telepathy-glib-0.24.2/0000755000175000017500000000000014006623343011513 500000000000000telepathy-glib-0.24.2/m4/0000755000175000017500000000000014006623342012032 500000000000000telepathy-glib-0.24.2/m4/gtk-doc.m40000644000175000017500000001066013762733206013560 00000000000000# -*- mode: autoconf -*- # # gtk-doc.m4 - configure macro to check for gtk-doc # Copyright (C) 2003 James Henstridge # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # As a special exception, the above copyright owner gives unlimited # permission to copy, distribute and modify the configure scripts that # are the output of Autoconf when processing the Macro. You need not # follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # serial 2 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) AC_MSG_CHECKING([for gtk-doc]) PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) AC_MSG_RESULT($have_gtk_doc) if test "$have_gtk_doc" = "no"; then AC_MSG_WARN([ You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found.]) fi dnl check for tools we added during development dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that dnl may not be writable by the user. Currently, automake requires that the dnl test name must end in '.test'. dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then AC_MSG_ERROR([ You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '[$]0'.]) fi dnl don't check for glib if we build glib if test "x$PACKAGE_NAME" != "xglib"; then dnl don't fail if someone does not have glib PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) fi dnl enable/disable output formats AC_ARG_ENABLE([gtk-doc-html], AS_HELP_STRING([--enable-gtk-doc-html], [build documentation in html format [[default=yes]]]),, [enable_gtk_doc_html=yes]) AC_ARG_ENABLE([gtk-doc-pdf], AS_HELP_STRING([--enable-gtk-doc-pdf], [build documentation in pdf format [[default=no]]]),, [enable_gtk_doc_pdf=no]) if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi AC_SUBST([AM_DEFAULT_VERBOSITY]) AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) ]) telepathy-glib-0.24.2/m4/compiler.m40000644000175000017500000000501712652510705014034 00000000000000# compiler.m4 - autoconf macros for compiler settings # # Copyright © 2005 Scott James Remnant . # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # COMPILER_WARNINGS # ---------------------- # Add configure option to enable additional compiler warnings and treat # them as errors. AC_DEFUN([COMPILER_WARNINGS], [AC_ARG_ENABLE(compiler-warnings, AS_HELP_STRING([--enable-compiler-warnings], [Enable additional compiler warnings]), [if test "x$enable_compiler_warnings" = "xyes"; then if test "x$GCC" = "xyes"; then CFLAGS="-Wall -Werror $CFLAGS" fi if test "x$GXX" = "xyes"; then CXXFLAGS="-Wall -Werror $CXXFLAGS" fi fi])dnl ])# COMPILER_WARNINGS # COMPILER_OPTIMISATIONS # --------------------------- # Add configure option to disable optimisations. AC_DEFUN([COMPILER_OPTIMISATIONS], [AC_ARG_ENABLE(compiler-optimisations, AS_HELP_STRING([--disable-compiler-optimisations], [Disable compiler optimisations]), [if test "x$enable_compiler_optimisations" = "xno"; then [CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"`] fi])dnl ])# COMPILER_OPTIMISATIONS # COMPILER_COVERAGE # ---------------------- # Add configure option to enable coverage data. AC_DEFUN([COMPILER_COVERAGE], [AC_ARG_ENABLE(compiler-coverage, AS_HELP_STRING([--enable-compiler-coverage], [Enable generation of coverage data]), [if test "x$enable_compiler_coverage" = "xyes"; then if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" fi fi])dnl ])# COMPILER_COVERAGE telepathy-glib-0.24.2/m4/libtool.m40000644000175000017500000112620014006601547013665 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$versuffix$shared_ext $libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS telepathy-glib-0.24.2/m4/ltversion.m40000644000175000017500000000127314006601547014247 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) telepathy-glib-0.24.2/m4/lt~obsolete.m40000644000175000017500000001377414006601547014605 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) telepathy-glib-0.24.2/m4/introspection.m40000644000175000017500000000661412652510705015126 00000000000000dnl -*- mode: autoconf -*- dnl Copyright 2009 Johan Dahlin dnl dnl This file is free software; the author(s) gives unlimited dnl permission to copy and/or distribute it, with or without dnl modifications, as long as this notice is preserved. dnl # serial 1 m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL], [ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([LT_INIT],[$0])dnl setup libtool first dnl enable/disable introspection m4_if([$2], [require], [dnl enable_introspection=yes ],[dnl AC_ARG_ENABLE(introspection, AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]], [Enable introspection for this build]),, [enable_introspection=auto]) ])dnl AC_MSG_CHECKING([for gobject-introspection]) dnl presence/version checking AS_CASE([$enable_introspection], [no], [dnl found_introspection="no (disabled, use --enable-introspection to enable)" ],dnl [yes],[dnl PKG_CHECK_EXISTS([gobject-introspection-1.0],, AC_MSG_ERROR([gobject-introspection-1.0 is not installed])) PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME])) ],dnl [auto],[dnl PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) ],dnl [dnl AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) ])dnl AC_MSG_RESULT([$found_introspection]) INTROSPECTION_SCANNER= INTROSPECTION_COMPILER= INTROSPECTION_GENERATE= INTROSPECTION_GIRDIR= INTROSPECTION_TYPELIBDIR= if test "x$found_introspection" = "xyes"; then INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection fi AC_SUBST(INTROSPECTION_SCANNER) AC_SUBST(INTROSPECTION_COMPILER) AC_SUBST(INTROSPECTION_GENERATE) AC_SUBST(INTROSPECTION_GIRDIR) AC_SUBST(INTROSPECTION_TYPELIBDIR) AC_SUBST(INTROSPECTION_CFLAGS) AC_SUBST(INTROSPECTION_LIBS) AC_SUBST(INTROSPECTION_MAKEFILE) AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes") ]) dnl Usage: dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version]) AC_DEFUN([GOBJECT_INTROSPECTION_CHECK], [ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1]) ]) dnl Usage: dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version]) AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE], [ _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require]) ]) telepathy-glib-0.24.2/m4/Makefile.am0000644000175000017500000000014412652510705014010 00000000000000EXTRA_DIST = \ compiler.m4 \ gtk-doc.m4 \ linker.m4 \ tp-compiler-flag.m4 \ tp-compiler-warnings.m4 telepathy-glib-0.24.2/m4/Makefile.in0000644000175000017500000003360714006601553014030 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXTRA_DIST = \ compiler.m4 \ gtk-doc.m4 \ linker.m4 \ tp-compiler-flag.m4 \ tp-compiler-warnings.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/m4/tp-compiler-flag.m40000644000175000017500000000217512652510705015366 00000000000000dnl A version of AS_COMPILER_FLAG that supports both C and C++. dnl Based on: dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given CFLAGS and CXXFLAGS. dnl dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise. AC_DEFUN([TP_COMPILER_FLAG], [ AC_MSG_CHECKING([to see if compiler understands $1]) save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS $1" CXXFLAGS="$CXXFLAGS $1" AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) dnl TP_ADD_COMPILER_FLAG(VARIABLE, CFLAGS) dnl Append CFLAGS to VARIABLE if the compiler supports them. AC_DEFUN([TP_ADD_COMPILER_FLAG], [ TP_COMPILER_FLAG([$2], [$1="[$]$1 $2"]) ]) telepathy-glib-0.24.2/m4/tp-linker-flag.m40000644000175000017500000000230712652510705015035 00000000000000dnl A version of AS_COMPILER_FLAG that supports linker flags dnl Based on: dnl as-compiler-flag.m4 0.1.0 dnl autostars m4 macro for detection of compiler flags dnl David Schleef dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $ dnl TP_LINKER_FLAG(LDFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED]) dnl Tries to compile with the given LDFLAGS. dnl dnl Runs ACTION-IF-ACCEPTED if the compiler/linker for the currently selected dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise. dnl dnl Note that LDFLAGS are passed to the linker via the compiler, so you dnl should check for -Wl,--no-add-needed rather than --no-add-needed. AC_DEFUN([TP_LINKER_FLAG], [ AC_MSG_CHECKING([to see if compiler/linker understand $1]) save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $1" AC_COMPILE_IFELSE(AC_LANG_SOURCE([]), [flag_ok=yes], [flag_ok=no]) LDFLAGS="$save_LDFLAGS" if test "X$flag_ok" = Xyes ; then $2 true else $3 true fi AC_MSG_RESULT([$flag_ok]) ]) dnl TP_ADD_LINKER_FLAG(VARIABLE, LDFLAGS) dnl Append LDFLAGS to VARIABLE if the linker supports them. AC_DEFUN([TP_ADD_LINKER_FLAG], [ TP_LINKER_FLAG([$2], [$1="[$]$1 $2"]) ]) telepathy-glib-0.24.2/m4/tp-compiler-warnings.m40000644000175000017500000000351012652510705016277 00000000000000dnl TP_COMPILER_WARNINGS(VARIABLE, WERROR_BY_DEFAULT, DESIRABLE, UNDESIRABLE) dnl $1 (VARIABLE): the variable to put flags into dnl $2 (WERROR_BY_DEFAULT): a command returning true if -Werror should be the dnl default dnl $3 (DESIRABLE): warning flags we want (e.g. all extra shadow) dnl $4 (UNDESIRABLE): warning flags we don't want (e.g. dnl missing-field-initializers unused-parameter) AC_DEFUN([TP_COMPILER_WARNINGS], [ AC_REQUIRE([AC_ARG_ENABLE])dnl AC_REQUIRE([AC_HELP_STRING])dnl AC_REQUIRE([TP_COMPILER_FLAG])dnl tp_warnings="" for tp_flag in $3; do TP_COMPILER_FLAG([-W$tp_flag], [tp_warnings="$tp_warnings -W$tp_flag"]) done tp_error_flags="-Werror" TP_COMPILER_FLAG([-Werror], [tp_werror=yes], [tp_werror=no]) for tp_flag in $4; do TP_COMPILER_FLAG([-Wno-$tp_flag], [tp_warnings="$tp_warnings -Wno-$tp_flag"]) dnl Yes, we do need to use both -Wno-foo and -Wno-error=foo. Simon says: dnl some warnings we explicitly don't want, like unused-parameter, but dnl they're in -Wall. when a distro using cdbs compiles us, we have: dnl -Werror -Wno-unused-parameter -Wall dnl ^ from us ^ from cdbs dnl which turns -Wunused-parameter back on, in effect TP_COMPILER_FLAG([-Wno-error=$tp_flag], [tp_error_flags="$tp_error_flags -Wno-error=$tp_flag"], [tp_werror=no]) done AC_ARG_ENABLE([Werror], AC_HELP_STRING([--disable-Werror], [compile without -Werror (normally enabled in development builds)]), tp_werror=$enableval, :) if test "x$tp_werror" = xyes && $2; then dnl We put -Wno-error=foo before -Wno-foo because clang interprets -Wall dnl -Werror -Wno-foo -Wno-error=foo as “make foo a non-fatal warning”, but does dnl what we want if you reverse them. $1="$tp_error_flags $tp_warnings" else $1="$tp_warnings" fi ]) telepathy-glib-0.24.2/m4/ltoptions.m40000644000175000017500000003426214006601547014261 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) telepathy-glib-0.24.2/m4/linker.m40000644000175000017500000000512212652510705013503 00000000000000# linker.m4 - autoconf macros for linker settings # # Copyright © 2005 Scott James Remnant . # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR # ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF # CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # LINKER_OPTIMISATIONS # -------------------- # Add configure option to disable linker optimisations. AC_DEFUN([LINKER_OPTIMISATIONS], [ AC_MSG_CHECKING([whether linker supports -Wl,-O1]) save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,-O1" AC_TRY_LINK([], [], [can_use_linker_opt=yes], [can_use_linker_opt=no]) AC_MSG_RESULT([$can_use_linker_opt]) if test "x$can_use_linker_opt" = "xno"; then LDFLAGS="$save_LDFLAGS" fi AC_ARG_ENABLE(linker-optimisations, AS_HELP_STRING([--disable-linker-optimisations], [Disable linker optimisations]), [if test "x$enable_linker_optimisations" = "xno"; then [LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O[0-9]*\b//g"`] fi], [])dnl ])# LINKER_OPTIMISATIONS # LINKER_VERSION_SCRIPT # -------------------------- # Detect whether the linker supports version scripts AC_DEFUN([LINKER_VERSION_SCRIPT], [AC_MSG_CHECKING([for linker version script argument]) for aranha_try_arg in "-Wl,--version-script"; do aranha_old_libs="$LIBS" LIBS="$LIBS $aranha_try_arg=conftest.ver" cat >conftest.ver < 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) telepathy-glib-0.24.2/NEWS0000644000175000017500000031141114006542652012136 00000000000000telepathy-glib 0.24.2 (2021-02-03) ================================== The "Ages Later" release. Enhancements: • Port build tools to Python 3 (Alexey Andreyev) • Update and fix tests for Python 3 (Jakub Kulík) Fixes: • stop hardcoding python's path in .py scripts (fd.o #76495, Guillaume) • fixed some code issues discovered by compiling with clang (fd.o #79006, Guillaume) • replaced tp_verify_* with G_STATIC_ASSERTs, fixing the build with more recent gtk-doc (Simon) • autogen.sh: run gtkdocize from $srcdir in out-of-source builds (fd.o #94391, Philip Withnall) • tests: fix build failure with glib >= 2.46 due to duplicate test paths (fd.o #92245, George Kiagiadakis) • tests: Fix a service file path to fix the build with installed tests (fd.o #90991, Philip Withnall) • call-channel: fix a memory leak (Fabrice Bellet) • debug-sender: fix messages queue locking (Fabrice Bellet) • TpBasePasswordChannel: fix gtk-doc comment for finished signal (Ting-Wei Lan) • protocol: fix a memory leak (Ivaylo Dimitrov) • Fix a crash when creating a conference call (Martin Jones) telepathy-glib 0.24.1 (2014-08-25) ================================== Fixes: • base-client: fix potential uninitialized variable bug (Guillaume) • Fix a potential crash in contact-list example (fd.o #79006, Guillaume) telepathy-glib 0.24.0 (2014-03-26) ================================== The “space Tolkien” release. Fixes since 0.23.3: • don't leak every D-Bus method call result, a regression in 0.23.1 (Simon) telepathy-glib 0.23.3 (2014-03-18) ================================== This is the release candidate for the future 0.24.0 stable release. Enhancements: • TpProtocol gained API to access to its immutable properties as a GVariant. (fd.o #55108, Guillaume) • TpCallStream and TpCallContent now inherit the factory from their TpCallChannel. (fd.o #76168, Guillaume) Fixes: • fix a memory leak when cleaning up TpProxy "prepare" requests (fd.o #76000, Simon) • fix a memory leak for paths to contacts' avatar data (fd.o #76000, Simon) • fix crashes in TpFileTransferChannel with GLib 2.39 (fd.o #72319, Xavier) • fix some paths memory leaks (fd.o #76119, Guillaume) • tp_list_connection_managers_async() now terminates properly if there is no CM installed. (fd.o #68892, Guillaume) telepathy-glib 0.23.2 (2014-02-26) ================================== Enhancements: • TpBaseConnection now has an "account-path-suffix" property (fd.o #74030, Xavier) • New high level TpAccountChannelRequest API, including tubes, Conference and SMSChannel. (fd.o #75450, Guillaume) • 'TargetHandleType: None' is now automatically added when requesting a channel with TpAccountChannelRequest if no handle type has been defined. (fd.o #75450, Guillaume) telepathy-glib 0.23.1 (2014-02-04) ================================== The “undead space elves” release. Dependencies: • GLib 2.36 or later is required Deprecations: • TpPresenceMixin: optional arguments are deprecated, apart from a string named "message". This matches our current D-Bus API. Enhancements: • tp_protocol_normalize_contact_async(), tp_protocol_identify_account_async(), and high-level API for the Protocol Addressing and Presence interfaces (fd.o #71048, Simon) • More accessors for TpPresenceStatusSpec, which is now a boxed type (fd.o #71048, Simon) • tp_connection_manager_param_dup_variant_type() (fd.o #71093, Simon) • Better debug output (fd.o #68390, #71048; Simon) Fixes: • In the examples, specifically ask for "TelepathyGlib-0.12" (this API version), not Telepathy 1.0 (fd.o #49737, Simon) • Improve tests' isolation from the real session bus (Xavier) • Fix a critical warning for each new connection under GLib 2.39 (fd.o #72303, Xavier) • Fix some possible crashes in file transfer channels, particularly under GLib 2.39 (fd.o #72319, Xavier) • Correct tp_account_request_set_avatar documentation (Xavier) • Fix a TpConnection reference-leak in TpBaseClient (Guillaume) telepathy-glib 0.23.0 (2013-10-28) ================================== We no longer guarantee compatible upgrades within a development (odd) branch, see README for details. Dependencies: • GLib 2.34 or later is required. Enhancements: • Spec 0.27.3 · added Conn.I.Sidecars1 · added Conn.I.Renaming · added CD.I.Messages1 • TpAccount::avatar-changed signal (fd.o #52938, Guillaume) • tp_value_array_free: equivalent of g_value_array_free but does not provoke deprecation warnings from GLib (fd.o #69849, Simon) • tp_account_is_prepared and tp_account_manager_is_prepared are now deprecated (Guillaume) Fixes: • tp_contact_set_attributes: don't warn on genuinely absent interfaces (fd.o #68149, Simon) • channel-group: don't crash if no message has been provided (Guillaume) telepathy-glib 0.22.0 (2013-10-02) ================================== The “don't starve” release. This is a new stable branch, recommended for use with GNOME 3.10. Fixes since 0.21.2: • When an avatar is downloaded, announce the change to the avatar token immediately; if the avatar changes from A to B while we're still doing the asynchronous file saving, don't set A as the new avatar when it has been saved. Regression in 0.21.2. (fd.o #70010, Simon) • Don't crash if the AccountManager returns an incorrect type for the Avatar (fd.o #69849, Simon) Significant changes since the previous stable branch, 0.20.x: • tp_connection_get_self_contact() now returns NULL if the contact's connection has been invalidated, in order to break a reference cycle • Avatars are saved to the cache asynchronously • TpBaseConnection implements SelfID, SelfContactChanged according to telepathy-spec 0.27.2 • TpAccount:uri-schemes property, with change notification requiring Mission Control 5.15+ telepathy-glib 0.21.2 (2013-09-24) ================================== The “always another thing” release. Enhancements: • Writing avatars into cache now uses asynchronous I/O. (fd.o #63402; Luca Versari, Chandni Verma, Simon McVittie) • telepathy-spec 0.27.2 · add SelfID, SelfContactChanged • tp_dbus_properties_mixin_dup_all() is now public (fd.o #69283, Simon) • TpBaseProtocol now lists Presence.Statuses as an immutable property. (fd.o #69520, Guillaume) • TpBaseConnection: Implement SelfID and SelfContactChanged as defined in spec 0.27.2. (Xavier) • The inspect-cm example now inspects all CMs if run without arguments (fd.o #68390, Simon) Fixes: • Don't crash if GetContactInfo() fails (fd.o #46430, Guillaume) • Fix a race condition that could result in telepathy-haze protocol support not being detected (fd.o #67183, Simon) • Fix documentation for tp_connection_get_self_handle (Emilio) • Make TpHeap work correctly with GComparator functions that return values outside {-1, 0, 1} (fd.o #68932, Debarshi Ray) • Examples have been updated to use more recent API (Simon) • Better debug-logging (fd.o #68390, Simon) telepathy-glib 0.21.1 (2013-06-20) ================================== The “imperative tense” release. Fixes: • Fix a wrong introspection annotation on tp_debug_client_get_messages_finish() that would lead to use-after-free (fd.o #65518, Simon) • Isolate regression tests better (fd.o #63119, Simon) • Explicitly annotate tp_account_update_parameters_finish()'s 'unset_parameters' argument to be a NULL-terminated string array. It was previously incorrectly inferred to be a string, for some reason. (wjt) • Always flag delivery reports with Non_Text_Content. (fd.o #61254, wjt) • Don't announce legacy Group channels twice (fd.o #52011; Jonny, Simon) • Don't crash if a broken connection manager signals a TLSCertificate with no CertificateChainData, just invalidate the channel (fd.o #61616, Guillaume) • Adjust regression tests so we can distcheck under Automake 1.13, and various other build-system updates (fd.o #65517, Simon) telepathy-glib 0.21.0 (2013-04-03) ================================== The "if only it was JS code" release. This starts a new development branch. Enhancements: • Code-generation now copes with ${PYTHON} being set to Python 3 (e.g. "./configure PYTHON=python3" on Debian); Python 2 remains fully supported (fd.o #56758, Simon) • Add uri-schemes property on TpAccount, with notify::uri-schemes emitted if using a recent AcountManager like Mission Control 5.15 or later (Guillaume) Fixes: • Remove the pkg-config dependency from .pc files (Will) • In TpSimpleClientFactory, don't crash when ensuring a contact for an obsolete connection manager without "immortal handles" fails (Maksim Melnikau) • Add missing (element-type) introspection annotations to tp_capabilities_get_channel_classes, tp_asv_get_bytes and tp_client_channel_factory_dup_channel_features (fd.o #58851, Philip Withnall) • Don't emit the NewChannels signal twice for the obsolete ContactList GROUP channels (fd.o #52011, Simon) • Fix builds with Automake 1.13 (fd.o #59604, Nuno Araujo) • Fix unit tests when running with glib >=2.36 (fd.o #63069, Xavier) • Fix refcycle preventing TpConnection objects to be freed. This theoretically introduce a behaviour change of tp_connection_get_self_contact() that now returns NULL when the connection as been invalidated. (fd.o #63027, Xavier) Deprecations: • tp_g_key_file_get_int64, tp_g_key_file_get_uint64 (use the corresponding functions from GLib ≥ 2.26) telepathy-glib 0.20.1 (2012-11-09) ================================== The "world's slowest ticket machines" release. Fixes: • In Call channels, ignore state transitions where the state did not actually change (fd.o #56044, Debarshi Ray) • Process the SelfHandleChanged signal for non-obsolete connection managers (fd.o #55666, Simon) telepathy-glib 0.20.0 (2012-10-03) ================================== The "why not indeed" release. This starts a new stable branch, recommended for use with GNOME 3.6. Summary of changes since the last stable branch, 0.18: • GLib 2.32 or later is required. • Many old things are now deprecated. New TP_VERSION_MIN_REQUIRED and TP_VERSION_MAX_ALLOWED macros are provided for deprecation control: they work like the ones in GLib 2.32. • Many functions that expected or returned dbus-glib parameterized types are now deprecated, and have an equivalent GVariant-based function which should be used instead. • The only headers you should #include are , and . Including anything else is deprecated. • All TpChannel APIs using contact TpHandle have been deprecated in favor of their TpContact variants. • TpRoomList and TpRoomInfo: high level API to list rooms on a server. • TpDebugClient: high level API to retrieve logs from Telepathy components. • TpTLSCertificate: TpProxy subclass representing a TLS certificate • TpAccountRequest: object to help account creation • TpSimpleClientFactory gained API to prepare TpContact objects with the features set on it. • Add tp_vardict_get_uint32() etc., analogous to tp_asv_get_uint32() etc. • The configure flags --disable-coding-style-checks, --disable-doc-checks and part of --disable-Werror have been superseded by --disable-fatal-warning There were no code changes since 0.19.10. telepathy-glib 0.19.10 (2012-09-26) =================================== The “Why not 0.20.0?” release. This is the release candidate for the future 0.20.0 stable release. Enhancements: • Add tp_vardict_get_uint32() etc., analogous to tp_asv_get_uint32() etc. (Xavier) • tp_channel_dispatch_operation_get_channels() is now introspected (fd.o #55102, Simon) • Add tp_vardict_get_*() helper functions to lookup values in a GVariant of type %G_VARIANT_TYPE_VARDICT (Xavier) • Add tp_variant_convert() and tp_variant_type_classify() to manipulate and convert GVariant (Xavier) A bunch of GVariant oriented API have been added as an alternative of their GValue equivalent: • tp_{dbus,stream}_tube_channel_dup_parameters_vardict() (fd.o #55024, Chandni Verma) • tp_message_set_variant() and tp_message_dup_part() (fd.o #55096, Simon) • tp_account_channel_request_dup_request(), • tp_account_channel_request_new_vardict(), tp_channel_request_dup_immutable_properties(), tp_channel_request_dup_hints(), tp_account_channel_request_set_hints() and TpAccountChannelRequest:request-vardict property (fd.o #55099, Simon) • tp_g_socket_address_from_g_variant() and tp_address_g_variant_from_g_socket_address() (fd.o #55101, Simon) • TpDBusTubeChannel:parameters-vardict and TpStreamTubeCha:parameters-vardict properties (fd.o #55024, Simon) • tp_contact_dup_location() and TpContact:location-vardict property (fd.o#55095, Simon) • tp_base_client_add_{observer,approver,handler}_filter_vardict (fd.o #55100, Simon) telepathy-glib 0.19.9 (2012-09-11) ================================== Deprecations: • Various functions whose names include _borrow_, such as tp_proxy_borrow_interface_by_id() and tp_channel_borrow_immutable_properties(), are deprecated. Use the corresponding function with _get_ or _dup_ in its name, such as tp_proxy_get_interface_by_id() or tp_channel_dup_immutable_properties(), instead. (Xavier) • Various functions returning a (transfer container) list, such as tp_text_channel_get_pending_messages(), are deprecated. Use the corresponding function with _dup_ in its name, such as tp_text_channel_dup_pending_messages(), instead. (Xavier) • tp_handle_set/get_qdata() are now deprecated. Handles are immortal so using them would leak the data until Connection gets disconnected. • tp_channel_request_new() and tp_channel_dispatch_operation_new() constructors are now deprecated. Applications should not need them since they are created internaly in TpBaseClient. Enhancements: • Some functions from util.h, such as tp_utf8_make_valid(), tp_escape_as_identifier() and user-action-time functions are now available via gobject-introspection (fd.o #54543, Simon) Fixes: • Get the remote contact from a MediaDescription correctly (fd.o #54425, Sjoerd) • Fix an incorrect error on UpdateLocalMediaDescription (Sjoerd) • Fix use of an unterminated string in the tls-certificates test (Sjoerd) • Fix service-side codegen using single includes, which prevents extensions to build with TP_DISABLE_SINGLE_INCLUDE. telepathy-glib 0.19.8 (2012-08-31) ================================== Enhancements: • New introspectable function tp_account_channel_request_set_hint() to add hints one by one. (Sjoerd) Fixes: • Set the ChannelRequests immutable properties when observing/handling channels. (Sjoerd) telepathy-glib 0.19.7 (2012-08-27) ================================== Enhancements: • Add API to TpBaseChannel to allow it to disappear and reappear from the bus without disposing the object. (fd.o#48210, Jonny) Fixes: • In tp_account_dup_storage_identifier_variant, don't fail if there is no storage identifier (fd.o #53201, Guillaume) • Remove duplicate TpBaseConnection typedef, fixing compilation with pre-C11 compilers like gcc < 4.6 (fd.o #53100, Simon) • Use AS_CASE instead of case/esac, and AS_IF instead of if/then/[else/]fi in configure.ac, as they are safer and guaranteed to work (fd.o#681413, Simon) telepathy-glib 0.19.6 (2012-08-06) ================================== Enhancements: • Add tp_account_manager_can_set_default() (Guillaume) Fixes: • Fix generation of reentrant-methods.list in highly parallel builds (fd.o #52480, Ross Burton) • TpBaseChannel: assert that the subclass sets TargetHandleType. (Will) telepathy-glib 0.19.5 (2012-07-24) ================================== Fixes: • fdo#52441 - fix warning when preparing blocked contacts before TP_CONNECTION_FEATURE_CONNECTED is officially prepared. • TpAccountManager: set the requested presence on newly created accounts telepathy-glib 0.19.4 (2012-07-19) ================================== The “#hellopaul” release. Enhancements: • TpBaseConnectionManager, TpBaseConnection and TpBaseProtocol: add virtual methods to get interfaces. (Jonny) • Add tp_account_request_set_storage_provider(). (Guillaume) Fixes: • base-connection: return from RequestHandles if called with no names. (Jonny) • TpAccountRequest: add missing 'service' property getter. (Guillaume) telepathy-glib 0.19.3 (2012-07-05) ================================== Deprecations: • tp_account_new(), tp_connection_new() and tp_*_channel_new() have been deprecated. Those proxies should be created using corresponding TpSimpleClientFactory APIs. (Xavier) • TpAccount, TpConnection and TpConnectionManager: deprecate "connection-manager" and "protocol" properties and replace them by "cm-name" and "protocol-name" to be more consistent. Ditto for their getters. (Xavier) Fixes: • fdo#51444 - Crash in TpBaseClient (Xavier) telepathy-glib 0.19.2 (2012-06-28) ================================== Enhancements: • TpDynamicHandleRepo can now have an asynchronous ID normalization function. That function can be set by Connection Manager wishing to do network rountrip to normalize an ID. (Xavier) Fixes: • fdo#51250 - tp_debug_client_get_messages_async: error is not propagated (Guillaume) telepathy-glib 0.19.1 (2012-06-06) ================================== Dependencies: • Valac ≥ 0.16.0 is now required for the Vala bindings. Deprecations: • TpHandle reference count related APIs have been deprecated. - The CM-side APIs tp_handle(s)_ref/unref() and tp_handle(s)_client_hold/release() were already no-op since immortal handles. - The Client-side APIs tp_connection_hold/unref_handles() are not needed with CMs having immortal handles. Others CM are considered legacy, clients wanting to keep support for them should continue using those deprecated APIs (Notably Empathy already dropped support for them since version 3.4). (Xavier) • Contact attributes APIs have been deprecated. It is considered an internal implementation detail for TpContact that clients doesn't need to care about. tp_connection_get_contact(_list)_attributes(). (Xavier) • tp_connection_request_handles() has been deprecated because higher level APIs now make it useless. If handle_type is TP_HANDLE_TYPE_CONTACT, use tp_connection_dup_contact_by_id_async() instead. For channel requests, use tp_account_channel_request_set_target_id() instead. (Xavier) • tp_channel_manager_emit_new_channels() has been deprecated, emitting multiple channels at once is discouraged because it makes client-side code more complicated for no good reason. (Jonny) • tp_connection_parse_object_path() has been deprecated because the connection's object-path is already parsed internaly and exposed via tp_connection_get_connection_manager_name() and tp_connection_get_protocol_name(). (Xavier) • tp_account_parse_object_path() has been deprecated because the account's object-path is already parsed internaly and exposed via tp_account_get_connection_manager() and tp_account_get_protocol(). (Xavier) • tp_account_ensure_connection() has been deprecated. Its purpose was to share a common TpConnection object between TpBaseClient and TpAccount. Now proxy uniqueness is guaranteed by TpSimpleClientFactory. (Xavier) • Struct members of TpProxy, TpConnectionManagerParam, TpConnectionManager and TpBaseConnection have been sealed. In the same spirit than G_SEAL, we introduced _TP_SEAL to force usage of getters and setters. (Simon) • Including individual headers is now deprecated. Only the teleapthy-glib.h and telepathy-glib-dbus.h meta headers should be included in applications. Build error is disabled by default and can be turned on by defining TP_DISABLE_SINGLE_INCLUDE. (Xavier) • tp_list_connection_managers() has been deprecated in favor of tp_list_connection_managers_async() and tp_list_connection_managers_finish(). (Simon) • TpConnectionManagerProtocol and all its related functions have been deprecated in favor of TpProtocol. (Simon) Enhancements: • New TpAccountRequest object to help account creation (Jonny) • TpSimpleClientFactory gained API to prepare TpContact objects with the features set on it. tp_simple_client_factory_upgrade_contacts_async() is convenience API for tp_connection_upgrade_contacts_async(). tp_simple_client_factory_ensure_contact_by_id_async() is convenience API for tp_connection_dup_contact_by_id_async(). (Xavier) • tp_simple/automatic_client_factory_new() now accept NULL TpDBusDaemon arg. tp_dbus_daemon_dup() will be used internaly in that case. (Xavier) Fixes: • Fixed possible case where TP_CONTACT_FEATURE_AVATAR_DATA does not get prepared. (Xavier) • Fix Vala bindings build when srcdir is different from builddir. (fdo#49802, Colin) telepathy-glib 0.19.0 (2012-05-09) ================================== Dependencies: • GLib ≥ 2.32, as released with GNOME 3.4, is now required. Deprecations: • Deprecations are now versioned. telepathy-glib users can define TP_VERSION_MIN_REQUIRED and/or TP_VERSION_MAX_ALLOWED, which work like the corresponding macros in GLib 2.32. (Simon) • All TpChannel APIs using contact TpHandle have been deprecated in favor of their TpContact variants. Note that replacement APIs are only guaranteed to work with Connection Managers implementing spec >= 0.23.4. Any CMs using telepathy-glib's TpGroupMixin for implementing the channel's group iface are fine. (Xavier) • TpTextMixin is (officially) deprecated, use TpMessageMixin. (Xavier) • TpIntsetIter is deprecated, use TpIntsetFastIter. The typedefs TpIntSetIter and TpIntSetFastIter are also deprecated. (Simon) • TP_ERRORS has officially been deprecated since 0.11; it now produces deprecation warnings too. (Simon) • Reimplementation of the RequestHandles method is deprecated. (Simon) • tp_connection_get_contacts_by_id is deprecated and replaced by tp_connection_dup_contact_by_id_async, for proper GAsyncResult API, and is now for single identifier to simplify most common use case. (fd.o #27687 and #30874, Xavier) • tp_connection_get_contacts_by_handle() is deprecated with no replacement. It is deprecated to create a TpContact without knowing both its id and handle. (fd.o #27687 and #30874, Xavier) • tp_connection_upgrade_contacts is deprecated and replaced by tp_connection_upgrade_contacts_async, for proper GAsyncResult API. Note that the connection must implement the Contacts interface to use this new API. (fd.o #27687 and #30874, Xavier) • TP_CHANNEL_FEATURE_CHAT_STATES and its corresponding APIs are deprecated and replaced by similar API on TpTextChannel. Enhancements: • now includes all non-generated code except proxy-subclass.h. Please use it instead of individual headers - direct inclusion of most individual headers will become an error in future versions, as was done for GLib. (Simon) • A new meta-header, , now includes all generated code. Please include it in any file that uses tp_svc_*, tp_cli_*, TP_IFACE_*, TP_HASH_TYPE_*, TP_STRUCT_TYPE_* or TP_ARRAY_TYPE_*. In telepathy-glib 1.0, it will become a separate pkg-config module. (Simon) • Replace --disable-coding-style-checks and --disable-doc-checks with --disable-fatal-warnings. In addition to what the removed options did, it changes the default for --disable-Werror and turns off g-ir-scanner warnings. In future releases, it might control additional "warnings are treated as errors" options. Developers can also use --enable-fatal-warnings to force all of these on, even in official releases. (Simon) • Add TpRoomList and TpRoomInfo (fd.o #30338, Guillaume) • Add TpDebugClient (fd.o #23344; Will, Guillaume) • Add tp_account_channel_request_new_text(), tp_account_channel_request_new_audio_call(), tp_account_channel_request_set_target_contact() etc., which do not require the caller to know D-Bus property names (fd.o #48780, Simon) • Add tp_connection_dup_detailed_error_vardict(), tp_base_connection_disconnect_with_dbus_error_vardict(), tp_connection_manager_param_dup_default_variant(), tp_capabilities_dup_channel_classes_variant() which use/return GVariants instead of dbus-glib parameterized types (Simon, Guillaume) • Add a simple PyGtk3 dialler to the examples, and optionally install the Python examples as well as the C ones (fd.o #48504, Simon) • Add tp_contact_get_account() (Xavier) • Improve documentation (Jonny, Simon, Xavier) • Add "clean-for-new-branch" Makefile target which is more thorough than clean, but less thorough than distclean (in particular, it doesn't forget your ./configure options) (Simon) • Add TpTLSCertificate, a TpProxy subclass representing a TLS certificate (fdo #30460, Guillaume) • TpMessageMixin now has helpers to implement the ChatState interface. Fixes: • Make it safe to hold refs to a remaining GAsyncResult after returning to the main loop (fd.o #45554, Simon) • When a TpProxy method call returns, which can occasionally be synchronous, use an idle to finish the corresponding GAsyncResult (fd.o #45514, Simon) • Add TP_NUM_DBUS_ERRORS (etc.) to supersede NUM_TP_DBUS_ERRORS (etc.) (fd.o #46470, Simon) • Make several methods returning a GStrv introspectable (fd.o #46471, Simon) • Retry preparation of features that depended on a missing connection interface after the connection connects, in the hope that the interface has now become available (fd.o #42981, Guillaume) • Interpret capabilities more strictly, avoiding falsely saying we support channel requests with fixed properties we don't understand (Xavier) telepathy-glib 0.18.1 (2012-04-20) ================================== The “King's Cross is unrecognisable” release. Enhancements: • Make various methods of the form get_foo() available to gobject-introspection (Xavier) • Improve stream tube examples (Guillaume) • Improve documentation (Xavier) Fixes: • Change the type of TpStreamTubeConnection::closed's argument from POINTER to ERROR so PyGI can bind it (Guillaume) • Avoid TpCallChannel potentially returning a TpContact with no identifier (Xavier) • Use the right macro to avoid post-2.30 GLib APIs (Guillaume) • Fix warnings with newer gtk-doc and g-ir-scanner (fd.o #48592, fd.o #48363, fd.o #48620; Stef Walter, Alban Browaeys) • Make various warnings non-fatal for this stable branch: GIR scanner warnings, documentation completeness, and deprecated functions (fd.o #48363, Simon) • Don't hard-code use of a particular abstract socket in dbus-tube-chan test, fixing test failure on non-Linux (fd.o #48600, Simon) telepathy-glib 0.18.0 (2012-04-02) ================================== This is the start of a new stable branch. We encourage those shipping GNOME 3.4 to track this stable branch. Changes since 0.17.7: • Support the DownloadAtConnection property in TpBaseContactList. (Alban) • Add high-level API for TpDBusTubeChannel classes. (fd.o#29271, Guillaume and Will) • Various improvements to the ContactList test suite. (Xavier) Summary of particularly noteworthy changes since 0.16.x: • GLib ≥ 2.30, dbus-glib ≥ 0.90, gobject-introspection ≥ 1.30, and valac ≥ 0.14 are now required. • TpCallChannel, TpBaseCallChannel, and other Call-related high-level API has been added. • High-level API to accept and provide file transfers has been added. • Building on Android using 'androgenizer' is now supported. telepathy-glib 0.17.7 (2012-03-22) ================================== API additions: • …get_local_sending on TpBaseMediaCallStream exposes the local sending state. (Olivier) • TpCallStateReason structure now has a message string member. (Olivier) Fixes: • TpBaseMediaCallContent: be sure to update the local sending state on call acceptance. (Olivier) • A few miscellaneous fixes to the Call1 code, including: • ensuring local sending state is updated on call acceptance, • ignoring sending/receiving failures while held, • only emitting STUNServersChanged when they have actually changed, • and not waiting for streams to start again after holding if they weren't sending before. (Olivier) Enhancements: • Use close_channels_async on the channel dispatch operation in the example approver. (Will) telepathy-glib 0.17.6 (19/03/2012) ================================== Requirements: • GLib >= 2.30 is now required for telepathy-glib, and for code generated by tools copied from this version. • dbus-glib >= 0.90 is now required. Deprecations: • tp_connection_is_ready(), tp_connection_call_when_ready, TpConnection:connection-ready and the TpChannel and TpConnectionManager equivalents are deprecated. Use tp_proxy_prepare_async() and tp_proxy_is_ready() instead. For connections, remember to ask for TP_CONNECTION_FEATURE_CONNECTED if required. Enhancements: • TpCapabilities: add API to check for Call and FileTransfer support (Xavier) • Use GObject's FFI-based generic marshaller instead of generating our own marshallers (fd.o #46523, Simon) • Add tp_list_connection_managers_async, tp_protocol_dup_params, tp_protocol_dup_param, tp_protocol_borrow_params, tp_connection_manager_dup_protocols (Simon) • Add accessors for TpAccount properties, parameters and storage identifier represented as a GVariant (fd.o #30422, Simon) • TpCallChannel: add API to put the call on hold. (Olivier) • TpCallContentMediaDescription now implements the RTPHeaderExtensions, RTCPFeedback and RTCPExtendedReports interfaces. (Olivier) Fixes: • Don't change the direction of Call streams because of a Hold (Olivier) • Use the right error when rejecting incompatible codecs (Olivier) • Reject local updates to a media description while an offer is pending (Olivier) • Avoid forward-declaring Call classes, fixing compilation on clang, older gcc, and other compilers not targeting C1x (Simon) • Fix namespaces in example_call.manager (George) • Produce self-contained header files from glib-interfaces-gen.py (fd.o #46835, Simon) • Correctly implement and document tp_call_channel_has_dtmf() (Xavier) • Fix various build failures in out-of-tree or parallel builds, and don't rebuild everything whenever the documentation changes (fd.o #36398, Simon) • Improve test coverage for the connection manager test (fd.o #46358, Simon) • TpCallChannel::state-changed is properly annotate (fdo.o #47410 Guillaume) telepathy-glib 0.17.5 (2012-02-20) ================================== The “I have no privates but I have a heart!” release. Enhancements: • telepathy-spec 0.25.2: · the Call1 family of interfaces · Conn.I.Addressing1 · Chan.I.CaptchaAuthentication1 · Account.Supersedes • Add TpCallChannel, TpBaseCallChannel and other Call-related high-level API. (A team effort involving Olivier, Xavier, Danielle, Sjoerd, Will, Nicolas, Jonny, David and possibly others) • tp_account_manager_get_most_available_presence() now returns (AVAILABLE, "available, "") if the only connected accounts does not implement SimplePresence. (Guillaume) • Add tp_base_channel_get_self_handle(). (Xavier) • TpBaseChannel now has a virtual get_interfaces() method. (Danielle) • tp_connection_disconnect_async: high level API to disconnect a TpConnection. (Simon) • tp_unix_connection_receive_credentials_with_byte() and tp_unix_connection_send_credentials_with_byte() now have async equivalents. (Xavier) • Produce DLL files when compiled for Windows. (Siraj) Fixes: • fd.o #45554: fix use-after-free if various async results are kept until after the callback has returned, which is considered valid. (Simon) • tp_account_manager_get_most_available_presence() now returns ("offline, "") as status and message if no account is connected, as stated in the doc, instead of (NULL, NULL). (Guillaume) • TpChannel: fix a crash when preparing contacts. (Xavier) • fdo.o #45982: fix a crash in TpBaseContactList when using RenameGroup()'s fallback code. (Guillaume) telepathy-glib 0.17.4 (2011-12-19) ================================== Fixes: • Set the right source on tp_account_set_uri_scheme_association_async's GAsyncResult. (Guillaume) • fdo#43755: Fix a crash when participating in a XMPP MUC containing members with an unknown real JID. (Guillaume) telepathy-glib 0.17.3 (2011-11-28) ================================== I DON'T ALWAYS WRITE NEWS //////// / _ _ + / • . • | | ,~~~, | \ #---# / ####### BUT WHEN I DO, THE COMMUNITY DEVOURS IT Dependencies: • gobject-introspection ≥ 1.30 • Valac ≥ 0.14.0 is now required for the Vala bindings. Fixes: • Fix a crash in TpSimplePasswordManager (Mikhail) Enhancements: • Add high level API to check if a connection supports settings aliases on contacts. (Guillaume) telepathy-glib 0.17.2 (2011-11-23) ================================== The “maple syrup bread” release. Enhancements: • TpBaseProtocol now supports the freshly-undrafted Protocol.Interface.Addressing from spec 0.25.1. (Eitan, Andre) • Building on Android using 'androgenizer' is now supported (Derek Foreman) Fixes: • Speculatively replace _free/_destroy with _unref everywhere, and add a coding style check. (Xavier) • Ensure GSocketConnection objects are properly closed and freed for incoming TpFileTransferChannels. (Jonathan) • Many documentation nits have been fixed. (Jonathan) • Building the GObject-Introspection repository now works reliably when using `make -j`. (Will) telepathy-glib 0.17.1 (2011-11-15) ================================== Dependencies: • gobject-introspection ≥ 1.30 is now required. • valac ≥ 0.14 is now required. Enhancements: • telepathy-glib now generates code for spec version 0.25.0. • fdo #39188: add high level API to accept and provide file transfers. (morten, jonny) telepathy-glib 0.17.0 (2011-11-08) ================================== The “Perrier-cassis” release. This is the start of a new development branch that will lead to 0.18 in roughly 6 months. This release contains all the fixes from 0.16.2. Enhancements: • fdo #41801: add high level API to block/unblock contacts. (Guillaume) • fdo #42546: add TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES a feature preparing ContactList's properties without preparing the contact list itself. (Guillaume) • fdo #42503: the TpChannelDispatchOperation passed to TpBaseClientClassObserveChannelsImpl is now prepared. (Xavier) • fdo #41455: it's now possible to install tp-glib's test suite. (albanc) telepathy-glib 0.16.2 (2011-11-08) ================================== The “destructive substance” release. Fixes: • Improve documentation of the TpProxy::invalidated signal. (Danni) • fdo#42305: TpGroupMixin: always set the Members_Changed_Detailed flag. (Guillaume) • fdo#42670: fix a crash when preparing TP_CHANNEL_FEATURE_CONTACTS on a channel containing contacts without known owners. (Guillaume) telepathy-glib 0.16.1 (2011-10-24) ================================== Fixes: • fd.o#42063: circular introspection dependency between connection and contacts. (Sjoerd) • fd.o#42049: TpBaseContactList now implements TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED. (Guillaume) • fd.o#41928: Don't crash if the owner of some members of a TpChannel are unknown. (Guillaume) • fd.o#41929: Don't crash if a TpTextChannel receives a message not having a sender. (Guillaume) telepathy-glib 0.16.0 (2011-10-14) ================================== The “irrelevant details” release. This is the start of a new stable branch (which will be spoken of by robot historians of the future in hushed, reverent voices). We encourage those shipping Gnome 3.2 to track this stable branch. Fixes since 0.15.9: • fd.o#41729: TpChannel now trusts the ChannelType property included in the dictionary of immutable properties passed to its constructor. Practically speaking, this resolves a race condition where channels would sometimes fail to prepare (and hence, conversation windows would fail to open). (Guillaume) • fd.o#41714: TpAccount:normalized-name now refers to XMPP JIDs and ICQ UINs, to give examples of what its value means. Summary of particularly noteworthy changes since 0.14.x: • telepathy-glib depends on GLib 2.28.0; • Applications can now define their own features on TpProxy subclasses, and can create their own proxy factory classes to automatically create their own proxy subclasses. • There's a bunch of new API to make it easier to work with channels, particularly text channels and TpContacts affiliated with channels. • There is now API on TpConnection for managing the user's contact list, at long last! Note that this currently doesn't work with telepathy-butterfly and telepathy-sunshine, since they do not implement the new, dramatically simpler ContactList D-Bus API. telepathy-glib 0.15.9 (2011-10-12) ================================== The “important lessons of the past” release. This will teach me to make releases without checking nothing more's been merged overnight. Fixes: . fd.o#41697: unknown handle owners in chat rooms no longer crashes TpChannel. (Guillaume) telepathy-glib 0.15.8 (2011-10-12) ================================== The “fretting about the now” release. Enhancements: • telepathy-glib now generates code for spec version 0.24.0, including the Room, Subject and RoomConfig interfaces. It also includes a new TpBaseRoomConfig object, which vaguely resembles the good bits of TpPropertiesMixin. (The latter is not deprecated yet, but just you wait…) • It is now possible to set D-Bus properties as if in response to a call to Set() on the bus, using tp_dbus_properties_mixin_set(). This complements the existing tp_dbus_properties_mixin_get() method, and makes it possible to fix fd.o#32416. Fixes: • fd.o#41470: crash in some situations when using TP_CHANNEL_FEATURE_CONTACTS. This was specifically triggered by test-cli-group as of the last release. telepathy-glib 0.15.7 (2011-10-04) ================================== Fixes: • fd.o#40555: Memory leaks in TpConnection and protocol.c (Vivek) • Memory leak if the debug message cache is disabled (Vivek) • fd.o#38060: Fix a crash in TpMessageMixin, triggered by delivery reports. (Danni) • fd.o#38997: Cope beter if UNIX sockets are not supported. (Guillaume) • fd.o#40523: Connection Manager crash when a client acks the same message twice. (Will) • fd.o#41414: Make sure tp_connection_upgrade_contacts() is no-op if all features are already prepared (Xavier). • fd.o#41368: Fix introspection by reverting 48998822d5e9575af822c1936b35be514dc2401b. The order in which files are given to gi-scanner matters (Xavier). • fd.o#41435: Ensure sent messages have a sender even with butterfly, which does not set "message-sender" (Xavier). telepathy-glib 0.15.6 (2011-09-30) ================================== Enhancements: • New JavaScript (gjs) code example to demonstrate GObject-Introspection of the API. • TpProtocol: new API to get avatars requirements. • Factory features are now prepared on various contacts: • TpConnection's self contact; • TpChannel's target, initiator and self contacts; • TpChannel's group memebers; • TpTextChannel's message sender; and • TpStreamTubeChannel's connection contact. • New object TpDBusTubeChannel to represent a D-Bus tube channel. Its API is still incomplete. • Group the MembersChanged signals for the initial roster (fd.o#40933). This improve login performance. • Spec upgraded to 0.23.4 except for draft call interfaces. Mixins implement the new additions. • TpDBusPropertiesMixin now has a method for emitting the standard PropertiesChanged signal; in conjunction with the code generator, it respects the EmitsChangedSignal annotation. Note that the signal is not emitted automatically. Fixes: • Python examples now works with latest pygobject (stop using static bindings). Deprecations: • tp_account_prepare_{async,finish} replaced by tp_proxy_prepare_{async,finish} • tp_account_manager_prepare_{async,finish} replaced by tp_proxy_prepare_{async,finish} telepathy-glib 0.15.5 (2011-12-17) ================================== The “feel. experience. know” release. This is a pretty big release, containing over ten thousand lines of changes, which should make various aspects of application development easier. Fasten your seatbelts. Dependencies: • Valac ≥0.11.2 is now required for the Vala bindings. • gtk-doc ≥1.17 is now required if you want to build documentation. Relatedly, building documentation for releases works again. (fd.o#39666) Enhancements: • A new pair of classes, TpSimpleClientFactory and TpAutomaticClientFactory, have been added, which make it much easier for application to provide custom subclasses of specific channel types and to request that certain features always be prepared on proxy objects before they are given to the application. These replace the prevous TpBasicProxyFactory and TpAutomaticProxyFactory classes, which are now deprecated. (Xavier) • A new TpAccount feature, TP_ACCOUNT_FEATURE_CONNECTION, has been added, to ask TpAccount to prepare TpConnection objects before announcing them. Relatedly, TpAccountManager no longer signals new TpAccount objects until they are prepared. (Xavier) • TpConnection now has API for managing the user's contact list! Hooray. This only works with CMs that implement the new ContactList API; dear Python CM folks, please do this and we can move forward with grace and speed. • fd.o#26516: Add tp_debug_sender_set_timestamps. (Jonny) • A metric tonne of new methods were added for joining chat rooms and managing members. (Xavier) • TpFileTransferChannel, a high-level API for file transfer channels, was added. (Morten Mjelva) • fd.o#38061: tp_cm_message_set_message() was added to complement tp_cm_message_take_message(). (Danni) Fixes: • fd.o#38060: fix a crash caused by an off-by-one error when constructing the SendError signal. (Danni) • fd.o#38997: cope more gracefully if UNIX sockets are unsupported, which should improve Windows portability. (Guillaume) • fd.o#39377: TpContact no longer erroneously re-prepares many features if existing contacts are re-requested. (Will) • fd.o#27855: TpChannelManagers now have access to the original TargetID specified in the channel request, if any. Previously, it was transformed into a TargetHandle and the TargetID was removed from the dictionary. The TargetHandle is still synthesised (validating the TargetID in the process) but the ID is left intact. (Will) telepathy-glib 0.15.4 (2011-07-12) ================================== The “A-level magical theory” release. This new release in the 0.15 development cycle fixes a bug introduced in 0.15.0 which could lead to you losing incoming messages. We strongly advise upgrading to this release if you're already using 0.15.0 or later. 0.14.x releases are not affected by this bug. Fixes: • TpTextChannel never finishes preparing if there are pending messages with no message-sender-id (fd.o#39172, Will, ably assisted by Jonny) • Cope better if UNIX sockets are unsupported (fd.o#38997, Guillaume) • Fix some compiler warnings (Xavier) telepathy-glib 0.15.3 (2011-07-08) ================================== This new release in the 0.15 development cycle contains all the fixes released in 0.14.9 except the TpChannelIface:handle-type change which has *not* been reverted in 0.15.3. Connection managers should be fixed to work properly with the new default value. Enhancements: • TpTextChannel: tp_text_channel_ack_all_pending_messages_async: convenient function to easily ack all the pending messages. (fdo #38559 Guillaume) • TpChannelRequest: add properties and accessors for Account, UserActionTime and PreferredHandler preferred-handler and user-action-time. (fdo #38605 Guillaume) • TpAccountChannelRequest and TpBaseClient: API to use the DelegateToPreferredHandler hint. (Guillaume) • TpMessage: tp_message_get_pending_message_id: convenient function to get the pending-message-id of the message. (Guillaume) • TpChannel: Annotate tp_channe_group_ methods. (Guillaume) Fixes: • Fix some set-but-not-used warnings with --disable-debug. (Will) • Honor NOCONFIGURE for compatibility with gnome-autogen.sh. (Colin) • Fix tests failing on some arch. (Will, Adam, Emilio) • Fix memory leaks in TpConnection. (fdo #38944 Siraj) telepathy-glib 0.15.2 (2011-06-21) ================================== The “I'm a PC” release. This new release in the 0.15 development cycle contains all the fixes released in 0.14.8. Enhancements: • Reduce debug spam. (Will) • tp_channel_destroy_async(): high level API to Destroy a TpChannel. • tp_channel_dispatch_operation_{leave,destroy}_channels_async: convenience API to claim a ChannelDispatchOperation and leave/destroy all its channels. (fdo #28015 Guillaume) • TpChannel: high level API for password protected channels; the TP_CHANNEL_FEATURE_PASSWORD feature is automatically prepared by TpAutomaticProxyFactory. (fdo #37360 Guillaume) • TpConnection high level avatars API and TpChannel high level group API are now introspected. (Xavier) Fixes: • TpChannelIface: set TP_UNKNOWN_HANDLE_TYPE as default handle type. (fd.o#38524 Guillaume) telepathy-glib 0.15.1 (2011-05-30) ================================== The "Bugzilla etiquette" release. This new release in the 0.15 development cycle contains all the fixes released in 0.14.7. Fixes: • tp_text_channel_set_chat_state_finish: check the right source tag. (Guillaume) • TpConnection: set the self handle to something sane instead of leaving uninitialized. (Jonny) • Fix a race in tp_channel_dispatch_operation_claim_with_async() (fdo #37280 Guillaume) Enhancements: • TpTextChannel: high level API for SMS; the TP_TEXT_CHANNEL_FEATURE_SMS feature is automatically prepared by TpAutomaticProxyFactory. (fdo #37358 Guillaume) • TpConnection: high level API for Balance. (fdo #36334 Emilio, Danielle, Guillaume) • tp_channel_dispatch_operation_close_channels_async: convenient API to claim a ChannelDispatchOperation and close all its channels. (fdo #28015 Guillaume) • TpBaseContactList: add ContactBlocking support (fdo #35331 Will) telepathy-glib 0.15.0 (2011-05-17) ================================== This first release in the 0.15 development cycle contains all the fixes released in 0.14.6. Dependencies: • GLib 2.28.0 Enhancements: • Update to spec 0.23.2 (Guillaume): · Generated code for Channel.Interface.SMS.GetSMSLength() · Generated code for ChannelDispatcher.DelegateChannels() and ChannelDispatcher.PresentChannel() • tp_channel_dispatch_operation_claim_with_async() replacing tp_channel_dispatch_operation_claim_async() (fdo #36490 Guillaume) • TpProxyFeature is now part of the API allowing users to define their own features (fdo #31583 Guillaume) • tp_base_client_delegate_channels_{async,finish} and add tp_channel_dispatcher_present_channel_{async,finish}: high level API to delegate and present channels (fdo #34610 Guillaume) • TpChannelDispatcher is now exported in the GIR file and so can be used using gobject-introspection (Guillaume) telepathy-glib 0.14.6 (2011-05-16) ================================== Fixes: • tp_dbus_daemon_watch_name_owner leaked a DBusMessage (fledermaus) • tp_dbus_daemon_list[_activatable]_names leaked a DBusMessage (fledermaus) • tp_base_connection_change_status: delay side-effects until all preconditions are checked (Simon) • TpGroupMixin: correctly use contact-ids, not member-ids (Will) • TpBaseContactList: fix leak of source object (Mike) telepathy-glib 0.14.5 (2011-04-20) ================================== The “seven years wasn't strange” release. Enhancements: • Update to spec 0.22.2, generating code for the Balance.ManageCreditURI and SimplePresence.MaximumStatusMessageLength properties. • tp_base_client_is_handling_channel(), which does what it says on the tin. (cassidy) • TpPresenceMixin now supports the MaximumStatusMessageLength class. (andrunko) Fixes: • The documentation now builds correctly with gtk-doc 1.16 and newer. (wjt) • The test suite now passes on systems with glib-networking installed. (wjt) telepathy-glib 0.14.4 (2011-04-15) ================================== Enhancements: • fd.o#27459: TpConnection now avoids a bunch of redundant D-Bus method calls when preparing the CORE feature with recent services, lowering latency (oggis) • tp_proxy_add_interfaces() for adding discovered interfaces from TpProxy subclasses (oggis, cassidy) • tp_base_protocol_get_immutable_properties() now fills the Proto.I.Avatars properties (cassidy) Fixes: • fd.o#36134 - TpProtocol claims it doesn't support any extra iface (cassidy) telepathy-glib 0.14.3 (2011-03-31) ================================== The “where the wind blows” release. This release flatly contradicts the statement that the previous stable release would be the last to add API, by adding API from version 0.22.1 of the specification plus a new utility function. This time, we shall merely claim that no major API additions will be made on this stable branch, and once a 0.15.x release is made no further API additions will be made on 0.14.x at all. Enhancements: • Update to spec 0.22.1 (Will): · Generated code for new StreamHandler methods and signals and types; · TP_ERROR_INSUFFICIENT_BALANCE. • tp_g_ptr_array_extend() for concatenating two GPtrArrays. (Jonny) telepathy-glib 0.14.2 (never) ============================= There is no telepathy-glib 0.14.2. telepathy-glib 0.14.1 (2011-03-22) ================================== The “work by the windows” release. This release adds API from version 0.22 of the Telepathy specification which was accidentally omitted from the previous release. Further releases on this stable branch should not add any further API. Enhancements: • Update to spec 0.22.0 (Guillaume) · TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES · generate code for Connection.I.ContactBlocking telepathy-glib 0.14.0 (2011-03-21) ================================== The “welded in gridlock” release, starting a 0.14.x stable branch. This branch corresponds to the 0.22 stable branch of the specification. Highlights since 0.12.0 ----------------------- • TpBaseContactList, a base class for the ContactList and ContactGroups connection interfaces, as well as old-style ContactList channels. While this helper class supports the old 'deny' channel for blocked contact, it unfortunately does not implement the new ContactBlocking interface yet. • CMs implemented using telepathy-glib will now have immortal handles. • TpContact supports ClientTypes. • TpClientChannelFactory, TpAutomaticProxyFactory and TpBasicProxyFactory have been added to help applications construct particular TpChannel subclasses for channels of different types, with particular features prepared. • TpStreamTubeChannel, a high-level client API for stream tubes, has been added. • TpBaseProtocol supports the Avatars and Presence interfaces. • tp_get_bus() is deprecated (again). Please use tp_dbus_daemon_dup(), followed by tp_dbus_daemon_register_object() if that's what you're using it for, or tp_proxy_get_dbus_connection() if you really need a DBusGConnection. • TpClientMessage and TpSignalledMessage, client-side representations for multipart messages used by TpTextChannel, have been added. • The TpContactSearch object has been added. It represents ongoing searches for contacts. • Code is now generated to emit and listen for the PropertiesChanged signal on org.freedesktop.DBus.Properties. Note that TpDBusPropertiesMixin does not emit this signal on it own, nor does TpProxy listen for it of its own accord. • Previously, tp_clear_object (NULL), tp_clear_boxed (type, NULL) and tp_clear_pointer (NULL) were no-ops. However, this behaviour was not very useful—these functions are always called as tp_clear_object (&priv->foo) in practice—and triggered compiler warnings (because these are actually implemented as macros). Thus, this usage is no longer supported. (This should not affect anything except contrived code, but CM authors may wish to check.) Fixes since 0.13.18 ------------------- • The error handling code paths when looking up the senders of incoming messages have been fixed. This issue led to TpSignalledMessages not specifying a sender with CMs that omit sender-id, like telepathy-idle. (stormer) telepathy-glib 0.13.18 (2011-03-15) =================================== The “chilled coconut-chocolate security blanket” release. Changes: • Previously, tp_clear_object (NULL), tp_clear_boxed (type, NULL) and tp_clear_pointer (NULL) were no-ops. However, this behaviour was not very useful—these functions are always called as tp_clear_object (&priv->foo) in practice—and triggered compiler warnings (because these are actually implemented as macros). Thus, this usage is no longer supported. (This should not affect anything except contrived code, but CM authors may wish to check.) Fixes: • TpCMMessage is no longer included in the .gir file. This class is only useful in CMs; we only support client-side API in the .gir file. (Benjamin Otte) • Correctly include TpBasePasswordChannel documentation. (Danielle) • Fix GCC 4.6 and Clang analyzer warnings (Dan Winship, Will) telepathy-glib 0.13.17 (2011-03-09) =================================== Enhancements: • Update to spec 0.21.11 (Sjoerd) · TP_ERROR_STR_SOFTWARE_UPGRADE_REQUIRED · TP_ERROR_STR_EMERGENCY_CALLS_NOT_SUPPORTED telepathy-glib 0.13.16 (2011-03-07) =================================== Enhancements: • Update to spec 0.21.11 (Guillaume) · TP_PROP_CLIENT_OBSERVER_DELAY_APPROVERS • Two new functions, tp_connection_get_connection_manager_name() and tp_connection_get_protocol_name(), allow you to grab these properties from a TpConnection without having to drive tp_connection_parse_object_path() yourself. (sjokkis) • GBinding utilities for connection-status on TpAccount and TpConnection: tp_connection_bind_connection_status_to_property() and tp_account_bind_connection_status_to_property(). (Danielle) • TpTextChannel now has a "message-types" property and accessor. It also gained tp_text_channel_supports_message_type() a convenient function to check if a specific message type is supported. (Guillaume) • TpContactSearch: only close channels if there was an error (Emilio) • TpBaseClient gained tp_base_client_set_observer_delay_approvers() which can be used to indicate that an Observer has to block Approvers. Fixes: • Various crashes fixed in TpBaseContactList. (Marco) telepathy-glib 0.13.15 (2011-02-24) =================================== The “Continents all made of clay” release. Enhancements: • Update to spec 0.21.10 (Guillaume) · TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_MAY_SAVE_RESPONSE • tp_utf8_make_valid(): an UTF-8 string validation function. (Senko) • SimplePasswordManager now has API to let the CM create its own SASL channel. (Jonner) • TpBasePasswordChannel: a base class to implement SASL channels. (Jonner) telepathy-glib 0.13.14 (2011-02-23) =================================== The “Things that London never saw” release. Enhancements: • TpContact now supports modifying the contact's groups on connection managers which implement Connection.Interface.ContactGroups. (Zdra) • It's now possible to get a list of TpChannelRequest objects from a TpObserveChannelsContext or TpHandleChannelsContext; adding hints to channel requests, and retrieving them again, is supported with telepathy-mission-control ≥ 5.7.2. (cassidy) • tp_account_channel_request_create_and_observe_channel_async() and friends, analogous to tp_account_channel_request_create_and_handle_channel_async() but for Observers rather than Handlers, have been added. (cassidy) • Code is now generated to emit and listen for the PropertiesChanged signal on org.freedesktop.DBus.Properties. Note that TpDBusPropertiesMixin does not emit this signal on it own, nor does TpProxy listen for it of its own accord. (danni) • tp_capabilities_supports_room_list(), a convenient way to check whether a connection supports listing chat rooms, has been added. (cassidy) Fixes: • Including telepathy-glib/protocol.h now correctly includes generated client-side functions. (danni) telepathy-glib 0.13.13 (2011-02-09) =================================== The “Duckworth Lewis” release. Enhancements: • Many doc fixes, including: TpBaseClientClass is now included; INCOMING_MESSAGES is now explained. (wjt) • Compiler flags reordered (clang is order-sensitive) to allow static analysis. (wjt) • Account Channel Requests now give you access to the originating TpChannelRequest. (cassidy) • The speculative debug cache may now be disabled at compile time. tp_debug_sender_add_message_vprintf and tp_debug_sender_add_message_printf added to allow callers who care about optimisation to reduce debug overhead. (fledermaus) telepathy-glib 0.13.12 (2011-02-01) =================================== The “You look good by siren light” release. Enhancements: • TpContact now tracks incoming and outgoing presence subscriptions, albeit only if the connection implements the new Connection.Interface.ContactList API. (Xavier) • Code is generated for new API added in telepathy-spec version 0.21.9; specifically, the FileTransfer.URI property is supported. (Guillaume) • TpPresenceMixinStatusAvailableFunc, which has confused many a CM author, now has clearer documentation. (Will) Fixes: • We no longer accidentally depend on GLib 2.28. (Will) • tests/contact-search-result no longer fails on x86. (Will) telepathy-glib 0.13.11 (2011-01-27) =================================== The “and, erm … I own an M-16 fully-automatic ground assault rifle” release. Enhancements: • fd.o#32053: The TpContactSearch object has been added. It represents ongoing searches for contacts. (pochu) Fixes: • fd.o#32551: tp_base_client_set_observer_recover now works with all possible gboolean arguments! (jonny) • tp_debug_timestamped_log_handler will now print the message and not just the time, which was broken over a year ago. (jonny) • TpProtocol will now consider a manager file's AuthenticationTypes value. (jonny) telepathy-glib 0.13.10 (2010-12-20) =================================== The “I own a 9 millimetre, a 357, a 45 handgun, a 38 special” release. Enhancements: • New TpMessage API: tp_message_get_message_type, tp_cm_message_new_text (smcv) • fd.o #32411: warn and do nothing if unsupported flags are passed to tp_g_signal_connect_object (smcv) • Updated to spec 0.21.8. · The ContactList.ContactsChangedWithID signal was added. It's automatically emitted by TpBaseContactList, so CMs don't need to make any changes to take advantage of it. (smcv) Fixes: • tp_account_manager_ensure_account() no longer criticals if you pass it a malformed account path. (wjt) • TpBaseClient will now return (an error) from ObserveChannels if an invalid connection path is passed to it by the Channel Dispatcher. (wjt) • fd.o#32184: Connection bus names are no longer erroneously released while connections are still open. This was a regression in 0.13.5. (wjt) • fd.o #32423: Preparing TpAccount features when the CORE feature is already prepared now works (smcv) • fd.o #32391: correctly deal with removing name owner watches during dispatch of their callbacks (wjt, smcv) • Documentation improvements (smcv) • TpBaseClient no longer breaks if HandleChannels is called more than once for the same channel. This was a regression introduced by the leak fix in the previous release (sjoerd) telepathy-glib 0.13.9 (2010-12-10) ================================== The "please mind the gap between the table and the table" release. This release includes all the bugfixes from version 0.12.6. Deprecations: • tp_message_new (replace with tp_cm_message_new) • tp_message_ref_handle (no longer needed) • tp_message_set_handle (use tp_cm_message_set_sender for the only supported handle in a message) • tp_message_take_message (replace with tp_cm_message_take_message) Enhancements: • tp_account_get_path_suffix: new function to get the varying suffix of an account's object path (wjt) • TpAccountManager: document which TpAccount objects are prepared (wjt) • tp_connection_dup_contact_if_possible: new function to make TpContact objects synchronously in some situations (smcv) • convert TpMessage into a GObject, with subclasses for use in CMs (TpCMMessage) and clients (TpClientMessage, TpSignalledMessage) (cassidy) • add TpConnection:self-contact, a TpContact for the self-handle (smcv) Fixes: • In TpSimplePasswordManager, clear the pointer to the channel when it's closed (jonny) • fd.o #32116: don't leak LegacyProtocol object references when a TpBaseConnectionManager is registered (smcv) • Fix an unlikely crash in which a TpBaseConnection outlives its TpBaseConnectionManager (smcv) • Documentation improvements (cassidy) • fd.o #32191: when tp_connection_get_contacts_by_handle would return contacts that already exist, make sure they have the desired features (smcv) • Fix memory leaks in TpAccount and TpDynamicHandleRepo introduced in 0.13.8 (cassidy) • fd.o #32222: fix a leak of TpChannel objects in TpBaseClient, document that Handlers are responsible for closing their channels, warn if channels are still handled when a Handler is disposed, and close channels in some regression tests (Zdra) telepathy-glib 0.13.8 (2010-12-01) ================================== The "many of my best conversations are when un-agonized" release. Deprecations: • fd.o #24114: tp_get_bus() is deprecated (again). Please use tp_dbus_daemon_dup(), followed by tp_dbus_daemon_register_object() if that's what you're using it for, or tp_proxy_get_dbus_connection() if you really need a DBusGConnection. (smcv) Changes: • fd.o #23155: handles now persist until the TpBaseConnection disconnects, and most of the reference-counting machinery has been removed (smcv) • fd.o #31997: in the ContactList channels produced by TpBaseContactList, AddMembers, RemoveMembers etc. don't return until the implementation reports success or failure (smcv) Enhancements: • Update to spec 0.21.6 (smcv) · Connection.HasImmortalHandles property • fd.o #31900: add TpSimplePasswordManager (jonny) • fd.o #32004: add tp_account_get_automatic_presence, tp_account_get_normalized_name, tp_account_set_automatic_presence_async (smcv) • fd.o #31918: add convenience API for Account.I.Addressing (smcv) Fixes: • return a zero-terminated array of features from tp_client_channel_factory_dup_channel_features (cassidy) • fd.o #32004: emit GObject::notify for TpAccount::requested-* (smcv) telepathy-glib 0.13.7 (2010-11-25) ================================== The "moustache pattern released under a Creative Commons licence" release. This release includes all bugfixes from 0.12.5. Enhancements: • Update to spec 0.21.5 (smcv) · Conn.I.PowerSaving · Chan.T.ServerAuthentication, Chan.I.SASLAuthentication, Chan.I.Securable · Account.I.Addressing · Protocol.I.Avatars · enhanced ChannelDispatcher and ChannelRequest API with "request hints" · new errors: CONFUSED, SERVER_CONFUSED · new property: Messages.MessageTypes · TP_CONTACT_INFO_FIELD_FLAG_OVERWRITTEN_BY_NICKNAME • fd.o #31686: add Protocol.I.Avatars support to TpBaseProtocol (eeejay) • implement the MessageTypes property in the TpMessagesMixin (smcv) • use G_N_ELEMENTS more (smcv) Fixes: • use the right getter for TpAccountChannelRequest:request (smcv) telepathy-glib 0.13.6 (2010-11-17) ================================== The "please stop trying to find me on Wikipedia" release. This release includes all the fixes from 0.12.4. API changes: • Pointers to a GObject implementing TP_TYPE_CLIENT_CHANNEL_FACTORY are now referred to as having type TpClientChannelFactory*, rather than misusing TpClientChannelFactoryInterface*. The ABI has not changed. Enhancements: • Return the reffed handle from tp_handle_ref() (jonny) Fixes: • fd.o #31473: force the namespace TelepathyGLib for the g-i-derived Vala bindings (treitter) • fd.o #31581: don't modify a const array in tp_group_mixin_remove_members_with_reason (smcv) • fd.o #31631: set a TpBaseClient's TpClientChannelFactory correctly (cassidy) • fd.o #31631: fix confusion between TpClientChannelFactory and TpClientChannelFactoryIface (smcv) • Run the stream tube IPv6 tests again, if ::1 is assigned to an interface (smcv) telepathy-glib 0.13.5 (2010-11-05) ================================== The "gunpowder, treason and plot" release. Enhancements: • fd.o #30088: add support for Protocol.I.Presence to TpBaseProtocol (fledermaus, smcv) Fixes: • fd.o #10613: release connections' object paths before their bus names, and do both sooner (smcv) • fd.o #31377: fix a race condition in the connection-interests test that sometimes caused it to fail or segfault, and similar races (not seen in practice) in two other tests (smcv) telepathy-glib 0.13.4 (2010-11-03) ================================== The "request_module: runaway loop modprobe binfmt-464c" release. This release includes all the fixes from 0.12.3. Enhancements: • Update to spec 0.21.4 (smcv) - fd.o #31215: fix incorrect namespace for MailNotification - add bindings for NewActiveTransportPair Fixes: • fd.o #31321: don't crash if the TpAccountManager is disposed while an account from tp_account_manager_ensure_account is preparing (cassidy) • fd.o #31198: avoid some C99 features not supported by MSVC 9 (Thomas Fluueli, smcv) • fd.o #31291: add pkg-config and C header information to GIR for the benefit of future Vala versions (Evan Nemerson) • In the echo2 example CM, advertise Messages' immutable properties (cassidy) • In TpBaseChannel, don't unref handles we didn't ref (jonny) telepathy-glib 0.13.3 (2010-10-26) ================================== The "reminds me of daf's random dbus type generator" release. This release includes all the fixes from version 0.12.2. Deprecations: • is now deprecated, and the Group and Properties mixins no longer output brightly-coloured logs Enhancements: • fd.o #31102: update to spec 0.21.3 (smcv): - add TP_ERROR_PICKED_UP_ELSEWHERE - generate code for Chan.I.DTMF.TonesDeferred and DeferredTones - generate code for Conn.I.MailNotification - generate code for Protocol.I.Presence - generate code for AddClientInterest, RemoveClientInterest - update the Call example CM and its regression test • fd.o #27948: add generic support for AddClientInterest, RemoveClientInterest on TpBaseConnection and TpConnection (smcv) • fd.o #30505: add TpDTMFPlayer, a DTMF dialstring interpreter (smcv) • TpClientChannelFactory: ask callers to prepare a given set of features, and do so in TpBaseClient (cassidy) Fixes: • fd.o #30730: order tests' and examples' CFLAGS and LIBS consistently, fixing builds in some situations (an older telepathy-glib built with -rpath already installed, possibly) (smcv) • fd.o #30949: fix a typo that made DeliveryReportingSupport always come out as 0, and test a nonzero value (smcv) • Don't leak an array of features in TpBaseClient (cassidy) • fd.o #31027: if stdout is a tty, tests now succeed silently, and only produce output on failure; also, they will automatically fail after a few seconds if an expected event does not happen (smcv) • fd.o #30999: tests now succeed on machines where IPv6 is supported but ::1 is not assigned to an interface (smcv) telepathy-glib 0.13.2 (2010-10-15) ================================== The "whose thighs are capacitive?" release. This release includes all the fixes from version 0.12.1. Enhancements: • Update to spec 0.21.2 (smcv) - add TP_ERROR_REJECTED, SendNamedTelephonyEvent, SendSoundTelephonyEvent - change the experimental Call interfaces and adjust the example CM to match • fd.o #29973: add TpClientChannelFactory, TpAutomaticProxyFactory and TpBasicProxyFactory, and use them in TpBaseClient and TpAccountChannelRequest (cassidy) • fd.o #29218: add TpStreamTubeChannel, a higher-level API for stream tubes (danni, cassidy) • fd.o #30478: add TP_ACCOUNT_FEATURE_STORAGE (danni) • Improve the error message for an undefined D-Bus interface (wjt) Fixes: • fd.o #30791: fix building with gtk-doc enabled, and an older telepathy-glib installed in a non-default library search path (danni) • fd.o #30644: don't 'return' a void expression from a void function, which isn't valid C99 and breaks compilation on Sun Studio C (smcv) • Remove redundant trailing semicolons from G_DEFINE_TYPE etc., which are not valid C99 (smcv) • Add DeliveryReportingSupport to the properties offered by TpMessageMixin (cassidy) • Add ContactListState to the properties offered by TpBaseContactList (smcv) • Avoid using a gboolean (which is signed) as a one-bit bitfield (smcv) telepathy-glib 0.13.1 (2010-10-04) ================================== The "we're out of bear-shaped biscuits" release. Enhancements: • Update to spec 0.21.1 (smcv): - add Access_Control, Access_Control_Type, Conn.I.ClientTypes • Add ClientTypes support to TpContact (jonny) Fixes: • In TpCapabilities, do more checks on the self pointer (cassidy) telepathy-glib 0.13.0 (2010-09-28) ================================== The "this whiteboard needs scrollbars" release. Dependencies: • Automake ≥ 1.11 is now required (when building from git or changing the build system) • If GObject-Introspection is enabled, it must be version 0.9.6 or later Enhancements: • Update to spec 0.21.0 (smcv) · generate code for the ContactList and ContactGroups interfaces • fd.o #28200: add TpBaseContactList, a base class for contact list/contact groups implementations (smcv) • fd.o #30204: add checks for stream and D-Bus tubes to TpCapabilities (cassidy) • fd.o #30327: add some new utility functions for TpHandleSet (smcv) • fd.o #30310: make tp_contacts_mixin_get_contact_attributes public for re-use (eeejay) • debug-log the error message when a Protocol filter rejects a parameter (wjt) telepathy-glib 0.12.0 (2010-09-20) ================================== The "you rang?" release, starting a 0.12.x stable branch. Highlights since 0.10.x ----------------------- Changes: • when the local user is removed from a Group Channel, the GError used to invalidate the TpChannel has changed New features: • the TpProxy "feature" (prepare_async) mechanism • high-level bindings for ChatStates, ContactCapabilities, ContactInfo, Avatars, detailed connection errors, and Protocol objects • TpAccountChannelRequest, a high-level channel-requesting mechanism • TpBaseClient, a base class for Observers, Approvers and Handlers • generated constants for contact attributes and handler capability tokens • base classes for Channel and Protocol in connection managers • TpWeakRef, a wrapper for a weak reference and optional extra pointer • experimental GObject-Introspection bindings, requiring version 0.6.14 or later • experimental Vala bindings, requiring GObject-Introspection 0.9.6 and Vala 0.10.0 or later • generated code for all stable APIs in telepathy-spec 0.20, apart from client code for Channel.Type.ServerTLSConnection (which will follow in 0.13.x) Note that the GObject-Introspection and Vala bindings are not subject to the same API guarantees as the C API, and are likely to have incompatible changes during the 0.13.x series. Changes since 0.11.16 --------------------- • Disable documentation completeness checks and redirect documentation uploads for stable branch • Add the version number, and a link to the latest version, to the documentation • Increase dependencies for Vala bindings to versions that the libfolks developers have verified to work: gobject-introspection 0.9.6 and Vala 0.10.0 telepathy-glib 0.11.16 (2010-09-15) =================================== The "Fear my moo of fury!" release. Enhancements: • Update to stable spec 0.20.1 (smcv) - generate basic API for Chan.I.Conference - generate basic API for Chan.T.ServerTLSConnection and TLSCertificate (server-side only for now, since TLSCertificate will require a new TpProxy subclass) • When connections are created in a CM, debug-log the sanitized parameter values (wjt) • When a TpBaseChannel is created, log an error if it doesn't have a parent connection (wjt) Fixes: • fd.o #30134: rename TpIntSet to TpIntset, with compatibility typedefs for the old name, to avoid breaking recent gobject-introspection (pwithnall) • fd.o #30134: add more gobject-introspection annotations to work better with recent versions, and work around another case of (skip) not working in older versions (pwithnall, treitter, smcv) Compatibility notes: • If the Vala bindings are enabled, either GObject-Introspection must be older than 0.9.5, or GObject-Introspection and Vala must both be very recent (g-i 0.9.6 and Vala 0.9.9 will hopefully be suitable). telepathy-glib 0.11.15 (2010-09-13) =================================== The “Castle Turing” release. Enhancements: • Update to spec 0.19.12 (smcv) - generate code for SMS interface for Text channels, NotYet error, Object_Immutable_Properties type and TP_PROP_CONNECTION_INTERFACE_CELLULAR_OVERRIDE_MESSAGE_SERVICE_CENTRE • fd.o #28420: add tp_channel_get_requested() etc. (cassidy) • Add basic introspectability for the Connection mixins (treitter) Fixes: • fd.o #30090: fix parsing TpProtocol information from .manager files (fledermaus, smcv) • fd.o #29943: make tp_debug_sender_log_handler thread-safe (smcv) • fd.o #30111: make GObject-Introspection work again with g-i >= 0.9.5 (danni, smcv) • fd.o #30134: make configure fail if Vala bindings are enabled but g-i is disabled, which can't work (smcv) • fd.o #25582, #27806, #30118: fix miscellaneous memory leaks (smcv) telepathy-glib 0.11.14 (2010-08-25) =================================== The “One hundred men can skin 5,000 cats a day.” release. Enhancements: • fd.o #29375: there's now a TpBaseChannel class which deals with all the boring boilerplate previously needed to implement channels. Public response to the class has been uniform. "The class is perfect", said one passer-by. (jonner, wjt) • fd.o #29614: add TpBaseClient:account-manager (smcv) • Allow TpBaseClient instances to wait for any desired set of TpAccount, TpConnection and TpChannel features (smcv) • fd.o #29671: add TP_ARRAY_TYPE_UCHAR_ARRAY_LIST, i.e. signature 'aay' in dbus-glib (smcv) Fixes: • Ensure that when a TpAccountChannelRequest produces a connection and a channel, they're obtained from the same TpAccount we started from (smcv) • fd.o #29756, #29795: various documentation improvements (smcv) telepathy-glib 0.11.13 (2010-08-17) =================================== The “Brand New Name” release. Dependencies: • When building from git or otherwise running automake, automake 1.11 is strongly recommended. If an older version is used, it will not be possible to generate Vala bindings, or to make tarball distributions. Changes to experimental API: • fd.o #29070: remove telepathy-vala.pc. Vala bindings should ask pkg-config for telepathy-glib, and can check that the VAPI file exists by attempting to link a trivial Vala program; see libfolks for example code (cassidy) Enhancements: • fd.o #29358: add TP_ERROR as an alias for TP_ERRORS, for introspectability (pwithnall) • add TP_USER_ACTION_TIME_NOT_USER_ACTION, TP_USER_ACTION_TIME_CURRENT_TIME, tp_user_action_time_from_x11, tp_user_action_time_should_present (smcv) • improve various documentation (smcv, danni) • convert TpBaseClient virtual methods into normal GObject virtual methods so they can be introspected (smcv) Fixes: • Don't rely on vala-1.0.pc to check for vala version and vapigen (treitter) • fd.o #25019: let the TpPresenceMixin work on connections that implement SimplePresence but not complex Presence (Butch Howard) • Fix a harmless misuse of enums that caused warnings on gcc 4.5 (smcv) • Fix out-of-tree builds with Vala enabled (smcv) telepathy-glib 0.11.12 (2010-08-10) =================================== The “Fire and Forget” release. Enhancements: • Added TpAccountChannelRequest, a request to create or ensure a channel (cassidy) ‣ fd.o #29456: tp_account_channel_request_create_async (plus an _ensure_ variant): create a channel which will be handled by an existing Handler, probably another application ‣ fd.o #13422: tp_account_channel_request_create_and_handle_async (plus an _ensure_ variant): create a channel and handle it yourself • fd.o #29461: updated to telepathy-spec 0.19.11 (smcv) ‣ more error codes for SSL/TLS - Insecure, Revoked, LimitExceeded ‣ Conference_Host call state flag Fixes: • fd.o #29174: update example connection managers to follow current telepathy-spec best practices, including Protocol objects (smcv) • fd.o #29268: fix compilation from a tarball with --enable-vala-bindings (smcv) telepathy-glib 0.11.11 (2010-07-26) =================================== The “xev claims I'm typing in Japanese” release. Enhancements: ↭ Updated spec to 0.19.10 (smcv): ↯ generate code for Protocol objects, and the ContactSearch channel type ↭ fd.o #27997: add TpProtocol client-side API, and TpBaseProtocol service-side base class, for Protocol objects (smcv) ↭ fd.o #28751: tp_proxy_has_interface is now a real function, not a macro, for better introspection (smcv) ↭ TpBaseClient's properties now have accessor methods for convenient use in C (smcv) ↭ tp_capabilities_get_channel_classes is now visible to g-i (pwithnall) Fixes: ↭ Install a .deps file for the Vala bindings (pwithnall) ↭ Vala bindings now install to the normal location, making it unnecessary to look up telepathy-vala in pkg-config; that pkg-config file will be removed in a future version (treitter) ↭ fd.o #29197: expand g-i coverage of connection manager code enough to use it for libfolks' regression tests (pwithnall, smcv) telepathy-glib 0.11.10 (2010-07-12) =================================== The “as many fossils as last year” release. Enhancements: ❱ Updated spec to 0.19.9 (wjt): ❭ added support for Read and Deleted delivery reports Fixes: ❱ Improved GObject-Introspection annotations to be sufficient for libfolks (treitter) ❱ Fixed a typo in the documentation (jonny) ❱ fd.o #28920: fixed tp_contact_request_contact_info_async cancellation handling when dealing with synchronous errors (pwithnall) telepathy-glib 0.11.9 (2010-07-02) ================================== The “mistakenly displays 2 more bars than it should” release. Enhancements: ❉ Updated spec to 0.19.8 (smcv): ➠ generate code for some new properties, Conn.I.Cellular and Account.I.Storage ➠ add convenience methods to TpAccount to access Account.Service ❉ Added tp_simple_async_report_success_in_idle, a convenience function to return "void" from an async method (smcv) Fixes: ❉ Fixed libdbus errors when unregistering a TpBaseClient that isn't a Handler (cassidy) ❉ Made some TpGroupMixin methods more const-correct (smcv) ❉ Fixed some memory leaks in regression tests (smcv) ❉ Suppressed more valgrind false-positives (smcv, cassidy) ❉ Improved generation of experimental Vala bindings (treitter) telepathy-glib 0.11.8 (2010-06-22) ================================== The "moving to Canada for maple syrup and bacon" release. Requirements: ⁂ If GObject-Introspection is enabled, it must be version 0.6.14 or later. Enhancements: ⁂ Improve GObject-Introspection annotations, and optionally build Vala bindings, which are currently considered highly experimental (treitter) Fixes: ⁂ Make tp_base_client_set_handler_bypass_approval able to set the value to FALSE, and hence make it possible for a TpSimpleHandler to not bypass approval (cassidy) ⁂ If the weak object for contact info retrieval disappears, stop, and don't call the callback (sjoerd) ⁂ Fix a va_list leak in tp_value_array_build (wjt) ⁂ Fix a memory leak for unlikely errors in tp_base_connection_register (wjt) telepathy-glib 0.11.7 (2010-06-14) ================================== The “why do my legs not work?” release. Requirements: ⎎ If GObject-Introspection is enabled, it must be version 0.6.13 or later. Deprecations: ⎎ TpChannelFactoryIface is officially deprecated (it shouldn't have been used since 0.8). ⎎ tp_verify() should not be used in new code: use GLib 2.20's G_STATIC_ASSERT. Enhancements: ⎎ Update to telepathy-spec 0.19.7 (smcv) ⎓ generate code for the Anonymity and ServicePoint interfaces ⎓ add ChatStates property and Chat_State_Map type ⎓ add Account.ConnectionError and ConnectionErrorDetails properties ⎎ fd.o #27676: add TP_CONNECTION_FEATURE_CONTACT_INFO, TP_CONTACT_FEATURE_CONTACT_INFO, tp_contact_request_contact_info_async, etc. (Zdra) ⎎ fd.o #28241: add tp_channel_dispatch_operation_handle_with_time_async (cassidy) ⎎ fd.o #28379: add connection-error and connection-error-details properties to TpAccount, and implement the corresponding parameters of TpAccount::status-changed (smcv) ⎎ fd.o #28312: add TpContact::presence-changed signal (sjokkis) ⎎ fd.o #28368: use GStrv instead of gchar ** in structs, so GObject-Introspection ≥ 0.6.13 can introspect it correctly (Zdra) ⎎ Add tp_handle_set_new_from_array (smcv) ⎎ fd.o #28345: add tp_clear_object, tp_clear_pointer, tp_clear_boxed (also proposed for GLib/GObject, as Gnome bug #620263) (smcv) ⎎ Add TP_ERROR as a synonym for TP_ERRORS, to be nice to Vala (treitter) ⎎ fd.o #28334, #28347: speed up the regression tests, clean up their code, and put their utility code in a namespace so Vala tests can use it (treitter, smcv) Fixes: ⎎ test-finalized-in-invalidated-handler: eliminate a race condition (smcv) ⎎ tp_connection_get_detailed_error: fix a memory leak introduced in 0.11.4 (smcv) telepathy-glib 0.11.6 (2010-05-25) ================================== The "anybody need this sign?" release. This version includes all the bugfixes from today's 0.10.6 release. Requirements: * If gtk-doc is enabled, it must be version 1.15 or later. * If GObject-Introspection is enabled, it must be version 0.6.11 or later. Enhancements: * Updated to telepathy-spec 0.19.6: * ChangingPresence property on the Account interface * SupportedLocationFeatures property on the Location interface * HandleWithTime method on ChannelDispatchOperation * MultipleTones method, SendingTones and StoppedTones signals, and CurrentlySendingTones and InitialTones properties on the DTMF interface * TpAccount:changing-presence and tp_account_get_changing_presence, a binding for the new ChangingPresence property (smcv) * fd.o #27872: enhance TpBaseClient to support being a Handler (cassidy) * fd.o #27873: TpSimpleHandler, a simple TpBaseClient subclass for projects that don't need their own subclass, and an example Approver that uses it (cassidy) * fd.o #20035: add TP_CONTACT_FEATURE_AVATAR_DATA, the ability to cache and access avatar data (Zdra) * fd.o #16170: cope better with sparse TpIntSets (smcv) * Add more API for int sets and handle sets (smcv) * Make the ContactList example connection manager more realistic, and add a regression test for it (smcv) Fixes: * fd.o #28203: TpGroupMixin: allow "adding" contacts who are already members, even if the Can_Add flag isn't set (e.g. accepting a subscription request twice), and allow "removing" contacts who are not in the channel (e.g. rejecting a subscription request twice) (smcv) * Correct the syntax of TP_IS_HANDLE_REPO_IFACE (smcv) * Move _tp_proxy_set_features_failed (which isn't intended to be API, and isn't ABI) to an internal header (smcv) * Fix the namespace version for GObject-Introspection (smcv) telepathy-glib 0.11.5 (2010-05-10) ================================== The "also, hi from bl.uk" release. API changes: ⌬ fd.o #23369: when the local user is removed from a Group Channel, the GError with which the TpChannel is invalidated has changed: → if possible, the detailed error name from D-Bus is mapped to a TpError, or a custom GError domain set up with tp_proxy_subclass_add_error_mapping → otherwise, the TpChannelGroupChangeReason is translated into a TpError Previously, we used an error from the TP_ERRORS_REMOVED_FROM_GROUP domain in most cases; this domain is no longer used, unless we get a change reason that isn't recognised. Enhancements: ⌬ fd.o #25236: TpBaseClient, a base class for Observers and Approvers, which will also support Handlers in a future release (cassidy) ⌬ fd.o #27871, #24214: TpSimpleObserver, a simple TpBaseClient subclass for projects that don't need their own subclass, and an example Observer that uses it (cassidy) ⌬ fd.o #27875: TpSimpleApprover, a simple TpBaseClient subclass for projects that don't need their own subclass, and an example Approver that uses it (cassidy) ⌬ fd.o #27899: internal macros for ERROR(), CRITICAL() etc., analogous to DEBUG() (jonny) ⌬ fd.o #23369: improve the errors with which a Group TpChannel is invalidated if we're removed, as per "API changes" above (smcv) ⌬ fd.o #18055: generate GEnum types for TpCMInfoSource, TpContactFeature, TpDBusError, and GFlags types for TpDBusNameType and TpDBusPropertiesMixinFlags. Note that TpConnectionManager:info-source is still of type G_TYPE_UINT, not TP_TYPE_CM_INFO_SOURCE, since switching it would be an ABI break. (danni, smcv) Fixes: ⌬ fd.o #26211: correct the generated constants for contact attributes and handler capability tokens, which were present-but-wrong since 0.11.3 (smcv) ⌬ fd.o #24689: document more clearly that the TpConnectionManager.protocols struct member can be reallocated (smcv) ⌬ fd.o #28043: explicitly link tests/* against dbus-glib, fixing compilation with GNU gold, with GNU ld with LDFLAGS=-Wl,--no-add-needed, and hopefully also with Fedora 13's patched GNU ld (see Red Hat #564245) (smcv) ⌬ some fixes to GObject-Introspection metadata (danni) telepathy-glib 0.11.4 (2010-04-28) ================================== The “not sure whether to be amused or terrified” release. This version includes all the bugfixes from today's 0.10.5 release. Requirements: ∮ gtk-doc 1.14 is now required. Applying commit 0a874b3a from gtk-doc git to support the (skip) annotation (as was done in Debian's gtk-doc 1.14-2) is also highly recommended; it'll be in upstream release 1.15. ∮ GLib 2.24 is now required. Enhancements: ∮ telepathy-glib now has experimental GObject-Introspection bindings, for use by language bindings like PyGI and gjs. At this stage, these bindings are incomplete, and are *not* covered by our normal API guarantees - incompatible changes between versions are likely. (danni, smcv) ∮ fd.o #27769: add TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS (Zdra) ∮ fd.o #27794: improve regression test coverage for TpAccount (cassidy, smcv) ∮ fd.o #19164: tighten the definition of TpChannel:identifier to guarantee that it's always non-NULL, even before the channel is ready (previously, it could be NULL before the channel was ready) ∮ fd.o #23369 (partial): improve error mapping on TpConnection and TpBaseConnection, and add tp_connection_get_detailed_error (smcv) Fixes: ∮ fd.o #27780: when TpAccount:connection changes, emit notify::connection (smcv) ∮ Don't leak TpAccount:parameters when disposed (smcv) ∮ Fix more assertion failures (this time in TpContact) if getting contact attributes fails or yields the wrong type (wjt) ∮ Remove some dead code to keep coverity happy (wjt) telepathy-glib 0.11.3 (2010-04-20) ================================== The "can we have a hippopotamus?" release. This version includes both the bugfixes from today's 0.10.4 release. Enhancements: ↠ Upgrade to telepathy-spec 0.19.5 (smcv) → Connection.Status, Connection.Interfaces properties (all telepathy-glib CMs that use TpBaseConnection should gain support for these automatically) → Observer.Recover property → ContactInfo interface ↠ Add TpWeakRef, a wrapper for a weak reference and an optional extra pointer (smcv) ↠ fd.o #21097: push the "feature" concept from TpAccount and TpAccountManager into the TpProxy base class, and use it to implement feature-preparation for core functionality of TpChannel, TpConnection, TpConnectionManager (smcv) ↠ add TP_CHANNEL_FEATURE_CHAT_STATES (smcv) ↠ fd.o #27511: add TpCapabilities, TP_CONNECTION_FEATURE_CAPABILITIES and TP_CONTACT_FEATURE_CAPABILITIES (cassidy) ↠ fd.o #27690, #27709: add boxed types for TpIntSet, TpConnectionManagerProtocol and TpConnectionManagerParam (danni, smcv) ↠ fd.o #27741: make it easier to export objects without using tp_get_bus(), particularly in connection managers (smcv) ↠ fd.o #26211: generate TP_TOKEN_${INTERFACE}_${TOKEN} constants for contact attributes and handler capability tokens (KA) Fixes: ↠ Use the fast-path for Location correctly (cassidy) ↠ fd.o #27714: support G_CONNECT_AFTER in tp_g_signal_connect_object, and document exactly which flags we support (Maiku, smcv) ↠ fd.o #27537: fix assertion failure if getting contact attributes fails (cassidy) ↠ fd.o #27695: only try the slow path in Contacts if the fast path isn't supported (cassidy) telepathy-glib 0.11.2 (2010-04-06) ================================== The "not actually deprecated" release. This version includes all the bugfixes from today's 0.8.3 and 0.10.3 releases (they were all included in the previous version, in fact). Un-deprecations: ☀ tp_get_bus is not considered to be deprecated yet after all; many connection managers use it, and the current alternative is considerably more verbose. This reopens fd.o #24114. (smcv) telepathy-glib 0.11.1 (2010-04-05) ================================== The “26-bit address bus” release. Enhancements: ◈ Add tp_str_empty() macro, a shortcut for ‘NULL or ""’ (smcv) ◈ Add TP_TYPE_UCHAR_ARRAY, a dbus-glib GArray of guchar (i.e. the default representation for the D-Bus 'ay' type) (cassidy) ◈ Add tp_account_set_avatar_async() (cassidy) ◈ Add TP_CONTACT_FEATURE_LOCATION (cassidy) Fixes: ◈ Only fail “make check” on documentation warnings in unreleased versions, to avoid build failures in releases when gtk-doc in a distribution doesn't have the same definition of full coverage that we do (smcv) ◈ Fix compatibility with gtk-doc 1.14 (smcv) telepathy-glib 0.11.0 (2010-03-31) ================================== The ‘bah, you removed my “beautiful” quotes’ release. Dependencies: ‣ GLib, GObject and GIO ≥ 2.22 are now required Deprecations: ‣ fd.o #22206: all the re-entrant functions (of the form tp_FOO_run_until_ready and tp_cli_FOO_run_BAR) are deprecated in this version, please use asynchronous calls instead (smcv) ‣ fd.o #24114: tp_get_bus() is deprecated, please use tp_dbus_daemon_dup() followed by tp_proxy_get_dbus_connection() (smcv) Enhancements: ‣ Update to telepathy-spec 0.19.3 (smcv) ❧ generate code for new Connection.Interfaces, Connection.Status properties, and implement them in TpBaseConnection ❧ generate code for Connection.Interface.Balance ‣ Add an example connection manager for the experimental Call API that will eventually replace StreamedMedia (smcv) ‣ Add tp_g_socket_address_from_variant, tp_address_variant_from_g_socket_address (danni) ‣ Add tp_g_value_slice_new_byte (smcv) ‣ Add tp_value_array_unpack, the inverse of tp_value_array_build (danni) ‣ Make various minor improvements to the tests (smcv) Fixes: ‣ tp_account_set_nickname_async: set the right source_tag (cassidy) ‣ fd.o #27281: clarify documentation for tp_message_mixin_sent, using telepathy-spec 0.19.2 as a reference (Maiku) ‣ Avoid using re-entrant functions, other than in regression tests (smcv) ‣ fd.o #21956: clean up documentation/defaults of TpContact properties (smcv) ‣ telepathy.am: if copied into a project where nothing is checked for unreleased version annotations, don't hang waiting for input (smcv) telepathy-glib 0.10.2 (2010-03-31) ================================== The "is that a koala in your roster or are you just nearby?" release. Fixes: * TpAccount: correctly add interfaces such as Avatars (danni) * Make GetContactAttributes() in GLib CMs tolerate unsupported interfaces, as per telepathy-spec 0.19.2 (wjt) * Improve documentation of TpContactsMixinFillContactAttributesFunc (mikhailz) telepathy-glib 0.10.1 (2010-03-24) ================================== The "usually quite loud" release. This version includes all the bugfixes from 0.8.2, plus some documentation improvements in code added since 0.8. Fixes: * Don't make an idle call to put received messages in the TpMessageMixin queue, potentially avoiding a reference leak (Vivek) * tp_contacts_mixin_set_contact_attribute now takes a const gchar * instead of a gchar * (mikhailz) * Escape the doc-comments better in generated service interfaces (smcv) * Fix some typos and broken cross-references in the documentation, and improve the TpAccount documentation (smcv) * Chain up to GObject's dispose method when destroying a TpBaseConnectionManager (smcv) * Remove a misleading debug message from tp_list_connection_names (wjt) telepathy-glib 0.10.0 (2010-01-21) ================================== The "where did you get your bear?" release. This release begins a bugfix-only 0.10.x branch, in which new API/ABI will no longer be added; 0.11.x development releases will continue to be made from the master branch. The 0.10.x branch targets the D-Bus API from telepathy-spec 0.18.0. The major enhancement since 0.8.x is that TpAccountManager and TpAccount, previously simple stub classes, now have high-level API to manipulate accounts. GLib 2.20 and dbus-glib 0.82 are now required, and telepathy-glib now links against GIO. Enhancements since 0.9.2: * Add compile-time warnings if the results of functions that allocate memory are ignored; for a couple of these functions it's not obvious that a result is allocated, leading to non-obvious leaks (smcv) * Add compile-time warnings if the results of certain functions with no side-effects are ignored, which is harmless but makes no sense (smcv) * Improve lcov.am, syncing with telepathy-gabble (smcv) Fixes since 0.9.2: * fd.o #23848: when making a release, make the build system check for files that indicate unreleased status; correct a few such comments (wjt) * fd.o #25149: when a TpAccount is invalidated (deleted), signal connection disconnection first (smcv) * Exit the main loop gracefully when CMs are disconnected from the session bus (sjoerd) * fd.o #14603: don't set fatal criticals in tp_run_connection_manager, CMs are now responsible for doing this (sjoerd) * fd.o #25600: fix inadvertant GLib 2.20 dependency (jonny) * In code generation tools (glib-ginterface-gen.py), allow D-Bus methods whose names are C keywords (smcv) * Fix with-session-bus.sh dbus-monitor logging when /bin/sh is not bash (smcv) telepathy-glib 0.9.2 (2009-12-03) ================================= The "old-fashioned, with no silly mods" release. Dependencies: * dbus-glib (>= 0.82) is now required Enhancements: * Add tp_value_array_build utility function (sjoerd) * Add tp_g_signal_connect_object, a non-leaky version of g_signal_connect_object (alsuren) * fd.o #25283: add constants for namespaced D-Bus property names, such as TP_PROP_CHANNEL_CHANNEL_TYPE (smcv) * fd.o #25235: add which includes the most commonly-used headers (danni) Fixes: * fd.o #24257: make sure tp_account_prepare, tp_account_manager_prepare will fail if the object is invalidated, rather than never finishing (alsuren) * fd.o #25051: fix a use-after-free in TpAccountManager by disconnecting signal handlers on destruction (alsuren) * fd.o #24654: fix a potential use-after-free in TpAccount and TpAccountManager by copying the list of features required (alsuren) * Future-proof TpAccount and TpAccountManager to allow more than one Feature (alsuren) * fd.o #24394: improve code portability to Windows headers and compilers, based on patches from Matti Reijonen (smcv) * fd.o #25121: fix failure to link when -Wl,--no-add-needed is used, which is the (faster) default behaviour for binutils-gold (Debian #556486) (smcv) * Fix various coverity nits, including a missing call to va_end, and a typo in the documentation (smcv) * fd.o #25359: alter code generation to cope with arbitrary UTF-8 in the spec (wjt) * fd.o #25335: glib-client-gen: annotate deprecated D-Bus methods (jonny) * Don't rely on enum types being unsigned (sjoerd) * fd.o #25181: avoid unnecessary D-Bus calls re-fetching existing TpContact objects (alsuren) * fd.o #25384: if accounts fail to prepare while the account manager is preparing, drop them from the list of valid accounts rather than never terminating (alsuren) * If the fake AccountManager doesn't appear for some reason during AM regression tests, don't start the system implementation (alsuren) * Fix a theoretical reference-leak in TpAccountManager, and some memory leaks in examples and regression tests (smcv) telepathy-glib 0.9.1 (2009-10-15) ================================= The "to quote Rob: sdflkaytliahdskljfhgaqgh;shf" release. Fixes: * Corrected the GLib dependency to 2.20 (this was also needed for 0.9.0, but that fact was undocumented) (smcv) * Corrected the error message given when a write-only D-Bus property is read (Pekka Pessi) * Work around GLib 2.20 being less const-correct than 2.22 (jonny) * fd.o #23853: if a connection manager is discovered not to be running while TpConnectionManager has a ListProtocols call in-flight, then a new instance of the CM starts up and replies to that call, don't crash with an assertion failure (smcv) * If a connection manager returns error from GetParameters(), don't dereference a NULL pointer and segfault (smcv) * When asked to activate or introspect a connection manager, don't do anything until we have at least worked out whether it was initially running, in order to provide the documented behaviour (smcv) * When getting parameter details from a running connection manager, consider parameters called "password" or ending with "-password" to be secret even if they lack the SECRET flag, as was already done when reading .manager files (smcv) telepathy-glib 0.9.0 (2009-09-28) ================================= The "purging all the lies" release. Dependencies: * GLib 2.20 is now required. * telepathy-glib now links to GIO as well as GLib and GObject (in practice they're packaged together, and we already depended on a new enough GLib version that it would come with GIO). Enhancements: * TpAccountManager, TpAccount: add convenience API similar to libempathy's (jonny, with contributions from wjt/danni/sjoerd/smcv) * telepathy-glib now uses Automake 1.11's "silent rules" feature for kernel-style output; as a result, we no longer use shave. If you were previously using --enable-shave to get prettier output, use --enable-silent-rules instead, and upgrade to Automake >= 1.11 if you will be altering the build system. (jonny) telepathy-glib 0.8.0 (2009-09-24) ================================= The "line in the sand" release. This release begins a bugfix-only 0.8.x branch, in which new API/ABI will no longer be added; 0.9.x development releases will continue to be made from the master branch. Summary of API changes since 0.6.x: * Since 0.7.35, it is no longer guaranteed that the self-handle in TpBaseConnection is set to 0 when the state changes to DISCONNECTED; instead, it remains valid until the connection is disposed. This will cause assertion failures during disconnection in telepathy-sofiasip < 0.5.17 and telepathy-gabble < 0.7.9. Summary of major enhancements since 0.6.x: * updated telepathy-spec from 0.16.x to 0.18.0, with many new interfaces, the AccountManager, the ChannelDispatcher, and Clients * added TpProxy, a base class representing remote D-Bus objects (see ) * added subclasses of TpProxy for all the major Telepathy objects (apart from Debug, which will be added later) * added TpContact, an object representing a Telepathy contact * added macros for interface-name GQuarks, and for Telepathy dbus-glib GTypes * added the tp_asv_get_foo() family of functions to manipulate a{sv} maps * used versioned symbols to document the ABI * implemented various simple example connection managers and clients Changes since 0.7.37: * spec: update from 0.17.28 to 0.18.0 (no real changes) (smcv) * ContactList example CM: fix a crash during shutdown (andrunko) * StreamedMedia example CM: check for direction changes correctly (andrunko) telepathy-glib-0.24.2/docs/0000755000175000017500000000000014006623343012443 500000000000000telepathy-glib-0.24.2/docs/Makefile.am0000644000175000017500000000002412652510705014415 00000000000000SUBDIRS = reference telepathy-glib-0.24.2/docs/Makefile.in0000644000175000017500000005006414006601553014434 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ SUBDIRS = reference all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/docs/reference/0000755000175000017500000000000014006623343014401 500000000000000telepathy-glib-0.24.2/docs/reference/html/0000755000175000017500000000000014006623344015346 500000000000000telepathy-glib-0.24.2/docs/reference/html/TpDynamicHandleRepo.html0000644000175000017500000006560114006623343022015 00000000000000 TpDynamicHandleRepo: telepathy-glib API Reference Manual

TpDynamicHandleRepo

TpDynamicHandleRepo — general handle repository implementation, with dynamic handle allocation and recycling

Properties

gpointer default-normalize-context Read / Write / Construct Only
gpointer normalize-function Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── TpDynamicHandleRepo

Implemented Interfaces

TpDynamicHandleRepo implements TpHandleRepoIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A dynamic handle repository will accept arbitrary handles, which can be created and destroyed at runtime.

The “handle-type” property must be set at construction time; the “normalize-function” property may be set to perform validation and normalization on handle ID strings.

Most connection managers will use this for all supported handle types except TP_HANDLE_TYPE_LIST.

Changed in 0.13.8: handles are no longer reference-counted, and the reference-count-related functions are stubs. Instead, handles remain valid until the handle repository is destroyed.

Functions

tp_dynamic_handle_repo_lookup_exact ()

TpHandle
tp_dynamic_handle_repo_lookup_exact (TpHandleRepoIface *irepo,
                                     const char *id);

Look up a name in the repository, returning the corresponding handle if it is present in the repository, without creating a new reference.

Unlike tp_handle_lookup() this function does not perform any normalization; it just looks for the literal string you requested. This can be useful to call from normalization callbacks (for instance, Gabble's contacts repository uses it to see whether we already know that a JID belongs to a multi-user chat room member).

Parameters

irepo

The handle repository

 

id

The name to be looked up

 

Returns

the handle corresponding to the given ID, or 0 if not present


tp_dynamic_handle_repo_new ()

TpHandleRepoIface *
tp_dynamic_handle_repo_new (TpHandleType handle_type,
                            TpDynamicHandleRepoNormalizeFunc normalize_func,
                            gpointer default_normalize_context);

Parameters

handle_type

The handle type

 

normalize_func

The function to be used to normalize and validate handles, or NULL to accept all handles as-is

 

default_normalize_context

The context pointer to be passed to the normalize_func if a NULL context is passed to tp_handle_lookup() and tp_handle_ensure(); this may itself be NULL

 

Returns

a new dynamic handle repository


tp_dynamic_handle_repo_set_normalize_async ()

void
tp_dynamic_handle_repo_set_normalize_async
                               (TpDynamicHandleRepo *self,
                                TpDynamicHandleRepoNormalizeAsync normalize_async,
                                TpDynamicHandleRepoNormalizeFinish normalize_finish);

Set an asynchronous normalization function. This is to be used if handle normalization requires a server round-trip. See tp_handle_ensure_async().

Parameters

Since: 0.19.2


TpDynamicHandleRepoNormalizeFunc ()

gchar *
(*TpDynamicHandleRepoNormalizeFunc) (TpHandleRepoIface *repo,
                                     const gchar *id,
                                     gpointer context,
                                     GError **error);

Signature of the normalization function optionally used by TpDynamicHandleRepo instances.

Parameters

repo

The repository on which tp_handle_lookup() or tp_handle_ensure() was called

 

id

The name to be normalized

 

context

Arbitrary context passed to tp_handle_lookup() or tp_handle_ensure()

 

error

Used to raise the Telepathy error InvalidHandle with an appropriate message if NULL is returned

 

Returns

a normalized version of id (to be freed with g_free by the caller), or NULL if id is not valid for this repository


TpDynamicHandleRepoNormalizeAsync ()

void
(*TpDynamicHandleRepoNormalizeAsync) (TpHandleRepoIface *repo,
                                      TpBaseConnection *connection,
                                      const gchar *id,
                                      gpointer context,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Signature of a function to asynchronously normalize an identifier. See tp_dynamic_handle_repo_set_normalize_async().

Parameters

repo

The repository on which tp_handle_ensure_async() was called

 

connection

the TpBaseConnection using this handle repo

 

id

The name to be normalized

 

context

Arbitrary context passed to tp_handle_ensure_async()

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.19.2


TpDynamicHandleRepoNormalizeFinish ()

gchar *
(*TpDynamicHandleRepoNormalizeFinish) (TpHandleRepoIface *repo,
                                       GAsyncResult *result,
                                       GError **error);

Signature of a function to finish the operation started with TpDynamicHandleRepoNormalizeAsync.

Parameters

repo

The repository on which tp_handle_ensure_async() was called

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.19.2

Types and Values

TpDynamicHandleRepo

typedef struct _TpDynamicHandleRepo TpDynamicHandleRepo;

A dynamic handle repository. The contents of the struct are private.


TpDynamicHandleRepoClass

typedef struct _TpDynamicHandleRepoClass TpDynamicHandleRepoClass;

The class of a dynamic handle repository. The contents of the struct are private.

Property Details

The “default-normalize-context” property

  “default-normalize-context” gpointer

An optional default context given to the “normalize-function” if NULL is passed as context to the ensure or lookup functions, e.g. when RequestHandle is called via D-Bus. The default is NULL.

Owner: TpDynamicHandleRepo

Flags: Read / Write / Construct Only


The “normalize-function” property

  “normalize-function”       gpointer

An optional TpDynamicHandleRepoNormalizeFunc used to validate and normalize handle IDs. If NULL (which is the default), any handle ID is accepted as-is (equivalent to supplying a pointer to a function that just calls g_strdup).

Owner: TpDynamicHandleRepo

Flags: Read / Write / Construct Only

See Also

TpHandleRepoIface, TpStaticHandleRepo

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-capabilities.html0000644000175000017500000016731314006623344023530 00000000000000 TpCapabilities: telepathy-glib API Reference Manual

TpCapabilities

TpCapabilities — object representing capabilities

Properties

GPtrArray_GValueArray_GHashTable_gchararray+GValue_+GStrv__* channel-classes Read / Write / Construct Only
GVariant * channel-classes-variant Read
gboolean contact-specific Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpCapabilities

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpCapabilities objects represent the capabilities a TpConnection or a TpContact supports.

Functions

tp_capabilities_get_channel_classes ()

GPtrArray *
tp_capabilities_get_channel_classes (TpCapabilities *self);

Parameters

self

a TpCapabilities object

 

Returns

the same GPtrArray as the “channel-classes” property.

[transfer none][element-type GHashTable]

Since: 0.11.3


tp_capabilities_dup_channel_classes_variant ()

GVariant *
tp_capabilities_dup_channel_classes_variant
                               (TpCapabilities *self);

Return the “channel-classes-variant” property

Parameters

self

a TpCapabilities

 

Returns

the value of the “channel-classes-variant” property.

[transfer full]

Since: 0.19.0


tp_capabilities_is_specific_to_contact ()

gboolean
tp_capabilities_is_specific_to_contact
                               (TpCapabilities *self);

Parameters

self

a TpCapabilities object

 

Returns

the same gboolean as the “contact-specific” property

Since: 0.11.3


tp_capabilities_supports_text_chatrooms ()

gboolean
tp_capabilities_supports_text_chatrooms
                               (TpCapabilities *self);

If the “contact-specific” property is FALSE, this function checks if named text chatrooms can be joined by providing a chatroom identifier, for instance by calling tp_account_channel_request_new_text() followed by tp_account_channel_request_set_target_id() with TP_HANDLE_TYPE_ROOM.

If the “contact-specific” property is TRUE, this function checks if the contact associated with this TpCapabilities can be invited to named text chatrooms.

If the protocol is such that chatrooms can be joined or contacts can be invited, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return FALSE.

Parameters

self

a TpCapabilities object

 

Returns

TRUE if a channel request containing Text as ChannelType, HandleTypeRoom as TargetHandleType and a channel identifier can be expected to work, FALSE otherwise.

Since: 0.11.3


tp_capabilities_supports_text_chats ()

gboolean
tp_capabilities_supports_text_chats (TpCapabilities *self);

Return whether private text channels can be established by providing a contact identifier, for instance by calling tp_account_channel_request_new_text() followed by tp_account_channel_request_set_target_contact().

If the protocol is such that text chats can be established, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return FALSE.

Parameters

self

a TpCapabilities object

 

Returns

TRUE if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, FALSE otherwise.

Since: 0.11.3


tp_capabilities_supports_sms ()

gboolean
tp_capabilities_supports_sms (TpCapabilities *self);

If the “contact-specific” property is FALSE, this function checks if SMS text channels can be requested with the connection associated with this TpCapabilities.

If the “contact-specific” property is TRUE, this function checks if the contact associated with this TpCapabilities supports SMS text channels.

Parameters

self

a TpCapabilities object

 

Returns

TRUE if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType, a channel identifier and TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL set to TRUE can be expected to work, FALSE otherwise.

Since: 0.19.0


tp_capabilities_supports_audio_call ()

gboolean
tp_capabilities_supports_audio_call (TpCapabilities *self,
                                     TpHandleType handle_type);

Return whether audio calls can be established, for instance by calling tp_account_channel_request_new_audio_call(), followed by tp_account_channel_request_set_target_id() with handle_type .

To check whether requests using tp_account_channel_request_set_target_contact() would work, set handle_type to TP_HANDLE_TYPE_CONTACT.

Parameters

self

a TpCapabilities object

 

handle_type

the handle type of the call; TP_HANDLE_TYPE_CONTACT for private, TP_HANDLE_TYPE_ROOM or TP_HANDLE_TYPE_NONE for conference (depending on the protocol)

 

Returns

TRUE if a channel request containing Call as ChannelType, handle_type as TargetHandleType, a True value for InitialAudio and an identifier of the appropriate type can be expected to work, FALSE otherwise.

Since: 0.17.6


tp_capabilities_supports_audio_video_call ()

gboolean
tp_capabilities_supports_audio_video_call
                               (TpCapabilities *self,
                                TpHandleType handle_type);

Return whether audio/video calls can be established, for instance by calling tp_account_channel_request_new_audio_video_call(), followed by tp_account_channel_request_set_target_id() with handle_type .

To check whether requests using tp_account_channel_request_set_target_contact() would work, set handle_type to TP_HANDLE_TYPE_CONTACT.

Parameters

self

a TpCapabilities object

 

handle_type

the handle type of the call; TP_HANDLE_TYPE_CONTACT for private, TP_HANDLE_TYPE_ROOM or TP_HANDLE_TYPE_NONE for conference (depending on the protocol)

 

Returns

TRUE if a channel request containing Call as ChannelType, handle_type as TargetHandleType, a True value for InitialAudio/InitialVideo and an identifier of the appropriate type can be expected to work, FALSE otherwise.

Since: 0.17.6


tp_capabilities_supports_file_transfer ()

gboolean
tp_capabilities_supports_file_transfer
                               (TpCapabilities *self);

Return whether private file transfer can be established by providing a contact identifier.

Parameters

self

a TpCapabilities object

 

Returns

TRUE if a channel request containing FileTransfer as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, FALSE otherwise.

Since: 0.17.6


tp_capabilities_supports_file_transfer_description ()

gboolean
tp_capabilities_supports_file_transfer_description
                               (TpCapabilities *self);

Parameters

self

a TpCapabilities object

 

Returns

TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's description

Since: 0.19.0


tp_capabilities_supports_file_transfer_initial_offset ()

gboolean
tp_capabilities_supports_file_transfer_initial_offset
                               (TpCapabilities *self);

Return whether an initial offset other than 0 can be specified on outgoing file transfers. This can be used to resume partial transfers, by omitting the part that has already been sent.

Parameters

self

a TpCapabilities object

 

Returns

TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify an initial offset greater than 0

Since: 0.19.0


tp_capabilities_supports_file_transfer_timestamp ()

gboolean
tp_capabilities_supports_file_transfer_timestamp
                               (TpCapabilities *self);

Parameters

self

a TpCapabilities object

 

Returns

TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's timestamp

Since: 0.19.0


tp_capabilities_supports_file_transfer_uri ()

gboolean
tp_capabilities_supports_file_transfer_uri
                               (TpCapabilities *self);

Parameters

self

a TpCapabilities object

 

Returns

TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's URI

Since: 0.19.0


tp_capabilities_supports_stream_tubes ()

gboolean
tp_capabilities_supports_stream_tubes (TpCapabilities *self,
                                       TpHandleType handle_type,
                                       const gchar *service);

If the “contact-specific” property is TRUE, this function checks if the contact associated with this TpCapabilities supports stream tubes with handle_type as TargetHandleType. If service is not NULL, it also checks if it supports stream tubes with service as TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE.

If the “contact-specific” property is FALSE, this function checks if the connection supports requesting stream tube channels with handle_type as ChannelType. The service argument is unused in this case.

Parameters

self

a TpCapabilities object

 

handle_type

the handle type of the tube (either TP_HANDLE_TYPE_CONTACT or TP_HANDLE_TYPE_ROOM)

 

service

the service of the tube, or NULL

 

Returns

TRUE if the contact or connection supports this type of stream tubes.

Since: 0.13.0


tp_capabilities_supports_dbus_tubes ()

gboolean
tp_capabilities_supports_dbus_tubes (TpCapabilities *self,
                                     TpHandleType handle_type,
                                     const gchar *service_name);

If the “contact-specific” property is TRUE, this function checks if the contact associated with this TpCapabilities supports D-Bus tubes with handle_type as TargetHandleType. If service_name is not NULL, it also checks if it supports stream tubes with service as TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME.

If the “contact-specific” property is FALSE, this function checks if the connection supports requesting D-Bus tube channels with handle_type as ChannelType. The service_name argument is unused in this case.

Parameters

self

a TpCapabilities object

 

handle_type

the handle type of the tube (either TP_HANDLE_TYPE_CONTACT or TP_HANDLE_TYPE_ROOM)

 

service_name

the service name of the tube, or NULL

 

Returns

TRUE if the contact or connection supports this type of D-Bus tubes.

Since: 0.13.0


tp_capabilities_supports_contact_search ()

gboolean
tp_capabilities_supports_contact_search
                               (TpCapabilities *self,
                                gboolean *with_limit,
                                gboolean *with_server);

Return whether this protocol or connection can perform contact searches. Optionally, also return whether a limited number of results can be specified, and whether alternative servers can be searched.

Parameters

self

a TpCapabilities object

 

with_limit

if not NULL, used to return TRUE if the limit parameter to tp_contact_search_new_async() and tp_contact_search_reset_async() can be nonzero.

[out]

with_server

if not NULL, used to return TRUE if the server parameter to tp_contact_search_new_async() and tp_contact_search_reset_async() can be non-NULL.

[out]

Returns

TRUE if TpContactSearch can be used.

Since: 0.13.11


tp_capabilities_supports_room_list ()

gboolean
tp_capabilities_supports_room_list (TpCapabilities *self,
                                    gboolean *with_server);

Discovers whether this protocol or connection supports listing rooms. Specifically, if this function returns TRUE, a room list channel can be requested as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
GHashTable *request;
TpAccountChannelRequest *req;

request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
      TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
    NULL);

req = tp_account_channel_request_new (account, request,
   TP_USER_ACTION_TIME_CURRENT_TIME);

tp_account_channel_request_create_and_handle_channel_async (req, NULL,
    create_channel_cb, NULL);

g_object_unref (req);
g_hash_table_unref (request);

If with_server is set to TRUE, a list of rooms on a particular server can be requested as follows:

1
2
3
4
5
6
7
8
/\* Same code as above but with request defined using: *\/
request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
      TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE,
    TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, G_TYPE_STRING,
      "characters.shakespeare.lit",
    NULL);

Parameters

self

a TpCapabilities object

 

with_server

if not NULL, used to return TRUE if the TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER property can be defined when requesting a RoomList channel.

[out]

Returns

TRUE if a channel request containing RoomList as ChannelType, HandleTypeNone as TargetHandleType can be expected to work, FALSE otherwise.

Since: 0.13.14

Types and Values

TpCapabilities

typedef struct _TpCapabilities TpCapabilities;

An object representing capabilities a TpConnection or TpContact supports.

Since: 0.11.3

Property Details

The “channel-classes” property

  “channel-classes”          GPtrArray_GValueArray_GHashTable_gchararray+GValue_+GStrv__*

The underlying data structure used by Telepathy to represent the requests that can succeed.

This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned GPtrArray of TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS.

The higher-level methods like tp_capabilities_supports_text_chats() are likely to be more useful to the majority of clients.

Owner: TpCapabilities

Flags: Read / Write / Construct Only


The “channel-classes-variant” property

  “channel-classes-variant”  GVariant *

The underlying data structure used by Telepathy to represent the requests that can succeed.

This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned GVariant of type a(a{sv}as).

The higher-level methods like tp_capabilities_supports_text_chats() are likely to be more useful to the majority of clients.

Owner: TpCapabilities

Flags: Read

Allowed values: GVariant<a(a{sv}as)>

Default value: NULL

Since: 0.19.0


The “contact-specific” property

  “contact-specific”         gboolean

Whether this object accurately describes the capabilities of a particular contact, or if it's only a guess based on the capabilities of the underlying connection.

Owner: TpCapabilities

Flags: Read / Write / Construct Only

Default value: FALSE

telepathy-glib-0.24.2/docs/reference/html/TpTLSCertificateRejection.html0000644000175000017500000004652414006623343023142 00000000000000 TpTLSCertificateRejection: telepathy-glib API Reference Manual

TpTLSCertificateRejection

TpTLSCertificateRejection — a certificate rejection

Properties

gchar * dbus-error Read / Write / Construct Only
GVariant * details Read / Write / Construct Only
GError * error Read / Write / Construct Only
guint reason Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpTLSCertificateRejection

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpTLSCertificateRejection is a small object used by TpTLSCertificate to represent the rejection of a certificate.

Functions

tp_tls_certificate_rejection_get_dbus_error ()

const gchar *
tp_tls_certificate_rejection_get_dbus_error
                               (TpTLSCertificateRejection *self);

Return the “dbus-error” property

Parameters

Returns

the value of “dbus-error” property

Since: 0.19.0


tp_tls_certificate_rejection_get_details ()

GVariant *
tp_tls_certificate_rejection_get_details
                               (TpTLSCertificateRejection *self);

Return the “details” property

Parameters

Returns

the value of “details” property

Since: 0.19.0


tp_tls_certificate_rejection_get_error ()

const GError *
tp_tls_certificate_rejection_get_error
                               (TpTLSCertificateRejection *self);

Return the “error” property

Parameters

Returns

the value of “error” property

Since: 0.19.0


tp_tls_certificate_rejection_get_reason ()

TpTLSCertificateRejectReason
tp_tls_certificate_rejection_get_reason
                               (TpTLSCertificateRejection *self);

Return the “reason” property

Parameters

Returns

the value of “reason” property

Since: 0.19.0


tp_tls_certificate_rejection_raise_error ()

gboolean
tp_tls_certificate_rejection_raise_error
                               (TpTLSCertificateRejection *self,
                                GError **error);

Convenient function to raise the “error” property in language binding supporting this feature.

Parameters

self

a TpTLSCertificateRejection

 

error

a GError to fill.

[out][allow-none][transfer full]

Returns

FALSE

Since: 0.19.0

Types and Values

struct TpTLSCertificateRejection

struct TpTLSCertificateRejection;

Data structure representing a TpTLSCertificateRejection.

Since: 0.19.0

Property Details

The “dbus-error” property

  “dbus-error”               gchar *

The D-Bus error name of the rejection

Owner: TpTLSCertificateRejection

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.0


The “details” property

  “details”                  GVariant *

A G_VARIANT_TYPE_VARDICT containing the details of the rejection

Owner: TpTLSCertificateRejection

Flags: Read / Write / Construct Only

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.0


The “error” property

  “error”                    GError *

a GError (likely to be in the TP_ERROR domain) indicating the reason of the rejection

Owner: TpTLSCertificateRejection

Flags: Read / Write / Construct Only

Since: 0.19.0


The “reason” property

  “reason”                   guint

TpTLSCertificateRejectReason representing the reason of the rejection

Owner: TpTLSCertificateRejection

Flags: Read / Write / Construct Only

Allowed values: <= 10

Default value: 0

Since: 0.19.0

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-media-interfaces.html0000644000175000017500000127726314006623344024306 00000000000000 TpMediaSessionHandler, TpMediaStreamHandler: telepathy-glib API Reference Manual

TpMediaSessionHandler, TpMediaStreamHandler

TpMediaSessionHandler, TpMediaStreamHandler — proxy objects for Telepathy media streaming

Functions

TpMediaSessionHandler * tp_media_session_handler_new ()
void tp_media_session_handler_init_known_interfaces ()
TpMediaStreamHandler * tp_media_stream_handler_new ()
void tp_media_stream_handler_init_known_interfaces ()
void (*tp_cli_media_session_handler_callback_for_error) ()
TpProxyPendingCall * tp_cli_media_session_handler_call_error ()
gboolean tp_cli_media_session_handler_run_error ()
void (*tp_cli_media_session_handler_callback_for_ready) ()
TpProxyPendingCall * tp_cli_media_session_handler_call_ready ()
gboolean tp_cli_media_session_handler_run_ready ()
void (*tp_cli_media_session_handler_signal_callback_new_stream_handler) ()
TpProxySignalConnection * tp_cli_media_session_handler_connect_to_new_stream_handler ()
void (*tp_cli_media_stream_handler_callback_for_codec_choice) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_codec_choice ()
gboolean tp_cli_media_stream_handler_run_codec_choice ()
void (*tp_cli_media_stream_handler_callback_for_error) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_error ()
gboolean tp_cli_media_stream_handler_run_error ()
void (*tp_cli_media_stream_handler_callback_for_native_candidates_prepared) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_native_candidates_prepared ()
gboolean tp_cli_media_stream_handler_run_native_candidates_prepared ()
void (*tp_cli_media_stream_handler_callback_for_new_active_candidate_pair) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_new_active_candidate_pair ()
gboolean tp_cli_media_stream_handler_run_new_active_candidate_pair ()
void (*tp_cli_media_stream_handler_callback_for_new_native_candidate) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_new_native_candidate ()
gboolean tp_cli_media_stream_handler_run_new_native_candidate ()
void (*tp_cli_media_stream_handler_callback_for_ready) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_ready ()
gboolean tp_cli_media_stream_handler_run_ready ()
void (*tp_cli_media_stream_handler_callback_for_set_local_codecs) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_set_local_codecs ()
gboolean tp_cli_media_stream_handler_run_set_local_codecs ()
void (*tp_cli_media_stream_handler_callback_for_stream_state) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_stream_state ()
gboolean tp_cli_media_stream_handler_run_stream_state ()
void (*tp_cli_media_stream_handler_callback_for_supported_codecs) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_supported_codecs ()
gboolean tp_cli_media_stream_handler_run_supported_codecs ()
void (*tp_cli_media_stream_handler_signal_callback_add_remote_candidate) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_add_remote_candidate ()
void (*tp_cli_media_stream_handler_signal_callback_close) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_close ()
void (*tp_cli_media_stream_handler_signal_callback_remove_remote_candidate) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_remove_remote_candidate ()
void (*tp_cli_media_stream_handler_signal_callback_set_active_candidate_pair) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_active_candidate_pair ()
void (*tp_cli_media_stream_handler_signal_callback_set_remote_candidate_list) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_remote_candidate_list ()
void (*tp_cli_media_stream_handler_signal_callback_set_remote_codecs) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_remote_codecs ()
void (*tp_cli_media_stream_handler_signal_callback_set_stream_playing) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_stream_playing ()
void (*tp_cli_media_stream_handler_signal_callback_set_stream_sending) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_stream_sending ()
void (*tp_cli_media_stream_handler_signal_callback_start_telephony_event) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_start_telephony_event ()
void (*tp_cli_media_stream_handler_signal_callback_stop_telephony_event) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_stop_telephony_event ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_hold_state ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_unhold_failure ()
void (*tp_cli_media_stream_handler_callback_for_hold_state) ()
void (*tp_cli_media_stream_handler_callback_for_unhold_failure) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_stream_held ()
gboolean tp_cli_media_stream_handler_run_hold_state ()
gboolean tp_cli_media_stream_handler_run_unhold_failure ()
void (*tp_cli_media_stream_handler_signal_callback_set_stream_held) ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_codecs_updated ()
void (*tp_cli_media_stream_handler_callback_for_codecs_updated) ()
gboolean tp_cli_media_stream_handler_run_codecs_updated ()
void (*tp_cli_media_stream_handler_signal_callback_start_named_telephony_event) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_start_named_telephony_event ()
void (*tp_cli_media_stream_handler_signal_callback_start_sound_telephony_event) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_start_sound_telephony_event ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_new_active_transport_pair ()
void (*tp_cli_media_stream_handler_callback_for_new_active_transport_pair) ()
gboolean tp_cli_media_stream_handler_run_new_active_transport_pair ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_supported_feedback_messages ()
TpProxyPendingCall * tp_cli_media_stream_handler_call_supported_header_extensions ()
void (*tp_cli_media_stream_handler_callback_for_supported_feedback_messages) ()
void (*tp_cli_media_stream_handler_callback_for_supported_header_extensions) ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages ()
TpProxySignalConnection * tp_cli_media_stream_handler_connect_to_set_remote_header_extensions ()
gboolean tp_cli_media_stream_handler_run_supported_feedback_messages ()
gboolean tp_cli_media_stream_handler_run_supported_header_extensions ()
void (*tp_cli_media_stream_handler_signal_callback_set_remote_feedback_messages) ()
void (*tp_cli_media_stream_handler_signal_callback_set_remote_header_extensions) ()

Object Hierarchy

    GObject
    ╰── TpProxy
        ├── TpMediaSessionHandler
        ╰── TpMediaStreamHandler

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This module provides access to the auxiliary objects used to implement TpSvcChannelTypeStreamedMedia.

Functions

tp_media_session_handler_new ()

TpMediaSessionHandler *
tp_media_session_handler_new (TpDBusDaemon *dbus,
                              const gchar *unique_name,
                              const gchar *object_path,
                              GError **error);

Parameters

dbus

a D-Bus daemon; may not be NULL

 

unique_name

the unique name of the connection process; may not be NULL or a well-known name

 

object_path

the object path of the media session handler; may not be NULL

 

error

used to indicate the error if NULL is returned

 

Returns

a new media session handler proxy, or NULL on invalid arguments

Since: 0.7.1


tp_media_session_handler_init_known_interfaces ()

void
tp_media_session_handler_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpMediaSessionHandler have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_MEDIA_SESSION_HANDLER.

Since: 0.7.32


tp_media_stream_handler_new ()

TpMediaStreamHandler *
tp_media_stream_handler_new (TpDBusDaemon *dbus,
                             const gchar *unique_name,
                             const gchar *object_path,
                             GError **error);

Parameters

dbus

a D-Bus daemon; may not be NULL

 

unique_name

the unique name of the connection process; may not be NULL or a well-known name

 

object_path

the object path of the media stream handler; may not be NULL

 

error

used to indicate the error if NULL is returned

 

Returns

a new media stream handler proxy, or NULL on invalid arguments

Since: 0.7.1


tp_media_stream_handler_init_known_interfaces ()

void
tp_media_stream_handler_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpMediaStreamHandler have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_MEDIA_STREAM_HANDLER.

Since: 0.7.32


tp_cli_media_session_handler_callback_for_error ()

void
(*tp_cli_media_session_handler_callback_for_error)
                               (TpMediaSessionHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_media_session_handler_callback_for_error is deprecated and should not be used in newly-written code.

Use StreamHandler.Error on each StreamHandler object instead.

Signature of the callback called when a Error method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_session_handler_call_error ()

TpProxyPendingCall *
tp_cli_media_session_handler_call_error
                               (TpMediaSessionHandler *proxy,
                                gint timeout_ms,
                                guint in_Error_Code,
                                const gchar *in_Message,
                                tp_cli_media_session_handler_callback_for_error callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_media_session_handler_call_error is deprecated and should not be used in newly-written code.

Use StreamHandler.Error on each StreamHandler object instead.

Start a Error method call.

Informs the connection manager that an error occured in this session. If used, the connection manager must terminate the session and all of the streams within it, and may also emit a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.StreamedMedia">StreamError</tp:dbus-ref> signal on the channel for each stream within the session.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Error_Code

Used to pass an 'in' argument: (Undocumented) (TpMediaStreamError)

 

in_Message

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_session_handler_run_error ()

gboolean
tp_cli_media_session_handler_run_error
                               (TpMediaSessionHandler *proxy,
                                gint timeout_ms,
                                guint in_Error_Code,
                                const gchar *in_Message,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_session_handler_run_error is deprecated and should not be used in newly-written code.

Use StreamHandler.Error on each StreamHandler object instead.

Call the method Error and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Informs the connection manager that an error occured in this session. If used, the connection manager must terminate the session and all of the streams within it, and may also emit a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.StreamedMedia">StreamError</tp:dbus-ref> signal on the channel for each stream within the session.

Parameters

proxy

A TpMediaSessionHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Error_Code

Used to pass an 'in' argument: (Undocumented) (TpMediaStreamError)

 

in_Message

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_session_handler_callback_for_ready ()

void
(*tp_cli_media_session_handler_callback_for_ready)
                               (TpMediaSessionHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Ready method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_session_handler_call_ready ()

TpProxyPendingCall *
tp_cli_media_session_handler_call_ready
                               (TpMediaSessionHandler *proxy,
                                gint timeout_ms,
                                tp_cli_media_session_handler_callback_for_ready callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Ready method call.

Inform the connection manager that a client is ready to handle this session handler (i.e. that it has connected to the <tp:member-ref>NewStreamHandler</tp:member-ref> signal and done any other necessary setup).

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_session_handler_run_ready ()

gboolean
tp_cli_media_session_handler_run_ready
                               (TpMediaSessionHandler *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_session_handler_run_ready is deprecated and should not be used in newly-written code.

Call the method Ready and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager that a client is ready to handle this session handler (i.e. that it has connected to the <tp:member-ref>NewStreamHandler</tp:member-ref> signal and done any other necessary setup).

Parameters

proxy

A TpMediaSessionHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_session_handler_signal_callback_new_stream_handler ()

void
(*tp_cli_media_session_handler_signal_callback_new_stream_handler)
                               (TpMediaSessionHandler *proxy,
                                const gchar *arg_Stream_Handler,
                                guint arg_ID,
                                guint arg_Media_Type,
                                guint arg_Direction,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewStreamHandler.

Parameters

proxy

The proxy on which tp_cli_media_session_handler_connect_to_new_stream_handler() was called

 

arg_Stream_Handler

The path of a new object implementing the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Media">StreamHandler</tp:dbus-ref> interface.

 

arg_ID

The unique ID of the new stream

 

arg_Media_Type

Type of media that this stream should handle (TpMediaStreamType)

 

arg_Direction

Direction of this stream (TpMediaStreamDirection)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_session_handler_connect_to_new_stream_handler ()

TpProxySignalConnection *
tp_cli_media_session_handler_connect_to_new_stream_handler
                               (TpMediaSessionHandler *proxy,
                                tp_cli_media_session_handler_signal_callback_new_stream_handler callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewStreamHandler.

Emitted when a new stream handler has been created for this session.

Parameters

proxy

A TpMediaSessionHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_callback_for_codec_choice ()

void
(*tp_cli_media_stream_handler_callback_for_codec_choice)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CodecChoice method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_codec_choice ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_codec_choice
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                guint in_Codec_ID,
                                tp_cli_media_stream_handler_callback_for_codec_choice callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CodecChoice method call.

Inform the connection manager of codec used to receive data.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Codec_ID

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_codec_choice ()

gboolean
tp_cli_media_stream_handler_run_codec_choice
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                guint in_Codec_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_codec_choice is deprecated and should not be used in newly-written code.

Call the method CodecChoice and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager of codec used to receive data.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Codec_ID

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_error ()

void
(*tp_cli_media_stream_handler_callback_for_error)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Error method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_error ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_error
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                guint in_Error_Code,
                                const gchar *in_Message,
                                tp_cli_media_stream_handler_callback_for_error callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Error method call.

Inform the connection manager that an error occured in this stream. The connection manager should emit the StreamError signal for the stream on the relevant channel, and remove the stream from the session.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Error_Code

Used to pass an 'in' argument: ID of error, from the MediaStreamError enumeration (TpMediaStreamError)

 

in_Message

Used to pass an 'in' argument: String describing the error

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_error ()

gboolean
tp_cli_media_stream_handler_run_error (TpMediaStreamHandler *proxy,
                                       gint timeout_ms,
                                       guint in_Error_Code,
                                       const gchar *in_Message,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_media_stream_handler_run_error is deprecated and should not be used in newly-written code.

Call the method Error and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager that an error occured in this stream. The connection manager should emit the StreamError signal for the stream on the relevant channel, and remove the stream from the session.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Error_Code

Used to pass an 'in' argument: ID of error, from the MediaStreamError enumeration (TpMediaStreamError)

 

in_Message

Used to pass an 'in' argument: String describing the error

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_native_candidates_prepared ()

void
(*tp_cli_media_stream_handler_callback_for_native_candidates_prepared)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NativeCandidatesPrepared method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_native_candidates_prepared ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_native_candidates_prepared
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                tp_cli_media_stream_handler_callback_for_native_candidates_prepared callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NativeCandidatesPrepared method call.

Informs the connection manager that all possible native candisates have been discovered for the moment.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_native_candidates_prepared ()

gboolean
tp_cli_media_stream_handler_run_native_candidates_prepared
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_native_candidates_prepared is deprecated and should not be used in newly-written code.

Call the method NativeCandidatesPrepared and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Informs the connection manager that all possible native candisates have been discovered for the moment.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_new_active_candidate_pair ()

void
(*tp_cli_media_stream_handler_callback_for_new_active_candidate_pair)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NewActiveCandidatePair method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_new_active_candidate_pair ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_new_active_candidate_pair
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Native_Candidate_ID,
                                const gchar *in_Remote_Candidate_ID,
                                tp_cli_media_stream_handler_callback_for_new_active_candidate_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NewActiveCandidatePair method call.

Informs the connection manager that a valid candidate pair has been discovered and streaming is in progress.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Native_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_new_active_candidate_pair ()

gboolean
tp_cli_media_stream_handler_run_new_active_candidate_pair
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Native_Candidate_ID,
                                const gchar *in_Remote_Candidate_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_new_active_candidate_pair is deprecated and should not be used in newly-written code.

Call the method NewActiveCandidatePair and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Informs the connection manager that a valid candidate pair has been discovered and streaming is in progress.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Native_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_new_native_candidate ()

void
(*tp_cli_media_stream_handler_callback_for_new_native_candidate)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NewNativeCandidate method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_new_native_candidate ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_new_native_candidate
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Candidate_ID,
                                const GPtrArray *in_Transports,
                                tp_cli_media_stream_handler_callback_for_new_native_candidate callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NewNativeCandidate method call.

Inform this MediaStreamHandler that a new native transport candidate has been ascertained.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Candidate_ID

Used to pass an 'in' argument: String identifier for this candidate

 

in_Transports

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Array of transports for this candidate, with fields: <ul> <li>component number</li> <li>IP address (as a string)</li> <li>port</li> <li>base network protocol (one of the values of MediaStreamBaseProto)</li> <li>proto subtype (e.g. RTP)</li> <li>proto profile (e.g. AVP)</li> <li>our preference value of this transport (double in range 0.0-1.0 inclusive); 1 signals the most preferred transport</li> <li>transport type, one of the values of MediaStreamTransportType</li> <li>username if authentication is required</li> <li>password if authentication is required</li> </ul>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_new_native_candidate ()

gboolean
tp_cli_media_stream_handler_run_new_native_candidate
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Candidate_ID,
                                const GPtrArray *in_Transports,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_new_native_candidate is deprecated and should not be used in newly-written code.

Call the method NewNativeCandidate and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform this MediaStreamHandler that a new native transport candidate has been ascertained.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Candidate_ID

Used to pass an 'in' argument: String identifier for this candidate

 

in_Transports

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Array of transports for this candidate, with fields: <ul> <li>component number</li> <li>IP address (as a string)</li> <li>port</li> <li>base network protocol (one of the values of MediaStreamBaseProto)</li> <li>proto subtype (e.g. RTP)</li> <li>proto profile (e.g. AVP)</li> <li>our preference value of this transport (double in range 0.0-1.0 inclusive); 1 signals the most preferred transport</li> <li>transport type, one of the values of MediaStreamTransportType</li> <li>username if authentication is required</li> <li>password if authentication is required</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_ready ()

void
(*tp_cli_media_stream_handler_callback_for_ready)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Ready method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_ready ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_ready
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                tp_cli_media_stream_handler_callback_for_ready callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Ready method call.

Inform the connection manager that a client is ready to handle this StreamHandler. Also provide it with info about all supported codecs.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Codecs

Used to pass an 'in' argument: Locally-supported codecs.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_ready ()

gboolean
tp_cli_media_stream_handler_run_ready (TpMediaStreamHandler *proxy,
                                       gint timeout_ms,
                                       const GPtrArray *in_Codecs,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_media_stream_handler_run_ready is deprecated and should not be used in newly-written code.

Call the method Ready and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager that a client is ready to handle this StreamHandler. Also provide it with info about all supported codecs.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Codecs

Used to pass an 'in' argument: Locally-supported codecs.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_set_local_codecs ()

void
(*tp_cli_media_stream_handler_callback_for_set_local_codecs)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetLocalCodecs method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_set_local_codecs ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_set_local_codecs
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                tp_cli_media_stream_handler_callback_for_set_local_codecs callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetLocalCodecs method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Used to provide codecs after Ready(), so the media client can go ready for an incoming call and exchange candidates/codecs before knowing what local codecs are available.</p> <p>This is useful for gatewaying calls between two connection managers. Given an incoming call, you need to call <tp:member-ref>Ready</tp:member-ref> to get the remote codecs before you can use them as the &quot;local&quot; codecs to place the outgoing call, and hence receive the outgoing call's remote codecs to use as the incoming call's &quot;local&quot; codecs.</p> <p>In this situation, you would pass an empty list of codecs to the incoming call's Ready method, then later call SetLocalCodecs on the incoming call in order to respond to the offer.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Codecs

Used to pass an 'in' argument: Locally-supported codecs

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_set_local_codecs ()

gboolean
tp_cli_media_stream_handler_run_set_local_codecs
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_set_local_codecs is deprecated and should not be used in newly-written code.

Call the method SetLocalCodecs and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Used to provide codecs after Ready(), so the media client can go ready for an incoming call and exchange candidates/codecs before knowing what local codecs are available.</p> <p>This is useful for gatewaying calls between two connection managers. Given an incoming call, you need to call <tp:member-ref>Ready</tp:member-ref> to get the remote codecs before you can use them as the &quot;local&quot; codecs to place the outgoing call, and hence receive the outgoing call's remote codecs to use as the incoming call's &quot;local&quot; codecs.</p> <p>In this situation, you would pass an empty list of codecs to the incoming call's Ready method, then later call SetLocalCodecs on the incoming call in order to respond to the offer.</p>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Codecs

Used to pass an 'in' argument: Locally-supported codecs

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_stream_state ()

void
(*tp_cli_media_stream_handler_callback_for_stream_state)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StreamState method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_stream_state ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_stream_state
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                guint in_State,
                                tp_cli_media_stream_handler_callback_for_stream_state callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StreamState method call.

Informs the connection manager of the stream's current state, as as specified in Channel.Type.StreamedMedia::ListStreams.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_State

Used to pass an 'in' argument: (Undocumented) (TpMediaStreamState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_stream_state ()

gboolean
tp_cli_media_stream_handler_run_stream_state
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                guint in_State,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_stream_state is deprecated and should not be used in newly-written code.

Call the method StreamState and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Informs the connection manager of the stream's current state, as as specified in Channel.Type.StreamedMedia::ListStreams.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_State

Used to pass an 'in' argument: (Undocumented) (TpMediaStreamState)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_callback_for_supported_codecs ()

void
(*tp_cli_media_stream_handler_callback_for_supported_codecs)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SupportedCodecs method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_call_supported_codecs ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_supported_codecs
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                tp_cli_media_stream_handler_callback_for_supported_codecs callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SupportedCodecs method call.

Inform the connection manager of the supported codecs for this session. This is called after the connection manager has emitted SetRemoteCodecs to notify what codecs are supported by the peer, and will thus be an intersection of all locally supported codecs (passed to Ready) and those supported by the peer.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Codecs

Used to pass an 'in' argument: Locally supported codecs.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_run_supported_codecs ()

gboolean
tp_cli_media_stream_handler_run_supported_codecs
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_supported_codecs is deprecated and should not be used in newly-written code.

Call the method SupportedCodecs and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager of the supported codecs for this session. This is called after the connection manager has emitted SetRemoteCodecs to notify what codecs are supported by the peer, and will thus be an intersection of all locally supported codecs (passed to Ready) and those supported by the peer.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Codecs

Used to pass an 'in' argument: Locally supported codecs.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_signal_callback_add_remote_candidate ()

void
(*tp_cli_media_stream_handler_signal_callback_add_remote_candidate)
                               (TpMediaStreamHandler *proxy,
                                const gchar *arg_Candidate_ID,
                                const GPtrArray *arg_Transports,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AddRemoteCandidate.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_add_remote_candidate() was called

 

arg_Candidate_ID

String identifier for this candidate

 

arg_Transports

Array of transports for this candidate with fields, as defined in NewNativeCandidate

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_add_remote_candidate ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_add_remote_candidate
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_add_remote_candidate callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AddRemoteCandidate.

Signal emitted when the connection manager wishes to inform the client of a new remote candidate.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_close ()

void
(*tp_cli_media_stream_handler_signal_callback_close)
                               (TpMediaStreamHandler *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Close.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_close() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_close ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_close
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_close callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Close.

Signal emitted when the connection manager wishes the stream to be closed.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_remove_remote_candidate ()

void
(*tp_cli_media_stream_handler_signal_callback_remove_remote_candidate)
                               (TpMediaStreamHandler *proxy,
                                const gchar *arg_Candidate_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RemoveRemoteCandidate.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_remove_remote_candidate() was called

 

arg_Candidate_ID

String identifier for remote candidate to drop

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_remove_remote_candidate ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_remove_remote_candidate
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_remove_remote_candidate callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RemoveRemoteCandidate.

Signal emitted when the connection manager wishes to inform the client that the remote end has removed a previously usable candidate. <tp:rationale> It seemed like a good idea at the time, but wasn't. </tp:rationale>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_set_active_candidate_pair ()

void
(*tp_cli_media_stream_handler_signal_callback_set_active_candidate_pair)
                               (TpMediaStreamHandler *proxy,
                                const gchar *arg_Native_Candidate_ID,
                                const gchar *arg_Remote_Candidate_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetActiveCandidatePair.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_active_candidate_pair() was called

 

arg_Native_Candidate_ID

.

[Undocumented]

arg_Remote_Candidate_ID

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_set_active_candidate_pair ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_active_candidate_pair
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_active_candidate_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetActiveCandidatePair.

Emitted by the connection manager to inform the client that a valid candidate pair has been discovered by the remote end and streaming is in progress.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_set_remote_candidate_list ()

void
(*tp_cli_media_stream_handler_signal_callback_set_remote_candidate_list)
                               (TpMediaStreamHandler *proxy,
                                const GPtrArray *arg_Remote_Candidates,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetRemoteCandidateList.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_remote_candidate_list() was called

 

arg_Remote_Candidates

A list of candidate id and a list of transports as defined in NewNativeCandidate

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_set_remote_candidate_list ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_remote_candidate_list
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_remote_candidate_list callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetRemoteCandidateList.

Signal emitted when the connection manager wishes to inform the client of all the available remote candidates at once.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_set_remote_codecs ()

void
(*tp_cli_media_stream_handler_signal_callback_set_remote_codecs)
                               (TpMediaStreamHandler *proxy,
                                const GPtrArray *arg_Codecs,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetRemoteCodecs.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_remote_codecs() was called

 

arg_Codecs

Codecs supported by the remote peer.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_set_remote_codecs ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_remote_codecs
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_remote_codecs callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetRemoteCodecs.

Signal emitted when the connection manager wishes to inform the client of the codecs supported by the remote end. If these codecs are compatible with the remote codecs, then the client must call <tp:member-ref>SupportedCodecs</tp:member-ref>, otherwise call <tp:member-ref>Error</tp:member-ref>.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_set_stream_playing ()

void
(*tp_cli_media_stream_handler_signal_callback_set_stream_playing)
                               (TpMediaStreamHandler *proxy,
                                gboolean arg_Playing,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetStreamPlaying.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_stream_playing() was called

 

arg_Playing

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_set_stream_playing ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_stream_playing
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_stream_playing callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetStreamPlaying.

If emitted with argument TRUE, this means that the connection manager wishes to set the stream playing; this means that the streaming implementation should expect to receive data. If emitted with argument FALSE this signal is basically meaningless and should be ignored. <tp:rationale> We're very sorry. </tp:rationale>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_set_stream_sending ()

void
(*tp_cli_media_stream_handler_signal_callback_set_stream_sending)
                               (TpMediaStreamHandler *proxy,
                                gboolean arg_Sending,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetStreamSending.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_stream_sending() was called

 

arg_Sending

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_set_stream_sending ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_stream_sending
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_stream_sending callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetStreamSending.

Signal emitted when the connection manager wishes to set whether or not the stream sends to the remote end.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_start_telephony_event ()

void
(*tp_cli_media_stream_handler_signal_callback_start_telephony_event)
                               (TpMediaStreamHandler *proxy,
                                guchar arg_Event,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StartTelephonyEvent.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_start_telephony_event() was called

 

arg_Event

A telephony event code.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_start_telephony_event ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_start_telephony_event
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_start_telephony_event callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StartTelephonyEvent.

Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_stop_telephony_event ()

void
(*tp_cli_media_stream_handler_signal_callback_stop_telephony_event)
                               (TpMediaStreamHandler *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StopTelephonyEvent.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_stop_telephony_event() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_stop_telephony_event ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_stop_telephony_event
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_stop_telephony_event callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StopTelephonyEvent.

Request that any ongoing telephony events (as defined by RFC 4733) being transmitted over this stream are stopped.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_call_hold_state ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_hold_state
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                gboolean in_Held,
                                tp_cli_media_stream_handler_callback_for_hold_state callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a HoldState method call.

Notify the connection manager that the stream's hold state has been changed successfully in response to SetStreamHeld.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Held

Used to pass an 'in' argument: If true, the stream is now on hold.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_call_unhold_failure ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_unhold_failure
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                tp_cli_media_stream_handler_callback_for_unhold_failure callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a UnholdFailure method call.

Notify the connection manager that an attempt to reacquire the necessary hardware or software resources to unhold the stream, in response to SetStreamHeld, has failed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_callback_for_hold_state ()

void
(*tp_cli_media_stream_handler_callback_for_hold_state)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a HoldState method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_callback_for_unhold_failure ()

void
(*tp_cli_media_stream_handler_callback_for_unhold_failure)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UnholdFailure method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_connect_to_set_stream_held ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_stream_held
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_stream_held callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetStreamHeld.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the connection manager wishes to place the stream on hold (so the streaming client should free hardware or software resources) or take the stream off hold (so the streaming client should reacquire the necessary resources).</p> <p>When placing a channel's streams on hold, the connection manager SHOULD notify the remote contact that this will be done (if appropriate in the protocol) before it emits this signal.</p> <tp:rationale> <p>It is assumed that relinquishing a resource will not fail. If it does, the call is probably doomed anyway.</p> </tp:rationale> <p>When unholding a channel's streams, the connection manager SHOULD emit this signal and wait for success to be indicated via HoldState before it notifies the remote contact that the channel has been taken off hold.</p> <tp:rationale> <p>This means that if a resource is unavailable, the remote contact will never even be told that we tried to acquire it.</p> </tp:rationale>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_run_hold_state ()

gboolean
tp_cli_media_stream_handler_run_hold_state
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                gboolean in_Held,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_hold_state is deprecated and should not be used in newly-written code.

Call the method HoldState and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Notify the connection manager that the stream's hold state has been changed successfully in response to SetStreamHeld.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Held

Used to pass an 'in' argument: If true, the stream is now on hold.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_run_unhold_failure ()

gboolean
tp_cli_media_stream_handler_run_unhold_failure
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_unhold_failure is deprecated and should not be used in newly-written code.

Call the method UnholdFailure and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Notify the connection manager that an attempt to reacquire the necessary hardware or software resources to unhold the stream, in response to SetStreamHeld, has failed.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_signal_callback_set_stream_held ()

void
(*tp_cli_media_stream_handler_signal_callback_set_stream_held)
                               (TpMediaStreamHandler *proxy,
                                gboolean arg_Held,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetStreamHeld.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_stream_held() was called

 

arg_Held

If true, the stream is to be placed on hold.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_call_codecs_updated ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_codecs_updated
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                tp_cli_media_stream_handler_callback_for_codecs_updated callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CodecsUpdated method call.

Inform the connection manager that the parameters of the supported codecs for this session have changed. The connection manager should send the new parameters to the remote contact. <tp:rationale> This is required for H.264 and Theora, for example. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Codecs

Used to pass an 'in' argument: Locally supported codecs, which SHOULD be the same as were previously in effect, but possibly with different parameters.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_callback_for_codecs_updated ()

void
(*tp_cli_media_stream_handler_callback_for_codecs_updated)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CodecsUpdated method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_run_codecs_updated ()

gboolean
tp_cli_media_stream_handler_run_codecs_updated
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Codecs,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_codecs_updated is deprecated and should not be used in newly-written code.

Call the method CodecsUpdated and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager that the parameters of the supported codecs for this session have changed. The connection manager should send the new parameters to the remote contact. <tp:rationale> This is required for H.264 and Theora, for example. </tp:rationale>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Codecs

Used to pass an 'in' argument: Locally supported codecs, which SHOULD be the same as were previously in effect, but possibly with different parameters.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_signal_callback_start_named_telephony_event ()

void
(*tp_cli_media_stream_handler_signal_callback_start_named_telephony_event)
                               (TpMediaStreamHandler *proxy,
                                guchar arg_Event,
                                guint arg_Codec_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StartNamedTelephonyEvent.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_start_named_telephony_event() was called

 

arg_Event

A telephony event code as defined by RFC 4733.

 

arg_Codec_ID

The payload type to use when sending events. The value 0xFFFFFFFF means to send with the already configured event type instead of using the specified one.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_start_named_telephony_event ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_start_named_telephony_event
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_start_named_telephony_event callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StartNamedTelephonyEvent.

Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called. This differs from StartTelephonyEvent in that you force the event to be transmitted as a RFC 4733 named event, not as sound. You can also force a specific Codec ID.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_signal_callback_start_sound_telephony_event ()

void
(*tp_cli_media_stream_handler_signal_callback_start_sound_telephony_event)
                               (TpMediaStreamHandler *proxy,
                                guchar arg_Event,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StartSoundTelephonyEvent.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_start_sound_telephony_event() was called

 

arg_Event

A telephony event code as defined by RFC 4733.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_connect_to_start_sound_telephony_event ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_start_sound_telephony_event
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_start_sound_telephony_event callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StartSoundTelephonyEvent.

Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called. This differs from StartTelephonyEvent in that you force the event to be transmitted as sound instead of as a named event.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_call_new_active_transport_pair ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_new_active_transport_pair
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Native_Candidate_ID,
                                const GValueArray *in_Native_Transport,
                                const gchar *in_Remote_Candidate_ID,
                                const GValueArray *in_Remote_Transport,
                                tp_cli_media_stream_handler_callback_for_new_active_transport_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NewActiveTransportPair method call.

<p>Informs the connection manager that a valid transport pair has been discovered and streaming is in progress. Component id MUST be the same for both transports and the pair is only valid for that component.</p> <tp:rationale> <p>The connection manager might need to send the details of the active transport pair (e.g. c and o parameters of SDP body need to contain address of selected native RTP transport as stipulated by RFC 5245). However, the candidate ID might not be enough to determine these info if the transport was found after <tp:member-ref>NativeCandidatesPrepared</tp:member-ref> has been called (e.g. peer reflexive ICE candidate). </p> </tp:rationale> <p>This method must be called before <tp:member-ref>NewActiveCandidatePair</tp:member-ref>.</p> <tp:rationale> <p>This way, connection managers supporting this method can safely ignore subsequent <tp:member-ref>NewActiveCandidatePair</tp:member-ref> call.</p> </tp:rationale> <p>Connection managers SHOULD NOT implement this method unless they need to inform the peer about selected transports. As a result, streaming implementations MUST NOT treat errors raised by this method as fatal.</p> <tp:rationale> <p>Usually, connection managers only need to do one answer/offer round-trip. However, some protocols give the possibility to to send an updated offer (e.g. ICE defines such mechanism to avoid some race conditions and to properly set the state of gateway devices).</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Native_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Native_Transport

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Transport

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_callback_for_new_active_transport_pair ()

void
(*tp_cli_media_stream_handler_callback_for_new_active_transport_pair)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NewActiveTransportPair method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_run_new_active_transport_pair ()

gboolean
tp_cli_media_stream_handler_run_new_active_transport_pair
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const gchar *in_Native_Candidate_ID,
                                const GValueArray *in_Native_Transport,
                                const gchar *in_Remote_Candidate_ID,
                                const GValueArray *in_Remote_Transport,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_new_active_transport_pair is deprecated and should not be used in newly-written code.

Call the method NewActiveTransportPair and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<p>Informs the connection manager that a valid transport pair has been discovered and streaming is in progress. Component id MUST be the same for both transports and the pair is only valid for that component.</p> <tp:rationale> <p>The connection manager might need to send the details of the active transport pair (e.g. c and o parameters of SDP body need to contain address of selected native RTP transport as stipulated by RFC 5245). However, the candidate ID might not be enough to determine these info if the transport was found after <tp:member-ref>NativeCandidatesPrepared</tp:member-ref> has been called (e.g. peer reflexive ICE candidate). </p> </tp:rationale> <p>This method must be called before <tp:member-ref>NewActiveCandidatePair</tp:member-ref>.</p> <tp:rationale> <p>This way, connection managers supporting this method can safely ignore subsequent <tp:member-ref>NewActiveCandidatePair</tp:member-ref> call.</p> </tp:rationale> <p>Connection managers SHOULD NOT implement this method unless they need to inform the peer about selected transports. As a result, streaming implementations MUST NOT treat errors raised by this method as fatal.</p> <tp:rationale> <p>Usually, connection managers only need to do one answer/offer round-trip. However, some protocols give the possibility to to send an updated offer (e.g. ICE defines such mechanism to avoid some race conditions and to properly set the state of gateway devices).</p> </tp:rationale>

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Native_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Native_Transport

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Candidate_ID

Used to pass an 'in' argument: (Undocumented)

 

in_Remote_Transport

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_call_supported_feedback_messages ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_supported_feedback_messages
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                GHashTable *in_Messages,
                                tp_cli_media_stream_handler_callback_for_supported_feedback_messages callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SupportedFeedbackMessages method call.

Inform the connection manager of the supported feedback messages for this session. This is called a before calling <tp:member-ref>SupportedCodecs</tp:member-ref>, <tp:member-ref>Ready</tp:member-ref> or <tp:member-ref>CodecsUpdated</tp:member-ref> to indicate the local, or negotiated feedback messages.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Messages

Used to pass an 'in' argument: Locally supported feedback messages.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_call_supported_header_extensions ()

TpProxyPendingCall *
tp_cli_media_stream_handler_call_supported_header_extensions
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Header_Extensions,
                                tp_cli_media_stream_handler_callback_for_supported_header_extensions callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SupportedHeaderExtensions method call.

Inform the connection manager of the supported RTP header extensions for this session. This is called before calling <tp:member-ref>SupportedCodecs</tp:member-ref>, <tp:member-ref>Ready</tp:member-ref> or <tp:member-ref>CodecsUpdated</tp:member-ref> to indicate the local or negotiated RTP header extensions.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Header_Extensions

Used to pass an 'in' argument: Locally supported RTP header extensions.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_media_stream_handler_callback_for_supported_feedback_messages ()

void
(*tp_cli_media_stream_handler_callback_for_supported_feedback_messages)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SupportedFeedbackMessages method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_callback_for_supported_header_extensions ()

void
(*tp_cli_media_stream_handler_callback_for_supported_header_extensions)
                               (TpMediaStreamHandler *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SupportedHeaderExtensions method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_remote_feedback_messages callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetRemoteFeedbackMessages.

Signal emitted when the connection manager wishes to inform the client of the feedback messages supported by the remote end. This signal is emitted before <tp:member-ref>SetRemoteCodecs</tp:member-ref>. If the client supports any of these messages, it must call <tp:member-ref>SupportedFeedbackMessages</tp:member-ref> before calling <tp:member-ref>SupportedCodecs</tp:member-ref>.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_connect_to_set_remote_header_extensions ()

TpProxySignalConnection *
tp_cli_media_stream_handler_connect_to_set_remote_header_extensions
                               (TpMediaStreamHandler *proxy,
                                tp_cli_media_stream_handler_signal_callback_set_remote_header_extensions callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SetRemoteHeaderExtensions.

Signal emitted when the connection manager wishes to inform the client of the RTP header extensions supported by the remote end. This signal is emitted before <tp:member-ref>SetRemoteCodecs</tp:member-ref>. If the client supports any of these messages, it must call <tp:member-ref>SupportedHeaderExtensions</tp:member-ref> before calling <tp:member-ref>SupportedCodecs</tp:member-ref>.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_media_stream_handler_run_supported_feedback_messages ()

gboolean
tp_cli_media_stream_handler_run_supported_feedback_messages
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                GHashTable *in_Messages,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_supported_feedback_messages is deprecated and should not be used in newly-written code.

Call the method SupportedFeedbackMessages and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager of the supported feedback messages for this session. This is called a before calling <tp:member-ref>SupportedCodecs</tp:member-ref>, <tp:member-ref>Ready</tp:member-ref> or <tp:member-ref>CodecsUpdated</tp:member-ref> to indicate the local, or negotiated feedback messages.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Messages

Used to pass an 'in' argument: Locally supported feedback messages.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_run_supported_header_extensions ()

gboolean
tp_cli_media_stream_handler_run_supported_header_extensions
                               (TpMediaStreamHandler *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Header_Extensions,
                                GError **error,
                                GMainLoop **loop);

tp_cli_media_stream_handler_run_supported_header_extensions is deprecated and should not be used in newly-written code.

Call the method SupportedHeaderExtensions and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the connection manager of the supported RTP header extensions for this session. This is called before calling <tp:member-ref>SupportedCodecs</tp:member-ref>, <tp:member-ref>Ready</tp:member-ref> or <tp:member-ref>CodecsUpdated</tp:member-ref> to indicate the local or negotiated RTP header extensions.

Parameters

proxy

A TpMediaStreamHandler or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Header_Extensions

Used to pass an 'in' argument: Locally supported RTP header extensions.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_media_stream_handler_signal_callback_set_remote_feedback_messages ()

void
(*tp_cli_media_stream_handler_signal_callback_set_remote_feedback_messages)
                               (TpMediaStreamHandler *proxy,
                                GHashTable *arg_Messages,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetRemoteFeedbackMessages.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages() was called

 

arg_Messages

Remote Feedback messages desired by the remote side

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_media_stream_handler_signal_callback_set_remote_header_extensions ()

void
(*tp_cli_media_stream_handler_signal_callback_set_remote_header_extensions)
                               (TpMediaStreamHandler *proxy,
                                const GPtrArray *arg_Header_Extensions,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SetRemoteHeaderExtensions.

Parameters

proxy

The proxy on which tp_cli_media_stream_handler_connect_to_set_remote_header_extensions() was called

 

arg_Header_Extensions

Header extensions desired by the remote side

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

Types and Values

TpMediaSessionHandler

typedef struct _TpMediaSessionHandler TpMediaSessionHandler;

A proxy object for a Telepathy connection manager.

Since: 0.7.1


TpMediaSessionHandlerClass

typedef struct _TpMediaSessionHandlerClass TpMediaSessionHandlerClass;

The class of a TpMediaSessionHandler.

Since: 0.7.1


TpMediaStreamHandler

typedef struct _TpMediaStreamHandler TpMediaStreamHandler;

A proxy object for a Telepathy connection manager.

Since: 0.7.1


TpMediaStreamHandlerClass

typedef struct _TpMediaStreamHandlerClass TpMediaStreamHandlerClass;

The class of a TpMediaStreamHandler.

Since: 0.7.1

See Also

TpChannel, TpProxy

telepathy-glib-0.24.2/docs/reference/html/TpChannelIface.html0000644000175000017500000003515514006623343020770 00000000000000 TpChannelIface: telepathy-glib API Reference Manual

TpChannelIface

TpChannelIface — interface representing basic channel properties

Functions

void (*TpChannelFunc) ()

Properties

gchar * channel-type Read / Write / Construct Only
guint handle Read / Write / Construct Only
guint handle-type Read / Write / Construct Only
gchar * object-path Read / Write / Construct Only

Types and Values

Object Hierarchy

    GInterface
    ╰── TpChannelIface

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This interface defines a basic set of channel properties. It's mainly used in TpChannelFactoryIface to represent the returned channel objects.

Functions

TpChannelFunc ()

void
(*TpChannelFunc) (TpChannelIface *self,
                  gpointer userdata);

A callback for functions which act on channels.

Parameters

self

An object implementing the channel interface

 

userdata

Arbitrary user-supplied data

 

Types and Values

TpChannelIface

typedef struct _TpChannelIface TpChannelIface;

Opaque typedef representing a channel.


struct TpChannelIfaceClass

struct TpChannelIfaceClass {
  GTypeInterface parent_class;
};

The class of the TpChannelIface interface.

Members

Property Details

The “channel-type” property

  “channel-type”             gchar *

The D-Bus interface representing the type of this channel. Read-only except during construction.

In TpChannel this property is read-only except during construction; if NULL during construction (the default), we ask the remote D-Bus object what its channel type is, and reading this property will yield NULL until a reply is received. This is not guaranteed to have happened until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE.

In connection manager implementations, attempts to set this property during construction will usually be ignored or treated as an error.

Owner: TpChannelIface

Flags: Read / Write / Construct Only

Default value: NULL


The “handle” property

  “handle”                   guint

This channel's associated handle, or 0 if no handle or unknown. Read-only except during construction.

In TpChannel, if this is 0 during construction, and handle-type is not TP_HANDLE_TYPE_NONE (== 0), we ask the remote D-Bus object what its handle type is; reading this property will yield 0 until we get the reply, or if GetHandle() fails. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE.

In connection manager implementations, attempts to set this during construction might be ignored, depending on the channel type.

Owner: TpChannelIface

Flags: Read / Write / Construct Only

Default value: 0


The “handle-type” property

  “handle-type”              guint

The TpHandleType of this channel's associated handle, or TP_HANDLE_TYPE_NONE (which is numerically 0) if no handle.

In TpChannel, if this is TP_UNKNOWN_HANDLE_TYPE during construction, we ask the remote D-Bus object what its handle type is; reading this property will yield TP_UNKNOWN_HANDLE_TYPE until we get the reply. This is not guaranteed to be have happened until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE.

In connection manager implementations, attempts to set this during construction might also be ignored.

Owner: TpChannelIface

Flags: Read / Write / Construct Only

Default value: 4294967295


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus. Read-only except during construction.

Owner: TpChannelIface

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-roomlist.html0000644000175000017500000007741314006623344025147 00000000000000 Room List channels: telepathy-glib API Reference Manual

Room List channels

Room List channels — service-side interface for the Room List channel type

Signals

void got-rooms Has Details
void listing-rooms Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelTypeRoomList

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Many instant messaging protocols allow named chatrooms to be listed. This section documents the auto-generated C wrappers for the Room List channel type.

Functions

tp_svc_channel_type_room_list_get_listing_rooms_impl ()

void
(*tp_svc_channel_type_room_list_get_listing_rooms_impl)
                               (TpSvcChannelTypeRoomList *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetListingRooms on interface org.freedesktop.Telepathy.Channel.Type.RoomList.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_room_list_implement_get_listing_rooms ()

void
tp_svc_channel_type_room_list_implement_get_listing_rooms
                               (TpSvcChannelTypeRoomListClass *klass,
                                tp_svc_channel_type_room_list_get_listing_rooms_impl impl);

Register an implementation for the GetListingRooms method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetListingRooms D-Bus method

 

tp_svc_channel_type_room_list_return_from_get_listing_rooms ()

void
tp_svc_channel_type_room_list_return_from_get_listing_rooms
                               (DBusGMethodInvocation *context,
                                gboolean out_In_Progress);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_In_Progress

gboolean (FIXME, generate documentation)

 

tp_svc_channel_type_room_list_list_rooms_impl ()

void
(*tp_svc_channel_type_room_list_list_rooms_impl)
                               (TpSvcChannelTypeRoomList *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListRooms on interface org.freedesktop.Telepathy.Channel.Type.RoomList.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_room_list_implement_list_rooms ()

void
tp_svc_channel_type_room_list_implement_list_rooms
                               (TpSvcChannelTypeRoomListClass *klass,
                                tp_svc_channel_type_room_list_list_rooms_impl impl);

Register an implementation for the ListRooms method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListRooms D-Bus method

 

tp_svc_channel_type_room_list_return_from_list_rooms ()

void
tp_svc_channel_type_room_list_return_from_list_rooms
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_room_list_stop_listing_impl ()

void
(*tp_svc_channel_type_room_list_stop_listing_impl)
                               (TpSvcChannelTypeRoomList *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StopListing on interface org.freedesktop.Telepathy.Channel.Type.RoomList.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_room_list_implement_stop_listing ()

void
tp_svc_channel_type_room_list_implement_stop_listing
                               (TpSvcChannelTypeRoomListClass *klass,
                                tp_svc_channel_type_room_list_stop_listing_impl impl);

Register an implementation for the StopListing method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StopListing D-Bus method

 

tp_svc_channel_type_room_list_return_from_stop_listing ()

void
tp_svc_channel_type_room_list_return_from_stop_listing
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_room_list_emit_got_rooms ()

void
tp_svc_channel_type_room_list_emit_got_rooms
                               (gpointer instance,
                                const GPtrArray *arg_Rooms);

Type-safe wrapper around g_signal_emit to emit the GotRooms signal on interface org.freedesktop.Telepathy.Channel.Type.RoomList.

Parameters

instance

The object implementing this interface

 

arg_Rooms

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_room_list_emit_listing_rooms ()

void
tp_svc_channel_type_room_list_emit_listing_rooms
                               (gpointer instance,
                                gboolean arg_Listing);

Type-safe wrapper around g_signal_emit to emit the ListingRooms signal on interface org.freedesktop.Telepathy.Channel.Type.RoomList.

Parameters

instance

The object implementing this interface

 

arg_Listing

gboolean (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeRoomList

typedef struct _TpSvcChannelTypeRoomList TpSvcChannelTypeRoomList;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeRoomListClass

typedef struct _TpSvcChannelTypeRoomListClass TpSvcChannelTypeRoomListClass;

The class of TpSvcChannelTypeRoomList.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_room_list (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_room_list_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_listing_rooms);
  IMPLEMENT (list_rooms);
  IMPLEMENT (stop_listing);
#undef IMPLEMENT
}

Signal Details

The “got-rooms” signal

void
user_function (TpSvcChannelTypeRoomList *self,
               gpointer                  user_data)

The GotRooms D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Rooms

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “listing-rooms” signal

void
user_function (TpSvcChannelTypeRoomList *self,
               gboolean                  arg_Listing,
               gpointer                  user_data)

The ListingRooms D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Listing

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-interfaces.html0000644000175000017500000127354014006623344023223 00000000000000 Telepathy protocol interface and property names: telepathy-glib API Reference Manual

Telepathy protocol interface and property names

Telepathy protocol interface and property names — D-Bus interface and property names from the Telepathy spec

Types and Values

#define TP_IFACE_ACCOUNT
#define TP_IFACE_QUARK_ACCOUNT
#define TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING
#define TP_IFACE_QUARK_ACCOUNT_INTERFACE_ADDRESSING
#define TP_IFACE_ACCOUNT_INTERFACE_AVATAR
#define TP_IFACE_QUARK_ACCOUNT_INTERFACE_AVATAR
#define TP_IFACE_ACCOUNT_INTERFACE_STORAGE
#define TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE
#define TP_IFACE_ACCOUNT_MANAGER
#define TP_IFACE_QUARK_ACCOUNT_MANAGER
#define TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE
#define TP_IFACE_QUARK_AUTHENTICATION_TLS_CERTIFICATE
#define TP_IFACE_DBUS_DAEMON
#define TP_IFACE_QUARK_DBUS_DAEMON
#define TP_IFACE_DBUS_INTROSPECTABLE
#define TP_IFACE_QUARK_DBUS_INTROSPECTABLE
#define TP_IFACE_DBUS_PEER
#define TP_IFACE_QUARK_DBUS_PEER
#define TP_IFACE_DBUS_PROPERTIES
#define TP_IFACE_QUARK_DBUS_PROPERTIES
#define TP_IFACE_DEBUG
#define TP_IFACE_QUARK_DEBUG
#define TP_IFACE_CONNECTION_MANAGER
#define TP_IFACE_QUARK_CONNECTION_MANAGER
#define TP_IFACE_PROTOCOL
#define TP_IFACE_QUARK_PROTOCOL
#define TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING
#define TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING
#define TP_IFACE_PROTOCOL_INTERFACE_AVATARS
#define TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS
#define TP_IFACE_PROTOCOL_INTERFACE_PRESENCE
#define TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE
#define TP_IFACE_CONNECTION
#define TP_IFACE_QUARK_CONNECTION
#define TP_IFACE_CONNECTION_INTERFACE_ADDRESSING
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_ADDRESSING
#define TP_IFACE_CONNECTION_INTERFACE_ALIASING
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING
#define TP_IFACE_CONNECTION_INTERFACE_ANONYMITY
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_ANONYMITY
#define TP_IFACE_CONNECTION_INTERFACE_AVATARS
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS
#define TP_IFACE_CONNECTION_INTERFACE_BALANCE
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE
#define TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES
#define TP_IFACE_CONNECTION_INTERFACE_CELLULAR
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CELLULAR
#define TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CLIENT_TYPES
#define TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES
#define TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS
#define TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_POWER_SAVING
#define TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING
#define TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO
#define TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST
#define TP_IFACE_CONNECTION_INTERFACE_CONTACTS
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS
#define TP_IFACE_CONNECTION_INTERFACE_RENAMING
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING
#define TP_IFACE_CONNECTION_INTERFACE_REQUESTS
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS
#define TP_IFACE_CONNECTION_INTERFACE_SIDECARS1
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_SIDECARS1
#define TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE
#define TP_IFACE_CONNECTION_INTERFACE_PRESENCE
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE
#define TP_IFACE_CONNECTION_INTERFACE_LOCATION
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION
#define TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_SERVICE_POINT
#define TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION
#define TP_IFACE_QUARK_CONNECTION_INTERFACE_MAIL_NOTIFICATION
#define TP_IFACE_CHANNEL
#define TP_IFACE_QUARK_CHANNEL
#define TP_IFACE_CHANNEL_TYPE_CALL
#define TP_IFACE_QUARK_CHANNEL_TYPE_CALL
#define TP_IFACE_CHANNEL_TYPE_CONTACT_LIST
#define TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST
#define TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH
#define TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_SEARCH
#define TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER
#define TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER
#define TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION
#define TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION
#define TP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION
#define TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_TLS_CONNECTION
#define TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA
#define TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA
#define TP_IFACE_CHANNEL_TYPE_ROOM_LIST
#define TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST
#define TP_IFACE_CHANNEL_TYPE_TEXT
#define TP_IFACE_QUARK_CHANNEL_TYPE_TEXT
#define TP_IFACE_CHANNEL_TYPE_TUBES
#define TP_IFACE_QUARK_CHANNEL_TYPE_TUBES
#define TP_IFACE_CHANNEL_INTERFACE_TUBE
#define TP_IFACE_CHANNEL_TYPE_DBUS_TUBE
#define TP_IFACE_CHANNEL_TYPE_STREAM_TUBE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE
#define TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE
#define TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE
#define TP_IFACE_CHANNEL_INTERFACE_ANONYMITY
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_ANONYMITY
#define TP_IFACE_CHANNEL_INTERFACE_CALL_STATE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_CALL_STATE
#define TP_IFACE_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION
#define TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE
#define TP_IFACE_CHANNEL_INTERFACE_CONFERENCE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE
#define TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE
#define TP_IFACE_CHANNEL_INTERFACE_DTMF
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF
#define TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA
#define TP_IFACE_CHANNEL_INTERFACE_GROUP
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP
#define TP_IFACE_CHANNEL_INTERFACE_HOLD
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD
#define TP_IFACE_CHANNEL_INTERFACE_PASSWORD
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD
#define TP_IFACE_CHANNEL_INTERFACE_ROOM
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM
#define TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM_CONFIG
#define TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_SASL_AUTHENTICATION
#define TP_IFACE_CHANNEL_INTERFACE_SECURABLE
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_SECURABLE
#define TP_IFACE_CHANNEL_INTERFACE_SMS
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS
#define TP_IFACE_CHANNEL_INTERFACE_SUBJECT
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_SUBJECT
#define TP_IFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_MEDIA_SIGNALLING
#define TP_IFACE_CHANNEL_INTERFACE_MESSAGES
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES
#define TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT
#define TP_IFACE_QUARK_CHANNEL_INTERFACE_SERVICE_POINT
#define TP_IFACE_CHANNEL_DISPATCHER
#define TP_IFACE_QUARK_CHANNEL_DISPATCHER
#define TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1
#define TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1
#define TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST
#define TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST
#define TP_IFACE_CHANNEL_DISPATCH_OPERATION
#define TP_IFACE_QUARK_CHANNEL_DISPATCH_OPERATION
#define TP_IFACE_CHANNEL_REQUEST
#define TP_IFACE_QUARK_CHANNEL_REQUEST
#define TP_IFACE_MEDIA_SESSION_HANDLER
#define TP_IFACE_QUARK_MEDIA_SESSION_HANDLER
#define TP_IFACE_MEDIA_STREAM_HANDLER
#define TP_IFACE_QUARK_MEDIA_STREAM_HANDLER
#define TP_IFACE_PROPERTIES_INTERFACE
#define TP_IFACE_QUARK_PROPERTIES_INTERFACE
#define TP_IFACE_CLIENT
#define TP_IFACE_QUARK_CLIENT
#define TP_IFACE_CLIENT_APPROVER
#define TP_IFACE_QUARK_CLIENT_APPROVER
#define TP_IFACE_CLIENT_HANDLER
#define TP_IFACE_QUARK_CLIENT_HANDLER
#define TP_IFACE_CLIENT_OBSERVER
#define TP_IFACE_QUARK_CLIENT_OBSERVER
#define TP_IFACE_CLIENT_INTERFACE_REQUESTS
#define TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS
#define TP_IFACE_CALL_CONTENT
#define TP_IFACE_QUARK_CALL_CONTENT
#define TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA
#define TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_MEDIA
#define TP_IFACE_CALL_CONTENT_INTERFACE_VIDEO_CONTROL
#define TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_VIDEO_CONTROL
#define TP_IFACE_CALL_CONTENT_INTERFACE_AUDIO_CONTROL
#define TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_AUDIO_CONTROL
#define TP_IFACE_CALL_CONTENT_INTERFACE_DTMF
#define TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF
#define TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION
#define TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION
#define TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS
#define TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS
#define TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK
#define TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK
#define TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS
#define TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS
#define TP_IFACE_CALL_STREAM
#define TP_IFACE_QUARK_CALL_STREAM
#define TP_IFACE_CALL_STREAM_ENDPOINT
#define TP_IFACE_QUARK_CALL_STREAM_ENDPOINT
#define TP_IFACE_CALL_STREAM_INTERFACE_MEDIA
#define TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA
#define TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE
#define TP_PROP_ACCOUNT_CHANGING_PRESENCE
#define TP_PROP_ACCOUNT_CONNECTION
#define TP_PROP_ACCOUNT_CONNECTION_ERROR
#define TP_PROP_ACCOUNT_CONNECTION_ERROR_DETAILS
#define TP_PROP_ACCOUNT_CONNECTION_STATUS
#define TP_PROP_ACCOUNT_CONNECTION_STATUS_REASON
#define TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY
#define TP_PROP_ACCOUNT_CURRENT_PRESENCE
#define TP_PROP_ACCOUNT_DISPLAY_NAME
#define TP_PROP_ACCOUNT_ENABLED
#define TP_PROP_ACCOUNT_HAS_BEEN_ONLINE
#define TP_PROP_ACCOUNT_ICON
#define TP_PROP_ACCOUNT_INTERFACES
#define TP_PROP_ACCOUNT_INTERFACE_ADDRESSING_URI_SCHEMES
#define TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR
#define TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_IDENTIFIER
#define TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER
#define TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_RESTRICTIONS
#define TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_SPECIFIC_INFORMATION
#define TP_PROP_ACCOUNT_MANAGER_INTERFACES
#define TP_PROP_ACCOUNT_MANAGER_INVALID_ACCOUNTS
#define TP_PROP_ACCOUNT_MANAGER_SUPPORTED_ACCOUNT_PROPERTIES
#define TP_PROP_ACCOUNT_MANAGER_VALID_ACCOUNTS
#define TP_PROP_ACCOUNT_NICKNAME
#define TP_PROP_ACCOUNT_NORMALIZED_NAME
#define TP_PROP_ACCOUNT_PARAMETERS
#define TP_PROP_ACCOUNT_REQUESTED_PRESENCE
#define TP_PROP_ACCOUNT_SERVICE
#define TP_PROP_ACCOUNT_SUPERSEDES
#define TP_PROP_ACCOUNT_VALID
#define TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_CHAIN_DATA
#define TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_TYPE
#define TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_REJECTIONS
#define TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_STATE
#define TP_PROP_CALL_CONTENT_DISPOSITION
#define TP_PROP_CALL_CONTENT_INTERFACES
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_EVENT
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_STATE
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_LOCAL_MEDIA_DESCRIPTIONS
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_MEDIA_DESCRIPTION_OFFER
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_PACKETIZATION
#define TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_REMOTE_MEDIA_DESCRIPTIONS
#define TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_BITRATE
#define TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_FRAMERATE
#define TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MANUAL_KEY_FRAMES
#define TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MTU
#define TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_VIDEO_RESOLUTION
#define TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_INPUT_VOLUME
#define TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_OUTPUT_VOLUME
#define TP_PROP_CALL_CONTENT_INTERFACE_DTMF_CURRENTLY_SENDING_TONES
#define TP_PROP_CALL_CONTENT_INTERFACE_DTMF_DEFERRED_TONES
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_FURTHER_NEGOTIATION_REQUIRED
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_HAS_REMOTE_INFORMATION
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACES
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DLRR_MAX_SIZE
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DUPLICATE_RLE_MAX_SIZE
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_ENABLE_METRICS
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_LOSS_RLE_MAX_SIZE
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_PACKET_RECEIPT_TIMES_MAX_SIZE
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_RTT_MODE
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_STATISTICS_FLAGS
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_DOES_AVPF
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_FEEDBACK_MESSAGES
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS_HEADER_EXTENSIONS
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT
#define TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_SSRCS
#define TP_PROP_CALL_CONTENT_NAME
#define TP_PROP_CALL_CONTENT_STREAMS
#define TP_PROP_CALL_CONTENT_TYPE
#define TP_PROP_CALL_STREAM_CAN_REQUEST_RECEIVING
#define TP_PROP_CALL_STREAM_ENDPOINT_CONTROLLING
#define TP_PROP_CALL_STREAM_ENDPOINT_ENDPOINT_STATE
#define TP_PROP_CALL_STREAM_ENDPOINT_IS_ICE_LITE
#define TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CANDIDATES
#define TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CREDENTIALS
#define TP_PROP_CALL_STREAM_ENDPOINT_SELECTED_CANDIDATE_PAIRS
#define TP_PROP_CALL_STREAM_ENDPOINT_TRANSPORT
#define TP_PROP_CALL_STREAM_INTERFACES
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ENDPOINTS
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_HAS_SERVER_INFO
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ICE_RESTART_PENDING
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CANDIDATES
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CREDENTIALS
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RECEIVING_STATE
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RELAY_INFO
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_SENDING_STATE
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_STUN_SERVERS
#define TP_PROP_CALL_STREAM_INTERFACE_MEDIA_TRANSPORT
#define TP_PROP_CALL_STREAM_LOCAL_SENDING_STATE
#define TP_PROP_CALL_STREAM_REMOTE_MEMBERS
#define TP_PROP_CALL_STREAM_REMOTE_MEMBER_IDENTIFIERS
#define TP_PROP_CHANNEL_CHANNEL_TYPE
#define TP_PROP_CHANNEL_DISPATCHER_INTERFACES
#define TP_PROP_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST_DISPATCH_OPERATIONS
#define TP_PROP_CHANNEL_DISPATCHER_SUPPORTS_REQUEST_HINTS
#define TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT
#define TP_PROP_CHANNEL_DISPATCH_OPERATION_CHANNELS
#define TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION
#define TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES
#define TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS
#define TP_PROP_CHANNEL_INITIATOR_HANDLE
#define TP_PROP_CHANNEL_INITIATOR_ID
#define TP_PROP_CHANNEL_INTERFACES
#define TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY
#define TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MODES
#define TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMOUS_ID
#define TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAN_RETRY_CAPTCHA
#define TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR
#define TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR_DETAILS
#define TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_STATUS
#define TP_PROP_CHANNEL_INTERFACE_CHAT_STATE_CHAT_STATES
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_CHANNELS
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_HANDLES
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INVITATION_MESSAGE
#define TP_PROP_CHANNEL_INTERFACE_CONFERENCE_ORIGINAL_CHANNELS
#define TP_PROP_CHANNEL_INTERFACE_DTMF_CURRENTLY_SENDING_TONES
#define TP_PROP_CHANNEL_INTERFACE_DTMF_DEFERRED_TONES
#define TP_PROP_CHANNEL_INTERFACE_DTMF_INITIAL_TONES
#define TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME
#define TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA
#define TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_HANDLE_OWNERS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_LOCAL_PENDING_MEMBERS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBERS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBER_IDENTIFIERS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_REMOTE_PENDING_MEMBERS
#define TP_PROP_CHANNEL_INTERFACE_GROUP_SELF_HANDLE
#define TP_PROP_CHANNEL_INTERFACE_MESSAGES_DELIVERY_REPORTING_SUPPORT
#define TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_PART_SUPPORT_FLAGS
#define TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_TYPES
#define TP_PROP_CHANNEL_INTERFACE_MESSAGES_PENDING_MESSAGES
#define TP_PROP_CHANNEL_INTERFACE_MESSAGES_SUPPORTED_CONTENT_TYPES
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_ANONYMOUS
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CAN_UPDATE_CONFIGURATION
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CONFIGURATION_RETRIEVED
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_DESCRIPTION
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_INVITEONLY
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_LIMIT
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MODERATED
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MUTABLE_PROPERTIES
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_HINT
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_PROTECTED
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PERSISTENT
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PRIVATE
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_TITLE
#define TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME
#define TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CREATION_TIMESTAMP
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR
#define TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR_HANDLE
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AUTHORIZATION_IDENTITY
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_CAN_TRY_AGAIN
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_REALM
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_USERNAME
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_HAS_INITIAL_DATA
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_MAY_SAVE_RESPONSE
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR_DETAILS
#define TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_STATUS
#define TP_PROP_CHANNEL_INTERFACE_SECURABLE_ENCRYPTED
#define TP_PROP_CHANNEL_INTERFACE_SECURABLE_VERIFIED
#define TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_CURRENT_SERVICE_POINT
#define TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_INITIAL_SERVICE_POINT
#define TP_PROP_CHANNEL_INTERFACE_SMS_FLASH
#define TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL
#define TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR
#define TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR_HANDLE
#define TP_PROP_CHANNEL_INTERFACE_SUBJECT_CAN_SET
#define TP_PROP_CHANNEL_INTERFACE_SUBJECT_SUBJECT
#define TP_PROP_CHANNEL_INTERFACE_SUBJECT_TIMESTAMP
#define TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS
#define TP_PROP_CHANNEL_INTERFACE_TUBE_STATE
#define TP_PROP_CHANNEL_TYPE_SERVER_AUTHENTICATION_AUTHENTICATION_METHOD
#define TP_PROP_CHANNEL_REQUESTED
#define TP_PROP_CHANNEL_REQUEST_ACCOUNT
#define TP_PROP_CHANNEL_REQUEST_HINTS
#define TP_PROP_CHANNEL_REQUEST_INTERFACES
#define TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER
#define TP_PROP_CHANNEL_REQUEST_REQUESTS
#define TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME
#define TP_PROP_CHANNEL_TARGET_HANDLE
#define TP_PROP_CHANNEL_TARGET_HANDLE_TYPE
#define TP_PROP_CHANNEL_TARGET_ID
#define TP_PROP_CHANNEL_TYPE_CALL_CALL_FLAGS
#define TP_PROP_CHANNEL_TYPE_CALL_CALL_MEMBERS
#define TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE
#define TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_DETAILS
#define TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_REASON
#define TP_PROP_CHANNEL_TYPE_CALL_CONTENTS
#define TP_PROP_CHANNEL_TYPE_CALL_HARDWARE_STREAMING
#define TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO
#define TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO_NAME
#define TP_PROP_CHANNEL_TYPE_CALL_INITIAL_TRANSPORT
#define TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO
#define TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO_NAME
#define TP_PROP_CHANNEL_TYPE_CALL_MEMBER_IDENTIFIERS
#define TP_PROP_CHANNEL_TYPE_CALL_MUTABLE_CONTENTS
#define TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_AVAILABLE_SEARCH_KEYS
#define TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT
#define TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SEARCH_STATE
#define TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER
#define TP_PROP_CHANNEL_TYPE_DBUS_TUBE_DBUS_NAMES
#define TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME
#define TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_AVAILABLE_SOCKET_TYPES
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILE_COLLECTION
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_STATE
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_TRANSFERRED_BYTES
#define TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI
#define TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER
#define TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME
#define TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES
#define TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_SERVER_CERTIFICATE
#define TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_IMMUTABLE_STREAMS
#define TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO
#define TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO
#define TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE
#define TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES
#define TP_PROP_CLIENT_APPROVER_APPROVER_CHANNEL_FILTER
#define TP_PROP_CLIENT_HANDLER_BYPASS_APPROVAL
#define TP_PROP_CLIENT_HANDLER_CAPABILITIES
#define TP_PROP_CLIENT_HANDLER_HANDLED_CHANNELS
#define TP_PROP_CLIENT_HANDLER_HANDLER_CHANNEL_FILTER
#define TP_PROP_CLIENT_INTERFACES
#define TP_PROP_CLIENT_OBSERVER_DELAY_APPROVERS
#define TP_PROP_CLIENT_OBSERVER_OBSERVER_CHANNEL_FILTER
#define TP_PROP_CLIENT_OBSERVER_RECOVER
#define TP_PROP_CONNECTION_HAS_IMMORTAL_HANDLES
#define TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY
#define TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MODES
#define TP_PROP_CONNECTION_INTERFACE_ANONYMITY_SUPPORTED_ANONYMITY_MODES
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH
#define TP_PROP_CONNECTION_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES
#define TP_PROP_CONNECTION_INTERFACE_BALANCE_ACCOUNT_BALANCE
#define TP_PROP_CONNECTION_INTERFACE_BALANCE_MANAGE_CREDIT_URI
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_IMSI
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_NATIONAL_CHARACTER_SET
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_REDUCED_CHARACTER_SET
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_SERVICE_CENTRE
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_VALIDITY_PERIOD
#define TP_PROP_CONNECTION_INTERFACE_CELLULAR_OVERRIDE_MESSAGE_SERVICE_CENTRE
#define TP_PROP_CONNECTION_INTERFACE_CONTACTS_CONTACT_ATTRIBUTE_INTERFACES
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_BLOCKING_CONTACT_BLOCKING_CAPABILITIES
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_DISJOINT_GROUPS
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUP_STORAGE
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_CONTACT_INFO_FLAGS
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_SUPPORTED_FIELDS
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CAN_CHANGE_CONTACT_LIST
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_REQUEST_USES_MESSAGE
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_PERSISTS
#define TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_STATE
#define TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL
#define TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL_TYPES
#define TP_PROP_CONNECTION_INTERFACE_LOCATION_SUPPORTED_LOCATION_FEATURES
#define TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_ADDRESS
#define TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_NOTIFICATION_FLAGS
#define TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAILS
#define TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAIL_COUNT
#define TP_PROP_CONNECTION_INTERFACE_POWER_SAVING_POWER_SAVING_ACTIVE
#define TP_PROP_CONNECTION_INTERFACE_REQUESTS_CHANNELS
#define TP_PROP_CONNECTION_INTERFACE_REQUESTS_REQUESTABLE_CHANNEL_CLASSES
#define TP_PROP_CONNECTION_INTERFACE_SERVICE_POINT_KNOWN_SERVICE_POINTS
#define TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_STATUSES
#define TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_MAXIMUM_STATUS_MESSAGE_LENGTH
#define TP_PROP_CONNECTION_MANAGER_INTERFACES
#define TP_PROP_CONNECTION_MANAGER_PROTOCOLS
#define TP_PROP_CONNECTION_INTERFACES
#define TP_PROP_CONNECTION_SELF_HANDLE
#define TP_PROP_CONNECTION_SELF_ID
#define TP_PROP_CONNECTION_STATUS
#define TP_PROP_DEBUG_ENABLED
#define TP_PROP_MEDIA_STREAM_HANDLER_CREATED_LOCALLY
#define TP_PROP_MEDIA_STREAM_HANDLER_NAT_TRAVERSAL
#define TP_PROP_MEDIA_STREAM_HANDLER_RELAY_INFO
#define TP_PROP_MEDIA_STREAM_HANDLER_STUN_SERVERS
#define TP_PROP_PROTOCOL_AUTHENTICATION_TYPES
#define TP_PROP_PROTOCOL_CONNECTION_INTERFACES
#define TP_PROP_PROTOCOL_ENGLISH_NAME
#define TP_PROP_PROTOCOL_ICON
#define TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_URI_SCHEMES
#define TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH
#define TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES
#define TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES
#define TP_PROP_PROTOCOL_INTERFACES
#define TP_PROP_PROTOCOL_PARAMETERS
#define TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES
#define TP_PROP_PROTOCOL_VCARD_FIELD
#define TP_TOKEN_CONNECTION_CONTACT_ID
#define TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_ADDRESSES
#define TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_URIS
#define TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS
#define TP_TOKEN_CONNECTION_INTERFACE_AVATARS_TOKEN
#define TP_TOKEN_CONNECTION_INTERFACE_CAPABILITIES_CAPS
#define TP_TOKEN_CONNECTION_INTERFACE_CLIENT_TYPES_CLIENT_TYPES
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_INFO_INFO
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST
#define TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE
#define TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE
#define TP_TOKEN_CONNECTION_INTERFACE_LOCATION_LOCATION
#define TP_TOKEN_CHANNEL_TYPE_CALL_AUDIO
#define TP_TOKEN_CHANNEL_TYPE_CALL_GTALK_P2P
#define TP_TOKEN_CHANNEL_TYPE_CALL_ICE
#define TP_TOKEN_CHANNEL_TYPE_CALL_SHM
#define TP_TOKEN_CHANNEL_TYPE_CALL_VIDEO
#define TP_TOKEN_CHANNEL_TYPE_CALL_WLM_2009
#define TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_GTALK_P2P
#define TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP
#define TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_8_5
#define TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_2009

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This header exposes the interface names from the Telepathy specification as cpp defines for strings, such as TP_IFACE_PROPERTIES_INTERFACE. It is automatically generated from the specification.

Since 0.7.0 it also provides cpp defines like TP_IFACE_QUARK_PROPERTIES_INTERFACE, which expand to function calls that return GQuarks for the same strings.

Since 0.9.2 it also provides cpp defines like TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS, which expand to string constants representing fully-qualified D-Bus property names, like org.freedesktop.Telepathy.Channel.Interface.Group.GroupFlags.

Since 0.11.5 it also provides cpp defines like TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS for contact attributes like "org.freedesktop.Telepathy.Connection.Interface.Aliasing/alias", and defines like TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP for handler capability tokens like "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p". (These were present in an incorrect form since 0.11.3.)

Functions

Types and Values

TP_IFACE_ACCOUNT

#define             TP_IFACE_ACCOUNT

The interface name "org.freedesktop.Telepathy.Account"


TP_IFACE_QUARK_ACCOUNT

#define             TP_IFACE_QUARK_ACCOUNT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Account"


TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING

#define             TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING

The interface name "org.freedesktop.Telepathy.Account.Interface.Addressing"


TP_IFACE_QUARK_ACCOUNT_INTERFACE_ADDRESSING

#define             TP_IFACE_QUARK_ACCOUNT_INTERFACE_ADDRESSING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Account.Interface.Addressing"


TP_IFACE_ACCOUNT_INTERFACE_AVATAR

#define             TP_IFACE_ACCOUNT_INTERFACE_AVATAR

The interface name "org.freedesktop.Telepathy.Account.Interface.Avatar"


TP_IFACE_QUARK_ACCOUNT_INTERFACE_AVATAR

#define             TP_IFACE_QUARK_ACCOUNT_INTERFACE_AVATAR

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Account.Interface.Avatar"


TP_IFACE_ACCOUNT_INTERFACE_STORAGE

#define             TP_IFACE_ACCOUNT_INTERFACE_STORAGE

The interface name "org.freedesktop.Telepathy.Account.Interface.Storage"


TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE

#define             TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Account.Interface.Storage"


TP_IFACE_ACCOUNT_MANAGER

#define             TP_IFACE_ACCOUNT_MANAGER

The interface name "org.freedesktop.Telepathy.AccountManager"


TP_IFACE_QUARK_ACCOUNT_MANAGER

#define             TP_IFACE_QUARK_ACCOUNT_MANAGER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.AccountManager"


TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE

#define             TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE

The interface name "org.freedesktop.Telepathy.Authentication.TLSCertificate"


TP_IFACE_QUARK_AUTHENTICATION_TLS_CERTIFICATE

#define             TP_IFACE_QUARK_AUTHENTICATION_TLS_CERTIFICATE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Authentication.TLSCertificate"


TP_IFACE_DBUS_DAEMON

#define             TP_IFACE_DBUS_DAEMON

The interface name "org.freedesktop.DBus"


TP_IFACE_QUARK_DBUS_DAEMON

#define             TP_IFACE_QUARK_DBUS_DAEMON

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.DBus"


TP_IFACE_DBUS_INTROSPECTABLE

#define             TP_IFACE_DBUS_INTROSPECTABLE

The interface name "org.freedesktop.DBus.Introspectable"


TP_IFACE_QUARK_DBUS_INTROSPECTABLE

#define             TP_IFACE_QUARK_DBUS_INTROSPECTABLE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.DBus.Introspectable"


TP_IFACE_DBUS_PEER

#define             TP_IFACE_DBUS_PEER

The interface name "org.freedesktop.DBus.Peer"


TP_IFACE_QUARK_DBUS_PEER

#define             TP_IFACE_QUARK_DBUS_PEER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.DBus.Peer"


TP_IFACE_DBUS_PROPERTIES

#define             TP_IFACE_DBUS_PROPERTIES

The interface name "org.freedesktop.DBus.Properties"


TP_IFACE_QUARK_DBUS_PROPERTIES

#define             TP_IFACE_QUARK_DBUS_PROPERTIES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.DBus.Properties"


TP_IFACE_DEBUG

#define             TP_IFACE_DEBUG

The interface name "org.freedesktop.Telepathy.Debug"


TP_IFACE_QUARK_DEBUG

#define             TP_IFACE_QUARK_DEBUG

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Debug"


TP_IFACE_CONNECTION_MANAGER

#define             TP_IFACE_CONNECTION_MANAGER

The interface name "org.freedesktop.Telepathy.ConnectionManager"


TP_IFACE_QUARK_CONNECTION_MANAGER

#define             TP_IFACE_QUARK_CONNECTION_MANAGER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ConnectionManager"


TP_IFACE_PROTOCOL

#define             TP_IFACE_PROTOCOL

The interface name "org.freedesktop.Telepathy.Protocol"


TP_IFACE_QUARK_PROTOCOL

#define             TP_IFACE_QUARK_PROTOCOL

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Protocol"


TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING

#define             TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING

The interface name "org.freedesktop.Telepathy.Protocol.Interface.Addressing"


TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING

#define             TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Protocol.Interface.Addressing"


TP_IFACE_PROTOCOL_INTERFACE_AVATARS

#define             TP_IFACE_PROTOCOL_INTERFACE_AVATARS

The interface name "org.freedesktop.Telepathy.Protocol.Interface.Avatars"


TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS

#define             TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Protocol.Interface.Avatars"


TP_IFACE_PROTOCOL_INTERFACE_PRESENCE

#define             TP_IFACE_PROTOCOL_INTERFACE_PRESENCE

The interface name "org.freedesktop.Telepathy.Protocol.Interface.Presence"


TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE

#define             TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Protocol.Interface.Presence"


TP_IFACE_CONNECTION

#define             TP_IFACE_CONNECTION

The interface name "org.freedesktop.Telepathy.Connection"


TP_IFACE_QUARK_CONNECTION

#define             TP_IFACE_QUARK_CONNECTION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection"


TP_IFACE_CONNECTION_INTERFACE_ADDRESSING

#define             TP_IFACE_CONNECTION_INTERFACE_ADDRESSING

The interface name "org.freedesktop.Telepathy.Connection.Interface.Addressing1"


TP_IFACE_QUARK_CONNECTION_INTERFACE_ADDRESSING

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_ADDRESSING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Addressing1"


TP_IFACE_CONNECTION_INTERFACE_ALIASING

#define             TP_IFACE_CONNECTION_INTERFACE_ALIASING

The interface name "org.freedesktop.Telepathy.Connection.Interface.Aliasing"


TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Aliasing"


TP_IFACE_CONNECTION_INTERFACE_ANONYMITY

#define             TP_IFACE_CONNECTION_INTERFACE_ANONYMITY

The interface name "org.freedesktop.Telepathy.Connection.Interface.Anonymity"


TP_IFACE_QUARK_CONNECTION_INTERFACE_ANONYMITY

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_ANONYMITY

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Anonymity"


TP_IFACE_CONNECTION_INTERFACE_AVATARS

#define             TP_IFACE_CONNECTION_INTERFACE_AVATARS

The interface name "org.freedesktop.Telepathy.Connection.Interface.Avatars"


TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Avatars"


TP_IFACE_CONNECTION_INTERFACE_BALANCE

#define             TP_IFACE_CONNECTION_INTERFACE_BALANCE

The interface name "org.freedesktop.Telepathy.Connection.Interface.Balance"


TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Balance"


TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES

#define             TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES

The interface name "org.freedesktop.Telepathy.Connection.Interface.Capabilities"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Capabilities"


TP_IFACE_CONNECTION_INTERFACE_CELLULAR

#define             TP_IFACE_CONNECTION_INTERFACE_CELLULAR

The interface name "org.freedesktop.Telepathy.Connection.Interface.Cellular"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CELLULAR

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CELLULAR

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Cellular"


TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES

#define             TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES

The interface name "org.freedesktop.Telepathy.Connection.Interface.ClientTypes"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CLIENT_TYPES

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CLIENT_TYPES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ClientTypes"


TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES

The interface name "org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities"


TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS

The interface name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups"


TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING

#define             TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING

The interface name "org.freedesktop.Telepathy.Connection.Interface.PowerSaving"


TP_IFACE_QUARK_CONNECTION_INTERFACE_POWER_SAVING

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_POWER_SAVING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.PowerSaving"


TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING

The interface name "org.freedesktop.Telepathy.Connection.Interface.ContactBlocking"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ContactBlocking"


TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO

The interface name "org.freedesktop.Telepathy.Connection.Interface.ContactInfo"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ContactInfo"


TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST

The interface name "org.freedesktop.Telepathy.Connection.Interface.ContactList"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ContactList"


TP_IFACE_CONNECTION_INTERFACE_CONTACTS

#define             TP_IFACE_CONNECTION_INTERFACE_CONTACTS

The interface name "org.freedesktop.Telepathy.Connection.Interface.Contacts"


TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Contacts"


TP_IFACE_CONNECTION_INTERFACE_RENAMING

#define             TP_IFACE_CONNECTION_INTERFACE_RENAMING

The interface name "org.freedesktop.Telepathy.Connection.Interface.Renaming"


TP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Renaming"


TP_IFACE_CONNECTION_INTERFACE_REQUESTS

#define             TP_IFACE_CONNECTION_INTERFACE_REQUESTS

The interface name "org.freedesktop.Telepathy.Connection.Interface.Requests"


TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Requests"


TP_IFACE_CONNECTION_INTERFACE_SIDECARS1

#define             TP_IFACE_CONNECTION_INTERFACE_SIDECARS1

The interface name "org.freedesktop.Telepathy.Connection.Interface.Sidecars1"


TP_IFACE_QUARK_CONNECTION_INTERFACE_SIDECARS1

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_SIDECARS1

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Sidecars1"


TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE

#define             TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE

The interface name "org.freedesktop.Telepathy.Connection.Interface.SimplePresence"


TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.SimplePresence"


TP_IFACE_CONNECTION_INTERFACE_PRESENCE

#define             TP_IFACE_CONNECTION_INTERFACE_PRESENCE

The interface name "org.freedesktop.Telepathy.Connection.Interface.Presence"


TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Presence"


TP_IFACE_CONNECTION_INTERFACE_LOCATION

#define             TP_IFACE_CONNECTION_INTERFACE_LOCATION

The interface name "org.freedesktop.Telepathy.Connection.Interface.Location"


TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.Location"


TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT

#define             TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT

The interface name "org.freedesktop.Telepathy.Connection.Interface.ServicePoint"


TP_IFACE_QUARK_CONNECTION_INTERFACE_SERVICE_POINT

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_SERVICE_POINT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.ServicePoint"


TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION

#define             TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION

The interface name "org.freedesktop.Telepathy.Connection.Interface.MailNotification"


TP_IFACE_QUARK_CONNECTION_INTERFACE_MAIL_NOTIFICATION

#define             TP_IFACE_QUARK_CONNECTION_INTERFACE_MAIL_NOTIFICATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Connection.Interface.MailNotification"


TP_IFACE_CHANNEL

#define             TP_IFACE_CHANNEL

The interface name "org.freedesktop.Telepathy.Channel"


TP_IFACE_QUARK_CHANNEL

#define             TP_IFACE_QUARK_CHANNEL

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel"


TP_IFACE_CHANNEL_TYPE_CALL

#define             TP_IFACE_CHANNEL_TYPE_CALL

The interface name "org.freedesktop.Telepathy.Channel.Type.Call1"


TP_IFACE_QUARK_CHANNEL_TYPE_CALL

#define             TP_IFACE_QUARK_CHANNEL_TYPE_CALL

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.Call1"


TP_IFACE_CHANNEL_TYPE_CONTACT_LIST

#define             TP_IFACE_CHANNEL_TYPE_CONTACT_LIST

The interface name "org.freedesktop.Telepathy.Channel.Type.ContactList"


TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST

#define             TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.ContactList"


TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH

#define             TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH

The interface name "org.freedesktop.Telepathy.Channel.Type.ContactSearch"


TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_SEARCH

#define             TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_SEARCH

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.ContactSearch"


TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER

#define             TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER

The interface name "org.freedesktop.Telepathy.Channel.Type.FileTransfer"


TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER

#define             TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.FileTransfer"


TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION

#define             TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION

The interface name "org.freedesktop.Telepathy.Channel.Type.ServerAuthentication"


TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION

#define             TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.ServerAuthentication"


TP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION

#define             TP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION

The interface name "org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection"


TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_TLS_CONNECTION

#define             TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_TLS_CONNECTION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection"


TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA

#define             TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA

The interface name "org.freedesktop.Telepathy.Channel.Type.StreamedMedia"


TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA

#define             TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.StreamedMedia"


TP_IFACE_CHANNEL_TYPE_ROOM_LIST

#define             TP_IFACE_CHANNEL_TYPE_ROOM_LIST

The interface name "org.freedesktop.Telepathy.Channel.Type.RoomList"


TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST

#define             TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.RoomList"


TP_IFACE_CHANNEL_TYPE_TEXT

#define             TP_IFACE_CHANNEL_TYPE_TEXT

The interface name "org.freedesktop.Telepathy.Channel.Type.Text"


TP_IFACE_QUARK_CHANNEL_TYPE_TEXT

#define             TP_IFACE_QUARK_CHANNEL_TYPE_TEXT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.Text"


TP_IFACE_CHANNEL_TYPE_TUBES

#define             TP_IFACE_CHANNEL_TYPE_TUBES

The interface name "org.freedesktop.Telepathy.Channel.Type.Tubes"


TP_IFACE_QUARK_CHANNEL_TYPE_TUBES

#define             TP_IFACE_QUARK_CHANNEL_TYPE_TUBES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.Tubes"


TP_IFACE_CHANNEL_INTERFACE_TUBE

#define             TP_IFACE_CHANNEL_INTERFACE_TUBE

The interface name "org.freedesktop.Telepathy.Channel.Interface.Tube"


TP_IFACE_CHANNEL_TYPE_DBUS_TUBE

#define             TP_IFACE_CHANNEL_TYPE_DBUS_TUBE

The interface name "org.freedesktop.Telepathy.Channel.Type.DBusTube"


TP_IFACE_CHANNEL_TYPE_STREAM_TUBE

#define             TP_IFACE_CHANNEL_TYPE_STREAM_TUBE

The interface name "org.freedesktop.Telepathy.Channel.Type.StreamTube"


TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Tube"


TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE

#define             TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.DBusTube"


TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE

#define             TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Type.StreamTube"


TP_IFACE_CHANNEL_INTERFACE_ANONYMITY

#define             TP_IFACE_CHANNEL_INTERFACE_ANONYMITY

The interface name "org.freedesktop.Telepathy.Channel.Interface.Anonymity"


TP_IFACE_QUARK_CHANNEL_INTERFACE_ANONYMITY

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_ANONYMITY

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Anonymity"


TP_IFACE_CHANNEL_INTERFACE_CALL_STATE

#define             TP_IFACE_CHANNEL_INTERFACE_CALL_STATE

The interface name "org.freedesktop.Telepathy.Channel.Interface.CallState"


TP_IFACE_QUARK_CHANNEL_INTERFACE_CALL_STATE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_CALL_STATE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.CallState"


TP_IFACE_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION

#define             TP_IFACE_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION

The interface name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1"


TP_IFACE_QUARK_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1"


TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE

#define             TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE

The interface name "org.freedesktop.Telepathy.Channel.Interface.ChatState"


TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.ChatState"


TP_IFACE_CHANNEL_INTERFACE_CONFERENCE

#define             TP_IFACE_CHANNEL_INTERFACE_CONFERENCE

The interface name "org.freedesktop.Telepathy.Channel.Interface.Conference"


TP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Conference"


TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE

#define             TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE

The interface name "org.freedesktop.Telepathy.Channel.Interface.Destroyable"


TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Destroyable"


TP_IFACE_CHANNEL_INTERFACE_DTMF

#define             TP_IFACE_CHANNEL_INTERFACE_DTMF

The interface name "org.freedesktop.Telepathy.Channel.Interface.DTMF"


TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.DTMF"


TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA

#define             TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA

The interface name "org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata"


TP_IFACE_QUARK_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata"


TP_IFACE_CHANNEL_INTERFACE_GROUP

#define             TP_IFACE_CHANNEL_INTERFACE_GROUP

The interface name "org.freedesktop.Telepathy.Channel.Interface.Group"


TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Group"


TP_IFACE_CHANNEL_INTERFACE_HOLD

#define             TP_IFACE_CHANNEL_INTERFACE_HOLD

The interface name "org.freedesktop.Telepathy.Channel.Interface.Hold"


TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Hold"


TP_IFACE_CHANNEL_INTERFACE_PASSWORD

#define             TP_IFACE_CHANNEL_INTERFACE_PASSWORD

The interface name "org.freedesktop.Telepathy.Channel.Interface.Password"


TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Password"


TP_IFACE_CHANNEL_INTERFACE_ROOM

#define             TP_IFACE_CHANNEL_INTERFACE_ROOM

The interface name "org.freedesktop.Telepathy.Channel.Interface.Room2"


TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Room2"


TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG

#define             TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG

The interface name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1"


TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM_CONFIG

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM_CONFIG

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1"


TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION

#define             TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION

The interface name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication"


TP_IFACE_QUARK_CHANNEL_INTERFACE_SASL_AUTHENTICATION

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_SASL_AUTHENTICATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication"


TP_IFACE_CHANNEL_INTERFACE_SECURABLE

#define             TP_IFACE_CHANNEL_INTERFACE_SECURABLE

The interface name "org.freedesktop.Telepathy.Channel.Interface.Securable"


TP_IFACE_QUARK_CHANNEL_INTERFACE_SECURABLE

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_SECURABLE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Securable"


TP_IFACE_CHANNEL_INTERFACE_SMS

#define             TP_IFACE_CHANNEL_INTERFACE_SMS

The interface name "org.freedesktop.Telepathy.Channel.Interface.SMS"


TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.SMS"


TP_IFACE_CHANNEL_INTERFACE_SUBJECT

#define             TP_IFACE_CHANNEL_INTERFACE_SUBJECT

The interface name "org.freedesktop.Telepathy.Channel.Interface.Subject2"


TP_IFACE_QUARK_CHANNEL_INTERFACE_SUBJECT

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_SUBJECT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Subject2"


TP_IFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING

#define             TP_IFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING

The interface name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling"


TP_IFACE_QUARK_CHANNEL_INTERFACE_MEDIA_SIGNALLING

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_MEDIA_SIGNALLING

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling"


TP_IFACE_CHANNEL_INTERFACE_MESSAGES

#define             TP_IFACE_CHANNEL_INTERFACE_MESSAGES

The interface name "org.freedesktop.Telepathy.Channel.Interface.Messages"


TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.Messages"


TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT

#define             TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT

The interface name "org.freedesktop.Telepathy.Channel.Interface.ServicePoint"


TP_IFACE_QUARK_CHANNEL_INTERFACE_SERVICE_POINT

#define             TP_IFACE_QUARK_CHANNEL_INTERFACE_SERVICE_POINT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Channel.Interface.ServicePoint"


TP_IFACE_CHANNEL_DISPATCHER

#define             TP_IFACE_CHANNEL_DISPATCHER

The interface name "org.freedesktop.Telepathy.ChannelDispatcher"


TP_IFACE_QUARK_CHANNEL_DISPATCHER

#define             TP_IFACE_QUARK_CHANNEL_DISPATCHER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ChannelDispatcher"


TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1

#define             TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1

The interface name "org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1"


TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1

#define             TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1"


TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST

#define             TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST

The interface name "org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList"


TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST

#define             TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList"


TP_IFACE_CHANNEL_DISPATCH_OPERATION

#define             TP_IFACE_CHANNEL_DISPATCH_OPERATION

The interface name "org.freedesktop.Telepathy.ChannelDispatchOperation"


TP_IFACE_QUARK_CHANNEL_DISPATCH_OPERATION

#define             TP_IFACE_QUARK_CHANNEL_DISPATCH_OPERATION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ChannelDispatchOperation"


TP_IFACE_CHANNEL_REQUEST

#define             TP_IFACE_CHANNEL_REQUEST

The interface name "org.freedesktop.Telepathy.ChannelRequest"


TP_IFACE_QUARK_CHANNEL_REQUEST

#define             TP_IFACE_QUARK_CHANNEL_REQUEST

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.ChannelRequest"


TP_IFACE_MEDIA_SESSION_HANDLER

#define             TP_IFACE_MEDIA_SESSION_HANDLER

The interface name "org.freedesktop.Telepathy.Media.SessionHandler"


TP_IFACE_QUARK_MEDIA_SESSION_HANDLER

#define             TP_IFACE_QUARK_MEDIA_SESSION_HANDLER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Media.SessionHandler"


TP_IFACE_MEDIA_STREAM_HANDLER

#define             TP_IFACE_MEDIA_STREAM_HANDLER

The interface name "org.freedesktop.Telepathy.Media.StreamHandler"


TP_IFACE_QUARK_MEDIA_STREAM_HANDLER

#define             TP_IFACE_QUARK_MEDIA_STREAM_HANDLER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Media.StreamHandler"


TP_IFACE_PROPERTIES_INTERFACE

#define             TP_IFACE_PROPERTIES_INTERFACE

The interface name "org.freedesktop.Telepathy.Properties"


TP_IFACE_QUARK_PROPERTIES_INTERFACE

#define             TP_IFACE_QUARK_PROPERTIES_INTERFACE

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Properties"


TP_IFACE_CLIENT

#define             TP_IFACE_CLIENT

The interface name "org.freedesktop.Telepathy.Client"


TP_IFACE_QUARK_CLIENT

#define             TP_IFACE_QUARK_CLIENT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Client"


TP_IFACE_CLIENT_APPROVER

#define             TP_IFACE_CLIENT_APPROVER

The interface name "org.freedesktop.Telepathy.Client.Approver"


TP_IFACE_QUARK_CLIENT_APPROVER

#define             TP_IFACE_QUARK_CLIENT_APPROVER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Client.Approver"


TP_IFACE_CLIENT_HANDLER

#define             TP_IFACE_CLIENT_HANDLER

The interface name "org.freedesktop.Telepathy.Client.Handler"


TP_IFACE_QUARK_CLIENT_HANDLER

#define             TP_IFACE_QUARK_CLIENT_HANDLER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Client.Handler"


TP_IFACE_CLIENT_OBSERVER

#define             TP_IFACE_CLIENT_OBSERVER

The interface name "org.freedesktop.Telepathy.Client.Observer"


TP_IFACE_QUARK_CLIENT_OBSERVER

#define             TP_IFACE_QUARK_CLIENT_OBSERVER

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Client.Observer"


TP_IFACE_CLIENT_INTERFACE_REQUESTS

#define             TP_IFACE_CLIENT_INTERFACE_REQUESTS

The interface name "org.freedesktop.Telepathy.Client.Interface.Requests"


TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS

#define             TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Client.Interface.Requests"


TP_IFACE_CALL_CONTENT

#define             TP_IFACE_CALL_CONTENT

The interface name "org.freedesktop.Telepathy.Call1.Content"


TP_IFACE_QUARK_CALL_CONTENT

#define             TP_IFACE_QUARK_CALL_CONTENT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content"


TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA

#define             TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA

The interface name "org.freedesktop.Telepathy.Call1.Content.Interface.Media"


TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_MEDIA

#define             TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_MEDIA

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.Interface.Media"


TP_IFACE_CALL_CONTENT_INTERFACE_VIDEO_CONTROL

#define             TP_IFACE_CALL_CONTENT_INTERFACE_VIDEO_CONTROL

The interface name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl"


TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_VIDEO_CONTROL

#define             TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_VIDEO_CONTROL

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl"


TP_IFACE_CALL_CONTENT_INTERFACE_AUDIO_CONTROL

#define             TP_IFACE_CALL_CONTENT_INTERFACE_AUDIO_CONTROL

The interface name "org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl"


TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_AUDIO_CONTROL

#define             TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_AUDIO_CONTROL

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl"


TP_IFACE_CALL_CONTENT_INTERFACE_DTMF

#define             TP_IFACE_CALL_CONTENT_INTERFACE_DTMF

The interface name "org.freedesktop.Telepathy.Call1.Content.Interface.DTMF"


TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF

#define             TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.Interface.DTMF"


TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION

#define             TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION

The interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription"


TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION

#define             TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription"


TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS

#define             TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS

The interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports"


TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS

#define             TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports"


TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK

#define             TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK

The interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback"


TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK

#define             TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback"


TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS

#define             TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS

The interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTPHeaderExtensions"


TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS

#define             TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTPHeaderExtensions"


TP_IFACE_CALL_STREAM

#define             TP_IFACE_CALL_STREAM

The interface name "org.freedesktop.Telepathy.Call1.Stream"


TP_IFACE_QUARK_CALL_STREAM

#define             TP_IFACE_QUARK_CALL_STREAM

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Stream"


TP_IFACE_CALL_STREAM_ENDPOINT

#define             TP_IFACE_CALL_STREAM_ENDPOINT

The interface name "org.freedesktop.Telepathy.Call1.Stream.Endpoint"


TP_IFACE_QUARK_CALL_STREAM_ENDPOINT

#define             TP_IFACE_QUARK_CALL_STREAM_ENDPOINT

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Stream.Endpoint"


TP_IFACE_CALL_STREAM_INTERFACE_MEDIA

#define             TP_IFACE_CALL_STREAM_INTERFACE_MEDIA

The interface name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media"


TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA

#define             TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA

Expands to a call to a function that returns a quark for the interface name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media"


TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE

#define             TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE

The fully-qualified property name "org.freedesktop.Telepathy.Account.AutomaticPresence"


TP_PROP_ACCOUNT_CHANGING_PRESENCE

#define             TP_PROP_ACCOUNT_CHANGING_PRESENCE

The fully-qualified property name "org.freedesktop.Telepathy.Account.ChangingPresence"


TP_PROP_ACCOUNT_CONNECTION

#define             TP_PROP_ACCOUNT_CONNECTION

The fully-qualified property name "org.freedesktop.Telepathy.Account.Connection"


TP_PROP_ACCOUNT_CONNECTION_ERROR

#define             TP_PROP_ACCOUNT_CONNECTION_ERROR

The fully-qualified property name "org.freedesktop.Telepathy.Account.ConnectionError"


TP_PROP_ACCOUNT_CONNECTION_ERROR_DETAILS

#define             TP_PROP_ACCOUNT_CONNECTION_ERROR_DETAILS

The fully-qualified property name "org.freedesktop.Telepathy.Account.ConnectionErrorDetails"


TP_PROP_ACCOUNT_CONNECTION_STATUS

#define             TP_PROP_ACCOUNT_CONNECTION_STATUS

The fully-qualified property name "org.freedesktop.Telepathy.Account.ConnectionStatus"


TP_PROP_ACCOUNT_CONNECTION_STATUS_REASON

#define             TP_PROP_ACCOUNT_CONNECTION_STATUS_REASON

The fully-qualified property name "org.freedesktop.Telepathy.Account.ConnectionStatusReason"


TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY

#define             TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY

The fully-qualified property name "org.freedesktop.Telepathy.Account.ConnectAutomatically"


TP_PROP_ACCOUNT_CURRENT_PRESENCE

#define             TP_PROP_ACCOUNT_CURRENT_PRESENCE

The fully-qualified property name "org.freedesktop.Telepathy.Account.CurrentPresence"


TP_PROP_ACCOUNT_DISPLAY_NAME

#define             TP_PROP_ACCOUNT_DISPLAY_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Account.DisplayName"


TP_PROP_ACCOUNT_ENABLED

#define             TP_PROP_ACCOUNT_ENABLED

The fully-qualified property name "org.freedesktop.Telepathy.Account.Enabled"


TP_PROP_ACCOUNT_HAS_BEEN_ONLINE

#define             TP_PROP_ACCOUNT_HAS_BEEN_ONLINE

The fully-qualified property name "org.freedesktop.Telepathy.Account.HasBeenOnline"


TP_PROP_ACCOUNT_ICON

#define             TP_PROP_ACCOUNT_ICON

The fully-qualified property name "org.freedesktop.Telepathy.Account.Icon"


TP_PROP_ACCOUNT_INTERFACES

#define             TP_PROP_ACCOUNT_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interfaces"


TP_PROP_ACCOUNT_INTERFACE_ADDRESSING_URI_SCHEMES

#define             TP_PROP_ACCOUNT_INTERFACE_ADDRESSING_URI_SCHEMES

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Addressing.URISchemes"


TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR

#define             TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Avatar.Avatar"


TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_IDENTIFIER

#define             TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_IDENTIFIER

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Storage.StorageIdentifier"


TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER

#define             TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Storage.StorageProvider"


TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_RESTRICTIONS

#define             TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_RESTRICTIONS

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Storage.StorageRestrictions"


TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_SPECIFIC_INFORMATION

#define             TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_SPECIFIC_INFORMATION

The fully-qualified property name "org.freedesktop.Telepathy.Account.Interface.Storage.StorageSpecificInformation"


TP_PROP_ACCOUNT_MANAGER_INTERFACES

#define             TP_PROP_ACCOUNT_MANAGER_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.AccountManager.Interfaces"


TP_PROP_ACCOUNT_MANAGER_INVALID_ACCOUNTS

#define             TP_PROP_ACCOUNT_MANAGER_INVALID_ACCOUNTS

The fully-qualified property name "org.freedesktop.Telepathy.AccountManager.InvalidAccounts"


TP_PROP_ACCOUNT_MANAGER_SUPPORTED_ACCOUNT_PROPERTIES

#define             TP_PROP_ACCOUNT_MANAGER_SUPPORTED_ACCOUNT_PROPERTIES

The fully-qualified property name "org.freedesktop.Telepathy.AccountManager.SupportedAccountProperties"


TP_PROP_ACCOUNT_MANAGER_VALID_ACCOUNTS

#define             TP_PROP_ACCOUNT_MANAGER_VALID_ACCOUNTS

The fully-qualified property name "org.freedesktop.Telepathy.AccountManager.ValidAccounts"


TP_PROP_ACCOUNT_NICKNAME

#define             TP_PROP_ACCOUNT_NICKNAME

The fully-qualified property name "org.freedesktop.Telepathy.Account.Nickname"


TP_PROP_ACCOUNT_NORMALIZED_NAME

#define             TP_PROP_ACCOUNT_NORMALIZED_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Account.NormalizedName"


TP_PROP_ACCOUNT_PARAMETERS

#define             TP_PROP_ACCOUNT_PARAMETERS

The fully-qualified property name "org.freedesktop.Telepathy.Account.Parameters"


TP_PROP_ACCOUNT_REQUESTED_PRESENCE

#define             TP_PROP_ACCOUNT_REQUESTED_PRESENCE

The fully-qualified property name "org.freedesktop.Telepathy.Account.RequestedPresence"


TP_PROP_ACCOUNT_SERVICE

#define             TP_PROP_ACCOUNT_SERVICE

The fully-qualified property name "org.freedesktop.Telepathy.Account.Service"


TP_PROP_ACCOUNT_SUPERSEDES

#define             TP_PROP_ACCOUNT_SUPERSEDES

The fully-qualified property name "org.freedesktop.Telepathy.Account.Supersedes"


TP_PROP_ACCOUNT_VALID

#define             TP_PROP_ACCOUNT_VALID

The fully-qualified property name "org.freedesktop.Telepathy.Account.Valid"


TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_CHAIN_DATA

#define             TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_CHAIN_DATA

The fully-qualified property name "org.freedesktop.Telepathy.Authentication.TLSCertificate.CertificateChainData"


TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_TYPE

#define             TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Authentication.TLSCertificate.CertificateType"


TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_REJECTIONS

#define             TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_REJECTIONS

The fully-qualified property name "org.freedesktop.Telepathy.Authentication.TLSCertificate.Rejections"


TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_STATE

#define             TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Authentication.TLSCertificate.State"


TP_PROP_CALL_CONTENT_DISPOSITION

#define             TP_PROP_CALL_CONTENT_DISPOSITION

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Disposition"


TP_PROP_CALL_CONTENT_INTERFACES

#define             TP_PROP_CALL_CONTENT_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interfaces"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_EVENT

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_EVENT

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.CurrentDTMFEvent"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_STATE

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.CurrentDTMFState"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_LOCAL_MEDIA_DESCRIPTIONS

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_LOCAL_MEDIA_DESCRIPTIONS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.LocalMediaDescriptions"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_MEDIA_DESCRIPTION_OFFER

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_MEDIA_DESCRIPTION_OFFER

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.MediaDescriptionOffer"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_PACKETIZATION

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_PACKETIZATION

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.Packetization"


TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_REMOTE_MEDIA_DESCRIPTIONS

#define             TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_REMOTE_MEDIA_DESCRIPTIONS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.Media.RemoteMediaDescriptions"


TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_BITRATE

#define             TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_BITRATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.Bitrate"


TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_FRAMERATE

#define             TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_FRAMERATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.Framerate"


TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MANUAL_KEY_FRAMES

#define             TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MANUAL_KEY_FRAMES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.ManualKeyFrames"


TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MTU

#define             TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MTU

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.MTU"


TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_VIDEO_RESOLUTION

#define             TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_VIDEO_RESOLUTION

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.VideoResolution"


TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_INPUT_VOLUME

#define             TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_INPUT_VOLUME

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl.RequestedInputVolume"


TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_OUTPUT_VOLUME

#define             TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_OUTPUT_VOLUME

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl.RequestedOutputVolume"


TP_PROP_CALL_CONTENT_INTERFACE_DTMF_CURRENTLY_SENDING_TONES

#define             TP_PROP_CALL_CONTENT_INTERFACE_DTMF_CURRENTLY_SENDING_TONES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.CurrentlySendingTones"


TP_PROP_CALL_CONTENT_INTERFACE_DTMF_DEFERRED_TONES

#define             TP_PROP_CALL_CONTENT_INTERFACE_DTMF_DEFERRED_TONES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.DeferredTones"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Codecs"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_FURTHER_NEGOTIATION_REQUIRED

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_FURTHER_NEGOTIATION_REQUIRED

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.FurtherNegotiationRequired"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_HAS_REMOTE_INFORMATION

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_HAS_REMOTE_INFORMATION

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.HasRemoteInformation"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACES

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interfaces"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DLRR_MAX_SIZE

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DLRR_MAX_SIZE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.DLRRMaxSize"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DUPLICATE_RLE_MAX_SIZE

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DUPLICATE_RLE_MAX_SIZE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.DuplicateRLEMaxSize"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_ENABLE_METRICS

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_ENABLE_METRICS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.EnableMetrics"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_LOSS_RLE_MAX_SIZE

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_LOSS_RLE_MAX_SIZE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.LossRLEMaxSize"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_PACKET_RECEIPT_TIMES_MAX_SIZE

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_PACKET_RECEIPT_TIMES_MAX_SIZE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.PacketReceiptTimesMaxSize"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_RTT_MODE

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_RTT_MODE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.RTTMode"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_STATISTICS_FLAGS

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_STATISTICS_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPExtendedReports.StatisticsFlags"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_DOES_AVPF

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_DOES_AVPF

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback.DoesAVPF"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_FEEDBACK_MESSAGES

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_FEEDBACK_MESSAGES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTCPFeedback.FeedbackMessages"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS_HEADER_EXTENSIONS

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS_HEADER_EXTENSIONS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.Interface.RTPHeaderExtensions.HeaderExtensions"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.RemoteContact"


TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_SSRCS

#define             TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_SSRCS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.MediaDescription.SSRCs"


TP_PROP_CALL_CONTENT_NAME

#define             TP_PROP_CALL_CONTENT_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Name"


TP_PROP_CALL_CONTENT_STREAMS

#define             TP_PROP_CALL_CONTENT_STREAMS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Streams"


TP_PROP_CALL_CONTENT_TYPE

#define             TP_PROP_CALL_CONTENT_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Content.Type"


TP_PROP_CALL_STREAM_CAN_REQUEST_RECEIVING

#define             TP_PROP_CALL_STREAM_CAN_REQUEST_RECEIVING

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.CanRequestReceiving"


TP_PROP_CALL_STREAM_ENDPOINT_CONTROLLING

#define             TP_PROP_CALL_STREAM_ENDPOINT_CONTROLLING

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.Controlling"


TP_PROP_CALL_STREAM_ENDPOINT_ENDPOINT_STATE

#define             TP_PROP_CALL_STREAM_ENDPOINT_ENDPOINT_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.EndpointState"


TP_PROP_CALL_STREAM_ENDPOINT_IS_ICE_LITE

#define             TP_PROP_CALL_STREAM_ENDPOINT_IS_ICE_LITE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.IsICELite"


TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CANDIDATES

#define             TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CANDIDATES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.RemoteCandidates"


TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CREDENTIALS

#define             TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CREDENTIALS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.RemoteCredentials"


TP_PROP_CALL_STREAM_ENDPOINT_SELECTED_CANDIDATE_PAIRS

#define             TP_PROP_CALL_STREAM_ENDPOINT_SELECTED_CANDIDATE_PAIRS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.SelectedCandidatePairs"


TP_PROP_CALL_STREAM_ENDPOINT_TRANSPORT

#define             TP_PROP_CALL_STREAM_ENDPOINT_TRANSPORT

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Endpoint.Transport"


TP_PROP_CALL_STREAM_INTERFACES

#define             TP_PROP_CALL_STREAM_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interfaces"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ENDPOINTS

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ENDPOINTS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.Endpoints"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_HAS_SERVER_INFO

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_HAS_SERVER_INFO

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.HasServerInfo"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ICE_RESTART_PENDING

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ICE_RESTART_PENDING

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.ICERestartPending"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CANDIDATES

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CANDIDATES

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.LocalCandidates"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CREDENTIALS

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CREDENTIALS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.LocalCredentials"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RECEIVING_STATE

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RECEIVING_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.ReceivingState"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RELAY_INFO

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RELAY_INFO

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.RelayInfo"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_SENDING_STATE

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_SENDING_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.SendingState"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_STUN_SERVERS

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_STUN_SERVERS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.STUNServers"


TP_PROP_CALL_STREAM_INTERFACE_MEDIA_TRANSPORT

#define             TP_PROP_CALL_STREAM_INTERFACE_MEDIA_TRANSPORT

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.Interface.Media.Transport"


TP_PROP_CALL_STREAM_LOCAL_SENDING_STATE

#define             TP_PROP_CALL_STREAM_LOCAL_SENDING_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.LocalSendingState"


TP_PROP_CALL_STREAM_REMOTE_MEMBERS

#define             TP_PROP_CALL_STREAM_REMOTE_MEMBERS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.RemoteMembers"


TP_PROP_CALL_STREAM_REMOTE_MEMBER_IDENTIFIERS

#define             TP_PROP_CALL_STREAM_REMOTE_MEMBER_IDENTIFIERS

The fully-qualified property name "org.freedesktop.Telepathy.Call1.Stream.RemoteMemberIdentifiers"


TP_PROP_CHANNEL_CHANNEL_TYPE

#define             TP_PROP_CHANNEL_CHANNEL_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.ChannelType"


TP_PROP_CHANNEL_DISPATCHER_INTERFACES

#define             TP_PROP_CHANNEL_DISPATCHER_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatcher.Interfaces"


TP_PROP_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST_DISPATCH_OPERATIONS

#define             TP_PROP_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST_DISPATCH_OPERATIONS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList.DispatchOperations"


TP_PROP_CHANNEL_DISPATCHER_SUPPORTS_REQUEST_HINTS

#define             TP_PROP_CHANNEL_DISPATCHER_SUPPORTS_REQUEST_HINTS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatcher.SupportsRequestHints"


TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT

#define             TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatchOperation.Account"


TP_PROP_CHANNEL_DISPATCH_OPERATION_CHANNELS

#define             TP_PROP_CHANNEL_DISPATCH_OPERATION_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatchOperation.Channels"


TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION

#define             TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatchOperation.Connection"


TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES

#define             TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatchOperation.Interfaces"


TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS

#define             TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelDispatchOperation.PossibleHandlers"


TP_PROP_CHANNEL_INITIATOR_HANDLE

#define             TP_PROP_CHANNEL_INITIATOR_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.InitiatorHandle"


TP_PROP_CHANNEL_INITIATOR_ID

#define             TP_PROP_CHANNEL_INITIATOR_ID

The fully-qualified property name "org.freedesktop.Telepathy.Channel.InitiatorID"


TP_PROP_CHANNEL_INTERFACES

#define             TP_PROP_CHANNEL_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interfaces"


TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY

#define             TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Anonymity.AnonymityMandatory"


TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MODES

#define             TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MODES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Anonymity.AnonymityModes"


TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMOUS_ID

#define             TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMOUS_ID

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Anonymity.AnonymousID"


TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAN_RETRY_CAPTCHA

#define             TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAN_RETRY_CAPTCHA

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.CanRetryCaptcha"


TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR

#define             TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.CaptchaError"


TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR_DETAILS

#define             TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR_DETAILS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.CaptchaErrorDetails"


TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_STATUS

#define             TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_STATUS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.CaptchaStatus"


TP_PROP_CHANNEL_INTERFACE_CHAT_STATE_CHAT_STATES

#define             TP_PROP_CHANNEL_INTERFACE_CHAT_STATE_CHAT_STATES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.ChatState.ChatStates"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_CHANNELS

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.Channels"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.InitialChannels"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_HANDLES

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_HANDLES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.InitialInviteeHandles"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.InitialInviteeIDs"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INVITATION_MESSAGE

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INVITATION_MESSAGE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.InvitationMessage"


TP_PROP_CHANNEL_INTERFACE_CONFERENCE_ORIGINAL_CHANNELS

#define             TP_PROP_CHANNEL_INTERFACE_CONFERENCE_ORIGINAL_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Conference.OriginalChannels"


TP_PROP_CHANNEL_INTERFACE_DTMF_CURRENTLY_SENDING_TONES

#define             TP_PROP_CHANNEL_INTERFACE_DTMF_CURRENTLY_SENDING_TONES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.DTMF.CurrentlySendingTones"


TP_PROP_CHANNEL_INTERFACE_DTMF_DEFERRED_TONES

#define             TP_PROP_CHANNEL_INTERFACE_DTMF_DEFERRED_TONES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.DTMF.DeferredTones"


TP_PROP_CHANNEL_INTERFACE_DTMF_INITIAL_TONES

#define             TP_PROP_CHANNEL_INTERFACE_DTMF_INITIAL_TONES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.DTMF.InitialTones"


TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME

#define             TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata.ServiceName"


TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA

#define             TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.FileTransfer.Metadata.Metadata"


TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.GroupFlags"


TP_PROP_CHANNEL_INTERFACE_GROUP_HANDLE_OWNERS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_HANDLE_OWNERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.HandleOwners"


TP_PROP_CHANNEL_INTERFACE_GROUP_LOCAL_PENDING_MEMBERS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_LOCAL_PENDING_MEMBERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.LocalPendingMembers"


TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBERS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.Members"


TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBER_IDENTIFIERS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBER_IDENTIFIERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.MemberIdentifiers"


TP_PROP_CHANNEL_INTERFACE_GROUP_REMOTE_PENDING_MEMBERS

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_REMOTE_PENDING_MEMBERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.RemotePendingMembers"


TP_PROP_CHANNEL_INTERFACE_GROUP_SELF_HANDLE

#define             TP_PROP_CHANNEL_INTERFACE_GROUP_SELF_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Group.SelfHandle"


TP_PROP_CHANNEL_INTERFACE_MESSAGES_DELIVERY_REPORTING_SUPPORT

#define             TP_PROP_CHANNEL_INTERFACE_MESSAGES_DELIVERY_REPORTING_SUPPORT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Messages.DeliveryReportingSupport"


TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_PART_SUPPORT_FLAGS

#define             TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_PART_SUPPORT_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Messages.MessagePartSupportFlags"


TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_TYPES

#define             TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Messages.MessageTypes"


TP_PROP_CHANNEL_INTERFACE_MESSAGES_PENDING_MESSAGES

#define             TP_PROP_CHANNEL_INTERFACE_MESSAGES_PENDING_MESSAGES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Messages.PendingMessages"


TP_PROP_CHANNEL_INTERFACE_MESSAGES_SUPPORTED_CONTENT_TYPES

#define             TP_PROP_CHANNEL_INTERFACE_MESSAGES_SUPPORTED_CONTENT_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Messages.SupportedContentTypes"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_ANONYMOUS

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_ANONYMOUS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Anonymous"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CAN_UPDATE_CONFIGURATION

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CAN_UPDATE_CONFIGURATION

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.CanUpdateConfiguration"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CONFIGURATION_RETRIEVED

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CONFIGURATION_RETRIEVED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.ConfigurationRetrieved"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_DESCRIPTION

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_DESCRIPTION

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Description"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_INVITEONLY

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_INVITEONLY

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.InviteOnly"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_LIMIT

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_LIMIT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Limit"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MODERATED

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MODERATED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Moderated"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MUTABLE_PROPERTIES

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MUTABLE_PROPERTIES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.MutableProperties"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Password"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_HINT

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_HINT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.PasswordHint"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_PROTECTED

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_PROTECTED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.PasswordProtected"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PERSISTENT

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PERSISTENT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Persistent"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PRIVATE

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PRIVATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Private"


TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_TITLE

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_TITLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.Title"


TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Room2.RoomName"


TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Room2.Server"


TP_PROP_CHANNEL_INTERFACE_ROOM_CREATION_TIMESTAMP

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CREATION_TIMESTAMP

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Room2.CreationTimestamp"


TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Room2.Creator"


TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR_HANDLE

#define             TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Room2.CreatorHandle"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AUTHORIZATION_IDENTITY

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AUTHORIZATION_IDENTITY

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.AuthorizationIdentity"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.AvailableMechanisms"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_CAN_TRY_AGAIN

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_CAN_TRY_AGAIN

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.CanTryAgain"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_REALM

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_REALM

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.DefaultRealm"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_USERNAME

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_USERNAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.DefaultUsername"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_HAS_INITIAL_DATA

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_HAS_INITIAL_DATA

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.HasInitialData"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_MAY_SAVE_RESPONSE

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_MAY_SAVE_RESPONSE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.MaySaveResponse"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.SASLError"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR_DETAILS

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR_DETAILS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.SASLErrorDetails"


TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_STATUS

#define             TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_STATUS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.SASLStatus"


TP_PROP_CHANNEL_INTERFACE_SECURABLE_ENCRYPTED

#define             TP_PROP_CHANNEL_INTERFACE_SECURABLE_ENCRYPTED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Securable.Encrypted"


TP_PROP_CHANNEL_INTERFACE_SECURABLE_VERIFIED

#define             TP_PROP_CHANNEL_INTERFACE_SECURABLE_VERIFIED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Securable.Verified"


TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_CURRENT_SERVICE_POINT

#define             TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_CURRENT_SERVICE_POINT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.ServicePoint.CurrentServicePoint"


TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_INITIAL_SERVICE_POINT

#define             TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_INITIAL_SERVICE_POINT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.ServicePoint.InitialServicePoint"


TP_PROP_CHANNEL_INTERFACE_SMS_FLASH

#define             TP_PROP_CHANNEL_INTERFACE_SMS_FLASH

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SMS.Flash"


TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL

#define             TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.SMS.SMSChannel"


TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR

#define             TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Subject2.Actor"


TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR_HANDLE

#define             TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Subject2.ActorHandle"


TP_PROP_CHANNEL_INTERFACE_SUBJECT_CAN_SET

#define             TP_PROP_CHANNEL_INTERFACE_SUBJECT_CAN_SET

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Subject2.CanSet"


TP_PROP_CHANNEL_INTERFACE_SUBJECT_SUBJECT

#define             TP_PROP_CHANNEL_INTERFACE_SUBJECT_SUBJECT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Subject2.Subject"


TP_PROP_CHANNEL_INTERFACE_SUBJECT_TIMESTAMP

#define             TP_PROP_CHANNEL_INTERFACE_SUBJECT_TIMESTAMP

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Subject2.Timestamp"


TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS

#define             TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Tube.Parameters"


TP_PROP_CHANNEL_INTERFACE_TUBE_STATE

#define             TP_PROP_CHANNEL_INTERFACE_TUBE_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Interface.Tube.State"


TP_PROP_CHANNEL_TYPE_SERVER_AUTHENTICATION_AUTHENTICATION_METHOD

#define             TP_PROP_CHANNEL_TYPE_SERVER_AUTHENTICATION_AUTHENTICATION_METHOD

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ServerAuthentication.AuthenticationMethod"


TP_PROP_CHANNEL_REQUESTED

#define             TP_PROP_CHANNEL_REQUESTED

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Requested"


TP_PROP_CHANNEL_REQUEST_ACCOUNT

#define             TP_PROP_CHANNEL_REQUEST_ACCOUNT

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.Account"


TP_PROP_CHANNEL_REQUEST_HINTS

#define             TP_PROP_CHANNEL_REQUEST_HINTS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.Hints"


TP_PROP_CHANNEL_REQUEST_INTERFACES

#define             TP_PROP_CHANNEL_REQUEST_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.Interfaces"


TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER

#define             TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.PreferredHandler"


TP_PROP_CHANNEL_REQUEST_REQUESTS

#define             TP_PROP_CHANNEL_REQUEST_REQUESTS

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.Requests"


TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME

#define             TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME

The fully-qualified property name "org.freedesktop.Telepathy.ChannelRequest.UserActionTime"


TP_PROP_CHANNEL_TARGET_HANDLE

#define             TP_PROP_CHANNEL_TARGET_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.TargetHandle"


TP_PROP_CHANNEL_TARGET_HANDLE_TYPE

#define             TP_PROP_CHANNEL_TARGET_HANDLE_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.TargetHandleType"


TP_PROP_CHANNEL_TARGET_ID

#define             TP_PROP_CHANNEL_TARGET_ID

The fully-qualified property name "org.freedesktop.Telepathy.Channel.TargetID"


TP_PROP_CHANNEL_TYPE_CALL_CALL_FLAGS

#define             TP_PROP_CHANNEL_TYPE_CALL_CALL_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.CallFlags"


TP_PROP_CHANNEL_TYPE_CALL_CALL_MEMBERS

#define             TP_PROP_CHANNEL_TYPE_CALL_CALL_MEMBERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.CallMembers"


TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE

#define             TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.CallState"


TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_DETAILS

#define             TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_DETAILS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.CallStateDetails"


TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_REASON

#define             TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_REASON

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.CallStateReason"


TP_PROP_CHANNEL_TYPE_CALL_CONTENTS

#define             TP_PROP_CHANNEL_TYPE_CALL_CONTENTS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.Contents"


TP_PROP_CHANNEL_TYPE_CALL_HARDWARE_STREAMING

#define             TP_PROP_CHANNEL_TYPE_CALL_HARDWARE_STREAMING

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.HardwareStreaming"


TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO

#define             TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio"


TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO_NAME

#define             TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudioName"


TP_PROP_CHANNEL_TYPE_CALL_INITIAL_TRANSPORT

#define             TP_PROP_CHANNEL_TYPE_CALL_INITIAL_TRANSPORT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.InitialTransport"


TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO

#define             TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo"


TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO_NAME

#define             TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideoName"


TP_PROP_CHANNEL_TYPE_CALL_MEMBER_IDENTIFIERS

#define             TP_PROP_CHANNEL_TYPE_CALL_MEMBER_IDENTIFIERS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.MemberIdentifiers"


TP_PROP_CHANNEL_TYPE_CALL_MUTABLE_CONTENTS

#define             TP_PROP_CHANNEL_TYPE_CALL_MUTABLE_CONTENTS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.Call1.MutableContents"


TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_AVAILABLE_SEARCH_KEYS

#define             TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_AVAILABLE_SEARCH_KEYS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ContactSearch.AvailableSearchKeys"


TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT

#define             TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ContactSearch.Limit"


TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SEARCH_STATE

#define             TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SEARCH_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ContactSearch.SearchState"


TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER

#define             TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ContactSearch.Server"


TP_PROP_CHANNEL_TYPE_DBUS_TUBE_DBUS_NAMES

#define             TP_PROP_CHANNEL_TYPE_DBUS_TUBE_DBUS_NAMES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.DBusTube.DBusNames"


TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME

#define             TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.DBusTube.ServiceName"


TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS

#define             TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.DBusTube.SupportedAccessControls"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_AVAILABLE_SOCKET_TYPES

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_AVAILABLE_SOCKET_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.AvailableSocketTypes"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.ContentHash"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.ContentHashType"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.ContentType"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.Date"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.Description"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILE_COLLECTION

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILE_COLLECTION

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.FileCollection"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.Filename"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.InitialOffset"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.Size"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_STATE

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.State"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_TRANSFERRED_BYTES

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_TRANSFERRED_BYTES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.TransferredBytes"


TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI

#define             TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.FileTransfer.URI"


TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER

#define             TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.RoomList.Server"


TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME

#define             TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection.Hostname"


TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES

#define             TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection.ReferenceIdentities"


TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_SERVER_CERTIFICATE

#define             TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_SERVER_CERTIFICATE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection.ServerCertificate"


TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_IMMUTABLE_STREAMS

#define             TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_IMMUTABLE_STREAMS

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.StreamedMedia.ImmutableStreams"


TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO

#define             TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio"


TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO

#define             TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialVideo"


TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE

#define             TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.StreamTube.Service"


TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES

#define             TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Channel.Type.StreamTube.SupportedSocketTypes"


TP_PROP_CLIENT_APPROVER_APPROVER_CHANNEL_FILTER

#define             TP_PROP_CLIENT_APPROVER_APPROVER_CHANNEL_FILTER

The fully-qualified property name "org.freedesktop.Telepathy.Client.Approver.ApproverChannelFilter"


TP_PROP_CLIENT_HANDLER_BYPASS_APPROVAL

#define             TP_PROP_CLIENT_HANDLER_BYPASS_APPROVAL

The fully-qualified property name "org.freedesktop.Telepathy.Client.Handler.BypassApproval"


TP_PROP_CLIENT_HANDLER_CAPABILITIES

#define             TP_PROP_CLIENT_HANDLER_CAPABILITIES

The fully-qualified property name "org.freedesktop.Telepathy.Client.Handler.Capabilities"


TP_PROP_CLIENT_HANDLER_HANDLED_CHANNELS

#define             TP_PROP_CLIENT_HANDLER_HANDLED_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.Client.Handler.HandledChannels"


TP_PROP_CLIENT_HANDLER_HANDLER_CHANNEL_FILTER

#define             TP_PROP_CLIENT_HANDLER_HANDLER_CHANNEL_FILTER

The fully-qualified property name "org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter"


TP_PROP_CLIENT_INTERFACES

#define             TP_PROP_CLIENT_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Client.Interfaces"


TP_PROP_CLIENT_OBSERVER_DELAY_APPROVERS

#define             TP_PROP_CLIENT_OBSERVER_DELAY_APPROVERS

The fully-qualified property name "org.freedesktop.Telepathy.Client.Observer.DelayApprovers"


TP_PROP_CLIENT_OBSERVER_OBSERVER_CHANNEL_FILTER

#define             TP_PROP_CLIENT_OBSERVER_OBSERVER_CHANNEL_FILTER

The fully-qualified property name "org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter"


TP_PROP_CLIENT_OBSERVER_RECOVER

#define             TP_PROP_CLIENT_OBSERVER_RECOVER

The fully-qualified property name "org.freedesktop.Telepathy.Client.Observer.Recover"


TP_PROP_CONNECTION_HAS_IMMORTAL_HANDLES

#define             TP_PROP_CONNECTION_HAS_IMMORTAL_HANDLES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.HasImmortalHandles"


TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY

#define             TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Anonymity.AnonymityMandatory"


TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MODES

#define             TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MODES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Anonymity.AnonymityModes"


TP_PROP_CONNECTION_INTERFACE_ANONYMITY_SUPPORTED_ANONYMITY_MODES

#define             TP_PROP_CONNECTION_INTERFACE_ANONYMITY_SUPPORTED_ANONYMITY_MODES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Anonymity.SupportedAnonymityModes"


TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.MaximumAvatarBytes"


TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.MaximumAvatarHeight"


TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.MaximumAvatarWidth"


TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.MinimumAvatarHeight"


TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.MinimumAvatarWidth"


TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.RecommendedAvatarHeight"


TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.RecommendedAvatarWidth"


TP_PROP_CONNECTION_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES

#define             TP_PROP_CONNECTION_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Avatars.SupportedAvatarMIMETypes"


TP_PROP_CONNECTION_INTERFACE_BALANCE_ACCOUNT_BALANCE

#define             TP_PROP_CONNECTION_INTERFACE_BALANCE_ACCOUNT_BALANCE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Balance.AccountBalance"


TP_PROP_CONNECTION_INTERFACE_BALANCE_MANAGE_CREDIT_URI

#define             TP_PROP_CONNECTION_INTERFACE_BALANCE_MANAGE_CREDIT_URI

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Balance.ManageCreditURI"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_IMSI

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_IMSI

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.IMSI"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_NATIONAL_CHARACTER_SET

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_NATIONAL_CHARACTER_SET

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageNationalCharacterSet"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_REDUCED_CHARACTER_SET

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_REDUCED_CHARACTER_SET

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageReducedCharacterSet"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_SERVICE_CENTRE

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_SERVICE_CENTRE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageServiceCentre"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_VALIDITY_PERIOD

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_VALIDITY_PERIOD

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageValidityPeriod"


TP_PROP_CONNECTION_INTERFACE_CELLULAR_OVERRIDE_MESSAGE_SERVICE_CENTRE

#define             TP_PROP_CONNECTION_INTERFACE_CELLULAR_OVERRIDE_MESSAGE_SERVICE_CENTRE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Cellular.OverrideMessageServiceCentre"


TP_PROP_CONNECTION_INTERFACE_CONTACTS_CONTACT_ATTRIBUTE_INTERFACES

#define             TP_PROP_CONNECTION_INTERFACE_CONTACTS_CONTACT_ATTRIBUTE_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Contacts.ContactAttributeInterfaces"


TP_PROP_CONNECTION_INTERFACE_CONTACT_BLOCKING_CONTACT_BLOCKING_CAPABILITIES

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_BLOCKING_CONTACT_BLOCKING_CAPABILITIES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactBlocking.ContactBlockingCapabilities"


TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_DISJOINT_GROUPS

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_DISJOINT_GROUPS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups.DisjointGroups"


TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups.Groups"


TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUP_STORAGE

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUP_STORAGE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups.GroupStorage"


TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_CONTACT_INFO_FLAGS

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_CONTACT_INFO_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactInfo.ContactInfoFlags"


TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_SUPPORTED_FIELDS

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_SUPPORTED_FIELDS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactInfo.SupportedFields"


TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CAN_CHANGE_CONTACT_LIST

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CAN_CHANGE_CONTACT_LIST

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactList.CanChangeContactList"


TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactList.DownloadAtConnection"


TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_REQUEST_USES_MESSAGE

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_REQUEST_USES_MESSAGE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactList.RequestUsesMessage"


TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_PERSISTS

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_PERSISTS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactList.ContactListPersists"


TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_STATE

#define             TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_STATE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ContactList.ContactListState"


TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL

#define             TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Location.LocationAccessControl"


TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL_TYPES

#define             TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Location.LocationAccessControlTypes"


TP_PROP_CONNECTION_INTERFACE_LOCATION_SUPPORTED_LOCATION_FEATURES

#define             TP_PROP_CONNECTION_INTERFACE_LOCATION_SUPPORTED_LOCATION_FEATURES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Location.SupportedLocationFeatures"


TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_ADDRESS

#define             TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_ADDRESS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.MailNotification.MailAddress"


TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_NOTIFICATION_FLAGS

#define             TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_NOTIFICATION_FLAGS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.MailNotification.MailNotificationFlags"


TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAILS

#define             TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAILS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.MailNotification.UnreadMails"


TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAIL_COUNT

#define             TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAIL_COUNT

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.MailNotification.UnreadMailCount"


TP_PROP_CONNECTION_INTERFACE_POWER_SAVING_POWER_SAVING_ACTIVE

#define             TP_PROP_CONNECTION_INTERFACE_POWER_SAVING_POWER_SAVING_ACTIVE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.PowerSaving.PowerSavingActive"


TP_PROP_CONNECTION_INTERFACE_REQUESTS_CHANNELS

#define             TP_PROP_CONNECTION_INTERFACE_REQUESTS_CHANNELS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Requests.Channels"


TP_PROP_CONNECTION_INTERFACE_REQUESTS_REQUESTABLE_CHANNEL_CLASSES

#define             TP_PROP_CONNECTION_INTERFACE_REQUESTS_REQUESTABLE_CHANNEL_CLASSES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.Requests.RequestableChannelClasses"


TP_PROP_CONNECTION_INTERFACE_SERVICE_POINT_KNOWN_SERVICE_POINTS

#define             TP_PROP_CONNECTION_INTERFACE_SERVICE_POINT_KNOWN_SERVICE_POINTS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.ServicePoint.KnownServicePoints"


TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_STATUSES

#define             TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_STATUSES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.SimplePresence.Statuses"


TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_MAXIMUM_STATUS_MESSAGE_LENGTH

#define             TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_MAXIMUM_STATUS_MESSAGE_LENGTH

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interface.SimplePresence.MaximumStatusMessageLength"


TP_PROP_CONNECTION_MANAGER_INTERFACES

#define             TP_PROP_CONNECTION_MANAGER_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.ConnectionManager.Interfaces"


TP_PROP_CONNECTION_MANAGER_PROTOCOLS

#define             TP_PROP_CONNECTION_MANAGER_PROTOCOLS

The fully-qualified property name "org.freedesktop.Telepathy.ConnectionManager.Protocols"


TP_PROP_CONNECTION_INTERFACES

#define             TP_PROP_CONNECTION_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Interfaces"


TP_PROP_CONNECTION_SELF_HANDLE

#define             TP_PROP_CONNECTION_SELF_HANDLE

The fully-qualified property name "org.freedesktop.Telepathy.Connection.SelfHandle"


TP_PROP_CONNECTION_SELF_ID

#define             TP_PROP_CONNECTION_SELF_ID

The fully-qualified property name "org.freedesktop.Telepathy.Connection.SelfID"


TP_PROP_CONNECTION_STATUS

#define             TP_PROP_CONNECTION_STATUS

The fully-qualified property name "org.freedesktop.Telepathy.Connection.Status"


TP_PROP_DEBUG_ENABLED

#define             TP_PROP_DEBUG_ENABLED

The fully-qualified property name "org.freedesktop.Telepathy.Debug.Enabled"


TP_PROP_MEDIA_STREAM_HANDLER_CREATED_LOCALLY

#define             TP_PROP_MEDIA_STREAM_HANDLER_CREATED_LOCALLY

The fully-qualified property name "org.freedesktop.Telepathy.Media.StreamHandler.CreatedLocally"


TP_PROP_MEDIA_STREAM_HANDLER_NAT_TRAVERSAL

#define             TP_PROP_MEDIA_STREAM_HANDLER_NAT_TRAVERSAL

The fully-qualified property name "org.freedesktop.Telepathy.Media.StreamHandler.NATTraversal"


TP_PROP_MEDIA_STREAM_HANDLER_RELAY_INFO

#define             TP_PROP_MEDIA_STREAM_HANDLER_RELAY_INFO

The fully-qualified property name "org.freedesktop.Telepathy.Media.StreamHandler.RelayInfo"


TP_PROP_MEDIA_STREAM_HANDLER_STUN_SERVERS

#define             TP_PROP_MEDIA_STREAM_HANDLER_STUN_SERVERS

The fully-qualified property name "org.freedesktop.Telepathy.Media.StreamHandler.STUNServers"


TP_PROP_PROTOCOL_AUTHENTICATION_TYPES

#define             TP_PROP_PROTOCOL_AUTHENTICATION_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.AuthenticationTypes"


TP_PROP_PROTOCOL_CONNECTION_INTERFACES

#define             TP_PROP_PROTOCOL_CONNECTION_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.ConnectionInterfaces"


TP_PROP_PROTOCOL_ENGLISH_NAME

#define             TP_PROP_PROTOCOL_ENGLISH_NAME

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.EnglishName"


TP_PROP_PROTOCOL_ICON

#define             TP_PROP_PROTOCOL_ICON

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Icon"


TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_URI_SCHEMES

#define             TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_URI_SCHEMES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Addressing.AddressableURISchemes"


TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS

#define             TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Addressing.AddressableVCardFields"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.MaximumAvatarBytes"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.MaximumAvatarHeight"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.MaximumAvatarWidth"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.MinimumAvatarHeight"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.MinimumAvatarWidth"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.RecommendedAvatarHeight"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.RecommendedAvatarWidth"


TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES

#define             TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Avatars.SupportedAvatarMIMETypes"


TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES

#define             TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interface.Presence.Statuses"


TP_PROP_PROTOCOL_INTERFACES

#define             TP_PROP_PROTOCOL_INTERFACES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Interfaces"


TP_PROP_PROTOCOL_PARAMETERS

#define             TP_PROP_PROTOCOL_PARAMETERS

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.Parameters"


TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES

#define             TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.RequestableChannelClasses"


TP_PROP_PROTOCOL_VCARD_FIELD

#define             TP_PROP_PROTOCOL_VCARD_FIELD

The fully-qualified property name "org.freedesktop.Telepathy.Protocol.VCardField"


TP_TOKEN_CONNECTION_CONTACT_ID

#define             TP_TOKEN_CONNECTION_CONTACT_ID

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection/contact-id"


TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_ADDRESSES

#define             TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_ADDRESSES

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Addressing1/addresses"


TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_URIS

#define             TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_URIS

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Addressing1/uris"


TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS

#define             TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Aliasing/alias"


TP_TOKEN_CONNECTION_INTERFACE_AVATARS_TOKEN

#define             TP_TOKEN_CONNECTION_INTERFACE_AVATARS_TOKEN

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Avatars/token"


TP_TOKEN_CONNECTION_INTERFACE_CAPABILITIES_CAPS

#define             TP_TOKEN_CONNECTION_INTERFACE_CAPABILITIES_CAPS

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Capabilities/caps"


TP_TOKEN_CONNECTION_INTERFACE_CLIENT_TYPES_CLIENT_TYPES

#define             TP_TOKEN_CONNECTION_INTERFACE_CLIENT_TYPES_CLIENT_TYPES

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ClientTypes/client-types"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactBlocking/blocked"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities/capabilities"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactGroups/groups"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_INFO_INFO

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_INFO_INFO

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactInfo/info"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactList/publish"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactList/publish-request"


TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE

#define             TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.ContactList/subscribe"


TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE

#define             TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.SimplePresence/presence"


TP_TOKEN_CONNECTION_INTERFACE_LOCATION_LOCATION

#define             TP_TOKEN_CONNECTION_INTERFACE_LOCATION_LOCATION

The fully-qualified contact attribute token name "org.freedesktop.Telepathy.Connection.Interface.Location/location"


TP_TOKEN_CHANNEL_TYPE_CALL_AUDIO

#define             TP_TOKEN_CHANNEL_TYPE_CALL_AUDIO

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/audio"


TP_TOKEN_CHANNEL_TYPE_CALL_GTALK_P2P

#define             TP_TOKEN_CHANNEL_TYPE_CALL_GTALK_P2P

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/gtalk-p2p"


TP_TOKEN_CHANNEL_TYPE_CALL_ICE

#define             TP_TOKEN_CHANNEL_TYPE_CALL_ICE

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/ice"


TP_TOKEN_CHANNEL_TYPE_CALL_SHM

#define             TP_TOKEN_CHANNEL_TYPE_CALL_SHM

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/shm"


TP_TOKEN_CHANNEL_TYPE_CALL_VIDEO

#define             TP_TOKEN_CHANNEL_TYPE_CALL_VIDEO

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/video"


TP_TOKEN_CHANNEL_TYPE_CALL_WLM_2009

#define             TP_TOKEN_CHANNEL_TYPE_CALL_WLM_2009

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Type.Call1/wlm-2009"


TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_GTALK_P2P

#define             TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_GTALK_P2P

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p"


TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP

#define             TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp"


TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_8_5

#define             TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_8_5

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/wlm-8.5"


TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_2009

#define             TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_2009

The fully-qualified capability token name "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/wlm-2009"

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-stream-tube-connection.html0000644000175000017500000004624714006623344025466 00000000000000 TpStreamTubeConnection: telepathy-glib API Reference Manual

TpStreamTubeConnection

TpStreamTubeConnection — a connection on a Stream Tube

Properties

TpStreamTubeChannel * channel Read / Write / Construct Only
TpContact * contact Read / Write / Construct Only
GSocketConnection * socket-connection Read / Write / Construct Only

Signals

void closed Run Last

Object Hierarchy

    GObject
    ╰── TpStreamTubeConnection

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Object used to represent a connection on a TpStreamTubeChannel.

Functions

tp_stream_tube_connection_get_channel ()

TpStreamTubeChannel *
tp_stream_tube_connection_get_channel (TpStreamTubeConnection *self);

Return the “channel” property

Parameters

Returns

the value of “channel”.

[transfer none]

Since: 0.13.2


tp_stream_tube_connection_get_contact ()

TpContact *
tp_stream_tube_connection_get_contact (TpStreamTubeConnection *self);

Return the “contact” property

Parameters

Returns

the value of “contact”.

[transfer none]

Since: 0.13.2


tp_stream_tube_connection_get_socket_connection ()

GSocketConnection *
tp_stream_tube_connection_get_socket_connection
                               (TpStreamTubeConnection *self);

Return the “socket-connection” property

Parameters

Returns

the value of “socket-connection”.

[transfer none]

Since: 0.13.2

Types and Values

TpStreamTubeConnection

typedef struct _TpStreamTubeConnection TpStreamTubeConnection;

Data structure representing a connection on a TpStreamTubeChannel.

Since: 0.13.2


TpStreamTubeConnectionClass

typedef struct _TpStreamTubeConnectionClass TpStreamTubeConnectionClass;

The class of a TpStreamTubeConnection.

Since: 0.13.2

Property Details

The “channel” property

  “channel”                  TpStreamTubeChannel *

The TpStreamTubeChannel channel associated with this connection

This property can't be NULL.

Owner: TpStreamTubeConnection

Flags: Read / Write / Construct Only

Since: 0.13.2


The “contact” property

  “contact”                  TpContact *

The TpContact with who we are exchanging data through this tube, or NULL if we can't safely identify the contact.

If not NULL, the TpContact objects is guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Owner: TpStreamTubeConnection

Flags: Read / Write / Construct Only

Since: 0.13.2


The “socket-connection” property

  “socket-connection”        GSocketConnection *

The GSocketConnection used to transfer data through this connection. Read-only except during construction.

This property can't be NULL.

Owner: TpStreamTubeConnection

Flags: Read / Write / Construct Only

Since: 0.13.2

Signal Details

The “closed” signal

void
user_function (TpStreamTubeConnection *self,
               GError                 *error,
               gpointer                user_data)

The ::closed signal is emitted when the connection manager reports that a tube connection has been closed.

Parameters

self

the TpStreamTubeConnection

 

error

a GError representing the error reported by the connection manager.

[transfer none]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.2

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-dtmf.html0000644000175000017500000005531714006623344022031 00000000000000 DTMF dialstring interpreter: telepathy-glib API Reference Manual

DTMF dialstring interpreter

DTMF dialstring interpreter — Converts a dialstring into a timed sequence of events

Signals

void finished Run Last
void started-tone Run Last
void stopped-tone Run Last
void tones-deferred Run Last

Types and Values

struct TpDTMFPlayer

Object Hierarchy

    GObject
    ╰── TpDTMFPlayer

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Telepathy offers two APIs for DTMF events: user interfaces can either call the StartTone and StopTone methods (appropriate if the user is pressing hardware or on-screen buttons in real time), or call MultipleTones or set InitialTones (appropriate if a stored dialstring is in use).

TpDTMFPlayer provides common code for connection managers that need to turn MultipleTones or InitialTones received from a UI into a sequence of start and stop events for the underlying protocol.

Functions

tp_dtmf_player_new ()

TpDTMFPlayer *
tp_dtmf_player_new (void);

Returns

a new DTMF interpreter.

[transfer full]

Since: 0.13.3


tp_dtmf_player_play ()

gboolean
tp_dtmf_player_play (TpDTMFPlayer *self,
                     const gchar *tones,
                     guint tone_ms,
                     guint gap_ms,
                     guint pause_ms,
                     GError **error);

Start to play a sequence of tones, by emitting the “started-tone” and “stopped-tone” signals.

If tp_dtmf_player_is_active() would return TRUE, this method raises TP_ERROR_SERVICE_BUSY and does not play anything, and the previous sequence continues to play.

The recognised characters are 0-9, A-D,

and * (which play the corresponding DTMF event), P, X and comma (which

each pause for pause_ms milliseconds), and W (which stops interpretation of the string and emits “tones-deferred” with the rest of the string). The corresponding lower-case letters are also allowed. If tones contains any other characters, this method raises TP_ERROR_INVALID_ARGUMENT and does not play anything.

Parameters

self

a DTMF interpreter

 

tones

a sequence of tones or other events

 

tone_ms

length of a tone (0-9, A-D, # or *) in milliseconds, which must be positive; typically 250

 

gap_ms

length of the gap between two tones, which must be positive; typically 100

 

pause_ms

length of the pause produced by P, X or comma, which must be positive; typically 3000

 

error

used to raise an error

 

Returns

TRUE on success, FALSE (setting error ) on failure

Since: 0.13.3


tp_dtmf_player_cancel ()

void
tp_dtmf_player_cancel (TpDTMFPlayer *self);

If tones were being played, stop the current tone (if any), stop playing subsequent tones, and emit “finished”.

Otherwise, do nothing.

Parameters

self

a DTMF interpreter

 

Since: 0.13.3


tp_dtmf_player_is_active ()

gboolean
tp_dtmf_player_is_active (TpDTMFPlayer *self);

Parameters

self

a DTMF interpreter

 

Returns

TRUE if a sequence of tones is currently playing

Since: 0.13.3

Types and Values

struct TpDTMFPlayer

struct TpDTMFPlayer;

An object to convert a string of characters representing DTMF tones into timed start and stop events.

Typically, a connection manager should instantiate one TpDTMFPlayer for each StreamedMedia or Call channel that supports DTMF.

The “started-tone” and “stopped-tone” signals should be connected to some way to play a tone, either directly or by emitting signals from the StreamHandler interface.

The “tones-deferred” signal should trigger emission of TonesDeferred.

The “finished” signal indicates that the current sequence of tones has finished.

Since: 0.13.3

Signal Details

The “finished” signal

void
user_function (TpDTMFPlayer *self,
               gboolean      cancelled,
               gpointer      user_data)

Emitted when playback stops, either because the end of the sequence was reached, tp_dtmf_player_cancel() was called, or a 'W' or 'w' character was encountered.

Parameters

self

the TpDTMFPlayer

 

cancelled

TRUE if playback was cancelled with tp_dtmf_player_cancel()

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.3


The “started-tone” signal

void
user_function (TpDTMFPlayer *self,
               guint         event,
               gpointer      user_data)

Emitted at the beginning of each tone.

Parameters

self

the TpDTMFPlayer

 

event

a G_TYPE_UINT representing the tone being played

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “stopped-tone” signal

void
user_function (TpDTMFPlayer *self,
               gpointer      user_data)

Emitted at the end of each tone.

Parameters

self

the TpDTMFPlayer

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.3


The “tones-deferred” signal

void
user_function (TpDTMFPlayer *self,
               gchar        *tones,
               gpointer      user_data)

Emitted just before “finished” if a 'W' or 'w' character is encountered before the end of a dial string. The connection manager is expected to wait for the user to confirm, then call tp_dtmf_player_play() again, using this signal's argument as the new dial string.

Parameters

self

the TpDTMFPlayer

 

tones

the remaining tones, starting from just after the 'W' or 'w'

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.3

telepathy-glib-0.24.2/docs/reference/html/right-insensitive.png0000644000175000017500000000056514006623343021454 00000000000000PNG  IHDRabKGD pHYs B(xtIME ^IDAT8͒J` /S_$AqrW(>m"]\(49.Nd39{eM#MSIιEiHz|3{̲l3,KkV'@EEQlwyiq]Kh4:mĦ,;ts\aR5/7'Wps׭I,K1=0j0Wg> PU𻤝0 ]?qCҫιg~kA_IENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-client-types.html0000644000175000017500000007324014006623344025647 00000000000000 Connection ClientTypes interface: telepathy-glib API Reference Manual

Connection ClientTypes interface

Connection ClientTypes interface — client-side wrappers for the ClientTypes interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

On some protocols it's possible to determine the type of client another user is using, ranging from a simple "phone or not?" indicator to a classification into several types of user interface. Telepathy represents these using the client types defined by XMPP.

This section documents the auto-generated C wrappers for the ClientTypes interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_client_types_call_get_client_types ()

TpProxyPendingCall *
tp_cli_connection_interface_client_types_call_get_client_types
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_client_types_callback_for_get_client_types callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetClientTypes method call.

Return the client types of the given contacts, if they are already known. If any of the given contacts' client types are not known, request their current client types, but return immediately without waiting for a reply; if a reply with a non-empty client type array is later received for those contacts, the <tp:member-ref>ClientTypesUpdated</tp:member-ref> signal will be emitted for them. <tp:rationale> This method is appropriate for &quot;lazy&quot; client type finding, for instance displaying the client types (if available) of everyone in your contact list. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: The contacts whose client types should be returned or signalled.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_client_types_call_request_client_types ()

TpProxyPendingCall *
tp_cli_connection_interface_client_types_call_request_client_types
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                tp_cli_connection_interface_client_types_callback_for_request_client_types callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestClientTypes method call.

Return the current client types of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply. <tp:rationale> This method is appropriate for use in a &quot;Contact Information...&quot; dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: The contact whose client types should be returned. (TpContactHandle)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_client_types_callback_for_get_client_types ()

void
(*tp_cli_connection_interface_client_types_callback_for_get_client_types)
                               (TpConnection *proxy,
                                GHashTable *out_Client_Types,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetClientTypes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Client_Types

Used to return an 'out' argument if error is NULL: The contacts' client types, if already known. Contacts whose client types are not already known are omitted from the mapping; contacts known to have no client type information appear in the mapping with an empty list.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_client_types_callback_for_request_client_types ()

void
(*tp_cli_connection_interface_client_types_callback_for_request_client_types)
                               (TpConnection *proxy,
                                const gchar **out_Client_Types,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestClientTypes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Client_Types

Used to return an 'out' argument if error is NULL: The contact's client types. It MAY be empty, indicating that no client type information was found.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_client_types_connect_to_client_types_updated ()

TpProxySignalConnection *
tp_cli_connection_interface_client_types_connect_to_client_types_updated
                               (TpConnection *proxy,
                                tp_cli_connection_interface_client_types_signal_callback_client_types_updated callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ClientTypesUpdated.

Emitted when a contact's client types change or become known.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_client_types_signal_callback_client_types_updated ()

void
(*tp_cli_connection_interface_client_types_signal_callback_client_types_updated)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                const gchar **arg_Client_Types,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ClientTypesUpdated.

Parameters

proxy

The proxy on which tp_cli_connection_interface_client_types_connect_to_client_types_updated() was called

 

arg_Contact

The contact. (TpContactHandle)

 

arg_Client_Types

The contact's client types, or an empty list to indicate that nothing is known about the contact's client types.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/TpBaseRoomConfig.html0000644000175000017500000015113414006623343021321 00000000000000 TpBaseRoomConfig: telepathy-glib API Reference Manual

TpBaseRoomConfig

TpBaseRoomConfig — implements the RoomConfig interface for chat rooms.

Properties

gboolean anonymous Read / Write
gboolean can-update-configuration Read / Write
TpBaseChannel * channel Read / Write / Construct Only
gboolean configuration-retrieved Read
gchar * description Read / Write
gboolean invite-only Read / Write
guint limit Read / Write
gboolean moderated Read / Write
GStrv mutable-properties Read
gchar * password Read / Write
gchar * password-hint Read / Write
gboolean password-protected Read / Write
gboolean persistent Read / Write
gboolean private Read / Write
gchar * title Read / Write

Object Hierarchy

    GEnum
    ╰── TpBaseRoomConfigProperty
    GObject
    ╰── TpBaseRoomConfig

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class implements the TpSvcChannelInterfaceRoomConfig interface on multi-user chat room channels. CMs are expected to subclass this base class to implement the protocol-specific details of changing room configuration. Then, in the connection manager's subclass of TpBaseChannel for multi-user chats:

If this protocol supports modifying some aspects of the room's configuration, the subclass should call tp_base_room_config_set_property_mutable() to mark appropriate properties as potentially-modifiable, call tp_base_room_config_set_can_update_configuration() to indicate whether the local user has permission to modify those properties at present, and implement TpBaseRoomConfigClass.update_async. When updates to properties are received from the network, they should be updated on this object using g_object_set():

1
2
3
4
5
g_object_self (room_config,
   "description", "A place to bury strangers",
   "private", TRUE,
   NULL);
tp_base_room_config_emit_properties_changed (room_config);

On joining the room, once the entire room configuration has been retrieved from the network, the CM should call tp_base_room_config_set_retrieved().

Functions

TpBaseRoomConfigUpdateAsync ()

void
(*TpBaseRoomConfigUpdateAsync) (TpBaseRoomConfig *self,
                                GHashTable *validated_properties,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Signature for a function to begin a network request to update the room configuration. It is guaranteed that validated_properties will only contain properties which were marked as mutable when the D-Bus method invocation arrived.

Note that TpBaseRoomConfig will take care of applying the property updates to itself if the operation succeeds.

Parameters

self

a TpBaseRoomConfig

 

validated_properties

a mapping from TpBaseRoomConfigProperty to GValue, whose types have already been validated. The function should not modify this hash table.

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

TpBaseRoomConfigUpdateFinish ()

gboolean
(*TpBaseRoomConfigUpdateFinish) (TpBaseRoomConfig *self,
                                 GAsyncResult *result,
                                 GError **error);

Signature for a function to complete a call to a corresponding implementation of TpBaseRoomConfigUpdateAsync.

Parameters

self

a TpBaseRoomConfig

 

result

the result passed to the callback

 

error

used to return an error if FALSE is returned.

 

Returns

TRUE if the room configuration update was accepted by the server; FALSE, with error set, otherwise.


tp_base_room_config_register_class ()

void
tp_base_room_config_register_class (TpBaseChannelClass *base_channel_class);

Registers that D-Bus properties for the RoomConfig1 interface should be handled by a TpBaseRoomConfig object associated with instances of base_channel_class .

base_channel_class must implement TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG using tp_base_room_config_iface_init(), and instances of base_channel_class must construct an instance of TpBaseRoomConfig, passing themself as “channel”.

Parameters

base_channel_class

the class structure for a subclass of TpBaseChannel which uses this object to implement TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG

 

tp_base_room_config_iface_init ()

void
tp_base_room_config_iface_init (gpointer g_iface,
                                gpointer iface_data);

Pass this as the second argument to G_IMPLEMENT_INTERFACE() when defining a TpBaseChannel subclass to declare that TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG is implemented using this class. The TpBaseChannel subclass must also call tp_base_room_config_register_class() in its class_init function, and construct a TpBaseRoomConfig object for each instance.

Parameters

g_iface

a pointer to a TpSvcChannelInterfaceRoomConfigClass structure

 

iface_data

ignored

 

tp_base_room_config_dup_channel ()

TpBaseChannel *
tp_base_room_config_dup_channel (TpBaseRoomConfig *self);

Returns the channel to which self is attached.

Parameters

self

a TpBaseChannel

 

Returns

the “channel” property.

[transfer full]


tp_base_room_config_set_can_update_configuration ()

void
tp_base_room_config_set_can_update_configuration
                               (TpBaseRoomConfig *self,
                                gboolean can_update_configuration);

Specify whether or not the local user currently has permission to modify the room configuration.

Changes made by calling this function are not signalled over D-Bus until tp_base_room_config_emit_properties_changed() is next called.

Parameters

self

a TpBaseRoomConfig object.

 

can_update_configuration

TRUE if the local user has permission to modify properties marked as mutable.

 

tp_base_room_config_set_property_mutable ()

void
tp_base_room_config_set_property_mutable
                               (TpBaseRoomConfig *self,
                                TpBaseRoomConfigProperty property_id,
                                gboolean is_mutable);

Specify whether it is possible for room members to modify the value of property_id (possibly dependent on them having channel-operator powers), or whether property_id 's value is an intrinsic fact about the protocol.

For example, on IRC it is impossible to configure a channel to hide the identities of participants from others, so TP_BASE_ROOM_CONFIG_ANONYMOUS should be marked as immutable on IRC; whereas channel operators can mark rooms as invite-only, so TP_BASE_ROOM_CONFIG_INVITE_ONLY should be marked as mutable on IRC.

By default, all properties are considered immutable.

Call tp_base_room_config_set_can_update_configuration() to specify whether or not it is currently possible for the local user to alter properties marked as mutable.

Changes made by calling this function are not signalled over D-Bus until tp_base_room_config_emit_properties_changed() is next called.

Parameters

self

a TpBaseRoomConfig object.

 

property_id

a property identifier (not including TP_NUM_BASE_ROOM_CONFIG_PROPERTIES)

 

is_mutable

TRUE if it is possible for Telepathy clients to modify

 

property_id when #TpBaseRoomConfig

can-update-configuration is TRUE.

 

tp_base_room_config_emit_properties_changed ()

void
tp_base_room_config_emit_properties_changed
                               (TpBaseRoomConfig *self);

Signal the new values of properties which have been modified since the last call to this method, if any. This includes changes made by calling tp_base_room_config_set_can_update_configuration() and tp_base_room_config_set_property_mutable(), as well as changes to any of the (writeable) GObject properties on this object.

Parameters

self

a TpBaseRoomConfig object.

 

tp_base_room_config_set_retrieved ()

void
tp_base_room_config_set_retrieved (TpBaseRoomConfig *self);

Signal that the room's configuration has been retrieved, as well as signalling any queued property changes. This function should be called once all properties have been set to meaningful values.

It is safe to call this function more than once; second and subsequent calls are equivalent to calling tp_base_room_config_emit_properties_changed().

Parameters

self

a TpBaseRoomConfig object

 

Types and Values

struct TpBaseRoomConfig

struct TpBaseRoomConfig;

An object representing the configuration of a multi-user chat room.

There are no public fields.


struct TpBaseRoomConfigClass

struct TpBaseRoomConfigClass {
    TpBaseRoomConfigUpdateAsync update_async;
    TpBaseRoomConfigUpdateFinish update_finish;
};

Class structure for TpBaseRoomConfig. By default, update_async is NULL, indicating that updating room configuration is not implemented; subclasses should override it if they wish to support updating room configuration.

Members

TpBaseRoomConfigUpdateAsync update_async;

begins a request to modify the room's configuration.

 

TpBaseRoomConfigUpdateFinish update_finish;

completes a call to update_async ; the default implementation may be used if update_async uses GSimpleAsyncResult

 

enum TpBaseRoomConfigProperty

An enumeration of room configuration fields, corresponding to GObject properties and, in turn, to D-Bus properties.

Members

TP_BASE_ROOM_CONFIG_ANONYMOUS

corresponds to “anonymous”

 

TP_BASE_ROOM_CONFIG_INVITE_ONLY

corresponds to “invite-only”

 

TP_BASE_ROOM_CONFIG_LIMIT

corresponds to “limit”

 

TP_BASE_ROOM_CONFIG_MODERATED

corresponds to “moderated”

 

TP_BASE_ROOM_CONFIG_TITLE

corresponds to “title”

 

TP_BASE_ROOM_CONFIG_DESCRIPTION

corresponds to “description”

 

TP_BASE_ROOM_CONFIG_PERSISTENT

corresponds to “persistent”

 

TP_BASE_ROOM_CONFIG_PRIVATE

corresponds to “private”

 

TP_BASE_ROOM_CONFIG_PASSWORD_PROTECTED

corresponds to “password-protected”

 

TP_BASE_ROOM_CONFIG_PASSWORD

corresponds to “password”

 

TP_BASE_ROOM_CONFIG_PASSWORD_HINT

corresponds to “password-hint”

 

TP_NUM_BASE_ROOM_CONFIG_PROPERTIES

the number of configuration properties currently defined.

 

TP_TYPE_BASE_ROOM_CONFIG_PROPERTY

#define TP_TYPE_BASE_ROOM_CONFIG_PROPERTY (tp_base_room_config_property_get_type ())

The GEnumClass type of TpBaseRoomConfigProperty. (The nicknames are chosen to correspond to unqualified D-Bus property names.)

Property Details

The “anonymous” property

  “anonymous”                gboolean

True if people may join the channel without other members being made aware of their identity.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “can-update-configuration” property

  “can-update-configuration” gboolean

If True, the user may call UpdateConfiguration to change the values of the properties listed in MutableProperties.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “channel” property

  “channel”                  TpBaseChannel *

Parent TpBaseChannel.

Owner: TpBaseRoomConfig

Flags: Read / Write / Construct Only


The “configuration-retrieved” property

  “configuration-retrieved”  gboolean

Becomes True once the room config has been fetched from the network.

Owner: TpBaseRoomConfig

Flags: Read

Default value: FALSE


The “description” property

  “description”              gchar *

A human-readable description of the channel's overall purpose; if any.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: ""


The “invite-only” property

  “invite-only”              gboolean

True if people may not join the channel until they have been invited.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “limit” property

  “limit”                    guint

The limit to the number of members; or 0 if there is no limit.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: 0


The “moderated” property

  “moderated”                gboolean

True if channel membership is not sufficient to allow participation.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “mutable-properties” property

  “mutable-properties”       GStrv

A list of (unqualified) property names on this interface which may be modified using UpdateConfiguration (if CanUpdateConfiguration is True). Properties not listed here cannot be modified.

Owner: TpBaseRoomConfig

Flags: Read


The “password” property

  “password”                 gchar *

If PasswordProtected is True, the password required to enter the channel, if known. If the password is unknown, or PasswordProtected is False, the empty string.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: ""


The “password-hint” property

  “password-hint”            gchar *

If PasswordProtected is True, a hint for the password. If the passwordpassword is unknown, or PasswordProtected is False, the empty string.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: ""


The “password-protected” property

  “password-protected”       gboolean

True if contacts joining this channel must provide a password to be granted entry.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “persistent” property

  “persistent”               gboolean

True if the channel will remain in existence on the server after all members have left it.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “private” property

  “private”                  gboolean

True if the channel is not visible to non-members.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: FALSE


The “title” property

  “title”                    gchar *

A human-visible name for the channel, if it differs from Room.DRAFT.RoomName; the empty string, otherwise.

Owner: TpBaseRoomConfig

Flags: Read / Write

Default value: ""

telepathy-glib-0.24.2/docs/reference/html/ch-service-base.html0000644000175000017500000002163014006623343021115 00000000000000 Service-side implementation: telepathy-glib API Reference Manual

Service-side implementation

Connection manager life cycle — entry point for telepathy-glib connection managers
TpBaseConnectionManager — base class for TpSvcConnectionManager implementations
TpBaseProtocol — base class for TpSvcProtocol implementations
TpBaseConnection — base class for TpSvcConnection implementations
TpChannelManager — interface for creating and tracking channels
TpBaseContactList — channel manager for ContactList channels
TpContactsMixin — a mixin implementation of the contacts connection interface
TpDBusPropertiesMixin — a mixin implementation of the DBus.Properties interface
TpExportableChannel — interface representing channels with several standard properties
TpBaseChannel — base class for TpExportableChannel implementations
TpPresenceMixin — a mixin implementation of the Presence connection interface
TpPropertiesMixin — a mixin implementation of the Telepathy.Properties interface
TpBaseRoomConfig — implements the RoomConfig interface for chat rooms.
TpGroupMixin — a mixin implementation of the groups interface
TpMessageMixin — a mixin implementation of the text channel type and the Messages interface
TpMessage — a message in the Telepathy message interface
TpCMMessage — a message in the Telepathy message interface, CM side
TpBasePasswordChannel — a simple X-TELEPATHY-PASSWORD channel
TpSimplePasswordManager — a simple X-TELEPATHY-PASSWORD channel manager
TpBaseClient — base class for Telepathy clients on D-Bus
TpObserveChannelsContext — context of a Observer.ObserveChannels() call
TpAddDispatchOperationContext — context of a Approver.AddDispatchOperation() call
TpHandleChannelsContext — context of a Handler.HandleChannels() call
TpSimpleObserver — a subclass of TpBaseClient implementing a simple Observer
TpSimpleApprover — a subclass of TpBaseClient implementing a simple Approver
TpSimpleHandler — a subclass of TpBaseClient implementing a simple Handler
DTMF dialstring interpreter — Converts a dialstring into a timed sequence of events
TpBaseCallChannel — base class for TpSvcChannelTypeCall implementations
TpBaseMediaCallChannel — base class for TpSvcChannelTypeCall RTP media implementations
TpBaseCallContent — base class for TpSvcCallContent implementations
TpBaseMediaCallContent — base class for TpSvcCallContentInterfaceMedia implementations
TpCallContentMediaDescription — implementation of TpSvcCallContentMediaDescription
TpBaseCallStream — base class for TpSvcCallStream implementations
TpBaseMediaCallStream — base class for TpSvcCallStreamInterfaceMedia implementations
TpCallStreamEndpoint — class for TpSvcCallStreamEndpoint implementations
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-presence.html0000644000175000017500000034247414006623344025043 00000000000000 Connection Presence interface: telepathy-glib API Reference Manual

Connection Presence interface

Connection Presence interface — client-side wrappers for the Presence interface

Functions

gboolean tp_cli_connection_interface_presence_run_add_status ()
gboolean tp_cli_connection_interface_presence_run_clear_status ()
gboolean tp_cli_connection_interface_presence_run_get_presence ()
gboolean tp_cli_connection_interface_presence_run_get_statuses ()
gboolean tp_cli_connection_interface_presence_run_remove_status ()
gboolean tp_cli_connection_interface_presence_run_request_presence ()
gboolean tp_cli_connection_interface_presence_run_set_last_activity_time ()
gboolean tp_cli_connection_interface_presence_run_set_status ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_add_status ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_clear_status ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_get_presence ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_get_statuses ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_remove_status ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_request_presence ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_set_last_activity_time ()
TpProxyPendingCall * tp_cli_connection_interface_presence_call_set_status ()
void (*tp_cli_connection_interface_presence_callback_for_add_status) ()
void (*tp_cli_connection_interface_presence_callback_for_clear_status) ()
void (*tp_cli_connection_interface_presence_callback_for_get_presence) ()
void (*tp_cli_connection_interface_presence_callback_for_get_statuses) ()
void (*tp_cli_connection_interface_presence_callback_for_remove_status) ()
void (*tp_cli_connection_interface_presence_callback_for_request_presence) ()
void (*tp_cli_connection_interface_presence_callback_for_set_last_activity_time) ()
void (*tp_cli_connection_interface_presence_callback_for_set_status) ()
TpProxySignalConnection * tp_cli_connection_interface_presence_connect_to_presence_update ()
void (*tp_cli_connection_interface_presence_signal_callback_presence_update) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Most instant messaging protocols allow users to advertise their presence status. In Telepathy, this is represented by the Presence interface, which lets applications advertise the presence status of the local user, and query the presence status of their contacts.

This section documents the auto-generated C wrappers for the Presence interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_presence_run_add_status ()

gboolean
tp_cli_connection_interface_presence_run_add_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                GHashTable *in_Parameters,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_add_status is deprecated and should not be used in newly-written code.

Call the method AddStatus and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that a single presence status is published for the user, along with any desired parameters. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Status

Used to pass an 'in' argument: The string identifier of the desired status

 

in_Parameters

Used to pass an 'in' argument: A dictionary of optional parameter names mapped to their variant-boxed values

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_clear_status ()

gboolean
tp_cli_connection_interface_presence_run_clear_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_clear_status is deprecated and should not be used in newly-written code.

Call the method ClearStatus and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that all of a user's presence statuses be removed. Be aware that this request may simply result in the statuses being replaced by a default available status. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_get_presence ()

gboolean
tp_cli_connection_interface_presence_run_get_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GHashTable **out_Presence,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_get_presence is deprecated and should not be used in newly-written code.

Call the method GetPresence and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get presence previously emitted by <tp:member-ref>PresenceUpdate</tp:member-ref> for the given contacts. Data is returned in the same structure as the PresenceUpdate signal. Using this method in favour of <tp:member-ref>RequestPresence</tp:member-ref> has the advantage that it will not wake up each client connected to the PresenceUpdate signal.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained

 

out_Presence

Used to return an 'out' argument if TRUE is returned: Presence information in the same format as for the <tp:member-ref>PresenceUpdate</tp:member-ref> signal

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_get_statuses ()

gboolean
tp_cli_connection_interface_presence_run_get_statuses
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable **out_Available_Statuses,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_get_statuses is deprecated and should not be used in newly-written code.

Call the method GetStatuses and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get a dictionary of the valid presence statuses for this connection. This is only available when online because only some statuses will be available on some servers.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Available_Statuses

Used to return an 'out' argument if TRUE is returned: A dictionary of string identifiers mapped to a struct for each status, containing: <ul> <li>a type value from one of the values above</li> <li>a boolean to indicate if this status may be set on yourself</li> <li>a boolean to indicate if this is an exclusive status which you may not set alongside any other</li> <li>a dictionary of valid optional string argument names mapped to their types</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_remove_status ()

gboolean
tp_cli_connection_interface_presence_run_remove_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_remove_status is deprecated and should not be used in newly-written code.

Call the method RemoveStatus and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that the given presence status is no longer published for the user. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted. As with <tp:member-ref>ClearStatus</tp:member-ref>, removing a status may actually result in it being replaced by a default available status.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Status

Used to pass an 'in' argument: The string identifier of the status not to publish anymore for the user

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_request_presence ()

gboolean
tp_cli_connection_interface_presence_run_request_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_request_presence is deprecated and should not be used in newly-written code.

Call the method RequestPresence and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the presence for contacts on this connection. A <tp:member-ref>PresenceUpdate</tp:member-ref> signal will be emitted when they are received. This is not the same as subscribing to the presence of a contact, which must be done using the 'subscription' <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">ContactList</tp:dbus-ref>, and on some protocols presence information may not be available unless a subscription exists.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_set_last_activity_time ()

gboolean
tp_cli_connection_interface_presence_run_set_last_activity_time
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Time,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_set_last_activity_time is deprecated and should not be used in newly-written code.

Call the method SetLastActivityTime and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that the recorded last activity time for the user be updated on the server.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Time

Used to pass an 'in' argument: A UNIX timestamp of the user's last activity time (in UTC) (TpUnixTimestamp)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_run_set_status ()

gboolean
tp_cli_connection_interface_presence_run_set_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Statuses,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_presence_run_set_status is deprecated and should not be used in newly-written code.

Call the method SetStatus and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the user's presence be changed to the given statuses and desired parameters. Changes will be reflected by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.</p> <p>Statuses whose <tp:type>Connection_Presence_Type</tp:type> is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.</p> <tp:rationale> <p>The same rationale as for <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">SimplePresence.SetPresence</tp:dbus-ref> applies.</p> </tp:rationale> <p>On certain protocols, this method may be called on a newly-created connection which is still in the DISCONNECTED state, and will sign on with the requested status. If the requested status is not available after signing on, NotAvailable will be returned and the connection will remain offline, or if the protocol does not support signing on with a certain status, Disconnected will be returned.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Statuses

Used to pass an 'in' argument: A dictionary mapping status identifiers to dictionaries, which map optional parameter names to their variant-boxed values

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_presence_call_add_status ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_add_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                GHashTable *in_Parameters,
                                tp_cli_connection_interface_presence_callback_for_add_status callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddStatus method call.

Request that a single presence status is published for the user, along with any desired parameters. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Status

Used to pass an 'in' argument: The string identifier of the desired status

 

in_Parameters

Used to pass an 'in' argument: A dictionary of optional parameter names mapped to their variant-boxed values

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_clear_status ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_clear_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_presence_callback_for_clear_status callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ClearStatus method call.

Request that all of a user's presence statuses be removed. Be aware that this request may simply result in the statuses being replaced by a default available status. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_get_presence ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_get_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_presence_callback_for_get_presence callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetPresence method call.

Get presence previously emitted by <tp:member-ref>PresenceUpdate</tp:member-ref> for the given contacts. Data is returned in the same structure as the PresenceUpdate signal. Using this method in favour of <tp:member-ref>RequestPresence</tp:member-ref> has the advantage that it will not wake up each client connected to the PresenceUpdate signal.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_get_statuses ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_get_statuses
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_presence_callback_for_get_statuses callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetStatuses method call.

Get a dictionary of the valid presence statuses for this connection. This is only available when online because only some statuses will be available on some servers.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_remove_status ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_remove_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                tp_cli_connection_interface_presence_callback_for_remove_status callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveStatus method call.

Request that the given presence status is no longer published for the user. Changes will be indicated by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted. As with <tp:member-ref>ClearStatus</tp:member-ref>, removing a status may actually result in it being replaced by a default available status.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Status

Used to pass an 'in' argument: The string identifier of the status not to publish anymore for the user

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_request_presence ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_request_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_presence_callback_for_request_presence callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestPresence method call.

Request the presence for contacts on this connection. A <tp:member-ref>PresenceUpdate</tp:member-ref> signal will be emitted when they are received. This is not the same as subscribing to the presence of a contact, which must be done using the 'subscription' <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">ContactList</tp:dbus-ref>, and on some protocols presence information may not be available unless a subscription exists.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_set_last_activity_time ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_set_last_activity_time
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Time,
                                tp_cli_connection_interface_presence_callback_for_set_last_activity_time callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetLastActivityTime method call.

Request that the recorded last activity time for the user be updated on the server.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Time

Used to pass an 'in' argument: A UNIX timestamp of the user's last activity time (in UTC) (TpUnixTimestamp)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_call_set_status ()

TpProxyPendingCall *
tp_cli_connection_interface_presence_call_set_status
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Statuses,
                                tp_cli_connection_interface_presence_callback_for_set_status callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetStatus method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the user's presence be changed to the given statuses and desired parameters. Changes will be reflected by <tp:member-ref>PresenceUpdate</tp:member-ref> signals being emitted.</p> <p>Statuses whose <tp:type>Connection_Presence_Type</tp:type> is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.</p> <tp:rationale> <p>The same rationale as for <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">SimplePresence.SetPresence</tp:dbus-ref> applies.</p> </tp:rationale> <p>On certain protocols, this method may be called on a newly-created connection which is still in the DISCONNECTED state, and will sign on with the requested status. If the requested status is not available after signing on, NotAvailable will be returned and the connection will remain offline, or if the protocol does not support signing on with a certain status, Disconnected will be returned.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Statuses

Used to pass an 'in' argument: A dictionary mapping status identifiers to dictionaries, which map optional parameter names to their variant-boxed values

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_presence_callback_for_add_status ()

void
(*tp_cli_connection_interface_presence_callback_for_add_status)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddStatus method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_clear_status ()

void
(*tp_cli_connection_interface_presence_callback_for_clear_status)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ClearStatus method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_get_presence ()

void
(*tp_cli_connection_interface_presence_callback_for_get_presence)
                               (TpConnection *proxy,
                                GHashTable *out_Presence,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetPresence method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Presence

Used to return an 'out' argument if error is NULL: Presence information in the same format as for the <tp:member-ref>PresenceUpdate</tp:member-ref> signal

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_get_statuses ()

void
(*tp_cli_connection_interface_presence_callback_for_get_statuses)
                               (TpConnection *proxy,
                                GHashTable *out_Available_Statuses,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetStatuses method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Available_Statuses

Used to return an 'out' argument if error is NULL: A dictionary of string identifiers mapped to a struct for each status, containing: <ul> <li>a type value from one of the values above</li> <li>a boolean to indicate if this status may be set on yourself</li> <li>a boolean to indicate if this is an exclusive status which you may not set alongside any other</li> <li>a dictionary of valid optional string argument names mapped to their types</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_remove_status ()

void
(*tp_cli_connection_interface_presence_callback_for_remove_status)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveStatus method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_request_presence ()

void
(*tp_cli_connection_interface_presence_callback_for_request_presence)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestPresence method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_set_last_activity_time ()

void
(*tp_cli_connection_interface_presence_callback_for_set_last_activity_time)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetLastActivityTime method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_callback_for_set_status ()

void
(*tp_cli_connection_interface_presence_callback_for_set_status)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetStatus method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_presence_connect_to_presence_update ()

TpProxySignalConnection *
tp_cli_connection_interface_presence_connect_to_presence_update
                               (TpConnection *proxy,
                                tp_cli_connection_interface_presence_signal_callback_presence_update callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PresenceUpdate.

This signal should be emitted when your own presence has been changed, or the presence of the member of any of the connection's channels has been changed, or when the presence requested by <tp:member-ref>RequestPresence</tp:member-ref> is available.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_presence_signal_callback_presence_update ()

void
(*tp_cli_connection_interface_presence_signal_callback_presence_update)
                               (TpConnection *proxy,
                                GHashTable *arg_Presence,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PresenceUpdate.

Parameters

proxy

The proxy on which tp_cli_connection_interface_presence_connect_to_presence_update() was called

 

arg_Presence

A dictionary of contact handles mapped to a struct containing a UNIX timestamp of the last activity time (in UTC), and a dictionary mapping the contact's current status identifiers to a dictionary of optional parameter names mapped to their variant-boxed values

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-asv.html0000644000175000017500000026444114006623343021667 00000000000000 Manipulating a{sv} mappings: telepathy-glib API Reference Manual

Manipulating a{sv} mappings

Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in dbus-glib by a GHashTable from string to GValue

Functions

#define tp_asv_size()
GHashTable * tp_asv_new ()
gboolean tp_asv_get_boolean ()
void tp_asv_set_boolean ()
gpointer tp_asv_get_boxed ()
void tp_asv_set_boxed ()
void tp_asv_take_boxed ()
void tp_asv_set_static_boxed ()
const GArray * tp_asv_get_bytes ()
void tp_asv_set_bytes ()
void tp_asv_take_bytes ()
gdouble tp_asv_get_double ()
void tp_asv_set_double ()
gint32 tp_asv_get_int32 ()
void tp_asv_set_int32 ()
gint64 tp_asv_get_int64 ()
void tp_asv_set_int64 ()
const gchar * tp_asv_get_object_path ()
void tp_asv_set_object_path ()
void tp_asv_take_object_path ()
void tp_asv_set_static_object_path ()
const gchar * tp_asv_get_string ()
void tp_asv_set_string ()
void tp_asv_take_string ()
void tp_asv_set_static_string ()
const gchar * const * tp_asv_get_strv ()
void tp_asv_set_strv ()
guint32 tp_asv_get_uint32 ()
void tp_asv_set_uint32 ()
guint64 tp_asv_get_uint64 ()
void tp_asv_set_uint64 ()
const GValue * tp_asv_lookup ()
void tp_asv_dump ()

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Mappings from string to variant (D-Bus signature a{sv}) are commonly used to provide extensibility, but in dbus-glib they're somewhat awkward to deal with.

These functions provide convenient access to the values in such a mapping.

They also work around the fact that none of the GHashTable public API takes a const pointer to a GHashTable, even the read-only methods that logically ought to.

Parts of telepathy-glib return const pointers to GHashTable, to encourage the use of this API.

Functions

tp_asv_size()

#define tp_asv_size(asv) _tp_asv_size_inline (asv)

Return the size of asv as if via g_hash_table_size().

The only difference is that this version takes a const GHashTable and casts it.

Parameters

asv

a GHashTable

 

Since: 0.7.12


tp_asv_new ()

GHashTable *
tp_asv_new (const gchar *first_key,
            ...);

Creates a new GHashTable for use with a{sv} maps, containing the values passed in as parameters.

The GHashTable is synonymous with:

1
2
GHashTable *asv = g_hash_table_new_full (g_str_hash, g_str_equal,
   NULL, (GDestroyNotify) tp_g_value_slice_free);

Followed by manual insertion of each of the parameters.

Parameters are stored in slice-allocated GValues and should be set using tp_asv_set_*() and retrieved using tp_asv_get_*().

tp_g_value_slice_new() and tp_g_value_slice_dup() may also be used to insert into the map if required.

1
2
g_hash_table_insert (parameters, "account",
   tp_g_value_slice_new_string ("bob@mcbadgers.com"));

Example 1. Using tp_asv_new()

1
2
3
4
GHashTable *parameters = tp_asv_new (
   "answer", G_TYPE_INT, 42,
   "question", G_TYPE_STRING, "We just don't know",
   NULL);

Allocated values will be automatically free'd when overwritten, removed or the hash table destroyed with g_hash_table_unref().

[skip]

Parameters

first_key

the name of the first key (or NULL)

 

...

type and value for the first key, followed by a NULL-terminated list of (key, type, value) tuples

 

Returns

a newly created GHashTable for storing a{sv} maps, free with g_hash_table_unref().

Since: 0.7.29


tp_asv_get_boolean ()

gboolean
tp_asv_get_boolean (const GHashTable *asv,
                    const gchar *key,
                    gboolean *valid);

If a value for key in asv is present and boolean, return it, and set *valid to TRUE if valid is not NULL.

Otherwise return FALSE, and set *valid to FALSE if valid is not NULL.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location to store TRUE if the key actually exists and has a boolean value.

[out]

Returns

a boolean value for key

Since: 0.7.9


tp_asv_set_boolean ()

void
tp_asv_set_boolean (GHashTable *asv,
                    const gchar *key,
                    gboolean value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_boolean(), tp_g_value_slice_new_boolean()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_boxed ()

gpointer
tp_asv_get_boxed (const GHashTable *asv,
                  const gchar *key,
                  GType type);

If a value for key in asv is present and is of the desired type, return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it, for instance with g_boxed_copy(), if you need to keep it for longer.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

type

The type that the key's value should have, which must be derived from G_TYPE_BOXED

 

Returns

the value of key , or NULL.

[transfer none][allow-none]

Since: 0.7.9


tp_asv_set_boxed ()

void
tp_asv_set_boxed (GHashTable *asv,
                  const gchar *key,
                  GType type,
                  gconstpointer value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_boxed()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

type

the type of the key's value, which must be derived from G_TYPE_BOXED

 

value

value

 

Since: 0.7.29


tp_asv_take_boxed ()

void
tp_asv_take_boxed (GHashTable *asv,
                   const gchar *key,
                   GType type,
                   gpointer value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_take_boxed()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

type

the type of the key's value, which must be derived from G_TYPE_BOXED

 

value

value

 

Since: 0.7.29


tp_asv_set_static_boxed ()

void
tp_asv_set_static_boxed (GHashTable *asv,
                         const gchar *key,
                         GType type,
                         gconstpointer value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_static_boxed()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

type

the type of the key's value, which must be derived from G_TYPE_BOXED

 

value

value

 

Since: 0.7.29


tp_asv_get_bytes ()

const GArray *
tp_asv_get_bytes (const GHashTable *asv,
                  const gchar *key);

If a value for key in asv is present and is an array of bytes (its GType is DBUS_TYPE_G_UCHAR_ARRAY), return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it with g_boxed_copy (DBUS_TYPE_G_UCHAR_ARRAY, ...) if you need to keep it for longer.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

Returns

the string value of key , or NULL.

[transfer none][allow-none][element-type guint8]

Since: 0.7.9


tp_asv_set_bytes ()

void
tp_asv_set_bytes (GHashTable *asv,
                  const gchar *key,
                  guint length,
                  gconstpointer bytes);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_bytes()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

length

the number of bytes to copy

 

bytes

location of an array of bytes to be copied (this may be NULL if and only if length is 0)

 

Since: 0.7.29


tp_asv_take_bytes ()

void
tp_asv_take_bytes (GHashTable *asv,
                   const gchar *key,
                   GArray *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_take_bytes()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

a non-NULL GArray of guchar, ownership of which will be taken by the GValue

 

Since: 0.7.29


tp_asv_get_double ()

gdouble
tp_asv_get_double (const GHashTable *asv,
                   const gchar *key,
                   gboolean *valid);

If a value for key in asv is present and has any numeric type used by dbus-glib (guchar, gint, guint, gint64, guint64 or gdouble), return it as a double, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0.0, and if valid is not NULL, set *valid to FALSE.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the double precision floating-point value of key , or 0.0

Since: 0.7.9


tp_asv_set_double ()

void
tp_asv_set_double (GHashTable *asv,
                   const gchar *key,
                   gdouble value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_double(), tp_g_value_slice_new_double()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_int32 ()

gint32
tp_asv_get_int32 (const GHashTable *asv,
                  const gchar *key,
                  gboolean *valid);

If a value for key in asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a gint32, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 32-bit signed integer value of key , or 0

Since: 0.7.9


tp_asv_set_int32 ()

void
tp_asv_set_int32 (GHashTable *asv,
                  const gchar *key,
                  gint32 value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_int32(), tp_g_value_slice_new_int()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_int64 ()

gint64
tp_asv_get_int64 (const GHashTable *asv,
                  const gchar *key,
                  gboolean *valid);

If a value for key in asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a gint64, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 64-bit signed integer value of key , or 0

Since: 0.7.9


tp_asv_set_int64 ()

void
tp_asv_set_int64 (GHashTable *asv,
                  const gchar *key,
                  gint64 value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_int64(), tp_g_value_slice_new_int64()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_object_path ()

const gchar *
tp_asv_get_object_path (const GHashTable *asv,
                        const gchar *key);

If a value for key in asv is present and is an object path, return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it with g_strdup() if you need to keep it for longer.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

Returns

the object-path value of key , or NULL.

[transfer none][allow-none]

Since: 0.7.9


tp_asv_set_object_path ()

void
tp_asv_set_object_path (GHashTable *asv,
                        const gchar *key,
                        const gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_object_path()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_take_object_path ()

void
tp_asv_take_object_path (GHashTable *asv,
                         const gchar *key,
                         gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_take_object_path()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_set_static_object_path ()

void
tp_asv_set_static_object_path (GHashTable *asv,
                               const gchar *key,
                               const gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_static_object_path()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_string ()

const gchar *
tp_asv_get_string (const GHashTable *asv,
                   const gchar *key);

If a value for key in asv is present and is a string, return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it with g_strdup() if you need to keep it for longer.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

Returns

the string value of key , or NULL.

[transfer none][allow-none]

Since: 0.7.9


tp_asv_set_string ()

void
tp_asv_set_string (GHashTable *asv,
                   const gchar *key,
                   const gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_string()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_take_string ()

void
tp_asv_take_string (GHashTable *asv,
                    const gchar *key,
                    gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_take_string()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_set_static_string ()

void
tp_asv_set_static_string (GHashTable *asv,
                          const gchar *key,
                          const gchar *value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_static_string()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_strv ()

const gchar * const *
tp_asv_get_strv (const GHashTable *asv,
                 const gchar *key);

If a value for key in asv is present and is an array of strings (strv), return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it with g_strdupv() if you need to keep it for longer.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

Returns

the NULL-terminated string-array value of key , or NULL.

[transfer none][allow-none]

Since: 0.7.9


tp_asv_set_strv ()

void
tp_asv_set_strv (GHashTable *asv,
                 const gchar *key,
                 gchar **value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_strv()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

a NULL-terminated string array

 

Since: 0.7.29


tp_asv_get_uint32 ()

guint32
tp_asv_get_uint32 (const GHashTable *asv,
                   const gchar *key,
                   gboolean *valid);

If a value for key in asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a guint32, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 32-bit unsigned integer value of key , or 0

Since: 0.7.9


tp_asv_set_uint32 ()

void
tp_asv_set_uint32 (GHashTable *asv,
                   const gchar *key,
                   guint32 value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_uint32(), tp_g_value_slice_new_uint()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_get_uint64 ()

guint64
tp_asv_get_uint64 (const GHashTable *asv,
                   const gchar *key,
                   gboolean *valid);

If a value for key in asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and is non-negative, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

asv

A GHashTable where the keys are strings and the values are GValues.

[element-type utf8 GObject.Value]

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 64-bit unsigned integer value of key , or 0

Since: 0.7.9


tp_asv_set_uint64 ()

void
tp_asv_set_uint64 (GHashTable *asv,
                   const gchar *key,
                   guint64 value);

Stores the value in the map.

The value is stored as a slice-allocated GValue.

See Also: tp_asv_new(), tp_asv_get_uint64(), tp_g_value_slice_new_uint64()

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 

key

string key

 

value

value

 

Since: 0.7.29


tp_asv_lookup ()

const GValue *
tp_asv_lookup (const GHashTable *asv,
               const gchar *key);

If a value for key in asv is present, return it. Otherwise return NULL.

The returned value is not copied, and is only valid as long as the value for key in asv is not removed or altered. Copy it with (for instance) g_value_copy() if you need to keep it for longer.

[skip]

Parameters

asv

A GHashTable where the keys are strings and the values are GValues

 

key

The key to look up

 

Returns

the value of key , or NULL

Since: 0.7.9


tp_asv_dump ()

void
tp_asv_dump (GHashTable *asv);

Dumps the a{sv} map to the debugging console.

The purpose of this function is give the programmer the ability to easily inspect the contents of an a{sv} map for debugging purposes.

[skip]

Parameters

asv

a GHashTable created with tp_asv_new()

 
telepathy-glib-0.24.2/docs/reference/html/left-insensitive.png0000644000175000017500000000061314006623343021263 00000000000000PNG  IHDRabKGD pHYs B(xtIMEƫqIDAT8͒NQ@pds`*4@W@ A!Ԇ@6^ 5hxIH R`sQp̙339B|sKEQTK@۝΁i^~Wʆ`0TJ6TcYn6A ƀ~߱>}ǭs; lYkwr 5U= /" "uU=ɲlArDzp5I4^E+P3Ɯq_p ̥iUYp=#IENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-addressing.html0000644000175000017500000006736414006623344025364 00000000000000 Connection Addressing interface: telepathy-glib API Reference Manual

Connection Addressing interface

Connection Addressing interface — client-side wrappers for the Addressing interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

An interface for connections in protocols where contacts' unique identifiers can be expressed as vCard fields and/or URIs.

Functions

tp_cli_connection_interface_addressing_call_get_contacts_by_uri ()

TpProxyPendingCall *
tp_cli_connection_interface_addressing_call_get_contacts_by_uri
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar **in_URIs,
                                const gchar **in_Interfaces,
                                tp_cli_connection_interface_addressing_callback_for_get_contacts_by_uri callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactsByURI method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request contacts and retrieve their attributes using URI addresses.</p> <p>The connection manager should record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.ReleaseHandles</tp:dbus-ref> method.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_URIs

Used to pass an 'in' argument: The URI addresses to get contact handles for. Supported schemes can be found in <tp:dbus-ref namespace="org.freedesktop.Telepathy.Protocol.Interface.Addressing">AddressableURISchemes</tp:dbus-ref>.

 

in_Interfaces

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.</p> <p>Attributes from this interface and from <tp:dbus-ref>org.freedesktop.Telepathy.Connection</tp:dbus-ref> are always returned, and need not be requested explicitly.</p> <p>The behavior of this parameter is similar to the same parameter in <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Contacts.GetContactAttributes</tp:dbus-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_addressing_call_get_contacts_by_vcard_field ()

TpProxyPendingCall *
tp_cli_connection_interface_addressing_call_get_contacts_by_vcard_field
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Field,
                                const gchar **in_Addresses,
                                const gchar **in_Interfaces,
                                tp_cli_connection_interface_addressing_callback_for_get_contacts_by_vcard_field callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactsByVCardField method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request contacts and retrieve their attributes using a given field in their vCards.</p> <p>The connection manager should record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.ReleaseHandles</tp:dbus-ref> method.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Field

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The vCard field of the addresses we are requesting. The field name SHOULD be in lower case. Supported fields can be found in <tp:dbus-ref namespace="org.freedesktop.Telepathy.Protocol.Interface.Addressing">AddressableVCardFields</tp:dbus-ref>.</p> <p>The <code>url</code> vCard field MUST NOT appear here; see <tp:member-ref>GetContactsByURI</tp:member-ref> instead.</p> <tp:rationale> <p>In practice, protocols have a limited set of URI schemes that make sense to resolve as a contact.</p> </tp:rationale>

 

in_Addresses

Used to pass an 'in' argument: The addresses to get contact handles for. The address types should match the given vCard field.

 

in_Interfaces

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.</p> <p>Attributes from this interface and from <tp:dbus-ref>org.freedesktop.Telepathy.Connection</tp:dbus-ref> are always returned, and need not be requested explicitly.</p> <p>The behavior of this parameter is similar to the same parameter in <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Contacts.GetContactAttributes</tp:dbus-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_addressing_callback_for_get_contacts_by_uri ()

void
(*tp_cli_connection_interface_addressing_callback_for_get_contacts_by_uri)
                               (TpConnection *proxy,
                                GHashTable *out_Requested,
                                GHashTable *out_Attributes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactsByURI method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Requested

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A mapping of requested URIs to the corresponding contact handles.</p> <p>Requested URIs that are not valid or understood for this protocol MUST be omitted from the mapping.</p>

 

out_Attributes

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary mapping the contact handles to contact attributes. If any of the requested addresses are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.</p> <p>Requested URIs that are not valid or understood for this protocol MUST be omitted from the mapping.</p> <p>Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (<code>org.freedesktop.Telepathy.Connection/contact-id</code>). </p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_addressing_callback_for_get_contacts_by_vcard_field ()

void
(*tp_cli_connection_interface_addressing_callback_for_get_contacts_by_vcard_field)
                               (TpConnection *proxy,
                                GHashTable *out_Requested,
                                GHashTable *out_Attributes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactsByVCardField method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Requested

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A mapping from requested vCard addresses to the corresponding contact handles.</p> <p>Requested addresses that are not valid or understood for this protocol MUST be omitted from the mapping.</p>

 

out_Attributes

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary mapping the contact handles to contact attributes. If any of the requested addresses are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.</p> <p>Requested addresses that are not valid or understood for this protocol MUST be omitted from the mapping.</p> <p>Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (<code>org.freedesktop.Telepathy.Connection/contact-id</code>). </p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-call-stream.html0000644000175000017500000010666314006623344023304 00000000000000 TpCallStream: telepathy-glib API Reference Manual

TpCallStream

TpCallStream — proxy object for a call stream

Properties

gboolean can-request-receiving Read
TpConnection * connection Read / Write / Construct Only
TpCallContent * content Read / Write / Construct Only
guint local-sending-state Read

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpCallStream

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpCallStream is a sub-class of TpProxy providing convenient API to represent TpCallChannel's stream.

Functions

tp_call_stream_init_known_interfaces ()

void
tp_call_stream_init_known_interfaces (void);

Ensure that the known interfaces for TpCallStream have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CALL_STREAM.

Since: 0.17.5


tp_call_stream_can_request_receiving ()

gboolean
tp_call_stream_can_request_receiving (TpCallStream *self);

Parameters

self

a TpCallStream

 

Returns

the value of “can-request-receiving”

Since: 0.17.5


tp_call_stream_get_local_sending_state ()

TpSendingState
tp_call_stream_get_local_sending_state
                               (TpCallStream *self);

Parameters

self

a TpCallStream

 

Returns

the value of “local-sending-state”

Since: 0.17.5


tp_call_stream_get_remote_members ()

GHashTable *
tp_call_stream_get_remote_members (TpCallStream *self);

Get the remote contacts to who this stream is connected, mapped to their sending state.

It is NOT guaranteed that TpContact objects have any feature prepared.

Parameters

self

a TpCallStream

 

Returns

GHashTable mapping TpContact to its new TpSendingState.

[transfer none][type GLib.HashTable][element-type TelepathyGLib.Contact uint]

Since: 0.17.5


tp_call_stream_request_receiving_async ()

void
tp_call_stream_request_receiving_async
                               (TpCallStream *self,
                                TpContact *contact,
                                gboolean receive,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request that a remote contact stops or starts sending on this stream.

The “can-request-receiving” property defines whether the protocol allows the local user to request the other side start sending on this stream.

If receive is TRUE, request that the given contact starts to send media. If receive is FALSE, request that the given contact stops sending media.

Parameters

self

a TpCallStream

 

contact

contact from which sending is requested

 

receive

the requested receiving state

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_stream_request_receiving_finish ()

gboolean
tp_call_stream_request_receiving_finish
                               (TpCallStream *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_call_stream_request_receiving_async().

Parameters

self

a TpCallStream

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_stream_set_sending_async ()

void
tp_call_stream_set_sending_async (TpCallStream *self,
                                  gboolean send,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Set the stream to start or stop sending media from the local user to other contacts.

If send is TRUE, “local-sending-state” should change to TP_SENDING_STATE_SENDING, if it isn't already. If send is FALSE, “local-sending-state” should change to TP_SENDING_STATE_NONE, if it isn't already.

Parameters

self

a TpCallStream

 

send

the requested sending state

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_stream_set_sending_finish ()

gboolean
tp_call_stream_set_sending_finish (TpCallStream *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_call_stream_set_sending_async().

Parameters

self

a TpCallStream

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5

Types and Values

struct TpCallStream

struct TpCallStream;

Data structure representing a TpCallStream.

Since: 0.17.5


struct TpCallStreamClass

struct TpCallStreamClass {
};

The class of a TpCallStream.

Since: 0.17.5


TP_CALL_STREAM_FEATURE_CORE

#define             TP_CALL_STREAM_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpCallStream.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to trigger the callback.

Property Details

The “can-request-receiving” property

  “can-request-receiving”    gboolean

If TRUE, the user can request that a remote contact starts sending on this stream.

Owner: TpCallStream

Flags: Read

Default value: FALSE

Since: 0.17.5


The “connection” property

  “connection”               TpConnection *

The TpConnection of the call.

Owner: TpCallStream

Flags: Read / Write / Construct Only

Since: 0.17.5


The “content” property

  “content”                  TpCallContent *

The Content that this streams belongs to

Owner: TpCallStream

Flags: Read / Write / Construct Only

Since: 0.17.6


The “local-sending-state” property

  “local-sending-state”      guint

The local user's sending state, from TpSendingState.

Owner: TpCallStream

Flags: Read

Default value: 0

Since: 0.17.5

Signal Details

The “local-sending-state-changed” signal

void
user_function (TpCallStream      *self,
               guint              state,
               TpCallStateReason *reason,
               gpointer           user_data)

The ::local-sending-state-changed signal is emitted whenever the stream sending state changes.

Parameters

self

the TpCallStream

 

state

the new TpSendingState

 

reason

the TpCallStateReason for the change

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “remote-members-changed” signal

void
user_function (TpCallStream      *self,
               GHashTable        *updates,
               GPtrArray         *removed,
               TpCallStateReason *reason,
               gpointer           user_data)

The ::remote-members-changed signal is emitted whenever the stream's remote members changes.

It is NOT guaranteed that TpContact objects have any feature prepared.

Parameters

self

the TpCallStream

 

updates

GHashTable mapping TpContact to its new TpSendingState.

[type GLib.HashTable][element-type TelepathyGLib.Contact uint]

removed

GPtrArray of TpContact removed from remote contacts.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

reason

the TpCallStateReason for the change

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection.html0000644000175000017500000217122614006623344023236 00000000000000 TpConnection: telepathy-glib API Reference Manual

TpConnection

TpConnection — proxy object for a Telepathy connection

Functions

void (*TpConnectionNameListCb) ()
void tp_list_connection_names ()
TpConnection * tp_connection_new ()
gboolean tp_connection_run_until_ready ()
void (*TpConnectionWhenReadyCb) ()
void tp_connection_call_when_ready ()
gboolean tp_connection_is_ready ()
void tp_connection_disconnect_async ()
gboolean tp_connection_disconnect_finish ()
TpAccount * tp_connection_get_account ()
TpConnectionStatus tp_connection_get_status ()
const gchar * tp_connection_get_connection_manager_name ()
const gchar * tp_connection_get_cm_name ()
const gchar * tp_connection_get_protocol_name ()
TpContact * tp_connection_get_self_contact ()
TpHandle tp_connection_get_self_handle ()
gboolean tp_connection_has_immortal_handles ()
void (*TpConnectionRequestHandlesCb) ()
void tp_connection_request_handles ()
void (*TpConnectionHoldHandlesCb) ()
void tp_connection_get_contact_attributes ()
void tp_connection_get_contact_list_attributes ()
void tp_connection_hold_handles ()
void tp_connection_unref_handles ()
void tp_connection_init_known_interfaces ()
gint tp_connection_presence_type_cmp_availability ()
gboolean tp_connection_parse_object_path ()
TpCapabilities * tp_connection_get_capabilities ()
TpAvatarRequirements * tp_connection_get_avatar_requirements ()
TpContactInfoFlags tp_connection_get_contact_info_flags ()
GList * tp_connection_get_contact_info_supported_fields ()
GList * tp_connection_dup_contact_info_supported_fields ()
void tp_connection_set_contact_info_async ()
gboolean tp_connection_set_contact_info_finish ()
const gchar * tp_connection_get_detailed_error ()
gchar * tp_connection_dup_detailed_error_vardict ()
void tp_connection_add_client_interest ()
void tp_connection_add_client_interest_by_id ()
GBinding * tp_connection_bind_connection_status_to_property ()
gboolean tp_connection_get_balance ()
const gchar * tp_connection_get_balance_uri ()
TpAvatarRequirements * tp_avatar_requirements_new ()
TpAvatarRequirements * tp_avatar_requirements_copy ()
void tp_avatar_requirements_destroy ()
TpContactInfoFieldSpec * tp_contact_info_field_spec_copy ()
void tp_contact_info_field_spec_free ()
GList * tp_contact_info_spec_list_copy ()
void tp_contact_info_spec_list_free ()
TpContactInfoField * tp_contact_info_field_new ()
TpContactInfoField * tp_contact_info_field_copy ()
void tp_contact_info_field_free ()
GList * tp_contact_info_list_copy ()
void tp_contact_info_list_free ()
TpContactListState tp_connection_get_contact_list_state ()
gboolean tp_connection_get_contact_list_persists ()
gboolean tp_connection_get_can_change_contact_list ()
gboolean tp_connection_get_request_uses_message ()
GPtrArray * tp_connection_dup_contact_list ()
void tp_connection_request_subscription_async ()
gboolean tp_connection_request_subscription_finish ()
void tp_connection_authorize_publication_async ()
gboolean tp_connection_authorize_publication_finish ()
void tp_connection_remove_contacts_async ()
gboolean tp_connection_remove_contacts_finish ()
void tp_connection_unsubscribe_async ()
gboolean tp_connection_unsubscribe_finish ()
void tp_connection_unpublish_async ()
gboolean tp_connection_unpublish_finish ()
gboolean tp_connection_get_disjoint_groups ()
TpContactMetadataStorageType tp_connection_get_group_storage ()
const gchar * const * tp_connection_get_contact_groups ()
void tp_connection_set_group_members_async ()
gboolean tp_connection_set_group_members_finish ()
void tp_connection_add_to_group_async ()
gboolean tp_connection_add_to_group_finish ()
void tp_connection_remove_from_group_async ()
gboolean tp_connection_remove_from_group_finish ()
void tp_connection_remove_group_async ()
gboolean tp_connection_remove_group_finish ()
void tp_connection_rename_group_async ()
gboolean tp_connection_rename_group_finish ()
void tp_connection_block_contacts_async ()
gboolean tp_connection_block_contacts_finish ()
void tp_connection_unblock_contacts_async ()
gboolean tp_connection_unblock_contacts_finish ()
gboolean tp_connection_can_report_abusive ()
GPtrArray * tp_connection_get_blocked_contacts ()
gboolean tp_connection_can_set_contact_alias ()
void (*tp_cli_connection_callback_for_connect) ()
TpProxyPendingCall * tp_cli_connection_call_connect ()
gboolean tp_cli_connection_run_connect ()
void (*tp_cli_connection_callback_for_disconnect) ()
TpProxyPendingCall * tp_cli_connection_call_disconnect ()
gboolean tp_cli_connection_run_disconnect ()
void (*tp_cli_connection_callback_for_get_interfaces) ()
TpProxyPendingCall * tp_cli_connection_call_get_interfaces ()
gboolean tp_cli_connection_run_get_interfaces ()
void (*tp_cli_connection_callback_for_get_protocol) ()
TpProxyPendingCall * tp_cli_connection_call_get_protocol ()
gboolean tp_cli_connection_run_get_protocol ()
void (*tp_cli_connection_callback_for_get_self_handle) ()
TpProxyPendingCall * tp_cli_connection_call_get_self_handle ()
gboolean tp_cli_connection_run_get_self_handle ()
void (*tp_cli_connection_callback_for_get_status) ()
TpProxyPendingCall * tp_cli_connection_call_get_status ()
gboolean tp_cli_connection_run_get_status ()
void (*tp_cli_connection_callback_for_hold_handles) ()
TpProxyPendingCall * tp_cli_connection_call_hold_handles ()
gboolean tp_cli_connection_run_hold_handles ()
void (*tp_cli_connection_callback_for_inspect_handles) ()
TpProxyPendingCall * tp_cli_connection_call_inspect_handles ()
gboolean tp_cli_connection_run_inspect_handles ()
void (*tp_cli_connection_callback_for_list_channels) ()
TpProxyPendingCall * tp_cli_connection_call_list_channels ()
gboolean tp_cli_connection_run_list_channels ()
void (*tp_cli_connection_callback_for_release_handles) ()
TpProxyPendingCall * tp_cli_connection_call_release_handles ()
gboolean tp_cli_connection_run_release_handles ()
void (*tp_cli_connection_callback_for_request_channel) ()
TpProxyPendingCall * tp_cli_connection_call_request_channel ()
gboolean tp_cli_connection_run_request_channel ()
void (*tp_cli_connection_callback_for_request_handles) ()
TpProxyPendingCall * tp_cli_connection_call_request_handles ()
gboolean tp_cli_connection_run_request_handles ()
void (*tp_cli_connection_signal_callback_new_channel) ()
TpProxySignalConnection * tp_cli_connection_connect_to_new_channel ()
void (*tp_cli_connection_signal_callback_self_handle_changed) ()
TpProxySignalConnection * tp_cli_connection_connect_to_self_handle_changed ()
void (*tp_cli_connection_signal_callback_self_contact_changed) ()
TpProxySignalConnection * tp_cli_connection_connect_to_self_contact_changed ()
void (*tp_cli_connection_signal_callback_status_changed) ()
TpProxySignalConnection * tp_cli_connection_connect_to_status_changed ()
void (*tp_cli_connection_signal_callback_connection_error) ()
TpProxySignalConnection * tp_cli_connection_connect_to_connection_error ()
TpProxyPendingCall * tp_cli_connection_call_add_client_interest ()
TpProxyPendingCall * tp_cli_connection_call_remove_client_interest ()
void (*tp_cli_connection_callback_for_add_client_interest) ()
void (*tp_cli_connection_callback_for_remove_client_interest) ()

Properties

gint balance Read
gchar * balance-currency Read
guint balance-scale Read
gchar * balance-uri Read
GPtrArray * blocked-contacts Read
gboolean can-change-contact-list Read
gboolean can-report-abusive Read
TpCapabilities * capabilities Read
gchar * cm-name Read
gchar * connection-manager-name Read
gboolean connection-ready Read
GStrv contact-groups Read
gboolean contact-list-persists Read
guint contact-list-state Read
gboolean disjoint-groups Read
guint group-storage Read
gchar * protocol-name Read
gboolean request-uses-message Read
TpContact * self-contact Read
guint self-handle Read
guint status Read
guint status-reason Read

Signals

void balance-changed Has Details
void blocked-contacts-changed Run Last
void contact-list-changed Run Last
void group-renamed Run Last
void groups-created Run Last
void groups-removed Run Last

Object Hierarchy

    GBoxed
    ├── TpAvatarRequirements
    ├── TpContactInfoField
    ├── TpContactInfoFieldSpec
    ├── TpContactInfoList
    ╰── TpContactInfoSpecList
    GObject
    ╰── TpProxy
        ╰── TpConnection

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpConnection objects represent Telepathy instant messaging connections accessed via D-Bus.

TpConnection objects should be obtained from a TpAccount, unless you are implementing a lower-level Telepathy component (such as the account manager service itself).

Since 0.16, TpConnection always has a non-NULL “factory”, and its “factory” will be propagated to its TpChannel objects (if any). Similarly, the “factory”'s features will be used for TpContact objects. If a TpConnection is created without going via the TpAccount or specifying a “factory”, the default is to use a new TpAutomaticClientFactory.

Functions

TpConnectionNameListCb ()

void
(*TpConnectionNameListCb) (const gchar * const *names,
                           gsize n,
                           const gchar * const *cms,
                           const gchar * const *protocols,
                           const GError *error,
                           gpointer user_data,
                           GObject *weak_object);

Signature of the callback supplied to tp_list_connection_names().

Parameters

names

NULL-terminated array of n connection bus names, or NULL on error.

[array zero-terminated=1]

n

number of names (not including the final NULL), or 0 on error

 

cms

NULL-terminated array of n connection manager names (e.g. "gabble") in the same order as names , or NULL on error.

[array zero-terminated=1]

protocols

NULL-terminated array of n protocol names as defined in the Telepathy spec (e.g. "jabber") in the same order as names , or NULL on error.

[array zero-terminated=1]

error

NULL on success, or an error that occurred

 

user_data

user-supplied data

 

weak_object

user-supplied weakly referenced object

 

Since: 0.7.1


tp_list_connection_names ()

void
tp_list_connection_names (TpDBusDaemon *bus_daemon,
                          TpConnectionNameListCb callback,
                          gpointer user_data,
                          GDestroyNotify destroy,
                          GObject *weak_object);

List the bus names of all the connections that currently exist, together with the connection manager name and the protocol name for each connection. Call the callback when done.

The bus names passed to the callback can be used to construct TpConnection objects for any connections that are of interest.

Parameters

bus_daemon

proxy for the D-Bus daemon

 

callback

callback to be called when listing the connections succeeds or fails; not called if the D-Bus connection fails completely or if the weak_object goes away

 

user_data

user-supplied data for the callback

 

destroy

callback to destroy the user-supplied data, called after callback , but also if the D-Bus connection fails or if the weak_object goes away

 

weak_object

if not NULL, will be weakly referenced; the callback will not be called if the object has vanished.

[allow-none]

Since: 0.7.1


tp_connection_new ()

TpConnection *
tp_connection_new (TpDBusDaemon *dbus,
                   const gchar *bus_name,
                   const gchar *object_path,
                   GError **error);

tp_connection_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_connection() instead.

Parameters

dbus

a D-Bus daemon; may not be NULL

 

bus_name

the well-known or unique name of the connection process; if well-known, this function will make a blocking call to the bus daemon to resolve the unique name. May be NULL if object_path is not, in which case a well-known name will be derived from object_path .

[allow-none]

object_path

the object path of the connection process. May be NULL if bus_name is a well-known name, in which case the object path will be derived from bus_name .

[allow-none]

error

used to indicate the error if NULL is returned

 

Returns

a new connection proxy, or NULL if unique-name resolution fails or on invalid arguments

Since: 0.7.1


tp_connection_run_until_ready ()

gboolean
tp_connection_run_until_ready (TpConnection *self,
                               gboolean connect,
                               GError **error,
                               GMainLoop **loop);

tp_connection_run_until_ready has been deprecated since version 0.11.0 and should not be used in newly-written code.

Use tp_proxy_prepare_async() and re-enter the main loop yourself, or restructure your program in such a way as to avoid re-entering the main loop.

If self is connected and ready for use, return immediately. Otherwise, call Connect() (unless connect is FALSE) and re-enter the main loop until the connection becomes invalid, the connection connects successfully and is introspected, or the main loop stored via loop is cancelled.

[skip]

Parameters

self

a connection

 

connect

if TRUE, call Connect() if it appears to be necessary; if FALSE, rely on Connect() to be called by another client

 

error

if not NULL and FALSE is returned, used to raise an error

 

loop

if not NULL, a GMainLoop is placed here while it is being run (so calling code can call g_main_loop_quit() to abort), and NULL is placed here after the loop has been run

 

Returns

TRUE if the connection is now connected and ready for use, FALSE if the connection has become invalid.

Since: 0.7.1


TpConnectionWhenReadyCb ()

void
(*TpConnectionWhenReadyCb) (TpConnection *connection,
                            const GError *error,
                            gpointer user_data);

TpConnectionWhenReadyCb has been deprecated since version 0.17.6 and should not be used in newly-written code.

Signature of a callback passed to tp_connection_call_when_ready(), which will be called exactly once, when the connection becomes ready or invalid (whichever happens first)

Parameters

connection

the connection (which may be in the middle of being disposed, if error is non-NULL, error->domain is TP_DBUS_ERRORS and error->code is TP_DBUS_ERROR_PROXY_UNREFERENCED)

 

error

NULL if the connection is ready for use, or the error with which it was invalidated if it is now invalid

 

user_data

whatever was passed to tp_connection_call_when_ready()

 

tp_connection_call_when_ready ()

void
tp_connection_call_when_ready (TpConnection *self,
                               TpConnectionWhenReadyCb callback,
                               gpointer user_data);

tp_connection_call_when_ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

Use tp_proxy_prepare_async()

If self is ready for use or has been invalidated, call callback immediately, then return. Otherwise, arrange for callback to be called when self either becomes ready for use or becomes invalid.

Note that if the connection is not in state CONNECTED, the callback will not be called until the connection either goes to state CONNECTED or is invalidated (e.g. by going to state DISCONNECTED or by becoming unreferenced). In particular, this method does not call Connect(). Call tp_cli_connection_call_connect() too, if you want to do that.

[skip]

Parameters

self

a connection

 

callback

called when the connection becomes ready or invalidated, whichever happens first

 

user_data

arbitrary user-supplied data passed to the callback

 

Since: 0.7.7


tp_connection_is_ready ()

gboolean
tp_connection_is_ready (TpConnection *self);

tp_connection_is_ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

use tp_proxy_is_prepared() with TP_CONNECTION_FEATURE_CONNECTED

Returns the same thing as the “connection-ready” property.

[skip]

Parameters

self

a connection

 

Returns

TRUE if introspection has completed

Since: 0.7.17


tp_connection_disconnect_async ()

void
tp_connection_disconnect_async (TpConnection *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Disconnect the connection.

This method is intended for use by AccountManager implementations, such as Mission Control. To disconnect a connection managed by an AccountManager, either use tp_account_request_presence_async() or tp_account_set_enabled_async(), depending whether the intention is to put the account offline temporarily, or disable it longer-term.

Parameters

self

a TpConnection

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_connection_disconnect_finish ()

gboolean
tp_connection_disconnect_finish (TpConnection *self,
                                 GAsyncResult *result,
                                 GError **error);

Interpret the result of tp_connection_disconnect_async().

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call was successful, otherwise FALSE

Since: 0.17.5


tp_connection_get_account ()

TpAccount *
tp_connection_get_account (TpConnection *self);

Return the the TpAccount associated with this connection. Will return NULL if self was not acquired from a TpAccount via tp_account_get_connection(), or if the account object got finalized in the meantime (TpConnection does not keep a strong ref on its TpAccount).

Parameters

self

a connection

 

Returns

the account associated with this connection, or NULL.

[transfer none]

Since: 0.15.5


tp_connection_get_status ()

TpConnectionStatus
tp_connection_get_status (TpConnection *self,
                          TpConnectionStatusReason *reason);

If reason is not NULL it is set to the reason why "status" changed to its current value, or TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown.

Parameters

self

a connection

 

reason

a TpConnectionStatusReason, or NULL.

[out]

Returns

This connection's status, or TP_UNKNOWN_CONNECTION_STATUS if we don't know yet.

Since: 0.7.14


tp_connection_get_connection_manager_name ()

const gchar *
tp_connection_get_connection_manager_name
                               (TpConnection *self);

tp_connection_get_connection_manager_name is deprecated and should not be used in newly-written code.

Use tp_connection_get_cm_name() instead.

Parameters

self

a TpConnection

 

Returns

the same as the “connection-manager-name” property

Since: 0.13.16


tp_connection_get_cm_name ()

const gchar *
tp_connection_get_cm_name (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the same as the “cm-name” property

Since: 0.19.3


tp_connection_get_protocol_name ()

const gchar *
tp_connection_get_protocol_name (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the same as the “protocol-name” property

Since: 0.13.16


tp_connection_get_self_contact ()

TpContact *
tp_connection_get_self_contact (TpConnection *self);

Return a TpContact representing the local user on this connection.

The returned object is not necessarily valid after the main loop is re-entered; ref it with g_object_ref() if you want to keep it.

Parameters

self

a connection

 

Returns

the value of the TpConnection:self-contact property, which may be NULL.

[transfer none]

Since: 0.13.9


tp_connection_get_self_handle ()

TpHandle
tp_connection_get_self_handle (TpConnection *self);

tp_connection_get_self_handle is deprecated and should not be used in newly-written code.

Use tp_connection_get_self_contact() instead.

Return the TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if the self-handle is not known yet or the connection has become invalid (the TpProxy::invalidated signal).

The returned handle is not necessarily valid forever (the notify::self-handle signal will be emitted if it changes, which can happen on protocols such as IRC). Construct a TpContact object if you want to track the local user's identifier in the protocol, or other information like their presence status, over time.

Parameters

self

a connection

 

Returns

the value of the TpConnection:self-handle property

Since: 0.7.26


tp_connection_has_immortal_handles ()

gboolean
tp_connection_has_immortal_handles (TpConnection *self);

Return TRUE if this connection is known to not destroy handles (TpHandle) until it disconnects.

On such connections, if you know that a handle maps to a particular identifier now, then you can rely on that handle mapping to that identifier for the whole lifetime of the connection.

Parameters

self

a connection

 

Returns

TRUE if handles last as long as the connection itself


TpConnectionRequestHandlesCb ()

void
(*TpConnectionRequestHandlesCb) (TpConnection *connection,
                                 TpHandleType handle_type,
                                 guint n_handles,
                                 const TpHandle *handles,
                                 const gchar * const *ids,
                                 const GError *error,
                                 gpointer user_data,
                                 GObject *weak_object);

TpConnectionRequestHandlesCb is deprecated and should not be used in newly-written code.

See tp_connection_request_handles().

Signature of the callback called when tp_connection_request_handles() succeeds or fails.

On success, the caller has a reference to each handle in handles .

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by “invalidated”). In earlier versions, they could be released with tp_connection_unref_handles().

For convenience, the handle type and IDs requested by the caller are passed through to this callback, so the caller does not have to include them in user_data .

Parameters

connection

the connection

 

handle_type

the handle type that was passed to tp_connection_request_handles()

 

n_handles

the number of IDs that were passed to tp_connection_request_handles() on success, or 0 on failure

 

handles

the n_handles handles corresponding to ids , in the same order, or NULL on failure.

[element-type uint][array length=n_handles]

ids

a copy of the array of n_handles IDs that was passed to tp_connection_request_handles() on success, or NULL on failure.

[element-type utf8][array length=n_handles]

error

NULL on success, or an error on failure

 

user_data

the same arbitrary pointer that was passed to tp_connection_request_handles()

 

weak_object

the same object that was passed to tp_connection_request_handles()

 

tp_connection_request_handles ()

void
tp_connection_request_handles (TpConnection *self,
                               gint timeout_ms,
                               TpHandleType handle_type,
                               const gchar * const *ids,
                               TpConnectionRequestHandlesCb callback,
                               gpointer user_data,
                               GDestroyNotify destroy,
                               GObject *weak_object);

tp_connection_request_handles is deprecated and should not be used in newly-written code.

If handle_type is TP_HANDLE_TYPE_CONTACT, use tp_connection_dup_contact_by_id_async() instead. For channel requests, use tp_account_channel_request_set_target_id() instead.

Request the handles corresponding to the given identifiers, and if they are valid, hold (ensure a reference to) the corresponding handles.

If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error.

Parameters

self

a connection

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

handle_type

the handle type

 

ids

an array of string identifiers for which handles are required, terminated by NULL (must not be NULL or empty).

[array zero-terminated=1]

callback

called on success or failure (unless weak_object has become unreferenced)

 

user_data

arbitrary user-supplied data

 

destroy

called to destroy user_data after calling callback , or when weak_object becomes unreferenced (whichever occurs sooner)

 

weak_object

if not NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

 

TpConnectionHoldHandlesCb ()

void
(*TpConnectionHoldHandlesCb) (TpConnection *connection,
                              TpHandleType handle_type,
                              guint n_handles,
                              const TpHandle *handles,
                              const GError *error,
                              gpointer user_data,
                              GObject *weak_object);

TpConnectionHoldHandlesCb is deprecated and should not be used in newly-written code.

See tp_connection_hold_handles().

Signature of the callback called when tp_connection_hold_handles() succeeds or fails.

On success, the caller has a reference to each handle in handles .

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by “invalidated”). In earlier versions, they could be released with tp_connection_unref_handles().

For convenience, the handle type and handles requested by the caller are passed through to this callback on success, so the caller does not have to include them in user_data .

Parameters

connection

the connection

 

handle_type

the handle type that was passed to tp_connection_hold_handles()

 

n_handles

the number of handles that were passed to tp_connection_hold_handles() on success, or 0 on failure

 

handles

a copy of the array of n_handles handles that was passed to tp_connection_hold_handles() on success, or NULL on failure

 

error

NULL on success, or an error on failure

 

user_data

the same arbitrary pointer that was passed to tp_connection_hold_handles()

 

weak_object

the same object that was passed to tp_connection_hold_handles()

 

tp_connection_get_contact_attributes ()

void
tp_connection_get_contact_attributes (TpConnection *self,
                                      gint timeout_ms,
                                      guint n_handles,
                                      const TpHandle *handles,
                                      const gchar * const *interfaces,
                                      gboolean hold,
                                      tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

tp_connection_get_contact_attributes is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_contact() instead.

Return (via a callback) any number of attributes of the given handles.

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by “invalidated”). In earlier versions, if hold was TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles().

This is a thin wrapper around the GetContactAttributes D-Bus method, and should be used in preference to tp_cli_connection_interface_contacts_call_get_contact_attributes(); mixing this function, tp_connection_hold_handles(), tp_connection_unref_handles(), and TpContact with direct use of the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods is unwise, as TpConnection and TpContact perform client-side reference counting of handles. The TpContact API provides a higher-level abstraction which should usually be used instead.

callback will later be called with the attributes of those of the given handles that were valid. Invalid handles are simply omitted from the parameter to the callback.

If hold is TRUE, the callback is given one reference to each handle that appears as a key in the callback's attributes parameter.

Parameters

self

a connection

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

n_handles

the number of handles in handles (must be at least 1)

 

handles

an array of handles.

[array length=n_handles]

interfaces

a GStrv of interfaces

 

hold

if TRUE, the callback will hold one reference to each valid handle

 

callback

called on success or failure (unless weak_object has become unreferenced).

[type GObject.Callback]

user_data

arbitrary user-supplied data

 

destroy

called to destroy user_data after calling callback , or when weak_object becomes unreferenced (whichever occurs sooner)

 

weak_object

if not NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

 

tp_connection_get_contact_list_attributes ()

void
tp_connection_get_contact_list_attributes
                               (TpConnection *self,
                                gint timeout_ms,
                                const gchar * const *interfaces,
                                gboolean hold,
                                tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_connection_get_contact_list_attributes is deprecated and should not be used in newly-written code.

Use tp_connection_dup_contact_list() instead.

Return (via a callback) the contacts on the contact list and any number of their attributes.

Since telepathy-glib version 0.13.8, the handles will remain valid until connection becomes invalid (signalled by “invalidated”). In earlier versions, if hold was TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles().

This is a thin wrapper around the RequestContactList D-Bus method, and should be used in preference to lower-level functions; it is similar to tp_connection_get_contact_attributes().

The TpContact API provides a higher-level abstraction which should usually be used instead.

If hold is TRUE, the callback is given a reference to each handle that appears as a key in the callback's attributes parameter.

Parameters

self

a connection

 

timeout_ms

the timeout in milliseconds (using a large timeout is recommended)

 

interfaces

a GStrv of interfaces

 

hold

if TRUE, the callback will hold one reference to each handle it receives

 

callback

called on success or failure (unless weak_object has become unreferenced).

[type GObject.Callback]

user_data

arbitrary user-supplied data

 

destroy

called to destroy user_data after calling callback , or when weak_object becomes unreferenced (whichever occurs sooner)

 

weak_object

if not NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

 

tp_connection_hold_handles ()

void
tp_connection_hold_handles (TpConnection *self,
                            gint timeout_ms,
                            TpHandleType handle_type,
                            guint n_handles,
                            const TpHandle *handles,
                            TpConnectionHoldHandlesCb callback,
                            gpointer user_data,
                            GDestroyNotify destroy,
                            GObject *weak_object);

tp_connection_hold_handles is deprecated and should not be used in newly-written code.

Holding handles is not needed with Connection Managers having immortal handles (any Connection Manager using telepathy-glib >= 0.13.8). Other Connection Managers are considered deprecated, clients wanting to still support them should continue using this deprecated function.

Hold (ensure a reference to) the given handles, if they are valid.

If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error.

This function, along with tp_connection_unref_handles(), tp_connection_get_contact_attributes() and TpContact, keeps a client-side reference count of handles; you should not use the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods directly as well as these functions.

Parameters

self

a connection

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

handle_type

the handle type

 

n_handles

the number of handles in handles (must be at least 1)

 

handles

an array of handles.

[array length=n_handles]

callback

called on success or failure (unless weak_object has become unreferenced)

 

user_data

arbitrary user-supplied data

 

destroy

called to destroy user_data after calling callback , or when weak_object becomes unreferenced (whichever occurs sooner)

 

weak_object

if not NULL, an object to be weakly referenced: if it is destroyed, callback will not be called

 

tp_connection_unref_handles ()

void
tp_connection_unref_handles (TpConnection *self,
                             TpHandleType handle_type,
                             guint n_handles,
                             const TpHandle *handles);

tp_connection_unref_handles is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. In versions of telepathy-glib prior to 0.13.8, this released a reference to the handles in handles .

Parameters

self

a connection

 

handle_type

a handle type

 

n_handles

the number of handles in handles

 

handles

an array of n_handles handles.

[array length=n_handles]

tp_connection_init_known_interfaces ()

void
tp_connection_init_known_interfaces (void);

Ensure that the known interfaces for TpConnection have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CONNECTION.

Since: 0.7.6


tp_connection_presence_type_cmp_availability ()

gint
tp_connection_presence_type_cmp_availability
                               (TpConnectionPresenceType p1,
                                TpConnectionPresenceType p2);

Compares p1 and p2 like strcmp(). p1 > p2 means p1 is more available than p2 .

The order used is: available > busy > away > xa > hidden > offline > error > unknown > unset

Returns

-1, 0 or 1, if p1 is <, == or > than p2 .

Since: 0.7.16


tp_connection_parse_object_path ()

gboolean
tp_connection_parse_object_path (TpConnection *self,
                                 gchar **protocol,
                                 gchar **cm_name);

tp_connection_parse_object_path is deprecated and should not be used in newly-written code.

Use tp_connection_get_protocol_name() and tp_connection_get_connection_manager_name() instead.

If the object path of connection is in the correct form, set protocol and cm_name , return TRUE. Otherwise leave them unchanged and return FALSE.

Parameters

self

a connection

 

protocol

If not NULL, used to return the protocol of the connection.

[out][transfer full]

cm_name

If not NULL, used to return the connection manager name of the connection.

[out][transfer full]

Returns

TRUE if the object path was correctly parsed, FALSE otherwise.

Since: 0.7.27


tp_connection_get_capabilities ()

TpCapabilities *
tp_connection_get_capabilities (TpConnection *self);

Parameters

self

a connection

 

Returns

the same TpCapabilities as the “capabilities” property.

[transfer none]

Since: 0.11.3


tp_connection_get_avatar_requirements ()

TpAvatarRequirements *
tp_connection_get_avatar_requirements (TpConnection *self);

To wait for valid avatar requirements, call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS.

This property cannot change after self goes to the Connected state.

Parameters

self

a connection

 

Returns

a TpAvatarRequirements struct, or NULL if the feature is not yet prepared or the connection doesn't have the necessary properties.

[transfer none]

Since: 0.11.4


tp_connection_get_contact_info_flags ()

TpContactInfoFlags
tp_connection_get_contact_info_flags (TpConnection *self);

Returns the flags describing how contact info (vCards) behaves on this connection

To wait for valid contact info flags, call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_INFO.

This property cannot change after self goes to the Connected state.

Parameters

self

a connection

 

Returns

a set of TpContactInfoFlags

Since: 0.11.7


tp_connection_get_contact_info_supported_fields ()

GList *
tp_connection_get_contact_info_supported_fields
                               (TpConnection *self);

tp_connection_get_contact_info_supported_fields is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_connection_dup_contact_info_supported_fields() instead.

Returns a newly allocated GList of supported contact info fields for this connection. The list must be freed with g_list_free() after used.

Note that the TpContactInfoFieldSpecs in the returned GList are not dupped before returning from this function. One could copy every item in the list using tp_contact_info_field_spec_copy().

To wait for valid supported fields, call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_INFO.

This property cannot change after self goes to the Connected state.

Parameters

self

a connection

 

Returns

a GList of TpContactInfoFieldSpec struct, or NULL if the feature is not yet prepared or the connection doesn't have the necessary properties.

[element-type TelepathyGLib.ContactInfoFieldSpec][transfer container]

Since: 0.11.7


tp_connection_dup_contact_info_supported_fields ()

GList *
tp_connection_dup_contact_info_supported_fields
                               (TpConnection *self);

Returns a newly allocated GList of supported contact info fields for this connection. The list must be freed with tp_contact_info_spec_list_free().

To wait for valid supported fields, call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_INFO.

This property cannot change after self goes to the Connected state.

Parameters

self

a connection

 

Returns

a GList of TpContactInfoFieldSpec struct, or NULL if the feature is not yet prepared or the connection doesn't have the necessary properties.

[element-type TelepathyGLib.ContactInfoFieldSpec][transfer full]

Since: 0.19.9


tp_connection_set_contact_info_async ()

void
tp_connection_set_contact_info_async (TpConnection *self,
                                      GList *info,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Requests an asynchronous set of the contact info of self . When the operation is finished, callback will be called. You can then call tp_connection_set_contact_info_finish() to get the result of the operation.

This method should not be expected to succeed if the result of tp_connection_get_contact_info_flags() does not include TP_CONTACT_INFO_FLAG_CAN_SET.

Parameters

self

a TpConnection

 

info

a GList of TpContactInfoField.

[element-type TelepathyGLib.ContactInfoField]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.7


tp_connection_set_contact_info_finish ()

gboolean
tp_connection_set_contact_info_finish (TpConnection *self,
                                       GAsyncResult *result,
                                       GError **error);

Finishes an async set of self info.

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the request call was successful, otherwise FALSE

Since: 0.11.7


tp_connection_get_detailed_error ()

const gchar *
tp_connection_get_detailed_error (TpConnection *self,
                                  const GHashTable **details);

If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is TP_ERROR_STR_CANCELLED if it was disconnected by a user request).

Otherwise, return NULL, without altering details .

Parameters

self

a connection

 

details

optionally used to return a map from string to GValue, which must not be modified or destroyed by the caller.

[out][allow-none][element-type utf8 GObject.Value][transfer none]

Returns

a D-Bus error name, or NULL.

[transfer none][allow-none]

Since: 0.11.4


tp_connection_dup_detailed_error_vardict ()

gchar *
tp_connection_dup_detailed_error_vardict
                               (TpConnection *self,
                                GVariant **details);

If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is TP_ERROR_STR_CANCELLED if it was disconnected by a user request).

Otherwise, return NULL, without altering details .

Parameters

self

a connection

 

details

optionally used to return a G_VARIANT_TYPE_VARDICT with details of the error.

[out][allow-none][transfer full]

Returns

a D-Bus error name, or NULL.

[transfer full][allow-none]

Since: 0.19.0


tp_connection_add_client_interest ()

void
tp_connection_add_client_interest (TpConnection *self,
                                   const gchar *interested_in);

Subscribe to any opt-in change notifications for interested_in .

For contact information, use TpContact instead, which will call this automatically.

Parameters

self

a connection

 

interested_in

a string identifying an interface or part of an interface to which this connection will subscribe

 

Since: 0.11.3


tp_connection_add_client_interest_by_id ()

void
tp_connection_add_client_interest_by_id
                               (TpConnection *self,
                                GQuark interested_in);

Subscribe to any opt-in change notifications for interested_in .

Equivalent to, but a little more efficient than, calling tp_connection_add_client_interest() for the string value of interested_in .

[skip]

Parameters

self

a connection

 

interested_in

a quark identifying an interface or part of an interface to which this connection will subscribe

 

Since: 0.11.3


tp_connection_bind_connection_status_to_property ()

GBinding *
tp_connection_bind_connection_status_to_property
                               (TpConnection *self,
                                gpointer target,
                                const char *target_property,
                                gboolean invert);

Binds the :status of self to the boolean property of another object using a GBinding such that the target_property will be set to TRUE when self is connected (and invert is FALSE).

target_property will be synchronised immediately (G_BINDING_SYNC_CREATE). invert can be interpreted as analogous to G_BINDING_INVERT_BOOLEAN.

For instance, this function can be used to bind the GtkWidget:sensitive property to only make a widget sensitive when the account is connected.

See g_object_bind_property() for more information.

Parameters

self

a TpConnection

 

target

the target GObject

 

target_property

the property on target to bind (must be G_TYPE_BOOLEAN)

 

invert

TRUE if you wish to invert the value of target_property (i.e. FALSE if connected)

 

Returns

the GBinding instance representing the binding between the self and the target . The binding is released whenever the GBinding reference count reaches zero.

[transfer none]

Since: 0.13.16


tp_connection_get_balance ()

gboolean
tp_connection_get_balance (TpConnection *self,
                           gint *balance,
                           guint *scale,
                           const gchar **currency);

If self has a valid account balance, returns TRUE and sets the variables pointed to by balance , scale and currency to the appropriate fields of the Balance.AccountBalance property.

The monetary value of the balance is expressed as a fixed-point number, balance , with a decimal scale defined by scale ; for instance a balance of 1234 with scale of 2 represents a value of "12.34" in the currency represented by currency .

Requires TP_CONNECTION_FEATURE_BALANCE to be prepared.

Parameters

self

a TpConnection

 

balance

a pointer to store the account balance (or NULL).

[out]

scale

a pointer to store the balance scale (or NULL).

[out]

currency

a pointer to store the balance currency (or NULL).

[out][transfer none]

Returns

TRUE if the balance is valid (and the values set), FALSE if the balance is invalid.

Since: 0.15.1


tp_connection_get_balance_uri ()

const gchar *
tp_connection_get_balance_uri (TpConnection *self);

The value of Balance.ManageCreditURI.

Requires TP_CONNECTION_FEATURE_BALANCE to be prepared.

Parameters

self

a TpConnection

 

Returns

the “balance-uri” property.

[transfer none]

Since: 0.15.1


tp_avatar_requirements_new ()

TpAvatarRequirements *
tp_avatar_requirements_new (GStrv supported_mime_types,
                            guint minimum_width,
                            guint minimum_height,
                            guint recommended_width,
                            guint recommended_height,
                            guint maximum_width,
                            guint maximum_height,
                            guint maximum_bytes);

Parameters

supported_mime_types

An array of supported MIME types (e.g. "image/jpeg") Clients MAY assume that the first type in this array is preferred

 

minimum_width

The minimum width in pixels of an avatar, which MAY be 0

 

minimum_height

The minimum height in pixels of an avatar, which MAY be 0

 

recommended_width

The recommended width in pixels of an avatar, or 0 if there is no preferred width.

 

recommended_height

The recommended height in pixels of an avatar, or 0 if there is no preferred height

 

maximum_width

The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit.

 

maximum_height

The maximum height in pixels of an avatar, or 0 if there is no limit.

 

maximum_bytes

he maximum size in bytes of an avatar, or 0 if there is no limit.

 

Returns

a newly allocated TpAvatarRequirements, free it with tp_avatar_requirements_destroy()

Since: 0.11.4


tp_avatar_requirements_copy ()

TpAvatarRequirements *
tp_avatar_requirements_copy (const TpAvatarRequirements *self);

[skip]

Parameters

Returns

a newly allocated TpAvatarRequirements, free it with tp_avatar_requirements_destroy()

Since: 0.11.4


tp_avatar_requirements_destroy ()

void
tp_avatar_requirements_destroy (TpAvatarRequirements *self);

Free all memory used by the TpAvatarRequirements.

[skip]

Parameters

Since: 0.11.4


tp_contact_info_field_spec_copy ()

TpContactInfoFieldSpec *
tp_contact_info_field_spec_copy (const TpContactInfoFieldSpec *self);

[skip]

Parameters

Returns

a newly allocated TpContactInfoFieldSpec, free it with tp_contact_info_field_spec_free()

Since: 0.11.7


tp_contact_info_field_spec_free ()

void
tp_contact_info_field_spec_free (TpContactInfoFieldSpec *self);

Free all memory used by the TpContactInfoFieldSpec.

[skip]

Parameters

Since: 0.11.7


tp_contact_info_spec_list_copy ()

GList *
tp_contact_info_spec_list_copy (GList *list);

[skip]

Parameters

list

a GList of TpContactInfoFieldSpec

 

Returns

a new GList of newly allocated TpContactInfoFieldSpec, free it with tp_contact_info_spec_list_free()

Since: 0.11.7


tp_contact_info_spec_list_free ()

void
tp_contact_info_spec_list_free (GList *list);

Free all memory used by the GList and its elements.

[skip]

Parameters

list

a GList of TpContactInfoFieldSpec

 

Since: 0.11.7


tp_contact_info_field_new ()

TpContactInfoField *
tp_contact_info_field_new (const gchar *field_name,
                           GStrv parameters,
                           GStrv field_value);

Parameters

field_name

The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr".

 

parameters

A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'.

 

field_value

For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value. For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements).

 

Returns

a newly allocated TpContactInfoField, free it with tp_contact_info_field_free()

Since: 0.11.7


tp_contact_info_field_copy ()

TpContactInfoField *
tp_contact_info_field_copy (const TpContactInfoField *self);

[skip]

Parameters

self

a TpContactInfoField

 

Returns

a newly allocated TpContactInfoField, free it with tp_contact_info_field_free()

Since: 0.11.7


tp_contact_info_field_free ()

void
tp_contact_info_field_free (TpContactInfoField *self);

Free all memory used by the TpContactInfoField.

[skip]

Parameters

self

a TpContactInfoField

 

Since: 0.11.7


tp_contact_info_list_copy ()

GList *
tp_contact_info_list_copy (GList *list);

[skip]

Parameters

list

a GList of TpContactInfoField

 

Returns

a new GList of newly allocated TpContactInfoField, free it with tp_contact_info_list_free()

Since: 0.11.7


tp_contact_info_list_free ()

void
tp_contact_info_list_free (GList *list);

Free all memory used by the GList and its elements.

[skip]

Parameters

list

a GList of TpContactInfoField

 

Since: 0.11.7


tp_connection_get_contact_list_state ()

TpContactListState
tp_connection_get_contact_list_state (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “contact-list-state” property

Since: 0.15.5


tp_connection_get_contact_list_persists ()

gboolean
tp_connection_get_contact_list_persists
                               (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “contact-list-persists” property

Since: 0.15.5


tp_connection_get_can_change_contact_list ()

gboolean
tp_connection_get_can_change_contact_list
                               (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “can-change-contact-list” property

Since: 0.15.5


tp_connection_get_request_uses_message ()

gboolean
tp_connection_get_request_uses_message
                               (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “request-uses-message” property

Since: 0.15.5


tp_connection_dup_contact_list ()

GPtrArray *
tp_connection_dup_contact_list (TpConnection *self);

Retrieves the user's contact list. In general, blocked contacts are not included in this list. The TpContact objects returned are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Before calling this method, you must first call tp_proxy_prepare_async() with the TP_CONNECTION_FEATURE_CONTACT_LIST feature, and verify that “contact-list-state” is set to TP_CONTACT_LIST_STATE_SUCCESS.

Parameters

self

a TpConnection

 

Returns

a new GPtrArray of TpContact. Use g_ptr_array_unref() when done.

[transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]

Since: 0.15.5


tp_connection_request_subscription_async ()

void
tp_connection_request_subscription_async
                               (TpConnection *self,
                                guint n_contacts,
                                TpContact * const *contacts,
                                const gchar *message,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request that the given contacts allow the local user to subscribe to their presence, i.e. that their “subscribe-state” property becomes TP_SUBSCRIPTION_STATE_YES.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to whom requests are to be sent.

[array length=n_contacts]

message

an optional plain-text message from the user, to send to those contacts with the subscription request.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_request_subscription_finish ()

gboolean
tp_connection_request_subscription_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_request_subscription_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_authorize_publication_async ()

void
tp_connection_authorize_publication_async
                               (TpConnection *self,
                                guint n_contacts,
                                TpContact * const *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

For each of the given contacts , request that the local user's presence is sent to that contact, i.e. that their “publish-state” property becomes TP_SUBSCRIPTION_STATE_YES.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to authorize.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_authorize_publication_finish ()

gboolean
tp_connection_authorize_publication_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_authorize_publication_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_remove_contacts_async ()

void
tp_connection_remove_contacts_async (TpConnection *self,
                                     guint n_contacts,
                                     TpContact * const *contacts,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Remove the given contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to remove.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_remove_contacts_finish ()

gboolean
tp_connection_remove_contacts_finish (TpConnection *self,
                                      GAsyncResult *result,
                                      GError **error);

Finishes tp_connection_remove_contacts_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_unsubscribe_async ()

void
tp_connection_unsubscribe_async (TpConnection *self,
                                 guint n_contacts,
                                 TpContact * const *contacts,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

Attempt to set the given contacts ' “subscribe-state” property to TP_SUBSCRIPTION_STATE_NO, i.e. stop receiving their presence.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to remove.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_unsubscribe_finish ()

gboolean
tp_connection_unsubscribe_finish (TpConnection *self,
                                  GAsyncResult *result,
                                  GError **error);

Finishes tp_connection_unsubscribe_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_unpublish_async ()

void
tp_connection_unpublish_async (TpConnection *self,
                               guint n_contacts,
                               TpContact * const *contacts,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Attempt to set the given contacts ' “publish-state” property to TP_SUBSCRIPTION_STATE_NO, i.e. stop sending presence to them.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to remove.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_unpublish_finish ()

gboolean
tp_connection_unpublish_finish (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_unpublish_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_get_disjoint_groups ()

gboolean
tp_connection_get_disjoint_groups (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “disjoint-groups”

Since: 0.15.5


tp_connection_get_group_storage ()

TpContactMetadataStorageType
tp_connection_get_group_storage (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “group-storage”

Since: 0.15.5


tp_connection_get_contact_groups ()

const gchar * const *
tp_connection_get_contact_groups (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “contact-groups”.

[array zero-terminated=1][transfer none]

Since: 0.15.5


tp_connection_set_group_members_async ()

void
tp_connection_set_group_members_async (TpConnection *self,
                                       const gchar *group,
                                       guint n_contacts,
                                       TpContact * const *contacts,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Add the given contacts to the given group (creating it if necessary), and remove all other members.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

group

the group to alter.

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects members for the group. If this set is empty, this method MAY remove the group.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_set_group_members_finish ()

gboolean
tp_connection_set_group_members_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_set_group_members_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_add_to_group_async ()

void
tp_connection_add_to_group_async (TpConnection *self,
                                  const gchar *group,
                                  guint n_contacts,
                                  TpContact * const *contacts,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Add the given contacts to the given group , creating it if necessary.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

group

the group to alter.

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to include in the group.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_add_to_group_finish ()

gboolean
tp_connection_add_to_group_finish (TpConnection *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_connection_add_to_group_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_remove_from_group_async ()

void
tp_connection_remove_from_group_async (TpConnection *self,
                                       const gchar *group,
                                       guint n_contacts,
                                       TpContact * const *contacts,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Remove the given contacts from the given group . If there are no members left in the group afterwards, the group MAY itself be removed.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

group

the group to alter.

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to remove from the group.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_remove_from_group_finish ()

gboolean
tp_connection_remove_from_group_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_remove_from_group_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_remove_group_async ()

void
tp_connection_remove_group_async (TpConnection *self,
                                  const gchar *group,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Remove all members from the given group, then remove the group itself.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

group

the group to remove.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_remove_group_finish ()

gboolean
tp_connection_remove_group_finish (TpConnection *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_connection_remove_group_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_rename_group_async ()

void
tp_connection_rename_group_async (TpConnection *self,
                                  const gchar *old_name,
                                  const gchar *new_name,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Rename the given old_name .

On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group.

For this to work properly self must have interface TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

old_name

the group to rename

 

new_name

the new name for the group

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_connection_rename_group_finish ()

gboolean
tp_connection_rename_group_finish (TpConnection *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_connection_rename_group_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_connection_block_contacts_async ()

void
tp_connection_block_contacts_async (TpConnection *self,
                                    guint n_contacts,
                                    TpContact * const *contacts,
                                    gboolean report_abusive,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Direct the server to block contacts .

Parameters

self

a TpConnection

 

n_contacts

the number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to block.

[array length=n_contacts]

report_abusive

If TRUE, report these contacts as abusive to the server administrators as well as blocking them. See “can-report-abusive” to discover whether reporting abuse is supported. If “can-report-abusive” is FALSE, this parameter will be ignored.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.0


tp_connection_block_contacts_finish ()

gboolean
tp_connection_block_contacts_finish (TpConnection *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes tp_connection_block_contacts_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.17.0


tp_connection_unblock_contacts_async ()

void
tp_connection_unblock_contacts_async (TpConnection *self,
                                      guint n_contacts,
                                      TpContact * const *contacts,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Direct the server to unblock contacts .

Parameters

self

a TpConnection

 

n_contacts

the number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects to block.

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.0


tp_connection_unblock_contacts_finish ()

gboolean
tp_connection_unblock_contacts_finish (TpConnection *self,
                                       GAsyncResult *result,
                                       GError **error);

Finishes tp_connection_unblock_contacts_async()

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.17.0


tp_connection_can_report_abusive ()

gboolean
tp_connection_can_report_abusive (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “can-report-abusive”

Since: 0.17.0


tp_connection_get_blocked_contacts ()

GPtrArray *
tp_connection_get_blocked_contacts (TpConnection *self);

Parameters

self

a TpConnection

 

Returns

the value of “blocked-contacts”.

[transfer none][element-type TelepathyGLib.Contact]

Since: 0.17.0


tp_connection_can_set_contact_alias ()

gboolean
tp_connection_can_set_contact_alias (TpConnection *self);

Check if the user can set aliases on his contacts. TP_CONNECTION_FEATURE_ALIASING needs to be prepared for this function to return a meaningful value.

Parameters

self

a TpConnection

 

Returns

TRUE if the aliases of contacts on self may be changed by the user of the service, not just by the contacts themselves; FALSE otherwise.

Since: 0.17.3


tp_cli_connection_callback_for_connect ()

void
(*tp_cli_connection_callback_for_connect)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Connect method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_connect ()

TpProxyPendingCall *
tp_cli_connection_call_connect (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_callback_for_connect callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Connect method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the connection be established. This will be done asynchronously and errors will be returned by emitting <tp:member-ref>StatusChanged</tp:member-ref> signals.</p> <p>Calling this method on a Connection that is already connecting or connected is allowed, and has no effect.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_connect ()

gboolean
tp_cli_connection_run_connect (TpConnection *proxy,
                               gint timeout_ms,
                               GError **error,
                               GMainLoop **loop);

tp_cli_connection_run_connect is deprecated and should not be used in newly-written code.

Call the method Connect and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the connection be established. This will be done asynchronously and errors will be returned by emitting <tp:member-ref>StatusChanged</tp:member-ref> signals.</p> <p>Calling this method on a Connection that is already connecting or connected is allowed, and has no effect.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_disconnect ()

void
(*tp_cli_connection_callback_for_disconnect)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Disconnect method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_disconnect ()

TpProxyPendingCall *
tp_cli_connection_call_disconnect (TpConnection *proxy,
                                   gint timeout_ms,
                                   tp_cli_connection_callback_for_disconnect callback,
                                   gpointer user_data,
                                   GDestroyNotify destroy,
                                   GObject *weak_object);

Start a Disconnect method call.

Request that the connection be closed. This closes the connection if it's not already in DISCONNECTED state, and destroys the connection object.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_disconnect ()

gboolean
tp_cli_connection_run_disconnect (TpConnection *proxy,
                                  gint timeout_ms,
                                  GError **error,
                                  GMainLoop **loop);

tp_cli_connection_run_disconnect is deprecated and should not be used in newly-written code.

Call the method Disconnect and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that the connection be closed. This closes the connection if it's not already in DISCONNECTED state, and destroys the connection object.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_get_interfaces ()

void
(*tp_cli_connection_callback_for_get_interfaces)
                               (TpConnection *proxy,
                                const gchar **out_Interfaces,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetInterfaces method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Interfaces

Used to return an 'out' argument if error is NULL: The value of the <tp:member-ref>Interfaces</tp:member-ref> property

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_get_interfaces ()

TpProxyPendingCall *
tp_cli_connection_call_get_interfaces (TpConnection *proxy,
                                       gint timeout_ms,
                                       tp_cli_connection_callback_for_get_interfaces callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

Start a GetInterfaces method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Returns the set of optional interfaces supported by this connection. See <tp:member-ref>Interfaces</tp:member-ref> for more details.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_get_interfaces ()

gboolean
tp_cli_connection_run_get_interfaces (TpConnection *proxy,
                                      gint timeout_ms,
                                      gchar ***out_Interfaces,
                                      GError **error,
                                      GMainLoop **loop);

tp_cli_connection_run_get_interfaces is deprecated and should not be used in newly-written code.

Call the method GetInterfaces and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Returns the set of optional interfaces supported by this connection. See <tp:member-ref>Interfaces</tp:member-ref> for more details.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Interfaces

Used to return an 'out' argument if TRUE is returned: The value of the <tp:member-ref>Interfaces</tp:member-ref> property

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_get_protocol ()

void
(*tp_cli_connection_callback_for_get_protocol)
                               (TpConnection *proxy,
                                const gchar *out_Protocol,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetProtocol method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Protocol

Used to return an 'out' argument if error is NULL: A string identifier for the protocol

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_get_protocol ()

TpProxyPendingCall *
tp_cli_connection_call_get_protocol (TpConnection *proxy,
                                     gint timeout_ms,
                                     tp_cli_connection_callback_for_get_protocol callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy,
                                     GObject *weak_object);

Start a GetProtocol method call.

Get the protocol this connection is using.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_get_protocol ()

gboolean
tp_cli_connection_run_get_protocol (TpConnection *proxy,
                                    gint timeout_ms,
                                    gchar **out_Protocol,
                                    GError **error,
                                    GMainLoop **loop);

tp_cli_connection_run_get_protocol is deprecated and should not be used in newly-written code.

Call the method GetProtocol and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the protocol this connection is using.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Protocol

Used to return an 'out' argument if TRUE is returned: A string identifier for the protocol

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_get_self_handle ()

void
(*tp_cli_connection_callback_for_get_self_handle)
                               (TpConnection *proxy,
                                guint out_Self_Handle,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_callback_for_get_self_handle is deprecated and should not be used in newly-written code.

Use GetAll to get the SelfHandle property (and all other Connection properties) instead.

Signature of the callback called when a GetSelfHandle method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Self_Handle

Used to return an 'out' argument if error is NULL: The value of the <tp:member-ref>SelfHandle</tp:member-ref> property (TpContactHandle)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_get_self_handle ()

TpProxyPendingCall *
tp_cli_connection_call_get_self_handle
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_callback_for_get_self_handle callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_connection_call_get_self_handle is deprecated and should not be used in newly-written code.

Use GetAll to get the SelfHandle property (and all other Connection properties) instead.

Start a GetSelfHandle method call.

Returns the value of the SelfHandle property. Change notification is via the SelfHandleChanged signal.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_get_self_handle ()

gboolean
tp_cli_connection_run_get_self_handle (TpConnection *proxy,
                                       gint timeout_ms,
                                       guint *out_Self_Handle,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_connection_run_get_self_handle is deprecated and should not be used in newly-written code.

Use GetAll to get the SelfHandle property (and all other Connection properties) instead.

Call the method GetSelfHandle and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the value of the SelfHandle property. Change notification is via the SelfHandleChanged signal.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Self_Handle

Used to return an 'out' argument if TRUE is returned: The value of the <tp:member-ref>SelfHandle</tp:member-ref> property

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_get_status ()

void
(*tp_cli_connection_callback_for_get_status)
                               (TpConnection *proxy,
                                guint out_Status,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetStatus method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Status

Used to return an 'out' argument if error is NULL: The value of the <tp:member-ref>Status</tp:member-ref> property (TpConnectionStatus)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_get_status ()

TpProxyPendingCall *
tp_cli_connection_call_get_status (TpConnection *proxy,
                                   gint timeout_ms,
                                   tp_cli_connection_callback_for_get_status callback,
                                   gpointer user_data,
                                   GDestroyNotify destroy,
                                   GObject *weak_object);

Start a GetStatus method call.

Get the current status as defined in the <tp:member-ref>StatusChanged</tp:member-ref> signal.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_get_status ()

gboolean
tp_cli_connection_run_get_status (TpConnection *proxy,
                                  gint timeout_ms,
                                  guint *out_Status,
                                  GError **error,
                                  GMainLoop **loop);

tp_cli_connection_run_get_status is deprecated and should not be used in newly-written code.

Call the method GetStatus and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the current status as defined in the <tp:member-ref>StatusChanged</tp:member-ref> signal.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Status

Used to return an 'out' argument if TRUE is returned: The value of the <tp:member-ref>Status</tp:member-ref> property

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_hold_handles ()

void
(*tp_cli_connection_callback_for_hold_handles)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a HoldHandles method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_hold_handles ()

TpProxyPendingCall *
tp_cli_connection_call_hold_handles (TpConnection *proxy,
                                     gint timeout_ms,
                                     guint in_Handle_Type,
                                     const GArray *in_Handles,
                                     tp_cli_connection_callback_for_hold_handles callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy,
                                     GObject *weak_object);

Start a HoldHandles method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.</p> <p>In older connection managers, this method notifies the connection manger that your client is holding a copy of handles which may not be in use in any existing channel or list, and were not obtained by using the <tp:member-ref>RequestHandles</tp:member-ref> method. For example, a handle observed in an emitted signal, or displayed somewhere in the UI that is not associated with a channel. The connection manager must not deallocate a handle where any clients have used this method to indicate it is in use until the <tp:member-ref>ReleaseHandles</tp:member-ref> method is called, or the clients disappear from the bus.</p> <p>Note that HoldHandles is idempotent - calling it multiple times is equivalent to calling it once. If a handle is &quot;referenced&quot; by several components which share a D-Bus unique name, the client should perform reference counting internally, and only call ReleaseHandles when none of the cooperating components need the handle any longer.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle to be held (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: A array of integer handles to hold

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_hold_handles ()

gboolean
tp_cli_connection_run_hold_handles (TpConnection *proxy,
                                    gint timeout_ms,
                                    guint in_Handle_Type,
                                    const GArray *in_Handles,
                                    GError **error,
                                    GMainLoop **loop);

tp_cli_connection_run_hold_handles is deprecated and should not be used in newly-written code.

Call the method HoldHandles and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.</p> <p>In older connection managers, this method notifies the connection manger that your client is holding a copy of handles which may not be in use in any existing channel or list, and were not obtained by using the <tp:member-ref>RequestHandles</tp:member-ref> method. For example, a handle observed in an emitted signal, or displayed somewhere in the UI that is not associated with a channel. The connection manager must not deallocate a handle where any clients have used this method to indicate it is in use until the <tp:member-ref>ReleaseHandles</tp:member-ref> method is called, or the clients disappear from the bus.</p> <p>Note that HoldHandles is idempotent - calling it multiple times is equivalent to calling it once. If a handle is &quot;referenced&quot; by several components which share a D-Bus unique name, the client should perform reference counting internally, and only call ReleaseHandles when none of the cooperating components need the handle any longer.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle to be held (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: A array of integer handles to hold

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_inspect_handles ()

void
(*tp_cli_connection_callback_for_inspect_handles)
                               (TpConnection *proxy,
                                const gchar **out_Identifiers,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a InspectHandles method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Identifiers

Used to return an 'out' argument if error is NULL: An array of identifiers corresponding to the given handles, in the same order.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_inspect_handles ()

TpProxyPendingCall *
tp_cli_connection_call_inspect_handles
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Handle_Type,
                                const GArray *in_Handles,
                                tp_cli_connection_callback_for_inspect_handles callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a InspectHandles method call.

Return a string representation for a number of handles of a given type.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle to be inspected (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: An array of integer handles of this type

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_inspect_handles ()

gboolean
tp_cli_connection_run_inspect_handles (TpConnection *proxy,
                                       gint timeout_ms,
                                       guint in_Handle_Type,
                                       const GArray *in_Handles,
                                       gchar ***out_Identifiers,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_connection_run_inspect_handles is deprecated and should not be used in newly-written code.

Call the method InspectHandles and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Return a string representation for a number of handles of a given type.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle to be inspected (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: An array of integer handles of this type

 

out_Identifiers

Used to return an 'out' argument if TRUE is returned: An array of identifiers corresponding to the given handles, in the same order.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_list_channels ()

void
(*tp_cli_connection_callback_for_list_channels)
                               (TpConnection *proxy,
                                const GPtrArray *out_Channel_Info,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_callback_for_list_channels is deprecated and should not be used in newly-written code.

Use the Requests.Channels property instead.

Signature of the callback called when a ListChannels method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Channel_Info

Used to return an 'out' argument if error is NULL: An array of structs representing channels.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_list_channels ()

TpProxyPendingCall *
tp_cli_connection_call_list_channels (TpConnection *proxy,
                                      gint timeout_ms,
                                      tp_cli_connection_callback_for_list_channels callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

tp_cli_connection_call_list_channels is deprecated and should not be used in newly-written code.

Use the Requests.Channels property instead.

Start a ListChannels method call.

List all the channels which currently exist on this connection.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_list_channels ()

gboolean
tp_cli_connection_run_list_channels (TpConnection *proxy,
                                     gint timeout_ms,
                                     GPtrArray **out_Channel_Info,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_connection_run_list_channels is deprecated and should not be used in newly-written code.

Use the Requests.Channels property instead.

Call the method ListChannels and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

List all the channels which currently exist on this connection.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Channel_Info

Used to return an 'out' argument if TRUE is returned: An array of structs representing channels.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_release_handles ()

void
(*tp_cli_connection_callback_for_release_handles)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReleaseHandles method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_release_handles ()

TpProxyPendingCall *
tp_cli_connection_call_release_handles
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Handle_Type,
                                const GArray *in_Handles,
                                tp_cli_connection_callback_for_release_handles callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ReleaseHandles method call.

<p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.</p> <p>In older connection managers, this method explicitly notifies the connection manager that your client is no longer holding any references to the given handles, and that they may be deallocated if they are not held by any other clients or referenced by any existing channels. See <tp:member-ref>HoldHandles</tp:member-ref> for notes.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handle_Type

Used to pass an 'in' argument: An integer handle type (as defined in RequestHandle) (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: An array of integer handles being held by the client

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_release_handles ()

gboolean
tp_cli_connection_run_release_handles (TpConnection *proxy,
                                       gint timeout_ms,
                                       guint in_Handle_Type,
                                       const GArray *in_Handles,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_connection_run_release_handles is deprecated and should not be used in newly-written code.

Call the method ReleaseHandles and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.</p> <p>In older connection managers, this method explicitly notifies the connection manager that your client is no longer holding any references to the given handles, and that they may be deallocated if they are not held by any other clients or referenced by any existing channels. See <tp:member-ref>HoldHandles</tp:member-ref> for notes.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handle_Type

Used to pass an 'in' argument: An integer handle type (as defined in RequestHandle) (TpHandleType)

 

in_Handles

Used to pass an 'in' argument: An array of integer handles being held by the client

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_request_channel ()

void
(*tp_cli_connection_callback_for_request_channel)
                               (TpConnection *proxy,
                                const gchar *out_Object_Path,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_callback_for_request_channel is deprecated and should not be used in newly-written code.

Use Requests.CreateChannel or Requests.EnsureChannel instead. Connection managers MAY implement RequestChannel by raising NotImplemented, or implement fewer types of channel via this API.

Signature of the callback called when a RequestChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Object_Path

Used to return an 'out' argument if error is NULL: The D-Bus object path for the channel created or retrieved

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_request_channel ()

TpProxyPendingCall *
tp_cli_connection_call_request_channel
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Type,
                                guint in_Handle_Type,
                                guint in_Handle,
                                gboolean in_Suppress_Handler,
                                tp_cli_connection_callback_for_request_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_connection_call_request_channel is deprecated and should not be used in newly-written code.

Use Requests.CreateChannel or Requests.EnsureChannel instead. Connection managers MAY implement RequestChannel by raising NotImplemented, or implement fewer types of channel via this API.

Start a RequestChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a channel satisfying the specified type and communicating with the contact, room, list etc. indicated by the given handle_type and handle. The handle_type and handle may both be zero to request the creation of a new, empty channel, which may or may not be possible, depending on the protocol and channel type.</p> <p>On success, the returned channel will always be of the requested type (i.e. implement the requested channel-type interface).</p> <p>If a new, empty channel is requested, on success the returned channel will always be an &quot;anonymous&quot; channel for which the type and handle are both zero.</p> <p>If a channel to a contact, room etc. is requested, on success, the returned channel may either be a new or existing channel to the requested entity (i.e. its <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandleType</tp:dbus-ref> and <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref> properties are the requested handle type and handle), or a newly created &quot;anonymous&quot; channel associated with the requested handle in some implementation-specific way.</p> <p>For example, for a contact handle, the returned channel might be &quot;anonymous&quot;, but implement the groups interface and have the requested contact already present among the members.</p> <p>If the request cannot be satisfied, an error is raised and no channel is created.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Type

Used to pass an 'in' argument: A D-Bus interface name representing base channel type

 

in_Handle_Type

Used to pass an 'in' argument: An integer representing the handle type, or Handle_Type_None if no handle is specified (TpHandleType)

 

in_Handle

Used to pass an 'in' argument: A nonzero integer handle representing a contact, room, list etc. according to handle_type, or zero if the handle_type is Handle_Type_None (TpHandle)

 

in_Suppress_Handler

Used to pass an 'in' argument: <p>Clients SHOULD always set this to true.</p> <tp:rationale> <p>The historical meaning was that clients that did not intend to take responsibility for displaying the channel to the user could set this to FALSE, in which case the channel dispatcher would launch an appropriate channel handler.</p> <p>However, clients whose functionality relies on having a working channel dispatcher should obtain that functionality by calling methods on the channel dispatcher, so that they will get an appropriate error if the channel dispatcher is missing or not working.</p> <p>The channel dispatcher itself should set this to true too, so that it will ignore the <tp:member-ref>NewChannel</tp:member-ref> signal that results from the creation of the channel. It can then dispatch the channel returned from this method to an appropriate handler.</p> <p>So, there is no sensible use-case for setting this to false, and setting it to false can result in unhandled channels (in the case where clients assume that a channel dispatcher is present, but it isn't).</p> </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_request_channel ()

gboolean
tp_cli_connection_run_request_channel (TpConnection *proxy,
                                       gint timeout_ms,
                                       const gchar *in_Type,
                                       guint in_Handle_Type,
                                       guint in_Handle,
                                       gboolean in_Suppress_Handler,
                                       gchar **out_Object_Path,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_connection_run_request_channel is deprecated and should not be used in newly-written code.

Use Requests.CreateChannel or Requests.EnsureChannel instead. Connection managers MAY implement RequestChannel by raising NotImplemented, or implement fewer types of channel via this API.

Call the method RequestChannel and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a channel satisfying the specified type and communicating with the contact, room, list etc. indicated by the given handle_type and handle. The handle_type and handle may both be zero to request the creation of a new, empty channel, which may or may not be possible, depending on the protocol and channel type.</p> <p>On success, the returned channel will always be of the requested type (i.e. implement the requested channel-type interface).</p> <p>If a new, empty channel is requested, on success the returned channel will always be an &quot;anonymous&quot; channel for which the type and handle are both zero.</p> <p>If a channel to a contact, room etc. is requested, on success, the returned channel may either be a new or existing channel to the requested entity (i.e. its <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandleType</tp:dbus-ref> and <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref> properties are the requested handle type and handle), or a newly created &quot;anonymous&quot; channel associated with the requested handle in some implementation-specific way.</p> <p>For example, for a contact handle, the returned channel might be &quot;anonymous&quot;, but implement the groups interface and have the requested contact already present among the members.</p> <p>If the request cannot be satisfied, an error is raised and no channel is created.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Type

Used to pass an 'in' argument: A D-Bus interface name representing base channel type

 

in_Handle_Type

Used to pass an 'in' argument: An integer representing the handle type, or Handle_Type_None if no handle is specified (TpHandleType)

 

in_Handle

Used to pass an 'in' argument: A nonzero integer handle representing a contact, room, list etc. according to handle_type, or zero if the handle_type is Handle_Type_None (TpHandle)

 

in_Suppress_Handler

Used to pass an 'in' argument: <p>Clients SHOULD always set this to true.</p> <tp:rationale> <p>The historical meaning was that clients that did not intend to take responsibility for displaying the channel to the user could set this to FALSE, in which case the channel dispatcher would launch an appropriate channel handler.</p> <p>However, clients whose functionality relies on having a working channel dispatcher should obtain that functionality by calling methods on the channel dispatcher, so that they will get an appropriate error if the channel dispatcher is missing or not working.</p> <p>The channel dispatcher itself should set this to true too, so that it will ignore the <tp:member-ref>NewChannel</tp:member-ref> signal that results from the creation of the channel. It can then dispatch the channel returned from this method to an appropriate handler.</p> <p>So, there is no sensible use-case for setting this to false, and setting it to false can result in unhandled channels (in the case where clients assume that a channel dispatcher is present, but it isn't).</p> </tp:rationale>

 

out_Object_Path

Used to return an 'out' argument if TRUE is returned: The D-Bus object path for the channel created or retrieved

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_callback_for_request_handles ()

void
(*tp_cli_connection_callback_for_request_handles)
                               (TpConnection *proxy,
                                const GArray *out_Handles,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestHandles method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Handles

Used to return an 'out' argument if error is NULL: An array of integer handle numbers in the same order as the given identifiers.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_call_request_handles ()

TpProxyPendingCall *
tp_cli_connection_call_request_handles
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Handle_Type,
                                const gchar **in_Identifiers,
                                tp_cli_connection_callback_for_request_handles callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestHandles method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request several handles from the connection manager which represent a number of contacts, rooms or server-stored lists on the service.</p> <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, the handles remain valid until the connection disconnects.</p> <p>The implementation of this method in older connection managers must record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the <tp:member-ref>ReleaseHandles</tp:member-ref> method. Where the identifier refers to an entity that already has a handle in this connection manager, this handle should be returned instead. The handle number 0 must not be returned by the connection manager.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle required (TpHandleType)

 

in_Identifiers

Used to pass an 'in' argument: An array of identifiers of entities to request handles for

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_run_request_handles ()

gboolean
tp_cli_connection_run_request_handles (TpConnection *proxy,
                                       gint timeout_ms,
                                       guint in_Handle_Type,
                                       const gchar **in_Identifiers,
                                       GArray **out_Handles,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_connection_run_request_handles is deprecated and should not be used in newly-written code.

Call the method RequestHandles and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request several handles from the connection manager which represent a number of contacts, rooms or server-stored lists on the service.</p> <p>If <tp:member-ref>HasImmortalHandles</tp:member-ref> is true, which SHOULD always be the case in this version of telepathy-spec, the handles remain valid until the connection disconnects.</p> <p>The implementation of this method in older connection managers must record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the <tp:member-ref>ReleaseHandles</tp:member-ref> method. Where the identifier refers to an entity that already has a handle in this connection manager, this handle should be returned instead. The handle number 0 must not be returned by the connection manager.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handle_Type

Used to pass an 'in' argument: The type of handle required (TpHandleType)

 

in_Identifiers

Used to pass an 'in' argument: An array of identifiers of entities to request handles for

 

out_Handles

Used to return an 'out' argument if TRUE is returned: An array of integer handle numbers in the same order as the given identifiers.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_signal_callback_new_channel ()

void
(*tp_cli_connection_signal_callback_new_channel)
                               (TpConnection *proxy,
                                const gchar *arg_Object_Path,
                                const gchar *arg_Channel_Type,
                                guint arg_Handle_Type,
                                guint arg_Handle,
                                gboolean arg_Suppress_Handler,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewChannel.

Parameters

proxy

The proxy on which tp_cli_connection_connect_to_new_channel() was called

 

arg_Object_Path

A D-Bus object path for the channel object on this service

 

arg_Channel_Type

A D-Bus interface name representing the channel type

 

arg_Handle_Type

An integer representing the type of handle this channel communicates with, or Handle_Type_None if no handle is specified (TpHandleType)

 

arg_Handle

A handle indicating the specific contact, room or list this channel communicates with, or zero if no handle is specified (TpHandle)

 

arg_Suppress_Handler

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If true, the channel was requested by a client that intends to present it to the user itself (i.e. it passed suppress_handler=TRUE to the <tp:member-ref>RequestChannel</tp:member-ref> method), so no other handler should be launched. Clients MAY assume that channels where this is true were created by a user request.</p> <p>If false, either the channel was created due to incoming information from the service, or the channel was requested by a local client that does not intend to handle the channel itself (this usage is deprecated).</p> <p>Clients MUST NOT assume that only incoming channels will have this flag set to false.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_connect_to_new_channel ()

TpProxySignalConnection *
tp_cli_connection_connect_to_new_channel
                               (TpConnection *proxy,
                                tp_cli_connection_signal_callback_new_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewChannel.

Emitted when a new Channel object is created, either through user request or incoming information from the service.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_signal_callback_self_handle_changed ()

void
(*tp_cli_connection_signal_callback_self_handle_changed)
                               (TpConnection *proxy,
                                guint arg_Self_Handle,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SelfHandleChanged.

Parameters

proxy

The proxy on which tp_cli_connection_connect_to_self_handle_changed() was called

 

arg_Self_Handle

The new value of the SelfHandle property. (TpContactHandle)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_connect_to_self_handle_changed ()

TpProxySignalConnection *
tp_cli_connection_connect_to_self_handle_changed
                               (TpConnection *proxy,
                                tp_cli_connection_signal_callback_self_handle_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SelfHandleChanged.

Emitted whenever the <tp:member-ref>SelfHandle</tp:member-ref> property changes. If the connection is not yet in the CONNECTED state, this signal is not guaranteed to be emitted.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_signal_callback_self_contact_changed ()

void
(*tp_cli_connection_signal_callback_self_contact_changed)
                               (TpConnection *proxy,
                                guint arg_Self_Handle,
                                const gchar *arg_Self_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SelfContactChanged.

Parameters

proxy

The proxy on which tp_cli_connection_connect_to_self_contact_changed() was called

 

arg_Self_Handle

The new value of the SelfHandle property. (TpContactHandle)

 

arg_Self_ID

The new value of the SelfID property.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_connect_to_self_contact_changed ()

TpProxySignalConnection *
tp_cli_connection_connect_to_self_contact_changed
                               (TpConnection *proxy,
                                tp_cli_connection_signal_callback_self_contact_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SelfContactChanged.

Emitted whenever the <tp:member-ref>SelfHandle</tp:member-ref> and <tp:member-ref>SelfID</tp:member-ref> property changes. If the connection is not yet in the CONNECTED state, this signal is not guaranteed to be emitted.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_signal_callback_status_changed ()

void
(*tp_cli_connection_signal_callback_status_changed)
                               (TpConnection *proxy,
                                guint arg_Status,
                                guint arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StatusChanged.

Parameters

proxy

The proxy on which tp_cli_connection_connect_to_status_changed() was called

 

arg_Status

An integer indicating the new status, as defined by ConnectionStatus (TpConnectionStatus)

 

arg_Reason

An integer indicating the reason for the status change, as defined by ConnectionStatusReason (TpConnectionStatusReason)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_connect_to_status_changed ()

TpProxySignalConnection *
tp_cli_connection_connect_to_status_changed
                               (TpConnection *proxy,
                                tp_cli_connection_signal_callback_status_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StatusChanged.

Emitted when the status of the connection changes. All states and reasons have numerical values, as defined in ConnectionStatus and ConnectionStatusReason.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_signal_callback_connection_error ()

void
(*tp_cli_connection_signal_callback_connection_error)
                               (TpConnection *proxy,
                                const gchar *arg_Error,
                                GHashTable *arg_Details,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ConnectionError.

Parameters

proxy

The proxy on which tp_cli_connection_connect_to_connection_error() was called

 

arg_Error

The name of a D-Bus error describing the error that occurred, which may correspond to a <tp:type>Connection_Status_Reason</tp:type>, or may be a more specific Telepathy error (such as <code>org.freedesktop.Telepathy.Error.ConnectionRefused</code> for Connection_Status_Reason_Network_Error) or a protocol-specific or connection-manager-specific error in a suitable namespace. <tp:rationale> For instance, a SIP connection manager could signal &quot;402 Payment Required&quot; as an error in a connection-manager-specific namespace, or a link-local XMPP implementation that used Avahi could provide the error given to it by the avahi-daemon. </tp:rationale>

 

arg_Details

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Additional information about the error, which may include the following well-known keys:</p> <dl> <dt>debug-message (s)</dt> <dd>Debugging information on the change, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances</dd> <dt>server-message (s)</dt> <dd>A human-readable message from the server explaining what happened. This may be in the user's native language, or in the server operator's native language, or even in Lojban.</dd> <dt>user-requested (b), expected-hostname (s), certificate-hostname (s)</dt> <dd>The same details defined in <tp:type>TLS_Certificate_Rejection</tp:type>.</dd> </dl>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_connect_to_connection_error ()

TpProxySignalConnection *
tp_cli_connection_connect_to_connection_error
                               (TpConnection *proxy,
                                tp_cli_connection_signal_callback_connection_error callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ConnectionError.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when an error occurs that renders this connection unusable. </p> <p>Whenever this signal is emitted, it MUST immediately be followed by a <tp:member-ref>StatusChanged</tp:member-ref> signal with status Connection_Status_Disconnected and an appropriate reason code.</p> <p>Connection managers SHOULD emit this signal on disconnection, but need not do so. Clients MUST support connection managers that emit StatusChanged(Disconnected, ...) without first emitting ConnectionError.</p> <tp:rationale> <p>This signal provides additional information about the reason for disconnection. The reason for connection is always straightforward - it was requested - so it does not need further explanation. However, on errors, it can be useful to provide additional information.</p> <p>The <tp:type>Connection_Status_Reason</tp:type> is not given here, since it will be signalled in <tp:member-ref>StatusChanged</tp:member-ref>. A reasonable client implementation would be to store the information given by this signal until StatusChanged is received, at which point the information given by this signal can be used to supplement the StatusChanged signal.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_call_add_client_interest ()

TpProxyPendingCall *
tp_cli_connection_call_add_client_interest
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar **in_Tokens,
                                tp_cli_connection_callback_for_add_client_interest callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddClientInterest method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Register a client's interest in notifications related to one or more interfaces.</p> <p>Groups of notifications are identified by a token which is either a D-Bus interface name, or a string that starts with a D-Bus interface name. The meaning of each token is given by that D-Bus interface, which MUST define it in its documentation.</p> <tp:rationale> <p>Initially, all interests are in entire interface, but allowing other strings allows subscription to part of an interface; for instance, an interest in ...MailNotification/count could track the number of messages without caring about their detailed content.</p> </tp:rationale> <p>For each token with which this method interacts, the Connection tracks an &quot;interest count&quot; (like a reference count) for each unique bus name that has called this method. When a client calls this method, for each token, the interest count for its unique bus name is incremented; when <tp:member-ref>RemoveClientInterest</tp:member-ref> is called, all interest counts for that unique bus name are decremented. If the unique bus name leaves the bus (for instance, if the client crashes or exits), all interest counts for that unique bus name are set to zero.</p> <p>The Connection can then use these reference counts to avoid subscribing to protocol-level notifications unless at least one client has a non-zero interest count for the relevant token.</p> <tp:rationale> <p>This method exists to reduce memory and network overhead when there is no active subscription.</p> <p>One situation where this is useful is <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Location</tp:dbus-ref>: on XMPP, location updates are received over PEP. If the Connection advertises the <code>geoloc+notify</code> capability, it will be sent location updates for all contacts. To avoid consuming resources for this, the connection should avoid advertising that capability until a client has expressed an interest in contacts' locations.</p> <p>Another example of a protocol that benefits from this method is the Google XMPP Mail Notification extension, which can be used to implement <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">MailNotification</tp:dbus-ref>. In this protocol, the CM receives a notification that something has changed, but to get more information, the CM must request this information. Knowing that nobody is currently interested in this information, the CM can avoid generating useless network traffic. Similarly, the CM may free the list of unread messages to reduce memory overhead.</p> </tp:rationale> <p>If this method is called for an interface that might require protocol-level subscription, but the connection cannot set up that subscription yet (for instance because the <tp:member-ref>Status</tp:member-ref> is not Connected yet), the Connection MUST remember the client's interest, and attempt to subscribe to the appropriate protocol feature when this becomes possible.</p> <p>Clients MAY ignore any errors raised by this method; it is intended to be called with the reply ignored.</p> <tp:rationale> <p>The only reason it could fail is if it's unimplemented, in which case the only thing the client can usefully do is to proceed as if it had succeeded.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Tokens

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Interfaces or parts of interfaces in which to register an interest, represented by either a <tp:type>DBus_Interface</tp:type>, or a string prefixed with a <tp:type>DBus_Interface</tp:type>.</p> <p>If the Connection does not support one of these tokens, this is not considered to be an error; the unsupported token is simply ignored.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_call_remove_client_interest ()

TpProxyPendingCall *
tp_cli_connection_call_remove_client_interest
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar **in_Tokens,
                                tp_cli_connection_callback_for_remove_client_interest callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveClientInterest method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Release an interest registered using <tp:member-ref>AddClientInterest</tp:member-ref>. See that method's documentation for details.</p> <p>Clients MAY ignore any errors raised by this method; it is intended to be called with the reply ignored.</p> <tp:rationale> <p>The only reasons it could fail are if it's unimplemented, or if the client's reference-counting is wrong and it has tried to remove a client interest that it did not add. In both cases, there's nothing the client could do about it.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Tokens

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Interfaces or parts of interfaces that were previously passed to <tp:member-ref>AddClientInterest</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_callback_for_add_client_interest ()

void
(*tp_cli_connection_callback_for_add_client_interest)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddClientInterest method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_callback_for_remove_client_interest ()

void
(*tp_cli_connection_callback_for_remove_client_interest)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveClientInterest method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

Types and Values

struct TpConnection

struct TpConnection;

A proxy object for a Telepathy connection. There are no interesting public struct fields.

(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)

Since: 0.7.1


struct TpConnectionClass

struct TpConnectionClass {
    TpProxyClass parent_class;
};

The class of a TpConnection. In addition to parent_class there are four pointers reserved for possible future use.

(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)

Members

Since: 0.7.1


TP_CONNECTION_FEATURE_CORE

#define             TP_CONNECTION_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpConnection.

When this feature is prepared, the basic properties of the Connection have been retrieved and are available for use, and change-notification has been set up for those that can change.

Specifically, this implies that:

prepared does not imply connected

Unlike the older “connection-ready” mechanism, this feature does not imply that the connection has successfully connected. It only implies that an initial status (disconnected, connecting or connected) has been discovered. TP_CONNECTION_FEATURE_CONNECTED is the closest equivalent of “connection-ready”.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_CONNECTION_FEATURE_CONNECTED

#define             TP_CONNECTION_FEATURE_CONNECTED

Expands to a call to a function that returns a GQuark representing the "connected" feature.

When this feature is prepared, it means that the connection has become connected to the appropriate real-time communications service, and all information requested via other features has been updated accordingly. In particular, the following aspects of TP_CONNECTION_FEATURE_CORE will be up to date:

Someone still has to call Connect()

Requesting this feature via tp_proxy_prepare_async() means that you want to wait for the connection to connect, but it doesn't actually start the process of connecting. For connections associated with a TpAccount, the account manager service is responsible for doing that, but if you are constructing connections directly (e.g. if you are implementing an account manager), you must tp_cli_connection_call_connect() separately.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_CONNECTION_FEATURE_CAPABILITIES

#define             TP_CONNECTION_FEATURE_CAPABILITIES

Expands to a call to a function that returns a GQuark representing the "capabilities" feature.

When this feature is prepared, the Requests.RequestableChannelClasses property of the Connection has been retrieved. In particular, the TpConnection:capabilities property has been set.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS

#define             TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS

Expands to a call to a function that returns a GQuark representing the "avatar-requirements" feature.

When this feature is prepared, the avatar requirements of the Connection has been retrieved. Use tp_connection_get_avatar_requirements() to get them once prepared.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.4


TP_CONNECTION_FEATURE_CONTACT_INFO

#define             TP_CONNECTION_FEATURE_CONTACT_INFO

Expands to a call to a function that returns a GQuark representing the "contact-info" feature.

When this feature is prepared, the ContactInfoFlags and SupportedFields of the Connection has been retrieved. Use tp_connection_get_contact_info_flags() and tp_connection_dup_contact_info_supported_fields() to get them once prepared.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.7


TP_CONNECTION_FEATURE_BALANCE

#define             TP_CONNECTION_FEATURE_BALANCE

Expands to a call to a function that returns a GQuark representing the "balance" feature.

When this feature is prepared, the Balance.AccountBalance and Balance.ManageCreditURI properties of the Connection have been retrieved. In particular, the TpConnection:balance, TpConnection:balance-scale, TpConnection:balance-currency and TpConnection:balance-uri properties have been set and the TpConnection::balance-changed: will be emitted when they are changed.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.1


TP_CONNECTION_FEATURE_CONTACT_LIST

#define             TP_CONNECTION_FEATURE_CONTACT_LIST

Expands to a call to a function that returns a GQuark representing the "contact-list" feature.

When this feature is prepared, the TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES has been prepared, so the contact list properties of the Connection has been retrieved. If “contact-list-state” is TP_CONTACT_LIST_STATE_SUCCESS, all TpContact objects will also be created and prepared with the desired features. See tp_connection_dup_contact_list() to get the list of contacts, and tp_simple_client_factory_add_contact_features() to define which features needs to be prepared on them.

This feature will fail to prepare when using obsolete Telepathy connection managers which do not implement the ContactList interface.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.5


TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES

#define             TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES

Expands to a call to a function that returns a GQuark representing the "contact-list-properties" feature.

When this feature is prepared, the contact list properties of the Connection has been retrieved. This feature will fail to prepare when using obsolete Telepathy connection managers which do not implement the ContactList interface.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.17.0


TP_CONNECTION_FEATURE_CONTACT_GROUPS

#define             TP_CONNECTION_FEATURE_CONTACT_GROUPS

Expands to a call to a function that returns a GQuark representing the "contact-groups" feature.

When this feature is prepared, the contact groups properties of the Connection has been retrieved.

See “contact-groups” to get the list of groups a contact is member of.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.5


TP_CONNECTION_FEATURE_CONTACT_BLOCKING

#define             TP_CONNECTION_FEATURE_CONTACT_BLOCKING

Expands to a call to a function that returns a GQuark representing the "contact-blocking" feature.

When this feature is prepared, “blocked-contacts” will contain an up-to-date list of TpContacts the user has blocked, and “can-report-abusive” will indicate whether abusive contacts can be reported to the server administrator.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.17.0


TP_CONNECTION_FEATURE_ALIASING

#define             TP_CONNECTION_FEATURE_ALIASING

Expands to a call to a function that returns a GQuark representing the "aliasing" feature.

This feature needs to be prepared in order to use tp_connection_can_set_contact_alias().

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.17.3


TP_UNKNOWN_CONNECTION_STATUS

#define TP_UNKNOWN_CONNECTION_STATUS ((TpConnectionStatus) -1)

An invalid connection status used in TpConnection to indicate that the status has not yet been discovered.

Since: 0.7.1


TP_ERRORS_DISCONNECTED

#define TP_ERRORS_DISCONNECTED (tp_errors_disconnected_quark ())

GError domain representing a Telepathy connection becoming disconnected. The code in a GError with this domain must be a member of TpConnectionStatusReason.

This macro expands to a function call returning a GQuark.

Since 0.7.24, this error domain is only used if a connection manager emits a TpConnectionStatusReason not known to telepathy-glib.

Since: 0.7.1


TP_TYPE_AVATAR_REQUIREMENTS

#define TP_TYPE_AVATAR_REQUIREMENTS (tp_avatar_requirements_get_type ())

The boxed type of a TpAvatarRequirements.

Since: 0.11.4


struct TpAvatarRequirements

struct TpAvatarRequirements {
  GStrv supported_mime_types;
  guint minimum_width;
  guint minimum_height;
  guint recommended_width;
  guint recommended_height;
  guint maximum_width;
  guint maximum_height;
  guint maximum_bytes;
};

The requirements for setting an avatar on a particular protocol.

Members

GStrv supported_mime_types;

An array of supported MIME types (e.g. "image/jpeg") Clients MAY assume that the first type in this array is preferred

 

guint minimum_width;

The minimum width in pixels of an avatar, which MAY be 0

 

guint minimum_height;

The minimum height in pixels of an avatar, which MAY be 0

 

guint recommended_width;

The recommended width in pixels of an avatar, or 0 if there is no preferred width.

 

guint recommended_height;

The recommended height in pixels of an avatar, or 0 if there is no preferred height

 

guint maximum_width;

The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit.

 

guint maximum_height;

The maximum height in pixels of an avatar, or 0 if there is no limit.

 

guint maximum_bytes;

he maximum size in bytes of an avatar, or 0 if there is no limit.

 

Since: 0.11.4


struct TpContactInfoFieldSpec

struct TpContactInfoFieldSpec {
  gchar *name;
  GStrv parameters;
  TpContactInfoFieldFlags flags;
  guint max;
};

A struct describing a vCard field.

Members

gchar *name;

The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr".

 

GStrv parameters;

The set of vCard type parameters which may be set on this field. If this list is empty and the TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT flag is not set, any vCard type parameters may be used. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'.

 

TpContactInfoFieldFlags flags;

Flags describing the behaviour of this field.

 

guint max;

Maximum number of instances of this field which may be set. G_MAXUINT32 is used to indicate that there is no limit.

 

Since: 0.11.7


TP_TYPE_CONTACT_INFO_FIELD_SPEC

#define TP_TYPE_CONTACT_INFO_FIELD_SPEC (tp_contact_info_field_spec_get_type ())

The boxed type of a TpContactInfoFieldSpec.

Since: 0.11.7


TP_TYPE_CONTACT_INFO_SPEC_LIST

#define TP_TYPE_CONTACT_INFO_SPEC_LIST (tp_contact_info_spec_list_get_type ())

The boxed type of a GList of TpContactInfoFieldSpec.

Since: 0.11.7


struct TpContactInfoField

struct TpContactInfoField {
  gchar *field_name;
  GStrv parameters;
  GStrv field_value;
};

A structure representing an information about a contact. Similar to a vCard field.

Members

gchar *field_name;

The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr".

 

GStrv parameters;

A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'.

 

GStrv field_value;

For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value. For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements).

 

Since: 0.11.7


TP_TYPE_CONTACT_INFO_FIELD

#define TP_TYPE_CONTACT_INFO_FIELD (tp_contact_info_field_get_type ())

The boxed type of a TpContactInfoField.

Since: 0.11.7


TP_TYPE_CONTACT_INFO_LIST

#define TP_TYPE_CONTACT_INFO_LIST (tp_contact_info_list_get_type ())

The boxed type of a GList of TpContactInfoField.

Since: 0.11.7

Property Details

The “balance” property

  “balance”                  gint

The Amount field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

Owner: TpConnection

Flags: Read

Default value: 0


The “balance-currency” property

  “balance-currency”         gchar *

The Currency field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

Owner: TpConnection

Flags: Read

Default value: NULL


The “balance-scale” property

  “balance-scale”            guint

The Scale field of the Balance.AccountBalance property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_BALANCE.

See Also: tp_connection_get_balance()

Owner: TpConnection

Flags: Read

Default value: 4294967295


The “balance-uri” property

  “balance-uri”              gchar *

The Balance.ManageCreditURI property.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_BALANCE.

Owner: TpConnection

Flags: Read

Default value: NULL


The “blocked-contacts” property

  “blocked-contacts”         GPtrArray *

A GPtrArray of blocked TpContact. Changes are notified using the “blocked-contacts-changed” signal.

These TpContact objects have been prepared with the desired features. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared on them.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_BLOCKING.

Owner: TpConnection

Flags: Read

Since: 0.17.0


The “can-change-contact-list” property

  “can-change-contact-list”  gboolean

If true, presence subscription and publication can be changed using the RequestSubscription, AuthorizePublication and RemoveContacts methods.

Rational: link-local XMPP, presence is implicitly published to everyone in the local subnet, so the user cannot control their presence publication.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or TP_CONNECTION_FEATURE_CONTACT_LIST.

Owner: TpConnection

Flags: Read

Default value: FALSE

Since: 0.15.5


The “can-report-abusive” property

  “can-report-abusive”       gboolean

If this property is TRUE, contacts may be reported as abusive to the server administrators by setting report_abusive to TRUE when calling tp_connection_block_contacts_async().

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_BLOCKING.

Owner: TpConnection

Flags: Read

Default value: FALSE

Since: 0.17.0


The “capabilities” property

  “capabilities”             TpCapabilities *

The TpCapabilities object representing the capabilities of this connection, or NULL if we don't know yet.

To wait for valid capability information, call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CAPABILITIES.

Owner: TpConnection

Flags: Read


The “cm-name” property

  “cm-name”                  gchar *

This connection's connection manager name.

Owner: TpConnection

Flags: Read

Default value: NULL

Since: 0.19.3


The “connection-manager-name” property

  “connection-manager-name”  gchar *

This connection's connection manager name.

TpConnection:connection-manager-name is deprecated and should not be used in newly-written code.

Use “cm-name” instead.

Owner: TpConnection

Flags: Read

Default value: NULL

Since: 0.13.16


The “connection-ready” property

  “connection-ready”         gboolean

Initially FALSE; changes to TRUE when the connection has gone to CONNECTED status, introspection has finished and it's ready for use.

By the time this property becomes TRUE, any extra interfaces will have been set up and the “interfaces” property will have been populated.

This is similar to TP_CONNECTION_FEATURE_CONNECTED, except that once it has changed to TRUE, it remains TRUE even if the connection has been invalidated.

TpConnection:connection-ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

use tp_proxy_is_prepared() with TP_CHANNEL_FEATURE_CONNECTED for checks, or tp_proxy_prepare_async() for notification

Owner: TpConnection

Flags: Read

Default value: FALSE


The “contact-groups” property

  “contact-groups”           GStrv

The names of all groups that currently exist. This may be a larger set than the union of all “contact-groups” properties, if the connection allows groups to be empty.

This property's value is not meaningful until the “contact-list-state” property has become TP_CONTACT_LIST_STATE_SUCCESS.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Owner: TpConnection

Flags: Read

Since: 0.15.5


The “contact-list-persists” property

  “contact-list-persists”    gboolean

If true, presence subscriptions (in both directions) on this connection are stored by the server or other infrastructure.

If false, presence subscriptions on this connection are not stored.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or TP_CONNECTION_FEATURE_CONTACT_LIST.

Owner: TpConnection

Flags: Read

Default value: FALSE

Since: 0.15.5


The “contact-list-state” property

  “contact-list-state”       guint

The progress made in retrieving the contact list.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or TP_CONNECTION_FEATURE_CONTACT_LIST.

Owner: TpConnection

Flags: Read

Default value: 0

Since: 0.15.5


The “disjoint-groups” property

  “disjoint-groups”          gboolean

True if each contact can be in at most one group; false if each contact can be in many groups.

This property cannot change after the connection has moved to the TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Owner: TpConnection

Flags: Read

Default value: FALSE

Since: 0.15.5


The “group-storage” property

  “group-storage”            guint

Indicates the extent to which contacts' groups can be set and stored.

This property cannot change after the connection has moved to the TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Owner: TpConnection

Flags: Read

Default value: 0

Since: 0.15.5


The “protocol-name” property

  “protocol-name”            gchar *

The connection's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification.

Owner: TpConnection

Flags: Read

Default value: NULL

Since: 0.13.16


The “request-uses-message” property

  “request-uses-message”     gboolean

If true, the Message parameter to RequestSubscription is likely to be significant, and user interfaces SHOULD prompt the user for a message to send with the request; a message such as "I would like to add you to my contact list", translated into the local user's language, might make a suitable default.

For this property to be valid, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or TP_CONNECTION_FEATURE_CONTACT_LIST.

Owner: TpConnection

Flags: Read

Default value: FALSE

Since: 0.15.5


The “self-contact” property

  “self-contact”             TpContact *

A TpContact representing the local user on this connection, or NULL if not yet available.

If the local user's unique identifier changes (for instance by using /nick on IRC), this property will change to a different TpContact object representing the new identifier, and “notify” will be emitted.

The TpContact object is guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

To wait for a non-NULL self-contact (and other properties), call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONNECTED.

Owner: TpConnection

Flags: Read

Since: 0.13.9


The “self-handle” property

  “self-handle”              guint

The TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if we don't know yet or if the connection has become invalid.

This may change if the local user's unique identifier changes (for instance by using /nick on IRC), in which case “notify” will be emitted.

To wait for a valid self-handle (and other properties), call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONNECTED.

TpConnection:self-handle is deprecated and should not be used in newly-written code.

Use “self-contact” instead.

Owner: TpConnection

Flags: Read

Default value: 0


The “status” property

  “status”                   guint

This connection's status, or TP_UNKNOWN_CONNECTION_STATUS if we don't know yet.

To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CORE.

Since version 0.11.3, the change to status TP_CONNECTION_STATUS_CONNECTED is delayed slightly, until introspection of the connection has finished.

Owner: TpConnection

Flags: Read

Default value: 4294967295


The “status-reason” property

  “status-reason”            guint

To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CORE.

The reason why “status” changed to its current value, or TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. know yet.

Owner: TpConnection

Flags: Read

Default value: 0

Signal Details

The “balance-changed” signal

void
user_function (TpConnection *self,
               gint          balance,
               guint         balance_scale,
               gchar        *balance_currency,
               gpointer      user_data)

Emitted when at least one of the “balance”, “balance-scale” or “balance-currency” property is changed.

For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_BALANCE.

Parameters

self

a channel

 

balance

the value of the “balance” property

 

balance_scale

the value of the “balance-scale” property

 

balance_currency

the value of the “balance-currency” property

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.15.1


The “blocked-contacts-changed” signal

void
user_function (TpConnection *self,
               GPtrArray    *added,
               GPtrArray    *removed,
               gpointer      user_data)

Notify of changes in “blocked-contacts”. It is guaranteed that all contacts have desired features prepared. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared.

This signal is also emitted for the initial set of blocked contacts once retrieved.

For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_BLOCKING.

Parameters

self

a TpConnection

 

added

a GPtrArray of TpContact which have been blocked.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

removed

a GPtrArray of TpContact which are no longer blocked.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.0


The “contact-list-changed” signal

void
user_function (TpConnection *self,
               GPtrArray    *added,
               GPtrArray    *removed,
               gpointer      user_data)

Notify of changes in the list of contacts as returned by tp_connection_dup_contact_list(). It is guaranteed that all contacts have desired features prepared. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared.

This signal is also emitted for the initial set of contacts once retrieved.

For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_LIST.

Parameters

self

a TpConnection

 

added

a GPtrArray of TpContact added to contacts list.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

removed

a GPtrArray of TpContact removed from contacts list.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.15.5


The “group-renamed” signal

void
user_function (TpConnection *self,
               gchar        *old_name,
               gchar        *new_name,
               gpointer      user_data)

Emitted when a group is renamed, in protocols where this can be distinguished from group creation, removal and membership changes.

Immediately after this signal is emitted, “groups-created” signal the creation of a group with the new name, and “groups-removed” signal the removal of a group with the old name. If the group was not empty, immediately after those signals are emitted, “contact-groups-changed” signal that the members of that group were removed from the old name and added to the new name.

When this signal is emitted, “contact-groups” property is already updated.

For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

old_name

the old name of the group.

 

new_name

the new name of the group.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.15.5


The “groups-created” signal

void
user_function (TpConnection *self,
               GStrv         added,
               gpointer      user_data)

Emitted when new, empty groups are created. This will often be followed by “contact-groups-changed” signals that add some members. When this signal is emitted, “contact-groups” property is already updated.

For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Parameters

self

a TpConnection

 

added

a GStrv with the names of the new groups.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.15.5


The “groups-removed” signal

void
user_function (TpConnection *self,
               GStrv         added,
               gpointer      user_data)

Emitted when one or more groups are removed. If they had members at the time that they were removed, then immediately after this signal is emitted, “contact-groups-changed” signals that their members were removed. When this signal is emitted, “contact-groups” property is already updated.

For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature TP_CONNECTION_FEATURE_CONTACT_GROUPS.

Parameters

self

A TpConnection

 

added

A GStrv with the names of the groups.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.15.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc.html0000644000175000017500000004251614006623344021667 00000000000000 The TpSvc* interfaces: telepathy-glib API Reference Manual

The TpSvc* interfaces

The TpSvc* interfaces — How to export Telepathy objects

The GInterfaces whose names start with TpSvc are generated automatically from the Telepathy specification, and can be used to make it easier to export methods and signals onto D-Bus. By implementing these GInterfaces you can avoid needing to generate any "glue" using the dbus-glib tools - this is all done internally inside telepathy-glib.

The media session interface makes a convenient example because it only has two methods (Error() and Ready()) and one signal (NewStreamHandler), and media session handlers aren't expected to implement any other interfaces.

The first thing to do is pre-declare the interface init function, and define the type you'll be using, declaring it to implement the media stream handler interface:

1
2
3
4
5
6
7
8
static void stream_handler_iface_init (gpointer, gpointer);

G_DEFINE_TYPE_WITH_CODE(GabbleMediaStream,
    gabble_media_stream,
    G_TYPE_OBJECT,
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_MEDIA_STREAM_HANDLER,
      stream_handler_iface_init)
    )

Here we're using a subclass of G_TYPE_OBJECT. You can of course subclass any type.

If you're implementing more than one interface on the same object, define more than one init function, and call G_IMPLEMENT_INTERFACE more than once. The interface init functions can even be extern if you want to separate off chunks of functionality into a different .c file. For instance, here's GabbleConnection:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* in header files */
void conn_aliasing_iface_init (gpointer, gpointer);
void conn_avatars_iface_init (gpointer, gpointer);
void conn_presence_iface_init (gpointer, gpointer);

/* in gabble-connection.c */
static void conn_iface_init (gpointer, gpointer);
static void capabilities_iface_init (gpointer, gpointer);

G_DEFINE_TYPE_WITH_CODE(GabbleConnection,
    gabble_connection,
    TP_TYPE_BASE_CONNECTION,
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION,
      conn_iface_init);
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING,
      conn_aliasing_iface_init);
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS,
      conn_avatars_iface_init);
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CAPABILITIES,
      capabilities_init);
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE,
      conn_presence_iface_init);
    )

The _class_init, _init etc. functions are just like normal, so I won't describe them here. One thing to note, though, is that for signals which are defined by the GInterface, you do not need to do anything in the _class_init - the GInterface has already set the signal up for you.

For each exported D-Bus method, there's a typedef ending with _impl giving the signature you should use for your method implementation. For example, here's the signature for the Error method on the media session handler interface:

1
2
3
void (*tp_svc_media_session_handler_error_impl)
  (TpSvcMediaSessionHandler *self, guint errno, const char *message,
   DBusGMethodInvocation *context);

and here's the beginning of the corresponding implementation:

1
2
3
4
5
6
7
8
9
static void
gabble_media_session_error (TpSvcMediaSessionHandler *iface,
                            guint errno,
                            const char *message,
                            DBusGMethodInvocation *context)
{
  GabbleMediaSession *self = GABBLE_MEDIA_SESSION (iface);

  /* do stuff with self here */

All service methods in telepathy-glib are asynchronous - you can of course implement them synchronously if you like, but you have to return the result or error to D-Bus by calling a callback rather than by returning from a function.

The method implementation's last parameter is a DBusGMethodInvocation. To send the reply, you must either call dbus_g_method_return_error (for a failure), dbus_g_method_return (for a successful return), or an inline function whose name contains "_return_from_" provided by the TpSvc interface. For example, for Error there's an inline function tp_svc_media_session_handler_return_from_error(). These inline functions are just a simple wrapper around dbus_g_method_return() to make it type-safe - it's recommended that you use them where possible.

For instance, Error doesn't return anything, so tp_svc_media_session_handler_return_from_error() doesn't take any parameters apart from the DBusGMethodInvocation:

1
2
3
4
5
6
7
8
9
10
11
12
static void
gabble_media_session_error (TpSvcMediaSessionHandler *iface,
                            guint errno,
                            const char *message,
                            DBusGMethodInvocation *context)
{
  GabbleMediaSession *self = GABBLE_MEDIA_SESSION (iface);

  /* do stuff with self here */

  tp_svc_media_session_handler_return_from_error (context);
}

As for signals, they're named as dictated by dbus-glib. This normally gives you a sensible lower-case name - for instance NewStreamHandler is mapped to "new-stream-handler".

To emit a signal, the generated code contains another convenience function whose name contains _emit_. This is prototyped to take the correct arguments for the signal, and emits it efficiently:

1
2
tp_svc_media_session_handler_emit_new_stream_handler (session,
  object_path, id, media_type, TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL);

Finally, the interface init function needs to be written. Normally you'd set the fields of a vtable to be pointers to your method implementations. However, we couldn't do this in telepathy-glib because that would mean breaking the ABI every time we added methods to an interface. Instead, you call functions, with pointers to your method implementations as a parameter:

1
2
3
4
5
6
7
8
9
10
11
static void
session_handler_iface_init (gpointer g_iface, gpointer iface_data)
{
  TpSvcMediaSessionHandlerClass *klass =
    (TpSvcMediaSessionHandlerClass *)g_iface;

  tp_svc_media_session_handler_implement_error (klass,
      gabble_media_session_error);
  tp_svc_media_session_handler_implement_ready (klass,
      gabble_media_session_ready);
}

This is obviously quite repetitive if there are a lot of methods, so the convention I've used in telepathy-glib, Gabble and telepathy-sofiasip is to define a temporary macro called IMPLEMENT:

1
2
3
4
5
6
7
8
9
10
11
12
static void
session_handler_iface_init (gpointer g_iface, gpointer iface_data)
{
  TpSvcMediaSessionHandlerClass *klass =
    (TpSvcMediaSessionHandlerClass *)g_iface;

#define IMPLEMENT(x) tp_svc_media_session_handler_implement_##x (\
    klass, gabble_media_session_##x)
  IMPLEMENT(error);
  IMPLEMENT(ready);
#undef IMPLEMENT
}

If you're implementing many interfaces, just write many similar interface init functions.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-gtypes.html0000644000175000017500000075450614006623344022420 00000000000000 GType factory functions: telepathy-glib API Reference Manual

GType factory functions

GType factory functions — Macros using caching factory functions to get dbus-glib specialized GTypes

Functions

Types and Values

#define TP_TYPE_UCHAR_ARRAY
#define TP_ARRAY_TYPE_OBJECT_PATH_LIST
#define TP_ARRAY_TYPE_UCHAR_ARRAY_LIST
#define TP_HASH_TYPE_STRING_STRING_MAP
#define TP_ARRAY_TYPE_STRING_STRING_MAP_LIST
#define TP_HASH_TYPE_STRING_VARIANT_MAP
#define TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST
#define TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP
#define TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST
#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IP
#define TP_ARRAY_TYPE_SOCKET_ADDRESS_IP_LIST
#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4
#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6
#define TP_STRUCT_TYPE_SOCKET_NETMASK_IPV4
#define TP_STRUCT_TYPE_SOCKET_NETMASK_IPV6
#define TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP
#define TP_ARRAY_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP_LIST
#define TP_STRUCT_TYPE_PARAM_SPEC
#define TP_ARRAY_TYPE_PARAM_SPEC_LIST
#define TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP
#define TP_STRUCT_TYPE_CHANNEL_INFO
#define TP_ARRAY_TYPE_CHANNEL_INFO_LIST
#define TP_HASH_TYPE_ALIAS_MAP
#define TP_STRUCT_TYPE_ALIAS_PAIR
#define TP_ARRAY_TYPE_ALIAS_PAIR_LIST
#define TP_HASH_TYPE_AVATAR_TOKEN_MAP
#define TP_STRUCT_TYPE_CURRENCY_AMOUNT
#define TP_HASH_TYPE_CONTACT_CAPABILITIES_MAP
#define TP_ARRAY_TYPE_CONTACT_CAPABILITIES_MAP_LIST
#define TP_STRUCT_TYPE_HANDLER_CAPABILITIES
#define TP_ARRAY_TYPE_HANDLER_CAPABILITIES_LIST
#define TP_STRUCT_TYPE_CAPABILITY_CHANGE
#define TP_ARRAY_TYPE_CAPABILITY_CHANGE_LIST
#define TP_STRUCT_TYPE_CAPABILITY_PAIR
#define TP_ARRAY_TYPE_CAPABILITY_PAIR_LIST
#define TP_STRUCT_TYPE_CONTACT_CAPABILITY
#define TP_ARRAY_TYPE_CONTACT_CAPABILITY_LIST
#define TP_HASH_TYPE_CONTACT_ATTRIBUTES_MAP
#define TP_HASH_TYPE_SINGLE_CONTACT_ATTRIBUTES_MAP
#define TP_HASH_TYPE_CHANNEL_CLASS
#define TP_ARRAY_TYPE_CHANNEL_CLASS_LIST
#define TP_STRUCT_TYPE_CHANNEL_DETAILS
#define TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST
#define TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS
#define TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST
#define TP_HASH_TYPE_SIMPLE_CONTACT_PRESENCES
#define TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP
#define TP_STRUCT_TYPE_SIMPLE_PRESENCE
#define TP_STRUCT_TYPE_SIMPLE_STATUS_SPEC
#define TP_STRUCT_TYPE_ACCESS_CONTROL
#define TP_STRUCT_TYPE_RICH_PRESENCE_ACCESS_CONTROL
#define TP_HASH_TYPE_CONTACT_PRESENCES
#define TP_HASH_TYPE_MULTIPLE_STATUS_MAP
#define TP_HASH_TYPE_STATUS_SPEC_MAP
#define TP_STRUCT_TYPE_LAST_ACTIVITY_AND_STATUSES
#define TP_STRUCT_TYPE_STATUS_SPEC
#define TP_HASH_TYPE_LOCATION
#define TP_HASH_TYPE_CONTACT_LOCATIONS
#define TP_HASH_TYPE_CONTACT_INFO_MAP
#define TP_STRUCT_TYPE_CONTACT_INFO_FIELD
#define TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST
#define TP_STRUCT_TYPE_FIELD_SPEC
#define TP_ARRAY_TYPE_FIELD_SPECS
#define TP_HASH_TYPE_ADDRESSING_NORMALIZATION_MAP
#define TP_HASH_TYPE_VCARD_FIELD_ADDRESS_MAP
#define TP_STRUCT_TYPE_CONTACT_SUBSCRIPTIONS
#define TP_HASH_TYPE_CONTACT_SUBSCRIPTION_MAP
#define TP_HASH_TYPE_CONTACT_CLIENT_TYPES
#define TP_HASH_TYPE_MAIL
#define TP_ARRAY_TYPE_MAIL_LIST
#define TP_STRUCT_TYPE_MAIL_ADDRESS
#define TP_ARRAY_TYPE_MAIL_ADDRESS_LIST
#define TP_STRUCT_TYPE_MAIL_URL
#define TP_STRUCT_TYPE_HTTP_POST_DATA
#define TP_ARRAY_TYPE_HTTP_POST_DATA_LIST
#define TP_STRUCT_TYPE_LOCAL_PENDING_INFO
#define TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST
#define TP_HASH_TYPE_HANDLE_OWNER_MAP
#define TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP
#define TP_HASH_TYPE_CHANNEL_ORIGINATOR_MAP
#define TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE
#define TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST
#define TP_HASH_TYPE_MESSAGE_PART
#define TP_ARRAY_TYPE_MESSAGE_PART_LIST
#define TP_HASH_TYPE_MESSAGE_PART_CONTENT_MAP
#define TP_HASH_TYPE_CHAT_STATE_MAP
#define TP_HASH_TYPE_SUPPORTED_SOCKET_MAP
#define TP_STRUCT_TYPE_TUBE_INFO
#define TP_ARRAY_TYPE_TUBE_INFO_LIST
#define TP_STRUCT_TYPE_DBUS_TUBE_MEMBER
#define TP_ARRAY_TYPE_DBUS_TUBE_MEMBER_LIST
#define TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS
#define TP_STRUCT_TYPE_PROPERTY_SPEC
#define TP_ARRAY_TYPE_PROPERTY_SPEC_LIST
#define TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE
#define TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST
#define TP_STRUCT_TYPE_PROPERTY_VALUE
#define TP_ARRAY_TYPE_PROPERTY_VALUE_LIST
#define TP_ARRAY_TYPE_MEDIA_SESSION_HANDLER_INFO_LIST
#define TP_STRUCT_TYPE_MEDIA_SESSION_HANDLER_INFO
#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE_LIST
#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CODEC_LIST
#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT_LIST
#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE
#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CODEC
#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT
#define TP_STRUCT_TYPE_MEDIA_STREAM_INFO
#define TP_ARRAY_TYPE_MEDIA_STREAM_INFO_LIST
#define TP_HASH_TYPE_CHANNEL_CALL_STATE_MAP
#define TP_ARRAY_TYPE_RTCP_FEEDBACK_MESSAGE_LIST
#define TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST
#define TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP
#define TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE
#define TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE_PROPERTIES
#define TP_STRUCT_TYPE_RTP_HEADER_EXTENSION
#define TP_ARRAY_TYPE_ROOM_INFO_LIST
#define TP_STRUCT_TYPE_ROOM_INFO
#define TP_STRUCT_TYPE_SERVICE_POINT
#define TP_ARRAY_TYPE_SERVICE_POINT_INFO_LIST
#define TP_STRUCT_TYPE_SERVICE_POINT_INFO
enum TpChannelContactSearchState
#define TP_NUM_CHANNEL_CONTACT_SEARCH_STATES
#define NUM_TP_CHANNEL_CONTACT_SEARCH_STATES
#define TP_HASH_TYPE_CONTACT_SEARCH_MAP
#define TP_HASH_TYPE_CONTACT_SEARCH_RESULT_MAP
#define TP_ARRAY_TYPE_CAPTCHA_INFO_LIST
#define TP_HASH_TYPE_CAPTCHA_ANSWERS
#define TP_STRUCT_TYPE_CAPTCHA_INFO
#define TP_STRUCT_TYPE_AVATAR
#define TP_STRUCT_TYPE_DISPATCH_OPERATION_DETAILS
#define TP_ARRAY_TYPE_DISPATCH_OPERATION_DETAILS_LIST
#define TP_HASH_TYPE_NOT_DELEGATED_MAP
#define TP_STRUCT_TYPE_NOT_DELEGATED_ERROR
#define TP_STRUCT_TYPE_DEBUG_MESSAGE
#define TP_ARRAY_TYPE_DEBUG_MESSAGE_LIST
#define TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION
#define TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST
#define TP_HASH_TYPE_METADATA
#define TP_ARRAY_TYPE_CALL_MEMBER_MAP_LIST
#define TP_ARRAY_TYPE_CANDIDATE_LIST
#define TP_ARRAY_TYPE_CANDIDATE_PAIR_LIST
#define TP_ARRAY_TYPE_CODEC_LIST
#define TP_ARRAY_TYPE_VIDEO_RESOLUTION_STRUCT
#define TP_HASH_TYPE_CALL_MEMBER_MAP
#define TP_HASH_TYPE_CANDIDATE_INFO
#define TP_HASH_TYPE_COMPONENT_STATE_MAP
#define TP_HASH_TYPE_CONTACT_CODEC_MAP
#define TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP
#define TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP
#define TP_HASH_TYPE_CONTACT_SSRCS_MAP
#define TP_HASH_TYPE_MEDIA_DESCRIPTION_PROPERTIES
#define TP_STRUCT_TYPE_CALL_STATE_REASON
#define TP_STRUCT_TYPE_CANDIDATE
#define TP_STRUCT_TYPE_CANDIDATE_PAIR
#define TP_STRUCT_TYPE_CODEC
#define TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER
#define TP_STRUCT_TYPE_STREAM_CREDENTIALS
#define TP_STRUCT_TYPE_VIDEO_RESOLUTION

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

dbus-glib's built-in factory functions for specialized GTypes need to do a fair amount of parsing on their arguments, so these macros are provided to avoid that. Each macro expands to a call to a function which caches the GType, so it only ever has to call into dbus-glib once.

tp_dbus_specialized_value_slice_new() is also provided.

Functions

tp_dbus_specialized_value_slice_new ()

GValue *
tp_dbus_specialized_value_slice_new (GType type);

Parameters

type

A D-Bus specialized type (i.e. probably a specialized GValueArray representing a D-Bus struct)

 

Returns

a slice-allocated GValue containing an empty value of the given type.

Types and Values

TP_TYPE_UCHAR_ARRAY

#define TP_TYPE_UCHAR_ARRAY (tp_type_dbus_array_of_y ())

Expands to a call to a function that returns the GType of a GArray of G_TYPE_UCHAR, i.e. the same thing as DBUS_TYPE_G_UCHAR_ARRAY

This is the type used in dbus-glib to represent a byte array, signature 'ay'. (Note that the GByteArray type is not used with dbus-glib.)

Since: 0.11.1


TP_ARRAY_TYPE_OBJECT_PATH_LIST

#define TP_ARRAY_TYPE_OBJECT_PATH_LIST (tp_type_dbus_array_of_o ())

Expands to a call to a function that returns the GType of a GPtrArray of DBUS_TYPE_G_OBJECT_PATH.

Since: 0.7.34


TP_ARRAY_TYPE_UCHAR_ARRAY_LIST

#define TP_ARRAY_TYPE_UCHAR_ARRAY_LIST (tp_type_dbus_array_of_ay ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_TYPE_UCHAR_ARRAY, i.e. a GPtrArray of GArray of guchar.

This is the type used in dbus-glib to represent an array of byte arrays, signature 'aay'. (Note that the GByteArray type is not used with dbus-glib.)

Since: 0.11.14


TP_HASH_TYPE_STRING_STRING_MAP

#define TP_HASH_TYPE_STRING_STRING_MAP (tp_type_dbus_hash_ss ())

A mapping from strings to strings representing extra key-value pairs.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ss}.

Keys (D-Bus type s, named Key): (Undocumented)

Values (D-Bus type s, named Value): (Undocumented)


TP_ARRAY_TYPE_STRING_STRING_MAP_LIST

#define TP_ARRAY_TYPE_STRING_STRING_MAP_LIST (tp_type_dbus_array_of_a_7bss_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_STRING_STRING_MAP.


TP_HASH_TYPE_STRING_VARIANT_MAP

#define TP_HASH_TYPE_STRING_VARIANT_MAP (tp_type_dbus_hash_sv ())

A mapping from strings to variants representing extra key-value pairs.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, named Key): (Undocumented)

Values (D-Bus type v, named Value): (Undocumented)


TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST

#define TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST (tp_type_dbus_array_of_a_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_STRING_VARIANT_MAP.


TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP

#define TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP (tp_type_dbus_hash_sv ())

A mapping from strings representing D-Bus properties (by their namespaced names) to their values.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, type DBus_Qualified_Member, named Key): A D-Bus interface name, followed by a dot and a D-Bus property name.

Values (D-Bus type v, named Value): The value of the property.


TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST

#define TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST (tp_type_dbus_array_of_a_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP.


TP_STRUCT_TYPE_SOCKET_ADDRESS_IP

#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IP (tp_type_dbus_struct_sq ())

An IP address and port.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sq).

Member 0 (D-Bus type s, named Address): Either a dotted-quad IPv4 address literal as for <tp:type>Socket_Address_IPv4</tp:type>, or an RFC2373 IPv6 address as for <tp:type>Socket_Address_IPv6</tp:type>.

Member 1 (D-Bus type q, named Port): The TCP or UDP port number.


TP_ARRAY_TYPE_SOCKET_ADDRESS_IP_LIST

#define TP_ARRAY_TYPE_SOCKET_ADDRESS_IP_LIST (tp_type_dbus_array_sq ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_SOCKET_ADDRESS_IP.


TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4

#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4 (tp_type_dbus_struct_sq ())

An IPv4 address and port.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sq).

Member 0 (D-Bus type s, named Address): A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. &quot;192.168.0.1&quot;.

Member 1 (D-Bus type q, named Port): The TCP or UDP port number.


TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6

#define TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6 (tp_type_dbus_struct_sq ())

An IPv6 address and port.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sq).

Member 0 (D-Bus type s, named Address): An IPv6 address literal as specified by RFC2373 section 2.2, e.g. &quot;2001:DB8::8:800:200C:4171&quot;.

Member 1 (D-Bus type q, named Port): The TCP or UDP port number.


TP_STRUCT_TYPE_SOCKET_NETMASK_IPV4

#define TP_STRUCT_TYPE_SOCKET_NETMASK_IPV4 (tp_type_dbus_struct_sy ())

An IPv4 network or subnet.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sy).

Member 0 (D-Bus type s, named Address): A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. &quot;192.168.0.1&quot;.

Member 1 (D-Bus type y, named Prefix_Length): The number of leading bits of the address that must match, for this netmask to be considered to match an address.


TP_STRUCT_TYPE_SOCKET_NETMASK_IPV6

#define TP_STRUCT_TYPE_SOCKET_NETMASK_IPV6 (tp_type_dbus_struct_sy ())

An IPv6 network or subnet.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sy).

Member 0 (D-Bus type s, named Address): An IPv6 address literal as specified by RFC2373 section 2.2, e.g. &quot;2001:DB8::8:800:200C:4171&quot;.

Member 1 (D-Bus type y, named Prefix_Length): The number of leading bits of the address that must match, for this netmask to be considered to match an address.


TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP

#define TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP (tp_type_dbus_hash_oa_7bsv_7d ())

A mapping from object path to the immutable properties of the object.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{oa{sv}}.

Keys (D-Bus type o, named Path): The object path of an object

Values (D-Bus type a{sv}, type Qualified_Property_Value_Map, named Immutable_Properties): The immutable properties of the object


TP_ARRAY_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP_LIST

#define TP_ARRAY_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP_LIST (tp_type_dbus_array_of_a_7boa_7bsv_7d_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP.


TP_STRUCT_TYPE_PARAM_SPEC

#define TP_STRUCT_TYPE_PARAM_SPEC (tp_type_dbus_struct_susv ())

A struct representing an allowed parameter, as returned by GetParameters on the ConnectionManager interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (susv).

Member 0 (D-Bus type s, named Name): A string parameter name

Member 1 (D-Bus type u, type Conn_Mgr_Param_Flags, named Flags): A bitwise OR of the parameter flags

Member 2 (D-Bus type s, type DBus_Signature, named Signature): A string containing the D-Bus type signature for this parameter

Member 3 (D-Bus type v, named Default_Value): The default value (if the Has_Default flag is not present, there is no default and this takes some dummy value, which SHOULD be of the appropriate D-Bus type)


TP_ARRAY_TYPE_PARAM_SPEC_LIST

#define TP_ARRAY_TYPE_PARAM_SPEC_LIST (tp_type_dbus_array_susv ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_PARAM_SPEC.


TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP

#define TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP (tp_type_dbus_hash_sa_7bsv_7d ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A map from protocol identifiers supported by a connection manager to the immutable properties of the corresponding <tp:dbus-ref namespace="org.freedesktop.Telepathy">Protocol</tp:dbus-ref> objects.</p>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sa{sv}}.

Keys (D-Bus type s, type Protocol, named Protocol): A protocol name

Values (D-Bus type a{sv}, type Qualified_Property_Value_Map, named Properties): The immutable properties of the corresponding Protocol object


TP_STRUCT_TYPE_CHANNEL_INFO

#define TP_STRUCT_TYPE_CHANNEL_INFO (tp_type_dbus_struct_osuu ())

A struct representing a channel, as returned by ListChannels on the Connection interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (osuu).

Member 0 (D-Bus type o, named Channel): The object path of the channel, which is on the same bus name as the connection

Member 1 (D-Bus type s, type DBus_Interface, named Channel_Type): The channel's type

Member 2 (D-Bus type u, type Handle_Type, named Handle_Type): The type of the handle that the channel communicates with, or Handle_Type_None if there is no associated handle

Member 3 (D-Bus type u, type Handle, named Handle): The handle that the channel communicates with, or 0 if there is no associated handle


TP_ARRAY_TYPE_CHANNEL_INFO_LIST

#define TP_ARRAY_TYPE_CHANNEL_INFO_LIST (tp_type_dbus_array_osuu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CHANNEL_INFO.


TP_HASH_TYPE_ALIAS_MAP

#define TP_HASH_TYPE_ALIAS_MAP (tp_type_dbus_hash_us ())

A dictionary whose keys are contact handles and whose values are aliases.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{us}.

Keys (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Values (D-Bus type s, named Alias): (Undocumented)


TP_STRUCT_TYPE_ALIAS_PAIR

#define TP_STRUCT_TYPE_ALIAS_PAIR (tp_type_dbus_struct_us ())

A pair (contact handle, alias) as seen in the

<tp:member-ref>AliasesChanged</tp:member-ref> signal.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (us).

Member 0 (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Member 1 (D-Bus type s, named Alias): (Undocumented)


TP_ARRAY_TYPE_ALIAS_PAIR_LIST

#define TP_ARRAY_TYPE_ALIAS_PAIR_LIST (tp_type_dbus_array_us ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_ALIAS_PAIR.


TP_HASH_TYPE_AVATAR_TOKEN_MAP

#define TP_HASH_TYPE_AVATAR_TOKEN_MAP (tp_type_dbus_hash_us ())

A dictionary whose keys are contact handles and whose values are avatar tokens.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{us}.

Keys (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Values (D-Bus type s, type Avatar_Token, named Token): (Undocumented)


TP_STRUCT_TYPE_CURRENCY_AMOUNT

#define TP_STRUCT_TYPE_CURRENCY_AMOUNT (tp_type_dbus_struct_ius ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p> An amount of money in a specified currency. For example, 3.21 British pounds would conventionally be represented by ( <var>Amount</var> = <tt>321</tt> , <var>Scale</var> = <tt>2</tt> ,

<var>Currency</var> = <tt>&quot;GBP&quot;</tt> ), but could be represented by ( <var>Amount</var> = <tt>3210</tt> , <var>Scale</var> = <tt>3</tt> ,

<var>Currency</var> = <tt>&quot;GBP&quot;</tt> ) in a service that records balance in units of 0.001 pounds. </p>

<p> As a special case, if <var>Amount</var> = <tt>0</tt> ,

<var>Scale</var> = <tt>2**32 - 1</tt> (i.e. the largest possible 32-bit unsigned integer) and <var>Currency</var> = <tt>&quot;&quot;</tt> , this indicates an unknown amount. </p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ius).

Member 0 (D-Bus type i, named Amount): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The amount, expressed as a fixed-point number with decimal scale defined by the <var>Scale</var> field; for instance, an <var>Amount</var> value of <tt>1234</tt> with <var>Scale</var> of <tt>2</tt> represents 12.34 in the currency unit given by the <var>Currency</var> field.</p>

Member 1 (D-Bus type u, named Scale): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The decimal scale for the fixed point value of the <var>Amount</var> field, defining the number of rightmost decimal digits from the integer value which form the fractional part of the resulting currency value.</p> <p>As well as defining the interpretation of <var>Amount</var>, user interfaces may use this value to determine the precision with which to display the amount.</p>

Member 2 (D-Bus type s, named Currency): The currency code represented by this amount, which SHOULD be an international currency code such as <tt>&quot;EUR&quot;</tt>, <tt>&quot;USD&quot;</tt>, or <tt>&quot;JPY&quot;</tt> if possible. An empty string can be used to indicate that the currency is not known.


TP_HASH_TYPE_CONTACT_CAPABILITIES_MAP

#define TP_HASH_TYPE_CONTACT_CAPABILITIES_MAP (tp_type_dbus_hash_ua_28a_7bsv_7das_29 ())

A mapping from contact handle to their capabilities.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua(a{sv}as)}.

Keys (D-Bus type u, type Contact_Handle, named Key): A contact handle.

Values (D-Bus type a(a{sv}as), type Requestable_Channel_Class[], named Value): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The contact's capabilities. These should be represented in the same way as in <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Requests">RequestableChannelClasses</tp:dbus-ref>, except that they may have more fixed properties or fewer allowed properties, to represent contacts who do not have all the capabilities of the connection.</p> <p>In particular, requestable channel classes for channels with target handle type Contact MUST list <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandleType</tp:dbus-ref> among their fixed properties when they appear here, and clients MAY assume that this will be the case.</p> <tp:rationale> <p>This matches the initial implementations - service-side in telepathy-gabble, and client-side in telepathy-qt4 - and means that clients can use exactly the same code to interpret RequestableChannelClasses and contact capabilities.</p> </tp:rationale> <p>Channel classes with target handle type Handle_Type_Contact indicate that a request that matches the channel class, and also either has the contact's handle as <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref> or the contact's identifier as <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetID</tp:dbus-ref>, can be expected to succeed. Connection managers SHOULD NOT include the TargetHandle or TargetID as a fixed property in contact capabilities.</p> <tp:rationale> <p>This makes one channel class sufficient to describe requests via TargetHandle or TargetID, and is necessary in order to allow clients to interpret RequestableChannelClasses and contact capabilities with the same code.</p> </tp:rationale> <p>Channel classes with target handle type Handle_Type_Room or Handle_Type_None indicate that if a channel matching the channel class is created, then inviting the contact to that channel can be expected to succeed.</p> <tp:rationale> <p>To support room-based XMPP protocols like <a href="http://telepathy.freedesktop.org/wiki/Muji">Muji</a> and MUC Tubes, it's necessary to be able to discover who can be invited to a given room channel; most XMPP contacts won't support being invited into a Muji conference call, at least in the short to medium term.</p> </tp:rationale> <p>No interpretation is defined for channel classes with any other target handle type, or for channel classes that do not fix a target handle type, in this version of the Telepathy specification.</p>


TP_ARRAY_TYPE_CONTACT_CAPABILITIES_MAP_LIST

#define TP_ARRAY_TYPE_CONTACT_CAPABILITIES_MAP_LIST (tp_type_dbus_array_of_a_7bua_28a_7bsv_7das_29_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_CONTACT_CAPABILITIES_MAP.


TP_STRUCT_TYPE_HANDLER_CAPABILITIES

#define TP_STRUCT_TYPE_HANDLER_CAPABILITIES (tp_type_dbus_struct_saa_7bsv_7das ())

A structure representing the capabilities of a single client.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (saa{sv}as).

Member 0 (D-Bus type s, type DBus_Well_Known_Name, named Well_Known_Name): For implementations of the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Client</tp:dbus-ref> interface, the well-known bus name name of the client; for any other process, any other reversed domain name that uniquely identifies it.

Member 1 (D-Bus type aa{sv}, type String_Variant_Map[], named Channel_Classes): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of channel classes that can be handled by this client. This will usually be a copy of the client's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandlerChannelFilter</tp:dbus-ref> property.

Member 2 (D-Bus type as, type Handler_Capability_Token[], named Capabilities): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of client capabilities supported by this client, to be used by the connection manager to determine what capabilities to advertise. This will usually be a copy of the client's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">Capabilities</tp:dbus-ref> property.


TP_ARRAY_TYPE_HANDLER_CAPABILITIES_LIST

#define TP_ARRAY_TYPE_HANDLER_CAPABILITIES_LIST (tp_type_dbus_array_saa_7bsv_7das ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_HANDLER_CAPABILITIES.


TP_STRUCT_TYPE_CAPABILITY_CHANGE

#define TP_STRUCT_TYPE_CAPABILITY_CHANGE (tp_type_dbus_struct_usuuuu ())

A struct (contact handle, channel type, old generic flags, new generic flags, old type-specific flags, new type-specific flags) representing a change to one of a contact's capabilities, as seen in the

<tp:member-ref>CapabilitiesChanged</tp:member-ref> signal on the Capabilities interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usuuuu).

Member 0 (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Member 1 (D-Bus type s, type DBus_Interface, named Channel_Type): (Undocumented)

Member 2 (D-Bus type u, type Connection_Capability_Flags, named Old_Generic_Flags): (Undocumented)

Member 3 (D-Bus type u, type Connection_Capability_Flags, named New_Generic_Flags): (Undocumented)

Member 4 (D-Bus type u, named Old_Type_Specific_Flags): (Undocumented)

Member 5 (D-Bus type u, named New_Type_Specific_Flags): (Undocumented)


TP_ARRAY_TYPE_CAPABILITY_CHANGE_LIST

#define TP_ARRAY_TYPE_CAPABILITY_CHANGE_LIST (tp_type_dbus_array_usuuuu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CAPABILITY_CHANGE.


TP_STRUCT_TYPE_CAPABILITY_PAIR

#define TP_STRUCT_TYPE_CAPABILITY_PAIR (tp_type_dbus_struct_su ())

A pair (channel type, type-specific flags) as passed to

<tp:member-ref>AdvertiseCapabilities</tp:member-ref> on the Capabilities interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (su).

Member 0 (D-Bus type s, type DBus_Interface, named Channel_Type): (Undocumented)

Member 1 (D-Bus type u, named Type_Specific_Flags): (Undocumented)


TP_ARRAY_TYPE_CAPABILITY_PAIR_LIST

#define TP_ARRAY_TYPE_CAPABILITY_PAIR_LIST (tp_type_dbus_array_su ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CAPABILITY_PAIR.


TP_STRUCT_TYPE_CONTACT_CAPABILITY

#define TP_STRUCT_TYPE_CONTACT_CAPABILITY (tp_type_dbus_struct_usuu ())

A struct (contact handle, channel type, generic flags, type-specific flags) representing a capability posessed by a contact, as returned by <tp:member-ref>GetCapabilities</tp:member-ref> on the Capabilities interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usuu).

Member 0 (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Member 1 (D-Bus type s, type DBus_Interface, named Channel_Type): (Undocumented)

Member 2 (D-Bus type u, type Connection_Capability_Flags, named Generic_Flags): (Undocumented)

Member 3 (D-Bus type u, named Type_Specific_Flags): (Undocumented)


TP_ARRAY_TYPE_CONTACT_CAPABILITY_LIST

#define TP_ARRAY_TYPE_CONTACT_CAPABILITY_LIST (tp_type_dbus_array_usuu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CONTACT_CAPABILITY.


TP_HASH_TYPE_CONTACT_ATTRIBUTES_MAP

#define TP_HASH_TYPE_CONTACT_ATTRIBUTES_MAP (tp_type_dbus_hash_ua_7bsv_7d ())

Mapping returned by <tp:member-ref>GetContactAttributes</tp:member-ref>, representing a collection of Contacts and their requested attributes.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua{sv}}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact

Values (D-Bus type a{sv}, type Single_Contact_Attributes_Map, named Attributes): Attributes of that contact


TP_HASH_TYPE_SINGLE_CONTACT_ATTRIBUTES_MAP

#define TP_HASH_TYPE_SINGLE_CONTACT_ATTRIBUTES_MAP (tp_type_dbus_hash_sv ())

Some of the attributes of a single contact.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, type Contact_Attribute, named Attribute): The name of the attribute

Values (D-Bus type v, named Value): The value of the attribute


TP_HASH_TYPE_CHANNEL_CLASS

#define TP_HASH_TYPE_CHANNEL_CLASS (tp_type_dbus_hash_sv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Mapping representing a class of channels that can be requested from a connection manager, can be handled by a user interface, are supported by a contact, etc.</p> <p>Classes of channel are identified by the fixed values of a subset of their properties.</p> <p>Channel classes SHOULD always include the keys <tp:dbus-ref>org.freedesktop.Telepathy.Channel.ChannelType</tp:dbus-ref> and <tp:dbus-ref>org.freedesktop.Telepathy.Channel.TargetHandleType</tp:dbus-ref>. (One exception is that <tp:dbus-ref namespace="ofdT.Channel.Type">ContactSearch</tp:dbus-ref> channels do not have TargetHandleType <code>None</code> in their requestable channel classes, for historical reasons.)</p>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, type DBus_Qualified_Member, named Key): A D-Bus interface name, followed by a dot and a D-Bus property name.

Values (D-Bus type v, named Value): The value of the property.


TP_ARRAY_TYPE_CHANNEL_CLASS_LIST

#define TP_ARRAY_TYPE_CHANNEL_CLASS_LIST (tp_type_dbus_array_of_a_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_CHANNEL_CLASS.


TP_STRUCT_TYPE_CHANNEL_DETAILS

#define TP_STRUCT_TYPE_CHANNEL_DETAILS (tp_type_dbus_struct_oa_7bsv_7d ())

Enough details of a channel that clients can work out how to dispatch or handle it.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (oa{sv}).

Member 0 (D-Bus type o, named Channel): The object path of the channel.

Member 1 (D-Bus type a{sv}, type Qualified_Property_Value_Map, named Properties): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel.</p> <p>Connection managers MUST NOT include properties in this mapping if their values can change. Clients MUST ignore properties that appear in this mapping if their values can change.</p> <tp:rationale> <p>If properties that could change were included, the following race condition would be likely to exist in some cases:</p> <ul> <li>NewChannels or Get(&quot;Channels&quot;) includes a property P with value V1</li> <li>Client creates a proxy object for the channel</li> <li>The value of P changes to V2</li> <li>Client connects to PChanged signal</li> <li>Client should call Get(&quot;P&quot;) or GetAll here, to avoid the race, but client's author has forgotten to do so</li> <li>Proxy object thinks P == V1, but actually P == V2</li> </ul> <p>We've taken the opportunity to make the API encourage the client author to get it right. Where possible, we intend that properties whose value will be used in channel dispatching or other &quot;early&quot; processing will be defined so that they are immutable (can never change).</p> </tp:rationale> <p>Each dictionary MUST contain the keys <tp:dbus-ref>org.freedesktop.Telepathy.Channel.ChannelType</tp:dbus-ref>, <tp:dbus-ref>org.freedesktop.Telepathy.Channel.TargetHandleType</tp:dbus-ref>, <tp:dbus-ref>org.freedesktop.Telepathy.Channel.TargetHandle</tp:dbus-ref>, <tp:dbus-ref>org.freedesktop.Telepathy.Channel.TargetID</tp:dbus-ref> and <tp:dbus-ref>org.freedesktop.Telepathy.Channel.Requested</tp:dbus-ref>. </p> <tp:rationale> <p>We expect these to be crucial to the channel-dispatching process.</p> </tp:rationale>


TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST

#define TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST (tp_type_dbus_array_oa_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CHANNEL_DETAILS.


TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS

#define TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS (tp_type_dbus_struct_a_7bsv_7das ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>Structure representing a class of channels that can be requested, identified by a set of properties that identify that class of channel.</p>

<tp:rationale>

<p>This will often just be the channel type and the handle type, but can include other properties of the channel - for instance, encrypted channels might require properties that unencrypted channels do not, like an encryption key.</p>

</tp:rationale>

<p>In some cases, these classes of channel may overlap, in the sense that one class fixes all the properties that another class does, plus some more properties.</p>

<tp:rationale>

<p>For older clients to still be able to understand how to request channels in the presence of a hypothetical &quot;encryption&quot; interface, we'd need to represent it like this:</p>

<ul>

<li>class 1: ChannelType = Text, TargetHandleType = CONTACT</li>

<li>class 2: Channel.ChannelType = Text, Channel.TargetHandleType = CONTACT, Encryption.Encrypted = TRUE</li>

</ul>

</tp:rationale>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (a{sv}as).

Member 0 (D-Bus type a{sv}, type Channel_Class, named Fixed_Properties): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The property values that identify this requestable channel class. These properties MUST be included in requests for a channel of this class, and MUST take these values.</p> <p>Clients that do not understand the semantics of all the Fixed_Properties MUST NOT request channels of this class, since they would be unable to avoid making an incorrect request.</p> <p>This implies that connection managers wishing to make channels available to old or minimal clients SHOULD have a channel class with the minimum number of Fixed_Properties, and MAY additionally have channel classes with extra Fixed_Properties.</p> <p>Interface designers SHOULD avoid introducing fixed properties whose types are not serializable in a <code>.manager</code> file.</p> <tp:rationale> <p>Connection managers with a fixed property that is not serializable cannot have a complete <code>.manager</code> file.</p> </tp:rationale>

Member 1 (D-Bus type as, type DBus_Qualified_Member[], named Allowed_Properties): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties that MAY be set when requesting a channel of this channel type and handle type.</p> <p>This array MUST NOT include properties that are in the Fixed_Properties mapping.</p> <p>Properties in this array may either be required or optional, according to their documented semantics.</p> <tp:rationale> <p>For instance, if TargetHandleType takes a value that is not Handle_Type_None, one or the other of TargetHandle and TargetID is required. Clients are expected to understand the documented relationship between the properties, so we do not have separate arrays of required and optional properties.</p> </tp:rationale> <p>If this array contains the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.FUTURE">Bundle</tp:dbus-ref> property, then this class of channel can be combined with other channels with that property in a request, or added to an existing bundle. If not, this signifies that the connection manager is unable to mark channels of this class as part of a bundle - this means that to the remote contact they are likely to be indistinguishable from channels requested separately.</p>


TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST

#define TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST (tp_type_dbus_array_a_7bsv_7das ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS.


TP_HASH_TYPE_SIMPLE_CONTACT_PRESENCES

#define TP_HASH_TYPE_SIMPLE_CONTACT_PRESENCES (tp_type_dbus_hash_u_28uss_29 ())

Mapping returned by <tp:member-ref>GetPresences</tp:member-ref> and signalled by <tp:member-ref>PresencesChanged</tp:member-ref>, indicating the presence of a number of contacts.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{u(uss)}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact

Values (D-Bus type (uss), type Simple_Presence, named Presence): The contact's presence


TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP

#define TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP (tp_type_dbus_hash_s_28ubb_29 ())

A mapping describing possible statuses.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{s(ubb)}.

Keys (D-Bus type s, named Identifier): The string identifier of this status.

Values (D-Bus type (ubb), type Simple_Status_Spec, named Spec): Details of this status.


TP_STRUCT_TYPE_SIMPLE_PRESENCE

#define TP_STRUCT_TYPE_SIMPLE_PRESENCE (tp_type_dbus_struct_uss ())

A struct representing the presence of a contact.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uss).

Member 0 (D-Bus type u, type Connection_Presence_Type, named Type): The presence type, e.g. Connection_Presence_Type_Away.

Member 1 (D-Bus type s, named Status): The string identifier of the status, e.g. &quot;brb&quot;, as defined in the <tp:member-ref>Statuses</tp:member-ref> property.

Member 2 (D-Bus type s, named Status_Message): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The user-defined status message, e.g. &quot;Back soon!&quot;.</p> <p>Clients SHOULD set the status message for the local user to the empty string, unless the user has actually provided a specific message (i.e. one that conveys more information than the Status).</p> <p>User interfaces SHOULD regard an empty status message as unset, and MAY replace it with a localized string corresponding to the Status or Type.</p> <tp:rationale> Use case: Daf sets his status in Empathy by choosing the Welsh translation of &quot;Available&quot; from a menu. It is more informative for his English-speaking colleagues to see the English translation of &quot;Available&quot; (as localized by their own clients) than to see &quot;Ar Gael&quot; (which they don't understand anyway). </tp:rationale>


TP_STRUCT_TYPE_SIMPLE_STATUS_SPEC

#define TP_STRUCT_TYPE_SIMPLE_STATUS_SPEC (tp_type_dbus_struct_ubb ())

A struct containing information about a status.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ubb).

Member 0 (D-Bus type u, type Connection_Presence_Type, named Type): The type of a presence. This SHOULD NOT be used as a way to set statuses that the client does not recognise (as explained in <tp:member-ref>SetPresence</tp:member-ref>), but MAY be used to check that the client's assumptions about a particular status name match the connection manager's.

Member 1 (D-Bus type b, named May_Set_On_Self): If true, the user can set this status on themselves using <tp:member-ref>SetPresence</tp:member-ref>.

Member 2 (D-Bus type b, named Can_Have_Message): If true, a non-empty message can be set for this status. Otherwise, the empty string is the only acceptable message. <tp:rationale> On IRC you can be Away with a status message, but if you are available you cannot set a status message. </tp:rationale>


TP_STRUCT_TYPE_ACCESS_CONTROL

#define TP_STRUCT_TYPE_ACCESS_CONTROL (tp_type_dbus_struct_uv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>An access control mode for extended presence items like geolocation. This type isn't actually used by the SimplePresence interface, but it's included here so it can be referenced by rich presence interfaces.</p>

<p> New interfaces should use this type, and NOT

<tp:type>Rich_Presence_Access_Control</tp:type> . </p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uv).

Member 0 (D-Bus type u, type Access_Control_Type, named Type): The type of access control to apply.

Member 1 (D-Bus type v, named Detail): Any additional information required by the Type. The required type and semantics are defined for each <tp:type>Access_Control_Type</tp:type>.


TP_STRUCT_TYPE_RICH_PRESENCE_ACCESS_CONTROL

#define TP_STRUCT_TYPE_RICH_PRESENCE_ACCESS_CONTROL (tp_type_dbus_struct_uv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p> An access control mode for extended presence items like geolocation. This type isn't actually used by the SimplePresence interface, but it's included here so it can be referenced by rich presence interfaces such as <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Location</tp:dbus-ref> . </p>

<p> <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Location</tp:dbus-ref>

uses this for historical reasons, new interfaces will use

<tp:type>Access_Control_Type</tp:type> . </p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uv).

Member 0 (D-Bus type u, type Rich_Presence_Access_Control_Type, named Type): The type of access control to apply.

Member 1 (D-Bus type v, named Detail): Any additional information required by the Type. The required type and semantics are defined for each <tp:type>Rich_Presence_Access_Control_Type</tp:type>.


TP_HASH_TYPE_CONTACT_PRESENCES

#define TP_HASH_TYPE_CONTACT_PRESENCES (tp_type_dbus_hash_u_28ua_7bsa_7bsv_7d_7d_29 ())

Mapping returned by <tp:member-ref>GetPresence</tp:member-ref> and signalled by <tp:member-ref>PresenceUpdate</tp:member-ref>, where the keys are contacts and the values represent their presences.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{u(ua{sa{sv}})}.

Keys (D-Bus type u, type Contact_Handle, named Contact): (Undocumented)

Values (D-Bus type (ua{sa{sv}}), type Last_Activity_And_Statuses, named Presence): (Undocumented)


TP_HASH_TYPE_MULTIPLE_STATUS_MAP

#define TP_HASH_TYPE_MULTIPLE_STATUS_MAP (tp_type_dbus_hash_sa_7bsv_7d ())

Mapping used in <tp:type>Last_Activity_And_Statuses</tp:type> and passed to <tp:member-ref>SetStatus</tp:member-ref>, representing a collection of statuses. Use of this mapping with more than one member is deprecated.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sa{sv}}.

Keys (D-Bus type s, named Status): (Undocumented)

Values (D-Bus type a{sv}, type String_Variant_Map, named Parameters): (Undocumented)


TP_HASH_TYPE_STATUS_SPEC_MAP

#define TP_HASH_TYPE_STATUS_SPEC_MAP (tp_type_dbus_hash_s_28ubba_7bss_7d_29 ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{s(ubba{ss})}.

Keys (D-Bus type s, named Identifier): (Undocumented)

Values (D-Bus type (ubba{ss}), type Status_Spec, named Spec): (Undocumented)


TP_STRUCT_TYPE_LAST_ACTIVITY_AND_STATUSES

#define TP_STRUCT_TYPE_LAST_ACTIVITY_AND_STATUSES (tp_type_dbus_struct_ua_7bsa_7bsv_7d_7d ())

Structure representing a contact's presence, containing a last-activity time (deprecated) and a Multiple_Status_Map.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ua{sa{sv}}).

Member 0 (D-Bus type u, type Unix_Timestamp, named Last_Activity): (Undocumented)

Member 1 (D-Bus type a{sa{sv}}, type Multiple_Status_Map, named Statuses): (Undocumented)


TP_STRUCT_TYPE_STATUS_SPEC

#define TP_STRUCT_TYPE_STATUS_SPEC (tp_type_dbus_struct_ubba_7bss_7d ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ubba{ss}).

Member 0 (D-Bus type u, type Connection_Presence_Type, named Type): (Undocumented)

Member 1 (D-Bus type b, named May_Set_On_Self): (Undocumented)

Member 2 (D-Bus type b, named Exclusive): (Undocumented)

Member 3 (D-Bus type a{ss}, type String_String_Map, named Parameter_Types): (Undocumented)


TP_HASH_TYPE_LOCATION

#define TP_HASH_TYPE_LOCATION (tp_type_dbus_hash_sv ())

A user's location, represented as an extensible mapping.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, named Key): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Civic addresses are represented by the following well-known keys (all of which have string values), which should be kept in sync with those used in XEP-0080 and in the Geoclue project:</p> <ul> <li>countrycode - s: an ISO-3166-1 alpha-2 (two-letter) country code, e.g. &quot;us&quot;, &quot;gb&quot;, &quot;fr&quot;</li> <li>country - s: a country name in unspecified locale, e.g. &quot;USA&quot;</li> <li>region - s: an administrative region of the nation, such as a state or province</li> <li>locality - s: a locality within the administrative region, such as a town or city</li> <li>area - s: a named area such as a campus or neighborhood</li> <li>postalcode - s: a code used for postal delivery</li> <li>street - s: a thoroughfare within the locality, or a crossing of two thoroughfares</li> </ul> <p>The following address keys are defined in XEP-0080 but not by Geoclue, and are also allowed:</p> <ul> <li>building - s: a specific building on a street or in an area</li> <li>floor - s: a particular floor in a building</li> <li>room - s: a particular room in a building</li> <li>text - s: any more specific information, e.g. &quot;Northwest corner of the lobby&quot;</li> <li>description - s: A natural-language name for or description of the location, e.g. &quot;Bill's house&quot;</li> <li>uri - s: a URI representing the location or pointing to more information about it</li> </ul> <p>Since the previous strings have data intended to be read by users, the language used should be stated using:</p> <ul> <li>language - s: a specific language or locale of location information in a format compatible to RFC 4646. Note that UTF-8 is the only allowed encoding, e.g. &quot;en&quot; or &quot;fr-CA&quot;.</li> </ul> <p>Positions are represented by the following well-known keys:</p> <ul> <li>lat - d: latitude in decimal degrees north, -90 to +90, relative to the WGS-84 datum <tp:rationale> This is from XEP-0080; the XEP allows use of a different datum, but recommends this one. We enforce sanity by requiring a consistent datum: a minimal compliant implementation of this specification in terms of XEP-0080 would simply ignore the &lt;lat&gt; and &lt;lon&gt; elements if &lt;datum&gt; exists and has a value other than WGS-84, while an advanced implementation might correct for the different datum. </tp:rationale> </li> <li>lon - d: Longitude in decimal degrees east, -180 to +180, relative to the WGS-84 datum <tp:rationale> Same rationale as 'lat' </tp:rationale> </li> <li>alt - d: altitude in metres above sea level (negative if below sea level) <tp:rationale> This is from XEP-0080 </tp:rationale> </li> <!-- Potentially to be reinstated later: http://bugs.freedesktop.org/show_bug.cgi?id=19585 <li>accuracy-level - i (<tp:type>Location_Accuracy_Level</tp:type>): an indication of accuracy, which SHOULD be omitted if it would be Location_Accuracy_Level_None or Location_Accuracy_Level_Detailed <tp:rationale> This is a struct field in GeoClue; the name is new in this specification, and was chosen in an attempt to avoid clashing with any future XEP-0080 terminology. </tp:rationale> </li> --> <li>accuracy - d: horizontal position error in metres if known <tp:rationale> This is from XEP-0080 </tp:rationale> </li> </ul> <p>Velocities are represented by the following well-known keys:</p> <ul> <li>speed - d: speed in metres per second <tp:rationale> This is from XEP-0080 </tp:rationale> </li> <li>bearing - d: direction of movement in decimal degrees, where North is 0 and East is 90 <tp:rationale> This is from XEP-0080, and is equivalent to the struct field called &quot;direction&quot; in GeoClue </tp:rationale> </li> </ul> <p>Other well-known keys:</p> <ul> <li>timestamp - x (<tp:type>Unix_Timestamp64</tp:type>): the time that the contact was at this location, in seconds since 1970-01-01T00:00:00Z (i.e. the beginning of 1970 in UTC) <tp:rationale> XEP-0080 uses an ISO 8601 string for this, but a number of seconds since the epoch is probably easier to work with. </tp:rationale> </li> </ul>

Values (D-Bus type v, named Value): The value corresponding to the well-known key.


TP_HASH_TYPE_CONTACT_LOCATIONS

#define TP_HASH_TYPE_CONTACT_LOCATIONS (tp_type_dbus_hash_ua_7bsv_7d ())

A map from contacts to their locations.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua{sv}}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact

Values (D-Bus type a{sv}, type Location, named Location): The contact's location, which MAY be empty to indicate that the contact's location is unknown


TP_HASH_TYPE_CONTACT_INFO_MAP

#define TP_HASH_TYPE_CONTACT_INFO_MAP (tp_type_dbus_hash_ua_28sasas_29 ())

A dictionary whose keys are contact handles and whose values are contact information..

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua(sasas)}.

Keys (D-Bus type u, type Contact_Handle, named Handle): (Undocumented)

Values (D-Bus type a(sasas), type Contact_Info_Field[], named Contact_Info): (Undocumented)


TP_STRUCT_TYPE_CONTACT_INFO_FIELD

#define TP_STRUCT_TYPE_CONTACT_INFO_FIELD (tp_type_dbus_struct_sasas ())

The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named &quot;adr&quot;.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sasas).

Member 0 (D-Bus type s, named Field_Name): The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named &quot;adr&quot;.

Member 1 (D-Bus type as, named Parameters): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'.</p> <tp:rationale> The type parameter 'type' is likely to be the most common, but there can be others, such as 'language=en'. </tp:rationale> <p>Characters which are required to be escaped in vCard type parameters should not be escaped in this list. For instance, a field &quot;X-FOO;SEMICOLON=\;:bar&quot; in a vCard would become ('x-foo', ['semicolon=;'], ['bar']) in this interface.</p> <tp:rationale> This avoids Telepathy UIs having to understand the escaping and unescaping rules for vCards. The type parameter name is not allowed (by RFC 2425) to contain an '=' character, so no ambiguity is introduced. </tp:rationale>

Member 2 (D-Bus type as, named Field_Value): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value.</p> <p>For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements).</p> <p>A vCard field with multiple comma-separated values, such as 'nickname', should be represented by several <tp:type>Contact_Info_Field</tp:type>s.</p> <p>Characters which are required to be escaped in vCard values, such as semi-colons and newlines, should not be escaped in this list (e.g. if a value contains a newline, the data passed over D-Bus should contain a literal newline character).</p> <tp:rationale> An earlier draft of this interface split structured vCard fields into multiple Telepathy-level fields; for example, 'n' became 'family-name', 'given-name', etc. But under this representation, omitting empty components leads to difficulty identifying where one name ends and another begins. Consider the fields ['given-name', 'honorific-suffixes', 'family-name', 'honorific-prefixes']: does this represent two 'n' fields, or one with incorrect component ordering? </tp:rationale>


TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST

#define TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST (tp_type_dbus_array_sasas ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CONTACT_INFO_FIELD.


TP_STRUCT_TYPE_FIELD_SPEC

#define TP_STRUCT_TYPE_FIELD_SPEC (tp_type_dbus_struct_sasuu ())

A struct describing a vCard field, with parameters, that may be passed to <tp:member-ref>SetContactInfo</tp:member-ref> on this Connection.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sasuu).

Member 0 (D-Bus type s, type VCard_Field, named Name): A vCard field name, such as 'tel'.

Member 1 (D-Bus type as, type VCard_Type_Parameter[], named Parameters): The set of vCard type parameters which may be set on this field. If this list is empty and the Contact_Info_Field_Flag_Parameters_Exact flag is not set, any vCard type parameters may be used.

Member 2 (D-Bus type u, type Contact_Info_Field_Flags, named Flags): Flags describing the behaviour of this field.

Member 3 (D-Bus type u, named Max): Maximum number of instances of this field which may be set. MAXUINT32 is used to indicate that there is no limit.


TP_ARRAY_TYPE_FIELD_SPECS

#define TP_ARRAY_TYPE_FIELD_SPECS (tp_type_dbus_array_sasuu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_FIELD_SPEC.


TP_HASH_TYPE_ADDRESSING_NORMALIZATION_MAP

#define TP_HASH_TYPE_ADDRESSING_NORMALIZATION_MAP (tp_type_dbus_hash_su ())

A map from URIs/vCard addresses to the corresponding handle.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{su}.

Keys (D-Bus type s, named Requested_String): The URI or vCard address that has been requested by <tp:member-ref>GetContactsByVCardField</tp:member-ref> or <tp:member-ref>GetContactsByURI</tp:member-ref>.

Values (D-Bus type u, type Contact_Handle, named Handle): A nonzero handle.


TP_HASH_TYPE_VCARD_FIELD_ADDRESS_MAP

#define TP_HASH_TYPE_VCARD_FIELD_ADDRESS_MAP (tp_type_dbus_hash_ss ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A mapping of vCard fields and addresses equivalent to a particular contact's protocol identifier. For instance, on XMPP this would contain <code>x-jabber</code> for all contacts, and <code>x-facebook-id</code> for contacts on Facebook's server.</p>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ss}.

Keys (D-Bus type s, named VCard_Field): A vCard field, such as <code>x-jabber</code>.

Values (D-Bus type s, named Address): The value of that vCard field for the contact.


TP_STRUCT_TYPE_CONTACT_SUBSCRIPTIONS

#define TP_STRUCT_TYPE_CONTACT_SUBSCRIPTIONS (tp_type_dbus_struct_uus ())

A single contact's subscribe, publish and publish-request attributes.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uus).

Member 0 (D-Bus type u, type Subscription_State, named Subscribe): The new value of the contact's &quot;subscribe&quot; attribute.

Member 1 (D-Bus type u, type Subscription_State, named Publish): The new value of the contact's &quot;publish&quot; attribute.

Member 2 (D-Bus type s, named Publish_Request): The new value of the contact's &quot;publish-request&quot; attribute, or the empty string if that attribute would be omitted.


TP_HASH_TYPE_CONTACT_SUBSCRIPTION_MAP

#define TP_HASH_TYPE_CONTACT_SUBSCRIPTION_MAP (tp_type_dbus_hash_u_28uus_29 ())

A map from contacts to their subscribe, publish and publish-request attributes.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{u(uus)}.

Keys (D-Bus type u, type Contact_Handle, named Contact): The contact's handle.

Values (D-Bus type (uus), type Contact_Subscriptions, named States): The contact's subscribe, publish and publish-request attributes.


TP_HASH_TYPE_CONTACT_CLIENT_TYPES

#define TP_HASH_TYPE_CONTACT_CLIENT_TYPES (tp_type_dbus_hash_uas ())

A mapping from contact handle to client types.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uas}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact.

Values (D-Bus type as, type Contact_Client_Type[], named Client_Types): The contact's client types as documented earlier in this interface.


TP_HASH_TYPE_MAIL

#define TP_HASH_TYPE_MAIL (tp_type_dbus_hash_sv ())

An extensible map representing a mail, or (on protocols where <tt>Thread_Based</tt> appears in <tp:member-ref>MailNotificationFlags</tp:member-ref>) a thread of mails. All keys are optional where not otherwise stated; however, at least one of &quot;senders&quot; and &quot;subject&quot; must be included.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, named Key): <p>A key providing information about the mail or thread. Well-known keys are as follows:</p> <dl> <dt>id — s</dt> <dd> <p>A unique ID for this e-mail. CMs with <tt>Supports_Unread_Mails</tt> set in <tp:member-ref>MailNotificationFlags</tp:member-ref> MUST provide this key in each <tp:type>Mail</tp:type>.</p> <p>If provided, the ID SHOULD be unique to a Mail at least until that mail is removed with the <tp:member-ref>UnreadMailsChanged</tp:member-ref> signal (in protocols with <tt>Supports_Unread_Emails</tt>), or unique for the duration of a session (otherwise).</p> <tp:rationale> <p>In protocols with Supports_Unread_Mails, this key is used to indicate which mail was removed. In protocols without that feature, it's impossible to tell when a mail has been removed (and hence how long the identifier will remain valid for use with <tp:member-ref>RequestMailURL</tp:member-ref>).</p> </tp:rationale> </dd> <dt>url-data — any type</dt> <dd>An opaque identifier (typically a string or list of strings) provided to the Connection when calling <tp:member-ref>RequestMailURL</tp:member-ref>, containing information used by the Connection to build the URL. </dd> <dt>senders — a(ss) (<tp:type>Mail_Address</tp:type>)</dt> <dd> An array of sender display name and e-mail address pairs. Note that only e-mails represented as a thread can have multiple senders. </dd> <dt>to-addresses — a(ss) (<tp:type>Mail_Address</tp:type>)</dt> <dd> An array of display name and e-mail address pairs representing the recipients. </dd> <dt>cc-addresses — a(ss) (<tp:type>Mail_Address</tp:type>)</dt> <dd> An array of display name and e-mail address pairs representing the carbon-copy recipients. </dd> <dt>sent-timestamp — x (<tp:type>Unix_Timestamp64</tp:type>)</dt> <dd>A UNIX timestamp indicating when the message was sent, or for a thread, when the most recent message was sent. </dd> <dt>received-timestamp — x (<tp:type>Unix_Timestamp64</tp:type>)</dt> <dd>A UNIX timestamp indicating when the message was received, or for a thread, when the most recent message was received. </dd> <dt>has-attachments — b</dt> <dd>If true, this mail has attachments.</dd> <dt>subject — s</dt> <dd> The subject of the message. This MUST be encoded in UTF-8. </dd> <dt>content-type — s</dt> <dd> <p>The MIME type of the message content. Two types are currently supported: &quot;text/plain&quot; for plain text, and &quot;text/html&quot; for a HTML document. If omitted, &quot;text/plain&quot; MUST be assumed. Regardless of MIME type, the content MUST be valid UTF-8 (which may require that the Connection transcodes it from a legacy encoding).</p> <tp:rationale> <p>All strings on D-Bus must be UTF-8.</p> </tp:rationale> </dd> <dt>truncated — b</dt> <dd> If true, the content is only a partial message; if false or omitted, the content is the entire message. </dd> <dt>content — s</dt> <dd> The body of the message, possibly truncated, encoded as appropriate for &quot;content-type&quot;. </dd> <dt>folder — s</dt> <dd> The name of the folder containing this e-mails. If omitted, the inbox SHOULD be assumed. </dd> </dl>

Values (D-Bus type v, named Value): The value, of whatever type is appropriate for the key.


TP_ARRAY_TYPE_MAIL_LIST

#define TP_ARRAY_TYPE_MAIL_LIST (tp_type_dbus_array_of_a_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_MAIL.


TP_STRUCT_TYPE_MAIL_ADDRESS

#define TP_STRUCT_TYPE_MAIL_ADDRESS (tp_type_dbus_struct_ss ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>A pair (name, address) representing an e-mail address, such as (&quot;Nicolas Dufresne&quot;, &quot;nicolas.dufresnecollabora.co.uk &quot;). At least one of name and address MUST be provided. A missing element will be represented by the empty string.</p>

<tp:rationale>

<p> The CM should provide as much information as possible, but not all protocols provide both the displayed name and the address. (If a protocol doesn't provide either, it should omit the appropriate field from the <tp:type>Mail</tp:type> entirely.) </p>

</tp:rationale>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ss).

Member 0 (D-Bus type s, named Name): The displayed name corresponding to the e-mail address

Member 1 (D-Bus type s, named Address): The actual e-mail address


TP_ARRAY_TYPE_MAIL_ADDRESS_LIST

#define TP_ARRAY_TYPE_MAIL_ADDRESS_LIST (tp_type_dbus_array_ss ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MAIL_ADDRESS.


TP_STRUCT_TYPE_MAIL_URL

#define TP_STRUCT_TYPE_MAIL_URL (tp_type_dbus_struct_sua_28ss_29 ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>A structure containing the required information to open a web-based e-mail UI, without needing re-authentication (if possible).</p>

<p>Because the URL and POST data frequently contain short-lived credential tokens, a new URL should be requested (by calling one of the methods that returns a Mail_URL) for each visit to the web-based UI, and the URL should be visited soon after it is returned.</p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sua(ss)).

Member 0 (D-Bus type s, named URL): The URL to which to send a request.

Member 1 (D-Bus type u, type HTTP_Method, named Method): The HTTP method of the request.

Member 2 (D-Bus type a(ss), type HTTP_Post_Data[], named Post_Data): An array of name-value pairs containing the POST data to use when opening the URL. This MUST be an empty array if the Method is not POST.


TP_STRUCT_TYPE_HTTP_POST_DATA

#define TP_STRUCT_TYPE_HTTP_POST_DATA (tp_type_dbus_struct_ss ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p> A pair (key, value) representing POST data compatible with the application/x-www-form-urlencoded MIME type. The strings MUST be valid UTF-8 strings, and the characters used in the key MUST obey the requirements of the

<a href="http://www.w3.org/TR/html401/types.htmltype-cdata"> HTML CDATA type</a> . The value MUST NOT be encoded with HTML entities. </p>

<p>For example, if the POST data should contain a key &quot;less-than&quot; with value &quot;&lt;&quot;, and a key &quot;percent&quot; with value &quot;%&quot;, this should be represented as two HTTP_Post_Data structures, (&quot;less-than&quot;, &quot;&lt;&quot;) and (&quot;percent&quot;, &quot;%&quot;), resulting in a POST request whose request body is &quot;less-than=&amp;lt;&amp;percent=25&quot;. If a client passes this to a browser by writing it into an HTML form, it could do so by representing it as:</p>

<pre> &lt;input type=&quot;hidden&quot; name=&quot;less-than&quot;&gt;&amp;lt;&lt;/input&gt; &lt;input type=&quot;hidden&quot; name=&quot;percent&quot;&gt;%&lt;/input&gt; </pre>

<tp:rationale>

<p> This data can be used to generate a HTML file that will automatically load the URL with appropriate POST data, in which case the client MUST convert any characters that are special within HTML into HTML entities. Alternatively, it can be used in an API that will instruct the browser how to load the URL (like the Netscape Plug-in API), in which case the client MUST escape

<a href="http://www.ietf.org/rfc/rfc1738.txt">characters that are reserved in URLs</a> , if appropriate for that API. </p>

<p>An array of pairs is used instead of a map from keys to values, because it's valid to repeat keys in both HTML and x-www-form-urlencoded data.</p>

</tp:rationale>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ss).

Member 0 (D-Bus type s, named Key): The key, corresponding to a HTML control name

Member 1 (D-Bus type s, named Value): The value


TP_ARRAY_TYPE_HTTP_POST_DATA_LIST

#define TP_ARRAY_TYPE_HTTP_POST_DATA_LIST (tp_type_dbus_array_ss ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_HTTP_POST_DATA.


TP_STRUCT_TYPE_LOCAL_PENDING_INFO

#define TP_STRUCT_TYPE_LOCAL_PENDING_INFO (tp_type_dbus_struct_uuus ())

A structure representing a contact whose attempt to join a group is to be confirmed by the local user using

<tp:member-ref>AddMembers</tp:member-ref> .

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuus).

Member 0 (D-Bus type u, type Contact_Handle, named To_Be_Added): The contact to be added to the group

Member 1 (D-Bus type u, type Contact_Handle, named Actor): The contact requesting or causing the change

Member 2 (D-Bus type u, type Channel_Group_Change_Reason, named Reason): The reason for the change

Member 3 (D-Bus type s, named Message): A human-readable message from the Actor, or an empty string if there is no message


TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST

#define TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST (tp_type_dbus_array_uuus ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_LOCAL_PENDING_INFO.


TP_HASH_TYPE_HANDLE_OWNER_MAP

#define TP_HASH_TYPE_HANDLE_OWNER_MAP (tp_type_dbus_hash_uu ())

A map from channel-specific handles to their owners.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Contact_Handle, named Channel_Specific_Handle): A nonzero channel-specific handle

Values (D-Bus type u, type Contact_Handle, named Global_Handle): The global handle that owns the corresponding channel-specific handle, or 0 if this could not be determined


TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP

#define TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP (tp_type_dbus_hash_us ())

A map from handles to the corresponding normalized string identifier.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{us}.

Keys (D-Bus type u, type Contact_Handle, named Handle): A nonzero handle

Values (D-Bus type s, named Identifier): The same string that would be returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">InspectHandles</tp:dbus-ref> for this handle.


TP_HASH_TYPE_CHANNEL_ORIGINATOR_MAP

#define TP_HASH_TYPE_CHANNEL_ORIGINATOR_MAP (tp_type_dbus_hash_uo ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> A mapping from members of a conference to the original 1-1 channel with that contact, if any. See <tp:member-ref>OriginalChannels</tp:member-ref> for details.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uo}.

Keys (D-Bus type u, type Contact_Handle, named Channel_Specific_Handle): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> A channel-specific handle for a participant in this conference.

Values (D-Bus type o, named Original_Channel): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The object path of <tp:member-ref>Channels</tp:member-ref> representing the original 1-1 channel with <var>Channel_Specific_Handle</var>.


TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE

#define TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE (tp_type_dbus_struct_uuuuus ())

A struct (message ID, timestamp in seconds since 1970-01-01 00:00 UTC, sender's handle, message type, flags, text) representing a pending text message, as returned by

<tp:member-ref>ListPendingMessages</tp:member-ref> . The arguments of the <tp:member-ref>Received</tp:member-ref> signal also match this struct's signature.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuuuus).

Member 0 (D-Bus type u, type Message_ID, named Identifier): (Undocumented)

Member 1 (D-Bus type u, type Unix_Timestamp, named Unix_Timestamp): (Undocumented)

Member 2 (D-Bus type u, type Contact_Handle, named Sender): (Undocumented)

Member 3 (D-Bus type u, type Channel_Text_Message_Type, named Message_Type): (Undocumented)

Member 4 (D-Bus type u, type Channel_Text_Message_Flags, named Flags): (Undocumented)

Member 5 (D-Bus type s, named Text): (Undocumented)


TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST

#define TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST (tp_type_dbus_array_uuuuus ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE.


TP_HASH_TYPE_MESSAGE_PART

#define TP_HASH_TYPE_MESSAGE_PART (tp_type_dbus_hash_sv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Part of a message's content. In practice, this mapping never appears in isolation: incoming messages are represented by a list of <tp:type>Message_Part</tp:type> mappings in the <tp:member-ref>MessageReceived</tp:member-ref> signal, and outgoing messages are passed to <tp:member-ref>SendMessage</tp:member-ref> as a list of these mappings.</p> <p>The first part of the message contains &quot;headers&quot;, which refer to the entire message. The second and subsequent parts contain the message's content, including plain text, formatted text and/or attached files. Well-known keys for the header and body parts are defined by the <tp:type>Message_Header_Key</tp:type> and <tp:type>Message_Body_Key</tp:type> types, respectively. It is an error for a connection manager to put keys referring to the message as a whole in the second or subsequent Message_Part, or keys intended for body parts in the first Message_Part; clients MUST recover from this error by ignoring these mis-placed keys.</p> <tp:rationale> <p>Instead of representing messages as aa{sv} where the first dictionary is special (a dictionary of headers), we could have used a signature like (a{sv}aa{sv}) to separate out the headers and the body parts.</p> <p>However, this would make access to the messages more awkward. In Python, the syntax for access to a header field would remain <code>message0</code>, but access to a body field in the second body part would change from <code>message2 to message1['content']</code>. In GLib, the message would change from being a <code>GPtrArray(GHashTable)</code> to being a <code>GValueArray(GHashTable, GPtrArray(GHashTable))</code> which is rather inconvenient to dereference.</p> </tp:rationale> <p>In any group of parts with the same non-empty value for the <tt>alternative</tt> key (which represent alternative versions of the same content), more faithful versions of the intended message MUST come before less faithful versions (note that this order is the opposite of MIME <tt>multipart/alternative</tt> parts). Clients SHOULD display the first alternative that they understand.</p> <tp:rationale> <p>Specifying the preference order means that if the underlying protocol doesn't support alternatives, the CM can safely delete everything apart from the first supported alternative when sending messages.</p> <p>The order is the reverse of MIME because MIME's rationale for placing the &quot;plainest&quot; part first (legibility in pre-MIME UAs) does not apply to us, and placing the most preferred part first simplifies display (a client can iterate the message in order, display the first alternative that it understands, and skip displaying all subsequent parts with the same &quot;alternative&quot; key).</p> </tp:rationale> <p>Clients SHOULD present all parts that are not redundant alternatives in the order they appear in this array, possibly excluding parts that are referenced by another displayed part. It is implementation-specific how the parts are presented to the user.</p> <tp:rationale> <p>This allows CMs to assume that all parts are actually shown to the user, even if they are not explicitly referenced - we do not yet recommend formatted text, and there is no way for plain text to reference an attachment since it has no concept of markup or references. This also forces clients to do something sensible with messages that consist entirely of &quot;attachments&quot;, with no &quot;body&quot; at all.</p> <p>For instance, when displaying the above example, a client that understands the HTML part should display the JPEG image once, between the two lines &quot;Here is a photo of my cat:&quot; and &quot;Isn't it cute?&quot;; it may additionally present the image in some way for a second time, after &quot;Isn't it cute?&quot;, or may choose not to.</p> <p>A client that does not understand HTML, displaying the same message, should display the plain-text part, followed by the JPEG image.</p> </tp:rationale> <p>Connection managers, clients and extensions to this specification SHOULD NOT include <tp:type>Handle</tp:type>s as values in a Message_Part, except for <code>message-sender</code> in the header.</p> <tp:rationale> <p>Reference-counting handles in clients becomes problematic if the channel proxy cannot know whether particular map values are handles or not.</p> </tp:rationale> <h4>Example messages</h4> <p>A rich-text message, with an embedded image, might be represented as:</p> <pre> [ { 'message-token': '9de9546a-3400-4419-a505-3ea270cb834c', 'message-sender': 42, 'message-sent': 1210067943, 'message-received': 1210067947, 'message-type': 0, # = Channel_Text_Message_Type_Normal 'pending-message-id': 437, }, { 'alternative': 'main', 'content-type': 'text/html', 'content': 'Here is a photo of my cat:&lt;br /&gt;' + '&lt;img src=&quot;cid:catphoto&quot; alt=&quot;lol!&quot; /&gt;' + '&lt;br /&gt;Isn't it cute?', }, { 'alternative': 'main', 'content-type': 'text/plain', 'content': 'Here is a photo of my cat:\n[IMG: lol!]\nIsn't it cute?', }, { 'identifier': 'catphoto', 'content-type': 'image/jpeg', 'size': 101000, 'needs-retrieval': True, }, ]</pre> <p>telepathy-ring, Nokia's GSM connection manager, represents vCards sent via SMS as:</p> <pre> [ { 'message-token': '9de9546a-3400-4419-a505-3ea270cb834c', 'message-sender': 42, 'message-sent': 1210067943, 'message-received': 1210067947, 'message-type': 0, # = Channel_Text_Message_Type_Normal 'pending-message-id': 437, }, { 'content-type': 'text/x-vcard', 'content': [ 0x66, 0x69, 0x71, ...], # vCard data as an array of bytes }, ]</pre> <h3>Delivery reports</h3> <div> <p>Delivery reports are also represented as messages with the <tt>message-type</tt> header mapping to <tp:type>Channel_Text_Message_Type</tp:type> Delivery_Report. Delivery reports SHOULD contain the <tt>message-sender</tt> header, mapping to the intended recipient of the original message, if possible; other headers specific to delivery reports are defined by the <tp:type>Delivery_Report_Header_Key</tp:type> type. The second and subsequent parts, if present, are a human-readable report from the IM service.</p> <p>For backwards- and forwards-compatibility, whenever a delivery error report is signalled—that is, with <tt>delivery-status</tt> mapping to <tp:type>Delivery_Status</tp:type> Temporarily_Failed or Permanently_Failed—<tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">SendError</tp:dbus-ref> SHOULD also be emitted; whenever <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">SendError</tp:dbus-ref> is emitted, a delivery report MUST also be signalled. Delivery report messages on this interface MUST be represented in emissions of <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">Received</tp:dbus-ref> as messages with the Non_Text_Content <tp:type>Channel_Text_Message_Flags</tp:type>; clients which understand this interface SHOULD ignore the SendError signal in favour of listening for delivery reports, as mentioned in the introduction.</p> <p>The result of attempting to send delivery reports using <tp:member-ref>SendMessage</tp:member-ref> is currently undefined.</p> <h4>Example delivery reports</h4> <dl> <dt>A minimal delivery report indicating permanent failure of the sent message whose token was <code>b9a991bd-8845-4d7f-a704-215186f43bb4</code> for an unknown reason</dt> <dd><pre> [{ # header 'message-sender': 123, 'message-type': Channel_Text_Message_Type_Delivery_Report, 'delivery-status': Delivery_Status_Permanently_Failed, 'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4', } # no body ]</pre></dd> <dt>A delivery report where the failed message is echoed back to the sender rather than being referenced by ID, and the failure reason is that this protocol cannot send messages to offline contacts such as the contact with handle 123</dt> <dd><pre> [{ # header 'message-sender': 123, 'message-type': Channel_Text_Message_Type_Delivery_Report, 'delivery-status': Delivery_Status_Temporarily_Failed, 'delivery-error': Channel_Text_Send_Error_Offline, 'delivery-echo': [{ # header of original message 'message-sender': 1, 'message-sent': 1210067943, }, { # body of original message 'content-type': 'text/plain', 'content': 'Hello, world!', }] ], # no body ]</pre></dd> <dt>A maximally complex delivery report: the server reports a bilingual human-readable failure message because the user sent a message &quot;Hello, world!&quot; with token <code>b9a991bd-8845-4d7f-a704-215186f43bb4</code> to a contact with handle 123, but that handle represents a contact who does not actually exist</dt> <dd><pre> [{ # header 'message-sender': 123, 'message-type': Channel_Text_Message_Type_Delivery_Report, 'delivery-status': Delivery_Status_Permanently_Failed, 'delivery-error': Channel_Text_Send_Error_Invalid_Contact, 'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4', 'delivery-echo': [{ # header of original message 'message-sender': 1, 'message-sent': 1210067943, }, { # body of original message 'content-type': 'text/plain', 'content': 'Hello, world!', }] ], }, { # message from server (alternative in English) 'alternative': '404', 'content-type': 'text/plain', 'lang': 'en', 'content': 'I have no contact with that name', }, { # message from server (alternative in German) 'alternative': '404'. 'content-type': 'text/plain', 'lang': 'de', 'content', 'Ich habe keinen Kontakt mit diesem Namen', } ]</pre></dd> <dt>A minimal delivery report indicating successful delivery of the sent message whose token was <code>b9a991bd-8845-4d7f-a704-215186f43bb4</code></dt> <dd><pre> [{ # header 'message-sender': 123, 'message-type': Channel_Text_Message_Type_Delivery_Report, 'delivery-status': Delivery_Status_Delivered, 'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4', } # no body ]</pre></dd> </dl> </div>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, named Key): A key, which SHOULD be one of the well-known keys specified by <tp:type>Message_Header_Key</tp:type>, <tp:type>Message_Body_Key</tp:type> or <tp:type>Delivery_Report_Header_Key</tp:type> if possible.

Values (D-Bus type v, named Value): The value corresponding to the given key, which SHOULD be one of the specified types for well-known keys.


TP_ARRAY_TYPE_MESSAGE_PART_LIST

#define TP_ARRAY_TYPE_MESSAGE_PART_LIST (tp_type_dbus_array_of_a_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_MESSAGE_PART.


TP_HASH_TYPE_MESSAGE_PART_CONTENT_MAP

#define TP_HASH_TYPE_MESSAGE_PART_CONTENT_MAP (tp_type_dbus_hash_uv ())

A mapping from message part indexes to their content, as returned by <tp:member-ref>GetPendingMessageContent</tp:member-ref>.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uv}.

Keys (D-Bus type u, type Message_Part_Index, named Part): Indexes into the array of <tp:type>Message_Part</tp:type>s that represents a message. The &quot;headers&quot; part (which is not a valid argument to GetPendingMessageContent) is considered to be part 0, so the valid part numbers start at 1 (for the second message part).

Values (D-Bus type v, named Content): The message part's content. The variant MUST contain either type 's' or 'ay' (UTF-8 text string, or byte array), following the same rules as for the value of the 'content' key in the <tp:type>Message_Part</tp:type> mappings.


TP_HASH_TYPE_CHAT_STATE_MAP

#define TP_HASH_TYPE_CHAT_STATE_MAP (tp_type_dbus_hash_uu ())

A map from contacts to their chat states.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact

Values (D-Bus type u, type Channel_Chat_State, named State): The contact's chat state


TP_HASH_TYPE_SUPPORTED_SOCKET_MAP

#define TP_HASH_TYPE_SUPPORTED_SOCKET_MAP (tp_type_dbus_hash_uau ())

The supported socket address and access-control types for tubes. See GetAvailableStreamTubeTypes.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uau}.

Keys (D-Bus type u, type Socket_Address_Type, named Address_Type): (Undocumented)

Values (D-Bus type au, type Socket_Access_Control[], named Access_Control): (Undocumented)


TP_STRUCT_TYPE_TUBE_INFO

#define TP_STRUCT_TYPE_TUBE_INFO (tp_type_dbus_struct_uuusa_7bsv_7du ())

A struct (tube ID, initiator handle, tube type, service name, parameters, state) representing a tube, as returned by ListTubes on the Tubes channel type.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuusa{sv}u).

Member 0 (D-Bus type u, type Tube_ID, named Identifier): (Undocumented)

Member 1 (D-Bus type u, type Contact_Handle, named Initiator): (Undocumented)

Member 2 (D-Bus type u, type Tube_Type, named Type): (Undocumented)

Member 3 (D-Bus type s, named Service): (Undocumented)

Member 4 (D-Bus type a{sv}, type String_Variant_Map, named Parameters): (Undocumented)

Member 5 (D-Bus type u, type Tube_State, named State): (Undocumented)


TP_ARRAY_TYPE_TUBE_INFO_LIST

#define TP_ARRAY_TYPE_TUBE_INFO_LIST (tp_type_dbus_array_uuusa_7bsv_7du ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_TUBE_INFO.


TP_STRUCT_TYPE_DBUS_TUBE_MEMBER

#define TP_STRUCT_TYPE_DBUS_TUBE_MEMBER (tp_type_dbus_struct_us ())

Represents a participant in a multi-user D-Bus tube, as returned by <tp:member-ref>GetDBusNames</tp:member-ref> and seen in the

<tp:member-ref>DBusNamesChanged</tp:member-ref> signal.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (us).

Member 0 (D-Bus type u, type Contact_Handle, named Handle): The handle of a participant in this D-Bus tube.

Member 1 (D-Bus type s, type DBus_Unique_Name, named Unique_Name): That participant's unique name.


TP_ARRAY_TYPE_DBUS_TUBE_MEMBER_LIST

#define TP_ARRAY_TYPE_DBUS_TUBE_MEMBER_LIST (tp_type_dbus_array_us ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_DBUS_TUBE_MEMBER.


TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS

#define TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS (tp_type_dbus_hash_us ())

Represents the participants in a multi-user D-Bus tube, as used by the <tp:member-ref>DBusNames</tp:member-ref> property and the <tp:member-ref>DBusNamesChanged</tp:member-ref> signal.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{us}.

Keys (D-Bus type u, type Contact_Handle, named Handle): The handle of a participant in this D-Bus tube.

Values (D-Bus type s, type DBus_Unique_Name, named Unique_Name): That participant's unique name.


TP_STRUCT_TYPE_PROPERTY_SPEC

#define TP_STRUCT_TYPE_PROPERTY_SPEC (tp_type_dbus_struct_ussu ())

A struct (property ID, property name, D-Bus signature, flags) representing a property, as returned by ListProperties on the Properties interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ussu).

Member 0 (D-Bus type u, named Property_ID): (Undocumented)

Member 1 (D-Bus type s, named Name): (Undocumented)

Member 2 (D-Bus type s, type DBus_Signature, named Signature): (Undocumented)

Member 3 (D-Bus type u, type Property_Flags, named Flags): (Undocumented)


TP_ARRAY_TYPE_PROPERTY_SPEC_LIST

#define TP_ARRAY_TYPE_PROPERTY_SPEC_LIST (tp_type_dbus_array_ussu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_PROPERTY_SPEC.


TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE

#define TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE (tp_type_dbus_struct_uu ())

A struct (property ID, flags) representing a change to a property's flags, as seen in the PropertyFlagsChanged signal on the Properties interface.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uu).

Member 0 (D-Bus type u, named Property_ID): (Undocumented)

Member 1 (D-Bus type u, named New_Flags): (Undocumented)


TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST

#define TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST (tp_type_dbus_array_uu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE.


TP_STRUCT_TYPE_PROPERTY_VALUE

#define TP_STRUCT_TYPE_PROPERTY_VALUE (tp_type_dbus_struct_uv ())

A struct (property ID, value) representing a property's value, as seen in the PropertiesChanged signal on the Properties interface, returned by the GetProperties method and passed to the SetProperties method.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uv).

Member 0 (D-Bus type u, type Property_ID, named Identifier): (Undocumented)

Member 1 (D-Bus type v, named Value): (Undocumented)


TP_ARRAY_TYPE_PROPERTY_VALUE_LIST

#define TP_ARRAY_TYPE_PROPERTY_VALUE_LIST (tp_type_dbus_array_uv ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_PROPERTY_VALUE.


TP_ARRAY_TYPE_MEDIA_SESSION_HANDLER_INFO_LIST

#define TP_ARRAY_TYPE_MEDIA_SESSION_HANDLER_INFO_LIST (tp_type_dbus_array_os ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MEDIA_SESSION_HANDLER_INFO.


TP_STRUCT_TYPE_MEDIA_SESSION_HANDLER_INFO

#define TP_STRUCT_TYPE_MEDIA_SESSION_HANDLER_INFO (tp_type_dbus_struct_os ())

A struct representing a active session handler.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (os).

Member 0 (D-Bus type o, named Session_Handler): The object path of the session handler, which is on the same bus name as the channel.

Member 1 (D-Bus type s, type Media_Session_Type, named Media_Session_Type): The media session's type


TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE_LIST

#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE_LIST (tp_type_dbus_array_sa_28usuussduss_29 ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE.


TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CODEC_LIST

#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CODEC_LIST (tp_type_dbus_array_usuuua_7bss_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CODEC.


TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT_LIST

#define TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT_LIST (tp_type_dbus_array_usuussduss ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT.


TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE

#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE (tp_type_dbus_struct_sa_28usuussduss_29 ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sa(usuussduss)).

Member 0 (D-Bus type s, named Name): (Undocumented)

Member 1 (D-Bus type a(usuussduss), type Media_Stream_Handler_Transport[], named Transports): (Undocumented)


TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CODEC

#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CODEC (tp_type_dbus_struct_usuuua_7bss_7d ())

Information about a codec supported by a client or a peer's client.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usuuua{ss}).

Member 0 (D-Bus type u, named Codec_ID): The codec's payload identifier, as per RFC 3551 (static or dynamic)

Member 1 (D-Bus type s, named Name): The codec's name

Member 2 (D-Bus type u, type Media_Stream_Type, named Media_Type): Type of stream this codec supports

Member 3 (D-Bus type u, named Clock_Rate): Sampling frequency in Hertz

Member 4 (D-Bus type u, named Number_Of_Channels): Number of supported channels

Member 5 (D-Bus type a{ss}, type String_String_Map, named Parameters): Codec-specific optional parameters


TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT

#define TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT (tp_type_dbus_struct_usuussduss ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usuussduss).

Member 0 (D-Bus type u, named Component_Number): (Undocumented)

Member 1 (D-Bus type s, named IP_Address): (Undocumented)

Member 2 (D-Bus type u, named Port): (Undocumented)

Member 3 (D-Bus type u, type Media_Stream_Base_Proto, named Protocol): (Undocumented)

Member 4 (D-Bus type s, named Subtype): (Undocumented)

Member 5 (D-Bus type s, named Profile): (Undocumented)

Member 6 (D-Bus type d, named Preference_Value): (Undocumented)

Member 7 (D-Bus type u, type Media_Stream_Transport_Type, named Transport_Type): (Undocumented)

Member 8 (D-Bus type s, named Username): (Undocumented)

Member 9 (D-Bus type s, named Password): (Undocumented)


TP_STRUCT_TYPE_MEDIA_STREAM_INFO

#define TP_STRUCT_TYPE_MEDIA_STREAM_INFO (tp_type_dbus_struct_uuuuuu ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuuuuu).

Member 0 (D-Bus type u, type Stream_ID, named Identifier): (Undocumented)

Member 1 (D-Bus type u, type Contact_Handle, named Contact): (Undocumented)

Member 2 (D-Bus type u, type Media_Stream_Type, named Type): (Undocumented)

Member 3 (D-Bus type u, type Media_Stream_State, named State): (Undocumented)

Member 4 (D-Bus type u, type Media_Stream_Direction, named Direction): (Undocumented)

Member 5 (D-Bus type u, type Media_Stream_Pending_Send, named Pending_Send_Flags): (Undocumented)


TP_ARRAY_TYPE_MEDIA_STREAM_INFO_LIST

#define TP_ARRAY_TYPE_MEDIA_STREAM_INFO_LIST (tp_type_dbus_array_uuuuuu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_MEDIA_STREAM_INFO.


TP_HASH_TYPE_CHANNEL_CALL_STATE_MAP

#define TP_HASH_TYPE_CHANNEL_CALL_STATE_MAP (tp_type_dbus_hash_uu ())

A map from contacts to call states.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Contact_Handle, named Contact): A contact involved in this call.

Values (D-Bus type u, type Channel_Call_State_Flags, named State): State flags for the given contact.


TP_ARRAY_TYPE_RTCP_FEEDBACK_MESSAGE_LIST

#define TP_ARRAY_TYPE_RTCP_FEEDBACK_MESSAGE_LIST (tp_type_dbus_array_sss ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE.


TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST

#define TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST (tp_type_dbus_array_uuss ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_RTP_HEADER_EXTENSION.


TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP

#define TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP (tp_type_dbus_hash_u_28ua_28sss_29_29 ())

A map of codec and its feedback properties.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{u(ua(sss))}.

Keys (D-Bus type u, named Codec_Identifier): Numeric identifier for the codec. This will be used as the PT in the SDP or content description.

Values (D-Bus type (ua(sss)), type RTCP_Feedback_Message_Properties, named Properties): The RTCP feedback properties for this codec.


TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE

#define TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE (tp_type_dbus_struct_sss ())

A struct defining an RTCP feedback message.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (sss).

Member 0 (D-Bus type s, named Type): Feedback type, for example &quot;ack&quot;, &quot;nack&quot;, or &quot;ccm&quot;.

Member 1 (D-Bus type s, named Subtype): Feedback subtype, according to the Type, can be an empty string (&quot;&quot;), if there is no subtype. For example, generic nack is Type=&quot;nack&quot; Subtype=&quot;&quot;.

Member 2 (D-Bus type s, named Parameters): Feedback parameters as a string. Format is defined in the relevant RFC


TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE_PROPERTIES

#define TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE_PROPERTIES (tp_type_dbus_struct_ua_28sss_29 ())

The minimum interval between two regular RTCP packets in milliseconds for this content. If no special value is desired, one should put MAXUINT (0xFFFFFFFF).

Implementors and users of Call's <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription.Interface">RTCPFeedback</tp:dbus-ref> should not use the MAXUINT default. Instead, in RTP/AVP, the default should be 5000 (5 seconds). If using the RTP/AVPF profile, it can be set to a lower value, the default being 0.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ua(sss)).

Member 0 (D-Bus type u, named RTCPMinimumInterval): The minimum interval between two regular RTCP packets in milliseconds for this content. If no special value is desired, one should put MAXUINT (0xFFFFFFFF). Implementors and users of Call's <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription.Interface">RTCPFeedback</tp:dbus-ref> should not use the MAXUINT default. Instead, in RTP/AVP, the default should be 5000 (5 seconds). If using the RTP/AVPF profile, it can be set to a lower value, the default being 0.

Member 1 (D-Bus type a(sss), type RTCP_Feedback_Message[], named Messages): The RTCP feedback messages for this codec.


TP_STRUCT_TYPE_RTP_HEADER_EXTENSION

#define TP_STRUCT_TYPE_RTP_HEADER_EXTENSION (tp_type_dbus_struct_uuss ())

A struct defining a RTP Header extension.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuss).

Member 0 (D-Bus type u, named ID): Identifier to be negotiated.

Member 1 (D-Bus type u, type Media_Stream_Direction, named Direction): Direction in which the Header Extension is negotiated.

Member 2 (D-Bus type s, named URI): URI defining the extension.

Member 3 (D-Bus type s, named Parameters): Feedback parameters as a string. Format is defined in the relevant RFC.


TP_ARRAY_TYPE_ROOM_INFO_LIST

#define TP_ARRAY_TYPE_ROOM_INFO_LIST (tp_type_dbus_array_usa_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_ROOM_INFO.


TP_STRUCT_TYPE_ROOM_INFO

#define TP_STRUCT_TYPE_ROOM_INFO (tp_type_dbus_struct_usa_7bsv_7d ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usa{sv}).

Member 0 (D-Bus type u, type Room_Handle, named Handle): (Undocumented)

Member 1 (D-Bus type s, type DBus_Interface, named Channel_Type): (Undocumented)

Member 2 (D-Bus type a{sv}, type String_Variant_Map, named Info): (Undocumented)


TP_STRUCT_TYPE_SERVICE_POINT

#define TP_STRUCT_TYPE_SERVICE_POINT (tp_type_dbus_struct_us ())

A service point.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (us).

Member 0 (D-Bus type u, type Service_Point_Type, named Service_Point_Type): The service type.

Member 1 (D-Bus type s, named Service): String representation of the service point. The representation is service specific; it may be a 'service' Uniform Resource Name as specified by <a href="http://www.rfc-editor.org/rfc/rfc5031.txt">RFC 5031</a>, or may be in some other form. Empty, unused or unknown value is represented by &quot;&quot;.


TP_ARRAY_TYPE_SERVICE_POINT_INFO_LIST

#define TP_ARRAY_TYPE_SERVICE_POINT_INFO_LIST (tp_type_dbus_array__28us_29as ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_SERVICE_POINT_INFO.


TP_STRUCT_TYPE_SERVICE_POINT_INFO

#define TP_STRUCT_TYPE_SERVICE_POINT_INFO (tp_type_dbus_struct__28us_29as ())

The service point.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature ((us)as).

Member 0 (D-Bus type (us), type Service_Point, named Service_Point): The service point.

Member 1 (D-Bus type as, named Service_IDs): A list of IDs that are mapped to this service. This is provided as a convenience for the UIs, but the preferred method for requesting channel to a service is by setting the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.ServicePoint">InitialServicePoint</tp:dbus-ref> property in a channel request.


enum TpChannelContactSearchState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED

The search has not started

 

TP_CHANNEL_CONTACT_SEARCH_STATE_IN_PROGRESS

The search is in progress

 

TP_CHANNEL_CONTACT_SEARCH_STATE_MORE_AVAILABLE

The search has paused, but more results can be retrieved by calling More.

 

TP_CHANNEL_CONTACT_SEARCH_STATE_COMPLETED

The search has been completed

 

TP_CHANNEL_CONTACT_SEARCH_STATE_FAILED

The search has failed

 

TP_NUM_CHANNEL_CONTACT_SEARCH_STATES

#define TP_NUM_CHANNEL_CONTACT_SEARCH_STATES (4+1)

1 higher than the highest valid value of TpChannelContactSearchState.


NUM_TP_CHANNEL_CONTACT_SEARCH_STATES

#define NUM_TP_CHANNEL_CONTACT_SEARCH_STATES TP_NUM_CHANNEL_CONTACT_SEARCH_STATES

1 higher than the highest valid value of TpChannelContactSearchState. In new code, use TP_NUM_CHANNEL_CONTACT_SEARCH_STATES instead.


TP_HASH_TYPE_CONTACT_SEARCH_MAP

#define TP_HASH_TYPE_CONTACT_SEARCH_MAP (tp_type_dbus_hash_ss ())

A map from search keys to search terms.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ss}.

Keys (D-Bus type s, type Contact_Search_Key, named Key): The search key to match against

Values (D-Bus type s, named Term): The term or terms to be searched for in the search key; depending on the protocol and the server implementation, this may be matched by exact or approximate equality, substring matching, word matching or any other matching algorithm


TP_HASH_TYPE_CONTACT_SEARCH_RESULT_MAP

#define TP_HASH_TYPE_CONTACT_SEARCH_RESULT_MAP (tp_type_dbus_hash_sa_28sasas_29 ())

A map from contact identifier to search result, emitted in the <tp:member-ref>SearchResultReceived</tp:member-ref> signal.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sa(sasas)}.

Keys (D-Bus type s, named Contact_Identifier): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The identifier of a contact matching the search terms. <tp:rationale> This is an identifier rather than a handle in case we make handles immortal; see <a href="https://bugs.freedesktop.org/show_bug.cgi?id=23155">fd.o23155</a> and <a href="https://bugs.freedesktop.org/show_bug.cgi?id=13347c5">fd.o13347 comment 5</a>. </tp:rationale>

Values (D-Bus type a(sasas), type Contact_Info_Field[], named Info): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of fields representing information about this contact, in the same format used in the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">ContactInfo</tp:dbus-ref> interface. It is possible that a separate call to <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.ContactInfo">RequestContactInfo</tp:dbus-ref> would return more information than this signal provides.</p>


TP_ARRAY_TYPE_CAPTCHA_INFO_LIST

#define TP_ARRAY_TYPE_CAPTCHA_INFO_LIST (tp_type_dbus_array_ussuas ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CAPTCHA_INFO.


TP_HASH_TYPE_CAPTCHA_ANSWERS

#define TP_HASH_TYPE_CAPTCHA_ANSWERS (tp_type_dbus_hash_us ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> A mapping of captcha IDs to answer strings.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{us}.

Keys (D-Bus type u, named ID): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The ID of the captcha to which the associated answer string is answering.

Values (D-Bus type s, named Answer): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The answer string to answer the captcha referenced by the associated ID.


TP_STRUCT_TYPE_CAPTCHA_INFO

#define TP_STRUCT_TYPE_CAPTCHA_INFO (tp_type_dbus_struct_ussuas ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>A struct containing information regarding a single captcha mechanism.</p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ussuas).

Member 0 (D-Bus type u, named ID): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The ID with which to reference this captcha method when retrieving its data and answering it. They are unique within this channel instance only.</p>

Member 1 (D-Bus type s, named Type): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The type of challenge <a href="http://xmpp.org/extensions/xep-0158.htmlchallenge"> as defined by XEP-0158</a>. For instance, the commonly-used &quot;type the letters/words you see in this image&quot; challenge is represented by <code>ocr</code></p>

Member 2 (D-Bus type s, named Label): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A human-readable label for the challenge, as defined in XEP-0158.</p> <p>If the server does not supply a label for a challenge of type other than <code>qa</code>, connection managers SHOULD set Label to an empty string instead of generating their own text. If the Label is an empty string, the Handler SHOULD replace it with a generic label in the user's locale, such as the strings suggested in XEP-0158 (for instance, <code>Enter the text you see</code> for <code>ocr</code> challenges). The Handler MAY use those generic labels in any case, as per <a href="http://xmpp.org/extensions/xep-0158.htmli18n">the Internationalization Considerations section of XEP-0158</a>.</p> <tp:rationale> <p>Connection managers are not usually localized, so text generated by the connection manager would be in English, regardless of the user's locale. The Handler is better-placed to generate a generic Label in the user's locale.</p> </tp:rationale> <p>For challenges of type <code>qa</code>, the Label is a plain-text question for the user to answer. The connection manager SHOULD NOT provide an empty Label; if it does, the Handler SHOULD treat that challenge as impossible, and SHOULD NOT attempt to display it.</p>

Member 3 (D-Bus type u, type Captcha_Flags, named Flags): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One flag defined: Required. Most captchas will have no flags.</p>

Member 4 (D-Bus type as, named Available_MIME_Types): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of MIME types the server is offering to provide for this captcha method.</p>


TP_STRUCT_TYPE_AVATAR

#define TP_STRUCT_TYPE_AVATAR (tp_type_dbus_struct_ays ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>A struct containing avatar data marked with its MIME type.</p>

<p>May be set to an empty byte-array and an empty string, indicating no avatar.</p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ays).

Member 0 (D-Bus type ay, named Avatar_Data): (Undocumented)

Member 1 (D-Bus type s, named MIME_Type): (Undocumented)


TP_STRUCT_TYPE_DISPATCH_OPERATION_DETAILS

#define TP_STRUCT_TYPE_DISPATCH_OPERATION_DETAILS (tp_type_dbus_struct_oa_7bsv_7d ())

Details of a channel dispatch operation.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (oa{sv}).

Member 0 (D-Bus type o, named Channel_Dispatch_Operation): The object path of the <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation</tp:dbus-ref>.

Member 1 (D-Bus type a{sv}, type Qualified_Property_Value_Map, named Properties): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel dispatch operation.</p> <p>Connection managers MUST NOT include properties in this mapping if their values can change. Clients MUST ignore properties that appear in this mapping if their values can change.</p> <tp:rationale> <p>The rationale is the same as for <tp:type>Channel_Details</tp:type>.</p> </tp:rationale> <p>Each dictionary MUST contain at least the following keys:</p> <ul> <li><tp:dbus-ref>org.freedesktop.Telepathy.ChannelDispatchOperation.Interfaces</tp:dbus-ref></li> <li><tp:dbus-ref>org.freedesktop.Telepathy.ChannelDispatchOperation.Connection</tp:dbus-ref></li> <li><tp:dbus-ref>org.freedesktop.Telepathy.ChannelDispatchOperation.Account</tp:dbus-ref></li> <li><tp:dbus-ref>org.freedesktop.Telepathy.ChannelDispatchOperation.PossibleHandlers</tp:dbus-ref></li> </ul>


TP_ARRAY_TYPE_DISPATCH_OPERATION_DETAILS_LIST

#define TP_ARRAY_TYPE_DISPATCH_OPERATION_DETAILS_LIST (tp_type_dbus_array_oa_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_DISPATCH_OPERATION_DETAILS.


TP_HASH_TYPE_NOT_DELEGATED_MAP

#define TP_HASH_TYPE_NOT_DELEGATED_MAP (tp_type_dbus_hash_o_28ss_29 ())

A mapping associating not delegated channel with an error.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{o(ss)}.

Keys (D-Bus type o, named Channel): The path of the channel

Values (D-Bus type (ss), type Not_Delegated_Error, named Error): An error describing why the channel has not be delegated


TP_STRUCT_TYPE_NOT_DELEGATED_ERROR

#define TP_STRUCT_TYPE_NOT_DELEGATED_ERROR (tp_type_dbus_struct_ss ())

the name of a D-Bus error describing what went wrong.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ss).

Member 0 (D-Bus type s, type DBus_Error_Name, named Error_Name): the name of a D-Bus error describing what went wrong.

Member 1 (D-Bus type s, named Error_Message): a human-readable informative error message.


TP_STRUCT_TYPE_DEBUG_MESSAGE

#define TP_STRUCT_TYPE_DEBUG_MESSAGE (tp_type_dbus_struct_dsus ())

A struct representing a debug message, as returned by

<tp:member-ref>GetMessages</tp:member-ref> .

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (dsus).

Member 0 (D-Bus type d, named Timestamp): Timestamp of the debug message. This is a double to allow more accuracy in the time the message was logged.

Member 1 (D-Bus type s, named Domain): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Domain of the debug message. This is used to identify the source of debug messages. For example, debug messages from a connection manager could have this Domain struct member be the name of the connection manager, and logs from any helper library could have the name of the helper library.</p> <p>The domain could also contain a category as to where the log message originated separated by a forward-slash. For example, if a debug message was output in a connection manager called &quot;dummy&quot;, in the file-transfer code, this Domain struct member might be <tt>dummy/file-transfer</tt>.</p>

Member 2 (D-Bus type u, type Debug_Level, named Level): Level of the debug message. This states the severity of the debug message.

Member 3 (D-Bus type s, named Message): The text of the debug message.


TP_ARRAY_TYPE_DEBUG_MESSAGE_LIST

#define TP_ARRAY_TYPE_DEBUG_MESSAGE_LIST (tp_type_dbus_array_dsus ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_DEBUG_MESSAGE.


TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION

#define TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION (tp_type_dbus_struct_usa_7bsv_7d ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p>Struct representing one reason why a TLS certificate was rejected.</p>

<p>Since there can be multiple things wrong with a TLS certificate, arrays of this type are used to represent lists of reasons for rejection. In that case, the most important reason SHOULD be placed first in the list.</p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usa{sv}).

Member 0 (D-Bus type u, type TLS_Certificate_Reject_Reason, named Reason): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The value of the TLS_Certificate_Reject_Reason enumeration for this certificate rejection. <tp:rationale> Clients that do not understand the <code>Error</code> member, which may be implementation-specific, can use this property to classify rejection reasons into common categories. </tp:rationale> </p>

Member 1 (D-Bus type s, type DBus_Error_Name, named Error): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The DBus error name for this certificate rejection.</p> <p>This MAY correspond to the value of the <code>Reason</code> member, or MAY be a more specific D-Bus error name, perhaps implementation-specific.</p>

Member 2 (D-Bus type a{sv}, type String_Variant_Map, named Details): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Additional information about why the certificate was rejected. This MAY also include one or more of the following well-known keys:</p> <p> <dl> <dt>user-requested (b)</dt> <dd>True if the error was due to an user-requested rejection of the certificate; False if there was an unrecoverable error in the verification process.</dd> <dt>expected-hostname (s)</dt> <dd>If the rejection reason is Hostname_Mismatch, the hostname that the server certificate was expected to have.</dd> <dt>certificate-hostname (s)</dt> <dd>If the rejection reason is Hostname_Mismatch, the hostname of the certificate that was presented. <tp:rationale> <p>For instance, if you try to connect to gmail.com but are presented with a TLS certificate issued to evil.example.org, the error details for Hostname_Mismatch MAY include:</p> <pre> { 'expected-hostname': 'gmail.com', 'certificate-hostname': 'evil.example.org', } </pre> </tp:rationale> </dd> <dt>debug-message (s)</dt> <dd>Debugging information on the error, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances</dd> </dl> </p>


TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST

#define TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST (tp_type_dbus_array_usa_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION.


TP_HASH_TYPE_METADATA

#define TP_HASH_TYPE_METADATA (tp_type_dbus_hash_sas ())

A mapping from string key to a list of strings, used in the <tp:member-ref>Metadata</tp:member-ref> property. To emulate a simple string → string hash table one should have exactly one member in the value string list. <tp:rationale> This property is an a{sas} primarily because this maps easily to <a href="http://xmpp.org/extensions/xep-0004.html">XEP-0004 Data Forms</a>, and allows more structured metadata than a{ss} would. (For instance, a list of RDF triples could be expressed as one long array of strings, or as three-element values for a series of dummy key names, rather than as one big string blob.) While it might be convenient for applications to allow keys of arbitrary types, the added convenience would be outweighed by having to define the XMPP representation </tp:rationale>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sas}.

Keys (D-Bus type s, named Key): (Undocumented)

Values (D-Bus type as, named Values): (Undocumented)


TP_ARRAY_TYPE_CALL_MEMBER_MAP_LIST

#define TP_ARRAY_TYPE_CALL_MEMBER_MAP_LIST (tp_type_dbus_array_of_a_7buu_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_HASH_TYPE_CALL_MEMBER_MAP.


TP_ARRAY_TYPE_CANDIDATE_LIST

#define TP_ARRAY_TYPE_CANDIDATE_LIST (tp_type_dbus_array_usua_7bsv_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CANDIDATE.


TP_ARRAY_TYPE_CANDIDATE_PAIR_LIST

#define TP_ARRAY_TYPE_CANDIDATE_PAIR_LIST (tp_type_dbus_array__28usua_7bsv_7d_29_28usua_7bsv_7d_29 ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CANDIDATE_PAIR.


TP_ARRAY_TYPE_CODEC_LIST

#define TP_ARRAY_TYPE_CODEC_LIST (tp_type_dbus_array_usuuba_7bss_7d ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_CODEC.


TP_ARRAY_TYPE_VIDEO_RESOLUTION_STRUCT

#define TP_ARRAY_TYPE_VIDEO_RESOLUTION_STRUCT (tp_type_dbus_array_uu ())

Expands to a call to a function that returns the GType of a GPtrArray of TP_STRUCT_TYPE_VIDEO_RESOLUTION.


TP_HASH_TYPE_CALL_MEMBER_MAP

#define TP_HASH_TYPE_CALL_MEMBER_MAP (tp_type_dbus_hash_uu ())

A mapping from handles to their current state in the call.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Handle, named key): (Undocumented)

Values (D-Bus type u, type Call_Member_Flags, named Flag): (Undocumented)


TP_HASH_TYPE_CANDIDATE_INFO

#define TP_HASH_TYPE_CANDIDATE_INFO (tp_type_dbus_hash_sv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Extra information about the candidate. Allowed and mandatory keys depend on the transport protocol used. The following keys are commenly used:</p> <dl> <dt><code>type</code> - u</dt> <dd>The type of candidate (<tp:type>Call_Stream_Candidate_Type</tp:type>)</dd> <dt><code>foundation</code> - s</dt> <dd>The foundation of this candidate</dd> <dt><code>protocol</code> - u</dt> <dd>Underlying protocol of the candidate (<tp:type>Media_Stream_Base_Proto</tp:type>) </dd> <dt><code>priority</code> - u</dt> <dd>Priority of the candidate (should be a number between 0 and 65535). Most ICE implementations will prefer the highest priority candidate pair that manages to connect. For backwards compatibility with non-ICE SIP clients, the lowest priority candidate may be sent as a raw UDP fallback candidate. It is recommended that a relay candidate is used as the lowest priority candidate if possible. If both IPv4 and IPv6 raw udp fallback candidates are available, they should be set to the same priority and advertised to the CM at the same time. The CM will decide which to advertise to the remote end.</dd> <dt><code>base-ip</code> - s</dt> <dd>The underlying Host address where media sent to this (non-host-type) candidate will eventually arrive.</dd> <dt><code>base-port</code> - u</dt> <dd>The underlying Host port where media sent to this (non-host-type) candidate will eventually arrive.</dd> <dt><code>username</code> - s</dt> <dd>Username of this candidate (only if credentials are per candidate)</dd> <dt><code>password</code> - s</dt> <dd>Password of this candidate (only if credentials are per candidate)</dd> <dt><code>ttl</code> - u</dt> <dd>The TTL mandated for RTP/RTCP packets sent to a multicast group (only valid for Multicast Streams)</dd> </dl>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, named Key): One of the well-known keys documented here, or an implementation-specific key.

Values (D-Bus type v, named Value): The value corresponding to that key.


TP_HASH_TYPE_COMPONENT_STATE_MAP

#define TP_HASH_TYPE_COMPONENT_STATE_MAP (tp_type_dbus_hash_uu ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Stream_Component, named Component): (Undocumented)

Values (D-Bus type u, type Stream_Endpoint_State, named State): (Undocumented)


TP_HASH_TYPE_CONTACT_CODEC_MAP

#define TP_HASH_TYPE_CONTACT_CODEC_MAP (tp_type_dbus_hash_ua_28usuuba_7bss_7d_29 ())

A map from contact to the list of codecs he or she supports.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua(usuuba{ss})}.

Keys (D-Bus type u, type Contact_Handle, named Handle): A contact handle.

Values (D-Bus type a(usuuba{ss}), type Codec[], named Codecs): The codecs that the contact supports.


TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP

#define TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP (tp_type_dbus_hash_ua_7bsv_7d ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{ua{sv}}.

Keys (D-Bus type u, type Handle, named Remote_Contact): The remote contact this description refers to or 0. This matches the <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">RemoteContact</tp:dbus-ref> property on <tp:dbus-ref namespace="ofdT.Call1.Content">MediaDescription</tp:dbus-ref>

Values (D-Bus type a{sv}, type Media_Description_Properties, named Media_Description_Properties): The properties of the description


TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP

#define TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP (tp_type_dbus_hash_uu ())

A map from a contact to his or her sending state.

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uu}.

Keys (D-Bus type u, type Contact_Handle, named Contact): The contact handle.

Values (D-Bus type u, type Sending_State, named Sending): The sending state of the contact.


TP_HASH_TYPE_CONTACT_SSRCS_MAP

#define TP_HASH_TYPE_CONTACT_SSRCS_MAP (tp_type_dbus_hash_uau ())

(Undocumented)

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{uau}.

Keys (D-Bus type u, type Handle, named Contact): The remote contact these SSRCs belong to or 0.

Values (D-Bus type au, named SSRCs): The list of Synchronisation Sources.


TP_HASH_TYPE_MEDIA_DESCRIPTION_PROPERTIES

#define TP_HASH_TYPE_MEDIA_DESCRIPTION_PROPERTIES (tp_type_dbus_hash_sv ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p> A mapping containing all properties that define the information from a <tp:dbus-ref namespace="ofdT.Call1.Content">MediaDescription</tp:dbus-ref> and its interfaces. </p> <p> If <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">HasRemoteInformation</tp:dbus-ref> is True, then this mapping will always contains at least <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">Codecs</tp:dbus-ref> </p>

This macro expands to a call to a function that returns the GType of a GHashTable appropriate for representing a D-Bus dictionary of signature a{sv}.

Keys (D-Bus type s, type DBus_Qualified_Member, named Media_Description_Property): A D-Bus interface name, followed by a dot and a D-Bus property name.

Values (D-Bus type v, named Media_Description_Property_Value): The value of the property


TP_STRUCT_TYPE_CALL_STATE_REASON

#define TP_STRUCT_TYPE_CALL_STATE_REASON (tp_type_dbus_struct_uuss ())

<tp:docstring xmlns="http://www.w3.org/1999/xhtml">

<p> A description of the reason for a change to the

<tp:member-ref>CallState</tp:member-ref> and/or

<tp:member-ref>CallFlags</tp:member-ref> . </p>

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uuss).

Member 0 (D-Bus type u, type Contact_Handle, named Actor): The contact responsible for the change, or 0 if no contact was responsible.

Member 1 (D-Bus type u, type Call_State_Change_Reason, named Reason): The reason, chosen from a limited set of possibilities defined by the Telepathy specification. If <tp:value-ref type="Call_State_Change_Reason">User_Requested</tp:value-ref> then the Actor member will dictate whether it was the local user or a remote contact responsible.

Member 2 (D-Bus type s, type DBus_Error_Name, named DBus_Reason): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.</p> <p>This SHOULD be an empty string for changes to any state other than Ended.</p> <p>The errors Cancelled and Terminated SHOULD NOT be used here; an empty string SHOULD be used instead.</p> <tp:rationale> <p>Those error names are used to indicate normal call termination by the local user or another user, respectively, in contexts where a D-Bus error name must appear.</p> </tp:rationale>

Member 3 (D-Bus type s, named Message): An optional debug message, to expediate debugging the potentially many processes involved in a call. This may be communicated across the network in protocols that support doing so, but it is not essential.


TP_STRUCT_TYPE_CANDIDATE

#define TP_STRUCT_TYPE_CANDIDATE (tp_type_dbus_struct_usua_7bsv_7d ())

A Stream Candidate.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usua{sv}).

Member 0 (D-Bus type u, type Stream_Component, named Component): The component number.

Member 1 (D-Bus type s, named IP): The IP address to use.

Member 2 (D-Bus type u, named Port): The port number to use.

Member 3 (D-Bus type a{sv}, type Candidate_Info, named Info): Additional information about the candidate.


TP_STRUCT_TYPE_CANDIDATE_PAIR

#define TP_STRUCT_TYPE_CANDIDATE_PAIR (tp_type_dbus_struct__28usua_7bsv_7d_29_28usua_7bsv_7d_29 ())

A Pair of candidates.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature ((usua{sv})(usua{sv})).

Member 0 (D-Bus type (usua{sv}), type Candidate, named Local): The local candidate.

Member 1 (D-Bus type (usua{sv}), type Candidate, named Remote): The remote candidate.


TP_STRUCT_TYPE_CODEC

#define TP_STRUCT_TYPE_CODEC (tp_type_dbus_struct_usuuba_7bss_7d ())

A description of a codec.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (usuuba{ss}).

Member 0 (D-Bus type u, named Identifier): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Numeric identifier for the codec. This will be used as the PT in the SDP or content description.

Member 1 (D-Bus type s, named Name): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The name of the codec.

Member 2 (D-Bus type u, named Clockrate): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The clockrate of the codec.

Member 3 (D-Bus type u, named Channels): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Number of channels of the codec if applicable, otherwise 0.

Member 4 (D-Bus type b, named Updated): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> This should be set to true in calls to <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">Accept</tp:dbus-ref> and <tp:member-ref>UpdateLocalMediaDescription</tp:member-ref> if this codec has changed in a way that needs to be signalled over the network. If it is set to false, the CM is allowed ignore any differences between the current parameters and the previous ones <tp:rationale> This mechanism may be used to save bandwidth and avoid the CM having to calculate diffs against previous versions of this struct, which can lead to false-positives (e.g. redundant ptime updates). </tp:rationale>

Member 5 (D-Bus type a{ss}, type String_String_Map, named Parameters): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Extra parameters for this codec.


TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER

#define TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER (tp_type_dbus_struct_oa_7bsv_7d ())

The remote description offer and its information

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (oa{sv}).

Member 0 (D-Bus type o, named Media_Description): <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The object path to the <tp:dbus-ref namespace="ofdT.Call1.Content">MediaDescription</tp:dbus-ref>

Member 1 (D-Bus type a{sv}, type Media_Description_Properties, named Properties): The immutable properties of all interfaces of the codec description. <tp:rationale> Having all the codec description properties here saves a D-Bus round-trip - it shouldn't be necessary to get the properties from the MediaDescription object, in practice. </tp:rationale>


TP_STRUCT_TYPE_STREAM_CREDENTIALS

#define TP_STRUCT_TYPE_STREAM_CREDENTIALS (tp_type_dbus_struct_ss ())

A username and password pair.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (ss).

Member 0 (D-Bus type s, named Username): The username.

Member 1 (D-Bus type s, named Password): The password.


TP_STRUCT_TYPE_VIDEO_RESOLUTION

#define TP_STRUCT_TYPE_VIDEO_RESOLUTION (tp_type_dbus_struct_uu ())

With of the video stream.

This macro expands to a call to a function that returns the GType of a GValueArray appropriate for representing a D-Bus struct with signature (uu).

Member 0 (D-Bus type u, named Width): With of the video stream.

Member 1 (D-Bus type u, named Height): Height of the video stream.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-debug-sender.html0000644000175000017500000007107314006623344023440 00000000000000 TpDebugSender: telepathy-glib API Reference Manual

TpDebugSender

TpDebugSender — object for exposing Telepathy debug interface

Properties

gboolean enabled Read / Write

Types and Values

struct TpDebugSender

Object Hierarchy

    GObject
    ╰── TpDebugSender

Implemented Interfaces

TpDebugSender implements TpSvcDBusProperties and TpSvcDebug.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A TpDebugSender object is an object exposing the Telepathy debug interface. There should be one object per process as it registers the object path /org/freedesktop/Telepathy/debug. Once the object exists and has the object path, messages can be passed to it using tp_debug_sender_add_message and signals will automatically be fired.

TpDebugSender is primarily designed for use in Connection Managers, but can be used by any other part of the Telepathy stack which wants to expose its debugging information over the debug interface.

In a Connection Manager, one would probably keep a ref to the TpDebugSender in the connection manager object, and when this said object is finalized, so is the process's TpDebugSender. A GLib log handler is also provided: tp_debug_sender_log_handler().

Functions

tp_debug_sender_dup ()

TpDebugSender *
tp_debug_sender_dup (void);

Returns a TpDebugSender instance on the bus this process was activated by (if it was launched by D-Bus service activation), or the session bus (otherwise).

The returned TpDebugSender is cached; the same TpDebugSender object will be returned by this function repeatedly, as long as at least one reference exists.

Returns

a reference to the TpDebugSender instance for the current starter bus daemon

Since: 0.7.36


tp_debug_sender_add_message ()

void
tp_debug_sender_add_message (TpDebugSender *self,
                             GTimeVal *timestamp,
                             const gchar *domain,
                             GLogLevelFlags level,
                             const gchar *string);

Adds a new message to the debug sender message queue. If the “enabled” property is set to TRUE, then a NewDebugMessage signal will be fired too.

Parameters

self

A TpDebugSender instance

 

timestamp

Time of the message or NULL for right now

 

domain

Message domain

 

level

The message level

 

string

The message string itself

 

Since: 0.7.36


tp_debug_sender_add_message_vprintf ()

void
tp_debug_sender_add_message_vprintf (TpDebugSender *self,
                                     GTimeVal *timestamp,
                                     gchar **formatted,
                                     const gchar *domain,
                                     GLogLevelFlags level,
                                     const gchar *format,
                                     va_list args);

Formats and adds a new message to the debug sender message queue. If the “enabled” property is set to TRUE, then a NewDebugMessage signal will be fired too.

Parameters

self

A TpDebugSender instance

 

timestamp

Time of the message, or NULL for right now

 

formatted

Place to store the formatted message, or NULL if not needed

 

domain

Message domain

 

level

The message level

 

format

The printf() format string

 

args

the va_list of parameters to insert into format

 

Since: 0.13.13


tp_debug_sender_add_message_printf ()

void
tp_debug_sender_add_message_printf (TpDebugSender *self,
                                    GTimeVal *timestamp,
                                    gchar **formatted,
                                    const gchar *domain,
                                    GLogLevelFlags level,
                                    const gchar *format,
                                    ...);

Formats and adds a new message to the debug sender message queue. If the “enabled” property is set to TRUE, then a NewDebugMessage signal will be fired too.

Parameters

self

A TpDebugSender instance

 

timestamp

Time of the message, or NULL for right now

 

formatted

Place to store the formatted message, or NULL if not required

 

domain

Message domain

 

level

The message level

 

format

The printf() format string

 

...

The parameters to insert into format

 

Since: 0.13.13


tp_debug_sender_log_handler ()

void
tp_debug_sender_log_handler (const gchar *log_domain,
                             GLogLevelFlags log_level,
                             const gchar *message,
                             gpointer exclude);

A generic log handler designed to be used by CMs. It initially calls g_log_default_handler(), and then sends the message on the bus TpDebugSender.

The exclude parameter is designed to allow filtering one domain, instead of sending every message to the TpDebugSender: typical usage is for a process to filter out messages from its own G_LOG_DOMAIN, so that it can append a category to its own messages and pass them directly to tp_debug_sender_add_message. Note that every message, regardless of domain, is given to g_log_default_handler().

Note that a ref to a TpDebugSender must be kept at all times otherwise no messages given to the handler will be sent to the Telepathy debug interface.

An example of its usage, taking in mind the notes above, follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
/<!-- -->* Create a main loop and debug sender *<!-- -->/
GMainLoop *loop = g_main_loop_new (NULL, FALSE);
TpDebugSender *sender = tp_debug_sender_dup ();

/<!-- -->* Set the default handler *<!-- -->/
g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN);

/<!-- -->* Run the main loop, but keeping a ref on the TpDebugSender from
 * the beginning of this code sample. *<!-- -->/
g_main_loop_run (loop);

/<!-- -->* g_main_loop_quit was called, so only now can we clean up the
 * TpDebugSender. *<!-- -->/
g_object_unref (sender);

(In a connection manager, replace g_main_loop_run() in the above example with tp_run_connection_manager().)

This function is merely for convenience if it meets the requirements. It can easily be re-implemented in services, and does not need to be used.

If timestamps should be prepended to messages (like in tp_debug_timestamped_log_handler()), tp_debug_sender_set_timestamps() should also be called.

Since version 0.11.15, this function can be called from any thread.

Parameters

log_domain

domain of the message

 

log_level

log leve of the message

 

message

the message itself

 

exclude

a log domain string to exclude from the TpDebugSender, or NULL

 

Since: 0.7.36


tp_debug_sender_set_timestamps ()

void
tp_debug_sender_set_timestamps (TpDebugSender *self,
                                gboolean maybe);

If the log handler is tp_debug_sender_log_handler() then calling this function with TRUE on the debug sender will prepend the message to be printed to stdout with the UTC time (currently in ISO 8601 format, with microsecond resolution). This is equivalent to using tp_debug_timestamped_log_handler() as the log handler, but also logging to the debug sender.

Parameters

self

a TpDebugSender

 

maybe

whether to display message timestamps

 

Since: 0.15.5

Types and Values

struct TpDebugSender

struct TpDebugSender;

An object for exposing the Telepathy debug interface.

Since: 0.7.36

Property Details

The “enabled” property

  “enabled”                  gboolean

TRUE if the NewDebugMessage signal should be emitted when a new debug message is generated.

Owner: TpDebugSender

Flags: Read / Write

Default value: FALSE

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-anonymity.html0000644000175000017500000002715114006623344023666 00000000000000 Connection and Channel Anonymity interfaces: telepathy-glib API Reference Manual

Connection and Channel Anonymity interfaces

Connection and Channel Anonymity interfaces — client-side wrappers for the Anonymity interfaces

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In some protocols, mainly those that interact with the PSTN, it's possible to make a call without disclosing the originating identity (e.g. phone number). The Anonymity interfaces on the Connection and Channel can be used to control this feature in Telepathy.

This section documents the auto-generated C wrappers for the Anonymity interfaces, used with TpConnection and TpChannel objects.

Functions

tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AnonymityModesChanged.

Emitted when the anonymity mode has changed.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed ()

void
(*tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed)
                               (TpConnection *proxy,
                                guint arg_Modes,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AnonymityModesChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed() was called

 

arg_Modes

The new anonymity modes for this connection. (TpAnonymityModeFlags)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-protocol.html0000644000175000017500000040545314006623344022740 00000000000000 TpProtocol: telepathy-glib API Reference Manual

TpProtocol

TpProtocol — proxy for a Telepathy Protocol object

Functions

TpProtocol * tp_protocol_new ()
TpProtocol * tp_protocol_new_vardict ()
const gchar * tp_protocol_get_name ()
const gchar * tp_protocol_get_cm_name ()
void tp_protocol_init_known_interfaces ()
const TpConnectionManagerParam * tp_protocol_borrow_params ()
GList * tp_protocol_dup_params ()
GStrv tp_protocol_dup_param_names ()
const TpConnectionManagerParam * tp_protocol_get_param ()
TpConnectionManagerParam * tp_protocol_dup_param ()
gboolean tp_protocol_has_param ()
gboolean tp_protocol_can_register ()
GVariant * tp_protocol_dup_immutable_properties ()
TpCapabilities * tp_protocol_get_capabilities ()
const gchar * tp_protocol_get_english_name ()
const gchar * tp_protocol_get_icon_name ()
const gchar * tp_protocol_get_vcard_field ()
const gchar * const * tp_protocol_get_authentication_types ()
void tp_protocol_identify_account_async ()
gchar * tp_protocol_identify_account_finish ()
void tp_protocol_normalize_contact_async ()
gchar * tp_protocol_normalize_contact_finish ()
TpAvatarRequirements * tp_protocol_get_avatar_requirements ()
GList * tp_protocol_dup_presence_statuses ()
const gchar * const * tp_protocol_get_addressable_uri_schemes ()
const gchar * const * tp_protocol_get_addressable_vcard_fields ()
void tp_protocol_normalize_contact_uri_async ()
gchar * tp_protocol_normalize_contact_uri_finish ()
void tp_protocol_normalize_vcard_address_async ()
gchar * tp_protocol_normalize_vcard_address_finish ()
TpProxyPendingCall * tp_cli_protocol_call_identify_account ()
TpProxyPendingCall * tp_cli_protocol_call_normalize_contact ()
void (*tp_cli_protocol_callback_for_identify_account) ()
void (*tp_cli_protocol_callback_for_normalize_contact) ()
TpProxyPendingCall * tp_cli_protocol_interface_addressing_call_normalize_contact_uri ()
TpProxyPendingCall * tp_cli_protocol_interface_addressing_call_normalize_vcard_address ()
void (*tp_cli_protocol_interface_addressing_callback_for_normalize_contact_uri) ()
void (*tp_cli_protocol_interface_addressing_callback_for_normalize_vcard_address) ()

Properties

GStrv addressable-uri-schemes Read
GStrv addressable-vcard-fields Read
GStrv authentication-types Read
gpointer avatar-requirements Read
TpCapabilities * capabilities Read
gchar * cm-name Read / Write / Construct Only
gchar * english-name Read
gchar * icon-name Read
GStrv param-names Read
gchar * protocol-name Read / Write / Construct Only
GHashTable_gchararray+GValue_* protocol-properties Read / Write / Construct Only
GVariant * protocol-properties-vardict Read
gchar * vcard-field Read

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpProtocol

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpProtocol objects represent the protocols implemented by Telepathy connection managers. In modern connection managers, each protocol is represented by a D-Bus object; in older connection managers, the protocols are represented by data structures, and this object merely emulates a D-Bus object.

Functions

tp_protocol_new ()

TpProtocol *
tp_protocol_new (TpDBusDaemon *dbus,
                 const gchar *cm_name,
                 const gchar *protocol_name,
                 const GHashTable *immutable_properties,
                 GError **error);

Parameters

dbus

proxy for the D-Bus daemon; may not be NULL

 

cm_name

the connection manager name (such as "gabble")

 

protocol_name

the protocol name (such as "jabber")

 

immutable_properties

the immutable D-Bus properties for this protocol

 

error

used to indicate the error if NULL is returned

 

Returns

a new protocol proxy, or NULL on invalid arguments

Since: 0.11.11


tp_protocol_new_vardict ()

TpProtocol *
tp_protocol_new_vardict (TpDBusDaemon *dbus,
                         const gchar *cm_name,
                         const gchar *protocol_name,
                         GVariant *immutable_properties,
                         GError **error);

Create a new protocol proxy.

If immutable_properties is a floating reference, this function will take ownership of it, much like g_variant_ref_sink(). See documentation of that function for details.

Parameters

dbus

proxy for the D-Bus daemon; may not be NULL

 

cm_name

the connection manager name (such as "gabble")

 

protocol_name

the protocol name (such as "jabber")

 

immutable_properties

the immutable D-Bus properties for this protocol

 

error

used to indicate the error if NULL is returned

 

Returns

a new protocol proxy, or NULL on invalid arguments

Since: 0.23.3


tp_protocol_get_name ()

const gchar *
tp_protocol_get_name (TpProtocol *self);

Return the same thing as the protocol-name property, for convenient use in C code. The returned string is valid for as long as self exists.

Parameters

self

a protocol object

 

Returns

the value of the “protocol-name” property

Since: 0.11.11


tp_protocol_get_cm_name ()

const gchar *
tp_protocol_get_cm_name (TpProtocol *self);

Return the “cm-name” property.

Parameters

self

a TpProtocol

 

Returns

the value of “cm-name”

Since: 0.19.1


tp_protocol_init_known_interfaces ()

void
tp_protocol_init_known_interfaces (void);

Ensure that the known interfaces for TpProtocol have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_PROTOCOL.

Since: 0.11.11


tp_protocol_borrow_params ()

const TpConnectionManagerParam *
tp_protocol_borrow_params (TpProtocol *self);

tp_protocol_borrow_params is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_protocol_dup_params() instead.

Returns an array of parameters supported by this connection manager, without additional memory allocations. The returned array is owned by self , and must not be used after self has been freed.

[skip]

Parameters

self

a protocol

 

Returns

an array of TpConnectionManagerParam structures, terminated by one whose name is NULL.

[transfer none]

Since: 0.17.6


tp_protocol_dup_params ()

GList *
tp_protocol_dup_params (TpProtocol *self);

Returns a list of parameters supported by this connection manager.

The returned list must be freed by the caller, for instance with g_list_free_full (l, (GDestroyNotify) tp_connection_manager_param_free).

Parameters

self

a protocol

 

Returns

a list of TpConnectionManagerParam structures, owned by the caller.

[transfer full][element-type TelepathyGLib.ConnectionManagerParam]

Since: 0.17.6


tp_protocol_dup_param_names ()

GStrv
tp_protocol_dup_param_names (TpProtocol *self);

Returns a list of parameter names supported by this connection manager for this protocol.

The result is copied and must be freed by the caller with g_strfreev().

Parameters

self

a protocol

 

Returns

a copy of “param-names”.

[array zero-terminated=1][transfer full]

Since: 0.11.11


tp_protocol_get_param ()

const TpConnectionManagerParam *
tp_protocol_get_param (TpProtocol *self,
                       const gchar *param);

Parameters

self

a protocol

 

param

a parameter name

 

Returns

a structure representing the parameter param , or NULL if not supported

Since: 0.11.11


tp_protocol_dup_param ()

TpConnectionManagerParam *
tp_protocol_dup_param (TpProtocol *self,
                       const gchar *param);

Parameters

self

a protocol

 

param

a parameter name

 

Returns

a structure representing the parameter param , or NULL if not supported. Free with tp_connection_manager_param_free().

[transfer full]

Since: 0.17.6


tp_protocol_has_param ()

gboolean
tp_protocol_has_param (TpProtocol *self,
                       const gchar *param);

Parameters

self

a protocol

 

param

a parameter name

 

Returns

TRUE if self supports the parameter param .

Since: 0.11.11


tp_protocol_can_register ()

gboolean
tp_protocol_can_register (TpProtocol *self);

Return whether a new account can be registered on this protocol, by setting the special "register" parameter to TRUE.

Parameters

self

a protocol

 

Returns

TRUE if protocol supports the parameter "register"

Since: 0.11.11


tp_protocol_dup_immutable_properties ()

GVariant *
tp_protocol_dup_immutable_properties (TpProtocol *self);

Return the “protocol-properties-vardict” property.

Parameters

self

a TpProtocol object

 

Returns

the value of “protocol-properties-vardict”.

[transfer full]

Since: 0.23.3


tp_protocol_get_capabilities ()

TpCapabilities *
tp_protocol_get_capabilities (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

“capabilities”, which must be referenced (if non-NULL) if it will be kept.

[transfer none]

Since: 0.11.11


tp_protocol_get_english_name ()

const gchar *
tp_protocol_get_english_name (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the non-NULL, non-empty value of “english-name”

Since: 0.11.11


tp_protocol_get_icon_name ()

const gchar *
tp_protocol_get_icon_name (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the non-NULL, non-empty value of “icon-name”

Since: 0.11.11


tp_protocol_get_vcard_field ()

const gchar *
tp_protocol_get_vcard_field (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the value of “vcard-field”

Since: 0.11.11


tp_protocol_get_authentication_types ()

const gchar * const *
tp_protocol_get_authentication_types (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the value of “authentication-types”.

[transfer none]

Since: 0.13.9


tp_protocol_identify_account_async ()

void
tp_protocol_identify_account_async (TpProtocol *self,
                                    GVariant *vardict,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Return a string that could identify the account with the given parameters. In most protocols that string is a normalized 'account' parameter, but some protocols have more complex requirements; for instance, on IRC, the 'account' (nickname) is insufficient, and must be combined with a server or network name.

Parameters

self

a protocol

 

vardict

the account parameters as a GVariant of type G_VARIANT_TYPE_VARDICT. If it is floating, ownership will be taken, as if via g_variant_ref_sink().

 

cancellable

may be used to cancel the async request.

[allow-none]

callback

a callback to call when the request is satisfied.

[scope async]

user_data

data to pass to callback .

[closure][allow-none]

Since: 0.23.1


tp_protocol_identify_account_finish ()

gchar *
tp_protocol_identify_account_finish (TpProtocol *self,
                                     GAsyncResult *result,
                                     GError **error);

Interpret the result of tp_protocol_identify_account_async().

Parameters

self

a protocol

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a string identifying the account, or NULL on error.

[transfer full]

Since: 0.23.1


tp_protocol_normalize_contact_async ()

void
tp_protocol_normalize_contact_async (TpProtocol *self,
                                     const gchar *contact,
                                     GCancellable *cancellable,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Perform best-effort offline contact normalization. This does syntactic normalization (e.g. transforming case-insensitive text to lower-case), but does not query servers or anything similar.

Parameters

self

a protocol

 

contact

a contact identifier, possibly invalid

 

cancellable

may be used to cancel the async request.

[allow-none]

callback

a callback to call when the request is satisfied.

[scope async]

user_data

data to pass to callback .

[closure][allow-none]

Since: 0.23.1


tp_protocol_normalize_contact_finish ()

gchar *
tp_protocol_normalize_contact_finish (TpProtocol *self,
                                      GAsyncResult *result,
                                      GError **error);

Interpret the result of tp_protocol_normalize_contact_async().

Parameters

self

a protocol

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

the normalized form of contact , or NULL on error.

[transfer full]

Since: 0.23.1


tp_protocol_get_avatar_requirements ()

TpAvatarRequirements *
tp_protocol_get_avatar_requirements (TpProtocol *self);

Return the “avatar-requirements” property

Parameters

self

a TpProtocol

 

Returns

the value of “avatar-requirements”.

[transfer none]

Since: 0.15.6


tp_protocol_dup_presence_statuses ()

GList *
tp_protocol_dup_presence_statuses (TpProtocol *self);

Return the presence statuses that might be supported by connections to this protocol.

It is possible that some of these statuses will not actually be supported by a connection: for instance, an XMPP connection manager would include "hidden" in this list, even though not all XMPP servers allow users to be online-but-hidden.

Parameters

self

a protocol object

 

Returns

a list of statuses, or NULL if unknown.

[transfer full][element-type TelepathyGLib.PresenceStatusSpec]


tp_protocol_get_addressable_uri_schemes ()

const gchar * const *
tp_protocol_get_addressable_uri_schemes
                               (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the value of “addressable-uri-schemes”.

[transfer none]

Since: 0.23.1


tp_protocol_get_addressable_vcard_fields ()

const gchar * const *
tp_protocol_get_addressable_vcard_fields
                               (TpProtocol *self);

Parameters

self

a protocol object

 

Returns

the value of “addressable-vcard-fields”.

[transfer none]

Since: 0.23.1


tp_protocol_normalize_contact_uri_async ()

void
tp_protocol_normalize_contact_uri_async
                               (TpProtocol *self,
                                const gchar *uri,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Perform best-effort offline contact normalization, for a contact in the form of a URI. This method will fail if the URI is not in a scheme supported by this protocol or connection manager.

Parameters

self

a protocol

 

uri

a contact URI, possibly invalid

 

cancellable

may be used to cancel the async request.

[allow-none]

callback

a callback to call when the request is satisfied.

[scope async]

user_data

data to pass to callback .

[closure][allow-none]

Since: 0.23.1


tp_protocol_normalize_contact_uri_finish ()

gchar *
tp_protocol_normalize_contact_uri_finish
                               (TpProtocol *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of tp_protocol_normalize_contact_uri_async().

Parameters

self

a protocol

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

the normalized form of uri , or NULL on error.

[transfer full]

Since: 0.23.1


tp_protocol_normalize_vcard_address_async ()

void
tp_protocol_normalize_vcard_address_async
                               (TpProtocol *self,
                                const gchar *field,
                                const gchar *value,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Perform best-effort offline contact normalization, for a contact in the form of a vCard field. This method will fail if the vCard field is not supported by this protocol or connection manager.

Parameters

self

a protocol

 

field

a vCard field

 

value

an address that is a value of field

 

cancellable

may be used to cancel the async request.

[allow-none]

callback

a callback to call when the request is satisfied.

[scope async]

user_data

data to pass to callback .

[closure][allow-none]

Since: 0.23.1


tp_protocol_normalize_vcard_address_finish ()

gchar *
tp_protocol_normalize_vcard_address_finish
                               (TpProtocol *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of tp_protocol_normalize_vcard_address_async().

Parameters

self

a protocol

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

the normalized form of value , or NULL on error.

[transfer full]

Since: 0.23.1


tp_cli_protocol_call_identify_account ()

TpProxyPendingCall *
tp_cli_protocol_call_identify_account (gpointer proxy,
                                       gint timeout_ms,
                                       GHashTable *in_Parameters,
                                       tp_cli_protocol_callback_for_identify_account callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

Start a IdentifyAccount method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Return a string which uniquely identifies the account to which the given parameters would connect.</p> <tp:rationale> <p>For many protocols, this would return the well-known 'account' parameter. However, for IRC the returned string would be composed from the 'account' (i.e. nickname) and 'server' parameters. AccountManager implementations can use this to form the account-specific part of an Account's object path.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Parameters

Used to pass an 'in' argument: A set of parameters as would be provided to <tp:dbus-ref namespace="org.freedesktop.Telepathy.ConnectionManager">RequestConnection</tp:dbus-ref>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_protocol_call_normalize_contact ()

TpProxyPendingCall *
tp_cli_protocol_call_normalize_contact
                               (gpointer proxy,
                                gint timeout_ms,
                                const gchar *in_Contact_ID,
                                tp_cli_protocol_callback_for_normalize_contact callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NormalizeContact method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Attempt to normalize the given contact ID. Where possible, this SHOULD return the same thing that would be returned by InspectHandles(RequestHandles(CONTACT, [Contact_ID])) on a connected <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>.</p> <p>If full normalization requires network activity or is otherwise impossible to do without a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>, this method SHOULD perform a best-effort normalization.</p> <tp:rationale> <p>One common example of a best-effort offline normalization differing from the ideal normalization is XMPP.</p> <p>On XMPP, contacts' JIDs should normally have the resource removed during normalization, but for contacts in a MUC (chatroom), the resource is an integral part of the JID - so the contact JID aliceexample.com /Empathy should normalize to aliceexample.com , but the in-MUC JID wonderlandconference.example.com /Alice should normalize to itself.</p> <p>While online, the connection manager has enough context to know which chatrooms the user is in, and can infer from that whether to remove resources, but the best-effort normalization performed while offline does not have this context, so the best that can be done is to remove the resource from all JIDs.</p> </tp:rationale> <p>This method MAY simply raise NotImplemented on some protocols.</p> <tp:rationale> <p>In link-local XMPP, you can't talk to someone who isn't present on your local network, so normalizing identifiers in advance is meaningless.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact_ID

Used to pass an 'in' argument: The identifier of a contact in this protocol

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_protocol_callback_for_identify_account ()

void
(*tp_cli_protocol_callback_for_identify_account)
                               (TpProxy *proxy,
                                const gchar *out_Account_ID,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a IdentifyAccount method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Account_ID

Used to return an 'out' argument if error is NULL: <p>An opaque string suitable for use as the account-specific part of an <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>'s object path. This is not necessarily globally unique, but should represent a &quot;best-effort&quot; identification of the account.</p> <tp:rationale> <p>For a pathological case, consider a user signing in as 'meexample.com ' with 'server' set to either jabber1.example.com or jabber2.example.com. Both of these should result in meexample.com being returned from this method, even if the user can actually be signed in to those two servers simultaneously.</p> </tp:rationale>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_protocol_callback_for_normalize_contact ()

void
(*tp_cli_protocol_callback_for_normalize_contact)
                               (TpProxy *proxy,
                                const gchar *out_Normalized_Contact_ID,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NormalizeContact method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Normalized_Contact_ID

Used to return an 'out' argument if error is NULL: The identifier of a contact in this protocol, normalized as much as possible

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_protocol_interface_addressing_call_normalize_contact_uri ()

TpProxyPendingCall *
tp_cli_protocol_interface_addressing_call_normalize_contact_uri
                               (gpointer proxy,
                                gint timeout_ms,
                                const gchar *in_URI,
                                tp_cli_protocol_interface_addressing_callback_for_normalize_contact_uri callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NormalizeContactURI method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Attempt to normalize the given contact URI. Where possible, this SHOULD return an address that would appear in the <code>org.freedesktop.Telepathy.Connection.Interface.Addressing1/uris</code> attribute for a contact on a connected <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>. </p> <p>If full normalization requires network activity or is otherwise impossible to do without a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>, this method SHOULD perform a best-effort normalization.</p> <p>If the URI has extra information beyond what's necessary to identify a particular contact, such as an XMPP resource or an action to carry out, this extra information SHOULD be removed. If all URIs in a scheme contain a verb or action (like <code>aim</code>, <code>ymsgr</code> and <code>msnim</code> URIs), then the verb SHOULD be replaced with the one specified in <tp:member-ref>AddressableURISchemes</tp:member-ref>.</p> <tp:rationale> <p>This method is intended to normalize URIs stored in address books, for instance. In protocols like XMPP, if you vary the resource or action (query string), the URI still refers to the same high-level contact.</p> </tp:rationale> <p>For instance, <code>xmpp:romeoExample.Com /Empathy?message;body=Hello</code> would be normalized to <code>xmpp:romeoexample.com </code>, and <code>aim:goim?screenname=Romeo20M&amp;message=Hello</code> would be normalized to <code>aim:addbuddy?screenname=romeom</code>.</p> <p>This method MAY simply raise NotImplemented on some protocols, if it has no use.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_URI

Used to pass an 'in' argument: <p>The URI to normalize, which is assumed to refer to a contact (as opposed to, for instance, a chatroom or a server).</p> <tp:rationale> <p>In some protocols, like XMPP, there is no way to tell whether a given URI refers to a contact or a chatroom by looking at its syntax.</p> </tp:rationale> <p>The URI's scheme (i.e. the part before the first colon) MUST appear in <tp:member-ref>AddressableURISchemes</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_protocol_interface_addressing_call_normalize_vcard_address ()

TpProxyPendingCall *
tp_cli_protocol_interface_addressing_call_normalize_vcard_address
                               (gpointer proxy,
                                gint timeout_ms,
                                const gchar *in_VCard_Field,
                                const gchar *in_VCard_Address,
                                tp_cli_protocol_interface_addressing_callback_for_normalize_vcard_address callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NormalizeVCardAddress method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Attempt to normalize the given vCard address. Where possible, this SHOULD return an address that would appear in the <code>org.freedesktop.Telepathy.Connection.Interface.Addressing1/addresses</code> attribute for a contact on a connected <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>. </p> <p>If full normalization requires network activity or is otherwise impossible to do without a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>, this method SHOULD perform a best-effort normalization.</p> <p>An example would be a vCard TEL field with a formatted number in the form of <code>+1 (206) 555 1234</code>, this would be normalized to <code>+12065551234</code>.</p> <p>This method MAY simply raise NotImplemented on some protocols, if it has no use.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_VCard_Field

Used to pass an 'in' argument: The vCard field of the address we are normalizing. The field name SHOULD be in lower case, and MUST appear in <tp:member-ref>AddressableVCardFields</tp:member-ref>.

 

in_VCard_Address

Used to pass an 'in' argument: The address to normalize, which is assumed to belong to a contact (and not, for instance, a chatroom or server).

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_protocol_interface_addressing_callback_for_normalize_contact_uri ()

void
(*tp_cli_protocol_interface_addressing_callback_for_normalize_contact_uri)
                               (TpProxy *proxy,
                                const gchar *out_Normalized_URI,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NormalizeContactURI method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Normalized_URI

Used to return an 'out' argument if error is NULL: A URI, normalized as much as possible.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_protocol_interface_addressing_callback_for_normalize_vcard_address ()

void
(*tp_cli_protocol_interface_addressing_callback_for_normalize_vcard_address)
                               (TpProxy *proxy,
                                const gchar *out_Normalized_VCard_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NormalizeVCardAddress method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Normalized_VCard_Address

Used to return an 'out' argument if error is NULL: The vCard address, normalized as much as possible.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

Types and Values

struct TpProtocol

struct TpProtocol;

A base class for connection managers' protocols.

Since: 0.11.11


TpProtocolClass

typedef struct _TpProtocolClass TpProtocolClass;

The class of a TpProtocol.

Since: 0.11.11


TP_PROTOCOL_FEATURE_PARAMETERS

#define             TP_PROTOCOL_FEATURE_PARAMETERS

Expands to a call to a function that returns a quark for the parameters feature of a TpProtocol.

When this feature is prepared, the possible parameters for connections to this protocol have been retrieved and are available for use.

Unlike TP_PROTOCOL_FEATURE_CORE, this feature can even be available on connection managers that don't really have Protocol objects (on these older connection managers, the TpProtocol uses information from ConnectionManager methods to provide the list of parameters).

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.11


TP_PROTOCOL_FEATURE_CORE

#define             TP_PROTOCOL_FEATURE_CORE

Expands to a call to a function that returns a quark for the core feature of a TpProtocol.

When this feature is prepared, at least the following basic information about the protocol is available:

  • possible parameters for connections to this protocol
  • interfaces expected on connections to this protocol
  • classes of channel that could be requested from connections to this protocol

(This feature implies that TP_PROTOCOL_FEATURE_PARAMETERS is also available.)

Unlike TP_PROTOCOL_FEATURE_PARAMETERS, this feature can only become available on connection managers that implement Protocol objects.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.11

Property Details

The “addressable-uri-schemes” property

  “addressable-uri-schemes”  GStrv

A non-NULL GStrv of URI schemes supported by this protocol. If this protocol does not support addressing contacts by URI, the list is empty.

For instance, a SIP connection manager that supports calling contacts by SIP URI (sip:alice@example.com, sips:bob@example.com) or telephone number (tel:+1-555-0123) might have { "sip", "sips", "tel", NULL }.

Owner: TpProtocol

Flags: Read

Since: 0.23.1


The “addressable-vcard-fields” property

  “addressable-vcard-fields” GStrv

A non-NULL GStrv of vCard fields supported by this protocol. If this protocol does not support addressing contacts by a vCard field, the list is empty.

For instance, a SIP connection manager that supports calling contacts by SIP URI (vCard field SIP) or telephone number (vCard field TEL) might have { "sip", "tel", NULL }.

Owner: TpProtocol

Flags: Read

Since: 0.23.1


The “authentication-types” property

  “authentication-types”     GStrv

A non-NULL GStrv of interfaces which provide information as to what kind of authentication channels can possibly appear before the connection reaches the CONNECTED state, or NULL if TP_PROTOCOL_FEATURE_CORE has not been prepared.

Owner: TpProtocol

Flags: Read

Since: 0.13.9


The “avatar-requirements” property

  “avatar-requirements”      gpointer

A TpAvatarRequirements representing the avatar requirements on this protocol, or NULL if TP_PROTOCOL_FEATURE_CORE has not been prepared or if the protocol doesn't support avatars.

Owner: TpProtocol

Flags: Read

Since: 0.15.6


The “capabilities” property

  “capabilities”             TpCapabilities *

The classes of channel that can be requested from connections to this protocol, or NULL if this is unknown or the TP_PROTOCOL_FEATURE_CORE feature has not been prepared.

Owner: TpProtocol

Flags: Read

Since: 0.11.11


The “cm-name” property

  “cm-name”                  gchar *

The name of the connection manager this protocol is on.

Owner: TpProtocol

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.1


The “english-name” property

  “english-name”             gchar *

The name of the protocol in a form suitable for display to users, such as "AIM" or "Yahoo!", or a string based on “protocol-name” (currently constructed by putting the first character in title case, but this is not guaranteed) if no better name is available or the TP_PROTOCOL_FEATURE_CORE feature has not been prepared.

This is effectively in the C locale (international English); user interfaces requiring a localized protocol name should look one up in their own message catalog based on either “protocol-name” or “english-name”, but should use this English version as a fallback if no translated version can be found.

Owner: TpProtocol

Flags: Read

Default value: NULL

Since: 0.11.11


The “icon-name” property

  “icon-name”                gchar *

The name of an icon in the system's icon theme. If none was supplied by the Protocol, or the TP_PROTOCOL_FEATURE_CORE feature has not been prepared, a default is used; currently, this is "im-" plus “protocol-name”.

Owner: TpProtocol

Flags: Read

Default value: NULL

Since: 0.11.11


The “param-names” property

  “param-names”              GStrv

A list of parameter names supported by this connection manager for this protocol, or NULL if TP_PROTOCOL_FEATURE_PARAMETERS has not been prepared.

Owner: TpProtocol

Flags: Read

Since: 0.11.11


The “protocol-name” property

  “protocol-name”            gchar *

The machine-readable name of the protocol, taken from the Telepathy D-Bus Interface Specification, such as "jabber" or "local-xmpp".

Owner: TpProtocol

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.11.11


The “protocol-properties” property

  “protocol-properties”      GHashTable_gchararray+GValue_*

The immutable properties of this Protocol, as provided at construction time. This is a map from string to GValue, which must not be modified.

If the immutable properties were not provided at construction time, the TP_PROTOCOL_FEATURE_PARAMETERS and TP_PROTOCOL_FEATURE_CORE features will both be unavailable, and this TpProtocol object will only be useful as a way to access lower-level D-Bus calls.

Owner: TpProtocol

Flags: Read / Write / Construct Only

Since: 0.11.11


The “protocol-properties-vardict” property

  “protocol-properties-vardict” GVariant *

The immutable properties of this Protocol, as provided at construction time. This is a G_VARIANT_TYPE_VARDICT GVariant, which must not be modified.

If the immutable properties were not provided at construction time, the TP_PROTOCOL_FEATURE_PARAMETERS and TP_PROTOCOL_FEATURE_CORE features will both be unavailable, and this TpProtocol object will only be useful as a way to access lower-level D-Bus calls.

Owner: TpProtocol

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.23.3


The “vcard-field” property

  “vcard-field”              gchar *

The most common vCard field used for this protocol's contact identifiers, normalized to lower case, or NULL if there is no such field or the TP_PROTOCOL_FEATURE_CORE feature has not been prepared.

Owner: TpProtocol

Flags: Read

Default value: NULL

Since: 0.11.11

telepathy-glib-0.24.2/docs/reference/html/style.css0000644000175000017500000002742114006623343017145 00000000000000body { font-family: cantarell, sans-serif; } .synopsis, .classsynopsis { /* tango:aluminium 1/2 */ background: #eeeeec; background: rgba(238, 238, 236, 0.5); border: solid 1px rgb(238, 238, 236); padding: 0.5em; } .programlisting { /* tango:sky blue 0/1 */ /* fallback for no rgba support */ background: #e6f3ff; border: solid 1px #729fcf; background: rgba(114, 159, 207, 0.1); border: solid 1px rgba(114, 159, 207, 0.2); padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } span.nowrap { white-space: nowrap; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a, a:visited { text-decoration: none; /* tango:sky blue 2 */ color: #3465a4; } a:hover { text-decoration: underline; /* tango:sky blue 1 */ color: #729fcf; } div.informaltable table { border-collapse: separate; border-spacing: 1em 0.3em; border: none; } div.informaltable table td, div.informaltable table th { vertical-align: top; } .function_type, .variable_type, .property_type, .signal_type, .parameter_name, .struct_member_name, .union_member_name, .define_keyword, .datatype_keyword, .typedef_keyword { text-align: right; } /* dim non-primary columns */ .c_punctuation, .function_type, .variable_type, .property_type, .signal_type, .define_keyword, .datatype_keyword, .typedef_keyword, .property_flags, .signal_flags, .parameter_annotations, .enum_member_annotations, .struct_member_annotations, .union_member_annotations { color: #888a85; } .function_type a, .function_type a:visited, .function_type a:hover, .property_type a, .property_type a:visited, .property_type a:hover, .signal_type a, .signal_type a:visited, .signal_type a:hover, .signal_flags a, .signal_flags a:visited, .signal_flags a:hover { color: #729fcf; } td p { margin: 0.25em; } div.table table { border-collapse: collapse; border-spacing: 0px; /* tango:aluminium 3 */ border: solid 1px #babdb6; } div.table table td, div.table table th { /* tango:aluminium 3 */ border: solid 1px #babdb6; padding: 3px; vertical-align: top; } div.table table th { /* tango:aluminium 2 */ background-color: #d3d7cf; } h4 { color: #555753; margin-top: 1em; margin-bottom: 1em; } hr { /* tango:aluminium 1 */ color: #d3d7cf; background: #d3d7cf; border: none 0px; height: 1px; clear: both; margin: 2.0em 0em 2.0em 0em; } dl.toc dt { padding-bottom: 0.25em; } dl.toc > dt { padding-top: 0.25em; padding-bottom: 0.25em; font-weight: bold; } dl.toc > dl { padding-bottom: 0.5em; } .parameter { font-style: normal; } .footer { padding-top: 3.5em; /* tango:aluminium 3 */ color: #babdb6; text-align: center; font-size: 80%; } .informalfigure, .figure { margin: 1em; } .informalexample, .example { margin-top: 1em; margin-bottom: 1em; } .warning { /* tango:orange 0/1 */ background: #ffeed9; background: rgba(252, 175, 62, 0.1); border-color: #ffb04f; border-color: rgba(252, 175, 62, 0.2); } .note { /* tango:chameleon 0/0.5 */ background: #d8ffb2; background: rgba(138, 226, 52, 0.1); border-color: #abf562; border-color: rgba(138, 226, 52, 0.2); } div.blockquote { border-color: #eeeeec; } .note, .warning, div.blockquote { padding: 0.5em; border-width: 1px; border-style: solid; margin: 2em; } .note p, .warning p { margin: 0; } div.warning h3.title, div.note h3.title { display: none; } p + div.section { margin-top: 1em; } div.refnamediv, div.refsynopsisdiv, div.refsect1, div.refsect2, div.toc, div.section { margin-bottom: 1em; } /* blob links */ h2 .extralinks, h3 .extralinks { float: right; /* tango:aluminium 3 */ color: #babdb6; font-size: 80%; font-weight: normal; } .lineart { color: #d3d7cf; font-weight: normal; } .annotation { /* tango:aluminium 5 */ color: #555753; font-weight: normal; } .structfield { font-style: normal; font-weight: normal; } acronym,abbr { border-bottom: 1px dotted gray; } .listing_frame { /* tango:sky blue 1 */ border: solid 1px #729fcf; border: solid 1px rgba(114, 159, 207, 0.2); padding: 0px; } .listing_lines, .listing_code { margin-top: 0px; margin-bottom: 0px; padding: 0.5em; } .listing_lines { /* tango:sky blue 0.5 */ background: #a6c5e3; background: rgba(114, 159, 207, 0.2); /* tango:aluminium 6 */ color: #2e3436; } .listing_code { /* tango:sky blue 0 */ background: #e6f3ff; background: rgba(114, 159, 207, 0.1); } .listing_code .programlisting { /* override from previous */ border: none 0px; padding: 0px; background: none; } .listing_lines pre, .listing_code pre { margin: 0px; } @media screen { /* these have a as a first child, but since there are no parent selectors * we can't use that. */ a.footnote { position: relative; top: 0em ! important; } /* this is needed so that the local anchors are displayed below the naviagtion */ div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] { display: inline-block; position: relative; top:-5em; } /* this seems to be a bug in the xsl style sheets when generating indexes */ div.index div.index { top: 0em; } /* make space for the fixed navigation bar and add space at the bottom so that * link targets appear somewhat close to top */ body { padding-top: 2.5em; padding-bottom: 500px; max-width: 60em; } p { max-width: 60em; } /* style and size the navigation bar */ table.navigation#top { position: fixed; background: #e2e2e2; border-bottom: solid 1px #babdb6; border-spacing: 5px; margin-top: 0; margin-bottom: 0; top: 0; left: 0; z-index: 10; } table.navigation#top td { padding-left: 6px; padding-right: 6px; } .navigation a, .navigation a:visited { /* tango:sky blue 3 */ color: #204a87; } .navigation a:hover { /* tango:sky blue 2 */ color: #3465a4; } td.shortcuts { /* tango:sky blue 2 */ color: #3465a4; font-size: 80%; white-space: nowrap; } td.shortcuts .dim { color: #babdb6; } .navigation .title { font-size: 80%; max-width: none; margin: 0px; font-weight: normal; } } @media screen and (min-width: 60em) { /* screen larger than 60em */ body { margin: auto; } } @media screen and (max-width: 60em) { /* screen less than 60em */ #nav_hierarchy { display: none; } #nav_interfaces { display: none; } #nav_prerequisites { display: none; } #nav_derived_interfaces { display: none; } #nav_implementations { display: none; } #nav_child_properties { display: none; } #nav_style_properties { display: none; } #nav_index { display: none; } #nav_glossary { display: none; } .gallery_image { display: none; } .property_flags { display: none; } .signal_flags { display: none; } .parameter_annotations { display: none; } .enum_member_annotations { display: none; } .struct_member_annotations { display: none; } .union_member_annotations { display: none; } /* now that a column is hidden, optimize space */ col.parameters_name { width: auto; } col.parameters_description { width: auto; } col.struct_members_name { width: auto; } col.struct_members_description { width: auto; } col.enum_members_name { width: auto; } col.enum_members_description { width: auto; } col.union_members_name { width: auto; } col.union_members_description { width: auto; } .listing_lines { display: none; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; background: #e2e2e2; border: solid 1px #babdb6; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 3em; } } pre { line-height: 125%; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .hll { background-color: #ffffcc } .c { color: #408080; font-style: italic } /* Comment */ .err { border: 1px solid #FF0000 } /* Error */ .k { color: #008000; font-weight: bold } /* Keyword */ .o { color: #666666 } /* Operator */ .ch { color: #408080; font-style: italic } /* Comment.Hashbang */ .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .cp { color: #BC7A00 } /* Comment.Preproc */ .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */ .c1 { color: #408080; font-style: italic } /* Comment.Single */ .cs { color: #408080; font-style: italic } /* Comment.Special */ .gd { color: #A00000 } /* Generic.Deleted */ .ge { font-style: italic } /* Generic.Emph */ .gr { color: #FF0000 } /* Generic.Error */ .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .gi { color: #00A000 } /* Generic.Inserted */ .go { color: #888888 } /* Generic.Output */ .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .gs { font-weight: bold } /* Generic.Strong */ .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .gt { color: #0044DD } /* Generic.Traceback */ .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .kp { color: #008000 } /* Keyword.Pseudo */ .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .kt { color: #B00040 } /* Keyword.Type */ .m { color: #666666 } /* Literal.Number */ .s { color: #BA2121 } /* Literal.String */ .na { color: #7D9029 } /* Name.Attribute */ .nb { color: #008000 } /* Name.Builtin */ .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .no { color: #880000 } /* Name.Constant */ .nd { color: #AA22FF } /* Name.Decorator */ .ni { color: #999999; font-weight: bold } /* Name.Entity */ .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .nf { color: #0000FF } /* Name.Function */ .nl { color: #A0A000 } /* Name.Label */ .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .nt { color: #008000; font-weight: bold } /* Name.Tag */ .nv { color: #19177C } /* Name.Variable */ .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .w { color: #bbbbbb } /* Text.Whitespace */ .mb { color: #666666 } /* Literal.Number.Bin */ .mf { color: #666666 } /* Literal.Number.Float */ .mh { color: #666666 } /* Literal.Number.Hex */ .mi { color: #666666 } /* Literal.Number.Integer */ .mo { color: #666666 } /* Literal.Number.Oct */ .sa { color: #BA2121 } /* Literal.String.Affix */ .sb { color: #BA2121 } /* Literal.String.Backtick */ .sc { color: #BA2121 } /* Literal.String.Char */ .dl { color: #BA2121 } /* Literal.String.Delimiter */ .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .s2 { color: #BA2121 } /* Literal.String.Double */ .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .sh { color: #BA2121 } /* Literal.String.Heredoc */ .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .sx { color: #008000 } /* Literal.String.Other */ .sr { color: #BB6688 } /* Literal.String.Regex */ .s1 { color: #BA2121 } /* Literal.String.Single */ .ss { color: #19177C } /* Literal.String.Symbol */ .bp { color: #008000 } /* Name.Builtin.Pseudo */ .fm { color: #0000FF } /* Name.Function.Magic */ .vc { color: #19177C } /* Name.Variable.Class */ .vg { color: #19177C } /* Name.Variable.Global */ .vi { color: #19177C } /* Name.Variable.Instance */ .vm { color: #19177C } /* Name.Variable.Magic */ .il { color: #666666 } /* Literal.Number.Integer.Long */telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-observe-channels-context.html0000644000175000017500000005773114006623344026021 00000000000000 TpObserveChannelsContext: telepathy-glib API Reference Manual

TpObserveChannelsContext

TpObserveChannelsContext — context of a Observer.ObserveChannels() call

Properties

TpAccount * account Read / Write / Construct Only
GPtrArray * channels Read / Write / Construct Only
TpConnection * connection Read / Write / Construct Only
gpointer dbus-context Write / Construct Only
TpChannelDispatchOperation * dispatch-operation Read / Write / Construct Only
GHashTable_gchararray+GValue_* observer-info Read / Write / Construct Only
GPtrArray * requests Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpObserveChannelsContext

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Object used to represent the context of a Observer.ObserveChannels() D-Bus call on a TpBaseClient.

Functions

tp_observe_channels_context_accept ()

void
tp_observe_channels_context_accept (TpObserveChannelsContext *self);

Called by TpBaseClientClassObserveChannelsImpl when it's done so the D-Bus method can return.

Parameters

Since: 0.11.5


tp_observe_channels_context_delay ()

void
tp_observe_channels_context_delay (TpObserveChannelsContext *self);

Called by TpBaseClientClassObserveChannelsImpl to indicate that it implements the method in an async way. The caller must take a reference to the TpObserveChannelsContext before calling this function, and is responsible for calling either tp_observe_channels_context_accept() or tp_observe_channels_context_fail() later.

Parameters

Since: 0.11.5


tp_observe_channels_context_fail ()

void
tp_observe_channels_context_fail (TpObserveChannelsContext *self,
                                  const GError *error);

Called by TpBaseClientClassObserveChannelsImpl to raise a D-Bus error.

Parameters

self

a TpObserveChannelsContext

 

error

the error to return from the method

 

Since: 0.11.5


tp_observe_channels_context_is_recovering ()

gboolean
tp_observe_channels_context_is_recovering
                               (TpObserveChannelsContext *self);

If this call to ObserveChannels is for channels that already existed before this observer started (because the observer used tp_base_client_set_observer_recover()), return TRUE.

In most cases, the result is FALSE.

Parameters

Returns

TRUE for pre-existing channels, FALSE for new channels

Since: 0.11.5


tp_observe_channels_context_get_requests ()

GList *
tp_observe_channels_context_get_requests
                               (TpObserveChannelsContext *self);

Return a list of the TpChannelRequest which have been satisfied by the channels associated with self.

Parameters

Returns

a newly allocated GList of reffed TpChannelRequest.

[transfer full][element-type TelepathyGLib.ChannelRequest]

Since: 0.13.14

Types and Values

TpObserveChannelsContext

typedef struct _TpObserveChannelsContext TpObserveChannelsContext;

Data structure representing the context of a Observer.ObserveChannels() call.

Since: 0.11.5

Property Details

The “account” property

  “account”                  TpAccount *

A TpAccount object representing the Account that has been passed to ObserveChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “channels” property

  “channels”                 GPtrArray *

A GPtrArray containing TpChannel objects representing the channels that have been passed to ObserveChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “connection” property

  “connection”               TpConnection *

A TpConnection object representing the Connection that has been passed to ObserveChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “dbus-context” property

  “dbus-context”             gpointer

The DBusGMethodInvocation representing the D-Bus context of the ObserveChannels call. Can only be written during construction.

[skip]

Owner: TpObserveChannelsContext

Flags: Write / Construct Only

Since: 0.11.5


The “dispatch-operation” property

  “dispatch-operation”       TpChannelDispatchOperation *

A TpChannelDispatchOperation object representing the ChannelDispatchOperation that has been passed to ObserveChannels, or NULL if none has been passed. Read-only except during construction.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “observer-info” property

  “observer-info”            GHashTable_gchararray+GValue_*

A GHashTable where the keys are string and values are GValue instances. It represents the Observer_Info hash table that has been passed to ObserveChannels. It's recommended to use high-level method such as tp_observe_channels_context_is_recovering() to access to its content.

This property can't be NULL.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “requests” property

  “requests”                 GPtrArray *

A GPtrArray containing TpChannelRequest objects representing the requests that have been passed to ObserveChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpObserveChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-contact-search.html0000644000175000017500000010532314006623344023766 00000000000000 TpContactSearch: telepathy-glib API Reference Manual

TpContactSearch

TpContactSearch — object for a Telepathy contact search channel

Properties

TpAccount * account Read / Write / Construct Only
guint limit Read / Write
gchar * server Read / Write / Construct Only
guint state Read

Signals

void search-results-received Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpContactSearch

Implemented Interfaces

TpContactSearch implements GAsyncInitable.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpContactSearch objects represent ongoing searches for contacts. They implement the GAsyncInitable interface, so the initialization may fail.

In normal circumstances, after creating a TpContactSearch object, you would connect to the “search-results-received” signal to get search results when a search happens. You would then call tp_contact_search_get_search_keys() to get the search keys, and then do a search using tp_contact_search_start(). When results are found, the “search-results-received” callback will be called.

You can check the search state by looking at the “state” property. If you want to be notified about changes, connect to the notify::state signal, see “notify” for details.

You can search as many times as you want on a TpContactSearch object, but you need to call tp_contact_search_reset_async() between searches.

Functions

tp_contact_search_new_async ()

void
tp_contact_search_new_async (TpAccount *account,
                             const gchar *server,
                             guint limit,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

Parameters

account

an account for the contact search

 

server

the server on which to search for contacts, or NULL

 

limit

The maximum number of results the server should return, or 0 for the server default.

 

callback

a GAsyncReadyCallback to call when the initialization is finished

 

user_data

data to pass to the callback function

 

Since: 0.13.11


tp_contact_search_new_finish ()

TpContactSearch *
tp_contact_search_new_finish (GAsyncResult *result,
                              GError **error);

Parameters

result

the GAsyncResult from the callback

 

error

a GError location to store an error, or NULL

 

Returns

a new contact search object, or NULL in case of error.

[transfer full]

Since: 0.13.11


tp_contact_search_reset_async ()

void
tp_contact_search_reset_async (TpContactSearch *self,
                               const gchar *server,
                               guint limit,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Resets the contact search object so a new search can be performed. If another tp_contact_search_reset_async() call is in progress, it will be cancelled and tp_contact_search_reset_finish() will return an appropriate error.

Parameters

self

the TpContactSearch to reset

 

server

the server on which to search for contacts, or NULL

 

limit

The maximum number of results the server should return, or 0 for the server default.

 

callback

a GAsyncReadyCallback to call when the initialization is finished

 

user_data

data to pass to the callback function

 

Since: 0.13.11


tp_contact_search_reset_finish ()

const gchar * const *
tp_contact_search_reset_finish (TpContactSearch *self,
                                GAsyncResult *result,
                                GError **error);

Parameters

self

the TpContactSearch that is being reset

 

result

the GAsyncResult from the callback

 

error

a GError location to store an error, or NULL

 

Returns

the new search keys, or NULL in case of error.

[transfer none]

Since: 0.13.11


tp_contact_search_start ()

void
tp_contact_search_start (TpContactSearch *self,
                         GHashTable *criteria);

Starts a search for the keys specified in criteria . Connect to the “search-results-received” signal before calling this function.

Before searching again on the same TpContactSearch, you must call tp_contact_search_reset_async().

Parameters

self

a TpContactSearch

 

criteria

a map from keys returned by tp_contact_search_get_search_keys() to values to search for.

[transfer none][element-type utf8 utf8]

Since: 0.13.11


tp_contact_search_get_search_keys ()

const gchar * const *
tp_contact_search_get_search_keys (TpContactSearch *self);

Get the search keys for a contact search. The keys are vCard field names in lower case, except when they're one of the special cases from telepathy-spec like "tel;cell" or "x-n-given". See the

Channel.Type.ContactSearch interface

for a list of the special cases.

Parameters

self

the contact search object to get the keys from

 

Returns

the new search keys, or NULL.

[transfer none]

Since: 0.13.11


tp_contact_search_get_account ()

TpAccount *
tp_contact_search_get_account (TpContactSearch *self);

Parameters

self

a contact search object

 

Returns

The TpContactSearch:account property.

[transfer none]

Since: 0.13.11


tp_contact_search_get_limit ()

guint
tp_contact_search_get_limit (TpContactSearch *self);

Parameters

self

a contact search object

 

Returns

The TpContactSearch:limit property

Since: 0.13.11


tp_contact_search_get_server ()

const gchar *
tp_contact_search_get_server (TpContactSearch *self);

Parameters

self

a contact search object

 

Returns

The TpContactSearch:server property

Since: 0.13.11

Types and Values

struct TpContactSearch

struct TpContactSearch;

An object for Telepathy contact searches. There are no interesting public struct fields.

Since: 0.13.11


struct TpContactSearchClass

struct TpContactSearchClass {
};

The class of a TpContactSearch.

Since: 0.13.11

Property Details

The “account” property

  “account”                  TpAccount *

This search's account.

Owner: TpContactSearch

Flags: Read / Write / Construct Only

Since: 0.13.11


The “limit” property

  “limit”                    guint

The maximum number of results that the server should return. This is only supported by some protocols; use tp_capabilities_supports_contact_search() to check if it's supported.

To change the limit after the object has been constructed, use tp_contact_search_reset_async().

Owner: TpContactSearch

Flags: Read / Write

Default value: 0

Since: 0.13.11


The “server” property

  “server”                   gchar *

The search server. This is only supported by some protocols; use tp_capabilities_supports_contact_search() to check if it's supported.

To change the server after the object has been constructed, use tp_contact_search_reset_async().

Owner: TpContactSearch

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.13.11


The “state” property

  “state”                    guint

This search's state, as a TpChannelContactSearchState.

Owner: TpContactSearch

Flags: Read

Default value: 0

Since: 0.13.11

Signal Details

The “search-results-received” signal

void
user_function (TpContactSearch *self,
               gpointer         results,
               gpointer         user_data)

Emitted when search results are received. Note that this signal may be emitted multiple times for the same search.

Parameters

self

a contact search

 

results

a GList with the search results.

[type GLib.List][element-type TelepathyGLib.ContactSearchResult]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.11

See Also

TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-call-misc.html0000644000175000017500000001377114006623344022741 00000000000000 Misc Call APIs: telepathy-glib API Reference Manual

Misc Call APIs

Misc Call APIs — Misc generated APISs for Call

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This contains generated APIs to be used by TpCallChannel, TpCallStream, TpCallContent or telepathy-farstream. Should not be needed for normal clients.

Functions

tp_call_content_media_description_init_known_interfaces ()

void
tp_call_content_media_description_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpProxy have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_PROXY.

Since: 0.17.5


tp_call_stream_endpoint_init_known_interfaces ()

void
tp_call_stream_endpoint_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpProxy have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_PROXY.

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-proxy-subclass.html0000644000175000017500000017077414006623344024102 00000000000000 TpProxy subclasses and mixins: telepathy-glib API Reference Manual

TpProxy subclasses and mixins

TpProxy subclasses and mixins — Providing extra functionality for a TpProxy or subclass, or subclassing it

Includes

#include <telepathy-glib/proxy-subclass.h>

Description

The implementations of TpProxy subclasses and "mixin" functions need access to the underlying dbus-glib objects used to implement the TpProxy API.

Mixin functions to implement particular D-Bus interfaces should usually be auto-generated, by copying tools/glib-client-gen.py from telepathy-glib.

Functions

tp_proxy_add_interface_by_id ()

DBusGProxy *
tp_proxy_add_interface_by_id (TpProxy *self,
                              GQuark iface);

Declare that this proxy supports a given interface.

To use methods and signals of that interface, either call tp_proxy_get_interface_by_id() to get the DBusGProxy, or use the tp_cli_* wrapper functions (strongly recommended).

If the interface is the proxy's "main interface", or has already been added, then do nothing.

[skip]

Parameters

self

the TpProxy, which must not have become “invalidated”.

 

iface

quark representing the interface to be added

 

Returns

either NULL or a borrowed DBusGProxy corresponding to iface , depending on implementation details. To reliably borrow the DBusGProxy, use tp_proxy_get_interface_by_id(). (This method should probably have returned void; sorry.)

Since: 0.7.1


tp_proxy_add_interfaces ()

void
tp_proxy_add_interfaces (TpProxy *self,
                         const gchar * const *interfaces);

Declare that this proxy supports the given interfaces. Equivalent to calling g_quark_from_string() followed by tp_proxy_add_interface_by_id() for each of the interface names.

[skip]

Parameters

self

the TpProxy, which must not have become “invalidated”.

 

interfaces

the names of the interfaces to be added

 

Since: 0.14.4


tp_proxy_borrow_interface_by_id ()

DBusGProxy *
tp_proxy_borrow_interface_by_id (TpProxy *self,
                                 GQuark iface,
                                 GError **error);

tp_proxy_borrow_interface_by_id is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_proxy_get_interface_by_id() instead.

[skip]

Parameters

self

the TpProxy

 

iface

quark representing the interface required

 

error

used to raise an error in the TP_DBUS_ERRORS domain if iface is invalid, self has been invalidated or self does not implement iface

 

Returns

a borrowed reference to a DBusGProxy for which the bus name and object path are the same as for self , but the interface is as given (or NULL if an error is raised). The reference is only valid as long as self is.

Since: 0.7.1


tp_proxy_get_interface_by_id ()

DBusGProxy *
tp_proxy_get_interface_by_id (TpProxy *self,
                              GQuark iface,
                              GError **error);

[skip]

Parameters

self

the TpProxy

 

iface

quark representing the interface required

 

error

used to raise an error in the TP_DBUS_ERRORS domain if iface is invalid, self has been invalidated or self does not implement iface

 

Returns

a borrowed reference to a DBusGProxy for which the bus name and object path are the same as for self , but the interface is as given (or NULL if an error is raised). The reference is only valid as long as self is.

Since: 0.19.9


tp_proxy_invalidate ()

void
tp_proxy_invalidate (TpProxy *self,
                     const GError *error);

Mark self as having been invalidated - no further calls will work, and if not already invalidated, the “invalidated” signal will be emitted with the given error.

Parameters

self

a proxy

 

error

an error causing the invalidation

 

Since: 0.7.1


TpProxyInterfaceAddedCb ()

void
(*TpProxyInterfaceAddedCb) (TpProxy *self,
                            guint quark,
                            DBusGProxy *proxy,
                            gpointer unused);

The signature of a “interface-added” signal callback.

Parameters

self

the proxy

 

quark

a quark whose string value is the interface being added

 

proxy

the DBusGProxy for the added interface

 

unused

unused

 

Since: 0.7.1


tp_proxy_or_subclass_hook_on_interface_add ()

void
tp_proxy_or_subclass_hook_on_interface_add
                               (GType proxy_or_subclass,
                                TpProxyInterfaceAddedCb callback);

Arrange for callback to be connected to “interface-added” during the TpProxy constructor. This is done sufficiently early that it will see the signal for the default interface (interface member of TpProxyClass), if any, being added. The intended use is for the callback to call dbus_g_proxy_add_signal() on the new DBusGProxy.

Since 0.7.6, to ensure correct overriding of interfaces that might be added to telepathy-glib, before calling this function you should call tp_proxy_init_known_interfaces, tp_connection_init_known_interfaces, tp_channel_init_known_interfaces etc. as appropriate for the subclass.

Parameters

proxy_or_subclass

The GType of TpProxy or a subclass

 

callback

A signal handler for “interface-added”

 

Since: 0.7.1


tp_proxy_init_known_interfaces ()

void
tp_proxy_init_known_interfaces (void);

Ensure that the known interfaces for TpProxy have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add().

Functions like tp_connection_init_known_interfaces and tp_channel_init_known_interfaces do this automatically.

Since: 0.7.6


tp_proxy_subclass_add_error_mapping ()

void
tp_proxy_subclass_add_error_mapping (GType proxy_subclass,
                                     const gchar *static_prefix,
                                     GQuark domain,
                                     GType code_enum_type);

Register a mapping from D-Bus errors received from the given proxy subclass to GError instances.

When a D-Bus error is received, the TpProxy code checks for error mappings registered for the class of the proxy receiving the error, then for all of its parent classes.

If there is an error mapping for which the D-Bus error name starts with the mapping's static_prefix , the proxy will check the corresponding code_enum_type for a value whose value_nick is the rest of the D-Bus error name (with the leading dot removed). If there isn't such a value, it will continue to try other error mappings.

If a suitable error mapping and code are found, the GError that is raised will have its error domain set to the domain from the error mapping, and its error code taken from the enum represented by the code_enum_type .

If no suitable error mapping or code is found, the GError will have error domain TP_DBUS_ERRORS and error code TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR.

Parameters

proxy_subclass

The GType of a subclass of TpProxy (which must not be TpProxy itself)

 

static_prefix

A prefix for D-Bus error names, not including the trailing dot (which must remain valid forever, and should usually be in static storage)

 

domain

A quark representing the corresponding GError domain

 

code_enum_type

The type of a subclass of GEnumClass

 

Since: 0.7.1


tp_proxy_dbus_g_proxy_claim_for_signal_adding ()

gboolean
tp_proxy_dbus_g_proxy_claim_for_signal_adding
                               (DBusGProxy *proxy);

Attempt to "claim" a DBusGProxy for addition of signal signatures. If this function has not been called on proxy before, TRUE is returned, and the caller may safely call dbus_g_proxy_add_signal() on proxy . If this function has already been caled, FALSE is returned, and the caller may not safely call dbus_g_proxy_add_signal().

This is intended for use by auto-generated signal-adding functions, to allow interfaces provided as local extensions to override those in telepathy-glib without causing assertion failures.

Parameters

proxy

a DBusGProxy

 

Returns

TRUE if it is safe to call dbus_g_proxy_add_signal()

Since: 0.7.6


TpProxyInvokeFunc ()

void
(*TpProxyInvokeFunc) (TpProxy *self,
                      GError *error,
                      GValueArray *args,
                      GCallback callback,
                      gpointer user_data,
                      GObject *weak_object);

Signature of a callback invoked by the TpProxy machinery after a D-Bus method call has succeeded or failed. It is responsible for calling the user-supplied callback.

Because parts of dbus-glib aren't reentrant, this callback may be called from an idle handler shortly after the method call reply is received, rather than from the callback for the reply.

At most one of args and error can be non-NULL (implementations may assert this). args and error may both be NULL if a method with no "out" arguments (i.e. a method that returns nothing) was called successfully.

The TpProxyInvokeFunc must call callback with user_data , weak_object , and appropriate arguments derived from error and args . It is responsible for freeing error and args , if their ownership has not been transferred.

Parameters

self

the TpProxy on which the D-Bus method was invoked

 

error

NULL if the method call succeeded, or a non-NULL error if the method call failed

 

args

array of "out" arguments (return values) for the D-Bus method, or NULL if an error occurred or if there were no "out" arguments

 

callback

the callback that should be invoked, as passed to tp_proxy_pending_call_v0_new()

 

user_data

user-supplied data to pass to the callback, as passed to tp_proxy_pending_call_v0_new()

 

weak_object

user-supplied object to pass to the callback, as passed to tp_proxy_pending_call_v0_new()

 

Since: 0.7.1


tp_proxy_pending_call_v0_new ()

TpProxyPendingCall *
tp_proxy_pending_call_v0_new (TpProxy *self,
                              GQuark iface,
                              const gchar *member,
                              DBusGProxy *iface_proxy,
                              TpProxyInvokeFunc invoke_callback,
                              GCallback callback,
                              gpointer user_data,
                              GDestroyNotify destroy,
                              GObject *weak_object,
                              gboolean cancel_must_raise);

Allocate a new pending call structure. After calling this function, the caller must start an asynchronous D-Bus call and give the resulting DBusGProxyCall to the pending call object using tp_proxy_pending_call_v0_take_pending_call().

If dbus-glib gets a reply to the call before it's cancelled, the caller must arrange for tp_proxy_pending_call_v0_take_results() to be called with the results (the intention is for this to be done immediately after dbus_g_proxy_end_call in the callback supplied to dbus-glib).

When dbus-glib discards its reference to the user_data supplied in the asynchronous D-Bus call (i.e. after the call is cancelled or a reply arrives), tp_proxy_pending_call_v0_completed must be called (the intention is for the TpProxyPendingCall to be the user_data in the async call, and for tp_proxy_pending_call_v0_completed to be the GDestroyNotify passed to the same async call).

This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.

Parameters

self

a proxy

 

iface

a quark whose string value is the D-Bus interface

 

member

the name of the method being called

 

iface_proxy

the interface-specific DBusGProxy for iface

 

invoke_callback

an implementation of TpProxyInvokeFunc which will invoke callback with appropriate arguments

 

callback

a callback to be called when the call completes

 

user_data

user-supplied data for the callback

 

destroy

user-supplied destructor for the data

 

weak_object

if not NULL, a GObject which will be weakly referenced by the signal connection - if it is destroyed, the pending call will automatically be cancelled

 

cancel_must_raise

if TRUE, the invoke_callback will be run with error TP_DBUS_ERROR_CANCELLED if the call is cancelled by a call to tp_proxy_pending_call_cancel() or by destruction of the weak_object ; if FALSE, the invoke_callback will not be run at all in these cases

 

Returns

a new pending call structure

Since: 0.7.1


tp_proxy_pending_call_v0_completed ()

void
tp_proxy_pending_call_v0_completed (gpointer p);

Indicate that dbus-glib has finished with this pending call, and therefore either tp_proxy_pending_call_v0_take_results() has already been called, or it will never be called. See tp_proxy_pending_call_v0_new().

The signature is chosen to match GDestroyNotify.

This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.

Parameters

Since: 0.7.1


tp_proxy_pending_call_v0_take_pending_call ()

void
tp_proxy_pending_call_v0_take_pending_call
                               (TpProxyPendingCall *pc,
                                DBusGProxyCall *pending_call);

Set the underlying pending call to be used by this object. See also tp_proxy_pending_call_v0_new().

This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.

Parameters

pc

A pending call on which this function has not yet been called

 

pending_call

The underlying dbus-glib pending call

 

Since: 0.7.1


tp_proxy_pending_call_v0_take_results ()

void
tp_proxy_pending_call_v0_take_results (TpProxyPendingCall *pc,
                                       GError *error,
                                       GValueArray *args);

Set the "out" arguments (return values) from this pending call. See also tp_proxy_pending_call_v0_new().

This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.

Parameters

pc

A pending call on which this function has not yet been called

 

error

NULL if the call was successful, or an error (whose ownership is taken over by the pending call object). Because of dbus-glib idiosyncrasies, this must be the error produced by dbus-glib, not a copy.

 

args

NULL if the call failed or had no "out" arguments, or an array of "out" arguments (whose ownership is taken over by the pending call object)

 

Since: 0.7.1


tp_proxy_signal_connection_v0_new ()

TpProxySignalConnection *
tp_proxy_signal_connection_v0_new (TpProxy *self,
                                   GQuark iface,
                                   const gchar *member,
                                   const GType *expected_types,
                                   GCallback collect_args,
                                   TpProxyInvokeFunc invoke_callback,
                                   GCallback callback,
                                   gpointer user_data,
                                   GDestroyNotify destroy,
                                   GObject *weak_object,
                                   GError **error);

Allocate a new structure representing a signal connection, and connect to the signal, arranging for invoke_callback to be called when it arrives.

This function is for use by TpProxy subclass implementations only, and should usually only be called from code generated by tools/glib-client-gen.py.

Parameters

self

a proxy

 

iface

a quark whose string value is the D-Bus interface

 

member

the name of the signal to which we're connecting

 

expected_types

an array of expected GTypes for the arguments, terminated by G_TYPE_INVALID

 

collect_args

a callback to be given to dbus_g_proxy_connect_signal(), which must marshal the arguments into a GValueArray and use them to call tp_proxy_signal_connection_v0_take_results(); this callback is not guaranteed to be called by future versions of telepathy-glib, which might be able to implement its functionality internally. If no arguments are expected at all (expected_types = { G_TYPE_INVALID }) then this callback should instead be NULL

 

invoke_callback

a function which will be called with error = NULL, which should invoke callback with user_data , weak_object and other appropriate arguments taken from args

 

callback

user callback to be invoked by invoke_callback

 

user_data

user-supplied data for the callback

 

destroy

user-supplied destructor for the data, which will be called when the signal connection is disconnected for any reason, or will be called before this function returns if an error occurs

 

weak_object

if not NULL, a GObject which will be weakly referenced by the signal connection - if it is destroyed, the signal connection will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a signal connection structure, or NULL if the proxy does not have the desired interface or has become invalid

Since: 0.7.1


tp_proxy_signal_connection_v0_take_results ()

void
tp_proxy_signal_connection_v0_take_results
                               (TpProxySignalConnection *sc,
                                GValueArray *args);

Feed the results of a signal invocation back into the signal connection machinery.

This method should only be called from TpProxy subclass implementations, in the callback that implements collect_args .

Parameters

sc

The signal connection

 

args

The arguments of the signal

 

Since: 0.7.1

See Also

TpProxy

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-defs.html0000644000175000017500000003221014006623344022003 00000000000000 Miscellaneous definitions: telepathy-glib API Reference Manual

Miscellaneous definitions

Miscellaneous definitions — Definitions useful for working with the Telepathy protocol

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This header contains definitions which didn't fit into enums.h, interfaces.h or errors.h.

Changed in 0.7.0: in older versions, some of these constants were in base-connection.h and base-connection-manager.h.

Functions

Types and Values

TP_CM_BUS_NAME_BASE

#define TP_CM_BUS_NAME_BASE    "org.freedesktop.Telepathy.ConnectionManager."

The prefix for a connection manager's bus name, to which the CM's name (e.g. "gabble") should be appended.


TP_CM_OBJECT_PATH_BASE

#define TP_CM_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/ConnectionManager/"

The prefix for a connection manager's object path, to which the CM's name (e.g. "gabble") should be appended.


TP_CONN_BUS_NAME_BASE

#define TP_CONN_BUS_NAME_BASE "org.freedesktop.Telepathy.Connection."

The prefix for a connection's bus name, to which the CM's name (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence of elements representing the account should be appended.


TP_CONN_OBJECT_PATH_BASE

#define TP_CONN_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Connection/"

The prefix for a connection's object path, to which the CM's name (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence of elements representing the account should be appended.


TP_ACCOUNT_MANAGER_BUS_NAME

#define TP_ACCOUNT_MANAGER_BUS_NAME "org.freedesktop.Telepathy.AccountManager"

The account manager's well-known bus name


TP_ACCOUNT_MANAGER_OBJECT_PATH

#define TP_ACCOUNT_MANAGER_OBJECT_PATH "/org/freedesktop/Telepathy/AccountManager"

The account manager's standard object path


TP_ACCOUNT_OBJECT_PATH_BASE

#define TP_ACCOUNT_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Account/"

The common prefix of the object path for all Account objects.


TP_CHANNEL_DISPATCHER_BUS_NAME

#define TP_CHANNEL_DISPATCHER_BUS_NAME "org.freedesktop.Telepathy.ChannelDispatcher"

The channel dispatcher's well-known bus name


TP_CHANNEL_DISPATCHER_OBJECT_PATH

#define TP_CHANNEL_DISPATCHER_OBJECT_PATH "/org/freedesktop/Telepathy/ChannelDispatcher"

The channel dispatcher's standard object path


TP_CLIENT_BUS_NAME_BASE

#define TP_CLIENT_BUS_NAME_BASE "org.freedesktop.Telepathy.Client."

The common prefix of the well-known bus name for any Telepathy Client.


TP_CLIENT_OBJECT_PATH_BASE

#define TP_CLIENT_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Client/"

The common prefix of the well-known object path for any Telepathy Client.


TP_DEBUG_OBJECT_PATH

#define TP_DEBUG_OBJECT_PATH "/org/freedesktop/Telepathy/debug"

The standard path for objects implementing the Telepathy Debug interface (TpSvcDebug).


TP_USER_ACTION_TIME_NOT_USER_ACTION

#define TP_USER_ACTION_TIME_NOT_USER_ACTION (G_GINT64_CONSTANT (0))

The "user action time" used by methods like tp_account_channel_request_new() to represent channel requests that are not a result of user action.

See also “user-action-time”, tp_user_action_time_from_x11(), tp_user_action_time_should_present() and TP_USER_ACTION_TIME_CURRENT_TIME.

Since: 0.11.13


TP_USER_ACTION_TIME_CURRENT_TIME

#define TP_USER_ACTION_TIME_CURRENT_TIME (G_MAXINT64)

The "user action time" used by methods like tp_account_channel_request_new() to represent channel requests that should be treated as though they happened at the current time. This is the same concept as GDK_CURRENT_TIME in GDK (but note that the numerical value used in Telepathy is not the same).

See also “user-action-time”, tp_user_action_time_from_x11(), tp_user_action_time_should_present() and TP_USER_ACTION_TIME_NOT_USER_ACTION.

Since: 0.11.13

telepathy-glib-0.24.2/docs/reference/html/TpBaseMediaCallStream.html0000644000175000017500000017353414006623343022256 00000000000000 TpBaseMediaCallStream: telepathy-glib API Reference Manual

TpBaseMediaCallStream

TpBaseMediaCallStream — base class for TpSvcCallStreamInterfaceMedia implementations

Properties

GPtrArray_DBusGObjectPath_ * endpoints Read
gboolean has-server-info Read
gboolean ice-restart-pending Read
GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___* local-candidates Read
GValueArray_gchararray+gchararray_* local-credentials Read
guint receiving-state Read
GPtrArray_GHashTable_gchararray+GValue__* relay-info Read
guint sending-state Read
GPtrArray_GValueArray_gchararray+guint__* stun-servers Read
guint transport Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseCallStream
        ╰── TpBaseMediaCallStream

Implemented Interfaces

TpBaseMediaCallStream implements TpSvcDBusProperties, TpSvcCallStream and TpSvcCallStreamInterfaceMedia.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcCallStreamInterfaceMedia implementations by implementing some of its properties and methods.

Subclasses must still implement TpBaseCallStream's virtual methods plus TpBaseMediaCallStreamClass.add_local_candidates and TpBaseMediaCallStreamClass.finish_initial_candidates.

Functions

TpBaseMediaCallStreamFinishInitialCandidatesFunc ()

gboolean
(*TpBaseMediaCallStreamFinishInitialCandidatesFunc)
                               (TpBaseMediaCallStream *self,
                                GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.finish_initial_candidates.

Parameters

self

a TpBaseMediaCallStream

 

error

a GError to fill

 

Since: 0.17.5


TpBaseMediaCallStreamAddCandidatesFunc ()

GPtrArray *
(*TpBaseMediaCallStreamAddCandidatesFunc)
                               (TpBaseMediaCallStream *self,
                                const GPtrArray *candidates,
                                GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.add_local_candidates.

Implementation should validate the added candidates and return a subset (or all) of them that are accepted. Implementation should return a new GPtrArray build in a way that g_ptr_array_unref() is enough to free all its memory. It is fine to just add element pointers from candidates to the returned GPtrArray without deep-copy them.

Parameters

self

a TpBaseMediaCallStream

 

candidates

a GPtrArray of GValueArray containing candidates info

 

error

a GError to fill

 

Since: 0.17.5


TpBaseMediaCallStreamReportFailureFunc ()

void
(*TpBaseMediaCallStreamReportFailureFunc)
                               (TpBaseMediaCallStream *self,
                                TpStreamFlowState old_state,
                                TpCallStateChangeReason reason,
                                const gchar *dbus_reason,
                                const gchar *message);

Signature of an implementation of TpBaseMediaCallStreamClass.report_sending_failure and TpBaseMediaCallStreamClass.report_receiving_failure.

Parameters

self

a TpBaseMediaCallStream

 

old_state

the previous TpStreamFlowState

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5


TpBaseMediaCallStreamRequestReceivingFunc ()

void
(*TpBaseMediaCallStreamRequestReceivingFunc)
                               (TpBaseMediaCallStream *self,
                                TpHandle contact,
                                gboolean receive);

Signature of an implementation of TpBaseMediaCallStreamClass.request_receiving.

Parameters

self

a TpBaseMediaCallStream

 

contact

the contact from who user wants to start or stop receiving

 

receive

wheter or not user would like to be receiving

 

Since: 0.17.5


TpBaseMediaCallStreamSetSendingFunc ()

gboolean
(*TpBaseMediaCallStreamSetSendingFunc)
                               (TpBaseMediaCallStream *self,
                                gboolean sending,
                                GError **error);

Signature of an implementation of TpBaseMediaCallStreamClass.set_sending.

Parameters

self

a TpBaseMediaCallStream

 

sending

whether or not user would like to be sending

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.17.5


tp_base_media_call_stream_set_relay_info ()

void
tp_base_media_call_stream_set_relay_info
                               (TpBaseMediaCallStream *self,
                                GPtrArray *relays);

Set the relays info. The GPtrArray should have a free_func defined such as g_ptr_array_ref() is enough to keep the data and g_ptr_array_unref() is enough to release it later.

Note that this replaces the previously set relays, it is not an addition.

Parameters

self

a TpBaseMediaCallStream

 

relays

the new relays info

 

Since: 0.17.5


tp_base_media_call_stream_set_stun_servers ()

void
tp_base_media_call_stream_set_stun_servers
                               (TpBaseMediaCallStream *self,
                                GPtrArray *stun_servers);

Set the STUN servers. The GPtrArray should have a free_func defined such as g_ptr_array_ref() is enough to keep the data and g_ptr_array_unref() is enough to release it later.

Note that this replaces the previously set STUN servers, it is not an addition.

Parameters

self

a TpBaseMediaCallStream

 

stun_servers

the new stun servers

 

Since: 0.17.5


tp_base_media_call_stream_add_endpoint ()

void
tp_base_media_call_stream_add_endpoint
                               (TpBaseMediaCallStream *self,
                                TpCallStreamEndpoint *endpoint);

Add endpoint to “endpoints” list, and emits EndpointsChanged DBus signal.

Parameters

Since: 0.17.5


tp_base_media_call_stream_remove_endpoint ()

void
tp_base_media_call_stream_remove_endpoint
                               (TpBaseMediaCallStream *self,
                                TpCallStreamEndpoint *endpoint);

Remove endpoint from “endpoints” list, and emits EndpointsChanged DBus signal.

Parameters

Since: 0.17.5


tp_base_media_call_stream_get_endpoints ()

GList *
tp_base_media_call_stream_get_endpoints
                               (TpBaseMediaCallStream *self);

Same as “endpoints” but as a GList of TpCallStreamEndpoint.

Parameters

Returns

Borrowed GList of TpCallStreamEndpoint.

Since: 0.17.5


tp_base_media_call_stream_get_username ()

const gchar *
tp_base_media_call_stream_get_username
                               (TpBaseMediaCallStream *self);

Parameters

Returns

the username part of “local-credentials”

Since: 0.17.5


tp_base_media_call_stream_get_password ()

const gchar *
tp_base_media_call_stream_get_password
                               (TpBaseMediaCallStream *self);

Parameters

Returns

the password part of “local-credentials”

Since: 0.17.5


tp_base_media_call_stream_update_receiving_state ()

void
tp_base_media_call_stream_update_receiving_state
                               (TpBaseMediaCallStream *self);

Update the receiving state.

Parameters

Since: 0.17.5


tp_base_media_call_stream_get_receiving_state ()

TpStreamFlowState
tp_base_media_call_stream_get_receiving_state
                               (TpBaseMediaCallStream *self);

Parameters

Returns

the value of “receiving-state”.

Since: 0.17.5


tp_base_media_call_stream_update_sending_state ()

void
tp_base_media_call_stream_update_sending_state
                               (TpBaseMediaCallStream *self);

Update the sending state.

Parameters

Since: 0.17.5


tp_base_media_call_stream_get_sending_state ()

TpStreamFlowState
tp_base_media_call_stream_get_sending_state
                               (TpBaseMediaCallStream *self);

Parameters

Returns

the value of “sending-state”.

Since: 0.17.5


tp_base_media_call_stream_set_local_sending ()

void
tp_base_media_call_stream_set_local_sending
                               (TpBaseMediaCallStream *self,
                                gboolean sending);

Set local sending state.

Parameters

self

a TpBaseMediaCallStream

 

sending

whether or not we are sending

 

Since: 0.17.5


tp_base_media_call_stream_get_local_sending ()

gboolean
tp_base_media_call_stream_get_local_sending
                               (TpBaseMediaCallStream *self);

Gets the local sending state

Parameters

Returns

The local sending state

Since: 0.17.7


tp_base_media_call_stream_get_local_candidates ()

GPtrArray *
tp_base_media_call_stream_get_local_candidates
                               (TpBaseMediaCallStream *self);

Parameters

Returns

the value of “local-candidates” as a GtrArray

Since: 0.17.5

Types and Values

struct TpBaseMediaCallStream

struct TpBaseMediaCallStream;

A base class for media call stream implementations

Since: 0.17.5


struct TpBaseMediaCallStreamClass

struct TpBaseMediaCallStreamClass {
  TpBaseMediaCallStreamReportFailureFunc report_sending_failure;
  TpBaseMediaCallStreamReportFailureFunc report_receiving_failure;
  TpBaseMediaCallStreamAddCandidatesFunc add_local_candidates;
  TpBaseMediaCallStreamFinishInitialCandidatesFunc finish_initial_candidates;

  TpBaseMediaCallStreamRequestReceivingFunc request_receiving;
  TpBaseMediaCallStreamSetSendingFunc set_sending;
};

The class structure for TpBaseMediaCallStream

Members

TpBaseMediaCallStreamReportFailureFunc report_sending_failure;

optional; called to indicate a failure in the outgoing portion of the stream

 

TpBaseMediaCallStreamReportFailureFunc report_receiving_failure;

optional; called to indicate a failure in the incoming portion of the stream

 

TpBaseMediaCallStreamAddCandidatesFunc add_local_candidates;

mandatory; called when new candidates are added

 

TpBaseMediaCallStreamFinishInitialCandidatesFunc finish_initial_candidates;

optional; called when the initial batch of candidates has been added, and should now be processed/sent to the remote side

 

TpBaseMediaCallStreamRequestReceivingFunc request_receiving;

optional (see “can-request-receiving”); virtual method called when user requested receiving from the given remote contact. This virtual method should be implemented instead of TpBaseCallStreamClass.request_receiving

 

TpBaseMediaCallStreamSetSendingFunc set_sending;

mandatory; virtual method called when user requested to start/stop sending to remote contacts. This virtual method should be implemented instead of TpBaseCallStreamClass.set_sending

 

Since: 0.17.5

Property Details

The “endpoints” property

  “endpoints”                GPtrArray_DBusGObjectPath_ *

GPtrArray{object-path string} The endpoints of this content.

Owner: TpBaseMediaCallStream

Flags: Read

Since: 0.17.5


The “has-server-info” property

  “has-server-info”          gboolean

TRUE if “relay-info” and “stun-servers” have been set.

Owner: TpBaseMediaCallStream

Flags: Read

Default value: FALSE

Since: 0.17.5


The “ice-restart-pending” property

  “ice-restart-pending”      gboolean

TRUE when ICERestartRequested signal is emitted, and FALSE when SetCredentials is called. Useful for debugging.

Owner: TpBaseMediaCallStream

Flags: Read

Default value: FALSE

Since: 0.17.5


The “local-candidates” property

  “local-candidates”         GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___*

GPtrArray{candidate GValueArray} List of local candidates.

Owner: TpBaseMediaCallStream

Flags: Read

Since: 0.17.5


The “local-credentials” property

  “local-credentials”        GValueArray_gchararray+gchararray_*

GValueArray{username string, password string} ufrag and pwd as defined by ICE.

Owner: TpBaseMediaCallStream

Flags: Read

Since: 0.17.5


The “receiving-state” property

  “receiving-state”          guint

The receiving TpStreamFlowState.

Owner: TpBaseMediaCallStream

Flags: Read

Default value: 0

Since: 0.17.5


The “relay-info” property

  “relay-info”               GPtrArray_GHashTable_gchararray+GValue__*

GPtrArray{relay-info asv} List of relay information.

Owner: TpBaseMediaCallStream

Flags: Read

Since: 0.17.5


The “sending-state” property

  “sending-state”            guint

The sending TpStreamFlowState.

Owner: TpBaseMediaCallStream

Flags: Read

Default value: 0

Since: 0.17.5


The “stun-servers” property

  “stun-servers”             GPtrArray_GValueArray_gchararray+guint__*

GPtrArray{stun-server GValueArray} List of STUN servers.

Owner: TpBaseMediaCallStream

Flags: Read

Since: 0.17.5


The “transport” property

  “transport”                guint

The TpStreamTransportType of this stream.

Owner: TpBaseMediaCallStream

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-ft-metadata.html0000644000175000017500000001301614006623344025453 00000000000000 File transfer Metadata interface: telepathy-glib API Reference Manual

File transfer Metadata interface

File transfer Metadata interface — GInterface to implement metadata file transfer interface

Object Hierarchy

    GInterface
    ╰── TpSvcChannelInterfaceFileTransferMetadata

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The Metadata file transfer channel interface exists to provide a mechanism to include arbitrary additional information in file transfers. For example, one might want to send a document and include the number of times the character P appeared in the file, so would add NumberOfPs=42 to the Metadata property.

Functions

Types and Values

TpSvcChannelInterfaceFileTransferMetadata

typedef struct _TpSvcChannelInterfaceFileTransferMetadata TpSvcChannelInterfaceFileTransferMetadata;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceFileTransferMetadataClass

typedef struct _TpSvcChannelInterfaceFileTransferMetadataClass TpSvcChannelInterfaceFileTransferMetadataClass;

The class of TpSvcChannelInterfaceFileTransferMetadata. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpTextMixin.html0000644000175000017500000012225114006623343023323 00000000000000 TpTextMixin: telepathy-glib API Reference Manual

TpTextMixin

TpTextMixin — a mixin implementation of the text channel type

Types and Values

Includes

#include <telepathy-glib/text-mixin.h>

Description

This mixin can be added to a channel GObject class to implement the text channel type in a general way. It implements the pending message queue and GetMessageTypes, so the implementation should only need to implement Send.

To use the text mixin, include a TpTextMixinClass somewhere in your class structure and a TpTextMixin somewhere in your instance structure, and call tp_text_mixin_class_init() from your class_init function, tp_text_mixin_init() from your init function or constructor, and tp_text_mixin_finalize() from your dispose or finalize function.

To use the text mixin as the implementation of TpSvcChannelTypeText, in the function you pass to G_IMPLEMENT_INTERFACE, you should first call tp_text_mixin_iface_init(), then call tp_svc_channel_type_text_implement_send() to register your implementation of the Send method.

Functions

tp_text_mixin_class_get_offset_quark ()

GQuark
tp_text_mixin_class_get_offset_quark (void);

tp_text_mixin_class_get_offset_quark is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Returns

the quark used for storing mixin offset on a GObjectClass


tp_text_mixin_get_offset_quark ()

GQuark
tp_text_mixin_get_offset_quark (void);

tp_text_mixin_get_offset_quark is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Returns

the quark used for storing mixin offset on a GObject


tp_text_mixin_class_init ()

void
tp_text_mixin_class_init (GObjectClass *obj_cls,
                          glong offset);

tp_text_mixin_class_init is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Initialize the text mixin. Should be called from the implementation's class_init function like so:

1
2
tp_text_mixin_class_init ((GObjectClass *) klass,
                          G_STRUCT_OFFSET (SomeObjectClass, text_mixin));

Parameters

obj_cls

The class of the implementation that uses this mixin

 

offset

The byte offset of the TpTextMixinClass within the class structure

 

tp_text_mixin_init ()

void
tp_text_mixin_init (GObject *obj,
                    glong offset,
                    TpHandleRepoIface *contacts_repo);

tp_text_mixin_init is deprecated and should not be used in newly-written code.

Use tp_message_mixin_init() instead.

Initialize the text mixin. Should be called from the implementation's instance init function like so:

1
2
3
tp_text_mixin_init ((GObject *) self,
                    G_STRUCT_OFFSET (SomeObject, text_mixin),
                    self->contact_repo);

Parameters

obj

An instance of the implementation that uses this mixin

 

offset

The byte offset of the TpTextMixin within the object structure

 

contacts_repo

The connection's TP_HANDLE_TYPE_CONTACT repository

 

tp_text_mixin_set_message_types ()

void
tp_text_mixin_set_message_types (GObject *obj,
                                 ...);

tp_text_mixin_set_message_types is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Set the supported message types.

Parameters

obj

An object with this mixin

 

...

guints representing members of TpChannelTextMessageType, terminated by G_MAXUINT

 

tp_text_mixin_finalize ()

void
tp_text_mixin_finalize (GObject *obj);

tp_text_mixin_finalize is deprecated and should not be used in newly-written code.

Use tp_message_mixin_finalize() instead.

Free resources held by the text mixin.

Parameters

obj

An object with this mixin.

 

tp_text_mixin_receive_with_flags ()

gboolean
tp_text_mixin_receive_with_flags (GObject *obj,
                                  TpChannelTextMessageType type,
                                  TpHandle sender,
                                  time_t timestamp,
                                  const char *text,
                                  TpChannelTextMessageFlags flags);

tp_text_mixin_receive_with_flags is deprecated and should not be used in newly-written code.

Use tp_message_mixin_take_received() instead.

Add a message to the pending queue and emit Received.

Parameters

obj

An object with the text mixin

 

type

The type of message received from the underlying protocol

 

sender

The handle of the message sender

 

timestamp

The time the message was received

 

text

The text of the message

 

flags

the message's flags

 

Returns

TRUE on success; FALSE if the message was lost due to the memory limit.


tp_text_mixin_receive ()

gboolean
tp_text_mixin_receive (GObject *obj,
                       TpChannelTextMessageType type,
                       TpHandle sender,
                       time_t timestamp,
                       const char *text);

tp_text_mixin_receive is deprecated and should not be used in newly-written code.

Use tp_message_mixin_take_received() instead.

Add a message to the pending queue and emit Received. Exactly equivalent to tp_text_mixin_receive_with_flags() with flags == 0.

Parameters

obj

An object with the text mixin

 

type

The type of message received from the underlying protocol

 

sender

The handle of the message sender

 

timestamp

The time the message was received

 

text

The text of the message

 

Returns

TRUE on success; FALSE if the message was lost due to the memory limit.


tp_text_mixin_acknowledge_pending_messages ()

gboolean
tp_text_mixin_acknowledge_pending_messages
                               (GObject *obj,
                                const GArray *ids,
                                GError **error);

tp_text_mixin_acknowledge_pending_messages is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Implements D-Bus method AcknowledgePendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text

Parameters

obj

An object with this mixin

 

ids

An array of guint representing message IDs

 

error

Used to return a pointer to a GError detailing any error that occurred, D-Bus will throw the error only if this function returns false.

 

Returns

TRUE if successful, FALSE if an error was thrown.


tp_text_mixin_list_pending_messages ()

gboolean
tp_text_mixin_list_pending_messages (GObject *obj,
                                     gboolean clear,
                                     GPtrArray **ret,
                                     GError **error);

tp_text_mixin_list_pending_messages is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Implements D-Bus method ListPendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text

Parameters

obj

An object with this mixin

 

clear

If TRUE, delete the pending messages from the queue

 

ret

Used to return a pointer to a new GPtrArray of D-Bus structures

 

error

Used to return a pointer to a GError detailing any error that occurred, D-Bus will throw the error only if this function returns false.

 

Returns

TRUE if successful, FALSE if an error was thrown.


tp_text_mixin_get_message_types ()

gboolean
tp_text_mixin_get_message_types (GObject *obj,
                                 GArray **ret,
                                 GError **error);

tp_text_mixin_get_message_types is deprecated and should not be used in newly-written code.

Use TpMessageMixin instead.

Return a newly allocated GArray of guint, representing message types taken from TpChannelTextMessageType, through ret .

Parameters

obj

An object with this mixin

 

ret

A pointer to where a GArray of guint will be placed on success

 

error

A pointer to where an error will be placed on failure

 

Returns

TRUE on success


tp_text_mixin_clear ()

void
tp_text_mixin_clear (GObject *obj);

tp_text_mixin_clear is deprecated and should not be used in newly-written code.

Use tp_message_mixin_clear() instead.

Clear the pending message queue, deleting all messages.

Parameters

obj

An object with this mixin

 

tp_text_mixin_has_pending_messages ()

gboolean
tp_text_mixin_has_pending_messages (GObject *obj,
                                    TpHandle *first_sender);

tp_text_mixin_has_pending_messages is deprecated and should not be used in newly-written code.

Use tp_message_mixin_has_pending_messages() instead.

Return whether the channel obj has unacknowledged messages. If so, and first_sender is not NULL, the handle of the sender of the first message is placed in it, without incrementing the handle's reference count.

Parameters

obj

An object with this mixin

 

first_sender

If not NULL, used to store the sender of the oldest pending message

 

Returns

TRUE if there are pending messages


tp_text_mixin_set_rescued ()

void
tp_text_mixin_set_rescued (GObject *obj);

tp_text_mixin_set_rescued is deprecated and should not be used in newly-written code.

Use tp_message_mixin_set_rescued() instead.

Mark all pending messages as having been "rescued" from a channel that previously closed.

Parameters

obj

An object with this mixin

 

tp_text_mixin_iface_init ()

void
tp_text_mixin_iface_init (gpointer g_iface,
                          gpointer iface_data);

tp_text_mixin_iface_init is deprecated and should not be used in newly-written code.

Use tp_message_mixin_text_iface_init() instead.

Fill in this mixin's AcknowledgePendingMessages, GetMessageTypes and ListPendingMessages implementations in the given interface vtable. In addition to calling this function during interface initialization, the implementor is expected to call tp_svc_channel_type_text_implement_send(), providing a Send implementation.

Parameters

g_iface

A pointer to the TpSvcChannelTypeTextClass in an object class

 

iface_data

Ignored

 

Types and Values

struct TpTextMixin

struct TpTextMixin {
};

TpTextMixin is deprecated and should not be used in newly-written code.

Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_text_mixin_init().

There are no public fields.


struct TpTextMixinClass

struct TpTextMixinClass {
};

TpTextMixinClass is deprecated and should not be used in newly-written code.

Structure to be included in the class structure of objects that use this mixin. Initialize it with tp_text_mixin_class_init().

There are no public fields.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-gnio-util.html0000644000175000017500000010162614006623344023001 00000000000000 GNIO Utilities: telepathy-glib API Reference Manual

GNIO Utilities

GNIO Utilities — Telepathy/GNIO utility functions

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Utility functions for interacting between Telepathy and GNIO.

Telepathy uses address variants stored in GValue boxes for communicating network socket addresses over D-Bus to and from the Connection Manager (for instance when using the file transfer and stream tube APIs).

This API provides translation between GSocketAddress subtypes and a GValue that can be used by telepathy-glib. GInetSocketAddress is used for IPv4/IPv6 and GUnixSocketAddress for UNIX sockets (only available on platforms with gio-unix).

Functions

tp_g_socket_address_from_variant ()

GSocketAddress *
tp_g_socket_address_from_variant (TpSocketAddressType type,
                                  const GValue *variant,
                                  GError **error);

Converts an address variant stored in a GValue into a GSocketAddress that can be used to make a socket connection with GIO.

Parameters

type

a Telepathy socket address type

 

variant

an initialised GValue containing an address variant, as encoded by dbus-glib

 

error

return location for a GError (or NULL)

 

Returns

a newly allocated GSocketAddress for the given variant, or NULL on error


tp_address_variant_from_g_socket_address ()

GValue *
tp_address_variant_from_g_socket_address
                               (GSocketAddress *address,
                                TpSocketAddressType *type,
                                GError **error);

Converts a GSocketAddress to a GValue address variant that can be used with Telepathy and dbus-glib.

Parameters

address

a GSocketAddress to convert

 

type

optional return of the Telepathy socket type (or NULL)

 

error

return location for a GError (or NULL)

 

Returns

a newly allocated GValue, free with tp_g_value_slice_free()


tp_g_socket_address_from_g_variant ()

GSocketAddress *
tp_g_socket_address_from_g_variant (TpSocketAddressType type,
                                    GVariant *variant,
                                    GError **error);

Converts an address variant stored in a GVariant into a GSocketAddress that can be used to make a socket connection with GIO.

If variant is a floating reference, this function takes ownership of it.

Parameters

type

a Telepathy socket address type

 

variant

a socket address as encoded by Telepathy according to type

 

error

return location for a GError (or NULL)

 

Returns

a newly allocated GSocketAddress for the given variant, or NULL on error

Since: 0.19.10


tp_address_g_variant_from_g_socket_address ()

GVariant *
tp_address_g_variant_from_g_socket_address
                               (GSocketAddress *address,
                                TpSocketAddressType *type,
                                GError **error);

Converts a GSocketAddress to a GVariant address variant that can be used with Telepathy.

Parameters

address

a GSocketAddress to convert

 

type

optional return of the Telepathy socket type (or NULL)

 

error

return location for a GError (or NULL)

 

Returns

a new variant with a floating reference, or NULL.

[transfer none]

Since: 0.19.10


tp_unix_connection_receive_credentials_with_byte ()

GCredentials *
tp_unix_connection_receive_credentials_with_byte
                               (GSocketConnection *connection,
                                guchar *byte,
                                GCancellable *cancellable,
                                GError **error);

A variant of g_unix_connection_receive_credentials() allowing you to get the byte which has been received with the credentials.

Parameters

connection

a GUnixConnection

 

byte

if not NULL, used to return the byte.

[out]

cancellable

a GCancellable, or NULL.

[allow-none]

error

a GError to fill

 

Returns

Received credentials on success (free with g_object_unref()), NULL if error is set.

[transfer full]

Since: 0.13.2


tp_unix_connection_receive_credentials_with_byte_async ()

void
tp_unix_connection_receive_credentials_with_byte_async
                               (GSocketConnection *connection,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously receive credentials.

For more details, see tp_unix_connection_receive_credentials_with_byte() which is the synchronous version of this call.

When the operation is finished, callback will be called. You can then call tp_unix_connection_receive_credentials_with_byte_finish() to get the result of the operation.

Parameters

connection

A GUnixConnection.

 

cancellable

optional GCancellable object, NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 0.17.5


tp_unix_connection_receive_credentials_with_byte_finish ()

GCredentials *
tp_unix_connection_receive_credentials_with_byte_finish
                               (GSocketConnection *connection,
                                GAsyncResult *result,
                                guchar *byte,
                                GError **error);

Finishes an asynchronous receive credentials operation started with tp_unix_connection_receive_credentials_with_byte_async().

Parameters

connection

A GUnixConnection.

 

result

a GAsyncResult.

 

byte

if not NULL, used to return the byte.

[out]

error

a GError, or NULL

 

Returns

a GCredentials, or NULL on error. Free the returned object with g_object_unref().

[transfer full]

Since: 0.17.5


tp_unix_connection_send_credentials_with_byte ()

gboolean
tp_unix_connection_send_credentials_with_byte
                               (GSocketConnection *connection,
                                guchar byte,
                                GCancellable *cancellable,
                                GError **error);

A variant of g_unix_connection_send_credentials() allowing you to choose the byte which is send with the credentials

Parameters

connection

a GUnixConnection

 

byte

the byte to send with the credentials

 

cancellable

a GCancellable, or NULL.

[allow-none]

error

a GError to fill

 

Returns

TRUE on success, FALSE if error is set.

Since: 0.13.2


tp_unix_connection_send_credentials_with_byte_async ()

void
tp_unix_connection_send_credentials_with_byte_async
                               (GSocketConnection *connection,
                                guchar byte,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously send credentials.

For more details, see tp_unix_connection_send_credentials_with_byte() which is the synchronous version of this call.

When the operation is finished, callback will be called. You can then call tp_unix_connection_send_credentials_with_byte_finish() to get the result of the operation.

Parameters

connection

A GUnixConnection.

 

byte

the byte to send with the credentials

 

cancellable

optional GCancellable object, NULL to ignore.

[allow-none]

callback

a GAsyncReadyCallback to call when the request is satisfied.

[scope async]

user_data

the data to pass to callback function.

[closure]

Since: 0.17.5


tp_unix_connection_send_credentials_with_byte_finish ()

gboolean
tp_unix_connection_send_credentials_with_byte_finish
                               (GSocketConnection *connection,
                                GAsyncResult *result,
                                GError **error);

Finishes an asynchronous send credentials operation started with tp_unix_connection_send_credentials_with_byte_async().

Parameters

connection

A GUnixConnection.

 

result

a GAsyncResult.

 

error

a GError, or NULL

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-roomlist.html0000644000175000017500000015457014006623344024356 00000000000000 Room List channels: telepathy-glib API Reference Manual

Room List channels

Room List channels — client-side wrappers for the Room List channel type

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Many instant messaging protocols allow named chatrooms to be listed. This section documents the auto-generated C wrappers for the Room List channel type.

Functions

tp_cli_channel_type_room_list_call_get_listing_rooms ()

TpProxyPendingCall *
tp_cli_channel_type_room_list_call_get_listing_rooms
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_room_list_callback_for_get_listing_rooms callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetListingRooms method call.

Check to see if there is already a room list request in progress on this channel.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_room_list_call_list_rooms ()

TpProxyPendingCall *
tp_cli_channel_type_room_list_call_list_rooms
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_room_list_callback_for_list_rooms callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListRooms method call.

Request the list of rooms from the server. The <tp:member-ref>ListingRooms</tp:member-ref> (True) signal should be emitted when this request is being processed, <tp:member-ref>GotRooms</tp:member-ref> when any room information is received, and <tp:member-ref>ListingRooms</tp:member-ref> (False) when the request is complete.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_room_list_call_stop_listing ()

TpProxyPendingCall *
tp_cli_channel_type_room_list_call_stop_listing
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_room_list_callback_for_stop_listing callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StopListing method call.

Stop the room listing if it's in progress, but don't close the channel. The <tp:member-ref>ListingRooms</tp:member-ref> (False) signal should be emitted when the listing stops.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_room_list_callback_for_get_listing_rooms ()

void
(*tp_cli_channel_type_room_list_callback_for_get_listing_rooms)
                               (TpChannel *proxy,
                                gboolean out_In_Progress,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetListingRooms method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_In_Progress

Used to return an 'out' argument if error is NULL: A boolean indicating if room listing is in progress

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_room_list_callback_for_list_rooms ()

void
(*tp_cli_channel_type_room_list_callback_for_list_rooms)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListRooms method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_room_list_callback_for_stop_listing ()

void
(*tp_cli_channel_type_room_list_callback_for_stop_listing)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StopListing method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_room_list_run_get_listing_rooms ()

gboolean
tp_cli_channel_type_room_list_run_get_listing_rooms
                               (TpChannel *proxy,
                                gint timeout_ms,
                                gboolean *out_In_Progress,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_room_list_run_get_listing_rooms is deprecated and should not be used in newly-written code.

Call the method GetListingRooms and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Check to see if there is already a room list request in progress on this channel.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_In_Progress

Used to return an 'out' argument if TRUE is returned: A boolean indicating if room listing is in progress

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_room_list_run_list_rooms ()

gboolean
tp_cli_channel_type_room_list_run_list_rooms
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_room_list_run_list_rooms is deprecated and should not be used in newly-written code.

Call the method ListRooms and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the list of rooms from the server. The <tp:member-ref>ListingRooms</tp:member-ref> (True) signal should be emitted when this request is being processed, <tp:member-ref>GotRooms</tp:member-ref> when any room information is received, and <tp:member-ref>ListingRooms</tp:member-ref> (False) when the request is complete.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_room_list_run_stop_listing ()

gboolean
tp_cli_channel_type_room_list_run_stop_listing
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_room_list_run_stop_listing is deprecated and should not be used in newly-written code.

Call the method StopListing and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Stop the room listing if it's in progress, but don't close the channel. The <tp:member-ref>ListingRooms</tp:member-ref> (False) signal should be emitted when the listing stops.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_room_list_connect_to_got_rooms ()

TpProxySignalConnection *
tp_cli_channel_type_room_list_connect_to_got_rooms
                               (TpChannel *proxy,
                                tp_cli_channel_type_room_list_signal_callback_got_rooms callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GotRooms.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when information about rooms on the server becomes available. The array contains the room handle (as can be passed to the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">RequestChannel</tp:dbus-ref> method with HANDLE_TYPE_ROOM), the channel type, and a dictionary containing further information about the room as available. The following well-known keys and types are recommended for use where appropriate:</p> <dl> <dt>handle-name (s)</dt> <dd>The identifier of the room (as would be returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">InspectHandles</tp:dbus-ref>). This property is mandatory.</dd> <dt>name (s)</dt> <dd>The human-readable name of the room if different from the handle</dd> <dt>description (s)</dt> <dd>A description of the room's overall purpose</dd> <dt>subject (s)</dt> <dd>The current subject of conversation in the room (as would be returned by getting the string part of the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Subject2">Subject</tp:dbus-ref> property)</dd> <dt>members (u)</dt> <dd>The number of members in the room</dd> <dt>password (b)</dt> <dd>True if the room requires a password to enter</dd> <dt>invite-only (b)</dt> <dd>True if you cannot join the room, but must be invited</dd> <dt>room-id (s)</dt> <dd>The human-readable identifier of a chat room (as would be returned by getting the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Room2">RoomName</tp:dbus-ref> property)</dd> <dt>server (s)</dt> <dd>The DNS name of the server hosting these channels (as would be returned by getting the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Room2">Server</tp:dbus-ref> property)</dd> </dl>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_room_list_connect_to_listing_rooms ()

TpProxySignalConnection *
tp_cli_channel_type_room_list_connect_to_listing_rooms
                               (TpChannel *proxy,
                                tp_cli_channel_type_room_list_signal_callback_listing_rooms callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ListingRooms.

Emitted to indicate whether or not room listing request is currently in progress.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_room_list_signal_callback_got_rooms ()

void
(*tp_cli_channel_type_room_list_signal_callback_got_rooms)
                               (TpChannel *proxy,
                                const GPtrArray *arg_Rooms,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GotRooms.

Parameters

proxy

The proxy on which tp_cli_channel_type_room_list_connect_to_got_rooms() was called

 

arg_Rooms

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs containing: <ul> <li>an integer room handle</li> <li>a string representing the D-Bus interface name of the channel type</li> <li>a dictionary mapping string keys to variant boxed information</li> </ul>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_room_list_signal_callback_listing_rooms ()

void
(*tp_cli_channel_type_room_list_signal_callback_listing_rooms)
                               (TpChannel *proxy,
                                gboolean arg_Listing,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ListingRooms.

Parameters

proxy

The proxy on which tp_cli_channel_type_room_list_connect_to_listing_rooms() was called

 

arg_Listing

A boolean indicating if room listing is in progress

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-base-contact-list.html0000644000175000017500000124471114006623343024411 00000000000000 TpBaseContactList: telepathy-glib API Reference Manual

TpBaseContactList

TpBaseContactList — channel manager for ContactList channels

Functions

void tp_base_contact_list_mixin_class_init ()
void tp_base_contact_list_mixin_register_with_contacts_mixin ()
void tp_base_contact_list_mixin_list_iface_init ()
void tp_base_contact_list_mixin_groups_iface_init ()
void tp_base_contact_list_mixin_blocking_iface_init ()
TpContactListState tp_base_contact_list_get_state ()
TpBaseConnection * tp_base_contact_list_get_connection ()
void tp_base_contact_list_set_list_pending ()
void tp_base_contact_list_set_list_failed ()
void tp_base_contact_list_set_list_received ()
void tp_base_contact_list_contacts_changed ()
void tp_base_contact_list_one_contact_changed ()
void tp_base_contact_list_one_contact_removed ()
gboolean (*TpBaseContactListBooleanFunc) ()
gboolean tp_base_contact_list_false_func ()
gboolean tp_base_contact_list_true_func ()
gboolean tp_base_contact_list_get_contact_list_persists ()
TpHandleSet * (*TpBaseContactListDupContactsFunc) ()
TpHandleSet * tp_base_contact_list_dup_contacts ()
void (*TpBaseContactListDupStatesFunc) ()
void tp_base_contact_list_dup_states ()
guint (*TpBaseContactListUIntFunc) ()
void (*TpBaseContactListAsyncFunc) ()
gboolean (*TpBaseContactListAsyncFinishFunc) ()
void tp_base_contact_list_download_async ()
gboolean tp_base_contact_list_download_finish ()
gboolean tp_base_contact_list_get_download_at_connection ()
gboolean tp_base_contact_list_can_change_contact_list ()
gboolean tp_base_contact_list_get_request_uses_message ()
void (*TpBaseContactListRequestSubscriptionFunc) ()
void tp_base_contact_list_request_subscription_async ()
gboolean tp_base_contact_list_request_subscription_finish ()
void (*TpBaseContactListActOnContactsFunc) ()
void tp_base_contact_list_authorize_publication_async ()
gboolean tp_base_contact_list_authorize_publication_finish ()
void tp_base_contact_list_store_contacts_async ()
gboolean tp_base_contact_list_store_contacts_finish ()
void tp_base_contact_list_remove_contacts_async ()
gboolean tp_base_contact_list_remove_contacts_finish ()
void tp_base_contact_list_unsubscribe_async ()
gboolean tp_base_contact_list_unsubscribe_finish ()
void tp_base_contact_list_unpublish_async ()
gboolean tp_base_contact_list_unpublish_finish ()
gchar * (*TpBaseContactListNormalizeFunc) ()
gchar * tp_base_contact_list_normalize_group ()
GStrv (*TpBaseContactListDupContactGroupsFunc) ()
GStrv tp_base_contact_list_dup_contact_groups ()
GStrv (*TpBaseContactListDupGroupsFunc) ()
GStrv tp_base_contact_list_dup_groups ()
TpHandleSet * (*TpBaseContactListDupGroupMembersFunc) ()
TpHandleSet * tp_base_contact_list_dup_group_members ()
void tp_base_contact_list_group_renamed ()
void tp_base_contact_list_groups_changed ()
void tp_base_contact_list_one_contact_groups_changed ()
void tp_base_contact_list_groups_created ()
void tp_base_contact_list_groups_removed ()
gboolean tp_base_contact_list_has_disjoint_groups ()
void (*TpBaseContactListSetContactGroupsFunc) ()
void tp_base_contact_list_set_contact_groups_async ()
gboolean tp_base_contact_list_set_contact_groups_finish ()
void (*TpBaseContactListGroupContactsFunc) ()
void tp_base_contact_list_add_to_group_async ()
gboolean tp_base_contact_list_add_to_group_finish ()
void tp_base_contact_list_remove_from_group_async ()
gboolean tp_base_contact_list_remove_from_group_finish ()
void tp_base_contact_list_set_group_members_async ()
gboolean tp_base_contact_list_set_group_members_finish ()
void (*TpBaseContactListRemoveGroupFunc) ()
void tp_base_contact_list_remove_group_async ()
gboolean tp_base_contact_list_remove_group_finish ()
void (*TpBaseContactListRenameGroupFunc) ()
void tp_base_contact_list_rename_group_async ()
gboolean tp_base_contact_list_rename_group_finish ()
TpContactMetadataStorageType tp_base_contact_list_get_group_storage ()
void (*TpBaseContactListBlockContactsWithAbuseFunc) ()
gboolean tp_base_contact_list_can_block ()
TpHandleSet * tp_base_contact_list_dup_blocked_contacts ()
void tp_base_contact_list_block_contacts_async ()
gboolean tp_base_contact_list_block_contacts_finish ()
void tp_base_contact_list_block_contacts_with_abuse_async ()
gboolean tp_base_contact_list_block_contacts_with_abuse_finish ()
void tp_base_contact_list_unblock_contacts_async ()
gboolean tp_base_contact_list_unblock_contacts_finish ()
void tp_base_contact_list_contact_blocking_changed ()

Properties

TpBaseConnection * connection Read / Write / Construct Only
gboolean download-at-connection Read / Write / Construct

Object Hierarchy

    GObject
    ╰── TpBaseContactList

Implemented Interfaces

TpBaseContactList implements TpChannelManager.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class represents a connection's contact list (roster, buddy list etc.) inside a connection manager. It can be used to implement the ContactList D-Bus interface on the Connection.

Connections that use TpBaseContactList must also have the TpContactsMixin.

Connection managers should subclass TpBaseContactList, implementing the virtual methods for core functionality in TpBaseContactListClass. Then, in the connection manager's TpBaseConnection subclass:

To support user-defined contact groups too, additionally implement TP_TYPE_CONTACT_GROUP_LIST in the TpBaseContactList subclass, add the TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS interface to the output of TpBaseConnectionClass.get interfaces_always_present, and implement the TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS in the TpBaseConnection subclass using tp_base_contact_list_mixin_groups_iface_init().

Optionally, one or more of the TP_TYPE_MUTABLE_CONTACT_LIST, TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, and TP_TYPE_BLOCKABLE_CONTACT_LIST GObject interfaces may also be implemented, as appropriate to the protocol.

In versions of the Telepathy D-Bus Interface Specification prior to 0.21.0, this functionality was provided as a collection of individual ContactList channels. As a result, this object also implements the TpChannelManager interface, so that it can provide those channels. The channel objects are internal to this object, and not considered to be part of the API.

Functions

tp_base_contact_list_mixin_class_init ()

void
tp_base_contact_list_mixin_class_init (TpBaseConnectionClass *cls);

Register the TpBaseContactList to be used like a mixin in cls . Before this function is called, the TpContactsMixin must be initialized with tp_contacts_mixin_class_init().

If the connection implements TpSvcConnectionInterfaceContactGroups, this function automatically sets up that interface as well as ContactList. In this case, when the TpBaseContactList is created later, it must implement TP_TYPE_CONTACT_GROUP_LIST.

Parameters

cls

A subclass of TpBaseConnection that has a TpContactsMixinClass, and implements TpSvcConnectionInterfaceContactList using TpBaseContactList

 

Since: 0.13.0


tp_base_contact_list_mixin_register_with_contacts_mixin ()

void
tp_base_contact_list_mixin_register_with_contacts_mixin
                               (TpBaseConnection *conn);

Register the ContactList interface with the Contacts interface to make it inspectable. Before this function is called, the TpContactsMixin must be initialized with tp_contacts_mixin_init(), and conn must have a TpBaseContactList in its list of channel managers (by creating it in its TpBaseConnectionClass.create_channel_managers implementation).

If the connection implements TpSvcConnectionInterfaceContactGroups the TpBaseContactList implements TP_TYPE_CONTACT_GROUP_LIST, this function automatically also registers the ContactGroups interface with the contacts mixin.

Parameters

conn

An instance of TpBaseConnection that uses a TpContactsMixin, and implements TpSvcConnectionInterfaceContactList using TpBaseContactList

 

Since: 0.13.0


tp_base_contact_list_mixin_list_iface_init ()

void
tp_base_contact_list_mixin_list_iface_init
                               (TpSvcConnectionInterfaceContactListClass *klass);

Use the TpBaseContactList like a mixin, to implement the ContactList D-Bus interface.

This function should be passed to G_IMPLEMENT_INTERFACE() for TpSvcConnectionInterfaceContactList.

Parameters

klass

the service-side D-Bus interface

 

Since: 0.13.0


tp_base_contact_list_mixin_groups_iface_init ()

void
tp_base_contact_list_mixin_groups_iface_init
                               (TpSvcConnectionInterfaceContactGroupsClass *klass);

Use the TpBaseContactList like a mixin, to implement the ContactGroups D-Bus interface.

This function should be passed to G_IMPLEMENT_INTERFACE() for TpSvcConnectionInterfaceContactGroups.

Parameters

klass

the service-side D-Bus interface

 

Since: 0.13.0


tp_base_contact_list_mixin_blocking_iface_init ()

void
tp_base_contact_list_mixin_blocking_iface_init
                               (TpSvcConnectionInterfaceContactBlockingClass *klass);

Use the TpBaseContactList like a mixin, to implement the ContactBlocking D-Bus interface.

This function should be passed to G_IMPLEMENT_INTERFACE() for TpSvcConnectionInterfaceContactBlocking

Parameters

klass

the service-side D-Bus interface

 

Since: 0.15.1


tp_base_contact_list_get_state ()

TpContactListState
tp_base_contact_list_get_state (TpBaseContactList *self,
                                GError **error);

Return how much progress this object has made towards retrieving the contact list.

If this contact list's connection has disconnected, or retrieving the contact list has failed, return TP_CONTACT_LIST_STATE_FAILURE.

Parameters

self

a contact list

 

error

used to raise an error if something other than TP_CONTACT_LIST_STATE_SUCCESS is returned

 

Returns

the state of the contact list

Since: 0.13.0


tp_base_contact_list_get_connection ()

TpBaseConnection *
tp_base_contact_list_get_connection (TpBaseContactList *self,
                                     GError **error);

Return the Connection this contact list uses. If this contact list's connection has already disconnected, return NULL instead.

Parameters

self

a contact list

 

error

used to raise an error if NULL is returned

 

Returns

the connection, or NULL.

[transfer none]

Since: 0.13.0


tp_base_contact_list_set_list_pending ()

void
tp_base_contact_list_set_list_pending (TpBaseContactList *self);

Record that receiving the initial contact list is in progress.

Parameters

self

the contact list manager

 

Since: 0.13.0


tp_base_contact_list_set_list_failed ()

void
tp_base_contact_list_set_list_failed (TpBaseContactList *self,
                                      GQuark domain,
                                      gint code,
                                      const gchar *message);

Record that receiving the initial contact list has failed.

This method cannot be called after tp_base_contact_list_set_list_received() is called.

Parameters

self

the contact list manager

 

domain

a GError domain

 

code

a GError code

 

message

a GError message

 

Since: 0.13.0


tp_base_contact_list_set_list_received ()

void
tp_base_contact_list_set_list_received
                               (TpBaseContactList *self);

Record that the initial contact list has been received. This allows the contact list manager to reply to requests for the list of contacts that were previously made, and reply to subsequent requests immediately.

This method can be called at most once for a contact list manager.

In protocols where there's no good definition of the point at which the initial contact list has been received (such as link-local XMPP), this method may be called immediately.

The TpBaseContactListDupContactsFunc and TpBaseContactListDupStatesFunc must already give correct results when entering this method.

If implemented, tp_base_contact_list_dup_blocked_contacts() must also give correct results when entering this method.

Parameters

self

the contact list manager

 

Since: 0.13.0


tp_base_contact_list_contacts_changed ()

void
tp_base_contact_list_contacts_changed (TpBaseContactList *self,
                                       TpHandleSet *changed,
                                       TpHandleSet *removed);

Emit signals for a change to the contact list.

The results of TpBaseContactListDupContactsFunc and TpBaseContactListDupStatesFunc must already reflect the contacts' new statuses when entering this method (in practice, this means that implementations must update their own cache of contacts before calling this method).

Parameters

self

the contact list manager

 

changed

a set of contacts added to the contact list or with a changed status.

[allow-none]

removed

a set of contacts removed from the contact list.

[allow-none]

Since: 0.13.0


tp_base_contact_list_one_contact_changed ()

void
tp_base_contact_list_one_contact_changed
                               (TpBaseContactList *self,
                                TpHandle changed);

Convenience wrapper around tp_base_contact_list_contacts_changed() for a single handle in the 'changed' set and no 'removed' set.

Parameters

self

the contact list manager

 

changed

a contact handle

 

Since: 0.13.0


tp_base_contact_list_one_contact_removed ()

void
tp_base_contact_list_one_contact_removed
                               (TpBaseContactList *self,
                                TpHandle removed);

Convenience wrapper around tp_base_contact_list_contacts_changed() for a single handle in the 'removed' set and no 'changed' set.

Parameters

self

the contact list manager

 

removed

a contact handle

 

Since: 0.13.0


TpBaseContactListBooleanFunc ()

gboolean
(*TpBaseContactListBooleanFunc) (TpBaseContactList *self);

Signature of a virtual method that returns a boolean result. These are used for feature-discovery.

For the simple cases of a constant result, use tp_base_contact_list_true_func() or tp_base_contact_list_false_func().

Parameters

self

a contact list manager

 

Returns

a boolean result

Since: 0.13.0


tp_base_contact_list_false_func ()

gboolean
tp_base_contact_list_false_func (TpBaseContactList *self);

An implementation of TpBaseContactListBooleanFunc that returns FALSE, for use in simple cases.

Parameters

self

ignored

 

Returns

FALSE

Since: 0.13.0


tp_base_contact_list_true_func ()

gboolean
tp_base_contact_list_true_func (TpBaseContactList *self);

An implementation of TpBaseContactListBooleanFunc that returns TRUE, for use in simple cases.

Parameters

self

ignored

 

Returns

TRUE

Since: 0.13.0


tp_base_contact_list_get_contact_list_persists ()

gboolean
tp_base_contact_list_get_contact_list_persists
                               (TpBaseContactList *self);

Return whether subscriptions on this protocol persist between sessions (i.e. are stored on the server).

This is a virtual method, implemented using TpBaseContactListClass.get_contact_list_persists.

The default implementation is tp_base_contact_list_true_func(), which is correct for most protocols. Protocols where the contact list isn't stored should use tp_base_contact_list_false_func() as their implementation.

In the rare case of a protocol where subscriptions sometimes persist and this is detected while connecting, the subclass can implement another TpBaseContactListBooleanFunc (whose result must remain constant after the TpBaseConnection has moved to state TP_CONNECTION_STATUS_CONNECTED), and use that as the implementation.

Parameters

self

a contact list manager

 

Returns

TRUE if subscriptions persist

Since: 0.13.0


TpBaseContactListDupContactsFunc ()

TpHandleSet *
(*TpBaseContactListDupContactsFunc) (TpBaseContactList *self);

Signature of a virtual method to list contacts with a particular state; the required state is defined by the particular virtual method being implemented.

The implementation is expected to have a cache of contacts on the contact list, which is updated based on protocol events.

Parameters

self

the contact list manager

 

Returns

a set of contacts with the desired state.

[transfer full]

Since: 0.13.0


tp_base_contact_list_dup_contacts ()

TpHandleSet *
tp_base_contact_list_dup_contacts (TpBaseContactList *self);

Return the contact list. It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, or after the connection has disconnected.

This is a virtual method, implemented using TpBaseContactListClass.dup_contacts. Every subclass of TpBaseContactList must implement this method.

If the contact list implements TP_TYPE_BLOCKABLE_CONTACT_LIST, blocked contacts should not appear in the result of this method unless they are considered to be on the contact list for some other reason.

Parameters

self

a contact list manager

 

Returns

a new TpHandleSet of contact handles.

[transfer full]

Since: 0.13.0


TpBaseContactListDupStatesFunc ()

void
(*TpBaseContactListDupStatesFunc) (TpBaseContactList *self,
                                   TpHandle contact,
                                   TpSubscriptionState *subscribe,
                                   TpSubscriptionState *publish,
                                   gchar **publish_request);

Signature of a virtual method to get contacts' presences. It should return subscribe = TP_SUBSCRIPTION_STATE_NO, publish = TP_SUBSCRIPTION_STATE_NO and publish_request = "", without error, for any contact not on the contact list.

Parameters

self

the contact list manager

 

contact

the contact

 

subscribe

used to return the state of the user's subscription to contact 's presence.

[out][allow-none]

publish

used to return the state of contact 's subscription to the user's presence.

[out][allow-none]

publish_request

if publish will be set to TP_SUBSCRIPTION_STATE_ASK, used to return the message that contact sent when they requested permission to see the user's presence; otherwise, used to return an empty string.

[out][allow-none][transfer full]

Since: 0.13.0


tp_base_contact_list_dup_states ()

void
tp_base_contact_list_dup_states (TpBaseContactList *self,
                                 TpHandle contact,
                                 TpSubscriptionState *subscribe,
                                 TpSubscriptionState *publish,
                                 gchar **publish_request);

Return the presence subscription state of contact . It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, or after the connection has disconnected.

This is a virtual method, implemented using TpBaseContactListClass.dup_states. Every subclass of TpBaseContactList must implement this method.

Parameters

self

a contact list manager

 

contact

the contact

 

subscribe

used to return the state of the user's subscription to contact 's presence.

[out][allow-none]

publish

used to return the state of contact 's subscription to the user's presence.

[out][allow-none]

publish_request

if publish will be set to TP_SUBSCRIPTION_STATE_ASK, used to return the message that contact sent when they requested permission to see the user's presence; otherwise, used to return an empty string.

[out][allow-none][transfer full]

Since: 0.13.0


TpBaseContactListUIntFunc ()

guint
(*TpBaseContactListUIntFunc) (TpBaseContactList *self);

Signature of a virtual method that returns an unsigned integer result. These are used for feature-discovery.

Parameters

self

a contact list manager

 

Returns

an unsigned integer result

Since: 0.13.0


TpBaseContactListAsyncFunc ()

void
(*TpBaseContactListAsyncFunc) (TpBaseContactList *self,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Signature of a virtual method that needs no additional information.

Parameters

self

the contact list manager

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.18.0


TpBaseContactListAsyncFinishFunc ()

gboolean
(*TpBaseContactListAsyncFinishFunc) (TpBaseContactList *self,
                                     GAsyncResult *result,
                                     GError **error);

Signature of a virtual method to finish an async operation.

Parameters

self

the contact list manager

 

result

the result of the asynchronous operation

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success, or FALSE if error is set

Since: 0.13.0


tp_base_contact_list_download_async ()

void
tp_base_contact_list_download_async (TpBaseContactList *self,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Download the contact list when it is not done automatically at connection.

If the TpBaseContactList subclass does not override download_async, the default implementation will raise TP_ERROR_NOT_IMPLEMENTED asynchronously.

Parameters

self

a contact list manager

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.18.0


tp_base_contact_list_download_finish ()

gboolean
tp_base_contact_list_download_finish (TpBaseContactList *self,
                                      GAsyncResult *result,
                                      GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_download_async().

This is a virtual method which may be implemented using TpBaseContactListClass.download_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_download_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.18.0


tp_base_contact_list_get_download_at_connection ()

gboolean
tp_base_contact_list_get_download_at_connection
                               (TpBaseContactList *self);

This function returns the “download-at-connection” property.

Parameters

self

a contact list manager

 

Returns

the “download-at-connection” property

Since: 0.18.0


tp_base_contact_list_can_change_contact_list ()

gboolean
tp_base_contact_list_can_change_contact_list
                               (TpBaseContactList *self);

Return whether the contact list can be changed.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, this method always returns FALSE.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST this is a virtual method, implemented using TpMutableContactListInterface.can_change_contact_list. The default implementation always returns TRUE.

In the rare case of a protocol where subscriptions can only sometimes be changed and this is detected while connecting, the TpBaseContactList subclass should implement TP_TYPE_MUTABLE_CONTACT_LIST. TpMutableContactListInterface.can_change_contact_list to its own implementation, whose result must remain constant after the TpBaseConnection has moved to state TP_CONNECTION_STATUS_CONNECTED.

(For instance, this could be useful for XMPP, where subscriptions can normally be altered, but on connections to Facebook Chat servers this is not actually supported.)

Parameters

self

a contact list manager

 

Returns

TRUE if the contact list can be changed

Since: 0.13.0


tp_base_contact_list_get_request_uses_message ()

gboolean
tp_base_contact_list_get_request_uses_message
                               (TpBaseContactList *self);

Return whether the tp_base_contact_list_request_subscription_async() method's message argument is actually used.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, this method is meaningless, and always returns FALSE.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method, implemented using TpMutableContactListInterface.get_request_uses_message. The default implementation always returns TRUE, which is correct for most protocols; subclasses may reimplement this method with tp_base_contact_list_false_func() or a custom implementation if desired.

Parameters

self

a contact list manager

 

Returns

TRUE if tp_base_contact_list_request_subscription_async() will not ignore its message argument

Since: 0.13.0


TpBaseContactListRequestSubscriptionFunc ()

void
(*TpBaseContactListRequestSubscriptionFunc)
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                const gchar *message,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Signature of a virtual method to request permission to see some contacts' presence.

The virtual method should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before it calls callback .

Parameters

self

the contact list manager

 

contacts

the contacts whose subscription is to be requested

 

message

an optional human-readable message from the user

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_request_subscription_async ()

void
tp_base_contact_list_request_subscription_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                const gchar *message,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request permission to see some contacts' presence.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpMutableContactListInterface.request_subscription_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before it calls callback .

If message will be ignored, TpMutableContactListInterface.get_request_uses_message should also be reimplemented to return FALSE.

Parameters

self

a contact list manager

 

contacts

the contacts whose subscription is to be requested

 

message

an optional human-readable message from the user

 

callback

a callback to call when the request for subscription succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_request_subscription_finish ()

gboolean
tp_base_contact_list_request_subscription_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_request_subscription_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.request_subscription_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_request_subscription_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


TpBaseContactListActOnContactsFunc ()

void
(*TpBaseContactListActOnContactsFunc) (TpBaseContactList *self,
                                       TpHandleSet *contacts,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Signature of a virtual method that acts on a set of contacts and needs no additional information, such as removing contacts, approving or cancelling presence publication, cancelling presence subscription, or removing contacts.

The virtual method should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before returning.

Parameters

self

the contact list manager

 

contacts

the contacts on which to act

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_authorize_publication_async ()

void
tp_base_contact_list_authorize_publication_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Give permission for some contacts to see the local user's presence.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpMutableContactListInterface.authorize_publication_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before it calls callback .

Parameters

self

a contact list manager

 

contacts

the contacts to whom presence will be published

 

callback

a callback to call when the authorization succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_authorize_publication_finish ()

gboolean
tp_base_contact_list_authorize_publication_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_authorize_publication_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.authorize_publication_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_authorize_publication_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_store_contacts_async ()

void
tp_base_contact_list_store_contacts_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Store contacts on the contact list, without attempting to subscribe to them or send presence to them. If this is not possible, do nothing.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method, which may be implemented using TpMutableContactListInterface.store_contacts_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before calling callback .

If the implementation of TpMutableContactListInterface.store_contacts_async is NULL (which is the default), this method calls callback to signal success, but does nothing in the underlying protocol.

Parameters

self

a contact list manager

 

contacts

the contacts to be stored

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_store_contacts_finish ()

gboolean
tp_base_contact_list_store_contacts_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_store_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.store_contacts_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_store_contacts_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_remove_contacts_async ()

void
tp_base_contact_list_remove_contacts_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Remove contacts from the contact list entirely; this includes the effect of both tp_base_contact_list_unsubscribe_async() and tp_base_contact_list_unpublish_async(), and also reverses the effect of tp_base_contact_list_store_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, this method does nothing.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpMutableContactListInterface.remove_contacts_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

the contacts to be removed

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_remove_contacts_finish ()

gboolean
tp_base_contact_list_remove_contacts_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_remove_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.remove_contacts_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_remove_contacts_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_unsubscribe_async ()

void
tp_base_contact_list_unsubscribe_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Cancel a pending subscription request to contacts , or attempt to stop receiving their presence.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpMutableContactListInterface.unsubscribe_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

the contacts whose presence will no longer be received

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_unsubscribe_finish ()

gboolean
tp_base_contact_list_unsubscribe_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_unsubscribe_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.unsubscribe_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_unsubscribe_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_unpublish_async ()

void
tp_base_contact_list_unpublish_async (TpBaseContactList *self,
                                      TpHandleSet *contacts,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Reject a pending subscription request from contacts , or attempt to stop sending presence to them.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpMutableContactListInterface.unpublish_async. The implementation should call tp_base_contact_list_contacts_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

the contacts to whom presence will no longer be published

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_unpublish_finish ()

gboolean
tp_base_contact_list_unpublish_finish (TpBaseContactList *self,
                                       GAsyncResult *result,
                                       GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_unpublish_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpMutableContactListInterface.unpublish_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_unpublish_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


TpBaseContactListNormalizeFunc ()

gchar *
(*TpBaseContactListNormalizeFunc) (TpBaseContactList *self,
                                   const gchar *s);

Signature of a virtual method to normalize strings in a contact list manager.

Parameters

self

a contact list manager

 

s

a non-NULL name to normalize

 

Returns

a normalized form of s , or NULL on error

Since: 0.13.0


tp_base_contact_list_normalize_group ()

gchar *
tp_base_contact_list_normalize_group (TpBaseContactList *self,
                                      const gchar *s);

Return a normalized form of the group name s , or NULL if a group of a sufficiently similar name cannot be created.

If the TpBaseContactList subclass does not implement TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always returns NULL.

For implementations of TP_TYPE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpContactGroupListInterface.normalize_group. If unimplemented, the default behaviour is to use the group's name as-is.

Protocols where this default is not suitable (for instance, if group names cannot be the empty string, or can only contain XML character data, or can only contain a particular Unicode normal form like NFKC) should reimplement this virtual method.

Parameters

self

a contact list manager

 

s

a non-NULL group name to normalize

 

Returns

a normalized form of s , or NULL on error

Since: 0.13.0


TpBaseContactListDupContactGroupsFunc ()

GStrv
(*TpBaseContactListDupContactGroupsFunc)
                               (TpBaseContactList *self,
                                TpHandle contact);

Signature of a virtual method that lists the groups to which contact belongs.

If contact is not on the contact list, this method must return either NULL or an empty array, without error.

Parameters

self

a contact list manager

 

contact

a non-zero contact handle

 

Returns

an array of groups.

[array zero-terminated=1][element-type utf8][transfer full]

Since: 0.13.0


tp_base_contact_list_dup_contact_groups ()

GStrv
tp_base_contact_list_dup_contact_groups
                               (TpBaseContactList *self,
                                TpHandle contact);

Return a list of groups of which contact is a member. It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, after the connection has disconnected, or on a TpBaseContactList that does not implement TP_TYPE_CONTACT_GROUP_LIST.

If contact is not on the contact list, this method must return either NULL or an empty array.

For implementations of TP_TYPE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpContactGroupListInterface.dup_contact_groups. It must always be implemented.

Parameters

self

a contact list manager

 

contact

a contact handle

 

Returns

an array of groups.

[array zero-terminated=1][element-type utf8][transfer full]

Since: 0.13.0


TpBaseContactListDupGroupsFunc ()

GStrv
(*TpBaseContactListDupGroupsFunc) (TpBaseContactList *self);

Signature of a virtual method that lists every group that exists on a connection.

Parameters

self

a contact list manager

 

Returns

an array of groups.

[array zero-terminated=1][element-type utf8][transfer full]

Since: 0.13.0


tp_base_contact_list_dup_groups ()

GStrv
tp_base_contact_list_dup_groups (TpBaseContactList *self);

Return a list of all groups on this connection. It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, after the connection has disconnected, or on a TpBaseContactList that does not implement TP_TYPE_CONTACT_GROUP_LIST.

For implementations of TP_TYPE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpContactGroupListInterface.dup_groups. It must always be implemented.

Parameters

self

a contact list manager

 

Returns

an array of groups.

[array zero-terminated=1][element-type utf8][transfer full]

Since: 0.13.0


TpBaseContactListDupGroupMembersFunc ()

TpHandleSet *
(*TpBaseContactListDupGroupMembersFunc)
                               (TpBaseContactList *self,
                                const gchar *group);

Signature of a virtual method that lists the members of a group.

Parameters

self

a contact list manager

 

group

a normalized group name

 

Returns

a set of contact (TP_HANDLE_TYPE_CONTACT) handles.

[transfer full]

Since: 0.13.0


tp_base_contact_list_dup_group_members ()

TpHandleSet *
tp_base_contact_list_dup_group_members
                               (TpBaseContactList *self,
                                const gchar *group);

Return the set of members of group . It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, after the connection has disconnected, or on a TpBaseContactList that does not implement TP_TYPE_CONTACT_GROUP_LIST.

If group does not exist, this method must return either NULL or an empty set, without error.

For implementations of TP_TYPE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpContactGroupListInterface.dup_group_members. It must always be implemented.

Parameters

self

a contact list manager

 

group

a normalized group name

 

Returns

a set of contact (TP_HANDLE_TYPE_CONTACT) handles

Since: 0.13.0


tp_base_contact_list_group_renamed ()

void
tp_base_contact_list_group_renamed (TpBaseContactList *self,
                                    const gchar *old_name,
                                    const gchar *new_name);

Called by subclasses when a group has been renamed.

Calling tp_base_contact_list_dup_group_members() for old_name during this method should return the group's old members. If this is done correctly by a subclass, then tp_base_contact_list_groups_changed() will automatically be emitted for the members, and the subclass does not need to do so.

It is an error to call this method on a contact list that does not implement TP_TYPE_CONTACT_GROUP_LIST.

Parameters

self

a contact list manager

 

old_name

the group's old name

 

new_name

the group's new name

 

Since: 0.13.0


tp_base_contact_list_groups_changed ()

void
tp_base_contact_list_groups_changed (TpBaseContactList *self,
                                     TpHandleSet *contacts,
                                     const gchar * const *added,
                                     gssize n_added,
                                     const gchar * const *removed,
                                     gssize n_removed);

Called by subclasses when groups' membership has been changed.

If any of the groups in added are not already known to exist, this method also signals that they were created, as if tp_base_contact_list_groups_created() had been called first.

It is an error to call this method on a contact list that does not implement TP_TYPE_CONTACT_GROUP_LIST.

Parameters

self

a contact list manager

 

contacts

a set containing one or more contacts

 

added

zero or more groups to which the contacts were added, or NULL (which has the same meaning as an empty list).

[array length=n_added][element-type utf8][allow-none]

n_added

the number of groups added, or -1 if added is NULL-terminated

 

removed

zero or more groups from which the contacts were removed, or NULL (which has the same meaning as an empty list).

[array zero-terminated=1][element-type utf8][allow-none]

n_removed

the number of groups removed, or -1 if removed is NULL-terminated

 

Since: 0.13.0


tp_base_contact_list_one_contact_groups_changed ()

void
tp_base_contact_list_one_contact_groups_changed
                               (TpBaseContactList *self,
                                TpHandle contact,
                                const gchar * const *added,
                                gssize n_added,
                                const gchar * const *removed,
                                gssize n_removed);

Convenience wrapper around tp_base_contact_list_groups_changed() for a single handle in the 'contacts' set.

(There is no equivalent function for added and removed having trivial contents, because you can already use NULL, 0 for an empty list or &group_name, 1 for a single group.)

Parameters

self

the contact list manager

 

contact

a contact handle

 

added

zero or more groups to which contact was added, or NULL.

[array length=n_added][element-type utf8][allow-none]

n_added

the number of groups added, or -1 if added is NULL-terminated

 

removed

zero or more groups from which the contact was removed, or NULL.

[array zero-terminated=1][element-type utf8][allow-none]

n_removed

the number of groups removed, or -1 if removed is NULL-terminated

 

Since: 0.13.0


tp_base_contact_list_groups_created ()

void
tp_base_contact_list_groups_created (TpBaseContactList *self,
                                     const gchar * const *created,
                                     gssize n_created);

Called by subclasses when new groups have been created. This will typically be followed by a call to tp_base_contact_list_groups_changed() to add some members to those groups.

It is an error to call this method on a contact list that does not implement TP_TYPE_CONTACT_GROUP_LIST.

Parameters

self

a contact list manager

 

created

zero or more groups that were created.

[array length=n_created][element-type utf8][allow-none]

n_created

the number of groups created, or -1 if created is NULL-terminated

 

Since: 0.13.0


tp_base_contact_list_groups_removed ()

void
tp_base_contact_list_groups_removed (TpBaseContactList *self,
                                     const gchar * const *removed,
                                     gssize n_removed);

Called by subclasses when groups have been removed.

Calling tp_base_contact_list_dup_group_members() during this method should return the groups' old members. If this is done correctly by a subclass, then tp_base_contact_list_groups_changed() will automatically be emitted for the old members, and the subclass does not need to do so.

It is an error to call this method on a contact list that does not implement TP_TYPE_CONTACT_GROUP_LIST.

Parameters

self

a contact list manager

 

removed

zero or more groups that were removed.

[array length=n_removed][element-type utf8][allow-none]

n_removed

the number of groups removed, or -1 if removed is NULL-terminated

 

Since: 0.13.0


tp_base_contact_list_has_disjoint_groups ()

gboolean
tp_base_contact_list_has_disjoint_groups
                               (TpBaseContactList *self);

Return whether groups in this protocol are disjoint (i.e. each contact can be in at most one group). This is merely informational: subclasses are responsible for making appropriate calls to tp_base_contact_list_groups_changed(), etc.

If the TpBaseContactList subclass does not implement TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always returns FALSE.

For implementations of TP_TYPE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpContactGroupListInterface.has_disjoint_groups.

The default implementation is tp_base_contact_list_false_func(); subclasses where groups are disjoint should use tp_base_contact_list_true_func() instead. In the unlikely event that a protocol can have disjoint groups, or not, determined at runtime, it can use a custom implementation.

Parameters

self

a contact list manager

 

Returns

TRUE if groups are disjoint

Since: 0.13.0


TpBaseContactListSetContactGroupsFunc ()

void
(*TpBaseContactListSetContactGroupsFunc)
                               (TpBaseContactList *self,
                                TpHandle contact,
                                const gchar * const *normalized_names,
                                gsize n_names,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Signature of an implementation of tp_base_contact_list_set_contact_groups_async().

Parameters

self

a contact list manager

 

contact

a contact handle

 

normalized_names

the normalized names of some groups.

[array length=n_names]

n_names

the number of groups

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_set_contact_groups_async ()

void
tp_base_contact_list_set_contact_groups_async
                               (TpBaseContactList *self,
                                TpHandle contact,
                                const gchar * const *normalized_names,
                                gsize n_names,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Add contact to each group in normalized_names , creating them if necessary, and remove contact from any other groups of which they are a member.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which must be implemented, using TpMutableContactGroupListInterface.set_contact_groups_async. The implementation should call tp_base_contact_list_groups_changed() for any changes it successfully made, before returning.

Parameters

self

a contact list manager

 

contact

a contact handle

 

normalized_names

the normalized names of some groups.

[array length=n_names]

n_names

the number of groups

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_set_contact_groups_finish ()

gboolean
tp_base_contact_list_set_contact_groups_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_set_contact_groups_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.set_contact_groups_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_set_contact_groups_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


TpBaseContactListGroupContactsFunc ()

void
(*TpBaseContactListGroupContactsFunc) (TpBaseContactList *self,
                                       const gchar *group,
                                       TpHandleSet *contacts,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Signature of a virtual method that alters a group's members.

Parameters

self

a contact list manager

 

group

a group

 

contacts

a set of contact handles

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_add_to_group_async ()

void
tp_base_contact_list_add_to_group_async
                               (TpBaseContactList *self,
                                const gchar *group,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Add contacts to group , creating it if necessary.

If group does not exist, the implementation should create it, even if contacts is empty.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which must be implemented, using TpMutableContactGroupListInterface.add_to_group_async. The implementation should call tp_base_contact_list_groups_changed() for any changes it successfully made, before calling callback .

Parameters

self

a contact list manager

 

group

the normalized name of a group

 

contacts

some contacts (may be an empty set)

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_add_to_group_finish ()

gboolean
tp_base_contact_list_add_to_group_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_add_to_group_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.add_to_group_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_add_to_group_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_remove_from_group_async ()

void
tp_base_contact_list_remove_from_group_async
                               (TpBaseContactList *self,
                                const gchar *group,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Remove contacts from group .

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which must be implemented, using TpMutableContactGroupListInterface.remove_from_group_async. The implementation should call tp_base_contact_list_groups_changed() for any changes it successfully made, before calling callback .

Parameters

self

a contact list manager

 

group

the normalized name of a group

 

contacts

some contacts

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_remove_from_group_finish ()

gboolean
tp_base_contact_list_remove_from_group_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_remove_from_group_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.remove_from_group_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_remove_from_group_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_set_group_members_async ()

void
tp_base_contact_list_set_group_members_async
                               (TpBaseContactList *self,
                                const gchar *normalized_group,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Set the members of normalized_group to be exactly contacts (i.e. add contacts , and simultaneously remove all members not in contacts ).

If normalized_group does not exist, the implementation should create it, even if contacts is empty.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which must be implemented, using TpMutableContactGroupListInterface.set_group_members_async. The implementation should call tp_base_contact_list_groups_changed() for any changes it successfully made, before calling callback .

Parameters

self

a contact list manager

 

normalized_group

the normalized name of a group

 

contacts

the contacts who should be in the group

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_set_group_members_finish ()

gboolean
tp_base_contact_list_set_group_members_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_set_group_members_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.set_group_members_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_set_group_members_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


TpBaseContactListRemoveGroupFunc ()

void
(*TpBaseContactListRemoveGroupFunc) (TpBaseContactList *self,
                                     const gchar *group,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Signature of a method that deletes groups.

Parameters

self

a contact list manager

 

group

the normalized name of a group

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_remove_group_async ()

void
tp_base_contact_list_remove_group_async
                               (TpBaseContactList *self,
                                const gchar *group,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Remove a group entirely, removing any members in the process.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which must be implemented, using TpMutableContactGroupListInterface.remove_group_async. The implementation should call tp_base_contact_list_groups_removed() for any groups it successfully removed, before calling callback .

Parameters

self

a contact list manager

 

group

the normalized name of a group

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_remove_group_finish ()

gboolean
tp_base_contact_list_remove_group_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_remove_group_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.remove_group_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_remove_group_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


TpBaseContactListRenameGroupFunc ()

void
(*TpBaseContactListRenameGroupFunc) (TpBaseContactList *self,
                                     const gchar *old_name,
                                     const gchar *new_name,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Signature of a method that renames groups.

Parameters

self

a contact list manager

 

old_name

a group

 

new_name

a new name for the group

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_rename_group_async ()

void
tp_base_contact_list_rename_group_async
                               (TpBaseContactList *self,
                                const gchar *old_name,
                                const gchar *new_name,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Rename a group; if possible, do so as an atomic operation. If this protocol can't do that, emulate renaming in terms of other operations.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented, using TpMutableContactGroupListInterface.rename_group_async.

If this virtual method is not implemented, the default is to implement renaming a group as creating the new group, adding all the old group's members to it, and removing the old group: this is appropriate for protocols like XMPP, in which groups behave more like tags.

The implementation should call tp_base_contact_list_group_renamed() before calling callback .

Parameters

self

a contact list manager

 

old_name

the normalized name of a group, which must exist

 

new_name

a new normalized name for the group name

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.13.0


tp_base_contact_list_rename_group_finish ()

gboolean
tp_base_contact_list_rename_group_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_rename_group_async().

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method which may be implemented using TpMutableContactGroupListInterface.rename_group_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_rename_group_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_get_group_storage ()

TpContactMetadataStorageType
tp_base_contact_list_get_group_storage
                               (TpBaseContactList *self);

Return the extent to which user-defined groups can be set in this protocol. If this is TP_CONTACT_METADATA_STORAGE_TYPE_NONE, methods that would alter the group list will not be called.

If the TpBaseContactList subclass does not implement TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this method is meaningless, and always returns TP_CONTACT_METADATA_STORAGE_TYPE_NONE.

For implementations of TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual method, implemented using TpMutableContactGroupListInterface.get_group_storage.

The default implementation is NULL, which is treated as equivalent to an implementation that always returns TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE. A custom implementation can also be used.

Parameters

self

a contact list manager

 

Since: 0.13.0


TpBaseContactListBlockContactsWithAbuseFunc ()

void
(*TpBaseContactListBlockContactsWithAbuseFunc)
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                gboolean report_abusive,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Signature of a virtual method that blocks a set of contacts, optionally reporting them to the server operator as abusive.

Parameters

self

the contact list manager

 

contacts

the contacts to block

 

report_abusive

whether to report the contacts as abusive to the server operator

 

callback

a callback to call on success, failure or disconnection

 

user_data

user data for the callback

 

Since: 0.15.1


tp_base_contact_list_can_block ()

gboolean
tp_base_contact_list_can_block (TpBaseContactList *self);

Return whether this contact list has a list of blocked contacts. If it does, that list is assumed to be modifiable.

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, this method always returns FALSE.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method, implemented using TpBlockableContactListInterface.can_block. The default implementation always returns TRUE.

In the case of a protocol where blocking may or may not work and this is detected while connecting, the subclass can implement another TpBaseContactListBooleanFunc (whose result must remain constant after the TpBaseConnection has moved to state TP_CONNECTION_STATUS_CONNECTED), and use that as the implementation.

(For instance, this could be useful for XMPP, where support for contact blocking is server-dependent: telepathy-gabble 0.8.x implements it for connections to Google Talk servers, but not for any other server.)

Parameters

self

a contact list manager

 

Returns

TRUE if communication from contacts can be blocked

Since: 0.13.0


tp_base_contact_list_dup_blocked_contacts ()

TpHandleSet *
tp_base_contact_list_dup_blocked_contacts
                               (TpBaseContactList *self);

Return the list of blocked contacts. It is incorrect to call this method before tp_base_contact_list_set_list_received() has been called, after the connection has disconnected, or on a TpBaseContactList that does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method, implemented using TpBlockableContactListInterface.dup_blocked_contacts. It must always be implemented.

Parameters

self

a contact list manager

 

Returns

a new TpHandleSet of contact handles.

[transfer full]

Since: 0.13.0


tp_base_contact_list_block_contacts_async ()

void
tp_base_contact_list_block_contacts_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request that the given contacts are prevented from communicating with the user, and that presence is not sent to them even if they have a valid presence subscription, if possible. This is equivalent to calling tp_base_contact_list_block_contacts_with_abuse_async(), passing FALSE as the report_abusive argument.

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpBlockableContactListInterface.block_contacts_async or TpBlockableContactListInterface.block_contacts_with_abuse_async. The implementation should call tp_base_contact_list_contact_blocking_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

contacts whose communications should be blocked

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_block_contacts_finish ()

gboolean
tp_base_contact_list_block_contacts_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_block_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpBlockableContactListInterface.block_contacts_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_block_contacts_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_block_contacts_with_abuse_async ()

void
tp_base_contact_list_block_contacts_with_abuse_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                gboolean report_abusive,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Request that the given contacts are prevented from communicating with the user, and that presence is not sent to them even if they have a valid presence subscription, if possible. If the TpBaseContactList subclass implements TpBlockableContactListInterface.block_contacts_with_abuse_async and report_abusive is TRUE, also report the given contacts as abusive to the server operator.

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpBlockableContactListInterface.block_contacts_async or TpBlockableContactListInterface.block_contacts_with_abuse_async. The implementation should call tp_base_contact_list_contact_blocking_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

contacts whose communications should be blocked

 

report_abusive

whether to report the contacts as abusive to the server operator

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.15.1


tp_base_contact_list_block_contacts_with_abuse_finish ()

gboolean
tp_base_contact_list_block_contacts_with_abuse_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_block_contacts_with_abuse_async().

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpBlockableContactListInterface.block_contacts_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_block_contacts_with_abuse_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.15.1


tp_base_contact_list_unblock_contacts_async ()

void
tp_base_contact_list_unblock_contacts_async
                               (TpBaseContactList *self,
                                TpHandleSet *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Reverse the effects of tp_base_contact_list_block_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, this method does nothing.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which must be implemented, using TpBlockableContactListInterface.unblock_contacts_async. The implementation should call tp_base_contact_list_contact_blocking_changed() for any contacts it has changed, before calling callback .

Parameters

self

a contact list manager

 

contacts

contacts whose communications should no longer be blocked

 

callback

a callback to call when the operation succeeds or fails

 

user_data

optional data to pass to callback

 

Since: 0.13.0


tp_base_contact_list_unblock_contacts_finish ()

gboolean
tp_base_contact_list_unblock_contacts_finish
                               (TpBaseContactList *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of an asynchronous call to tp_base_contact_list_unblock_contacts_async().

If the TpBaseContactList subclass does not implement TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method.

For implementations of TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual method which may be implemented using TpBlockableContactListInterface.unblock_contacts_finish. If the result will be a GSimpleAsyncResult, the default implementation may be used.

Parameters

self

a contact list manager

 

result

the result passed to callback by an implementation of tp_base_contact_list_unblock_contacts_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE on success or FALSE on error

Since: 0.13.0


tp_base_contact_list_contact_blocking_changed ()

void
tp_base_contact_list_contact_blocking_changed
                               (TpBaseContactList *self,
                                TpHandleSet *changed);

Emit signals for a change to the blocked contacts list.

tp_base_contact_list_dup_blocked_contacts() must already reflect the contacts' new statuses when entering this method (in practice, this means that implementations must update their own cache of contacts before calling this method).

It is an error to call this method if tp_base_contact_list_can_block() would return FALSE.

Parameters

self

the contact list manager

 

changed

a set of contacts who were blocked or unblocked

 

Since: 0.13.0

Types and Values

struct TpBaseContactList

struct TpBaseContactList;

A connection's contact list (roster, buddy list) inside a connection manager. Each TpBaseConnection may have at most one TpBaseContactList.

This abstract base class provides the Telepathy "view" of the contact list: subclasses must provide access to the "model" by implementing its virtual methods in terms of the protocol's real contact list (e.g. the XMPP roster object in Wocky).

The implementation must call tp_base_contact_list_set_list_received() exactly once, when the initial set of contacts has been received (or immediately, if that condition is not meaningful for the protocol).

Since: 0.13.0


struct TpBaseContactListClass

struct TpBaseContactListClass {
    GObjectClass parent_class;

    TpBaseContactListDupContactsFunc dup_contacts;
    TpBaseContactListDupStatesFunc dup_states;
    TpBaseContactListBooleanFunc get_contact_list_persists;

    TpBaseContactListAsyncFunc download_async;
    TpBaseContactListAsyncFinishFunc download_finish;
};

The class of a TpBaseContactList.

Additional functionality can be added by implementing GInterfaces. Most subclasses should implement TP_TYPE_MUTABLE_CONTACT_LIST, which allows the contact list to be altered.

Subclasses may implement TP_TYPE_BLOCKABLE_CONTACT_LIST if contacts can be blocked from communicating with the user.

Members

TpBaseContactListDupContactsFunc dup_contacts;

the implementation of tp_base_contact_list_dup_contacts(); every subclass must implement this itself

 

TpBaseContactListDupStatesFunc dup_states;

the implementation of tp_base_contact_list_dup_states(); every subclass must implement this itself

 

TpBaseContactListBooleanFunc get_contact_list_persists;

the implementation of tp_base_contact_list_get_contact_list_persists(); if a subclass does not implement this itself, the default implementation always returns TRUE, which is correct for most protocols

 

TpBaseContactListAsyncFunc download_async;

the implementation of tp_base_contact_list_download_async(); if a subclass does not implement this itself, the default implementation will raise TP_ERROR_NOT_IMPLEMENTED asynchronously. Since: 0.18.0

 

TpBaseContactListAsyncFinishFunc download_finish;

the implementation of tp_base_contact_list_download_finish(). Since: 0.18.0

 

Since: 0.13.0


TP_TYPE_MUTABLE_CONTACT_LIST

#define             TP_TYPE_MUTABLE_CONTACT_LIST

Interface representing a TpBaseContactList on which the contact list can potentially be changed.

Since: 0.13.0


struct TpMutableContactListInterface

struct TpMutableContactListInterface {
    GTypeInterface parent;

    /* _async mandatory-to-implement, _finish has a default implementation
     * suitable for a GSimpleAsyncResult */

    TpBaseContactListRequestSubscriptionFunc request_subscription_async;
    TpBaseContactListAsyncFinishFunc request_subscription_finish;

    TpBaseContactListActOnContactsFunc authorize_publication_async;
    TpBaseContactListAsyncFinishFunc authorize_publication_finish;

    TpBaseContactListActOnContactsFunc remove_contacts_async;
    TpBaseContactListAsyncFinishFunc remove_contacts_finish;

    TpBaseContactListActOnContactsFunc unsubscribe_async;
    TpBaseContactListAsyncFinishFunc unsubscribe_finish;

    TpBaseContactListActOnContactsFunc unpublish_async;
    TpBaseContactListAsyncFinishFunc unpublish_finish;

    /* optional-to-implement */

    TpBaseContactListActOnContactsFunc store_contacts_async;
    TpBaseContactListAsyncFinishFunc store_contacts_finish;

    TpBaseContactListBooleanFunc can_change_contact_list;
    TpBaseContactListBooleanFunc get_request_uses_message;
};

The interface vtable for a TP_TYPE_MUTABLE_CONTACT_LIST.

Members

GTypeInterface parent;

the parent interface

 

TpBaseContactListRequestSubscriptionFunc request_subscription_async;

the implementation of tp_base_contact_list_request_subscription_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc request_subscription_finish;

the implementation of tp_base_contact_list_request_subscription_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc authorize_publication_async;

the implementation of tp_base_contact_list_authorize_publication_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc authorize_publication_finish;

the implementation of tp_base_contact_list_authorize_publication_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc remove_contacts_async;

the implementation of tp_base_contact_list_remove_contacts_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc remove_contacts_finish;

the implementation of tp_base_contact_list_remove_contacts_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc unsubscribe_async;

the implementation of tp_base_contact_list_unsubscribe_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc unsubscribe_finish;

the implementation of tp_base_contact_list_unsubscribe_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc unpublish_async;

the implementation of tp_base_contact_list_unpublish_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc unpublish_finish;

the implementation of tp_base_contact_list_unpublish_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc store_contacts_async;

the implementation of tp_base_contact_list_store_contacts_async(); if not reimplemented, the default implementation is NULL, which is interpreted as "do nothing"

 

TpBaseContactListAsyncFinishFunc store_contacts_finish;

the implementation of tp_base_contact_list_store_contacts_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListBooleanFunc can_change_contact_list;

the implementation of tp_base_contact_list_can_change_contact_list(); if not reimplemented, the default implementation always returns TRUE

 

TpBaseContactListBooleanFunc get_request_uses_message;

the implementation of tp_base_contact_list_get_request_uses_message(); if not reimplemented, the default implementation always returns TRUE

 

Since: 0.13.0


TP_TYPE_CONTACT_GROUP_LIST

#define             TP_TYPE_CONTACT_GROUP_LIST

Interface representing a TpBaseContactList on which contacts can be in user-defined groups, which cannot necessarily be edited (TP_TYPE_MUTABLE_CONTACT_GROUP_LIST represents a list where these groups exist and can also be edited).

Since: 0.13.0


struct TpContactGroupListInterface

struct TpContactGroupListInterface {
    GTypeInterface parent;
    /* mandatory to implement */
    TpBaseContactListDupGroupsFunc dup_groups;
    TpBaseContactListDupGroupMembersFunc dup_group_members;
    TpBaseContactListDupContactGroupsFunc dup_contact_groups;
    /* optional to implement */
    TpBaseContactListBooleanFunc has_disjoint_groups;
    TpBaseContactListNormalizeFunc normalize_group;
};

The interface vtable for a TP_TYPE_CONTACT_GROUP_LIST.

Members

GTypeInterface parent;

the parent interface

 

TpBaseContactListDupGroupsFunc dup_groups;

the implementation of tp_base_contact_list_dup_groups(); must always be implemented

 

TpBaseContactListDupGroupMembersFunc dup_group_members;

the implementation of tp_base_contact_list_dup_group_members(); must always be implemented

 

TpBaseContactListDupContactGroupsFunc dup_contact_groups;

the implementation of tp_base_contact_list_dup_contact_groups(); must always be implemented

 

TpBaseContactListBooleanFunc has_disjoint_groups;

the implementation of tp_base_contact_list_has_disjoint_groups(); if not reimplemented, the default implementation always returns FALSE

 

TpBaseContactListNormalizeFunc normalize_group;

the implementation of tp_base_contact_list_normalize_group(); if not reimplemented, the default implementation is NULL, which allows any UTF-8 string as a group name (including the empty string) and assumes that any distinct group names can coexist

 

Since: 0.13.0


TP_TYPE_MUTABLE_CONTACT_GROUP_LIST

#define             TP_TYPE_MUTABLE_CONTACT_GROUP_LIST

Interface representing a TpBaseContactList on which user-defined contact groups can potentially be changed. TP_TYPE_CONTACT_GROUP_LIST is a prerequisite for this interface.

Since: 0.13.0


struct TpMutableContactGroupListInterface

struct TpMutableContactGroupListInterface {
    GTypeInterface parent;

    /* _async mandatory-to-implement, _finish has a default implementation
     * suitable for a GSimpleAsyncResult */

    TpBaseContactListSetContactGroupsFunc set_contact_groups_async;
    TpBaseContactListAsyncFinishFunc set_contact_groups_finish;

    TpBaseContactListGroupContactsFunc set_group_members_async;
    TpBaseContactListAsyncFinishFunc set_group_members_finish;

    TpBaseContactListGroupContactsFunc add_to_group_async;
    TpBaseContactListAsyncFinishFunc add_to_group_finish;

    TpBaseContactListGroupContactsFunc remove_from_group_async;
    TpBaseContactListAsyncFinishFunc remove_from_group_finish;

    TpBaseContactListRemoveGroupFunc remove_group_async;
    TpBaseContactListAsyncFinishFunc remove_group_finish;

    /* optional to implement */

    TpBaseContactListRenameGroupFunc rename_group_async;
    TpBaseContactListAsyncFinishFunc rename_group_finish;
    TpBaseContactListUIntFunc get_group_storage;
};

The interface vtable for a TP_TYPE_MUTABLE_CONTACT_GROUP_LIST.

Members

GTypeInterface parent;

the parent interface

 

TpBaseContactListSetContactGroupsFunc set_contact_groups_async;

the implementation of tp_base_contact_list_set_contact_groups_async(); must always be implemented

 

TpBaseContactListAsyncFinishFunc set_contact_groups_finish;

the implementation of tp_base_contact_list_set_contact_groups_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListGroupContactsFunc set_group_members_async;

the implementation of tp_base_contact_list_set_group_members_async(); must always be implemented

 

TpBaseContactListAsyncFinishFunc set_group_members_finish;

the implementation of tp_base_contact_list_set_group_members_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListGroupContactsFunc add_to_group_async;

the implementation of tp_base_contact_list_add_to_group_async(); must always be implemented

 

TpBaseContactListAsyncFinishFunc add_to_group_finish;

the implementation of tp_base_contact_list_add_to_group_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListGroupContactsFunc remove_from_group_async;

the implementation of tp_base_contact_list_remove_from_group_async(); must always be implemented

 

TpBaseContactListAsyncFinishFunc remove_from_group_finish;

the implementation of tp_base_contact_list_remove_from_group_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListRemoveGroupFunc remove_group_async;

the implementation of tp_base_contact_list_remove_group_async(); must always be implemented

 

TpBaseContactListAsyncFinishFunc remove_group_finish;

the implementation of tp_base_contact_list_remove_group_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListRenameGroupFunc rename_group_async;

the implementation of tp_base_contact_list_rename_group_async(); the default implementation results in group renaming being emulated via a call to add_to_group_async and a call to remove_group_async

 

TpBaseContactListAsyncFinishFunc rename_group_finish;

the implementation of tp_base_contact_list_rename_group_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListUIntFunc get_group_storage;

the implementation of tp_base_contact_list_get_group_storage(); the default implementation is NULL, which results in TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE being advertised

 

Since: 0.13.0


TP_TYPE_BLOCKABLE_CONTACT_LIST

#define             TP_TYPE_BLOCKABLE_CONTACT_LIST

Interface representing a TpBaseContactList on which contacts can be blocked from communicating with the user.

Since: 0.13.0


struct TpBlockableContactListInterface

struct TpBlockableContactListInterface {
    GTypeInterface parent;

    /* mandatory to implement */

    TpBaseContactListDupContactsFunc dup_blocked_contacts;

    /* unblock_contacts_async is mandatory to implement; either
     * block_contacts_async or block_contacts_with_abuse_async (but not both!)
     * must also be implemented. _finish have default implementations
     * suitable for a GSimpleAsyncResult */

    TpBaseContactListActOnContactsFunc block_contacts_async;
    TpBaseContactListAsyncFinishFunc block_contacts_finish;
    TpBaseContactListActOnContactsFunc unblock_contacts_async;
    TpBaseContactListAsyncFinishFunc unblock_contacts_finish;

    /* optional to implement */
    TpBaseContactListBooleanFunc can_block;

    /* see above. block_contacts_finish is the corresponding _finish function.
     */
    TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async;
};

The interface vtable for a TP_TYPE_BLOCKABLE_CONTACT_LIST.

Members

GTypeInterface parent;

the parent interface

 

TpBaseContactListDupContactsFunc dup_blocked_contacts;

the implementation of tp_base_contact_list_dup_blocked_contacts(); must always be provided

 

TpBaseContactListActOnContactsFunc block_contacts_async;

the implementation of tp_base_contact_list_block_contacts_async(); either this or block_contacts_with_abuse_async must always be provided

 

TpBaseContactListAsyncFinishFunc block_contacts_finish;

the implementation of tp_base_contact_list_block_contacts_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListActOnContactsFunc unblock_contacts_async;

the implementation of tp_base_contact_list_unblock_contacts_async(); must always be provided

 

TpBaseContactListAsyncFinishFunc unblock_contacts_finish;

the implementation of tp_base_contact_list_unblock_contacts_finish(); the default implementation may be used if result is a GSimpleAsyncResult

 

TpBaseContactListBooleanFunc can_block;

the implementation of tp_base_contact_list_can_block(); if not reimplemented, the default implementation always returns TRUE

 

TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async;

the implementation of tp_base_contact_list_block_contacts_async(); either this or block_contacts_async must always be provided. If the underlying protocol does not support reporting contacts as abusive, implement

 

Since: 0.13.0

Property Details

The “connection” property

  “connection”               TpBaseConnection *

The connection that owns this channel manager. Read-only except during construction.

Owner: TpBaseContactList

Flags: Read / Write / Construct Only

Since: 0.13.0


The “download-at-connection” property

  “download-at-connection”   gboolean

Whether the roster should be automatically downloaded at connection.

This property doesn't change anything in TpBaseContactsList's behaviour. Implementations should check this property when they become connected and in their Download method, and behave accordingly.

Owner: TpBaseContactList

Flags: Read / Write / Construct

Default value: TRUE

Since: 0.18.0

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-call.html0000644000175000017500000136003414006623344024205 00000000000000 Service-side Channel Call interface: telepathy-glib API Reference Manual

Service-side Channel Call interface

Service-side Channel Call interface — GInterface to implement call channels

Functions

void (*tp_svc_channel_type_call_accept_impl) ()
void (*tp_svc_channel_type_call_add_content_impl) ()
void tp_svc_channel_type_call_emit_call_members_changed ()
void tp_svc_channel_type_call_emit_call_state_changed ()
void tp_svc_channel_type_call_emit_content_added ()
void tp_svc_channel_type_call_emit_content_removed ()
void (*tp_svc_channel_type_call_hangup_impl) ()
void tp_svc_channel_type_call_implement_accept ()
void tp_svc_channel_type_call_implement_add_content ()
void tp_svc_channel_type_call_implement_hangup ()
void tp_svc_channel_type_call_implement_set_queued ()
void tp_svc_channel_type_call_implement_set_ringing ()
void tp_svc_channel_type_call_return_from_accept ()
void tp_svc_channel_type_call_return_from_add_content ()
void tp_svc_channel_type_call_return_from_hangup ()
void tp_svc_channel_type_call_return_from_set_queued ()
void tp_svc_channel_type_call_return_from_set_ringing ()
void (*tp_svc_channel_type_call_set_queued_impl) ()
void (*tp_svc_channel_type_call_set_ringing_impl) ()
void tp_svc_call_content_emit_streams_added ()
void tp_svc_call_content_emit_streams_removed ()
void tp_svc_call_content_implement_remove ()
void (*tp_svc_call_content_remove_impl) ()
void tp_svc_call_content_return_from_remove ()
void (*tp_svc_call_content_interface_media_acknowledge_dtmf_change_impl) ()
void tp_svc_call_content_interface_media_emit_dtmf_change_requested ()
void tp_svc_call_content_interface_media_emit_local_media_description_changed ()
void tp_svc_call_content_interface_media_emit_media_description_offer_done ()
void tp_svc_call_content_interface_media_emit_media_descriptions_removed ()
void tp_svc_call_content_interface_media_emit_new_media_description_offer ()
void tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed ()
void (*tp_svc_call_content_interface_media_fail_impl) ()
void tp_svc_call_content_interface_media_implement_acknowledge_dtmf_change ()
void tp_svc_call_content_interface_media_implement_fail ()
void tp_svc_call_content_interface_media_implement_update_local_media_description ()
void tp_svc_call_content_interface_media_return_from_acknowledge_dtmf_change ()
void tp_svc_call_content_interface_media_return_from_fail ()
void tp_svc_call_content_interface_media_return_from_update_local_media_description ()
void (*tp_svc_call_content_interface_media_update_local_media_description_impl) ()
void tp_svc_call_content_interface_video_control_emit_bitrate_changed ()
void tp_svc_call_content_interface_video_control_emit_framerate_changed ()
void tp_svc_call_content_interface_video_control_emit_key_frame_requested ()
void tp_svc_call_content_interface_video_control_emit_mtu_changed ()
void tp_svc_call_content_interface_video_control_emit_video_resolution_changed ()
void tp_svc_call_content_interface_audio_control_implement_report_input_volume ()
void tp_svc_call_content_interface_audio_control_implement_report_output_volume ()
void (*tp_svc_call_content_interface_audio_control_report_input_volume_impl) ()
void (*tp_svc_call_content_interface_audio_control_report_output_volume_impl) ()
void tp_svc_call_content_interface_audio_control_return_from_report_input_volume ()
void tp_svc_call_content_interface_audio_control_return_from_report_output_volume ()
void tp_svc_call_content_interface_dtmf_emit_sending_tones ()
void tp_svc_call_content_interface_dtmf_emit_stopped_tones ()
void tp_svc_call_content_interface_dtmf_emit_tones_deferred ()
void tp_svc_call_content_interface_dtmf_implement_multiple_tones ()
void tp_svc_call_content_interface_dtmf_implement_start_tone ()
void tp_svc_call_content_interface_dtmf_implement_stop_tone ()
void (*tp_svc_call_content_interface_dtmf_multiple_tones_impl) ()
void tp_svc_call_content_interface_dtmf_return_from_multiple_tones ()
void tp_svc_call_content_interface_dtmf_return_from_start_tone ()
void tp_svc_call_content_interface_dtmf_return_from_stop_tone ()
void (*tp_svc_call_content_interface_dtmf_start_tone_impl) ()
void (*tp_svc_call_content_interface_dtmf_stop_tone_impl) ()
void (*tp_svc_call_content_media_description_accept_impl) ()
void tp_svc_call_content_media_description_implement_accept ()
void tp_svc_call_content_media_description_implement_reject ()
void tp_svc_call_content_media_description_return_from_accept ()
void tp_svc_call_content_media_description_return_from_reject ()
void (*tp_svc_call_content_media_description_reject_impl) ()
void tp_svc_call_stream_implement_request_receiving ()
void tp_svc_call_stream_implement_set_sending ()
void tp_svc_call_stream_emit_local_sending_state_changed ()
void tp_svc_call_stream_emit_remote_members_changed ()
void (*tp_svc_call_stream_request_receiving_impl) ()
void tp_svc_call_stream_return_from_request_receiving ()
void tp_svc_call_stream_return_from_set_sending ()
void (*tp_svc_call_stream_set_sending_impl) ()
void (*tp_svc_call_stream_interface_media_add_candidates_impl) ()
void (*tp_svc_call_stream_interface_media_complete_receiving_state_change_impl) ()
void (*tp_svc_call_stream_interface_media_complete_sending_state_change_impl) ()
void tp_svc_call_stream_interface_media_emit_endpoints_changed ()
void tp_svc_call_stream_interface_media_emit_ice_restart_requested ()
void tp_svc_call_stream_interface_media_emit_local_candidates_added ()
void tp_svc_call_stream_interface_media_emit_local_credentials_changed ()
void tp_svc_call_stream_interface_media_emit_receiving_state_changed ()
void tp_svc_call_stream_interface_media_emit_relay_info_changed ()
void tp_svc_call_stream_interface_media_emit_sending_state_changed ()
void tp_svc_call_stream_interface_media_emit_server_info_retrieved ()
void tp_svc_call_stream_interface_media_emit_stun_servers_changed ()
void (*tp_svc_call_stream_interface_media_fail_impl) ()
void (*tp_svc_call_stream_interface_media_finish_initial_candidates_impl) ()
void tp_svc_call_stream_interface_media_implement_add_candidates ()
void tp_svc_call_stream_interface_media_implement_complete_receiving_state_change ()
void tp_svc_call_stream_interface_media_implement_complete_sending_state_change ()
void tp_svc_call_stream_interface_media_implement_fail ()
void tp_svc_call_stream_interface_media_implement_finish_initial_candidates ()
void tp_svc_call_stream_interface_media_implement_report_receiving_failure ()
void tp_svc_call_stream_interface_media_implement_report_sending_failure ()
void tp_svc_call_stream_interface_media_implement_set_credentials ()
void (*tp_svc_call_stream_interface_media_report_receiving_failure_impl) ()
void (*tp_svc_call_stream_interface_media_report_sending_failure_impl) ()
void tp_svc_call_stream_interface_media_return_from_add_candidates ()
void tp_svc_call_stream_interface_media_return_from_complete_receiving_state_change ()
void tp_svc_call_stream_interface_media_return_from_complete_sending_state_change ()
void tp_svc_call_stream_interface_media_return_from_fail ()
void tp_svc_call_stream_interface_media_return_from_finish_initial_candidates ()
void tp_svc_call_stream_interface_media_return_from_report_receiving_failure ()
void tp_svc_call_stream_interface_media_return_from_report_sending_failure ()
void tp_svc_call_stream_interface_media_return_from_set_credentials ()
void (*tp_svc_call_stream_interface_media_set_credentials_impl) ()
void (*tp_svc_call_stream_endpoint_accept_selected_candidate_pair_impl) ()
void tp_svc_call_stream_endpoint_emit_candidate_pair_selected ()
void tp_svc_call_stream_endpoint_emit_controlling_changed ()
void tp_svc_call_stream_endpoint_emit_endpoint_state_changed ()
void tp_svc_call_stream_endpoint_emit_remote_candidates_added ()
void tp_svc_call_stream_endpoint_emit_remote_credentials_set ()
void tp_svc_call_stream_endpoint_implement_accept_selected_candidate_pair ()
void tp_svc_call_stream_endpoint_implement_reject_selected_candidate_pair ()
void tp_svc_call_stream_endpoint_implement_set_controlling ()
void tp_svc_call_stream_endpoint_implement_set_endpoint_state ()
void tp_svc_call_stream_endpoint_implement_set_selected_candidate_pair ()
void (*tp_svc_call_stream_endpoint_reject_selected_candidate_pair_impl) ()
void tp_svc_call_stream_endpoint_return_from_accept_selected_candidate_pair ()
void tp_svc_call_stream_endpoint_return_from_reject_selected_candidate_pair ()
void tp_svc_call_stream_endpoint_return_from_set_controlling ()
void tp_svc_call_stream_endpoint_return_from_set_endpoint_state ()
void tp_svc_call_stream_endpoint_return_from_set_selected_candidate_pair ()
void (*tp_svc_call_stream_endpoint_set_controlling_impl) ()
void (*tp_svc_call_stream_endpoint_set_endpoint_state_impl) ()
void (*tp_svc_call_stream_endpoint_set_selected_candidate_pair_impl) ()

Signals

void call-members-changed Has Details
void call-state-changed Has Details
void content-added Has Details
void content-removed Has Details
void streams-added Has Details
void streams-removed Has Details
void d-tm-fchange-requested Has Details
void local-media-description-changed Has Details
void media-description-offer-done Has Details
void media-descriptions-removed Has Details
void new-media-description-offer Has Details
void remote-media-descriptions-changed Has Details
void bitrate-changed Has Details
void framerate-changed Has Details
void key-frame-requested Has Details
void m-tu-changed Has Details
void video-resolution-changed Has Details
void sending-tones Has Details
void stopped-tones Has Details
void tones-deferred Has Details
void local-sending-state-changed Has Details
void remote-members-changed Has Details
void endpoints-changed Has Details
void i-ce-restart-requested Has Details
void local-candidates-added Has Details
void local-credentials-changed Has Details
void receiving-state-changed Has Details
void relay-info-changed Has Details
void s-tu-nservers-changed Has Details
void sending-state-changed Has Details
void server-info-retrieved Has Details
void candidate-pair-selected Has Details
void controlling-changed Has Details
void endpoint-state-changed Has Details
void remote-candidates-added Has Details
void remote-credentials-set Has Details

Object Hierarchy

    GInterface
    ├── TpSvcCallContent
    ├── TpSvcCallContentInterfaceAudioControl
    ├── TpSvcCallContentInterfaceDTMF
    ├── TpSvcCallContentInterfaceMedia
    ├── TpSvcCallContentInterfaceVideoControl
    ├── TpSvcCallContentMediaDescription
    ├── TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports
    ├── TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback
    ├── TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions
    ├── TpSvcCallStream
    ├── TpSvcCallStreamEndpoint
    ├── TpSvcCallStreamInterfaceMedia
    ╰── TpSvcChannelTypeCall

Known Implementations

TpSvcChannelTypeCall is implemented by TpBaseCallChannel and TpBaseMediaCallChannel.

TpSvcCallContent is implemented by TpBaseCallContent and TpBaseMediaCallContent.

TpSvcCallContentInterfaceMedia is implemented by TpBaseMediaCallContent.

TpSvcCallContentInterfaceDTMF is implemented by TpBaseCallContent and TpBaseMediaCallContent.

TpSvcCallContentMediaDescription is implemented by TpCallContentMediaDescription.

TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports is implemented by TpCallContentMediaDescription.

TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback is implemented by TpCallContentMediaDescription.

TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions is implemented by TpCallContentMediaDescription.

TpSvcCallStream is implemented by TpBaseCallStream and TpBaseMediaCallStream.

TpSvcCallStreamInterfaceMedia is implemented by TpBaseMediaCallStream.

TpSvcCallStreamEndpoint is implemented by TpCallStreamEndpoint.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Call channels represent real-time audio or video streaming, including voice over IP, webcams, and telephony.

Functions

tp_svc_channel_type_call_accept_impl ()

void
(*tp_svc_channel_type_call_accept_impl)
                               (TpSvcChannelTypeCall *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Accept on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_call_add_content_impl ()

void
(*tp_svc_channel_type_call_add_content_impl)
                               (TpSvcChannelTypeCall *self,
                                const gchar *in_Content_Name,
                                guint in_Content_Type,
                                guint in_InitialDirection,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddContent on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

self

The object implementing this interface

 

in_Content_Name

const gchar * (FIXME, generate documentation)

 

in_Content_Type

guint (FIXME, generate documentation)

 

in_InitialDirection

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_call_emit_call_members_changed ()

void
tp_svc_channel_type_call_emit_call_members_changed
                               (gpointer instance,
                                GHashTable *arg_Flags_Changed,
                                GHashTable *arg_Identifiers,
                                const GArray *arg_Removed,
                                const GValueArray *arg_Reason);

Type-safe wrapper around g_signal_emit to emit the CallMembersChanged signal on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

instance

The object implementing this interface

 

arg_Flags_Changed

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

tp_svc_channel_type_call_emit_call_state_changed ()

void
tp_svc_channel_type_call_emit_call_state_changed
                               (gpointer instance,
                                guint arg_Call_State,
                                guint arg_Call_Flags,
                                const GValueArray *arg_Call_State_Reason,
                                GHashTable *arg_Call_State_Details);

Type-safe wrapper around g_signal_emit to emit the CallStateChanged signal on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

instance

The object implementing this interface

 

arg_Call_State

guint (FIXME, generate documentation)

 

arg_Call_Flags

guint (FIXME, generate documentation)

 

arg_Call_State_Reason

const GValueArray * (FIXME, generate documentation)

 

arg_Call_State_Details

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_type_call_emit_content_added ()

void
tp_svc_channel_type_call_emit_content_added
                               (gpointer instance,
                                const gchar *arg_Content);

Type-safe wrapper around g_signal_emit to emit the ContentAdded signal on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

instance

The object implementing this interface

 

arg_Content

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_call_emit_content_removed ()

void
tp_svc_channel_type_call_emit_content_removed
                               (gpointer instance,
                                const gchar *arg_Content,
                                const GValueArray *arg_Reason);

Type-safe wrapper around g_signal_emit to emit the ContentRemoved signal on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

instance

The object implementing this interface

 

arg_Content

const gchar * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

tp_svc_channel_type_call_hangup_impl ()

void
(*tp_svc_channel_type_call_hangup_impl)
                               (TpSvcChannelTypeCall *self,
                                guint in_Reason,
                                const gchar *in_Detailed_Hangup_Reason,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Hangup on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

self

The object implementing this interface

 

in_Reason

guint (FIXME, generate documentation)

 

in_Detailed_Hangup_Reason

const gchar * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_call_implement_accept ()

void
tp_svc_channel_type_call_implement_accept
                               (TpSvcChannelTypeCallClass *klass,
                                tp_svc_channel_type_call_accept_impl impl);

Register an implementation for the Accept method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Accept D-Bus method

 

tp_svc_channel_type_call_implement_add_content ()

void
tp_svc_channel_type_call_implement_add_content
                               (TpSvcChannelTypeCallClass *klass,
                                tp_svc_channel_type_call_add_content_impl impl);

Register an implementation for the AddContent method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddContent D-Bus method

 

tp_svc_channel_type_call_implement_hangup ()

void
tp_svc_channel_type_call_implement_hangup
                               (TpSvcChannelTypeCallClass *klass,
                                tp_svc_channel_type_call_hangup_impl impl);

Register an implementation for the Hangup method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Hangup D-Bus method

 

tp_svc_channel_type_call_implement_set_queued ()

void
tp_svc_channel_type_call_implement_set_queued
                               (TpSvcChannelTypeCallClass *klass,
                                tp_svc_channel_type_call_set_queued_impl impl);

Register an implementation for the SetQueued method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetQueued D-Bus method

 

tp_svc_channel_type_call_implement_set_ringing ()

void
tp_svc_channel_type_call_implement_set_ringing
                               (TpSvcChannelTypeCallClass *klass,
                                tp_svc_channel_type_call_set_ringing_impl impl);

Register an implementation for the SetRinging method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetRinging D-Bus method

 

tp_svc_channel_type_call_return_from_accept ()

void
tp_svc_channel_type_call_return_from_accept
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_call_return_from_add_content ()

void
tp_svc_channel_type_call_return_from_add_content
                               (DBusGMethodInvocation *context,
                                const gchar *out_Content);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Content

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_call_return_from_hangup ()

void
tp_svc_channel_type_call_return_from_hangup
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_call_return_from_set_queued ()

void
tp_svc_channel_type_call_return_from_set_queued
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_call_return_from_set_ringing ()

void
tp_svc_channel_type_call_return_from_set_ringing
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_call_set_queued_impl ()

void
(*tp_svc_channel_type_call_set_queued_impl)
                               (TpSvcChannelTypeCall *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetQueued on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_call_set_ringing_impl ()

void
(*tp_svc_channel_type_call_set_ringing_impl)
                               (TpSvcChannelTypeCall *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetRinging on interface org.freedesktop.Telepathy.Channel.Type.Call1.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_call_content_emit_streams_added ()

void
tp_svc_call_content_emit_streams_added
                               (gpointer instance,
                                const GPtrArray *arg_Streams);

Type-safe wrapper around g_signal_emit to emit the StreamsAdded signal on interface org.freedesktop.Telepathy.Call1.Content.

Parameters

instance

The object implementing this interface

 

arg_Streams

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_content_emit_streams_removed ()

void
tp_svc_call_content_emit_streams_removed
                               (gpointer instance,
                                const GPtrArray *arg_Streams,
                                const GValueArray *arg_Reason);

Type-safe wrapper around g_signal_emit to emit the StreamsRemoved signal on interface org.freedesktop.Telepathy.Call1.Content.

Parameters

instance

The object implementing this interface

 

arg_Streams

const GPtrArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

tp_svc_call_content_implement_remove ()

void
tp_svc_call_content_implement_remove (TpSvcCallContentClass *klass,
                                      tp_svc_call_content_remove_impl impl);

Register an implementation for the Remove method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Remove D-Bus method

 

tp_svc_call_content_remove_impl ()

void
(*tp_svc_call_content_remove_impl) (TpSvcCallContent *self,
                                    DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Remove on interface org.freedesktop.Telepathy.Call1.Content.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_call_content_return_from_remove ()

void
tp_svc_call_content_return_from_remove
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_media_acknowledge_dtmf_change_impl ()

void
(*tp_svc_call_content_interface_media_acknowledge_dtmf_change_impl)
                               (TpSvcCallContentInterfaceMedia *self,
                                guchar in_Event,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcknowledgeDTMFChange on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Event

guchar (FIXME, generate documentation)

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_media_emit_dtmf_change_requested ()

void
tp_svc_call_content_interface_media_emit_dtmf_change_requested
                               (gpointer instance,
                                guchar arg_Event,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the DTMFChangeRequested signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Event

guchar (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_call_content_interface_media_emit_local_media_description_changed ()

void
tp_svc_call_content_interface_media_emit_local_media_description_changed
                               (gpointer instance,
                                GHashTable *arg_Updated_Media_Description);

Type-safe wrapper around g_signal_emit to emit the LocalMediaDescriptionChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Updated_Media_Description

GHashTable * (FIXME, generate documentation)

 

tp_svc_call_content_interface_media_emit_media_description_offer_done ()

void
tp_svc_call_content_interface_media_emit_media_description_offer_done
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the MediaDescriptionOfferDone signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

tp_svc_call_content_interface_media_emit_media_descriptions_removed ()

void
tp_svc_call_content_interface_media_emit_media_descriptions_removed
                               (gpointer instance,
                                const GArray *arg_Removed_Media_Descriptions);

Type-safe wrapper around g_signal_emit to emit the MediaDescriptionsRemoved signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Removed_Media_Descriptions

const GArray * (FIXME, generate documentation)

 

tp_svc_call_content_interface_media_emit_new_media_description_offer ()

void
tp_svc_call_content_interface_media_emit_new_media_description_offer
                               (gpointer instance,
                                const gchar *arg_Media_Description,
                                GHashTable *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the NewMediaDescriptionOffer signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Media_Description

const gchar * (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed ()

void
tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed
                               (gpointer instance,
                                GHashTable *arg_Updated_Media_Descriptions);

Type-safe wrapper around g_signal_emit to emit the RemoteMediaDescriptionsChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Updated_Media_Descriptions

GHashTable * (FIXME, generate documentation)

 

tp_svc_call_content_interface_media_fail_impl ()

void
(*tp_svc_call_content_interface_media_fail_impl)
                               (TpSvcCallContentInterfaceMedia *self,
                                const GValueArray *in_Reason,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Fail on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Reason

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_media_implement_acknowledge_dtmf_change ()

void
tp_svc_call_content_interface_media_implement_acknowledge_dtmf_change
                               (TpSvcCallContentInterfaceMediaClass *klass,
                                tp_svc_call_content_interface_media_acknowledge_dtmf_change_impl impl);

Register an implementation for the AcknowledgeDTMFChange method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcknowledgeDTMFChange D-Bus method

 

tp_svc_call_content_interface_media_implement_fail ()

void
tp_svc_call_content_interface_media_implement_fail
                               (TpSvcCallContentInterfaceMediaClass *klass,
                                tp_svc_call_content_interface_media_fail_impl impl);

Register an implementation for the Fail method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Fail D-Bus method

 

tp_svc_call_content_interface_media_implement_update_local_media_description ()

void
tp_svc_call_content_interface_media_implement_update_local_media_description
                               (TpSvcCallContentInterfaceMediaClass *klass,
                                tp_svc_call_content_interface_media_update_local_media_description_impl impl);

Register an implementation for the UpdateLocalMediaDescription method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UpdateLocalMediaDescription D-Bus method

 

tp_svc_call_content_interface_media_return_from_acknowledge_dtmf_change ()

void
tp_svc_call_content_interface_media_return_from_acknowledge_dtmf_change
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_media_return_from_fail ()

void
tp_svc_call_content_interface_media_return_from_fail
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_media_return_from_update_local_media_description ()

void
tp_svc_call_content_interface_media_return_from_update_local_media_description
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_media_update_local_media_description_impl ()

void
(*tp_svc_call_content_interface_media_update_local_media_description_impl)
                               (TpSvcCallContentInterfaceMedia *self,
                                GHashTable *in_MediaDescription,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UpdateLocalMediaDescription on interface org.freedesktop.Telepathy.Call1.Content.Interface.Media.

Parameters

self

The object implementing this interface

 

in_MediaDescription

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_video_control_emit_bitrate_changed ()

void
tp_svc_call_content_interface_video_control_emit_bitrate_changed
                               (gpointer instance,
                                guint arg_NewBitrate);

Type-safe wrapper around g_signal_emit to emit the BitrateChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.

Parameters

instance

The object implementing this interface

 

arg_NewBitrate

guint (FIXME, generate documentation)

 

tp_svc_call_content_interface_video_control_emit_framerate_changed ()

void
tp_svc_call_content_interface_video_control_emit_framerate_changed
                               (gpointer instance,
                                guint arg_NewFramerate);

Type-safe wrapper around g_signal_emit to emit the FramerateChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.

Parameters

instance

The object implementing this interface

 

arg_NewFramerate

guint (FIXME, generate documentation)

 

tp_svc_call_content_interface_video_control_emit_key_frame_requested ()

void
tp_svc_call_content_interface_video_control_emit_key_frame_requested
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the KeyFrameRequested signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.

Parameters

instance

The object implementing this interface

 

tp_svc_call_content_interface_video_control_emit_mtu_changed ()

void
tp_svc_call_content_interface_video_control_emit_mtu_changed
                               (gpointer instance,
                                guint arg_NewMTU);

Type-safe wrapper around g_signal_emit to emit the MTUChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.

Parameters

instance

The object implementing this interface

 

arg_NewMTU

guint (FIXME, generate documentation)

 

tp_svc_call_content_interface_video_control_emit_video_resolution_changed ()

void
tp_svc_call_content_interface_video_control_emit_video_resolution_changed
                               (gpointer instance,
                                const GValueArray *arg_NewResolution);

Type-safe wrapper around g_signal_emit to emit the VideoResolutionChanged signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.VideoControl.

Parameters

instance

The object implementing this interface

 

arg_NewResolution

const GValueArray * (FIXME, generate documentation)

 

tp_svc_call_content_interface_audio_control_implement_report_input_volume ()

void
tp_svc_call_content_interface_audio_control_implement_report_input_volume
                               (TpSvcCallContentInterfaceAudioControlClass *klass,
                                tp_svc_call_content_interface_audio_control_report_input_volume_impl impl);

Register an implementation for the ReportInputVolume method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ReportInputVolume D-Bus method

 

tp_svc_call_content_interface_audio_control_implement_report_output_volume ()

void
tp_svc_call_content_interface_audio_control_implement_report_output_volume
                               (TpSvcCallContentInterfaceAudioControlClass *klass,
                                tp_svc_call_content_interface_audio_control_report_output_volume_impl impl);

Register an implementation for the ReportOutputVolume method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ReportOutputVolume D-Bus method

 

tp_svc_call_content_interface_audio_control_report_input_volume_impl ()

void
(*tp_svc_call_content_interface_audio_control_report_input_volume_impl)
                               (TpSvcCallContentInterfaceAudioControl *self,
                                gint in_Volume,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ReportInputVolume on interface org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl.

Parameters

self

The object implementing this interface

 

in_Volume

gint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_audio_control_report_output_volume_impl ()

void
(*tp_svc_call_content_interface_audio_control_report_output_volume_impl)
                               (TpSvcCallContentInterfaceAudioControl *self,
                                gint in_Volume,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ReportOutputVolume on interface org.freedesktop.Telepathy.Call1.Content.Interface.AudioControl.

Parameters

self

The object implementing this interface

 

in_Volume

gint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_audio_control_return_from_report_input_volume ()

void
tp_svc_call_content_interface_audio_control_return_from_report_input_volume
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_audio_control_return_from_report_output_volume ()

void
tp_svc_call_content_interface_audio_control_return_from_report_output_volume
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_dtmf_emit_sending_tones ()

void
tp_svc_call_content_interface_dtmf_emit_sending_tones
                               (gpointer instance,
                                const gchar *arg_Tones);

Type-safe wrapper around g_signal_emit to emit the SendingTones signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

tp_svc_call_content_interface_dtmf_emit_stopped_tones ()

void
tp_svc_call_content_interface_dtmf_emit_stopped_tones
                               (gpointer instance,
                                gboolean arg_Cancelled);

Type-safe wrapper around g_signal_emit to emit the StoppedTones signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Cancelled

gboolean (FIXME, generate documentation)

 

tp_svc_call_content_interface_dtmf_emit_tones_deferred ()

void
tp_svc_call_content_interface_dtmf_emit_tones_deferred
                               (gpointer instance,
                                const gchar *arg_Tones);

Type-safe wrapper around g_signal_emit to emit the TonesDeferred signal on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

tp_svc_call_content_interface_dtmf_implement_multiple_tones ()

void
tp_svc_call_content_interface_dtmf_implement_multiple_tones
                               (TpSvcCallContentInterfaceDTMFClass *klass,
                                tp_svc_call_content_interface_dtmf_multiple_tones_impl impl);

Register an implementation for the MultipleTones method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the MultipleTones D-Bus method

 

tp_svc_call_content_interface_dtmf_implement_start_tone ()

void
tp_svc_call_content_interface_dtmf_implement_start_tone
                               (TpSvcCallContentInterfaceDTMFClass *klass,
                                tp_svc_call_content_interface_dtmf_start_tone_impl impl);

Register an implementation for the StartTone method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StartTone D-Bus method

 

tp_svc_call_content_interface_dtmf_implement_stop_tone ()

void
tp_svc_call_content_interface_dtmf_implement_stop_tone
                               (TpSvcCallContentInterfaceDTMFClass *klass,
                                tp_svc_call_content_interface_dtmf_stop_tone_impl impl);

Register an implementation for the StopTone method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StopTone D-Bus method

 

tp_svc_call_content_interface_dtmf_multiple_tones_impl ()

void
(*tp_svc_call_content_interface_dtmf_multiple_tones_impl)
                               (TpSvcCallContentInterfaceDTMF *self,
                                const gchar *in_Tones,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method MultipleTones on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

self

The object implementing this interface

 

in_Tones

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_dtmf_return_from_multiple_tones ()

void
tp_svc_call_content_interface_dtmf_return_from_multiple_tones
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_dtmf_return_from_start_tone ()

void
tp_svc_call_content_interface_dtmf_return_from_start_tone
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_dtmf_return_from_stop_tone ()

void
tp_svc_call_content_interface_dtmf_return_from_stop_tone
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_interface_dtmf_start_tone_impl ()

void
(*tp_svc_call_content_interface_dtmf_start_tone_impl)
                               (TpSvcCallContentInterfaceDTMF *self,
                                guchar in_Event,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StartTone on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

self

The object implementing this interface

 

in_Event

guchar (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_interface_dtmf_stop_tone_impl ()

void
(*tp_svc_call_content_interface_dtmf_stop_tone_impl)
                               (TpSvcCallContentInterfaceDTMF *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StopTone on interface org.freedesktop.Telepathy.Call1.Content.Interface.DTMF.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_call_content_media_description_accept_impl ()

void
(*tp_svc_call_content_media_description_accept_impl)
                               (TpSvcCallContentMediaDescription *self,
                                GHashTable *in_Local_Media_Description,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Accept on interface org.freedesktop.Telepathy.Call1.Content.MediaDescription.

Parameters

self

The object implementing this interface

 

in_Local_Media_Description

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_content_media_description_implement_accept ()

void
tp_svc_call_content_media_description_implement_accept
                               (TpSvcCallContentMediaDescriptionClass *klass,
                                tp_svc_call_content_media_description_accept_impl impl);

Register an implementation for the Accept method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Accept D-Bus method

 

tp_svc_call_content_media_description_implement_reject ()

void
tp_svc_call_content_media_description_implement_reject
                               (TpSvcCallContentMediaDescriptionClass *klass,
                                tp_svc_call_content_media_description_reject_impl impl);

Register an implementation for the Reject method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Reject D-Bus method

 

tp_svc_call_content_media_description_return_from_accept ()

void
tp_svc_call_content_media_description_return_from_accept
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_media_description_return_from_reject ()

void
tp_svc_call_content_media_description_return_from_reject
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_content_media_description_reject_impl ()

void
(*tp_svc_call_content_media_description_reject_impl)
                               (TpSvcCallContentMediaDescription *self,
                                const GValueArray *in_Reason,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Reject on interface org.freedesktop.Telepathy.Call1.Content.MediaDescription.

Parameters

self

The object implementing this interface

 

in_Reason

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_implement_request_receiving ()

void
tp_svc_call_stream_implement_request_receiving
                               (TpSvcCallStreamClass *klass,
                                tp_svc_call_stream_request_receiving_impl impl);

Register an implementation for the RequestReceiving method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestReceiving D-Bus method

 

tp_svc_call_stream_implement_set_sending ()

void
tp_svc_call_stream_implement_set_sending
                               (TpSvcCallStreamClass *klass,
                                tp_svc_call_stream_set_sending_impl impl);

Register an implementation for the SetSending method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetSending D-Bus method

 

tp_svc_call_stream_emit_local_sending_state_changed ()

void
tp_svc_call_stream_emit_local_sending_state_changed
                               (gpointer instance,
                                guint arg_State,
                                const GValueArray *arg_Reason);

Type-safe wrapper around g_signal_emit to emit the LocalSendingStateChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

tp_svc_call_stream_emit_remote_members_changed ()

void
tp_svc_call_stream_emit_remote_members_changed
                               (gpointer instance,
                                GHashTable *arg_Updates,
                                GHashTable *arg_Identifiers,
                                const GArray *arg_Removed,
                                const GValueArray *arg_Reason);

Type-safe wrapper around g_signal_emit to emit the RemoteMembersChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.

Parameters

instance

The object implementing this interface

 

arg_Updates

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

tp_svc_call_stream_request_receiving_impl ()

void
(*tp_svc_call_stream_request_receiving_impl)
                               (TpSvcCallStream *self,
                                guint in_Contact,
                                gboolean in_Receive,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestReceiving on interface org.freedesktop.Telepathy.Call1.Stream.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

in_Receive

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_return_from_request_receiving ()

void
tp_svc_call_stream_return_from_request_receiving
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_return_from_set_sending ()

void
tp_svc_call_stream_return_from_set_sending
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_set_sending_impl ()

void
(*tp_svc_call_stream_set_sending_impl)
                               (TpSvcCallStream *self,
                                gboolean in_Send,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetSending on interface org.freedesktop.Telepathy.Call1.Stream.

Parameters

self

The object implementing this interface

 

in_Send

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_add_candidates_impl ()

void
(*tp_svc_call_stream_interface_media_add_candidates_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                const GPtrArray *in_Candidates,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddCandidates on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Candidates

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_complete_receiving_state_change_impl ()

void
(*tp_svc_call_stream_interface_media_complete_receiving_state_change_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CompleteReceivingStateChange on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_complete_sending_state_change_impl ()

void
(*tp_svc_call_stream_interface_media_complete_sending_state_change_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CompleteSendingStateChange on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_emit_endpoints_changed ()

void
tp_svc_call_stream_interface_media_emit_endpoints_changed
                               (gpointer instance,
                                const GPtrArray *arg_Endpoints_Added,
                                const GPtrArray *arg_Endpoints_Removed);

Type-safe wrapper around g_signal_emit to emit the EndpointsChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Endpoints_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Endpoints_Removed

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_ice_restart_requested ()

void
tp_svc_call_stream_interface_media_emit_ice_restart_requested
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the ICERestartRequested signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

tp_svc_call_stream_interface_media_emit_local_candidates_added ()

void
tp_svc_call_stream_interface_media_emit_local_candidates_added
                               (gpointer instance,
                                const GPtrArray *arg_Candidates);

Type-safe wrapper around g_signal_emit to emit the LocalCandidatesAdded signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Candidates

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_local_credentials_changed ()

void
tp_svc_call_stream_interface_media_emit_local_credentials_changed
                               (gpointer instance,
                                const gchar *arg_Username,
                                const gchar *arg_Password);

Type-safe wrapper around g_signal_emit to emit the LocalCredentialsChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Username

const gchar * (FIXME, generate documentation)

 

arg_Password

const gchar * (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_receiving_state_changed ()

void
tp_svc_call_stream_interface_media_emit_receiving_state_changed
                               (gpointer instance,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the ReceivingStateChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_relay_info_changed ()

void
tp_svc_call_stream_interface_media_emit_relay_info_changed
                               (gpointer instance,
                                const GPtrArray *arg_Relay_Info);

Type-safe wrapper around g_signal_emit to emit the RelayInfoChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Relay_Info

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_sending_state_changed ()

void
tp_svc_call_stream_interface_media_emit_sending_state_changed
                               (gpointer instance,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the SendingStateChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_emit_server_info_retrieved ()

void
tp_svc_call_stream_interface_media_emit_server_info_retrieved
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the ServerInfoRetrieved signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

tp_svc_call_stream_interface_media_emit_stun_servers_changed ()

void
tp_svc_call_stream_interface_media_emit_stun_servers_changed
                               (gpointer instance,
                                const GPtrArray *arg_Servers);

Type-safe wrapper around g_signal_emit to emit the STUNServersChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

instance

The object implementing this interface

 

arg_Servers

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_stream_interface_media_fail_impl ()

void
(*tp_svc_call_stream_interface_media_fail_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                const GValueArray *in_Reason,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Fail on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Reason

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_finish_initial_candidates_impl ()

void
(*tp_svc_call_stream_interface_media_finish_initial_candidates_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method FinishInitialCandidates on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_implement_add_candidates ()

void
tp_svc_call_stream_interface_media_implement_add_candidates
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_add_candidates_impl impl);

Register an implementation for the AddCandidates method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddCandidates D-Bus method

 

tp_svc_call_stream_interface_media_implement_complete_receiving_state_change ()

void
tp_svc_call_stream_interface_media_implement_complete_receiving_state_change
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_complete_receiving_state_change_impl impl);

Register an implementation for the CompleteReceivingStateChange method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CompleteReceivingStateChange D-Bus method

 

tp_svc_call_stream_interface_media_implement_complete_sending_state_change ()

void
tp_svc_call_stream_interface_media_implement_complete_sending_state_change
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_complete_sending_state_change_impl impl);

Register an implementation for the CompleteSendingStateChange method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CompleteSendingStateChange D-Bus method

 

tp_svc_call_stream_interface_media_implement_fail ()

void
tp_svc_call_stream_interface_media_implement_fail
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_fail_impl impl);

Register an implementation for the Fail method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Fail D-Bus method

 

tp_svc_call_stream_interface_media_implement_finish_initial_candidates ()

void
tp_svc_call_stream_interface_media_implement_finish_initial_candidates
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_finish_initial_candidates_impl impl);

Register an implementation for the FinishInitialCandidates method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the FinishInitialCandidates D-Bus method

 

tp_svc_call_stream_interface_media_implement_report_receiving_failure ()

void
tp_svc_call_stream_interface_media_implement_report_receiving_failure
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_report_receiving_failure_impl impl);

Register an implementation for the ReportReceivingFailure method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ReportReceivingFailure D-Bus method

 

tp_svc_call_stream_interface_media_implement_report_sending_failure ()

void
tp_svc_call_stream_interface_media_implement_report_sending_failure
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_report_sending_failure_impl impl);

Register an implementation for the ReportSendingFailure method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ReportSendingFailure D-Bus method

 

tp_svc_call_stream_interface_media_implement_set_credentials ()

void
tp_svc_call_stream_interface_media_implement_set_credentials
                               (TpSvcCallStreamInterfaceMediaClass *klass,
                                tp_svc_call_stream_interface_media_set_credentials_impl impl);

Register an implementation for the SetCredentials method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetCredentials D-Bus method

 

tp_svc_call_stream_interface_media_report_receiving_failure_impl ()

void
(*tp_svc_call_stream_interface_media_report_receiving_failure_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                guint in_Reason,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ReportReceivingFailure on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Reason

guint (FIXME, generate documentation)

 

in_Error

const gchar * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_report_sending_failure_impl ()

void
(*tp_svc_call_stream_interface_media_report_sending_failure_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                guint in_Reason,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ReportSendingFailure on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Reason

guint (FIXME, generate documentation)

 

in_Error

const gchar * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_interface_media_return_from_add_candidates ()

void
tp_svc_call_stream_interface_media_return_from_add_candidates
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_complete_receiving_state_change ()

void
tp_svc_call_stream_interface_media_return_from_complete_receiving_state_change
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_complete_sending_state_change ()

void
tp_svc_call_stream_interface_media_return_from_complete_sending_state_change
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_fail ()

void
tp_svc_call_stream_interface_media_return_from_fail
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_finish_initial_candidates ()

void
tp_svc_call_stream_interface_media_return_from_finish_initial_candidates
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_report_receiving_failure ()

void
tp_svc_call_stream_interface_media_return_from_report_receiving_failure
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_report_sending_failure ()

void
tp_svc_call_stream_interface_media_return_from_report_sending_failure
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_return_from_set_credentials ()

void
tp_svc_call_stream_interface_media_return_from_set_credentials
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_interface_media_set_credentials_impl ()

void
(*tp_svc_call_stream_interface_media_set_credentials_impl)
                               (TpSvcCallStreamInterfaceMedia *self,
                                const gchar *in_Username,
                                const gchar *in_Password,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetCredentials on interface org.freedesktop.Telepathy.Call1.Stream.Interface.Media.

Parameters

self

The object implementing this interface

 

in_Username

const gchar * (FIXME, generate documentation)

 

in_Password

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_endpoint_accept_selected_candidate_pair_impl ()

void
(*tp_svc_call_stream_endpoint_accept_selected_candidate_pair_impl)
                               (TpSvcCallStreamEndpoint *self,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcceptSelectedCandidatePair on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

self

The object implementing this interface

 

in_Local_Candidate

const GValueArray * (FIXME, generate documentation)

 

in_Remote_Candidate

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_endpoint_emit_candidate_pair_selected ()

void
tp_svc_call_stream_endpoint_emit_candidate_pair_selected
                               (gpointer instance,
                                const GValueArray *arg_Local_Candidate,
                                const GValueArray *arg_Remote_Candidate);

Type-safe wrapper around g_signal_emit to emit the CandidatePairSelected signal on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

instance

The object implementing this interface

 

arg_Local_Candidate

const GValueArray * (FIXME, generate documentation)

 

arg_Remote_Candidate

const GValueArray * (FIXME, generate documentation)

 

tp_svc_call_stream_endpoint_emit_controlling_changed ()

void
tp_svc_call_stream_endpoint_emit_controlling_changed
                               (gpointer instance,
                                gboolean arg_Controlling);

Type-safe wrapper around g_signal_emit to emit the ControllingChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

instance

The object implementing this interface

 

arg_Controlling

gboolean (FIXME, generate documentation)

 

tp_svc_call_stream_endpoint_emit_endpoint_state_changed ()

void
tp_svc_call_stream_endpoint_emit_endpoint_state_changed
                               (gpointer instance,
                                guint arg_Component,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the EndpointStateChanged signal on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

instance

The object implementing this interface

 

arg_Component

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_call_stream_endpoint_emit_remote_candidates_added ()

void
tp_svc_call_stream_endpoint_emit_remote_candidates_added
                               (gpointer instance,
                                const GPtrArray *arg_Candidates);

Type-safe wrapper around g_signal_emit to emit the RemoteCandidatesAdded signal on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

instance

The object implementing this interface

 

arg_Candidates

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_call_stream_endpoint_emit_remote_credentials_set ()

void
tp_svc_call_stream_endpoint_emit_remote_credentials_set
                               (gpointer instance,
                                const gchar *arg_Username,
                                const gchar *arg_Password);

Type-safe wrapper around g_signal_emit to emit the RemoteCredentialsSet signal on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

instance

The object implementing this interface

 

arg_Username

const gchar * (FIXME, generate documentation)

 

arg_Password

const gchar * (FIXME, generate documentation)

 

tp_svc_call_stream_endpoint_implement_accept_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_implement_accept_selected_candidate_pair
                               (TpSvcCallStreamEndpointClass *klass,
                                tp_svc_call_stream_endpoint_accept_selected_candidate_pair_impl impl);

Register an implementation for the AcceptSelectedCandidatePair method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcceptSelectedCandidatePair D-Bus method

 

tp_svc_call_stream_endpoint_implement_reject_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_implement_reject_selected_candidate_pair
                               (TpSvcCallStreamEndpointClass *klass,
                                tp_svc_call_stream_endpoint_reject_selected_candidate_pair_impl impl);

Register an implementation for the RejectSelectedCandidatePair method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RejectSelectedCandidatePair D-Bus method

 

tp_svc_call_stream_endpoint_implement_set_controlling ()

void
tp_svc_call_stream_endpoint_implement_set_controlling
                               (TpSvcCallStreamEndpointClass *klass,
                                tp_svc_call_stream_endpoint_set_controlling_impl impl);

Register an implementation for the SetControlling method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetControlling D-Bus method

 

tp_svc_call_stream_endpoint_implement_set_endpoint_state ()

void
tp_svc_call_stream_endpoint_implement_set_endpoint_state
                               (TpSvcCallStreamEndpointClass *klass,
                                tp_svc_call_stream_endpoint_set_endpoint_state_impl impl);

Register an implementation for the SetEndpointState method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetEndpointState D-Bus method

 

tp_svc_call_stream_endpoint_implement_set_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_implement_set_selected_candidate_pair
                               (TpSvcCallStreamEndpointClass *klass,
                                tp_svc_call_stream_endpoint_set_selected_candidate_pair_impl impl);

Register an implementation for the SetSelectedCandidatePair method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetSelectedCandidatePair D-Bus method

 

tp_svc_call_stream_endpoint_reject_selected_candidate_pair_impl ()

void
(*tp_svc_call_stream_endpoint_reject_selected_candidate_pair_impl)
                               (TpSvcCallStreamEndpoint *self,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RejectSelectedCandidatePair on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

self

The object implementing this interface

 

in_Local_Candidate

const GValueArray * (FIXME, generate documentation)

 

in_Remote_Candidate

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_endpoint_return_from_accept_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_return_from_accept_selected_candidate_pair
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_endpoint_return_from_reject_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_return_from_reject_selected_candidate_pair
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_endpoint_return_from_set_controlling ()

void
tp_svc_call_stream_endpoint_return_from_set_controlling
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_endpoint_return_from_set_endpoint_state ()

void
tp_svc_call_stream_endpoint_return_from_set_endpoint_state
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_endpoint_return_from_set_selected_candidate_pair ()

void
tp_svc_call_stream_endpoint_return_from_set_selected_candidate_pair
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_call_stream_endpoint_set_controlling_impl ()

void
(*tp_svc_call_stream_endpoint_set_controlling_impl)
                               (TpSvcCallStreamEndpoint *self,
                                gboolean in_Controlling,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetControlling on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

self

The object implementing this interface

 

in_Controlling

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_endpoint_set_endpoint_state_impl ()

void
(*tp_svc_call_stream_endpoint_set_endpoint_state_impl)
                               (TpSvcCallStreamEndpoint *self,
                                guint in_Component,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetEndpointState on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

self

The object implementing this interface

 

in_Component

guint (FIXME, generate documentation)

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_call_stream_endpoint_set_selected_candidate_pair_impl ()

void
(*tp_svc_call_stream_endpoint_set_selected_candidate_pair_impl)
                               (TpSvcCallStreamEndpoint *self,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetSelectedCandidatePair on interface org.freedesktop.Telepathy.Call1.Stream.Endpoint.

Parameters

self

The object implementing this interface

 

in_Local_Candidate

const GValueArray * (FIXME, generate documentation)

 

in_Remote_Candidate

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

Types and Values

TpSvcChannelTypeCall

typedef struct _TpSvcChannelTypeCall TpSvcChannelTypeCall;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeCallClass

typedef struct _TpSvcChannelTypeCallClass TpSvcChannelTypeCallClass;

The class of TpSvcChannelTypeCall.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_call (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_call_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_ringing);
  IMPLEMENT (set_queued);
  IMPLEMENT (accept);
  IMPLEMENT (hangup);
  IMPLEMENT (add_content);
#undef IMPLEMENT
}

TpSvcCallContent

typedef struct _TpSvcCallContent TpSvcCallContent;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentClass

typedef struct _TpSvcCallContentClass TpSvcCallContentClass;

The class of TpSvcCallContent.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_content (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_content_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (remove);
#undef IMPLEMENT
}

TpSvcCallContentInterfaceMedia

typedef struct _TpSvcCallContentInterfaceMedia TpSvcCallContentInterfaceMedia;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentInterfaceMediaClass

typedef struct _TpSvcCallContentInterfaceMediaClass TpSvcCallContentInterfaceMediaClass;

The class of TpSvcCallContentInterfaceMedia.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_content_interface_media (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_content_interface_media_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (update_local_media_description);
  IMPLEMENT (acknowledge_dtmf_change);
  IMPLEMENT (fail);
#undef IMPLEMENT
}

TpSvcCallContentInterfaceVideoControl

typedef struct _TpSvcCallContentInterfaceVideoControl TpSvcCallContentInterfaceVideoControl;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentInterfaceVideoControlClass

typedef struct _TpSvcCallContentInterfaceVideoControlClass TpSvcCallContentInterfaceVideoControlClass;

The class of TpSvcCallContentInterfaceVideoControl. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcCallContentInterfaceAudioControl

typedef struct _TpSvcCallContentInterfaceAudioControl TpSvcCallContentInterfaceAudioControl;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentInterfaceAudioControlClass

typedef struct _TpSvcCallContentInterfaceAudioControlClass TpSvcCallContentInterfaceAudioControlClass;

The class of TpSvcCallContentInterfaceAudioControl.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_content_interface_audio_control (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_content_interface_audio_control_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (report_input_volume);
  IMPLEMENT (report_output_volume);
#undef IMPLEMENT
}

TpSvcCallContentInterfaceDTMF

typedef struct _TpSvcCallContentInterfaceDTMF TpSvcCallContentInterfaceDTMF;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentInterfaceDTMFClass

typedef struct _TpSvcCallContentInterfaceDTMFClass TpSvcCallContentInterfaceDTMFClass;

The class of TpSvcCallContentInterfaceDTMF.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_content_interface_dtmf (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_content_interface_dtmf_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (start_tone);
  IMPLEMENT (stop_tone);
  IMPLEMENT (multiple_tones);
#undef IMPLEMENT
}

TpSvcCallContentMediaDescription

typedef struct _TpSvcCallContentMediaDescription TpSvcCallContentMediaDescription;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentMediaDescriptionClass

typedef struct _TpSvcCallContentMediaDescriptionClass TpSvcCallContentMediaDescriptionClass;

The class of TpSvcCallContentMediaDescription.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_content_media_description (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_content_media_description_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (accept);
  IMPLEMENT (reject);
#undef IMPLEMENT
}

TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReportsClass

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReportsClass TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReportsClass;

The class of TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentMediaDescriptionInterfaceRTCPFeedbackClass

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTCPFeedbackClass TpSvcCallContentMediaDescriptionInterfaceRTCPFeedbackClass;

The class of TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions;

Dummy typedef representing any implementation of this interface.


TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensionsClass

typedef struct _TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensionsClass TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensionsClass;

The class of TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcCallStream

typedef struct _TpSvcCallStream TpSvcCallStream;

Dummy typedef representing any implementation of this interface.


TpSvcCallStreamClass

typedef struct _TpSvcCallStreamClass TpSvcCallStreamClass;

The class of TpSvcCallStream.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_stream (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_stream_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_sending);
  IMPLEMENT (request_receiving);
#undef IMPLEMENT
}

TpSvcCallStreamInterfaceMedia

typedef struct _TpSvcCallStreamInterfaceMedia TpSvcCallStreamInterfaceMedia;

Dummy typedef representing any implementation of this interface.


TpSvcCallStreamInterfaceMediaClass

typedef struct _TpSvcCallStreamInterfaceMediaClass TpSvcCallStreamInterfaceMediaClass;

The class of TpSvcCallStreamInterfaceMedia.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_stream_interface_media (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_stream_interface_media_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (complete_sending_state_change);
  IMPLEMENT (report_sending_failure);
  IMPLEMENT (complete_receiving_state_change);
  IMPLEMENT (report_receiving_failure);
  IMPLEMENT (set_credentials);
  IMPLEMENT (add_candidates);
  IMPLEMENT (finish_initial_candidates);
  IMPLEMENT (fail);
#undef IMPLEMENT
}

TpSvcCallStreamEndpoint

typedef struct _TpSvcCallStreamEndpoint TpSvcCallStreamEndpoint;

Dummy typedef representing any implementation of this interface.


TpSvcCallStreamEndpointClass

typedef struct _TpSvcCallStreamEndpointClass TpSvcCallStreamEndpointClass;

The class of TpSvcCallStreamEndpoint.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_call_stream_endpoint (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_call_stream_endpoint_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_selected_candidate_pair);
  IMPLEMENT (set_endpoint_state);
  IMPLEMENT (accept_selected_candidate_pair);
  IMPLEMENT (reject_selected_candidate_pair);
  IMPLEMENT (set_controlling);
#undef IMPLEMENT
}

Signal Details

The “call-members-changed” signal

void
user_function (TpSvcChannelTypeCall *self,
               GArray_guint_        *arg_Removed,
               gpointer              user_data)

The CallMembersChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Flags_Changed

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “call-state-changed” signal

void
user_function (TpSvcChannelTypeCall *self,
               guint                 arg_Call_State,
               guint                 arg_Call_Flags,
               gpointer              user_data)

The CallStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Call_State

guint (FIXME, generate documentation)

 

arg_Call_Flags

guint (FIXME, generate documentation)

 

arg_Call_State_Reason

const GValueArray * (FIXME, generate documentation)

 

arg_Call_State_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “content-added” signal

void
user_function (TpSvcChannelTypeCall *self,
               DBusGObjectPath      *arg_Content,
               gpointer              user_data)

The ContentAdded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Content

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “content-removed” signal

void
user_function (TpSvcChannelTypeCall *self,
               DBusGObjectPath      *arg_Content,
               gpointer              user_data)

The ContentRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Content

const gchar * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “streams-added” signal

void
user_function (TpSvcCallContent           *self,
               GPtrArray_DBusGObjectPath_ *arg_Streams,
               gpointer                    user_data)

The StreamsAdded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Streams

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “streams-removed” signal

void
user_function (TpSvcCallContent           *self,
               GPtrArray_DBusGObjectPath_ *arg_Streams,
               gpointer                    user_data)

The StreamsRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Streams

const GPtrArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “d-tm-fchange-requested” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               guchar                          arg_Event,
               guint                           arg_State,
               gpointer                        user_data)

The DTMFChangeRequested D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Event

guchar (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “local-media-description-changed” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               gpointer                        user_data)

The LocalMediaDescriptionChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Updated_Media_Description

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “media-description-offer-done” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               gpointer                        user_data)

The MediaDescriptionOfferDone D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “media-descriptions-removed” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               GArray_guint_                  *arg_Removed_Media_Descriptions,
               gpointer                        user_data)

The MediaDescriptionsRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Removed_Media_Descriptions

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-media-description-offer” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               DBusGObjectPath                *arg_Media_Description,
               gpointer                        user_data)

The NewMediaDescriptionOffer D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Media_Description

const gchar * (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “remote-media-descriptions-changed” signal

void
user_function (TpSvcCallContentInterfaceMedia *self,
               gpointer                        user_data)

The RemoteMediaDescriptionsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Updated_Media_Descriptions

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “bitrate-changed” signal

void
user_function (TpSvcCallContentInterfaceVideoControl *self,
               guint                                  arg_NewBitrate,
               gpointer                               user_data)

The BitrateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_NewBitrate

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “framerate-changed” signal

void
user_function (TpSvcCallContentInterfaceVideoControl *self,
               guint                                  arg_NewFramerate,
               gpointer                               user_data)

The FramerateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_NewFramerate

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “key-frame-requested” signal

void
user_function (TpSvcCallContentInterfaceVideoControl *self,
               gpointer                               user_data)

The KeyFrameRequested D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “m-tu-changed” signal

void
user_function (TpSvcCallContentInterfaceVideoControl *self,
               guint                                  arg_NewMTU,
               gpointer                               user_data)

The MTUChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_NewMTU

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “video-resolution-changed” signal

void
user_function (TpSvcCallContentInterfaceVideoControl *self,
               gpointer                               user_data)

The VideoResolutionChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_NewResolution

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “sending-tones” signal

void
user_function (TpSvcCallContentInterfaceDTMF *self,
               gchar                         *arg_Tones,
               gpointer                       user_data)

The SendingTones D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stopped-tones” signal

void
user_function (TpSvcCallContentInterfaceDTMF *self,
               gboolean                       arg_Cancelled,
               gpointer                       user_data)

The StoppedTones D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Cancelled

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “tones-deferred” signal

void
user_function (TpSvcCallContentInterfaceDTMF *self,
               gchar                         *arg_Tones,
               gpointer                       user_data)

The TonesDeferred D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “local-sending-state-changed” signal

void
user_function (TpSvcCallStream *self,
               guint            arg_State,
               gpointer         user_data)

The LocalSendingStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “remote-members-changed” signal

void
user_function (TpSvcCallStream *self,
               GArray_guint_   *arg_Removed,
               gpointer         user_data)

The RemoteMembersChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Updates

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Reason

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “endpoints-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               GPtrArray_DBusGObjectPath_    *arg_Endpoints_Added,
               GPtrArray_DBusGObjectPath_    *arg_Endpoints_Removed,
               gpointer                       user_data)

The EndpointsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Endpoints_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Endpoints_Removed

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “i-ce-restart-requested” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gpointer                       user_data)

The ICERestartRequested D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “local-candidates-added” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gpointer                       user_data)

The LocalCandidatesAdded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Candidates

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “local-credentials-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gchar                         *arg_Username,
               gchar                         *arg_Password,
               gpointer                       user_data)

The LocalCredentialsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Username

const gchar * (FIXME, generate documentation)

 

arg_Password

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “receiving-state-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               guint                          arg_State,
               gpointer                       user_data)

The ReceivingStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “relay-info-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gpointer                       user_data)

The RelayInfoChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Relay_Info

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “s-tu-nservers-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gpointer                       user_data)

The STUNServersChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Servers

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “sending-state-changed” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               guint                          arg_State,
               gpointer                       user_data)

The SendingStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “server-info-retrieved” signal

void
user_function (TpSvcCallStreamInterfaceMedia *self,
               gpointer                       user_data)

The ServerInfoRetrieved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “candidate-pair-selected” signal

void
user_function (TpSvcCallStreamEndpoint *self,
               gpointer                 user_data)

The CandidatePairSelected D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Local_Candidate

const GValueArray * (FIXME, generate documentation)

 

arg_Remote_Candidate

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “controlling-changed” signal

void
user_function (TpSvcCallStreamEndpoint *self,
               gboolean                 arg_Controlling,
               gpointer                 user_data)

The ControllingChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Controlling

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “endpoint-state-changed” signal

void
user_function (TpSvcCallStreamEndpoint *self,
               guint                    arg_Component,
               guint                    arg_State,
               gpointer                 user_data)

The EndpointStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Component

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “remote-candidates-added” signal

void
user_function (TpSvcCallStreamEndpoint *self,
               gpointer                 user_data)

The RemoteCandidatesAdded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Candidates

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “remote-credentials-set” signal

void
user_function (TpSvcCallStreamEndpoint *self,
               gchar                   *arg_Username,
               gchar                   *arg_Password,
               gpointer                 user_data)

The RemoteCredentialsSet D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Username

const gchar * (FIXME, generate documentation)

 

arg_Password

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-text.html0000644000175000017500000037026614006623344024265 00000000000000 Text channels: telepathy-glib API Reference Manual

Text channels

Text channels — service-side interfaces for the Text channel type, and the Chat State, Password and SMS interfaces

Functions

void (*tp_svc_channel_type_text_acknowledge_pending_messages_impl) ()
void tp_svc_channel_type_text_implement_acknowledge_pending_messages ()
void tp_svc_channel_type_text_return_from_acknowledge_pending_messages ()
void (*tp_svc_channel_type_text_get_message_types_impl) ()
void tp_svc_channel_type_text_implement_get_message_types ()
void tp_svc_channel_type_text_return_from_get_message_types ()
void (*tp_svc_channel_type_text_list_pending_messages_impl) ()
void tp_svc_channel_type_text_implement_list_pending_messages ()
void tp_svc_channel_type_text_return_from_list_pending_messages ()
void (*tp_svc_channel_type_text_send_impl) ()
void tp_svc_channel_type_text_implement_send ()
void tp_svc_channel_type_text_return_from_send ()
void tp_svc_channel_type_text_emit_lost_message ()
void tp_svc_channel_type_text_emit_received ()
void tp_svc_channel_type_text_emit_send_error ()
void tp_svc_channel_type_text_emit_sent ()
void (*tp_svc_channel_interface_chat_state_set_chat_state_impl) ()
void tp_svc_channel_interface_chat_state_implement_set_chat_state ()
void tp_svc_channel_interface_chat_state_return_from_set_chat_state ()
void tp_svc_channel_interface_chat_state_emit_chat_state_changed ()
void tp_svc_channel_interface_messages_emit_message_received ()
void tp_svc_channel_interface_messages_emit_message_sent ()
void tp_svc_channel_interface_messages_emit_pending_messages_removed ()
void (*tp_svc_channel_interface_messages_get_pending_message_content_impl) ()
void tp_svc_channel_interface_messages_implement_get_pending_message_content ()
void tp_svc_channel_interface_messages_implement_send_message ()
void tp_svc_channel_interface_messages_return_from_get_pending_message_content ()
void tp_svc_channel_interface_messages_return_from_send_message ()
void (*tp_svc_channel_interface_messages_send_message_impl) ()
void (*tp_svc_channel_interface_password_get_password_flags_impl) ()
void tp_svc_channel_interface_password_implement_get_password_flags ()
void tp_svc_channel_interface_password_return_from_get_password_flags ()
void (*tp_svc_channel_interface_password_provide_password_impl) ()
void tp_svc_channel_interface_password_implement_provide_password ()
void tp_svc_channel_interface_password_return_from_provide_password ()
void tp_svc_channel_interface_password_emit_password_flags_changed ()
void tp_svc_channel_interface_sms_emit_sms_channel_changed ()
void (*tp_svc_channel_interface_sms_get_sms_length_impl) ()
void tp_svc_channel_interface_sms_implement_get_sms_length ()
void tp_svc_channel_interface_sms_return_from_get_sms_length ()

Signals

void lost-message Has Details
void received Has Details
void send-error Has Details
void sent Has Details
void chat-state-changed Has Details
void message-received Has Details
void message-sent Has Details
void pending-messages-removed Has Details
void password-flags-changed Has Details
void s-ms-channel-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceChatState
    ├── TpSvcChannelInterfaceMessages
    ├── TpSvcChannelInterfacePassword
    ├── TpSvcChannelInterfaceSMS
    ╰── TpSvcChannelTypeText

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A major use for instant messaging is obviously to send messages. Channels of type Text represent conversations or chat rooms using short real-time messages, including SMS.

This section documents the auto-generated GInterfaces used to implement the Text channel type, and some interfaces used in conjunction with it.

Functions

tp_svc_channel_type_text_acknowledge_pending_messages_impl ()

void
(*tp_svc_channel_type_text_acknowledge_pending_messages_impl)
                               (TpSvcChannelTypeText *self,
                                const GArray *in_IDs,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcknowledgePendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

self

The object implementing this interface

 

in_IDs

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_text_implement_acknowledge_pending_messages ()

void
tp_svc_channel_type_text_implement_acknowledge_pending_messages
                               (TpSvcChannelTypeTextClass *klass,
                                tp_svc_channel_type_text_acknowledge_pending_messages_impl impl);

Register an implementation for the AcknowledgePendingMessages method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcknowledgePendingMessages D-Bus method

 

tp_svc_channel_type_text_return_from_acknowledge_pending_messages ()

void
tp_svc_channel_type_text_return_from_acknowledge_pending_messages
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_text_get_message_types_impl ()

void
(*tp_svc_channel_type_text_get_message_types_impl)
                               (TpSvcChannelTypeText *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetMessageTypes on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_text_implement_get_message_types ()

void
tp_svc_channel_type_text_implement_get_message_types
                               (TpSvcChannelTypeTextClass *klass,
                                tp_svc_channel_type_text_get_message_types_impl impl);

Register an implementation for the GetMessageTypes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetMessageTypes D-Bus method

 

tp_svc_channel_type_text_return_from_get_message_types ()

void
tp_svc_channel_type_text_return_from_get_message_types
                               (DBusGMethodInvocation *context,
                                const GArray *out_Available_Types);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Available_Types

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_type_text_list_pending_messages_impl ()

void
(*tp_svc_channel_type_text_list_pending_messages_impl)
                               (TpSvcChannelTypeText *self,
                                gboolean in_Clear,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListPendingMessages on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

self

The object implementing this interface

 

in_Clear

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_text_implement_list_pending_messages ()

void
tp_svc_channel_type_text_implement_list_pending_messages
                               (TpSvcChannelTypeTextClass *klass,
                                tp_svc_channel_type_text_list_pending_messages_impl impl);

Register an implementation for the ListPendingMessages method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListPendingMessages D-Bus method

 

tp_svc_channel_type_text_return_from_list_pending_messages ()

void
tp_svc_channel_type_text_return_from_list_pending_messages
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Pending_Messages);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Pending_Messages

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_text_send_impl ()

void
(*tp_svc_channel_type_text_send_impl) (TpSvcChannelTypeText *self,
                                       guint in_Type,
                                       const gchar *in_Text,
                                       DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Send on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

self

The object implementing this interface

 

in_Type

guint (FIXME, generate documentation)

 

in_Text

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_text_implement_send ()

void
tp_svc_channel_type_text_implement_send
                               (TpSvcChannelTypeTextClass *klass,
                                tp_svc_channel_type_text_send_impl impl);

Register an implementation for the Send method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Send D-Bus method

 

tp_svc_channel_type_text_return_from_send ()

void
tp_svc_channel_type_text_return_from_send
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_text_emit_lost_message ()

void
tp_svc_channel_type_text_emit_lost_message
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the LostMessage signal on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

instance

The object implementing this interface

 

tp_svc_channel_type_text_emit_received ()

void
tp_svc_channel_type_text_emit_received
                               (gpointer instance,
                                guint arg_ID,
                                guint arg_Timestamp,
                                guint arg_Sender,
                                guint arg_Type,
                                guint arg_Flags,
                                const gchar *arg_Text);

Type-safe wrapper around g_signal_emit to emit the Received signal on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Sender

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Flags

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_text_emit_send_error ()

void
tp_svc_channel_type_text_emit_send_error
                               (gpointer instance,
                                guint arg_Error,
                                guint arg_Timestamp,
                                guint arg_Type,
                                const gchar *arg_Text);

Type-safe wrapper around g_signal_emit to emit the SendError signal on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

instance

The object implementing this interface

 

arg_Error

guint (FIXME, generate documentation)

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_text_emit_sent ()

void
tp_svc_channel_type_text_emit_sent (gpointer instance,
                                    guint arg_Timestamp,
                                    guint arg_Type,
                                    const gchar *arg_Text);

Type-safe wrapper around g_signal_emit to emit the Sent signal on interface org.freedesktop.Telepathy.Channel.Type.Text.

Parameters

instance

The object implementing this interface

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_interface_chat_state_set_chat_state_impl ()

void
(*tp_svc_channel_interface_chat_state_set_chat_state_impl)
                               (TpSvcChannelInterfaceChatState *self,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetChatState on interface org.freedesktop.Telepathy.Channel.Interface.ChatState.

Parameters

self

The object implementing this interface

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_chat_state_implement_set_chat_state ()

void
tp_svc_channel_interface_chat_state_implement_set_chat_state
                               (TpSvcChannelInterfaceChatStateClass *klass,
                                tp_svc_channel_interface_chat_state_set_chat_state_impl impl);

Register an implementation for the SetChatState method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetChatState D-Bus method

 

tp_svc_channel_interface_chat_state_return_from_set_chat_state ()

void
tp_svc_channel_interface_chat_state_return_from_set_chat_state
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_chat_state_emit_chat_state_changed ()

void
tp_svc_channel_interface_chat_state_emit_chat_state_changed
                               (gpointer instance,
                                guint arg_Contact,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the ChatStateChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.ChatState.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_emit_message_received ()

void
tp_svc_channel_interface_messages_emit_message_received
                               (gpointer instance,
                                const GPtrArray *arg_Message);

Type-safe wrapper around g_signal_emit to emit the MessageReceived signal on interface org.freedesktop.Telepathy.Channel.Interface.Messages.

Parameters

instance

The object implementing this interface

 

arg_Message

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_emit_message_sent ()

void
tp_svc_channel_interface_messages_emit_message_sent
                               (gpointer instance,
                                const GPtrArray *arg_Content,
                                guint arg_Flags,
                                const gchar *arg_Message_Token);

Type-safe wrapper around g_signal_emit to emit the MessageSent signal on interface org.freedesktop.Telepathy.Channel.Interface.Messages.

Parameters

instance

The object implementing this interface

 

arg_Content

const GPtrArray * (FIXME, generate documentation)

 

arg_Flags

guint (FIXME, generate documentation)

 

arg_Message_Token

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_emit_pending_messages_removed ()

void
tp_svc_channel_interface_messages_emit_pending_messages_removed
                               (gpointer instance,
                                const GArray *arg_Message_IDs);

Type-safe wrapper around g_signal_emit to emit the PendingMessagesRemoved signal on interface org.freedesktop.Telepathy.Channel.Interface.Messages.

Parameters

instance

The object implementing this interface

 

arg_Message_IDs

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_get_pending_message_content_impl ()

void
(*tp_svc_channel_interface_messages_get_pending_message_content_impl)
                               (TpSvcChannelInterfaceMessages *self,
                                guint in_Message_ID,
                                const GArray *in_Parts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetPendingMessageContent on interface org.freedesktop.Telepathy.Channel.Interface.Messages.

Parameters

self

The object implementing this interface

 

in_Message_ID

guint (FIXME, generate documentation)

 

in_Parts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_messages_implement_get_pending_message_content ()

void
tp_svc_channel_interface_messages_implement_get_pending_message_content
                               (TpSvcChannelInterfaceMessagesClass *klass,
                                tp_svc_channel_interface_messages_get_pending_message_content_impl impl);

Register an implementation for the GetPendingMessageContent method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetPendingMessageContent D-Bus method

 

tp_svc_channel_interface_messages_implement_send_message ()

void
tp_svc_channel_interface_messages_implement_send_message
                               (TpSvcChannelInterfaceMessagesClass *klass,
                                tp_svc_channel_interface_messages_send_message_impl impl);

Register an implementation for the SendMessage method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SendMessage D-Bus method

 

tp_svc_channel_interface_messages_return_from_get_pending_message_content ()

void
tp_svc_channel_interface_messages_return_from_get_pending_message_content
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Content);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Content

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_return_from_send_message ()

void
tp_svc_channel_interface_messages_return_from_send_message
                               (DBusGMethodInvocation *context,
                                const gchar *out_Token);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Token

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_interface_messages_send_message_impl ()

void
(*tp_svc_channel_interface_messages_send_message_impl)
                               (TpSvcChannelInterfaceMessages *self,
                                const GPtrArray *in_Message,
                                guint in_Flags,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SendMessage on interface org.freedesktop.Telepathy.Channel.Interface.Messages.

Parameters

self

The object implementing this interface

 

in_Message

const GPtrArray * (FIXME, generate documentation)

 

in_Flags

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_password_get_password_flags_impl ()

void
(*tp_svc_channel_interface_password_get_password_flags_impl)
                               (TpSvcChannelInterfacePassword *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetPasswordFlags on interface org.freedesktop.Telepathy.Channel.Interface.Password.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_password_implement_get_password_flags ()

void
tp_svc_channel_interface_password_implement_get_password_flags
                               (TpSvcChannelInterfacePasswordClass *klass,
                                tp_svc_channel_interface_password_get_password_flags_impl impl);

Register an implementation for the GetPasswordFlags method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetPasswordFlags D-Bus method

 

tp_svc_channel_interface_password_return_from_get_password_flags ()

void
tp_svc_channel_interface_password_return_from_get_password_flags
                               (DBusGMethodInvocation *context,
                                guint out_Password_Flags);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Password_Flags

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_password_provide_password_impl ()

void
(*tp_svc_channel_interface_password_provide_password_impl)
                               (TpSvcChannelInterfacePassword *self,
                                const gchar *in_Password,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ProvidePassword on interface org.freedesktop.Telepathy.Channel.Interface.Password.

Parameters

self

The object implementing this interface

 

in_Password

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_password_implement_provide_password ()

void
tp_svc_channel_interface_password_implement_provide_password
                               (TpSvcChannelInterfacePasswordClass *klass,
                                tp_svc_channel_interface_password_provide_password_impl impl);

Register an implementation for the ProvidePassword method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ProvidePassword D-Bus method

 

tp_svc_channel_interface_password_return_from_provide_password ()

void
tp_svc_channel_interface_password_return_from_provide_password
                               (DBusGMethodInvocation *context,
                                gboolean out_Correct);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Correct

gboolean (FIXME, generate documentation)

 

tp_svc_channel_interface_password_emit_password_flags_changed ()

void
tp_svc_channel_interface_password_emit_password_flags_changed
                               (gpointer instance,
                                guint arg_Added,
                                guint arg_Removed);

Type-safe wrapper around g_signal_emit to emit the PasswordFlagsChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Password.

Parameters

instance

The object implementing this interface

 

arg_Added

guint (FIXME, generate documentation)

 

arg_Removed

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_sms_emit_sms_channel_changed ()

void
tp_svc_channel_interface_sms_emit_sms_channel_changed
                               (gpointer instance,
                                gboolean arg_SMSChannel);

Type-safe wrapper around g_signal_emit to emit the SMSChannelChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.SMS.

Parameters

instance

The object implementing this interface

 

arg_SMSChannel

gboolean (FIXME, generate documentation)

 

tp_svc_channel_interface_sms_get_sms_length_impl ()

void
(*tp_svc_channel_interface_sms_get_sms_length_impl)
                               (TpSvcChannelInterfaceSMS *self,
                                const GPtrArray *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetSMSLength on interface org.freedesktop.Telepathy.Channel.Interface.SMS.

Parameters

self

The object implementing this interface

 

in_Message

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_sms_implement_get_sms_length ()

void
tp_svc_channel_interface_sms_implement_get_sms_length
                               (TpSvcChannelInterfaceSMSClass *klass,
                                tp_svc_channel_interface_sms_get_sms_length_impl impl);

Register an implementation for the GetSMSLength method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetSMSLength D-Bus method

 

tp_svc_channel_interface_sms_return_from_get_sms_length ()

void
tp_svc_channel_interface_sms_return_from_get_sms_length
                               (DBusGMethodInvocation *context,
                                guint out_Chunks_Required,
                                gint out_Remaining_Characters,
                                gint out_Estimated_Cost);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Chunks_Required

guint (FIXME, generate documentation)

 

out_Remaining_Characters

gint (FIXME, generate documentation)

 

out_Estimated_Cost

gint (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeText

typedef struct _TpSvcChannelTypeText TpSvcChannelTypeText;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeTextClass

typedef struct _TpSvcChannelTypeTextClass TpSvcChannelTypeTextClass;

The class of TpSvcChannelTypeText.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_text (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (acknowledge_pending_messages);
  IMPLEMENT (get_message_types);
  IMPLEMENT (list_pending_messages);
  IMPLEMENT (send);
#undef IMPLEMENT
}

TpSvcChannelInterfaceChatState

typedef struct _TpSvcChannelInterfaceChatState TpSvcChannelInterfaceChatState;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceChatStateClass

typedef struct _TpSvcChannelInterfaceChatStateClass TpSvcChannelInterfaceChatStateClass;

The class of TpSvcChannelInterfaceChatState.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_chat_state (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_chat_state_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_chat_state);
#undef IMPLEMENT
}

TpSvcChannelInterfaceMessages

typedef struct _TpSvcChannelInterfaceMessages TpSvcChannelInterfaceMessages;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceMessagesClass

typedef struct _TpSvcChannelInterfaceMessagesClass TpSvcChannelInterfaceMessagesClass;

The class of TpSvcChannelInterfaceMessages.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_messages (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_messages_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (send_message);
  IMPLEMENT (get_pending_message_content);
#undef IMPLEMENT
}

TpSvcChannelInterfacePassword

typedef struct _TpSvcChannelInterfacePassword TpSvcChannelInterfacePassword;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfacePasswordClass

typedef struct _TpSvcChannelInterfacePasswordClass TpSvcChannelInterfacePasswordClass;

The class of TpSvcChannelInterfacePassword.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_password (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_password_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_password_flags);
  IMPLEMENT (provide_password);
#undef IMPLEMENT
}

TpSvcChannelInterfaceSMS

typedef struct _TpSvcChannelInterfaceSMS TpSvcChannelInterfaceSMS;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceSMSClass

typedef struct _TpSvcChannelInterfaceSMSClass TpSvcChannelInterfaceSMSClass;

The class of TpSvcChannelInterfaceSMS.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_sms (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_sms_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_sms_length);
#undef IMPLEMENT
}

Signal Details

The “lost-message” signal

void
user_function (TpSvcChannelTypeText *self,
               gpointer              user_data)

The LostMessage D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “received” signal

void
user_function (TpSvcChannelTypeText *self,
               guint                 arg_ID,
               guint                 arg_Timestamp,
               guint                 arg_Sender,
               guint                 arg_Type,
               guint                 arg_Flags,
               gchar                *arg_Text,
               gpointer              user_data)

The Received D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Sender

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Flags

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “send-error” signal

void
user_function (TpSvcChannelTypeText *self,
               guint                 arg_Error,
               guint                 arg_Timestamp,
               guint                 arg_Type,
               gchar                *arg_Text,
               gpointer              user_data)

The SendError D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Error

guint (FIXME, generate documentation)

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “sent” signal

void
user_function (TpSvcChannelTypeText *self,
               guint                 arg_Timestamp,
               guint                 arg_Type,
               gchar                *arg_Text,
               gpointer              user_data)

The Sent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Timestamp

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Text

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “chat-state-changed” signal

void
user_function (TpSvcChannelInterfaceChatState *self,
               guint                           arg_Contact,
               guint                           arg_State,
               gpointer                        user_data)

The ChatStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “message-received” signal

void
user_function (TpSvcChannelInterfaceMessages *self,
               gpointer                       user_data)

The MessageReceived D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Message

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “message-sent” signal

void
user_function (TpSvcChannelInterfaceMessages *self,
               guint                          arg_Flags,
               gchar                         *arg_Message_Token,
               gpointer                       user_data)

The MessageSent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Content

const GPtrArray * (FIXME, generate documentation)

 

arg_Flags

guint (FIXME, generate documentation)

 

arg_Message_Token

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “pending-messages-removed” signal

void
user_function (TpSvcChannelInterfaceMessages *self,
               GArray_guint_                 *arg_Message_IDs,
               gpointer                       user_data)

The PendingMessagesRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Message_IDs

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “password-flags-changed” signal

void
user_function (TpSvcChannelInterfacePassword *self,
               guint                          arg_Added,
               guint                          arg_Removed,
               gpointer                       user_data)

The PasswordFlagsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

guint (FIXME, generate documentation)

 

arg_Removed

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “s-ms-channel-changed” signal

void
user_function (TpSvcChannelInterfaceSMS *self,
               gboolean                  arg_SMSChannel,
               gpointer                  user_data)

The SMSChannelChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_SMSChannel

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpTextMixin

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-call-content.html0000644000175000017500000062637614006623344024240 00000000000000 Channel Call content interfaces: telepathy-glib API Reference Manual

Channel Call content interfaces

Channel Call content interfaces — client-side wrappers for call contents

Functions

TpProxyPendingCall * tp_cli_call_content_call_remove ()
void (*tp_cli_call_content_callback_for_remove) ()
TpProxySignalConnection * tp_cli_call_content_connect_to_streams_added ()
TpProxySignalConnection * tp_cli_call_content_connect_to_streams_removed ()
void (*tp_cli_call_content_signal_callback_streams_added) ()
void (*tp_cli_call_content_signal_callback_streams_removed) ()
TpProxyPendingCall * tp_cli_call_content_interface_media_call_acknowledge_dtmf_change ()
TpProxyPendingCall * tp_cli_call_content_interface_media_call_fail ()
TpProxyPendingCall * tp_cli_call_content_interface_media_call_update_local_media_description ()
void (*tp_cli_call_content_interface_media_callback_for_acknowledge_dtmf_change) ()
void (*tp_cli_call_content_interface_media_callback_for_fail) ()
void (*tp_cli_call_content_interface_media_callback_for_update_local_media_description) ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_dtmf_change_requested ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_local_media_description_changed ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_media_description_offer_done ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_media_descriptions_removed ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_new_media_description_offer ()
TpProxySignalConnection * tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed ()
void (*tp_cli_call_content_interface_media_signal_callback_dtmf_change_requested) ()
void (*tp_cli_call_content_interface_media_signal_callback_local_media_description_changed) ()
void (*tp_cli_call_content_interface_media_signal_callback_media_description_offer_done) ()
void (*tp_cli_call_content_interface_media_signal_callback_media_descriptions_removed) ()
void (*tp_cli_call_content_interface_media_signal_callback_new_media_description_offer) ()
void (*tp_cli_call_content_interface_media_signal_callback_remote_media_descriptions_changed) ()
TpProxySignalConnection * tp_cli_call_content_interface_video_control_connect_to_bitrate_changed ()
TpProxySignalConnection * tp_cli_call_content_interface_video_control_connect_to_framerate_changed ()
TpProxySignalConnection * tp_cli_call_content_interface_video_control_connect_to_key_frame_requested ()
TpProxySignalConnection * tp_cli_call_content_interface_video_control_connect_to_mtu_changed ()
TpProxySignalConnection * tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed ()
void (*tp_cli_call_content_interface_video_control_signal_callback_bitrate_changed) ()
void (*tp_cli_call_content_interface_video_control_signal_callback_framerate_changed) ()
void (*tp_cli_call_content_interface_video_control_signal_callback_key_frame_requested) ()
void (*tp_cli_call_content_interface_video_control_signal_callback_mtu_changed) ()
void (*tp_cli_call_content_interface_video_control_signal_callback_video_resolution_changed) ()
TpProxyPendingCall * tp_cli_call_content_interface_audio_control_call_report_input_volume ()
TpProxyPendingCall * tp_cli_call_content_interface_audio_control_call_report_output_volume ()
void (*tp_cli_call_content_interface_audio_control_callback_for_report_input_volume) ()
void (*tp_cli_call_content_interface_audio_control_callback_for_report_output_volume) ()
TpProxyPendingCall * tp_cli_call_content_interface_dtmf_call_multiple_tones ()
TpProxyPendingCall * tp_cli_call_content_interface_dtmf_call_start_tone ()
TpProxyPendingCall * tp_cli_call_content_interface_dtmf_call_stop_tone ()
void (*tp_cli_call_content_interface_dtmf_callback_for_multiple_tones) ()
void (*tp_cli_call_content_interface_dtmf_callback_for_start_tone) ()
void (*tp_cli_call_content_interface_dtmf_callback_for_stop_tone) ()
TpProxySignalConnection * tp_cli_call_content_interface_dtmf_connect_to_sending_tones ()
TpProxySignalConnection * tp_cli_call_content_interface_dtmf_connect_to_stopped_tones ()
TpProxySignalConnection * tp_cli_call_content_interface_dtmf_connect_to_tones_deferred ()
void (*tp_cli_call_content_interface_dtmf_signal_callback_sending_tones) ()
void (*tp_cli_call_content_interface_dtmf_signal_callback_stopped_tones) ()
void (*tp_cli_call_content_interface_dtmf_signal_callback_tones_deferred) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Represents the contents of a call.

Functions

tp_cli_call_content_call_remove ()

TpProxyPendingCall *
tp_cli_call_content_call_remove (TpCallContent *proxy,
                                 gint timeout_ms,
                                 tp_cli_call_content_callback_for_remove callback,
                                 gpointer user_data,
                                 GDestroyNotify destroy,
                                 GObject *weak_object);

Start a Remove method call.

Remove the content from the call. This will cause <tp:dbus-ref namespace="ofdT.Channel.Type">Call1.ContentRemoved</tp:dbus-ref>((self_handle, <tp:value-ref type="Call_State_Change_Reason">User_Requested</tp:value-ref>, &quot;&quot;, &quot;&quot;)) to be emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_callback_for_remove ()

void
(*tp_cli_call_content_callback_for_remove)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Remove method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_connect_to_streams_added ()

TpProxySignalConnection *
tp_cli_call_content_connect_to_streams_added
                               (TpCallContent *proxy,
                                tp_cli_call_content_signal_callback_streams_added callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamsAdded.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when streams are added to a call.</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_connect_to_streams_removed ()

TpProxySignalConnection *
tp_cli_call_content_connect_to_streams_removed
                               (TpCallContent *proxy,
                                tp_cli_call_content_signal_callback_streams_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamsRemoved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when streams are removed from a call</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_signal_callback_streams_added ()

void
(*tp_cli_call_content_signal_callback_streams_added)
                               (TpCallContent *proxy,
                                const GPtrArray *arg_Streams,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamsAdded.

Parameters

proxy

The proxy on which tp_cli_call_content_connect_to_streams_added() was called

 

arg_Streams

The <tp:dbus-ref namespace="ofdT.Call1">Stream</tp:dbus-ref>s which were added.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_signal_callback_streams_removed ()

void
(*tp_cli_call_content_signal_callback_streams_removed)
                               (TpCallContent *proxy,
                                const GPtrArray *arg_Streams,
                                const GValueArray *arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamsRemoved.

Parameters

proxy

The proxy on which tp_cli_call_content_connect_to_streams_removed() was called

 

arg_Streams

The <tp:dbus-ref namespace="ofdT.Call1">Stream</tp:dbus-ref>s which were removed.

 

arg_Reason

Why the content was removed.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_call_acknowledge_dtmf_change ()

TpProxyPendingCall *
tp_cli_call_content_interface_media_call_acknowledge_dtmf_change
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                guchar in_Event,
                                guint in_State,
                                tp_cli_call_content_interface_media_callback_for_acknowledge_dtmf_change callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcknowledgeDTMFChange method call.

Called by the streaming implementation in response to <tp:member-ref>DTMFChangeRequested</tp:member-ref> to confirm that it has started or stopped sending the event in question.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Event

Used to pass an 'in' argument: The event referred to in the corresponding <tp:member-ref>DTMFChangeRequested</tp:member-ref> signal.

 

in_State

Used to pass an 'in' argument: Either <tp:value-ref type="Sending_State">Sending</tp:value-ref> or <tp:value-ref type="Sending_State">None</tp:value-ref>. (TpSendingState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_media_call_fail ()

TpProxyPendingCall *
tp_cli_call_content_interface_media_call_fail
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                const GValueArray *in_Reason,
                                tp_cli_call_content_interface_media_callback_for_fail callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Fail method call.

Signal an unrecoverable error for this content, and remove it.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: A reason struct describing the error.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_media_call_update_local_media_description ()

TpProxyPendingCall *
tp_cli_call_content_interface_media_call_update_local_media_description
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                GHashTable *in_MediaDescription,
                                tp_cli_call_content_interface_media_callback_for_update_local_media_description callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a UpdateLocalMediaDescription method call.

Update the local codec mapping and other interfaces of the MediaDescription. This method should only be used during an existing call to update the local media description. This may trigger a re-negotiation which may result in new new MediaDescriptionOffers if the &quot;FurtherNegotiationRequired&quot; property is TRUE. Otherwise, only parameters which strictly describe the media being sent can be changed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_MediaDescription

Used to pass an 'in' argument: The updated media description that the local side wants to use.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_media_callback_for_acknowledge_dtmf_change ()

void
(*tp_cli_call_content_interface_media_callback_for_acknowledge_dtmf_change)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcknowledgeDTMFChange method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_media_callback_for_fail ()

void
(*tp_cli_call_content_interface_media_callback_for_fail)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Fail method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_media_callback_for_update_local_media_description ()

void
(*tp_cli_call_content_interface_media_callback_for_update_local_media_description)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UpdateLocalMediaDescription method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_media_connect_to_dtmf_change_requested ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_dtmf_change_requested
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_dtmf_change_requested callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal DTMFChangeRequested.

Used by the CM to relay instructions from <tp:dbus-ref namespace="ofdT">Channel.Interface.DTMF</tp:dbus-ref> to the streaming implementation. If any contact in this call supports the telephone-event codec in their MediaDescription, this event should be sent as outlined in RFC 4733. Otherwise, it should be sent as an audible tone.

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_connect_to_local_media_description_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_local_media_description_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_local_media_description_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocalMediaDescriptionChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Change notification for <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">LocalMediaDescriptions</tp:dbus-ref> </p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_connect_to_media_description_offer_done ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_media_description_offer_done
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_media_description_offer_done callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MediaDescriptionOfferDone.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a <tp:dbus-ref namespace="ofdT.Call1.Content">MediaDescription</tp:dbus-ref> has been handled. </p> <p>Emission of this signal indicates that the <tp:member-ref>MediaDescriptionOffer</tp:member-ref> property has changed to <code>(&quot;/&quot;, 0, {})</code>.</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_connect_to_media_descriptions_removed ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_media_descriptions_removed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_media_descriptions_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MediaDescriptionsRemoved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Removal notification for <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">RemoteMediaDescriptions</tp:dbus-ref> and <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">LocalMediaDescriptions</tp:dbus-ref> </p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_connect_to_new_media_description_offer ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_new_media_description_offer
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_new_media_description_offer callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewMediaDescriptionOffer.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a new <tp:dbus-ref namespace="ofdT.Call1.Content">MediaDescription</tp:dbus-ref> appears. The streaming &gt;implementation MUST respond by calling the <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">Accept</tp:dbus-ref> or <tp:dbus-ref namespace="ofdT.Call1.Content.MediaDescription">Reject</tp:dbus-ref> method on the description object appeared.</p> <p>Emission of this signal indicates that the <tp:member-ref>MediaDescriptionOffer</tp:member-ref> property has changed to <code>(Description, Contact, MediaDescriptionProperties)</code>.</p> <p>When the MediaDescriptionOffer has been dealt with then <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">MediaDescriptionOfferDone</tp:dbus-ref> must be emitted before <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">NewMediaDescriptionOffer</tp:dbus-ref> is emitted again. </p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_media_signal_callback_remote_media_descriptions_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RemoteMediaDescriptionsChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Change notification for <tp:dbus-ref namespace="ofdT.Call1.Content.Interface.Media">RemoteMediaDescriptions</tp:dbus-ref> </p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_media_signal_callback_dtmf_change_requested ()

void
(*tp_cli_call_content_interface_media_signal_callback_dtmf_change_requested)
                               (TpCallContent *proxy,
                                guchar arg_Event,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal DTMFChangeRequested.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_dtmf_change_requested() was called

 

arg_Event

The event to send (or stop sending).

 

arg_State

Either <tp:value-ref type="Sending_State">Pending_Send</tp:value-ref> or <tp:value-ref type="Sending_State">Pending_Stop_Sending</tp:value-ref>. (TpSendingState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_signal_callback_local_media_description_changed ()

void
(*tp_cli_call_content_interface_media_signal_callback_local_media_description_changed)
                               (TpCallContent *proxy,
                                GHashTable *arg_Updated_Media_Description,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocalMediaDescriptionChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_local_media_description_changed() was called

 

arg_Updated_Media_Description

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The local content description that was updated</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_signal_callback_media_description_offer_done ()

void
(*tp_cli_call_content_interface_media_signal_callback_media_description_offer_done)
                               (TpCallContent *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MediaDescriptionOfferDone.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_media_description_offer_done() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_signal_callback_media_descriptions_removed ()

void
(*tp_cli_call_content_interface_media_signal_callback_media_descriptions_removed)
                               (TpCallContent *proxy,
                                const GArray *arg_Removed_Media_Descriptions,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MediaDescriptionsRemoved.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_media_descriptions_removed() was called

 

arg_Removed_Media_Descriptions

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The local and remote content descriptions that are no longer part of this content</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_signal_callback_new_media_description_offer ()

void
(*tp_cli_call_content_interface_media_signal_callback_new_media_description_offer)
                               (TpCallContent *proxy,
                                const gchar *arg_Media_Description,
                                GHashTable *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewMediaDescriptionOffer.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_new_media_description_offer() was called

 

arg_Media_Description

The object path of the new media description. This replaces any previous media description.

 

arg_Properties

The immutable properties of the remote media description. <tp:rationale> Having all the MediaDescription properties here saves a D-Bus round-trip - it shouldn't be necessary to get the properties from the MediaDescription object, in practice. </tp:rationale>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_media_signal_callback_remote_media_descriptions_changed ()

void
(*tp_cli_call_content_interface_media_signal_callback_remote_media_descriptions_changed)
                               (TpCallContent *proxy,
                                GHashTable *arg_Updated_Media_Descriptions,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RemoteMediaDescriptionsChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed() was called

 

arg_Updated_Media_Descriptions

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The remote content descriptions that were updated</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_video_control_connect_to_bitrate_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_video_control_connect_to_bitrate_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_video_control_signal_callback_bitrate_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal BitrateChanged.

The desired bitrate has changed

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_video_control_connect_to_framerate_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_video_control_connect_to_framerate_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_video_control_signal_callback_framerate_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal FramerateChanged.

The desired framerate has changed

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_video_control_connect_to_key_frame_requested ()

TpProxySignalConnection *
tp_cli_call_content_interface_video_control_connect_to_key_frame_requested
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_video_control_signal_callback_key_frame_requested callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal KeyFrameRequested.

Request that the video encoder produce a new key frame as soon as possible.

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_video_control_connect_to_mtu_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_video_control_connect_to_mtu_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_video_control_signal_callback_mtu_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MTUChanged.

The Maximum Transmission Unit has changed

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed ()

TpProxySignalConnection *
tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_video_control_signal_callback_video_resolution_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal VideoResolutionChanged.

The desired video resolution has changed.

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_video_control_signal_callback_bitrate_changed ()

void
(*tp_cli_call_content_interface_video_control_signal_callback_bitrate_changed)
                               (TpCallContent *proxy,
                                guint arg_NewBitrate,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal BitrateChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_video_control_connect_to_bitrate_changed() was called

 

arg_NewBitrate

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_video_control_signal_callback_framerate_changed ()

void
(*tp_cli_call_content_interface_video_control_signal_callback_framerate_changed)
                               (TpCallContent *proxy,
                                guint arg_NewFramerate,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal FramerateChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_video_control_connect_to_framerate_changed() was called

 

arg_NewFramerate

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_video_control_signal_callback_key_frame_requested ()

void
(*tp_cli_call_content_interface_video_control_signal_callback_key_frame_requested)
                               (TpCallContent *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal KeyFrameRequested.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_video_control_connect_to_key_frame_requested() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_video_control_signal_callback_mtu_changed ()

void
(*tp_cli_call_content_interface_video_control_signal_callback_mtu_changed)
                               (TpCallContent *proxy,
                                guint arg_NewMTU,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MTUChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_video_control_connect_to_mtu_changed() was called

 

arg_NewMTU

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_video_control_signal_callback_video_resolution_changed ()

void
(*tp_cli_call_content_interface_video_control_signal_callback_video_resolution_changed)
                               (TpCallContent *proxy,
                                const GValueArray *arg_NewResolution,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal VideoResolutionChanged.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed() was called

 

arg_NewResolution

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_audio_control_call_report_input_volume ()

TpProxyPendingCall *
tp_cli_call_content_interface_audio_control_call_report_input_volume
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                gint in_Volume,
                                tp_cli_call_content_interface_audio_control_callback_for_report_input_volume callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ReportInputVolume method call.

<p>Report to the CM that the Content input volume has been changed by the client.</p> <p>It is the client's responsibility to change the input volume used for the content. However, the client MUST call this whenever it changes input volume for the content.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Volume

Used to pass an 'in' argument: Report the input volume level as set by the client.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_audio_control_call_report_output_volume ()

TpProxyPendingCall *
tp_cli_call_content_interface_audio_control_call_report_output_volume
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                gint in_Volume,
                                tp_cli_call_content_interface_audio_control_callback_for_report_output_volume callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ReportOutputVolume method call.

<p>Report to the CM that the content output volume has been changed by the client.</p> <p>It is the client's responsibility to change the output volume used for the content. However, the client MUST call this whenever it changes output volume for the content.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Volume

Used to pass an 'in' argument: Report the output volume level as set by the client.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_audio_control_callback_for_report_input_volume ()

void
(*tp_cli_call_content_interface_audio_control_callback_for_report_input_volume)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReportInputVolume method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_audio_control_callback_for_report_output_volume ()

void
(*tp_cli_call_content_interface_audio_control_callback_for_report_output_volume)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReportOutputVolume method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_dtmf_call_multiple_tones ()

TpProxyPendingCall *
tp_cli_call_content_interface_dtmf_call_multiple_tones
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                const gchar *in_Tones,
                                tp_cli_call_content_interface_dtmf_callback_for_multiple_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a MultipleTones method call.

<p>Send multiple DTMF events to all eligible streams in the channel. Each tone will be played for an implementation-defined number of milliseconds (typically 250ms), followed by a gap before the next tone is played (typically 100ms). The duration and gap are defined by the protocol or connection manager.</p> <tp:rationale> <p>In cases where the client knows in advance the tone sequence it wants to send, it's easier to use this method than manually start and stop each tone in the sequence.</p> <p>The tone and gap lengths may need to vary for interoperability, according to the protocol and other implementations' ability to recognise tones. At the time of writing, GStreamer uses a minimum of 250ms tones and 100ms gaps when playing in-band DTMF in the normal audio stream, or 70ms tones and 50ms gaps when encoding DTMF as <code>audio/telephone-event</code>.</p> </tp:rationale> <p>Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Tones

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A string representation of one or more DTMF events. Implementations of this method MUST support all of the following characters in this string:</p> <ul> <li>the digits 0-9, letters A-D and a-d, and symbols '*' and '#' correspond to the members of <tp:type>DTMF_Event</tp:type></li> <li>any of 'p', 'P', 'x', 'X' or ',' (comma) results in an implementation-defined pause, typically for 3 seconds</li> <li>'w' or 'W' waits for the user to continue, by stopping interpretation of the string, and if there is more to be played, emitting the <tp:member-ref>TonesDeferred</tp:member-ref> signal with the rest of the string as its argument: see that signal for details</li> </ul>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_dtmf_call_start_tone ()

TpProxyPendingCall *
tp_cli_call_content_interface_dtmf_call_start_tone
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                guchar in_Event,
                                tp_cli_call_content_interface_dtmf_callback_for_start_tone callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StartTone method call.

<p>Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until <tp:member-ref>StopTone</tp:member-ref> is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.</p> <tp:rationale> The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly. </tp:rationale> <p>Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Event

Used to pass an 'in' argument: A numeric event code from the DTMF_Event enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_dtmf_call_stop_tone ()

TpProxyPendingCall *
tp_cli_call_content_interface_dtmf_call_stop_tone
                               (TpCallContent *proxy,
                                gint timeout_ms,
                                tp_cli_call_content_interface_dtmf_callback_for_stop_tone callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StopTone method call.

Stop sending any DTMF tones which have been started using the <tp:member-ref>StartTone</tp:member-ref> or <tp:member-ref>MultipleTones</tp:member-ref> methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal. <tp:rationale> On some protocols it might be impossible to cancel queued tones immediately. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_interface_dtmf_callback_for_multiple_tones ()

void
(*tp_cli_call_content_interface_dtmf_callback_for_multiple_tones)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a MultipleTones method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_dtmf_callback_for_start_tone ()

void
(*tp_cli_call_content_interface_dtmf_callback_for_start_tone)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StartTone method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_dtmf_callback_for_stop_tone ()

void
(*tp_cli_call_content_interface_dtmf_callback_for_stop_tone)
                               (TpCallContent *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StopTone method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_interface_dtmf_connect_to_sending_tones ()

TpProxySignalConnection *
tp_cli_call_content_interface_dtmf_connect_to_sending_tones
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_dtmf_signal_callback_sending_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SendingTones.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>DTMF tone(s)are being sent to all eligible streams in the channel. The signal is provided to indicating the fact that the streams are currently being used to send one or more DTMF tones, so any other media input is not getting through to the audio stream. It also serves as a cue for the <tp:member-ref>StopTone</tp:member-ref> method.</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_dtmf_connect_to_stopped_tones ()

TpProxySignalConnection *
tp_cli_call_content_interface_dtmf_connect_to_stopped_tones
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_dtmf_signal_callback_stopped_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StoppedTones.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>DTMF tones have finished playing on streams in this channel.</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_dtmf_connect_to_tones_deferred ()

TpProxySignalConnection *
tp_cli_call_content_interface_dtmf_connect_to_tones_deferred
                               (TpCallContent *proxy,
                                tp_cli_call_content_interface_dtmf_signal_callback_tones_deferred callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TonesDeferred.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when 'w' or 'W', indicating &quot;wait for the user to continue&quot;, is encountered while playing a DTMF string queued by <tp:member-ref>MultipleTones</tp:member-ref>. Any queued DTMF events after the 'w', which have not yet been played, are placed in the <tp:member-ref>DeferredTones</tp:member-ref> property and copied into this signal's argument.</p> <p>When the channel handler is ready to continue, it MAY pass the value of <tp:member-ref>DeferredTones</tp:member-ref> to <tp:member-ref>MultipleTones</tp:member-ref>, to resume sending. Alternatively, it MAY ignore the deferred tones, or even play different tones instead. Any deferred tones are discarded the next time a tone is played.</p> <p>This signal SHOULD NOT be emitted if there is nothing left to play, i.e. if the 'w' was the last character in the DTMF string.</p>

Parameters

proxy

A TpCallContent or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_content_interface_dtmf_signal_callback_sending_tones ()

void
(*tp_cli_call_content_interface_dtmf_signal_callback_sending_tones)
                               (TpCallContent *proxy,
                                const gchar *arg_Tones,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SendingTones.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_dtmf_connect_to_sending_tones() was called

 

arg_Tones

DTMF string (one or more events) that is to be played.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_dtmf_signal_callback_stopped_tones ()

void
(*tp_cli_call_content_interface_dtmf_signal_callback_stopped_tones)
                               (TpCallContent *proxy,
                                gboolean arg_Cancelled,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StoppedTones.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_dtmf_connect_to_stopped_tones() was called

 

arg_Cancelled

True if the DTMF tones were actively cancelled via <tp:member-ref>StopTone</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_content_interface_dtmf_signal_callback_tones_deferred ()

void
(*tp_cli_call_content_interface_dtmf_signal_callback_tones_deferred)
                               (TpCallContent *proxy,
                                const gchar *arg_Tones,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TonesDeferred.

Parameters

proxy

The proxy on which tp_cli_call_content_interface_dtmf_connect_to_tones_deferred() was called

 

arg_Tones

The new non-empty value of <tp:member-ref>DeferredTones</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-auth.html0000644000175000017500000024632514006623344024240 00000000000000 Service-side Channel Authentication interfaces: telepathy-glib API Reference Manual

Service-side Channel Authentication interfaces

Service-side Channel Authentication interfaces — GInterfaces to implement authentication channels

Functions

void (*tp_svc_channel_interface_sasl_authentication_abort_sasl_impl) ()
void (*tp_svc_channel_interface_sasl_authentication_accept_sasl_impl) ()
void tp_svc_channel_interface_sasl_authentication_emit_new_challenge ()
void tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed ()
void tp_svc_channel_interface_sasl_authentication_implement_abort_sasl ()
void tp_svc_channel_interface_sasl_authentication_implement_accept_sasl ()
void tp_svc_channel_interface_sasl_authentication_implement_respond ()
void tp_svc_channel_interface_sasl_authentication_implement_start_mechanism ()
void tp_svc_channel_interface_sasl_authentication_implement_start_mechanism_with_data ()
void (*tp_svc_channel_interface_sasl_authentication_respond_impl) ()
void tp_svc_channel_interface_sasl_authentication_return_from_abort_sasl ()
void tp_svc_channel_interface_sasl_authentication_return_from_accept_sasl ()
void tp_svc_channel_interface_sasl_authentication_return_from_respond ()
void tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism ()
void tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism_with_data ()
void (*tp_svc_channel_interface_sasl_authentication_start_mechanism_impl) ()
void (*tp_svc_channel_interface_sasl_authentication_start_mechanism_with_data_impl) ()
void (*tp_svc_channel_interface_captcha_authentication_answer_captchas_impl) ()
void (*tp_svc_channel_interface_captcha_authentication_cancel_captcha_impl) ()
void (*tp_svc_channel_interface_captcha_authentication_get_captcha_data_impl) ()
void (*tp_svc_channel_interface_captcha_authentication_get_captchas_impl) ()
void tp_svc_channel_interface_captcha_authentication_implement_answer_captchas ()
void tp_svc_channel_interface_captcha_authentication_implement_cancel_captcha ()
void tp_svc_channel_interface_captcha_authentication_implement_get_captcha_data ()
void tp_svc_channel_interface_captcha_authentication_implement_get_captchas ()
void tp_svc_channel_interface_captcha_authentication_return_from_answer_captchas ()
void tp_svc_channel_interface_captcha_authentication_return_from_cancel_captcha ()
void tp_svc_channel_interface_captcha_authentication_return_from_get_captcha_data ()
void tp_svc_channel_interface_captcha_authentication_return_from_get_captchas ()

Signals

void new-challenge Has Details
void s-as-lstatus-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceCaptchaAuthentication
    ├── TpSvcChannelInterfaceSASLAuthentication
    ╰── TpSvcChannelTypeServerAuthentication

Known Implementations

TpSvcChannelTypeServerAuthentication is implemented by TpBasePasswordChannel.

TpSvcChannelInterfaceSASLAuthentication is implemented by TpBasePasswordChannel.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The ServerAuthentication channel type represents a request for client/UI processes to carry out authentication with a server.

The SASLAuthentication interface allows authentication via SASL, and also allows providing a simple password to the connection manager for it to use with SASL or non-SASL mechanisms.

The CaptchaAuthentication interface (since 0.17.5) allows interactive captcha-solving so that the user can prove that they are not a bot, on protocols requiring this.

Functions

tp_svc_channel_interface_sasl_authentication_abort_sasl_impl ()

void
(*tp_svc_channel_interface_sasl_authentication_abort_sasl_impl)
                               (TpSvcChannelInterfaceSASLAuthentication *self,
                                guint in_Reason,
                                const gchar *in_Debug_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AbortSASL on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

self

The object implementing this interface

 

in_Reason

guint (FIXME, generate documentation)

 

in_Debug_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_sasl_authentication_accept_sasl_impl ()

void
(*tp_svc_channel_interface_sasl_authentication_accept_sasl_impl)
                               (TpSvcChannelInterfaceSASLAuthentication *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcceptSASL on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_sasl_authentication_emit_new_challenge ()

void
tp_svc_channel_interface_sasl_authentication_emit_new_challenge
                               (gpointer instance,
                                const GArray *arg_Challenge_Data);

Type-safe wrapper around g_signal_emit to emit the NewChallenge signal on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

instance

The object implementing this interface

 

arg_Challenge_Data

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed ()

void
tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed
                               (gpointer instance,
                                guint arg_Status,
                                const gchar *arg_Reason,
                                GHashTable *arg_Details);

Type-safe wrapper around g_signal_emit to emit the SASLStatusChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

instance

The object implementing this interface

 

arg_Status

guint (FIXME, generate documentation)

 

arg_Reason

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_sasl_authentication_implement_abort_sasl ()

void
tp_svc_channel_interface_sasl_authentication_implement_abort_sasl
                               (TpSvcChannelInterfaceSASLAuthenticationClass *klass,
                                tp_svc_channel_interface_sasl_authentication_abort_sasl_impl impl);

Register an implementation for the AbortSASL method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AbortSASL D-Bus method

 

tp_svc_channel_interface_sasl_authentication_implement_accept_sasl ()

void
tp_svc_channel_interface_sasl_authentication_implement_accept_sasl
                               (TpSvcChannelInterfaceSASLAuthenticationClass *klass,
                                tp_svc_channel_interface_sasl_authentication_accept_sasl_impl impl);

Register an implementation for the AcceptSASL method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcceptSASL D-Bus method

 

tp_svc_channel_interface_sasl_authentication_implement_respond ()

void
tp_svc_channel_interface_sasl_authentication_implement_respond
                               (TpSvcChannelInterfaceSASLAuthenticationClass *klass,
                                tp_svc_channel_interface_sasl_authentication_respond_impl impl);

Register an implementation for the Respond method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Respond D-Bus method

 

tp_svc_channel_interface_sasl_authentication_implement_start_mechanism ()

void
tp_svc_channel_interface_sasl_authentication_implement_start_mechanism
                               (TpSvcChannelInterfaceSASLAuthenticationClass *klass,
                                tp_svc_channel_interface_sasl_authentication_start_mechanism_impl impl);

Register an implementation for the StartMechanism method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StartMechanism D-Bus method

 

tp_svc_channel_interface_sasl_authentication_implement_start_mechanism_with_data ()

void
tp_svc_channel_interface_sasl_authentication_implement_start_mechanism_with_data
                               (TpSvcChannelInterfaceSASLAuthenticationClass *klass,
                                tp_svc_channel_interface_sasl_authentication_start_mechanism_with_data_impl impl);

Register an implementation for the StartMechanismWithData method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StartMechanismWithData D-Bus method

 

tp_svc_channel_interface_sasl_authentication_respond_impl ()

void
(*tp_svc_channel_interface_sasl_authentication_respond_impl)
                               (TpSvcChannelInterfaceSASLAuthentication *self,
                                const GArray *in_Response_Data,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Respond on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

self

The object implementing this interface

 

in_Response_Data

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_sasl_authentication_return_from_abort_sasl ()

void
tp_svc_channel_interface_sasl_authentication_return_from_abort_sasl
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_sasl_authentication_return_from_accept_sasl ()

void
tp_svc_channel_interface_sasl_authentication_return_from_accept_sasl
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_sasl_authentication_return_from_respond ()

void
tp_svc_channel_interface_sasl_authentication_return_from_respond
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism ()

void
tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism_with_data ()

void
tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism_with_data
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_sasl_authentication_start_mechanism_impl ()

void
(*tp_svc_channel_interface_sasl_authentication_start_mechanism_impl)
                               (TpSvcChannelInterfaceSASLAuthentication *self,
                                const gchar *in_Mechanism,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StartMechanism on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

self

The object implementing this interface

 

in_Mechanism

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_sasl_authentication_start_mechanism_with_data_impl ()

void
(*tp_svc_channel_interface_sasl_authentication_start_mechanism_with_data_impl)
                               (TpSvcChannelInterfaceSASLAuthentication *self,
                                const gchar *in_Mechanism,
                                const GArray *in_Initial_Data,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StartMechanismWithData on interface org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication.

Parameters

self

The object implementing this interface

 

in_Mechanism

const gchar * (FIXME, generate documentation)

 

in_Initial_Data

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_captcha_authentication_answer_captchas_impl ()

void
(*tp_svc_channel_interface_captcha_authentication_answer_captchas_impl)
                               (TpSvcChannelInterfaceCaptchaAuthentication *self,
                                GHashTable *in_Answers,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AnswerCaptchas on interface org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.

Parameters

self

The object implementing this interface

 

in_Answers

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_captcha_authentication_cancel_captcha_impl ()

void
(*tp_svc_channel_interface_captcha_authentication_cancel_captcha_impl)
                               (TpSvcChannelInterfaceCaptchaAuthentication *self,
                                guint in_Reason,
                                const gchar *in_Debug_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CancelCaptcha on interface org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.

Parameters

self

The object implementing this interface

 

in_Reason

guint (FIXME, generate documentation)

 

in_Debug_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_captcha_authentication_get_captcha_data_impl ()

void
(*tp_svc_channel_interface_captcha_authentication_get_captcha_data_impl)
                               (TpSvcChannelInterfaceCaptchaAuthentication *self,
                                guint in_ID,
                                const gchar *in_Mime_Type,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetCaptchaData on interface org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

in_Mime_Type

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_captcha_authentication_get_captchas_impl ()

void
(*tp_svc_channel_interface_captcha_authentication_get_captchas_impl)
                               (TpSvcChannelInterfaceCaptchaAuthentication *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetCaptchas on interface org.freedesktop.Telepathy.Channel.Interface.CaptchaAuthentication1.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_captcha_authentication_implement_answer_captchas ()

void
tp_svc_channel_interface_captcha_authentication_implement_answer_captchas
                               (TpSvcChannelInterfaceCaptchaAuthenticationClass *klass,
                                tp_svc_channel_interface_captcha_authentication_answer_captchas_impl impl);

Register an implementation for the AnswerCaptchas method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AnswerCaptchas D-Bus method

 

tp_svc_channel_interface_captcha_authentication_implement_cancel_captcha ()

void
tp_svc_channel_interface_captcha_authentication_implement_cancel_captcha
                               (TpSvcChannelInterfaceCaptchaAuthenticationClass *klass,
                                tp_svc_channel_interface_captcha_authentication_cancel_captcha_impl impl);

Register an implementation for the CancelCaptcha method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CancelCaptcha D-Bus method

 

tp_svc_channel_interface_captcha_authentication_implement_get_captcha_data ()

void
tp_svc_channel_interface_captcha_authentication_implement_get_captcha_data
                               (TpSvcChannelInterfaceCaptchaAuthenticationClass *klass,
                                tp_svc_channel_interface_captcha_authentication_get_captcha_data_impl impl);

Register an implementation for the GetCaptchaData method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetCaptchaData D-Bus method

 

tp_svc_channel_interface_captcha_authentication_implement_get_captchas ()

void
tp_svc_channel_interface_captcha_authentication_implement_get_captchas
                               (TpSvcChannelInterfaceCaptchaAuthenticationClass *klass,
                                tp_svc_channel_interface_captcha_authentication_get_captchas_impl impl);

Register an implementation for the GetCaptchas method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetCaptchas D-Bus method

 

tp_svc_channel_interface_captcha_authentication_return_from_answer_captchas ()

void
tp_svc_channel_interface_captcha_authentication_return_from_answer_captchas
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_captcha_authentication_return_from_cancel_captcha ()

void
tp_svc_channel_interface_captcha_authentication_return_from_cancel_captcha
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_captcha_authentication_return_from_get_captcha_data ()

void
tp_svc_channel_interface_captcha_authentication_return_from_get_captcha_data
                               (DBusGMethodInvocation *context,
                                const GArray *out_Captcha_Data);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Captcha_Data

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_captcha_authentication_return_from_get_captchas ()

void
tp_svc_channel_interface_captcha_authentication_return_from_get_captchas
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Captcha_Info,
                                guint out_Number_Required,
                                const gchar *out_Language);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Captcha_Info

const GPtrArray * (FIXME, generate documentation)

 

out_Number_Required

guint (FIXME, generate documentation)

 

out_Language

const gchar * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeServerAuthentication

typedef struct _TpSvcChannelTypeServerAuthentication TpSvcChannelTypeServerAuthentication;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeServerAuthenticationClass

typedef struct _TpSvcChannelTypeServerAuthenticationClass TpSvcChannelTypeServerAuthenticationClass;

The class of TpSvcChannelTypeServerAuthentication. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelInterfaceSASLAuthentication

typedef struct _TpSvcChannelInterfaceSASLAuthentication TpSvcChannelInterfaceSASLAuthentication;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceSASLAuthenticationClass

typedef struct _TpSvcChannelInterfaceSASLAuthenticationClass TpSvcChannelInterfaceSASLAuthenticationClass;

The class of TpSvcChannelInterfaceSASLAuthentication.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_sasl_authentication (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_sasl_authentication_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (start_mechanism);
  IMPLEMENT (start_mechanism_with_data);
  IMPLEMENT (respond);
  IMPLEMENT (accept_sasl);
  IMPLEMENT (abort_sasl);
#undef IMPLEMENT
}

TpSvcChannelInterfaceCaptchaAuthentication

typedef struct _TpSvcChannelInterfaceCaptchaAuthentication TpSvcChannelInterfaceCaptchaAuthentication;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceCaptchaAuthenticationClass

typedef struct _TpSvcChannelInterfaceCaptchaAuthenticationClass TpSvcChannelInterfaceCaptchaAuthenticationClass;

The class of TpSvcChannelInterfaceCaptchaAuthentication.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_captcha_authentication (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_captcha_authentication_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_captchas);
  IMPLEMENT (get_captcha_data);
  IMPLEMENT (answer_captchas);
  IMPLEMENT (cancel_captcha);
#undef IMPLEMENT
}

Signal Details

The “new-challenge” signal

void
user_function (TpSvcChannelInterfaceSASLAuthentication *self,
               GArray_guchar_                          *arg_Challenge_Data,
               gpointer                                 user_data)

The NewChallenge D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Challenge_Data

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “s-as-lstatus-changed” signal

void
user_function (TpSvcChannelInterfaceSASLAuthentication *self,
               guint                                    arg_Status,
               gchar                                   *arg_Reason,
               gpointer                                 user_data)

The SASLStatusChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Status

guint (FIXME, generate documentation)

 

arg_Reason

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-simple-password-manager.html0000644000175000017500000006040514006623344025632 00000000000000 TpSimplePasswordManager: telepathy-glib API Reference Manual

TpSimplePasswordManager

TpSimplePasswordManager — a simple X-TELEPATHY-PASSWORD channel manager

Properties

TpBaseConnection * connection Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpSimplePasswordManager

Implemented Interfaces

TpSimplePasswordManager implements TpChannelManager.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class makes it easy to implement the X-TELEPATHY-PASSWORD SASL mechanism in a connection manger. It implements the TpChannelManager interface and pops up a ServerAuthentication channel when tp_simple_password_manager_prompt_async() is called to enable a channel handler to pass in the password using the appropriate D-Bus methods.

This channel manager is only useful for connection managers only wanting to implement the X-TELEPATHY-PASSWORD SASL mechanism in authentication channels. For connections with more SASL mechanisms, the channel manager and channel itself should be reimplemented to support the desired mechanisms.

A new TpSimplePasswordManager object should be created in the TpBaseConnectionClass->create_channel_managers implementation and added to the GPtrArray of channel managers. Then, in the TpBaseConnectionClass->start_connecting implementation, once the connection status has been changed to CONNECTING, the connection should check whether a password parameter was given when creating the connection through RequestConnection. If a password is present, the connection should go ahead and use it. If it is not present, tp_simple_password_manager_prompt_async() should be called.

Once a password is retrieved using the server authentication channel, or an error is occurred, the callback that was passed to tp_simple_password_manager_prompt_async() is called and the connection should call tp_simple_password_manager_prompt_finish() to get the result of the process. If the GString returned from said finish function is non-NULL, the connection can then proceed with that password, otherwise the connection must deal with the error reached.

Functions

tp_simple_password_manager_new ()

TpSimplePasswordManager *
tp_simple_password_manager_new (TpBaseConnection *connection);

Creates a new simple server authentication channel manager.

Parameters

connection

a TpBaseConnection

 

Returns

a new reference to a server authentication channel manager.


tp_simple_password_manager_prompt_async ()

void
tp_simple_password_manager_prompt_async
                               (TpSimplePasswordManager *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Pops up a new server authentication channel and handles the X-TELEPATHY-PASSWORD mechanism to obtain a password for the connection.

When the operation is finished, callback will be called. You must then call tp_simple_password_manager_prompt_finish() to get the result of the request.

Parameters

self

a TpSimplePasswordManager

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.8


tp_simple_password_manager_prompt_finish ()

const GString *
tp_simple_password_manager_prompt_finish
                               (TpSimplePasswordManager *self,
                                GAsyncResult *result,
                                GError **error);

Retrieve the value of the request begun with tp_simple_password_manager_prompt_async().

Parameters

self

a TpSimplePasswordManager

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a GString with the password (or byte-blob) retrieved by manager .

[transfer none]

Since: 0.13.8


tp_simple_password_manager_prompt_for_channel_async ()

void
tp_simple_password_manager_prompt_for_channel_async
                               (TpSimplePasswordManager *self,
                                TpBasePasswordChannel *channel,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Pops up a new server authentication channel and handles the X-TELEPATHY-PASSWORD mechanism to obtain a password for the connection.

When the operation is finished, callback will be called. You must then call tp_simple_password_manager_prompt_for_channel_finish() to get the result of the request.

Most of the time, tp_simple_password_manager_prompt_async() should be used instead. This function enables applications to provide custom channels instead of letting the password manager handle all of the channel details automatically. This may be useful if your SASL channel needs to implement additional interfaces (such as Channel.Interface.CredentialsStorage)

Parameters

self

a TpSimplePasswordManager

 

channel

a TpBasePasswordChannel

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.15


tp_simple_password_manager_prompt_for_channel_finish ()

const GString *
tp_simple_password_manager_prompt_for_channel_finish
                               (TpSimplePasswordManager *self,
                                GAsyncResult *result,
                                TpBasePasswordChannel **channel,
                                GError **error);

Retrieve the value of the request begun with tp_simple_password_manager_prompt_for_channel_async().

Parameters

self

a TpSimplePasswordManager

 

result

a GAsyncResult

 

channel

an output location to retrieve the custom password channel that was passed to tp_simple_password_manager_prompt_for_channel_async().

[transfer none]

error

a GError to fill

 

Returns

a GString with the password (or byte-blob) retrieved by manager .

[transfer none]

Since: 0.13.15

Types and Values

struct TpSimplePasswordManager

struct TpSimplePasswordManager;

A helper channel manager to manage X-TELEPATHY-PASSWORD ServerAuthentication channels.

Since: 0.13.8

Property Details

The “connection” property

  “connection”               TpBaseConnection *

The connection object that owns this channel manager.

Owner: TpSimplePasswordManager

Flags: Read / Write / Construct Only

telepathy-glib-0.24.2/docs/reference/html/right.png0000644000175000017500000000040514006623343017107 00000000000000PNG  IHDRabKGD pHYs B(xtIME!GIDAT8үa?MIdEr,-hAIl ry}sX6 !9#D r$-Br$G"$;WZ&!cq \`軀O=QoufIENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-protocol.html0000644000175000017500000005743414006623344023533 00000000000000 Service-side Protocol interface: telepathy-glib API Reference Manual

Service-side Protocol interface

Service-side Protocol interface — GInterface for Telepathy Protocol objects

Object Hierarchy

    GInterface
    ├── TpSvcProtocol
    ├── TpSvcProtocolInterfaceAddressing
    ├── TpSvcProtocolInterfaceAvatars
    ╰── TpSvcProtocolInterfacePresence

Known Implementations

TpSvcProtocol is implemented by TpBaseProtocol.

TpSvcProtocolInterfaceAddressing is implemented by TpBaseProtocol.

TpSvcProtocolInterfacePresence is implemented by TpBaseProtocol.

TpSvcProtocolInterfaceAvatars is implemented by TpBaseProtocol.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The TpSvcProtocol interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy Protocol interface.

Functions

tp_svc_protocol_identify_account_impl ()

void
(*tp_svc_protocol_identify_account_impl)
                               (TpSvcProtocol *self,
                                GHashTable *in_Parameters,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method IdentifyAccount on interface org.freedesktop.Telepathy.Protocol.

Parameters

self

The object implementing this interface

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_protocol_implement_identify_account ()

void
tp_svc_protocol_implement_identify_account
                               (TpSvcProtocolClass *klass,
                                tp_svc_protocol_identify_account_impl impl);

Register an implementation for the IdentifyAccount method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the IdentifyAccount D-Bus method

 

tp_svc_protocol_implement_normalize_contact ()

void
tp_svc_protocol_implement_normalize_contact
                               (TpSvcProtocolClass *klass,
                                tp_svc_protocol_normalize_contact_impl impl);

Register an implementation for the NormalizeContact method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the NormalizeContact D-Bus method

 

tp_svc_protocol_normalize_contact_impl ()

void
(*tp_svc_protocol_normalize_contact_impl)
                               (TpSvcProtocol *self,
                                const gchar *in_Contact_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method NormalizeContact on interface org.freedesktop.Telepathy.Protocol.

Parameters

self

The object implementing this interface

 

in_Contact_ID

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_protocol_return_from_identify_account ()

void
tp_svc_protocol_return_from_identify_account
                               (DBusGMethodInvocation *context,
                                const gchar *out_Account_ID);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Account_ID

const gchar * (FIXME, generate documentation)

 

tp_svc_protocol_return_from_normalize_contact ()

void
tp_svc_protocol_return_from_normalize_contact
                               (DBusGMethodInvocation *context,
                                const gchar *out_Normalized_Contact_ID);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Normalized_Contact_ID

const gchar * (FIXME, generate documentation)

 

Types and Values

TpSvcProtocol

typedef struct _TpSvcProtocol TpSvcProtocol;

Dummy typedef representing any implementation of this interface.


TpSvcProtocolClass

typedef struct _TpSvcProtocolClass TpSvcProtocolClass;

The class of TpSvcProtocol.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_protocol (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_protocol_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (identify_account);
  IMPLEMENT (normalize_contact);
#undef IMPLEMENT
}

TpSvcProtocolInterfaceAddressing

typedef struct _TpSvcProtocolInterfaceAddressing TpSvcProtocolInterfaceAddressing;

Dummy typedef representing any implementation of this interface.


TpSvcProtocolInterfaceAddressingClass

typedef struct _TpSvcProtocolInterfaceAddressingClass TpSvcProtocolInterfaceAddressingClass;

The class of TpSvcProtocolInterfaceAddressing.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_protocol_interface_addressing (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_protocol_interface_addressing_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (normalize_vcard_address);
  IMPLEMENT (normalize_contact_uri);
#undef IMPLEMENT
}

TpSvcProtocolInterfacePresence

typedef struct _TpSvcProtocolInterfacePresence TpSvcProtocolInterfacePresence;

Dummy typedef representing any implementation of this interface.


TpSvcProtocolInterfacePresenceClass

typedef struct _TpSvcProtocolInterfacePresenceClass TpSvcProtocolInterfacePresenceClass;

The class of TpSvcProtocolInterfacePresence. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcProtocolInterfaceAvatars

typedef struct _TpSvcProtocolInterfaceAvatars TpSvcProtocolInterfaceAvatars;

Dummy typedef representing any implementation of this interface.


TpSvcProtocolInterfaceAvatarsClass

typedef struct _TpSvcProtocolInterfaceAvatarsClass TpSvcProtocolInterfaceAvatarsClass;

The class of TpSvcProtocolInterfaceAvatars. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

See Also

TpBaseProtocol

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-service-point.html0000644000175000017500000004772414006623344024436 00000000000000 Connection and Channel ServicePoint interfaces: telepathy-glib API Reference Manual

Connection and Channel ServicePoint interfaces

Connection and Channel ServicePoint interfaces — client-side wrappers for the ServicePoint interfaces

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In some protocols, mainly those that interact with the PSTN, it's possible to contact the emergency services or other public service answering points. The ServicePoint interfaces on the Connection and Channel can be used to discover how to contact these service points, and detect whether a call in progress is communicating with a service point.

This section documents the auto-generated C wrappers for the ServicePoint interfaces, used with TpConnection and TpChannel objects.

Functions

tp_cli_channel_interface_service_point_connect_to_service_point_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_service_point_connect_to_service_point_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_service_point_signal_callback_service_point_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ServicePointChanged.

<p>Emitted when a channel changes the service point that it's connected to. This might be a new call being connected to a service, a call connected to a service being routed to a different service (ie, an emergency call being routed from a generic emergency PSAP to a poison control PSAP), or any number of other things.</p> <p>Note that this should be emitted as soon as the CM has been notified of the switch, and has updated its internal state. The CM MAY still be in the process of connecting to the new service point.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_service_point_signal_callback_service_point_changed ()

void
(*tp_cli_channel_interface_service_point_signal_callback_service_point_changed)
                               (TpChannel *proxy,
                                const GValueArray *arg_Service_Point,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ServicePointChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_service_point_connect_to_service_point_changed() was called

 

arg_Service_Point

The new service point that is being used.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_service_point_connect_to_service_points_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_service_point_connect_to_service_points_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_service_point_signal_callback_service_points_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ServicePointsChanged.

Emitted when the list of known service points (or their IDs) has changed.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_service_point_signal_callback_service_points_changed ()

void
(*tp_cli_connection_interface_service_point_signal_callback_service_points_changed)
                               (TpConnection *proxy,
                                const GPtrArray *arg_Service_Points,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ServicePointsChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_service_point_connect_to_service_points_changed() was called

 

arg_Service_Points

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The new value of <tp:member-ref>KnownServicePoints</tp:member-ref>.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/TpBaseChannel.html0000644000175000017500000021631514006623343020632 00000000000000 TpBaseChannel: telepathy-glib API Reference Manual

TpBaseChannel

TpBaseChannel — base class for TpExportableChannel implementations

Properties

TpBaseConnection * connection Read / Write / Construct Only
guint initiator-handle Read / Write / Construct Only
gchar * initiator-id Read
GStrv interfaces Read
gboolean requested Read / Write / Construct Only
gchar * target-id Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseChannel
        ├── TpBaseCallChannel
        ╰── TpBasePasswordChannel

Implemented Interfaces

TpBaseChannel implements TpSvcDBusProperties, TpSvcChannel, TpChannelIface and TpExportableChannel.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpExportableChannel implementations by implementing some of its properties, and defining other relevant properties.

Subclasses should fill in TpBaseChannelClass.channel_type and TpBaseChannelClass.target_handle_type; and implement the TpBaseChannelClass.get_interfaces and TpBaseChannelClass.close virtual functions.

If the channel type and/or interfaces being implemented define immutable D-Bus properties besides those on the Channel interface, the subclass should implement the TpBaseChannelClass.fill_immutable_properties virtual function.

If the “object-path” property is not set at construct time, the TpBaseChannelClass.get_object_path_suffix virtual function will be called to determine the channel's path, whose default implementation simply generates a unique path based on the object's address in memory.

TpBaseChannel also has the ability to remove the channel from the bus, but keep the object around. To close the channel and remove it from the bus, subclasses should call tp_base_channel_disappear(). To bring the channel back, subclasses use tp_base_channel_reopened_with_requested() and the channel should be re-announced with tp_channel_manager_emit_new_channel(). Note that channels which can disappear but can also reopen due to pending messages need special casing by the channel manager:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
static void
channel_closed_cb (TpBaseChannel *chan,
    TpChannelManager *manager)
{
  MyChannelManager *self = MY_CHANNEL_MANAGER (manager);
  TpHandle handle = tp_base_channel_get_target_handle (chan);

  // first, emit ChannelClosed if the channel is registered (it
  // won't be registered if it is appearing from being hidden, so
  // let's not emit the signal in this case)
  if (tp_base_channel_is_registered (chan))
    {
      tp_channel_manager_emit_channel_closed (manager,
          TP_EXPORTABLE_CHANNEL (chan));
    }

  if (tp_base_channel_is_destroyed (chan))
    {
      // destroyed() must have been called; forget this channel
      g_hash_table_remove (self->priv->channels, handle);
    }
  else if (tp_base_channel_is_respawning (chan))
    {
      // reopened_with_requested() must have been called; re-announce the channel
      tp_channel_manager_emit_new_channel (manager, TP_EXPORTABLE_CHANNEL (chan));
    }
  else
    {
      // disappear() must have been called, do nothing special
    }
}

and the TpChannelManagerIface.foreach_channel virtual function should be updated to only include registered channels:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
static void
foreach_channel (TpChannelManager *manager,
    TpChannelManagerChannelClassFunc func,
    gpointer user_data)
{
  MyChannelManager *self = MY_CHANNEL_MANAGER (manager);
  GHashTableIter iter;
  gpointer chan;

  g_hash_table_iter_init (&iter, self->priv->channels);
  while (g_hash_table_iter_next (&iter, NULL, &chan))
    {
      if (tp_base_channel_is_registered (TP_BASE_CHANNEL (chan)))
        func (TP_EXPORTABLE_CHANNEL (chan), user_data);
    }
}

Functions

TpBaseChannelFillPropertiesFunc ()

void
(*TpBaseChannelFillPropertiesFunc) (TpBaseChannel *chan,
                                    GHashTable *properties);

Signature of an implementation of the TpBaseChannelClass.fill_immutable_properties virtual function. A typical implementation, for a channel implementing TpSvcChannelTypeContactSearch, would be:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
static void
my_search_channel_fill_properties (
    TpBaseChannel *chan,
    GHashTable *properties)
{
  TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS (my_search_channel_parent_class);

  klass->fill_immutable_properties (chan, properties);

  tp_dbus_properties_mixin_fill_properties_hash (
      G_OBJECT (chan), properties,
      TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "Limit",
      TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "AvailableSearchKeys",
      TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "Server",
      NULL);
}

Note that the SearchState property is not added to properties , since only immutable properties (whose value cannot change over the lifetime of chan ) should be included.

Parameters

chan

a channel

 

properties

a dictionary of chan 's immutable properties, which the implementation may add to using tp_dbus_properties_mixin_fill_properties_hash()

 

Since: 0.11.14


TpBaseChannelCloseFunc ()

void
(*TpBaseChannelCloseFunc) (TpBaseChannel *chan);

Signature of an implementation of the TpBaseChannelClass.close virtual function. Implementations should eventually call either tp_base_channel_destroyed() if the channel is really closed as a result, or tp_base_channel_reopened() if the channel will be re-spawned (for instance, due to unacknowledged messages on a text channel), but need not do so before returning. Note that channels that support re-spawning must also implement TpSvcChannelInterfaceDestroyable.

Implementations may assume that tp_base_channel_is_destroyed() is FALSE for chan when called. Note that if this function is implemented asynchronously, it may be called more than once. A subclass which needs to perform some asynchronous clean-up in order to close might implement this function as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
static void
my_channel_close (TpBaseChannel *chan)
{
  MyChannel *self = MY_CHANNEL (chan);

  if (self->priv->closing)
    return;

  self->priv->closing = TRUE;

  // some hypothetical channel-specific clean-up function:
  clean_up (self, cleaned_up_cb);
}

static void
cleaned_up_cb (MyChannel *self)
{
  // all done, we can finish closing now
  tp_base_channel_destroyed (TP_BASE_CHANNEL (self));
}
static void
my_channel_class_init (MyChannelClass *klass)
{
  TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass);

  klass->close = my_channel_close;
  // ...
}

If a subclass does not need to do anything to clean itself up, it may implement TpBaseChannelClass.close using tp_base_channel_destroyed() directly:

1
2
3
4
5
6
7
8
static void
my_channel_class_init (MyChannelClass *klass)
{
  TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass);

  klass->close = tp_base_channel_destroyed;
  // ...
}

Parameters

chan

a channel

 

Since: 0.11.14


TpBaseChannelGetPathFunc ()

gchar *
(*TpBaseChannelGetPathFunc) (TpBaseChannel *chan);

Signature of an implementation of the TpBaseChannelClass.get_object_path_suffix virtual function.

Parameters

chan

a channel

 

Returns

a string that will be appended to the Connection objects's object path to get the Channel's object path.

[transfer full]

Since: 0.11.14


TpBaseChannelGetInterfacesFunc ()

GPtrArray *
(*TpBaseChannelGetInterfacesFunc) (TpBaseChannel *chan);

Signature of an implementation of TpBaseChannelClass.get_interfaces virtual function.

Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.

1
2
3
4
5
6
7
8
9
10
11
static GPtrArray *
my_channel_get_interfaces (TpBaseChannel *self)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_CHANNEL_CLASS (my_channel_parent_class)->get_interfaces (self);

  g_ptr_array_add (interfaces, TP_IFACE_BADGERS);

  return interfaces;
}

Parameters

chan

a channel

 

Returns

a GPtrArray of static strings for D-Bus interfaces implemented by this client.

[transfer container]

Since: 0.17.5


tp_base_channel_register ()

void
tp_base_channel_register (TpBaseChannel *chan);

Make the channel appear on the bus. “object-path” must have been set to a valid path, which must not already be in use as another object's path.

Parameters

chan

a channel

 

Since: 0.11.14


tp_base_channel_close ()

void
tp_base_channel_close (TpBaseChannel *chan);

Asks chan to close, just as if the Close D-Bus method had been called. If “channel-destroyed” is TRUE, this is a no-op.

Note that, depending on the subclass's implementation of TpBaseChannelClass.close and internal behaviour, this may or may not be a suitable method to use during connection teardown. For instance, if the channel may respawn when Close is called, an equivalent of the Destroy D-Bus method would be more appropriate during teardown, since the intention is to forcibly terminate all channels.

Parameters

chan

a channel

 

Since: 0.11.14


tp_base_channel_destroyed ()

void
tp_base_channel_destroyed (TpBaseChannel *chan);

Called by subclasses to indicate that this channel was destroyed and can be removed from the bus. The "Closed" signal will be emitted and the “channel-destroyed” property will be set.

Parameters

chan

a channel

 

Since: 0.11.14


tp_base_channel_reopened ()

void
tp_base_channel_reopened (TpBaseChannel *chan,
                          TpHandle initiator);

Called by subclasses to indicate that this channel was closed but was re-opened due to pending messages.

Calling this method is the same as calling tp_base_channel_reopened_with_requested() with a requested value of FALSE.

Parameters

chan

a channel

 

initiator

the handle of the contact that re-opened the channel

 

Since: 0.11.14


tp_base_channel_disappear ()

void
tp_base_channel_disappear (TpBaseChannel *chan);

Called by subclasses to indicate that this channel is closing and should be unregistered from the bus, but the actual object shouldn't be destroyed. The "Closed" signal will be emitted, the “channel-destroyed” property will not be set, and the channel will be unregistered from the bus.

Parameters

chan

a channel

 

Since: 0.19.7


tp_base_channel_reopened_with_requested ()

void
tp_base_channel_reopened_with_requested
                               (TpBaseChannel *chan,
                                gboolean requested,
                                TpHandle initiator);

Called by subclasses to indicate that this channel was closed but was re-opened, either due to pending messages or from having disappeared (with tp_base_channel_disappear()). The "Closed" signal will be emitted, but the “channel-destroyed” property will not be set. The channel's “initiator-handle” property will be set to initiator , and the “requested” property will be set to requested .

Parameters

chan

a channel

 

requested

TRUE if the channel is requested, otherwise FALSE

 

initiator

the handle of the contact that re-opened the channel

 

Since: 0.19.7


tp_base_channel_get_object_path ()

const gchar *
tp_base_channel_get_object_path (TpBaseChannel *chan);

Returns chan 's object path, as a shortcut for retrieving the “object-path” property.

Parameters

chan

a channel

 

Returns

chan 's object path.

[transfer none]

Since: 0.11.14


tp_base_channel_get_connection ()

TpBaseConnection *
tp_base_channel_get_connection (TpBaseChannel *chan);

Returns the connection to which chan is attached, as a shortcut for retrieving the “connection” property.

Parameters

chan

a channel

 

Returns

the connection to which chan is attached.

[transfer none]

Since: 0.11.14


tp_base_channel_get_self_handle ()

TpHandle
tp_base_channel_get_self_handle (TpBaseChannel *chan);

If chan has a TpGroupMixin, returns the value of group's self handle. Otherwise return the value of “self-handle”.

Parameters

chan

a channel

 

Returns

the self handle of chan

Since: 0.17.5


tp_base_channel_get_target_handle ()

TpHandle
tp_base_channel_get_target_handle (TpBaseChannel *chan);

Returns the target handle of chan (without a reference), which will be 0 if TpBaseChannelClass.target_handle_type is TP_HANDLE_TYPE_NONE for this class, and non-zero otherwise. This is a shortcut for retrieving the “handle” property.

Parameters

chan

a channel

 

Returns

the target handle of chan

Since: 0.11.14


tp_base_channel_get_initiator ()

TpHandle
tp_base_channel_get_initiator (TpBaseChannel *chan);

Returns the initiator handle of chan , as a shortcut for retrieving the “initiator-handle” property.

Parameters

chan

a channel

 

Returns

the initiator handle of chan

Since: 0.11.14


tp_base_channel_is_requested ()

gboolean
tp_base_channel_is_requested (TpBaseChannel *chan);

Returns whether or not chan was requested, as a shortcut for retrieving the “requested” property.

Parameters

chan

a channel

 

Returns

whether or not chan was requested.

Since: 0.11.14


tp_base_channel_is_registered ()

gboolean
tp_base_channel_is_registered (TpBaseChannel *chan);

Returns whether or not chan is visible on the bus; that is, whether tp_base_channel_register() has been called and tp_base_channel_destroyed() has not been called.

Parameters

chan

a channel

 

Returns

TRUE if chan is visible on the bus

Since: 0.11.14


tp_base_channel_is_destroyed ()

gboolean
tp_base_channel_is_destroyed (TpBaseChannel *chan);

Returns the value of the “channel-destroyed” property, which is TRUE if tp_base_channel_destroyed() has been called (and thus the channel has been removed from the bus).

Parameters

chan

a channel

 

Returns

TRUE if tp_base_channel_destroyed() has been called.

Since: 0.11.14


tp_base_channel_is_respawning ()

gboolean
tp_base_channel_is_respawning (TpBaseChannel *chan);

Returns TRUE if the channel has been reopened, either by a subclass calling tp_base_channel_reopened() or tp_base_channel_reopened_with_requested(). This is useful for "closed" handlers to distinguish between channels really closing and channels that have been reopened due to pending messages.

Parameters

chan

a channel

 

Since: 0.19.7

Types and Values

struct TpBaseChannel

struct TpBaseChannel;

A base class for channel implementations

Since: 0.11.14


struct TpBaseChannelClass

struct TpBaseChannelClass {
  TpDBusPropertiesMixinClass dbus_props_class;

  const gchar *channel_type;
  TpHandleType target_handle_type;

  TpBaseChannelCloseFunc close;
  TpBaseChannelFillPropertiesFunc fill_immutable_properties;
  TpBaseChannelGetPathFunc get_object_path_suffix;
  TpBaseChannelGetInterfacesFunc get_interfaces;
};

The class structure for TpBaseChannel

Members

TpDBusPropertiesMixinClass dbus_props_class;

The class structure for the DBus properties mixin

 

const gchar *channel_type;

The type of channel that instances of this class represent (e.g. TP_IFACE_CHANNEL_TYPE_TEXT)

 

TpHandleType target_handle_type;

The type of handle that is the target of channels of this type

 

TpBaseChannelCloseFunc close;

A virtual function called to close the channel, which will be called by tp_base_channel_close() and by the implementation of the Closed D-Bus method.

 

TpBaseChannelFillPropertiesFunc fill_immutable_properties;

A virtual function called to add custom properties to the DBus properties hash. Implementations must chain up to the parent class implementation and call tp_dbus_properties_mixin_fill_properties_hash() on the supplied hash table

 

TpBaseChannelGetPathFunc get_object_path_suffix;

Returns a string that will be appended to the Connection objects's object path to get the Channel's object path. This function will only be called as a fallback if the “object-path” property is not set. The default implementation simply generates a unique path based on the object's address in memory. The returned string will be freed automatically.

 

TpBaseChannelGetInterfacesFunc get_interfaces;

Extra interfaces provided by this channel (this SHOULD NOT include the channel type and interface itself). Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray. Replaces interfaces .

 

Since: 0.11.14

Property Details

The “connection” property

  “connection”               TpBaseConnection *

Connection object that owns this channel.

Owner: TpBaseChannel

Flags: Read / Write / Construct Only


The “initiator-handle” property

  “initiator-handle”         guint

The contact who initiated the channel.

Owner: TpBaseChannel

Flags: Read / Write / Construct Only

Default value: 0


The “initiator-id” property

  “initiator-id”             gchar *

The string obtained by inspecting the initiator-handle.

Owner: TpBaseChannel

Flags: Read

Default value: NULL


The “interfaces” property

  “interfaces”               GStrv

Additional Channel.Interface.* interfaces.

Owner: TpBaseChannel

Flags: Read


The “requested” property

  “requested”                gboolean

True if this channel was requested by the local user.

Owner: TpBaseChannel

Flags: Read / Write / Construct Only

Default value: FALSE


The “target-id” property

  “target-id”                gchar *

The string obtained by inspecting the target handle.

Owner: TpBaseChannel

Flags: Read

Default value: NULL

See Also

TpSvcChannel

telepathy-glib-0.24.2/docs/reference/html/ch-dbus.html0000644000175000017500000000666614006623343017516 00000000000000 General D-Bus support: telepathy-glib API Reference Manual

General D-Bus support

TpProxy — base class for Telepathy client proxy objects
TpProxy D-Bus core methods — The D-Bus Introspectable, Peer and Properties interfaces
TpProxy Telepathy Properties — The Telepathy Properties interface
D-Bus utilities — some D-Bus utility functions
Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in dbus-glib by a GHashTable from string to GValue
GVariant utilities — some GVariant utility functions
Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in GVariant by a G_VARIANT_TYPE_VARDICT
TpProxy subclasses and mixins — Providing extra functionality for a TpProxy or subclass, or subclassing it
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-call-stream.html0000644000175000017500000052502014006623344024041 00000000000000 Channel Call stream interfaces: telepathy-glib API Reference Manual

Channel Call stream interfaces

Channel Call stream interfaces — client-side wrappers for call streams

Functions

TpProxyPendingCall * tp_cli_call_stream_call_request_receiving ()
TpProxyPendingCall * tp_cli_call_stream_call_set_sending ()
void (*tp_cli_call_stream_callback_for_request_receiving) ()
void (*tp_cli_call_stream_callback_for_set_sending) ()
TpProxySignalConnection * tp_cli_call_stream_connect_to_local_sending_state_changed ()
TpProxySignalConnection * tp_cli_call_stream_connect_to_remote_members_changed ()
void (*tp_cli_call_stream_signal_callback_local_sending_state_changed) ()
void (*tp_cli_call_stream_signal_callback_remote_members_changed) ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_add_candidates ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_complete_receiving_state_change ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_complete_sending_state_change ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_fail ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_finish_initial_candidates ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_report_receiving_failure ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_report_sending_failure ()
TpProxyPendingCall * tp_cli_call_stream_interface_media_call_set_credentials ()
void (*tp_cli_call_stream_interface_media_callback_for_add_candidates) ()
void (*tp_cli_call_stream_interface_media_callback_for_complete_receiving_state_change) ()
void (*tp_cli_call_stream_interface_media_callback_for_complete_sending_state_change) ()
void (*tp_cli_call_stream_interface_media_callback_for_fail) ()
void (*tp_cli_call_stream_interface_media_callback_for_finish_initial_candidates) ()
void (*tp_cli_call_stream_interface_media_callback_for_report_receiving_failure) ()
void (*tp_cli_call_stream_interface_media_callback_for_report_sending_failure) ()
void (*tp_cli_call_stream_interface_media_callback_for_set_credentials) ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_endpoints_changed ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_ice_restart_requested ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_local_candidates_added ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_local_credentials_changed ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_receiving_state_changed ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_relay_info_changed ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_sending_state_changed ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_server_info_retrieved ()
TpProxySignalConnection * tp_cli_call_stream_interface_media_connect_to_stun_servers_changed ()
void (*tp_cli_call_stream_interface_media_signal_callback_endpoints_changed) ()
void (*tp_cli_call_stream_interface_media_signal_callback_ice_restart_requested) ()
void (*tp_cli_call_stream_interface_media_signal_callback_local_candidates_added) ()
void (*tp_cli_call_stream_interface_media_signal_callback_local_credentials_changed) ()
void (*tp_cli_call_stream_interface_media_signal_callback_receiving_state_changed) ()
void (*tp_cli_call_stream_interface_media_signal_callback_relay_info_changed) ()
void (*tp_cli_call_stream_interface_media_signal_callback_sending_state_changed) ()
void (*tp_cli_call_stream_interface_media_signal_callback_server_info_retrieved) ()
void (*tp_cli_call_stream_interface_media_signal_callback_stun_servers_changed) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Represents the streams of a call.

Functions

tp_cli_call_stream_call_request_receiving ()

TpProxyPendingCall *
tp_cli_call_stream_call_request_receiving
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                gboolean in_Receive,
                                tp_cli_call_stream_callback_for_request_receiving callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestReceiving method call.

<p>Request that a remote contact stops or starts sending on this stream.</p> <p>The <tp:member-ref>CanRequestReceiving</tp:member-ref> property defines whether the protocol allows the local user to request the other side start sending on this stream.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Contact from which sending is requested</p> (TpContactHandle)

 

in_Receive

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If true, request that the given contact starts to send media. If false, request that the given contact stops sending media.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_call_set_sending ()

TpProxyPendingCall *
tp_cli_call_stream_call_set_sending (TpCallStream *proxy,
                                     gint timeout_ms,
                                     gboolean in_Send,
                                     tp_cli_call_stream_callback_for_set_sending callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy,
                                     GObject *weak_object);

Start a SetSending method call.

Set the stream to start or stop sending media from the local user to other contacts.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Send

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If True, the <tp:member-ref>LocalSendingState</tp:member-ref> should change to <tp:value-ref type="Sending_State">Sending</tp:value-ref>, if it isn't already.</p> <p>If False, the <tp:member-ref>LocalSendingState</tp:member-ref> should change to <tp:value-ref type="Sending_State">None</tp:value-ref>, if it isn't already.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_callback_for_request_receiving ()

void
(*tp_cli_call_stream_callback_for_request_receiving)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestReceiving method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_callback_for_set_sending ()

void
(*tp_cli_call_stream_callback_for_set_sending)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetSending method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_connect_to_local_sending_state_changed ()

TpProxySignalConnection *
tp_cli_call_stream_connect_to_local_sending_state_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_signal_callback_local_sending_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocalSendingStateChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Emitted when <tp:member-ref>LocalSendingState</tp:member-ref> changes.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_connect_to_remote_members_changed ()

TpProxySignalConnection *
tp_cli_call_stream_connect_to_remote_members_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_signal_callback_remote_members_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RemoteMembersChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Emitted when <tp:member-ref>RemoteMembers</tp:member-ref> changes.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_signal_callback_local_sending_state_changed ()

void
(*tp_cli_call_stream_signal_callback_local_sending_state_changed)
                               (TpCallStream *proxy,
                                guint arg_State,
                                const GValueArray *arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocalSendingStateChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_connect_to_local_sending_state_changed() was called

 

arg_State

The new value of <tp:member-ref>LocalSendingState</tp:member-ref>. (TpSendingState)

 

arg_Reason

A structured reason for the change.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_signal_callback_remote_members_changed ()

void
(*tp_cli_call_stream_signal_callback_remote_members_changed)
                               (TpCallStream *proxy,
                                GHashTable *arg_Updates,
                                GHashTable *arg_Identifiers,
                                const GArray *arg_Removed,
                                const GValueArray *arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RemoteMembersChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_connect_to_remote_members_changed() was called

 

arg_Updates

A mapping from channel-specific handles to their updated sending state, whose keys include at least the members who were added, and the members whose states changed.

 

arg_Identifiers

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The identifiers of the contacts in the <var>Updates</var> map.

 

arg_Removed

The channel-specific handles that were removed from the keys of the <tp:member-ref>RemoteMembers</tp:member-ref> property, as a result of the contact leaving this stream

 

arg_Reason

A structured reason for the change.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_call_add_candidates ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_add_candidates
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Candidates,
                                tp_cli_call_stream_interface_media_callback_for_add_candidates callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddCandidates method call.

Add candidates to the <tp:member-ref>LocalCandidates</tp:member-ref> property and signal them to the remote contact(s). Note that connection managers MAY delay the sending of candidates until <tp:member-ref>FinishInitialCandidates</tp:member-ref> is called.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Candidates

Used to pass an 'in' argument: The candidates to be added.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_complete_receiving_state_change ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_complete_receiving_state_change
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                guint in_State,
                                tp_cli_call_stream_interface_media_callback_for_complete_receiving_state_change callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CompleteReceivingStateChange method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called in response to <tp:member-ref>ReceivingStateChanged</tp:member-ref>(Pending_*, *) to indicate that the media state has successfully progressed from Pending_{Start, Stop, Pause} to the corresponding non-pending state.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_State

Used to pass an 'in' argument: The new (non-pending) value of ReceivingState. (TpStreamFlowState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_complete_sending_state_change ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_complete_sending_state_change
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                guint in_State,
                                tp_cli_call_stream_interface_media_callback_for_complete_sending_state_change callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CompleteSendingStateChange method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called in response to <tp:member-ref>SendingStateChanged</tp:member-ref>(Pending_*, *) to indicate that the media state has successfully progressed from Pending_{Start, Stop, Pause} to the corresponding non-pending state.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_State

Used to pass an 'in' argument: The new (non-pending) value of SendingState. (TpStreamFlowState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_fail ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_fail
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                const GValueArray *in_Reason,
                                tp_cli_call_stream_interface_media_callback_for_fail callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Fail method call.

Signal an unrecoverable error for this stream, and remove it. If all streams are removed from a content, then it will also be removed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: A structured reason for stream removal.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_finish_initial_candidates ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_finish_initial_candidates
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                tp_cli_call_stream_interface_media_callback_for_finish_initial_candidates callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a FinishInitialCandidates method call.

This indicates to the CM that the initial batch of candidates has been added, and should now be processed/sent to the remote side. <tp:rationale> Protocols supporting Raw UDP SHOULD wait for FinishInitialCandidates, and then set the lowest priority candidate as the Raw UDP candidate. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_report_receiving_failure ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_report_receiving_failure
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                guint in_Reason,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                tp_cli_call_stream_interface_media_callback_for_report_receiving_failure callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ReportReceivingFailure method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Can be called at any point to indicate a failure in the incoming portion of the stream.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: (Undocumented) (TpCallStateChangeReason)

 

in_Error

Used to pass an 'in' argument: (Undocumented)

 

in_Message

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_report_sending_failure ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_report_sending_failure
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                guint in_Reason,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                tp_cli_call_stream_interface_media_callback_for_report_sending_failure callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ReportSendingFailure method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Can be called at any point to indicate a failure in the outgoing portion of the stream.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: (Undocumented) (TpCallStateChangeReason)

 

in_Error

Used to pass an 'in' argument: (Undocumented)

 

in_Message

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_call_set_credentials ()

TpProxyPendingCall *
tp_cli_call_stream_interface_media_call_set_credentials
                               (TpCallStream *proxy,
                                gint timeout_ms,
                                const gchar *in_Username,
                                const gchar *in_Password,
                                tp_cli_call_stream_interface_media_callback_for_set_credentials callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetCredentials method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Used to set the username fragment and password for streams that have global credentials.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Username

Used to pass an 'in' argument: The username to use when authenticating on the stream.

 

in_Password

Used to pass an 'in' argument: The password to use when authenticating on the stream.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_interface_media_callback_for_add_candidates ()

void
(*tp_cli_call_stream_interface_media_callback_for_add_candidates)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddCandidates method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_complete_receiving_state_change ()

void
(*tp_cli_call_stream_interface_media_callback_for_complete_receiving_state_change)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CompleteReceivingStateChange method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_complete_sending_state_change ()

void
(*tp_cli_call_stream_interface_media_callback_for_complete_sending_state_change)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CompleteSendingStateChange method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_fail ()

void
(*tp_cli_call_stream_interface_media_callback_for_fail)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Fail method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_finish_initial_candidates ()

void
(*tp_cli_call_stream_interface_media_callback_for_finish_initial_candidates)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a FinishInitialCandidates method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_report_receiving_failure ()

void
(*tp_cli_call_stream_interface_media_callback_for_report_receiving_failure)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReportReceivingFailure method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_report_sending_failure ()

void
(*tp_cli_call_stream_interface_media_callback_for_report_sending_failure)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReportSendingFailure method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_callback_for_set_credentials ()

void
(*tp_cli_call_stream_interface_media_callback_for_set_credentials)
                               (TpCallStream *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetCredentials method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_interface_media_connect_to_endpoints_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_endpoints_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_endpoints_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal EndpointsChanged.

Emitted when the <tp:member-ref>Endpoints</tp:member-ref> property changes.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_ice_restart_requested ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_ice_restart_requested
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_ice_restart_requested callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ICERestartRequested.

Emitted when the remote side requests an ICE restart (e.g. third party call control, when the remote endpoint changes). The streaming implementation should call <tp:member-ref>SetCredentials</tp:member-ref> again.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_local_candidates_added ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_local_candidates_added
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_local_candidates_added callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocalCandidatesAdded.

Emitted when local candidates are added to the <tp:member-ref>LocalCandidates</tp:member-ref> property.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_local_credentials_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_local_credentials_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_local_credentials_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocalCredentialsChanged.

Emitted when the value of <tp:member-ref>LocalCredentials</tp:member-ref> changes to a non-empty value. This should only happen when the streaming implementation calls <tp:member-ref>SetCredentials</tp:member-ref>, so this signal is mostly useful for debugging.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_receiving_state_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_receiving_state_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_receiving_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ReceivingStateChanged.

Change notification for <tp:member-ref>ReceivingState</tp:member-ref>.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_relay_info_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_relay_info_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_relay_info_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RelayInfoChanged.

Emitted when the value of <tp:member-ref>RelayInfo</tp:member-ref> changes.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_sending_state_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_sending_state_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_sending_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SendingStateChanged.

Change notification for <tp:member-ref>SendingState</tp:member-ref>. Note that this information is duplicated onto the Stream interface, so that UIs can ignore the Media interface, and streaming implementations can ignore everything but the media interface.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_server_info_retrieved ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_server_info_retrieved
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_server_info_retrieved callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ServerInfoRetrieved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Signals that the initial information about STUN and Relay servers has been retrieved, i.e. the <tp:member-ref>HasServerInfo</tp:member-ref> property is now true.</p>

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_connect_to_stun_servers_changed ()

TpProxySignalConnection *
tp_cli_call_stream_interface_media_connect_to_stun_servers_changed
                               (TpCallStream *proxy,
                                tp_cli_call_stream_interface_media_signal_callback_stun_servers_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal STUNServersChanged.

Emitted when the value of <tp:member-ref>STUNServers</tp:member-ref> changes.

Parameters

proxy

A TpCallStream or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_interface_media_signal_callback_endpoints_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_endpoints_changed)
                               (TpCallStream *proxy,
                                const GPtrArray *arg_Endpoints_Added,
                                const GPtrArray *arg_Endpoints_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal EndpointsChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_endpoints_changed() was called

 

arg_Endpoints_Added

Endpoints that were added.

 

arg_Endpoints_Removed

Endpoints that no longer exist.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_ice_restart_requested ()

void
(*tp_cli_call_stream_interface_media_signal_callback_ice_restart_requested)
                               (TpCallStream *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ICERestartRequested.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_ice_restart_requested() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_local_candidates_added ()

void
(*tp_cli_call_stream_interface_media_signal_callback_local_candidates_added)
                               (TpCallStream *proxy,
                                const GPtrArray *arg_Candidates,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocalCandidatesAdded.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_local_candidates_added() was called

 

arg_Candidates

Candidates that have been added.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_local_credentials_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_local_credentials_changed)
                               (TpCallStream *proxy,
                                const gchar *arg_Username,
                                const gchar *arg_Password,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocalCredentialsChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_local_credentials_changed() was called

 

arg_Username

.

[Undocumented]

arg_Password

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_receiving_state_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_receiving_state_changed)
                               (TpCallStream *proxy,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ReceivingStateChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_receiving_state_changed() was called

 

arg_State

The new value of ReceivingState. (TpStreamFlowState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_relay_info_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_relay_info_changed)
                               (TpCallStream *proxy,
                                const GPtrArray *arg_Relay_Info,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RelayInfoChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_relay_info_changed() was called

 

arg_Relay_Info

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_sending_state_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_sending_state_changed)
                               (TpCallStream *proxy,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SendingStateChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_sending_state_changed() was called

 

arg_State

The new value of SendingState. (TpStreamFlowState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_server_info_retrieved ()

void
(*tp_cli_call_stream_interface_media_signal_callback_server_info_retrieved)
                               (TpCallStream *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ServerInfoRetrieved.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_server_info_retrieved() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_interface_media_signal_callback_stun_servers_changed ()

void
(*tp_cli_call_stream_interface_media_signal_callback_stun_servers_changed)
                               (TpCallStream *proxy,
                                const GPtrArray *arg_Servers,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal STUNServersChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_interface_media_connect_to_stun_servers_changed() was called

 

arg_Servers

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-cellular.html0000644000175000017500000002623014006623344025027 00000000000000 Connection Cellular interface: telepathy-glib API Reference Manual

Connection Cellular interface

Connection Cellular interface — client-side wrappers for the Cellular interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

An interface for connections to cellular telephony (GSM, CDMA etc.), which provides properties and signals that aren't applicable to other protocols.

Functions

tp_cli_connection_interface_cellular_connect_to_imsi_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_cellular_connect_to_imsi_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_cellular_signal_callback_imsi_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal IMSIChanged.

Emitted when the IMSI for the connection changes. This sort of thing is rare, but could happen on cellular phones that allow hot-swapping of SIM cards. In the case of SIM swapping, this signal would be emitted twice; the first time while the SIM is being ejected (with an empty string), and the second time after a new SIM has been inserted (assuming that the IMSI can be determined from the new SIM).

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_cellular_signal_callback_imsi_changed ()

void
(*tp_cli_connection_interface_cellular_signal_callback_imsi_changed)
                               (TpConnection *proxy,
                                const gchar *arg_IMSI,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal IMSIChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_cellular_connect_to_imsi_changed() was called

 

arg_IMSI

The new IMSI value. This may be an empty string in the case where the IMSI is being reset or removed.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-account.html0000644000175000017500000116703514006623343022534 00000000000000 TpAccount: telepathy-glib API Reference Manual

TpAccount

TpAccount — proxy object for an account in the Telepathy account manager

Functions

TpAccount * tp_account_new ()
void tp_account_init_known_interfaces ()
gboolean tp_account_parse_object_path ()
const gchar * tp_account_get_path_suffix ()
TpConnection * tp_account_get_connection ()
TpConnection * tp_account_ensure_connection ()
const gchar * tp_account_get_display_name ()
const gchar * tp_account_get_connection_manager ()
const gchar * tp_account_get_cm_name ()
const gchar * tp_account_get_protocol ()
const gchar * tp_account_get_protocol_name ()
const gchar * tp_account_get_icon_name ()
const gchar * tp_account_get_service ()
void tp_account_set_enabled_async ()
gboolean tp_account_set_enabled_finish ()
void tp_account_reconnect_async ()
gboolean tp_account_reconnect_finish ()
gboolean tp_account_is_enabled ()
gboolean tp_account_is_valid ()
void tp_account_update_parameters_async ()
gboolean tp_account_update_parameters_finish ()
void tp_account_update_parameters_vardict_async ()
gboolean tp_account_update_parameters_vardict_finish ()
void tp_account_remove_async ()
gboolean tp_account_remove_finish ()
void tp_account_set_display_name_async ()
gboolean tp_account_set_display_name_finish ()
void tp_account_set_icon_name_async ()
gboolean tp_account_set_icon_name_finish ()
void tp_account_set_service_async ()
gboolean tp_account_set_service_finish ()
void tp_account_request_presence_async ()
gboolean tp_account_request_presence_finish ()
void tp_account_set_automatic_presence_async ()
gboolean tp_account_set_automatic_presence_finish ()
gboolean tp_account_get_connect_automatically ()
void tp_account_set_connect_automatically_async ()
gboolean tp_account_set_connect_automatically_finish ()
gboolean tp_account_get_has_been_online ()
TpConnectionStatus tp_account_get_connection_status ()
const gchar * tp_account_get_detailed_error ()
gchar * tp_account_dup_detailed_error_vardict ()
gboolean tp_account_get_changing_presence ()
TpConnectionPresenceType tp_account_get_current_presence ()
TpConnectionPresenceType tp_account_get_requested_presence ()
TpConnectionPresenceType tp_account_get_automatic_presence ()
const GHashTable * tp_account_get_parameters ()
GVariant * tp_account_dup_parameters_vardict ()
const gchar * tp_account_get_nickname ()
void tp_account_set_nickname_async ()
gboolean tp_account_set_nickname_finish ()
const gchar * tp_account_get_normalized_name ()
const gchar * const * tp_account_get_supersedes ()
void tp_account_get_avatar_async ()
const GArray * tp_account_get_avatar_finish ()
void tp_account_set_avatar_async ()
gboolean tp_account_set_avatar_finish ()
GBinding * tp_account_bind_connection_status_to_property ()
gboolean tp_account_is_prepared ()
void tp_account_prepare_async ()
gboolean tp_account_prepare_finish ()
const gchar * const * tp_account_get_uri_schemes ()
gboolean tp_account_associated_with_uri_scheme ()
void tp_account_set_uri_scheme_association_async ()
gboolean tp_account_set_uri_scheme_association_finish ()
const gchar * tp_account_get_storage_provider ()
const GValue * tp_account_get_storage_identifier ()
GVariant * tp_account_dup_storage_identifier_variant ()
TpStorageRestrictionFlags tp_account_get_storage_restrictions ()
void tp_account_get_storage_specific_information_async ()
GHashTable * tp_account_get_storage_specific_information_finish ()
void tp_account_dup_storage_specific_information_vardict_async ()
GVariant * tp_account_dup_storage_specific_information_vardict_finish ()
void (*tp_cli_account_callback_for_reconnect) ()
TpProxyPendingCall * tp_cli_account_call_reconnect ()
void (*tp_cli_account_callback_for_remove) ()
TpProxyPendingCall * tp_cli_account_call_remove ()
void (*tp_cli_account_callback_for_update_parameters) ()
TpProxyPendingCall * tp_cli_account_call_update_parameters ()
void (*tp_cli_account_signal_callback_account_property_changed) ()
TpProxySignalConnection * tp_cli_account_connect_to_account_property_changed ()
void (*tp_cli_account_signal_callback_removed) ()
TpProxySignalConnection * tp_cli_account_connect_to_removed ()
void (*tp_cli_account_interface_avatar_signal_callback_avatar_changed) ()
TpProxySignalConnection * tp_cli_account_interface_avatar_connect_to_avatar_changed ()
void (*tp_cli_account_interface_addressing_callback_for_set_uri_scheme_association) ()
TpProxyPendingCall * tp_cli_account_interface_addressing_call_set_uri_scheme_association ()

Properties

guint automatic-presence-type Read
gchar * automatic-status Read
gchar * automatic-status-message Read
gboolean changing-presence Read
gchar * cm-name Read
gboolean connect-automatically Read
TpConnection * connection Read
gchar * connection-error Read
GHashTable * connection-error-details Read
gchar * connection-manager Read
guint connection-status Read
guint connection-status-reason Read
guint current-presence-type Read
gchar * current-status Read
gchar * current-status-message Read
gchar * display-name Read
gboolean enabled Read
gboolean has-been-online Read
gchar * icon-name Read
gchar * nickname Read
gchar * normalized-name Read
gchar * protocol Read
gchar * protocol-name Read
guint requested-presence-type Read
gchar * requested-status Read
gchar * requested-status-message Read
gchar * service Read
GValue * storage-identifier Read
GVariant * storage-identifier-variant Read
gchar * storage-provider Read
guint storage-restrictions Read
GStrv supersedes Read
GStrv uri-schemes Read
gboolean valid Read

Signals

void avatar-changed Run Last
void presence-changed Run Last
void status-changed Run Last

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpAccount

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

The Telepathy Account Manager stores the user's configured real-time communication accounts. The TpAccount object represents a stored account.

Functions

tp_account_new ()

TpAccount *
tp_account_new (TpDBusDaemon *bus_daemon,
                const gchar *object_path,
                GError **error);

tp_account_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_account() instead.

Convenience function to create a new account proxy. The returned TpAccount is not guaranteed to be ready at the point of return.

Parameters

bus_daemon

Proxy for the D-Bus daemon

 

object_path

The non-NULL object path of this account

 

error

Used to raise an error if object_path is not valid

 

Returns

a new reference to an account proxy, or NULL if object_path is not valid


tp_account_init_known_interfaces ()

void
tp_account_init_known_interfaces (void);

Ensure that the known interfaces for TpAccount have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_ACCOUNT.

Since: 0.7.32


tp_account_parse_object_path ()

gboolean
tp_account_parse_object_path (const gchar *object_path,
                              gchar **cm,
                              gchar **protocol,
                              gchar **account_id,
                              GError **error);

tp_account_parse_object_path is deprecated and should not be used in newly-written code.

Use tp_account_get_protocol() and tp_account_get_connection_manager() instead.

Validates and parses a Telepathy Account's object path, extracting the connection manager's name, the protocol, and the account's unique identifier from the path. This includes replacing underscores with hyphens in the protocol name, as defined in the Account specification.

Any of the out parameters may be NULL if not needed. If TRUE is returned, the caller is responsible for freeing the strings stored in any non-NULL out parameters, using g_free().

Parameters

object_path

a Telepathy Account's object path

 

cm

location at which to store the account's connection manager's name.

[out][transfer full]

protocol

location at which to store the account's protocol.

[out][transfer full]

account_id

location at which to store the account's unique identifier.

[out][transfer full]

error

location at which to return an error

 

Returns

TRUE if object_path was successfully parsed; FALSE and sets error otherwise.

Since: 0.9.0


tp_account_get_path_suffix ()

const gchar *
tp_account_get_path_suffix (TpAccount *account);

Returns the portion of account 's object path after the standard TP_ACCOUNT_OBJECT_PATH_BASE prefix, of the form "cm/protocol/acct". This string uniquely identifies the account.

This function is only intended to be used when printing debug messages or in tools for developer. For a string suitable for displaying to the user, see tp_account_get_display_name(). To retrieve the connection manager and protocol name parts of the object path, see tp_account_get_connection_manager() and tp_account_get_protocol(). For persistent identification of the account, use tp_proxy_get_object_path().

Parameters

account

a TpAccount

 

Returns

a suffix of account 's object path, for debugging purposes.

Since: 0.13.9


tp_account_get_connection ()

TpConnection *
tp_account_get_connection (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “connection” property.

[transfer none]

Since: 0.9.0


tp_account_ensure_connection ()

TpConnection *
tp_account_ensure_connection (TpAccount *account,
                              const gchar *path);

tp_account_ensure_connection is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_ensure_connection() instead.

Set the connection of the account by specifying the connection object path. This function does not return a new ref and it is not guaranteed that the returned TpConnection object is ready.

The use-case for this function is in a HandleChannels callback and you already know the object path for the connection, so you can let account create its TpConnection and return it for use.

Parameters

account

a TpAccount

 

path

the path to connection object for TpAccount

 

Returns

the connection of the account, or NULL if either the object path path is invalid or it is the null-value "/".

[transfer none]

Since: 0.9.0


tp_account_get_display_name ()

const gchar *
tp_account_get_display_name (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “display-name” property

Since: 0.9.0


tp_account_get_connection_manager ()

const gchar *
tp_account_get_connection_manager (TpAccount *account);

tp_account_get_connection_manager is deprecated and should not be used in newly-written code.

Use tp_account_get_cm_name() instead.

Parameters

account

a TpAccount

 

Returns

the same as the “connection-manager” property

Since: 0.9.0


tp_account_get_cm_name ()

const gchar *
tp_account_get_cm_name (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “cm-name” property

Since: 0.19.3


tp_account_get_protocol ()

const gchar *
tp_account_get_protocol (TpAccount *account);

tp_account_get_protocol is deprecated and should not be used in newly-written code.

Use tp_account_get_cm_name() instead.

Parameters

account

a TpAccount

 

Returns

the same as the “protocol” property

Since: 0.9.0


tp_account_get_protocol_name ()

const gchar *
tp_account_get_protocol_name (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “protocol-name” property

Since: 0.19.3


tp_account_get_icon_name ()

const gchar *
tp_account_get_icon_name (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “icon-name” property

Since: 0.9.0


tp_account_get_service ()

const gchar *
tp_account_get_service (TpAccount *self);

Parameters

self

an account

 

Returns

the same as the “service” property

Since: 0.11.9


tp_account_set_enabled_async ()

void
tp_account_set_enabled_async (TpAccount *account,
                              gboolean enabled,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Requests an asynchronous set of the Enabled property of account . When the operation is finished, callback will be called. You can then call tp_account_set_enabled_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

enabled

the new enabled value of account

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_set_enabled_finish ()

gboolean
tp_account_set_enabled_finish (TpAccount *account,
                               GAsyncResult *result,
                               GError **error);

Finishes an async set of the Enabled property.

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the set was successful, otherwise FALSE

Since: 0.9.0


tp_account_reconnect_async ()

void
tp_account_reconnect_async (TpAccount *account,
                            GAsyncReadyCallback callback,
                            gpointer user_data);

Requests an asynchronous reconnect of account . When the operation is finished, callback will be called. You can then call tp_account_reconnect_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_reconnect_finish ()

gboolean
tp_account_reconnect_finish (TpAccount *account,
                             GAsyncResult *result,
                             GError **error);

Finishes an async reconnect of account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the reconnect call was successful, otherwise FALSE

Since: 0.9.0


tp_account_is_enabled ()

gboolean
tp_account_is_enabled (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “enabled” property

Since: 0.9.0


tp_account_is_valid ()

gboolean
tp_account_is_valid (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “valid” property

Since: 0.9.0


tp_account_update_parameters_async ()

void
tp_account_update_parameters_async (TpAccount *account,
                                    GHashTable *parameters,
                                    const gchar **unset_parameters,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Requests an asynchronous update of parameters of account . When the operation is finished, callback will be called. You can then call tp_account_update_parameters_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

parameters

new parameters to set on account .

[element-type utf8 GObject.Value][transfer none]

unset_parameters

list of parameters to unset on account

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_update_parameters_finish ()

gboolean
tp_account_update_parameters_finish (TpAccount *account,
                                     GAsyncResult *result,
                                     gchar ***reconnect_required,
                                     GError **error);

Finishes an async update of the parameters on account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

reconnect_required

a GStrv to fill with properties that need a reconnect to take effect.

[out][array zero-terminated=1][transfer full]

error

a GError to fill

 

Returns

TRUE if the request succeeded, otherwise FALSE

Since: 0.9.0


tp_account_update_parameters_vardict_async ()

void
tp_account_update_parameters_vardict_async
                               (TpAccount *account,
                                GVariant *parameters,
                                const gchar **unset_parameters,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Requests an asynchronous update of parameters of account . When the operation is finished, callback will be called. You can then call tp_account_update_parameters_finish() to get the result of the operation.

If parameters is a floating reference (see g_variant_ref_sink()), ownership of parameters is taken by this function. This means you can pass the result of g_variant_new() or g_variant_new_parsed() directly to this function without additional reference-count management.

Parameters

account

a TpAccount

 

parameters

a variant of type G_VARIANT_TYPE_VARDICT containing new parameters to set on account .

[transfer none]

unset_parameters

list of parameters to unset on account .

[array zero-terminated=1]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.17.6


tp_account_update_parameters_vardict_finish ()

gboolean
tp_account_update_parameters_vardict_finish
                               (TpAccount *account,
                                GAsyncResult *result,
                                gchar ***reconnect_required,
                                GError **error);

Finishes an async update of the parameters on account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

reconnect_required

a GStrv to fill with properties that need a reconnect to take effect.

[out][type GStrv][transfer full]

error

a GError to fill

 

Returns

TRUE if the request succeeded, otherwise FALSE

Since: 0.17.6


tp_account_remove_async ()

void
tp_account_remove_async (TpAccount *account,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Requests an asynchronous removal of account . When the operation is finished, callback will be called. You can then call tp_account_remove_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_remove_finish ()

gboolean
tp_account_remove_finish (TpAccount *account,
                          GAsyncResult *result,
                          GError **error);

Finishes an async removal of account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.9.0


tp_account_set_display_name_async ()

void
tp_account_set_display_name_async (TpAccount *account,
                                   const gchar *display_name,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Requests an asynchronous set of the DisplayName property of account . When the operation is finished, callback will be called. You can then call tp_account_set_display_name_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

display_name

a new display name, or NULL to unset the display name

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_set_display_name_finish ()

gboolean
tp_account_set_display_name_finish (TpAccount *account,
                                    GAsyncResult *result,
                                    GError **error);

Finishes an async set of the DisplayName property.

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call was successful, otherwise FALSE

Since: 0.9.0


tp_account_set_icon_name_async ()

void
tp_account_set_icon_name_async (TpAccount *account,
                                const gchar *icon_name,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Requests an asynchronous set of the Icon property of account . When the operation is finished, callback will be called. You can then call tp_account_set_icon_name_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

icon_name

a new icon name, or NULL to unset the icon name

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_set_icon_name_finish ()

gboolean
tp_account_set_icon_name_finish (TpAccount *account,
                                 GAsyncResult *result,
                                 GError **error);

Finishes an async set of the Icon parameter.

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.9.0


tp_account_set_service_async ()

void
tp_account_set_service_async (TpAccount *self,
                              const gchar *service,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Requests an asynchronous set of the Service property on self . When the operation is finished, callback will be called. You can then call tp_account_set_service_finish() to get the result of the operation.

Parameters

self

a TpAccount

 

service

a new service name, or NULL or the empty string to unset the service name (which will result in the “service” property becoming the same as “protocol”)

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.9


tp_account_set_service_finish ()

gboolean
tp_account_set_service_finish (TpAccount *self,
                               GAsyncResult *result,
                               GError **error);

Finishes an async set of the Service parameter.

Parameters

self

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.11.9


tp_account_request_presence_async ()

void
tp_account_request_presence_async (TpAccount *account,
                                   TpConnectionPresenceType type,
                                   const gchar *status,
                                   const gchar *message,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Requests an asynchronous change of presence on account . When the operation is finished, callback will be called. You can then call tp_account_request_presence_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

type

the requested presence

 

status

a status message to set, or NULL

 

message

a message for the change, or NULL

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_request_presence_finish ()

gboolean
tp_account_request_presence_finish (TpAccount *account,
                                    GAsyncResult *result,
                                    GError **error);

Finishes an async presence change request on account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.9.0


tp_account_set_automatic_presence_async ()

void
tp_account_set_automatic_presence_async
                               (TpAccount *account,
                                TpConnectionPresenceType type,
                                const gchar *status,
                                const gchar *message,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Requests an asynchronous change of account 's automatic presence. When the operation is finished, callback will be called. You can then call tp_account_set_automatic_presence_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

type

the requested presence

 

status

a status message to set, or NULL

 

message

a message for the change, or NULL

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.8


tp_account_set_automatic_presence_finish ()

gboolean
tp_account_set_automatic_presence_finish
                               (TpAccount *account,
                                GAsyncResult *result,
                                GError **error);

Finishes an asynchronous request to change the automatic presence of account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.13.8


tp_account_get_connect_automatically ()

gboolean
tp_account_get_connect_automatically (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “connect-automatically” property

Since: 0.9.0


tp_account_set_connect_automatically_async ()

void
tp_account_set_connect_automatically_async
                               (TpAccount *account,
                                gboolean connect_automatically,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Requests an asynchronous set of the ConnectAutomatically property of account . When the operation is finished, callback will be called. You can then call tp_account_set_display_name_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

connect_automatically

new value for the parameter

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_set_connect_automatically_finish ()

gboolean
tp_account_set_connect_automatically_finish
                               (TpAccount *account,
                                GAsyncResult *result,
                                GError **error);

Finishes an async set of the ConnectAutomatically property.

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call was successful, otherwise FALSE

Since: 0.9.0


tp_account_get_has_been_online ()

gboolean
tp_account_get_has_been_online (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “has-been-online” property

Since: 0.9.0


tp_account_get_connection_status ()

TpConnectionStatus
tp_account_get_connection_status (TpAccount *account,
                                  TpConnectionStatusReason *reason);

Gets the connection status and reason from account . The two values are the same as the “connection-status” and “connection-status-reason” properties.

Parameters

account

a TpAccount

 

reason

a TpConnectionStatusReason to fill, or NULL.

[out]

Returns

the same as the “connection-status” property

Since: 0.9.0


tp_account_get_detailed_error ()

const gchar *
tp_account_get_detailed_error (TpAccount *self,
                               const GHashTable **details);

If the account's connection is not connected, return the D-Bus error name with which it last disconnected or failed to connect (in particular, this is TP_ERROR_STR_CANCELLED if it was disconnected by a user request). This is the same as “connection-error”.

If details is not NULL, it will be used to return additional details about the error (the same as “connection-error-details”).

Otherwise, return NULL, without altering details .

The returned string and details may become invalid when the main loop is re-entered or the account is destroyed.

[skip]

Parameters

self

an account

 

details

optionally used to return a map from string to GValue, which must not be modified, destroyed or unreffed by the caller.

[out][allow-none][element-type utf8 GObject.Value][transfer none]

Returns

a D-Bus error name, or NULL.

[transfer none][allow-none]

Since: 0.11.7


tp_account_dup_detailed_error_vardict ()

gchar *
tp_account_dup_detailed_error_vardict (TpAccount *self,
                                       GVariant **details);

If the account's connection is not connected, return the D-Bus error name with which it last disconnected or failed to connect (in particular, this is TP_ERROR_STR_CANCELLED if it was disconnected by a user request). This is the same as “connection-error”.

If details is not NULL, it will be used to return additional details about the error (the same as “connection-error-details”).

Otherwise, return NULL, without altering details .

The returned string and details may become invalid when the main loop is re-entered or the account is destroyed.

Parameters

self

an account

 

details

optionally used to return a variant of type G_VARIANT_TYPE_VARDICT, which must be unreffed by the caller with g_variant_unref().

[out][allow-none][transfer full]

Returns

a D-Bus error name, or NULL.

[transfer full][allow-none]

Since: 0.17.6


tp_account_get_changing_presence ()

gboolean
tp_account_get_changing_presence (TpAccount *self);

Parameters

self

an account

 

Returns

the same as the “changing-presence” property

Since: 0.11.6


tp_account_get_current_presence ()

TpConnectionPresenceType
tp_account_get_current_presence (TpAccount *account,
                                 gchar **status,
                                 gchar **status_message);

Gets the current presence, status and status message of account . These values are the same as the “current-presence-type”, “current-status” and “current-status-message” properties.

Parameters

account

a TpAccount

 

status

return location for the current status.

[out][transfer full]

status_message

return location for the current status message.

[out][transfer full]

Returns

the same as the “current-presence-type” property

Since: 0.9.0


tp_account_get_requested_presence ()

TpConnectionPresenceType
tp_account_get_requested_presence (TpAccount *account,
                                   gchar **status,
                                   gchar **status_message);

Gets the requested presence, status and status message of account . These values are the same as the “requested-presence-type”, “requested-status” and “requested-status-message” properties.

Parameters

account

a TpAccount

 

status

return location for the requested status.

[out][transfer none]

status_message

return location for the requested status message.

[out][transfer full]

Returns

the same as the “requested-presence-type” property

Since: 0.9.0


tp_account_get_automatic_presence ()

TpConnectionPresenceType
tp_account_get_automatic_presence (TpAccount *self,
                                   gchar **status,
                                   gchar **status_message);

Gets the automatic presence, status and status message of account . These values are the same as the “automatic-presence-type”, “automatic-status” and “automatic-status-message” properties, and are the values that will be used if the account should be put online automatically.

Parameters

self

an account

 

status

return location for the presence status.

[out][transfer none]

status_message

return location for the user-defined message.

[out][transfer full]

Returns

the same as the “automatic-presence-type” property

Since: 0.13.8


tp_account_get_parameters ()

const GHashTable *
tp_account_get_parameters (TpAccount *account);

Returns the parameters of the account, in a hash table where each string is the parameter name (account, password, require-encryption etc.), and each value is a GValue. Using the tp_asv_get family of functions (tp_asv_get_uint32(), tp_asv_get_string() etc.) to access the parameters is recommended.

The allowed parameters depend on the connection manager, and can be found via tp_connection_manager_get_protocol() and tp_connection_manager_protocol_get_param(). Well-known parameters are listed

in the Telepathy D-Bus Interface Specification.

Parameters

account

a TpAccount

 

Returns

the hash table of parameters on account .

[transfer none][element-type utf8 GObject.Value]

Since: 0.9.0


tp_account_dup_parameters_vardict ()

GVariant *
tp_account_dup_parameters_vardict (TpAccount *account);

Returns the parameters of the account, in a variant of type G_VARIANT_TYPE_VARDICT where the keys are parameter names (account, password, require-encryption etc.). Use g_variant_lookup() or g_variant_lookup_value() for convenient access to the values.

The allowed parameters depend on the connection manager, and can be found via tp_connection_manager_get_protocol() and tp_connection_manager_protocol_get_param(). Well-known parameters are listed

in the Telepathy D-Bus Interface Specification.

Parameters

account

a TpAccount

 

Returns

the dictionary of parameters on account , of type G_VARIANT_TYPE_VARDICT.

[transfer full]

Since: 0.17.6


tp_account_get_nickname ()

const gchar *
tp_account_get_nickname (TpAccount *account);

Parameters

account

a TpAccount

 

Returns

the same as the “nickname” property

Since: 0.9.0


tp_account_set_nickname_async ()

void
tp_account_set_nickname_async (TpAccount *account,
                               const gchar *nickname,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Requests an asynchronous change of the Nickname parameter on account . When the operation is finished, callback will be called. You can then call tp_account_set_nickname_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

nickname

a new nickname to set

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_set_nickname_finish ()

gboolean
tp_account_set_nickname_finish (TpAccount *account,
                                GAsyncResult *result,
                                GError **error);

Finishes an async nickname change request on account .

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.9.0


tp_account_get_normalized_name ()

const gchar *
tp_account_get_normalized_name (TpAccount *self);

Parameters

self

a TpAccount

 

Returns

the same as the “normalized-name” property.

[transfer none]

Since: 0.13.8


tp_account_get_supersedes ()

const gchar * const *
tp_account_get_supersedes (TpAccount *self);

Return the same thing as the “supersedes” property, in a way that may be more convenient for C code.

The returned pointers are not guaranteed to remain valid after the main loop has been re-entered.

Parameters

self

a TpAccount

 

Returns

the same as the “supersedes” property.

[transfer none]

Since: 0.17.5


tp_account_get_avatar_async ()

void
tp_account_get_avatar_async (TpAccount *account,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

Requests an asynchronous get of account 's avatar. When the operation is finished, callback will be called. You can then call tp_account_get_avatar_finish() to get the result of the operation.

Parameters

account

a TpAccount

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_get_avatar_finish ()

const GArray *
tp_account_get_avatar_finish (TpAccount *account,
                              GAsyncResult *result,
                              GError **error);

Finishes an async get operation of account 's avatar.

Beware that the returned value is only valid until result is freed. Copy it with g_array_ref() if you need to keep it for longer.

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a GArray of guchar containing the bytes of the account's avatar, or NULL on failure.

[element-type guchar][transfer none]

Since: 0.9.0


tp_account_set_avatar_async ()

void
tp_account_set_avatar_async (TpAccount *self,
                             const guchar *avatar,
                             gsize len,
                             const gchar *mime_type,
                             GAsyncReadyCallback callback,
                             gpointer user_data);

Requests an asynchronous change of the Avatar parameter on self . When the operation is finished, callback will be called. You can then call tp_account_set_avatar_finish() to get the result of the operation.

If len equals 0, the avatar is cleared.

Parameters

self

a TpAccount

 

avatar

a new avatar to set; can be NULL only if len equals 0.

[allow-none][array length=len]

len

the length of the new avatar

 

mime_type

the MIME type of the new avatar; can be NULL only if len equals 0.

[allow-none]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.1


tp_account_set_avatar_finish ()

gboolean
tp_account_set_avatar_finish (TpAccount *self,
                              GAsyncResult *result,
                              GError **error);

Finishes an async avatar change request on account .

Parameters

self

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE

Since: 0.11.1


tp_account_bind_connection_status_to_property ()

GBinding *
tp_account_bind_connection_status_to_property
                               (TpAccount *self,
                                gpointer target,
                                const char *target_property,
                                gboolean invert);

Binds the :connection-status of self to the boolean property of another object using a GBinding such that the target_property will be set to TRUE when self is connected (and invert is FALSE).

target_property will be synchronised immediately (G_BINDING_SYNC_CREATE). invert can be interpreted as analogous to G_BINDING_INVERT_BOOLEAN.

For instance, this function can be used to bind the GtkWidget:sensitive property to only make a widget sensitive when the account is connected.

See g_object_bind_property() for more information.

Parameters

self

a TpAccount

 

target

the target GObject

 

target_property

the property on target to bind (must be G_TYPE_BOOLEAN)

 

invert

TRUE if you wish to invert the value of target_property (i.e. FALSE if connected)

 

Returns

the GBinding instance representing the binding between the self and the target . The binding is released whenever the GBinding reference count reaches zero.

[transfer none]

Since: 0.13.16


tp_account_is_prepared ()

gboolean
tp_account_is_prepared (TpAccount *account,
                        GQuark feature);

tp_account_is_prepared is deprecated and should not be used in newly-written code.

since 0.23.0, use tp_proxy_is_prepared() instead.

[skip]

Parameters

account

a TpAccount

 

feature

a feature which is required

 

Returns

the same thing as tp_proxy_is_prepared()

Since: 0.9.0


tp_account_prepare_async ()

void
tp_account_prepare_async (TpAccount *account,
                          const GQuark *features,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

tp_account_prepare_async is deprecated and should not be used in newly-written code.

since 0.15.6, use tp_proxy_prepare_async() instead.

Requests an asynchronous preparation of account with the features specified by features . When the operation is finished, callback will be called. You can then call tp_account_prepare_finish() to get the result of the operation.

If features is NULL, then callback will be called when the implied TP_ACCOUNT_FEATURE_CORE feature is ready.

If NULL is given to callback , then no callback will be called when the operation is finished. Instead, it will simply set features on manager . Note that if callback is NULL, then user_data must also be NULL.

Since 0.11.3, this is equivalent to calling the new function tp_proxy_prepare_async() with the same arguments.

[skip]

Parameters

account

a TpAccount

 

features

a 0-terminated list of features, or NULL

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_prepare_finish ()

gboolean
tp_account_prepare_finish (TpAccount *account,
                           GAsyncResult *result,
                           GError **error);

tp_account_prepare_finish is deprecated and should not be used in newly-written code.

since 0.15.6, use tp_proxy_prepare_finish() instead.

Finishes an async preparation of the account account .

[skip]

Parameters

account

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the preparation was successful, otherwise FALSE

Since: 0.9.0


tp_account_get_uri_schemes ()

const gchar * const *
tp_account_get_uri_schemes (TpAccount *self);

Return the “uri-schemes” property

Parameters

self

a TpAccount

 

Returns

the value of “uri_schemes” property.

[transfer none]

Since: 0.13.8


tp_account_associated_with_uri_scheme ()

gboolean
tp_account_associated_with_uri_scheme (TpAccount *self,
                                       const gchar *scheme);

Parameters

self

a TpAccount

 

scheme

a URI scheme such as "tel", "sip" or "xmpp".

[transfer none]

Returns

TRUE if the result of tp_account_get_uri_schemes() would include scheme

Since: 0.13.8


tp_account_set_uri_scheme_association_async ()

void
tp_account_set_uri_scheme_association_async
                               (TpAccount *self,
                                const gchar *scheme,
                                gboolean associate,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Add scheme to the list of additional URI schemes that would be returned by tp_account_get_uri_schemes(), or remove it from that list.

scheme should not be the primary URI scheme for the account's protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), since the account should be assumed to be useful for those schemes regardless of the contents of the list.

Calling this method does not require the TP_ACCOUNT_FEATURE_ADDRESSING feature to be enabled, but the change will not be reflected in the result of tp_account_get_uri_schemes() or tp_account_associated_with_uri_scheme() unless that feature has been enabled.

Parameters

self

a TpAccount

 

scheme

a non-NULL URI scheme such as "tel"

 

associate

TRUE to use this account for scheme , or FALSE to not use it

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.8


tp_account_set_uri_scheme_association_finish ()

gboolean
tp_account_set_uri_scheme_association_finish
                               (TpAccount *self,
                                GAsyncResult *result,
                                GError **error);

Interpret the result of tp_account_set_uri_scheme_association_async().

Parameters

self

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call was successful, otherwise FALSE

Since: 0.13.8


tp_account_get_storage_provider ()

const gchar *
tp_account_get_storage_provider (TpAccount *self);

Parameters

self

a TpAccount

 

Returns

the same as the “storage-provider” property

Since: 0.13.2


tp_account_get_storage_identifier ()

const GValue *
tp_account_get_storage_identifier (TpAccount *self);

Parameters

self

a TpAccount

 

Returns

the same as the “storage-identifier” property

Since: 0.13.2


tp_account_dup_storage_identifier_variant ()

GVariant *
tp_account_dup_storage_identifier_variant
                               (TpAccount *self);

Return provider-specific information used to identify this account. Use g_variant_get_type() to check that the type is what you expect; for instance, if the “storage-provider” has string-based user identifiers, this variant should have type G_VARIANT_TYPE_STRING.

Parameters

self

a TpAccount

 

Returns

the same as the “storage-identifier-variant” property.

[transfer full]

Since: 0.13.2


tp_account_get_storage_restrictions ()

TpStorageRestrictionFlags
tp_account_get_storage_restrictions (TpAccount *self);

Parameters

self

a TpAccount

 

Returns

the same as the “storage-restrictions” property

Since: 0.13.2


tp_account_get_storage_specific_information_async ()

void
tp_account_get_storage_specific_information_async
                               (TpAccount *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Makes an asynchronous request of self 's StorageSpecificInformation property (part of the Account.Interface.Storage interface).

When the operation is finished, callback will be called. You must then call tp_account_get_storage_specific_information_finish() to get the result of the request.

Parameters

self

a TpAccount

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.2


tp_account_get_storage_specific_information_finish ()

GHashTable *
tp_account_get_storage_specific_information_finish
                               (TpAccount *self,
                                GAsyncResult *result,
                                GError **error);

Retrieve the value of the request begun with tp_account_get_storage_specific_information_async().

Beware that the returned value is only valid until result is freed. Copy it with g_hash_table_ref() if you need to keep it for longer.

Parameters

self

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a GHashTable of strings to GValues representing the D-Bus type a{sv}.

[element-type utf8 GObject.Value][transfer none]

Since: 0.13.2


tp_account_dup_storage_specific_information_vardict_async ()

void
tp_account_dup_storage_specific_information_vardict_async
                               (TpAccount *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Makes an asynchronous request of self 's StorageSpecificInformation property (part of the Account.Interface.Storage interface).

When the operation is finished, callback will be called. You must then call tp_account_dup_storage_specific_information_vardict_finish() to get the result of the request.

Parameters

self

a TpAccount

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.17.6


tp_account_dup_storage_specific_information_vardict_finish ()

GVariant *
tp_account_dup_storage_specific_information_vardict_finish
                               (TpAccount *self,
                                GAsyncResult *result,
                                GError **error);

Retrieve the value of the request begun with tp_account_dup_storage_specific_information_vardict_async().

Parameters

self

a TpAccount

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a map from strings to variants, of type G_VARIANT_TYPE_VARDICT.

[transfer full]

Since: 0.17.6


tp_cli_account_callback_for_reconnect ()

void
(*tp_cli_account_callback_for_reconnect)
                               (TpAccount *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Reconnect method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_account_call_reconnect ()

TpProxyPendingCall *
tp_cli_account_call_reconnect (TpAccount *proxy,
                               gint timeout_ms,
                               tp_cli_account_callback_for_reconnect callback,
                               gpointer user_data,
                               GDestroyNotify destroy,
                               GObject *weak_object);

Start a Reconnect method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Re-connect this account. If the account is currently disconnected and the requested presence is offline, or if the account is not <tp:member-ref>Enabled</tp:member-ref> or not <tp:member-ref>Valid</tp:member-ref>, this does nothing.</p> <p>If the account is disconnected and the requested presence is not offline, this forces an attempt to connect with the requested presence immediately.</p> <p>If the account is connecting or connected, this is equivalent to remembering the current value of <tp:member-ref>RequestedPresence</tp:member-ref>, setting its value to (OFFLINE, &quot;offline&quot;, &quot;&quot;), waiting for the change to take effect, then setting its value to the value that was previously remembered.</p> <tp:rationale> <p>Clients desiring &quot;instant apply&quot; semantics for CM parameters MAY call this method to achieve that.</p> </tp:rationale> <p>In particular, if the account's <tp:member-ref>Connection</tp:member-ref> is in the Connecting state, calling this method causes the attempt to connect to be aborted and re-tried.</p> <tp:rationale> <p>This is necessary to ensure that the new parameters are picked up.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_account_callback_for_remove ()

void
(*tp_cli_account_callback_for_remove) (TpAccount *proxy,
                                       const GError *error,
                                       gpointer user_data,
                                       GObject *weak_object);

Signature of the callback called when a Remove method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_account_call_remove ()

TpProxyPendingCall *
tp_cli_account_call_remove (TpAccount *proxy,
                            gint timeout_ms,
                            tp_cli_account_callback_for_remove callback,
                            gpointer user_data,
                            GDestroyNotify destroy,
                            GObject *weak_object);

Start a Remove method call.

Delete the account.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_account_callback_for_update_parameters ()

void
(*tp_cli_account_callback_for_update_parameters)
                               (TpAccount *proxy,
                                const gchar **out_Reconnect_Required,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UpdateParameters method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Reconnect_Required

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If all of the updates could be applied to the active <tp:member-ref>Connection</tp:member-ref> (if any), the empty list, signifying that no reconnection is required for the new parameters to take effect. For example, if the only parameter updated is <tt>...Cellular.<tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Cellular">MessageValidityPeriod</tp:dbus-ref></tt>, the new value can be applied immediately to the connection.</p> <p>Otherwise, a list of the names of parameters with changes that will not take effect until the account is reconnected. User interfaces that require &quot;instant apply&quot; semantics MAY call <tp:member-ref>Reconnect</tp:member-ref> in response to receiving a non-empty list. For example, if the caller updates both <tt>...Anonymity.<tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Anonymity">AnonymityMandatory</tp:dbus-ref></tt> and <tt>require-encryption</tt>, the former can be applied to the current connection, but the latter needs a reconnect to take effect, so this method should return <code>[&quot;require-encryption&quot;]</code>.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_account_call_update_parameters ()

TpProxyPendingCall *
tp_cli_account_call_update_parameters (TpAccount *proxy,
                                       gint timeout_ms,
                                       GHashTable *in_Set,
                                       const gchar **in_Unset,
                                       tp_cli_account_callback_for_update_parameters callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

Start a UpdateParameters method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Change the value of the <tp:member-ref>Parameters</tp:member-ref> property.</p> <p>If any of the <var>Set</var> parameters’ <tp:type>Conn_Mgr_Param_Flags</tp:type> include <code>DBus_Property</code>, the change will be applied immediately to the corresponding D-Bus Property on the active <tp:member-ref>Connection</tp:member-ref>, if there is one. If any of the <var>Unset</var> parameters’ <tp:type>Conn_Mgr_Param_Flags</tp:type> include both <code>DBus_Property</code> and <code>Has_Default</code>, the corresponding D-Bus Property on the connection will be set to the default value. Changes to other parameters will not take effect until the next time the account is disconnected and reconnected. (If parameters are explicitly set to their default value, or are unset when previously set to their default value, the account manager MAY decide that no reconnection is necessary to make the change take effect.)</p> <tp:rationale> <p>In general, reconnecting is a destructive operation that shouldn't happen as a side-effect. In particular, migration tools that twiddle the settings of all accounts shouldn't cause an automatic disconnect and reconnect.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Set

Used to pass an 'in' argument: A mapping from parameter names to their values. These parameters should be stored for future use.

 

in_Unset

Used to pass an 'in' argument: A list of the names of parameters to be removed from the set of stored values, allowing the default values to be used. If the given parameters were not, in fact, stored, or even if they do not exist at all, the account manager MUST accept this without error.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_account_signal_callback_account_property_changed ()

void
(*tp_cli_account_signal_callback_account_property_changed)
                               (TpAccount *proxy,
                                GHashTable *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AccountPropertyChanged.

Parameters

proxy

The proxy on which tp_cli_account_connect_to_account_property_changed() was called

 

arg_Properties

A map from property names in this namespace (e.g. <tp:member-ref>Nickname</tp:member-ref>) to values. Properties whose values have not changed SHOULD be omitted, but this need not be done.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_account_connect_to_account_property_changed ()

TpProxySignalConnection *
tp_cli_account_connect_to_account_property_changed
                               (TpAccount *proxy,
                                tp_cli_account_signal_callback_account_property_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AccountPropertyChanged.

The values of one or more properties on this interface (that do not specify that this signal does not apply to them) may have changed. This does not cover properties of other interfaces, which must provide their own change notification if appropriate.

Parameters

proxy

A TpAccount or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_account_signal_callback_removed ()

void
(*tp_cli_account_signal_callback_removed)
                               (TpAccount *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Removed.

Parameters

proxy

The proxy on which tp_cli_account_connect_to_removed() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_account_connect_to_removed ()

TpProxySignalConnection *
tp_cli_account_connect_to_removed (TpAccount *proxy,
                                   tp_cli_account_signal_callback_removed callback,
                                   gpointer user_data,
                                   GDestroyNotify destroy,
                                   GObject *weak_object,
                                   GError **error);

Connect a handler to the signal Removed.

This account has been removed. <tp:rationale> This is redundant with <tp:dbus-ref namespace="org.freedesktop.Telepathy.AccountManager">AccountRemoved</tp:dbus-ref>, but it's still worth having, to avoid having to bind to AccountManager.AccountRemoved to tell you whether your Account is valid — ideally, an account-editing UI should only care about a single Account. </tp:rationale>

Parameters

proxy

A TpAccount or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_account_interface_avatar_signal_callback_avatar_changed ()

void
(*tp_cli_account_interface_avatar_signal_callback_avatar_changed)
                               (TpAccount *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AvatarChanged.

Parameters

proxy

The proxy on which tp_cli_account_interface_avatar_connect_to_avatar_changed() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_account_interface_avatar_connect_to_avatar_changed ()

TpProxySignalConnection *
tp_cli_account_interface_avatar_connect_to_avatar_changed
                               (TpAccount *proxy,
                                tp_cli_account_interface_avatar_signal_callback_avatar_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AvatarChanged.

Emitted when the Avatar property changes. <tp:rationale>The avatar itself is deliberately not included in this signal, to reduce bus traffic in the (likely common) case where no running application cares about the user's own avatar.</tp:rationale>

Parameters

proxy

A TpAccount or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_account_interface_addressing_callback_for_set_uri_scheme_association ()

void
(*tp_cli_account_interface_addressing_callback_for_set_uri_scheme_association)
                               (TpAccount *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetURISchemeAssociation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_account_interface_addressing_call_set_uri_scheme_association ()

TpProxyPendingCall *
tp_cli_account_interface_addressing_call_set_uri_scheme_association
                               (TpAccount *proxy,
                                gint timeout_ms,
                                const gchar *in_URI_Scheme,
                                gboolean in_Association,
                                tp_cli_account_interface_addressing_callback_for_set_uri_scheme_association callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetURISchemeAssociation method call.

<p>Associate (or disassociate) an account with a particular URI addressing scheme, (such as 'tel' for telephony)</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_URI_Scheme

Used to pass an 'in' argument: <p>URI scheme to associate/disassociate the account with/from</p>

 

in_Association

Used to pass an 'in' argument: <p>True to associate this account with a given addressing scheme</p> <p>False if the account should not be associated with said scheme</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

Types and Values

TpAccount

typedef struct _TpAccount TpAccount;

The Telepathy Account Manager stores the user's configured real-time communication accounts. This object represents a stored account.

If this account is deleted from the account manager, the “invalidated” signal will be emitted with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_OBJECT_REMOVED.

One can connect to the “notify” signal to get change notifications for many of the properties on this object. Refer to each property's documentation for whether it can be used in this way.

TpAccount objects should normally be obtained from the TpAccountManager.

Since 0.16, TpAccount always has a non-NULL “factory”, and its “factory” will be propagated to its TpConnection (if any). If a TpAccount is created without going via the TpAccountManager or specifying a “factory”, the default is to use a new TpAutomaticClientFactory.

Since: 0.7.32


struct TpAccountClass

struct TpAccountClass {
};

The class of a TpAccount.


TP_ACCOUNT_FEATURE_CORE

#define             TP_ACCOUNT_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpAccount.

When this feature is prepared, the basic properties of the Account have been retrieved and are available for use, and change-notification has been set up.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.9.0


TP_ACCOUNT_FEATURE_CONNECTION

#define             TP_ACCOUNT_FEATURE_CONNECTION

Expands to a call to a function that returns a quark for the "connection" feature on a TpAccount.

When this feature is prepared, it is guaranteed that “connection” will always be either NULL or prepared. The account's “factory” will be used to create the TpConnection object and to determine its desired connection features. Change notification of the “connection” property will be delayed until all features (at least TP_CONNECTION_FEATURE_CORE) are prepared. See tp_simple_client_factory_add_account_features() to define which features needs to be prepared.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.5


TP_ACCOUNT_FEATURE_ADDRESSING

#define             TP_ACCOUNT_FEATURE_ADDRESSING

Expands to a call to a function that returns a quark for the "addressing" feature on a TpAccount.

When this feature is prepared, the list of URI schemes from Account.Interface.Addressing has been retrieved and is available for use.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.13.8


TP_ACCOUNT_FEATURE_STORAGE

#define             TP_ACCOUNT_FEATURE_STORAGE

Expands to a call to a function that returns a quark for the "storage" feature on a TpAccount.

When this feature is prepared, the Account.Interface.Storage properties have been retrieved and are available for use.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.13.2

Property Details

The “automatic-presence-type” property

  “automatic-presence-type”  guint

The account's automatic presence type (a TpConnectionPresenceType).

When the account is put online automatically, for instance to make a channel request or because network connectivity becomes available, the automatic presence type, status and message will be copied to their "requested" counterparts.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is TP_CONNECTION_PRESENCE_TYPE_UNSET.

Owner: TpAccount

Flags: Read

Allowed values: <= 9

Default value: 0

Since: 0.13.8


The “automatic-status” property

  “automatic-status”         gchar *

The string status name to use in conjunction with the “automatic-presence-type”.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.13.8


The “automatic-status-message” property

  “automatic-status-message” gchar *

The user-defined message to use in conjunction with the “automatic-presence-type”.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.13.8


The “changing-presence” property

  “changing-presence”        gboolean

TRUE if an attempt is currently being made to change the account's presence (“current-presence-type”, “current-status” and “current-status-message”) to match its requested presence (“requested-presence-type”, “requested-status” and “requested-status-message”).

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE.

Owner: TpAccount

Flags: Read

Default value: FALSE

Since: 0.11.6


The “cm-name” property

  “cm-name”                  gchar *

The account's connection manager name.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.19.3


The “connect-automatically” property

  “connect-automatically”    gboolean

Whether the account should connect automatically or not. To change this property, use tp_account_set_connect_automatically_async().

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE.

Owner: TpAccount

Flags: Read

Default value: FALSE

Since: 0.9.0


The “connection” property

  “connection”               TpConnection *

The connection of the account, or NULL if account is offline. Note that the returned TpConnection is not guaranteed to have any features pre-prepared (not even TP_CONNECTION_FEATURE_CORE) unless TP_ACCOUNT_FEATURE_CONNECTION has been prepared on the account

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. If TP_ACCOUNT_FEATURE_CONNECTION has been prepared, this signal will be delayed until the connection is ready.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Since: 0.9.0


The “connection-error” property

  “connection-error”         gchar *

The D-Bus error name for the last disconnection or connection failure, (in particular, TP_ERROR_STR_CANCELLED if it was disconnected by user request), or NULL if the account is connected.

One can receive change notifications on this property by connecting to the “status-changed” signal, or by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.11.7


The “connection-error-details” property

  “connection-error-details” GHashTable *

A map from string to GValue containing extensible error details related to “connection-error”. Functions like tp_asv_get_string() can be used to read from this map.

The keys for this map are defined by

the Telepathy D-Bus Interface Specification. They will typically include

debug-message, which is a debugging message in the C locale, analogous to GError.message.

One can receive change notifications on this property by connecting to the “status-changed” signal, or by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is an empty map.

Owner: TpAccount

Flags: Read

Since: 0.11.7


The “connection-manager” property

  “connection-manager”       gchar *

The account's connection manager name.

TpAccount:connection-manager is deprecated and should not be used in newly-written code.

Use “cm-name” instead.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “connection-status” property

  “connection-status”        guint

The account's connection status type (a TpConnectionStatus).

One can receive change notifications on this property by connecting to the “status-changed” signal, or by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is TP_CONNECTION_STATUS_DISCONNECTED.

Owner: TpAccount

Flags: Read

Allowed values: <= 3

Default value: 2

Since: 0.9.0


The “connection-status-reason” property

  “connection-status-reason” guint

The account's connection status reason (a TpConnectionStatusReason).

One can receive change notifications on this property by connecting to the “status-changed” signal, or by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED.

Owner: TpAccount

Flags: Read

Allowed values: <= 17

Default value: 0

Since: 0.9.0


The “current-presence-type” property

  “current-presence-type”    guint

The account connection's current presence type (a TpConnectionPresenceType).

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is TP_CONNECTION_PRESENCE_TYPE_UNSET.

Owner: TpAccount

Flags: Read

Allowed values: <= 9

Default value: 0

Since: 0.9.0


The “current-status” property

  “current-status”           gchar *

The current Status string of the account.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “current-status-message” property

  “current-status-message”   gchar *

The current status message message of the account.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “display-name” property

  “display-name”             gchar *

The account's display name, from the DisplayName property.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “enabled” property

  “enabled”                  gboolean

Whether this account is enabled or not.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE.

Owner: TpAccount

Flags: Read

Default value: FALSE

Since: 0.9.0


The “has-been-online” property

  “has-been-online”          gboolean

Whether this account has been online or not.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE.

Owner: TpAccount

Flags: Read

Default value: FALSE

Since: 0.9.0


The “icon-name” property

  “icon-name”                gchar *

The account's icon name. To change this propery, use tp_account_set_icon_name_async().

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “nickname” property

  “nickname”                 gchar *

The nickname that should be set for the user on this account.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “normalized-name” property

  “normalized-name”          gchar *

The normalized form of the user's own unique identifier on this protocol. For example, on XMPP accounts this is the user's JID; on ICQ this is the user's UIN; and so on.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.13.8


The “protocol” property

  “protocol”                 gchar *

The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification.

TpAccount:protocol is deprecated and should not be used in newly-written code.

Use “protocol-name” instead.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “protocol-name” property

  “protocol-name”            gchar *

The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.19.3


The “requested-presence-type” property

  “requested-presence-type”  guint

The account's requested presence type (a TpConnectionPresenceType).

Since 0.13.8, one can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Allowed values: <= 9

Default value: 0

Since: 0.9.0


The “requested-status” property

  “requested-status”         gchar *

The requested Status string of the account.

Since 0.13.8, one can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “requested-status-message” property

  “requested-status-message” gchar *

The requested status message message of the account.

Since 0.13.8, one can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.9.0


The “service” property

  “service”                  gchar *

A machine-readable name identifying a specific service to which this account connects, or a copy of “protocol” if there is no more specific service.

Well-known names for various services can be found in the Telepathy D-Bus Interface Specification.

For instance, accounts for the "jabber" protocol should have the service names "google-talk", "ovi-chat", "facebook" and "lj-talk" for accounts that connect to Google Talk, Ovi Chat, Facebook and Livejournal, respectively, and this property will be "jabber" for accounts that connect to a generic Jabber server.

To change this property, use tp_account_set_service_async().

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.11.9


The “storage-identifier” property

  “storage-identifier”       GValue *

The storage identifier for this account.

A provider-specific variant type used to identify this account with the provider. This value will be NULL if “storage-provider” is an empty string.

This property cannot change once an Account has been created.

This is not guaranteed to have been retrieved until the TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Since: 0.13.2


The “storage-identifier-variant” property

  “storage-identifier-variant” GVariant *

Provider-specific information used to identify this account. Use g_variant_get_type() to check that the type is what you expect. For instance, if you use a “storage-provider” with numeric identifiers for accounts, this variant might have type G_VARIANT_TYPE_UINT32; if the storage provider has string-based identifiers, it should have type G_VARIANT_TYPE_STRING.

This property cannot change once an Account has been created.

This is not guaranteed to have been retrieved until the TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Allowed values: GVariant<*>

Default value: NULL

Since: 0.13.2


The “storage-provider” property

  “storage-provider”         gchar *

The storage provider for this account.

The name of the account storage implementation. When this is the empty string the account is internally stored.

This property cannot change once an Account has been created.

This is not guaranteed to have been retrieved until the TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Default value: NULL

Since: 0.13.2


The “storage-restrictions” property

  “storage-restrictions”     guint

The storage restrictions for this account.

A bitfield of TpStorageRestrictionFlags that give the limitations of this account imposed by the storage provider. This value will be 0 if “storage-provider” is an empty string.

This property cannot change once an Account has been created.

This is not guaranteed to have been retrieved until the TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is 0.

Owner: TpAccount

Flags: Read

Default value: 0

Since: 0.13.2


The “supersedes” property

  “supersedes”               GStrv

The object paths of previously-active accounts superseded by this one. For instance, this can be used in a logger to read old logs for an account that has been migrated from one connection manager to another.

This is not guaranteed to have been retrieved until the TP_ACCOUNT_FEATURE_CORE feature has been prepared; until then, the value is NULL.

Owner: TpAccount

Flags: Read

Since: 0.17.5


The “uri-schemes” property

  “uri-schemes”              GStrv

If the TP_ACCOUNT_FEATURE_ADDRESSING feature has been prepared successfully, a list of additional URI schemes for which this account should be used if possible. Otherwise NULL.

For instance, a SIP or Skype account might have "tel" in this list if the user would like to use that account to call phone numbers.

This list should not contain the primary URI scheme(s) for the account's protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), since it should be assumed to be useful for those schemes in any case.

The notify::uri-schemes signal cannot be relied on if the Account Manager is Mission Control version 5.14.0 or older.

Owner: TpAccount

Flags: Read

Since: 0.21.0


The “valid” property

  “valid”                    gboolean

Whether this account is valid.

One can receive change notifications on this property by connecting to the “notify” signal and using this property as the signal detail.

This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE.

Owner: TpAccount

Flags: Read

Default value: FALSE

Since: 0.9.0

Signal Details

The “avatar-changed” signal

void
user_function (TpAccount *self,
               gpointer   user_data)

Emitted when the avatar changes. Call tp_account_get_avatar_async() to get the new avatar data.

Parameters

self

a TpAccount

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.23.0


The “presence-changed” signal

void
user_function (TpAccount *account,
               guint      presence,
               gchar     *status,
               gchar     *status_message,
               gpointer   user_data)

Emitted when the presence of the account changes.

Parameters

account

the TpAccount

 

presence

the new presence

 

status

the new presence status

 

status_message

the new presence status message

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0


The “status-changed” signal

void
user_function (TpAccount  *account,
               guint       old_status,
               guint       new_status,
               guint       reason,
               gchar      *dbus_error_name,
               GHashTable *details,
               gpointer    user_data)

Emitted when the connection status on the account changes.

The dbus_error_name and details parameters were present, but non-functional (always NULL), in older versions. They have been available with their current behaviour since version 0.11.7.

Parameters

account

the TpAccount

 

old_status

old “connection-status”

 

new_status

new “connection-status”

 

reason

the “connection-status-reason”

 

dbus_error_name

the “connection-error”.

[allow-none]

details

the “connection-error-details”.

[element-type utf8 GObject.Value]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0

See Also

TpAccountManager

telepathy-glib-0.24.2/docs/reference/html/left.png0000644000175000017500000000040614006623343016725 00000000000000PNG  IHDRabKGD pHYs B(xtIME,`m;IDAT8үa?DAPY\$[p+IIMlf('}Mpy{_ޥ}^q xZ <=Yj) <04\~+Pl#",Qϑp Iǐlsw>[/]_i03IENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-powersaving.html0000644000175000017500000004752614006623344025603 00000000000000 Connection PowerSaving interface: telepathy-glib API Reference Manual

Connection PowerSaving interface

Connection PowerSaving interface — client-side wrappers for the PowerSaving interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some connection manager implementations can be instructed to try to save power on mobile devices by suppressing non-essential traffic, such as presence notifications. This section documents auto-generated C wrappers for the PowerSaving D-Bus interface.

Functions

tp_cli_connection_interface_power_saving_call_set_power_saving ()

TpProxyPendingCall *
tp_cli_connection_interface_power_saving_call_set_power_saving
                               (TpConnection *proxy,
                                gint timeout_ms,
                                gboolean in_Activate,
                                tp_cli_connection_interface_power_saving_callback_for_set_power_saving callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetPowerSaving method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Turn power saving mode on or off.</p> <tp:rationale> <p>Depending on the device's activity level, the connection can have its power saving mode turned on or off.</p> </tp:rationale> <p>Errors raised by this method indicate that power saving could not be enabled, which SHOULD NOT generally be treated as fatal.</p> <tp:rationale> If the CM cannot switch modes, either because of the protocol (<code>NotImplemented</code>), or because of the service (<code>NotAvailable</code>), Mission Control (or whoever manages this) should be made aware. The error could be ignored or, in the extreme, be fascist and disconnect the account. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Activate

Used to pass an 'in' argument: <code>True</code> if protocol-level power saving features should be activated; <code>False</code> if they should be de-activated.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_power_saving_callback_for_set_power_saving ()

void
(*tp_cli_connection_interface_power_saving_callback_for_set_power_saving)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetPowerSaving method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_power_saving_connect_to_power_saving_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_power_saving_connect_to_power_saving_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PowerSavingChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The <tp:member-ref>PowerSavingActive</tp:member-ref> property changed.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed ()

void
(*tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed)
                               (TpConnection *proxy,
                                gboolean arg_Active,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PowerSavingChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_power_saving_connect_to_power_saving_changed() was called

 

arg_Active

The new state of the power saving feature.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-account.html0000644000175000017500000013042414006623344023315 00000000000000 Service-side Account interfaces: telepathy-glib API Reference Manual

Service-side Account interfaces

Service-side Account interfaces — GInterfaces for Telepathy Account objects

Signals

void account-property-changed Has Details
void removed Has Details
void avatar-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcAccount
    ├── TpSvcAccountInterfaceAddressing
    ├── TpSvcAccountInterfaceAvatar
    ╰── TpSvcAccountInterfaceStorage

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

These interfaces (auto-generated from the Telepathy spec) make it easier to export objects implementing the Telepathy Account and its optional interfaces, with the correct method and signal signatures, and emit signals from those objects in a type-safe way.

You don't need these interfaces unless you're implementing a Telepathy AccountManager, such as Mission Control.

Functions

tp_svc_account_emit_account_property_changed ()

void
tp_svc_account_emit_account_property_changed
                               (gpointer instance,
                                GHashTable *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the AccountPropertyChanged signal on interface org.freedesktop.Telepathy.Account.

Parameters

instance

The object implementing this interface

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_account_emit_removed ()

void
tp_svc_account_emit_removed (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Removed signal on interface org.freedesktop.Telepathy.Account.

Parameters

instance

The object implementing this interface

 

tp_svc_account_reconnect_impl ()

void
(*tp_svc_account_reconnect_impl) (TpSvcAccount *self,
                                  DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Reconnect on interface org.freedesktop.Telepathy.Account.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_account_return_from_reconnect ()

void
tp_svc_account_return_from_reconnect (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_account_implement_reconnect ()

void
tp_svc_account_implement_reconnect (TpSvcAccountClass *klass,
                                    tp_svc_account_reconnect_impl impl);

Register an implementation for the Reconnect method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Reconnect D-Bus method

 

tp_svc_account_remove_impl ()

void
(*tp_svc_account_remove_impl) (TpSvcAccount *self,
                               DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Remove on interface org.freedesktop.Telepathy.Account.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_account_return_from_remove ()

void
tp_svc_account_return_from_remove (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_account_implement_remove ()

void
tp_svc_account_implement_remove (TpSvcAccountClass *klass,
                                 tp_svc_account_remove_impl impl);

Register an implementation for the Remove method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Remove D-Bus method

 

tp_svc_account_update_parameters_impl ()

void
(*tp_svc_account_update_parameters_impl)
                               (TpSvcAccount *self,
                                GHashTable *in_Set,
                                const gchar **in_Unset,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UpdateParameters on interface org.freedesktop.Telepathy.Account.

Parameters

self

The object implementing this interface

 

in_Set

GHashTable * (FIXME, generate documentation)

 

in_Unset

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_account_return_from_update_parameters ()

void
tp_svc_account_return_from_update_parameters
                               (DBusGMethodInvocation *context,
                                const gchar **out_Reconnect_Required);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Reconnect_Required

const gchar ** (FIXME, generate documentation)

 

tp_svc_account_implement_update_parameters ()

void
tp_svc_account_implement_update_parameters
                               (TpSvcAccountClass *klass,
                                tp_svc_account_update_parameters_impl impl);

Register an implementation for the UpdateParameters method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UpdateParameters D-Bus method

 

tp_svc_account_interface_avatar_emit_avatar_changed ()

void
tp_svc_account_interface_avatar_emit_avatar_changed
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the AvatarChanged signal on interface org.freedesktop.Telepathy.Account.Interface.Avatar.

Parameters

instance

The object implementing this interface

 

tp_svc_account_interface_addressing_implement_set_uri_scheme_association ()

void
tp_svc_account_interface_addressing_implement_set_uri_scheme_association
                               (TpSvcAccountInterfaceAddressingClass *klass,
                                tp_svc_account_interface_addressing_set_uri_scheme_association_impl impl);

Register an implementation for the SetURISchemeAssociation method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetURISchemeAssociation D-Bus method

 

tp_svc_account_interface_addressing_return_from_set_uri_scheme_association ()

void
tp_svc_account_interface_addressing_return_from_set_uri_scheme_association
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_account_interface_addressing_set_uri_scheme_association_impl ()

void
(*tp_svc_account_interface_addressing_set_uri_scheme_association_impl)
                               (TpSvcAccountInterfaceAddressing *self,
                                const gchar *in_URI_Scheme,
                                gboolean in_Association,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetURISchemeAssociation on interface org.freedesktop.Telepathy.Account.Interface.Addressing.

Parameters

self

The object implementing this interface

 

in_URI_Scheme

const gchar * (FIXME, generate documentation)

 

in_Association

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

Types and Values

TpSvcAccount

typedef struct _TpSvcAccount TpSvcAccount;

Dummy typedef representing any implementation of this interface.


TpSvcAccountClass

typedef struct _TpSvcAccountClass TpSvcAccountClass;

The class of TpSvcAccount.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_account (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_account_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (remove);
  IMPLEMENT (update_parameters);
  IMPLEMENT (reconnect);
#undef IMPLEMENT
}

TpSvcAccountInterfaceAvatar

typedef struct _TpSvcAccountInterfaceAvatar TpSvcAccountInterfaceAvatar;

Dummy typedef representing any implementation of this interface.


TpSvcAccountInterfaceAvatarClass

typedef struct _TpSvcAccountInterfaceAvatarClass TpSvcAccountInterfaceAvatarClass;

The class of TpSvcAccountInterfaceAvatar. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcAccountInterfaceStorage

typedef struct _TpSvcAccountInterfaceStorage TpSvcAccountInterfaceStorage;

Dummy typedef representing any implementation of this interface.


TpSvcAccountInterfaceStorageClass

typedef struct _TpSvcAccountInterfaceStorageClass TpSvcAccountInterfaceStorageClass;

The class of TpSvcAccountInterfaceStorage. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcAccountInterfaceAddressing

typedef struct _TpSvcAccountInterfaceAddressing TpSvcAccountInterfaceAddressing;

Dummy typedef representing any implementation of this interface.


TpSvcAccountInterfaceAddressingClass

typedef struct _TpSvcAccountInterfaceAddressingClass TpSvcAccountInterfaceAddressingClass;

The class of TpSvcAccountInterfaceAddressing.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_account_interface_addressing (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_account_interface_addressing_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_uri_scheme_association);
#undef IMPLEMENT
}

Signal Details

The “account-property-changed” signal

void
user_function (TpSvcAccount *self,
               gpointer      user_data)

The AccountPropertyChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “removed” signal

void
user_function (TpSvcAccount *self,
               gpointer      user_data)

The Removed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “avatar-changed” signal

void
user_function (TpSvcAccountInterfaceAvatar *self,
               gpointer                     user_data)

The AvatarChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpMessageMixin.html0000644000175000017500000013530014006623343023762 00000000000000 TpMessageMixin: telepathy-glib API Reference Manual

TpMessageMixin

TpMessageMixin — a mixin implementation of the text channel type and the Messages interface

Types and Values

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This mixin can be added to a channel GObject class to implement the text channel type (with the Messages interface) in a general way. The channel class should also have a TpDBusPropertiesMixinClass.

To use the messages mixin, include a TpMessageMixin somewhere in your instance structure, and call tp_message_mixin_init() from your constructor function, and tp_message_mixin_finalize() from your dispose or finalize function. In the class_init function, call tp_message_mixin_init_dbus_properties() to hook this mixin into the D-Bus properties mixin class. Finally, include the following in the fourth argument of G_DEFINE_TYPE_WITH_CODE():

1
2
3
4
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT,
  tp_message_mixin_text_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES,
  tp_message_mixin_messages_iface_init);

To support sending messages, you must call tp_message_mixin_implement_sending() in the constructor function. If you do not, any attempt to send a message will fail with NotImplemented.

To support chat state, you must call tp_message_mixin_implement_send_chat_state() in the constructor function, and include the following in the fourth argument of G_DEFINE_TYPE_WITH_CODE():

1
2
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE,
  tp_message_mixin_chat_state_iface_init);

Functions

TpMessageMixinSendImpl ()

void
(*TpMessageMixinSendImpl) (GObject *object,
                           TpMessage *message,
                           TpMessageSendingFlags flags);

Signature of a virtual method which may be implemented to allow messages to be sent. It must arrange for tp_message_mixin_sent() to be called when the message has submitted or when message submission has failed.

Parameters

object

An instance of the implementation that uses this mixin

 

message

An outgoing message

 

flags

flags with which to send the message

 

tp_message_mixin_finalize ()

void
tp_message_mixin_finalize (GObject *obj);

Free resources held by the text mixin.

Parameters

obj

An object with this mixin.

 

Since: 0.7.21


tp_message_mixin_implement_sending ()

void
tp_message_mixin_implement_sending (GObject *object,
                                    TpMessageMixinSendImpl send,
                                    guint n_types,
                                    const TpChannelTextMessageType *types,
                                    TpMessagePartSupportFlags message_part_support_flags,
                                    TpDeliveryReportingSupportFlags delivery_reporting_support_flags,
                                    const gchar * const *supported_content_types);

Set the callback used to implement SendMessage, and the types of message that can be sent. This must be called from the init, constructor or constructed callback, after tp_message_mixin_init(), and may only be called once per object.

Parameters

object

An instance of the implementation that uses this mixin

 

send

An implementation of SendMessage()

 

n_types

Number of supported message types

 

types

n_types supported message types

 

message_part_support_flags

Flags indicating what message part structures are supported

 

delivery_reporting_support_flags

Flags indicating what kind of delivery reports are supported

 

supported_content_types

The supported content types

 

Since: 0.7.21


tp_message_mixin_init ()

void
tp_message_mixin_init (GObject *obj,
                       gsize offset,
                       TpBaseConnection *connection);

Initialize the mixin. Should be called from the implementation's instance init function or constructor like so:

1
2
3
tp_message_mixin_init ((GObject *) self,
    G_STRUCT_OFFSET (SomeObject, message_mixin),
    self->connection);

Parameters

obj

An instance of the implementation that uses this mixin

 

offset

The byte offset of the TpMessageMixin within the object structure

 

connection

A TpBaseConnection

 

Since: 0.7.21


tp_message_mixin_init_dbus_properties ()

void
tp_message_mixin_init_dbus_properties (GObjectClass *cls);

Set up a TpDBusPropertiesMixinClass to use this mixin's implementation of the Messages interface's properties.

This uses tp_message_mixin_get_dbus_property() as the property getter and sets a list of the supported properties for it.

Parameters

cls

The class of an object with this mixin

 

tp_message_mixin_messages_iface_init ()

void
tp_message_mixin_messages_iface_init (gpointer g_iface,
                                      gpointer iface_data);

Fill in this mixin's Messages method implementations in the given interface vtable.

Parameters

g_iface

A pointer to the TpSvcChannelInterfaceMessagesClass in an object class

 

iface_data

Ignored

 

Since: 0.7.21


tp_message_mixin_get_dbus_property ()

void
tp_message_mixin_get_dbus_property (GObject *object,
                                    GQuark interface,
                                    GQuark name,
                                    GValue *value,
                                    gpointer unused);

An implementation of TpDBusPropertiesMixinGetter which assumes that the object has the messages mixin. It can only be used for the Messages interface.

Parameters

object

An object with this mixin

 

interface

Must be TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES

 

name

A quark representing the D-Bus property name, either "PendingMessages", "SupportedContentTypes" or "MessagePartSupportFlags"

 

value

A GValue pre-initialized to the right type, into which to put the value

 

unused

Ignored

 

tp_message_mixin_sent ()

void
tp_message_mixin_sent (GObject *object,
                       TpMessage *message,
                       TpMessageSendingFlags flags,
                       const gchar *token,
                       const GError *error);

Indicate to the message mixin that message submission to the IM server has succeeded or failed. This should be called as soon as the CM determines it's theoretically possible to send the message (e.g. the parameters are supported and correct).

After this function is called, message will have been freed, and must not be dereferenced.

Parameters

object

An object implementing the Text and Messages interfaces with this mixin

 

message

The outgoing message

 

flags

The flags used when sending the message, which may be a subset of those passed to the TpMessageMixinSendImpl implementation if not all are supported, or 0 on error.

 

token

A token representing the sent message (see the Telepathy D-Bus API specification), or an empty string if no suitable identifier is available, or NULL on error

 

error

NULL on success, or the error with which message submission failed

 

Since: 0.7.21


tp_message_mixin_set_rescued ()

void
tp_message_mixin_set_rescued (GObject *obj);

Mark all pending messages as having been "rescued" from a channel that previously closed.

Parameters

obj

An object with this mixin

 

tp_message_mixin_take_received ()

guint
tp_message_mixin_take_received (GObject *object,
                                TpMessage *message);

Receive a message into the pending messages queue, where it will stay until acknowledged, and emit the Received and ReceivedMessage signals. Also emit the SendError signal if the message is a failed delivery report.

Parameters

object

a channel with this mixin

 

message

the message. Its ownership is claimed by the message mixin, so it must no longer be modified or freed

 

Returns

the message ID

Since: 0.7.21


tp_message_mixin_has_pending_messages ()

gboolean
tp_message_mixin_has_pending_messages (GObject *object,
                                       TpHandle *first_sender);

Return whether the channel obj has unacknowledged messages. If so, and first_sender is not NULL, the handle of the sender of the first message is placed in it, without incrementing the handle's reference count.

Parameters

object

An object with this mixin

 

first_sender

If not NULL, used to store the sender of the oldest pending message

 

Returns

TRUE if there are pending messages


tp_message_mixin_clear ()

void
tp_message_mixin_clear (GObject *obj);

Clear the pending message queue, deleting all messages without emitting PendingMessagesRemoved.

Parameters

obj

An object with this mixin

 

tp_message_mixin_text_iface_init ()

void
tp_message_mixin_text_iface_init (gpointer g_iface,
                                  gpointer iface_data);

Fill in this mixin's Text method implementations in the given interface vtable.

Parameters

g_iface

A pointer to the TpSvcChannelTypeTextClass in an object class

 

iface_data

Ignored

 

Since: 0.7.21


TpMessageMixinSendChatStateImpl ()

gboolean
(*TpMessageMixinSendChatStateImpl) (GObject *object,
                                    TpChannelChatState state,
                                    GError **error);

Signature of a virtual method which may be implemented to allow sending chat state.

Parameters

object

an instance of the implementation that uses this mixin

 

state

a TpChannelChatState to be send

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.19.0


tp_message_mixin_chat_state_iface_init ()

void
tp_message_mixin_chat_state_iface_init
                               (gpointer g_iface,
                                gpointer iface_data);

Fill in this mixin's ChatState method implementations in the given interface vtable.

Parameters

g_iface

A pointer to the TpSvcChannelInterfaceChatStateClass in an object class

 

iface_data

Ignored

 

Since: 0.19.0


tp_message_mixin_change_chat_state ()

void
tp_message_mixin_change_chat_state (GObject *object,
                                    TpHandle member,
                                    TpChannelChatState state);

Change the current chat state of member to be state . This emits ChatStateChanged signal and update ChatStates property.

Parameters

object

an instance of the implementation that uses this mixin

 

member

a member of this chat

 

state

the new state to set

 

Since: 0.19.0


tp_message_mixin_implement_send_chat_state ()

void
tp_message_mixin_implement_send_chat_state
                               (GObject *object,
                                TpMessageMixinSendChatStateImpl send_chat_state);

Set the callback used to implement SetChatState. This must be called from the init, constructor or constructed callback, after tp_message_mixin_init(), and may only be called once per object.

Parameters

object

an instance of the implementation that uses this mixin

 

send_chat_state

send our chat state

 

Since: 0.19.0


tp_message_mixin_maybe_send_gone ()

void
tp_message_mixin_maybe_send_gone (GObject *object);

Send TP_CHANNEL_CHAT_STATE_GONE if needed. This should be called on private chats when channel is closed.

Parameters

object

An instance of the implementation that uses this mixin

 

Since: 0.19.0

Types and Values

struct TpMessageMixin

struct TpMessageMixin {
};

Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_message_mixin_init().

There are no public fields.

Since: 0.7.21

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-handle-repo.html0000644000175000017500000030002414006623344023261 00000000000000 TpHandleRepoIface: telepathy-glib API Reference Manual

TpHandleRepoIface

TpHandleRepoIface — abstract interface for handle allocation

Properties

guint handle-type Read / Write / Construct Only

Object Hierarchy

    GBoxed
    ╰── TpHandleSet
    GInterface
    ╰── TpHandleRepoIface

Prerequisites

TpHandleRepoIface requires GObject.

Known Implementations

TpHandleRepoIface is implemented by TpDynamicHandleRepo and TpStaticHandleRepo.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Abstract interface of a repository for handles, supporting operations which include checking for validity, lookup by string value and lookup by numeric value. See TpDynamicHandleRepo and TpStaticHandleRepo for concrete implementations.

Functions

tp_handle_is_valid ()

gboolean
tp_handle_is_valid (TpHandleRepoIface *self,
                    TpHandle handle,
                    GError **error);

[skip]

Parameters

self

A handle repository implementation

 

handle

A handle of the type stored in the repository self

 

error

Set to InvalidHandle if FALSE is returned

 

Returns

TRUE if the handle is nonzero and is present in the repository, else FALSE


tp_handles_are_valid ()

gboolean
tp_handles_are_valid (TpHandleRepoIface *self,
                      const GArray *handles,
                      gboolean allow_zero,
                      GError **error);

[skip]

Parameters

self

A handle repository implementation

 

handles

Array of TpHandle representing handles of the type stored in the repository self

 

allow_zero

If TRUE, zero is treated like a valid handle

 

error

Set to InvalidHandle if FALSE is returned

 

Returns

TRUE if the handle is present in the repository, else FALSE


tp_handles_supported_and_valid ()

gboolean
tp_handles_supported_and_valid (TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES],
                                TpHandleType handle_type,
                                const GArray *handles,
                                gboolean allow_zero,
                                GError **error);

Return TRUE if the given handle type is supported (i.e. repos[handle_type] is not NULL) and the given handles are all valid in that repository. If not, set error and return FALSE.

[skip]

Parameters

repos

An array of possibly null pointers to handle repositories, indexed by handle type, where a null pointer means an unsupported handle type

 

handle_type

The handle type

 

handles

A GArray of guint representing handles of the given type

 

allow_zero

If TRUE, zero is treated like a valid handle

 

error

Used to return an error if FALSE is returned

 

Returns

TRUE if the handle type is supported and the handles are all valid.


tp_handle_ref ()

TpHandle
tp_handle_ref (TpHandleRepoIface *self,
               TpHandle handle);

tp_handle_ref is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

Changed in 0.13.6: handle is now returned; previously, this function didn't return anything.

[skip]

Parameters

self

not used

 

handle

not used

 

Returns

the same handle


tp_handles_ref ()

void
tp_handles_ref (TpHandleRepoIface *self,
                const GArray *handles);

tp_handles_ref is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

not used

 

handles

not used

 

tp_handle_unref ()

void
tp_handle_unref (TpHandleRepoIface *self,
                 TpHandle handle);

tp_handle_unref is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

A handle repository implementation

 

handle

A handle of the type stored in the repository

 

tp_handles_unref ()

void
tp_handles_unref (TpHandleRepoIface *self,
                  const GArray *handles);

tp_handles_unref is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

not used

 

handles

not used

 

tp_handle_client_hold ()

gboolean
tp_handle_client_hold (TpHandleRepoIface *self,
                       const gchar *client,
                       TpHandle handle,
                       GError **error);

tp_handle_client_hold is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

not used

 

client

not used

 

handle

not used

 

error

not set

 

Returns

TRUE


tp_handles_client_hold ()

gboolean
tp_handles_client_hold (TpHandleRepoIface *self,
                        const gchar *client,
                        const GArray *handles,
                        GError **error);

tp_handles_client_hold is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

ignored

 

client

ignored

 

handles

ignored

 

error

ignored

 

Returns

TRUE


tp_handle_client_release ()

gboolean
tp_handle_client_release (TpHandleRepoIface *self,
                          const gchar *client,
                          TpHandle handle,
                          GError **error);

tp_handle_client_release is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

ignored

 

client

ignored

 

handle

ignored

 

error

ignored

 

Returns

TRUE


tp_handles_client_release ()

gboolean
tp_handles_client_release (TpHandleRepoIface *self,
                           const gchar *client,
                           const GArray *handles,
                           GError **error);

tp_handles_client_release is deprecated and should not be used in newly-written code.

This is no-op so can be safely removed.

Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles.

[skip]

Parameters

self

ignored

 

client

ignored

 

handles

ignored

 

error

ignored

 

Returns

TRUE


tp_handle_inspect ()

const char *
tp_handle_inspect (TpHandleRepoIface *self,
                   TpHandle handle);

[skip]

Parameters

self

A handle repository implementation

 

handle

A handle of the type stored in the repository

 

Returns

the string represented by the given handle, or NULL if the handle is absent from the repository. The string is owned by the handle repository and will remain valid as long as a reference to the handle exists.


tp_handle_set_qdata ()

void
tp_handle_set_qdata (TpHandleRepoIface *repo,
                     TpHandle handle,
                     GQuark key_id,
                     gpointer data,
                     GDestroyNotify destroy);

tp_handle_set_qdata is deprecated and should not be used in newly-written code.

Since 0.19.9. It is not recommended to use this function because the associated data won't be freed until the connection disconnects.

Associates a blob of data with a given handle and a given key

If destroy is set, then the data is freed when the handle is freed.

Since version 0.13.8, handles always last as long as the connection, so destroy will not be called until the connection disconnects.

[skip]

Parameters

repo

A handle repository implementation

 

handle

A handle to set data on

 

key_id

Key id to associate data with

 

data

data to associate with handle

 

destroy

A GDestroyNotify to call to destroy the data, or NULL if not needed.

 

tp_handle_get_qdata ()

gpointer
tp_handle_get_qdata (TpHandleRepoIface *repo,
                     TpHandle handle,
                     GQuark key_id);

tp_handle_get_qdata is deprecated and should not be used in newly-written code.

Since 0.19.9. It is not recommended to use this function because the associated data won't be freed until the connection disconnects.

[skip]

Parameters

repo

A handle repository implementation

 

handle

A handle to get data from

 

key_id

Key id of data to fetch

 

Returns

the data associated with a given key on a given handle; NULL if there is no associated data.


tp_handle_ensure ()

TpHandle
tp_handle_ensure (TpHandleRepoIface *self,
                  const gchar *id,
                  gpointer context,
                  GError **error);

Return a handle for the given string, creating one if necessary. The string is normalized, if possible.

Parameters

self

A handle repository implementation

 

id

A string whose handle is required

 

context

User data to be passed to the normalization callback

 

error

Used to return an error if 0 is returned

 

Returns

the handle corresponding to the given string, or 0 if it is invalid.


tp_handle_lookup ()

TpHandle
tp_handle_lookup (TpHandleRepoIface *self,
                  const gchar *id,
                  gpointer context,
                  GError **error);

Return the handle for the given string. The string is normalized if possible. If no handle already exists for the string, none is created.

[skip]

Parameters

self

A handle repository implementation

 

id

A string whose handle is required

 

context

User data to be passed to the normalization callback

 

error

Used to raise an error if the handle does not exist or is invalid

 

Returns

the handle corresponding to the given string, or 0 if it does not exist or is invalid


tp_handle_ensure_async ()

void
tp_handle_ensure_async (TpHandleRepoIface *self,
                        TpBaseConnection *connection,
                        const gchar *id,
                        gpointer context,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Asyncronously normalize an identifier and create an handle for it. This could involve a server round-trip. This should be used instead of tp_handle_ensure() for user provided contact identifiers, but it is not necessary for identifiers from the server.

[skip]

Parameters

self

A handle repository implementation

 

connection

the TpBaseConnection using this handle repo

 

id

A string whose handle is required

 

context

User data to be passed to the normalization callback

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.19.2


tp_handle_ensure_finish ()

TpHandle
tp_handle_ensure_finish (TpHandleRepoIface *self,
                         GAsyncResult *result,
                         GError **error);

Finishes tp_handle_ensure_async()

[skip]

Parameters

self

A handle repository implementation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

non-0 TpHandle if the operation was successful, otherwise 0.

Since: 0.19.2


TpHandleSetMemberFunc ()

void
(*TpHandleSetMemberFunc) (TpHandleSet *set,
                          TpHandle handle,
                          gpointer userdata);

Signature of the callback used to iterate over the handle set in tp_handle_set_foreach().

[skip]

Parameters

set

The set of handles on which tp_handle_set_foreach() was called

 

handle

A handle in the set

 

userdata

Arbitrary user data as supplied to tp_handle_set_foreach()

 

tp_handle_set_new ()

TpHandleSet *
tp_handle_set_new (TpHandleRepoIface *repo);

Creates a new TpHandleSet

[skip]

Parameters

repo

TpHandleRepoIface that holds the handles to be reffed by this set

 

Returns

A new TpHandleSet.

[transfer full]


tp_handle_set_new_containing ()

TpHandleSet *
tp_handle_set_new_containing (TpHandleRepoIface *repo,
                              TpHandle handle);

Creates a new TpHandleSet from a specified handle repository and single handle.

[skip]

Parameters

repo

TpHandleRepoIface that holds the handles to be reffed by this set

 

handle

a valid handle

 

Returns

A new TpHandleSet.

[transfer full]

Since: 0.13.0


tp_handle_set_new_from_array ()

TpHandleSet *
tp_handle_set_new_from_array (TpHandleRepoIface *repo,
                              const GArray *array);

Creates a new TpHandleSet

[skip]

Parameters

repo

TpHandleRepoIface that holds the handles to be reffed by this set

 

array

array of handles to be referenced by this set.

[element-type uint]

Returns

A new TpHandleSet.

[transfer full]

Since: 0.11.7


tp_handle_set_new_from_intset ()

TpHandleSet *
tp_handle_set_new_from_intset (TpHandleRepoIface *repo,
                               const TpIntset *intset);

Creates a new TpHandleSet from a specified handle repository and set of handles.

[skip]

Parameters

repo

TpHandleRepoIface that holds the handles to be reffed by this set

 

intset

a set of handles, which must all be valid

 

Returns

A new TpHandleSet.

[transfer full]

Since: 0.13.0


tp_handle_set_copy ()

TpHandleSet *
tp_handle_set_copy (const TpHandleSet *other);

Creates a new TpHandleSet with the same contents as other .

[skip]

Parameters

other

another handle set

 

Returns

a new set

Since: 0.11.6


tp_handle_set_clear ()

void
tp_handle_set_clear (TpHandleSet *set);

Remove every handle from set , releasing the references it holds.

[skip]

Parameters

set

TpHandleSet to clear

 

Since: 0.11.6


tp_handle_set_destroy ()

void
tp_handle_set_destroy (TpHandleSet *set);

Delete a TpHandleSet and unreference any handles that it holds

[skip]

Parameters

set

TpHandleSet to destroy

 

tp_handle_set_peek ()

TpIntset *
tp_handle_set_peek (TpHandleSet *set);

[skip]

Parameters

set

TpHandleSet to peek at

 

Returns

the underlying TpIntset used by this TpHandleSet.

[transfer none]


tp_handle_set_add ()

void
tp_handle_set_add (TpHandleSet *set,
                   TpHandle handle);

Add a handle to a TpHandleSet, and reference it in the attached TpHandleRepoIface

[skip]

Parameters

set

TpHandleSet to add this handle to

 

handle

handle to add

 

tp_handle_set_remove ()

gboolean
tp_handle_set_remove (TpHandleSet *set,
                      TpHandle handle);

Remove a handle from a TpHandleSet, and unreference it in the attached TpHandleRepoIface

[skip]

Parameters

set

TpHandleSet to remove this handle from

 

handle

handle to remove

 

Returns

FALSE if the handle was invalid, or was not in this set


tp_handle_set_is_member ()

gboolean
tp_handle_set_is_member (const TpHandleSet *set,
                         TpHandle handle);

Check if the handle is in this set

[skip]

Parameters

set

A TpHandleSet

 

handle

handle to check

 

Returns

TRUE if the handle is in this set


tp_handle_set_foreach ()

void
tp_handle_set_foreach (TpHandleSet *set,
                       TpHandleSetMemberFunc func,
                       gpointer user_data);

Call func (set , handle , userdata ) for each handle in set .

[skip]

Parameters

set

A set of handles

 

func

A callback.

[scope call]

user_data

Arbitrary data to pass to func

 

tp_handle_set_is_empty ()

gboolean
tp_handle_set_is_empty (const TpHandleSet *set);

Return the same thing as (tp_handle_set_size (set) == 0), but calculated more efficiently.

[skip]

Parameters

set

TpHandleSet to check

 

Returns

TRUE if the set has no members

Since: 0.11.6


tp_handle_set_size ()

int
tp_handle_set_size (const TpHandleSet *set);

[skip]

Parameters

set

A set of handles

 

Returns

the number of handles in this set


tp_handle_set_to_array ()

GArray *
tp_handle_set_to_array (const TpHandleSet *set);

[skip]

Parameters

set

A handle set

 

Returns

a newly-allocated GArray of guint representing the handles in the set.

[element-type uint]


tp_handle_set_to_identifier_map ()

GHashTable *
tp_handle_set_to_identifier_map (TpHandleSet *self);

Returns a dictionary mapping each handle in self to the corresponding identifier, as if retrieved by calling tp_handle_inspect() on each handle. The type of the returned value is described as

Handle_Identifier_Map in the Telepathy specification.

Parameters

self

a handle set

 

Returns

a map from the handles in self to the corresponding identifier.

[transfer full][element-type TpHandle utf8]


tp_handle_set_update ()

TpIntset *
tp_handle_set_update (TpHandleSet *set,
                      const TpIntset *add);

Add a set of handles to a handle set, referencing those which are not already members. The TpIntset returned must be freed with tp_intset_destroy.

[skip]

Parameters

set

a TpHandleSet to update

 

add

a TpIntset of handles to add

 

Returns

the handles which were added (some subset of add )


tp_handle_set_difference_update ()

TpIntset *
tp_handle_set_difference_update (TpHandleSet *set,
                                 const TpIntset *remove);

Remove a set of handles from a handle set, dereferencing those which are members. The TpIntset returned must be freed with tp_intset_destroy.

If you want to be able to inspect the handles in the set returned, you must ensure that this function does not cause their refcount to drop to zero, for instance by temporarily taking a reference to all the handles in remove , calling this function, doing something with the result and discarding the temporary references.

[skip]

Parameters

set

a TpHandleSet to update

 

remove

a TpIntset of handles to remove

 

Returns

the handles which were dereferenced and removed (some subset of remove ).


tp_handle_set_dump ()

gchar *
tp_handle_set_dump (const TpHandleSet *self);

Format a TpHandleSet for debug output.

Parameters

self

a handle set

 

Returns

a string representation of the handle set suitable for debug output.

[transfer full][type utf8]

Types and Values

TpHandleRepoIface

typedef struct _TpHandleRepoIface TpHandleRepoIface;

Dummy typedef representing any implementation of this interface.


TpHandleRepoIfaceClass

typedef struct _TpHandleRepoIfaceClass TpHandleRepoIfaceClass;

The class of a handle repository interface. The structure layout is only available within telepathy-glib, for the handle repository implementations' benefit.


TpHandleSet

typedef struct _TpHandleSet TpHandleSet;

A set of handles. This is similar to a TpIntset (and implemented using one), but adding a handle to the set also references it.


TP_TYPE_HANDLE_SET

#define TP_TYPE_HANDLE_SET (tp_handle_set_get_type ())

The boxed type of a TpHandleSet.

Since: 0.11.6

Property Details

The “handle-type” property

  “handle-type”              guint

The TpHandleType held in this handle repository.

Owner: TpHandleRepoIface

Flags: Read / Write / Construct Only

Default value: 0

See Also

TpDynamicHandleRepo, TpStaticHandleRepo

telepathy-glib-0.24.2/docs/reference/html/TpBaseMediaCallContent.html0000644000175000017500000005731114006623343022427 00000000000000 TpBaseMediaCallContent: telepathy-glib API Reference Manual

TpBaseMediaCallContent

TpBaseMediaCallContent — base class for TpSvcCallContentInterfaceMedia implementations

Properties

guchar current-dtmf-event Read
guint current-dtmf-state Read
GHashTable_guint+GHashTable_gchararray+GValue__* local-media-descriptions Read
GValueArray_DBusGObjectPath+GHashTable_gchararray+GValue__* media-description-offer Read
guint packetization Read / Write / Construct Only
GHashTable_guint+GHashTable_gchararray+GValue__* remote-media-descriptions Read

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseCallContent
        ╰── TpBaseMediaCallContent

Implemented Interfaces

TpBaseMediaCallContent implements TpSvcDBusProperties, TpSvcCallContent, TpSvcCallContentInterfaceDTMF and TpSvcCallContentInterfaceMedia.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcCallContentInterfaceMedia implementations by implementing its properties and methods.

Subclasses must still implement TpBaseCallContent's virtual methods.

Functions

tp_base_media_call_content_get_local_media_description ()

GHashTable *
tp_base_media_call_content_get_local_media_description
                               (TpBaseMediaCallContent *self,
                                TpHandle contact);

Get the media description used to stream to contact .

Parameters

self

a TpBaseMediaCallContent

 

contact

the contact

 

Returns

borrowed GHashTable mapping iface propery string to GValue.

Since: 0.17.5


tp_base_media_call_content_offer_media_description_async ()

void
tp_base_media_call_content_offer_media_description_async
                               (TpBaseMediaCallContent *self,
                                TpCallContentMediaDescription *md,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Offer md for media description negociation.

Parameters

self

a TpBaseMediaCallContent

 

md

a TpCallContentMediaDescription

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_base_media_call_content_offer_media_description_finish ()

gboolean
tp_base_media_call_content_offer_media_description_finish
                               (TpBaseMediaCallContent *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_base_media_call_content_offer_media_description_async().

Parameters

self

a TpBaseMediaCallContent

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5

Types and Values

struct TpBaseMediaCallContent

struct TpBaseMediaCallContent;

A base class for media call content implementations

Since: 0.17.5


struct TpBaseMediaCallContentClass

struct TpBaseMediaCallContentClass {
};

The class structure for TpBaseMediaCallContent

Since: 0.17.5

Property Details

The “current-dtmf-event” property

  “current-dtmf-event”       guchar

The currently being played TpDTMFEvent if any

Owner: TpBaseMediaCallContent

Flags: Read

Allowed values: <= 15

Default value: 0

Since: 0.17.5


The “current-dtmf-state” property

  “current-dtmf-state”       guint

The TpSendingState of the dtmf events

Owner: TpBaseMediaCallContent

Flags: Read

Allowed values: <= 3

Default value: 0

Since: 0.17.5


The “local-media-descriptions” property

  “local-media-descriptions” GHashTable_guint+GHashTable_gchararray+GValue__*

GHashTable{contact TpHandle, properties GHashTable} The map of contacts to local media descriptions.

Owner: TpBaseMediaCallContent

Flags: Read

Since: 0.17.5


The “media-description-offer” property

  “media-description-offer”  GValueArray_DBusGObjectPath+GHashTable_gchararray+GValue__*

GValueArray{object-path, contact TpHandle, properties GHashTable}. The current media description offer if any.

Owner: TpBaseMediaCallContent

Flags: Read

Since: 0.17.5


The “packetization” property

  “packetization”            guint

The TpCallContentPacketizationType of this content.

Owner: TpBaseMediaCallContent

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “remote-media-descriptions” property

  “remote-media-descriptions” GHashTable_guint+GHashTable_gchararray+GValue__*

GHashTable{contact TpHandle, properties GHashTable} The map of contacts to remote media descriptions.

Owner: TpBaseMediaCallContent

Flags: Read

Since: 0.17.5

Signal Details

The “local-media-description-updated” signal

void
user_function (TpBaseMediaCallContent *self,
               guint                   contact,
               GHashTable             *properties,
               gpointer                user_data)

The ::local-media-description-changed signal is emitted whenever the local media description changes for a remote contact.

Parameters

self

the TpCallChannel

 

contact

the remote contact

 

properties

the new media description properties asv

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-handle.html0000644000175000017500000002044414006623344022323 00000000000000 TpHandle: telepathy-glib API Reference Manual

TpHandle

TpHandle — type representing handles

Functions

gboolean tp_handle_type_is_valid ()
const gchar * tp_handle_type_to_string ()

Types and Values

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

The TpHandle type represents a Telepathy handle.

Functions

tp_handle_type_is_valid ()

gboolean
tp_handle_type_is_valid (TpHandleType type,
                         GError **error);

If the given handle type is valid, return TRUE. If not, set error and return FALSE.

Parameters

type

A handle type, valid or not, to be checked

 

error

Set if the handle type is invalid

 

Returns

TRUE if the handle type is valid.


tp_handle_type_to_string ()

const gchar *
tp_handle_type_to_string (TpHandleType type);

Parameters

type

A handle type, which need not be valid

 

Returns

a human-readable string describing the handle type, e.g. "contact". For invalid handle types, returns "(no handle)" for 0 or "(invalid handle type)" for others.

Types and Values

TpHandle

typedef guint TpHandle;

Type representing Telepathy handles within telepathy-glib.

This is guint despite the wire protocol having 32-bit integers, because dbus-glib expects GArrays of guint and so on. If the dbus-glib ABI changes in future, telepathy-glib is likely to have a matching ABI change.


TP_TYPE_HANDLE

#define TP_TYPE_HANDLE G_TYPE_UINT

The GType of a TpHandle, currently G_TYPE_UINT.

This won't change unless in an ABI-incompatible version of telepathy-glib.


TP_UNKNOWN_HANDLE_TYPE

#define TP_UNKNOWN_HANDLE_TYPE ((TpHandleType) -1)

An invalid handle type (-1 cast to TpHandleType) used to represent an unknown handle type.

Since: 0.7.0

See Also

TpHandleRepoIface

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-call-channel.html0000644000175000017500000023707314006623344024166 00000000000000 Channel Call interfaces: telepathy-glib API Reference Manual

Channel Call interfaces

Channel Call interfaces — client-side wrappers for call channels

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Call channels represent real-time audio or video streaming, including voice over IP, webcams, and telephony.

Functions

tp_cli_channel_type_call_call_accept ()

TpProxyPendingCall *
tp_cli_channel_type_call_call_accept (TpChannel *proxy,
                                      gint timeout_ms,
                                      tp_cli_channel_type_call_callback_for_accept callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a Accept method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>For incoming calls in state <tp:value-ref type="Call_State">Initialised</tp:value-ref>, accept the incoming call. This changes the <tp:member-ref>CallState</tp:member-ref> to <tp:value-ref type="Call_State">Accepted</tp:value-ref>.</p> <p>For outgoing calls in state <tp:value-ref type="Call_State">Pending_Initiator</tp:value-ref>, actually call the remote contact; this changes the <tp:member-ref>CallState</tp:member-ref> to <tp:value-ref type="Call_State">Initialising</tp:value-ref>.</p> <p>Otherwise, this method SHOULD fail with the error NotAvailable.</p> <p>This method should be called exactly once per Call, by whatever client (user interface) is handling the channel.</p> <p>When this method is called, for each <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> whose <tp:dbus-ref namespace="ofdT.Call1.Content">Disposition</tp:dbus-ref> is <tp:value-ref type="Call_Content_Disposition">Initial</tp:value-ref>, any streams where the <tp:dbus-ref namespace="ofdT.Call1.Stream">LocalSendingState</tp:dbus-ref> is <tp:value-ref type="Sending_State">Pending_Send</tp:value-ref> will be moved to <tp:value-ref type="Sending_State">Sending</tp:value-ref> as if <tp:dbus-ref namespace="ofdT.Call1.Stream">SetSending</tp:dbus-ref>(True) had been called.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_call_call_add_content ()

TpProxyPendingCall *
tp_cli_channel_type_call_call_add_content
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Content_Name,
                                guint in_Content_Type,
                                guint in_InitialDirection,
                                tp_cli_channel_type_call_callback_for_add_content callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddContent method call.

Request that a new <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> of type Content_Type is added to the Call1. Handlers should check the value of the <tp:member-ref>MutableContents</tp:member-ref> property before trying to add another content as it might not be allowed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Content_Name

Used to pass an 'in' argument: <p>The suggested name of the content to add.</p> <tp:rationale> The content name property should be meaningful, so should be given a name which is significant to the user. The name could be a localized &quot;audio&quot;, &quot;video&quot; or perhaps include some string identifying the source, such as a webcam identifier. </tp:rationale> <p>If there is already a content with the same name as this property then a sensible suffix should be added. For example, if this argument is &quot;audio&quot; but a content of the same name already exists, a sensible suffix such as &quot; (1)&quot; is appended to name the new content &quot;audio (1)&quot;. A further content with the name &quot;audio&quot; would then be named &quot;audio (2)&quot;.</p>

 

in_Content_Type

Used to pass an 'in' argument: The media stream type of the content to be added to the call. (TpMediaStreamType)

 

in_InitialDirection

Used to pass an 'in' argument: The requested initial direction of the new content. (TpMediaStreamDirection)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_call_call_hangup ()

TpProxyPendingCall *
tp_cli_channel_type_call_call_hangup (TpChannel *proxy,
                                      gint timeout_ms,
                                      guint in_Reason,
                                      const gchar *in_Detailed_Hangup_Reason,
                                      const gchar *in_Message,
                                      tp_cli_channel_type_call_callback_for_hangup callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a Hangup method call.

Request that the call is ended. All contents will be removed from the Call so that the <tp:member-ref>Contents</tp:member-ref> property will be the empty list.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: A generic hangup reason. (TpCallStateChangeReason)

 

in_Detailed_Hangup_Reason

Used to pass an 'in' argument: A more specific reason for the call hangup, if one is available, or an empty string otherwise.

 

in_Message

Used to pass an 'in' argument: A human-readable message to be sent to the remote contact(s). <tp:rationale> XMPP Jingle allows calls to be terminated with a human-readable message. </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_call_call_set_queued ()

TpProxyPendingCall *
tp_cli_channel_type_call_call_set_queued
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_call_callback_for_set_queued callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetQueued method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Notifies the CM that the local user is already in a call, so this call has been put in a call-waiting style queue.</p> <p>This method is only useful if the channel's <tp:dbus-ref namespace="ofdT.Channel">Requested</tp:dbus-ref> property is False, and the <tp:member-ref>CallState</tp:member-ref> is <tp:value-ref type="Call_State">Initialising</tp:value-ref> or <tp:value-ref type="Call_State">Initialised</tp:value-ref>. Calling this method SHOULD set <tp:member-ref>CallFlags</tp:member-ref>' bit <tp:value-ref type="Call_Flags">Locally_Queued</tp:value-ref>, and notify the remote contact that the call is in a queue (if the protocol supports this); repeated calls to this method SHOULD succeed, but have no further effect.</p> <p>Locally_Queued is a little like Locally_Held, but applies to calls that have not been Accepted (the Locally_Queued flag should be unset by the CM when Accept is called). It should also be set in response to the state of the world, rather than in response to user action.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_call_call_set_ringing ()

TpProxyPendingCall *
tp_cli_channel_type_call_call_set_ringing
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_call_callback_for_set_ringing callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetRinging method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Indicate that the local user has been alerted about the incoming call.</p> <p>This method is only useful if the channel's <tp:dbus-ref namespace="ofdT.Channel">Requested</tp:dbus-ref> property is False, and the <tp:member-ref>CallState</tp:member-ref> is <tp:value-ref type="Call_State">Initialised</tp:value-ref> (an incoming call is ready and waiting for the user to be notified). Calling this method SHOULD set <tp:member-ref>CallFlags</tp:member-ref>' bit <tp:value-ref type="Call_Flags">Locally_Ringing</tp:value-ref>, and notify the remote contact that the local user has been alerted (if the protocol supports this); repeated calls to this method SHOULD succeed, but have no further effect.</p> <p>In all other states, this method SHOULD fail with the error NotAvailable.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_call_callback_for_accept ()

void
(*tp_cli_channel_type_call_callback_for_accept)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Accept method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_call_callback_for_add_content ()

void
(*tp_cli_channel_type_call_callback_for_add_content)
                               (TpChannel *proxy,
                                const gchar *out_Content,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddContent method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Content

Used to return an 'out' argument if error is NULL: Path to the newly-created <tp:dbus-ref namespace="org.freedesktop.Telepathy">Call1.Content</tp:dbus-ref> object.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_call_callback_for_hangup ()

void
(*tp_cli_channel_type_call_callback_for_hangup)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Hangup method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_call_callback_for_set_queued ()

void
(*tp_cli_channel_type_call_callback_for_set_queued)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetQueued method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_call_callback_for_set_ringing ()

void
(*tp_cli_channel_type_call_callback_for_set_ringing)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetRinging method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_call_connect_to_call_members_changed ()

TpProxySignalConnection *
tp_cli_channel_type_call_connect_to_call_members_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_call_signal_callback_call_members_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal CallMembersChanged.

Emitted when the <tp:member-ref>CallMembers</tp:member-ref> property changes in any way, either because contacts have been added to the call, contacts have been removed from the call, or contacts' flags have changed.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_call_connect_to_call_state_changed ()

TpProxySignalConnection *
tp_cli_channel_type_call_connect_to_call_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_call_signal_callback_call_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal CallStateChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the state of the call as a whole changes.</p> <p>This signal is emitted for any change in the properties corresponding to its arguments, even if the other properties referenced remain unchanged.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_call_connect_to_content_added ()

TpProxySignalConnection *
tp_cli_channel_type_call_connect_to_content_added
                               (TpChannel *proxy,
                                tp_cli_channel_type_call_signal_callback_content_added callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContentAdded.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a new <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> is added to the call.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_call_connect_to_content_removed ()

TpProxySignalConnection *
tp_cli_channel_type_call_connect_to_content_removed
                               (TpChannel *proxy,
                                tp_cli_channel_type_call_signal_callback_content_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContentRemoved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> is removed from the call.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_call_signal_callback_call_members_changed ()

void
(*tp_cli_channel_type_call_signal_callback_call_members_changed)
                               (TpChannel *proxy,
                                GHashTable *arg_Flags_Changed,
                                GHashTable *arg_Identifiers,
                                const GArray *arg_Removed,
                                const GValueArray *arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal CallMembersChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_call_connect_to_call_members_changed() was called

 

arg_Flags_Changed

A map from members of the call to their new call member flags, including at least the members who have been added to <tp:member-ref>CallMembers</tp:member-ref>, and the members whose flags have changed.

 

arg_Identifiers

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The identifiers of the contacts in the <var>Flags_Changed</var> map.

 

arg_Removed

A list of members who have left the call, i.e. keys to be removed from <tp:member-ref>CallMembers</tp:member-ref>.

 

arg_Reason

A structured reason for the change.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_call_signal_callback_call_state_changed ()

void
(*tp_cli_channel_type_call_signal_callback_call_state_changed)
                               (TpChannel *proxy,
                                guint arg_Call_State,
                                guint arg_Call_Flags,
                                const GValueArray *arg_Call_State_Reason,
                                GHashTable *arg_Call_State_Details,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal CallStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_call_connect_to_call_state_changed() was called

 

arg_Call_State

The new value of the <tp:member-ref>CallState</tp:member-ref> property. (TpCallState)

 

arg_Call_Flags

The new value of the <tp:member-ref>CallFlags</tp:member-ref> property. (TpCallFlags)

 

arg_Call_State_Reason

The new value of the <tp:member-ref>CallStateReason</tp:member-ref> property.

 

arg_Call_State_Details

The new value of the <tp:member-ref>CallStateDetails</tp:member-ref> property.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_call_signal_callback_content_added ()

void
(*tp_cli_channel_type_call_signal_callback_content_added)
                               (TpChannel *proxy,
                                const gchar *arg_Content,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContentAdded.

Parameters

proxy

The proxy on which tp_cli_channel_type_call_connect_to_content_added() was called

 

arg_Content

Path to the newly-created <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> object.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_call_signal_callback_content_removed ()

void
(*tp_cli_channel_type_call_signal_callback_content_removed)
                               (TpChannel *proxy,
                                const gchar *arg_Content,
                                const GValueArray *arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContentRemoved.

Parameters

proxy

The proxy on which tp_cli_channel_type_call_connect_to_content_removed() was called

 

arg_Content

The <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref> which was removed.

 

arg_Reason

Why the content was removed.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-simple-client-factory.html0000644000175000017500000027510614006623344025311 00000000000000 TpSimpleClientFactory: telepathy-glib API Reference Manual

TpSimpleClientFactory

TpSimpleClientFactory — a factory for TpContacts and plain subclasses of TpProxy

Properties

TpDBusDaemon * dbus-daemon Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── TpSimpleClientFactory
        ╰── TpAutomaticClientFactory

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This factory constructs various TpProxy subclasses as well as TpContact, which guarantees that at most one instance of those objects will exist for a given remote object or contact. It also stores the desired features for contacts and each type of proxy.

Note that the factory will not prepare the desired features: it is the caller's responsibility to do so. By default, only core features are requested.

Currently supported classes are TpAccount, TpConnection, TpChannel and TpContact. Those objects should always be acquired through a factory or a "larger" object (e.g. getting the TpConnection from a TpAccount), rather than being constructed directly.

One can subclass TpSimpleClientFactory and override some of its virtual methods to construct more specialized objects. See TpAutomaticClientFactory for a subclass which automatically constructs subclasses of TpChannel for common channel types.

An application using its own factory subclass would look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
int main(int argc, char *argv[])
{
  TpSimpleClientFactory *factory;
  TpAccountManager *manager;

  factory = my_factory_new ();
  manager = tp_account_manager_new_with_factory (factory);
  tp_account_manager_set_default (manager);

  ...
  tp_proxy_prepare_async (manager, am_features, callback, user_data);
  ...
}

The call to tp_account_manager_set_default() near the beginning of main() will ensure that any libraries or plugins which also use Telepathy (and call tp_account_manager_dup()) will share your TpAccountManager.

Functions

tp_simple_client_factory_new ()

TpSimpleClientFactory *
tp_simple_client_factory_new (TpDBusDaemon *dbus);

Creates a new TpSimpleClientFactory instance. If dbus is NULL, tp_dbus_daemon_dup() will be used.

Parameters

dbus

a TpDBusDaemon, or NULL.

[allow-none]

Returns

a new TpSimpleClientFactory

Since: 0.15.5


tp_simple_client_factory_get_dbus_daemon ()

TpDBusDaemon *
tp_simple_client_factory_get_dbus_daemon
                               (TpSimpleClientFactory *self);

Parameters

self

a TpSimpleClientFactory object

 

Returns

the value of the “dbus-daemon” property.

[transfer none]

Since: 0.15.5


tp_simple_client_factory_ensure_account ()

TpAccount *
tp_simple_client_factory_ensure_account
                               (TpSimpleClientFactory *self,
                                const gchar *object_path,
                                const GHashTable *immutable_properties,
                                GError **error);

Returns a TpAccount proxy for the account at object_path . The returned TpAccount is cached; the same TpAccount object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpAccount is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_account_features()).

This function is rather low-level. tp_account_manager_dup_valid_accounts() and “validity-changed” are more appropriate for most applications.

Parameters

self

a TpSimpleClientFactory object

 

object_path

the object path of an account

 

immutable_properties

the immutable properties of the account, or NULL.

[transfer none][element-type utf8 GObject.Value]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpAccount; see tp_account_new().

[transfer full]

Since: 0.15.5


tp_simple_client_factory_dup_account_features ()

GArray *
tp_simple_client_factory_dup_account_features
                               (TpSimpleClientFactory *self,
                                TpAccount *account);

Return a zero-terminated GArray containing the TpAccount features that should be prepared on account .

Parameters

self

a TpSimpleClientFactory object

 

account

a TpAccount

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since: 0.15.5


tp_simple_client_factory_add_account_features ()

void
tp_simple_client_factory_add_account_features
                               (TpSimpleClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpAccount objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_account_features().

It is not necessary to add TP_ACCOUNT_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpAccount objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpSimpleClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since: 0.15.5


tp_simple_client_factory_add_account_features_varargs ()

void
tp_simple_client_factory_add_account_features_varargs
                               (TpSimpleClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_simple_client_factory_add_account_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a TpSimpleClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.15.5


tp_simple_client_factory_ensure_connection ()

TpConnection *
tp_simple_client_factory_ensure_connection
                               (TpSimpleClientFactory *self,
                                const gchar *object_path,
                                const GHashTable *immutable_properties,
                                GError **error);

Returns a TpConnection proxy for the connection at object_path . The returned TpConnection is cached; the same TpConnection object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpConnection is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_connection_features()).

This function is rather low-level. “connection” is more appropriate for most applications.

Parameters

self

a TpSimpleClientFactory object

 

object_path

the object path of a connection

 

immutable_properties

the immutable properties of the connection.

[transfer none][element-type utf8 GObject.Value]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpConnection; see tp_connection_new().

[transfer full]

Since: 0.15.5


tp_simple_client_factory_dup_connection_features ()

GArray *
tp_simple_client_factory_dup_connection_features
                               (TpSimpleClientFactory *self,
                                TpConnection *connection);

Return a zero-terminated GArray containing the TpConnection features that should be prepared on connection .

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since: 0.15.5


tp_simple_client_factory_add_connection_features ()

void
tp_simple_client_factory_add_connection_features
                               (TpSimpleClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpConnection objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_connection_features().

It is not necessary to add TP_CONNECTION_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpConnection objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpSimpleClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since: 0.15.5


tp_simple_client_factory_add_connection_features_varargs ()

void
tp_simple_client_factory_add_connection_features_varargs
                               (TpSimpleClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_simple_client_factory_add_connection_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a TpSimpleClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.15.5


tp_simple_client_factory_ensure_channel ()

TpChannel *
tp_simple_client_factory_ensure_channel
                               (TpSimpleClientFactory *self,
                                TpConnection *connection,
                                const gchar *object_path,
                                const GHashTable *immutable_properties,
                                GError **error);

Returns a TpChannel proxy for the channel at object_path on connection . The returned TpChannel is cached; the same TpChannel object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpChannel is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_channel_features()).

This function is rather low-level. TpAccountChannelRequest and TpBaseClient are more appropriate ways to obtain channels for most applications.

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection whose “factory” is this object

 

object_path

the object path of a channel on connection

 

immutable_properties

the immutable properties of the channel.

[transfer none][element-type utf8 GObject.Value]

error

Used to raise an error if object_path is not valid

 

Returns

a reference to a TpChannel; see tp_channel_new_from_properties().

[transfer full]

Since: 0.15.5


tp_simple_client_factory_dup_channel_features ()

GArray *
tp_simple_client_factory_dup_channel_features
                               (TpSimpleClientFactory *self,
                                TpChannel *channel);

Return a zero-terminated GArray containing the TpChannel features that should be prepared on channel .

Parameters

self

a TpSimpleClientFactory object

 

channel

a TpChannel

 

Returns

a newly allocated GArray.

[transfer full][element-type GLib.Quark]

Since: 0.15.5


tp_simple_client_factory_add_channel_features ()

void
tp_simple_client_factory_add_channel_features
                               (TpSimpleClientFactory *self,
                                const GQuark *features);

Add features to the desired features to be prepared on TpChannel objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_channel_features().

It is not necessary to add TP_CHANNEL_FEATURE_CORE as it is already included by default.

Note that these features will not be added to existing TpChannel objects; the user must call tp_proxy_prepare_async() themself.

Parameters

self

a TpSimpleClientFactory object

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

Since: 0.15.5


tp_simple_client_factory_add_channel_features_varargs ()

void
tp_simple_client_factory_add_channel_features_varargs
                               (TpSimpleClientFactory *self,
                                GQuark feature,
                                ...);

The same as tp_simple_client_factory_add_channel_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a TpSimpleClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.15.5


tp_simple_client_factory_ensure_contact ()

TpContact *
tp_simple_client_factory_ensure_contact
                               (TpSimpleClientFactory *self,
                                TpConnection *connection,
                                TpHandle handle,
                                const gchar *identifier);

Returns a TpContact representing identifier (and handle ) on connection . The returned TpContact is cached; the same TpContact object will be returned by this function repeatedly, as long as at least one reference exists.

Note that the returned TpContact is not guaranteed to be ready; the caller is responsible for calling tp_connection_upgrade_contacts() with the desired features (as given by tp_simple_client_factory_dup_contact_features()).

For this function to work properly, tp_connection_has_immortal_handles() must return TRUE for connection .

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection whose “factory” is this object

 

handle

a TpHandle

 

identifier

a string representing the contact's identifier

 

Returns

a reference to a TpContact.

[transfer full]

Since: 0.15.5


tp_simple_client_factory_upgrade_contacts_async ()

void
tp_simple_client_factory_upgrade_contacts_async
                               (TpSimpleClientFactory *self,
                                TpConnection *connection,
                                guint n_contacts,
                                TpContact * const *contacts,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Same as tp_connection_upgrade_contacts_async(), but prepare contacts with all features previously passed to tp_simple_client_factory_add_contact_features().

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection whose “factory” is this object

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.19.1


tp_simple_client_factory_upgrade_contacts_finish ()

gboolean
tp_simple_client_factory_upgrade_contacts_finish
                               (TpSimpleClientFactory *self,
                                GAsyncResult *result,
                                GPtrArray **contacts,
                                GError **error);

Finishes tp_simple_client_factory_upgrade_contacts_async()

Parameters

self

a TpSimpleClientFactory

 

result

a GAsyncResult

 

contacts

a location to set a GPtrArray of upgraded TpContact, or NULL.

[element-type TelepathyGLib.Contact][transfer container][out][allow-none]

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.19.1


tp_simple_client_factory_ensure_contact_by_id_async ()

void
tp_simple_client_factory_ensure_contact_by_id_async
                               (TpSimpleClientFactory *self,
                                TpConnection *connection,
                                const gchar *identifier,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Same as tp_connection_dup_contact_by_id_async(), but prepare the contact with all features previously passed to tp_simple_client_factory_add_contact_features().

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection

 

identifier

a string representing the contact's identifier

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.19.1


tp_simple_client_factory_ensure_contact_by_id_finish ()

TpContact *
tp_simple_client_factory_ensure_contact_by_id_finish
                               (TpSimpleClientFactory *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_simple_client_factory_ensure_contact_by_id_async()

Parameters

self

a TpSimpleClientFactory

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a TpContact or NULL on error.

[transfer full]

Since: 0.19.1


tp_simple_client_factory_dup_contact_features ()

GArray *
tp_simple_client_factory_dup_contact_features
                               (TpSimpleClientFactory *self,
                                TpConnection *connection);

Return a GArray containing the TpContactFeature that should be prepared on all contacts of connection .

Parameters

self

a TpSimpleClientFactory object

 

connection

a TpConnection

 

Returns

a newly allocated GArray.

[transfer full][element-type TelepathyGLib.ContactFeature]

Since: 0.15.5


tp_simple_client_factory_add_contact_features ()

void
tp_simple_client_factory_add_contact_features
                               (TpSimpleClientFactory *self,
                                guint n_features,
                                const TpContactFeature *features);

Add features to the desired features to be prepared on TpContact objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_contact_features().

Note that these features will not be added to existing TpContact objects; the user must call tp_connection_upgrade_contacts() themself.

Parameters

self

a TpSimpleClientFactory object

 

n_features

The number of features in features (may be 0)

 

features

an array of desired features (may be NULL if n_features is 0).

[array length=n_features][allow-none]

Since: 0.15.5


tp_simple_client_factory_add_contact_features_varargs ()

void
tp_simple_client_factory_add_contact_features_varargs
                               (TpSimpleClientFactory *self,
                                TpContactFeature feature,
                                ...);

The same as tp_simple_client_factory_add_contact_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a TpSimpleClientFactory

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with TP_CONTACT_FEATURE_INVALID

 

Since: 0.15.5

Types and Values

TpSimpleClientFactory

typedef struct _TpSimpleClientFactory TpSimpleClientFactory;

Data structure representing a TpSimpleClientFactory

Since: 0.15.5


struct TpSimpleClientFactoryClass

struct TpSimpleClientFactoryClass {
    GObjectClass parent_class;

    /* TpAccount */
    TpAccount * (*create_account) (TpSimpleClientFactory *self,
        const gchar *object_path,
        const GHashTable *immutable_properties,
        GError **error);
    GArray * (*dup_account_features) (TpSimpleClientFactory *self,
        TpAccount *account);

    /* TpConnection */
    TpConnection * (*create_connection) (TpSimpleClientFactory *self,
        const gchar *object_path,
        const GHashTable *immutable_properties,
        GError **error);
    GArray * (*dup_connection_features) (TpSimpleClientFactory *self,
        TpConnection *connection);

    /* TpChannel */
    TpChannel * (*create_channel) (TpSimpleClientFactory *self,
        TpConnection *conn,
        const gchar *object_path,
        const GHashTable *immutable_properties,
        GError **error);
    GArray * (*dup_channel_features) (TpSimpleClientFactory *self,
        TpChannel *channel);

    /* TpContact */
    TpContact * (*create_contact) (TpSimpleClientFactory *self,
        TpConnection *connection,
        TpHandle handle,
        const gchar *identifier);
    GArray * (*dup_contact_features) (TpSimpleClientFactory *self,
        TpConnection *connection);
};

The class structure for TpSimpleClientFactory.

TpSimpleClientFactory maintains a cache of previously-constructed proxy objects, so the implementations of create_account , create_connection , create_channel , and create_contact may assume that a new object should be created when they are called. The default implementations create unadorned instances of the relevant classes; subclasses of the factory may choose to create more interesting proxy subclasses.

The default implementation of dup_channel_features returns TP_CHANNEL_FEATURE_CORE, plus all features passed to tp_simple_client_factory_add_channel_features() by the application. Subclasses may override this method to prepare more interesting features from subclasses of TpChannel, for instance. The default implementations of the other dup_x_features methods behave similarly.

Members

GObjectClass parent_class;

the parent

 

create_account ()

create a TpAccount; see tp_simple_client_factory_ensure_account()

 

dup_account_features ()

implementation of tp_simple_client_factory_dup_account_features()

 

create_connection ()

create a TpConnection; see tp_simple_client_factory_ensure_connection()

 

dup_connection_features ()

implementation of tp_simple_client_factory_dup_connection_features()

 

create_channel ()

create a TpChannel; see tp_simple_client_factory_ensure_channel()

 

dup_channel_features ()

implementation of tp_simple_client_factory_dup_channel_features()

 

create_contact ()

create a TpContact; see tp_simple_client_factory_ensure_contact()

 

dup_contact_features ()

implementation of tp_simple_client_factory_dup_contact_features()

 

Since: 0.15.5

Property Details

The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

The D-Bus daemon for this object.

Owner: TpSimpleClientFactory

Flags: Read / Write / Construct Only

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-tubes.html0000644000175000017500000032075314006623344024417 00000000000000 Tubes channels: telepathy-glib API Reference Manual

Tubes channels

Tubes channels — service-side interface for the Tubes channel type

Functions

void (*tp_svc_channel_type_tubes_accept_d_bus_tube_impl) ()
void tp_svc_channel_type_tubes_implement_accept_d_bus_tube ()
void tp_svc_channel_type_tubes_return_from_accept_d_bus_tube ()
void (*tp_svc_channel_type_tubes_accept_stream_tube_impl) ()
void tp_svc_channel_type_tubes_implement_accept_stream_tube ()
void tp_svc_channel_type_tubes_return_from_accept_stream_tube ()
void (*tp_svc_channel_type_tubes_close_tube_impl) ()
void tp_svc_channel_type_tubes_implement_close_tube ()
void tp_svc_channel_type_tubes_return_from_close_tube ()
void (*tp_svc_channel_type_tubes_get_available_stream_tube_types_impl) ()
void tp_svc_channel_type_tubes_implement_get_available_stream_tube_types ()
void tp_svc_channel_type_tubes_return_from_get_available_stream_tube_types ()
void (*tp_svc_channel_type_tubes_get_available_tube_types_impl) ()
void tp_svc_channel_type_tubes_implement_get_available_tube_types ()
void tp_svc_channel_type_tubes_return_from_get_available_tube_types ()
void (*tp_svc_channel_type_tubes_get_d_bus_names_impl) ()
void tp_svc_channel_type_tubes_implement_get_d_bus_names ()
void tp_svc_channel_type_tubes_return_from_get_d_bus_names ()
void (*tp_svc_channel_type_tubes_get_d_bus_tube_address_impl) ()
void tp_svc_channel_type_tubes_implement_get_d_bus_tube_address ()
void tp_svc_channel_type_tubes_return_from_get_d_bus_tube_address ()
void (*tp_svc_channel_type_tubes_get_stream_tube_socket_address_impl) ()
void tp_svc_channel_type_tubes_implement_get_stream_tube_socket_address ()
void tp_svc_channel_type_tubes_return_from_get_stream_tube_socket_address ()
void (*tp_svc_channel_type_tubes_list_tubes_impl) ()
void tp_svc_channel_type_tubes_implement_list_tubes ()
void tp_svc_channel_type_tubes_return_from_list_tubes ()
void (*tp_svc_channel_type_tubes_offer_d_bus_tube_impl) ()
void tp_svc_channel_type_tubes_implement_offer_d_bus_tube ()
void tp_svc_channel_type_tubes_return_from_offer_d_bus_tube ()
void (*tp_svc_channel_type_tubes_offer_stream_tube_impl) ()
void tp_svc_channel_type_tubes_implement_offer_stream_tube ()
void tp_svc_channel_type_tubes_return_from_offer_stream_tube ()
void tp_svc_channel_type_tubes_emit_d_bus_names_changed ()
void tp_svc_channel_type_tubes_emit_new_tube ()
void tp_svc_channel_type_tubes_emit_stream_tube_new_connection ()
void tp_svc_channel_type_tubes_emit_tube_closed ()
void tp_svc_channel_type_tubes_emit_tube_state_changed ()

Signals

void d-bus-names-changed Has Details
void new-tube Has Details
void stream-tube-new-connection Has Details
void tube-closed Has Details
void tube-state-changed Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelTypeTubes

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A "tube" is a mechanism for arbitrary data transfer. This section documents the auto-generated C wrappers for the Tubes channel type.

Functions

tp_svc_channel_type_tubes_accept_d_bus_tube_impl ()

void
(*tp_svc_channel_type_tubes_accept_d_bus_tube_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcceptDBusTube on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_accept_d_bus_tube ()

void
tp_svc_channel_type_tubes_implement_accept_d_bus_tube
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_accept_d_bus_tube_impl impl);

Register an implementation for the AcceptDBusTube method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcceptDBusTube D-Bus method

 

tp_svc_channel_type_tubes_return_from_accept_d_bus_tube ()

void
tp_svc_channel_type_tubes_return_from_accept_d_bus_tube
                               (DBusGMethodInvocation *context,
                                const gchar *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_accept_stream_tube_impl ()

void
(*tp_svc_channel_type_tubes_accept_stream_tube_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcceptStreamTube on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

in_Address_Type

guint (FIXME, generate documentation)

 

in_Access_Control

guint (FIXME, generate documentation)

 

in_Access_Control_Param

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_accept_stream_tube ()

void
tp_svc_channel_type_tubes_implement_accept_stream_tube
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_accept_stream_tube_impl impl);

Register an implementation for the AcceptStreamTube method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcceptStreamTube D-Bus method

 

tp_svc_channel_type_tubes_return_from_accept_stream_tube ()

void
tp_svc_channel_type_tubes_return_from_accept_stream_tube
                               (DBusGMethodInvocation *context,
                                const GValue *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address

const GValue * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_close_tube_impl ()

void
(*tp_svc_channel_type_tubes_close_tube_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CloseTube on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_close_tube ()

void
tp_svc_channel_type_tubes_implement_close_tube
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_close_tube_impl impl);

Register an implementation for the CloseTube method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CloseTube D-Bus method

 

tp_svc_channel_type_tubes_return_from_close_tube ()

void
tp_svc_channel_type_tubes_return_from_close_tube
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_tubes_get_available_stream_tube_types_impl ()

void
(*tp_svc_channel_type_tubes_get_available_stream_tube_types_impl)
                               (TpSvcChannelTypeTubes *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAvailableStreamTubeTypes on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_get_available_stream_tube_types ()

void
tp_svc_channel_type_tubes_implement_get_available_stream_tube_types
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_get_available_stream_tube_types_impl impl);

Register an implementation for the GetAvailableStreamTubeTypes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAvailableStreamTubeTypes D-Bus method

 

tp_svc_channel_type_tubes_return_from_get_available_stream_tube_types ()

void
tp_svc_channel_type_tubes_return_from_get_available_stream_tube_types
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Available_Stream_Tube_Types);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Available_Stream_Tube_Types

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_get_available_tube_types_impl ()

void
(*tp_svc_channel_type_tubes_get_available_tube_types_impl)
                               (TpSvcChannelTypeTubes *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAvailableTubeTypes on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_get_available_tube_types ()

void
tp_svc_channel_type_tubes_implement_get_available_tube_types
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_get_available_tube_types_impl impl);

Register an implementation for the GetAvailableTubeTypes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAvailableTubeTypes D-Bus method

 

tp_svc_channel_type_tubes_return_from_get_available_tube_types ()

void
tp_svc_channel_type_tubes_return_from_get_available_tube_types
                               (DBusGMethodInvocation *context,
                                const GArray *out_Available_Tube_Types);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Available_Tube_Types

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_get_d_bus_names_impl ()

void
(*tp_svc_channel_type_tubes_get_d_bus_names_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetDBusNames on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_get_d_bus_names ()

void
tp_svc_channel_type_tubes_implement_get_d_bus_names
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_get_d_bus_names_impl impl);

Register an implementation for the GetDBusNames method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetDBusNames D-Bus method

 

tp_svc_channel_type_tubes_return_from_get_d_bus_names ()

void
tp_svc_channel_type_tubes_return_from_get_d_bus_names
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_DBus_Names);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_DBus_Names

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_get_d_bus_tube_address_impl ()

void
(*tp_svc_channel_type_tubes_get_d_bus_tube_address_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetDBusTubeAddress on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_get_d_bus_tube_address ()

void
tp_svc_channel_type_tubes_implement_get_d_bus_tube_address
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_get_d_bus_tube_address_impl impl);

Register an implementation for the GetDBusTubeAddress method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetDBusTubeAddress D-Bus method

 

tp_svc_channel_type_tubes_return_from_get_d_bus_tube_address ()

void
tp_svc_channel_type_tubes_return_from_get_d_bus_tube_address
                               (DBusGMethodInvocation *context,
                                const gchar *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_get_stream_tube_socket_address_impl ()

void
(*tp_svc_channel_type_tubes_get_stream_tube_socket_address_impl)
                               (TpSvcChannelTypeTubes *self,
                                guint in_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetStreamTubeSocketAddress on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_get_stream_tube_socket_address ()

void
tp_svc_channel_type_tubes_implement_get_stream_tube_socket_address
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_get_stream_tube_socket_address_impl impl);

Register an implementation for the GetStreamTubeSocketAddress method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetStreamTubeSocketAddress D-Bus method

 

tp_svc_channel_type_tubes_return_from_get_stream_tube_socket_address ()

void
tp_svc_channel_type_tubes_return_from_get_stream_tube_socket_address
                               (DBusGMethodInvocation *context,
                                guint out_Address_Type,
                                const GValue *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address_Type

guint (FIXME, generate documentation)

 

out_Address

const GValue * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_list_tubes_impl ()

void
(*tp_svc_channel_type_tubes_list_tubes_impl)
                               (TpSvcChannelTypeTubes *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListTubes on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_list_tubes ()

void
tp_svc_channel_type_tubes_implement_list_tubes
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_list_tubes_impl impl);

Register an implementation for the ListTubes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListTubes D-Bus method

 

tp_svc_channel_type_tubes_return_from_list_tubes ()

void
tp_svc_channel_type_tubes_return_from_list_tubes
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Tubes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Tubes

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_offer_d_bus_tube_impl ()

void
(*tp_svc_channel_type_tubes_offer_d_bus_tube_impl)
                               (TpSvcChannelTypeTubes *self,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method OfferDBusTube on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_Service

const gchar * (FIXME, generate documentation)

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_offer_d_bus_tube ()

void
tp_svc_channel_type_tubes_implement_offer_d_bus_tube
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_offer_d_bus_tube_impl impl);

Register an implementation for the OfferDBusTube method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the OfferDBusTube D-Bus method

 

tp_svc_channel_type_tubes_return_from_offer_d_bus_tube ()

void
tp_svc_channel_type_tubes_return_from_offer_d_bus_tube
                               (DBusGMethodInvocation *context,
                                guint out_Tube_ID);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Tube_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_offer_stream_tube_impl ()

void
(*tp_svc_channel_type_tubes_offer_stream_tube_impl)
                               (TpSvcChannelTypeTubes *self,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                guint in_Address_Type,
                                const GValue *in_Address,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method OfferStreamTube on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

self

The object implementing this interface

 

in_Service

const gchar * (FIXME, generate documentation)

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

in_Address_Type

guint (FIXME, generate documentation)

 

in_Address

const GValue * (FIXME, generate documentation)

 

in_Access_Control

guint (FIXME, generate documentation)

 

in_Access_Control_Param

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_tubes_implement_offer_stream_tube ()

void
tp_svc_channel_type_tubes_implement_offer_stream_tube
                               (TpSvcChannelTypeTubesClass *klass,
                                tp_svc_channel_type_tubes_offer_stream_tube_impl impl);

Register an implementation for the OfferStreamTube method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the OfferStreamTube D-Bus method

 

tp_svc_channel_type_tubes_return_from_offer_stream_tube ()

void
tp_svc_channel_type_tubes_return_from_offer_stream_tube
                               (DBusGMethodInvocation *context,
                                guint out_Tube_ID);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Tube_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_emit_d_bus_names_changed ()

void
tp_svc_channel_type_tubes_emit_d_bus_names_changed
                               (gpointer instance,
                                guint arg_ID,
                                const GPtrArray *arg_Added,
                                const GArray *arg_Removed);

Type-safe wrapper around g_signal_emit to emit the DBusNamesChanged signal on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_emit_new_tube ()

void
tp_svc_channel_type_tubes_emit_new_tube
                               (gpointer instance,
                                guint arg_ID,
                                guint arg_Initiator,
                                guint arg_Type,
                                const gchar *arg_Service,
                                GHashTable *arg_Parameters,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the NewTube signal on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Initiator

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Service

const gchar * (FIXME, generate documentation)

 

arg_Parameters

GHashTable * (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_emit_stream_tube_new_connection ()

void
tp_svc_channel_type_tubes_emit_stream_tube_new_connection
                               (gpointer instance,
                                guint arg_ID,
                                guint arg_Handle);

Type-safe wrapper around g_signal_emit to emit the StreamTubeNewConnection signal on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Handle

guint (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_emit_tube_closed ()

void
tp_svc_channel_type_tubes_emit_tube_closed
                               (gpointer instance,
                                guint arg_ID);

Type-safe wrapper around g_signal_emit to emit the TubeClosed signal on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_tubes_emit_tube_state_changed ()

void
tp_svc_channel_type_tubes_emit_tube_state_changed
                               (gpointer instance,
                                guint arg_ID,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the TubeStateChanged signal on interface org.freedesktop.Telepathy.Channel.Type.Tubes.

Parameters

instance

The object implementing this interface

 

arg_ID

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeTubes

typedef struct _TpSvcChannelTypeTubes TpSvcChannelTypeTubes;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeTubesClass

typedef struct _TpSvcChannelTypeTubesClass TpSvcChannelTypeTubesClass;

The class of TpSvcChannelTypeTubes.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_tubes (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_tubes_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_available_stream_tube_types);
  IMPLEMENT (get_available_tube_types);
  IMPLEMENT (list_tubes);
  IMPLEMENT (offer_d_bus_tube);
  IMPLEMENT (offer_stream_tube);
  IMPLEMENT (accept_d_bus_tube);
  IMPLEMENT (accept_stream_tube);
  IMPLEMENT (close_tube);
  IMPLEMENT (get_d_bus_tube_address);
  IMPLEMENT (get_d_bus_names);
  IMPLEMENT (get_stream_tube_socket_address);
#undef IMPLEMENT
}

Signal Details

The “d-bus-names-changed” signal

void
user_function (TpSvcChannelTypeTubes *self,
               guint                  arg_ID,
               GArray_guint_         *arg_Removed,
               gpointer               user_data)

The DBusNamesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-tube” signal

void
user_function (TpSvcChannelTypeTubes *self,
               guint                  arg_ID,
               guint                  arg_Initiator,
               guint                  arg_Type,
               gchar                 *arg_Service,
               guint                  arg_State,
               gpointer               user_data)

The NewTube D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Initiator

guint (FIXME, generate documentation)

 

arg_Type

guint (FIXME, generate documentation)

 

arg_Service

const gchar * (FIXME, generate documentation)

 

arg_Parameters

GHashTable * (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stream-tube-new-connection” signal

void
user_function (TpSvcChannelTypeTubes *self,
               guint                  arg_ID,
               guint                  arg_Handle,
               gpointer               user_data)

The StreamTubeNewConnection D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Handle

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “tube-closed” signal

void
user_function (TpSvcChannelTypeTubes *self,
               guint                  arg_ID,
               gpointer               user_data)

The TubeClosed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “tube-state-changed” signal

void
user_function (TpSvcChannelTypeTubes *self,
               guint                  arg_ID,
               guint                  arg_State,
               gpointer               user_data)

The TubeStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_ID

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-file-transfer.html0000644000175000017500000011241314006623344026026 00000000000000 File Transfer channels: telepathy-glib API Reference Manual

File Transfer channels

File Transfer channels — service-side interface for the File Transfer channel type

Signals

void file-transfer-state-changed Has Details
void initial-offset-defined Has Details
void transferred-bytes-changed Has Details
void u-ri-defined Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelTypeFileTransfer

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This section documents the auto-generated GInterface used to implement the File Transfer channel type.

Functions

tp_svc_channel_type_file_transfer_accept_file_impl ()

void
(*tp_svc_channel_type_file_transfer_accept_file_impl)
                               (TpSvcChannelTypeFileTransfer *self,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                guint64 in_Offset,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AcceptFile on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

self

The object implementing this interface

 

in_Address_Type

guint (FIXME, generate documentation)

 

in_Access_Control

guint (FIXME, generate documentation)

 

in_Access_Control_Param

const GValue * (FIXME, generate documentation)

 

in_Offset

guint64 (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_file_transfer_emit_file_transfer_state_changed ()

void
tp_svc_channel_type_file_transfer_emit_file_transfer_state_changed
                               (gpointer instance,
                                guint arg_State,
                                guint arg_Reason);

Type-safe wrapper around g_signal_emit to emit the FileTransferStateChanged signal on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

tp_svc_channel_type_file_transfer_emit_initial_offset_defined ()

void
tp_svc_channel_type_file_transfer_emit_initial_offset_defined
                               (gpointer instance,
                                guint64 arg_InitialOffset);

Type-safe wrapper around g_signal_emit to emit the InitialOffsetDefined signal on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

instance

The object implementing this interface

 

arg_InitialOffset

guint64 (FIXME, generate documentation)

 

tp_svc_channel_type_file_transfer_emit_transferred_bytes_changed ()

void
tp_svc_channel_type_file_transfer_emit_transferred_bytes_changed
                               (gpointer instance,
                                guint64 arg_Count);

Type-safe wrapper around g_signal_emit to emit the TransferredBytesChanged signal on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

instance

The object implementing this interface

 

arg_Count

guint64 (FIXME, generate documentation)

 

tp_svc_channel_type_file_transfer_emit_uri_defined ()

void
tp_svc_channel_type_file_transfer_emit_uri_defined
                               (gpointer instance,
                                const gchar *arg_URI);

Type-safe wrapper around g_signal_emit to emit the URIDefined signal on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

instance

The object implementing this interface

 

arg_URI

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_file_transfer_implement_accept_file ()

void
tp_svc_channel_type_file_transfer_implement_accept_file
                               (TpSvcChannelTypeFileTransferClass *klass,
                                tp_svc_channel_type_file_transfer_accept_file_impl impl);

Register an implementation for the AcceptFile method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AcceptFile D-Bus method

 

tp_svc_channel_type_file_transfer_implement_provide_file ()

void
tp_svc_channel_type_file_transfer_implement_provide_file
                               (TpSvcChannelTypeFileTransferClass *klass,
                                tp_svc_channel_type_file_transfer_provide_file_impl impl);

Register an implementation for the ProvideFile method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ProvideFile D-Bus method

 

tp_svc_channel_type_file_transfer_provide_file_impl ()

void
(*tp_svc_channel_type_file_transfer_provide_file_impl)
                               (TpSvcChannelTypeFileTransfer *self,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ProvideFile on interface org.freedesktop.Telepathy.Channel.Type.FileTransfer.

Parameters

self

The object implementing this interface

 

in_Address_Type

guint (FIXME, generate documentation)

 

in_Access_Control

guint (FIXME, generate documentation)

 

in_Access_Control_Param

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_file_transfer_return_from_accept_file ()

void
tp_svc_channel_type_file_transfer_return_from_accept_file
                               (DBusGMethodInvocation *context,
                                const GValue *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address

const GValue * (FIXME, generate documentation)

 

tp_svc_channel_type_file_transfer_return_from_provide_file ()

void
tp_svc_channel_type_file_transfer_return_from_provide_file
                               (DBusGMethodInvocation *context,
                                const GValue *out_Address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Address

const GValue * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeFileTransfer

typedef struct _TpSvcChannelTypeFileTransfer TpSvcChannelTypeFileTransfer;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeFileTransferClass

typedef struct _TpSvcChannelTypeFileTransferClass TpSvcChannelTypeFileTransferClass;

The class of TpSvcChannelTypeFileTransfer.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_file_transfer (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_file_transfer_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (accept_file);
  IMPLEMENT (provide_file);
#undef IMPLEMENT
}

Signal Details

The “file-transfer-state-changed” signal

void
user_function (TpSvcChannelTypeFileTransfer *self,
               guint                         arg_State,
               guint                         arg_Reason,
               gpointer                      user_data)

The FileTransferStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “initial-offset-defined” signal

void
user_function (TpSvcChannelTypeFileTransfer *self,
               guint64                       arg_InitialOffset,
               gpointer                      user_data)

The InitialOffsetDefined D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_InitialOffset

guint64 (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “transferred-bytes-changed” signal

void
user_function (TpSvcChannelTypeFileTransfer *self,
               guint64                       arg_Count,
               gpointer                      user_data)

The TransferredBytesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Count

guint64 (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “u-ri-defined” signal

void
user_function (TpSvcChannelTypeFileTransfer *self,
               gchar                        *arg_URI,
               gpointer                      user_data)

The URIDefined D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_URI

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-room-list.html0000644000175000017500000005770014006623344023022 00000000000000 TpRoomList: telepathy-glib API Reference Manual

TpRoomList

TpRoomList — proxy object for a room list channel

Properties

TpAccount * account Read / Write / Construct Only
gboolean listing Read
gchar * server Read / Write / Construct Only

Signals

void failed Run Last
void got-room Run Last

Types and Values

struct TpRoomList
struct TpRoomListClass

Object Hierarchy

    GObject
    ╰── TpRoomList

Implemented Interfaces

TpRoomList implements GAsyncInitable.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpRoomList provides convenient API to list rooms.

Functions

tp_room_list_new_async ()

void
tp_room_list_new_async (TpAccount *account,
                        const gchar *server,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Parameters

account

a TpAccount for the room listing

 

server

the DNS name of the server whose rooms should listed

 

callback

a GAsyncReadyCallback to call when the initialization is finished

 

user_data

data to pass to the callback function

 

Since: 0.19.0


tp_room_list_new_finish ()

TpRoomList *
tp_room_list_new_finish (GAsyncResult *result,
                         GError **error);

Parameters

result

the GAsyncResult from the callback

 

error

a GError location to store an error, or NULL

 

Returns

a new TpRoomList object, or NULL in case of error.

[transfer full]

Since: 0.19.0


tp_room_list_is_listing ()

gboolean
tp_room_list_is_listing (TpRoomList *self);

Return the “listing” property

Parameters

self

a TpRoomList

 

Returns

the value of “listing” property

Since: 0.19.0


tp_room_list_get_server ()

const gchar *
tp_room_list_get_server (TpRoomList *self);

Return the “server” property

Parameters

self

a TpRoomList

 

Returns

the value of “server” property

Since: 0.19.0


tp_room_list_get_account ()

TpAccount *
tp_room_list_get_account (TpRoomList *self);

Return the “account” property

Parameters

self

a TpRoomList

 

Returns

the value of “account” property.

[transfer none]

Since: 0.19.0


tp_room_list_start ()

void
tp_room_list_start (TpRoomList *self);

Start listing rooms using self . Use the TpRoomList::got-rooms signal to get the rooms found. Errors will be reported using the TpRoomList::failed signal.

Parameters

self

a TpRoomList

 

Since: 0.19.0

Types and Values

struct TpRoomList

struct TpRoomList;

Data structure representing a TpRoomList.

Since: 0.19.0


struct TpRoomListClass

struct TpRoomListClass {
};

The class of a TpRoomList.

Since: 0.19.0

Property Details

The “account” property

  “account”                  TpAccount *

The TpAccount to use for the room listing.

Owner: TpRoomList

Flags: Read / Write / Construct Only

Since: 0.19.0


The “listing” property

  “listing”                  gboolean

TRUE if the channel is currently listing rooms.

This property is meaningless until the TP_ROOM_LIST_FEATURE_LISTING feature has been prepared.

Owner: TpRoomList

Flags: Read

Default value: FALSE

Since: 0.19.0


The “server” property

  “server”                   gchar *

The DNS name of the server whose rooms are listed by this channel, or NULL.

Owner: TpRoomList

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.0

Signal Details

The “failed” signal

void
user_function (TpRoomList *self,
               GError     *error,
               gpointer    user_data)

Fired when something goes wrong while listing the channels; see error for details.

Parameters

self

a TpRoomList

 

error

a GError indicating the reason of the error

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.19.0


The “got-room” signal

void
user_function (TpRoomList *self,
               TpRoomInfo *room,
               gpointer    user_data)

Fired each time a room is found during the listing process. User should take his own reference on room if he plans to continue using it once the signal callback has returned.

Parameters

self

a TpRoomList

 

room

a TpRoomInfo

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.19.0

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-dbus-tube-channel.html0000644000175000017500000010073114006623344024366 00000000000000 TpDBusTubeChannel: telepathy-glib API Reference Manual

TpDBusTubeChannel

TpDBusTubeChannel — proxy object for D-Bus tube channels

Properties

GHashTable_gchararray+GValue_* parameters Read
GVariant * parameters-vardict Read
gchar * service-name Read

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannel
            ╰── TpDBusTubeChannel

Implemented Interfaces

TpDBusTubeChannel implements TpChannelIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpDBusTubeChannel provides API for working with D-Bus tube channels, which allow applications to open D-Bus connections to a contact or chat room.

To create a new outgoing D-Bus tube channel, do something like:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
GHashTable *request_properties = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
    TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, tp_contact_get_identifier (contact),
    TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, "com.example.walrus",
    NULL);
TpAccountChannelRequest *req = tp_account_channel_request_new (account,
    request_properties, TP_USER_ACTION_TIME_NOT_USER_ACTION);
tp_account_channel_request_create_and_handle_channel_async (req, NULL, callback, NULL);

// ...

static void
callback (
    GObject *source,
    GAsyncResult *result,
    gpointer user_data)
{
  TpAccountChannelRequest *req = TP_ACCOUNT_CHANNEL_REQUEST (source);
  TpChannel *channel;
  GError *error = NULL;

  channel = tp_account_channel_request_create_and_handle_channel_finish (req, result, &error);
  tp_dbus_tube_channel_offer_async (TP_DBUS_TUBE_CHANNEL (channel), NULL, offer_callback, NULL);
}

You can find a fuller example in the examples/client/dbus-tubes directory.

Functions

tp_dbus_tube_channel_get_parameters ()

GHashTable *
tp_dbus_tube_channel_get_parameters (TpDBusTubeChannel *self);

Return the “parameters” property

[skip]

Parameters

self

a TpDBusTubeChannel

 

Returns

the value of “parameters”.

[transfer none][element-type utf8 GObject.Value]

Since: 0.18.0


tp_dbus_tube_channel_dup_parameters_vardict ()

GVariant *
tp_dbus_tube_channel_dup_parameters_vardict
                               (TpDBusTubeChannel *self);

Return the parameters of the dbus-tube channel in a variant of type G_VARIANT_TYPE_VARDICT whose keys are strings representing parameter names and values are variants representing corresponding parameter values set by the offerer when offering this channel.

The GVariant returned is NULL if this is an outgoing tube that has not yet been offered or the parameters property has not been set.

Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() and similar functions for convenient access to the values.

Parameters

self

a TpDBusTubeChannel

 

Returns

a new reference to a GVariant.

[transfer full]

Since: 0.19.10


tp_dbus_tube_channel_get_service_name ()

const gchar *
tp_dbus_tube_channel_get_service_name (TpDBusTubeChannel *self);

Return the “service-name” property

Parameters

self

a TpDBusTubeChannel

 

Returns

the value of “service-name”.

[transfer none]

Since: 0.18.0


tp_dbus_tube_channel_offer_async ()

void
tp_dbus_tube_channel_offer_async (TpDBusTubeChannel *self,
                                  GHashTable *params,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Offer an outgoing D-Bus tube. When the tube has been offered and accepted callback will be called. You can then call tp_dbus_tube_channel_offer_finish() to get the GDBusConnection that will be used to communicate through the tube.

Parameters

self

an outgoing TpDBusTubeChannel

 

params

parameters of the tube, or NULL.

[allow-none][transfer none]

callback

a callback to call when the tube has been offered

 

user_data

data to pass to callback

 

Since: 0.18.0


tp_dbus_tube_channel_offer_finish ()

GDBusConnection *
tp_dbus_tube_channel_offer_finish (TpDBusTubeChannel *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes offering an outgoing D-Bus tube. The returned GDBusConnection is ready to be used to exchange data through the tube.

Parameters

self

a TpDBusTubeChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a reference on a GDBusConnection if the tube has been successfully offered and opened; NULL otherwise.

[transfer full]

Since: 0.18.0


tp_dbus_tube_channel_accept_async ()

void
tp_dbus_tube_channel_accept_async (TpDBusTubeChannel *self,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Accept an incoming D-Bus tube. When the tube has been accepted callback will be called. You can then call tp_dbus_tube_channel_accept_finish() to get the GDBusConnection that will be used to communicate through the tube.

Parameters

self

an incoming TpDBusTubeChannel

 

callback

a callback to call when the tube has been offered

 

user_data

data to pass to callback

 

Since: 0.18.0


tp_dbus_tube_channel_accept_finish ()

GDBusConnection *
tp_dbus_tube_channel_accept_finish (TpDBusTubeChannel *self,
                                    GAsyncResult *result,
                                    GError **error);

Finishes to accept an incoming D-Bus tube. The returned GDBusConnection is ready to be used to exchange data through the tube.

Parameters

self

a TpDBusTubeChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a reference on a GDBusConnection if the tube has been successfully accepted and opened; NULL otherwise.

[transfer full]

Since: 0.18.0

Types and Values

struct TpDBusTubeChannel

struct TpDBusTubeChannel;

Data structure representing a TpDBusTubeChannel.

Since: 0.18.0


struct TpDBusTubeChannelClass

struct TpDBusTubeChannelClass {
};

The class of a TpDBusTubeChannel.

Since: 0.18.0


TP_DBUS_TUBE_CHANNEL_FEATURE_CORE

#define             TP_DBUS_TUBE_CHANNEL_FEATURE_CORE

Expands to a call to a function that returns a quark representing the core feature of a TpDBusTubeChannel.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.18.0

Property Details

The “parameters” property

  “parameters”               GHashTable_gchararray+GValue_*

A string to GValue GHashTable representing the parameters of the tube.

Will be NULL for outgoing tubes until the tube has been offered.

In high-level language bindings, use tp_dbus_tube_channel_dup_parameters_vardict() to get the same information in a more convenient format.

Owner: TpDBusTubeChannel

Flags: Read

Since: 0.18.0


The “parameters-vardict” property

  “parameters-vardict”       GVariant *

A G_VARIANT_TYPE_VARDICT representing the parameters of the tube.

Will be NULL for outgoing tubes until the tube has been offered.

Owner: TpDBusTubeChannel

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “service-name” property

  “service-name”             gchar *

A string representing the service name that will be used over the tube.

Owner: TpDBusTubeChannel

Flags: Read

Default value: NULL

Since: 0.18.0

telepathy-glib-0.24.2/docs/reference/html/ch-service-dbus.html0000644000175000017500000002067114006623343021144 00000000000000 Service-side D-Bus interfaces: telepathy-glib API Reference Manual

Service-side D-Bus interfaces

The TpSvc* interfaces — How to export Telepathy objects
Generic service-side interfaces — GInterfaces for D-Bus objects exporting Telepathy properties and common D-Bus core interfaces
Service-side Channel base interface — GInterface for Telepathy Channel objects
Service-side Channel Group and Conference interfaces — Groups of contacts
Service-side room interfaces — room-related functionality for channels
Contact List channels — service-side interface for the Contact List channel type
Contact Search channels — service-side interface for the Contact Search channel type
Text channels — service-side interfaces for the Text channel type, and the Chat State, Password and SMS interfaces
Media channels — service-side interfaces for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces
File Transfer channels — service-side interface for the File Transfer channel type
File transfer Metadata interface — GInterface to implement metadata file transfer interface
Tubes channels — service-side interface for the Tubes channel type
Tube channels — service-side interface for the Tube channel interface, StreamTube channel type and DBusTube channel type.
Room List channels — service-side interface for the Room List channel type
Service-side Channel Authentication interfaces — GInterfaces to implement authentication channels
Service-side Securable interface — GInterface to indicate channels' security level
Service-side Channel Call interface — GInterface to implement call channels
Service-side Debug base interface — GInterface for Telepathy Debug objects
Service-side Connection interfaces — GInterfaces for Telepathy Connection objects
Service-side Connection and Channel Anonymity interfaces — GInterfaces to implement the Anonymity interfaces
Service-side Connection and Channel ServicePoint interfaces — GInterfaces to implement the ServicePoint interfaces
Service-side media streaming helper interfaces — media session and media stream
Service-side Connection Manager interface — GInterface for Telepathy ConnectionManager objects
Service-side Protocol interface — GInterface for Telepathy Protocol objects
Service-side Account Manager interface — GInterface for Telepathy AccountManager objects
Service-side Account interfaces — GInterfaces for Telepathy Account objects
Service-side Channel Dispatcher interface — GInterfaces for Telepathy ChannelDispatcher object
Service-side Channel Dispatch Operation interface — GInterface for Telepathy ChannelDispatchOperation object
Service-side Channel Request interface — GInterface for Telepathy ChannelRequest object
Service-side Client interfaces — interfaces used to be an Observer, Approver and Handler
Service-side TLS interfaces — GInterfaces to implement Chan.T.ServerTLSConnection
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-dbus-properties-mixin.html0000644000175000017500000022302414006623344025340 00000000000000 TpDBusPropertiesMixin: telepathy-glib API Reference Manual

TpDBusPropertiesMixin

TpDBusPropertiesMixin — a mixin implementation of the DBus.Properties interface

Object Hierarchy

    GFlags
    ╰── TpDBusPropertiesMixinFlags

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This mixin provides an implementation of the org.freedesktop.DBus.Properties interface. It relies on the auto-generated service-side GInterfaces from telepathy-glib >= 0.7.3, or something similar, to register the abstract properties and their GTypes; classes with the mixin can then register an implementation of the properties.

To register D-Bus properties in a GInterface to be implementable with this mixin, either use the code-generation tools from telepathy-glib >= 0.7.3, or call tp_svc_interface_set_dbus_properties_info() from a section of the base_init function that only runs once.

To use this mixin, include a TpDBusPropertiesMixinClass somewhere in your class structure, populate it with pointers to statically allocated (or duplicated and never freed) data, and call tp_dbus_properties_mixin_class_init() from your class_init implementation.

To use this mixin as the implementation of TpSvcDBusProperties, call G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) in the fourth argument to G_DEFINE_TYPE_WITH_CODE.

Functions

tp_svc_interface_set_dbus_properties_info ()

void
tp_svc_interface_set_dbus_properties_info
                               (GType g_interface,
                                TpDBusPropertiesMixinIfaceInfo *info);

Declare that g_interface implements the given D-Bus interface, with the given properties. This may only be called once per GInterface, usually from a section of its base_init function that only runs once.

This is typically only used within generated code; there is normally no reason to call it manually.

Parameters

g_interface

The GType of a service interface

 

info

an interface description

 

Since: 0.7.3


tp_svc_interface_get_dbus_properties_info ()

TpDBusPropertiesMixinIfaceInfo *
tp_svc_interface_get_dbus_properties_info
                               (GType g_interface);

Retrieves the D-Bus property metadata for the given interface, if any. This function is typically not useful outside telepathy-glib itself, but may be useful for domain-specific variations on the theme of SetProperty. If in doubt, you probably don't need this function.

[skip]

Parameters

g_interface

The GType of a service interface

 

Returns

D-Bus property metadata for g_interface , or NULL if it has none.

Since: 0.15.8


TpDBusPropertiesMixinGetter ()

void
(*TpDBusPropertiesMixinGetter) (GObject *object,
                                GQuark iface,
                                GQuark name,
                                GValue *value,
                                gpointer getter_data);

Signature of a callback used to get the value of a property.

For simplicity, in this mixin we don't allow getting a property to fail; implementations must always be prepared to return *something*.

Parameters

object

The exported object with the properties

 

iface

A quark representing the D-Bus interface name

 

name

A quark representing the D-Bus property name

 

value

A GValue pre-initialized to the right type, into which to put the value

 

getter_data

The getter_data from the TpDBusPropertiesMixinPropImpl

 

tp_dbus_properties_mixin_getter_gobject_properties ()

void
tp_dbus_properties_mixin_getter_gobject_properties
                               (GObject *object,
                                GQuark iface,
                                GQuark name,
                                GValue *value,
                                gpointer getter_data);

An implementation of TpDBusPropertiesMixinGetter which assumes that the getter_data is the name of a readable GObject property of an appropriate type, and uses it for the value of the D-Bus property.

Parameters

object

The exported object with the properties

 

iface

A quark representing the D-Bus interface name

 

name

A quark representing the D-Bus property name

 

value

A GValue pre-initialized to the right type, into which to put the value

 

getter_data

The getter_data from the TpDBusPropertiesMixinPropImpl, which must be a string containing the GObject property's name

 

TpDBusPropertiesMixinSetter ()

gboolean
(*TpDBusPropertiesMixinSetter) (GObject *object,
                                GQuark iface,
                                GQuark name,
                                const GValue *value,
                                gpointer setter_data,
                                GError **error);

Signature of a callback used to get the value of a property.

Parameters

object

The exported object with the properties

 

iface

A quark representing the D-Bus interface name

 

name

A quark representing the D-Bus property name

 

value

The new value for the property

 

setter_data

The setter_data from the TpDBusPropertiesMixinPropImpl

 

error

Used to return an error on failure

 

Returns

TRUE on success, FALSE (setting error ) on failure


tp_dbus_properties_mixin_setter_gobject_properties ()

gboolean
tp_dbus_properties_mixin_setter_gobject_properties
                               (GObject *object,
                                GQuark iface,
                                GQuark name,
                                const GValue *value,
                                gpointer setter_data,
                                GError **error);

An implementation of TpDBusPropertiesMixinSetter which assumes that the setter_data is the name of a writable GObject property of an appropriate type, and sets that property to the given value.

Parameters

object

The exported object with the properties

 

iface

A quark representing the D-Bus interface name

 

name

A quark representing the D-Bus property name

 

value

The new value for the property

 

setter_data

The setter_data from the TpDBusPropertiesMixinPropImpl, which must be a string containing the GObject property's name

 

error

Not used

 

Returns

TRUE


tp_dbus_properties_mixin_class_init ()

void
tp_dbus_properties_mixin_class_init (GObjectClass *cls,
                                     gsize offset);

Initialize the class cls to use the D-Bus Properties mixin. The given struct member, of size sizeof(TpDBusPropertiesMixinClass), will be used to store property implementation information.

Each property and each interface must have been declared as a member of a GInterface implemented by cls , using tp_svc_interface_set_dbus_properties_info().

Before calling this function, the array interfaces must have been placed in the TpDBusPropertiesMixinClass structure; if it would be empty, it may instead be NULL.

This function should be called from the class_init callback in such a way that it will only be called once, even if the class is subclassed.

Changed in 0.7.9: TpDBusPropertiesMixinClass::interfaces may now be NULL, which means that only interfaces whose properties are set up using tp_dbus_properties_mixin_implement_interface() will be used.

Changed in 0.7.15: offset may now be 0, in which case the TpDBusPropertiesMixinClass can be omitted from cls . It is treated as if it were present, but with all fields (including TpDBusPropertiesMixinClass::interfaces) being NULL, so only interfaces whose properties are set using tp_dbus_properties_mixin_implement_interface() will be used.

Parameters

cls

a subclass of GObjectClass

 

offset

the offset within cls of a TpDBusPropertiesMixinClass structure

 

Since: 0.7.3


tp_dbus_properties_mixin_implement_interface ()

void
tp_dbus_properties_mixin_implement_interface
                               (GObjectClass *cls,
                                GQuark iface,
                                TpDBusPropertiesMixinGetter getter,
                                TpDBusPropertiesMixinSetter setter,
                                TpDBusPropertiesMixinPropImpl *props);

Declare that, in addition to any interfaces set in tp_dbus_properties_mixin_class_init(), the given class (and its subclasses) will implement the properties of the interface iface using the callbacks getter and setter and the properties given by props .

This function should be called from the class_init callback in such a way that it will only be called once, even if the class is subclassed.

Typically, the static array interfaces in the TpDBusPropertiesMixinClass should be used for interfaces whose properties are implemented directly by the class cls , and this function should be used for interfaces whose properties are implemented by mixins.

It is an error for the same interface to appear in the array interfaces in the TpDBusPropertiesMixinClass, and also be set up by this function.

If a class C and a subclass S both implement the properties of the same interface, only the implementations from the subclass S will be used, regardless of whether the implementations in C and/or S were set up by this function or via the array interfaces in the TpDBusPropertiesMixinClass.

[skip]

Parameters

cls

a subclass of GObjectClass

 

iface

a quark representing the the name of the interface to implement

 

getter

a callback to get properties on this interface, or NULL if they are all write-only

 

setter

a callback to set properties on this interface, or NULL if they are all read-only

 

props

an array of TpDBusPropertiesMixinPropImpl representing individual properties, terminated by one with name == NULL

 

tp_dbus_properties_mixin_iface_init ()

void
tp_dbus_properties_mixin_iface_init (gpointer g_iface,
                                     gpointer iface_data);

Declare that the DBus.Properties interface represented by g_iface is implemented using this mixin.

Parameters

g_iface

a pointer to a TpSvcDBusPropertiesClass structure

 

iface_data

ignored

 

tp_dbus_properties_mixin_get ()

gboolean
tp_dbus_properties_mixin_get (GObject *self,
                              const gchar *interface_name,
                              const gchar *property_name,
                              GValue *value,
                              GError **error);

Initialize value with the type of the property property_name on interface_name , and write the value of that property into it as if by calling the D-Bus method org.freedesktop.DBus.Properties.Get.

If Get would return a D-Bus error, value remains unset and error is filled in instead.

Parameters

self

an object with this mixin

 

interface_name

a D-Bus interface name

 

property_name

a D-Bus property name

 

value

an unset GValue (initialized to all zeroes)

 

error

used to return an error on failure

 

Returns

TRUE (filling value ) on success, FALSE (setting error ) on failure

Since: 0.7.13


tp_dbus_properties_mixin_dup_all ()

GHashTable *
tp_dbus_properties_mixin_dup_all (GObject *self,
                                  const gchar *interface_name);

Get all the properties of a particular interface. This implementation never returns an error: it will return an empty map if the interface is unknown.

Parameters

self

an object with this mixin

 

interface_name

a D-Bus interface name

 

Returns

a map from property name (without the interface name) to value.

[transfer container][element-type utf8 GObject.Value]

Since: 0.21.2


tp_dbus_properties_mixin_set ()

gboolean
tp_dbus_properties_mixin_set (GObject *self,
                              const gchar *interface_name,
                              const gchar *property_name,
                              const GValue *value,
                              GError **error);

Sets a property to the value specified by value , as if by calling the D-Bus method org.freedesktop.DBus.Properties.Set.

If Set would return a D-Bus error, sets error and returns FALSE

Parameters

self

an object with this mixin

 

interface_name

a D-Bus interface name

 

property_name

a D-Bus property name

 

value

a GValue containing the new value for this property.

 

error

used to return an error on failure

 

Returns

TRUE on success; FALSE (setting error ) on failure

Since: 0.15.8


tp_dbus_properties_mixin_fill_properties_hash ()

void
tp_dbus_properties_mixin_fill_properties_hash
                               (GObject *object,
                                GHashTable *table,
                                const gchar *first_interface,
                                const gchar *first_property,
                                ...);

Retrieves the values of several D-Bus properties from an object, and adds them to a hash mapping the fully-qualified name of the property to its value. This is equivalent to calling tp_dbus_properties_mixin_get() for each property and adding it to the table yourself, with the proviso that this function will g_assert() if retrieving a property fails (for instance, because it does not exist).

Note that in particular, table does not have the same memory-allocation model as the hash tables required by tp_asv_set_string() and similar functions.

[skip]

Parameters

object

an object which uses the D-Bus properties mixin

 

table

a hash table where the keys are strings copied with g_strdup() and the values are slice-allocated GValues.

[element-type utf8 GObject.Value]

first_interface

the interface of the first property to be retrieved

 

first_property

the name of the first property to be retrieved

 

...

more (interface name, property name) pairs, terminated by NULL.

 

Since: 0.11.11


tp_dbus_properties_mixin_make_properties_hash ()

GHashTable *
tp_dbus_properties_mixin_make_properties_hash
                               (GObject *object,
                                const gchar *first_interface,
                                const gchar *first_property,
                                ...);

Retrieves the values of several D-Bus properties from an object, and builds a hash mapping the fully-qualified name of the property to its value. This is equivalent to calling tp_dbus_properties_mixin_get() for each property and building the table yourself, with the proviso that this function will g_assert() if retrieving a property fails (for instance, because it does not exist).

Additional keys and values can be inserted into the returned hash table; if this is done, the inserted keys and values will be freed when the hash table is destroyed. The keys must be allocated with g_strdup() or equivalent, and the values must be slice-allocated (for instance with tp_g_value_slice_new_string() or a similar function).

Note that in particular, tp_asv_set_string() and similar functions should not be used with this hash table.

[skip]

Parameters

object

an object which uses the D-Bus properties mixin

 

first_interface

the interface of the first property to be retrieved

 

first_property

the name of the first property to be retrieved

 

...

more (interface name, property name) pairs, terminated by NULL.

 

Returns

a hash table mapping (gchar *) fully-qualified property names to GValues, which must be freed by the caller (at which point its contents will also be freed).


tp_dbus_properties_mixin_emit_properties_changed ()

void
tp_dbus_properties_mixin_emit_properties_changed
                               (GObject *object,
                                const gchar *interface_name,
                                const gchar * const *properties);

Emits the PropertiesChanged signal for the provided properties. Depending on the EmitsChangedSignal annotations in the introspection XML, either the new value of the property will be included in the signal, or merely the fact that the property has changed.

For example, the MPRIS specification defines a TrackList interface with two properties, one of which is annotated with EmitsChangedSignal=true and one annotated with EmitsChangedSignal=invalidates. The following call would include the new value of CanEditTracks and list Tracks as invalidated:

1
2
3
4
const gchar *properties[] = { "CanEditTracks", "Tracks", NULL };

tp_dbus_properties_mixin_emit_properties_changed (G_OBJECT (self),
    "org.mpris.MediaPlayer2.TrackList", properties);

It is an error to pass a property to this function if the property is annotated with EmitsChangedSignal=false, or is unannotated.

Parameters

object

an object which uses the D-Bus properties mixin

 

interface_name

the interface on which properties have changed

 

properties

a NULL-terminated array of (unqualified) property names whose values have changed.

[allow-none]

Since: 0.15.6


tp_dbus_properties_mixin_emit_properties_changed_varargs ()

void
tp_dbus_properties_mixin_emit_properties_changed_varargs
                               (GObject *object,
                                const gchar *interface_name,
                                ...);

A shortcut for calling tp_dbus_properties_mixin_emit_properties_changed().

[skip]

Parameters

object

an object which uses the D-Bus properties mixin

 

interface_name

the interface on which properties have changed

 

...

property names (unqualified) whose values have changed, terminated by NULL.

 

Since: 0.15.6

Types and Values

enum TpDBusPropertiesMixinFlags

Bitfield representing allowed access to a property. At most one of TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED and TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED may be specified for a property.

Since 0.11.5, there is a corresponding GFlagsClass type, TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS.

Members

TP_DBUS_PROPERTIES_MIXIN_FLAG_READ

The property can be read using Get and GetAll

 

TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE

The property can be written using Set

 

TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED

The property's new value is included in emissions of PropertiesChanged

 

TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED

The property is announced as invalidated, without its value, in emissions of PropertiesChanged

 

Since: 0.7.3


TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS

#define TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS (tp_dbus_properties_mixin_flags_get_type ())

The GFlagsClass type of TpDBusPropertiesMixinFlags.

Since: 0.11.5


TpDBusPropertiesMixinIfaceInfo

typedef struct {
    GQuark dbus_interface;
    TpDBusPropertiesMixinPropInfo *props;
} TpDBusPropertiesMixinIfaceInfo;

Semi-abstract description of an interface. Each service GInterface that has properties must have one of these attached to it via tp_svc_interface_set_dbus_properties_info() in its base_init function; service GInterfaces that do not have properties may have one of these with no properties.

This structure must either be statically allocated, or duplicated and never freed, so it always remains valid.

In addition to the documented members, there are two private pointers for future expansion, which must always be initialized to NULL.

Members

GQuark dbus_interface;

Quark representing the interface's name

 

TpDBusPropertiesMixinPropInfo *props;

Array of property descriptions, terminated by one with name == NULL

 

Since: 0.7.3


TpDBusPropertiesMixinPropInfo

typedef struct {
    GQuark name;
    TpDBusPropertiesMixinFlags flags;
    gchar *dbus_signature;
    GType type;
} TpDBusPropertiesMixinPropInfo;

Semi-abstract description of a property, as attached to a service GInterface. This structure must either be statically allocated, or duplicated and never freed, so it always remains valid.

In addition to the documented members, there are two private pointers for future expansion, which must always be initialized to NULL.

Members

GQuark name;

Quark representing the property's name

 

TpDBusPropertiesMixinFlags flags;

Flags representing read/write access to the property

 

gchar *dbus_signature;

The D-Bus signature of the property

 

GType type;

The GType used in a GValue to implement the property

 

Since: 0.7.3


TpDBusPropertiesMixinClass

typedef struct {
    TpDBusPropertiesMixinIfaceImpl *interfaces;
} TpDBusPropertiesMixinClass;

Structure representing all of a class's property implementations. One of these structures may be placed in the layout of an object class structure.

In addition to the documented fields, there are 7 pointers reserved for future use, which must be initialized to NULL.

Members

TpDBusPropertiesMixinIfaceImpl *interfaces;

An array of interface implementations, terminated by one with name equal to NULL

 

Since: 0.7.3


TpDBusPropertiesMixinIfaceImpl

typedef struct {
    const gchar *name;
    TpDBusPropertiesMixinGetter getter;
    TpDBusPropertiesMixinSetter setter;
    TpDBusPropertiesMixinPropImpl *props;
} TpDBusPropertiesMixinIfaceImpl;

Structure representing an implementation of an interface's properties.

In addition to the documented fields, there are four pointers which must be initialized to NULL.

This structure must either be statically allocated, or duplicated and never freed, so it always remains valid.

Members

const gchar *name;

The name of the interface

 

TpDBusPropertiesMixinGetter getter;

A callback to get the current value of the property, to which the getter_data from each property implementation will be passed

 

TpDBusPropertiesMixinSetter setter;

A callback to set a new value for the property, to which the setter_data from each property implementation will be passed

 

TpDBusPropertiesMixinPropImpl *props;

An array of property implementations, terminated by one with name equal to NULL

 

Since: 0.7.3


TpDBusPropertiesMixinPropImpl

typedef struct {
    const gchar *name;
    gpointer getter_data;
    gpointer setter_data;
} TpDBusPropertiesMixinPropImpl;

Structure representing an implementation of a property.

In addition to the documented fields, there are three pointers which must be initialized to NULL.

This structure must either be statically allocated, or duplicated and never freed, so it always remains valid.

Members

const gchar *name;

The name of the property as it appears on D-Bus

 

gpointer getter_data;

Arbitrary user-supplied data for the getter function

 

gpointer setter_data;

Arbitrary user-supplied data for the setter function

 

Since: 0.7.3

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-util.html0000644000175000017500000032532114006623344022047 00000000000000 Utilities: telepathy-glib API Reference Manual

Utilities

Utilities — Non-Telepathy utility functions

Functions

#define tp_verify()
#define tp_verify_true()
#define tp_verify_statement()
void tp_g_hash_table_update ()
gboolean tp_g_ptr_array_contains ()
void tp_g_ptr_array_extend ()
GValue * tp_g_value_slice_new ()
GValue * tp_g_value_slice_new_boolean ()
GValue * tp_g_value_slice_new_boxed ()
GValue * tp_g_value_slice_new_static_boxed ()
GValue * tp_g_value_slice_new_take_boxed ()
GValue * tp_g_value_slice_new_double ()
GValue * tp_g_value_slice_new_int ()
GValue * tp_g_value_slice_new_int64 ()
GValue * tp_g_value_slice_new_string ()
GValue * tp_g_value_slice_new_static_string ()
GValue * tp_g_value_slice_new_take_string ()
GValue * tp_g_value_slice_new_uint ()
GValue * tp_g_value_slice_new_uint64 ()
GValue * tp_g_value_slice_new_byte ()
void tp_g_value_slice_free ()
GValue * tp_g_value_slice_dup ()
gboolean tp_str_empty ()
gboolean tp_strdiff ()
gpointer tp_mixin_offset_cast ()
guint tp_mixin_class_get_offset ()
guint tp_mixin_instance_get_offset ()
gchar * tp_escape_as_identifier ()
gboolean tp_strv_contains ()
gint64 tp_g_key_file_get_int64 ()
guint64 tp_g_key_file_get_uint64 ()
gulong tp_g_signal_connect_object ()
GValueArray * tp_value_array_build ()
void tp_value_array_unpack ()
void tp_value_array_free ()
TpWeakRef * tp_weak_ref_new ()
gpointer tp_weak_ref_dup_object ()
gpointer tp_weak_ref_get_user_data ()
void tp_weak_ref_destroy ()
#define tp_clear_pointer()
#define tp_clear_object()
#define tp_clear_boxed()
void tp_simple_async_report_success_in_idle ()
gint64 tp_user_action_time_from_x11 ()
gboolean tp_user_action_time_should_present ()
gchar * tp_utf8_make_valid ()

Types and Values

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Some utility functions used in telepathy-glib which could have been in GLib, but aren't.

Functions

tp_verify()

#define tp_verify(R)            G_STATIC_ASSERT (R)

Make an assertion at compile time, like C++0x's proposed static_assert keyword. If R is determined to be true, there is no overhead at runtime; if R is determined to be false, compilation will fail.

This macro can be used at file scope (it expands to a dummy extern declaration).

(This is gnulib's verify macro, written by Paul Eggert, Bruno Haible and Jim Meyering.)

This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code.

Parameters

R

a requirement (constant expression) to be checked at compile-time

 

Since: 0.7.34


tp_verify_true()

#define tp_verify_true(R)       (((void) G_STATIC_ASSERT_EXPR (R)), 1)

Make an assertion at compile time, like C++0x's proposed static_assert keyword. If R is determined to be true, there is no overhead at runtime, and the macro evaluates to 1 as an integer constant expression; if R is determined to be false, compilation will fail.

This macro can be used anywhere that an integer constant expression would be allowed.

(This is gnulib's verify_true macro, written by Paul Eggert, Bruno Haible and Jim Meyering.)

This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code.

Parameters

R

a requirement (constant expression) to be checked at compile-time

 

Returns

1

Since: 0.7.34


tp_verify_statement()

#define tp_verify_statement(R)  ((void) G_STATIC_ASSERT_EXPR (R))

Make an assertion at compile time, like C++0x's proposed static_assert keyword. If R is determined to be true, there is no overhead at runtime; if R is determined to be false, compilation will fail.

This macro can be used anywhere that a statement would be allowed; it is equivalent to ((void) tp_verify_true (R)).

This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code.

Parameters

R

a requirement (constant expression) to be checked at compile-time

 

Since: 0.7.34


tp_g_hash_table_update ()

void
tp_g_hash_table_update (GHashTable *target,
                        GHashTable *source,
                        GBoxedCopyFunc key_dup,
                        GBoxedCopyFunc value_dup);

Add each item in source to target , replacing any existing item with the same key. key_dup and value_dup are used to duplicate the items; in principle they could also be used to convert between types.

[skip]

Parameters

target

The hash table to be updated

 

source

The hash table to update it with (read-only)

 

key_dup

function to duplicate a key from source so it can be be stored in target . If NULL, the key is not copied, but is used as-is

 

value_dup

function to duplicate a value from source so it can be stored in target . If NULL, the value is not copied, but is used as-is

 

Since: 0.7.0


tp_g_ptr_array_contains ()

gboolean
tp_g_ptr_array_contains (GPtrArray *haystack,
                         gpointer needle);

[skip]

Parameters

haystack

The pointer array to be searched

 

needle

The pointer to look for

 

Returns

TRUE if needle is one of the elements of haystack


tp_g_ptr_array_extend ()

void
tp_g_ptr_array_extend (GPtrArray *target,
                       GPtrArray *source);

Appends all elements of source to target . Note that this only copies the pointers from source ; any duplication or reference-incrementing must be performed by the caller.

After this function has been called, it is safe to call g_ptr_array_free() on source and also free the actual pointer array, as long as doing so does not free the data pointed to by the new items in target .

[skip]

Parameters

target

a GPtrArray to copy items to

 

source

a GPtrArray to copy items from

 

Since: 0.14.3


tp_g_value_slice_new ()

GValue *
tp_g_value_slice_new (GType type);

Slice-allocate an empty GValue. tp_g_value_slice_new_boolean() and similar functions are likely to be more convenient to use for the types supported.

[skip]

Parameters

type

The type desired for the new GValue

 

Returns

a newly allocated, newly initialized GValue, to be freed with tp_g_value_slice_free() or g_slice_free().

Since: 0.5.14


tp_g_value_slice_new_boolean ()

GValue *
tp_g_value_slice_new_boolean (gboolean b);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

b

a boolean value

 

Returns

a GValue of type G_TYPE_BOOLEAN with value b , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_boxed ()

GValue *
tp_g_value_slice_new_boxed (GType type,
                            gconstpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

type

a boxed type

 

p

a pointer of type type , which will be copied

 

Returns

a GValue of type type whose value is a copy of p , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_static_boxed ()

GValue *
tp_g_value_slice_new_static_boxed (GType type,
                                   gconstpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

type

a boxed type

 

p

a pointer of type type , which must remain valid forever

 

Returns

a GValue of type type whose value is p , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_take_boxed ()

GValue *
tp_g_value_slice_new_take_boxed (GType type,
                                 gpointer p);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

type

a boxed type

 

p

a pointer of type type which will be freed with g_boxed_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

 

Returns

a GValue of type type whose value is p , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_double ()

GValue *
tp_g_value_slice_new_double (double d);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

d

a number

 

Returns

a GValue of type G_TYPE_DOUBLE with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_int ()

GValue *
tp_g_value_slice_new_int (gint n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

n

an integer

 

Returns

a GValue of type G_TYPE_INT with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_int64 ()

GValue *
tp_g_value_slice_new_int64 (gint64 n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

n

a 64-bit integer

 

Returns

a GValue of type G_TYPE_INT64 with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_string ()

GValue *
tp_g_value_slice_new_string (const gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

string

a string to be copied into the value

 

Returns

a GValue of type G_TYPE_STRING whose value is a copy of string , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_static_string ()

GValue *
tp_g_value_slice_new_static_string (const gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

string

a static string which must remain valid forever, to be pointed to by the value

 

Returns

a GValue of type G_TYPE_STRING whose value is string , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_take_string ()

GValue *
tp_g_value_slice_new_take_string (gchar *string);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

string

a string which will be freed with g_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

 

Returns

a GValue of type G_TYPE_STRING whose value is string , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_uint ()

GValue *
tp_g_value_slice_new_uint (guint n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

n

an unsigned integer

 

Returns

a GValue of type G_TYPE_UINT with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_uint64 ()

GValue *
tp_g_value_slice_new_uint64 (guint64 n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

n

a 64-bit unsigned integer

 

Returns

a GValue of type G_TYPE_UINT64 with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_byte ()

GValue *
tp_g_value_slice_new_byte (guchar n);

Slice-allocate and initialize a GValue. This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

n

an unsigned integer

 

Returns

a GValue of type G_TYPE_UCHAR with value n , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.11.0


tp_g_value_slice_free ()

void
tp_g_value_slice_free (GValue *value);

Unset and free a slice-allocated GValue.

(GDestroyNotify) tp_g_value_slice_free can be used as a destructor for values in a GHashTable, for example.

[skip]

Parameters

value

A GValue which was allocated with the g_slice API

 

tp_g_value_slice_dup ()

GValue *
tp_g_value_slice_dup (const GValue *value);

[skip]

Parameters

value

A GValue

 

Returns

a newly allocated copy of value , to be freed with tp_g_value_slice_free() or g_slice_free().

Since: 0.5.14


tp_str_empty ()

gboolean
tp_str_empty (const gchar *s);

Return TRUE if s is empty, counting NULL as empty.

[skip]

Parameters

s

a string.

[type utf8][transfer none]

Returns

TRUE if s is either NULL or "".

[type boolean]

Since: 0.11.1


tp_strdiff ()

gboolean
tp_strdiff (const gchar *left,
            const gchar *right);

Return TRUE if the given strings are different. Unlike strcmp this function will handle null pointers, treating them as distinct from any string.

[skip]

Parameters

left

The first string to compare (may be NULL)

 

right

The second string to compare (may be NULL)

 

Returns

FALSE if left and right are both NULL, or if neither is NULL and both have the same contents; TRUE otherwise


tp_mixin_offset_cast ()

gpointer
tp_mixin_offset_cast (gpointer instance,
                      guint offset);

Extend a pointer by an offset, provided the offset is not 0. This is used to cast from an object instance to one of the telepathy-glib mixin classes.

[skip]

Parameters

instance

A pointer to a structure

 

offset

The offset of a structure member in bytes, which must not be 0

 

Returns

a pointer offset bytes beyond instance


tp_mixin_class_get_offset ()

guint
tp_mixin_class_get_offset (gpointer klass,
                           GQuark quark);

If the type of klass , or any of its ancestor types, has had an offset attached using qdata with the given quark , return that offset; if not, return 0.

In older telepathy-glib versions, calling this function on an instance that did not have the mixin was considered to be a programming error. Since version 0.13.9, 0 is returned, without error.

This is used to implement the telepathy-glib mixin classes.

[skip]

Parameters

klass

A pointer to a GObjectClass-derived class structure

 

quark

A quark that was used to store the offset with g_type_set_qdata()

 

Returns

the offset of the mixin class


tp_mixin_instance_get_offset ()

guint
tp_mixin_instance_get_offset (gpointer instance,
                              GQuark quark);

If the type of instance , or any of its ancestor types, has had an offset attached using qdata with the given quark , return that offset. If not, return 0.

In older telepathy-glib versions, calling this function on an instance that did not have the mixin was considered to be a programming error. Since version 0.13.9, 0 is returned, without error.

This is used to implement the telepathy-glib mixin classes.

[skip]

Parameters

instance

A pointer to a GObject-derived instance structure

 

quark

A quark that was used to store the offset with g_type_set_qdata()

 

Returns

the offset of the mixin


tp_escape_as_identifier ()

gchar *
tp_escape_as_identifier (const gchar *name);

Escape an arbitrary string so it follows the rules for a C identifier, and hence an object path component, interface element component, bus name component or member name in D-Bus.

Unlike g_strcanon this is a reversible encoding, so it preserves distinctness.

The escaping consists of replacing all non-alphanumerics, and the first character if it's a digit, with an underscore and two lower-case hex digits:

"0123abc_xyz\x01\xff" -> _30123abc_5fxyz_01_ff

i.e. similar to URI encoding, but with _ taking the role of %, and a smaller allowed set. As a special case, "" is escaped to "_" (just for completeness, really).

Parameters

name

The string to be escaped

 

Returns

the escaped string, which must be freed by the caller with g_free.

[transfer full]


tp_strv_contains ()

gboolean
tp_strv_contains (const gchar * const *strv,
                  const gchar *str);

[skip]

Parameters

strv

a NULL-terminated array of strings, or NULL (which is treated as an empty strv)

 

str

a non-NULL string

 

Returns

TRUE if str is an element of strv , according to strcmp().

Since: 0.7.15


tp_g_key_file_get_int64 ()

gint64
tp_g_key_file_get_int64 (GKeyFile *key_file,
                         const gchar *group_name,
                         const gchar *key,
                         GError **error);

tp_g_key_file_get_int64 is deprecated and should not be used in newly-written code.

Since 0.21.0. Use g_key_file_get_int64() instead.

Returns the value associated with key under group_name as a signed 64-bit integer. This is similar to g_key_file_get_integer() but can return 64-bit results without truncation.

[skip]

Parameters

key_file

a non-NULL GKeyFile

 

group_name

a non-NULL group name

 

key

a non-NULL key

 

error

return location for a GError

 

Returns

the value associated with the key as a signed 64-bit integer, or 0 if the key was not found or could not be parsed.

Since: 0.7.31


tp_g_key_file_get_uint64 ()

guint64
tp_g_key_file_get_uint64 (GKeyFile *key_file,
                          const gchar *group_name,
                          const gchar *key,
                          GError **error);

tp_g_key_file_get_uint64 is deprecated and should not be used in newly-written code.

Since 0.21.0. Use g_key_file_get_uint64() instead.

Returns the value associated with key under group_name as an unsigned 64-bit integer. This is similar to g_key_file_get_integer() but can return large positive results without truncation.

[skip]

Parameters

key_file

a non-NULL GKeyFile

 

group_name

a non-NULL group name

 

key

a non-NULL key

 

error

return location for a GError

 

Returns

the value associated with the key as an unsigned 64-bit integer, or 0 if the key was not found or could not be parsed.

Since: 0.7.31


tp_g_signal_connect_object ()

gulong
tp_g_signal_connect_object (gpointer instance,
                            const gchar *detailed_signal,
                            GCallback c_handler,
                            gpointer gobject,
                            GConnectFlags connect_flags);

Connects a GCallback function to a signal for a particular object, as if with g_signal_connect(). Additionally, arranges for the signal handler to be disconnected if gobject is destroyed.

This is similar to g_signal_connect_data(), but uses a closure which ensures that the gobject stays alive during the call to c_handler by temporarily adding a reference count to gobject .

This is similar to g_signal_connect_object(), but doesn't have the documented bug that everyone is too scared to fix. Also, it does not allow you to pass in NULL as gobject

This is intended to be a convenient way for objects to use themselves as user_data for callbacks without having to explicitly disconnect all the handlers in their finalizers.

Changed in 0.10.4 and 0.11.3: G_CONNECT_AFTER is now respected.

[skip]

Parameters

instance

the instance to connect to.

 

detailed_signal

a string of the form "signal-name::detail".

 

c_handler

the GCallback to connect.

 

gobject

the object to pass as data to c_handler .

 

connect_flags

a combination of GConnectFlags. Only G_CONNECT_AFTER and G_CONNECT_SWAPPED are supported by this function.

 

Returns

the handler id

Since: 0.9.2


tp_value_array_build ()

GValueArray *
tp_value_array_build (gsize length,
                      GType type,
                      ...);

Creates a new GValueArray for use with structs, containing the values passed in as parameters. The values are copied or reffed as appropriate for their type.

Example 3.  using tp_value_array_build

1
2
3
4
GValueArray *array = tp_value_array_build (2,
   G_TYPE_STRING, host,
   G_TYPE_UINT, port,
   G_TYPE_INVALID);

[skip]

Parameters

length

The number of elements that should be in the array

 

type

The type of the first argument.

 

...

The value of the first item in the struct followed by a list of type, value pairs terminated by G_TYPE_INVALID.

 

Returns

a newly created GValueArray, free with tp_value_array_free()

Since: 0.9.2


tp_value_array_unpack ()

void
tp_value_array_unpack (GValueArray *array,
                       gsize len,
                       ...);

Unpacks a GValueArray into separate variables.

The contents of the values aren't copied into the variables, and so become invalid when array is freed.

Example 4. using tp_value_array_unpack

1
2
3
4
5
6
const gchar *host;
guint port;

tp_value_array_unpack (array, 2,
   &host,
   &port);

[skip]

Parameters

array

the array to unpack

 

len

The number of elements that should be in the array

 

...

a list of correctly typed pointers to store the values in

 

Since: 0.11.0


tp_value_array_free ()

void
tp_value_array_free (GValueArray *va);

Free va . This is exactly the same as g_value_array_free(), but does not provoke deprecation warnings from GLib when used in conjunction with tp_value_array_build() and tp_value_array_unpack().

Parameters

va

a GValueArray

 

Since: 0.23.0


tp_weak_ref_new ()

TpWeakRef *
tp_weak_ref_new (gpointer object,
                 gpointer user_data,
                 GDestroyNotify destroy);

Return a new weak reference wrapper for object .

[skip]

Parameters

object

an object to which to take a weak reference.

[type GObject.Object]

user_data

optional additional data to store alongside the weak ref

 

destroy

destructor for user_data , called when the weak ref is freed

 

Returns

a new weak-reference wrapper

Free-function: tp_weak_ref_destroy().

[transfer full]

Since: 0.11.3


tp_weak_ref_dup_object ()

gpointer
tp_weak_ref_dup_object (TpWeakRef *self);

If the weakly referenced object still exists, return a new reference to it. Otherwise, return NULL.

[skip]

Parameters

self

a weak reference

 

Returns

a new reference, or NULL.

[type GObject.Object][transfer full]

Since: 0.11.3


tp_weak_ref_get_user_data ()

gpointer
tp_weak_ref_get_user_data (TpWeakRef *self);

Return the additional data that was passed to tp_weak_ref_new().

[skip]

Parameters

self

a weak reference

 

Returns

the additional data supplied in tp_weak_ref_new(), which may be NULL

Since: 0.11.3


tp_weak_ref_destroy ()

void
tp_weak_ref_destroy (TpWeakRef *self);

Free a weak reference wrapper. This drops the weak reference to the object (if it still exists), and frees the user data with the user-supplied destructor function if one was provided.

[skip]

Parameters

self

a weak reference.

[transfer full]

Since: 0.11.3


tp_clear_pointer()

#define             tp_clear_pointer(pp, destroy)

Set a variable holding a pointer to NULL. If it was not already NULL, unref or destroy the object it previously pointed to with destroy .

More precisely, if *pp is non-NULL, set *pp to NULL, then call destroy on the object that *pp previously pointed to.

This is analogous to g_clear_error() for non-error objects, but also ensures that pp is already NULL before the destructor is run.

Typical usage is something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
typedef struct {
  TpConnection *conn;
  GError *error;
  GHashTable *table;
  MyStruct *misc;
} Foo;
Foo *foo;

...

tp_clear_object (&foo->conn);
g_clear_error (&foo->error);
tp_clear_boxed (G_TYPE_HASH_TABLE, &foo->table);
tp_clear_pointer (&foo->misc, my_struct_destroy);

Parameters

pp

a pointer to a variable, struct member etc. holding a pointer

 

destroy

a function to which a gpointer can be passed, to destroy *pp (if calling this macro from C++, explicitly casting the function to GDestroyNotify may be necessary)

 

Since: 0.11.7


tp_clear_object()

#define tp_clear_object(op) tp_clear_pointer ((op), g_object_unref)

Set a variable holding a GObject to NULL. If it was not already NULL, unref the object it previously pointed to.

This is exactly equivalent to calling tp_clear_pointer() on op , with destroy = g_object_unref(). See tp_clear_pointer() for example usage.

Parameters

op

a pointer to a variable, struct member etc. holding a GObject

 

Since: 0.11.7


tp_clear_boxed()

#define             tp_clear_boxed(gtype, pp)

Set a variable holding a boxed object to NULL. If it was not already NULL, destroy the boxed object it previously pointed to, as appropriate for gtype .

More precisely, if *pp is non-NULL, set *pp to NULL, then call g_boxed_free() on the object that *pp previously pointed to.

This is similar to tp_clear_pointer(); see that function's documentation for typical usage.

Parameters

gtype

the GType of *pp , e.g. G_TYPE_HASH_TABLE.

[type GObject.Type]

pp

a pointer to a variable, struct member etc. holding a boxed object

 

Since: 0.11.7


tp_simple_async_report_success_in_idle ()

void
tp_simple_async_report_success_in_idle
                               (GObject *source,
                                GAsyncReadyCallback callback,
                                gpointer user_data,
                                gpointer source_tag);

Create a new GSimpleAsyncResult with no operation result, and call g_simple_async_result_complete_in_idle() on it.

This is like a successful version of g_simple_async_report_error_in_idle(), suitable for asynchronous functions that (conceptually) either succeed and return nothing, or raise an error, such as tp_proxy_prepare_async().

The corresponding finish function should not call a function that attempts to get a result, such as g_simple_async_result_get_op_res_gpointer().

Parameters

source

the source object.

[allow-none]

callback

the callback.

[scope async]

user_data

user data for callback .

[closure]

source_tag

the source tag for the GSimpleAsyncResult

 

Since: 0.11.9


tp_user_action_time_from_x11 ()

gint64
tp_user_action_time_from_x11 (guint32 x11_time);

Convert an X11 timestamp into a user action time as used in Telepathy.

This also works for the timestamps used by GDK 2, GDK 3 and Clutter 1.0; it may or may not work with other toolkits or versions.

Parameters

x11_time

an X11 timestamp, or 0 to indicate the current time

 

Returns

a nonzero Telepathy user action time, or TP_USER_ACTION_TIME_CURRENT_TIME

Since: 0.11.13


tp_user_action_time_should_present ()

gboolean
tp_user_action_time_should_present (gint64 user_action_time,
                                    guint32 *x11_time);

Interpret a Telepathy user action time to decide whether a Handler should attempt to gain focus. If TRUE is returned, it would be appropriate to call gtk_window_present_with_time() using x11_time as input, for instance.

x11_time is used to return a timestamp in the right format for X11, GDK 2, GDK 3 and Clutter 1.0; it may or may not work with other toolkits or versions.

Parameters

user_action_time

the Telepathy user action time.

[type gint64]

x11_time

a pointer to guint32 used to return an X11 timestamp, or 0 to indicate the current time; if FALSE is returned, the value placed here is not meaningful.

[out][allow-none]

Returns

TRUE if it would be appropriate to present a window

Since: 0.11.13


tp_utf8_make_valid ()

gchar *
tp_utf8_make_valid (const gchar *name);

Validate that the provided string is valid UTF8. If not, replace all invalid bytes with unicode replacement character (U+FFFD).

This method is a verbatim copy of glib's internal _g_utf8_make_valid() function, and will be deprecated as soon as the glib one becomes public.

Parameters

name

string to coerce into UTF8

 

Returns

a new valid UTF8 string.

[transfer full]

Since: 0.13.15

Types and Values

TpWeakRef

typedef struct _TpWeakRef TpWeakRef;

A simple wrapper for a weak reference to a GObject, suitable for use in asynchronous calls which should only affect the object if it hasn't already been freed.

As well as wrapping a weak reference to an object, this structure can contain an extra pointer to arbitrary data. This is useful for asynchronous calls which act on an object and some second piece of data, which are quite common in practice.

If more than one piece of auxiliary data is required, the user_data argument to the constructor can be a struct or a GValueArray.

Since: 0.11.3

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-vardict.html0000644000175000017500000006126114006623344022526 00000000000000 Manipulating a{sv} mappings: telepathy-glib API Reference Manual

Manipulating a{sv} mappings

Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in GVariant by a G_VARIANT_TYPE_VARDICT

Functions

gboolean tp_vardict_get_boolean ()
gdouble tp_vardict_get_double ()
gint32 tp_vardict_get_int32 ()
gint64 tp_vardict_get_int64 ()
const gchar * tp_vardict_get_object_path ()
const gchar * tp_vardict_get_string ()
guint32 tp_vardict_get_uint32 ()
guint64 tp_vardict_get_uint64 ()

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

These functions provide convenient access to the values in such a mapping.

Functions

tp_vardict_get_boolean ()

gboolean
tp_vardict_get_boolean (GVariant *variant,
                        const gchar *key,
                        gboolean *valid);

If a value for key in variant is present and boolean, return it, and set *valid to TRUE if valid is not NULL.

Otherwise return FALSE, and set *valid to FALSE if valid is not NULL.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location to store TRUE if the key actually exists and has a boolean value.

[out]

Returns

a boolean value for key

Since: 0.19.10


tp_vardict_get_double ()

gdouble
tp_vardict_get_double (GVariant *variant,
                       const gchar *key,
                       gboolean *valid);

If a value for key in variant is present and has any numeric type used by GVariant (gint32, guint32, gint64, guint64 or gdouble), return it as a double, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0.0, and if valid is not NULL, set *valid to FALSE.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the double precision floating-point value of key , or 0.0

Since: 0.19.10


tp_vardict_get_int32 ()

gint32
tp_vardict_get_int32 (GVariant *variant,
                      const gchar *key,
                      gboolean *valid);

If a value for key in variant is present, has an integer type used by GVariant (gint32, guint32, gint64 or guint64) and fits in the range of a gint32, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 32-bit signed integer value of key , or 0

Since: 0.19.10


tp_vardict_get_int64 ()

gint64
tp_vardict_get_int64 (GVariant *variant,
                      const gchar *key,
                      gboolean *valid);

If a value for key in variant is present, has an integer type used by GVariant (gint32, guint32, gint64 or guint64) and fits in the range of a gint64, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 64-bit signed integer value of key , or 0

Since: 0.19.10


tp_vardict_get_object_path ()

const gchar *
tp_vardict_get_object_path (GVariant *variant,
                            const gchar *key);

If a value for key in variant is present and is an object path, return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as variant is kept. Copy it with g_strdup() if you need to keep it for longer.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

Returns

the object path value of key , or NULL.

[transfer none][allow-none]

Since: 0.19.10


tp_vardict_get_string ()

const gchar *
tp_vardict_get_string (GVariant *variant,
                       const gchar *key);

If a value for key in variant is present and is a string, return it.

Otherwise return NULL.

The returned value is not copied, and is only valid as long as variant is kept. Copy it with g_strdup() if you need to keep it for longer.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

Returns

the string value of key , or NULL.

[transfer none][allow-none]

Since: 0.19.10


tp_vardict_get_uint32 ()

guint32
tp_vardict_get_uint32 (GVariant *variant,
                       const gchar *key,
                       gboolean *valid);

If a value for key in variant is present, has an integer type used by GVariant (gint32, guint32, gint64 or guint64) and fits in the range of a guint32, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 32-bit unsigned integer value of key , or 0

Since: 0.19.10


tp_vardict_get_uint64 ()

guint64
tp_vardict_get_uint64 (GVariant *variant,
                       const gchar *key,
                       gboolean *valid);

If a value for key in variant is present, has an integer type used by GVariant (gint32, guint32, gint64 or guint64) and is non-negative, return it, and if valid is not NULL, set *valid to TRUE.

Otherwise, return 0, and if valid is not NULL, set *valid to FALSE.

Parameters

variant

a GVariant of type G_VARIANT_TYPE_VARDICT

 

key

The key to look up

 

valid

Either NULL, or a location in which to store TRUE on success or FALSE on failure.

[out]

Returns

the 64-bit unsigned integer value of key , or 0

Since: 0.19.10

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-request.html0000644000175000017500000026057314006623344024177 00000000000000 TpChannelRequest: telepathy-glib API Reference Manual

TpChannelRequest

TpChannelRequest — proxy object for a request to the Telepathy channel dispatcher

Properties

TpAccount * account Read
GObject * channel-factory Read / Write / Construct
GHashTable_gchararray+GValue_* hints Read
GVariant * hints-vardict Read
GHashTable_gchararray+GValue_* immutable-properties Read / Write / Construct Only
GVariant * immutable-properties-vardict Read
gchar * preferred-handler Read
gint64 user-action-time Read

Signals

void succeeded Has Details
void succeeded-with-channel Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannelRequest

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Requesting a channel from the channel dispatcher can take some time, so an object is created in the channel dispatcher to represent each request. Objects of the TpChannelRequest class provide access to one of those objects.

Functions

tp_channel_request_new ()

TpChannelRequest *
tp_channel_request_new (TpDBusDaemon *bus_daemon,
                        const gchar *object_path,
                        GHashTable *immutable_properties,
                        GError **error);

tp_channel_request_new is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should get TpChannelRequest objects from a TpBaseClient

Convenience function to create a new channel request proxy.

If the channel request was newly created, the client making the request is responsible for calling tp_cli_channel_request_call_proceed() when it is ready for the channel request to proceed.

Parameters

bus_daemon

Proxy for the D-Bus daemon

 

object_path

The non-NULL object path of this channel request

 

immutable_properties

As many as are known of the immutable D-Bus properties of this channel request, or NULL if none are known

 

error

Used to raise an error if NULL is returned

 

Returns

a new reference to an channel request proxy, or NULL if object_path is not syntactically valid or the channel dispatcher is not running


tp_channel_request_init_known_interfaces ()

void
tp_channel_request_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpChannelRequest have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CHANNEL_REQUEST.

Since: 0.7.32


tp_channel_request_set_channel_factory ()

void
tp_channel_request_set_channel_factory
                               (TpChannelRequest *self,
                                TpClientChannelFactory *factory);

tp_channel_request_set_channel_factory is deprecated and should not be used in newly-written code.

since 0.15.5. Use “factory” instead.

Change the value of the “channel-factory” property.

Parameters

self

a TpChannelRequest

 

factory

an object implementing the TpClientChannelFactoryInterface interface

 

Since: 0.13.14


tp_channel_request_get_immutable_properties ()

const GHashTable *
tp_channel_request_get_immutable_properties
                               (TpChannelRequest *self);

Return the “immutable-properties” construct-only property

Parameters

self

a TpChannelRequest

 

Returns

the value of “immutable-properties”.

[transfer none]

Since: 0.13.14


tp_channel_request_dup_immutable_properties ()

GVariant *
tp_channel_request_dup_immutable_properties
                               (TpChannelRequest *self);

Return the “immutable-properties-vardict” property.

Parameters

self

a TpChannelRequest

 

Returns

the value of “immutable-properties-vardict”.

[transfer full]

Since: 0.19.10


tp_channel_request_get_account ()

TpAccount *
tp_channel_request_get_account (TpChannelRequest *self);

Return the value of the “account” construct-only property

Parameters

self

a tpchannelrequest

 

Returns

the value of “account”.

[transfer none]

Since: 0.15.3


tp_channel_request_get_user_action_time ()

gint64
tp_channel_request_get_user_action_time
                               (TpChannelRequest *self);

return the “user-action-time” construct-only property

Parameters

self

a tpchannelrequest

 

Returns

the value of “user-action-time”

Since: 0.15.3


tp_channel_request_get_preferred_handler ()

const gchar *
tp_channel_request_get_preferred_handler
                               (TpChannelRequest *self);

return the “preferred-handler” construct-only property

Parameters

self

a tpchannelrequest

 

Returns

the value of “preferred-handler”

Since: 0.15.3


tp_channel_request_get_hints ()

const GHashTable *
tp_channel_request_get_hints (TpChannelRequest *self);

Return the “hints” property

Parameters

self

a TpChannelRequest

 

Returns

the value of “hints”.

[transfer none]

Since: 0.13.14


tp_channel_request_dup_hints ()

GVariant *
tp_channel_request_dup_hints (TpChannelRequest *self);

Return the “hints-vardict” property

Parameters

self

a TpChannelRequest

 

Returns

the value of “hints-vardict”.

[transfer full]

Since: 0.19.10


tp_cli_channel_request_callback_for_cancel ()

void
(*tp_cli_channel_request_callback_for_cancel)
                               (TpChannelRequest *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Cancel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_request_call_cancel ()

TpProxyPendingCall *
tp_cli_channel_request_call_cancel (TpChannelRequest *proxy,
                                    gint timeout_ms,
                                    tp_cli_channel_request_callback_for_cancel callback,
                                    gpointer user_data,
                                    GDestroyNotify destroy,
                                    GObject *weak_object);

Start a Cancel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Cancel the channel request. The precise effect depends on the current progress of the request.</p> <p>If the connection manager has not already been asked to create a channel, then <tp:member-ref>Failed</tp:member-ref> is emitted immediately, and the channel request is removed.</p> <p>If the connection manager has already been asked to create a channel but has not produced one yet (e.g. if <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref> has been called, but has not yet returned), then the ChannelDispatcher will remember that the request has been cancelled. When the channel appears, it will be closed (if it was newly created and can be closed), and will not be dispatched to a handler.</p> <p>If the connection manager has already returned a channel, but the channel has not yet been dispatched to a handler then the channel dispatcher will not dispatch that channel to a handler. If the channel was newly created for this request, the channel dispatcher will close it with <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref>; otherwise, the channel dispatcher will ignore it. In either case, <tp:member-ref>Failed</tp:member-ref> will be emitted when processing has been completed.</p> <p>If <tp:member-ref>Failed</tp:member-ref> is emitted in response to this method, the error SHOULD be <code>org.freedesktop.Telepathy.Error.Cancelled</code>.</p> <p>If the channel has already been dispatched to a handler, then it's too late to call this method, and the channel request will no longer exist.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_request_callback_for_proceed ()

void
(*tp_cli_channel_request_callback_for_proceed)
                               (TpChannelRequest *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Proceed method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_request_call_proceed ()

TpProxyPendingCall *
tp_cli_channel_request_call_proceed (TpChannelRequest *proxy,
                                     gint timeout_ms,
                                     tp_cli_channel_request_callback_for_proceed callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy,
                                     GObject *weak_object);

Start a Proceed method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Proceed with the channel request.</p> <tp:rationale> <p>The client that created this object calls this method when it has connected signal handlers for <tp:member-ref>Succeeded</tp:member-ref> and <tp:member-ref>Failed</tp:member-ref>.</p> </tp:rationale> <p>Clients other than the client which created the ChannelRequest MUST NOT call this method.</p> <p>This method SHOULD return immediately; on success, the request might still fail, but this will be indicated asynchronously by the <tp:member-ref>Failed</tp:member-ref> signal.</p> <p>Proceed cannot fail, unless clients have got the life-cycle of a ChannelRequest seriously wrong (e.g. a client calls this method twice, or a client that did not create the ChannelRequest calls this method). If it fails, clients SHOULD assume that the whole ChannelRequest has become useless.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_request_signal_callback_failed ()

void
(*tp_cli_channel_request_signal_callback_failed)
                               (TpChannelRequest *proxy,
                                const gchar *arg_Error,
                                const gchar *arg_Message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Failed.

Parameters

proxy

The proxy on which tp_cli_channel_request_connect_to_failed() was called

 

arg_Error

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The name of a D-Bus error. This can come from various sources, including the error raised by <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Requests">CreateChannel</tp:dbus-ref>, or an error generated to represent failure to establish the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref>.</p>

 

arg_Message

If the first argument of the D-Bus error message was a string, that string. Otherwise, an empty string.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_request_connect_to_failed ()

TpProxySignalConnection *
tp_cli_channel_request_connect_to_failed
                               (TpChannelRequest *proxy,
                                tp_cli_channel_request_signal_callback_failed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Failed.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel request has failed. It is no longer present, and further methods must not be called on it.</p>

Parameters

proxy

A TpChannelRequest or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_request_signal_callback_succeeded ()

void
(*tp_cli_channel_request_signal_callback_succeeded)
                               (TpChannelRequest *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Succeeded.

Parameters

proxy

The proxy on which tp_cli_channel_request_connect_to_succeeded() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_request_connect_to_succeeded ()

TpProxySignalConnection *
tp_cli_channel_request_connect_to_succeeded
                               (TpChannelRequest *proxy,
                                tp_cli_channel_request_signal_callback_succeeded callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Succeeded.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel request has succeeded. It is no longer present, and further methods must not be called on it.</p>

Parameters

proxy

A TpChannelRequest or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_request_signal_callback_succeeded_with_channel ()

void
(*tp_cli_channel_request_signal_callback_succeeded_with_channel)
                               (TpChannelRequest *proxy,
                                const gchar *arg_Connection,
                                GHashTable *arg_Connection_Properties,
                                const gchar *arg_Channel,
                                GHashTable *arg_Channel_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SucceededWithChannel.

Parameters

proxy

The proxy on which tp_cli_channel_request_connect_to_succeeded_with_channel() was called

 

arg_Connection

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The Connection owning the channel.</p>

 

arg_Connection_Properties

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A subset of the Connection's properties, currently unused. This parameter may be used in future.</p>

 

arg_Channel

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel which has been created.</p>

 

arg_Channel_Properties

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The same immutable properties of the Channel that would appear in a <tp:dbus-ref namespace="ofdT.Connection.Interface.Requests">NewChannels</tp:dbus-ref> signal.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_request_connect_to_succeeded_with_channel ()

TpProxySignalConnection *
tp_cli_channel_request_connect_to_succeeded_with_channel
                               (TpChannelRequest *proxy,
                                tp_cli_channel_request_signal_callback_succeeded_with_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SucceededWithChannel.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Variant of the <tp:dbus-ref namespace="ofdT.ChannelRequest">Succeeded</tp:dbus-ref> signal allowing to get the channel which has been created.</p> <p>This signal MUST be emitted if the <tp:dbus-ref namespace="ofdT">ChannelDispatcher</tp:dbus-ref>'s <tp:dbus-ref namespace="ofdT.ChannelDispatcher">SupportsRequestHints</tp:dbus-ref> property is true. If supported, it MUST be emitted before the <tp:member-ref>Succeeded</tp:member-ref> signal.</p>

Parameters

proxy

A TpChannelRequest or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

Types and Values

struct TpChannelRequest

struct TpChannelRequest;

Requesting a channel from the channel dispatcher can take some time, so an object is created in the channel dispatcher to represent each request. This proxy represents one of those objects.

Any client can call tp_cli_channel_request_call_cancel() at any time to attempt to cancel the request.

On success, the “succeeded” signal will be emitted. Immediately after that, the “invalidated” signal will be emitted, with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_OBJECT_REMOVED (this is not an error condition, it merely indicates that the channel request no longer exists).

On failure, the “invalidated” signal will be emitted with some other suitable error, usually from the TP_ERROR domain.

If the channel dispatcher crashes or exits, the “invalidated” signal will be emitted with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_NAME_OWNER_LOST.

Creating a TpChannelRequest directly is deprecated: it should only be created via a TpAccountChannelRequest or a TpBaseClient.

Since 0.16, TpChannelRequest always has a non-NULL “factory”, and its “factory” will be propagated to the TpAccount, TpConnection and TpChannel.

Since: 0.7.32


struct TpChannelRequestClass

struct TpChannelRequestClass {
};

The class of a TpChannelRequest.

Property Details

The “account” property

  “account”                  TpAccount *

The TpAccount on which this request was made, not guaranteed to be prepared.

Read-only.

Owner: TpChannelRequest

Flags: Read

Since: 0.15.3


The “channel-factory” property

  “channel-factory”          GObject *

The object implementing the TpClientChannelFactoryInterface interface that will be used to create channel proxies when the “succeeded-with-channel” signal is fired. This property can be changed using tp_channel_request_set_channel_factory().

If no channel factory is specified then TpAutomaticProxyFactory is used.

TpChannelRequest:channel-factory is deprecated and should not be used in newly-written code.

since 0.15.5. Use “factory” instead.

Owner: TpChannelRequest

Flags: Read / Write / Construct

Since: 0.13.14


The “hints” property

  “hints”                    GHashTable_gchararray+GValue_*

A TP_HASH_TYPE_STRING_VARIANT_MAP of metadata provided by the channel requester; or NULL if “immutable-properties” is not defined or if no hints has been defined.

Read-only.

Owner: TpChannelRequest

Flags: Read

Since: 0.13.14


The “hints-vardict” property

  “hints-vardict”            GVariant *

A G_VARIANT_TYPE_VARDICT of metadata provided by the channel requester; or NULL if “immutable-properties” is not defined or if no hints have been defined.

Read-only.

Owner: TpChannelRequest

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “immutable-properties” property

  “immutable-properties”     GHashTable_gchararray+GValue_*

The immutable D-Bus properties of this channel request, represented by a GHashTable where the keys are D-Bus interface name + "." + property name, and the values are GValue instances.

Note that this property is set only if the immutable properties have been set during the construction of the TpChannelRequest.

Read-only except during construction.

Owner: TpChannelRequest

Flags: Read / Write / Construct Only

Since: 0.13.14


The “immutable-properties-vardict” property

  “immutable-properties-vardict” GVariant *

The immutable D-Bus properties of this channel request, represented by a G_VARIANT_TYPE_VARDICT where the keys are D-Bus interface name + "." + property name.

Note that this property is set only if the immutable properties have been set during the construction of the TpChannelRequest.

Read-only except during construction.

Owner: TpChannelRequest

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “preferred-handler” property

  “preferred-handler”        gchar *

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for this channel request, or NULL to indicate that any handler would be acceptable.

Read-only.

Owner: TpChannelRequest

Flags: Read

Default value: NULL

Since: 0.15.3


The “user-action-time” property

  “user-action-time”         gint64

The time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this channel request is for some reason not involving user action.

Read-only.

Owner: TpChannelRequest

Flags: Read

Allowed values: >= 0

Default value: 0

Since: 0.15.3

Signal Details

The “succeeded” signal

void
user_function (TpChannelRequest *self,
               gpointer          user_data)

Emitted when the channel request succeeds.

TpChannelRequest::succeeded is deprecated and should not be used in newly-written code.

since 0.13.14. Use “succeeded-with-channel”, which provides the resulting channel, instead.

Parameters

self

the channel request proxy

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “succeeded-with-channel” signal

void
user_function (TpChannelRequest *self,
               TpConnection     *connection,
               TpChannel        *channel,
               gpointer          user_data)

Emitted when the channel request succeeds.

With telepathy-mission-control version 5.7.1 and earlier, connection and channel will be NULL. When using newer versions, they will be correctly set to the newly-created channel, and the connection which owns it.

The TpChannel is created using “channel-factory” or “factory” but the features of the factory are NOT prepared. It's up to the user to prepare the features returned by tp_simple_client_factory_dup_channel_features() himself.

Parameters

self

the channel request proxy

 

connection

the TpConnection of channel , or NULL

 

channel

the TpChannel created, or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.13.14

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-stream-tube-channel.html0000644000175000017500000010677214006623344024737 00000000000000 TpStreamTubeChannel: telepathy-glib API Reference Manual

TpStreamTubeChannel

TpStreamTubeChannel — proxy object for a stream tube channel

Properties

GHashTable_gchararray+GValue_* parameters Read
GVariant * parameters-vardict Read
gchar * service Read

Signals

void incoming Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannel
            ╰── TpStreamTubeChannel

Implemented Interfaces

TpStreamTubeChannel implements TpChannelIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpStreamTubeChannel is a sub-class of TpChannel providing convenient API to offer and accept a stream tube.

Functions

tp_stream_tube_channel_accept_async ()

void
tp_stream_tube_channel_accept_async (TpStreamTubeChannel *self,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Accept an incoming stream tube. When the tube has been accepted, callback will be called. You can then call tp_stream_tube_channel_accept_finish() to get a TpStreamTubeConnection connected to the tube.

Parameters

self

an incoming TpStreamTubeChannel

 

callback

a callback to call when the tube has been accepted

 

user_data

data to pass to callback

 

Since: 0.13.2


tp_stream_tube_channel_accept_finish ()

TpStreamTubeConnection *
tp_stream_tube_channel_accept_finish (TpStreamTubeChannel *self,
                                      GAsyncResult *result,
                                      GError **error);

Finishes accepting an incoming stream tube. The returned TpStreamTubeConnection can then be used to exchange data through the tube.

Parameters

self

a TpStreamTubeChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a newly created TpStreamTubeConnection.

[transfer full]

Since: 0.13.2


tp_stream_tube_channel_get_parameters ()

GHashTable *
tp_stream_tube_channel_get_parameters (TpStreamTubeChannel *self);

Return the “parameters” property

[skip]

Parameters

Returns

the value of “parameters”.

[transfer none][element-type utf8 GObject.Value]

Since: 0.13.2


tp_stream_tube_channel_dup_parameters_vardict ()

GVariant *
tp_stream_tube_channel_dup_parameters_vardict
                               (TpStreamTubeChannel *self);

Return the parameters of the dbus-tube channel in a variant of type G_VARIANT_TYPE_VARDICT whose keys are strings representing parameter names and values are variants representing corresponding parameter values set by the offerer when offering this channel.

The GVariant returned is NULL if this is an outgoing tube that has not yet been offered or the parameters property has not been set.

Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() and similar functions for convenient access to the values.

Parameters

Returns

a new reference to a GVariant.

[transfer full]

Since: 0.19.10


tp_stream_tube_channel_get_service ()

const gchar *
tp_stream_tube_channel_get_service (TpStreamTubeChannel *self);

Return the “service” property

Parameters

Returns

the value of “service”.

[transfer none]

Since: 0.13.2


tp_stream_tube_channel_new ()

TpStreamTubeChannel *
tp_stream_tube_channel_new (TpConnection *conn,
                            const gchar *object_path,
                            const GHashTable *immutable_properties,
                            GError **error);

tp_stream_tube_channel_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_channel() instead.

Creates a new TpStreamTubeChannel proxy object from the provided path and properties. Most developers will not need to use this function; use TpAutomaticProxyFactory to automatically create TpStreamTubeChannel proxy objects.

Parameters

conn

a TpConnection; may not be NULL

 

object_path

the object path of the channel; may not be NULL

 

immutable_properties

the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to GValue instances.

[transfer none][element-type utf8 GObject.Value]

error

used to indicate the error if NULL is returned

 

Returns

a newly-created TpStreamTubeChannel proxy.

[transfer full]

Since: 0.13.2


tp_stream_tube_channel_offer_async ()

void
tp_stream_tube_channel_offer_async (TpStreamTubeChannel *self,
                                    GHashTable *params,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Offer an outgoing stream tube. When the tube has been offered, callback will be called. You can then call tp_stream_tube_channel_offer_finish() to get the result of the operation.

You have to connect to the “incoming” signal to get a TpStreamTubeConnection each time a contact establishes a connection to the tube.

Parameters

self

an outgoing TpStreamTubeChannel

 

params

parameters of the tube, or NULL.

[allow-none][transfer none]

callback

a callback to call when the tube has been offered

 

user_data

data to pass to callback

 

Since: 0.13.2


tp_stream_tube_channel_offer_finish ()

gboolean
tp_stream_tube_channel_offer_finish (TpStreamTubeChannel *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes offering an outgoing stream tube.

Parameters

self

a TpStreamTubeChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE when a Tube has been successfully offered; FALSE otherwise

Since: 0.13.2

Types and Values

struct TpStreamTubeChannel

struct TpStreamTubeChannel;

Data structure representing a TpStreamTubeChannel.

Since: 0.13.2


struct TpStreamTubeChannelClass

struct TpStreamTubeChannelClass {
};

The class of a TpStreamTubeChannel.

Since: 0.13.2

Property Details

The “parameters” property

  “parameters”               GHashTable_gchararray+GValue_*

A string to GValue GHashTable representing the parameters of the tube.

Will be NULL for outgoing tubes until the tube has been offered.

In high-level language bindings, use “parameters-vardict” or tp_stream_tube_channel_dup_parameters_vardict() to get the same information in a more convenient format.

Owner: TpStreamTubeChannel

Flags: Read

Since: 0.13.2


The “parameters-vardict” property

  “parameters-vardict”       GVariant *

A G_VARIANT_TYPE_VARDICT representing the parameters of the tube.

Will be NULL for outgoing tubes until the tube has been offered.

Owner: TpStreamTubeChannel

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “service” property

  “service”                  gchar *

A string representing the service name that will be used over the tube.

Owner: TpStreamTubeChannel

Flags: Read

Default value: NULL

Since: 0.13.2

Signal Details

The “incoming” signal

void
user_function (TpStreamTubeChannel    *self,
               TpStreamTubeConnection *tube_connection,
               gpointer                user_data)

The ::incoming signal is emitted on offered Tubes when a new incoming connection is made from a remote user (one accepting the Tube).

Consumers of this signal must take their own references to tube_connection

Parameters

self

the TpStreamTubeChannel

 

tube_connection

the TpStreamTubeConnection for the connection

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

telepathy-glib-0.24.2/docs/reference/html/index.html0000644000175000017500000011132014006623343017260 00000000000000 telepathy-glib API Reference Manual: telepathy-glib API Reference Manual

This manual documents telepathy-glib version 0.24.2 . The latest development version of this documentation can be found here: online copy of the telepathy-glib API Reference Manual. The latest version in this stable branch can be found here: online copy of the telepathy-glib 0.24.x API Reference Manual.


General D-Bus support
TpProxy — base class for Telepathy client proxy objects
TpProxy D-Bus core methods — The D-Bus Introspectable, Peer and Properties interfaces
TpProxy Telepathy Properties — The Telepathy Properties interface
D-Bus utilities — some D-Bus utility functions
Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in dbus-glib by a GHashTable from string to GValue
GVariant utilities — some GVariant utility functions
Manipulating a{sv} mappings — Functions to manipulate mappings from string to variant, as represented in GVariant by a G_VARIANT_TYPE_VARDICT
TpProxy subclasses and mixins — Providing extra functionality for a TpProxy or subclass, or subclassing it
The Telepathy protocol
Miscellaneous definitions — Definitions useful for working with the Telepathy protocol
TpHandle — type representing handles
Telepathy protocol interface and property names — D-Bus interface and property names from the Telepathy spec
Telepathy protocol enumerations — Enumerated types and bitfields from the Telepathy spec
Telepathy protocol errors — The errors from the Telepathy D-Bus spec, as a GLib error domain
GType factory functions — Macros using caching factory functions to get dbus-glib specialized GTypes
TpChannelIface — interface representing basic channel properties
Client-side proxies
TpConnectionManager — proxy object for a Telepathy connection manager
TpProtocol — proxy for a Telepathy Protocol object
TpConnection — proxy object for a Telepathy connection
TpContact — object representing a contact
TpCapabilities — object representing capabilities
Connection Aliasing interface — client-side wrappers for the Aliasing interface
Connection Avatars interface — client-side wrappers for the Avatars interface
Connection Balance interface — client-side wrappers for the Balance interface
Connection ClientTypes interface — client-side wrappers for the ClientTypes interface
Connection Contacts interface — client-side wrappers for the Contacts interface
Connection ContactInfo interface — client-side wrappers for the ContactInfo interface
Connection ContactList, ContactGroups and ContactBlocking interfaces — client-side wrappers for the ContactList, ContactGroups and ContactBlocking interfaces
Connection ContactCapabilities and Capabilities interfaces — client-side wrappers for the capabilities interfaces
Connection Location interface — client-side wrappers for the Location interface
Connection Requests interface — client-side wrappers for the Requests interface
Connection SimplePresence interface — client-side wrappers for the SimplePresence interface
Connection Presence interface — client-side wrappers for the Presence interface
Connection Cellular interface — client-side wrappers for the Cellular interface
Connection MailNotification interface — client-side wrappers for the MailNotification interface
Connection PowerSaving interface — client-side wrappers for the PowerSaving interface
Connection Addressing interface — client-side wrappers for the Addressing interface
Connection Renaming interface — client-side wrappers for the Renaming interface
Connection Sidecars interface — client-side wrappers for the Sidecars interface
TpContactSearch — object for a Telepathy contact search channel
TpContactSearchResult — a result of a contact search
TpChannel — proxy object for a Telepathy channel
Group and Conference interfaces on Channels — client-side wrappers for Group and Conference
Room-related interfaces on Channels — client-side wrappers for Room, RoomConfig and Subject
Text channels — client-side wrappers for the Text channel type, and the Chat State and Password interfaces
Media channels — client-side wrappers for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces
File transfer — client-side wrappers for the File Transfer channel type
Tubes channels — client-side wrappers for the Tubes channel type
Tube channels — client-side wrappers for the Tube channel interface, StreamTube channel type and DBusTube channel type.
Room List channels — client-side wrappers for the Room List channel type
Contact Search channels — client-side wrappers for the Contact Search channel type
Channel Authentication interfaces — client-side wrappers for authentication channels
Channel Call interfaces — client-side wrappers for call channels
Channel Call content interfaces — client-side wrappers for call contents
Channel Call stream interfaces — client-side wrappers for call streams
Channel Call misc interfaces — client-side wrappers for misc call interfaces
Connection and Channel Anonymity interfaces — client-side wrappers for the Anonymity interfaces
Connection and Channel ServicePoint interfaces — client-side wrappers for the ServicePoint interfaces
TpMediaSessionHandler, TpMediaStreamHandler — proxy objects for Telepathy media streaming
TpAccountManager — proxy object for the Telepathy account manager
TpAccount — proxy object for an account in the Telepathy account manager
TpAccountRequest — object for a currently non-existent account in order to create easily without speaking fluent D-Bus
TpChannelDispatcher — proxy object for the Telepathy channel dispatcher
TpChannelDispatchOperation — proxy object for a to the Telepathy channel dispatcher
TpChannelRequest — proxy object for a request to the Telepathy channel dispatcher
TpClient — proxy object for a client of the ChannelDispatcher
TpAccountChannelRequest — Object used to request a channel from a TpAccount
TpStreamTubeChannel — proxy object for a stream tube channel
TpStreamTubeConnection — a connection on a Stream Tube
TpDBusTubeChannel — proxy object for D-Bus tube channels
TpClientChannelFactoryInterface — an interface for client channel factories
TpBasicProxyFactory — channel factory creating TpChannel objects
TpAutomaticProxyFactory — factory creating higher level proxy objects
TpSimpleClientFactory — a factory for TpContacts and plain subclasses of TpProxy
TpAutomaticClientFactory — Factory for specialized TpChannel subclasses.
TpClientMessage — a message in the Telepathy message interface, client side
TpSignalledMessage — a message received using the Telepathy message interface
TpTextChannel — proxy object for a text channel
TpFileTransferChannel — proxy object for a file transfer channel
TpCallChannel — proxy object for a call channel
TpCallContent — proxy object for a call content
TpCallStream — proxy object for a call stream
Misc Call APIs — Misc generated APISs for Call
TpDebugClient — proxy objects for Telepathy debug information
TpDebugMessage — a debug message
TpRoomList — proxy object for a room list channel
TpRoomInfo — a room found by TpRoomList
TpTLSCertificate — proxy object for a server or peer's TLS certificate
TpTLSCertificateRejection — a certificate rejection
Service-side D-Bus interfaces
The TpSvc* interfaces — How to export Telepathy objects
Generic service-side interfaces — GInterfaces for D-Bus objects exporting Telepathy properties and common D-Bus core interfaces
Service-side Channel base interface — GInterface for Telepathy Channel objects
Service-side Channel Group and Conference interfaces — Groups of contacts
Service-side room interfaces — room-related functionality for channels
Contact List channels — service-side interface for the Contact List channel type
Contact Search channels — service-side interface for the Contact Search channel type
Text channels — service-side interfaces for the Text channel type, and the Chat State, Password and SMS interfaces
Media channels — service-side interfaces for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces
File Transfer channels — service-side interface for the File Transfer channel type
File transfer Metadata interface — GInterface to implement metadata file transfer interface
Tubes channels — service-side interface for the Tubes channel type
Tube channels — service-side interface for the Tube channel interface, StreamTube channel type and DBusTube channel type.
Room List channels — service-side interface for the Room List channel type
Service-side Channel Authentication interfaces — GInterfaces to implement authentication channels
Service-side Securable interface — GInterface to indicate channels' security level
Service-side Channel Call interface — GInterface to implement call channels
Service-side Debug base interface — GInterface for Telepathy Debug objects
Service-side Connection interfaces — GInterfaces for Telepathy Connection objects
Service-side Connection and Channel Anonymity interfaces — GInterfaces to implement the Anonymity interfaces
Service-side Connection and Channel ServicePoint interfaces — GInterfaces to implement the ServicePoint interfaces
Service-side media streaming helper interfaces — media session and media stream
Service-side Connection Manager interface — GInterface for Telepathy ConnectionManager objects
Service-side Protocol interface — GInterface for Telepathy Protocol objects
Service-side Account Manager interface — GInterface for Telepathy AccountManager objects
Service-side Account interfaces — GInterfaces for Telepathy Account objects
Service-side Channel Dispatcher interface — GInterfaces for Telepathy ChannelDispatcher object
Service-side Channel Dispatch Operation interface — GInterface for Telepathy ChannelDispatchOperation object
Service-side Channel Request interface — GInterface for Telepathy ChannelRequest object
Service-side Client interfaces — interfaces used to be an Observer, Approver and Handler
Service-side TLS interfaces — GInterfaces to implement Chan.T.ServerTLSConnection
Service-side implementation
Connection manager life cycle — entry point for telepathy-glib connection managers
TpBaseConnectionManager — base class for TpSvcConnectionManager implementations
TpBaseProtocol — base class for TpSvcProtocol implementations
TpBaseConnection — base class for TpSvcConnection implementations
TpChannelManager — interface for creating and tracking channels
TpBaseContactList — channel manager for ContactList channels
TpContactsMixin — a mixin implementation of the contacts connection interface
TpDBusPropertiesMixin — a mixin implementation of the DBus.Properties interface
TpExportableChannel — interface representing channels with several standard properties
TpBaseChannel — base class for TpExportableChannel implementations
TpPresenceMixin — a mixin implementation of the Presence connection interface
TpPropertiesMixin — a mixin implementation of the Telepathy.Properties interface
TpBaseRoomConfig — implements the RoomConfig interface for chat rooms.
TpGroupMixin — a mixin implementation of the groups interface
TpMessageMixin — a mixin implementation of the text channel type and the Messages interface
TpMessage — a message in the Telepathy message interface
TpCMMessage — a message in the Telepathy message interface, CM side
TpBasePasswordChannel — a simple X-TELEPATHY-PASSWORD channel
TpSimplePasswordManager — a simple X-TELEPATHY-PASSWORD channel manager
TpBaseClient — base class for Telepathy clients on D-Bus
TpObserveChannelsContext — context of a Observer.ObserveChannels() call
TpAddDispatchOperationContext — context of a Approver.AddDispatchOperation() call
TpHandleChannelsContext — context of a Handler.HandleChannels() call
TpSimpleObserver — a subclass of TpBaseClient implementing a simple Observer
TpSimpleApprover — a subclass of TpBaseClient implementing a simple Approver
TpSimpleHandler — a subclass of TpBaseClient implementing a simple Handler
DTMF dialstring interpreter — Converts a dialstring into a timed sequence of events
TpBaseCallChannel — base class for TpSvcChannelTypeCall implementations
TpBaseMediaCallChannel — base class for TpSvcChannelTypeCall RTP media implementations
TpBaseCallContent — base class for TpSvcCallContent implementations
TpBaseMediaCallContent — base class for TpSvcCallContentInterfaceMedia implementations
TpCallContentMediaDescription — implementation of TpSvcCallContentMediaDescription
TpBaseCallStream — base class for TpSvcCallStream implementations
TpBaseMediaCallStream — base class for TpSvcCallStreamInterfaceMedia implementations
TpCallStreamEndpoint — class for TpSvcCallStreamEndpoint implementations
Service-side handle repositories
TpHandleRepoIface — abstract interface for handle allocation
TpStaticHandleRepo — handle repository implementation with a fixed, static set of handle names
TpDynamicHandleRepo — general handle repository implementation, with dynamic handle allocation and recycling
Utilities
Version information — Checking the telepathy-glib version
Utilities — Non-Telepathy utility functions
GNIO Utilities — Telepathy/GNIO utility functions
Common debug support — API to activate debugging messages from telepathy-glib
TpDebugSender — object for exposing Telepathy debug interface
TpIntset — a set of unsigned integers
TpHeap — a heap queue of pointers
Obsolete modules
TpChannelFactoryIface — interface for channel allocation/tracking
ANSI codes for debug messages — used to colorize log messages for "clarity"
TpTextMixin — a mixin implementation of the text channel type
Annotation Glossary
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-group.html0000644000175000017500000036526514006623344024440 00000000000000 Service-side Channel Group and Conference interfaces: telepathy-glib API Reference Manual

Service-side Channel Group and Conference interfaces

Service-side Channel Group and Conference interfaces — Groups of contacts

Functions

void (*tp_svc_channel_interface_group_add_members_impl) ()
void tp_svc_channel_interface_group_implement_add_members ()
void tp_svc_channel_interface_group_return_from_add_members ()
void (*tp_svc_channel_interface_group_get_all_members_impl) ()
void tp_svc_channel_interface_group_implement_get_all_members ()
void tp_svc_channel_interface_group_return_from_get_all_members ()
void (*tp_svc_channel_interface_group_get_group_flags_impl) ()
void tp_svc_channel_interface_group_implement_get_group_flags ()
void tp_svc_channel_interface_group_return_from_get_group_flags ()
void (*tp_svc_channel_interface_group_get_handle_owners_impl) ()
void tp_svc_channel_interface_group_implement_get_handle_owners ()
void tp_svc_channel_interface_group_return_from_get_handle_owners ()
void (*tp_svc_channel_interface_group_get_local_pending_members_impl) ()
void tp_svc_channel_interface_group_implement_get_local_pending_members ()
void tp_svc_channel_interface_group_return_from_get_local_pending_members ()
void (*tp_svc_channel_interface_group_get_local_pending_members_with_info_impl) ()
void tp_svc_channel_interface_group_implement_get_local_pending_members_with_info ()
void tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info ()
void (*tp_svc_channel_interface_group_get_members_impl) ()
void tp_svc_channel_interface_group_implement_get_members ()
void tp_svc_channel_interface_group_return_from_get_members ()
void (*tp_svc_channel_interface_group_get_remote_pending_members_impl) ()
void tp_svc_channel_interface_group_implement_get_remote_pending_members ()
void tp_svc_channel_interface_group_return_from_get_remote_pending_members ()
void (*tp_svc_channel_interface_group_get_self_handle_impl) ()
void tp_svc_channel_interface_group_implement_get_self_handle ()
void tp_svc_channel_interface_group_return_from_get_self_handle ()
void (*tp_svc_channel_interface_group_remove_members_impl) ()
void tp_svc_channel_interface_group_implement_remove_members ()
void tp_svc_channel_interface_group_return_from_remove_members ()
void tp_svc_channel_interface_group_emit_group_flags_changed ()
void tp_svc_channel_interface_group_emit_members_changed ()
void tp_svc_channel_interface_group_emit_members_changed_detailed ()
void tp_svc_channel_interface_group_implement_remove_members_with_reason ()
void (*tp_svc_channel_interface_group_remove_members_with_reason_impl) ()
void tp_svc_channel_interface_group_return_from_remove_members_with_reason ()
void tp_svc_channel_interface_group_emit_handle_owners_changed ()
void tp_svc_channel_interface_group_emit_self_handle_changed ()
void tp_svc_channel_interface_conference_emit_channel_merged ()
void tp_svc_channel_interface_conference_emit_channel_removed ()

Signals

void group-flags-changed Has Details
void handle-owners-changed Has Details
void handle-owners-changed-detailed Has Details
void members-changed Has Details
void members-changed-detailed Has Details
void self-contact-changed Has Details
void self-handle-changed Has Details
void channel-merged Has Details
void channel-removed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceConference
    ╰── TpSvcChannelInterfaceGroup

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Many Telepathy Channel objects can be seen as representing groups or sets of contacts. The Telepathy specification represents this by a common interface, Group. This section documents the auto-generated GInterface used to implement the Group interface.

Contacts can be in four states:

  • in the group (the "members" set)

  • "local pending" (waiting to be added to the group by the local client calling AddMembers())

  • "remote pending" (waiting to be added to the group by some other action, probably by someone else)

  • no relationship with the group at all

For instance, chatrooms implement the Group interface. Contacts in the chatroom are members, and contacts who we've invited to the group, or contacts who've requested permission to join, are remote pending. If the local user has been invited by another contact, they will appear in the local-pending set until they accept or decline the invitation.

Since 0.11.16, telepathy-glib also includes basic support for the Conference interface, which represents a Group channel that can be initiated by merging or upgrading individual 1-1 channels.

Functions

tp_svc_channel_interface_group_add_members_impl ()

void
(*tp_svc_channel_interface_group_add_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_add_members ()

void
tp_svc_channel_interface_group_implement_add_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_add_members_impl impl);

Register an implementation for the AddMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_add_members ()

void
tp_svc_channel_interface_group_return_from_add_members
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_group_get_all_members_impl ()

void
(*tp_svc_channel_interface_group_get_all_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAllMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_all_members ()

void
tp_svc_channel_interface_group_implement_get_all_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_all_members_impl impl);

Register an implementation for the GetAllMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAllMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_get_all_members ()

void
tp_svc_channel_interface_group_return_from_get_all_members
                               (DBusGMethodInvocation *context,
                                const GArray *out_Members,
                                const GArray *out_Local_Pending,
                                const GArray *out_Remote_Pending);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Members

const GArray * (FIXME, generate documentation)

 

out_Local_Pending

const GArray * (FIXME, generate documentation)

 

out_Remote_Pending

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_group_flags_impl ()

void
(*tp_svc_channel_interface_group_get_group_flags_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetGroupFlags on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_group_flags ()

void
tp_svc_channel_interface_group_implement_get_group_flags
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_group_flags_impl impl);

Register an implementation for the GetGroupFlags method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetGroupFlags D-Bus method

 

tp_svc_channel_interface_group_return_from_get_group_flags ()

void
tp_svc_channel_interface_group_return_from_get_group_flags
                               (DBusGMethodInvocation *context,
                                guint out_Group_Flags);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Group_Flags

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_handle_owners_impl ()

void
(*tp_svc_channel_interface_group_get_handle_owners_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetHandleOwners on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_handle_owners ()

void
tp_svc_channel_interface_group_implement_get_handle_owners
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_handle_owners_impl impl);

Register an implementation for the GetHandleOwners method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetHandleOwners D-Bus method

 

tp_svc_channel_interface_group_return_from_get_handle_owners ()

void
tp_svc_channel_interface_group_return_from_get_handle_owners
                               (DBusGMethodInvocation *context,
                                const GArray *out_Owners);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Owners

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_local_pending_members_impl ()

void
(*tp_svc_channel_interface_group_get_local_pending_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetLocalPendingMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_local_pending_members ()

void
tp_svc_channel_interface_group_implement_get_local_pending_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_local_pending_members_impl impl);

Register an implementation for the GetLocalPendingMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetLocalPendingMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_get_local_pending_members ()

void
tp_svc_channel_interface_group_return_from_get_local_pending_members
                               (DBusGMethodInvocation *context,
                                const GArray *out_Handles);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Handles

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_local_pending_members_with_info_impl ()

void
(*tp_svc_channel_interface_group_get_local_pending_members_with_info_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetLocalPendingMembersWithInfo on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_local_pending_members_with_info ()

void
tp_svc_channel_interface_group_implement_get_local_pending_members_with_info
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_local_pending_members_with_info_impl impl);

Register an implementation for the GetLocalPendingMembersWithInfo method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetLocalPendingMembersWithInfo D-Bus method

 

tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info ()

void
tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Info);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Info

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_members_impl ()

void
(*tp_svc_channel_interface_group_get_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_members ()

void
tp_svc_channel_interface_group_implement_get_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_members_impl impl);

Register an implementation for the GetMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_get_members ()

void
tp_svc_channel_interface_group_return_from_get_members
                               (DBusGMethodInvocation *context,
                                const GArray *out_Handles);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Handles

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_remote_pending_members_impl ()

void
(*tp_svc_channel_interface_group_get_remote_pending_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetRemotePendingMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_remote_pending_members ()

void
tp_svc_channel_interface_group_implement_get_remote_pending_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_remote_pending_members_impl impl);

Register an implementation for the GetRemotePendingMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetRemotePendingMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_get_remote_pending_members ()

void
tp_svc_channel_interface_group_return_from_get_remote_pending_members
                               (DBusGMethodInvocation *context,
                                const GArray *out_Handles);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Handles

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_get_self_handle_impl ()

void
(*tp_svc_channel_interface_group_get_self_handle_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetSelfHandle on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_get_self_handle ()

void
tp_svc_channel_interface_group_implement_get_self_handle
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_get_self_handle_impl impl);

Register an implementation for the GetSelfHandle method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetSelfHandle D-Bus method

 

tp_svc_channel_interface_group_return_from_get_self_handle ()

void
tp_svc_channel_interface_group_return_from_get_self_handle
                               (DBusGMethodInvocation *context,
                                guint out_Self_Handle);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Self_Handle

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_group_remove_members_impl ()

void
(*tp_svc_channel_interface_group_remove_members_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveMembers on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_implement_remove_members ()

void
tp_svc_channel_interface_group_implement_remove_members
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_remove_members_impl impl);

Register an implementation for the RemoveMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveMembers D-Bus method

 

tp_svc_channel_interface_group_return_from_remove_members ()

void
tp_svc_channel_interface_group_return_from_remove_members
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_group_emit_group_flags_changed ()

void
tp_svc_channel_interface_group_emit_group_flags_changed
                               (gpointer instance,
                                guint arg_Added,
                                guint arg_Removed);

Type-safe wrapper around g_signal_emit to emit the GroupFlagsChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Added

guint (FIXME, generate documentation)

 

arg_Removed

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_group_emit_members_changed ()

void
tp_svc_channel_interface_group_emit_members_changed
                               (gpointer instance,
                                const gchar *arg_Message,
                                const GArray *arg_Added,
                                const GArray *arg_Removed,
                                const GArray *arg_Local_Pending,
                                const GArray *arg_Remote_Pending,
                                guint arg_Actor,
                                guint arg_Reason);

Type-safe wrapper around g_signal_emit to emit the MembersChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Message

const gchar * (FIXME, generate documentation)

 

arg_Added

const GArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Local_Pending

const GArray * (FIXME, generate documentation)

 

arg_Remote_Pending

const GArray * (FIXME, generate documentation)

 

arg_Actor

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_group_emit_members_changed_detailed ()

void
tp_svc_channel_interface_group_emit_members_changed_detailed
                               (gpointer instance,
                                const GArray *arg_Added,
                                const GArray *arg_Removed,
                                const GArray *arg_Local_Pending,
                                const GArray *arg_Remote_Pending,
                                GHashTable *arg_Details);

Type-safe wrapper around g_signal_emit to emit the MembersChangedDetailed signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Added

const GArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Local_Pending

const GArray * (FIXME, generate documentation)

 

arg_Remote_Pending

const GArray * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_implement_remove_members_with_reason ()

void
tp_svc_channel_interface_group_implement_remove_members_with_reason
                               (TpSvcChannelInterfaceGroupClass *klass,
                                tp_svc_channel_interface_group_remove_members_with_reason_impl impl);

Register an implementation for the RemoveMembersWithReason method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveMembersWithReason D-Bus method

 

tp_svc_channel_interface_group_remove_members_with_reason_impl ()

void
(*tp_svc_channel_interface_group_remove_members_with_reason_impl)
                               (TpSvcChannelInterfaceGroup *self,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                guint in_Reason,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveMembersWithReason on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

in_Reason

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_group_return_from_remove_members_with_reason ()

void
tp_svc_channel_interface_group_return_from_remove_members_with_reason
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_group_emit_handle_owners_changed ()

void
tp_svc_channel_interface_group_emit_handle_owners_changed
                               (gpointer instance,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed);

Type-safe wrapper around g_signal_emit to emit the HandleOwnersChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_emit_self_handle_changed ()

void
tp_svc_channel_interface_group_emit_self_handle_changed
                               (gpointer instance,
                                guint arg_Self_Handle);

Type-safe wrapper around g_signal_emit to emit the SelfHandleChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_conference_emit_channel_merged ()

void
tp_svc_channel_interface_conference_emit_channel_merged
                               (gpointer instance,
                                const gchar *arg_Channel,
                                guint arg_Channel_Specific_Handle,
                                GHashTable *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the ChannelMerged signal on interface org.freedesktop.Telepathy.Channel.Interface.Conference.

Parameters

instance

The object implementing this interface

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Channel_Specific_Handle

guint (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_conference_emit_channel_removed ()

void
tp_svc_channel_interface_conference_emit_channel_removed
                               (gpointer instance,
                                const gchar *arg_Channel,
                                GHashTable *arg_Details);

Type-safe wrapper around g_signal_emit to emit the ChannelRemoved signal on interface org.freedesktop.Telepathy.Channel.Interface.Conference.

Parameters

instance

The object implementing this interface

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelInterfaceGroup

typedef struct _TpSvcChannelInterfaceGroup TpSvcChannelInterfaceGroup;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceGroupClass

typedef struct _TpSvcChannelInterfaceGroupClass TpSvcChannelInterfaceGroupClass;

The class of TpSvcChannelInterfaceGroup.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_group (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_group_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (add_members);
  IMPLEMENT (get_all_members);
  IMPLEMENT (get_group_flags);
  IMPLEMENT (get_handle_owners);
  IMPLEMENT (get_local_pending_members);
  IMPLEMENT (get_local_pending_members_with_info);
  IMPLEMENT (get_members);
  IMPLEMENT (get_remote_pending_members);
  IMPLEMENT (get_self_handle);
  IMPLEMENT (remove_members);
  IMPLEMENT (remove_members_with_reason);
#undef IMPLEMENT
}

TpSvcChannelInterfaceConference

typedef struct _TpSvcChannelInterfaceConference TpSvcChannelInterfaceConference;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceConferenceClass

typedef struct _TpSvcChannelInterfaceConferenceClass TpSvcChannelInterfaceConferenceClass;

The class of TpSvcChannelInterfaceConference. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

Signal Details

The “group-flags-changed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               guint                       arg_Added,
               guint                       arg_Removed,
               gpointer                    user_data)

The GroupFlagsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

guint (FIXME, generate documentation)

 

arg_Removed

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “handle-owners-changed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               GArray_guint_              *arg_Removed,
               gpointer                    user_data)

The HandleOwnersChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “handle-owners-changed-detailed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               GArray_guint_              *arg_Removed,
               gpointer                    user_data)

The HandleOwnersChangedDetailed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “members-changed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               gchar                      *arg_Message,
               GArray_guint_              *arg_Added,
               GArray_guint_              *arg_Removed,
               GArray_guint_              *arg_Local_Pending,
               GArray_guint_              *arg_Remote_Pending,
               guint                       arg_Actor,
               guint                       arg_Reason,
               gpointer                    user_data)

The MembersChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Message

const gchar * (FIXME, generate documentation)

 

arg_Added

const GArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Local_Pending

const GArray * (FIXME, generate documentation)

 

arg_Remote_Pending

const GArray * (FIXME, generate documentation)

 

arg_Actor

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “members-changed-detailed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               GArray_guint_              *arg_Added,
               GArray_guint_              *arg_Removed,
               GArray_guint_              *arg_Local_Pending,
               GArray_guint_              *arg_Remote_Pending,
               gpointer                    user_data)

The MembersChangedDetailed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

const GArray * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Local_Pending

const GArray * (FIXME, generate documentation)

 

arg_Remote_Pending

const GArray * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “self-contact-changed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               guint                       arg_Self_Handle,
               gchar                      *arg_Self_ID,
               gpointer                    user_data)

The SelfContactChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

arg_Self_ID

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “self-handle-changed” signal

void
user_function (TpSvcChannelInterfaceGroup *self,
               guint                       arg_Self_Handle,
               gpointer                    user_data)

The SelfHandleChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “channel-merged” signal

void
user_function (TpSvcChannelInterfaceConference *self,
               DBusGObjectPath                 *arg_Channel,
               guint                            arg_Channel_Specific_Handle,
               gpointer                         user_data)

The ChannelMerged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Channel_Specific_Handle

guint (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “channel-removed” signal

void
user_function (TpSvcChannelInterfaceConference *self,
               DBusGObjectPath                 *arg_Channel,
               gpointer                         user_data)

The ChannelRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpGroupMixin

telepathy-glib-0.24.2/docs/reference/html/TpBaseMediaCallChannel.html0000644000175000017500000003672414006623343022372 00000000000000 TpBaseMediaCallChannel: telepathy-glib API Reference Manual

TpBaseMediaCallChannel

TpBaseMediaCallChannel — base class for TpSvcChannelTypeCall RTP media implementations

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseChannel
        ╰── TpBaseCallChannel
            ╰── TpBaseMediaCallChannel

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This is a base class for connection managers that use standard RTP media.

Functions

TpBaseMediaCallChannelHoldStateChangedFunc ()

void
(*TpBaseMediaCallChannelHoldStateChangedFunc)
                               (TpBaseMediaCallChannel *self,
                                TpLocalHoldState hold_state,
                                TpLocalHoldStateReason hold_state_reason);

Signature of an implementation of TpBaseMediaCallChannelClass.hold_state_changed.

Parameters

self

a TpBaseMediaCallChannel

 

hold_state

the new TpLocalHoldState

 

hold_state_reason

the TpLocalHoldStateReason for this change

 

Since: 0.17.5


TpBaseMediaCallChannelVoidFunc ()

void
(*TpBaseMediaCallChannelVoidFunc) (TpBaseMediaCallChannel *self);

Signature of an implementation of TpBaseMediaCallChannelClass.accept.

Parameters

Since: 0.17.5


tp_base_media_call_channel_get_local_hold_state ()

TpLocalHoldState
tp_base_media_call_channel_get_local_hold_state
                               (TpBaseMediaCallChannel *channel,
                                TpLocalHoldStateReason *reason);

Parameters

channel

a TpBaseMediaCallChannel

 

reason

pointer to a location where to store the reason , or NULL

 

Returns

The current hold state

Since: 0.17.6

Types and Values

struct TpBaseMediaCallChannel

struct TpBaseMediaCallChannel;

A base class for call channel implementations with standard RTP

Since: 0.17.5


struct TpBaseMediaCallChannelClass

struct TpBaseMediaCallChannelClass {
  TpBaseMediaCallChannelHoldStateChangedFunc hold_state_changed;
  TpBaseMediaCallChannelVoidFunc accept;
};

The class structure for TpBaseMediaCallChannel

Members

TpBaseMediaCallChannelHoldStateChangedFunc hold_state_changed;

optional; virtual method called when the hold state changed

 

TpBaseMediaCallChannelVoidFunc accept;

optional; virtual method called when the call is locally accepted and contents are ready. This replaces TpBaseCallChannelClass.accept.

 

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/TpCMMessage.html0000644000175000017500000004537214006623343020276 00000000000000 TpCMMessage: telepathy-glib API Reference Manual

TpCMMessage

TpCMMessage — a message in the Telepathy message interface, CM side

Types and Values

Object Hierarchy

    GObject
    ╰── TpMessage
        ╰── TpCMMessage

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpCMMessage is used within connection managers to represent a message sent or received using the Messages interface.

Functions

tp_cm_message_new ()

TpMessage *
tp_cm_message_new (TpBaseConnection *connection,
                   guint initial_parts);

Parameters

connection

a connection on which to reference handles

 

initial_parts

number of parts to create (at least 1)

 

Returns

a newly allocated message suitable to be passed to tp_cm_message_mixin_take_received()

Since: 0.13.9


tp_cm_message_new_text ()

TpMessage *
tp_cm_message_new_text (TpBaseConnection *conn,
                        TpHandle sender,
                        TpChannelTextMessageType type,
                        const gchar *text);

A convenient function to create a new TpCMMessage having 'text/plain' as 'content-type', type as 'message-type', text as 'content' and sender as its sender.

Parameters

conn

a connection

 

sender

the TpHandle of the sender of the message

 

type

the type of message

 

text

content of the messsage

 

Returns

a newly allocated TpCMMessage.

[transfer full]

Since: 0.13.10


tp_cm_message_set_message ()

void
tp_cm_message_set_message (TpMessage *self,
                           guint part,
                           const gchar *key,
                           TpMessage *message);

Set key in part part of self to have message as an aa{sv} value (that is, an array of Message_Part).

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

message

another (distinct) message created for the same TpBaseConnection

 

Since: 0.15.5


tp_cm_message_take_message ()

void
tp_cm_message_take_message (TpMessage *self,
                            guint part,
                            const gchar *key,
                            TpMessage *message);

Set key in part part of self to have message as an aa{sv} value (that is, an array of Message_Part), and take ownership of message . The caller should not use message after passing it to this function. All handle references owned by message will subsequently belong to and be released with self .

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

message

another (distinct) message created for the same TpBaseConnection

 

Since: 0.13.9


tp_cm_message_get_sender ()

TpHandle
tp_cm_message_get_sender (TpMessage *self);

Return the sender of self , i.e. the "message-sender" key of the header, or 0 if there is no sender.

Parameters

self

a TpCMMessage

 

Returns

a TP_HANDLE_TYPE_CONTACT handle, or 0

Since: 0.13.9


tp_cm_message_set_sender ()

void
tp_cm_message_set_sender (TpMessage *self,
                          TpHandle handle);

Set the sender of self , i.e. the "message-sender" and "message-sender-id" keys in the header.

Parameters

self

a TpCMMessage

 

handle

the TpHandle of the sender of the message

 

Since: 0.13.9

Types and Values

TpCMMessage

typedef struct _TpCMMessage TpCMMessage;

Opaque structure representing a message in the Telepathy messages interface (an array of at least one mapping from string to variant, where the first mapping contains message headers and subsequent mappings contain the message body).

Since: 0.13.9

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-avatars.html0000644000175000017500000034602514006623344024674 00000000000000 Connection Avatars interface: telepathy-glib API Reference Manual

Connection Avatars interface

Connection Avatars interface — client-side wrappers for the Avatars interface

Functions

gboolean tp_cli_connection_interface_avatars_run_clear_avatar ()
gboolean tp_cli_connection_interface_avatars_run_get_avatar_requirements ()
gboolean tp_cli_connection_interface_avatars_run_get_avatar_tokens ()
gboolean tp_cli_connection_interface_avatars_run_get_known_avatar_tokens ()
gboolean tp_cli_connection_interface_avatars_run_request_avatar ()
gboolean tp_cli_connection_interface_avatars_run_request_avatars ()
gboolean tp_cli_connection_interface_avatars_run_set_avatar ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_clear_avatar ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_requirements ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_avatar_tokens ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatar ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_request_avatars ()
TpProxyPendingCall * tp_cli_connection_interface_avatars_call_set_avatar ()
void (*tp_cli_connection_interface_avatars_callback_for_clear_avatar) ()
void (*tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements) ()
void (*tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens) ()
void (*tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens) ()
void (*tp_cli_connection_interface_avatars_callback_for_request_avatar) ()
void (*tp_cli_connection_interface_avatars_callback_for_request_avatars) ()
void (*tp_cli_connection_interface_avatars_callback_for_set_avatar) ()
TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_retrieved ()
TpProxySignalConnection * tp_cli_connection_interface_avatars_connect_to_avatar_updated ()
void (*tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved) ()
void (*tp_cli_connection_interface_avatars_signal_callback_avatar_updated) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Most instant messaging protocols allow users to set an icon or avatar. This section documents the auto-generated C wrappers for the Avatar interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_avatars_run_clear_avatar ()

gboolean
tp_cli_connection_interface_avatars_run_clear_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_clear_avatar is deprecated and should not be used in newly-written code.

Call the method ClearAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Remove the avatar image for this connection.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_get_avatar_requirements ()

gboolean
tp_cli_connection_interface_avatars_run_get_avatar_requirements
                               (TpConnection *proxy,
                                gint timeout_ms,
                                gchar ***out_MIME_Types,
                                guint *out_Min_Width,
                                guint *out_Min_Height,
                                guint *out_Max_Width,
                                guint *out_Max_Height,
                                guint *out_Max_Bytes,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_get_avatar_requirements is deprecated and should not be used in newly-written code.

Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Call the method GetAvatarRequirements and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the required format of avatars on this connection.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_MIME_Types

Used to return an 'out' argument if TRUE is returned: An array of supported MIME types (eg image/jpeg)

 

out_Min_Width

Used to return an 'out' argument if TRUE is returned: The minimum image width in pixels

 

out_Min_Height

Used to return an 'out' argument if TRUE is returned: The minimum image height in pixels

 

out_Max_Width

Used to return an 'out' argument if TRUE is returned: The maximum image width in pixels, or 0 if there is no limit

 

out_Max_Height

Used to return an 'out' argument if TRUE is returned: The maximum image height in pixels, or 0 if there is no limit

 

out_Max_Bytes

Used to return an 'out' argument if TRUE is returned: The maximum image size in bytes, or 0 if there is no limit

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_get_avatar_tokens ()

gboolean
tp_cli_connection_interface_avatars_run_get_avatar_tokens
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                gchar ***out_Tokens,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_get_avatar_tokens is deprecated and should not be used in newly-written code.

Use GetKnownAvatarTokens instead.

Call the method GetAvatarTokens and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use <tp:member-ref>GetKnownAvatarTokens</tp:member-ref> instead.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

out_Tokens

Used to return an 'out' argument if TRUE is returned: An array of avatar tokens or empty strings (if no avatar is set) in the same order as the given array of contact handles

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_get_known_avatar_tokens ()

gboolean
tp_cli_connection_interface_avatars_run_get_known_avatar_tokens
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GHashTable **out_Tokens,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_get_known_avatar_tokens is deprecated and should not be used in newly-written code.

Call the method GetKnownAvatarTokens and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

out_Tokens

Used to return an 'out' argument if TRUE is returned: A dictionary of handles mapped to avatar tokens, containing only the known avatar tokens.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_request_avatar ()

gboolean
tp_cli_connection_interface_avatars_run_request_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                GArray **out_Data,
                                gchar **out_MIME_Type,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_request_avatar is deprecated and should not be used in newly-written code.

Use RequestAvatars instead.

Call the method RequestAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contact

Used to pass an 'in' argument: An integer handle for the contact to request the avatar for (TpContactHandle)

 

out_Data

Used to return an 'out' argument if TRUE is returned: An array of bytes containing the image data

 

out_MIME_Type

Used to return an 'out' argument if TRUE is returned: A string containing the image MIME type (eg image/jpeg), or empty if unknown

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_request_avatars ()

gboolean
tp_cli_connection_interface_avatars_run_request_avatars
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_request_avatars is deprecated and should not be used in newly-written code.

Call the method RequestAvatars and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request avatars for a number of contacts. The <tp:member-ref>AvatarRetrieved</tp:member-ref> signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: The contacts to retrieve avatars for

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_run_set_avatar ()

gboolean
tp_cli_connection_interface_avatars_run_set_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Avatar,
                                const gchar *in_MIME_Type,
                                gchar **out_Token,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_avatars_run_set_avatar is deprecated and should not be used in newly-written code.

Call the method SetAvatar and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Set a new avatar image for this connection. The avatar image must respect the requirements obtained by <tp:member-ref>GetAvatarRequirements</tp:member-ref>.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Avatar

Used to pass an 'in' argument: An array of bytes representing the avatar image data

 

in_MIME_Type

Used to pass an 'in' argument: A string representing the image MIME type

 

out_Token

Used to return an 'out' argument if TRUE is returned: The string token of the new avatar

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_avatars_call_clear_avatar ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_clear_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_avatars_callback_for_clear_avatar callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ClearAvatar method call.

Remove the avatar image for this connection.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_get_avatar_requirements ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_get_avatar_requirements
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_call_get_avatar_requirements is deprecated and should not be used in newly-written code.

Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Start a GetAvatarRequirements method call.

Get the required format of avatars on this connection.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_get_avatar_tokens ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_get_avatar_tokens
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_call_get_avatar_tokens is deprecated and should not be used in newly-written code.

Use GetKnownAvatarTokens instead.

Start a GetAvatarTokens method call.

Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use <tp:member-ref>GetKnownAvatarTokens</tp:member-ref> instead.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_get_known_avatar_tokens
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetKnownAvatarTokens method call.

Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_request_avatar ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_request_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                tp_cli_connection_interface_avatars_callback_for_request_avatar callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_call_request_avatar is deprecated and should not be used in newly-written code.

Use RequestAvatars instead.

Start a RequestAvatar method call.

Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: An integer handle for the contact to request the avatar for (TpContactHandle)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_request_avatars ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_request_avatars
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_avatars_callback_for_request_avatars callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestAvatars method call.

Request avatars for a number of contacts. The <tp:member-ref>AvatarRetrieved</tp:member-ref> signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: The contacts to retrieve avatars for

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_call_set_avatar ()

TpProxyPendingCall *
tp_cli_connection_interface_avatars_call_set_avatar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Avatar,
                                const gchar *in_MIME_Type,
                                tp_cli_connection_interface_avatars_callback_for_set_avatar callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetAvatar method call.

Set a new avatar image for this connection. The avatar image must respect the requirements obtained by <tp:member-ref>GetAvatarRequirements</tp:member-ref>.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Avatar

Used to pass an 'in' argument: An array of bytes representing the avatar image data

 

in_MIME_Type

Used to pass an 'in' argument: A string representing the image MIME type

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_avatars_callback_for_clear_avatar ()

void
(*tp_cli_connection_interface_avatars_callback_for_clear_avatar)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ClearAvatar method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements ()

void
(*tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements)
                               (TpConnection *proxy,
                                const gchar **out_MIME_Types,
                                guint out_Min_Width,
                                guint out_Min_Height,
                                guint out_Max_Width,
                                guint out_Max_Height,
                                guint out_Max_Bytes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements is deprecated and should not be used in newly-written code.

Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure.

Signature of the callback called when a GetAvatarRequirements method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_MIME_Types

Used to return an 'out' argument if error is NULL: An array of supported MIME types (eg image/jpeg)

 

out_Min_Width

Used to return an 'out' argument if error is NULL: The minimum image width in pixels

 

out_Min_Height

Used to return an 'out' argument if error is NULL: The minimum image height in pixels

 

out_Max_Width

Used to return an 'out' argument if error is NULL: The maximum image width in pixels, or 0 if there is no limit

 

out_Max_Height

Used to return an 'out' argument if error is NULL: The maximum image height in pixels, or 0 if there is no limit

 

out_Max_Bytes

Used to return an 'out' argument if error is NULL: The maximum image size in bytes, or 0 if there is no limit

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens ()

void
(*tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens)
                               (TpConnection *proxy,
                                const gchar **out_Tokens,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens is deprecated and should not be used in newly-written code.

Use GetKnownAvatarTokens instead.

Signature of the callback called when a GetAvatarTokens method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Tokens

Used to return an 'out' argument if error is NULL: An array of avatar tokens or empty strings (if no avatar is set) in the same order as the given array of contact handles

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens ()

void
(*tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens)
                               (TpConnection *proxy,
                                GHashTable *out_Tokens,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetKnownAvatarTokens method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Tokens

Used to return an 'out' argument if error is NULL: A dictionary of handles mapped to avatar tokens, containing only the known avatar tokens.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_request_avatar ()

void
(*tp_cli_connection_interface_avatars_callback_for_request_avatar)
                               (TpConnection *proxy,
                                const GArray *out_Data,
                                const gchar *out_MIME_Type,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_connection_interface_avatars_callback_for_request_avatar is deprecated and should not be used in newly-written code.

Use RequestAvatars instead.

Signature of the callback called when a RequestAvatar method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Data

Used to return an 'out' argument if error is NULL: An array of bytes containing the image data

 

out_MIME_Type

Used to return an 'out' argument if error is NULL: A string containing the image MIME type (eg image/jpeg), or empty if unknown

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_request_avatars ()

void
(*tp_cli_connection_interface_avatars_callback_for_request_avatars)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestAvatars method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_callback_for_set_avatar ()

void
(*tp_cli_connection_interface_avatars_callback_for_set_avatar)
                               (TpConnection *proxy,
                                const gchar *out_Token,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetAvatar method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Token

Used to return an 'out' argument if error is NULL: The string token of the new avatar

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_avatars_connect_to_avatar_retrieved ()

TpProxySignalConnection *
tp_cli_connection_interface_avatars_connect_to_avatar_retrieved
                               (TpConnection *proxy,
                                tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AvatarRetrieved.

Emitted when the avatar for a contact has been retrieved.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_avatars_connect_to_avatar_updated ()

TpProxySignalConnection *
tp_cli_connection_interface_avatars_connect_to_avatar_updated
                               (TpConnection *proxy,
                                tp_cli_connection_interface_avatars_signal_callback_avatar_updated callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AvatarUpdated.

Emitted when the avatar for a contact has been updated, or first discovered on this connection. If the token differs from the token associated with the client's cached avatar for this contact, the new avatar should be requested with <tp:member-ref>RequestAvatars</tp:member-ref>.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved ()

void
(*tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                const gchar *arg_Token,
                                const GArray *arg_Avatar,
                                const gchar *arg_Type,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AvatarRetrieved.

Parameters

proxy

The proxy on which tp_cli_connection_interface_avatars_connect_to_avatar_retrieved() was called

 

arg_Contact

The contact whose avatar has been retrieved (TpContactHandle)

 

arg_Token

The token corresponding to the avatar

 

arg_Avatar

An array of bytes containing the image data

 

arg_Type

A string containing the image MIME type (eg image/jpeg), or empty if unknown

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_avatars_signal_callback_avatar_updated ()

void
(*tp_cli_connection_interface_avatars_signal_callback_avatar_updated)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                const gchar *arg_New_Avatar_Token,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AvatarUpdated.

Parameters

proxy

The proxy on which tp_cli_connection_interface_avatars_connect_to_avatar_updated() was called

 

arg_Contact

An integer handle for the contact whose avatar has changed (TpContactHandle)

 

arg_New_Avatar_Token

Unique token for their new avatar

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-balance.html0000644000175000017500000002636314006623344024620 00000000000000 Connection Balance interface: telepathy-glib API Reference Manual

Connection Balance interface

Connection Balance interface — client-side wrappers for the Balance interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In some real-time communication services the user can pay for certain services, typically calls to the PSTN, in advance. In (at least) Skype, it's possible to query the current balance in a machine-readable way.

This section documents the auto-generated C wrappers for the Balance interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_balance_connect_to_balance_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_balance_connect_to_balance_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_balance_signal_callback_balance_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal BalanceChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the user's balance has changed.</p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_balance_signal_callback_balance_changed ()

void
(*tp_cli_connection_interface_balance_signal_callback_balance_changed)
                               (TpConnection *proxy,
                                const GValueArray *arg_Balance,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal BalanceChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_balance_connect_to_balance_changed() was called

 

arg_Balance

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The new value of the <tp:member-ref>AccountBalance</tp:member-ref> property.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/TpTLSCertificate.html0000644000175000017500000012105714006623343021272 00000000000000 TpTLSCertificate: telepathy-glib API Reference Manual

TpTLSCertificate

TpTLSCertificate — proxy object for a server or peer's TLS certificate

Properties

GPtrArray * cert-data Read
gchar * cert-type Read
TpProxy * parent Read / Write / Construct Only
guint state Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpTLSCertificate

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpTLSCertificate is a TpProxy subclass for TLSCertificate objects, used in Channel.Type.ServerTLSConnection.

Functions

tp_tls_certificate_init_known_interfaces ()

void
tp_tls_certificate_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpTLSCertificate have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_TLS_CERTIFICATE.

Since: 0.19.0


tp_tls_certificate_new ()

TpTLSCertificate *
tp_tls_certificate_new (TpProxy *conn_or_chan,
                        const gchar *object_path,
                        GError **error);

Parameters

conn_or_chan

a TpConnection or TpChannel parent for this object, whose invalidation will also result in invalidation of the returned object

 

object_path

the object path of this TLS certificate

 

error

a GError used to return an error if NULL is returned, or NULL

 

Returns

a new TLS certificate proxy. Prepare the feature TP_TLS_CERTIFICATE_FEATURE_CORE to make it useful.

[transfer full]

Since: 0.19.0


tp_tls_certificate_get_rejection ()

TpTLSCertificateRejection *
tp_tls_certificate_get_rejection (TpTLSCertificate *self);

If this certificate has been rejected, return a TpTLSCertificateRejection indicating the first rejection reason (by convention, the most important).

If you want to list all the things that are wrong with the certificate (for instance, it might be self-signed and also have expired) you can call tp_tls_certificate_get_nth_rejection(), increasing n until it returns NULL.

Parameters

self

a TLS certificate

 

Returns

a TpTLSCertificateRejection, or NULL.

[transfer none][allow-none]

Since: 0.19.0


tp_tls_certificate_get_nth_rejection ()

TpTLSCertificateRejection *
tp_tls_certificate_get_nth_rejection (TpTLSCertificate *self,
                                      guint n);

If this certificate has been rejected and n is less than the number of rejection reasons, return a TpTLSCertificateRejection representing the n th rejection reason (starting from 0).

With n == 0 this is equivalent to tp_tls_certificate_get_rejection().

Parameters

self

a TLS certificate

 

n

the rejection reason to return; if 0, return the same thing as tp_tls_certificate_get_detailed_rejection()

 

Returns

a TpTLSCertificateRejection, or NULL.

[transfer none][allow-none]

Since: 0.19.0


tp_tls_certificate_accept_async ()

void
tp_tls_certificate_accept_async (TpTLSCertificate *self,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

Accept this certificate, asynchronously. In or after callback , you may call tp_tls_certificate_accept_finish() to check the result.

“:state” will also be emitted when the connection manager signals that the certificate has been accepted.

Parameters

self

a TLS certificate

 

callback

called on success or failure

 

user_data

user data for the callback

 

Since: 0.19.0


tp_tls_certificate_accept_finish ()

gboolean
tp_tls_certificate_accept_finish (TpTLSCertificate *self,
                                  GAsyncResult *result,
                                  GError **error);

Check the result of tp_tls_certificate_accept_async().

Parameters

self

a TLS certificate

 

result

the result passed to the callback by tp_tls_certificate_accept_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE if acceptance was successful

Since: 0.19.0


tp_tls_certificate_add_rejection ()

void
tp_tls_certificate_add_rejection (TpTLSCertificate *self,
                                  TpTLSCertificateRejectReason reason,
                                  const gchar *dbus_error,
                                  GVariant *details);

Add a pending reason for rejection. The first call to this method is considered "most important". After calling this method as many times as are required, call tp_tls_certificate_reject_async() to reject the certificate.

If details is a floating reference (see g_variant_ref_sink()), ownership of details is taken by this function. This means you can pass the result of g_variant_new() or g_variant_new_parsed() directly to this function without additional reference-count management.

Parameters

self

a TLS certificate

 

reason

the reason for rejection

 

dbus_error

a D-Bus error name such as TP_ERROR_STR_CERT_REVOKED, or NULL to derive one from reason

 

details

a variant of type G_VARIANT_TYPE_VARDICT containing the details of the rejection, or NULL.

[transfer none][allow-none]

Since: 0.19.0


tp_tls_certificate_reject_async ()

void
tp_tls_certificate_reject_async (TpTLSCertificate *self,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

Reject this certificate, asynchronously.

Before calling this method, you must call tp_tls_certificate_add_rejection() at least once, to set the reason(s) for rejection (for instance, a certificate might be both self-signed and expired).

In or after callback , you may call tp_tls_certificate_reject_finish() to check the result.

“:state” will also be emitted when the connection manager signals that the certificate has been rejected.

Parameters

self

a TLS certificate

 

callback

called on success or failure

 

user_data

user data for the callback

 

Since: 0.19.0


tp_tls_certificate_reject_finish ()

gboolean
tp_tls_certificate_reject_finish (TpTLSCertificate *self,
                                  GAsyncResult *result,
                                  GError **error);

Check the result of tp_tls_certificate_reject_async().

Parameters

self

a TLS certificate

 

result

the result passed to the callback by tp_tls_certificate_reject_async()

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE if rejection was successful

Since: 0.19.0


tp_tls_certificate_get_cert_type ()

const gchar *
tp_tls_certificate_get_cert_type (TpTLSCertificate *self);

Return the “cert-type” property

Parameters

self

a TpTLSCertificate

 

Returns

the value of “cert-type” property

Since: 0.19.0


tp_tls_certificate_get_cert_data ()

GPtrArray *
tp_tls_certificate_get_cert_data (TpTLSCertificate *self);

Return the “cert-data” property

Parameters

self

a TpTLSCertificate

 

Returns

the value of “cert-data” property.

[transfer none][type GLib.PtrArray][element-type GLib.Bytes]

Since: 0.19.0


tp_tls_certificate_get_state ()

TpTLSCertificateState
tp_tls_certificate_get_state (TpTLSCertificate *self);

Return the “state” property

Parameters

self

a TpTLSCertificate

 

Returns

the value of “state” property

Since: 0.19.0

Types and Values

struct TpTLSCertificate

struct TpTLSCertificate;

A TpProxy subclass representing a server or peer's TLS certificate being presented for acceptance/rejection.

Since: 0.19.0


TP_TLS_CERTIFICATE_FEATURE_CORE

#define             TP_TLS_CERTIFICATE_FEATURE_CORE

Expands to a call to a function that returns a quark representing the core functionality of a TpTLSCertificate.

When this feature is prepared, the basic properties of the object have been retrieved and are available for use:

In addition, “:state” will be emitted if the state changes.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.19.0

Property Details

The “cert-data” property

  “cert-data”                GPtrArray *

The raw data of the certificate or certificate chain, represented as a GPtrArray of GBytes. It should be interpreted according to “cert-type”.

The first certificate in this array is the server's certificate, followed by its issuer, followed by the issuer's issuer and so on.

For "x509" certificates, each certificate is an X.509 certificate in binary (DER) format.

For "pgp" certificates, each certificate is a binary OpenPGP key.

Owner: TpTLSCertificate

Flags: Read

Since: 0.19.0


The “cert-type” property

  “cert-type”                gchar *

The type of the certificate, typically either "x509" or "pgp".

Owner: TpTLSCertificate

Flags: Read

Default value: NULL

Since: 0.19.0


The “parent” property

  “parent”                   TpProxy *

A TpConnection or TpChannel which owns this TLS certificate. If the parent object is invalidated, the certificate is also invalidated, and this property is set to NULL.

Owner: TpTLSCertificate

Flags: Read / Write / Construct Only

Since: 0.19.0


The “state” property

  “state”                    guint

The state of this TLS certificate as a TpTLSCertificateState, initially TP_TLS_CERTIFICATE_STATE_PENDING.

“:state” will be emitted when this changes.

Owner: TpTLSCertificate

Flags: Read

Allowed values: <= 2

Default value: 0

Since: 0.19.0

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-connection-manager.html0000644000175000017500000010055514006623344025432 00000000000000 Service-side Connection Manager interface: telepathy-glib API Reference Manual

Service-side Connection Manager interface

Service-side Connection Manager interface — GInterface for Telepathy ConnectionManager objects

Signals

void new-connection Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcConnectionManager

Known Implementations

TpSvcConnectionManager is implemented by TpBaseConnectionManager.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The TpSvcConnectionManager interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy ConnectionManager interface, with the correct method and signal signatures, and emit signals from that object in a type-safe way.

Functions

tp_svc_connection_manager_get_parameters_impl ()

void
(*tp_svc_connection_manager_get_parameters_impl)
                               (TpSvcConnectionManager *self,
                                const gchar *in_Protocol,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetParameters on interface org.freedesktop.Telepathy.ConnectionManager.

Parameters

self

The object implementing this interface

 

in_Protocol

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_manager_implement_get_parameters ()

void
tp_svc_connection_manager_implement_get_parameters
                               (TpSvcConnectionManagerClass *klass,
                                tp_svc_connection_manager_get_parameters_impl impl);

Register an implementation for the GetParameters method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetParameters D-Bus method

 

tp_svc_connection_manager_return_from_get_parameters ()

void
tp_svc_connection_manager_return_from_get_parameters
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Parameters);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Parameters

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_manager_list_protocols_impl ()

void
(*tp_svc_connection_manager_list_protocols_impl)
                               (TpSvcConnectionManager *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListProtocols on interface org.freedesktop.Telepathy.ConnectionManager.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_manager_implement_list_protocols ()

void
tp_svc_connection_manager_implement_list_protocols
                               (TpSvcConnectionManagerClass *klass,
                                tp_svc_connection_manager_list_protocols_impl impl);

Register an implementation for the ListProtocols method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListProtocols D-Bus method

 

tp_svc_connection_manager_return_from_list_protocols ()

void
tp_svc_connection_manager_return_from_list_protocols
                               (DBusGMethodInvocation *context,
                                const gchar **out_Protocols);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Protocols

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_manager_request_connection_impl ()

void
(*tp_svc_connection_manager_request_connection_impl)
                               (TpSvcConnectionManager *self,
                                const gchar *in_Protocol,
                                GHashTable *in_Parameters,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestConnection on interface org.freedesktop.Telepathy.ConnectionManager.

Parameters

self

The object implementing this interface

 

in_Protocol

const gchar * (FIXME, generate documentation)

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_manager_implement_request_connection ()

void
tp_svc_connection_manager_implement_request_connection
                               (TpSvcConnectionManagerClass *klass,
                                tp_svc_connection_manager_request_connection_impl impl);

Register an implementation for the RequestConnection method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestConnection D-Bus method

 

tp_svc_connection_manager_return_from_request_connection ()

void
tp_svc_connection_manager_return_from_request_connection
                               (DBusGMethodInvocation *context,
                                const gchar *out_Bus_Name,
                                const gchar *out_Object_Path);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Bus_Name

const gchar * (FIXME, generate documentation)

 

out_Object_Path

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_manager_emit_new_connection ()

void
tp_svc_connection_manager_emit_new_connection
                               (gpointer instance,
                                const gchar *arg_Bus_Name,
                                const gchar *arg_Object_Path,
                                const gchar *arg_Protocol);

Type-safe wrapper around g_signal_emit to emit the NewConnection signal on interface org.freedesktop.Telepathy.ConnectionManager.

Parameters

instance

The object implementing this interface

 

arg_Bus_Name

const gchar * (FIXME, generate documentation)

 

arg_Object_Path

const gchar * (FIXME, generate documentation)

 

arg_Protocol

const gchar * (FIXME, generate documentation)

 

Types and Values

TpSvcConnectionManager

typedef struct _TpSvcConnectionManager TpSvcConnectionManager;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionManagerClass

typedef struct _TpSvcConnectionManagerClass TpSvcConnectionManagerClass;

The class of TpSvcConnectionManager.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_manager (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_manager_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_parameters);
  IMPLEMENT (list_protocols);
  IMPLEMENT (request_connection);
#undef IMPLEMENT
}

Signal Details

The “new-connection” signal

void
user_function (TpSvcConnectionManager *self,
               gchar                  *arg_Bus_Name,
               DBusGObjectPath        *arg_Object_Path,
               gchar                  *arg_Protocol,
               gpointer                user_data)

The NewConnection D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Bus_Name

const gchar * (FIXME, generate documentation)

 

arg_Object_Path

const gchar * (FIXME, generate documentation)

 

arg_Protocol

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpBaseConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-contact-list.html0000644000175000017500000071715014006623344025640 00000000000000 Connection ContactList, ContactGroups and ContactBlocking interfaces: telepathy-glib API Reference Manual

Connection ContactList, ContactGroups and ContactBlocking interfaces

Connection ContactList, ContactGroups and ContactBlocking interfaces — client-side wrappers for the ContactList, ContactGroups and ContactBlocking interfaces

Functions

TpProxyPendingCall * tp_cli_connection_interface_contact_blocking_call_block_contacts ()
TpProxyPendingCall * tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ()
TpProxyPendingCall * tp_cli_connection_interface_contact_blocking_call_unblock_contacts ()
void (*tp_cli_connection_interface_contact_blocking_callback_for_block_contacts) ()
void (*tp_cli_connection_interface_contact_blocking_callback_for_request_blocked_contacts) ()
void (*tp_cli_connection_interface_contact_blocking_callback_for_unblock_contacts) ()
TpProxySignalConnection * tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed ()
gboolean tp_cli_connection_interface_contact_blocking_run_block_contacts ()
gboolean tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts ()
gboolean tp_cli_connection_interface_contact_blocking_run_unblock_contacts ()
void (*tp_cli_connection_interface_contact_blocking_signal_callback_blocked_contacts_changed) ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_add_to_group ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_remove_from_group ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_remove_group ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_rename_group ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_set_contact_groups ()
TpProxyPendingCall * tp_cli_connection_interface_contact_groups_call_set_group_members ()
void (*tp_cli_connection_interface_contact_groups_callback_for_add_to_group) ()
void (*tp_cli_connection_interface_contact_groups_callback_for_remove_from_group) ()
void (*tp_cli_connection_interface_contact_groups_callback_for_remove_group) ()
void (*tp_cli_connection_interface_contact_groups_callback_for_rename_group) ()
void (*tp_cli_connection_interface_contact_groups_callback_for_set_contact_groups) ()
void (*tp_cli_connection_interface_contact_groups_callback_for_set_group_members) ()
TpProxySignalConnection * tp_cli_connection_interface_contact_groups_connect_to_group_renamed ()
TpProxySignalConnection * tp_cli_connection_interface_contact_groups_connect_to_groups_changed ()
TpProxySignalConnection * tp_cli_connection_interface_contact_groups_connect_to_groups_created ()
TpProxySignalConnection * tp_cli_connection_interface_contact_groups_connect_to_groups_removed ()
void (*tp_cli_connection_interface_contact_groups_signal_callback_group_renamed) ()
void (*tp_cli_connection_interface_contact_groups_signal_callback_groups_changed) ()
void (*tp_cli_connection_interface_contact_groups_signal_callback_groups_created) ()
void (*tp_cli_connection_interface_contact_groups_signal_callback_groups_removed) ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_authorize_publication ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_download ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_remove_contacts ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_request_subscription ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_unpublish ()
TpProxyPendingCall * tp_cli_connection_interface_contact_list_call_unsubscribe ()
void (*tp_cli_connection_interface_contact_list_callback_for_authorize_publication) ()
void (*tp_cli_connection_interface_contact_list_callback_for_download) ()
void (*tp_cli_connection_interface_contact_list_callback_for_remove_contacts) ()
void (*tp_cli_connection_interface_contact_list_callback_for_request_subscription) ()
void (*tp_cli_connection_interface_contact_list_callback_for_unpublish) ()
void (*tp_cli_connection_interface_contact_list_callback_for_unsubscribe) ()
TpProxySignalConnection * tp_cli_connection_interface_contact_list_connect_to_contacts_changed ()
void (*tp_cli_connection_interface_contact_list_signal_callback_contacts_changed_with_id) ()
TpProxySignalConnection * tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id ()
void (*tp_cli_connection_interface_contact_list_signal_callback_contacts_changed) ()
TpProxySignalConnection * tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed ()
void (*tp_cli_connection_interface_contact_list_signal_callback_contact_list_state_changed) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface allows a client to obtain a server-stored contact list and contacts' groups.

This section documents the auto-generated C wrappers for the ContactList, ContactGroups and ContactBlocking interfaces, used with TpConnection objects.

Functions

tp_cli_connection_interface_contact_blocking_call_block_contacts ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_blocking_call_block_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                gboolean in_Report_Abusive,
                                tp_cli_connection_interface_contact_blocking_callback_for_block_contacts callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a BlockContacts method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Direct the server to block some contacts. The precise effect is protocol-dependent, but SHOULD include ignoring all current and subsequent communications from the given contacts, avoiding sending presence to them in future, and if they were already receiving the local user's presence, behaving as if the local user went offline.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: Some contacts to block. If some of the contacts in this list are already blocked, the connection manager MUST act as if they were not specified in this list.

 

in_Report_Abusive

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>In addition to blocking, report these contacts as abusive to the server administrators.</p> <p>Clients can determine whether this capability is available by checking the <tp:member-ref>ContactBlockingCapabilities</tp:member-ref> property. If this argument is set to <code>True</code> by a client despite <tp:member-ref>ContactBlockingCapabilities</tp:member-ref> not containing the <code>Can_Report_Abusive</code> flag, the connection manager SHOULD act as if it were <code>False</code> and simply block the supplied contacts.</p> <tp:rationale> <p>A correct user interface shouldn't get this far without knowing that reporting abusive contacts is not supported. If it does, then the user has expressed their intention to block these contacts. Returning an error would leave the UI with three options:</p> <ul> <li>Ignore the error, leaving the contacts not actually blocked;</li> <li>Display an error to the user;</li> <li>Call this method again, passing <code>False</code> for this argument.</li> </ul> <p>None of these seem preferable to the CM just ignoring this flag if it doesn't support it: that way, the contacts will be blocked, as the user requested, and UIs have fewer ways to mess up entirely.</p> </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_contact_blocking_callback_for_request_blocked_contacts callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestBlockedContacts method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>List the contacts that are blocked.</p> <p>Clients SHOULD allow a relatively long timeout for calls to this method, since on some protocols contact blocking is part of the contact list, which can take a significant time to retrieve.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_blocking_call_unblock_contacts ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_blocking_call_unblock_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_blocking_callback_for_unblock_contacts callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a UnblockContacts method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Direct the server to unblock some contacts.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: Some contacts to unblock. If some of the contacts in this list are not currently blocked, the connection manager MUST act as if they were not specified in this list.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_blocking_callback_for_block_contacts ()

void
(*tp_cli_connection_interface_contact_blocking_callback_for_block_contacts)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a BlockContacts method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_blocking_callback_for_request_blocked_contacts ()

void
(*tp_cli_connection_interface_contact_blocking_callback_for_request_blocked_contacts)
                               (TpConnection *proxy,
                                GHashTable *out_Contacts,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestBlockedContacts method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Contacts

Used to return an 'out' argument if error is NULL: The blocked contacts’ handles, together with their identifiers.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_blocking_callback_for_unblock_contacts ()

void
(*tp_cli_connection_interface_contact_blocking_callback_for_unblock_contacts)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UnblockContacts method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_blocking_signal_callback_blocked_contacts_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal BlockedContactsChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the list of blocked contacts is first retrieved (before returning from any pending calls to <tp:member-ref>RequestBlockedContacts</tp:member-ref>), and whenever the list of blocked contacts subsequently changes.</p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_blocking_run_block_contacts ()

gboolean
tp_cli_connection_interface_contact_blocking_run_block_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                gboolean in_Report_Abusive,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_blocking_run_block_contacts is deprecated and should not be used in newly-written code.

Call the method BlockContacts and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Direct the server to block some contacts. The precise effect is protocol-dependent, but SHOULD include ignoring all current and subsequent communications from the given contacts, avoiding sending presence to them in future, and if they were already receiving the local user's presence, behaving as if the local user went offline.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: Some contacts to block. If some of the contacts in this list are already blocked, the connection manager MUST act as if they were not specified in this list.

 

in_Report_Abusive

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>In addition to blocking, report these contacts as abusive to the server administrators.</p> <p>Clients can determine whether this capability is available by checking the <tp:member-ref>ContactBlockingCapabilities</tp:member-ref> property. If this argument is set to <code>True</code> by a client despite <tp:member-ref>ContactBlockingCapabilities</tp:member-ref> not containing the <code>Can_Report_Abusive</code> flag, the connection manager SHOULD act as if it were <code>False</code> and simply block the supplied contacts.</p> <tp:rationale> <p>A correct user interface shouldn't get this far without knowing that reporting abusive contacts is not supported. If it does, then the user has expressed their intention to block these contacts. Returning an error would leave the UI with three options:</p> <ul> <li>Ignore the error, leaving the contacts not actually blocked;</li> <li>Display an error to the user;</li> <li>Call this method again, passing <code>False</code> for this argument.</li> </ul> <p>None of these seem preferable to the CM just ignoring this flag if it doesn't support it: that way, the contacts will be blocked, as the user requested, and UIs have fewer ways to mess up entirely.</p> </tp:rationale>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts ()

gboolean
tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable **out_Contacts,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts is deprecated and should not be used in newly-written code.

Call the method RequestBlockedContacts and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>List the contacts that are blocked.</p> <p>Clients SHOULD allow a relatively long timeout for calls to this method, since on some protocols contact blocking is part of the contact list, which can take a significant time to retrieve.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Contacts

Used to return an 'out' argument if TRUE is returned: The blocked contacts’ handles, together with their identifiers.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_blocking_run_unblock_contacts ()

gboolean
tp_cli_connection_interface_contact_blocking_run_unblock_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_blocking_run_unblock_contacts is deprecated and should not be used in newly-written code.

Call the method UnblockContacts and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Direct the server to unblock some contacts.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: Some contacts to unblock. If some of the contacts in this list are not currently blocked, the connection manager MUST act as if they were not specified in this list.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_blocking_signal_callback_blocked_contacts_changed ()

void
(*tp_cli_connection_interface_contact_blocking_signal_callback_blocked_contacts_changed)
                               (TpConnection *proxy,
                                GHashTable *arg_Blocked_Contacts,
                                GHashTable *arg_Unblocked_Contacts,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal BlockedContactsChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed() was called

 

arg_Blocked_Contacts

Contacts added to the result of <tp:member-ref>RequestBlockedContacts</tp:member-ref>.

 

arg_Unblocked_Contacts

Contacts removed from the result of <tp:member-ref>RequestBlockedContacts</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_groups_call_add_to_group ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_add_to_group
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                tp_cli_connection_interface_contact_groups_callback_for_add_to_group callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddToGroup method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Add the given members to the given group, creating it if necessary.</p> <p>If <tp:member-ref>DisjointGroups</tp:member-ref> is true, this will also remove each member from their previous group.</p> <tp:rationale> <p>This is good for user interfaces in which you can edit groups via drag-and-drop.</p> </tp:rationale> <p>Any <tp:member-ref>GroupsCreated</tp:member-ref>, <tp:member-ref>GroupsChanged</tp:member-ref> and <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Group

Used to pass an 'in' argument: The group to alter.

 

in_Members

Used to pass an 'in' argument: The set of members to include in the group.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_call_remove_from_group ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_remove_from_group
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                tp_cli_connection_interface_contact_groups_callback_for_remove_from_group callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveFromGroup method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Remove the given members from the given group.</p> <tp:rationale> <p>This is good for user interfaces in which you can edit groups via drag-and-drop.</p> </tp:rationale> <p>Any <tp:member-ref>GroupsChanged</tp:member-ref> or <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Group

Used to pass an 'in' argument: The group to alter. If it does not exist, then it has no members by definition, so this method SHOULD return successfully.

 

in_Members

Used to pass an 'in' argument: The set of members to remove from the group. It is not an error to remove members who are already not in the group. If there are no members left in the group afterwards, the group MAY itself be removed.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_call_remove_group ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_remove_group
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Group,
                                tp_cli_connection_interface_contact_groups_callback_for_remove_group callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveGroup method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Remove all members from the given group, then remove the group itself. If the group already does not exist, this method SHOULD return successfully.</p> <p>Any <tp:member-ref>GroupsChanged</tp:member-ref> or <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Group

Used to pass an 'in' argument: The group to remove.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_call_rename_group ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_rename_group
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Old_Name,
                                const gchar *in_New_Name,
                                tp_cli_connection_interface_contact_groups_callback_for_rename_group callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RenameGroup method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Rename the given group.</p> <p>On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group.</p> <tp:rationale> <p>Otherwise, clients can't perform this operation atomically, even if the connection could.</p> </tp:rationale> <p>Any <tp:member-ref>GroupRenamed</tp:member-ref> or <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Old_Name

Used to pass an 'in' argument: The group to rename.

 

in_New_Name

Used to pass an 'in' argument: The new name for the group.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_call_set_contact_groups ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_set_contact_groups
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                const gchar **in_Groups,
                                tp_cli_connection_interface_contact_groups_callback_for_set_contact_groups callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetContactGroups method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Add the given contact to the given groups (creating new groups if necessary), and remove them from all other groups.</p> <tp:rationale> <p>This is the easiest and most correct way to implement user interfaces that display a single contact with a list of groups, resulting in a user expectation that when they apply the changes, the contact's set of groups will become exactly what was displayed.</p> </tp:rationale> <p>If the user is removed from a group of which they were the only member, the group MAY be removed automatically.</p> <tp:rationale> <p>In protocols like XMPP where groups behave like tags, a group with no members has no protocol representation.</p> </tp:rationale> <p>Any <tp:member-ref>GroupsCreated</tp:member-ref>, <tp:member-ref>GroupsChanged</tp:member-ref> and <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: The contact to alter. (TpContactHandle)

 

in_Groups

Used to pass an 'in' argument: The set of groups which the contact should be in.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_call_set_group_members ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_groups_call_set_group_members
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                tp_cli_connection_interface_contact_groups_callback_for_set_group_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetGroupMembers method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Add the given members to the given group (creating it if necessary), and remove all other members.</p> <tp:rationale> <p>This is the easiest and most correct way to implement user interfaces that display a single group with a list of contacts, resulting in a user expectation that when they apply the changes, the groups's set of members will become exactly what was displayed.</p> </tp:rationale> <p>If <tp:member-ref>DisjointGroups</tp:member-ref> is true, this will also remove each member from their previous group.</p> <p>If the user is removed from a group of which they were the only member, the group MAY be removed automatically.</p> <p>Any <tp:member-ref>GroupsCreated</tp:member-ref>, <tp:member-ref>GroupsChanged</tp:member-ref> and <tp:member-ref>GroupsRemoved</tp:member-ref> signals that result from this method call MUST be emitted before the method returns.</p> <p>This method SHOULD NOT be called until the <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">ContactListState</tp:dbus-ref> changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as <tp:dbus-ref namespace="ofdT.Connection.Interface.ContactList">GetContactListAttributes</tp:dbus-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Group

Used to pass an 'in' argument: The group to alter.

 

in_Members

Used to pass an 'in' argument: The set of members for the group. If this set is empty, this method MAY remove the group.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_groups_callback_for_add_to_group ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_add_to_group)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddToGroup method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_callback_for_remove_from_group ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_remove_from_group)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveFromGroup method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_callback_for_remove_group ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_remove_group)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveGroup method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_callback_for_rename_group ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_rename_group)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RenameGroup method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_callback_for_set_contact_groups ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_set_contact_groups)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetContactGroups method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_callback_for_set_group_members ()

void
(*tp_cli_connection_interface_contact_groups_callback_for_set_group_members)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetGroupMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_groups_connect_to_group_renamed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_groups_connect_to_group_renamed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_groups_signal_callback_group_renamed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GroupRenamed.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a group is renamed, in protocols where this can be distinguished from group creation, removal and membership changes.</p> <p>Immediately after this signal is emitted, <tp:member-ref>GroupsCreated</tp:member-ref> MUST signal the creation of a group with the new name, and <tp:member-ref>GroupsRemoved</tp:member-ref> MUST signal the removal of a group with the old name.</p> <tp:rationale> <p>Emitting these extra signals, in this order, means that clients that are interested in the set of groups that exist (but treat a rename and a create/remove pair identically) can ignore the GroupRenamed signal entirely.</p> </tp:rationale> <p>If the group was not empty, immediately after those signals are emitted, <tp:member-ref>GroupsChanged</tp:member-ref> MUST signal that the members of that group were removed from the old name and added to the new name.</p> <p>On connection managers where groups behave like tags, renaming a group MAY be signalled as a set of <tp:member-ref>GroupsCreated</tp:member-ref>, <tp:member-ref>GroupsRemoved</tp:member-ref> and <tp:member-ref>GroupsChanged</tp:member-ref> signals, instead of emitting this signal.</p> <tp:rationale> <p>On protocols like XMPP, another resource &quot;renaming a group&quot; is indistinguishable from changing contacts' groups individually.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_groups_connect_to_groups_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_groups_connect_to_groups_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_groups_signal_callback_groups_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GroupsChanged.

Emitted when contacts' groups change.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_groups_connect_to_groups_created ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_groups_connect_to_groups_created
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_groups_signal_callback_groups_created callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GroupsCreated.

Emitted when new, empty groups are created. This will often be followed by <tp:member-ref>GroupsChanged</tp:member-ref> signals that add some members.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_groups_connect_to_groups_removed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_groups_connect_to_groups_removed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_groups_signal_callback_groups_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GroupsRemoved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when one or more groups are removed. If they had members at the time that they were removed, then immediately after this signal is emitted, <tp:member-ref>GroupsChanged</tp:member-ref> MUST signal that their members were removed.</p> <tp:rationale> <p>Emitting the signals in this order allows for two modes of operation. A client interested only in a contact's set of groups can ignore <tp:member-ref>GroupsRemoved</tp:member-ref> and rely on the <tp:member-ref>GroupsChanged</tp:member-ref> signal that will follow; a more elaborate client wishing to distinguish between all of a group's members being removed, and the group itself being removed, can additionally watch for <tp:member-ref>GroupsRemoved</tp:member-ref> and use it to disambiguate.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_groups_signal_callback_group_renamed ()

void
(*tp_cli_connection_interface_contact_groups_signal_callback_group_renamed)
                               (TpConnection *proxy,
                                const gchar *arg_Old_Name,
                                const gchar *arg_New_Name,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GroupRenamed.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_groups_connect_to_group_renamed() was called

 

arg_Old_Name

The old name of the group.

 

arg_New_Name

The new name of the group.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_groups_signal_callback_groups_changed ()

void
(*tp_cli_connection_interface_contact_groups_signal_callback_groups_changed)
                               (TpConnection *proxy,
                                const GArray *arg_Contact,
                                const gchar **arg_Added,
                                const gchar **arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GroupsChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_groups_connect_to_groups_changed() was called

 

arg_Contact

The relevant contacts.

 

arg_Added

The names of groups to which the contacts were added.

 

arg_Removed

The names of groups from which the contacts were removed.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_groups_signal_callback_groups_created ()

void
(*tp_cli_connection_interface_contact_groups_signal_callback_groups_created)
                               (TpConnection *proxy,
                                const gchar **arg_Names,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GroupsCreated.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_groups_connect_to_groups_created() was called

 

arg_Names

The names of the new groups.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_groups_signal_callback_groups_removed ()

void
(*tp_cli_connection_interface_contact_groups_signal_callback_groups_removed)
                               (TpConnection *proxy,
                                const gchar **arg_Names,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GroupsRemoved.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_groups_connect_to_groups_removed() was called

 

arg_Names

The names of the groups.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_list_call_authorize_publication ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_authorize_publication
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_list_callback_for_authorize_publication callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AuthorizePublication method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>For each of the given contacts, request that the local user's presence is sent to that contact, i.e. that their publish attribute becomes Yes.</p> <p>Connection managers SHOULD NOT attempt to enforce a mutual-subscription policy (i.e. when this method is called, they should not automatically request that the contacts allow the user to subscribe to their presence). User interfaces that require mutual subscription MAY call <tp:member-ref>RequestSubscription</tp:member-ref> at the same time as this method.</p> <tp:rationale> <p>Whether to enforce mutual subscription is a matter of policy, so it is left to the user interface and/or the server.</p> </tp:rationale> <p>For contacts with publish=Yes, this method has no effect; it MUST return successfully if all contacts given have this state.</p> <p>For contacts with publish=Ask, this method accepts the contact's request to see the local user's presence, changing their publish attribute from Ask to Yes.</p> <p>For contacts with publish=No, if the protocol allows it, this method allows the contacts to see the local user's presence even though they have not requested it, changing their publish attribute from No to Yes. Otherwise, it merely records the fact that presence publication to those contacts is allowed; if any of those contacts ask to receive the local user's presence later in the lifetime of the connection, the connection SHOULD immediately allow them to do so, changing their publish attribute directly from No to Yes.</p> <tp:rationale> <p>This makes it easy to implement the common UI policy that if the user attempts to subscribe to a contact's presence, requests for reciprocal subscription are automatically approved.</p> </tp:rationale> <p>Any state changes that immediately result from this request MUST be signalled via <tp:member-ref>ContactsChanged</tp:member-ref> before this method returns.</p> <tp:rationale> <p>This makes it easy for user interfaces to see what practical effect this method had.</p> </tp:rationale> <p>This method SHOULD NOT be called until the <tp:member-ref>ContactListState</tp:member-ref> changes to Success. If the <tp:member-ref>ContactListState</tp:member-ref> changes to Failure, this method SHOULD raise the same error as <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One or more contacts to authorize.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_call_download ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_download
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_contact_list_callback_for_download callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Download method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Download the contact list from the server. If <tp:member-ref>DownloadAtConnection</tp:member-ref> is true, Download does nothing.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_call_remove_contacts ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_remove_contacts
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_list_callback_for_remove_contacts callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveContacts method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Remove the given contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances.</p> <p>If possible, this method SHOULD set the contacts' subscribe and publish attributes to No, remove any stored aliases for those contacts, and remove the contacts from the result of <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p> <p>This method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts (for instance, if there is an outstanding request to subscribe to the contact's presence, and it's not possible to cancel such requests). However, all signals that immediately result from this method call MUST be emitted before it returns, so that clients can interpret the result.</p> <tp:rationale> <p>User interfaces removing a contact from the contact list are unlikely to want spurious failure notifications resulting from limitations of a particular protocol. However, emitting the signals first means that if a client does want to check exactly what happened, it can wait for the method to return (while applying change-notification signals to its local cache of the contact list's state), then consult its local cache of the contact list's state to see whether the contact is still there.</p> </tp:rationale> <p>This method SHOULD NOT be called until the <tp:member-ref>ContactListState</tp:member-ref> changes to Success. If the <tp:member-ref>ContactListState</tp:member-ref> changes to Failure, this method SHOULD raise the same error as <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One or more contacts to remove.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_call_request_subscription ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_request_subscription
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                tp_cli_connection_interface_contact_list_callback_for_request_subscription callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestSubscription method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the given contacts allow the local user to subscribe to their presence, i.e. that their subscribe attribute becomes Yes.</p> <p>Connection managers SHOULD NOT attempt to enforce a mutual-subscription policy (i.e. when this method is called, they should not automatically allow the contacts to see the local user's presence). User interfaces that require mutual subscription MAY call <tp:member-ref>AuthorizePublication</tp:member-ref> at the same time as this method.</p> <tp:rationale> <p>Whether to enforce mutual subscription is a matter of policy, so it is left to the user interface and/or the server.</p> </tp:rationale> <p>Before calling this method on a connection where <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">GetAliasFlags</tp:dbus-ref> returns the <code>User_Set</code> flag, user interfaces SHOULD obtain, from the user, an alias to identify the contact in future, and store it using <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">SetAliases</tp:dbus-ref>.</p> <p>The user MAY be prompted using the contact's current self-assigned nickname, or something derived from the contact's (presumably self-assigned) identifier, as a default, but these names chosen by the contact SHOULD NOT be used without user approval.</p> <tp:rationale> <p>This is a generalization of <a href="http://xmpp.org/extensions/xep-0165.html">XEP-0165 &quot;Best Practices to Discourage JID Mimicking&quot;</a>) to protocols other than XMPP. A reasonable user interface for this, as used in many XMPP clients, is to have a text entry for the alias adjacent to the text entry for the identifier to add.</p> </tp:rationale> <p>For contacts with subscribe=Yes, this method has no effect. It MUST return successfully if all contacts are in this state.</p> <p>For contacts with subscribe=Ask, this method SHOULD send a new request, with the given message, if allowed by the underlying protocol.</p> <p>For contacts with subscribe=No or subscribe=Rejected, this method SHOULD request that the contact allows the local user to subscribe to their presence; in general, this will change their publish attribute to Ask (although it could change directly to Yes in some situations).</p> <p>Any state changes that immediately result from this request MUST be signalled via <tp:member-ref>ContactsChanged</tp:member-ref> before this method returns.</p> <tp:rationale> <p>This makes it easy for user interfaces to see what practical effect this method had.</p> </tp:rationale> <p>If the remote contact accepts the request, their subscribe attribute will later change from Ask to Yes.</p> <p>If the remote contact explicitly rejects the request (in protocols that allow this), their subscribe attribute will later change from Ask to Rejected.</p> <p>If the subscription request is cancelled by the local user, the contact's subscribe attribute will change from Ask to No.</p> <p>This method SHOULD NOT be called until the <tp:member-ref>ContactListState</tp:member-ref> changes to Success. If the <tp:member-ref>ContactListState</tp:member-ref> changes to Failure, this method SHOULD raise the same error as <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One or more contacts to whom requests are to be sent.</p>

 

in_Message

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An optional plain-text message from the user, to send to those contacts with the subscription request. The <tp:member-ref>RequestUsesMessage</tp:member-ref> property indicates whether this message will be used or ignored.</p> <p>Clients SHOULD NOT send a non-empty message without first giving the user an opportunity to edit it.</p> <tp:rationale> <p>These messages are typically presented to the remote contact as if the user had typed them, so as a minimum, the user should be allowed to see what the UI will be saying on their behalf.</p> </tp:rationale> <p>Connections where this message is not useful MUST still allow it to be non-empty.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_call_unpublish ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_unpublish
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_list_callback_for_unpublish callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Unpublish method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Attempt to set the given contacts' publish attribute to No, i.e. stop sending presence to them.</p> <p>For contacts with publish=Ask, this method explicitly rejects the contact's request to subscribe to the user's presence; for contacts with publish=Yes, this method attempts to prevent the user's presence from being received by the contact.</p> <p>As with <tp:member-ref>RemoveContacts</tp:member-ref>, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.</p> <p>This method SHOULD NOT be called until the <tp:member-ref>ContactListState</tp:member-ref> changes to Success. If the <tp:member-ref>ContactListState</tp:member-ref> changes to Failure, this method SHOULD raise the same error as <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One or more contacts to remove.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_call_unsubscribe ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_list_call_unsubscribe
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_list_callback_for_unsubscribe callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Unsubscribe method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Attempt to set the given contacts' subscribe attribute to No, i.e. stop receiving their presence.</p> <p>For contacts with subscribe=Ask, this attempts to cancel an earlier request to subscribe to the contact's presence; for contacts with subscribe=Yes, this attempts to unsubscribe from the contact's presence.</p> <p>As with <tp:member-ref>RemoveContacts</tp:member-ref>, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.</p> <p>This method SHOULD NOT be called until the <tp:member-ref>ContactListState</tp:member-ref> changes to Success. If the <tp:member-ref>ContactListState</tp:member-ref> changes to Failure, this method SHOULD raise the same error as <tp:member-ref>GetContactListAttributes</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>One or more contacts to remove.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_list_callback_for_authorize_publication ()

void
(*tp_cli_connection_interface_contact_list_callback_for_authorize_publication)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AuthorizePublication method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_callback_for_download ()

void
(*tp_cli_connection_interface_contact_list_callback_for_download)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Download method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_callback_for_remove_contacts ()

void
(*tp_cli_connection_interface_contact_list_callback_for_remove_contacts)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveContacts method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_callback_for_request_subscription ()

void
(*tp_cli_connection_interface_contact_list_callback_for_request_subscription)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestSubscription method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_callback_for_unpublish ()

void
(*tp_cli_connection_interface_contact_list_callback_for_unpublish)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Unpublish method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_callback_for_unsubscribe ()

void
(*tp_cli_connection_interface_contact_list_callback_for_unsubscribe)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Unsubscribe method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_list_connect_to_contacts_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_list_connect_to_contacts_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_list_signal_callback_contacts_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContactsChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted immediately after <tp:member-ref>ContactsChangedWithID</tp:member-ref>, under the same circumstances.</p> <p>If clients receive this signal without first receiving a corresponding <tp:member-ref>ContactsChangedWithID</tp:member-ref>, they MUST assume that only this signal will be emitted.</p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_list_signal_callback_contacts_changed_with_id ()

void
(*tp_cli_connection_interface_contact_list_signal_callback_contacts_changed_with_id)
                               (TpConnection *proxy,
                                GHashTable *arg_Changes,
                                GHashTable *arg_Identifiers,
                                GHashTable *arg_Removals,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContactsChangedWithID.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id() was called

 

arg_Changes

The new <tp:token-ref>subscribe</tp:token-ref>, <tp:token-ref>publish</tp:token-ref> and <tp:token-ref>publish-request</tp:token-ref> attributes of all the contacts that have been added, and all the contacts for which those attributes have changed.

 

arg_Identifiers

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The identifiers of the contacts in the <var>Changes</var> map.

 

arg_Removals

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The contacts that have been removed from the list that would be returned by <tp:member-ref>GetContactListAttributes</tp:member-ref>. This also implies that they have subscribe = No and publish = No; contacts MUST NOT be listed both here and in <var>Changes</var>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_list_signal_callback_contacts_changed_with_id callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContactsChangedWithID.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the contact list becomes available, when contacts' basic stored properties change, when new contacts are added to the list that would be returned by <tp:member-ref>GetContactListAttributes</tp:member-ref>, or when contacts are removed from that list.</p> <tp:rationale> <p>This provides change notification for that list, and for contacts' <tp:token-ref>subscribe</tp:token-ref>, <tp:token-ref>publish</tp:token-ref> and <tp:token-ref>publish-request</tp:token-ref> attributes.</p> </tp:rationale> <p>Connection managers SHOULD also emit this signal when a contact requests that the user's presence is published to them, even if that contact's <tp:token>publish</tp:token> attribute is already Ask and the <tp:token>publish-request</tp:token> has not changed.</p> <tp:rationale> <p>If the same contact sends 10 identical requests, 10 identical signals should be emitted.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_list_signal_callback_contacts_changed ()

void
(*tp_cli_connection_interface_contact_list_signal_callback_contacts_changed)
                               (TpConnection *proxy,
                                GHashTable *arg_Changes,
                                const GArray *arg_Removals,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContactsChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_list_connect_to_contacts_changed() was called

 

arg_Changes

The same as the corresponding argument to <tp:member-ref>ContactsChangedWithID</tp:member-ref>.

 

arg_Removals

The same as the corresponding argument to <tp:member-ref>ContactsChangedWithID</tp:member-ref>, except that it only includes handles and not identifiers.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_list_signal_callback_contact_list_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContactListStateChanged.

Emitted when <tp:member-ref>ContactListState</tp:member-ref> changes.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_list_signal_callback_contact_list_state_changed ()

void
(*tp_cli_connection_interface_contact_list_signal_callback_contact_list_state_changed)
                               (TpConnection *proxy,
                                guint arg_Contact_List_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContactListStateChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed() was called

 

arg_Contact_List_State

The new value of <tp:member-ref>ContactListState</tp:member-ref>. (TpContactListState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/TpBaseCallStream.html0000644000175000017500000013360514006623343021311 00000000000000 TpBaseCallStream: telepathy-glib API Reference Manual

TpBaseCallStream

TpBaseCallStream — base class for TpSvcCallStream implementations

Properties

gboolean can-request-receiving Read
TpBaseCallChannel * channel Read
TpBaseConnection * connection Read / Write / Construct Only
TpBaseCallContent * content Read / Write / Construct Only
GStrv interfaces Read
guint local-sending-state Read / Write / Construct Only
gchar * object-path Read / Write / Construct Only
GHashTable_guint+gchararray_* remote-member-identifiers Read
GHashTable_guint+guint_* remote-members Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseCallStream
        ╰── TpBaseMediaCallStream

Implemented Interfaces

TpBaseCallStream implements TpSvcDBusProperties and TpSvcCallStream.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcCallStream implementations by implementing its properties, and some of its methods.

Subclasses should fill in TpBaseCallStreamClass.get_interfaces, TpBaseCallStreamClass.request_receiving and TpBaseCallStreamClass.set_sending virtual function.

Functions

TpBaseCallStreamGetInterfacesFunc ()

GPtrArray *
(*TpBaseCallStreamGetInterfacesFunc) (TpBaseCallStream *self);

Signature of an implementation of TpBaseCallStreamClass.get_interfaces.

Parameters

self

a TpBaseCallStream

 

Returns

a GPtrArray containing static strings.

Since: 0.17.5


TpBaseCallStreamRequestReceivingFunc ()

gboolean
(*TpBaseCallStreamRequestReceivingFunc)
                               (TpBaseCallStream *self,
                                TpHandle contact,
                                gboolean receive,
                                GError **error);

Signature of an implementation of TpBaseCallStreamClass.request_receiving.

Parameters

self

a TpBaseCallStream

 

contact

the contact from who user wants to start or stop receiving

 

receive

wheter or not user would like to be receiving

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.17.5


TpBaseCallStreamSetSendingFunc ()

gboolean
(*TpBaseCallStreamSetSendingFunc) (TpBaseCallStream *self,
                                   gboolean sending,
                                   GError **error);

Signature of an implementation of TpBaseCallStreamClass.set_sending.

Parameters

self

a TpBaseCallStream

 

sending

whether or not user would like to be sending

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.17.5


tp_base_call_stream_get_connection ()

TpBaseConnection *
tp_base_call_stream_get_connection (TpBaseCallStream *self);

Parameters

self

a TpBaseCallStream

 

Returns

the value of “connection”

Since: 0.17.5


tp_base_call_stream_get_object_path ()

const gchar *
tp_base_call_stream_get_object_path (TpBaseCallStream *self);

Parameters

self

a TpBaseCallStream

 

Returns

the value of “object-path”

Since: 0.17.5


tp_base_call_stream_get_local_sending_state ()

TpSendingState
tp_base_call_stream_get_local_sending_state
                               (TpBaseCallStream *self);

Parameters

self

a TpBaseCallStream

 

Returns

the value of “local-sending-state”

Since: 0.17.5


tp_base_call_stream_update_local_sending_state ()

gboolean
tp_base_call_stream_update_local_sending_state
                               (TpBaseCallStream *self,
                                TpSendingState new_state,
                                TpHandle actor_handle,
                                TpCallStateChangeReason reason,
                                const gchar *dbus_reason,
                                const gchar *message);

Update the local sending state, emitting LocalSendingStateChanged DBus signal if needed.

Parameters

self

a TpBaseCallStream

 

new_state

the new local TpSendingState

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Returns

TRUE if state was updated, FALSE if it was already set to new_state .

Since: 0.17.5


tp_base_call_stream_get_remote_sending_state ()

TpSendingState
tp_base_call_stream_get_remote_sending_state
                               (TpBaseCallStream *self,
                                TpHandle contact);

Parameters

self

a TpBaseCallStream

 

contact

the TpHandle of a member contact

 

Returns

the TpSendingState of contact .

Since: 0.17.5


tp_base_call_stream_update_remote_sending_state ()

gboolean
tp_base_call_stream_update_remote_sending_state
                               (TpBaseCallStream *self,
                                TpHandle contact,
                                TpSendingState new_state,
                                TpHandle actor_handle,
                                TpCallStateChangeReason reason,
                                const gchar *dbus_reason,
                                const gchar *message);

If contact is not member, add it. Otherwise update its sending state. Emits RemoteMemberChanged DBus signal if needed.

Parameters

self

a TpBaseCallStream

 

contact

the TpHandle to update or add to members

 

new_state

the new sending state of contact

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Returns

TRUE if state was updated, FALSE if it was already set to new_state .

Since: 0.17.5


tp_base_call_stream_remove_member ()

gboolean
tp_base_call_stream_remove_member (TpBaseCallStream *self,
                                   TpHandle contact,
                                   TpHandle actor_handle,
                                   TpCallStateChangeReason reason,
                                   const gchar *dbus_reason,
                                   const gchar *message);

Remove contact from stream members, emitting RemoteMembersChanged DBus signal if needed. Do nothing if contact is not member.

Parameters

self

a TpBaseCallStream

 

contact

the TpHandle to remove from members

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Returns

TRUE if contact was removed, FALSE if it was not member.

Since: 0.17.5

Types and Values

struct TpBaseCallStream

struct TpBaseCallStream;

A base class for call stream implementations

Since: 0.17.5


struct TpBaseCallStreamClass

struct TpBaseCallStreamClass {
  TpBaseCallStreamRequestReceivingFunc request_receiving;
  TpBaseCallStreamSetSendingFunc set_sending;
  TpBaseCallStreamGetInterfacesFunc get_interfaces;
};

The class structure for TpBaseCallStream

Members

TpBaseCallStreamRequestReceivingFunc request_receiving;

optional (see “can-request-receiving”); virtual method called when user requested receiving from the given remote contact.

 

TpBaseCallStreamSetSendingFunc set_sending;

mandatory; virtual method called when user requested to start/stop sending to remote contacts.

 

TpBaseCallStreamGetInterfacesFunc get_interfaces;

extra interfaces provided by this stream (this SHOULD NOT include TP_IFACE_CALL_STREAM itself). Implementation must first chainup on parent class implementation then add extra interfaces into the GPtrArray.

 

Since: 0.17.5

Property Details

The “can-request-receiving” property

  “can-request-receiving”    gboolean

Whether or not user can request receiving from remote contact using the RequestSending DBus method call. The value is determined by whether or not TpBaseCallStreamClass.request_receiving is implemented.

Owner: TpBaseCallStream

Flags: Read

Default value: FALSE

Since: 0.17.5


The “channel” property

  “channel”                  TpBaseCallChannel *

TpBaseChannel object that owns this call stream.

Owner: TpBaseCallStream

Flags: Read

Since: 0.17.5


The “connection” property

  “connection”               TpBaseConnection *

TpBaseConnection object that owns this call stream.

Owner: TpBaseCallStream

Flags: Read / Write / Construct Only

Since: 0.17.5


The “content” property

  “content”                  TpBaseCallContent *

TpBaseCallContent object that owns this call stream.

Owner: TpBaseCallStream

Flags: Read / Write / Construct Only

Since: 0.17.6


The “interfaces” property

  “interfaces”               GStrv

Additional interfaces implemented by this stream.

Owner: TpBaseCallStream

Flags: Read

Since: 0.17.5


The “local-sending-state” property

  “local-sending-state”      guint

The local TpSendingState.

Owner: TpBaseCallStream

Flags: Read / Write / Construct Only

Allowed values: <= 4

Default value: 0

Since: 0.17.5


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus.

Owner: TpBaseCallStream

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.17.5


The “remote-member-identifiers” property

  “remote-member-identifiers” GHashTable_guint+gchararray_*

GHashTable mapping contact TpHandle to their identifies.

Owner: TpBaseCallStream

Flags: Read

Since: 0.17.5


The “remote-members” property

  “remote-members”           GHashTable_guint+guint_*

GHashTable mapping contact TpHandle to their TpSendingState.

Owner: TpBaseCallStream

Flags: Read

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/annotation-glossary.html0000644000175000017500000001111014006623343022160 00000000000000 Annotation Glossary: telepathy-glib API Reference Manual

Annotation Glossary

A

allow-none

NULL is OK, both for passing and for returning.

array

Parameter points to an array of items.

C

closure

This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.

E

element-type

Generics and defining elements of containers and arrays.

O

out

Parameter for returning results. Default is transfer full.

S

scope async

The callback is valid until first called.

scope call

The callback is valid only during the call to the method.

skip

Exposed in C code, not necessarily available in other languages.

T

transfer container

Free data container after the code is done.

transfer full

Free data after the code is done.

transfer none

Don't free data after the code is done.

type

Override the parsed C type with given type.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-manager.html0000644000175000017500000053106214006623344024642 00000000000000 TpConnectionManager: telepathy-glib API Reference Manual

TpConnectionManager

TpConnectionManager — proxy object for a Telepathy connection manager

Functions

void (*TpConnectionManagerListCb) ()
void tp_list_connection_managers_async ()
GList * tp_list_connection_managers_finish ()
void tp_list_connection_managers ()
TpConnectionManager * tp_connection_manager_new ()
const gchar * tp_connection_manager_get_name ()
void (*TpConnectionManagerWhenReadyCb) ()
void tp_connection_manager_call_when_ready ()
gboolean tp_connection_manager_is_ready ()
TpCMInfoSource tp_connection_manager_get_info_source ()
gboolean tp_connection_manager_activate ()
gboolean tp_connection_manager_is_running ()
GList * tp_connection_manager_dup_protocols ()
gchar ** tp_connection_manager_dup_protocol_names ()
gboolean tp_connection_manager_has_protocol ()
const TpConnectionManagerProtocol * tp_connection_manager_get_protocol ()
TpProtocol * tp_connection_manager_get_protocol_object ()
gboolean tp_connection_manager_protocol_can_register ()
gchar ** tp_connection_manager_protocol_dup_param_names ()
gboolean tp_connection_manager_protocol_has_param ()
const TpConnectionManagerParam * tp_connection_manager_protocol_get_param ()
const gchar * tp_connection_manager_param_get_name ()
const gchar * tp_connection_manager_param_get_dbus_signature ()
GVariantType * tp_connection_manager_param_dup_variant_type ()
gboolean tp_connection_manager_param_is_required ()
gboolean tp_connection_manager_param_is_required_for_registration ()
gboolean tp_connection_manager_param_is_secret ()
gboolean tp_connection_manager_param_is_dbus_property ()
gboolean tp_connection_manager_param_get_default ()
GVariant * tp_connection_manager_param_dup_default_variant ()
gboolean tp_connection_manager_check_valid_name ()
gboolean tp_connection_manager_check_valid_protocol_name ()
void tp_connection_manager_init_known_interfaces ()
TpConnectionManagerParam * tp_connection_manager_param_copy ()
void tp_connection_manager_param_free ()
TpConnectionManagerProtocol * tp_connection_manager_protocol_copy ()
void tp_connection_manager_protocol_free ()
void (*tp_cli_connection_manager_callback_for_get_parameters) ()
TpProxyPendingCall * tp_cli_connection_manager_call_get_parameters ()
gboolean tp_cli_connection_manager_run_get_parameters ()
void (*tp_cli_connection_manager_callback_for_list_protocols) ()
TpProxyPendingCall * tp_cli_connection_manager_call_list_protocols ()
gboolean tp_cli_connection_manager_run_list_protocols ()
void (*tp_cli_connection_manager_callback_for_request_connection) ()
TpProxyPendingCall * tp_cli_connection_manager_call_request_connection ()
gboolean tp_cli_connection_manager_run_request_connection ()
void (*tp_cli_connection_manager_signal_callback_new_connection) ()
TpProxySignalConnection * tp_cli_connection_manager_connect_to_new_connection ()

Properties

gboolean always-introspect Read / Write
gchar * cm-name Read
gchar * connection-manager Read
guint info-source Read
gchar * manager-file Read / Write / Construct

Signals

void activated Has Details
void exited Has Details
void got-info Has Details

Object Hierarchy

    GBoxed
    ├── TpConnectionManagerParam
    ╰── TpConnectionManagerProtocol
    GEnum
    ╰── TpCMInfoSource
    GObject
    ╰── TpProxy
        ╰── TpConnectionManager

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpConnectionManager objects represent Telepathy connection managers. They can be used to open connections.

Functions

TpConnectionManagerListCb ()

void
(*TpConnectionManagerListCb) (TpConnectionManager * const *cms,
                              gsize n_cms,
                              const GError *error,
                              gpointer user_data,
                              GObject *weak_object);

Signature of the callback supplied to tp_list_connection_managers().

Since 0.11.3, tp_list_connection_managers() will wait for TP_CONNECTION_MANAGER_FEATURE_CORE to be prepared on each connection manager passed to callback , unless an error occurred while launching that connection manager.

Parameters

cms

NULL-terminated array of TpConnectionManager (the objects will be unreferenced and the array will be freed after the callback returns, so the callback must reference any CMs it stores a pointer to), or NULL on error.

[array zero-terminated=1]

n_cms

number of connection managers in cms (not including the final NULL)

 

error

NULL on success, or an error that occurred

 

user_data

user-supplied data

 

weak_object

user-supplied weakly referenced object

 

Since: 0.7.1


tp_list_connection_managers_async ()

void
tp_list_connection_managers_async (TpDBusDaemon *dbus_daemon,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

List the available (running or installed) connection managers, asynchronously, and wait for their TP_CONNECTION_MANAGER_FEATURE_CORE feature to be ready.

Parameters

dbus_daemon

a TpDBusDaemon, or NULL to use tp_dbus_daemon_dup().

[allow-none]

callback

a callback to call with a list of CMs

 

user_data

data to pass to callback

 

Since: 0.17.6


tp_list_connection_managers_finish ()

GList *
tp_list_connection_managers_finish (GAsyncResult *result,
                                    GError **error);

Finish listing the available connection managers.

Free the list after use, for instance with g_list_free_full (list, g_object_unref).

Parameters

result

the result of tp_list_connection_managers_async()

 

error

used to raise an error if the operation failed

 

Returns

a newly allocated list of references to TpConnectionManager objects.

[transfer full][element-type TelepathyGLib.ConnectionManager]

Since: 0.17.6


tp_list_connection_managers ()

void
tp_list_connection_managers (TpDBusDaemon *bus_daemon,
                             TpConnectionManagerListCb callback,
                             gpointer user_data,
                             GDestroyNotify destroy,
                             GObject *weak_object);

tp_list_connection_managers is deprecated and should not be used in newly-written code.

since 0.19.1, use tp_list_connection_managers_async()

List the available (running or installed) connection managers. Call the callback when done.

Since 0.7.26, this function will wait for each TpConnectionManager to be ready, so all connection managers passed to callback will have their TP_CONNECTION_MANAGER_FEATURE_CORE feature prepared, unless an error occurred while launching that connection manager.

Parameters

bus_daemon

proxy for the D-Bus daemon

 

callback

callback to be called when listing the CMs succeeds or fails; not called if the weak_object goes away

 

user_data

user-supplied data for the callback

 

destroy

callback to destroy the user-supplied data, called after callback , but also if the weak_object goes away

 

weak_object

if not NULL, will be weakly referenced; the callback will not be called, and the call will be cancelled, if the object has vanished.

[allow-none]

Since: 0.7.1


tp_connection_manager_new ()

TpConnectionManager *
tp_connection_manager_new (TpDBusDaemon *dbus,
                           const gchar *name,
                           const gchar *manager_filename,
                           GError **error);

Convenience function to create a new connection manager proxy. If its protocol and parameter information are required, you should call tp_proxy_prepare_async() on the result.

Parameters

dbus

Proxy for the D-Bus daemon

 

name

The connection manager name (such as "gabble")

 

manager_filename

The “manager-file” property, which may (and generally should) be NULL.

[allow-none]

error

used to return an error if NULL is returned

 

Returns

a new reference to a connection manager proxy, or NULL if error is set.


tp_connection_manager_get_name ()

const gchar *
tp_connection_manager_get_name (TpConnectionManager *self);

Return the internal name of this connection manager in the Telepathy D-Bus API, e.g. "gabble" or "haze". This is often the name of the binary without the "telepathy-" prefix.

The returned string is valid as long as self is. Copy it with g_strdup() if a longer lifetime is required.

Parameters

self

a connection manager

 

Returns

the “cm-name” property

Since: 0.7.26


TpConnectionManagerWhenReadyCb ()

void
(*TpConnectionManagerWhenReadyCb) (TpConnectionManager *cm,
                                   const GError *error,
                                   gpointer user_data,
                                   GObject *weak_object);

TpConnectionManagerWhenReadyCb is deprecated and should not be used in newly-written code.

since 0.17.6, use tp_proxy_prepare_async() instead

Called as the result of tp_connection_manager_call_when_ready(). If the connection manager's protocol and parameter information could be retrieved, error is NULL and cm is considered to be ready. Otherwise, error is non-NULL and cm is not ready.

Parameters

cm

a connection manager

 

error

NULL on success, or the reason why tp_connection_manager_is_ready() would return FALSE

 

user_data

the user_data passed to tp_connection_manager_call_when_ready()

 

weak_object

the weak_object passed to tp_connection_manager_call_when_ready()

 

tp_connection_manager_call_when_ready ()

void
tp_connection_manager_call_when_ready (TpConnectionManager *self,
                                       TpConnectionManagerWhenReadyCb callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

tp_connection_manager_call_when_ready is deprecated and should not be used in newly-written code.

since 0.17.6, use tp_proxy_prepare_async() instead

Call the callback from the main loop when information about cm 's supported protocols and parameters has been retrieved.

[skip]

Parameters

self

a connection manager

 

callback

callback to call when information has been retrieved or on error

 

user_data

arbitrary data to pass to the callback

 

destroy

called to destroy user_data

 

weak_object

object to reference weakly; if it is destroyed, callback will not be called, but destroy will still be called

 

Since: 0.7.26


tp_connection_manager_is_ready ()

gboolean
tp_connection_manager_is_ready (TpConnectionManager *self);

tp_connection_manager_is_ready is deprecated and should not be used in newly-written code.

since 0.17.6, use tp_proxy_is_prepared() with TP_CONNECTION_MANAGER_FEATURE_CORE instead

If protocol and parameter information has been obtained from the connection manager or the cache in the .manager file, return TRUE. Otherwise, return FALSE.

This may change from FALSE to TRUE at any time that the main loop is running; the “notify” signal is emitted for the “info-source” property.

[skip]

Parameters

self

a connection manager

 

Returns

TRUE, unless the “info-source” property is TP_CM_INFO_SOURCE_NONE

Since: 0.7.26


tp_connection_manager_get_info_source ()

TpCMInfoSource
tp_connection_manager_get_info_source (TpConnectionManager *self);

If protocol and parameter information has been obtained from the connection manager, return TP_CM_INFO_SOURCE_LIVE; if it has been obtained from the cache in the .manager file, return TP_CM_INFO_SOURCE_FILE. If this information has not yet been obtained, or obtaining it failed, return TP_CM_INFO_SOURCE_NONE.

This may increase at any time that the main loop is running; the “notify” signal is emitted.

Parameters

self

a connection manager

 

Returns

the value of the “info-source” property

Since: 0.7.26


tp_connection_manager_activate ()

gboolean
tp_connection_manager_activate (TpConnectionManager *self);

Attempt to run and introspect the connection manager, asynchronously. Since 0.7.26 this function is not generally very useful, since the connection manager will now be activated automatically if necessary.

If the CM was already running, do nothing and return FALSE.

On success, emit “activated” when the CM appears on the bus, and “got-info” when its capabilities have been (re-)discovered.

On failure, emit “exited” without first emitting activated.

[skip]

Parameters

self

a connection manager proxy

 

Returns

TRUE if activation was needed and is now in progress, FALSE if the connection manager was already running and no additional signals will be emitted.

Since: 0.7.1


tp_connection_manager_is_running ()

gboolean
tp_connection_manager_is_running (TpConnectionManager *self);

Return TRUE if this connection manager currently appears to be running. This may change at any time that the main loop is running; the “activated” and “exited” signals are emitted.

Parameters

self

a connection manager

 

Returns

whether the connection manager is currently running

Since: 0.7.26


tp_connection_manager_dup_protocols ()

GList *
tp_connection_manager_dup_protocols (TpConnectionManager *self);

Return objects representing all protocols supported by this connection manager.

If this function is called before the connection manager information has been obtained, the result is always NULL. Use tp_proxy_prepare_async() to wait for this.

The caller must free the list, for instance with g_list_free_full (l, g_object_unref).

Parameters

self

a connection manager

 

Returns

a list of TpProtocol objects representing the protocols supported by self , owned by the caller.

[transfer full][element-type TelepathyGLib.Protocol]

Since: 0.17.6


tp_connection_manager_dup_protocol_names ()

gchar **
tp_connection_manager_dup_protocol_names
                               (TpConnectionManager *self);

Returns a list of protocol names supported by this connection manager. These are the internal protocol names used by the Telepathy specification (e.g. "jabber" and "msn"), rather than user-visible names in any particular locale.

If this function is called before the connection manager information has been obtained, the result is always NULL. Use tp_proxy_prepare_async() to wait for this.

The result is copied and must be freed by the caller, but it is not necessarily still true after the main loop is re-entered.

Parameters

self

a connection manager

 

Returns

a GStrv of protocol names.

[array zero-terminated=1][transfer full]

Since: 0.7.26


tp_connection_manager_has_protocol ()

gboolean
tp_connection_manager_has_protocol (TpConnectionManager *self,
                                    const gchar *protocol);

Return whether protocol is supported by this connection manager.

If this function is called before the connection manager information has been obtained, the result is always FALSE. Use tp_proxy_prepare_async() to wait for this.

Parameters

self

a connection manager

 

protocol

the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn"

 

Returns

TRUE if this connection manager supports protocol

Since: 0.7.26


tp_connection_manager_get_protocol ()

const TpConnectionManagerProtocol *
tp_connection_manager_get_protocol (TpConnectionManager *self,
                                    const gchar *protocol);

tp_connection_manager_get_protocol has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use tp_connection_manager_get_protocol_object()

Returns a structure representing a protocol, or NULL if this connection manager does not support the specified protocol.

Since 0.11.11, you can get a GObject version with more functionality by calling tp_connection_manager_get_protocol_object().

If this function is called before the connection manager information has been obtained, the result is always NULL. Use tp_proxy_prepare_async() to wait for this.

The result is not necessarily valid after the main loop is re-entered. Since 0.11.3, it can be copied with tp_connection_manager_protocol_copy() if a permanently-valid copy is needed.

Parameters

self

a connection manager

 

protocol

the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn"

 

Returns

a structure representing the protocol.

[transfer none]

Since: 0.7.26


tp_connection_manager_get_protocol_object ()

TpProtocol *
tp_connection_manager_get_protocol_object
                               (TpConnectionManager *self,
                                const gchar *protocol);

Returns an object representing a protocol, or NULL if this connection manager does not support the specified protocol.

If this function is called before the connection manager information has been obtained, the result is always NULL. Use tp_proxy_prepare_async() to wait for this.

The result should be referenced with g_object_ref() if it will be kept.

Parameters

self

a connection manager

 

protocol

the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn"

 

Returns

an object representing the protocol, or NULL.

[transfer none]

Since: 0.11.11


tp_connection_manager_protocol_can_register ()

gboolean
tp_connection_manager_protocol_can_register
                               (const TpConnectionManagerProtocol *protocol);

tp_connection_manager_protocol_can_register has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Return whether a new account can be registered on this protocol, by setting the special "register" parameter to TRUE.

Parameters

protocol

structure representing a supported protocol

 

Returns

TRUE if protocol supports the parameter "register"

Since: 0.7.26


tp_connection_manager_protocol_dup_param_names ()

gchar **
tp_connection_manager_protocol_dup_param_names
                               (const TpConnectionManagerProtocol *protocol);

tp_connection_manager_protocol_dup_param_names has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Returns a list of parameter names supported by this connection manager for this protocol.

The result is copied and must be freed by the caller with g_strfreev().

Parameters

protocol

a protocol supported by a TpConnectionManager

 

Returns

a GStrv of protocol names.

[array zero-terminated=1][transfer full]

Since: 0.7.26


tp_connection_manager_protocol_has_param ()

gboolean
tp_connection_manager_protocol_has_param
                               (const TpConnectionManagerProtocol *protocol,
                                const gchar *param);

tp_connection_manager_protocol_has_param has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Parameters

protocol

structure representing a supported protocol

 

param

a parameter name

 

Returns

TRUE if protocol supports the parameter param .

Since: 0.7.26


tp_connection_manager_protocol_get_param ()

const TpConnectionManagerParam *
tp_connection_manager_protocol_get_param
                               (const TpConnectionManagerProtocol *protocol,
                                const gchar *param);

tp_connection_manager_protocol_get_param has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Parameters

protocol

structure representing a supported protocol

 

param

a parameter name

 

Returns

a structure representing the parameter param , or NULL if not supported

Since: 0.7.26


tp_connection_manager_param_get_name ()

const gchar *
tp_connection_manager_param_get_name (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

the name of the parameter

Since: 0.7.26


tp_connection_manager_param_get_dbus_signature ()

const gchar *
tp_connection_manager_param_get_dbus_signature
                               (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

the D-Bus signature of the parameter

Since: 0.7.26


tp_connection_manager_param_dup_variant_type ()

GVariantType *
tp_connection_manager_param_dup_variant_type
                               (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

the GVariantType of the parameter.

[transfer full]

Since: 0.23.1


tp_connection_manager_param_is_required ()

gboolean
tp_connection_manager_param_is_required
                               (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

TRUE if the parameter is normally required

Since: 0.7.26


tp_connection_manager_param_is_required_for_registration ()

gboolean
tp_connection_manager_param_is_required_for_registration
                               (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

TRUE if the parameter is required when registering a new account (by setting the special "register" parameter to TRUE)

Since: 0.7.26


tp_connection_manager_param_is_secret ()

gboolean
tp_connection_manager_param_is_secret (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

TRUE if the parameter's value is a password or other secret

Since: 0.7.26


tp_connection_manager_param_is_dbus_property ()

gboolean
tp_connection_manager_param_is_dbus_property
                               (const TpConnectionManagerParam *param);

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

TRUE if the parameter represents a D-Bus property of the same name

Since: 0.7.26


tp_connection_manager_param_get_default ()

gboolean
tp_connection_manager_param_get_default
                               (const TpConnectionManagerParam *param,
                                GValue *value);

Get the default value for this parameter, if there is one. If FALSE is returned, value is left uninitialized.

Parameters

param

a parameter supported by a TpConnectionManager

 

value

pointer to an unset (all zeroes) GValue into which the default's type and value are written

 

Returns

TRUE if there is a default value

Since: 0.7.26


tp_connection_manager_param_dup_default_variant ()

GVariant *
tp_connection_manager_param_dup_default_variant
                               (const TpConnectionManagerParam *param);

Get the default value for this parameter.

Use g_variant_get_type() to check that the type is what you expect. For instance, a string parameter should have type G_VARIANT_TYPE_STRING.

Parameters

param

a parameter supported by a TpConnectionManager

 

Returns

the default value, or NULL if there is no default

Since: 0.19.0


tp_connection_manager_check_valid_name ()

gboolean
tp_connection_manager_check_valid_name
                               (const gchar *name,
                                GError **error);

Check that the given string is a valid connection manager name, i.e. that it consists entirely of ASCII letters, digits and underscores, and starts with a letter.

Parameters

name

a possible connection manager name

 

error

used to raise TP_ERROR_INVALID_ARGUMENT if FALSE is returned

 

Returns

TRUE if name is valid

Since: 0.7.1


tp_connection_manager_check_valid_protocol_name ()

gboolean
tp_connection_manager_check_valid_protocol_name
                               (const gchar *name,
                                GError **error);

Check that the given string is a valid protocol name, i.e. that it consists entirely of ASCII letters, digits and hyphen/minus, and starts with a letter.

Parameters

name

a possible protocol name

 

error

used to raise TP_ERROR_INVALID_ARGUMENT if FALSE is returned

 

Returns

TRUE if name is valid

Since: 0.7.1


tp_connection_manager_init_known_interfaces ()

void
tp_connection_manager_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpConnectionManager have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CONNECTION_MANAGER.

Since: 0.7.32


tp_connection_manager_param_copy ()

TpConnectionManagerParam *
tp_connection_manager_param_copy (const TpConnectionManagerParam *in);

Parameters

in

the TpConnectionManagerParam to copy

 

Returns

a newly (slice) allocated TpConnectionManagerParam, free with tp_connection_manager_param_free()

Since: 0.11.3


tp_connection_manager_param_free ()

void
tp_connection_manager_param_free (TpConnectionManagerParam *param);

Frees param , which was copied with tp_connection_manager_param_copy().

Parameters

param

the TpConnectionManagerParam to free

 

Since: 0.11.3


tp_connection_manager_protocol_copy ()

TpConnectionManagerProtocol *
tp_connection_manager_protocol_copy (const TpConnectionManagerProtocol *in);

tp_connection_manager_protocol_copy has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Parameters

in

the TpConnectionManagerProtocol to copy

 

Returns

a newly (slice) allocated TpConnectionManagerProtocol, free with tp_connection_manager_protocol_free()

Since: 0.11.3


tp_connection_manager_protocol_free ()

void
tp_connection_manager_protocol_free (TpConnectionManagerProtocol *proto);

tp_connection_manager_protocol_free has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Frees proto , which was copied with tp_connection_manager_protocol_copy().

Parameters

proto

the TpConnectionManagerProtocol to free

 

Since: 0.11.3


tp_cli_connection_manager_callback_for_get_parameters ()

void
(*tp_cli_connection_manager_callback_for_get_parameters)
                               (TpConnectionManager *proxy,
                                const GPtrArray *out_Parameters,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetParameters method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Parameters

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs representing possible parameters.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_manager_call_get_parameters ()

TpProxyPendingCall *
tp_cli_connection_manager_call_get_parameters
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                const gchar *in_Protocol,
                                tp_cli_connection_manager_callback_for_get_parameters callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetParameters method call.

Get a list of the parameters which may be specified in the <tp:dbus-ref namespace="ofdT.Account">Parameters</tp:dbus-ref> of an <tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> (or, for specialised applications which do not use the account manager, passed to <tp:member-ref>RequestConnection</tp:member-ref>). Some parameters are mandatory, and some parameters only make sense when registering new accounts with the server; see the <tp:type>Param_Spec</tp:type> documentation for more details.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Protocol

Used to pass an 'in' argument: The required protocol name

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_manager_run_get_parameters ()

gboolean
tp_cli_connection_manager_run_get_parameters
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                const gchar *in_Protocol,
                                GPtrArray **out_Parameters,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_manager_run_get_parameters is deprecated and should not be used in newly-written code.

Call the method GetParameters and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get a list of the parameters which may be specified in the <tp:dbus-ref namespace="ofdT.Account">Parameters</tp:dbus-ref> of an <tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> (or, for specialised applications which do not use the account manager, passed to <tp:member-ref>RequestConnection</tp:member-ref>). Some parameters are mandatory, and some parameters only make sense when registering new accounts with the server; see the <tp:type>Param_Spec</tp:type> documentation for more details.

Parameters

proxy

A TpConnectionManager or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Protocol

Used to pass an 'in' argument: The required protocol name

 

out_Parameters

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs representing possible parameters.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_manager_callback_for_list_protocols ()

void
(*tp_cli_connection_manager_callback_for_list_protocols)
                               (TpConnectionManager *proxy,
                                const gchar **out_Protocols,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListProtocols method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Protocols

Used to return an 'out' argument if error is NULL: The keys of the <tp:member-ref>Protocols</tp:member-ref> map.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_manager_call_list_protocols ()

TpProxyPendingCall *
tp_cli_connection_manager_call_list_protocols
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                tp_cli_connection_manager_callback_for_list_protocols callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListProtocols method call.

Get a list of protocol identifiers that are implemented by this connection manager.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_manager_run_list_protocols ()

gboolean
tp_cli_connection_manager_run_list_protocols
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                gchar ***out_Protocols,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_manager_run_list_protocols is deprecated and should not be used in newly-written code.

Call the method ListProtocols and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get a list of protocol identifiers that are implemented by this connection manager.

Parameters

proxy

A TpConnectionManager or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Protocols

Used to return an 'out' argument if TRUE is returned: The keys of the <tp:member-ref>Protocols</tp:member-ref> map.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_manager_callback_for_request_connection ()

void
(*tp_cli_connection_manager_callback_for_request_connection)
                               (TpConnectionManager *proxy,
                                const gchar *out_Bus_Name,
                                const gchar *out_Object_Path,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestConnection method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Bus_Name

Used to return an 'out' argument if error is NULL: A D-Bus service name where the new Connection object can be found

 

out_Object_Path

Used to return an 'out' argument if error is NULL: The D-Bus object path to the Connection on this service

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_manager_call_request_connection ()

TpProxyPendingCall *
tp_cli_connection_manager_call_request_connection
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                const gchar *in_Protocol,
                                GHashTable *in_Parameters,
                                tp_cli_connection_manager_callback_for_request_connection callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestConnection method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> object representing a given account on a given protocol with the given parameters. The method returns the bus name and the object path where the new Connection object can be found, which should have the status of Connection_Status_Disconnected, to allow signal handlers to be attached before connecting is started with the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">Connect</tp:dbus-ref> method.</p> <p><strong>Most applications should not use this method</strong>: they should instead use the the <tp:dbus-ref namespace="ofdT.Account">Connection</tp:dbus-ref> property on an <tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> object obtained from the <tp:dbus-ref namespace="ofdT">AccountManager</tp:dbus-ref>. This method is used internally by the account manager to create connections when needed.</p> <p>The parameters which must and may be provided in the parameters dictionary can be discovered with the <tp:member-ref>GetParameters</tp:member-ref> method. These parameters, their types, and their default values may be cached in files so that all available connection managers do not need to be started to discover which protocols are available.</p> <p>To request values for these parameters from the user, a client must have prior knowledge of the meaning of the parameter names, so the well-known names and types defined by the <tp:type>Connection_Parameter_Name</tp:type> type should be used where appropriate.</p> <p>Connection manager authors SHOULD avoid introducing parameters whose default values would not be serializable in a <code>.manager</code> file.</p> <tp:rationale> <p>The same serialization format is used in Mission Control to store accounts.</p> </tp:rationale> <p>Every successful RequestConnection call will cause the emission of a <tp:member-ref>NewConnection</tp:member-ref> signal for the same newly created connection. The requester can use the returned object path and service name independently of the emission of that signal. In that case this signal emission is most useful for, e.g. other processes that are monitoring the creation of new connections.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Protocol

Used to pass an 'in' argument: The protocol identifier

 

in_Parameters

Used to pass an 'in' argument: A dictionary mapping parameter names to values of the appropriate type, as indicated by <tp:member-ref>GetParameters</tp:member-ref> and the well-known list of names and value types documented on the <tp:type>Connection_Parameter_Name</tp:type> type.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_manager_run_request_connection ()

gboolean
tp_cli_connection_manager_run_request_connection
                               (TpConnectionManager *proxy,
                                gint timeout_ms,
                                const gchar *in_Protocol,
                                GHashTable *in_Parameters,
                                gchar **out_Bus_Name,
                                gchar **out_Object_Path,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_manager_run_request_connection is deprecated and should not be used in newly-written code.

Call the method RequestConnection and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> object representing a given account on a given protocol with the given parameters. The method returns the bus name and the object path where the new Connection object can be found, which should have the status of Connection_Status_Disconnected, to allow signal handlers to be attached before connecting is started with the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">Connect</tp:dbus-ref> method.</p> <p><strong>Most applications should not use this method</strong>: they should instead use the the <tp:dbus-ref namespace="ofdT.Account">Connection</tp:dbus-ref> property on an <tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> object obtained from the <tp:dbus-ref namespace="ofdT">AccountManager</tp:dbus-ref>. This method is used internally by the account manager to create connections when needed.</p> <p>The parameters which must and may be provided in the parameters dictionary can be discovered with the <tp:member-ref>GetParameters</tp:member-ref> method. These parameters, their types, and their default values may be cached in files so that all available connection managers do not need to be started to discover which protocols are available.</p> <p>To request values for these parameters from the user, a client must have prior knowledge of the meaning of the parameter names, so the well-known names and types defined by the <tp:type>Connection_Parameter_Name</tp:type> type should be used where appropriate.</p> <p>Connection manager authors SHOULD avoid introducing parameters whose default values would not be serializable in a <code>.manager</code> file.</p> <tp:rationale> <p>The same serialization format is used in Mission Control to store accounts.</p> </tp:rationale> <p>Every successful RequestConnection call will cause the emission of a <tp:member-ref>NewConnection</tp:member-ref> signal for the same newly created connection. The requester can use the returned object path and service name independently of the emission of that signal. In that case this signal emission is most useful for, e.g. other processes that are monitoring the creation of new connections.</p>

Parameters

proxy

A TpConnectionManager or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Protocol

Used to pass an 'in' argument: The protocol identifier

 

in_Parameters

Used to pass an 'in' argument: A dictionary mapping parameter names to values of the appropriate type, as indicated by <tp:member-ref>GetParameters</tp:member-ref> and the well-known list of names and value types documented on the <tp:type>Connection_Parameter_Name</tp:type> type.

 

out_Bus_Name

Used to return an 'out' argument if TRUE is returned: A D-Bus service name where the new Connection object can be found

 

out_Object_Path

Used to return an 'out' argument if TRUE is returned: The D-Bus object path to the Connection on this service

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_manager_signal_callback_new_connection ()

void
(*tp_cli_connection_manager_signal_callback_new_connection)
                               (TpConnectionManager *proxy,
                                const gchar *arg_Bus_Name,
                                const gchar *arg_Object_Path,
                                const gchar *arg_Protocol,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewConnection.

Parameters

proxy

The proxy on which tp_cli_connection_manager_connect_to_new_connection() was called

 

arg_Bus_Name

The D-Bus service where the connection object can be found

 

arg_Object_Path

The object path of the Connection object on this service

 

arg_Protocol

The identifier for the protocol this connection uses

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_manager_connect_to_new_connection ()

TpProxySignalConnection *
tp_cli_connection_manager_connect_to_new_connection
                               (TpConnectionManager *proxy,
                                tp_cli_connection_manager_signal_callback_new_connection callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewConnection.

Emitted when a new <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> object is created.

Parameters

proxy

A TpConnectionManager or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

Types and Values

struct TpConnectionManager

struct TpConnectionManager;

A proxy object for a Telepathy connection manager.

This might represent a connection manager which is currently running (in which case it can be introspected) or not (in which case its capabilities can be read from .manager files in the filesystem). Accordingly, this object never emits “invalidated” unless all references to it are discarded.

Various fields and methods on this object do not work until TP_CONNECTION_MANAGER_FEATURE_CORE is prepared. Use tp_proxy_prepare_async() to wait for this to happen.

Since 0.19.1, accessing the fields of this struct is deprecated, and they are no longer documented here. Use the accessors tp_connection_manager_get_name(), tp_connection_manager_is_running(), tp_connection_manager_dup_protocols(), tp_connection_manager_get_info_source() and the “always-introspect” property instead.

Since: 0.7.1


struct TpConnectionManagerClass

struct TpConnectionManagerClass {
};

The class of a TpConnectionManager.

Since: 0.7.1


TP_CONNECTION_MANAGER_FEATURE_CORE

#define             TP_CONNECTION_MANAGER_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpConnectionManager.

After this feature is prepared, basic information about the connection manager's protocols (tp_connection_manager_dup_protocols()), and their available parameters, will have been retrieved, either by activating the connection manager over D-Bus or by reading the .manager file in which that information is cached.

Since 0.11.11, this feature also finds any extra interfaces that this connection manager has, and adds them to “interfaces” (where they can be queried with tp_proxy_has_interface()).

(These are the same guarantees offered by the older tp_connection_manager_call_when_ready() mechanism.)

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


enum TpCMInfoSource

Describes possible sources of information on connection managers' supported protocols.

Since 0.11.5, there is a corresponding GEnumClass type, TP_TYPE_CM_INFO_SOURCE.

Members

TP_CM_INFO_SOURCE_NONE

no information available

 

TP_CM_INFO_SOURCE_FILE

information came from a .manager file

 

TP_CM_INFO_SOURCE_LIVE

information came from the connection manager

 

Since: 0.7.1


TP_TYPE_CM_INFO_SOURCE

#define TP_TYPE_CM_INFO_SOURCE (tp_cm_info_source_get_type ())

The GEnumClass type of a TpCMInfoSource.

Since: 0.11.5


struct TpConnectionManagerProtocol

struct TpConnectionManagerProtocol {
  gchar *name;
  TpConnectionManagerParam *params;
};

TpConnectionManagerProtocol has been deprecated since version 0.19.1 and should not be used in newly-written code.

, use TpProtocol objects instead

Structure representing a protocol supported by a connection manager. Note that the size of this structure may change, so its size must not be relied on.

Members

gchar *name;

The name of this connection manager

 

TpConnectionManagerParam *params;

Array of TpConnectionManagerParam structures, terminated by a structure whose name is NULL

 

Since: 0.7.1


struct TpConnectionManagerParam

struct TpConnectionManagerParam {
};

Structure representing a connection manager parameter.

Since 0.19.1, accessing the fields of this struct is deprecated, and they are no longer documented here. Use the accessors tp_connection_manager_param_get_name(), tp_connection_manager_param_get_dbus_signature(), tp_connection_manager_param_is_required(), tp_connection_manager_param_is_required_for_registration(), tp_connection_manager_param_is_secret(), tp_connection_manager_param_is_dbus_property(), tp_connection_manager_param_get_default(), tp_connection_manager_param_dup_default_variant() instead.

Since: 0.7.1

Property Details

The “always-introspect” property

  “always-introspect”        gboolean

If TRUE, always introspect the connection manager as it comes online, even if we already have its info from a .manager file. Default FALSE.

Owner: TpConnectionManager

Flags: Read / Write

Default value: FALSE


The “cm-name” property

  “cm-name”                  gchar *

The name of the connection manager, e.g. "gabble" (read-only).

Owner: TpConnectionManager

Flags: Read

Default value: NULL

Since: 0.19.3


The “connection-manager” property

  “connection-manager”       gchar *

The name of the connection manager, e.g. "gabble" (read-only).

TpConnectionManager:connection-manager is deprecated and should not be used in newly-written code.

Use “cm-name” instead.

Owner: TpConnectionManager

Flags: Read

Default value: NULL


The “info-source” property

  “info-source”              guint

Where we got the current information on supported protocols (a TpCMInfoSource).

Since 0.7.26, the “notify” signal is emitted for this property.

(Note that this is of type G_TYPE_UINT, not TP_TYPE_CM_INFO_SOURCE, for historical reasons.)

Owner: TpConnectionManager

Flags: Read

Allowed values: <= 2

Default value: 0


The “manager-file” property

  “manager-file”             gchar *

The absolute path of the .manager file. If set to NULL (the default), the XDG data directories will be searched for a .manager file of the correct name.

If set to the empty string, no .manager file will be read.

Owner: TpConnectionManager

Flags: Read / Write / Construct

Default value: NULL

Signal Details

The “activated” signal

void
user_function (TpConnectionManager *self,
               gpointer             user_data)

Emitted when the connection manager's well-known name appears on the bus.

Parameters

self

the connection manager proxy

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “exited” signal

void
user_function (TpConnectionManager *self,
               gpointer             user_data)

Emitted when the connection manager's well-known name disappears from the bus or when activation fails.

Parameters

self

the connection manager proxy

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “got-info” signal

void
user_function (TpConnectionManager *self,
               guint                source,
               gpointer             user_data)

Emitted when the connection manager's capabilities have been discovered.

This signal is not very helpful. Using tp_proxy_prepare_async() instead is recommended.

Parameters

self

the connection manager proxy

 

source

a TpCMInfoSource

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-caps.html0000644000175000017500000017304014006623344024154 00000000000000 Connection ContactCapabilities and Capabilities interfaces: telepathy-glib API Reference Manual

Connection ContactCapabilities and Capabilities interfaces

Connection ContactCapabilities and Capabilities interfaces — client-side wrappers for the capabilities interfaces

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some instant messaging protocols allow discovery of the capabilities of a user's client. In Telepathy, this is represented by the ContactCapabilities interface, which lets applications advertise extra capabilities for the local user, and query the interfaces supported by their contacts.

The Capabilities interface is an older API with similar functionality.

This section documents the auto-generated C wrappers for the ContactCapabilities and Capabilities interfaces, used with TpConnection objects.

Functions

tp_cli_connection_interface_contact_capabilities_callback_for_get_contact_capabilities ()

void
(*tp_cli_connection_interface_contact_capabilities_callback_for_get_contact_capabilities)
                               (TpConnection *proxy,
                                GHashTable *out_Contact_Capabilities,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactCapabilities method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Contact_Capabilities

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A map from contact handles to lists of requestable channel classes, representing the channel requests that are expected to succeed for that contact.</p> <p>Contacts listed among Handles whose capabilities are unknown SHOULD be omitted from this map; contacts known to have an empty set of capabilities SHOULD be included in the keys of this map, with an empty array as the corresponding value.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_capabilities_call_get_contact_capabilities ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_capabilities_call_get_contact_capabilities
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                tp_cli_connection_interface_contact_capabilities_callback_for_get_contact_capabilities callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactCapabilities method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Returns an array of requestable channel classes for the given contact handles, representing the channel requests that are expected to succeed.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handles

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of contact handles for this connection.</p> <p>The handle zero MUST NOT be included in the request.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_capabilities_callback_for_update_capabilities ()

void
(*tp_cli_connection_interface_contact_capabilities_callback_for_update_capabilities)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UpdateCapabilities method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_capabilities_call_update_capabilities ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_capabilities_call_update_capabilities
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Handler_Capabilities,
                                tp_cli_connection_interface_contact_capabilities_callback_for_update_capabilities callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a UpdateCapabilities method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Alter the connection's advertised capabilities to include the intersection of the given clients' capabilities with what the connection manager is able to implement.</p> <p>On connections managed by the ChannelDispatcher, processes other than the ChannelDispatcher SHOULD NOT call this method, and the ChannelDispatcher SHOULD use this method to advertise the capabilities of all the registered <tp:dbus-ref namespace="org.freedesktop.Telepathy">Client.Handler</tp:dbus-ref> implementations.On connections not managed by the ChannelDispatcher, clients MAY use this method directly, to indicate the channels they will handle and the extra capabilities they have.</p> <p>Upon a successful invocation of this method, the connection manager will only emit the <tp:member-ref>ContactCapabilitiesChanged</tp:member-ref> signal for the user's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">SelfHandle</tp:dbus-ref> if, in the underlying protocol, the new capabilities are distinct from the previous state.</p> <tp:rationale> <p>The connection manager will essentially intersect the provided capabilities and the channel classes it implements. Therefore, certain properties which are never fixed for a channel class (such as the target handle, or the Parameters property of a tube channel) will almost certainly not be advertised.</p> </tp:rationale> <p>This method MAY be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the appropriate capabilities. Doing so MUST NOT fail.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handler_Capabilities

Used to pass an 'in' argument: <p>The capabilities of one or more clients.</p> <p>For each client in the given list, any capabilities previously advertised for the same client name are discarded, then replaced by the capabilities indicated.</p> <p>As a result, if a client becomes unavailable, this method SHOULD be called with a <tp:type>Handler_Capabilities</tp:type> structure containing its name, an empty list of channel classes, and an empty list of capabilities. When this is done, the connection manager SHOULD free all memory associated with that client name.</p> <tp:rationale> <p>This method takes a list of clients so that when the channel dispatcher first calls it (with a list of all the Handlers that are initially available), the changes can be made atomically, with only one transmission of updated capabilities to the network. Afterwards, the channel dispatcher will call this method with a single-element list every time a Handler becomes available or unavailable.</p> </tp:rationale> <p>The connection manager MUST ignore any channel classes and client capabilities for which there is no representation in the protocol or no support in the connection manager.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_capabilities_signal_callback_contact_capabilities_changed ()

void
(*tp_cli_connection_interface_contact_capabilities_signal_callback_contact_capabilities_changed)
                               (TpConnection *proxy,
                                GHashTable *arg_caps,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContactCapabilitiesChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed() was called

 

arg_caps

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> All the capabilities of the contacts

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_capabilities_signal_callback_contact_capabilities_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContactCapabilitiesChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Announce that there has been a change of capabilities on the given handles. A single signal can be emitted for several contacts.</p> <tp:rationale> <p>The underlying protocol can get several contacts' capabilities at the same time.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_capabilities_call_advertise_capabilities ()

TpProxyPendingCall *
tp_cli_connection_interface_capabilities_call_advertise_capabilities
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Add,
                                const gchar **in_Remove,
                                tp_cli_connection_interface_capabilities_callback_for_advertise_capabilities callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AdvertiseCapabilities method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Used by user interfaces to indicate which channel types they are able to handle on this connection. Because these may be provided by different client processes, this method accepts channel types to add and remove from the set already advertised on this connection. The type of advertised capabilities (create versus invite) is protocol-dependent and hence cannot be set by the this method. In the case of a client adding an already advertised channel type but with new channel type specific flags, the connection manager should simply add the new flags to the set of advertised capabilities.</p> <p>Upon a successful invocation of this method, the <tp:member-ref>CapabilitiesChanged</tp:member-ref> signal will be emitted for the user's own handle ( <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.GetSelfHandle</tp:dbus-ref>) by the connection manager to indicate the changes that have been made. This signal should also be monitored to ensure that the set is kept accurate - for example, a client may remove capabilities or type specific capability flags when it exits which are still provided by another client.</p> <p>On connections managed by the <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatcher</tp:dbus-ref>, this method SHOULD NOT be used by clients other than the ChannelDispatcher itself.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Add

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structures containing: <ul> <li>a string channel type</li> <li>a bitwise OR of type specific capability flags</li> </ul>

 

in_Remove

Used to pass an 'in' argument: An array of D-Bus interface names of channel types to remove

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_capabilities_call_get_capabilities ()

TpProxyPendingCall *
tp_cli_connection_interface_capabilities_call_get_capabilities
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                tp_cli_connection_interface_capabilities_callback_for_get_capabilities callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetCapabilities method call.

Returns an array of capabilities for the given contact handles.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handles

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of contact handles for this connection.</p> <p>This may include zero, which originally meant a query for capabilities available on the connection itself. This usage is deprecated; clients SHOULD NOT do this, and connection managers SHOULD proceed as though zero had not been present in this list.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_capabilities_callback_for_advertise_capabilities ()

void
(*tp_cli_connection_interface_capabilities_callback_for_advertise_capabilities)
                               (TpConnection *proxy,
                                const GPtrArray *out_Self_Capabilities,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AdvertiseCapabilities method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Self_Capabilities

Used to return an 'out' argument if error is NULL: An array of structures describing the current capabilities containing: <ul> <li>a string channel type</li> <li>a bitwise OR of type specific capability flags</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_capabilities_callback_for_get_capabilities ()

void
(*tp_cli_connection_interface_capabilities_callback_for_get_capabilities)
                               (TpConnection *proxy,
                                const GPtrArray *out_Contact_Capabilities,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetCapabilities method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Contact_Capabilities

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structures containing: <ul> <li>an integer handle representing the contact</li> <li>a string channel type</li> <li>a bitwise OR of generic capability flags for the type</li> <li>a bitwise OR of type specific capability flags for the type</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_capabilities_connect_to_capabilities_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_capabilities_connect_to_capabilities_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_capabilities_signal_callback_capabilities_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal CapabilitiesChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Announce that there has been a change of capabilities on the given handle.</p> <p>If the handle is zero, the capabilities refer to the connection itself, in some poorly defined way. This usage is deprecated and clients should ignore it.</p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_capabilities_signal_callback_capabilities_changed ()

void
(*tp_cli_connection_interface_capabilities_signal_callback_capabilities_changed)
                               (TpConnection *proxy,
                                const GPtrArray *arg_Caps,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal CapabilitiesChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_capabilities_connect_to_capabilities_changed() was called

 

arg_Caps

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structures containing: <ul> <li>an integer handle representing the contact</li> <li>a string channel type</li> <li>a bitwise OR of the contact's old generic capability flags</li> <li>a bitwise OR of the contact's new generic capability flags</li> <li>a bitwise OR of the contact's old type specific capability flags</li> <li>a bitwise OR of the contact's new type specific capability flags</li> </ul>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-contact.html0000644000175000017500000066531514006623344022537 00000000000000 TpContact: telepathy-glib API Reference Manual

TpContact

TpContact — object representing a contact

Functions

void (*TpConnectionContactsByHandleCb) ()
TpContact * tp_connection_dup_contact_if_possible ()
void tp_connection_get_contacts_by_handle ()
void (*TpConnectionContactsByIdCb) ()
void tp_connection_get_contacts_by_id ()
void (*TpConnectionUpgradeContactsCb) ()
void tp_connection_upgrade_contacts ()
void tp_connection_refresh_contact_info ()
const gchar * tp_contact_get_alias ()
const gchar * tp_contact_get_avatar_token ()
GFile * tp_contact_get_avatar_file ()
const gchar * tp_contact_get_avatar_mime_type ()
const gchar * const * tp_contact_get_client_types ()
TpAccount * tp_contact_get_account ()
TpConnection * tp_contact_get_connection ()
TpHandle tp_contact_get_handle ()
const gchar * tp_contact_get_identifier ()
const gchar * tp_contact_get_presence_message ()
const gchar * tp_contact_get_presence_status ()
TpConnectionPresenceType tp_contact_get_presence_type ()
GHashTable * tp_contact_get_location ()
GVariant * tp_contact_dup_location ()
TpCapabilities * tp_contact_get_capabilities ()
GList * tp_contact_get_contact_info ()
GList * tp_contact_dup_contact_info ()
gboolean tp_contact_is_blocked ()
void tp_contact_request_contact_info_async ()
gboolean tp_contact_request_contact_info_finish ()
TpSubscriptionState tp_contact_get_subscribe_state ()
TpSubscriptionState tp_contact_get_publish_state ()
const gchar * tp_contact_get_publish_request ()
const gchar * const * tp_contact_get_contact_groups ()
void tp_contact_set_contact_groups_async ()
gboolean tp_contact_set_contact_groups_finish ()
gboolean tp_contact_has_feature ()
void tp_connection_dup_contact_by_id_async ()
TpContact * tp_connection_dup_contact_by_id_finish ()
void tp_connection_upgrade_contacts_async ()
gboolean tp_connection_upgrade_contacts_finish ()
void tp_contact_request_subscription_async ()
gboolean tp_contact_request_subscription_finish ()
void tp_contact_authorize_publication_async ()
gboolean tp_contact_authorize_publication_finish ()
void tp_contact_remove_async ()
gboolean tp_contact_remove_finish ()
void tp_contact_unsubscribe_async ()
gboolean tp_contact_unsubscribe_finish ()
void tp_contact_unpublish_async ()
gboolean tp_contact_unpublish_finish ()
void tp_contact_add_to_group_async ()
gboolean tp_contact_add_to_group_finish ()
void tp_contact_remove_from_group_async ()
gboolean tp_contact_remove_from_group_finish ()
void tp_contact_block_async ()
gboolean tp_contact_block_finish ()
void tp_contact_unblock_async ()
gboolean tp_contact_unblock_finish ()

Properties

gchar * alias Read
GFile * avatar-file Read
gchar * avatar-mime-type Read
gchar * avatar-token Read
TpCapabilities * capabilities Read
GStrv client-types Read
TpConnection * connection Read
GStrv contact-groups Read
TpContactInfoList * contact-info Read
guint handle Read
gchar * identifier Read
gboolean is-blocked Read
GHashTable_gchararray+GValue_* location Read
GVariant * location-vardict Read
gchar * presence-message Read
gchar * presence-status Read
guint presence-type Read
gchar * publish-request Read
guint publish-state Read
guint subscribe-state Read

Signals

void contact-groups-changed Run Last
void presence-changed Run Last
void subscription-states-changed Run Last

Object Hierarchy

    GEnum
    ╰── TpContactFeature
    GObject
    ╰── TpContact

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpContact objects represent the contacts on a particular TpConnection.

Functions

TpConnectionContactsByHandleCb ()

void
(*TpConnectionContactsByHandleCb) (TpConnection *connection,
                                   guint n_contacts,
                                   TpContact * const *contacts,
                                   guint n_failed,
                                   const TpHandle *failed,
                                   const GError *error,
                                   gpointer user_data,
                                   GObject *weak_object);

TpConnectionContactsByHandleCb is deprecated and should not be used in newly-written code.

Signature of a callback used to receive the result of tp_connection_get_contacts_by_handle().

If an unrecoverable error occurs (for instance, if connection becomes disconnected) the whole operation fails, and no contacts or invalid handles are returned.

If some or even all of the handles passed to tp_connection_get_contacts_by_handle() were not valid, this is not considered to be a failure. error will be NULL in this situation, contacts will contain contact objects for those handles that were valid (possibly none of them), and invalid will contain the handles that were not valid.

Parameters

connection

The connection

 

n_contacts

The number of TpContact objects successfully created (one per valid handle), or 0 on unrecoverable errors

 

contacts

An array of n_contacts TpContact objects (this callback is not given a reference to any of these objects, and must call g_object_ref() on any that it will keep), or NULL on unrecoverable errors.

[array length=n_contacts]

n_failed

The number of invalid handles that were passed to tp_connection_get_contacts_by_handle() (or on unrecoverable errors, the total number of handles that were given)

 

failed

An array of n_failed handles that were passed to tp_connection_get_contacts_by_handle() but turned out to be invalid (or on unrecoverable errors, all the handles that were given).

[array length=n_failed]

error

NULL on success, or an unrecoverable error that caused everything to fail

 

user_data

the user_data that was passed to tp_connection_get_contacts_by_handle()

 

weak_object

the weak_object that was passed to tp_connection_get_contacts_by_handle()

 

Since: 0.7.18


tp_connection_dup_contact_if_possible ()

TpContact *
tp_connection_dup_contact_if_possible (TpConnection *connection,
                                       TpHandle handle,
                                       const gchar *identifier);

Try to return an existing contact object or create a new contact object immediately.

If tp_connection_has_immortal_handles() would return TRUE and identifier is non-NULL, this function always succeeds.

On connections without immortal handles, it is not possible to guarantee that handle remains valid without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_id().

Similarly, if identifier is NULL, it might not be possible to find the identifier for handle without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_handle().

Parameters

connection

a connection

 

handle

a handle of type TP_HANDLE_TYPE_CONTACT

 

identifier

the normalized identifier (XMPP JID, etc.) corresponding to handle , or NULL if not known.

[transfer none]

Returns

a contact or NULL.

[transfer full]

Since: 0.13.9


tp_connection_get_contacts_by_handle ()

void
tp_connection_get_contacts_by_handle (TpConnection *self,
                                      guint n_handles,
                                      const TpHandle *handles,
                                      guint n_features,
                                      const TpContactFeature *features,
                                      TpConnectionContactsByHandleCb callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

tp_connection_get_contacts_by_handle is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_contact() instead.

Create a number of TpContact objects and make asynchronous method calls to hold their handles and ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

n_handles

The number of handles in handles (must be at least 1)

 

handles

An array of handles of type TP_HANDLE_TYPE_CONTACT representing the desired contacts.

[array length=n_handles][element-type uint]

n_features

The number of features in features (may be 0)

 

features

An array of features that must be ready for use (if supported) before the callback is called (may be NULL if n_features is 0).

[array length=n_features][allow-none][element-type uint]

callback

A user callback to call when the contacts are ready

 

user_data

Data to pass to the callback

 

destroy

Called to destroy user_data either after callback has been called, or if the operation is cancelled

 

weak_object

An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled.

[allow-none]

Since: 0.7.18


TpConnectionContactsByIdCb ()

void
(*TpConnectionContactsByIdCb) (TpConnection *connection,
                               guint n_contacts,
                               TpContact * const *contacts,
                               const gchar * const *requested_ids,
                               GHashTable *failed_id_errors,
                               const GError *error,
                               gpointer user_data,
                               GObject *weak_object);

TpConnectionContactsByIdCb is deprecated and should not be used in newly-written code.

Signature of a callback used to receive the result of tp_connection_get_contacts_by_id().

requested_ids contains the IDs that were converted to handles successfully. The normalized form of requested_ids[i] is tp_contact_get_identifier (contacts[i]).

If some or even all of the ids passed to tp_connection_get_contacts_by_id() were not valid, this is not considered to be a fatal error. error will be NULL in this situation, contacts will contain contact objects for those IDs that were valid (it may be empty), and failed_id_errors will map the IDs that were not valid to a corresponding GError (if the connection manager complies with the Telepathy spec, it will have domain TP_ERROR and code TP_ERROR_INVALID_HANDLE).

If an unrecoverable error occurs (for instance, if connection becomes disconnected) the whole operation fails, and no contacts or requested IDs are returned. failed_id_errors will contain all the IDs that were requested, mapped to a corresponding GError (either one indicating that the ID was invalid, if that was determined before the fatal error occurred, or a copy of error ).

Parameters

connection

The connection

 

n_contacts

The number of TpContact objects successfully created (one per valid ID), or 0 on unrecoverable errors

 

contacts

An array of n_contacts TpContact objects (this callback is not given a reference to any of these objects, and must call g_object_ref() on any that it will keep), or NULL on unrecoverable errors.

[array length=n_contacts]

requested_ids

An array of n_contacts valid IDs (JIDs, SIP URIs etc.) that were passed to tp_connection_get_contacts_by_id(), in an order corresponding to contacts , or NULL on unrecoverable errors.

[array length=n_contacts]

failed_id_errors

A hash table in which the keys are IDs and the values are errors (GError).

[element-type utf8 GLib.Error]

error

NULL on success, or an unrecoverable error that caused everything to fail

 

user_data

the user_data that was passed to tp_connection_get_contacts_by_id()

 

weak_object

the weak_object that was passed to tp_connection_get_contacts_by_id()

 

Since: 0.7.18


tp_connection_get_contacts_by_id ()

void
tp_connection_get_contacts_by_id (TpConnection *self,
                                  guint n_ids,
                                  const gchar * const *ids,
                                  guint n_features,
                                  const TpContactFeature *features,
                                  TpConnectionContactsByIdCb callback,
                                  gpointer user_data,
                                  GDestroyNotify destroy,
                                  GObject *weak_object);

tp_connection_get_contacts_by_id is deprecated and should not be used in newly-written code.

Use tp_connection_dup_contact_by_id_async() instead.

Create a number of TpContact objects and make asynchronous method calls to obtain their handles and ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

n_ids

The number of IDs in ids (must be at least 1)

 

ids

An array of strings representing the desired contacts by their identifiers in the IM protocol (XMPP JIDs, SIP URIs, MSN Passports, AOL screen-names etc.).

[array length=n_ids][transfer none]

n_features

The number of features in features (may be 0)

 

features

An array of features that must be ready for use (if supported) before the callback is called (may be NULL if n_features is 0).

[array length=n_features][allow-none]

callback

A user callback to call when the contacts are ready

 

user_data

Data to pass to the callback

 

destroy

Called to destroy user_data either after callback has been called, or if the operation is cancelled

 

weak_object

An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled.

[allow-none]

Since: 0.7.18


TpConnectionUpgradeContactsCb ()

void
(*TpConnectionUpgradeContactsCb) (TpConnection *connection,
                                  guint n_contacts,
                                  TpContact * const *contacts,
                                  const GError *error,
                                  gpointer user_data,
                                  GObject *weak_object);

TpConnectionUpgradeContactsCb is deprecated and should not be used in newly-written code.

Signature of a callback used to receive the result of tp_connection_upgrade_contacts().

If an unrecoverable error occurs (for instance, if connection becomes disconnected) it is indicated by error , but the contacts in contacts are still provided.

Parameters

connection

The connection

 

n_contacts

The number of TpContact objects for which an upgrade was requested

 

contacts

An array of n_contacts TpContact objects (this callback is not given an extra reference to any of these objects, and must call g_object_ref() on any that it will keep).

[array length=n_contacts]

error

An unrecoverable error, or NULL if the connection remains valid

 

user_data

the user_data that was passed to tp_connection_upgrade_contacts()

 

weak_object

the weak_object that was passed to tp_connection_upgrade_contacts()

 

Since: 0.7.18


tp_connection_upgrade_contacts ()

void
tp_connection_upgrade_contacts (TpConnection *self,
                                guint n_contacts,
                                TpContact * const *contacts,
                                guint n_features,
                                const TpContactFeature *features,
                                TpConnectionUpgradeContactsCb callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_connection_upgrade_contacts is deprecated and should not be used in newly-written code.

Use tp_connection_upgrade_contacts_async() instead.

Given several TpContact objects, make asynchronous method calls ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

n_features

The number of features in features (must be at least 1)

 

features

An array of features that must be ready for use (if supported) before the callback is called.

[array length=n_features]

callback

A user callback to call when the contacts are ready

 

user_data

Data to pass to the callback

 

destroy

Called to destroy user_data either after callback has been called, or if the operation is cancelled

 

weak_object

An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled.

[allow-none]

Since: 0.7.18


tp_connection_refresh_contact_info ()

void
tp_connection_refresh_contact_info (TpConnection *self,
                                    guint n_contacts,
                                    TpContact * const *contacts);

Requests to refresh the “contact-info” property on each contact from contacts , requesting it from the network if an up-to-date version is not cached locally. "notify::contact-info" will be emitted when the contact's information are updated.

If TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on a contact, it will be set before its property gets updated.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

Since: 0.11.7


tp_contact_get_alias ()

const gchar *
tp_contact_get_alias (TpContact *self);

Return the contact's alias. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL alias as the “alias”

Since: 0.7.18


tp_contact_get_avatar_token ()

const gchar *
tp_contact_get_avatar_token (TpContact *self);

Return the contact's avatar token. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same token as the “avatar-token” property (possibly NULL)

Since: 0.7.18


tp_contact_get_avatar_file ()

GFile *
tp_contact_get_avatar_file (TpContact *self);

Return the contact's avatar file. This remains valid until the main loop is re-entered; if the caller requires a GFile that will persist for longer than that, it must be reffed with g_object_ref().

Parameters

self

a contact

 

Returns

the same GFile as the “avatar-file” property (possibly NULL).

[transfer none]

Since: 0.11.6


tp_contact_get_avatar_mime_type ()

const gchar *
tp_contact_get_avatar_mime_type (TpContact *self);

Return the contact's avatar MIME type. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same MIME type as the “avatar-mime-type” property (possibly NULL)

Since: 0.11.6


tp_contact_get_client_types ()

const gchar * const *
tp_contact_get_client_types (TpContact *self);

Return the contact's client types or NULL if the client types are unspecified.

Parameters

self

a contact

 

Returns

the same GStrv as the “client-types” property.

[array zero-terminated=1][transfer none]

Since: 0.13.1


tp_contact_get_account ()

TpAccount *
tp_contact_get_account (TpContact *self);

Return the TpAccount of self 's “connection”. See tp_connection_get_account() for details.

Parameters

self

a contact

 

Returns

a borrowed reference to self 's account (it must be referenced with g_object_ref if it must remain valid longer than the contact).

[transfer none]

Since: 0.19.0


tp_contact_get_connection ()

TpConnection *
tp_contact_get_connection (TpContact *self);

Parameters

self

a contact

 

Returns

a borrowed reference to the “connection” (it must be referenced with g_object_ref if it must remain valid longer than the contact).

[transfer none]

Since: 0.7.18


tp_contact_get_handle ()

TpHandle
tp_contact_get_handle (TpContact *self);

Return the contact's handle, which is of type TP_HANDLE_TYPE_CONTACT, or 0 if the “connection” has become invalid.

This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as self exists and the “connection” remains valid.

However, the caller of this function does not gain an additional reference to the handle.

Parameters

self

a contact

 

Returns

the same handle as the “handle” property

Since: 0.7.18


tp_contact_get_identifier ()

const gchar *
tp_contact_get_identifier (TpContact *self);

Return the contact's identifier. This remains valid for as long as self exists; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL identifier as the “identifier” property

Since: 0.7.18


tp_contact_get_presence_message ()

const gchar *
tp_contact_get_presence_message (TpContact *self);

Return the contact's user-defined status message, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL message as the “presence-message” property

Since: 0.7.18


tp_contact_get_presence_status ()

const gchar *
tp_contact_get_presence_status (TpContact *self);

Return the name of the contact's presence status, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL status name as the “presence-status” property

Since: 0.7.18


tp_contact_get_presence_type ()

TpConnectionPresenceType
tp_contact_get_presence_type (TpContact *self);

If this object has been set up to track TP_CONTACT_FEATURE_PRESENCE and the underlying connection supports either the Presence or SimplePresence interfaces, return the type of the contact's presence.

Otherwise, return TP_CONNECTION_PRESENCE_TYPE_UNSET.

Parameters

self

a contact

 

Returns

the same presence type as the “presence-type” property

Since: 0.7.18


tp_contact_get_location ()

GHashTable *
tp_contact_get_location (TpContact *self);

Return the contact's user-defined location or NULL if the location is unspecified. This remains valid until the main loop is re-entered; if the caller requires a hash table that will persist for longer than that, it must be reffed with g_hash_table_ref().

Parameters

self

a contact

 

Returns

the same GHashTable (or NULL) as the “location” property.

[element-type utf8 GObject.Value][transfer none]

Since: 0.11.1


tp_contact_dup_location ()

GVariant *
tp_contact_dup_location (TpContact *self);

Return the contact's user-defined location, or NULL if the location is unspecified.

This function returns the same information as tp_contact_get_location(), but in a different format.

Parameters

self

a contact

 

Returns

a variant of type G_VARIANT_TYPE_VARDICT, the same as the “location-vardict” property

Since: 0.19.10


tp_contact_get_capabilities ()

TpCapabilities *
tp_contact_get_capabilities (TpContact *self);

Parameters

self

a contact

 

Returns

the same TpCapabilities (or NULL) as the “capabilities” property.

[transfer none]

Since: 0.11.3


tp_contact_get_contact_info ()

GList *
tp_contact_get_contact_info (TpContact *self);

tp_contact_get_contact_info is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_contact_dup_contact_info() instead.

Returns a newly allocated GList of contact's vCard fields. The list must be freed with g_list_free() after used.

Note that the TpContactInfoFields in the returned GList are not dupped before returning from this function. One could copy every item in the list using tp_contact_info_field_copy().

Same as the “contact-info” property.

Parameters

self

a TpContact

 

Returns

a GList of TpContactInfoField, or NULL if the feature is not yet prepared.

[element-type TelepathyGLib.ContactInfoField][transfer container]

Since: 0.11.7


tp_contact_dup_contact_info ()

GList *
tp_contact_dup_contact_info (TpContact *self);

Returns a newly allocated GList of contact's vCard fields. The list must be freed with tp_contact_info_list_free() after used.

Same as the “contact-info” property.

Parameters

self

a TpContact

 

Returns

a GList of TpContactInfoField, or NULL if the feature is not yet prepared.

[element-type TelepathyGLib.ContactInfoField][transfer full]

Since: 0.19.9


tp_contact_is_blocked ()

gboolean
tp_contact_is_blocked (TpContact *self);

Parameters

self

a TpContact

 

Returns

the value of “is-blocked”.

Since: 0.17.0


tp_contact_request_contact_info_async ()

void
tp_contact_request_contact_info_async (TpContact *self,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Requests an asynchronous request of the contact info of self . When the operation is finished, callback will be called. You can then call tp_contact_request_contact_info_finish() to get the result of the operation.

If the operation is successful, the “contact-info” property will be updated (emitting "notify::contact-info" signal) before callback is called. That means you can call tp_contact_get_contact_info() to get the new vCard inside callback .

Note that requesting the vCard from the network can take significant time, so a bigger timeout is set on the underlying D-Bus call. cancellable can be cancelled to free resources used in the D-Bus call if the caller is no longer interested in the vCard.

If TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on self , it will be set before its property gets updated and callback is called.

Parameters

self

a TpContact

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.7


tp_contact_request_contact_info_finish ()

gboolean
tp_contact_request_contact_info_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async request of self info. If the operation was successful, the contact's vCard can be accessed using tp_contact_get_contact_info().

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the request call was successful, otherwise FALSE

Since: 0.11.7


tp_contact_get_subscribe_state ()

TpSubscriptionState
tp_contact_get_subscribe_state (TpContact *self);

Return the state of the local user's subscription to this remote contact's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Parameters

self

a TpContact

 

Returns

the value of “subscribe-state”.

Since: 0.13.12


tp_contact_get_publish_state ()

TpSubscriptionState
tp_contact_get_publish_state (TpContact *self);

Return the state of this remote contact's subscription to the local user's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Parameters

self

a TpContact

 

Returns

the value of “publish-state”.

Since: 0.13.12


tp_contact_get_publish_request ()

const gchar *
tp_contact_get_publish_request (TpContact *self);

If “publish-state” is set to TP_SUBSCRIPTION_STATE_ASK, return the message that this remote contact sent when they requested permission to see the local user's presence, an empty string ("") otherwise. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

This is set to NULL until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-NULL afterward.

Parameters

self

a TpContact

 

Returns

the value of “publish-request”.

Since: 0.13.12


tp_contact_get_contact_groups ()

const gchar * const *
tp_contact_get_contact_groups (TpContact *self);

Return names of groups of which a contact is a member. It is incorrect to call this method before TP_CONTACT_FEATURE_CONTACT_GROUPS has been prepared. This remains valid until the main loop is re-entered; if the caller requires a GStrv that will persist for longer than that, it must be copied with g_strdupv().

Parameters

self

a TpContact

 

Returns

the same GStrv as the “contact-groups” property.

[array zero-terminated=1][transfer none]

Since: 0.13.14


tp_contact_set_contact_groups_async ()

void
tp_contact_set_contact_groups_async (TpContact *self,
                                     gint n_groups,
                                     const gchar * const *groups,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Add self to the given groups (creating new groups if necessary), and remove it from all other groups. If the user is removed from a group of which they were the only member, the group MAY be removed automatically. You can then call tp_contact_set_contact_groups_finish() to get the result of the operation.

If the operation is successful and TP_CONTACT_FEATURE_CONTACT_GROUPS is prepared, the “contact-groups” property will be updated (emitting "notify::contact-groups" signal) and “contact-groups-changed” signal will be emitted before callback is called. That means you can call tp_contact_get_contact_groups() to get the new contact groups inside callback .

Parameters

self

a TpContact

 

n_groups

the number of groups, or -1 if groups is NULL-terminated

 

groups

the set of groups which the contact should be in (may be NULL if n_groups is 0).

[array length=n_groups][element-type utf8][allow-none]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.14


tp_contact_set_contact_groups_finish ()

gboolean
tp_contact_set_contact_groups_finish (TpContact *self,
                                      GAsyncResult *result,
                                      GError **error);

Finishes an async set of self contact groups.

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the request call was successful, otherwise FALSE

Since: 0.13.14


tp_contact_has_feature ()

gboolean
tp_contact_has_feature (TpContact *self,
                        TpContactFeature feature);

Parameters

self

a contact

 

feature

a desired feature

 

Returns

TRUE if self has been set up to track the feature feature

Since: 0.7.18


tp_connection_dup_contact_by_id_async ()

void
tp_connection_dup_contact_by_id_async (TpConnection *self,
                                       const gchar *id,
                                       guint n_features,
                                       const TpContactFeature *features,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Create a TpContact object and make any asynchronous method calls necessary to ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

id

A strings representing the desired contact by its identifier in the IM protocol (an XMPP JID, SIP URI, MSN Passport, AOL screen-name etc.)

 

n_features

The number of features in features (may be 0)

 

features

An array of features that must be ready for use (if supported) before the callback is called (may be NULL if n_features is 0).

[array length=n_features][allow-none]

callback

A user callback to call when the contact is ready

 

user_data

Data to pass to the callback

 

Since: 0.19.0


tp_connection_dup_contact_by_id_finish ()

TpContact *
tp_connection_dup_contact_by_id_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_dup_contact_by_id_async().

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a TpContact or NULL on error.

[transfer full]

Since: 0.19.0


tp_connection_upgrade_contacts_async ()

void
tp_connection_upgrade_contacts_async (TpConnection *self,
                                      guint n_contacts,
                                      TpContact * const *contacts,
                                      guint n_features,
                                      const TpContactFeature *features,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Given several TpContact objects, make asynchronous method calls ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

n_features

The number of features in features (must be at least 1)

 

features

An array of features that must be ready for use (if supported) before the callback is called.

[array length=n_features]

callback

A user callback to call when the contacts are ready

 

user_data

Data to pass to the callback

 

Since: 0.19.0


tp_connection_upgrade_contacts_finish ()

gboolean
tp_connection_upgrade_contacts_finish (TpConnection *self,
                                       GAsyncResult *result,
                                       GPtrArray **contacts,
                                       GError **error);

Finishes tp_connection_upgrade_contacts_async().

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

contacts

a location to set a GPtrArray of upgraded TpContact, or NULL.

[element-type TelepathyGLib.Contact][transfer container][out][allow-none]

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.19.0


tp_contact_request_subscription_async ()

void
tp_contact_request_subscription_async (TpContact *self,
                                       const gchar *message,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Convenience wrapper for tp_connection_request_subscription_async() on a single contact.

Parameters

self

a TpContact

 

message

an optional message

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_request_subscription_finish ()

gboolean
tp_contact_request_subscription_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_request_subscription_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_authorize_publication_async ()

void
tp_contact_authorize_publication_async
                               (TpContact *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Convenience wrapper for tp_connection_authorize_publication_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_authorize_publication_finish ()

gboolean
tp_contact_authorize_publication_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_authorize_publication_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_remove_async ()

void
tp_contact_remove_async (TpContact *self,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Convenience wrapper for tp_connection_remove_contacts_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_remove_finish ()

gboolean
tp_contact_remove_finish (TpContact *self,
                          GAsyncResult *result,
                          GError **error);

Finishes tp_contact_remove_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_unsubscribe_async ()

void
tp_contact_unsubscribe_async (TpContact *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Convenience wrapper for tp_connection_unsubscribe_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_unsubscribe_finish ()

gboolean
tp_contact_unsubscribe_finish (TpContact *self,
                               GAsyncResult *result,
                               GError **error);

Finishes tp_contact_unsubscribe_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_unpublish_async ()

void
tp_contact_unpublish_async (TpContact *self,
                            GAsyncReadyCallback callback,
                            gpointer user_data);

Convenience wrapper for tp_connection_unpublish_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_unpublish_finish ()

gboolean
tp_contact_unpublish_finish (TpContact *self,
                             GAsyncResult *result,
                             GError **error);

Finishes tp_contact_unpublish_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_add_to_group_async ()

void
tp_contact_add_to_group_async (TpContact *self,
                               const gchar *group,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Convenience wrapper for tp_connection_add_to_group_async() on a single contact.

Parameters

self

a TpContact

 

group

the group to alter.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_add_to_group_finish ()

gboolean
tp_contact_add_to_group_finish (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_add_to_group_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_remove_from_group_async ()

void
tp_contact_remove_from_group_async (TpContact *self,
                                    const gchar *group,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Convenience wrapper for tp_connection_remove_from_group_async() on a single contact.

Parameters

self

a TpContact

 

group

the group to alter.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_contact_remove_from_group_finish ()

gboolean
tp_contact_remove_from_group_finish (TpContact *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes tp_contact_remove_from_group_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.15.5


tp_contact_block_async ()

void
tp_contact_block_async (TpContact *self,
                        gboolean report_abusive,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Block communications with a contact, optionally reporting the contact as abusive to the server administrators. To block more than one contact at once, see tp_connection_block_contacts_async().

Parameters

self

a TpContact

 

report_abusive

If TRUE, report this contact as abusive to the server administrators as well as blocking him. See “can-report-abusive” to discover whether reporting abuse is supported. If “can-report-abusive” is FALSE, this parameter will be ignored.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.0


tp_contact_block_finish ()

gboolean
tp_contact_block_finish (TpContact *self,
                         GAsyncResult *result,
                         GError **error);

Finishes tp_contact_block_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.17.0


tp_contact_unblock_async ()

void
tp_contact_unblock_async (TpContact *self,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Unblock communications with a contact. To unblock more than one contact at once, see tp_connection_unblock_contacts_async().

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.0


tp_contact_unblock_finish ()

gboolean
tp_contact_unblock_finish (TpContact *self,
                           GAsyncResult *result,
                           GError **error);

Finishes tp_contact_unblock_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since: 0.17.0

Types and Values

TpContact

typedef struct _TpContact TpContact;

An object representing a contact on a TpConnection.

Contact objects support tracking a number of attributes of contacts, as described by the TpContactFeature flags. Features can be specified when instantiating contact objects (with tp_connection_get_contacts_by_id() or tp_connection_get_contacts_by_handle()), or added to an existing contact object with tp_connection_upgrade_contacts(). For example, a client wishing to keep track of a contact's alias would set TP_CONTACT_FEATURE_ALIAS, and then listen for the "notify::alias" signal, emitted whenever the “alias” property changes.

Note that releasing a TpContact object might release handle references held by calling tp_cli_connection_call_request_handles(), tp_cli_connection_run_request_handles(), tp_cli_connection_call_hold_handles(), tp_cli_connection_run_hold_handles(), tp_cli_connection_interface_contacts_call_get_contact_attributes() or tp_cli_connection_interface_contacts_run_get_contact_attributes() directly. Those functions should be avoided in favour of using TpContact, tp_connection_hold_handles(), tp_connection_request_handles() and tp_connection_get_contact_attributes().

Since: 0.7.18


enum TpContactFeature

Enumeration representing the features a TpContact can optionally support. When requesting a TpContact, library users specify the desired features; the TpContact code will only initialize state for those features, to avoid unwanted D-Bus round-trips and signal connections.

Since 0.11.5, there is a corresponding GEnumClass type, TP_TYPE_CONTACT_FEATURE.

Members

TP_CONTACT_FEATURE_ALIAS

“alias”

 

TP_CONTACT_FEATURE_AVATAR_TOKEN

“avatar-token”

 

TP_CONTACT_FEATURE_PRESENCE

“presence-type”, “presence-status” and “presence-message”

 

TP_CONTACT_FEATURE_LOCATION

“location” (available since 0.11.1) and “location-vardict” (since 0.19.10)

 

TP_CONTACT_FEATURE_CAPABILITIES

“capabilities” (available since 0.11.3)

 

TP_CONTACT_FEATURE_AVATAR_DATA

“avatar-file” and “avatar-mime-type”. Implies TP_CONTACT_FEATURE_AVATAR_TOKEN (available since 0.11.6)

 

TP_CONTACT_FEATURE_CONTACT_INFO

“contact-info” (available since 0.11.7)

 

TP_CONTACT_FEATURE_CLIENT_TYPES

“client-types” (available since 0.13.1)

 

TP_CONTACT_FEATURE_SUBSCRIPTION_STATES

“subscribe-state”, “publish-state” and “publish-request”. Require a Connection implementing the TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST interface. (available since 0.13.12)

 

TP_CONTACT_FEATURE_CONTACT_GROUPS

“contact-groups” (available since 0.13.14)

 

TP_CONTACT_FEATURE_CONTACT_BLOCKING

“is-blocked”. Require Connection implementing the TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING interface. (available since 0.17.0)

 

Since: 0.7.18


TP_CONTACT_FEATURE_INVALID

#define TP_CONTACT_FEATURE_INVALID ((TpContactFeature) -1)

An invalid TpContactFeature. Used as list termination. See for example tp_simple_client_factory_add_contact_features_varargs().

Since: 0.15.5


NUM_TP_CONTACT_FEATURES

#define NUM_TP_CONTACT_FEATURES TP_NUM_CONTACT_FEATURES

1 higher than the highest TpContactFeature supported by this version of telepathy-glib. Use TP_NUM_CONTACT_FEATURES in new code.

Since: 0.7.18


TP_NUM_CONTACT_FEATURES

#define TP_NUM_CONTACT_FEATURES (TP_CONTACT_FEATURE_CONTACT_BLOCKING + 1)

1 higher than the highest TpContactFeature supported by this version of telepathy-glib.

Since: 0.19.0


TP_TYPE_CONTACT_FEATURE

#define TP_TYPE_CONTACT_FEATURE (tp_contact_feature_get_type ())

The GEnumClass type of a TpContactFeature.

Since: 0.11.5

Property Details

The “alias” property

  “alias”                    gchar *

The contact's alias if available, falling back to their “identifier” if no alias is available or if the TpContact has not been set up to track TP_CONTACT_FEATURE_ALIAS.

This alias may have been supplied by the contact themselves, or by the local user, so it does not necessarily unambiguously identify the contact. However, it is suitable for use as a main "display name" for the contact.

This is never NULL for contact objects that are visible to library-user code.

Owner: TpContact

Flags: Read

Default value: NULL


The “avatar-file” property

  “avatar-file”              GFile *

GFile to the latest cached avatar image, or NULL if this contact has no avatar, or if the avatar data is not yet retrieved.

When “avatar-token” changes, this property is not updated immediately, but will be updated when the new avatar data is retrieved and stored in cache. Until then, the file will keep its old value of the latest cached avatar image.

This is set to NULL if TP_CONTACT_FEATURE_AVATAR_DATA is not set on this contact. Note that setting TP_CONTACT_FEATURE_AVATAR_DATA will also implicitly set TP_CONTACT_FEATURE_AVATAR_TOKEN.

Owner: TpContact

Flags: Read

Since: 0.11.6


The “avatar-mime-type” property

  “avatar-mime-type”         gchar *

MIME type of the latest cached avatar image, or NULL if this contact has no avatar, or if the avatar data is not yet retrieved.

This is always the MIME type of the image given by “avatar-file”.

Owner: TpContact

Flags: Read

Default value: NULL

Since: 0.11.6


The “avatar-token” property

  “avatar-token”             gchar *

An opaque string representing state of the contact's avatar (depending on the protocol, this might be a hash, a timestamp or something else), or an empty string if there is no avatar.

This may be NULL if it is not known whether this contact has an avatar or not (either for network protocol reasons, or because this TpContact has not been set up to track TP_CONTACT_FEATURE_AVATAR_TOKEN).

Owner: TpContact

Flags: Read

Default value: NULL


The “capabilities” property

  “capabilities”             TpCapabilities *

The capabilities supported by this contact. If the underlying Connection doesn't support the ContactCapabilities interface, this property will contain the capabilities supported by the connection. Use tp_capabilities_is_specific_to_contact() to check if the capabilities are specific to this TpContact or not.

This may be NULL if this TpContact object has not been set up to track TP_CONTACT_FEATURE_CAPABILITIES.

Owner: TpContact

Flags: Read

Since: 0.11.3


The “client-types” property

  “client-types”             GStrv

A GStrv containing the client types of this contact.

This is set to NULL if TP_CONTACT_FEATURE_CLIENT_TYPES is not set on this contact; it may also be NULL if that feature is prepared, but the contact's client types are unknown.

Owner: TpContact

Flags: Read

Since: 0.13.1


The “connection” property

  “connection”               TpConnection *

The TpConnection to which this contact belongs.

Owner: TpContact

Flags: Read


The “contact-groups” property

  “contact-groups”           GStrv

a GStrv with names of groups of which a contact is a member.

This is set to NULL if TP_CONTACT_FEATURE_CONTACT_GROUPS is not prepared on this contact, or if the connection does not implement ContactGroups interface.

Owner: TpContact

Flags: Read

Since: 0.13.14


The “contact-info” property

  “contact-info”             TpContactInfoList *

A GList of TpContactInfoField representing the vCard of this contact.

This is set to NULL if TP_CONTACT_FEATURE_CONTACT_INFO is not set on this contact.

Owner: TpContact

Flags: Read

Since: 0.11.7


The “handle” property

  “handle”                   guint

The contact's handle in the Telepathy D-Bus API, a handle of type TP_HANDLE_TYPE_CONTACT representing the string given by “identifier”.

This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as the TpContact exists and the “connection” remains valid.

However, getting this property does not cause an additional reference to the handle to be held.

If the “connection” becomes invalid, this property is no longer meaningful and will be set to 0.

Owner: TpContact

Flags: Read

Default value: 0


The “identifier” property

  “identifier”               gchar *

The contact's identifier in the instant messaging protocol (e.g. XMPP JID, SIP URI, AOL screenname or IRC nick - whatever the underlying protocol uses to identify a user).

This is never NULL for contact objects that are visible to library-user code.

Owner: TpContact

Flags: Read

Default value: NULL


The “is-blocked” property

  “is-blocked”               gboolean

TRUE if the contact has been blocked.

This is set to FALSE if TP_CONTACT_FEATURE_CONTACT_BLOCKING is not prepared on this contact, or if the connection does not implement ContactBlocking interface.

Owner: TpContact

Flags: Read

Default value: FALSE

Since: 0.17.0


The “location” property

  “location”                 GHashTable_gchararray+GValue_*

If this contact has set a user-defined location, a string to GValue * hash table containing his location. If not, NULL. tp_asv_get_string() and similar functions can be used to access the contents.

This may be NULL even if the contact has set a location, if this TpContact object has not been set up to track TP_CONTACT_FEATURE_LOCATION.

Owner: TpContact

Flags: Read

Since: 0.11.1


The “location-vardict” property

  “location-vardict”         GVariant *

If this contact has set a user-defined location, a string to variant map containing his location. If not, NULL. tp_vardict_get_string() and similar functions can be used to access the contents.

This may be NULL even if the contact has set a location, if this TpContact object has not been set up to track TP_CONTACT_FEATURE_LOCATION.

This property contains the same information as “location”, in a different format.

Owner: TpContact

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “presence-message” property

  “presence-message”         gchar *

If this contact has set a user-defined status message, that message; if not, an empty string (which user interfaces may replace with a localized form of the “presence-status” or “presence-type”).

This may be an empty string even if the contact has set a message, if this TpContact object has not been set up to track TP_CONTACT_FEATURE_PRESENCE. It is never NULL.

Owner: TpContact

Flags: Read

Default value: ""


The “presence-status” property

  “presence-status”          gchar *

A string representing the presence status of this contact. This may be a well-known string from the Telepathy specification, like "available", or a connection-manager-specific string, like "out-to-lunch".

This may be an empty string if this TpContact object has not been set up to track TP_CONTACT_FEATURE_PRESENCE. It is never NULL.

Owner: TpContact

Flags: Read

Default value: ""


The “presence-type” property

  “presence-type”            guint

The TpConnectionPresenceType representing the type of presence status for this contact.

This is provided so even unknown values for “presence-status” can be classified into their fundamental types.

This may be TP_CONNECTION_PRESENCE_TYPE_UNSET if this TpContact has not been set up to track TP_CONTACT_FEATURE_PRESENCE.

Owner: TpContact

Flags: Read

Default value: 0


The “publish-request” property

  “publish-request”          gchar *

The message that contact sent when they requested permission to see the local user's presence, if “publish-state” is TP_SUBSCRIPTION_STATE_ASK, an empty string ("") otherwise.

This is set to NULL until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-NULL afterward.

Owner: TpContact

Flags: Read

Default value: NULL

Since: 0.13.12


The “publish-state” property

  “publish-state”            guint

A TpSubscriptionState indicating the state of this contact's subscription to the local user's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Owner: TpContact

Flags: Read

Default value: 0

Since: 0.13.12


The “subscribe-state” property

  “subscribe-state”          guint

A TpSubscriptionState indicating the state of the local user's subscription to this contact's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Owner: TpContact

Flags: Read

Default value: 0

Since: 0.13.12

Signal Details

The “contact-groups-changed” signal

void
user_function (TpContact *contact,
               GStrv      added,
               GStrv      removed,
               gpointer   user_data)

Emitted when this contact's groups changes. When this signal is emitted, “contact-groups” property is already updated.

Parameters

contact

A TpContact

 

added

A GStrv with added contact groups

 

removed

A GStrv with removed contact groups

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.14


The “presence-changed” signal

void
user_function (TpContact *contact,
               guint      type,
               gchar     *status,
               gchar     *message,
               gpointer   user_data)

Emitted when this contact's presence changes.

Parameters

contact

a TpContact

 

type

The new value of “presence-type”

 

status

The new value of “presence-status”

 

message

The new value of “presence-message”

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.11.7


The “subscription-states-changed” signal

void
user_function (TpContact *contact,
               guint      subscribe,
               guint      publish,
               gchar     *publish_request,
               gpointer   user_data)

Emitted when this contact's subscription states changes.

Parameters

contact

a TpContact

 

subscribe

the new value of “subscribe-state”

 

publish

the new value of “publish-state”

 

publish_request

the new value of “publish-request”

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.12

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/TpClientMessage.html0000644000175000017500000002031614006623343021204 00000000000000 TpClientMessage: telepathy-glib API Reference Manual

TpClientMessage

TpClientMessage — a message in the Telepathy message interface, client side

Types and Values

Object Hierarchy

    GObject
    ╰── TpMessage
        ╰── TpClientMessage

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpClientMessage is used within Telepathy clients to represent a message composed by a client, which it will send using the Messages interface. Its subclass TpSignalledMessage represents messages as signalled by a connection manager.

Functions

tp_client_message_new ()

TpMessage *
tp_client_message_new (void);

A convenient function to create a new TpClientMessage

Returns

a newly allocated TpClientMessage having only the header part.

[transfer full]

Since: 0.13.9


tp_client_message_new_text ()

TpMessage *
tp_client_message_new_text (TpChannelTextMessageType type,
                            const gchar *text);

A convenient function to create a new TpClientMessage having 'text/plain' as 'content-type', type as 'message-type' and text as 'content'.

Parameters

type

the type of message

 

text

content of the messsage

 

Returns

a newly allocated TpClientMessage.

[transfer full]

Since: 0.13.9

Types and Values

TpClientMessage

typedef struct _TpClientMessage TpClientMessage;

Opaque structure representing a message in the Telepathy messages interface (client side).

Since: 0.13.9

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-errors.html0000644000175000017500000023745714006623344022422 00000000000000 Telepathy protocol errors: telepathy-glib API Reference Manual

Telepathy protocol errors

Telepathy protocol errors — The errors from the Telepathy D-Bus spec, as a GLib error domain

Types and Values

#define TP_ERROR_PREFIX
#define TP_ERROR
#define TP_TYPE_ERROR
enum TpError
#define TP_ERROR_STR_NETWORK_ERROR
#define TP_ERROR_STR_NOT_IMPLEMENTED
#define TP_ERROR_STR_INVALID_ARGUMENT
#define TP_ERROR_STR_NOT_AVAILABLE
#define TP_ERROR_STR_PERMISSION_DENIED
#define TP_ERROR_STR_DISCONNECTED
#define TP_ERROR_STR_INVALID_HANDLE
#define TP_ERROR_STR_CHANNEL_BANNED
#define TP_ERROR_STR_CHANNEL_FULL
#define TP_ERROR_STR_CHANNEL_INVITE_ONLY
#define TP_ERROR_STR_NOT_YOURS
#define TP_ERROR_STR_CANCELLED
#define TP_ERROR_STR_AUTHENTICATION_FAILED
#define TP_ERROR_STR_ENCRYPTION_NOT_AVAILABLE
#define TP_ERROR_STR_ENCRYPTION_ERROR
#define TP_ERROR_STR_CERT_NOT_PROVIDED
#define TP_ERROR_STR_CERT_UNTRUSTED
#define TP_ERROR_STR_CERT_EXPIRED
#define TP_ERROR_STR_CERT_NOT_ACTIVATED
#define TP_ERROR_STR_CERT_FINGERPRINT_MISMATCH
#define TP_ERROR_STR_CERT_HOSTNAME_MISMATCH
#define TP_ERROR_STR_CERT_SELF_SIGNED
#define TP_ERROR_STR_CERT_INVALID
#define TP_ERROR_STR_NOT_CAPABLE
#define TP_ERROR_STR_OFFLINE
#define TP_ERROR_STR_CHANNEL_KICKED
#define TP_ERROR_STR_BUSY
#define TP_ERROR_STR_NO_ANSWER
#define TP_ERROR_STR_DOES_NOT_EXIST
#define TP_ERROR_STR_TERMINATED
#define TP_ERROR_STR_CONNECTION_REFUSED
#define TP_ERROR_STR_CONNECTION_FAILED
#define TP_ERROR_STR_CONNECTION_LOST
#define TP_ERROR_STR_ALREADY_CONNECTED
#define TP_ERROR_STR_CONNECTION_REPLACED
#define TP_ERROR_STR_REGISTRATION_EXISTS
#define TP_ERROR_STR_SERVICE_BUSY
#define TP_ERROR_STR_RESOURCE_UNAVAILABLE
#define TP_ERROR_STR_WOULD_BREAK_ANONYMITY
#define TP_ERROR_STR_CERT_REVOKED
#define TP_ERROR_STR_CERT_INSECURE
#define TP_ERROR_STR_CERT_LIMIT_EXCEEDED
#define TP_ERROR_STR_NOT_YET
#define TP_ERROR_STR_REJECTED
#define TP_ERROR_STR_PICKED_UP_ELSEWHERE
#define TP_ERROR_STR_CONFUSED
#define TP_ERROR_STR_SERVICE_CONFUSED
#define TP_ERROR_STR_SOFTWARE_UPGRADE_REQUIRED
#define TP_ERROR_STR_EMERGENCY_CALLS_NOT_SUPPORTED
#define TP_ERROR_STR_INSUFFICIENT_BALANCE
#define TP_ERROR_STR_MEDIA_CODECS_INCOMPATIBLE
#define TP_ERROR_STR_MEDIA_UNSUPPORTED_TYPE
#define TP_ERROR_STR_MEDIA_STREAMING_ERROR
#define TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED

Object Hierarchy

    GEnum
    ╰── TpError

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This header provides the Telepathy D-Bus errors, in the form of a GLib error domain. For D-Bus methods which fail with one of these errors, dbus-glib will generate a reply message with the appropriate error.

It also provides utility functions used by functions which return an error.

Functions

tp_g_set_error_invalid_handle_type ()

void
tp_g_set_error_invalid_handle_type (guint type,
                                    GError **error);

Set the error NotImplemented for an invalid handle type, with an appropriate message.

Changed in version 0.7.23: previously, the error was InvalidArgument.

[skip]

Parameters

type

An invalid handle type

 

error

Either NULL, or used to return an error (as for g_set_error)

 

tp_g_set_error_unsupported_handle_type ()

void
tp_g_set_error_unsupported_handle_type
                               (guint type,
                                GError **error);

Set the error NotImplemented for a handle type which is valid but is not supported by this connection manager, with an appropriate message.

Changed in version 0.7.23: previously, the error was InvalidArgument.

[skip]

Parameters

type

An unsupported handle type

 

error

Either NULL, or used to return an error (as for g_set_error)

 

tp_error_get_dbus_name ()

const gchar *
tp_error_get_dbus_name (TpError error);

Parameters

error

a member of the TpError enum.

 

Returns

the D-Bus error name corresponding to error .

Since: 0.7.31

Types and Values

TP_ERROR_PREFIX

#define TP_ERROR_PREFIX "org.freedesktop.Telepathy.Error"

The common prefix of Telepathy errors, as a string constant, without the trailing '.' character.

Since: 0.7.1


TP_ERROR

#define TP_ERROR (tp_error_quark ())

The error domain for the D-Bus errors described in the Telepathy specification. Error codes in this domain come from the TpError enumeration.

This macro expands to a call to a function returning the Telepathy error domain. Since 0.7.17, this function automatically registers the domain with dbus-glib for server-side use (using dbus_g_error_domain_register()) when called.

This used to be called TP_ERRORS.

Since: 0.11.7


TP_TYPE_ERROR

#define TP_TYPE_ERROR (tp_error_get_type ())

The GType of the Telepathy error enumeration.


enum TpError

Enumerated type representing the Telepathy D-Bus errors.

Members

TP_ERROR_NETWORK_ERROR

org.freedesktop.Telepathy.Error.NetworkError: Raised when there is an error reading from or writing to the network.

 

TP_ERROR_NOT_IMPLEMENTED

org.freedesktop.Telepathy.Error.NotImplemented: Raised when the requested method, channel, etc is not available on this connection.

 

TP_ERROR_INVALID_ARGUMENT

org.freedesktop.Telepathy.Error.InvalidArgument: Raised when one of the provided arguments is invalid.

 

TP_ERROR_NOT_AVAILABLE

org.freedesktop.Telepathy.Error.NotAvailable: Raised when the requested functionality is temporarily unavailable.

 

TP_ERROR_PERMISSION_DENIED

org.freedesktop.Telepathy.Error.PermissionDenied: The user is not permitted to perform the requested operation.

 

TP_ERROR_DISCONNECTED

org.freedesktop.Telepathy.Error.Disconnected: The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None.

 

TP_ERROR_INVALID_HANDLE

org.freedesktop.Telepathy.Error.InvalidHandle: An identifier being converted to a handle was syntactically invalid, or an invalid handle was used.

 

TP_ERROR_CHANNEL_BANNED

org.freedesktop.Telepathy.Error.Channel.Banned: You are banned from the channel.

 

TP_ERROR_CHANNEL_FULL

org.freedesktop.Telepathy.Error.Channel.Full: The channel is full.

 

TP_ERROR_CHANNEL_INVITE_ONLY

org.freedesktop.Telepathy.Error.Channel.InviteOnly: The requested channel is invite-only.

 

TP_ERROR_NOT_YOURS

org.freedesktop.Telepathy.Error.NotYours: The requested channel or other resource already exists, and another client is responsible for it

 

TP_ERROR_CANCELLED

org.freedesktop.Telepathy.Error.Cancelled: Raised by an ongoing request if it is cancelled by user request before it has completed, or when operations are performed on an object which the user has asked to close (for instance, a Connection where the user has called Disconnect, or a Channel where the user has called Close).

 

TP_ERROR_AUTHENTICATION_FAILED

org.freedesktop.Telepathy.Error.AuthenticationFailed: Raised when authentication with a service was unsuccessful.

 

TP_ERROR_ENCRYPTION_NOT_AVAILABLE

org.freedesktop.Telepathy.Error.EncryptionNotAvailable: Raised if a user request insisted that encryption should be used, but encryption was not actually available.

 

TP_ERROR_ENCRYPTION_ERROR

org.freedesktop.Telepathy.Error.EncryptionError: Raised if encryption appears to be available, but could not actually be used (for instance if SSL/TLS negotiation fails).

 

TP_ERROR_CERT_NOT_PROVIDED

org.freedesktop.Telepathy.Error.Cert.NotProvided: Raised if the server did not provide a SSL/TLS certificate.

 

TP_ERROR_CERT_UNTRUSTED

org.freedesktop.Telepathy.Error.Cert.Untrusted: Raised if the server provided a SSL/TLS certificate signed by an untrusted certifying authority.

 

TP_ERROR_CERT_EXPIRED

org.freedesktop.Telepathy.Error.Cert.Expired: Raised if the server provided an expired SSL/TLS certificate.

 

TP_ERROR_CERT_NOT_ACTIVATED

org.freedesktop.Telepathy.Error.Cert.NotActivated: Raised if the server provided an SSL/TLS certificate that will become valid at some point in the future.

 

TP_ERROR_CERT_FINGERPRINT_MISMATCH

org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch: Raised if the server provided an SSL/TLS certificate that did not have the expected fingerprint.

 

TP_ERROR_CERT_HOSTNAME_MISMATCH

org.freedesktop.Telepathy.Error.Cert.HostnameMismatch: Raised if the server provided an SSL/TLS certificate that did not match its hostname.

 

TP_ERROR_CERT_SELF_SIGNED

org.freedesktop.Telepathy.Error.Cert.SelfSigned: Raised if the server provided an SSL/TLS certificate that is self-signed and untrusted.

 

TP_ERROR_CERT_INVALID

org.freedesktop.Telepathy.Error.Cert.Invalid: Raised if the server provided an SSL/TLS certificate that is unacceptable in some way that does not have a more specific error.

 

TP_ERROR_NOT_CAPABLE

org.freedesktop.Telepathy.Error.NotCapable: Raised when requested functionality is unavailable due to a contact not having the required capabilities.

 

TP_ERROR_OFFLINE

org.freedesktop.Telepathy.Error.Offline: Raised when requested functionality is unavailable because a contact is offline.

 

TP_ERROR_CHANNEL_KICKED

org.freedesktop.Telepathy.Error.Channel.Kicked: Used to represent a user being ejected from a channel by another user, for instance being kicked from a chatroom.

 

TP_ERROR_BUSY

org.freedesktop.Telepathy.Error.Busy: Used to represent a user being removed from a channel because of a "busy" indication.

 

TP_ERROR_NO_ANSWER

org.freedesktop.Telepathy.Error.NoAnswer: Used to represent a user being removed from a channel because they did not respond, e.g. to a StreamedMedia call.

 

TP_ERROR_DOES_NOT_EXIST

org.freedesktop.Telepathy.Error.DoesNotExist: Raised when the requested user does not, in fact, exist.

 

TP_ERROR_TERMINATED

org.freedesktop.Telepathy.Error.Terminated: Raised when a channel is terminated for an unspecified reason. In particular, this error SHOULD be used whenever normal termination of a 1-1 StreamedMedia call by the remote user is represented as a D-Bus error name.

 

TP_ERROR_CONNECTION_REFUSED

org.freedesktop.Telepathy.Error.ConnectionRefused: Raised when a connection is refused.

 

TP_ERROR_CONNECTION_FAILED

org.freedesktop.Telepathy.Error.ConnectionFailed: Raised when a connection can't be established.

 

TP_ERROR_CONNECTION_LOST

org.freedesktop.Telepathy.Error.ConnectionLost: Raised when a connection is broken.

 

TP_ERROR_ALREADY_CONNECTED

org.freedesktop.Telepathy.Error.AlreadyConnected: Raised on attempts to connect again to an account that is already connected, if the protocol or server does not allow this. Since 0.7.34

 

TP_ERROR_CONNECTION_REPLACED

org.freedesktop.Telepathy.Error.ConnectionReplaced: Used as disconnection reason for an existing connection if it is disconnected because a second connection to the same account is made. Since 0.7.34

 

TP_ERROR_REGISTRATION_EXISTS

org.freedesktop.Telepathy.Error.RegistrationExists: Raised on attempts to register an account on a server when the account already exists. Since 0.7.34

 

TP_ERROR_SERVICE_BUSY

org.freedesktop.Telepathy.Error.ServiceBusy: Raised when a server or other infrastructure rejects a request because it is too busy. Since 0.7.34

 

TP_ERROR_RESOURCE_UNAVAILABLE

org.freedesktop.Telepathy.Error.ResourceUnavailable: Raised when a local process rejects a request because it does not have enough of a resource, such as memory. Since 0.7.34

 

TP_ERROR_WOULD_BREAK_ANONYMITY

org.freedesktop.Telepathy.Error.WouldBreakAnonymity: Raised when a request cannot be satisfied without violating an earlier request for anonymity, and the earlier request specified that raising an error is preferable to disclosing the user's identity Since 0.11.7

 

TP_ERROR_CERT_REVOKED

org.freedesktop.Telepathy.Error.Cert.Revoked: Raised if the server provided an SSL/TLS certificate that has been revoked. Since 0.11.12

 

TP_ERROR_CERT_INSECURE

org.freedesktop.Telepathy.Error.Cert.Insecure: Raised if the server provided an SSL/TLS certificate that uses an insecure cipher algorithm or is cryptographically weak. Since 0.11.12

 

TP_ERROR_CERT_LIMIT_EXCEEDED

org.freedesktop.Telepathy.Error.Cert.LimitExceeded: Raised if the length in bytes of the server certificate, or the depth of the server certificate chain, exceed the limits imposed by the crypto library. Since 0.11.12

 

TP_ERROR_NOT_YET

org.freedesktop.Telepathy.Error.NotYet: Raised when the requested functionality is not yet available, but is likely to become available after some time has passed. Since 0.11.15

 

TP_ERROR_REJECTED

org.freedesktop.Telepathy.Error.Rejected: Raised when an incoming or outgoing call is rejected by the receiving contact. Since 0.13.2

 

TP_ERROR_PICKED_UP_ELSEWHERE

org.freedesktop.Telepathy.Error.PickedUpElsewhere: Raised when a call was terminated as a result of the local user picking up the call on a different resource. Since 0.13.3

 

TP_ERROR_CONFUSED

org.freedesktop.Telepathy.Error.Confused: Raised if a server rejects protocol messages from a connection manager claiming that they do not make sense, two local processes fail to understand each other, or an apparently impossible situation is reached. This has a similar meaning to TP_DBUS_ERROR_INCONSISTENT but can be passed between processes via D-Bus. Since 0.13.7

 

TP_ERROR_SERVICE_CONFUSED

org.freedesktop.Telepathy.Error.ServiceConfused: Raised when a server or other piece of infrastructure indicates an internal error, or when a message that makes no sense is received from a server or other piece of infrastructure. Since 0.13.7

 

TP_ERROR_EMERGENCY_CALLS_NOT_SUPPORTED

org.freedesktop.Telepathy.Error.EmergencyCallsNotSupported: Raised when a client attempts to dial a number that is recognized as an emergency number (e.g. '911' in the USA), but the Connection Manager or provider does not support dialling emergency numbers.

 

TP_ERROR_SOFTWARE_UPGRADE_REQUIRED

org.freedesktop.Telepathy.Error.SoftwareUpgradeRequired: Raised when a Connection cannot be established because either the Connection Manager or its support library (e.g. wocky, papyon, sofiasip) requires upgrading to support a newer protocol version.

 

TP_ERROR_INSUFFICIENT_BALANCE

org.freedesktop.Telepathy.Error.InsufficientBalance:

Raised if the user has insufficient balance to place a call. The key 'balance-required' MAY be included in CallStateDetails on a Call channel (with the same units and scale as AccountBalance) to indicate how much credit is required to make this call.

 

TP_ERROR_MEDIA_CODECS_INCOMPATIBLE

org.freedesktop.Telepathy.Error.Media.CodecsIncompatible:

Raised when the local streaming implementation has no codecs in common with the remote side. Since 0.15.6

 

TP_ERROR_MEDIA_UNSUPPORTED_TYPE

org.freedesktop.Telepathy.Error.Media.UnsupportedType:

The media stream type requested is not supported by either the local or remote side. Since 0.15.6

 

TP_ERROR_MEDIA_STREAMING_ERROR

org.freedesktop.Telepathy.Error.Media.StreamingError:

Raised when the call's streaming implementation has some kind of internal error. Since 0.15.6

 

TP_ERROR_CAPTCHA_NOT_SUPPORTED

org.freedesktop.Telepathy.Error.Media.CaptchaNotSupported:

Raised if no UI is available to present captchas, or if one is available but it is unable to answer any of the captchas given.

 

TP_ERROR_STR_NETWORK_ERROR

#define TP_ERROR_STR_NETWORK_ERROR "org.freedesktop.Telepathy.Error.NetworkError"

The D-Bus error name org.freedesktop.Telepathy.Error.NetworkError

Raised when there is an error reading from or writing to the network.


TP_ERROR_STR_NOT_IMPLEMENTED

#define TP_ERROR_STR_NOT_IMPLEMENTED "org.freedesktop.Telepathy.Error.NotImplemented"

The D-Bus error name org.freedesktop.Telepathy.Error.NotImplemented

Raised when the requested method, channel, etc is not available on this connection.


TP_ERROR_STR_INVALID_ARGUMENT

#define TP_ERROR_STR_INVALID_ARGUMENT "org.freedesktop.Telepathy.Error.InvalidArgument"

The D-Bus error name org.freedesktop.Telepathy.Error.InvalidArgument

Raised when one of the provided arguments is invalid.


TP_ERROR_STR_NOT_AVAILABLE

#define TP_ERROR_STR_NOT_AVAILABLE "org.freedesktop.Telepathy.Error.NotAvailable"

The D-Bus error name org.freedesktop.Telepathy.Error.NotAvailable

Raised when the requested functionality is temporarily unavailable.


TP_ERROR_STR_PERMISSION_DENIED

#define TP_ERROR_STR_PERMISSION_DENIED "org.freedesktop.Telepathy.Error.PermissionDenied"

The D-Bus error name org.freedesktop.Telepathy.Error.PermissionDenied

The user is not permitted to perform the requested operation.


TP_ERROR_STR_DISCONNECTED

#define TP_ERROR_STR_DISCONNECTED "org.freedesktop.Telepathy.Error.Disconnected"

The D-Bus error name org.freedesktop.Telepathy.Error.Disconnected

The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">StatusChanged</tp:dbus-ref> has signalled status Disconnected for reason None. <tp:rationale> The second usage corresponds to None in the <tp:type>Connection_Status_Reason</tp:type> enum; if a better reason is available, the corresponding error should be used instead. </tp:rationale>


TP_ERROR_STR_INVALID_HANDLE

#define TP_ERROR_STR_INVALID_HANDLE "org.freedesktop.Telepathy.Error.InvalidHandle"

The D-Bus error name org.freedesktop.Telepathy.Error.InvalidHandle

The handle specified is unknown on this channel or connection.


TP_ERROR_STR_CHANNEL_BANNED

#define TP_ERROR_STR_CHANNEL_BANNED "org.freedesktop.Telepathy.Error.Channel.Banned"

The D-Bus error name org.freedesktop.Telepathy.Error.Channel.Banned

You are banned from the channel.


TP_ERROR_STR_CHANNEL_FULL

#define TP_ERROR_STR_CHANNEL_FULL "org.freedesktop.Telepathy.Error.Channel.Full"

The D-Bus error name org.freedesktop.Telepathy.Error.Channel.Full

The channel is full.


TP_ERROR_STR_CHANNEL_INVITE_ONLY

#define TP_ERROR_STR_CHANNEL_INVITE_ONLY "org.freedesktop.Telepathy.Error.Channel.InviteOnly"

The D-Bus error name org.freedesktop.Telepathy.Error.Channel.InviteOnly

The requested channel is invite-only.


TP_ERROR_STR_NOT_YOURS

#define TP_ERROR_STR_NOT_YOURS "org.freedesktop.Telepathy.Error.NotYours"

The D-Bus error name org.freedesktop.Telepathy.Error.NotYours

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The requested channel or other resource already exists, and another user interface in this session is responsible for it.</p> <p>User interfaces SHOULD handle this error unobtrusively, since it indicates that some other user interface is already processing the channel.</p>


TP_ERROR_STR_CANCELLED

#define TP_ERROR_STR_CANCELLED "org.freedesktop.Telepathy.Error.Cancelled"

The D-Bus error name org.freedesktop.Telepathy.Error.Cancelled

Raised by an ongoing request if it is cancelled by user request before it has completed, or when operations are performed on an object which the user has asked to close (for instance, a Connection where the user has called Disconnect, or a Channel where the user has called Close). <tp:rationale> The second form can be used to correspond to the Requested member in the <tp:type>Connection_Status_Reason</tp:type> enum, or to to represent the situation where disconnecting a Connection, closing a Channel, etc. has been requested by the user but this request has not yet been acted on, for instance because the service will only act on the request when it has finished processing an event queue. </tp:rationale>


TP_ERROR_STR_AUTHENTICATION_FAILED

#define TP_ERROR_STR_AUTHENTICATION_FAILED "org.freedesktop.Telepathy.Error.AuthenticationFailed"

The D-Bus error name org.freedesktop.Telepathy.Error.AuthenticationFailed

Raised when authentication with a service was unsuccessful. <tp:rationale> This corresponds to Authentication_Failed in the <tp:type>Connection_Status_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_ENCRYPTION_NOT_AVAILABLE

#define TP_ERROR_STR_ENCRYPTION_NOT_AVAILABLE "org.freedesktop.Telepathy.Error.EncryptionNotAvailable"

The D-Bus error name org.freedesktop.Telepathy.Error.EncryptionNotAvailable

Raised if a user request insisted that encryption should be used, but encryption was not actually available. <tp:rationale> This corresponds to part of Encryption_Error in the <tp:type>Connection_Status_Reason</tp:type> enum. It's been separated into a distinct error here because the two concepts that were part of EncryptionError seem to be things that could reasonably appear differently in the UI. </tp:rationale>


TP_ERROR_STR_ENCRYPTION_ERROR

#define TP_ERROR_STR_ENCRYPTION_ERROR "org.freedesktop.Telepathy.Error.EncryptionError"

The D-Bus error name org.freedesktop.Telepathy.Error.EncryptionError

Raised if encryption appears to be available, but could not actually be used (for instance if SSL/TLS negotiation fails). <tp:rationale> This corresponds to part of Encryption_Error in the <tp:type>Connection_Status_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_NOT_PROVIDED

#define TP_ERROR_STR_CERT_NOT_PROVIDED "org.freedesktop.Telepathy.Error.Cert.NotProvided"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.NotProvided

Raised if the server did not provide a SSL/TLS certificate. This error MUST NOT be used to represent the absence of a client certificate provided by the Telepathy connection manager. <tp:rationale> This corresponds to Cert_Not_Provided in the <tp:type>Connection_Status_Reason</tp:type> enum. That error explicitly applied only to server SSL certificates, so this one is similarly limited; having the CM present a client certificate is a possible future feature, but it should have its own error handling. </tp:rationale>


TP_ERROR_STR_CERT_UNTRUSTED

#define TP_ERROR_STR_CERT_UNTRUSTED "org.freedesktop.Telepathy.Error.Cert.Untrusted"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.Untrusted

Raised if the server provided a SSL/TLS certificate signed by an untrusted certifying authority. This error SHOULD NOT be used to represent a self-signed certificate: see the Self Signed error for that. <tp:rationale> This corresponds to Cert_Untrusted in the <tp:type>Connection_Status_Reason</tp:type> enum and to Untrusted in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum, with a clarification to avoid ambiguity. </tp:rationale>


TP_ERROR_STR_CERT_EXPIRED

#define TP_ERROR_STR_CERT_EXPIRED "org.freedesktop.Telepathy.Error.Cert.Expired"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.Expired

Raised if the server provided an expired SSL/TLS certificate. <tp:rationale> This corresponds to Cert_Expired in the <tp:type>Connection_Status_Reason</tp:type> enum and to Expired in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_NOT_ACTIVATED

#define TP_ERROR_STR_CERT_NOT_ACTIVATED "org.freedesktop.Telepathy.Error.Cert.NotActivated"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.NotActivated

Raised if the server provided an SSL/TLS certificate that will become valid at some point in the future. <tp:rationale> This corresponds to Cert_Not_Activated in the <tp:type>Connection_Status_Reason</tp:type> enum and to Not_Activated in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_FINGERPRINT_MISMATCH

#define TP_ERROR_STR_CERT_FINGERPRINT_MISMATCH "org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch

Raised if the server provided an SSL/TLS certificate that did not have the expected fingerprint. <tp:rationale> This corresponds to Cert_Fingerprint_Mismatch in the <tp:type>Connection_Status_Reason</tp:type> enum and to Fingerprint_Mismatch in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_HOSTNAME_MISMATCH

#define TP_ERROR_STR_CERT_HOSTNAME_MISMATCH "org.freedesktop.Telepathy.Error.Cert.HostnameMismatch"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.HostnameMismatch

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Raised if the server provided an SSL/TLS certificate that did not match its hostname.</p> <p>You MAY be able to get more details about the expected and certified hostnames by looking up the 'expected-hostname' and 'certificate-hostname' keys in the details map that came together with this error.</p> <tp:rationale> This corresponds to Cert_Hostname_Mismatch in the <tp:type>Connection_Status_Reason</tp:type> enum and to Hostname_Mismatch in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_SELF_SIGNED

#define TP_ERROR_STR_CERT_SELF_SIGNED "org.freedesktop.Telepathy.Error.Cert.SelfSigned"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.SelfSigned

Raised if the server provided an SSL/TLS certificate that is self-signed and untrusted. <tp:rationale> This corresponds to Cert_Self_Signed in the <tp:type>Connection_Status_Reason</tp:type> enum and to Self_Signed in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_INVALID

#define TP_ERROR_STR_CERT_INVALID "org.freedesktop.Telepathy.Error.Cert.Invalid"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.Invalid

Raised if the server provided an SSL/TLS certificate that is unacceptable in some way that does not have a more specific error. <tp:rationale> This corresponds to Cert_Other_Error in the <tp:type>Connection_Status_Reason</tp:type> enum and to Unknown in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_NOT_CAPABLE

#define TP_ERROR_STR_NOT_CAPABLE "org.freedesktop.Telepathy.Error.NotCapable"

The D-Bus error name org.freedesktop.Telepathy.Error.NotCapable

Raised when requested functionality is unavailable due to contact not having required capabilities.


TP_ERROR_STR_OFFLINE

#define TP_ERROR_STR_OFFLINE "org.freedesktop.Telepathy.Error.Offline"

The D-Bus error name org.freedesktop.Telepathy.Error.Offline

Raised when requested functionality is unavailable because a contact is offline. <tp:rationale> This corresponds to Offline in the <tp:type>Channel_Group_Change_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CHANNEL_KICKED

#define TP_ERROR_STR_CHANNEL_KICKED "org.freedesktop.Telepathy.Error.Channel.Kicked"

The D-Bus error name org.freedesktop.Telepathy.Error.Channel.Kicked

Used to represent a user being ejected from a channel by another user, for instance being kicked from a chatroom. <tp:rationale> This corresponds to Kicked in the <tp:type>Channel_Group_Change_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_BUSY

#define TP_ERROR_STR_BUSY "org.freedesktop.Telepathy.Error.Busy"

The D-Bus error name org.freedesktop.Telepathy.Error.Busy

Used to represent a user being removed from a channel because of a &quot;busy&quot; indication. This error SHOULD NOT be used to represent a server or other infrastructure being too busy to process a request - for that, see ServerBusy. <tp:rationale> This corresponds to Busy in the <tp:type>Channel_Group_Change_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_NO_ANSWER

#define TP_ERROR_STR_NO_ANSWER "org.freedesktop.Telepathy.Error.NoAnswer"

The D-Bus error name org.freedesktop.Telepathy.Error.NoAnswer

Used to represent a user being removed from a channel because they did not respond, e.g. to a StreamedMedia call. <tp:rationale> This corresponds to No_Answer in the <tp:type>Channel_Group_Change_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_DOES_NOT_EXIST

#define TP_ERROR_STR_DOES_NOT_EXIST "org.freedesktop.Telepathy.Error.DoesNotExist"

The D-Bus error name org.freedesktop.Telepathy.Error.DoesNotExist

Raised when the requested user does not, in fact, exist. <tp:rationale> This corresponds to Invalid_Contact in the <tp:type>Channel_Group_Change_Reason</tp:type> enum, but can also be used to represent other things not existing (like chatrooms, perhaps). </tp:rationale>


TP_ERROR_STR_TERMINATED

#define TP_ERROR_STR_TERMINATED "org.freedesktop.Telepathy.Error.Terminated"

The D-Bus error name org.freedesktop.Telepathy.Error.Terminated

Raised when a channel is terminated for an unspecified reason. In particular, this error SHOULD be used whenever normal termination of a 1-1 StreamedMedia call by the remote user is represented as a D-Bus error name. <tp:rationale> This corresponds to None in the <tp:type>Channel_Group_Change_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CONNECTION_REFUSED

#define TP_ERROR_STR_CONNECTION_REFUSED "org.freedesktop.Telepathy.Error.ConnectionRefused"

The D-Bus error name org.freedesktop.Telepathy.Error.ConnectionRefused

Raised when a connection is refused.


TP_ERROR_STR_CONNECTION_FAILED

#define TP_ERROR_STR_CONNECTION_FAILED "org.freedesktop.Telepathy.Error.ConnectionFailed"

The D-Bus error name org.freedesktop.Telepathy.Error.ConnectionFailed

Raised when a connection can't be established.


TP_ERROR_STR_CONNECTION_LOST

#define TP_ERROR_STR_CONNECTION_LOST "org.freedesktop.Telepathy.Error.ConnectionLost"

The D-Bus error name org.freedesktop.Telepathy.Error.ConnectionLost

Raised when a connection is broken.


TP_ERROR_STR_ALREADY_CONNECTED

#define TP_ERROR_STR_ALREADY_CONNECTED "org.freedesktop.Telepathy.Error.AlreadyConnected"

The D-Bus error name org.freedesktop.Telepathy.Error.AlreadyConnected

Raised when the user attempts to connect to an account but they are already connected (perhaps from another client or computer), and the protocol or account settings do not allow this. <tp:rationale> XMPP can have this behaviour if the user chooses the same resource in both clients (it is server-dependent whether the result is AlreadyConnected on the new connection, ConnectionReplaced on the old connection, or two successful connections). </tp:rationale>


TP_ERROR_STR_CONNECTION_REPLACED

#define TP_ERROR_STR_CONNECTION_REPLACED "org.freedesktop.Telepathy.Error.ConnectionReplaced"

The D-Bus error name org.freedesktop.Telepathy.Error.ConnectionReplaced

Raised by an existing connection to an account if it is replaced by a new connection (perhaps from another client or computer). <tp:rationale> In MSNP, when connecting twice with the same Passport, the new connection &quot;wins&quot; and the old one is automatically disconnected. XMPP can also have this behaviour if the user chooses the same resource in two clients (it is server-dependent whether the result is AlreadyConnected on the new connection, ConnectionReplaced on the old connection, or two successful connections). </tp:rationale>


TP_ERROR_STR_REGISTRATION_EXISTS

#define TP_ERROR_STR_REGISTRATION_EXISTS "org.freedesktop.Telepathy.Error.RegistrationExists"

The D-Bus error name org.freedesktop.Telepathy.Error.RegistrationExists

Raised during in-band registration if the server indicates that the requested account already exists.


TP_ERROR_STR_SERVICE_BUSY

#define TP_ERROR_STR_SERVICE_BUSY "org.freedesktop.Telepathy.Error.ServiceBusy"

The D-Bus error name org.freedesktop.Telepathy.Error.ServiceBusy

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Raised if a server or some other piece of infrastructure cannot process the request, e.g. due to resource limitations. Clients MAY try again later. <tp:rationale> This is not the same error as Busy, which indicates that a <em>user</em> is busy. </tp:rationale>


TP_ERROR_STR_RESOURCE_UNAVAILABLE

#define TP_ERROR_STR_RESOURCE_UNAVAILABLE "org.freedesktop.Telepathy.Error.ResourceUnavailable"

The D-Bus error name org.freedesktop.Telepathy.Error.ResourceUnavailable

Raised if a request cannot be satisfied because a process local to the user has insufficient resources. Clients MAY try again later. <tp:rationale> For instance, the <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatcher</tp:dbus-ref> might raise this error for some or all channel requests if it has detected that there is not enough free memory. </tp:rationale>


TP_ERROR_STR_WOULD_BREAK_ANONYMITY

#define TP_ERROR_STR_WOULD_BREAK_ANONYMITY "org.freedesktop.Telepathy.Error.WouldBreakAnonymity"

The D-Bus error name org.freedesktop.Telepathy.Error.WouldBreakAnonymity

Raised if a request cannot be satisfied without violating an earlier request for anonymity, and the earlier request specified that raising an error is preferable to disclosing the user's identity (for instance via <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Anonymity.AnonymityMandatory</tp:dbus-ref> or <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Anonymity.AnonymityMandatory</tp:dbus-ref>).


TP_ERROR_STR_CERT_REVOKED

#define TP_ERROR_STR_CERT_REVOKED "org.freedesktop.Telepathy.Error.Cert.Revoked"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.Revoked

Raised if the server provided an SSL/TLS certificate that has been revoked. <tp:rationale> This corresponds to Cert_Revoked in the <tp:type>Connection_Status_Reason</tp:type> enum and to Revoked in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_INSECURE

#define TP_ERROR_STR_CERT_INSECURE "org.freedesktop.Telepathy.Error.Cert.Insecure"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.Insecure

Raised if the server provided an SSL/TLS certificate that uses an insecure cipher algorithm or is cryptographically weak. <tp:rationale> This corresponds to Cert_Insecure in the <tp:type>Connection_Status_Reason</tp:type> enum and to Insecure in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_CERT_LIMIT_EXCEEDED

#define TP_ERROR_STR_CERT_LIMIT_EXCEEDED "org.freedesktop.Telepathy.Error.Cert.LimitExceeded"

The D-Bus error name org.freedesktop.Telepathy.Error.Cert.LimitExceeded

Raised if the length in bytes of the server certificate, or the depth of the server certificate chain exceeds the limits imposed by the crypto library. <tp:rationale> This corresponds to Cert_Limit_Exceeded in the <tp:type>Connection_Status_Reason</tp:type> enum and to Limit_Exceeded in the <tp:type>TLS_Certificate_Reject_Reason</tp:type> enum. </tp:rationale>


TP_ERROR_STR_NOT_YET

#define TP_ERROR_STR_NOT_YET "org.freedesktop.Telepathy.Error.NotYet"

The D-Bus error name org.freedesktop.Telepathy.Error.NotYet

Raised when the requested functionality is not yet available, but is likely to become available after some time has passed.


TP_ERROR_STR_REJECTED

#define TP_ERROR_STR_REJECTED "org.freedesktop.Telepathy.Error.Rejected"

The D-Bus error name org.freedesktop.Telepathy.Error.Rejected

Raised when an incoming or outgoing <tp:dbus-ref namespace="ofdT.Channel.Type">Call1</tp:dbus-ref> is rejected by the the receiver.


TP_ERROR_STR_PICKED_UP_ELSEWHERE

#define TP_ERROR_STR_PICKED_UP_ELSEWHERE "org.freedesktop.Telepathy.Error.PickedUpElsewhere"

The D-Bus error name org.freedesktop.Telepathy.Error.PickedUpElsewhere

Raised when a call was terminated as a result of the local user picking up the call on a different resource.


TP_ERROR_STR_CONFUSED

#define TP_ERROR_STR_CONFUSED "org.freedesktop.Telepathy.Error.Confused"

The D-Bus error name org.freedesktop.Telepathy.Error.Confused

Raised if a server rejects protocol messages from a connection manager claiming that they do not make sense, two local processes fail to understand each other, or an apparently impossible situation is reached. <tp:rationale> For instance, this would be an appropriate mapping for XMPP's errors bad-format, invalid-xml, etc., which can't happen unless the local (or remote) XMPP implementation is faulty. This is also analogous to <tp:value-ref type="Media_Stream_Error">Invalid_CM_Behavior</tp:value-ref>, <code>TP_DBUS_ERROR_INCONSISTENT</code> in telepathy-glib, and <code>TELEPATHY_QT4_ERROR_INCONSISTENT</code> in telepathy-qt4. </tp:rationale>


TP_ERROR_STR_SERVICE_CONFUSED

#define TP_ERROR_STR_SERVICE_CONFUSED "org.freedesktop.Telepathy.Error.ServiceConfused"

The D-Bus error name org.freedesktop.Telepathy.Error.ServiceConfused

Raised when a server or other piece of infrastructure indicates an internal error, or when a message that makes no sense is received from a server or other piece of infrastructure. <tp:rationale> For instance, this is appropriate for XMPP's <code>internal-server-error</code>, and is also appropriate if you receive sufficiently inconsistent information from a server that you cannot continue. </tp:rationale>


TP_ERROR_STR_SOFTWARE_UPGRADE_REQUIRED

#define TP_ERROR_STR_SOFTWARE_UPGRADE_REQUIRED "org.freedesktop.Telepathy.Error.SoftwareUpgradeRequired"

The D-Bus error name org.freedesktop.Telepathy.Error.SoftwareUpgradeRequired

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Raised as a <tp:dbus-ref namespace="ofdT.Connection">ConnectionError</tp:dbus-ref> when a Connection cannot be established because either the Connection Manager or its support library (e.g. wocky, papyon, sofiasip) requires upgrading to support a newer protocol version.</p> <p>This error corresponds to the <tp:type>Connection_Status_Reason</tp:type> of Network_Error.</p> <tp:rationale> Some protocols transmit a protocol or library version number to the server, which will disconnect them if the version isn't appropriate. This way we can report the error to the user, and if appropriate, the user's client can check for updates. </tp:rationale>


TP_ERROR_STR_EMERGENCY_CALLS_NOT_SUPPORTED

#define TP_ERROR_STR_EMERGENCY_CALLS_NOT_SUPPORTED "org.freedesktop.Telepathy.Error.EmergencyCallsNotSupported"

The D-Bus error name org.freedesktop.Telepathy.Error.EmergencyCallsNotSupported

Raised if a client attempts to dial a number that is recognized as an emergency number (e.g. '911' in the USA), but the Connection Manager or provider does not support dialling emergency numbers. <tp:rationale> Many VOIP providers have the ability to dial traditional (PSTN) telephone numbers, but do not provide the ability to dial emergency numbers (for instance, Google Voice). This error provides additional information about why such a call was unsuccessful. </tp:rationale>


TP_ERROR_STR_INSUFFICIENT_BALANCE

#define TP_ERROR_STR_INSUFFICIENT_BALANCE "org.freedesktop.Telepathy.Error.InsufficientBalance"

The D-Bus error name org.freedesktop.Telepathy.Error.InsufficientBalance

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Raised if the user has insufficient <tp:dbus-ref namespace="ofdT.Connection.Interface">Balance</tp:dbus-ref> to place a call or send a message.</p> <p>The key 'balance-required' MAY be included in <tp:dbus-ref namespace="ofdT.Channel.Type.Call1">CallStateDetails</tp:dbus-ref> or a delivery report's <tp:type>Message_Part</tp:type> (with the same units and scale as <tp:dbus-ref namespace="ofdT.Connection.Interface.Balance">AccountBalance</tp:dbus-ref>) to indicate how much credit is required to make this call or send this message.</p>


TP_ERROR_STR_MEDIA_CODECS_INCOMPATIBLE

#define TP_ERROR_STR_MEDIA_CODECS_INCOMPATIBLE "org.freedesktop.Telepathy.Error.Media.CodecsIncompatible"

The D-Bus error name org.freedesktop.Telepathy.Error.Media.CodecsIncompatible

Raised when the local streaming implementation has no codecs in common with the remote side. <tp:rationale> This corresponds to <tp:value-ref type="Call_State_Change_Reason">Media_Error</tp:value-ref>. </tp:rationale>


TP_ERROR_STR_MEDIA_UNSUPPORTED_TYPE

#define TP_ERROR_STR_MEDIA_UNSUPPORTED_TYPE "org.freedesktop.Telepathy.Error.Media.UnsupportedType"

The D-Bus error name org.freedesktop.Telepathy.Error.Media.UnsupportedType

The media stream type requested is not supported by either the local or remote side. <tp:rationale> This corresponds to <tp:value-ref type="Call_State_Change_Reason">Media_Error</tp:value-ref>. </tp:rationale>


TP_ERROR_STR_MEDIA_STREAMING_ERROR

#define TP_ERROR_STR_MEDIA_STREAMING_ERROR "org.freedesktop.Telepathy.Error.Media.StreamingError"

The D-Bus error name org.freedesktop.Telepathy.Error.Media.StreamingError

Raised when the call's streaming implementation has some kind of internal error. <tp:rationale> This corresponds to <tp:value-ref type="Call_State_Change_Reason">Internal_Error</tp:value-ref>. </tp:rationale>


TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED

#define TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED "org.freedesktop.Telepathy.Error.CaptchaNotSupported"

The D-Bus error name org.freedesktop.Telepathy.Error.CaptchaNotSupported

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Raised if the <tp:dbus-ref namespace="ofdT.Channel.Interface">CaptchaAuthentication1</tp:dbus-ref> Handler either has no UI to present captchas, or it does, but wasn't able to answer any of the captchas given.</p>

telepathy-glib-0.24.2/docs/reference/html/TpExportableChannel.html0000644000175000017500000003700414006623343022061 00000000000000 TpExportableChannel: telepathy-glib API Reference Manual

TpExportableChannel

TpExportableChannel — interface representing channels with several standard properties

Functions

Properties

gboolean channel-destroyed Read
GHashTable_gchararray+GValue_* channel-properties Read
gchar * object-path Read / Write / Construct Only

Types and Values

Object Hierarchy

    GInterface
    ╰── TpExportableChannel

Prerequisites

TpExportableChannel requires TpSvcChannel.

Known Implementations

TpExportableChannel is implemented by TpBaseCallChannel, TpBaseChannel, TpBaseMediaCallChannel and TpBasePasswordChannel.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This interface defines a set of channel properties on top of those of TpChannelIface. It's mainly used by TpChannelManager to represent the returned and managed channel objects.

Functions

TpExportableChannelFunc ()

void
(*TpExportableChannelFunc) (TpExportableChannel *channel,
                            gpointer user_data);

A callback for functions which act on exportable channels.

Parameters

channel

An object implementing the exportable channel interface

 

user_data

Arbitrary user-supplied data

 

Types and Values

TpExportableChannel

typedef struct _TpExportableChannel TpExportableChannel;

Opaque typedef representing a channel with several standard properties.


struct TpExportableChannelIface

struct TpExportableChannelIface {
    GTypeInterface parent;
};

The interface for TpExportableChannel objects.

Members

GTypeInterface parent;

The parent interface

 

Property Details

The “channel-destroyed” property

  “channel-destroyed”        gboolean

If true, the closed signal on the Channel interface indicates that the channel can go away.

If false, the closed signal indicates to the channel manager that the channel should appear to go away and be re-created, by emitting Closed followed by NewChannel. (This is to support the "respawning" of Text channels which are closed with unacknowledged messages.)

Owner: TpExportableChannel

Flags: Read

Default value: FALSE


The “channel-properties” property

  “channel-properties”       GHashTable_gchararray+GValue_*

The D-Bus properties to be announced in the NewChannels signal and in the Channels property, as a map from interface.name.propertyname to GValue.

A channel's immutable properties are constant for its lifetime on the bus, so this property should only change when the closed signal is emitted (so that respawned channels can reappear on the bus with different properties). All of the D-Bus properties mentioned here should be exposed through the D-Bus properties interface; additional (possibly mutable) properties not included here may also be exposed via the D-Bus properties interface.

If the channel implementation uses

TpDBusPropertiesMixin,

this property can implemented using tp_dbus_properties_mixin_make_properties_hash() as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
case PROP_CHANNEL_PROPERTIES:
  g_value_take_boxed (value,
    tp_dbus_properties_mixin_make_properties_hash (object,
        // The spec says these properties MUST be included:
        TP_IFACE_CHANNEL, "TargetHandle",
        TP_IFACE_CHANNEL, "TargetHandleType",
        TP_IFACE_CHANNEL, "ChannelType",
        TP_IFACE_CHANNEL, "TargetID",
        TP_IFACE_CHANNEL, "Requested",
        // These aren't mandatory as of spec 0.17.17
        // (but they should be):
        TP_IFACE_CHANNEL, "InitiatorHandle",
        TP_IFACE_CHANNEL, "InitiatorID",
        TP_IFACE_CHANNEL, "Interfaces",
        // Perhaps your channel has some other immutable properties:
        TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes",
        // etc.
        NULL));
  break;

Owner: TpExportableChannel

Flags: Read


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus. Read-only except during construction.

Owner: TpExportableChannel

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-text-channel.html0000644000175000017500000030061714006623344023465 00000000000000 TpTextChannel: telepathy-glib API Reference Manual

TpTextChannel

TpTextChannel — proxy object for a text channel

Properties

guint delivery-reporting-support Read
gboolean is-sms-channel Read
guint message-part-support-flags Read
GArray_guint_ * message-types Read
gboolean sms-flash Read
GStrv supported-content-types Read

Signals

void contact-chat-state-changed Has Details
void message-received Run Last
void message-sent Run Last
void pending-message-removed Run Last

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannel
            ╰── TpTextChannel

Implemented Interfaces

TpTextChannel implements TpChannelIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpTextChannel is a sub-class of TpChannel providing convenient API to send and receive TpMessage.

Functions

tp_text_channel_new ()

TpTextChannel *
tp_text_channel_new (TpConnection *conn,
                     const gchar *object_path,
                     const GHashTable *immutable_properties,
                     GError **error);

tp_text_channel_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_channel() instead.

Convenient function to create a new TpTextChannel

Parameters

conn

a TpConnection; may not be NULL

 

object_path

the object path of the channel; may not be NULL

 

immutable_properties

the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to GValue instances.

[transfer none][element-type utf8 GObject.Value]

error

used to indicate the error if NULL is returned

 

Returns

a newly created TpTextChannel.

[transfer full]

Since: 0.13.10


tp_text_channel_get_supported_content_types ()

const gchar * const *
tp_text_channel_get_supported_content_types
                               (TpTextChannel *self);

Return the “supported-content-types” property

Parameters

self

a TpTextChannel

 

Returns

(transfer none) : the value of “supported-content-types”

Since: 0.13.10


tp_text_channel_get_message_part_support_flags ()

TpMessagePartSupportFlags
tp_text_channel_get_message_part_support_flags
                               (TpTextChannel *self);

Return the “message-part-support-flags” property

Parameters

self

a TpTextChannel

 

Returns

the value of “message-part-support-flags”

Since: 0.13.10


tp_text_channel_get_delivery_reporting_support ()

TpDeliveryReportingSupportFlags
tp_text_channel_get_delivery_reporting_support
                               (TpTextChannel *self);

Return the “delivery-reporting-support” property

Parameters

self

a TpTextChannel

 

Returns

the value of “delivery-reporting-support” property

Since: 0.13.10


tp_text_channel_get_pending_messages ()

GList *
tp_text_channel_get_pending_messages (TpTextChannel *self);

tp_text_channel_get_pending_messages is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_text_channel_dup_pending_messages() instead.

Return a newly allocated list of unacknowledged TpSignalledMessage objects.

It is guaranteed that the “sender” of each TpSignalledMessage has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

a TpTextChannel

 

Returns

a GList of borrowed TpSignalledMessage.

[transfer container][element-type TelepathyGLib.SignalledMessage]

Since: 0.13.10


tp_text_channel_dup_pending_messages ()

GList *
tp_text_channel_dup_pending_messages (TpTextChannel *self);

Return a newly allocated list of unacknowledged TpSignalledMessage objects.

It is guaranteed that the “sender” of each TpSignalledMessage has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

a TpTextChannel

 

Returns

a GList of reffed TpSignalledMessage.

[transfer full][element-type TelepathyGLib.SignalledMessage]

Since: 0.19.9


tp_text_channel_get_message_types ()

GArray *
tp_text_channel_get_message_types (TpTextChannel *self);

Return the “message-types” property

Parameters

self

a TpTextChannel

 

Returns

the value of “message-types”.

[transfer none][element-type TelepathyGLib.ChannelTextMessageType]

Since: 0.13.16


tp_text_channel_send_message_async ()

void
tp_text_channel_send_message_async (TpTextChannel *self,
                                    TpMessage *message,
                                    TpMessageSendingFlags flags,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Submit a message to the server for sending. Once the message has been submitted to the sever, callback will be called. You can then call tp_text_channel_send_message_finish() to get the result of the operation.

Parameters

self

a TpTextChannel

 

message

a TpClientMessage

 

flags

flags affecting how the message is sent

 

callback

a callback to call when the message has been submitted to the server

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_text_channel_send_message_finish ()

gboolean
tp_text_channel_send_message_finish (TpTextChannel *self,
                                     GAsyncResult *result,
                                     gchar **token,
                                     GError **error);

Completes a call to tp_text_channel_send_message_async().

token can be used to match any incoming delivery or failure reports against the sent message. If this function returns true but the returned token is NULL, the message was sent successfully but the protocol does not provide a way to identify it later.

Parameters

self

a TpTextChannel

 

result

a GAsyncResult passed to the callback for tp_text_channel_send_message_async()

 

token

if not NULL, used to return the token of the sent message.

[out][transfer full]

error

a GError to fill

 

Returns

TRUE if the message has been submitted to the server, FALSE otherwise.

Since: 0.13.10


tp_text_channel_ack_messages_async ()

void
tp_text_channel_ack_messages_async (TpTextChannel *self,
                                    const GList *messages,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Acknowledge all the messages in messages . Once the messages have been acked, callback will be called. You can then call tp_text_channel_ack_messages_finish() to get the result of the operation.

You should use the TpSignalledMessage received from tp_text_channel_dup_pending_messages() or the “message-received” signal.

See tp_text_channel_ack_message_async() about acknowledging messages.

Parameters

self

a TpTextChannel

 

messages

a GList of TpSignalledMessage.

[element-type TelepathyGLib.SignalledMessage]

callback

a callback to call when the message have been acked

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_text_channel_ack_messages_finish ()

gboolean
tp_text_channel_ack_messages_finish (TpTextChannel *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes acknowledging a list of messages.

Parameters

self

a TpTextChannel

 

result

a GAsyncResult passed to the callback for tp_text_channel_ack_messages_async()

 

error

a GError to fill

 

Returns

TRUE if the messages have been acked, FALSE otherwise.

Since: 0.13.10


tp_text_channel_ack_message_async ()

void
tp_text_channel_ack_message_async (TpTextChannel *self,
                                   TpMessage *message,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Acknowledge message . Once the message has been acked, callback will be called. You can then call tp_text_channel_ack_message_finish() to get the result of the operation.

A message should be acknowledged once it has been shown to the user by the Handler of the channel. So Observers and Approvers should NOT acknowledge messages themselves. Once a message has been acknowledged, it is removed from the pending-message queue and so the “pending-message-removed” signal is fired.

You should use the TpSignalledMessage received from tp_text_channel_dup_pending_messages() or the “message-received” signal.

Parameters

self

a TpTextChannel

 

message

a TpSignalledMessage

 

callback

a callback to call when the message have been acked

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_text_channel_ack_message_finish ()

gboolean
tp_text_channel_ack_message_finish (TpTextChannel *self,
                                    GAsyncResult *result,
                                    GError **error);

Finishes acknowledging a message.

Parameters

self

a TpTextChannel

 

result

a GAsyncResult passed to the callback for tp_text_channel_ack_message_async()

 

error

a GError to fill

 

Returns

TRUE if the message has been acked, FALSE otherwise.

Since: 0.13.10


tp_text_channel_ack_all_pending_messages_async ()

void
tp_text_channel_ack_all_pending_messages_async
                               (TpTextChannel *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Acknowledge all the pending messages. This is equivalent of calling tp_text_channel_ack_messages_async() with the list of TpSignalledMessage returned by tp_text_channel_dup_pending_messages().

Once the messages have been acked, callback will be called. You can then call tp_text_channel_ack_all_pending_messages_finish() to get the result of the operation.

See tp_text_channel_ack_message_async() about acknowledging messages.

Parameters

self

a TpTextChannel

 

callback

a callback to call when the messages have been acked

 

user_data

data to pass to callback

 

Since: 0.15.3


tp_text_channel_ack_all_pending_messages_finish ()

gboolean
tp_text_channel_ack_all_pending_messages_finish
                               (TpTextChannel *self,
                                GAsyncResult *result,
                                GError **error);

Finish an asynchronous acknowledgement operation of all messages.

Parameters

self

a TpTextChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the messages have been acked, FALSE otherwise.

Since: 0.15.3


tp_text_channel_set_chat_state_async ()

void
tp_text_channel_set_chat_state_async (TpTextChannel *self,
                                      TpChannelChatState state,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Set the local state on channel self to state . Once the state has been set, callback will be called. You can then call tp_text_channel_set_chat_state_finish() to get the result of the operation.

Parameters

self

a TpTextChannel

 

state

a TpChannelChatState to set

 

callback

a callback to call when the chat state has been set

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_text_channel_set_chat_state_finish ()

gboolean
tp_text_channel_set_chat_state_finish (TpTextChannel *self,
                                       GAsyncResult *result,
                                       GError **error);

Completes a call to tp_text_channel_set_chat_state_async().

Parameters

self

a TpTextChannel

 

result

a GAsyncResult passed to the callback for tp_text_channel_set_chat_state_async()

 

error

a GError to fill

 

Returns

TRUE if the chat state has been changed, FALSE otherwise.

Since: 0.13.10


tp_text_channel_supports_message_type ()

gboolean
tp_text_channel_supports_message_type (TpTextChannel *self,
                                       TpChannelTextMessageType message_type);

Check if message of type message_type can be sent on this channel.

Parameters

self

a TpTextChannel

 

message_type

a TpChannelTextMessageType

 

Returns

TRUE if message of type message_type can be sent on self , FALSE otherwise

Since: 0.13.16


tp_text_channel_is_sms_channel ()

gboolean
tp_text_channel_is_sms_channel (TpTextChannel *self);

Return the “is-sms-channel” property

Parameters

self

a TpTextChannel

 

Returns

the value of “is-sms-channel” property

Since: 0.15.1


tp_text_channel_get_sms_flash ()

gboolean
tp_text_channel_get_sms_flash (TpTextChannel *self);

Return the “sms-flash” property

Parameters

self

a TpTextChannel

 

Returns

the value of “sms-flash” property

Since: 0.15.1


tp_text_channel_get_sms_length_async ()

void
tp_text_channel_get_sms_length_async (TpTextChannel *self,
                                      TpMessage *message,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Starts an async call to get the number of 140 octet chunks required to send a message via SMS on self, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost.

Once the request has been satisfied, callback will be called. You can then call tp_text_channel_get_sms_length_finish() to get the result of the operation.

Parameters

self

a TpTextChannel

 

message

a TpClientMessage

 

callback

a callback to call when the request has been satisfied

 

user_data

data to pass to callback

 

Since: 0.15.1


tp_text_channel_get_sms_length_finish ()

gboolean
tp_text_channel_get_sms_length_finish (TpTextChannel *self,
                                       GAsyncResult *result,
                                       guint *chunks_required,
                                       gint *remaining_characters,
                                       gint *estimated_cost,
                                       GError **error);

Finishes an async SMS length request.

Parameters

self

a TpTextChannel

 

result

a GAsyncResult

 

chunks_required

if not NULL used to return the number of 140 octet chunks required to send the message.

[out]

remaining_characters

if not NULL used to return the number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by abs(remaining_characters ). The value G_MININT32 indicates the message will be truncated by an unknown amount.

[out]

estimated_cost

if not NULL used to return the estimated cost of sending this message. The currency and scale of this value are the same as the values of the “balance-scale” and “balance-currency” properties. A value of -1 indicates the cost could not be estimated.

[out]

error

a GError to fill

 

Returns

TRUE if the number of 140 octet chunks required to send the message has been retrieved, FALSE otherwise.

Since: 0.15.1


tp_text_channel_get_chat_state ()

TpChannelChatState
tp_text_channel_get_chat_state (TpTextChannel *self,
                                TpContact *contact);

Return the chat state for the given contact. If tp_proxy_is_prepared() would return FALSE for the feature TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, the result will always be TP_CHANNEL_CHAT_STATE_INACTIVE.

Parameters

self

a channel

 

contact

a TpContact

 

Returns

the chat state for contact , or TP_CHANNEL_CHAT_STATE_INACTIVE if their chat state is not known

Since: 0.19.0

Types and Values

struct TpTextChannel

struct TpTextChannel;

Data structure representing a TpTextChannel.

Since: 0.13.10


struct TpTextChannelClass

struct TpTextChannelClass {
};

The class of a TpTextChannel.

Since: 0.13.10


TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES

#define             TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES

Expands to a call to a function that returns a quark representing the incoming messages features of a TpTextChannel.

When this feature is prepared, tp_text_channel_dup_pending_messages() will return a non-empty list if any unacknowledged messages are waiting, and the “message-received” and “pending-message-removed” signals will be emitted.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.13.10


TP_TEXT_CHANNEL_FEATURE_SMS

#define             TP_TEXT_CHANNEL_FEATURE_SMS

Expands to a call to a function that returns a quark representing the SMS feature of a TpTextChannel.

When this feature is prepared, the TpTextChannel:is-sms-channel property will have a meaningful value and will be updated when needed.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.1


TP_TEXT_CHANNEL_FEATURE_CHAT_STATES

#define             TP_TEXT_CHANNEL_FEATURE_CHAT_STATES

Expands to a call to a function that returns a quark representing the chat states feature on a TpTextChannel.

When this feature is prepared, tp_text_channel_get_chat_state() and the “contact-chat-state-changed” signal become useful.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.19.0

Property Details

The “delivery-reporting-support” property

  “delivery-reporting-support” guint

A TpDeliveryReportingSupportFlags indicating features supported by this channel.

Owner: TpTextChannel

Flags: Read

Default value: 0

Since: 0.13.10


The “is-sms-channel” property

  “is-sms-channel”           gboolean

TRUE if messages sent and received on this channel are transmitted via SMS.

This property is not guaranteed to have a meaningful value until TP_TEXT_CHANNEL_FEATURE_SMS has been prepared.

Owner: TpTextChannel

Flags: Read

Default value: FALSE

Since: 0.15.1


The “message-part-support-flags” property

  “message-part-support-flags” guint

A TpMessagePartSupportFlags indicating the level of support for message parts on this channel.

Owner: TpTextChannel

Flags: Read

Default value: 0

Since: 0.13.10


The “message-types” property

  “message-types”            GArray_guint_ *

A GArray containing the TpChannelTextMessageType which may be sent on this channel.

Owner: TpTextChannel

Flags: Read

Since: 0.13.16


The “sms-flash” property

  “sms-flash”                gboolean

TRUE if this channel is exclusively for receiving class 0 SMSes (and no SMSes can be sent using tp_text_channel_send_message_async() on this channel). If FALSE, no incoming class 0 SMSes will appear on this channel.

Owner: TpTextChannel

Flags: Read

Default value: FALSE

Since: 0.15.1


The “supported-content-types” property

  “supported-content-types”  GStrv

A GStrv containing the MIME types supported by this channel, with more preferred MIME types appearing earlier in the array.

Owner: TpTextChannel

Flags: Read

Since: 0.13.10

Signal Details

The “contact-chat-state-changed” signal

void
user_function (TpTextChannel *self,
               TpContact     *contact,
               guint          state,
               gpointer       user_data)

Emitted when a contact's chat state changes after tp_proxy_prepare_async() has finished preparing features TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, TP_CHANNEL_FEATURE_GROUP and TP_CHANNEL_FEATURE_CONTACTS.

Parameters

self

a channel

 

contact

a TpContact for the local user or another contact

 

state

the new TpChannelChatState for the contact

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.19.0


The “message-received” signal

void
user_function (TpTextChannel      *self,
               TpSignalledMessage *message,
               gpointer            user_data)

The ::message-received signal is emitted when a new message has been received on self .

The same message object will be used by the “pending-message-removed” signal once message has been acked so you can simply compare pointers to identify the message.

Note that this signal is only fired once the TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.

It is guaranteed that message 's “sender” has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

the TpTextChannel

 

message

a TpSignalledMessage

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.10


The “message-sent” signal

void
user_function (TpTextChannel      *self,
               TpSignalledMessage *message,
               guint               flags,
               gchar              *token,
               gpointer            user_data)

The ::message-sent signal is emitted when message has been submitted for sending.

It is guaranteed that message 's “sender” has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

the TpTextChannel

 

message

a TpSignalledMessage

 

flags

the TpMessageSendingFlags affecting how the message was sent

 

token

an opaque token used to match any incoming delivery or failure reports against this message, or NULL if the message is not readily identifiable.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.10


The “pending-message-removed” signal

void
user_function (TpTextChannel      *self,
               TpSignalledMessage *message,
               gpointer            user_data)

The ::pending-message-removed signal is emitted when message has been acked and so removed from the pending messages list.

Note that this signal is only fired once the TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared.

It is guaranteed that message 's “sender” has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

the TpTextChannel

 

message

a TpSignalledMessage

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.10

telepathy-glib-0.24.2/docs/reference/html/home.png0000644000175000017500000000040014006623343016715 00000000000000PNG  IHDRabKGD pHYs B(xtIME &IDAT8ҽ Aߞf`n v`6`/`Yܡ`f&k$,} 0b+ԸaQW~b O e{y N[L}.piBzmm o.I]7^[;%:VIENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpPresenceMixin.html0000644000175000017500000023237014006623343024147 00000000000000 TpPresenceMixin: telepathy-glib API Reference Manual

TpPresenceMixin

TpPresenceMixin — a mixin implementation of the Presence connection interface

Object Hierarchy

    GBoxed
    ╰── TpPresenceStatusSpec

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This mixin can be added to a TpBaseConnection subclass to implement the SimplePresence and/or Presence interfaces. Implementing both interfaces (as described below) is recommended. In particular, you must implement the old-style Presence interface if compatibility with telepathy-glib versions older than 0.11.13 is required.

To use the presence mixin, include a TpPresenceMixinClass somewhere in your class structure and a TpPresenceMixin somewhere in your instance structure, and call tp_presence_mixin_class_init() from your class_init function, tp_presence_mixin_init() from your init function or constructor, and tp_presence_mixin_finalize() from your dispose or finalize function.

Implementing SimplePresence

Since 0.7.13 this mixin supports the entire SimplePresence interface. You can implement TpSvcConnectionInterfaceSimplePresence as follows:

Implementing old-style Presence

This mixin also supports a large subset of the deprecated Presence interface. It does not support protocols where it is possible to set multiple statuses on yourself at once (all presence statuses will have the exclusive flag set), or last-activity-time information.

To use the presence mixin as the implementation of TpSvcConnectionInterfacePresence, use tp_presence_mixin_iface_init() as the function you pass to G_IMPLEMENT_INTERFACE(), as in the following example. The presence mixin implements all of the D-Bus methods in the Presence interface.

1
2
3
4
5
6
7
G_DEFINE_TYPE_WITH_CODE (MyConnection, my_connection,
    TP_TYPE_BASE_CONNECTION,
    // ...
    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE,
        tp_presence_mixin_iface_init);
    // ...
    )

In telepathy-glib versions older than 0.11.13, every connection that used the TpPresenceMixin was required to implement TpSvcConnectionInterfacePresence; failing to do so would lead to an assertion failure. Since 0.11.13, this is no longer required.

Functions

tp_presence_status_spec_can_set_on_self ()

gboolean
tp_presence_status_spec_can_set_on_self
                               (const TpPresenceStatusSpec *self);

Parameters

self

a presence status specification

 

Returns

TRUE if the user can set this presence status on themselves (most statuses), or FALSE if they cannot directly set it on themselves (typically used for TP_CONNECTION_PRESENCE_TYPE_OFFLINE and TP_CONNECTION_PRESENCE_TYPE_ERROR)

Since: 0.23.1


tp_presence_status_spec_get_name ()

const gchar *
tp_presence_status_spec_get_name (const TpPresenceStatusSpec *self);

Parameters

self

a presence status specification

 

Returns

the name of this presence status, such as "available" or "out-to-lunch".

[transfer none]

Since: 0.23.1


tp_presence_status_spec_get_presence_type ()

TpConnectionPresenceType
tp_presence_status_spec_get_presence_type
                               (const TpPresenceStatusSpec *self);

Return the category into which this presence type falls. For instance, for XMPP's "" (do not disturb) status, this would return TP_CONNECTION_PRESENCE_TYPE_BUSY.

Parameters

self

a presence status specification

 

Since: 0.23.1


tp_presence_status_spec_has_message ()

gboolean
tp_presence_status_spec_has_message (const TpPresenceStatusSpec *self);

Parameters

self

a presence status specification

 

Returns

TRUE if this presence status is accompanied by an optional human-readable message

Since: 0.23.1


tp_presence_status_spec_new ()

TpPresenceStatusSpec *
tp_presence_status_spec_new (const gchar *name,
                             TpConnectionPresenceType type,
                             gboolean can_set_on_self,
                             gboolean has_message);

Parameters

name

the name of the new presence status

 

type

the category into which this presence status falls

 

can_set_on_self

TRUE if the user can set this presence status on themselves

 

has_message

TRUE if this presence status is accompanied by an optional human-readable message

 

Returns

a new TpPresenceStatusSpec.

[transfer full]

Since: 0.23.1


tp_presence_status_spec_copy ()

TpPresenceStatusSpec *
tp_presence_status_spec_copy (const TpPresenceStatusSpec *self);

Copy a presence status specification.

If self has optional arguments other than a string named "message", they are not copied. Optional arguments with other names or types are deprecated.

Parameters

self

a presence status specification

 

Returns

a new TpPresenceStatusSpec resembling self .

[transfer full]

Since: 0.23.1


tp_presence_status_spec_free ()

void
tp_presence_status_spec_free (TpPresenceStatusSpec *self);

Free a presence status specification produced by tp_presence_status_spec_new() or tp_presence_status_spec_copy().

Parameters

self

a presence status specification.

[transfer full]

Since: 0.23.1


TpPresenceMixinStatusAvailableFunc ()

gboolean
(*TpPresenceMixinStatusAvailableFunc) (GObject *obj,
                                       guint which);

Signature of a callback to be used to determine if a given presence status can be set on the connection. Most users of this mixin do not need to supply an implementation of this callback: the value of TpPresenceStatusSpec.self is enough to determine whether this is a user-settable presence, so NULL should be passed to tp_presence_mixin_class_init() for this callback.

One place where this callback may be needed is on XMPP: not all server implementation support the user becoming invisible. So an XMPP implementation would implement this function, so that—once connected—the hidden status is only available if the server supports it. Before the connection is connected, this callback should return TRUE for every status that might possibly be supported: this allows the user to at least try to sign in as invisible.

Parameters

obj

An instance of a TpBaseConnection subclass implementing the presence interface with this mixin

 

which

An index into the array of TpPresenceStatusSpec provided to tp_presence_mixin_class_init()

 

Returns

TRUE if the status can be set on this connection; FALSE if not.


TpPresenceMixinGetContactStatusesFunc ()

GHashTable *
(*TpPresenceMixinGetContactStatusesFunc)
                               (GObject *obj,
                                const GArray *contacts,
                                GError **error);

Signature of the callback used to get the stored presence status of contacts. The returned hash table should have contact handles mapped to their respective presence statuses in TpPresenceStatus structs.

The returned hash table will be freed with g_hash_table_unref. The callback is responsible for ensuring that this does any cleanup that may be necessary.

Parameters

obj

An object with this mixin.

 

contacts

An array of TpHandle for the contacts to get presence status for

 

error

Used to return a Telepathy D-Bus error if NULL is returned

 

Returns

The contact presence on success, NULL with error set on error.

[transfer full]


TpPresenceMixinSetOwnStatusFunc ()

gboolean
(*TpPresenceMixinSetOwnStatusFunc) (GObject *obj,
                                    const TpPresenceStatus *status,
                                    GError **error);

Signature of the callback used to commit changes to the user's own presence status in SetStatuses. It is also used in ClearStatus and RemoveStatus to reset the user's own status back to the "default" one with a NULL status argument.

The optional_arguments hash table in status , if not NULL, will have been filtered so it only contains recognised parameters, so the callback need not (and cannot) check for unrecognised parameters. However, the types of the parameters are not currently checked, so the callback is responsible for doing so.

The callback is responsible for emitting PresenceUpdate, if appropriate, by calling tp_presence_mixin_emit_presence_update().

Parameters

obj

An object with this mixin.

 

status

The status to set, or NULL for whatever the protocol defines as a "default" status

 

error

Used to return a Telepathy D-Bus error if FALSE is returned

 

Returns

TRUE if the operation was successful, FALSE if not.


TpPresenceMixinGetMaximumStatusMessageLengthFunc ()

guint
(*TpPresenceMixinGetMaximumStatusMessageLengthFunc)
                               (GObject *obj);

Signature of a callback used to determine the maximum length of status messages. If this callback is provided and returns non-zero, the TpPresenceMixinSetOwnStatusFunc implementation is responsible for truncating the message to fit this limit, if necessary.

Parameters

obj

An object with this mixin.

 

Returns

the maximum number of UTF-8 characters which may appear in a status message, or 0 if there is no limit.

Since: 0.14.5


tp_presence_status_new ()

TpPresenceStatus *
tp_presence_status_new (guint which,
                        GHashTable *optional_arguments);

Construct a presence status structure. You should free the returned structure with tp_presence_status_free.

In modern Telepathy connection managers, the only optional argument should be a G_TYPE_STRING named "message", on statuses that have an optional human-readable message. All other optional arguments are deprecated.

[skip]

Parameters

which

Index of the presence status in the provided supported presence statuses array

 

optional_arguments

Optional arguments for the presence statuses. Can be NULL if there are no optional arguments. The presence status object makes a copy of the hashtable, so you should free the original.

 

Returns

A pointer to the newly allocated presence status structure.


tp_presence_status_free ()

void
tp_presence_status_free (TpPresenceStatus *status);

Deallocate all resources associated with a presence status structure.

[skip]

Parameters

status

A pointer to the presence status structure to free.

 

tp_presence_mixin_class_init ()

void
tp_presence_mixin_class_init (GObjectClass *obj_cls,
                              glong offset,
                              TpPresenceMixinStatusAvailableFunc status_available,
                              TpPresenceMixinGetContactStatusesFunc get_contact_statuses,
                              TpPresenceMixinSetOwnStatusFunc set_own_status,
                              const TpPresenceStatusSpec *statuses);

Initialize the presence mixin. Should be called from the implementation's class_init function like so:

1
2
3
tp_presence_mixin_class_init ((GObjectClass *) klass,
                              G_STRUCT_OFFSET (SomeObjectClass,
                                               presence_mixin));

[skip]

Parameters

obj_cls

The class of the implementation that uses this mixin

 

offset

The byte offset of the TpPresenceMixinClass within the class structure

 

status_available

A callback to be used to determine if a given presence status can be set on a particular connection. Should usually be NULL, to consider all statuses with TpPresenceStatusSpec.self set to TRUE to be settable.

 

get_contact_statuses

A callback to be used get the current presence status for contacts. This is used in implementations of various D-Bus methods and hence must be provided.

 

set_own_status

A callback to be used to commit changes to the user's own presence status to the server. This is used in implementations of various D-Bus methods and hence must be provided.

 

statuses

An array of TpPresenceStatusSpec structures representing all presence statuses supported by the protocol, terminated by a NULL name.

 

tp_presence_mixin_init ()

void
tp_presence_mixin_init (GObject *obj,
                        glong offset);

Initialize the presence mixin. Should be called from the implementation's instance init function like so:

1
2
tp_presence_mixin_init ((GObject *) self,
                        G_STRUCT_OFFSET (SomeObject, presence_mixin));

[skip]

Parameters

obj

An instance of the implementation that uses this mixin

 

offset

The byte offset of the TpPresenceMixin within the object structure

 

tp_presence_mixin_finalize ()

void
tp_presence_mixin_finalize (GObject *obj);

Free resources held by the presence mixin.

[skip]

Parameters

obj

An object with this mixin.

 

tp_presence_mixin_emit_presence_update ()

void
tp_presence_mixin_emit_presence_update
                               (GObject *obj,
                                GHashTable *contact_presences);

Emit the PresenceUpdate signal for multiple contacts. For emitting PresenceUpdate for a single contact, there is a convenience wrapper called tp_presence_mixin_emit_one_presence_update.

[skip]

Parameters

obj

A connection object with this mixin

 

contact_presences

A mapping of contact handles to TpPresenceStatus structures with the presence data to emit

 

tp_presence_mixin_emit_one_presence_update ()

void
tp_presence_mixin_emit_one_presence_update
                               (GObject *obj,
                                TpHandle handle,
                                const TpPresenceStatus *status);

Emit the PresenceUpdate signal for a single contact. This method is just a convenience wrapper around tp_presence_mixin_emit_presence_update.

[skip]

Parameters

obj

A connection object with this mixin

 

handle

The handle of the contact to emit the signal for

 

status

The new status to emit

 

tp_presence_mixin_iface_init ()

void
tp_presence_mixin_iface_init (gpointer g_iface,
                              gpointer iface_data);

Fill in the vtable entries needed to implement the presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.

[skip]

Parameters

g_iface

A pointer to the TpSvcConnectionInterfacePresenceClass in an object class

 

iface_data

Ignored

 

tp_presence_mixin_simple_presence_iface_init ()

void
tp_presence_mixin_simple_presence_iface_init
                               (gpointer g_iface,
                                gpointer iface_data);

Fill in the vtable entries needed to implement the simple presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.

[skip]

Parameters

g_iface

A pointer to the TpSvcConnectionInterfaceSimplePresenceClass in an object class

 

iface_data

Ignored

 

Since: 0.7.13


tp_presence_mixin_simple_presence_init_dbus_properties ()

void
tp_presence_mixin_simple_presence_init_dbus_properties
                               (GObjectClass *cls);

Set up TpDBusPropertiesMixinClass to use this mixin's implementation of the SimplePresence interface's properties.

This automatically sets up a list of the supported properties for the SimplePresence interface.

[skip]

Parameters

cls

The class of an object with this mixin

 

Since: 0.7.13


tp_presence_mixin_simple_presence_register_with_contacts_mixin ()

void
tp_presence_mixin_simple_presence_register_with_contacts_mixin
                               (GObject *obj);

Register the SimplePresence interface with the Contacts interface to make it inspectable. The Contacts mixin should be initialized before this function is called

[skip]

Parameters

obj

An instance that of the implementation that uses both the Contacts mixin and this mixin

 

Types and Values

struct TpPresenceStatusOptionalArgumentSpec

struct TpPresenceStatusOptionalArgumentSpec {
    const gchar *name;
    const gchar *dtype;
};

Structure specifying a supported optional argument for a presence status.

In addition to the fields documented here, there are two gpointer fields which must currently be NULL. A meaning may be defined for these in a future version of telepathy-glib.

Members

const gchar *name;

Name of the argument as passed over D-Bus

 

const gchar *dtype;

D-Bus type signature of the argument

 

struct TpPresenceStatusSpec

struct TpPresenceStatusSpec {
    const gchar *name;
    TpConnectionPresenceType presence_type;
    gboolean self;
    const TpPresenceStatusOptionalArgumentSpec *optional_arguments;
};

Structure specifying a supported presence status.

In addition to the fields documented here, there are two gpointer fields which must currently be NULL. A meaning may be defined for these in a future version of telepathy-glib.

Members

const gchar *name;

String identifier of the presence status

 

TpConnectionPresenceType presence_type;

A type value, as specified by TpConnectionPresenceType

 

gboolean self;

Indicates if this status may be set on yourself

 

const TpPresenceStatusOptionalArgumentSpec *optional_arguments;

An array of TpPresenceStatusOptionalArgumentSpec structures representing the optional arguments for this status, terminated by a NULL name. If there are no optional arguments for a status, this can be NULL. In modern Telepathy connection managers, the only optional argument should be a string (type "s") named "message" on statuses that have an optional human-readable message. All other optional arguments are deprecated.

 

struct TpPresenceStatus

struct TpPresenceStatus {
    guint index;
    GHashTable *optional_arguments;
};

Structure representing a presence status.

In addition to the fields documented here, there are two gpointer fields which must currently be NULL. A meaning may be defined for these in a future version of telepathy-glib.

In modern Telepathy connection managers, the only optional argument should be a G_TYPE_STRING named "message", on statuses that have an optional human-readable message. All other optional arguments are deprecated.

Members

guint index;

Index of the presence status in the provided supported presence statuses array

 

GHashTable *optional_arguments;

A GHashTable mapping of string identifiers to GValues of the optional status arguments, if any. If there are no optional arguments, this pointer may be NULL.

 

struct TpPresenceMixin

struct TpPresenceMixin {
};

Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_presence_mixin_init().

There are no public fields.


struct TpPresenceMixinClass

struct TpPresenceMixinClass {
    TpPresenceMixinStatusAvailableFunc status_available;
    TpPresenceMixinGetContactStatusesFunc get_contact_statuses;
    TpPresenceMixinSetOwnStatusFunc set_own_status;

    const TpPresenceStatusSpec *statuses;

    TpPresenceMixinGetMaximumStatusMessageLengthFunc get_maximum_status_message_length;
};

Structure to be included in the class structure of objects that use this mixin. Initialize it with tp_presence_mixin_class_init().

If the protocol imposes a limit on the length of status messages, one should implement get_maximum_status_message_length . If this callback is not implemented, it is assumed that there is no limit. The callback function should be set after calling tp_presence_mixin_class_init(), like so:

1
2
3
4
5
6
7
TpPresenceMixinClass *mixin_class;

tp_presence_mixin_class_init ((GObjectClass *) klass,
    G_STRUCT_OFFSET (SomeObjectClass, presence_mixin));
mixin_class = TP_PRESENCE_MIXIN_CLASS (klass);
mixin_class->get_maximum_status_message_length =
    some_object_get_maximum_status_message_length;

All other fields should be considered read-only.

Members

TpPresenceMixinStatusAvailableFunc status_available;

The status-available function that was passed to tp_presence_mixin_class_init()

 

TpPresenceMixinGetContactStatusesFunc get_contact_statuses;

The get-contact-statuses function that was passed to tp_presence_mixin_class_init()

 

TpPresenceMixinSetOwnStatusFunc set_own_status;

The set-own-status function that was passed to tp_presence_mixin_class_init()

 

const TpPresenceStatusSpec *statuses;

The presence statuses array that was passed to tp_presence_mixin_class_init()

 

TpPresenceMixinGetMaximumStatusMessageLengthFunc get_maximum_status_message_length;

The callback used to discover the the limit for status messages length, if any. Since: 0.14.5

 
telepathy-glib-0.24.2/docs/reference/html/TpBaseCallContent.html0000644000175000017500000013564514006623343021476 00000000000000 TpBaseCallContent: telepathy-glib API Reference Manual

TpBaseCallContent

TpBaseCallContent — base class for TpSvcCallContent implementations

Properties

TpBaseConnection * connection Read / Write / Construct Only
guint creator Read / Write / Construct Only
gboolean currently-sending-tones Read
gchar * deferred-tones Read
guint disposition Read / Write / Construct Only
GStrv interfaces Read
guint media-type Read / Write / Construct Only
gchar * name Read / Write / Construct Only
gchar * object-path Read / Write / Construct Only
GPtrArray_DBusGObjectPath_ * streams Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseCallContent
        ╰── TpBaseMediaCallContent

Implemented Interfaces

TpBaseCallContent implements TpSvcDBusProperties, TpSvcCallContent and TpSvcCallContentInterfaceDTMF.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcCallContent implementations by implementing its properties, and some of its methods.

Subclasses should fill in TpBaseCallContentClass.get_interfaces, and TpBaseCallContentClass.deinit virtual function.

Functions

TpBaseCallContentGetInterfacesFunc ()

GPtrArray *
(*TpBaseCallContentGetInterfacesFunc) (TpBaseCallContent *self);

Signature of an implementation of TpBaseCallContentClass.get_interfaces.

Parameters

self

a TpBaseCallContent

 

Returns

a GPtrArray containing static strings.

Since: 0.17.5


TpBaseCallContentDeinitFunc ()

void
(*TpBaseCallContentDeinitFunc) (TpBaseCallContent *self);

Signature of an implementation of TpBaseCallContentClass.deinit.

Parameters

self

a TpBaseCallContent

 

Since: 0.17.5


TpBaseCallContentMultipleTonesFunc ()

gboolean
(*TpBaseCallContentMultipleTonesFunc) (TpBaseCallContent *self,
                                       const gchar *tones,
                                       GError **error);

Signature of an implementation of TpBaseCallContentClass.multiple_tones.

Parameters

self

a TpBaseCallContent

 

tones

a string representation of one or more DTMF events

 

error

a GError to fill

 

Returns

TRUE on success, otherwise FALSE and set error

Since: 0.17.5


TpBaseCallContentStartToneFunc ()

gboolean
(*TpBaseCallContentStartToneFunc) (TpBaseCallContent *self,
                                   TpDTMFEvent event,
                                   GError **error);

Signature of an implementation of TpBaseCallContentClass.start_tone.

Parameters

self

a TpBaseCallContent

 

event

a TpDTMFEvent

 

error

a GError to fill

 

Returns

TRUE on success, otherwise FALSE and set error

Since: 0.17.5


TpBaseCallContentStopToneFunc ()

gboolean
(*TpBaseCallContentStopToneFunc) (TpBaseCallContent *self,
                                  GError **error);

Signature of an implementation of TpBaseCallContentClass.stop_tone.

Parameters

self

a TpBaseCallContent

 

error

a GError to fill

 

Returns

TRUE on success, otherwise FALSE and set error

Since: 0.17.5


tp_base_call_content_get_connection ()

TpBaseConnection *
tp_base_call_content_get_connection (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

the value of “connection”

Since: 0.17.5


tp_base_call_content_get_object_path ()

const gchar *
tp_base_call_content_get_object_path (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

the value of “object-path”

Since: 0.17.5


tp_base_call_content_get_name ()

const gchar *
tp_base_call_content_get_name (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

the value of “name”

Since: 0.17.5


tp_base_call_content_get_media_type ()

TpMediaStreamType
tp_base_call_content_get_media_type (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

the value of “media-type”

Since: 0.17.5


tp_base_call_content_get_disposition ()

TpCallContentDisposition
tp_base_call_content_get_disposition (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

the value of “disposition”

Since: 0.17.5


tp_base_call_content_get_streams ()

GList *
tp_base_call_content_get_streams (TpBaseCallContent *self);

Parameters

self

a TpBaseCallContent

 

Returns

a GList of TpBaseCallStream of this content.

Since: 0.17.5


tp_base_call_content_add_stream ()

void
tp_base_call_content_add_stream (TpBaseCallContent *self,
                                 TpBaseCallStream *stream);

Add stream to self 's “streams”. Emitting StreamsAdded DBus signal.

Parameters

self

a TpBaseCallContent

 

stream

a TpBaseCallStream

 

Since: 0.17.5


tp_base_call_content_remove_stream ()

void
tp_base_call_content_remove_stream (TpBaseCallContent *self,
                                    TpBaseCallStream *stream,
                                    TpHandle actor_handle,
                                    TpCallStateChangeReason reason,
                                    const gchar *dbus_reason,
                                    const gchar *message);

Remove stream from self 's “streams”. Emitting StreamsRemoved DBus signal.

Parameters

self

a TpBaseCallContent

 

stream

a TpBaseCallStream

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5

Types and Values

struct TpBaseCallContent

struct TpBaseCallContent;

A base class for call content implementations

Since: 0.17.5


struct TpBaseCallContentClass

struct TpBaseCallContentClass {
  TpBaseCallContentDeinitFunc deinit;
  TpBaseCallContentGetInterfacesFunc get_interfaces;

  TpBaseCallContentStartToneFunc start_tone;
  TpBaseCallContentStopToneFunc stop_tone;
  TpBaseCallContentMultipleTonesFunc multiple_tones;
};

The class structure for TpBaseCallContent

Members

TpBaseCallContentDeinitFunc deinit;

optional; virtual method called by TpBaseCallChannel when removing the content

 

TpBaseCallContentGetInterfacesFunc get_interfaces;

extra interfaces provided by this content (this SHOULD NOT include TP_IFACE_CALL_CONTENT itself). Implementation must first chainup on parent class implementation then add extra interfaces into the GPtrArray.

 

TpBaseCallContentStartToneFunc start_tone;

optional; virtual method called when user requested to send a DTMF tone. Note that this method is already implemented by TpBaseMediaCallContent and so does not have to be overriden when using that subclass

 

TpBaseCallContentStopToneFunc stop_tone;

optional; virtual method called when user requested to stop sending currently being played DTMF tones. Note that this method is already implemented by TpBaseMediaCallContent and so does not have to be overriden when using that subclass

 

TpBaseCallContentMultipleTonesFunc multiple_tones;

optional; virtual method called when user requested to send multiple DTMF tones. Note that this method is already implemented by TpBaseMediaCallContent and so does not have to be overriden when using that subclass

 

Since: 0.17.5

Property Details

The “connection” property

  “connection”               TpBaseConnection *

TpBaseConnection object that owns this call content.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Since: 0.17.5


The “creator” property

  “creator”                  guint

The contact TpHandle of the creator of this content.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “currently-sending-tones” property

  “currently-sending-tones”  gboolean

If this content is currently sending tones or not

Owner: TpBaseCallContent

Flags: Read

Default value: FALSE

Since: 0.17.5


The “deferred-tones” property

  “deferred-tones”           gchar *

Tones that are waiting for the user action to play.

Owner: TpBaseCallContent

Flags: Read

Default value: NULL

Since: 0.17.5


The “disposition” property

  “disposition”              guint

The TpCallContentDisposition of this content.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “interfaces” property

  “interfaces”               GStrv

Additional interfaces implemented by this content.

Owner: TpBaseCallContent

Flags: Read

Since: 0.17.5


The “media-type” property

  “media-type”               guint

The TpMediaStreamType of this content.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “name” property

  “name”                     gchar *

The name of this content, if any.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Default value: ""

Since: 0.17.5


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus.

Owner: TpBaseCallContent

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.17.5


The “streams” property

  “streams”                  GPtrArray_DBusGObjectPath_ *

A GPtrArray of this content streams' “object-path”.

Owner: TpBaseCallContent

Flags: Read

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-handle-channels-context.html0000644000175000017500000006520414006623344025601 00000000000000 TpHandleChannelsContext: telepathy-glib API Reference Manual

TpHandleChannelsContext

TpHandleChannelsContext — context of a Handler.HandleChannels() call

Properties

TpAccount * account Read / Write / Construct Only
GPtrArray * channels Read / Write / Construct Only
TpConnection * connection Read / Write / Construct Only
gpointer dbus-context Write / Construct Only
GHashTable_gchararray+GValue_* handler-info Read / Write / Construct Only
GPtrArray * requests-satisfied Read / Write / Construct Only
gint64 user-action-time Read / Write / Construct Only

Signals

void done Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpHandleChannelsContext

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Object used to represent the context of a Handler.HandleChannels() D-Bus call on a TpBaseClient.

Functions

tp_handle_channels_context_accept ()

void
tp_handle_channels_context_accept (TpHandleChannelsContext *self);

Called by TpBaseClientClassAddDispatchOperationImpl when it's done so the D-Bus method can return.

The caller is responsible for closing channels with tp_cli_channel_call_close() when it has finished handling them.

Parameters

Since: 0.11.6


tp_handle_channels_context_delay ()

void
tp_handle_channels_context_delay (TpHandleChannelsContext *self);

Called by TpBaseClientClassAddDispatchOperationImpl to indicate that it implements the method in an async way. The caller must take a reference to the TpHandleChannelsContext before calling this function, and is responsible for calling either tp_handle_channels_context_accept() or tp_handle_channels_context_fail() later.

Parameters

Since: 0.11.6


tp_handle_channels_context_fail ()

void
tp_handle_channels_context_fail (TpHandleChannelsContext *self,
                                 const GError *error);

Called by TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error.

Parameters

self

a TpHandleChannelsContext

 

error

the error to return from the method

 

Since: 0.11.6


tp_handle_channels_context_get_handler_info ()

const GHashTable *
tp_handle_channels_context_get_handler_info
                               (TpHandleChannelsContext *self);

Return any extra information that accompanied this request to handle channels (the Handler_Info argument from the HandleChannels D-Bus method). Well-known keys for this map will be defined by the Telepathy D-Bus Interface Specification; at the time of writing, none have been defined.

The returned hash table is only valid for as long as self is.

Parameters

self

a channel-handling context

 

Returns

extensible extra handler information, in a form suitable for use with tp_asv_get_string() etc.

[transfer none][element-type utf8 GObject.Value]

Since: 0.11.14


tp_handle_channels_context_get_requests ()

GList *
tp_handle_channels_context_get_requests
                               (TpHandleChannelsContext *self);

Return a list of the TpChannelRequest which have been satisfied by the channels associated with self.

Parameters

self

a channel-handling context

 

Returns

a newly allocated GList of reffed TpChannelRequest.

[transfer full][element-type TelepathyGLib.ChannelRequest]

Since: 0.13.14

Types and Values

TpHandleChannelsContext

typedef struct _TpHandleChannelsContext TpHandleChannelsContext;

Data structure representing the context of a Handler.HandleChannels() call.

Since: 0.11.6

Property Details

The “account” property

  “account”                  TpAccount *

A TpAccount object representing the Account of the DispatchOperation that has been passed to HandleChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.6


The “channels” property

  “channels”                 GPtrArray *

A GPtrArray containing TpChannel objects representing the channels that have been passed to HandleChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.6


The “connection” property

  “connection”               TpConnection *

A TpConnection object representing the Connection of the DispatchOperation that has been passed to HandleChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.6


The “dbus-context” property

  “dbus-context”             gpointer

The DBusGMethodInvocation representing the D-Bus context of the HandleChannels call. Can only be written during construction.

[skip]

Owner: TpHandleChannelsContext

Flags: Write / Construct Only

Since: 0.11.6


The “handler-info” property

  “handler-info”             GHashTable_gchararray+GValue_*

A GHashTable where the keys are string and values are GValue instances. It represents the Handler_info hash table that has been passed to HandleChannels.

This property can't be NULL.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.6


The “requests-satisfied” property

  “requests-satisfied”       GPtrArray *

A GPtrArray containing TpChannelRequest objects representing the requests that have been passed to HandleChannels. Read-only except during construction.

This property can't be NULL.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Since: 0.11.6


The “user-action-time” property

  “user-action-time”         gint64

The time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time” for details)

Read-only except during construction.

Owner: TpHandleChannelsContext

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0

Since: 0.11.6

Signal Details

The “done” signal

void
user_function (TpHandleChannelsContext *self,
               gpointer                 user_data)

Emitted when tp_handle_channels_context_accept has been called on self .

Parameters

self

a TpHandleChannelsContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.6

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel.html0000644000175000017500000102057014006623344022501 00000000000000 TpChannel: telepathy-glib API Reference Manual

TpChannel

TpChannel — proxy object for a Telepathy channel

Functions

TpChannel * tp_channel_new ()
TpChannel * tp_channel_new_from_properties ()
gboolean tp_channel_run_until_ready ()
void (*TpChannelWhenReadyCb) ()
void tp_channel_call_when_ready ()
void tp_channel_init_known_interfaces ()
gboolean tp_channel_is_ready ()
TpConnection * tp_channel_borrow_connection ()
GHashTable * tp_channel_borrow_immutable_properties ()
TpConnection * tp_channel_get_connection ()
GVariant * tp_channel_dup_immutable_properties ()
const gchar * tp_channel_get_channel_type ()
GQuark tp_channel_get_channel_type_id ()
TpHandle tp_channel_get_handle ()
const gchar * tp_channel_get_identifier ()
TpContact * tp_channel_get_target_contact ()
gboolean tp_channel_get_requested ()
TpHandle tp_channel_get_initiator_handle ()
const gchar * tp_channel_get_initiator_identifier ()
TpContact * tp_channel_get_initiator_contact ()
void tp_channel_join_async ()
gboolean tp_channel_join_finish ()
void tp_channel_leave_async ()
gboolean tp_channel_leave_finish ()
void tp_channel_close_async ()
gboolean tp_channel_close_finish ()
void tp_channel_destroy_async ()
gboolean tp_channel_destroy_finish ()
TpChannelChatState tp_channel_get_chat_state ()
TpChannelGroupFlags tp_channel_group_get_flags ()
TpHandle tp_channel_group_get_handle_owner ()
TpContact * tp_channel_group_get_contact_owner ()
TpHandle tp_channel_group_get_self_handle ()
TpContact * tp_channel_group_get_self_contact ()
const TpIntset * tp_channel_group_get_members ()
GPtrArray * tp_channel_group_dup_members_contacts ()
const TpIntset * tp_channel_group_get_local_pending ()
GPtrArray * tp_channel_group_dup_local_pending_contacts ()
const TpIntset * tp_channel_group_get_remote_pending ()
GPtrArray * tp_channel_group_dup_remote_pending_contacts ()
gboolean tp_channel_group_get_local_pending_info ()
gboolean tp_channel_group_get_local_pending_contact_info ()
gboolean tp_channel_password_needed ()
void tp_channel_provide_password_async ()
gboolean tp_channel_provide_password_finish ()
TpProxyPendingCall * tp_cli_channel_call_close ()
TpProxyPendingCall * tp_cli_channel_call_get_channel_type ()
TpProxyPendingCall * tp_cli_channel_call_get_handle ()
TpProxyPendingCall * tp_cli_channel_call_get_interfaces ()
void (*tp_cli_channel_callback_for_close) ()
void (*tp_cli_channel_callback_for_get_channel_type) ()
void (*tp_cli_channel_callback_for_get_handle) ()
void (*tp_cli_channel_callback_for_get_interfaces) ()
gboolean tp_cli_channel_run_close ()
gboolean tp_cli_channel_run_get_channel_type ()
gboolean tp_cli_channel_run_get_handle ()
gboolean tp_cli_channel_run_get_interfaces ()
TpProxySignalConnection * tp_cli_channel_connect_to_closed ()
void (*tp_cli_channel_signal_callback_closed) ()
TpProxyPendingCall * tp_cli_channel_interface_destroyable_call_destroy ()
void (*tp_cli_channel_interface_destroyable_callback_for_destroy) ()
gboolean tp_cli_channel_interface_destroyable_run_destroy ()

Properties

GHashTable_gchararray+GValue_* channel-properties Read / Write / Construct Only
gboolean channel-ready Read
TpConnection * connection Read / Write / Construct Only
guint group-flags Read
TpContact * group-self-contact Read
guint group-self-handle Read
gchar * identifier Read
TpContact * initiator-contact Read
guint initiator-handle Read
gchar * initiator-identifier Read
gboolean password-needed Read
gboolean requested Read
TpContact * target-contact Read

Signals

void chat-state-changed Has Details
void group-contacts-changed Has Details
void group-flags-changed Has Details
void group-members-changed Has Details
void group-members-changed-detailed Has Details

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannel
            ├── TpCallChannel
            ├── TpDBusTubeChannel
            ├── TpFileTransferChannel
            ├── TpStreamTubeChannel
            ╰── TpTextChannel

Implemented Interfaces

TpChannel implements TpChannelIface.

Includes

#include <telepathy-glib/channel.h>

Description

TpChannel objects provide convenient access to Telepathy channels.

Compared with a simple proxy for method calls, they add the following features:

  • calling GetChannelType(), GetInterfaces(), GetHandles() automatically

This section also documents the auto-generated C wrappers for the Channel D-Bus interface. Of these, in general, only tp_cli_channel_call_close() and tp_cli_channel_run_close() are useful (the TpChannel object provides a more convenient API for the rest).

Functions

tp_channel_new ()

TpChannel *
tp_channel_new (TpConnection *conn,
                const gchar *object_path,
                const gchar *optional_channel_type,
                TpHandleType optional_handle_type,
                TpHandle optional_handle,
                GError **error);

tp_channel_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_channel() instead.

Parameters

conn

a connection; may not be NULL

 

object_path

the object path of the channel; may not be NULL

 

optional_channel_type

the channel type if already known, or NULL if not

 

optional_handle_type

the handle type if already known, or TP_UNKNOWN_HANDLE_TYPE if not

 

optional_handle

the handle if already known, or 0 if not (if optional_handle_type is TP_UNKNOWN_HANDLE_TYPE or TP_HANDLE_TYPE_NONE, this must be 0)

 

error

used to indicate the error if NULL is returned

 

Returns

a new channel proxy, or NULL on invalid arguments.

Since: 0.7.1


tp_channel_new_from_properties ()

TpChannel *
tp_channel_new_from_properties (TpConnection *conn,
                                const gchar *object_path,
                                const GHashTable *immutable_properties,
                                GError **error);

tp_channel_new_from_properties is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_channel() instead.

Parameters

conn

a connection; may not be NULL

 

object_path

the object path of the channel; may not be NULL

 

immutable_properties

the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to GValue instances.

[transfer none][element-type utf8 GObject.Value]

error

used to indicate the error if NULL is returned

 

Returns

a new channel proxy, or NULL on invalid arguments

Since: 0.7.19


tp_channel_run_until_ready ()

gboolean
tp_channel_run_until_ready (TpChannel *self,
                            GError **error,
                            GMainLoop **loop);

tp_channel_run_until_ready has been deprecated since version 0.11.0 and should not be used in newly-written code.

Use tp_proxy_prepare_async() and re-enter the main loop yourself, or restructure your program in such a way as to avoid re-entering the main loop.

If self is ready for use (introspection has finished, etc.), return immediately. Otherwise, re-enter the main loop until the channel either becomes invalid or becomes ready for use, or until the main loop stored via loop is cancelled.

[skip]

Parameters

self

a channel

 

error

if not NULL and FALSE is returned, used to raise an error

 

loop

if not NULL, a GMainLoop is placed here while it is being run (so calling code can call g_main_loop_quit() to abort), and NULL is placed here after the loop has been run

 

Returns

TRUE if the channel has been introspected and is ready for use, FALSE if the channel has become invalid.

Since: 0.7.1


TpChannelWhenReadyCb ()

void
(*TpChannelWhenReadyCb) (TpChannel *channel,
                         const GError *error,
                         gpointer user_data);

TpChannelWhenReadyCb has been deprecated since version 0.17.6 and should not be used in newly-written code.

Signature of a callback passed to tp_channel_call_when_ready(), which will be called exactly once, when the channel becomes ready or invalid (whichever happens first)

Parameters

channel

the channel (which may be in the middle of being disposed, if error is non-NULL, error->domain is TP_DBUS_ERRORS and error->code is TP_DBUS_ERROR_PROXY_UNREFERENCED)

 

error

NULL if the channel is ready for use, or the error with which it was invalidated if it is now invalid

 

user_data

whatever was passed to tp_channel_call_when_ready()

 

tp_channel_call_when_ready ()

void
tp_channel_call_when_ready (TpChannel *self,
                            TpChannelWhenReadyCb callback,
                            gpointer user_data);

tp_channel_call_when_ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

Use tp_proxy_prepare_async()

If self is ready for use or has been invalidated, call callback immediately, then return. Otherwise, arrange for callback to be called when self either becomes ready for use or becomes invalid.

This is a less general form of tp_proxy_prepare_async(), which should be used in new code. (One important difference is that this function can call callback before it has returned, whereas tp_proxy_prepare_async() always calls callback from the main loop.)

[skip]

Parameters

self

a channel

 

callback

called when the channel becomes ready or invalidated, whichever happens first

 

user_data

arbitrary user-supplied data passed to the callback

 

Since: 0.7.7


tp_channel_init_known_interfaces ()

void
tp_channel_init_known_interfaces (void);

Ensure that the known interfaces for TpChannel have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CHANNEL.

Since: 0.7.6


tp_channel_is_ready ()

gboolean
tp_channel_is_ready (TpChannel *self);

tp_channel_is_ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

use tp_proxy_is_prepared() with TP_CHANNEL_FEATURE_CORE

Returns the same thing as the “channel-ready” property.

New code should use tp_proxy_is_prepared(), which is a more general form of this method.

For group channels, this method is equivalent to checking for the combination of TP_CHANNEL_FEATURE_CORE and TP_CHANNEL_FEATURE_GROUP; for non-group channels, it's equivalent to checking for TP_CHANNEL_FEATURE_CORE.

One important difference is that after “invalidated” is signalled, “channel-ready” keeps its current value - which might be TRUE, if the channel was successfully prepared before it became invalidated - but tp_proxy_is_prepared() returns FALSE for all features.

[skip]

Parameters

self

a channel

 

Returns

TRUE if introspection has completed

Since: 0.7.12


tp_channel_borrow_connection ()

TpConnection *
tp_channel_borrow_connection (TpChannel *self);

tp_channel_borrow_connection is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_get_connection() instead.

Returns the connection for this channel. The returned pointer is only valid while this channel is valid - reference it with g_object_ref() if needed.

Parameters

self

a channel

 

Returns

the value of “connection”.

[transfer none]

Since: 0.7.12


tp_channel_borrow_immutable_properties ()

GHashTable *
tp_channel_borrow_immutable_properties
                               (TpChannel *self);

tp_channel_borrow_immutable_properties is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_dup_immutable_properties() instead.

Returns the immutable D-Bus properties of this channel, the same as “channel-properties”.

The returned hash table should not be altered, and is not necessarily valid after the main loop is next re-entered. Copy it with g_boxed_copy() (its type is TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP) if a copy that remains valid must be kept.

If the “channel-properties” property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the TP_CHANNEL_FEATURE_CORE feature is prepared.

Parameters

self

a channel

 

Returns

a GHashTable where the keys are strings, D-Bus interface name + "." + property name, and the values are GValue instances.

[transfer none][element-type utf8 GObject.Value]


tp_channel_get_connection ()

TpConnection *
tp_channel_get_connection (TpChannel *self);

Returns the connection for this channel. The returned pointer is only valid while this channel is valid - reference it with g_object_ref() if needed.

Parameters

self

a channel

 

Returns

the value of “connection”.

[transfer none]

Since: 0.19.9


tp_channel_dup_immutable_properties ()

GVariant *
tp_channel_dup_immutable_properties (TpChannel *self);

Returns the immutable D-Bus properties of this channel, in a variant of type G_VARIANT_TYPE_VARDICT where the keys are strings, D-Bus interface name + "." + property name. Use g_variant_lookup() or g_variant_lookup_value() for convenient access to the values.

If the “channel-properties” property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the TP_CHANNEL_FEATURE_CORE feature is prepared.

This function should be used only by TpChannel subclasses, otherwise it is recommended to use individual property getters instead.

Parameters

self

a channel

 

Returns

a dictionary where the keys are strings, D-Bus interface name + "." + property name.

[transfer full]

Since: 0.19.9


tp_channel_get_channel_type ()

const gchar *
tp_channel_get_channel_type (TpChannel *self);

Get the D-Bus interface name representing this channel's type, if it has been discovered.

This is the same as the “channel-type” property; it isn't guaranteed to be non-NULL until the TP_CHANNEL_FEATURE_CORE feature has been prepared.

Parameters

self

a channel

 

Returns

the channel type, if the channel is ready; either the channel type or NULL, if the channel is not yet ready.

Since: 0.7.12


tp_channel_get_channel_type_id ()

GQuark
tp_channel_get_channel_type_id (TpChannel *self);

Get the D-Bus interface name representing this channel's type, as a GQuark, if it has been discovered.

This is the same as the “channel-type” property, except that it is a GQuark rather than a string. It isn't guaranteed to be nonzero until the TP_CHANNEL_FEATURE_CORE property is ready.

Parameters

self

a channel

 

Returns

the channel type, if the channel is ready; either the channel type or 0, if the channel is not yet ready.

Since: 0.7.12


tp_channel_get_handle ()

TpHandle
tp_channel_get_handle (TpChannel *self,
                       TpHandleType *handle_type);

Get the handle representing the contact, chatroom, etc. with which this channel communicates for its whole lifetime, or 0 if there is no such handle or it has not yet been discovered.

This is the same as the “handle” property. It isn't guaranteed to have its final value until the TP_CHANNEL_FEATURE_CORE feature is ready.

If handle_type is not NULL, the type of handle is written into it. This will be TP_UNKNOWN_HANDLE_TYPE if the handle has not yet been discovered, or TP_HANDLE_TYPE_NONE if there is no handle with which this channel will always communicate. This is the same as the “handle-type” property.

Parameters

self

a channel

 

handle_type

if not NULL, used to return the type of this handle.

[out]

Returns

the handle

Since: 0.7.12


tp_channel_get_identifier ()

const gchar *
tp_channel_get_identifier (TpChannel *self);

This channel's associated identifier, or the empty string if no identifier or unknown.

This is the same as the “identifier” property, and isn't guaranteed to be set until the TP_CHANNEL_FEATURE_CORE property is ready.

Changed in 0.11.4: as with “identifier”, this could previously either be NULL or the empty string if there was no suitable value. It is now non-NULL in all cases.

Parameters

self

a channel

 

Returns

the identifier

Since: 0.7.21


tp_channel_get_target_contact ()

TpContact *
tp_channel_get_target_contact (TpChannel *self);

Parameters

self

a channel

 

Returns

the value of “target-contact”.

[transfer none]

Since: 0.15.6


tp_channel_get_requested ()

gboolean
tp_channel_get_requested (TpChannel *self);

Return the “requested” property

Parameters

self

a TpChannel

 

Returns

the value of “requested”

Since: 0.11.15


tp_channel_get_initiator_handle ()

TpHandle
tp_channel_get_initiator_handle (TpChannel *self);

tp_channel_get_initiator_handle is deprecated and should not be used in newly-written code.

New code should use tp_channel_get_initiator_contact() instead.

Return the “initiator-handle” property

[skip]

Parameters

self

a TpChannel

 

Returns

the value of “initiator-handle”

Since: 0.11.15


tp_channel_get_initiator_identifier ()

const gchar *
tp_channel_get_initiator_identifier (TpChannel *self);

tp_channel_get_initiator_identifier is deprecated and should not be used in newly-written code.

New code should use tp_channel_get_initiator_contact() instead.

Return the “initiator-identifier” property

[skip]

Parameters

self

a TpChannel

 

Returns

the value of “initiator-identifier”

Since: 0.11.15


tp_channel_get_initiator_contact ()

TpContact *
tp_channel_get_initiator_contact (TpChannel *self);

Parameters

self

a channel

 

Returns

the value of “initiator-contact”.

[transfer none]

Since: 0.15.6


tp_channel_join_async ()

void
tp_channel_join_async (TpChannel *self,
                       const gchar *message,
                       GAsyncReadyCallback callback,
                       gpointer user_data);

Join channel self with message as join message.

When we joined the channel, callback will be called. You can then call tp_channel_join_finish() to get the result of the operation.

Note that unlike tp_channel_leave_async(), TP_CHANNEL_FEATURE_GROUP feature must be prepared before calling this function.

Parameters

self

a TpChannel

 

message

the join message

 

callback

a callback to call when we joined the channel

 

user_data

data to pass to callback

 

Since: 0.15.5


tp_channel_join_finish ()

gboolean
tp_channel_join_finish (TpChannel *self,
                        GAsyncResult *result,
                        GError **error);

Completes a call to tp_channel_join_async().

Parameters

self

a TpChannel

 

result

a GAsyncResult passed to the callback for tp_channel_join_async().

 

error

a GError to fill

 

Returns

TRUE if the channel was successfully joined; FALSE otherwise

Since: 0.15.5


tp_channel_leave_async ()

void
tp_channel_leave_async (TpChannel *self,
                        TpChannelGroupChangeReason reason,
                        const gchar *message,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Leave channel self with reason as reason and message as leave message. If self doesn't implement TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP or if for any reason we can't properly leave the channel, we close it.

When we left the channel, callback will be called. You can then call tp_channel_leave_finish() to get the result of the operation.

Note that unlike tp_channel_join_async(), TP_CHANNEL_FEATURE_GROUP feature does not have to be prepared and will be prepared for you. But this is a deprecated behaviour.

Parameters

self

a TpChannel

 

reason

the leave reason

 

message

the leave message

 

callback

a callback to call when we left the channel

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_channel_leave_finish ()

gboolean
tp_channel_leave_finish (TpChannel *self,
                         GAsyncResult *result,
                         GError **error);

Completes a call to tp_channel_leave_async().

Parameters

self

a TpChannel

 

result

a GAsyncResult passed to the callback for tp_channel_leave_async().

 

error

a GError to fill

 

Returns

TRUE if the channel has been left; FALSE otherwise

Since: 0.13.10


tp_channel_close_async ()

void
tp_channel_close_async (TpChannel *self,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Close channel self . In most cases, it's generally cleaner to use tp_channel_leave_async() instead to properly leave and close the channel.

When the channel has been closed, callback will be called. You can then call tp_channel_close_finish() to get the result of the operation.

Parameters

self

a TpChannel

 

callback

a callback to call when we closed the channel, or NULL to ignore any reply

 

user_data

data to pass to callback

 

Since: 0.13.10


tp_channel_close_finish ()

gboolean
tp_channel_close_finish (TpChannel *self,
                         GAsyncResult *result,
                         GError **error);

Finishes a call to tp_channel_leave_async().

Parameters

self

a TpChannel

 

result

a GAsyncResult passed to the callback for tp_channel_close_async().

 

error

a GError to fill

 

Returns

TRUE if the channel has been closed; FALSE otherwise

Since: 0.13.10


tp_channel_destroy_async ()

void
tp_channel_destroy_async (TpChannel *self,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Destroy channel self . If self doesn't implement TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE or if for any reason we can't destroy the channel, we close it.

When the channel has been destroyed or closed, callback will be called. You can then call tp_channel_destroy_finish() to get the result of the operation.

Parameters

self

a TpChannel

 

callback

a callback to call when we left the channel

 

user_data

data to pass to callback

 

Since: 0.15.2


tp_channel_destroy_finish ()

gboolean
tp_channel_destroy_finish (TpChannel *self,
                           GAsyncResult *result,
                           GError **error);

Completes a call to tp_channel_destroy_async().

Parameters

self

a TpChannel

 

result

a GAsyncResult passed to the callback for tp_channel_destroy_async().

 

error

a GError to fill

 

Returns

TRUE if the channel has been destroyed or closed; FALSE otherwise

Since: 0.15.2


tp_channel_get_chat_state ()

TpChannelChatState
tp_channel_get_chat_state (TpChannel *self,
                           TpHandle contact);

tp_channel_get_chat_state is deprecated and should not be used in newly-written code.

Use tp_text_channel_get_chat_state() instead.

Return the chat state for the given contact. If tp_proxy_is_prepared() would return FALSE for the feature TP_CHANNEL_FEATURE_CHAT_STATES, the result will always be TP_CHANNEL_CHAT_STATE_INACTIVE.

Parameters

self

a channel

 

contact

a contact handle

 

Returns

the chat state for contact , or TP_CHANNEL_CHAT_STATE_INACTIVE if their chat state is not known

Since: 0.11.3


tp_channel_group_get_flags ()

TpChannelGroupFlags
tp_channel_group_get_flags (TpChannel *self);

Return the “group-flags” property (see the description of that property for notes on validity).

Parameters

self

a channel

 

Returns

the group flags, or 0

Since: 0.7.12


tp_channel_group_get_handle_owner ()

TpHandle
tp_channel_group_get_handle_owner (TpChannel *self,
                                   TpHandle handle);

tp_channel_group_get_handle_owner is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_get_contact_owner() instead.

Synopsis (see below for further explanation):

  • if self is not a group or handle is not a member of this channel, result is undefined;

  • if TP_CHANNEL_FEATURE_GROUP has not yet been prepared, result is undefined;

  • if self does not have flags that include TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined;

  • if handle is channel-specific and its globally valid "owner" is known, return that owner;

  • if handle is channel-specific and its globally valid "owner" is unknown, return zero;

  • if handle is globally valid, return handle itself

Some channels (those with flags that include TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific handles". These are handles that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname.

Depending on the protocol and configuration, it might be possible to find out what globally valid handle (i.e. an identifier that you could add to your contact list) "owns" a channel-specific handle. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.

This is further complicated by the fact that channels with channel-specific handles can sometimes have members with globally valid handles (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the handle representing that JID in the Group's remote-pending set).

This function's result is undefined unless the channel is ready and its flags include TP_CHANNEL_GROUP_FLAG_PROPERTIES (an implementation without extra D-Bus round trips is not possible using the older API).

Parameters

self

a channel

 

handle

a handle which is a member of this channel

 

Returns

the global handle that owns the given handle, or 0

Since: 0.7.12


tp_channel_group_get_contact_owner ()

TpContact *
tp_channel_group_get_contact_owner (TpChannel *self,
                                    TpContact *contact);

Synopsis (see below for further explanation):

  • if self is not a group or contact is not a member of this channel, result is undefined;

  • if TP_CHANNEL_FEATURE_CONTACTS has not yet been prepared, result is undefined;

  • if self does not have flags that include TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined;

  • if contact is channel-specific and its globally valid "owner" is known, return that owner;

  • if contact is channel-specific and its globally valid "owner" is unknown, return NULL;

  • if contact is globally valid, return contact itself

Some channels (those with flags that include TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific contacts". These are contacts that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname.

Depending on the protocol and configuration, it might be possible to find out what globally valid contact (i.e. a contact that you could add to your contact list) "owns" a channel-specific contact. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can.

This is further complicated by the fact that channels with channel-specific contacts can sometimes have members with globally valid contacts (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the contact representing that JID in the Group's remote-pending set).

Parameters

self

a channel

 

contact

a contact which is a member of this channel

 

Returns

the global contact that owns the given contact, or NULL.

[transfer none]

Since: 0.15.6


tp_channel_group_get_self_handle ()

TpHandle
tp_channel_group_get_self_handle (TpChannel *self);

tp_channel_group_get_self_handle is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_get_self_contact() instead.

Return the “group-self-handle” property (see the description of that property for notes on validity).

Parameters

self

a channel

 

Returns

the handle representing the user, or 0

Since: 0.7.12


tp_channel_group_get_self_contact ()

TpContact *
tp_channel_group_get_self_contact (TpChannel *self);

Parameters

self

a channel

 

Returns

the value of “group-self-contact”.

[transfer none]

Since: 0.15.6


tp_channel_group_get_members ()

const TpIntset *
tp_channel_group_get_members (TpChannel *self);

tp_channel_group_get_members is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_dup_members_contacts() instead.

If self is a group and the TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a TpIntset containing its members.

If self is a group but TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

the members, or NULL.

[transfer none]

Since: 0.7.12


tp_channel_group_dup_members_contacts ()

GPtrArray *
tp_channel_group_dup_members_contacts (TpChannel *self);

If self is a group and the TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a GPtrArray containing its members.

If self is a group but TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

a new GPtrArray of TpContact, free it with g_ptr_array_unref(), or NULL.

[transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]

Since: 0.15.6


tp_channel_group_get_local_pending ()

const TpIntset *
tp_channel_group_get_local_pending (TpChannel *self);

tp_channel_group_get_local_pending is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_dup_local_pending_contacts() instead.

If self is a group and the TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a TpIntset containing its local-pending members.

If self is a group but TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of local-pending members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

the local-pending members, or NULL.

[transfer none]

Since: 0.7.12


tp_channel_group_dup_local_pending_contacts ()

GPtrArray *
tp_channel_group_dup_local_pending_contacts
                               (TpChannel *self);

If self is a group and the TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a GPtrArray containing its local-pending members.

If self is a group but TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of local-pending members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

a new GPtrArray of TpContact, free it with g_ptr_array_unref(), or NULL.

[transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]

Since: 0.15.6


tp_channel_group_get_remote_pending ()

const TpIntset *
tp_channel_group_get_remote_pending (TpChannel *self);

tp_channel_group_get_remote_pending is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_dup_remote_pending_contacts() instead.

If self is a group and the TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a TpIntset containing its remote-pending members.

If self is a group but TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of remote-pending members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

the remote-pending members, or NULL.

[transfer none]

Since: 0.7.12


tp_channel_group_dup_remote_pending_contacts ()

GPtrArray *
tp_channel_group_dup_remote_pending_contacts
                               (TpChannel *self);

If self is a group and the TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a GPtrArray containing its remote-pending members.

If self is a group but TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of remote-pending members, or NULL.

If self is not a group, return NULL.

Parameters

self

a channel

 

Returns

a new GPtrArray of TpContact, free it with g_ptr_array_unref(), or NULL.

[transfer container][type GLib.PtrArray][element-type TelepathyGLib.Contact]

Since: 0.15.6


tp_channel_group_get_local_pending_info ()

gboolean
tp_channel_group_get_local_pending_info
                               (TpChannel *self,
                                TpHandle local_pending,
                                TpHandle *actor,
                                TpChannelGroupChangeReason *reason,
                                const gchar **message);

tp_channel_group_get_local_pending_info is deprecated and should not be used in newly-written code.

New code should use tp_channel_group_get_local_pending_contact_info() instead.

If local_pending is actually the handle of a local-pending contact, write additional information into actor , reason and message and return TRUE. The handle and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered.

If local_pending is not the handle of a local-pending contact, write 0 into actor , TP_CHANNEL_GROUP_CHANGE_REASON_NONE into reason and "" into message , and return FALSE.

Parameters

self

a channel

 

local_pending

the handle of a local-pending contact about whom more information is needed

 

actor

either NULL or a location to return the contact who requested the change.

[out][allow-none]

reason

either NULL or a location to return the reason for the change.

[out][allow-none]

message

either NULL or a location to return the user-supplied message.

[out][transfer none][allow-none]

Returns

TRUE if the contact is in fact local-pending

Since: 0.7.12


tp_channel_group_get_local_pending_contact_info ()

gboolean
tp_channel_group_get_local_pending_contact_info
                               (TpChannel *self,
                                TpContact *local_pending,
                                TpContact **actor,
                                TpChannelGroupChangeReason *reason,
                                const gchar **message);

If local_pending is actually a local-pending contact, write additional information into actor , reason and message and return TRUE. The contact and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered.

If local_pending is not the handle of a local-pending contact, write NULL into actor , TP_CHANNEL_GROUP_CHANGE_REASON_NONE into reason and "" into message , and return FALSE.

Parameters

self

a channel

 

local_pending

the TpContact of a local-pending contact about whom more information is needed

 

actor

either NULL or a location to return the contact who requested the change.

[out][allow-none][transfer none]

reason

either NULL or a location to return the reason for the change.

[out][allow-none]

message

either NULL or a location to return the user-supplied message.

[out][allow-none][transfer none]

Returns

TRUE if the contact is in fact local-pending

Since: 0.15.6


tp_channel_password_needed ()

gboolean
tp_channel_password_needed (TpChannel *self);

Return the “password-needed” property

Parameters

self

a TpChannel

 

Returns

the value of “password-needed”

Since: 0.15.2


tp_channel_provide_password_async ()

void
tp_channel_provide_password_async (TpChannel *self,
                                   const gchar *password,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Provide password so that self can be joined. This function must be called with the correct password in order for channel joining to proceed if the TpChannel:password-needed property is set.

Once the password has been provided, callback will be called. You can then call tp_channel_provide_password_finish() to get the result of the operation.

Parameters

self

a TpChannel

 

password

the password

 

callback

a callback to call when password has been provided

 

user_data

data to pass to callback

 

Since: 0.15.2


tp_channel_provide_password_finish ()

gboolean
tp_channel_provide_password_finish (TpChannel *self,
                                    GAsyncResult *result,
                                    GError **error);

Completes a call to tp_channel_provide_password_async(). If the password was rejected, the operation fails with TP_ERROR_AUTHENTICATION_FAILED.

Parameters

self

a TpChannel

 

result

a GAsyncResult passed to the callback for tp_channel_provide_password_async().

 

error

a GError to fill

 

Returns

TRUE if the password has been provided and accepted, FALSE otherwise.

Since: 0.15.2


tp_cli_channel_call_close ()

TpProxyPendingCall *
tp_cli_channel_call_close (TpChannel *proxy,
                           gint timeout_ms,
                           tp_cli_channel_callback_for_close callback,
                           gpointer user_data,
                           GDestroyNotify destroy,
                           GObject *weak_object);

Start a Close method call.

Request that the channel be closed. This is not the case until the <tp:member-ref>Closed</tp:member-ref> signal has been emitted, and depending on the connection manager this may simply remove you from the channel on the server, rather than causing it to stop existing entirely. Some channels such as contact list channels may not be closed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_call_get_channel_type ()

TpProxyPendingCall *
tp_cli_channel_call_get_channel_type (TpChannel *proxy,
                                      gint timeout_ms,
                                      tp_cli_channel_callback_for_get_channel_type callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

tp_cli_channel_call_get_channel_type is deprecated and should not be used in newly-written code.

Use the ChannelType property if possible.

Start a GetChannelType method call.

Returns the interface name for the type of this channel. Clients SHOULD use the <tp:member-ref>ChannelType</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_call_get_handle ()

TpProxyPendingCall *
tp_cli_channel_call_get_handle (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_callback_for_get_handle callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_call_get_handle is deprecated and should not be used in newly-written code.

Use the TargetHandleType and TargetHandle properties if possible.

Start a GetHandle method call.

Returns the handle type and number if this channel represents a communication with a particular contact, room or server-stored list, or zero if it is transient and defined only by its contents. Clients SHOULD use the <tp:member-ref>TargetHandle</tp:member-ref> and <tp:member-ref>TargetHandleType</tp:member-ref> properties instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_call_get_interfaces ()

TpProxyPendingCall *
tp_cli_channel_call_get_interfaces (TpChannel *proxy,
                                    gint timeout_ms,
                                    tp_cli_channel_callback_for_get_interfaces callback,
                                    gpointer user_data,
                                    GDestroyNotify destroy,
                                    GObject *weak_object);

tp_cli_channel_call_get_interfaces is deprecated and should not be used in newly-written code.

Use the Interfaces property if possible.

Start a GetInterfaces method call.

Get the optional interfaces implemented by the channel. Clients SHOULD use the <tp:member-ref>Interfaces</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_callback_for_close ()

void
(*tp_cli_channel_callback_for_close) (TpChannel *proxy,
                                      const GError *error,
                                      gpointer user_data,
                                      GObject *weak_object);

Signature of the callback called when a Close method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_callback_for_get_channel_type ()

void
(*tp_cli_channel_callback_for_get_channel_type)
                               (TpChannel *proxy,
                                const gchar *out_Channel_Type,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_callback_for_get_channel_type is deprecated and should not be used in newly-written code.

Use the ChannelType property if possible.

Signature of the callback called when a GetChannelType method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Channel_Type

Used to return an 'out' argument if error is NULL: The interface name

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_callback_for_get_handle ()

void
(*tp_cli_channel_callback_for_get_handle)
                               (TpChannel *proxy,
                                guint out_Target_Handle_Type,
                                guint out_Target_Handle,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_callback_for_get_handle is deprecated and should not be used in newly-written code.

Use the TargetHandleType and TargetHandle properties if possible.

Signature of the callback called when a GetHandle method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Target_Handle_Type

Used to return an 'out' argument if error is NULL: The same as TargetHandleType. (TpHandleType)

 

out_Target_Handle

Used to return an 'out' argument if error is NULL: The same as TargetHandle. (TpHandle)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_callback_for_get_interfaces ()

void
(*tp_cli_channel_callback_for_get_interfaces)
                               (TpChannel *proxy,
                                const gchar **out_Interfaces,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_callback_for_get_interfaces is deprecated and should not be used in newly-written code.

Use the Interfaces property if possible.

Signature of the callback called when a GetInterfaces method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Interfaces

Used to return an 'out' argument if error is NULL: An array of the D-Bus interface names

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_run_close ()

gboolean
tp_cli_channel_run_close (TpChannel *proxy,
                          gint timeout_ms,
                          GError **error,
                          GMainLoop **loop);

tp_cli_channel_run_close is deprecated and should not be used in newly-written code.

Call the method Close and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that the channel be closed. This is not the case until the <tp:member-ref>Closed</tp:member-ref> signal has been emitted, and depending on the connection manager this may simply remove you from the channel on the server, rather than causing it to stop existing entirely. Some channels such as contact list channels may not be closed.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_run_get_channel_type ()

gboolean
tp_cli_channel_run_get_channel_type (TpChannel *proxy,
                                     gint timeout_ms,
                                     gchar **out_Channel_Type,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_channel_run_get_channel_type is deprecated and should not be used in newly-written code.

Use the ChannelType property if possible.

Call the method GetChannelType and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the interface name for the type of this channel. Clients SHOULD use the <tp:member-ref>ChannelType</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Channel_Type

Used to return an 'out' argument if TRUE is returned: The interface name

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_run_get_handle ()

gboolean
tp_cli_channel_run_get_handle (TpChannel *proxy,
                               gint timeout_ms,
                               guint *out_Target_Handle_Type,
                               guint *out_Target_Handle,
                               GError **error,
                               GMainLoop **loop);

tp_cli_channel_run_get_handle is deprecated and should not be used in newly-written code.

Use the TargetHandleType and TargetHandle properties if possible.

Call the method GetHandle and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the handle type and number if this channel represents a communication with a particular contact, room or server-stored list, or zero if it is transient and defined only by its contents. Clients SHOULD use the <tp:member-ref>TargetHandle</tp:member-ref> and <tp:member-ref>TargetHandleType</tp:member-ref> properties instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Target_Handle_Type

Used to return an 'out' argument if TRUE is returned: The same as TargetHandleType.

 

out_Target_Handle

Used to return an 'out' argument if TRUE is returned: The same as TargetHandle.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_run_get_interfaces ()

gboolean
tp_cli_channel_run_get_interfaces (TpChannel *proxy,
                                   gint timeout_ms,
                                   gchar ***out_Interfaces,
                                   GError **error,
                                   GMainLoop **loop);

tp_cli_channel_run_get_interfaces is deprecated and should not be used in newly-written code.

Use the Interfaces property if possible.

Call the method GetInterfaces and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the optional interfaces implemented by the channel. Clients SHOULD use the <tp:member-ref>Interfaces</tp:member-ref> property instead, falling back to this method only if necessary. <tp:rationale> The GetAll method lets clients retrieve all properties in one round-trip. </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Interfaces

Used to return an 'out' argument if TRUE is returned: An array of the D-Bus interface names

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_connect_to_closed ()

TpProxySignalConnection *
tp_cli_channel_connect_to_closed (TpChannel *proxy,
                                  tp_cli_channel_signal_callback_closed callback,
                                  gpointer user_data,
                                  GDestroyNotify destroy,
                                  GObject *weak_object,
                                  GError **error);

Connect a handler to the signal Closed.

Emitted when the channel has been closed. Method calls on the channel are no longer valid after this signal has been emitted, and the connection manager may then remove the object from the bus at any point.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_signal_callback_closed ()

void
(*tp_cli_channel_signal_callback_closed)
                               (TpChannel *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Closed.

Parameters

proxy

The proxy on which tp_cli_channel_connect_to_closed() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_destroyable_call_destroy ()

TpProxyPendingCall *
tp_cli_channel_interface_destroyable_call_destroy
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_destroyable_callback_for_destroy callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Destroy method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Close the channel abruptly, possibly with loss of data. The connection manager MUST NOT re-create the channel unless/until more events occur.</p> <tp:rationale> <p>The main motivating situation for this method is that when a Text channel with pending messages is closed with Close, it comes back as an incoming channel (to avoid a race between Close and an incoming message). If Destroy is called on a Text channel, the CM should delete all pending messages and close the channel, and the channel shouldn't be re-created until/unless another message arrives.</p> </tp:rationale> <p>Most clients SHOULD call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Close</tp:dbus-ref> instead. However, if a client explicitly intends to destroy the channel with possible loss of data, it SHOULD call this method if this interface is supported (according to the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interfaces</tp:dbus-ref> property), falling back to Close if not.</p> <p>In particular, channel dispatchers SHOULD use this method if available when terminating channels that cannot be handled correctly (for instance, if no handler has been installed for a channel type, or if the handler crashes repeatedly).</p> <p>Connection managers do not need to implement this interface on channels where Close and Destroy would be equivalent.</p> <tp:rationale> <p>Callers need to be able to fall back to Close in any case.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_destroyable_callback_for_destroy ()

void
(*tp_cli_channel_interface_destroyable_callback_for_destroy)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Destroy method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_destroyable_run_destroy ()

gboolean
tp_cli_channel_interface_destroyable_run_destroy
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_destroyable_run_destroy is deprecated and should not be used in newly-written code.

Call the method Destroy and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Close the channel abruptly, possibly with loss of data. The connection manager MUST NOT re-create the channel unless/until more events occur.</p> <tp:rationale> <p>The main motivating situation for this method is that when a Text channel with pending messages is closed with Close, it comes back as an incoming channel (to avoid a race between Close and an incoming message). If Destroy is called on a Text channel, the CM should delete all pending messages and close the channel, and the channel shouldn't be re-created until/unless another message arrives.</p> </tp:rationale> <p>Most clients SHOULD call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Close</tp:dbus-ref> instead. However, if a client explicitly intends to destroy the channel with possible loss of data, it SHOULD call this method if this interface is supported (according to the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interfaces</tp:dbus-ref> property), falling back to Close if not.</p> <p>In particular, channel dispatchers SHOULD use this method if available when terminating channels that cannot be handled correctly (for instance, if no handler has been installed for a channel type, or if the handler crashes repeatedly).</p> <p>Connection managers do not need to implement this interface on channels where Close and Destroy would be equivalent.</p> <tp:rationale> <p>Callers need to be able to fall back to Close in any case.</p> </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error

Types and Values

struct TpChannel

struct TpChannel;

A proxy object for a Telepathy channel. A proxy object for a Telepathy channel. There are no interesting public struct fields.

(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)

Since: 0.7.1


struct TpChannelClass

struct TpChannelClass {
    TpProxyClass parent_class;
};

The class of a TpChannel. In addition to parent_class there are four pointers reserved for possible future use.

(Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.)

Members

Since: 0.7.1


TP_CHANNEL_FEATURE_CORE

#define             TP_CHANNEL_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpChannel.

When this feature is prepared, the basic Channel properties of the Channel have been retrieved and are available for use.

Specifically, this implies that:

(These are a subset of the guarantees offered by the older “channel-ready” and tp_channel_call_when_ready() mechanisms, which are now equivalent to (TP_CHANNEL_FEATURE_CORE, TP_CHANNEL_FEATURE_GROUP) if the channel is a group, or just TP_CHANNEL_FEATURE_CORE otherwise.)

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_CHANNEL_FEATURE_CONTACTS

#define             TP_CHANNEL_FEATURE_CONTACTS

Expands to a call to a function that returns a quark representing the Contacts features of a TpChannel.

When this feature is prepared, the TpContact objects of this channel are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

On older connection managers, this feature may fail to prepare.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.6


TP_CHANNEL_FEATURE_CHAT_STATES

#define             TP_CHANNEL_FEATURE_CHAT_STATES

TP_CHANNEL_FEATURE_CHAT_STATES is deprecated and should not be used in newly-written code.

Use TP_TEXT_CHANNEL_FEATURE_CHAT_STATES instead.

Expands to a call to a function that returns a quark representing the chat states feature on a TpChannel.

When this feature is prepared, tp_channel_get_chat_state() and the “chat-state-changed” signal become useful.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_CHANNEL_FEATURE_GROUP

#define             TP_CHANNEL_FEATURE_GROUP

Expands to a call to a function that returns a quark representing the Group features of a TpChannel.

When this feature is prepared, the Group properties of the Channel have been retrieved and are available for use, and change-notification has been set up for those that can change:

  • the initial value of the “group-self-handle” property will have been fetched and change notification will have been set up

  • the initial value of the “group-flags” property will have been fetched and change notification will have been set up

(These are the same guarantees offered for Group channels by the older “channel-ready” and tp_channel_call_when_ready() mechanisms.)

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.3


TP_ERRORS_REMOVED_FROM_GROUP

#define TP_ERRORS_REMOVED_FROM_GROUP (tp_errors_removed_from_group_quark ())

GError domain representing the local user being removed from a channel with the Group interface. The code in a GError with this domain must be a member of TpChannelGroupChangeReason.

This error may be raised on non-Group channels with certain reason codes if there's no better error code to use (mainly TP_CHANNEL_GROUP_CHANGE_REASON_NONE).

This macro expands to a function call returning a GQuark.

Since: 0.7.1


TP_CHANNEL_FEATURE_PASSWORD

#define             TP_CHANNEL_FEATURE_PASSWORD

Expands to a call to a function that returns a quark representing the password feature on a TpChannel.

When this feature is prepared, tp_channel_password_needed() and the “password-needed” property become useful.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.15.2

Property Details

The “channel-properties” property

  “channel-properties”       GHashTable_gchararray+GValue_*

The immutable D-Bus properties of this channel, represented by a GHashTable where the keys are D-Bus interface name + "." + property name, and the values are GValue instances.

Read-only except during construction. If this is not provided during construction, a reasonable (but possibly incomplete) version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE.

Owner: TpChannel

Flags: Read / Write / Construct Only


The “channel-ready” property

  “channel-ready”            gboolean

Initially FALSE; changes to TRUE when tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE, and if the channel is a group, TP_CHANNEL_FEATURE_GROUP.

This is a less general form of tp_proxy_is_prepared(), which should be used in new code.

One important difference is that after “invalidated” is signalled, “channel-ready” keeps its current value - which might be TRUE, if the channel was successfully prepared before it became invalidated - but tp_proxy_is_prepared() returns FALSE for all features.

Change notification is via notify::channel-ready.

TpChannel:channel-ready has been deprecated since version 0.17.6 and should not be used in newly-written code.

use tp_proxy_is_prepared() with TP_CHANNEL_FEATURE_CORE for checks, or tp_proxy_prepare_async() for notification

Owner: TpChannel

Flags: Read

Default value: FALSE


The “connection” property

  “connection”               TpConnection *

The TpConnection to which this TpChannel belongs. Used for e.g. handle manipulation.

Owner: TpChannel

Flags: Read / Write / Construct Only


The “group-flags” property

  “group-flags”              guint

If the TP_CHANNEL_FEATURE_GROUP feature has been prepared successfully, TpChannelGroupFlags indicating the capabilities and behaviour of that group.

Otherwise, this may be 0.

Change notification is via notify::group-flags or TpChannel::group-flags-changed.

Owner: TpChannel

Flags: Read

Default value: 0

Since: 0.7.12


The “group-self-contact” property

  “group-self-contact”       TpContact *

If this channel is a group and TP_CHANNEL_FEATURE_CONTACTS has been prepared, and the user is a member of the group, the TpContact representing them in this group.

Otherwise, the result may be either a contact representing the user, or NULL.

Change notification is via notify::group-self-contact.

Owner: TpChannel

Flags: Read

Since: 0.15.6


The “group-self-handle” property

  “group-self-handle”        guint

If this channel is a group and TP_CHANNEL_FEATURE_GROUP has been prepared, and the user is a member of the group, the TpHandle representing them in this group.

Otherwise, the result may be either a handle representing the user, or 0.

Change notification is via notify::group-self-handle.

TpChannel:group-self-handle is deprecated and should not be used in newly-written code.

Use “group-self-contact” instead.

Owner: TpChannel

Flags: Read

Default value: 0

Since: 0.7.12


The “identifier” property

  “identifier”               gchar *

This channel's associated identifier, or the empty string if it has handle type TP_HANDLE_TYPE_NONE.

For channels where “handle” is non-zero, this is the result of inspecting “handle”.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string.

Changed in 0.11.4: this property is never NULL. Previously, it was NULL before an identifier was known, or when a channel with no TargetID D-Bus property had TargetHandleType TP_HANDLE_TYPE_NONE.

Owner: TpChannel

Flags: Read

Default value: ""


The “initiator-contact” property

  “initiator-contact”        TpContact *

The TpContact of the initiator of this channel, or NULL if there is no particular initiator.

If the channel was initiated by a remote contact, this represents that contact, and “requested” will be FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation.

If the channel was requested by the local user, “requested” will be TRUE, and this property may be the “group-self-contact” or “self-contact”.

If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be NULL.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CONTACTS; until then, it may be NULL.

Owner: TpChannel

Flags: Read

Since: 0.15.6


The “initiator-handle” property

  “initiator-handle”         guint

The TP_HANDLE_TYPE_CONTACT TpHandle of the initiator of this channel, or 0 if there is no particular initiator.

If the channel was initiated by a remote contact, this handle represents that contact, and “requested” will be FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation.

If the channel was requested by the local user, “requested” will be TRUE, and this property may be the “group-self-handle” or “self-handle”.

If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be 0.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE; until then, it may be 0.

TpChannel:initiator-handle is deprecated and should not be used in newly-written code.

Use “initiator-contact” instead.

Owner: TpChannel

Flags: Read

Default value: 0

Since: 0.11.15


The “initiator-identifier” property

  “initiator-identifier”     gchar *

If “initiator-handle” is 0, this will always be "". Otherwise, this will be the “identifier” of the contact with that handle.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string.

TpChannel:initiator-identifier is deprecated and should not be used in newly-written code.

Use “initiator-contact” instead.

Owner: TpChannel

Flags: Read

Default value: ""

Since: 0.11.15


The “password-needed” property

  “password-needed”          gboolean

If TRUE, tp_channel_provide_password_async() has to be called to be able to join the channel.

This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_PASSWORD; until then, it may return FALSE even if the channel is actually protected by a password. Preparing TP_CHANNEL_FEATURE_PASSWORD also ensures that the notify::password-needed signal will be fired when this property changes.

Owner: TpChannel

Flags: Read

Default value: FALSE

Since: 0.15.2


The “requested” property

  “requested”                gboolean

TRUE if this channel was created in response to a local request, such as a call to tp_account_channel_request_create_channel_async(). FALSE if this channel was initiated by a remote contact (the “initiator-handle”), or if it appeared as a side-effect of some other action.

For instance, this is FALSE on incoming calls and file transfers, remotely-initiated 1-1 text conversations, and invitations to chatrooms, and TRUE on outgoing calls and file transfers, locally-initiated 1-1 text conversations, and chatrooms joined by local user action.

This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CORE; until then, it may return FALSE even if the channel was actually requested.

Owner: TpChannel

Flags: Read

Default value: FALSE

Since: 0.11.15


The “target-contact” property

  “target-contact”           TpContact *

If this channel is for communication with a single contact (that is, “handle-type” is TP_HANDLE_TYPE_CONTACT), then a TpContact representing the remote contact. For chat rooms, contact search channels and other channels without a single remote contact, NULL.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CONTACTS; until then, it may be NULL.

Owner: TpChannel

Flags: Read

Since: 0.15.6

Signal Details

The “chat-state-changed” signal

void
user_function (TpChannel *self,
               guint      contact,
               guint      state,
               gpointer   user_data)

Emitted when a contact's chat state changes after tp_proxy_prepare_async() has finished preparing the feature TP_CHANNEL_FEATURE_CHAT_STATES.

TpChannel::chat-state-changed is deprecated and should not be used in newly-written code.

Use “contact-chat-state-changed” instead

Parameters

self

a channel

 

contact

a contact handle for the local user or another contact

 

state

the new TpChannelChatState for the contact

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.3


The “group-contacts-changed” signal

void
user_function (TpChannel *self,
               GPtrArray *added,
               GPtrArray *removed,
               GPtrArray *local_pending,
               GPtrArray *remote_pending,
               TpContact *actor,
               gpointer   user_data)

Emitted when the group members change in a Group channel.

This is not guaranteed to be emitted until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_FEATURE_CONTACTS; until then, it may be omitted.

Parameters

self

a channel

 

added

a GPtrArray of TpContact containing the full members added.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

removed

a GPtrArray of TpContact containing the members (full, local-pending or remote-pending) removed.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

local_pending

a GPtrArray of TpContact containing the local-pending members added.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

remote_pending

a GPtrArray of TpContact containing the remote-pending members added.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

actor

a TpContact for the "actor" handle in details

 

details

a GHashTable mapping (gchar *) to GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal.

[type GLib.HashTable][element-type utf8 GObject.Value]

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.15.6


The “group-flags-changed” signal

void
user_function (TpChannel *self,
               guint      added,
               guint      removed,
               gpointer   user_data)

Emitted when the “group-flags” property changes while the channel is ready.

Parameters

self

a channel

 

added

TpChannelGroupFlags which are newly set

 

removed

TpChannelGroupFlags which are no longer set

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.7.12


The “group-members-changed” signal

void
user_function (TpChannel     *self,
               gchar         *message,
               GArray_guint_ *added,
               GArray_guint_ *removed,
               GArray_guint_ *local_pending,
               GArray_guint_ *remote_pending,
               guint          actor,
               guint          reason,
               gpointer       user_data)

Emitted when the group members change in a Group channel that is ready.

[skip]

TpChannel::group-members-changed is deprecated and should not be used in newly-written code.

Use “group-contacts-changed” instead.

Parameters

self

a channel

 

message

an optional textual message

 

added

a GArray of guint containing the full members added

 

removed

a GArray of guint containing the members (full, local-pending or remote-pending) removed

 

local_pending

a GArray of guint containing the local-pending members added

 

remote_pending

a GArray of guint containing the remote-pending members added

 

actor

the TpHandle of the contact causing the change, or 0

 

reason

the reason for the change as a TpChannelGroupChangeReason

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.7.12


The “group-members-changed-detailed” signal

void
user_function (TpChannel     *self,
               GArray_guint_ *added,
               GArray_guint_ *removed,
               GArray_guint_ *local_pending,
               GArray_guint_ *remote_pending,
               gpointer       user_data)

Emitted when the group members change in a Group channel that is ready. Contains a superset of the information in the TpChannel::group-members-changed signal, and is emitted at the same time; applications can connect to this signal and ignore the other.

TpChannel::group-members-changed-detailed is deprecated and should not be used in newly-written code.

Use “group-contacts-changed” instead.

Parameters

self

a channel

 

added

a GArray of guint containing the full members added.

[type GLib.Array][element-type uint]

removed

a GArray of guint containing the members (full, local-pending or remote-pending) removed.

[type GLib.Array][element-type uint]

local_pending

a GArray of guint containing the local-pending members added.

[type GLib.Array][element-type uint]

remote_pending

a GArray of guint containing the remote-pending members added.

[type GLib.Array][element-type uint]

details

a GHashTable mapping (gchar *) to GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal.

[type GLib.HashTable][element-type utf8 GObject.Value]

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.7.21

See Also

TpConnection, channel-group, channel-text, channel-media

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-dispatch-operation.html0000644000175000017500000046321314006623344026300 00000000000000 TpChannelDispatchOperation: telepathy-glib API Reference Manual

TpChannelDispatchOperation

TpChannelDispatchOperation — proxy object for a to the Telepathy channel dispatcher

Functions

TpChannelDispatchOperation * tp_channel_dispatch_operation_new ()
void tp_channel_dispatch_operation_init_known_interfaces ()
void (*tp_cli_channel_dispatch_operation_callback_for_claim) ()
TpProxyPendingCall * tp_cli_channel_dispatch_operation_call_claim ()
void (*tp_cli_channel_dispatch_operation_callback_for_handle_with) ()
TpProxyPendingCall * tp_cli_channel_dispatch_operation_call_handle_with ()
void (*tp_cli_channel_dispatch_operation_callback_for_handle_with_time) ()
TpProxyPendingCall * tp_cli_channel_dispatch_operation_call_handle_with_time ()
void (*tp_cli_channel_dispatch_operation_signal_callback_channel_lost) ()
TpProxySignalConnection * tp_cli_channel_dispatch_operation_connect_to_channel_lost ()
void (*tp_cli_channel_dispatch_operation_signal_callback_finished) ()
TpProxySignalConnection * tp_cli_channel_dispatch_operation_connect_to_finished ()
TpAccount * tp_channel_dispatch_operation_borrow_account ()
GPtrArray * tp_channel_dispatch_operation_borrow_channels ()
TpConnection * tp_channel_dispatch_operation_borrow_connection ()
GHashTable * tp_channel_dispatch_operation_borrow_immutable_properties ()
GStrv tp_channel_dispatch_operation_borrow_possible_handlers ()
TpAccount * tp_channel_dispatch_operation_get_account ()
GPtrArray * tp_channel_dispatch_operation_get_channels ()
TpConnection * tp_channel_dispatch_operation_get_connection ()
GStrv tp_channel_dispatch_operation_get_possible_handlers ()
void tp_channel_dispatch_operation_handle_with_async ()
gboolean tp_channel_dispatch_operation_handle_with_finish ()
void tp_channel_dispatch_operation_handle_with_time_async ()
gboolean tp_channel_dispatch_operation_handle_with_time_finish ()
void tp_channel_dispatch_operation_claim_async ()
gboolean tp_channel_dispatch_operation_claim_finish ()
void tp_channel_dispatch_operation_claim_with_async ()
gboolean tp_channel_dispatch_operation_claim_with_finish ()
void tp_channel_dispatch_operation_close_channels_async ()
gboolean tp_channel_dispatch_operation_close_channels_finish ()
void tp_channel_dispatch_operation_leave_channels_async ()
gboolean tp_channel_dispatch_operation_leave_channels_finish ()
void tp_channel_dispatch_operation_destroy_channels_async ()
gboolean tp_channel_dispatch_operation_destroy_channels_finish ()

Properties

TpAccount * account Read / Write / Construct Only
GHashTable_gchararray+GValue_* cdo-properties Read / Write / Construct Only
GPtrArray * channels Read / Write / Construct Only
TpConnection * connection Read / Write / Construct Only
GStrv possible-handlers Read

Signals

void channel-lost Has Details

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannelDispatchOperation

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

One of the channel dispatcher's functions is to offer incoming channels to Approver clients for approval. Approvers respond to the channel dispatcher via a TpChannelDispatchOperation object.

Functions

tp_channel_dispatch_operation_new ()

TpChannelDispatchOperation *
tp_channel_dispatch_operation_new (TpDBusDaemon *bus_daemon,
                                   const gchar *object_path,
                                   GHashTable *immutable_properties,
                                   GError **error);

tp_channel_dispatch_operation_new is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should get TpChannelDispatchOperation objects from a TpBaseClient

Convenience function to create a new channel dispatch operation proxy.

The immutable_properties argument is not yet used.

Parameters

bus_daemon

Proxy for the D-Bus daemon

 

object_path

The non-NULL object path of this channel dispatch operation

 

immutable_properties

As many as are known of the immutable D-Bus properties of this channel dispatch operation, or NULL if none are known

 

error

Used to raise an error if NULL is returned

 

Returns

a new reference to an channel dispatch operation proxy, or NULL if object_path is not syntactically valid or the channel dispatcher is not running


tp_channel_dispatch_operation_init_known_interfaces ()

void
tp_channel_dispatch_operation_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpChannelDispatchOperation have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CHANNEL_DISPATCH_OPERATION.

Since: 0.7.32


tp_cli_channel_dispatch_operation_callback_for_claim ()

void
(*tp_cli_channel_dispatch_operation_callback_for_claim)
                               (TpChannelDispatchOperation *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Claim method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatch_operation_call_claim ()

TpProxyPendingCall *
tp_cli_channel_dispatch_operation_call_claim
                               (TpChannelDispatchOperation *proxy,
                                gint timeout_ms,
                                tp_cli_channel_dispatch_operation_callback_for_claim callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Claim method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel, but <em>does not</em> have the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref> method called on it.</p> <p>Clients that call Claim on channels but do not immediately close them SHOULD implement the Handler interface and its <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandledChannels</tp:dbus-ref> property.</p> <p>Approvers wishing to reject channels MUST call this method to claim ownership of them, and MUST NOT call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref> on the channels unless/until this method returns successfully.</p> <tp:rationale> <p>The channel dispatcher can't know how best to close arbitrary channel types, so it leaves it up to the approver to do so. For instance, for Text channels it is necessary to acknowledge any messages that have already been displayed to the user first - ideally, the approver would display and then acknowledge the messages - or to call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Destroyable.Destroy</tp:dbus-ref> if the destructive behaviour of that method is desired.</p> <p>Similarly, an Approver for StreamedMedia channels can close the channel with a reason (e.g. &quot;busy&quot;) if desired. The channel dispatcher, which is designed to have no specific knowledge of particular channel types, can't do that.</p> </tp:rationale> <p>If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting <tp:member-ref>Finished</tp:member-ref>, in the same way as for <tp:member-ref>HandleWith</tp:member-ref>.</p> <p>This method may fail because the dispatch operation has already been completed. Again, see HandleWith for more details. The approver MUST NOT attempt to interact with the channels further in this case.</p> <p>(FIXME: list some other possible errors)</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatch_operation_callback_for_handle_with ()

void
(*tp_cli_channel_dispatch_operation_callback_for_handle_with)
                               (TpChannelDispatchOperation *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a HandleWith method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatch_operation_call_handle_with ()

TpProxyPendingCall *
tp_cli_channel_dispatch_operation_call_handle_with
                               (TpChannelDispatchOperation *proxy,
                                gint timeout_ms,
                                const gchar *in_Handler,
                                tp_cli_channel_dispatch_operation_callback_for_handle_with callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a HandleWith method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by an approver to accept a channel bundle and request that the given handler be used to handle it.</p> <p>If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting <tp:member-ref>Finished</tp:member-ref>.</p> <p>However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler.</p> <p>Approvers which are also channel handlers SHOULD use <tp:member-ref>Claim</tp:member-ref> instead of HandleWith to request that they can handle a channel bundle themselves.</p> <p>(FIXME: list some possible errors)</p> <p>If the channel handler raises an error from <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref>, this method MAY respond by raising that same error, even if it is not specifically documented here.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatch_operation_callback_for_handle_with_time ()

void
(*tp_cli_channel_dispatch_operation_callback_for_handle_with_time)
                               (TpChannelDispatchOperation *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a HandleWithTime method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatch_operation_call_handle_with_time ()

TpProxyPendingCall *
tp_cli_channel_dispatch_operation_call_handle_with_time
                               (TpChannelDispatchOperation *proxy,
                                gint timeout_ms,
                                const gchar *in_Handler,
                                gint64 in_UserActionTime,
                                tp_cli_channel_dispatch_operation_callback_for_handle_with_time callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a HandleWithTime method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A variant of <tp:member-ref>HandleWith</tp:member-ref> allowing the approver to pass an user action time. This timestamp will be passed to the Handler when <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref> is called.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.</p>

 

in_UserActionTime

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatch_operation_signal_callback_channel_lost ()

void
(*tp_cli_channel_dispatch_operation_signal_callback_channel_lost)
                               (TpChannelDispatchOperation *proxy,
                                const gchar *arg_Channel,
                                const gchar *arg_Error,
                                const gchar *arg_Message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ChannelLost.

Parameters

proxy

The proxy on which tp_cli_channel_dispatch_operation_connect_to_channel_lost() was called

 

arg_Channel

The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref> that closed.

 

arg_Error

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The name of a D-Bus error indicating why the channel closed. If no better reason can be found, <code>org.freedesktop.Telepathy.Error.NotAvailable</code> MAY be used as a fallback; this means that this error SHOULD NOT be given any more specific meaning.</p>

 

arg_Message

A string associated with the D-Bus error.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_dispatch_operation_connect_to_channel_lost ()

TpProxySignalConnection *
tp_cli_channel_dispatch_operation_connect_to_channel_lost
                               (TpChannelDispatchOperation *proxy,
                                tp_cli_channel_dispatch_operation_signal_callback_channel_lost callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ChannelLost.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A channel has closed before it could be claimed or handled. If this is emitted for the last remaining channel in a channel dispatch operation, it MUST immediately be followed by <tp:member-ref>Finished</tp:member-ref>.</p> <p>This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Approver">AddDispatchOperation</tp:dbus-ref> method.</p> <tp:rationale> <p>This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual &quot;connect to signals then recover state&quot; model - first connect to ChannelLost and <tp:member-ref>Finished</tp:member-ref>, then download <tp:member-ref>Channels</tp:member-ref> (and on error, perhaps assume that the operation has already Finished).</p> </tp:rationale>

Parameters

proxy

A TpChannelDispatchOperation or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_dispatch_operation_signal_callback_finished ()

void
(*tp_cli_channel_dispatch_operation_signal_callback_finished)
                               (TpChannelDispatchOperation *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Finished.

Parameters

proxy

The proxy on which tp_cli_channel_dispatch_operation_connect_to_finished() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_dispatch_operation_connect_to_finished ()

TpProxySignalConnection *
tp_cli_channel_dispatch_operation_connect_to_finished
                               (TpChannelDispatchOperation *proxy,
                                tp_cli_channel_dispatch_operation_signal_callback_finished callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Finished.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when this dispatch operation finishes. The dispatch operation is no longer present and further methods must not be called on it.</p> <p>Approvers that have a user interface SHOULD stop notifying the user about the channels in response to this signal; they MAY assume that on errors, they would have received <tp:member-ref>ChannelLost</tp:member-ref> first.</p> <p>Its object path SHOULD NOT be reused for a subsequent dispatch operation; the ChannelDispatcher MUST choose object paths in a way that avoids immediate re-use.</p> <tp:rationale> <p>Otherwise, clients might accidentally call <tp:member-ref>HandleWith</tp:member-ref> or <tp:member-ref>Claim</tp:member-ref> on a new dispatch operation instead of the one they intended to handle.</p> </tp:rationale> <p>This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Approver">AddDispatchOperation</tp:dbus-ref> method.</p> <tp:rationale> <p>This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual &quot;connect to signals then recover state&quot; model - first connect to <tp:member-ref>ChannelLost</tp:member-ref> and Finished, then download <tp:member-ref>Channels</tp:member-ref> (and on error, perhaps assume that the operation has already Finished).</p> </tp:rationale>

Parameters

proxy

A TpChannelDispatchOperation or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_channel_dispatch_operation_borrow_account ()

TpAccount *
tp_channel_dispatch_operation_borrow_account
                               (TpChannelDispatchOperation *self);

tp_channel_dispatch_operation_borrow_account is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_dispatch_operation_get_account() instead.

Returns the TpAccount of this ChannelDispatchOperation. The returned pointer is only valid while self is valid - reference it with g_object_ref() if needed.

[skip]

Parameters

Returns

the value of “account”.

[transfer none]

Since: 0.11.5


tp_channel_dispatch_operation_borrow_channels ()

GPtrArray *
tp_channel_dispatch_operation_borrow_channels
                               (TpChannelDispatchOperation *self);

tp_channel_dispatch_operation_borrow_channels is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_dispatch_operation_get_channels() instead.

Returns a GPtrArray containing the TpChannel of this ChannelDispatchOperation. The returned array and its TpChannel are only valid while self is valid - copy array and reference channels with g_object_ref() if needed.

[skip]

Parameters

Returns

the value of “channels”.

[transfer none]

Since: 0.11.5


tp_channel_dispatch_operation_borrow_connection ()

TpConnection *
tp_channel_dispatch_operation_borrow_connection
                               (TpChannelDispatchOperation *self);

tp_channel_dispatch_operation_borrow_connection is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_dispatch_operation_get_connection() instead.

Returns the TpConnection of this ChannelDispatchOperation. The returned pointer is only valid while self is valid - reference it with g_object_ref() if needed.

[skip]

Parameters

Returns

the value of “connection”.

[transfer none]

Since: 0.11.5


tp_channel_dispatch_operation_borrow_immutable_properties ()

GHashTable *
tp_channel_dispatch_operation_borrow_immutable_properties
                               (TpChannelDispatchOperation *self);

tp_channel_dispatch_operation_borrow_immutable_properties is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use individual property getters like tp_channel_dispatch_operation_get_connection(), tp_channel_dispatch_operation_get_account(), tp_channel_dispatch_operation_get_channels(), or tp_channel_dispatch_operation_get_possible_handlers() instead.

Returns the immutable D-Bus properties of this channel. The returned hash table is only valid while self is valid - reference it with g_hash_table_ref() if needed.

[skip]

Parameters

Returns

the value of “cdo-properties”.

[transfer none][element-type utf8 GObject.Value]

Since: 0.11.5


tp_channel_dispatch_operation_borrow_possible_handlers ()

GStrv
tp_channel_dispatch_operation_borrow_possible_handlers
                               (TpChannelDispatchOperation *self);

tp_channel_dispatch_operation_borrow_possible_handlers is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_channel_dispatch_operation_get_possible_handlers() instead.

Returns a GStrv containing the possible handlers of this ChannelDispatchOperation. The returned array and its strings are only valid while self is valid - copy it with g_strdupv if needed.

[skip]

Parameters

Returns

the value of “possible-handlers”.

[transfer none]

Since: 0.11.5


tp_channel_dispatch_operation_get_account ()

TpAccount *
tp_channel_dispatch_operation_get_account
                               (TpChannelDispatchOperation *self);

Returns the TpAccount of this ChannelDispatchOperation. The returned pointer is only valid while self is valid - reference it with g_object_ref() if needed.

[skip]

Parameters

Returns

the value of “account”.

[transfer none]

Since: 0.19.9


tp_channel_dispatch_operation_get_channels ()

GPtrArray *
tp_channel_dispatch_operation_get_channels
                               (TpChannelDispatchOperation *self);

Returns a GPtrArray containing the TpChannel of this ChannelDispatchOperation. The returned array and its TpChannel are only valid while self is valid - copy array and reference channels with g_object_ref() if needed.

Parameters

Returns

the value of “channels”.

[transfer none][element-type TelepathyGLib.Channel]

Since: 0.19.9


tp_channel_dispatch_operation_get_connection ()

TpConnection *
tp_channel_dispatch_operation_get_connection
                               (TpChannelDispatchOperation *self);

Returns the TpConnection of this ChannelDispatchOperation. The returned pointer is only valid while self is valid - reference it with g_object_ref() if needed.

[skip]

Parameters

Returns

the value of “connection”.

[transfer none]

Since: 0.19.9


tp_channel_dispatch_operation_get_possible_handlers ()

GStrv
tp_channel_dispatch_operation_get_possible_handlers
                               (TpChannelDispatchOperation *self);

Returns a GStrv containing the possible handlers of this ChannelDispatchOperation. The returned array and its strings are only valid while self is valid - copy it with g_strdupv if needed.

[skip]

Parameters

Returns

the value of “possible-handlers”.

[transfer none]

Since: 0.19.9


tp_channel_dispatch_operation_handle_with_async ()

void
tp_channel_dispatch_operation_handle_with_async
                               (TpChannelDispatchOperation *self,
                                const gchar *handler,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Called by an approver to accept a channel bundle and request that the given handler be used to handle it.

If successful, this method will cause the “invalidated” signal to be emitted with the TP_DBUS_ERROR_OBJECT_REMOVED error code.

However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler.

Approvers which are also channel handlers SHOULD use tp_channel_dispatch_operation_claim_async() instead of tp_channel_dispatch_operation_handle_with_async() to request that they can handle a channel bundle themselves.

Parameters

self

a TpChannelDispatchOperation

 

handler

The well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the channel, or NULL if the client has no preferred channel handler.

[allow-none]

callback

a callback to call when the call returns

 

user_data

data to pass to callback

 

Since: 0.11.5


tp_channel_dispatch_operation_handle_with_finish ()

gboolean
tp_channel_dispatch_operation_handle_with_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async call to HandleWith().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the HandleWith() call was successful, otherwise FALSE

Since: 0.11.5


tp_channel_dispatch_operation_handle_with_time_async ()

void
tp_channel_dispatch_operation_handle_with_time_async
                               (TpChannelDispatchOperation *self,
                                const gchar *handler,
                                gint64 user_action_time,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

A variant of tp_channel_dispatch_operation_handle_with_async() allowing the approver to pass an user action time. This timestamp will be passed to the Handler when HandleChannels is called.

If an X server timestamp for the user action causing this method call is available, user_action_time should be this timestamp (for instance, the result of gdk_event_get_time() if it is not GDK_CURRENT_TIME). Otherwise, it may be TP_USER_ACTION_TIME_NOT_USER_ACTION to behave as if there was no user action or it happened a long time ago, or TP_USER_ACTION_TIME_CURRENT_TIME to have the Handler behave as though the user action had just happened (resembling, but not numerically equal to, GDK_CURRENT_TIME).

This method has been introduced in telepathy-mission-control 5.5.0.

Parameters

self

a TpChannelDispatchOperation

 

handler

The well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the channel, or NULL if the client has no preferred channel handler.

[allow-none]

user_action_time

the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME

 

callback

a callback to call when the call returns

 

user_data

data to pass to callback

 

Since: 0.11.7


tp_channel_dispatch_operation_handle_with_time_finish ()

gboolean
tp_channel_dispatch_operation_handle_with_time_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async call to HandleWithTime().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the HandleWithTime() call was successful, otherwise FALSE

Since: 0.11.7


tp_channel_dispatch_operation_claim_async ()

void
tp_channel_dispatch_operation_claim_async
                               (TpChannelDispatchOperation *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

tp_channel_dispatch_operation_claim_async is deprecated and should not be used in newly-written code.

since 0.15.0. Use tp_channel_dispatch_operation_claim_with_async()

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel.

If successful, this method will cause the “invalidated” signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case.

Parameters

self

a TpChannelDispatchOperation

 

callback

a callback to call when the call returns

 

user_data

data to pass to callback

 

Since: 0.11.5


tp_channel_dispatch_operation_claim_finish ()

gboolean
tp_channel_dispatch_operation_claim_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

tp_channel_dispatch_operation_claim_finish is deprecated and should not be used in newly-written code.

since 0.15.0. Use tp_channel_dispatch_operation_claim_with_finish()

Finishes an async call to Claim().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the Claim() call was successful, otherwise FALSE

Since: 0.11.5


tp_channel_dispatch_operation_claim_with_async ()

void
tp_channel_dispatch_operation_claim_with_async
                               (TpChannelDispatchOperation *self,
                                TpBaseClient *client,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel.

If successful, this method will cause the “invalidated” signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case.

This is an improved version of tp_channel_dispatch_operation_claim_async() as it tells client about the new channels being handled.

TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

Parameters

self

a TpChannelDispatchOperation

 

client

the TpBaseClient claiming self

 

callback

a callback to call when the call returns

 

user_data

data to pass to callback

 

Since: 0.15.0


tp_channel_dispatch_operation_claim_with_finish ()

gboolean
tp_channel_dispatch_operation_claim_with_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async call to Claim() initiated using tp_channel_dispatch_operation_claim_with_async().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the Claim() call was successful, otherwise FALSE

Since: 0.15.0


tp_channel_dispatch_operation_close_channels_async ()

void
tp_channel_dispatch_operation_close_channels_async
                               (TpChannelDispatchOperation *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Called by an approver to claim channels and close them all right away. If this method is called successfully, self has been claimed and tp_channel_close_async() has been called on all of its channels.

If successful, this method will cause the “invalidated” signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details.

TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

Parameters

self

a TpChannelDispatchOperation

 

callback

a callback to call when the request has been satisfied

 

user_data

data to pass to callback

 

Since: 0.15.1


tp_channel_dispatch_operation_close_channels_finish ()

gboolean
tp_channel_dispatch_operation_close_channels_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async operation initiated using tp_channel_dispatch_operation_close_channels_async().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the Claim() call was successful and Close() has at least been attempted on all the channels, otherwise FALSE

Since: 0.15.1


tp_channel_dispatch_operation_leave_channels_async ()

void
tp_channel_dispatch_operation_leave_channels_async
                               (TpChannelDispatchOperation *self,
                                TpChannelGroupChangeReason reason,
                                const gchar *message,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Called by an approver to claim channels and leave them all right away. If this method is called successfully, self has been claimed and tp_channel_leave_async() has been called on all of its channels.

If successful, this method will cause the “invalidated” signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details.

TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

Parameters

self

a TpChannelDispatchOperation

 

reason

the leave reason

 

message

the leave message

 

callback

a callback to call when the request has been satisfied

 

user_data

data to pass to callback

 

Since: 0.15.2


tp_channel_dispatch_operation_leave_channels_finish ()

gboolean
tp_channel_dispatch_operation_leave_channels_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async operation initiated using tp_channel_dispatch_operation_leave_channels_async().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the Claim() call was successful and tp_channel_leave_async() has at least been attempted on all the channels, otherwise FALSE

Since: 0.15.2


tp_channel_dispatch_operation_destroy_channels_async ()

void
tp_channel_dispatch_operation_destroy_channels_async
                               (TpChannelDispatchOperation *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Called by an approver to claim channels and destroy them all right away. If this method is called successfully, self has been claimed and tp_channel_destroy_async() has been called on all of its channels.

If successful, this method will cause the “invalidated” signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async().

This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details.

TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function.

Parameters

self

a TpChannelDispatchOperation

 

callback

a callback to call when the request has been satisfied

 

user_data

data to pass to callback

 

Since: 0.15.2


tp_channel_dispatch_operation_destroy_channels_finish ()

gboolean
tp_channel_dispatch_operation_destroy_channels_finish
                               (TpChannelDispatchOperation *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async operation initiated using tp_channel_dispatch_operation_destroy_channels_async().

Parameters

self

a TpChannelDispatchOperation

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the Claim() call was successful and tp_channel_destroy_async() has at least been attempted on all the channels, otherwise FALSE

Since: 0.15.2

Types and Values

struct TpChannelDispatchOperation

struct TpChannelDispatchOperation;

One of the channel dispatcher's functions is to offer incoming channels to Approver clients for approval. An approver should generally ask the user whether they want to participate in the requested communication channels (join the chat or chatroom, answer the call, accept the file transfer, or whatever is appropriate). A collection of channels offered in this way is represented by a ChannelDispatchOperation object.

If the user wishes to accept the communication channels, the approver should call tp_cli_channel_dispatch_operation_call_handle_with() to indicate the user's or approver's preferred handler for the channels (the empty string indicates no particular preference, and will cause any suitable handler to be used).

If the user wishes to reject the communication channels, or if the user accepts the channels and the approver will handle them itself, the approver should call tp_cli_channel_dispatch_operation_call_claim(). If this method succeeds, the approver immediately has control over the channels as their primary handler, and may do anything with them (in particular, it may close them in whatever way seems most appropriate).

There are various situations in which the channel dispatch operation will be closed, causing the “invalidated” signal to be emitted. If this happens, the approver should stop prompting the user.

Because all approvers are launched simultaneously, the user might respond to another approver; if this happens, the “invalidated” signal will be emitted with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_OBJECT_REMOVED.

If a channel closes, the “channel-lost” signal is emitted. If all channels close, there is nothing more to dispatch, so the “invalidated” signal will be emitted with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_OBJECT_REMOVED.

If the channel dispatcher crashes or exits, the “invalidated” signal will be emitted with the domain TP_DBUS_ERRORS and the error code TP_DBUS_ERROR_NAME_OWNER_LOST. In a high-quality implementation, the dispatcher should be restarted, at which point it will create new channel dispatch operations for any undispatched channels, and the approver will be notified again.

Creating a TpChannelDispatchOperation directly is deprecated: it should only be created via a TpBaseClient.

Since 0.16, TpChannelDispatchOperation always has a non-NULL “factory”, which will be propagated to the TpAccount, TpConnection and TpChannel.

Since: 0.7.32


struct TpChannelDispatchOperationClass

struct TpChannelDispatchOperationClass {
};

The class of a TpChannelDispatchOperation.


TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE

#define             TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpChannelDispatchOperation.

When this feature is prepared, the basic properties of the ChannelDispatchOperation have been retrieved and are available for use.

Specifically, this implies that:

  • “connection” is set (but TP_CONNECTION_FEATURE_CORE is not necessarily prepared)

  • “account” is set (but TP_ACCOUNT_FEATURE_CORE is not necessarily prepared)

  • “channels” is set (but TP_CHANNEL_FEATURE_CORE is not necessarily prepared)

  • “possible-handlers” is set

  • any extra interfaces will have been set up in TpProxy (i.e. “interfaces” contains at least all extra ChannelDispatchOperation interfaces)

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.11.5

Property Details

The “account” property

  “account”                  TpAccount *

The TpAccount with which the connection and channels are associated.

Read-only except during construction.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

Owner: TpChannelDispatchOperation

Flags: Read / Write / Construct Only

Since: 0.11.5


The “cdo-properties” property

  “cdo-properties”           GHashTable_gchararray+GValue_*

The immutable D-Bus properties of this ChannelDispatchOperation, represented by a GHashTable where the keys are D-Bus interface name + "." + property name, and the values are GValue instances.

Read-only except during construction. If this is not provided during construction, it is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

Owner: TpChannelDispatchOperation

Flags: Read / Write / Construct Only

Since: 0.11.5


The “channels” property

  “channels”                 GPtrArray *

A GPtrArray containing the TpChannel to be dispatched.

Read-only.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

Owner: TpChannelDispatchOperation

Flags: Read / Write / Construct Only

Since: 0.11.5


The “connection” property

  “connection”               TpConnection *

The TpConnection with which the channels are associated.

Read-only except during construction.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

Owner: TpChannelDispatchOperation

Flags: Read / Write / Construct Only

Since: 0.11.5


The “possible-handlers” property

  “possible-handlers”        GStrv

A GStrv containing the well known bus names (starting with TP_CLIENT_BUS_NAME_BASE) of the possible Handlers for the channels

Read-only except during construction.

This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE.

Owner: TpChannelDispatchOperation

Flags: Read

Since: 0.11.5

Signal Details

The “channel-lost” signal

void
user_function (TpChannelDispatchOperation *self,
               TpChannel                  *channel,
               guint                       domain,
               gint                        code,
               gchar                      *message,
               gpointer                    user_data)

Emitted when a channel has closed before it could be claimed or handled.

Parameters

self

a TpChannelDispatchOperation

 

channel

the TpChannel that closed

 

domain

domain of a GError indicating why the channel has been closed

 

code

error code of a GError indicating why the channel has been closed

 

message

a message associated with the error

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-aliasing.html0000644000175000017500000017265214006623344025025 00000000000000 Connection Aliasing interface: telepathy-glib API Reference Manual

Connection Aliasing interface

Connection Aliasing interface — client-side wrappers for the Aliasing interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Most instant messaging protocols allow users to set a nickname or alias. This section documents the auto-generated C wrappers for the Aliasing interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_aliasing_run_get_alias_flags ()

gboolean
tp_cli_connection_interface_aliasing_run_get_alias_flags
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint *out_Alias_Flags,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_aliasing_run_get_alias_flags is deprecated and should not be used in newly-written code.

Call the method GetAliasFlags and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Return a bitwise OR of flags detailing the behaviour of aliases on this connection.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Alias_Flags

Used to return an 'out' argument if TRUE is returned: An integer with a bitwise OR of flags from ConnectionAliasFlags

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_aliasing_run_request_aliases ()

gboolean
tp_cli_connection_interface_aliasing_run_request_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                gchar ***out_Aliases,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_aliasing_run_request_aliases is deprecated and should not be used in newly-written code.

Call the method RequestAliases and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the value of several contacts' aliases at once.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

out_Aliases

Used to return an 'out' argument if TRUE is returned: A list of aliases in the same order as the contact handles

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_aliasing_run_get_aliases ()

gboolean
tp_cli_connection_interface_aliasing_run_get_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GHashTable **out_Aliases,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_aliasing_run_get_aliases is deprecated and should not be used in newly-written code.

Call the method GetAliases and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request the value of several contacts' aliases at once. This SHOULD only return cached aliases, falling back on the contact identifier (i.e. the string corresponding to the handle) if none is present. Also if there was no cached alias, a request SHOULD be started of which the result is later signalled by <tp:member-ref>AliasesChanged</tp:member-ref>.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

out_Aliases

Used to return an 'out' argument if TRUE is returned: A dictionary mapping contact handles to aliases

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_aliasing_run_set_aliases ()

gboolean
tp_cli_connection_interface_aliasing_run_set_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Aliases,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_aliasing_run_set_aliases is deprecated and should not be used in newly-written code.

Call the method SetAliases and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request that the alias of the given contact be changed. Success will be indicated by emitting an <tp:member-ref>AliasesChanged</tp:member-ref> signal. On connections where the CONNECTION_ALIAS_FLAG_USER_SET flag is not set, this method will only ever succeed if the contact is the user's own handle (as returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.GetSelfHandle</tp:dbus-ref>).

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Aliases

Used to pass an 'in' argument: A dictionary mapping integer handles of contacts to strings of the new alias to set.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_aliasing_call_get_alias_flags ()

TpProxyPendingCall *
tp_cli_connection_interface_aliasing_call_get_alias_flags
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_aliasing_callback_for_get_alias_flags callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetAliasFlags method call.

Return a bitwise OR of flags detailing the behaviour of aliases on this connection.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_aliasing_call_request_aliases ()

TpProxyPendingCall *
tp_cli_connection_interface_aliasing_call_request_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_aliasing_callback_for_request_aliases callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestAliases method call.

Request the value of several contacts' aliases at once.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_aliasing_call_get_aliases ()

TpProxyPendingCall *
tp_cli_connection_interface_aliasing_call_get_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_aliasing_callback_for_get_aliases callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetAliases method call.

Request the value of several contacts' aliases at once. This SHOULD only return cached aliases, falling back on the contact identifier (i.e. the string corresponding to the handle) if none is present. Also if there was no cached alias, a request SHOULD be started of which the result is later signalled by <tp:member-ref>AliasesChanged</tp:member-ref>.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_aliasing_call_set_aliases ()

TpProxyPendingCall *
tp_cli_connection_interface_aliasing_call_set_aliases
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Aliases,
                                tp_cli_connection_interface_aliasing_callback_for_set_aliases callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetAliases method call.

Request that the alias of the given contact be changed. Success will be indicated by emitting an <tp:member-ref>AliasesChanged</tp:member-ref> signal. On connections where the CONNECTION_ALIAS_FLAG_USER_SET flag is not set, this method will only ever succeed if the contact is the user's own handle (as returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.GetSelfHandle</tp:dbus-ref>).

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Aliases

Used to pass an 'in' argument: A dictionary mapping integer handles of contacts to strings of the new alias to set.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_aliasing_callback_for_get_alias_flags ()

void
(*tp_cli_connection_interface_aliasing_callback_for_get_alias_flags)
                               (TpConnection *proxy,
                                guint out_Alias_Flags,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetAliasFlags method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Alias_Flags

Used to return an 'out' argument if error is NULL: An integer with a bitwise OR of flags from ConnectionAliasFlags (TpConnectionAliasFlags)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_aliasing_callback_for_request_aliases ()

void
(*tp_cli_connection_interface_aliasing_callback_for_request_aliases)
                               (TpConnection *proxy,
                                const gchar **out_Aliases,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestAliases method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Aliases

Used to return an 'out' argument if error is NULL: A list of aliases in the same order as the contact handles

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_aliasing_callback_for_get_aliases ()

void
(*tp_cli_connection_interface_aliasing_callback_for_get_aliases)
                               (TpConnection *proxy,
                                GHashTable *out_Aliases,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetAliases method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Aliases

Used to return an 'out' argument if error is NULL: A dictionary mapping contact handles to aliases

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_aliasing_callback_for_set_aliases ()

void
(*tp_cli_connection_interface_aliasing_callback_for_set_aliases)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetAliases method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_aliasing_connect_to_aliases_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_aliasing_connect_to_aliases_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_aliasing_signal_callback_aliases_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AliasesChanged.

Signal emitted when a contact's alias (or that of the user) is changed.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_aliasing_signal_callback_aliases_changed ()

void
(*tp_cli_connection_interface_aliasing_signal_callback_aliases_changed)
                               (TpConnection *proxy,
                                const GPtrArray *arg_Aliases,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AliasesChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_aliasing_connect_to_aliases_changed() was called

 

arg_Aliases

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array containing structs of: <ul> <li>the handle representing the contact</li> <li>the new alias</li> </ul>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-media.html0000644000175000017500000074507714006623344023575 00000000000000 Media channels: telepathy-glib API Reference Manual

Media channels

Media channels — client-side wrappers for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces

Functions

TpProxyPendingCall * tp_cli_channel_type_streamed_media_call_list_streams ()
TpProxyPendingCall * tp_cli_channel_type_streamed_media_call_remove_streams ()
TpProxyPendingCall * tp_cli_channel_type_streamed_media_call_request_stream_direction ()
TpProxyPendingCall * tp_cli_channel_type_streamed_media_call_request_streams ()
void (*tp_cli_channel_type_streamed_media_callback_for_list_streams) ()
void (*tp_cli_channel_type_streamed_media_callback_for_remove_streams) ()
void (*tp_cli_channel_type_streamed_media_callback_for_request_stream_direction) ()
void (*tp_cli_channel_type_streamed_media_callback_for_request_streams) ()
gboolean tp_cli_channel_type_streamed_media_run_list_streams ()
gboolean tp_cli_channel_type_streamed_media_run_remove_streams ()
gboolean tp_cli_channel_type_streamed_media_run_request_stream_direction ()
gboolean tp_cli_channel_type_streamed_media_run_request_streams ()
TpProxySignalConnection * tp_cli_channel_type_streamed_media_connect_to_stream_added ()
TpProxySignalConnection * tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed ()
TpProxySignalConnection * tp_cli_channel_type_streamed_media_connect_to_stream_error ()
TpProxySignalConnection * tp_cli_channel_type_streamed_media_connect_to_stream_removed ()
TpProxySignalConnection * tp_cli_channel_type_streamed_media_connect_to_stream_state_changed ()
void (*tp_cli_channel_type_streamed_media_signal_callback_stream_added) ()
void (*tp_cli_channel_type_streamed_media_signal_callback_stream_direction_changed) ()
void (*tp_cli_channel_type_streamed_media_signal_callback_stream_error) ()
void (*tp_cli_channel_type_streamed_media_signal_callback_stream_removed) ()
void (*tp_cli_channel_type_streamed_media_signal_callback_stream_state_changed) ()
TpProxyPendingCall * tp_cli_channel_interface_call_state_call_get_call_states ()
void (*tp_cli_channel_interface_call_state_callback_for_get_call_states) ()
TpProxySignalConnection * tp_cli_channel_interface_call_state_connect_to_call_state_changed ()
gboolean tp_cli_channel_interface_call_state_run_get_call_states ()
void (*tp_cli_channel_interface_call_state_signal_callback_call_state_changed) ()
gboolean tp_cli_channel_interface_dtmf_run_start_tone ()
gboolean tp_cli_channel_interface_dtmf_run_stop_tone ()
TpProxyPendingCall * tp_cli_channel_interface_dtmf_call_start_tone ()
TpProxyPendingCall * tp_cli_channel_interface_dtmf_call_stop_tone ()
void (*tp_cli_channel_interface_dtmf_callback_for_start_tone) ()
void (*tp_cli_channel_interface_dtmf_callback_for_stop_tone) ()
TpProxyPendingCall * tp_cli_channel_interface_dtmf_call_multiple_tones ()
void (*tp_cli_channel_interface_dtmf_callback_for_multiple_tones) ()
TpProxySignalConnection * tp_cli_channel_interface_dtmf_connect_to_sending_tones ()
void (*tp_cli_channel_interface_dtmf_signal_callback_sending_tones) ()
TpProxySignalConnection * tp_cli_channel_interface_dtmf_connect_to_stopped_tones ()
void (*tp_cli_channel_interface_dtmf_signal_callback_stopped_tones) ()
TpProxySignalConnection * tp_cli_channel_interface_dtmf_connect_to_tones_deferred ()
void (*tp_cli_channel_interface_dtmf_signal_callback_tones_deferred) ()
void (*tp_cli_channel_interface_hold_callback_for_get_hold_state) ()
TpProxyPendingCall * tp_cli_channel_interface_hold_call_get_hold_state ()
gboolean tp_cli_channel_interface_hold_run_get_hold_state ()
void (*tp_cli_channel_interface_hold_callback_for_request_hold) ()
TpProxyPendingCall * tp_cli_channel_interface_hold_call_request_hold ()
gboolean tp_cli_channel_interface_hold_run_request_hold ()
void (*tp_cli_channel_interface_hold_signal_callback_hold_state_changed) ()
TpProxySignalConnection * tp_cli_channel_interface_hold_connect_to_hold_state_changed ()
gboolean tp_cli_channel_interface_media_signalling_run_get_session_handlers ()
TpProxyPendingCall * tp_cli_channel_interface_media_signalling_call_get_session_handlers ()
void (*tp_cli_channel_interface_media_signalling_callback_for_get_session_handlers) ()
TpProxySignalConnection * tp_cli_channel_interface_media_signalling_connect_to_new_session_handler ()
void (*tp_cli_channel_interface_media_signalling_signal_callback_new_session_handler) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This section documents the auto-generated C wrappers for the Streamed Media channel type, and the DTMF and Media Signalling interfaces which are optionally supported by channels of this type.

Streamed Media channels represent real-time audio or video streaming, including voice over IP, webcams, and telephony.

Channels of type Streamed Media may support the Media Signalling interface. If not, the connection manager is assumed to be presenting the media streams to the user automatically (for instance, in a connection manager like gnome-phone-manager or telepathy-snom that remotely controls a telephone, the phone's own speaker and microphone will probably be used directly).

If Media Signalling is supported, the Telepathy client is responsible for actually streaming the media, using the Media Signalling interface to provide signalling (connection managers might implement this interface in terms of Jingle or SDP, for instance). The Telepathy project suggests that client authors use the Farsight library for this; the glue between Media Signalling and Farsight is currently done in telepathy-stream-engine, an additional D-Bus service, but it will be provided as a library in future.

Channels of type Streamed Media may also support the DTMF and CallState interfaces.

Functions

tp_cli_channel_type_streamed_media_call_list_streams ()

TpProxyPendingCall *
tp_cli_channel_type_streamed_media_call_list_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_streamed_media_callback_for_list_streams callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListStreams method call.

Returns an array of structs representing the streams currently active within this channel. Each stream is identified by an unsigned integer which is unique for each stream within the channel.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_streamed_media_call_remove_streams ()

TpProxyPendingCall *
tp_cli_channel_type_streamed_media_call_remove_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Streams,
                                tp_cli_channel_type_streamed_media_callback_for_remove_streams callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveStreams method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the given streams are removed. If all streams are removed, the channel MAY close.</p> <p>Clients SHOULD NOT attempt to terminate calls by removing all the streams; instead, clients SHOULD terminate calls by removing the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface">Group.SelfHandle</tp:dbus-ref> from the channel, using either <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Group">RemoveMembers</tp:dbus-ref> or <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Group">RemoveMembersWithReason</tp:dbus-ref>. </p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Streams

Used to pass an 'in' argument: An array of stream identifiers (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_streamed_media_call_request_stream_direction ()

TpProxyPendingCall *
tp_cli_channel_type_streamed_media_call_request_stream_direction
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                guint in_Stream_Direction,
                                tp_cli_channel_type_streamed_media_callback_for_request_stream_direction callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestStreamDirection method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a change in the direction of an existing stream. In particular, this might be useful to stop sending media of a particular type, or inform the peer that you are no longer using media that is being sent to you.</p> <p>Depending on the protocol, streams which are no longer sending in either direction should be removed and a <tp:member-ref>StreamRemoved</tp:member-ref> signal emitted. Some direction changes can be enforced locally (for example, BIDIRECTIONAL -&gt; RECEIVE can be achieved by merely stopping sending), others may not be possible on some protocols, and some need agreement from the remote end. In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in the <tp:member-ref>StreamDirectionChanged</tp:member-ref> signal, and the signal emitted again without the flag to indicate the resulting direction when the remote end has accepted or rejected the change.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Stream_ID

Used to pass an 'in' argument: The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

in_Stream_Direction

Used to pass an 'in' argument: The desired stream direction (a value of MediaStreamDirection) (TpMediaStreamDirection)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_streamed_media_call_request_streams ()

TpProxyPendingCall *
tp_cli_channel_type_streamed_media_call_request_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Contact_Handle,
                                const GArray *in_Types,
                                tp_cli_channel_type_streamed_media_callback_for_request_streams callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestStreams method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that streams be established to exchange the given types of media with the given member. In general this will try and establish a bidirectional stream, but on some protocols it may not be possible to indicate to the peer that you would like to receive media, so a send-only stream will be created initially. In the cases where the stream requires remote agreement (eg you wish to receive media from them), the <tp:member-ref>StreamDirectionChanged</tp:member-ref> signal will be emitted with the MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again with the flag cleared when the remote end has replied.</p> <p>If streams of the requested types already exist, calling this method results in the creation of additional streams. Accordingly, clients wishing to have exactly one audio stream or exactly one video stream SHOULD check for the current streams using <tp:member-ref>ListStreams</tp:member-ref> before calling this method.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact_Handle

Used to pass an 'in' argument: A contact handle with whom to establish the streams (TpContactHandle)

 

in_Types

Used to pass an 'in' argument: An array of stream types (values of MediaStreamType)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_streamed_media_callback_for_list_streams ()

void
(*tp_cli_channel_type_streamed_media_callback_for_list_streams)
                               (TpChannel *proxy,
                                const GPtrArray *out_Streams,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListStreams method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Streams

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs containing: <ul> <li>the stream identifier</li> <li>the contact handle who the stream is with (or 0 if the stream represents more than a single member)</li> <li>the type of the stream</li> <li>the current stream state</li> <li>the current direction of the stream</li> <li>the current pending send flags</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_streamed_media_callback_for_remove_streams ()

void
(*tp_cli_channel_type_streamed_media_callback_for_remove_streams)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveStreams method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_streamed_media_callback_for_request_stream_direction ()

void
(*tp_cli_channel_type_streamed_media_callback_for_request_stream_direction)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestStreamDirection method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_streamed_media_callback_for_request_streams ()

void
(*tp_cli_channel_type_streamed_media_callback_for_request_streams)
                               (TpChannel *proxy,
                                const GPtrArray *out_Streams,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestStreams method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Streams

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs (in the same order as the given stream types) containing: <ul> <li>the stream identifier</li> <li>the contact handle who the stream is with (or 0 if the stream represents more than a single member)</li> <li>the type of the stream</li> <li>the current stream state</li> <li>the current direction of the stream</li> <li>the current pending send flags</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_streamed_media_run_list_streams ()

gboolean
tp_cli_channel_type_streamed_media_run_list_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GPtrArray **out_Streams,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_streamed_media_run_list_streams is deprecated and should not be used in newly-written code.

Call the method ListStreams and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns an array of structs representing the streams currently active within this channel. Each stream is identified by an unsigned integer which is unique for each stream within the channel.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Streams

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs containing: <ul> <li>the stream identifier</li> <li>the contact handle who the stream is with (or 0 if the stream represents more than a single member)</li> <li>the type of the stream</li> <li>the current stream state</li> <li>the current direction of the stream</li> <li>the current pending send flags</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_streamed_media_run_remove_streams ()

gboolean
tp_cli_channel_type_streamed_media_run_remove_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Streams,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_streamed_media_run_remove_streams is deprecated and should not be used in newly-written code.

Call the method RemoveStreams and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the given streams are removed. If all streams are removed, the channel MAY close.</p> <p>Clients SHOULD NOT attempt to terminate calls by removing all the streams; instead, clients SHOULD terminate calls by removing the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface">Group.SelfHandle</tp:dbus-ref> from the channel, using either <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Group">RemoveMembers</tp:dbus-ref> or <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Group">RemoveMembersWithReason</tp:dbus-ref>. </p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Streams

Used to pass an 'in' argument: An array of stream identifiers (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_streamed_media_run_request_stream_direction ()

gboolean
tp_cli_channel_type_streamed_media_run_request_stream_direction
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                guint in_Stream_Direction,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_streamed_media_run_request_stream_direction is deprecated and should not be used in newly-written code.

Call the method RequestStreamDirection and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request a change in the direction of an existing stream. In particular, this might be useful to stop sending media of a particular type, or inform the peer that you are no longer using media that is being sent to you.</p> <p>Depending on the protocol, streams which are no longer sending in either direction should be removed and a <tp:member-ref>StreamRemoved</tp:member-ref> signal emitted. Some direction changes can be enforced locally (for example, BIDIRECTIONAL -&gt; RECEIVE can be achieved by merely stopping sending), others may not be possible on some protocols, and some need agreement from the remote end. In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in the <tp:member-ref>StreamDirectionChanged</tp:member-ref> signal, and the signal emitted again without the flag to indicate the resulting direction when the remote end has accepted or rejected the change.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Stream_ID

Used to pass an 'in' argument: The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

in_Stream_Direction

Used to pass an 'in' argument: The desired stream direction (a value of MediaStreamDirection) (TpMediaStreamDirection)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_streamed_media_run_request_streams ()

gboolean
tp_cli_channel_type_streamed_media_run_request_streams
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Contact_Handle,
                                const GArray *in_Types,
                                GPtrArray **out_Streams,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_streamed_media_run_request_streams is deprecated and should not be used in newly-written code.

Call the method RequestStreams and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that streams be established to exchange the given types of media with the given member. In general this will try and establish a bidirectional stream, but on some protocols it may not be possible to indicate to the peer that you would like to receive media, so a send-only stream will be created initially. In the cases where the stream requires remote agreement (eg you wish to receive media from them), the <tp:member-ref>StreamDirectionChanged</tp:member-ref> signal will be emitted with the MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again with the flag cleared when the remote end has replied.</p> <p>If streams of the requested types already exist, calling this method results in the creation of additional streams. Accordingly, clients wishing to have exactly one audio stream or exactly one video stream SHOULD check for the current streams using <tp:member-ref>ListStreams</tp:member-ref> before calling this method.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contact_Handle

Used to pass an 'in' argument: A contact handle with whom to establish the streams (TpContactHandle)

 

in_Types

Used to pass an 'in' argument: An array of stream types (values of MediaStreamType)

 

out_Streams

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs (in the same order as the given stream types) containing: <ul> <li>the stream identifier</li> <li>the contact handle who the stream is with (or 0 if the stream represents more than a single member)</li> <li>the type of the stream</li> <li>the current stream state</li> <li>the current direction of the stream</li> <li>the current pending send flags</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_streamed_media_connect_to_stream_added ()

TpProxySignalConnection *
tp_cli_channel_type_streamed_media_connect_to_stream_added
                               (TpChannel *proxy,
                                tp_cli_channel_type_streamed_media_signal_callback_stream_added callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamAdded.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a new stream has been added to this channel. Clients SHOULD assume that the stream's <tp:type>Media_Stream_State</tp:type> is initially Disconnected.</p> <p>If a connection manager needs to represent the addition of a stream whose state is already Connecting or Connected, it MUST do this by emitting StreamAdded, closely followed by <tp:member-ref>StreamStateChanged</tp:member-ref> indicating a change to the appropriate state.</p> <tp:rationale> <p>Historically, it was not clear from the StreamAdded signal what the state of the stream was. telepathy-spec 0.17.22 clarified this.</p> </tp:rationale> <p>Similarly, clients SHOULD assume that the initial <tp:type>Media_Stream_Direction</tp:type> of a newly added stream is Receive, and that the initial <tp:type>Media_Stream_Pending_Send</tp:type> is Pending_Local_Send.</p> <p>If a connection manager needs to represent the addition of a stream whose direction or pending-send differs from those initial values, it MUST do so by emitting StreamAdded, closely followed by <tp:member-ref>StreamDirectionChanged</tp:member-ref> indicating a change to the appropriate direction and pending-send state.</p> <tp:rationale> <p>StreamAdded doesn't itself indicate the stream's direction; this is unfortunate, but is preserved for compatibility.</p> <p>This is the appropriate direction for streams added by a remote contact on existing connection managers, and does not violate user privacy by automatically sending audio or video (audio streams start off muted, video streams start off not sending). For streams added by the local user using the client receiving the signal, the true direction can also be determined from the return value of the <tp:member-ref>RequestStreams</tp:member-ref> method.</p> <p>Existing clients typically operate by maintaining a separate idea of the directions that they would like the streams to have, and enforcing these intended directions by calling <tp:member-ref>RequestStreamDirection</tp:member-ref> whenever needed.</p> </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed ()

TpProxySignalConnection *
tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_streamed_media_signal_callback_stream_direction_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamDirectionChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the direction or pending flags of a stream are changed.</p> <p>If the MEDIA_STREAM_PENDING_LOCAL_SEND flag is set, the remote user has requested that we begin sending on this stream. <tp:member-ref>RequestStreamDirection</tp:member-ref> should be called to indicate whether or not this change is acceptable.</p> <tp:rationale> <p>This allows for a MSN-style user interface, &quot;Fred has asked you to enable your webcam. (Accept | Reject)&quot;, if desired.</p> </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_streamed_media_connect_to_stream_error ()

TpProxySignalConnection *
tp_cli_channel_type_streamed_media_connect_to_stream_error
                               (TpChannel *proxy,
                                tp_cli_channel_type_streamed_media_signal_callback_stream_error callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamError.

Emitted when a stream encounters an error.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_streamed_media_connect_to_stream_removed ()

TpProxySignalConnection *
tp_cli_channel_type_streamed_media_connect_to_stream_removed
                               (TpChannel *proxy,
                                tp_cli_channel_type_streamed_media_signal_callback_stream_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamRemoved.

Emitted when a stream has been removed from this channel.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_streamed_media_connect_to_stream_state_changed ()

TpProxySignalConnection *
tp_cli_channel_type_streamed_media_connect_to_stream_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_streamed_media_signal_callback_stream_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamStateChanged.

Emitted when a member's stream's state changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_streamed_media_signal_callback_stream_added ()

void
(*tp_cli_channel_type_streamed_media_signal_callback_stream_added)
                               (TpChannel *proxy,
                                guint arg_Stream_ID,
                                guint arg_Contact_Handle,
                                guint arg_Stream_Type,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamAdded.

Parameters

proxy

The proxy on which tp_cli_channel_type_streamed_media_connect_to_stream_added() was called

 

arg_Stream_ID

The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

arg_Contact_Handle

The contact handle who the stream is with (or 0 if it represents more than a single member) (TpContactHandle)

 

arg_Stream_Type

The stream type (a value from MediaStreamType) (TpMediaStreamType)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_streamed_media_signal_callback_stream_direction_changed ()

void
(*tp_cli_channel_type_streamed_media_signal_callback_stream_direction_changed)
                               (TpChannel *proxy,
                                guint arg_Stream_ID,
                                guint arg_Stream_Direction,
                                guint arg_Pending_Flags,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamDirectionChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed() was called

 

arg_Stream_ID

The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

arg_Stream_Direction

The new stream direction (as defined in ListStreams) (TpMediaStreamDirection)

 

arg_Pending_Flags

The new pending send flags (as defined in ListStreams) (TpMediaStreamPendingSend)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_streamed_media_signal_callback_stream_error ()

void
(*tp_cli_channel_type_streamed_media_signal_callback_stream_error)
                               (TpChannel *proxy,
                                guint arg_Stream_ID,
                                guint arg_Error_Code,
                                const gchar *arg_Message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamError.

Parameters

proxy

The proxy on which tp_cli_channel_type_streamed_media_connect_to_stream_error() was called

 

arg_Stream_ID

The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

arg_Error_Code

A stream error number, one of the values of MediaStreamError (TpMediaStreamError)

 

arg_Message

A string describing the error (for debugging purposes only)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_streamed_media_signal_callback_stream_removed ()

void
(*tp_cli_channel_type_streamed_media_signal_callback_stream_removed)
                               (TpChannel *proxy,
                                guint arg_Stream_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamRemoved.

Parameters

proxy

The proxy on which tp_cli_channel_type_streamed_media_connect_to_stream_removed() was called

 

arg_Stream_ID

stream_id - the stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_streamed_media_signal_callback_stream_state_changed ()

void
(*tp_cli_channel_type_streamed_media_signal_callback_stream_state_changed)
                               (TpChannel *proxy,
                                guint arg_Stream_ID,
                                guint arg_Stream_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_streamed_media_connect_to_stream_state_changed() was called

 

arg_Stream_ID

The stream identifier (as defined in <tp:member-ref>ListStreams</tp:member-ref>)

 

arg_Stream_State

The new stream state (as defined in ListStreams) (TpMediaStreamState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_call_state_call_get_call_states ()

TpProxyPendingCall *
tp_cli_channel_interface_call_state_call_get_call_states
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_call_state_callback_for_get_call_states callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetCallStates method call.

Get the current call states for all contacts involved in this call.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_call_state_callback_for_get_call_states ()

void
(*tp_cli_channel_interface_call_state_callback_for_get_call_states)
                               (TpChannel *proxy,
                                GHashTable *out_States,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetCallStates method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_States

Used to return an 'out' argument if error is NULL: The current call states. Participants where the call state flags would be 0 (all unset) may be omitted from this mapping.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_call_state_connect_to_call_state_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_call_state_connect_to_call_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_call_state_signal_callback_call_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal CallStateChanged.

Emitted when the state of a member of the channel has changed.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_call_state_run_get_call_states ()

gboolean
tp_cli_channel_interface_call_state_run_get_call_states
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable **out_States,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_call_state_run_get_call_states is deprecated and should not be used in newly-written code.

Call the method GetCallStates and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get the current call states for all contacts involved in this call.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_States

Used to return an 'out' argument if TRUE is returned: The current call states. Participants where the call state flags would be 0 (all unset) may be omitted from this mapping.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_call_state_signal_callback_call_state_changed ()

void
(*tp_cli_channel_interface_call_state_signal_callback_call_state_changed)
                               (TpChannel *proxy,
                                guint arg_Contact,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal CallStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_call_state_connect_to_call_state_changed() was called

 

arg_Contact

An integer handle for the contact. (TpContactHandle)

 

arg_State

The new state for this contact. (TpChannelCallStateFlags)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_dtmf_run_start_tone ()

gboolean
tp_cli_channel_interface_dtmf_run_start_tone
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                guchar in_Event,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_dtmf_run_start_tone is deprecated and should not be used in newly-written code.

Call the method StartTone and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<p>Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until <tp:member-ref>StopTone</tp:member-ref> is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.</p> <tp:rationale> The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly. </tp:rationale> <p>Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Stream_ID

Used to pass an 'in' argument: A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the tone SHOULD be sent to all eligible streams in the channel. (TpStreamID)

 

in_Event

Used to pass an 'in' argument: A numeric event code from the DTMF_Event enum.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_dtmf_run_stop_tone ()

gboolean
tp_cli_channel_interface_dtmf_run_stop_tone
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_dtmf_run_stop_tone is deprecated and should not be used in newly-written code.

Call the method StopTone and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Stop sending any DTMF tones which have been started using the <tp:member-ref>StartTone</tp:member-ref> or <tp:member-ref>MultipleTones</tp:member-ref> methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal. <tp:rationale> On some protocols it might be impossible to cancel queued tones immediately. </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Stream_ID

Used to pass an 'in' argument: A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the sending SHOULD be stoped in all eligible streams in the channel. (TpStreamID)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_dtmf_call_start_tone ()

TpProxyPendingCall *
tp_cli_channel_interface_dtmf_call_start_tone
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                guchar in_Event,
                                tp_cli_channel_interface_dtmf_callback_for_start_tone callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StartTone method call.

<p>Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until <tp:member-ref>StopTone</tp:member-ref> is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.</p> <tp:rationale> The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly. </tp:rationale> <p>Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Stream_ID

Used to pass an 'in' argument: A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the tone SHOULD be sent to all eligible streams in the channel. (TpStreamID)

 

in_Event

Used to pass an 'in' argument: A numeric event code from the DTMF_Event enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_dtmf_call_stop_tone ()

TpProxyPendingCall *
tp_cli_channel_interface_dtmf_call_stop_tone
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Stream_ID,
                                tp_cli_channel_interface_dtmf_callback_for_stop_tone callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StopTone method call.

Stop sending any DTMF tones which have been started using the <tp:member-ref>StartTone</tp:member-ref> or <tp:member-ref>MultipleTones</tp:member-ref> methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal. <tp:rationale> On some protocols it might be impossible to cancel queued tones immediately. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Stream_ID

Used to pass an 'in' argument: A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the sending SHOULD be stoped in all eligible streams in the channel. (TpStreamID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_dtmf_callback_for_start_tone ()

void
(*tp_cli_channel_interface_dtmf_callback_for_start_tone)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StartTone method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_dtmf_callback_for_stop_tone ()

void
(*tp_cli_channel_interface_dtmf_callback_for_stop_tone)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StopTone method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_dtmf_call_multiple_tones ()

TpProxyPendingCall *
tp_cli_channel_interface_dtmf_call_multiple_tones
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Tones,
                                tp_cli_channel_interface_dtmf_callback_for_multiple_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a MultipleTones method call.

<p>Send multiple DTMF events to all eligible streams in the channel. Each tone will be played for an implementation-defined number of milliseconds (typically 250ms), followed by a gap before the next tone is played (typically 100ms). The duration and gap are defined by the protocol or connection manager.</p> <tp:rationale> <p>In cases where the client knows in advance the tone sequence it wants to send, it's easier to use this method than manually start and stop each tone in the sequence.</p> <p>The tone and gap lengths may need to vary for interoperability, according to the protocol and other implementations' ability to recognise tones. At the time of writing, GStreamer uses a minimum of 250ms tones and 100ms gaps when playing in-band DTMF in the normal audio stream, or 70ms tones and 50ms gaps when encoding DTMF as <code>audio/telephone-event</code>.</p> </tp:rationale> <p>Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Tones

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A string representation of one or more DTMF events. Implementations of this method MUST support all of the following characters in this string:</p> <ul> <li>the digits 0-9, letters A-D and a-d, and symbols '*' and '#' correspond to the members of <tp:type>DTMF_Event</tp:type></li> <li>any of 'p', 'P', 'x', 'X' or ',' (comma) results in an implementation-defined pause, typically for 3 seconds</li> <li>'w' or 'W' waits for the user to continue, by stopping interpretation of the string, and if there is more to be played, emitting the <tp:member-ref>TonesDeferred</tp:member-ref> signal with the rest of the string as its argument: see that signal for details</li> </ul>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_dtmf_callback_for_multiple_tones ()

void
(*tp_cli_channel_interface_dtmf_callback_for_multiple_tones)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a MultipleTones method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_dtmf_connect_to_sending_tones ()

TpProxySignalConnection *
tp_cli_channel_interface_dtmf_connect_to_sending_tones
                               (TpChannel *proxy,
                                tp_cli_channel_interface_dtmf_signal_callback_sending_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SendingTones.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>DTMF tone(s)are being sent to all eligible streams in the channel. The signal is provided to indicating the fact that the streams are currently being used to send one or more DTMF tones, so any other media input is not getting through to the audio stream. It also serves as a cue for the <tp:member-ref>StopTone</tp:member-ref> method.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_dtmf_signal_callback_sending_tones ()

void
(*tp_cli_channel_interface_dtmf_signal_callback_sending_tones)
                               (TpChannel *proxy,
                                const gchar *arg_Tones,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SendingTones.

Parameters

proxy

The proxy on which tp_cli_channel_interface_dtmf_connect_to_sending_tones() was called

 

arg_Tones

DTMF string (one or more events) that is to be played.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_dtmf_connect_to_stopped_tones ()

TpProxySignalConnection *
tp_cli_channel_interface_dtmf_connect_to_stopped_tones
                               (TpChannel *proxy,
                                tp_cli_channel_interface_dtmf_signal_callback_stopped_tones callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StoppedTones.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>DTMF tones have finished playing on streams in this channel.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_dtmf_signal_callback_stopped_tones ()

void
(*tp_cli_channel_interface_dtmf_signal_callback_stopped_tones)
                               (TpChannel *proxy,
                                gboolean arg_Cancelled,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StoppedTones.

Parameters

proxy

The proxy on which tp_cli_channel_interface_dtmf_connect_to_stopped_tones() was called

 

arg_Cancelled

True if the DTMF tones were actively cancelled via <tp:member-ref>StopTone</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_dtmf_connect_to_tones_deferred ()

TpProxySignalConnection *
tp_cli_channel_interface_dtmf_connect_to_tones_deferred
                               (TpChannel *proxy,
                                tp_cli_channel_interface_dtmf_signal_callback_tones_deferred callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TonesDeferred.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when 'w' or 'W', indicating &quot;wait for the user to continue&quot;, is encountered while playing a DTMF string queued by <tp:member-ref>MultipleTones</tp:member-ref> or <tp:member-ref>InitialTones</tp:member-ref>. Any queued DTMF events after the 'w', which have not yet been played, are placed in the <tp:member-ref>DeferredTones</tp:member-ref> property and copied into this signal's argument.</p> <p>When the channel handler is ready to continue, it MAY pass the value of <tp:member-ref>DeferredTones</tp:member-ref> to <tp:member-ref>MultipleTones</tp:member-ref>, to resume sending. Alternatively, it MAY ignore the deferred tones, or even play different tones instead. Any deferred tones are discarded the next time a tone is played.</p> <p>This signal SHOULD NOT be emitted if there is nothing left to play, i.e. if the 'w' was the last character in the DTMF string.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_dtmf_signal_callback_tones_deferred ()

void
(*tp_cli_channel_interface_dtmf_signal_callback_tones_deferred)
                               (TpChannel *proxy,
                                const gchar *arg_Tones,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TonesDeferred.

Parameters

proxy

The proxy on which tp_cli_channel_interface_dtmf_connect_to_tones_deferred() was called

 

arg_Tones

The new non-empty value of <tp:member-ref>DeferredTones</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_hold_callback_for_get_hold_state ()

void
(*tp_cli_channel_interface_hold_callback_for_get_hold_state)
                               (TpChannel *proxy,
                                guint out_HoldState,
                                guint out_Reason,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetHoldState method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_HoldState

Used to return an 'out' argument if error is NULL: The state of the channel (TpLocalHoldState)

 

out_Reason

Used to return an 'out' argument if error is NULL: The reason why the channel is in that state (TpLocalHoldStateReason)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_hold_call_get_hold_state ()

TpProxyPendingCall *
tp_cli_channel_interface_hold_call_get_hold_state
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_hold_callback_for_get_hold_state callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetHoldState method call.

Return whether the local user has placed the channel on hold.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_hold_run_get_hold_state ()

gboolean
tp_cli_channel_interface_hold_run_get_hold_state
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint *out_HoldState,
                                guint *out_Reason,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_hold_run_get_hold_state is deprecated and should not be used in newly-written code.

Call the method GetHoldState and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Return whether the local user has placed the channel on hold.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_HoldState

Used to return an 'out' argument if TRUE is returned: The state of the channel

 

out_Reason

Used to return an 'out' argument if TRUE is returned: The reason why the channel is in that state

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_hold_callback_for_request_hold ()

void
(*tp_cli_channel_interface_hold_callback_for_request_hold)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestHold method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_hold_call_request_hold ()

TpProxyPendingCall *
tp_cli_channel_interface_hold_call_request_hold
                               (TpChannel *proxy,
                                gint timeout_ms,
                                gboolean in_Hold,
                                tp_cli_channel_interface_hold_callback_for_request_hold callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestHold method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the channel be put on hold (be instructed not to send any media streams to you) or be taken off hold.</p> <p>If the connection manager can immediately tell that the requested state change could not possibly succeed, this method SHOULD return the NotAvailable error. If the requested state is the same as the current state, this method SHOULD return successfully without doing anything.</p> <p>Otherwise, this method SHOULD immediately set the hold state to Local_Hold_State_Pending_Hold or Local_Hold_State_Pending_Unhold (as appropriate), emitting <tp:member-ref>HoldStateChanged</tp:member-ref> if this is a change, and return successfully.</p> <p>The eventual success or failure of the request is indicated by a subsequent HoldStateChanged signal, changing the hold state to Local_Hold_State_Held or Local_Hold_State_Unheld.</p> <p>If the channel has multiple streams, and the connection manager succeeds in changing the hold state of one stream but fails to change the hold state of another, it SHOULD attempt to revert all streams to their previous hold states.</p> <p>The following state transitions SHOULD be used, where appropriate:</p> <ul> <li>Successful hold: (Unheld, any reason) → (Pending_Hold, Requested) → (Held, Requested) </li> <li>Successful unhold: (Held, any reason) → (Pending_Unhold, Requested) → (Unheld, Requested) </li> <li>Attempting to unhold fails at the first attempt to acquire a resource: (Held, any reason) → (Pending_Unhold, Requested) → (Held, Resource_Not_Available) </li> <li>Attempting to unhold acquires one resource, but fails to acquire a second, and takes time to release the first: (Held, any reason) → (Pending_Unhold, Requested) → (Pending_Hold, Resource_Not_Available) → (Held, Resource_Not_Available) </li> </ul>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Hold

Used to pass an 'in' argument: A boolean indicating whether or not the channel should be on hold

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_hold_run_request_hold ()

gboolean
tp_cli_channel_interface_hold_run_request_hold
                               (TpChannel *proxy,
                                gint timeout_ms,
                                gboolean in_Hold,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_hold_run_request_hold is deprecated and should not be used in newly-written code.

Call the method RequestHold and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the channel be put on hold (be instructed not to send any media streams to you) or be taken off hold.</p> <p>If the connection manager can immediately tell that the requested state change could not possibly succeed, this method SHOULD return the NotAvailable error. If the requested state is the same as the current state, this method SHOULD return successfully without doing anything.</p> <p>Otherwise, this method SHOULD immediately set the hold state to Local_Hold_State_Pending_Hold or Local_Hold_State_Pending_Unhold (as appropriate), emitting <tp:member-ref>HoldStateChanged</tp:member-ref> if this is a change, and return successfully.</p> <p>The eventual success or failure of the request is indicated by a subsequent HoldStateChanged signal, changing the hold state to Local_Hold_State_Held or Local_Hold_State_Unheld.</p> <p>If the channel has multiple streams, and the connection manager succeeds in changing the hold state of one stream but fails to change the hold state of another, it SHOULD attempt to revert all streams to their previous hold states.</p> <p>The following state transitions SHOULD be used, where appropriate:</p> <ul> <li>Successful hold: (Unheld, any reason) → (Pending_Hold, Requested) → (Held, Requested) </li> <li>Successful unhold: (Held, any reason) → (Pending_Unhold, Requested) → (Unheld, Requested) </li> <li>Attempting to unhold fails at the first attempt to acquire a resource: (Held, any reason) → (Pending_Unhold, Requested) → (Held, Resource_Not_Available) </li> <li>Attempting to unhold acquires one resource, but fails to acquire a second, and takes time to release the first: (Held, any reason) → (Pending_Unhold, Requested) → (Pending_Hold, Resource_Not_Available) → (Held, Resource_Not_Available) </li> </ul>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Hold

Used to pass an 'in' argument: A boolean indicating whether or not the channel should be on hold

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_hold_signal_callback_hold_state_changed ()

void
(*tp_cli_channel_interface_hold_signal_callback_hold_state_changed)
                               (TpChannel *proxy,
                                guint arg_HoldState,
                                guint arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal HoldStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_hold_connect_to_hold_state_changed() was called

 

arg_HoldState

The state of the channel (TpLocalHoldState)

 

arg_Reason

The reason for the state change (TpLocalHoldStateReason)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_hold_connect_to_hold_state_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_hold_connect_to_hold_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_hold_signal_callback_hold_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal HoldStateChanged.

Emitted to indicate that the hold state has changed for this channel. This may occur as a consequence of you requesting a change with <tp:member-ref>RequestHold</tp:member-ref>, or the state changing as a result of a request from another process.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_media_signalling_run_get_session_handlers ()

gboolean
tp_cli_channel_interface_media_signalling_run_get_session_handlers
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GPtrArray **out_Session_Handlers,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_media_signalling_run_get_session_handlers is deprecated and should not be used in newly-written code.

Call the method GetSessionHandlers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns all currently active session handlers on this channel as a list of (session_handler_path, type).

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Session_Handlers

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_media_signalling_call_get_session_handlers ()

TpProxyPendingCall *
tp_cli_channel_interface_media_signalling_call_get_session_handlers
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_media_signalling_callback_for_get_session_handlers callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetSessionHandlers method call.

Returns all currently active session handlers on this channel as a list of (session_handler_path, type).

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_media_signalling_callback_for_get_session_handlers ()

void
(*tp_cli_channel_interface_media_signalling_callback_for_get_session_handlers)
                               (TpChannel *proxy,
                                const GPtrArray *out_Session_Handlers,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetSessionHandlers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Session_Handlers

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_media_signalling_connect_to_new_session_handler ()

TpProxySignalConnection *
tp_cli_channel_interface_media_signalling_connect_to_new_session_handler
                               (TpChannel *proxy,
                                tp_cli_channel_interface_media_signalling_signal_callback_new_session_handler callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewSessionHandler.

Signal that a session handler object has been created. The client should create a session object and create streams for the streams within.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_media_signalling_signal_callback_new_session_handler ()

void
(*tp_cli_channel_interface_media_signalling_signal_callback_new_session_handler)
                               (TpChannel *proxy,
                                const gchar *arg_Session_Handler,
                                const gchar *arg_Session_Type,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewSessionHandler.

Parameters

proxy

The proxy on which tp_cli_channel_interface_media_signalling_connect_to_new_session_handler() was called

 

arg_Session_Handler

Object path of the new <tp:dbus-ref namespace="org.freedesktop.Telepathy">Media.SessionHandler</tp:dbus-ref> object

 

arg_Session_Type

String indicating type of session, eg &quot;rtp&quot;

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

channel-group, TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel.html0000644000175000017500000012156714006623344023301 00000000000000 Service-side Channel base interface: telepathy-glib API Reference Manual

Service-side Channel base interface

Service-side Channel base interface — GInterface for Telepathy Channel objects

Signals

void closed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannel
    ╰── TpSvcChannelInterfaceDestroyable

Known Derived Interfaces

TpSvcChannel is required by TpExportableChannel.

Known Implementations

TpSvcChannel is implemented by TpBaseCallChannel, TpBaseChannel, TpBaseMediaCallChannel and TpBasePasswordChannel.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface (auto-generated from the Telepathy spec) makes it easier to export objects implementing the Telepathy Channel.

Functions

tp_svc_channel_close_impl ()

void
(*tp_svc_channel_close_impl) (TpSvcChannel *self,
                              DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Close on interface org.freedesktop.Telepathy.Channel.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_implement_close ()

void
tp_svc_channel_implement_close (TpSvcChannelClass *klass,
                                tp_svc_channel_close_impl impl);

Register an implementation for the Close method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Close D-Bus method

 

tp_svc_channel_return_from_close ()

void
tp_svc_channel_return_from_close (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_get_channel_type_impl ()

void
(*tp_svc_channel_get_channel_type_impl)
                               (TpSvcChannel *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetChannelType on interface org.freedesktop.Telepathy.Channel.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_implement_get_channel_type ()

void
tp_svc_channel_implement_get_channel_type
                               (TpSvcChannelClass *klass,
                                tp_svc_channel_get_channel_type_impl impl);

Register an implementation for the GetChannelType method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetChannelType D-Bus method

 

tp_svc_channel_return_from_get_channel_type ()

void
tp_svc_channel_return_from_get_channel_type
                               (DBusGMethodInvocation *context,
                                const gchar *out_Channel_Type);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Channel_Type

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_get_handle_impl ()

void
(*tp_svc_channel_get_handle_impl) (TpSvcChannel *self,
                                   DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetHandle on interface org.freedesktop.Telepathy.Channel.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_implement_get_handle ()

void
tp_svc_channel_implement_get_handle (TpSvcChannelClass *klass,
                                     tp_svc_channel_get_handle_impl impl);

Register an implementation for the GetHandle method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetHandle D-Bus method

 

tp_svc_channel_return_from_get_handle ()

void
tp_svc_channel_return_from_get_handle (DBusGMethodInvocation *context,
                                       guint out_Target_Handle_Type,
                                       guint out_Target_Handle);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Target_Handle_Type

guint (FIXME, generate documentation)

 

out_Target_Handle

guint (FIXME, generate documentation)

 

tp_svc_channel_get_interfaces_impl ()

void
(*tp_svc_channel_get_interfaces_impl) (TpSvcChannel *self,
                                       DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetInterfaces on interface org.freedesktop.Telepathy.Channel.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_implement_get_interfaces ()

void
tp_svc_channel_implement_get_interfaces
                               (TpSvcChannelClass *klass,
                                tp_svc_channel_get_interfaces_impl impl);

Register an implementation for the GetInterfaces method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetInterfaces D-Bus method

 

tp_svc_channel_return_from_get_interfaces ()

void
tp_svc_channel_return_from_get_interfaces
                               (DBusGMethodInvocation *context,
                                const gchar **out_Interfaces);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Interfaces

const gchar ** (FIXME, generate documentation)

 

tp_svc_channel_emit_closed ()

void
tp_svc_channel_emit_closed (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Closed signal on interface org.freedesktop.Telepathy.Channel.

Parameters

instance

The object implementing this interface

 

tp_svc_channel_interface_destroyable_destroy_impl ()

void
(*tp_svc_channel_interface_destroyable_destroy_impl)
                               (TpSvcChannelInterfaceDestroyable *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Destroy on interface org.freedesktop.Telepathy.Channel.Interface.Destroyable.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_destroyable_implement_destroy ()

void
tp_svc_channel_interface_destroyable_implement_destroy
                               (TpSvcChannelInterfaceDestroyableClass *klass,
                                tp_svc_channel_interface_destroyable_destroy_impl impl);

Register an implementation for the Destroy method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Destroy D-Bus method

 

tp_svc_channel_interface_destroyable_return_from_destroy ()

void
tp_svc_channel_interface_destroyable_return_from_destroy
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

Types and Values

TpSvcChannel

typedef struct _TpSvcChannel TpSvcChannel;

Dummy typedef representing any implementation of this interface.


TpSvcChannelClass

typedef struct _TpSvcChannelClass TpSvcChannelClass;

The class of TpSvcChannel.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (close);
  IMPLEMENT (get_channel_type);
  IMPLEMENT (get_handle);
  IMPLEMENT (get_interfaces);
#undef IMPLEMENT
}

TpSvcChannelInterfaceDestroyable

typedef struct _TpSvcChannelInterfaceDestroyable TpSvcChannelInterfaceDestroyable;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceDestroyableClass

typedef struct _TpSvcChannelInterfaceDestroyableClass TpSvcChannelInterfaceDestroyableClass;

The class of TpSvcChannelInterfaceDestroyable.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_destroyable (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_destroyable_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (destroy);
#undef IMPLEMENT
}

Signal Details

The “closed” signal

void
user_function (TpSvcChannel *self,
               gpointer      user_data)

The Closed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpChannelIface

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-basic-proxy-factory.html0000644000175000017500000002555114006623343025000 00000000000000 TpBasicProxyFactory: telepathy-glib API Reference Manual

TpBasicProxyFactory

TpBasicProxyFactory — channel factory creating TpChannel objects

Types and Values

Object Hierarchy

    GObject
    ╰── TpBasicProxyFactory

Implemented Interfaces

TpBasicProxyFactory implements TpClientChannelFactory.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This factory implements the TpClientChannelFactory interface to create plain TpChannel objects. Unlike TpAutomaticProxyFactory, it will not create higher-level subclasses like TpStreamTubeChannel. The only feature this factory asks to prepare is TP_CHANNEL_FEATURE_CORE.

TpProxy subclasses other than TpChannel are not currently supported.

Functions

tp_basic_proxy_factory_new ()

TpBasicProxyFactory *
tp_basic_proxy_factory_new (void);

tp_basic_proxy_factory_new is deprecated and should not be used in newly-written code.

New code should use TpSimpleClientFactory instead

Convenient function to create a new TpBasicProxyFactory instance.

Returns

a new TpBasicProxyFactory

Since: 0.13.2


tp_basic_proxy_factory_dup ()

TpBasicProxyFactory *
tp_basic_proxy_factory_dup (void);

tp_basic_proxy_factory_dup is deprecated and should not be used in newly-written code.

New code should use TpSimpleClientFactory instead

Returns a cached TpBasicProxyFactory; the same TpBasicProxyFactory object will be returned by this function repeatedly, as long as at least one reference exists.

Returns

a TpBasicProxyFactory.

[transfer full]

Since: 0.13.2

Types and Values

struct TpBasicProxyFactory

struct TpBasicProxyFactory;

Data structure representing a TpBasicProxyFactory

Since: 0.13.2


struct TpBasicProxyFactoryClass

struct TpBasicProxyFactoryClass {
    GObjectClass parent_class;
};

The class of a TpBasicProxyFactory.

Members

GObjectClass parent_class;

the parent class

 

Since: 0.13.2

telepathy-glib-0.24.2/docs/reference/html/TpDebugMessage.html0000644000175000017500000005616714006623343021031 00000000000000 TpDebugMessage: telepathy-glib API Reference Manual

TpDebugMessage

TpDebugMessage — a debug message

Functions

Properties

gchar * category Read
gchar * domain Read
guint level Read
gchar * message Read
GDateTime * time Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpDebugMessage

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpDebugMessage is a small object used to represent a debug message receive from a Telepathy component using TpDebugClient.

See also: TpDebugClient

Functions

tp_debug_client_get_messages_async ()

void
tp_debug_client_get_messages_async (TpDebugClient *self,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Retrieve buffered messages from self . Once callback is called, use tp_debug_client_get_messages_finish() to retrieve the TpDebugMessage objects.

Parameters

self

a TpDebugClient

 

callback

callback to call when the messages have been retrieved

 

user_data

data to pass to callback

 

Since: 0.19.0


tp_debug_client_get_messages_finish ()

GPtrArray *
tp_debug_client_get_messages_finish (TpDebugClient *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes tp_debug_client_set_enabled_async().

Parameters

self

a TpDebugClient

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a GPtrArray of TpDebugMessage, free with g_ptr_array_unref().

[transfer container][type GLib.PtrArray][element-type TelepathyGLib.DebugMessage]

Since: 0.19.0


tp_debug_message_get_domain ()

const gchar *
tp_debug_message_get_domain (TpDebugMessage *self);

Return the “domain” property

Parameters

self

a TpDebugMessage

 

Returns

the value of “domain” property

Since: 0.19.0


tp_debug_message_get_category ()

const gchar *
tp_debug_message_get_category (TpDebugMessage *self);

Return the “category” property

Parameters

self

a TpDebugMessage

 

Returns

the value of “category” property

Since: 0.19.0


tp_debug_message_get_level ()

GLogLevelFlags
tp_debug_message_get_level (TpDebugMessage *self);

Return the “level” property

Parameters

self

a TpDebugMessage

 

Returns

the value of “level” property

Since: 0.19.0


tp_debug_message_get_message ()

const gchar *
tp_debug_message_get_message (TpDebugMessage *self);

Return the “message” property

Parameters

self

a TpDebugMessage

 

Returns

the value of “message” property

Since: 0.19.0


tp_debug_message_get_time ()

GDateTime *
tp_debug_message_get_time (TpDebugMessage *self);

Return the “time” property

Parameters

self

a TpDebugMessage

 

Returns

the value of “time” property.

[transfer none]

Since: 0.19.0

Types and Values

struct TpDebugMessage

struct TpDebugMessage;

Data structure representing a TpDebugMessage.

Since: 0.19.0


struct TpDebugMessageClass

struct TpDebugMessageClass {
};

The class of a TpDebugMessage.

Since: 0.19.0

Property Details

The “category” property

  “category”                 gchar *

Category of the debug message, or NULL if none was specified.

Owner: TpDebugMessage

Flags: Read

Default value: NULL

Since: 0.19.0


The “domain” property

  “domain”                   gchar *

Domain of the debug message.

Owner: TpDebugMessage

Flags: Read

Default value: NULL

Since: 0.19.0


The “level” property

  “level”                    guint

A GLogLevelFlags representing the level of the debug message.

Owner: TpDebugMessage

Flags: Read

Allowed values: <= 4294967292

Default value: 0

Since: 0.19.0


The “message” property

  “message”                  gchar *

Text of the debug message, stripped from its trailing whitespaces.

Owner: TpDebugMessage

Flags: Read

Default value: NULL

Since: 0.19.0


The “time” property

  “time”                     GDateTime *

Timestamp of the debug message.

Owner: TpDebugMessage

Flags: Read

Since: 0.19.0

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-text.html0000644000175000017500000071176414006623344023476 00000000000000 Text channels: telepathy-glib API Reference Manual

Text channels

Text channels — client-side wrappers for the Text channel type, and the Chat State and Password interfaces

Functions

gboolean tp_cli_channel_type_text_run_acknowledge_pending_messages ()
gboolean tp_cli_channel_type_text_run_get_message_types ()
gboolean tp_cli_channel_type_text_run_list_pending_messages ()
gboolean tp_cli_channel_type_text_run_send ()
TpProxyPendingCall * tp_cli_channel_type_text_call_acknowledge_pending_messages ()
TpProxyPendingCall * tp_cli_channel_type_text_call_get_message_types ()
TpProxyPendingCall * tp_cli_channel_type_text_call_list_pending_messages ()
TpProxyPendingCall * tp_cli_channel_type_text_call_send ()
void (*tp_cli_channel_type_text_callback_for_acknowledge_pending_messages) ()
void (*tp_cli_channel_type_text_callback_for_get_message_types) ()
void (*tp_cli_channel_type_text_callback_for_list_pending_messages) ()
void (*tp_cli_channel_type_text_callback_for_send) ()
TpProxySignalConnection * tp_cli_channel_type_text_connect_to_lost_message ()
TpProxySignalConnection * tp_cli_channel_type_text_connect_to_received ()
TpProxySignalConnection * tp_cli_channel_type_text_connect_to_send_error ()
TpProxySignalConnection * tp_cli_channel_type_text_connect_to_sent ()
void (*tp_cli_channel_type_text_signal_callback_lost_message) ()
void (*tp_cli_channel_type_text_signal_callback_received) ()
void (*tp_cli_channel_type_text_signal_callback_send_error) ()
void (*tp_cli_channel_type_text_signal_callback_sent) ()
void (*tp_cli_channel_interface_messages_callback_for_get_pending_message_content) ()
TpProxyPendingCall * tp_cli_channel_interface_messages_call_get_pending_message_content ()
gboolean tp_cli_channel_interface_messages_run_get_pending_message_content ()
void (*tp_cli_channel_interface_messages_callback_for_send_message) ()
TpProxyPendingCall * tp_cli_channel_interface_messages_call_send_message ()
gboolean tp_cli_channel_interface_messages_run_send_message ()
void (*tp_cli_channel_interface_messages_signal_callback_message_received) ()
TpProxySignalConnection * tp_cli_channel_interface_messages_connect_to_message_received ()
void (*tp_cli_channel_interface_messages_signal_callback_message_sent) ()
TpProxySignalConnection * tp_cli_channel_interface_messages_connect_to_message_sent ()
void (*tp_cli_channel_interface_messages_signal_callback_pending_messages_removed) ()
TpProxySignalConnection * tp_cli_channel_interface_messages_connect_to_pending_messages_removed ()
gboolean tp_cli_channel_interface_chat_state_run_set_chat_state ()
TpProxyPendingCall * tp_cli_channel_interface_chat_state_call_set_chat_state ()
void (*tp_cli_channel_interface_chat_state_callback_for_set_chat_state) ()
TpProxySignalConnection * tp_cli_channel_interface_chat_state_connect_to_chat_state_changed ()
void (*tp_cli_channel_interface_chat_state_signal_callback_chat_state_changed) ()
gboolean tp_cli_channel_interface_password_run_get_password_flags ()
gboolean tp_cli_channel_interface_password_run_provide_password ()
TpProxyPendingCall * tp_cli_channel_interface_password_call_get_password_flags ()
TpProxyPendingCall * tp_cli_channel_interface_password_call_provide_password ()
void (*tp_cli_channel_interface_password_callback_for_get_password_flags) ()
void (*tp_cli_channel_interface_password_callback_for_provide_password) ()
TpProxySignalConnection * tp_cli_channel_interface_password_connect_to_password_flags_changed ()
void (*tp_cli_channel_interface_password_signal_callback_password_flags_changed) ()
TpProxySignalConnection * tp_cli_channel_interface_sms_connect_to_sms_channel_changed ()
void (*tp_cli_channel_interface_sms_signal_callback_sms_channel_changed) ()
TpProxyPendingCall * tp_cli_channel_interface_sms_call_get_sms_length ()
void (*tp_cli_channel_interface_sms_callback_for_get_sms_length) ()
gboolean tp_cli_channel_interface_sms_run_get_sms_length ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A major use for instant messaging is obviously to send messages. Channels of type Text represent IM conversations or chat rooms.

This section documents the auto-generated C wrappers for the Text channel type, and also for the Chat State and Password interfaces, which are usually used in conjunction with Text channels.

Functions

tp_cli_channel_type_text_run_acknowledge_pending_messages ()

gboolean
tp_cli_channel_type_text_run_acknowledge_pending_messages
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_IDs,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_text_run_acknowledge_pending_messages is deprecated and should not be used in newly-written code.

Call the method AcknowledgePendingMessages and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Inform the channel that you have handled messages by displaying them to the user (or equivalent), so they can be removed from the pending queue.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_IDs

Used to pass an 'in' argument: The IDs of the messages to acknowledge

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_text_run_get_message_types ()

gboolean
tp_cli_channel_type_text_run_get_message_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Available_Types,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_text_run_get_message_types is deprecated and should not be used in newly-written code.

Consulting MessageTypes is preferred.

Call the method GetMessageTypes and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Return an array indicating which types of message may be sent on this channel.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Available_Types

Used to return an 'out' argument if TRUE is returned: An array of integer message types (ChannelTextMessageType)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_text_run_list_pending_messages ()

gboolean
tp_cli_channel_type_text_run_list_pending_messages
                               (TpChannel *proxy,
                                gint timeout_ms,
                                gboolean in_Clear,
                                GPtrArray **out_Pending_Messages,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_text_run_list_pending_messages is deprecated and should not be used in newly-written code.

Consulting PendingMessages is preferred.

Call the method ListPendingMessages and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

List the messages currently in the pending queue, and optionally remove then all.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Clear

Used to pass an 'in' argument: If true, behave as if <tp:member-ref>AcknowledgePendingMessages</tp:member-ref> had also been called.

 

out_Pending_Messages

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs representing the pending queue. Each contains: <ul> <li>a numeric identifier</li> <li>a Unix timestamp indicating when the message was received</li> <li>the contact handle for the contact who sent the message</li> <li>the message type, taken from ChannelTextMessageType</li> <li>the bitwise-OR of the message flags from ChannelTextMessageFlags</li> <li>the text of the message</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_text_run_send ()

gboolean
tp_cli_channel_type_text_run_send (TpChannel *proxy,
                                   gint timeout_ms,
                                   guint in_Type,
                                   const gchar *in_Text,
                                   GError **error,
                                   GMainLoop **loop);

tp_cli_channel_type_text_run_send is deprecated and should not be used in newly-written code.

The SendMessage method is more flexible.

Call the method Send and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that a message be sent on this channel. When the message has been submitted for delivery, this method will return and the <tp:member-ref>Sent</tp:member-ref> signal will be emitted. If the message cannot be submitted for delivery, the method returns an error and no signal is emitted.</p> <p>This method SHOULD return before the Sent signal is emitted.</p> <tp:rationale> <p>When a Text channel implements the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface">Messages</tp:dbus-ref> interface, that &quot;SHOULD&quot; becomes a &quot;MUST&quot;.</p> </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Type

Used to pass an 'in' argument: An integer indicating the type of the message (TpChannelTextMessageType)

 

in_Text

Used to pass an 'in' argument: The message to send

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_text_call_acknowledge_pending_messages ()

TpProxyPendingCall *
tp_cli_channel_type_text_call_acknowledge_pending_messages
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_IDs,
                                tp_cli_channel_type_text_callback_for_acknowledge_pending_messages callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcknowledgePendingMessages method call.

Inform the channel that you have handled messages by displaying them to the user (or equivalent), so they can be removed from the pending queue.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_IDs

Used to pass an 'in' argument: The IDs of the messages to acknowledge

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_text_call_get_message_types ()

TpProxyPendingCall *
tp_cli_channel_type_text_call_get_message_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_text_callback_for_get_message_types callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_type_text_call_get_message_types is deprecated and should not be used in newly-written code.

Consulting MessageTypes is preferred.

Start a GetMessageTypes method call.

Return an array indicating which types of message may be sent on this channel.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_text_call_list_pending_messages ()

TpProxyPendingCall *
tp_cli_channel_type_text_call_list_pending_messages
                               (TpChannel *proxy,
                                gint timeout_ms,
                                gboolean in_Clear,
                                tp_cli_channel_type_text_callback_for_list_pending_messages callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_type_text_call_list_pending_messages is deprecated and should not be used in newly-written code.

Consulting PendingMessages is preferred.

Start a ListPendingMessages method call.

List the messages currently in the pending queue, and optionally remove then all.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Clear

Used to pass an 'in' argument: If true, behave as if <tp:member-ref>AcknowledgePendingMessages</tp:member-ref> had also been called.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_text_call_send ()

TpProxyPendingCall *
tp_cli_channel_type_text_call_send (TpChannel *proxy,
                                    gint timeout_ms,
                                    guint in_Type,
                                    const gchar *in_Text,
                                    tp_cli_channel_type_text_callback_for_send callback,
                                    gpointer user_data,
                                    GDestroyNotify destroy,
                                    GObject *weak_object);

tp_cli_channel_type_text_call_send is deprecated and should not be used in newly-written code.

The SendMessage method is more flexible.

Start a Send method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that a message be sent on this channel. When the message has been submitted for delivery, this method will return and the <tp:member-ref>Sent</tp:member-ref> signal will be emitted. If the message cannot be submitted for delivery, the method returns an error and no signal is emitted.</p> <p>This method SHOULD return before the Sent signal is emitted.</p> <tp:rationale> <p>When a Text channel implements the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface">Messages</tp:dbus-ref> interface, that &quot;SHOULD&quot; becomes a &quot;MUST&quot;.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Type

Used to pass an 'in' argument: An integer indicating the type of the message (TpChannelTextMessageType)

 

in_Text

Used to pass an 'in' argument: The message to send

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_text_callback_for_acknowledge_pending_messages ()

void
(*tp_cli_channel_type_text_callback_for_acknowledge_pending_messages)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcknowledgePendingMessages method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_text_callback_for_get_message_types ()

void
(*tp_cli_channel_type_text_callback_for_get_message_types)
                               (TpChannel *proxy,
                                const GArray *out_Available_Types,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_type_text_callback_for_get_message_types is deprecated and should not be used in newly-written code.

Consulting MessageTypes is preferred.

Signature of the callback called when a GetMessageTypes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Available_Types

Used to return an 'out' argument if error is NULL: An array of integer message types (ChannelTextMessageType)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_text_callback_for_list_pending_messages ()

void
(*tp_cli_channel_type_text_callback_for_list_pending_messages)
                               (TpChannel *proxy,
                                const GPtrArray *out_Pending_Messages,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_type_text_callback_for_list_pending_messages is deprecated and should not be used in newly-written code.

Consulting PendingMessages is preferred.

Signature of the callback called when a ListPendingMessages method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Pending_Messages

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of structs representing the pending queue. Each contains: <ul> <li>a numeric identifier</li> <li>a Unix timestamp indicating when the message was received</li> <li>the contact handle for the contact who sent the message</li> <li>the message type, taken from ChannelTextMessageType</li> <li>the bitwise-OR of the message flags from ChannelTextMessageFlags</li> <li>the text of the message</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_text_callback_for_send ()

void
(*tp_cli_channel_type_text_callback_for_send)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_type_text_callback_for_send is deprecated and should not be used in newly-written code.

The SendMessage method is more flexible.

Signature of the callback called when a Send method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_text_connect_to_lost_message ()

TpProxySignalConnection *
tp_cli_channel_type_text_connect_to_lost_message
                               (TpChannel *proxy,
                                tp_cli_channel_type_text_signal_callback_lost_message callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LostMessage.

This signal is emitted to indicate that an incoming message was not able to be stored and forwarded by the connection manager due to lack of memory.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_text_connect_to_received ()

TpProxySignalConnection *
tp_cli_channel_type_text_connect_to_received
                               (TpChannel *proxy,
                                tp_cli_channel_type_text_signal_callback_received callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Received.

Signals that a message with the given id, timestamp, sender, type and text has been received on this channel. Applications that catch this signal and reliably inform the user of the message should acknowledge that they have dealt with the message with the <tp:member-ref>AcknowledgePendingMessages</tp:member-ref> method.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_text_connect_to_send_error ()

TpProxySignalConnection *
tp_cli_channel_type_text_connect_to_send_error
                               (TpChannel *proxy,
                                tp_cli_channel_type_text_signal_callback_send_error callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SendError.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Signals that an outgoing message has failed to send. The error will be one of the values from ChannelTextSendError.</p> <p>This signal should only be emitted for messages for which <tp:member-ref>Sent</tp:member-ref> has already been emitted and <tp:member-ref>Send</tp:member-ref> has already returned success.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_text_connect_to_sent ()

TpProxySignalConnection *
tp_cli_channel_type_text_connect_to_sent
                               (TpChannel *proxy,
                                tp_cli_channel_type_text_signal_callback_sent callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Sent.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Signals that a message has been submitted for sending.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_text_signal_callback_lost_message ()

void
(*tp_cli_channel_type_text_signal_callback_lost_message)
                               (TpChannel *proxy,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LostMessage.

Parameters

proxy

The proxy on which tp_cli_channel_type_text_connect_to_lost_message() was called

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_text_signal_callback_received ()

void
(*tp_cli_channel_type_text_signal_callback_received)
                               (TpChannel *proxy,
                                guint arg_ID,
                                guint arg_Timestamp,
                                guint arg_Sender,
                                guint arg_Type,
                                guint arg_Flags,
                                const gchar *arg_Text,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Received.

Parameters

proxy

The proxy on which tp_cli_channel_type_text_connect_to_received() was called

 

arg_ID

A numeric identifier for acknowledging the message

 

arg_Timestamp

A Unix timestamp indicating when the message was received (TpUnixTimestamp)

 

arg_Sender

The handle of the contact who sent the message (TpContactHandle)

 

arg_Type

The type of the message (normal, action, notice, etc.) (TpChannelTextMessageType)

 

arg_Flags

A bitwise OR of the message flags (TpChannelTextMessageFlags)

 

arg_Text

The text of the message

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_text_signal_callback_send_error ()

void
(*tp_cli_channel_type_text_signal_callback_send_error)
                               (TpChannel *proxy,
                                guint arg_Error,
                                guint arg_Timestamp,
                                guint arg_Type,
                                const gchar *arg_Text,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SendError.

Parameters

proxy

The proxy on which tp_cli_channel_type_text_connect_to_send_error() was called

 

arg_Error

The error that occurred (TpChannelTextSendError)

 

arg_Timestamp

The Unix timestamp indicating when the message was sent (TpUnixTimestamp)

 

arg_Type

The message type (TpChannelTextMessageType)

 

arg_Text

The text of the message

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_text_signal_callback_sent ()

void
(*tp_cli_channel_type_text_signal_callback_sent)
                               (TpChannel *proxy,
                                guint arg_Timestamp,
                                guint arg_Type,
                                const gchar *arg_Text,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Sent.

Parameters

proxy

The proxy on which tp_cli_channel_type_text_connect_to_sent() was called

 

arg_Timestamp

Unix timestamp indicating when the message was sent (TpUnixTimestamp)

 

arg_Type

The message type (normal, action, notice, etc) from ChannelTextMessageType (TpChannelTextMessageType)

 

arg_Text

The text of the message. If the message was, or will be, altered during transmission, this argument SHOULD reflect what other contacts will receive rather than being a copy of the argument to <tp:member-ref>Send</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_messages_callback_for_get_pending_message_content ()

void
(*tp_cli_channel_interface_messages_callback_for_get_pending_message_content)
                               (TpChannel *proxy,
                                GHashTable *out_Content,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_messages_callback_for_get_pending_message_content is deprecated and should not be used in newly-written code.

This method has never been implemented, and in any case would have been impossible to use correctly when multiple clients (such as a logger and the handler) are interested in a text channel. See freedesktop.org bug 26417 for more details.

Signature of the callback called when a GetPendingMessageContent method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Content

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The content of the requested parts. The keys in this mapping are positions in the array of message parts; the values are either of type 's' or 'ay' (UTF-8 text string, or byte array), following the same rules as for the value of the 'content' key in the <tp:type>Message_Part</tp:type> mappings.</p> <p>If the one of the requested part numbers was greater than zero but referred to a part that had no content (i.e. it had no 'content-type' key or no 'content' key), it is simply omitted from this mapping; this is not considered to be an error condition.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_messages_call_get_pending_message_content ()

TpProxyPendingCall *
tp_cli_channel_interface_messages_call_get_pending_message_content
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Message_ID,
                                const GArray *in_Parts,
                                tp_cli_channel_interface_messages_callback_for_get_pending_message_content callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_messages_call_get_pending_message_content is deprecated and should not be used in newly-written code.

This method has never been implemented, and in any case would have been impossible to use correctly when multiple clients (such as a logger and the handler) are interested in a text channel. See freedesktop.org bug 26417 for more details.

Start a GetPendingMessageContent method call.

Retrieve the content of one or more parts of a pending message. Note that this function may take a considerable amount of time to return if the part's 'needs-retrieval' flag is true; consider extending the default D-Bus method call timeout. Additional API is likely to be added in future, to stream large message parts.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Message_ID

Used to pass an 'in' argument: The ID of a pending message (TpMessageID)

 

in_Parts

Used to pass an 'in' argument: The desired entries in the array of message parts, identified by their position. The &quot;headers&quot; part (which is not a valid argument to this method) is considered to be part 0, so the valid part numbers start at 1 (for the second Message_Part).

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_messages_run_get_pending_message_content ()

gboolean
tp_cli_channel_interface_messages_run_get_pending_message_content
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Message_ID,
                                const GArray *in_Parts,
                                GHashTable **out_Content,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_messages_run_get_pending_message_content is deprecated and should not be used in newly-written code.

This method has never been implemented, and in any case would have been impossible to use correctly when multiple clients (such as a logger and the handler) are interested in a text channel. See freedesktop.org bug 26417 for more details.

Call the method GetPendingMessageContent and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Retrieve the content of one or more parts of a pending message. Note that this function may take a considerable amount of time to return if the part's 'needs-retrieval' flag is true; consider extending the default D-Bus method call timeout. Additional API is likely to be added in future, to stream large message parts.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Message_ID

Used to pass an 'in' argument: The ID of a pending message (TpMessageID)

 

in_Parts

Used to pass an 'in' argument: The desired entries in the array of message parts, identified by their position. The &quot;headers&quot; part (which is not a valid argument to this method) is considered to be part 0, so the valid part numbers start at 1 (for the second Message_Part).

 

out_Content

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The content of the requested parts. The keys in this mapping are positions in the array of message parts; the values are either of type 's' or 'ay' (UTF-8 text string, or byte array), following the same rules as for the value of the 'content' key in the <tp:type>Message_Part</tp:type> mappings.</p> <p>If the one of the requested part numbers was greater than zero but referred to a part that had no content (i.e. it had no 'content-type' key or no 'content' key), it is simply omitted from this mapping; this is not considered to be an error condition.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_messages_callback_for_send_message ()

void
(*tp_cli_channel_interface_messages_callback_for_send_message)
                               (TpChannel *proxy,
                                const gchar *out_Token,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SendMessage method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Token

Used to return an 'out' argument if error is NULL: An opaque token used to match any incoming delivery or failure reports against this message, or an empty string if the message is not readily identifiable.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_messages_call_send_message ()

TpProxyPendingCall *
tp_cli_channel_interface_messages_call_send_message
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Message,
                                guint in_Flags,
                                tp_cli_channel_interface_messages_callback_for_send_message callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SendMessage method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Submit a message to the server for sending. If this method returns successfully, the message has been submitted to the server and the <tp:member-ref>MessageSent</tp:member-ref> signal is emitted. A corresponding <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">Sent</tp:dbus-ref> signal on the Text interface MUST also be emitted.</p> <p>This method MUST return before the MessageSent signal is emitted.</p> <tp:rationale> <p>This means that the process sending the message is the first to see the <tp:type>Protocol_Message_Token</tp:type>, and can relate the message to the corresponding <tp:member-ref>MessageSent</tp:member-ref> signal by comparing message tokens (if supported by the protocol).</p> </tp:rationale> <p>If this method fails, message submission to the server has failed and no signal on this interface (or the Text interface) is emitted.</p> <p>If this method succeeds, message submission to the server has succeeded, but the message has not necessarily reached its intended recipient. If a delivery failure is detected later, this is signalled by receiving a message whose <code>message-type</code> header maps to <tp:value-ref type="Channel_Text_Message_Type">Delivery_Report</tp:value-ref>. Similarly, if delivery is detected to have been successful (which is not possible in all protocols), a successful delivery report will be signalled.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Message

Used to pass an 'in' argument: The message content, including any attachments or alternatives. This MUST NOT include the following headers, or any others that do not make sense for a client to specify: <code>message-sender</code>, <code>message-sender-id</code>, <code>message-sent</code>, <code>message-received</code>, <code>pending-message-id</code>.

 

in_Flags

Used to pass an 'in' argument: Flags affecting how the message is sent. The channel MAY ignore some or all flags, depending on <tp:member-ref>DeliveryReportingSupport</tp:member-ref>; the flags that were handled by the CM are provided in <tp:member-ref>MessageSent</tp:member-ref>. (TpMessageSendingFlags)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_messages_run_send_message ()

gboolean
tp_cli_channel_interface_messages_run_send_message
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Message,
                                guint in_Flags,
                                gchar **out_Token,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_messages_run_send_message is deprecated and should not be used in newly-written code.

Call the method SendMessage and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Submit a message to the server for sending. If this method returns successfully, the message has been submitted to the server and the <tp:member-ref>MessageSent</tp:member-ref> signal is emitted. A corresponding <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">Sent</tp:dbus-ref> signal on the Text interface MUST also be emitted.</p> <p>This method MUST return before the MessageSent signal is emitted.</p> <tp:rationale> <p>This means that the process sending the message is the first to see the <tp:type>Protocol_Message_Token</tp:type>, and can relate the message to the corresponding <tp:member-ref>MessageSent</tp:member-ref> signal by comparing message tokens (if supported by the protocol).</p> </tp:rationale> <p>If this method fails, message submission to the server has failed and no signal on this interface (or the Text interface) is emitted.</p> <p>If this method succeeds, message submission to the server has succeeded, but the message has not necessarily reached its intended recipient. If a delivery failure is detected later, this is signalled by receiving a message whose <code>message-type</code> header maps to <tp:value-ref type="Channel_Text_Message_Type">Delivery_Report</tp:value-ref>. Similarly, if delivery is detected to have been successful (which is not possible in all protocols), a successful delivery report will be signalled.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Message

Used to pass an 'in' argument: The message content, including any attachments or alternatives. This MUST NOT include the following headers, or any others that do not make sense for a client to specify: <code>message-sender</code>, <code>message-sender-id</code>, <code>message-sent</code>, <code>message-received</code>, <code>pending-message-id</code>.

 

in_Flags

Used to pass an 'in' argument: Flags affecting how the message is sent. The channel MAY ignore some or all flags, depending on <tp:member-ref>DeliveryReportingSupport</tp:member-ref>; the flags that were handled by the CM are provided in <tp:member-ref>MessageSent</tp:member-ref>. (TpMessageSendingFlags)

 

out_Token

Used to return an 'out' argument if TRUE is returned: An opaque token used to match any incoming delivery or failure reports against this message, or an empty string if the message is not readily identifiable.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_messages_signal_callback_message_received ()

void
(*tp_cli_channel_interface_messages_signal_callback_message_received)
                               (TpChannel *proxy,
                                const GPtrArray *arg_Message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MessageReceived.

Parameters

proxy

The proxy on which tp_cli_channel_interface_messages_connect_to_message_received() was called

 

arg_Message

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The message content, including any attachments or alternatives. If the incoming message contains formatted text without a plain text alternative, the connection manager MUST generate a <tt>text/plain</tt> alternative from the formatted text, and include it in this message (both here, and in the <tp:member-ref>PendingMessages</tp:member-ref> property).</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_messages_connect_to_message_received ()

TpProxySignalConnection *
tp_cli_channel_interface_messages_connect_to_message_received
                               (TpChannel *proxy,
                                tp_cli_channel_interface_messages_signal_callback_message_received callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MessageReceived.

Signals that a message has been received and added to the pending messages queue. This MUST be emitted exactly once per emission of the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">Received</tp:dbus-ref> signal on the Text interface, for backwards-compatibility; clients SHOULD ignore the latter in favour of this signal if this interface is present, as mentioned in the introduction.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_messages_signal_callback_message_sent ()

void
(*tp_cli_channel_interface_messages_signal_callback_message_sent)
                               (TpChannel *proxy,
                                const GPtrArray *arg_Content,
                                guint arg_Flags,
                                const gchar *arg_Message_Token,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MessageSent.

Parameters

proxy

The proxy on which tp_cli_channel_interface_messages_connect_to_message_sent() was called

 

arg_Content

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The message content (see <tp:type>Message_Part</tp:type> for full details). If the message that was passed to <tp:member-ref>SendMessage</tp:member-ref> has a formatted text part that the connection manager recognises, but no <tt>text/plain</tt> alternative, the CM MUST use the formatted text part to generate a <tt>text/plain</tt> alternative which is also included in this signal argument.</p> <p>The connection manager SHOULD include the <code>message-sender</code>, <code>message-sender-id</code> and <code>message-sent</code> headers in the representation of the message that is signalled here. If the channel has channel-specific handles, the <code>message-sender</code> and <code>message-sender-id</code> SHOULD reflect the sender that other contacts will see.</p> <p>If the connection manager can predict that the message will be altered during transmission, this argument SHOULD reflect what other contacts will receive, rather than being a copy of the argument to SendMessage (if the message is truncated, formatting or alternatives are dropped, etc., then the edited version SHOULD appear in this signal).</p>

 

arg_Flags

<p>Flags affecting how the message was sent. The flags might be a subset of those passed to SendMessage if the caller requested unsupported flags.</p> (TpMessageSendingFlags)

 

arg_Message_Token

An opaque token used to match any incoming delivery or failure reports against this message, or an empty string if the message is not readily identifiable.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_messages_connect_to_message_sent ()

TpProxySignalConnection *
tp_cli_channel_interface_messages_connect_to_message_sent
                               (TpChannel *proxy,
                                tp_cli_channel_interface_messages_signal_callback_message_sent callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MessageSent.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Signals that a message has been submitted for sending. This MUST be emitted exactly once per emission of the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type.Text">Sent</tp:dbus-ref> signal on the Text interface, for backwards-compatibility; clients SHOULD ignore the latter if this interface is present, as mentioned in the introduction.</p> <p>This SHOULD be emitted as soon as the CM determines it's theoretically possible to send the message (e.g. the parameters are supported and correct).</p> <tp:rationale> <p>This signal allows a process that is not the caller of SendMessage to log sent messages.</p> </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_messages_signal_callback_pending_messages_removed ()

void
(*tp_cli_channel_interface_messages_signal_callback_pending_messages_removed)
                               (TpChannel *proxy,
                                const GArray *arg_Message_IDs,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PendingMessagesRemoved.

Parameters

proxy

The proxy on which tp_cli_channel_interface_messages_connect_to_pending_messages_removed() was called

 

arg_Message_IDs

The messages that have been removed from the pending message list.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_messages_connect_to_pending_messages_removed ()

TpProxySignalConnection *
tp_cli_channel_interface_messages_connect_to_pending_messages_removed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_messages_signal_callback_pending_messages_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PendingMessagesRemoved.

The messages with the given IDs have been removed from the <tp:member-ref>PendingMessages</tp:member-ref> list. Clients SHOULD NOT attempt to acknowledge those messages. <tp:rationale> This completes change notification for the PendingMessages property (previously, there was change notification when pending messages were added, but not when they were removed). </tp:rationale>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_chat_state_run_set_chat_state ()

gboolean
tp_cli_channel_interface_chat_state_run_set_chat_state
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_State,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_chat_state_run_set_chat_state is deprecated and should not be used in newly-written code.

Call the method SetChatState and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Set the local state and notify other members of the channel that it has changed.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_State

Used to pass an 'in' argument: The new state. (TpChannelChatState)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_chat_state_call_set_chat_state ()

TpProxyPendingCall *
tp_cli_channel_interface_chat_state_call_set_chat_state
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_State,
                                tp_cli_channel_interface_chat_state_callback_for_set_chat_state callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetChatState method call.

Set the local state and notify other members of the channel that it has changed.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_State

Used to pass an 'in' argument: The new state. (TpChannelChatState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_chat_state_callback_for_set_chat_state ()

void
(*tp_cli_channel_interface_chat_state_callback_for_set_chat_state)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetChatState method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_chat_state_connect_to_chat_state_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_chat_state_connect_to_chat_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_chat_state_signal_callback_chat_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ChatStateChanged.

Emitted when the state of a member of the channel has changed. This includes local state.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_chat_state_signal_callback_chat_state_changed ()

void
(*tp_cli_channel_interface_chat_state_signal_callback_chat_state_changed)
                               (TpChannel *proxy,
                                guint arg_Contact,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ChatStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_chat_state_connect_to_chat_state_changed() was called

 

arg_Contact

An integer handle for the contact. (TpContactHandle)

 

arg_State

The new state of this contact. (TpChannelChatState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_password_run_get_password_flags ()

gboolean
tp_cli_channel_interface_password_run_get_password_flags
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint *out_Password_Flags,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_password_run_get_password_flags is deprecated and should not be used in newly-written code.

Call the method GetPasswordFlags and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the bitwise-OR of the flags relevant to the password on this channel. The user interface can use this to present information about which operations are currently valid.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Password_Flags

Used to return an 'out' argument if TRUE is returned: An integer with the logical OR of all the flags set (values of ChannelPasswordFlags)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_password_run_provide_password ()

gboolean
tp_cli_channel_interface_password_run_provide_password
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Password,
                                gboolean *out_Correct,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_password_run_provide_password is deprecated and should not be used in newly-written code.

Call the method ProvidePassword and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Provide the password so that the channel can be joined. Must be called with the correct password in order for channel joining to proceed if the 'provide' password flag is set.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Password

Used to pass an 'in' argument: The password

 

out_Correct

Used to return an 'out' argument if TRUE is returned: A boolean indicating whether or not the password was correct

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_password_call_get_password_flags ()

TpProxyPendingCall *
tp_cli_channel_interface_password_call_get_password_flags
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_password_callback_for_get_password_flags callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetPasswordFlags method call.

Returns the bitwise-OR of the flags relevant to the password on this channel. The user interface can use this to present information about which operations are currently valid.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_password_call_provide_password ()

TpProxyPendingCall *
tp_cli_channel_interface_password_call_provide_password
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Password,
                                tp_cli_channel_interface_password_callback_for_provide_password callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ProvidePassword method call.

Provide the password so that the channel can be joined. Must be called with the correct password in order for channel joining to proceed if the 'provide' password flag is set.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Password

Used to pass an 'in' argument: The password

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_password_callback_for_get_password_flags ()

void
(*tp_cli_channel_interface_password_callback_for_get_password_flags)
                               (TpChannel *proxy,
                                guint out_Password_Flags,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetPasswordFlags method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Password_Flags

Used to return an 'out' argument if error is NULL: An integer with the logical OR of all the flags set (values of ChannelPasswordFlags) (TpChannelPasswordFlags)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_password_callback_for_provide_password ()

void
(*tp_cli_channel_interface_password_callback_for_provide_password)
                               (TpChannel *proxy,
                                gboolean out_Correct,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ProvidePassword method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Correct

Used to return an 'out' argument if error is NULL: A boolean indicating whether or not the password was correct

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_password_connect_to_password_flags_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_password_connect_to_password_flags_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_password_signal_callback_password_flags_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PasswordFlagsChanged.

Emitted when the flags as returned by <tp:member-ref>GetPasswordFlags</tp:member-ref> are changed. The user interface should be updated as appropriate.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_password_signal_callback_password_flags_changed ()

void
(*tp_cli_channel_interface_password_signal_callback_password_flags_changed)
                               (TpChannel *proxy,
                                guint arg_Added,
                                guint arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PasswordFlagsChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_password_connect_to_password_flags_changed() was called

 

arg_Added

A bitwise OR of the flags which have been set (TpChannelPasswordFlags)

 

arg_Removed

A bitwise OR of the flags which have been cleared (TpChannelPasswordFlags)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_sms_connect_to_sms_channel_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_sms_connect_to_sms_channel_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_sms_signal_callback_sms_channel_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SMSChannelChanged.

This signal indicates a change in the <tp:member-ref>SMSChannel</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_sms_signal_callback_sms_channel_changed ()

void
(*tp_cli_channel_interface_sms_signal_callback_sms_channel_changed)
                               (TpChannel *proxy,
                                gboolean arg_SMSChannel,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SMSChannelChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_sms_connect_to_sms_channel_changed() was called

 

arg_SMSChannel

The new value for <tp:member-ref>SMSChannel</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_sms_call_get_sms_length ()

TpProxyPendingCall *
tp_cli_channel_interface_sms_call_get_sms_length
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Message,
                                tp_cli_channel_interface_sms_callback_for_get_sms_length callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetSMSLength method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Returns the number of 140 octet chunks required to send a message via SMS, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost.</p> <tp:rationale> <p>There are a number of different SMS encoding mechanisms, and the client doesn't know which mechanisms an individual CM might support. This method allows the client, without any knowledge of the encoding mechanism, to provide length details to the user.</p> </tp:rationale> <p>Clients SHOULD limit the frequency with which this method is called and SHOULD NOT call it for every keystroke. Clients MAY estimate the remaining size between single keystrokes.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Message

Used to pass an 'in' argument: The message the user wishes to send.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sms_callback_for_get_sms_length ()

void
(*tp_cli_channel_interface_sms_callback_for_get_sms_length)
                               (TpChannel *proxy,
                                guint out_Chunks_Required,
                                gint out_Remaining_Characters,
                                gint out_Estimated_Cost,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetSMSLength method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Chunks_Required

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The number of 140 octet chunks required to send this message.</p> <p>For example, in the GSM standard 7-bit encoding, a 162 character message would require 2 chunks.</p>

 

out_Remaining_Characters

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by <code>abs(Remaining_Characters)</code>. The value <code>MIN_INT32</code> (<code>-2<sup>31</sup></code>) indicates the message will be truncated by an unknown amount.</p> <p>For example, in the GSM standard 7-bit encoding, a 162 character message would return 144 remaining characters (because of the space required for the multipart SMS header).</p>

 

out_Estimated_Cost

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The estimated cost of sending this message. The currency and scale of this value are the same as the <tp:dbus-ref namespace="ofdT.Connection.Interface">Balance.AccountBalance</tp:dbus-ref> property.</p> <p>A value of <code>-1</code> indicates the cost could not be estimated.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sms_run_get_sms_length ()

gboolean
tp_cli_channel_interface_sms_run_get_sms_length
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Message,
                                guint *out_Chunks_Required,
                                gint *out_Remaining_Characters,
                                gint *out_Estimated_Cost,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_sms_run_get_sms_length is deprecated and should not be used in newly-written code.

Call the method GetSMSLength and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Returns the number of 140 octet chunks required to send a message via SMS, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost.</p> <tp:rationale> <p>There are a number of different SMS encoding mechanisms, and the client doesn't know which mechanisms an individual CM might support. This method allows the client, without any knowledge of the encoding mechanism, to provide length details to the user.</p> </tp:rationale> <p>Clients SHOULD limit the frequency with which this method is called and SHOULD NOT call it for every keystroke. Clients MAY estimate the remaining size between single keystrokes.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Message

Used to pass an 'in' argument: The message the user wishes to send.

 

out_Chunks_Required

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The number of 140 octet chunks required to send this message.</p> <p>For example, in the GSM standard 7-bit encoding, a 162 character message would require 2 chunks.</p>

 

out_Remaining_Characters

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by <code>abs(Remaining_Characters)</code>. The value <code>MIN_INT32</code> (<code>-2<sup>31</sup></code>) indicates the message will be truncated by an unknown amount.</p> <p>For example, in the GSM standard 7-bit encoding, a 162 character message would return 144 remaining characters (because of the space required for the multipart SMS header).</p>

 

out_Estimated_Cost

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The estimated cost of sending this message. The currency and scale of this value are the same as the <tp:dbus-ref namespace="ofdT.Connection.Interface">Balance.AccountBalance</tp:dbus-ref> property.</p> <p>A value of <code>-1</code> indicates the cost could not be estimated.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error

See Also

channel-group, TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-debug-ansi.html0000644000175000017500000003254614006623344023114 00000000000000 ANSI codes for debug messages: telepathy-glib API Reference Manual

ANSI codes for debug messages

ANSI codes for debug messages — used to colorize log messages for "clarity"

Includes

#include <telepathy-glib/debug-ansi.h>

Description

This header provides some ANSI escapes you can use to make debug messages more colourful. Please use sparingly.

Functions

Types and Values

TP_ANSI_RESET

#define TP_ANSI_RESET      "\x1b[0m"

TP_ANSI_RESET has been deprecated since version 0.13.3 and should not be used in newly-written code.

Reset all attributes.


TP_ANSI_BOLD_ON

#define TP_ANSI_BOLD_ON    "\x1b[1m"

TP_ANSI_BOLD_ON has been deprecated since version 0.13.3 and should not be used in newly-written code.

Set the bold attribute.


TP_ANSI_INVERSE_ON

#define TP_ANSI_INVERSE_ON "\x1b[7m"

TP_ANSI_INVERSE_ON has been deprecated since version 0.13.3 and should not be used in newly-written code.

Set the inverse video attribute.


TP_ANSI_BOLD_OFF

#define TP_ANSI_BOLD_OFF   "\x1b[22m"

TP_ANSI_BOLD_OFF has been deprecated since version 0.13.3 and should not be used in newly-written code.

Clear the bold attribute.


TP_ANSI_FG_BLACK

#define TP_ANSI_FG_BLACK   "\x1b[30m"

TP_ANSI_FG_BLACK has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_RED

#define TP_ANSI_FG_RED     "\x1b[31m"

TP_ANSI_FG_RED has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_GREEN

#define TP_ANSI_FG_GREEN   "\x1b[32m"

TP_ANSI_FG_GREEN has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_YELLOW

#define TP_ANSI_FG_YELLOW  "\x1b[33m"

TP_ANSI_FG_YELLOW has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_BLUE

#define TP_ANSI_FG_BLUE    "\x1b[34m"

TP_ANSI_FG_BLUE has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_MAGENTA

#define TP_ANSI_FG_MAGENTA "\x1b[35m"

TP_ANSI_FG_MAGENTA has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_CYAN

#define TP_ANSI_FG_CYAN    "\x1b[36m"

TP_ANSI_FG_CYAN has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_FG_WHITE

#define TP_ANSI_FG_WHITE   "\x1b[37m"

TP_ANSI_FG_WHITE has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_RED

#define TP_ANSI_BG_RED     "\x1b[41m"

TP_ANSI_BG_RED has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_GREEN

#define TP_ANSI_BG_GREEN   "\x1b[42m"

TP_ANSI_BG_GREEN has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_YELLOW

#define TP_ANSI_BG_YELLOW  "\x1b[43m"

TP_ANSI_BG_YELLOW has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_BLUE

#define TP_ANSI_BG_BLUE    "\x1b[44m"

TP_ANSI_BG_BLUE has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_MAGENTA

#define TP_ANSI_BG_MAGENTA "\x1b[45m"

TP_ANSI_BG_MAGENTA has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_CYAN

#define TP_ANSI_BG_CYAN    "\x1b[46m"

TP_ANSI_BG_CYAN has been deprecated since version 0.13.3 and should not be used in newly-written code.


TP_ANSI_BG_WHITE

#define TP_ANSI_BG_WHITE   "\x1b[47m"

TP_ANSI_BG_WHITE has been deprecated since version 0.13.3 and should not be used in newly-written code.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-contactsearch.html0000644000175000017500000016244214006623344025324 00000000000000 Contact Search channels: telepathy-glib API Reference Manual

Contact Search channels

Contact Search channels — client-side wrappers for the Contact Search channel type

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some instant messaging protocols allow searching for contacts by name or other details. In Telepathy, each search attempt is represented as a Channel.

This section documents the auto-generated C wrappers for the Contact Search channel type.

Functions

tp_cli_channel_type_contact_search_call_more ()

TpProxyPendingCall *
tp_cli_channel_type_contact_search_call_more
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_contact_search_callback_for_more callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a More method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Request that a search in <tp:member-ref>SearchState</tp:member-ref> <code>More_Available</code> move back to state <code>In_Progress</code> and continue listing up to <tp:member-ref>Limit</tp:member-ref> more results.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_contact_search_call_search ()

TpProxyPendingCall *
tp_cli_channel_type_contact_search_call_search
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_Terms,
                                tp_cli_channel_type_contact_search_callback_for_search callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Search method call.

Send a request to start a search for contacts on this connection. This may only be called while the <tp:member-ref>SearchState</tp:member-ref> is Not_Started; a valid search request will cause the <tp:member-ref>SearchStateChanged</tp:member-ref> signal to be emitted with the state In_Progress.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Terms

Used to pass an 'in' argument: A dictionary mapping search key names to the desired values

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_contact_search_call_stop ()

TpProxyPendingCall *
tp_cli_channel_type_contact_search_call_stop
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_contact_search_callback_for_stop callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Stop method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Stop the current search. This may not be called while the <tp:member-ref>SearchState</tp:member-ref> is Not_Started. If called while the SearchState is In_Progress, <tp:member-ref>SearchStateChanged</tp:member-ref> will be emitted, with the state Failed and the error <code>org.freedesktop.Telepathy.Error.<tp:error-ref>Cancelled</tp:error-ref></code>.</p> <p>Calling this method on a search in state Completed or Failed succeeds, but has no effect.</p> <tp:rationale> <p>Specifying Stop to succeed when the search has finished means that clients who call Stop just before receiving <tp:member-ref>SearchStateChanged</tp:member-ref> don't have to handle a useless error.</p> </tp:rationale> <p>Depending on the protocol, the connection manager may not be able to prevent the server from sending further results after this method returns; if this is the case, it MUST ignore any further results.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_contact_search_callback_for_more ()

void
(*tp_cli_channel_type_contact_search_callback_for_more)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a More method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_contact_search_callback_for_search ()

void
(*tp_cli_channel_type_contact_search_callback_for_search)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Search method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_contact_search_callback_for_stop ()

void
(*tp_cli_channel_type_contact_search_callback_for_stop)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Stop method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_contact_search_connect_to_search_result_received ()

TpProxySignalConnection *
tp_cli_channel_type_contact_search_connect_to_search_result_received
                               (TpChannel *proxy,
                                tp_cli_channel_type_contact_search_signal_callback_search_result_received callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SearchResultReceived.

Emitted when a some search results are received from the server. This signal can be fired arbitrarily many times so clients MUST NOT assume they'll get only one signal.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_contact_search_connect_to_search_state_changed ()

TpProxySignalConnection *
tp_cli_channel_type_contact_search_connect_to_search_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_contact_search_signal_callback_search_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SearchStateChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the <tp:member-ref>SearchState</tp:member-ref> property changes. The implementation MUST NOT make transitions other than the following:</p> <ul> <li><code>Not_Started</code> → <code>In_Progress</code></li> <li><code>In_Progress</code> → <code>More_Available</code></li> <li><code>More_Available</code> → <code>In_Progress</code></li> <li><code>In_Progress</code> → <code>Completed</code></li> <li><code>In_Progress</code> → <code>Failed</code></li> </ul>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_contact_search_run_more ()

gboolean
tp_cli_channel_type_contact_search_run_more
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_contact_search_run_more is deprecated and should not be used in newly-written code.

Call the method More and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Request that a search in <tp:member-ref>SearchState</tp:member-ref> <code>More_Available</code> move back to state <code>In_Progress</code> and continue listing up to <tp:member-ref>Limit</tp:member-ref> more results.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_contact_search_run_search ()

gboolean
tp_cli_channel_type_contact_search_run_search
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_Terms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_contact_search_run_search is deprecated and should not be used in newly-written code.

Call the method Search and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Send a request to start a search for contacts on this connection. This may only be called while the <tp:member-ref>SearchState</tp:member-ref> is Not_Started; a valid search request will cause the <tp:member-ref>SearchStateChanged</tp:member-ref> signal to be emitted with the state In_Progress.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Terms

Used to pass an 'in' argument: A dictionary mapping search key names to the desired values

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_contact_search_run_stop ()

gboolean
tp_cli_channel_type_contact_search_run_stop
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_contact_search_run_stop is deprecated and should not be used in newly-written code.

Call the method Stop and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Stop the current search. This may not be called while the <tp:member-ref>SearchState</tp:member-ref> is Not_Started. If called while the SearchState is In_Progress, <tp:member-ref>SearchStateChanged</tp:member-ref> will be emitted, with the state Failed and the error <code>org.freedesktop.Telepathy.Error.<tp:error-ref>Cancelled</tp:error-ref></code>.</p> <p>Calling this method on a search in state Completed or Failed succeeds, but has no effect.</p> <tp:rationale> <p>Specifying Stop to succeed when the search has finished means that clients who call Stop just before receiving <tp:member-ref>SearchStateChanged</tp:member-ref> don't have to handle a useless error.</p> </tp:rationale> <p>Depending on the protocol, the connection manager may not be able to prevent the server from sending further results after this method returns; if this is the case, it MUST ignore any further results.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_contact_search_signal_callback_search_result_received ()

void
(*tp_cli_channel_type_contact_search_signal_callback_search_result_received)
                               (TpChannel *proxy,
                                GHashTable *arg_Result,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SearchResultReceived.

Parameters

proxy

The proxy on which tp_cli_channel_type_contact_search_connect_to_search_result_received() was called

 

arg_Result

A mapping from contact identifier to an array of fields representing information about this contact.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_contact_search_signal_callback_search_state_changed ()

void
(*tp_cli_channel_type_contact_search_signal_callback_search_state_changed)
                               (TpChannel *proxy,
                                guint arg_State,
                                const gchar *arg_Error,
                                GHashTable *arg_Details,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SearchStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_contact_search_connect_to_search_state_changed() was called

 

arg_State

The new search state (TpChannelContactSearchState)

 

arg_Error

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> If the new state is <code>Failed</code>, the name of a D-Bus error describing what went wrong. Otherwise, the empty string.

 

arg_Details

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Additional information about the state transition, which may include the following well-known keys:</p> <dl> <dt>debug-message (s)</dt> <dd>Debugging information on the change, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances</dd> </dl> <tp:rationale> <p>This argument allows for future extensions. For instance, if moving to state <code>Failed</code> because the server rejected one of our search terms, we could define a key that indicates which terms were invalid.</p> </tp:rationale>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-tube.html0000644000175000017500000016424214006623344024233 00000000000000 Tube channels: telepathy-glib API Reference Manual

Tube channels

Tube channels — service-side interface for the Tube channel interface, StreamTube channel type and DBusTube channel type.

Signals

void tube-channel-state-changed Has Details
void connection-closed Has Details
void new-local-connection Has Details
void new-remote-connection Has Details
void d-bus-names-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceTube
    ├── TpSvcChannelTypeDBusTube
    ╰── TpSvcChannelTypeStreamTube

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A "tube" is a mechanism for arbitrary data transfer. This section documents the auto-generated C wrappers for the Tube channel interface, StreamTube channel type and DBusTube channel type.

Functions

tp_svc_channel_interface_tube_emit_tube_channel_state_changed ()

void
tp_svc_channel_interface_tube_emit_tube_channel_state_changed
                               (gpointer instance,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the TubeChannelStateChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Tube.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_channel_type_stream_tube_offer_impl ()

void
(*tp_svc_channel_type_stream_tube_offer_impl)
                               (TpSvcChannelTypeStreamTube *self,
                                guint in_address_type,
                                const GValue *in_address,
                                guint in_access_control,
                                GHashTable *in_parameters,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Offer on interface org.freedesktop.Telepathy.Channel.Type.StreamTube.

Parameters

self

The object implementing this interface

 

in_address_type

guint (FIXME, generate documentation)

 

in_address

const GValue * (FIXME, generate documentation)

 

in_access_control

guint (FIXME, generate documentation)

 

in_parameters

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_stream_tube_implement_offer ()

void
tp_svc_channel_type_stream_tube_implement_offer
                               (TpSvcChannelTypeStreamTubeClass *klass,
                                tp_svc_channel_type_stream_tube_offer_impl impl);

Register an implementation for the Offer method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Offer D-Bus method

 

tp_svc_channel_type_stream_tube_return_from_offer ()

void
tp_svc_channel_type_stream_tube_return_from_offer
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_stream_tube_accept_impl ()

void
(*tp_svc_channel_type_stream_tube_accept_impl)
                               (TpSvcChannelTypeStreamTube *self,
                                guint in_address_type,
                                guint in_access_control,
                                const GValue *in_access_control_param,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Accept on interface org.freedesktop.Telepathy.Channel.Type.StreamTube.

Parameters

self

The object implementing this interface

 

in_address_type

guint (FIXME, generate documentation)

 

in_access_control

guint (FIXME, generate documentation)

 

in_access_control_param

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_stream_tube_implement_accept ()

void
tp_svc_channel_type_stream_tube_implement_accept
                               (TpSvcChannelTypeStreamTubeClass *klass,
                                tp_svc_channel_type_stream_tube_accept_impl impl);

Register an implementation for the Accept method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Accept D-Bus method

 

tp_svc_channel_type_stream_tube_return_from_accept ()

void
tp_svc_channel_type_stream_tube_return_from_accept
                               (DBusGMethodInvocation *context,
                                const GValue *out_address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_address

const GValue * (FIXME, generate documentation)

 

tp_svc_channel_type_stream_tube_emit_new_remote_connection ()

void
tp_svc_channel_type_stream_tube_emit_new_remote_connection
                               (gpointer instance,
                                guint arg_Handle,
                                const GValue *arg_Connection_Param,
                                guint arg_Connection_ID);

Type-safe wrapper around g_signal_emit to emit the NewRemoteConnection signal on interface org.freedesktop.Telepathy.Channel.Type.StreamTube.

Parameters

instance

The object implementing this interface

 

arg_Handle

guint (FIXME, generate documentation)

 

arg_Connection_Param

const GValue * (FIXME, generate documentation)

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_stream_tube_emit_new_local_connection ()

void
tp_svc_channel_type_stream_tube_emit_new_local_connection
                               (gpointer instance,
                                guint arg_Connection_ID);

Type-safe wrapper around g_signal_emit to emit the NewLocalConnection signal on interface org.freedesktop.Telepathy.Channel.Type.StreamTube.

Parameters

instance

The object implementing this interface

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_stream_tube_emit_connection_closed ()

void
tp_svc_channel_type_stream_tube_emit_connection_closed
                               (gpointer instance,
                                guint arg_Connection_ID,
                                const gchar *arg_Error,
                                const gchar *arg_Message);

Type-safe wrapper around g_signal_emit to emit the ConnectionClosed signal on interface org.freedesktop.Telepathy.Channel.Type.StreamTube.

Parameters

instance

The object implementing this interface

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_dbus_tube_offer_impl ()

void
(*tp_svc_channel_type_dbus_tube_offer_impl)
                               (TpSvcChannelTypeDBusTube *self,
                                GHashTable *in_parameters,
                                guint in_access_control,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Offer on interface org.freedesktop.Telepathy.Channel.Type.DBusTube.

Parameters

self

The object implementing this interface

 

in_parameters

GHashTable * (FIXME, generate documentation)

 

in_access_control

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_dbus_tube_implement_offer ()

void
tp_svc_channel_type_dbus_tube_implement_offer
                               (TpSvcChannelTypeDBusTubeClass *klass,
                                tp_svc_channel_type_dbus_tube_offer_impl impl);

Register an implementation for the Offer method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Offer D-Bus method

 

tp_svc_channel_type_dbus_tube_return_from_offer ()

void
tp_svc_channel_type_dbus_tube_return_from_offer
                               (DBusGMethodInvocation *context,
                                const gchar *out_address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_address

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_dbus_tube_accept_impl ()

void
(*tp_svc_channel_type_dbus_tube_accept_impl)
                               (TpSvcChannelTypeDBusTube *self,
                                guint in_access_control,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Accept on interface org.freedesktop.Telepathy.Channel.Type.DBusTube.

Parameters

self

The object implementing this interface

 

in_access_control

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_dbus_tube_implement_accept ()

void
tp_svc_channel_type_dbus_tube_implement_accept
                               (TpSvcChannelTypeDBusTubeClass *klass,
                                tp_svc_channel_type_dbus_tube_accept_impl impl);

Register an implementation for the Accept method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Accept D-Bus method

 

tp_svc_channel_type_dbus_tube_return_from_accept ()

void
tp_svc_channel_type_dbus_tube_return_from_accept
                               (DBusGMethodInvocation *context,
                                const gchar *out_address);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_address

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_dbus_tube_emit_dbus_names_changed ()

void
tp_svc_channel_type_dbus_tube_emit_dbus_names_changed
                               (gpointer instance,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed);

Type-safe wrapper around g_signal_emit to emit the DBusNamesChanged signal on interface org.freedesktop.Telepathy.Channel.Type.DBusTube.

Parameters

instance

The object implementing this interface

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelInterfaceTube

typedef struct _TpSvcChannelInterfaceTube TpSvcChannelInterfaceTube;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceTubeClass

typedef struct _TpSvcChannelInterfaceTubeClass TpSvcChannelInterfaceTubeClass;

The class of TpSvcChannelInterfaceTube. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelTypeStreamTube

typedef struct _TpSvcChannelTypeStreamTube TpSvcChannelTypeStreamTube;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeStreamTubeClass

typedef struct _TpSvcChannelTypeStreamTubeClass TpSvcChannelTypeStreamTubeClass;

The class of TpSvcChannelTypeStreamTube.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_stream_tube (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_stream_tube_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (offer);
  IMPLEMENT (accept);
#undef IMPLEMENT
}

TpSvcChannelTypeDBusTube

typedef struct _TpSvcChannelTypeDBusTube TpSvcChannelTypeDBusTube;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeDBusTubeClass

typedef struct _TpSvcChannelTypeDBusTubeClass TpSvcChannelTypeDBusTubeClass;

The class of TpSvcChannelTypeDBusTube.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_dbus_tube (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_dbus_tube_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (offer);
  IMPLEMENT (accept);
#undef IMPLEMENT
}

Signal Details

The “tube-channel-state-changed” signal

void
user_function (TpSvcChannelInterfaceTube *self,
               guint                      arg_State,
               gpointer                   user_data)

The TubeChannelStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “connection-closed” signal

void
user_function (TpSvcChannelTypeStreamTube *self,
               guint                       arg_Connection_ID,
               gchar                      *arg_Error,
               gchar                      *arg_Message,
               gpointer                    user_data)

The ConnectionClosed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-local-connection” signal

void
user_function (TpSvcChannelTypeStreamTube *self,
               guint                       arg_Connection_ID,
               gpointer                    user_data)

The NewLocalConnection D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-remote-connection” signal

void
user_function (TpSvcChannelTypeStreamTube *self,
               guint                       arg_Handle,
               GValue                     *arg_Connection_Param,
               guint                       arg_Connection_ID,
               gpointer                    user_data)

The NewRemoteConnection D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Handle

guint (FIXME, generate documentation)

 

arg_Connection_Param

const GValue * (FIXME, generate documentation)

 

arg_Connection_ID

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “d-bus-names-changed” signal

void
user_function (TpSvcChannelTypeDBusTube *self,
               GArray_guint_            *arg_Removed,
               gpointer                  user_data)

The DBusNamesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-auth.html0000644000175000017500000027447414006623344023455 00000000000000 Channel Authentication interfaces: telepathy-glib API Reference Manual

Channel Authentication interfaces

Channel Authentication interfaces — client-side wrappers for authentication channels

Functions

TpProxyPendingCall * tp_cli_channel_interface_sasl_authentication_call_abort_sasl ()
TpProxyPendingCall * tp_cli_channel_interface_sasl_authentication_call_accept_sasl ()
TpProxyPendingCall * tp_cli_channel_interface_sasl_authentication_call_respond ()
TpProxyPendingCall * tp_cli_channel_interface_sasl_authentication_call_start_mechanism ()
TpProxyPendingCall * tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data ()
void (*tp_cli_channel_interface_sasl_authentication_callback_for_abort_sasl) ()
void (*tp_cli_channel_interface_sasl_authentication_callback_for_accept_sasl) ()
void (*tp_cli_channel_interface_sasl_authentication_callback_for_respond) ()
void (*tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism) ()
void (*tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism_with_data) ()
TpProxySignalConnection * tp_cli_channel_interface_sasl_authentication_connect_to_new_challenge ()
TpProxySignalConnection * tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed ()
TpProxyPendingCall * tp_cli_channel_interface_captcha_authentication_call_answer_captchas ()
TpProxyPendingCall * tp_cli_channel_interface_captcha_authentication_call_cancel_captcha ()
TpProxyPendingCall * tp_cli_channel_interface_captcha_authentication_call_get_captcha_data ()
TpProxyPendingCall * tp_cli_channel_interface_captcha_authentication_call_get_captchas ()
void (*tp_cli_channel_interface_captcha_authentication_callback_for_answer_captchas) ()
void (*tp_cli_channel_interface_captcha_authentication_callback_for_cancel_captcha) ()
void (*tp_cli_channel_interface_captcha_authentication_callback_for_get_captcha_data) ()
void (*tp_cli_channel_interface_captcha_authentication_callback_for_get_captchas) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The ServerAuthentication channel type represents a request for client/UI processes to carry out authentication with a server, including password authentication (prove that you are who you say you are) and captcha authentication (prove that you are not a bot).

Functions

tp_cli_channel_interface_sasl_authentication_call_abort_sasl ()

TpProxyPendingCall *
tp_cli_channel_interface_sasl_authentication_call_abort_sasl
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Reason,
                                const gchar *in_Debug_Message,
                                tp_cli_channel_interface_sasl_authentication_callback_for_abort_sasl callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AbortSASL method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Abort the current authentication try.</p> <p>If the current status is SASL_Status_Server_Failed or SASL_Status_Client_Failed, this method returns successfully, but has no further effect. If the current status is SASL_Status_Succeeded or SASL_Status_Client_Accepted then NotAvailable is raised. Otherwise, it changes the channel's state to SASL_Status_Client_Failed, with an appropriate error name and reason code.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: Reason for abort. (TpSASLAbortReason)

 

in_Debug_Message

Used to pass an 'in' argument: Debug message for abort.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sasl_authentication_call_accept_sasl ()

TpProxyPendingCall *
tp_cli_channel_interface_sasl_authentication_call_accept_sasl
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_sasl_authentication_callback_for_accept_sasl callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcceptSASL method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If the channel's status is SASL_Status_Server_Succeeded, this method confirms successful authentication and advances the status of the channel to SASL_Status_Succeeded.</p> <p>If the channel's status is SASL_Status_In_Progress, calling this method indicates that the last <tp:member-ref>NewChallenge</tp:member-ref> signal was in fact additional data sent after a successful SASL negotiation, and declares that from the client's point of view, authentication was successful. This advances the state of the channel to SASL_Status_Client_Accepted.</p> <p>In mechanisms where the server authenticates itself to the client, calling this method indicates that the client considers this to have been successful. In the case of <tp:dbus-ref namespace="ofdT.Channel.Type">ServerAuthentication</tp:dbus-ref> channels, this means that the connection manager MAY continue to connect, and MAY advance the <tp:dbus-ref namespace="ofdT">Connection.Status</tp:dbus-ref> to Connected.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sasl_authentication_call_respond ()

TpProxyPendingCall *
tp_cli_channel_interface_sasl_authentication_call_respond
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Response_Data,
                                tp_cli_channel_interface_sasl_authentication_callback_for_respond callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Respond method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Send a response to the the last challenge received via <tp:member-ref>NewChallenge</tp:member-ref>.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Response_Data

Used to pass an 'in' argument: The response data.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sasl_authentication_call_start_mechanism ()

TpProxyPendingCall *
tp_cli_channel_interface_sasl_authentication_call_start_mechanism
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Mechanism,
                                tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StartMechanism method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Start an authentication try using <var>Mechanism</var>, without sending initial data (an &quot;initial response&quot; as defined in RFC 4422).</p> <tp:rationale> <p>This method is appropriate for mechanisms where the client cannot send anything until it receives a challenge from the server, such as <code><a href="http://tools.ietf.org/html/rfc2831">DIGEST-MD5</a></code> in &quot;initial authentication&quot; mode.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Mechanism

Used to pass an 'in' argument: The chosen mechanism.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data ()

TpProxyPendingCall *
tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Mechanism,
                                const GArray *in_Initial_Data,
                                tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism_with_data callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StartMechanismWithData method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Start an authentication try using <var>Mechanism</var>, and send <var>Initial_Data</var> as the &quot;initial response&quot; defined in <a href="http://tools.ietf.org/html/rfc4422section-3.3">RFC 4422 §3.3</a>.</p> <tp:rationale> <p>This method is appropriate for mechanisms where the client may send data first, such as <code>PLAIN</code>, or must send data first, such as <code><a href="http://tools.ietf.org/html/rfc2831">DIGEST-MD5</a></code> in &quot;subsequent authentication&quot; mode.</p> <p>Having two methods allows any mechanism where it makes a difference to distinguish between the absence of an initial response (<tp:member-ref>StartMechanism</tp:member-ref>) and a zero-byte initial response (StartMechanismWithData, with Initial_Data empty).</p> </tp:rationale> <p>If the <tp:member-ref>HasInitialData</tp:member-ref> property is false, this indicates that the underlying protocol does not make it possible to send initial data. In such protocols, this method may only be used for the <code>X-TELEPATHY-</code> pseudo-mechanisms (such as <code>X-TELEPATHY-PASSWORD</code>), and will fail if used with an ordinary SASL mechanism.</p> <tp:rationale> <p>For instance, the IRC SASL extension implemented in Charybdis and Atheme does not support initial data - the first message in the exchange only carries the mechanism. This is significant if using <code><a href="http://tools.ietf.org/html/rfc2831">DIGEST-MD5</a></code>, which cannot be used in the faster &quot;subsequent authentication&quot; mode on a protocol not supporting initial data.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Mechanism

Used to pass an 'in' argument: The chosen mechanism.

 

in_Initial_Data

Used to pass an 'in' argument: Initial data (an &quot;initial response&quot; in RFC 4422's terminology) to send with the mechanism.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_sasl_authentication_callback_for_abort_sasl ()

void
(*tp_cli_channel_interface_sasl_authentication_callback_for_abort_sasl)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AbortSASL method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sasl_authentication_callback_for_accept_sasl ()

void
(*tp_cli_channel_interface_sasl_authentication_callback_for_accept_sasl)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcceptSASL method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sasl_authentication_callback_for_respond ()

void
(*tp_cli_channel_interface_sasl_authentication_callback_for_respond)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Respond method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism ()

void
(*tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StartMechanism method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism_with_data ()

void
(*tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism_with_data)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StartMechanismWithData method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_sasl_authentication_connect_to_new_challenge ()

TpProxySignalConnection *
tp_cli_channel_interface_sasl_authentication_connect_to_new_challenge
                               (TpChannel *proxy,
                                tp_cli_channel_interface_sasl_authentication_signal_callback_new_challenge callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewChallenge.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a new challenge is received from the server, or when a message indicating successful authentication and containing additional data is received from the server.</p> <p>When the channel's handler is ready to proceed, it should respond to the challenge by calling <tp:member-ref>Respond</tp:member-ref>, or respond to the additional data by calling <tp:member-ref>AcceptSASL</tp:member-ref>. Alternatively, it may call <tp:member-ref>AbortSASL</tp:member-ref> to abort authentication.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_sasl_authentication_signal_callback_sasl_status_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SASLStatusChanged.

Emitted when the status of the channel changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_captcha_authentication_call_answer_captchas ()

TpProxyPendingCall *
tp_cli_channel_interface_captcha_authentication_call_answer_captchas
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_Answers,
                                tp_cli_channel_interface_captcha_authentication_callback_for_answer_captchas callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AnswerCaptchas method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Answer as many captchas as desired and/or required.</p> <p>Callable in state Local_Pending only. State changes to Remote_Pending.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Answers

Used to pass an 'in' argument: The mapping of captcha IDs to answer strings.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_captcha_authentication_call_cancel_captcha ()

TpProxyPendingCall *
tp_cli_channel_interface_captcha_authentication_call_cancel_captcha
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Reason,
                                const gchar *in_Debug_Message,
                                tp_cli_channel_interface_captcha_authentication_callback_for_cancel_captcha callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CancelCaptcha method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Cancel. State changes to Failed with error NotAvailable or Cancelled if it isn't already Failed. All you can do now is to close the channel.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: Reason for cancelling. This MAY be used to choose an error response to the remote server, and SHOULD also be reflected in the <tp:member-ref>CaptchaError</tp:member-ref>. (TpCaptchaCancelReason)

 

in_Debug_Message

Used to pass an 'in' argument: A textual description of the reason for cancelling, supplied by the Handler. This message SHOULD NOT be sent to the remote server, but SHOULD be copied into the 'debug-message' field of the <tp:member-ref>CaptchaErrorDetails</tp:member-ref> and <tp:dbus-ref namespace="ofdT.Connection">ConnectionError</tp:dbus-ref>.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_captcha_authentication_call_get_captcha_data ()

TpProxyPendingCall *
tp_cli_channel_interface_captcha_authentication_call_get_captcha_data
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                const gchar *in_Mime_Type,
                                tp_cli_channel_interface_captcha_authentication_callback_for_get_captcha_data callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetCaptchaData method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Fetch and return the captcha data. In protocols where captchas are downloaded out-of-band (for instance via HTTP), the connection manager is expected to do so.</p> <p>Returns an empty array if the type was &quot;qa&quot;</p> <tp:rationale> <p>If audio-based and image-based captchas are both available, we don't want to waste time downloading the audio until/unless the user asks to hear it. The extra D-Bus round-trips are not a problem, since they are expected to be quick compared with the time taken for the user to solve the captcha.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the captcha of which to retrieve data.

 

in_Mime_Type

Used to pass an 'in' argument: MIME type picked by the Handler, chosen from the list of MIME types received in <tp:member-ref>GetCaptchas</tp:member-ref>. <tp:rationale> XEP-0158 allows the same captcha to be made available in multiple formats, for instance the same spoken question as audio/x-wav, application/ogg and audio/speex. </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_captcha_authentication_call_get_captchas ()

TpProxyPendingCall *
tp_cli_channel_interface_captcha_authentication_call_get_captchas
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_captcha_authentication_callback_for_get_captchas callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetCaptchas method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Gets information regarding each of the captcha methods available and which and how many need to be successfully answered</p> <p>To call this method successfully, the state must be Local_Pending or Try_Again. If it is Local_Pending, it remains Local_Pending. If called more than once while in Local_Pending state, or if the state is Try_Again, this method fetches a new set of captcha challenges, if possible, and the state returns to Local_Pending.</p> <tp:rationale> <p>For instance, you could call GetCaptchas again from Local_Pending state if the user indicates that they can't understand the initially-offered captcha.</p> <p>This is a method, not a property, so that it can be used to fetch more than one set of captcha challenges, and so that change notification is not required. Only the Handler should call this method and calling GetAll would not reduce round-trips, so the usual reasons to prefer a property do not apply here.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_captcha_authentication_callback_for_answer_captchas ()

void
(*tp_cli_channel_interface_captcha_authentication_callback_for_answer_captchas)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AnswerCaptchas method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_captcha_authentication_callback_for_cancel_captcha ()

void
(*tp_cli_channel_interface_captcha_authentication_callback_for_cancel_captcha)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CancelCaptcha method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_captcha_authentication_callback_for_get_captcha_data ()

void
(*tp_cli_channel_interface_captcha_authentication_callback_for_get_captcha_data)
                               (TpChannel *proxy,
                                const GArray *out_Captcha_Data,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetCaptchaData method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Captcha_Data

Used to return an 'out' argument if error is NULL: Captcha data as requested.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_captcha_authentication_callback_for_get_captchas ()

void
(*tp_cli_channel_interface_captcha_authentication_callback_for_get_captchas)
                               (TpChannel *proxy,
                                const GPtrArray *out_Captcha_Info,
                                guint out_Number_Required,
                                const gchar *out_Language,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetCaptchas method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Captcha_Info

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Information about each of the available captcha methods.

 

out_Number_Required

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The number of captcha methods required to be answered in order to successfully complete this captcha challenge (most frequently 1, but XMPP allows servers to demand that more than one captcha is answered).

 

out_Language

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> The language of each Label in Captcha_Info if available, for instance en_US, or &quot;&quot; if unknown.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 
telepathy-glib-0.24.2/docs/reference/html/TpBaseCallChannel.html0000644000175000017500000020512114006623343021417 00000000000000 TpBaseCallChannel: telepathy-glib API Reference Manual

TpBaseCallChannel

TpBaseCallChannel — base class for TpSvcChannelTypeCall implementations

Properties

guint call-flags Read
GHashTable_guint+guint_* call-members Read
guint call-state Read
GHashTable_gchararray+GValue_* call-state-details Read
GValueArray_guint+guint+gchararray+gchararray_* call-state-reason Read
GPtrArray_DBusGObjectPath_ * contents Read
gboolean hardware-streaming Read
gboolean initial-audio Read / Write / Construct Only
gchar * initial-audio-name Read / Write / Construct Only
gchar * initial-tones Read / Write / Construct Only
guint initial-transport Read / Write / Construct Only
gboolean initial-video Read / Write / Construct Only
gchar * initial-video-name Read / Write / Construct Only
GHashTable_guint+gchararray_* member-identifiers Read
gboolean mutable-contents Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseChannel
        ╰── TpBaseCallChannel
            ╰── TpBaseMediaCallChannel

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcChannelTypeCall implementations by implementing its properties, and some of its methods.

Subclasses should fill in TpBaseCallChannelClass.accept, TpBaseCallChannelClass.add_content and TpBaseCallChannelClass.hangup virtual function.

Functions

TpBaseCallChannelVoidFunc ()

void
(*TpBaseCallChannelVoidFunc) (TpBaseCallChannel *self);

Signature of an implementation of TpBaseCallChannelClass.set_ringing, TpBaseCallChannelClass.set_queued and TpBaseCallChannelClass.accept.

Parameters

self

a TpBaseCallChannel

 

Since: 0.17.5


TpBaseCallChannelAddContentFunc ()

TpBaseCallContent *
(*TpBaseCallChannelAddContentFunc) (TpBaseCallChannel *self,
                                    const gchar *name,
                                    TpMediaStreamType media,
                                    TpMediaStreamDirection initial_direction,
                                    GError **error);

Signature of an implementation of TpBaseCallChannelClass.add_content.

Parameters

self

a TpBaseCallChannel

 

name

the name for the new content

 

media

a TpMediaStreamType

 

initial_direction

the desired initial direction of streams in the new content

 

error

a GError to fill

 

Returns

a borrowed TpBaseCallContent.

Since: 0.17.5


TpBaseCallChannelHangupFunc ()

void
(*TpBaseCallChannelHangupFunc) (TpBaseCallChannel *self,
                                TpCallStateChangeReason reason,
                                const gchar *detailed_reason,
                                const gchar *message);

Signature of an implementation of TpBaseCallChannelClass.hangup.

Parameters

self

a TpBaseCallChannel

 

reason

the TpCallStateChangeReason of the change

 

detailed_reason

a more specific reason for the call hangup, if one is available, or an empty string otherwise.

 

message

a human-readable message to be sent to the remote contact(s).

 

Since: 0.17.5


tp_base_call_channel_get_state ()

TpCallState
tp_base_call_channel_get_state (TpBaseCallChannel *self);

Parameters

self

a TpBaseCallChannel

 

Returns

the value of “call-state”

Since: 0.17.5


tp_base_call_channel_set_state ()

void
tp_base_call_channel_set_state (TpBaseCallChannel *self,
                                TpCallState state,
                                guint actor_handle,
                                TpCallStateChangeReason reason,
                                const gchar *dbus_reason,
                                const gchar *message);

Changes the call state and emit StateChanged signal with the new state.

Parameters

self

a TpBaseCallChannel

 

state

the new TpCallState

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5


tp_base_call_channel_has_initial_audio ()

gboolean
tp_base_call_channel_has_initial_audio
                               (TpBaseCallChannel *self,
                                const gchar **initial_audio_name);

Parameters

self

a TpBaseCallChannel

 

initial_audio_name

a place to set the value of “initial-audio-name”.

[out][allow-none][transfer none]

Returns

the value of “initial-audio”

Since: 0.17.5


tp_base_call_channel_has_initial_video ()

gboolean
tp_base_call_channel_has_initial_video
                               (TpBaseCallChannel *self,
                                const gchar **initial_video_name);

Parameters

self

a TpBaseCallChannel

 

initial_video_name

a place to set the value of “initial-video-name”.

[out][allow-none][transfer none]

Returns

the value of “initial-video”

Since: 0.17.5


tp_base_call_channel_has_mutable_contents ()

gboolean
tp_base_call_channel_has_mutable_contents
                               (TpBaseCallChannel *self);

Parameters

self

a TpBaseCallChannel

 

Returns

the value of “mutable-contents”

Since: 0.17.5


tp_base_call_channel_get_contents ()

GList *
tp_base_call_channel_get_contents (TpBaseCallChannel *self);

Get the contents of this call. The GList and its elements must not be freed and should be copied before doing any modification.

Parameters

self

a TpBaseCallChannel

 

Returns

a GList of TpBaseCallContent

Since: 0.17.5


tp_base_call_channel_add_content ()

void
tp_base_call_channel_add_content (TpBaseCallChannel *self,
                                  TpBaseCallContent *content);

Add content to self . If content 's “disposition” is TP_CALL_CONTENT_DISPOSITION_INITIAL, also set “initial-audio” and “initial-audio-name” properties (or “initial-video” and “initial-video-name”). Note that it is not allowed to add INITIAL contents after having registered self on the bus.

Parameters

self

a TpBaseCallChannel

 

content

a TpBaseCallContent to add

 

Since: 0.17.5


tp_base_call_channel_remove_content ()

void
tp_base_call_channel_remove_content (TpBaseCallChannel *self,
                                     TpBaseCallContent *content,
                                     TpHandle actor_handle,
                                     TpCallStateChangeReason reason,
                                     const gchar *dbus_reason,
                                     const gchar *message);

Remove content from self .

Parameters

self

a TpBaseCallChannel

 

content

a TpBaseCallContent to remove

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5


tp_base_call_channel_update_member_flags ()

void
tp_base_call_channel_update_member_flags
                               (TpBaseCallChannel *self,
                                TpHandle contact,
                                TpCallMemberFlags new_flags,
                                TpHandle actor_handle,
                                TpCallStateChangeReason reason,
                                const gchar *dbus_reason,
                                const gchar *message);

Add or update contact call member with flags flags.

Parameters

self

a TpBaseCallChannel

 

contact

the contact to update

 

new_flags

the new TpCallMemberFlags of contact

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5


tp_base_call_channel_remove_member ()

void
tp_base_call_channel_remove_member (TpBaseCallChannel *self,
                                    TpHandle contact,
                                    TpHandle actor_handle,
                                    TpCallStateChangeReason reason,
                                    const gchar *dbus_reason,
                                    const gchar *message);

Remove contact from call members.

Parameters

self

a TpBaseCallChannel

 

contact

the contact to remove

 

actor_handle

the contact responsible for the change, or 0 if no contact was responsible.

 

reason

the TpCallStateChangeReason of the change

 

dbus_reason

a specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

 

message

an optional debug message, to expediate debugging the potentially many processes involved in a call.

 

Since: 0.17.5


tp_base_call_channel_get_call_members ()

GHashTable *
tp_base_call_channel_get_call_members (TpBaseCallChannel *self);

Parameters

self

a TpBaseCallChannel

 

Returns

the value of “call-members”.

Since: 0.17.5


tp_base_call_channel_remote_accept ()

void
tp_base_call_channel_remote_accept (TpBaseCallChannel *self);

Must be called when the remote contact accepted the call. “call-state” must be either TP_CALL_STATE_INITIALISED or TP_CALL_STATE_INITIALISING and will then change to TP_CALL_STATE_ACCEPTED.

Must be used only for outgoing calls.

Parameters

self

a TpBaseCallChannel

 

Since: 0.17.5


tp_base_call_channel_is_accepted ()

gboolean
tp_base_call_channel_is_accepted (TpBaseCallChannel *self);

Parameters

self

a TpBaseCallChannel

 

Returns

Whether or not the call has been remotely accepted.

Since: 0.17.5

Types and Values

struct TpBaseCallChannel

struct TpBaseCallChannel;

A base class for call channel implementations

Since: 0.17.5


struct TpBaseCallChannelClass

struct TpBaseCallChannelClass {
  TpBaseCallChannelVoidFunc set_ringing;
  TpBaseCallChannelVoidFunc set_queued;
  TpBaseCallChannelVoidFunc accept;
  TpBaseCallChannelAddContentFunc add_content;
  TpBaseCallChannelHangupFunc hangup;
};

The class structure for TpBaseCallChannel

Members

TpBaseCallChannelVoidFunc set_ringing;

Notify members that client is ringing.

 

TpBaseCallChannelVoidFunc set_queued;

Notify members that call is queued.

 

TpBaseCallChannelVoidFunc accept;

accept the call. Note that TpBaseMediaCallChannel subclasses should not override this virtual method, but TpBaseMediaCallChannelClass.accept instead.

 

TpBaseCallChannelAddContentFunc add_content;

add content to the call. Implementation must call tp_base_call_channel_add_content(). Can be NULL if “mutable-contents” is FALSE.

 

TpBaseCallChannelHangupFunc hangup;

hangup the call.

 

Since: 0.17.5

Property Details

The “call-flags” property

  “call-flags”               guint

The flags of this call.

Owner: TpBaseCallChannel

Flags: Read

Default value: 0

Since: 0.17.5


The “call-members” property

  “call-members”             GHashTable_guint+guint_*

GHashTable mapping TpHandle of each call member to their TpCallMemberFlags.

Owner: TpBaseCallChannel

Flags: Read

Since: 0.17.5


The “call-state” property

  “call-state”               guint

The state of this call.

Owner: TpBaseCallChannel

Flags: Read

Default value: 0

Since: 0.17.5


The “call-state-details” property

  “call-state-details”       GHashTable_gchararray+GValue_*

Details on the call state.

Owner: TpBaseCallChannel

Flags: Read

Since: 0.17.5


The “call-state-reason” property

  “call-state-reason”        GValueArray_guint+guint+gchararray+gchararray_*

The reason for last call state change.

Owner: TpBaseCallChannel

Flags: Read

Since: 0.17.5


The “contents” property

  “contents”                 GPtrArray_DBusGObjectPath_ *

GPtrArray of object-paths of the TpBaseCallContent objects.

Owner: TpBaseCallChannel

Flags: Read

Since: 0.17.5


The “hardware-streaming” property

  “hardware-streaming”       gboolean

Indicate to clients whether or not this Connection Manager has hardware streaming.

Owner: TpBaseCallChannel

Flags: Read

Default value: FALSE

Since: 0.17.5


The “initial-audio” property

  “initial-audio”            gboolean

If set to TRUE on a requested channel, subclass should immediately attempt to establish an audio stream to the remote contact.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.17.5


The “initial-audio-name” property

  “initial-audio-name”       gchar *

Name to use to create the audio TpBaseCallContent if “initial-audio” is set to TRUE.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: "audio"

Since: 0.17.5


The “initial-tones” property

  “initial-tones”            gchar *

DTMF Tones to be played on the channel created.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: ""

Since: 0.17.5


The “initial-transport” property

  “initial-transport”        guint

If set to TRUE on a requested channel, this indicates the transport that should be used for this call.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “initial-video” property

  “initial-video”            gboolean

If set to TRUE on a requested channel, subclass should immediately attempt to establish a video stream to the remote contact.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.17.5


The “initial-video-name” property

  “initial-video-name”       gchar *

Name to use to create the video TpBaseCallContent if “initial-video” is set to TRUE.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: "video"

Since: 0.17.5


The “member-identifiers” property

  “member-identifiers”       GHashTable_guint+gchararray_*

GHashTable mapping TpHandle of each call member to their identifiers.

Owner: TpBaseCallChannel

Flags: Read

Since: 0.17.5


The “mutable-contents” property

  “mutable-contents”         gboolean

Indicate to clients whether or not they can add/remove contents.

Owner: TpBaseCallChannel

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-connection.html0000644000175000017500000253247114006623344024032 00000000000000 Service-side Connection interfaces: telepathy-glib API Reference Manual

Service-side Connection interfaces

Service-side Connection interfaces — GInterfaces for Telepathy Connection objects

Functions

void (*tp_svc_connection_connect_impl) ()
void tp_svc_connection_implement_connect ()
void tp_svc_connection_return_from_connect ()
void (*tp_svc_connection_disconnect_impl) ()
void tp_svc_connection_implement_disconnect ()
void tp_svc_connection_return_from_disconnect ()
void (*tp_svc_connection_get_interfaces_impl) ()
void tp_svc_connection_implement_get_interfaces ()
void tp_svc_connection_return_from_get_interfaces ()
void (*tp_svc_connection_get_protocol_impl) ()
void tp_svc_connection_implement_get_protocol ()
void tp_svc_connection_return_from_get_protocol ()
void (*tp_svc_connection_get_self_handle_impl) ()
void tp_svc_connection_implement_get_self_handle ()
void tp_svc_connection_return_from_get_self_handle ()
void (*tp_svc_connection_get_status_impl) ()
void tp_svc_connection_implement_get_status ()
void tp_svc_connection_return_from_get_status ()
void (*tp_svc_connection_hold_handles_impl) ()
void tp_svc_connection_implement_hold_handles ()
void tp_svc_connection_return_from_hold_handles ()
void (*tp_svc_connection_inspect_handles_impl) ()
void tp_svc_connection_implement_inspect_handles ()
void tp_svc_connection_return_from_inspect_handles ()
void (*tp_svc_connection_list_channels_impl) ()
void tp_svc_connection_implement_list_channels ()
void tp_svc_connection_return_from_list_channels ()
void (*tp_svc_connection_release_handles_impl) ()
void tp_svc_connection_implement_release_handles ()
void tp_svc_connection_return_from_release_handles ()
void (*tp_svc_connection_request_channel_impl) ()
void tp_svc_connection_implement_request_channel ()
void tp_svc_connection_return_from_request_channel ()
void (*tp_svc_connection_request_handles_impl) ()
void tp_svc_connection_implement_request_handles ()
void tp_svc_connection_return_from_request_handles ()
void tp_svc_connection_emit_new_channel ()
void tp_svc_connection_emit_self_handle_changed ()
void tp_svc_connection_emit_self_contact_changed ()
void tp_svc_connection_emit_status_changed ()
void tp_svc_connection_emit_connection_error ()
void (*tp_svc_connection_add_client_interest_impl) ()
void tp_svc_connection_implement_add_client_interest ()
void tp_svc_connection_implement_remove_client_interest ()
void (*tp_svc_connection_remove_client_interest_impl) ()
void tp_svc_connection_return_from_add_client_interest ()
void tp_svc_connection_return_from_remove_client_interest ()
void (*tp_svc_connection_interface_contacts_get_contact_attributes_impl) ()
void tp_svc_connection_interface_contacts_implement_get_contact_attributes ()
void tp_svc_connection_interface_contacts_return_from_get_contact_attributes ()
void (*tp_svc_connection_interface_contacts_get_contact_by_id_impl) ()
void tp_svc_connection_interface_contacts_implement_get_contact_by_id ()
void tp_svc_connection_interface_contacts_return_from_get_contact_by_id ()
void (*tp_svc_connection_interface_requests_create_channel_impl) ()
void tp_svc_connection_interface_requests_emit_channel_closed ()
void tp_svc_connection_interface_requests_emit_new_channels ()
void (*tp_svc_connection_interface_requests_ensure_channel_impl) ()
void tp_svc_connection_interface_requests_implement_create_channel ()
void tp_svc_connection_interface_requests_implement_ensure_channel ()
void tp_svc_connection_interface_requests_return_from_create_channel ()
void tp_svc_connection_interface_requests_return_from_ensure_channel ()
void tp_svc_connection_interface_simple_presence_emit_presences_changed ()
void (*tp_svc_connection_interface_simple_presence_get_presences_impl) ()
void tp_svc_connection_interface_simple_presence_implement_get_presences ()
void tp_svc_connection_interface_simple_presence_implement_set_presence ()
void tp_svc_connection_interface_simple_presence_return_from_get_presences ()
void tp_svc_connection_interface_simple_presence_return_from_set_presence ()
void (*tp_svc_connection_interface_simple_presence_set_presence_impl) ()
void (*tp_svc_connection_interface_presence_add_status_impl) ()
void tp_svc_connection_interface_presence_implement_add_status ()
void tp_svc_connection_interface_presence_return_from_add_status ()
void (*tp_svc_connection_interface_presence_clear_status_impl) ()
void tp_svc_connection_interface_presence_implement_clear_status ()
void tp_svc_connection_interface_presence_return_from_clear_status ()
void (*tp_svc_connection_interface_presence_get_presence_impl) ()
void tp_svc_connection_interface_presence_implement_get_presence ()
void tp_svc_connection_interface_presence_return_from_get_presence ()
void (*tp_svc_connection_interface_presence_get_statuses_impl) ()
void tp_svc_connection_interface_presence_implement_get_statuses ()
void tp_svc_connection_interface_presence_return_from_get_statuses ()
void (*tp_svc_connection_interface_presence_remove_status_impl) ()
void tp_svc_connection_interface_presence_implement_remove_status ()
void tp_svc_connection_interface_presence_return_from_remove_status ()
void (*tp_svc_connection_interface_presence_request_presence_impl) ()
void tp_svc_connection_interface_presence_implement_request_presence ()
void tp_svc_connection_interface_presence_return_from_request_presence ()
void (*tp_svc_connection_interface_presence_set_last_activity_time_impl) ()
void tp_svc_connection_interface_presence_implement_set_last_activity_time ()
void tp_svc_connection_interface_presence_return_from_set_last_activity_time ()
void (*tp_svc_connection_interface_presence_set_status_impl) ()
void tp_svc_connection_interface_presence_implement_set_status ()
void tp_svc_connection_interface_presence_return_from_set_status ()
void tp_svc_connection_interface_presence_emit_presence_update ()
void (*tp_svc_connection_interface_avatars_clear_avatar_impl) ()
void tp_svc_connection_interface_avatars_implement_clear_avatar ()
void tp_svc_connection_interface_avatars_return_from_clear_avatar ()
void (*tp_svc_connection_interface_avatars_get_avatar_requirements_impl) ()
void tp_svc_connection_interface_avatars_implement_get_avatar_requirements ()
void tp_svc_connection_interface_avatars_return_from_get_avatar_requirements ()
void (*tp_svc_connection_interface_avatars_get_avatar_tokens_impl) ()
void tp_svc_connection_interface_avatars_implement_get_avatar_tokens ()
void tp_svc_connection_interface_avatars_return_from_get_avatar_tokens ()
void (*tp_svc_connection_interface_avatars_request_avatar_impl) ()
void tp_svc_connection_interface_avatars_implement_request_avatar ()
void tp_svc_connection_interface_avatars_return_from_request_avatar ()
void (*tp_svc_connection_interface_avatars_set_avatar_impl) ()
void tp_svc_connection_interface_avatars_implement_set_avatar ()
void tp_svc_connection_interface_avatars_return_from_set_avatar ()
void tp_svc_connection_interface_avatars_emit_avatar_updated ()
void tp_svc_connection_interface_avatars_emit_avatar_retrieved ()
void tp_svc_connection_interface_avatars_implement_request_avatars ()
void (*tp_svc_connection_interface_avatars_request_avatars_impl) ()
void tp_svc_connection_interface_avatars_return_from_request_avatars ()
void (*tp_svc_connection_interface_avatars_get_known_avatar_tokens_impl) ()
void tp_svc_connection_interface_avatars_implement_get_known_avatar_tokens ()
void tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ()
void (*tp_svc_connection_interface_aliasing_get_alias_flags_impl) ()
void tp_svc_connection_interface_aliasing_implement_get_alias_flags ()
void tp_svc_connection_interface_aliasing_return_from_get_alias_flags ()
void (*tp_svc_connection_interface_aliasing_request_aliases_impl) ()
void tp_svc_connection_interface_aliasing_implement_request_aliases ()
void tp_svc_connection_interface_aliasing_return_from_request_aliases ()
void (*tp_svc_connection_interface_aliasing_get_aliases_impl) ()
void tp_svc_connection_interface_aliasing_implement_get_aliases ()
void tp_svc_connection_interface_aliasing_return_from_get_aliases ()
void (*tp_svc_connection_interface_aliasing_set_aliases_impl) ()
void tp_svc_connection_interface_aliasing_implement_set_aliases ()
void tp_svc_connection_interface_aliasing_return_from_set_aliases ()
void tp_svc_connection_interface_aliasing_emit_aliases_changed ()
void tp_svc_connection_interface_balance_emit_balance_changed ()
void (*tp_svc_connection_interface_capabilities_advertise_capabilities_impl) ()
void tp_svc_connection_interface_capabilities_implement_advertise_capabilities ()
void tp_svc_connection_interface_capabilities_return_from_advertise_capabilities ()
void (*tp_svc_connection_interface_capabilities_get_capabilities_impl) ()
void tp_svc_connection_interface_capabilities_implement_get_capabilities ()
void tp_svc_connection_interface_capabilities_return_from_get_capabilities ()
void tp_svc_connection_interface_capabilities_emit_capabilities_changed ()
void tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed ()
void (*tp_svc_connection_interface_contact_capabilities_get_contact_capabilities_impl) ()
void tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities ()
void tp_svc_connection_interface_contact_capabilities_implement_get_contact_capabilities ()
void (*tp_svc_connection_interface_contact_capabilities_update_capabilities_impl) ()
void tp_svc_connection_interface_contact_capabilities_return_from_update_capabilities ()
void tp_svc_connection_interface_contact_capabilities_implement_update_capabilities ()
void tp_svc_connection_interface_location_emit_location_updated ()
void (*tp_svc_connection_interface_location_get_locations_impl) ()
void tp_svc_connection_interface_location_return_from_get_locations ()
void tp_svc_connection_interface_location_implement_get_locations ()
void (*tp_svc_connection_interface_location_request_location_impl) ()
void tp_svc_connection_interface_location_return_from_request_location ()
void tp_svc_connection_interface_location_implement_request_location ()
void (*tp_svc_connection_interface_location_set_location_impl) ()
void tp_svc_connection_interface_location_return_from_set_location ()
void tp_svc_connection_interface_location_implement_set_location ()
void tp_svc_connection_interface_contact_info_emit_contact_info_changed ()
void (*tp_svc_connection_interface_contact_info_get_contact_info_impl) ()
void tp_svc_connection_interface_contact_info_implement_get_contact_info ()
void tp_svc_connection_interface_contact_info_implement_refresh_contact_info ()
void tp_svc_connection_interface_contact_info_implement_request_contact_info ()
void tp_svc_connection_interface_contact_info_implement_set_contact_info ()
void (*tp_svc_connection_interface_contact_info_refresh_contact_info_impl) ()
void (*tp_svc_connection_interface_contact_info_request_contact_info_impl) ()
void tp_svc_connection_interface_contact_info_return_from_get_contact_info ()
void tp_svc_connection_interface_contact_info_return_from_refresh_contact_info ()
void tp_svc_connection_interface_contact_info_return_from_request_contact_info ()
void tp_svc_connection_interface_contact_info_return_from_set_contact_info ()
void (*tp_svc_connection_interface_contact_info_set_contact_info_impl) ()
void (*tp_svc_connection_interface_contact_blocking_block_contacts_impl) ()
void tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed ()
void tp_svc_connection_interface_contact_blocking_implement_block_contacts ()
void tp_svc_connection_interface_contact_blocking_implement_request_blocked_contacts ()
void tp_svc_connection_interface_contact_blocking_implement_unblock_contacts ()
void (*tp_svc_connection_interface_contact_blocking_request_blocked_contacts_impl) ()
void tp_svc_connection_interface_contact_blocking_return_from_block_contacts ()
void tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts ()
void tp_svc_connection_interface_contact_blocking_return_from_unblock_contacts ()
void (*tp_svc_connection_interface_contact_blocking_unblock_contacts_impl) ()
void (*tp_svc_connection_interface_contact_groups_add_to_group_impl) ()
void tp_svc_connection_interface_contact_groups_emit_group_renamed ()
void tp_svc_connection_interface_contact_groups_emit_groups_changed ()
void tp_svc_connection_interface_contact_groups_emit_groups_created ()
void tp_svc_connection_interface_contact_groups_emit_groups_removed ()
void tp_svc_connection_interface_contact_groups_implement_add_to_group ()
void tp_svc_connection_interface_contact_groups_implement_remove_from_group ()
void tp_svc_connection_interface_contact_groups_implement_remove_group ()
void tp_svc_connection_interface_contact_groups_implement_rename_group ()
void tp_svc_connection_interface_contact_groups_implement_set_contact_groups ()
void tp_svc_connection_interface_contact_groups_implement_set_group_members ()
void (*tp_svc_connection_interface_contact_groups_remove_from_group_impl) ()
void (*tp_svc_connection_interface_contact_groups_remove_group_impl) ()
void (*tp_svc_connection_interface_contact_groups_rename_group_impl) ()
void tp_svc_connection_interface_contact_groups_return_from_add_to_group ()
void tp_svc_connection_interface_contact_groups_return_from_remove_from_group ()
void tp_svc_connection_interface_contact_groups_return_from_remove_group ()
void tp_svc_connection_interface_contact_groups_return_from_rename_group ()
void tp_svc_connection_interface_contact_groups_return_from_set_contact_groups ()
void tp_svc_connection_interface_contact_groups_return_from_set_group_members ()
void (*tp_svc_connection_interface_contact_groups_set_contact_groups_impl) ()
void (*tp_svc_connection_interface_contact_groups_set_group_members_impl) ()
void (*tp_svc_connection_interface_contact_list_authorize_publication_impl) ()
void (*tp_svc_connection_interface_contact_list_download_impl) ()
void tp_svc_connection_interface_contact_list_emit_contacts_changed ()
void tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id ()
void tp_svc_connection_interface_contact_list_emit_contact_list_state_changed ()
void (*tp_svc_connection_interface_contact_list_get_contact_list_attributes_impl) ()
void tp_svc_connection_interface_contact_list_implement_authorize_publication ()
void tp_svc_connection_interface_contact_list_implement_download ()
void tp_svc_connection_interface_contact_list_implement_get_contact_list_attributes ()
void tp_svc_connection_interface_contact_list_implement_remove_contacts ()
void tp_svc_connection_interface_contact_list_implement_request_subscription ()
void tp_svc_connection_interface_contact_list_implement_unpublish ()
void tp_svc_connection_interface_contact_list_implement_unsubscribe ()
void (*tp_svc_connection_interface_contact_list_remove_contacts_impl) ()
void (*tp_svc_connection_interface_contact_list_request_subscription_impl) ()
void tp_svc_connection_interface_contact_list_return_from_authorize_publication ()
void tp_svc_connection_interface_contact_list_return_from_download ()
void tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes ()
void tp_svc_connection_interface_contact_list_return_from_remove_contacts ()
void tp_svc_connection_interface_contact_list_return_from_request_subscription ()
void tp_svc_connection_interface_contact_list_return_from_unpublish ()
void tp_svc_connection_interface_contact_list_return_from_unsubscribe ()
void (*tp_svc_connection_interface_contact_list_unpublish_impl) ()
void (*tp_svc_connection_interface_contact_list_unsubscribe_impl) ()
void tp_svc_connection_interface_cellular_emit_imsi_changed ()
void tp_svc_connection_interface_client_types_emit_client_types_updated ()
void (*tp_svc_connection_interface_client_types_get_client_types_impl) ()
void tp_svc_connection_interface_client_types_implement_get_client_types ()
void tp_svc_connection_interface_client_types_implement_request_client_types ()
void (*tp_svc_connection_interface_client_types_request_client_types_impl) ()
void tp_svc_connection_interface_client_types_return_from_get_client_types ()
void tp_svc_connection_interface_client_types_return_from_request_client_types ()
void tp_svc_connection_interface_mail_notification_emit_mails_received ()
void tp_svc_connection_interface_mail_notification_emit_unread_mails_changed ()
void tp_svc_connection_interface_mail_notification_implement_request_inbox_url ()
void tp_svc_connection_interface_mail_notification_implement_request_mail_url ()
void (*tp_svc_connection_interface_mail_notification_request_inbox_url_impl) ()
void (*tp_svc_connection_interface_mail_notification_request_mail_url_impl) ()
void tp_svc_connection_interface_mail_notification_return_from_request_inbox_url ()
void tp_svc_connection_interface_mail_notification_return_from_request_mail_url ()
void tp_svc_connection_interface_power_saving_emit_power_saving_changed ()
void tp_svc_connection_interface_power_saving_implement_set_power_saving ()
void tp_svc_connection_interface_power_saving_return_from_set_power_saving ()
void (*tp_svc_connection_interface_power_saving_set_power_saving_impl) ()
void (*tp_svc_connection_interface_addressing_get_contacts_by_uri_impl) ()
void (*tp_svc_connection_interface_addressing_get_contacts_by_vcard_field_impl) ()
void tp_svc_connection_interface_addressing_implement_get_contacts_by_uri ()
void tp_svc_connection_interface_addressing_implement_get_contacts_by_vcard_field ()
void tp_svc_connection_interface_addressing_return_from_get_contacts_by_uri ()
void tp_svc_connection_interface_addressing_return_from_get_contacts_by_vcard_field ()
void tp_svc_connection_interface_renaming_emit_renamed ()
void tp_svc_connection_interface_renaming_implement_request_rename ()
void (*tp_svc_connection_interface_renaming_request_rename_impl) ()
void tp_svc_connection_interface_renaming_return_from_request_rename ()
void (*tp_svc_connection_interface_sidecars1_ensure_sidecar_impl) ()
void tp_svc_connection_interface_sidecars1_implement_ensure_sidecar ()
void tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar ()

Signals

void connection-error Has Details
void new-channel Has Details
void self-contact-changed Has Details
void self-handle-changed Has Details
void status-changed Has Details
void channel-closed Has Details
void new-channels Has Details
void presences-changed Has Details
void presence-update Has Details
void avatar-retrieved Has Details
void avatar-updated Has Details
void aliases-changed Has Details
void balance-changed Has Details
void capabilities-changed Has Details
void contact-capabilities-changed Has Details
void location-updated Has Details
void contact-info-changed Has Details
void blocked-contacts-changed Has Details
void group-renamed Has Details
void groups-changed Has Details
void groups-created Has Details
void groups-removed Has Details
void contact-list-state-changed Has Details
void contacts-changed Has Details
void contacts-changed-with-id Has Details
void i-ms-ichanged Has Details
void client-types-updated Has Details
void mails-received Has Details
void unread-mails-changed Has Details
void power-saving-changed Has Details
void renamed Has Details

Types and Values

  TpSvcConnection
  TpSvcConnectionClass
  TpSvcConnectionInterfaceContacts
  TpSvcConnectionInterfaceContactsClass
  TpSvcConnectionInterfaceRequests
  TpSvcConnectionInterfaceRequestsClass
  TpSvcConnectionInterfaceSimplePresence
  TpSvcConnectionInterfaceSimplePresenceClass
  TpSvcConnectionInterfacePresence
  TpSvcConnectionInterfacePresenceClass
  TpSvcConnectionInterfaceAvatars
  TpSvcConnectionInterfaceAvatarsClass
  TpSvcConnectionInterfaceAliasing
  TpSvcConnectionInterfaceAliasingClass
  TpSvcConnectionInterfaceBalance
  TpSvcConnectionInterfaceBalanceClass
  TpSvcConnectionInterfaceCapabilities
  TpSvcConnectionInterfaceCapabilitiesClass
  TpSvcConnectionInterfaceContactCapabilities
  TpSvcConnectionInterfaceContactCapabilitiesClass
  TpSvcConnectionInterfaceLocation
  TpSvcConnectionInterfaceLocationClass
  TpSvcConnectionInterfaceContactInfo
  TpSvcConnectionInterfaceContactInfoClass
  TpSvcConnectionInterfaceContactBlocking
  TpSvcConnectionInterfaceContactBlockingClass
  TpSvcConnectionInterfaceContactGroups
  TpSvcConnectionInterfaceContactGroupsClass
  TpSvcConnectionInterfaceContactList
  TpSvcConnectionInterfaceContactListClass
  TpSvcConnectionInterfaceCellular
  TpSvcConnectionInterfaceCellularClass
  TpSvcConnectionInterfaceClientTypes
  TpSvcConnectionInterfaceClientTypesClass
  TpSvcConnectionInterfaceMailNotification
  TpSvcConnectionInterfaceMailNotificationClass
  TpSvcConnectionInterfacePowerSaving
  TpSvcConnectionInterfacePowerSavingClass
  TpSvcConnectionInterfaceAddressing
  TpSvcConnectionInterfaceAddressingClass
  TpSvcConnectionInterfaceRenaming
  TpSvcConnectionInterfaceRenamingClass
  TpSvcConnectionInterfaceSidecars1
  TpSvcConnectionInterfaceSidecars1Class

Object Hierarchy

    GInterface
    ├── TpSvcConnection
    ├── TpSvcConnectionInterfaceAddressing
    ├── TpSvcConnectionInterfaceAliasing
    ├── TpSvcConnectionInterfaceAvatars
    ├── TpSvcConnectionInterfaceBalance
    ├── TpSvcConnectionInterfaceCapabilities
    ├── TpSvcConnectionInterfaceCellular
    ├── TpSvcConnectionInterfaceClientTypes
    ├── TpSvcConnectionInterfaceContactBlocking
    ├── TpSvcConnectionInterfaceContactCapabilities
    ├── TpSvcConnectionInterfaceContactGroups
    ├── TpSvcConnectionInterfaceContactInfo
    ├── TpSvcConnectionInterfaceContactList
    ├── TpSvcConnectionInterfaceContacts
    ├── TpSvcConnectionInterfaceLocation
    ├── TpSvcConnectionInterfaceMailNotification
    ├── TpSvcConnectionInterfacePowerSaving
    ├── TpSvcConnectionInterfacePresence
    ├── TpSvcConnectionInterfaceRenaming
    ├── TpSvcConnectionInterfaceRequests
    ├── TpSvcConnectionInterfaceSidecars1
    ╰── TpSvcConnectionInterfaceSimplePresence

Known Implementations

TpSvcConnection is implemented by TpBaseConnection.

TpSvcConnectionInterfaceRequests is implemented by TpBaseConnection.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

These interfaces (auto-generated from the Telepathy spec) make it easier to export objects implementing the Telepathy Connection and its optional interfaces, with the correct method and signal signatures, and emit signals from those objects in a type-safe way.

Functions

tp_svc_connection_connect_impl ()

void
(*tp_svc_connection_connect_impl) (TpSvcConnection *self,
                                   DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Connect on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_connect ()

void
tp_svc_connection_implement_connect (TpSvcConnectionClass *klass,
                                     tp_svc_connection_connect_impl impl);

Register an implementation for the Connect method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Connect D-Bus method

 

tp_svc_connection_return_from_connect ()

void
tp_svc_connection_return_from_connect (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_disconnect_impl ()

void
(*tp_svc_connection_disconnect_impl) (TpSvcConnection *self,
                                      DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Disconnect on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_disconnect ()

void
tp_svc_connection_implement_disconnect
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_disconnect_impl impl);

Register an implementation for the Disconnect method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Disconnect D-Bus method

 

tp_svc_connection_return_from_disconnect ()

void
tp_svc_connection_return_from_disconnect
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_get_interfaces_impl ()

void
(*tp_svc_connection_get_interfaces_impl)
                               (TpSvcConnection *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetInterfaces on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_get_interfaces ()

void
tp_svc_connection_implement_get_interfaces
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_get_interfaces_impl impl);

Register an implementation for the GetInterfaces method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetInterfaces D-Bus method

 

tp_svc_connection_return_from_get_interfaces ()

void
tp_svc_connection_return_from_get_interfaces
                               (DBusGMethodInvocation *context,
                                const gchar **out_Interfaces);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Interfaces

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_get_protocol_impl ()

void
(*tp_svc_connection_get_protocol_impl)
                               (TpSvcConnection *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetProtocol on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_get_protocol ()

void
tp_svc_connection_implement_get_protocol
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_get_protocol_impl impl);

Register an implementation for the GetProtocol method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetProtocol D-Bus method

 

tp_svc_connection_return_from_get_protocol ()

void
tp_svc_connection_return_from_get_protocol
                               (DBusGMethodInvocation *context,
                                const gchar *out_Protocol);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Protocol

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_get_self_handle_impl ()

void
(*tp_svc_connection_get_self_handle_impl)
                               (TpSvcConnection *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetSelfHandle on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_get_self_handle ()

void
tp_svc_connection_implement_get_self_handle
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_get_self_handle_impl impl);

Register an implementation for the GetSelfHandle method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetSelfHandle D-Bus method

 

tp_svc_connection_return_from_get_self_handle ()

void
tp_svc_connection_return_from_get_self_handle
                               (DBusGMethodInvocation *context,
                                guint out_Self_Handle);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Self_Handle

guint (FIXME, generate documentation)

 

tp_svc_connection_get_status_impl ()

void
(*tp_svc_connection_get_status_impl) (TpSvcConnection *self,
                                      DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetStatus on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_get_status ()

void
tp_svc_connection_implement_get_status
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_get_status_impl impl);

Register an implementation for the GetStatus method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetStatus D-Bus method

 

tp_svc_connection_return_from_get_status ()

void
tp_svc_connection_return_from_get_status
                               (DBusGMethodInvocation *context,
                                guint out_Status);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Status

guint (FIXME, generate documentation)

 

tp_svc_connection_hold_handles_impl ()

void
(*tp_svc_connection_hold_handles_impl)
                               (TpSvcConnection *self,
                                guint in_Handle_Type,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method HoldHandles on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Handle_Type

guint (FIXME, generate documentation)

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_hold_handles ()

void
tp_svc_connection_implement_hold_handles
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_hold_handles_impl impl);

Register an implementation for the HoldHandles method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the HoldHandles D-Bus method

 

tp_svc_connection_return_from_hold_handles ()

void
tp_svc_connection_return_from_hold_handles
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_inspect_handles_impl ()

void
(*tp_svc_connection_inspect_handles_impl)
                               (TpSvcConnection *self,
                                guint in_Handle_Type,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method InspectHandles on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Handle_Type

guint (FIXME, generate documentation)

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_inspect_handles ()

void
tp_svc_connection_implement_inspect_handles
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_inspect_handles_impl impl);

Register an implementation for the InspectHandles method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the InspectHandles D-Bus method

 

tp_svc_connection_return_from_inspect_handles ()

void
tp_svc_connection_return_from_inspect_handles
                               (DBusGMethodInvocation *context,
                                const gchar **out_Identifiers);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Identifiers

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_list_channels_impl ()

void
(*tp_svc_connection_list_channels_impl)
                               (TpSvcConnection *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListChannels on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_list_channels ()

void
tp_svc_connection_implement_list_channels
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_list_channels_impl impl);

Register an implementation for the ListChannels method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListChannels D-Bus method

 

tp_svc_connection_return_from_list_channels ()

void
tp_svc_connection_return_from_list_channels
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Channel_Info);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Channel_Info

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_release_handles_impl ()

void
(*tp_svc_connection_release_handles_impl)
                               (TpSvcConnection *self,
                                guint in_Handle_Type,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ReleaseHandles on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Handle_Type

guint (FIXME, generate documentation)

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_release_handles ()

void
tp_svc_connection_implement_release_handles
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_release_handles_impl impl);

Register an implementation for the ReleaseHandles method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ReleaseHandles D-Bus method

 

tp_svc_connection_return_from_release_handles ()

void
tp_svc_connection_return_from_release_handles
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_request_channel_impl ()

void
(*tp_svc_connection_request_channel_impl)
                               (TpSvcConnection *self,
                                const gchar *in_Type,
                                guint in_Handle_Type,
                                guint in_Handle,
                                gboolean in_Suppress_Handler,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestChannel on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Type

const gchar * (FIXME, generate documentation)

 

in_Handle_Type

guint (FIXME, generate documentation)

 

in_Handle

guint (FIXME, generate documentation)

 

in_Suppress_Handler

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_request_channel ()

void
tp_svc_connection_implement_request_channel
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_request_channel_impl impl);

Register an implementation for the RequestChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestChannel D-Bus method

 

tp_svc_connection_return_from_request_channel ()

void
tp_svc_connection_return_from_request_channel
                               (DBusGMethodInvocation *context,
                                const gchar *out_Object_Path);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Object_Path

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_request_handles_impl ()

void
(*tp_svc_connection_request_handles_impl)
                               (TpSvcConnection *self,
                                guint in_Handle_Type,
                                const gchar **in_Identifiers,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestHandles on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Handle_Type

guint (FIXME, generate documentation)

 

in_Identifiers

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_request_handles ()

void
tp_svc_connection_implement_request_handles
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_request_handles_impl impl);

Register an implementation for the RequestHandles method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestHandles D-Bus method

 

tp_svc_connection_return_from_request_handles ()

void
tp_svc_connection_return_from_request_handles
                               (DBusGMethodInvocation *context,
                                const GArray *out_Handles);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Handles

const GArray * (FIXME, generate documentation)

 

tp_svc_connection_emit_new_channel ()

void
tp_svc_connection_emit_new_channel (gpointer instance,
                                    const gchar *arg_Object_Path,
                                    const gchar *arg_Channel_Type,
                                    guint arg_Handle_Type,
                                    guint arg_Handle,
                                    gboolean arg_Suppress_Handler);

Type-safe wrapper around g_signal_emit to emit the NewChannel signal on interface org.freedesktop.Telepathy.Connection.

Parameters

instance

The object implementing this interface

 

arg_Object_Path

const gchar * (FIXME, generate documentation)

 

arg_Channel_Type

const gchar * (FIXME, generate documentation)

 

arg_Handle_Type

guint (FIXME, generate documentation)

 

arg_Handle

guint (FIXME, generate documentation)

 

arg_Suppress_Handler

gboolean (FIXME, generate documentation)

 

tp_svc_connection_emit_self_handle_changed ()

void
tp_svc_connection_emit_self_handle_changed
                               (gpointer instance,
                                guint arg_Self_Handle);

Type-safe wrapper around g_signal_emit to emit the SelfHandleChanged signal on interface org.freedesktop.Telepathy.Connection.

Parameters

instance

The object implementing this interface

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

tp_svc_connection_emit_self_contact_changed ()

void
tp_svc_connection_emit_self_contact_changed
                               (gpointer instance,
                                guint arg_Self_Handle,
                                const gchar *arg_Self_ID);

Type-safe wrapper around g_signal_emit to emit the SelfContactChanged signal on interface org.freedesktop.Telepathy.Connection.

Parameters

instance

The object implementing this interface

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

arg_Self_ID

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_emit_status_changed ()

void
tp_svc_connection_emit_status_changed (gpointer instance,
                                       guint arg_Status,
                                       guint arg_Reason);

Type-safe wrapper around g_signal_emit to emit the StatusChanged signal on interface org.freedesktop.Telepathy.Connection.

Parameters

instance

The object implementing this interface

 

arg_Status

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

tp_svc_connection_emit_connection_error ()

void
tp_svc_connection_emit_connection_error
                               (gpointer instance,
                                const gchar *arg_Error,
                                GHashTable *arg_Details);

Type-safe wrapper around g_signal_emit to emit the ConnectionError signal on interface org.freedesktop.Telepathy.Connection.

Parameters

instance

The object implementing this interface

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_add_client_interest_impl ()

void
(*tp_svc_connection_add_client_interest_impl)
                               (TpSvcConnection *self,
                                const gchar **in_Tokens,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddClientInterest on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Tokens

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_implement_add_client_interest ()

void
tp_svc_connection_implement_add_client_interest
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_add_client_interest_impl impl);

Register an implementation for the AddClientInterest method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddClientInterest D-Bus method

 

tp_svc_connection_implement_remove_client_interest ()

void
tp_svc_connection_implement_remove_client_interest
                               (TpSvcConnectionClass *klass,
                                tp_svc_connection_remove_client_interest_impl impl);

Register an implementation for the RemoveClientInterest method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveClientInterest D-Bus method

 

tp_svc_connection_remove_client_interest_impl ()

void
(*tp_svc_connection_remove_client_interest_impl)
                               (TpSvcConnection *self,
                                const gchar **in_Tokens,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveClientInterest on interface org.freedesktop.Telepathy.Connection.

Parameters

self

The object implementing this interface

 

in_Tokens

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_return_from_add_client_interest ()

void
tp_svc_connection_return_from_add_client_interest
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_return_from_remove_client_interest ()

void
tp_svc_connection_return_from_remove_client_interest
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contacts_get_contact_attributes_impl ()

void
(*tp_svc_connection_interface_contacts_get_contact_attributes_impl)
                               (TpSvcConnectionInterfaceContacts *self,
                                const GArray *in_Handles,
                                const gchar **in_Interfaces,
                                gboolean in_Hold,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactAttributes on interface org.freedesktop.Telepathy.Connection.Interface.Contacts.

Parameters

self

The object implementing this interface

 

in_Handles

const GArray * (FIXME, generate documentation)

 

in_Interfaces

const gchar ** (FIXME, generate documentation)

 

in_Hold

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contacts_implement_get_contact_attributes ()

void
tp_svc_connection_interface_contacts_implement_get_contact_attributes
                               (TpSvcConnectionInterfaceContactsClass *klass,
                                tp_svc_connection_interface_contacts_get_contact_attributes_impl impl);

Register an implementation for the GetContactAttributes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactAttributes D-Bus method

 

tp_svc_connection_interface_contacts_return_from_get_contact_attributes ()

void
tp_svc_connection_interface_contacts_return_from_get_contact_attributes
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Attributes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Attributes

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contacts_get_contact_by_id_impl ()

void
(*tp_svc_connection_interface_contacts_get_contact_by_id_impl)
                               (TpSvcConnectionInterfaceContacts *self,
                                const gchar *in_Identifier,
                                const gchar **in_Interfaces,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactByID on interface org.freedesktop.Telepathy.Connection.Interface.Contacts.

Parameters

self

The object implementing this interface

 

in_Identifier

const gchar * (FIXME, generate documentation)

 

in_Interfaces

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contacts_implement_get_contact_by_id ()

void
tp_svc_connection_interface_contacts_implement_get_contact_by_id
                               (TpSvcConnectionInterfaceContactsClass *klass,
                                tp_svc_connection_interface_contacts_get_contact_by_id_impl impl);

Register an implementation for the GetContactByID method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactByID D-Bus method

 

tp_svc_connection_interface_contacts_return_from_get_contact_by_id ()

void
tp_svc_connection_interface_contacts_return_from_get_contact_by_id
                               (DBusGMethodInvocation *context,
                                guint out_Handle,
                                GHashTable *out_Attributes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Handle

guint (FIXME, generate documentation)

 

out_Attributes

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_requests_create_channel_impl ()

void
(*tp_svc_connection_interface_requests_create_channel_impl)
                               (TpSvcConnectionInterfaceRequests *self,
                                GHashTable *in_Request,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CreateChannel on interface org.freedesktop.Telepathy.Connection.Interface.Requests.

Parameters

self

The object implementing this interface

 

in_Request

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_requests_emit_channel_closed ()

void
tp_svc_connection_interface_requests_emit_channel_closed
                               (gpointer instance,
                                const gchar *arg_Removed);

Type-safe wrapper around g_signal_emit to emit the ChannelClosed signal on interface org.freedesktop.Telepathy.Connection.Interface.Requests.

Parameters

instance

The object implementing this interface

 

arg_Removed

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_requests_emit_new_channels ()

void
tp_svc_connection_interface_requests_emit_new_channels
                               (gpointer instance,
                                const GPtrArray *arg_Channels);

Type-safe wrapper around g_signal_emit to emit the NewChannels signal on interface org.freedesktop.Telepathy.Connection.Interface.Requests.

Parameters

instance

The object implementing this interface

 

arg_Channels

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_requests_ensure_channel_impl ()

void
(*tp_svc_connection_interface_requests_ensure_channel_impl)
                               (TpSvcConnectionInterfaceRequests *self,
                                GHashTable *in_Request,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method EnsureChannel on interface org.freedesktop.Telepathy.Connection.Interface.Requests.

Parameters

self

The object implementing this interface

 

in_Request

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_requests_implement_create_channel ()

void
tp_svc_connection_interface_requests_implement_create_channel
                               (TpSvcConnectionInterfaceRequestsClass *klass,
                                tp_svc_connection_interface_requests_create_channel_impl impl);

Register an implementation for the CreateChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CreateChannel D-Bus method

 

tp_svc_connection_interface_requests_implement_ensure_channel ()

void
tp_svc_connection_interface_requests_implement_ensure_channel
                               (TpSvcConnectionInterfaceRequestsClass *klass,
                                tp_svc_connection_interface_requests_ensure_channel_impl impl);

Register an implementation for the EnsureChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the EnsureChannel D-Bus method

 

tp_svc_connection_interface_requests_return_from_create_channel ()

void
tp_svc_connection_interface_requests_return_from_create_channel
                               (DBusGMethodInvocation *context,
                                const gchar *out_Channel,
                                GHashTable *out_Properties);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Channel

const gchar * (FIXME, generate documentation)

 

out_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_requests_return_from_ensure_channel ()

void
tp_svc_connection_interface_requests_return_from_ensure_channel
                               (DBusGMethodInvocation *context,
                                gboolean out_Yours,
                                const gchar *out_Channel,
                                GHashTable *out_Properties);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Yours

gboolean (FIXME, generate documentation)

 

out_Channel

const gchar * (FIXME, generate documentation)

 

out_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_simple_presence_emit_presences_changed ()

void
tp_svc_connection_interface_simple_presence_emit_presences_changed
                               (gpointer instance,
                                GHashTable *arg_Presence);

Type-safe wrapper around g_signal_emit to emit the PresencesChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.SimplePresence.

Parameters

instance

The object implementing this interface

 

arg_Presence

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_simple_presence_get_presences_impl ()

void
(*tp_svc_connection_interface_simple_presence_get_presences_impl)
                               (TpSvcConnectionInterfaceSimplePresence *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetPresences on interface org.freedesktop.Telepathy.Connection.Interface.SimplePresence.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_simple_presence_implement_get_presences ()

void
tp_svc_connection_interface_simple_presence_implement_get_presences
                               (TpSvcConnectionInterfaceSimplePresenceClass *klass,
                                tp_svc_connection_interface_simple_presence_get_presences_impl impl);

Register an implementation for the GetPresences method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetPresences D-Bus method

 

tp_svc_connection_interface_simple_presence_implement_set_presence ()

void
tp_svc_connection_interface_simple_presence_implement_set_presence
                               (TpSvcConnectionInterfaceSimplePresenceClass *klass,
                                tp_svc_connection_interface_simple_presence_set_presence_impl impl);

Register an implementation for the SetPresence method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetPresence D-Bus method

 

tp_svc_connection_interface_simple_presence_return_from_get_presences ()

void
tp_svc_connection_interface_simple_presence_return_from_get_presences
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Presence);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Presence

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_simple_presence_return_from_set_presence ()

void
tp_svc_connection_interface_simple_presence_return_from_set_presence
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_simple_presence_set_presence_impl ()

void
(*tp_svc_connection_interface_simple_presence_set_presence_impl)
                               (TpSvcConnectionInterfaceSimplePresence *self,
                                const gchar *in_Status,
                                const gchar *in_Status_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetPresence on interface org.freedesktop.Telepathy.Connection.Interface.SimplePresence.

Parameters

self

The object implementing this interface

 

in_Status

const gchar * (FIXME, generate documentation)

 

in_Status_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_add_status_impl ()

void
(*tp_svc_connection_interface_presence_add_status_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                const gchar *in_Status,
                                GHashTable *in_Parameters,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddStatus on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Status

const gchar * (FIXME, generate documentation)

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_add_status ()

void
tp_svc_connection_interface_presence_implement_add_status
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_add_status_impl impl);

Register an implementation for the AddStatus method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddStatus D-Bus method

 

tp_svc_connection_interface_presence_return_from_add_status ()

void
tp_svc_connection_interface_presence_return_from_add_status
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_clear_status_impl ()

void
(*tp_svc_connection_interface_presence_clear_status_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ClearStatus on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_clear_status ()

void
tp_svc_connection_interface_presence_implement_clear_status
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_clear_status_impl impl);

Register an implementation for the ClearStatus method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ClearStatus D-Bus method

 

tp_svc_connection_interface_presence_return_from_clear_status ()

void
tp_svc_connection_interface_presence_return_from_clear_status
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_get_presence_impl ()

void
(*tp_svc_connection_interface_presence_get_presence_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetPresence on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_get_presence ()

void
tp_svc_connection_interface_presence_implement_get_presence
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_get_presence_impl impl);

Register an implementation for the GetPresence method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetPresence D-Bus method

 

tp_svc_connection_interface_presence_return_from_get_presence ()

void
tp_svc_connection_interface_presence_return_from_get_presence
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Presence);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Presence

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_presence_get_statuses_impl ()

void
(*tp_svc_connection_interface_presence_get_statuses_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetStatuses on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_get_statuses ()

void
tp_svc_connection_interface_presence_implement_get_statuses
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_get_statuses_impl impl);

Register an implementation for the GetStatuses method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetStatuses D-Bus method

 

tp_svc_connection_interface_presence_return_from_get_statuses ()

void
tp_svc_connection_interface_presence_return_from_get_statuses
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Available_Statuses);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Available_Statuses

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_presence_remove_status_impl ()

void
(*tp_svc_connection_interface_presence_remove_status_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                const gchar *in_Status,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveStatus on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Status

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_remove_status ()

void
tp_svc_connection_interface_presence_implement_remove_status
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_remove_status_impl impl);

Register an implementation for the RemoveStatus method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveStatus D-Bus method

 

tp_svc_connection_interface_presence_return_from_remove_status ()

void
tp_svc_connection_interface_presence_return_from_remove_status
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_request_presence_impl ()

void
(*tp_svc_connection_interface_presence_request_presence_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestPresence on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_request_presence ()

void
tp_svc_connection_interface_presence_implement_request_presence
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_request_presence_impl impl);

Register an implementation for the RequestPresence method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestPresence D-Bus method

 

tp_svc_connection_interface_presence_return_from_request_presence ()

void
tp_svc_connection_interface_presence_return_from_request_presence
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_set_last_activity_time_impl ()

void
(*tp_svc_connection_interface_presence_set_last_activity_time_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                guint in_Time,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetLastActivityTime on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Time

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_set_last_activity_time ()

void
tp_svc_connection_interface_presence_implement_set_last_activity_time
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_set_last_activity_time_impl impl);

Register an implementation for the SetLastActivityTime method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetLastActivityTime D-Bus method

 

tp_svc_connection_interface_presence_return_from_set_last_activity_time ()

void
tp_svc_connection_interface_presence_return_from_set_last_activity_time
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_set_status_impl ()

void
(*tp_svc_connection_interface_presence_set_status_impl)
                               (TpSvcConnectionInterfacePresence *self,
                                GHashTable *in_Statuses,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetStatus on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

self

The object implementing this interface

 

in_Statuses

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_presence_implement_set_status ()

void
tp_svc_connection_interface_presence_implement_set_status
                               (TpSvcConnectionInterfacePresenceClass *klass,
                                tp_svc_connection_interface_presence_set_status_impl impl);

Register an implementation for the SetStatus method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetStatus D-Bus method

 

tp_svc_connection_interface_presence_return_from_set_status ()

void
tp_svc_connection_interface_presence_return_from_set_status
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_presence_emit_presence_update ()

void
tp_svc_connection_interface_presence_emit_presence_update
                               (gpointer instance,
                                GHashTable *arg_Presence);

Type-safe wrapper around g_signal_emit to emit the PresenceUpdate signal on interface org.freedesktop.Telepathy.Connection.Interface.Presence.

Parameters

instance

The object implementing this interface

 

arg_Presence

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_clear_avatar_impl ()

void
(*tp_svc_connection_interface_avatars_clear_avatar_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ClearAvatar on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_clear_avatar ()

void
tp_svc_connection_interface_avatars_implement_clear_avatar
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_clear_avatar_impl impl);

Register an implementation for the ClearAvatar method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ClearAvatar D-Bus method

 

tp_svc_connection_interface_avatars_return_from_clear_avatar ()

void
tp_svc_connection_interface_avatars_return_from_clear_avatar
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_avatars_get_avatar_requirements_impl ()

void
(*tp_svc_connection_interface_avatars_get_avatar_requirements_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAvatarRequirements on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_get_avatar_requirements ()

void
tp_svc_connection_interface_avatars_implement_get_avatar_requirements
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_get_avatar_requirements_impl impl);

Register an implementation for the GetAvatarRequirements method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAvatarRequirements D-Bus method

 

tp_svc_connection_interface_avatars_return_from_get_avatar_requirements ()

void
tp_svc_connection_interface_avatars_return_from_get_avatar_requirements
                               (DBusGMethodInvocation *context,
                                const gchar **out_MIME_Types,
                                guint out_Min_Width,
                                guint out_Min_Height,
                                guint out_Max_Width,
                                guint out_Max_Height,
                                guint out_Max_Bytes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_MIME_Types

const gchar ** (FIXME, generate documentation)

 

out_Min_Width

guint (FIXME, generate documentation)

 

out_Min_Height

guint (FIXME, generate documentation)

 

out_Max_Width

guint (FIXME, generate documentation)

 

out_Max_Height

guint (FIXME, generate documentation)

 

out_Max_Bytes

guint (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_get_avatar_tokens_impl ()

void
(*tp_svc_connection_interface_avatars_get_avatar_tokens_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAvatarTokens on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_get_avatar_tokens ()

void
tp_svc_connection_interface_avatars_implement_get_avatar_tokens
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_get_avatar_tokens_impl impl);

Register an implementation for the GetAvatarTokens method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAvatarTokens D-Bus method

 

tp_svc_connection_interface_avatars_return_from_get_avatar_tokens ()

void
tp_svc_connection_interface_avatars_return_from_get_avatar_tokens
                               (DBusGMethodInvocation *context,
                                const gchar **out_Tokens);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Tokens

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_request_avatar_impl ()

void
(*tp_svc_connection_interface_avatars_request_avatar_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                guint in_Contact,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestAvatar on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_request_avatar ()

void
tp_svc_connection_interface_avatars_implement_request_avatar
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_request_avatar_impl impl);

Register an implementation for the RequestAvatar method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestAvatar D-Bus method

 

tp_svc_connection_interface_avatars_return_from_request_avatar ()

void
tp_svc_connection_interface_avatars_return_from_request_avatar
                               (DBusGMethodInvocation *context,
                                const GArray *out_Data,
                                const gchar *out_MIME_Type);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Data

const GArray * (FIXME, generate documentation)

 

out_MIME_Type

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_set_avatar_impl ()

void
(*tp_svc_connection_interface_avatars_set_avatar_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                const GArray *in_Avatar,
                                const gchar *in_MIME_Type,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetAvatar on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

in_Avatar

const GArray * (FIXME, generate documentation)

 

in_MIME_Type

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_set_avatar ()

void
tp_svc_connection_interface_avatars_implement_set_avatar
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_set_avatar_impl impl);

Register an implementation for the SetAvatar method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetAvatar D-Bus method

 

tp_svc_connection_interface_avatars_return_from_set_avatar ()

void
tp_svc_connection_interface_avatars_return_from_set_avatar
                               (DBusGMethodInvocation *context,
                                const gchar *out_Token);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Token

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_emit_avatar_updated ()

void
tp_svc_connection_interface_avatars_emit_avatar_updated
                               (gpointer instance,
                                guint arg_Contact,
                                const gchar *arg_New_Avatar_Token);

Type-safe wrapper around g_signal_emit to emit the AvatarUpdated signal on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_New_Avatar_Token

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_emit_avatar_retrieved ()

void
tp_svc_connection_interface_avatars_emit_avatar_retrieved
                               (gpointer instance,
                                guint arg_Contact,
                                const gchar *arg_Token,
                                const GArray *arg_Avatar,
                                const gchar *arg_Type);

Type-safe wrapper around g_signal_emit to emit the AvatarRetrieved signal on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Token

const gchar * (FIXME, generate documentation)

 

arg_Avatar

const GArray * (FIXME, generate documentation)

 

arg_Type

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_avatars_implement_request_avatars ()

void
tp_svc_connection_interface_avatars_implement_request_avatars
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_request_avatars_impl impl);

Register an implementation for the RequestAvatars method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestAvatars D-Bus method

 

tp_svc_connection_interface_avatars_request_avatars_impl ()

void
(*tp_svc_connection_interface_avatars_request_avatars_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestAvatars on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_return_from_request_avatars ()

void
tp_svc_connection_interface_avatars_return_from_request_avatars
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_avatars_get_known_avatar_tokens_impl ()

void
(*tp_svc_connection_interface_avatars_get_known_avatar_tokens_impl)
                               (TpSvcConnectionInterfaceAvatars *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetKnownAvatarTokens on interface org.freedesktop.Telepathy.Connection.Interface.Avatars.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_avatars_implement_get_known_avatar_tokens ()

void
tp_svc_connection_interface_avatars_implement_get_known_avatar_tokens
                               (TpSvcConnectionInterfaceAvatarsClass *klass,
                                tp_svc_connection_interface_avatars_get_known_avatar_tokens_impl impl);

Register an implementation for the GetKnownAvatarTokens method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetKnownAvatarTokens D-Bus method

 

tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ()

void
tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Tokens);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Tokens

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_aliasing_get_alias_flags_impl ()

void
(*tp_svc_connection_interface_aliasing_get_alias_flags_impl)
                               (TpSvcConnectionInterfaceAliasing *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAliasFlags on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_aliasing_implement_get_alias_flags ()

void
tp_svc_connection_interface_aliasing_implement_get_alias_flags
                               (TpSvcConnectionInterfaceAliasingClass *klass,
                                tp_svc_connection_interface_aliasing_get_alias_flags_impl impl);

Register an implementation for the GetAliasFlags method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAliasFlags D-Bus method

 

tp_svc_connection_interface_aliasing_return_from_get_alias_flags ()

void
tp_svc_connection_interface_aliasing_return_from_get_alias_flags
                               (DBusGMethodInvocation *context,
                                guint out_Alias_Flags);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Alias_Flags

guint (FIXME, generate documentation)

 

tp_svc_connection_interface_aliasing_request_aliases_impl ()

void
(*tp_svc_connection_interface_aliasing_request_aliases_impl)
                               (TpSvcConnectionInterfaceAliasing *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestAliases on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_aliasing_implement_request_aliases ()

void
tp_svc_connection_interface_aliasing_implement_request_aliases
                               (TpSvcConnectionInterfaceAliasingClass *klass,
                                tp_svc_connection_interface_aliasing_request_aliases_impl impl);

Register an implementation for the RequestAliases method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestAliases D-Bus method

 

tp_svc_connection_interface_aliasing_return_from_request_aliases ()

void
tp_svc_connection_interface_aliasing_return_from_request_aliases
                               (DBusGMethodInvocation *context,
                                const gchar **out_Aliases);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Aliases

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_aliasing_get_aliases_impl ()

void
(*tp_svc_connection_interface_aliasing_get_aliases_impl)
                               (TpSvcConnectionInterfaceAliasing *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAliases on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_aliasing_implement_get_aliases ()

void
tp_svc_connection_interface_aliasing_implement_get_aliases
                               (TpSvcConnectionInterfaceAliasingClass *klass,
                                tp_svc_connection_interface_aliasing_get_aliases_impl impl);

Register an implementation for the GetAliases method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAliases D-Bus method

 

tp_svc_connection_interface_aliasing_return_from_get_aliases ()

void
tp_svc_connection_interface_aliasing_return_from_get_aliases
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Aliases);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Aliases

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_aliasing_set_aliases_impl ()

void
(*tp_svc_connection_interface_aliasing_set_aliases_impl)
                               (TpSvcConnectionInterfaceAliasing *self,
                                GHashTable *in_Aliases,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetAliases on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing.

Parameters

self

The object implementing this interface

 

in_Aliases

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_aliasing_implement_set_aliases ()

void
tp_svc_connection_interface_aliasing_implement_set_aliases
                               (TpSvcConnectionInterfaceAliasingClass *klass,
                                tp_svc_connection_interface_aliasing_set_aliases_impl impl);

Register an implementation for the SetAliases method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetAliases D-Bus method

 

tp_svc_connection_interface_aliasing_return_from_set_aliases ()

void
tp_svc_connection_interface_aliasing_return_from_set_aliases
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_aliasing_emit_aliases_changed ()

void
tp_svc_connection_interface_aliasing_emit_aliases_changed
                               (gpointer instance,
                                const GPtrArray *arg_Aliases);

Type-safe wrapper around g_signal_emit to emit the AliasesChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.Aliasing.

Parameters

instance

The object implementing this interface

 

arg_Aliases

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_balance_emit_balance_changed ()

void
tp_svc_connection_interface_balance_emit_balance_changed
                               (gpointer instance,
                                const GValueArray *arg_Balance);

Type-safe wrapper around g_signal_emit to emit the BalanceChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.Balance.

Parameters

instance

The object implementing this interface

 

arg_Balance

const GValueArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_capabilities_advertise_capabilities_impl ()

void
(*tp_svc_connection_interface_capabilities_advertise_capabilities_impl)
                               (TpSvcConnectionInterfaceCapabilities *self,
                                const GPtrArray *in_Add,
                                const gchar **in_Remove,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AdvertiseCapabilities on interface org.freedesktop.Telepathy.Connection.Interface.Capabilities.

Parameters

self

The object implementing this interface

 

in_Add

const GPtrArray * (FIXME, generate documentation)

 

in_Remove

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_capabilities_implement_advertise_capabilities ()

void
tp_svc_connection_interface_capabilities_implement_advertise_capabilities
                               (TpSvcConnectionInterfaceCapabilitiesClass *klass,
                                tp_svc_connection_interface_capabilities_advertise_capabilities_impl impl);

Register an implementation for the AdvertiseCapabilities method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AdvertiseCapabilities D-Bus method

 

tp_svc_connection_interface_capabilities_return_from_advertise_capabilities ()

void
tp_svc_connection_interface_capabilities_return_from_advertise_capabilities
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Self_Capabilities);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Self_Capabilities

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_capabilities_get_capabilities_impl ()

void
(*tp_svc_connection_interface_capabilities_get_capabilities_impl)
                               (TpSvcConnectionInterfaceCapabilities *self,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetCapabilities on interface org.freedesktop.Telepathy.Connection.Interface.Capabilities.

Parameters

self

The object implementing this interface

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_capabilities_implement_get_capabilities ()

void
tp_svc_connection_interface_capabilities_implement_get_capabilities
                               (TpSvcConnectionInterfaceCapabilitiesClass *klass,
                                tp_svc_connection_interface_capabilities_get_capabilities_impl impl);

Register an implementation for the GetCapabilities method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetCapabilities D-Bus method

 

tp_svc_connection_interface_capabilities_return_from_get_capabilities ()

void
tp_svc_connection_interface_capabilities_return_from_get_capabilities
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Contact_Capabilities);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Contact_Capabilities

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_capabilities_emit_capabilities_changed ()

void
tp_svc_connection_interface_capabilities_emit_capabilities_changed
                               (gpointer instance,
                                const GPtrArray *arg_Caps);

Type-safe wrapper around g_signal_emit to emit the CapabilitiesChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.Capabilities.

Parameters

instance

The object implementing this interface

 

arg_Caps

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed ()

void
tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed
                               (gpointer instance,
                                GHashTable *arg_caps);

Type-safe wrapper around g_signal_emit to emit the ContactCapabilitiesChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.

Parameters

instance

The object implementing this interface

 

arg_caps

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_capabilities_get_contact_capabilities_impl ()

void
(*tp_svc_connection_interface_contact_capabilities_get_contact_capabilities_impl)
                               (TpSvcConnectionInterfaceContactCapabilities *self,
                                const GArray *in_Handles,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactCapabilities on interface org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.

Parameters

self

The object implementing this interface

 

in_Handles

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities ()

void
tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Contact_Capabilities);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Contact_Capabilities

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_capabilities_implement_get_contact_capabilities ()

void
tp_svc_connection_interface_contact_capabilities_implement_get_contact_capabilities
                               (TpSvcConnectionInterfaceContactCapabilitiesClass *klass,
                                tp_svc_connection_interface_contact_capabilities_get_contact_capabilities_impl impl);

Register an implementation for the GetContactCapabilities method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactCapabilities D-Bus method

 

tp_svc_connection_interface_contact_capabilities_update_capabilities_impl ()

void
(*tp_svc_connection_interface_contact_capabilities_update_capabilities_impl)
                               (TpSvcConnectionInterfaceContactCapabilities *self,
                                const GPtrArray *in_Handler_Capabilities,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UpdateCapabilities on interface org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities.

Parameters

self

The object implementing this interface

 

in_Handler_Capabilities

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_capabilities_return_from_update_capabilities ()

void
tp_svc_connection_interface_contact_capabilities_return_from_update_capabilities
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_capabilities_implement_update_capabilities ()

void
tp_svc_connection_interface_contact_capabilities_implement_update_capabilities
                               (TpSvcConnectionInterfaceContactCapabilitiesClass *klass,
                                tp_svc_connection_interface_contact_capabilities_update_capabilities_impl impl);

Register an implementation for the UpdateCapabilities method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UpdateCapabilities D-Bus method

 

tp_svc_connection_interface_location_emit_location_updated ()

void
tp_svc_connection_interface_location_emit_location_updated
                               (gpointer instance,
                                guint arg_Contact,
                                GHashTable *arg_Location);

Type-safe wrapper around g_signal_emit to emit the LocationUpdated signal on interface org.freedesktop.Telepathy.Connection.Interface.Location.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Location

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_location_get_locations_impl ()

void
(*tp_svc_connection_interface_location_get_locations_impl)
                               (TpSvcConnectionInterfaceLocation *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetLocations on interface org.freedesktop.Telepathy.Connection.Interface.Location.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_location_return_from_get_locations ()

void
tp_svc_connection_interface_location_return_from_get_locations
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Locations);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Locations

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_location_implement_get_locations ()

void
tp_svc_connection_interface_location_implement_get_locations
                               (TpSvcConnectionInterfaceLocationClass *klass,
                                tp_svc_connection_interface_location_get_locations_impl impl);

Register an implementation for the GetLocations method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetLocations D-Bus method

 

tp_svc_connection_interface_location_request_location_impl ()

void
(*tp_svc_connection_interface_location_request_location_impl)
                               (TpSvcConnectionInterfaceLocation *self,
                                guint in_Contact,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestLocation on interface org.freedesktop.Telepathy.Connection.Interface.Location.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_location_return_from_request_location ()

void
tp_svc_connection_interface_location_return_from_request_location
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Location);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Location

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_location_implement_request_location ()

void
tp_svc_connection_interface_location_implement_request_location
                               (TpSvcConnectionInterfaceLocationClass *klass,
                                tp_svc_connection_interface_location_request_location_impl impl);

Register an implementation for the RequestLocation method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestLocation D-Bus method

 

tp_svc_connection_interface_location_set_location_impl ()

void
(*tp_svc_connection_interface_location_set_location_impl)
                               (TpSvcConnectionInterfaceLocation *self,
                                GHashTable *in_Location,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetLocation on interface org.freedesktop.Telepathy.Connection.Interface.Location.

Parameters

self

The object implementing this interface

 

in_Location

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_location_return_from_set_location ()

void
tp_svc_connection_interface_location_return_from_set_location
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_location_implement_set_location ()

void
tp_svc_connection_interface_location_implement_set_location
                               (TpSvcConnectionInterfaceLocationClass *klass,
                                tp_svc_connection_interface_location_set_location_impl impl);

Register an implementation for the SetLocation method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetLocation D-Bus method

 

tp_svc_connection_interface_contact_info_emit_contact_info_changed ()

void
tp_svc_connection_interface_contact_info_emit_contact_info_changed
                               (gpointer instance,
                                guint arg_Contact,
                                const GPtrArray *arg_ContactInfo);

Type-safe wrapper around g_signal_emit to emit the ContactInfoChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactInfo.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_ContactInfo

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_info_get_contact_info_impl ()

void
(*tp_svc_connection_interface_contact_info_get_contact_info_impl)
                               (TpSvcConnectionInterfaceContactInfo *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactInfo on interface org.freedesktop.Telepathy.Connection.Interface.ContactInfo.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_info_implement_get_contact_info ()

void
tp_svc_connection_interface_contact_info_implement_get_contact_info
                               (TpSvcConnectionInterfaceContactInfoClass *klass,
                                tp_svc_connection_interface_contact_info_get_contact_info_impl impl);

Register an implementation for the GetContactInfo method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactInfo D-Bus method

 

tp_svc_connection_interface_contact_info_implement_refresh_contact_info ()

void
tp_svc_connection_interface_contact_info_implement_refresh_contact_info
                               (TpSvcConnectionInterfaceContactInfoClass *klass,
                                tp_svc_connection_interface_contact_info_refresh_contact_info_impl impl);

Register an implementation for the RefreshContactInfo method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RefreshContactInfo D-Bus method

 

tp_svc_connection_interface_contact_info_implement_request_contact_info ()

void
tp_svc_connection_interface_contact_info_implement_request_contact_info
                               (TpSvcConnectionInterfaceContactInfoClass *klass,
                                tp_svc_connection_interface_contact_info_request_contact_info_impl impl);

Register an implementation for the RequestContactInfo method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestContactInfo D-Bus method

 

tp_svc_connection_interface_contact_info_implement_set_contact_info ()

void
tp_svc_connection_interface_contact_info_implement_set_contact_info
                               (TpSvcConnectionInterfaceContactInfoClass *klass,
                                tp_svc_connection_interface_contact_info_set_contact_info_impl impl);

Register an implementation for the SetContactInfo method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetContactInfo D-Bus method

 

tp_svc_connection_interface_contact_info_refresh_contact_info_impl ()

void
(*tp_svc_connection_interface_contact_info_refresh_contact_info_impl)
                               (TpSvcConnectionInterfaceContactInfo *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RefreshContactInfo on interface org.freedesktop.Telepathy.Connection.Interface.ContactInfo.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_info_request_contact_info_impl ()

void
(*tp_svc_connection_interface_contact_info_request_contact_info_impl)
                               (TpSvcConnectionInterfaceContactInfo *self,
                                guint in_Contact,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestContactInfo on interface org.freedesktop.Telepathy.Connection.Interface.ContactInfo.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_info_return_from_get_contact_info ()

void
tp_svc_connection_interface_contact_info_return_from_get_contact_info
                               (DBusGMethodInvocation *context,
                                GHashTable *out_ContactInfo);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_ContactInfo

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_info_return_from_refresh_contact_info ()

void
tp_svc_connection_interface_contact_info_return_from_refresh_contact_info
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_info_return_from_request_contact_info ()

void
tp_svc_connection_interface_contact_info_return_from_request_contact_info
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Contact_Info);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Contact_Info

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_info_return_from_set_contact_info ()

void
tp_svc_connection_interface_contact_info_return_from_set_contact_info
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_info_set_contact_info_impl ()

void
(*tp_svc_connection_interface_contact_info_set_contact_info_impl)
                               (TpSvcConnectionInterfaceContactInfo *self,
                                const GPtrArray *in_ContactInfo,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetContactInfo on interface org.freedesktop.Telepathy.Connection.Interface.ContactInfo.

Parameters

self

The object implementing this interface

 

in_ContactInfo

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_blocking_block_contacts_impl ()

void
(*tp_svc_connection_interface_contact_blocking_block_contacts_impl)
                               (TpSvcConnectionInterfaceContactBlocking *self,
                                const GArray *in_Contacts,
                                gboolean in_Report_Abusive,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method BlockContacts on interface org.freedesktop.Telepathy.Connection.Interface.ContactBlocking.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

in_Report_Abusive

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed ()

void
tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed
                               (gpointer instance,
                                GHashTable *arg_Blocked_Contacts,
                                GHashTable *arg_Unblocked_Contacts);

Type-safe wrapper around g_signal_emit to emit the BlockedContactsChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactBlocking.

Parameters

instance

The object implementing this interface

 

arg_Blocked_Contacts

GHashTable * (FIXME, generate documentation)

 

arg_Unblocked_Contacts

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_blocking_implement_block_contacts ()

void
tp_svc_connection_interface_contact_blocking_implement_block_contacts
                               (TpSvcConnectionInterfaceContactBlockingClass *klass,
                                tp_svc_connection_interface_contact_blocking_block_contacts_impl impl);

Register an implementation for the BlockContacts method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the BlockContacts D-Bus method

 

tp_svc_connection_interface_contact_blocking_implement_request_blocked_contacts ()

void
tp_svc_connection_interface_contact_blocking_implement_request_blocked_contacts
                               (TpSvcConnectionInterfaceContactBlockingClass *klass,
                                tp_svc_connection_interface_contact_blocking_request_blocked_contacts_impl impl);

Register an implementation for the RequestBlockedContacts method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestBlockedContacts D-Bus method

 

tp_svc_connection_interface_contact_blocking_implement_unblock_contacts ()

void
tp_svc_connection_interface_contact_blocking_implement_unblock_contacts
                               (TpSvcConnectionInterfaceContactBlockingClass *klass,
                                tp_svc_connection_interface_contact_blocking_unblock_contacts_impl impl);

Register an implementation for the UnblockContacts method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UnblockContacts D-Bus method

 

tp_svc_connection_interface_contact_blocking_request_blocked_contacts_impl ()

void
(*tp_svc_connection_interface_contact_blocking_request_blocked_contacts_impl)
                               (TpSvcConnectionInterfaceContactBlocking *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestBlockedContacts on interface org.freedesktop.Telepathy.Connection.Interface.ContactBlocking.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_blocking_return_from_block_contacts ()

void
tp_svc_connection_interface_contact_blocking_return_from_block_contacts
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts ()

void
tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Contacts);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Contacts

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_blocking_return_from_unblock_contacts ()

void
tp_svc_connection_interface_contact_blocking_return_from_unblock_contacts
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_blocking_unblock_contacts_impl ()

void
(*tp_svc_connection_interface_contact_blocking_unblock_contacts_impl)
                               (TpSvcConnectionInterfaceContactBlocking *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UnblockContacts on interface org.freedesktop.Telepathy.Connection.Interface.ContactBlocking.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_add_to_group_impl ()

void
(*tp_svc_connection_interface_contact_groups_add_to_group_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddToGroup on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Group

const gchar * (FIXME, generate documentation)

 

in_Members

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_emit_group_renamed ()

void
tp_svc_connection_interface_contact_groups_emit_group_renamed
                               (gpointer instance,
                                const gchar *arg_Old_Name,
                                const gchar *arg_New_Name);

Type-safe wrapper around g_signal_emit to emit the GroupRenamed signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

instance

The object implementing this interface

 

arg_Old_Name

const gchar * (FIXME, generate documentation)

 

arg_New_Name

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_groups_emit_groups_changed ()

void
tp_svc_connection_interface_contact_groups_emit_groups_changed
                               (gpointer instance,
                                const GArray *arg_Contact,
                                const gchar **arg_Added,
                                const gchar **arg_Removed);

Type-safe wrapper around g_signal_emit to emit the GroupsChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

instance

The object implementing this interface

 

arg_Contact

const GArray * (FIXME, generate documentation)

 

arg_Added

const gchar ** (FIXME, generate documentation)

 

arg_Removed

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_groups_emit_groups_created ()

void
tp_svc_connection_interface_contact_groups_emit_groups_created
                               (gpointer instance,
                                const gchar **arg_Names);

Type-safe wrapper around g_signal_emit to emit the GroupsCreated signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

instance

The object implementing this interface

 

arg_Names

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_groups_emit_groups_removed ()

void
tp_svc_connection_interface_contact_groups_emit_groups_removed
                               (gpointer instance,
                                const gchar **arg_Names);

Type-safe wrapper around g_signal_emit to emit the GroupsRemoved signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

instance

The object implementing this interface

 

arg_Names

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_groups_implement_add_to_group ()

void
tp_svc_connection_interface_contact_groups_implement_add_to_group
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_add_to_group_impl impl);

Register an implementation for the AddToGroup method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddToGroup D-Bus method

 

tp_svc_connection_interface_contact_groups_implement_remove_from_group ()

void
tp_svc_connection_interface_contact_groups_implement_remove_from_group
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_remove_from_group_impl impl);

Register an implementation for the RemoveFromGroup method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveFromGroup D-Bus method

 

tp_svc_connection_interface_contact_groups_implement_remove_group ()

void
tp_svc_connection_interface_contact_groups_implement_remove_group
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_remove_group_impl impl);

Register an implementation for the RemoveGroup method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveGroup D-Bus method

 

tp_svc_connection_interface_contact_groups_implement_rename_group ()

void
tp_svc_connection_interface_contact_groups_implement_rename_group
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_rename_group_impl impl);

Register an implementation for the RenameGroup method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RenameGroup D-Bus method

 

tp_svc_connection_interface_contact_groups_implement_set_contact_groups ()

void
tp_svc_connection_interface_contact_groups_implement_set_contact_groups
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_set_contact_groups_impl impl);

Register an implementation for the SetContactGroups method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetContactGroups D-Bus method

 

tp_svc_connection_interface_contact_groups_implement_set_group_members ()

void
tp_svc_connection_interface_contact_groups_implement_set_group_members
                               (TpSvcConnectionInterfaceContactGroupsClass *klass,
                                tp_svc_connection_interface_contact_groups_set_group_members_impl impl);

Register an implementation for the SetGroupMembers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetGroupMembers D-Bus method

 

tp_svc_connection_interface_contact_groups_remove_from_group_impl ()

void
(*tp_svc_connection_interface_contact_groups_remove_from_group_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveFromGroup on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Group

const gchar * (FIXME, generate documentation)

 

in_Members

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_remove_group_impl ()

void
(*tp_svc_connection_interface_contact_groups_remove_group_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                const gchar *in_Group,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveGroup on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Group

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_rename_group_impl ()

void
(*tp_svc_connection_interface_contact_groups_rename_group_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                const gchar *in_Old_Name,
                                const gchar *in_New_Name,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RenameGroup on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Old_Name

const gchar * (FIXME, generate documentation)

 

in_New_Name

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_return_from_add_to_group ()

void
tp_svc_connection_interface_contact_groups_return_from_add_to_group
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_return_from_remove_from_group ()

void
tp_svc_connection_interface_contact_groups_return_from_remove_from_group
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_return_from_remove_group ()

void
tp_svc_connection_interface_contact_groups_return_from_remove_group
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_return_from_rename_group ()

void
tp_svc_connection_interface_contact_groups_return_from_rename_group
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_return_from_set_contact_groups ()

void
tp_svc_connection_interface_contact_groups_return_from_set_contact_groups
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_return_from_set_group_members ()

void
tp_svc_connection_interface_contact_groups_return_from_set_group_members
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_groups_set_contact_groups_impl ()

void
(*tp_svc_connection_interface_contact_groups_set_contact_groups_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                guint in_Contact,
                                const gchar **in_Groups,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetContactGroups on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

in_Groups

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_groups_set_group_members_impl ()

void
(*tp_svc_connection_interface_contact_groups_set_group_members_impl)
                               (TpSvcConnectionInterfaceContactGroups *self,
                                const gchar *in_Group,
                                const GArray *in_Members,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetGroupMembers on interface org.freedesktop.Telepathy.Connection.Interface.ContactGroups.

Parameters

self

The object implementing this interface

 

in_Group

const gchar * (FIXME, generate documentation)

 

in_Members

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_authorize_publication_impl ()

void
(*tp_svc_connection_interface_contact_list_authorize_publication_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AuthorizePublication on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_download_impl ()

void
(*tp_svc_connection_interface_contact_list_download_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Download on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_emit_contacts_changed ()

void
tp_svc_connection_interface_contact_list_emit_contacts_changed
                               (gpointer instance,
                                GHashTable *arg_Changes,
                                const GArray *arg_Removals);

Type-safe wrapper around g_signal_emit to emit the ContactsChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

instance

The object implementing this interface

 

arg_Changes

GHashTable * (FIXME, generate documentation)

 

arg_Removals

const GArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id ()

void
tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id
                               (gpointer instance,
                                GHashTable *arg_Changes,
                                GHashTable *arg_Identifiers,
                                GHashTable *arg_Removals);

Type-safe wrapper around g_signal_emit to emit the ContactsChangedWithID signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

instance

The object implementing this interface

 

arg_Changes

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removals

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_list_emit_contact_list_state_changed ()

void
tp_svc_connection_interface_contact_list_emit_contact_list_state_changed
                               (gpointer instance,
                                guint arg_Contact_List_State);

Type-safe wrapper around g_signal_emit to emit the ContactListStateChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

instance

The object implementing this interface

 

arg_Contact_List_State

guint (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_list_get_contact_list_attributes_impl ()

void
(*tp_svc_connection_interface_contact_list_get_contact_list_attributes_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const gchar **in_Interfaces,
                                gboolean in_Hold,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactListAttributes on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Interfaces

const gchar ** (FIXME, generate documentation)

 

in_Hold

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_implement_authorize_publication ()

void
tp_svc_connection_interface_contact_list_implement_authorize_publication
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_authorize_publication_impl impl);

Register an implementation for the AuthorizePublication method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AuthorizePublication D-Bus method

 

tp_svc_connection_interface_contact_list_implement_download ()

void
tp_svc_connection_interface_contact_list_implement_download
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_download_impl impl);

Register an implementation for the Download method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Download D-Bus method

 

tp_svc_connection_interface_contact_list_implement_get_contact_list_attributes ()

void
tp_svc_connection_interface_contact_list_implement_get_contact_list_attributes
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_get_contact_list_attributes_impl impl);

Register an implementation for the GetContactListAttributes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactListAttributes D-Bus method

 

tp_svc_connection_interface_contact_list_implement_remove_contacts ()

void
tp_svc_connection_interface_contact_list_implement_remove_contacts
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_remove_contacts_impl impl);

Register an implementation for the RemoveContacts method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveContacts D-Bus method

 

tp_svc_connection_interface_contact_list_implement_request_subscription ()

void
tp_svc_connection_interface_contact_list_implement_request_subscription
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_request_subscription_impl impl);

Register an implementation for the RequestSubscription method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestSubscription D-Bus method

 

tp_svc_connection_interface_contact_list_implement_unpublish ()

void
tp_svc_connection_interface_contact_list_implement_unpublish
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_unpublish_impl impl);

Register an implementation for the Unpublish method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Unpublish D-Bus method

 

tp_svc_connection_interface_contact_list_implement_unsubscribe ()

void
tp_svc_connection_interface_contact_list_implement_unsubscribe
                               (TpSvcConnectionInterfaceContactListClass *klass,
                                tp_svc_connection_interface_contact_list_unsubscribe_impl impl);

Register an implementation for the Unsubscribe method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Unsubscribe D-Bus method

 

tp_svc_connection_interface_contact_list_remove_contacts_impl ()

void
(*tp_svc_connection_interface_contact_list_remove_contacts_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveContacts on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_request_subscription_impl ()

void
(*tp_svc_connection_interface_contact_list_request_subscription_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestSubscription on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_return_from_authorize_publication ()

void
tp_svc_connection_interface_contact_list_return_from_authorize_publication
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_return_from_download ()

void
tp_svc_connection_interface_contact_list_return_from_download
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes ()

void
tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Attributes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Attributes

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_contact_list_return_from_remove_contacts ()

void
tp_svc_connection_interface_contact_list_return_from_remove_contacts
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_return_from_request_subscription ()

void
tp_svc_connection_interface_contact_list_return_from_request_subscription
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_return_from_unpublish ()

void
tp_svc_connection_interface_contact_list_return_from_unpublish
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_return_from_unsubscribe ()

void
tp_svc_connection_interface_contact_list_return_from_unsubscribe
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_contact_list_unpublish_impl ()

void
(*tp_svc_connection_interface_contact_list_unpublish_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Unpublish on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_contact_list_unsubscribe_impl ()

void
(*tp_svc_connection_interface_contact_list_unsubscribe_impl)
                               (TpSvcConnectionInterfaceContactList *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Unsubscribe on interface org.freedesktop.Telepathy.Connection.Interface.ContactList.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_cellular_emit_imsi_changed ()

void
tp_svc_connection_interface_cellular_emit_imsi_changed
                               (gpointer instance,
                                const gchar *arg_IMSI);

Type-safe wrapper around g_signal_emit to emit the IMSIChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.Cellular.

Parameters

instance

The object implementing this interface

 

arg_IMSI

const gchar * (FIXME, generate documentation)

 

tp_svc_connection_interface_client_types_emit_client_types_updated ()

void
tp_svc_connection_interface_client_types_emit_client_types_updated
                               (gpointer instance,
                                guint arg_Contact,
                                const gchar **arg_Client_Types);

Type-safe wrapper around g_signal_emit to emit the ClientTypesUpdated signal on interface org.freedesktop.Telepathy.Connection.Interface.ClientTypes.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Client_Types

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_client_types_get_client_types_impl ()

void
(*tp_svc_connection_interface_client_types_get_client_types_impl)
                               (TpSvcConnectionInterfaceClientTypes *self,
                                const GArray *in_Contacts,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetClientTypes on interface org.freedesktop.Telepathy.Connection.Interface.ClientTypes.

Parameters

self

The object implementing this interface

 

in_Contacts

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_client_types_implement_get_client_types ()

void
tp_svc_connection_interface_client_types_implement_get_client_types
                               (TpSvcConnectionInterfaceClientTypesClass *klass,
                                tp_svc_connection_interface_client_types_get_client_types_impl impl);

Register an implementation for the GetClientTypes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetClientTypes D-Bus method

 

tp_svc_connection_interface_client_types_implement_request_client_types ()

void
tp_svc_connection_interface_client_types_implement_request_client_types
                               (TpSvcConnectionInterfaceClientTypesClass *klass,
                                tp_svc_connection_interface_client_types_request_client_types_impl impl);

Register an implementation for the RequestClientTypes method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestClientTypes D-Bus method

 

tp_svc_connection_interface_client_types_request_client_types_impl ()

void
(*tp_svc_connection_interface_client_types_request_client_types_impl)
                               (TpSvcConnectionInterfaceClientTypes *self,
                                guint in_Contact,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestClientTypes on interface org.freedesktop.Telepathy.Connection.Interface.ClientTypes.

Parameters

self

The object implementing this interface

 

in_Contact

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_client_types_return_from_get_client_types ()

void
tp_svc_connection_interface_client_types_return_from_get_client_types
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Client_Types);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Client_Types

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_client_types_return_from_request_client_types ()

void
tp_svc_connection_interface_client_types_return_from_request_client_types
                               (DBusGMethodInvocation *context,
                                const gchar **out_Client_Types);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Client_Types

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_mail_notification_emit_mails_received ()

void
tp_svc_connection_interface_mail_notification_emit_mails_received
                               (gpointer instance,
                                const GPtrArray *arg_Mails);

Type-safe wrapper around g_signal_emit to emit the MailsReceived signal on interface org.freedesktop.Telepathy.Connection.Interface.MailNotification.

Parameters

instance

The object implementing this interface

 

arg_Mails

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_mail_notification_emit_unread_mails_changed ()

void
tp_svc_connection_interface_mail_notification_emit_unread_mails_changed
                               (gpointer instance,
                                guint arg_Count,
                                const GPtrArray *arg_Mails_Added,
                                const gchar **arg_Mails_Removed);

Type-safe wrapper around g_signal_emit to emit the UnreadMailsChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.MailNotification.

Parameters

instance

The object implementing this interface

 

arg_Count

guint (FIXME, generate documentation)

 

arg_Mails_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Mails_Removed

const gchar ** (FIXME, generate documentation)

 

tp_svc_connection_interface_mail_notification_implement_request_inbox_url ()

void
tp_svc_connection_interface_mail_notification_implement_request_inbox_url
                               (TpSvcConnectionInterfaceMailNotificationClass *klass,
                                tp_svc_connection_interface_mail_notification_request_inbox_url_impl impl);

Register an implementation for the RequestInboxURL method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestInboxURL D-Bus method

 

tp_svc_connection_interface_mail_notification_implement_request_mail_url ()

void
tp_svc_connection_interface_mail_notification_implement_request_mail_url
                               (TpSvcConnectionInterfaceMailNotificationClass *klass,
                                tp_svc_connection_interface_mail_notification_request_mail_url_impl impl);

Register an implementation for the RequestMailURL method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestMailURL D-Bus method

 

tp_svc_connection_interface_mail_notification_request_inbox_url_impl ()

void
(*tp_svc_connection_interface_mail_notification_request_inbox_url_impl)
                               (TpSvcConnectionInterfaceMailNotification *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestInboxURL on interface org.freedesktop.Telepathy.Connection.Interface.MailNotification.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_mail_notification_request_mail_url_impl ()

void
(*tp_svc_connection_interface_mail_notification_request_mail_url_impl)
                               (TpSvcConnectionInterfaceMailNotification *self,
                                const gchar *in_ID,
                                const GValue *in_URL_Data,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestMailURL on interface org.freedesktop.Telepathy.Connection.Interface.MailNotification.

Parameters

self

The object implementing this interface

 

in_ID

const gchar * (FIXME, generate documentation)

 

in_URL_Data

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_mail_notification_return_from_request_inbox_url ()

void
tp_svc_connection_interface_mail_notification_return_from_request_inbox_url
                               (DBusGMethodInvocation *context,
                                const GValueArray *out_URL);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_URL

const GValueArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_mail_notification_return_from_request_mail_url ()

void
tp_svc_connection_interface_mail_notification_return_from_request_mail_url
                               (DBusGMethodInvocation *context,
                                const GValueArray *out_URL);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_URL

const GValueArray * (FIXME, generate documentation)

 

tp_svc_connection_interface_power_saving_emit_power_saving_changed ()

void
tp_svc_connection_interface_power_saving_emit_power_saving_changed
                               (gpointer instance,
                                gboolean arg_Active);

Type-safe wrapper around g_signal_emit to emit the PowerSavingChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.PowerSaving.

Parameters

instance

The object implementing this interface

 

arg_Active

gboolean (FIXME, generate documentation)

 

tp_svc_connection_interface_power_saving_implement_set_power_saving ()

void
tp_svc_connection_interface_power_saving_implement_set_power_saving
                               (TpSvcConnectionInterfacePowerSavingClass *klass,
                                tp_svc_connection_interface_power_saving_set_power_saving_impl impl);

Register an implementation for the SetPowerSaving method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetPowerSaving D-Bus method

 

tp_svc_connection_interface_power_saving_return_from_set_power_saving ()

void
tp_svc_connection_interface_power_saving_return_from_set_power_saving
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_power_saving_set_power_saving_impl ()

void
(*tp_svc_connection_interface_power_saving_set_power_saving_impl)
                               (TpSvcConnectionInterfacePowerSaving *self,
                                gboolean in_Activate,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetPowerSaving on interface org.freedesktop.Telepathy.Connection.Interface.PowerSaving.

Parameters

self

The object implementing this interface

 

in_Activate

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_addressing_get_contacts_by_uri_impl ()

void
(*tp_svc_connection_interface_addressing_get_contacts_by_uri_impl)
                               (TpSvcConnectionInterfaceAddressing *self,
                                const gchar **in_URIs,
                                const gchar **in_Interfaces,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactsByURI on interface org.freedesktop.Telepathy.Connection.Interface.Addressing1.

Parameters

self

The object implementing this interface

 

in_URIs

const gchar ** (FIXME, generate documentation)

 

in_Interfaces

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_addressing_get_contacts_by_vcard_field_impl ()

void
(*tp_svc_connection_interface_addressing_get_contacts_by_vcard_field_impl)
                               (TpSvcConnectionInterfaceAddressing *self,
                                const gchar *in_Field,
                                const gchar **in_Addresses,
                                const gchar **in_Interfaces,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetContactsByVCardField on interface org.freedesktop.Telepathy.Connection.Interface.Addressing1.

Parameters

self

The object implementing this interface

 

in_Field

const gchar * (FIXME, generate documentation)

 

in_Addresses

const gchar ** (FIXME, generate documentation)

 

in_Interfaces

const gchar ** (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_addressing_implement_get_contacts_by_uri ()

void
tp_svc_connection_interface_addressing_implement_get_contacts_by_uri
                               (TpSvcConnectionInterfaceAddressingClass *klass,
                                tp_svc_connection_interface_addressing_get_contacts_by_uri_impl impl);

Register an implementation for the GetContactsByURI method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactsByURI D-Bus method

 

tp_svc_connection_interface_addressing_implement_get_contacts_by_vcard_field ()

void
tp_svc_connection_interface_addressing_implement_get_contacts_by_vcard_field
                               (TpSvcConnectionInterfaceAddressingClass *klass,
                                tp_svc_connection_interface_addressing_get_contacts_by_vcard_field_impl impl);

Register an implementation for the GetContactsByVCardField method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetContactsByVCardField D-Bus method

 

tp_svc_connection_interface_addressing_return_from_get_contacts_by_uri ()

void
tp_svc_connection_interface_addressing_return_from_get_contacts_by_uri
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Requested,
                                GHashTable *out_Attributes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Requested

GHashTable * (FIXME, generate documentation)

 

out_Attributes

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_addressing_return_from_get_contacts_by_vcard_field ()

void
tp_svc_connection_interface_addressing_return_from_get_contacts_by_vcard_field
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Requested,
                                GHashTable *out_Attributes);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Requested

GHashTable * (FIXME, generate documentation)

 

out_Attributes

GHashTable * (FIXME, generate documentation)

 

tp_svc_connection_interface_renaming_emit_renamed ()

void
tp_svc_connection_interface_renaming_emit_renamed
                               (gpointer instance,
                                guint arg_Original,
                                guint arg_New);

Type-safe wrapper around g_signal_emit to emit the Renamed signal on interface org.freedesktop.Telepathy.Connection.Interface.Renaming.

Parameters

instance

The object implementing this interface

 

arg_Original

guint (FIXME, generate documentation)

 

arg_New

guint (FIXME, generate documentation)

 

tp_svc_connection_interface_renaming_implement_request_rename ()

void
tp_svc_connection_interface_renaming_implement_request_rename
                               (TpSvcConnectionInterfaceRenamingClass *klass,
                                tp_svc_connection_interface_renaming_request_rename_impl impl);

Register an implementation for the RequestRename method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestRename D-Bus method

 

tp_svc_connection_interface_renaming_request_rename_impl ()

void
(*tp_svc_connection_interface_renaming_request_rename_impl)
                               (TpSvcConnectionInterfaceRenaming *self,
                                const gchar *in_Identifier,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestRename on interface org.freedesktop.Telepathy.Connection.Interface.Renaming.

Parameters

self

The object implementing this interface

 

in_Identifier

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_renaming_return_from_request_rename ()

void
tp_svc_connection_interface_renaming_return_from_request_rename
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_connection_interface_sidecars1_ensure_sidecar_impl ()

void
(*tp_svc_connection_interface_sidecars1_ensure_sidecar_impl)
                               (TpSvcConnectionInterfaceSidecars1 *self,
                                const gchar *in_Main_Interface,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method EnsureSidecar on interface org.freedesktop.Telepathy.Connection.Interface.Sidecars1.

Parameters

self

The object implementing this interface

 

in_Main_Interface

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_connection_interface_sidecars1_implement_ensure_sidecar ()

void
tp_svc_connection_interface_sidecars1_implement_ensure_sidecar
                               (TpSvcConnectionInterfaceSidecars1Class *klass,
                                tp_svc_connection_interface_sidecars1_ensure_sidecar_impl impl);

Register an implementation for the EnsureSidecar method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the EnsureSidecar D-Bus method

 

tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar ()

void
tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar
                               (DBusGMethodInvocation *context,
                                const gchar *out_Path,
                                GHashTable *out_Properties);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Path

const gchar * (FIXME, generate documentation)

 

out_Properties

GHashTable * (FIXME, generate documentation)

 

Types and Values

TpSvcConnection

typedef struct _TpSvcConnection TpSvcConnection;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionClass

typedef struct _TpSvcConnectionClass TpSvcConnectionClass;

The class of TpSvcConnection.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (connect);
  IMPLEMENT (disconnect);
  IMPLEMENT (get_interfaces);
  IMPLEMENT (get_protocol);
  IMPLEMENT (get_self_handle);
  IMPLEMENT (get_status);
  IMPLEMENT (hold_handles);
  IMPLEMENT (inspect_handles);
  IMPLEMENT (list_channels);
  IMPLEMENT (release_handles);
  IMPLEMENT (request_channel);
  IMPLEMENT (request_handles);
  IMPLEMENT (add_client_interest);
  IMPLEMENT (remove_client_interest);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContacts

typedef struct _TpSvcConnectionInterfaceContacts TpSvcConnectionInterfaceContacts;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactsClass

typedef struct _TpSvcConnectionInterfaceContactsClass TpSvcConnectionInterfaceContactsClass;

The class of TpSvcConnectionInterfaceContacts.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contacts (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contacts_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_contact_attributes);
  IMPLEMENT (get_contact_by_id);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceRequests

typedef struct _TpSvcConnectionInterfaceRequests TpSvcConnectionInterfaceRequests;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceRequestsClass

typedef struct _TpSvcConnectionInterfaceRequestsClass TpSvcConnectionInterfaceRequestsClass;

The class of TpSvcConnectionInterfaceRequests.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_requests (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_requests_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (create_channel);
  IMPLEMENT (ensure_channel);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceSimplePresence

typedef struct _TpSvcConnectionInterfaceSimplePresence TpSvcConnectionInterfaceSimplePresence;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceSimplePresenceClass

typedef struct _TpSvcConnectionInterfaceSimplePresenceClass TpSvcConnectionInterfaceSimplePresenceClass;

The class of TpSvcConnectionInterfaceSimplePresence.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_simple_presence (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_simple_presence_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_presence);
  IMPLEMENT (get_presences);
#undef IMPLEMENT
}

TpSvcConnectionInterfacePresence

typedef struct _TpSvcConnectionInterfacePresence TpSvcConnectionInterfacePresence;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfacePresenceClass

typedef struct _TpSvcConnectionInterfacePresenceClass TpSvcConnectionInterfacePresenceClass;

The class of TpSvcConnectionInterfacePresence.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_presence (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_presence_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (add_status);
  IMPLEMENT (clear_status);
  IMPLEMENT (get_presence);
  IMPLEMENT (get_statuses);
  IMPLEMENT (remove_status);
  IMPLEMENT (request_presence);
  IMPLEMENT (set_last_activity_time);
  IMPLEMENT (set_status);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceAvatars

typedef struct _TpSvcConnectionInterfaceAvatars TpSvcConnectionInterfaceAvatars;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceAvatarsClass

typedef struct _TpSvcConnectionInterfaceAvatarsClass TpSvcConnectionInterfaceAvatarsClass;

The class of TpSvcConnectionInterfaceAvatars.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_avatars (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_avatars_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_avatar_requirements);
  IMPLEMENT (get_avatar_tokens);
  IMPLEMENT (get_known_avatar_tokens);
  IMPLEMENT (request_avatar);
  IMPLEMENT (request_avatars);
  IMPLEMENT (set_avatar);
  IMPLEMENT (clear_avatar);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceAliasing

typedef struct _TpSvcConnectionInterfaceAliasing TpSvcConnectionInterfaceAliasing;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceAliasingClass

typedef struct _TpSvcConnectionInterfaceAliasingClass TpSvcConnectionInterfaceAliasingClass;

The class of TpSvcConnectionInterfaceAliasing.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_aliasing (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_alias_flags);
  IMPLEMENT (request_aliases);
  IMPLEMENT (get_aliases);
  IMPLEMENT (set_aliases);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceBalance

typedef struct _TpSvcConnectionInterfaceBalance TpSvcConnectionInterfaceBalance;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceBalanceClass

typedef struct _TpSvcConnectionInterfaceBalanceClass TpSvcConnectionInterfaceBalanceClass;

The class of TpSvcConnectionInterfaceBalance. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcConnectionInterfaceCapabilities

typedef struct _TpSvcConnectionInterfaceCapabilities TpSvcConnectionInterfaceCapabilities;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceCapabilitiesClass

typedef struct _TpSvcConnectionInterfaceCapabilitiesClass TpSvcConnectionInterfaceCapabilitiesClass;

The class of TpSvcConnectionInterfaceCapabilities.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_capabilities (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_capabilities_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (advertise_capabilities);
  IMPLEMENT (get_capabilities);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContactCapabilities

typedef struct _TpSvcConnectionInterfaceContactCapabilities TpSvcConnectionInterfaceContactCapabilities;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactCapabilitiesClass

typedef struct _TpSvcConnectionInterfaceContactCapabilitiesClass TpSvcConnectionInterfaceContactCapabilitiesClass;

The class of TpSvcConnectionInterfaceContactCapabilities.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contact_capabilities (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contact_capabilities_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (update_capabilities);
  IMPLEMENT (get_contact_capabilities);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceLocation

typedef struct _TpSvcConnectionInterfaceLocation TpSvcConnectionInterfaceLocation;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceLocationClass

typedef struct _TpSvcConnectionInterfaceLocationClass TpSvcConnectionInterfaceLocationClass;

The class of TpSvcConnectionInterfaceLocation.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_location (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_location_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_locations);
  IMPLEMENT (request_location);
  IMPLEMENT (set_location);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContactInfo

typedef struct _TpSvcConnectionInterfaceContactInfo TpSvcConnectionInterfaceContactInfo;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactInfoClass

typedef struct _TpSvcConnectionInterfaceContactInfoClass TpSvcConnectionInterfaceContactInfoClass;

The class of TpSvcConnectionInterfaceContactInfo.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contact_info (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contact_info_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_contact_info);
  IMPLEMENT (refresh_contact_info);
  IMPLEMENT (request_contact_info);
  IMPLEMENT (set_contact_info);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContactBlocking

typedef struct _TpSvcConnectionInterfaceContactBlocking TpSvcConnectionInterfaceContactBlocking;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactBlockingClass

typedef struct _TpSvcConnectionInterfaceContactBlockingClass TpSvcConnectionInterfaceContactBlockingClass;

The class of TpSvcConnectionInterfaceContactBlocking.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contact_blocking (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contact_blocking_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (block_contacts);
  IMPLEMENT (unblock_contacts);
  IMPLEMENT (request_blocked_contacts);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContactGroups

typedef struct _TpSvcConnectionInterfaceContactGroups TpSvcConnectionInterfaceContactGroups;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactGroupsClass

typedef struct _TpSvcConnectionInterfaceContactGroupsClass TpSvcConnectionInterfaceContactGroupsClass;

The class of TpSvcConnectionInterfaceContactGroups.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contact_groups (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contact_groups_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_contact_groups);
  IMPLEMENT (set_group_members);
  IMPLEMENT (add_to_group);
  IMPLEMENT (remove_from_group);
  IMPLEMENT (remove_group);
  IMPLEMENT (rename_group);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceContactList

typedef struct _TpSvcConnectionInterfaceContactList TpSvcConnectionInterfaceContactList;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceContactListClass

typedef struct _TpSvcConnectionInterfaceContactListClass TpSvcConnectionInterfaceContactListClass;

The class of TpSvcConnectionInterfaceContactList.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_contact_list (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_contact_list_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_contact_list_attributes);
  IMPLEMENT (request_subscription);
  IMPLEMENT (authorize_publication);
  IMPLEMENT (remove_contacts);
  IMPLEMENT (unsubscribe);
  IMPLEMENT (unpublish);
  IMPLEMENT (download);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceCellular

typedef struct _TpSvcConnectionInterfaceCellular TpSvcConnectionInterfaceCellular;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceCellularClass

typedef struct _TpSvcConnectionInterfaceCellularClass TpSvcConnectionInterfaceCellularClass;

The class of TpSvcConnectionInterfaceCellular. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcConnectionInterfaceClientTypes

typedef struct _TpSvcConnectionInterfaceClientTypes TpSvcConnectionInterfaceClientTypes;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceClientTypesClass

typedef struct _TpSvcConnectionInterfaceClientTypesClass TpSvcConnectionInterfaceClientTypesClass;

The class of TpSvcConnectionInterfaceClientTypes.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_client_types (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_client_types_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_client_types);
  IMPLEMENT (request_client_types);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceMailNotification

typedef struct _TpSvcConnectionInterfaceMailNotification TpSvcConnectionInterfaceMailNotification;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceMailNotificationClass

typedef struct _TpSvcConnectionInterfaceMailNotificationClass TpSvcConnectionInterfaceMailNotificationClass;

The class of TpSvcConnectionInterfaceMailNotification.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_mail_notification (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_mail_notification_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (request_inbox_url);
  IMPLEMENT (request_mail_url);
#undef IMPLEMENT
}

TpSvcConnectionInterfacePowerSaving

typedef struct _TpSvcConnectionInterfacePowerSaving TpSvcConnectionInterfacePowerSaving;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfacePowerSavingClass

typedef struct _TpSvcConnectionInterfacePowerSavingClass TpSvcConnectionInterfacePowerSavingClass;

The class of TpSvcConnectionInterfacePowerSaving.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_power_saving (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_power_saving_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_power_saving);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceAddressing

typedef struct _TpSvcConnectionInterfaceAddressing TpSvcConnectionInterfaceAddressing;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceAddressingClass

typedef struct _TpSvcConnectionInterfaceAddressingClass TpSvcConnectionInterfaceAddressingClass;

The class of TpSvcConnectionInterfaceAddressing.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_addressing (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_addressing_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_contacts_by_vcard_field);
  IMPLEMENT (get_contacts_by_uri);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceRenaming

typedef struct _TpSvcConnectionInterfaceRenaming TpSvcConnectionInterfaceRenaming;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceRenamingClass

typedef struct _TpSvcConnectionInterfaceRenamingClass TpSvcConnectionInterfaceRenamingClass;

The class of TpSvcConnectionInterfaceRenaming.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_renaming (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_renaming_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (request_rename);
#undef IMPLEMENT
}

TpSvcConnectionInterfaceSidecars1

typedef struct _TpSvcConnectionInterfaceSidecars1 TpSvcConnectionInterfaceSidecars1;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceSidecars1Class

typedef struct _TpSvcConnectionInterfaceSidecars1Class TpSvcConnectionInterfaceSidecars1Class;

The class of TpSvcConnectionInterfaceSidecars1.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_connection_interface_sidecars1 (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_connection_interface_sidecars1_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (ensure_sidecar);
#undef IMPLEMENT
}

Signal Details

The “connection-error” signal

void
user_function (TpSvcConnection *self,
               gchar           *arg_Error,
               gpointer         user_data)

The ConnectionError D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-channel” signal

void
user_function (TpSvcConnection *self,
               DBusGObjectPath *arg_Object_Path,
               gchar           *arg_Channel_Type,
               guint            arg_Handle_Type,
               guint            arg_Handle,
               gboolean         arg_Suppress_Handler,
               gpointer         user_data)

The NewChannel D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Object_Path

const gchar * (FIXME, generate documentation)

 

arg_Channel_Type

const gchar * (FIXME, generate documentation)

 

arg_Handle_Type

guint (FIXME, generate documentation)

 

arg_Handle

guint (FIXME, generate documentation)

 

arg_Suppress_Handler

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “self-contact-changed” signal

void
user_function (TpSvcConnection *self,
               guint            arg_Self_Handle,
               gchar           *arg_Self_ID,
               gpointer         user_data)

The SelfContactChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

arg_Self_ID

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “self-handle-changed” signal

void
user_function (TpSvcConnection *self,
               guint            arg_Self_Handle,
               gpointer         user_data)

The SelfHandleChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “status-changed” signal

void
user_function (TpSvcConnection *self,
               guint            arg_Status,
               guint            arg_Reason,
               gpointer         user_data)

The StatusChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Status

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “channel-closed” signal

void
user_function (TpSvcConnectionInterfaceRequests *self,
               DBusGObjectPath                  *arg_Removed,
               gpointer                          user_data)

The ChannelClosed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Removed

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-channels” signal

void
user_function (TpSvcConnectionInterfaceRequests *self,
               gpointer                          user_data)

The NewChannels D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Channels

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “presences-changed” signal

void
user_function (TpSvcConnectionInterfaceSimplePresence *self,
               gpointer                                user_data)

The PresencesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Presence

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “presence-update” signal

void
user_function (TpSvcConnectionInterfacePresence *self,
               gpointer                          user_data)

The PresenceUpdate D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Presence

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “avatar-retrieved” signal

void
user_function (TpSvcConnectionInterfaceAvatars *self,
               guint                            arg_Contact,
               gchar                           *arg_Token,
               GArray_guchar_                  *arg_Avatar,
               gchar                           *arg_Type,
               gpointer                         user_data)

The AvatarRetrieved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Token

const gchar * (FIXME, generate documentation)

 

arg_Avatar

const GArray * (FIXME, generate documentation)

 

arg_Type

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “avatar-updated” signal

void
user_function (TpSvcConnectionInterfaceAvatars *self,
               guint                            arg_Contact,
               gchar                           *arg_New_Avatar_Token,
               gpointer                         user_data)

The AvatarUpdated D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_New_Avatar_Token

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “aliases-changed” signal

void
user_function (TpSvcConnectionInterfaceAliasing *self,
               gpointer                          user_data)

The AliasesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Aliases

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “balance-changed” signal

void
user_function (TpSvcConnectionInterfaceBalance *self,
               gpointer                         user_data)

The BalanceChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Balance

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “capabilities-changed” signal

void
user_function (TpSvcConnectionInterfaceCapabilities *self,
               gpointer                              user_data)

The CapabilitiesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Caps

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “contact-capabilities-changed” signal

void
user_function (TpSvcConnectionInterfaceContactCapabilities *self,
               gpointer                                     user_data)

The ContactCapabilitiesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_caps

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “location-updated” signal

void
user_function (TpSvcConnectionInterfaceLocation *self,
               guint                             arg_Contact,
               gpointer                          user_data)

The LocationUpdated D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Location

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “contact-info-changed” signal

void
user_function (TpSvcConnectionInterfaceContactInfo *self,
               guint                                arg_Contact,
               gpointer                             user_data)

The ContactInfoChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_ContactInfo

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “blocked-contacts-changed” signal

void
user_function (TpSvcConnectionInterfaceContactBlocking *self,
               gpointer                                 user_data)

The BlockedContactsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Blocked_Contacts

GHashTable * (FIXME, generate documentation)

 

arg_Unblocked_Contacts

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “group-renamed” signal

void
user_function (TpSvcConnectionInterfaceContactGroups *self,
               gchar                                 *arg_Old_Name,
               gchar                                 *arg_New_Name,
               gpointer                               user_data)

The GroupRenamed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Old_Name

const gchar * (FIXME, generate documentation)

 

arg_New_Name

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “groups-changed” signal

void
user_function (TpSvcConnectionInterfaceContactGroups *self,
               GArray_guint_                         *arg_Contact,
               GStrv                                  arg_Added,
               GStrv                                  arg_Removed,
               gpointer                               user_data)

The GroupsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

const GArray * (FIXME, generate documentation)

 

arg_Added

const gchar ** (FIXME, generate documentation)

 

arg_Removed

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “groups-created” signal

void
user_function (TpSvcConnectionInterfaceContactGroups *self,
               GStrv                                  arg_Names,
               gpointer                               user_data)

The GroupsCreated D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Names

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “groups-removed” signal

void
user_function (TpSvcConnectionInterfaceContactGroups *self,
               GStrv                                  arg_Names,
               gpointer                               user_data)

The GroupsRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Names

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “contact-list-state-changed” signal

void
user_function (TpSvcConnectionInterfaceContactList *self,
               guint                                arg_Contact_List_State,
               gpointer                             user_data)

The ContactListStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact_List_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “contacts-changed” signal

void
user_function (TpSvcConnectionInterfaceContactList *self,
               GArray_guint_                       *arg_Removals,
               gpointer                             user_data)

The ContactsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Changes

GHashTable * (FIXME, generate documentation)

 

arg_Removals

const GArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “contacts-changed-with-id” signal

void
user_function (TpSvcConnectionInterfaceContactList *self,
               gpointer                             user_data)

The ContactsChangedWithID D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Changes

GHashTable * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

arg_Removals

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “i-ms-ichanged” signal

void
user_function (TpSvcConnectionInterfaceCellular *self,
               gchar                            *arg_IMSI,
               gpointer                          user_data)

The IMSIChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_IMSI

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “client-types-updated” signal

void
user_function (TpSvcConnectionInterfaceClientTypes *self,
               guint                                arg_Contact,
               GStrv                                arg_Client_Types,
               gpointer                             user_data)

The ClientTypesUpdated D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_Client_Types

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “mails-received” signal

void
user_function (TpSvcConnectionInterfaceMailNotification *self,
               gpointer                                  user_data)

The MailsReceived D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Mails

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “unread-mails-changed” signal

void
user_function (TpSvcConnectionInterfaceMailNotification *self,
               guint                                     arg_Count,
               GStrv                                     arg_Mails_Removed,
               gpointer                                  user_data)

The UnreadMailsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Count

guint (FIXME, generate documentation)

 

arg_Mails_Added

const GPtrArray * (FIXME, generate documentation)

 

arg_Mails_Removed

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “power-saving-changed” signal

void
user_function (TpSvcConnectionInterfacePowerSaving *self,
               gboolean                             arg_Active,
               gpointer                             user_data)

The PowerSavingChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Active

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “renamed” signal

void
user_function (TpSvcConnectionInterfaceRenaming *self,
               guint                             arg_Original,
               guint                             arg_New,
               gpointer                          user_data)

The Renamed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Original

guint (FIXME, generate documentation)

 

arg_New

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpBaseConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib.devhelp20000644000175000017500000374030014006623343021641 00000000000000 telepathy-glib-0.24.2/docs/reference/html/TpChannelFactoryIface.html0000644000175000017500000015150114006623343022312 00000000000000 TpChannelFactoryIface: telepathy-glib API Reference Manual

TpChannelFactoryIface

TpChannelFactoryIface — interface for channel allocation/tracking

Signals

void channel-error Has Details
void new-channel Has Details

Object Hierarchy

    GInterface
    ╰── TpChannelFactoryIface

Includes

#include <telepathy-glib/channel-factory-iface.h>

Description

A channel factory is attached to a connection. It carries out channel requests from the connection, and responds to channel-related events on the underlying network connection (e.g. incoming calls).

Deprecated since version 0.11.7. Use TpChannelManager, a newer interface which can be used to implement modern D-Bus APIs, instead.

Functions

TpChannelFactoryIfaceForeachImpl ()

void
(*TpChannelFactoryIfaceForeachImpl) (TpChannelFactoryIface *self,
                                     TpChannelFunc func,
                                     gpointer data);

TpChannelFactoryIfaceForeachImpl has been deprecated since version 0.11.7 and should not be used in newly-written code.

Signature of an implementation of foreach, which must call func(channel, data) for each channel managed by this factory.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An object implementing TpChannelFactoryIface

 

func

A function

 

data

Arbitrary data to pass to func as the second argument

 

TpChannelFactoryIfaceProc ()

void
(*TpChannelFactoryIfaceProc) (TpChannelFactoryIface *self);

TpChannelFactoryIfaceProc has been deprecated since version 0.11.7 and should not be used in newly-written code.

A virtual method on a channel factory that takes no extra parameters and returns nothing.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An object implementing TpChannelFactoryIface

 

TpChannelFactoryIfaceRequestImpl ()

TpChannelFactoryRequestStatus
(*TpChannelFactoryIfaceRequestImpl) (TpChannelFactoryIface *self,
                                     const gchar *chan_type,
                                     TpHandleType handle_type,
                                     guint handle,
                                     gpointer request,
                                     TpChannelIface **ret,
                                     GError **error);

TpChannelFactoryIfaceRequestImpl has been deprecated since version 0.11.7 and should not be used in newly-written code.

Signature of an implementation of RequestChannel.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An object implementing TpChannelFactoryIface

 

chan_type

The channel type, e.g. TP_IFACE_CHANNEL_TYPE_TEXT

 

handle_type

The handle type of the channel's associated handle, or 0 if the channel has no associated handle

 

handle

The channel's associated handle, of type handle_type , or 0 if the channel has no associated handle

 

request

An opaque data structure representing the channel request; if this request is satisfied by a newly created channel, this structure MUST be included in the new-channel signal if the newly created channel has handle 0, and MAY be included in the signal if the newly created channel has nonzero handle.

 

ret

Set to the new channel if it is available immediately, as documented in the description of TpChannelFactoryRequestStatus

 

error

Set to the error if the return is TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, unset otherwise

 

Returns

one of the values of TpChannelFactoryRequestStatus, and behaves as documented for that return value


tp_channel_factory_iface_close_all ()

void
tp_channel_factory_iface_close_all (TpChannelFactoryIface *self);

tp_channel_factory_iface_close_all has been deprecated since version 0.11.7 and should not be used in newly-written code.

Close all channels and shut down the channel factory. It is not expected to be usable afterwards. This is called when the connection goes to disconnected state, before either emitting the StatusChanged signal or calling disconnected().

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An object implementing TpChannelFactoryIface

 

tp_channel_factory_iface_connecting ()

void
tp_channel_factory_iface_connecting (TpChannelFactoryIface *self);

tp_channel_factory_iface_connecting has been deprecated since version 0.11.7 and should not be used in newly-written code.

Indicate that the connection has gone from disconnected to connecting state.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An implementation of the channel factory interface

 

tp_channel_factory_iface_connected ()

void
tp_channel_factory_iface_connected (TpChannelFactoryIface *self);

tp_channel_factory_iface_connected has been deprecated since version 0.11.7 and should not be used in newly-written code.

Indicate that the connection has gone from connecting to connected state.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An implementation of the channel factory interface

 

tp_channel_factory_iface_disconnected ()

void
tp_channel_factory_iface_disconnected (TpChannelFactoryIface *self);

tp_channel_factory_iface_disconnected has been deprecated since version 0.11.7 and should not be used in newly-written code.

Indicate that the connection has become disconnected.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An implementation of the channel factory interface

 

tp_channel_factory_iface_foreach ()

void
tp_channel_factory_iface_foreach (TpChannelFactoryIface *self,
                                  TpChannelFunc func,
                                  gpointer data);

tp_channel_factory_iface_foreach has been deprecated since version 0.11.7 and should not be used in newly-written code.

Call func(channel, data) for each channel managed by this factory.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An implementation of the channel factory interface

 

func

A callback to be called once per channel

 

data

Extra data to be passed to func

 

tp_channel_factory_iface_request ()

TpChannelFactoryRequestStatus
tp_channel_factory_iface_request (TpChannelFactoryIface *self,
                                  const gchar *chan_type,
                                  TpHandleType handle_type,
                                  guint handle,
                                  gpointer request,
                                  TpChannelIface **ret,
                                  GError **error);

tp_channel_factory_iface_request has been deprecated since version 0.11.7 and should not be used in newly-written code.

Request a channel.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

self

An object implementing TpChannelFactoryIface

 

chan_type

The channel type, e.g. TP_IFACE_CHANNEL_TYPE_TEXT

 

handle_type

The handle type of the channel's associated handle, or 0 if the channel has no associated handle

 

handle

The channel's associated handle, of type handle_type , or 0 if the channel has no associated handle

 

request

An opaque data structure representing the channel request; if this request is satisfied by a newly created channel, this structure MUST be included in the new-channel signal if the newly created channel has handle 0, and MAY be included in the signal if the newly created channel has nonzero handle.

 

ret

Set to the new channel if it is available immediately, as documented in the description of TpChannelFactoryRequestStatus

 

error

Set to the error if the return is TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, unset otherwise

 

Returns

one of the values of TpChannelFactoryRequestStatus, and behaves as documented for that return value


tp_channel_factory_iface_emit_new_channel ()

void
tp_channel_factory_iface_emit_new_channel
                               (gpointer instance,
                                TpChannelIface *channel,
                                gpointer request);

tp_channel_factory_iface_emit_new_channel has been deprecated since version 0.11.7 and should not be used in newly-written code.

Signal that a new channel has been created (new-channel signal).

If the channel was created in response to a channel request, the request was for a nonzero handle type, and the channel has zero handle type, request will be the request context passed to tp_channel_factory_iface_request().

Otherwise, request may either be NULL or a request that led to the channel's creation; callers are expected to determine which channels satisfy which requests based on the handle and handle-type.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

instance

An object implementing TpChannelFactoryIface

 

channel

The new channel

 

request

A request context as passed to tp_channel_factory_iface_request(), or NULL

 

tp_channel_factory_iface_emit_channel_error ()

void
tp_channel_factory_iface_emit_channel_error
                               (gpointer instance,
                                TpChannelIface *channel,
                                GError *error,
                                gpointer request);

tp_channel_factory_iface_emit_channel_error has been deprecated since version 0.11.7 and should not be used in newly-written code.

Signal that a new channel was created, but an error occurred before it could become useful.

request is as for tp_channel_factory_iface_emit_new_channel().

Deprecated since version 0.11.7. Use TpChannelManager instead.

Parameters

instance

An object implementing TpChannelFactoryIface

 

channel

The new channel

 

error

The error that made the channel request fail

 

request

A request context as passed to tp_channel_factory_iface_request(), or NULL

 

Types and Values

enum TpChannelFactoryRequestStatus

TpChannelFactoryRequestStatus has been deprecated since version 0.11.7 and should not be used in newly-written code.

Indicates the result of a channel request.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Members

TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED

Same as the Telepathy error NotImplemented. The connection will try the next factory in its list; if all return this, the overall result of the request will be NotImplemented. *ret and *error are not set

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE

Same as the Telepathy error NotAvailable. *ret and *error are not set

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE

Same as the Telepathy error InvalidHandle. *ret and *error are not set

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR

An error other than the above. *ret is not set, *error is set

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED

A new channel was created (possibly in response to more than one request). new-channel has already been emitted and *ret is set to the new channel.

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED

A new channel will be created, or was created but is not ready yet. Either new-channel or channel-error will be emitted later. *ret and *error are not set.

 

TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING

An existing channel satisfies the request: new-channel was not emitted. *ret is set to the existing channel.

 

TpChannelFactoryIface

typedef struct _TpChannelFactoryIface TpChannelFactoryIface;

TpChannelFactoryIface has been deprecated since version 0.11.7 and should not be used in newly-written code.

Opaque typedef representing any channel factory implementation.

Deprecated since version 0.11.7. Use TpChannelManager instead.


struct TpChannelFactoryIfaceClass

struct TpChannelFactoryIfaceClass {
  GTypeInterface parent_class;

  TpChannelFactoryIfaceProc close_all;
  TpChannelFactoryIfaceProc connecting;
  TpChannelFactoryIfaceProc connected;
  TpChannelFactoryIfaceProc disconnected;
  TpChannelFactoryIfaceForeachImpl foreach;
  TpChannelFactoryIfaceRequestImpl request;
};

TpChannelFactoryIfaceClass has been deprecated since version 0.11.7 and should not be used in newly-written code.

The class structure and vtable for a channel factory implementation.

Deprecated since version 0.11.7. Use TpChannelManager instead.

Members

TpChannelFactoryIfaceProc close_all;

Close all channels and shut down the channel factory. It is not expected to be usable afterwards. This is called when the connection goes to disconnected state, before emitting the StatusChanged signal or calling disconnected(). Must be filled in by implementations.

 

TpChannelFactoryIfaceProc connecting;

Called just after the connection goes from disconnected to connecting state. May be NULL if nothing special needs to happen.

 

TpChannelFactoryIfaceProc connected;

Called just after the connection goes from connecting to connected state. May be NULL if nothing special needs to happen.

 

TpChannelFactoryIfaceProc disconnected;

Called just after the connection goes to disconnected state. This is always called after close_all . May be NULL if nothing special needs to happen.

 

TpChannelFactoryIfaceForeachImpl foreach;

Call func(channel, data) for each channel managed by this factory. Must be filled in by implementations.

 

TpChannelFactoryIfaceRequestImpl request;

Respond to a request for a channel. Must be filled in by implementations. See TpChannelFactoryIfaceRequestImpl for details.

 

Signal Details

The “channel-error” signal

void
user_function (TpChannelFactoryIface *self,
               GObject               *channel,
               gpointer               error,
               gpointer               request_context,
               gpointer               user_data)

Emitted when a new channel has been created, but an error occurred before it could become useful.

request is the same as for “new-channel”.

Parameters

self

an object implementing TpChannelFactoryIface

 

channel

an object implementing TpChannelIface

 

error

the GError that made the channel request fail

 

request_context

a request context as passed to tp_channel_factory_iface_request(), or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-channel” signal

void
user_function (TpChannelFactoryIface *self,
               GObject               *channel,
               gpointer               request_context,
               gpointer               user_data)

Emitted when a new channel has been created.

If the channel was created in response to a channel request, the request was for a nonzero handle type, and the channel has zero handle type, request_context will be the request context passed to tp_channel_factory_iface_request().

Otherwise, request may either be NULL or a request that led to channel 's creation; callers are expected to determine which channels satisfy which requests based on the handle and handle-type.

Parameters

self

an object implementing TpChannelFactoryIface

 

channel

a new channel (an object implementing TpChannelIface)

 

request_context

a request context as passed to tp_channel_factory_iface_request(), or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-client.html0000644000175000017500000014346214006623344023145 00000000000000 Service-side Client interfaces: telepathy-glib API Reference Manual

Service-side Client interfaces

Service-side Client interfaces — interfaces used to be an Observer, Approver and Handler

Object Hierarchy

    GInterface
    ├── TpSvcClient
    ├── TpSvcClientApprover
    ├── TpSvcClientHandler
    ├── TpSvcClientInterfaceRequests
    ╰── TpSvcClientObserver

Known Implementations

TpSvcClient is implemented by TpBaseClient, TpSimpleApprover, TpSimpleHandler and TpSimpleObserver.

TpSvcClientApprover is implemented by TpBaseClient, TpSimpleApprover, TpSimpleHandler and TpSimpleObserver.

TpSvcClientHandler is implemented by TpBaseClient, TpSimpleApprover, TpSimpleHandler and TpSimpleObserver.

TpSvcClientInterfaceRequests is implemented by TpBaseClient, TpSimpleApprover, TpSimpleHandler and TpSimpleObserver.

TpSvcClientObserver is implemented by TpBaseClient, TpSimpleApprover, TpSimpleHandler and TpSimpleObserver.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

These interfaces (auto-generated from the telepathy spec) make it easier to export the objects used to implement a Telepathy client.

Clients such as loggers, new message notification windows and chat UIs should implement some or all of the Client types (Observer, Approver and/or Handler): see telepathy-spec for details.

Functions

tp_svc_client_approver_return_from_add_dispatch_operation ()

void
tp_svc_client_approver_return_from_add_dispatch_operation
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_client_approver_add_dispatch_operation_impl ()

void
(*tp_svc_client_approver_add_dispatch_operation_impl)
                               (TpSvcClientApprover *self,
                                const GPtrArray *in_Channels,
                                const gchar *in_DispatchOperation,
                                GHashTable *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddDispatchOperation on interface org.freedesktop.Telepathy.Client.Approver.

Parameters

self

The object implementing this interface

 

in_Channels

const GPtrArray * (FIXME, generate documentation)

 

in_DispatchOperation

const gchar * (FIXME, generate documentation)

 

in_Properties

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_client_approver_implement_add_dispatch_operation ()

void
tp_svc_client_approver_implement_add_dispatch_operation
                               (TpSvcClientApproverClass *klass,
                                tp_svc_client_approver_add_dispatch_operation_impl impl);

Register an implementation for the AddDispatchOperation method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddDispatchOperation D-Bus method

 

tp_svc_client_handler_return_from_handle_channels ()

void
tp_svc_client_handler_return_from_handle_channels
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_client_handler_handle_channels_impl ()

void
(*tp_svc_client_handler_handle_channels_impl)
                               (TpSvcClientHandler *self,
                                const gchar *in_Account,
                                const gchar *in_Connection,
                                const GPtrArray *in_Channels,
                                const GPtrArray *in_Requests_Satisfied,
                                guint64 in_User_Action_Time,
                                GHashTable *in_Handler_Info,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method HandleChannels on interface org.freedesktop.Telepathy.Client.Handler.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Connection

const gchar * (FIXME, generate documentation)

 

in_Channels

const GPtrArray * (FIXME, generate documentation)

 

in_Requests_Satisfied

const GPtrArray * (FIXME, generate documentation)

 

in_User_Action_Time

guint64 (FIXME, generate documentation)

 

in_Handler_Info

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_client_handler_implement_handle_channels ()

void
tp_svc_client_handler_implement_handle_channels
                               (TpSvcClientHandlerClass *klass,
                                tp_svc_client_handler_handle_channels_impl impl);

Register an implementation for the HandleChannels method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the HandleChannels D-Bus method

 

tp_svc_client_interface_requests_return_from_add_request ()

void
tp_svc_client_interface_requests_return_from_add_request
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_client_interface_requests_add_request_impl ()

void
(*tp_svc_client_interface_requests_add_request_impl)
                               (TpSvcClientInterfaceRequests *self,
                                const gchar *in_Request,
                                GHashTable *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method AddRequest on interface org.freedesktop.Telepathy.Client.Interface.Requests.

Parameters

self

The object implementing this interface

 

in_Request

const gchar * (FIXME, generate documentation)

 

in_Properties

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_client_interface_requests_implement_add_request ()

void
tp_svc_client_interface_requests_implement_add_request
                               (TpSvcClientInterfaceRequestsClass *klass,
                                tp_svc_client_interface_requests_add_request_impl impl);

Register an implementation for the AddRequest method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the AddRequest D-Bus method

 

tp_svc_client_interface_requests_return_from_remove_request ()

void
tp_svc_client_interface_requests_return_from_remove_request
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_client_interface_requests_remove_request_impl ()

void
(*tp_svc_client_interface_requests_remove_request_impl)
                               (TpSvcClientInterfaceRequests *self,
                                const gchar *in_Request,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveRequest on interface org.freedesktop.Telepathy.Client.Interface.Requests.

Parameters

self

The object implementing this interface

 

in_Request

const gchar * (FIXME, generate documentation)

 

in_Error

const gchar * (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_client_interface_requests_implement_remove_request ()

void
tp_svc_client_interface_requests_implement_remove_request
                               (TpSvcClientInterfaceRequestsClass *klass,
                                tp_svc_client_interface_requests_remove_request_impl impl);

Register an implementation for the RemoveRequest method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveRequest D-Bus method

 

tp_svc_client_observer_return_from_observe_channels ()

void
tp_svc_client_observer_return_from_observe_channels
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_client_observer_observe_channels_impl ()

void
(*tp_svc_client_observer_observe_channels_impl)
                               (TpSvcClientObserver *self,
                                const gchar *in_Account,
                                const gchar *in_Connection,
                                const GPtrArray *in_Channels,
                                const gchar *in_Dispatch_Operation,
                                const GPtrArray *in_Requests_Satisfied,
                                GHashTable *in_Observer_Info,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ObserveChannels on interface org.freedesktop.Telepathy.Client.Observer.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Connection

const gchar * (FIXME, generate documentation)

 

in_Channels

const GPtrArray * (FIXME, generate documentation)

 

in_Dispatch_Operation

const gchar * (FIXME, generate documentation)

 

in_Requests_Satisfied

const GPtrArray * (FIXME, generate documentation)

 

in_Observer_Info

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_client_observer_implement_observe_channels ()

void
tp_svc_client_observer_implement_observe_channels
                               (TpSvcClientObserverClass *klass,
                                tp_svc_client_observer_observe_channels_impl impl);

Register an implementation for the ObserveChannels method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ObserveChannels D-Bus method

 

Types and Values

TpSvcClient

typedef struct _TpSvcClient TpSvcClient;

Dummy typedef representing any implementation of this interface.


TpSvcClientClass

typedef struct _TpSvcClientClass TpSvcClientClass;

The class of TpSvcClient. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcClientApprover

typedef struct _TpSvcClientApprover TpSvcClientApprover;

Dummy typedef representing any implementation of this interface.


TpSvcClientApproverClass

typedef struct _TpSvcClientApproverClass TpSvcClientApproverClass;

The class of TpSvcClientApprover.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_client_approver (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_client_approver_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (add_dispatch_operation);
#undef IMPLEMENT
}

TpSvcClientHandler

typedef struct _TpSvcClientHandler TpSvcClientHandler;

Dummy typedef representing any implementation of this interface.


TpSvcClientHandlerClass

typedef struct _TpSvcClientHandlerClass TpSvcClientHandlerClass;

The class of TpSvcClientHandler.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_client_handler (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_client_handler_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (handle_channels);
#undef IMPLEMENT
}

TpSvcClientInterfaceRequests

typedef struct _TpSvcClientInterfaceRequests TpSvcClientInterfaceRequests;

Dummy typedef representing any implementation of this interface.


TpSvcClientInterfaceRequestsClass

typedef struct _TpSvcClientInterfaceRequestsClass TpSvcClientInterfaceRequestsClass;

The class of TpSvcClientInterfaceRequests.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_client_interface_requests (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_client_interface_requests_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (add_request);
  IMPLEMENT (remove_request);
#undef IMPLEMENT
}

TpSvcClientObserver

typedef struct _TpSvcClientObserver TpSvcClientObserver;

Dummy typedef representing any implementation of this interface.


TpSvcClientObserverClass

typedef struct _TpSvcClientObserverClass TpSvcClientObserverClass;

The class of TpSvcClientObserver.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_client_observer (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_client_observer_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (observe_channels);
#undef IMPLEMENT
}
telepathy-glib-0.24.2/docs/reference/html/ch-utilities.html0000644000175000017500000000553414006623343020565 00000000000000 Utilities: telepathy-glib API Reference Manual

Utilities

Version information — Checking the telepathy-glib version
Utilities — Non-Telepathy utility functions
GNIO Utilities — Telepathy/GNIO utility functions
Common debug support — API to activate debugging messages from telepathy-glib
TpDebugSender — object for exposing Telepathy debug interface
TpIntset — a set of unsigned integers
TpHeap — a heap queue of pointers
telepathy-glib-0.24.2/docs/reference/html/ch-service-handles.html0000644000175000017500000000453014006623343021621 00000000000000 Service-side handle repositories: telepathy-glib API Reference Manual

Service-side handle repositories

TpHandleRepoIface — abstract interface for handle allocation
TpStaticHandleRepo — handle repository implementation with a fixed, static set of handle names
TpDynamicHandleRepo — general handle repository implementation, with dynamic handle allocation and recycling
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-automatic-client-factory.html0000644000175000017500000003472514006623343026005 00000000000000 TpAutomaticClientFactory: telepathy-glib API Reference Manual

TpAutomaticClientFactory

TpAutomaticClientFactory — Factory for specialized TpChannel subclasses.

Object Hierarchy

    GObject
    ╰── TpSimpleClientFactory
        ╰── TpAutomaticClientFactory

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This factory overrides some TpSimpleClientFactory virtual methods to create specialized TpChannel subclasses.

TpAutomaticClientFactory will currently create TpChannel objects as follows:

It is guaranteed that the objects returned by future versions will be either the class that is currently used, or a more specific subclass of that class.

This factory asks to prepare the following features:

Functions

tp_automatic_client_factory_new ()

TpAutomaticClientFactory *
tp_automatic_client_factory_new (TpDBusDaemon *dbus);

Returns a new TpAutomaticClientFactory instance. If dbus is NULL, tp_dbus_daemon_dup() will be used.

Parameters

dbus

a TpDBusDaemon, or NULL.

[allow-none]

Returns

a new TpAutomaticClientFactory

Since: 0.15.5

Types and Values

struct TpAutomaticClientFactory

struct TpAutomaticClientFactory;

Data structure representing a TpAutomaticClientFactory

Since: 0.15.5


struct TpAutomaticClientFactoryClass

struct TpAutomaticClientFactoryClass {
    TpSimpleClientFactoryClass parent_class;
};

The class of a TpAutomaticClientFactory.

Members

TpSimpleClientFactoryClass parent_class;

the parent class

 

Since: 0.15.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-enums.html0000644000175000017500000111776414006623344022234 00000000000000 Telepathy protocol enumerations: telepathy-glib API Reference Manual

Telepathy protocol enumerations

Telepathy protocol enumerations — Enumerated types and bitfields from the Telepathy spec

Functions

Types and Values

enum TpHandleType
#define TP_NUM_HANDLE_TYPES
#define NUM_TP_HANDLE_TYPES
enum TpConnMgrParamFlags
enum TpConnectionStatus
#define TP_NUM_CONNECTION_STATUSES
#define NUM_TP_CONNECTION_STATUSES
enum TpConnectionStatusReason
#define TP_NUM_CONNECTION_STATUS_REASONS
#define NUM_TP_CONNECTION_STATUS_REASONS
enum TpConnectionAliasFlags
enum TpConnectionCapabilityFlags
enum TpConnectionPresenceType
#define TP_NUM_CONNECTION_PRESENCE_TYPES
#define NUM_TP_CONNECTION_PRESENCE_TYPES
enum TpDTMFEvent
#define TP_NUM_DTMF_EVENTS
#define NUM_TP_DTMF_EVENTS
enum TpMediaStreamType
#define NUM_TP_MEDIA_STREAM_TYPES
#define TP_NUM_MEDIA_STREAM_TYPES
enum TpMediaStreamState
#define NUM_TP_MEDIA_STREAM_STATES
#define TP_NUM_MEDIA_STREAM_STATES
enum TpMediaStreamDirection
#define NUM_TP_MEDIA_STREAM_DIRECTIONS
#define TP_NUM_MEDIA_STREAM_DIRECTIONS
enum TpMediaStreamPendingSend
enum TpChannelMediaCapabilities
enum TpChannelTextSendError
#define TP_NUM_CHANNEL_TEXT_SEND_ERRORS
#define NUM_TP_CHANNEL_TEXT_SEND_ERRORS
enum TpChannelTextMessageType
#define NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES
#define TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES
enum TpChannelTextMessageFlags
enum TpChannelChatState
#define NUM_TP_CHANNEL_CHAT_STATES
#define TP_NUM_CHANNEL_CHAT_STATES
enum TpChannelGroupFlags
enum TpChannelGroupChangeReason
#define NUM_TP_CHANNEL_GROUP_CHANGE_REASONS
#define TP_NUM_CHANNEL_GROUP_CHANGE_REASONS
enum TpChannelPasswordFlags
enum TpContactBlockingCapabilities
enum TpDeliveryReportingSupportFlags
enum TpDeliveryStatus
#define NUM_TP_DELIVERY_STATUSES
#define TP_NUM_DELIVERY_STATUSES
enum TpMediaStreamError
#define NUM_TP_MEDIA_STREAM_ERRORS
#define TP_NUM_MEDIA_STREAM_ERRORS
enum TpMediaStreamBaseProto
#define NUM_TP_MEDIA_STREAM_BASE_PROTOS
#define TP_NUM_MEDIA_STREAM_BASE_PROTOS
enum TpMediaStreamTransportType
#define NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES
#define TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES
enum TpPropertyFlags
enum TpMessagePartSupportFlags
enum TpMessageSendingFlags
#define NUM_TP_SOCKET_ACCESS_CONTROLS
#define TP_NUM_SOCKET_ACCESS_CONTROLS
enum TpSocketAccessControl
#define NUM_TP_SOCKET_ADDRESS_TYPES
#define TP_NUM_SOCKET_ADDRESS_TYPES
enum TpSocketAddressType
#define NUM_TP_TUBE_STATES
#define TP_NUM_TUBE_STATES
enum TpTubeState
#define NUM_TP_TUBE_TYPES
#define TP_NUM_TUBE_TYPES
enum TpTubeType
enum TpChannelCallStateFlags
#define NUM_TP_LOCAL_HOLD_STATES
#define TP_NUM_LOCAL_HOLD_STATES
enum TpLocalHoldState
#define NUM_TP_LOCAL_HOLD_STATE_REASONS
#define TP_NUM_LOCAL_HOLD_STATE_REASONS
enum TpLocalHoldStateReason
enum TpAccessControlType
#define NUM_TP_ACCESS_CONTROL_TYPES
#define TP_NUM_ACCESS_CONTROL_TYPES
enum TpRichPresenceAccessControlType
#define NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES
#define TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES
enum TpFileHashType
#define NUM_TP_FILE_HASH_TYPES
#define TP_NUM_FILE_HASH_TYPES
enum TpFileTransferState
#define NUM_TP_FILE_TRANSFER_STATES
#define TP_NUM_FILE_TRANSFER_STATES
enum TpFileTransferStateChangeReason
#define NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS
#define TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS
enum TpTubeChannelState
#define NUM_TP_TUBE_CHANNEL_STATES
#define TP_NUM_TUBE_CHANNEL_STATES
enum TpDebugLevel
#define NUM_TP_DEBUG_LEVELS
#define TP_NUM_DEBUG_LEVELS
enum TpContactInfoFlags
enum TpContactInfoFieldFlags
enum TpLocationFeatures
enum TpServicePointType
#define NUM_TP_SERVICE_POINT_TYPES
#define TP_NUM_SERVICE_POINT_TYPES
enum TpAnonymityModeFlags
enum TpStorageRestrictionFlags
enum TpTLSCertificateRejectReason
#define NUM_TP_TLS_CERTIFICATE_REJECT_REASONS
#define TP_NUM_TLS_CERTIFICATE_REJECT_REASONS
enum TpTLSCertificateState
#define NUM_TP_TLS_CERTIFICATE_STATES
#define TP_NUM_TLS_CERTIFICATE_STATES
enum TpContactMetadataStorageType
#define NUM_TP_CONTACT_METADATA_STORAGE_TYPES
#define TP_NUM_CONTACT_METADATA_STORAGE_TYPES
enum TpSubscriptionState
#define NUM_TP_SUBSCRIPTION_STATES
#define TP_NUM_SUBSCRIPTION_STATES
enum TpContactListState
#define NUM_TP_CONTACT_LIST_STATES
#define TP_NUM_CONTACT_LIST_STATES
enum TpHTTPMethod
#define NUM_TP_HTTP_METHODS
#define TP_NUM_HTTP_METHODS
enum TpMailNotificationFlags
enum TpSASLAbortReason
#define NUM_TP_SASL_ABORT_REASONS
#define TP_NUM_SASL_ABORT_REASONS
enum TpSASLStatus
#define NUM_TP_SASL_STATUSES
#define TP_NUM_SASL_STATUSES
enum TpCaptchaStatus
#define NUM_TP_CAPTCHA_STATUSES
#define TP_NUM_CAPTCHA_STATUSES
enum TpCaptchaCancelReason
#define NUM_TP_CAPTCHA_CANCEL_REASONS
#define TP_NUM_CAPTCHA_CANCEL_REASONS
enum TpCaptchaFlags
enum TpCallContentDisposition
#define NUM_TP_CALL_CONTENT_DISPOSITIONS
#define TP_NUM_CALL_CONTENT_DISPOSITIONS
enum TpCallContentPacketizationType
#define NUM_TP_CALL_CONTENT_PACKETIZATION_TYPES
#define TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES
enum TpCallState
#define NUM_TP_CALL_STATES
#define TP_NUM_CALL_STATES
enum TpCallStateChangeReason
#define NUM_TP_CALL_STATE_CHANGE_REASONS
#define TP_NUM_CALL_STATE_CHANGE_REASONS
enum TpCallStreamCandidateType
#define NUM_TP_CALL_STREAM_CANDIDATE_TYPES
#define TP_NUM_CALL_STREAM_CANDIDATE_TYPES
enum TpRCPTXRRTTMode
#define NUM_TP_RCPT_XR_RTT_MODES
#define TP_NUM_RCPT_XR_RTT_MODES
enum TpSendingState
#define NUM_TP_SENDING_STATES
#define TP_NUM_SENDING_STATES
enum TpStreamComponent
#define NUM_TP_STREAM_COMPONENTS
#define TP_NUM_STREAM_COMPONENTS
enum TpStreamEndpointState
#define NUM_TP_STREAM_ENDPOINT_STATES
#define TP_NUM_STREAM_ENDPOINT_STATES
enum TpStreamFlowState
#define NUM_TP_STREAM_FLOW_STATES
#define TP_NUM_STREAM_FLOW_STATES
enum TpStreamTransportType
#define NUM_TP_STREAM_TRANSPORT_TYPES
#define TP_NUM_STREAM_TRANSPORT_TYPES
enum TpCallFlags
enum TpCallMemberFlags
enum TpRTCPXRStatisticsFlags

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This header exposes the constants from the Telepathy specification as C enums. It is automatically generated from the specification.

The names used in the specification (e.g. Connection_Status_Connected) are converted to upper-case and given a TP_ prefix, e.g. TP_CONNECTION_STATUS_CONNECTED.

Each enum also has a constant for the number of members, named like TP_NUM_CONNECTION_STATUSES. The pluralization is currently hard-coded in the conversion scripts, but should move into the specification in future.

Constants LAST_TP_CONNECTION_STATUS, etc. are also provided. These are deprecated and will be removed in a future release.

Functions

tp_dtmf_event_to_char ()

gchar
tp_dtmf_event_to_char (TpDTMFEvent event);

Return a printable ASCII character representing event , or '?' if event was not understood.

Parameters

event

a TpDTMFEvent

 

Returns

a printable ASCII character

Since: 0.13.3

Types and Values

enum TpHandleType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_HANDLE_TYPE_NONE

A "null" handle type used to indicate the absence of a handle. When a handle type and a handle appear as a pair, if the handle type is zero, the handle must also be zero.

 

TP_HANDLE_TYPE_CONTACT

A contact

 

TP_HANDLE_TYPE_ROOM

A chat room

 

TP_HANDLE_TYPE_LIST

A server-generated contact list (see Channel.Interface.Group)

 

TP_HANDLE_TYPE_GROUP

A user-defined contact list (see Channel.Interface.Group)

 

TP_NUM_HANDLE_TYPES

#define TP_NUM_HANDLE_TYPES (4+1)

1 higher than the highest valid value of TpHandleType.


NUM_TP_HANDLE_TYPES

#define NUM_TP_HANDLE_TYPES TP_NUM_HANDLE_TYPES

1 higher than the highest valid value of TpHandleType. In new code, use TP_NUM_HANDLE_TYPES instead.


enum TpConnMgrParamFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONN_MGR_PARAM_FLAG_REQUIRED

This parameter is required for connecting to the server.

 

TP_CONN_MGR_PARAM_FLAG_REGISTER

This parameter is required for registering an account on the server.

 

TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT

This parameter has a default value, which is returned in GetParameters; not providing this parameter is equivalent to providing the default.

 

TP_CONN_MGR_PARAM_FLAG_SECRET

This parameter should be considered private or secret; for instance, clients should store it in a "password safe" like gnome-keyring or kwallet, omit it from debug logs, and use a text input widget that hides the value of the parameter. (Clients that support older connection managers may also treat any parameter whose name contains "password" as though it had this flag.)

 

TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY

This parameter is also a D-Bus property on the resulting Connection; a parameter named com.example.Duck.Macaroni with this flag corresponds to the Macaroni property on the com.example.Duck interface. Its value can be queried and possibly changed on an existing Connection using methods on the org.freedesktop.DBus.Properties interface. When a new value for a parameter with this flag is passed to Account.UpdateParameters, the account manager will attempt to update its value on any running connections. Similarly, if the parameter also has the Has_Default flag, and is passed in the second argument to UpdateParameters, the default value will be applied to any running connections. Thus, clients generally do not need to directly access or update the connection property; instead, they SHOULD manipulate Account.Parameters. This allows runtime-configurable options to be stored and maintained by the AccountManager, without needing to invent a separate account preference for “properties that should be set on the connection as soon as it is created”. It was originally invented to manage Cellular preferences.

 

enum TpConnectionStatus

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONNECTION_STATUS_CONNECTED

The connection is fully connected and all methods are available.

 

TP_CONNECTION_STATUS_CONNECTING

Connect has been called but the connection has not yet been established. Some methods may fail until the connection has been established.

 

TP_CONNECTION_STATUS_DISCONNECTED

If this is retrieved from GetStatus or Status, it indicates that connection has not yet been attempted. If seen in a StatusChanged signal, it indicates that the connection has failed; the Connection object SHOULD be removed from D-Bus immediately, and all subsequent method calls SHOULD fail.

 

TP_NUM_CONNECTION_STATUSES

#define TP_NUM_CONNECTION_STATUSES (2+1)

1 higher than the highest valid value of TpConnectionStatus.


NUM_TP_CONNECTION_STATUSES

#define NUM_TP_CONNECTION_STATUSES TP_NUM_CONNECTION_STATUSES

1 higher than the highest valid value of TpConnectionStatus. In new code, use TP_NUM_CONNECTION_STATUSES instead.


enum TpConnectionStatusReason

A reason why the status of the connection changed. Apart from Requested, the values of this enumeration only make sense as reasons why the status changed to Disconnected.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED

There is no reason set for this state change. Unknown status reasons SHOULD be treated like this reason. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Disconnected.

 

TP_CONNECTION_STATUS_REASON_REQUESTED

The change is in response to a user request. Changes to the Connecting or Connected status SHOULD always indicate this reason; changes to the Disconnected status SHOULD indicate this reason if and only if the disconnection was requested by the user. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled.

 

TP_CONNECTION_STATUS_REASON_NETWORK_ERROR

There was an error sending or receiving on the network socket. When the status changes from Connecting to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionRefused, org.freedesktop.Telepathy.Error.ConnectionFailed or some more specific error. When the status changes from Connected to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionLost or some more specific error.

 

TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED

The username or password was invalid. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.AuthenticationFailed.

 

TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR

There was an error negotiating SSL on this connection, or encryption was unavailable and require-encryption was set when the connection was created. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.EncryptionNotAvailable if encryption was not available at all, or org.freedesktop.Telepathy.Error.EncryptionError if encryption failed.

 

TP_CONNECTION_STATUS_REASON_NAME_IN_USE

In general, this reason indicates that the requested account name or other identification could not be used due to conflict with another connection. It can be divided into three cases: If the status change is from Connecting to Disconnected and the 'register' parameter to RequestConnection was present and true, the requested account could not be created on the server because it already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.RegistrationExists. If the status change is from Connecting to Disconnected but the 'register' parameter is absent or false, the connection manager could not connect to the specified account because a connection to that account already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.AlreadyConnected. In some protocols, like XMPP (when connecting with the same JID and resource as an existing connection), the existing connection "wins" and the new one fails to connect. If the status change is from Connected to Disconnected, the existing connection was automatically disconnected because a new connection to the same account (perhaps from a different client or location) was established. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.ConnectionReplaced. In some protocols, like MSNP (when connecting twice with the same Passport), the new connection "wins" and the existing one is automatically disconnected.

 

TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED

The server did not provide a SSL certificate. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotProvided.

 

TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED

The server's SSL certificate is signed by an untrusted certifying authority. This error SHOULD NOT be used to represent a self-signed certificate: use the more specific Cert_Self_Signed reason for that. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Untrusted.

 

TP_CONNECTION_STATUS_REASON_CERT_EXPIRED

The server's SSL certificate has expired. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Expired.

 

TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED

The server's SSL certificate is not yet valid. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotActivated.

 

TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH

The server's SSL certificate did not match its hostname. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.HostnameMismatch.

 

TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH

The server's SSL certificate does not have the expected fingerprint. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch.

 

TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED

The server's SSL certificate is self-signed. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.SelfSigned.

 

TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR

There was some other error validating the server's SSL certificate. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Invalid.

 

TP_CONNECTION_STATUS_REASON_CERT_REVOKED

The server's SSL certificate has been revoked. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Revoked.

 

TP_CONNECTION_STATUS_REASON_CERT_INSECURE

The server's SSL certificate uses an insecure algorithm, or is cryptographically weak. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Insecure.

 

TP_CONNECTION_STATUS_REASON_CERT_LIMIT_EXCEEDED

The length in bytes of the server certificate, or the depth of the sever certificate chain exceed the limits imposed by the crypto library. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.LimitExceeded

 

TP_NUM_CONNECTION_STATUS_REASONS

#define TP_NUM_CONNECTION_STATUS_REASONS (16+1)

1 higher than the highest valid value of TpConnectionStatusReason.


NUM_TP_CONNECTION_STATUS_REASONS

#define NUM_TP_CONNECTION_STATUS_REASONS TP_NUM_CONNECTION_STATUS_REASONS

1 higher than the highest valid value of TpConnectionStatusReason. In new code, use TP_NUM_CONNECTION_STATUS_REASONS instead.


enum TpConnectionAliasFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONNECTION_ALIAS_FLAG_USER_SET

The aliases of contacts on this connection may be changed by the user of the service, not just by the contacts themselves. This is the case on Jabber, for instance. It is possible that aliases can be changed by the contacts too - which alias takes precedence is not defined by this specification, and depends on the server and/or connection manager implementation. This flag only applies to the aliases of "globally valid" contact handles. At this time, clients should not expect to be able to change the aliases corresponding to any channel-specific handles. If this becomes possible in future, a new flag will be defined.

 

enum TpConnectionCapabilityFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONNECTION_CAPABILITY_FLAG_CREATE

The given channel type and handle can be given to RequestChannel to create a new channel of this type.

 

TP_CONNECTION_CAPABILITY_FLAG_INVITE

The given contact can be invited to an existing channel of this type.

 

enum TpConnectionPresenceType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONNECTION_PRESENCE_TYPE_UNSET

An invalid presence type used as a null value. This value MUST NOT appear in the Statuses property, or in the result of GetStatuses on the deprecated Presence interface.

 

TP_CONNECTION_PRESENCE_TYPE_OFFLINE

Offline

 

TP_CONNECTION_PRESENCE_TYPE_AVAILABLE

Available

 

TP_CONNECTION_PRESENCE_TYPE_AWAY

Away

 

TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY

Away for an extended time

 

TP_CONNECTION_PRESENCE_TYPE_HIDDEN

Hidden (invisible)

 

TP_CONNECTION_PRESENCE_TYPE_BUSY

Busy, Do Not Disturb.

 

TP_CONNECTION_PRESENCE_TYPE_UNKNOWN

Unknown, unable to determine presence for this contact, for example if the protocol only allows presence of subscribed contacts.

 

TP_CONNECTION_PRESENCE_TYPE_ERROR

Error, an error occurred while trying to determine presence. The message, if set, is an error from the server.

 

TP_NUM_CONNECTION_PRESENCE_TYPES

#define TP_NUM_CONNECTION_PRESENCE_TYPES (8+1)

1 higher than the highest valid value of TpConnectionPresenceType.


NUM_TP_CONNECTION_PRESENCE_TYPES

#define NUM_TP_CONNECTION_PRESENCE_TYPES TP_NUM_CONNECTION_PRESENCE_TYPES

1 higher than the highest valid value of TpConnectionPresenceType. In new code, use TP_NUM_CONNECTION_PRESENCE_TYPES instead.


enum TpDTMFEvent

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_DTMF_EVENT_DIGIT_0

0

 

TP_DTMF_EVENT_DIGIT_1

1

 

TP_DTMF_EVENT_DIGIT_2

2

 

TP_DTMF_EVENT_DIGIT_3

3

 

TP_DTMF_EVENT_DIGIT_4

4

 

TP_DTMF_EVENT_DIGIT_5

5

 

TP_DTMF_EVENT_DIGIT_6

6

 

TP_DTMF_EVENT_DIGIT_7

7

 

TP_DTMF_EVENT_DIGIT_8

8

 

TP_DTMF_EVENT_DIGIT_9

9

 

TP_DTMF_EVENT_ASTERISK

*

 

TP_DTMF_EVENT_HASH

#

 

TP_DTMF_EVENT_LETTER_A

A

 

TP_DTMF_EVENT_LETTER_B

B

 

TP_DTMF_EVENT_LETTER_C

C

 

TP_DTMF_EVENT_LETTER_D

D

 

TP_NUM_DTMF_EVENTS

#define TP_NUM_DTMF_EVENTS (15+1)

1 higher than the highest valid value of TpDTMFEvent.


NUM_TP_DTMF_EVENTS

#define NUM_TP_DTMF_EVENTS TP_NUM_DTMF_EVENTS

1 higher than the highest valid value of TpDTMFEvent. In new code, use TP_NUM_DTMF_EVENTS instead.


enum TpMediaStreamType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_TYPE_AUDIO

An audio stream

 

TP_MEDIA_STREAM_TYPE_VIDEO

A video stream

 

NUM_TP_MEDIA_STREAM_TYPES

#define NUM_TP_MEDIA_STREAM_TYPES TP_NUM_MEDIA_STREAM_TYPES

1 higher than the highest valid value of TpMediaStreamType. In new code, use TP_NUM_MEDIA_STREAM_TYPES instead.


TP_NUM_MEDIA_STREAM_TYPES

#define TP_NUM_MEDIA_STREAM_TYPES (1+1)

1 higher than the highest valid value of TpMediaStreamType.


enum TpMediaStreamState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_STATE_DISCONNECTED

The stream is disconnected.

 

TP_MEDIA_STREAM_STATE_CONNECTING

The stream is trying to connect.

 

TP_MEDIA_STREAM_STATE_CONNECTED

The stream is connected.

 

NUM_TP_MEDIA_STREAM_STATES

#define NUM_TP_MEDIA_STREAM_STATES TP_NUM_MEDIA_STREAM_STATES

1 higher than the highest valid value of TpMediaStreamState. In new code, use TP_NUM_MEDIA_STREAM_STATES instead.


TP_NUM_MEDIA_STREAM_STATES

#define TP_NUM_MEDIA_STREAM_STATES (2+1)

1 higher than the highest valid value of TpMediaStreamState.


enum TpMediaStreamDirection

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_DIRECTION_NONE

Media are not being sent or received

 

TP_MEDIA_STREAM_DIRECTION_SEND

Media are being sent, but not received

 

TP_MEDIA_STREAM_DIRECTION_RECEIVE

Media are being received, but not sent

 

TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL

Media are being sent and received

 

NUM_TP_MEDIA_STREAM_DIRECTIONS

#define NUM_TP_MEDIA_STREAM_DIRECTIONS TP_NUM_MEDIA_STREAM_DIRECTIONS

1 higher than the highest valid value of TpMediaStreamDirection. In new code, use TP_NUM_MEDIA_STREAM_DIRECTIONS instead.


TP_NUM_MEDIA_STREAM_DIRECTIONS

#define TP_NUM_MEDIA_STREAM_DIRECTIONS (3+1)

1 higher than the highest valid value of TpMediaStreamDirection.


enum TpMediaStreamPendingSend

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_PENDING_LOCAL_SEND

The local user has been asked to send media by the remote user. Call RequestStreamDirection to indicate whether or not this is acceptable.

 

TP_MEDIA_STREAM_PENDING_REMOTE_SEND

The remote user has been asked to send media by the local user. The StreamDirectionChanged signal will be emitted when the remote user accepts or rejects this change.

 

enum TpChannelMediaCapabilities

The channel-type-specific capability flags used for Channel.Type.StreamedMedia in the Connection.Interface.Capabilities interface. See the InitialAudio property for details of the mechanisms that will replace this.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_MEDIA_CAPABILITY_AUDIO

The handle is capable of using audio streams within a media channel.

 

TP_CHANNEL_MEDIA_CAPABILITY_VIDEO

The handle is capable of using video streams within a media channel.

 

TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_STUN

The handle is capable of performing STUN to traverse NATs.

 

TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_GTALK_P2P

The handle is capable of establishing Google Talk peer-to-peer connections (as implemented in libjingle 0.3) to traverse NATs.

 

TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_ICE_UDP

The handle is capable of establishing ICE UDP peer-to-peer connections (as defined by the IETF MMUSIC working group) to traverse NATs.

 

TP_CHANNEL_MEDIA_CAPABILITY_IMMUTABLE_STREAMS

Channels whose target handle is this contact will have ImmutableStreams = True.

 

enum TpChannelTextSendError

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_TEXT_SEND_ERROR_UNKNOWN

An unknown error occurred

 

TP_CHANNEL_TEXT_SEND_ERROR_OFFLINE

The requested contact was offline

 

TP_CHANNEL_TEXT_SEND_ERROR_INVALID_CONTACT

The requested contact is not valid

 

TP_CHANNEL_TEXT_SEND_ERROR_PERMISSION_DENIED

The user does not have permission to speak on this channel

 

TP_CHANNEL_TEXT_SEND_ERROR_TOO_LONG

The outgoing message was too long and was rejected by the server

 

TP_CHANNEL_TEXT_SEND_ERROR_NOT_IMPLEMENTED

The channel doesn't support sending text messages to the requested contact

 

TP_NUM_CHANNEL_TEXT_SEND_ERRORS

#define TP_NUM_CHANNEL_TEXT_SEND_ERRORS (5+1)

1 higher than the highest valid value of TpChannelTextSendError.


NUM_TP_CHANNEL_TEXT_SEND_ERRORS

#define NUM_TP_CHANNEL_TEXT_SEND_ERRORS TP_NUM_CHANNEL_TEXT_SEND_ERRORS

1 higher than the highest valid value of TpChannelTextSendError. In new code, use TP_NUM_CHANNEL_TEXT_SEND_ERRORS instead.


enum TpChannelTextMessageType

The type of message.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL

An ordinary chat message. Unknown types SHOULD be treated like this.

 

TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION

An action which might be presented to the user as "* <sender> <action>", such as an IRC CTCP ACTION (typically selected by the "/me" command). For example, the text of the message might be "drinks more coffee".

 

TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE

A one-off or automated message not necessarily expecting a reply

 

TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY

An automatically-generated reply message.

 

TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT

A delivery report. This message type MUST NOT appear unless the channel supports the Messages interface; see Message_Part for the format that delivery reports must take.

 

NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES

#define NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES

1 higher than the highest valid value of TpChannelTextMessageType. In new code, use TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES instead.


TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES

#define TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES (4+1)

1 higher than the highest valid value of TpChannelTextMessageType.


enum TpChannelTextMessageFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_TEXT_MESSAGE_FLAG_TRUNCATED

The incoming message was truncated to a shorter length by the server or the connection manager.

 

TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT

The incoming message contained non-text content which cannot be represented by this interface, but has been signalled in the Messages interface. Connection managers SHOULD only set this flag if the non-text content appears to be relatively significant (exactly how significant is up to the implementor). The intention is that if this flag is set, clients using this interface SHOULD inform the user that part of the message was not understood.

 

TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK

The incoming message was part of a replay of message history. In XMPP multi-user chat, a few past messages are replayed when you join a chatroom. A sufficiently capable IRC connection manager could also set this flag on historical messages when connected to a proxy like bip or irssi-proxy. The existence of this flag allows loggers and UIs to use better heuristics when eliminating duplicates (a simple implementation made possible by this flag would be to avoid logging scrollback at all).

 

TP_CHANNEL_TEXT_MESSAGE_FLAG_RESCUED

The incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (the channel in which the message now appears) to open. This means that a logger (which should already have seen the message in the previous channel) is able to recognise and ignore these replayed messages.

 

enum TpChannelChatState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_CHAT_STATE_GONE

The contact has effectively ceased participating in the chat.

 

TP_CHANNEL_CHAT_STATE_INACTIVE

The contact has not been active for some time.

 

TP_CHANNEL_CHAT_STATE_ACTIVE

The contact is actively participating in the chat.

 

TP_CHANNEL_CHAT_STATE_PAUSED

The contact has paused composing a message.

 

TP_CHANNEL_CHAT_STATE_COMPOSING

The contact is composing a message to be sent to the chat.

 

NUM_TP_CHANNEL_CHAT_STATES

#define NUM_TP_CHANNEL_CHAT_STATES TP_NUM_CHANNEL_CHAT_STATES

1 higher than the highest valid value of TpChannelChatState. In new code, use TP_NUM_CHANNEL_CHAT_STATES instead.


TP_NUM_CHANNEL_CHAT_STATES

#define TP_NUM_CHANNEL_CHAT_STATES (4+1)

1 higher than the highest valid value of TpChannelChatState.


enum TpChannelGroupFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_GROUP_FLAG_CAN_ADD

The AddMembers method can be used to add or invite members who are not already in the local pending list (which is always valid).

 

TP_CHANNEL_GROUP_FLAG_CAN_REMOVE

The RemoveMembers method can be used to remove channel members (removing those on the pending local list is always valid).

 

TP_CHANNEL_GROUP_FLAG_CAN_RESCIND

The RemoveMembers method can be used on people on the remote pending list.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_ADD

A message may be sent to the server when calling AddMembers on contacts who are not currently pending members.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_REMOVE

A message may be sent to the server when calling RemoveMembers on contacts who are currently channel members.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT

A message may be sent to the server when calling AddMembers on contacts who are locally pending.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_REJECT

A message may be sent to the server when calling RemoveMembers on contacts who are locally pending.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_RESCIND

A message may be sent to the server when calling RemoveMembers on contacts who are remote pending.

 

TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES

The members of this group have handles which are specific to this channel, and are not valid as general-purpose handles on the connection. Depending on the channel, it may be possible to check the HandleOwners property or call GetHandleOwners to find the owners of these handles, which should be done if you wish to (e.g.) subscribe to the contact's presence. Connection managers must ensure that any given handle is not simultaneously a general-purpose handle and a channel-specific handle.

 

TP_CHANNEL_GROUP_FLAG_ONLY_ONE_GROUP

Placing a contact in multiple groups of this type is not allowed and will raise NotAvailable (on services where contacts may only be in one user-defined group, user-defined groups will have this flag).

 

TP_CHANNEL_GROUP_FLAG_HANDLE_OWNERS_NOT_AVAILABLE

In rooms with channel specific handles (ie Channel_Specific_Handles flag is set), this flag indicates that no handle owners are available, apart from the owner of the SelfHandle. This used to be an important optimization to avoid repeated GetHandleOwners calls, before we introduced the HandleOwners property and HandleOwnersChanged signal.

 

TP_CHANNEL_GROUP_FLAG_PROPERTIES

This flag indicates that all the properties introduced in specification 0.17.6 are fully supported.

 

TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED

Indicates that MembersChangedDetailed will be emitted for changes to this group's members in addition to MembersChanged. Clients can then connect to the former and ignore emission of the latter. This flag's state MUST NOT change over the lifetime of a channel. If it were allowed to change, client bindings would have to always connect to MembersChanged just in case the flag ever went away (and generally be unnecessarily complicated), which would mostly negate the point of having this flag in the first place.

 

TP_CHANNEL_GROUP_FLAG_MESSAGE_DEPART

A message may be sent to the server when calling RemoveMembers on the SelfHandle. This would be set for XMPP Multi-User Chat or IRC channels, but not for a typical implementation of streamed media calls.

 

enum TpChannelGroupChangeReason

The reason for a set of handles to move to one of Members, LocalPendingMembers or RemotePendingMembers, or to be removed from the group. A client may supply a reason when attempting to remove members from a group with RemoveMembersWithReason, and reasons are supplied by the CM when emitting MembersChanged and MembersChangedDetailed. Some reason codes have different meanings depending on the Actor in a MembersChanged signal.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_GROUP_CHANGE_REASON_NONE

No reason was provided for this change. In particular, this reason SHOULD be used when representing users joining a named chatroom in the usual way, users leaving a chatroom by their own request, and normal termination of a StreamedMedia call by the remote user. If the SelfHandle is removed from a group for this reason and the actor is not the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Terminated. If the SelfHandle is removed from a group for this reason and the actor is also the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled.

 

TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE

The change is due to a user going offline. Also used when user is already offline, but this wasn't known previously. If a one-to-one StreamedMedia call fails because the contact being called is offline, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Offline. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If a handle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Offline.

 

TP_CHANNEL_GROUP_CHANGE_REASON_KICKED

The change is due to a kick operation. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Kicked.

 

TP_CHANNEL_GROUP_CHANGE_REASON_BUSY

The change is due to a busy indication. If a one-to-one StreamedMedia call fails because the contact being called is busy, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Busy. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Busy.

 

TP_CHANNEL_GROUP_CHANGE_REASON_INVITED

The change is due to an invitation. This reason SHOULD only be used when contacts are added to the remote-pending set (to indicate that the contact has been invited) or to the members (to indicate that the contact has accepted the invitation). Otherwise, what would it mean?

 

TP_CHANNEL_GROUP_CHANGE_REASON_BANNED

The change is due to a kick+ban operation. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Banned.

 

TP_CHANNEL_GROUP_CHANGE_REASON_ERROR

The change is due to an error occurring.

 

TP_CHANNEL_GROUP_CHANGE_REASON_INVALID_CONTACT

The change is because the requested contact does not exist. For instance, if the user invites a nonexistent contact to a chatroom or attempts to call a nonexistent contact, this could be indicated by the CM adding that contact's handle to remote-pending for reason None or Invited, then removing it for reason Invalid_Contact. In the case of a 1-1 StreamedMedia call, the CM SHOULD remove the self handle from the Group in the same signal. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.DoesNotExist.

 

TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER

The change is because the requested contact did not respond. If a one-to-one StreamedMedia call fails because the contact being called did not respond, or the local user did not respond to an incoming call, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason No_Answer. Documenting existing practice. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.NoAnswer.

 

TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED

The change is because a contact's unique identifier changed. There must be exactly one handle in the removed set and exactly one handle in one of the added sets. The Renamed signal on the Renaming interface will have been emitted for the same handles, shortly before this MembersChanged signal is emitted.

 

TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED

The change is because there was no permission to contact the requested handle. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.PermissionDenied.

 

TP_CHANNEL_GROUP_CHANGE_REASON_SEPARATED

If members are removed with this reason code, the change is because the group has split into unconnected parts which can only communicate within themselves (e.g. netsplits on IRC use this reason code). If members are added with this reason code, the change is because unconnected parts of the group have rejoined. If this channel carries messages (e.g. Text or Tubes channels) applications must assume that the contacts being added are likely to have missed some messages as a result of the separation, and that the contacts in the group are likely to have missed some messages from the contacts being added. Note that from the added contacts' perspective, they have been in the group all along, and the contacts we indicate to be in the group (including the local user) have just rejoined the group with reason Separated. Application protocols in Tubes should be prepared to cope with this situation. The SelfHandle SHOULD NOT be removed from channels with this reason.

 

NUM_TP_CHANNEL_GROUP_CHANGE_REASONS

#define NUM_TP_CHANNEL_GROUP_CHANGE_REASONS TP_NUM_CHANNEL_GROUP_CHANGE_REASONS

1 higher than the highest valid value of TpChannelGroupChangeReason. In new code, use TP_NUM_CHANNEL_GROUP_CHANGE_REASONS instead.


TP_NUM_CHANNEL_GROUP_CHANGE_REASONS

#define TP_NUM_CHANNEL_GROUP_CHANGE_REASONS (11+1)

1 higher than the highest valid value of TpChannelGroupChangeReason.


enum TpChannelPasswordFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_PASSWORD_FLAG_PROVIDE

The ProvidePassword method must be called now for the user to join the channel

 

TP_CHANNEL_PASSWORD_FLAG_HINT

The RoomConfig1.PasswordHint contains a hint for the password.

 

enum TpContactBlockingCapabilities

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONTACT_BLOCKING_CAPABILITY_CAN_REPORT_ABUSIVE

When calling BlockContacts, the contacts may be reporting as abusive to the server administrators by setting Report_Abusive to True.

 

enum TpDeliveryReportingSupportFlags

Flags indicating the level of support for delivery reporting on this channel, as found on the DeliveryReportingSupport property. Any future flags added to this set will conform to the convention that the presence of an extra flag implies that more operations will succeed. Note that CMs may always provide more reports than are requested in the Message_Sending_Flags passed to SendMessage. If senders want delivery reports, they should ask for them. If they don't want delivery reports, they can just ignore them, so there's no need to have capability discovery for what will happen if a delivery report isn't requested.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES

Clients MAY expect to receive negative delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending.

 

TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_SUCCESSES

Clients MAY expect to receive positive delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending.

 

TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_READ

Clients MAY expect to receive Delivery_Status Read reports if Message_Sending_Flag_Report_Read is specified when sending.

 

TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_DELETED

Clients MAY expect to receive Delivery_Status Deleted reports if Message_Sending_Flag_Report_Deleted is specified when sending.

 

enum TpDeliveryStatus

The status of a message as indicated by a delivery report. If this enum is extended in future specifications, this should only be to add new, non-overlapping conditions (i.e. all failures should still be signalled as either Temporarily_Failed or Permanently_Failed). If additional detail is required (e.g. distinguishing between the various types of permanent failure) this will be done using additional Delivery_Report_Header_Keys.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_DELIVERY_STATUS_UNKNOWN

The message's disposition is unknown. Clients SHOULD consider all messages to have status Delivery_Status_Unknown unless otherwise specified; connection managers SHOULD NOT signal this delivery status explicitly.

 

TP_DELIVERY_STATUS_DELIVERED

The message has been delivered to the intended recipient.

 

TP_DELIVERY_STATUS_TEMPORARILY_FAILED

Delivery of the message has failed. Clients SHOULD notify the user, but MAY automatically try sending another copy of the message. Similar to errors with type="wait" in XMPP; analogous to 4xx errors in SMTP.

 

TP_DELIVERY_STATUS_PERMANENTLY_FAILED

Delivery of the message has failed. Clients SHOULD NOT try again unless by specific user action. If the user does not modify the message or alter configuration before re-sending, this error is likely to happen again. Similar to errors with type="cancel", type="modify" or type="auth" in XMPP; analogous to 5xx errors in SMTP.

 

TP_DELIVERY_STATUS_ACCEPTED

An intermediate server has accepted the message but the message has not been yet delivered to the ultimate recipient. The connection manager might send a Failed report or Delivered report later. Similar to "202 Accepted" success code in SIP; analogous to 251 and 252 responses in SMTP.

 

TP_DELIVERY_STATUS_READ

The message has been read by the intended recipient.

 

TP_DELIVERY_STATUS_DELETED

The message has been deleted by the intended recipient. This MAY be signalled on its own if the message is deleted without being read, or after Read if the message was read before being deleted.

 

NUM_TP_DELIVERY_STATUSES

#define NUM_TP_DELIVERY_STATUSES TP_NUM_DELIVERY_STATUSES

1 higher than the highest valid value of TpDeliveryStatus. In new code, use TP_NUM_DELIVERY_STATUSES instead.


TP_NUM_DELIVERY_STATUSES

#define TP_NUM_DELIVERY_STATUSES (6+1)

1 higher than the highest valid value of TpDeliveryStatus.


enum TpMediaStreamError

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_ERROR_UNKNOWN

An unknown error occured.

 

TP_MEDIA_STREAM_ERROR_EOS

The end of the stream was reached.

 

TP_MEDIA_STREAM_ERROR_CODEC_NEGOTIATION_FAILED

There are no common codecs between the local side and the other particpants in the call. The possible codecs are not signalled here: the streaming implementation is assumed to report them in an implementation-dependent way, e.g. Farsight should use GstMissingElement.

 

TP_MEDIA_STREAM_ERROR_CONNECTION_FAILED

A network connection for the Media could not be established or was lost.

 

TP_MEDIA_STREAM_ERROR_NETWORK_ERROR

There was an error in the networking stack (other than the connection failure).

 

TP_MEDIA_STREAM_ERROR_NO_CODECS

There are no installed codecs for this media type.

 

TP_MEDIA_STREAM_ERROR_INVALID_CM_BEHAVIOR

The CM is doing something wrong.

 

TP_MEDIA_STREAM_ERROR_MEDIA_ERROR

There was an error in the media processing stack.

 

NUM_TP_MEDIA_STREAM_ERRORS

#define NUM_TP_MEDIA_STREAM_ERRORS TP_NUM_MEDIA_STREAM_ERRORS

1 higher than the highest valid value of TpMediaStreamError. In new code, use TP_NUM_MEDIA_STREAM_ERRORS instead.


TP_NUM_MEDIA_STREAM_ERRORS

#define TP_NUM_MEDIA_STREAM_ERRORS (7+1)

1 higher than the highest valid value of TpMediaStreamError.


enum TpMediaStreamBaseProto

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_BASE_PROTO_UDP

UDP (User Datagram Protocol)

 

TP_MEDIA_STREAM_BASE_PROTO_TCP

TCP (Transmission Control Protocol)

 

NUM_TP_MEDIA_STREAM_BASE_PROTOS

#define NUM_TP_MEDIA_STREAM_BASE_PROTOS TP_NUM_MEDIA_STREAM_BASE_PROTOS

1 higher than the highest valid value of TpMediaStreamBaseProto. In new code, use TP_NUM_MEDIA_STREAM_BASE_PROTOS instead.


TP_NUM_MEDIA_STREAM_BASE_PROTOS

#define TP_NUM_MEDIA_STREAM_BASE_PROTOS (1+1)

1 higher than the highest valid value of TpMediaStreamBaseProto.


enum TpMediaStreamTransportType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MEDIA_STREAM_TRANSPORT_TYPE_LOCAL

A local address

 

TP_MEDIA_STREAM_TRANSPORT_TYPE_DERIVED

An external address derived by a method such as STUN

 

TP_MEDIA_STREAM_TRANSPORT_TYPE_RELAY

An external stream relay

 

NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES

#define NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES

1 higher than the highest valid value of TpMediaStreamTransportType. In new code, use TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES instead.


TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES

#define TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES (2+1)

1 higher than the highest valid value of TpMediaStreamTransportType.


enum TpPropertyFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_PROPERTY_FLAG_READ

The property can be read

 

TP_PROPERTY_FLAG_WRITE

The property can be written

 

enum TpMessagePartSupportFlags

Flags indicating the level of support for message parts on this channel. They are designed such that setting more flags always implies that the channel has more capabilities. If no flags are set, this indicates that messages may contain a single message part whose content-type is any of the types from SupportedContentTypes, possibly with some alternatives. There is no flag indicating support for alternatives. This is because the SendMessage implementation can always accept messages containing alternatives, even if the underlying protocol does not, by deleting all alternatives except the first (most preferred) that is supported. Each of the flags so far implies the previous flag, so we could have used a simple enumeration here; however, we've defined the message-part support indicator as a flag set for future expansion. See SupportedContentTypes for some examples.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT

SendMessage will accept messages containing a textual message body, plus a single attachment of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_Data_Only is not also set (because the connection manager can trivially provide an empty text part if necessary).

 

TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS

SendMessage will accept messages containing a textual message body, plus an arbitrary number of attachments of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_One_Attachment is not also set.

 

enum TpMessageSendingFlags

Flags altering the way a message is sent. The "most usual" action should always be to have these flags unset. Some indication of which flags are supported is provided by the DeliveryReportingSupport property.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MESSAGE_SENDING_FLAG_REPORT_DELIVERY

Provide a successful delivery report if possible, even if this is not the default for this protocol. Ignored if delivery reports are not possible on this protocol. In some protocols, like XMPP, it is not conventional to request or send positive delivery notifications. Delivery failure reports SHOULD always be sent, but if this flag is present, the connection manager MAY also try harder to obtain failed delivery reports or allow them to be matched to outgoing messages.

 

TP_MESSAGE_SENDING_FLAG_REPORT_READ

Provide a delivery report when the message is read by the recipient, even if this is not the default for this protocol. Ignored if read reports are not possible on this protocol.

 

TP_MESSAGE_SENDING_FLAG_REPORT_DELETED

Provide a delivery report when the message is deleted by the recipient, even if this is not the default for this protocol. Ignored if such reports are not possible on this protocol.

 

NUM_TP_SOCKET_ACCESS_CONTROLS

#define NUM_TP_SOCKET_ACCESS_CONTROLS TP_NUM_SOCKET_ACCESS_CONTROLS

1 higher than the highest valid value of TpSocketAccessControl. In new code, use TP_NUM_SOCKET_ACCESS_CONTROLS instead.


TP_NUM_SOCKET_ACCESS_CONTROLS

#define TP_NUM_SOCKET_ACCESS_CONTROLS (3+1)

1 higher than the highest valid value of TpSocketAccessControl.


enum TpSocketAccessControl

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SOCKET_ACCESS_CONTROL_LOCALHOST

The IP or Unix socket can be accessed by any local user (e.g. a Unix socket that accepts all local connections, or an IP socket listening on 127.0.0.1 (or ::1) or rejecting connections not from that address). The associated variant must be ignored. For a D-Bus tube, this means that the "same user" access control typically provided by default in D-Bus implementations SHOULD be disabled. If the socket is only available to local users (e.g. a Unix socket, an IPv4 socket bound to 127.0.0.1, or an IPv6 socket bound to ::1), the ANONYMOUS authentication mechanism MAY be enabled.

 

TP_SOCKET_ACCESS_CONTROL_PORT

May only be used on IP sockets, and only for Stream tubes. The associated variant must contain a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the string form of an IP address of the appropriate version, and a port number. The socket can only be accessed if the connecting process has that address and port number; all other connections will be rejected.

 

TP_SOCKET_ACCESS_CONTROL_NETMASK

May only be used on IP sockets. The associated variant must contain a struct Socket_Netmask_IPv4 (or Socket_Netmask_IPv6) with signature (sy), containing the string form of an IP address of the appropriate version, and a prefix length "n". The socket can only be accessed if the first n bits of the connecting address match the first n bits of the given address.

 

TP_SOCKET_ACCESS_CONTROL_CREDENTIALS

The high-level meaning of this access control type is that only the same user (e.g. same numeric Unix uid) is allowed to interact with the tube. Exactly how this is achieved varies by channel type. For StreamTube channels, this access control type may only be used on UNIX sockets. The connecting process must send a byte when it first connects, which is not considered to be part of the data stream. If the operating system uses <link linkend="sendmsg"><function>sendmsg()</function></link> with SCM_CREDS or SCM_CREDENTIALS to pass credentials over sockets, the connecting process must do so if possible; if not, it must still send the byte, without any attached credentials. (This mechanism is very similar to the first byte of a D-Bus connection, except that in D-Bus the byte is always zero, whereas in Tubes it can be nonzero.) For DBusTube channels, this access control type may be used on any type of socket, and there is no extra byte added by Telepathy at the beginning of the stream: all bytes in the stream are part of the D-Bus tube connection. The connecting process should prove its identity via any of the SASL authentication mechanisms usually used for D-Bus (in typical D-Bus implementations this involves either sending and receiving credentials as above, or demonstrating the ability to write to a file in the user's home directory). In either case, the listening process will disconnect the connection unless it can determine by OS-specific means that the connecting process has the same user ID as the listening process. In either tube type, the associated variant must be ignored.

 

NUM_TP_SOCKET_ADDRESS_TYPES

#define NUM_TP_SOCKET_ADDRESS_TYPES TP_NUM_SOCKET_ADDRESS_TYPES

1 higher than the highest valid value of TpSocketAddressType. In new code, use TP_NUM_SOCKET_ADDRESS_TYPES instead.


TP_NUM_SOCKET_ADDRESS_TYPES

#define TP_NUM_SOCKET_ADDRESS_TYPES (3+1)

1 higher than the highest valid value of TpSocketAddressType.


enum TpSocketAddressType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SOCKET_ADDRESS_TYPE_UNIX

A Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket.

 

TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX

An abstract Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket including the leading null byte.

 

TP_SOCKET_ADDRESS_TYPE_IPV4

An IPv4 socket. The address variant contains a Socket_Address_IPv4, i.e. a structure with signature (sq) in which the string is an IPv4 dotted-quad address literal (and must not be a DNS name), while the 16-bit unsigned integer is the port number.

 

TP_SOCKET_ADDRESS_TYPE_IPV6

An IPv6 socket. The address variant contains a Socket_Address_IPv6, i.e. a structure with signature (sq) in which the string is an IPv6 address literal as specified in RFC2373 (and must not be a DNS name), while the 16-bit unsigned integer is the port number.

 

NUM_TP_TUBE_STATES

#define NUM_TP_TUBE_STATES TP_NUM_TUBE_STATES

1 higher than the highest valid value of TpTubeState. In new code, use TP_NUM_TUBE_STATES instead.


TP_NUM_TUBE_STATES

#define TP_NUM_TUBE_STATES (2+1)

1 higher than the highest valid value of TpTubeState.


enum TpTubeState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_TUBE_STATE_LOCAL_PENDING

The tube is waiting to be accepted/closed locally.

 

TP_TUBE_STATE_REMOTE_PENDING

The tube is waiting to be accepted/closed remotely.

 

TP_TUBE_STATE_OPEN

The tube is open for traffic.

 

NUM_TP_TUBE_TYPES

#define NUM_TP_TUBE_TYPES TP_NUM_TUBE_TYPES

1 higher than the highest valid value of TpTubeType. In new code, use TP_NUM_TUBE_TYPES instead.


TP_NUM_TUBE_TYPES

#define TP_NUM_TUBE_TYPES (1+1)

1 higher than the highest valid value of TpTubeType.


enum TpTubeType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_TUBE_TYPE_DBUS

The tube is D-Bus tube as described by the org.freedesktop.Telepathy.Channel.Type.DBusTube interface.

 

TP_TUBE_TYPE_STREAM

The tube is stream tube as described by the org.freedesktop.Telepathy.Channel.Type.StreamTube interface.

 

enum TpChannelCallStateFlags

A set of flags representing call states.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CHANNEL_CALL_STATE_RINGING

The contact has been alerted about the call but has not responded (e.g. 180 Ringing in SIP).

 

TP_CHANNEL_CALL_STATE_QUEUED

The contact is temporarily unavailable, and the call has been placed in a queue (e.g. 182 Queued in SIP, or call-waiting in telephony).

 

TP_CHANNEL_CALL_STATE_HELD

The contact has placed the call on hold, and will not receive media from the local user or any other participants until they unhold the call again.

 

TP_CHANNEL_CALL_STATE_FORWARDED

The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted.

 

TP_CHANNEL_CALL_STATE_IN_PROGRESS

Progress has been made in placing the outgoing call, but the destination contact may not have been made aware of the call yet (so the Ringing state is not appropriate). This corresponds to SIP's status code 183 Session Progress, and could be used when the outgoing call has reached a gateway, for instance.

 

TP_CHANNEL_CALL_STATE_CONFERENCE_HOST

This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact.

 

NUM_TP_LOCAL_HOLD_STATES

#define NUM_TP_LOCAL_HOLD_STATES TP_NUM_LOCAL_HOLD_STATES

1 higher than the highest valid value of TpLocalHoldState. In new code, use TP_NUM_LOCAL_HOLD_STATES instead.


TP_NUM_LOCAL_HOLD_STATES

#define TP_NUM_LOCAL_HOLD_STATES (3+1)

1 higher than the highest valid value of TpLocalHoldState.


enum TpLocalHoldState

The hold state of a channel.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_LOCAL_HOLD_STATE_UNHELD

All streams are unheld (the call is active). New channels SHOULD have this hold state.

 

TP_LOCAL_HOLD_STATE_HELD

All streams are held (the call is on hold)

 

TP_LOCAL_HOLD_STATE_PENDING_HOLD

The connection manager is attempting to move to state Held, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information.

 

TP_LOCAL_HOLD_STATE_PENDING_UNHOLD

The connection manager is attempting to move to state Unheld, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information.

 

NUM_TP_LOCAL_HOLD_STATE_REASONS

#define NUM_TP_LOCAL_HOLD_STATE_REASONS TP_NUM_LOCAL_HOLD_STATE_REASONS

1 higher than the highest valid value of TpLocalHoldStateReason. In new code, use TP_NUM_LOCAL_HOLD_STATE_REASONS instead.


TP_NUM_LOCAL_HOLD_STATE_REASONS

#define TP_NUM_LOCAL_HOLD_STATE_REASONS (2+1)

1 higher than the highest valid value of TpLocalHoldStateReason.


enum TpLocalHoldStateReason

The reason for a change to the Local_Hold_State. Clients MUST treat unknown values as equivalent to Local_Hold_State_Reason_None.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_LOCAL_HOLD_STATE_REASON_NONE

The reason cannot be described by any of the predefined values (connection managers SHOULD avoid this reason, but clients MUST handle it gracefully)

 

TP_LOCAL_HOLD_STATE_REASON_REQUESTED

The change is in response to a user request

 

TP_LOCAL_HOLD_STATE_REASON_RESOURCE_NOT_AVAILABLE

The change is because some resource was not available

 

enum TpAccessControlType

A type for communication access control. These control policies are used in CommunicationPolicy.DRAFT as well as most rich presence interfaces. New interfaces should use this type, and NOT Rich_Presence_Access_Control_Type.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_ACCESS_CONTROL_TYPE_WHITELIST

Only allow contacts that are in a certain whitelist. The associated variant in Access_Control is a list of Contact_Handle representing the whitelist, with signature au.

 

TP_ACCESS_CONTROL_TYPE_PUBLISH_LIST

Allow contacts in the user's 'publish' list. The associated variant in Access_Control is ignored.

 

TP_ACCESS_CONTROL_TYPE_GROUP

Only allow contacts that are in a certain group. The associated variant in Access_Control is a Group_Handle representing the permitted group.

 

TP_ACCESS_CONTROL_TYPE_OPEN

Allow all contacts. The associated variant in Access_Control is ignored.

 

TP_ACCESS_CONTROL_TYPE_SUBSCRIBE_OR_PUBLISH_LIST

Allow all contacts in the user's 'subscribe' or 'publish' list. The associated variant in Access_Control is ignored.

 

TP_ACCESS_CONTROL_TYPE_CLOSED

Forbid all contacts. The associated variant in Access_Control is ignored.

 

TP_ACCESS_CONTROL_TYPE_NOT_UNDERSTOOD

The access control rule is too complex to be represented in the current Telepathy API. The associated variant is meaningless. Setting this mode is never valid; the connection manager MUST raise an error if this is attempted. XEP-0016 Privacy Lists can easily produce access control mechanisms that can't be expressed in a simpler API. We need to be able to at least indicate that fact. The associated variant in Access_Control is ignored.

 

NUM_TP_ACCESS_CONTROL_TYPES

#define NUM_TP_ACCESS_CONTROL_TYPES TP_NUM_ACCESS_CONTROL_TYPES

1 higher than the highest valid value of TpAccessControlType. In new code, use TP_NUM_ACCESS_CONTROL_TYPES instead.


TP_NUM_ACCESS_CONTROL_TYPES

#define TP_NUM_ACCESS_CONTROL_TYPES (6+1)

1 higher than the highest valid value of TpAccessControlType.


enum TpRichPresenceAccessControlType

A type of access control for Rich_Presence_Access_Control. For most types, the exact access control is given by an associated variant. These are the access control types from XMPP publish/subscribe (XEP-0060). Location uses this for historical reasons, new interfaces will use Access_Control_Type.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_RICH_PRESENCE_ACCESS_CONTROL_TYPE_WHITELIST

The associated variant is a list of contacts (signature 'au', Contact_Handle[]) who can see the extended presence information.

 

TP_RICH_PRESENCE_ACCESS_CONTROL_TYPE_PUBLISH_LIST

All contacts in the user's 'publish' contact list can see the extended presence information. The associated variant is ignored.

 

TP_RICH_PRESENCE_ACCESS_CONTROL_TYPE_GROUP

The associated variant is a handle of type Group (signature 'u', Group_Handle) representing a group of contacts who can see the extended presence information.

 

TP_RICH_PRESENCE_ACCESS_CONTROL_TYPE_OPEN

Anyone with access to the service can see the extended presence information.

 

NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES

#define NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES

1 higher than the highest valid value of TpRichPresenceAccessControlType. In new code, use TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES instead.


TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES

#define TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES (3+1)

1 higher than the highest valid value of TpRichPresenceAccessControlType.


enum TpFileHashType

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_FILE_HASH_TYPE_NONE

No hash.

 

TP_FILE_HASH_TYPE_MD5

MD5 digest as a string of 32 ASCII hex digits.

 

TP_FILE_HASH_TYPE_SHA1

SHA1 digest as a string of ASCII hex digits.

 

TP_FILE_HASH_TYPE_SHA256

SHA256 digest as a string of ASCII hex digits.

 

NUM_TP_FILE_HASH_TYPES

#define NUM_TP_FILE_HASH_TYPES TP_NUM_FILE_HASH_TYPES

1 higher than the highest valid value of TpFileHashType. In new code, use TP_NUM_FILE_HASH_TYPES instead.


TP_NUM_FILE_HASH_TYPES

#define TP_NUM_FILE_HASH_TYPES (3+1)

1 higher than the highest valid value of TpFileHashType.


enum TpFileTransferState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_FILE_TRANSFER_STATE_NONE

An invalid state type used as a null value. This value MUST NOT appear in the State property.

 

TP_FILE_TRANSFER_STATE_PENDING

The file transfer is waiting to be accepted/closed by the receiver. The receiver has to call AcceptFile, then wait for the state to change to Open and check the offset value.

 

TP_FILE_TRANSFER_STATE_ACCEPTED

The receiver has accepted the transfer. The sender now has to call ProvideFile to actually start the transfer. The receiver should now wait for the state to change to Open and check the offset value.

 

TP_FILE_TRANSFER_STATE_OPEN

The file transfer is open for traffic.

 

TP_FILE_TRANSFER_STATE_COMPLETED

The file transfer has been completed successfully.

 

TP_FILE_TRANSFER_STATE_CANCELLED

The file transfer has been cancelled.

 

NUM_TP_FILE_TRANSFER_STATES

#define NUM_TP_FILE_TRANSFER_STATES TP_NUM_FILE_TRANSFER_STATES

1 higher than the highest valid value of TpFileTransferState. In new code, use TP_NUM_FILE_TRANSFER_STATES instead.


TP_NUM_FILE_TRANSFER_STATES

#define TP_NUM_FILE_TRANSFER_STATES (5+1)

1 higher than the highest valid value of TpFileTransferState.


enum TpFileTransferStateChangeReason

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE

No reason was specified.

 

TP_FILE_TRANSFER_STATE_CHANGE_REASON_REQUESTED

The change in state was requested.

 

TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_STOPPED

The file transfer was cancelled by the local user.

 

TP_FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_STOPPED

The file transfer was cancelled by the remote user.

 

TP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR

The file transfer was cancelled because of a local error.

 

TP_FILE_TRANSFER_STATE_CHANGE_REASON_REMOTE_ERROR

The file transfer was cancelled because of a remote error.

 

NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS

#define NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS

1 higher than the highest valid value of TpFileTransferStateChangeReason. In new code, use TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS instead.


TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS

#define TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS (5+1)

1 higher than the highest valid value of TpFileTransferStateChangeReason.


enum TpTubeChannelState

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_TUBE_CHANNEL_STATE_LOCAL_PENDING

The initiator offered the tube. The tube is waiting to be accepted/closed locally. If the client accepts the tube, the tube's state will be Open.

 

TP_TUBE_CHANNEL_STATE_REMOTE_PENDING

The tube is waiting to be accepted/closed remotely. If the recipient accepts the tube, the tube's state will be Open.

 

TP_TUBE_CHANNEL_STATE_OPEN

The initiator offered the tube and the recipient accepted it. The tube is open for traffic. The tube's state stays in this state until it is closed.

 

TP_TUBE_CHANNEL_STATE_NOT_OFFERED

The tube channel has been requested but the tube is not yet offered. The client should offer the tube to the recipient and the tube's state will be Remote_Pending. The method used to offer the tube depends on the tube type.

 

NUM_TP_TUBE_CHANNEL_STATES

#define NUM_TP_TUBE_CHANNEL_STATES TP_NUM_TUBE_CHANNEL_STATES

1 higher than the highest valid value of TpTubeChannelState. In new code, use TP_NUM_TUBE_CHANNEL_STATES instead.


TP_NUM_TUBE_CHANNEL_STATES

#define TP_NUM_TUBE_CHANNEL_STATES (3+1)

1 higher than the highest valid value of TpTubeChannelState.


enum TpDebugLevel

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_DEBUG_LEVEL_ERROR

Log level for errors. Error messages are always fatal, resulting in the service terminating after something completely unexpected occurred.

 

TP_DEBUG_LEVEL_CRITICAL

Log level for critical messages. Critical messages are messages that the service might predict and it is up to the service itself to decide whether to terminate following a critical message.

 

TP_DEBUG_LEVEL_WARNING

Log level for warnings.

 

TP_DEBUG_LEVEL_MESSAGE

Log level for messages.

 

TP_DEBUG_LEVEL_INFO

Log level for information messages.

 

TP_DEBUG_LEVEL_DEBUG

Log level for debug messages.

 

NUM_TP_DEBUG_LEVELS

#define NUM_TP_DEBUG_LEVELS TP_NUM_DEBUG_LEVELS

1 higher than the highest valid value of TpDebugLevel. In new code, use TP_NUM_DEBUG_LEVELS instead.


TP_NUM_DEBUG_LEVELS

#define TP_NUM_DEBUG_LEVELS (5+1)

1 higher than the highest valid value of TpDebugLevel.


enum TpContactInfoFlags

Flags defining the behaviour of contact information on this protocol. Some protocols provide no information on contacts without an explicit request; others always push information to the connection manager as and when it changes.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONTACT_INFO_FLAG_CAN_SET

Indicates that SetContactInfo is supported on this connection.

 

TP_CONTACT_INFO_FLAG_PUSH

Indicates that the protocol pushes all contacts' information to the connection manager without prompting. If set, ContactInfoChanged will be emitted whenever contacts' information changes.

 

enum TpContactInfoFieldFlags

Flags describing the behaviour of a vCard field.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT

If present, exactly the parameters indicated must be set on this field; in the case of an empty list of parameters, this implies that parameters may not be used. If absent, and the list of allowed parameters is non-empty, any (possibly empty) subset of that list may be used. If absent, and the list of allowed parameters is empty, any parameters may be used.

 

TP_CONTACT_INFO_FIELD_FLAG_OVERWRITTEN_BY_NICKNAME

Indicates that this field will be overwritten when the user's alias is changed with SetAliases or when the Account's Nickname is updated. Clients that allow the editing of the Alias and the ContactInfo in the same location should hide fields with this flag. If a client allowed the user to edit both the nickname and the ContactInfo field at the same time, the user could set them to two different values even though they map to the same property. This would result in surprising behavior where the second value would win over the first. In addition to hiding this field when editing ContactInfo together with the user's nickname, it is recommended that clients call SetContactInfo before setting the user's nickname. This ensures that if the user changes the nickname, the correct value will get set even if the stale nickname is mistakenly sent along with SetContactInfo. If used, this flag typically appears on either the 'nickname' or 'fn' field.

 

enum TpLocationFeatures

Flags describing the Location features which may be supported on any given connection.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_LOCATION_FEATURE_CAN_SET

Indicates that setting your own location with SetLocation is supported on this connection.

 

enum TpServicePointType

The various types of service points a channel might connect to.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SERVICE_POINT_TYPE_NONE

The channel is not communicating with a service point, or it is not known whether it is communicating with a service point (e.g. an ordinary call).

 

TP_SERVICE_POINT_TYPE_EMERGENCY

The service point is a generic emergency point.

 

TP_SERVICE_POINT_TYPE_COUNSELING

The service point is some kind of counseling service (ie, mental health or child-services counseling).

 

NUM_TP_SERVICE_POINT_TYPES

#define NUM_TP_SERVICE_POINT_TYPES TP_NUM_SERVICE_POINT_TYPES

1 higher than the highest valid value of TpServicePointType. In new code, use TP_NUM_SERVICE_POINT_TYPES instead.


TP_NUM_SERVICE_POINT_TYPES

#define TP_NUM_SERVICE_POINT_TYPES (2+1)

1 higher than the highest valid value of TpServicePointType.


enum TpAnonymityModeFlags

Flags for the various types of anonymity modes. These modes are solely to inform the CM of the desired anonymous settings. It is up to the CM to determine whether the anonymity modes should be handled within the CM itself, or whether the network that a CM might be talking to should be enforcing anonymity. CMs MAY support only a subset of these modes, and specific connections MAY support none at all.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_ANONYMITY_MODE_CLIENT_INFO

Obscure any information that provides user identification, user-agent identification or personal details. Examples of this information might be GSM CallerID, SIP from address, various informational email headers, etc. The CM should scrub/replace any of this information before passing messages or data onto the network. Note that a CM which has the option of obscuring the information at the CM or privacy service level would choose both (anonymity services are opaque to clients of this interface). Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info.

 

TP_ANONYMITY_MODE_SHOW_CLIENT_INFO

Explicitly request showing of client information. In connection context, this can be used to override service default. In channel context, this overrides connection anonymity modes. In GSM, it's possible to have CLIR enabled by default, and explicitly suppress CLIR for a single phone call. Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info. The CM MAY set both Client_Info and Show_Client_Info in SupportedAnonymityModes to indicate its support for explicitly hiding and publicising client information.

 

TP_ANONYMITY_MODE_NETWORK_INFO

Obscure any originating IP address information, contact URIs, and anonymize all traffic involved with sending/receiving any media streams or call content. Examples of this include the "headers" portions of RFC 3323 as well as the History-Info (described in RFC 4244) for a SIP CM. This SHOULD have the effect of hiding address information from the remote contact (ie, the contact cannot know what IP address the session is originated from). Obviously the network still needs to be able to route information between contacts, so this provides no guarantees of what can be seen by intermediaries.

 

enum TpStorageRestrictionFlags

Flags indicating restrictions imposed on an Account by its storage method.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS

The account's Parameters property can't be changed by calling UpdateParameters.

 

TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED

The account can't be enabled/disabled by setting the Enabled property.

 

TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PRESENCE

The account's presence can't be changed by setting the RequestedPresence and AutomaticPresence properties.

 

TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_SERVICE

The account's Service property cannot be changed.

 

enum TpTLSCertificateRejectReason

Possible reasons to reject a TLS certificate.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN

The certificate has been rejected for another reason not listed in this enumeration.

 

TP_TLS_CERTIFICATE_REJECT_REASON_UNTRUSTED

The certificate is not trusted.

 

TP_TLS_CERTIFICATE_REJECT_REASON_EXPIRED

The certificate is expired.

 

TP_TLS_CERTIFICATE_REJECT_REASON_NOT_ACTIVATED

The certificate is not active yet.

 

TP_TLS_CERTIFICATE_REJECT_REASON_FINGERPRINT_MISMATCH

The certificate provided does not have the expected fingerprint.

 

TP_TLS_CERTIFICATE_REJECT_REASON_HOSTNAME_MISMATCH

The hostname certified does not match the provided one.

 

TP_TLS_CERTIFICATE_REJECT_REASON_SELF_SIGNED

The certificate is self-signed.

 

TP_TLS_CERTIFICATE_REJECT_REASON_REVOKED

The certificate has been revoked.

 

TP_TLS_CERTIFICATE_REJECT_REASON_INSECURE

The certificate uses an insecure cipher algorithm, or is cryptographically weak.

 

TP_TLS_CERTIFICATE_REJECT_REASON_LIMIT_EXCEEDED

The length in bytes of the certificate, or the depth of the certificate chain exceed the limits imposed by the crypto library.

 

NUM_TP_TLS_CERTIFICATE_REJECT_REASONS

#define NUM_TP_TLS_CERTIFICATE_REJECT_REASONS TP_NUM_TLS_CERTIFICATE_REJECT_REASONS

1 higher than the highest valid value of TpTLSCertificateRejectReason. In new code, use TP_NUM_TLS_CERTIFICATE_REJECT_REASONS instead.


TP_NUM_TLS_CERTIFICATE_REJECT_REASONS

#define TP_NUM_TLS_CERTIFICATE_REJECT_REASONS (9+1)

1 higher than the highest valid value of TpTLSCertificateRejectReason.


enum TpTLSCertificateState

The possible states for a TLSCertificate object.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_TLS_CERTIFICATE_STATE_PENDING

The certificate is currently waiting to be accepted or rejected.

 

TP_TLS_CERTIFICATE_STATE_ACCEPTED

The certificate has been verified.

 

TP_TLS_CERTIFICATE_STATE_REJECTED

The certificate has been rejected.

 

NUM_TP_TLS_CERTIFICATE_STATES

#define NUM_TP_TLS_CERTIFICATE_STATES TP_NUM_TLS_CERTIFICATE_STATES

1 higher than the highest valid value of TpTLSCertificateState. In new code, use TP_NUM_TLS_CERTIFICATE_STATES instead.


TP_NUM_TLS_CERTIFICATE_STATES

#define TP_NUM_TLS_CERTIFICATE_STATES (2+1)

1 higher than the highest valid value of TpTLSCertificateState.


enum TpContactMetadataStorageType

Values of this enumeration indicate the extent to which metadata such as aliases and group memberships can be stored for the contacts on a particular connection. On some protocols, certain metadata (for instance, contact aliases) can only be stored for contacts on the contact list, or contacts with a particular contact list state. To make it easier to deal with such protocols, if clients set metadata on a contact who is not in the required state, the Connection MUST cache the metadata for the duration of the session. If clients request the attributes of that contact after the appropriate "set" method has returned successfully, the Connection MUST return the new (cached) value. If the contact is later placed in the required state to store metadata (for instance, if subscription to the contact's presence is requested, on a protocol like MSN where the alias has storage type Subscribed_Or_Pending), the connection MUST store the cached metadata at that time. If the Connection didn't cache changes in this way, a client intending to change the alias on MSN would have to wait until the server acknowledged the subscription request; in the meantime, other clients would still display the old alias. The only exception to that general rule is that if the Connection cannot store particular metadata at all (i.e. the storage type is None), it MUST reject attempts to set it. If the implementation knows that metadata can't be stored at all, it's useful to report that, which can be done synchronously. In general, user interfaces should detect storage type None and not display editing controls at all.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONTACT_METADATA_STORAGE_TYPE_NONE

This connection cannot store this type of metadata at all, and attempting to do so will fail with NotImplemented. Link-local XMPP can't store aliases or group memberships at all, and subscription and presence states are implicit (all contacts on the local network have subscribe = publish = Yes and no other contacts exist). As of April 2010, the XMPP server for Facebook Chat provides a read-only view of the user's Facebook contacts, so it could also usefully have this storage type.

 

TP_CONTACT_METADATA_STORAGE_TYPE_SUBSCRIBED_OR_PENDING

This type of metadata can only be stored permanently for contacts whose subscribe attribute is Ask or Yes. Contact aliases and groups on MSN have this behaviour.

 

TP_CONTACT_METADATA_STORAGE_TYPE_SUBSCRIBED

This type of metadata can only be stored permanently for contacts whose subscribe attribute is Yes. No service with this behaviour is currently known, but it's a stricter form of Subscribed_Or_Pending.

 

TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE

The user can set this metadata for any valid contact identifier, whether or not they have any presence subscription relationship to it, and it will be stored on their contact list. Contact aliases and groups on XMPP have this behaviour; it is possible to put a contact in a group, or assign an alias to them, without requesting that presence be shared.

 

NUM_TP_CONTACT_METADATA_STORAGE_TYPES

#define NUM_TP_CONTACT_METADATA_STORAGE_TYPES TP_NUM_CONTACT_METADATA_STORAGE_TYPES

1 higher than the highest valid value of TpContactMetadataStorageType. In new code, use TP_NUM_CONTACT_METADATA_STORAGE_TYPES instead.


TP_NUM_CONTACT_METADATA_STORAGE_TYPES

#define TP_NUM_CONTACT_METADATA_STORAGE_TYPES (3+1)

1 higher than the highest valid value of TpContactMetadataStorageType.


enum TpSubscriptionState

An enumeration indicating whether presence subscription is denied, denied but pending permission, or allowed. The exact semantics vary according to where this type is used: see the subscribe and publish contact attributes for details.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SUBSCRIPTION_STATE_UNKNOWN

The presence subscription state is unknown.

 

TP_SUBSCRIPTION_STATE_NO

Presence information cannot be seen, and either the subscription state Removed_Remotely does not apply, or it is not known whether that state applies.

 

TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY

Presence information cannot be seen because the remote contact took action: either the local user's request to see the remote contact's presence was denied, or the remote contact requested to see the local user's presence but then cancelled their request.

 

TP_SUBSCRIPTION_STATE_ASK

Presence information cannot be seen. Permission to see presence information has been requested, and the request has not yet been declined or accepted.

 

TP_SUBSCRIPTION_STATE_YES

Presence information can be seen.

 

NUM_TP_SUBSCRIPTION_STATES

#define NUM_TP_SUBSCRIPTION_STATES TP_NUM_SUBSCRIPTION_STATES

1 higher than the highest valid value of TpSubscriptionState. In new code, use TP_NUM_SUBSCRIPTION_STATES instead.


TP_NUM_SUBSCRIPTION_STATES

#define TP_NUM_SUBSCRIPTION_STATES (4+1)

1 higher than the highest valid value of TpSubscriptionState.


enum TpContactListState

The progress made in retrieving the contact list.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CONTACT_LIST_STATE_NONE

The connection has not started to retrieve the contact list. If GetContactListAttributes is called in this state, it will raise NotYet.

 

TP_CONTACT_LIST_STATE_WAITING

The connection has started to retrieve the contact list, but has not yet succeeded or failed. If GetContactListAttributes is called in this state, it will raise NotYet.

 

TP_CONTACT_LIST_STATE_FAILURE

The connection has tried and failed to retrieve the contact list. If GetContactListAttributes is called in this state, it will immediately raise an error indicating the reason for failure. The connection manager SHOULD try again to obtain the contact list, if appropriate for the protocol. If it succeeds later, the ContactListState MUST advance to Success.

 

TP_CONTACT_LIST_STATE_SUCCESS

The connection has successfully retrieved the contact list. If GetContactListAttributes is called in this state, it will return successfully.

 

NUM_TP_CONTACT_LIST_STATES

#define NUM_TP_CONTACT_LIST_STATES TP_NUM_CONTACT_LIST_STATES

1 higher than the highest valid value of TpContactListState. In new code, use TP_NUM_CONTACT_LIST_STATES instead.


TP_NUM_CONTACT_LIST_STATES

#define TP_NUM_CONTACT_LIST_STATES (3+1)

1 higher than the highest valid value of TpContactListState.


enum TpHTTPMethod

The HTTP Method with which to request a URL.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_HTTP_METHOD_GET

Use the GET method when opening the URL.

 

TP_HTTP_METHOD_POST

Use the POST method when opening the URL. Refer to HTTP_Post_Data for more details.

 

NUM_TP_HTTP_METHODS

#define NUM_TP_HTTP_METHODS TP_NUM_HTTP_METHODS

1 higher than the highest valid value of TpHTTPMethod. In new code, use TP_NUM_HTTP_METHODS instead.


TP_NUM_HTTP_METHODS

#define TP_NUM_HTTP_METHODS (1+1)

1 higher than the highest valid value of TpHTTPMethod.


enum TpMailNotificationFlags

Flags representing capabilities provided by a connection manager. Those values can be used as bitfield. Some flags depend on, or conflict with, each other. Connections SHOULD implement as many of these features as the underlying protocol allows, preferring to implement Supports_Unread_Mails instead of Emits_Mails_Received if both are possible.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_MAIL_NOTIFICATION_FLAG_SUPPORTS_UNREAD_MAIL_COUNT

This Connection provides the number of unread e-mails (or e-mail threads) in the main folder of your e-mail account, as the UnreadMailCount property. The connection manager will update this value by emitting the UnreadMailsChanged signal.

 

TP_MAIL_NOTIFICATION_FLAG_SUPPORTS_UNREAD_MAILS

This Connection provides a detailed list of unread e-mails, as the UnreadMails property. If this flag is set, Supports_Unread_Mail_Count MUST be set, and Emits_Mails_Received MUST NOT be set. The Connection will update the list by emitting the UnreadMailsChanged signals.

 

TP_MAIL_NOTIFICATION_FLAG_EMITS_MAILS_RECEIVED

This Connection emits the MailsReceived signal, which provides details about newly arrived e-mails but does not maintain their read/unread status afterwards. This flag MUST NOT be combined with Supports_Unread_Mails.

 

TP_MAIL_NOTIFICATION_FLAG_SUPPORTS_REQUEST_INBOX_URL

This Connection can provide a URL (with optional POST data) to open the the inbox of the e-mail account in a web-based client, via the RequestInboxURL method.

 

TP_MAIL_NOTIFICATION_FLAG_SUPPORTS_REQUEST_MAIL_URL

This Connection can provide a URL (with optional POST data) to open a specific mail in a web-based client, via the RequestMailURL method. This feature is not useful unless either Emits_Mails_Received or Supports_Unread_Mails is set. If this flag is not set, clients SHOULD fall back to using RequestInboxURL if available.

 

TP_MAIL_NOTIFICATION_FLAG_THREAD_BASED

Each Mail represents a thread of e-mails, which MAY have more than one sender. Google Talk notifies users about new mail in terms of unread threads, rather than unread e-mails.

 

enum TpSASLAbortReason

A reason why SASL authentication was aborted by the client.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SASL_ABORT_REASON_INVALID_CHALLENGE

The server sent an invalid challenge or data.

 

TP_SASL_ABORT_REASON_USER_ABORT

The user aborted the authentication.

 

NUM_TP_SASL_ABORT_REASONS

#define NUM_TP_SASL_ABORT_REASONS TP_NUM_SASL_ABORT_REASONS

1 higher than the highest valid value of TpSASLAbortReason. In new code, use TP_NUM_SASL_ABORT_REASONS instead.


TP_NUM_SASL_ABORT_REASONS

#define TP_NUM_SASL_ABORT_REASONS (1+1)

1 higher than the highest valid value of TpSASLAbortReason.


enum TpSASLStatus

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SASL_STATUS_NOT_STARTED

The initial state. The Handler SHOULD either call AbortSASL, or connect to the NewChallenge signal then call StartMechanism or StartMechanismWithData.

 

TP_SASL_STATUS_IN_PROGRESS

The challenge/response exchange is in progress. The Handler SHOULD call either Respond or AcceptSASL exactly once per emission of NewChallenge, or call AbortSASL at any time.

 

TP_SASL_STATUS_SERVER_SUCCEEDED

The server has indicated successful authentication, and the connection manager is waiting for confirmation from the Handler. The Handler must call either AcceptSASL or AbortSASL to indicate whether it considers authentication to have been successful.

 

TP_SASL_STATUS_CLIENT_ACCEPTED

The Handler has indicated successful authentication, and the connection manager is waiting for confirmation from the server. The state will progress to either Succeeded or Server_Failed when confirmation is received.

 

TP_SASL_STATUS_SUCCEEDED

Everyone is happy (the server sent success, and the client has called AcceptSASL). Connection to the server will proceed as soon as this state is reached. The Handler SHOULD call Close to close the channel.

 

TP_SASL_STATUS_SERVER_FAILED

The server has indicated an authentication failure. If CanTryAgain is true, the client may try to authenticate again, by calling StartMechanism or StartMechanismWithData again. Otherwise, it should give up completely, by calling Close on the channel.

 

TP_SASL_STATUS_CLIENT_FAILED

The client has indicated an authentication failure. The possible actions are the same as for Server_Failed.

 

NUM_TP_SASL_STATUSES

#define NUM_TP_SASL_STATUSES TP_NUM_SASL_STATUSES

1 higher than the highest valid value of TpSASLStatus. In new code, use TP_NUM_SASL_STATUSES instead.


TP_NUM_SASL_STATUSES

#define TP_NUM_SASL_STATUSES (6+1)

1 higher than the highest valid value of TpSASLStatus.


enum TpCaptchaStatus

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CAPTCHA_STATUS_LOCAL_PENDING

The challenge/response exchange is in progress and waiting for a local action. Call AnswerCaptchas to go to the Remote_Pending state, or call CancelCaptcha followed by Close to give up.

 

TP_CAPTCHA_STATUS_REMOTE_PENDING

The challenge/response exchange is in progress and waiting for a response from the server. Wait for a reply from the server, which will result in the Succeeded, Try_Again, or Failed state, or call CancelCaptcha followed by Close to give up.

 

TP_CAPTCHA_STATUS_SUCCEEDED

Everyone is happy. Connection to the server will proceed as soon as this state is reached. There is nothing useful to do in this state except to call Close to close the channel.

 

TP_CAPTCHA_STATUS_TRY_AGAIN

The server has indicated an authentication failure. Call GetCaptchas again to get a new captcha, or CancelCaptcha followed by Close to give up.

 

TP_CAPTCHA_STATUS_FAILED

Authentication has failed in some way. There is nothing useful to do in this state except to close the channel with Close.

 

NUM_TP_CAPTCHA_STATUSES

#define NUM_TP_CAPTCHA_STATUSES TP_NUM_CAPTCHA_STATUSES

1 higher than the highest valid value of TpCaptchaStatus. In new code, use TP_NUM_CAPTCHA_STATUSES instead.


TP_NUM_CAPTCHA_STATUSES

#define TP_NUM_CAPTCHA_STATUSES (4+1)

1 higher than the highest valid value of TpCaptchaStatus.


enum TpCaptchaCancelReason

A reason why captcha authentication was aborted by the client.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CAPTCHA_CANCEL_REASON_USER_CANCELLED

The user aborted the authentication. If this is used, the CaptchaError SHOULD be set to Cancelled

 

TP_CAPTCHA_CANCEL_REASON_NOT_SUPPORTED

The Handler doesn't support the given/required captcha types. If this is used, the CaptchaError SHOULD be set to CaptchaNotSupported. This SHOULD also be used if Close is called before CancelCaptcha. If no Handler supports captcha channels, the ChannelDispatcher will just call Close, because it has no knowledge of specific channel types.

 

TP_CAPTCHA_CANCEL_REASON_SERVICE_CONFUSED

The Handler doesn't understand the captcha data received. The challenger may be sending gibberish. If this is used, the CaptchaError SHOULD be set to ServiceConfused.

 

NUM_TP_CAPTCHA_CANCEL_REASONS

#define NUM_TP_CAPTCHA_CANCEL_REASONS TP_NUM_CAPTCHA_CANCEL_REASONS

1 higher than the highest valid value of TpCaptchaCancelReason. In new code, use TP_NUM_CAPTCHA_CANCEL_REASONS instead.


TP_NUM_CAPTCHA_CANCEL_REASONS

#define TP_NUM_CAPTCHA_CANCEL_REASONS (2+1)

1 higher than the highest valid value of TpCaptchaCancelReason.


enum TpCaptchaFlags

Extra flags to include with Captcha information

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CAPTCHA_FLAGS_REQUIRED

This captcha mechanism is required to be successfully answered in order to pass this captcha challenge.

 

enum TpCallContentDisposition

The disposition of this content, which defines whether to automatically start sending data on the streams when Accept is called on the channel.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_CONTENT_DISPOSITION_NONE

The content has no specific disposition.

 

TP_CALL_CONTENT_DISPOSITION_INITIAL

The content was initially part of the call. When Accept is called on the channel, all streams of this content with LocalSendingState set to Pending_Send will be moved to Sending as if SetSending (True) had been called.

 

NUM_TP_CALL_CONTENT_DISPOSITIONS

#define NUM_TP_CALL_CONTENT_DISPOSITIONS TP_NUM_CALL_CONTENT_DISPOSITIONS

1 higher than the highest valid value of TpCallContentDisposition. In new code, use TP_NUM_CALL_CONTENT_DISPOSITIONS instead.


TP_NUM_CALL_CONTENT_DISPOSITIONS

#define TP_NUM_CALL_CONTENT_DISPOSITIONS (1+1)

1 higher than the highest valid value of TpCallContentDisposition.


enum TpCallContentPacketizationType

A packetization method that can be used for a content.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_CONTENT_PACKETIZATION_TYPE_RTP

Real-time Transport Protocol, as documented by RFC 3550.

 

TP_CALL_CONTENT_PACKETIZATION_TYPE_RAW

Raw media.

 

TP_CALL_CONTENT_PACKETIZATION_TYPE_MSN_WEBCAM

MSN webcam. This is the video-only one-way type which was used in earlier versions of WLM. Although no longer used, modern WLM clients still support the MSN webcam protocol.

 

NUM_TP_CALL_CONTENT_PACKETIZATION_TYPES

#define NUM_TP_CALL_CONTENT_PACKETIZATION_TYPES TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES

1 higher than the highest valid value of TpCallContentPacketizationType. In new code, use TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES instead.


TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES

#define TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES (2+1)

1 higher than the highest valid value of TpCallContentPacketizationType.


enum TpCallState

The state of a call, as a whole. The allowed transitions are: Pending_Initiator → Initialising (for outgoing calls, when Accept is called) Initialising → Initialised (for outgoing calls, when the remote client indicates that the user has been notified about the call. If the network is known not to provide feedback about whether the remote side is ringing, then the call should immediately be set to Initialised. Initialising → Initialised (for incoming calls, when e.g. the implementation has been initialised far enough that it is sensible to notify the user about the call (to reduce the probability that the user will pick up the call and have it immediately fail). The UI should then alert the user about the call, and call SetRinging) Initialised → Accepted (for outgoing calls to a contact, when the remote contact accepts the call; for incoming calls, when Accept is called.) Accepted → Active (when the local user successfully joins the call/conference, and media is known to be flowing successfully; also, when temporary connection problems are resolved (See below)). If the network is known not to provide feedback about when the call is properly connected, the call should immediately be set to Active. Active → Accepted (when there are temporary connection problems that the CM is aware of and able to recover from) any state → Ended (when the call is terminated normally, or when an error occurs that the CM is unable to recover from) Clients MAY consider unknown values from this enum to be an error - additional values will not be defined after the Call specification is declared to be stable.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_STATE_UNKNOWN

The call state is not known. This call state MUST NOT appear as a value of the CallState property, but MAY be used by client code to represent calls whose state is as yet unknown.

 

TP_CALL_STATE_PENDING_INITIATOR

The initiator of the call hasn't accepted the call yet. This state only makes sense for outgoing calls, where it means that the local user has not yet sent any signalling messages to the remote user(s), and will not do so until Accept is called.

 

TP_CALL_STATE_INITIALISING

Progress has been made in placing the call, but the contact has not been made aware of the call yet. This corresponds to SIP's status code 183 Session Progress, and should be used for the period where the CM is waiting for the streaming implementation to initialise (before sending the initial INVITE or equivalent) and when the outgoing call has reached a gateway or ICE negotiation is pending. UIs should not produce a dialtone or start ringing if the call is in this state.

 

TP_CALL_STATE_INITIALISED

In the outgoing case: at least one called user has been alerted about the call (a SIP 180 (Ringing) packet or equivalent has been received) but none have answered, so the call cannot go to Accepted (use Ringing to determine which members have been informed and which haven't, if you care). UIs SHOULD produce a dialtone for outgoing calls in this state. In the incoming case, the local user should be informed of the call as soon as the call reaches this state (and SetRinging should be called to inform the CM that this has happened, so that it can relay this fact to the caller using a SIP 180 (Ringing) packet or equivalent).

 

TP_CALL_STATE_ACCEPTED

The contact being called has accepted the call, but the call is not in the Active state (The most common reason for this is that the streaming implementation hasn't connected yet).

 

TP_CALL_STATE_ACTIVE

The contact being called has accepted the call, and discourse between at least two parties should now be possible.

 

TP_CALL_STATE_ENDED

The call has ended, either via normal termination or an error.

 

NUM_TP_CALL_STATES

#define NUM_TP_CALL_STATES TP_NUM_CALL_STATES

1 higher than the highest valid value of TpCallState. In new code, use TP_NUM_CALL_STATES instead.


TP_NUM_CALL_STATES

#define TP_NUM_CALL_STATES (6+1)

1 higher than the highest valid value of TpCallState.


enum TpCallStateChangeReason

A simple representation of the reason for a change in the call's state, which may be used by simple clients, or used as a fallback when the DBus_Reason member of a Call_State_Reason struct is not understood.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_STATE_CHANGE_REASON_UNKNOWN

We just don't know. Unknown values of this enum SHOULD also be treated like this.

 

TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE

Situation normal. Progress has been made in the setup/teardown of the call (and it didn't require any user interaction).

 

TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED

The change was requested by the contact indicated by the Actor member of a Call_State_Reason struct. The DBus_Reason SHOULD be the empty string if the call was terminated normally, but MAY be a non-empty error name to indicate error-like call termination reasons (kicked from a conference by a moderator, etc.).

 

TP_CALL_STATE_CHANGE_REASON_FORWARDED

The call was forwarded. If known, the handle of the contact the call was forwarded to will be indicated by the "forwarded-to" member of a CallStateDetails dictionnary in the CallStateChanged signal.

 

TP_CALL_STATE_CHANGE_REASON_REJECTED

The CallState changed from Initialised or Ended (or a content's direction changed) because it was rejected by the remote user. Corresponds to Rejected

 

TP_CALL_STATE_CHANGE_REASON_NO_ANSWER

The CallState changed from Initialised or Ended because the initiator ended the call before the receiver accepted it. With an incoming call this state change reason signifies a missed call, or one that was picked up elsewhere before it was picked up here. Corresponds to NoAnswer or PickedUpElsewhere

 

TP_CALL_STATE_CHANGE_REASON_INVALID_CONTACT

The CallState changed because one of the addresses does not exist on the network. Corresponds to DoesNotExist

 

TP_CALL_STATE_CHANGE_REASON_PERMISSION_DENIED

The CallState changed because the local user is not authorised. Corresponds to PermissionDenied or InsufficientBalance

 

TP_CALL_STATE_CHANGE_REASON_BUSY

The CallState changed from Initialised Ended because the receiver is busy (e.g. is already engaged in another call, and has not placed the initiator in a call-waiting queue). Corresponds to Busy

 

TP_CALL_STATE_CHANGE_REASON_INTERNAL_ERROR

There has been an unexpected error in either the CM or some other local component. Corresponds to Confused or Media.StreamingError

 

TP_CALL_STATE_CHANGE_REASON_SERVICE_ERROR

There has been an unexpected error in the server or some other remote component. Corresponds to ServiceConfused

 

TP_CALL_STATE_CHANGE_REASON_NETWORK_ERROR

There has been a network error related to the CM or the signalling part of the call (compare and contrast: Streaming_Error). Corresponds to NetworkError

 

TP_CALL_STATE_CHANGE_REASON_MEDIA_ERROR

Some aspect of the content is unsupported so has to be removed from the call. Corresponds to Media.UnsupportedType or Media.CodecsIncompatible

 

TP_CALL_STATE_CHANGE_REASON_CONNECTIVITY_ERROR

It was not possible for the streaming implementation to connect to any of the users participating in this call or content. Corresponds to ConnectionFailed or ConnectionLost

 

NUM_TP_CALL_STATE_CHANGE_REASONS

#define NUM_TP_CALL_STATE_CHANGE_REASONS TP_NUM_CALL_STATE_CHANGE_REASONS

1 higher than the highest valid value of TpCallStateChangeReason. In new code, use TP_NUM_CALL_STATE_CHANGE_REASONS instead.


TP_NUM_CALL_STATE_CHANGE_REASONS

#define TP_NUM_CALL_STATE_CHANGE_REASONS (13+1)

1 higher than the highest valid value of TpCallStateChangeReason.


enum TpCallStreamCandidateType

The network topology that an IP candidate represents. This can sometimes be used to infer what kind of performance characteristics (latency, bandwith, etc) can be expected of connections made to this candidate.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_STREAM_CANDIDATE_TYPE_NONE

This is not an IP candidate. This is a reserved value, and should not be seen on the bus.

 

TP_CALL_STREAM_CANDIDATE_TYPE_HOST

This candidate represents a direct connection to the host, as its address is taken directly the host's IP stack.

 

TP_CALL_STREAM_CANDIDATE_TYPE_SERVER_REFLEXIVE

This candidate probably represents a connection to the host through a NAT device, as its address was discovered by sending a binding request to a STUN server or similar.

 

TP_CALL_STREAM_CANDIDATE_TYPE_PEER_REFLEXIVE

This candidate probably represents a good route between the host and its peer, as its address was discovered by sending a STUN binding request to one of the candidates advertised by the peer.

 

TP_CALL_STREAM_CANDIDATE_TYPE_RELAY

This candidate represents the address of a relay server (usually somewhere on the public internet). This candidate is the most likely to work, but all media will go via a relay server, so latency is likely to be higher than other types of candidate.

 

TP_CALL_STREAM_CANDIDATE_TYPE_MULTICAST

This candidate represents a Multicast group. This value should only appear if the Stream's Transport is set to Multicast.

 

NUM_TP_CALL_STREAM_CANDIDATE_TYPES

#define NUM_TP_CALL_STREAM_CANDIDATE_TYPES TP_NUM_CALL_STREAM_CANDIDATE_TYPES

1 higher than the highest valid value of TpCallStreamCandidateType. In new code, use TP_NUM_CALL_STREAM_CANDIDATE_TYPES instead.


TP_NUM_CALL_STREAM_CANDIDATE_TYPES

#define TP_NUM_CALL_STREAM_CANDIDATE_TYPES (5+1)

1 higher than the highest valid value of TpCallStreamCandidateType.


enum TpRCPTXRRTTMode

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_RCPT_XR_RTT_MODE_ALL

Both RTP data senders and data receivers MAY send DLRR blocks.

 

TP_RCPT_XR_RTT_MODE_SENDER

Only active RTP senders MAY send DLRR blocks, i.e., non RTP senders SHALL NOT send DLRR blocks.

 

NUM_TP_RCPT_XR_RTT_MODES

#define NUM_TP_RCPT_XR_RTT_MODES TP_NUM_RCPT_XR_RTT_MODES

1 higher than the highest valid value of TpRCPTXRRTTMode. In new code, use TP_NUM_RCPT_XR_RTT_MODES instead.


TP_NUM_RCPT_XR_RTT_MODES

#define TP_NUM_RCPT_XR_RTT_MODES (1+1)

1 higher than the highest valid value of TpRCPTXRRTTMode.


enum TpSendingState

Enum indicating whether a contact is sending media.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_SENDING_STATE_NONE

The contact is not sending media and has not been asked to do so.

 

TP_SENDING_STATE_PENDING_SEND

The contact has been asked to start sending media.

 

TP_SENDING_STATE_SENDING

The contact is sending media.

 

TP_SENDING_STATE_PENDING_STOP_SENDING

The contact has been asked to stop sending media.

 

NUM_TP_SENDING_STATES

#define NUM_TP_SENDING_STATES TP_NUM_SENDING_STATES

1 higher than the highest valid value of TpSendingState. In new code, use TP_NUM_SENDING_STATES instead.


TP_NUM_SENDING_STATES

#define TP_NUM_SENDING_STATES (3+1)

1 higher than the highest valid value of TpSendingState.


enum TpStreamComponent

Media streams can use more than one UDP socket: one for RTP (data) and one for RTCP (control). Most of the time, they are adjacent to each other, but some protocols (xmpp) signal each port separately.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_STREAM_COMPONENT_UNKNOWN

The stream transport type is unknown or not applicable (should not appear over dbus).

 

TP_STREAM_COMPONENT_DATA

This is the high-traffic data socket, containing the audio/video data for the stream.

 

TP_STREAM_COMPONENT_CONTROL

This is the low-traffic control socket, usually containing feedback about packet loss etc.

 

NUM_TP_STREAM_COMPONENTS

#define NUM_TP_STREAM_COMPONENTS TP_NUM_STREAM_COMPONENTS

1 higher than the highest valid value of TpStreamComponent. In new code, use TP_NUM_STREAM_COMPONENTS instead.


TP_NUM_STREAM_COMPONENTS

#define TP_NUM_STREAM_COMPONENTS (2+1)

1 higher than the highest valid value of TpStreamComponent.


enum TpStreamEndpointState

Represents the state of ICE negotiation for a single component of a stream to an endpoint.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_STREAM_ENDPOINT_STATE_CONNECTING

Candidate gathering and connectivity checks are in progress.

 

TP_STREAM_ENDPOINT_STATE_PROVISIONALLY_CONNECTED

The streaming implementation has found at least one working candidate pair. It is possible to send media at this point, but the controlling side has yet to negotiate the final candidates for use in this call.

 

TP_STREAM_ENDPOINT_STATE_FULLY_CONNECTED

This component of the stream is connected, and an updated offer has been sent and accepted (finalising the candidates to be used for the call). This should be set by the CM in response to AcceptSelectedCandidatePair.

 

TP_STREAM_ENDPOINT_STATE_EXHAUSTED_CANDIDATES

The streaming implementation has tried connecting to all of the available candidates and none of them have connected. This is distinct from Failed, because the CM might be able to provide more candidates later (more likely in XMPP than SIP).

 

TP_STREAM_ENDPOINT_STATE_FAILED

The CM and streaming implementation are in agreement that it is impossible to connect to this endpoint. This value should only be set by the CM.

 

NUM_TP_STREAM_ENDPOINT_STATES

#define NUM_TP_STREAM_ENDPOINT_STATES TP_NUM_STREAM_ENDPOINT_STATES

1 higher than the highest valid value of TpStreamEndpointState. In new code, use TP_NUM_STREAM_ENDPOINT_STATES instead.


TP_NUM_STREAM_ENDPOINT_STATES

#define TP_NUM_STREAM_ENDPOINT_STATES (4+1)

1 higher than the highest valid value of TpStreamEndpointState.


enum TpStreamFlowState

The type of SendingState and ReceivingState.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_STREAM_FLOW_STATE_STOPPED

No data is flowing (or expected to be flowing) at this time.

 

TP_STREAM_FLOW_STATE_PENDING_START

The streaming implementation has been told to start or receiving, but has not yet indicated that it is doing so.

 

TP_STREAM_FLOW_STATE_PENDING_STOP

The streaming implementation has been told to stop sending or receiving data, but it has not yet indicated that it has done so.

 

TP_STREAM_FLOW_STATE_STARTED

The streaming implementation is successfully sending or receiving data, and everything is going swimmingly.

 

NUM_TP_STREAM_FLOW_STATES

#define NUM_TP_STREAM_FLOW_STATES TP_NUM_STREAM_FLOW_STATES

1 higher than the highest valid value of TpStreamFlowState. In new code, use TP_NUM_STREAM_FLOW_STATES instead.


TP_NUM_STREAM_FLOW_STATES

#define TP_NUM_STREAM_FLOW_STATES (3+1)

1 higher than the highest valid value of TpStreamFlowState.


enum TpStreamTransportType

A transport that can be used for streaming.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_STREAM_TRANSPORT_TYPE_UNKNOWN

The stream transport type is unknown or not applicable (for streams that do not have a configurable transport).

 

TP_STREAM_TRANSPORT_TYPE_RAW_UDP

Raw UDP, with or without STUN. All streaming clients are assumed to support this transport, so there is no handler capability token for it in the Call1 interface. [This corresponds to "none" or "stun" in the old Media.StreamHandler interface.]

 

TP_STREAM_TRANSPORT_TYPE_ICE

Interactive Connectivity Establishment, as defined by RFC 5245. Note that this value covers ICE-UDP only. [This corresponds to "ice-udp" in the old Media.StreamHandler interface.]

 

TP_STREAM_TRANSPORT_TYPE_GTALK_P2P

Google Talk peer-to-peer connectivity establishment, as implemented by libjingle 0.3. [This corresponds to "gtalk-p2p" in the old Media.StreamHandler interface.]

 

TP_STREAM_TRANSPORT_TYPE_WLM_2009

The transport used by Windows Live Messenger 2009 or later, which resembles ICE draft 19. [This corresponds to "wlm-2009" in the old Media.StreamHandler interface.]

 

TP_STREAM_TRANSPORT_TYPE_SHM

Shared memory transport, as implemented by the GStreamer shmsrc and shmsink plugins.

 

TP_STREAM_TRANSPORT_TYPE_MULTICAST

Multicast transport.

 

NUM_TP_STREAM_TRANSPORT_TYPES

#define NUM_TP_STREAM_TRANSPORT_TYPES TP_NUM_STREAM_TRANSPORT_TYPES

1 higher than the highest valid value of TpStreamTransportType. In new code, use TP_NUM_STREAM_TRANSPORT_TYPES instead.


TP_NUM_STREAM_TRANSPORT_TYPES

#define TP_NUM_STREAM_TRANSPORT_TYPES (6+1)

1 higher than the highest valid value of TpStreamTransportType.


enum TpCallFlags

A set of flags representing additional information than is available in CallState. Many of these flags only make sense in a particular (or may explain why a call is in a specific state).

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_FLAG_LOCALLY_HELD

The call has been put on hold by the local user, e.g. using the Hold interface. This flag SHOULD only be set if there is at least one Content, and all Contents are locally held. Otherwise, in transient situations where some but not all contents are on hold, UIs would falsely indicate that the call as a whole is on hold, which could lead to the user saying something they'll regret, while under the impression that the other contacts can't hear them! This flag exists as a simplified proxy for HoldStateChanged, to reduce the number of signals that need to be listened to by a simple UI.

 

TP_CALL_FLAG_LOCALLY_RINGING

This flag exists for observability of the SetRinging method (e.g. so that loggers can tell whether the call got as far as alerting the user, or whether something went wrong before then). It should be set when the SetRinging is called, and unset when the call leaves Initialised.

 

TP_CALL_FLAG_LOCALLY_QUEUED

This flag exists for observability of the SetQueued method. It should be set when the SetQueued is called, and unset when the call leaves Initialising or Initialised.

 

TP_CALL_FLAG_FORWARDED

The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted. This flag only makes sense on outgoing calls. It SHOULD be set or unset according to informational messages from other contacts.

 

TP_CALL_FLAG_CLEARING

This flag only occurs when the CallState is Ended. The call with this flag set has ended, but not all resources corresponding to the call have been freed yet. Depending on the protocol there might be some audible feedback while the clearing flag is set. In calls following the ITU-T Q.931 standard there is a period of time between the call ending and the underlying channel being completely free for re-use.

 

enum TpCallMemberFlags

A set of flags representing the status of a remote contact in a call. It is protocol- and client-specific whether a particular contact will ever have a particular flag set on them, and Telepathy clients SHOULD NOT assume that a flag will ever be set. 180 Ringing in SIP, and its equivalent in XMPP, are optional informational messages, and implementations are not required to send them. The same applies to the messages used to indicate hold state.

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_CALL_MEMBER_FLAG_RINGING

The remote contact's client has told us that the contact has been alerted about the call but has not responded. This is a flag per member, not a flag for the call as a whole, because in Muji conference calls, you could invite someone and have their state be "ringing" for a while.

 

TP_CALL_MEMBER_FLAG_HELD

The call member has put this call on hold. This is a flag per member, not a flag for the call as a whole, because in conference calls, any member could put the conference on hold.

 

TP_CALL_MEMBER_FLAG_CONFERENCE_HOST

This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact.

 

enum TpRTCPXRStatisticsFlags

Bitfield/set of flags generated from the Telepathy specification.

Members

TP_RTCP_XR_STATISTICS_FLAGS_LOSS

Loss report flag, as defined in RFC3611 section 4.6.

 

TP_RTCP_XR_STATISTICS_FLAGS_DUPLICATE

Duplicate report flag, as defined in RFC3611 section 4.6.

 

TP_RTCP_XR_STATISTICS_FLAGS_JITTER

Jitter flag, as defined in RFC3611 section 4.6.

 

TP_RTCP_XR_STATISTICS_FLAGS_TTL

First bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6.

 

TP_RTCP_XR_STATISTICS_FLAGS_HL

Second bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6.

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-account-manager.html0000644000175000017500000035544314006623343024145 00000000000000 TpAccountManager: telepathy-glib API Reference Manual

TpAccountManager

TpAccountManager — proxy object for the Telepathy account manager

Signals

void account-disabled Run Last
void account-enabled Run Last
void account-removed Run Last
void account-validity-changed Run Last
void most-available-presence-changed Run Last

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpAccountManager

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

The TpAccountManager object is used to communicate with the Telepathy AccountManager service.

A new TpAccountManager object can be created with tp_account_manager_dup().

To list the existing valid accounts, the client should first prepare the TP_ACCOUNT_MANAGER_FEATURE_CORE feature using tp_proxy_prepare_async(), then call tp_account_manager_dup_valid_accounts().

The “account-validity-changed” signal is emitted to notify of the validity of an account changing. New accounts are also indicated by the emission of this signal on an account that did not previously exist. (The rationale behind indicating new accounts by an account validity change signal is that clients interested in this kind of thing should be connected to this signal anyway: an account having just become valid is effectively a new account to a client.)

The “account-removed” signal is emitted when existing accounts are removed.

Functions

tp_account_manager_new ()

TpAccountManager *
tp_account_manager_new (TpDBusDaemon *bus_daemon);

Convenience function to create a new account manager proxy. The returned TpAccountManager is not guaranteed to be prepared on return. Its “factory” will be a new TpAutomaticClientFactory for bus_daemon .

Use tp_account_manager_dup() instead if you want an account manager proxy on the starter or session bus (which is almost always the right thing for Telepathy).

Parameters

bus_daemon

Proxy for the D-Bus daemon

 

Returns

a new reference to an account manager proxy


tp_account_manager_new_with_factory ()

TpAccountManager *
tp_account_manager_new_with_factory (TpSimpleClientFactory *factory);

Convenience function to create a new account manager proxy. The returned TpAccountManager is not guaranteed to be ready on return.

Should be used only by applications having their own TpSimpleClientFactory subclass. Usually this should be done at application startup and followed by a call to tp_account_manager_set_default() to ensure other libraries/plugins will use this custom factory as well.

Parameters

factory

a TpSimpleClientFactory

 

Returns

a new reference to an account manager proxy


tp_account_manager_init_known_interfaces ()

void
tp_account_manager_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpAccountManager have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_ACCOUNT_MANAGER.

Since: 0.7.32


tp_account_manager_set_default ()

void
tp_account_manager_set_default (TpAccountManager *manager);

Define the TpAccountManager singleton that will be returned by tp_account_manager_dup().

This function may only be called before the first call to tp_account_manager_dup(), and may not be called more than once. Applications which use a custom TpSimpleClientFactory and want the default TpAccountManager to use that factory should call this after calling tp_account_manager_new_with_factory().

Unlike tp_account_manager_dup(), this function will keep an internal reference to manager , so it will never be destroyed.

Note that manager must use the default TpDBusDaemon as returned by tp_dbus_daemon_dup()

Parameters

manager

a TpAccountManager

 

Since: 0.15.5


tp_account_manager_can_set_default ()

gboolean
tp_account_manager_can_set_default (void);

Check if tp_account_manager_set_default() has already successfully been called.

Returns

TRUE if tp_account_manager_set_default() has already successfully been called in this process, FALSE otherwise.

Since: 0.19.6


tp_account_manager_dup ()

TpAccountManager *
tp_account_manager_dup (void);

Returns an account manager proxy on the D-Bus daemon on which this process was activated (if it was launched by D-Bus service activation), or the session bus (otherwise). This account manager will always have the result of tp_dbus_daemon_dup() as its “dbus-daemon”.

The returned TpAccountManager is cached; the same TpAccountManager object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned TpAccountManager is not guaranteed to be ready on return.

If tp_account_manager_set_default() has been called successfully, that TpAccountManager will be returned. Otherwise, a new TpAccountManager will be created the first time this function is called, using a new TpAutomaticClientFactory as its “factory”.

Returns

an account manager proxy on the starter or session bus, or NULL if it wasn't possible to get a dbus daemon proxy for the appropriate bus.

[transfer full]

Since: 0.9.0


tp_account_manager_create_account_async ()

void
tp_account_manager_create_account_async
                               (TpAccountManager *manager,
                                const gchar *connection_manager,
                                const gchar *protocol,
                                const gchar *display_name,
                                GHashTable *parameters,
                                GHashTable *properties,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Requests an asynchronous create of an account on the account manager manager . When the operation is finished, callback will be called. You can then call tp_account_manager_create_account_finish() to get the result of the operation.

The TpAccount returned by tp_account_manager_create_account_finish() will already have TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's “factory”.

It is usually better to use TpAccountRequest instead, particularly when using high-level language bindings.

Parameters

manager

a TpAccountManager

 

connection_manager

the name of a connection manager

 

protocol

the name of a protocol

 

display_name

the display name for the account

 

parameters

parameters for the new account.

[element-type utf8 GObject.Value][transfer none]

properties

properties for the new account.

[element-type utf8 GObject.Value][transfer none]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_manager_create_account_finish ()

TpAccount *
tp_account_manager_create_account_finish
                               (TpAccountManager *manager,
                                GAsyncResult *result,
                                GError **error);

Finishes an async create account operation, and returns a new TpAccount object. It has TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's “factory”.

The caller must keep a ref to the returned object using g_object_ref() if it is to be kept beyond the lifetime of result .

Parameters

manager

a TpAccountManager

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

a new TpAccount which was just created on success, otherwise NULL.

[transfer none]

Since: 0.9.0


tp_account_manager_ensure_account ()

TpAccount *
tp_account_manager_ensure_account (TpAccountManager *manager,
                                   const gchar *path);

tp_account_manager_ensure_account is deprecated and should not be used in newly-written code.

New code should call tp_simple_client_factory_ensure_account() on this object's “factory” instead, which ensures that a new reference is returned.

Lookup an account in the account manager manager . If the desired account has already been ensured then the same object will be returned, otherwise it will create a new TpAccount and add it to manager . As a result, if manager thinks that the account doesn't exist, this will still add it to manager to avoid races.

The account will be constructed via this account manager's “factory” (so it will be of an appropriate TpAccount subclass if the factory returns one), but does not necessarily have any features prepared yet. Use tp_proxy_prepare_async() to prepare features, using the contents of tp_simple_client_factory_dup_account_features() as a parameter if you want to prepare the same features that would normally be used.

The caller must keep a ref to the returned object using g_object_ref() if it is to be kept.

Parameters

manager

a TpAccountManager

 

path

the object path for an account

 

Returns

a new TpAccount at path , or NULL if path is not a valid account path.

[transfer none]

Since: 0.9.0


tp_account_manager_get_valid_accounts ()

GList *
tp_account_manager_get_valid_accounts (TpAccountManager *manager);

tp_account_manager_get_valid_accounts is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_account_manager_dup_valid_accounts() instead.

Returns a newly allocated GList of valid accounts in manager . The list must be freed with g_list_free() after used. None of the accounts in the returned list are guaranteed to be ready.

Note that the TpAccounts in the returned GList are not reffed before returning from this function. One could ref every item in the list like the following example:

1
2
3
GList *accounts;
account = tp_account_manager_get_valid_accounts (manager);
g_list_foreach (accounts, (GFunc) g_object_ref, NULL);

The returned TpAccounts are guaranteed to have TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's “factory”.

The list of valid accounts returned is not guaranteed to have been retrieved until TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (tp_proxy_prepare_async() has returned). Until this feature has been prepared, an empty list (NULL) will be returned.

Parameters

manager

a TpAccountManager

 

Returns

a newly allocated GList of valid accounts in manager .

[element-type TelepathyGLib.Account][transfer container]

Since: 0.9.0


tp_account_manager_dup_valid_accounts ()

GList *
tp_account_manager_dup_valid_accounts (TpAccountManager *manager);

Returns a newly allocated GList of reffed valid accounts in manager . The list must be freed with g_list_free_full() and g_object_unref() after used.

The returned TpAccounts are guaranteed to have TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's “factory”.

The list of valid accounts returned is not guaranteed to have been retrieved until TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (tp_proxy_prepare_async() has returned). Until this feature has been prepared, an empty list (NULL) will be returned.

Parameters

manager

a TpAccountManager

 

Returns

a newly allocated GList of reffed valid accounts in manager .

[element-type TelepathyGLib.Account][transfer full]

Since: 0.19.9


tp_account_manager_get_most_available_presence ()

TpConnectionPresenceType
tp_account_manager_get_most_available_presence
                               (TpAccountManager *manager,
                                gchar **status,
                                gchar **message);

Gets the most available presence over all accounts in manager . This function does not average presences across all accounts, but it merely finds the "most available" presence. As a result, there is a guarantee that there exists at least one account in manager with the returned presence.

If no accounts are enabled or valid the output will be (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "").

Since 0.17.5, if the only connected accounts does not implement TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, the output will be (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "").

The return value of this function is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value will be the same as if no accounts are enabled or valid.

Parameters

manager

a TpAccountManager

 

status

a string to fill with the actual status.

[out][transfer full]

message

a string to fill with the actual status message.

[out][transfer full]

Returns

the most available presence across all accounts

Since: 0.9.0


tp_account_manager_set_all_requested_presences ()

void
tp_account_manager_set_all_requested_presences
                               (TpAccountManager *manager,
                                TpConnectionPresenceType type,
                                const gchar *status,
                                const gchar *message);

Iterates through the accounts in manager and requests the presence (type , status and message ). Note that the presence requested here is merely a request, and if might not be satisfiable.

You can find the most available presence across all accounts by calling tp_account_manager_get_most_available_presence().

Setting a requested presence on all accounts will have no effect until tp_proxy_prepare_async() (or the older tp_account_manager_prepare_async()) has finished.

Parameters

manager

a TpAccountManager

 

type

a presence type to request

 

status

a status to request

 

message

a status message to request

 

Since: 0.9.0


tp_account_manager_enable_restart ()

void
tp_account_manager_enable_restart (TpAccountManager *manager);

Enable autostarting the account manager D-Bus service. This means that the account manager will be restarted if it disappears from the bus.

Parameters

manager

a TpAccountManager

 

tp_account_manager_is_prepared ()

gboolean
tp_account_manager_is_prepared (TpAccountManager *manager,
                                GQuark feature);

tp_account_manager_is_prepared is deprecated and should not be used in newly-written code.

since 0.23.0, use tp_proxy_is_prepared() instead.

[skip]

Parameters

manager

a TpAccountManager

 

feature

a feature which is required

 

Returns

the same thing as tp_proxy_is_prepared()

Since: 0.9.0


tp_account_manager_prepare_async ()

void
tp_account_manager_prepare_async (TpAccountManager *manager,
                                  const GQuark *features,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

tp_account_manager_prepare_async is deprecated and should not be used in newly-written code.

since 0.15.6, use tp_proxy_prepare_async() instead.

Requests an asynchronous preparation of manager with TP_ACCOUNT_MANAGER_FEATURE_CORE, plus any features specified by features . When the operation is finished, callback will be called. You can then call tp_account_manager_prepare_finish() to get the result of the operation.

If NULL is given to callback , then no callback will be called when the operation is finished. Instead, it will simply set features on manager . Note that if callback is NULL, then user_data must also be NULL.

In version 0.11.3 or later, this is equivalent to calling tp_proxy_prepare_async() with the same arguments.

[skip]

Parameters

manager

a TpAccountManager

 

features

a 0-terminated list of features, or NULL

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.9.0


tp_account_manager_prepare_finish ()

gboolean
tp_account_manager_prepare_finish (TpAccountManager *manager,
                                   GAsyncResult *result,
                                   GError **error);

tp_account_manager_prepare_finish is deprecated and should not be used in newly-written code.

since 0.15.6, use tp_proxy_prepare_finish() instead.

Finishes an async preparation of the account manager manager .

[skip]

Parameters

manager

a TpAccountManager

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the preparation was successful, otherwise FALSE

Since: 0.9.0


tp_cli_account_manager_callback_for_create_account ()

void
(*tp_cli_account_manager_callback_for_create_account)
                               (TpAccountManager *proxy,
                                const gchar *out_Account,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CreateAccount method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Account

Used to return an 'out' argument if error is NULL: The new <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_account_manager_call_create_account ()

TpProxyPendingCall *
tp_cli_account_manager_call_create_account
                               (TpAccountManager *proxy,
                                gint timeout_ms,
                                const gchar *in_Connection_Manager,
                                const gchar *in_Protocol,
                                const gchar *in_Display_Name,
                                GHashTable *in_Parameters,
                                GHashTable *in_Properties,
                                tp_cli_account_manager_callback_for_create_account callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CreateAccount method call.

Request the creation of a new <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>. The account manager SHOULD NOT allow invalid accounts to be created.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Connection_Manager

Used to pass an 'in' argument: The name of the connection manager, e.g. &quot;salut&quot;.

 

in_Protocol

Used to pass an 'in' argument: The protocol, e.g. &quot;local-xmpp&quot;.

 

in_Display_Name

Used to pass an 'in' argument: The initial value of the new account's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">DisplayName</tp:dbus-ref> property. The account manager SHOULD modify this to make it unique if an Account already exists with the same display name, for instance by appending a number or the 'account' parameter. Account manager implementations SHOULD accept an empty string, but account editing user interfaces should avoid passing an empty string for this parameter. <tp:rationale> <p>The account creation UI may ask the user for a name for the new account. If the author of the UI chooses not to do this, the account creation UI is better able to suggest a default display name because it has protocol-specific knowledge which the account manager does not.</p> <p>The account manager always knows the complete list of accounts so it can easily tell whether it should append something to the display name to avoid presenting two identically-named accounts to the user.</p> </tp:rationale>

 

in_Parameters

Used to pass an 'in' argument: Initial parameter values, as would be passed to <tp:dbus-ref namespace="org.freedesktop.Telepathy.ConnectionManager">RequestConnection</tp:dbus-ref>.

 

in_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The values of any other properties to be set immediately on the new Account.</p> <p>Only the properties mentioned in <tp:member-ref>SupportedAccountProperties</tp:member-ref> are acceptable here. In particular, the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">DisplayName</tp:dbus-ref> and <tp:dbus-ref namespace="org.freedesktop.Telepathy.Account">Parameters</tp:dbus-ref> properties are never allowed here, since they are set using the other arguments to this method.</p> <p>Account manager implementations SHOULD support creating accounts with an empty value for this argument.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_account_manager_signal_callback_account_removed ()

void
(*tp_cli_account_manager_signal_callback_account_removed)
                               (TpAccountManager *proxy,
                                const gchar *arg_Account,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AccountRemoved.

Parameters

proxy

The proxy on which tp_cli_account_manager_connect_to_account_removed() was called

 

arg_Account

An Account, which must not be used any more.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_account_manager_connect_to_account_removed ()

TpProxySignalConnection *
tp_cli_account_manager_connect_to_account_removed
                               (TpAccountManager *proxy,
                                tp_cli_account_manager_signal_callback_account_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AccountRemoved.

The given account has been removed. <tp:rationale> This is effectively change notification for the valid and invalid accounts lists. On emission of this signal, the Account indicated will no longer be present in either of the lists. </tp:rationale>

Parameters

proxy

A TpAccountManager or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_account_manager_signal_callback_account_validity_changed ()

void
(*tp_cli_account_manager_signal_callback_account_validity_changed)
                               (TpAccountManager *proxy,
                                const gchar *arg_Account,
                                gboolean arg_Valid,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal AccountValidityChanged.

Parameters

proxy

The proxy on which tp_cli_account_manager_connect_to_account_validity_changed() was called

 

arg_Account

An <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref>.

 

arg_Valid

True if the account is now valid.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_account_manager_connect_to_account_validity_changed ()

TpProxySignalConnection *
tp_cli_account_manager_connect_to_account_validity_changed
                               (TpAccountManager *proxy,
                                tp_cli_account_manager_signal_callback_account_validity_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal AccountValidityChanged.

The validity of the given account has changed. New accounts are also indicated by this signal, as an account validity change (usually to True) on an account that did not previously exist. <tp:rationale> This is effectively change notification for the valid and invalid accounts lists. </tp:rationale>

Parameters

proxy

A TpAccountManager or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

Types and Values

struct TpAccountManager

struct TpAccountManager;

The Telepathy Account Manager stores real-time communication accounts and their configuration, places accounts online on request, and manipulates accounts' presence, nicknames and avatars.

TpAccountManager is the "top level" object. Since 0.16 it always has a non-NULL “factory”, and its “factory” will be propagated to all other objects like TpAccountManager -> TpAccount -> TpConnection -> TpContact and TpChannel. This means that desired features set on that factory will be prepared on all those objects. If a “factory” is not specified when the TpAccountManager is constructed, it will use a TpAutomaticClientFactory.

Example 2. TpAccountManager example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
 * contact-list
 *
 * Copyright © 2011 Collabora Ltd. <http://www.collabora.co.uk/>
 *
 * Copying and distribution of this file, with or without modification,
 * are permitted in any medium without royalty provided the copyright
 * notice and this notice are preserved.
 */

#include "config.h"

#include <telepathy-glib/telepathy-glib.h>

static void
account_manager_prepared_cb (GObject *object,
    GAsyncResult *res,
    gpointer user_data)
{
  TpAccountManager *manager = (TpAccountManager *) object;
  GMainLoop *loop = user_data;
  GList *accounts, *l;
  GError *error = NULL;

  if (!tp_proxy_prepare_finish (object, res, &error))
    {
      g_print ("Error preparing AM: %s\n", error->message);
      goto OUT;
    }

  accounts = tp_account_manager_dup_valid_accounts (manager);
  for (l = accounts; l != NULL; l = l->next)
    {
      TpAccount *account = l->data;
      TpConnection *connection = tp_account_get_connection (account);
      GPtrArray *contacts;
      guint i;

      /* Verify account is online and received its contact list. If state is not
       * SUCCESS this means we didn't received the roster from server yet and
       * we would have to wait for the "notify:contact-list-state" signal. */
      if (connection == NULL ||
          tp_connection_get_contact_list_state (connection) !=
              TP_CONTACT_LIST_STATE_SUCCESS)
        continue;

      contacts = tp_connection_dup_contact_list (connection);
      for (i = 0; i < contacts->len; i++)
        {
          TpContact *contact = g_ptr_array_index (contacts, i);
          const gchar * const *groups;

          g_print ("contact %s (%s) in groups:\n",
              tp_contact_get_identifier (contact),
              tp_contact_get_alias (contact));

          for (groups = tp_contact_get_contact_groups (contact);
               *groups != NULL; groups++)
            g_print ("  %s\n", *groups);
        }
      g_ptr_array_unref (contacts);
    }
  g_list_free_full (accounts, g_object_unref);

OUT:
  g_main_loop_quit (loop);
}

int
main (int argc,
      char **argv)
{
  TpAccountManager *manager;
  TpSimpleClientFactory *factory;
  GMainLoop *loop;

  tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG"));

  loop = g_main_loop_new (NULL, FALSE);

  manager = tp_account_manager_dup ();
  factory = tp_proxy_get_factory (manager);
  tp_simple_client_factory_add_account_features_varargs (factory,
      TP_ACCOUNT_FEATURE_CONNECTION,
      0);
  tp_simple_client_factory_add_connection_features_varargs (factory,
      TP_CONNECTION_FEATURE_CONTACT_LIST,
      0);
  tp_simple_client_factory_add_contact_features_varargs (factory,
      TP_CONTACT_FEATURE_ALIAS,
      TP_CONTACT_FEATURE_CONTACT_GROUPS,
      TP_CONTACT_FEATURE_INVALID);

  tp_proxy_prepare_async (manager, NULL, account_manager_prepared_cb, loop);

  g_main_loop_run (loop);

  g_object_unref (manager);
  g_main_loop_unref (loop);

  return 0;
}

Since: 0.7.32


struct TpAccountManagerClass

struct TpAccountManagerClass {
};

The class of a TpAccount.


TP_ACCOUNT_MANAGER_FEATURE_CORE

#define             TP_ACCOUNT_MANAGER_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpAccountManager.

When this feature is prepared, the list of accounts have been retrieved and are available for use, and change-notification has been set up. Additionally, since 0.16 the TpAccount objects returned by tp_account_manager_dup_valid_accounts() have their features prepared as configured by the “factory”; in particular, they will all have TP_ACCOUNT_FEATURE_CORE.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to callback.

Since: 0.9.0

Signal Details

The “account-disabled” signal

void
user_function (TpAccountManager *manager,
               TpAccount        *account,
               gpointer          user_data)

Emitted when an account from manager is disabled.

Parameters

manager

a TpAccountManager

 

account

a TpAccount

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0


The “account-enabled” signal

void
user_function (TpAccountManager *manager,
               TpAccount        *account,
               gpointer          user_data)

Emitted when an account from manager is enabled.

account is guaranteed to have TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to the “factory”'s tp_simple_client_factory_add_account_features().

Parameters

manager

a TpAccountManager

 

account

a TpAccount

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0


The “account-removed” signal

void
user_function (TpAccountManager *manager,
               TpAccount        *account,
               gpointer          user_data)

Emitted when an account is removed from manager .

Parameters

manager

a TpAccountManager

 

account

a TpAccount

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0


The “account-validity-changed” signal

void
user_function (TpAccountManager *manager,
               TpAccount        *account,
               gboolean          valid,
               gpointer          user_data)

Emitted when the validity on account changes.

This signal is also used to indicate a new account that did not previously exist has been added (with valid set to TRUE).

If valid is TRUE, account is guaranteed to have TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to the “factory”'s tp_simple_client_factory_add_account_features().

Parameters

manager

a TpAccountManager

 

account

a TpAccount

 

valid

TRUE if the account is now valid

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0


The “most-available-presence-changed” signal

void
user_function (TpAccountManager *manager,
               guint             presence,
               gchar            *status,
               gchar            *message,
               gpointer          user_data)

Emitted when the most available presence on manager changes.

Parameters

manager

a TpAccountManager

 

presence

new presence type

 

status

new status

 

message

new status message

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.9.0

See Also

TpAccount

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-run.html0000644000175000017500000001437414006623344021701 00000000000000 Connection manager life cycle: telepathy-glib API Reference Manual

Connection manager life cycle

Connection manager life cycle — entry point for telepathy-glib connection managers

Functions

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

tp_run_connection_manager() provides a convenient entry point for telepathy-glib connection managers. It initializes most of the functionality the CM will need, constructs a connection manager object and lets it run.

This function also manages the connection manager's lifetime - if there are no new connections for a while, it times out and exits.

Functions

tp_run_connection_manager ()

int
tp_run_connection_manager (const char *prog_name,
                           const char *version,
                           TpBaseConnectionManager* (*construct_cm) (void),
                           int argc,
                           char **argv);

Run the connection manager by initializing libraries, constructing a main loop, instantiating a connection manager and running the main loop. When this function returns, the program should exit.

If the connection manager does not create a connection within a short arbitrary time (currently 5 seconds), either on startup or after the last open connection is disconnected, and the PERSIST debug flag is not set, return 0.

If registering the connection manager on D-Bus fails, return 1.

Parameters

prog_name

The program name to be used in debug messages etc.

 

version

The program version

 

construct_cm

A function which will return the connection manager object

 

argc

The number of arguments passed to the program

 

argv

The arguments passed to the program

 

Returns

the status code with which the process should exit

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpContactsMixin.html0000644000175000017500000006523114006623343024161 00000000000000 TpContactsMixin: telepathy-glib API Reference Manual

TpContactsMixin

TpContactsMixin — a mixin implementation of the contacts connection interface

Types and Values

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This mixin can be added to a TpBaseConnection subclass to implement the Contacts interface in a generic way.

To use the contacts mixin, include a TpContactsMixinClass somewhere in your class structure and a TpContactsMixin somewhere in your instance structure, and call tp_contacts_mixin_class_init() from your class_init function, tp_contacts_mixin_init() from your init function or constructor, and tp_contacts_mixin_finalize() from your dispose or finalize function.

To use the contacts mixin as the implementation of TpSvcConnectionInterfaceContacts, in the function you pass to G_IMPLEMENT_INTERFACE, you should call tp_contacts_mixin_iface_init. TpContactsMixin implements all of the D-Bus methods and properties in the Contacts interface.

To add interfaces with contact attributes to this interface use tp_contacts_mixin_add_contact_attributes_iface:

Functions

tp_contacts_mixin_add_contact_attributes_iface ()

void
tp_contacts_mixin_add_contact_attributes_iface
                               (GObject *obj,
                                const gchar *interface,
                                TpContactsMixinFillContactAttributesFunc fill_contact_attributes);

Declare that the given interface has contact attributes which can be added to the attributes hash using the filler function. All the handles in the handle array passed to the filler function are guaranteed to be valid and referenced.

[skip]

Parameters

obj

An instance of the implementation that uses this mixin

 

interface

Name of the interface that has ContactAttributes

 

fill_contact_attributes

Contact attribute filler function

 

Since: 0.7.14


tp_contacts_mixin_class_init ()

void
tp_contacts_mixin_class_init (GObjectClass *obj_cls,
                              glong offset);

Initialize the contacts mixin. Should be called from the implementation's class_init function like so:

1
2
tp_contacts_mixin_class_init ((GObjectClass *) klass,
                         G_STRUCT_OFFSET (SomeObjectClass, contacts_mixin));

[skip]

Parameters

obj_cls

The class of the implementation that uses this mixin

 

offset

The byte offset of the TpContactsMixinClass within the class structure

 

Since: 0.7.14


tp_contacts_mixin_finalize ()

void
tp_contacts_mixin_finalize (GObject *obj);

Free resources held by the contacts mixin.

[skip]

Parameters

obj

An object with this mixin.

 

Since: 0.7.14


tp_contacts_mixin_iface_init ()

void
tp_contacts_mixin_iface_init (gpointer g_iface,
                              gpointer iface_data);

Fill in the vtable entries needed to implement the contacts interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.

[skip]

Parameters

g_iface

A pointer to the TpSvcConnectionInterfaceContacts in an object class

 

iface_data

Ignored

 

Since: 0.7.14


tp_contacts_mixin_init ()

void
tp_contacts_mixin_init (GObject *obj,
                        gsize offset);

Initialize the contacts mixin. Should be called from the implementation's instance init function like so:

1
2
tp_contacts_mixin_init ((GObject *) self,
                    G_STRUCT_OFFSET (SomeObject, contacts_mixin));

[skip]

Parameters

obj

An instance of the implementation that uses this mixin

 

offset

The byte offset of the TpContactsMixin within the object structure

 

Since: 0.7.14


tp_contacts_mixin_set_contact_attribute ()

void
tp_contacts_mixin_set_contact_attribute
                               (GHashTable *contact_attributes,
                                TpHandle handle,
                                const gchar *attribute,
                                GValue *value);

Utility function to set attribute for handle to value in the attributes hash as passed to a TpContactsMixinFillContactAttributesFunc.

[skip]

Parameters

contact_attributes

contacts attribute hash as passed to TpContactsMixinFillContactAttributesFunc

 

handle

Handle to set the attribute on

 

attribute

attribute name

 

value

slice allocated GValue containing the value of the attribute, for instance with tp_g_value_slice_new. Ownership of the GValue is taken over by the mixin

 

Since: 0.7.14


tp_contacts_mixin_get_contact_attributes ()

GHashTable *
tp_contacts_mixin_get_contact_attributes
                               (GObject *obj,
                                const GArray *handles,
                                const gchar **interfaces,
                                const gchar **assumed_interfaces,
                                const gchar *sender);

Get contact attributes for the given contacts. Provide attributes for all requested interfaces. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

[skip]

Parameters

obj

A connection instance that uses this mixin. The connection must be connected.

 

handles

List of handles to retrieve contacts for. Any invalid handles will be dropped from the returned mapping.

 

interfaces

A list of interfaces to retrieve attributes from.

 

assumed_interfaces

A list of additional interfaces to retrieve attributes from. This can be used for interfaces documented as automatically included, like TP_IFACE_CONNECTION for GetContactAttributes, or TP_IFACE_CONNECTION and TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST for GetContactListAttributes.

 

sender

The DBus client's unique name. If this is not NULL, the requested handles will be held on behalf of this client.

 

Returns

A dictionary mapping the contact handles to contact attributes.


TpContactsMixinFillContactAttributesFunc ()

void
(*TpContactsMixinFillContactAttributesFunc)
                               (GObject *obj,
                                const GArray *contacts,
                                GHashTable *attributes_hash);

This function is called to supply contact attributes pertaining to a particular interface, for a list of contacts. All the handles in contacts are guaranteed to be valid and referenced.

Parameters

obj

An object implementing the Contacts interface with this mixin

 

contacts

The contact handles for which attributes are requested

 

attributes_hash

hash of handle => hash of attributes, containing all the contacts in the contacts array

 

Types and Values

struct TpContactsMixin

struct TpContactsMixin {
};

Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_contacts_mixin_init().

There are no public fields.


struct TpContactsMixinClass

struct TpContactsMixinClass {
};

Structure to be included in the class structure of objects that use this mixin. Initialize it with tp_contacts_mixin_class_init().

There are no public fields.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-version.html0000644000175000017500000002733114006623344022557 00000000000000 Version information: telepathy-glib API Reference Manual

Version information

Version information — Checking the telepathy-glib version

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Since 0.19.0, telepathy-glib provides version information similar to that used in GLib.

Typical usage from configure.ac is similar to GLib's:

1
2
3
4
AC_DEFINE([TP_VERSION_MIN_REQUIRED], [TP_VERSION_0_18],
  [Ignore deprecations newer than this branch])
AC_DEFINE([TP_VERSION_MAX_ALLOWED], [TP_VERSION_0_20],
  [Prevent use of APIs newer than this branch])

or you can define the macros directly on the compiler command line if required:

1
2
3
4
cc -o foo foo.c \
    -DTP_VERSION_MIN_REQUIRED=TP_VERSION_0_18 \
    -DTP_VERSION_MAX_ALLOWED=TP_VERSION_0_20 \
    ${TP_CFLAGS} ${TP_LIBS}

This functionality was added in telepathy-glib 0.19.0, but it is safe to define the TP_VERSION_MIN_REQUIRED and TP_VERSION_MAX_ALLOWED macros even for older versions of telepathy-glib, as long as you do not try to expand them.

Functions

Types and Values

TP_MAJOR_VERSION

#define TP_MAJOR_VERSION 0

The major version of telepathy-glib (e.g. the 0 in 0.18.1) at the time your code was compiled.


TP_MINOR_VERSION

#define TP_MINOR_VERSION 24

The minor version of telepathy-glib (e.g. the 18 in 0.18.1) at the time your code was compiled.

Odd minor versions indicate a development branch; even minor versions indicate a stable branch.


TP_MICRO_VERSION

#define TP_MICRO_VERSION 2

The micro version of telepathy-glib (e.g. the 1 in 0.18.1) at the time your code was compiled.

Within a stable branch (even minor version), micro versions fix bugs but do not add features.

Within a development branch (odd minor version), micro versions can fix bugs and/or add features.


TP_VERSION_0_16

#define TP_VERSION_0_16 (_TP_ENCODE_VERSION (0, 16))

A constant representing the telepathy-glib 0.16 stable branch, and the 0.15 development branch that led to it.


TP_VERSION_0_18

#define TP_VERSION_0_18 (_TP_ENCODE_VERSION (0, 18))

A constant representing the telepathy-glib 0.18 stable branch, and the 0.17 development branch that led to it.


TP_VERSION_0_20

#define TP_VERSION_0_20 (_TP_ENCODE_VERSION (0, 20))

A constant representing the telepathy-glib 0.20 stable branch, and the 0.19 development branch that led to it.


TP_VERSION_0_22

#define TP_VERSION_0_22 (_TP_ENCODE_VERSION (0, 22))

A constant representing the telepathy-glib 0.22 stable branch, and the 0.21 development branch that led to it.


TP_VERSION_0_24

#define TP_VERSION_0_24 (_TP_ENCODE_VERSION (0, 24))

A constant representing the telepathy-glib 0.24 stable branch, and the 0.23 development branch that led to it.


TP_VERSION_MIN_REQUIRED

# define TP_VERSION_MIN_REQUIRED (_TP_VERSION_CUR_STABLE)

A version-number constant like TP_VERSION_0_18.

This may be defined to a value like TP_VERSION_0_18 by users of telepathy-glib, to set the minimum version they wish to require. Warnings will be issued for functions deprecated in or before that version.

If not defined, the default value is the previous stable branch.


TP_VERSION_MAX_ALLOWED

# define TP_VERSION_MAX_ALLOWED (_TP_VERSION_CUR_STABLE)

A version-number constant like TP_VERSION_0_18.

This may be defined to a value like TP_VERSION_0_18 by users of telepathy-glib, to set the maximum version they wish to depend on. Warnings will be issued for functions deprecated in or before that version.

If not defined, the default value in stable branches is that stable branch, and the default value in development branches is the next stable branch.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-sidecars.html0000644000175000017500000003475314006623344025032 00000000000000 Connection Sidecars interface: telepathy-glib API Reference Manual

Connection Sidecars interface

Connection Sidecars interface — client-side wrappers for the Sidecars interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some Telepathy connection managers have a plugin API, with plugins providing plugin-specific channel types and other D-Bus APIs. It is technically difficult for plugins to add interfaces analogous to Aliasing, Avatars etc. to a Connection. The Sidecars1 interface provides an alternative, by attaching plugin-provided interfaces to a secondary object.

Functions

tp_cli_connection_interface_sidecars1_call_ensure_sidecar ()

TpProxyPendingCall *
tp_cli_connection_interface_sidecars1_call_ensure_sidecar
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Main_Interface,
                                tp_cli_connection_interface_sidecars1_callback_for_ensure_sidecar callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a EnsureSidecar method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request an object with a particular interface providing additional connection-specific functionality, together with its immutable properties. These will often be implemented by plug-ins to the connection managers; for example, support for an XMPP XEP for which no generic Telepathy interface exists might be implemented by a Gabble plugin exposing a sidecar with a particular interface.</p> <p>This method may be called at any point during the lifetime of a connection, even before its <tp:type>Connection_Status</tp:type> changes to Connected. It MAY take a long time to return—perhaps it needs to wait for a connection to be established and for all the services supported by the server to be discovered before determining whether necessary server-side support is available—so callers SHOULD override the default method timeout (25 seconds) with a much higher value (perhaps even MAX_INT32, meaning “no timeout” in recent versions of libdbus).</p> <tp:rationale> <p>There is an implicit assumption that any connection manager plugin will only want to export one “primary” object per feature it implements, since there is a one-to-one mapping between interface and object. This is reasonable since Sidecars are (intended to be) analogous to extra interfaces on the connection, providing once-per-connection shared functionality; it also makes client code straightforward (look up the interface you care about in a dictionary, build a proxy object from the value). More “plural” plugins are likely to want to implement new types of <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref> instead.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Main_Interface

Used to pass an 'in' argument: The &quot;primary&quot; interface implemented by an object attached to a connection. For example, a Gabble plugin implementing fine-grained control of XEP-0016 privacy lists might expose an object implementing <tt>com.example.PrivacyLists</tt>.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_sidecars1_callback_for_ensure_sidecar ()

void
(*tp_cli_connection_interface_sidecars1_callback_for_ensure_sidecar)
                               (TpConnection *proxy,
                                const gchar *out_Path,
                                GHashTable *out_Properties,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a EnsureSidecar method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Path

Used to return an 'out' argument if error is NULL: The object path of the sidecar, exported by the same bus name as the Connection to which it is attached.

 

out_Properties

Used to return an 'out' argument if error is NULL: Immutable properties of the sidecar.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-base-password-channel.html0000644000175000017500000004422614006623343025253 00000000000000 TpBasePasswordChannel: telepathy-glib API Reference Manual

TpBasePasswordChannel

TpBasePasswordChannel — a simple X-TELEPATHY-PASSWORD channel

Properties

gchar * authentication-method Read
gchar * authorization-identity Read
GStrv available-mechanisms Read
gboolean can-try-again Read
gchar * default-realm Read
gchar * default-username Read
gboolean has-initial-data Read
gboolean may-save-response Read / Write / Construct Only
gchar * sasl-error Read
GHashTable_gchararray+GValue_* sasl-error-details Read
guint sasl-status Read

Signals

void finished Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseChannel
        ╰── TpBasePasswordChannel

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class implements a SASL Authentication channel with the X-TELEPATHY-PASSWORD SASL mechanism. Most of the time, you should not use or instantiate this class directly. It is used by TpSimplePasswordManager behind the scenes. In some special circumstances (e.g. when the authentication channel needs to implement additional interfaces), it may be necessary to create your own custom authentication channels instead of letting TpSimplePasswordManager create them automatically. In this case, you should derive your channel from this class and then pass the channel as an argument to tp_simple_password_manager_prompt_for_channel_async().

Functions

Types and Values

struct TpBasePasswordChannel

struct TpBasePasswordChannel;

Data structure representing a channel implementing a SASL Authentication channel with the X-TELEPATHY-PASSWORD SASL mechanism.

Since: 0.13.15

Property Details

The “authentication-method” property

  “authentication-method”    gchar *

Interface of authentication method.

Owner: TpBasePasswordChannel

Flags: Read

Default value: ""


The “authorization-identity” property

  “authorization-identity”   gchar *

Authorization identity.

Owner: TpBasePasswordChannel

Flags: Read

Default value: ""


The “available-mechanisms” property

  “available-mechanisms”     GStrv

The set of mechanisms the server advertised.

Owner: TpBasePasswordChannel

Flags: Read


The “can-try-again” property

  “can-try-again”            gboolean

Whether StartMechanism will work in failed states.

Owner: TpBasePasswordChannel

Flags: Read

Default value: FALSE


The “default-realm” property

  “default-realm”            gchar *

DefaultRealm.

Owner: TpBasePasswordChannel

Flags: Read

Default value: ""


The “default-username” property

  “default-username”         gchar *

DefaultUsername.

Owner: TpBasePasswordChannel

Flags: Read

Default value: ""


The “has-initial-data” property

  “has-initial-data”         gboolean

Whether the StartMechanismWithData can be called.

Owner: TpBasePasswordChannel

Flags: Read

Default value: FALSE


The “may-save-response” property

  “may-save-response”        gboolean

Whether the client may save the authentication response.

Owner: TpBasePasswordChannel

Flags: Read / Write / Construct Only

Default value: TRUE


The “sasl-error” property

  “sasl-error”               gchar *

SASL error.

Owner: TpBasePasswordChannel

Flags: Read

Default value: ""


The “sasl-error-details” property

  “sasl-error-details”       GHashTable_gchararray+GValue_*

SASL error details.

Owner: TpBasePasswordChannel

Flags: Read


The “sasl-status” property

  “sasl-status”              guint

The status of the current SASL authentication.

Owner: TpBasePasswordChannel

Flags: Read

Allowed values: <= 7

Default value: 0

Signal Details

The “finished” signal

void
user_function (TpBasePasswordChannel *self,
               GString               *password,
               guint                  domain,
               gint                   code,
               gchar                 *message,
               gpointer               user_data)

Emitted when either the password has been provided by the user or the authentication has been aborted.

Parameters

self

the TpBasePasswordChannel

 

password

the password provided by the user, or NULL if the authentication has been aborted

 

domain

domain of a GError indicating why the authentication has been aborted, or 0

 

code

error code of a GError indicating why the authentication has been aborted, or 0

 

message

a message associated with the error, or NULL

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.13.15

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-dbus.html0000644000175000017500000105372614006623344022037 00000000000000 D-Bus utilities: telepathy-glib API Reference Manual

D-Bus utilities

D-Bus utilities — some D-Bus utility functions

Functions

void tp_dbus_g_method_return_not_implemented ()
DBusGConnection * tp_get_bus ()
DBusGProxy * tp_get_bus_proxy ()
gboolean tp_dbus_check_valid_bus_name ()
gboolean tp_dbus_check_valid_interface_name ()
gboolean tp_dbus_check_valid_member_name ()
gboolean tp_dbus_check_valid_object_path ()
GValue * tp_g_value_slice_new_bytes ()
GValue * tp_g_value_slice_new_take_bytes ()
GValue * tp_g_value_slice_new_object_path ()
GValue * tp_g_value_slice_new_static_object_path ()
GValue * tp_g_value_slice_new_take_object_path ()
TpDBusDaemon * tp_dbus_daemon_dup ()
TpDBusDaemon * tp_dbus_daemon_new ()
const gchar * tp_dbus_daemon_get_unique_name ()
void (*TpDBusDaemonNameOwnerChangedCb) ()
void tp_dbus_daemon_watch_name_owner ()
gboolean tp_dbus_daemon_cancel_name_owner_watch ()
void (*TpDBusDaemonListNamesCb) ()
void tp_dbus_daemon_list_names ()
void tp_dbus_daemon_list_activatable_names ()
gboolean tp_dbus_daemon_release_name ()
gboolean tp_dbus_daemon_request_name ()
void tp_dbus_daemon_register_object ()
void tp_dbus_daemon_unregister_object ()
void tp_dbus_daemon_init_known_interfaces ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_add_match ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_get_connection_se_linux_security_context ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_get_connection_unix_process_id ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_get_connection_unix_user ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_get_id ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_get_name_owner ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_hello ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_list_activatable_names ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_list_names ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_list_queued_owners ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_name_has_owner ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_release_name ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_reload_config ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_remove_match ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_request_name ()
TpProxyPendingCall * tp_cli_dbus_daemon_call_start_service_by_name ()
gboolean tp_cli_dbus_daemon_run_add_match ()
gboolean tp_cli_dbus_daemon_run_get_connection_se_linux_security_context ()
gboolean tp_cli_dbus_daemon_run_get_connection_unix_process_id ()
gboolean tp_cli_dbus_daemon_run_get_connection_unix_user ()
gboolean tp_cli_dbus_daemon_run_get_id ()
gboolean tp_cli_dbus_daemon_run_get_name_owner ()
gboolean tp_cli_dbus_daemon_run_hello ()
gboolean tp_cli_dbus_daemon_run_list_activatable_names ()
gboolean tp_cli_dbus_daemon_run_list_names ()
gboolean tp_cli_dbus_daemon_run_list_queued_owners ()
gboolean tp_cli_dbus_daemon_run_name_has_owner ()
gboolean tp_cli_dbus_daemon_run_release_name ()
gboolean tp_cli_dbus_daemon_run_reload_config ()
gboolean tp_cli_dbus_daemon_run_remove_match ()
gboolean tp_cli_dbus_daemon_run_request_name ()
gboolean tp_cli_dbus_daemon_run_start_service_by_name ()
void (*tp_cli_dbus_daemon_callback_for_add_match) ()
void (*tp_cli_dbus_daemon_callback_for_get_connection_se_linux_security_context) ()
void (*tp_cli_dbus_daemon_callback_for_get_connection_unix_process_id) ()
void (*tp_cli_dbus_daemon_callback_for_get_connection_unix_user) ()
void (*tp_cli_dbus_daemon_callback_for_get_id) ()
void (*tp_cli_dbus_daemon_callback_for_get_name_owner) ()
void (*tp_cli_dbus_daemon_callback_for_hello) ()
void (*tp_cli_dbus_daemon_callback_for_list_activatable_names) ()
void (*tp_cli_dbus_daemon_callback_for_list_names) ()
void (*tp_cli_dbus_daemon_callback_for_list_queued_owners) ()
void (*tp_cli_dbus_daemon_callback_for_name_has_owner) ()
void (*tp_cli_dbus_daemon_callback_for_release_name) ()
void (*tp_cli_dbus_daemon_callback_for_reload_config) ()
void (*tp_cli_dbus_daemon_callback_for_remove_match) ()
void (*tp_cli_dbus_daemon_callback_for_request_name) ()
void (*tp_cli_dbus_daemon_callback_for_start_service_by_name) ()
TpProxySignalConnection * tp_cli_dbus_daemon_connect_to_name_acquired ()
TpProxySignalConnection * tp_cli_dbus_daemon_connect_to_name_lost ()
TpProxySignalConnection * tp_cli_dbus_daemon_connect_to_name_owner_changed ()
void (*tp_cli_dbus_daemon_signal_callback_name_acquired) ()
void (*tp_cli_dbus_daemon_signal_callback_name_lost) ()
void (*tp_cli_dbus_daemon_signal_callback_name_owner_changed) ()

Object Hierarchy

    GFlags
    ╰── TpDBusNameType
    GObject
    ╰── TpProxy
        ╰── TpDBusDaemon

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

D-Bus utility functions used in telepathy-glib.

Functions

tp_dbus_g_method_return_not_implemented ()

void
tp_dbus_g_method_return_not_implemented
                               (DBusGMethodInvocation *context);

Return the Telepathy error NotImplemented from the method invocation given by context .

[skip]

Parameters

context

The D-Bus method invocation context

 

tp_get_bus ()

DBusGConnection *
tp_get_bus (void);

tp_get_bus is deprecated and should not be used in newly-written code.

Returns a connection to the D-Bus daemon on which this process was activated if it was launched by D-Bus service activation, or the session bus otherwise.

If dbus_g_bus_get() fails, exit with error code 1.

Note that this function is not suitable for use in applications which can be useful even in the absence of D-Bus - it is designed for use in connection managers, which are not at all useful without a D-Bus connection. See <https://bugs.freedesktop.org/show_bug.cgi?id=18832>. Most processes should use tp_dbus_daemon_dup() instead.

[skip]

Returns

a connection to the starter or session D-Bus daemon.


tp_get_bus_proxy ()

DBusGProxy *
tp_get_bus_proxy (void);

tp_get_bus_proxy has been deprecated since version 0.7.26 and should not be used in newly-written code.

Use tp_dbus_daemon_dup() in new code.

Return a DBusGProxy for the bus daemon object. The same caveats as for tp_get_bus() apply.

[skip]

Returns

a proxy for the bus daemon object on the starter or session bus.


tp_dbus_check_valid_bus_name ()

gboolean
tp_dbus_check_valid_bus_name (const gchar *name,
                              TpDBusNameType allow_types,
                              GError **error);

Check that the given string is a valid D-Bus bus name of an appropriate type.

Parameters

name

a possible bus name

 

allow_types

some combination of TP_DBUS_NAME_TYPE_UNIQUE, TP_DBUS_NAME_TYPE_WELL_KNOWN or TP_DBUS_NAME_TYPE_BUS_DAEMON (often this will be TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON or TP_DBUS_NAME_TYPE_ANY)

 

error

used to raise TP_DBUS_ERROR_INVALID_BUS_NAME if FALSE is returned

 

Returns

TRUE if name is valid

Since: 0.7.1


tp_dbus_check_valid_interface_name ()

gboolean
tp_dbus_check_valid_interface_name (const gchar *name,
                                    GError **error);

Check that the given string is a valid D-Bus interface name. This is also appropriate to use to check for valid error names.

Since GIO 2.26, g_dbus_is_interface_name() should always return the same thing, although the GLib function does not raise an error explaining why the interface name is incorrect.

Parameters

name

a possible interface name

 

error

used to raise TP_DBUS_ERROR_INVALID_INTERFACE_NAME if FALSE is returned

 

Returns

TRUE if name is valid

Since: 0.7.1


tp_dbus_check_valid_member_name ()

gboolean
tp_dbus_check_valid_member_name (const gchar *name,
                                 GError **error);

Check that the given string is a valid D-Bus member (method or signal) name.

Since GIO 2.26, g_dbus_is_member_name() should always return the same thing, although the GLib function does not raise an error explaining why the interface name is incorrect.

Parameters

name

a possible member name

 

error

used to raise TP_DBUS_ERROR_INVALID_MEMBER_NAME if FALSE is returned

 

Returns

TRUE if name is valid

Since: 0.7.1


tp_dbus_check_valid_object_path ()

gboolean
tp_dbus_check_valid_object_path (const gchar *path,
                                 GError **error);

Check that the given string is a valid D-Bus object path. Since GLib 2.24, g_variant_is_object_path() should always return the same thing as this function, although it doesn't provide an error explaining why the object path is invalid.

Parameters

path

a possible object path

 

error

used to raise TP_DBUS_ERROR_INVALID_OBJECT_PATH if FALSE is returned

 

Returns

TRUE if path is valid

Since: 0.7.1


tp_g_value_slice_new_bytes ()

GValue *
tp_g_value_slice_new_bytes (guint length,
                            gconstpointer bytes);

Slice-allocate a GValue containing a byte-array, using tp_g_value_slice_new_boxed(). This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

length

number of bytes to copy

 

bytes

location of an array of bytes to be copied (this may be NULL if and only if length is 0)

 

Returns

a GValue of type DBUS_TYPE_G_UCHAR_ARRAY whose value is a copy of length bytes from bytes , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_take_bytes ()

GValue *
tp_g_value_slice_new_take_bytes (GArray *bytes);

Slice-allocate a GValue containing bytes , using tp_g_value_slice_new_boxed(). This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

bytes

a non-NULL GArray of guchar, ownership of which will be taken by the GValue

 

Returns

a GValue of type DBUS_TYPE_G_UCHAR_ARRAY whose value is bytes , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_object_path ()

GValue *
tp_g_value_slice_new_object_path (const gchar *path);

Slice-allocate a GValue containing an object path, using tp_g_value_slice_new_boxed(). This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

path

a valid D-Bus object path which will be copied

 

Returns

a GValue of type DBUS_TYPE_G_OBJECT_PATH whose value is a copy of path , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_static_object_path ()

GValue *
tp_g_value_slice_new_static_object_path
                               (const gchar *path);

Slice-allocate a GValue containing an object path, using tp_g_value_slice_new_static_boxed(). This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

path

a valid D-Bus object path which must remain valid forever

 

Returns

a GValue of type DBUS_TYPE_G_OBJECT_PATH whose value is path , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_g_value_slice_new_take_object_path ()

GValue *
tp_g_value_slice_new_take_object_path (gchar *path);

Slice-allocate a GValue containing an object path, using tp_g_value_slice_new_take_boxed(). This function is convenient to use when constructing hash tables from string to GValue, for example.

[skip]

Parameters

path

a valid D-Bus object path which will be freed with g_free() by the returned GValue (the caller must own it before calling this function, but no longer owns it after this function returns)

 

Returns

a GValue of type DBUS_TYPE_G_OBJECT_PATH whose value is path , to be freed with tp_g_value_slice_free() or g_slice_free()

Since: 0.7.27


tp_dbus_daemon_dup ()

TpDBusDaemon *
tp_dbus_daemon_dup (GError **error);

Returns a proxy for signals and method calls on the D-Bus daemon on which this process was activated (if it was launched by D-Bus service activation), or the session bus (otherwise).

If it is not possible to connect to the appropriate bus, raise an error and return NULL.

The returned TpDBusDaemon is cached; the same TpDBusDaemon object will be returned by this function repeatedly, as long as at least one reference exists.

Parameters

error

Used to indicate error if NULL is returned

 

Returns

a reference to a proxy for signals and method calls on the bus daemon, or NULL.

[transfer full]

Since: 0.7.26


tp_dbus_daemon_new ()

TpDBusDaemon *
tp_dbus_daemon_new (DBusGConnection *connection);

Returns a proxy for signals and method calls on a particular bus connection.

Use tp_dbus_daemon_dup() instead if you just want a connection to the starter or session bus (which is almost always the right thing for Telepathy).

[skip]

Parameters

connection

a connection to D-Bus

 

Returns

a new proxy for signals and method calls on the bus daemon to which connection is connected

Since: 0.7.1


tp_dbus_daemon_get_unique_name ()

const gchar *
tp_dbus_daemon_get_unique_name (TpDBusDaemon *self);

Parameters

self

object representing a connection to a bus

 

Returns

the unique name of this connection to the bus, which is valid for as long as this TpDBusDaemon is

Since: 0.7.35


TpDBusDaemonNameOwnerChangedCb ()

void
(*TpDBusDaemonNameOwnerChangedCb) (TpDBusDaemon *bus_daemon,
                                   const gchar *name,
                                   const gchar *new_owner,
                                   gpointer user_data);

The signature of the callback called by tp_dbus_daemon_watch_name_owner().

Parameters

bus_daemon

The D-Bus daemon

 

name

The name whose ownership has changed or been discovered

 

new_owner

The unique name that now owns name

 

user_data

Arbitrary user-supplied data as passed to tp_dbus_daemon_watch_name_owner()

 

Since: 0.7.1


tp_dbus_daemon_watch_name_owner ()

void
tp_dbus_daemon_watch_name_owner (TpDBusDaemon *self,
                                 const gchar *name,
                                 TpDBusDaemonNameOwnerChangedCb callback,
                                 gpointer user_data,
                                 GDestroyNotify destroy);

Arrange for callback to be called with the owner of name as soon as possible (which might even be before this function returns!), then again every time the ownership of name changes.

If multiple watches are registered for the same name , they will be called in the order they were registered.

Parameters

self

The D-Bus daemon

 

name

The name whose ownership is to be watched

 

callback

Callback to call when the ownership is discovered or changes

 

user_data

Arbitrary data to pass to callback

 

destroy

Called to destroy user_data when the name owner watch is cancelled due to tp_dbus_daemon_cancel_name_owner_watch()

 

Since: 0.7.1


tp_dbus_daemon_cancel_name_owner_watch ()

gboolean
tp_dbus_daemon_cancel_name_owner_watch
                               (TpDBusDaemon *self,
                                const gchar *name,
                                TpDBusDaemonNameOwnerChangedCb callback,
                                gconstpointer user_data);

If there was a previous call to tp_dbus_daemon_watch_name_owner() with exactly the given name , callback and user_data , remove it.

If more than one watch matching the details provided was active, remove only the most recently added one.

[skip]

Parameters

self

the D-Bus daemon

 

name

the name that was being watched

 

callback

the callback that was called

 

user_data

the user data that was provided

 

Returns

TRUE if there was such a watch, FALSE otherwise

Since: 0.7.1


TpDBusDaemonListNamesCb ()

void
(*TpDBusDaemonListNamesCb) (TpDBusDaemon *bus_daemon,
                            const gchar * const *names,
                            const GError *error,
                            gpointer user_data,
                            GObject *weak_object);

Signature of a callback for functions that list bus names.

Parameters

bus_daemon

object representing a connection to a bus

 

names

constant NULL-terminated array of constant strings representing bus names, or NULL on error

 

error

the error that occurred, or NULL on success

 

user_data

the same user data that was passed to tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names

 

weak_object

the same object that was passed to tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names

 

Since: 0.7.35


tp_dbus_daemon_list_names ()

void
tp_dbus_daemon_list_names (TpDBusDaemon *self,
                           gint timeout_ms,
                           TpDBusDaemonListNamesCb callback,
                           gpointer user_data,
                           GDestroyNotify destroy,
                           GObject *weak_object);

Call the ListNames method on the bus daemon, asynchronously. The callback will be called from the main loop with a list of all the names (either unique or well-known) that exist on the bus.

In versions of telepathy-glib that have it, this should be preferred instead of calling tp_cli_dbus_daemon_call_list_names(), since that function will result in wakeups for every NameOwnerChanged signal.

Parameters

self

object representing a connection to a bus

 

timeout_ms

timeout for the call

 

callback

callback to be called on success or failure; must not be NULL

 

user_data

opaque user-supplied data to pass to the callback

 

destroy

if not NULL, called with user_data as argument after the call has succeeded or failed, or after weak_object has been destroyed

 

weak_object

if not NULL, a GObject which will be weakly referenced; if it is destroyed, callback will not be called at all

 

Since: 0.7.35


tp_dbus_daemon_list_activatable_names ()

void
tp_dbus_daemon_list_activatable_names (TpDBusDaemon *self,
                                       gint timeout_ms,
                                       TpDBusDaemonListNamesCb callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

Call the ListActivatableNames method on the bus daemon, asynchronously. The callback will be called from the main loop with a list of all the well-known names that are available for service-activation on the bus.

In versions of telepathy-glib that have it, this should be preferred instead of calling tp_cli_dbus_daemon_call_list_activatable_names(), since that function will result in wakeups for every NameOwnerChanged signal.

Parameters

self

object representing a connection to a bus daemon

 

timeout_ms

timeout for the call

 

callback

callback to be called on success or failure; must not be NULL

 

user_data

opaque user-supplied data to pass to the callback

 

destroy

if not NULL, called with user_data as argument after the call has succeeded or failed, or after weak_object has been destroyed

 

weak_object

if not NULL, a GObject which will be weakly referenced; if it is destroyed, callback will not be called at all

 

Since: 0.7.35


tp_dbus_daemon_release_name ()

gboolean
tp_dbus_daemon_release_name (TpDBusDaemon *self,
                             const gchar *well_known_name,
                             GError **error);

Release the given well-known name. This makes a synchronous call to the bus daemon.

Parameters

self

a TpDBusDaemon

 

well_known_name

a well-known name owned by this process to release

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE if well_known_name was released, or FALSE and sets error if an error occurred.

Since: 0.7.30


tp_dbus_daemon_request_name ()

gboolean
tp_dbus_daemon_request_name (TpDBusDaemon *self,
                             const gchar *well_known_name,
                             gboolean idempotent,
                             GError **error);

Claim the given well-known name without queueing, allowing replacement or replacing an existing name-owner. This makes a synchronous call to the bus daemon.

Parameters

self

a TpDBusDaemon

 

well_known_name

a well-known name to acquire

 

idempotent

whether to consider it to be a success if this process already owns the name

 

error

used to raise an error if FALSE is returned

 

Returns

TRUE if well_known_name was claimed, or FALSE and sets error if an error occurred.

Since: 0.7.30


tp_dbus_daemon_register_object ()

void
tp_dbus_daemon_register_object (TpDBusDaemon *self,
                                const gchar *object_path,
                                gpointer object);

Export object at object_path . This is a convenience wrapper around dbus_g_connection_register_g_object(), and behaves similarly.

Parameters

self

object representing a connection to a bus

 

object_path

an object path

 

object

an object to export.

[type GObject.Object][transfer none]

Since: 0.11.3


tp_dbus_daemon_unregister_object ()

void
tp_dbus_daemon_unregister_object (TpDBusDaemon *self,
                                  gpointer object);

Stop exporting object on D-Bus. This is a convenience wrapper around dbus_g_connection_unregister_g_object(), and behaves similarly.

Parameters

self

object representing a connection to a bus

 

object

an object previously exported with tp_dbus_daemon_register_object().

[type GObject.Object][transfer none]

Since: 0.11.3


tp_dbus_daemon_init_known_interfaces ()

void
tp_dbus_daemon_init_known_interfaces (void);

Ensure that the known interfaces for TpDBusDaemon have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_DBUS_DAEMON.

Since: 0.7.32


tp_cli_dbus_daemon_call_add_match ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_add_match (TpDBusDaemon *proxy,
                                   gint timeout_ms,
                                   const gchar *in0,
                                   tp_cli_dbus_daemon_callback_for_add_match callback,
                                   gpointer user_data,
                                   GDestroyNotify destroy,
                                   GObject *weak_object);

Start a AddMatch method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_get_connection_se_linux_security_context ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_get_connection_se_linux_security_context
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_get_connection_se_linux_security_context callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetConnectionSELinuxSecurityContext method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_get_connection_unix_process_id ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_get_connection_unix_process_id
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_get_connection_unix_process_id callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetConnectionUnixProcessID method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_get_connection_unix_user ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_get_connection_unix_user
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_get_connection_unix_user callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetConnectionUnixUser method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_get_id ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_get_id (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                tp_cli_dbus_daemon_callback_for_get_id callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetId method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_get_name_owner ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_get_name_owner
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_get_name_owner callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetNameOwner method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_hello ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_hello (TpDBusDaemon *proxy,
                               gint timeout_ms,
                               tp_cli_dbus_daemon_callback_for_hello callback,
                               gpointer user_data,
                               GDestroyNotify destroy,
                               GObject *weak_object);

Start a Hello method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_list_activatable_names ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_list_activatable_names
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                tp_cli_dbus_daemon_callback_for_list_activatable_names callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListActivatableNames method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_list_names ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_list_names (TpDBusDaemon *proxy,
                                    gint timeout_ms,
                                    tp_cli_dbus_daemon_callback_for_list_names callback,
                                    gpointer user_data,
                                    GDestroyNotify destroy,
                                    GObject *weak_object);

Start a ListNames method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_list_queued_owners ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_list_queued_owners
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_list_queued_owners callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListQueuedOwners method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_name_has_owner ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_name_has_owner
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                tp_cli_dbus_daemon_callback_for_name_has_owner callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a NameHasOwner method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_release_name ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_release_name (TpDBusDaemon *proxy,
                                      gint timeout_ms,
                                      const gchar *in0,
                                      tp_cli_dbus_daemon_callback_for_release_name callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a ReleaseName method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_reload_config ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_reload_config (TpDBusDaemon *proxy,
                                       gint timeout_ms,
                                       tp_cli_dbus_daemon_callback_for_reload_config callback,
                                       gpointer user_data,
                                       GDestroyNotify destroy,
                                       GObject *weak_object);

Start a ReloadConfig method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_remove_match ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_remove_match (TpDBusDaemon *proxy,
                                      gint timeout_ms,
                                      const gchar *in0,
                                      tp_cli_dbus_daemon_callback_for_remove_match callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a RemoveMatch method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_request_name ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_request_name (TpDBusDaemon *proxy,
                                      gint timeout_ms,
                                      const gchar *in0,
                                      guint in1,
                                      tp_cli_dbus_daemon_callback_for_request_name callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a RequestName method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

in1

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_call_start_service_by_name ()

TpProxyPendingCall *
tp_cli_dbus_daemon_call_start_service_by_name
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                guint in1,
                                tp_cli_dbus_daemon_callback_for_start_service_by_name callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a StartServiceByName method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

in1

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_daemon_run_add_match ()

gboolean
tp_cli_dbus_daemon_run_add_match (TpDBusDaemon *proxy,
                                  gint timeout_ms,
                                  const gchar *in0,
                                  GError **error,
                                  GMainLoop **loop);

tp_cli_dbus_daemon_run_add_match is deprecated and should not be used in newly-written code.

Call the method AddMatch and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_get_connection_se_linux_security_context ()

gboolean
tp_cli_dbus_daemon_run_get_connection_se_linux_security_context
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                GArray **out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_get_connection_se_linux_security_context is deprecated and should not be used in newly-written code.

Call the method GetConnectionSELinuxSecurityContext and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_get_connection_unix_process_id ()

gboolean
tp_cli_dbus_daemon_run_get_connection_unix_process_id
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                guint *out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_get_connection_unix_process_id is deprecated and should not be used in newly-written code.

Call the method GetConnectionUnixProcessID and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_get_connection_unix_user ()

gboolean
tp_cli_dbus_daemon_run_get_connection_unix_user
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                guint *out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_get_connection_unix_user is deprecated and should not be used in newly-written code.

Call the method GetConnectionUnixUser and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_get_id ()

gboolean
tp_cli_dbus_daemon_run_get_id (TpDBusDaemon *proxy,
                               gint timeout_ms,
                               gchar **out0,
                               GError **error,
                               GMainLoop **loop);

tp_cli_dbus_daemon_run_get_id is deprecated and should not be used in newly-written code.

Call the method GetId and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_get_name_owner ()

gboolean
tp_cli_dbus_daemon_run_get_name_owner (TpDBusDaemon *proxy,
                                       gint timeout_ms,
                                       const gchar *in0,
                                       gchar **out0,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_dbus_daemon_run_get_name_owner is deprecated and should not be used in newly-written code.

Call the method GetNameOwner and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_hello ()

gboolean
tp_cli_dbus_daemon_run_hello (TpDBusDaemon *proxy,
                              gint timeout_ms,
                              gchar **out0,
                              GError **error,
                              GMainLoop **loop);

tp_cli_dbus_daemon_run_hello is deprecated and should not be used in newly-written code.

Call the method Hello and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_list_activatable_names ()

gboolean
tp_cli_dbus_daemon_run_list_activatable_names
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                gchar ***out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_list_activatable_names is deprecated and should not be used in newly-written code.

Call the method ListActivatableNames and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_list_names ()

gboolean
tp_cli_dbus_daemon_run_list_names (TpDBusDaemon *proxy,
                                   gint timeout_ms,
                                   gchar ***out0,
                                   GError **error,
                                   GMainLoop **loop);

tp_cli_dbus_daemon_run_list_names is deprecated and should not be used in newly-written code.

Call the method ListNames and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_list_queued_owners ()

gboolean
tp_cli_dbus_daemon_run_list_queued_owners
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                gchar ***out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_list_queued_owners is deprecated and should not be used in newly-written code.

Call the method ListQueuedOwners and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_name_has_owner ()

gboolean
tp_cli_dbus_daemon_run_name_has_owner (TpDBusDaemon *proxy,
                                       gint timeout_ms,
                                       const gchar *in0,
                                       gboolean *out0,
                                       GError **error,
                                       GMainLoop **loop);

tp_cli_dbus_daemon_run_name_has_owner is deprecated and should not be used in newly-written code.

Call the method NameHasOwner and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_release_name ()

gboolean
tp_cli_dbus_daemon_run_release_name (TpDBusDaemon *proxy,
                                     gint timeout_ms,
                                     const gchar *in0,
                                     guint *out0,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_dbus_daemon_run_release_name is deprecated and should not be used in newly-written code.

Call the method ReleaseName and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_reload_config ()

gboolean
tp_cli_dbus_daemon_run_reload_config (TpDBusDaemon *proxy,
                                      gint timeout_ms,
                                      GError **error,
                                      GMainLoop **loop);

tp_cli_dbus_daemon_run_reload_config is deprecated and should not be used in newly-written code.

Call the method ReloadConfig and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_remove_match ()

gboolean
tp_cli_dbus_daemon_run_remove_match (TpDBusDaemon *proxy,
                                     gint timeout_ms,
                                     const gchar *in0,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_dbus_daemon_run_remove_match is deprecated and should not be used in newly-written code.

Call the method RemoveMatch and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_request_name ()

gboolean
tp_cli_dbus_daemon_run_request_name (TpDBusDaemon *proxy,
                                     gint timeout_ms,
                                     const gchar *in0,
                                     guint in1,
                                     guint *out0,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_dbus_daemon_run_request_name is deprecated and should not be used in newly-written code.

Call the method RequestName and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

in1

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_run_start_service_by_name ()

gboolean
tp_cli_dbus_daemon_run_start_service_by_name
                               (TpDBusDaemon *proxy,
                                gint timeout_ms,
                                const gchar *in0,
                                guint in1,
                                guint *out0,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_daemon_run_start_service_by_name is deprecated and should not be used in newly-written code.

Call the method StartServiceByName and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in0

Used to pass an 'in' argument: (Undocumented)

 

in1

Used to pass an 'in' argument: (Undocumented)

 

out0

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_daemon_callback_for_add_match ()

void
(*tp_cli_dbus_daemon_callback_for_add_match)
                               (TpDBusDaemon *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddMatch method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_get_connection_se_linux_security_context ()

void
(*tp_cli_dbus_daemon_callback_for_get_connection_se_linux_security_context)
                               (TpDBusDaemon *proxy,
                                const GArray *out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetConnectionSELinuxSecurityContext method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_get_connection_unix_process_id ()

void
(*tp_cli_dbus_daemon_callback_for_get_connection_unix_process_id)
                               (TpDBusDaemon *proxy,
                                guint out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetConnectionUnixProcessID method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_get_connection_unix_user ()

void
(*tp_cli_dbus_daemon_callback_for_get_connection_unix_user)
                               (TpDBusDaemon *proxy,
                                guint out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetConnectionUnixUser method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_get_id ()

void
(*tp_cli_dbus_daemon_callback_for_get_id)
                               (TpDBusDaemon *proxy,
                                const gchar *out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetId method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_get_name_owner ()

void
(*tp_cli_dbus_daemon_callback_for_get_name_owner)
                               (TpDBusDaemon *proxy,
                                const gchar *out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetNameOwner method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_hello ()

void
(*tp_cli_dbus_daemon_callback_for_hello)
                               (TpDBusDaemon *proxy,
                                const gchar *out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Hello method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_list_activatable_names ()

void
(*tp_cli_dbus_daemon_callback_for_list_activatable_names)
                               (TpDBusDaemon *proxy,
                                const gchar **out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListActivatableNames method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_list_names ()

void
(*tp_cli_dbus_daemon_callback_for_list_names)
                               (TpDBusDaemon *proxy,
                                const gchar **out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListNames method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_list_queued_owners ()

void
(*tp_cli_dbus_daemon_callback_for_list_queued_owners)
                               (TpDBusDaemon *proxy,
                                const gchar **out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListQueuedOwners method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_name_has_owner ()

void
(*tp_cli_dbus_daemon_callback_for_name_has_owner)
                               (TpDBusDaemon *proxy,
                                gboolean out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a NameHasOwner method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_release_name ()

void
(*tp_cli_dbus_daemon_callback_for_release_name)
                               (TpDBusDaemon *proxy,
                                guint out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReleaseName method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_reload_config ()

void
(*tp_cli_dbus_daemon_callback_for_reload_config)
                               (TpDBusDaemon *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ReloadConfig method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_remove_match ()

void
(*tp_cli_dbus_daemon_callback_for_remove_match)
                               (TpDBusDaemon *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveMatch method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_request_name ()

void
(*tp_cli_dbus_daemon_callback_for_request_name)
                               (TpDBusDaemon *proxy,
                                guint out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestName method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_callback_for_start_service_by_name ()

void
(*tp_cli_dbus_daemon_callback_for_start_service_by_name)
                               (TpDBusDaemon *proxy,
                                guint out0,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a StartServiceByName method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out0

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_daemon_connect_to_name_acquired ()

TpProxySignalConnection *
tp_cli_dbus_daemon_connect_to_name_acquired
                               (TpDBusDaemon *proxy,
                                tp_cli_dbus_daemon_signal_callback_name_acquired callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NameAcquired.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_dbus_daemon_connect_to_name_lost ()

TpProxySignalConnection *
tp_cli_dbus_daemon_connect_to_name_lost
                               (TpDBusDaemon *proxy,
                                tp_cli_dbus_daemon_signal_callback_name_lost callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NameLost.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_dbus_daemon_connect_to_name_owner_changed ()

TpProxySignalConnection *
tp_cli_dbus_daemon_connect_to_name_owner_changed
                               (TpDBusDaemon *proxy,
                                tp_cli_dbus_daemon_signal_callback_name_owner_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NameOwnerChanged.

(Undocumented)

Parameters

proxy

A TpDBusDaemon or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_dbus_daemon_signal_callback_name_acquired ()

void
(*tp_cli_dbus_daemon_signal_callback_name_acquired)
                               (TpDBusDaemon *proxy,
                                const gchar *arg0,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NameAcquired.

Parameters

proxy

The proxy on which tp_cli_dbus_daemon_connect_to_name_acquired() was called

 

arg0

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_dbus_daemon_signal_callback_name_lost ()

void
(*tp_cli_dbus_daemon_signal_callback_name_lost)
                               (TpDBusDaemon *proxy,
                                const gchar *arg0,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NameLost.

Parameters

proxy

The proxy on which tp_cli_dbus_daemon_connect_to_name_lost() was called

 

arg0

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_dbus_daemon_signal_callback_name_owner_changed ()

void
(*tp_cli_dbus_daemon_signal_callback_name_owner_changed)
                               (TpDBusDaemon *proxy,
                                const gchar *arg0,
                                const gchar *arg1,
                                const gchar *arg2,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NameOwnerChanged.

Parameters

proxy

The proxy on which tp_cli_dbus_daemon_connect_to_name_owner_changed() was called

 

arg0

.

[Undocumented]

arg1

.

[Undocumented]

arg2

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

Types and Values

enum TpDBusNameType

A set of flags indicating which D-Bus bus names are acceptable. They can be combined with the bitwise-or operator to accept multiple types. TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON and TP_DBUS_NAME_TYPE_ANY are the bitwise-or of other appropriate types, for convenience.

Since 0.11.5, there is a corresponding GFlagsClass type, TP_TYPE_DBUS_NAME_TYPE.

Members

TP_DBUS_NAME_TYPE_UNIQUE

accept unique names like :1.123 (not including the name of the bus daemon itself)

 

TP_DBUS_NAME_TYPE_WELL_KNOWN

accept well-known names like com.example.Service (not including the name of the bus daemon itself)

 

TP_DBUS_NAME_TYPE_BUS_DAEMON

accept the name of the bus daemon itself, which has the syntax of a well-known name, but behaves like a unique name

 

TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON

accept either unique or well-known names, but not the bus daemon

 

TP_DBUS_NAME_TYPE_ANY

accept any of the above

 

Since: 0.7.1


TP_TYPE_DBUS_NAME_TYPE

#define TP_TYPE_DBUS_NAME_TYPE (tp_dbus_name_type_get_type ())

The GFlagsClass type of a TpDBusNameType or a set of name types.

Since: 0.11.5


TpDBusDaemon

typedef struct _TpDBusDaemon TpDBusDaemon;

A subclass of TpProxy that represents the D-Bus daemon. It mainly provides functionality to manage well-known names on the bus.

Since: 0.7.1


TpDBusDaemonClass

typedef struct _TpDBusDaemonClass TpDBusDaemonClass;

The class of TpDBusDaemon.

Since: 0.7.1

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-client-channel-factory.html0000644000175000017500000004230014006623344025414 00000000000000 TpClientChannelFactoryInterface: telepathy-glib API Reference Manual

TpClientChannelFactoryInterface

TpClientChannelFactoryInterface — an interface for client channel factories

Object Hierarchy

    GInterface
    ╰── TpClientChannelFactory

Prerequisites

TpClientChannelFactory requires GObject.

Known Implementations

TpClientChannelFactory is implemented by TpAutomaticProxyFactory and TpBasicProxyFactory.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Client channel factories are used to create channel proxies. An application wanting to use its own TpChannel subclass has to implement an object implementing the TpClientChannelFactoryInterface interface.

Once a channel has been created by a factory using tp_client_channel_factory_create_channel(), the caller should then prepare on it the channel features returned by tp_client_channel_factory_dup_channel_features() using tp_proxy_prepare_async().

Functions

tp_client_channel_factory_create_channel ()

TpChannel *
tp_client_channel_factory_create_channel
                               (TpClientChannelFactory *self,
                                TpConnection *conn,
                                const gchar *path,
                                GHashTable *properties,
                                GError **error);

Function called when a channel need to be created. Implementation can return a subclass of TpChannel if they need to.

Changed in 0.13.6: the function's signature was previously wrong; it expected an object instance as its first parameter, but the type of the parameter was the type of the interface vtable.

Parameters

self

a client channel factory

 

conn

a TpConnection

 

path

the object path of the channel

 

properties

the immutable properties of the channel.

[transfer none][element-type utf8 GObject.Value]

error

used to indicate the error if NULL is returned

 

Returns

a new channel proxy, or NULL on invalid arguments.

[transfer full]

Since: 0.13.2


tp_client_channel_factory_dup_channel_features ()

GArray *
tp_client_channel_factory_dup_channel_features
                               (TpClientChannelFactory *self,
                                TpChannel *channel);

Return a zero terminated GArray containing the TpChannel features that should be prepared on channel .

Changed in 0.13.6: the function's signature was previously wrong; it expected an object instance as its first parameter, but the type of the parameter was the type of the interface vtable.

Parameters

self

a client channel factory

 

channel

a TpChannel

 

Returns

a newly allocated GArray.

[transfer full][element-type GQuark]

Since: 0.13.3

Types and Values

TpClientChannelFactory

typedef struct _TpClientChannelFactory TpClientChannelFactory;

Opaque typedef representing a GObject that implements the TP_TYPE_CLIENT_CHANNEL_FACTORY interface.

Since: 0.13.6


struct TpClientChannelFactoryInterface

struct TpClientChannelFactoryInterface {
    GTypeInterface parent;

    TpChannel * (* create_channel) (TpClientChannelFactoryInterface *self,
        TpConnection *conn,
        const gchar *path,
        GHashTable *properties,
        GError **error);

    GArray * (* dup_channel_features) (TpClientChannelFactoryInterface *self,
        TpChannel *channel);

    TpChannel *(*obj_create_channel) (TpClientChannelFactory *self,
        TpConnection *conn,
        const gchar *path,
        GHashTable *properties,
        GError **error);

    GArray *(*obj_dup_channel_features) (TpClientChannelFactory *self,
        TpChannel *channel);
};

Interface for a channel factory

Members

GTypeInterface parent;

the parent

 

create_channel ()

obsolete version of obj_create_channel which does not receive the object instance as an argument

 

dup_channel_features ()

obsolete version of obj_dup_channel_features which does not receive the object instance as an argument

 

obj_create_channel ()

virtual method used to create channels; see tp_client_channel_factory_create_channel()

 

obj_dup_channel_features ()

virtual method returning channel features that have to be prepared on newly created channels; see tp_client_channel_factory_dup_channel_features()

 

Since: 0.13.2

telepathy-glib-0.24.2/docs/reference/html/TpChannelManager.html0000644000175000017500000023127514006623343021334 00000000000000 TpChannelManager: telepathy-glib API Reference Manual

TpChannelManager

TpChannelManager — interface for creating and tracking channels

Signals

void channel-closed Has Details
void new-channels Has Details
void request-already-satisfied Has Details
void request-failed Has Details

Types and Values

Object Hierarchy

    GInterface
    ╰── TpChannelManager

Known Implementations

TpChannelManager is implemented by TpBaseContactList and TpSimplePasswordManager.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A channel manager is attached to a connection. It carries out channel requests from the connection, and responds to channel-related events on the underlying network connection, for particular classes of channel (for example, incoming and outgoing calls, respectively). It also tracks currently-open channels of the relevant kinds.

The connection has an array of channel managers. In response to a call to CreateChannel or RequestChannel, the channel request is offered to each channel manager in turn, until one accepts the request. In a trivial implementation there might be a single channel manager which handles all requests and all incoming events, but in general, there will be multiple channel managers handling different types of channel.

For example, at the time of writing, Gabble has a roster channel manager which handles contact lists and groups, an IM channel manager which handles one-to-one messaging, a MUC channel manager which handles multi-user chat rooms, the index of chat rooms and MUC tubes, a media channel manager which handles VoIP calls, and a 1-1 tubes channel manager.

Functions

TpChannelManagerChannelClassFunc ()

void
(*TpChannelManagerChannelClassFunc) (TpChannelManager *manager,
                                     GHashTable *fixed_properties,
                                     const gchar * const *allowed_properties,
                                     gpointer user_data);

Signature of callbacks which act on each channel class supported by manager .

Parameters

manager

An object implementing TpChannelManager

 

fixed_properties

A table mapping (const gchar *) property names to GValues, representing the values those properties must take to request channels of a particular class.

 

allowed_properties

A NULL-terminated array of property names which may appear in requests for a particular channel class.

 

user_data

Arbitrary user-supplied data.

 

TpChannelManagerForeachChannelClassFunc ()

void
(*TpChannelManagerForeachChannelClassFunc)
                               (TpChannelManager *manager,
                                TpChannelManagerChannelClassFunc func,
                                gpointer user_data);

Signature of an implementation of foreach_channel_class, which must call func(manager, fixed, allowed, user_data) for each channel class understood by manager .

Parameters

manager

An object implementing TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the final argument of func

 

TpChannelManagerTypeChannelClassFunc ()

void
(*TpChannelManagerTypeChannelClassFunc)
                               (GType type,
                                GHashTable *fixed_properties,
                                const gchar * const *allowed_properties,
                                gpointer user_data);

Signature of callbacks which act on each channel class potentially supported by instances of type .

Parameters

type

A type whose instances implement TpChannelManager

 

fixed_properties

A table mapping (const gchar *) property names to GValues, representing the values those properties must take to request channels of a particular class.

 

allowed_properties

A NULL-terminated array of property names which may appear in requests for a particular channel class.

 

user_data

Arbitrary user-supplied data.

 

TpChannelManagerTypeForeachChannelClassFunc ()

void
(*TpChannelManagerTypeForeachChannelClassFunc)
                               (GType type,
                                TpChannelManagerTypeChannelClassFunc func,
                                gpointer user_data);

Signature of an implementation of type_foreach_channel_class, which must call func(type, fixed, allowed, user_data) for each channel class potentially understood by instances of type .

Parameters

type

A type whose instances implement TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the final argument of func

 

TpChannelManagerForeachChannelFunc ()

void
(*TpChannelManagerForeachChannelFunc) (TpChannelManager *manager,
                                       TpExportableChannelFunc func,
                                       gpointer user_data);

Signature of an implementation of foreach_channel, which must call func(channel, user_data) for each channel managed by this channel manager.

Parameters

manager

an object implementing TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the second argument of func

 

TpChannelManagerRequestFunc ()

gboolean
(*TpChannelManagerRequestFunc) (TpChannelManager *manager,
                                gpointer request_token,
                                GHashTable *request_properties);

Signature of an implementation of TpChannelManagerIface.create_channel and TpChannelManagerIface.request_channel.

Implementations should inspect the contents of request_properties to see if it matches a channel class handled by this manager. If so, they should return TRUE to accept responsibility for the request, and ultimately emit exactly one of the “new-channels”, “request-already-satisfied” and “request-failed” signals (including request_token in the appropriate argument).

If the implementation does not want to handle the request, it should return FALSE to allow the request to be offered to another channel manager.

Implementations may assume the following of request_properties :

  • the ChannelType property is present, and is a (const gchar *)
  • the TargetHandleType property is a valid TpHandleType, if present
  • if TargetHandleType is None, TargetHandle is omitted
  • if TargetHandleType is not None, TargetHandle is a valid TpHandle of that TpHandleType

Changed in version 0.15.5: Previously the TargetID property was guaranteed to be missing from request_properties . Now it is always present, whether it was in the original channel request or not.

Parameters

manager

An object implementing TpChannelManager

 

request_token

An opaque pointer representing this pending request.

 

request_properties

A table mapping (const gchar *) property names to GValue, representing the desired properties of a channel requested by a Telepathy client. The hash table will be freed after the function returns; if the channel manager wants to keep it around, it must copy it.

 

Returns

TRUE if manager will handle this request, else FALSE.


tp_channel_manager_asv_has_unknown_properties ()

gboolean
tp_channel_manager_asv_has_unknown_properties
                               (GHashTable *properties,
                                const gchar * const *fixed,
                                const gchar * const *allowed,
                                GError **error);

Checks whether the keys of properties are elements of one of fixed and allowed . This is intended to be used by implementations of TpChannelManagerIface.create_channel which have decided to accept a request, to conform with the specification's requirement that unknown requested properties must cause a request to fail, not be silently ignored.

On encountering unknown properties, this function will return TRUE, and set error to a GError that could be used as a D-Bus method error.

Parameters

properties

a table mapping (const gchar *) property names to GValues, as passed to methods of TpChannelManager

 

fixed

a NULL-terminated array of property names

 

allowed

a NULL-terminated array of property names

 

error

an address at which to store an error suitable for returning from the D-Bus method when properties contains unknown properties

 

Returns

TRUE if properties contains keys not in either fixed or allowed ; else FALSE.

Since: 0.7.15


tp_channel_manager_create_channel ()

gboolean
tp_channel_manager_create_channel (TpChannelManager *manager,
                                   gpointer request_token,
                                   GHashTable *request_properties);

Offers an incoming CreateChannel call to manager .

Parameters

manager

An object implementing TpChannelManager

 

request_token

An opaque pointer representing this pending request.

 

request_properties

A table mapping (const gchar *) property names to GValue, representing the desired properties of a channel requested by a Telepathy client.

 

Returns

TRUE if this request will be handled by manager ; else FALSE.

Since: 0.7.15


tp_channel_manager_emit_channel_closed ()

void
tp_channel_manager_emit_channel_closed
                               (gpointer instance,
                                const gchar *path);

Emit the “channel-closed” signal indicating that the channel at the given object path has been closed.

Parameters

instance

An object implementing TpChannelManager

 

path

A channel's object-path

 

Since: 0.7.15


tp_channel_manager_emit_channel_closed_for_object ()

void
tp_channel_manager_emit_channel_closed_for_object
                               (gpointer instance,
                                TpExportableChannel *channel);

Emit the “channel-closed” signal indicating that the given channel has been closed. (This is a convenient shortcut for calling tp_channel_manager_emit_channel_closed() with the “object-path” property of channel .)

Parameters

instance

An object implementing TpChannelManager

 

channel

A TpExportableChannel

 

Since: 0.7.15


tp_channel_manager_emit_new_channel ()

void
tp_channel_manager_emit_new_channel (gpointer instance,
                                     TpExportableChannel *channel,
                                     GSList *request_tokens);

Emit the “new-channels” signal indicating that the channel has been created.

Parameters

instance

An object implementing TpChannelManager

 

channel

A TpExportableChannel

 

request_tokens

the request tokens (opaque pointers) satisfied by this channel

 

Since: 0.7.15


tp_channel_manager_emit_new_channels ()

void
tp_channel_manager_emit_new_channels (gpointer instance,
                                      GHashTable *channels);

tp_channel_manager_emit_new_channels is deprecated and should not be used in newly-written code.

in 0.19.1 this function should not be used. Signalling the creation of multiple channels together in a single signal is strongly recommended against as it's very complicated, hard to get right in clients, and not nearly as useful as it originally sounded. Use tp_channel_manager_emit_new_channel() instead.

If channels is non-empty, emit the “new-channels” signal indicating that those channels have been created.

Parameters

instance

An object implementing TpChannelManager

 

channels

a GHashTable where the keys are TpExportableChannel instances (hashed and compared by g_direct_hash() and g_direct_equal()) and the values are linked lists (GSList) of request tokens (opaque pointers) satisfied by these channels

 

Since: 0.7.15


tp_channel_manager_emit_request_already_satisfied ()

void
tp_channel_manager_emit_request_already_satisfied
                               (gpointer instance,
                                gpointer request_token,
                                TpExportableChannel *channel);

Emit the “request-already-satisfied” signal indicating that the pre-existing channel channel satisfies request_token .

Parameters

instance

An object implementing TpChannelManager

 

request_token

An opaque pointer representing the request that succeeded

 

channel

The channel that satisfies the request

 

Since: 0.7.15


tp_channel_manager_emit_request_failed ()

void
tp_channel_manager_emit_request_failed
                               (gpointer instance,
                                gpointer request_token,
                                GQuark domain,
                                gint code,
                                const gchar *message);

Emit the “request-failed” signal indicating that the request request_token failed for the given reason.

Parameters

instance

An object implementing TpChannelManager

 

request_token

An opaque pointer representing the request that failed

 

domain

a GError domain

 

code

a GError code appropriate for domain

 

message

the error message

 

Since: 0.7.15


tp_channel_manager_emit_request_failed_printf ()

void
tp_channel_manager_emit_request_failed_printf
                               (gpointer instance,
                                gpointer request_token,
                                GQuark domain,
                                gint code,
                                const gchar *format,
                                ...);

Emit the “request-failed” signal indicating that the request request_token failed for the given reason.

Parameters

instance

An object implementing TpChannelManager

 

request_token

An opaque pointer representing the request that failed

 

domain

a GError domain

 

code

a GError code appropriate for domain

 

format

a printf-style format string for the error message

 

...

arguments for the format string

 

Since: 0.7.15


tp_channel_manager_ensure_channel ()

gboolean
tp_channel_manager_ensure_channel (TpChannelManager *manager,
                                   gpointer request_token,
                                   GHashTable *request_properties);

Offers an incoming EnsureChannel call to manager .

Parameters

manager

An object implementing TpChannelManager

 

request_token

An opaque pointer representing this pending request.

 

request_properties

A table mapping (const gchar *) property names to GValue, representing the desired properties of a channel requested by a Telepathy client.

 

Returns

TRUE if this request will be handled by manager ; else FALSE.

Since: 0.7.16


tp_channel_manager_foreach_channel ()

void
tp_channel_manager_foreach_channel (TpChannelManager *manager,
                                    TpExportableChannelFunc func,
                                    gpointer user_data);

Calls func(channel, user_data) for each channel managed by manager .

Parameters

manager

an object implementing TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the second argument of func

 

Since: 0.7.15


tp_channel_manager_foreach_channel_class ()

void
tp_channel_manager_foreach_channel_class
                               (TpChannelManager *manager,
                                TpChannelManagerChannelClassFunc func,
                                gpointer user_data);

Calls func(manager, fixed, allowed, user_data) for each channel class understood by manager .

Parameters

manager

An object implementing TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the final argument of func

 

Since: 0.7.15


tp_channel_manager_type_foreach_channel_class ()

void
tp_channel_manager_type_foreach_channel_class
                               (GType type,
                                TpChannelManagerTypeChannelClassFunc func,
                                gpointer user_data);

Calls func(type, fixed, allowed, user_data) for each channel class potentially understood by instances of type .

Parameters

type

A type whose instances implement TpChannelManager

 

func

A function

 

user_data

Arbitrary data to be passed as the final argument of func

 

Since: 0.11.11


tp_channel_manager_request_channel ()

gboolean
tp_channel_manager_request_channel (TpChannelManager *manager,
                                    gpointer request_token,
                                    GHashTable *request_properties);

Offers an incoming RequestChannel call to manager .

Parameters

manager

An object implementing TpChannelManager

 

request_token

An opaque pointer representing this pending request.

 

request_properties

A table mapping (const gchar *) property names to GValue, representing the desired properties of a channel requested by a Telepathy client.

 

Returns

TRUE if this request will be handled by manager ; else FALSE.

Since: 0.7.15

Types and Values

TpChannelManager

typedef struct _TpChannelManager TpChannelManager;

Opaque typedef representing any channel manager implementation.


struct TpChannelManagerIface

struct TpChannelManagerIface {
    GTypeInterface parent;

    TpChannelManagerForeachChannelFunc foreach_channel;

    TpChannelManagerForeachChannelClassFunc foreach_channel_class;

    TpChannelManagerRequestFunc create_channel;
    TpChannelManagerRequestFunc request_channel;
    TpChannelManagerRequestFunc ensure_channel;

    TpChannelManagerTypeForeachChannelClassFunc type_foreach_channel_class;
};

The vtable for a channel manager implementation.

In addition to the fields documented here there are several GCallback fields which must currently be NULL.

Members

GTypeInterface parent;

Fields shared with GTypeInterface.

 

TpChannelManagerForeachChannelFunc foreach_channel;

Call func(channel, user_data) for each channel managed by this manager. If not implemented, the manager is assumed to manage no channels.

 

TpChannelManagerForeachChannelClassFunc foreach_channel_class;

Call func(manager, fixed, allowed, user_data) for each class of channel that this instance can create (a subset of the channel classes produced by type_foreach_channel_class ). If not implemented, type_foreach_channel_class is used.

 

TpChannelManagerRequestFunc create_channel;

Respond to a request for a new channel made with the Connection.Interface.Requests.CreateChannel method. See TpChannelManagerRequestFunc for details.

 

TpChannelManagerRequestFunc request_channel;

Respond to a request for a (new or existing) channel made with the Connection.RequestChannel method. See TpChannelManagerRequestFunc for details.

 

TpChannelManagerRequestFunc ensure_channel;

Respond to a request for a (new or existing) channel made with the Connection.Interface.Requests.EnsureChannel method. See TpChannelManagerRequestFunc for details. Since: 0.7.16

 

TpChannelManagerTypeForeachChannelClassFunc type_foreach_channel_class;

Call func(cls, fixed, allowed, user_data) for each class of channel that instances of this class might be able to create. Since: 0.11.11

 

Since: 0.7.15

Signal Details

The “channel-closed” signal

void
user_function (TpChannelManager *self,
               gchar            *path,
               gpointer          user_data)

Emitted when a channel has been closed. The Connection should generally respond to this signal by emitting ChannelClosed.

Parameters

self

the channel manager

 

path

the channel's object-path

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-channels” signal

void
user_function (TpChannelManager *self,
               gpointer          channels,
               gpointer          user_data)

Emitted when new channels have been created. The Connection should generally emit NewChannels (and NewChannel) in response to this signal, and then return from pending CreateChannel, EnsureChannel and/or RequestChannel calls if appropriate.

Since 0.19.1, clients should not emit more than one channel in this signal at one time as the creation of multiple channels together in a single signal is strongly recommended against: it's very complicated, hard to get right in clients, and not nearly as useful as it originally sounded.

Parameters

self

the channel manager

 

channels

a GHashTable where the keys are TpExportableChannel instances (hashed and compared by g_direct_hash() and g_direct_equal()) and the values are linked lists (GSList) of request tokens (opaque pointers) satisfied by these channels

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “request-already-satisfied” signal

void
user_function (TpChannelManager *self,
               gpointer          request_token,
               GObject          *channel,
               gpointer          user_data)

Emitted when a channel request is satisfied by an existing channel. The Connection should generally respond to this signal by returning success from EnsureChannel or RequestChannel.

Parameters

self

the channel manager

 

request_token

opaque pointer supplied by the requester, representing a request

 

channel

the existing TpExportableChannel that satisfies the request

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “request-failed” signal

void
user_function (TpChannelManager *self,
               gpointer          request_token,
               guint             domain,
               gint              code,
               gchar            *message,
               gpointer          user_data)

Emitted when a channel request has failed. The Connection should generally respond to this signal by returning failure from CreateChannel, EnsureChannel or RequestChannel.

Parameters

self

the channel manager

 

request_token

opaque pointer supplied by the requester, representing a request

 

domain

the domain of a GError indicating why the request failed

 

code

the error code of a GError indicating why the request failed

 

message

the string part of a GError indicating why the request failed

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

See Also

TpSvcConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-request.html0000644000175000017500000007413514006623344024765 00000000000000 Service-side Channel Request interface: telepathy-glib API Reference Manual

Service-side Channel Request interface

Service-side Channel Request interface — GInterface for Telepathy ChannelRequest object

Signals

void failed Has Details
void succeeded Has Details
void succeeded-with-channel Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelRequest

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy ChannelRequest interface, with the correct method and signal signatures, and emit signals from that object in a type-safe way.

You don't need these interfaces unless you're implementing a Telepathy ChannelDispatcher, such as Mission Control.

Functions

tp_svc_channel_request_return_from_proceed ()

void
tp_svc_channel_request_return_from_proceed
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_request_proceed_impl ()

void
(*tp_svc_channel_request_proceed_impl)
                               (TpSvcChannelRequest *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Proceed on interface org.freedesktop.Telepathy.ChannelRequest.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_request_implement_proceed ()

void
tp_svc_channel_request_implement_proceed
                               (TpSvcChannelRequestClass *klass,
                                tp_svc_channel_request_proceed_impl impl);

Register an implementation for the Proceed method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Proceed D-Bus method

 

tp_svc_channel_request_return_from_cancel ()

void
tp_svc_channel_request_return_from_cancel
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_request_cancel_impl ()

void
(*tp_svc_channel_request_cancel_impl) (TpSvcChannelRequest *self,
                                       DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Cancel on interface org.freedesktop.Telepathy.ChannelRequest.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_request_implement_cancel ()

void
tp_svc_channel_request_implement_cancel
                               (TpSvcChannelRequestClass *klass,
                                tp_svc_channel_request_cancel_impl impl);

Register an implementation for the Cancel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Cancel D-Bus method

 

tp_svc_channel_request_emit_failed ()

void
tp_svc_channel_request_emit_failed (gpointer instance,
                                    const gchar *arg_Error,
                                    const gchar *arg_Message);

Type-safe wrapper around g_signal_emit to emit the Failed signal on interface org.freedesktop.Telepathy.ChannelRequest.

Parameters

instance

The object implementing this interface

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_request_emit_succeeded ()

void
tp_svc_channel_request_emit_succeeded (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Succeeded signal on interface org.freedesktop.Telepathy.ChannelRequest.

Parameters

instance

The object implementing this interface

 

tp_svc_channel_request_emit_succeeded_with_channel ()

void
tp_svc_channel_request_emit_succeeded_with_channel
                               (gpointer instance,
                                const gchar *arg_Connection,
                                GHashTable *arg_Connection_Properties,
                                const gchar *arg_Channel,
                                GHashTable *arg_Channel_Properties);

Type-safe wrapper around g_signal_emit to emit the SucceededWithChannel signal on interface org.freedesktop.Telepathy.ChannelRequest.

Parameters

instance

The object implementing this interface

 

arg_Connection

const gchar * (FIXME, generate documentation)

 

arg_Connection_Properties

GHashTable * (FIXME, generate documentation)

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Channel_Properties

GHashTable * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelRequest

typedef struct _TpSvcChannelRequest TpSvcChannelRequest;

Dummy typedef representing any implementation of this interface.


TpSvcChannelRequestClass

typedef struct _TpSvcChannelRequestClass TpSvcChannelRequestClass;

The class of TpSvcChannelRequest.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_request (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_request_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (proceed);
  IMPLEMENT (cancel);
#undef IMPLEMENT
}

Signal Details

The “failed” signal

void
user_function (TpSvcChannelRequest *self,
               gchar               *arg_Error,
               gchar               *arg_Message,
               gpointer             user_data)

The Failed D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “succeeded” signal

void
user_function (TpSvcChannelRequest *self,
               gpointer             user_data)

The Succeeded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “succeeded-with-channel” signal

void
user_function (TpSvcChannelRequest *self,
               DBusGObjectPath     *arg_Connection,
               DBusGObjectPath     *arg_Channel,
               gpointer             user_data)

The SucceededWithChannel D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Connection

const gchar * (FIXME, generate documentation)

 

arg_Connection_Properties

GHashTable * (FIXME, generate documentation)

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Channel_Properties

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-client.html0000644000175000017500000021174414006623344022353 00000000000000 TpClient: telepathy-glib API Reference Manual

TpClient

TpClient — proxy object for a client of the ChannelDispatcher

Types and Values

struct TpClient
struct TpClientClass

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpClient

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Each client to which the ChannelDispatcher can send channels must implement the Client interface. This object represents such a client, and is mainly useful in the implementation of the ChannelDispatcher itself.

Functions

tp_client_init_known_interfaces ()

void
tp_client_init_known_interfaces (void);

Ensure that the known interfaces for TpClient have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CLIENT.

Since: 0.7.32


tp_cli_client_observer_callback_for_observe_channels ()

void
(*tp_cli_client_observer_callback_for_observe_channels)
                               (TpClient *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ObserveChannels method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_client_observer_call_observe_channels ()

TpProxyPendingCall *
tp_cli_client_observer_call_observe_channels
                               (TpClient *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                const gchar *in_Connection,
                                const GPtrArray *in_Channels,
                                const gchar *in_Dispatch_Operation,
                                const GPtrArray *in_Requests_Satisfied,
                                GHashTable *in_Observer_Info,
                                tp_cli_client_observer_callback_for_observe_channels callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ObserveChannels method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by the channel dispatcher when channels in which the observer has registered an interest are announced in a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Requests">NewChannels</tp:dbus-ref> signal.</p> <p>If the same NewChannels signal announces some channels that match the filter, and some that do not, then only a subset of the channels (those that do match the filter) are passed to this method.</p> <p>If the channel dispatcher will split up the channels from a single NewChannels signal and dispatch them separately (for instance because no installed Handler can handle all of them), it will call ObserveChannels several times.</p> <p>The observer MUST NOT return from this method call until it is ready for a handler for the channel to run (which may change the channel's state).</p> <tp:rationale> <p>The channel dispatcher must wait for observers to start up, to avoid the following race: text channel logger (observer) gets ObserveChannels, text channel handler gets <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref> channel handler starts up faster and acknowledges messages, logger never sees those messages.</p> </tp:rationale> <p>The channel dispatcher SHOULD NOT change its behaviour based on whether this method succeeds or fails: there are no defined D-Bus errors for this method, and if it fails, this only indicates that an Observer is somehow broken.</p> <tp:rationale> <p>The expected error response in the channel dispatcher is to log a warning, and otherwise continue as though this method had succeeded.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> with which the channels are associated. The well-known bus name to use is that of the <tp:dbus-ref namespace="org.freedesktop.Telepathy">AccountManager</tp:dbus-ref>.

 

in_Connection

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> with which the channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'.

 

in_Channels

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref>s and their properties. Their well-known bus names are all the same as that of the Connection.

 

in_Dispatch_Operation

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The path to the <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation</tp:dbus-ref> for these channels, or the special value '/' if there is no ChannelDispatchOperation (because the channels were requested, not incoming).</p> <p>If the Observer calls <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">Claim</tp:dbus-ref> or <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">HandleWith</tp:dbus-ref> on the dispatch operation, it MUST be careful to avoid deadlock, since these methods cannot return until the Observer has returned from <tp:member-ref>ObserveChannels</tp:member-ref>.</p> <tp:rationale> <p>This allows an Observer to <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">Claim</tp:dbus-ref> a set of channels without having to match up calls to this method with calls to <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Approver">AddDispatchOperation</tp:dbus-ref>.</p> </tp:rationale>

 

in_Requests_Satisfied

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref>s satisfied by these channels. <tp:rationale> If the same process is an Observer and a Handler, it can be useful to be given this information as soon as possible (it will also be passed to <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client">Handler.HandleChannels</tp:dbus-ref>). </tp:rationale>

 

in_Observer_Info

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Additional information about these channels. Currently defined keys are:</p> <dl> <dt><code>recovering</code> - b</dt> <dd><code>True</code> if ObserveChannels was called for an existing channel (due to the <tp:member-ref>Recover</tp:member-ref> property being <code>True</code>); <code>False</code> or omitted otherwise. <tp:rationale> This allows observers to distinguish between new channels (the normal case), and existing channels that were given to the observer in order to catch up on previous events (perhaps after a previous instance of the same observer crashed). </tp:rationale> </dd> <dt><code>request-properties</code> - a{oa{sv}}</dt> <dd>A map from <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> paths listed in <var>Requests_Satisfied</var> to <tp:type>Qualified_Property_Value_Map</tp:type>s containing namespaced immutable properties of each request.</dd> </dl> <p>All defined keys for this dictionary are optional; observers MAY safely ignore any entry in this dictionary.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_client_handler_callback_for_handle_channels ()

void
(*tp_cli_client_handler_callback_for_handle_channels)
                               (TpClient *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a HandleChannels method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_client_handler_call_handle_channels ()

TpProxyPendingCall *
tp_cli_client_handler_call_handle_channels
                               (TpClient *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                const gchar *in_Connection,
                                const GPtrArray *in_Channels,
                                const GPtrArray *in_Requests_Satisfied,
                                guint64 in_User_Action_Time,
                                GHashTable *in_Handler_Info,
                                tp_cli_client_handler_callback_for_handle_channels callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a HandleChannels method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by the channel dispatcher when this client should handle these channels, or when this client should present channels that it is already handling to the user (e.g. bring them into the foreground).</p> <tp:rationale> <p>Clients are expected to know what channels they're already handling, and which channel object path corresponds to which window or tab. This can easily be done using a hash table keyed by channels' object paths.</p> </tp:rationale> <p>This method can raise any D-Bus error. If it does, the handler is assumed to have failed or crashed, and the channel dispatcher MUST recover in an implementation-specific way; it MAY attempt to dispatch the channels to another handler, or close the channels.</p> <p>If closing the channels, it is RECOMMENDED that the channel dispatcher attempts to close the channels using <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Close</tp:dbus-ref>, but resorts to calling <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel.Interface.Destroyable.Destroy</tp:dbus-ref> (if available) or ignoring the channel (if not) if the same handler repeatedly fails to handle channels.</p> <p>After HandleChannels returns successfully, the client process is considered to be responsible for the channel until it its unique name disappears from the bus.</p> <tp:rationale> <p>If a process has multiple Client bus names - some temporary and some long-lived - and drops one of the temporary bus names in order to reduce the set of channels that it will handle, any channels that it is already handling should remain unaffected.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> with which the channels are associated. The well-known bus name to use is that of the <tp:dbus-ref namespace="org.freedesktop.Telepathy">AccountManager</tp:dbus-ref>.

 

in_Connection

Used to pass an 'in' argument: The Connection with which the channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'.

 

in_Channels

Used to pass an 'in' argument: The channels and their immutable properties. Their well-known bus name is the same as that of the Connection.

 

in_Requests_Satisfied

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The requests satisfied by these channels.</p> <tp:rationale> <p>If the handler implements Requests, this tells it that these channels match previous <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Interface.Requests">AddRequest</tp:dbus-ref> calls that it may have received.</p> <p>There can be more than one, if they were EnsureChannel requests.</p> </tp:rationale>

 

in_User_Action_Time

Used to pass an 'in' argument: The time at which user action occurred, or 0 if this channel is to be handled for some reason not involving user action. Handlers SHOULD use this for focus-stealing prevention, if applicable. This property has the same semantic as <tp:type>User_Action_Timestamp</tp:type> but is unsigned for historical reasons.

 

in_Handler_Info

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Additional information about these channels. Currently defined keys are:</p> <dl> <dt><code>request-properties</code> - a{oa{sv}}</dt> <dd>A map from <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> paths listed in <var>Requests_Satisfied</var> to <tp:type>Qualified_Property_Value_Map</tp:type>s containing namespaced immutable properties of each request.</dd> </dl> <p>When more keys are defined for this dictionary, all will be optional; handlers MAY safely ignore any entry in this dictionary.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_client_interface_requests_callback_for_add_request ()

void
(*tp_cli_client_interface_requests_callback_for_add_request)
                               (TpClient *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddRequest method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_client_interface_requests_call_add_request ()

TpProxyPendingCall *
tp_cli_client_interface_requests_call_add_request
                               (TpClient *proxy,
                                gint timeout_ms,
                                const gchar *in_Request,
                                GHashTable *in_Properties,
                                tp_cli_client_interface_requests_callback_for_add_request callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddRequest method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by the ChannelDispatcher to indicate that channels have been requested, and that if the request is successful, they will probably be handled by this Handler. The ChannelDispatcher SHOULD only call this method on one handler per request.</p> <tp:rationale> <p>This allows the UI to start preparing to handle the channels in advance (e.g. render a window with an &quot;in progress&quot; message), improving perceived responsiveness.</p> <p>The use of &quot;probably&quot; is because you can't necessarily tell from a channel request which handler will handle particular channels. A reasonable heuristic would be to match the request against the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandlerChannelFilter</tp:dbus-ref>, and respect the preferred handler (if any).</p> </tp:rationale> <p>If the request succeeds and is given to the expected Handler, the Requests_Satisfied parameter to <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref> can be used to match the channel to a previous AddRequest call.</p> <tp:rationale> <p>This lets the UI direct the channels to the window that it already opened.</p> </tp:rationale> <p>If the request fails, the expected handler is notified by the channel dispatcher calling its <tp:member-ref>RemoveRequest</tp:member-ref> method.</p> <tp:rationale> <p>This lets the UI close the window or display the error.</p> </tp:rationale> <p>The channel dispatcher SHOULD remember which handler was notified, and if the channel request succeeds, it SHOULD dispatch the channels to the expected handler, unless the channels do not match that handler's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandlerChannelFilter</tp:dbus-ref>. If the channels are not dispatched to the expected handler, the handler that was expected is notified by the channel dispatcher calling its <tp:member-ref>RemoveRequest</tp:member-ref> method with the NotYours error.</p> <tp:rationale> <p>Expected handling is for the UI to close the window it previously opened.</p> </tp:rationale> <p>Handlers SHOULD NOT return an error from this method; errors returned from this method SHOULD NOT alter the channel dispatcher's behaviour.</p> <tp:rationale> <p>Calls to this method are merely a notification.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Request

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object, which MUST have been returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">CreateChannel</tp:dbus-ref> or <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">EnsureChannel</tp:dbus-ref> before this method is called. <tp:rationale> See those methods for the rationale of this ordering. </tp:rationale>

 

in_Properties

Used to pass an 'in' argument: <p>Some of the properties of the ChannelRequest. To avoid race conditions, this dictionary MUST NOT include properties whose values could subsequently change. It SHOULD include as many properties as possible, given that constraint.</p> <p>In particular, the properties <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelRequest">Requests</tp:dbus-ref>, <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelRequest">UserActionTime</tp:dbus-ref> and <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelRequest">Account</tp:dbus-ref> MUST be included, and <tp:dbus-ref namespace="ofdT.ChannelRequest">Hints</tp:dbus-ref> MUST be included if implemented.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_client_interface_requests_callback_for_remove_request ()

void
(*tp_cli_client_interface_requests_callback_for_remove_request)
                               (TpClient *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveRequest method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_client_interface_requests_call_remove_request ()

TpProxyPendingCall *
tp_cli_client_interface_requests_call_remove_request
                               (TpClient *proxy,
                                gint timeout_ms,
                                const gchar *in_Request,
                                const gchar *in_Error,
                                const gchar *in_Message,
                                tp_cli_client_interface_requests_callback_for_remove_request callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveRequest method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by the ChannelDispatcher to indicate that a request previously passed to <tp:member-ref>AddRequest</tp:member-ref> has failed and should be disregarded.</p> <p>Handlers SHOULD NOT return an error from this method; errors returned from this method SHOULD NOT alter the channel dispatcher's behaviour.</p> <tp:rationale> <p>Calls to this method are merely a notification.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Request

Used to pass an 'in' argument: The request that failed.

 

in_Error

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The name of the D-Bus error with which the request failed.</p> <p>If this is <code>org.freedesktop.Telepathy.Error.NotYours</code>, this indicates that the request succeeded, but all the resulting channels were given to some other handler.</p>

 

in_Message

Used to pass an 'in' argument: Any message supplied with the D-Bus error.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_client_approver_callback_for_add_dispatch_operation ()

void
(*tp_cli_client_approver_callback_for_add_dispatch_operation)
                               (TpClient *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddDispatchOperation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_client_approver_call_add_dispatch_operation ()

TpProxyPendingCall *
tp_cli_client_approver_call_add_dispatch_operation
                               (TpClient *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Channels,
                                const gchar *in_DispatchOperation,
                                GHashTable *in_Properties,
                                tp_cli_client_approver_callback_for_add_dispatch_operation callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddDispatchOperation method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by the channel dispatcher when a ChannelDispatchOperation in which the approver has registered an interest is created, or when the approver starts up while such channel dispatch operations already exist.</p> <p>The channel dispatcher SHOULD call this method on all approvers at the same time. If an approver returns an error from this method, the approver is assumed to be faulty.</p> <p>If no approvers return from this method successfully (including situations where there are no matching approvers at all), the channel dispatcher SHOULD consider this to be an error, and recover by dispatching the channel to the most preferred handler.</p> <tp:rationale> Processes that aren't approvers (or don't at least ensure that there is some approver) probably shouldn't be making connections anyway, so there should always be at least one approver running. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Channels

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The initial value of the <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation.Channels</tp:dbus-ref> property, containing the <tp:dbus-ref namespace="org.freedesktop.Telepathy">Channel</tp:dbus-ref>s to be dispatched and their properties.</p> <tp:rationale> <p>This can't be signalled to the approver through the Properties parameter of this method, because Channels is not an immutable property.</p> </tp:rationale> <p>This argument always contains all of the channels in the channel dispatch operation, even if not all of them actually match the <tp:member-ref>ApproverChannelFilter</tp:member-ref>.</p> <tp:rationale> <p>This seems the least bad way to handle such a situation; see the discussion on <a href="http://bugs.freedesktop.org/show_bug.cgi?id=21090">bug 21090</a>.</p> </tp:rationale> <p>The actual channels to be dispatched may reduce as channels are closed: this is signalled by <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation.ChannelLost</tp:dbus-ref>. </p> <p>Approvers SHOULD connect to ChannelLost and <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation.Finished</tp:dbus-ref>. (if desired) before returning from AddDispatchOperation, since those signals are guaranteed not to be emitted until after all AddDispatchOperation calls have returned (with success or failure) or timed out.</p>

 

in_DispatchOperation

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation</tp:dbus-ref> to be processed.</p>

 

in_Properties

Used to pass an 'in' argument: <p>Properties of the channel dispatch operation. The keys MUST be fully qualified D-Bus property names. This MUST NOT include properties that could change, SHOULD include as many properties as possible given that constraint, and MUST include at least the <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">Account</tp:dbus-ref>, <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">Connection</tp:dbus-ref> and <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatchOperation">PossibleHandlers</tp:dbus-ref> properties.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.

Types and Values

struct TpClient

struct TpClient;

Each client to which the ChannelDispatcher can send channels must implement the Client interface. This object represents such a client, and is mainly useful in the implementation of the ChannelDispatcher itself.

This proxy is usable but very incomplete: accessors for D-Bus properties will be added in a later version of telepathy-glib, along with a mechanism similar to tp_connection_call_when_ready().

Many operations performed on a Client are done via D-Bus properties. Until convenience methods for this are implemented, use of the generic tp_cli_dbus_properties_call_get_all() and tp_cli_dbus_properties_call_set() methods is recommended.

Since: 0.7.32


struct TpClientClass

struct TpClientClass {
};

The class of a TpClient.

telepathy-glib-0.24.2/docs/reference/html/TpIntset.html0000644000175000017500000016501314006623343017733 00000000000000 TpIntset: telepathy-glib API Reference Manual

TpIntset

TpIntset — a set of unsigned integers

Types and Values

Object Hierarchy

    GBoxed
    ├── TpIntSet
    ╰── TpIntset

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A TpIntset is a set of unsigned integers, implemented as a dynamically-allocated sparse bitfield.

Functions

TpIntFunc ()

void
(*TpIntFunc) (guint i,
              gpointer userdata);

A callback function acting on unsigned integers.

Parameters

i

The relevant integer

 

userdata

Opaque user data

 

tp_intset_sized_new ()

TpIntset *
tp_intset_sized_new (guint size);

Allocate a new integer set.

Parameters

size

ignored (it was previously 1 more than the largest integer you expect to store)

 

Returns

a new, empty integer set to be destroyed with tp_intset_destroy()


tp_intset_new ()

TpIntset *
tp_intset_new (void);

Allocate a new integer set.

Returns

a new, empty integer set to be destroyed with tp_intset_destroy()


tp_intset_new_containing ()

TpIntset *
tp_intset_new_containing (guint element);

Allocate a new integer set containing the given integer.

Parameters

element

integer to add to a new set

 

Returns

a new integer set containing element , to be destroyed with tp_intset_destroy()

Since: 0.7.26


tp_intset_destroy ()

void
tp_intset_destroy (TpIntset *set);

Free all memory used by the set.

Parameters

set

set

 

tp_intset_clear ()

void
tp_intset_clear (TpIntset *set);

Unset every integer in the set.

Parameters

set

set

 

tp_intset_add ()

void
tp_intset_add (TpIntset *set,
               guint element);

Add an integer into a TpIntset.

Parameters

set

set

 

element

integer to add

 

tp_intset_remove ()

gboolean
tp_intset_remove (TpIntset *set,
                  guint element);

Remove an integer from a TpIntset

Parameters

set

set

 

element

integer to add

 

Returns

TRUE if element was previously in set


tp_intset_is_member ()

gboolean
tp_intset_is_member (const TpIntset *set,
                     guint element);

Tests if element is a member of set

Parameters

set

set

 

element

integer to test

 

Returns

TRUE if element is in set


tp_intset_foreach ()

void
tp_intset_foreach (const TpIntset *set,
                   TpIntFunc func,
                   gpointer userdata);

Call func (element, userdata ) for each element of set , in order.

Parameters

set

set

 

func

TpIntFunc to use to iterate the set.

[scope call]

userdata

user data to pass to each call of func

 

tp_intset_to_array ()

GArray *
tp_intset_to_array (const TpIntset *set);

Parameters

set

set to convert

 

Returns

a GArray of guint (which must be freed by the caller) containing the same integers as set .

[element-type uint][transfer full]


tp_intset_from_array ()

TpIntset *
tp_intset_from_array (const GArray *array);

Parameters

array

An array of guint.

[element-type uint]

Returns

A set containing the same integers as array .


tp_intset_is_empty ()

gboolean
tp_intset_is_empty (const TpIntset *set);

Return the same thing as (tp_intset_size (set) == 0), but calculated more efficiently.

Parameters

set

a set of integers

 

Returns

TRUE if set is empty

Since: 0.11.6


tp_intset_size ()

guint
tp_intset_size (const TpIntset *set);

Parameters

set

A set of integers

 

Returns

The number of integers in set


tp_intset_is_equal ()

gboolean
tp_intset_is_equal (const TpIntset *left,
                    const TpIntset *right);

Parameters

left

A set of integers

 

right

A set of integers

 

Returns

TRUE if left and right contain the same bits


tp_intset_copy ()

TpIntset *
tp_intset_copy (const TpIntset *orig);

Parameters

orig

A set of integers

 

Returns

A set containing the same integers as orig , to be freed with tp_intset_destroy() by the caller


tp_intset_intersection ()

TpIntset *
tp_intset_intersection (const TpIntset *left,
                        const TpIntset *right);

Parameters

left

The left operand

 

right

The right operand

 

Returns

The set of those integers which are in both left and right (analogous to the bitwise operation left & right), to be freed with tp_intset_destroy() by the caller


tp_intset_union ()

TpIntset *
tp_intset_union (const TpIntset *left,
                 const TpIntset *right);

Parameters

left

The left operand

 

right

The right operand

 

Returns

The set of those integers which are in either left or right (analogous to the bitwise operation left | right), to be freed with tp_intset_destroy() by the caller


tp_intset_union_update ()

void
tp_intset_union_update (TpIntset *self,
                        const TpIntset *other);

Add each integer in other to self , analogous to the bitwise operation self |= other.

Parameters

self

the set to change

 

other

members to add

 

Since: 0.13.10


tp_intset_difference ()

TpIntset *
tp_intset_difference (const TpIntset *left,
                      const TpIntset *right);

Parameters

left

The left operand

 

right

The right operand

 

Returns

The set of those integers which are in left and not in right (analogous to the bitwise operation left & (~right)), to be freed with tp_intset_destroy() by the caller


tp_intset_difference_update ()

void
tp_intset_difference_update (TpIntset *self,
                             const TpIntset *other);

Remove each integer in other from self , analogous to the bitwise operation self &= (~other).

Parameters

self

the set to change

 

other

members to remove

 

Since: 0.13.10


tp_intset_symmetric_difference ()

TpIntset *
tp_intset_symmetric_difference (const TpIntset *left,
                                const TpIntset *right);

Parameters

left

The left operand

 

right

The right operand

 

Returns

The set of those integers which are in either left or right but not both (analogous to the bitwise operation left ^ right), to be freed with tp_intset_destroy() by the caller


tp_intset_dump ()

gchar *
tp_intset_dump (const TpIntset *set);

Parameters

set

An integer set

 

Returns

a string which the caller must free with g_free, listing the numbers in set in a human-readable format


tp_intset_fast_iter_init ()

void
tp_intset_fast_iter_init (TpIntsetFastIter *iter,
                          const TpIntset *set);

Initialize iter to iterate over set in arbitrary order. iter will become invalid if set is modified.

Parameters

iter

an iterator

 

set

a set

 

Since: 0.11.6


tp_intset_fast_iter_next ()

gboolean
tp_intset_fast_iter_next (TpIntsetFastIter *iter,
                          guint *output);

Advances iter and retrieves the integer it now points to. Iteration is not necessarily in numerical order.

Parameters

iter

an iterator

 

output

a location to store a new integer, in arbitrary order

 

Returns

FALSE if the end of the set has been reached

Since: 0.11.6


TP_INTSET_ITER_INIT()

#define TP_INTSET_ITER_INIT(set) { (set), (guint)(-1) }

TP_INTSET_ITER_INIT is deprecated and should not be used in newly-written code.

since 0.19.0. Use TpIntsetFastIter instead

A suitable static initializer for a TpIntsetIter, to be used as follows:

1
2
3
4
5
6
void
do_something (const TpIntset *intset)
{
  TpIntsetIter iter = TP_INTSET_ITER_INIT (intset);
  /* ... do something with iter ... */
}

Parameters

set

A set of integers

 

tp_intset_iter_init ()

void
tp_intset_iter_init (TpIntsetIter *iter,
                     const TpIntset *set);

tp_intset_iter_init is deprecated and should not be used in newly-written code.

since 0.19.0. Use TpIntsetFastIter instead

Reset the iterator iter to the beginning and make it iterate over set .

Parameters

iter

An integer set iterator to be initialized.

 

set

An integer set to be used by that iterator

 

tp_intset_iter_next ()

gboolean
tp_intset_iter_next (TpIntsetIter *iter);

tp_intset_iter_next is deprecated and should not be used in newly-written code.

If there are integers in (iter->set ) higher than (iter->element ), set (iter->element) to the next one and return TRUE. Otherwise return FALSE.

Usage:

1
2
3
4
5
TpIntsetIter iter = TP_INTSET_INIT (intset);
while (tp_intset_iter_next (&iter))
{
  printf ("%u is in the intset\n", iter.element);
}

Since 0.11.6, consider using TpIntsetFastIter if iteration in numerical order is not required.

Parameters

iter

An iterator originally initialized with TP_INTSET_INIT(set)

 

Returns

TRUE if (iter->element ) has been advanced


tp_intset_iter_reset ()

void
tp_intset_iter_reset (TpIntsetIter *iter);

tp_intset_iter_reset is deprecated and should not be used in newly-written code.

since 0.19.0. Use TpIntsetFastIter instead

Reset the iterator iter to the beginning. It must already be associated with a set.

Parameters

iter

An integer set iterator to be reset.

 

Types and Values

TpIntset

typedef struct _TpIntset TpIntset;

Opaque type representing a set of unsigned integers.

Before 0.11.16, this type was called TpIntSet, which is now a backwards compatibility typedef.


TP_TYPE_INTSET

#define TP_TYPE_INTSET (tp_intset_get_type ())

The boxed type of a TpIntset.

Since: 0.11.3


TpIntsetFastIter

typedef struct {
} TpIntsetFastIter;

An opaque structure representing iteration in undefined order over a set of integers. Must be initialized with tp_intset_fast_iter_init().

Before 0.11.16, this type was called TpIntSetFastIter, which is now a backwards compatibility typedef.

Usage is similar to GHashTableIter:

1
2
3
4
5
6
7
8
9
TpIntsetFastIter iter;
guint element;

tp_intset_fast_iter_init (&iter, intset);

while (tp_intset_fast_iter_next (&iter, &element))
{
  printf ("%u is in the intset\n", element);
}

Since: 0.11.6


TpIntsetIter

typedef struct {
    const TpIntset *set;
    guint element;
} TpIntsetIter;

TpIntsetIter is deprecated and should not be used in newly-written code.

since 0.19.0. Use TpIntsetFastIter instead

A structure representing iteration over a set of integers. Must be initialized with either TP_INTSET_ITER_INIT() or tp_intset_iter_init().

Since 0.11.6, consider using TpIntsetFastIter if iteration in numerical order is not required.

Before 0.11.16, this type was called TpIntSetIter, which is now a backwards compatibility typedef.

Members

const TpIntset *set;

The set iterated over.

 

guint element;

Must be (guint)(-1) before iteration starts. Set to the next element in the set by tp_intset_iter_next(); undefined after tp_intset_iter_next() returns FALSE.

 

See Also

TpHandleSet

telepathy-glib-0.24.2/docs/reference/html/TpSignalledMessage.html0000644000175000017500000002022514006623343021667 00000000000000 TpSignalledMessage: telepathy-glib API Reference Manual

TpSignalledMessage

TpSignalledMessage — a message received using the Telepathy message interface

Properties

TpContact * sender Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpMessage
        ╰── TpSignalledMessage

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpSignalledMessage is used within Telepathy clients to represent a message signalled by a connection manager. This can either be a message received from someone else, confirmation that a message has been sent by the local user, or a delivery report indicating that delivery of a message has succeeded or failed.

Functions

tp_signalled_message_get_sender ()

TpContact *
tp_signalled_message_get_sender (TpMessage *message);

Returns a TpContact representing the sender of message if known, NULL otherwise.

Parameters

message

a TpSignalledMessage

 

Returns

the sender of the message.

[transfer none]

Since: 0.13.9

Types and Values

TpSignalledMessage

typedef struct _TpSignalledMessage TpSignalledMessage;

Opaque structure representing a received message using the Telepathy messages interface

Since: 0.13.9

Property Details

The “sender” property

  “sender”                   TpContact *

A TpContact representing the sender of the message, if known, or NULL otherwise.

Owner: TpSignalledMessage

Flags: Read / Write / Construct Only

Since: 0.13.9

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-room-info.html0000644000175000017500000005606214006623344023002 00000000000000 TpRoomInfo: telepathy-glib API Reference Manual

TpRoomInfo

TpRoomInfo — a room found by TpRoomList

Types and Values

struct TpRoomInfo
struct TpRoomInfoClass

Object Hierarchy

    GObject
    ╰── TpRoomInfo

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpRoomInfo represents a room found during a room listing using TpRoomList.

See also: TpRoomList

Functions

tp_room_info_get_channel_type ()

const gchar *
tp_room_info_get_channel_type (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

a string representing the D-Bus interface name of the channel type of the room

Since: 0.19.0


tp_room_info_get_description ()

const gchar *
tp_room_info_get_description (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

a description of the room's overall purpose

Since: 0.19.0


tp_room_info_get_handle ()

TpHandle
tp_room_info_get_handle (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the TpHandle of the room

Since: 0.19.0


tp_room_info_get_handle_name ()

const gchar *
tp_room_info_get_handle_name (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the identifier of the room (as would be returned by inspecting the TpHandle returned by tp_room_info_get_handle())

Since: 0.19.0


tp_room_info_get_invite_only ()

gboolean
tp_room_info_get_invite_only (TpRoomInfo *self,
                              gboolean *known);

Parameters

self

a TpRoomInfo

 

known

either NULL, or a location in which to store TRUE if the returned value is meaningful

 

Returns

TRUE if you cannot join the room, but must be invited

Since: 0.19.0


tp_room_info_get_members_count ()

guint
tp_room_info_get_members_count (TpRoomInfo *self,
                                gboolean *known);

Parameters

self

a TpRoomInfo

 

known

either NULL, or a location in which to store TRUE if the returned value is meaningful

 

Returns

the number of members in the room

Since: 0.19.0


tp_room_info_get_name ()

const gchar *
tp_room_info_get_name (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the human-readable name of the room if different from the handle

Since: 0.19.0


tp_room_info_get_requires_password ()

gboolean
tp_room_info_get_requires_password (TpRoomInfo *self,
                                    gboolean *known);

Parameters

self

a TpRoomInfo

 

known

either NULL, or a location in which to store TRUE if the returned value is meaningful

 

Returns

TRUE if the room requires a password to enter

Since: 0.19.0


tp_room_info_get_room_id ()

const gchar *
tp_room_info_get_room_id (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the human-readable identifier of the room

Since: 0.19.0


tp_room_info_get_server ()

const gchar *
tp_room_info_get_server (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the DNS name of the server hosting the room

Since: 0.19.0


tp_room_info_get_subject ()

const gchar *
tp_room_info_get_subject (TpRoomInfo *self);

Parameters

self

a TpRoomInfo

 

Returns

the current subject of conversation in the room

Since: 0.19.0

Types and Values

struct TpRoomInfo

struct TpRoomInfo;

Data structure representing a TpRoomInfo.

Since: 0.19.0


struct TpRoomInfoClass

struct TpRoomInfoClass {
};

The class of a TpRoomInfo.

Since: 0.19.0

telepathy-glib-0.24.2/docs/reference/html/up-insensitive.png0000644000175000017500000000056614006623343020764 00000000000000PNG  IHDRabKGD pHYs B(xtIMEwIIDAT8?/Qϙ?[u$VHTDۈBM+! TpGroupMixin: telepathy-glib API Reference Manual

TpGroupMixin

TpGroupMixin — a mixin implementation of the groups interface

Functions

#define TP_HAS_GROUP_MIXIN()
#define TP_HAS_GROUP_MIXIN_CLASS()
gboolean (*TpGroupMixinAddMemberFunc) ()
gboolean (*TpGroupMixinRemMemberFunc) ()
gboolean (*TpGroupMixinRemMemberWithReasonFunc) ()
void tp_group_mixin_class_init ()
void tp_group_mixin_class_allow_self_removal ()
void tp_group_mixin_class_set_remove_with_reason_func ()
void tp_group_mixin_init ()
void tp_group_mixin_finalize ()
gboolean tp_group_mixin_get_self_handle ()
gboolean tp_group_mixin_get_group_flags ()
gboolean tp_group_mixin_add_members ()
gboolean tp_group_mixin_remove_members ()
gboolean tp_group_mixin_remove_members_with_reason ()
gboolean tp_group_mixin_get_members ()
gboolean tp_group_mixin_get_local_pending_members ()
gboolean tp_group_mixin_get_local_pending_members_with_info ()
gboolean tp_group_mixin_get_remote_pending_members ()
gboolean tp_group_mixin_get_all_members ()
gboolean tp_group_mixin_get_handle_owners ()
void tp_group_mixin_change_flags ()
gboolean tp_group_mixin_change_members ()
gboolean tp_group_mixin_change_members_detailed ()
void tp_group_mixin_add_handle_owner ()
void tp_group_mixin_iface_init ()
void tp_group_mixin_add_handle_owners ()
void tp_group_mixin_get_dbus_property ()
void tp_group_mixin_init_dbus_properties ()
void tp_group_mixin_change_self_handle ()
void tp_external_group_mixin_iface_init ()
void tp_external_group_mixin_init ()
void tp_external_group_mixin_finalize ()
void tp_external_group_mixin_init_dbus_properties ()
void tp_external_group_mixin_get_dbus_property ()

Types and Values

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This mixin can be added to a channel GObject class to implement the groups interface in a general way.

To use the group mixin, include a TpGroupMixinClass somewhere in your class structure and a TpGroupMixin somewhere in your instance structure, and call tp_group_mixin_class_init() from your class_init function, tp_group_mixin_init() from your init function or constructor, and tp_group_mixin_finalize() from your dispose or finalize function.

To use the group mixin as the implementation of TpSvcChannelInterfaceGroup, call G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_group_mixin_iface_init) in the fourth argument to G_DEFINE_TYPE_WITH_CODE.

Since 0.5.13 you can also implement the group interface by forwarding all group operations to the group mixin of an associated object (mainly useful for Tubes channels). To do this, call tp_external_group_mixin_init() in the constructor after the associated object has been set, tp_external_group_mixin_finalize() in the dispose or finalize function, and G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_external_group_mixin_iface_init) in the fourth argument to G_DEFINE_TYPE_WITH_CODE.

Since 0.7.10 you can also implement the properties of Group channels, by calling tp_group_mixin_init_dbus_properties() or tp_external_group_mixin_init_dbus_properties() (as appropriate).

Functions

TP_HAS_GROUP_MIXIN()

#define TP_HAS_GROUP_MIXIN(o) (TP_GROUP_MIXIN_OFFSET (o) != 0)

Parameters

o

a GObject instance

 

Returns

TRUE if o (or one of its parent classes) has the group mixin.

Since: 0.13.9


TP_HAS_GROUP_MIXIN_CLASS()

#define TP_HAS_GROUP_MIXIN_CLASS(cls) (TP_GROUP_MIXIN_CLASS_OFFSET (cls) != 0)

Parameters

cls

a GObjectClass structure

 

Returns

TRUE if cls (or one of its parent classes) has the group mixin.

Since: 0.13.9


TpGroupMixinAddMemberFunc ()

gboolean
(*TpGroupMixinAddMemberFunc) (GObject *obj,
                              TpHandle handle,
                              const gchar *message,
                              GError **error);

Signature of the callback used to add a member to the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be added.

Parameters

obj

An object implementing the group interface with this mixin

 

handle

The handle of the contact to be added

 

message

A message to be sent if the protocol supports it

 

error

Used to return a Telepathy D-Bus error if FALSE is returned

 

Returns

TRUE on success, FALSE with error set on error


TpGroupMixinRemMemberFunc ()

gboolean
(*TpGroupMixinRemMemberFunc) (GObject *obj,
                              TpHandle handle,
                              const gchar *message,
                              GError **error);

Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed.

Parameters

obj

An object implementing the group interface with this mixin

 

handle

The handle of the contact to be removed

 

message

A message to be sent if the protocol supports it

 

error

Used to return a Telepathy D-Bus error if FALSE is returned

 

Returns

TRUE on success, FALSE with error set on error


TpGroupMixinRemMemberWithReasonFunc ()

gboolean
(*TpGroupMixinRemMemberWithReasonFunc)
                               (GObject *obj,
                                TpHandle handle,
                                const gchar *message,
                                guint reason,
                                GError **error);

Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed.

Set this with tp_group_mixin_class_set_remove_with_reason_func(), .

Parameters

obj

An object implementing the group interface with this mixin

 

handle

The handle of the contact to be removed

 

message

A message to be sent if the protocol supports it

 

reason

A TpChannelGroupChangeReason indicating the reason

 

error

Used to return a Telepathy D-Bus error if FALSE is returned

 

Returns

TRUE on success, FALSE with error set on error


tp_group_mixin_class_init ()

void
tp_group_mixin_class_init (GObjectClass *obj_cls,
                           glong offset,
                           TpGroupMixinAddMemberFunc add_func,
                           TpGroupMixinRemMemberFunc rem_func);

Configure the mixin for use with the given class.

[skip]

Parameters

obj_cls

The class of an object implementing the group interface using this mixin

 

offset

The offset of the TpGroupMixinClass structure within the class structure

 

add_func

A callback to be used to add contacts to this group

 

rem_func

A callback to be used to remove contacts from this group. This must be NULL if you will subsequently call tp_group_mixin_class_set_remove_with_reason_func().

 

tp_group_mixin_class_allow_self_removal ()

void
tp_group_mixin_class_allow_self_removal
                               (GObjectClass *obj_cls);

Configure the mixin to allow attempts to remove the SelfHandle from this Group, even if the group flags would otherwise disallow this. The channel's TpGroupMixinRemMemberFunc or TpGroupMixinRemMemberWithReasonFunc will be called as usual for such attempts, and may make them fail with TP_ERROR_PERMISSION_DENIED if required.

This function should be called from the GObject class_init callback, after calling tp_group_mixin_class_init().

(Recent telepathy-spec changes make it valid to try to remove the self-handle at all times, regardless of group flags. However, if this was implemented automatically in TpGroupMixin, this would risk crashing connection manager implementations that assume that TpGroupMixin will enforce the group flags strictly. As a result, connection managers should call this function to indicate to the TpGroupMixin that it may call their removal callback with the self-handle regardless of flag settings.)

[skip]

Parameters

obj_cls

The class of an object implementing the group interface using this mixin

 

Since: 0.7.27


tp_group_mixin_class_set_remove_with_reason_func ()

void
tp_group_mixin_class_set_remove_with_reason_func
                               (GObjectClass *cls,
                                TpGroupMixinRemMemberWithReasonFunc func);

Set a callback to be used to implement RemoveMembers() and RemoveMembersWithReason(). If this function is called during class initialization, the given callback will be used instead of the remove callback passed to tp_group_mixin_class_init() (which must be NULL in this case).

[skip]

Parameters

cls

The class of an object implementing the group interface using this mixin

 

func

A callback to be used to remove contacts from this group with a specified reason.

 

Since: 0.5.13


tp_group_mixin_init ()

void
tp_group_mixin_init (GObject *obj,
                     glong offset,
                     TpHandleRepoIface *handle_repo,
                     TpHandle self_handle);

Initialize the mixin.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

offset

The offset of the TpGroupMixin structure within the instance structure

 

handle_repo

The connection's handle repository for contacts

 

self_handle

The handle of the local user in this group, if any

 

tp_group_mixin_finalize ()

void
tp_group_mixin_finalize (GObject *obj);

Unreference handles and free resources used by this mixin.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

tp_group_mixin_get_self_handle ()

gboolean
tp_group_mixin_get_self_handle (GObject *obj,
                                guint *ret,
                                GError **error);

Set the guint pointed to by ret to the local user's handle in this group, or to 0 if the local user is not present in this group.

[skip]

Parameters

obj

An object implementing the group mixin using this interface

 

ret

Used to return the local user's handle in this group

 

error

Unused

 

Returns

TRUE.


tp_group_mixin_get_group_flags ()

gboolean
tp_group_mixin_get_group_flags (GObject *obj,
                                guint *ret,
                                GError **error);

Set the guint pointed to by ret to this group's flags, to be interpreted according to TpChannelGroupFlags.

[skip]

Parameters

obj

An object implementing the group mixin using this interface

 

ret

Used to return the flags

 

error

Unused

 

Returns

TRUE


tp_group_mixin_add_members ()

gboolean
tp_group_mixin_add_members (GObject *obj,
                            const GArray *contacts,
                            const gchar *message,
                            GError **error);

Request that the given contacts be added to the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. Otherwise attempt to add the contacts by calling the callbacks provided by the channel implementation.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

contacts

A GArray of guint representing contacts

 

message

A message associated with the addition request, if supported

 

error

Used to return an error if FALSE is returned

 

Returns

TRUE on success


tp_group_mixin_remove_members ()

gboolean
tp_group_mixin_remove_members (GObject *obj,
                               const GArray *contacts,
                               const gchar *message,
                               GError **error);

Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

contacts

A GArray of guint representing contacts

 

message

A message to be sent to those contacts, if supported

 

error

Used to return an error if FALSE is returned

 

Returns

TRUE on success


tp_group_mixin_remove_members_with_reason ()

gboolean
tp_group_mixin_remove_members_with_reason
                               (GObject *obj,
                                const GArray *contacts,
                                const gchar *message,
                                guint reason,
                                GError **error);

Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

contacts

A GArray of guint representing contacts

 

message

A message to be sent to those contacts, if supported

 

reason

A TpChannelGroupChangeReason

 

error

Used to return an error if FALSE is returned

 

Returns

TRUE on success


tp_group_mixin_get_members ()

gboolean
tp_group_mixin_get_members (GObject *obj,
                            GArray **ret,
                            GError **error);

Get the group's current members

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

ret

Used to return a newly-allocated GArray of guint contact handles

 

error

Unused

 

Returns

TRUE


tp_group_mixin_get_local_pending_members ()

gboolean
tp_group_mixin_get_local_pending_members
                               (GObject *obj,
                                GArray **ret,
                                GError **error);

Get the group's local-pending members.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

ret

Used to return a newly-allocated GArray of guint contact handles

 

error

Unused

 

Returns

TRUE


tp_group_mixin_get_local_pending_members_with_info ()

gboolean
tp_group_mixin_get_local_pending_members_with_info
                               (GObject *obj,
                                GPtrArray **ret,
                                GError **error);

Get the group's local-pending members and information about their requests to join the channel.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

ret

Used to return a newly-allocated GPtrArray of D-Bus structures each containing the handle of a local-pending contact, the handle of a contact responsible for adding them to the group (or 0), the reason code and a related message (e.g. their request to join the group)

 

error

Unused

 

Returns

TRUE


tp_group_mixin_get_remote_pending_members ()

gboolean
tp_group_mixin_get_remote_pending_members
                               (GObject *obj,
                                GArray **ret,
                                GError **error);

Get the group's remote-pending members.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

ret

Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members

 

error

Unused

 

Returns

TRUE


tp_group_mixin_get_all_members ()

gboolean
tp_group_mixin_get_all_members (GObject *obj,
                                GArray **members,
                                GArray **local_pending,
                                GArray **remote_pending,
                                GError **error);

Get the group's current and pending members.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

members

Used to return a newly-allocated GArray of guint representing the handles of the group's members

 

local_pending

Used to return a newly-allocated GArray of guint representing the handles of the group's local pending members

 

remote_pending

Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members

 

error

Unused

 

Returns

TRUE


tp_group_mixin_get_handle_owners ()

gboolean
tp_group_mixin_get_handle_owners (GObject *obj,
                                  const GArray *handles,
                                  GArray **ret,
                                  GError **error);

If the mixin has the flag TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, return the global owners of the given local handles, or 0 where unavailable.

[skip]

Parameters

obj

An object implementing the group interface with this mixin

 

handles

An array of guint representing locally valid handles

 

ret

Used to return an array of guint representing globally valid handles, or 0 where unavailable, if TRUE is returned

 

error

Used to return an error if FALSE is returned

 

Returns

TRUE (setting ret ) on success, FALSE (setting error ) on failure


tp_group_mixin_change_flags ()

void
tp_group_mixin_change_flags (GObject *obj,
                             TpChannelGroupFlags add,
                             TpChannelGroupFlags del);

Request a change to be made to the flags. If any flags were actually set or cleared, emits the GroupFlagsChanged signal with the changes.

It is an error to set any of the same bits in both add and del .

Changed in 0.7.7: the signal is not emitted if adding add and removing del had no effect on the existing group flags.

[skip]

Parameters

obj

An object implementing the groups interface using this mixin

 

add

Flags to be added

 

del

Flags to be removed

 

tp_group_mixin_change_members ()

gboolean
tp_group_mixin_change_members (GObject *obj,
                               const gchar *message,
                               const TpIntset *add,
                               const TpIntset *del,
                               const TpIntset *add_local_pending,
                               const TpIntset *add_remote_pending,
                               TpHandle actor,
                               TpChannelGroupChangeReason reason);

Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op.

This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly.

If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that.

Each of the TpIntset arguments may be NULL, which is treated as equivalent to an empty set.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

message

A message to be sent to the affected contacts if possible; NULL is allowed, and is mapped to an empty string

 

add

A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present)

 

del

A set of contact handles to be removed from members, local pending or remote pending, wherever they are present

 

add_local_pending

A set of contact handles to be added to local pending, and removed from members and remote pending

 

add_remote_pending

A set of contact handles to be added to remote pending, and removed from members and local pending

 

actor

The handle of the contact responsible for this change

 

reason

The reason for this change

 

Returns

TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; FALSE if nothing actually changed and the signals were suppressed.


tp_group_mixin_change_members_detailed ()

gboolean
tp_group_mixin_change_members_detailed
                               (GObject *obj,
                                const TpIntset *add,
                                const TpIntset *del,
                                const TpIntset *add_local_pending,
                                const TpIntset *add_remote_pending,
                                const GHashTable *details);

Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op.

This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly.

If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that.

Each of the TpIntset arguments may be NULL, which is treated as equivalent to an empty set.

details may contain, among other entries, the well-known keys (and corresponding type, wrapped in a GValue) defined by the Group.MembersChangedDetailed signal's specification; these include "actor" (a handle as G_TYPE_UINT), "change-reason" (an element of TpChannelGroupChangeReason as G_TYPE_UINT), "message" (G_TYPE_STRING), "error" (G_TYPE_STRING), "debug-message" (G_TYPE_STRING).

If all of the information in details could be passed to tp_group_mixin_change_members() then calling this function instead provides no benefit. Calling this function without setting TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED with tp_group_mixin_change_members() first is not very useful, as clients will not know to listen for MembersChangedDetailed and thus will miss the details.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

add

A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present)

 

del

A set of contact handles to be removed from members, local pending or remote pending, wherever they are present

 

add_local_pending

A set of contact handles to be added to local pending, and removed from members and remote pending

 

add_remote_pending

A set of contact handles to be added to remote pending, and removed from members and local pending

 

details

a map from strings to GValues detailing the change

 

Returns

TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; FALSE if nothing actually changed and the signals were suppressed.

Since: 0.7.21


tp_group_mixin_add_handle_owner ()

void
tp_group_mixin_add_handle_owner (GObject *obj,
                                 TpHandle local_handle,
                                 TpHandle owner_handle);

Note that the given local handle is an alias within this group for the given globally-valid handle. It will be returned from subsequent GetHandleOwner queries where appropriate.

Changed in 0.7.10: The owner_handle may be 0. To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owners().

[skip]

Parameters

obj

A GObject implementing the group interface with this mixin

 

local_handle

A contact handle valid within this group (may not be 0)

 

owner_handle

A contact handle valid globally, or 0 if the owner of the local_handle is unknown

 

tp_group_mixin_iface_init ()

void
tp_group_mixin_iface_init (gpointer g_iface,
                           gpointer iface_data);

Fill in the vtable entries needed to implement the group interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE.

[skip]

Parameters

g_iface

A TpSvcChannelInterfaceGroupClass

 

iface_data

Unused

 

tp_group_mixin_add_handle_owners ()

void
tp_group_mixin_add_handle_owners (GObject *obj,
                                  GHashTable *local_to_owner_handle);

Note that the given local handles are aliases within this group for the given globally-valid handles.

To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owner().

[skip]

Parameters

obj

A GObject implementing the group interface with this mixin

 

local_to_owner_handle

A map from contact handles valid within this group (which may not be 0) to either contact handles valid globally, or 0 if the owner of the corresponding key is unknown; all handles are stored using GUINT_TO_POINTER

 

Since: 0.7.10


tp_group_mixin_get_dbus_property ()

void
tp_group_mixin_get_dbus_property (GObject *object,
                                  GQuark interface,
                                  GQuark name,
                                  GValue *value,
                                  gpointer unused);

An implementation of TpDBusPropertiesMixinGetter which assumes that the object has the group mixin. It can only be used for the Group interface.

[skip]

Parameters

object

An object with this mixin

 

interface

Must be TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP

 

name

A quark representing the D-Bus property name, either "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", "RemotePendingMembers" or "SelfHandle"

 

value

A GValue pre-initialized to the right type, into which to put the value

 

unused

Ignored

 

Since: 0.7.10


tp_group_mixin_init_dbus_properties ()

void
tp_group_mixin_init_dbus_properties (GObjectClass *cls);

Set up TpDBusPropertiesMixinClass to use this mixin's implementation of the Group interface's properties.

This uses tp_group_mixin_get_dbus_property() as the property getter and sets up a list of the supported properties for it. Having called this, you should add TP_CHANNEL_GROUP_FLAG_PROPERTIES to any channels of this class with tp_group_mixin_change_flags() to indicate that the DBus properties are available.

[skip]

Parameters

cls

The class of an object with this mixin

 

Since: 0.7.10


tp_group_mixin_change_self_handle ()

void
tp_group_mixin_change_self_handle (GObject *obj,
                                   TpHandle new_self_handle);

Change the self-handle for this group to the given value.

[skip]

Parameters

obj

An object implementing the group interface using this mixin

 

new_self_handle

The new self-handle for this group

 

tp_external_group_mixin_iface_init ()

void
tp_external_group_mixin_iface_init (gpointer g_iface,
                                    gpointer iface_data);

Fill in the vtable entries needed to implement the group interface using the group mixin of another object. This function should usually be called via G_IMPLEMENT_INTERFACE.

[skip]

Parameters

g_iface

A TpSvcChannelInterfaceGroupClass

 

iface_data

Unused

 

Since: 0.5.13


tp_external_group_mixin_init ()

void
tp_external_group_mixin_init (GObject *obj,
                              GObject *obj_with_mixin);

Fill in the qdata needed to implement the group interface using the group mixin of another object. This function should usually be called in the instance constructor.

[skip]

Parameters

obj

An object implementing the groups interface using an external group mixin

 

obj_with_mixin

A GObject with the group mixin

 

Since: 0.5.13


tp_external_group_mixin_finalize ()

void
tp_external_group_mixin_finalize (GObject *obj);

Remove the external group mixin. This function should usually be called in the dispose or finalize function.

[skip]

Parameters

obj

An object implementing the groups interface using an external group mixin

 

Since: 0.5.13


tp_external_group_mixin_init_dbus_properties ()

void
tp_external_group_mixin_init_dbus_properties
                               (GObjectClass *cls);

Set up TpDBusPropertiesMixinClass to use this mixin's implementation of the Group interface's properties.

This uses tp_group_mixin_get_dbus_property() as the property getter and sets up a list of the supported properties for it. Having called this, you should add TP_CHANNEL_GROUP_FLAG_PROPERTIES to channels containing the mixin used by this class with tp_group_mixin_change_flags() to indicate that the DBus properties are available.

[skip]

Parameters

cls

The class of an object with this mixin

 

Since: 0.7.10


tp_external_group_mixin_get_dbus_property ()

void
tp_external_group_mixin_get_dbus_property
                               (GObject *object,
                                GQuark interface,
                                GQuark name,
                                GValue *value,
                                gpointer unused);

An implementation of TpDBusPropertiesMixinGetter which assumes that the object has the external group mixin. It can only be used for the Group interface.

[skip]

Parameters

object

An object with this mixin

 

interface

Must be TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP

 

name

A quark representing the D-Bus property name, either "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", "RemotePendingMembers" or "SelfHandle"

 

value

A GValue pre-initialized to the right type, into which to put the value

 

unused

Ignored

 

Since: 0.7.10

Types and Values

struct TpGroupMixin

struct TpGroupMixin {
  TpHandleRepoIface *handle_repo;
  TpHandle self_handle;

  TpChannelGroupFlags group_flags;

  TpHandleSet *members;
  TpHandleSet *local_pending;
  TpHandleSet *remote_pending;

  TpGroupMixinPrivate *priv;
};

Structure representing the group mixin as used in a particular class. To be placed in the implementation's instance structure.

All fields should be considered read-only.

Members

TpHandleRepoIface *handle_repo;

The connection's contact handle repository

 

TpHandle self_handle;

The local user's handle within this group, or 0 if none. Set using tp_group_mixin_init() and tp_group_mixin_change_self_handle().

 

TpChannelGroupFlags group_flags;

This group's flags. Set using tp_group_mixin_change_flags(); defaults to 0.

 

TpHandleSet *members;

The members of the group. Alter using tp_group_mixin_change_members().

 

TpHandleSet *local_pending;

Members awaiting the local user's approval to join the group. Alter using tp_group_mixin_change_members().

 

TpHandleSet *remote_pending;

Members awaiting remote (e.g. remote user or server) approval to join the group. Alter using tp_group_mixin_change_members().

 

TpGroupMixinPrivate *priv;

Pointer to opaque private data

 

struct TpGroupMixinClass

struct TpGroupMixinClass {
  TpGroupMixinAddMemberFunc add_member;
  TpGroupMixinRemMemberFunc remove_member;
  TpGroupMixinClassPrivate *priv;
};

Structure representing the group mixin as used in a particular class. To be placed in the implementation's class structure.

Initialize this with tp_group_mixin_class_init().

All fields should be considered read-only.

Members

TpGroupMixinAddMemberFunc add_member;

The add-member function that was passed to tp_group_mixin_class_init()

 

TpGroupMixinRemMemberFunc remove_member;

The remove-member function that was passed to tp_group_mixin_class_init()

 

TpGroupMixinClassPrivate *priv;

Pointer to opaque private data

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-service-point.html0000644000175000017500000003733514006623344024457 00000000000000 Service-side Connection and Channel ServicePoint interfaces: telepathy-glib API Reference Manual

Service-side Connection and Channel ServicePoint interfaces

Service-side Connection and Channel ServicePoint interfaces — GInterfaces to implement the ServicePoint interfaces

Signals

void service-points-changed Has Details
void service-point-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceServicePoint
    ╰── TpSvcConnectionInterfaceServicePoint

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In some protocols, mainly those that interact with the PSTN, it's possible to contact the emergency services or other public service answering points. The ServicePoint interfaces on the Connection and Channel can be used to discover how to contact these service points, and detect whether a call in progress is communicating with a service point.

This section documents the auto-generated GInterfaces used to implement the ServicePoint interfaces.

Functions

tp_svc_connection_interface_service_point_emit_service_points_changed ()

void
tp_svc_connection_interface_service_point_emit_service_points_changed
                               (gpointer instance,
                                const GPtrArray *arg_Service_Points);

Type-safe wrapper around g_signal_emit to emit the ServicePointsChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.ServicePoint.

Parameters

instance

The object implementing this interface

 

arg_Service_Points

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_service_point_emit_service_point_changed ()

void
tp_svc_channel_interface_service_point_emit_service_point_changed
                               (gpointer instance,
                                const GValueArray *arg_Service_Point);

Type-safe wrapper around g_signal_emit to emit the ServicePointChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.ServicePoint.

Parameters

instance

The object implementing this interface

 

arg_Service_Point

const GValueArray * (FIXME, generate documentation)

 

Types and Values

TpSvcConnectionInterfaceServicePoint

typedef struct _TpSvcConnectionInterfaceServicePoint TpSvcConnectionInterfaceServicePoint;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceServicePointClass

typedef struct _TpSvcConnectionInterfaceServicePointClass TpSvcConnectionInterfaceServicePointClass;

The class of TpSvcConnectionInterfaceServicePoint. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelInterfaceServicePoint

typedef struct _TpSvcChannelInterfaceServicePoint TpSvcChannelInterfaceServicePoint;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceServicePointClass

typedef struct _TpSvcChannelInterfaceServicePointClass TpSvcChannelInterfaceServicePointClass;

The class of TpSvcChannelInterfaceServicePoint. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

Signal Details

The “service-points-changed” signal

void
user_function (TpSvcConnectionInterfaceServicePoint *self,
               gpointer                              user_data)

The ServicePointsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Service_Points

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “service-point-changed” signal

void
user_function (TpSvcChannelInterfaceServicePoint *self,
               gpointer                           user_data)

The ServicePointChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Service_Point

const GValueArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-securable.html0000644000175000017500000001224014006623344025227 00000000000000 Service-side Securable interface: telepathy-glib API Reference Manual

Service-side Securable interface

Service-side Securable interface — GInterface to indicate channels' security level

Object Hierarchy

    GInterface
    ╰── TpSvcChannelInterfaceSecurable

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The Securable channel interface represents a channel that might be end-to-end encrypted and/or protected from man-in-the-middle attacks.

Functions

Types and Values

TpSvcChannelInterfaceSecurable

typedef struct _TpSvcChannelInterfaceSecurable TpSvcChannelInterfaceSecurable;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceSecurableClass

typedef struct _TpSvcChannelInterfaceSecurableClass TpSvcChannelInterfaceSecurableClass;

The class of TpSvcChannelInterfaceSecurable. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-account-channel-request.html0000644000175000017500000051347214006623343025627 00000000000000 TpAccountChannelRequest: telepathy-glib API Reference Manual

TpAccountChannelRequest

TpAccountChannelRequest — Object used to request a channel from a TpAccount

Functions

TpAccountChannelRequest * tp_account_channel_request_new ()
TpAccountChannelRequest * tp_account_channel_request_new_vardict ()
GHashTable * tp_account_channel_request_get_request ()
GVariant * tp_account_channel_request_dup_request ()
gint64 tp_account_channel_request_get_user_action_time ()
TpAccount * tp_account_channel_request_get_account ()
void tp_account_channel_request_set_target_contact ()
void tp_account_channel_request_set_target_id ()
void tp_account_channel_request_set_request_property ()
TpAccountChannelRequest * tp_account_channel_request_new_text ()
void tp_account_channel_request_set_sms_channel ()
void tp_account_channel_request_set_conference_initial_channels ()
void tp_account_channel_request_set_initial_invitee_ids ()
void tp_account_channel_request_set_initial_invitees ()
TpAccountChannelRequest * tp_account_channel_request_new_audio_call ()
TpAccountChannelRequest * tp_account_channel_request_new_audio_video_call ()
TpAccountChannelRequest * tp_account_channel_request_new_file_transfer ()
void tp_account_channel_request_set_file_transfer_description ()
void tp_account_channel_request_set_file_transfer_initial_offset ()
void tp_account_channel_request_set_file_transfer_timestamp ()
void tp_account_channel_request_set_file_transfer_uri ()
void tp_account_channel_request_set_file_transfer_hash ()
TpAccountChannelRequest * tp_account_channel_request_new_stream_tube ()
TpAccountChannelRequest * tp_account_channel_request_new_dbus_tube ()
void tp_account_channel_request_create_and_handle_channel_async ()
TpChannel * tp_account_channel_request_create_and_handle_channel_finish ()
void tp_account_channel_request_ensure_and_handle_channel_async ()
TpChannel * tp_account_channel_request_ensure_and_handle_channel_finish ()
void tp_account_channel_request_create_channel_async ()
gboolean tp_account_channel_request_create_channel_finish ()
void tp_account_channel_request_ensure_channel_async ()
gboolean tp_account_channel_request_ensure_channel_finish ()
void tp_account_channel_request_create_and_observe_channel_async ()
TpChannel * tp_account_channel_request_create_and_observe_channel_finish ()
void tp_account_channel_request_ensure_and_observe_channel_async ()
TpChannel * tp_account_channel_request_ensure_and_observe_channel_finish ()
void tp_account_channel_request_set_channel_factory ()
TpChannelRequest * tp_account_channel_request_get_channel_request ()
void tp_account_channel_request_set_hint ()
void tp_account_channel_request_set_hints ()
void tp_account_channel_request_set_delegate_to_preferred_handler ()
void (*TpAccountChannelRequestDelegatedChannelCb) ()
void tp_account_channel_request_set_delegated_channel_callback ()

Properties

TpAccount * account Read / Write / Construct Only
TpChannelRequest * channel-request Read
GHashTable_gchararray+GValue_* request Read / Write / Construct Only
GVariant * request-vardict Read / Write / Construct Only
gint64 user-action-time Read / Write / Construct Only

Signals

void re-handled Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpAccountChannelRequest

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A TpAccountChannelRequest object is used to request a channel using the ChannelDispatcher. Once created, use one of the create or ensure async method to actually request the channel.

Note that each TpAccountChannelRequest object can only be used to create one channel. You can't call a create or ensure method more than once on the same TpAccountChannelRequest.

Once the channel has been created you can use the TpAccountChannelRequest::re-handled: signal to be notified when the channel has to be re-handled. This can be useful for example to move its window to the foreground, if applicable.

Using this object is appropriate for most channel types. For a contact search channel, use tp_contact_search_new_async() instead.

Functions

tp_account_channel_request_new ()

TpAccountChannelRequest *
tp_account_channel_request_new (TpAccount *account,
                                GHashTable *request,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object.

Parameters

account

a TpAccount

 

request

the requested properties of the channel (see “request”).

[transfer none][element-type utf8 GObject.Value]

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.11.12


tp_account_channel_request_new_vardict ()

TpAccountChannelRequest *
tp_account_channel_request_new_vardict
                               (TpAccount *account,
                                GVariant *request,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object.

If request is a floating reference, this function will take ownership of it, much like g_variant_ref_sink(). See documentation of that function for details.

Parameters

account

a TpAccount

 

request

the requested properties of the channel (see “request”) as a G_VARIANT_TYPE_VARDICT

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.19.10


tp_account_channel_request_get_request ()

GHashTable *
tp_account_channel_request_get_request
                               (TpAccountChannelRequest *self);

Return the “request” construct-only property

Parameters

Returns

the value of “request”.

[transfer none]

Since: 0.11.12


tp_account_channel_request_dup_request ()

GVariant *
tp_account_channel_request_dup_request
                               (TpAccountChannelRequest *self);

Return the “request-vardict” construct-only property.

Parameters

Returns

the value of “request-vardict”.

[transfer full]

Since: 0.19.10


tp_account_channel_request_get_user_action_time ()

gint64
tp_account_channel_request_get_user_action_time
                               (TpAccountChannelRequest *self);

Return the “user-action-time” construct-only property

Parameters

Returns

the value of “user-action-time”

Since: 0.11.12


tp_account_channel_request_get_account ()

TpAccount *
tp_account_channel_request_get_account
                               (TpAccountChannelRequest *self);

Return the “account” construct-only property

Parameters

Returns

the value of “account”.

[transfer none]

Since: 0.11.12


tp_account_channel_request_set_target_contact ()

void
tp_account_channel_request_set_target_contact
                               (TpAccountChannelRequest *self,
                                TpContact *contact);

Configure this request to create a peer-to-peer channel with contact as the other peer.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

contact

the contact to be contacted

 

Since: 0.19.0


tp_account_channel_request_set_target_id ()

void
tp_account_channel_request_set_target_id
                               (TpAccountChannelRequest *self,
                                TpHandleType handle_type,
                                const gchar *identifier);

Configure this request to create a channel with identifier , an identifier of type handle_type .

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

handle_type

the type of identifier , typically TP_HANDLE_TYPE_CONTACT or TP_HANDLE_TYPE_ROOM

 

identifier

the unique identifier of the contact, room etc. to be contacted

 

Since: 0.19.0


tp_account_channel_request_set_request_property ()

void
tp_account_channel_request_set_request_property
                               (TpAccountChannelRequest *self,
                                const gchar *name,
                                GVariant *value);

Configure this channel request to include the given property, as documented in the Telepathy D-Bus API Specification or an implementation-specific extension.

Using this method is not recommended, but it can be necessary for experimental or implementation-specific interfaces.

If the property is not supported by the protocol or channel type, the channel request will fail. Use TpCapabilities and the Telepathy D-Bus API Specification to determine which properties are available.

If value is a floating reference, this method takes ownership of it by using g_variant_ref_sink(). This allows convenient inline use of GVariant constructors:

1
2
3
4
tp_account_channel_request_set_request_property (acr, "com.example.Int",
    g_variant_new_int32 (17));
tp_account_channel_request_set_request_property (acr, "com.example.String",
    g_variant_new_string ("ferret"));

It is an error to provide a value which contains types not supported by D-Bus.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

name

a D-Bus property name

 

value

an arbitrary value for the property

 

Since: 0.19.0


tp_account_channel_request_new_text ()

TpAccountChannelRequest *
tp_account_channel_request_new_text (TpAccount *account,
                                     gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object which will yield a Text channel.

After creating the request, you will also need to set the "target" of the channel by calling one of the following functions:

  • tp_account_channel_request_set_target_contact()

  • tp_account_channel_request_set_target_id()

Parameters

account

a TpAccount

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.19.0


tp_account_channel_request_set_sms_channel ()

void
tp_account_channel_request_set_sms_channel
                               (TpAccountChannelRequest *self,
                                gboolean is_sms_channel);

If is_sms_channel is set to TRUE, messages sent and received on the requested channel will be transmitted via SMS.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

is_sms_channel

TRUE if the channel should use SMS

 

Since: 0.23.2


tp_account_channel_request_set_conference_initial_channels ()

void
tp_account_channel_request_set_conference_initial_channels
                               (TpAccountChannelRequest *self,
                                const gchar * const *channels);

Indicate that the channel which is going to be requested using self is an upgrade of the channels whose object paths is listed in channels .

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

channels

a NULL-terminated array of channel paths

 

Since: 0.23.2


tp_account_channel_request_set_initial_invitee_ids ()

void
tp_account_channel_request_set_initial_invitee_ids
                               (TpAccountChannelRequest *self,
                                const gchar * const *ids);

Indicate that the contacts listed in ids have to be invited to the conference represented by the channel which is going to be requested using self .

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

ids

a NULL-terminated array of contact ids

 

Since: 0.23.2


tp_account_channel_request_set_initial_invitees ()

void
tp_account_channel_request_set_initial_invitees
                               (TpAccountChannelRequest *self,
                                GPtrArray *contacts);

Indicate that the contacts listed in contacts have to be invited to the conference represented by the channel which is going to be requested using self .

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

contacts

a GPtrArray of TpContact.

[element-type TelepathyGLib.Contact]

Since: 0.23.2


tp_account_channel_request_new_audio_call ()

TpAccountChannelRequest *
tp_account_channel_request_new_audio_call
                               (TpAccount *account,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object which will yield a Call channel, initially carrying audio only.

After creating the request, you will usually also need to set the "target" of the channel by calling one of the following functions:

  • tp_account_channel_request_set_target_contact()

  • tp_account_channel_request_set_target_id()

To call a contact, either use tp_account_channel_request_set_target_contact() or one of the generic methods that takes a handle type argument. To check whether this is possible, use tp_capabilities_supports_audio_call() with handle_type set to TP_HANDLE_TYPE_CONTACT.

In some protocols, it is possible to create a Call channel without setting a target at all, which will result in a new, empty conference call. To test whether this is possible, use tp_capabilities_supports_audio_call() with handle_type set to TP_HANDLE_TYPE_NONE.

Parameters

account

a TpAccount

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.19.0


tp_account_channel_request_new_audio_video_call ()

TpAccountChannelRequest *
tp_account_channel_request_new_audio_video_call
                               (TpAccount *account,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object which will yield a Call channel, initially carrying both audio and video.

This is the same as tp_account_channel_request_new_audio_call(), except that the channel will initially carry video as well as audio, and instead of using tp_capabilities_supports_audio_call() you should test capabilities with tp_capabilities_supports_audio_video_call().

See the documentation of tp_account_channel_request_new_audio_call() for details of how to set the target (contact, chatroom etc.) for the call.

Parameters

account

a TpAccount

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.19.0


tp_account_channel_request_new_file_transfer ()

TpAccountChannelRequest *
tp_account_channel_request_new_file_transfer
                               (TpAccount *account,
                                const gchar *filename,
                                const gchar *mime_type,
                                guint64 size,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object, which will yield a FileTransfer channel to send a file to a contact.

After creating the request, you will also need to set the "target" of the channel by calling one of the following functions:

  • tp_account_channel_request_set_target_contact()

  • tp_account_channel_request_set_target_id()

Parameters

account

a TpAccount

 

filename

a suggested name for the file, which should not contain directories or directory separators (for example, if you are sending a file called /home/user/monkey.pdf, set this to monkey.pdf)

 

mime_type

the MIME type (content-type) of the file; a NULL value is allowed, and is treated as "application/octet-stream".

[allow-none]

size

the file's size in bytes

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.19.0


tp_account_channel_request_set_file_transfer_description ()

void
tp_account_channel_request_set_file_transfer_description
                               (TpAccountChannelRequest *self,
                                const gchar *description);

Configure this channel request to provide the recipient of the file with the given description.

If file descriptions are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_description() to determine whether outgoing file transfers can have a description.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

description

a description of the file

 

Since: 0.19.0


tp_account_channel_request_set_file_transfer_initial_offset ()

void
tp_account_channel_request_set_file_transfer_initial_offset
                               (TpAccountChannelRequest *self,
                                guint64 offset);

Configure this channel request to inform the recipient of the file that this channel will not send the first offset bytes of the file. In some protocols, this can be used to resume an interrupted transfer.

If this method is not called, the default is to start from the beginning of the file (equivalent to offset = 0).

If offsets greater than 0 are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_initial_offset() to determine whether offsets greater than 0 are available.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

offset

the offset into the file at which the transfer will start

 

Since: 0.19.0


tp_account_channel_request_set_file_transfer_timestamp ()

void
tp_account_channel_request_set_file_transfer_timestamp
                               (TpAccountChannelRequest *self,
                                guint64 timestamp);

Configure this channel request to accompany the file transfer with the given modification timestamp for the file.

If file timestamps are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_date() to determine whether outgoing file transfers can have a timestamp.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

timestamp

the modification timestamp of the file, in seconds since the Unix epoch (the beginning of 1970 in the UTC time zone), as returned by g_date_time_to_unix()

 

Since: 0.19.0


tp_account_channel_request_set_file_transfer_uri ()

void
tp_account_channel_request_set_file_transfer_uri
                               (TpAccountChannelRequest *self,
                                const gchar *uri);

Configure this channel request to provide other local Telepathy components with the URI of the file being sent. Unlike most properties on a file transfer channel, this information is not sent to the recipient of the file; instead, it is signalled on D-Bus for use by other Telepathy components.

The URI should usually be a file URI as defined by

RFC 1738 §3.10 (for instance, file:///path/to/file or file://localhost/path/to/file). If a remote resource

is being transferred to a contact, it may have a different scheme, such as http.

Even if this method is used, the connection manager will not read the file from disk: the handler for the channel is still responsible for streaming the file. However, providing the URI allows a local logger to log which file was transferred, for instance.

If this functionality is not supported by the connection manager, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_uri() to determine whether outgoing file transfers can have a URI.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

uri

the source URI for the file

 

Since: 0.19.0


tp_account_channel_request_set_file_transfer_hash ()

void
tp_account_channel_request_set_file_transfer_hash
                               (TpAccountChannelRequest *self,
                                TpFileHashType hash_type,
                                const gchar *hash);

Configure this channel request to accompany the file transfer with the hash of the file.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

hash_type

a type of hash

 

hash

hash of the contents of the file transfer

 

Since: 0.23.2


tp_account_channel_request_new_stream_tube ()

TpAccountChannelRequest *
tp_account_channel_request_new_stream_tube
                               (TpAccount *account,
                                const gchar *service,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object, which will yield a StreamTube channel.

After creating the request, you will also need to set the "target" of the channel by calling one of the following functions:

  • tp_account_channel_request_set_target_contact()

  • tp_account_channel_request_set_target_id()

Parameters

account

a TpAccount

 

service

the service name that will be used over the tube. It should be a well-known TCP service name as defined by http://www.iana.org/assignments/port-numbers or http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap".

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.23.2


tp_account_channel_request_new_dbus_tube ()

TpAccountChannelRequest *
tp_account_channel_request_new_dbus_tube
                               (TpAccount *account,
                                const gchar *service_name,
                                gint64 user_action_time);

Convenience function to create a new TpAccountChannelRequest object, which will yield a DBusTube channel.

After creating the request, you will also need to set the "target" of the channel by calling one of the following functions:

  • tp_account_channel_request_set_target_contact()

  • tp_account_channel_request_set_target_id()

Parameters

account

a TpAccount

 

service_name

the service name that will be used over the tube. It should be

 

user_action_time

the time of the user action that caused this request, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time”)

 

Returns

a new TpAccountChannelRequest object

Since: 0.23.2


tp_account_channel_request_create_and_handle_channel_async ()

void
tp_account_channel_request_create_and_handle_channel_async
                               (TpAccountChannelRequest *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in “request” that you are going to handle yourself. When the operation is finished, callback will be called. You can then call tp_account_channel_request_create_and_handle_channel_finish() to get the result of the operation.

(Behind the scenes, this works by creating a temporary TpBaseClient, then acting like tp_account_channel_request_create_channel_async() with the temporary TpBaseClient as the preferred_handler .)

The caller is responsible for closing the channel with tp_cli_channel_call_close() when it has finished handling it.

Parameters

self

a TpAccountChannelRequest

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.12


tp_account_channel_request_create_and_handle_channel_finish ()

TpChannel *
tp_account_channel_request_create_and_handle_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                TpHandleChannelsContext **context,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_create_and_handle_channel_async().

See tp_account_channel_request_ensure_and_handle_channel_finish() for details of how context can be used.

The caller is responsible for closing the channel with tp_cli_channel_call_close() when it has finished handling it.

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

context

pointer used to return a reference to the context of the HandleChannels() call, or NULL.

[out][allow-none][transfer full]

error

a GError to fill

 

Returns

a new reference on a TpChannel if the channel was successfully created and you are handling it, otherwise NULL.

[transfer full][allow-none]

Since: 0.11.12


tp_account_channel_request_ensure_and_handle_channel_async ()

void
tp_account_channel_request_ensure_and_handle_channel_async
                               (TpAccountChannelRequest *self,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in “request” that you are going to handle yourself. When the operation is finished, callback will be called. You can then call tp_account_channel_request_ensure_and_handle_channel_finish() to get the result of the operation.

If the channel already exists and is already being handled, or if a newly created channel is sent to a different handler, this operation will fail with the error TP_ERROR_NOT_YOURS. The other handler will be notified that the channel was requested again (for instance with “re-handled”, TpBaseClientClassHandleChannelsImpl or “callback”), and can move its window to the foreground, if applicable.

(Behind the scenes, this works by creating a temporary TpBaseClient, then acting like tp_account_channel_request_ensure_channel_async() with the temporary TpBaseClient as the preferred_handler .)

Parameters

self

a TpAccountChannelRequest

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.12


tp_account_channel_request_ensure_and_handle_channel_finish ()

TpChannel *
tp_account_channel_request_ensure_and_handle_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                TpHandleChannelsContext **context,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_ensure_and_handle_channel_async().

If the channel already exists and is already being handled, or if a newly created channel is sent to a different handler, this operation will fail with the error TP_ERROR_NOT_YOURS.

context can be used to obtain extensible information about the channel via tp_handle_channels_context_get_handler_info(), and any similar methods that are added in future. It is not valid for the caller of this method to call tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail().

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

context

pointer used to return a reference to the context of the HandleChannels() call, or NULL.

[out][allow-none][transfer full]

error

a GError to fill

 

Returns

a new reference on a TpChannel if the channel was successfully created and you are handling it, otherwise NULL.

[transfer full][allow-none]

Since: 0.11.12


tp_account_channel_request_create_channel_async ()

void
tp_account_channel_request_create_channel_async
                               (TpAccountChannelRequest *self,
                                const gchar *preferred_handler,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in “request” and let the ChannelDispatcher dispatch it to an handler. callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation.

Parameters

self

a TpAccountChannelRequest

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or NULL to indicate that any handler would be acceptable.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.12


tp_account_channel_request_create_channel_finish ()

gboolean
tp_account_channel_request_create_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_create_channel_async().

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the channel was successfully created and dispatched, otherwise FALSE.

Since: 0.11.12


tp_account_channel_request_ensure_channel_async ()

void
tp_account_channel_request_ensure_channel_async
                               (TpAccountChannelRequest *self,
                                const gchar *preferred_handler,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in “request” and let the ChannelDispatcher dispatch it to an handler.

If a suitable channel already existed, its handler will be notified that the channel was requested again (for instance with “re-handled”, TpBaseClientClassHandleChannelsImpl or “callback”, if it is implemented using Telepathy-GLib), so that it can re-present the window to the user, for example. Otherwise, a new channel will be created and dispatched to a handler.

callback will be called when an existing channel's handler has been notified, a new channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_ensure_channel_finish() to get the result of the operation.

Parameters

self

a TpAccountChannelRequest

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or NULL to indicate that any handler would be acceptable.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.11.12


tp_account_channel_request_ensure_channel_finish ()

gboolean
tp_account_channel_request_ensure_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_ensure_channel_async().

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the channel was successfully ensured and (re-)dispatched, otherwise FALSE.

Since: 0.11.12


tp_account_channel_request_create_and_observe_channel_async ()

void
tp_account_channel_request_create_and_observe_channel_async
                               (TpAccountChannelRequest *self,
                                const gchar *preferred_handler,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in “request” and let the ChannelDispatcher dispatch it to an handler. callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation and a TpChannel representing the channel which has been created. Note that you are not handling this channel and so should interact with the channel as an Observer. See the Telepathy book for details about how clients should interact with channels.

Parameters

self

a TpAccountChannelRequest

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or NULL to indicate that any handler would be acceptable.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.14


tp_account_channel_request_create_and_observe_channel_finish ()

TpChannel *
tp_account_channel_request_create_and_observe_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_create_and_observe_channel_async().

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a newly created TpChannel if the channel was successfully created and dispatched, otherwise NULL.

[transfer full]

Since: 0.13.14


tp_account_channel_request_ensure_and_observe_channel_async ()

void
tp_account_channel_request_ensure_and_observe_channel_async
                               (TpAccountChannelRequest *self,
                                const gchar *preferred_handler,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in “request” and let the ChannelDispatcher dispatch it to an handler. callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation and a TpChannel representing the channel which has been created. Note that you are not handling this channel and so should interact with the channel as an Observer. See the Telepathy book for details about how clients should interact with channels.

If a suitable channel already existed, its handler will be notified that the channel was requested again (for instance with “re-handled”, TpBaseClientClassHandleChannelsImpl or “callback”, if it is implemented using Telepathy-GLib), so that it can re-present the window to the user, for example. Otherwise, a new channel will be created and dispatched to a handler.

Parameters

self

a TpAccountChannelRequest

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or NULL to indicate that any handler would be acceptable.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.13.14


tp_account_channel_request_ensure_and_observe_channel_finish ()

TpChannel *
tp_account_channel_request_ensure_and_observe_channel_finish
                               (TpAccountChannelRequest *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel creation started using tp_account_channel_request_create_and_observe_channel_async().

Parameters

self

a TpAccountChannelRequest

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a newly created TpChannel if the channel was successfully ensure and (re-)dispatched, otherwise NULL.

[transfer full]

Since: 0.13.14


tp_account_channel_request_set_channel_factory ()

void
tp_account_channel_request_set_channel_factory
                               (TpAccountChannelRequest *self,
                                TpClientChannelFactory *factory);

tp_account_channel_request_set_channel_factory is deprecated and should not be used in newly-written code.

since 0.15.5. The factory is taken from “account”.

Set factory as the TpClientChannelFactory that will be used to create the channel requested by self . By default TpAutomaticProxyFactory is used.

This function can't be called once self has been used to request a channel.

Parameters

Since: 0.13.2


tp_account_channel_request_get_channel_request ()

TpChannelRequest *
tp_account_channel_request_get_channel_request
                               (TpAccountChannelRequest *self);

Return the “channel-request” property

Parameters

Returns

the value of “channel-request”.

[transfer none]

Since: 0.13.13


tp_account_channel_request_set_hint ()

void
tp_account_channel_request_set_hint (TpAccountChannelRequest *self,
                                     const gchar *key,
                                     GVariant *value);

Set additional information about the channel request, which will be used in the resulting request's “hints” property.

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

key

the key used for the hint

 

value

a variant containting the hint value.

[transfer none]

Since: 0.19.8


tp_account_channel_request_set_hints ()

void
tp_account_channel_request_set_hints (TpAccountChannelRequest *self,
                                      GHashTable *hints);

Set additional information about the channel request, which will be used as the value for the resulting request's “hints” property.

This function can't be called once self has been used to request a channel.

In high-level language bindings, use tp_account_channel_request_set_hint() instead.

Since: 0.13.14


tp_account_channel_request_set_delegate_to_preferred_handler ()

void
tp_account_channel_request_set_delegate_to_preferred_handler
                               (TpAccountChannelRequest *self,
                                gboolean delegate);

If delegate is TRUE, asks to the client currently handling the channels to delegate them to the preferred handler (passed when calling tp_account_channel_request_ensure_channel_async() for example).

This function can't be called once self has been used to request a channel.

Parameters

self

a TpAccountChannelRequest

 

delegate

TRUE to request to delegate channels

 

Since: 0.15.3


TpAccountChannelRequestDelegatedChannelCb ()

void
(*TpAccountChannelRequestDelegatedChannelCb)
                               (TpAccountChannelRequest *request,
                                TpChannel *channel,
                                gpointer user_data);

Called when a client asked us to delegate channel to another Handler. When this function is called you are no longer handling channel .

Parameters

request

a TpAccountChannelRequest instance

 

channel

a TpChannel

 

user_data

arbitrary user-supplied data passed to tp_account_channel_request_set_delegated_channel_callback()

 

Since: 0.15.3


tp_account_channel_request_set_delegated_channel_callback ()

void
tp_account_channel_request_set_delegated_channel_callback
                               (TpAccountChannelRequest *self,
                                TpAccountChannelRequestDelegatedChannelCb callback,
                                gpointer user_data,
                                GDestroyNotify destroy);

Turn on support for the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler hint.

When receiving a request containing this hint, self will automatically delegate the channel to the preferred handler of the request and then call callback to inform the client that it is no longer handling this channel.

callback may be called any time after (and only after) requesting and handling the channel (i.e. you have called create_and_handle or ensure_and_handle).

This function can't be called once self has been used to request a channel.

See also: tp_base_client_set_delegated_channels_callback()

Parameters

self

a TpAccountChannelRequest

 

callback

function called the channel requested using self is delegated, may not be NULL

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when self is destroyed

 

Since: 0.15.3

Types and Values

TpAccountChannelRequest

typedef struct _TpAccountChannelRequest TpAccountChannelRequest;

Data structure representing a TpAccountChannelRequest object.

Since: 0.11.12

Property Details

The “account” property

  “account”                  TpAccount *

The TpAccount used to request the channel. Read-only except during construction.

This property can't be NULL.

Owner: TpAccountChannelRequest

Flags: Read / Write / Construct Only

Since: 0.11.12


The “channel-request” property

  “channel-request”          TpChannelRequest *

The TpChannelRequest used to request the channel, or NULL if the channel has not be requested yet.

This can be useful for example to compare with the TpChannelRequest objects received from the requests_satisfied argument of TpSimpleHandlerHandleChannelsImpl to check if the client is asked to handle the channel it just requested.

Note that the TpChannelRequest objects may be different while still representing the same ChannelRequest on D-Bus. You have to compare them using their object paths (tp_proxy_get_object_path()).

Since 0.13.13

Owner: TpAccountChannelRequest

Flags: Read


The “request” property

  “request”                  GHashTable_gchararray+GValue_*

The desired D-Bus properties for the channel, represented as a GHashTable where the keys are strings and the values are GValue.

When constructing a new object, one of “request” or “request-vardict” must be set to a non-NULL value, and the other must remain unspecified.

Owner: TpAccountChannelRequest

Flags: Read / Write / Construct Only

Since: 0.11.12


The “request-vardict” property

  “request-vardict”          GVariant *

The desired D-Bus properties for the channel.

When constructing a new object, one of “request” or “request-vardict” must be set to a non-NULL value, and the other must remain unspecified.

Owner: TpAccountChannelRequest

Flags: Read / Write / Construct Only

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.10


The “user-action-time” property

  “user-action-time”         gint64

The user action time that will be passed to the channel dispatcher when requesting the channel.

This may be the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME.

If TP_USER_ACTION_TIME_NOT_USER_ACTION, the action doesn't involve any user action. Clients should avoid stealing focus when presenting the channel.

If TP_USER_ACTION_TIME_CURRENT_TIME, clients SHOULD behave as though the user action happened at the current time, e.g. a client may request that its window gains focus.

On X11-based systems, GDK 2, GDK 3, Clutter 1.0 etc., tp_user_action_time_from_x11() can be used to convert an X11 timestamp to a Telepathy user action time.

If the channel request succeeds, this user action time will be passed on to the channel's handler. If the handler is a GUI, it may use tp_user_action_time_should_present() to decide whether to bring its window to the foreground.

Owner: TpAccountChannelRequest

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.11.12

Signal Details

The “re-handled” signal

void
user_function (TpAccountChannelRequest *self,
               TpChannel               *channel,
               gint64                   user_action_time,
               TpHandleChannelsContext *context,
               gpointer                 user_data)

Emitted when the channel created using self has been "re-handled".

This means that a Telepathy client has made another request for a matching channel using an "ensure" API like tp_account_channel_request_ensure_channel_async(), while the channel still exists. Instead of creating a new channel, the channel dispatcher notifies the existing handler of channel , resulting in this signal.

Most GUI handlers should respond to this signal by checking user_action_time , and if appropriate, moving to the foreground.

context can be used to obtain extensible information about the channel via tp_handle_channels_context_get_handler_info(), and any similar methods that are added in future. It is not valid for the receiver of this signal to call tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail().

Parameters

self

a TpAccountChannelRequest

 

channel

the TpChannel being re-handled

 

user_action_time

the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME; see “user-action-time”

 

context

a TpHandleChannelsContext representing the context of the HandleChannels() call.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.12

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-requests.html0000644000175000017500000016621314006623344025105 00000000000000 Connection Requests interface: telepathy-glib API Reference Manual

Connection Requests interface

Connection Requests interface — client-side wrappers for the Requests interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface allows a client to request new channels from a connection, and to listen to signals indicating that channels have been created and closed.

This section documents the auto-generated C wrappers for the Requests interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_requests_call_create_channel ()

TpProxyPendingCall *
tp_cli_connection_interface_requests_call_create_channel
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Request,
                                tp_cli_connection_interface_requests_callback_for_create_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CreateChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that an entirely new channel is created.</p> <tp:rationale> <p>There is deliberately no flag corresponding to the suppress_handler argument to <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.RequestChannel</tp:dbus-ref>, because passing a FALSE value for that argument is deprecated. Requests made using this interface always behave as though suppress_handler was TRUE.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Request

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, which MUST include <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">ChannelType</tp:dbus-ref>. Some properties are defined such that only an exact match makes sense, and connection managers MUST NOT satisfy a request with a channel where that property does not match; some properties are defined such that the connection manager MAY treat the request as merely a hint, and make a best-effort attempt to satisfy it. This is documented separately for each property.</p> <p>If this dictionary contains a property whose semantics are not known to the connection manager, this method MUST fail without side-effects (in particular it must not create a new channel).</p> <tp:rationale> <p>This is necessary if we want to be able to invent properties in future that, when used in a request, are hard requirements rather than just hints. A connection manager that did not know the semantics of those properties could incorrectly return a new channel that did not satisfy the requirements.</p> </tp:rationale> <p>The connection manager MUST NOT respond successfully, and SHOULD NOT create a new channel or cause any other side-effects, unless it can create a new channel that satisfies the client's requirements.</p> <p>Properties that will be set by this argument need not have write access after the channel has been created - indeed, it is expected that most will be read-only.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_requests_call_ensure_channel ()

TpProxyPendingCall *
tp_cli_connection_interface_requests_call_ensure_channel
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Request,
                                tp_cli_connection_interface_requests_callback_for_ensure_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a EnsureChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that channels are ensured to exist.</p> <tp:rationale> <p>The connection manager is in the best position to determine which existing channels could satisfy which requests.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Request

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, with the same semantics as the corresponding parameter to <tp:member-ref>CreateChannel</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_requests_callback_for_create_channel ()

void
(*tp_cli_connection_interface_requests_callback_for_create_channel)
                               (TpConnection *proxy,
                                const gchar *out_Channel,
                                GHashTable *out_Properties,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CreateChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Channel

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The Channel object, which MUST NOT be signalled with <tp:member-ref>NewChannels</tp:member-ref> until after this method returns.</p> <tp:rationale> <p>This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.</p> </tp:rationale>

 

out_Properties

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel that was produced, equivalent to the properties in <tp:type>Channel_Details</tp:type>. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in <tp:type>Channel_Details</tp:type>.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_requests_callback_for_ensure_channel ()

void
(*tp_cli_connection_interface_requests_callback_for_ensure_channel)
                               (TpConnection *proxy,
                                gboolean out_Yours,
                                const gchar *out_Channel,
                                GHashTable *out_Properties,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a EnsureChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Yours

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If false, the caller of EnsureChannel MUST assume that some other process is handling this channel; if true, the caller of EnsureChannel SHOULD handle it themselves or delegate it to another client.</p> <p>If the creation of a channel makes several calls to EnsureChannel (and no other requests) successful, exactly one of those calls MUST return a true value for this argument.</p> <p>If the creation of a channel makes other requests successful, the value returned for this argument MUST be such that exactly one of the clients making requests ends up responsible for the channel. In particular, if <tp:member-ref>CreateChannel</tp:member-ref> returns a channel <em>C</em>, any EnsureChannel calls that also return <em>C</em> MUST return a false value for this argument.</p>

 

out_Channel

Used to return an 'out' argument if error is NULL: The Channel object. If it was created as a result of this method call, it MUST NOT be signalled by <tp:member-ref>NewChannels</tp:member-ref> until after this method returns. <tp:rationale> <p>This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.</p> </tp:rationale>

 

out_Properties

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel that was produced, equivalent to the properties in <tp:type>Channel_Details</tp:type>. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in <tp:type>Channel_Details</tp:type>.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_requests_connect_to_channel_closed ()

TpProxySignalConnection *
tp_cli_connection_interface_requests_connect_to_channel_closed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_requests_signal_callback_channel_closed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ChannelClosed.

Emitted when a channel is closed and hence disappears from the <tp:member-ref>Channels</tp:member-ref> property. <tp:rationale> This is redundant with the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Closed</tp:dbus-ref> signal on the channel itself, but it does provide full change notification for the Channels property. </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_requests_connect_to_new_channels ()

TpProxySignalConnection *
tp_cli_connection_interface_requests_connect_to_new_channels
                               (TpConnection *proxy,
                                tp_cli_connection_interface_requests_signal_callback_new_channels callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewChannels.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>New channels have been created. The connection manager SHOULD emit a single signal for any group of closely related channels that are created at the same time, so that the channel dispatcher can try to dispatch them to a handler as a unit.</p> <p>In particular, if additional channels are created as a side-effect of a call to <tp:member-ref>CreateChannel</tp:member-ref>, these channels SHOULD appear in the same NewChannels signal as the channel that satisfies the request.</p> <tp:rationale> <p>Joining a MUC Tube in XMPP requires joining the corresponding MUC (chatroom), so a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">Text</tp:dbus-ref> channel can be created as a side-effect.</p> </tp:rationale> <p>Every time NewChannels is emitted, it MUST be followed by a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.NewChannel</tp:dbus-ref> signal for each channel.</p> <tp:rationale> <p>The double signal emission is for the benefit of older Telepathy clients, which won't be listening for NewChannels.</p> <p>The more informative NewChannels signal comes first so that clients that did not examine the connection to find out whether Requests is supported will see the more informative signal for each channel first, and then ignore the less informative signal because it announces a new channel of which they are already aware.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_requests_run_create_channel ()

gboolean
tp_cli_connection_interface_requests_run_create_channel
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Request,
                                gchar **out_Channel,
                                GHashTable **out_Properties,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_requests_run_create_channel is deprecated and should not be used in newly-written code.

Call the method CreateChannel and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that an entirely new channel is created.</p> <tp:rationale> <p>There is deliberately no flag corresponding to the suppress_handler argument to <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.RequestChannel</tp:dbus-ref>, because passing a FALSE value for that argument is deprecated. Requests made using this interface always behave as though suppress_handler was TRUE.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Request

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, which MUST include <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">ChannelType</tp:dbus-ref>. Some properties are defined such that only an exact match makes sense, and connection managers MUST NOT satisfy a request with a channel where that property does not match; some properties are defined such that the connection manager MAY treat the request as merely a hint, and make a best-effort attempt to satisfy it. This is documented separately for each property.</p> <p>If this dictionary contains a property whose semantics are not known to the connection manager, this method MUST fail without side-effects (in particular it must not create a new channel).</p> <tp:rationale> <p>This is necessary if we want to be able to invent properties in future that, when used in a request, are hard requirements rather than just hints. A connection manager that did not know the semantics of those properties could incorrectly return a new channel that did not satisfy the requirements.</p> </tp:rationale> <p>The connection manager MUST NOT respond successfully, and SHOULD NOT create a new channel or cause any other side-effects, unless it can create a new channel that satisfies the client's requirements.</p> <p>Properties that will be set by this argument need not have write access after the channel has been created - indeed, it is expected that most will be read-only.</p>

 

out_Channel

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The Channel object, which MUST NOT be signalled with <tp:member-ref>NewChannels</tp:member-ref> until after this method returns.</p> <tp:rationale> <p>This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.</p> </tp:rationale>

 

out_Properties

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel that was produced, equivalent to the properties in <tp:type>Channel_Details</tp:type>. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in <tp:type>Channel_Details</tp:type>.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_requests_run_ensure_channel ()

gboolean
tp_cli_connection_interface_requests_run_ensure_channel
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Request,
                                gboolean *out_Yours,
                                gchar **out_Channel,
                                GHashTable **out_Properties,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_requests_run_ensure_channel is deprecated and should not be used in newly-written code.

Call the method EnsureChannel and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that channels are ensured to exist.</p> <tp:rationale> <p>The connection manager is in the best position to determine which existing channels could satisfy which requests.</p> </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Request

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties, with the same semantics as the corresponding parameter to <tp:member-ref>CreateChannel</tp:member-ref>.</p>

 

out_Yours

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If false, the caller of EnsureChannel MUST assume that some other process is handling this channel; if true, the caller of EnsureChannel SHOULD handle it themselves or delegate it to another client.</p> <p>If the creation of a channel makes several calls to EnsureChannel (and no other requests) successful, exactly one of those calls MUST return a true value for this argument.</p> <p>If the creation of a channel makes other requests successful, the value returned for this argument MUST be such that exactly one of the clients making requests ends up responsible for the channel. In particular, if <tp:member-ref>CreateChannel</tp:member-ref> returns a channel <em>C</em>, any EnsureChannel calls that also return <em>C</em> MUST return a false value for this argument.</p>

 

out_Channel

Used to return an 'out' argument if TRUE is returned: The Channel object. If it was created as a result of this method call, it MUST NOT be signalled by <tp:member-ref>NewChannels</tp:member-ref> until after this method returns. <tp:rationale> <p>This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.</p> </tp:rationale>

 

out_Properties

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Properties of the channel that was produced, equivalent to the properties in <tp:type>Channel_Details</tp:type>. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in <tp:type>Channel_Details</tp:type>.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_requests_signal_callback_channel_closed ()

void
(*tp_cli_connection_interface_requests_signal_callback_channel_closed)
                               (TpConnection *proxy,
                                const gchar *arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ChannelClosed.

Parameters

proxy

The proxy on which tp_cli_connection_interface_requests_connect_to_channel_closed() was called

 

arg_Removed

The channel which has been removed from the Channels property

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_requests_signal_callback_new_channels ()

void
(*tp_cli_connection_interface_requests_signal_callback_new_channels)
                               (TpConnection *proxy,
                                const GPtrArray *arg_Channels,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewChannels.

Parameters

proxy

The proxy on which tp_cli_connection_interface_requests_connect_to_new_channels() was called

 

arg_Channels

The channels and their details. All channels that are signalled together like this MUST have the same <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.FUTURE">Bundle</tp:dbus-ref> property, which may either refer to an existing bundle, or establish a new bundle.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-debug.html0000644000175000017500000004221614006623344022750 00000000000000 Service-side Debug base interface: telepathy-glib API Reference Manual

Service-side Debug base interface

Service-side Debug base interface — GInterface for Telepathy Debug objects

Signals

void new-debug-message Has Details

Types and Values

Object Hierarchy

    GInterface
    ╰── TpSvcDebug

Known Implementations

TpSvcDebug is implemented by TpDebugSender.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface (auto-generated from the Telepathy spec) makes it easier to export objects implementing the Telepathy Debug interface.

TpDebugSender provides a reference implementation of the Debug object.

Functions

tp_svc_debug_get_messages_impl ()

void
(*tp_svc_debug_get_messages_impl) (TpSvcDebug *self,
                                   DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetMessages on interface org.freedesktop.Telepathy.Debug.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_debug_implement_get_messages ()

void
tp_svc_debug_implement_get_messages (TpSvcDebugClass *klass,
                                     tp_svc_debug_get_messages_impl impl);

Register an implementation for the GetMessages method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetMessages D-Bus method

 

tp_svc_debug_return_from_get_messages ()

void
tp_svc_debug_return_from_get_messages (DBusGMethodInvocation *context,
                                       const GPtrArray *out_Messages);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Messages

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_debug_emit_new_debug_message ()

void
tp_svc_debug_emit_new_debug_message (gpointer instance,
                                     gdouble arg_time,
                                     const gchar *arg_domain,
                                     guint arg_level,
                                     const gchar *arg_message);

Type-safe wrapper around g_signal_emit to emit the NewDebugMessage signal on interface org.freedesktop.Telepathy.Debug.

Parameters

instance

The object implementing this interface

 

arg_time

gdouble (FIXME, generate documentation)

 

arg_domain

const gchar * (FIXME, generate documentation)

 

arg_level

guint (FIXME, generate documentation)

 

arg_message

const gchar * (FIXME, generate documentation)

 

Types and Values

TpSvcDebug

typedef struct _TpSvcDebug TpSvcDebug;

Dummy typedef representing any implementation of this interface.


TpSvcDebugClass

typedef struct _TpSvcDebugClass TpSvcDebugClass;

The class of TpSvcDebug.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_debug (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_debug_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_messages);
#undef IMPLEMENT
}

Signal Details

The “new-debug-message” signal

void
user_function (TpSvcDebug *self,
               gdouble     arg_time,
               gchar      *arg_domain,
               guint       arg_level,
               gchar      *arg_message,
               gpointer    user_data)

The NewDebugMessage D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_time

gdouble (FIXME, generate documentation)

 

arg_domain

const gchar * (FIXME, generate documentation)

 

arg_level

guint (FIXME, generate documentation)

 

arg_message

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-variant-util.html0000644000175000017500000001524714006623344023514 00000000000000 GVariant utilities: telepathy-glib API Reference Manual

GVariant utilities

GVariant utilities — some GVariant utility functions

Functions

GVariantClass tp_variant_type_classify ()
GVariant * tp_variant_convert ()

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

GVariant utility functions used in telepathy-glib.

Functions

tp_variant_type_classify ()

GVariantClass
tp_variant_type_classify (const GVariantType *type);

Classifies type according to its top-level type.

Parameters

type

a GVariantType

 

Returns

the GVariantClass of type

Since: 0.19.10


tp_variant_convert ()

GVariant *
tp_variant_convert (GVariant *variant,
                    const GVariantType *type);

Convert the type of variant to type if possible. This takes ownership of variant . If no conversion is needed, simply return variant . If conversion is not possible, NULL is returned.

Parameters

variant

a GVariant to convert.

[transfer full]

type

a GVariantType variant must be converted to

 

Returns

a new GVariant owned by the caller.

[transfer full]

Since: 0.19.10

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-room.html0000644000175000017500000005743614006623344024256 00000000000000 Service-side room interfaces: telepathy-glib API Reference Manual

Service-side room interfaces

Service-side room interfaces — room-related functionality for channels

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceRoom
    ├── TpSvcChannelInterfaceRoomConfig
    ╰── TpSvcChannelInterfaceSubject

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This collection of interfaces is used to expose various aspects of the configuration of chat rooms.

TpSvcChannelInterfaceRoom consists of a pair of requestable, immutable properties: "RoomName" and

"Server"; and a pair of immutable properties: "Creator", "CreatorHandle", and "CreationTimestamp". It has no methods or signals. It

should be implemented on channels representing a chat room (whether it be a text chat, a multi-user call, or some other media type).

TpSvcChannelInterfaceSubject may be implemented by channels which have a subject (or topic, depending on your protocol's terminology of choice). This will usually be in addition to TpSvcChannelInterfaceRoom, though in theory a 1-1 channel could have a subject. In addition to its single method, it defines a set of read-only properties, namely "Subject",

"Actor", "ActorHandle", "Timestamp",

and "CanSet". Changes should be signalled using tp_dbus_properties_mixin_emit_properties_changed().

TpSvcChannelInterfaceRoomConfig provides a vast array of properties for other aspects of a chat room's configuration (such as the maximum number of participants, and whether the room is password-protected). Channels with this interface will typically implement the other two, too.

Functions

tp_svc_channel_interface_room_config_implement_update_configuration ()

void
tp_svc_channel_interface_room_config_implement_update_configuration
                               (TpSvcChannelInterfaceRoomConfigClass *klass,
                                tp_svc_channel_interface_room_config_update_configuration_impl impl);

Register an implementation for the UpdateConfiguration method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UpdateConfiguration D-Bus method

 

tp_svc_channel_interface_room_config_return_from_update_configuration ()

void
tp_svc_channel_interface_room_config_return_from_update_configuration
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_room_config_update_configuration_impl ()

void
(*tp_svc_channel_interface_room_config_update_configuration_impl)
                               (TpSvcChannelInterfaceRoomConfig *self,
                                GHashTable *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UpdateConfiguration on interface org.freedesktop.Telepathy.Channel.Interface.RoomConfig1.

Parameters

self

The object implementing this interface

 

in_Properties

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_subject_implement_set_subject ()

void
tp_svc_channel_interface_subject_implement_set_subject
                               (TpSvcChannelInterfaceSubjectClass *klass,
                                tp_svc_channel_interface_subject_set_subject_impl impl);

Register an implementation for the SetSubject method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetSubject D-Bus method

 

tp_svc_channel_interface_subject_return_from_set_subject ()

void
tp_svc_channel_interface_subject_return_from_set_subject
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_subject_set_subject_impl ()

void
(*tp_svc_channel_interface_subject_set_subject_impl)
                               (TpSvcChannelInterfaceSubject *self,
                                const gchar *in_Subject,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetSubject on interface org.freedesktop.Telepathy.Channel.Interface.Subject2.

Parameters

self

The object implementing this interface

 

in_Subject

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

Types and Values

TpSvcChannelInterfaceRoom

typedef struct _TpSvcChannelInterfaceRoom TpSvcChannelInterfaceRoom;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceRoomClass

typedef struct _TpSvcChannelInterfaceRoomClass TpSvcChannelInterfaceRoomClass;

The class of TpSvcChannelInterfaceRoom. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelInterfaceRoomConfig

typedef struct _TpSvcChannelInterfaceRoomConfig TpSvcChannelInterfaceRoomConfig;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceRoomConfigClass

typedef struct _TpSvcChannelInterfaceRoomConfigClass TpSvcChannelInterfaceRoomConfigClass;

The class of TpSvcChannelInterfaceRoomConfig.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_room_config (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_room_config_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (update_configuration);
#undef IMPLEMENT
}

TpSvcChannelInterfaceSubject

typedef struct _TpSvcChannelInterfaceSubject TpSvcChannelInterfaceSubject;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceSubjectClass

typedef struct _TpSvcChannelInterfaceSubjectClass TpSvcChannelInterfaceSubjectClass;

The class of TpSvcChannelInterfaceSubject.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_subject (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_subject_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (set_subject);
#undef IMPLEMENT
}
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-base-client.html0000644000175000017500000056576214006623343023276 00000000000000 TpBaseClient: telepathy-glib API Reference Manual

TpBaseClient

TpBaseClient — base class for Telepathy clients on D-Bus

Functions

void tp_base_client_add_observer_filter ()
void tp_base_client_add_observer_filter_vardict ()
void tp_base_client_take_observer_filter ()
void tp_base_client_set_observer_recover ()
void tp_base_client_set_observer_delay_approvers ()
void (*TpBaseClientClassObserveChannelsImpl) ()
void tp_base_client_implement_observe_channels ()
void tp_base_client_add_approver_filter ()
void tp_base_client_add_approver_filter_vardict ()
void tp_base_client_take_approver_filter ()
void (*TpBaseClientClassAddDispatchOperationImpl) ()
void tp_base_client_implement_add_dispatch_operation ()
void tp_base_client_add_handler_capabilities ()
void tp_base_client_add_handler_capabilities_varargs ()
void tp_base_client_add_handler_capability ()
void tp_base_client_add_handler_filter ()
void tp_base_client_add_handler_filter_vardict ()
void tp_base_client_take_handler_filter ()
void tp_base_client_be_a_handler ()
void (*TpBaseClientClassHandleChannelsImpl) ()
void tp_base_client_implement_handle_channels ()
void tp_base_client_add_account_features ()
void tp_base_client_add_account_features_varargs ()
void tp_base_client_add_connection_features ()
void tp_base_client_add_connection_features_varargs ()
void tp_base_client_add_channel_features ()
void tp_base_client_add_channel_features_varargs ()
GList * tp_base_client_get_handled_channels ()
GList * tp_base_client_dup_handled_channels ()
gboolean tp_base_client_is_handling_channel ()
void tp_base_client_delegate_channels_async ()
gboolean tp_base_client_delegate_channels_finish ()
void (*TpBaseClientDelegatedChannelsCb) ()
void tp_base_client_set_delegated_channels_callback ()
void tp_channel_dispatcher_present_channel_async ()
gboolean tp_channel_dispatcher_present_channel_finish ()
GList * tp_base_client_get_pending_requests ()
GList * tp_base_client_dup_pending_requests ()
void tp_base_client_set_handler_bypass_approval ()
void tp_base_client_set_handler_request_notification ()
gboolean tp_base_client_register ()
void tp_base_client_unregister ()
const gchar * tp_base_client_get_bus_name ()
const gchar * tp_base_client_get_object_path ()
TpDBusDaemon * tp_base_client_get_dbus_daemon ()
const gchar * tp_base_client_get_name ()
gboolean tp_base_client_get_uniquify_name ()
TpAccountManager * tp_base_client_get_account_manager ()
void tp_base_client_set_channel_factory ()
TpClientChannelFactory * tp_base_client_get_channel_factory ()

Properties

TpAccountManager * account-manager Read / Write / Construct Only
GObject * channel-factory Read / Write / Construct Only
TpDBusDaemon * dbus-daemon Read / Write / Construct Only
TpSimpleClientFactory * factory Read / Write / Construct Only
gchar * name Read / Write / Construct Only
gboolean uniquify-name Read / Write / Construct Only

Signals

void request-added Has Details
void request-removed Has Details

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseClient
        ├── TpSimpleApprover
        ├── TpSimpleHandler
        ╰── TpSimpleObserver

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcClient implementations. Subclasses should usually pass the filters they want and override the D-Bus methods they implement.

For many applications, the provided TpSimpleObserver, TpSimpleApprover and TpSimpleHandler subclasses can be used instead of deriving from this class.

Functions

tp_base_client_add_observer_filter ()

void
tp_base_client_add_observer_filter (TpBaseClient *self,
                                    GHashTable *filter);

Register a new channel class as Observer.ObserverChannelFilter. The TpBaseClientClass.observe_channels virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channels.

Parameters

self

a TpBaseClient

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS.

[transfer none][element-type utf8 GObject.Value]

Since: 0.11.5


tp_base_client_add_observer_filter_vardict ()

void
tp_base_client_add_observer_filter_vardict
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Observer.ObserverChannelFilter. The TpBaseClientClass.observe_channels virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channels.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken, allowing for uses like this:

1
2
3
4
5
tp_base_client_add_observer_filter_vardict (client,
   g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, ... }",
       TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT,
       TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT,
       ...));

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since: 0.19.10


tp_base_client_take_observer_filter ()

void
tp_base_client_take_observer_filter (TpBaseClient *self,
                                     GHashTable *filter);

The same as tp_base_client_add_observer_filter(), but ownership of filter is taken by self . This makes it convenient to call using tp_asv_new():

1
2
3
4
5
6
7
tp_base_client_take_observer_filter (client,
   tp_asv_new (
       TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
           TP_IFACE_CHANNEL_TYPE_TEXT,
       TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
           TP_HANDLE_TYPE_CONTACT,
       ...));

[skip]

Parameters

self

a client

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by self .

[transfer full][element-type utf8 GObject.Value]

Since: 0.11.5


tp_base_client_set_observer_recover ()

void
tp_base_client_set_observer_recover (TpBaseClient *self,
                                     gboolean recover);

Set whether the channel dispatcher should attempt to recover this Observer if it crashes. (This is implemented by setting the value of its Recover D-Bus property.)

Normally, Observers are only notified when new channels appear. If an Observer is set to recover, when it registers with tp_base_client_register(), it will also be told about any channels that already existed before it started.

For Observers that are activatable as a D-Bus service, if the Observer exits or crashes while there are any channels that match its filter, it will automatically be restarted by service-activation.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channels.

Parameters

self

a TpBaseClient

 

recover

the value of the Observer.Recover property

 

Since: 0.11.5


tp_base_client_set_observer_delay_approvers ()

void
tp_base_client_set_observer_delay_approvers
                               (TpBaseClient *self,
                                gboolean delay);

Set whether the channel dispatcher should wait for tp_observe_channels_context_accept() or tp_observe_channels_context_fail() to be called before calling TpBaseClientClass.add_dispatch_operation on appropriate Approvers.

This is implemented by setting the value of the DelayApprovers D-Bus property.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.observe_channels.

Parameters

self

a TpBaseClient

 

delay

the value of the Observer.DelayApprovers property

 

Since: 0.13.16


TpBaseClientClassObserveChannelsImpl ()

void
(*TpBaseClientClassObserveChannelsImpl)
                               (TpBaseClient *client,
                                TpAccount *account,
                                TpConnection *connection,
                                GList *channels,
                                TpChannelDispatchOperation *dispatch_operation,
                                GList *requests,
                                TpObserveChannelsContext *context);

Signature of the implementation of the ObserveChannels method.

This function must call either tp_observe_channels_context_accept(), tp_observe_channels_context_delay() or tp_observe_channels_context_fail() on context before it returns.

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible

 

channels

a GList of TpChannel, each with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible.

[element-type TelepathyGLib.Channel]

dispatch_operation

a TpChannelDispatchOperation or NULL; the dispatch_operation is not guaranteed to be prepared.

[allow-none]

requests

a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

context

a TpObserveChannelsContext representing the context of this D-Bus call

 

Since: 0.11.5


tp_base_client_implement_observe_channels ()

void
tp_base_client_implement_observe_channels
                               (TpBaseClientClass *klass,
                                TpBaseClientClassObserveChannelsImpl impl);

Called by subclasses to define the actual implementation of the ObserveChannels() D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.observe_channels function pointer.

[skip]

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassObserveChannelsImpl function implementing ObserveChannels()

 

Since: 0.11.5


tp_base_client_add_approver_filter ()

void
tp_base_client_add_approver_filter (TpBaseClient *self,
                                    GHashTable *filter);

Register a new channel class as Approver.ApproverChannelFilter. The TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.add_dispatch_operation.

Parameters

self

a TpBaseClient

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS.

[transfer none][element-type utf8 GObject.Value]

Since: 0.11.5


tp_base_client_add_approver_filter_vardict ()

void
tp_base_client_add_approver_filter_vardict
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Approver.ApproverChannelFilter. The TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.add_dispatch_operation.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_vardict() for more details.

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since: 0.19.10


tp_base_client_take_approver_filter ()

void
tp_base_client_take_approver_filter (TpBaseClient *self,
                                     GHashTable *filter);

The same as tp_base_client_add_approver_filter(), but ownership of filter is taken by self . This makes it convenient to call using tp_asv_new():

1
2
3
4
5
6
7
tp_base_client_take_approver_filter (client,
   tp_asv_new (
       TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
           TP_IFACE_CHANNEL_TYPE_TEXT,
       TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
           TP_HANDLE_TYPE_CONTACT,
       ...));

[skip]

Parameters

self

a client

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by self .

[transfer full][element-type utf8 GObject.Value]

Since: 0.11.5


TpBaseClientClassAddDispatchOperationImpl ()

void
(*TpBaseClientClassAddDispatchOperationImpl)
                               (TpBaseClient *client,
                                TpAccount *account,
                                TpConnection *connection,
                                GList *channels,
                                TpChannelDispatchOperation *dispatch_operation,
                                TpAddDispatchOperationContext *context);

Signature of the implementation of the AddDispatchOperation method.

This function must call either tp_add_dispatch_operation_context_accept(), tp_add_dispatch_operation_context_delay() or tp_add_dispatch_operation_context_fail() on context before it returns.

The implementation can then use tp_channel_dispatch_operation_handle_with_async() to approve handling of the channels, or tp_channel_dispatch_operation_claim_async() to take responsibility for handling or closing them".

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible

 

channels

a GList of TpChannel, each with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible.

[element-type TelepathyGLib.Channel]

dispatch_operation

a TpChannelDispatchOperation having TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible

 

context

a TpObserveChannelsContext representing the context of this D-Bus call

 

Since: 0.11.5


tp_base_client_implement_add_dispatch_operation ()

void
tp_base_client_implement_add_dispatch_operation
                               (TpBaseClientClass *klass,
                                TpBaseClientClassAddDispatchOperationImpl impl);

Called by subclasses to define the actual implementation of the AddDispatchOperation() D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.add_dispatch_operation function pointer.

[skip]

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassAddDispatchOperationImpl function implementing AddDispatchOperation()

 

Since: 0.11.5


tp_base_client_add_handler_capabilities ()

void
tp_base_client_add_handler_capabilities
                               (TpBaseClient *self,
                                const gchar * const *tokens);

Add several capability tokens to this client. These are used to signal that Telepathy connection managers should advertise certain capabilities to other contacts, such as the ability to receive audio/video calls using particular streaming protocols and codecs.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

tokens

capability tokens as defined by the Telepathy D-Bus API Specification.

[array zero-terminated=1][element-type utf8]

Since: 0.11.6


tp_base_client_add_handler_capabilities_varargs ()

void
tp_base_client_add_handler_capabilities_varargs
                               (TpBaseClient *self,
                                const gchar *first_token,
                                ...);

Convenience C API equivalent to calling tp_base_client_add_handler_capability() for each capability token.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

[skip]

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

first_token

a capability token from the Telepathy D-Bus API Specification

 

...

more tokens, ending with NULL

 

Since: 0.11.6


tp_base_client_add_handler_capability ()

void
tp_base_client_add_handler_capability (TpBaseClient *self,
                                       const gchar *token);

Add one capability token to this client, as if via tp_base_client_add_handler_capabilities().

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a client, which must not have been registered with tp_base_client_register() yet

 

token

a capability token as defined by the Telepathy D-Bus API Specification

 

Since: 0.11.6


tp_base_client_add_handler_filter ()

void
tp_base_client_add_handler_filter (TpBaseClient *self,
                                   GHashTable *filter);

Register a new channel class as Handler.HandlerChannelFilter. The TpBaseClientClass.handle_channels virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a TpBaseClient

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS.

[transfer none][element-type utf8 GObject.Value]

Since: 0.11.6


tp_base_client_add_handler_filter_vardict ()

void
tp_base_client_add_handler_filter_vardict
                               (TpBaseClient *self,
                                GVariant *filter);

Register a new channel class as Handler.HandlerChannelFilter. The TpBaseClientClass.handle_channels virtual method will be called whenever a new channel's properties match the ones in filter .

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_vardict() for more details.

Parameters

self

a client

 

filter

a variant of type G_VARIANT_TYPE_VARDICT.

[transfer none]

Since: 0.19.10


tp_base_client_take_handler_filter ()

void
tp_base_client_take_handler_filter (TpBaseClient *self,
                                    GHashTable *filter);

The same as tp_base_client_add_handler_filter(), but ownership of filter is taken by self . This makes it convenient to call using tp_asv_new():

1
2
3
4
5
6
7
tp_base_client_take_handler_filter (client,
   tp_asv_new (
       TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
           TP_IFACE_CHANNEL_TYPE_TEXT,
       TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
           TP_HANDLE_TYPE_CONTACT,
       ...));

[skip]

Parameters

self

a TpBaseClient

 

filter

a TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by self .

[transfer full][element-type utf8 GObject.Value]

Since: 0.11.6


tp_base_client_be_a_handler ()

void
tp_base_client_be_a_handler (TpBaseClient *self);

Register self as a Client.Handler with an empty list of filters. This is useful if you want to create a client that only handle channels for which it's the PreferredHandler.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a TpBaseClient

 

Since: 0.11.6


TpBaseClientClassHandleChannelsImpl ()

void
(*TpBaseClientClassHandleChannelsImpl)
                               (TpBaseClient *client,
                                TpAccount *account,
                                TpConnection *connection,
                                GList *channels,
                                GList *requests_satisfied,
                                gint64 user_action_time,
                                TpHandleChannelsContext *context);

Signature of the implementation of the HandleChannels method.

This function must call either tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail() on context before it returns.

Parameters

client

a TpBaseClient instance

 

account

a TpAccount with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible

 

connection

a TpConnection with TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible

 

channels

a GList of TpChannel, each with TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible.

[element-type TelepathyGLib.Channel]

requests_satisfied

a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

user_action_time

the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time” for details)

 

context

a TpHandleChannelsContext representing the context of this D-Bus call

 

Since: 0.11.6


tp_base_client_implement_handle_channels ()

void
tp_base_client_implement_handle_channels
                               (TpBaseClientClass *klass,
                                TpBaseClientClassHandleChannelsImpl impl);

Called by subclasses to define the actual implementation of the HandleChannels() D-Bus method.

Since 0.11.13 this is exactly equivalent to setting the TpBaseClientClass.handle_channels function pointer.

[skip]

Parameters

klass

the TpBaseClientClass of the object

 

impl

the TpBaseClientClassHandleChannelsImpl function implementing HandleCHannels()

 

Since: 0.11.6


tp_base_client_add_account_features ()

void
tp_base_client_add_account_features (TpBaseClient *self,
                                     const GQuark *features,
                                     gssize n);

tp_base_client_add_account_features is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_account_features() instead.

Request that the given features are prepared on each TpAccount (in addition to TP_ACCOUNT_FEATURE_CORE) before calling TpBaseClientClass.observe_channels, TpBaseClientClass.add_dispatch_operation or TpBaseClientClass.handle_channels, or emitting “request-added”.

Parameters

self

a client

 

features

the features.

[array length=n]

n

the number of features, or -1 if features is 0-terminated

 

Since: 0.11.14


tp_base_client_add_account_features_varargs ()

void
tp_base_client_add_account_features_varargs
                               (TpBaseClient *self,
                                GQuark feature,
                                ...);

tp_base_client_add_account_features_varargs is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_account_features_varargs() instead.

The same as tp_base_client_add_account_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a client

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.11.14


tp_base_client_add_connection_features ()

void
tp_base_client_add_connection_features
                               (TpBaseClient *self,
                                const GQuark *features,
                                gssize n);

tp_base_client_add_connection_features is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_connection_features() instead.

Request that the given features are prepared on each TpConnection (in addition to TP_CONNECTION_FEATURE_CORE) before calling TpBaseClientClass.observe_channels, TpBaseClientClass.add_dispatch_operation or TpBaseClientClass.handle_channels.

Parameters

self

a client

 

features

the features.

[array length=n]

n

the number of features, or -1 if features is 0-terminated

 

Since: 0.11.14


tp_base_client_add_connection_features_varargs ()

void
tp_base_client_add_connection_features_varargs
                               (TpBaseClient *self,
                                GQuark feature,
                                ...);

tp_base_client_add_connection_features_varargs is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_connection_features_varargs() instead.

The same as tp_base_client_add_connection_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a client

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.11.14


tp_base_client_add_channel_features ()

void
tp_base_client_add_channel_features (TpBaseClient *self,
                                     const GQuark *features,
                                     gssize n);

tp_base_client_add_channel_features is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_channel_features() instead.

Request that the given features are prepared on each TpChannel (in addition to TP_CHANNEL_FEATURE_CORE) before calling TpBaseClientClass.observe_channels, TpBaseClientClass.add_dispatch_operation or TpBaseClientClass.handle_channels.

Parameters

self

a client

 

features

the features.

[array length=n]

n

the number of features, or -1 if features is 0-terminated

 

Since: 0.11.14


tp_base_client_add_channel_features_varargs ()

void
tp_base_client_add_channel_features_varargs
                               (TpBaseClient *self,
                                GQuark feature,
                                ...);

tp_base_client_add_channel_features_varargs is deprecated and should not be used in newly-written code.

New code should use tp_simple_client_factory_add_channel_features_varargs() instead.

The same as tp_base_client_add_channel_features(), but with a more convenient calling convention from C.

[skip]

Parameters

self

a client

 

feature

the first feature

 

...

the second and subsequent features, if any, ending with 0

 

Since: 0.11.14


tp_base_client_get_handled_channels ()

GList *
tp_base_client_get_handled_channels (TpBaseClient *self);

tp_base_client_get_handled_channels is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_base_client_dup_handled_channels() instead.

Returns the set of channels currently handled by this base client or by any other TpBaseClient with which it shares a unique name.

Parameters

self

a TpBaseClient

 

Returns

the handled channels.

[transfer container][element-type TelepathyGLib.Channel]

Since: 0.11.6


tp_base_client_dup_handled_channels ()

GList *
tp_base_client_dup_handled_channels (TpBaseClient *self);

Returns the set of channels currently handled by this base client or by any other TpBaseClient with which it shares a unique name.

Parameters

self

a TpBaseClient

 

Returns

the handled channels.

[transfer full][element-type TelepathyGLib.Channel]

Since: 0.19.9


tp_base_client_is_handling_channel ()

gboolean
tp_base_client_is_handling_channel (TpBaseClient *self,
                                    TpChannel *channel);

Check if self is currently handling channel .

Parameters

self

a TpBaseClient

 

channel

a TpChannel

 

Returns

TRUE if self is handling channel , FALSE otherwise

Since: 0.14.5


tp_base_client_delegate_channels_async ()

void
tp_base_client_delegate_channels_async
                               (TpBaseClient *self,
                                GList *channels,
                                gint64 user_action_time,
                                const gchar *preferred_handler,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls DelegateChannels on the ChannelDispatcher to try stopping handling channels and pass them to another Handler. You can then call tp_base_client_delegate_channels_finish() to get the result of the operation.

Parameters

self

a TpBaseClient

 

channels

a GList of TpChannel handled by self .

[element-type TelepathyGLib.Channel]

user_action_time

the time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this delegation request is for some reason not involving user action.

 

preferred_handler

Either the well-known bus name (starting with TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channels, or NULL to indicate that any handler but self would be acceptable.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.15.0


tp_base_client_delegate_channels_finish ()

gboolean
tp_base_client_delegate_channels_finish
                               (TpBaseClient *self,
                                GAsyncResult *result,
                                GPtrArray **delegated,
                                GHashTable **not_delegated,
                                GError **error);

Finishes an async channels delegation request started using tp_base_client_delegate_channels_async().

Parameters

self

a TpBaseClient

 

result

a GAsyncResult

 

delegated

if not NULL, used to return a GPtrArray containing the TpChannels which have been properly delegated.

[out][element-type TelepathyGLib.Channel][transfer container]

not_delegated

if not not NULL, used to return a GHashTable mapping TpChannels which have not been delegated to a GError explaining the reason of the failure.

[out][element-type TelepathyGLib.Channel GLib.Error][transfer container]

error

a GError to fill

 

Returns

TRUE if the operation succeed, delegated and not_delegated can be used to know the channels that self is not handling any more, otherwise FALSE.

Since: 0.15.0


TpBaseClientDelegatedChannelsCb ()

void
(*TpBaseClientDelegatedChannelsCb) (TpBaseClient *client,
                                    GPtrArray *channels,
                                    gpointer user_data);

Called when a client asked us to delegate channels to another Handler. When this function is called client is not longer handling channels .

Parameters

client

a TpBaseClient instance

 

channels

a GPtrArray of TpChannel.

[element-type TelepathyGLib.Channel]

user_data

arbitrary user-supplied data passed to tp_base_client_set_delegated_channels_callback()

 

Since: 0.15.3


tp_base_client_set_delegated_channels_callback ()

void
tp_base_client_set_delegated_channels_callback
                               (TpBaseClient *self,
                                TpBaseClientDelegatedChannelsCb callback,
                                gpointer user_data,
                                GDestroyNotify destroy);

Turn on support for the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler hint.

When receiving a request containing this hint, self will automatically delegate the channels to the preferred handler of the request and then call callback to inform the client that it is no longer handling those channels.

Parameters

self

a TpBaseClient implementing Handler

 

callback

function called when channels currently handled by self are delegated, may not be NULL

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when self is destroyed

 

Since: 0.15.3


tp_channel_dispatcher_present_channel_async ()

void
tp_channel_dispatcher_present_channel_async
                               (TpChannelDispatcher *self,
                                TpChannel *channel,
                                gint64 user_action_time,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Asynchronously calls PresentChannel on the ChannelDispatcher to ask to the handler of channel to re-present it to the user. You can then call tp_channel_dispatcher_present_channel_finish() to get the result of the operation.

Parameters

self

a TpChannelDispatcher

 

channel

a TpChannel

 

user_action_time

the time at which user action occurred, or TP_USER_ACTION_TIME_NOT_USER_ACTION if this presentation request is for some reason not involving user action.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.15.0


tp_channel_dispatcher_present_channel_finish ()

gboolean
tp_channel_dispatcher_present_channel_finish
                               (TpChannelDispatcher *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async channel presentation request started using tp_channel_dispatcher_present_channel_async().

Parameters

self

a TpBaseClient

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the call succeeded, otherwise FALSE.

Since: 0.15.0


tp_base_client_get_pending_requests ()

GList *
tp_base_client_get_pending_requests (TpBaseClient *self);

tp_base_client_get_pending_requests is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_base_client_dup_pending_requests() instead.

Only works if tp_base_client_set_handler_request_notification() has been called. Returns the list of requests self is likely be asked to handle.

Parameters

self

a TpBaseClient

 

Returns

a GList of TpChannelRequest.

[transfer container][element-type TelepathyGLib.ChannelRequest]

Since: 0.11.6


tp_base_client_dup_pending_requests ()

GList *
tp_base_client_dup_pending_requests (TpBaseClient *self);

Only works if tp_base_client_set_handler_request_notification() has been called. Returns the list of requests self is likely be asked to handle.

Parameters

self

a TpBaseClient

 

Returns

a GList of TpChannelRequest.

[transfer full][element-type TelepathyGLib.ChannelRequest]

Since: 0.19.9


tp_base_client_set_handler_bypass_approval ()

void
tp_base_client_set_handler_bypass_approval
                               (TpBaseClient *self,
                                gboolean bypass_approval);

Set whether the channels destined for this handler are automatically handled, without invoking approvers. (This is implemented by setting the value of its BypassApproval D-Bus property.)

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a TpBaseClient

 

bypass_approval

the value of the Handler.BypassApproval property

 

Since: 0.11.6


tp_base_client_set_handler_request_notification ()

void
tp_base_client_set_handler_request_notification
                               (TpBaseClient *self);

Indicate that self is a Handler willing to be notified about requests for channels that it is likely to be asked to handle. This means that the “request-added” and “request-removed” signals will be fired and tp_base_client_get_pending_requests() will return the list of pending requests.

This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements TpBaseClientClass.handle_channels.

Parameters

self

a TpBaseClient

 

Since: 0.11.6


tp_base_client_register ()

gboolean
tp_base_client_register (TpBaseClient *self,
                         GError **error);

Publish self as an available client. After this method is called, as long as it continues to exist, it will receive and process whatever events were requested via the various filters.

Methods that set the filters and other immutable state, such as tp_base_client_add_observer_filter(), cannot be called after this one.

Parameters

self

a TpBaseClient, which must not have been registered with tp_base_client_register() yet

 

error

used to indicate the error if FALSE is returned

 

Returns

TRUE if the client was registered successfully

Since: 0.11.5


tp_base_client_unregister ()

void
tp_base_client_unregister (TpBaseClient *self);

Remove this client object from D-Bus, if tp_base_client_register() has already been called.

If the object is not registered, this method may be called, but has no effect.

Releasing the last reference to the object also has the same effect as calling this method, but this method should be preferred, as it has more deterministic behaviour.

If the object still exists, tp_base_client_register() may be used to attempt to register it again.

Parameters

self

a client, which may already have been registered with tp_base_client_register(), or not

 

Since: 0.11.6


tp_base_client_get_bus_name ()

const gchar *
tp_base_client_get_bus_name (TpBaseClient *self);

Return the bus name of self . Note that doesn't mean the client is actually owning this name; for example if tp_base_client_register() has not been called yet or failed.

Parameters

self

a TpBaseClient

 

Returns

the bus name of the client

Since: 0.11.5


tp_base_client_get_object_path ()

const gchar *
tp_base_client_get_object_path (TpBaseClient *self);

Return the object path of self . Note that doesn't mean the client is actually registered on this path; for example if tp_base_client_register() has not been called yet or failed.

Parameters

self

a TpBaseClient

 

Returns

the object path of the client

Since: 0.11.5


tp_base_client_get_dbus_daemon ()

TpDBusDaemon *
tp_base_client_get_dbus_daemon (TpBaseClient *self);

Return the “dbus-daemon” construct-only property, which represents the D-Bus connection used to export this client object.

The returned object's reference count is not incremented, so it is not necessarily valid after self is destroyed.

Parameters

self

a TpBaseClient

 

Returns

the value of “dbus-daemon”.

[transfer none]

Since: 0.11.11


tp_base_client_get_name ()

const gchar *
tp_base_client_get_name (TpBaseClient *self);

Return the “name” construct-only property, which is used as part of the bus name and object path.

Parameters

self

a TpBaseClient

 

Returns

the value of “name”

Since: 0.11.11


tp_base_client_get_uniquify_name ()

gboolean
tp_base_client_get_uniquify_name (TpBaseClient *self);

Return the “uniquify-name” construct-only property; if this is true, the bus name and object path will be made unique by appending a suffix that includes the D-Bus unique name and a per-process counter.

Parameters

self

a TpBaseClient

 

Returns

the value of “uniquify-name”

Since: 0.11.11


tp_base_client_get_account_manager ()

TpAccountManager *
tp_base_client_get_account_manager (TpBaseClient *self);

tp_base_client_get_account_manager is deprecated and should not be used in newly-written code.

New code should not use this function, it may return NULL in the case self was constructed with a TpSimpleClientFactory.

Return the “account-manager” construct-only property, which is the account manager used to look up or create TpAccount objects.

The returned object's reference count is not incremented, so it is not necessarily valid after self is destroyed.

It is not guaranteed that any particular features are prepared on this object; enable and wait for features with tp_proxy_prepare_async().

[skip]

Parameters

self

a TpBaseClient

 

Returns

the value of “account-manager”.

[transfer none]

Since: 0.11.14


tp_base_client_set_channel_factory ()

void
tp_base_client_set_channel_factory (TpBaseClient *self,
                                    TpClientChannelFactory *factory);

tp_base_client_set_channel_factory is deprecated and should not be used in newly-written code.

since 0.15.5. The factory is taken from “account-manager”.

Change the value of the “channel-factory” property. It can't be changed once self has been registered.

Parameters

self

a TpBaseClient

 

factory

an object implementing the TpClientChannelFactoryInterface interface

 

Since: 0.13.2


tp_base_client_get_channel_factory ()

TpClientChannelFactory *
tp_base_client_get_channel_factory (TpBaseClient *self);

tp_base_client_get_channel_factory is deprecated and should not be used in newly-written code.

since 0.15.5. The factory is taken from “account-manager”.

Return the “channel-factory” property.

[skip]

Parameters

self

a TpBaseClient

 

Returns

the value of “channel-factory”

Since: 0.13.2

Types and Values

struct TpBaseClient

struct TpBaseClient;

Data structure representing a generic TpSvcClient implementation.

Since: 0.11.5


struct TpBaseClientClass

struct TpBaseClientClass {
    GObjectClass parent_class;
    TpBaseClientClassObserveChannelsImpl observe_channels;
    TpBaseClientClassAddDispatchOperationImpl add_dispatch_operation;
    TpBaseClientClassHandleChannelsImpl handle_channels;
};

The class of a TpBaseClient.

The virtual methods observe_channels , add_dispatch_operation and handle_channels can be also implemented by calling tp_base_client_implement_observe_channels(), tp_base_client_implement_add_dispatch_operation() and tp_base_client_implement_handle_channels(). This is compatible with telepathy-glib versions older than 0.11.13.

Members

GObjectClass parent_class;

the parent class

 

TpBaseClientClassObserveChannelsImpl observe_channels;

the function called to observe newly-created channels matching this client's observer filter (since 0.11.13)

 

TpBaseClientClassAddDispatchOperationImpl add_dispatch_operation;

the function called to request user approval of unrequested (incoming) channels matching this client's approver filter (since 0.11.13)

 

TpBaseClientClassHandleChannelsImpl handle_channels;

the function called to handle channels matching this client's handler filter (since 0.11.13)

 

Since: 0.11.5

Property Details

The “account-manager” property

  “account-manager”          TpAccountManager *

Account manager for this base client, used to look up or create TpAccount objects. This may be specified in the constructor in order to get existing TpAccount objects.

It is not guaranteed that any of its features have been prepared, and it is not necessary to wait for any features before specifying this property in the constructor.

Clients that interact with the TpAccount should usually set this property instead of “dbus-daemon”. Doing this will ensure that each account, connection or contact is represented by a single TpAccount, TpConnection or TpContact object, shared between all the cooperating modules that have the same TpAccountManager.

If the “dbus-daemon” is set to the result of tp_dbus_daemon_dup(), then this property defaults to the result of tp_account_manager_dup().

This property may be NULL initially, but will always be non-NULL after the TpBaseClient has been constructed.

It is an error to specify both a non-NULL account manager, and a non-NULL “dbus-daemon” that is not the same as the account manager's “dbus-daemon”.

TpBaseClient:account-manager is deprecated and should not be used in newly-written code.

New code should not use this property, it may be NULL in the case self was constructed with a TpSimpleClientFactory.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Since: 0.11.14


The “channel-factory” property

  “channel-factory”          GObject *

The object implementing the TpClientChannelFactoryInterface interface that will be used to create channel proxies. While tp_base_client_register() has not yet been called, this property can be changed using tp_base_client_set_channel_factory().

If no channel factory is specified then TpAutomaticProxyFactory is used.

TpBaseClient:channel-factory is deprecated and should not be used in newly-written code.

since 0.15.5. The factory is taken from “account-manager”.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Since: 0.13.2


The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction.

This property can't be NULL after construction.

Since 0.11.14 this property may be NULL or unspecified in g_object_new(), but only if “account-manager” is provided instead, in which case its “dbus-daemon” property will be used.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Since: 0.11.5


The “factory” property

  “factory”                  TpSimpleClientFactory *

Factory for this base client, used to look up or create TpAccount objects.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Since: 0.15.5


The “name” property

  “name”                     gchar *

The name of the client. This is used to register the D-Bus service name and object path of the service.

This property can't be NULL.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.11.5


The “uniquify-name” property

  “uniquify-name”            gboolean

If TRUE, tp_base_client_register() will append an unique token to the service bus name and object path to ensure they are unique.

Owner: TpBaseClient

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.11.5

Signal Details

The “request-added” signal

void
user_function (TpBaseClient     *self,
               TpAccount        *account,
               TpChannelRequest *request,
               gpointer          user_data)

Emitted when a channels have been requested, and that if the request is successful, they will probably be handled by this Handler.

This signal is only fired if tp_base_client_set_handler_request_notification() has been called on self previously.

Parameters

self

a TpBaseClient

 

account

the TpAccount on which the request was made, with TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible

 

request

a TpChannelRequest having its object-path defined but is not guaranteed to be prepared.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.6


The “request-removed” signal

void
user_function (TpBaseClient     *self,
               TpChannelRequest *request,
               gchar            *error,
               gchar            *message,
               gpointer          user_data)

Emitted when a request has failed and should be disregarded.

This signal is only fired if tp_base_client_set_handler_request_notification() has been called on self previously.

Parameters

self

a TpBaseClient

 

request

the TpChannelRequest being removed

 

error

the name of the D-Bus error with which the request failed.

 

message

any message supplied with the D-Bus error.

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

Since: 0.11.6

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpPropertiesMixin.html0000644000175000017500000020071614006623343024536 00000000000000 TpPropertiesMixin: telepathy-glib API Reference Manual

TpPropertiesMixin

TpPropertiesMixin — a mixin implementation of the Telepathy.Properties interface

Includes

#include <telepathy-glib/properties-mixin.h>

Description

This mixin can be added to any GObject class to implement the properties interface in a general way.

To use the properties mixin, include a TpPropertiesMixinClass somewhere in your class structure and a TpPropertiesMixin somewhere in your instance structure, and call tp_properties_mixin_class_init() from your class_init function, tp_properties_mixin_init() from your init function or constructor, and tp_properties_mixin_finalize() from your dispose or finalize function.

To use the properties mixin as the implementation of TpSvcPropertiesInterface, call G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROPERTIES_INTERFACE, tp_properties_mixin_iface_init) in the fourth argument to G_DEFINE_TYPE_WITH_CODE.

Functions

TpPropertiesSetFunc ()

gboolean
(*TpPropertiesSetFunc) (GObject *obj,
                        TpPropertiesContext *ctx,
                        GError **error);

A callback used to implement the SetProperties D-Bus method by setting properties in the underlying IM protocol.

The callback must either:

Parameters

obj

An object with the properties mixin

 

ctx

A properties context

 

error

Set to the error if FALSE is returned

 

Returns

FALSE on immediate failure, TRUE otherwise


tp_properties_mixin_class_init ()

void
tp_properties_mixin_class_init (GObjectClass *obj_cls,
                                glong offset,
                                const TpPropertySignature *signatures,
                                guint num_properties,
                                TpPropertiesSetFunc set_func);

Initialize the mixin. Should be called from the implementation's class_init function like so:

1
2
3
tp_properties_mixin_class_init ((GObjectClass *) klass,
                                G_STRUCT_OFFSET (SomeObjectClass,
                                 properties_mixin));

Parameters

obj_cls

The class of an object that has this mixin

 

offset

The offset of the TpPropertiesMixinClass structure in the class structure

 

signatures

An array of property signatures

 

num_properties

The number of entries in signatures

 

set_func

Callback used to set the properties

 

tp_properties_mixin_init ()

void
tp_properties_mixin_init (GObject *obj,
                          glong offset);

Initialize the mixin. Should be called from the implementation's instance init function like so:

1
2
3
tp_properties_mixin_init ((GObject *) self,
                          G_STRUCT_OFFSET (SomeObject, properties_mixin),
                          self->contact_repo);

Parameters

obj

An object that has this mixin

 

offset

The offset of the TpPropertiesMixin structure in the object structure

 

tp_properties_mixin_finalize ()

void
tp_properties_mixin_finalize (GObject *obj);

Free memory used by the TpPropertiesMixin.

Parameters

obj

An object that has this mixin

 

tp_properties_mixin_list_properties ()

gboolean
tp_properties_mixin_list_properties (GObject *obj,
                                     GPtrArray **ret,
                                     GError **error);

List all available properties and their flags, as in the ListProperties D-Bus method.

Parameters

obj

An object with this mixin

 

ret

Output parameter which will be set to a GPtrArray of D-Bus structures if TRUE is returned

 

error

Set to the error if FALSE is returned

 

Returns

TRUE on success


tp_properties_mixin_get_properties ()

gboolean
tp_properties_mixin_get_properties (GObject *obj,
                                    const GArray *properties,
                                    GPtrArray **ret,
                                    GError **error);

Retrieve the values of the given properties, as in the GetProperties D-Bus method.

Parameters

obj

An object with this mixin

 

properties

an array of integer property IDs

 

ret

set to an array of D-Bus structures if TRUE is returned

 

error

Set to the error if FALSE is returned

 

Returns

TRUE on success


tp_properties_mixin_set_properties ()

void
tp_properties_mixin_set_properties (GObject *obj,
                                    const GPtrArray *properties,
                                    DBusGMethodInvocation *context);

Start to change properties in response to user request via D-Bus.

Parameters

obj

An object with this mixin

 

properties

An array of D-Bus structures containing property ID and value

 

context

A D-Bus method invocation context for the SetProperties method

 

tp_properties_mixin_has_property ()

gboolean
tp_properties_mixin_has_property (GObject *obj,
                                  const gchar *name,
                                  guint *property);

Parameters

obj

an object with a properties mixin

 

name

the string name of the property

 

property

either NULL, or a pointer to a location to receive the property index

 

Returns

TRUE, setting property , if obj has a property of that name


tp_properties_context_has ()

gboolean
tp_properties_context_has (TpPropertiesContext *ctx,
                           guint property);

Parameters

ctx

the properties context representing a SetProperties call

 

property

the property ID

 

Returns

TRUE if ctx indicates that property still needs to be set on the server.


tp_properties_context_has_other_than ()

gboolean
tp_properties_context_has_other_than (TpPropertiesContext *ctx,
                                      guint property);

Parameters

ctx

the properties context representing a SetProperties call

 

property

the property ID

 

Returns

TRUE if ctx has properties other than property that still need to be set on the server


tp_properties_context_get ()

const GValue *
tp_properties_context_get (TpPropertiesContext *ctx,
                           guint property);

Parameters

ctx

the properties context representing a SetProperties call

 

property

a property ID

 

Returns

the value to be set on the server for the property property in ctx (whether it has been set already or not)


tp_properties_context_get_value_count ()

guint
tp_properties_context_get_value_count (TpPropertiesContext *ctx);

Parameters

ctx

the properties context representing a SetProperties call

 

Returns

the number of properties in ctx which still need to be set on the server, or have already been set


tp_properties_context_remove ()

void
tp_properties_context_remove (TpPropertiesContext *ctx,
                              guint property);

Mark the given property as having been set successfully.

Parameters

ctx

the properties context representing a SetProperties call

 

property

a property ID

 

tp_properties_context_return ()

void
tp_properties_context_return (TpPropertiesContext *ctx,
                              GError *error);

Commit the property changes and return from the pending D-Bus call.

Parameters

ctx

the properties context representing a SetProperties call

 

error

If NULL, return successfully; otherwise return this error

 

tp_properties_context_return_if_done ()

gboolean
tp_properties_context_return_if_done (TpPropertiesContext *ctx);

Return from the pending D-Bus call if there are no more properties to be dealt with.

Parameters

ctx

the properties context representing a SetProperties call

 

Returns

TRUE if we returned from the D-Bus call.


tp_properties_mixin_change_value ()

void
tp_properties_mixin_change_value (GObject *obj,
                                  guint prop_id,
                                  const GValue *new_value,
                                  TpIntset *props);

Change the value of the given property ID in response to a server state change.

If the old and new values match, nothing happens; no signal is emitted and props is ignored. Otherwise, the following applies:

If props is NULL the PropertiesChanged signal is emitted for this one property.

Otherwise, the property ID is added to the set; the caller is responsible for passing the set to tp_properties_mixin_emit_changed() once a batch of properties have been changed.

Parameters

obj

An object with the properties mixin

 

prop_id

A property ID on which to act

 

new_value

Property value

 

props

either NULL, or a pointer to a TpIntset

 

tp_properties_mixin_change_flags ()

void
tp_properties_mixin_change_flags (GObject *obj,
                                  guint prop_id,
                                  TpPropertyFlags add,
                                  TpPropertyFlags del,
                                  TpIntset *props);

Change the flags for the given property ID in response to a server state change.

Flags removed by del override flags added by add . This should not be relied upon.

If props is NULL the PropertyFlagsChanged signal is emitted for this single property.

Otherwise, the property ID is added to the set; the caller is responsible for passing the set to tp_properties_mixin_emit_flags() once a batch of properties have been changed.

Parameters

obj

An object with the properties mixin

 

prop_id

A property ID on which to act

 

add

Property flags to be added via bitwise OR

 

del

Property flags to be removed via bitwise AND

 

props

either NULL, or a pointer to a TpIntset

 

tp_properties_mixin_emit_changed ()

void
tp_properties_mixin_emit_changed (GObject *obj,
                                  const TpIntset *props);

Emit the PropertiesChanged signal to indicate that the values of the given property IDs have changed; the actual values are automatically added using their stored values.

Parameters

obj

an object with the properties mixin

 

props

a set of property IDs

 

tp_properties_mixin_emit_flags ()

void
tp_properties_mixin_emit_flags (GObject *obj,
                                const TpIntset *props);

Emit the PropertyFlagsChanged signal to indicate that the flags of the given property IDs have changed; the actual flags are automatically added using their stored values.

Parameters

obj

an object with the properties mixin

 

props

a set of property IDs

 

tp_properties_mixin_is_readable ()

gboolean
tp_properties_mixin_is_readable (GObject *obj,
                                 guint prop_id);

Parameters

obj

an object with this mixin

 

prop_id

an integer property ID

 

Returns

TRUE if the given property has the READ flag


tp_properties_mixin_is_writable ()

gboolean
tp_properties_mixin_is_writable (GObject *obj,
                                 guint prop_id);

Parameters

obj

an object with this mixin

 

prop_id

an integer property ID

 

Returns

TRUE if the given property has the WRITE flag


tp_properties_mixin_iface_init ()

void
tp_properties_mixin_iface_init (gpointer g_iface,
                                gpointer iface_data);

Fill in this mixin's method implementations in the given interface vtable. This function should usually be called via G_IMPLEMENT_INTERFACE inside the G_DEFINE_TYPE_WITH_CODE macro.

Parameters

g_iface

A pointer to the TpSvcPropertiesInterfaceClass in an object class

 

iface_data

Ignored

 

Types and Values

TpPropertySignature

typedef struct {
    gchar *name;
    GType type;
} TpPropertySignature;

Signature of a property in the Telepathy properties interface.

Members

gchar *name;

Name of the property as seen in the Telepathy D-Bus protocol

 

GType type;

GType which the variant value must have. We currently support only G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING, G_TYPE_BOOLEAN, corresponding to D-Bus signatures 'u', 'i', 's', 'b'.

 

TpProperty

typedef struct {
    /* FIXME: if we ever break ABI, make this a (GValue) rather than a
     * (GValue *) */
    GValue *value;
    guint flags;
} TpProperty;

Structure representing the current state of a property.

Members

GValue *value;

The value of the property

 

guint flags;

TpPropertyFlags indicating the property's permissions

 

TpPropertiesContext

typedef struct _TpPropertiesContext TpPropertiesContext;

Opaque pointer representing an incomplete property-setting operation, used in the implementation of SetProperties.


struct TpPropertiesMixin

struct TpPropertiesMixin {
    TpProperty *properties;

    TpPropertiesMixinPrivate *priv;
};

Structure to be placed in a GObject-derived structure containing instance data for the properties mixin (i.e. the properties). Initialize it using tp_properties_mixin_init().

Members

TpProperty *properties;

Array of property values, of length klass->num_props. Should be considered read-only.

 

TpPropertiesMixinPrivate *priv;

Pointer to opaque private data.

 

struct TpPropertiesMixinClass

struct TpPropertiesMixinClass {
  const TpPropertySignature *signatures;
  guint num_props;

  TpPropertiesSetFunc set_properties;

  TpPropertiesMixinClassPrivate *priv;
};

Structure to be placed in a GObjectClass-derived structure containing settings for the properties mixin. Initialize it using tp_properties_mixin_class_init().

All fields should be considered read-only.

Members

const TpPropertySignature *signatures;

Array of property signatures, as provided via tp_properties_mixin_class_init(), of length num_props .

 

guint num_props;

Number of properties supported.

 

TpPropertiesSetFunc set_properties;

Properties setting function, as supplied to tp_properties_mixin_class_init().

 

TpPropertiesMixinClassPrivate *priv;

Pointer to opaque private data.

 

TP_TYPE_PROPERTY_INFO_STRUCT

#define TP_TYPE_PROPERTY_INFO_STRUCT TP_STRUCT_TYPE_PROPERTY_SPEC

The GType of the structures with D-Bus signature '(ussu)' returned by ListProperties.

Deprecated : Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_SPEC instead.


TP_TYPE_PROPERTY_INFO_LIST

#define TP_TYPE_PROPERTY_INFO_LIST TP_ARRAY_TYPE_PROPERTY_SPEC_LIST

The GType of the return from ListProperties (i.e. a GPtrArray of structures of type TP_TYPE_PROPERTY_INFO_STRUCT), corresponding to D-Bus signature 'a(ussu)'.

Deprecated : Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_SPEC_LIST instead.


TP_TYPE_PROPERTY_VALUE_STRUCT

#define TP_TYPE_PROPERTY_VALUE_STRUCT TP_STRUCT_TYPE_PROPERTY_VALUE

The GType of the structures with signature '(uv)' returned by GetProperties and emitted in PropertiesChanged.

Deprecated : Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_VALUE instead.


TP_TYPE_PROPERTY_VALUE_LIST

#define TP_TYPE_PROPERTY_VALUE_LIST TP_ARRAY_TYPE_PROPERTY_VALUE_LIST

The GType of the return from GetProperties and the parameter to PropertiesChanged (i.e. a GPtrArray of structures of type TP_TYPE_PROPERTY_VALUE_STRUCT), corresponding to D-Bus signature 'a(uv)'.

Deprecated : Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_VALUE_LIST instead.


TP_TYPE_PROPERTY_FLAGS_STRUCT

#define TP_TYPE_PROPERTY_FLAGS_STRUCT TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE

The GType of the structures with D-Bus signature '(uu)' emitted in PropertyFlagsChanged.

Deprecated : Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE instead.


TP_TYPE_PROPERTY_FLAGS_LIST

#define TP_TYPE_PROPERTY_FLAGS_LIST TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST

The GType of the parameter to PropertyFlagsChanged (i.e. a GPtrArray of structures of type TP_TYPE_PROPERTY_FLAGS_STRUCT), corresponding to D-Bus signature 'a(uu)'.

Deprecated : Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST instead.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-account-request.html0000644000175000017500000023440214006623343024212 00000000000000 TpAccountRequest: telepathy-glib API Reference Manual

TpAccountRequest

TpAccountRequest — object for a currently non-existent account in order to create easily without speaking fluent D-Bus

Properties

TpAccountManager * account-manager Read / Write / Construct Only
guint automatic-presence-type Read
gchar * automatic-status Read
gchar * automatic-status-message Read
GArray * avatar Read
gchar * avatar-mime-type Read
gboolean connect-automatically Read
gchar * connection-manager Read / Write / Construct Only
gchar * display-name Read / Write / Construct Only
gboolean enabled Read
gchar * icon-name Read
gchar * nickname Read
GVariant * parameters Read
GVariant * properties Read
gchar * protocol Read / Write / Construct Only
guint requested-presence-type Read
gchar * requested-status Read
gchar * requested-status-message Read
gchar * service Read
gchar * storage-provider Read
GStrv supersedes Read

Types and Values

Object Hierarchy

    GObject
    ╰── TpAccountRequest

Includes

#include <telepathy-glib/account-request.h>

Description

This is a convenience object to aid in the creation of accounts on a TpAccountManager without having to construct GHashTables with well-known keys. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
static void created_cb (GObject *object, GAsyncResult *res, gpointer user_data);

static void
create_acount (void)
{
  TpAccountManager *am = tp_account_manager_dup ();
  TpAccountRequest *req;

  req = tp_account_request_new (am, "gabble", "jabber", "Work Jabber account");

  tp_account_request_set_parameter (req, "account", "walter.white@lospollos.lit");

  // ...

  tp_account_request_create_account_async (req, created_cb, NULL);
  g_object_unref (req);
  g_object_unref (am);
}

static void
created_cb (GObject *object,
    GAsyncResult *result,
    gpointer user_data)
{
  TpAccountRequest *req = TP_ACCOUNT_REQUEST (object);
  TpAccount *account;
  GError *error = NULL;

  account = tp_account_request_create_account_finish (req, result, &error);

  if (account == NULL)
    {
      g_error ("Failed to create account: %s\n", error->message);
      g_clear_error (&error);
      return;
    }

  // ...

  g_object_unref (account);
}

Functions

tp_account_request_new ()

TpAccountRequest *
tp_account_request_new (TpAccountManager *account_manager,
                        const gchar *manager,
                        const gchar *protocol,
                        const gchar *display_name);

Convenience function to create a new account request object which will assist in the creation of a new account on account_manager , using connection manager manager , and protocol protocol .

Parameters

account_manager

the TpAccountManager to create the account on

 

manager

the name of the connection manager

 

protocol

the name of the protocol on manager

 

display_name

the user-visible name of this account

 

Returns

a new reference to an account request object, or NULL if any argument is incorrect.

[transfer full]

Since: 0.19.1


tp_account_request_new_from_protocol ()

TpAccountRequest *
tp_account_request_new_from_protocol (TpAccountManager *account_manager,
                                      TpProtocol *protocol,
                                      const gchar *display_name);

Convenience function to create a new TpAccountRequest object using a TpProtocol instance, instead of specifying connection manager and protocol name specifically. See tp_account_request_new() for more details.

Parameters

account_manager

the TpAccountManager to create the account on

 

protocol

a TpProtocol

 

display_name

the user-visible name of this account

 

Returns

a new reference to an account request object, or NULL if any argument is incorrect.

[transfer full]

Since: 0.19.1


tp_account_request_set_display_name ()

void
tp_account_request_set_display_name (TpAccountRequest *self,
                                     const gchar *name);

Set the display name for the new account, self , to name . Use the “display-name” property to read the current display name.

Parameters

self

a TpAccountRequest

 

name

a display name for the account

 

Since: 0.19.1


tp_account_request_set_icon_name ()

void
tp_account_request_set_icon_name (TpAccountRequest *self,
                                  const gchar *icon);

Set the icon name for the new account, self , to icon . Use the “icon-name” property to read the current icon name.

Parameters

self

a TpAccountRequest

 

icon

an icon name for the account

 

Since: 0.19.1


tp_account_request_set_nickname ()

void
tp_account_request_set_nickname (TpAccountRequest *self,
                                 const gchar *nickname);

Set the nickname for the new account, self , to nickname . Use the “nickname” property to read the current nickname.

Parameters

self

a TpAccountRequest

 

nickname

a nickname for the account

 

Since: 0.19.1


tp_account_request_set_requested_presence ()

void
tp_account_request_set_requested_presence
                               (TpAccountRequest *self,
                                TpConnectionPresenceType presence,
                                const gchar *status,
                                const gchar *message);

Set the requested presence for the new account, self , to the type (presence , status ), with message message . Use the “requested-presence-type”, “requested-status”, and “requested-status-message” properties to read the current requested presence.

Parameters

self

a TpAccountRequest

 

presence

the requested presence type

 

status

the requested presence status

 

message

the requested presence message

 

Since: 0.19.1


tp_account_request_set_automatic_presence ()

void
tp_account_request_set_automatic_presence
                               (TpAccountRequest *self,
                                TpConnectionPresenceType presence,
                                const gchar *status,
                                const gchar *message);

Set the automatic presence for the new account, self , to the type (presence , status ), with message message . Use the “automatic-presence-type”, “automatic-status”, and “automatic-status-message” properties to read the current automatic presence.

Parameters

self

a TpAccountRequest

 

presence

the automatic presence type

 

status

the automatic presence status

 

message

the automatic presence message

 

Since: 0.19.1


tp_account_request_set_enabled ()

void
tp_account_request_set_enabled (TpAccountRequest *self,
                                gboolean enabled);

Set the enabled property of the account on creation to enabled . Use the “enabled” property to read the current enabled value.

Parameters

self

a TpAccountRequest

 

enabled

TRUE if the account is to be enabled

 

Since: 0.19.1


tp_account_request_set_connect_automatically ()

void
tp_account_request_set_connect_automatically
                               (TpAccountRequest *self,
                                gboolean connect_automatically);

Set the connect automatically property of the account on creation to connect_automatically so that the account is brought online to the automatic presence. Use the “connect-automatically” property to read the current connect automatically value.

Parameters

self

a TpAccountRequest

 

connect_automatically

TRUE if the account is to connect automatically

 

Since: 0.19.1


tp_account_request_add_supersedes ()

void
tp_account_request_add_supersedes (TpAccountRequest *self,
                                   const gchar *superseded_path);

Add an account object path to the list of superseded accounts which this new account will supersede. Use the “supersedes” property to read the current list of superseded accounts.

Parameters

self

a TpAccountRequest

 

superseded_path

an account object path to add to the supersedes list

 

Since: 0.19.1


tp_account_request_set_avatar ()

void
tp_account_request_set_avatar (TpAccountRequest *self,
                               const guchar *avatar,
                               gsize len,
                               const gchar *mime_type);

Set the avatar of the account self to avatar . Use the “avatar” and “avatar-mime-type” properties to read the current avatar.

Parameters

self

a TpAccountRequest

 

avatar

a new avatar to set; can be NULL only if len equals 0.

[allow-none][array length=len]

len

the length of the new avatar

 

mime_type

the MIME type of the new avatar; can be NULL only if len equals 0.

[allow-none]

Since: 0.19.1


tp_account_request_set_service ()

void
tp_account_request_set_service (TpAccountRequest *self,
                                const gchar *service);

Set the service property of the account to service . Use the “service” property to read the current value.

Parameters

self

a TpAccountRequest

 

service

the service name for

 

Since: 0.19.1


tp_account_request_set_storage_provider ()

void
tp_account_request_set_storage_provider
                               (TpAccountRequest *self,
                                const gchar *provider);

Set the account storage to use when creating the account. Use the “storage-provider” property to read the current value.

Parameters

self

a TpAccountRequest

 

provider

the name of an account storage implementation

 

Since: 0.19.4


tp_account_request_set_parameter ()

void
tp_account_request_set_parameter (TpAccountRequest *self,
                                  const gchar *key,
                                  GVariant *value);

Set an account parameter, key , to value . Use the “parameters” property to read the current list of set parameters.

Parameters can be unset using tp_account_request_unset_parameter().

Parameters

self

a TpAccountRequest

 

key

the parameter key

 

value

a variant containing the parameter value.

[transfer none]

Since: 0.19.1


tp_account_request_set_parameter_string ()

void
tp_account_request_set_parameter_string
                               (TpAccountRequest *self,
                                const gchar *key,
                                const gchar *value);

Convenience function to set an account parameter string value. See tp_account_request_set_parameter() for more details.

[skip]

Parameters

self

a TpAccountRequest

 

key

the parameter key

 

value

the parameter value

 

Since: 0.19.1


tp_account_request_unset_parameter ()

void
tp_account_request_unset_parameter (TpAccountRequest *self,
                                    const gchar *key);

Unset the account parameter key which has previously been set using tp_account_request_set_parameter() or another convenience function.

Parameters

self

a TpAccountRequest

 

key

the parameter key

 

Since: 0.19.1


tp_account_request_create_account_async ()

void
tp_account_request_create_account_async
                               (TpAccountRequest *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Start an asynchronous operation to create the account self on the account manager.

callback will only be called when the newly created TpAccount has the TP_ACCOUNT_FEATURE_CORE feature ready on it, so when calling tp_account_request_create_account_finish(), one can guarantee this feature.

Parameters

self

a TpAccountRequest

 

callback

a function to call when the account has been created

 

user_data

user data to callback

 

Since: 0.19.1


tp_account_request_create_account_finish ()

TpAccount *
tp_account_request_create_account_finish
                               (TpAccountRequest *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an asynchronous account creation operation and returns a new ref to a TpAccount object. The returned account will have the features listed in tp_simple_client_factory_dup_account_features() (with the proxy factory from “account-manager”) prepared on it.

Parameters

self

a TpAccountRequest

 

result

a GAsyncResult

 

error

something

 

Returns

a new ref to a TpAccount, or NULL.

[transfer full]

Since: 0.19.1

Types and Values

struct TpAccountRequest

struct TpAccountRequest;

An object for representing a currently non-existent account which is to be created on a TpAccountManager.

Since: 0.19.1


struct TpAccountRequestClass

struct TpAccountRequestClass {
};

The class of a TpAccountRequest.

Property Details

The “account-manager” property

  “account-manager”          TpAccountManager *

The TpAccountManager to create the account on.

Owner: TpAccountRequest

Flags: Read / Write / Construct Only

Since: 0.19.1


The “automatic-presence-type” property

  “automatic-presence-type”  guint

The account's automatic presence type (a TpConnectionPresenceType). To change this property use tp_account_request_set_automatic_presence().

When the account is put online automatically, for instance to make a channel request or because network connectivity becomes available, the automatic presence type, status and message will be copied to their "requested" counterparts.

Owner: TpAccountRequest

Flags: Read

Allowed values: <= 9

Default value: 0

Since: 0.19.1


The “automatic-status” property

  “automatic-status”         gchar *

The string status name to use in conjunction with the “automatic-presence-type”. To change this property use tp_account_request_set_automatic_presence().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “automatic-status-message” property

  “automatic-status-message” gchar *

The user-defined message to use in conjunction with the “automatic-presence-type”. To change this property use tp_account_request_set_automatic_presence().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “avatar” property

  “avatar”                   GArray *

The avatar set on the account. The avatar's mime type can be read in the “avatar-mime-type” property. To change this property, use tp_account_request_set_avatar().

Owner: TpAccountRequest

Flags: Read

Since: 0.19.1


The “avatar-mime-type” property

  “avatar-mime-type”         gchar *

The mime type of the “avatar” property. To change this property, use tp_account_request_set_avatar().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “connect-automatically” property

  “connect-automatically”    gboolean

Whether the account should connect automatically or not. To change this property, use tp_account_request_set_connect_automatically().

Owner: TpAccountRequest

Flags: Read

Default value: FALSE

Since: 0.19.1


The “connection-manager” property

  “connection-manager”       gchar *

The account's connection manager name.

Owner: TpAccountRequest

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.1


The “display-name” property

  “display-name”             gchar *

The account's display name. To change this property use tp_account_request_set_display_name().

Owner: TpAccountRequest

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.1


The “enabled” property

  “enabled”                  gboolean

Whether the account is enabled or not. To change this property use tp_account_request_set_enabled().

Owner: TpAccountRequest

Flags: Read

Default value: FALSE

Since: 0.19.1


The “icon-name” property

  “icon-name”                gchar *

The account's icon name. To change this propery, use tp_account_request_set_icon_name().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “nickname” property

  “nickname”                 gchar *

The account's nickname. To change this property use tp_account_request_set_nickname().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “parameters” property

  “parameters”               GVariant *

The account's connection parameters. To add a parameter, use tp_account_request_set_parameter() or another convience function.

Owner: TpAccountRequest

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.1


The “properties” property

  “properties”               GVariant *

The account's properties.

Owner: TpAccountRequest

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL

Since: 0.19.1


The “protocol” property

  “protocol”                 gchar *

The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification.

Owner: TpAccountRequest

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.19.1


The “requested-presence-type” property

  “requested-presence-type”  guint

The account's requested presence type (a TpConnectionPresenceType). To change this property use tp_account_request_set_requested_presence().

Owner: TpAccountRequest

Flags: Read

Allowed values: <= 9

Default value: 0

Since: 0.19.1


The “requested-status” property

  “requested-status”         gchar *

The requested Status string of the account. To change this property use tp_account_request_set_requested_presence().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “requested-status-message” property

  “requested-status-message” gchar *

The requested status message message of the account. To change this property use tp_account_request_set_requested_presence().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “service” property

  “service”                  gchar *

A string describing the service of the account, which must consist only of ASCII letters, numbers and hyphen/minus signs, and start with a letter (matching the requirements for Protocol). To change this property, use tp_account_request_set_service().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.1


The “storage-provider” property

  “storage-provider”         gchar *

The account's storage provider. To change this property use tp_account_request_set_storage_provider().

Owner: TpAccountRequest

Flags: Read

Default value: NULL

Since: 0.19.4


The “supersedes” property

  “supersedes”               GStrv

The object paths of previously-active accounts superseded by this one. For instance, this can be used in a logger to read old logs for an account that has been migrated from one connection manager to another.

To add to this property use tp_account_request_add_supersedes().

Owner: TpAccountRequest

Flags: Read

Since: 0.19.1

See Also

TpAccountManager

telepathy-glib-0.24.2/docs/reference/html/up.png0000644000175000017500000000040414006623343016415 00000000000000PNG  IHDRabKGD pHYs B(xtIME IDAT81 @D{xa;$]r =JR1, Sd-}0̟oL:m-QO[ k TzMޠL,:ךu!tK; Pp Ot@l/̵*l}IENDB`telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-contact-info.html0000644000175000017500000017750214006623344025621 00000000000000 Connection ContactInfo interface: telepathy-glib API Reference Manual

Connection ContactInfo interface

Connection ContactInfo interface — client-side wrappers for the ContactInfo interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

An interface for requesting information about a contact on a given connection. The information is represented as a list of fields forming a structured representation of a vCard (as defined by RFC 2426), using field names and semantics defined therein.

This section documents the auto-generated C wrappers for the ContactInfo interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_contact_info_call_get_contact_info ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_info_call_get_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_info_callback_for_get_contact_info callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactInfo method call.

Request information on several contacts at once. This SHOULD only return cached information, omitting handles for which no information is cached from the returned map.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_info_call_refresh_contact_info ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_info_call_refresh_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_contact_info_callback_for_refresh_contact_info callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RefreshContactInfo method call.

Retrieve information for the given contact, requesting it from the network if an up-to-date version is not cached locally. This method SHOULD return immediately, emitting <tp:member-ref>ContactInfoChanged</tp:member-ref> when the contacts' updated contact information is returned. <tp:rationale> This method allows a client with cached contact information to update its cache after a number of days. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: Integer handles for contacts.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_info_call_request_contact_info ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_info_call_request_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                tp_cli_connection_interface_contact_info_callback_for_request_contact_info callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestContactInfo method call.

Retrieve information for a contact, requesting it from the network if it is not cached locally. <tp:rationale> This method is appropriate for an explicit user request to show a contact's information; it allows a UI to wait for the contact info to be returned. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: An integer handle for a contact. (TpContactHandle)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_info_call_set_contact_info ()

TpProxyPendingCall *
tp_cli_connection_interface_contact_info_call_set_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_ContactInfo,
                                tp_cli_connection_interface_contact_info_callback_for_set_contact_info callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetContactInfo method call.

Set new contact information for this connection, replacing existing information. This method is only suppported if <tp:member-ref>ContactInfoFlags</tp:member-ref> contains <code>Can_Set</code>, and may only be passed fields conforming to <tp:member-ref>SupportedFields</tp:member-ref>.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ContactInfo

Used to pass an 'in' argument: The new information to be set.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contact_info_callback_for_get_contact_info ()

void
(*tp_cli_connection_interface_contact_info_callback_for_get_contact_info)
                               (TpConnection *proxy,
                                GHashTable *out_ContactInfo,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactInfo method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_ContactInfo

Used to return an 'out' argument if error is NULL: A dictionary mapping contact handles to information, whose keys are the subset of the requested list of handles for which information was cached.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_info_callback_for_refresh_contact_info ()

void
(*tp_cli_connection_interface_contact_info_callback_for_refresh_contact_info)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RefreshContactInfo method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_info_callback_for_request_contact_info ()

void
(*tp_cli_connection_interface_contact_info_callback_for_request_contact_info)
                               (TpConnection *proxy,
                                const GPtrArray *out_Contact_Info,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestContactInfo method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Contact_Info

Used to return an 'out' argument if error is NULL: Information about that contact.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_info_callback_for_set_contact_info ()

void
(*tp_cli_connection_interface_contact_info_callback_for_set_contact_info)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetContactInfo method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contact_info_connect_to_contact_info_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_contact_info_connect_to_contact_info_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_contact_info_signal_callback_contact_info_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ContactInfoChanged.

Emitted when a contact's information has changed or been received for the first time on this connection.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_contact_info_run_get_contact_info ()

gboolean
tp_cli_connection_interface_contact_info_run_get_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GHashTable **out_ContactInfo,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_info_run_get_contact_info is deprecated and should not be used in newly-written code.

Call the method GetContactInfo and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Request information on several contacts at once. This SHOULD only return cached information, omitting handles for which no information is cached from the returned map.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of handles representing contacts.

 

out_ContactInfo

Used to return an 'out' argument if TRUE is returned: A dictionary mapping contact handles to information, whose keys are the subset of the requested list of handles for which information was cached.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_info_run_refresh_contact_info ()

gboolean
tp_cli_connection_interface_contact_info_run_refresh_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_info_run_refresh_contact_info is deprecated and should not be used in newly-written code.

Call the method RefreshContactInfo and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Retrieve information for the given contact, requesting it from the network if an up-to-date version is not cached locally. This method SHOULD return immediately, emitting <tp:member-ref>ContactInfoChanged</tp:member-ref> when the contacts' updated contact information is returned. <tp:rationale> This method allows a client with cached contact information to update its cache after a number of days. </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: Integer handles for contacts.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_info_run_request_contact_info ()

gboolean
tp_cli_connection_interface_contact_info_run_request_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                GPtrArray **out_Contact_Info,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_info_run_request_contact_info is deprecated and should not be used in newly-written code.

Call the method RequestContactInfo and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Retrieve information for a contact, requesting it from the network if it is not cached locally. <tp:rationale> This method is appropriate for an explicit user request to show a contact's information; it allows a UI to wait for the contact info to be returned. </tp:rationale>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contact

Used to pass an 'in' argument: An integer handle for a contact. (TpContactHandle)

 

out_Contact_Info

Used to return an 'out' argument if TRUE is returned: Information about that contact.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_info_run_set_contact_info ()

gboolean
tp_cli_connection_interface_contact_info_run_set_contact_info
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_ContactInfo,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contact_info_run_set_contact_info is deprecated and should not be used in newly-written code.

Call the method SetContactInfo and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Set new contact information for this connection, replacing existing information. This method is only suppported if <tp:member-ref>ContactInfoFlags</tp:member-ref> contains <code>Can_Set</code>, and may only be passed fields conforming to <tp:member-ref>SupportedFields</tp:member-ref>.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ContactInfo

Used to pass an 'in' argument: The new information to be set.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contact_info_signal_callback_contact_info_changed ()

void
(*tp_cli_connection_interface_contact_info_signal_callback_contact_info_changed)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                const GPtrArray *arg_ContactInfo,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ContactInfoChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_contact_info_connect_to_contact_info_changed() was called

 

arg_Contact

An integer handle for the contact whose info has changed. (TpContactHandle)

 

arg_ContactInfo

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> An array of fields representing information about this contact.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-anonymity.html0000644000175000017500000002713714006623344023716 00000000000000 Service-side Connection and Channel Anonymity interfaces: telepathy-glib API Reference Manual

Service-side Connection and Channel Anonymity interfaces

Service-side Connection and Channel Anonymity interfaces — GInterfaces to implement the Anonymity interfaces

Signals

void anonymity-modes-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceAnonymity
    ╰── TpSvcConnectionInterfaceAnonymity

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In some protocols, mainly those that interact with the PSTN, it's possible to make a call without disclosing the originating identity (e.g. phone number). The Anonymity interfaces on the Connection and Channel can be used to control this feature in Telepathy.

This section documents the auto-generated GInterfaces used to implement the Anonymity interfaces.

Functions

tp_svc_connection_interface_anonymity_emit_anonymity_modes_changed ()

void
tp_svc_connection_interface_anonymity_emit_anonymity_modes_changed
                               (gpointer instance,
                                guint arg_Modes);

Type-safe wrapper around g_signal_emit to emit the AnonymityModesChanged signal on interface org.freedesktop.Telepathy.Connection.Interface.Anonymity.

Parameters

instance

The object implementing this interface

 

arg_Modes

guint (FIXME, generate documentation)

 

Types and Values

TpSvcConnectionInterfaceAnonymity

typedef struct _TpSvcConnectionInterfaceAnonymity TpSvcConnectionInterfaceAnonymity;

Dummy typedef representing any implementation of this interface.


TpSvcConnectionInterfaceAnonymityClass

typedef struct _TpSvcConnectionInterfaceAnonymityClass TpSvcConnectionInterfaceAnonymityClass;

The class of TpSvcConnectionInterfaceAnonymity. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelInterfaceAnonymity

typedef struct _TpSvcChannelInterfaceAnonymity TpSvcChannelInterfaceAnonymity;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceAnonymityClass

typedef struct _TpSvcChannelInterfaceAnonymityClass TpSvcChannelInterfaceAnonymityClass;

The class of TpSvcChannelInterfaceAnonymity. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

Signal Details

The “anonymity-modes-changed” signal

void
user_function (TpSvcConnectionInterfaceAnonymity *self,
               guint                              arg_Modes,
               gpointer                           user_data)

The AnonymityModesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Modes

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-dispatch-operation.html0000644000175000017500000010440214006623344027061 00000000000000 Service-side Channel Dispatch Operation interface: telepathy-glib API Reference Manual

Service-side Channel Dispatch Operation interface

Service-side Channel Dispatch Operation interface — GInterface for Telepathy ChannelDispatchOperation object

Signals

void channel-lost Has Details
void finished Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelDispatchOperation

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy ChannelDispatchOperation interface, with the correct method and signal signatures, and emit signals from that object in a type-safe way.

You don't need these interfaces unless you're implementing a Telepathy ChannelDispatcher, such as Mission Control.

Functions

tp_svc_channel_dispatch_operation_return_from_claim ()

void
tp_svc_channel_dispatch_operation_return_from_claim
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_dispatch_operation_claim_impl ()

void
(*tp_svc_channel_dispatch_operation_claim_impl)
                               (TpSvcChannelDispatchOperation *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Claim on interface org.freedesktop.Telepathy.ChannelDispatchOperation.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatch_operation_implement_claim ()

void
tp_svc_channel_dispatch_operation_implement_claim
                               (TpSvcChannelDispatchOperationClass *klass,
                                tp_svc_channel_dispatch_operation_claim_impl impl);

Register an implementation for the Claim method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Claim D-Bus method

 

tp_svc_channel_dispatch_operation_return_from_handle_with ()

void
tp_svc_channel_dispatch_operation_return_from_handle_with
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_dispatch_operation_handle_with_impl ()

void
(*tp_svc_channel_dispatch_operation_handle_with_impl)
                               (TpSvcChannelDispatchOperation *self,
                                const gchar *in_Handler,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method HandleWith on interface org.freedesktop.Telepathy.ChannelDispatchOperation.

Parameters

self

The object implementing this interface

 

in_Handler

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatch_operation_implement_handle_with ()

void
tp_svc_channel_dispatch_operation_implement_handle_with
                               (TpSvcChannelDispatchOperationClass *klass,
                                tp_svc_channel_dispatch_operation_handle_with_impl impl);

Register an implementation for the HandleWith method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the HandleWith D-Bus method

 

tp_svc_channel_dispatch_operation_handle_with_time_impl ()

void
(*tp_svc_channel_dispatch_operation_handle_with_time_impl)
                               (TpSvcChannelDispatchOperation *self,
                                const gchar *in_Handler,
                                gint64 in_UserActionTime,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method HandleWithTime on interface org.freedesktop.Telepathy.ChannelDispatchOperation.

Parameters

self

The object implementing this interface

 

in_Handler

const gchar * (FIXME, generate documentation)

 

in_UserActionTime

gint64 (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatch_operation_implement_handle_with_time ()

void
tp_svc_channel_dispatch_operation_implement_handle_with_time
                               (TpSvcChannelDispatchOperationClass *klass,
                                tp_svc_channel_dispatch_operation_handle_with_time_impl impl);

Register an implementation for the HandleWithTime method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the HandleWithTime D-Bus method

 

tp_svc_channel_dispatch_operation_return_from_handle_with_time ()

void
tp_svc_channel_dispatch_operation_return_from_handle_with_time
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_dispatch_operation_emit_channel_lost ()

void
tp_svc_channel_dispatch_operation_emit_channel_lost
                               (gpointer instance,
                                const gchar *arg_Channel,
                                const gchar *arg_Error,
                                const gchar *arg_Message);

Type-safe wrapper around g_signal_emit to emit the ChannelLost signal on interface org.freedesktop.Telepathy.ChannelDispatchOperation.

Parameters

instance

The object implementing this interface

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatch_operation_emit_finished ()

void
tp_svc_channel_dispatch_operation_emit_finished
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Finished signal on interface org.freedesktop.Telepathy.ChannelDispatchOperation.

Parameters

instance

The object implementing this interface

 

Types and Values

TpSvcChannelDispatchOperation

typedef struct _TpSvcChannelDispatchOperation TpSvcChannelDispatchOperation;

Dummy typedef representing any implementation of this interface.


TpSvcChannelDispatchOperationClass

typedef struct _TpSvcChannelDispatchOperationClass TpSvcChannelDispatchOperationClass;

The class of TpSvcChannelDispatchOperation.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_dispatch_operation (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_dispatch_operation_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (handle_with);
  IMPLEMENT (claim);
  IMPLEMENT (handle_with_time);
#undef IMPLEMENT
}

Signal Details

The “channel-lost” signal

void
user_function (TpSvcChannelDispatchOperation *self,
               DBusGObjectPath               *arg_Channel,
               gchar                         *arg_Error,
               gchar                         *arg_Message,
               gpointer                       user_data)

The ChannelLost D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Channel

const gchar * (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “finished” signal

void
user_function (TpSvcChannelDispatchOperation *self,
               gpointer                       user_data)

The Finished D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-call-content.html0000644000175000017500000011513514006623344023455 00000000000000 TpCallContent: telepathy-glib API Reference Manual

TpCallContent

TpCallContent — proxy object for a call content

Properties

TpCallChannel * channel Read / Write / Construct Only
TpConnection * connection Read / Write / Construct Only
guint disposition Read
guint media-type Read
gchar * name Read
GPtrArray * streams Read

Signals

void removed Run Last
void streams-added Run Last
void streams-removed Run Last

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpCallContent

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpCallContent is a sub-class of TpProxy providing convenient API to represent TpCallChannel's content.

Functions

tp_call_content_init_known_interfaces ()

void
tp_call_content_init_known_interfaces (void);

Ensure that the known interfaces for TpCallContent have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CALL_CONTENT.

Since: 0.17.5


tp_call_content_get_disposition ()

TpCallContentDisposition
tp_call_content_get_disposition (TpCallContent *self);

Parameters

self

a TpCallContent

 

Returns

the value of “disposition”

Since: 0.17.5


tp_call_content_get_media_type ()

TpMediaStreamType
tp_call_content_get_media_type (TpCallContent *self);

Parameters

self

a TpCallContent

 

Returns

the value of “name”

Since: 0.17.5


tp_call_content_get_name ()

const gchar *
tp_call_content_get_name (TpCallContent *self);

Parameters

self

a TpCallContent

 

Returns

the value of “name”

Since: 0.17.5


tp_call_content_get_streams ()

GPtrArray *
tp_call_content_get_streams (TpCallContent *self);

Parameters

self

a TpCallContent

 

Returns

the value of “streams”.

[transfer none][type GLib.PtrArray][element-type TelepathyGLib.CallStream]

Since: 0.17.5


tp_call_content_remove_async ()

void
tp_call_content_remove_async (TpCallContent *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Remove the content from the call. This will cause “removed” to be emitted.

Parameters

self

a TpCallContent

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_content_remove_finish ()

gboolean
tp_call_content_remove_finish (TpCallContent *self,
                               GAsyncResult *result,
                               GError **error);

Finishes tp_call_content_remove_async().

Parameters

self

a TpCallContent

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_content_send_tones_async ()

void
tp_call_content_send_tones_async (TpCallContent *self,
                                  const gchar *tones,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Send tones DTMF code on self content. self must have the TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface.

If DTMF tones are already being played, this request is queued.

Parameters

self

a TpCallContent

 

tones

a string representation of one or more DTMF events.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_content_send_tones_finish ()

gboolean
tp_call_content_send_tones_finish (TpCallContent *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_call_content_send_tones_async().

Parameters

self

a TpCallContent

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.17.5

Types and Values

TpCallContent

typedef struct _TpCallContent TpCallContent;

Data structure representing a TpCallContent.

Since: 0.17.5


struct TpCallContentClass

struct TpCallContentClass {
};

The class of a TpCallContent.

Since: 0.17.5


TP_CALL_CONTENT_FEATURE_CORE

#define             TP_CALL_CONTENT_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpCallContent.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to trigger the callback.

Property Details

The “channel” property

  “channel”                  TpCallChannel *

The parent TpCallChannel of the content.

Owner: TpCallContent

Flags: Read / Write / Construct Only

Since: 0.17.6


The “connection” property

  “connection”               TpConnection *

The TpConnection of the call.

Owner: TpCallContent

Flags: Read / Write / Construct Only

Since: 0.17.5


The “disposition” property

  “disposition”              guint

The disposition of this content, from TpCallContentDisposition.

Owner: TpCallContent

Flags: Read

Default value: 0

Since: 0.17.5


The “media-type” property

  “media-type”               guint

The media type of this content, from TpMediaStreamType.

Owner: TpCallContent

Flags: Read

Default value: 0

Since: 0.17.5


The “name” property

  “name”                     gchar *

The name of this content.

Owner: TpCallContent

Flags: Read

Default value: ""

Since: 0.17.5


The “streams” property

  “streams”                  GPtrArray *

GPtrArray of TpCallStream objects. The list of stream objects that are part of this content.

It is NOT guaranteed that TP_CALL_STREAM_FEATURE_CORE is prepared on those objects.

Owner: TpCallContent

Flags: Read

Since: 0.17.5

Signal Details

The “removed” signal

void
user_function (TpCallContent *self,
               gpointer       user_data)

The ::removed signal is emitted when self is removed from a TpCallChannel.

Parameters

self

the TpCallContent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “streams-added” signal

void
user_function (TpCallContent *self,
               GPtrArray     *streams,
               gpointer       user_data)

The ::streams-added signal is emitted whenever TpCallStream are added to self .

It is NOT guaranteed that TP_CALL_STREAM_FEATURE_CORE is prepared on stream objects.

Parameters

self

the TpCallContent

 

streams

a GPtrArray of newly added TpCallStream.

[type GLib.PtrArray][element-type TelepathyGLib.CallStream]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “streams-removed” signal

void
user_function (TpCallContent     *self,
               GPtrArray         *streams,
               TpCallStateReason *reason,
               gpointer           user_data)

The ::streams-removed signal is emitted whenever TpCallStreams are removed from self .

It is NOT guaranteed that TP_CALL_STREAM_FEATURE_CORE is prepared on stream objects.

Parameters

self

the TpCallContent

 

streams

a GPtrArray of newly removed TpCallStream.

[type GLib.PtrArray][element-type TelepathyGLib.CallStream]

reason

a TpCallStateReason

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-proxy-tp-properties.html0000644000175000017500000015773214006623344025077 00000000000000 TpProxy Telepathy Properties: telepathy-glib API Reference Manual

TpProxy Telepathy Properties

TpProxy Telepathy Properties — The Telepathy Properties interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

As well as TpProxy, proxy.h includes auto-generated client wrappers for the Telepathy Properties interface, which can be implemented by any type of object.

The Telepathy Properties interface should not be confused with the D-Bus core Properties interface.

Functions

tp_cli_properties_interface_callback_for_get_properties ()

void
(*tp_cli_properties_interface_callback_for_get_properties)
                               (TpProxy *proxy,
                                const GPtrArray *out_Values,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetProperties method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Values

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of structs containing:</p> <ul> <li>integer identifiers</li> <li>variant boxed values</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_properties_interface_call_get_properties ()

TpProxyPendingCall *
tp_cli_properties_interface_call_get_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                const GArray *in_Properties,
                                tp_cli_properties_interface_callback_for_get_properties callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetProperties method call.

Returns an array of (identifier, value) pairs containing the current values of the given properties.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Properties

Used to pass an 'in' argument: An array of property identifiers

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_properties_interface_run_get_properties ()

gboolean
tp_cli_properties_interface_run_get_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                const GArray *in_Properties,
                                GPtrArray **out_Values,
                                GError **error,
                                GMainLoop **loop);

tp_cli_properties_interface_run_get_properties is deprecated and should not be used in newly-written code.

Call the method GetProperties and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns an array of (identifier, value) pairs containing the current values of the given properties.

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Properties

Used to pass an 'in' argument: An array of property identifiers

 

out_Values

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of structs containing:</p> <ul> <li>integer identifiers</li> <li>variant boxed values</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_properties_interface_callback_for_list_properties ()

void
(*tp_cli_properties_interface_callback_for_list_properties)
                               (TpProxy *proxy,
                                const GPtrArray *out_Available_Properties,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListProperties method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Available_Properties

Used to return an 'out' argument if error is NULL: An array of structs containing: <ul> <li>an integer identifier</li> <li>a string property name</li> <li>a string representing the D-Bus signature of this property</li> <li>a bitwise OR of the flags applicable to this property</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_properties_interface_call_list_properties ()

TpProxyPendingCall *
tp_cli_properties_interface_call_list_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                tp_cli_properties_interface_callback_for_list_properties callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListProperties method call.

Returns a dictionary of the properties available on this channel.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_properties_interface_run_list_properties ()

gboolean
tp_cli_properties_interface_run_list_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                GPtrArray **out_Available_Properties,
                                GError **error,
                                GMainLoop **loop);

tp_cli_properties_interface_run_list_properties is deprecated and should not be used in newly-written code.

Call the method ListProperties and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns a dictionary of the properties available on this channel.

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Available_Properties

Used to return an 'out' argument if TRUE is returned: An array of structs containing: <ul> <li>an integer identifier</li> <li>a string property name</li> <li>a string representing the D-Bus signature of this property</li> <li>a bitwise OR of the flags applicable to this property</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_properties_interface_callback_for_set_properties ()

void
(*tp_cli_properties_interface_callback_for_set_properties)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetProperties method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_properties_interface_call_set_properties ()

TpProxyPendingCall *
tp_cli_properties_interface_call_set_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Properties,
                                tp_cli_properties_interface_callback_for_set_properties callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetProperties method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Takes an array of (identifier, value) pairs containing desired values to set the given properties. In the case of any errors, no properties will be changed. When the changes have been acknowledged by the server, the PropertiesChanged signal will be emitted.</p> <p>All properties given must have the PROPERTY_FLAG_WRITE flag, or PermissionDenied will be returned. If any variants are of the wrong type, NotAvailable will be returned. If any given property identifiers are invalid, InvalidArgument will be returned.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Properties

Used to pass an 'in' argument: An array mapping integer property identifiers to boxed values

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_properties_interface_run_set_properties ()

gboolean
tp_cli_properties_interface_run_set_properties
                               (gpointer proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Properties,
                                GError **error,
                                GMainLoop **loop);

tp_cli_properties_interface_run_set_properties is deprecated and should not be used in newly-written code.

Call the method SetProperties and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Takes an array of (identifier, value) pairs containing desired values to set the given properties. In the case of any errors, no properties will be changed. When the changes have been acknowledged by the server, the PropertiesChanged signal will be emitted.</p> <p>All properties given must have the PROPERTY_FLAG_WRITE flag, or PermissionDenied will be returned. If any variants are of the wrong type, NotAvailable will be returned. If any given property identifiers are invalid, InvalidArgument will be returned.</p>

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Properties

Used to pass an 'in' argument: An array mapping integer property identifiers to boxed values

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_properties_interface_signal_callback_properties_changed ()

void
(*tp_cli_properties_interface_signal_callback_properties_changed)
                               (TpProxy *proxy,
                                const GPtrArray *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PropertiesChanged.

Parameters

proxy

The proxy on which tp_cli_properties_interface_connect_to_properties_changed() was called

 

arg_Properties

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of structs containing:</p> <ul> <li>integer identifiers</li> <li>variant boxed values</li> </ul> <p>The array should contain only properties whose values have actually changed.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_properties_interface_connect_to_properties_changed ()

TpProxySignalConnection *
tp_cli_properties_interface_connect_to_properties_changed
                               (gpointer proxy,
                                tp_cli_properties_interface_signal_callback_properties_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PropertiesChanged.

Emitted when the value of readable properties has changed.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_properties_interface_signal_callback_property_flags_changed ()

void
(*tp_cli_properties_interface_signal_callback_property_flags_changed)
                               (TpProxy *proxy,
                                const GPtrArray *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PropertyFlagsChanged.

Parameters

proxy

The proxy on which tp_cli_properties_interface_connect_to_property_flags_changed() was called

 

arg_Properties

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of structs containing:</p> <ul> <li>integer identifiers</li> <li>a bitwise OR of the current flags</li> </ul> <p>The array should contain only properties whose flags have actually changed.</p>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_properties_interface_connect_to_property_flags_changed ()

TpProxySignalConnection *
tp_cli_properties_interface_connect_to_property_flags_changed
                               (gpointer proxy,
                                tp_cli_properties_interface_signal_callback_property_flags_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PropertyFlagsChanged.

Emitted when the flags of some room properties have changed.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

See Also

TpProxy

telepathy-glib-0.24.2/docs/reference/html/TpMessage.html0000644000175000017500000024047014006623343020052 00000000000000 TpMessage: telepathy-glib API Reference Manual

TpMessage

TpMessage — a message in the Telepathy message interface

Types and Values

Object Hierarchy

    GObject
    ╰── TpMessage
        ├── TpClientMessage
        ├── TpCMMessage
        ╰── TpSignalledMessage

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpMessage represent a message send or received using the Message interface.

Functions

tp_message_count_parts ()

guint
tp_message_count_parts (TpMessage *self);

Parameters

self

a message

 

Returns

the number of parts in the message, including the headers in part 0

Since: 0.7.21


tp_message_dup_part ()

GVariant *
tp_message_dup_part (TpMessage *self,
                     guint part);

Parameters

self

a message

 

part

a part number

 

Returns

the current contents of the given part, or NULL if the part number is out of range.

[transfer full]

Since: 0.19.10


tp_message_peek ()

const GHashTable *
tp_message_peek (TpMessage *self,
                 guint part);

Parameters

self

a message

 

part

a part number

 

Returns

the GHashTable used to implement the given part, or NULL if the part number is out of range. The hash table is only valid as long as the message is valid and the part is not deleted.

[transfer none][element-type utf8 GObject.Value]

Since: 0.7.21


tp_message_to_text ()

gchar *
tp_message_to_text (TpMessage *message,
                    TpChannelTextMessageFlags *out_flags);

Concatene all the text parts contained in message .

Parameters

message

a TpMessage

 

out_flags

(out) : if not NULL, the TpChannelTextMessageFlags of message

 

Returns

a newly allocated string containing the text content of message.

[transfer full]

Since: 0.13.9


tp_message_get_message_type ()

TpChannelTextMessageType
tp_message_get_message_type (TpMessage *self);

Parameters

self

a message

 

Returns

the type of this message

Since: 0.13.10


tp_message_get_received_timestamp ()

gint64
tp_message_get_received_timestamp (TpMessage *self);

Return when this message was received locally, as a number of seconds since the beginning of 1970 in the UTC timezone (the same representation used by g_date_time_new_from_unix_utc(), for instance), or 0 if not known.

Parameters

self

a message

 

Returns

a Unix timestamp, or 0

Since: 0.13.9


tp_message_get_sent_timestamp ()

gint64
tp_message_get_sent_timestamp (TpMessage *self);

Return when this message was sent, as a number of seconds since the beginning of 1970 in the UTC timezone (the same representation used by g_date_time_new_from_unix_utc(), for instance), or 0 if not known.

If this protocol does not track the time at which the message was initially sent, this timestamp might be approximated by using the time at which it arrived at a central server.

Parameters

self

a message

 

Returns

a Unix timestamp, or 0

Since: 0.13.9


tp_message_get_specific_to_interface ()

const gchar *
tp_message_get_specific_to_interface (TpMessage *self);

If this message is specific to a particular D-Bus interface and should be ignored by clients without knowledge of that interface, return the name of the interface.

If this message is an ordinary message or delivery report, return NULL.

Parameters

self

a message

 

Returns

a D-Bus interface name, or NULL for ordinary messages and delivery reports.

[transfer none]

Since: 0.13.9


tp_message_get_supersedes ()

const gchar *
tp_message_get_supersedes (TpMessage *self);

If this message replaces a previous message, return the value of tp_message_get_token() for that previous message. Otherwise, return NULL.

For instance, a user interface could replace the superseded message with this message, or grey out the superseded message.

Parameters

self

a message

 

Returns

a non-empty opaque identifier, or NULL if none.

[transfer none]

Since: 0.13.9


tp_message_get_token ()

const gchar *
tp_message_get_token (TpMessage *self);

Return this message's identifier in the underlying protocol. This is not guaranteed to be unique, even within the scope of a single channel or contact: the only guarantee made is that two messages with different non-empty tokens are different messages.

If there is no suitable token, return NULL.

Parameters

self

a message

 

Returns

a non-empty opaque identifier, or NULL if none.

[transfer none]

Since: 0.13.9


tp_message_is_delivery_report ()

gboolean
tp_message_is_delivery_report (TpMessage *self);

If this message is a delivery report indicating success or failure of delivering a message, return TRUE.

Parameters

self

a message

 

Returns

TRUE if this is a delivery report

Since: 0.13.9


tp_message_is_rescued ()

gboolean
tp_message_is_rescued (TpMessage *self);

Returns TRUE if this incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (in which the message now appears) to open.

Loggers should check this flag to avoid duplicating messages, for instance.

Parameters

self

a message

 

Returns

TRUE if this message was seen in a previous Channel on this Connection

Since: 0.13.9


tp_message_is_scrollback ()

gboolean
tp_message_is_scrollback (TpMessage *self);

Parameters

self

a message

 

Returns

TRUE if this message is part of a replay of message history, for instance in an XMPP chatroom.

Since: 0.13.9


tp_message_get_pending_message_id ()

guint32
tp_message_get_pending_message_id (TpMessage *self,
                                   gboolean *valid);

Return the incoming message ID of self . Only incoming messages have such ID, for outgoing ones this function returns 0 and set valid to FALSE.

Parameters

self

a message

 

valid

either NULL, or a location in which to store TRUE if self contains a pending message ID.

[out]

Returns

the incoming message ID.

Since: 0.15.3


tp_message_is_mutable ()

gboolean
tp_message_is_mutable (TpMessage *self);

Check if self is mutable. Only mutable messages can be modified using functions such as tp_message_set_string().

Parameters

self

a TpMessage

 

Returns

TRUE if the message is mutable.

Since: 0.13.9


tp_message_append_part ()

guint
tp_message_append_part (TpMessage *self);

Append a body part to the message.

Parameters

self

a message

 

Returns

the part number

Since: 0.7.21


tp_message_delete_key ()

gboolean
tp_message_delete_key (TpMessage *self,
                       guint part,
                       const gchar *key);

Remove the given key and its value from the given part.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

Returns

TRUE if the key previously existed

Since: 0.7.21


tp_message_delete_part ()

void
tp_message_delete_part (TpMessage *self,
                        guint part);

Delete the given body part from the message.

Parameters

self

a message

 

part

a part number, which must be strictly greater than 0, and strictly less than the number returned by tp_message_count_parts()

 

Since: 0.7.21


tp_message_set ()

void
tp_message_set (TpMessage *self,
                guint part,
                const gchar *key,
                const GValue *source);

Set key in part part of self to have a copy of source as its value.

If source represents a data structure containing handles, they should all be referenced with tp_message_ref_handle() first.

In high-level language bindings, use tp_message_set_variant() instead.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

source

a value, encoded as dbus-glib would

 

Since: 0.7.21


tp_message_set_variant ()

void
tp_message_set_variant (TpMessage *self,
                        guint part,
                        const gchar *key,
                        GVariant *value);

Set key in part part of self to have value as its value.

If value is a floating reference (see g_variant_ref_sink()), then this function will take ownership of it.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

value

a value

 

Since: 0.19.10


tp_message_set_boolean ()

void
tp_message_set_boolean (TpMessage *self,
                        guint part,
                        const gchar *key,
                        gboolean b);

Set key in part part of self to have b as a boolean value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

b

a boolean value

 

Since: 0.7.21


tp_message_set_bytes ()

void
tp_message_set_bytes (TpMessage *self,
                      guint part,
                      const gchar *key,
                      guint len,
                      gconstpointer bytes);

Set key in part part of self to have bytes as a byte-array value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

len

a number of bytes

 

bytes

an array of len bytes

 

Since: 0.7.21


tp_message_set_int16()

#define             tp_message_set_int16(s, p, k, i)

Set key in part part of self to have i as a signed integer value.

Parameters

s

a message

 

p

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

k

a key in the mapping representing the part

 

i

an integer value

 

Since: 0.7.21


tp_message_set_int32 ()

void
tp_message_set_int32 (TpMessage *self,
                      guint part,
                      const gchar *key,
                      gint32 i);

Set key in part part of self to have i as a signed integer value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

i

an integer value

 

Since: 0.7.21


tp_message_set_int64 ()

void
tp_message_set_int64 (TpMessage *self,
                      guint part,
                      const gchar *key,
                      gint64 i);

Set key in part part of self to have i as a signed integer value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

i

an integer value

 

Since: 0.7.21


tp_message_set_string ()

void
tp_message_set_string (TpMessage *self,
                       guint part,
                       const gchar *key,
                       const gchar *s);

Set key in part part of self to have s as a string value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

s

a string value

 

Since: 0.7.21


tp_message_set_string_printf ()

void
tp_message_set_string_printf (TpMessage *self,
                              guint part,
                              const gchar *key,
                              const gchar *fmt,
                              ...);

Set key in part part of self to have a string value constructed from a printf-style format string.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

fmt

a printf-style format string for the string value

 

...

arguments for the format string

 

Since: 0.7.21


tp_message_set_uint16()

#define             tp_message_set_uint16(s, p, k, u)

Set key in part part of self to have u as an unsigned integer value.

Parameters

s

a message

 

p

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

k

a key in the mapping representing the part

 

u

an unsigned integer value

 

Since: 0.7.21


tp_message_set_uint32 ()

void
tp_message_set_uint32 (TpMessage *self,
                       guint part,
                       const gchar *key,
                       guint32 u);

Set key in part part of self to have u as an unsigned integer value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

u

an unsigned integer value

 

Since: 0.7.21


tp_message_set_uint64 ()

void
tp_message_set_uint64 (TpMessage *self,
                       guint part,
                       const gchar *key,
                       guint64 u);

Set key in part part of self to have u as an unsigned integer value.

Parameters

self

a message

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

u

an unsigned integer value

 

Since: 0.7.21


tp_message_new ()

TpMessage *
tp_message_new (TpBaseConnection *connection,
                guint initial_parts,
                guint size_hint);

tp_message_new is deprecated and should not be used in newly-written code.

since 0.13.9. Use tp_cm_message_new()

Parameters

connection

a connection on which to reference handles

 

initial_parts

number of parts to create (at least 1)

 

size_hint

preallocate space for this many parts (at least initial_parts )

 

Returns

a newly allocated message suitable to be passed to tp_message_mixin_take_received()

Since: 0.7.21


tp_message_destroy ()

void
tp_message_destroy (TpMessage *self);

Since 0.13.9 this function is a simple wrapper around g_object_unref()

Parameters

self

a message

 

Since: 0.7.21


tp_message_ref_handle ()

void
tp_message_ref_handle (TpMessage *self,
                       TpHandleType handle_type,
                       TpHandle handle);

tp_message_ref_handle is deprecated and should not be used in newly-written code.

since 0.13.9. Handles are now immortal so there is no point to ref them. Furthermore, the only handle that should be stored in a TpMessage is message-sender which should be set using tp_cm_message_set_sender().

Reference the given handle until this message is destroyed.

Parameters

self

a message

 

handle_type

a handle type, greater than TP_HANDLE_TYPE_NONE and less than TP_NUM_HANDLE_TYPES

 

handle

a handle of the given type

 

Since: 0.7.21


tp_message_set_handle ()

void
tp_message_set_handle (TpMessage *self,
                       guint part,
                       const gchar *key,
                       TpHandleType handle_type,
                       TpHandle handle_or_0);

tp_message_set_handle is deprecated and should not be used in newly-written code.

since 0.13.9. Use tp_cm_message_set_sender()

If handle_or_0 is not zero, reference it with tp_message_ref_handle().

Set key in part part of self to have handle_or_0 as an unsigned integer value.

Since 0.13.9 this function has been deprecated in favor or tp_cm_message_set_sender() as 'message-sender' is the only handle you can put in a TpCMMessage.

Parameters

self

a TpCMMessage

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

handle_type

a handle type

 

handle_or_0

a handle of that type, or 0

 

Since: 0.7.21


tp_message_take_message ()

void
tp_message_take_message (TpMessage *self,
                         guint part,
                         const gchar *key,
                         TpMessage *message);

tp_message_take_message is deprecated and should not be used in newly-written code.

since 0.13.9. Use tp_cm_message_take_message()

Set key in part part of self to have message as an aa{sv} value (that is, an array of Message_Part), and take ownership of message . The caller should not use message after passing it to this function. All handle references owned by message will subsequently belong to and be released with self .

Parameters

self

a TpCMMessage

 

part

a part number, which must be strictly less than the number returned by tp_message_count_parts()

 

key

a key in the mapping representing the part

 

message

another (distinct) message created for the same TpBaseConnection

 

Since: 0.7.21

Types and Values

TpMessage

typedef struct _TpMessage TpMessage;

Opaque structure representing a message in the Telepathy messages interface (an array of at least one mapping from string to variant, where the first mapping contains message headers and subsequent mappings contain the message body).

This base class provides convenience API for most of the common keys that can appear in the header. One notable exception is the sender of the message. Inside a connection manager, messages are represented by the TpCMMessage subclass, and you should use tp_cm_message_get_sender(). When composing a message in a client using TpClientMessage, messages do not have an explicit sender (the sender is automatically the local user). When a client sees a sent or received message signalled by the connection manager (represented by TpSignalledMessage), the message's sender (if any) can be accessed with tp_signalled_message_get_sender().

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-tube.html0000644000175000017500000031335414006623344023442 00000000000000 Tube channels: telepathy-glib API Reference Manual

Tube channels

Tube channels — client-side wrappers for the Tube channel interface, StreamTube channel type and DBusTube channel type.

Functions

TpProxySignalConnection * tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed ()
void (*tp_cli_channel_interface_tube_signal_callback_tube_channel_state_changed) ()
gboolean tp_cli_channel_type_stream_tube_run_offer ()
gboolean tp_cli_channel_type_stream_tube_run_accept ()
TpProxyPendingCall * tp_cli_channel_type_stream_tube_call_offer ()
TpProxyPendingCall * tp_cli_channel_type_stream_tube_call_accept ()
void (*tp_cli_channel_type_stream_tube_callback_for_offer) ()
void (*tp_cli_channel_type_stream_tube_callback_for_accept) ()
TpProxySignalConnection * tp_cli_channel_type_stream_tube_connect_to_new_remote_connection ()
TpProxySignalConnection * tp_cli_channel_type_stream_tube_connect_to_new_local_connection ()
TpProxySignalConnection * tp_cli_channel_type_stream_tube_connect_to_connection_closed ()
void (*tp_cli_channel_type_stream_tube_signal_callback_new_remote_connection) ()
void (*tp_cli_channel_type_stream_tube_signal_callback_new_local_connection) ()
void (*tp_cli_channel_type_stream_tube_signal_callback_connection_closed) ()
gboolean tp_cli_channel_type_dbus_tube_run_offer ()
gboolean tp_cli_channel_type_dbus_tube_run_accept ()
TpProxyPendingCall * tp_cli_channel_type_dbus_tube_call_offer ()
TpProxyPendingCall * tp_cli_channel_type_dbus_tube_call_accept ()
void (*tp_cli_channel_type_dbus_tube_callback_for_offer) ()
void (*tp_cli_channel_type_dbus_tube_callback_for_accept) ()
TpProxySignalConnection * tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed ()
void (*tp_cli_channel_type_dbus_tube_signal_callback_dbus_names_changed) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A "tube" is a mechanism for arbitrary data transfer. This section documents the auto-generated C wrappers for the Tube channel interface, StreamTube channel type and DBusTube channel type.

Functions

tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_tube_signal_callback_tube_channel_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TubeChannelStateChanged.

Emitted when the state of the tube channel changes. Valid state transitions are documented with <tp:type>Tube_Channel_State</tp:type>.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_tube_signal_callback_tube_channel_state_changed ()

void
(*tp_cli_channel_interface_tube_signal_callback_tube_channel_state_changed)
                               (TpChannel *proxy,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TubeChannelStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed() was called

 

arg_State

The new state of the tube. (TpTubeChannelState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_stream_tube_run_offer ()

gboolean
tp_cli_channel_type_stream_tube_run_offer
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_address_type,
                                const GValue *in_address,
                                guint in_access_control,
                                GHashTable *in_parameters,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_stream_tube_run_offer is deprecated and should not be used in newly-written code.

Call the method Offer and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Offer a stream tube exporting the local socket specified.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_address_type

Used to pass an 'in' argument: The type of the listening address of the local service, as a member of Socket_Address_Type. (TpSocketAddressType)

 

in_address

Used to pass an 'in' argument: The listening address of the local service, as indicated by the address_type.

 

in_access_control

Used to pass an 'in' argument: The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. (TpSocketAccessControl)

 

in_parameters

Used to pass an 'in' argument: The dictionary of arbitrary <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">Parameters</tp:dbus-ref> to send with the tube offer.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_stream_tube_run_accept ()

gboolean
tp_cli_channel_type_stream_tube_run_accept
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_address_type,
                                guint in_access_control,
                                const GValue *in_access_control_param,
                                GValue **out_address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_stream_tube_run_accept is deprecated and should not be used in newly-written code.

Call the method Accept and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Accept a stream tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">TubeChannelStateChanged</tp:dbus-ref> signal is emitted.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_address_type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_access_control

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The type of access control the connection manager should apply to the socket.</p> <p>Note that if you plan to establish more than one connection through the tube, the Socket_Access_Control_Port access control can't be used as you can't connect more than once from the same port.</p> (TpSocketAccessControl)

 

in_access_control_param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

out_address

Used to return an 'out' argument if TRUE is returned: The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_stream_tube_call_offer ()

TpProxyPendingCall *
tp_cli_channel_type_stream_tube_call_offer
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_address_type,
                                const GValue *in_address,
                                guint in_access_control,
                                GHashTable *in_parameters,
                                tp_cli_channel_type_stream_tube_callback_for_offer callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Offer method call.

Offer a stream tube exporting the local socket specified.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_address_type

Used to pass an 'in' argument: The type of the listening address of the local service, as a member of Socket_Address_Type. (TpSocketAddressType)

 

in_address

Used to pass an 'in' argument: The listening address of the local service, as indicated by the address_type.

 

in_access_control

Used to pass an 'in' argument: The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. (TpSocketAccessControl)

 

in_parameters

Used to pass an 'in' argument: The dictionary of arbitrary <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">Parameters</tp:dbus-ref> to send with the tube offer.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_stream_tube_call_accept ()

TpProxyPendingCall *
tp_cli_channel_type_stream_tube_call_accept
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_address_type,
                                guint in_access_control,
                                const GValue *in_access_control_param,
                                tp_cli_channel_type_stream_tube_callback_for_accept callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Accept method call.

Accept a stream tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">TubeChannelStateChanged</tp:dbus-ref> signal is emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_address_type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_access_control

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The type of access control the connection manager should apply to the socket.</p> <p>Note that if you plan to establish more than one connection through the tube, the Socket_Access_Control_Port access control can't be used as you can't connect more than once from the same port.</p> (TpSocketAccessControl)

 

in_access_control_param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_stream_tube_callback_for_offer ()

void
(*tp_cli_channel_type_stream_tube_callback_for_offer)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Offer method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_stream_tube_callback_for_accept ()

void
(*tp_cli_channel_type_stream_tube_callback_for_accept)
                               (TpChannel *proxy,
                                const GValue *out_address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Accept method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_address

Used to return an 'out' argument if error is NULL: The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_stream_tube_connect_to_new_remote_connection ()

TpProxySignalConnection *
tp_cli_channel_type_stream_tube_connect_to_new_remote_connection
                               (TpChannel *proxy,
                                tp_cli_channel_type_stream_tube_signal_callback_new_remote_connection callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewRemoteConnection.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted each time a participant opens a new connection to its socket.</p> <p>This signal is only fired on the offering side.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_stream_tube_connect_to_new_local_connection ()

TpProxySignalConnection *
tp_cli_channel_type_stream_tube_connect_to_new_local_connection
                               (TpChannel *proxy,
                                tp_cli_channel_type_stream_tube_signal_callback_new_local_connection callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewLocalConnection.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the tube application connects to the CM's socket.</p> <p>This signal is only fired on the accepting side.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_stream_tube_connect_to_connection_closed ()

TpProxySignalConnection *
tp_cli_channel_type_stream_tube_connect_to_connection_closed
                               (TpChannel *proxy,
                                tp_cli_channel_type_stream_tube_signal_callback_connection_closed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ConnectionClosed.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a connection has been closed.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_stream_tube_signal_callback_new_remote_connection ()

void
(*tp_cli_channel_type_stream_tube_signal_callback_new_remote_connection)
                               (TpChannel *proxy,
                                guint arg_Handle,
                                const GValue *arg_Connection_Param,
                                guint arg_Connection_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewRemoteConnection.

Parameters

proxy

The proxy on which tp_cli_channel_type_stream_tube_connect_to_new_remote_connection() was called

 

arg_Handle

The handle of the participant who opened the new connection (TpContactHandle)

 

arg_Connection_Param

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A parameter which can be used by the listening process to identify the connection. Note that this parameter has a meaningful value only in the Socket_Access_Control_Port and Socket_Access_Control_Credentials cases. If a different Socket_Access_Control has been chosen when offering the tube, this parameter should be ignored.</p> <p>In the Socket_Access_Control_Port case, the variant contains a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the address from which the CM is connected to the client application.</p> <p>In the Socket_Access_Control_Credentials case, the variant contains the byte (D-Bus signature 'y') that has been sent with the credentials.</p>

 

arg_Connection_ID

The unique ID associated with this connection. This ID will be used to identifiy the connection when reporting errors with <tp:member-ref>ConnectionClosed</tp:member-ref>. (TpStreamTubeConnectionID)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_stream_tube_signal_callback_new_local_connection ()

void
(*tp_cli_channel_type_stream_tube_signal_callback_new_local_connection)
                               (TpChannel *proxy,
                                guint arg_Connection_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewLocalConnection.

Parameters

proxy

The proxy on which tp_cli_channel_type_stream_tube_connect_to_new_local_connection() was called

 

arg_Connection_ID

The unique ID associated with this connection. This ID will be used to identifiy the connection when reporting errors with <tp:member-ref>ConnectionClosed</tp:member-ref>. (TpStreamTubeConnectionID)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_stream_tube_signal_callback_connection_closed ()

void
(*tp_cli_channel_type_stream_tube_signal_callback_connection_closed)
                               (TpChannel *proxy,
                                guint arg_Connection_ID,
                                const gchar *arg_Error,
                                const gchar *arg_Message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ConnectionClosed.

Parameters

proxy

The proxy on which tp_cli_channel_type_stream_tube_connect_to_connection_closed() was called

 

arg_Connection_ID

The ID of the connection. (TpStreamTubeConnectionID)

 

arg_Error

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The name of a D-Bus error describing the error that occurred.</p> <p>The following errors can be used:</p> <ul> <li><code>org.freedesktop.Telepathy.Error.Cancelled</code>: user closed the socket or the tube.</li> <li><code>org.freedesktop.Telepathy.Error.ConnectionLost</code>: the bytestream relaying connection's data has been broken.</li> <li><code>org.freedesktop.Telepathy.Error.ConnectionRefused</code>: the tube offer refused the connection.</li> </ul>

 

arg_Message

A debug message.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_dbus_tube_run_offer ()

gboolean
tp_cli_channel_type_dbus_tube_run_offer
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_parameters,
                                guint in_access_control,
                                gchar **out_address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_dbus_tube_run_offer is deprecated and should not be used in newly-written code.

Call the method Offer and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Offers a D-Bus tube providing the service specified.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_parameters

Used to pass an 'in' argument: The dictionary of arbitrary <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">Parameters</tp:dbus-ref> to send with the tube offer.

 

in_access_control

Used to pass an 'in' argument: The access control the connection manager applies to the D-Bus socket. (TpSocketAccessControl)

 

out_address

Used to return an 'out' argument if TRUE is returned: The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_dbus_tube_run_accept ()

gboolean
tp_cli_channel_type_dbus_tube_run_accept
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_access_control,
                                gchar **out_address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_dbus_tube_run_accept is deprecated and should not be used in newly-written code.

Call the method Accept and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Accept a D-Bus tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">TubeChannelStateChanged</tp:dbus-ref> signal is emitted.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_access_control

Used to pass an 'in' argument: The access control the connection manager applies to the D-Bus socket. (TpSocketAccessControl)

 

out_address

Used to return an 'out' argument if TRUE is returned: The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_dbus_tube_call_offer ()

TpProxyPendingCall *
tp_cli_channel_type_dbus_tube_call_offer
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_parameters,
                                guint in_access_control,
                                tp_cli_channel_type_dbus_tube_callback_for_offer callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Offer method call.

Offers a D-Bus tube providing the service specified.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_parameters

Used to pass an 'in' argument: The dictionary of arbitrary <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">Parameters</tp:dbus-ref> to send with the tube offer.

 

in_access_control

Used to pass an 'in' argument: The access control the connection manager applies to the D-Bus socket. (TpSocketAccessControl)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_dbus_tube_call_accept ()

TpProxyPendingCall *
tp_cli_channel_type_dbus_tube_call_accept
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_access_control,
                                tp_cli_channel_type_dbus_tube_callback_for_accept callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Accept method call.

Accept a D-Bus tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Tube">TubeChannelStateChanged</tp:dbus-ref> signal is emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_access_control

Used to pass an 'in' argument: The access control the connection manager applies to the D-Bus socket. (TpSocketAccessControl)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_dbus_tube_callback_for_offer ()

void
(*tp_cli_channel_type_dbus_tube_callback_for_offer)
                               (TpChannel *proxy,
                                const gchar *out_address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Offer method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_address

Used to return an 'out' argument if error is NULL: The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_dbus_tube_callback_for_accept ()

void
(*tp_cli_channel_type_dbus_tube_callback_for_accept)
                               (TpChannel *proxy,
                                const gchar *out_address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Accept method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_address

Used to return an 'out' argument if error is NULL: The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed ()

TpProxySignalConnection *
tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_dbus_tube_signal_callback_dbus_names_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal DBusNamesChanged.

Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a participant opens or closes the tube. This provides change notification for the <tp:member-ref>DBusNames</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_dbus_tube_signal_callback_dbus_names_changed ()

void
(*tp_cli_channel_type_dbus_tube_signal_callback_dbus_names_changed)
                               (TpChannel *proxy,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal DBusNamesChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed() was called

 

arg_Added

Array of handles and D-Bus names of new participants.

 

arg_Removed

Array of handles of former participants.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

channel-group

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-proxy.html0000644000175000017500000022511514006623344022253 00000000000000 TpProxy: telepathy-glib API Reference Manual

TpProxy

TpProxy — base class for Telepathy client proxy objects

Properties

gchar * bus-name Read / Write / Construct Only
DBusGConnection * dbus-connection Read / Write / Construct Only
TpDBusDaemon * dbus-daemon Read / Write / Construct Only
TpSimpleClientFactory * factory Read / Write / Construct Only
GStrv interfaces Read
gchar * object-path Read / Write / Construct Only

Signals

void interface-added Has Details
void invalidated Has Details

Object Hierarchy

    GEnum
    ╰── TpDBusError
    GObject
    ╰── TpProxy
        ├── TpAccount
        ├── TpAccountManager
        ├── TpChannel
        ├── TpCallContent
        ├── TpCallStream
        ├── TpChannelDispatchOperation
        ├── TpChannelDispatcher
        ├── TpChannelRequest
        ├── TpClient
        ├── TpConnection
        ├── TpConnectionManager
        ├── TpDBusDaemon
        ├── TpDebugClient
        ├── TpMediaSessionHandler
        ├── TpMediaStreamHandler
        ├── TpProtocol
        ╰── TpTLSCertificate

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpProxy is a base class for Telepathy client-side proxies, which represent an object accessed via D-Bus and provide access to its methods and signals.

Functions

TpProxyPrepareAsync ()

void
(*TpProxyPrepareAsync) (TpProxy *proxy,
                        const TpProxyFeature *feature,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Function called when feature has to be prepared for proxy .

Parameters

proxy

the object on which feature has to be prepared

 

feature

a GQuark representing the feature to prepare

 

callback

called when the feature has been prepared, or the preparation failed

 

user_data

data to pass to callback

 

TpProxyClassFeatureListFunc ()

const TpProxyFeature *
(*TpProxyClassFeatureListFunc) (TpProxyClass *cls);

A function called to list the features supported by tp_proxy_prepare_async(). Currently, only code inside telepathy-glib can implement this.

Parameters

cls

a subclass of TpProxyClass

 

Returns

an array of feature descriptions

Since: 0.11.3


tp_proxy_has_interface ()

gboolean
tp_proxy_has_interface (gpointer self,
                        const gchar *iface);

Return whether this proxy is known to have a particular interface. In versions older than 0.11.11, this was a macro wrapper around tp_proxy_has_interface_by_id().

For objects that discover their interfaces at runtime, this method will indicate that interfaces are missing until they are known to be present. In subclasses that define features for use with tp_proxy_prepare_async(), successfully preparing the "core" feature for that subclass (such as TP_CHANNEL_FEATURE_CORE or TP_CONNECTION_FEATURE_CORE) implies that the interfaces are known.

Parameters

self

the TpProxy (or subclass)

 

iface

the D-Bus interface required, as a string

 

Returns

TRUE if this proxy implements the given interface.

Since: 0.7.1


tp_proxy_has_interface_by_id ()

gboolean
tp_proxy_has_interface_by_id (gpointer self,
                              GQuark iface);

Return whether this proxy is known to have a particular interface, by its quark ID. This is equivalent to using g_quark_to_string() followed by tp_proxy_has_interface(), but more efficient.

Parameters

self

the TpProxy (or subclass)

 

iface

quark representing the D-Bus interface required

 

Returns

TRUE if this proxy implements the given interface.

Since: 0.7.1


tp_proxy_is_prepared ()

gboolean
tp_proxy_is_prepared (gpointer self,
                      GQuark feature);

Return TRUE if feature has been prepared successfully, or FALSE if feature has not been requested, has not been prepared yet, or is not available on this object at all.

(For instance, if feature is TP_CHANNEL_FEATURE_CHAT_STATES and self is a TpChannel in a protocol that doesn't actually implement chat states, or is not a TpChannel at all, then this method will return FALSE.)

To prepare features, call tp_proxy_prepare_async().

Parameters

self

an instance of a TpProxy subclass

 

feature

a feature that is supported by self 's class

 

Returns

TRUE if feature has been prepared successfully

Since: 0.11.3


tp_proxy_prepare_async ()

void
tp_proxy_prepare_async (gpointer self,
                        const GQuark *features,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

TpProxy itself does not support any features, but subclasses like TpChannel can support features, which can either be core functionality like TP_CHANNEL_FEATURE_CORE, or extended functionality like TP_CHANNEL_FEATURE_CHAT_STATES.

Proxy instances start with no features prepared. When features are requested via tp_proxy_prepare_async(), the proxy starts to do the necessary setup to use those features.

tp_proxy_prepare_async() always waits for core functionality of the proxy's class to be prepared, even if it is not specifically requested: for instance, because TP_CHANNEL_FEATURE_CORE is core functionality of a TpChannel,

1
2
3
TpChannel *channel = ...;

tp_proxy_prepare_async (channel, NULL, callback, user_data);

is equivalent to

1
2
3
4
TpChannel *channel = ...;
GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 };

tp_proxy_prepare_async (channel, features, callback, user_data);

If a feature represents core functionality (like TP_CHANNEL_FEATURE_CORE), failure to prepare it will result in tp_proxy_prepare_async() finishing unsuccessfully: if failure to prepare the feature indicates that the proxy is no longer useful, it will also emit “invalidated”.

If a feature represents non-essential functionality (like TP_CHANNEL_FEATURE_CHAT_STATES), or is not supported by the object at all, then failure to prepare it is not fatal: tp_proxy_prepare_async() will complete successfully, but tp_proxy_is_prepared() will still return FALSE for the feature, and accessor methods for the feature will typically return a dummy value.

Some TpProxy subclasses automatically start to prepare their core features when instantiated, and features will sometimes become prepared as a side-effect of other actions, but to ensure that a feature is present you must generally call tp_proxy_prepare_async() and wait for the result.

Parameters

self

an instance of a TpProxy subclass

 

features

an array of desired features, ending with 0; NULL is equivalent to an array containing only 0.

[transfer none][array zero-terminated=1][allow-none]

callback

if not NULL, called exactly once, when the features have all been prepared or failed to prepare, or after the proxy is invalidated

 

user_data

user data for callback

 

Since: 0.11.3


tp_proxy_prepare_finish ()

gboolean
tp_proxy_prepare_finish (gpointer self,
                         GAsyncResult *result,
                         GError **error);

Check for error in a call to tp_proxy_prepare_async(). An error here generally indicates that either the asynchronous call was cancelled, or self has emitted “invalidated”.

Parameters

self

an instance of a TpProxy subclass

 

result

the result passed to the callback of tp_proxy_prepare_async()

 

error

used to return an error if FALSE is returned

 

Returns

FALSE (setting error ) if tp_proxy_prepare_async() failed or was cancelled

Since: 0.11.3


tp_proxy_pending_call_cancel ()

void
tp_proxy_pending_call_cancel (TpProxyPendingCall *pc);

Cancel the given pending call. After this function returns, you must not assume that the pending call remains valid, but you must not explicitly free it either.

Parameters

pc

a pending call

 

Since: 0.7.1


tp_proxy_signal_connection_disconnect ()

void
tp_proxy_signal_connection_disconnect (TpProxySignalConnection *sc);

Disconnect the given signal connection. After this function returns, you must not assume that the signal connection remains valid, but you must not explicitly free it either.

It is not safe to call this function if sc has been disconnected already, which happens in each of these situations:

  • the weak_object used when sc was created has been destroyed
  • tp_proxy_signal_connection_disconnect has already been used
  • the proxy has been invalidated

Parameters

sc

a signal connection

 

Since: 0.7.1


tp_proxy_get_factory ()

TpSimpleClientFactory *
tp_proxy_get_factory (gpointer self);

Parameters

self

a TpProxy or subclass

 

Returns

the same value as “factory” property.

[transfer none]

Since: 0.15.5


tp_proxy_get_dbus_daemon ()

TpDBusDaemon *
tp_proxy_get_dbus_daemon (gpointer self);

Parameters

self

a TpProxy or subclass

 

Returns

a borrowed reference to the TpDBusDaemon for this object, if any; always NULL if this object is itself a TpDBusDaemon. The caller must reference the returned object with g_object_ref() if it will be kept.

[transfer none]

Since: 0.7.17


tp_proxy_get_dbus_connection ()

DBusGConnection *
tp_proxy_get_dbus_connection (gpointer self);

[skip]

Parameters

self

a TpProxy or subclass

 

Returns

a borrowed reference to the D-Bus connection used by this object. The caller must reference the returned pointer with dbus_g_connection_ref() if it will be kept.

Since: 0.7.17


tp_proxy_get_bus_name ()

const gchar *
tp_proxy_get_bus_name (gpointer self);

Parameters

self

a TpProxy or subclass

 

Returns

the bus name of the application exporting the object. The caller must copy the string with g_strdup() if it will be kept.

Since: 0.7.17


tp_proxy_get_object_path ()

const gchar *
tp_proxy_get_object_path (gpointer self);

Parameters

self

a TpProxy or subclass

 

Returns

the object path of the remote object. The caller must copy the string with g_strdup() if it will be kept.

Since: 0.7.17


tp_proxy_get_invalidated ()

const GError *
tp_proxy_get_invalidated (gpointer self);

Parameters

self

a TpProxy or subclass

 

Returns

the reason this proxy was invalidated, or NULL if has not been invalidated. The caller must copy the error, for instance with g_error_copy(), if it will be kept.

Since: 0.7.17


tp_proxy_dbus_error_to_gerror ()

void
tp_proxy_dbus_error_to_gerror (gpointer self,
                               const char *dbus_error,
                               const char *debug_message,
                               GError **error);

Convert a D-Bus error name into a GError as if it was returned by a method on this proxy. This method is useful when D-Bus error names are emitted in signals, such as Connection.ConnectionError and Group.MembersChangedDetailed.

Parameters

self

a TpProxy or subclass

 

dbus_error

a D-Bus error name, for instance from the callback for tp_cli_connection_connect_to_connection_error()

 

debug_message

a debug message that accompanied the error name, or NULL

 

error

used to return the corresponding GError

 

Since: 0.7.24

Types and Values

struct TpProxy

struct TpProxy;

Structure representing a Telepathy client-side proxy.

Since: 0.7.1


struct TpProxyFeature

struct TpProxyFeature {
    GQuark name;
    gboolean core;

    TpProxyPrepareAsync prepare_async;
    TpProxyPrepareAsync prepare_before_signalling_connected_async;

    const GQuark *interfaces_needed;
    /* Features we depend on */
    const GQuark *depends_on;

    gboolean can_retry;
};

Structure representing a feature.

Members

GQuark name;

a GQuark representing the name of the feature

 

gboolean core;

if TRUE, every non-core feature of the class depends on this one, and every feature (core or not) in subclasses depends on this one

 

TpProxyPrepareAsync prepare_async;

called when the feature has to be prepared

 

TpProxyPrepareAsync prepare_before_signalling_connected_async;

only relevant for TpConnection sub-classes; same as prepare_async but for features wanting to have a chance to prepare themself before the TpConnection object announce its TP_CONNECTION_STATUS_CONNECTED status

 

const GQuark *interfaces_needed;

an array of GQuark representing interfaces which have to be implemented on the object in order to be able to prepare the feature

 

const GQuark *depends_on;

an array of GQuark representing other features which have to be prepared before trying to prepare this feature

 

gboolean can_retry;

If TRUE, allow retrying preparation of this feature even if it failed once already; if FALSE any attempt of preparing the feature after the preparation already failed once will immediately fail with re-calling prepare_async

 

Since: 0.11.3


struct TpProxyClass

struct TpProxyClass {
    GObjectClass parent_class;

    GQuark interface;

    unsigned int must_have_unique_name:1;
};

The class of a TpProxy. The struct fields not documented here are reserved.

Members

GObjectClass parent_class;

The parent class structure

 

GQuark interface;

If set non-zero by a subclass, TpProxy will automatically add this interface in its constructor

 

unsigned int must_have_unique_name :1;

If set TRUE by a subclass, the TpProxy constructor will fail if a well-known bus name is given

 

Since: 0.7.1


TpProxyPendingCall

typedef struct _TpProxyPendingCall TpProxyPendingCall;

Opaque structure representing a pending D-Bus call.

Since: 0.7.1


TpProxySignalConnection

typedef struct _TpProxySignalConnection TpProxySignalConnection;

Opaque structure representing a D-Bus signal connection.

Since: 0.7.1


TP_DBUS_ERRORS

#define TP_DBUS_ERRORS (tp_dbus_errors_quark ())

GError domain representing D-Bus errors not directly related to Telepathy, for use by TpProxy. The code in a GError with this domain must be a member of TpDBusError.

This macro expands to a function call returning a GQuark.

Since: 0.7.1


enum TpDBusError

GError codes for use with the TP_DBUS_ERRORS domain.

Since 0.11.5, there is a corresponding GEnumClass type, TP_TYPE_DBUS_ERROR.

Members

TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR

Raised if the error raised by a remote D-Bus object is not recognised

 

TP_DBUS_ERROR_PROXY_UNREFERENCED

Emitted in “invalidated” when the TpProxy has lost its last reference

 

TP_DBUS_ERROR_NO_INTERFACE

Raised by TpProxy methods if the remote object does not appear to have the required interface

 

TP_DBUS_ERROR_NAME_OWNER_LOST

Emitted in “invalidated” if the remote process loses ownership of its bus name, and raised by any TpProxy methods that have not had a reply at that time or are called after the proxy becomes invalid in this way (usually meaning it crashed)

 

TP_DBUS_ERROR_INVALID_BUS_NAME

Raised if a D-Bus bus name given is not valid, or is of an unacceptable type (e.g. well-known vs. unique)

 

TP_DBUS_ERROR_INVALID_INTERFACE_NAME

Raised if a D-Bus interface or error name given is not valid

 

TP_DBUS_ERROR_INVALID_OBJECT_PATH

Raised if a D-Bus object path given is not valid

 

TP_DBUS_ERROR_INVALID_MEMBER_NAME

Raised if a D-Bus method or signal name given is not valid

 

TP_DBUS_ERROR_OBJECT_REMOVED

A generic error which can be used with “invalidated” to indicate an application-specific indication that the remote object no longer exists, if no more specific error is available.

 

TP_DBUS_ERROR_CANCELLED

Raised from calls that re-enter the main loop (*_run_*) if they are cancelled

 

TP_DBUS_ERROR_INCONSISTENT

Raised if information received from a remote object is inconsistent or otherwise obviously wrong (added in 0.7.17). See also TP_ERROR_CONFUSED.

 

Since: 0.7.1


NUM_TP_DBUS_ERRORS

#define NUM_TP_DBUS_ERRORS TP_NUM_DBUS_ERRORS

1 more than the highest valid TpDBusError at the time of compilation. In new code, use TP_NUM_DBUS_ERRORS instead.

Since: 0.7.1


TP_NUM_DBUS_ERRORS

#define TP_NUM_DBUS_ERRORS (TP_DBUS_ERROR_INCONSISTENT + 1)

1 more than the highest valid TpDBusError at the time of compilation

Since: 0.19.0


TP_TYPE_DBUS_ERROR

#define TP_TYPE_DBUS_ERROR (tp_dbus_error_get_type ())

The GEnumClass type of a TpDBusError.

Since: 0.11.5

Property Details

The “bus-name” property

  “bus-name”                 gchar *

The D-Bus bus name for this object. Read-only except during construction.

Owner: TpProxy

Flags: Read / Write / Construct Only

Default value: NULL


The “dbus-connection” property

  “dbus-connection”          DBusGConnection *

The D-Bus connection for this object. Read-only except during construction.

[skip]

Owner: TpProxy

Flags: Read / Write / Construct Only


The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

The D-Bus daemon for this object (this object itself, if it is a TpDBusDaemon). Read-only except during construction.

Owner: TpProxy

Flags: Read / Write / Construct Only


The “factory” property

  “factory”                  TpSimpleClientFactory *

The TpSimpleClientFactory used to create this proxy, or NULL if this proxy was not created through a factory.

Owner: TpProxy

Flags: Read / Write / Construct Only


The “interfaces” property

  “interfaces”               GStrv

Known D-Bus interface names for this object.

Owner: TpProxy

Flags: Read


The “object-path” property

  “object-path”              gchar *

The D-Bus object path for this object. Read-only except during construction.

Owner: TpProxy

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “interface-added” signal

void
user_function (TpProxy    *self,
               guint       id,
               DBusGProxy *proxy,
               gpointer    user_data)

Emitted when this proxy has gained an interface. It is not guaranteed to be emitted immediately, but will be emitted before the interface is first used (at the latest: before it's returned from tp_proxy_get_interface_by_id(), any signal is connected, or any method is called).

The intended use is to call dbus_g_proxy_add_signals(). This signal should only be used by TpProy implementations

[skip]

Parameters

self

the proxy object

 

id

the GQuark representing the interface

 

proxy

the dbus-glib proxy representing the interface

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “invalidated” signal

void
user_function (TpProxy *self,
               guint    domain,
               gint     code,
               gchar   *message,
               gpointer user_data)

Emitted when this proxy has been become invalid for whatever reason. Any more specific signal should be emitted first.

An invalidated proxy is one which can make no more method calls and will emit no more D-Bus signals. This is typically because the D-Bus object represented by the proxy ceased to exist, or there was some error obtaining the initial state.

Any pending or future method calls made on this proxy will fail gracefully with the same error as returned by tp_proxy_get_invalidated().

Parameters

self

the proxy object

 

domain

domain of a GError indicating why this proxy was invalidated

 

code

error code of a GError indicating why this proxy was invalidated

 

message

a message associated with the error

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/ch-protocol.html0000644000175000017500000000615414006623343020412 00000000000000 The Telepathy protocol: telepathy-glib API Reference Manual

The Telepathy protocol

Miscellaneous definitions — Definitions useful for working with the Telepathy protocol
TpHandle — type representing handles
Telepathy protocol interface and property names — D-Bus interface and property names from the Telepathy spec
Telepathy protocol enumerations — Enumerated types and bitfields from the Telepathy spec
Telepathy protocol errors — The errors from the Telepathy D-Bus spec, as a GLib error domain
GType factory functions — Macros using caching factory functions to get dbus-glib specialized GTypes
TpChannelIface — interface representing basic channel properties
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-contact-search-result.html0000644000175000017500000003642514006623344025310 00000000000000 TpContactSearchResult: telepathy-glib API Reference Manual

TpContactSearchResult

TpContactSearchResult — a result of a contact search

Properties

gchar * identifier Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpContactSearchResult

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpContactSearchResult objects represent results for TpContactSearch.

Functions

tp_contact_search_result_get_field ()

TpContactInfoField *
tp_contact_search_result_get_field (TpContactSearchResult *self,
                                    const gchar *field);

Parameters

self

a TpContactSearchResult

 

field

the name of the field

 

Returns

the specified field, or NULL if the result doesn't have it.

[transfer none]

Since: 0.13.11


tp_contact_search_result_get_fields ()

GList *
tp_contact_search_result_get_fields (TpContactSearchResult *self);

tp_contact_search_result_get_fields is deprecated and should not be used in newly-written code.

Since 0.19.9. New code should use tp_contact_search_result_dup_fields() instead.

Parameters

self

a search result

 

Returns

a GList of TpContactInfoField for the specified contact. You should free it when you're done with g_list_free().

[transfer container][element-type TelepathyGLib.ContactInfoField]


tp_contact_search_result_dup_fields ()

GList *
tp_contact_search_result_dup_fields (TpContactSearchResult *self);

Parameters

self

a search result

 

Returns

a GList of TpContactInfoField for the specified contact. You should free it when you're done with tp_contact_info_list_free().

[transfer full][element-type TelepathyGLib.ContactInfoField]

Since: 0.19.9


tp_contact_search_result_get_identifier ()

const gchar *
tp_contact_search_result_get_identifier
                               (TpContactSearchResult *self);

Parameters

Returns

the contact identifier.

Since: 0.13.11

Types and Values

struct TpContactSearchResult

struct TpContactSearchResult;

An object representing the results of a Telepathy contact search channel. There are no interesting public struct fields.

Since: 0.13.11


struct TpContactSearchResultClass

struct TpContactSearchResultClass {
};

The class of a TpContactSearchResult.

Since: 0.13.11

Property Details

The “identifier” property

  “identifier”               gchar *

The contact identifier.

Owner: TpContactSearchResult

Flags: Read / Write / Construct Only

Default value: NULL

See Also

TpContactSearch

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-debug.html0000644000175000017500000005055114006623344022160 00000000000000 Common debug support: telepathy-glib API Reference Manual

Common debug support

Common debug support — API to activate debugging messages from telepathy-glib

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

telepathy-glib has an internal mechanism for debug messages and filtering. Connection managers written with telepathy-glib are expected to connect this to their own debugging mechanisms: when the CM's debugging mechanism is activated, it should call tp_debug_set_flags() and/or tp_debug_set_persistent().

The supported debug-mode keywords and the debug messages that they enable are subject to change, but currently include:

Functions

tp_debug_set_flags ()

void
tp_debug_set_flags (const gchar *flags_string);

Set the debug flags indicated by flags_string , in addition to any already set.

The parsing matches that of g_parse_debug_string().

If telepathy-glib was compiled with --disable-debug (not recommended), this function has no practical effect, since the debug messages it would enable were removed at compile time.

Parameters

flags_string

The flags to set, comma-separated. If NULL or empty, no additional flags are set.

 

Since: 0.6.1


tp_debug_set_persistent ()

void
tp_debug_set_persistent (gboolean persistent);

Used to enable persistent operation of the connection manager process for debugging purposes.

Parameters

persistent

TRUE prevents the connection manager mainloop from exiting, FALSE enables exiting if there are no connections (the default behavior).

 

tp_debug_divert_messages ()

void
tp_debug_divert_messages (const gchar *filename);

Open the given file for writing and duplicate its file descriptor to be used for stdout and stderr. This has the effect of closing the previous stdout and stderr, and sending all messages that would have gone there to the given file instead.

By default the file is truncated and hence overwritten each time the process is executed. Since version 0.7.14, if the filename is prefixed with '+' then the file is not truncated and output is added at the end of the file.

Passing NULL to this function is guaranteed to have no effect. This is so you can call it with the recommended usage tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE")) and it won't do anything if the environment variable is not set.

This function still works if telepathy-glib was compiled without debug support.

Parameters

filename

A file to which to divert stdout and stderr, or NULL to do nothing

 

Since: 0.7.1


tp_debug_timestamped_log_handler ()

void
tp_debug_timestamped_log_handler (const gchar *log_domain,
                                  GLogLevelFlags log_level,
                                  const gchar *message,
                                  gpointer ignored);

A GLogFunc that prepends the UTC time (currently in ISO 8601 format, with microsecond resolution) to the message, then calls g_log_default_handler.

Intended usage is:

1
2
if (g_getenv ("MYPROG_TIMING") != NULL)
  g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL);

If telepathy-glib was compiled with --disable-debug (not recommended), this function is equivalent to g_log_default_handler().

Changed in 0.9.0: timestamps are now printed in UTC, in RFC-3339 format. Previously, they were printed in local time, in a format similar to RFC-3339.

Parameters

log_domain

the message's log domain

 

log_level

the log level of the message

 

message

the message to process

 

ignored

not used

 

Since: 0.7.1


tp_debug_set_flags_from_string ()

void
tp_debug_set_flags_from_string (const gchar *flags_string);

tp_debug_set_flags_from_string is deprecated and should not be used in newly-written code.

since 0.6.1. Use tp_debug_set_flags() and tp_debug_set_persistent() instead

Set the debug flags indicated by flags_string , in addition to any already set. Unlike tp_debug_set_flags(), this enables persistence like tp_debug_set_persistent() if the "persist" flag is present or the string is "all" - this turns out to be unhelpful, as persistence should be orthogonal.

The parsing matches that of g_parse_debug_string().

[skip]

Parameters

flags_string

The flags to set, comma-separated. If NULL or empty, no additional flags are set.

 

tp_debug_set_flags_from_env ()

void
tp_debug_set_flags_from_env (const gchar *var);

tp_debug_set_flags_from_env is deprecated and should not be used in newly-written code.

since 0.6.1. Use tp_debug_set_flags(g_getenv(...)) and tp_debug_set_persistent() instead

Equivalent to tp_debug_set_flags_from_string (g_getenv (var)), and has the same problem with persistence being included in "all".

[skip]

Parameters

var

The name of the environment variable to parse

 

tp_debug_set_all_flags ()

void
tp_debug_set_all_flags (void);

tp_debug_set_all_flags is deprecated and should not be used in newly-written code.

since 0.6.1. Use tp_debug_set_flags ("all") and tp_debug_set_persistent() instead.

Activate all possible debug modes. This also activates persistent mode, which should have been orthogonal.

[skip]

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-simple-approver.html0000644000175000017500000010341314006623344024213 00000000000000 TpSimpleApprover: telepathy-glib API Reference Manual

TpSimpleApprover

TpSimpleApprover — a subclass of TpBaseClient implementing a simple Approver

Properties

gpointer callback Write / Construct Only
gpointer destroy Write / Construct Only
gpointer user-data Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseClient
        ╰── TpSimpleApprover

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class makes it easier to construct a TpSvcClient implementing the TpSvcClientApprover interface.

A typical simple approver would look liks this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
static void
my_add_dispatch_operation (TpSimpleApprover *approver,
   TpAccount *account,
   TpConnection *connection,
   GList *channels,
   TpChannelDispatchOperation *dispatch_operation,
   TpAddDispatchOperationContext *context,
   gpointer user_data)
{
 /<!-- -->* call tp_channel_dispatch_operation_handle_with_async()
 if wanting to approve the channels *<!-- -->/

 tp_add_dispatch_operation_context_accept (context);
}

factory = tp_automatic_client_factory_new (dbus);
client = tp_simple_approver_new_with_factory (factory, "MyApprover", FALSE,
   my_add_dispatch_operation, user_data);
g_object_unref (factory);

tp_base_client_take_approver_filter (client, tp_asv_new (
     TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT,
     TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
     NULL));

tp_base_client_register (client, NULL);

See examples/client/text-approver.c for a complete example.

Functions

TpSimpleApproverAddDispatchOperationImpl ()

void
(*TpSimpleApproverAddDispatchOperationImpl)
                               (TpSimpleApprover *approver,
                                TpAccount *account,
                                TpConnection *connection,
                                GList *channels,
                                TpChannelDispatchOperation *dispatch_operation,
                                TpAddDispatchOperationContext *context,
                                gpointer user_data);

Signature of the implementation of the AddDispatchOperation method.

This function must call either tp_add_dispatch_operation_context_accept(), tp_add_dispatch_operation_context_delay() or tp_add_dispatch_operation_context_fail() on context before it returns.

Parameters

approver

a TpSimpleApprover instance

 

account

a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible

 

connection

a TpConnection having TP_CONNECTION_FEATURE_CORE prepared if possible

 

channels

a GList of TpChannel, all having TP_CHANNEL_FEATURE_CORE prepared.

[element-type TelepathyGLib.Channel]

dispatch_operation

a TpChannelDispatchOperation or NULL; the dispatch_operation is not guaranteed to be prepared.

[allow-none]

context

a TpAddDispatchOperationContext representing the context of this D-Bus call

 

user_data

arbitrary user-supplied data passed to tp_simple_approver_new()

 

Since: 0.11.5


tp_simple_approver_new ()

TpBaseClient *
tp_simple_approver_new (TpDBusDaemon *dbus,
                        const gchar *name,
                        gboolean uniquify,
                        TpSimpleApproverAddDispatchOperationImpl callback,
                        gpointer user_data,
                        GDestroyNotify destroy);

tp_simple_approver_new is deprecated and should not be used in newly-written code.

New code should use tp_simple_approver_new_with_am() instead.

Convenient function to create a new TpSimpleApprover instance.

If dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_approver_new_with_am() instead, so that TpAccount, TpConnection and TpContact instances can be shared between modules.

Parameters

dbus

a TpDBusDaemon object, may not be NULL

 

name

the name of the Approver (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when AddDispatchOperation is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleApprover is destroyed

 

Returns

a new TpSimpleApprover.

[type TelepathyGLib.SimpleApprover]

Since: 0.11.5


tp_simple_approver_new_with_am ()

TpBaseClient *
tp_simple_approver_new_with_am (TpAccountManager *account_manager,
                                const gchar *name,
                                gboolean uniquify,
                                TpSimpleApproverAddDispatchOperationImpl callback,
                                gpointer user_data,
                                GDestroyNotify destroy);

Convenient function to create a new TpSimpleApprover instance with a specified TpAccountManager.

It is not necessary to prepare any features on account_manager before calling this function.

Parameters

account_manager

an account manager, which may not be NULL

 

name

the name of the Approver (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when AddDispatchOperation is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleApprover is destroyed

 

Returns

a new TpSimpleApprover.

[type TelepathyGLib.SimpleApprover]

Since: 0.11.14


tp_simple_approver_new_with_factory ()

TpBaseClient *
tp_simple_approver_new_with_factory (TpSimpleClientFactory *factory,
                                     const gchar *name,
                                     gboolean uniquify,
                                     TpSimpleApproverAddDispatchOperationImpl callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy);

Convenient function to create a new TpSimpleApprover instance with a specified TpSimpleClientFactory.

Parameters

factory

an TpSimpleClientFactory, which may not be NULL

 

name

the name of the Approver (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when AddDispatchOperation is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleApprover is destroyed

 

Returns

a new TpSimpleApprover.

[type TelepathyGLib.SimpleApprover]

Since: 0.15.5

Types and Values

struct TpSimpleApprover

struct TpSimpleApprover;

Data structure representing a simple Approver implementation.

Since: 0.11.5

Property Details

The “callback” property

  “callback”                 gpointer

The TpSimpleApproverAddDispatchOperationImpl callback implementing the AddDispatchOperation D-Bus method.

This property can't be NULL.

Owner: TpSimpleApprover

Flags: Write / Construct Only

Since: 0.11.5


The “destroy” property

  “destroy”                  gpointer

The GDestroyNotify function called to free “user-data” when the TpSimpleApprover is destroyed.

Owner: TpSimpleApprover

Flags: Write / Construct Only

Since: 0.11.5


The “user-data” property

  “user-data”                gpointer

The user-data pointer passed to “callback”.

Owner: TpSimpleApprover

Flags: Write / Construct Only

Since: 0.11.5

telepathy-glib-0.24.2/docs/reference/html/ch-client.html0000644000175000017500000004066114006623343020030 00000000000000 Client-side proxies: telepathy-glib API Reference Manual

Client-side proxies

TpConnectionManager — proxy object for a Telepathy connection manager
TpProtocol — proxy for a Telepathy Protocol object
TpConnection — proxy object for a Telepathy connection
TpContact — object representing a contact
TpCapabilities — object representing capabilities
Connection Aliasing interface — client-side wrappers for the Aliasing interface
Connection Avatars interface — client-side wrappers for the Avatars interface
Connection Balance interface — client-side wrappers for the Balance interface
Connection ClientTypes interface — client-side wrappers for the ClientTypes interface
Connection Contacts interface — client-side wrappers for the Contacts interface
Connection ContactInfo interface — client-side wrappers for the ContactInfo interface
Connection ContactList, ContactGroups and ContactBlocking interfaces — client-side wrappers for the ContactList, ContactGroups and ContactBlocking interfaces
Connection ContactCapabilities and Capabilities interfaces — client-side wrappers for the capabilities interfaces
Connection Location interface — client-side wrappers for the Location interface
Connection Requests interface — client-side wrappers for the Requests interface
Connection SimplePresence interface — client-side wrappers for the SimplePresence interface
Connection Presence interface — client-side wrappers for the Presence interface
Connection Cellular interface — client-side wrappers for the Cellular interface
Connection MailNotification interface — client-side wrappers for the MailNotification interface
Connection PowerSaving interface — client-side wrappers for the PowerSaving interface
Connection Addressing interface — client-side wrappers for the Addressing interface
Connection Renaming interface — client-side wrappers for the Renaming interface
Connection Sidecars interface — client-side wrappers for the Sidecars interface
TpContactSearch — object for a Telepathy contact search channel
TpContactSearchResult — a result of a contact search
TpChannel — proxy object for a Telepathy channel
Group and Conference interfaces on Channels — client-side wrappers for Group and Conference
Room-related interfaces on Channels — client-side wrappers for Room, RoomConfig and Subject
Text channels — client-side wrappers for the Text channel type, and the Chat State and Password interfaces
Media channels — client-side wrappers for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces
File transfer — client-side wrappers for the File Transfer channel type
Tubes channels — client-side wrappers for the Tubes channel type
Tube channels — client-side wrappers for the Tube channel interface, StreamTube channel type and DBusTube channel type.
Room List channels — client-side wrappers for the Room List channel type
Contact Search channels — client-side wrappers for the Contact Search channel type
Channel Authentication interfaces — client-side wrappers for authentication channels
Channel Call interfaces — client-side wrappers for call channels
Channel Call content interfaces — client-side wrappers for call contents
Channel Call stream interfaces — client-side wrappers for call streams
Channel Call misc interfaces — client-side wrappers for misc call interfaces
Connection and Channel Anonymity interfaces — client-side wrappers for the Anonymity interfaces
Connection and Channel ServicePoint interfaces — client-side wrappers for the ServicePoint interfaces
TpMediaSessionHandler, TpMediaStreamHandler — proxy objects for Telepathy media streaming
TpAccountManager — proxy object for the Telepathy account manager
TpAccount — proxy object for an account in the Telepathy account manager
TpAccountRequest — object for a currently non-existent account in order to create easily without speaking fluent D-Bus
TpChannelDispatcher — proxy object for the Telepathy channel dispatcher
TpChannelDispatchOperation — proxy object for a to the Telepathy channel dispatcher
TpChannelRequest — proxy object for a request to the Telepathy channel dispatcher
TpClient — proxy object for a client of the ChannelDispatcher
TpAccountChannelRequest — Object used to request a channel from a TpAccount
TpStreamTubeChannel — proxy object for a stream tube channel
TpStreamTubeConnection — a connection on a Stream Tube
TpDBusTubeChannel — proxy object for D-Bus tube channels
TpClientChannelFactoryInterface — an interface for client channel factories
TpBasicProxyFactory — channel factory creating TpChannel objects
TpAutomaticProxyFactory — factory creating higher level proxy objects
TpSimpleClientFactory — a factory for TpContacts and plain subclasses of TpProxy
TpAutomaticClientFactory — Factory for specialized TpChannel subclasses.
TpClientMessage — a message in the Telepathy message interface, client side
TpSignalledMessage — a message received using the Telepathy message interface
TpTextChannel — proxy object for a text channel
TpFileTransferChannel — proxy object for a file transfer channel
TpCallChannel — proxy object for a call channel
TpCallContent — proxy object for a call content
TpCallStream — proxy object for a call stream
Misc Call APIs — Misc generated APISs for Call
TpDebugClient — proxy objects for Telepathy debug information
TpDebugMessage — a debug message
TpRoomList — proxy object for a room list channel
TpRoomInfo — a room found by TpRoomList
TpTLSCertificate — proxy object for a server or peer's TLS certificate
TpTLSCertificateRejection — a certificate rejection
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-call-channel.html0000644000175000017500000027131314006623343023413 00000000000000 TpCallChannel: telepathy-glib API Reference Manual

TpCallChannel

TpCallChannel — proxy object for a call channel

Properties

GPtrArray * contents Read
guint flags Read
gboolean hardware-streaming Read
guint hold-state Read
guint hold-state-reason Read
gboolean initial-audio Read
gchar * initial-audio-name Read
gboolean initial-video Read
gchar * initial-video-name Read
gboolean mutable-contents Read
guint state Read
GHashTable * state-details Read
TpCallStateReason * state-reason Read

Signals

void content-added Run Last
void content-removed Run Last
void members-changed Run Last
void state-changed Run Last

Types and Values

Object Hierarchy

    GBoxed
    ╰── TpCallStateReason
    GObject
    ╰── TpProxy
        ╰── TpChannel
            ╰── TpCallChannel

Implemented Interfaces

TpCallChannel implements TpChannelIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpCallChannel is a sub-class of TpChannel providing convenient API to make calls

Functions

tp_call_channel_get_contents ()

GPtrArray *
tp_call_channel_get_contents (TpCallChannel *self);

Parameters

self

a TpCallChannel

 

Returns

the value of “contents”.

[transfer none][type GLib.PtrArray][element-type TelepathyGLib.CallContent]

Since: 0.17.5


tp_call_channel_get_state ()

TpCallState
tp_call_channel_get_state (TpCallChannel *self,
                           TpCallFlags *flags,
                           GHashTable **details,
                           TpCallStateReason **reason);

Parameters

self

a TpCallChannel

 

flags

a place to set the value of “flags”.

[out][allow-none][transfer none]

details

a place to set the value of “state-details”.

[out][allow-none][transfer none]

reason

a place to set the value of “state-reason”.

[out][allow-none][transfer none]

Returns

the value of “state”

Since: 0.17.5


tp_call_channel_has_hardware_streaming ()

gboolean
tp_call_channel_has_hardware_streaming
                               (TpCallChannel *self);

Parameters

self

a TpCallChannel

 

Returns

the value of “hardware-streaming”

Since: 0.17.5


tp_call_channel_has_initial_audio ()

gboolean
tp_call_channel_has_initial_audio (TpCallChannel *self,
                                   const gchar **initial_audio_name);

Parameters

self

a TpCallChannel

 

initial_audio_name

a place to set the value of “initial-audio-name”.

[out][allow-none][transfer none]

Returns

the value of “initial-audio”

Since: 0.17.5


tp_call_channel_has_initial_video ()

gboolean
tp_call_channel_has_initial_video (TpCallChannel *self,
                                   const gchar **initial_video_name);

Parameters

self

a TpCallChannel

 

initial_video_name

a place to set the value of “initial-video-name”.

[out][allow-none][transfer none]

Returns

the value of “initial-video”

Since: 0.17.5


tp_call_channel_has_mutable_contents ()

gboolean
tp_call_channel_has_mutable_contents (TpCallChannel *self);

Parameters

self

a TpCallChannel

 

Returns

the value of “mutable-contents”

Since: 0.17.5


tp_call_channel_get_members ()

GHashTable *
tp_call_channel_get_members (TpCallChannel *self);

Get the members of this call.

The TpContact objects are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

a TpCallChannel

 

Returns

GHashTable mapping TpContact to its new TpCallMemberFlags.

[transfer none][type GLib.HashTable][element-type TelepathyGLib.Contact uint]

Since: 0.17.5


tp_call_channel_has_dtmf ()

gboolean
tp_call_channel_has_dtmf (TpCallChannel *self);

Whether or not self can send DTMF tones using tp_call_channel_send_tones_async(). To be able to send DTMF tones, at least one of self 's “contents” must implement TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface.

Parameters

self

a TpCallChannel

 

Returns

whether or not self can send DTMF tones.

Since: 0.17.5


tp_call_channel_has_hold ()

gboolean
tp_call_channel_has_hold (TpCallChannel *self);

Whether or not self has the TP_IFACE_CHANNEL_INTERFACE_HOLD interfaces

Parameters

self

a TpCallChannel

 

Returns

whether or not self supports Hold

Since: 0.17.6


tp_call_channel_send_tones_async ()

void
tp_call_channel_send_tones_async (TpCallChannel *self,
                                  const gchar *tones,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Send tones on every of self 's contents which have the TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface.

For more details, see tp_call_content_send_tones_async().

Parameters

self

a TpCallChannel

 

tones

a string representation of one or more DTMF events.

 

cancellable

optional GCancellable object, NULL to ignore

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_send_tones_finish ()

gboolean
tp_call_channel_send_tones_finish (TpCallChannel *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_call_channel_send_tones_async().

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since: 0.17.5


tp_call_channel_set_ringing_async ()

void
tp_call_channel_set_ringing_async (TpCallChannel *self,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Indicate that the local user has been alerted about the incoming call.

Parameters

self

a TpCallChannel

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_set_ringing_finish ()

gboolean
tp_call_channel_set_ringing_finish (TpCallChannel *self,
                                    GAsyncResult *result,
                                    GError **error);

Finishes tp_call_channel_set_ringing_async().

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_channel_set_queued_async ()

void
tp_call_channel_set_queued_async (TpCallChannel *self,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Notifies the CM that the local user is already in a call, so this call has been put in a call-waiting style queue.

Parameters

self

a TpCallChannel

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_set_queued_finish ()

gboolean
tp_call_channel_set_queued_finish (TpCallChannel *self,
                                   GAsyncResult *result,
                                   GError **error);

Finishes tp_call_channel_set_queued_async().

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_channel_accept_async ()

void
tp_call_channel_accept_async (TpCallChannel *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

For incoming calls with “state” set to TP_CALL_STATE_INITIALISED, accept the incoming call. This changes “state” to TP_CALL_STATE_ACCEPTED.

For outgoing calls with “state” set to TP_CALL_STATE_PENDING_INITIATOR, actually call the remote contact; this changes “state” to TP_CALL_STATE_INITIALISING.

Parameters

self

a TpCallChannel

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_accept_finish ()

gboolean
tp_call_channel_accept_finish (TpCallChannel *self,
                               GAsyncResult *result,
                               GError **error);

Finishes tp_call_channel_accept_async().

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_channel_hangup_async ()

void
tp_call_channel_hangup_async (TpCallChannel *self,
                              TpCallStateChangeReason reason,
                              const gchar *detailed_reason,
                              const gchar *message,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Request that the call is ended. All contents will be removed from self so that the “contents” property will be the empty list.

Parameters

self

a TpCallChannel

 

reason

a TpCallStateChangeReason

 

detailed_reason

a more specific reason for the call hangup, if one is available, or an empty or NULL string otherwise

 

message

a human-readable message to be sent to the remote contact(s)

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_hangup_finish ()

gboolean
tp_call_channel_hangup_finish (TpCallChannel *self,
                               GAsyncResult *result,
                               GError **error);

Finishes tp_call_channel_hangup_async().

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.5


tp_call_channel_add_content_async ()

void
tp_call_channel_add_content_async (TpCallChannel *self,
                                   const gchar *name,
                                   TpMediaStreamType type,
                                   TpMediaStreamDirection initial_direction,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Request that a new Content of type type is added to self . Callers should check the value of the “mutable-contents” property before trying to add another content as it might not be allowed.

Parameters

self

a TpCallChannel

 

name

the suggested name of the content to add

 

type

the media stream type of the content to be added to the call, from TpMediaStreamType

 

initial_direction

The initial direction of the content

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.5


tp_call_channel_add_content_finish ()

TpCallContent *
tp_call_channel_add_content_finish (TpCallChannel *self,
                                    GAsyncResult *result,
                                    GError **error);

Finishes tp_call_channel_add_content_async().

The returned TpCallContent is NOT guaranteed to have TP_CALL_CONTENT_FEATURE_CORE prepared.

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

reference to the new TpCallContent.

[transfer full]

Since: 0.17.5


tp_call_channel_request_hold_async ()

void
tp_call_channel_request_hold_async (TpCallChannel *self,
                                    gboolean hold,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Requests that the connection manager holds or unholds the call. Watch “hold-state” property to know when the channel goes on hold or is unheld. Unholding may fail if the streaming implementation can not obtain all the resources needed to restart the call.

Parameters

self

a TpCallChannel

 

hold

Whether to request a hold or a unhold

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since: 0.17.6


tp_call_channel_request_hold_finish ()

gboolean
tp_call_channel_request_hold_finish (TpCallChannel *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes tp_call_channel_request_hold_async

Parameters

self

a TpCallChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Since: 0.17.6

Types and Values

struct TpCallChannel

struct TpCallChannel;

Data structure representing a TpCallChannel.

Since: 0.17.5


struct TpCallChannelClass

struct TpCallChannelClass {
};

The class of a TpCallChannel.

Since: 0.17.5


TP_CALL_CHANNEL_FEATURE_CORE

#define             TP_CALL_CHANNEL_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpCallChannel.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to trigger the callback.


struct TpCallStateReason

struct TpCallStateReason {
  TpHandle actor;
  TpCallStateChangeReason reason;
  gchar *dbus_reason;
  gchar *message;
};

Data structure representing the reason for a call state change.

Members

TpHandle actor;

the contact responsible for the change, or 0 if no contact was responsible

 

TpCallStateChangeReason reason;

the reason for the change. If TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED then the actor member will dictate whether it was the local user or a remote contact responsible

 

gchar *dbus_reason;

A specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error

 

gchar *message;

A developer readable debug message giving the reason for the state change.

 

Since: 0.17.5

Property Details

The “contents” property

  “contents”                 GPtrArray *

GPtrArray of TpCallContent objects. The list of content objects that are part of this call.

It is NOT guaranteed that TP_CALL_CONTENT_FEATURE_CORE is prepared on those objects.

Owner: TpCallChannel

Flags: Read

Since: 0.17.5


The “flags” property

  “flags”                    guint

A TpCallFlags specifying the flags of the call state.

Owner: TpCallChannel

Flags: Read

Default value: 0

Since: 0.17.5


The “hardware-streaming” property

  “hardware-streaming”       gboolean

Whether or not the streaming is done by dedicated hardware.

Owner: TpCallChannel

Flags: Read

Default value: FALSE

Since: 0.17.5


The “hold-state” property

  “hold-state”               guint

A TpLocalHoldState specifying if the Call is currently held

Owner: TpCallChannel

Flags: Read

Default value: 0

Since: 0.17.6


The “hold-state-reason” property

  “hold-state-reason”        guint

A TpLocalHoldStateReason specifying why the Call is currently held.

Owner: TpCallChannel

Flags: Read

Default value: 0

Since: 0.17.6


The “initial-audio” property

  “initial-audio”            gboolean

Whether or not the Call was started with audio.

Owner: TpCallChannel

Flags: Read

Default value: FALSE

Since: 0.17.5


The “initial-audio-name” property

  “initial-audio-name”       gchar *

If “initial-audio” is set to TRUE, then this property will is the name of the intial audio content, NULL otherwise.

Owner: TpCallChannel

Flags: Read

Default value: NULL

Since: 0.17.5


The “initial-video” property

  “initial-video”            gboolean

Whether or not the Call was started with video.

Owner: TpCallChannel

Flags: Read

Default value: FALSE

Since: 0.17.5


The “initial-video-name” property

  “initial-video-name”       gchar *

If “initial-video” is set to TRUE, then this property will is the name of the intial video content, NULL otherwise.

Owner: TpCallChannel

Flags: Read

Default value: NULL

Since: 0.17.5


The “mutable-contents” property

  “mutable-contents”         gboolean

Whether or not call contents can be added or removed.

Owner: TpCallChannel

Flags: Read

Default value: FALSE

Since: 0.17.5


The “state” property

  “state”                    guint

A TpCallState specifying the state of the call.

Owner: TpCallChannel

Flags: Read

Default value: 0

Since: 0.17.5


The “state-details” property

  “state-details”            GHashTable *

Detailed infoermation about “state”. It is a GHashTable mapping gchar*->GValue, it can be accessed using the tp_asv_* functions.

Owner: TpCallChannel

Flags: Read

Since: 0.17.5


The “state-reason” property

  “state-reason”             TpCallStateReason *

Reason why “state” last changed.

Owner: TpCallChannel

Flags: Read

Since: 0.17.5

Signal Details

The “content-added” signal

void
user_function (TpCallChannel *self,
               GObject       *content,
               gpointer       user_data)

The ::content-added signal is emitted whenever a TpCallContent is added to self .

It is NOT guaranteed that TP_CALL_CONTENT_FEATURE_CORE is prepared on content .

Parameters

self

the TpCallChannel

 

content

the newly added TpCallContent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “content-removed” signal

void
user_function (TpCallChannel     *self,
               GObject           *content,
               TpCallStateReason *reason,
               gpointer           user_data)

The ::content-removed signal is emitted whenever a TpCallContent is removed from self .

It is NOT guaranteed that TP_CALL_CONTENT_FEATURE_CORE is prepared on content .

Parameters

self

the TpCallChannel

 

content

the newly removed TpCallContent

 

reason

a TpCallStateReason

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “members-changed” signal

void
user_function (TpCallChannel     *self,
               GHashTable        *updates,
               GPtrArray         *removed,
               TpCallStateReason *reason,
               gpointer           user_data)

The ::members-changed signal is emitted whenever the call's members changes.

The TpContact objects are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared.

Parameters

self

the TpCallChannel

 

updates

GHashTable mapping TpContact to its new TpCallMemberFlags.

[type GLib.HashTable][element-type TelepathyGLib.Contact uint]

removed

GPtrArray of TpContact removed from the call members.

[type GLib.PtrArray][element-type TelepathyGLib.Contact]

reason

the TpCallStateReason for the change

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “state-changed” signal

void
user_function (TpCallChannel     *self,
               guint              state,
               guint              flags,
               TpCallStateReason *reason,
               GHashTable        *details,
               gpointer           user_data)

The ::state-changed signal is emitted whenever the call state changes.

Parameters

self

the TpCallChannel

 

state

the new TpCallState

 

flags

the new TpCallFlags

 

reason

the TpCallStateReason for the change

 

details

additional details as a GHashTable readable using the tp_asv_* functions.

[element-type utf8 GObject.Value]

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-dispatcher.html0000644000175000017500000022251714006623344025422 00000000000000 Service-side Channel Dispatcher interface: telepathy-glib API Reference Manual

Service-side Channel Dispatcher interface

Service-side Channel Dispatcher interface — GInterfaces for Telepathy ChannelDispatcher object

Functions

void tp_svc_channel_dispatcher_return_from_create_channel ()
void (*tp_svc_channel_dispatcher_create_channel_impl) ()
void tp_svc_channel_dispatcher_implement_create_channel ()
void tp_svc_channel_dispatcher_return_from_create_channel_with_hints ()
void (*tp_svc_channel_dispatcher_create_channel_with_hints_impl) ()
void tp_svc_channel_dispatcher_implement_create_channel_with_hints ()
void tp_svc_channel_dispatcher_return_from_ensure_channel ()
void (*tp_svc_channel_dispatcher_ensure_channel_impl) ()
void tp_svc_channel_dispatcher_implement_ensure_channel ()
void tp_svc_channel_dispatcher_return_from_ensure_channel_with_hints ()
void (*tp_svc_channel_dispatcher_ensure_channel_with_hints_impl) ()
void tp_svc_channel_dispatcher_implement_ensure_channel_with_hints ()
void (*tp_svc_channel_dispatcher_delegate_channels_impl) ()
void tp_svc_channel_dispatcher_implement_delegate_channels ()
void tp_svc_channel_dispatcher_implement_present_channel ()
void (*tp_svc_channel_dispatcher_present_channel_impl) ()
void tp_svc_channel_dispatcher_return_from_delegate_channels ()
void tp_svc_channel_dispatcher_return_from_present_channel ()
void tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation ()
void tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished ()
void tp_svc_channel_dispatcher_interface_messages1_implement_send_message ()
void tp_svc_channel_dispatcher_interface_messages1_return_from_send_message ()
void (*tp_svc_channel_dispatcher_interface_messages1_send_message_impl) ()

Signals

void dispatch-operation-finished Has Details
void new-dispatch-operation Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelDispatcher
    ├── TpSvcChannelDispatcherInterfaceMessages1
    ╰── TpSvcChannelDispatcherInterfaceOperationList

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The TpSvcChannelDispatcher interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy ChannelDispatcher interface, with the correct method and signal signatures, and emit signals from that object in a type-safe way.

Similarly, TpSvcChannelDispatcherInterfaceOperationList helps to implement the optional OperationList interface.

You don't need these interfaces unless you're implementing a Telepathy ChannelDispatcher, such as Mission Control.

Functions

tp_svc_channel_dispatcher_return_from_create_channel ()

void
tp_svc_channel_dispatcher_return_from_create_channel
                               (DBusGMethodInvocation *context,
                                const gchar *out_Request);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Request

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_create_channel_impl ()

void
(*tp_svc_channel_dispatcher_create_channel_impl)
                               (TpSvcChannelDispatcher *self,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CreateChannel on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Requested_Properties

GHashTable * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

in_Preferred_Handler

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_implement_create_channel ()

void
tp_svc_channel_dispatcher_implement_create_channel
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_create_channel_impl impl);

Register an implementation for the CreateChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CreateChannel D-Bus method

 

tp_svc_channel_dispatcher_return_from_create_channel_with_hints ()

void
tp_svc_channel_dispatcher_return_from_create_channel_with_hints
                               (DBusGMethodInvocation *context,
                                const gchar *out_Request);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Request

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_create_channel_with_hints_impl ()

void
(*tp_svc_channel_dispatcher_create_channel_with_hints_impl)
                               (TpSvcChannelDispatcher *self,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                GHashTable *in_Hints,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CreateChannelWithHints on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Requested_Properties

GHashTable * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

in_Preferred_Handler

const gchar * (FIXME, generate documentation)

 

in_Hints

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_implement_create_channel_with_hints ()

void
tp_svc_channel_dispatcher_implement_create_channel_with_hints
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_create_channel_with_hints_impl impl);

Register an implementation for the CreateChannelWithHints method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CreateChannelWithHints D-Bus method

 

tp_svc_channel_dispatcher_return_from_ensure_channel ()

void
tp_svc_channel_dispatcher_return_from_ensure_channel
                               (DBusGMethodInvocation *context,
                                const gchar *out_Request);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Request

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_ensure_channel_impl ()

void
(*tp_svc_channel_dispatcher_ensure_channel_impl)
                               (TpSvcChannelDispatcher *self,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method EnsureChannel on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Requested_Properties

GHashTable * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

in_Preferred_Handler

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_implement_ensure_channel ()

void
tp_svc_channel_dispatcher_implement_ensure_channel
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_ensure_channel_impl impl);

Register an implementation for the EnsureChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the EnsureChannel D-Bus method

 

tp_svc_channel_dispatcher_return_from_ensure_channel_with_hints ()

void
tp_svc_channel_dispatcher_return_from_ensure_channel_with_hints
                               (DBusGMethodInvocation *context,
                                const gchar *out_Request);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Request

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_ensure_channel_with_hints_impl ()

void
(*tp_svc_channel_dispatcher_ensure_channel_with_hints_impl)
                               (TpSvcChannelDispatcher *self,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                GHashTable *in_Hints,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method EnsureChannelWithHints on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Requested_Properties

GHashTable * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

in_Preferred_Handler

const gchar * (FIXME, generate documentation)

 

in_Hints

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_implement_ensure_channel_with_hints ()

void
tp_svc_channel_dispatcher_implement_ensure_channel_with_hints
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_ensure_channel_with_hints_impl impl);

Register an implementation for the EnsureChannelWithHints method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the EnsureChannelWithHints D-Bus method

 

tp_svc_channel_dispatcher_delegate_channels_impl ()

void
(*tp_svc_channel_dispatcher_delegate_channels_impl)
                               (TpSvcChannelDispatcher *self,
                                const GPtrArray *in_Channels,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method DelegateChannels on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Channels

const GPtrArray * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

in_Preferred_Handler

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_implement_delegate_channels ()

void
tp_svc_channel_dispatcher_implement_delegate_channels
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_delegate_channels_impl impl);

Register an implementation for the DelegateChannels method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the DelegateChannels D-Bus method

 

tp_svc_channel_dispatcher_implement_present_channel ()

void
tp_svc_channel_dispatcher_implement_present_channel
                               (TpSvcChannelDispatcherClass *klass,
                                tp_svc_channel_dispatcher_present_channel_impl impl);

Register an implementation for the PresentChannel method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the PresentChannel D-Bus method

 

tp_svc_channel_dispatcher_present_channel_impl ()

void
(*tp_svc_channel_dispatcher_present_channel_impl)
                               (TpSvcChannelDispatcher *self,
                                const gchar *in_Channel,
                                gint64 in_User_Action_Time,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method PresentChannel on interface org.freedesktop.Telepathy.ChannelDispatcher.

Parameters

self

The object implementing this interface

 

in_Channel

const gchar * (FIXME, generate documentation)

 

in_User_Action_Time

gint64 (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_dispatcher_return_from_delegate_channels ()

void
tp_svc_channel_dispatcher_return_from_delegate_channels
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Delegated,
                                GHashTable *out_Not_Delegated);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Delegated

const GPtrArray * (FIXME, generate documentation)

 

out_Not_Delegated

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_return_from_present_channel ()

void
tp_svc_channel_dispatcher_return_from_present_channel
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation ()

void
tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation
                               (gpointer instance,
                                const gchar *arg_Dispatch_Operation,
                                GHashTable *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the NewDispatchOperation signal on interface org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList.

Parameters

instance

The object implementing this interface

 

arg_Dispatch_Operation

const gchar * (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished ()

void
tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished
                               (gpointer instance,
                                const gchar *arg_Dispatch_Operation);

Type-safe wrapper around g_signal_emit to emit the DispatchOperationFinished signal on interface org.freedesktop.Telepathy.ChannelDispatcher.Interface.OperationList.

Parameters

instance

The object implementing this interface

 

arg_Dispatch_Operation

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_interface_messages1_implement_send_message ()

void
tp_svc_channel_dispatcher_interface_messages1_implement_send_message
                               (TpSvcChannelDispatcherInterfaceMessages1Class *klass,
                                tp_svc_channel_dispatcher_interface_messages1_send_message_impl impl);

Register an implementation for the SendMessage method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SendMessage D-Bus method

 

tp_svc_channel_dispatcher_interface_messages1_return_from_send_message ()

void
tp_svc_channel_dispatcher_interface_messages1_return_from_send_message
                               (DBusGMethodInvocation *context,
                                const gchar *out_Token);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Token

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_dispatcher_interface_messages1_send_message_impl ()

void
(*tp_svc_channel_dispatcher_interface_messages1_send_message_impl)
                               (TpSvcChannelDispatcherInterfaceMessages1 *self,
                                const gchar *in_Account,
                                const gchar *in_Target_ID,
                                const GPtrArray *in_Message,
                                guint in_Flags,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SendMessage on interface org.freedesktop.Telepathy.ChannelDispatcher.Interface.Messages1.

Parameters

self

The object implementing this interface

 

in_Account

const gchar * (FIXME, generate documentation)

 

in_Target_ID

const gchar * (FIXME, generate documentation)

 

in_Message

const GPtrArray * (FIXME, generate documentation)

 

in_Flags

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

Types and Values

TpSvcChannelDispatcher

typedef struct _TpSvcChannelDispatcher TpSvcChannelDispatcher;

Dummy typedef representing any implementation of this interface.


TpSvcChannelDispatcherClass

typedef struct _TpSvcChannelDispatcherClass TpSvcChannelDispatcherClass;

The class of TpSvcChannelDispatcher.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_dispatcher (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_dispatcher_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (create_channel);
  IMPLEMENT (ensure_channel);
  IMPLEMENT (create_channel_with_hints);
  IMPLEMENT (ensure_channel_with_hints);
  IMPLEMENT (delegate_channels);
  IMPLEMENT (present_channel);
#undef IMPLEMENT
}

TpSvcChannelDispatcherInterfaceOperationList

typedef struct _TpSvcChannelDispatcherInterfaceOperationList TpSvcChannelDispatcherInterfaceOperationList;

Dummy typedef representing any implementation of this interface.


TpSvcChannelDispatcherInterfaceOperationListClass

typedef struct _TpSvcChannelDispatcherInterfaceOperationListClass TpSvcChannelDispatcherInterfaceOperationListClass;

The class of TpSvcChannelDispatcherInterfaceOperationList. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcChannelDispatcherInterfaceMessages1

typedef struct _TpSvcChannelDispatcherInterfaceMessages1 TpSvcChannelDispatcherInterfaceMessages1;

Dummy typedef representing any implementation of this interface.


TpSvcChannelDispatcherInterfaceMessages1Class

typedef struct _TpSvcChannelDispatcherInterfaceMessages1Class TpSvcChannelDispatcherInterfaceMessages1Class;

The class of TpSvcChannelDispatcherInterfaceMessages1.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_dispatcher_interface_messages1 (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_dispatcher_interface_messages1_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (send_message);
#undef IMPLEMENT
}

Signal Details

The “dispatch-operation-finished” signal

void
user_function (TpSvcChannelDispatcherInterfaceOperationList *self,
               DBusGObjectPath                              *arg_Dispatch_Operation,
               gpointer                                      user_data)

The DispatchOperationFinished D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Dispatch_Operation

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-dispatch-operation” signal

void
user_function (TpSvcChannelDispatcherInterfaceOperationList *self,
               DBusGObjectPath                              *arg_Dispatch_Operation,
               gpointer                                      user_data)

The NewDispatchOperation D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Dispatch_Operation

const gchar * (FIXME, generate documentation)

 

arg_Properties

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-generic.html0000644000175000017500000021044214006623344023274 00000000000000 Generic service-side interfaces: telepathy-glib API Reference Manual

Generic service-side interfaces

Generic service-side interfaces — GInterfaces for D-Bus objects exporting Telepathy properties and common D-Bus core interfaces

Signals

void properties-changed Has Details
void properties-changed Has Details
void property-flags-changed Has Details

Object Hierarchy

    GInterface
    ├── TpSvcDBusIntrospectable
    ├── TpSvcDBusProperties
    ╰── TpSvcPropertiesInterface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The D-Bus Properties interface associates named properties with any D-Bus object.

The D-Bus Introspectable interface provides introspection information.

The D-Bus Peer interface is exported by every D-Bus object.

The Telepathy Properties interface associates a number of named properties with a channel, connection or other D-Bus object. Signals are emitted when the properties or their flags (readable/writable) change.

Functions

tp_svc_dbus_introspectable_implement_introspect ()

void
tp_svc_dbus_introspectable_implement_introspect
                               (TpSvcDBusIntrospectableClass *klass,
                                tp_svc_dbus_introspectable_introspect_impl impl);

Register an implementation for the Introspect method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Introspect D-Bus method

 

tp_svc_dbus_introspectable_introspect_impl ()

void
(*tp_svc_dbus_introspectable_introspect_impl)
                               (TpSvcDBusIntrospectable *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Introspect on interface org.freedesktop.DBus.Introspectable.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_dbus_introspectable_return_from_introspect ()

void
tp_svc_dbus_introspectable_return_from_introspect
                               (DBusGMethodInvocation *context,
                                const gchar *out_XML_Data);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_XML_Data

const gchar * (FIXME, generate documentation)

 

tp_svc_dbus_properties_get_all_impl ()

void
(*tp_svc_dbus_properties_get_all_impl)
                               (TpSvcDBusProperties *self,
                                const gchar *in_Interface_Name,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetAll on interface org.freedesktop.DBus.Properties.

Parameters

self

The object implementing this interface

 

in_Interface_Name

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_dbus_properties_get_impl ()

void
(*tp_svc_dbus_properties_get_impl) (TpSvcDBusProperties *self,
                                    const gchar *in_Interface_Name,
                                    const gchar *in_Property_Name,
                                    DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Get on interface org.freedesktop.DBus.Properties.

Parameters

self

The object implementing this interface

 

in_Interface_Name

const gchar * (FIXME, generate documentation)

 

in_Property_Name

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_dbus_properties_implement_get ()

void
tp_svc_dbus_properties_implement_get (TpSvcDBusPropertiesClass *klass,
                                      tp_svc_dbus_properties_get_impl impl);

Register an implementation for the Get method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Get D-Bus method

 

tp_svc_dbus_properties_implement_get_all ()

void
tp_svc_dbus_properties_implement_get_all
                               (TpSvcDBusPropertiesClass *klass,
                                tp_svc_dbus_properties_get_all_impl impl);

Register an implementation for the GetAll method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetAll D-Bus method

 

tp_svc_dbus_properties_implement_set ()

void
tp_svc_dbus_properties_implement_set (TpSvcDBusPropertiesClass *klass,
                                      tp_svc_dbus_properties_set_impl impl);

Register an implementation for the Set method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Set D-Bus method

 

tp_svc_dbus_properties_return_from_get ()

void
tp_svc_dbus_properties_return_from_get
                               (DBusGMethodInvocation *context,
                                const GValue *out_Value);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Value

const GValue * (FIXME, generate documentation)

 

tp_svc_dbus_properties_return_from_get_all ()

void
tp_svc_dbus_properties_return_from_get_all
                               (DBusGMethodInvocation *context,
                                GHashTable *out_Properties);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Properties

GHashTable * (FIXME, generate documentation)

 

tp_svc_dbus_properties_return_from_set ()

void
tp_svc_dbus_properties_return_from_set
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_dbus_properties_set_impl ()

void
(*tp_svc_dbus_properties_set_impl) (TpSvcDBusProperties *self,
                                    const gchar *in_Interface_Name,
                                    const gchar *in_Property_Name,
                                    const GValue *in_Value,
                                    DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Set on interface org.freedesktop.DBus.Properties.

Parameters

self

The object implementing this interface

 

in_Interface_Name

const gchar * (FIXME, generate documentation)

 

in_Property_Name

const gchar * (FIXME, generate documentation)

 

in_Value

const GValue * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_dbus_properties_emit_properties_changed ()

void
tp_svc_dbus_properties_emit_properties_changed
                               (gpointer instance,
                                const gchar *arg_Interface_Name,
                                GHashTable *arg_Changed_Properties,
                                const gchar **arg_Invalidated_Properties);

Type-safe wrapper around g_signal_emit to emit the PropertiesChanged signal on interface org.freedesktop.DBus.Properties.

Parameters

instance

The object implementing this interface

 

arg_Interface_Name

const gchar * (FIXME, generate documentation)

 

arg_Changed_Properties

GHashTable * (FIXME, generate documentation)

 

arg_Invalidated_Properties

const gchar ** (FIXME, generate documentation)

 

tp_svc_properties_interface_get_properties_impl ()

void
(*tp_svc_properties_interface_get_properties_impl)
                               (TpSvcPropertiesInterface *self,
                                const GArray *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetProperties on interface org.freedesktop.Telepathy.Properties.

Parameters

self

The object implementing this interface

 

in_Properties

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_properties_interface_return_from_get_properties ()

void
tp_svc_properties_interface_return_from_get_properties
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Values);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Values

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_properties_interface_implement_get_properties ()

void
tp_svc_properties_interface_implement_get_properties
                               (TpSvcPropertiesInterfaceClass *klass,
                                tp_svc_properties_interface_get_properties_impl impl);

Register an implementation for the GetProperties method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetProperties D-Bus method

 

tp_svc_properties_interface_list_properties_impl ()

void
(*tp_svc_properties_interface_list_properties_impl)
                               (TpSvcPropertiesInterface *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListProperties on interface org.freedesktop.Telepathy.Properties.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_properties_interface_return_from_list_properties ()

void
tp_svc_properties_interface_return_from_list_properties
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Available_Properties);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Available_Properties

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_properties_interface_implement_list_properties ()

void
tp_svc_properties_interface_implement_list_properties
                               (TpSvcPropertiesInterfaceClass *klass,
                                tp_svc_properties_interface_list_properties_impl impl);

Register an implementation for the ListProperties method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListProperties D-Bus method

 

tp_svc_properties_interface_set_properties_impl ()

void
(*tp_svc_properties_interface_set_properties_impl)
                               (TpSvcPropertiesInterface *self,
                                const GPtrArray *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetProperties on interface org.freedesktop.Telepathy.Properties.

Parameters

self

The object implementing this interface

 

in_Properties

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_properties_interface_return_from_set_properties ()

void
tp_svc_properties_interface_return_from_set_properties
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_properties_interface_implement_set_properties ()

void
tp_svc_properties_interface_implement_set_properties
                               (TpSvcPropertiesInterfaceClass *klass,
                                tp_svc_properties_interface_set_properties_impl impl);

Register an implementation for the SetProperties method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetProperties D-Bus method

 

tp_svc_properties_interface_emit_properties_changed ()

void
tp_svc_properties_interface_emit_properties_changed
                               (gpointer instance,
                                const GPtrArray *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the PropertiesChanged signal on interface org.freedesktop.Telepathy.Properties.

Parameters

instance

The object implementing this interface

 

arg_Properties

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_properties_interface_emit_property_flags_changed ()

void
tp_svc_properties_interface_emit_property_flags_changed
                               (gpointer instance,
                                const GPtrArray *arg_Properties);

Type-safe wrapper around g_signal_emit to emit the PropertyFlagsChanged signal on interface org.freedesktop.Telepathy.Properties.

Parameters

instance

The object implementing this interface

 

arg_Properties

const GPtrArray * (FIXME, generate documentation)

 

Types and Values

TpSvcDBusIntrospectable

typedef struct _TpSvcDBusIntrospectable TpSvcDBusIntrospectable;

Dummy typedef representing any implementation of this interface.


TpSvcDBusIntrospectableClass

typedef struct _TpSvcDBusIntrospectableClass TpSvcDBusIntrospectableClass;

The class of TpSvcDBusIntrospectable.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_dbus_introspectable (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_dbus_introspectable_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (introspect);
#undef IMPLEMENT
}

TpSvcDBusProperties

typedef struct _TpSvcDBusProperties TpSvcDBusProperties;

Dummy typedef representing any implementation of this interface.


TpSvcDBusPropertiesClass

typedef struct _TpSvcDBusPropertiesClass TpSvcDBusPropertiesClass;

The class of TpSvcDBusProperties.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_dbus_properties (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_dbus_properties_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get);
  IMPLEMENT (set);
  IMPLEMENT (get_all);
#undef IMPLEMENT
}

TpSvcPropertiesInterface

typedef struct _TpSvcPropertiesInterface TpSvcPropertiesInterface;

Dummy typedef representing any implementation of this interface.


TpSvcPropertiesInterfaceClass

typedef struct _TpSvcPropertiesInterfaceClass TpSvcPropertiesInterfaceClass;

The class of TpSvcPropertiesInterface.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_properties_interface (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_properties_interface_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_properties);
  IMPLEMENT (list_properties);
  IMPLEMENT (set_properties);
#undef IMPLEMENT
}

Signal Details

The “properties-changed” signal

void
user_function (TpSvcDBusProperties *self,
               gchar               *arg_Interface_Name,
               GStrv                arg_Invalidated_Properties,
               gpointer             user_data)

The PropertiesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Interface_Name

const gchar * (FIXME, generate documentation)

 

arg_Changed_Properties

GHashTable * (FIXME, generate documentation)

 

arg_Invalidated_Properties

const gchar ** (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “properties-changed” signal

void
user_function (TpSvcPropertiesInterface *self,
               gpointer                  user_data)

The PropertiesChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Properties

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “property-flags-changed” signal

void
user_function (TpSvcPropertiesInterface *self,
               gpointer                  user_data)

The PropertyFlagsChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Properties

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-simple-handler.html0000644000175000017500000011630114006623344023772 00000000000000 TpSimpleHandler: telepathy-glib API Reference Manual

TpSimpleHandler

TpSimpleHandler — a subclass of TpBaseClient implementing a simple Handler

Properties

gboolean bypass-approval Write / Construct Only
gpointer callback Write / Construct Only
gpointer destroy Write / Construct Only
gboolean requests Write / Construct Only
gpointer user-data Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseClient
        ╰── TpSimpleHandler

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class makes it easier to construct a TpSvcClient implementing the TpSvcClientHandler interface.

A typical simple handler would look liks this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
static void
my_handle_channels (TpSimpleHandler *handler,
   TpAccount *account,
   TpConnection *connection,
   GList *channels,
   GList *requests_satisfied,
   gint64 user_action_time,
   GList *requests,
   TpHandleChannelsContext *context,
   gpointer user_data)
{
 /<!-- -->* start handling the channels here *<!-- -->/

 tp_handle_channels_context_accept (context);
}

factory = tp_automatic_client_factory_new (dbus);
client = tp_simple_handler_new_with_factory (factory, FALSE, FALSE,
    "MyHandler", FALSE, my_handle_channels, user_data);
g_object_unref (factory);

tp_base_client_take_handler_filter (client, tp_asv_new (
     TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT,
     TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
     NULL));

tp_base_client_register (client, NULL);

See examples/client/text-handler.c for a complete example.

Functions

TpSimpleHandlerHandleChannelsImpl ()

void
(*TpSimpleHandlerHandleChannelsImpl) (TpSimpleHandler *handler,
                                      TpAccount *account,
                                      TpConnection *connection,
                                      GList *channels,
                                      GList *requests_satisfied,
                                      gint64 user_action_time,
                                      TpHandleChannelsContext *context,
                                      gpointer user_data);

Signature of the implementation of the HandleChannels method.

This function must call either tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail() on context before it returns.

Parameters

handler

a TpSimpleHandler instance

 

account

a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible

 

connection

a TpConnection having TP_CONNECTION_FEATURE_CORE prepared if possible

 

channels

a GList of TpChannel, all having TP_CHANNEL_FEATURE_CORE prepared if possible.

[element-type TelepathyGLib.Channel]

requests_satisfied

a GList of TpChannelRequest having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

user_action_time

the time at which user action occurred, or one of the special values TP_USER_ACTION_TIME_NOT_USER_ACTION or TP_USER_ACTION_TIME_CURRENT_TIME (see “user-action-time” for details)

 

context

a TpHandleChannelsContext representing the context of this D-Bus call

 

user_data

arbitrary user-supplied data passed to tp_simple_handler_new()

 

Since: 0.11.6


tp_simple_handler_new ()

TpBaseClient *
tp_simple_handler_new (TpDBusDaemon *dbus,
                       gboolean bypass_approval,
                       gboolean requests,
                       const gchar *name,
                       gboolean uniquify,
                       TpSimpleHandlerHandleChannelsImpl callback,
                       gpointer user_data,
                       GDestroyNotify destroy);

tp_simple_handler_new is deprecated and should not be used in newly-written code.

New code should use tp_simple_handler_new_with_am() instead.

Convenient function to create a new TpSimpleHandler instance.

If dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_handler_new_with_am() instead, so that TpAccount, TpConnection and TpContact instances can be shared between modules.

Parameters

dbus

a TpDBusDaemon object, may not be NULL

 

bypass_approval

the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details)

 

requests

whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details)

 

name

the name of the Handler (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when HandleChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleHandler is destroyed

 

Returns

a new TpSimpleHandler.

[type TelepathyGLib.SimpleHandler]

Since: 0.11.6


tp_simple_handler_new_with_am ()

TpBaseClient *
tp_simple_handler_new_with_am (TpAccountManager *account_manager,
                               gboolean bypass_approval,
                               gboolean requests,
                               const gchar *name,
                               gboolean uniquify,
                               TpSimpleHandlerHandleChannelsImpl callback,
                               gpointer user_data,
                               GDestroyNotify destroy);

Convenient function to create a new TpSimpleHandler instance with a specified TpAccountManager.

It is not necessary to prepare any features on account_manager before calling this function.

Parameters

account_manager

an account manager, which may not be NULL

 

bypass_approval

the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details)

 

requests

whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details)

 

name

the name of the Handler (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when HandleChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleHandler is destroyed

 

Returns

a new TpSimpleHandler.

[type TelepathyGLib.SimpleHandler]

Since: 0.11.14


tp_simple_handler_new_with_factory ()

TpBaseClient *
tp_simple_handler_new_with_factory (TpSimpleClientFactory *factory,
                                    gboolean bypass_approval,
                                    gboolean requests,
                                    const gchar *name,
                                    gboolean uniquify,
                                    TpSimpleHandlerHandleChannelsImpl callback,
                                    gpointer user_data,
                                    GDestroyNotify destroy);

Convenient function to create a new TpSimpleHandler instance with a specified TpSimpleClientFactory.

Parameters

factory

a TpSimpleClientFactory, which may not be NULL

 

bypass_approval

the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details)

 

requests

whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details)

 

name

the name of the Handler (see “name” for details)

 

uniquify

the value of the “uniquify-name” property

 

callback

the function called when HandleChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with user_data as its argument when the TpSimpleHandler is destroyed

 

Returns

a new TpSimpleHandler.

[type TelepathyGLib.SimpleHandler]

Since: 0.15.5

Types and Values

struct TpSimpleHandler

struct TpSimpleHandler;

Data structure representing a simple Handler implementation.

Since: 0.11.6

Property Details

The “bypass-approval” property

  “bypass-approval”          gboolean

The value of the Handler.BypassApproval D-Bus property.

Owner: TpSimpleHandler

Flags: Write / Construct Only

Default value: FALSE

Since: 0.11.6


The “callback” property

  “callback”                 gpointer

The TpSimpleHandlerHandleChannelsImpl callback implementing the HandleChannels D-Bus method.

This property can't be NULL.

Owner: TpSimpleHandler

Flags: Write / Construct Only

Since: 0.11.6


The “destroy” property

  “destroy”                  gpointer

The GDestroyNotify function called to free “user-data” when the TpSimpleHandler is destroyed.

Owner: TpSimpleHandler

Flags: Write / Construct Only

Since: 0.11.6


The “requests” property

  “requests”                 gboolean

If TRUE, the Handler will implement the Requests interface

Owner: TpSimpleHandler

Flags: Write / Construct Only

Default value: FALSE

Since: 0.11.6


The “user-data” property

  “user-data”                gpointer

The user-data pointer passed to “callback”.

Owner: TpSimpleHandler

Flags: Write / Construct Only

Since: 0.11.6

telepathy-glib-0.24.2/docs/reference/html/TpStaticHandleRepo.html0000644000175000017500000002423514006623343021656 00000000000000 TpStaticHandleRepo: telepathy-glib API Reference Manual

TpStaticHandleRepo

TpStaticHandleRepo — handle repository implementation with a fixed, static set of handle names

Properties

GStrv handle-names Read / Write / Construct Only

Object Hierarchy

    GObject
    ╰── TpStaticHandleRepo

Implemented Interfaces

TpStaticHandleRepo implements TpHandleRepoIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A static handle repository has a fixed, static set of allowed names; these handles can never be destroyed, and no more can be created, so no reference counting is performed.

The “handle-type” property must be set at construction time.

Most connection managers will use this for handles of type TP_HANDLE_TYPE_LIST.

Functions

tp_static_handle_repo_new ()

TpHandleRepoIface *
tp_static_handle_repo_new (TpHandleType handle_type,
                           const gchar **handle_names);

Parameters

handle_type

The type of handle to store in the new repository

 

handle_names

Same as “handle-names”

 

Returns

a new static handle repository

Types and Values

TpStaticHandleRepo

typedef struct _TpStaticHandleRepo TpStaticHandleRepo;

A static handle repository contains a fixed set of handles.

As well as setting the “handle-type” property, code which creates a static handle repository must set the “handle-names” construction property to a strv of valid handle names. All of these are preallocated; no more may be created, and attempts to do so will fail.

Handles in this repository are 1 more than the index in the string vector of the handle's name, so the first name in the vector has handle 1 and so on. Connection managers which use a static repository may assume this to be true, and use an enumeration starting at 1, in the same order as the string vector, to avoid having to look up handles internally.

This is intended for handles of type TP_HANDLE_TYPE_LIST, for which the connection manager should only accept a static list of supported handle names.

All structure fields are private.


TpStaticHandleRepoClass

typedef struct _TpStaticHandleRepoClass TpStaticHandleRepoClass;

The class of a TpStaticHandleRepo. All fields are private.

Property Details

The “handle-names” property

  “handle-names”             GStrv

The static set of handle names supported by this repo.

Owner: TpStaticHandleRepo

Flags: Read / Write / Construct Only

See Also

TpHandleRepoIface, TpDynamicHandleRepo

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-contactlist.html0000644000175000017500000001237414006623344025621 00000000000000 Contact List channels: telepathy-glib API Reference Manual

Contact List channels

Contact List channels — service-side interface for the Contact List channel type

Object Hierarchy

    GInterface
    ╰── TpSvcChannelTypeContactList

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Many instant messaging protocols have the a concept of a contact list, roster or buddy list. Some protocols also have user-defined groups or tags which can be represented as subsets of the roster.

This section documents the auto-generated C wrappers for the Contact List channel type.

Functions

Types and Values

TpSvcChannelTypeContactList

typedef struct _TpSvcChannelTypeContactList TpSvcChannelTypeContactList;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeContactListClass

typedef struct _TpSvcChannelTypeContactListClass TpSvcChannelTypeContactListClass;

The class of TpSvcChannelTypeContactList. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-base-protocol.html0000644000175000017500000021766614006623343023656 00000000000000 TpBaseProtocol: telepathy-glib API Reference Manual

TpBaseProtocol

TpBaseProtocol — base class for TpSvcProtocol implementations

Properties

GHashTable_gchararray+GValue_* immutable-properties Read
gchar * name Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseProtocol

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Base class for Telepathy Protocol objects.

Functions

tp_base_protocol_get_name ()

const gchar *
tp_base_protocol_get_name (TpBaseProtocol *self);

[skip]

Parameters

self

a Protocol

 

Returns

the value of “name”.

[transfer none]

Since: 0.11.11


tp_base_protocol_get_immutable_properties ()

GHashTable *
tp_base_protocol_get_immutable_properties
                               (TpBaseProtocol *self);

Return a basic set of immutable properties for this Protocol object, by using tp_dbus_properties_mixin_make_properties_hash().

Additional keys and values can be inserted into the returned hash table; if this is done, the inserted keys and values will be freed when the hash table is destroyed. The keys must be allocated with g_strdup() or equivalent, and the values must be slice-allocated (for instance with tp_g_value_slice_new_string() or a similar function).

Note that in particular, tp_asv_set_string() and similar functions should not be used with this hash table.

Parameters

self

a Protocol

 

Returns

a hash table mapping (gchar *) fully-qualified property names to GValues, which must be freed by the caller (at which point its contents will also be freed).

Since: 0.11.11


tp_base_protocol_get_parameters ()

const TpCMParamSpec *
tp_base_protocol_get_parameters (TpBaseProtocol *self);

Returns the parameters supported by this protocol, as an array of structs which must remain valid at least as long as self exists (it will typically be a global static array).

Parameters

self

a Protocol object

 

Returns

a description of the parameters supported by this protocol.

[transfer none][array zero-terminated=1]

Since: 0.11.11


tp_base_protocol_get_statuses ()

const TpPresenceStatusSpec *
tp_base_protocol_get_statuses (TpBaseProtocol *self);

Get the statuses supported by this object. Subclasses implement this via the TpBaseProtocolClass.get_statuses virtual method.

If the object does not implement the Protocol.Interface.Presences interface, it need not implement this virtual method.

Parameters

self

a Protocol object

 

Returns

an array of TpPresenceStatusSpec structs describing the standard statuses supported by this protocol, with a final element whose name element is guaranteed to be NULL. The array must remain valid at least as long as self does.

Since: 0.13.5


tp_base_protocol_new_connection ()

TpBaseConnection *
tp_base_protocol_new_connection (TpBaseProtocol *self,
                                 GHashTable *asv,
                                 GError **error);

Create a new connection using the TpBaseProtocolClass.get_parameters and TpBaseProtocolClass.new_connection implementations provided by a subclass. This is used to implement the RequestConnection() D-Bus method.

If the parameters in asv do not fit the result of get_parameters (unknown parameters are given, types are inappropriate, required parameters are not given, or a TpCMParamSpec.filter fails), then this method raises an error and new_connection is not called.

Otherwise, new_connection is called. Its asv argument is a copy of the asv given to this method, with default values for missing parameters filled in where available, and parameters' types converted to the GType specified by TpCMParamSpec.gtype.

Parameters

self

a Protocol object

 

asv

the parameters provided via D-Bus.

[transfer none][element-type utf8 GObject.Value]

error

used to return an error if NULL is returned

 

Returns

a new connection, or NULL on error

Since: 0.11.11


TpBaseProtocolGetParametersFunc ()

const TpCMParamSpec *
(*TpBaseProtocolGetParametersFunc) (TpBaseProtocol *self);

Signature of a virtual method to get the allowed parameters for connections to a protocol.

Returns the parameters supported by this protocol, as an array of structs which must remain valid at least as long as self exists (it will typically be a global static array).

Parameters

self

a protocol

 

Returns

a description of the parameters supported by this protocol.

[transfer none][array zero-terminated=1]

Since: 0.11.11


TpBaseProtocolNewConnectionFunc ()

TpBaseConnection *
(*TpBaseProtocolNewConnectionFunc) (TpBaseProtocol *self,
                                    GHashTable *asv,
                                    GError **error);

Signature of a virtual method to create a new connection to this protocol. This is used to implement the RequestConnection D-Bus method.

Implementations of TpBaseProtocolClass.new_connection may assume that the parameters in asv conform to the specifications given by TpBaseProtocolClass.get_parameters.

Parameters

self

a protocol

 

asv

the parameters provided via D-Bus.

[transfer none][element-type utf8 GObject.Value]

error

used to return an error if NULL is returned

 

Returns

a new connection, or NULL on error.

[transfer full]

Since: 0.11.11


TpBaseProtocolNormalizeContactFunc ()

gchar *
(*TpBaseProtocolNormalizeContactFunc) (TpBaseProtocol *self,
                                       const gchar *contact,
                                       GError **error);

Signature of a virtual method to perform best-effort offline normalization of a contact's identifier. It must either return a newly allocated string that is the normalized form of contact , or raise an error and return NULL.

Parameters

self

a protocol

 

contact

a contact's identifier

 

error

used to return an error if NULL is returned

 

Returns

a normalized identifier, or NULL on error.

[transfer full]

Since: 0.11.11


TpBaseProtocolIdentifyAccountFunc ()

gchar *
(*TpBaseProtocolIdentifyAccountFunc) (TpBaseProtocol *self,
                                      GHashTable *asv,
                                      GError **error);

Signature of a virtual method to choose a unique name for an account whose connection parameters are asv . This will typically return a copy of the 'account' parameter from asv , but may do something more complex (for instance, on IRC it could combine the nickname and the IRC network).

Implementations of TpBaseProtocolClass.identify_account may assume that the parameters in asv conform to the specifications given by TpBaseProtocolClass.get_parameters.

Parameters

self

a protocol

 

asv

parameters that might be passed to the RequestConnection D-Bus method

 

error

used to return an error if NULL is returned

 

Returns

a unique name for the account, or NULL on error.

[transfer full]

Since: 0.11.11


TpBaseProtocolGetInterfacesFunc ()

GStrv
(*TpBaseProtocolGetInterfacesFunc) (TpBaseProtocol *self);

Signature of a virtual method to get the D-Bus interfaces implemented by self , in addition to the Protocol interface.

If you implement TpBaseProtocolClass.get_statuses, you should include TP_IFACE_PROTOCOL_INTERFACE_PRESENCE in the returned array.

Parameters

self

a protocol

 

Returns

a NULL-terminated array of D-Bus interface names.

[transfer full]

Since: 0.11.11


TpBaseProtocolGetConnectionDetailsFunc ()

void
(*TpBaseProtocolGetConnectionDetailsFunc)
                               (TpBaseProtocol *self,
                                GStrv *connection_interfaces,
                                GType **channel_manager_types,
                                gchar **icon_name,
                                gchar **english_name,
                                gchar **vcard_field);

Signature of a virtual method to get the D-Bus interfaces implemented by self , in addition to the Protocol interface.

Parameters

self

a protocol

 

connection_interfaces

used to return a NULL-terminated array of interfaces which might be implemented on connections to this protocol.

[out][transfer full]

channel_manager_types

used to return a G_TYPE_INVALID-terminated array of types that implement TpChannelManager, which must include all channel managers that might be present on connections to this protocol; the channel managers should all implement TpChannelManagerIface.type_foreach_channel_class. The array will be freed with g_free() by the caller.

[out][transfer full][array zero-terminated=1]

icon_name

used to return the name of an icon for this protocol, such as "im-icq", or an empty string.

[out][transfer full]

english_name

used to return a human-readable but non-localized name for this protocol, or an empty string.

[out][transfer full]

vcard_field

used to return the name of the vCard field typically used with this protocol, or an empty string.

[out][transfer full]

Since: 0.11.11


TpBaseProtocolGetAvatarDetailsFunc ()

void
(*TpBaseProtocolGetAvatarDetailsFunc) (TpBaseProtocol *self,
                                       GStrv *supported_mime_types,
                                       guint *min_height,
                                       guint *min_width,
                                       guint *rec_height,
                                       guint *rec_width,
                                       guint *max_height,
                                       guint *max_width,
                                       guint *max_bytes);

Signature of a virtual method to get the supported avatar details for the protocol implemented by self .

Parameters

self

a protocol

 

supported_mime_types

used to return a NULL-terminated array of supported avatar mime types.

[out][transfer full]

min_height

used to return the minimum height in pixels of an avatar on this protocol, which may be 0.

[out]

min_width

used to return the minimum width in pixels of an avatar on this protocol, which may be 0.

[out]

rec_height

used to return the rec height in pixels of an avatar on this protocol, or 0 if there is no preferred height.

[out]

rec_width

used to return the rec width in pixels of an avatar on this protocol, or 0 if there is no preferred width.

[out]

max_height

used to return the maximum height in pixels of an avatar on this protocol, or 0 if there is no limit.

[out]

max_width

used to return the maximum width in pixels of an avatar on this protocol, or 0 if there is no limit.

[out]

max_bytes

used to return the maximum size in bytes of an avatar on this protocol, or 0 if there is no limit.

[out]

Since: 0.13.7


TpBaseProtocolGetInterfacesArrayFunc ()

GPtrArray *
(*TpBaseProtocolGetInterfacesArrayFunc)
                               (TpBaseProtocol *self);

Signature of an implementation of TpBaseProtocolClass.get_interfaces_array virtual function.

Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.

1
2
3
4
5
6
7
8
9
10
11
12
static GPtrArray *
my_protocol_get_interfaces_array (TpBaseProtocol *self)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_PROTOCOL_CLASS (
      my_protocol_parent_class)->get_interfaces_array (self);

  g_ptr_array_add (interfaces, TP_IFACE_BADGERS);

  return interfaces;
}

Parameters

self

a TpBaseProtocol

 

Returns

a GPtrArray of static strings for D-Bus interfaces implemented by this client.

[transfer container]

Since: 0.19.4


TpBaseProtocolDupSupportedVCardFieldsFunc ()

GStrv
(*TpBaseProtocolDupSupportedVCardFieldsFunc)
                               (TpBaseProtocol *self);

Signature of a virtual method to get the supported vCard fields supported by self.

Parameters

self

a protocol

 

Returns

a list of vCard fields in lower case, e.g. [x-sip, tel].

[allow-none][out][transfer full]

Since: 0.17.2


TpBaseProtocolDupSupportedURISchemesFunc ()

GStrv
(*TpBaseProtocolDupSupportedURISchemesFunc)
                               (TpBaseProtocol *self);

Signature of a virtual method to get the supported URI schemes supported by self.

Parameters

self

a protocol

 

Returns

a list of uri schemes, e.g. [sip, sips, tel].

[allow-none][out][transfer full]

Since: 0.17.2


TpBaseProtocolNormalizeVCardAddressFunc ()

gchar *
(*TpBaseProtocolNormalizeVCardAddressFunc)
                               (TpBaseProtocol *self,
                                const gchar *vcard_field,
                                const gchar *vcard_address,
                                GError **error);

Signature of a virtual method to perform best-effort offline normalization of a vCard address. It must either return a newly allocated string that is the normalized form of vcard_address , or raise an error and return NULL.

Parameters

self

a protocol

 

vcard_field

The vCard field of the address to be normalized.

 

vcard_address

The address to normalize.

 

error

used to return an error if NULL is returned

 

Returns

a normalized identifier, or NULL on error.

[transfer full]

Since: 0.17.2


TpBaseProtocolNormalizeURIFunc ()

gchar *
(*TpBaseProtocolNormalizeURIFunc) (TpBaseProtocol *self,
                                   const gchar *uri,
                                   GError **error);

Signature of a virtual method to perform best-effort offline normalization of a URI. It must either return a newly allocated string that is the normalized form of uri , or raise an error and return NULL.

Parameters

self

a protocol

 

uri

The URI to normalize.

 

error

used to return an error if NULL is returned

 

Returns

a normalized identifier, or NULL on error.

[transfer full]

Since: 0.13.11

Types and Values

struct TpBaseProtocol

struct TpBaseProtocol;

An object providing static details of the implementation of one real-time communications protocol.

Since: 0.11.11


struct TpBaseProtocolClass

struct TpBaseProtocolClass {
  GObjectClass parent_class;
  TpDBusPropertiesMixinClass dbus_properties_class;

  gboolean is_stub;
  const TpCMParamSpec *(*get_parameters) (TpBaseProtocol *self);
  TpBaseConnection *(*new_connection) (TpBaseProtocol *self,
      GHashTable *asv,
      GError **error);

  gchar *(*normalize_contact) (TpBaseProtocol *self,
      const gchar *contact,
      GError **error);
  gchar *(*identify_account) (TpBaseProtocol *self,
      GHashTable *asv,
      GError **error);

  void (*get_connection_details) (TpBaseProtocol *self,
      GStrv *connection_interfaces,
      GType **channel_manager_types,
      gchar **icon_name,
      gchar **english_name,
      gchar **vcard_field);

  const TpPresenceStatusSpec * (*get_statuses) (TpBaseProtocol *self);

  TpBaseProtocolGetAvatarDetailsFunc get_avatar_details;

  GStrv (*dup_authentication_types) (TpBaseProtocol *self);

  TpBaseProtocolGetInterfacesArrayFunc get_interfaces_array;
};

The class of a TpBaseProtocol.

Members

TpDBusPropertiesMixinClass dbus_properties_class;

a D-Bus properties mixin

 

gboolean is_stub;

if TRUE, this protocol will not be advertised on D-Bus (for internal use by TpBaseConnection)

 

get_parameters ()

a callback used to implement tp_base_protocol_get_parameters(), which all subclasses must provide; see the documentation of that method for details

 

new_connection ()

a callback used to implement tp_base_protocol_new_connection(), which all subclasses must provide; see the documentation of that method for details

 

normalize_contact ()

a callback used to implement the NormalizeContact D-Bus method; it must either return a newly allocated string that is the normalized version of contact , or raise an error via error and return NULL. If not implemented, TP_ERROR_NOT_IMPLEMENTED will be raised instead.

 

identify_account ()

a callback used to implement the IdentifyAccount D-Bus method; it takes as input a map from strings to GValues, and must either return a newly allocated string that represents the "identity" of the parameters in asv (usually the "account" parameter), or NULL with an error raised via error

 

get_connection_details ()

a callback used to implement the Protocol D-Bus properties that represent details of the connections provided by this protocol

 

get_statuses ()

a callback used to implement the Protocol.Interface.Presence interface's Statuses property. Since 0.13.5

 

TpBaseProtocolGetAvatarDetailsFunc get_avatar_details;

a callback used to implement the Protocol.Interface.Avatars interface's properties. Since 0.13.7

 

dup_authentication_types ()

a callback used to implement the AuthenticationTypes D-Bus property; it must return a newly allocated GStrv containing D-Bus interface names. Since 0.13.9

 

TpBaseProtocolGetInterfacesArrayFunc get_interfaces_array;

a callback used to implement the Interfaces D-Bus property; The implementation must first chainup to parent class implementation and then add extra interfaces to the GPtrArray. Replaces get_interfaces

 

Since: 0.11.11


struct TpProtocolAddressingInterface

struct TpProtocolAddressingInterface {
  GTypeInterface parent;

  TpBaseProtocolDupSupportedVCardFieldsFunc dup_supported_vcard_fields;

  TpBaseProtocolDupSupportedURISchemesFunc dup_supported_uri_schemes;

  TpBaseProtocolNormalizeVCardAddressFunc normalize_vcard_address;

  TpBaseProtocolNormalizeURIFunc normalize_contact_uri;
};

The interface vtable for a TP_TYPE_PROTOCOL_ADDRESSING.

Members

GTypeInterface parent;

the parent interface

 

TpBaseProtocolDupSupportedVCardFieldsFunc dup_supported_vcard_fields;

provides the supported vCard fields. Must always be implemented.

 

TpBaseProtocolDupSupportedURISchemesFunc dup_supported_uri_schemes;

provides the supported URI schemes. Must always be implemented.

 

TpBaseProtocolNormalizeVCardAddressFunc normalize_vcard_address;

protocol-specific implementation for normalizing vCard addresses.

 

TpBaseProtocolNormalizeURIFunc normalize_contact_uri;

protocol-specific implementation for normalizing contact URIs.

 

Since: 0.17.2

Property Details

The “immutable-properties” property

  “immutable-properties”     GHashTable_gchararray+GValue_*

The D-Bus properties to be announced in the ConnectionManager interface's Protocols property, as a map from interface.name.propertyname to GValue.

A protocol's immutable properties are constant for its lifetime on the bus, so this property should never change. All of the D-Bus properties mentioned here should also be exposed through the D-Bus properties interface.

The TpBaseProtocol base class implements this property to be correct for the basic set of properties. It can be reimplemented by subclasses to have more immutable properties; if so, the subclass should use tp_base_protocol_get_immutable_properties(), then augment the result using tp_dbus_properties_mixin_fill_properties_hash().

Owner: TpBaseProtocol

Flags: Read

Since: 0.11.11


The “name” property

  “name”                     gchar *

The Protocol from telepathy-spec, such as 'jabber' or 'local-xmpp'.

Owner: TpBaseProtocol

Flags: Read / Write / Construct Only

Default value: NULL

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-dispatcher.html0000644000175000017500000034064014006623344024627 00000000000000 TpChannelDispatcher: telepathy-glib API Reference Manual

TpChannelDispatcher

TpChannelDispatcher — proxy object for the Telepathy channel dispatcher

Functions

TpChannelDispatcher * tp_channel_dispatcher_new ()
void tp_channel_dispatcher_init_known_interfaces ()
void (*tp_cli_channel_dispatcher_callback_for_create_channel) ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_create_channel ()
void (*tp_cli_channel_dispatcher_callback_for_create_channel_with_hints) ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_create_channel_with_hints ()
void (*tp_cli_channel_dispatcher_callback_for_ensure_channel) ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_ensure_channel ()
void (*tp_cli_channel_dispatcher_callback_for_ensure_channel_with_hints) ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_ensure_channel_with_hints ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_delegate_channels ()
TpProxyPendingCall * tp_cli_channel_dispatcher_call_present_channel ()
void (*tp_cli_channel_dispatcher_callback_for_delegate_channels) ()
void (*tp_cli_channel_dispatcher_callback_for_present_channel) ()
TpProxyPendingCall * tp_cli_channel_dispatcher_interface_messages1_call_send_message ()
void (*tp_cli_channel_dispatcher_interface_messages1_callback_for_send_message) ()
void (*tp_cli_channel_dispatcher_interface_operation_list_signal_callback_dispatch_operation_finished) ()
TpProxySignalConnection * tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished ()
void (*tp_cli_channel_dispatcher_interface_operation_list_signal_callback_new_dispatch_operation) ()
TpProxySignalConnection * tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation ()

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannelDispatcher

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

The TpChannelDispatcher object can be used to communicate with any implementation of the Telepathy ChannelDispatcher service to request new channels.

Functions

tp_channel_dispatcher_new ()

TpChannelDispatcher *
tp_channel_dispatcher_new (TpDBusDaemon *bus_daemon);

Convenience function to create a new channel dispatcher proxy.

Parameters

bus_daemon

Proxy for the D-Bus daemon

 

Returns

a new reference to a channel dispatcher proxy


tp_channel_dispatcher_init_known_interfaces ()

void
tp_channel_dispatcher_init_known_interfaces
                               (void);

Ensure that the known interfaces for TpChannelDispatcher have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_CHANNEL_DISPATCHER.

Since: 0.7.32


tp_cli_channel_dispatcher_callback_for_create_channel ()

void
(*tp_cli_channel_dispatcher_callback_for_create_channel)
                               (TpChannelDispatcher *proxy,
                                const gchar *out_Request,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CreateChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Request

Used to return an 'out' argument if error is NULL: A <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_call_create_channel ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_create_channel
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                tp_cli_channel_dispatcher_callback_for_create_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CreateChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Equivalent to calling <tp:member-ref>CreateChannelWithHints</tp:member-ref> with an empty <var>Hints</var> parameter.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> for which the new channel is to be created.

 

in_Requested_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_Preferred_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Either the well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_callback_for_create_channel_with_hints ()

void
(*tp_cli_channel_dispatcher_callback_for_create_channel_with_hints)
                               (TpChannelDispatcher *proxy,
                                const gchar *out_Request,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CreateChannelWithHints method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Request

Used to return an 'out' argument if error is NULL: A <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_call_create_channel_with_hints ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_create_channel_with_hints
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                GHashTable *in_Hints,
                                tp_cli_channel_dispatcher_callback_for_create_channel_with_hints callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CreateChannelWithHints method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Start a request to create a channel. This initially just creates a <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object, which can be used to continue the request and track its success or failure.</p> <tp:rationale> <p>The request can take a long time - in the worst case, the channel dispatcher has to ask the account manager to put the account online, the account manager has to ask the operating system to obtain an Internet connection, and the operating system has to ask the user whether to activate an Internet connection using an on-demand mechanism like dialup.</p> <p>This means that using a single D-Bus method call and response to represent the whole request will tend to lead to that call timing out, which is not the behaviour we want.</p> </tp:rationale> <p>If this method is called for an Account that is disabled, invalid or otherwise unusable, no error is signalled until <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest.Proceed</tp:dbus-ref> is called, at which point <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest.Failed</tp:dbus-ref> is emitted with an appropriate error.</p> <tp:rationale> <p>This means there's only one code path for errors, apart from InvalidArgument for &quot;that request makes no sense&quot;.</p> <p>It also means that the request will proceed if the account is enabled after calling CreateChannel, but before calling Proceed.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> for which the new channel is to be created.

 

in_Requested_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties. This has the same semantics as the corresponding parameter to <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.CreateChannel</tp:dbus-ref>. </p> <p>Certain properties will not necessarily make sense in this dictionary: for instance, <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref> can only be given if the requester is able to interact with a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> to the desired account.</p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channel request is for some reason not involving user action. The <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelRequest">UserActionTime</tp:dbus-ref> property will be set to this value, and it will eventually be passed as the <code>User_Action_Time</code> parameter of <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref>.</p>

 

in_Preferred_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Either the well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The channel dispatcher SHOULD dispatch as many as possible of the resulting channels (ideally, all of them) to that handler—irrespective of whether that handler's <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandlerChannelFilter</tp:dbus-ref> matches the channel—and SHOULD remember the preferred handler so it can try to dispatch subsequent channels in the same bundle to the same handler.</p> <tp:rationale> <p>This must be the well-known bus name, not the unique name, to ensure that all handlers do indeed have the Client API, and the Client object on the handler can be located easily.</p> <p>This is partly so the channel dispatcher can call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Handler">HandleChannels</tp:dbus-ref> on it, and partly so the channel dispatcher can recover state if it crashes and is restarted.</p> <p>The filter should be disregarded for ease of use of this interface: clients will usually use this argument to request channels be sent to themself, and this should trump the filter not matching. This also allows a client to become the handler for a channel produced by one of its own requests, while not being a candidate to handle other channels of that type.</p> </tp:rationale> <p>If this is a well-known bus name and the handler has the Requests interface, the channel dispatcher SHOULD call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client.Interface.Requests">AddRequest</tp:dbus-ref> on that Handler after this method has returned.</p> <tp:rationale> <p>This ordering allows a Handler which calls CreateChannel with itself as the preferred handler to associate the call to AddRequest with that call.</p> </tp:rationale> <p>This is copied to the ChannelRequest that is returned, as the <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelRequest">PreferredHandler</tp:dbus-ref> property.</p>

 

in_Hints

Used to pass an 'in' argument: <p>Additional information about the channel request, which will be used as the value for the resulting request's <tp:dbus-ref namespace="ofdT.ChannelRequest">Hints</tp:dbus-ref> property.</p> <tp:rationale> <p>See the Hints property's documentation for rationale.</p> </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_callback_for_ensure_channel ()

void
(*tp_cli_channel_dispatcher_callback_for_ensure_channel)
                               (TpChannelDispatcher *proxy,
                                const gchar *out_Request,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a EnsureChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Request

Used to return an 'out' argument if error is NULL: A <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_call_ensure_channel ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_ensure_channel
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                tp_cli_channel_dispatcher_callback_for_ensure_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a EnsureChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Equivalent to calling <tp:member-ref>EnsureChannelWithHints</tp:member-ref> with an empty <var>Hints</var> parameter.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> for which the new channel is to be created.

 

in_Requested_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_Preferred_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Either the well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to <tp:member-ref>EnsureChannelWithHints</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_callback_for_ensure_channel_with_hints ()

void
(*tp_cli_channel_dispatcher_callback_for_ensure_channel_with_hints)
                               (TpChannelDispatcher *proxy,
                                const gchar *out_Request,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a EnsureChannelWithHints method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Request

Used to return an 'out' argument if error is NULL: A <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_call_ensure_channel_with_hints ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_ensure_channel_with_hints
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                GHashTable *in_Requested_Properties,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                GHashTable *in_Hints,
                                tp_cli_channel_dispatcher_callback_for_ensure_channel_with_hints callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a EnsureChannelWithHints method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Start a request to ensure that a channel exists, creating it if necessary. This initially just creates a <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest</tp:dbus-ref> object, which can be used to continue the request and track its success or failure.</p> <p>If this method is called for an Account that is disabled, invalid or otherwise unusable, no error is signalled until <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest.Proceed</tp:dbus-ref> is called, at which point <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelRequest.Failed</tp:dbus-ref> is emitted with an appropriate error.</p> <tp:rationale> <p>The rationale is as for <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">CreateChannelWithHints</tp:dbus-ref>.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="org.freedesktop.Telepathy">Account</tp:dbus-ref> for which the new channel is to be created.

 

in_Requested_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary containing desirable properties. This has the same semantics as the corresponding parameter to <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.EnsureChannel</tp:dbus-ref>. </p> <p>Certain properties will not necessarily make sense in this dictionary: for instance, <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">TargetHandle</tp:dbus-ref> can only be given if the requester is able to interact with a <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection</tp:dbus-ref> to the desired account.</p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_Preferred_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Either the well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>, except as noted here.</p> <p>If any new channels are created in response to this request, the channel dispatcher SHOULD dispatch as many as possible of the resulting channels (ideally, all of them) to that handler, and SHOULD remember the preferred handler so it can try to dispatch subsequent channels in the same bundle to the same handler. If the requested channel already exists (that is, <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.Interface.Requests.EnsureChannel</tp:dbus-ref> returns <code>Yours=False</code>) then the channel dispatcher SHOULD re-dispatch the channel to its existing handler, and MUST NOT dispatch it to this client (unless it is the existing handler); the request is still deemed to have succeeded in this case.</p> <tp:rationale> <p>An address book application, for example, might call <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">EnsureChannel</tp:dbus-ref> to ensure that a text channel with a particular contact is displayed to the user; it does not care whether a new channel was made. An IM client might call <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">EnsureChannel</tp:dbus-ref> in response to the user double-clicking an entry in the contact list, with itself as the <code>Preferred_Handler</code>; if the user already has a conversation with that contact in another application, they would expect the existing window to be presented, rather than their double-click leading to an error message. So the request should succeed, even if its <code>Preferred_Handler</code> is not used.</p> </tp:rationale>

 

in_Hints

Used to pass an 'in' argument: Additional information about the channel request, which will be used as the value for the resulting request's <tp:dbus-ref namespace="ofdT.ChannelRequest">Hints</tp:dbus-ref> property.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_call_delegate_channels ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_delegate_channels
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const GPtrArray *in_Channels,
                                gint64 in_User_Action_Time,
                                const gchar *in_Preferred_Handler,
                                tp_cli_channel_dispatcher_callback_for_delegate_channels callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a DelegateChannels method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Called by a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client">Handler</tp:dbus-ref> to redispatch a bunch of channels it is currently handling.</p> <p>For each <var>Channel</var> in <var>Channels</var>, if another <tp:dbus-ref namespace="ofdT.Client">Handler</tp:dbus-ref> can be found, <tp:dbus-ref namespace="ofdT.Client.Handler">HandleChannels</tp:dbus-ref> will be called on it until a <tp:dbus-ref namespace="ofdT.Client">Handler</tp:dbus-ref> accepts it.</p> <p>This method returns once all the <var>Channels</var> have either been accepted or rejected by Handlers.</p> <p>If this method fails, the original <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client">Handler</tp:dbus-ref> is still handling the channels.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Channels

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The list of channels to redispatch. The caller has to be the current <tp:dbus-ref namespace="org.freedesktop.Telepathy.Client">Handler</tp:dbus-ref> of all of these channels </p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channels delegation is for some reason not involving user action.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

in_Preferred_Handler

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Either the well-known bus name (starting with <code>org.freedesktop.Telepathy.Client.</code>) of the preferred new handler for these channels, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to <tp:member-ref>CreateChannelWithHints</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_call_present_channel ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_call_present_channel
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Channel,
                                gint64 in_User_Action_Time,
                                tp_cli_channel_dispatcher_callback_for_present_channel callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a PresentChannel method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Equivalent of calling <tp:dbus-ref namespace="org.freedesktop.Telepathy.ChannelDispatcher">EnsureChannel</tp:dbus-ref> with a <var>Requested_Properties</var> which would result in ensuring <var>Channel</var>.</p> <p>If <var>Channel</var> is handled, its handler will be asked to present it the user (e.g. bring it into the foreground).</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Channel

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The channel to present.</p>

 

in_User_Action_Time

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.</p> <p>This parameter is used in the same way as the corresponding parameter to <tp:member-ref>EnsureChannelWithHints</tp:member-ref>.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_callback_for_delegate_channels ()

void
(*tp_cli_channel_dispatcher_callback_for_delegate_channels)
                               (TpChannelDispatcher *proxy,
                                const GPtrArray *out_Delegated,
                                GHashTable *out_Not_Delegated,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a DelegateChannels method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Delegated

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The list of channels which have been delegated; the caller is no longer handling these channels.</p> <p>The client should remove these channels from its <tp:dbus-ref namespace="ofdT.Client.Handler">HandledChannels</tp:dbus-ref> property.</p>

 

out_Not_Delegated

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The list of channels which have NOT been delegated; the caller is still handling these channels.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_callback_for_present_channel ()

void
(*tp_cli_channel_dispatcher_callback_for_present_channel)
                               (TpChannelDispatcher *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a PresentChannel method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_interface_messages1_call_send_message ()

TpProxyPendingCall *
tp_cli_channel_dispatcher_interface_messages1_call_send_message
                               (TpChannelDispatcher *proxy,
                                gint timeout_ms,
                                const gchar *in_Account,
                                const gchar *in_Target_ID,
                                const GPtrArray *in_Message,
                                guint in_Flags,
                                tp_cli_channel_dispatcher_interface_messages1_callback_for_send_message callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SendMessage method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Submit a message to the server for sending, like the <tp:dbus-ref namespace="ofdT.Channel.Interface">Messages.SendMessage</tp:dbus-ref> method.</p> <p>If the <var>Account</var> is connected and a Text channel to the <var>Target_ID</var> already exists, this method is equivalent to sending the same message via that channel.</p> <p>Otherwise, this method creates a channel (connecting the Account if appropriate), sends the desired message, and closes the channel as if via <tp:dbus-ref namespace="ofdT">Channel.Close</tp:dbus-ref>, without acknowledging any messages received on that channel during that time.</p> <p>If any messages are received on that channel before it is closed, a correct connection manager implementation will reopen the channel when it is closed, resulting in those &quot;rescued&quot; messages being processed by the system's normal <tp:dbus-ref namespace="ofdT.Client">Handler</tp:dbus-ref> for text channels. In particular, this deals with the situation where a successful or failed delivery report is received before the channel is closed.</p> <tp:rationale> <p>Expecting a trivial client (perhaps a send-only IRC bot, or a simple SMS-sending API) to go through all those steps to send a message seems somewhat unreasonable. Having this as a method in the ChannelDispatcher lets it take some short-cuts if required, and centralizes the implementation to reduce the risk of mistakes that cause message loss.</p> </tp:rationale> <p>The ChannelDispatcher SHOULD support this method for any connection manager that would accept channel requests of this form:</p> <pre> { …<tp:dbus-ref namespace="ofdT">Channel.ChannelType</tp:dbus-ref>: …<tp:dbus-ref namespace="ofdT">Channel.Type.Text</tp:dbus-ref>, …<tp:dbus-ref namespace="ofdT">Channel.TargetHandleType</tp:dbus-ref>: <tp:value-ref type="Handle_Type">Contact</tp:value-ref>, …<tp:dbus-ref namespace="ofdT">Channel.TargetID</tp:dbus-ref>: <var>Target_ID</var> }</pre> <p>However, if the connection manager provides additional APIs (such as a way to open &quot;send-only&quot; channels), the ChannelDispatcher MAY use those: it is not required to use those exact request parameters.</p> <p>This method may raise any error that would be raised by the <tp:dbus-ref namespace="ofdT.Connection.Interface">Requests.EnsureChannel</tp:dbus-ref> or <tp:dbus-ref namespace="ofdT.Channel.Interface">Messages.SendMessage</tp:dbus-ref> methods, or signalled by the <tp:dbus-ref namespace="ofdT.ChannelRequest">Failed</tp:dbus-ref> signal.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Account

Used to pass an 'in' argument: The <tp:dbus-ref namespace="ofdT">Account</tp:dbus-ref> through which to communicate.

 

in_Target_ID

Used to pass an 'in' argument: The contact to send the message to.

 

in_Message

Used to pass an 'in' argument: The parts of the message, the same as for <tp:dbus-ref namespace="ofdT.Channel.Interface">Messages.SendMessage</tp:dbus-ref>.

 

in_Flags

Used to pass an 'in' argument: Flags influencing how to send the message, the same as for <tp:dbus-ref namespace="ofdT.Channel.Interface">Messages.SendMessage</tp:dbus-ref>.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_dispatcher_interface_messages1_callback_for_send_message ()

void
(*tp_cli_channel_dispatcher_interface_messages1_callback_for_send_message)
                               (TpChannelDispatcher *proxy,
                                const gchar *out_Token,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SendMessage method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Token

Used to return an 'out' argument if error is NULL: An opaque token equivalent to the one returned by <tp:dbus-ref namespace="ofdT.Channel.Interface">Messages.SendMessage</tp:dbus-ref>.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_dispatcher_interface_operation_list_signal_callback_dispatch_operation_finished ()

void
(*tp_cli_channel_dispatcher_interface_operation_list_signal_callback_dispatch_operation_finished)
                               (TpChannelDispatcher *proxy,
                                const gchar *arg_Dispatch_Operation,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal DispatchOperationFinished.

Parameters

proxy

The proxy on which tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished() was called

 

arg_Dispatch_Operation

The dispatch operation that was closed.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished ()

TpProxySignalConnection *
tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished
                               (TpChannelDispatcher *proxy,
                                tp_cli_channel_dispatcher_interface_operation_list_signal_callback_dispatch_operation_finished callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal DispatchOperationFinished.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Emitted when a dispatch operation finishes (i.e. exactly once per emission of <tp:dbus-ref namespace="org.freedesktop.Telepathy">ChannelDispatchOperation.Finished</tp:dbus-ref>). <tp:rationale> Strictly speaking this is redundant with ChannelDispatchOperation.Finished, but it provides full change-notification for the <tp:member-ref>DispatchOperations</tp:member-ref> property. </tp:rationale>

Parameters

proxy

A TpChannelDispatcher or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_dispatcher_interface_operation_list_signal_callback_new_dispatch_operation ()

void
(*tp_cli_channel_dispatcher_interface_operation_list_signal_callback_new_dispatch_operation)
                               (TpChannelDispatcher *proxy,
                                const gchar *arg_Dispatch_Operation,
                                GHashTable *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewDispatchOperation.

Parameters

proxy

The proxy on which tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation() was called

 

arg_Dispatch_Operation

The dispatch operation that was created.

 

arg_Properties

The same properties that would appear in the Properties member of <tp:type>Dispatch_Operation_Details</tp:type>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation ()

TpProxySignalConnection *
tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation
                               (TpChannelDispatcher *proxy,
                                tp_cli_channel_dispatcher_interface_operation_list_signal_callback_new_dispatch_operation callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewDispatchOperation.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a dispatch operation is added to <tp:member-ref>DispatchOperations</tp:member-ref>.</p>

Parameters

proxy

A TpChannelDispatcher or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.

Types and Values

struct TpChannelDispatcher

struct TpChannelDispatcher;

The Channel Dispatcher's main D-Bus API is used to request channels, which is done by calling tp_cli_channel_dispatcher_call_create_channel() or tp_cli_channel_dispatcher_call_ensure_channel() as appropriate.

The Telepathy Channel Dispatcher is also responsible for responding to new channels and launching client processes to handle them. However, clients that can work with incoming channels do not have to call methods on the channel dispatcher: instead, they must register with the channel dispatcher passively, by taking a bus name starting with TP_CLIENT_BUS_NAME_BASE and implementing the TpSvcClient interface. See the Telepathy D-Bus Interface Specification for details.

This proxy is usable but incomplete: convenience methods will be added in a later version of telepathy-glib, along with a mechanism similar to tp_connection_call_when_ready().

Since: 0.7.32


struct TpChannelDispatcherClass

struct TpChannelDispatcherClass {
};

The class of a TpChannelDispatcher.

telepathy-glib-0.24.2/docs/reference/html/TpDebugClient.html0000644000175000017500000010477614006623343020663 00000000000000 TpDebugClient: telepathy-glib API Reference Manual

TpDebugClient

TpDebugClient — proxy objects for Telepathy debug information

Properties

gboolean enabled Read

Signals

void new-debug-message Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpDebugClient

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This module provides access to the auxiliary objects used to implement TpSvcDebug.

Functions

tp_cli_debug_call_get_messages ()

TpProxyPendingCall *
tp_cli_debug_call_get_messages (TpDebugClient *proxy,
                                gint timeout_ms,
                                tp_cli_debug_callback_for_get_messages callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetMessages method call.

Retrieve buffered debug messages. An implementation could have a limit on how many message it keeps and so the array returned from this method should not be assumed to be all of the messages in the lifetime of the service.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_debug_callback_for_get_messages ()

void
(*tp_cli_debug_callback_for_get_messages)
                               (TpDebugClient *proxy,
                                const GPtrArray *out_Messages,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetMessages method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Messages

Used to return an 'out' argument if error is NULL: A list of debug messages.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_debug_connect_to_new_debug_message ()

TpProxySignalConnection *
tp_cli_debug_connect_to_new_debug_message
                               (TpDebugClient *proxy,
                                tp_cli_debug_signal_callback_new_debug_message callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewDebugMessage.

Emitted when a debug messages is generated if the <tp:member-ref>Enabled</tp:member-ref> property is set to TRUE.

Parameters

proxy

A TpDebugClient or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_debug_signal_callback_new_debug_message ()

void
(*tp_cli_debug_signal_callback_new_debug_message)
                               (TpDebugClient *proxy,
                                gdouble arg_time,
                                const gchar *arg_domain,
                                guint arg_level,
                                const gchar *arg_message,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewDebugMessage.

Parameters

proxy

The proxy on which tp_cli_debug_connect_to_new_debug_message() was called

 

arg_time

Timestamp of the debug message.

 

arg_domain

Domain of the debug message, as described in the Debug_Message struct.

 

arg_level

Level of the debug message. (TpDebugLevel)

 

arg_message

The text of the debug message.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_debug_client_init_known_interfaces ()

void
tp_debug_client_init_known_interfaces (void);

Ensure that the known interfaces for TpDebugClient have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument TP_TYPE_DEBUG_CLIENT.

Since: 0.19.0


tp_debug_client_new ()

TpDebugClient *
tp_debug_client_new (TpDBusDaemon *dbus,
                     const gchar *unique_name,
                     GError **error);

Parameters

dbus

a D-Bus daemon; may not be NULL

 

unique_name

the unique name of the process to be debugged; may not be NULL or a well-known name

 

error

used to raise an error if unique_name is not valid

 

Returns

a new debug client proxy, or NULL on invalid arguments

Since: 0.19.0


tp_debug_client_set_enabled_async ()

void
tp_debug_client_set_enabled_async (TpDebugClient *self,
                                   gboolean enabled,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Enable or disable publishing of debug messages on the bus by the component owning self 's bus name.

Parameters

self

a TpDebugClient

 

enabled

TRUE if debug messages should be published on the bus, FALSE otherwise

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since: 0.19.0


tp_debug_client_set_enabled_finish ()

gboolean
tp_debug_client_set_enabled_finish (TpDebugClient *self,
                                    GAsyncResult *result,
                                    GError **error);

Finishes tp_debug_client_set_enabled_async().

Parameters

self

a TpDebugClient

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE, if the operation suceeded, FALSE otherwise

Since: 0.19.0


tp_debug_client_is_enabled ()

gboolean
tp_debug_client_is_enabled (TpDebugClient *self);

Return the “enabled” property

Parameters

self

a TpDebugClient

 

Returns

the value of “enabled” property

Since: 0.19.0

Types and Values

TpDebugClient

typedef struct _TpDebugClient TpDebugClient;

A proxy object for the debug interface of a Telepathy component.

Since: 0.19.0


TpDebugClientClass

typedef struct _TpDebugClientClass TpDebugClientClass;

The class of a TpDebugClient.

Since: 0.19.0

Property Details

The “enabled” property

  “enabled”                  gboolean

TRUE if debug messages are published on the bus.

This property is meaningless until the TP_DEBUG_CLIENT_FEATURE_CORE feature has been prepared.

Owner: TpDebugClient

Flags: Read

Default value: FALSE

Since: 0.19.0

Signal Details

The “new-debug-message” signal

void
user_function (TpDebugClient  *self,
               TpDebugMessage *message,
               gpointer        user_data)

Emitted when a TpDebugMessage is generated if the TpDebugMessage:enabled property is set to TRUE.

Parameters

self

a TpDebugClient

 

message

a TpDebugMessage

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.19.0

See Also

TpProxy

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-account-manager.html0000644000175000017500000005441514006623344024732 00000000000000 Service-side Account Manager interface: telepathy-glib API Reference Manual

Service-side Account Manager interface

Service-side Account Manager interface — GInterface for Telepathy AccountManager objects

Signals

void account-removed Has Details
void account-validity-changed Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcAccountManager

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

The TpSvcAccountManager interface (auto-generated from the Telepathy spec) makes it easier to export an object implementing the Telepathy AccountManager interface, with the correct method and signal signatures, and emit signals from that object in a type-safe way.

You don't need these interfaces unless you're implementing a Telepathy AccountManager, such as Mission Control.

Functions

tp_svc_account_manager_emit_account_removed ()

void
tp_svc_account_manager_emit_account_removed
                               (gpointer instance,
                                const gchar *arg_Account);

Type-safe wrapper around g_signal_emit to emit the AccountRemoved signal on interface org.freedesktop.Telepathy.AccountManager.

Parameters

instance

The object implementing this interface

 

arg_Account

const gchar * (FIXME, generate documentation)

 

tp_svc_account_manager_emit_account_validity_changed ()

void
tp_svc_account_manager_emit_account_validity_changed
                               (gpointer instance,
                                const gchar *arg_Account,
                                gboolean arg_Valid);

Type-safe wrapper around g_signal_emit to emit the AccountValidityChanged signal on interface org.freedesktop.Telepathy.AccountManager.

Parameters

instance

The object implementing this interface

 

arg_Account

const gchar * (FIXME, generate documentation)

 

arg_Valid

gboolean (FIXME, generate documentation)

 

tp_svc_account_manager_create_account_impl ()

void
(*tp_svc_account_manager_create_account_impl)
                               (TpSvcAccountManager *self,
                                const gchar *in_Connection_Manager,
                                const gchar *in_Protocol,
                                const gchar *in_Display_Name,
                                GHashTable *in_Parameters,
                                GHashTable *in_Properties,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CreateAccount on interface org.freedesktop.Telepathy.AccountManager.

Parameters

self

The object implementing this interface

 

in_Connection_Manager

const gchar * (FIXME, generate documentation)

 

in_Protocol

const gchar * (FIXME, generate documentation)

 

in_Display_Name

const gchar * (FIXME, generate documentation)

 

in_Parameters

GHashTable * (FIXME, generate documentation)

 

in_Properties

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_account_manager_return_from_create_account ()

void
tp_svc_account_manager_return_from_create_account
                               (DBusGMethodInvocation *context,
                                const gchar *out_Account);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Account

const gchar * (FIXME, generate documentation)

 

tp_svc_account_manager_implement_create_account ()

void
tp_svc_account_manager_implement_create_account
                               (TpSvcAccountManagerClass *klass,
                                tp_svc_account_manager_create_account_impl impl);

Register an implementation for the CreateAccount method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CreateAccount D-Bus method

 

Types and Values

TpSvcAccountManager

typedef struct _TpSvcAccountManager TpSvcAccountManager;

Dummy typedef representing any implementation of this interface.


TpSvcAccountManagerClass

typedef struct _TpSvcAccountManagerClass TpSvcAccountManagerClass;

The class of TpSvcAccountManager.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_account_manager (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_account_manager_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (create_account);
#undef IMPLEMENT
}

Signal Details

The “account-removed” signal

void
user_function (TpSvcAccountManager *self,
               DBusGObjectPath     *arg_Account,
               gpointer             user_data)

The AccountRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Account

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “account-validity-changed” signal

void
user_function (TpSvcAccountManager *self,
               DBusGObjectPath     *arg_Account,
               gboolean             arg_Valid,
               gpointer             user_data)

The AccountValidityChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Account

const gchar * (FIXME, generate documentation)

 

arg_Valid

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-simple-presence.html0000644000175000017500000012660214006623344026323 00000000000000 Connection SimplePresence interface: telepathy-glib API Reference Manual

Connection SimplePresence interface

Connection SimplePresence interface — client-side wrappers for the SimplePresence interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Most instant messaging protocols allow users to advertise their presence status. In Telepathy, this is represented by the SimplePresence interface, which lets applications advertise the presence status of the local user, and query the presence status of their contacts.

This section documents the auto-generated C wrappers for the SimplePresence interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_simple_presence_run_get_presences ()

gboolean
tp_cli_connection_interface_simple_presence_run_get_presences
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                GHashTable **out_Presence,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_simple_presence_run_get_presences is deprecated and should not be used in newly-written code.

Call the method GetPresences and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Get presence previously emitted by <tp:member-ref>PresencesChanged</tp:member-ref> for the given contacts. Data is returned in the same structure as the PresencesChanged signal; no additional network requests are made.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained.

 

out_Presence

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Presence information in the same format as for the <tp:member-ref>PresencesChanged</tp:member-ref> signal. The returned mapping MUST include an entry for each contact in the method's argument.</p> <p>The definition of the connection presence types Unknown and Offline means that if a connection manager will return Unknown for contacts not on the subscribe list, it MUST delay the reply to this method call until it has found out which contacts are, in fact, on the subscribe list.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_simple_presence_run_set_presence ()

gboolean
tp_cli_connection_interface_simple_presence_run_set_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                const gchar *in_Status_Message,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_simple_presence_run_set_presence is deprecated and should not be used in newly-written code.

Call the method SetPresence and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the presence status and status message are published for the connection. Changes will be indicated by <tp:member-ref>PresencesChanged</tp:member-ref> signals being emitted.</p> <p>This method may be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the selected status.</p> <p>In DISCONNECTED state the <tp:member-ref>Statuses</tp:member-ref> property will indicate which statuses are allowed to be set while DISCONNECTED (none, if the Connection Manager doesn't allow this). This value MUST NOT be cached, as the set of allowed presences might change upon connecting.</p>

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Status

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The string identifier of the desired status. Possible status identifiers are defined in the <tp:member-ref>Statuses</tp:member-ref> property.</p> <p>Clients MUST NOT set a status whose string value they do not recognise, even if its presence type in Statuses matches what the user requested.</p> <tp:rationale> <p>Suppose a protocol has statuses that include 'phone' (of type BUSY) and 'in-a-meeting' (of type BUSY), but there is no generic 'busy' status.</p> <p>If the user requests &quot;Busy&quot; status from a menu, a client author might be tempted to pick an arbitrary status that has type BUSY. However, on this protocol, neither of the choices would be appropriate, and incorrect information about the user would be conveyed.</p> </tp:rationale> <p>Statuses whose <tp:type>Connection_Presence_Type</tp:type> is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.</p> <tp:rationale> <p>To go offline, call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">Disconnect</tp:dbus-ref> instead. The &quot;error&quot; and &quot;unknown&quot; statuses make no sense.</p> </tp:rationale>

 

in_Status_Message

Used to pass an 'in' argument: The status message associated with the current status.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_simple_presence_call_get_presences ()

TpProxyPendingCall *
tp_cli_connection_interface_simple_presence_call_get_presences
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_simple_presence_callback_for_get_presences callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetPresences method call.

Get presence previously emitted by <tp:member-ref>PresencesChanged</tp:member-ref> for the given contacts. Data is returned in the same structure as the PresencesChanged signal; no additional network requests are made.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of the contacts whose presence should be obtained.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_simple_presence_call_set_presence ()

TpProxyPendingCall *
tp_cli_connection_interface_simple_presence_call_set_presence
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Status,
                                const gchar *in_Status_Message,
                                tp_cli_connection_interface_simple_presence_callback_for_set_presence callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetPresence method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the presence status and status message are published for the connection. Changes will be indicated by <tp:member-ref>PresencesChanged</tp:member-ref> signals being emitted.</p> <p>This method may be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the selected status.</p> <p>In DISCONNECTED state the <tp:member-ref>Statuses</tp:member-ref> property will indicate which statuses are allowed to be set while DISCONNECTED (none, if the Connection Manager doesn't allow this). This value MUST NOT be cached, as the set of allowed presences might change upon connecting.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Status

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The string identifier of the desired status. Possible status identifiers are defined in the <tp:member-ref>Statuses</tp:member-ref> property.</p> <p>Clients MUST NOT set a status whose string value they do not recognise, even if its presence type in Statuses matches what the user requested.</p> <tp:rationale> <p>Suppose a protocol has statuses that include 'phone' (of type BUSY) and 'in-a-meeting' (of type BUSY), but there is no generic 'busy' status.</p> <p>If the user requests &quot;Busy&quot; status from a menu, a client author might be tempted to pick an arbitrary status that has type BUSY. However, on this protocol, neither of the choices would be appropriate, and incorrect information about the user would be conveyed.</p> </tp:rationale> <p>Statuses whose <tp:type>Connection_Presence_Type</tp:type> is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.</p> <tp:rationale> <p>To go offline, call <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">Disconnect</tp:dbus-ref> instead. The &quot;error&quot; and &quot;unknown&quot; statuses make no sense.</p> </tp:rationale>

 

in_Status_Message

Used to pass an 'in' argument: The status message associated with the current status.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_simple_presence_callback_for_get_presences ()

void
(*tp_cli_connection_interface_simple_presence_callback_for_get_presences)
                               (TpConnection *proxy,
                                GHashTable *out_Presence,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetPresences method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Presence

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Presence information in the same format as for the <tp:member-ref>PresencesChanged</tp:member-ref> signal. The returned mapping MUST include an entry for each contact in the method's argument.</p> <p>The definition of the connection presence types Unknown and Offline means that if a connection manager will return Unknown for contacts not on the subscribe list, it MUST delay the reply to this method call until it has found out which contacts are, in fact, on the subscribe list.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_simple_presence_callback_for_set_presence ()

void
(*tp_cli_connection_interface_simple_presence_callback_for_set_presence)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetPresence method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_simple_presence_connect_to_presences_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_simple_presence_connect_to_presences_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_simple_presence_signal_callback_presences_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PresencesChanged.

This signal should be emitted when your own presence has been changed, or the presence of the member of any of the connection's channels has been changed.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_simple_presence_signal_callback_presences_changed ()

void
(*tp_cli_connection_interface_simple_presence_signal_callback_presences_changed)
                               (TpConnection *proxy,
                                GHashTable *arg_Presence,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PresencesChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_simple_presence_connect_to_presences_changed() was called

 

arg_Presence

A dictionary of contact handles mapped to the status, presence type and status message.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-cli-call-misc.html0000644000175000017500000030366614006623344023513 00000000000000 Channel Call misc interfaces: telepathy-glib API Reference Manual

Channel Call misc interfaces

Channel Call misc interfaces — client-side wrappers for misc call interfaces

Functions

TpProxyPendingCall * tp_cli_call_content_media_description_call_accept ()
TpProxyPendingCall * tp_cli_call_content_media_description_call_reject ()
void (*tp_cli_call_content_media_description_callback_for_accept) ()
void (*tp_cli_call_content_media_description_callback_for_reject) ()
TpProxyPendingCall * tp_cli_call_stream_endpoint_call_accept_selected_candidate_pair ()
TpProxyPendingCall * tp_cli_call_stream_endpoint_call_reject_selected_candidate_pair ()
TpProxyPendingCall * tp_cli_call_stream_endpoint_call_set_controlling ()
TpProxyPendingCall * tp_cli_call_stream_endpoint_call_set_endpoint_state ()
TpProxyPendingCall * tp_cli_call_stream_endpoint_call_set_selected_candidate_pair ()
void (*tp_cli_call_stream_endpoint_callback_for_accept_selected_candidate_pair) ()
void (*tp_cli_call_stream_endpoint_callback_for_reject_selected_candidate_pair) ()
void (*tp_cli_call_stream_endpoint_callback_for_set_controlling) ()
void (*tp_cli_call_stream_endpoint_callback_for_set_endpoint_state) ()
void (*tp_cli_call_stream_endpoint_callback_for_set_selected_candidate_pair) ()
TpProxySignalConnection * tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected ()
TpProxySignalConnection * tp_cli_call_stream_endpoint_connect_to_controlling_changed ()
TpProxySignalConnection * tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed ()
TpProxySignalConnection * tp_cli_call_stream_endpoint_connect_to_remote_candidates_added ()
TpProxySignalConnection * tp_cli_call_stream_endpoint_connect_to_remote_credentials_set ()
void (*tp_cli_call_stream_endpoint_signal_callback_candidate_pair_selected) ()
void (*tp_cli_call_stream_endpoint_signal_callback_controlling_changed) ()
void (*tp_cli_call_stream_endpoint_signal_callback_endpoint_state_changed) ()
void (*tp_cli_call_stream_endpoint_signal_callback_remote_candidates_added) ()
void (*tp_cli_call_stream_endpoint_signal_callback_remote_credentials_set) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Misc interfaces for calls.

Functions

tp_cli_call_content_media_description_call_accept ()

TpProxyPendingCall *
tp_cli_call_content_media_description_call_accept
                               (gpointer proxy,
                                gint timeout_ms,
                                GHashTable *in_Local_Media_Description,
                                tp_cli_call_content_media_description_callback_for_accept callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Accept method call.

Accepts the updated Description and update the corresponding local description. If FurtherNegotiationRequired is True, calling this method will generally cause a network round-trip and a new MediaDescription to be offered (hopefully with FurtherNegotiationRequired set to False).

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Local_Media_Description

Used to pass an 'in' argument: The local description to send to the remote contacts and to use in the <tp:dbus-ref namespace="ofdT.Call1">Content</tp:dbus-ref>.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_media_description_call_reject ()

TpProxyPendingCall *
tp_cli_call_content_media_description_call_reject
                               (gpointer proxy,
                                gint timeout_ms,
                                const GValueArray *in_Reason,
                                tp_cli_call_content_media_description_callback_for_reject callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Reject method call.

Reject the proposed update to the remote description.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Reason

Used to pass an 'in' argument: A structured reason for the rejection.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_content_media_description_callback_for_accept ()

void
(*tp_cli_call_content_media_description_callback_for_accept)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Accept method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_content_media_description_callback_for_reject ()

void
(*tp_cli_call_content_media_description_callback_for_reject)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Reject method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_call_accept_selected_candidate_pair ()

TpProxyPendingCall *
tp_cli_call_stream_endpoint_call_accept_selected_candidate_pair
                               (gpointer proxy,
                                gint timeout_ms,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                tp_cli_call_stream_endpoint_callback_for_accept_selected_candidate_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcceptSelectedCandidatePair method call.

Called in response to <tp:member-ref>CandidatePairSelected</tp:member-ref> if/when this candidate pair is known to have passed its connectivity checks.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Local_Candidate

Used to pass an 'in' argument: The local candidate that has been selected.

 

in_Remote_Candidate

Used to pass an 'in' argument: The remote candidate that has been selected.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_endpoint_call_reject_selected_candidate_pair ()

TpProxyPendingCall *
tp_cli_call_stream_endpoint_call_reject_selected_candidate_pair
                               (gpointer proxy,
                                gint timeout_ms,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                tp_cli_call_stream_endpoint_callback_for_reject_selected_candidate_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RejectSelectedCandidatePair method call.

Called in response to <tp:member-ref>CandidatePairSelected</tp:member-ref> if/when this candidate pair is known to have failed its connectivity checks.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Local_Candidate

Used to pass an 'in' argument: The local candidate that has been selected.

 

in_Remote_Candidate

Used to pass an 'in' argument: The remote candidate that has been selected.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_endpoint_call_set_controlling ()

TpProxyPendingCall *
tp_cli_call_stream_endpoint_call_set_controlling
                               (gpointer proxy,
                                gint timeout_ms,
                                gboolean in_Controlling,
                                tp_cli_call_stream_endpoint_callback_for_set_controlling callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetControlling method call.

Set whether the local side is taking the Controlling role. Note that if there are multiple endpoints (e.g. SIP call forking) it may be the case that all endpoints need to have the same controlling/controlled orientation.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Controlling

Used to pass an 'in' argument: The new value of <tp:member-ref>Controlling</tp:member-ref>.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_endpoint_call_set_endpoint_state ()

TpProxyPendingCall *
tp_cli_call_stream_endpoint_call_set_endpoint_state
                               (gpointer proxy,
                                gint timeout_ms,
                                guint in_Component,
                                guint in_State,
                                tp_cli_call_stream_endpoint_callback_for_set_endpoint_state callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetEndpointState method call.

Change the <tp:member-ref>EndpointState</tp:member-ref> of the endpoint.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Component

Used to pass an 'in' argument: The component whose state needs updating. (TpStreamComponent)

 

in_State

Used to pass an 'in' argument: The new state of this component. (TpStreamEndpointState)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_endpoint_call_set_selected_candidate_pair ()

TpProxyPendingCall *
tp_cli_call_stream_endpoint_call_set_selected_candidate_pair
                               (gpointer proxy,
                                gint timeout_ms,
                                const GValueArray *in_Local_Candidate,
                                const GValueArray *in_Remote_Candidate,
                                tp_cli_call_stream_endpoint_callback_for_set_selected_candidate_pair callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetSelectedCandidatePair method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Update the entry in <tp:member-ref>SelectedCandidatePairs</tp:member-ref> for a particular component, and signal it to the remote side.</p> <p>This method should only be called by the controlling side of an ICE session. See <tp:member-ref>CandidatePairSelected</tp:member-ref> for details.</p> <tp:rationale> <p>In the SDP offer/answer model, this signalling will take place as generating an updated offer. Note that updates may be queued up until information about all components of all streams is gathered.</p> </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Local_Candidate

Used to pass an 'in' argument: The local candidate that has been selected.

 

in_Remote_Candidate

Used to pass an 'in' argument: The remote candidate that has been selected.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_call_stream_endpoint_callback_for_accept_selected_candidate_pair ()

void
(*tp_cli_call_stream_endpoint_callback_for_accept_selected_candidate_pair)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcceptSelectedCandidatePair method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_callback_for_reject_selected_candidate_pair ()

void
(*tp_cli_call_stream_endpoint_callback_for_reject_selected_candidate_pair)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RejectSelectedCandidatePair method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_callback_for_set_controlling ()

void
(*tp_cli_call_stream_endpoint_callback_for_set_controlling)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetControlling method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_callback_for_set_endpoint_state ()

void
(*tp_cli_call_stream_endpoint_callback_for_set_endpoint_state)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetEndpointState method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_callback_for_set_selected_candidate_pair ()

void
(*tp_cli_call_stream_endpoint_callback_for_set_selected_candidate_pair)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetSelectedCandidatePair method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected ()

TpProxySignalConnection *
tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected
                               (gpointer proxy,
                                tp_cli_call_stream_endpoint_signal_callback_candidate_pair_selected callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal CandidatePairSelected.

Emitted when a candidate is selected for use in the stream by the controlling side of an ICE session. The controlled side should call <tp:member-ref>AcceptSelectedCandidatePair</tp:member-ref> or <tp:member-ref>RejectSelectedCandidatePair</tp:member-ref> when connectivity checks have either succeeded or failed for this candidate pair. See also: <tp:member-ref>SelectedCandidatePairs</tp:member-ref>.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_endpoint_connect_to_controlling_changed ()

TpProxySignalConnection *
tp_cli_call_stream_endpoint_connect_to_controlling_changed
                               (gpointer proxy,
                                tp_cli_call_stream_endpoint_signal_callback_controlling_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ControllingChanged.

The value of <tp:member-ref>Controlling</tp:member-ref> has changed.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed ()

TpProxySignalConnection *
tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed
                               (gpointer proxy,
                                tp_cli_call_stream_endpoint_signal_callback_endpoint_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal EndpointStateChanged.

Emitted when the <tp:member-ref>EndpointState</tp:member-ref> property changes.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_endpoint_connect_to_remote_candidates_added ()

TpProxySignalConnection *
tp_cli_call_stream_endpoint_connect_to_remote_candidates_added
                               (gpointer proxy,
                                tp_cli_call_stream_endpoint_signal_callback_remote_candidates_added callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RemoteCandidatesAdded.

Emitted when remote candidates are added to the <tp:member-ref>RemoteCandidates</tp:member-ref> property.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_endpoint_connect_to_remote_credentials_set ()

TpProxySignalConnection *
tp_cli_call_stream_endpoint_connect_to_remote_credentials_set
                               (gpointer proxy,
                                tp_cli_call_stream_endpoint_signal_callback_remote_credentials_set callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal RemoteCredentialsSet.

Emitted when the remote ICE credentials for the endpoint are set. If each candidate has different credentials, then this signal will never be fired.

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_call_stream_endpoint_signal_callback_candidate_pair_selected ()

void
(*tp_cli_call_stream_endpoint_signal_callback_candidate_pair_selected)
                               (TpProxy *proxy,
                                const GValueArray *arg_Local_Candidate,
                                const GValueArray *arg_Remote_Candidate,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal CandidatePairSelected.

Parameters

proxy

The proxy on which tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected() was called

 

arg_Local_Candidate

The local candidate that has been selected.

 

arg_Remote_Candidate

The remote candidate that has been selected.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_endpoint_signal_callback_controlling_changed ()

void
(*tp_cli_call_stream_endpoint_signal_callback_controlling_changed)
                               (TpProxy *proxy,
                                gboolean arg_Controlling,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ControllingChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_endpoint_connect_to_controlling_changed() was called

 

arg_Controlling

The new value of <tp:member-ref>Controlling</tp:member-ref>.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_endpoint_signal_callback_endpoint_state_changed ()

void
(*tp_cli_call_stream_endpoint_signal_callback_endpoint_state_changed)
                               (TpProxy *proxy,
                                guint arg_Component,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal EndpointStateChanged.

Parameters

proxy

The proxy on which tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed() was called

 

arg_Component

The component whose state has changed. (TpStreamComponent)

 

arg_State

The new state of this component. (TpStreamEndpointState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_endpoint_signal_callback_remote_candidates_added ()

void
(*tp_cli_call_stream_endpoint_signal_callback_remote_candidates_added)
                               (TpProxy *proxy,
                                const GPtrArray *arg_Candidates,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RemoteCandidatesAdded.

Parameters

proxy

The proxy on which tp_cli_call_stream_endpoint_connect_to_remote_candidates_added() was called

 

arg_Candidates

The candidates that were added.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_call_stream_endpoint_signal_callback_remote_credentials_set ()

void
(*tp_cli_call_stream_endpoint_signal_callback_remote_credentials_set)
                               (TpProxy *proxy,
                                const gchar *arg_Username,
                                const gchar *arg_Password,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal RemoteCredentialsSet.

Parameters

proxy

The proxy on which tp_cli_call_stream_endpoint_connect_to_remote_credentials_set() was called

 

arg_Username

The username set.

 

arg_Password

The password set.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/TpCallStreamEndpoint.html0000644000175000017500000011121014006623343022203 00000000000000 TpCallStreamEndpoint: telepathy-glib API Reference Manual

TpCallStreamEndpoint

TpCallStreamEndpoint — class for TpSvcCallStreamEndpoint implementations

Properties

gboolean controlling Read
TpDBusDaemon * dbus-daemon Read / Write / Construct Only
GHashTable_guint+guint_* endpoint-state Read
gboolean is-ice-lite Read / Write / Construct Only
gchar * object-path Read / Write / Construct Only
GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___* remote-candidates Read
GValueArray_gchararray+gchararray_* remote-credentials Read
GPtrArray_GValueArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue__+GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue____* selected-candidate-pairs Read
guint transport Read / Write / Construct Only

Signals

void candidate-accepted Run Last
void candidate-rejected Run Last
void candidate-selected Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpCallStreamEndpoint

Implemented Interfaces

TpCallStreamEndpoint implements TpSvcCallStreamEndpoint and TpSvcDBusProperties.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class makes it easier to write TpSvcCallStreamEndpoint implementations by implementing its properties and methods.

Functions

tp_call_stream_endpoint_new ()

TpCallStreamEndpoint *
tp_call_stream_endpoint_new (TpDBusDaemon *dbus_daemon,
                             const gchar *object_path,
                             TpStreamTransportType transport,
                             gboolean is_ice_lite);

Create a new TpCallStreamEndpoint object. It is registered on the bus at construction, and is unregistered at dispose.

Parameters

dbus_daemon

value of “dbus-daemon” property

 

object_path

value of “object-path” property

 

transport

value of “transport” property

 

is_ice_lite

value of “is_ice_lite” property

 

Returns

a new TpCallStreamEndpoint.

Since: 0.17.5


tp_call_stream_endpoint_get_object_path ()

const gchar *
tp_call_stream_endpoint_get_object_path
                               (TpCallStreamEndpoint *self);

Parameters

Returns

the value of “object-path”

Since: 0.17.5


tp_call_stream_endpoint_get_state ()

TpStreamEndpointState
tp_call_stream_endpoint_get_state (TpCallStreamEndpoint *self,
                                   TpStreamComponent component);

Parameters

self

a TpCallStreamEndpoint

 

component

a TpStreamComponent

 

Returns

the state of self 's component

Since: 0.17.5


tp_call_stream_endpoint_add_new_candidates ()

void
tp_call_stream_endpoint_add_new_candidates
                               (TpCallStreamEndpoint *self,
                                const GPtrArray *candidates);

Add candidates to the “remote-candidates” property. See Also: tp_call_stream_endpoint_add_new_candidate().

Parameters

self

a TpCallStreamEndpoint

 

candidates

GPtrArray of GValueArray defining the candidates to add

 

Since: 0.17.5


tp_call_stream_endpoint_add_new_candidate ()

void
tp_call_stream_endpoint_add_new_candidate
                               (TpCallStreamEndpoint *self,
                                TpStreamComponent component,
                                const gchar *address,
                                guint port,
                                const GHashTable *info_hash);

Add a candidate to the “remote-candidates” property. See Also: tp_call_stream_endpoint_add_new_candidates().

Parameters

self

a TpCallStreamEndpoint

 

component

a TpStreamComponent

 

address

an IP address

 

port

a port number

 

info_hash

string -> GValue mapping for extra info

 

Since: 0.17.5


tp_call_stream_endpoint_set_remote_credentials ()

void
tp_call_stream_endpoint_set_remote_credentials
                               (TpCallStreamEndpoint *self,
                                const gchar *username,
                                const gchar *password);

Set the username and password to use for self 's crendentials.

Parameters

self

a TpCallStreamEndpoint

 

username

the username

 

password

the password

 

Since: 0.17.5

Types and Values

struct TpCallStreamEndpoint

struct TpCallStreamEndpoint;

A class for call stream endpoint implementations

Since: 0.17.5


struct TpCallStreamEndpointClass

struct TpCallStreamEndpointClass {
};

The class structure for TpCallStreamEndpoint

Since: 0.17.5

Property Details

The “controlling” property

  “controlling”              gboolean

Whether or not the local side is taking the controlling role.

Owner: TpCallStreamEndpoint

Flags: Read

Default value: FALSE

Since: 0.17.5


The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

The connection to the DBus daemon owning the CM.

Owner: TpCallStreamEndpoint

Flags: Read / Write / Construct Only

Since: 0.17.5


The “endpoint-state” property

  “endpoint-state”           GHashTable_guint+guint_*

GHashTable{TpStreamComponent -> TpStreamEndpointState} The state of this endpoint.

Owner: TpCallStreamEndpoint

Flags: Read

Since: 0.17.5


The “is-ice-lite” property

  “is-ice-lite”              gboolean

Whether or not the Remote side is an ICE Lite endpoint.

Owner: TpCallStreamEndpoint

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.17.5


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus.

Owner: TpCallStreamEndpoint

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.17.5


The “remote-candidates” property

  “remote-candidates”        GPtrArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue___*

GPtrArray{candidate GValueArray} The remote candidates of this endpoint.

Owner: TpCallStreamEndpoint

Flags: Read

Since: 0.17.5


The “remote-credentials” property

  “remote-credentials”       GValueArray_gchararray+gchararray_*

GValueArray{username string, password string} The remote credentials of this endpoint.

Owner: TpCallStreamEndpoint

Flags: Read

Since: 0.17.5


The “selected-candidate-pairs” property

  “selected-candidate-pairs” GPtrArray_GValueArray_GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue__+GValueArray_guint+gchararray+guint+GHashTable_gchararray+GValue____*

GPtrArray{local-candidate GValueArray, remote-candidate GValueArray} The candidate pairs selected for this endpoint.

Owner: TpCallStreamEndpoint

Flags: Read

Since: 0.17.5


The “transport” property

  “transport”                guint

The TpStreamTransportType for the content of this endpoint.

Owner: TpCallStreamEndpoint

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5

Signal Details

The “candidate-accepted” signal

void
user_function (TpCallStreamEndpoint *self,
               gpointer              user_data)

The ::candidate-accepted signal is emitted whenever AcceptSelectedCandidatePair DBus method has been called on this object.

Parameters

self

the TpCallStreamEndpoint

 

local_candidate

the local candidate

 

remote_candidate

the remote candidate

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “candidate-rejected” signal

void
user_function (TpCallStreamEndpoint *self,
               gpointer              user_data)

The ::candidate-rejected signal is emitted whenever RejectSelectedCandidatePair DBus method has been called on this object.

Parameters

self

the TpCallStreamEndpoint

 

local_candidate

the local candidate

 

remote_candidate

the remote candidate

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5


The “candidate-selected” signal

void
user_function (TpCallStreamEndpoint *self,
               gpointer              user_data)

The ::candidate-selected signal is emitted whenever SetSelectedCandidatePair DBus method has been called on this object.

Parameters

self

the TpCallStreamEndpoint

 

local_candidate

the local candidate

 

remote_candidate

the remote candidate

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 0.17.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-media.html0000644000175000017500000041431114006623344024346 00000000000000 Media channels: telepathy-glib API Reference Manual

Media channels

Media channels — service-side interfaces for the Streamed Media channel type, and the Call State, DTMF and Media Signalling interfaces

Functions

void (*tp_svc_channel_type_streamed_media_list_streams_impl) ()
void tp_svc_channel_type_streamed_media_implement_list_streams ()
void tp_svc_channel_type_streamed_media_return_from_list_streams ()
void (*tp_svc_channel_type_streamed_media_remove_streams_impl) ()
void tp_svc_channel_type_streamed_media_implement_remove_streams ()
void tp_svc_channel_type_streamed_media_return_from_remove_streams ()
void (*tp_svc_channel_type_streamed_media_request_stream_direction_impl) ()
void tp_svc_channel_type_streamed_media_implement_request_stream_direction ()
void tp_svc_channel_type_streamed_media_return_from_request_stream_direction ()
void (*tp_svc_channel_type_streamed_media_request_streams_impl) ()
void tp_svc_channel_type_streamed_media_implement_request_streams ()
void tp_svc_channel_type_streamed_media_return_from_request_streams ()
void tp_svc_channel_type_streamed_media_emit_stream_added ()
void tp_svc_channel_type_streamed_media_emit_stream_direction_changed ()
void tp_svc_channel_type_streamed_media_emit_stream_error ()
void tp_svc_channel_type_streamed_media_emit_stream_removed ()
void tp_svc_channel_type_streamed_media_emit_stream_state_changed ()
void tp_svc_channel_interface_call_state_emit_call_state_changed ()
void (*tp_svc_channel_interface_call_state_get_call_states_impl) ()
void tp_svc_channel_interface_call_state_implement_get_call_states ()
void tp_svc_channel_interface_call_state_return_from_get_call_states ()
void tp_svc_channel_interface_dtmf_implement_multiple_tones ()
void tp_svc_channel_interface_dtmf_implement_start_tone ()
void tp_svc_channel_interface_dtmf_implement_stop_tone ()
void tp_svc_channel_interface_dtmf_return_from_multiple_tones ()
void tp_svc_channel_interface_dtmf_return_from_start_tone ()
void tp_svc_channel_interface_dtmf_return_from_stop_tone ()
void (*tp_svc_channel_interface_dtmf_multiple_tones_impl) ()
void (*tp_svc_channel_interface_dtmf_start_tone_impl) ()
void (*tp_svc_channel_interface_dtmf_stop_tone_impl) ()
void tp_svc_channel_interface_dtmf_emit_sending_tones ()
void tp_svc_channel_interface_dtmf_emit_stopped_tones ()
void tp_svc_channel_interface_dtmf_emit_tones_deferred ()
void (*tp_svc_channel_interface_hold_get_hold_state_impl) ()
void tp_svc_channel_interface_hold_return_from_get_hold_state ()
void tp_svc_channel_interface_hold_implement_get_hold_state ()
void (*tp_svc_channel_interface_hold_request_hold_impl) ()
void tp_svc_channel_interface_hold_return_from_request_hold ()
void tp_svc_channel_interface_hold_implement_request_hold ()
void tp_svc_channel_interface_hold_emit_hold_state_changed ()
void (*tp_svc_channel_interface_media_signalling_get_session_handlers_impl) ()
void tp_svc_channel_interface_media_signalling_implement_get_session_handlers ()
void tp_svc_channel_interface_media_signalling_return_from_get_session_handlers ()
void tp_svc_channel_interface_media_signalling_emit_new_session_handler ()

Signals

void stream-added Has Details
void stream-direction-changed Has Details
void stream-error Has Details
void stream-removed Has Details
void stream-state-changed Has Details
void call-state-changed Has Details
void sending-tones Has Details
void stopped-tones Has Details
void tones-deferred Has Details
void hold-state-changed Has Details
void new-session-handler Has Details

Object Hierarchy

    GInterface
    ├── TpSvcChannelInterfaceCallState
    ├── TpSvcChannelInterfaceDTMF
    ├── TpSvcChannelInterfaceHold
    ├── TpSvcChannelInterfaceMediaSignalling
    ╰── TpSvcChannelTypeStreamedMedia

Known Implementations

TpSvcChannelInterfaceDTMF is implemented by TpBaseCallChannel and TpBaseMediaCallChannel.

TpSvcChannelInterfaceHold is implemented by TpBaseMediaCallChannel.

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This section documents the auto-generated C wrappers for the Streamed Media channel type, and some interfaces which are optionally supported by channels of this type.

Streamed Media channels represent real-time audio or video streaming, including voice over IP, webcams, and telephony.

Channels of type Streamed Media may support the Media Signalling interface. If not, the connection manager is assumed to be presenting the media streams to the user automatically (for instance, in a connection manager like gnome-phone-manager or telepathy-snom that remotely controls a telephone, the phone's own speaker and microphone will probably be used directly).

If Media Signalling is supported, the Telepathy client is responsible for actually streaming the media, using the Media Signalling interface to provide signalling (connection managers might implement this interface in terms of Jingle or SDP, for instance).

Channels of type Streamed Media may also support the DTMF and CallState interfaces.

Functions

tp_svc_channel_type_streamed_media_list_streams_impl ()

void
(*tp_svc_channel_type_streamed_media_list_streams_impl)
                               (TpSvcChannelTypeStreamedMedia *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method ListStreams on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_streamed_media_implement_list_streams ()

void
tp_svc_channel_type_streamed_media_implement_list_streams
                               (TpSvcChannelTypeStreamedMediaClass *klass,
                                tp_svc_channel_type_streamed_media_list_streams_impl impl);

Register an implementation for the ListStreams method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the ListStreams D-Bus method

 

tp_svc_channel_type_streamed_media_return_from_list_streams ()

void
tp_svc_channel_type_streamed_media_return_from_list_streams
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Streams);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Streams

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_remove_streams_impl ()

void
(*tp_svc_channel_type_streamed_media_remove_streams_impl)
                               (TpSvcChannelTypeStreamedMedia *self,
                                const GArray *in_Streams,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RemoveStreams on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

self

The object implementing this interface

 

in_Streams

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_streamed_media_implement_remove_streams ()

void
tp_svc_channel_type_streamed_media_implement_remove_streams
                               (TpSvcChannelTypeStreamedMediaClass *klass,
                                tp_svc_channel_type_streamed_media_remove_streams_impl impl);

Register an implementation for the RemoveStreams method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RemoveStreams D-Bus method

 

tp_svc_channel_type_streamed_media_return_from_remove_streams ()

void
tp_svc_channel_type_streamed_media_return_from_remove_streams
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_streamed_media_request_stream_direction_impl ()

void
(*tp_svc_channel_type_streamed_media_request_stream_direction_impl)
                               (TpSvcChannelTypeStreamedMedia *self,
                                guint in_Stream_ID,
                                guint in_Stream_Direction,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestStreamDirection on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

self

The object implementing this interface

 

in_Stream_ID

guint (FIXME, generate documentation)

 

in_Stream_Direction

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_streamed_media_implement_request_stream_direction ()

void
tp_svc_channel_type_streamed_media_implement_request_stream_direction
                               (TpSvcChannelTypeStreamedMediaClass *klass,
                                tp_svc_channel_type_streamed_media_request_stream_direction_impl impl);

Register an implementation for the RequestStreamDirection method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestStreamDirection D-Bus method

 

tp_svc_channel_type_streamed_media_return_from_request_stream_direction ()

void
tp_svc_channel_type_streamed_media_return_from_request_stream_direction
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_streamed_media_request_streams_impl ()

void
(*tp_svc_channel_type_streamed_media_request_streams_impl)
                               (TpSvcChannelTypeStreamedMedia *self,
                                guint in_Contact_Handle,
                                const GArray *in_Types,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestStreams on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

self

The object implementing this interface

 

in_Contact_Handle

guint (FIXME, generate documentation)

 

in_Types

const GArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_streamed_media_implement_request_streams ()

void
tp_svc_channel_type_streamed_media_implement_request_streams
                               (TpSvcChannelTypeStreamedMediaClass *klass,
                                tp_svc_channel_type_streamed_media_request_streams_impl impl);

Register an implementation for the RequestStreams method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestStreams D-Bus method

 

tp_svc_channel_type_streamed_media_return_from_request_streams ()

void
tp_svc_channel_type_streamed_media_return_from_request_streams
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Streams);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Streams

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_emit_stream_added ()

void
tp_svc_channel_type_streamed_media_emit_stream_added
                               (gpointer instance,
                                guint arg_Stream_ID,
                                guint arg_Contact_Handle,
                                guint arg_Stream_Type);

Type-safe wrapper around g_signal_emit to emit the StreamAdded signal on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

instance

The object implementing this interface

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Contact_Handle

guint (FIXME, generate documentation)

 

arg_Stream_Type

guint (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_emit_stream_direction_changed ()

void
tp_svc_channel_type_streamed_media_emit_stream_direction_changed
                               (gpointer instance,
                                guint arg_Stream_ID,
                                guint arg_Stream_Direction,
                                guint arg_Pending_Flags);

Type-safe wrapper around g_signal_emit to emit the StreamDirectionChanged signal on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

instance

The object implementing this interface

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Stream_Direction

guint (FIXME, generate documentation)

 

arg_Pending_Flags

guint (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_emit_stream_error ()

void
tp_svc_channel_type_streamed_media_emit_stream_error
                               (gpointer instance,
                                guint arg_Stream_ID,
                                guint arg_Error_Code,
                                const gchar *arg_Message);

Type-safe wrapper around g_signal_emit to emit the StreamError signal on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

instance

The object implementing this interface

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Error_Code

guint (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_emit_stream_removed ()

void
tp_svc_channel_type_streamed_media_emit_stream_removed
                               (gpointer instance,
                                guint arg_Stream_ID);

Type-safe wrapper around g_signal_emit to emit the StreamRemoved signal on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

instance

The object implementing this interface

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

tp_svc_channel_type_streamed_media_emit_stream_state_changed ()

void
tp_svc_channel_type_streamed_media_emit_stream_state_changed
                               (gpointer instance,
                                guint arg_Stream_ID,
                                guint arg_Stream_State);

Type-safe wrapper around g_signal_emit to emit the StreamStateChanged signal on interface org.freedesktop.Telepathy.Channel.Type.StreamedMedia.

Parameters

instance

The object implementing this interface

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Stream_State

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_call_state_emit_call_state_changed ()

void
tp_svc_channel_interface_call_state_emit_call_state_changed
                               (gpointer instance,
                                guint arg_Contact,
                                guint arg_State);

Type-safe wrapper around g_signal_emit to emit the CallStateChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.CallState.

Parameters

instance

The object implementing this interface

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_call_state_get_call_states_impl ()

void
(*tp_svc_channel_interface_call_state_get_call_states_impl)
                               (TpSvcChannelInterfaceCallState *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetCallStates on interface org.freedesktop.Telepathy.Channel.Interface.CallState.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_call_state_implement_get_call_states ()

void
tp_svc_channel_interface_call_state_implement_get_call_states
                               (TpSvcChannelInterfaceCallStateClass *klass,
                                tp_svc_channel_interface_call_state_get_call_states_impl impl);

Register an implementation for the GetCallStates method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetCallStates D-Bus method

 

tp_svc_channel_interface_call_state_return_from_get_call_states ()

void
tp_svc_channel_interface_call_state_return_from_get_call_states
                               (DBusGMethodInvocation *context,
                                GHashTable *out_States);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_States

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_dtmf_implement_multiple_tones ()

void
tp_svc_channel_interface_dtmf_implement_multiple_tones
                               (TpSvcChannelInterfaceDTMFClass *klass,
                                tp_svc_channel_interface_dtmf_multiple_tones_impl impl);

Register an implementation for the MultipleTones method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the MultipleTones D-Bus method

 

tp_svc_channel_interface_dtmf_implement_start_tone ()

void
tp_svc_channel_interface_dtmf_implement_start_tone
                               (TpSvcChannelInterfaceDTMFClass *klass,
                                tp_svc_channel_interface_dtmf_start_tone_impl impl);

Register an implementation for the StartTone method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StartTone D-Bus method

 

tp_svc_channel_interface_dtmf_implement_stop_tone ()

void
tp_svc_channel_interface_dtmf_implement_stop_tone
                               (TpSvcChannelInterfaceDTMFClass *klass,
                                tp_svc_channel_interface_dtmf_stop_tone_impl impl);

Register an implementation for the StopTone method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StopTone D-Bus method

 

tp_svc_channel_interface_dtmf_return_from_multiple_tones ()

void
tp_svc_channel_interface_dtmf_return_from_multiple_tones
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_dtmf_return_from_start_tone ()

void
tp_svc_channel_interface_dtmf_return_from_start_tone
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_dtmf_return_from_stop_tone ()

void
tp_svc_channel_interface_dtmf_return_from_stop_tone
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_dtmf_multiple_tones_impl ()

void
(*tp_svc_channel_interface_dtmf_multiple_tones_impl)
                               (TpSvcChannelInterfaceDTMF *self,
                                const gchar *in_Tones,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method MultipleTones on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

self

The object implementing this interface

 

in_Tones

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_dtmf_start_tone_impl ()

void
(*tp_svc_channel_interface_dtmf_start_tone_impl)
                               (TpSvcChannelInterfaceDTMF *self,
                                guint in_Stream_ID,
                                guchar in_Event,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StartTone on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

self

The object implementing this interface

 

in_Stream_ID

guint (FIXME, generate documentation)

 

in_Event

guchar (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_dtmf_stop_tone_impl ()

void
(*tp_svc_channel_interface_dtmf_stop_tone_impl)
                               (TpSvcChannelInterfaceDTMF *self,
                                guint in_Stream_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StopTone on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

self

The object implementing this interface

 

in_Stream_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_dtmf_emit_sending_tones ()

void
tp_svc_channel_interface_dtmf_emit_sending_tones
                               (gpointer instance,
                                const gchar *arg_Tones);

Type-safe wrapper around g_signal_emit to emit the SendingTones signal on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_interface_dtmf_emit_stopped_tones ()

void
tp_svc_channel_interface_dtmf_emit_stopped_tones
                               (gpointer instance,
                                gboolean arg_Cancelled);

Type-safe wrapper around g_signal_emit to emit the StoppedTones signal on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Cancelled

gboolean (FIXME, generate documentation)

 

tp_svc_channel_interface_dtmf_emit_tones_deferred ()

void
tp_svc_channel_interface_dtmf_emit_tones_deferred
                               (gpointer instance,
                                const gchar *arg_Tones);

Type-safe wrapper around g_signal_emit to emit the TonesDeferred signal on interface org.freedesktop.Telepathy.Channel.Interface.DTMF.

Parameters

instance

The object implementing this interface

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

tp_svc_channel_interface_hold_get_hold_state_impl ()

void
(*tp_svc_channel_interface_hold_get_hold_state_impl)
                               (TpSvcChannelInterfaceHold *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetHoldState on interface org.freedesktop.Telepathy.Channel.Interface.Hold.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_hold_return_from_get_hold_state ()

void
tp_svc_channel_interface_hold_return_from_get_hold_state
                               (DBusGMethodInvocation *context,
                                guint out_HoldState,
                                guint out_Reason);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_HoldState

guint (FIXME, generate documentation)

 

out_Reason

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_hold_implement_get_hold_state ()

void
tp_svc_channel_interface_hold_implement_get_hold_state
                               (TpSvcChannelInterfaceHoldClass *klass,
                                tp_svc_channel_interface_hold_get_hold_state_impl impl);

Register an implementation for the GetHoldState method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetHoldState D-Bus method

 

tp_svc_channel_interface_hold_request_hold_impl ()

void
(*tp_svc_channel_interface_hold_request_hold_impl)
                               (TpSvcChannelInterfaceHold *self,
                                gboolean in_Hold,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method RequestHold on interface org.freedesktop.Telepathy.Channel.Interface.Hold.

Parameters

self

The object implementing this interface

 

in_Hold

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_hold_return_from_request_hold ()

void
tp_svc_channel_interface_hold_return_from_request_hold
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_interface_hold_implement_request_hold ()

void
tp_svc_channel_interface_hold_implement_request_hold
                               (TpSvcChannelInterfaceHoldClass *klass,
                                tp_svc_channel_interface_hold_request_hold_impl impl);

Register an implementation for the RequestHold method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the RequestHold D-Bus method

 

tp_svc_channel_interface_hold_emit_hold_state_changed ()

void
tp_svc_channel_interface_hold_emit_hold_state_changed
                               (gpointer instance,
                                guint arg_HoldState,
                                guint arg_Reason);

Type-safe wrapper around g_signal_emit to emit the HoldStateChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Hold.

Parameters

instance

The object implementing this interface

 

arg_HoldState

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

tp_svc_channel_interface_media_signalling_get_session_handlers_impl ()

void
(*tp_svc_channel_interface_media_signalling_get_session_handlers_impl)
                               (TpSvcChannelInterfaceMediaSignalling *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method GetSessionHandlers on interface org.freedesktop.Telepathy.Channel.Interface.MediaSignalling.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_interface_media_signalling_implement_get_session_handlers ()

void
tp_svc_channel_interface_media_signalling_implement_get_session_handlers
                               (TpSvcChannelInterfaceMediaSignallingClass *klass,
                                tp_svc_channel_interface_media_signalling_get_session_handlers_impl impl);

Register an implementation for the GetSessionHandlers method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the GetSessionHandlers D-Bus method

 

tp_svc_channel_interface_media_signalling_return_from_get_session_handlers ()

void
tp_svc_channel_interface_media_signalling_return_from_get_session_handlers
                               (DBusGMethodInvocation *context,
                                const GPtrArray *out_Session_Handlers);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

out_Session_Handlers

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_channel_interface_media_signalling_emit_new_session_handler ()

void
tp_svc_channel_interface_media_signalling_emit_new_session_handler
                               (gpointer instance,
                                const gchar *arg_Session_Handler,
                                const gchar *arg_Session_Type);

Type-safe wrapper around g_signal_emit to emit the NewSessionHandler signal on interface org.freedesktop.Telepathy.Channel.Interface.MediaSignalling.

Parameters

instance

The object implementing this interface

 

arg_Session_Handler

const gchar * (FIXME, generate documentation)

 

arg_Session_Type

const gchar * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeStreamedMedia

typedef struct _TpSvcChannelTypeStreamedMedia TpSvcChannelTypeStreamedMedia;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeStreamedMediaClass

typedef struct _TpSvcChannelTypeStreamedMediaClass TpSvcChannelTypeStreamedMediaClass;

The class of TpSvcChannelTypeStreamedMedia.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_streamed_media (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_streamed_media_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (list_streams);
  IMPLEMENT (remove_streams);
  IMPLEMENT (request_stream_direction);
  IMPLEMENT (request_streams);
#undef IMPLEMENT
}

TpSvcChannelInterfaceCallState

typedef struct _TpSvcChannelInterfaceCallState TpSvcChannelInterfaceCallState;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceCallStateClass

typedef struct _TpSvcChannelInterfaceCallStateClass TpSvcChannelInterfaceCallStateClass;

The class of TpSvcChannelInterfaceCallState.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_call_state (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_call_state_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_call_states);
#undef IMPLEMENT
}

TpSvcChannelInterfaceDTMF

typedef struct _TpSvcChannelInterfaceDTMF TpSvcChannelInterfaceDTMF;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceDTMFClass

typedef struct _TpSvcChannelInterfaceDTMFClass TpSvcChannelInterfaceDTMFClass;

The class of TpSvcChannelInterfaceDTMF.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_dtmf (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_dtmf_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (start_tone);
  IMPLEMENT (stop_tone);
  IMPLEMENT (multiple_tones);
#undef IMPLEMENT
}

TpSvcChannelInterfaceHold

typedef struct _TpSvcChannelInterfaceHold TpSvcChannelInterfaceHold;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceHoldClass

typedef struct _TpSvcChannelInterfaceHoldClass TpSvcChannelInterfaceHoldClass;

The class of TpSvcChannelInterfaceHold.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_hold (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_hold_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_hold_state);
  IMPLEMENT (request_hold);
#undef IMPLEMENT
}

TpSvcChannelInterfaceMediaSignalling

typedef struct _TpSvcChannelInterfaceMediaSignalling TpSvcChannelInterfaceMediaSignalling;

Dummy typedef representing any implementation of this interface.


TpSvcChannelInterfaceMediaSignallingClass

typedef struct _TpSvcChannelInterfaceMediaSignallingClass TpSvcChannelInterfaceMediaSignallingClass;

The class of TpSvcChannelInterfaceMediaSignalling.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_interface_media_signalling (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_interface_media_signalling_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (get_session_handlers);
#undef IMPLEMENT
}

Signal Details

The “stream-added” signal

void
user_function (TpSvcChannelTypeStreamedMedia *self,
               guint                          arg_Stream_ID,
               guint                          arg_Contact_Handle,
               guint                          arg_Stream_Type,
               gpointer                       user_data)

The StreamAdded D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Contact_Handle

guint (FIXME, generate documentation)

 

arg_Stream_Type

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stream-direction-changed” signal

void
user_function (TpSvcChannelTypeStreamedMedia *self,
               guint                          arg_Stream_ID,
               guint                          arg_Stream_Direction,
               guint                          arg_Pending_Flags,
               gpointer                       user_data)

The StreamDirectionChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Stream_Direction

guint (FIXME, generate documentation)

 

arg_Pending_Flags

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stream-error” signal

void
user_function (TpSvcChannelTypeStreamedMedia *self,
               guint                          arg_Stream_ID,
               guint                          arg_Error_Code,
               gchar                         *arg_Message,
               gpointer                       user_data)

The StreamError D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Error_Code

guint (FIXME, generate documentation)

 

arg_Message

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stream-removed” signal

void
user_function (TpSvcChannelTypeStreamedMedia *self,
               guint                          arg_Stream_ID,
               gpointer                       user_data)

The StreamRemoved D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stream-state-changed” signal

void
user_function (TpSvcChannelTypeStreamedMedia *self,
               guint                          arg_Stream_ID,
               guint                          arg_Stream_State,
               gpointer                       user_data)

The StreamStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_ID

guint (FIXME, generate documentation)

 

arg_Stream_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “call-state-changed” signal

void
user_function (TpSvcChannelInterfaceCallState *self,
               guint                           arg_Contact,
               guint                           arg_State,
               gpointer                        user_data)

The CallStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Contact

guint (FIXME, generate documentation)

 

arg_State

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “sending-tones” signal

void
user_function (TpSvcChannelInterfaceDTMF *self,
               gchar                     *arg_Tones,
               gpointer                   user_data)

The SendingTones D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stopped-tones” signal

void
user_function (TpSvcChannelInterfaceDTMF *self,
               gboolean                   arg_Cancelled,
               gpointer                   user_data)

The StoppedTones D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Cancelled

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “tones-deferred” signal

void
user_function (TpSvcChannelInterfaceDTMF *self,
               gchar                     *arg_Tones,
               gpointer                   user_data)

The TonesDeferred D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Tones

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “hold-state-changed” signal

void
user_function (TpSvcChannelInterfaceHold *self,
               guint                      arg_HoldState,
               guint                      arg_Reason,
               gpointer                   user_data)

The HoldStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_HoldState

guint (FIXME, generate documentation)

 

arg_Reason

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “new-session-handler” signal

void
user_function (TpSvcChannelInterfaceMediaSignalling *self,
               DBusGObjectPath                      *arg_Session_Handler,
               gchar                                *arg_Session_Type,
               gpointer                              user_data)

The NewSessionHandler D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Session_Handler

const gchar * (FIXME, generate documentation)

 

arg_Session_Type

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/TpCallContentMediaDescription.html0000644000175000017500000017662114006623343024046 00000000000000 TpCallContentMediaDescription: telepathy-glib API Reference Manual

TpCallContentMediaDescription

TpCallContentMediaDescription — implementation of TpSvcCallContentMediaDescription

Properties

GPtrArray_GValueArray_guint+gchararray+guint+guint+gboolean+GHashTable_gchararray+gchararray___* codecs Read
TpDBusDaemon * dbus-daemon Read / Write / Construct Only
guint dlrr-max-size Read
gboolean does-avpf Read
guint duplicate-rle-max-size Read
gboolean enable-metrics Read
GHashTable_guint+GValueArray_guint+GPtrArray_GValueArray_gchararray+gchararray+gchararray____* feedback-messages Read
gboolean further-negotiation-required Read / Write / Construct Only
gboolean has-remote-information Read / Write / Construct Only
GPtrArray_GValueArray_guint+guint+gchararray+gchararray__* header-extensions Read
GStrv interfaces Read
guint loss-rle-max-size Read
gchar * object-path Read / Write / Construct Only
guint packet-receipt-times-max-size Read
guint remote-contact Read / Write / Construct Only
guint rtt-mode Read
GHashTable_guint+GArray_guint__* ssrcs Read
guint statistics-flags Read

Object Hierarchy

    GObject
    ╰── TpCallContentMediaDescription

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class is used to negociate the media description used with a remote contact. To be used with TpBaseMediaCallContent implementations.

Functions

tp_call_content_media_description_new ()

TpCallContentMediaDescription *
tp_call_content_media_description_new (TpDBusDaemon *dbus_daemon,
                                       const gchar *object_path,
                                       TpHandle remote_contact,
                                       gboolean has_remote_information,
                                       gboolean further_negotiation_required);

Create a new TpCallContentMediaDescription object. More information can be added after construction using tp_call_content_media_description_append_codec() and tp_call_content_media_description_add_ssrc().

Once all information has been filled, the media description can be offered using tp_base_media_call_content_offer_media_description_async().

Parameters

dbus_daemon

value of “dbus-daemon” property

 

object_path

value of “object-path” property

 

remote_contact

value of “remote-contact” property

 

has_remote_information

value of “has_remote_information” property

 

further_negotiation_required

value of “further_negotiation_required” property

 

Since: 0.17.5


tp_call_content_media_description_get_object_path ()

const gchar *
tp_call_content_media_description_get_object_path
                               (TpCallContentMediaDescription *self);

Parameters

Returns

the value of “object-path”

Since: 0.17.5


tp_call_content_media_description_get_remote_contact ()

TpHandle
tp_call_content_media_description_get_remote_contact
                               (TpCallContentMediaDescription *self);

Parameters

Returns

the value of “remote-contact”

Since: 0.17.5


tp_call_content_media_description_append_codec ()

void
tp_call_content_media_description_append_codec
                               (TpCallContentMediaDescription *self,
                                guint identifier,
                                const gchar *name,
                                guint clock_rate,
                                guint channels,
                                gboolean updated,
                                GHashTable *parameters);

Add description for a supported codec.

Parameters

self

a TpCallContentMediaDescription

 

identifier

Numeric identifier for the codec. This will be used as the PT in the SDP or content description.

 

name

The name of the codec.

 

clock_rate

The clock rate of the codec.

 

channels

Number of channels of the codec if applicable, otherwise 0.

 

updated

TRUE if this codec was updated since the last Media Description

 

parameters

a GHashTable of string->string containing optional parameters

 

Since: 0.17.5


tp_call_content_media_description_add_ssrc ()

void
tp_call_content_media_description_add_ssrc
                               (TpCallContentMediaDescription *self,
                                TpHandle contact,
                                guint ssrc);

Add an SSRC to the list of SSRCs that a contact will send from. A SSRC is a synchronization source in RTP, it is the identifier for a continuous stream of packets following the same timeline.

Parameters

self

a TpCallContentMediaDescription

 

contact

The TpHandle of a contact that is part of the call

 

ssrc

A SSRC that this contact may send from

 

Since: 0.17.5


tp_call_content_media_description_add_rtp_header_extension ()

void
tp_call_content_media_description_add_rtp_header_extension
                               (TpCallContentMediaDescription *self,
                                guint id,
                                TpMediaStreamDirection direction,
                                const gchar *uri,
                                const gchar *parameters);

Add an element to the “header-extensions” property.

Implement TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS interface.

Parameters

self

a TpCallContentMediaDescription

 

id

identifier to be negotiated.

 

direction

a TpMediaStreamDirection in which the Header Extension is negotiated.

 

uri

URI defining the extension.

 

parameters

Feedback parameters as a string. Format is defined in the relevant RFC.

 

Since: 0.17.6


tp_call_content_media_description_add_rtcp_feedback_message ()

void
tp_call_content_media_description_add_rtcp_feedback_message
                               (TpCallContentMediaDescription *self,
                                guint codec_identifier,
                                const gchar *type,
                                const gchar *subtype,
                                const gchar *parameters);

Add a message for a given codec. This ensures codec_identifier is in the “feedback-messages” map. The rtcp-minimum-interval is set to G_MAXUINT and can then be changed using tp_call_content_media_description_set_rtcp_feedback_minimum_interval().

Implement TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK interface.

Parameters

self

a TpCallContentMediaDescription

 

codec_identifier

Numeric identifier for the codec. This will be used as the PT in the SDP or content description.

 

type

feedback type, for example "ack", "nack", or "ccm".

 

subtype

feedback subtype, according to the Type, can be an empty string (""), if there is no subtype. For example, generic nack is Type="nack" Subtype="".

 

parameters

feedback parameters as a string. Format is defined in the relevant RFC.

 

Since: 0.17.6


tp_call_content_media_description_set_rtcp_feedback_minimum_interval ()

void
tp_call_content_media_description_set_rtcp_feedback_minimum_interval
                               (TpCallContentMediaDescription *self,
                                guint codec_identifier,
                                guint rtcp_minimum_interval);

Set the minimum interval for a given codec. This ensures codec_identifier is in the “feedback-messages” map. The messages can then be added using tp_call_content_media_description_add_rtcp_feedback_message().

Implement TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK interface.

Parameters

self

a TpCallContentMediaDescription

 

codec_identifier

Numeric identifier for the codec. This will be used as the PT in the SDP or content description.

 

rtcp_minimum_interval

The minimum interval between two regular RTCP packets in milliseconds for this content. If no special value is desired, one should put MAXUINT (0xFFFFFFFF). Implementors and users of Call's RTCPFeedback should not use the MAXUINT default. Instead, in RTP/AVP, the default should be 5000 (5 seconds). If using the RTP/AVPF profile, it can be set to a lower value, the default being 0.

 

Since: 0.17.6


tp_call_content_media_description_set_does_avpf ()

void
tp_call_content_media_description_set_does_avpf
                               (TpCallContentMediaDescription *self,
                                gboolean does_avpf);

Implement properties for TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK interface

Parameters

self

a TpCallContentMediaDescription

 

does_avpf

the value for “does-avpf” property.

 

Since: 0.17.6


tp_call_content_media_description_set_rtcp_extended_reports ()

void
tp_call_content_media_description_set_rtcp_extended_reports
                               (TpCallContentMediaDescription *self,
                                guint loss_rle_max_size,
                                guint duplicate_rle_max_size,
                                guint packet_receipt_times_max_size,
                                guint dlrr_max_size,
                                TpRCPTXRRTTMode rtt_mode,
                                TpRTCPXRStatisticsFlags statistics_flags,
                                gboolean enable_metrics);

Implement TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS interface.

Parameters

self

a TpCallContentMediaDescription

 

loss_rle_max_size

the value for “loss-rle-max-size” property.

 

duplicate_rle_max_size

the value for “duplicate-rle-max-size” property.

 

packet_receipt_times_max_size

the value for “packet-receipt-times-max-size” property.

 

dlrr_max_size

the value for “dlrr-max-size” property.

 

rtt_mode

the value for “rtt-mode” property.

 

statistics_flags

the value for “statistics-flags” property.

 

enable_metrics

the value for “enable-metrics” property.

 

Since: 0.17.6


tp_call_content_media_description_add_rtcp_extended_reports_interface ()

void
tp_call_content_media_description_add_rtcp_extended_reports_interface
                               (TpCallContentMediaDescription *self);

Adds the RTCPExtendedReports interface to the list of supported interfaces

Parameters

Since: 0.17.6


tp_call_content_media_description_add_rtcp_feedback_interface ()

void
tp_call_content_media_description_add_rtcp_feedback_interface
                               (TpCallContentMediaDescription *self);

Adds the RTCPFeedback interface to the list of supported interfaces

Parameters

Since: 0.17.6


tp_call_content_media_description_add_rtp_header_extensions_interface ()

void
tp_call_content_media_description_add_rtp_header_extensions_interface
                               (TpCallContentMediaDescription *self);

Adds the RTPHeaderExtensions interface to the list of supported interfaces

Parameters

Since: 0.17.6

Types and Values

struct TpCallContentMediaDescription

struct TpCallContentMediaDescription;

A class for media content description

Since: 0.17.5


struct TpCallContentMediaDescriptionClass

struct TpCallContentMediaDescriptionClass {
};

The class structure for TpCallContentMediaDescription

Since: 0.17.5

Property Details

The “codecs” property

  “codecs”                   GPtrArray_GValueArray_guint+gchararray+guint+guint+gboolean+GHashTable_gchararray+gchararray___*

GPtrArray{codecs GValueArray}. A list of codecs the remote contact supports.

Owner: TpCallContentMediaDescription

Flags: Read

Since: 0.17.5


The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

The connection to the DBus daemon owning the CM.

Owner: TpCallContentMediaDescription

Flags: Read / Write / Construct Only

Since: 0.17.5


The “dlrr-max-size” property

  “dlrr-max-size”            guint

If non-zero, enable Receiver Reference Time and Delay since Last Receiver Report Blocks (for estimating Round Trip Times between non-senders and other parties in the call. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6


The “does-avpf” property

  “does-avpf”                gboolean

TRUE if the remote contact supports Audio-Visual Profile Feedback (AVPF), otherwise FALSE.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: FALSE

Since: 0.17.6


The “duplicate-rle-max-size” property

  “duplicate-rle-max-size”   guint

If non-zero, enable Duplicate Run-Length-Encoded Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6


The “enable-metrics” property

  “enable-metrics”           gboolean

Whether to enable VoIP Metrics Report Blocks. These blocks are of a fixed size.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: FALSE

Since: 0.17.6


The “feedback-messages” property

  “feedback-messages”        GHashTable_guint+GValueArray_guint+GPtrArray_GValueArray_gchararray+gchararray+gchararray____*

A map of remote feedback codec properties that are supported.

Owner: TpCallContentMediaDescription

Flags: Read

Since: 0.17.6


The “further-negotiation-required” property

  “further-negotiation-required” gboolean

TRUE if the MediaDescription contains remote information.

Owner: TpCallContentMediaDescription

Flags: Read / Write / Construct Only

Default value: FALSE

Since: 0.17.5


The “has-remote-information” property

  “has-remote-information”   gboolean

True if the MediaDescription contains remote information.

Owner: TpCallContentMediaDescription

Flags: Read / Write / Construct Only

Default value: FALSE


The “header-extensions” property

  “header-extensions”        GPtrArray_GValueArray_guint+guint+gchararray+gchararray__*

A list of remote header extensions which are supported.

Owner: TpCallContentMediaDescription

Flags: Read

Since: 0.17.6


The “interfaces” property

  “interfaces”               GStrv

Additional interfaces implemented by this object.

Owner: TpCallContentMediaDescription

Flags: Read

Since: 0.17.5


The “loss-rle-max-size” property

  “loss-rle-max-size”        guint

If non-zero, enable Loss Run Length Encoded Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6


The “object-path” property

  “object-path”              gchar *

The D-Bus object path used for this object on the bus.

Owner: TpCallContentMediaDescription

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.17.5


The “packet-receipt-times-max-size” property

  “packet-receipt-times-max-size” guint

If non-zero, enable Packet Receipt Times Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6


The “remote-contact” property

  “remote-contact”           guint

The contact TpHandle that this media description applies to.

Owner: TpCallContentMediaDescription

Flags: Read / Write / Construct Only

Default value: 0

Since: 0.17.5


The “rtt-mode” property

  “rtt-mode”                 guint

Who is allowed to send Delay since Last Receiver Reports. Value from TpRCPTXRRTTMode.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6


The “ssrcs” property

  “ssrcs”                    GHashTable_guint+GArray_guint__*

GHashTable{contact TpHandle, GArray{uint}} A map of contacts to SSRCs.

Owner: TpCallContentMediaDescription

Flags: Read

Since: 0.17.5


The “statistics-flags” property

  “statistics-flags”         guint

Which fields SHOULD be included in the statistics summary report blocks that are sent, and whether to send VoIP Metrics Report Blocks. There can be zero or more flags set. Value from TpRTCPXRStatisticsFlags.

Owner: TpCallContentMediaDescription

Flags: Read

Default value: 0

Since: 0.17.6

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-tls.html0000644000175000017500000006523014006623344022465 00000000000000 Service-side TLS interfaces: telepathy-glib API Reference Manual

Service-side TLS interfaces

Service-side TLS interfaces — GInterfaces to implement Chan.T.ServerTLSConnection

Signals

void accepted Has Details
void rejected Has Details

Object Hierarchy

    GInterface
    ├── TpSvcAuthenticationTLSCertificate
    ╰── TpSvcChannelTypeServerTLSConnection

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Channel.Type.ServerTLSConnection can be handled by clients to check servers' TLS certificates interactively. The actual certificates are represented by a separate TLSCertificate object.

Functions

tp_svc_authentication_tls_certificate_accept_impl ()

void
(*tp_svc_authentication_tls_certificate_accept_impl)
                               (TpSvcAuthenticationTLSCertificate *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Accept on interface org.freedesktop.Telepathy.Authentication.TLSCertificate.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_authentication_tls_certificate_return_from_accept ()

void
tp_svc_authentication_tls_certificate_return_from_accept
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_authentication_tls_certificate_implement_accept ()

void
tp_svc_authentication_tls_certificate_implement_accept
                               (TpSvcAuthenticationTLSCertificateClass *klass,
                                tp_svc_authentication_tls_certificate_accept_impl impl);

Register an implementation for the Accept method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Accept D-Bus method

 

tp_svc_authentication_tls_certificate_emit_accepted ()

void
tp_svc_authentication_tls_certificate_emit_accepted
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Accepted signal on interface org.freedesktop.Telepathy.Authentication.TLSCertificate.

Parameters

instance

The object implementing this interface

 

tp_svc_authentication_tls_certificate_reject_impl ()

void
(*tp_svc_authentication_tls_certificate_reject_impl)
                               (TpSvcAuthenticationTLSCertificate *self,
                                const GPtrArray *in_Rejections,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Reject on interface org.freedesktop.Telepathy.Authentication.TLSCertificate.

Parameters

self

The object implementing this interface

 

in_Rejections

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_authentication_tls_certificate_return_from_reject ()

void
tp_svc_authentication_tls_certificate_return_from_reject
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_authentication_tls_certificate_implement_reject ()

void
tp_svc_authentication_tls_certificate_implement_reject
                               (TpSvcAuthenticationTLSCertificateClass *klass,
                                tp_svc_authentication_tls_certificate_reject_impl impl);

Register an implementation for the Reject method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Reject D-Bus method

 

tp_svc_authentication_tls_certificate_emit_rejected ()

void
tp_svc_authentication_tls_certificate_emit_rejected
                               (gpointer instance,
                                const GPtrArray *arg_Rejections);

Type-safe wrapper around g_signal_emit to emit the Rejected signal on interface org.freedesktop.Telepathy.Authentication.TLSCertificate.

Parameters

instance

The object implementing this interface

 

arg_Rejections

const GPtrArray * (FIXME, generate documentation)

 

Types and Values

TpSvcChannelTypeServerTLSConnection

typedef struct _TpSvcChannelTypeServerTLSConnection TpSvcChannelTypeServerTLSConnection;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeServerTLSConnectionClass

typedef struct _TpSvcChannelTypeServerTLSConnectionClass TpSvcChannelTypeServerTLSConnectionClass;

The class of TpSvcChannelTypeServerTLSConnection. This interface has no D-Bus methods, so an implementation can typically pass NULL to G_IMPLEMENT_INTERFACE() as the interface initialization function.


TpSvcAuthenticationTLSCertificate

typedef struct _TpSvcAuthenticationTLSCertificate TpSvcAuthenticationTLSCertificate;

Dummy typedef representing any implementation of this interface.


TpSvcAuthenticationTLSCertificateClass

typedef struct _TpSvcAuthenticationTLSCertificateClass TpSvcAuthenticationTLSCertificateClass;

The class of TpSvcAuthenticationTLSCertificate.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_authentication_tls_certificate (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_authentication_tls_certificate_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (accept);
  IMPLEMENT (reject);
#undef IMPLEMENT
}

Signal Details

The “accepted” signal

void
user_function (TpSvcAuthenticationTLSCertificate *self,
               gpointer                           user_data)

The Accepted D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “rejected” signal

void
user_function (TpSvcAuthenticationTLSCertificate *self,
               gpointer                           user_data)

The Rejected D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Rejections

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-media-interfaces.html0000644000175000017500000054745314006623344025077 00000000000000 Service-side media streaming helper interfaces: telepathy-glib API Reference Manual

Service-side media streaming helper interfaces

Service-side media streaming helper interfaces — media session and media stream

Functions

void (*tp_svc_media_session_handler_error_impl) ()
void tp_svc_media_session_handler_implement_error ()
void tp_svc_media_session_handler_return_from_error ()
void (*tp_svc_media_session_handler_ready_impl) ()
void tp_svc_media_session_handler_implement_ready ()
void tp_svc_media_session_handler_return_from_ready ()
void tp_svc_media_session_handler_emit_new_stream_handler ()
void (*tp_svc_media_stream_handler_codec_choice_impl) ()
void tp_svc_media_stream_handler_implement_codec_choice ()
void tp_svc_media_stream_handler_return_from_codec_choice ()
void (*tp_svc_media_stream_handler_error_impl) ()
void tp_svc_media_stream_handler_implement_error ()
void tp_svc_media_stream_handler_return_from_error ()
void (*tp_svc_media_stream_handler_native_candidates_prepared_impl) ()
void tp_svc_media_stream_handler_implement_native_candidates_prepared ()
void tp_svc_media_stream_handler_return_from_native_candidates_prepared ()
void (*tp_svc_media_stream_handler_new_active_candidate_pair_impl) ()
void tp_svc_media_stream_handler_implement_new_active_candidate_pair ()
void tp_svc_media_stream_handler_return_from_new_active_candidate_pair ()
void (*tp_svc_media_stream_handler_new_native_candidate_impl) ()
void tp_svc_media_stream_handler_implement_new_native_candidate ()
void tp_svc_media_stream_handler_return_from_new_native_candidate ()
void (*tp_svc_media_stream_handler_ready_impl) ()
void tp_svc_media_stream_handler_implement_ready ()
void tp_svc_media_stream_handler_return_from_ready ()
void (*tp_svc_media_stream_handler_set_local_codecs_impl) ()
void tp_svc_media_stream_handler_implement_set_local_codecs ()
void tp_svc_media_stream_handler_return_from_set_local_codecs ()
void (*tp_svc_media_stream_handler_stream_state_impl) ()
void tp_svc_media_stream_handler_implement_stream_state ()
void tp_svc_media_stream_handler_return_from_stream_state ()
void (*tp_svc_media_stream_handler_supported_codecs_impl) ()
void tp_svc_media_stream_handler_implement_supported_codecs ()
void tp_svc_media_stream_handler_return_from_supported_codecs ()
void tp_svc_media_stream_handler_emit_add_remote_candidate ()
void tp_svc_media_stream_handler_emit_close ()
void tp_svc_media_stream_handler_emit_remove_remote_candidate ()
void tp_svc_media_stream_handler_emit_set_active_candidate_pair ()
void tp_svc_media_stream_handler_emit_set_remote_candidate_list ()
void tp_svc_media_stream_handler_emit_set_remote_codecs ()
void tp_svc_media_stream_handler_emit_set_stream_playing ()
void tp_svc_media_stream_handler_emit_set_stream_sending ()
void tp_svc_media_stream_handler_emit_start_telephony_event ()
void tp_svc_media_stream_handler_emit_stop_telephony_event ()
void tp_svc_media_stream_handler_emit_set_stream_held ()
void (*tp_svc_media_stream_handler_hold_state_impl) ()
void tp_svc_media_stream_handler_implement_hold_state ()
void tp_svc_media_stream_handler_implement_unhold_failure ()
void tp_svc_media_stream_handler_return_from_hold_state ()
void tp_svc_media_stream_handler_return_from_unhold_failure ()
void (*tp_svc_media_stream_handler_unhold_failure_impl) ()
void (*tp_svc_media_stream_handler_codecs_updated_impl) ()
void tp_svc_media_stream_handler_implement_codecs_updated ()
void tp_svc_media_stream_handler_return_from_codecs_updated ()
void tp_svc_media_stream_handler_emit_start_named_telephony_event ()
void tp_svc_media_stream_handler_emit_start_sound_telephony_event ()
void tp_svc_media_stream_handler_implement_new_active_transport_pair ()
void (*tp_svc_media_stream_handler_new_active_transport_pair_impl) ()
void tp_svc_media_stream_handler_return_from_new_active_transport_pair ()
void tp_svc_media_stream_handler_emit_set_remote_feedback_messages ()
void tp_svc_media_stream_handler_emit_set_remote_header_extensions ()
void tp_svc_media_stream_handler_implement_supported_feedback_messages ()
void tp_svc_media_stream_handler_implement_supported_header_extensions ()
void tp_svc_media_stream_handler_return_from_supported_feedback_messages ()
void tp_svc_media_stream_handler_return_from_supported_header_extensions ()
void (*tp_svc_media_stream_handler_supported_feedback_messages_impl) ()
void (*tp_svc_media_stream_handler_supported_header_extensions_impl) ()

Signals

void new-stream-handler Has Details
void add-remote-candidate Has Details
void close Has Details
void remove-remote-candidate Has Details
void set-active-candidate-pair Has Details
void set-remote-candidate-list Has Details
void set-remote-codecs Has Details
void set-remote-feedback-messages Has Details
void set-remote-header-extensions Has Details
void set-stream-held Has Details
void set-stream-playing Has Details
void set-stream-sending Has Details
void start-named-telephony-event Has Details
void start-sound-telephony-event Has Details
void start-telephony-event Has Details
void stop-telephony-event Has Details

Object Hierarchy

    GInterface
    ├── TpSvcMediaSessionHandler
    ╰── TpSvcMediaStreamHandler

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

These interfaces (auto-generated from the telepathy spec) make it easier to export the objects used to implement TpSvcChannelTypeStreamedMedia, with the correct method and signal signatures, and emit signals from those objects.

Functions

tp_svc_media_session_handler_error_impl ()

void
(*tp_svc_media_session_handler_error_impl)
                               (TpSvcMediaSessionHandler *self,
                                guint in_Error_Code,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Error on interface org.freedesktop.Telepathy.Media.SessionHandler.

Parameters

self

The object implementing this interface

 

in_Error_Code

guint (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_session_handler_implement_error ()

void
tp_svc_media_session_handler_implement_error
                               (TpSvcMediaSessionHandlerClass *klass,
                                tp_svc_media_session_handler_error_impl impl);

Register an implementation for the Error method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Error D-Bus method

 

tp_svc_media_session_handler_return_from_error ()

void
tp_svc_media_session_handler_return_from_error
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_session_handler_ready_impl ()

void
(*tp_svc_media_session_handler_ready_impl)
                               (TpSvcMediaSessionHandler *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Ready on interface org.freedesktop.Telepathy.Media.SessionHandler.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_media_session_handler_implement_ready ()

void
tp_svc_media_session_handler_implement_ready
                               (TpSvcMediaSessionHandlerClass *klass,
                                tp_svc_media_session_handler_ready_impl impl);

Register an implementation for the Ready method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Ready D-Bus method

 

tp_svc_media_session_handler_return_from_ready ()

void
tp_svc_media_session_handler_return_from_ready
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_session_handler_emit_new_stream_handler ()

void
tp_svc_media_session_handler_emit_new_stream_handler
                               (gpointer instance,
                                const gchar *arg_Stream_Handler,
                                guint arg_ID,
                                guint arg_Media_Type,
                                guint arg_Direction);

Type-safe wrapper around g_signal_emit to emit the NewStreamHandler signal on interface org.freedesktop.Telepathy.Media.SessionHandler.

Parameters

instance

The object implementing this interface

 

arg_Stream_Handler

const gchar * (FIXME, generate documentation)

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Media_Type

guint (FIXME, generate documentation)

 

arg_Direction

guint (FIXME, generate documentation)

 

tp_svc_media_stream_handler_codec_choice_impl ()

void
(*tp_svc_media_stream_handler_codec_choice_impl)
                               (TpSvcMediaStreamHandler *self,
                                guint in_Codec_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CodecChoice on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Codec_ID

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_codec_choice ()

void
tp_svc_media_stream_handler_implement_codec_choice
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_codec_choice_impl impl);

Register an implementation for the CodecChoice method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CodecChoice D-Bus method

 

tp_svc_media_stream_handler_return_from_codec_choice ()

void
tp_svc_media_stream_handler_return_from_codec_choice
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_error_impl ()

void
(*tp_svc_media_stream_handler_error_impl)
                               (TpSvcMediaStreamHandler *self,
                                guint in_Error_Code,
                                const gchar *in_Message,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Error on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Error_Code

guint (FIXME, generate documentation)

 

in_Message

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_error ()

void
tp_svc_media_stream_handler_implement_error
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_error_impl impl);

Register an implementation for the Error method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Error D-Bus method

 

tp_svc_media_stream_handler_return_from_error ()

void
tp_svc_media_stream_handler_return_from_error
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_native_candidates_prepared_impl ()

void
(*tp_svc_media_stream_handler_native_candidates_prepared_impl)
                               (TpSvcMediaStreamHandler *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method NativeCandidatesPrepared on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_native_candidates_prepared ()

void
tp_svc_media_stream_handler_implement_native_candidates_prepared
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_native_candidates_prepared_impl impl);

Register an implementation for the NativeCandidatesPrepared method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the NativeCandidatesPrepared D-Bus method

 

tp_svc_media_stream_handler_return_from_native_candidates_prepared ()

void
tp_svc_media_stream_handler_return_from_native_candidates_prepared
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_new_active_candidate_pair_impl ()

void
(*tp_svc_media_stream_handler_new_active_candidate_pair_impl)
                               (TpSvcMediaStreamHandler *self,
                                const gchar *in_Native_Candidate_ID,
                                const gchar *in_Remote_Candidate_ID,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method NewActiveCandidatePair on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Native_Candidate_ID

const gchar * (FIXME, generate documentation)

 

in_Remote_Candidate_ID

const gchar * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_new_active_candidate_pair ()

void
tp_svc_media_stream_handler_implement_new_active_candidate_pair
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_new_active_candidate_pair_impl impl);

Register an implementation for the NewActiveCandidatePair method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the NewActiveCandidatePair D-Bus method

 

tp_svc_media_stream_handler_return_from_new_active_candidate_pair ()

void
tp_svc_media_stream_handler_return_from_new_active_candidate_pair
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_new_native_candidate_impl ()

void
(*tp_svc_media_stream_handler_new_native_candidate_impl)
                               (TpSvcMediaStreamHandler *self,
                                const gchar *in_Candidate_ID,
                                const GPtrArray *in_Transports,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method NewNativeCandidate on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Candidate_ID

const gchar * (FIXME, generate documentation)

 

in_Transports

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_new_native_candidate ()

void
tp_svc_media_stream_handler_implement_new_native_candidate
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_new_native_candidate_impl impl);

Register an implementation for the NewNativeCandidate method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the NewNativeCandidate D-Bus method

 

tp_svc_media_stream_handler_return_from_new_native_candidate ()

void
tp_svc_media_stream_handler_return_from_new_native_candidate
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_ready_impl ()

void
(*tp_svc_media_stream_handler_ready_impl)
                               (TpSvcMediaStreamHandler *self,
                                const GPtrArray *in_Codecs,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Ready on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Codecs

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_ready ()

void
tp_svc_media_stream_handler_implement_ready
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_ready_impl impl);

Register an implementation for the Ready method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Ready D-Bus method

 

tp_svc_media_stream_handler_return_from_ready ()

void
tp_svc_media_stream_handler_return_from_ready
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_set_local_codecs_impl ()

void
(*tp_svc_media_stream_handler_set_local_codecs_impl)
                               (TpSvcMediaStreamHandler *self,
                                const GPtrArray *in_Codecs,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SetLocalCodecs on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Codecs

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_set_local_codecs ()

void
tp_svc_media_stream_handler_implement_set_local_codecs
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_set_local_codecs_impl impl);

Register an implementation for the SetLocalCodecs method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SetLocalCodecs D-Bus method

 

tp_svc_media_stream_handler_return_from_set_local_codecs ()

void
tp_svc_media_stream_handler_return_from_set_local_codecs
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_stream_state_impl ()

void
(*tp_svc_media_stream_handler_stream_state_impl)
                               (TpSvcMediaStreamHandler *self,
                                guint in_State,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method StreamState on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_State

guint (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_stream_state ()

void
tp_svc_media_stream_handler_implement_stream_state
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_stream_state_impl impl);

Register an implementation for the StreamState method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the StreamState D-Bus method

 

tp_svc_media_stream_handler_return_from_stream_state ()

void
tp_svc_media_stream_handler_return_from_stream_state
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_supported_codecs_impl ()

void
(*tp_svc_media_stream_handler_supported_codecs_impl)
                               (TpSvcMediaStreamHandler *self,
                                const GPtrArray *in_Codecs,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SupportedCodecs on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Codecs

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_supported_codecs ()

void
tp_svc_media_stream_handler_implement_supported_codecs
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_supported_codecs_impl impl);

Register an implementation for the SupportedCodecs method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SupportedCodecs D-Bus method

 

tp_svc_media_stream_handler_return_from_supported_codecs ()

void
tp_svc_media_stream_handler_return_from_supported_codecs
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_emit_add_remote_candidate ()

void
tp_svc_media_stream_handler_emit_add_remote_candidate
                               (gpointer instance,
                                const gchar *arg_Candidate_ID,
                                const GPtrArray *arg_Transports);

Type-safe wrapper around g_signal_emit to emit the AddRemoteCandidate signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Candidate_ID

const gchar * (FIXME, generate documentation)

 

arg_Transports

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_close ()

void
tp_svc_media_stream_handler_emit_close
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the Close signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

tp_svc_media_stream_handler_emit_remove_remote_candidate ()

void
tp_svc_media_stream_handler_emit_remove_remote_candidate
                               (gpointer instance,
                                const gchar *arg_Candidate_ID);

Type-safe wrapper around g_signal_emit to emit the RemoveRemoteCandidate signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Candidate_ID

const gchar * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_active_candidate_pair ()

void
tp_svc_media_stream_handler_emit_set_active_candidate_pair
                               (gpointer instance,
                                const gchar *arg_Native_Candidate_ID,
                                const gchar *arg_Remote_Candidate_ID);

Type-safe wrapper around g_signal_emit to emit the SetActiveCandidatePair signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Native_Candidate_ID

const gchar * (FIXME, generate documentation)

 

arg_Remote_Candidate_ID

const gchar * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_remote_candidate_list ()

void
tp_svc_media_stream_handler_emit_set_remote_candidate_list
                               (gpointer instance,
                                const GPtrArray *arg_Remote_Candidates);

Type-safe wrapper around g_signal_emit to emit the SetRemoteCandidateList signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Remote_Candidates

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_remote_codecs ()

void
tp_svc_media_stream_handler_emit_set_remote_codecs
                               (gpointer instance,
                                const GPtrArray *arg_Codecs);

Type-safe wrapper around g_signal_emit to emit the SetRemoteCodecs signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Codecs

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_stream_playing ()

void
tp_svc_media_stream_handler_emit_set_stream_playing
                               (gpointer instance,
                                gboolean arg_Playing);

Type-safe wrapper around g_signal_emit to emit the SetStreamPlaying signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Playing

gboolean (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_stream_sending ()

void
tp_svc_media_stream_handler_emit_set_stream_sending
                               (gpointer instance,
                                gboolean arg_Sending);

Type-safe wrapper around g_signal_emit to emit the SetStreamSending signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Sending

gboolean (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_start_telephony_event ()

void
tp_svc_media_stream_handler_emit_start_telephony_event
                               (gpointer instance,
                                guchar arg_Event);

Type-safe wrapper around g_signal_emit to emit the StartTelephonyEvent signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Event

guchar (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_stop_telephony_event ()

void
tp_svc_media_stream_handler_emit_stop_telephony_event
                               (gpointer instance);

Type-safe wrapper around g_signal_emit to emit the StopTelephonyEvent signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

tp_svc_media_stream_handler_emit_set_stream_held ()

void
tp_svc_media_stream_handler_emit_set_stream_held
                               (gpointer instance,
                                gboolean arg_Held);

Type-safe wrapper around g_signal_emit to emit the SetStreamHeld signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Held

gboolean (FIXME, generate documentation)

 

tp_svc_media_stream_handler_hold_state_impl ()

void
(*tp_svc_media_stream_handler_hold_state_impl)
                               (TpSvcMediaStreamHandler *self,
                                gboolean in_Held,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method HoldState on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Held

gboolean (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_hold_state ()

void
tp_svc_media_stream_handler_implement_hold_state
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_hold_state_impl impl);

Register an implementation for the HoldState method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the HoldState D-Bus method

 

tp_svc_media_stream_handler_implement_unhold_failure ()

void
tp_svc_media_stream_handler_implement_unhold_failure
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_unhold_failure_impl impl);

Register an implementation for the UnholdFailure method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the UnholdFailure D-Bus method

 

tp_svc_media_stream_handler_return_from_hold_state ()

void
tp_svc_media_stream_handler_return_from_hold_state
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_return_from_unhold_failure ()

void
tp_svc_media_stream_handler_return_from_unhold_failure
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_unhold_failure_impl ()

void
(*tp_svc_media_stream_handler_unhold_failure_impl)
                               (TpSvcMediaStreamHandler *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method UnholdFailure on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_codecs_updated_impl ()

void
(*tp_svc_media_stream_handler_codecs_updated_impl)
                               (TpSvcMediaStreamHandler *self,
                                const GPtrArray *in_Codecs,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method CodecsUpdated on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Codecs

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_implement_codecs_updated ()

void
tp_svc_media_stream_handler_implement_codecs_updated
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_codecs_updated_impl impl);

Register an implementation for the CodecsUpdated method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the CodecsUpdated D-Bus method

 

tp_svc_media_stream_handler_return_from_codecs_updated ()

void
tp_svc_media_stream_handler_return_from_codecs_updated
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_emit_start_named_telephony_event ()

void
tp_svc_media_stream_handler_emit_start_named_telephony_event
                               (gpointer instance,
                                guchar arg_Event,
                                guint arg_Codec_ID);

Type-safe wrapper around g_signal_emit to emit the StartNamedTelephonyEvent signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Event

guchar (FIXME, generate documentation)

 

arg_Codec_ID

guint (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_start_sound_telephony_event ()

void
tp_svc_media_stream_handler_emit_start_sound_telephony_event
                               (gpointer instance,
                                guchar arg_Event);

Type-safe wrapper around g_signal_emit to emit the StartSoundTelephonyEvent signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Event

guchar (FIXME, generate documentation)

 

tp_svc_media_stream_handler_implement_new_active_transport_pair ()

void
tp_svc_media_stream_handler_implement_new_active_transport_pair
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_new_active_transport_pair_impl impl);

Register an implementation for the NewActiveTransportPair method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the NewActiveTransportPair D-Bus method

 

tp_svc_media_stream_handler_new_active_transport_pair_impl ()

void
(*tp_svc_media_stream_handler_new_active_transport_pair_impl)
                               (TpSvcMediaStreamHandler *self,
                                const gchar *in_Native_Candidate_ID,
                                const GValueArray *in_Native_Transport,
                                const gchar *in_Remote_Candidate_ID,
                                const GValueArray *in_Remote_Transport,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method NewActiveTransportPair on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Native_Candidate_ID

const gchar * (FIXME, generate documentation)

 

in_Native_Transport

const GValueArray * (FIXME, generate documentation)

 

in_Remote_Candidate_ID

const gchar * (FIXME, generate documentation)

 

in_Remote_Transport

const GValueArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_return_from_new_active_transport_pair ()

void
tp_svc_media_stream_handler_return_from_new_active_transport_pair
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_emit_set_remote_feedback_messages ()

void
tp_svc_media_stream_handler_emit_set_remote_feedback_messages
                               (gpointer instance,
                                GHashTable *arg_Messages);

Type-safe wrapper around g_signal_emit to emit the SetRemoteFeedbackMessages signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Messages

GHashTable * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_emit_set_remote_header_extensions ()

void
tp_svc_media_stream_handler_emit_set_remote_header_extensions
                               (gpointer instance,
                                const GPtrArray *arg_Header_Extensions);

Type-safe wrapper around g_signal_emit to emit the SetRemoteHeaderExtensions signal on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

instance

The object implementing this interface

 

arg_Header_Extensions

const GPtrArray * (FIXME, generate documentation)

 

tp_svc_media_stream_handler_implement_supported_feedback_messages ()

void
tp_svc_media_stream_handler_implement_supported_feedback_messages
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_supported_feedback_messages_impl impl);

Register an implementation for the SupportedFeedbackMessages method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SupportedFeedbackMessages D-Bus method

 

tp_svc_media_stream_handler_implement_supported_header_extensions ()

void
tp_svc_media_stream_handler_implement_supported_header_extensions
                               (TpSvcMediaStreamHandlerClass *klass,
                                tp_svc_media_stream_handler_supported_header_extensions_impl impl);

Register an implementation for the SupportedHeaderExtensions method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the SupportedHeaderExtensions D-Bus method

 

tp_svc_media_stream_handler_return_from_supported_feedback_messages ()

void
tp_svc_media_stream_handler_return_from_supported_feedback_messages
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_return_from_supported_header_extensions ()

void
tp_svc_media_stream_handler_return_from_supported_header_extensions
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_media_stream_handler_supported_feedback_messages_impl ()

void
(*tp_svc_media_stream_handler_supported_feedback_messages_impl)
                               (TpSvcMediaStreamHandler *self,
                                GHashTable *in_Messages,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SupportedFeedbackMessages on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Messages

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_media_stream_handler_supported_header_extensions_impl ()

void
(*tp_svc_media_stream_handler_supported_header_extensions_impl)
                               (TpSvcMediaStreamHandler *self,
                                const GPtrArray *in_Header_Extensions,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method SupportedHeaderExtensions on interface org.freedesktop.Telepathy.Media.StreamHandler.

Parameters

self

The object implementing this interface

 

in_Header_Extensions

const GPtrArray * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

Types and Values

TpSvcMediaSessionHandler

typedef struct _TpSvcMediaSessionHandler TpSvcMediaSessionHandler;

Dummy typedef representing any implementation of this interface.


TpSvcMediaSessionHandlerClass

typedef struct _TpSvcMediaSessionHandlerClass TpSvcMediaSessionHandlerClass;

The class of TpSvcMediaSessionHandler.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_media_session_handler (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_media_session_handler_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (error);
  IMPLEMENT (ready);
#undef IMPLEMENT
}

TpSvcMediaStreamHandler

typedef struct _TpSvcMediaStreamHandler TpSvcMediaStreamHandler;

Dummy typedef representing any implementation of this interface.


TpSvcMediaStreamHandlerClass

typedef struct _TpSvcMediaStreamHandlerClass TpSvcMediaStreamHandlerClass;

The class of TpSvcMediaStreamHandler.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_media_stream_handler (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_media_stream_handler_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (codec_choice);
  IMPLEMENT (error);
  IMPLEMENT (native_candidates_prepared);
  IMPLEMENT (new_active_candidate_pair);
  IMPLEMENT (new_active_transport_pair);
  IMPLEMENT (new_native_candidate);
  IMPLEMENT (ready);
  IMPLEMENT (set_local_codecs);
  IMPLEMENT (stream_state);
  IMPLEMENT (supported_codecs);
  IMPLEMENT (codecs_updated);
  IMPLEMENT (hold_state);
  IMPLEMENT (unhold_failure);
  IMPLEMENT (supported_feedback_messages);
  IMPLEMENT (supported_header_extensions);
#undef IMPLEMENT
}

Signal Details

The “new-stream-handler” signal

void
user_function (TpSvcMediaSessionHandler *self,
               DBusGObjectPath          *arg_Stream_Handler,
               guint                     arg_ID,
               guint                     arg_Media_Type,
               guint                     arg_Direction,
               gpointer                  user_data)

The NewStreamHandler D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Stream_Handler

const gchar * (FIXME, generate documentation)

 

arg_ID

guint (FIXME, generate documentation)

 

arg_Media_Type

guint (FIXME, generate documentation)

 

arg_Direction

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “add-remote-candidate” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gchar                   *arg_Candidate_ID,
               gpointer                 user_data)

The AddRemoteCandidate D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Candidate_ID

const gchar * (FIXME, generate documentation)

 

arg_Transports

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “close” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The Close D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “remove-remote-candidate” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gchar                   *arg_Candidate_ID,
               gpointer                 user_data)

The RemoveRemoteCandidate D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Candidate_ID

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-active-candidate-pair” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gchar                   *arg_Native_Candidate_ID,
               gchar                   *arg_Remote_Candidate_ID,
               gpointer                 user_data)

The SetActiveCandidatePair D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Native_Candidate_ID

const gchar * (FIXME, generate documentation)

 

arg_Remote_Candidate_ID

const gchar * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-remote-candidate-list” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The SetRemoteCandidateList D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Remote_Candidates

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-remote-codecs” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The SetRemoteCodecs D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Codecs

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-remote-feedback-messages” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The SetRemoteFeedbackMessages D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Messages

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-remote-header-extensions” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The SetRemoteHeaderExtensions D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Header_Extensions

const GPtrArray * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-stream-held” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gboolean                 arg_Held,
               gpointer                 user_data)

The SetStreamHeld D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Held

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-stream-playing” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gboolean                 arg_Playing,
               gpointer                 user_data)

The SetStreamPlaying D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Playing

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “set-stream-sending” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gboolean                 arg_Sending,
               gpointer                 user_data)

The SetStreamSending D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Sending

gboolean (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “start-named-telephony-event” signal

void
user_function (TpSvcMediaStreamHandler *self,
               guchar                   arg_Event,
               guint                    arg_Codec_ID,
               gpointer                 user_data)

The StartNamedTelephonyEvent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Event

guchar (FIXME, generate documentation)

 

arg_Codec_ID

guint (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “start-sound-telephony-event” signal

void
user_function (TpSvcMediaStreamHandler *self,
               guchar                   arg_Event,
               gpointer                 user_data)

The StartSoundTelephonyEvent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Event

guchar (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “start-telephony-event” signal

void
user_function (TpSvcMediaStreamHandler *self,
               guchar                   arg_Event,
               gpointer                 user_data)

The StartTelephonyEvent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Event

guchar (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “stop-telephony-event” signal

void
user_function (TpSvcMediaStreamHandler *self,
               gpointer                 user_data)

The StopTelephonyEvent D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-TpHeap.html0000644000175000017500000003504314006623343022251 00000000000000 TpHeap: telepathy-glib API Reference Manual

TpHeap

TpHeap — a heap queue of pointers

Functions

TpHeap * tp_heap_new ()
void tp_heap_destroy ()
void tp_heap_clear ()
void tp_heap_add ()
void tp_heap_remove ()
gpointer tp_heap_peek_first ()
gpointer tp_heap_extract_first ()
guint tp_heap_size ()

Types and Values

  TpHeap

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

A heap queue of pointers.

Functions

tp_heap_new ()

TpHeap *
tp_heap_new (GCompareFunc comparator,
             GDestroyNotify destructor);

Parameters

comparator

Comparator by which to order the pointers in the heap

 

destructor

Function to call on the pointers when the heap is destroyed or cleared, or NULL if this is not needed

 

Returns

A new, empty heap queue.


tp_heap_destroy ()

void
tp_heap_destroy (TpHeap *heap);

Destroy a TpHeap. The destructor, if any, is called on all items.

Parameters

heap

The heap queue

 

tp_heap_clear ()

void
tp_heap_clear (TpHeap *heap);

Remove all items from a TpHeap. The destructor, if any, is called on all items.

Parameters

heap

The heap queue

 

tp_heap_add ()

void
tp_heap_add (TpHeap *heap,
             gpointer element);

Add element to the heap queue, maintaining correct order.

Parameters

heap

The heap queue

 

element

An element

 

tp_heap_remove ()

void
tp_heap_remove (TpHeap *heap,
                gpointer element);

Remove element from heap , if it's present. The destructor, if any, is not called.

Parameters

heap

The heap queue

 

element

An element in the heap

 

tp_heap_peek_first ()

gpointer
tp_heap_peek_first (TpHeap *heap);

Parameters

heap

The heap queue

 

Returns

The first item in the queue, or NULL if the queue is empty


tp_heap_extract_first ()

gpointer
tp_heap_extract_first (TpHeap *heap);

Remove and return the first element in the queue. The destructor, if any, is not called.

Parameters

heap

The heap queue

 

Returns

the removed element


tp_heap_size ()

guint
tp_heap_size (TpHeap *heap);

Parameters

heap

The heap queue

 

Returns

The number of items in heap

Types and Values

TpHeap

typedef struct _TpHeap TpHeap;

Structure representing the heap queue. All fields are private.

telepathy-glib-0.24.2/docs/reference/html/TpBaseConnection.html0000644000175000017500000035616314006623343021367 00000000000000 TpBaseConnection: telepathy-glib API Reference Manual

TpBaseConnection

TpBaseConnection — base class for TpSvcConnection implementations

Functions

GPtrArray * (*TpBaseConnectionCreateChannelFactoriesImpl) ()
GPtrArray * (*TpBaseConnectionCreateChannelManagersImpl) ()
void (*TpBaseConnectionCreateHandleReposImpl) ()
gchar * (*TpBaseConnectionGetUniqueConnectionNameImpl) ()
GPtrArray * (*TpBaseConnectionGetInterfacesImpl) ()
void (*TpBaseConnectionProc) ()
gboolean (*TpBaseConnectionStartConnectingImpl) ()
const gchar * tp_base_connection_get_bus_name ()
const gchar * tp_base_connection_get_object_path ()
TpDBusDaemon * tp_base_connection_get_dbus_daemon ()
gboolean tp_base_connection_register ()
TpHandleRepoIface * tp_base_connection_get_handles ()
TpHandle tp_base_connection_get_self_handle ()
void tp_base_connection_set_self_handle ()
TpConnectionStatus tp_base_connection_get_status ()
gboolean tp_base_connection_is_destroyed ()
gboolean tp_base_connection_check_connected ()
void tp_base_connection_change_status ()
void tp_base_connection_disconnect_with_dbus_error ()
void tp_base_connection_disconnect_with_dbus_error_vardict ()
void tp_base_connection_finish_shutdown ()
void tp_base_connection_add_interfaces ()
void tp_base_connection_dbus_request_handles ()
#define TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED()
void tp_base_connection_register_with_contacts_mixin ()
void tp_base_connection_add_possible_client_interest ()
void tp_base_connection_add_client_interest ()
const gchar * tp_base_connection_get_account_path_suffix ()
void tp_base_connection_channel_manager_iter_init ()
gboolean tp_base_connection_channel_manager_iter_next ()

Properties

gchar * account-path-suffix Read / Write / Construct Only
TpDBusDaemon * dbus-daemon Read / Write / Construct Only
guint dbus-status Read
gboolean has-immortal-handles Read
GStrv interfaces Read
gchar * protocol Read / Write / Construct Only
guint self-handle Read / Write
gchar * self-id Read

Signals

void clients-interested Has Details
void clients-uninterested Has Details
void shutdown-finished Has Details

Object Hierarchy

    GObject
    ╰── TpBaseConnection

Implemented Interfaces

TpBaseConnection implements TpSvcConnection, TpSvcDBusProperties and TpSvcConnectionInterfaceRequests.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcConnection implementations by managing connection status, channel factories and handle tracking. A subclass should often not need to implement any of the Connection methods itself.

However, methods may be reimplemented if needed: for instance, Gabble overrides RequestHandles so it can validate MUC rooms, which must be done asynchronously.

Functions

TpBaseConnectionCreateChannelFactoriesImpl ()

GPtrArray *
(*TpBaseConnectionCreateChannelFactoriesImpl)
                               (TpBaseConnection *self);

Signature of an implementation of the create_channel_factories method of TpBaseConnection.

Parameters

self

The implementation, a subclass of TpBaseConnection

 

Returns

a GPtrArray of objects implementing TpChannelFactoryIface which, between them, implement all channel types this Connection supports.

[transfer full]


TpBaseConnectionCreateChannelManagersImpl ()

GPtrArray *
(*TpBaseConnectionCreateChannelManagersImpl)
                               (TpBaseConnection *self);

Signature of an implementation of the create_channel_managers method of TpBaseConnection.

Parameters

self

The implementation, a subclass of TpBaseConnection

 

Returns

a GPtrArray of objects implementing TpChannelManager which, between them, implement all channel types this Connection supports.

[transfer full]


TpBaseConnectionCreateHandleReposImpl ()

void
(*TpBaseConnectionCreateHandleReposImpl)
                               (TpBaseConnection *self,
                                TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]);

Signature of an implementation of the create_handle_repos method of TpBaseConnection.

[skip]

Parameters

self

The connection object

 

repos

An array of pointers to be filled in; the implementation may assume all are initially NULL.

 

TpBaseConnectionGetUniqueConnectionNameImpl ()

gchar *
(*TpBaseConnectionGetUniqueConnectionNameImpl)
                               (TpBaseConnection *self);

Signature of the get_unique_connection_name virtual method on TpBaseConnection.

Parameters

self

The implementation, a subclass of TpBaseConnection

 

Returns

a name for this connection which will be unique within this connection manager process, as a string which the caller must free with g_free.

[transfer full]


TpBaseConnectionGetInterfacesImpl ()

GPtrArray *
(*TpBaseConnectionGetInterfacesImpl) (TpBaseConnection *self);

Signature of an implementation of TpBaseConnectionClass.get_interfaces_always_present virtual function.

Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.

1
2
3
4
5
6
7
8
9
10
11
12
static GPtrArray *
my_connection_get_interfaces_always_present (TpBaseConnection *self)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_CONNECTION_CLASS (
      my_connection_parent_class)->get_interfaces_always_present (self);

  g_ptr_array_add (interfaces, TP_IFACE_BADGERS);

  return interfaces;
}

Parameters

self

a TpBaseConnection

 

Returns

a GPtrArray of static strings for D-Bus interfaces implemented by this client.

[transfer container]

Since: 0.19.4


TpBaseConnectionProc ()

void
(*TpBaseConnectionProc) (TpBaseConnection *self);

Signature of a virtual method on TpBaseConnection that takes no additional parameters and returns nothing.

Parameters

self

The connection object

 

TpBaseConnectionStartConnectingImpl ()

gboolean
(*TpBaseConnectionStartConnectingImpl)
                               (TpBaseConnection *self,
                                GError **error);

Signature of an implementation of the start_connecting method of TpBaseConnection.

On entry, the implementation may assume that it is in state NEW.

If TRUE is returned, the Connect D-Bus method succeeds; the implementation must either have already set the status to CONNECTED by calling tp_base_connection_change_status(), or have arranged for a status change to either state DISCONNECTED or CONNECTED to be signalled by calling tp_base_connection_change_status() at some later time. If the status is still NEW after returning TRUE, TpBaseConnection will automatically change it to CONNECTING for reason REQUESTED.

If FALSE is returned, the error will be raised from Connect as an exception. If the status is not DISCONNECTED after FALSE is returned, TpBaseConnection will automatically change it to DISCONNECTED with a reason appropriate to the error; NetworkError results in NETWORK_ERROR, PermissionDenied results in AUTHENTICATION_FAILED, and all other errors currently result in NONE_SPECIFIED.

All except the simplest connection managers are expected to implement this asynchronously, returning TRUE in most cases and changing the status to CONNECTED or DISCONNECTED later.

Parameters

self

The connection object

 

error

Set to the error if FALSE is returned

 

Returns

FALSE if failure has already occurred, else TRUE.


tp_base_connection_get_bus_name ()

const gchar *
tp_base_connection_get_bus_name (TpBaseConnection *self);

Return the bus name starting with TP_CONN_BUS_NAME_BASE that represents this connection on D-Bus.

The returned string belongs to the TpBaseConnection and must be copied by the caller if it will be kept.

If this connection has never been present on D-Bus (tp_base_connection_register() has never been called), return NULL instead.

Parameters

self

the connection

 

Returns

the bus name of this connection, or NULL.

[allow-none][transfer none]

Since: 0.19.1


tp_base_connection_get_object_path ()

const gchar *
tp_base_connection_get_object_path (TpBaseConnection *self);

Return the object path starting with TP_CONN_OBJECT_PATH_BASE that represents this connection on D-Bus.

The returned string belongs to the TpBaseConnection and must be copied by the caller if it will be kept.

If this connection has never been present on D-Bus (tp_base_connection_register() has never been called), return NULL instead.

Parameters

self

the connection

 

Returns

the object path of this connection, or NULL.

[allow-none][transfer none]

Since: 0.19.1


tp_base_connection_get_dbus_daemon ()

TpDBusDaemon *
tp_base_connection_get_dbus_daemon (TpBaseConnection *self);

[skip]

Parameters

self

the connection manager

 

Returns

the value of the “dbus-daemon” property. The caller must reference the returned object with g_object_ref() if it will be kept.

[transfer none]

Since: 0.11.3


tp_base_connection_register ()

gboolean
tp_base_connection_register (TpBaseConnection *self,
                             const gchar *cm_name,
                             gchar **bus_name,
                             gchar **object_path,
                             GError **error);

Make the connection object appear on the bus, returning the bus name and object path used. If TRUE is returned, the connection owns the bus name, and will release it when destroyed.

Since 0.11.11, bus_name and object_path may be NULL if the strings are not needed.

Parameters

self

A connection

 

cm_name

The name of the connection manager in the Telepathy protocol

 

bus_name

Used to return the bus name corresponding to the connection if TRUE is returned. To be freed by the caller.

[out]

object_path

Used to return the object path of the connection if TRUE is returned. To be freed by the caller.

[out]

error

Used to return an error if FALSE is returned; may be NULL

 

Returns

TRUE on success, FALSE on error.


tp_base_connection_get_handles ()

TpHandleRepoIface *
tp_base_connection_get_handles (TpBaseConnection *self,
                                TpHandleType handle_type);

Parameters

self

A connection

 

handle_type

The handle type

 

Returns

the handle repository corresponding to the given handle type, or NULL if it's unsupported or invalid.

[transfer none]


tp_base_connection_get_self_handle ()

TpHandle
tp_base_connection_get_self_handle (TpBaseConnection *self);

Returns the “self-handle” property, which is guaranteed not to be 0 once the connection has moved to the CONNECTED state.

[skip]

Parameters

self

A connection

 

Returns

the current self handle of the connection.

Since: 0.7.15


tp_base_connection_set_self_handle ()

void
tp_base_connection_set_self_handle (TpBaseConnection *self,
                                    TpHandle self_handle);

Sets the “self-handle” property. self_handle may not be 0 once the connection has moved to the CONNECTED state.

Parameters

self

A connection

 

self_handle

The new self handle for the connection.

 

Since: 0.7.15


tp_base_connection_get_status ()

TpConnectionStatus
tp_base_connection_get_status (TpBaseConnection *self);

Return the status of this connection, as set by tp_base_connection_change_status() or similar functions like tp_base_connection_disconnect_with_dbus_error().

Like the corresponding D-Bus property, this method returns TP_CONNECTION_STATUS_DISCONNECTED in two situations: either the connection is newly-created (and has never emitted “status-changed”), or D-Bus clients have already been told that it has been destroyed (by the Disconnect D-Bus method, a failed attempt to connect, or loss of an established connection). Use tp_base_connection_is_destroyed() to distinguish between the two.

Parameters

self

the connection

 

Returns

the value of “dbus-status”

Since: 0.19.1


tp_base_connection_is_destroyed ()

gboolean
tp_base_connection_is_destroyed (TpBaseConnection *self);

Return whether this connection has already emitted the D-Bus signal indicating that it has been destroyed.

In particular, this can be used to distinguish between the two reasons why tp_base_connection_get_status() would return TP_CONNECTION_STATUS_DISCONNECTED: it will return FALSE if the connection is newly-created, and TRUE if the Disconnect D-Bus method has been called, an attempt to connect has failed, or an established connection has encountered an error.

Parameters

self

the connection

 

Returns

TRUE if this connection is disappearing from D-Bus

Since: 0.19.1


tp_base_connection_check_connected ()

gboolean
tp_base_connection_check_connected (TpBaseConnection *self,
                                    GError **error);

Return whether this connection is fully active and connected. If it is not, raise TP_ERROR_DISCONNECTED.

This is equivalent to checking whether tp_base_connection_get_status() returns TP_CONNECTION_STATUS_CONNECTED; it is provided because methods on the connection often need to make this check, and return a GError if it fails.

Parameters

self

the connection

 

error

used to raise TP_ERROR_DISCONNECTED if FALSE is returned

 

Returns

TRUE if this connection is connected

Since: 0.19.1


tp_base_connection_change_status ()

void
tp_base_connection_change_status (TpBaseConnection *self,
                                  TpConnectionStatus status,
                                  TpConnectionStatusReason reason);

Change the status of the connection. The allowed state transitions are:

Before the transition to TP_CONNECTION_STATUS_CONNECTED, the implementation must have discovered the handle for the local user and passed it to tp_base_connection_set_self_handle().

Changing from NEW to CONNECTED is implemented by doing the transition from NEW to CONNECTING, followed by the transition from CONNECTING to CONNECTED; it's exactly equivalent to calling tp_base_connection_change_status for those two transitions one after the other.

Any other valid transition does the following, in this order:

To provide more details about what happened when moving to status TP_CONNECTION_STATUS_DISCONNECTED due to an error, consider calling tp_base_connection_disconnect_with_dbus_error() instead of this function.

Changed in 0.7.35: the self_handle member of TpBaseConnection was previously set to 0 at this stage. It now remains non-zero until the object is disposed.

Parameters

self

The connection

 

status

The new status

 

reason

The reason for the status change

 

tp_base_connection_disconnect_with_dbus_error ()

void
tp_base_connection_disconnect_with_dbus_error
                               (TpBaseConnection *self,
                                const gchar *error_name,
                                GHashTable *details,
                                TpConnectionStatusReason reason);

Changes the TpBaseConnection.status of self to TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to tp_base_connection_change_status(), but additionally emits the

ConnectionError D-Bus signal to provide more details about the

error.

Well-known keys for details are documented in the Telepathy specification's

definition of the ConnectionError signal, and include:
  • "debug-message", whose value should have type G_TYPE_STRING, for debugging information about the disconnection which should not be shown to the user
  • "server-message", whose value should also have type G_TYPE_STRING, for a human-readable error message from the server (in an unspecified language) explaining why the user was disconnected.

[skip]

Parameters

self

The connection

 

error_name

The D-Bus error with which the connection changed status to Disconnected

 

details

Further details of the error, as a hash table where the keys are strings as defined in the Telepathy specification, and the values are GValues. NULL is allowed, and treated as an empty hash table.

 

reason

The reason code to use in the StatusChanged signal (a less specific, non-extensible version of error_name )

 

Since: 0.7.24


tp_base_connection_disconnect_with_dbus_error_vardict ()

void
tp_base_connection_disconnect_with_dbus_error_vardict
                               (TpBaseConnection *self,
                                const gchar *error_name,
                                GVariant *details,
                                TpConnectionStatusReason reason);

Changes the TpBaseConnection.status of self to TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to tp_base_connection_change_status(), but additionally emits the

ConnectionError D-Bus signal to provide more details about the

error.

Well-known keys for details are documented in the Telepathy specification's

definition of the ConnectionError signal, and include:
  • "debug-message", whose value should have type G_TYPE_STRING, for debugging information about the disconnection which should not be shown to the user
  • "server-message", whose value should also have type G_TYPE_STRING, for a human-readable error message from the server (in an unspecified language) explaining why the user was disconnected.

[skip]

Parameters

self

The connection

 

error_name

The D-Bus error with which the connection changed status to Disconnected

 

details

Further details of the error, as a variant of type G_VARIANT_TYPE_VARDICT. The keys are strings as defined in the Telepathy specification, and the values are of type G_VARIANT_TYPE_VARIANT. NULL is allowed, and treated as an empty dictionary.

 

reason

The reason code to use in the StatusChanged signal (a less specific, non-extensible version of error_name )

 

Since: 0.7.24


tp_base_connection_finish_shutdown ()

void
tp_base_connection_finish_shutdown (TpBaseConnection *self);

Tell the connection manager that this Connection has been disconnected, has emitted StatusChanged and is ready to be removed from D-Bus.

[skip]

Parameters

self

The connection

 

tp_base_connection_add_interfaces ()

void
tp_base_connection_add_interfaces (TpBaseConnection *self,
                                   const gchar **interfaces);

Add some interfaces to the list supported by this Connection. If you're going to call this function at all, you must do so before moving to state CONNECTED (or DISCONNECTED); if you don't call it, only the set of interfaces always present (get_interfaces_always_present in TpBaseConnectionClass) will be supported.

[skip]

Parameters

self

A TpBaseConnection in state TP_INTERNAL_CONNECTION_STATUS_NEW or TP_CONNECTION_STATUS_CONNECTING

 

interfaces

A NULL-terminated array of D-Bus interface names, which must remain valid at least until the connection enters state TP_CONNECTION_STATUS_DISCONNECTED (in practice, you should either use static strings, or use strdup'd strings and free them in the dispose callback).

 

tp_base_connection_dbus_request_handles ()

void
tp_base_connection_dbus_request_handles
                               (TpSvcConnection *iface,
                                guint handle_type,
                                const gchar **names,
                                DBusGMethodInvocation *context);

tp_base_connection_dbus_request_handles has been deprecated since version 0.19.0 and should not be used in newly-written code.

Implements D-Bus method RequestHandles on interface org.freedesktop.Telepathy.Connection.

This was exported so subclasses could use it as a basis for their reimplementations, but reimplementing the method is now deprecated.

[skip]

Parameters

iface

A pointer to TpBaseConnection, cast to a pointer to TpSvcConnection

 

handle_type

The handle type (TpHandleType) as a guint

 

names

A strv of handle names

 

context

The dbus-glib method invocation context

 

TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED()

#define             TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED(conn, context)

If conn is not in state TP_CONNECTION_STATUS_CONNECTED, complete the D-Bus method invocation context by raising the Telepathy error TP_ERROR_DISCONNECTED, and return from the current function (which must be void). For use in D-Bus method implementations.

Parameters

conn

A TpBaseConnection

 

context

A DBusGMethodInvocation

 

tp_base_connection_register_with_contacts_mixin ()

void
tp_base_connection_register_with_contacts_mixin
                               (TpBaseConnection *self);

Register the Connection interface with the Contacts interface to make it inspectable. The Contacts mixin should be initialized before this function is called

[skip]

Parameters

self

An instance of the TpBaseConnections that uses the Contacts mixin

 

tp_base_connection_add_possible_client_interest ()

void
tp_base_connection_add_possible_client_interest
                               (TpBaseConnection *self,
                                GQuark token);

Add token to the set of tokens for which this connection will emit “clients-interested” and “clients-uninterested”.

This method must be called from the GObjectClass.constructed or GObjectClass.constructor callback (otherwise, it will run too late to be useful).

Parameters

self

a connection

 

token

a quark corresponding to a D-Bus interface, or a token representing part of a D-Bus interface, for which this connection wishes to be notified when clients register an interest

 

tp_base_connection_add_client_interest ()

void
tp_base_connection_add_client_interest
                               (TpBaseConnection *self,
                                const gchar *unique_name,
                                const gchar *token,
                                gboolean only_if_uninterested);

Add a "client interest" for token on behalf of the given client.

This emits “clients-interested” if this was the first time a client expressed an interest in this token.

Parameters

self

a TpBaseConnection

 

unique_name

the unique bus name of a D-Bus client

 

token

a D-Bus interface or a token representing part of an interface, added with tp_base_connection_add_possible_client_interest()

 

only_if_uninterested

only add to the interest count if the client is not already interested (appropriate for APIs that implicitly subscribe on first use if this has not been done already, like Location)

 

tp_base_connection_get_account_path_suffix ()

const gchar *
tp_base_connection_get_account_path_suffix
                               (TpBaseConnection *self);

Parameters

self

the connection

 

Returns

the same value has the “account-path-suffix” property.

Since: 0.23.2


tp_base_connection_channel_manager_iter_init ()

void
tp_base_connection_channel_manager_iter_init
                               (TpChannelManagerIter *iter,
                                TpBaseConnection *self);

Initializes an iterator over the TpChannelManager objects known to self . It is intended to be used as followed:

1
2
3
4
5
6
7
8
TpChannelManagerIter iter;
TpChannelManager *manager;

tp_base_connection_channel_manager_iter_init (&iter, base_conn);
while (tp_base_connection_channel_manager_iter_next (&iter, &manager))
  {
    ...do something with manager...
  }

[skip]

Parameters

iter

an uninitialized TpChannelManagerIter

 

self

a connection

 

Since: 0.7.15


tp_base_connection_channel_manager_iter_next ()

gboolean
tp_base_connection_channel_manager_iter_next
                               (TpChannelManagerIter *iter,
                                TpChannelManager **manager_out);

Advances iter , and retrieves the TpChannelManager it now points to. If there are no more channel managers, manager_out is not set and FALSE is returned.

[skip]

Parameters

iter

an initialized TpChannelManagerIter

 

manager_out

a location to store the channel manager, or NULL.

 

Returns

FALSE if there are no more channel managers; else TRUE.

Since: 0.7.15

Types and Values

TP_INTERNAL_CONNECTION_STATUS_NEW

#   define TP_INTERNAL_CONNECTION_STATUS_NEW ((TpConnectionStatus)(-1))

A special value for TpConnectionStatus, used within GLib connection managers to indicate that the connection is disconnected because connection has never been attempted (as distinct from disconnected after connection has started, either by user request or an error).

Must never be visible on the D-Bus - TP_CONNECTION_STATUS_DISCONNECTED is sent instead.


TpBaseConnection

typedef struct _TpBaseConnection TpBaseConnection;

Data structure representing a generic TpSvcConnection implementation.

Since 0.19.1, accessing the fields of this structure is deprecated. Use tp_base_connection_get_bus_name(), tp_base_connection_get_object_path(), tp_base_connection_get_status(), tp_base_connection_get_self_handle() instead.


struct TpBaseConnectionClass

struct TpBaseConnectionClass {
    GObjectClass parent_class;

#ifdef __GI_SCANNER__
#else
    TpBaseConnectionCreateHandleReposImpl create_handle_repos;
#endif

    TpBaseConnectionCreateChannelFactoriesImpl create_channel_factories;

    TpBaseConnectionGetUniqueConnectionNameImpl get_unique_connection_name;

    TpBaseConnectionProc connecting;
    TpBaseConnectionProc connected;
    TpBaseConnectionProc disconnected;

    TpBaseConnectionProc shut_down;

    TpBaseConnectionStartConnectingImpl start_connecting;

    TpBaseConnectionCreateChannelManagersImpl create_channel_managers;

    TpBaseConnectionGetInterfacesImpl get_interfaces_always_present;
};

The class of a TpBaseConnection. Many members are virtual methods etc. to be filled in in the subclass' class_init function.

Members

TpBaseConnectionCreateHandleReposImpl create_handle_repos;

Fill in suitable handle repositories in the given array for all those handle types this Connection supports. Must be set by subclasses to a non-NULL value; the function must create at least a CONTACT handle repository (failing to do so will cause a crash).

 

TpBaseConnectionCreateChannelFactoriesImpl create_channel_factories;

Create an array of channel factories for this Connection. At least one of this or create_channel_managers must be set by subclasses to a non-NULL value; in new code, setting this to NULL and using channel managers exclusively is recommended.

 

TpBaseConnectionGetUniqueConnectionNameImpl get_unique_connection_name;

Construct a unique name for this connection (for example using the protocol's format for usernames). If NULL (the default), a unique name will be generated. Subclasses should usually override this to get more obvious names, to aid debugging and prevent multiple connections to the same account.

 

TpBaseConnectionProc connecting;

If set by subclasses, will be called just after the state changes to CONNECTING. May be NULL if nothing special needs to happen.

 

TpBaseConnectionProc connected;

If set by subclasses, will be called just after the state changes to CONNECTED. May be NULL if nothing special needs to happen.

 

TpBaseConnectionProc disconnected;

If set by subclasses, will be called just after the state changes to DISCONNECTED. May be NULL if nothing special needs to happen.

 

TpBaseConnectionProc shut_down;

Called after disconnected() is called, to clean up the connection. Must start the shutdown process for the underlying network connection, and arrange for tp_base_connection_finish_shutdown() to be called after the underlying connection has been closed. May not be left as NULL.

 

TpBaseConnectionStartConnectingImpl start_connecting;

Asynchronously start connecting - called to implement the Connect D-Bus method. See TpBaseConnectionStartConnectingImpl for details. May not be left as NULL.

 

TpBaseConnectionCreateChannelManagersImpl create_channel_managers;

Create an array of channel managers for this Connection. At least one of this or create_channel_factories must be set by subclasses to a non-NULL value. Since: 0.7.15

 

TpBaseConnectionGetInterfacesImpl get_interfaces_always_present;

Returns a GPtrArray of extra D-Bus interfaces which are always implemented by instances of this class, which may be filled in by subclasses. The default is to list no additional interfaces. Individual instances may detect which additional interfaces they support and signal them before going to state CONNECTED by calling tp_base_connection_add_interfaces().

 

struct TpChannelManagerIter

struct TpChannelManagerIter {
};

An iterator over the TpChannelManager objects known to a TpBaseConnection. It has no public fields.

Use tp_base_connection_channel_manager_iter_init() to start iteration and tp_base_connection_channel_manager_iter_next() to continue.

Since: 0.7.15

Property Details

The “account-path-suffix” property

  “account-path-suffix”      gchar *

The suffix of the account object path such as "gabble/jabber/chris_40example_2ecom0" for the account whose object path is TP_ACCOUNT_OBJECT_PATH_BASE + "gabble/jabber/chris_40example_2ecom0". The same as returned by tp_account_get_path_suffix().

It is given by the AccountManager in the connection parameters. Or NULL if the ConnectionManager or the AccountManager are too old.

Owner: TpBaseConnection

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.23.2


The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction.

If this property is NULL or omitted during construction, the object will automatically attempt to connect to the starter or session bus with tp_dbus_daemon_dup() just after it is constructed; if this fails, this property will remain NULL, and tp_base_connection_register() will fail.

[skip]

Owner: TpBaseConnection

Flags: Read / Write / Construct Only

Since: 0.11.3


The “dbus-status” property

  “dbus-status”              guint

The Connection.Status as visible on D-Bus, which is the same as TpBaseConnection.status except that TP_INTERNAL_CONNECTION_STATUS_NEW is replaced by TP_CONNECTION_STATUS_DISCONNECTED.

The “notify” signal is not currently emitted for this property.

[skip]

Owner: TpBaseConnection

Flags: Read

Allowed values: <= 2

Default value: 2

Since: 0.11.3


The “has-immortal-handles” property

  “has-immortal-handles”     gboolean

This property is not useful to use directly. Its value is TRUE, to indicate that this version of telepathy-glib never unreferences handles until the connection becomes disconnected.

Owner: TpBaseConnection

Flags: Read

Default value: TRUE

Since: 0.13.8


The “interfaces” property

  “interfaces”               GStrv

The set of D-Bus interfaces available on this Connection, other than Connection itself.

[skip]

Owner: TpBaseConnection

Flags: Read

Since: 0.11.3


The “protocol” property

  “protocol”                 gchar *

Identifier used in the Telepathy protocol when this connection's protocol name is required.

[skip]

Owner: TpBaseConnection

Flags: Read / Write / Construct Only

Default value: NULL


The “self-handle” property

  “self-handle”              guint

The handle of type TP_HANDLE_TYPE_CONTACT representing the local user. Must be set nonzero by the subclass before moving to state CONNECTED.

[skip]

Owner: TpBaseConnection

Flags: Read / Write

Default value: 0

Since: 0.7.15


The “self-id” property

  “self-id”                  gchar *

The identifier representing the local user. This is the result of inspecting “self-handle”.

[skip]

Owner: TpBaseConnection

Flags: Read

Default value: ""

Since: 0.21.2

Signal Details

The “clients-interested” signal

void
user_function (TpBaseConnection *connection,
               gchar            *token,
               gpointer          user_data)

Emitted when a client becomes interested in any token that was added with tp_base_connection_add_possible_client_interest().

The "signal detail" is a GQuark representing token . Modules implementing an interface (Location, say) should typically connect to a detailed signal like "clients-interested::org.freedesktop.Telepathy.Connection.Interface.Location" rather than receiving all emissions of this signal.

Parameters

connection

the TpBaseConnection

 

token

the interface or part of an interface in which clients are newly interested

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “clients-uninterested” signal

void
user_function (TpBaseConnection *connection,
               gchar            *token,
               gpointer          user_data)

Emitted when no more clients are interested in an interface added with tp_base_connection_add_possible_client_interest(), for which “clients-interested” was previously emitted.

As with “clients-interested”, the "signal detail" is a GQuark representing token . Modules implementing an interface (Location, say) should typically connect to a detailed signal like "clients-uninterested::org.freedesktop.Telepathy.Connection.Interface.Location" rather than receiving all emissions of this signal.

Parameters

connection

the TpBaseConnection

 

token

the interface or part of an interface in which clients are no longer interested

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “shutdown-finished” signal

void
user_function (TpBaseConnection *connection,
               gpointer          user_data)

Emitted by tp_base_connection_finish_shutdown() when the underlying network connection has been closed; TpBaseConnectionManager listens for this signal and removes connections from its table of active connections when it is received.

[skip]

Parameters

connection

the TpBaseConnection

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-svc-channel-contactsearch.html0000644000175000017500000010261714006623344026113 00000000000000 Contact Search channels: telepathy-glib API Reference Manual

Contact Search channels

Contact Search channels — service-side interface for the Contact Search channel type

Signals

void search-result-received Has Details
void search-state-changed Has Details

Object Hierarchy

    GInterface
    ╰── TpSvcChannelTypeContactSearch

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some instant messaging protocols allow searching for contacts by name or other details. In Telepathy, each search attempt is represented as a Channel.

This section documents the auto-generated C wrappers for the Contact Search channel type.

Functions

tp_svc_channel_type_contact_search_emit_search_result_received ()

void
tp_svc_channel_type_contact_search_emit_search_result_received
                               (gpointer instance,
                                GHashTable *arg_Result);

Type-safe wrapper around g_signal_emit to emit the SearchResultReceived signal on interface org.freedesktop.Telepathy.Channel.Type.ContactSearch.

Parameters

instance

The object implementing this interface

 

arg_Result

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_type_contact_search_emit_search_state_changed ()

void
tp_svc_channel_type_contact_search_emit_search_state_changed
                               (gpointer instance,
                                guint arg_State,
                                const gchar *arg_Error,
                                GHashTable *arg_Details);

Type-safe wrapper around g_signal_emit to emit the SearchStateChanged signal on interface org.freedesktop.Telepathy.Channel.Type.ContactSearch.

Parameters

instance

The object implementing this interface

 

arg_State

guint (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_type_contact_search_implement_more ()

void
tp_svc_channel_type_contact_search_implement_more
                               (TpSvcChannelTypeContactSearchClass *klass,
                                tp_svc_channel_type_contact_search_more_impl impl);

Register an implementation for the More method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the More D-Bus method

 

tp_svc_channel_type_contact_search_implement_search ()

void
tp_svc_channel_type_contact_search_implement_search
                               (TpSvcChannelTypeContactSearchClass *klass,
                                tp_svc_channel_type_contact_search_search_impl impl);

Register an implementation for the Search method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Search D-Bus method

 

tp_svc_channel_type_contact_search_implement_stop ()

void
tp_svc_channel_type_contact_search_implement_stop
                               (TpSvcChannelTypeContactSearchClass *klass,
                                tp_svc_channel_type_contact_search_stop_impl impl);

Register an implementation for the Stop method in the vtable of an implementation of this interface. To be called from the interface init function.

Parameters

klass

A class whose instances implement this interface

 

impl

A callback used to implement the Stop D-Bus method

 

tp_svc_channel_type_contact_search_more_impl ()

void
(*tp_svc_channel_type_contact_search_more_impl)
                               (TpSvcChannelTypeContactSearch *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method More on interface org.freedesktop.Telepathy.Channel.Type.ContactSearch.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

tp_svc_channel_type_contact_search_return_from_more ()

void
tp_svc_channel_type_contact_search_return_from_more
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_contact_search_return_from_search ()

void
tp_svc_channel_type_contact_search_return_from_search
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_contact_search_return_from_stop ()

void
tp_svc_channel_type_contact_search_return_from_stop
                               (DBusGMethodInvocation *context);

Return successfully by calling dbus_g_method_return(). This inline function exists only to provide type-safety.

Parameters

context

The D-Bus method invocation context

 

tp_svc_channel_type_contact_search_search_impl ()

void
(*tp_svc_channel_type_contact_search_search_impl)
                               (TpSvcChannelTypeContactSearch *self,
                                GHashTable *in_Terms,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Search on interface org.freedesktop.Telepathy.Channel.Type.ContactSearch.

Parameters

self

The object implementing this interface

 

in_Terms

GHashTable * (FIXME, generate documentation)

 

context

Used to return values or throw an error

 

tp_svc_channel_type_contact_search_stop_impl ()

void
(*tp_svc_channel_type_contact_search_stop_impl)
                               (TpSvcChannelTypeContactSearch *self,
                                DBusGMethodInvocation *context);

The signature of an implementation of the D-Bus method Stop on interface org.freedesktop.Telepathy.Channel.Type.ContactSearch.

Parameters

self

The object implementing this interface

 

context

Used to return values or throw an error

 

Types and Values

TpSvcChannelTypeContactSearch

typedef struct _TpSvcChannelTypeContactSearch TpSvcChannelTypeContactSearch;

Dummy typedef representing any implementation of this interface.


TpSvcChannelTypeContactSearchClass

typedef struct _TpSvcChannelTypeContactSearchClass TpSvcChannelTypeContactSearchClass;

The class of TpSvcChannelTypeContactSearch.

In a full implementation of this interface (i.e. all methods implemented), the interface initialization function used in G_IMPLEMENT_INTERFACE() would typically look like this:

static void
implement_channel_type_contact_search (gpointer klass,
    gpointer unused G_GNUC_UNUSED)
{
#define IMPLEMENT(x) tp_svc_channel_type_contact_search_implement_##x (\
  klass, my_object_##x)
  IMPLEMENT (search);
  IMPLEMENT (more);
  IMPLEMENT (stop);
#undef IMPLEMENT
}

Signal Details

The “search-result-received” signal

void
user_function (TpSvcChannelTypeContactSearch *self,
               gpointer                       user_data)

The SearchResultReceived D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_Result

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details


The “search-state-changed” signal

void
user_function (TpSvcChannelTypeContactSearch *self,
               guint                          arg_State,
               gchar                         *arg_Error,
               gpointer                       user_data)

The SearchStateChanged D-Bus signal is emitted whenever this GObject signal is.

Parameters

self

an object

 

arg_State

guint (FIXME, generate documentation)

 

arg_Error

const gchar * (FIXME, generate documentation)

 

arg_Details

GHashTable * (FIXME, generate documentation)

 

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-add-dispatch-operation-context.html0000644000175000017500000004354414006623343027102 00000000000000 TpAddDispatchOperationContext: telepathy-glib API Reference Manual

TpAddDispatchOperationContext

TpAddDispatchOperationContext — context of a Approver.AddDispatchOperation() call

Properties

TpAccount * account Read / Write / Construct Only
GPtrArray * channels Read / Write / Construct Only
TpConnection * connection Read / Write / Construct Only
gpointer dbus-context Write / Construct Only
TpChannelDispatchOperation * dispatch-operation Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpAddDispatchOperationContext

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

Object used to represent the context of a Approver.AddDispatchOperation() D-Bus call on a TpBaseClient.

Functions

tp_add_dispatch_operation_context_accept ()

void
tp_add_dispatch_operation_context_accept
                               (TpAddDispatchOperationContext *self);

Called by TpBaseClientClassAddDispatchOperationImpl when it's done so the D-Bus method can return.

Parameters

Since: 0.11.5


tp_add_dispatch_operation_context_delay ()

void
tp_add_dispatch_operation_context_delay
                               (TpAddDispatchOperationContext *self);

Called by TpBaseClientClassAddDispatchOperationImpl to indicate that it implements the method in an async way. The caller must take a reference to the TpAddDispatchOperationContext before calling this function, and is responsible for calling either tp_add_dispatch_operation_context_accept() or tp_add_dispatch_operation_context_fail() later.

Parameters

Since: 0.11.5


tp_add_dispatch_operation_context_fail ()

void
tp_add_dispatch_operation_context_fail
                               (TpAddDispatchOperationContext *self,
                                const GError *error);

Called by TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error.

Parameters

self

a TpAddDispatchOperationContext

 

error

the error to return from the method

 

Since: 0.11.5

Types and Values

TpAddDispatchOperationContext

typedef struct _TpAddDispatchOperationContext TpAddDispatchOperationContext;

Data structure representing the context of a Approver.AddDispatchOperation() call.

Since: 0.11.5

Property Details

The “account” property

  “account”                  TpAccount *

A TpAccount object representing the Account of the DispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction.

This property can't be NULL.

Owner: TpAddDispatchOperationContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “channels” property

  “channels”                 GPtrArray *

A GPtrArray containing TpChannel objects representing the channels that have been passed to AddDispatchOperation. Read-only except during construction.

This property can't be NULL.

Owner: TpAddDispatchOperationContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “connection” property

  “connection”               TpConnection *

A TpConnection object representing the Connection of the DispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction.

This property can't be NULL.

Owner: TpAddDispatchOperationContext

Flags: Read / Write / Construct Only

Since: 0.11.5


The “dbus-context” property

  “dbus-context”             gpointer

The DBusGMethodInvocation representing the D-Bus context of the AddDispatchOperation call. Can only be written during construction.

[skip]

Owner: TpAddDispatchOperationContext

Flags: Write / Construct Only

Since: 0.11.5


The “dispatch-operation” property

  “dispatch-operation”       TpChannelDispatchOperation *

A TpChannelDispatchOperation object representing the ChannelDispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction.

This property can't be NULL.

Owner: TpAddDispatchOperationContext

Flags: Read / Write / Construct Only

Since: 0.11.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-room.html0000644000175000017500000005502514006623344023455 00000000000000 Room-related interfaces on Channels: telepathy-glib API Reference Manual

Room-related interfaces on Channels

Room-related interfaces on Channels — client-side wrappers for Room, RoomConfig and Subject

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This family of interfaces exposes aspects of chat rooms' configuration, and provides API to modify it (where permitted). Most of the API is in terms of D-Bus properties; they may be retrieved using tp_cli_dbus_properties_call_get_all(), and changes monitored using tp_cli_dbus_properties_connect_to_properties_changed().

TP_IFACE_CHANNEL_INTERFACE_ROOM consists only of a pair of requestable, immutable properties: TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME and TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER.

In addition to TP_IFACE_CHANNEL_INTERFACE_SUBJECT's single method, it defines a set of read-only properties: "Subject",

"Actor", "ActorHandle", "Timestamp",

and "CanSet".

TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG provides a vast array of properties for other aspects of a chat room's configuration (such as the maximum number of participants, and whether the room is password-protected).

Functions

tp_cli_channel_interface_room_config_call_update_configuration ()

TpProxyPendingCall *
tp_cli_channel_interface_room_config_call_update_configuration
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable *in_Properties,
                                tp_cli_channel_interface_room_config_callback_for_update_configuration callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a UpdateConfiguration method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If <tp:member-ref>CanUpdateConfiguration</tp:member-ref> is <code>True</code>, modifies the current values of one or more room properties. This method SHOULD NOT return until the change has been accepted or declined by the server.</p> <p>Note that the server may ostensibly accept the changes (thus allowing this method to return success) but signal different values; for example, the server might truncate <tp:member-ref>Title</tp:member-ref> to some maximum length. Callers SHOULD continue to listen for the <code>PropertiesChanged</code> signal, and trust the values it signals over those provided to this method.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Properties

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p> The new values of one or more properties on this interface, which must be listed in <tp:member-ref>MutableProperties</tp:member-ref>. For instance, to set up a channel for discussing top-secret corporate merge plans, this parameter might be: </p> <blockquote> <pre>{ 'Private': True, 'InviteOnly': True, 'Description': &quot;The first rule of inteltakeover is: do not talk about inteltakeover&quot;, }</pre></blockquote>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_room_config_callback_for_update_configuration ()

void
(*tp_cli_channel_interface_room_config_callback_for_update_configuration)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a UpdateConfiguration method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_subject_call_set_subject ()

TpProxyPendingCall *
tp_cli_channel_interface_subject_call_set_subject
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Subject,
                                tp_cli_channel_interface_subject_callback_for_set_subject callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetSubject method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Set the room's subject. Clients SHOULD look at the subject flags before calling this method as the user might not have permission to set the subject.</p> <p>A successful return of this method indicates a successful change in subject, but clients should still listen for changes to the <tp:member-ref>Subject</tp:member-ref> property for further changes by other users or the server.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Subject

Used to pass an 'in' argument: The new subject.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_subject_callback_for_set_subject ()

void
(*tp_cli_channel_interface_subject_callback_for_set_subject)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetSubject method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-proxy-dbus-core.html0000644000175000017500000023463514006623344024143 00000000000000 TpProxy D-Bus core methods: telepathy-glib API Reference Manual

TpProxy D-Bus core methods

TpProxy D-Bus core methods — The D-Bus Introspectable, Peer and Properties interfaces

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

All D-Bus objects support the Peer interface, and many support the Introspectable and Properties interfaces.

Functions

tp_cli_dbus_introspectable_call_introspect ()

TpProxyPendingCall *
tp_cli_dbus_introspectable_call_introspect
                               (gpointer proxy,
                                gint timeout_ms,
                                tp_cli_dbus_introspectable_callback_for_introspect callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a Introspect method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_introspectable_callback_for_introspect ()

void
(*tp_cli_dbus_introspectable_callback_for_introspect)
                               (TpProxy *proxy,
                                const gchar *out_XML_Data,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Introspect method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_XML_Data

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_introspectable_run_introspect ()

gboolean
tp_cli_dbus_introspectable_run_introspect
                               (gpointer proxy,
                                gint timeout_ms,
                                gchar **out_XML_Data,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_introspectable_run_introspect is deprecated and should not be used in newly-written code.

Call the method Introspect and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_XML_Data

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_peer_call_get_machine_id ()

TpProxyPendingCall *
tp_cli_dbus_peer_call_get_machine_id (gpointer proxy,
                                      gint timeout_ms,
                                      tp_cli_dbus_peer_callback_for_get_machine_id callback,
                                      gpointer user_data,
                                      GDestroyNotify destroy,
                                      GObject *weak_object);

Start a GetMachineId method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_peer_call_ping ()

TpProxyPendingCall *
tp_cli_dbus_peer_call_ping (gpointer proxy,
                            gint timeout_ms,
                            tp_cli_dbus_peer_callback_for_ping callback,
                            gpointer user_data,
                            GDestroyNotify destroy,
                            GObject *weak_object);

Start a Ping method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_peer_callback_for_get_machine_id ()

void
(*tp_cli_dbus_peer_callback_for_get_machine_id)
                               (TpProxy *proxy,
                                const gchar *out_Machine_UUID,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetMachineId method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Machine_UUID

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_peer_callback_for_ping ()

void
(*tp_cli_dbus_peer_callback_for_ping) (TpProxy *proxy,
                                       const GError *error,
                                       gpointer user_data,
                                       GObject *weak_object);

Signature of the callback called when a Ping method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_peer_run_get_machine_id ()

gboolean
tp_cli_dbus_peer_run_get_machine_id (gpointer proxy,
                                     gint timeout_ms,
                                     gchar **out_Machine_UUID,
                                     GError **error,
                                     GMainLoop **loop);

tp_cli_dbus_peer_run_get_machine_id is deprecated and should not be used in newly-written code.

Call the method GetMachineId and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Machine_UUID

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_peer_run_ping ()

gboolean
tp_cli_dbus_peer_run_ping (gpointer proxy,
                           gint timeout_ms,
                           GError **error,
                           GMainLoop **loop);

tp_cli_dbus_peer_run_ping is deprecated and should not be used in newly-written code.

Call the method Ping and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_properties_call_get ()

TpProxyPendingCall *
tp_cli_dbus_properties_call_get (gpointer proxy,
                                 gint timeout_ms,
                                 const gchar *in_Interface_Name,
                                 const gchar *in_Property_Name,
                                 tp_cli_dbus_properties_callback_for_get callback,
                                 gpointer user_data,
                                 GDestroyNotify destroy,
                                 GObject *weak_object);

Start a Get method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Property_Name

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_properties_call_get_all ()

TpProxyPendingCall *
tp_cli_dbus_properties_call_get_all (gpointer proxy,
                                     gint timeout_ms,
                                     const gchar *in_Interface_Name,
                                     tp_cli_dbus_properties_callback_for_get_all callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy,
                                     GObject *weak_object);

Start a GetAll method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_properties_call_set ()

TpProxyPendingCall *
tp_cli_dbus_properties_call_set (gpointer proxy,
                                 gint timeout_ms,
                                 const gchar *in_Interface_Name,
                                 const gchar *in_Property_Name,
                                 const GValue *in_Value,
                                 tp_cli_dbus_properties_callback_for_set callback,
                                 gpointer user_data,
                                 GDestroyNotify destroy,
                                 GObject *weak_object);

Start a Set method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Property_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Value

Used to pass an 'in' argument: (Undocumented)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_dbus_properties_callback_for_get ()

void
(*tp_cli_dbus_properties_callback_for_get)
                               (TpProxy *proxy,
                                const GValue *out_Value,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Get method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Value

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_properties_callback_for_get_all ()

void
(*tp_cli_dbus_properties_callback_for_get_all)
                               (TpProxy *proxy,
                                GHashTable *out_Properties,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetAll method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Properties

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_properties_callback_for_set ()

void
(*tp_cli_dbus_properties_callback_for_set)
                               (TpProxy *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a Set method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_dbus_properties_run_get ()

gboolean
tp_cli_dbus_properties_run_get (gpointer proxy,
                                gint timeout_ms,
                                const gchar *in_Interface_Name,
                                const gchar *in_Property_Name,
                                GValue **out_Value,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_properties_run_get is deprecated and should not be used in newly-written code.

Call the method Get and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Property_Name

Used to pass an 'in' argument: (Undocumented)

 

out_Value

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_properties_run_get_all ()

gboolean
tp_cli_dbus_properties_run_get_all (gpointer proxy,
                                    gint timeout_ms,
                                    const gchar *in_Interface_Name,
                                    GHashTable **out_Properties,
                                    GError **error,
                                    GMainLoop **loop);

tp_cli_dbus_properties_run_get_all is deprecated and should not be used in newly-written code.

Call the method GetAll and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

out_Properties

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_dbus_properties_signal_callback_properties_changed ()

void
(*tp_cli_dbus_properties_signal_callback_properties_changed)
                               (TpProxy *proxy,
                                const gchar *arg_Interface_Name,
                                GHashTable *arg_Changed_Properties,
                                const gchar **arg_Invalidated_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal PropertiesChanged.

Parameters

proxy

The proxy on which tp_cli_dbus_properties_connect_to_properties_changed() was called

 

arg_Interface_Name

.

[Undocumented]

arg_Changed_Properties

.

[Undocumented]

arg_Invalidated_Properties

.

[Undocumented]

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_dbus_properties_connect_to_properties_changed ()

TpProxySignalConnection *
tp_cli_dbus_properties_connect_to_properties_changed
                               (gpointer proxy,
                                tp_cli_dbus_properties_signal_callback_properties_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal PropertiesChanged.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_dbus_properties_run_set ()

gboolean
tp_cli_dbus_properties_run_set (gpointer proxy,
                                gint timeout_ms,
                                const gchar *in_Interface_Name,
                                const gchar *in_Property_Name,
                                const GValue *in_Value,
                                GError **error,
                                GMainLoop **loop);

tp_cli_dbus_properties_run_set is deprecated and should not be used in newly-written code.

Call the method Set and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpProxy or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Interface_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Property_Name

Used to pass an 'in' argument: (Undocumented)

 

in_Value

Used to pass an 'in' argument: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error

See Also

TpProxy

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-location.html0000644000175000017500000011424314006623344025036 00000000000000 Connection Location interface: telepathy-glib API Reference Manual

Connection Location interface

Connection Location interface — client-side wrappers for the Location interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some instant messaging protocols support "rich presence" functionality, such as geolocation (advertising the user's location to authorized contacts, and receiving contacts' locations).

This section documents the auto-generated C wrappers for the Location interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_location_connect_to_location_updated ()

TpProxySignalConnection *
tp_cli_connection_interface_location_connect_to_location_updated
                               (TpConnection *proxy,
                                tp_cli_connection_interface_location_signal_callback_location_updated callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocationUpdated.

Emitted when a contact's location changes or becomes known.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_location_signal_callback_location_updated ()

void
(*tp_cli_connection_interface_location_signal_callback_location_updated)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                GHashTable *arg_Location,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocationUpdated.

Parameters

proxy

The proxy on which tp_cli_connection_interface_location_connect_to_location_updated() was called

 

arg_Contact

The contact (TpContactHandle)

 

arg_Location

The contact's location, or empty to indicate that nothing is known about the contact's location.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_location_call_get_locations ()

TpProxyPendingCall *
tp_cli_connection_interface_location_call_get_locations
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                tp_cli_connection_interface_location_callback_for_get_locations callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetLocations method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Return the current locations of the given contacts, if they are already known. If any of the given contacts' locations are not known, request their current locations, but return immediately without waiting for a reply; if a reply with a non-empty location is later received for those contacts, the <tp:member-ref>LocationUpdated</tp:member-ref> signal will be emitted for them.</p> <tp:rationale> <p>This method is appropriate for &quot;lazy&quot; location finding, for instance displaying the location (if available) of everyone in your contact list.</p> </tp:rationale> <p>For backwards compatibility, if this method is called by a client whose &quot;interest count&quot; for this interface, as defined by <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.AddClientInterest</tp:dbus-ref>, is zero, the Connection SHOULD behave as if AddClientInterest had been called for this interface just before that method call. Clients that do not explicitly call AddClientInterest SHOULD NOT call <tp:dbus-ref namespace="org.freedesktop.Telepathy">Connection.RemoveClientInterest</tp:dbus-ref> either.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: The contacts whose locations should be returned or signalled.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_location_callback_for_get_locations ()

void
(*tp_cli_connection_interface_location_callback_for_get_locations)
                               (TpConnection *proxy,
                                GHashTable *out_Locations,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetLocations method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Locations

Used to return an 'out' argument if error is NULL: The contacts' locations, if already known. Contacts whose locations are not already known are omitted from the mapping; contacts known to have no location information appear in the mapping with an empty Location dictionary.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_location_call_request_location ()

TpProxyPendingCall *
tp_cli_connection_interface_location_call_request_location
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                tp_cli_connection_interface_location_callback_for_request_location callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestLocation method call.

Return the current location of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply. <tp:rationale> This method is appropriate for use in a &quot;Contact Information...&quot; dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: The contact whose location should be returned. (TpContactHandle)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_location_callback_for_request_location ()

void
(*tp_cli_connection_interface_location_callback_for_request_location)
                               (TpConnection *proxy,
                                GHashTable *out_Location,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestLocation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Location

Used to return an 'out' argument if error is NULL: The contact's location. It MAY be empty, indicating that no location information was found.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_location_call_set_location ()

TpProxyPendingCall *
tp_cli_connection_interface_location_call_set_location
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Location,
                                tp_cli_connection_interface_location_callback_for_set_location callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetLocation method call.

Set the local user's own location.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Location

Used to pass an 'in' argument: The location to advertise. If the user wants to obscure their exact location by reducing the precision or accuracy, clients MUST do this themselves, rather than relying on the connection manager to do so. Clients that interact with more than one connection SHOULD advertise the same reduced-accuracy location to all of them, so that contacts cannot obtain an undesirably accurate location by assuming that random errors have been added and averaging the locations advertised on multiple connections.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_location_callback_for_set_location ()

void
(*tp_cli_connection_interface_location_callback_for_set_location)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetLocation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-file-transfer.html0000644000175000017500000020660314006623344025242 00000000000000 File transfer: telepathy-glib API Reference Manual

File transfer

File transfer — client-side wrappers for the File Transfer channel type

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This section documents the auto-generated C wrappers for the File Transfer channel type.

Functions

tp_cli_channel_type_file_transfer_call_accept_file ()

TpProxyPendingCall *
tp_cli_channel_type_file_transfer_call_accept_file
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                guint64 in_Offset,
                                tp_cli_channel_type_file_transfer_callback_for_accept_file callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcceptFile method call.

Accept a file transfer that's in the Pending state. The file transfer's state becomes Accepted after this method is called. At this point the client can connect to the socket. CM MUST emit <tp:member-ref>InitialOffsetDefined</tp:member-ref> and change the state to Open before writing to the socket. Then <tp:member-ref>InitialOffset</tp:member-ref> should be respected in case its value differs from the offset that was specified as an argument to AcceptFile.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

in_Offset

Used to pass an 'in' argument: The desired offset in bytes where the file transfer should start. The offset is taken from the beginning of the file. Specifying an offset of zero will start the transfer from the beginning of the file. The offset that is actually given in the <tp:member-ref>InitialOffset</tp:member-ref> property can differ from this argument where the requested offset is not supported. (For example, some protocols do not support offsets at all so the InitialOffset property will always be 0.)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_file_transfer_call_provide_file ()

TpProxyPendingCall *
tp_cli_channel_type_file_transfer_call_provide_file
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                tp_cli_channel_type_file_transfer_callback_for_provide_file callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ProvideFile method call.

Provide the file for an outgoing file transfer which has been offered. Opens a socket that the client can use to provide a file to the connection manager. The channel MUST have been requested, and will change state to Open when this method is called if its state was Accepted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_file_transfer_callback_for_accept_file ()

void
(*tp_cli_channel_type_file_transfer_callback_for_accept_file)
                               (TpChannel *proxy,
                                const GValue *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcceptFile method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address

Used to return an 'out' argument if error is NULL: The address on which the connection manager will listen for connections for this file transfer.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_file_transfer_callback_for_provide_file ()

void
(*tp_cli_channel_type_file_transfer_callback_for_provide_file)
                               (TpChannel *proxy,
                                const GValue *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ProvideFile method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address

Used to return an 'out' argument if error is NULL: The address on which the connection manager will listen for connections for this file transfer.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed ()

TpProxySignalConnection *
tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_file_transfer_signal_callback_file_transfer_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal FileTransferStateChanged.

Emitted when the state of a file transfer changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined ()

TpProxySignalConnection *
tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined
                               (TpChannel *proxy,
                                tp_cli_channel_type_file_transfer_signal_callback_initial_offset_defined callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal InitialOffsetDefined.

Emitted when the value of the <tp:member-ref>InitialOffset</tp:member-ref> property has been negotiated. This signal MUST be emitted before the channel becomes Open and clients have to use this offset when transferring the file.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed ()

TpProxySignalConnection *
tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_file_transfer_signal_callback_transferred_bytes_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TransferredBytesChanged.

Emitted when the number of transferred bytes changes. This will not be signalled with every single byte change. Instead, the most frequent this signal will be emitted is once a second. This should be sufficient, and the <tp:member-ref>TransferredBytes</tp:member-ref> property SHOULD NOT be polled.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_file_transfer_connect_to_uri_defined ()

TpProxySignalConnection *
tp_cli_channel_type_file_transfer_connect_to_uri_defined
                               (TpChannel *proxy,
                                tp_cli_channel_type_file_transfer_signal_callback_uri_defined callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal URIDefined.

Emitted when the value of the <tp:member-ref>URI</tp:member-ref> property has been set. This signal MUST only be emitted on incoming file transfers, and only if the handler sets the <tp:member-ref>URI</tp:member-ref> property before accepting the file.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_file_transfer_run_accept_file ()

gboolean
tp_cli_channel_type_file_transfer_run_accept_file
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                guint64 in_Offset,
                                GValue **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_file_transfer_run_accept_file is deprecated and should not be used in newly-written code.

Call the method AcceptFile and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Accept a file transfer that's in the Pending state. The file transfer's state becomes Accepted after this method is called. At this point the client can connect to the socket. CM MUST emit <tp:member-ref>InitialOffsetDefined</tp:member-ref> and change the state to Open before writing to the socket. Then <tp:member-ref>InitialOffset</tp:member-ref> should be respected in case its value differs from the offset that was specified as an argument to AcceptFile.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

in_Offset

Used to pass an 'in' argument: The desired offset in bytes where the file transfer should start. The offset is taken from the beginning of the file. Specifying an offset of zero will start the transfer from the beginning of the file. The offset that is actually given in the <tp:member-ref>InitialOffset</tp:member-ref> property can differ from this argument where the requested offset is not supported. (For example, some protocols do not support offsets at all so the InitialOffset property will always be 0.)

 

out_Address

Used to return an 'out' argument if TRUE is returned: The address on which the connection manager will listen for connections for this file transfer.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_file_transfer_run_provide_file ()

gboolean
tp_cli_channel_type_file_transfer_run_provide_file
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                GValue **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_file_transfer_run_provide_file is deprecated and should not be used in newly-written code.

Call the method ProvideFile and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Provide the file for an outgoing file transfer which has been offered. Opens a socket that the client can use to provide a file to the connection manager. The channel MUST have been requested, and will change state to Open when this method is called if its state was Accepted.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

out_Address

Used to return an 'out' argument if TRUE is returned: The address on which the connection manager will listen for connections for this file transfer.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_file_transfer_signal_callback_file_transfer_state_changed ()

void
(*tp_cli_channel_type_file_transfer_signal_callback_file_transfer_state_changed)
                               (TpChannel *proxy,
                                guint arg_State,
                                guint arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal FileTransferStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed() was called

 

arg_State

The new state of the file transfer; see the File_Transfer_State enumeration. (TpFileTransferState)

 

arg_Reason

The reason for the state change; see the File_Transfer_State_Change_Reason enumeration. The value will always be File_Transfer_State_Change_Reason_None, except when changing state to cancelled. (TpFileTransferStateChangeReason)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_file_transfer_signal_callback_initial_offset_defined ()

void
(*tp_cli_channel_type_file_transfer_signal_callback_initial_offset_defined)
                               (TpChannel *proxy,
                                guint64 arg_InitialOffset,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal InitialOffsetDefined.

Parameters

proxy

The proxy on which tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined() was called

 

arg_InitialOffset

The value of the <tp:member-ref>InitialOffset</tp:member-ref> property.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_file_transfer_signal_callback_transferred_bytes_changed ()

void
(*tp_cli_channel_type_file_transfer_signal_callback_transferred_bytes_changed)
                               (TpChannel *proxy,
                                guint64 arg_Count,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TransferredBytesChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed() was called

 

arg_Count

The number of already transferred bytes.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_file_transfer_signal_callback_uri_defined ()

void
(*tp_cli_channel_type_file_transfer_signal_callback_uri_defined)
                               (TpChannel *proxy,
                                const gchar *arg_URI,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal URIDefined.

Parameters

proxy

The proxy on which tp_cli_channel_type_file_transfer_connect_to_uri_defined() was called

 

arg_URI

The value of the <tp:member-ref>URI</tp:member-ref> property.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpChannel

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-contacts.html0000644000175000017500000010556614006623344025054 00000000000000 Connection Contacts interface: telepathy-glib API Reference Manual

Connection Contacts interface

Connection Contacts interface — client-side wrappers for the Contacts interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

This interface allows a client to get information from various connection interfaces in one dbus call.

This section documents the auto-generated C wrappers for the Contacts interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_contacts_call_get_contact_attributes ()

TpProxyPendingCall *
tp_cli_connection_interface_contacts_call_get_contact_attributes
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                const gchar **in_Interfaces,
                                gboolean in_Hold,
                                tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactAttributes method call.

Return any number of contact attributes for the given handles.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handles

Used to pass an 'in' argument: An array of handles representing contacts.

 

in_Interfaces

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.</p> <p>Connection managers SHOULD ignore interfaces requested which they do not support (i.e. those not mentioned in the <tp:member-ref>ContactAttributeInterfaces</tp:member-ref> property.)</p> <tp:rationale> <p>This simplifies client-side code. Clients which care may distinguish between unsupported interfaces (e.g. this Connection does not support Avatars), and interfaces on which no information is known for these contacts (e.g. we don't know the avatar tokens of any of the contacts, so we omitted them all) by inspecting <tp:member-ref>ContactAttributeInterfaces</tp:member-ref>.</p> </tp:rationale> <p>Attributes from the interface <tp:dbus-ref>org.freedesktop.Telepathy.Connection</tp:dbus-ref> are always returned, and need not be requested explicitly.</p> <p>As well as returning cached information immediately, the connection MAY start asynchronous requests to obtain better values for the contact attributes. If better values are later obtained by this process, they will be indicated with the usual signals (such as <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">AliasesChanged</tp:dbus-ref>).</p> <tp:rationale> For instance, an XMPP connection manager could download vCards in response to a request for <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Aliasing</tp:dbus-ref> attributes. </tp:rationale>

 

in_Hold

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If true, all handles that appear as keys in the result have been held on behalf of the calling process, as if by a call to <tp:dbus-ref namespace="ofdT">Connection.HoldHandles</tp:dbus-ref>. (If <tp:dbus-ref namespace="ofdT.Connection">HasImmortalHandles</tp:dbus-ref> is true, which SHOULD be the case in all new connection managers, this has no effect.)</p> <tp:rationale> <p>For further round-trip avoidance.</p> </tp:rationale>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contacts_callback_for_get_contact_attributes ()

void
(*tp_cli_connection_interface_contacts_callback_for_get_contact_attributes)
                               (TpConnection *proxy,
                                GHashTable *out_Attributes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactAttributes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Attributes

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary mapping the contact handles to contact attributes. If any of the requested handles are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.</p> <p>Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (<code>org.freedesktop.Telepathy.Connection/contact-id</code>).</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_contacts_run_get_contact_attributes ()

gboolean
tp_cli_connection_interface_contacts_run_get_contact_attributes
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                const gchar **in_Interfaces,
                                gboolean in_Hold,
                                GHashTable **out_Attributes,
                                GError **error,
                                GMainLoop **loop);

tp_cli_connection_interface_contacts_run_get_contact_attributes is deprecated and should not be used in newly-written code.

Call the method GetContactAttributes and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Return any number of contact attributes for the given handles.

Parameters

proxy

A TpConnection or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handles

Used to pass an 'in' argument: An array of handles representing contacts.

 

in_Interfaces

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.</p> <p>Connection managers SHOULD ignore interfaces requested which they do not support (i.e. those not mentioned in the <tp:member-ref>ContactAttributeInterfaces</tp:member-ref> property.)</p> <tp:rationale> <p>This simplifies client-side code. Clients which care may distinguish between unsupported interfaces (e.g. this Connection does not support Avatars), and interfaces on which no information is known for these contacts (e.g. we don't know the avatar tokens of any of the contacts, so we omitted them all) by inspecting <tp:member-ref>ContactAttributeInterfaces</tp:member-ref>.</p> </tp:rationale> <p>Attributes from the interface <tp:dbus-ref>org.freedesktop.Telepathy.Connection</tp:dbus-ref> are always returned, and need not be requested explicitly.</p> <p>As well as returning cached information immediately, the connection MAY start asynchronous requests to obtain better values for the contact attributes. If better values are later obtained by this process, they will be indicated with the usual signals (such as <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface.Aliasing">AliasesChanged</tp:dbus-ref>).</p> <tp:rationale> For instance, an XMPP connection manager could download vCards in response to a request for <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection.Interface">Aliasing</tp:dbus-ref> attributes. </tp:rationale>

 

in_Hold

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>If true, all handles that appear as keys in the result have been held on behalf of the calling process, as if by a call to <tp:dbus-ref namespace="ofdT">Connection.HoldHandles</tp:dbus-ref>. (If <tp:dbus-ref namespace="ofdT.Connection">HasImmortalHandles</tp:dbus-ref> is true, which SHOULD be the case in all new connection managers, this has no effect.)</p> <tp:rationale> <p>For further round-trip avoidance.</p> </tp:rationale>

 

out_Attributes

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary mapping the contact handles to contact attributes. If any of the requested handles are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.</p> <p>Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (<code>org.freedesktop.Telepathy.Connection/contact-id</code>).</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_connection_interface_contacts_call_get_contact_by_id ()

TpProxyPendingCall *
tp_cli_connection_interface_contacts_call_get_contact_by_id
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Identifier,
                                const gchar **in_Interfaces,
                                tp_cli_connection_interface_contacts_callback_for_get_contact_by_id callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetContactByID method call.

Return any number of contact attributes for the given identifier. <tp:rationale> This is for a single identifier to make it simpler to use for the most common use case. For multiple contacts case, <tp:member-ref>GetContactAttributes</tp:member-ref> should be used. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Identifier

Used to pass an 'in' argument: An identifier representing a contact.

 

in_Interfaces

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.</p> <p>See <tp:member-ref>GetContactAttributes</tp:member-ref> for details.</p>

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_contacts_callback_for_get_contact_by_id ()

void
(*tp_cli_connection_interface_contacts_callback_for_get_contact_by_id)
                               (TpConnection *proxy,
                                guint out_Handle,
                                GHashTable *out_Attributes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetContactByID method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Handle

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>The contact's handle, as returned by <tp:dbus-ref namespace="ofdT.Connection">RequestHandles</tp:dbus-ref></p> (TpContactHandle)

 

out_Attributes

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>All supported attributes of the contact on the given interfaces that can be returned without network round-trips. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.</p> <p>The contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (<code>org.freedesktop.Telepathy.Connection/contact-id</code>).</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-simple-observer.html0000644000175000017500000010643614006623344024214 00000000000000 TpSimpleObserver: telepathy-glib API Reference Manual

TpSimpleObserver

TpSimpleObserver — a subclass of TpBaseClient implementing a simple Observer

Properties

gpointer callback Write / Construct Only
gpointer destroy Write / Construct Only
gboolean recover Write / Construct Only
gpointer user-data Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── TpBaseClient
        ╰── TpSimpleObserver

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This class makes it easier to write TpSvcClient implementing the TpSvcClientObserver interface.

A typical simple observer would look liks this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
static void
my_observe_channels (TpSimpleObserver *observer,
   TpAccount *account,
   TpConnection *connection,
   GList *channels,
   TpChannelDispatchOperation *dispatch_operation,
   GList *requests,
   TpObserveChannelsContext *context,
   gpointer user_data)
{
 /<!-- -->* do something useful with the channels here *<!-- -->/

 tp_observe_channels_context_accept (context);
}

factory = tp_automatic_client_factory_new (dbus);
client = tp_simple_observer_new_with_factory (factory, TRUE, "MyObserver",
    FALSE, my_observe_channels, user_data);
g_object_unref (factory);

tp_base_client_take_observer_filter (client, tp_asv_new (
     TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT,
     TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
     NULL));

tp_base_client_register (client, NULL);

See examples/client/media-observer.c for a complete example.

Functions

TpSimpleObserverObserveChannelsImpl ()

void
(*TpSimpleObserverObserveChannelsImpl)
                               (TpSimpleObserver *observer,
                                TpAccount *account,
                                TpConnection *connection,
                                GList *channels,
                                TpChannelDispatchOperation *dispatch_operation,
                                GList *requests,
                                TpObserveChannelsContext *context,
                                gpointer user_data);

Signature of the implementation of the ObserveChannels method.

This function must call either tp_observe_channels_context_accept(), tp_observe_channels_context_delay() or tp_observe_channels_context_fail() on context before it returns.

Parameters

observer

a TpSimpleObserver instance

 

account

a TpAccount having TP_ACCOUNT_FEATURE_CORE prepared if possible

 

connection

a TpConnection having TP_CONNECTION_FEATURE_CORE prepared if possible

 

channels

a GList of TpChannel, all having TP_CHANNEL_FEATURE_CORE prepared if possible.

[element-type TelepathyGLib.Channel]

dispatch_operation

a TpChannelDispatchOperation or NULL; the dispatch_operation is not guaranteed to be prepared.

[allow-none]

requests

a GList of TpChannelRequest, all having their object-path defined but are not guaranteed to be prepared.

[element-type TelepathyGLib.ChannelRequest]

context

a TpObserveChannelsContext representing the context of this D-Bus call

 

user_data

arbitrary user-supplied data passed to tp_simple_observer_new()

 

Since: 0.11.5


tp_simple_observer_new ()

TpBaseClient *
tp_simple_observer_new (TpDBusDaemon *dbus,
                        gboolean recover,
                        const gchar *name,
                        gboolean uniquify,
                        TpSimpleObserverObserveChannelsImpl callback,
                        gpointer user_data,
                        GDestroyNotify destroy);

tp_simple_observer_new is deprecated and should not be used in newly-written code.

New code should use tp_simple_observer_new_with_am() instead.

Convenient function to create a new TpSimpleObserver instance.

If dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_observer_new_with_am() instead, so that TpAccount, TpConnection and TpContact instances can be shared between modules.

Parameters

dbus

a TpDBusDaemon object, may not be NULL

 

recover

the value of the Observer.Recover D-Bus property

 

name

the name of the Observer (see “name”: for details)

 

uniquify

the value of the “uniquify-name”: property

 

callback

the function called when ObserveChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when the TpSimpleObserver is destroyed

 

Returns

a new TpSimpleObserver.

[type TelepathyGLib.SimpleObserver]

Since: 0.11.5


tp_simple_observer_new_with_am ()

TpBaseClient *
tp_simple_observer_new_with_am (TpAccountManager *account_manager,
                                gboolean recover,
                                const gchar *name,
                                gboolean uniquify,
                                TpSimpleObserverObserveChannelsImpl callback,
                                gpointer user_data,
                                GDestroyNotify destroy);

Convenient function to create a new TpSimpleObserver instance with a specified TpAccountManager.

It is not necessary to prepare any features on account_manager before calling this function.

Parameters

account_manager

an account manager, which may not be NULL

 

recover

the value of the Observer.Recover D-Bus property

 

name

the name of the Observer (see “name”: for details)

 

uniquify

the value of the “uniquify-name”: property

 

callback

the function called when ObserveChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when the TpSimpleObserver is destroyed

 

Returns

a new TpSimpleObserver.

[type TelepathyGLib.SimpleObserver]

Since: 0.11.14


tp_simple_observer_new_with_factory ()

TpBaseClient *
tp_simple_observer_new_with_factory (TpSimpleClientFactory *factory,
                                     gboolean recover,
                                     const gchar *name,
                                     gboolean uniquify,
                                     TpSimpleObserverObserveChannelsImpl callback,
                                     gpointer user_data,
                                     GDestroyNotify destroy);

Convenient function to create a new TpSimpleObserver instance with a specified TpSimpleClientFactory.

Parameters

factory

a TpSimpleClientFactory, which may not be NULL

 

recover

the value of the Observer.Recover D-Bus property

 

name

the name of the Observer (see “name”: for details)

 

uniquify

the value of the “uniquify-name”: property

 

callback

the function called when ObserveChannels is called

 

user_data

arbitrary user-supplied data passed to callback

 

destroy

called with the user_data as argument, when the TpSimpleObserver is destroyed

 

Returns

a new TpSimpleObserver.

[type TelepathyGLib.SimpleObserver]

Since: 0.15.5

Types and Values

struct TpSimpleObserver

struct TpSimpleObserver;

Data structure representing a simple Observer implementation.

Since: 0.11.5

Property Details

The “callback” property

  “callback”                 gpointer

The TpSimpleObserverObserveChannelsImpl callback implementing the ObserveChannels D-Bus method.

This property can't be NULL.

Owner: TpSimpleObserver

Flags: Write / Construct Only

Since: 0.11.5


The “destroy” property

  “destroy”                  gpointer

The GDestroyNotify function called to free the user-data pointer when the TpSimpleObserver is destroyed.

Owner: TpSimpleObserver

Flags: Write / Construct Only

Since: 0.11.5


The “recover” property

  “recover”                  gboolean

The value of the Observer.Recover D-Bus property.

Owner: TpSimpleObserver

Flags: Write / Construct Only

Default value: FALSE

Since: 0.11.5


The “user-data” property

  “user-data”                gpointer

The user-data pointer passed to the callback implementing the ObserveChannels D-Bus method.

Owner: TpSimpleObserver

Flags: Write / Construct Only

Since: 0.11.5

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-tubes.html0000644000175000017500000057655214006623344023640 00000000000000 Tubes channels: telepathy-glib API Reference Manual

Tubes channels

Tubes channels — client-side wrappers for the Tubes channel type

Functions

gboolean tp_cli_channel_type_tubes_run_accept_d_bus_tube ()
gboolean tp_cli_channel_type_tubes_run_accept_stream_tube ()
gboolean tp_cli_channel_type_tubes_run_close_tube ()
gboolean tp_cli_channel_type_tubes_run_get_available_stream_tube_types ()
gboolean tp_cli_channel_type_tubes_run_get_available_tube_types ()
gboolean tp_cli_channel_type_tubes_run_get_d_bus_names ()
gboolean tp_cli_channel_type_tubes_run_get_d_bus_tube_address ()
gboolean tp_cli_channel_type_tubes_run_get_stream_tube_socket_address ()
gboolean tp_cli_channel_type_tubes_run_list_tubes ()
gboolean tp_cli_channel_type_tubes_run_offer_d_bus_tube ()
gboolean tp_cli_channel_type_tubes_run_offer_stream_tube ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_accept_d_bus_tube ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_accept_stream_tube ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_close_tube ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_get_available_stream_tube_types ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_get_available_tube_types ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_get_d_bus_names ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_get_d_bus_tube_address ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_get_stream_tube_socket_address ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_list_tubes ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_offer_d_bus_tube ()
TpProxyPendingCall * tp_cli_channel_type_tubes_call_offer_stream_tube ()
void (*tp_cli_channel_type_tubes_callback_for_accept_d_bus_tube) ()
void (*tp_cli_channel_type_tubes_callback_for_accept_stream_tube) ()
void (*tp_cli_channel_type_tubes_callback_for_close_tube) ()
void (*tp_cli_channel_type_tubes_callback_for_get_available_stream_tube_types) ()
void (*tp_cli_channel_type_tubes_callback_for_get_available_tube_types) ()
void (*tp_cli_channel_type_tubes_callback_for_get_d_bus_names) ()
void (*tp_cli_channel_type_tubes_callback_for_get_d_bus_tube_address) ()
void (*tp_cli_channel_type_tubes_callback_for_get_stream_tube_socket_address) ()
void (*tp_cli_channel_type_tubes_callback_for_list_tubes) ()
void (*tp_cli_channel_type_tubes_callback_for_offer_d_bus_tube) ()
void (*tp_cli_channel_type_tubes_callback_for_offer_stream_tube) ()
TpProxySignalConnection * tp_cli_channel_type_tubes_connect_to_d_bus_names_changed ()
TpProxySignalConnection * tp_cli_channel_type_tubes_connect_to_new_tube ()
TpProxySignalConnection * tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection ()
TpProxySignalConnection * tp_cli_channel_type_tubes_connect_to_tube_closed ()
TpProxySignalConnection * tp_cli_channel_type_tubes_connect_to_tube_state_changed ()
void (*tp_cli_channel_type_tubes_signal_callback_d_bus_names_changed) ()
void (*tp_cli_channel_type_tubes_signal_callback_new_tube) ()
void (*tp_cli_channel_type_tubes_signal_callback_stream_tube_new_connection) ()
void (*tp_cli_channel_type_tubes_signal_callback_tube_closed) ()
void (*tp_cli_channel_type_tubes_signal_callback_tube_state_changed) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

A "tube" is a mechanism for arbitrary data transfer. This section documents the auto-generated C wrappers for the Tubes channel type.

Functions

tp_cli_channel_type_tubes_run_accept_d_bus_tube ()

gboolean
tp_cli_channel_type_tubes_run_accept_d_bus_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                gchar **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_accept_d_bus_tube is deprecated and should not be used in newly-written code.

Call the method AcceptDBusTube and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Accept a D-Bus tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the TubeStateChanged signal is emitted.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to accept. (TpTubeID)

 

out_Address

Used to return an 'out' argument if TRUE is returned: The string describing the address of the private bus. The client should not attempt to connect to the address until the tube is open.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_accept_stream_tube ()

gboolean
tp_cli_channel_type_tubes_run_accept_stream_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                GValue **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_accept_stream_tube is deprecated and should not be used in newly-written code.

Call the method AcceptStreamTube and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Accept a stream tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the TubeStateChanged signal is emitted.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to accept. (TpTubeID)

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

out_Address

Used to return an 'out' argument if TRUE is returned: The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_close_tube ()

gboolean
tp_cli_channel_type_tubes_run_close_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_close_tube is deprecated and should not be used in newly-written code.

Call the method CloseTube and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Close a tube.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to close. (TpTubeID)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_get_available_stream_tube_types ()

gboolean
tp_cli_channel_type_tubes_run_get_available_stream_tube_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GHashTable **out_Available_Stream_Tube_Types,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_get_available_stream_tube_types is deprecated and should not be used in newly-written code.

Call the method GetAvailableStreamTubeTypes and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

List the available address types and access-control types for stream tubes.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Available_Stream_Tube_Types

Used to return an 'out' argument if TRUE is returned: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for stream tubes with that address type. For simplicity, if a CM supports offering a particular type of tube, it is assumed to support accepting it.</p> <p>A typical value for a host without IPv6 support:</p> <pre> { Socket_Address_Type_IPv4: [Socket_Access_Control_Localhost, Socket_Access_Control_Port, Socket_Access_Control_Netmask], Socket_Address_Type_Unix: [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials] } </pre> <p>If stream tubes are not supported, this will be an empty dictionary.</p>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_get_available_tube_types ()

gboolean
tp_cli_channel_type_tubes_run_get_available_tube_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Available_Tube_Types,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_get_available_tube_types is deprecated and should not be used in newly-written code.

Call the method GetAvailableTubeTypes and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Available_Tube_Types

Used to return an 'out' argument if TRUE is returned: An array of the available tube types, as defined by the Tube_Type enum.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_get_d_bus_names ()

gboolean
tp_cli_channel_type_tubes_run_get_d_bus_names
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                GPtrArray **out_DBus_Names,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_get_d_bus_names is deprecated and should not be used in newly-written code.

Call the method GetDBusNames and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping between contact handles and their unique bus names on this tube.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to get names for. (TpTubeID)

 

out_DBus_Names

Used to return an 'out' argument if TRUE is returned: An array of structures, each containing a contact handle and a D-Bus bus name.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_get_d_bus_tube_address ()

gboolean
tp_cli_channel_type_tubes_run_get_d_bus_tube_address
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                gchar **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_get_d_bus_tube_address is deprecated and should not be used in newly-written code.

Call the method GetDBusTubeAddress and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

For a D-Bus tube, return a string describing the address of the private bus.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to get an address for. (TpTubeID)

 

out_Address

Used to return an 'out' argument if TRUE is returned: The bus address.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_get_stream_tube_socket_address ()

gboolean
tp_cli_channel_type_tubes_run_get_stream_tube_socket_address
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                guint *out_Address_Type,
                                GValue **out_Address,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_get_stream_tube_socket_address is deprecated and should not be used in newly-written code.

Call the method GetStreamTubeSocketAddress and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

For a stream tube, obtain the address of the socket used to communicate over this tube.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_ID

Used to pass an 'in' argument: The ID of the stream tube to get the socket for. (TpTubeID)

 

out_Address_Type

Used to return an 'out' argument if TRUE is returned: The type of the listening address of the socket, as a member of Socket_Address_Type.

 

out_Address

Used to return an 'out' argument if TRUE is returned: The listening address of the socket, as indicated by the address_type.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_list_tubes ()

gboolean
tp_cli_channel_type_tubes_run_list_tubes
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GPtrArray **out_Tubes,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_list_tubes is deprecated and should not be used in newly-written code.

Call the method ListTubes and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

(Undocumented)

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Tubes

Used to return an 'out' argument if TRUE is returned: Return an array of tuples, each representing a tube, with the following members: <ul> <li>the tube's ID</li> <li>the tube's initiator</li> <li>the tube's type</li> <li>the tube's service</li> <li>the tube's parameters</li> <li>the tube's state</li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_offer_d_bus_tube ()

gboolean
tp_cli_channel_type_tubes_run_offer_d_bus_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                guint *out_Tube_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_offer_d_bus_tube is deprecated and should not be used in newly-written code.

Call the method OfferDBusTube and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Offers a D-Bus tube providing the service specified.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Service

Used to pass an 'in' argument: A string representing the service name that will be used over the tube. It should be a well-known D-Bus service name, of the form com.example.ServiceName.

 

in_Parameters

Used to pass an 'in' argument: A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'.

 

out_Tube_ID

Used to return an 'out' argument if TRUE is returned: The ID of the new tube.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_run_offer_stream_tube ()

gboolean
tp_cli_channel_type_tubes_run_offer_stream_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                guint in_Address_Type,
                                const GValue *in_Address,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                guint *out_Tube_ID,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_type_tubes_run_offer_stream_tube is deprecated and should not be used in newly-written code.

Call the method OfferStreamTube and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Offer a stream tube exporting the local socket specified.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Service

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> A string representing the service name that will be used over the tube. It should be a well-known TCP service name as defined by <a href="http://www.iana.org/assignments/port-numbers"> http://www.iana.org/assignments/port-numbers</a> or <a href="http://www.dns-sd.org/ServiceTypes.html"> http://www.dns-sd.org/ServiceTypes.html</a>, for instance &quot;rsync&quot; or &quot;daap&quot;.

 

in_Parameters

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'.</p> <p>These should usually be the same key-value pairs specified for use in the DNS-SD TXT record for that service.</p>

 

in_Address_Type

Used to pass an 'in' argument: The type of the listening address of the local service, as a member of Socket_Address_Type. (TpSocketAddressType)

 

in_Address

Used to pass an 'in' argument: The listening address of the local service, as indicated by the address_type.

 

in_Access_Control

Used to pass an 'in' argument: The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

out_Tube_ID

Used to return an 'out' argument if TRUE is returned: The ID of the new tube.

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_type_tubes_call_accept_d_bus_tube ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_accept_d_bus_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                tp_cli_channel_type_tubes_callback_for_accept_d_bus_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcceptDBusTube method call.

Accept a D-Bus tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the TubeStateChanged signal is emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to accept. (TpTubeID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_accept_stream_tube ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_accept_stream_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                guint in_Address_Type,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                tp_cli_channel_type_tubes_callback_for_accept_stream_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AcceptStreamTube method call.

Accept a stream tube that's in the &quot;local pending&quot; state. The connection manager will attempt to open the tube. The tube remains in the &quot;local pending&quot; state until the TubeStateChanged signal is emitted.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to accept. (TpTubeID)

 

in_Address_Type

Used to pass an 'in' argument: The type of address the connection manager should listen on. (TpSocketAddressType)

 

in_Access_Control

Used to pass an 'in' argument: The type of access control the connection manager should apply to the socket. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_close_tube ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_close_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                tp_cli_channel_type_tubes_callback_for_close_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a CloseTube method call.

Close a tube.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to close. (TpTubeID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_get_available_stream_tube_types ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_get_available_stream_tube_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_tubes_callback_for_get_available_stream_tube_types callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetAvailableStreamTubeTypes method call.

List the available address types and access-control types for stream tubes.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_get_available_tube_types ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_get_available_tube_types
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_tubes_callback_for_get_available_tube_types callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetAvailableTubeTypes method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_get_d_bus_names ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_get_d_bus_names
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                tp_cli_channel_type_tubes_callback_for_get_d_bus_names callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetDBusNames method call.

For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping between contact handles and their unique bus names on this tube.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to get names for. (TpTubeID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_get_d_bus_tube_address ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_get_d_bus_tube_address
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                tp_cli_channel_type_tubes_callback_for_get_d_bus_tube_address callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetDBusTubeAddress method call.

For a D-Bus tube, return a string describing the address of the private bus.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the tube to get an address for. (TpTubeID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_get_stream_tube_socket_address ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_get_stream_tube_socket_address
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint in_ID,
                                tp_cli_channel_type_tubes_callback_for_get_stream_tube_socket_address callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a GetStreamTubeSocketAddress method call.

For a stream tube, obtain the address of the socket used to communicate over this tube.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The ID of the stream tube to get the socket for. (TpTubeID)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_list_tubes ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_list_tubes
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_type_tubes_callback_for_list_tubes callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a ListTubes method call.

(Undocumented)

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_offer_d_bus_tube ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_offer_d_bus_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                tp_cli_channel_type_tubes_callback_for_offer_d_bus_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a OfferDBusTube method call.

Offers a D-Bus tube providing the service specified.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Service

Used to pass an 'in' argument: A string representing the service name that will be used over the tube. It should be a well-known D-Bus service name, of the form com.example.ServiceName.

 

in_Parameters

Used to pass an 'in' argument: A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_call_offer_stream_tube ()

TpProxyPendingCall *
tp_cli_channel_type_tubes_call_offer_stream_tube
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const gchar *in_Service,
                                GHashTable *in_Parameters,
                                guint in_Address_Type,
                                const GValue *in_Address,
                                guint in_Access_Control,
                                const GValue *in_Access_Control_Param,
                                tp_cli_channel_type_tubes_callback_for_offer_stream_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a OfferStreamTube method call.

Offer a stream tube exporting the local socket specified.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Service

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> A string representing the service name that will be used over the tube. It should be a well-known TCP service name as defined by <a href="http://www.iana.org/assignments/port-numbers"> http://www.iana.org/assignments/port-numbers</a> or <a href="http://www.dns-sd.org/ServiceTypes.html"> http://www.dns-sd.org/ServiceTypes.html</a>, for instance &quot;rsync&quot; or &quot;daap&quot;.

 

in_Parameters

Used to pass an 'in' argument: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'.</p> <p>These should usually be the same key-value pairs specified for use in the DNS-SD TXT record for that service.</p>

 

in_Address_Type

Used to pass an 'in' argument: The type of the listening address of the local service, as a member of Socket_Address_Type. (TpSocketAddressType)

 

in_Address

Used to pass an 'in' argument: The listening address of the local service, as indicated by the address_type.

 

in_Access_Control

Used to pass an 'in' argument: The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. (TpSocketAccessControl)

 

in_Access_Control_Param

Used to pass an 'in' argument: A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_type_tubes_callback_for_accept_d_bus_tube ()

void
(*tp_cli_channel_type_tubes_callback_for_accept_d_bus_tube)
                               (TpChannel *proxy,
                                const gchar *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcceptDBusTube method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address

Used to return an 'out' argument if error is NULL: The string describing the address of the private bus. The client should not attempt to connect to the address until the tube is open.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_accept_stream_tube ()

void
(*tp_cli_channel_type_tubes_callback_for_accept_stream_tube)
                               (TpChannel *proxy,
                                const GValue *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AcceptStreamTube method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address

Used to return an 'out' argument if error is NULL: The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_close_tube ()

void
(*tp_cli_channel_type_tubes_callback_for_close_tube)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a CloseTube method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_get_available_stream_tube_types ()

void
(*tp_cli_channel_type_tubes_callback_for_get_available_stream_tube_types)
                               (TpChannel *proxy,
                                GHashTable *out_Available_Stream_Tube_Types,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetAvailableStreamTubeTypes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Available_Stream_Tube_Types

Used to return an 'out' argument if error is NULL: <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for stream tubes with that address type. For simplicity, if a CM supports offering a particular type of tube, it is assumed to support accepting it.</p> <p>A typical value for a host without IPv6 support:</p> <pre> { Socket_Address_Type_IPv4: [Socket_Access_Control_Localhost, Socket_Access_Control_Port, Socket_Access_Control_Netmask], Socket_Address_Type_Unix: [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials] } </pre> <p>If stream tubes are not supported, this will be an empty dictionary.</p>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_get_available_tube_types ()

void
(*tp_cli_channel_type_tubes_callback_for_get_available_tube_types)
                               (TpChannel *proxy,
                                const GArray *out_Available_Tube_Types,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetAvailableTubeTypes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Available_Tube_Types

Used to return an 'out' argument if error is NULL: An array of the available tube types, as defined by the Tube_Type enum.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_get_d_bus_names ()

void
(*tp_cli_channel_type_tubes_callback_for_get_d_bus_names)
                               (TpChannel *proxy,
                                const GPtrArray *out_DBus_Names,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetDBusNames method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_DBus_Names

Used to return an 'out' argument if error is NULL: An array of structures, each containing a contact handle and a D-Bus bus name.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_get_d_bus_tube_address ()

void
(*tp_cli_channel_type_tubes_callback_for_get_d_bus_tube_address)
                               (TpChannel *proxy,
                                const gchar *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetDBusTubeAddress method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address

Used to return an 'out' argument if error is NULL: The bus address.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_get_stream_tube_socket_address ()

void
(*tp_cli_channel_type_tubes_callback_for_get_stream_tube_socket_address)
                               (TpChannel *proxy,
                                guint out_Address_Type,
                                const GValue *out_Address,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a GetStreamTubeSocketAddress method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Address_Type

Used to return an 'out' argument if error is NULL: The type of the listening address of the socket, as a member of Socket_Address_Type. (TpSocketAddressType)

 

out_Address

Used to return an 'out' argument if error is NULL: The listening address of the socket, as indicated by the address_type.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_list_tubes ()

void
(*tp_cli_channel_type_tubes_callback_for_list_tubes)
                               (TpChannel *proxy,
                                const GPtrArray *out_Tubes,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a ListTubes method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Tubes

Used to return an 'out' argument if error is NULL: Return an array of tuples, each representing a tube, with the following members: <ul> <li>the tube's ID</li> <li>the tube's initiator</li> <li>the tube's type</li> <li>the tube's service</li> <li>the tube's parameters</li> <li>the tube's state</li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_offer_d_bus_tube ()

void
(*tp_cli_channel_type_tubes_callback_for_offer_d_bus_tube)
                               (TpChannel *proxy,
                                guint out_Tube_ID,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a OfferDBusTube method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Tube_ID

Used to return an 'out' argument if error is NULL: The ID of the new tube. (TpTubeID)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_callback_for_offer_stream_tube ()

void
(*tp_cli_channel_type_tubes_callback_for_offer_stream_tube)
                               (TpChannel *proxy,
                                guint out_Tube_ID,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a OfferStreamTube method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Tube_ID

Used to return an 'out' argument if error is NULL: The ID of the new tube. (TpTubeID)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_type_tubes_connect_to_d_bus_names_changed ()

TpProxySignalConnection *
tp_cli_channel_type_tubes_connect_to_d_bus_names_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_tubes_signal_callback_d_bus_names_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal DBusNamesChanged.

Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a participant opens or closes the tube.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_tubes_connect_to_new_tube ()

TpProxySignalConnection *
tp_cli_channel_type_tubes_connect_to_new_tube
                               (TpChannel *proxy,
                                tp_cli_channel_type_tubes_signal_callback_new_tube callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal NewTube.

Emitted when a tube is created.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection ()

TpProxySignalConnection *
tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection
                               (TpChannel *proxy,
                                tp_cli_channel_type_tubes_signal_callback_stream_tube_new_connection callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal StreamTubeNewConnection.

Emitted on a stream tube when a participant opens a new connection to its socket.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_tubes_connect_to_tube_closed ()

TpProxySignalConnection *
tp_cli_channel_type_tubes_connect_to_tube_closed
                               (TpChannel *proxy,
                                tp_cli_channel_type_tubes_signal_callback_tube_closed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TubeClosed.

Emitted when a tube has been closed. The ID of a closed tube is no longer valid. The ID may later be reused for a new tube.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_tubes_connect_to_tube_state_changed ()

TpProxySignalConnection *
tp_cli_channel_type_tubes_connect_to_tube_state_changed
                               (TpChannel *proxy,
                                tp_cli_channel_type_tubes_signal_callback_tube_state_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal TubeStateChanged.

Emitted when the state of a tube changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_type_tubes_signal_callback_d_bus_names_changed ()

void
(*tp_cli_channel_type_tubes_signal_callback_d_bus_names_changed)
                               (TpChannel *proxy,
                                guint arg_ID,
                                const GPtrArray *arg_Added,
                                const GArray *arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal DBusNamesChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_tubes_connect_to_d_bus_names_changed() was called

 

arg_ID

The ID of the tube whose names have changed. (TpTubeID)

 

arg_Added

Array of handles and D-Bus names of new participants.

 

arg_Removed

Array of handles of former participants.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_tubes_signal_callback_new_tube ()

void
(*tp_cli_channel_type_tubes_signal_callback_new_tube)
                               (TpChannel *proxy,
                                guint arg_ID,
                                guint arg_Initiator,
                                guint arg_Type,
                                const gchar *arg_Service,
                                GHashTable *arg_Parameters,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal NewTube.

Parameters

proxy

The proxy on which tp_cli_channel_type_tubes_connect_to_new_tube() was called

 

arg_ID

The ID of the new tube. (TpTubeID)

 

arg_Initiator

The handle of the contact who initiated the tube. (TpContactHandle)

 

arg_Type

The tube type, as defined by the Tube_Type enum. (TpTubeType)

 

arg_Service

A string representing the service that will be used over the tube.

 

arg_Parameters

The new tube's properties.

 

arg_State

The new tube's state. (TpTubeState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_tubes_signal_callback_stream_tube_new_connection ()

void
(*tp_cli_channel_type_tubes_signal_callback_stream_tube_new_connection)
                               (TpChannel *proxy,
                                guint arg_ID,
                                guint arg_Handle,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal StreamTubeNewConnection.

Parameters

proxy

The proxy on which tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection() was called

 

arg_ID

The ID of the tube (TpTubeID)

 

arg_Handle

The handle of the participant who opened the new connection (TpContactHandle)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_tubes_signal_callback_tube_closed ()

void
(*tp_cli_channel_type_tubes_signal_callback_tube_closed)
                               (TpChannel *proxy,
                                guint arg_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TubeClosed.

Parameters

proxy

The proxy on which tp_cli_channel_type_tubes_connect_to_tube_closed() was called

 

arg_ID

The ID of the tube that was closed. (TpTubeID)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_type_tubes_signal_callback_tube_state_changed ()

void
(*tp_cli_channel_type_tubes_signal_callback_tube_state_changed)
                               (TpChannel *proxy,
                                guint arg_ID,
                                guint arg_State,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal TubeStateChanged.

Parameters

proxy

The proxy on which tp_cli_channel_type_tubes_connect_to_tube_state_changed() was called

 

arg_ID

The ID of the tube that changed state. (TpTubeID)

 

arg_State

The new state of the tube; see the Tube_State enumeration. (TpTubeState)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

channel-group

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-channel-group.html0000644000175000017500000073772514006623344023653 00000000000000 Group and Conference interfaces on Channels: telepathy-glib API Reference Manual

Group and Conference interfaces on Channels

Group and Conference interfaces on Channels — client-side wrappers for Group and Conference

Functions

gboolean tp_cli_channel_interface_group_run_add_members ()
gboolean tp_cli_channel_interface_group_run_get_all_members ()
gboolean tp_cli_channel_interface_group_run_get_group_flags ()
gboolean tp_cli_channel_interface_group_run_get_handle_owners ()
gboolean tp_cli_channel_interface_group_run_get_local_pending_members ()
gboolean tp_cli_channel_interface_group_run_get_local_pending_members_with_info ()
gboolean tp_cli_channel_interface_group_run_get_members ()
gboolean tp_cli_channel_interface_group_run_get_remote_pending_members ()
gboolean tp_cli_channel_interface_group_run_get_self_handle ()
gboolean tp_cli_channel_interface_group_run_remove_members ()
gboolean tp_cli_channel_interface_group_run_remove_members_with_reason ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_add_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_all_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_group_flags ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_handle_owners ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_local_pending_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_local_pending_members_with_info ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_remote_pending_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_get_self_handle ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_remove_members ()
TpProxyPendingCall * tp_cli_channel_interface_group_call_remove_members_with_reason ()
void (*tp_cli_channel_interface_group_callback_for_add_members) ()
void (*tp_cli_channel_interface_group_callback_for_get_all_members) ()
void (*tp_cli_channel_interface_group_callback_for_get_group_flags) ()
void (*tp_cli_channel_interface_group_callback_for_get_handle_owners) ()
void (*tp_cli_channel_interface_group_callback_for_get_local_pending_members) ()
void (*tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info) ()
void (*tp_cli_channel_interface_group_callback_for_get_members) ()
void (*tp_cli_channel_interface_group_callback_for_get_remote_pending_members) ()
void (*tp_cli_channel_interface_group_callback_for_get_self_handle) ()
void (*tp_cli_channel_interface_group_callback_for_remove_members) ()
void (*tp_cli_channel_interface_group_callback_for_remove_members_with_reason) ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_group_flags_changed ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_members_changed ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_members_changed_detailed ()
void (*tp_cli_channel_interface_group_signal_callback_group_flags_changed) ()
void (*tp_cli_channel_interface_group_signal_callback_members_changed) ()
void (*tp_cli_channel_interface_group_signal_callback_members_changed_detailed) ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_handle_owners_changed ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_self_handle_changed ()
void (*tp_cli_channel_interface_group_signal_callback_handle_owners_changed) ()
void (*tp_cli_channel_interface_group_signal_callback_self_handle_changed) ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed ()
TpProxySignalConnection * tp_cli_channel_interface_group_connect_to_self_contact_changed ()
void (*tp_cli_channel_interface_group_signal_callback_handle_owners_changed_detailed) ()
void (*tp_cli_channel_interface_group_signal_callback_self_contact_changed) ()
void tp_svc_channel_interface_group_emit_handle_owners_changed_detailed ()
void tp_svc_channel_interface_group_emit_self_contact_changed ()
TpProxySignalConnection * tp_cli_channel_interface_conference_connect_to_channel_merged ()
TpProxySignalConnection * tp_cli_channel_interface_conference_connect_to_channel_removed ()
void (*tp_cli_channel_interface_conference_signal_callback_channel_merged) ()
void (*tp_cli_channel_interface_conference_signal_callback_channel_removed) ()

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Many Telepathy Channel objects can be seen as representing groups or sets of contacts. The Telepathy specification represents this by a common interface, Group. This section documents the auto-generated C wrappers for the Group interface.

Contacts can be in four states:

  • in the group (the "members" set)

  • "local pending" (waiting to be added to the group by the local client calling AddMembers())

  • "remote pending" (waiting to be added to the group by some other action, probably by someone else)

  • no relationship with the group at all

For instance, chatrooms implement the Group interface. Contacts in the chatroom are members, and contacts who we've invited to the group, or contacts who've requested permission to join, are remote pending. If the local user has been invited by another contact, they will appear in the local-pending set until they accept or decline the invitation.

Some Group channels also have the Conference interface, representing a group which can be initiated by upgrading or merging one or more 1-1 channels.

Functions

tp_cli_channel_interface_group_run_add_members ()

gboolean
tp_cli_channel_interface_group_run_add_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_add_members is deprecated and should not be used in newly-written code.

Call the method AddMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Invite all the given contacts into the channel, or accept requests for channel membership for contacts on the pending local list.</p> <p>A message may be provided along with the request, which will be sent to the server if supported. See the CHANNEL_GROUP_FLAG_MESSAGE_ADD and CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT <tp:member-ref>GroupFlags</tp:member-ref> to see in which cases this message should be provided.</p> <p>Attempting to add contacts who are already members is allowed; connection managers must silently accept this, without error.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to invite to the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_all_members ()

gboolean
tp_cli_channel_interface_group_run_get_all_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Members,
                                GArray **out_Local_Pending,
                                GArray **out_Remote_Pending,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_all_members is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including Members, RemotePendingMembers and LocalPendingMembers instead, falling back to this method and GetLocalPendingMembersWithInfo if necessary.

Call the method GetAllMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns arrays of all current, local and remote pending channel members.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Members

Used to return an 'out' argument if TRUE is returned: array of handles of current members

 

out_Local_Pending

Used to return an 'out' argument if TRUE is returned: array of handles of local pending members

 

out_Remote_Pending

Used to return an 'out' argument if TRUE is returned: array of handles of remote pending members

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_group_flags ()

gboolean
tp_cli_channel_interface_group_run_get_group_flags
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint *out_Group_Flags,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_group_flags is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including GroupFlags instead, falling back to this method if necessary.

Call the method GetGroupFlags and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the value of the <tp:member-ref>GroupFlags</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Group_Flags

Used to return an 'out' argument if TRUE is returned: The value of the GroupFlags property

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_handle_owners ()

gboolean
tp_cli_channel_interface_group_run_get_handle_owners
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                GArray **out_Owners,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_handle_owners is deprecated and should not be used in newly-written code.

Clients should use the HandleOwners property and HandleOwnersChanged signal if Channel_Group_Flag_Properties is present.

Call the method GetHandleOwners and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

If the CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES flag is set on the channel, then the handles of the group members are specific to this channel, and are not meaningful in a connection-wide context such as contact lists. This method allows you to find the owner of the handle if it can be discovered in this channel, or 0 if the owner is not available.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Handles

Used to pass an 'in' argument: A list of integer handles representing members of the channel

 

out_Owners

Used to return an 'out' argument if TRUE is returned: An array of integer handles representing the owner handles of the given room members, in the same order, or 0 if the owner is not available

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_local_pending_members ()

gboolean
tp_cli_channel_interface_group_run_get_local_pending_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Handles,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_local_pending_members is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Call the method GetLocalPendingMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the To_Be_Added handle (only) for each structure in the <tp:member-ref>LocalPendingMembers</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Handles

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_local_pending_members_with_info ()

gboolean
tp_cli_channel_interface_group_run_get_local_pending_members_with_info
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GPtrArray **out_Info,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_local_pending_members_with_info is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Call the method GetLocalPendingMembersWithInfo and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the <tp:member-ref>LocalPendingMembers</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Info

Used to return an 'out' argument if TRUE is returned: An array of structs containing: <ul> <li> A handle representing the contact requesting channel membership </li> <li> A handle representing the contact making the request, or 0 if unknown </li> <li> The reason for the request: one of the values of <tp:type>Channel_Group_Change_Reason</tp:type> </li> <li> A string message containing the reason for the request if any (or blank if none) </li> </ul>

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_members ()

gboolean
tp_cli_channel_interface_group_run_get_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Handles,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_members is deprecated and should not be used in newly-written code.

Use the Members property, if Channel_Group_Flag_Properties is present.

Call the method GetMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the <tp:member-ref>Members</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Handles

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_remote_pending_members ()

gboolean
tp_cli_channel_interface_group_run_get_remote_pending_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                GArray **out_Handles,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_remote_pending_members is deprecated and should not be used in newly-written code.

Use the RemotePendingMembers property, if Channel_Group_Flag_Properties is present.

Call the method GetRemotePendingMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns an array of handles representing contacts who have been invited to the channel and are awaiting remote approval.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Handles

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_get_self_handle ()

gboolean
tp_cli_channel_interface_group_run_get_self_handle
                               (TpChannel *proxy,
                                gint timeout_ms,
                                guint *out_Self_Handle,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_get_self_handle is deprecated and should not be used in newly-written code.

Clients should retrieve the SelfHandle property using GetAll instead, if Channel_Group_Flag_Properties is present.

Call the method GetSelfHandle and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

Returns the value of the <tp:member-ref>SelfHandle</tp:member-ref> property.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

out_Self_Handle

Used to return an 'out' argument if TRUE is returned: (Undocumented)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_remove_members ()

gboolean
tp_cli_channel_interface_group_run_remove_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_remove_members is deprecated and should not be used in newly-written code.

Call the method RemoveMembers and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Requests the removal of contacts from a channel, reject their request for channel membership on the pending local list, or rescind their invitation on the pending remote list.</p> <p>If the <tp:member-ref>SelfHandle</tp:member-ref> is in a Group, it can be removed via this method, in order to leave the group gracefully. This is the recommended way to leave a chatroom, close or reject a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">StreamedMedia</tp:dbus-ref> call, and so on.</p> <p>Accordingly, connection managers SHOULD support doing this, regardless of the value of <tp:member-ref>GroupFlags</tp:member-ref>. If doing so fails with PermissionDenied, this is considered to a bug in the connection manager, but clients MUST recover by falling back to closing the channel with the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref> method.</p> <p>Removing any contact from the local pending list is always allowed. Removing contacts other than the <tp:member-ref>SelfHandle</tp:member-ref> from the channel's members is allowed if and only if Channel_Group_Flag_Can_Remove is in the <tp:member-ref>GroupFlags</tp:member-ref>, while removing contacts other than the <tp:member-ref>SelfHandle</tp:member-ref> from the remote pending list is allowed if and only if Channel_Group_Flag_Can_Rescind is in the <tp:member-ref>GroupFlags</tp:member-ref>.</p> <p>A message may be provided along with the request, which will be sent to the server if supported. See the Channel_Group_Flag_Message_Remove, Channel_Group_Flag_Message_Depart, Channel_Group_Flag_Message_Reject and Channel_Group_Flag_Message_Rescind <tp:member-ref>GroupFlags</tp:member-ref> to see in which cases this message should be provided.</p>

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to remove from the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_run_remove_members_with_reason ()

gboolean
tp_cli_channel_interface_group_run_remove_members_with_reason
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                guint in_Reason,
                                GError **error,
                                GMainLoop **loop);

tp_cli_channel_interface_group_run_remove_members_with_reason is deprecated and should not be used in newly-written code.

Call the method RemoveMembersWithReason and run the main loop until it returns. Before calling this method, you must add a reference to any borrowed objects you need to keep, and generally ensure that everything is in a consistent state.

As <tp:member-ref>RemoveMembers</tp:member-ref>, but a reason code may be provided where appropriate. The reason code may be ignored if the underlying protocol is unable to represent the given reason.

Parameters

proxy

A TpChannel or subclass

 

timeout_ms

Timeout in milliseconds, or -1 for default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to remove from the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

in_Reason

Used to pass an 'in' argument: A reason for the change (TpChannelGroupChangeReason)

 

error

If not NULL, used to return errors if FALSE is returned

 

loop

If not NULL, set before re-entering the main loop, to point to a GMainLoop which can be used to cancel this call with g_main_loop_quit(), causing a return of FALSE with error set to TP_DBUS_ERROR_CANCELLED

 

Returns

TRUE on success, FALSE and sets error on error


tp_cli_channel_interface_group_call_add_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_add_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                tp_cli_channel_interface_group_callback_for_add_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a AddMembers method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Invite all the given contacts into the channel, or accept requests for channel membership for contacts on the pending local list.</p> <p>A message may be provided along with the request, which will be sent to the server if supported. See the CHANNEL_GROUP_FLAG_MESSAGE_ADD and CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT <tp:member-ref>GroupFlags</tp:member-ref> to see in which cases this message should be provided.</p> <p>Attempting to add contacts who are already members is allowed; connection managers must silently accept this, without error.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to invite to the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_all_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_all_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_all_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_all_members is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including Members, RemotePendingMembers and LocalPendingMembers instead, falling back to this method and GetLocalPendingMembersWithInfo if necessary.

Start a GetAllMembers method call.

Returns arrays of all current, local and remote pending channel members.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_group_flags ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_group_flags
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_group_flags callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_group_flags is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including GroupFlags instead, falling back to this method if necessary.

Start a GetGroupFlags method call.

Returns the value of the <tp:member-ref>GroupFlags</tp:member-ref> property.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_handle_owners ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_handle_owners
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Handles,
                                tp_cli_channel_interface_group_callback_for_get_handle_owners callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_handle_owners is deprecated and should not be used in newly-written code.

Clients should use the HandleOwners property and HandleOwnersChanged signal if Channel_Group_Flag_Properties is present.

Start a GetHandleOwners method call.

If the CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES flag is set on the channel, then the handles of the group members are specific to this channel, and are not meaningful in a connection-wide context such as contact lists. This method allows you to find the owner of the handle if it can be discovered in this channel, or 0 if the owner is not available.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Handles

Used to pass an 'in' argument: A list of integer handles representing members of the channel

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_local_pending_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_local_pending_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_local_pending_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_local_pending_members is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Start a GetLocalPendingMembers method call.

Returns the To_Be_Added handle (only) for each structure in the <tp:member-ref>LocalPendingMembers</tp:member-ref> property.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_local_pending_members_with_info ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_local_pending_members_with_info
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_local_pending_members_with_info is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Start a GetLocalPendingMembersWithInfo method call.

Returns the <tp:member-ref>LocalPendingMembers</tp:member-ref> property.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_members is deprecated and should not be used in newly-written code.

Use the Members property, if Channel_Group_Flag_Properties is present.

Start a GetMembers method call.

Returns the <tp:member-ref>Members</tp:member-ref> property.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_remote_pending_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_remote_pending_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_remote_pending_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_remote_pending_members is deprecated and should not be used in newly-written code.

Use the RemotePendingMembers property, if Channel_Group_Flag_Properties is present.

Start a GetRemotePendingMembers method call.

Returns an array of handles representing contacts who have been invited to the channel and are awaiting remote approval.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_get_self_handle ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_get_self_handle
                               (TpChannel *proxy,
                                gint timeout_ms,
                                tp_cli_channel_interface_group_callback_for_get_self_handle callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

tp_cli_channel_interface_group_call_get_self_handle is deprecated and should not be used in newly-written code.

Clients should retrieve the SelfHandle property using GetAll instead, if Channel_Group_Flag_Properties is present.

Start a GetSelfHandle method call.

Returns the value of the <tp:member-ref>SelfHandle</tp:member-ref> property.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_remove_members ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_remove_members
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                tp_cli_channel_interface_group_callback_for_remove_members callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveMembers method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Requests the removal of contacts from a channel, reject their request for channel membership on the pending local list, or rescind their invitation on the pending remote list.</p> <p>If the <tp:member-ref>SelfHandle</tp:member-ref> is in a Group, it can be removed via this method, in order to leave the group gracefully. This is the recommended way to leave a chatroom, close or reject a <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">StreamedMedia</tp:dbus-ref> call, and so on.</p> <p>Accordingly, connection managers SHOULD support doing this, regardless of the value of <tp:member-ref>GroupFlags</tp:member-ref>. If doing so fails with PermissionDenied, this is considered to a bug in the connection manager, but clients MUST recover by falling back to closing the channel with the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel">Close</tp:dbus-ref> method.</p> <p>Removing any contact from the local pending list is always allowed. Removing contacts other than the <tp:member-ref>SelfHandle</tp:member-ref> from the channel's members is allowed if and only if Channel_Group_Flag_Can_Remove is in the <tp:member-ref>GroupFlags</tp:member-ref>, while removing contacts other than the <tp:member-ref>SelfHandle</tp:member-ref> from the remote pending list is allowed if and only if Channel_Group_Flag_Can_Rescind is in the <tp:member-ref>GroupFlags</tp:member-ref>.</p> <p>A message may be provided along with the request, which will be sent to the server if supported. See the Channel_Group_Flag_Message_Remove, Channel_Group_Flag_Message_Depart, Channel_Group_Flag_Message_Reject and Channel_Group_Flag_Message_Rescind <tp:member-ref>GroupFlags</tp:member-ref> to see in which cases this message should be provided.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to remove from the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_call_remove_members_with_reason ()

TpProxyPendingCall *
tp_cli_channel_interface_group_call_remove_members_with_reason
                               (TpChannel *proxy,
                                gint timeout_ms,
                                const GArray *in_Contacts,
                                const gchar *in_Message,
                                guint in_Reason,
                                tp_cli_channel_interface_group_callback_for_remove_members_with_reason callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RemoveMembersWithReason method call.

As <tp:member-ref>RemoveMembers</tp:member-ref>, but a reason code may be provided where appropriate. The reason code may be ignored if the underlying protocol is unable to represent the given reason.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contacts

Used to pass an 'in' argument: An array of contact handles to remove from the channel

 

in_Message

Used to pass an 'in' argument: A string message, which can be blank if desired

 

in_Reason

Used to pass an 'in' argument: A reason for the change (TpChannelGroupChangeReason)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_channel_interface_group_callback_for_add_members ()

void
(*tp_cli_channel_interface_group_callback_for_add_members)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a AddMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_all_members ()

void
(*tp_cli_channel_interface_group_callback_for_get_all_members)
                               (TpChannel *proxy,
                                const GArray *out_Members,
                                const GArray *out_Local_Pending,
                                const GArray *out_Remote_Pending,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_all_members is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including Members, RemotePendingMembers and LocalPendingMembers instead, falling back to this method and GetLocalPendingMembersWithInfo if necessary.

Signature of the callback called when a GetAllMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Members

Used to return an 'out' argument if error is NULL: array of handles of current members

 

out_Local_Pending

Used to return an 'out' argument if error is NULL: array of handles of local pending members

 

out_Remote_Pending

Used to return an 'out' argument if error is NULL: array of handles of remote pending members

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_group_flags ()

void
(*tp_cli_channel_interface_group_callback_for_get_group_flags)
                               (TpChannel *proxy,
                                guint out_Group_Flags,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_group_flags is deprecated and should not be used in newly-written code.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including GroupFlags instead, falling back to this method if necessary.

Signature of the callback called when a GetGroupFlags method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Group_Flags

Used to return an 'out' argument if error is NULL: The value of the GroupFlags property (TpChannelGroupFlags)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_handle_owners ()

void
(*tp_cli_channel_interface_group_callback_for_get_handle_owners)
                               (TpChannel *proxy,
                                const GArray *out_Owners,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_handle_owners is deprecated and should not be used in newly-written code.

Clients should use the HandleOwners property and HandleOwnersChanged signal if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetHandleOwners method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Owners

Used to return an 'out' argument if error is NULL: An array of integer handles representing the owner handles of the given room members, in the same order, or 0 if the owner is not available

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_local_pending_members ()

void
(*tp_cli_channel_interface_group_callback_for_get_local_pending_members)
                               (TpChannel *proxy,
                                const GArray *out_Handles,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_local_pending_members is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetLocalPendingMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Handles

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info ()

void
(*tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info)
                               (TpChannel *proxy,
                                const GPtrArray *out_Info,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info is deprecated and should not be used in newly-written code.

Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetLocalPendingMembersWithInfo method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Info

Used to return an 'out' argument if error is NULL: An array of structs containing: <ul> <li> A handle representing the contact requesting channel membership </li> <li> A handle representing the contact making the request, or 0 if unknown </li> <li> The reason for the request: one of the values of <tp:type>Channel_Group_Change_Reason</tp:type> </li> <li> A string message containing the reason for the request if any (or blank if none) </li> </ul>

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_members ()

void
(*tp_cli_channel_interface_group_callback_for_get_members)
                               (TpChannel *proxy,
                                const GArray *out_Handles,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_members is deprecated and should not be used in newly-written code.

Use the Members property, if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Handles

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_remote_pending_members ()

void
(*tp_cli_channel_interface_group_callback_for_get_remote_pending_members)
                               (TpChannel *proxy,
                                const GArray *out_Handles,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_remote_pending_members is deprecated and should not be used in newly-written code.

Use the RemotePendingMembers property, if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetRemotePendingMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Handles

Used to return an 'out' argument if error is NULL: (Undocumented)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_get_self_handle ()

void
(*tp_cli_channel_interface_group_callback_for_get_self_handle)
                               (TpChannel *proxy,
                                guint out_Self_Handle,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

tp_cli_channel_interface_group_callback_for_get_self_handle is deprecated and should not be used in newly-written code.

Clients should retrieve the SelfHandle property using GetAll instead, if Channel_Group_Flag_Properties is present.

Signature of the callback called when a GetSelfHandle method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Self_Handle

Used to return an 'out' argument if error is NULL: (Undocumented) (TpContactHandle)

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_remove_members ()

void
(*tp_cli_channel_interface_group_callback_for_remove_members)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveMembers method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_callback_for_remove_members_with_reason ()

void
(*tp_cli_channel_interface_group_callback_for_remove_members_with_reason)
                               (TpChannel *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RemoveMembersWithReason method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_channel_interface_group_connect_to_group_flags_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_group_flags_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_group_flags_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal GroupFlagsChanged.

Emitted when the flags as returned by <tp:member-ref>GetGroupFlags</tp:member-ref> are changed. The user interface should be updated as appropriate.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_connect_to_members_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_members_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_members_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MembersChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when contacts join any of the three lists (members, local pending or remote pending) or when they leave any of the three lists. There may also be a message from the server regarding this change, which may be displayed to the user if desired.</p> <p>All channel-specific handles that are mentioned in this signal MUST be represented in the value of the <tp:member-ref>HandleOwners</tp:member-ref> property. In practice, this will mean that <tp:member-ref>HandleOwnersChanged</tp:member-ref> is emitted <em>before</em> emitting a MembersChanged signal in which channel-specific handles are added, but that it is emitted <em>after</em> emitting a MembersChanged signal in which channel-specific handles are removed.</p> <p>See <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">StreamedMedia</tp:dbus-ref> for an overview of how group state changes are used to indicate the progress of a call.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_connect_to_members_changed_detailed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_members_changed_detailed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_members_changed_detailed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MembersChangedDetailed.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when contacts join any of the three lists (members, local pending or remote pending) or when they leave any of the three lists. This signal provides a superset of the information provided by <tp:member-ref>MembersChanged</tp:member-ref>; if the channel's <tp:member-ref>GroupFlags</tp:member-ref> contains Members_Changed_Detailed, then clients may listen exclusively to this signal in preference to that signal.</p> <p>All channel-specific handles that are mentioned in this signal MUST be represented in the value of the <tp:member-ref>HandleOwners</tp:member-ref> property. In practice, this will mean that <tp:member-ref>HandleOwnersChanged</tp:member-ref> is emitted <em>before</em> emitting a MembersChangedDetailed signal in which channel-specific handles are added, but that it is emitted <em>after</em> emitting a MembersChangedDetailed signal in which channel-specific handles are removed.</p> <p>See <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Type">StreamedMedia</tp:dbus-ref> for an overview of how group state changes are used to indicate the progress of a call.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_signal_callback_group_flags_changed ()

void
(*tp_cli_channel_interface_group_signal_callback_group_flags_changed)
                               (TpChannel *proxy,
                                guint arg_Added,
                                guint arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal GroupFlagsChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_group_flags_changed() was called

 

arg_Added

A bitwise OR of the flags which have been set (TpChannelGroupFlags)

 

arg_Removed

A bitwise OR of the flags which have been cleared (TpChannelGroupFlags)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_signal_callback_members_changed ()

void
(*tp_cli_channel_interface_group_signal_callback_members_changed)
                               (TpChannel *proxy,
                                const gchar *arg_Message,
                                const GArray *arg_Added,
                                const GArray *arg_Removed,
                                const GArray *arg_Local_Pending,
                                const GArray *arg_Remote_Pending,
                                guint arg_Actor,
                                guint arg_Reason,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MembersChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_members_changed() was called

 

arg_Message

A string message from the server, or blank if not

 

arg_Added

A list of members added to the channel

 

arg_Removed

A list of members removed from the channel

 

arg_Local_Pending

A list of members who are pending local approval

 

arg_Remote_Pending

A list of members who are pending remote approval

 

arg_Actor

The contact handle of the person who made the change, or 0 if not known (TpContactHandle)

 

arg_Reason

A reason for the change (TpChannelGroupChangeReason)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_signal_callback_members_changed_detailed ()

void
(*tp_cli_channel_interface_group_signal_callback_members_changed_detailed)
                               (TpChannel *proxy,
                                const GArray *arg_Added,
                                const GArray *arg_Removed,
                                const GArray *arg_Local_Pending,
                                const GArray *arg_Remote_Pending,
                                GHashTable *arg_Details,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MembersChangedDetailed.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_members_changed_detailed() was called

 

arg_Added

A list of members added to the channel

 

arg_Removed

A list of members removed from the channel

 

arg_Local_Pending

A list of members who are pending local approval

 

arg_Remote_Pending

A list of members who are pending remote approval

 

arg_Details

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Information about the change, which may include the following well-known keys:</p> <dl> <dt>actor (u — <tp:type>Contact_Handle</tp:type>)</dt> <dd>The contact handle of the person who made the change; 0 or omitted if unknown or not applicable.</dd> <dt>change-reason (u — <tp:type>Channel_Group_Change_Reason</tp:type>)</dt> <dd>A reason for the change.</dd> <dt>contact-ids (a{us} — <tp:type>Handle_Identifier_Map</tp:type>)</dt> <dd> <p>The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to react to the event without waiting for round-trips. Connection managers SHOULD include the identifiers for members added to the group and for the actor (if any); they MAY omit the identifiers for handles which have been removed from the group.</p> <tp:rationale> <p>On IRC, an event such as a netsplit could cause the vast majority of a channel to leave. Given that clients should already know the identifiers of a channel's members, including potentially hundreds of strings in the netsplit signal is unnecessary.</p> </tp:rationale> <p>Clients MUST NOT assume that the presence or absence of a handle in this mapping is meaningful. This mapping is merely an optimization for round-trip reduction, and connection managers MAY add additional handles, omit some handles, or omit the mapping completely.</p> </dd> <dt>message (s)</dt> <dd>A string message from the server regarding the change</dd> <dt>error (s — <tp:type>DBus_Error_Name</tp:type>)</dt> <dd>A (possibly implementation-specific) DBus error describing the change, providing more specific information than the <tp:type>Channel_Group_Change_Reason</tp:type> enum allows. This MUST only be present if it is strictly more informative than 'change-reason'; if present, 'change-reason' MUST be set to the closest available reason. <tp:rationale> A SIP connection manager might want to signal &quot;402 Payment required&quot; as something more specific than Error or Permission_Denied so that a SIP-aware UI could handle it specially; including a namespaced error permits this to be done without <tp:type>Channel_Group_Change_Reason</tp:type> being extended to encompass every error any CM ever wants to report. </tp:rationale> </dd> <dt>debug-message (s)</dt> <dd>Debugging information on the change. SHOULD NOT be shown to users in normal circumstances.</dd> </dl>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_connect_to_handle_owners_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_handle_owners_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_handle_owners_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal HandleOwnersChanged.

Emitted whenever the <tp:member-ref>HandleOwners</tp:member-ref> property changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_connect_to_self_handle_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_self_handle_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_self_handle_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SelfHandleChanged.

Emitted whenever the <tp:member-ref>SelfHandle</tp:member-ref> property changes.

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_signal_callback_handle_owners_changed ()

void
(*tp_cli_channel_interface_group_signal_callback_handle_owners_changed)
                               (TpChannel *proxy,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal HandleOwnersChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_handle_owners_changed() was called

 

arg_Added

A map from channel-specific handles to their owners, in which the keys include all the handles that were added to the keys of the HandleOwners property, and all the handles in that property whose owner has changed

 

arg_Removed

The channel-specific handles that were removed from the keys of the HandleOwners property, as a result of the contact leaving this group in a previous <tp:member-ref>MembersChanged</tp:member-ref> signal

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_signal_callback_self_handle_changed ()

void
(*tp_cli_channel_interface_group_signal_callback_self_handle_changed)
                               (TpChannel *proxy,
                                guint arg_Self_Handle,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SelfHandleChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_self_handle_changed() was called

 

arg_Self_Handle

The new value of the SelfHandle property. (TpContactHandle)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_handle_owners_changed_detailed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal HandleOwnersChangedDetailed.

<p>Emitted whenever the <tp:member-ref>HandleOwners</tp:member-ref> property changes.</p> <p>Clients can assume this signal is emitted by the Connection Manager if the <tp:member-ref>MemberIdentifiers</tp:member-ref> property exists </p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_connect_to_self_contact_changed ()

TpProxySignalConnection *
tp_cli_channel_interface_group_connect_to_self_contact_changed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_group_signal_callback_self_contact_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal SelfContactChanged.

<p>Emitted whenever the <tp:member-ref>SelfHandle</tp:member-ref> property changes.</p> <p>Clients can assume this signal is emitted by the Connection Manager if the <tp:member-ref>MemberIdentifiers</tp:member-ref> property exists. </p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_group_signal_callback_handle_owners_changed_detailed ()

void
(*tp_cli_channel_interface_group_signal_callback_handle_owners_changed_detailed)
                               (TpChannel *proxy,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed,
                                GHashTable *arg_Identifiers,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal HandleOwnersChangedDetailed.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed() was called

 

arg_Added

A map from channel-specific handles to their owners, in which the keys include all the handles that were added to the keys of the HandleOwners property, and all the handles in that property whose owner has changed

 

arg_Removed

The channel-specific handles that were removed from the keys of the HandleOwners property, as a result of the contact leaving this group in a previous <tp:member-ref>MembersChanged</tp:member-ref> signal

 

arg_Identifiers

The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to create contacts without waiting for round-trips. Connection managers MUST include at least the identifiers for all handles in the Added map, and MAY include those from Removed array.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_group_signal_callback_self_contact_changed ()

void
(*tp_cli_channel_interface_group_signal_callback_self_contact_changed)
                               (TpChannel *proxy,
                                guint arg_Self_Handle,
                                const gchar *arg_Self_ID,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal SelfContactChanged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_group_connect_to_self_contact_changed() was called

 

arg_Self_Handle

The new value of the SelfHandle property. (TpContactHandle)

 

arg_Self_ID

The new value of the SelfHandle property's identifier.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_svc_channel_interface_group_emit_handle_owners_changed_detailed ()

void
tp_svc_channel_interface_group_emit_handle_owners_changed_detailed
                               (gpointer instance,
                                GHashTable *arg_Added,
                                const GArray *arg_Removed,
                                GHashTable *arg_Identifiers);

Type-safe wrapper around g_signal_emit to emit the HandleOwnersChangedDetailed signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Added

GHashTable * (FIXME, generate documentation)

 

arg_Removed

const GArray * (FIXME, generate documentation)

 

arg_Identifiers

GHashTable * (FIXME, generate documentation)

 

tp_svc_channel_interface_group_emit_self_contact_changed ()

void
tp_svc_channel_interface_group_emit_self_contact_changed
                               (gpointer instance,
                                guint arg_Self_Handle,
                                const gchar *arg_Self_ID);

Type-safe wrapper around g_signal_emit to emit the SelfContactChanged signal on interface org.freedesktop.Telepathy.Channel.Interface.Group.

Parameters

instance

The object implementing this interface

 

arg_Self_Handle

guint (FIXME, generate documentation)

 

arg_Self_ID

const gchar * (FIXME, generate documentation)

 

tp_cli_channel_interface_conference_connect_to_channel_merged ()

TpProxySignalConnection *
tp_cli_channel_interface_conference_connect_to_channel_merged
                               (TpChannel *proxy,
                                tp_cli_channel_interface_conference_signal_callback_channel_merged callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ChannelMerged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a new channel is added to the value of <tp:member-ref>Channels</tp:member-ref>.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_conference_connect_to_channel_removed ()

TpProxySignalConnection *
tp_cli_channel_interface_conference_connect_to_channel_removed
                               (TpChannel *proxy,
                                tp_cli_channel_interface_conference_signal_callback_channel_removed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal ChannelRemoved.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when a channel is removed from the value of <tp:member-ref>Channels</tp:member-ref>, either because it closed or because it was split using the <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface">Splittable.DRAFT.Split</tp:dbus-ref> method.</p> <p>If a channel is removed because it was closed, <tp:dbus-ref namespace="ofdT.Channel">Closed</tp:dbus-ref> should be emitted before this signal.</p>

Parameters

proxy

A TpChannel or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_channel_interface_conference_signal_callback_channel_merged ()

void
(*tp_cli_channel_interface_conference_signal_callback_channel_merged)
                               (TpChannel *proxy,
                                const gchar *arg_Channel,
                                guint arg_Channel_Specific_Handle,
                                GHashTable *arg_Properties,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ChannelMerged.

Parameters

proxy

The proxy on which tp_cli_channel_interface_conference_connect_to_channel_merged() was called

 

arg_Channel

The channel that was added to <tp:member-ref>Channels</tp:member-ref>.

 

arg_Channel_Specific_Handle

A new channel-specific handle for the <tp:dbus-ref namespace="ofdT.Channel">TargetHandle</tp:dbus-ref> of <var>Channel</var>, as will appear in <tp:member-ref>OriginalChannels</tp:member-ref>, or <tt>0</tt> if a global handle is used for <var>Channel</var>'s TargetHandle on the <tp:dbus-ref namespace="ofdT.Channel.Interface">Group</tp:dbus-ref> interface of this channel. (TpContactHandle)

 

arg_Properties

<var>Channel</var>'s immutable properties.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_channel_interface_conference_signal_callback_channel_removed ()

void
(*tp_cli_channel_interface_conference_signal_callback_channel_removed)
                               (TpChannel *proxy,
                                const gchar *arg_Channel,
                                GHashTable *arg_Details,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal ChannelRemoved.

Parameters

proxy

The proxy on which tp_cli_channel_interface_conference_connect_to_channel_removed() was called

 

arg_Channel

The channel that was removed from <tp:member-ref>Channels</tp:member-ref>.

 

arg_Details

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> Additional information about the removal, which may include the same well-known keys as the Details argument of <tp:dbus-ref namespace="ofdT.Channel.Interface.Group">MembersChangedDetailed</tp:dbus-ref>, with the same semantics.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpChannel

telepathy-glib-0.24.2/docs/reference/html/ch-obsolete.html0000644000175000017500000000435314006623343020364 00000000000000 Obsolete modules: telepathy-glib API Reference Manual

Obsolete modules

TpChannelFactoryIface — interface for channel allocation/tracking
ANSI codes for debug messages — used to colorize log messages for "clarity"
TpTextMixin — a mixin implementation of the text channel type
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-renaming.html0000644000175000017500000005150414006623344025026 00000000000000 Connection Renaming interface: telepathy-glib API Reference Manual

Connection Renaming interface

Connection Renaming interface — client-side wrappers for the Renaming interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

In IRC, and perhaps other protocols, users' unique identifiers can change. The Renaming interface models this.

Functions

tp_cli_connection_interface_renaming_call_request_rename ()

TpProxyPendingCall *
tp_cli_connection_interface_renaming_call_request_rename
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_Identifier,
                                tp_cli_connection_interface_renaming_callback_for_request_rename callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestRename method call.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Request that the user's own identifier is changed on the server. If successful, a <tp:member-ref>Renamed</tp:member-ref> signal will be emitted for the current &quot;self handle&quot; as returned by <tp:dbus-ref namespace="org.freedesktop.Telepathy.Connection">GetSelfHandle</tp:dbus-ref>.</p> <p>It is protocol-dependent how the identifier that's actually used will be derived from the supplied identifier; some sort of normalization might take place.</p>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Identifier

Used to pass an 'in' argument: The desired identifier

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_renaming_callback_for_request_rename ()

void
(*tp_cli_connection_interface_renaming_callback_for_request_rename)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestRename method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_renaming_connect_to_renamed ()

TpProxySignalConnection *
tp_cli_connection_interface_renaming_connect_to_renamed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_renaming_signal_callback_renamed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal Renamed.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when the unique identifier of a contact on the server changes.</p> <p>Any channels associated with the contact's original handle will continue to be to that handle, and so are no longer useful (unless the contact renames back, or another contact connects with that unique ID). Clients may open a similar channel associated with the new handle to continue communicating with the contact.</p> <p>For example, if a GUI client associates text channels with chat windows, it should detach the old channel from the chat window, closing it, and associate a channel to the new handle with the same window.</p> <p>If the contact's old handle is in any of the member lists of a channel which has the groups interface, it will be removed from the channel and the new handle will be added. The resulting <tp:dbus-ref namespace="org.freedesktop.Telepathy.Channel.Interface.Group">MembersChanged</tp:dbus-ref> signal must be emitted <em>after</em> the <tp:member-ref>Renamed</tp:member-ref> signal; the reason should be RENAMED. </p> <p>The handles may be either general-purpose or channel-specific. If the original handle is general-purpose, the new handle must be general-purpose; if the original handle is channel-specific, the new handle must be channel-specific in the same channel. </p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_renaming_signal_callback_renamed ()

void
(*tp_cli_connection_interface_renaming_signal_callback_renamed)
                               (TpConnection *proxy,
                                guint arg_Original,
                                guint arg_New,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal Renamed.

Parameters

proxy

The proxy on which tp_cli_connection_interface_renaming_connect_to_renamed() was called

 

arg_Original

The handle of the original identifier (TpContactHandle)

 

arg_New

The handle of the new identifier (TpContactHandle)

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

See Also

TpConnection

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-connection-mail.html0000644000175000017500000011761614006623344024157 00000000000000 Connection MailNotification interface: telepathy-glib API Reference Manual

Connection MailNotification interface

Connection MailNotification interface — client-side wrappers for the MailNotification interface

Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some service providers offer both real-time communications and e-mail, and integrate them by providing "new mail" notifications over the real-time communication protocol.

This section documents the auto-generated C wrappers for the MailNotification interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_mail_notification_call_request_inbox_url ()

TpProxyPendingCall *
tp_cli_connection_interface_mail_notification_call_request_inbox_url
                               (TpConnection *proxy,
                                gint timeout_ms,
                                tp_cli_connection_interface_mail_notification_callback_for_request_inbox_url callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestInboxURL method call.

This method creates and returns a URL and an optional POST data that allow opening the Inbox folder of a webmail account. This URL MAY contain tokens with a short lifetime, so clients SHOULD request a new URL for each visit to the webmail interface. This method is implemented only if the <tt>Supports_Request_Inbox_URL</tt> flag is set in <tp:member-ref>MailNotificationFlags</tp:member-ref>. <tp:rationale> We are not using properties here because the tokens are unsuitable for sharing between clients, and network round-trips may be required to obtain the information that leads to authentication free webmail access. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_mail_notification_call_request_mail_url ()

TpProxyPendingCall *
tp_cli_connection_interface_mail_notification_call_request_mail_url
                               (TpConnection *proxy,
                                gint timeout_ms,
                                const gchar *in_ID,
                                const GValue *in_URL_Data,
                                tp_cli_connection_interface_mail_notification_callback_for_request_mail_url callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestMailURL method call.

This method creates and returns a URL and optional POST data that allow opening a specific mail in a webmail interface. This method is implemented only if <tt>Supports_Request_Mail_URL</tt> flag is set in <tp:member-ref>MailNotificationFlags</tp:member-ref>. <tp:rationale> See <tp:member-ref>RequestInboxURL</tp:member-ref> for design rationale. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_ID

Used to pass an 'in' argument: The mail's <tt>id</tt> as found in the <tp:type>Mail</tp:type> structure, or the empty string if no <tt>id</tt> key was provided.

 

in_URL_Data

Used to pass an 'in' argument: Whatever <tt>url-data</tt> was found in the <tp:type>Mail</tp:type> structure, or the boolean value False (D-Bus type 'b') if no <tt>url-data</tt> was provided in the Mail.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_mail_notification_callback_for_request_inbox_url ()

void
(*tp_cli_connection_interface_mail_notification_callback_for_request_inbox_url)
                               (TpConnection *proxy,
                                const GValueArray *out_URL,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestInboxURL method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_URL

Used to return an 'out' argument if error is NULL: A struture containing a URL and optional additional data to open a webmail client, without re-authentication if possible.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_mail_notification_callback_for_request_mail_url ()

void
(*tp_cli_connection_interface_mail_notification_callback_for_request_mail_url)
                               (TpConnection *proxy,
                                const GValueArray *out_URL,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestMailURL method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_URL

Used to return an 'out' argument if error is NULL: A struture that contains a URL and optional additional data to open a webmail client, without re-authentication if possible.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_mail_notification_connect_to_mails_received ()

TpProxySignalConnection *
tp_cli_connection_interface_mail_notification_connect_to_mails_received
                               (TpConnection *proxy,
                                tp_cli_connection_interface_mail_notification_signal_callback_mails_received callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal MailsReceived.

Emitted when new e-mails messages arrive to the inbox associated with this connection. This signal is used for protocols that are not able to maintain the <tp:member-ref>UnreadMails</tp:member-ref> list, but do provide real-time notification about newly arrived e-mails. It MUST NOT be emitted unless <tt>Emits_Mails_Received</tt> is set in <tp:member-ref>MailNotificationFlags</tp:member-ref>.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_mail_notification_connect_to_unread_mails_changed ()

TpProxySignalConnection *
tp_cli_connection_interface_mail_notification_connect_to_unread_mails_changed
                               (TpConnection *proxy,
                                tp_cli_connection_interface_mail_notification_signal_callback_unread_mails_changed callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal UnreadMailsChanged.

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>Emitted when <tp:member-ref>UnreadMails</tp:member-ref> or <tp:member-ref>UnreadMailCount</tp:member-ref> have changed. It MUST NOT be emited if <tt>Supports_Unread_Mail_Count</tt> flag is not set in <tp:member-ref>MailNotificationFlags</tp:member-ref>.</p> <p><tt>Mails_Added</tt> and <tt>Mails_Removed</tt> MUST be empty if the <tt>Supports_Unread_Mails</tt> flag is not set.</p>

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_mail_notification_signal_callback_mails_received ()

void
(*tp_cli_connection_interface_mail_notification_signal_callback_mails_received)
                               (TpConnection *proxy,
                                const GPtrArray *arg_Mails,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal MailsReceived.

Parameters

proxy

The proxy on which tp_cli_connection_interface_mail_notification_connect_to_mails_received() was called

 

arg_Mails

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>An array of <tp:type>Mail</tp:type>s. Those e-mail MUST NOT have the &quot;id&quot; key.</p> <tp:rationale> <p>On connections that emit this signal, it's impossible to tell when a mail has been removed, and hence when &quot;id&quot; has become invalid.</p> </tp:rationale>

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_mail_notification_signal_callback_unread_mails_changed ()

void
(*tp_cli_connection_interface_mail_notification_signal_callback_unread_mails_changed)
                               (TpConnection *proxy,
                                guint arg_Count,
                                const GPtrArray *arg_Mails_Added,
                                const gchar **arg_Mails_Removed,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal UnreadMailsChanged.

Parameters

proxy

The proxy on which tp_cli_connection_interface_mail_notification_connect_to_unread_mails_changed() was called

 

arg_Count

Number of unread messages in the inbox (the new value of <tp:member-ref>UnreadMailCount</tp:member-ref>).

 

arg_Mails_Added

<tp:docstring xmlns="http://www.w3.org/1999/xhtml"> <p>A list of <tp:type>Mail</tp:type> that are being added or updated in <tp:member-ref>UnreadMails</tp:member-ref>.</p> <tp:rationale> <p>Mails may be updated when the URL information (URL and POST data) have changed, or senders were added or removed from an e-mail thread.</p> </tp:rationale> <p>If the <tt>Supports_Unread_Mails</tt> flag is not set, this list MUST be empty, even if Count has increased.</p>

 

arg_Mails_Removed

A list of e-mail IDs that are being removed from <tp:member-ref>UnreadMails</tp:member-ref>. If the <tt>Supports_Unread_Mails</tt> flag is not set, this list MUST be empty, even if Count has decreased.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 
telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-automatic-proxy-factory.html0000644000175000017500000003447114006623343025706 00000000000000 TpAutomaticProxyFactory: telepathy-glib API Reference Manual

TpAutomaticProxyFactory

TpAutomaticProxyFactory — factory creating higher level proxy objects

Types and Values

Object Hierarchy

    GObject
    ╰── TpAutomaticProxyFactory

Implemented Interfaces

TpAutomaticProxyFactory implements TpClientChannelFactory.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This factory implements the TpClientChannelFactoryInterface interface to create specialized TpChannel subclasses.

TpAutomaticProxyFactory will currently create TpChannel objects as follows:

It is guaranteed that the objects returned by future versions will be either the class that is currently used, or a more specific subclass of that class.

This factory asks to prepare the following properties:

TpProxy subclasses other than TpChannel are not currently supported.

Functions

tp_automatic_proxy_factory_new ()

TpAutomaticProxyFactory *
tp_automatic_proxy_factory_new (void);

tp_automatic_proxy_factory_new is deprecated and should not be used in newly-written code.

New code should use TpAutomaticClientFactory instead

Convenient function to create a new TpAutomaticProxyFactory instance.

Returns

a new TpAutomaticProxyFactory

Since: 0.13.2


tp_automatic_proxy_factory_dup ()

TpAutomaticProxyFactory *
tp_automatic_proxy_factory_dup (void);

tp_automatic_proxy_factory_dup is deprecated and should not be used in newly-written code.

New code should use TpAutomaticClientFactory instead

Returns a cached TpAutomaticProxyFactory; the same TpAutomaticProxyFactory object will be returned by this function repeatedly, as long as at least one reference exists.

Returns

a TpAutomaticProxyFactory.

[transfer full]

Since: 0.13.2

Types and Values

struct TpAutomaticProxyFactory

struct TpAutomaticProxyFactory;

Data structure representing a TpAutomaticProxyFactory

Since: 0.13.2


struct TpAutomaticProxyFactoryClass

struct TpAutomaticProxyFactoryClass {
    GObjectClass parent_class;
};

The class of a TpAutomaticProxyFactory.

Members

GObjectClass parent_class;

the parent class

 

Since: 0.13.2

telepathy-glib-0.24.2/docs/reference/html/telepathy-glib-file-transfer-channel.html0000644000175000017500000021076714006623344025250 00000000000000 TpFileTransferChannel: telepathy-glib API Reference Manual

TpFileTransferChannel

TpFileTransferChannel — proxy object for a file transfer channel

Properties

GDateTime * date Read
gchar * description Read
GFile * file Read
gchar * filename Read
guint64 initial-offset Read
GHashTable_gchararray+GStrv_* metadata Read
gchar * mime-type Read
gchar * service-name Read
guint64 size Read
guint state Read
guint64 transferred-bytes Read

Object Hierarchy

    GObject
    ╰── TpProxy
        ╰── TpChannel
            ╰── TpFileTransferChannel

Implemented Interfaces

TpFileTransferChannel implements TpChannelIface.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpFileTransferChannel is a sub-class of TpChannel providing convenient API to send and receive files.

The channel properties are available in “date”, “description”, “filename”, “initial-offset”, “mime-type”, “size”, “state”, and “transferred-bytes” GObject properties, with accessor functions too.

To send a file to a contact, one should create a File Transfer channel with the appropriate D-Bus properties set by specifying their values in the channel creation method call. The file transfer invitation will be sent to the remote contact when the channel is created. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
GHashTable *request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
    TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "foo@bar.com",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, "text/plain",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, G_TYPE_INT64, 1320925992,
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, G_TYPE_STRING, "",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, "test.pdf",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, G_TYPE_UINT64, 0,
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, 165710,
    NULL);

TpAccountChannelRequest *channel_request = tp_account_channel_request_new (
    account, request,
    TP_USER_ACTION_TIME_CURRENT_TIME);

tp_account_channel_request_create_and_handle_channel_async (channel_request, NULL,
    create_and_handle_cb, NULL);

g_hash_table_unref (request);

Once a TpFileTransferChannel is created as a proxy to the channel on D-Bus. The "notify::state" GObject signals on the resulting channel should be monitored; when the channel moves to state TP_FILE_TRANSFER_STATE_ACCEPTED, tp_file_transfer_channel_provide_file_async() should be called.

When an incoming File Transfer channel appears, one should call tp_file_transfer_channel_accept_file_async().

To cancel or reject a pending or ongoing file transfer, one should close the channel using tp_channel_close_async().

Functions

tp_file_transfer_channel_new ()

TpFileTransferChannel *
tp_file_transfer_channel_new (TpConnection *conn,
                              const gchar *object_path,
                              const GHashTable *immutable_properties,
                              GError **error);

tp_file_transfer_channel_new is deprecated and should not be used in newly-written code.

Use tp_simple_client_factory_ensure_channel() instead.

Convenient function to create a new TpFileTransferChannel

Parameters

conn

a TpConnection; may not be NULL

 

object_path

the object path of the channel; may not be NULL

 

immutable_properties

the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to GValue instances.

[transfer none][element-type utf8 GObject.Value]

error

used to indicate the error if NULL is returned

 

Returns

a newly created TpFileTransferChannel.

[transfer full]

Since: 0.15.5


tp_file_transfer_channel_get_mime_type ()

const char *
tp_file_transfer_channel_get_mime_type
                               (TpFileTransferChannel *self);

Return the “mime-type” property

Parameters

Returns

the value of the “mime-type” property.

[transfer none]

Since: 0.15.5


tp_file_transfer_channel_get_date ()

GDateTime *
tp_file_transfer_channel_get_date (TpFileTransferChannel *self);

Return the “date” property

Parameters

Returns

the value of the “date” property.

[transfer none]

Since: 0.15.5


tp_file_transfer_channel_get_description ()

const gchar *
tp_file_transfer_channel_get_description
                               (TpFileTransferChannel *self);

Return the “description” property

Parameters

Returns

the value of the “description” property.

[transfer none]

Since: 0.15.5


tp_file_transfer_channel_get_filename ()

const gchar *
tp_file_transfer_channel_get_filename (TpFileTransferChannel *self);

Return the “filename” property

Parameters

Returns

the value of the “filename” property.

[transfer none]

Since: 0.15.5


tp_file_transfer_channel_get_size ()

guint64
tp_file_transfer_channel_get_size (TpFileTransferChannel *self);

Return the “size” property

Parameters

Returns

the value of the “size” property

Since: 0.15.5


tp_file_transfer_channel_get_transferred_bytes ()

guint64
tp_file_transfer_channel_get_transferred_bytes
                               (TpFileTransferChannel *self);

Return the “transferred-bytes” property

Parameters

Returns

the value of the “transferred-bytes” property

Since: 0.15.5


tp_file_transfer_channel_get_state ()

TpFileTransferState
tp_file_transfer_channel_get_state (TpFileTransferChannel *self,
                                    TpFileTransferStateChangeReason *reason);

Returns the “state” property.

If reason is not NULL it is set to the reason why “state” changed to its current value.

Parameters

self

a TpFileTransferChannel

 

reason

a TpFileTransferStateChangeReason, or NULL.

[out]

Returns

the value of the “state” property

Since: 0.17.1


tp_file_transfer_channel_get_service_name ()

const gchar *
tp_file_transfer_channel_get_service_name
                               (TpFileTransferChannel *self);

Return the “service-name” property

Parameters

Returns

the value of the “service-name” property

Since: 0.17.1


tp_file_transfer_channel_get_metadata ()

const GHashTable *
tp_file_transfer_channel_get_metadata (TpFileTransferChannel *self);

Return the “metadata” property

Parameters

Returns

the value of the “metadata” property.

[transfer none][element-type utf8 GStrv]

Since: 0.17.1


tp_file_transfer_channel_accept_file_async ()

void
tp_file_transfer_channel_accept_file_async
                               (TpFileTransferChannel *self,
                                GFile *file,
                                guint64 offset,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Accept an incoming file transfer in the TP_FILE_TRANSFER_STATE_PENDING state. Once the accept has been processed, callback will be called. You can then call tp_file_transfer_channel_accept_file_finish() to get the result of the operation.

Parameters

self

a TpFileTransferChannel

 

file

a GFile where the file should be saved

 

offset

Offset from the start of file where transfer begins

 

callback

a callback to call when the transfer has been accepted

 

user_data

data to pass to callback

 

Since: 0.17.1


tp_file_transfer_channel_accept_file_finish ()

gboolean
tp_file_transfer_channel_accept_file_finish
                               (TpFileTransferChannel *self,
                                GAsyncResult *result,
                                GError **error);

Finishes a call to tp_file_transfer_channel_accept_file_async().

Parameters

self

a TpFileTransferChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the accept operation was a success, or FALSE

Since: 0.17.1


tp_file_transfer_channel_provide_file_async ()

void
tp_file_transfer_channel_provide_file_async
                               (TpFileTransferChannel *self,
                                GFile *file,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Provide a file transfer. This should be called when the file transfer state changes (tp_file_transfer_channel_get_state() and the "notify::state" signal) to TP_FILE_TRANSFER_STATE_ACCEPTED or TP_FILE_TRANSFER_STATE_PENDING. Once the file has been provided, the channel “state” will change to TP_FILE_TRANSFER_STATE_OPEN.

Once the file has been provided, callback will be called. You should then call tp_file_transfer_channel_provide_file_finish() to get the result of the operation.

Parameters

self

a TpFileTransferChannel

 

file

a GFile to send to the remote contact

 

callback

a callback to call when the transfer has been accepted

 

user_data

data to pass to callback

 

Since: 0.17.1


tp_file_transfer_channel_provide_file_finish ()

gboolean
tp_file_transfer_channel_provide_file_finish
                               (TpFileTransferChannel *self,
                                GAsyncResult *result,
                                GError **error);

Finishes a call to tp_file_transfer_channel_provide_file_async().

Successful return from this function does not mean that the file transfer has completed or has even started at all. The state of the file transfer should be monitored with the "notify::state" signal.

Parameters

self

a TpFileTransferChannel

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the file has been successfully provided, or FALSE.

Since: 0.17.1

Types and Values

struct TpFileTransferChannel

struct TpFileTransferChannel;

Data structure representing a TpFileTransferChannel.

Since: 0.15.5


struct TpFileTransferChannelClass

struct TpFileTransferChannelClass {
};

The class of a TpFileTransferChannel.

Since: 0.15.5


TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE

#define             TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE

Expands to a call to a function that returns a quark for the "core" feature on a TpFileTransferChannel.

When this feature is prepared, the “transferred-bytes” property has been retrieved and will be updated.

One can ask for a feature to be prepared using the tp_proxy_prepare_async() function, and waiting for it to trigger the callback.

Since: 0.15.5

Property Details

The “date” property

  “date”                     GDateTime *

A GDateTime representing the last modification time of the file to be transferred.

Since 0.15.5

Owner: TpFileTransferChannel

Flags: Read


The “description” property

  “description”              gchar *

The description of the file transfer, defined by the sender when sending the file transfer offer.

Since 0.15.5

Owner: TpFileTransferChannel

Flags: Read

Default value: NULL


The “file” property

  “file”                     GFile *

For incoming file transfers, this property will be set to a GFile for the location where the file will be saved (given by tp_file_transfer_channel_accept_file_async()) when the transfer starts. The feature TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE must already be prepared for this property to have a meaningful value, and to receive change notification. Once the initial value is set, this property will not be changed.

For outgoing file transfers, this property is a GFile for the location of the file being sent (given by tp_file_transfer_channel_provide_file_async()). The feature TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE does not have to be prepared and there is no change notification.

Owner: TpFileTransferChannel

Flags: Read

Since: 0.17.1


The “filename” property

  “filename”                 gchar *

The name of the file on the sender's side. This is therefore given as a suggested filename for the receiver.

Since 0.15.5

Owner: TpFileTransferChannel

Flags: Read

Default value: NULL


The “initial-offset” property

  “initial-offset”           guint64

The offset in bytes from where the file should be sent.

The TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

Owner: TpFileTransferChannel

Flags: Read

Default value: 0

Since: 0.17.1


The “metadata” property

  “metadata”                 GHashTable_gchararray+GStrv_*

Additional information about the file transfer set by the channel initiator, or an empty GHashTable if the initiator did not provide any additional information.

To provide metadata along with a file offer, include TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA in the channel request. For example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
GHashTable *request;
GHashTable *metadata = g_hash_table_new (g_str_hash, g_str_equal);
const gchar * const values[] = { "Jason Derulo", "Tinie Tempah", NULL };

g_hash_table_insert (metadata, "best buds", values);

request = tp_asv_new (
    TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
    TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
    TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "foo@bar.com",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, "text/plain",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, G_TYPE_INT64, 1320925992,
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, G_TYPE_STRING, "",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, "test.pdf",
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, G_TYPE_UINT64, 0,
    TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, 165710,
    TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA, TP_TYPE_METADATA, metadata,
    NULL);

...

The TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful.

Owner: TpFileTransferChannel

Flags: Read

Since: 0.17.1


The “mime-type” property

  “mime-type”                gchar *

The MIME type of the file to be transferred.

Owner: TpFileTransferChannel

Flags: Read

Default value: NULL

Since: 0.15.5


The “service-name” property

  “service-name”             gchar *

A string representing the name of the service suggested to handle this file transfer channel, or NULL if the initiator did not provide one.

This is a useful way of requesting file transfer channels with a hint of what handler they should be handled by on the remote side. If a channel request is made with this property set (to a contact who also supports the metadata extension; see the requestable channel classes for said contact), this property will be set to the same value on the remote incoming channel and handlers can match on this in their handler filter. For example, a remote handler could call the following:

1
2
3
4
5
6
tp_base_client_take_handler_filter (handler, tp_asv_new (
              TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER,
              TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT,
              TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE,
              TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, G_TYPE_STRING, "service.name",
              NULL));

The TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful.

Owner: TpFileTransferChannel

Flags: Read

Default value: ""

Since: 0.17.1


The “size” property

  “size”                     guint64

The size of the file to be transferred, or G_MAXUINT64 if not known.

Since 0.15.5

Owner: TpFileTransferChannel

Flags: Read

Default value: 0


The “state” property

  “state”                    guint

A TpFileTransferState holding the state of the file transfer.

The TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

Since 0.17.1

Owner: TpFileTransferChannel

Flags: Read

Allowed values: <= 6

Default value: 0


The “transferred-bytes” property

  “transferred-bytes”        guint64

The number of bytes transferred so far in this file transfer.

The TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date.

Owner: TpFileTransferChannel

Flags: Read

Default value: 0

Since: 0.15.5

telepathy-glib-0.24.2/docs/reference/html/TpBaseConnectionManager.html0000644000175000017500000014252214006623343022652 00000000000000 TpBaseConnectionManager: telepathy-glib API Reference Manual

TpBaseConnectionManager

TpBaseConnectionManager — base class for TpSvcConnectionManager implementations

Properties

TpDBusDaemon * dbus-daemon Read / Write / Construct Only
GStrv interfaces Read
GHashTable_gchararray+GHashTable_gchararray+GValue__* protocols Read

Signals

void no-more-connections Has Details

Object Hierarchy

    GObject
    ╰── TpBaseConnectionManager

Implemented Interfaces

TpBaseConnectionManager implements TpSvcDBusProperties and TpSvcConnectionManager.

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

This base class makes it easier to write TpSvcConnectionManager implementations by managing the D-Bus object path and bus name, and maintaining a table of active connections. Subclasses should usually only need to override the members of the class data structure.

Functions

TpCMParamFilter ()

gboolean
(*TpCMParamFilter) (const TpCMParamSpec *paramspec,
                    GValue *value,
                    GError **error);

Signature of a callback used to validate and/or normalize user-provided CM parameter values.

Parameters

paramspec

The parameter specification. The filter is likely to use name (for the error message if the value is invalid) and filter_data.

 

value

The value for that parameter provided by the user. May be changed to contain a different value of the same type, if some sort of normalization is required

 

error

Used to raise TP_ERROR_INVALID_ARGUMENT if the given value is rejected

 

Returns

TRUE to accept, FALSE (with error set) to reject


tp_cm_param_filter_string_nonempty ()

gboolean
tp_cm_param_filter_string_nonempty (const TpCMParamSpec *paramspec,
                                    GValue *value,
                                    GError **error);

A TpCMParamFilter which rejects empty strings.

Parameters

paramspec

The parameter specification for a string parameter

 

value

A GValue containing a string, which will not be altered

 

error

Used to return an error if the string is empty

 

Returns

TRUE to accept, FALSE (with error set) to reject


tp_cm_param_filter_uint_nonzero ()

gboolean
tp_cm_param_filter_uint_nonzero (const TpCMParamSpec *paramspec,
                                 GValue *value,
                                 GError **error);

A TpCMParamFilter which rejects zero, useful for server port numbers.

Parameters

paramspec

The parameter specification for a guint parameter

 

value

A GValue containing a guint, which will not be altered

 

error

Used to return an error if the guint is 0

 

Returns

TRUE to accept, FALSE (with error set) to reject


TpCMParamSetter ()

void
(*TpCMParamSetter) (const TpCMParamSpec *paramspec,
                    const GValue *value,
                    gpointer params);

The signature of a callback used to set a parameter within the opaque data structure used for a protocol.

Parameters

paramspec

The parameter specification. The setter is likely to use some combination of the name, offset and setter_data fields.

 

value

The value for that parameter provided by the user.

 

params

An opaque data structure, created by TpCMProtocolSpec.params_new.

 

Since: 0.7.0


tp_cm_param_setter_offset ()

void
tp_cm_param_setter_offset (const TpCMParamSpec *paramspec,
                           const GValue *value,
                           gpointer params);

A TpCMParamSetter which sets parameters by dereferencing an offset from params . If paramspec->offset is G_MAXSIZE, the parameter is deemed obsolete, and is accepted but ignored.

Parameters

paramspec

A parameter specification with offset set to some meaningful value.

 

value

The value for that parameter, either provided by the user or constructed from the parameter's default.

 

params

An opaque data structure such that the address at (params + paramspec->offset ) is a valid pointer to a variable of the appropriate type.

 

Since: 0.7.0


TpBaseConnectionManagerNewConnFunc ()

TpBaseConnection *
(*TpBaseConnectionManagerNewConnFunc) (TpBaseConnectionManager *self,
                                       const gchar *proto,
                                       TpIntset *params_present,
                                       void *parsed_params,
                                       GError **error);

A function that will return a new connection according to the parsed parameters; used to implement RequestConnection.

The connection manager base class will register the bus name for the new connection, and place a reference to it in its table of connections until the connection's shutdown process finishes.

Parameters

self

The connection manager implementation

 

proto

The protocol name from the D-Bus request

 

params_present

A set of integers representing the indexes into the array of TpCMParamSpec of those parameters that were present in the request

 

parsed_params

An opaque data structure as returned by the protocol's params_new function, populated according to the parameter specifications

 

error

if not NULL, used to indicate the error if NULL is returned

 

Returns

the new connection object, or NULL on error.


TpBaseConnectionManagerGetInterfacesFunc ()

GPtrArray *
(*TpBaseConnectionManagerGetInterfacesFunc)
                               (TpBaseConnectionManager *self);

Signature of an implementation of TpBaseConnectionManagerClass.get_interfaces virtual function.

Implementation must first chainup on parent class implementation and then add extra interfaces into the GPtrArray.

1
2
3
4
5
6
7
8
9
10
11
12
static GPtrArray *
my_connection_manager_get_interfaces (TpBaseConnectionManager *self)
{
  GPtrArray *interfaces;

  interfaces = TP_BASE_CONNECTION_MANAGER_CLASS (
      my_connection_manager_parent_class)->get_interfaces (self);

  g_ptr_array_add (interfaces, TP_IFACE_BADGERS);

  return interfaces;
}

Parameters

Returns

a GPtrArray of static strings for D-Bus interfaces implemented by this client.

[transfer container]

Since: 0.19.4


tp_base_connection_manager_get_dbus_daemon ()

TpDBusDaemon *
tp_base_connection_manager_get_dbus_daemon
                               (TpBaseConnectionManager *self);

Parameters

self

the connection manager

 

Returns

the value of the “dbus-daemon” property. The caller must reference the returned object with g_object_ref() if it will be kept.

[transfer none]

Since: 0.11.3


tp_base_connection_manager_register ()

gboolean
tp_base_connection_manager_register (TpBaseConnectionManager *self);

Register the connection manager with an appropriate object path as determined from its cm_dbus_name , and register the appropriate well-known bus name.

Parameters

self

The connection manager implementation

 

Returns

TRUE on success, FALSE (having emitted a warning to stderr) on failure


tp_base_connection_manager_add_protocol ()

void
tp_base_connection_manager_add_protocol
                               (TpBaseConnectionManager *self,
                                TpBaseProtocol *protocol);

Add a protocol object to the set of supported protocols.

Parameters

self

a connection manager object which has not yet registered on D-Bus (i.e. tp_base_connection_manager_register() must not have been called)

 

protocol

a protocol object, which must not have the same protocol name as any that has already been added

 

Types and Values

struct TpCMParamSpec

struct TpCMParamSpec {
    const gchar *name;
    const gchar *dtype;
    GType gtype;
    guint flags;
    gconstpointer def;
    gsize offset;

    TpCMParamFilter filter;
    gconstpointer filter_data;

    gconstpointer setter_data;
};

Structure representing a connection manager parameter, as accepted by RequestConnection.

In addition to the fields documented here, there is one gpointer field which must currently be NULL. A meaning may be defined for it in a future version of telepathy-glib.

Members

const gchar *name;

Name as passed over D-Bus

 

const gchar *dtype;

D-Bus type signature. We currently support 16- and 32-bit integers (gtype is INT), 16- and 32-bit unsigned integers (gtype is UINT), strings (gtype is STRING) and booleans (gtype is BOOLEAN).

 

GType gtype;

GLib type, derived from dtype as above

 

guint flags;

Some combination of TpConnMgrParamFlags

 

gconstpointer def;

Default value, as a (const gchar *) for string parameters, or using GINT_TO_POINTER or GUINT_TO_POINTER for integer parameters

 

gsize offset;

Offset of the parameter in the opaque data structure, if appropriate. The member at that offset is expected to be a gint, guint, (gchar *) or gboolean, depending on gtype . The default parameter setter, tp_cm_param_setter_offset, uses this field.

 

TpCMParamFilter filter;

A callback which is used to validate or normalize the user-provided value before it is written into the opaque data structure

 

gconstpointer filter_data;

Arbitrary opaque data intended for use by the filter function

 

gconstpointer setter_data;

Arbitrary opaque data intended for use by the setter function instead of or in addition to offset .

 

TpCMProtocolSpec

typedef struct {
    const gchar *name;
    const TpCMParamSpec *parameters;
    gpointer (*params_new) (void);
    void (*params_free) (gpointer);
    TpCMParamSetter set_param;
} TpCMProtocolSpec;

Structure representing a connection manager protocol.

In addition to the fields documented here, there are three gpointer fields which must currently be NULL. A meaning may be defined for these in a future version of telepathy-glib.

Members

const gchar *name;

The name which should be passed to RequestConnection for this protocol.

 

const TpCMParamSpec *parameters;

An array of TpCMParamSpec representing the valid parameters for this protocol, terminated by a TpCMParamSpec whose name entry is NULL.

 

params_new ()

A function which allocates an opaque data structure to store the parsed parameters for this protocol. The offset fields in the members of the parameters array refer to offsets within this opaque structure.

 

params_free ()

A function which deallocates the opaque data structure provided by params_new, including deallocating its data members (currently, only strings) if necessary.

 

TpCMParamSetter set_param;

A function which sets a parameter within the opaque data structure provided by params_new. If NULL, tp_cm_param_setter_offset() will be used. (New in 0.7.0 - previously, code equivalent to tp_cm_param_setter_offset() was always used.)

 

struct TpBaseConnectionManager

struct TpBaseConnectionManager;

A base class for connection managers. There are no interesting public fields in the instance structure.


struct TpBaseConnectionManagerClass

struct TpBaseConnectionManagerClass {
    GObjectClass parent_class;

    const char *cm_dbus_name;

    TpBaseConnectionManagerGetInterfacesFunc get_interfaces;
};

The class structure for TpBaseConnectionManager.

In addition to the fields documented here, there are some gpointer fields which must currently be NULL (a meaning may be defined for these in a future version of telepathy-glib).

Changed in 0.7.1: it is a fatal error for cm_dbus_name not to conform to the specification.

Changed in 0.11.11: protocol_params and new_connection may both be NULL. If so, this connection manager is assumed to use Protocol objects instead. Since 0.19.2 those fields are deprecated and should not be used anymore.

Members

const char *cm_dbus_name;

The name of this connection manager, as used to construct D-Bus object paths and bus names. Must contain only letters, digits and underscores, and may not start with a digit. Must be filled in by subclasses in their class_init function.

 

TpBaseConnectionManagerGetInterfacesFunc get_interfaces;

Returns a GPtrArray of static strings of extra D-Bus interfaces implemented by instances of this class, which may be filled in by subclasses. The default is to list no additional interfaces. Implementations must first chainup on parent class implementation and then add extra interfaces to the GPtrArray. Replaces interfaces . Since: 0.19.4

 

Property Details

The “dbus-daemon” property

  “dbus-daemon”              TpDBusDaemon *

TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction.

If this property is NULL or omitted during construction, the object will automatically attempt to connect to the starter or session bus with tp_dbus_daemon_dup() just after it is constructed; if this fails, a warning will be logged with g_warning(), and this property will remain NULL.

Owner: TpBaseConnectionManager

Flags: Read / Write / Construct Only

Since: 0.11.3


The “interfaces” property

  “interfaces”               GStrv

The set of D-Bus interfaces available on this ConnectionManager, other than ConnectionManager itself.

Owner: TpBaseConnectionManager

Flags: Read

Since: 0.11.11


The “protocols” property

  “protocols”                GHashTable_gchararray+GHashTable_gchararray+GValue__*

The Protocol objects available on this ConnectionManager.

Owner: TpBaseConnectionManager

Flags: Read

Since: 0.11.11

Signal Details

The “no-more-connections” signal

void
user_function (TpBaseConnectionManager *tpbaseconnectionmanager,
               gpointer                 user_data)

Emitted when the table of active connections becomes empty. tp_run_connection_manager() uses this to detect when to shut down the connection manager.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Has Details

telepathy-glib-0.24.2/docs/reference/telepathy-glib-sections.txt0000644000175000017500000105055614006623343021635 00000000000000
telepathy-glib/telepathy-glib.h channel-iface TpChannelFunc TpChannelIface TpChannelIface TpChannelIfaceClass TP_CHANNEL_IFACE TP_IS_CHANNEL_IFACE TP_TYPE_CHANNEL_IFACE tp_channel_iface_get_type TP_CHANNEL_IFACE_GET_CLASS TpChannelPrivate
telepathy-glib/telepathy-glib.h defs defs TP_CM_BUS_NAME_BASE TP_CM_OBJECT_PATH_BASE TP_CONN_BUS_NAME_BASE TP_CONN_OBJECT_PATH_BASE TP_ACCOUNT_MANAGER_BUS_NAME TP_ACCOUNT_MANAGER_OBJECT_PATH TP_ACCOUNT_OBJECT_PATH_BASE TP_CHANNEL_DISPATCHER_BUS_NAME TP_CHANNEL_DISPATCHER_OBJECT_PATH TP_CLIENT_BUS_NAME_BASE TP_CLIENT_OBJECT_PATH_BASE TP_DEBUG_OBJECT_PATH TP_USER_ACTION_TIME_NOT_USER_ACTION TP_USER_ACTION_TIME_CURRENT_TIME
telepathy-glib/telepathy-glib.h version version TP_MAJOR_VERSION TP_MINOR_VERSION TP_MICRO_VERSION TP_VERSION_0_16 TP_VERSION_0_18 TP_VERSION_0_20 TP_VERSION_0_22 TP_VERSION_0_24 TP_VERSION_MIN_REQUIRED TP_VERSION_MAX_ALLOWED TP_VERSION_1_0
telepathy-glib/telepathy-glib.h base-connection TpBaseConnection TP_INTERNAL_CONNECTION_STATUS_NEW TpBaseConnection TpBaseConnectionClass TpBaseConnectionCreateChannelFactoriesImpl TpBaseConnectionCreateChannelManagersImpl TpBaseConnectionCreateHandleReposImpl TpBaseConnectionGetUniqueConnectionNameImpl TpBaseConnectionGetInterfacesImpl TpBaseConnectionProc TpBaseConnectionStartConnectingImpl tp_base_connection_get_bus_name tp_base_connection_get_object_path tp_base_connection_get_dbus_daemon tp_base_connection_register tp_base_connection_get_handles tp_base_connection_get_self_handle tp_base_connection_set_self_handle tp_base_connection_get_status tp_base_connection_is_destroyed tp_base_connection_check_connected tp_base_connection_change_status tp_base_connection_disconnect_with_dbus_error tp_base_connection_disconnect_with_dbus_error_vardict tp_base_connection_finish_shutdown tp_base_connection_add_interfaces tp_base_connection_dbus_request_handles TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED tp_base_connection_register_with_contacts_mixin tp_base_connection_add_possible_client_interest tp_base_connection_add_client_interest tp_base_connection_get_account_path_suffix TpChannelManagerIter tp_base_connection_channel_manager_iter_init tp_base_connection_channel_manager_iter_next TP_BASE_CONNECTION TP_IS_BASE_CONNECTION TP_TYPE_BASE_CONNECTION tp_base_connection_get_type TP_BASE_CONNECTION_CLASS TP_IS_BASE_CONNECTION_CLASS TP_BASE_CONNECTION_GET_CLASS TpBaseConnectionPrivate
TpBaseConnectionManager telepathy-glib/telepathy-glib.h base-connection-manager TpCMParamFilter tp_cm_param_filter_string_nonempty tp_cm_param_filter_uint_nonzero TpCMParamSetter tp_cm_param_setter_offset TpCMParamSpec TpCMProtocolSpec TpBaseConnectionManager TpBaseConnectionManagerClass TpBaseConnectionManagerNewConnFunc TpBaseConnectionManagerGetInterfacesFunc tp_base_connection_manager_get_dbus_daemon tp_base_connection_manager_register tp_base_connection_manager_add_protocol TP_BASE_CONNECTION_MANAGER TP_IS_BASE_CONNECTION_MANAGER TP_TYPE_BASE_CONNECTION_MANAGER tp_base_connection_manager_get_type TP_BASE_CONNECTION_MANAGER_CLASS TP_IS_BASE_CONNECTION_MANAGER_CLASS TP_BASE_CONNECTION_MANAGER_GET_CLASS TpBaseConnectionManagerPrivate
telepathy-glib/channel-factory-iface.h channel-factory-iface TpChannelFactoryIfaceForeachImpl TpChannelFactoryIfaceProc TpChannelFactoryIfaceRequestImpl TpChannelFactoryRequestStatus TpChannelFactoryIface TpChannelFactoryIface TpChannelFactoryIfaceClass tp_channel_factory_iface_close_all tp_channel_factory_iface_connecting tp_channel_factory_iface_connected tp_channel_factory_iface_disconnected tp_channel_factory_iface_foreach tp_channel_factory_iface_request tp_channel_factory_iface_emit_new_channel tp_channel_factory_iface_emit_channel_error TP_CHANNEL_FACTORY_IFACE TP_IS_CHANNEL_FACTORY_IFACE TP_TYPE_CHANNEL_FACTORY_IFACE tp_channel_factory_iface_get_type TP_CHANNEL_FACTORY_IFACE_GET_CLASS
telepathy-glib/telepathy-glib.h channel-manager TpChannelManagerChannelClassFunc TpChannelManagerForeachChannelClassFunc TpChannelManagerTypeChannelClassFunc TpChannelManagerTypeForeachChannelClassFunc TpChannelManagerForeachChannelFunc TpChannelManagerRequestFunc TpChannelManager TpChannelManager TpChannelManagerIface tp_channel_manager_asv_has_unknown_properties tp_channel_manager_create_channel tp_channel_manager_emit_channel_closed tp_channel_manager_emit_channel_closed_for_object tp_channel_manager_emit_new_channel tp_channel_manager_emit_new_channels tp_channel_manager_emit_request_already_satisfied tp_channel_manager_emit_request_failed tp_channel_manager_emit_request_failed_printf tp_channel_manager_ensure_channel tp_channel_manager_foreach_channel tp_channel_manager_foreach_channel_class tp_channel_manager_type_foreach_channel_class tp_channel_manager_request_channel TP_CHANNEL_MANAGER TP_IS_CHANNEL_MANAGER TP_TYPE_CHANNEL_MANAGER tp_channel_manager_get_type TP_CHANNEL_MANAGER_GET_INTERFACE
telepathy-glib/telepathy-glib.h exportable-channel TpExportableChannelFunc TpExportableChannel TpExportableChannel TpExportableChannelIface TP_EXPORTABLE_CHANNEL TP_IS_EXPORTABLE_CHANNEL TP_TYPE_EXPORTABLE_CHANNEL tp_exportable_channel_get_type TP_EXPORTABLE_CHANNEL_GET_INTERFACE
telepathy-glib/telepathy-glib.h base-channel TpBaseChannel TpBaseChannel TpBaseChannelClass TpBaseChannelFillPropertiesFunc TpBaseChannelCloseFunc TpBaseChannelGetPathFunc TpBaseChannelGetInterfacesFunc tp_base_channel_register tp_base_channel_close tp_base_channel_destroyed tp_base_channel_reopened tp_base_channel_disappear tp_base_channel_reopened_with_requested tp_base_channel_get_object_path tp_base_channel_get_connection tp_base_channel_get_self_handle tp_base_channel_get_target_handle tp_base_channel_get_initiator tp_base_channel_is_requested tp_base_channel_is_registered tp_base_channel_is_destroyed tp_base_channel_is_respawning TP_BASE_CHANNEL TP_IS_BASE_CHANNEL TP_TYPE_BASE_CHANNEL TP_BASE_CHANNEL_CLASS TP_BASE_CHANNEL_GET_CLASS TP_IS_BASE_CHANNEL_CLASS tp_base_channel_get_type TpBaseChannelPrivate
handle-repo telepathy-glib/telepathy-glib.h handle-repo TpHandleRepoIface TpHandleRepoIfaceClass tp_handle_is_valid tp_handles_are_valid tp_handles_supported_and_valid tp_handle_ref tp_handles_ref tp_handle_unref tp_handles_unref tp_handle_client_hold tp_handles_client_hold tp_handle_client_release tp_handles_client_release tp_handle_inspect tp_handle_set_qdata tp_handle_get_qdata tp_handle_ensure tp_handle_lookup tp_handle_ensure_async tp_handle_ensure_finish TP_HANDLE_REPO_IFACE TP_IS_HANDLE_REPO_IFACE TP_TYPE_HANDLE_REPO_IFACE tp_handle_repo_iface_get_type TP_HANDLE_REPO_IFACE_GET_CLASS tp_handle_set_get_type TpHandleSet TP_TYPE_HANDLE_SET TpHandleSetMemberFunc tp_handle_set_new tp_handle_set_new_containing tp_handle_set_new_from_array tp_handle_set_new_from_intset tp_handle_set_copy tp_handle_set_clear tp_handle_set_destroy tp_handle_set_peek tp_handle_set_add tp_handle_set_remove tp_handle_set_is_member tp_handle_set_foreach tp_handle_set_is_empty tp_handle_set_size tp_handle_set_to_array tp_handle_set_to_identifier_map tp_handle_set_update tp_handle_set_difference_update tp_handle_set_dump
telepathy-glib/telepathy-glib.h handle-repo-dynamic TpDynamicHandleRepo TpDynamicHandleRepo TpDynamicHandleRepoClass tp_dynamic_handle_repo_lookup_exact tp_dynamic_handle_repo_new tp_dynamic_handle_repo_set_normalize_async TpDynamicHandleRepoNormalizeFunc TpDynamicHandleRepoNormalizeAsync TpDynamicHandleRepoNormalizeFinish TP_DYNAMIC_HANDLE_REPO TP_IS_DYNAMIC_HANDLE_REPO TP_TYPE_DYNAMIC_HANDLE_REPO tp_dynamic_handle_repo_get_type TP_DYNAMIC_HANDLE_REPO_CLASS TP_IS_DYNAMIC_HANDLE_REPO_CLASS TP_DYNAMIC_HANDLE_REPO_GET_CLASS
handle-repo-static telepathy-glib/telepathy-glib.h TpStaticHandleRepo tp_static_handle_repo_new TpStaticHandleRepo TpStaticHandleRepoClass TP_STATIC_HANDLE_REPO TP_IS_STATIC_HANDLE_REPO TP_TYPE_STATIC_HANDLE_REPO tp_static_handle_repo_get_type TP_STATIC_HANDLE_REPO_CLASS TP_IS_STATIC_HANDLE_REPO_CLASS TP_STATIC_HANDLE_REPO_GET_CLASS
svc-generic telepathy-glib/telepathy-glib-dbus.h svc-generic TpSvcDBusIntrospectable TpSvcDBusIntrospectableClass TpSvcDBusProperties TpSvcDBusPropertiesClass TpSvcPropertiesInterface TpSvcPropertiesInterfaceClass tp_svc_dbus_introspectable_implement_introspect tp_svc_dbus_introspectable_introspect_impl tp_svc_dbus_introspectable_return_from_introspect tp_svc_dbus_properties_get_all_impl tp_svc_dbus_properties_get_impl tp_svc_dbus_properties_implement_get tp_svc_dbus_properties_implement_get_all tp_svc_dbus_properties_implement_set tp_svc_dbus_properties_return_from_get tp_svc_dbus_properties_return_from_get_all tp_svc_dbus_properties_return_from_set tp_svc_dbus_properties_set_impl tp_svc_dbus_properties_emit_properties_changed tp_svc_properties_interface_get_properties_impl tp_svc_properties_interface_return_from_get_properties tp_svc_properties_interface_implement_get_properties tp_svc_properties_interface_list_properties_impl tp_svc_properties_interface_return_from_list_properties tp_svc_properties_interface_implement_list_properties tp_svc_properties_interface_set_properties_impl tp_svc_properties_interface_return_from_set_properties tp_svc_properties_interface_implement_set_properties tp_svc_properties_interface_emit_properties_changed tp_svc_properties_interface_emit_property_flags_changed tp_svc_dbus_introspectable_get_type tp_svc_dbus_properties_get_type tp_svc_properties_interface_get_type TP_SVC_PROPERTIES_INTERFACE TP_IS_SVC_PROPERTIES_INTERFACE TP_TYPE_SVC_PROPERTIES_INTERFACE TP_SVC_PROPERTIES_INTERFACE_GET_CLASS TP_IS_SVC_DBUS_INTROSPECTABLE TP_IS_SVC_DBUS_PROPERTIES TP_SVC_DBUS_INTROSPECTABLE TP_SVC_DBUS_INTROSPECTABLE_GET_CLASS TP_SVC_DBUS_PROPERTIES TP_SVC_DBUS_PROPERTIES_GET_CLASS TP_TYPE_SVC_DBUS_INTROSPECTABLE TP_TYPE_SVC_DBUS_PROPERTIES
telepathy-glib/telepathy-glib-dbus.h svc-channel svc-channel TpSvcChannel TpSvcChannelClass tp_svc_channel_close_impl tp_svc_channel_implement_close tp_svc_channel_return_from_close tp_svc_channel_get_channel_type_impl tp_svc_channel_implement_get_channel_type tp_svc_channel_return_from_get_channel_type tp_svc_channel_get_handle_impl tp_svc_channel_implement_get_handle tp_svc_channel_return_from_get_handle tp_svc_channel_get_interfaces_impl tp_svc_channel_implement_get_interfaces tp_svc_channel_return_from_get_interfaces tp_svc_channel_emit_closed TpSvcChannelInterfaceDestroyable TpSvcChannelInterfaceDestroyableClass tp_svc_channel_interface_destroyable_destroy_impl tp_svc_channel_interface_destroyable_implement_destroy tp_svc_channel_interface_destroyable_return_from_destroy TP_SVC_CHANNEL TP_IS_SVC_CHANNEL TP_TYPE_SVC_CHANNEL tp_svc_channel_get_type TP_SVC_CHANNEL_GET_CLASS TP_IS_SVC_CHANNEL_INTERFACE_DESTROYABLE TP_SVC_CHANNEL_INTERFACE_DESTROYABLE TP_SVC_CHANNEL_INTERFACE_DESTROYABLE_GET_CLASS tp_svc_channel_interface_destroyable_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE
telepathy-glib/telepathy-glib-dbus.h svc-channel-text svc-channel-text TpSvcChannelTypeText TpSvcChannelTypeTextClass tp_svc_channel_type_text_acknowledge_pending_messages_impl tp_svc_channel_type_text_implement_acknowledge_pending_messages tp_svc_channel_type_text_return_from_acknowledge_pending_messages tp_svc_channel_type_text_get_message_types_impl tp_svc_channel_type_text_implement_get_message_types tp_svc_channel_type_text_return_from_get_message_types tp_svc_channel_type_text_list_pending_messages_impl tp_svc_channel_type_text_implement_list_pending_messages tp_svc_channel_type_text_return_from_list_pending_messages tp_svc_channel_type_text_send_impl tp_svc_channel_type_text_implement_send tp_svc_channel_type_text_return_from_send tp_svc_channel_type_text_emit_lost_message tp_svc_channel_type_text_emit_received tp_svc_channel_type_text_emit_send_error tp_svc_channel_type_text_emit_sent TP_SVC_CHANNEL_TYPE_TEXT TP_IS_SVC_CHANNEL_TYPE_TEXT TP_TYPE_SVC_CHANNEL_TYPE_TEXT tp_svc_channel_type_text_get_type TP_SVC_CHANNEL_TYPE_TEXT_GET_CLASS TpSvcChannelInterfaceChatState TpSvcChannelInterfaceChatStateClass tp_svc_channel_interface_chat_state_set_chat_state_impl tp_svc_channel_interface_chat_state_implement_set_chat_state tp_svc_channel_interface_chat_state_return_from_set_chat_state tp_svc_channel_interface_chat_state_emit_chat_state_changed TP_SVC_CHANNEL_INTERFACE_CHAT_STATE TP_IS_SVC_CHANNEL_INTERFACE_CHAT_STATE TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE tp_svc_channel_interface_chat_state_get_type TP_SVC_CHANNEL_INTERFACE_CHAT_STATE_GET_CLASS TpSvcChannelInterfaceMessages TpSvcChannelInterfaceMessagesClass tp_svc_channel_interface_messages_emit_message_received tp_svc_channel_interface_messages_emit_message_sent tp_svc_channel_interface_messages_emit_pending_messages_removed tp_svc_channel_interface_messages_get_pending_message_content_impl tp_svc_channel_interface_messages_implement_get_pending_message_content tp_svc_channel_interface_messages_implement_send_message tp_svc_channel_interface_messages_return_from_get_pending_message_content tp_svc_channel_interface_messages_return_from_send_message tp_svc_channel_interface_messages_send_message_impl tp_svc_channel_interface_messages_get_type TP_IS_SVC_CHANNEL_INTERFACE_MESSAGES TP_SVC_CHANNEL_INTERFACE_MESSAGES TP_SVC_CHANNEL_INTERFACE_MESSAGES_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES TpSvcChannelInterfacePassword TpSvcChannelInterfacePasswordClass tp_svc_channel_interface_password_get_password_flags_impl tp_svc_channel_interface_password_implement_get_password_flags tp_svc_channel_interface_password_return_from_get_password_flags tp_svc_channel_interface_password_provide_password_impl tp_svc_channel_interface_password_implement_provide_password tp_svc_channel_interface_password_return_from_provide_password tp_svc_channel_interface_password_emit_password_flags_changed TP_SVC_CHANNEL_INTERFACE_PASSWORD TP_IS_SVC_CHANNEL_INTERFACE_PASSWORD TP_TYPE_SVC_CHANNEL_INTERFACE_PASSWORD tp_svc_channel_interface_password_get_type TP_SVC_CHANNEL_INTERFACE_PASSWORD_GET_CLASS TpSvcChannelInterfaceSMS TpSvcChannelInterfaceSMSClass tp_svc_channel_interface_sms_emit_sms_channel_changed tp_svc_channel_interface_sms_get_sms_length_impl tp_svc_channel_interface_sms_implement_get_sms_length tp_svc_channel_interface_sms_return_from_get_sms_length tp_svc_channel_interface_sms_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_SMS TP_SVC_CHANNEL_INTERFACE_SMS_GET_CLASS TP_SVC_CHANNEL_INTERFACE_SMS TP_IS_SVC_CHANNEL_INTERFACE_SMS
telepathy-glib/telepathy-glib-dbus.h svc-channel-room svc-channel-room TpSvcChannelInterfaceRoom TpSvcChannelInterfaceRoomClass tp_svc_channel_interface_room_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM TP_SVC_CHANNEL_INTERFACE_ROOM TP_SVC_CHANNEL_INTERFACE_ROOM_GET_CLASS TP_IS_SVC_CHANNEL_INTERFACE_ROOM TpSvcChannelInterfaceRoomConfig TpSvcChannelInterfaceRoomConfigClass tp_svc_channel_interface_room_config_implement_update_configuration tp_svc_channel_interface_room_config_return_from_update_configuration tp_svc_channel_interface_room_config_update_configuration_impl tp_svc_channel_interface_room_config_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG_GET_CLASS TP_IS_SVC_CHANNEL_INTERFACE_ROOM_CONFIG TpSvcChannelInterfaceSubject TpSvcChannelInterfaceSubjectClass tp_svc_channel_interface_subject_implement_set_subject tp_svc_channel_interface_subject_return_from_set_subject tp_svc_channel_interface_subject_set_subject_impl tp_svc_channel_interface_subject_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_SUBJECT TP_SVC_CHANNEL_INTERFACE_SUBJECT TP_SVC_CHANNEL_INTERFACE_SUBJECT_GET_CLASS TP_IS_SVC_CHANNEL_INTERFACE_SUBJECT
telepathy-glib/telepathy-glib-dbus.h svc-channel-file-transfer svc-channel-file-transfer TpSvcChannelTypeFileTransfer TpSvcChannelTypeFileTransferClass tp_svc_channel_type_file_transfer_accept_file_impl tp_svc_channel_type_file_transfer_emit_file_transfer_state_changed tp_svc_channel_type_file_transfer_emit_initial_offset_defined tp_svc_channel_type_file_transfer_emit_transferred_bytes_changed tp_svc_channel_type_file_transfer_emit_uri_defined tp_svc_channel_type_file_transfer_implement_accept_file tp_svc_channel_type_file_transfer_implement_provide_file tp_svc_channel_type_file_transfer_provide_file_impl tp_svc_channel_type_file_transfer_return_from_accept_file tp_svc_channel_type_file_transfer_return_from_provide_file TP_SVC_CHANNEL_TYPE_FILE_TRANSFER TP_IS_SVC_CHANNEL_TYPE_FILE_TRANSFER TP_TYPE_SVC_CHANNEL_TYPE_FILE_TRANSFER tp_svc_channel_type_file_transfer_get_type TP_SVC_CHANNEL_TYPE_FILE_TRANSFER_GET_CLASS
telepathy-glib/telepathy-glib-dbus.h svc-channel-tubes svc-channel-tubes TpSvcChannelTypeTubes TpSvcChannelTypeTubesClass tp_svc_channel_type_tubes_accept_d_bus_tube_impl tp_svc_channel_type_tubes_implement_accept_d_bus_tube tp_svc_channel_type_tubes_return_from_accept_d_bus_tube tp_svc_channel_type_tubes_accept_stream_tube_impl tp_svc_channel_type_tubes_implement_accept_stream_tube tp_svc_channel_type_tubes_return_from_accept_stream_tube tp_svc_channel_type_tubes_close_tube_impl tp_svc_channel_type_tubes_implement_close_tube tp_svc_channel_type_tubes_return_from_close_tube tp_svc_channel_type_tubes_get_available_stream_tube_types_impl tp_svc_channel_type_tubes_implement_get_available_stream_tube_types tp_svc_channel_type_tubes_return_from_get_available_stream_tube_types tp_svc_channel_type_tubes_get_available_tube_types_impl tp_svc_channel_type_tubes_implement_get_available_tube_types tp_svc_channel_type_tubes_return_from_get_available_tube_types tp_svc_channel_type_tubes_get_d_bus_names_impl tp_svc_channel_type_tubes_implement_get_d_bus_names tp_svc_channel_type_tubes_return_from_get_d_bus_names tp_svc_channel_type_tubes_get_d_bus_tube_address_impl tp_svc_channel_type_tubes_implement_get_d_bus_tube_address tp_svc_channel_type_tubes_return_from_get_d_bus_tube_address tp_svc_channel_type_tubes_get_stream_tube_socket_address_impl tp_svc_channel_type_tubes_implement_get_stream_tube_socket_address tp_svc_channel_type_tubes_return_from_get_stream_tube_socket_address tp_svc_channel_type_tubes_list_tubes_impl tp_svc_channel_type_tubes_implement_list_tubes tp_svc_channel_type_tubes_return_from_list_tubes tp_svc_channel_type_tubes_offer_d_bus_tube_impl tp_svc_channel_type_tubes_implement_offer_d_bus_tube tp_svc_channel_type_tubes_return_from_offer_d_bus_tube tp_svc_channel_type_tubes_offer_stream_tube_impl tp_svc_channel_type_tubes_implement_offer_stream_tube tp_svc_channel_type_tubes_return_from_offer_stream_tube tp_svc_channel_type_tubes_emit_d_bus_names_changed tp_svc_channel_type_tubes_emit_new_tube tp_svc_channel_type_tubes_emit_stream_tube_new_connection tp_svc_channel_type_tubes_emit_tube_closed tp_svc_channel_type_tubes_emit_tube_state_changed tp_svc_channel_type_tubes_get_type TP_SVC_CHANNEL_TYPE_TUBES TP_IS_SVC_CHANNEL_TYPE_TUBES TP_SVC_CHANNEL_TYPE_TUBES_GET_CLASS TP_TYPE_SVC_CHANNEL_TYPE_TUBES
telepathy-glib/telepathy-glib-dbus.h svc-channel-tube svc-channel-tube TpSvcChannelInterfaceTube TpSvcChannelInterfaceTubeClass tp_svc_channel_interface_tube_emit_tube_channel_state_changed TpSvcChannelTypeStreamTube TpSvcChannelTypeStreamTubeClass tp_svc_channel_type_stream_tube_offer_impl tp_svc_channel_type_stream_tube_implement_offer tp_svc_channel_type_stream_tube_return_from_offer tp_svc_channel_type_stream_tube_accept_impl tp_svc_channel_type_stream_tube_implement_accept tp_svc_channel_type_stream_tube_return_from_accept tp_svc_channel_type_stream_tube_emit_new_remote_connection tp_svc_channel_type_stream_tube_emit_new_local_connection tp_svc_channel_type_stream_tube_emit_connection_closed TpSvcChannelTypeDBusTube TpSvcChannelTypeDBusTubeClass tp_svc_channel_type_dbus_tube_offer_impl tp_svc_channel_type_dbus_tube_implement_offer tp_svc_channel_type_dbus_tube_return_from_offer tp_svc_channel_type_dbus_tube_accept_impl tp_svc_channel_type_dbus_tube_implement_accept tp_svc_channel_type_dbus_tube_return_from_accept tp_svc_channel_type_dbus_tube_emit_dbus_names_changed TP_TYPE_SVC_CHANNEL_INTERFACE_TUBE TP_SVC_CHANNEL_INTERFACE_TUBE TP_IS_SVC_CHANNEL_INTERFACE_TUBE tp_svc_channel_interface_tube_get_type TP_SVC_CHANNEL_INTERFACE_TUBE_GET_CLASS TP_SVC_CHANNEL_TYPE_STREAM_TUBE TP_IS_SVC_CHANNEL_TYPE_STREAM_TUBE TP_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE tp_svc_channel_type_stream_tube_get_type TP_SVC_CHANNEL_TYPE_STREAM_TUBE_GET_CLASS TP_SVC_CHANNEL_TYPE_DBUS_TUBE TP_IS_SVC_CHANNEL_TYPE_DBUS_TUBE TP_TYPE_SVC_CHANNEL_TYPE_DBUS_TUBE tp_svc_channel_type_dbus_tube_get_type TP_SVC_CHANNEL_TYPE_DBUS_TUBE_GET_CLASS
svc-channel-roomlist svc-channel-roomlist telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeRoomList TpSvcChannelTypeRoomListClass tp_svc_channel_type_room_list_get_listing_rooms_impl tp_svc_channel_type_room_list_implement_get_listing_rooms tp_svc_channel_type_room_list_return_from_get_listing_rooms tp_svc_channel_type_room_list_list_rooms_impl tp_svc_channel_type_room_list_implement_list_rooms tp_svc_channel_type_room_list_return_from_list_rooms tp_svc_channel_type_room_list_stop_listing_impl tp_svc_channel_type_room_list_implement_stop_listing tp_svc_channel_type_room_list_return_from_stop_listing tp_svc_channel_type_room_list_emit_got_rooms tp_svc_channel_type_room_list_emit_listing_rooms TP_SVC_CHANNEL_TYPE_ROOM_LIST TP_IS_SVC_CHANNEL_TYPE_ROOM_LIST TP_TYPE_SVC_CHANNEL_TYPE_ROOM_LIST tp_svc_channel_type_room_list_get_type TP_SVC_CHANNEL_TYPE_ROOM_LIST_GET_CLASS
svc-channel-contactlist svc-channel-contactlist telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeContactList TpSvcChannelTypeContactListClass TP_SVC_CHANNEL_TYPE_CONTACT_LIST TP_IS_SVC_CHANNEL_TYPE_CONTACT_LIST TP_TYPE_SVC_CHANNEL_TYPE_CONTACT_LIST tp_svc_channel_type_contact_list_get_type TP_SVC_CHANNEL_TYPE_CONTACT_LIST_GET_CLASS
svc-channel-group svc-channel-group telepathy-glib/telepathy-glib-dbus.h TpSvcChannelInterfaceGroup TpSvcChannelInterfaceGroupClass tp_svc_channel_interface_group_add_members_impl tp_svc_channel_interface_group_implement_add_members tp_svc_channel_interface_group_return_from_add_members tp_svc_channel_interface_group_get_all_members_impl tp_svc_channel_interface_group_implement_get_all_members tp_svc_channel_interface_group_return_from_get_all_members tp_svc_channel_interface_group_get_group_flags_impl tp_svc_channel_interface_group_implement_get_group_flags tp_svc_channel_interface_group_return_from_get_group_flags tp_svc_channel_interface_group_get_handle_owners_impl tp_svc_channel_interface_group_implement_get_handle_owners tp_svc_channel_interface_group_return_from_get_handle_owners tp_svc_channel_interface_group_get_local_pending_members_impl tp_svc_channel_interface_group_implement_get_local_pending_members tp_svc_channel_interface_group_return_from_get_local_pending_members tp_svc_channel_interface_group_get_local_pending_members_with_info_impl tp_svc_channel_interface_group_implement_get_local_pending_members_with_info tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info tp_svc_channel_interface_group_get_members_impl tp_svc_channel_interface_group_implement_get_members tp_svc_channel_interface_group_return_from_get_members tp_svc_channel_interface_group_get_remote_pending_members_impl tp_svc_channel_interface_group_implement_get_remote_pending_members tp_svc_channel_interface_group_return_from_get_remote_pending_members tp_svc_channel_interface_group_get_self_handle_impl tp_svc_channel_interface_group_implement_get_self_handle tp_svc_channel_interface_group_return_from_get_self_handle tp_svc_channel_interface_group_remove_members_impl tp_svc_channel_interface_group_implement_remove_members tp_svc_channel_interface_group_return_from_remove_members tp_svc_channel_interface_group_emit_group_flags_changed tp_svc_channel_interface_group_emit_members_changed tp_svc_channel_interface_group_emit_members_changed_detailed tp_svc_channel_interface_group_implement_remove_members_with_reason tp_svc_channel_interface_group_remove_members_with_reason_impl tp_svc_channel_interface_group_return_from_remove_members_with_reason tp_svc_channel_interface_group_emit_handle_owners_changed tp_svc_channel_interface_group_emit_self_handle_changed TP_SVC_CHANNEL_INTERFACE_GROUP TP_IS_SVC_CHANNEL_INTERFACE_GROUP TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP tp_svc_channel_interface_group_get_type TP_SVC_CHANNEL_INTERFACE_GROUP_GET_CLASS TpSvcChannelInterfaceConference TpSvcChannelInterfaceConferenceClass tp_svc_channel_interface_conference_emit_channel_merged tp_svc_channel_interface_conference_emit_channel_removed TP_IS_SVC_CHANNEL_INTERFACE_CONFERENCE TP_SVC_CHANNEL_INTERFACE_CONFERENCE TP_SVC_CHANNEL_INTERFACE_CONFERENCE_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_CONFERENCE tp_svc_channel_interface_conference_get_type
svc-channel-media svc-channel-media telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeStreamedMedia TpSvcChannelTypeStreamedMediaClass tp_svc_channel_type_streamed_media_list_streams_impl tp_svc_channel_type_streamed_media_implement_list_streams tp_svc_channel_type_streamed_media_return_from_list_streams tp_svc_channel_type_streamed_media_remove_streams_impl tp_svc_channel_type_streamed_media_implement_remove_streams tp_svc_channel_type_streamed_media_return_from_remove_streams tp_svc_channel_type_streamed_media_request_stream_direction_impl tp_svc_channel_type_streamed_media_implement_request_stream_direction tp_svc_channel_type_streamed_media_return_from_request_stream_direction tp_svc_channel_type_streamed_media_request_streams_impl tp_svc_channel_type_streamed_media_implement_request_streams tp_svc_channel_type_streamed_media_return_from_request_streams tp_svc_channel_type_streamed_media_emit_stream_added tp_svc_channel_type_streamed_media_emit_stream_direction_changed tp_svc_channel_type_streamed_media_emit_stream_error tp_svc_channel_type_streamed_media_emit_stream_removed tp_svc_channel_type_streamed_media_emit_stream_state_changed TP_SVC_CHANNEL_TYPE_STREAMED_MEDIA TP_IS_SVC_CHANNEL_TYPE_STREAMED_MEDIA TP_TYPE_SVC_CHANNEL_TYPE_STREAMED_MEDIA tp_svc_channel_type_streamed_media_get_type TP_SVC_CHANNEL_TYPE_STREAMED_MEDIA_GET_CLASS TpSvcChannelInterfaceCallState TpSvcChannelInterfaceCallStateClass tp_svc_channel_interface_call_state_emit_call_state_changed tp_svc_channel_interface_call_state_get_call_states_impl tp_svc_channel_interface_call_state_implement_get_call_states tp_svc_channel_interface_call_state_return_from_get_call_states TP_IS_SVC_CHANNEL_INTERFACE_CALL_STATE TP_SVC_CHANNEL_INTERFACE_CALL_STATE TP_SVC_CHANNEL_INTERFACE_CALL_STATE_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_CALL_STATE tp_svc_channel_interface_call_state_get_type TpSvcChannelInterfaceDTMF TpSvcChannelInterfaceDTMFClass tp_svc_channel_interface_dtmf_implement_multiple_tones tp_svc_channel_interface_dtmf_implement_start_tone tp_svc_channel_interface_dtmf_implement_stop_tone tp_svc_channel_interface_dtmf_return_from_multiple_tones tp_svc_channel_interface_dtmf_return_from_start_tone tp_svc_channel_interface_dtmf_return_from_stop_tone tp_svc_channel_interface_dtmf_multiple_tones_impl tp_svc_channel_interface_dtmf_start_tone_impl tp_svc_channel_interface_dtmf_stop_tone_impl tp_svc_channel_interface_dtmf_emit_sending_tones tp_svc_channel_interface_dtmf_emit_stopped_tones tp_svc_channel_interface_dtmf_emit_tones_deferred TP_SVC_CHANNEL_INTERFACE_DTMF TP_IS_SVC_CHANNEL_INTERFACE_DTMF TP_TYPE_SVC_CHANNEL_INTERFACE_DTMF tp_svc_channel_interface_dtmf_get_type TP_SVC_CHANNEL_INTERFACE_DTMF_GET_CLASS TpSvcChannelInterfaceHold TpSvcChannelInterfaceHoldClass tp_svc_channel_interface_hold_get_hold_state_impl tp_svc_channel_interface_hold_return_from_get_hold_state tp_svc_channel_interface_hold_implement_get_hold_state tp_svc_channel_interface_hold_request_hold_impl tp_svc_channel_interface_hold_return_from_request_hold tp_svc_channel_interface_hold_implement_request_hold tp_svc_channel_interface_hold_emit_hold_state_changed TP_IS_SVC_CHANNEL_INTERFACE_HOLD TP_SVC_CHANNEL_INTERFACE_HOLD TP_SVC_CHANNEL_INTERFACE_HOLD_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD tp_svc_channel_interface_hold_get_type TpSvcChannelInterfaceMediaSignalling TpSvcChannelInterfaceMediaSignallingClass tp_svc_channel_interface_media_signalling_get_session_handlers_impl tp_svc_channel_interface_media_signalling_implement_get_session_handlers tp_svc_channel_interface_media_signalling_return_from_get_session_handlers tp_svc_channel_interface_media_signalling_emit_new_session_handler TP_SVC_CHANNEL_INTERFACE_MEDIA_SIGNALLING TP_IS_SVC_CHANNEL_INTERFACE_MEDIA_SIGNALLING TP_TYPE_SVC_CHANNEL_INTERFACE_MEDIA_SIGNALLING tp_svc_channel_interface_media_signalling_get_type TP_SVC_CHANNEL_INTERFACE_MEDIA_SIGNALLING_GET_CLASS
svc-channel-call svc-channel-call telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeCall TpSvcChannelTypeCallClass tp_svc_channel_type_call_accept_impl tp_svc_channel_type_call_add_content_impl tp_svc_channel_type_call_emit_call_members_changed tp_svc_channel_type_call_emit_call_state_changed tp_svc_channel_type_call_emit_content_added tp_svc_channel_type_call_emit_content_removed tp_svc_channel_type_call_hangup_impl tp_svc_channel_type_call_implement_accept tp_svc_channel_type_call_implement_add_content tp_svc_channel_type_call_implement_hangup tp_svc_channel_type_call_implement_set_queued tp_svc_channel_type_call_implement_set_ringing tp_svc_channel_type_call_return_from_accept tp_svc_channel_type_call_return_from_add_content tp_svc_channel_type_call_return_from_hangup tp_svc_channel_type_call_return_from_set_queued tp_svc_channel_type_call_return_from_set_ringing tp_svc_channel_type_call_set_queued_impl tp_svc_channel_type_call_set_ringing_impl TP_TYPE_SVC_CHANNEL_TYPE_CALL TP_IS_SVC_CHANNEL_TYPE_CALL TP_SVC_CHANNEL_TYPE_CALL TP_SVC_CHANNEL_TYPE_CALL_GET_CLASS tp_svc_channel_type_call_get_type TpSvcCallContent TpSvcCallContentClass tp_svc_call_content_emit_streams_added tp_svc_call_content_emit_streams_removed tp_svc_call_content_implement_remove tp_svc_call_content_remove_impl tp_svc_call_content_return_from_remove tp_svc_call_content_get_type TP_SVC_CALL_CONTENT TP_SVC_CALL_CONTENT_GET_CLASS TP_IS_SVC_CALL_CONTENT TP_TYPE_SVC_CALL_CONTENT TpSvcCallContentInterfaceMedia TpSvcCallContentInterfaceMediaClass tp_svc_call_content_interface_media_acknowledge_dtmf_change_impl tp_svc_call_content_interface_media_emit_dtmf_change_requested tp_svc_call_content_interface_media_emit_local_media_description_changed tp_svc_call_content_interface_media_emit_media_description_offer_done tp_svc_call_content_interface_media_emit_media_descriptions_removed tp_svc_call_content_interface_media_emit_new_media_description_offer tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed tp_svc_call_content_interface_media_fail_impl tp_svc_call_content_interface_media_implement_acknowledge_dtmf_change tp_svc_call_content_interface_media_implement_fail tp_svc_call_content_interface_media_implement_update_local_media_description tp_svc_call_content_interface_media_return_from_acknowledge_dtmf_change tp_svc_call_content_interface_media_return_from_fail tp_svc_call_content_interface_media_return_from_update_local_media_description tp_svc_call_content_interface_media_update_local_media_description_impl tp_svc_call_content_interface_media_get_type TP_SVC_CALL_CONTENT_INTERFACE_MEDIA TP_SVC_CALL_CONTENT_INTERFACE_MEDIA_GET_CLASS TP_IS_SVC_CALL_CONTENT_INTERFACE_MEDIA TP_TYPE_SVC_CALL_CONTENT_INTERFACE_MEDIA TpSvcCallContentInterfaceVideoControl TpSvcCallContentInterfaceVideoControlClass tp_svc_call_content_interface_video_control_emit_bitrate_changed tp_svc_call_content_interface_video_control_emit_framerate_changed tp_svc_call_content_interface_video_control_emit_key_frame_requested tp_svc_call_content_interface_video_control_emit_mtu_changed tp_svc_call_content_interface_video_control_emit_video_resolution_changed tp_svc_call_content_interface_video_control_get_type TP_SVC_CALL_CONTENT_INTERFACE_VIDEO_CONTROL TP_SVC_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_GET_CLASS TP_IS_SVC_CALL_CONTENT_INTERFACE_VIDEO_CONTROL TP_TYPE_SVC_CALL_CONTENT_INTERFACE_VIDEO_CONTROL TpSvcCallContentInterfaceAudioControl TpSvcCallContentInterfaceAudioControlClass tp_svc_call_content_interface_audio_control_implement_report_input_volume tp_svc_call_content_interface_audio_control_implement_report_output_volume tp_svc_call_content_interface_audio_control_report_input_volume_impl tp_svc_call_content_interface_audio_control_report_output_volume_impl tp_svc_call_content_interface_audio_control_return_from_report_input_volume tp_svc_call_content_interface_audio_control_return_from_report_output_volume tp_svc_call_content_interface_audio_control_get_type TP_IS_SVC_CALL_CONTENT_INTERFACE_AUDIO_CONTROL TP_SVC_CALL_CONTENT_INTERFACE_AUDIO_CONTROL TP_SVC_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_GET_CLASS TP_TYPE_SVC_CALL_CONTENT_INTERFACE_AUDIO_CONTROL TpSvcCallContentInterfaceDTMF TpSvcCallContentInterfaceDTMFClass tp_svc_call_content_interface_dtmf_emit_sending_tones tp_svc_call_content_interface_dtmf_emit_stopped_tones tp_svc_call_content_interface_dtmf_emit_tones_deferred tp_svc_call_content_interface_dtmf_implement_multiple_tones tp_svc_call_content_interface_dtmf_implement_start_tone tp_svc_call_content_interface_dtmf_implement_stop_tone tp_svc_call_content_interface_dtmf_multiple_tones_impl tp_svc_call_content_interface_dtmf_return_from_multiple_tones tp_svc_call_content_interface_dtmf_return_from_start_tone tp_svc_call_content_interface_dtmf_return_from_stop_tone tp_svc_call_content_interface_dtmf_start_tone_impl tp_svc_call_content_interface_dtmf_stop_tone_impl tp_svc_call_content_interface_dtmf_get_type TP_IS_SVC_CALL_CONTENT_INTERFACE_DTMF TP_SVC_CALL_CONTENT_INTERFACE_DTMF TP_SVC_CALL_CONTENT_INTERFACE_DTMF_GET_CLASS TP_TYPE_SVC_CALL_CONTENT_INTERFACE_DTMF TpSvcCallContentMediaDescription TpSvcCallContentMediaDescriptionClass tp_svc_call_content_media_description_accept_impl tp_svc_call_content_media_description_implement_accept tp_svc_call_content_media_description_implement_reject tp_svc_call_content_media_description_return_from_accept tp_svc_call_content_media_description_return_from_reject tp_svc_call_content_media_description_reject_impl tp_svc_call_content_media_description_get_type TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_GET_CLASS TP_IS_SVC_CALL_CONTENT_MEDIA_DESCRIPTION TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReports TpSvcCallContentMediaDescriptionInterfaceRTCPExtendedReportsClass tp_svc_call_content_media_description_interface_rtcp_extended_reports_get_type TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_GET_CLASS TP_IS_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS TpSvcCallContentMediaDescriptionInterfaceRTCPFeedback TpSvcCallContentMediaDescriptionInterfaceRTCPFeedbackClass tp_svc_call_content_media_description_interface_rtcp_feedback_get_type TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_GET_CLASS TP_IS_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensions TpSvcCallContentMediaDescriptionInterfaceRTPHeaderExtensionsClass tp_svc_call_content_media_description_interface_rtp_header_extensions_get_type TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS TP_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS_GET_CLASS TP_IS_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS TpSvcCallStream TpSvcCallStreamClass tp_svc_call_stream_implement_request_receiving tp_svc_call_stream_implement_set_sending tp_svc_call_stream_emit_local_sending_state_changed tp_svc_call_stream_emit_remote_members_changed tp_svc_call_stream_request_receiving_impl tp_svc_call_stream_return_from_request_receiving tp_svc_call_stream_return_from_set_sending tp_svc_call_stream_set_sending_impl tp_svc_call_stream_get_type TP_TYPE_SVC_CALL_STREAM TP_SVC_CALL_STREAM TP_SVC_CALL_STREAM_GET_CLASS TP_IS_SVC_CALL_STREAM TpSvcCallStreamInterfaceMedia TpSvcCallStreamInterfaceMediaClass tp_svc_call_stream_interface_media_add_candidates_impl tp_svc_call_stream_interface_media_complete_receiving_state_change_impl tp_svc_call_stream_interface_media_complete_sending_state_change_impl tp_svc_call_stream_interface_media_emit_endpoints_changed tp_svc_call_stream_interface_media_emit_ice_restart_requested tp_svc_call_stream_interface_media_emit_local_candidates_added tp_svc_call_stream_interface_media_emit_local_credentials_changed tp_svc_call_stream_interface_media_emit_receiving_state_changed tp_svc_call_stream_interface_media_emit_relay_info_changed tp_svc_call_stream_interface_media_emit_sending_state_changed tp_svc_call_stream_interface_media_emit_server_info_retrieved tp_svc_call_stream_interface_media_emit_stun_servers_changed tp_svc_call_stream_interface_media_fail_impl tp_svc_call_stream_interface_media_finish_initial_candidates_impl tp_svc_call_stream_interface_media_implement_add_candidates tp_svc_call_stream_interface_media_implement_complete_receiving_state_change tp_svc_call_stream_interface_media_implement_complete_sending_state_change tp_svc_call_stream_interface_media_implement_fail tp_svc_call_stream_interface_media_implement_finish_initial_candidates tp_svc_call_stream_interface_media_implement_report_receiving_failure tp_svc_call_stream_interface_media_implement_report_sending_failure tp_svc_call_stream_interface_media_implement_set_credentials tp_svc_call_stream_interface_media_report_receiving_failure_impl tp_svc_call_stream_interface_media_report_sending_failure_impl tp_svc_call_stream_interface_media_return_from_add_candidates tp_svc_call_stream_interface_media_return_from_complete_receiving_state_change tp_svc_call_stream_interface_media_return_from_complete_sending_state_change tp_svc_call_stream_interface_media_return_from_fail tp_svc_call_stream_interface_media_return_from_finish_initial_candidates tp_svc_call_stream_interface_media_return_from_report_receiving_failure tp_svc_call_stream_interface_media_return_from_report_sending_failure tp_svc_call_stream_interface_media_return_from_set_credentials tp_svc_call_stream_interface_media_set_credentials_impl TP_SVC_CALL_STREAM_INTERFACE_MEDIA TP_SVC_CALL_STREAM_INTERFACE_MEDIA_GET_CLASS TP_TYPE_SVC_CALL_STREAM_INTERFACE_MEDIA TP_IS_SVC_CALL_STREAM_INTERFACE_MEDIA tp_svc_call_stream_interface_media_get_type TpSvcCallStreamEndpoint TpSvcCallStreamEndpointClass tp_svc_call_stream_endpoint_accept_selected_candidate_pair_impl tp_svc_call_stream_endpoint_emit_candidate_pair_selected tp_svc_call_stream_endpoint_emit_controlling_changed tp_svc_call_stream_endpoint_emit_endpoint_state_changed tp_svc_call_stream_endpoint_emit_remote_candidates_added tp_svc_call_stream_endpoint_emit_remote_credentials_set tp_svc_call_stream_endpoint_implement_accept_selected_candidate_pair tp_svc_call_stream_endpoint_implement_reject_selected_candidate_pair tp_svc_call_stream_endpoint_implement_set_controlling tp_svc_call_stream_endpoint_implement_set_endpoint_state tp_svc_call_stream_endpoint_implement_set_selected_candidate_pair tp_svc_call_stream_endpoint_reject_selected_candidate_pair_impl tp_svc_call_stream_endpoint_return_from_accept_selected_candidate_pair tp_svc_call_stream_endpoint_return_from_reject_selected_candidate_pair tp_svc_call_stream_endpoint_return_from_set_controlling tp_svc_call_stream_endpoint_return_from_set_endpoint_state tp_svc_call_stream_endpoint_return_from_set_selected_candidate_pair tp_svc_call_stream_endpoint_set_controlling_impl tp_svc_call_stream_endpoint_set_endpoint_state_impl tp_svc_call_stream_endpoint_set_selected_candidate_pair_impl tp_svc_call_stream_endpoint_get_type TP_IS_SVC_CALL_STREAM_ENDPOINT TP_SVC_CALL_STREAM_ENDPOINT TP_SVC_CALL_STREAM_ENDPOINT_GET_CLASS TP_TYPE_SVC_CALL_STREAM_ENDPOINT
svc-anonymity svc-anonymity telepathy-glib/telepathy-glib-dbus.h TpSvcConnectionInterfaceAnonymity TpSvcConnectionInterfaceAnonymityClass tp_svc_connection_interface_anonymity_emit_anonymity_modes_changed TpSvcChannelInterfaceAnonymity TpSvcChannelInterfaceAnonymityClass tp_svc_channel_interface_anonymity_get_type TP_IS_SVC_CHANNEL_INTERFACE_ANONYMITY TP_SVC_CHANNEL_INTERFACE_ANONYMITY TP_SVC_CHANNEL_INTERFACE_ANONYMITY_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_ANONYMITY TP_IS_SVC_CONNECTION_INTERFACE_ANONYMITY TP_SVC_CONNECTION_INTERFACE_ANONYMITY TP_SVC_CONNECTION_INTERFACE_ANONYMITY_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_ANONYMITY tp_svc_connection_interface_anonymity_get_type
svc-service-point svc-service-point telepathy-glib/telepathy-glib-dbus.h TpSvcConnectionInterfaceServicePoint TpSvcConnectionInterfaceServicePointClass tp_svc_connection_interface_service_point_emit_service_points_changed TpSvcChannelInterfaceServicePoint TpSvcChannelInterfaceServicePointClass tp_svc_channel_interface_service_point_emit_service_point_changed tp_svc_channel_interface_service_point_get_type TP_IS_SVC_CHANNEL_INTERFACE_SERVICE_POINT TP_SVC_CHANNEL_INTERFACE_SERVICE_POINT TP_SVC_CHANNEL_INTERFACE_SERVICE_POINT_GET_CLASS TP_TYPE_SVC_CHANNEL_INTERFACE_SERVICE_POINT TP_IS_SVC_CONNECTION_INTERFACE_SERVICE_POINT TP_SVC_CONNECTION_INTERFACE_SERVICE_POINT TP_SVC_CONNECTION_INTERFACE_SERVICE_POINT_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_SERVICE_POINT tp_svc_connection_interface_service_point_get_type
svc-connection telepathy-glib/telepathy-glib-dbus.h svc-connection TpSvcConnection TpSvcConnectionClass tp_svc_connection_connect_impl tp_svc_connection_implement_connect tp_svc_connection_return_from_connect tp_svc_connection_disconnect_impl tp_svc_connection_implement_disconnect tp_svc_connection_return_from_disconnect tp_svc_connection_get_interfaces_impl tp_svc_connection_implement_get_interfaces tp_svc_connection_return_from_get_interfaces tp_svc_connection_get_protocol_impl tp_svc_connection_implement_get_protocol tp_svc_connection_return_from_get_protocol tp_svc_connection_get_self_handle_impl tp_svc_connection_implement_get_self_handle tp_svc_connection_return_from_get_self_handle tp_svc_connection_get_status_impl tp_svc_connection_implement_get_status tp_svc_connection_return_from_get_status tp_svc_connection_hold_handles_impl tp_svc_connection_implement_hold_handles tp_svc_connection_return_from_hold_handles tp_svc_connection_inspect_handles_impl tp_svc_connection_implement_inspect_handles tp_svc_connection_return_from_inspect_handles tp_svc_connection_list_channels_impl tp_svc_connection_implement_list_channels tp_svc_connection_return_from_list_channels tp_svc_connection_release_handles_impl tp_svc_connection_implement_release_handles tp_svc_connection_return_from_release_handles tp_svc_connection_request_channel_impl tp_svc_connection_implement_request_channel tp_svc_connection_return_from_request_channel tp_svc_connection_request_handles_impl tp_svc_connection_implement_request_handles tp_svc_connection_return_from_request_handles tp_svc_connection_emit_new_channel tp_svc_connection_emit_self_handle_changed tp_svc_connection_emit_self_contact_changed tp_svc_connection_emit_status_changed tp_svc_connection_emit_connection_error tp_svc_connection_add_client_interest_impl tp_svc_connection_implement_add_client_interest tp_svc_connection_implement_remove_client_interest tp_svc_connection_remove_client_interest_impl tp_svc_connection_return_from_add_client_interest tp_svc_connection_return_from_remove_client_interest TP_SVC_CONNECTION TP_IS_SVC_CONNECTION TP_TYPE_SVC_CONNECTION tp_svc_connection_get_type TP_SVC_CONNECTION_GET_CLASS TpSvcConnectionInterfaceContacts TpSvcConnectionInterfaceContactsClass tp_svc_connection_interface_contacts_get_contact_attributes_impl tp_svc_connection_interface_contacts_implement_get_contact_attributes tp_svc_connection_interface_contacts_return_from_get_contact_attributes tp_svc_connection_interface_contacts_get_contact_by_id_impl tp_svc_connection_interface_contacts_implement_get_contact_by_id tp_svc_connection_interface_contacts_return_from_get_contact_by_id TP_IS_SVC_CONNECTION_INTERFACE_CONTACTS TP_SVC_CONNECTION_INTERFACE_CONTACTS TP_SVC_CONNECTION_INTERFACE_CONTACTS_GET_CLASS tp_svc_connection_interface_contacts_get_type TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS TpSvcConnectionInterfaceRequests TpSvcConnectionInterfaceRequestsClass tp_svc_connection_interface_requests_create_channel_impl tp_svc_connection_interface_requests_emit_channel_closed tp_svc_connection_interface_requests_emit_new_channels tp_svc_connection_interface_requests_ensure_channel_impl tp_svc_connection_interface_requests_implement_create_channel tp_svc_connection_interface_requests_implement_ensure_channel tp_svc_connection_interface_requests_return_from_create_channel tp_svc_connection_interface_requests_return_from_ensure_channel TP_IS_SVC_CONNECTION_INTERFACE_REQUESTS TP_SVC_CONNECTION_INTERFACE_REQUESTS TP_SVC_CONNECTION_INTERFACE_REQUESTS_GET_CLASS tp_svc_connection_interface_requests_get_type TP_TYPE_SVC_CONNECTION_INTERFACE_REQUESTS TpSvcConnectionInterfaceSimplePresence TpSvcConnectionInterfaceSimplePresenceClass tp_svc_connection_interface_simple_presence_emit_presences_changed tp_svc_connection_interface_simple_presence_get_presences_impl tp_svc_connection_interface_simple_presence_implement_get_presences tp_svc_connection_interface_simple_presence_implement_set_presence tp_svc_connection_interface_simple_presence_return_from_get_presences tp_svc_connection_interface_simple_presence_return_from_set_presence tp_svc_connection_interface_simple_presence_set_presence_impl TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE TP_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE TP_IS_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE tp_svc_connection_interface_simple_presence_get_type TP_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE_GET_CLASS TpSvcConnectionInterfacePresence TpSvcConnectionInterfacePresenceClass tp_svc_connection_interface_presence_add_status_impl tp_svc_connection_interface_presence_implement_add_status tp_svc_connection_interface_presence_return_from_add_status tp_svc_connection_interface_presence_clear_status_impl tp_svc_connection_interface_presence_implement_clear_status tp_svc_connection_interface_presence_return_from_clear_status tp_svc_connection_interface_presence_get_presence_impl tp_svc_connection_interface_presence_implement_get_presence tp_svc_connection_interface_presence_return_from_get_presence tp_svc_connection_interface_presence_get_statuses_impl tp_svc_connection_interface_presence_implement_get_statuses tp_svc_connection_interface_presence_return_from_get_statuses tp_svc_connection_interface_presence_remove_status_impl tp_svc_connection_interface_presence_implement_remove_status tp_svc_connection_interface_presence_return_from_remove_status tp_svc_connection_interface_presence_request_presence_impl tp_svc_connection_interface_presence_implement_request_presence tp_svc_connection_interface_presence_return_from_request_presence tp_svc_connection_interface_presence_set_last_activity_time_impl tp_svc_connection_interface_presence_implement_set_last_activity_time tp_svc_connection_interface_presence_return_from_set_last_activity_time tp_svc_connection_interface_presence_set_status_impl tp_svc_connection_interface_presence_implement_set_status tp_svc_connection_interface_presence_return_from_set_status tp_svc_connection_interface_presence_emit_presence_update TP_SVC_CONNECTION_INTERFACE_PRESENCE TP_IS_SVC_CONNECTION_INTERFACE_PRESENCE TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE tp_svc_connection_interface_presence_get_type TP_SVC_CONNECTION_INTERFACE_PRESENCE_GET_CLASS TpSvcConnectionInterfaceAvatars TpSvcConnectionInterfaceAvatarsClass tp_svc_connection_interface_avatars_clear_avatar_impl tp_svc_connection_interface_avatars_implement_clear_avatar tp_svc_connection_interface_avatars_return_from_clear_avatar tp_svc_connection_interface_avatars_get_avatar_requirements_impl tp_svc_connection_interface_avatars_implement_get_avatar_requirements tp_svc_connection_interface_avatars_return_from_get_avatar_requirements tp_svc_connection_interface_avatars_get_avatar_tokens_impl tp_svc_connection_interface_avatars_implement_get_avatar_tokens tp_svc_connection_interface_avatars_return_from_get_avatar_tokens tp_svc_connection_interface_avatars_request_avatar_impl tp_svc_connection_interface_avatars_implement_request_avatar tp_svc_connection_interface_avatars_return_from_request_avatar tp_svc_connection_interface_avatars_set_avatar_impl tp_svc_connection_interface_avatars_implement_set_avatar tp_svc_connection_interface_avatars_return_from_set_avatar tp_svc_connection_interface_avatars_emit_avatar_updated tp_svc_connection_interface_avatars_emit_avatar_retrieved tp_svc_connection_interface_avatars_implement_request_avatars tp_svc_connection_interface_avatars_request_avatars_impl tp_svc_connection_interface_avatars_return_from_request_avatars tp_svc_connection_interface_avatars_get_known_avatar_tokens_impl tp_svc_connection_interface_avatars_implement_get_known_avatar_tokens tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens TP_SVC_CONNECTION_INTERFACE_AVATARS TP_IS_SVC_CONNECTION_INTERFACE_AVATARS TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS tp_svc_connection_interface_avatars_get_type TP_SVC_CONNECTION_INTERFACE_AVATARS_GET_CLASS TpSvcConnectionInterfaceAliasing TpSvcConnectionInterfaceAliasingClass tp_svc_connection_interface_aliasing_get_alias_flags_impl tp_svc_connection_interface_aliasing_implement_get_alias_flags tp_svc_connection_interface_aliasing_return_from_get_alias_flags tp_svc_connection_interface_aliasing_request_aliases_impl tp_svc_connection_interface_aliasing_implement_request_aliases tp_svc_connection_interface_aliasing_return_from_request_aliases tp_svc_connection_interface_aliasing_get_aliases_impl tp_svc_connection_interface_aliasing_implement_get_aliases tp_svc_connection_interface_aliasing_return_from_get_aliases tp_svc_connection_interface_aliasing_set_aliases_impl tp_svc_connection_interface_aliasing_implement_set_aliases tp_svc_connection_interface_aliasing_return_from_set_aliases tp_svc_connection_interface_aliasing_emit_aliases_changed TP_SVC_CONNECTION_INTERFACE_ALIASING TP_IS_SVC_CONNECTION_INTERFACE_ALIASING TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING tp_svc_connection_interface_aliasing_get_type TP_SVC_CONNECTION_INTERFACE_ALIASING_GET_CLASS TpSvcConnectionInterfaceBalance TpSvcConnectionInterfaceBalanceClass tp_svc_connection_interface_balance_emit_balance_changed TP_SVC_CONNECTION_INTERFACE_BALANCE TP_IS_SVC_CONNECTION_INTERFACE_BALANCE TP_TYPE_SVC_CONNECTION_INTERFACE_BALANCE tp_svc_connection_interface_balance_get_type TP_SVC_CONNECTION_INTERFACE_BALANCE_GET_CLASS TpSvcConnectionInterfaceCapabilities TpSvcConnectionInterfaceCapabilitiesClass tp_svc_connection_interface_capabilities_advertise_capabilities_impl tp_svc_connection_interface_capabilities_implement_advertise_capabilities tp_svc_connection_interface_capabilities_return_from_advertise_capabilities tp_svc_connection_interface_capabilities_get_capabilities_impl tp_svc_connection_interface_capabilities_implement_get_capabilities tp_svc_connection_interface_capabilities_return_from_get_capabilities tp_svc_connection_interface_capabilities_emit_capabilities_changed TP_SVC_CONNECTION_INTERFACE_CAPABILITIES TP_IS_SVC_CONNECTION_INTERFACE_CAPABILITIES TP_TYPE_SVC_CONNECTION_INTERFACE_CAPABILITIES tp_svc_connection_interface_capabilities_get_type TP_SVC_CONNECTION_INTERFACE_CAPABILITIES_GET_CLASS TpSvcConnectionInterfaceContactCapabilities TpSvcConnectionInterfaceContactCapabilitiesClass tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed tp_svc_connection_interface_contact_capabilities_get_contact_capabilities_impl tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities tp_svc_connection_interface_contact_capabilities_implement_get_contact_capabilities tp_svc_connection_interface_contact_capabilities_update_capabilities_impl tp_svc_connection_interface_contact_capabilities_return_from_update_capabilities tp_svc_connection_interface_contact_capabilities_implement_update_capabilities TP_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES tp_svc_connection_interface_contact_capabilities_get_type TP_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_GET_CLASS TpSvcConnectionInterfaceLocation TpSvcConnectionInterfaceLocationClass tp_svc_connection_interface_location_emit_location_updated tp_svc_connection_interface_location_get_locations_impl tp_svc_connection_interface_location_return_from_get_locations tp_svc_connection_interface_location_implement_get_locations tp_svc_connection_interface_location_request_location_impl tp_svc_connection_interface_location_return_from_request_location tp_svc_connection_interface_location_implement_request_location tp_svc_connection_interface_location_set_location_impl tp_svc_connection_interface_location_return_from_set_location tp_svc_connection_interface_location_implement_set_location TP_IS_SVC_CONNECTION_INTERFACE_LOCATION TP_SVC_CONNECTION_INTERFACE_LOCATION TP_SVC_CONNECTION_INTERFACE_LOCATION_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_LOCATION tp_svc_connection_interface_location_get_type TpSvcConnectionInterfaceContactInfo TpSvcConnectionInterfaceContactInfoClass tp_svc_connection_interface_contact_info_emit_contact_info_changed tp_svc_connection_interface_contact_info_get_contact_info_impl tp_svc_connection_interface_contact_info_implement_get_contact_info tp_svc_connection_interface_contact_info_implement_refresh_contact_info tp_svc_connection_interface_contact_info_implement_request_contact_info tp_svc_connection_interface_contact_info_implement_set_contact_info tp_svc_connection_interface_contact_info_refresh_contact_info_impl tp_svc_connection_interface_contact_info_request_contact_info_impl tp_svc_connection_interface_contact_info_return_from_get_contact_info tp_svc_connection_interface_contact_info_return_from_refresh_contact_info tp_svc_connection_interface_contact_info_return_from_request_contact_info tp_svc_connection_interface_contact_info_return_from_set_contact_info tp_svc_connection_interface_contact_info_set_contact_info_impl tp_svc_connection_interface_contact_info_get_type TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_INFO TP_SVC_CONNECTION_INTERFACE_CONTACT_INFO TP_SVC_CONNECTION_INTERFACE_CONTACT_INFO_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO TpSvcConnectionInterfaceContactBlocking TpSvcConnectionInterfaceContactBlockingClass tp_svc_connection_interface_contact_blocking_block_contacts_impl tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed tp_svc_connection_interface_contact_blocking_implement_block_contacts tp_svc_connection_interface_contact_blocking_implement_request_blocked_contacts tp_svc_connection_interface_contact_blocking_implement_unblock_contacts tp_svc_connection_interface_contact_blocking_request_blocked_contacts_impl tp_svc_connection_interface_contact_blocking_return_from_block_contacts tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts tp_svc_connection_interface_contact_blocking_return_from_unblock_contacts tp_svc_connection_interface_contact_blocking_unblock_contacts_impl TpSvcConnectionInterfaceContactGroups TpSvcConnectionInterfaceContactGroupsClass tp_svc_connection_interface_contact_groups_add_to_group_impl tp_svc_connection_interface_contact_groups_emit_group_renamed tp_svc_connection_interface_contact_groups_emit_groups_changed tp_svc_connection_interface_contact_groups_emit_groups_created tp_svc_connection_interface_contact_groups_emit_groups_removed tp_svc_connection_interface_contact_groups_implement_add_to_group tp_svc_connection_interface_contact_groups_implement_remove_from_group tp_svc_connection_interface_contact_groups_implement_remove_group tp_svc_connection_interface_contact_groups_implement_rename_group tp_svc_connection_interface_contact_groups_implement_set_contact_groups tp_svc_connection_interface_contact_groups_implement_set_group_members tp_svc_connection_interface_contact_groups_remove_from_group_impl tp_svc_connection_interface_contact_groups_remove_group_impl tp_svc_connection_interface_contact_groups_rename_group_impl tp_svc_connection_interface_contact_groups_return_from_add_to_group tp_svc_connection_interface_contact_groups_return_from_remove_from_group tp_svc_connection_interface_contact_groups_return_from_remove_group tp_svc_connection_interface_contact_groups_return_from_rename_group tp_svc_connection_interface_contact_groups_return_from_set_contact_groups tp_svc_connection_interface_contact_groups_return_from_set_group_members tp_svc_connection_interface_contact_groups_set_contact_groups_impl tp_svc_connection_interface_contact_groups_set_group_members_impl TpSvcConnectionInterfaceContactList TpSvcConnectionInterfaceContactListClass tp_svc_connection_interface_contact_list_authorize_publication_impl tp_svc_connection_interface_contact_list_download_impl tp_svc_connection_interface_contact_list_emit_contacts_changed tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id tp_svc_connection_interface_contact_list_emit_contact_list_state_changed tp_svc_connection_interface_contact_list_get_contact_list_attributes_impl tp_svc_connection_interface_contact_list_implement_authorize_publication tp_svc_connection_interface_contact_list_implement_download tp_svc_connection_interface_contact_list_implement_get_contact_list_attributes tp_svc_connection_interface_contact_list_implement_remove_contacts tp_svc_connection_interface_contact_list_implement_request_subscription tp_svc_connection_interface_contact_list_implement_unpublish tp_svc_connection_interface_contact_list_implement_unsubscribe tp_svc_connection_interface_contact_list_remove_contacts_impl tp_svc_connection_interface_contact_list_request_subscription_impl tp_svc_connection_interface_contact_list_return_from_authorize_publication tp_svc_connection_interface_contact_list_return_from_download tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes tp_svc_connection_interface_contact_list_return_from_remove_contacts tp_svc_connection_interface_contact_list_return_from_request_subscription tp_svc_connection_interface_contact_list_return_from_unpublish tp_svc_connection_interface_contact_list_return_from_unsubscribe tp_svc_connection_interface_contact_list_unpublish_impl tp_svc_connection_interface_contact_list_unsubscribe_impl tp_svc_connection_interface_contact_blocking_get_type tp_svc_connection_interface_contact_list_get_type tp_svc_connection_interface_contact_groups_get_type TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_LIST TP_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING TP_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING_GET_CLASS TP_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS TP_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS_GET_CLASS TP_SVC_CONNECTION_INTERFACE_CONTACT_LIST TP_SVC_CONNECTION_INTERFACE_CONTACT_LIST_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST TpSvcConnectionInterfaceCellular TpSvcConnectionInterfaceCellularClass tp_svc_connection_interface_cellular_emit_imsi_changed TP_IS_SVC_CONNECTION_INTERFACE_CELLULAR TP_SVC_CONNECTION_INTERFACE_CELLULAR TP_SVC_CONNECTION_INTERFACE_CELLULAR_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_CELLULAR tp_svc_connection_interface_cellular_get_type TpSvcConnectionInterfaceClientTypes TpSvcConnectionInterfaceClientTypesClass tp_svc_connection_interface_client_types_emit_client_types_updated tp_svc_connection_interface_client_types_get_client_types_impl tp_svc_connection_interface_client_types_implement_get_client_types tp_svc_connection_interface_client_types_implement_request_client_types tp_svc_connection_interface_client_types_request_client_types_impl tp_svc_connection_interface_client_types_return_from_get_client_types tp_svc_connection_interface_client_types_return_from_request_client_types tp_svc_connection_interface_client_types_get_type TP_IS_SVC_CONNECTION_INTERFACE_CLIENT_TYPES TP_SVC_CONNECTION_INTERFACE_CLIENT_TYPES TP_SVC_CONNECTION_INTERFACE_CLIENT_TYPES_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_CLIENT_TYPES TpSvcConnectionInterfaceMailNotification TpSvcConnectionInterfaceMailNotificationClass tp_svc_connection_interface_mail_notification_emit_mails_received tp_svc_connection_interface_mail_notification_emit_unread_mails_changed tp_svc_connection_interface_mail_notification_implement_request_inbox_url tp_svc_connection_interface_mail_notification_implement_request_mail_url tp_svc_connection_interface_mail_notification_request_inbox_url_impl tp_svc_connection_interface_mail_notification_request_mail_url_impl tp_svc_connection_interface_mail_notification_return_from_request_inbox_url tp_svc_connection_interface_mail_notification_return_from_request_mail_url TP_IS_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION TP_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION TP_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_MAIL_NOTIFICATION tp_svc_connection_interface_mail_notification_get_type TpSvcConnectionInterfacePowerSaving TpSvcConnectionInterfacePowerSavingClass tp_svc_connection_interface_power_saving_emit_power_saving_changed tp_svc_connection_interface_power_saving_implement_set_power_saving tp_svc_connection_interface_power_saving_return_from_set_power_saving tp_svc_connection_interface_power_saving_set_power_saving_impl tp_svc_connection_interface_power_saving_get_type TP_IS_SVC_CONNECTION_INTERFACE_POWER_SAVING TP_SVC_CONNECTION_INTERFACE_POWER_SAVING TP_SVC_CONNECTION_INTERFACE_POWER_SAVING_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_POWER_SAVING TpSvcConnectionInterfaceAddressing TpSvcConnectionInterfaceAddressingClass tp_svc_connection_interface_addressing_get_contacts_by_uri_impl tp_svc_connection_interface_addressing_get_contacts_by_vcard_field_impl tp_svc_connection_interface_addressing_implement_get_contacts_by_uri tp_svc_connection_interface_addressing_implement_get_contacts_by_vcard_field tp_svc_connection_interface_addressing_return_from_get_contacts_by_uri tp_svc_connection_interface_addressing_return_from_get_contacts_by_vcard_field TP_IS_SVC_CONNECTION_INTERFACE_ADDRESSING TP_SVC_CONNECTION_INTERFACE_ADDRESSING TP_SVC_CONNECTION_INTERFACE_ADDRESSING_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_ADDRESSING tp_svc_connection_interface_addressing_get_type TpSvcConnectionInterfaceRenaming TpSvcConnectionInterfaceRenamingClass tp_svc_connection_interface_renaming_emit_renamed tp_svc_connection_interface_renaming_implement_request_rename tp_svc_connection_interface_renaming_request_rename_impl tp_svc_connection_interface_renaming_return_from_request_rename TP_IS_SVC_CONNECTION_INTERFACE_RENAMING TP_SVC_CONNECTION_INTERFACE_RENAMING TP_SVC_CONNECTION_INTERFACE_RENAMING_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_RENAMING tp_svc_connection_interface_renaming_get_type TpSvcConnectionInterfaceSidecars1 TpSvcConnectionInterfaceSidecars1Class tp_svc_connection_interface_sidecars1_ensure_sidecar_impl tp_svc_connection_interface_sidecars1_implement_ensure_sidecar tp_svc_connection_interface_sidecars1_return_from_ensure_sidecar TP_IS_SVC_CONNECTION_INTERFACE_SIDECARS1 TP_SVC_CONNECTION_INTERFACE_SIDECARS1 TP_SVC_CONNECTION_INTERFACE_SIDECARS1_GET_CLASS TP_TYPE_SVC_CONNECTION_INTERFACE_SIDECARS1 tp_svc_connection_interface_sidecars1_get_type
svc-media-interfaces telepathy-glib/telepathy-glib-dbus.h svc-media-interfaces TpSvcMediaSessionHandler TpSvcMediaSessionHandlerClass tp_svc_media_session_handler_error_impl tp_svc_media_session_handler_implement_error tp_svc_media_session_handler_return_from_error tp_svc_media_session_handler_ready_impl tp_svc_media_session_handler_implement_ready tp_svc_media_session_handler_return_from_ready tp_svc_media_session_handler_emit_new_stream_handler TP_SVC_MEDIA_SESSION_HANDLER TP_IS_SVC_MEDIA_SESSION_HANDLER TP_TYPE_SVC_MEDIA_SESSION_HANDLER tp_svc_media_session_handler_get_type TP_SVC_MEDIA_SESSION_HANDLER_GET_CLASS TpSvcMediaStreamHandler TpSvcMediaStreamHandlerClass tp_svc_media_stream_handler_codec_choice_impl tp_svc_media_stream_handler_implement_codec_choice tp_svc_media_stream_handler_return_from_codec_choice tp_svc_media_stream_handler_error_impl tp_svc_media_stream_handler_implement_error tp_svc_media_stream_handler_return_from_error tp_svc_media_stream_handler_native_candidates_prepared_impl tp_svc_media_stream_handler_implement_native_candidates_prepared tp_svc_media_stream_handler_return_from_native_candidates_prepared tp_svc_media_stream_handler_new_active_candidate_pair_impl tp_svc_media_stream_handler_implement_new_active_candidate_pair tp_svc_media_stream_handler_return_from_new_active_candidate_pair tp_svc_media_stream_handler_new_native_candidate_impl tp_svc_media_stream_handler_implement_new_native_candidate tp_svc_media_stream_handler_return_from_new_native_candidate tp_svc_media_stream_handler_ready_impl tp_svc_media_stream_handler_implement_ready tp_svc_media_stream_handler_return_from_ready tp_svc_media_stream_handler_set_local_codecs_impl tp_svc_media_stream_handler_implement_set_local_codecs tp_svc_media_stream_handler_return_from_set_local_codecs tp_svc_media_stream_handler_stream_state_impl tp_svc_media_stream_handler_implement_stream_state tp_svc_media_stream_handler_return_from_stream_state tp_svc_media_stream_handler_supported_codecs_impl tp_svc_media_stream_handler_implement_supported_codecs tp_svc_media_stream_handler_return_from_supported_codecs tp_svc_media_stream_handler_emit_add_remote_candidate tp_svc_media_stream_handler_emit_close tp_svc_media_stream_handler_emit_remove_remote_candidate tp_svc_media_stream_handler_emit_set_active_candidate_pair tp_svc_media_stream_handler_emit_set_remote_candidate_list tp_svc_media_stream_handler_emit_set_remote_codecs tp_svc_media_stream_handler_emit_set_stream_playing tp_svc_media_stream_handler_emit_set_stream_sending tp_svc_media_stream_handler_emit_start_telephony_event tp_svc_media_stream_handler_emit_stop_telephony_event tp_svc_media_stream_handler_emit_set_stream_held tp_svc_media_stream_handler_hold_state_impl tp_svc_media_stream_handler_implement_hold_state tp_svc_media_stream_handler_implement_unhold_failure tp_svc_media_stream_handler_return_from_hold_state tp_svc_media_stream_handler_return_from_unhold_failure tp_svc_media_stream_handler_unhold_failure_impl tp_svc_media_stream_handler_codecs_updated_impl tp_svc_media_stream_handler_implement_codecs_updated tp_svc_media_stream_handler_return_from_codecs_updated tp_svc_media_stream_handler_emit_start_named_telephony_event tp_svc_media_stream_handler_emit_start_sound_telephony_event tp_svc_media_stream_handler_implement_new_active_transport_pair tp_svc_media_stream_handler_new_active_transport_pair_impl tp_svc_media_stream_handler_return_from_new_active_transport_pair tp_svc_media_stream_handler_emit_set_remote_feedback_messages tp_svc_media_stream_handler_emit_set_remote_header_extensions tp_svc_media_stream_handler_implement_supported_feedback_messages tp_svc_media_stream_handler_implement_supported_header_extensions tp_svc_media_stream_handler_return_from_supported_feedback_messages tp_svc_media_stream_handler_return_from_supported_header_extensions tp_svc_media_stream_handler_supported_feedback_messages_impl tp_svc_media_stream_handler_supported_header_extensions_impl TP_SVC_MEDIA_STREAM_HANDLER TP_IS_SVC_MEDIA_STREAM_HANDLER TP_TYPE_SVC_MEDIA_STREAM_HANDLER tp_svc_media_stream_handler_get_type TP_SVC_MEDIA_STREAM_HANDLER_GET_CLASS
svc-connection-manager telepathy-glib/telepathy-glib-dbus.h svc-connection-manager TpSvcConnectionManager TpSvcConnectionManagerClass tp_svc_connection_manager_get_parameters_impl tp_svc_connection_manager_implement_get_parameters tp_svc_connection_manager_return_from_get_parameters tp_svc_connection_manager_list_protocols_impl tp_svc_connection_manager_implement_list_protocols tp_svc_connection_manager_return_from_list_protocols tp_svc_connection_manager_request_connection_impl tp_svc_connection_manager_implement_request_connection tp_svc_connection_manager_return_from_request_connection tp_svc_connection_manager_emit_new_connection TP_SVC_CONNECTION_MANAGER TP_IS_SVC_CONNECTION_MANAGER TP_TYPE_SVC_CONNECTION_MANAGER tp_svc_connection_manager_get_type TP_SVC_CONNECTION_MANAGER_GET_CLASS
util util telepathy-glib/telepathy-glib.h tp_verify tp_verify_true tp_verify_statement tp_g_hash_table_update tp_g_ptr_array_contains tp_g_ptr_array_extend tp_g_value_slice_new tp_g_value_slice_new_boolean tp_g_value_slice_new_boxed tp_g_value_slice_new_static_boxed tp_g_value_slice_new_take_boxed tp_g_value_slice_new_double tp_g_value_slice_new_int tp_g_value_slice_new_int64 tp_g_value_slice_new_string tp_g_value_slice_new_static_string tp_g_value_slice_new_take_string tp_g_value_slice_new_uint tp_g_value_slice_new_uint64 tp_g_value_slice_new_byte tp_g_value_slice_free tp_g_value_slice_dup tp_str_empty tp_strdiff tp_mixin_offset_cast tp_mixin_class_get_offset tp_mixin_instance_get_offset tp_escape_as_identifier tp_strv_contains tp_g_key_file_get_int64 tp_g_key_file_get_uint64 tp_g_signal_connect_object tp_value_array_build tp_value_array_unpack tp_value_array_free TpWeakRef tp_weak_ref_new tp_weak_ref_dup_object tp_weak_ref_get_user_data tp_weak_ref_destroy tp_clear_pointer tp_clear_object tp_clear_boxed tp_simple_async_report_success_in_idle tp_user_action_time_from_x11 tp_user_action_time_should_present tp_utf8_make_valid
gnio-util gnio-util telepathy-glib/telepathy-glib.h tp_g_socket_address_from_variant tp_address_variant_from_g_socket_address tp_g_socket_address_from_g_variant tp_address_g_variant_from_g_socket_address tp_unix_connection_receive_credentials_with_byte tp_unix_connection_receive_credentials_with_byte_async tp_unix_connection_receive_credentials_with_byte_finish tp_unix_connection_send_credentials_with_byte tp_unix_connection_send_credentials_with_byte_async tp_unix_connection_send_credentials_with_byte_finish
gtypes gtypes telepathy-glib/telepathy-glib-dbus.h # Generic tp_dbus_specialized_value_slice_new TP_TYPE_UCHAR_ARRAY TP_ARRAY_TYPE_OBJECT_PATH_LIST TP_ARRAY_TYPE_UCHAR_ARRAY_LIST TP_HASH_TYPE_STRING_STRING_MAP TP_ARRAY_TYPE_STRING_STRING_MAP_LIST TP_HASH_TYPE_STRING_VARIANT_MAP TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP TP_ARRAY_TYPE_QUALIFIED_PROPERTY_VALUE_MAP_LIST TP_STRUCT_TYPE_SOCKET_ADDRESS_IP TP_ARRAY_TYPE_SOCKET_ADDRESS_IP_LIST TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4 TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6 TP_STRUCT_TYPE_SOCKET_NETMASK_IPV4 TP_STRUCT_TYPE_SOCKET_NETMASK_IPV6 TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP TP_ARRAY_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP_LIST # Connection Manager TP_STRUCT_TYPE_PARAM_SPEC TP_ARRAY_TYPE_PARAM_SPEC_LIST TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP # Connection TP_STRUCT_TYPE_CHANNEL_INFO TP_ARRAY_TYPE_CHANNEL_INFO_LIST # Connection - Aliasing TP_HASH_TYPE_ALIAS_MAP TP_STRUCT_TYPE_ALIAS_PAIR TP_ARRAY_TYPE_ALIAS_PAIR_LIST # Connection - Avatars TP_HASH_TYPE_AVATAR_TOKEN_MAP # Connection - Balance TP_STRUCT_TYPE_CURRENCY_AMOUNT # Connection - ContactCapabilities TP_HASH_TYPE_CONTACT_CAPABILITIES_MAP TP_ARRAY_TYPE_CONTACT_CAPABILITIES_MAP_LIST TP_STRUCT_TYPE_HANDLER_CAPABILITIES TP_ARRAY_TYPE_HANDLER_CAPABILITIES_LIST # Connection - Capabilities TP_STRUCT_TYPE_CAPABILITY_CHANGE TP_ARRAY_TYPE_CAPABILITY_CHANGE_LIST TP_STRUCT_TYPE_CAPABILITY_PAIR TP_ARRAY_TYPE_CAPABILITY_PAIR_LIST TP_STRUCT_TYPE_CONTACT_CAPABILITY TP_ARRAY_TYPE_CONTACT_CAPABILITY_LIST # Connection - Contacts TP_HASH_TYPE_CONTACT_ATTRIBUTES_MAP TP_HASH_TYPE_SINGLE_CONTACT_ATTRIBUTES_MAP # Connection - Requests TP_HASH_TYPE_CHANNEL_CLASS TP_ARRAY_TYPE_CHANNEL_CLASS_LIST TP_STRUCT_TYPE_CHANNEL_DETAILS TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST # Connection - SimplePresence and generic support for rich presence TP_HASH_TYPE_SIMPLE_CONTACT_PRESENCES TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP TP_STRUCT_TYPE_SIMPLE_PRESENCE TP_STRUCT_TYPE_SIMPLE_STATUS_SPEC TP_STRUCT_TYPE_ACCESS_CONTROL TP_STRUCT_TYPE_RICH_PRESENCE_ACCESS_CONTROL # Connection - Presence (0.16) TP_HASH_TYPE_CONTACT_PRESENCES TP_HASH_TYPE_MULTIPLE_STATUS_MAP TP_HASH_TYPE_STATUS_SPEC_MAP TP_STRUCT_TYPE_LAST_ACTIVITY_AND_STATUSES TP_STRUCT_TYPE_STATUS_SPEC # Connection - Location TP_HASH_TYPE_LOCATION TP_HASH_TYPE_CONTACT_LOCATIONS # ContactInfo and Addressing TP_HASH_TYPE_CONTACT_INFO_MAP TP_STRUCT_TYPE_CONTACT_INFO_FIELD TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST TP_STRUCT_TYPE_FIELD_SPEC TP_ARRAY_TYPE_FIELD_SPECS TP_HASH_TYPE_ADDRESSING_NORMALIZATION_MAP TP_HASH_TYPE_VCARD_FIELD_ADDRESS_MAP # Connection - ContactList, ContactGroups TP_STRUCT_TYPE_CONTACT_SUBSCRIPTIONS TP_HASH_TYPE_CONTACT_SUBSCRIPTION_MAP # Connection - ClientTypes TP_HASH_TYPE_CONTACT_CLIENT_TYPES # Connection - MailNotification TP_HASH_TYPE_MAIL TP_ARRAY_TYPE_MAIL_LIST TP_STRUCT_TYPE_MAIL_ADDRESS TP_ARRAY_TYPE_MAIL_ADDRESS_LIST TP_STRUCT_TYPE_MAIL_URL TP_STRUCT_TYPE_HTTP_POST_DATA TP_ARRAY_TYPE_HTTP_POST_DATA_LIST # Channel - Group and Conference TP_STRUCT_TYPE_LOCAL_PENDING_INFO TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST TP_HASH_TYPE_HANDLE_OWNER_MAP TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP TP_HASH_TYPE_CHANNEL_ORIGINATOR_MAP # Channel - Text and Messages TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST TP_HASH_TYPE_MESSAGE_PART TP_ARRAY_TYPE_MESSAGE_PART_LIST TP_HASH_TYPE_MESSAGE_PART_CONTENT_MAP TP_HASH_TYPE_CHAT_STATE_MAP # Channel - Tubes TP_HASH_TYPE_SUPPORTED_SOCKET_MAP TP_STRUCT_TYPE_TUBE_INFO TP_ARRAY_TYPE_TUBE_INFO_LIST TP_STRUCT_TYPE_DBUS_TUBE_MEMBER TP_ARRAY_TYPE_DBUS_TUBE_MEMBER_LIST # Channel - DBusTube TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS # Properties TP_STRUCT_TYPE_PROPERTY_SPEC TP_ARRAY_TYPE_PROPERTY_SPEC_LIST TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST TP_STRUCT_TYPE_PROPERTY_VALUE TP_ARRAY_TYPE_PROPERTY_VALUE_LIST # Channel - Media-related TP_ARRAY_TYPE_MEDIA_SESSION_HANDLER_INFO_LIST TP_STRUCT_TYPE_MEDIA_SESSION_HANDLER_INFO TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE_LIST TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_CODEC_LIST TP_ARRAY_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT_LIST TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CANDIDATE TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_CODEC TP_STRUCT_TYPE_MEDIA_STREAM_HANDLER_TRANSPORT TP_STRUCT_TYPE_MEDIA_STREAM_INFO TP_ARRAY_TYPE_MEDIA_STREAM_INFO_LIST TP_HASH_TYPE_CHANNEL_CALL_STATE_MAP TP_ARRAY_TYPE_RTCP_FEEDBACK_MESSAGE_LIST TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE TP_STRUCT_TYPE_RTCP_FEEDBACK_MESSAGE_PROPERTIES TP_STRUCT_TYPE_RTP_HEADER_EXTENSION # Channel - Room List TP_ARRAY_TYPE_ROOM_INFO_LIST TP_STRUCT_TYPE_ROOM_INFO # Channel - Service Point TP_STRUCT_TYPE_SERVICE_POINT TP_ARRAY_TYPE_SERVICE_POINT_INFO_LIST TP_STRUCT_TYPE_SERVICE_POINT_INFO # Channel - Contact Search TpChannelContactSearchState TP_NUM_CHANNEL_CONTACT_SEARCH_STATES NUM_TP_CHANNEL_CONTACT_SEARCH_STATES TP_HASH_TYPE_CONTACT_SEARCH_MAP TP_HASH_TYPE_CONTACT_SEARCH_RESULT_MAP # Channel - captchas TP_ARRAY_TYPE_CAPTCHA_INFO_LIST TP_HASH_TYPE_CAPTCHA_ANSWERS TP_STRUCT_TYPE_CAPTCHA_INFO # Account and AM TP_STRUCT_TYPE_AVATAR # CD, CDO and CR TP_STRUCT_TYPE_DISPATCH_OPERATION_DETAILS TP_ARRAY_TYPE_DISPATCH_OPERATION_DETAILS_LIST TP_HASH_TYPE_NOT_DELEGATED_MAP TP_STRUCT_TYPE_NOT_DELEGATED_ERROR # Debug TP_STRUCT_TYPE_DEBUG_MESSAGE TP_ARRAY_TYPE_DEBUG_MESSAGE_LIST # TLS TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST # Metadata TP_HASH_TYPE_METADATA # Call TP_ARRAY_TYPE_CALL_MEMBER_MAP_LIST TP_ARRAY_TYPE_CANDIDATE_LIST TP_ARRAY_TYPE_CANDIDATE_PAIR_LIST TP_ARRAY_TYPE_CODEC_LIST TP_ARRAY_TYPE_VIDEO_RESOLUTION_STRUCT TP_HASH_TYPE_CALL_MEMBER_MAP TP_HASH_TYPE_CANDIDATE_INFO TP_HASH_TYPE_COMPONENT_STATE_MAP TP_HASH_TYPE_CONTACT_CODEC_MAP TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP TP_HASH_TYPE_CONTACT_SSRCS_MAP TP_HASH_TYPE_MEDIA_DESCRIPTION_PROPERTIES TP_STRUCT_TYPE_CALL_STATE_REASON TP_STRUCT_TYPE_CANDIDATE TP_STRUCT_TYPE_CANDIDATE_PAIR TP_STRUCT_TYPE_CODEC TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER TP_STRUCT_TYPE_STREAM_CREDENTIALS TP_STRUCT_TYPE_VIDEO_RESOLUTION tp_type_dbus_array__28us_29as tp_type_dbus_array__28usua_7bsv_7d_29_28usua_7bsv_7d_29 tp_type_dbus_array_a_7bsv_7das tp_type_dbus_array_dsus tp_type_dbus_array_oa_7bsv_7d tp_type_dbus_array_of_a_7boa_7bsv_7d_7d tp_type_dbus_array_of_a_7bss_7d tp_type_dbus_array_of_a_7bsv_7d tp_type_dbus_array_of_a_7bua_28a_7bsv_7das_29_7d tp_type_dbus_array_of_a_7buu_7d tp_type_dbus_array_of_ay tp_type_dbus_array_of_o tp_type_dbus_array_of_y tp_type_dbus_array_os tp_type_dbus_array_osuu tp_type_dbus_array_sa_28usuussduss_29 tp_type_dbus_array_saa_7bsv_7das tp_type_dbus_array_sasas tp_type_dbus_array_sasuu tp_type_dbus_array_sq tp_type_dbus_array_ss tp_type_dbus_array_sss tp_type_dbus_array_su tp_type_dbus_array_susv tp_type_dbus_array_us tp_type_dbus_array_usa_7bsv_7d tp_type_dbus_array_ussu tp_type_dbus_array_usua_7bsv_7d tp_type_dbus_array_usuu tp_type_dbus_array_usuuba_7bss_7d tp_type_dbus_array_usuussduss tp_type_dbus_array_usuuua_7bss_7d tp_type_dbus_array_usuuuu tp_type_dbus_array_uu tp_type_dbus_array_uuss tp_type_dbus_array_uuus tp_type_dbus_array_uuusa_7bsv_7du tp_type_dbus_array_uuuuus tp_type_dbus_array_uuuuuu tp_type_dbus_array_uv tp_type_dbus_hash_o_28ss_29 tp_type_dbus_hash_oa_7bsv_7d tp_type_dbus_hash_s_28ubb_29 tp_type_dbus_hash_s_28ubba_7bss_7d_29 tp_type_dbus_hash_sa_28sasas_29 tp_type_dbus_hash_sa_7bsv_7d tp_type_dbus_hash_sas tp_type_dbus_hash_ss tp_type_dbus_hash_sv tp_type_dbus_hash_u_28ua_28sss_29_29 tp_type_dbus_hash_u_28ua_7bsa_7bsv_7d_7d_29 tp_type_dbus_hash_u_28uss_29 tp_type_dbus_hash_u_28uus_29 tp_type_dbus_hash_ua_28a_7bsv_7das_29 tp_type_dbus_hash_ua_28sasas_29 tp_type_dbus_hash_ua_28usuuba_7bss_7d_29 tp_type_dbus_hash_ua_7bsv_7d tp_type_dbus_hash_uas tp_type_dbus_hash_uau tp_type_dbus_hash_uo tp_type_dbus_hash_us tp_type_dbus_hash_uu tp_type_dbus_hash_uv tp_type_dbus_struct__28us_29as tp_type_dbus_struct__28usua_7bsv_7d_29_28usua_7bsv_7d_29 tp_type_dbus_struct_a_7bsv_7das tp_type_dbus_struct_ays tp_type_dbus_struct_dsus tp_type_dbus_struct_ius tp_type_dbus_struct_oa_7bsv_7d tp_type_dbus_struct_os tp_type_dbus_struct_osuu tp_type_dbus_struct_oua_7bsv_7d tp_type_dbus_struct_sa_28usuussduss_29 tp_type_dbus_struct_saa_7bsv_7das tp_type_dbus_struct_sasas tp_type_dbus_struct_sasuu tp_type_dbus_struct_sq tp_type_dbus_struct_ss tp_type_dbus_struct_sss tp_type_dbus_struct_su tp_type_dbus_struct_sua_28ss_29 tp_type_dbus_struct_susv tp_type_dbus_struct_sy tp_type_dbus_struct_ua_28sss_29 tp_type_dbus_struct_ua_7bsa_7bsv_7d_7d tp_type_dbus_struct_ubb tp_type_dbus_struct_ubba_7bss_7d tp_type_dbus_struct_us tp_type_dbus_struct_usa_7bsv_7d tp_type_dbus_struct_uss tp_type_dbus_struct_ussu tp_type_dbus_struct_usua_7bsv_7d tp_type_dbus_struct_usuu tp_type_dbus_struct_usuuba_7bss_7d tp_type_dbus_struct_usuussduss tp_type_dbus_struct_usuuua_7bss_7d tp_type_dbus_struct_usuuuu tp_type_dbus_struct_uu tp_type_dbus_struct_uus tp_type_dbus_struct_uuss tp_type_dbus_struct_uuus tp_type_dbus_struct_uuusa_7bsv_7du tp_type_dbus_struct_uuuuus tp_type_dbus_struct_uuuuuu tp_type_dbus_struct_uv tp_type_dbus_array_ussuas tp_type_dbus_hash_su tp_type_dbus_struct_ussuas
run telepathy-glib/telepathy-glib.h run tp_run_connection_manager
debug-ansi telepathy-glib/debug-ansi.h debug-ansi TP_ANSI_RESET TP_ANSI_BOLD_ON TP_ANSI_INVERSE_ON TP_ANSI_BOLD_OFF TP_ANSI_FG_BLACK TP_ANSI_FG_RED TP_ANSI_FG_GREEN TP_ANSI_FG_YELLOW TP_ANSI_FG_BLUE TP_ANSI_FG_MAGENTA TP_ANSI_FG_CYAN TP_ANSI_FG_WHITE TP_ANSI_BG_RED TP_ANSI_BG_GREEN TP_ANSI_BG_YELLOW TP_ANSI_BG_BLUE TP_ANSI_BG_MAGENTA TP_ANSI_BG_CYAN TP_ANSI_BG_WHITE
properties-mixin TpPropertySignature TpProperty TpPropertiesContext TpPropertiesSetFunc TpPropertiesMixin telepathy-glib/properties-mixin.h TpPropertiesMixin TpPropertiesMixinClass tp_properties_mixin_class_init tp_properties_mixin_init tp_properties_mixin_finalize tp_properties_mixin_list_properties tp_properties_mixin_get_properties tp_properties_mixin_set_properties tp_properties_mixin_has_property tp_properties_context_has tp_properties_context_has_other_than tp_properties_context_get tp_properties_context_get_value_count tp_properties_context_remove tp_properties_context_return tp_properties_context_return_if_done tp_properties_mixin_change_value tp_properties_mixin_change_flags tp_properties_mixin_emit_changed tp_properties_mixin_emit_flags tp_properties_mixin_is_readable tp_properties_mixin_is_writable tp_properties_mixin_iface_init TP_TYPE_PROPERTY_INFO_STRUCT TP_TYPE_PROPERTY_INFO_LIST TP_TYPE_PROPERTY_VALUE_STRUCT TP_TYPE_PROPERTY_VALUE_LIST TP_TYPE_PROPERTY_FLAGS_STRUCT TP_TYPE_PROPERTY_FLAGS_LIST TP_PROPERTIES_MIXIN_CLASS_OFFSET_QUARK TP_PROPERTIES_MIXIN_CLASS_OFFSET TP_PROPERTIES_MIXIN_OFFSET_QUARK TP_PROPERTIES_MIXIN_OFFSET tp_properties_mixin_class_get_offset_quark tp_properties_mixin_get_offset_quark TpPropertiesMixinPrivate TpPropertiesMixinClassPrivate TP_PROPERTIES_MIXIN_CLASS TP_PROPERTIES_MIXIN
base-room-config telepathy-glib/telepathy-glib.h TpBaseRoomConfig TpBaseRoomConfig TpBaseRoomConfigClass TpBaseRoomConfigUpdateAsync TpBaseRoomConfigUpdateFinish tp_base_room_config_register_class tp_base_room_config_iface_init TpBaseRoomConfigProperty TP_TYPE_BASE_ROOM_CONFIG_PROPERTY tp_base_room_config_dup_channel tp_base_room_config_set_can_update_configuration tp_base_room_config_set_property_mutable tp_base_room_config_emit_properties_changed tp_base_room_config_set_retrieved TP_BASE_ROOM_CONFIG TP_BASE_ROOM_CONFIG_CLASS TP_BASE_ROOM_CONFIG_GET_CLASS TP_IS_BASE_ROOM_CONFIG TP_IS_BASE_ROOM_CONFIG_CLASS TP_TYPE_BASE_ROOM_CONFIG tp_base_room_config_get_type tp_base_room_config_property_get_type TpBaseRoomConfigPrivate
telepathy-glib/telepathy-glib.h contacts-mixin TpContactsMixin TpContactsMixin TpContactsMixinClass tp_contacts_mixin_add_contact_attributes_iface tp_contacts_mixin_class_init tp_contacts_mixin_finalize tp_contacts_mixin_iface_init tp_contacts_mixin_init tp_contacts_mixin_set_contact_attribute tp_contacts_mixin_get_contact_attributes TpContactsMixinFillContactAttributesFunc TP_CONTACTS_MIXIN_CLASS_OFFSET TP_CONTACTS_MIXIN_CLASS_OFFSET_QUARK TP_CONTACTS_MIXIN_OFFSET TP_CONTACTS_MIXIN_OFFSET_QUARK tp_contacts_mixin_class_get_offset_quark tp_contacts_mixin_get_offset_quark TpContactsMixinClassPrivate TpContactsMixinPrivate TP_CONTACTS_MIXIN_CLASS TP_CONTACTS_MIXIN
telepathy-glib/telepathy-glib.h presence-mixin TpPresenceStatusOptionalArgumentSpec TpPresenceStatusSpec tp_presence_status_spec_can_set_on_self tp_presence_status_spec_get_name tp_presence_status_spec_get_presence_type tp_presence_status_spec_has_message tp_presence_status_spec_new tp_presence_status_spec_copy tp_presence_status_spec_free TpPresenceMixinStatusAvailableFunc TpPresenceMixinGetContactStatusesFunc TpPresenceMixinSetOwnStatusFunc TpPresenceMixinGetMaximumStatusMessageLengthFunc TpPresenceStatus tp_presence_status_new tp_presence_status_free TpPresenceMixin TpPresenceMixin TpPresenceMixinClass tp_presence_mixin_class_init tp_presence_mixin_init tp_presence_mixin_finalize tp_presence_mixin_emit_presence_update tp_presence_mixin_emit_one_presence_update tp_presence_mixin_iface_init tp_presence_mixin_simple_presence_iface_init tp_presence_mixin_simple_presence_init_dbus_properties tp_presence_mixin_simple_presence_register_with_contacts_mixin TP_PRESENCE_MIXIN_CLASS_OFFSET_QUARK TP_PRESENCE_MIXIN_CLASS_OFFSET TP_PRESENCE_MIXIN_OFFSET_QUARK TP_PRESENCE_MIXIN_OFFSET tp_presence_mixin_class_get_offset_quark tp_presence_mixin_get_offset_quark TpPresenceMixinPrivate TpPresenceMixinClassPrivate TpPresenceStatusSpecPrivate TP_PRESENCE_MIXIN_CLASS TP_PRESENCE_MIXIN tp_presence_status_spec_get_type
debug debug telepathy-glib/telepathy-glib.h tp_debug_set_flags tp_debug_set_persistent tp_debug_divert_messages tp_debug_timestamped_log_handler tp_debug_set_flags_from_string tp_debug_set_flags_from_env tp_debug_set_all_flags
handle telepathy-glib/telepathy-glib.h handle TpHandle TP_TYPE_HANDLE TP_UNKNOWN_HANDLE_TYPE tp_handle_type_is_valid tp_handle_type_to_string
group-mixin telepathy-glib/telepathy-glib.h TpGroupMixin TP_HAS_GROUP_MIXIN TP_HAS_GROUP_MIXIN_CLASS TpGroupMixinAddMemberFunc TpGroupMixinRemMemberFunc TpGroupMixinRemMemberWithReasonFunc TpGroupMixin TpGroupMixinClass tp_group_mixin_class_init tp_group_mixin_class_allow_self_removal tp_group_mixin_class_set_remove_with_reason_func tp_group_mixin_init tp_group_mixin_finalize tp_group_mixin_get_self_handle tp_group_mixin_get_group_flags tp_group_mixin_add_members tp_group_mixin_remove_members tp_group_mixin_remove_members_with_reason tp_group_mixin_get_members tp_group_mixin_get_local_pending_members tp_group_mixin_get_local_pending_members_with_info tp_group_mixin_get_remote_pending_members tp_group_mixin_get_all_members tp_group_mixin_get_handle_owners tp_group_mixin_change_flags tp_group_mixin_change_members tp_group_mixin_change_members_detailed tp_group_mixin_add_handle_owner tp_group_mixin_iface_init tp_group_mixin_add_handle_owners tp_group_mixin_get_dbus_property tp_group_mixin_init_dbus_properties tp_group_mixin_change_self_handle tp_external_group_mixin_iface_init tp_external_group_mixin_init tp_external_group_mixin_finalize tp_external_group_mixin_init_dbus_properties tp_external_group_mixin_get_dbus_property tp_group_mixin_class_get_offset_quark tp_group_mixin_get_offset_quark TP_GROUP_MIXIN_CLASS_OFFSET_QUARK TP_GROUP_MIXIN_CLASS_OFFSET TP_GROUP_MIXIN_OFFSET_QUARK TP_GROUP_MIXIN_OFFSET TpGroupMixinPrivate TpGroupMixinClassPrivate TP_GROUP_MIXIN_CLASS TP_GROUP_MIXIN
intset telepathy-glib/telepathy-glib.h TpIntset TpIntset TP_TYPE_INTSET TpIntFunc tp_intset_sized_new tp_intset_new tp_intset_new_containing tp_intset_destroy tp_intset_clear tp_intset_add tp_intset_remove tp_intset_is_member tp_intset_foreach tp_intset_to_array tp_intset_from_array tp_intset_is_empty tp_intset_size tp_intset_is_equal tp_intset_copy tp_intset_intersection tp_intset_union tp_intset_union_update tp_intset_difference tp_intset_difference_update tp_intset_symmetric_difference tp_intset_dump TpIntsetFastIter tp_intset_fast_iter_init tp_intset_fast_iter_next TP_INTSET_ITER_INIT TpIntsetIter tp_intset_iter_init tp_intset_iter_next tp_intset_iter_reset tp_intset_get_type TpIntSet TpIntSetIter TpIntSetFastIter
asv asv telepathy-glib/telepathy-glib.h tp_asv_size tp_asv_new tp_asv_get_boolean tp_asv_set_boolean tp_asv_get_boxed tp_asv_set_boxed tp_asv_take_boxed tp_asv_set_static_boxed tp_asv_get_bytes tp_asv_set_bytes tp_asv_take_bytes tp_asv_get_double tp_asv_set_double tp_asv_get_int32 tp_asv_set_int32 tp_asv_get_int64 tp_asv_set_int64 tp_asv_get_object_path tp_asv_set_object_path tp_asv_take_object_path tp_asv_set_static_object_path tp_asv_get_string tp_asv_set_string tp_asv_take_string tp_asv_set_static_string tp_asv_get_strv tp_asv_set_strv tp_asv_get_uint32 tp_asv_set_uint32 tp_asv_get_uint64 tp_asv_set_uint64 tp_asv_lookup tp_asv_dump
variant-util variant-util telepathy-glib/telepathy-glib.h tp_variant_type_classify tp_variant_convert
vardict vardict telepathy-glib/telepathy-glib.h tp_vardict_get_boolean tp_vardict_get_double tp_vardict_get_int32 tp_vardict_get_int64 tp_vardict_get_object_path tp_vardict_get_string tp_vardict_get_uint32 tp_vardict_get_uint64
dbus dbus telepathy-glib/telepathy-glib.h tp_dbus_g_method_return_not_implemented tp_get_bus tp_get_bus_proxy TpDBusNameType TP_TYPE_DBUS_NAME_TYPE tp_dbus_check_valid_bus_name tp_dbus_check_valid_interface_name tp_dbus_check_valid_member_name tp_dbus_check_valid_object_path tp_g_value_slice_new_bytes tp_g_value_slice_new_take_bytes tp_g_value_slice_new_object_path tp_g_value_slice_new_static_object_path tp_g_value_slice_new_take_object_path TpDBusDaemon TpDBusDaemonClass tp_dbus_daemon_dup tp_dbus_daemon_new tp_dbus_daemon_get_unique_name TpDBusDaemonNameOwnerChangedCb tp_dbus_daemon_watch_name_owner tp_dbus_daemon_cancel_name_owner_watch TpDBusDaemonListNamesCb tp_dbus_daemon_list_names tp_dbus_daemon_list_activatable_names tp_dbus_daemon_release_name tp_dbus_daemon_request_name tp_dbus_daemon_register_object tp_dbus_daemon_unregister_object tp_dbus_daemon_init_known_interfaces tp_cli_dbus_daemon_call_add_match tp_cli_dbus_daemon_call_get_connection_se_linux_security_context tp_cli_dbus_daemon_call_get_connection_unix_process_id tp_cli_dbus_daemon_call_get_connection_unix_user tp_cli_dbus_daemon_call_get_id tp_cli_dbus_daemon_call_get_name_owner tp_cli_dbus_daemon_call_hello tp_cli_dbus_daemon_call_list_activatable_names tp_cli_dbus_daemon_call_list_names tp_cli_dbus_daemon_call_list_queued_owners tp_cli_dbus_daemon_call_name_has_owner tp_cli_dbus_daemon_call_release_name tp_cli_dbus_daemon_call_reload_config tp_cli_dbus_daemon_call_remove_match tp_cli_dbus_daemon_call_request_name tp_cli_dbus_daemon_call_start_service_by_name tp_cli_dbus_daemon_run_add_match tp_cli_dbus_daemon_run_get_connection_se_linux_security_context tp_cli_dbus_daemon_run_get_connection_unix_process_id tp_cli_dbus_daemon_run_get_connection_unix_user tp_cli_dbus_daemon_run_get_id tp_cli_dbus_daemon_run_get_name_owner tp_cli_dbus_daemon_run_hello tp_cli_dbus_daemon_run_list_activatable_names tp_cli_dbus_daemon_run_list_names tp_cli_dbus_daemon_run_list_queued_owners tp_cli_dbus_daemon_run_name_has_owner tp_cli_dbus_daemon_run_release_name tp_cli_dbus_daemon_run_reload_config tp_cli_dbus_daemon_run_remove_match tp_cli_dbus_daemon_run_request_name tp_cli_dbus_daemon_run_start_service_by_name tp_cli_dbus_daemon_callback_for_add_match tp_cli_dbus_daemon_callback_for_get_connection_se_linux_security_context tp_cli_dbus_daemon_callback_for_get_connection_unix_process_id tp_cli_dbus_daemon_callback_for_get_connection_unix_user tp_cli_dbus_daemon_callback_for_get_id tp_cli_dbus_daemon_callback_for_get_name_owner tp_cli_dbus_daemon_callback_for_hello tp_cli_dbus_daemon_callback_for_list_activatable_names tp_cli_dbus_daemon_callback_for_list_names tp_cli_dbus_daemon_callback_for_list_queued_owners tp_cli_dbus_daemon_callback_for_name_has_owner tp_cli_dbus_daemon_callback_for_release_name tp_cli_dbus_daemon_callback_for_reload_config tp_cli_dbus_daemon_callback_for_remove_match tp_cli_dbus_daemon_callback_for_request_name tp_cli_dbus_daemon_callback_for_start_service_by_name tp_cli_dbus_daemon_connect_to_name_acquired tp_cli_dbus_daemon_connect_to_name_lost tp_cli_dbus_daemon_connect_to_name_owner_changed tp_cli_dbus_daemon_signal_callback_name_acquired tp_cli_dbus_daemon_signal_callback_name_lost tp_cli_dbus_daemon_signal_callback_name_owner_changed tp_dbus_name_type_get_type tp_dbus_daemon_get_type TP_DBUS_DAEMON TP_DBUS_DAEMON_CLASS TP_DBUS_DAEMON_GET_CLASS TP_IS_DBUS_DAEMON TP_IS_DBUS_DAEMON_CLASS TP_TYPE_DBUS_DAEMON TpDBusDaemonPrivate
telepathy-glib/telepathy-glib.h dbus-properties-mixin dbus-properties-mixin TpDBusPropertiesMixinFlags TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS TpDBusPropertiesMixinIfaceInfo TpDBusPropertiesMixinPropInfo tp_svc_interface_set_dbus_properties_info tp_svc_interface_get_dbus_properties_info TpDBusPropertiesMixinClass TpDBusPropertiesMixinIfaceImpl TpDBusPropertiesMixinPropImpl TpDBusPropertiesMixinGetter tp_dbus_properties_mixin_getter_gobject_properties TpDBusPropertiesMixinSetter tp_dbus_properties_mixin_setter_gobject_properties tp_dbus_properties_mixin_class_init tp_dbus_properties_mixin_implement_interface tp_dbus_properties_mixin_iface_init tp_dbus_properties_mixin_get tp_dbus_properties_mixin_dup_all tp_dbus_properties_mixin_set tp_dbus_properties_mixin_fill_properties_hash tp_dbus_properties_mixin_make_properties_hash tp_dbus_properties_mixin_emit_properties_changed tp_dbus_properties_mixin_emit_properties_changed_varargs tp_dbus_properties_mixin_flags_get_type
errors telepathy-glib/telepathy-glib.h errors TP_ERROR_PREFIX TP_ERROR TP_TYPE_ERROR TpError tp_g_set_error_invalid_handle_type tp_g_set_error_unsupported_handle_type tp_error_get_dbus_name TP_ERROR_STR_NETWORK_ERROR TP_ERROR_STR_NOT_IMPLEMENTED TP_ERROR_STR_INVALID_ARGUMENT TP_ERROR_STR_NOT_AVAILABLE TP_ERROR_STR_PERMISSION_DENIED TP_ERROR_STR_DISCONNECTED TP_ERROR_STR_INVALID_HANDLE TP_ERROR_STR_CHANNEL_BANNED TP_ERROR_STR_CHANNEL_FULL TP_ERROR_STR_CHANNEL_INVITE_ONLY TP_ERROR_STR_NOT_YOURS TP_ERROR_STR_CANCELLED TP_ERROR_STR_AUTHENTICATION_FAILED TP_ERROR_STR_ENCRYPTION_NOT_AVAILABLE TP_ERROR_STR_ENCRYPTION_ERROR TP_ERROR_STR_CERT_NOT_PROVIDED TP_ERROR_STR_CERT_UNTRUSTED TP_ERROR_STR_CERT_EXPIRED TP_ERROR_STR_CERT_NOT_ACTIVATED TP_ERROR_STR_CERT_FINGERPRINT_MISMATCH TP_ERROR_STR_CERT_HOSTNAME_MISMATCH TP_ERROR_STR_CERT_SELF_SIGNED TP_ERROR_STR_CERT_INVALID TP_ERROR_STR_NOT_CAPABLE TP_ERROR_STR_OFFLINE TP_ERROR_STR_CHANNEL_KICKED TP_ERROR_STR_BUSY TP_ERROR_STR_NO_ANSWER TP_ERROR_STR_DOES_NOT_EXIST TP_ERROR_STR_TERMINATED TP_ERROR_STR_CONNECTION_REFUSED TP_ERROR_STR_CONNECTION_FAILED TP_ERROR_STR_CONNECTION_LOST TP_ERROR_STR_ALREADY_CONNECTED TP_ERROR_STR_CONNECTION_REPLACED TP_ERROR_STR_REGISTRATION_EXISTS TP_ERROR_STR_SERVICE_BUSY TP_ERROR_STR_RESOURCE_UNAVAILABLE TP_ERROR_STR_WOULD_BREAK_ANONYMITY TP_ERROR_STR_CERT_REVOKED TP_ERROR_STR_CERT_INSECURE TP_ERROR_STR_CERT_LIMIT_EXCEEDED TP_ERROR_STR_NOT_YET TP_ERROR_STR_REJECTED TP_ERROR_STR_PICKED_UP_ELSEWHERE TP_ERROR_STR_CONFUSED TP_ERROR_STR_SERVICE_CONFUSED TP_ERROR_STR_SOFTWARE_UPGRADE_REQUIRED TP_ERROR_STR_EMERGENCY_CALLS_NOT_SUPPORTED TP_ERROR_STR_INSUFFICIENT_BALANCE TP_ERROR_STR_MEDIA_CODECS_INCOMPATIBLE TP_ERROR_STR_MEDIA_UNSUPPORTED_TYPE TP_ERROR_STR_MEDIA_STREAMING_ERROR TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED tp_error_get_type tp_errors_quark tp_error_quark TP_ERRORS
TpHeap telepathy-glib/telepathy-glib.h heap TpHeap tp_heap_new tp_heap_destroy tp_heap_clear tp_heap_add tp_heap_remove tp_heap_peek_first tp_heap_extract_first tp_heap_size
message-mixin telepathy-glib/telepathy-glib.h TpMessageMixin TpMessageMixin TpMessageMixinSendImpl tp_message_mixin_finalize tp_message_mixin_implement_sending tp_message_mixin_init tp_message_mixin_init_dbus_properties tp_message_mixin_messages_iface_init tp_message_mixin_get_dbus_property tp_message_mixin_sent tp_message_mixin_set_rescued tp_message_mixin_take_received tp_message_mixin_has_pending_messages tp_message_mixin_clear tp_message_mixin_text_iface_init TpMessageMixinSendChatStateImpl tp_message_mixin_chat_state_iface_init tp_message_mixin_change_chat_state tp_message_mixin_implement_send_chat_state tp_message_mixin_maybe_send_gone TpMessageMixinPrivate
message telepathy-glib/telepathy-glib.h TpMessage TpMessage tp_message_count_parts tp_message_dup_part tp_message_peek tp_message_to_text tp_message_get_message_type tp_message_get_received_timestamp tp_message_get_sent_timestamp tp_message_get_specific_to_interface tp_message_get_supersedes tp_message_get_token tp_message_is_delivery_report tp_message_is_rescued tp_message_is_scrollback tp_message_get_pending_message_id tp_message_is_mutable tp_message_append_part tp_message_delete_key tp_message_delete_part tp_message_set tp_message_set_variant tp_message_set_boolean tp_message_set_bytes tp_message_set_int16 tp_message_set_int32 tp_message_set_int64 tp_message_set_string tp_message_set_string_printf tp_message_set_uint16 tp_message_set_uint32 tp_message_set_uint64 tp_message_new tp_message_destroy tp_message_ref_handle tp_message_set_handle tp_message_take_message TP_IS_MESSAGE TP_IS_MESSAGE_CLASS TP_MESSAGE TP_MESSAGE_CLASS TP_MESSAGE_GET_CLASS TP_TYPE_MESSAGE tp_message_get_type
cm-message telepathy-glib/telepathy-glib.h TpCMMessage TpCMMessage tp_cm_message_new tp_cm_message_new_text tp_cm_message_set_message tp_cm_message_take_message tp_cm_message_get_sender tp_cm_message_set_sender TP_IS_CM_MESSAGE TP_IS_CM_MESSAGE_CLASS TP_CM_MESSAGE TP_CM_MESSAGE_CLASS TP_CM_MESSAGE_GET_CLASS TP_TYPE_CM_MESSAGE tp_cm_message_get_type
text-mixin telepathy-glib/text-mixin.h TpTextMixin TpTextMixin TpTextMixinClass tp_text_mixin_class_get_offset_quark tp_text_mixin_get_offset_quark tp_text_mixin_class_init tp_text_mixin_init tp_text_mixin_set_message_types tp_text_mixin_finalize tp_text_mixin_receive_with_flags tp_text_mixin_receive tp_text_mixin_acknowledge_pending_messages tp_text_mixin_list_pending_messages tp_text_mixin_get_message_types tp_text_mixin_clear tp_text_mixin_has_pending_messages tp_text_mixin_set_rescued tp_text_mixin_iface_init TP_TEXT_MIXIN_CLASS_OFFSET_QUARK TP_TEXT_MIXIN_CLASS_OFFSET TP_TEXT_MIXIN_OFFSET_QUARK TP_TEXT_MIXIN_OFFSET TpTextMixinPrivate TpTextMixinClassPrivate TP_TEXT_MIXIN_CLASS TP_TEXT_MIXIN
enums telepathy-glib/telepathy-glib.h enums TpHandleType TP_NUM_HANDLE_TYPES NUM_TP_HANDLE_TYPES TpConnMgrParamFlags TpConnectionStatus TP_NUM_CONNECTION_STATUSES NUM_TP_CONNECTION_STATUSES TpConnectionStatusReason TP_NUM_CONNECTION_STATUS_REASONS NUM_TP_CONNECTION_STATUS_REASONS TpConnectionAliasFlags TpConnectionCapabilityFlags TpConnectionPresenceType TP_NUM_CONNECTION_PRESENCE_TYPES NUM_TP_CONNECTION_PRESENCE_TYPES TpDTMFEvent TP_NUM_DTMF_EVENTS NUM_TP_DTMF_EVENTS tp_dtmf_event_to_char TpMediaStreamType NUM_TP_MEDIA_STREAM_TYPES TP_NUM_MEDIA_STREAM_TYPES TpMediaStreamState NUM_TP_MEDIA_STREAM_STATES TP_NUM_MEDIA_STREAM_STATES TpMediaStreamDirection NUM_TP_MEDIA_STREAM_DIRECTIONS TP_NUM_MEDIA_STREAM_DIRECTIONS TpMediaStreamPendingSend TpChannelMediaCapabilities TpChannelTextSendError TP_NUM_CHANNEL_TEXT_SEND_ERRORS NUM_TP_CHANNEL_TEXT_SEND_ERRORS TpChannelTextMessageType NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES TpChannelTextMessageFlags TpChannelChatState NUM_TP_CHANNEL_CHAT_STATES TP_NUM_CHANNEL_CHAT_STATES TpChannelGroupFlags TpChannelGroupChangeReason NUM_TP_CHANNEL_GROUP_CHANGE_REASONS TP_NUM_CHANNEL_GROUP_CHANGE_REASONS TpChannelPasswordFlags TpContactBlockingCapabilities TpDeliveryReportingSupportFlags TpDeliveryStatus NUM_TP_DELIVERY_STATUSES TP_NUM_DELIVERY_STATUSES TpMediaStreamError NUM_TP_MEDIA_STREAM_ERRORS TP_NUM_MEDIA_STREAM_ERRORS TpMediaStreamBaseProto NUM_TP_MEDIA_STREAM_BASE_PROTOS TP_NUM_MEDIA_STREAM_BASE_PROTOS TpMediaStreamTransportType NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES TP_NUM_MEDIA_STREAM_TRANSPORT_TYPES TpPropertyFlags TpMessagePartSupportFlags TpMessageSendingFlags NUM_TP_SOCKET_ACCESS_CONTROLS TP_NUM_SOCKET_ACCESS_CONTROLS TpSocketAccessControl NUM_TP_SOCKET_ADDRESS_TYPES TP_NUM_SOCKET_ADDRESS_TYPES TpSocketAddressType NUM_TP_TUBE_STATES TP_NUM_TUBE_STATES TpTubeState NUM_TP_TUBE_TYPES TP_NUM_TUBE_TYPES TpTubeType TpChannelCallStateFlags NUM_TP_LOCAL_HOLD_STATES TP_NUM_LOCAL_HOLD_STATES TpLocalHoldState NUM_TP_LOCAL_HOLD_STATE_REASONS TP_NUM_LOCAL_HOLD_STATE_REASONS TpLocalHoldStateReason TpAccessControlType NUM_TP_ACCESS_CONTROL_TYPES TP_NUM_ACCESS_CONTROL_TYPES TpRichPresenceAccessControlType NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES TP_NUM_RICH_PRESENCE_ACCESS_CONTROL_TYPES TpFileHashType NUM_TP_FILE_HASH_TYPES TP_NUM_FILE_HASH_TYPES TpFileTransferState NUM_TP_FILE_TRANSFER_STATES TP_NUM_FILE_TRANSFER_STATES TpFileTransferStateChangeReason NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS TP_NUM_FILE_TRANSFER_STATE_CHANGE_REASONS TpTubeChannelState NUM_TP_TUBE_CHANNEL_STATES TP_NUM_TUBE_CHANNEL_STATES TpDebugLevel NUM_TP_DEBUG_LEVELS TP_NUM_DEBUG_LEVELS TpContactInfoFlags TpContactInfoFieldFlags TpLocationFeatures TpServicePointType NUM_TP_SERVICE_POINT_TYPES TP_NUM_SERVICE_POINT_TYPES TpAnonymityModeFlags TpStorageRestrictionFlags TpTLSCertificateRejectReason NUM_TP_TLS_CERTIFICATE_REJECT_REASONS TP_NUM_TLS_CERTIFICATE_REJECT_REASONS TpTLSCertificateState NUM_TP_TLS_CERTIFICATE_STATES TP_NUM_TLS_CERTIFICATE_STATES TpContactMetadataStorageType NUM_TP_CONTACT_METADATA_STORAGE_TYPES TP_NUM_CONTACT_METADATA_STORAGE_TYPES TpSubscriptionState NUM_TP_SUBSCRIPTION_STATES TP_NUM_SUBSCRIPTION_STATES TpContactListState NUM_TP_CONTACT_LIST_STATES TP_NUM_CONTACT_LIST_STATES TpHTTPMethod NUM_TP_HTTP_METHODS TP_NUM_HTTP_METHODS TpMailNotificationFlags TpSASLAbortReason NUM_TP_SASL_ABORT_REASONS TP_NUM_SASL_ABORT_REASONS TpSASLStatus NUM_TP_SASL_STATUSES TP_NUM_SASL_STATUSES TpCaptchaStatus NUM_TP_CAPTCHA_STATUSES TP_NUM_CAPTCHA_STATUSES TpCaptchaCancelReason NUM_TP_CAPTCHA_CANCEL_REASONS TP_NUM_CAPTCHA_CANCEL_REASONS TpCaptchaFlags TpCallContentDisposition NUM_TP_CALL_CONTENT_DISPOSITIONS TP_NUM_CALL_CONTENT_DISPOSITIONS TpCallContentPacketizationType NUM_TP_CALL_CONTENT_PACKETIZATION_TYPES TP_NUM_CALL_CONTENT_PACKETIZATION_TYPES TpCallState NUM_TP_CALL_STATES TP_NUM_CALL_STATES TpCallStateChangeReason NUM_TP_CALL_STATE_CHANGE_REASONS TP_NUM_CALL_STATE_CHANGE_REASONS TpCallStreamCandidateType NUM_TP_CALL_STREAM_CANDIDATE_TYPES TP_NUM_CALL_STREAM_CANDIDATE_TYPES TpRCPTXRRTTMode NUM_TP_RCPT_XR_RTT_MODES TP_NUM_RCPT_XR_RTT_MODES TpSendingState NUM_TP_SENDING_STATES TP_NUM_SENDING_STATES TpStreamComponent NUM_TP_STREAM_COMPONENTS TP_NUM_STREAM_COMPONENTS TpStreamEndpointState NUM_TP_STREAM_ENDPOINT_STATES TP_NUM_STREAM_ENDPOINT_STATES TpStreamFlowState NUM_TP_STREAM_FLOW_STATES TP_NUM_STREAM_FLOW_STATES TpStreamTransportType NUM_TP_STREAM_TRANSPORT_TYPES TP_NUM_STREAM_TRANSPORT_TYPES TpCallFlags TpCallMemberFlags TpRTCPXRStatisticsFlags
interfaces interfaces telepathy-glib/telepathy-glib-dbus.h TP_IFACE_ACCOUNT TP_IFACE_QUARK_ACCOUNT TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING TP_IFACE_QUARK_ACCOUNT_INTERFACE_ADDRESSING TP_IFACE_ACCOUNT_INTERFACE_AVATAR TP_IFACE_QUARK_ACCOUNT_INTERFACE_AVATAR TP_IFACE_ACCOUNT_INTERFACE_STORAGE TP_IFACE_QUARK_ACCOUNT_INTERFACE_STORAGE TP_IFACE_ACCOUNT_MANAGER TP_IFACE_QUARK_ACCOUNT_MANAGER TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE TP_IFACE_QUARK_AUTHENTICATION_TLS_CERTIFICATE TP_IFACE_DBUS_DAEMON TP_IFACE_QUARK_DBUS_DAEMON TP_IFACE_DBUS_INTROSPECTABLE TP_IFACE_QUARK_DBUS_INTROSPECTABLE TP_IFACE_DBUS_PEER TP_IFACE_QUARK_DBUS_PEER TP_IFACE_DBUS_PROPERTIES TP_IFACE_QUARK_DBUS_PROPERTIES TP_IFACE_DEBUG TP_IFACE_QUARK_DEBUG TP_IFACE_CONNECTION_MANAGER TP_IFACE_QUARK_CONNECTION_MANAGER TP_IFACE_PROTOCOL TP_IFACE_QUARK_PROTOCOL TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING TP_IFACE_PROTOCOL_INTERFACE_AVATARS TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS TP_IFACE_PROTOCOL_INTERFACE_PRESENCE TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE TP_IFACE_CONNECTION TP_IFACE_QUARK_CONNECTION TP_IFACE_CONNECTION_INTERFACE_ADDRESSING TP_IFACE_QUARK_CONNECTION_INTERFACE_ADDRESSING TP_IFACE_CONNECTION_INTERFACE_ALIASING TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING TP_IFACE_CONNECTION_INTERFACE_ANONYMITY TP_IFACE_QUARK_CONNECTION_INTERFACE_ANONYMITY TP_IFACE_CONNECTION_INTERFACE_AVATARS TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS TP_IFACE_CONNECTION_INTERFACE_BALANCE TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES TP_IFACE_QUARK_CONNECTION_INTERFACE_CAPABILITIES TP_IFACE_CONNECTION_INTERFACE_CELLULAR TP_IFACE_QUARK_CONNECTION_INTERFACE_CELLULAR TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES TP_IFACE_QUARK_CONNECTION_INTERFACE_CLIENT_TYPES TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS TP_IFACE_CONNECTION_INTERFACE_POWER_SAVING TP_IFACE_QUARK_CONNECTION_INTERFACE_POWER_SAVING TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST TP_IFACE_CONNECTION_INTERFACE_CONTACTS TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS TP_IFACE_CONNECTION_INTERFACE_RENAMING TP_IFACE_QUARK_CONNECTION_INTERFACE_RENAMING TP_IFACE_CONNECTION_INTERFACE_REQUESTS TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS TP_IFACE_CONNECTION_INTERFACE_SIDECARS1 TP_IFACE_QUARK_CONNECTION_INTERFACE_SIDECARS1 TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE TP_IFACE_CONNECTION_INTERFACE_PRESENCE TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE TP_IFACE_CONNECTION_INTERFACE_LOCATION TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION TP_IFACE_CONNECTION_INTERFACE_SERVICE_POINT TP_IFACE_QUARK_CONNECTION_INTERFACE_SERVICE_POINT TP_IFACE_CONNECTION_INTERFACE_MAIL_NOTIFICATION TP_IFACE_QUARK_CONNECTION_INTERFACE_MAIL_NOTIFICATION TP_IFACE_CHANNEL TP_IFACE_QUARK_CHANNEL TP_IFACE_CHANNEL_TYPE_CALL TP_IFACE_QUARK_CHANNEL_TYPE_CALL TP_IFACE_CHANNEL_TYPE_CONTACT_LIST TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_LIST TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH TP_IFACE_QUARK_CHANNEL_TYPE_CONTACT_SEARCH TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION TP_IFACE_CHANNEL_TYPE_SERVER_TLS_CONNECTION TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_TLS_CONNECTION TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA TP_IFACE_CHANNEL_TYPE_ROOM_LIST TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST TP_IFACE_CHANNEL_TYPE_TEXT TP_IFACE_QUARK_CHANNEL_TYPE_TEXT TP_IFACE_CHANNEL_TYPE_TUBES TP_IFACE_QUARK_CHANNEL_TYPE_TUBES TP_IFACE_CHANNEL_INTERFACE_TUBE TP_IFACE_CHANNEL_TYPE_DBUS_TUBE TP_IFACE_CHANNEL_TYPE_STREAM_TUBE TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE TP_IFACE_CHANNEL_INTERFACE_ANONYMITY TP_IFACE_QUARK_CHANNEL_INTERFACE_ANONYMITY TP_IFACE_CHANNEL_INTERFACE_CALL_STATE TP_IFACE_QUARK_CHANNEL_INTERFACE_CALL_STATE TP_IFACE_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION TP_IFACE_QUARK_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE TP_IFACE_CHANNEL_INTERFACE_CONFERENCE TP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE TP_IFACE_CHANNEL_INTERFACE_DTMF TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA TP_IFACE_QUARK_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA TP_IFACE_CHANNEL_INTERFACE_GROUP TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP TP_IFACE_CHANNEL_INTERFACE_HOLD TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD TP_IFACE_CHANNEL_INTERFACE_PASSWORD TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD TP_IFACE_CHANNEL_INTERFACE_ROOM TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM_CONFIG TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION TP_IFACE_QUARK_CHANNEL_INTERFACE_SASL_AUTHENTICATION TP_IFACE_CHANNEL_INTERFACE_SECURABLE TP_IFACE_QUARK_CHANNEL_INTERFACE_SECURABLE TP_IFACE_CHANNEL_INTERFACE_SMS TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS TP_IFACE_CHANNEL_INTERFACE_SUBJECT TP_IFACE_QUARK_CHANNEL_INTERFACE_SUBJECT TP_IFACE_CHANNEL_INTERFACE_MEDIA_SIGNALLING TP_IFACE_QUARK_CHANNEL_INTERFACE_MEDIA_SIGNALLING TP_IFACE_CHANNEL_INTERFACE_MESSAGES TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES TP_IFACE_CHANNEL_INTERFACE_SERVICE_POINT TP_IFACE_QUARK_CHANNEL_INTERFACE_SERVICE_POINT TP_IFACE_CHANNEL_DISPATCHER TP_IFACE_QUARK_CHANNEL_DISPATCHER TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1 TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1 TP_IFACE_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST TP_IFACE_QUARK_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST TP_IFACE_CHANNEL_DISPATCH_OPERATION TP_IFACE_QUARK_CHANNEL_DISPATCH_OPERATION TP_IFACE_CHANNEL_REQUEST TP_IFACE_QUARK_CHANNEL_REQUEST TP_IFACE_MEDIA_SESSION_HANDLER TP_IFACE_QUARK_MEDIA_SESSION_HANDLER TP_IFACE_MEDIA_STREAM_HANDLER TP_IFACE_QUARK_MEDIA_STREAM_HANDLER TP_IFACE_PROPERTIES_INTERFACE TP_IFACE_QUARK_PROPERTIES_INTERFACE TP_IFACE_CLIENT TP_IFACE_QUARK_CLIENT TP_IFACE_CLIENT_APPROVER TP_IFACE_QUARK_CLIENT_APPROVER TP_IFACE_CLIENT_HANDLER TP_IFACE_QUARK_CLIENT_HANDLER TP_IFACE_CLIENT_OBSERVER TP_IFACE_QUARK_CLIENT_OBSERVER TP_IFACE_CLIENT_INTERFACE_REQUESTS TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS TP_IFACE_CALL_CONTENT TP_IFACE_QUARK_CALL_CONTENT TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_MEDIA TP_IFACE_CALL_CONTENT_INTERFACE_VIDEO_CONTROL TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_VIDEO_CONTROL TP_IFACE_CALL_CONTENT_INTERFACE_AUDIO_CONTROL TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_AUDIO_CONTROL TP_IFACE_CALL_CONTENT_INTERFACE_DTMF TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS TP_IFACE_QUARK_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS TP_IFACE_CALL_STREAM TP_IFACE_QUARK_CALL_STREAM TP_IFACE_CALL_STREAM_ENDPOINT TP_IFACE_QUARK_CALL_STREAM_ENDPOINT TP_IFACE_CALL_STREAM_INTERFACE_MEDIA TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE TP_PROP_ACCOUNT_CHANGING_PRESENCE TP_PROP_ACCOUNT_CONNECTION TP_PROP_ACCOUNT_CONNECTION_ERROR TP_PROP_ACCOUNT_CONNECTION_ERROR_DETAILS TP_PROP_ACCOUNT_CONNECTION_STATUS TP_PROP_ACCOUNT_CONNECTION_STATUS_REASON TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY TP_PROP_ACCOUNT_CURRENT_PRESENCE TP_PROP_ACCOUNT_DISPLAY_NAME TP_PROP_ACCOUNT_ENABLED TP_PROP_ACCOUNT_HAS_BEEN_ONLINE TP_PROP_ACCOUNT_ICON TP_PROP_ACCOUNT_INTERFACES TP_PROP_ACCOUNT_INTERFACE_ADDRESSING_URI_SCHEMES TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_IDENTIFIER TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_RESTRICTIONS TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_SPECIFIC_INFORMATION TP_PROP_ACCOUNT_MANAGER_INTERFACES TP_PROP_ACCOUNT_MANAGER_INVALID_ACCOUNTS TP_PROP_ACCOUNT_MANAGER_SUPPORTED_ACCOUNT_PROPERTIES TP_PROP_ACCOUNT_MANAGER_VALID_ACCOUNTS TP_PROP_ACCOUNT_NICKNAME TP_PROP_ACCOUNT_NORMALIZED_NAME TP_PROP_ACCOUNT_PARAMETERS TP_PROP_ACCOUNT_REQUESTED_PRESENCE TP_PROP_ACCOUNT_SERVICE TP_PROP_ACCOUNT_SUPERSEDES TP_PROP_ACCOUNT_VALID TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_CHAIN_DATA TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_CERTIFICATE_TYPE TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_REJECTIONS TP_PROP_AUTHENTICATION_TLS_CERTIFICATE_STATE TP_PROP_CALL_CONTENT_DISPOSITION TP_PROP_CALL_CONTENT_INTERFACES TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_EVENT TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_CURRENT_DTMF_STATE TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_LOCAL_MEDIA_DESCRIPTIONS TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_MEDIA_DESCRIPTION_OFFER TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_PACKETIZATION TP_PROP_CALL_CONTENT_INTERFACE_MEDIA_REMOTE_MEDIA_DESCRIPTIONS TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_BITRATE TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_FRAMERATE TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MANUAL_KEY_FRAMES TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_MTU TP_PROP_CALL_CONTENT_INTERFACE_VIDEO_CONTROL_VIDEO_RESOLUTION TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_INPUT_VOLUME TP_PROP_CALL_CONTENT_INTERFACE_AUDIO_CONTROL_REQUESTED_OUTPUT_VOLUME TP_PROP_CALL_CONTENT_INTERFACE_DTMF_CURRENTLY_SENDING_TONES TP_PROP_CALL_CONTENT_INTERFACE_DTMF_DEFERRED_TONES TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_FURTHER_NEGOTIATION_REQUIRED TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_HAS_REMOTE_INFORMATION TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACES TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DLRR_MAX_SIZE TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_DUPLICATE_RLE_MAX_SIZE TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_ENABLE_METRICS TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_LOSS_RLE_MAX_SIZE TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_PACKET_RECEIPT_TIMES_MAX_SIZE TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_RTT_MODE TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS_STATISTICS_FLAGS TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_DOES_AVPF TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK_FEEDBACK_MESSAGES TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS_HEADER_EXTENSIONS TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_SSRCS TP_PROP_CALL_CONTENT_NAME TP_PROP_CALL_CONTENT_STREAMS TP_PROP_CALL_CONTENT_TYPE TP_PROP_CALL_STREAM_CAN_REQUEST_RECEIVING TP_PROP_CALL_STREAM_ENDPOINT_CONTROLLING TP_PROP_CALL_STREAM_ENDPOINT_ENDPOINT_STATE TP_PROP_CALL_STREAM_ENDPOINT_IS_ICE_LITE TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CANDIDATES TP_PROP_CALL_STREAM_ENDPOINT_REMOTE_CREDENTIALS TP_PROP_CALL_STREAM_ENDPOINT_SELECTED_CANDIDATE_PAIRS TP_PROP_CALL_STREAM_ENDPOINT_TRANSPORT TP_PROP_CALL_STREAM_INTERFACES TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ENDPOINTS TP_PROP_CALL_STREAM_INTERFACE_MEDIA_HAS_SERVER_INFO TP_PROP_CALL_STREAM_INTERFACE_MEDIA_ICE_RESTART_PENDING TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CANDIDATES TP_PROP_CALL_STREAM_INTERFACE_MEDIA_LOCAL_CREDENTIALS TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RECEIVING_STATE TP_PROP_CALL_STREAM_INTERFACE_MEDIA_RELAY_INFO TP_PROP_CALL_STREAM_INTERFACE_MEDIA_SENDING_STATE TP_PROP_CALL_STREAM_INTERFACE_MEDIA_STUN_SERVERS TP_PROP_CALL_STREAM_INTERFACE_MEDIA_TRANSPORT TP_PROP_CALL_STREAM_LOCAL_SENDING_STATE TP_PROP_CALL_STREAM_REMOTE_MEMBERS TP_PROP_CALL_STREAM_REMOTE_MEMBER_IDENTIFIERS TP_PROP_CHANNEL_CHANNEL_TYPE TP_PROP_CHANNEL_DISPATCHER_INTERFACES TP_PROP_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST_DISPATCH_OPERATIONS TP_PROP_CHANNEL_DISPATCHER_SUPPORTS_REQUEST_HINTS TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT TP_PROP_CHANNEL_DISPATCH_OPERATION_CHANNELS TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS TP_PROP_CHANNEL_INITIATOR_HANDLE TP_PROP_CHANNEL_INITIATOR_ID TP_PROP_CHANNEL_INTERFACES TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMITY_MODES TP_PROP_CHANNEL_INTERFACE_ANONYMITY_ANONYMOUS_ID TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAN_RETRY_CAPTCHA TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_ERROR_DETAILS TP_PROP_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_CAPTCHA_STATUS TP_PROP_CHANNEL_INTERFACE_CHAT_STATE_CHAT_STATES TP_PROP_CHANNEL_INTERFACE_CONFERENCE_CHANNELS TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_HANDLES TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INVITATION_MESSAGE TP_PROP_CHANNEL_INTERFACE_CONFERENCE_ORIGINAL_CHANNELS TP_PROP_CHANNEL_INTERFACE_DTMF_CURRENTLY_SENDING_TONES TP_PROP_CHANNEL_INTERFACE_DTMF_DEFERRED_TONES TP_PROP_CHANNEL_INTERFACE_DTMF_INITIAL_TONES TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS TP_PROP_CHANNEL_INTERFACE_GROUP_HANDLE_OWNERS TP_PROP_CHANNEL_INTERFACE_GROUP_LOCAL_PENDING_MEMBERS TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBERS TP_PROP_CHANNEL_INTERFACE_GROUP_MEMBER_IDENTIFIERS TP_PROP_CHANNEL_INTERFACE_GROUP_REMOTE_PENDING_MEMBERS TP_PROP_CHANNEL_INTERFACE_GROUP_SELF_HANDLE TP_PROP_CHANNEL_INTERFACE_MESSAGES_DELIVERY_REPORTING_SUPPORT TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_PART_SUPPORT_FLAGS TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_TYPES TP_PROP_CHANNEL_INTERFACE_MESSAGES_PENDING_MESSAGES TP_PROP_CHANNEL_INTERFACE_MESSAGES_SUPPORTED_CONTENT_TYPES TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_ANONYMOUS TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CAN_UPDATE_CONFIGURATION TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_CONFIGURATION_RETRIEVED TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_DESCRIPTION TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_INVITEONLY TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_LIMIT TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MODERATED TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_MUTABLE_PROPERTIES TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_HINT TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PASSWORD_PROTECTED TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PERSISTENT TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_PRIVATE TP_PROP_CHANNEL_INTERFACE_ROOM_CONFIG_TITLE TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER TP_PROP_CHANNEL_INTERFACE_ROOM_CREATION_TIMESTAMP TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR TP_PROP_CHANNEL_INTERFACE_ROOM_CREATOR_HANDLE TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AUTHORIZATION_IDENTITY TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_CAN_TRY_AGAIN TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_REALM TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_DEFAULT_USERNAME TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_HAS_INITIAL_DATA TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_MAY_SAVE_RESPONSE TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_ERROR_DETAILS TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_SASL_STATUS TP_PROP_CHANNEL_INTERFACE_SECURABLE_ENCRYPTED TP_PROP_CHANNEL_INTERFACE_SECURABLE_VERIFIED TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_CURRENT_SERVICE_POINT TP_PROP_CHANNEL_INTERFACE_SERVICE_POINT_INITIAL_SERVICE_POINT TP_PROP_CHANNEL_INTERFACE_SMS_FLASH TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR TP_PROP_CHANNEL_INTERFACE_SUBJECT_ACTOR_HANDLE TP_PROP_CHANNEL_INTERFACE_SUBJECT_CAN_SET TP_PROP_CHANNEL_INTERFACE_SUBJECT_SUBJECT TP_PROP_CHANNEL_INTERFACE_SUBJECT_TIMESTAMP TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS TP_PROP_CHANNEL_INTERFACE_TUBE_STATE TP_PROP_CHANNEL_TYPE_SERVER_AUTHENTICATION_AUTHENTICATION_METHOD TP_PROP_CHANNEL_REQUESTED TP_PROP_CHANNEL_REQUEST_ACCOUNT TP_PROP_CHANNEL_REQUEST_HINTS TP_PROP_CHANNEL_REQUEST_INTERFACES TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER TP_PROP_CHANNEL_REQUEST_REQUESTS TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME TP_PROP_CHANNEL_TARGET_HANDLE TP_PROP_CHANNEL_TARGET_HANDLE_TYPE TP_PROP_CHANNEL_TARGET_ID TP_PROP_CHANNEL_TYPE_CALL_CALL_FLAGS TP_PROP_CHANNEL_TYPE_CALL_CALL_MEMBERS TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_DETAILS TP_PROP_CHANNEL_TYPE_CALL_CALL_STATE_REASON TP_PROP_CHANNEL_TYPE_CALL_CONTENTS TP_PROP_CHANNEL_TYPE_CALL_HARDWARE_STREAMING TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO_NAME TP_PROP_CHANNEL_TYPE_CALL_INITIAL_TRANSPORT TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO_NAME TP_PROP_CHANNEL_TYPE_CALL_MEMBER_IDENTIFIERS TP_PROP_CHANNEL_TYPE_CALL_MUTABLE_CONTENTS TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_AVAILABLE_SEARCH_KEYS TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SEARCH_STATE TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER TP_PROP_CHANNEL_TYPE_DBUS_TUBE_DBUS_NAMES TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SUPPORTED_ACCESS_CONTROLS TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_AVAILABLE_SOCKET_TYPES TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILE_COLLECTION TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILE_COLLECTION TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_STATE TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_TRANSFERRED_BYTES TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_HOSTNAME TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_REFERENCE_IDENTITIES TP_PROP_CHANNEL_TYPE_SERVER_TLS_CONNECTION_SERVER_CERTIFICATE TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_IMMUTABLE_STREAMS TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES TP_PROP_CLIENT_APPROVER_APPROVER_CHANNEL_FILTER TP_PROP_CLIENT_HANDLER_BYPASS_APPROVAL TP_PROP_CLIENT_HANDLER_CAPABILITIES TP_PROP_CLIENT_HANDLER_HANDLED_CHANNELS TP_PROP_CLIENT_HANDLER_HANDLER_CHANNEL_FILTER TP_PROP_CLIENT_INTERFACES TP_PROP_CLIENT_OBSERVER_DELAY_APPROVERS TP_PROP_CLIENT_OBSERVER_OBSERVER_CHANNEL_FILTER TP_PROP_CLIENT_OBSERVER_RECOVER TP_PROP_CONNECTION_HAS_IMMORTAL_HANDLES TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MANDATORY TP_PROP_CONNECTION_INTERFACE_ANONYMITY_ANONYMITY_MODES TP_PROP_CONNECTION_INTERFACE_ANONYMITY_SUPPORTED_ANONYMITY_MODES TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT TP_PROP_CONNECTION_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT TP_PROP_CONNECTION_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT TP_PROP_CONNECTION_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH TP_PROP_CONNECTION_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES TP_PROP_CONNECTION_INTERFACE_BALANCE_ACCOUNT_BALANCE TP_PROP_CONNECTION_INTERFACE_BALANCE_MANAGE_CREDIT_URI TP_PROP_CONNECTION_INTERFACE_CELLULAR_IMSI TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_NATIONAL_CHARACTER_SET TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_REDUCED_CHARACTER_SET TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_SERVICE_CENTRE TP_PROP_CONNECTION_INTERFACE_CELLULAR_MESSAGE_VALIDITY_PERIOD TP_PROP_CONNECTION_INTERFACE_CELLULAR_OVERRIDE_MESSAGE_SERVICE_CENTRE TP_PROP_CONNECTION_INTERFACE_CONTACTS_CONTACT_ATTRIBUTE_INTERFACES TP_PROP_CONNECTION_INTERFACE_CONTACT_BLOCKING_CONTACT_BLOCKING_CAPABILITIES TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_DISJOINT_GROUPS TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS TP_PROP_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUP_STORAGE TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_CONTACT_INFO_FLAGS TP_PROP_CONNECTION_INTERFACE_CONTACT_INFO_SUPPORTED_FIELDS TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CAN_CHANGE_CONTACT_LIST TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_DOWNLOAD_AT_CONNECTION TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_REQUEST_USES_MESSAGE TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_PERSISTS TP_PROP_CONNECTION_INTERFACE_CONTACT_LIST_CONTACT_LIST_STATE TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL TP_PROP_CONNECTION_INTERFACE_LOCATION_LOCATION_ACCESS_CONTROL_TYPES TP_PROP_CONNECTION_INTERFACE_LOCATION_SUPPORTED_LOCATION_FEATURES TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_ADDRESS TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_MAIL_NOTIFICATION_FLAGS TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAILS TP_PROP_CONNECTION_INTERFACE_MAIL_NOTIFICATION_UNREAD_MAIL_COUNT TP_PROP_CONNECTION_INTERFACE_POWER_SAVING_POWER_SAVING_ACTIVE TP_PROP_CONNECTION_INTERFACE_REQUESTS_CHANNELS TP_PROP_CONNECTION_INTERFACE_REQUESTS_REQUESTABLE_CHANNEL_CLASSES TP_PROP_CONNECTION_INTERFACE_SERVICE_POINT_KNOWN_SERVICE_POINTS TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_STATUSES TP_PROP_CONNECTION_INTERFACE_SIMPLE_PRESENCE_MAXIMUM_STATUS_MESSAGE_LENGTH TP_PROP_CONNECTION_MANAGER_INTERFACES TP_PROP_CONNECTION_MANAGER_PROTOCOLS TP_PROP_CONNECTION_INTERFACES TP_PROP_CONNECTION_SELF_HANDLE TP_PROP_CONNECTION_SELF_ID TP_PROP_CONNECTION_STATUS TP_PROP_DEBUG_ENABLED TP_PROP_MEDIA_STREAM_HANDLER_CREATED_LOCALLY TP_PROP_MEDIA_STREAM_HANDLER_NAT_TRAVERSAL TP_PROP_MEDIA_STREAM_HANDLER_RELAY_INFO TP_PROP_MEDIA_STREAM_HANDLER_STUN_SERVERS TP_PROP_PROTOCOL_AUTHENTICATION_TYPES TP_PROP_PROTOCOL_CONNECTION_INTERFACES TP_PROP_PROTOCOL_ENGLISH_NAME TP_PROP_PROTOCOL_ICON TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_URI_SCHEMES TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES TP_PROP_PROTOCOL_INTERFACES TP_PROP_PROTOCOL_PARAMETERS TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES TP_PROP_PROTOCOL_VCARD_FIELD TP_TOKEN_CONNECTION_CONTACT_ID TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_ADDRESSES TP_TOKEN_CONNECTION_INTERFACE_ADDRESSING_URIS TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS TP_TOKEN_CONNECTION_INTERFACE_AVATARS_TOKEN TP_TOKEN_CONNECTION_INTERFACE_CAPABILITIES_CAPS TP_TOKEN_CONNECTION_INTERFACE_CLIENT_TYPES_CLIENT_TYPES TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS TP_TOKEN_CONNECTION_INTERFACE_CONTACT_INFO_INFO TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE TP_TOKEN_CONNECTION_INTERFACE_LOCATION_LOCATION TP_TOKEN_CHANNEL_TYPE_CALL_AUDIO TP_TOKEN_CHANNEL_TYPE_CALL_GTALK_P2P TP_TOKEN_CHANNEL_TYPE_CALL_ICE TP_TOKEN_CHANNEL_TYPE_CALL_SHM TP_TOKEN_CHANNEL_TYPE_CALL_VIDEO TP_TOKEN_CHANNEL_TYPE_CALL_WLM_2009 TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_GTALK_P2P TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_8_5 TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_WLM_2009 tp_iface_quark_account tp_iface_quark_account_interface_addressing tp_iface_quark_account_interface_avatar tp_iface_quark_account_interface_storage tp_iface_quark_account_manager tp_iface_quark_authentication_tls_certificate tp_iface_quark_dbus_introspectable tp_iface_quark_dbus_peer tp_iface_quark_dbus_properties tp_iface_quark_debug tp_iface_quark_channel tp_iface_quark_channel_interface_chat_state tp_iface_quark_channel_interface_conference tp_iface_quark_channel_interface_destroyable tp_iface_quark_channel_interface_dtmf tp_iface_quark_channel_interface_file_transfer_metadata tp_iface_quark_channel_interface_group tp_iface_quark_channel_interface_hold tp_iface_quark_channel_interface_media_signalling tp_iface_quark_channel_interface_messages tp_iface_quark_channel_interface_password tp_iface_quark_channel_interface_room tp_iface_quark_channel_interface_room_config tp_iface_quark_channel_interface_sasl_authentication tp_iface_quark_channel_interface_securable tp_iface_quark_channel_interface_sms tp_iface_quark_channel_interface_subject tp_iface_quark_channel_type_contact_list tp_iface_quark_channel_type_contact_search tp_iface_quark_channel_type_file_transfer tp_iface_quark_channel_type_room_list tp_iface_quark_channel_type_server_tls_connection tp_iface_quark_channel_type_streamed_media tp_iface_quark_channel_type_text tp_iface_quark_channel_type_tubes tp_iface_quark_channel_interface_tube tp_iface_quark_channel_type_dbus_tube tp_iface_quark_channel_type_server_authentication tp_iface_quark_channel_type_stream_tube tp_iface_quark_channel_dispatcher tp_iface_quark_channel_dispatcher_interface_messages1 tp_iface_quark_channel_dispatcher_interface_operation_list tp_iface_quark_channel_dispatch_operation tp_iface_quark_channel_request tp_iface_quark_client tp_iface_quark_client_approver tp_iface_quark_client_handler tp_iface_quark_client_interface_requests tp_iface_quark_client_observer tp_iface_quark_connection tp_iface_quark_connection_interface_aliasing tp_iface_quark_connection_interface_avatars tp_iface_quark_connection_interface_balance tp_iface_quark_connection_interface_cellular tp_iface_quark_connection_interface_client_types tp_iface_quark_connection_interface_contacts tp_iface_quark_connection_interface_contact_blocking tp_iface_quark_connection_interface_contact_capabilities tp_iface_quark_connection_interface_contact_groups tp_iface_quark_connection_interface_contact_info tp_iface_quark_connection_interface_contact_list tp_iface_quark_connection_interface_capabilities tp_iface_quark_connection_interface_mail_notification tp_iface_quark_connection_interface_renaming tp_iface_quark_connection_interface_requests tp_iface_quark_connection_interface_power_saving tp_iface_quark_connection_interface_sidecars1 tp_iface_quark_connection_interface_simple_presence tp_iface_quark_connection_interface_presence tp_iface_quark_connection_interface_location tp_iface_quark_connection_manager tp_iface_quark_dbus_daemon tp_iface_quark_media_session_handler tp_iface_quark_media_stream_handler tp_iface_quark_properties_interface tp_iface_quark_protocol tp_iface_quark_protocol_interface_addressing tp_iface_quark_protocol_interface_avatars tp_iface_quark_protocol_interface_presence tp_iface_quark_channel_interface_call_state tp_iface_quark_channel_interface_anonymity tp_iface_quark_channel_interface_service_point tp_iface_quark_connection_interface_anonymity tp_iface_quark_connection_interface_service_point tp_iface_quark_channel_interface_captcha_authentication tp_iface_quark_connection_interface_addressing tp_iface_quark_call_content tp_iface_quark_call_content_interface_media tp_iface_quark_call_content_interface_video_control tp_iface_quark_call_content_interface_audio_control tp_iface_quark_call_content_interface_dtmf tp_iface_quark_call_content_media_description tp_iface_quark_call_content_media_description_interface_rtcp_extended_reports tp_iface_quark_call_content_media_description_interface_rtcp_feedback tp_iface_quark_call_content_media_description_interface_rtp_header_extensions tp_iface_quark_call_stream tp_iface_quark_call_stream_endpoint tp_iface_quark_call_stream_interface_media tp_iface_quark_channel_type_call
proxy proxy telepathy-glib/telepathy-glib.h TpProxy TpProxyPrepareAsync TpProxyFeature TpProxyClassFeatureListFunc TpProxyClass tp_proxy_has_interface tp_proxy_has_interface_by_id tp_proxy_is_prepared tp_proxy_prepare_async tp_proxy_prepare_finish TpProxyPendingCall tp_proxy_pending_call_cancel TpProxySignalConnection tp_proxy_signal_connection_disconnect tp_proxy_get_factory tp_proxy_get_dbus_daemon tp_proxy_get_dbus_connection tp_proxy_get_bus_name tp_proxy_get_object_path tp_proxy_get_invalidated tp_proxy_dbus_error_to_gerror TP_DBUS_ERRORS TpDBusError NUM_TP_DBUS_ERRORS TP_NUM_DBUS_ERRORS TP_TYPE_DBUS_ERROR tp_dbus_error_get_type tp_dbus_errors_quark TpProxyPrivate TP_TYPE_PROXY tp_proxy_get_type TP_IS_PROXY TP_IS_PROXY_CLASS TP_PROXY TP_PROXY_CLASS TP_PROXY_GET_CLASS TpProxyFeaturePrivate
proxy-tp-properties proxy-tp-properties telepathy-glib/telepathy-glib-dbus.h tp_cli_properties_interface_callback_for_get_properties tp_cli_properties_interface_call_get_properties tp_cli_properties_interface_run_get_properties tp_cli_properties_interface_callback_for_list_properties tp_cli_properties_interface_call_list_properties tp_cli_properties_interface_run_list_properties tp_cli_properties_interface_callback_for_set_properties tp_cli_properties_interface_call_set_properties tp_cli_properties_interface_run_set_properties tp_cli_properties_interface_signal_callback_properties_changed tp_cli_properties_interface_connect_to_properties_changed tp_cli_properties_interface_signal_callback_property_flags_changed tp_cli_properties_interface_connect_to_property_flags_changed
proxy-dbus-core proxy-dbus-core telepathy-glib/telepathy-glib-dbus.h tp_cli_dbus_introspectable_call_introspect tp_cli_dbus_introspectable_callback_for_introspect tp_cli_dbus_introspectable_run_introspect tp_cli_dbus_peer_call_get_machine_id tp_cli_dbus_peer_call_ping tp_cli_dbus_peer_callback_for_get_machine_id tp_cli_dbus_peer_callback_for_ping tp_cli_dbus_peer_run_get_machine_id tp_cli_dbus_peer_run_ping tp_cli_dbus_properties_call_get tp_cli_dbus_properties_call_get_all tp_cli_dbus_properties_call_set tp_cli_dbus_properties_callback_for_get tp_cli_dbus_properties_callback_for_get_all tp_cli_dbus_properties_callback_for_set tp_cli_dbus_properties_run_get tp_cli_dbus_properties_run_get_all tp_cli_dbus_properties_signal_callback_properties_changed tp_cli_dbus_properties_connect_to_properties_changed tp_cli_dbus_properties_run_set
proxy-subclass proxy-subclass telepathy-glib/proxy-subclass.h tp_proxy_add_interface_by_id tp_proxy_add_interfaces tp_proxy_borrow_interface_by_id tp_proxy_get_interface_by_id tp_proxy_invalidate TpProxyInterfaceAddedCb tp_proxy_or_subclass_hook_on_interface_add tp_proxy_init_known_interfaces tp_proxy_subclass_add_error_mapping tp_proxy_dbus_g_proxy_claim_for_signal_adding TpProxyInvokeFunc tp_proxy_pending_call_v0_new tp_proxy_pending_call_v0_completed tp_proxy_pending_call_v0_take_pending_call tp_proxy_pending_call_v0_take_results tp_proxy_signal_connection_v0_new tp_proxy_signal_connection_v0_take_results
channel channel telepathy-glib/channel.h TpChannel TpChannelClass tp_channel_new tp_channel_new_from_properties tp_channel_run_until_ready TpChannelWhenReadyCb tp_channel_call_when_ready tp_channel_init_known_interfaces tp_channel_is_ready TP_CHANNEL_FEATURE_CORE TP_CHANNEL_FEATURE_CONTACTS tp_channel_borrow_connection tp_channel_borrow_immutable_properties tp_channel_get_connection tp_channel_dup_immutable_properties tp_channel_get_channel_type tp_channel_get_channel_type_id tp_channel_get_handle tp_channel_get_identifier tp_channel_get_target_contact tp_channel_get_requested tp_channel_get_initiator_handle tp_channel_get_initiator_identifier tp_channel_get_initiator_contact tp_channel_join_async tp_channel_join_finish tp_channel_leave_async tp_channel_leave_finish tp_channel_close_async tp_channel_close_finish tp_channel_destroy_async tp_channel_destroy_finish tp_channel_get_feature_quark_chat_states tp_channel_get_feature_quark_core tp_channel_get_feature_quark_group tp_channel_get_feature_quark_contacts tp_channel_get_feature_quark_password TP_CHANNEL_FEATURE_CHAT_STATES tp_channel_get_chat_state TP_CHANNEL_FEATURE_GROUP tp_channel_group_get_flags tp_channel_group_get_handle_owner tp_channel_group_get_contact_owner tp_channel_group_get_self_handle tp_channel_group_get_self_contact tp_channel_group_get_members tp_channel_group_dup_members_contacts tp_channel_group_get_local_pending tp_channel_group_dup_local_pending_contacts tp_channel_group_get_remote_pending tp_channel_group_dup_remote_pending_contacts tp_channel_group_get_local_pending_info tp_channel_group_get_local_pending_contact_info TP_ERRORS_REMOVED_FROM_GROUP TP_CHANNEL_FEATURE_PASSWORD tp_channel_password_needed tp_channel_provide_password_async tp_channel_provide_password_finish tp_errors_removed_from_group_quark tp_channel_get_type TP_TYPE_CHANNEL TP_CHANNEL TP_CHANNEL_CLASS TP_CHANNEL_GET_CLASS TP_IS_CHANNEL TP_IS_CHANNEL_CLASS tp_cli_channel_call_close tp_cli_channel_call_get_channel_type tp_cli_channel_call_get_handle tp_cli_channel_call_get_interfaces tp_cli_channel_callback_for_close tp_cli_channel_callback_for_get_channel_type tp_cli_channel_callback_for_get_handle tp_cli_channel_callback_for_get_interfaces tp_cli_channel_run_close tp_cli_channel_run_get_channel_type tp_cli_channel_run_get_handle tp_cli_channel_run_get_interfaces tp_cli_channel_connect_to_closed tp_cli_channel_signal_callback_closed tp_cli_channel_interface_destroyable_call_destroy tp_cli_channel_interface_destroyable_callback_for_destroy tp_cli_channel_interface_destroyable_run_destroy
channel-group channel-group telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_interface_group_run_add_members tp_cli_channel_interface_group_run_get_all_members tp_cli_channel_interface_group_run_get_group_flags tp_cli_channel_interface_group_run_get_handle_owners tp_cli_channel_interface_group_run_get_local_pending_members tp_cli_channel_interface_group_run_get_local_pending_members_with_info tp_cli_channel_interface_group_run_get_members tp_cli_channel_interface_group_run_get_remote_pending_members tp_cli_channel_interface_group_run_get_self_handle tp_cli_channel_interface_group_run_remove_members tp_cli_channel_interface_group_run_remove_members_with_reason tp_cli_channel_interface_group_call_add_members tp_cli_channel_interface_group_call_get_all_members tp_cli_channel_interface_group_call_get_group_flags tp_cli_channel_interface_group_call_get_handle_owners tp_cli_channel_interface_group_call_get_local_pending_members tp_cli_channel_interface_group_call_get_local_pending_members_with_info tp_cli_channel_interface_group_call_get_members tp_cli_channel_interface_group_call_get_remote_pending_members tp_cli_channel_interface_group_call_get_self_handle tp_cli_channel_interface_group_call_remove_members tp_cli_channel_interface_group_call_remove_members_with_reason tp_cli_channel_interface_group_callback_for_add_members tp_cli_channel_interface_group_callback_for_get_all_members tp_cli_channel_interface_group_callback_for_get_group_flags tp_cli_channel_interface_group_callback_for_get_handle_owners tp_cli_channel_interface_group_callback_for_get_local_pending_members tp_cli_channel_interface_group_callback_for_get_local_pending_members_with_info tp_cli_channel_interface_group_callback_for_get_members tp_cli_channel_interface_group_callback_for_get_remote_pending_members tp_cli_channel_interface_group_callback_for_get_self_handle tp_cli_channel_interface_group_callback_for_remove_members tp_cli_channel_interface_group_callback_for_remove_members_with_reason tp_cli_channel_interface_group_connect_to_group_flags_changed tp_cli_channel_interface_group_connect_to_members_changed tp_cli_channel_interface_group_connect_to_members_changed_detailed tp_cli_channel_interface_group_signal_callback_group_flags_changed tp_cli_channel_interface_group_signal_callback_members_changed tp_cli_channel_interface_group_signal_callback_members_changed_detailed tp_cli_channel_interface_group_connect_to_handle_owners_changed tp_cli_channel_interface_group_connect_to_self_handle_changed tp_cli_channel_interface_group_signal_callback_handle_owners_changed tp_cli_channel_interface_group_signal_callback_self_handle_changed tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed tp_cli_channel_interface_group_connect_to_self_contact_changed tp_cli_channel_interface_group_signal_callback_handle_owners_changed_detailed tp_cli_channel_interface_group_signal_callback_self_contact_changed tp_svc_channel_interface_group_emit_handle_owners_changed_detailed tp_svc_channel_interface_group_emit_self_contact_changed tp_cli_channel_interface_conference_connect_to_channel_merged tp_cli_channel_interface_conference_connect_to_channel_removed tp_cli_channel_interface_conference_signal_callback_channel_merged tp_cli_channel_interface_conference_signal_callback_channel_removed
channel-text channel-text telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_text_run_acknowledge_pending_messages tp_cli_channel_type_text_run_get_message_types tp_cli_channel_type_text_run_list_pending_messages tp_cli_channel_type_text_run_send tp_cli_channel_type_text_call_acknowledge_pending_messages tp_cli_channel_type_text_call_get_message_types tp_cli_channel_type_text_call_list_pending_messages tp_cli_channel_type_text_call_send tp_cli_channel_type_text_callback_for_acknowledge_pending_messages tp_cli_channel_type_text_callback_for_get_message_types tp_cli_channel_type_text_callback_for_list_pending_messages tp_cli_channel_type_text_callback_for_send tp_cli_channel_type_text_connect_to_lost_message tp_cli_channel_type_text_connect_to_received tp_cli_channel_type_text_connect_to_send_error tp_cli_channel_type_text_connect_to_sent tp_cli_channel_type_text_signal_callback_lost_message tp_cli_channel_type_text_signal_callback_received tp_cli_channel_type_text_signal_callback_send_error tp_cli_channel_type_text_signal_callback_sent tp_cli_channel_interface_messages_callback_for_get_pending_message_content tp_cli_channel_interface_messages_call_get_pending_message_content tp_cli_channel_interface_messages_run_get_pending_message_content tp_cli_channel_interface_messages_callback_for_send_message tp_cli_channel_interface_messages_call_send_message tp_cli_channel_interface_messages_run_send_message tp_cli_channel_interface_messages_signal_callback_message_received tp_cli_channel_interface_messages_connect_to_message_received tp_cli_channel_interface_messages_signal_callback_message_sent tp_cli_channel_interface_messages_connect_to_message_sent tp_cli_channel_interface_messages_signal_callback_pending_messages_removed tp_cli_channel_interface_messages_connect_to_pending_messages_removed tp_cli_channel_interface_chat_state_run_set_chat_state tp_cli_channel_interface_chat_state_call_set_chat_state tp_cli_channel_interface_chat_state_callback_for_set_chat_state tp_cli_channel_interface_chat_state_connect_to_chat_state_changed tp_cli_channel_interface_chat_state_signal_callback_chat_state_changed tp_cli_channel_interface_password_run_get_password_flags tp_cli_channel_interface_password_run_provide_password tp_cli_channel_interface_password_call_get_password_flags tp_cli_channel_interface_password_call_provide_password tp_cli_channel_interface_password_callback_for_get_password_flags tp_cli_channel_interface_password_callback_for_provide_password tp_cli_channel_interface_password_connect_to_password_flags_changed tp_cli_channel_interface_password_signal_callback_password_flags_changed tp_cli_channel_interface_sms_connect_to_sms_channel_changed tp_cli_channel_interface_sms_signal_callback_sms_channel_changed tp_cli_channel_interface_sms_call_get_sms_length tp_cli_channel_interface_sms_callback_for_get_sms_length tp_cli_channel_interface_sms_run_get_sms_length
channel-room channel-room telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_interface_room_config_call_update_configuration tp_cli_channel_interface_room_config_callback_for_update_configuration tp_cli_channel_interface_subject_call_set_subject tp_cli_channel_interface_subject_callback_for_set_subject
channel-file-transfer channel-file-transfer telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_file_transfer_call_accept_file tp_cli_channel_type_file_transfer_call_provide_file tp_cli_channel_type_file_transfer_callback_for_accept_file tp_cli_channel_type_file_transfer_callback_for_provide_file tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed tp_cli_channel_type_file_transfer_connect_to_uri_defined tp_cli_channel_type_file_transfer_run_accept_file tp_cli_channel_type_file_transfer_run_provide_file tp_cli_channel_type_file_transfer_signal_callback_file_transfer_state_changed tp_cli_channel_type_file_transfer_signal_callback_initial_offset_defined tp_cli_channel_type_file_transfer_signal_callback_transferred_bytes_changed tp_cli_channel_type_file_transfer_signal_callback_uri_defined
channel-media channel-media telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_streamed_media_call_list_streams tp_cli_channel_type_streamed_media_call_remove_streams tp_cli_channel_type_streamed_media_call_request_stream_direction tp_cli_channel_type_streamed_media_call_request_streams tp_cli_channel_type_streamed_media_callback_for_list_streams tp_cli_channel_type_streamed_media_callback_for_remove_streams tp_cli_channel_type_streamed_media_callback_for_request_stream_direction tp_cli_channel_type_streamed_media_callback_for_request_streams tp_cli_channel_type_streamed_media_run_list_streams tp_cli_channel_type_streamed_media_run_remove_streams tp_cli_channel_type_streamed_media_run_request_stream_direction tp_cli_channel_type_streamed_media_run_request_streams tp_cli_channel_type_streamed_media_connect_to_stream_added tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed tp_cli_channel_type_streamed_media_connect_to_stream_error tp_cli_channel_type_streamed_media_connect_to_stream_removed tp_cli_channel_type_streamed_media_connect_to_stream_state_changed tp_cli_channel_type_streamed_media_signal_callback_stream_added tp_cli_channel_type_streamed_media_signal_callback_stream_direction_changed tp_cli_channel_type_streamed_media_signal_callback_stream_error tp_cli_channel_type_streamed_media_signal_callback_stream_removed tp_cli_channel_type_streamed_media_signal_callback_stream_state_changed tp_cli_channel_interface_call_state_call_get_call_states tp_cli_channel_interface_call_state_callback_for_get_call_states tp_cli_channel_interface_call_state_connect_to_call_state_changed tp_cli_channel_interface_call_state_run_get_call_states tp_cli_channel_interface_call_state_signal_callback_call_state_changed tp_cli_channel_interface_dtmf_run_start_tone tp_cli_channel_interface_dtmf_run_stop_tone tp_cli_channel_interface_dtmf_call_start_tone tp_cli_channel_interface_dtmf_call_stop_tone tp_cli_channel_interface_dtmf_callback_for_start_tone tp_cli_channel_interface_dtmf_callback_for_stop_tone tp_cli_channel_interface_dtmf_call_multiple_tones tp_cli_channel_interface_dtmf_callback_for_multiple_tones tp_cli_channel_interface_dtmf_connect_to_sending_tones tp_cli_channel_interface_dtmf_signal_callback_sending_tones tp_cli_channel_interface_dtmf_connect_to_stopped_tones tp_cli_channel_interface_dtmf_signal_callback_stopped_tones tp_cli_channel_interface_dtmf_connect_to_tones_deferred tp_cli_channel_interface_dtmf_signal_callback_tones_deferred tp_cli_channel_interface_hold_callback_for_get_hold_state tp_cli_channel_interface_hold_call_get_hold_state tp_cli_channel_interface_hold_run_get_hold_state tp_cli_channel_interface_hold_callback_for_request_hold tp_cli_channel_interface_hold_call_request_hold tp_cli_channel_interface_hold_run_request_hold tp_cli_channel_interface_hold_signal_callback_hold_state_changed tp_cli_channel_interface_hold_connect_to_hold_state_changed tp_cli_channel_interface_media_signalling_run_get_session_handlers tp_cli_channel_interface_media_signalling_call_get_session_handlers tp_cli_channel_interface_media_signalling_callback_for_get_session_handlers tp_cli_channel_interface_media_signalling_connect_to_new_session_handler tp_cli_channel_interface_media_signalling_signal_callback_new_session_handler tp_cli_channel_interface_dtmf_run_multiple_tones
channel-tubes channel-tubes telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_tubes_run_accept_d_bus_tube tp_cli_channel_type_tubes_run_accept_stream_tube tp_cli_channel_type_tubes_run_close_tube tp_cli_channel_type_tubes_run_get_available_stream_tube_types tp_cli_channel_type_tubes_run_get_available_tube_types tp_cli_channel_type_tubes_run_get_d_bus_names tp_cli_channel_type_tubes_run_get_d_bus_tube_address tp_cli_channel_type_tubes_run_get_stream_tube_socket_address tp_cli_channel_type_tubes_run_list_tubes tp_cli_channel_type_tubes_run_offer_d_bus_tube tp_cli_channel_type_tubes_run_offer_stream_tube tp_cli_channel_type_tubes_call_accept_d_bus_tube tp_cli_channel_type_tubes_call_accept_stream_tube tp_cli_channel_type_tubes_call_close_tube tp_cli_channel_type_tubes_call_get_available_stream_tube_types tp_cli_channel_type_tubes_call_get_available_tube_types tp_cli_channel_type_tubes_call_get_d_bus_names tp_cli_channel_type_tubes_call_get_d_bus_tube_address tp_cli_channel_type_tubes_call_get_stream_tube_socket_address tp_cli_channel_type_tubes_call_list_tubes tp_cli_channel_type_tubes_call_offer_d_bus_tube tp_cli_channel_type_tubes_call_offer_stream_tube tp_cli_channel_type_tubes_callback_for_accept_d_bus_tube tp_cli_channel_type_tubes_callback_for_accept_stream_tube tp_cli_channel_type_tubes_callback_for_close_tube tp_cli_channel_type_tubes_callback_for_get_available_stream_tube_types tp_cli_channel_type_tubes_callback_for_get_available_tube_types tp_cli_channel_type_tubes_callback_for_get_d_bus_names tp_cli_channel_type_tubes_callback_for_get_d_bus_tube_address tp_cli_channel_type_tubes_callback_for_get_stream_tube_socket_address tp_cli_channel_type_tubes_callback_for_list_tubes tp_cli_channel_type_tubes_callback_for_offer_d_bus_tube tp_cli_channel_type_tubes_callback_for_offer_stream_tube tp_cli_channel_type_tubes_connect_to_d_bus_names_changed tp_cli_channel_type_tubes_connect_to_new_tube tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection tp_cli_channel_type_tubes_connect_to_tube_closed tp_cli_channel_type_tubes_connect_to_tube_state_changed tp_cli_channel_type_tubes_signal_callback_d_bus_names_changed tp_cli_channel_type_tubes_signal_callback_new_tube tp_cli_channel_type_tubes_signal_callback_stream_tube_new_connection tp_cli_channel_type_tubes_signal_callback_tube_closed tp_cli_channel_type_tubes_signal_callback_tube_state_changed
channel-tube channel-tube telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed tp_cli_channel_interface_tube_signal_callback_tube_channel_state_changed tp_cli_channel_type_stream_tube_run_offer tp_cli_channel_type_stream_tube_run_accept tp_cli_channel_type_stream_tube_call_offer tp_cli_channel_type_stream_tube_call_accept tp_cli_channel_type_stream_tube_callback_for_offer tp_cli_channel_type_stream_tube_callback_for_accept tp_cli_channel_type_stream_tube_connect_to_new_remote_connection tp_cli_channel_type_stream_tube_connect_to_new_local_connection tp_cli_channel_type_stream_tube_connect_to_connection_closed tp_cli_channel_type_stream_tube_signal_callback_new_remote_connection tp_cli_channel_type_stream_tube_signal_callback_new_local_connection tp_cli_channel_type_stream_tube_signal_callback_connection_closed tp_cli_channel_type_dbus_tube_run_offer tp_cli_channel_type_dbus_tube_run_accept tp_cli_channel_type_dbus_tube_call_offer tp_cli_channel_type_dbus_tube_call_accept tp_cli_channel_type_dbus_tube_callback_for_offer tp_cli_channel_type_dbus_tube_callback_for_accept tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed tp_cli_channel_type_dbus_tube_signal_callback_dbus_names_changed
channel-roomlist channel-roomlist telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_room_list_call_get_listing_rooms tp_cli_channel_type_room_list_call_list_rooms tp_cli_channel_type_room_list_call_stop_listing tp_cli_channel_type_room_list_callback_for_get_listing_rooms tp_cli_channel_type_room_list_callback_for_list_rooms tp_cli_channel_type_room_list_callback_for_stop_listing tp_cli_channel_type_room_list_run_get_listing_rooms tp_cli_channel_type_room_list_run_list_rooms tp_cli_channel_type_room_list_run_stop_listing tp_cli_channel_type_room_list_connect_to_got_rooms tp_cli_channel_type_room_list_connect_to_listing_rooms tp_cli_channel_type_room_list_signal_callback_got_rooms tp_cli_channel_type_room_list_signal_callback_listing_rooms
cli-anonymity cli-anonymity telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed tp_cli_connection_interface_anonymity_signal_callback_anonymity_modes_changed
cli-service-point cli-service-point telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_interface_service_point_connect_to_service_point_changed tp_cli_channel_interface_service_point_signal_callback_service_point_changed tp_cli_connection_interface_service_point_connect_to_service_points_changed tp_cli_connection_interface_service_point_signal_callback_service_points_changed
connection connection telepathy-glib/telepathy-glib.h TpConnectionNameListCb tp_list_connection_names TpConnection TpConnectionClass tp_connection_new TP_CONNECTION_FEATURE_CORE TP_CONNECTION_FEATURE_CONNECTED TP_CONNECTION_FEATURE_CAPABILITIES TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS TP_CONNECTION_FEATURE_CONTACT_INFO TP_CONNECTION_FEATURE_BALANCE TP_CONNECTION_FEATURE_CONTACT_LIST TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES TP_CONNECTION_FEATURE_CONTACT_GROUPS TP_CONNECTION_FEATURE_CONTACT_BLOCKING TP_CONNECTION_FEATURE_ALIASING tp_connection_run_until_ready TpConnectionWhenReadyCb tp_connection_call_when_ready tp_connection_is_ready tp_connection_disconnect_async tp_connection_disconnect_finish tp_connection_get_account tp_connection_get_status tp_connection_get_connection_manager_name tp_connection_get_cm_name tp_connection_get_protocol_name tp_connection_get_self_contact tp_connection_get_self_handle tp_connection_has_immortal_handles TpConnectionRequestHandlesCb tp_connection_request_handles TpConnectionHoldHandlesCb tp_connection_get_contact_attributes tp_connection_get_contact_list_attributes tp_connection_hold_handles tp_connection_unref_handles tp_connection_init_known_interfaces tp_connection_presence_type_cmp_availability tp_connection_parse_object_path tp_connection_get_capabilities tp_connection_get_avatar_requirements tp_connection_get_contact_info_flags tp_connection_get_contact_info_supported_fields tp_connection_dup_contact_info_supported_fields tp_connection_set_contact_info_async tp_connection_set_contact_info_finish TP_UNKNOWN_CONNECTION_STATUS TP_ERRORS_DISCONNECTED tp_connection_get_detailed_error tp_connection_dup_detailed_error_vardict tp_connection_add_client_interest tp_connection_add_client_interest_by_id tp_connection_bind_connection_status_to_property tp_connection_get_balance tp_connection_get_balance_uri tp_errors_disconnected_quark tp_connection_get_type TP_TYPE_CONNECTION TP_CONNECTION TP_CONNECTION_CLASS TP_CONNECTION_GET_CLASS TP_IS_CONNECTION TP_IS_CONNECTION_CLASS TpConnectionPrivate tp_avatar_requirements_get_type tp_contact_info_field_spec_get_type tp_contact_info_spec_list_get_type tp_contact_info_field_get_type tp_contact_info_list_get_type tp_connection_get_feature_quark_core tp_connection_get_feature_quark_connected tp_connection_get_feature_quark_capabilities tp_connection_get_feature_quark_avatar_requirements tp_connection_get_feature_quark_contact_info tp_connection_get_feature_quark_balance tp_connection_get_feature_quark_contact_list tp_connection_get_feature_quark_contact_list_properties tp_connection_get_feature_quark_contact_groups tp_connection_get_feature_quark_contact_blocking tp_connection_get_feature_quark_aliasing TP_TYPE_AVATAR_REQUIREMENTS TpAvatarRequirements tp_avatar_requirements_new tp_avatar_requirements_copy tp_avatar_requirements_destroy TpContactInfoFieldSpec TP_TYPE_CONTACT_INFO_FIELD_SPEC tp_contact_info_field_spec_copy tp_contact_info_field_spec_free TP_TYPE_CONTACT_INFO_SPEC_LIST tp_contact_info_spec_list_copy tp_contact_info_spec_list_free TpContactInfoField TP_TYPE_CONTACT_INFO_FIELD tp_contact_info_field_new tp_contact_info_field_copy tp_contact_info_field_free TP_TYPE_CONTACT_INFO_LIST tp_contact_info_list_copy tp_contact_info_list_free TpContactInfoSpecList TpContactInfoList tp_connection_get_contact_list_state tp_connection_get_contact_list_persists tp_connection_get_can_change_contact_list tp_connection_get_request_uses_message tp_connection_dup_contact_list tp_connection_request_subscription_async tp_connection_request_subscription_finish tp_connection_authorize_publication_async tp_connection_authorize_publication_finish tp_connection_remove_contacts_async tp_connection_remove_contacts_finish tp_connection_unsubscribe_async tp_connection_unsubscribe_finish tp_connection_unpublish_async tp_connection_unpublish_finish tp_connection_get_disjoint_groups tp_connection_get_group_storage tp_connection_get_contact_groups tp_connection_set_group_members_async tp_connection_set_group_members_finish tp_connection_add_to_group_async tp_connection_add_to_group_finish tp_connection_remove_from_group_async tp_connection_remove_from_group_finish tp_connection_remove_group_async tp_connection_remove_group_finish tp_connection_rename_group_async tp_connection_rename_group_finish tp_connection_block_contacts_async tp_connection_block_contacts_finish tp_connection_unblock_contacts_async tp_connection_unblock_contacts_finish tp_connection_can_report_abusive tp_connection_get_blocked_contacts tp_connection_can_set_contact_alias tp_cli_connection_callback_for_connect tp_cli_connection_call_connect tp_cli_connection_run_connect tp_cli_connection_callback_for_disconnect tp_cli_connection_call_disconnect tp_cli_connection_run_disconnect tp_cli_connection_callback_for_get_interfaces tp_cli_connection_call_get_interfaces tp_cli_connection_run_get_interfaces tp_cli_connection_callback_for_get_protocol tp_cli_connection_call_get_protocol tp_cli_connection_run_get_protocol tp_cli_connection_callback_for_get_self_handle tp_cli_connection_call_get_self_handle tp_cli_connection_run_get_self_handle tp_cli_connection_callback_for_get_status tp_cli_connection_call_get_status tp_cli_connection_run_get_status tp_cli_connection_callback_for_hold_handles tp_cli_connection_call_hold_handles tp_cli_connection_run_hold_handles tp_cli_connection_callback_for_inspect_handles tp_cli_connection_call_inspect_handles tp_cli_connection_run_inspect_handles tp_cli_connection_callback_for_list_channels tp_cli_connection_call_list_channels tp_cli_connection_run_list_channels tp_cli_connection_callback_for_release_handles tp_cli_connection_call_release_handles tp_cli_connection_run_release_handles tp_cli_connection_callback_for_request_channel tp_cli_connection_call_request_channel tp_cli_connection_run_request_channel tp_cli_connection_callback_for_request_handles tp_cli_connection_call_request_handles tp_cli_connection_run_request_handles tp_cli_connection_signal_callback_new_channel tp_cli_connection_connect_to_new_channel tp_cli_connection_signal_callback_self_handle_changed tp_cli_connection_connect_to_self_handle_changed tp_cli_connection_signal_callback_self_contact_changed tp_cli_connection_connect_to_self_contact_changed tp_cli_connection_signal_callback_status_changed tp_cli_connection_connect_to_status_changed tp_cli_connection_signal_callback_connection_error tp_cli_connection_connect_to_connection_error tp_cli_connection_call_add_client_interest tp_cli_connection_call_remove_client_interest tp_cli_connection_callback_for_add_client_interest tp_cli_connection_callback_for_remove_client_interest tp_cli_connection_run_add_client_interest tp_cli_connection_run_remove_client_interest
connection-aliasing connection-aliasing telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_aliasing_run_get_alias_flags tp_cli_connection_interface_aliasing_run_request_aliases tp_cli_connection_interface_aliasing_run_get_aliases tp_cli_connection_interface_aliasing_run_set_aliases tp_cli_connection_interface_aliasing_call_get_alias_flags tp_cli_connection_interface_aliasing_call_request_aliases tp_cli_connection_interface_aliasing_call_get_aliases tp_cli_connection_interface_aliasing_call_set_aliases tp_cli_connection_interface_aliasing_callback_for_get_alias_flags tp_cli_connection_interface_aliasing_callback_for_request_aliases tp_cli_connection_interface_aliasing_callback_for_get_aliases tp_cli_connection_interface_aliasing_callback_for_set_aliases tp_cli_connection_interface_aliasing_connect_to_aliases_changed tp_cli_connection_interface_aliasing_signal_callback_aliases_changed
connection-renaming connection-renaming telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_renaming_call_request_rename tp_cli_connection_interface_renaming_callback_for_request_rename tp_cli_connection_interface_renaming_connect_to_renamed tp_cli_connection_interface_renaming_signal_callback_renamed
connection-sidecars connection-sidecars telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_sidecars1_call_ensure_sidecar tp_cli_connection_interface_sidecars1_callback_for_ensure_sidecar
connection-avatars connection-avatars telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_avatars_run_clear_avatar tp_cli_connection_interface_avatars_run_get_avatar_requirements tp_cli_connection_interface_avatars_run_get_avatar_tokens tp_cli_connection_interface_avatars_run_get_known_avatar_tokens tp_cli_connection_interface_avatars_run_request_avatar tp_cli_connection_interface_avatars_run_request_avatars tp_cli_connection_interface_avatars_run_set_avatar tp_cli_connection_interface_avatars_call_clear_avatar tp_cli_connection_interface_avatars_call_get_avatar_requirements tp_cli_connection_interface_avatars_call_get_avatar_tokens tp_cli_connection_interface_avatars_call_get_known_avatar_tokens tp_cli_connection_interface_avatars_call_request_avatar tp_cli_connection_interface_avatars_call_request_avatars tp_cli_connection_interface_avatars_call_set_avatar tp_cli_connection_interface_avatars_callback_for_clear_avatar tp_cli_connection_interface_avatars_callback_for_get_avatar_requirements tp_cli_connection_interface_avatars_callback_for_get_avatar_tokens tp_cli_connection_interface_avatars_callback_for_get_known_avatar_tokens tp_cli_connection_interface_avatars_callback_for_request_avatar tp_cli_connection_interface_avatars_callback_for_request_avatars tp_cli_connection_interface_avatars_callback_for_set_avatar tp_cli_connection_interface_avatars_connect_to_avatar_retrieved tp_cli_connection_interface_avatars_connect_to_avatar_updated tp_cli_connection_interface_avatars_signal_callback_avatar_retrieved tp_cli_connection_interface_avatars_signal_callback_avatar_updated
connection-balance connection-balance telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_balance_connect_to_balance_changed tp_cli_connection_interface_balance_signal_callback_balance_changed
connection-caps connection-caps telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_contact_capabilities_callback_for_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_call_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_callback_for_update_capabilities tp_cli_connection_interface_contact_capabilities_call_update_capabilities tp_cli_connection_interface_contact_capabilities_signal_callback_contact_capabilities_changed tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed tp_cli_connection_interface_contact_capabilities_run_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_run_update_capabilities tp_cli_connection_interface_capabilities_run_advertise_capabilities tp_cli_connection_interface_capabilities_run_get_capabilities tp_cli_connection_interface_capabilities_call_advertise_capabilities tp_cli_connection_interface_capabilities_call_get_capabilities tp_cli_connection_interface_capabilities_callback_for_advertise_capabilities tp_cli_connection_interface_capabilities_callback_for_get_capabilities tp_cli_connection_interface_capabilities_connect_to_capabilities_changed tp_cli_connection_interface_capabilities_signal_callback_capabilities_changed
connection-contact-list connection-contact-list telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_contact_blocking_call_block_contacts tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts tp_cli_connection_interface_contact_blocking_call_unblock_contacts tp_cli_connection_interface_contact_blocking_callback_for_block_contacts tp_cli_connection_interface_contact_blocking_callback_for_request_blocked_contacts tp_cli_connection_interface_contact_blocking_callback_for_unblock_contacts tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed tp_cli_connection_interface_contact_blocking_run_block_contacts tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts tp_cli_connection_interface_contact_blocking_run_unblock_contacts tp_cli_connection_interface_contact_blocking_signal_callback_blocked_contacts_changed tp_cli_connection_interface_contact_groups_call_add_to_group tp_cli_connection_interface_contact_groups_call_remove_from_group tp_cli_connection_interface_contact_groups_call_remove_group tp_cli_connection_interface_contact_groups_call_rename_group tp_cli_connection_interface_contact_groups_call_set_contact_groups tp_cli_connection_interface_contact_groups_call_set_group_members tp_cli_connection_interface_contact_groups_callback_for_add_to_group tp_cli_connection_interface_contact_groups_callback_for_remove_from_group tp_cli_connection_interface_contact_groups_callback_for_remove_group tp_cli_connection_interface_contact_groups_callback_for_rename_group tp_cli_connection_interface_contact_groups_callback_for_set_contact_groups tp_cli_connection_interface_contact_groups_callback_for_set_group_members tp_cli_connection_interface_contact_groups_connect_to_group_renamed tp_cli_connection_interface_contact_groups_connect_to_groups_changed tp_cli_connection_interface_contact_groups_connect_to_groups_created tp_cli_connection_interface_contact_groups_connect_to_groups_removed tp_cli_connection_interface_contact_groups_signal_callback_group_renamed tp_cli_connection_interface_contact_groups_signal_callback_groups_changed tp_cli_connection_interface_contact_groups_signal_callback_groups_created tp_cli_connection_interface_contact_groups_signal_callback_groups_removed tp_cli_connection_interface_contact_list_call_authorize_publication tp_cli_connection_interface_contact_list_call_download tp_cli_connection_interface_contact_list_call_remove_contacts tp_cli_connection_interface_contact_list_call_request_subscription tp_cli_connection_interface_contact_list_call_unpublish tp_cli_connection_interface_contact_list_call_unsubscribe tp_cli_connection_interface_contact_list_callback_for_authorize_publication tp_cli_connection_interface_contact_list_callback_for_download tp_cli_connection_interface_contact_list_callback_for_remove_contacts tp_cli_connection_interface_contact_list_callback_for_request_subscription tp_cli_connection_interface_contact_list_callback_for_unpublish tp_cli_connection_interface_contact_list_callback_for_unsubscribe tp_cli_connection_interface_contact_list_connect_to_contacts_changed tp_cli_connection_interface_contact_list_signal_callback_contacts_changed_with_id tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id tp_cli_connection_interface_contact_list_signal_callback_contacts_changed tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed tp_cli_connection_interface_contact_list_signal_callback_contact_list_state_changed # deliberately "undocumented" because it can interfere with handle ownership # tracking tp_cli_connection_interface_contact_list_call_get_contact_list_attributes tp_cli_connection_interface_contact_list_callback_for_get_contact_list_attributes # "undocumented" because they were already deprecated when introduced tp_cli_connection_interface_contact_list_run_get_contact_list_attributes tp_cli_connection_interface_contact_list_run_authorize_publication tp_cli_connection_interface_contact_list_run_remove_contacts tp_cli_connection_interface_contact_list_run_request_subscription tp_cli_connection_interface_contact_list_run_unpublish tp_cli_connection_interface_contact_list_run_unsubscribe tp_cli_connection_interface_contact_groups_run_add_to_group tp_cli_connection_interface_contact_groups_run_remove_from_group tp_cli_connection_interface_contact_groups_run_remove_group tp_cli_connection_interface_contact_groups_run_rename_group tp_cli_connection_interface_contact_groups_run_set_contact_groups tp_cli_connection_interface_contact_groups_run_set_group_members
connection-cellular connection-cellular telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_cellular_connect_to_imsi_changed tp_cli_connection_interface_cellular_signal_callback_imsi_changed
connection-contacts connection-contacts telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_contacts_call_get_contact_attributes tp_cli_connection_interface_contacts_callback_for_get_contact_attributes tp_cli_connection_interface_contacts_run_get_contact_attributes tp_cli_connection_interface_contacts_call_get_contact_by_id tp_cli_connection_interface_contacts_callback_for_get_contact_by_id
connection-contact-info connection-contact-info telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_contact_info_call_get_contact_info tp_cli_connection_interface_contact_info_call_refresh_contact_info tp_cli_connection_interface_contact_info_call_request_contact_info tp_cli_connection_interface_contact_info_call_set_contact_info tp_cli_connection_interface_contact_info_callback_for_get_contact_info tp_cli_connection_interface_contact_info_callback_for_refresh_contact_info tp_cli_connection_interface_contact_info_callback_for_request_contact_info tp_cli_connection_interface_contact_info_callback_for_set_contact_info tp_cli_connection_interface_contact_info_connect_to_contact_info_changed tp_cli_connection_interface_contact_info_run_get_contact_info tp_cli_connection_interface_contact_info_run_refresh_contact_info tp_cli_connection_interface_contact_info_run_request_contact_info tp_cli_connection_interface_contact_info_run_set_contact_info tp_cli_connection_interface_contact_info_signal_callback_contact_info_changed
connection-requests connection-requests telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_requests_call_create_channel tp_cli_connection_interface_requests_call_ensure_channel tp_cli_connection_interface_requests_callback_for_create_channel tp_cli_connection_interface_requests_callback_for_ensure_channel tp_cli_connection_interface_requests_connect_to_channel_closed tp_cli_connection_interface_requests_connect_to_new_channels tp_cli_connection_interface_requests_run_create_channel tp_cli_connection_interface_requests_run_ensure_channel tp_cli_connection_interface_requests_signal_callback_channel_closed tp_cli_connection_interface_requests_signal_callback_new_channels
connection-simple-presence connection-simple-presence telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_simple_presence_run_get_presences tp_cli_connection_interface_simple_presence_run_set_presence tp_cli_connection_interface_simple_presence_call_get_presences tp_cli_connection_interface_simple_presence_call_set_presence tp_cli_connection_interface_simple_presence_callback_for_get_presences tp_cli_connection_interface_simple_presence_callback_for_set_presence tp_cli_connection_interface_simple_presence_connect_to_presences_changed tp_cli_connection_interface_simple_presence_signal_callback_presences_changed
connection-location connection-location telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_location_connect_to_location_updated tp_cli_connection_interface_location_signal_callback_location_updated tp_cli_connection_interface_location_call_get_locations tp_cli_connection_interface_location_callback_for_get_locations tp_cli_connection_interface_location_call_request_location tp_cli_connection_interface_location_callback_for_request_location tp_cli_connection_interface_location_call_set_location tp_cli_connection_interface_location_callback_for_set_location # Omit these from the docs as a mild form of deprecation... tp_cli_connection_interface_location_run_get_locations tp_cli_connection_interface_location_run_request_location tp_cli_connection_interface_location_run_set_location
connection-presence connection-presence telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_presence_run_add_status tp_cli_connection_interface_presence_run_clear_status tp_cli_connection_interface_presence_run_get_presence tp_cli_connection_interface_presence_run_get_statuses tp_cli_connection_interface_presence_run_remove_status tp_cli_connection_interface_presence_run_request_presence tp_cli_connection_interface_presence_run_set_last_activity_time tp_cli_connection_interface_presence_run_set_status tp_cli_connection_interface_presence_call_add_status tp_cli_connection_interface_presence_call_clear_status tp_cli_connection_interface_presence_call_get_presence tp_cli_connection_interface_presence_call_get_statuses tp_cli_connection_interface_presence_call_remove_status tp_cli_connection_interface_presence_call_request_presence tp_cli_connection_interface_presence_call_set_last_activity_time tp_cli_connection_interface_presence_call_set_status tp_cli_connection_interface_presence_callback_for_add_status tp_cli_connection_interface_presence_callback_for_clear_status tp_cli_connection_interface_presence_callback_for_get_presence tp_cli_connection_interface_presence_callback_for_get_statuses tp_cli_connection_interface_presence_callback_for_remove_status tp_cli_connection_interface_presence_callback_for_request_presence tp_cli_connection_interface_presence_callback_for_set_last_activity_time tp_cli_connection_interface_presence_callback_for_set_status tp_cli_connection_interface_presence_connect_to_presence_update tp_cli_connection_interface_presence_signal_callback_presence_update
connection-powersaving connection-powersaving telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_power_saving_call_set_power_saving tp_cli_connection_interface_power_saving_callback_for_set_power_saving tp_cli_connection_interface_power_saving_connect_to_power_saving_changed tp_cli_connection_interface_power_saving_signal_callback_power_saving_changed tp_cli_connection_interface_power_saving_run_set_power_saving
connection-client-types connection-client-types telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_client_types_call_get_client_types tp_cli_connection_interface_client_types_call_request_client_types tp_cli_connection_interface_client_types_callback_for_get_client_types tp_cli_connection_interface_client_types_callback_for_request_client_types tp_cli_connection_interface_client_types_connect_to_client_types_updated tp_cli_connection_interface_client_types_signal_callback_client_types_updated tp_cli_connection_interface_client_types_run_get_client_types tp_cli_connection_interface_client_types_run_request_client_types
connection-mail connection-mail telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_mail_notification_call_request_inbox_url tp_cli_connection_interface_mail_notification_call_request_mail_url tp_cli_connection_interface_mail_notification_callback_for_request_inbox_url tp_cli_connection_interface_mail_notification_callback_for_request_mail_url tp_cli_connection_interface_mail_notification_connect_to_mails_received tp_cli_connection_interface_mail_notification_connect_to_unread_mails_changed tp_cli_connection_interface_mail_notification_signal_callback_mails_received tp_cli_connection_interface_mail_notification_signal_callback_unread_mails_changed tp_cli_connection_interface_mail_notification_run_request_inbox_url tp_cli_connection_interface_mail_notification_run_request_mail_url
connection-addressing connection-addressing telepathy-glib/telepathy-glib-dbus.h tp_cli_connection_interface_addressing_call_get_contacts_by_uri tp_cli_connection_interface_addressing_call_get_contacts_by_vcard_field tp_cli_connection_interface_addressing_callback_for_get_contacts_by_uri tp_cli_connection_interface_addressing_callback_for_get_contacts_by_vcard_field
connection-manager connection-manager telepathy-glib/telepathy-glib.h TpConnectionManagerListCb tp_list_connection_managers_async tp_list_connection_managers_finish tp_list_connection_managers TpConnectionManager TpConnectionManagerClass tp_connection_manager_new tp_connection_manager_get_name TP_CONNECTION_MANAGER_FEATURE_CORE TpConnectionManagerWhenReadyCb tp_connection_manager_call_when_ready tp_connection_manager_is_ready TpCMInfoSource TP_TYPE_CM_INFO_SOURCE tp_connection_manager_get_info_source tp_connection_manager_activate tp_connection_manager_is_running tp_connection_manager_dup_protocols tp_connection_manager_dup_protocol_names tp_connection_manager_has_protocol tp_connection_manager_get_protocol tp_connection_manager_get_protocol_object TpConnectionManagerProtocol tp_connection_manager_protocol_can_register tp_connection_manager_protocol_dup_param_names tp_connection_manager_protocol_has_param tp_connection_manager_protocol_get_param TpConnectionManagerParam tp_connection_manager_param_get_name tp_connection_manager_param_get_dbus_signature tp_connection_manager_param_dup_variant_type tp_connection_manager_param_is_required tp_connection_manager_param_is_required_for_registration tp_connection_manager_param_is_secret tp_connection_manager_param_is_dbus_property tp_connection_manager_param_get_default tp_connection_manager_param_dup_default_variant tp_connection_manager_check_valid_name tp_connection_manager_check_valid_protocol_name tp_connection_manager_init_known_interfaces tp_connection_manager_param_copy tp_connection_manager_param_free tp_connection_manager_protocol_copy tp_connection_manager_protocol_free tp_cm_info_source_get_type tp_connection_manager_get_type tp_connection_manager_protocol_get_type tp_connection_manager_param_get_type TP_TYPE_CONNECTION_MANAGER TP_TYPE_CONNECTION_MANAGER_PROTOCOL TP_TYPE_CONNECTION_MANAGER_PARAM TP_CONNECTION_MANAGER TP_CONNECTION_MANAGER_CLASS TP_CONNECTION_MANAGER_GET_CLASS TP_IS_CONNECTION_MANAGER TP_IS_CONNECTION_MANAGER_CLASS TpConnectionManagerPrivate tp_connection_manager_get_feature_quark_core tp_cli_connection_manager_callback_for_get_parameters tp_cli_connection_manager_call_get_parameters tp_cli_connection_manager_run_get_parameters tp_cli_connection_manager_callback_for_list_protocols tp_cli_connection_manager_call_list_protocols tp_cli_connection_manager_run_list_protocols tp_cli_connection_manager_callback_for_request_connection tp_cli_connection_manager_call_request_connection tp_cli_connection_manager_run_request_connection tp_cli_connection_manager_signal_callback_new_connection tp_cli_connection_manager_connect_to_new_connection
contact-search contact-search telepathy-glib/telepathy-glib.h TpContactSearch TpContactSearchClass tp_contact_search_new_async tp_contact_search_new_finish tp_contact_search_reset_async tp_contact_search_reset_finish tp_contact_search_start tp_contact_search_get_search_keys tp_contact_search_get_account tp_contact_search_get_limit tp_contact_search_get_server tp_contact_search_get_type TP_CONTACT_SEARCH TP_CONTACT_SEARCH_CLASS TP_CONTACT_SEARCH_GET_CLASS TP_IS_CONTACT_SEARCH TP_IS_CONTACT_SEARCH_CLASS TP_TYPE_CONTACT_SEARCH TpContactSearchPrivate
contact-search-result contact-search-result telepathy-glib/telepathy-glib.h TpContactSearchResult TpContactSearchResultClass tp_contact_search_result_get_field tp_contact_search_result_get_fields tp_contact_search_result_dup_fields tp_contact_search_result_get_identifier tp_contact_search_result_get_type TP_CONTACT_SEARCH_RESULT TP_CONTACT_SEARCH_RESULT_CLASS TP_CONTACT_SEARCH_RESULT_GET_CLASS TP_IS_CONTACT_SEARCH_RESULT TP_IS_CONTACT_SEARCH_RESULT_CLASS TP_TYPE_CONTACT_SEARCH_RESULT TpContactSearchResultPrivate
media-interfaces media-interfaces telepathy-glib/telepathy-glib-dbus.h TP_IS_MEDIA_SESSION_HANDLER TP_IS_MEDIA_SESSION_HANDLER_CLASS TP_IS_MEDIA_STREAM_HANDLER TP_IS_MEDIA_STREAM_HANDLER_CLASS TP_MEDIA_SESSION_HANDLER TP_MEDIA_SESSION_HANDLER_CLASS TP_MEDIA_SESSION_HANDLER_GET_CLASS TP_MEDIA_STREAM_HANDLER TP_MEDIA_STREAM_HANDLER_CLASS TP_MEDIA_STREAM_HANDLER_GET_CLASS TP_TYPE_MEDIA_SESSION_HANDLER TP_TYPE_MEDIA_STREAM_HANDLER tp_media_session_handler_get_type tp_media_stream_handler_get_type TpMediaSessionHandlerPrivate TpMediaStreamHandlerPrivate tp_media_session_handler_new tp_media_session_handler_init_known_interfaces TpMediaSessionHandler TpMediaSessionHandlerClass tp_media_stream_handler_new tp_media_stream_handler_init_known_interfaces TpMediaStreamHandler TpMediaStreamHandlerClass tp_cli_media_session_handler_callback_for_error tp_cli_media_session_handler_call_error tp_cli_media_session_handler_run_error tp_cli_media_session_handler_callback_for_ready tp_cli_media_session_handler_call_ready tp_cli_media_session_handler_run_ready tp_cli_media_session_handler_signal_callback_new_stream_handler tp_cli_media_session_handler_connect_to_new_stream_handler tp_cli_media_stream_handler_callback_for_codec_choice tp_cli_media_stream_handler_call_codec_choice tp_cli_media_stream_handler_run_codec_choice tp_cli_media_stream_handler_callback_for_error tp_cli_media_stream_handler_call_error tp_cli_media_stream_handler_run_error tp_cli_media_stream_handler_callback_for_native_candidates_prepared tp_cli_media_stream_handler_call_native_candidates_prepared tp_cli_media_stream_handler_run_native_candidates_prepared tp_cli_media_stream_handler_callback_for_new_active_candidate_pair tp_cli_media_stream_handler_call_new_active_candidate_pair tp_cli_media_stream_handler_run_new_active_candidate_pair tp_cli_media_stream_handler_callback_for_new_native_candidate tp_cli_media_stream_handler_call_new_native_candidate tp_cli_media_stream_handler_run_new_native_candidate tp_cli_media_stream_handler_callback_for_ready tp_cli_media_stream_handler_call_ready tp_cli_media_stream_handler_run_ready tp_cli_media_stream_handler_callback_for_set_local_codecs tp_cli_media_stream_handler_call_set_local_codecs tp_cli_media_stream_handler_run_set_local_codecs tp_cli_media_stream_handler_callback_for_stream_state tp_cli_media_stream_handler_call_stream_state tp_cli_media_stream_handler_run_stream_state tp_cli_media_stream_handler_callback_for_supported_codecs tp_cli_media_stream_handler_call_supported_codecs tp_cli_media_stream_handler_run_supported_codecs tp_cli_media_stream_handler_signal_callback_add_remote_candidate tp_cli_media_stream_handler_connect_to_add_remote_candidate tp_cli_media_stream_handler_signal_callback_close tp_cli_media_stream_handler_connect_to_close tp_cli_media_stream_handler_signal_callback_remove_remote_candidate tp_cli_media_stream_handler_connect_to_remove_remote_candidate tp_cli_media_stream_handler_signal_callback_set_active_candidate_pair tp_cli_media_stream_handler_connect_to_set_active_candidate_pair tp_cli_media_stream_handler_signal_callback_set_remote_candidate_list tp_cli_media_stream_handler_connect_to_set_remote_candidate_list tp_cli_media_stream_handler_signal_callback_set_remote_codecs tp_cli_media_stream_handler_connect_to_set_remote_codecs tp_cli_media_stream_handler_signal_callback_set_stream_playing tp_cli_media_stream_handler_connect_to_set_stream_playing tp_cli_media_stream_handler_signal_callback_set_stream_sending tp_cli_media_stream_handler_connect_to_set_stream_sending tp_cli_media_stream_handler_signal_callback_start_telephony_event tp_cli_media_stream_handler_connect_to_start_telephony_event tp_cli_media_stream_handler_signal_callback_stop_telephony_event tp_cli_media_stream_handler_connect_to_stop_telephony_event tp_cli_media_stream_handler_call_hold_state tp_cli_media_stream_handler_call_unhold_failure tp_cli_media_stream_handler_callback_for_hold_state tp_cli_media_stream_handler_callback_for_unhold_failure tp_cli_media_stream_handler_connect_to_set_stream_held tp_cli_media_stream_handler_run_hold_state tp_cli_media_stream_handler_run_unhold_failure tp_cli_media_stream_handler_signal_callback_set_stream_held tp_cli_media_stream_handler_call_codecs_updated tp_cli_media_stream_handler_callback_for_codecs_updated tp_cli_media_stream_handler_run_codecs_updated tp_cli_media_stream_handler_signal_callback_start_named_telephony_event tp_cli_media_stream_handler_connect_to_start_named_telephony_event tp_cli_media_stream_handler_signal_callback_start_sound_telephony_event tp_cli_media_stream_handler_connect_to_start_sound_telephony_event tp_cli_media_stream_handler_call_new_active_transport_pair tp_cli_media_stream_handler_callback_for_new_active_transport_pair tp_cli_media_stream_handler_run_new_active_transport_pair tp_cli_media_stream_handler_call_supported_feedback_messages tp_cli_media_stream_handler_call_supported_header_extensions tp_cli_media_stream_handler_callback_for_supported_feedback_messages tp_cli_media_stream_handler_callback_for_supported_header_extensions tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages tp_cli_media_stream_handler_connect_to_set_remote_header_extensions tp_cli_media_stream_handler_run_supported_feedback_messages tp_cli_media_stream_handler_run_supported_header_extensions tp_cli_media_stream_handler_signal_callback_set_remote_feedback_messages tp_cli_media_stream_handler_signal_callback_set_remote_header_extensions
telepathy-glib/telepathy-glib.h contact contact TpContact TpContactFeature TP_CONTACT_FEATURE_INVALID NUM_TP_CONTACT_FEATURES TP_NUM_CONTACT_FEATURES TP_TYPE_CONTACT_FEATURE TpConnectionContactsByHandleCb tp_connection_dup_contact_if_possible tp_connection_get_contacts_by_handle TpConnectionContactsByIdCb tp_connection_get_contacts_by_id TpConnectionUpgradeContactsCb tp_connection_upgrade_contacts tp_connection_refresh_contact_info tp_contact_get_alias tp_contact_get_avatar_token tp_contact_get_avatar_file tp_contact_get_avatar_mime_type tp_contact_get_client_types tp_contact_get_account tp_contact_get_connection tp_contact_get_handle tp_contact_get_identifier tp_contact_get_presence_message tp_contact_get_presence_status tp_contact_get_presence_type tp_contact_get_location tp_contact_dup_location tp_contact_get_capabilities tp_contact_get_contact_info tp_contact_dup_contact_info tp_contact_is_blocked tp_contact_request_contact_info_async tp_contact_request_contact_info_finish tp_contact_get_subscribe_state tp_contact_get_publish_state tp_contact_get_publish_request tp_contact_get_contact_groups tp_contact_set_contact_groups_async tp_contact_set_contact_groups_finish tp_contact_has_feature tp_connection_dup_contact_by_id_async tp_connection_dup_contact_by_id_finish tp_connection_upgrade_contacts_async tp_connection_upgrade_contacts_finish tp_contact_request_subscription_async tp_contact_request_subscription_finish tp_contact_authorize_publication_async tp_contact_authorize_publication_finish tp_contact_remove_async tp_contact_remove_finish tp_contact_unsubscribe_async tp_contact_unsubscribe_finish tp_contact_unpublish_async tp_contact_unpublish_finish tp_contact_add_to_group_async tp_contact_add_to_group_finish tp_contact_remove_from_group_async tp_contact_remove_from_group_finish tp_contact_block_async tp_contact_block_finish tp_contact_unblock_async tp_contact_unblock_finish tp_contact_feature_get_type tp_contact_get_type TP_CONTACT TP_CONTACT_CLASS TP_CONTACT_GET_CLASS TP_IS_CONTACT TP_IS_CONTACT_CLASS TP_TYPE_CONTACT TpContactClass TpContactPrivate
telepathy-glib/telepathy-glib.h capabilities capabilities TpCapabilities tp_capabilities_get_channel_classes tp_capabilities_dup_channel_classes_variant tp_capabilities_is_specific_to_contact tp_capabilities_supports_text_chatrooms tp_capabilities_supports_text_chats tp_capabilities_supports_sms tp_capabilities_supports_audio_call tp_capabilities_supports_audio_video_call tp_capabilities_supports_file_transfer tp_capabilities_supports_file_transfer_description tp_capabilities_supports_file_transfer_initial_offset tp_capabilities_supports_file_transfer_timestamp tp_capabilities_supports_file_transfer_uri tp_capabilities_supports_stream_tubes tp_capabilities_supports_dbus_tubes tp_capabilities_supports_contact_search tp_capabilities_supports_room_list tp_capabilities_get_type TP_CAPABILITIES TP_CAPABILITIES_CLASS TP_CAPABILITIES_GET_CLASS TP_IS_CAPABILITIES TP_IS_CAPABILITIES_CLASS TP_TYPE_CAPABILITIES TpCapabilitiesClass TpCapabilitiesPrivate
svc-account telepathy-glib/telepathy-glib-dbus.h svc-account TpSvcAccount TpSvcAccountClass tp_svc_account_emit_account_property_changed tp_svc_account_emit_removed tp_svc_account_reconnect_impl tp_svc_account_return_from_reconnect tp_svc_account_implement_reconnect tp_svc_account_remove_impl tp_svc_account_return_from_remove tp_svc_account_implement_remove tp_svc_account_update_parameters_impl tp_svc_account_return_from_update_parameters tp_svc_account_implement_update_parameters TP_SVC_ACCOUNT TP_IS_SVC_ACCOUNT TP_TYPE_SVC_ACCOUNT tp_svc_account_get_type TP_SVC_ACCOUNT_GET_CLASS TpSvcAccountInterfaceAvatar TpSvcAccountInterfaceAvatarClass tp_svc_account_interface_avatar_emit_avatar_changed TP_SVC_ACCOUNT_INTERFACE_AVATAR TP_IS_SVC_ACCOUNT_INTERFACE_AVATAR TP_TYPE_SVC_ACCOUNT_INTERFACE_AVATAR tp_svc_account_interface_avatar_get_type TP_SVC_ACCOUNT_INTERFACE_AVATAR_GET_CLASS TpSvcAccountInterfaceStorage TpSvcAccountInterfaceStorageClass TP_IS_SVC_ACCOUNT_INTERFACE_STORAGE TP_SVC_ACCOUNT_INTERFACE_STORAGE TP_SVC_ACCOUNT_INTERFACE_STORAGE_GET_CLASS TP_TYPE_SVC_ACCOUNT_INTERFACE_STORAGE tp_svc_account_interface_storage_get_type TpSvcAccountInterfaceAddressing TpSvcAccountInterfaceAddressingClass tp_svc_account_interface_addressing_implement_set_uri_scheme_association tp_svc_account_interface_addressing_return_from_set_uri_scheme_association tp_svc_account_interface_addressing_set_uri_scheme_association_impl TP_IS_SVC_ACCOUNT_INTERFACE_ADDRESSING TP_SVC_ACCOUNT_INTERFACE_ADDRESSING TP_SVC_ACCOUNT_INTERFACE_ADDRESSING_GET_CLASS TP_TYPE_SVC_ACCOUNT_INTERFACE_ADDRESSING tp_svc_account_interface_addressing_get_type
svc-account-manager telepathy-glib/telepathy-glib-dbus.h svc-account-manager TpSvcAccountManager TpSvcAccountManagerClass tp_svc_account_manager_emit_account_removed tp_svc_account_manager_emit_account_validity_changed tp_svc_account_manager_create_account_impl tp_svc_account_manager_return_from_create_account tp_svc_account_manager_implement_create_account TP_SVC_ACCOUNT_MANAGER TP_IS_SVC_ACCOUNT_MANAGER TP_TYPE_SVC_ACCOUNT_MANAGER tp_svc_account_manager_get_type TP_SVC_ACCOUNT_MANAGER_GET_CLASS
account telepathy-glib/telepathy-glib.h account TpAccount TpAccountClass tp_account_new tp_account_init_known_interfaces tp_account_parse_object_path tp_account_get_path_suffix tp_account_get_connection tp_account_ensure_connection tp_account_get_display_name tp_account_get_connection_manager tp_account_get_cm_name tp_account_get_protocol tp_account_get_protocol_name tp_account_get_icon_name tp_account_get_service tp_account_set_enabled_async tp_account_set_enabled_finish tp_account_reconnect_async tp_account_reconnect_finish tp_account_is_enabled tp_account_is_valid tp_account_update_parameters_async tp_account_update_parameters_finish tp_account_update_parameters_vardict_async tp_account_update_parameters_vardict_finish tp_account_remove_async tp_account_remove_finish tp_account_set_display_name_async tp_account_set_display_name_finish tp_account_set_icon_name_async tp_account_set_icon_name_finish tp_account_set_service_async tp_account_set_service_finish tp_account_request_presence_async tp_account_request_presence_finish tp_account_set_automatic_presence_async tp_account_set_automatic_presence_finish tp_account_get_connect_automatically tp_account_set_connect_automatically_async tp_account_set_connect_automatically_finish tp_account_get_has_been_online tp_account_get_connection_status tp_account_get_detailed_error tp_account_dup_detailed_error_vardict tp_account_get_changing_presence tp_account_get_current_presence tp_account_get_requested_presence tp_account_get_automatic_presence tp_account_get_parameters tp_account_dup_parameters_vardict tp_account_get_nickname tp_account_set_nickname_async tp_account_set_nickname_finish tp_account_get_normalized_name tp_account_get_supersedes tp_account_get_avatar_async tp_account_get_avatar_finish tp_account_set_avatar_async tp_account_set_avatar_finish tp_account_bind_connection_status_to_property TP_ACCOUNT_FEATURE_CORE TP_ACCOUNT_FEATURE_CONNECTION tp_account_is_prepared tp_account_prepare_async tp_account_prepare_finish TP_ACCOUNT_FEATURE_ADDRESSING tp_account_get_uri_schemes tp_account_associated_with_uri_scheme tp_account_set_uri_scheme_association_async tp_account_set_uri_scheme_association_finish TP_ACCOUNT_FEATURE_STORAGE tp_account_get_storage_provider tp_account_get_storage_identifier tp_account_dup_storage_identifier_variant tp_account_get_storage_restrictions tp_account_get_storage_specific_information_async tp_account_get_storage_specific_information_finish tp_account_dup_storage_specific_information_vardict_async tp_account_dup_storage_specific_information_vardict_finish tp_account_get_feature_quark_core tp_account_get_feature_quark_connection tp_account_get_feature_quark_addressing tp_account_get_feature_quark_storage tp_cli_account_callback_for_reconnect tp_cli_account_call_reconnect tp_cli_account_callback_for_remove tp_cli_account_call_remove tp_cli_account_callback_for_update_parameters tp_cli_account_call_update_parameters tp_cli_account_signal_callback_account_property_changed tp_cli_account_connect_to_account_property_changed tp_cli_account_signal_callback_removed tp_cli_account_connect_to_removed tp_cli_account_interface_avatar_signal_callback_avatar_changed tp_cli_account_interface_avatar_connect_to_avatar_changed tp_cli_account_interface_addressing_callback_for_set_uri_scheme_association tp_cli_account_interface_addressing_call_set_uri_scheme_association TP_ACCOUNT TP_IS_ACCOUNT TP_IS_ACCOUNT_CLASS TP_TYPE_ACCOUNT tp_account_get_type TP_ACCOUNT_CLASS TP_ACCOUNT_GET_CLASS TpAccountPrivate TpAccountClassPrivate
account-request telepathy-glib/account-request.h account-request TpAccountRequest TpAccountRequestClass tp_account_request_new tp_account_request_new_from_protocol tp_account_request_set_display_name tp_account_request_set_icon_name tp_account_request_set_nickname tp_account_request_set_requested_presence tp_account_request_set_automatic_presence tp_account_request_set_enabled tp_account_request_set_connect_automatically tp_account_request_add_supersedes tp_account_request_set_avatar tp_account_request_set_service tp_account_request_set_storage_provider tp_account_request_set_parameter tp_account_request_set_parameter_string tp_account_request_unset_parameter tp_account_request_create_account_async tp_account_request_create_account_finish TP_ACCOUNT_REQUEST TP_IS_ACCOUNT_REQUEST TP_IS_ACCOUNT_REQUEST_CLASS TP_TYPE_ACCOUNT_REQUEST tp_account_request_get_type TP_ACCOUNT_REQUEST_CLASS TP_ACCOUNT_REQUEST_GET_CLASS TpAccountRequestPrivate
account-manager telepathy-glib/telepathy-glib.h account-manager TpAccountManager TpAccountManagerClass tp_account_manager_new tp_account_manager_new_with_factory tp_account_manager_init_known_interfaces tp_account_manager_set_default tp_account_manager_can_set_default tp_account_manager_dup tp_account_manager_create_account_async tp_account_manager_create_account_finish tp_account_manager_ensure_account tp_account_manager_get_valid_accounts tp_account_manager_dup_valid_accounts tp_account_manager_get_most_available_presence tp_account_manager_set_all_requested_presences tp_account_manager_enable_restart TP_ACCOUNT_MANAGER_FEATURE_CORE tp_account_manager_is_prepared tp_account_manager_prepare_async tp_account_manager_prepare_finish tp_account_manager_get_feature_quark_core tp_cli_account_manager_callback_for_create_account tp_cli_account_manager_call_create_account tp_cli_account_manager_signal_callback_account_removed tp_cli_account_manager_connect_to_account_removed tp_cli_account_manager_signal_callback_account_validity_changed tp_cli_account_manager_connect_to_account_validity_changed TP_ACCOUNT_MANAGER TP_IS_ACCOUNT_MANAGER TP_IS_ACCOUNT_MANAGER_CLASS TP_TYPE_ACCOUNT_MANAGER tp_account_manager_get_type TP_ACCOUNT_MANAGER_CLASS TP_ACCOUNT_MANAGER_GET_CLASS TpAccountManagerPrivate TpAccountManagerClassPrivate
channel-dispatcher telepathy-glib/telepathy-glib.h channel-dispatcher TpChannelDispatcher TpChannelDispatcherClass tp_channel_dispatcher_new tp_channel_dispatcher_init_known_interfaces tp_cli_channel_dispatcher_callback_for_create_channel tp_cli_channel_dispatcher_call_create_channel tp_cli_channel_dispatcher_callback_for_create_channel_with_hints tp_cli_channel_dispatcher_call_create_channel_with_hints tp_cli_channel_dispatcher_callback_for_ensure_channel tp_cli_channel_dispatcher_call_ensure_channel tp_cli_channel_dispatcher_callback_for_ensure_channel_with_hints tp_cli_channel_dispatcher_call_ensure_channel_with_hints tp_cli_channel_dispatcher_call_delegate_channels tp_cli_channel_dispatcher_call_present_channel tp_cli_channel_dispatcher_callback_for_delegate_channels tp_cli_channel_dispatcher_callback_for_present_channel tp_cli_channel_dispatcher_interface_messages1_call_send_message tp_cli_channel_dispatcher_interface_messages1_callback_for_send_message tp_cli_channel_dispatcher_interface_operation_list_signal_callback_dispatch_operation_finished tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished tp_cli_channel_dispatcher_interface_operation_list_signal_callback_new_dispatch_operation tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation TP_CHANNEL_DISPATCHER TP_IS_CHANNEL_DISPATCHER TP_IS_CHANNEL_DISPATCHER_CLASS TP_TYPE_CHANNEL_DISPATCHER tp_channel_dispatcher_get_type TP_CHANNEL_DISPATCHER_CLASS TP_CHANNEL_DISPATCHER_GET_CLASS TpChannelDispatcherPrivate TpChannelDispatcherClassPrivate
svc-channel-dispatcher telepathy-glib/telepathy-glib-dbus.h svc-channel-dispatcher TpSvcChannelDispatcher TpSvcChannelDispatcherClass tp_svc_channel_dispatcher_return_from_create_channel tp_svc_channel_dispatcher_create_channel_impl tp_svc_channel_dispatcher_implement_create_channel tp_svc_channel_dispatcher_return_from_create_channel_with_hints tp_svc_channel_dispatcher_create_channel_with_hints_impl tp_svc_channel_dispatcher_implement_create_channel_with_hints tp_svc_channel_dispatcher_return_from_ensure_channel tp_svc_channel_dispatcher_ensure_channel_impl tp_svc_channel_dispatcher_implement_ensure_channel tp_svc_channel_dispatcher_return_from_ensure_channel_with_hints tp_svc_channel_dispatcher_ensure_channel_with_hints_impl tp_svc_channel_dispatcher_implement_ensure_channel_with_hints tp_svc_channel_dispatcher_delegate_channels_impl tp_svc_channel_dispatcher_implement_delegate_channels tp_svc_channel_dispatcher_implement_present_channel tp_svc_channel_dispatcher_present_channel_impl tp_svc_channel_dispatcher_return_from_delegate_channels tp_svc_channel_dispatcher_return_from_present_channel TpSvcChannelDispatcherInterfaceOperationList TpSvcChannelDispatcherInterfaceOperationListClass tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished TpSvcChannelDispatcherInterfaceMessages1 TpSvcChannelDispatcherInterfaceMessages1Class tp_svc_channel_dispatcher_interface_messages1_implement_send_message tp_svc_channel_dispatcher_interface_messages1_return_from_send_message tp_svc_channel_dispatcher_interface_messages1_send_message_impl TP_SVC_CHANNEL_DISPATCHER TP_SVC_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1 TP_SVC_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST TP_IS_SVC_CHANNEL_DISPATCHER TP_IS_SVC_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1 TP_IS_SVC_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST TP_TYPE_SVC_CHANNEL_DISPATCHER TP_TYPE_SVC_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1 TP_TYPE_SVC_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST tp_svc_channel_dispatcher_get_type tp_svc_channel_dispatcher_interface_messages1_get_type tp_svc_channel_dispatcher_interface_operation_list_get_type TP_SVC_CHANNEL_DISPATCHER_GET_CLASS TP_SVC_CHANNEL_DISPATCHER_INTERFACE_MESSAGES1_GET_CLASS TP_SVC_CHANNEL_DISPATCHER_INTERFACE_OPERATION_LIST_GET_CLASS
channel-dispatch-operation telepathy-glib/telepathy-glib.h channel-dispatch-operation TpChannelDispatchOperation TpChannelDispatchOperationClass tp_channel_dispatch_operation_new tp_channel_dispatch_operation_init_known_interfaces tp_cli_channel_dispatch_operation_callback_for_claim tp_cli_channel_dispatch_operation_call_claim tp_cli_channel_dispatch_operation_callback_for_handle_with tp_cli_channel_dispatch_operation_call_handle_with tp_cli_channel_dispatch_operation_callback_for_handle_with_time tp_cli_channel_dispatch_operation_call_handle_with_time tp_cli_channel_dispatch_operation_signal_callback_channel_lost tp_cli_channel_dispatch_operation_connect_to_channel_lost tp_cli_channel_dispatch_operation_signal_callback_finished tp_cli_channel_dispatch_operation_connect_to_finished TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE tp_channel_dispatch_operation_borrow_account tp_channel_dispatch_operation_borrow_channels tp_channel_dispatch_operation_borrow_connection tp_channel_dispatch_operation_borrow_immutable_properties tp_channel_dispatch_operation_borrow_possible_handlers tp_channel_dispatch_operation_get_account tp_channel_dispatch_operation_get_channels tp_channel_dispatch_operation_get_connection tp_channel_dispatch_operation_get_possible_handlers tp_channel_dispatch_operation_handle_with_async tp_channel_dispatch_operation_handle_with_finish tp_channel_dispatch_operation_handle_with_time_async tp_channel_dispatch_operation_handle_with_time_finish tp_channel_dispatch_operation_claim_async tp_channel_dispatch_operation_claim_finish tp_channel_dispatch_operation_claim_with_async tp_channel_dispatch_operation_claim_with_finish tp_channel_dispatch_operation_close_channels_async tp_channel_dispatch_operation_close_channels_finish tp_channel_dispatch_operation_leave_channels_async tp_channel_dispatch_operation_leave_channels_finish tp_channel_dispatch_operation_destroy_channels_async tp_channel_dispatch_operation_destroy_channels_finish TP_CHANNEL_DISPATCH_OPERATION TP_CHANNEL_DISPATCH_OPERATION_CLASS TP_CHANNEL_DISPATCH_OPERATION_GET_CLASS TP_IS_CHANNEL_DISPATCH_OPERATION TP_IS_CHANNEL_DISPATCH_OPERATION_CLASS TP_TYPE_CHANNEL_DISPATCH_OPERATION tp_channel_dispatch_operation_get_type tp_channel_dispatch_operation_get_feature_quark_core
channel-request telepathy-glib/telepathy-glib.h channel-request TpChannelRequest TpChannelRequestClass tp_channel_request_new tp_channel_request_init_known_interfaces tp_channel_request_set_channel_factory tp_channel_request_get_immutable_properties tp_channel_request_dup_immutable_properties tp_channel_request_get_account tp_channel_request_get_user_action_time tp_channel_request_get_preferred_handler tp_channel_request_get_hints tp_channel_request_dup_hints tp_cli_channel_request_callback_for_cancel tp_cli_channel_request_call_cancel tp_cli_channel_request_callback_for_proceed tp_cli_channel_request_call_proceed tp_cli_channel_request_signal_callback_failed tp_cli_channel_request_connect_to_failed tp_cli_channel_request_signal_callback_succeeded tp_cli_channel_request_connect_to_succeeded tp_cli_channel_request_signal_callback_succeeded_with_channel tp_cli_channel_request_connect_to_succeeded_with_channel TP_CHANNEL_REQUEST TP_CHANNEL_REQUEST_CLASS TP_CHANNEL_REQUEST_GET_CLASS TP_IS_CHANNEL_REQUEST TP_IS_CHANNEL_REQUEST_CLASS TP_TYPE_CHANNEL_REQUEST TpChannelRequestClassPrivate TpChannelRequestPrivate tp_channel_request_get_type
svc-channel-dispatch-operation telepathy-glib/telepathy-glib-dbus.h svc-channel-dispatch-operation TpSvcChannelDispatchOperation TpSvcChannelDispatchOperationClass tp_svc_channel_dispatch_operation_return_from_claim tp_svc_channel_dispatch_operation_claim_impl tp_svc_channel_dispatch_operation_implement_claim tp_svc_channel_dispatch_operation_return_from_handle_with tp_svc_channel_dispatch_operation_handle_with_impl tp_svc_channel_dispatch_operation_implement_handle_with tp_svc_channel_dispatch_operation_handle_with_time_impl tp_svc_channel_dispatch_operation_implement_handle_with_time tp_svc_channel_dispatch_operation_return_from_handle_with_time tp_svc_channel_dispatch_operation_emit_channel_lost tp_svc_channel_dispatch_operation_emit_finished tp_svc_channel_dispatch_operation_get_type TP_IS_SVC_CHANNEL_DISPATCH_OPERATION TP_SVC_CHANNEL_DISPATCH_OPERATION TP_SVC_CHANNEL_DISPATCH_OPERATION_GET_CLASS TP_TYPE_SVC_CHANNEL_DISPATCH_OPERATION
svc-channel-request telepathy-glib/telepathy-glib-dbus.h svc-channel-request TpSvcChannelRequest TpSvcChannelRequestClass tp_svc_channel_request_return_from_proceed tp_svc_channel_request_proceed_impl tp_svc_channel_request_implement_proceed tp_svc_channel_request_return_from_cancel tp_svc_channel_request_cancel_impl tp_svc_channel_request_implement_cancel tp_svc_channel_request_emit_failed tp_svc_channel_request_emit_succeeded tp_svc_channel_request_emit_succeeded_with_channel tp_svc_channel_request_get_type TP_IS_SVC_CHANNEL_REQUEST TP_SVC_CHANNEL_REQUEST TP_SVC_CHANNEL_REQUEST_GET_CLASS TP_TYPE_SVC_CHANNEL_REQUEST
client telepathy-glib/telepathy-glib.h client TpClient TpClientClass tp_client_init_known_interfaces tp_cli_client_observer_callback_for_observe_channels tp_cli_client_observer_call_observe_channels tp_cli_client_handler_callback_for_handle_channels tp_cli_client_handler_call_handle_channels tp_cli_client_interface_requests_callback_for_add_request tp_cli_client_interface_requests_call_add_request tp_cli_client_interface_requests_callback_for_remove_request tp_cli_client_interface_requests_call_remove_request tp_cli_client_approver_callback_for_add_dispatch_operation tp_cli_client_approver_call_add_dispatch_operation tp_client_get_type TP_CLIENT TP_CLIENT_CLASS TP_CLIENT_GET_CLASS TP_IS_CLIENT TP_IS_CLIENT_CLASS TP_TYPE_CLIENT TpClientClassPrivate TpClientPrivate
svc-client telepathy-glib/telepathy-glib-dbus.h svc-client TpSvcClient TpSvcClientClass TpSvcClientApprover TpSvcClientApproverClass tp_svc_client_approver_return_from_add_dispatch_operation tp_svc_client_approver_add_dispatch_operation_impl tp_svc_client_approver_implement_add_dispatch_operation TpSvcClientHandler TpSvcClientHandlerClass tp_svc_client_handler_return_from_handle_channels tp_svc_client_handler_handle_channels_impl tp_svc_client_handler_implement_handle_channels TpSvcClientInterfaceRequests TpSvcClientInterfaceRequestsClass tp_svc_client_interface_requests_return_from_add_request tp_svc_client_interface_requests_add_request_impl tp_svc_client_interface_requests_implement_add_request tp_svc_client_interface_requests_return_from_remove_request tp_svc_client_interface_requests_remove_request_impl tp_svc_client_interface_requests_implement_remove_request TpSvcClientObserver TpSvcClientObserverClass tp_svc_client_observer_return_from_observe_channels tp_svc_client_observer_observe_channels_impl tp_svc_client_observer_implement_observe_channels tp_svc_client_get_type tp_svc_client_approver_get_type tp_svc_client_handler_get_type tp_svc_client_interface_requests_get_type tp_svc_client_observer_get_type TP_IS_SVC_CLIENT TP_IS_SVC_CLIENT_APPROVER TP_IS_SVC_CLIENT_HANDLER TP_IS_SVC_CLIENT_INTERFACE_REQUESTS TP_IS_SVC_CLIENT_OBSERVER TP_SVC_CLIENT TP_SVC_CLIENT_APPROVER TP_SVC_CLIENT_APPROVER_GET_CLASS TP_SVC_CLIENT_GET_CLASS TP_SVC_CLIENT_HANDLER TP_SVC_CLIENT_HANDLER_GET_CLASS TP_SVC_CLIENT_INTERFACE_REQUESTS TP_SVC_CLIENT_INTERFACE_REQUESTS_GET_CLASS TP_SVC_CLIENT_OBSERVER TP_SVC_CLIENT_OBSERVER_GET_CLASS TP_TYPE_SVC_CLIENT TP_TYPE_SVC_CLIENT_APPROVER TP_TYPE_SVC_CLIENT_HANDLER TP_TYPE_SVC_CLIENT_INTERFACE_REQUESTS TP_TYPE_SVC_CLIENT_OBSERVER
telepathy-glib/telepathy-glib-dbus.h svc-debug svc-debug TpSvcDebug TpSvcDebugClass tp_svc_debug_get_messages_impl tp_svc_debug_implement_get_messages tp_svc_debug_return_from_get_messages tp_svc_debug_emit_new_debug_message TP_SVC_DEBUG TP_IS_SVC_DEBUG TP_TYPE_SVC_DEBUG TP_SVC_DEBUG_GET_CLASS tp_svc_debug_get_type
telepathy-glib/telepathy-glib.h debug-sender debug-sender TpDebugSender tp_debug_sender_dup tp_debug_sender_add_message tp_debug_sender_add_message_vprintf tp_debug_sender_add_message_printf tp_debug_sender_log_handler tp_debug_sender_set_timestamps tp_debug_sender_get_type TP_DEBUG_SENDER TP_DEBUG_SENDER_CLASS TP_DEBUG_SENDER_GET_CLASS TP_IS_DEBUG_SENDER TP_IS_DEBUG_SENDER_CLASS TP_TYPE_DEBUG_SENDER TpDebugSenderClass TpDebugSenderPrivate
telepathy-glib/telepathy-glib.h base-client base-client TpBaseClient TpBaseClientClass tp_base_client_add_observer_filter tp_base_client_add_observer_filter_vardict tp_base_client_take_observer_filter tp_base_client_set_observer_recover tp_base_client_set_observer_delay_approvers TpBaseClientClassObserveChannelsImpl tp_base_client_implement_observe_channels tp_base_client_add_approver_filter tp_base_client_add_approver_filter_vardict tp_base_client_take_approver_filter TpBaseClientClassAddDispatchOperationImpl tp_base_client_implement_add_dispatch_operation tp_base_client_add_handler_capabilities tp_base_client_add_handler_capabilities_varargs tp_base_client_add_handler_capability tp_base_client_add_handler_filter tp_base_client_add_handler_filter_vardict tp_base_client_take_handler_filter tp_base_client_be_a_handler TpBaseClientClassHandleChannelsImpl tp_base_client_implement_handle_channels tp_base_client_add_account_features tp_base_client_add_account_features_varargs tp_base_client_add_connection_features tp_base_client_add_connection_features_varargs tp_base_client_add_channel_features tp_base_client_add_channel_features_varargs tp_base_client_get_handled_channels tp_base_client_dup_handled_channels tp_base_client_is_handling_channel tp_base_client_delegate_channels_async tp_base_client_delegate_channels_finish TpBaseClientDelegatedChannelsCb tp_base_client_set_delegated_channels_callback tp_channel_dispatcher_present_channel_async tp_channel_dispatcher_present_channel_finish tp_base_client_get_pending_requests tp_base_client_dup_pending_requests tp_base_client_set_handler_bypass_approval tp_base_client_set_handler_request_notification tp_base_client_register tp_base_client_unregister tp_base_client_get_bus_name tp_base_client_get_object_path tp_base_client_get_dbus_daemon tp_base_client_get_name tp_base_client_get_uniquify_name tp_base_client_get_account_manager tp_base_client_set_channel_factory tp_base_client_get_channel_factory tp_base_client_get_type TP_BASE_CLIENT TP_BASE_CLIENT_CLASS TP_BASE_CLIENT_GET_CLASS TP_IS_BASE_CLIENT TP_IS_BASE_CLIENT_CLASS TP_TYPE_OBSERVE_CHANNELS_CONTEXT TP_TYPE_BASE_CLIENT TpBaseClientPrivate TpBaseClientClassPrivate
telepathy-glib/telepathy-glib.h observe-channels-context observe-channels-context TpObserveChannelsContext tp_observe_channels_context_accept tp_observe_channels_context_delay tp_observe_channels_context_fail tp_observe_channels_context_is_recovering tp_observe_channels_context_get_requests tp_observe_channels_context_get_type TP_OBSERVE_CHANNELS_CONTEXT TP_OBSERVE_CHANNELS_CONTEXT_CLASS TP_OBSERVE_CHANNELS_CONTEXT_GET_CLASS TP_IS_OBSERVE_CHANNELS_CONTEXT TP_IS_OBSERVE_CHANNELS_CONTEXT_CLASS TpObserveChannelsContextClass TpObserveChannelsContextPrivate
telepathy-glib/telepathy-glib.h simple-observer simple-observer TpSimpleObserver TpSimpleObserverObserveChannelsImpl tp_simple_observer_new tp_simple_observer_new_with_am tp_simple_observer_new_with_factory tp_simple_observer_get_type TP_TYPE_SIMPLE_OBSERVER TP_SIMPLE_OBSERVER TP_SIMPLE_OBSERVER_CLASS TP_SIMPLE_OBSERVER_GET_CLASS TP_IS_SIMPLE_OBSERVER TP_IS_SIMPLE_OBSERVER_CLASS TpSimpleObserverClass TpSimpleObserverPrivate
telepathy-glib/telepathy-glib.h add-dispatch-operation-context add-dispatch-operation-context TpAddDispatchOperationContext tp_add_dispatch_operation_context_accept tp_add_dispatch_operation_context_delay tp_add_dispatch_operation_context_fail tp_add_dispatch_operation_context_get_type TP_ADD_DISPATCH_OPERATION_CONTEXT TP_ADD_DISPATCH_OPERATION_CONTEXT_CLASS TP_ADD_DISPATCH_OPERATION_CONTEXT_GET_CLASS TP_IS_ADD_DISPATCH_OPERATION_CONTEXT TP_IS_ADD_DISPATCH_OPERATION_CONTEXT_CLASS TpAddDispatchOperationContextClass TpAddDispatchOperationContextPrivate TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT
telepathy-glib/telepathy-glib.h simple-approver simple-approver TpSimpleApprover TpSimpleApproverAddDispatchOperationImpl tp_simple_approver_new tp_simple_approver_new_with_am tp_simple_approver_new_with_factory tp_simple_approver_get_type TP_TYPE_SIMPLE_APPROVER TP_SIMPLE_APPROVER TP_SIMPLE_APPROVER_CLASS TP_SIMPLE_APPROVER_GET_CLASS TP_IS_SIMPLE_APPROVER TP_IS_SIMPLE_APPROVER_CLASS TpSimpleApproverClass TpSimpleApproverPrivate
telepathy-glib/telepathy-glib.h handle-channels-context handle-channels-context TpHandleChannelsContext tp_handle_channels_context_accept tp_handle_channels_context_delay tp_handle_channels_context_fail tp_handle_channels_context_get_handler_info tp_handle_channels_context_get_requests tp_handle_channels_context_get_type TP_HANDLE_CHANNELS_CONTEXT TP_HANDLE_CHANNELS_CONTEXT_CLASS TP_HANDLE_CHANNELS_CONTEXT_GET_CLASS TP_IS_HANDLE_CHANNELS_CONTEXT TP_IS_HANDLE_CHANNELS_CONTEXT_CLASS TpHandleChannelsContextClass TpHandleChannelsContextPrivate TP_TYPE_HANDLE_CHANNELS_CONTEXT
telepathy-glib/telepathy-glib.h simple-handler simple-handler TpSimpleHandler TpSimpleHandlerHandleChannelsImpl tp_simple_handler_new tp_simple_handler_new_with_am tp_simple_handler_new_with_factory tp_simple_handler_get_type TP_TYPE_SIMPLE_HANDLER TP_SIMPLE_HANDLER TP_SIMPLE_HANDLER_CLASS TP_SIMPLE_HANDLER_GET_CLASS TP_IS_SIMPLE_HANDLER TP_IS_SIMPLE_HANDLER_CLASS TpSimpleHandlerClass TpSimpleHandlerPrivate
telepathy-glib/telepathy-glib.h simple-password-manager simple-password-manager TpSimplePasswordManager tp_simple_password_manager_new tp_simple_password_manager_prompt_async tp_simple_password_manager_prompt_finish tp_simple_password_manager_prompt_for_channel_async tp_simple_password_manager_prompt_for_channel_finish tp_simple_password_manager_get_type TP_TYPE_SIMPLE_PASSWORD_MANAGER TP_SIMPLE_PASSWORD_MANAGER TP_SIMPLE_PASSWORD_MANAGER_CLASS TP_SIMPLE_PASSWORD_MANAGER_GET_CLASS TP_IS_SIMPLE_PASSWORD_MANAGER TP_IS_SIMPLE_PASSWORD_MANAGER_CLASS TpSimplePasswordManagerClass TpSimplePasswordManagerPrivate
telepathy-glib/telepathy-glib.h base-password-channel base-password-channel TpBasePasswordChannel tp_base_password_channel_get_type TP_TYPE_BASE_PASSWORD_CHANNEL TP_BASE_PASSWORD_CHANNEL TP_BASE_PASSWORD_CHANNEL_CLASS TP_BASE_PASSWORD_CHANNEL_GET_CLASS TP_IS_BASE_PASSWORD_CHANNEL TP_IS_BASE_PASSWORD_CHANNEL_CLASS TpBasePasswordChannelClass TpBasePasswordChannelPrivate
telepathy-glib/telepathy-glib.h base-protocol base-protocol TpBaseProtocol tp_base_protocol_get_name tp_base_protocol_get_immutable_properties tp_base_protocol_get_parameters tp_base_protocol_get_statuses tp_base_protocol_new_connection TpBaseProtocolClass TpBaseProtocolGetParametersFunc TpBaseProtocolNewConnectionFunc TpBaseProtocolNormalizeContactFunc TpBaseProtocolIdentifyAccountFunc TpBaseProtocolGetInterfacesFunc TpBaseProtocolGetConnectionDetailsFunc TpBaseProtocolGetAvatarDetailsFunc TpBaseProtocolGetInterfacesArrayFunc tp_base_protocol_get_type TP_BASE_PROTOCOL TP_BASE_PROTOCOL_CLASS TP_BASE_PROTOCOL_GET_CLASS TP_IS_BASE_PROTOCOL TP_IS_BASE_PROTOCOL_CLASS TP_TYPE_BASE_PROTOCOL tp_protocol_addressing_get_type TP_TYPE_PROTOCOL_ADDRESSING TP_IS_PROTOCOL_ADDRESSING TP_PROTOCOL_ADDRESSING_GET_INTERFACE TpProtocolAddressingInterface TpBaseProtocolDupSupportedVCardFieldsFunc TpBaseProtocolDupSupportedURISchemesFunc TpBaseProtocolNormalizeVCardAddressFunc TpBaseProtocolNormalizeURIFunc TpBaseProtocolPrivate TpBaseProtocolClassPrivate
telepathy-glib/telepathy-glib-dbus.h svc-protocol svc-protocol TpSvcProtocol TpSvcProtocolClass tp_svc_protocol_identify_account_impl tp_svc_protocol_implement_identify_account tp_svc_protocol_implement_normalize_contact tp_svc_protocol_normalize_contact_impl tp_svc_protocol_return_from_identify_account tp_svc_protocol_return_from_normalize_contact TpSvcProtocolInterfaceAddressing TpSvcProtocolInterfaceAddressingClass TpSvcProtocolInterfacePresence TpSvcProtocolInterfacePresenceClass TpSvcProtocolInterfaceAvatars TpSvcProtocolInterfaceAvatarsClass tp_svc_protocol_get_type TP_SVC_PROTOCOL TP_SVC_PROTOCOL_CLASS TP_SVC_PROTOCOL_GET_CLASS TP_IS_SVC_PROTOCOL TP_TYPE_SVC_PROTOCOL TP_IS_SVC_PROTOCOL_INTERFACE_ADDRESSING TP_TYPE_SVC_PROTOCOL_INTERFACE_ADDRESSING tp_svc_protocol_interface_addressing_get_type TP_SVC_PROTOCOL_INTERFACE_ADDRESSING TP_SVC_PROTOCOL_INTERFACE_ADDRESSING_GET_CLASS tp_svc_protocol_interface_addressing_implement_normalize_contact_uri tp_svc_protocol_interface_addressing_implement_normalize_vcard_address tp_svc_protocol_interface_addressing_normalize_contact_uri_impl tp_svc_protocol_interface_addressing_normalize_vcard_address_impl tp_svc_protocol_interface_addressing_return_from_normalize_contact_uri tp_svc_protocol_interface_addressing_return_from_normalize_vcard_address tp_svc_protocol_interface_presence_get_type TP_SVC_PROTOCOL_INTERFACE_PRESENCE TP_SVC_PROTOCOL_INTERFACE_PRESENCE_CLASS TP_SVC_PROTOCOL_INTERFACE_PRESENCE_GET_CLASS TP_IS_SVC_PROTOCOL_INTERFACE_PRESENCE TP_TYPE_SVC_PROTOCOL_INTERFACE_PRESENCE tp_svc_protocol_interface_avatars_get_type TP_SVC_PROTOCOL_INTERFACE_AVATARS TP_SVC_PROTOCOL_INTERFACE_AVATARS_CLASS TP_SVC_PROTOCOL_INTERFACE_AVATARS_GET_CLASS TP_IS_SVC_PROTOCOL_INTERFACE_AVATARS TP_TYPE_SVC_PROTOCOL_INTERFACE_AVATARS
telepathy-glib/telepathy-glib.h protocol protocol TpProtocol TpProtocolClass tp_protocol_new tp_protocol_new_vardict tp_protocol_get_name tp_protocol_get_cm_name tp_protocol_init_known_interfaces TP_PROTOCOL_FEATURE_PARAMETERS tp_protocol_borrow_params tp_protocol_dup_params tp_protocol_dup_param_names tp_protocol_get_param tp_protocol_dup_param tp_protocol_has_param tp_protocol_can_register tp_protocol_dup_immutable_properties TP_PROTOCOL_FEATURE_CORE tp_protocol_get_capabilities tp_protocol_get_english_name tp_protocol_get_icon_name tp_protocol_get_vcard_field tp_protocol_get_authentication_types tp_protocol_identify_account_async tp_protocol_identify_account_finish tp_protocol_normalize_contact_async tp_protocol_normalize_contact_finish tp_protocol_get_avatar_requirements tp_protocol_dup_presence_statuses tp_protocol_get_addressable_uri_schemes tp_protocol_get_addressable_vcard_fields tp_protocol_normalize_contact_uri_async tp_protocol_normalize_contact_uri_finish tp_protocol_normalize_vcard_address_async tp_protocol_normalize_vcard_address_finish tp_cli_protocol_call_identify_account tp_cli_protocol_call_normalize_contact tp_cli_protocol_callback_for_identify_account tp_cli_protocol_callback_for_normalize_contact tp_cli_protocol_interface_addressing_call_normalize_contact_uri tp_cli_protocol_interface_addressing_call_normalize_vcard_address tp_cli_protocol_interface_addressing_callback_for_normalize_contact_uri tp_cli_protocol_interface_addressing_callback_for_normalize_vcard_address tp_protocol_get_type TP_PROTOCOL TP_PROTOCOL_CLASS TP_PROTOCOL_GET_CLASS TP_IS_PROTOCOL TP_IS_PROTOCOL_CLASS TP_TYPE_PROTOCOL tp_protocol_get_feature_quark_core tp_protocol_get_feature_quark_parameters TpProtocolPrivate TpProtocolClassPrivate
channel-contactsearch channel-contactsearch telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_contact_search_call_more tp_cli_channel_type_contact_search_call_search tp_cli_channel_type_contact_search_call_stop tp_cli_channel_type_contact_search_callback_for_more tp_cli_channel_type_contact_search_callback_for_search tp_cli_channel_type_contact_search_callback_for_stop tp_cli_channel_type_contact_search_connect_to_search_result_received tp_cli_channel_type_contact_search_connect_to_search_state_changed tp_cli_channel_type_contact_search_run_more tp_cli_channel_type_contact_search_run_search tp_cli_channel_type_contact_search_run_stop tp_cli_channel_type_contact_search_signal_callback_search_result_received tp_cli_channel_type_contact_search_signal_callback_search_state_changed
svc-channel-contactsearch svc-channel-contactsearch telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeContactSearch TpSvcChannelTypeContactSearchClass tp_svc_channel_type_contact_search_emit_search_result_received tp_svc_channel_type_contact_search_emit_search_state_changed tp_svc_channel_type_contact_search_implement_more tp_svc_channel_type_contact_search_implement_search tp_svc_channel_type_contact_search_implement_stop tp_svc_channel_type_contact_search_more_impl tp_svc_channel_type_contact_search_return_from_more tp_svc_channel_type_contact_search_return_from_search tp_svc_channel_type_contact_search_return_from_stop tp_svc_channel_type_contact_search_search_impl tp_svc_channel_type_contact_search_stop_impl TP_IS_SVC_CHANNEL_TYPE_CONTACT_SEARCH TP_SVC_CHANNEL_TYPE_CONTACT_SEARCH TP_SVC_CHANNEL_TYPE_CONTACT_SEARCH_GET_CLASS TP_TYPE_SVC_CHANNEL_TYPE_CONTACT_SEARCH tp_svc_channel_type_contact_search_get_type
account-channel-request account-channel-request telepathy-glib/telepathy-glib.h TpAccountChannelRequest tp_account_channel_request_new tp_account_channel_request_new_vardict tp_account_channel_request_get_request tp_account_channel_request_dup_request tp_account_channel_request_get_user_action_time tp_account_channel_request_get_account tp_account_channel_request_set_target_contact tp_account_channel_request_set_target_id tp_account_channel_request_set_request_property tp_account_channel_request_new_text tp_account_channel_request_set_sms_channel tp_account_channel_request_set_conference_initial_channels tp_account_channel_request_set_initial_invitee_ids tp_account_channel_request_set_initial_invitees tp_account_channel_request_new_audio_call tp_account_channel_request_new_audio_video_call tp_account_channel_request_new_file_transfer tp_account_channel_request_set_file_transfer_description tp_account_channel_request_set_file_transfer_initial_offset tp_account_channel_request_set_file_transfer_timestamp tp_account_channel_request_set_file_transfer_uri tp_account_channel_request_set_file_transfer_hash tp_account_channel_request_new_stream_tube tp_account_channel_request_new_dbus_tube tp_account_channel_request_create_and_handle_channel_async tp_account_channel_request_create_and_handle_channel_finish tp_account_channel_request_ensure_and_handle_channel_async tp_account_channel_request_ensure_and_handle_channel_finish tp_account_channel_request_create_channel_async tp_account_channel_request_create_channel_finish tp_account_channel_request_ensure_channel_async tp_account_channel_request_ensure_channel_finish tp_account_channel_request_create_and_observe_channel_async tp_account_channel_request_create_and_observe_channel_finish tp_account_channel_request_ensure_and_observe_channel_async tp_account_channel_request_ensure_and_observe_channel_finish tp_account_channel_request_set_channel_factory tp_account_channel_request_get_channel_request tp_account_channel_request_set_hint tp_account_channel_request_set_hints tp_account_channel_request_set_delegate_to_preferred_handler TpAccountChannelRequestDelegatedChannelCb tp_account_channel_request_set_delegated_channel_callback tp_account_channel_request_get_type TP_ACCOUNT_CHANNEL_REQUEST TP_ACCOUNT_CHANNEL_REQUEST_CLASS TP_ACCOUNT_CHANNEL_REQUEST_GET_CLASS TP_IS_ACCOUNT_CHANNEL_REQUEST TP_IS_ACCOUNT_CHANNEL_REQUEST_CLASS TP_TYPE_ACCOUNT_CHANNEL_REQUEST
svc-tls svc-tls telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeServerTLSConnection TpSvcChannelTypeServerTLSConnectionClass TpSvcAuthenticationTLSCertificate TpSvcAuthenticationTLSCertificateClass tp_svc_authentication_tls_certificate_accept_impl tp_svc_authentication_tls_certificate_return_from_accept tp_svc_authentication_tls_certificate_implement_accept tp_svc_authentication_tls_certificate_emit_accepted tp_svc_authentication_tls_certificate_reject_impl tp_svc_authentication_tls_certificate_return_from_reject tp_svc_authentication_tls_certificate_implement_reject tp_svc_authentication_tls_certificate_emit_rejected TP_IS_SVC_AUTHENTICATION_TLS_CERTIFICATE TP_IS_SVC_CHANNEL_TYPE_SERVER_TLS_CONNECTION TP_SVC_AUTHENTICATION_TLS_CERTIFICATE TP_SVC_AUTHENTICATION_TLS_CERTIFICATE_GET_CLASS TP_SVC_CHANNEL_TYPE_SERVER_TLS_CONNECTION TP_SVC_CHANNEL_TYPE_SERVER_TLS_CONNECTION_GET_CLASS TP_TYPE_SVC_AUTHENTICATION_TLS_CERTIFICATE TP_TYPE_SVC_CHANNEL_TYPE_SERVER_TLS_CONNECTION tp_svc_authentication_tls_certificate_get_type tp_svc_channel_type_server_tls_connection_get_type
telepathy-glib/telepathy-glib.h base-contact-list base-contact-list TpBaseContactList TpBaseContactListClass tp_base_contact_list_mixin_class_init tp_base_contact_list_mixin_register_with_contacts_mixin tp_base_contact_list_mixin_list_iface_init tp_base_contact_list_mixin_groups_iface_init tp_base_contact_list_mixin_blocking_iface_init tp_base_contact_list_get_state tp_base_contact_list_get_connection tp_base_contact_list_set_list_pending tp_base_contact_list_set_list_failed tp_base_contact_list_set_list_received tp_base_contact_list_contacts_changed tp_base_contact_list_one_contact_changed tp_base_contact_list_one_contact_removed TpBaseContactListBooleanFunc tp_base_contact_list_false_func tp_base_contact_list_true_func tp_base_contact_list_get_contact_list_persists TpBaseContactListDupContactsFunc tp_base_contact_list_dup_contacts TpBaseContactListDupStatesFunc tp_base_contact_list_dup_states TpBaseContactListUIntFunc TpBaseContactListAsyncFunc TpBaseContactListAsyncFinishFunc tp_base_contact_list_download_async tp_base_contact_list_download_finish tp_base_contact_list_get_download_at_connection TP_TYPE_MUTABLE_CONTACT_LIST TpMutableContactListInterface tp_base_contact_list_can_change_contact_list tp_base_contact_list_get_request_uses_message TpBaseContactListRequestSubscriptionFunc tp_base_contact_list_request_subscription_async tp_base_contact_list_request_subscription_finish TpBaseContactListActOnContactsFunc tp_base_contact_list_authorize_publication_async tp_base_contact_list_authorize_publication_finish tp_base_contact_list_store_contacts_async tp_base_contact_list_store_contacts_finish tp_base_contact_list_remove_contacts_async tp_base_contact_list_remove_contacts_finish tp_base_contact_list_unsubscribe_async tp_base_contact_list_unsubscribe_finish tp_base_contact_list_unpublish_async tp_base_contact_list_unpublish_finish TP_TYPE_CONTACT_GROUP_LIST TpContactGroupListInterface TpBaseContactListNormalizeFunc tp_base_contact_list_normalize_group TpBaseContactListDupContactGroupsFunc tp_base_contact_list_dup_contact_groups TpBaseContactListDupGroupsFunc tp_base_contact_list_dup_groups TpBaseContactListDupGroupMembersFunc tp_base_contact_list_dup_group_members tp_base_contact_list_group_renamed tp_base_contact_list_groups_changed tp_base_contact_list_one_contact_groups_changed tp_base_contact_list_groups_created tp_base_contact_list_groups_removed tp_base_contact_list_has_disjoint_groups TP_TYPE_MUTABLE_CONTACT_GROUP_LIST TpMutableContactGroupListInterface TpBaseContactListSetContactGroupsFunc tp_base_contact_list_set_contact_groups_async tp_base_contact_list_set_contact_groups_finish TpBaseContactListGroupContactsFunc tp_base_contact_list_add_to_group_async tp_base_contact_list_add_to_group_finish tp_base_contact_list_remove_from_group_async tp_base_contact_list_remove_from_group_finish tp_base_contact_list_set_group_members_async tp_base_contact_list_set_group_members_finish TpBaseContactListRemoveGroupFunc tp_base_contact_list_remove_group_async tp_base_contact_list_remove_group_finish TpBaseContactListRenameGroupFunc tp_base_contact_list_rename_group_async tp_base_contact_list_rename_group_finish tp_base_contact_list_get_group_storage TP_TYPE_BLOCKABLE_CONTACT_LIST TpBlockableContactListInterface TpBaseContactListBlockContactsWithAbuseFunc tp_base_contact_list_can_block tp_base_contact_list_dup_blocked_contacts tp_base_contact_list_block_contacts_async tp_base_contact_list_block_contacts_finish tp_base_contact_list_block_contacts_with_abuse_async tp_base_contact_list_block_contacts_with_abuse_finish tp_base_contact_list_unblock_contacts_async tp_base_contact_list_unblock_contacts_finish tp_base_contact_list_contact_blocking_changed tp_base_contact_list_get_type TpBaseContactListPrivate TpBaseContactListClassPrivate TP_TYPE_BASE_CONTACT_LIST TP_BASE_CONTACT_LIST TP_BASE_CONTACT_LIST_CLASS TP_BASE_CONTACT_LIST_GET_CLASS TP_IS_BASE_CONTACT_LIST TP_IS_BASE_CONTACT_LIST_CLASS TP_IS_MUTABLE_CONTACT_LIST TP_MUTABLE_CONTACT_LIST_GET_INTERFACE tp_mutable_contact_list_get_type TP_IS_BLOCKABLE_CONTACT_LIST TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE tp_blockable_contact_list_get_type TP_IS_CONTACT_GROUP_LIST TP_CONTACT_GROUP_LIST_GET_INTERFACE tp_contact_group_list_get_type TP_IS_MUTABLE_CONTACT_GROUP_LIST TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE tp_mutable_contact_group_list_get_type
stream-tube-channel stream-tube-channel telepathy-glib/telepathy-glib.h TpStreamTubeChannel TpStreamTubeChannelClass tp_stream_tube_channel_accept_async tp_stream_tube_channel_accept_finish tp_stream_tube_channel_get_parameters tp_stream_tube_channel_dup_parameters_vardict tp_stream_tube_channel_get_service tp_stream_tube_channel_new tp_stream_tube_channel_offer_async tp_stream_tube_channel_offer_finish TP_IS_STREAM_TUBE_CHANNEL TP_IS_STREAM_TUBE_CHANNEL_CLASS TP_STREAM_TUBE_CHANNEL TP_STREAM_TUBE_CHANNEL_CLASS TP_STREAM_TUBE_CHANNEL_GET_CLASS TP_TYPE_STREAM_TUBE_CHANNEL tp_stream_tube_channel_get_type TpStreamTubeChannelPrivate
stream-tube-connection stream-tube-connection telepathy-glib/telepathy-glib.h TpStreamTubeConnection TpStreamTubeConnectionClass tp_stream_tube_connection_get_channel tp_stream_tube_connection_get_contact tp_stream_tube_connection_get_socket_connection TP_IS_STREAM_TUBE_CONNECTION TP_IS_STREAM_TUBE_CONNECTION_CLASS TP_STREAM_TUBE_CONNECTION TP_STREAM_TUBE_CONNECTION_CLASS TP_STREAM_TUBE_CONNECTION_GET_CLASS TP_TYPE_STREAM_TUBE_CONNECTION tp_stream_tube_connection_get_type TpStreamTubeConnectionPrivate
dbus-tube-channel dbus-tube-channel telepathy-glib/telepathy-glib.h TpDBusTubeChannel TpDBusTubeChannelClass TP_DBUS_TUBE_CHANNEL_FEATURE_CORE tp_dbus_tube_channel_get_parameters tp_dbus_tube_channel_dup_parameters_vardict tp_dbus_tube_channel_get_service_name tp_dbus_tube_channel_offer_async tp_dbus_tube_channel_offer_finish tp_dbus_tube_channel_accept_async tp_dbus_tube_channel_accept_finish TP_IS_DBUS_TUBE_CHANNEL TP_IS_DBUS_TUBE_CHANNEL_CLASS TP_DBUS_TUBE_CHANNEL TP_DBUS_TUBE_CHANNEL_CLASS TP_DBUS_TUBE_CHANNEL_GET_CLASS TP_TYPE_DBUS_TUBE_CHANNEL tp_dbus_tube_channel_get_type TpDBusTubeChannelPrivate tp_dbus_tube_channel_feature_quark_core
client-channel-factory client-channel-factory telepathy-glib/telepathy-glib.h TpClientChannelFactory TpClientChannelFactoryInterface tp_client_channel_factory_create_channel tp_client_channel_factory_dup_channel_features TP_CLIENT_CHANNEL_FACTORY TP_CLIENT_CHANNEL_FACTORY_GET_IFACE TP_IS_CLIENT_CHANNEL_FACTORY TP_TYPE_CLIENT_CHANNEL_FACTORY tp_client_channel_factory_get_type
basic-proxy-factory basic-proxy-factory telepathy-glib/telepathy-glib.h TpBasicProxyFactory TpBasicProxyFactoryClass tp_basic_proxy_factory_new tp_basic_proxy_factory_dup TP_BASIC_PROXY_FACTORY TP_BASIC_PROXY_FACTORY_GET_CLASS TP_IS_BASIC_PROXY_FACTORY TP_TYPE_BASIC_PROXY_FACTORY TP_BASIC_PROXY_FACTORY_CLASS TP_IS_BASIC_PROXY_FACTORY_CLASS tp_basic_proxy_factory_get_type
automatic-proxy-factory automatic-proxy-factory telepathy-glib/telepathy-glib.h TpAutomaticProxyFactory TpAutomaticProxyFactoryClass tp_automatic_proxy_factory_new tp_automatic_proxy_factory_dup TP_AUTOMATIC_PROXY_FACTORY TP_AUTOMATIC_PROXY_FACTORY_CLASS TP_AUTOMATIC_PROXY_FACTORY_GET_CLASS TP_IS_AUTOMATIC_PROXY_FACTORY TP_IS_AUTOMATIC_PROXY_FACTORY_CLASS TP_TYPE_AUTOMATIC_PROXY_FACTORY tp_automatic_proxy_factory_get_type
dtmf dtmf telepathy-glib/telepathy-glib.h TpDTMFPlayer tp_dtmf_player_new tp_dtmf_player_play tp_dtmf_player_cancel tp_dtmf_player_is_active TP_DTMF_PLAYER TP_DTMF_PLAYER_CLASS TP_DTMF_PLAYER_GET_CLASS TP_IS_DTMF_PLAYER TP_IS_DTMF_PLAYER_CLASS TP_TYPE_DTMF_PLAYER TpDTMFPlayerClass TpDTMFPlayerPrivate tp_dtmf_player_get_type
svc-channel-securable svc-channel-securable telepathy-glib/telepathy-glib-dbus.h TpSvcChannelInterfaceSecurable TpSvcChannelInterfaceSecurableClass TP_SVC_CHANNEL_INTERFACE_SECURABLE TP_IS_SVC_CHANNEL_INTERFACE_SECURABLE TP_TYPE_SVC_CHANNEL_INTERFACE_SECURABLE tp_svc_channel_interface_securable_get_type TP_SVC_CHANNEL_INTERFACE_SECURABLE_GET_CLASS
svc-channel-auth svc-channel-auth telepathy-glib/telepathy-glib-dbus.h TpSvcChannelTypeServerAuthentication TpSvcChannelTypeServerAuthenticationClass TpSvcChannelInterfaceSASLAuthentication TpSvcChannelInterfaceSASLAuthenticationClass tp_svc_channel_interface_sasl_authentication_abort_sasl_impl tp_svc_channel_interface_sasl_authentication_accept_sasl_impl tp_svc_channel_interface_sasl_authentication_emit_new_challenge tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed tp_svc_channel_interface_sasl_authentication_implement_abort_sasl tp_svc_channel_interface_sasl_authentication_implement_accept_sasl tp_svc_channel_interface_sasl_authentication_implement_respond tp_svc_channel_interface_sasl_authentication_implement_start_mechanism tp_svc_channel_interface_sasl_authentication_implement_start_mechanism_with_data tp_svc_channel_interface_sasl_authentication_respond_impl tp_svc_channel_interface_sasl_authentication_return_from_abort_sasl tp_svc_channel_interface_sasl_authentication_return_from_accept_sasl tp_svc_channel_interface_sasl_authentication_return_from_respond tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism_with_data tp_svc_channel_interface_sasl_authentication_start_mechanism_impl tp_svc_channel_interface_sasl_authentication_start_mechanism_with_data_impl TP_SVC_CHANNEL_TYPE_SERVER_AUTHENTICATION TP_IS_SVC_CHANNEL_TYPE_SERVER_AUTHENTICATION TP_TYPE_SVC_CHANNEL_TYPE_SERVER_AUTHENTICATION tp_svc_channel_type_server_authentication_get_type TP_SVC_CHANNEL_TYPE_SERVER_AUTHENTICATION_GET_CLASS TP_SVC_CHANNEL_INTERFACE_SASL_AUTHENTICATION TP_IS_SVC_CHANNEL_INTERFACE_SASL_AUTHENTICATION TP_TYPE_SVC_CHANNEL_INTERFACE_SASL_AUTHENTICATION tp_svc_channel_interface_sasl_authentication_get_type TP_SVC_CHANNEL_INTERFACE_SASL_AUTHENTICATION_GET_CLASS TpSvcChannelInterfaceCaptchaAuthentication TpSvcChannelInterfaceCaptchaAuthenticationClass TP_IS_SVC_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION TP_SVC_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION TP_SVC_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION_GET_CLASS tp_svc_channel_interface_captcha_authentication_get_type TP_TYPE_SVC_CHANNEL_INTERFACE_CAPTCHA_AUTHENTICATION tp_svc_channel_interface_captcha_authentication_answer_captchas_impl tp_svc_channel_interface_captcha_authentication_cancel_captcha_impl tp_svc_channel_interface_captcha_authentication_get_captcha_data_impl tp_svc_channel_interface_captcha_authentication_get_captchas_impl tp_svc_channel_interface_captcha_authentication_implement_answer_captchas tp_svc_channel_interface_captcha_authentication_implement_cancel_captcha tp_svc_channel_interface_captcha_authentication_implement_get_captcha_data tp_svc_channel_interface_captcha_authentication_implement_get_captchas tp_svc_channel_interface_captcha_authentication_return_from_answer_captchas tp_svc_channel_interface_captcha_authentication_return_from_cancel_captcha tp_svc_channel_interface_captcha_authentication_return_from_get_captcha_data tp_svc_channel_interface_captcha_authentication_return_from_get_captchas
channel-auth channel-auth telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_interface_sasl_authentication_call_abort_sasl tp_cli_channel_interface_sasl_authentication_call_accept_sasl tp_cli_channel_interface_sasl_authentication_call_respond tp_cli_channel_interface_sasl_authentication_call_start_mechanism tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data tp_cli_channel_interface_sasl_authentication_callback_for_abort_sasl tp_cli_channel_interface_sasl_authentication_callback_for_accept_sasl tp_cli_channel_interface_sasl_authentication_callback_for_respond tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism tp_cli_channel_interface_sasl_authentication_callback_for_start_mechanism_with_data tp_cli_channel_interface_sasl_authentication_connect_to_new_challenge tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed tp_cli_channel_interface_sasl_authentication_run_abort_sasl tp_cli_channel_interface_sasl_authentication_run_accept_sasl tp_cli_channel_interface_sasl_authentication_run_respond tp_cli_channel_interface_sasl_authentication_run_start_mechanism tp_cli_channel_interface_sasl_authentication_run_start_mechanism_with_data tp_cli_channel_interface_sasl_authentication_signal_callback_new_challenge tp_cli_channel_interface_sasl_authentication_signal_callback_sasl_status_changed tp_cli_channel_interface_captcha_authentication_call_answer_captchas tp_cli_channel_interface_captcha_authentication_call_cancel_captcha tp_cli_channel_interface_captcha_authentication_call_get_captcha_data tp_cli_channel_interface_captcha_authentication_call_get_captchas tp_cli_channel_interface_captcha_authentication_callback_for_answer_captchas tp_cli_channel_interface_captcha_authentication_callback_for_cancel_captcha tp_cli_channel_interface_captcha_authentication_callback_for_get_captcha_data tp_cli_channel_interface_captcha_authentication_callback_for_get_captchas
client-message telepathy-glib/telepathy-glib.h TpClientMessage TpClientMessage tp_client_message_new tp_client_message_new_text TP_IS_CLIENT_MESSAGE TP_IS_CLIENT_MESSAGE_CLASS TP_CLIENT_MESSAGE TP_CLIENT_MESSAGE_CLASS TP_CLIENT_MESSAGE_GET_CLASS TP_TYPE_CLIENT_MESSAGE tp_client_message_get_type
signalled-message telepathy-glib/telepathy-glib.h TpSignalledMessage TpSignalledMessage tp_signalled_message_get_sender TP_IS_SIGNALLED_MESSAGE TP_IS_SIGNALLED_MESSAGE_CLASS TP_SIGNALLED_MESSAGE TP_SIGNALLED_MESSAGE_CLASS TP_SIGNALLED_MESSAGE_GET_CLASS TP_TYPE_SIGNALLED_MESSAGE tp_signalled_message_get_type
text-channel text-channel telepathy-glib/telepathy-glib.h TpTextChannel TpTextChannelClass tp_text_channel_new tp_text_channel_get_supported_content_types tp_text_channel_get_message_part_support_flags tp_text_channel_get_delivery_reporting_support tp_text_channel_get_pending_messages tp_text_channel_dup_pending_messages tp_text_channel_get_message_types TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES tp_text_channel_send_message_async tp_text_channel_send_message_finish tp_text_channel_ack_messages_async tp_text_channel_ack_messages_finish tp_text_channel_ack_message_async tp_text_channel_ack_message_finish tp_text_channel_ack_all_pending_messages_async tp_text_channel_ack_all_pending_messages_finish tp_text_channel_set_chat_state_async tp_text_channel_set_chat_state_finish tp_text_channel_supports_message_type TP_TEXT_CHANNEL_FEATURE_SMS tp_text_channel_is_sms_channel tp_text_channel_get_sms_flash tp_text_channel_get_sms_length_async tp_text_channel_get_sms_length_finish TP_TEXT_CHANNEL_FEATURE_CHAT_STATES tp_text_channel_get_chat_state TP_IS_TEXT_CHANNEL TP_IS_TEXT_CHANNEL_CLASS TP_TEXT_CHANNEL TP_TEXT_CHANNEL_CLASS TP_TEXT_CHANNEL_GET_CLASS TP_TYPE_TEXT_CHANNEL tp_text_channel_get_type TpTextChannelPrivate tp_text_channel_get_feature_quark_incoming_messages tp_text_channel_get_feature_quark_sms tp_text_channel_get_feature_quark_chat_states
file-transfer-channel file-transfer-channel telepathy-glib/telepathy-glib.h TpFileTransferChannel TpFileTransferChannelClass tp_file_transfer_channel_new TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE tp_file_transfer_channel_get_mime_type tp_file_transfer_channel_get_date tp_file_transfer_channel_get_description tp_file_transfer_channel_get_filename tp_file_transfer_channel_get_size tp_file_transfer_channel_get_transferred_bytes tp_file_transfer_channel_get_state tp_file_transfer_channel_get_service_name tp_file_transfer_channel_get_metadata tp_file_transfer_channel_accept_file_async tp_file_transfer_channel_accept_file_finish tp_file_transfer_channel_provide_file_async tp_file_transfer_channel_provide_file_finish tp_file_transfer_channel_get_type TP_FILE_TRANSFER_CHANNEL TP_FILE_TRANSFER_CHANNEL_CLASS TP_FILE_TRANSFER_CHANNEL_GET_CLASS TP_IS_FILE_TRANSFER_CHANNEL TP_IS_FILE_TRANSFER_CHANNEL_CLASS TP_TYPE_FILE_TRANSFER_CHANNEL TpFileTransferChannelPrivate tp_file_transfer_channel_get_feature_quark_core
cli-call-channel cli-call-channel telepathy-glib/telepathy-glib-dbus.h tp_cli_channel_type_call_call_accept tp_cli_channel_type_call_call_add_content tp_cli_channel_type_call_call_hangup tp_cli_channel_type_call_call_set_queued tp_cli_channel_type_call_call_set_ringing tp_cli_channel_type_call_callback_for_accept tp_cli_channel_type_call_callback_for_add_content tp_cli_channel_type_call_callback_for_hangup tp_cli_channel_type_call_callback_for_set_queued tp_cli_channel_type_call_callback_for_set_ringing tp_cli_channel_type_call_connect_to_call_members_changed tp_cli_channel_type_call_connect_to_call_state_changed tp_cli_channel_type_call_connect_to_content_added tp_cli_channel_type_call_connect_to_content_removed tp_cli_channel_type_call_signal_callback_call_members_changed tp_cli_channel_type_call_signal_callback_call_state_changed tp_cli_channel_type_call_signal_callback_content_added tp_cli_channel_type_call_signal_callback_content_removed
call-channel call-channel telepathy-glib/telepathy-glib.h TpCallChannel TpCallChannelClass TP_CALL_CHANNEL_FEATURE_CORE TpCallStateReason tp_call_channel_get_contents tp_call_channel_get_state tp_call_channel_has_hardware_streaming tp_call_channel_has_initial_audio tp_call_channel_has_initial_video tp_call_channel_has_mutable_contents tp_call_channel_get_members tp_call_channel_has_dtmf tp_call_channel_has_hold tp_call_channel_send_tones_async tp_call_channel_send_tones_finish tp_call_channel_set_ringing_async tp_call_channel_set_ringing_finish tp_call_channel_set_queued_async tp_call_channel_set_queued_finish tp_call_channel_accept_async tp_call_channel_accept_finish tp_call_channel_hangup_async tp_call_channel_hangup_finish tp_call_channel_add_content_async tp_call_channel_add_content_finish tp_call_channel_request_hold_async tp_call_channel_request_hold_finish TpCallChannelPrivate tp_call_channel_get_type TP_CALL_CHANNEL TP_CALL_CHANNEL_CLASS TP_CALL_CHANNEL_GET_CLASS TP_TYPE_CALL_CHANNEL TP_IS_CALL_CHANNEL TP_IS_CALL_CHANNEL_CLASS tp_call_state_reason_get_type TP_TYPE_CALL_STATE_REASON tp_call_channel_get_feature_quark_core
cli-call-content cli-call-content telepathy-glib/telepathy-glib-dbus.h tp_cli_call_content_call_remove tp_cli_call_content_callback_for_remove tp_cli_call_content_connect_to_streams_added tp_cli_call_content_connect_to_streams_removed tp_cli_call_content_signal_callback_streams_added tp_cli_call_content_signal_callback_streams_removed tp_cli_call_content_interface_media_call_acknowledge_dtmf_change tp_cli_call_content_interface_media_call_fail tp_cli_call_content_interface_media_call_update_local_media_description tp_cli_call_content_interface_media_callback_for_acknowledge_dtmf_change tp_cli_call_content_interface_media_callback_for_fail tp_cli_call_content_interface_media_callback_for_update_local_media_description tp_cli_call_content_interface_media_connect_to_dtmf_change_requested tp_cli_call_content_interface_media_connect_to_local_media_description_changed tp_cli_call_content_interface_media_connect_to_media_description_offer_done tp_cli_call_content_interface_media_connect_to_media_descriptions_removed tp_cli_call_content_interface_media_connect_to_new_media_description_offer tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed tp_cli_call_content_interface_media_signal_callback_dtmf_change_requested tp_cli_call_content_interface_media_signal_callback_local_media_description_changed tp_cli_call_content_interface_media_signal_callback_media_description_offer_done tp_cli_call_content_interface_media_signal_callback_media_descriptions_removed tp_cli_call_content_interface_media_signal_callback_new_media_description_offer tp_cli_call_content_interface_media_signal_callback_remote_media_descriptions_changed tp_cli_call_content_interface_video_control_connect_to_bitrate_changed tp_cli_call_content_interface_video_control_connect_to_framerate_changed tp_cli_call_content_interface_video_control_connect_to_key_frame_requested tp_cli_call_content_interface_video_control_connect_to_mtu_changed tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed tp_cli_call_content_interface_video_control_signal_callback_bitrate_changed tp_cli_call_content_interface_video_control_signal_callback_framerate_changed tp_cli_call_content_interface_video_control_signal_callback_key_frame_requested tp_cli_call_content_interface_video_control_signal_callback_mtu_changed tp_cli_call_content_interface_video_control_signal_callback_video_resolution_changed tp_cli_call_content_interface_audio_control_call_report_input_volume tp_cli_call_content_interface_audio_control_call_report_output_volume tp_cli_call_content_interface_audio_control_callback_for_report_input_volume tp_cli_call_content_interface_audio_control_callback_for_report_output_volume tp_cli_call_content_interface_dtmf_call_multiple_tones tp_cli_call_content_interface_dtmf_call_start_tone tp_cli_call_content_interface_dtmf_call_stop_tone tp_cli_call_content_interface_dtmf_callback_for_multiple_tones tp_cli_call_content_interface_dtmf_callback_for_start_tone tp_cli_call_content_interface_dtmf_callback_for_stop_tone tp_cli_call_content_interface_dtmf_connect_to_sending_tones tp_cli_call_content_interface_dtmf_connect_to_stopped_tones tp_cli_call_content_interface_dtmf_connect_to_tones_deferred tp_cli_call_content_interface_dtmf_signal_callback_sending_tones tp_cli_call_content_interface_dtmf_signal_callback_stopped_tones tp_cli_call_content_interface_dtmf_signal_callback_tones_deferred
call-content call-content telepathy-glib/telepathy-glib.h TpCallContent TpCallContentClass tp_call_content_init_known_interfaces TP_CALL_CONTENT_FEATURE_CORE tp_call_content_get_disposition tp_call_content_get_media_type tp_call_content_get_name tp_call_content_get_streams tp_call_content_remove_async tp_call_content_remove_finish tp_call_content_send_tones_async tp_call_content_send_tones_finish TpCallContentPrivate tp_call_content_get_type TP_CALL_CONTENT TP_CALL_CONTENT_CLASS TP_CALL_CONTENT_GET_CLASS TP_IS_CALL_CONTENT TP_IS_CALL_CONTENT_CLASS TP_TYPE_CALL_CONTENT tp_call_content_get_feature_quark_core
cli-call-stream cli-call-stream telepathy-glib/telepathy-glib-dbus.h tp_cli_call_stream_call_request_receiving tp_cli_call_stream_call_set_sending tp_cli_call_stream_callback_for_request_receiving tp_cli_call_stream_callback_for_set_sending tp_cli_call_stream_connect_to_local_sending_state_changed tp_cli_call_stream_connect_to_remote_members_changed tp_cli_call_stream_signal_callback_local_sending_state_changed tp_cli_call_stream_signal_callback_remote_members_changed tp_cli_call_stream_interface_media_call_add_candidates tp_cli_call_stream_interface_media_call_complete_receiving_state_change tp_cli_call_stream_interface_media_call_complete_sending_state_change tp_cli_call_stream_interface_media_call_fail tp_cli_call_stream_interface_media_call_finish_initial_candidates tp_cli_call_stream_interface_media_call_report_receiving_failure tp_cli_call_stream_interface_media_call_report_sending_failure tp_cli_call_stream_interface_media_call_set_credentials tp_cli_call_stream_interface_media_callback_for_add_candidates tp_cli_call_stream_interface_media_callback_for_complete_receiving_state_change tp_cli_call_stream_interface_media_callback_for_complete_sending_state_change tp_cli_call_stream_interface_media_callback_for_fail tp_cli_call_stream_interface_media_callback_for_finish_initial_candidates tp_cli_call_stream_interface_media_callback_for_report_receiving_failure tp_cli_call_stream_interface_media_callback_for_report_sending_failure tp_cli_call_stream_interface_media_callback_for_set_credentials tp_cli_call_stream_interface_media_connect_to_endpoints_changed tp_cli_call_stream_interface_media_connect_to_ice_restart_requested tp_cli_call_stream_interface_media_connect_to_local_candidates_added tp_cli_call_stream_interface_media_connect_to_local_credentials_changed tp_cli_call_stream_interface_media_connect_to_receiving_state_changed tp_cli_call_stream_interface_media_connect_to_relay_info_changed tp_cli_call_stream_interface_media_connect_to_sending_state_changed tp_cli_call_stream_interface_media_connect_to_server_info_retrieved tp_cli_call_stream_interface_media_connect_to_stun_servers_changed tp_cli_call_stream_interface_media_signal_callback_endpoints_changed tp_cli_call_stream_interface_media_signal_callback_ice_restart_requested tp_cli_call_stream_interface_media_signal_callback_local_candidates_added tp_cli_call_stream_interface_media_signal_callback_local_credentials_changed tp_cli_call_stream_interface_media_signal_callback_receiving_state_changed tp_cli_call_stream_interface_media_signal_callback_relay_info_changed tp_cli_call_stream_interface_media_signal_callback_sending_state_changed tp_cli_call_stream_interface_media_signal_callback_server_info_retrieved tp_cli_call_stream_interface_media_signal_callback_stun_servers_changed
call-stream call-stream telepathy-glib/telepathy-glib.h TpCallStream TpCallStreamClass tp_call_stream_init_known_interfaces TP_CALL_STREAM_FEATURE_CORE tp_call_stream_can_request_receiving tp_call_stream_get_local_sending_state tp_call_stream_get_remote_members tp_call_stream_request_receiving_async tp_call_stream_request_receiving_finish tp_call_stream_set_sending_async tp_call_stream_set_sending_finish tp_call_stream_get_type TpCallStreamPrivate TP_CALL_STREAM TP_CALL_STREAM_CLASS TP_CALL_STREAM_GET_CLASS TP_IS_CALL_STREAM TP_IS_CALL_STREAM_CLASS TP_TYPE_CALL_STREAM tp_call_stream_get_feature_quark_core
cli-call-misc cli-call-misc telepathy-glib/telepathy-glib-dbus.h tp_cli_call_content_media_description_call_accept tp_cli_call_content_media_description_call_reject tp_cli_call_content_media_description_callback_for_accept tp_cli_call_content_media_description_callback_for_reject tp_cli_call_stream_endpoint_call_accept_selected_candidate_pair tp_cli_call_stream_endpoint_call_reject_selected_candidate_pair tp_cli_call_stream_endpoint_call_set_controlling tp_cli_call_stream_endpoint_call_set_endpoint_state tp_cli_call_stream_endpoint_call_set_selected_candidate_pair tp_cli_call_stream_endpoint_callback_for_accept_selected_candidate_pair tp_cli_call_stream_endpoint_callback_for_reject_selected_candidate_pair tp_cli_call_stream_endpoint_callback_for_set_controlling tp_cli_call_stream_endpoint_callback_for_set_endpoint_state tp_cli_call_stream_endpoint_callback_for_set_selected_candidate_pair tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected tp_cli_call_stream_endpoint_connect_to_controlling_changed tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed tp_cli_call_stream_endpoint_connect_to_remote_candidates_added tp_cli_call_stream_endpoint_connect_to_remote_credentials_set tp_cli_call_stream_endpoint_signal_callback_candidate_pair_selected tp_cli_call_stream_endpoint_signal_callback_controlling_changed tp_cli_call_stream_endpoint_signal_callback_endpoint_state_changed tp_cli_call_stream_endpoint_signal_callback_remote_candidates_added tp_cli_call_stream_endpoint_signal_callback_remote_credentials_set
call-misc call-misc telepathy-glib/telepathy-glib.h tp_call_content_media_description_init_known_interfaces tp_call_stream_endpoint_init_known_interfaces
simple-client-factory simple-client-factory telepathy-glib/telepathy-glib.h TpSimpleClientFactory TpSimpleClientFactoryClass tp_simple_client_factory_new tp_simple_client_factory_get_dbus_daemon tp_simple_client_factory_ensure_account tp_simple_client_factory_dup_account_features tp_simple_client_factory_add_account_features tp_simple_client_factory_add_account_features_varargs tp_simple_client_factory_ensure_connection tp_simple_client_factory_dup_connection_features tp_simple_client_factory_add_connection_features tp_simple_client_factory_add_connection_features_varargs tp_simple_client_factory_ensure_channel tp_simple_client_factory_dup_channel_features tp_simple_client_factory_add_channel_features tp_simple_client_factory_add_channel_features_varargs tp_simple_client_factory_ensure_contact tp_simple_client_factory_upgrade_contacts_async tp_simple_client_factory_upgrade_contacts_finish tp_simple_client_factory_ensure_contact_by_id_async tp_simple_client_factory_ensure_contact_by_id_finish tp_simple_client_factory_dup_contact_features tp_simple_client_factory_add_contact_features tp_simple_client_factory_add_contact_features_varargs TP_IS_SIMPLE_CLIENT_FACTORY TP_IS_SIMPLE_CLIENT_FACTORY_CLASS TP_SIMPLE_CLIENT_FACTORY TP_SIMPLE_CLIENT_FACTORY_CLASS TP_SIMPLE_CLIENT_FACTORY_GET_CLASS TP_TYPE_SIMPLE_CLIENT_FACTORY tp_simple_client_factory_get_type TpSimpleClientFactoryPrivate
automatic-client-factory automatic-client-factory telepathy-glib/telepathy-glib.h TpAutomaticClientFactory TpAutomaticClientFactoryClass tp_automatic_client_factory_new TP_IS_AUTOMATIC_CLIENT_FACTORY TP_IS_AUTOMATIC_CLIENT_FACTORY_CLASS TP_AUTOMATIC_CLIENT_FACTORY TP_AUTOMATIC_CLIENT_FACTORY_CLASS TP_AUTOMATIC_CLIENT_FACTORY_GET_CLASS TP_TYPE_AUTOMATIC_CLIENT_FACTORY tp_automatic_client_factory_get_type
svc-channel-ft-metadata svc-channel-ft-metadata telepathy-glib/telepathy-glib-dbus.h TpSvcChannelInterfaceFileTransferMetadata TpSvcChannelInterfaceFileTransferMetadataClass TP_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA TP_IS_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA TP_TYPE_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA tp_svc_channel_interface_file_transfer_metadata_get_type TP_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_GET_CLASS
telepathy-glib/telepathy-glib.h base-call-channel TpBaseCallChannel TpBaseCallChannel TpBaseCallChannelClass TpBaseCallChannelVoidFunc TpBaseCallChannelAddContentFunc TpBaseCallChannelHangupFunc tp_base_call_channel_get_state tp_base_call_channel_set_state tp_base_call_channel_has_initial_audio tp_base_call_channel_has_initial_video tp_base_call_channel_has_mutable_contents tp_base_call_channel_get_contents tp_base_call_channel_add_content tp_base_call_channel_remove_content tp_base_call_channel_update_member_flags tp_base_call_channel_remove_member tp_base_call_channel_get_call_members tp_base_call_channel_remote_accept tp_base_call_channel_is_accepted TP_BASE_CALL_CHANNEL TP_BASE_CALL_CHANNEL_CLASS TP_BASE_CALL_CHANNEL_GET_CLASS TP_IS_BASE_CALL_CHANNEL TP_IS_BASE_CALL_CHANNEL_CLASS TP_TYPE_BASE_CALL_CHANNEL tp_base_call_channel_get_type TpBaseCallChannelPrivate
telepathy-glib/telepathy-glib.h base-call-content TpBaseCallContent TpBaseCallContent TpBaseCallContentClass TpBaseCallContentGetInterfacesFunc TpBaseCallContentDeinitFunc TpBaseCallContentMultipleTonesFunc TpBaseCallContentStartToneFunc TpBaseCallContentStopToneFunc tp_base_call_content_get_connection tp_base_call_content_get_object_path tp_base_call_content_get_name tp_base_call_content_get_media_type tp_base_call_content_get_disposition tp_base_call_content_get_streams tp_base_call_content_add_stream tp_base_call_content_remove_stream TP_BASE_CALL_CONTENT TP_BASE_CALL_CONTENT_CLASS TP_BASE_CALL_CONTENT_GET_CLASS TP_IS_BASE_CALL_CONTENT TP_IS_BASE_CALL_CONTENT_CLASS TP_TYPE_BASE_CALL_CONTENT tp_base_call_content_get_type TpBaseCallContentPrivate
telepathy-glib/telepathy-glib.h base-call-stream TpBaseCallStream TpBaseCallStream TpBaseCallStreamClass TpBaseCallStreamGetInterfacesFunc TpBaseCallStreamRequestReceivingFunc TpBaseCallStreamSetSendingFunc tp_base_call_stream_get_connection tp_base_call_stream_get_object_path tp_base_call_stream_get_local_sending_state tp_base_call_stream_update_local_sending_state tp_base_call_stream_get_remote_sending_state tp_base_call_stream_update_remote_sending_state tp_base_call_stream_remove_member TP_BASE_CALL_STREAM TP_BASE_CALL_STREAM_CLASS TP_BASE_CALL_STREAM_GET_CLASS TP_IS_BASE_CALL_STREAM TP_IS_BASE_CALL_STREAM_CLASS TP_TYPE_BASE_CALL_STREAM tp_base_call_stream_get_type TpBaseCallStreamPrivate
telepathy-glib/telepathy-glib.h base-media-call-content TpBaseMediaCallContent TpBaseMediaCallContent TpBaseMediaCallContentClass tp_base_media_call_content_get_local_media_description tp_base_media_call_content_offer_media_description_async tp_base_media_call_content_offer_media_description_finish TP_BASE_MEDIA_CALL_CONTENT TP_BASE_MEDIA_CALL_CONTENT_CLASS TP_BASE_MEDIA_CALL_CONTENT_GET_CLASS TP_IS_BASE_MEDIA_CALL_CONTENT TP_IS_BASE_MEDIA_CALL_CONTENT_CLASS TP_TYPE_BASE_MEDIA_CALL_CONTENT tp_base_media_call_content_get_type TpBaseMediaCallContentPrivate
telepathy-glib/telepathy-glib.h call-content-media-description TpCallContentMediaDescription TpCallContentMediaDescription TpCallContentMediaDescriptionClass tp_call_content_media_description_new tp_call_content_media_description_get_object_path tp_call_content_media_description_get_remote_contact tp_call_content_media_description_append_codec tp_call_content_media_description_add_ssrc tp_call_content_media_description_add_rtp_header_extension tp_call_content_media_description_add_rtcp_feedback_message tp_call_content_media_description_set_rtcp_feedback_minimum_interval tp_call_content_media_description_set_does_avpf tp_call_content_media_description_set_rtcp_extended_reports tp_call_content_media_description_add_rtcp_extended_reports_interface tp_call_content_media_description_add_rtcp_feedback_interface tp_call_content_media_description_add_rtp_header_extensions_interface TP_CALL_CONTENT_MEDIA_DESCRIPTION TP_CALL_CONTENT_MEDIA_DESCRIPTION_CLASS TP_CALL_CONTENT_MEDIA_DESCRIPTION_GET_CLASS TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION_CLASS TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION tp_call_content_media_description_get_type TpBaseMediaCallContentPrivate
telepathy-glib/telepathy-glib.h base-media-call-stream TpBaseMediaCallStream TpBaseMediaCallStream TpBaseMediaCallStreamClass TpBaseMediaCallStreamFinishInitialCandidatesFunc TpBaseMediaCallStreamAddCandidatesFunc TpBaseMediaCallStreamReportFailureFunc TpBaseMediaCallStreamRequestReceivingFunc TpBaseMediaCallStreamSetSendingFunc tp_base_media_call_stream_set_relay_info tp_base_media_call_stream_set_stun_servers tp_base_media_call_stream_add_endpoint tp_base_media_call_stream_remove_endpoint tp_base_media_call_stream_get_endpoints tp_base_media_call_stream_get_username tp_base_media_call_stream_get_password tp_base_media_call_stream_update_receiving_state tp_base_media_call_stream_get_receiving_state tp_base_media_call_stream_update_sending_state tp_base_media_call_stream_get_sending_state tp_base_media_call_stream_set_local_sending tp_base_media_call_stream_get_local_sending tp_base_media_call_stream_get_local_candidates TP_BASE_MEDIA_CALL_STREAM TP_BASE_MEDIA_CALL_STREAM_CLASS TP_BASE_MEDIA_CALL_STREAM_GET_CLASS TP_IS_BASE_MEDIA_CALL_STREAM TP_IS_BASE_MEDIA_CALL_STREAM_CLASS TP_TYPE_BASE_MEDIA_CALL_STREAM tp_base_media_call_stream_get_type TpBaseMediaCallStreamPrivate
telepathy-glib/telepathy-glib.h call-stream-endpoint TpCallStreamEndpoint TpCallStreamEndpoint TpCallStreamEndpointClass tp_call_stream_endpoint_new tp_call_stream_endpoint_get_object_path tp_call_stream_endpoint_get_state tp_call_stream_endpoint_add_new_candidates tp_call_stream_endpoint_add_new_candidate tp_call_stream_endpoint_set_remote_credentials TP_CALL_STREAM_ENDPOINT TP_CALL_STREAM_ENDPOINT_CLASS TP_CALL_STREAM_ENDPOINT_GET_CLASS TP_IS_CALL_STREAM_ENDPOINT TP_IS_CALL_STREAM_ENDPOINT_CLASS TP_TYPE_CALL_STREAM_ENDPOINT tp_call_stream_endpoint_get_type TpCallStreamEndpointPrivate
telepathy-glib/telepathy-glib.h base-media-call-channel TpBaseMediaCallChannel TpBaseMediaCallChannel TpBaseMediaCallChannelClass TpBaseMediaCallChannelHoldStateChangedFunc TpBaseMediaCallChannelVoidFunc tp_base_media_call_channel_get_local_hold_state TP_BASE_MEDIA_CALL_CHANNEL TP_BASE_MEDIA_CALL_CHANNEL_CLASS TP_BASE_MEDIA_CALL_CHANNEL_GET_CLASS TP_IS_BASE_MEDIA_CALL_CHANNEL TP_IS_BASE_MEDIA_CALL_CHANNEL_CLASS TP_TYPE_BASE_MEDIA_CALL_CHANNEL tp_base_media_call_channel_get_type TpBaseMediaCallChannelPrivate
telepathy-glib/telepathy-glib.h debug-client TpDebugClient TpDebugClient TpDebugClientClass tp_cli_debug_call_get_messages tp_cli_debug_callback_for_get_messages tp_cli_debug_connect_to_new_debug_message tp_cli_debug_signal_callback_new_debug_message tp_debug_client_init_known_interfaces tp_debug_client_new tp_debug_client_set_enabled_async tp_debug_client_set_enabled_finish tp_debug_client_is_enabled TP_DEBUG_CLIENT TP_DEBUG_CLIENT_CLASS TP_DEBUG_CLIENT_FEATURE_CORE TP_DEBUG_CLIENT_GET_CLASS TP_IS_DEBUG_CLIENT TP_IS_DEBUG_CLIENT_CLASS TP_TYPE_DEBUG_CLIENT tp_debug_client_get_type tp_debug_client_get_feature_quark_core TpDebugClientPrivate
telepathy-glib/telepathy-glib.h debug-message TpDebugMessage TpDebugMessage TpDebugMessageClass tp_debug_client_get_messages_async tp_debug_client_get_messages_finish tp_debug_message_get_domain tp_debug_message_get_category tp_debug_message_get_level tp_debug_message_get_message tp_debug_message_get_time TP_DEBUG_MESSAGE TP_DEBUG_MESSAGE_CLASS TP_DEBUG_MESSAGE_GET_CLASS TP_IS_DEBUG_MESSAGE TP_IS_DEBUG_MESSAGE_CLASS TP_TYPE_DEBUG_MESSAGE tp_debug_message_get_type TpDebugMessagePriv
room-list room-list telepathy-glib/telepathy-glib.h TpRoomList TpRoomListClass tp_room_list_new_async tp_room_list_new_finish tp_room_list_is_listing tp_room_list_get_server tp_room_list_get_account tp_room_list_start TP_IS_ROOM_LIST TP_IS_ROOM_LIST_CLASS TP_ROOM_LIST TP_ROOM_LIST_CLASS TP_ROOM_LIST_FEATURE_LISTING TP_ROOM_LIST_GET_CLASS TP_TYPE_ROOM_LIST tp_room_list_get_type TpRoomListPrivate tp_room_list_get_feature_quark_listing
room-info room-info telepathy-glib/telepathy-glib.h TpRoomInfo TpRoomInfoClass tp_room_info_get_channel_type tp_room_info_get_description tp_room_info_get_handle tp_room_info_get_handle_name tp_room_info_get_invite_only tp_room_info_get_members_count tp_room_info_get_name tp_room_info_get_requires_password tp_room_info_get_room_id tp_room_info_get_server tp_room_info_get_subject TP_IS_ROOM_INFO TP_IS_ROOM_INFO_CLASS TP_ROOM_INFO TP_ROOM_INFO_CLASS TP_ROOM_INFO_GET_CLASS TP_TYPE_ROOM_INFO tp_room_info_get_type TpRoomInfoPriv
tls-certificate telepathy-glib/telepathy-glib.h TpTLSCertificate TpTLSCertificate tp_tls_certificate_init_known_interfaces tp_tls_certificate_new TP_TLS_CERTIFICATE_FEATURE_CORE tp_tls_certificate_get_rejection tp_tls_certificate_get_nth_rejection tp_tls_certificate_accept_async tp_tls_certificate_accept_finish tp_tls_certificate_add_rejection tp_tls_certificate_reject_async tp_tls_certificate_reject_finish tp_tls_certificate_get_cert_type tp_tls_certificate_get_cert_data tp_tls_certificate_get_state tp_cli_authentication_tls_certificate_call_accept tp_cli_authentication_tls_certificate_call_reject tp_cli_authentication_tls_certificate_callback_for_accept tp_cli_authentication_tls_certificate_callback_for_reject tp_cli_authentication_tls_certificate_connect_to_accepted tp_cli_authentication_tls_certificate_connect_to_rejected tp_cli_authentication_tls_certificate_signal_callback_accepted tp_cli_authentication_tls_certificate_signal_callback_rejected tp_tls_certificate_get_feature_quark_core TP_IS_TLS_CERTIFICATE TP_IS_TLS_CERTIFICATE_CLASS TP_TLS_CERTIFICATE TP_TLS_CERTIFICATE_CLASS TP_TLS_CERTIFICATE_GET_CLASS TP_TYPE_TLS_CERTIFICATE TpTLSCertificateClass TpTLSCertificateClassPrivate TpTLSCertificatePrivate tp_tls_certificate_get_type
tls-certificate-rejection telepathy-glib/telepathy-glib.h TpTLSCertificateRejection TpTLSCertificateRejection tp_tls_certificate_rejection_get_dbus_error tp_tls_certificate_rejection_get_details tp_tls_certificate_rejection_get_error tp_tls_certificate_rejection_get_reason tp_tls_certificate_rejection_raise_error TP_IS_TLS_CERTIFICATE_REJECTION TP_IS_TLS_CERTIFICATE_REJECTION_CLASS TP_TLS_CERTIFICATE_REJECTION TP_TLS_CERTIFICATE_REJECTION_CLASS TP_TLS_CERTIFICATE_REJECTION_GET_CLASS TP_TYPE_TLS_CERTIFICATE_REJECTION TpTLSCertificateRejectionClass tp_tls_certificate_rejection_get_type TpTLSCertificateRejectionPriv
telepathy-glib-0.24.2/docs/reference/tp-svc.xml0000644000175000017500000001751412652510705016271 00000000000000 The TpSvc* interfaces 7 telepathy-glib The TpSvc* interfaces How to export Telepathy objects The GInterfaces whose names start with TpSvc are generated automatically from the Telepathy specification, and can be used to make it easier to export methods and signals onto D-Bus. By implementing these GInterfaces you can avoid needing to generate any "glue" using the dbus-glib tools - this is all done internally inside telepathy-glib. The media session interface makes a convenient example because it only has two methods (Error() and Ready()) and one signal (NewStreamHandler), and media session handlers aren't expected to implement any other interfaces. The first thing to do is pre-declare the interface init function, and define the type you'll be using, declaring it to implement the media stream handler interface: static void stream_handler_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE(GabbleMediaStream, gabble_media_stream, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_MEDIA_STREAM_HANDLER, stream_handler_iface_init) ) Here we're using a subclass of G_TYPE_OBJECT. You can of course subclass any type. If you're implementing more than one interface on the same object, define more than one init function, and call G_IMPLEMENT_INTERFACE more than once. The interface init functions can even be extern if you want to separate off chunks of functionality into a different .c file. For instance, here's GabbleConnection: /* in header files */ void conn_aliasing_iface_init (gpointer, gpointer); void conn_avatars_iface_init (gpointer, gpointer); void conn_presence_iface_init (gpointer, gpointer); /* in gabble-connection.c */ static void conn_iface_init (gpointer, gpointer); static void capabilities_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE(GabbleConnection, gabble_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, conn_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, conn_aliasing_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS, conn_avatars_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CAPABILITIES, capabilities_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, conn_presence_iface_init); ) The _class_init, _init etc. functions are just like normal, so I won't describe them here. One thing to note, though, is that for signals which are defined by the GInterface, you do not need to do anything in the _class_init - the GInterface has already set the signal up for you. For each exported D-Bus method, there's a typedef ending with _impl giving the signature you should use for your method implementation. For example, here's the signature for the Error method on the media session handler interface: void (*tp_svc_media_session_handler_error_impl) (TpSvcMediaSessionHandler *self, guint errno, const char *message, DBusGMethodInvocation *context); and here's the beginning of the corresponding implementation: static void gabble_media_session_error (TpSvcMediaSessionHandler *iface, guint errno, const char *message, DBusGMethodInvocation *context) { GabbleMediaSession *self = GABBLE_MEDIA_SESSION (iface); /* do stuff with self here */ All service methods in telepathy-glib are asynchronous - you can of course implement them synchronously if you like, but you have to return the result or error to D-Bus by calling a callback rather than by returning from a function. The method implementation's last parameter is a DBusGMethodInvocation. To send the reply, you must either call dbus_g_method_return_error (for a failure), dbus_g_method_return (for a successful return), or an inline function whose name contains "_return_from_" provided by the TpSvc interface. For example, for Error there's an inline function tp_svc_media_session_handler_return_from_error(). These inline functions are just a simple wrapper around dbus_g_method_return() to make it type-safe - it's recommended that you use them where possible. For instance, Error doesn't return anything, so tp_svc_media_session_handler_return_from_error() doesn't take any parameters apart from the DBusGMethodInvocation: static void gabble_media_session_error (TpSvcMediaSessionHandler *iface, guint errno, const char *message, DBusGMethodInvocation *context) { GabbleMediaSession *self = GABBLE_MEDIA_SESSION (iface); /* do stuff with self here */ tp_svc_media_session_handler_return_from_error (context); } As for signals, they're named as dictated by dbus-glib. This normally gives you a sensible lower-case name - for instance NewStreamHandler is mapped to "new-stream-handler". To emit a signal, the generated code contains another convenience function whose name contains _emit_. This is prototyped to take the correct arguments for the signal, and emits it efficiently: tp_svc_media_session_handler_emit_new_stream_handler (session, object_path, id, media_type, TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL); Finally, the interface init function needs to be written. Normally you'd set the fields of a vtable to be pointers to your method implementations. However, we couldn't do this in telepathy-glib because that would mean breaking the ABI every time we added methods to an interface. Instead, you call functions, with pointers to your method implementations as a parameter: static void session_handler_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcMediaSessionHandlerClass *klass = (TpSvcMediaSessionHandlerClass *)g_iface; tp_svc_media_session_handler_implement_error (klass, gabble_media_session_error); tp_svc_media_session_handler_implement_ready (klass, gabble_media_session_ready); } This is obviously quite repetitive if there are a lot of methods, so the convention I've used in telepathy-glib, Gabble and telepathy-sofiasip is to define a temporary macro called IMPLEMENT: static void session_handler_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcMediaSessionHandlerClass *klass = (TpSvcMediaSessionHandlerClass *)g_iface; #define IMPLEMENT(x) tp_svc_media_session_handler_implement_##x (\ klass, gabble_media_session_##x) IMPLEMENT(error); IMPLEMENT(ready); #undef IMPLEMENT } If you're implementing many interfaces, just write many similar interface init functions. telepathy-glib-0.24.2/docs/reference/version.xml0000644000175000017500000000000714006601556016527 000000000000000.24.2 telepathy-glib-0.24.2/docs/reference/telepathy-glib-overrides.txt0000644000175000017500000000000012652510705021764 00000000000000telepathy-glib-0.24.2/docs/reference/version.xml.in0000644000175000017500000000001212652510705017130 00000000000000@VERSION@ telepathy-glib-0.24.2/docs/reference/Makefile.am0000644000175000017500000001166214004033172016354 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=telepathy-glib # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR=$(abs_top_srcdir)/telepathy-glib $(abs_top_builddir)/telepathy-glib # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=\ --deprecated-guards=TP_DISABLE_DEPRECATED \ --ignore-decorators='_TP_GNUC_DEPRECATED|_TP_GNUC_DEPRECATED_FOR\s*\([^\)]+\)' \ --rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/telepathy-glib/*.h $(top_builddir)/telepathy-glib/_gen/*.h CFILE_GLOB=$(top_srcdir)/telepathy-glib/*.c $(top_builddir)/telepathy-glib/_gen/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES= # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES=\ proxy-introspectable.h \ $(NULL) # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files=tp-svc.xml version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) @DBUS_CFLAGS@ @GLIB_CFLAGS@ GTKDOC_LIBS=$(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ @GLIB_LIBS@ # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += version.xml.in # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += # Work around gtk-doc using an outdated -sections.txt in out-of-tree builds: # redo the copy every time the files in the srcdir change setup-build.stamp: $(srcdir)/$(DOC_MODULE)-overrides.txt setup-build.stamp: $(srcdir)/$(DOC_MODULE)-sections.txt setup-build.stamp: $(srcdir)/$(DOC_MAIN_SGML_FILE) setup-build.stamp: $(srcdir)/tp-svc.xml if ENABLE_GTK_DOC check-local: @err=0; \ if grep '^0 symbols incomplete' \ telepathy-glib-undocumented.txt; then\ :; \ else \ cat telepathy-glib-undocumented.txt; \ err=1; \ fi; \ if grep '^0 not documented' \ telepathy-glib-undocumented.txt; then\ :; \ else \ cat telepathy-glib-undocumented.txt; \ err=1; \ fi; \ if grep . telepathy-glib-unused.txt; then\ echo "^^^ Unused symbols" >&2; \ err=1; \ fi; \ if test -e telepathy-glib-undeclared.txt &&\ grep . telepathy-glib-undeclared.txt; then\ echo "^^^ Undeclared symbols" >&2; \ err=1; \ fi; \ sed -n -e 's,\(.*\),\1,p' telepathy-glib-sections.txt |\ while read file; do \ if grep -F "xml/$$file.xml" telepathy-glib-docs.sgml \ >/dev/null;\ then \ :; \ else \ echo "$$file missing from telepathy-glib-docs.sgml"; \ err=1; \ fi; \ done endif # ... but don't fail on incomplete documentation, this is a stable branch telepathy-glib-0.24.2/docs/reference/Makefile.in0000644000175000017500000007565514006601553016407 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- # # gtk-doc.make - make rules for gtk-doc # Copyright (C) 2003 James Henstridge # 2004-2007 Damon Chaplin # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs/reference ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = version.xml CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.xml.in \ $(top_srcdir)/gtk-doc.make DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = telepathy-glib # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # Directories containing the source code, relative to $(srcdir). # gtk-doc will search all .c and .h files beneath these paths # for inline comments documenting functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk DOC_SOURCE_DIR = $(abs_top_srcdir)/telepathy-glib $(abs_top_builddir)/telepathy-glib # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = \ --deprecated-guards=TP_DISABLE_DEPRECATED \ --ignore-decorators='_TP_GNUC_DEPRECATED|_TP_GNUC_DEPRECATED_FOR\s*\([^\)]+\)' \ --rebuild-types # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--xml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-mkhtml MKHTML_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/telepathy-glib/*.h $(top_builddir)/telepathy-glib/_gen/*.h CFILE_GLOB = $(top_srcdir)/telepathy-glib/*.c $(top_builddir)/telepathy-glib/_gen/*.c # Extra header to include when scanning, which are not under DOC_SOURCE_DIR # e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h EXTRA_HFILES = # Header files or dirs to ignore when scanning. Use base file/dir names # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code IGNORE_HFILES = \ proxy-introspectable.h \ $(NULL) # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = tp-svc.xml version.xml # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) @DBUS_CFLAGS@ @GLIB_CFLAGS@ GTKDOC_LIBS = $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ @GLIB_LIBS@ @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) version.xml.in DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test @GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = @GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp @GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = @GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp #### setup #### GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; #### scan #### GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; #### xml #### GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0 = @echo " DOC Building XML"; #### html #### GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; #### pdf #### GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/reference/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/reference/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/gtk-doc.make $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook @ENABLE_GTK_DOC_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am @ENABLE_GTK_DOC_FALSE@all-local: all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: check-am install-am install-strip .PHONY: all all-am all-local check check-am check-local clean \ clean-generic clean-libtool clean-local cscopelist-am ctags-am \ dist-hook distclean distclean-generic distclean-libtool \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-local .PRECIOUS: Makefile gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc @ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true $(DOC_MAIN_SGML_FILE): sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ test -f $$file && cp $$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # @HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs @HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" @HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" @HAVE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Files not to distribute # for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types # for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt #DISTCLEANFILES += # Work around gtk-doc using an outdated -sections.txt in out-of-tree builds: # redo the copy every time the files in the srcdir change setup-build.stamp: $(srcdir)/$(DOC_MODULE)-overrides.txt setup-build.stamp: $(srcdir)/$(DOC_MODULE)-sections.txt setup-build.stamp: $(srcdir)/$(DOC_MAIN_SGML_FILE) setup-build.stamp: $(srcdir)/tp-svc.xml @ENABLE_GTK_DOC_TRUE@check-local: @ENABLE_GTK_DOC_TRUE@ @err=0; \ @ENABLE_GTK_DOC_TRUE@ if grep '^0 symbols incomplete' \ @ENABLE_GTK_DOC_TRUE@ telepathy-glib-undocumented.txt; then\ @ENABLE_GTK_DOC_TRUE@ :; \ @ENABLE_GTK_DOC_TRUE@ else \ @ENABLE_GTK_DOC_TRUE@ cat telepathy-glib-undocumented.txt; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ if grep '^0 not documented' \ @ENABLE_GTK_DOC_TRUE@ telepathy-glib-undocumented.txt; then\ @ENABLE_GTK_DOC_TRUE@ :; \ @ENABLE_GTK_DOC_TRUE@ else \ @ENABLE_GTK_DOC_TRUE@ cat telepathy-glib-undocumented.txt; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ if grep . telepathy-glib-unused.txt; then\ @ENABLE_GTK_DOC_TRUE@ echo "^^^ Unused symbols" >&2; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ if test -e telepathy-glib-undeclared.txt &&\ @ENABLE_GTK_DOC_TRUE@ grep . telepathy-glib-undeclared.txt; then\ @ENABLE_GTK_DOC_TRUE@ echo "^^^ Undeclared symbols" >&2; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ sed -n -e 's,\(.*\),\1,p' telepathy-glib-sections.txt |\ @ENABLE_GTK_DOC_TRUE@ while read file; do \ @ENABLE_GTK_DOC_TRUE@ if grep -F "xml/$$file.xml" telepathy-glib-docs.sgml \ @ENABLE_GTK_DOC_TRUE@ >/dev/null;\ @ENABLE_GTK_DOC_TRUE@ then \ @ENABLE_GTK_DOC_TRUE@ :; \ @ENABLE_GTK_DOC_TRUE@ else \ @ENABLE_GTK_DOC_TRUE@ echo "$$file missing from telepathy-glib-docs.sgml"; \ @ENABLE_GTK_DOC_TRUE@ err=1; \ @ENABLE_GTK_DOC_TRUE@ fi; \ @ENABLE_GTK_DOC_TRUE@ done # ... but don't fail on incomplete documentation, this is a stable branch # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/docs/reference/telepathy-glib-docs.sgml0000644000175000017500000002332314004033172021041 00000000000000 ]> telepathy-glib API Reference Manual This manual documents telepathy-glib version &tpglibversion;. The latest development version of this documentation can be found here: online copy of the telepathy-glib API Reference Manual. The latest version in this stable branch can be found here: online copy of the telepathy-glib 0.24.x API Reference Manual. General D-Bus support The Telepathy protocol Client-side proxies Service-side D-Bus interfaces Service-side implementation Service-side handle repositories Utilities Obsolete modules telepathy-glib-0.24.2/docs/reference/telepathy-glib.types0000644000175000017500000001577014006623343020333 00000000000000tp_account_channel_request_get_type tp_account_get_type tp_account_manager_get_type tp_account_request_get_type tp_add_dispatch_operation_context_get_type tp_automatic_client_factory_get_type tp_automatic_proxy_factory_get_type tp_avatar_requirements_get_type tp_base_call_channel_get_type tp_base_call_content_get_type tp_base_call_stream_get_type tp_base_channel_get_type tp_base_client_get_type tp_base_connection_get_type tp_base_connection_manager_get_type tp_base_contact_list_get_type tp_base_media_call_channel_get_type tp_base_media_call_content_get_type tp_base_media_call_stream_get_type tp_base_password_channel_get_type tp_base_protocol_get_type tp_base_room_config_get_type tp_base_room_config_property_get_type tp_basic_proxy_factory_get_type tp_blockable_contact_list_get_type tp_call_channel_get_type tp_call_content_get_type tp_call_content_media_description_get_type tp_call_state_reason_get_type tp_call_stream_endpoint_get_type tp_call_stream_get_type tp_capabilities_get_type tp_channel_dispatch_operation_get_type tp_channel_dispatcher_get_type tp_channel_factory_iface_get_type tp_channel_get_type tp_channel_iface_get_type tp_channel_manager_get_type tp_channel_request_get_type tp_client_channel_factory_get_type tp_client_get_type tp_client_message_get_type tp_cm_info_source_get_type tp_cm_message_get_type tp_connection_get_type tp_connection_manager_get_type tp_connection_manager_param_get_type tp_connection_manager_protocol_get_type tp_contact_feature_get_type tp_contact_get_type tp_contact_group_list_get_type tp_contact_info_field_get_type tp_contact_info_field_spec_get_type tp_contact_info_list_get_type tp_contact_info_spec_list_get_type tp_contact_search_get_type tp_contact_search_result_get_type tp_dbus_daemon_get_type tp_dbus_error_get_type tp_dbus_name_type_get_type tp_dbus_properties_mixin_flags_get_type tp_dbus_tube_channel_get_type tp_debug_client_get_type tp_debug_message_get_type tp_debug_sender_get_type tp_dtmf_player_get_type tp_dynamic_handle_repo_get_type tp_error_get_type tp_exportable_channel_get_type tp_file_transfer_channel_get_type tp_handle_channels_context_get_type tp_handle_repo_iface_get_type tp_handle_set_get_type tp_intset_get_type tp_media_session_handler_get_type tp_media_stream_handler_get_type tp_message_get_type tp_mutable_contact_group_list_get_type tp_mutable_contact_list_get_type tp_observe_channels_context_get_type tp_presence_status_spec_get_type tp_protocol_addressing_get_type tp_protocol_get_type tp_proxy_get_type tp_room_info_get_type tp_room_list_get_type tp_signalled_message_get_type tp_simple_approver_get_type tp_simple_client_factory_get_type tp_simple_handler_get_type tp_simple_observer_get_type tp_simple_password_manager_get_type tp_static_handle_repo_get_type tp_stream_tube_channel_get_type tp_stream_tube_connection_get_type tp_svc_account_get_type tp_svc_account_interface_addressing_get_type tp_svc_account_interface_avatar_get_type tp_svc_account_interface_storage_get_type tp_svc_account_manager_get_type tp_svc_authentication_tls_certificate_get_type tp_svc_call_content_get_type tp_svc_call_content_interface_audio_control_get_type tp_svc_call_content_interface_dtmf_get_type tp_svc_call_content_interface_media_get_type tp_svc_call_content_interface_video_control_get_type tp_svc_call_content_media_description_get_type tp_svc_call_content_media_description_interface_rtcp_extended_reports_get_type tp_svc_call_content_media_description_interface_rtcp_feedback_get_type tp_svc_call_content_media_description_interface_rtp_header_extensions_get_type tp_svc_call_stream_endpoint_get_type tp_svc_call_stream_get_type tp_svc_call_stream_interface_media_get_type tp_svc_channel_dispatch_operation_get_type tp_svc_channel_dispatcher_get_type tp_svc_channel_dispatcher_interface_messages1_get_type tp_svc_channel_dispatcher_interface_operation_list_get_type tp_svc_channel_get_type tp_svc_channel_interface_anonymity_get_type tp_svc_channel_interface_call_state_get_type tp_svc_channel_interface_captcha_authentication_get_type tp_svc_channel_interface_chat_state_get_type tp_svc_channel_interface_conference_get_type tp_svc_channel_interface_destroyable_get_type tp_svc_channel_interface_dtmf_get_type tp_svc_channel_interface_file_transfer_metadata_get_type tp_svc_channel_interface_group_get_type tp_svc_channel_interface_hold_get_type tp_svc_channel_interface_media_signalling_get_type tp_svc_channel_interface_messages_get_type tp_svc_channel_interface_password_get_type tp_svc_channel_interface_room_config_get_type tp_svc_channel_interface_room_get_type tp_svc_channel_interface_sasl_authentication_get_type tp_svc_channel_interface_securable_get_type tp_svc_channel_interface_service_point_get_type tp_svc_channel_interface_sms_get_type tp_svc_channel_interface_subject_get_type tp_svc_channel_interface_tube_get_type tp_svc_channel_request_get_type tp_svc_channel_type_call_get_type tp_svc_channel_type_contact_list_get_type tp_svc_channel_type_contact_search_get_type tp_svc_channel_type_dbus_tube_get_type tp_svc_channel_type_file_transfer_get_type tp_svc_channel_type_room_list_get_type tp_svc_channel_type_server_authentication_get_type tp_svc_channel_type_server_tls_connection_get_type tp_svc_channel_type_stream_tube_get_type tp_svc_channel_type_streamed_media_get_type tp_svc_channel_type_text_get_type tp_svc_channel_type_tubes_get_type tp_svc_client_approver_get_type tp_svc_client_get_type tp_svc_client_handler_get_type tp_svc_client_interface_requests_get_type tp_svc_client_observer_get_type tp_svc_connection_get_type tp_svc_connection_interface_addressing_get_type tp_svc_connection_interface_aliasing_get_type tp_svc_connection_interface_anonymity_get_type tp_svc_connection_interface_avatars_get_type tp_svc_connection_interface_balance_get_type tp_svc_connection_interface_capabilities_get_type tp_svc_connection_interface_cellular_get_type tp_svc_connection_interface_client_types_get_type tp_svc_connection_interface_contact_blocking_get_type tp_svc_connection_interface_contact_capabilities_get_type tp_svc_connection_interface_contact_groups_get_type tp_svc_connection_interface_contact_info_get_type tp_svc_connection_interface_contact_list_get_type tp_svc_connection_interface_contacts_get_type tp_svc_connection_interface_location_get_type tp_svc_connection_interface_mail_notification_get_type tp_svc_connection_interface_power_saving_get_type tp_svc_connection_interface_presence_get_type tp_svc_connection_interface_renaming_get_type tp_svc_connection_interface_requests_get_type tp_svc_connection_interface_service_point_get_type tp_svc_connection_interface_sidecars1_get_type tp_svc_connection_interface_simple_presence_get_type tp_svc_connection_manager_get_type tp_svc_dbus_introspectable_get_type tp_svc_dbus_properties_get_type tp_svc_debug_get_type tp_svc_media_session_handler_get_type tp_svc_media_stream_handler_get_type tp_svc_properties_interface_get_type tp_svc_protocol_get_type tp_svc_protocol_interface_addressing_get_type tp_svc_protocol_interface_avatars_get_type tp_svc_protocol_interface_presence_get_type tp_text_channel_get_type tp_tls_certificate_get_type tp_tls_certificate_rejection_get_type telepathy-glib-0.24.2/spec/0000755000175000017500000000000014006623342012444 500000000000000telepathy-glib-0.24.2/spec/Channel_Interface_File_Transfer_Metadata.xml0000644000175000017500000001062112652510705023044 00000000000000 Copyright (C) 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface exists to provide a mechanism to include arbitrary additional information in file transfers. For example, one might want to send a document and include the number of times the character P appeared in the file, so would add NumberOfPs=42 to the Metadata property.

ServiceName living in its own property makes it easier for specific applications to send files to each other, bypassing the standard handler. For example, the Banshee Telepathy plugin handler could match on ServiceName so the Empathy file transfer is not used instead.

A string representing the service name that will be used over the file transfer channel. This property is equivalent to the Channel.Type.DBusTube.ServiceName and Channel.Type.StreamTube.Service properties. If no service name is given then this property will be the empty string.

Additional information about the file transfer set by the channel initiator. If no additional information is given then this property will be empty.

A mapping from string key to a list of strings, used in the Metadata property. To emulate a simple string → string hash table one should have exactly one member in the value string list. This property is an a{sas} primarily because this maps easily to XEP-0004 Data Forms, and allows more structured metadata than a{ss} would. (For instance, a list of RDF triples could be expressed as one long array of strings, or as three-element values for a series of dummy key names, rather than as one big string blob.) While it might be convenient for applications to allow keys of arbitrary types, the added convenience would be outweighed by having to define the XMPP representation
telepathy-glib-0.24.2/spec/Channel_Type_Streamed_Media.xml0000644000175000017500000012014312652510705020406 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

An audio stream A video stream The stream is disconnected. The stream is trying to connect. The stream is connected. Media are not being sent or received Media are being sent, but not received Media are being received, but not sent Media are being sent and received The local user has been asked to send media by the remote user. Call RequestStreamDirection to indicate whether or not this is acceptable. The remote user has been asked to send media by the local user. The StreamDirectionChanged signal will be emitted when the remote user accepts or rejects this change.

An unsigned integer identifying a stream within a channel.

An array of structs containing:
  • the stream identifier
  • the contact handle who the stream is with (or 0 if the stream represents more than a single member)
  • the type of the stream
  • the current stream state
  • the current direction of the stream
  • the current pending send flags
Returns an array of structs representing the streams currently active within this channel. Each stream is identified by an unsigned integer which is unique for each stream within the channel.
An array of stream identifiers (as defined in ListStreams)

Request that the given streams are removed. If all streams are removed, the channel MAY close.

Clients SHOULD NOT attempt to terminate calls by removing all the streams; instead, clients SHOULD terminate calls by removing the Group.SelfHandle from the channel, using either RemoveMembers or RemoveMembersWithReason.

A stream identifier is unknown
The stream identifier (as defined in ListStreams) The desired stream direction (a value of MediaStreamDirection)

Request a change in the direction of an existing stream. In particular, this might be useful to stop sending media of a particular type, or inform the peer that you are no longer using media that is being sent to you.

Depending on the protocol, streams which are no longer sending in either direction should be removed and a StreamRemoved signal emitted. Some direction changes can be enforced locally (for example, BIDIRECTIONAL -> RECEIVE can be achieved by merely stopping sending), others may not be possible on some protocols, and some need agreement from the remote end. In this case, the MEDIA_STREAM_PENDING_REMOTE_SEND flag will be set in the StreamDirectionChanged signal, and the signal emitted again without the flag to indicate the resulting direction when the remote end has accepted or rejected the change.

A stream identifier is unknown The requested direction is not available on this stream
A contact handle with whom to establish the streams An array of stream types (values of MediaStreamType) An array of structs (in the same order as the given stream types) containing:
  • the stream identifier
  • the contact handle who the stream is with (or 0 if the stream represents more than a single member)
  • the type of the stream
  • the current stream state
  • the current direction of the stream
  • the current pending send flags

Request that streams be established to exchange the given types of media with the given member. In general this will try and establish a bidirectional stream, but on some protocols it may not be possible to indicate to the peer that you would like to receive media, so a send-only stream will be created initially. In the cases where the stream requires remote agreement (eg you wish to receive media from them), the StreamDirectionChanged signal will be emitted with the MEDIA_STREAM_PENDING_REMOTE_SEND flag set, and the signal emitted again with the flag cleared when the remote end has replied.

If streams of the requested types already exist, calling this method results in the creation of additional streams. Accordingly, clients wishing to have exactly one audio stream or exactly one video stream SHOULD check for the current streams using ListStreams before calling this method.

It is valid to use a handle which is neither a current nor pending member in this channel's Group interface. If so, that handle will be added to the remote-pending set only when an attempt has actually been made to contact them. For further call-state notification, use the CallState interface, if supported. This usage was not allowed in spec versions below 0.17.2.

A stream type given is invalid. A stream type given is not implemented by the connection manager. Since 0.17.23, connection managers SHOULD raise this error in preference to InvalidArgument. Connection managers can't know whether an unknown number is a valid stream type that was introduced in a later spec version. That contact's client does not implement one of the given stream types. For this method, clients SHOULD consider this error and NotCapable to be equivalent. That contact's client does not implement one of the given stream types. Since 0.17.23, connection managers SHOULD raise this in preference to NotAvailable.
The stream identifier (as defined in ListStreams) The contact handle who the stream is with (or 0 if it represents more than a single member) The stream type (a value from MediaStreamType)

Emitted when a new stream has been added to this channel. Clients SHOULD assume that the stream's Media_Stream_State is initially Disconnected.

If a connection manager needs to represent the addition of a stream whose state is already Connecting or Connected, it MUST do this by emitting StreamAdded, closely followed by StreamStateChanged indicating a change to the appropriate state.

Historically, it was not clear from the StreamAdded signal what the state of the stream was. telepathy-spec 0.17.22 clarified this.

Similarly, clients SHOULD assume that the initial Media_Stream_Direction of a newly added stream is Receive, and that the initial Media_Stream_Pending_Send is Pending_Local_Send.

If a connection manager needs to represent the addition of a stream whose direction or pending-send differs from those initial values, it MUST do so by emitting StreamAdded, closely followed by StreamDirectionChanged indicating a change to the appropriate direction and pending-send state.

StreamAdded doesn't itself indicate the stream's direction; this is unfortunate, but is preserved for compatibility.

This is the appropriate direction for streams added by a remote contact on existing connection managers, and does not violate user privacy by automatically sending audio or video (audio streams start off muted, video streams start off not sending). For streams added by the local user using the client receiving the signal, the true direction can also be determined from the return value of the RequestStreams method.

Existing clients typically operate by maintaining a separate idea of the directions that they would like the streams to have, and enforcing these intended directions by calling RequestStreamDirection whenever needed.

The stream identifier (as defined in ListStreams) The new stream direction (as defined in ListStreams) The new pending send flags (as defined in ListStreams)

Emitted when the direction or pending flags of a stream are changed.

If the MEDIA_STREAM_PENDING_LOCAL_SEND flag is set, the remote user has requested that we begin sending on this stream. RequestStreamDirection should be called to indicate whether or not this change is acceptable.

This allows for a MSN-style user interface, "Fred has asked you to enable your webcam. (Accept | Reject)", if desired.

The stream identifier (as defined in ListStreams) A stream error number, one of the values of MediaStreamError A string describing the error (for debugging purposes only) Emitted when a stream encounters an error. stream_id - the stream identifier (as defined in ListStreams) Emitted when a stream has been removed from this channel. The stream identifier (as defined in ListStreams) The new stream state (as defined in ListStreams) Emitted when a member's stream's state changes.

If set to true in a channel request that will create a new channel, the connection manager should immediately attempt to establish an audio stream to the remote contact, making it unnecessary for the client to call RequestStreams.

If this property, or InitialVideo, is passed to EnsureChannel (as opposed to CreateChannel), the connection manager SHOULD ignore these properties when checking whether it can return an existing channel as suitable; these properties only become significant when the connection manager has decided to create a new channel.

If true on a requested channel, this indicates that the audio stream has already been requested and the client does not need to call RequestStreams, although it MAY still do so.

If true on an unrequested (incoming) channel, this indicates that the remote contact initially requested an audio stream; this does not imply that that audio stream is still active (as indicated by ListStreams).

This property is immutable (cannot change), and therefore SHOULD appear wherever immutable properties are reported, e.g. NewChannels signals.

This reduces D-Bus round trips.

Connection managers capable of signalling audio calls to contacts SHOULD include a channel class in RequestableChannelClasses with ChannelType = StreamedMedia and TargetHandleType = Contact in the fixed properties dictionary, and InitialAudio (and also InitialVideo, if applicable) in the allowed properties list. Clients wishing to discover whether a connection manager can signal audio and/or video calls SHOULD use this information.

Not all protocols support signalling video calls, and it would be possible (although unlikely) to have a protocol where only video, and not audio, could be signalled.

Connection managers that support the ContactCapabilities interface SHOULD represent the capabilities of receiving audio and/or video calls by including a channel class in a contact's capabilities with ChannelType = StreamedMedia in the fixed properties dictionary, and InitialAudio and/or InitialVideo in the allowed properties list. Clients wishing to discover whether a particular contact is likely to be able to receive audio and/or video calls SHOULD use this information.

Not all clients support video calls, and it would also be possible (although unlikely) to have a client which could only stream video, not audio.

Clients that are willing to receive audio and/or video calls SHOULD include the following among their channel classes if calling UpdateCapabilities (clients of a ChannelDispatcher SHOULD instead arrange for the ChannelDispatcher to do this, by including the filters in their HandlerChannelFilter properties):

  • { ChannelType = StreamedMedia }
  • { ChannelType = StreamedMedia, InitialAudio = true } if receiving calls with audio is supported
  • { ChannelType = StreamedMedia, InitialVideo = true } if receiving calls with video is supported

Connection managers for protocols with capability discovery, like XMPP, need this information to advertise the appropriate capabilities for their protocol.

The same as InitialAudio, but for a video stream. This property is immutable (cannot change).

In particular, note that if this property is false, this does not imply that an active video stream has not been added, only that no video stream was active at the time the channel appeared.

This property is the correct way to discover whether connection managers, contacts etc. support video calls; it appears in capabilities structures in the same way as InitialAudio.

If True, once streams have been requested for this channel (either by setting InitialAudio or InitialVideo when the channel is requested, or by calling RequestStreams on a channel with no streams), a stream of a different content type cannot be added; subsequent calls to RequestStreams that attempt to do so will fail.

If this property is missing, clients SHOULD assume that it is false, and thus that the channel's streams can be changed once the call has started.

If this property is present in the "allowed" set in all of the StreamedMedia entries in a contact's capabilities, then user interfaces MAY choose to show a separate "call" option for each class of call.

For example, once an audio-only Google Talk call has started, it is not possible to add a video stream; both audio and video must be requested at the start of the call if video is desired. User interfaces may use this pseudo-capability as a hint to display separate "Audio call" and "Video call" buttons, rather than a single "Call" button with the option to add and remove video once the call has started for contacts without this flag.

This property is immutable, and therefore SHOULD be announced in NewChannels, etc.

A channel that can send and receive streamed media such as audio or video. Provides a number of methods for listing and requesting new streams, and signals to indicate when streams have been added, removed and changed status. The state of the call (ringing remotely, ringing locally, answered, missed, etc.) are represented using the properties and signals of the Group interface.

In general this should be used in conjunction with the MediaSignalling interface to exchange connection candidates and codec choices with whichever component is responsible for the streams. However, in certain applications where no candidate exchange is necessary (eg the streams are handled by specialised hardware which is controlled directly by the connection manager), the signalling interface can be omitted and this channel type used simply to control the streams.

Outgoing calls

To make an audio-only call to a contact foo@example.com, clients should call:

CreateChannel({
  ChannelType: StreamedMedia,
  TargetHandleType: Contact,
  TargetID: 'foo@example.com',
  InitialAudio: True,
)

As always, TargetHandle may be used in place of TargetID if the contact's handle is already known. To make an audio-and-video call, the client should also specify InitialVideo. The connection manager SHOULD return a channel whose immutable properties contain the local user as the InitiatorHandle, the remote contact as the TargetHandle, Requested = True (indicating that the call is outgoing); the Group interface should initially have the local user in Members and the remote contact in RemotePendingMembers, to indicate that we are awaiting their response.

The contact answering the call is represented by the CM signalling MembersChanged, moving the remote contact to Members, with the remote contact as the Actor and Reason None. The contact rejecting the call is represented by both contacts being removed from the group, with the remote contact as the Actor and Reason set appropriately. The local user may hang up at any time by calling RemoveMembersWithReason to remove themself, with an appropriate reason; the CM SHOULD relay the reason to the remote contact, and emit MembersChanged removing both contacts from the group with the self handle as the Actor.

(In the past, several other patterns have been used to place outgoing calls; see 'Requesting StreamedMedia Channels' on the Telepathy wiki for the details.)

Incoming calls

Incoming calls' immutable properties should contain TargetHandleType = Contact, both TargetHandle and InitiatorHandle set to the remote contact, Requested = False (indicating that this is an incoming call), and appropriate values of InitialAudio and InitialVideo; the Group interface should initially have the local user in LocalPendingMembers and the remote contact in Members, indicating that the contact is awaiting our response.

To accept the call, use AddMembers to move the local user to the group's members. To reject the call, use RemoveMembersWithReason to remove the local member from the group, with an appropriate reason. If the remote user ends the call before it is answered, this is represented by MembersChanged removing both parties from the group with the remote contact as the Actor, and Reason set appropriately.

Note that the call may end with the self handle as the Actor without the user having chosen to reject the call, as indicated by the nature of the Reason. Specifically, some local component may time out the call (indicating this with reason No_Answer; for example, the CM may have forwarded the call to another number, as configured using Forwarding.DRAFT), or something may have gone wrong with the call (indicated by reason Error). Such calls SHOULD be considered missed, just as if the remote contact had hung up before the local user answered the call.

This is a bit awkward, but these are the best ways we can represent these situations. It's important to document which calls should be considered missed, to ensure that the user can be notified.

When the local user accepts an incoming call, the connection manager SHOULD change the direction of any streams with pending local send to be sending, without altering whether those streams are receiving.

This matches existing practice, and means that a client can answer incoming calls and get an unmuted microphone/activated webcam without having to take additional action to accept the stream directions.

It does, however, introduce a race condition: a client believing that it is accepting an audio-only call by calling AddMembers can inadvertantly accept an audio + video call (and hence activate sending from a webcam without the user's permission) if a video stream is added just before AddMembers is processed. This race should be removed when this specification is revised.

During a call

If ImmutableStreams is False, new streams may be requested using RequestStreams (to add video to an audio-only call, for instance), and existing streams may be removed using RemoveStreams (for example, to downgrade an audio-video call to audio-only). The call may be ended by calling RemoveMembers or RemoveMembersWithReason; the call ending is signalled by the CM emitting MembersChanged, removing both parties from the group.

Handler filters

For historical reasons, handlers must specify more than one filter if they want to correctly advertise support for audio and/or video calls. If they can handle channels using the MediaSignalling interface, they should also advertise various Handler_Capability_Tokens to indicate which codecs and transports they support. See InitialAudio and MediaSignalling/video/h264 for the gory details. In summary:

To advertise support for streamed media in general, include the following filter in HandlerChannelFilter:
{ '...Channel.ChannelType': '...Channel.Type.StreamedMedia' ,
  '...Channel.TargetHandleType': Contact,
}
To advertise support for audio calls, also include the following filter:
{ '...Channel.ChannelType': '...Channel.Type.StreamedMedia' ,
  '...Channel.TargetHandleType': Contact,
  '...Channel.Type.StreamedMedia.InitialAudio': True,
}
To advertise support for video calls, also include the following filter:
{ '...Channel.ChannelType': '...Channel.Type.StreamedMedia' ,
  '...Channel.TargetHandleType': Contact,
  '...Channel.Type.StreamedMedia.InitialVideo': True,
}
If you use telepathy-farsight, and have H.264 support, you probably want these Capabilities:
[ "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp",
  "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p",
  "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264",
]
The channel-type-specific capability flags used for Channel.Type.StreamedMedia in the Connection.Interface.Capabilities interface. See the InitialAudio property for details of the mechanisms that will replace this. The handle is capable of using audio streams within a media channel. The handle is capable of using video streams within a media channel. The handle is capable of performing STUN to traverse NATs. The handle is capable of establishing Google Talk peer-to-peer connections (as implemented in libjingle 0.3) to traverse NATs. The handle is capable of establishing ICE UDP peer-to-peer connections (as defined by the IETF MMUSIC working group) to traverse NATs. Channels whose target handle is this contact will have ImmutableStreams = True.
telepathy-glib-0.24.2/spec/generic-types.xml0000644000175000017500000002155212652510705015674 00000000000000 An unsigned 32-bit integer representing time as the number of seconds elapsed since the Unix epoch (1970-01-01T00:00:00Z) An signed 64-bit integer representing time as the number of seconds elapsed since the Unix epoch (1970-01-01T00:00:00Z); negative for times before the epoch The Text interface is the only user of Unix_Timestamp so far, and we'd like to be Y2038 compatible in future interfaces. A string representing a D-Bus bus name - either a well-known name like "org.freedesktop.Telepathy.MissionControl" or a unique name like ":1.123" A string representing a D-Bus well-known name like "org.freedesktop.Telepathy.MissionControl". A string representing a D-Bus unique name, such as ":1.123" An ASCII string representing a D-Bus interface - two or more elements separated by dots, where each element is a non-empty string of ASCII letters, digits and underscores, not starting with a digit. The maximum total length is 255 characters. For example, "org.freedesktop.DBus.Peer". An ASCII string representing a D-Bus error. This is syntactically the same as a DBus_Interface, but the meaning is different. A string representing a D-Bus signature (the 'g' type isn't used because of poor interoperability, particularly with dbus-glib) An ASCII string representing a D-Bus method, signal or property name - a non-empty string of ASCII letters, digits and underscores, not starting with a digit, with a maximum length of 255 characters. For example, "Ping". A string representing the full name of a D-Bus method, signal or property, consisting of a DBus_Interface, followed by a dot, followed by a DBus_Member. For example, "org.freedesktop.DBus.Peer.Ping". A mapping from strings representing D-Bus properties (by their namespaced names) to their values. A D-Bus interface name, followed by a dot and a D-Bus property name. The value of the property. A mapping from strings to variants representing extra key-value pairs. A mapping from strings to strings representing extra key-value pairs. An IP address and port. Either a dotted-quad IPv4 address literal as for Socket_Address_IPv4, or an RFC2373 IPv6 address as for Socket_Address_IPv6. The TCP or UDP port number. An IPv4 address and port. A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. "192.168.0.1". The TCP or UDP port number. An IPv6 address and port. An IPv6 address literal as specified by RFC2373 section 2.2, e.g. "2001:DB8::8:800:200C:4171". The TCP or UDP port number. An IPv4 network or subnet. A dotted-quad IPv4 address literal: four ASCII decimal numbers, each between 0 and 255 inclusive, e.g. "192.168.0.1". The number of leading bits of the address that must match, for this netmask to be considered to match an address. An IPv6 network or subnet. An IPv6 address literal as specified by RFC2373 section 2.2, e.g. "2001:DB8::8:800:200C:4171". The number of leading bits of the address that must match, for this netmask to be considered to match an address.

The time at which an user action occurred. This type has the 2 following special values:

0: the action doesn't involve any user action. Clients SHOULD avoid stealing focus when presenting the channel.

MAX_INT64: clients SHOULD behave as though the user action happened at the current time, e.g. a client MAY request that its window gains focus.

This can be used by clients that can't know the X server time like command line applications for example.

For all the other values it corresponds to the time of the user action. Clients SHOULD use this for focus-stealing prevention, if applicable. Note that the time is dependant on the local environment and so is not necessarily a wall-clock time. For example in an X environment it's expected to be the X timestamp of events. This corresponds to the _NET_WM_USER_TIME property in EWMH.

A mapping from object path to the immutable properties of the object. The object path of an object The immutable properties of the object A language tag as defined in IETF BCP 47, such as "en_US".
telepathy-glib-0.24.2/spec/Channel_Type_Server_Authentication.xml0000644000175000017500000001372012652510705022052 00000000000000 Copyright © 2010 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

The type for a channel representing an authentication step with the server. The actual authentication functionality is implemented by the additional interface named in AuthenticationMethod, such as Channel.Interface.SASLAuthentication.

Future authentication steps also supported by this channel type might include solving a captcha and/or agreeing to an EULA or terms-of-use document; each of these would be represented by a channel with this type, but a different AuthenticationMethod.

Channels of this type will normally be be signalled and dispatched while the Connection owning them is in the CONNECTING state. They MAY also appear on a Connection in the CONNECTED state, for instance if periodic re-authentication is required.

Normally, only one channel of this type will exist on a given Connection; if there is more than one, the handler must complete authentication with each of them in turn.

Channels of this type cannot be requested with methods such as CreateChannel. They always have Requested = False, TargetHandleType = None and TargetHandle = 0.

While it is CONNECTING, the Connection MUST NOT proceed with connection, or signal StatusChanged to the CONNECTED state, until each channel of this type has either been accepted as having a positive result (for instance, on SASL channels this is done with the AcceptSASL method), or closed with the Close method.

ServerAuthentication channels normally represent the client authenticating itself to the server, but can also be used for the server to authenticate itself to the client (i.e. prove that it is in fact the desired server and not an imposter). Until the authentication handler has confirmed this, connection should not continue.

If a channel of this type is closed with the Close method before authentication has succeeded, this indicates that the Handler has given up its attempts to authenticate or that no Handler is available.

If this occurs, the connection manager MAY attempt to continue connection (for instance, performing SASL authentication by using any credentials passed to RequestConnection, for instance from the Account.Parameters). If this fails or has already been tried, the Connection will disconnect.

In particular, the ChannelDispatcher will close the channel if it cannot find a handler.

When the connection is done with the channel and it is no longer needed, it is left open until either the connection state turns to DISCONNECTED or the handler closes the channel. The channel SHOULD NOT close itself once finished with.

This property defines the method used for the authentication step represented by this channel, which MUST be one of this channel's Interfaces.

The initially-defined interface that can be used here is Channel.Interface.SASLAuthentication.

telepathy-glib-0.24.2/spec/Properties_Interface.xml0000644000175000017500000002164512652510705017235 00000000000000 Copyright (C) 2005-2007 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

All uses of this interface have been expunged, and it may now be laid to rest. A struct (property ID, property name, D-Bus signature, flags) representing a property, as returned by ListProperties on the Properties interface. A struct (property ID, flags) representing a change to a property's flags, as seen in the PropertyFlagsChanged signal on the Properties interface. An unsigned integer used to represent a Telepathy property. A struct (property ID, value) representing a property's value, as seen in the PropertiesChanged signal on the Properties interface, returned by the GetProperties method and passed to the SetProperties method. Returns an array of (identifier, value) pairs containing the current values of the given properties. An array of property identifiers

An array of structs containing:

  • integer identifiers
  • variant boxed values
Some property identifier requested is invalid Some property requested does not have the PROPERTY_FLAG_READ flag
Returns a dictionary of the properties available on this channel. An array of structs containing:
  • an integer identifier
  • a string property name
  • a string representing the D-Bus signature of this property
  • a bitwise OR of the flags applicable to this property
Emitted when the value of readable properties has changed.

An array of structs containing:

  • integer identifiers
  • variant boxed values

The array should contain only properties whose values have actually changed.

Emitted when the flags of some room properties have changed.

An array of structs containing:

  • integer identifiers
  • a bitwise OR of the current flags

The array should contain only properties whose flags have actually changed.

Takes an array of (identifier, value) pairs containing desired values to set the given properties. In the case of any errors, no properties will be changed. When the changes have been acknowledged by the server, the PropertiesChanged signal will be emitted.

All properties given must have the PROPERTY_FLAG_WRITE flag, or PermissionDenied will be returned. If any variants are of the wrong type, NotAvailable will be returned. If any given property identifiers are invalid, InvalidArgument will be returned.

An array mapping integer property identifiers to boxed values

Interface for channels and other objects, to allow querying and setting properties. ListProperties returns which properties are valid for the given channel, including their type, and an integer handle used to refer to them in GetProperties, SetProperties, and the PropertiesChanged signal. The values are represented by D-Bus variant types, and are accompanied by flags indicating whether or not the property is readable or writable.

Each property also has a flags value to indicate what methods are available. This is a bitwise OR of PropertyFlags values.

The property can be read The property can be written
telepathy-glib-0.24.2/spec/Connection_Interface_Contacts.xml0000644000175000017500000002522312652510705021032 00000000000000 Copyright (C) 2005-2008 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface allows many attributes of many contacts to be obtained in a single D-Bus round trip.

Each contact attribute has an string identifier (Contact_Attribute), which is namespaced by the D-Bus interface which defines it.

A DBus_Interface, followed by a slash '/' character and an identifier for an attribute defined by that interface. The attribute identifier SHOULD be in lower case. These aren't D-Bus core Properties, and we want them to look visibly different. Some of the attributes of a single contact. The name of the attribute The value of the attribute Mapping returned by GetContactAttributes, representing a collection of Contacts and their requested attributes. A contact Attributes of that contact A list of D-Bus interfaces for which GetContactAttributes is expected to work. This cannot change during the lifetime of the Connection. Return any number of contact attributes for the given handles. An array of handles representing contacts.

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

Connection managers SHOULD ignore interfaces requested which they do not support (i.e. those not mentioned in the ContactAttributeInterfaces property.)

This simplifies client-side code. Clients which care may distinguish between unsupported interfaces (e.g. this Connection does not support Avatars), and interfaces on which no information is known for these contacts (e.g. we don't know the avatar tokens of any of the contacts, so we omitted them all) by inspecting ContactAttributeInterfaces.

Attributes from the interface org.freedesktop.Telepathy.Connection are always returned, and need not be requested explicitly.

As well as returning cached information immediately, the connection MAY start asynchronous requests to obtain better values for the contact attributes. If better values are later obtained by this process, they will be indicated with the usual signals (such as AliasesChanged).

For instance, an XMPP connection manager could download vCards in response to a request for Aliasing attributes.
requesting information for interfaces not mentioned in ContactAttributeInterfaces is no longer an error. Be aware that older connection managers may still consider this an error.

If true, all handles that appear as keys in the result have been held on behalf of the calling process, as if by a call to Connection.HoldHandles. (If HasImmortalHandles is true, which SHOULD be the case in all new connection managers, this has no effect.)

For further round-trip avoidance.

A dictionary mapping the contact handles to contact attributes. If any of the requested handles are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

Return any number of contact attributes for the given identifier. This is for a single identifier to make it simpler to use for the most common use case. For multiple contacts case, GetContactAttributes should be used. An identifier representing a contact.

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

See GetContactAttributes for details.

The contact's handle, as returned by RequestHandles

All supported attributes of the contact on the given interfaces that can be returned without network round-trips. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

The contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

telepathy-glib-0.24.2/spec/Channel_Type_Room_List.xml0000644000175000017500000001717712652510705017466 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

For protocols with a concept of chatrooms on multiple servers with different DNS names (like XMPP), the DNS name of the server whose rooms are listed by this channel, e.g. "conference.jabber.org". Otherwise, the empty string.

This property cannot change during the lifetime of the channel.

A boolean indicating if room listing is in progress Check to see if there is already a room list request in progress on this channel. An array of structs containing:
  • an integer room handle
  • a string representing the D-Bus interface name of the channel type
  • a dictionary mapping string keys to variant boxed information

Emitted when information about rooms on the server becomes available. The array contains the room handle (as can be passed to the RequestChannel method with HANDLE_TYPE_ROOM), the channel type, and a dictionary containing further information about the room as available. The following well-known keys and types are recommended for use where appropriate:

handle-name (s)
The identifier of the room (as would be returned by InspectHandles). This property is mandatory.
name (s)
The human-readable name of the room if different from the handle
description (s)
A description of the room's overall purpose
subject (s)
The current subject of conversation in the room (as would be returned by getting the string part of the Subject property)
members (u)
The number of members in the room
password (b)
True if the room requires a password to enter
invite-only (b)
True if you cannot join the room, but must be invited
room-id (s)
The human-readable identifier of a chat room (as would be returned by getting the RoomName property)
server (s)
The DNS name of the server hosting these channels (as would be returned by getting the Server property)
Request the list of rooms from the server. The ListingRooms (True) signal should be emitted when this request is being processed, GotRooms when any room information is received, and ListingRooms (False) when the request is complete. Stop the room listing if it's in progress, but don't close the channel. The ListingRooms (False) signal should be emitted when the listing stops. A boolean indicating if room listing is in progress Emitted to indicate whether or not room listing request is currently in progress.

A channel type for listing named channels available on the server. Once the ListRooms method is called, it emits signals for rooms present on the server, until you Close this channel. In some cases, it may not be possible to stop the deluge of information from the server. This channel should be closed when the room information is no longer being displayed, so that the room handles can be freed.

This channel type may be implemented as a singleton on some protocols, so clients should be prepared for the eventuality that they are given a channel that is already in the middle of listing channels. The ListingRooms signal, or GetListingRooms method, can be used to check this.

telepathy-glib-0.24.2/spec/Connection_Interface_Contact_List.xml0000644000175000017500000014600312652510705021642 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for connections that have any concept of a list of known contacts (roster, buddy list, friends list etc.)

On many protocols, there's a server-side roster (as in XMPP), or a set of server-side lists that can be combined to form a roster (as in MSN).

In some protocols (like link-local XMPP), while there might not be any server or roster, it's possible to list "nearby" contacts.

In Telepathy 0.20 and older, we represented contact lists as a collection of ContactList channels. This is remarkably difficult to work with in practice - every client that cares about contact lists has to take the union of some hard-to-define set of these channels - and conflicts with the idea that channels that cannot be dispatched to a handler should be closed.

The list of contacts is not exposed as a D-Bus property; it can be fetched using GetContactListAttributes.

In some protocols, such as XMPP, the contact list may not be available immediately. The GetContactListAttributes method will fail until the contact list is available. Using a method also allows extra attributes to be retrieved at the same time.

The progress made in retrieving the contact list. The connection has not started to retrieve the contact list. If GetContactListAttributes is called in this state, it will raise NotYet. The connection has started to retrieve the contact list, but has not yet succeeded or failed. If GetContactListAttributes is called in this state, it will raise NotYet.

The connection has tried and failed to retrieve the contact list. If GetContactListAttributes is called in this state, it will immediately raise an error indicating the reason for failure.

The connection manager SHOULD try again to obtain the contact list, if appropriate for the protocol. If it succeeds later, the ContactListState MUST advance to Success.

The connection has successfully retrieved the contact list. If GetContactListAttributes is called in this state, it will return successfully.
The progress made in retrieving the contact list. Change notification is via ContactListStateChanged. Emitted when ContactListState changes. The new value of ContactListState.

Return some contact attributes for a list of contacts associated with the user. This list MUST include at least:

  • all contacts whose subscribe attribute is not No
  • all contacts whose publish attribute is not No

but MAY contain other contacts.

For instance, on XMPP, all contacts on the roster would appear here even if they have subscription="none", unless there's reason to believe the user does not want to see them (such as having been blocked).

This list does not need to contain every visible contact: for instance, contacts seen in XMPP or IRC chatrooms SHOULD NOT appear here. Blocked contacts SHOULD NOT appear here, unless they still have a non-No subscribe or publish attribute for some reason.

It's reasonable to assume that blocked contacts should not be visible to the user unless they specifically go looking for them, at least in protocols like XMPP where blocking a contact suppresses presence.

A list of strings indicating which D-Bus interfaces the calling process is interested in. Equivalent to the corresponding argument to GetContactAttributes, except that if this list does not contain the ContactList interface itself, it is treated as though that interface was also requested.

If true, all handles that appear as keys in the result have been held on behalf of the calling process, as if by a call to Connection.HoldHandles. (If HasImmortalHandles is true, which SHOULD be the case in all new connection managers, this has no effect.)

A dictionary mapping the contact handles to contact attributes, equivalent to the result of GetContactAttributes.

The ContactListState is None or Waiting. In particular, this error is raised if the Status is not yet Connection_Status_Connected.

An enumeration indicating whether presence subscription is denied, denied but pending permission, or allowed. The exact semantics vary according to where this type is used: see the subscribe and publish contact attributes for details.

The presence subscription state is unknown. Presence information cannot be seen, and either the subscription state Removed_Remotely does not apply, or it is not known whether that state applies. Presence information cannot be seen because the remote contact took action: either the local user's request to see the remote contact's presence was denied, or the remote contact requested to see the local user's presence but then cancelled their request. Presence information cannot be seen. Permission to see presence information has been requested, and the request has not yet been declined or accepted. Presence information can be seen.

If this attribute on a contact is Yes, this connection can expect to receive their presence, along with any other information that has the same access control.

This is subscription="from" or subscription="both" in XMPP, the "forward list" on MSN, or the contact being "added to the local user's buddy list" in ICQ, for example.

If this attribute is not Yes, the local user cannot generally expect to receive presence from this contact. Their presence status as returned by GetPresences is likely to be (Unknown, "unknown", ""), unless the local user can temporarily see their presence for some other reason (for instance, on XMPP, contacts seen in chatrooms will temporarily have available presence).

If this attribute is Ask, this indicates that the local user has asked to receive the contact's presence at some time. It is implementation-dependent whether contacts' subscribe attributes can remain set to Ask, or are reset to No, when the connection disconnects.

Some protocols store the fact that we wishes to see a contact's presence; on these protocols, this attribute can remain Ask indefinitely. On other protocols, only contacts who have been asked during the current session will ever have Ask status.

If this attribute is Removed_Remotely, this indicates that the local user has asked to receive the contact's presence at some time, but the remote contact has rejected that request, and a local user interface has not yet acknowledged this. It is implementation-dependent whether contacts' subscribe attributes can remain set to Removed_Remotely, or are reset to No, when the connection disconnects.

After notifying the user, user interfaces MAY acknowledge a change to subscribe=Removed_Remotely by calling either Unsubscribe or RemoveContacts, which will set subscribe to No (and perhaps remove the contact). This allows user interfaces to detect that the user has been notified about the rejected request.

This attribute's value will be Unknown or omitted until the ContactListState has changed to Success.

If this attribute on a contact is Yes, the local user's presence is published to that contact, along with any other information that shares an access-control mechanism with presence (depending on protocol, server configuration and/or user configuration, this may include avatars, "rich presence" such as location, etc.).

This is subscription="to" or subscription="both" in XMPP, the "reverse list" on MSN, or the state of "being added to the contact's buddy list" in ICQ, for example.

If this attribute is not Yes, the local user's presence is not published to that contact; however, if it is Ask, the contact has requested that the local user's presence is made available to them.

It is implementation-dependent whether contacts' publish attributes can remain set to Ask, or are reset to No, when the connection disconnects.

Some protocols store the fact that a contact wishes to see our presence; on these protocols, this attribute can remain Ask indefinitely. On other protocols, only contacts who have asked during the current session will ever have Ask status.

If this attribute is Removed_Remotely, this indicates that the remote contact has asked to receive the user's presence at some time, but has then cancelled that request before a response was given by the local user. User interfaces MAY reset publish from Removed_Remotely to No, by calling either Unpublish or RemoveContacts.

If multiple factors affect whether a contact can receive the local user's presence, this attribute SHOULD reflect the overall result. For instance, an XMPP contact with subscription="to" or subscription="both", but who has been blocked via XEP-0016 Privacy Lists, SHOULD have publish=No.

This attribute's value will be Unknown or omitted until the ContactListState has changed to Success.

If the publish attribute is Ask, an optional message that was sent by the contact asking to receive the local user's presence; omitted if none was given.

If the contact asking to receive our presence is also using Telepathy, this is the message they supplied as the Message argument to RequestSubscription.

Otherwise, this SHOULD be omitted.

This attribute will also be omitted until the ContactListState has changed to Success.

If true, presence subscriptions (in both directions) on this connection are stored by the server or other infrastructure.

XMPP, MSN, ICQ, etc. all behave like this.

If false, presence subscriptions on this connection are not stored.

In SIMPLE (SIP), clients are expected to keep a record of subscriptions, as described below. In link-local XMPP, subscriptions are implicit (everyone on the local network receives presence from everyone else) so nothing is ever stored.

If CanChangeContactList is true, Telepathy clients (e.g. user interfaces or address books) MAY keep a record of permission to publish and requests to subscribe locally, and attempt to restore it for each Connection. If ContactListPersists is false, clients MAY do this for all contacts; if ContactListPersists is true, clients SHOULD NOT change the state of contacts that were not changed locally.

In SIMPLE (SIP), ContactListPersists is false, but CanChangeContactList is true. Presence will not be received unless clients renew any subscriptions they have for each connection, in the way described. There is no server-side storage, so clients have no alternative but to maintain independent contact lists.

In protocols like XMPP and MSN, it may be useful for clients to queue up subscription requests or removals made while offline and process them next time the connection is online. However, clients should only replay the changes, rather than resetting the contact list to match a stored copy, to avoid overwriting changes that were made on the server.

Clients that replay requests like this SHOULD do so by calling AuthorizePublication to pre-approve publication of presence to the appropriate contacts, followed by RequestSubscription to request the appropriate contacts' presences.

This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.

Values of this enumeration indicate the extent to which metadata such as aliases and group memberships can be stored for the contacts on a particular connection.

On some protocols, certain metadata (for instance, contact aliases) can only be stored for contacts on the contact list, or contacts with a particular contact list state.

To make it easier to deal with such protocols, if clients set metadata on a contact who is not in the required state, the Connection MUST cache the metadata for the duration of the session. If clients request the attributes of that contact after the appropriate "set" method has returned successfully, the Connection MUST return the new (cached) value.

If the contact is later placed in the required state to store metadata (for instance, if subscription to the contact's presence is requested, on a protocol like MSN where the alias has storage type Subscribed_Or_Pending), the connection MUST store the cached metadata at that time.

If the Connection didn't cache changes in this way, a client intending to change the alias on MSN would have to wait until the server acknowledged the subscription request; in the meantime, other clients would still display the old alias.

The only exception to that general rule is that if the Connection cannot store particular metadata at all (i.e. the storage type is None), it MUST reject attempts to set it.

If the implementation knows that metadata can't be stored at all, it's useful to report that, which can be done synchronously. In general, user interfaces should detect storage type None and not display editing controls at all.

This connection cannot store this type of metadata at all, and attempting to do so will fail with NotImplemented.

Link-local XMPP can't store aliases or group memberships at all, and subscription and presence states are implicit (all contacts on the local network have subscribe = publish = Yes and no other contacts exist).

As of April 2010, the XMPP server for Facebook Chat provides a read-only view of the user's Facebook contacts, so it could also usefully have this storage type.

This type of metadata can only be stored permanently for contacts whose subscribe attribute is Ask or Yes.

Contact aliases and groups on MSN have this behaviour.

This type of metadata can only be stored permanently for contacts whose subscribe attribute is Yes.

No service with this behaviour is currently known, but it's a stricter form of Subscribed_Or_Pending.

The user can set this metadata for any valid contact identifier, whether or not they have any presence subscription relationship to it, and it will be stored on their contact list.

Contact aliases and groups on XMPP have this behaviour; it is possible to put a contact in a group, or assign an alias to them, without requesting that presence be shared.

A single contact's subscribe, publish and publish-request attributes. The new value of the contact's "subscribe" attribute. The new value of the contact's "publish" attribute. The new value of the contact's "publish-request" attribute, or the empty string if that attribute would be omitted. A map from contacts to their subscribe, publish and publish-request attributes. The contact's handle. The contact's subscribe, publish and publish-request attributes.

Emitted when the contact list becomes available, when contacts' basic stored properties change, when new contacts are added to the list that would be returned by GetContactListAttributes, or when contacts are removed from that list.

This provides change notification for that list, and for contacts' subscribe, publish and publish-request attributes.

Connection managers SHOULD also emit this signal when a contact requests that the user's presence is published to them, even if that contact's publish attribute is already Ask and the publish-request has not changed.

If the same contact sends 10 identical requests, 10 identical signals should be emitted.

The new subscribe, publish and publish-request attributes of all the contacts that have been added, and all the contacts for which those attributes have changed. The identifiers of the contacts in the Changes map. The contacts that have been removed from the list that would be returned by GetContactListAttributes. This also implies that they have subscribe = No and publish = No; contacts MUST NOT be listed both here and in Changes.
Connection managers MUST still emit this signal, but clients SHOULD listen for the ContactsChangedWithID signal in addition, and ignore this signal after ContactsChangedWithID has been emitted at least once.

Emitted immediately after ContactsChangedWithID, under the same circumstances.

If clients receive this signal without first receiving a corresponding ContactsChangedWithID, they MUST assume that only this signal will be emitted.

The same as the corresponding argument to ContactsChangedWithID. The same as the corresponding argument to ContactsChangedWithID, except that it only includes handles and not identifiers.

If true, presence subscription and publication can be changed using the RequestSubscription, AuthorizePublication and RemoveContacts methods.

If false, all of those methods will always fail; they SHOULD raise the error org.freedesktop.Telepathy.Error.NotImplemented.

In XEP-0174 "Serverless Messaging" (link-local XMPP), presence is implicitly published to everyone in the local subnet, so the user cannot control their presence publication.

This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.

Request that the given contacts allow the local user to subscribe to their presence, i.e. that their subscribe attribute becomes Yes.

Connection managers SHOULD NOT attempt to enforce a mutual-subscription policy (i.e. when this method is called, they should not automatically allow the contacts to see the local user's presence). User interfaces that require mutual subscription MAY call AuthorizePublication at the same time as this method.

Whether to enforce mutual subscription is a matter of policy, so it is left to the user interface and/or the server.

Before calling this method on a connection where GetAliasFlags returns the User_Set flag, user interfaces SHOULD obtain, from the user, an alias to identify the contact in future, and store it using SetAliases.

The user MAY be prompted using the contact's current self-assigned nickname, or something derived from the contact's (presumably self-assigned) identifier, as a default, but these names chosen by the contact SHOULD NOT be used without user approval.

This is a generalization of XEP-0165 "Best Practices to Discourage JID Mimicking") to protocols other than XMPP. A reasonable user interface for this, as used in many XMPP clients, is to have a text entry for the alias adjacent to the text entry for the identifier to add.

For contacts with subscribe=Yes, this method has no effect. It MUST return successfully if all contacts are in this state.

For contacts with subscribe=Ask, this method SHOULD send a new request, with the given message, if allowed by the underlying protocol.

For contacts with subscribe=No or subscribe=Rejected, this method SHOULD request that the contact allows the local user to subscribe to their presence; in general, this will change their publish attribute to Ask (although it could change directly to Yes in some situations).

Any state changes that immediately result from this request MUST be signalled via ContactsChanged before this method returns.

This makes it easy for user interfaces to see what practical effect this method had.

If the remote contact accepts the request, their subscribe attribute will later change from Ask to Yes.

If the remote contact explicitly rejects the request (in protocols that allow this), their subscribe attribute will later change from Ask to Rejected.

If the subscription request is cancelled by the local user, the contact's subscribe attribute will change from Ask to No.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState changes to Failure, this method SHOULD raise the same error as GetContactListAttributes.

One or more contacts to whom requests are to be sent.

An optional plain-text message from the user, to send to those contacts with the subscription request. The RequestUsesMessage property indicates whether this message will be used or ignored.

Clients SHOULD NOT send a non-empty message without first giving the user an opportunity to edit it.

These messages are typically presented to the remote contact as if the user had typed them, so as a minimum, the user should be allowed to see what the UI will be saying on their behalf.

Connections where this message is not useful MUST still allow it to be non-empty.

The ContactListState is None or Waiting. It was not possible to perform the requested action, because CanChangeContactList is false.

If true, the Message parameter to RequestSubscription is likely to be significant, and user interfaces SHOULD prompt the user for a message to send with the request; a message such as "I would like to add you to my contact list", translated into the local user's language, might make a suitable default.

This matches user expectations in XMPP and ICQ, for instance.

If false, the parameter is ignored; user interfaces SHOULD avoid prompting the user, and SHOULD pass an empty string to RequestSubscription.

FIXME: is there any such protocol?

If true, the contact list is automatically downloaded at connection. If false, the contact list is only downloaded when requested explicitely with Download.

Downloading the contact list uses bandwidth and is not always necessary or desired. For example, a client could cache the contact list from previous connections and accept less regular updates, it could get the contact list from an out-of-band protocol-specific way, or it could not need the contact list at all.

Connection managers MUST default to true.

If a connection manager starts supporting this property but defaults to false, it would break all existing clients that don't call Download.

For each of the given contacts, request that the local user's presence is sent to that contact, i.e. that their publish attribute becomes Yes.

Connection managers SHOULD NOT attempt to enforce a mutual-subscription policy (i.e. when this method is called, they should not automatically request that the contacts allow the user to subscribe to their presence). User interfaces that require mutual subscription MAY call RequestSubscription at the same time as this method.

Whether to enforce mutual subscription is a matter of policy, so it is left to the user interface and/or the server.

For contacts with publish=Yes, this method has no effect; it MUST return successfully if all contacts given have this state.

For contacts with publish=Ask, this method accepts the contact's request to see the local user's presence, changing their publish attribute from Ask to Yes.

For contacts with publish=No, if the protocol allows it, this method allows the contacts to see the local user's presence even though they have not requested it, changing their publish attribute from No to Yes. Otherwise, it merely records the fact that presence publication to those contacts is allowed; if any of those contacts ask to receive the local user's presence later in the lifetime of the connection, the connection SHOULD immediately allow them to do so, changing their publish attribute directly from No to Yes.

This makes it easy to implement the common UI policy that if the user attempts to subscribe to a contact's presence, requests for reciprocal subscription are automatically approved.

Any state changes that immediately result from this request MUST be signalled via ContactsChanged before this method returns.

This makes it easy for user interfaces to see what practical effect this method had.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState changes to Failure, this method SHOULD raise the same error as GetContactListAttributes.

One or more contacts to authorize.

It was not possible to perform the requested action, because CanChangeContactList is false. The ContactListState is None or Waiting.

Remove the given contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances.

If possible, this method SHOULD set the contacts' subscribe and publish attributes to No, remove any stored aliases for those contacts, and remove the contacts from the result of GetContactListAttributes.

This method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts (for instance, if there is an outstanding request to subscribe to the contact's presence, and it's not possible to cancel such requests). However, all signals that immediately result from this method call MUST be emitted before it returns, so that clients can interpret the result.

User interfaces removing a contact from the contact list are unlikely to want spurious failure notifications resulting from limitations of a particular protocol. However, emitting the signals first means that if a client does want to check exactly what happened, it can wait for the method to return (while applying change-notification signals to its local cache of the contact list's state), then consult its local cache of the contact list's state to see whether the contact is still there.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState changes to Failure, this method SHOULD raise the same error as GetContactListAttributes.

One or more contacts to remove.

It was not possible to perform the requested action because CanChangeContactList is false. The ContactListState is None or Waiting.

Attempt to set the given contacts' subscribe attribute to No, i.e. stop receiving their presence.

For contacts with subscribe=Ask, this attempts to cancel an earlier request to subscribe to the contact's presence; for contacts with subscribe=Yes, this attempts to unsubscribe from the contact's presence.

As with RemoveContacts, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState changes to Failure, this method SHOULD raise the same error as GetContactListAttributes.

One or more contacts to remove.

It was not possible to perform the requested action because CanChangeContactList is false.

Attempt to set the given contacts' publish attribute to No, i.e. stop sending presence to them.

For contacts with publish=Ask, this method explicitly rejects the contact's request to subscribe to the user's presence; for contacts with publish=Yes, this method attempts to prevent the user's presence from being received by the contact.

As with RemoveContacts, this method SHOULD succeed even if it was not possible to carry out the request entirely or for all contacts; however, all signals that immediately result from this method call MUST be emitted before it returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState changes to Failure, this method SHOULD raise the same error as GetContactListAttributes.

One or more contacts to remove.

It was not possible to perform the requested action because CanChangeContactList is false. The ContactListState is None or Waiting.

Download the contact list from the server. If DownloadAtConnection is true, Download does nothing.

telepathy-glib-0.24.2/spec/Connection_Interface_Communication_Policy.xml0000644000175000017500000001460512652510705023402 00000000000000 Copyright © 2010 Collabora Limited This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (draft 1)

This interface supports controlling which contacts are allowed to initiate text chats, incoming calls, and other forms of communication as supported by the underlying protocol. The policies supported for different communication methods on this connection are listed in the SupportedPolicies property. The current configuration is held in ActivePolicies; it can be modified using SetPolicy, and changes are signalled by PolicyChanged.

A mapping of communication methods (channel types), and their associated policy. The channel interface with the policy. The active policy for this channel type. The communication policies supported by this connection.

The active communication policies on this connection. Communication methods that are not in this mapping are considered open.

For example, to allow incoming calls only from contacts buddy list, and to allow text messages from anyone, the policy would look like this:

{
    'org.freedesktop.Telepathy.Channel.Type.Text' : Access_Control_Type_Open,
    'org.freedesktop.Telepathy.Channel.Type.Call' : Access_Control_Type_Publish_List
}
        

Changes to this property are signalled by PolicyChanged.

Set a policy for a communication method (channel type). Depending on the server or protocol, more than one communication method could be bound to the same policy, if calling this method on one channel type changes the policy on another channel type, the PolicyChanged signal that would follow would include all the channel types that have an altered policy. The channel type to set the policy for. The policy to set for this channel. ActivePolicies has changed. This occurs when the server unilaterally changed the policy or SetPolicy has been called. A subset of the active policies that have changed.

The communication methods (channel types), and the policies that can be applied to them. This is server and protocol dependant.

Grouped channel types will always have the same policy applied to them.

Different protocols have different limitations to the granularity of communication policies. One protocol might be able to set a different policy for VoIP calls and text chat, while another protocol might only be able to set one policy to both VoIP and text chat.
A list of channel interfaces that support these policies. A list of supported policies.
telepathy-glib-0.24.2/spec/Channel_Request.xml0000644000175000017500000003671412652510705016204 00000000000000 Copyright © 2008–2011 Collabora Ltd. Copyright © 2008–2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

A channel request is an object in the ChannelDispatcher representing an ongoing request for some channels to be created or found. They are created by methods such as CreateChannel. There can be any number of ChannelRequest objects at the same time.

Its well-known bus name is the same as that of the ChannelDispatcher, "org.freedesktop.Telepathy.ChannelDispatcher".

See ChannelDispatcher.CreateChannel for rationale for ChannelRequest being a separate object.

A channel request can be cancelled by any client (not just the one that requested it). This means that the ChannelDispatcher will Close the resulting channel, or refrain from requesting it at all, rather than dispatching it to a handler.

The Account on which this request was made. This property cannot change.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.

This property is set when the channel request is created, and can never change.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable.

This property is set when the channel request is created, and can never change.

An array of dictionaries containing desirable properties for the channel or channels to be created.

This is an array so that we could add a CreateChannels method in future without redefining the API of ChannelRequest.

This property is set when the channel request is created, and can never change.

A list of the extra interfaces provided by this channel request. This property cannot change.

Proceed with the channel request.

The client that created this object calls this method when it has connected signal handlers for Succeeded and Failed.

Clients other than the client which created the ChannelRequest MUST NOT call this method.

This method SHOULD return immediately; on success, the request might still fail, but this will be indicated asynchronously by the Failed signal.

Proceed cannot fail, unless clients have got the life-cycle of a ChannelRequest seriously wrong (e.g. a client calls this method twice, or a client that did not create the ChannelRequest calls this method). If it fails, clients SHOULD assume that the whole ChannelRequest has become useless.

This method has already been called, so it is no longer available. Stop calling it.

Cancel the channel request. The precise effect depends on the current progress of the request.

If the connection manager has not already been asked to create a channel, then Failed is emitted immediately, and the channel request is removed.

If the connection manager has already been asked to create a channel but has not produced one yet (e.g. if Connection.Interface.Requests.CreateChannel has been called, but has not yet returned), then the ChannelDispatcher will remember that the request has been cancelled. When the channel appears, it will be closed (if it was newly created and can be closed), and will not be dispatched to a handler.

If the connection manager has already returned a channel, but the channel has not yet been dispatched to a handler then the channel dispatcher will not dispatch that channel to a handler. If the channel was newly created for this request, the channel dispatcher will close it with Close; otherwise, the channel dispatcher will ignore it. In either case, Failed will be emitted when processing has been completed.

If Failed is emitted in response to this method, the error SHOULD be org.freedesktop.Telepathy.Error.Cancelled.

If the channel has already been dispatched to a handler, then it's too late to call this method, and the channel request will no longer exist.

The channel request has failed. It is no longer present, and further methods must not be called on it.

The name of a D-Bus error. This can come from various sources, including the error raised by CreateChannel, or an error generated to represent failure to establish the Connection.

If the first argument of the D-Bus error message was a string, that string. Otherwise, an empty string.

The channel request has succeeded. It is no longer present, and further methods must not be called on it.

A dictionary of metadata provided by the channel requester, which the handler and other clients MAY choose to interpret. Clients MAY choose to use platform-specific keys for their own purposes, but MUST ignore unknown keys and MUST cope with expected keys being missing. Clients SHOULD namespace hint names by having them start with a reversed domain name, in the same way as D-Bus interface names.

This property might be used to pass a contact ID for a telephone number shared between two contacts from the address book to the call UI, so that if you try to call “Mum”, the call UI knows this rather than having to guess or show “Calling Mum or Dad”. The format of these contact IDs would be platform-specific, so we leave the definition of the dictionary entry up to the platform in question. But third-party channel requesters might not include the contact ID, so the call UI has to be able to deal with it not being there.

The channel dispatcher does not currently interpret any of these hints: they are solely for communication between cooperating clients. If hints that do affect the channel dispatcher are added in future, their names will start with an appropriate reversed domain name (e.g. org.freedesktop.Telepathy for hints defined by this specification, or an appropriate vendor name for third-party plugins).

This property may be set when the channel request is created, and can never change. Since it is immutable, it SHOULD be included in the dictionary of properties passed to AddRequest by the ChannelDispatcher.

The following standardised hints are defined:

org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler - b
If present and True the client currently handling the channel SHOULD pass the channel to the PreferredHandler using DelegateChannels. This hint allows the user to request a channel in their preferred client in a situation where there are two chat handlers (for example: requesting a channel in Empathy which is currently being handled by gnome-shell). If the channel is currently unhandled, clients SHOULD ignore this hint. It is assumed that Mission Control will correctly delegate an unhandled channel to the preferred Handler. This allows requesting clients to always include this hint in their channel request. The Handler should check each ChannelRequest of the Requests_Satisfied parameter of HandleChannels for the hint. The first request containing the hint SHOULD be used and all further hints SHOULD be ignored. This covers the very unlikely case where HandleChannels satisfies two separate requests which have different PreferredHandlers.

Variant of the Succeeded signal allowing to get the channel which has been created.

This signal MUST be emitted if the ChannelDispatcher's SupportsRequestHints property is true. If supported, it MUST be emitted before the Succeeded signal.

The Connection owning the channel.

A subset of the Connection's properties, currently unused. This parameter may be used in future.

The channel which has been created.

The same immutable properties of the Channel that would appear in a NewChannels signal.

telepathy-glib-0.24.2/spec/Connection_Interface_Aliasing.xml0000644000175000017500000002107112652510705021000 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A dictionary whose keys are contact handles and whose values are aliases. A pair (contact handle, alias) as seen in the AliasesChanged signal. An array containing structs of:
  • the handle representing the contact
  • the new alias
Signal emitted when a contact's alias (or that of the user) is changed.

The aliases of contacts on this connection may be changed by the user of the service, not just by the contacts themselves. This is the case on Jabber, for instance.

It is possible that aliases can be changed by the contacts too - which alias takes precedence is not defined by this specification, and depends on the server and/or connection manager implementation.

This flag only applies to the aliases of "globally valid" contact handles. At this time, clients should not expect to be able to change the aliases corresponding to any channel-specific handles. If this becomes possible in future, a new flag will be defined.

An integer with a bitwise OR of flags from ConnectionAliasFlags Return a bitwise OR of flags detailing the behaviour of aliases on this connection. An array of handles representing contacts A list of aliases in the same order as the contact handles Request the value of several contacts' aliases at once. An array of handles representing contacts A dictionary mapping contact handles to aliases Request the value of several contacts' aliases at once. This SHOULD only return cached aliases, falling back on the contact identifier (i.e. the string corresponding to the handle) if none is present. Also if there was no cached alias, a request SHOULD be started of which the result is later signalled by AliasesChanged. A dictionary mapping integer handles of contacts to strings of the new alias to set. Request that the alias of the given contact be changed. Success will be indicated by emitting an AliasesChanged signal. On connections where the CONNECTION_ALIAS_FLAG_USER_SET flag is not set, this method will only ever succeed if the contact is the user's own handle (as returned by Connection.GetSelfHandle).

The same string that would be returned by GetAliases (always present with some value, possibly the same as Connection/contact-id, if information from the Aliasing interface was requested)

An interface on connections to support protocols where contacts have an alias which they can change at will. Provides a method for the user to set their own alias, and a signal which should be emitted when a contact's alias is changed or first discovered.

On connections where the user is allowed to set aliases for contacts and store them on the server, the GetAliasFlags method will have the CONNECTION_ALIAS_FLAG_USER_SET flag set, and the SetAliases method may be called on contact handles other than the user themselves.

Aliases are intended to be used as the main displayed name for the contact, where available.

telepathy-glib-0.24.2/spec/Channel_Interface_Credentials_Storage.xml0000644000175000017500000000605112652510705022444 00000000000000 Copyright © 2011 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

A channel interface for SASL authentication channels that can save the credentials in the connection manager.

This interface is unlikely to be present for any SASL channels that are more complex than a simple password prompt (e.g. X-TELEPATHY-PASSWORD or PLAIN).

In practice, this interface should only be implemented by connection managers that implement the ConnectionManager.Interface.AccountStorage.DRAFT interface. To clear a password that has been saved in this manner, a client should call AccountStorage.DRAFT.ForgetCredentials on the Account.

Whether to store the authentication credentials.

This method tells the connection manager whether to store the authentication response in order to allow the connection manager to sign-on automatically in the future.

If credentials have been stored in this way, the client SHOULD NOT attempt to store the credentials locally in a keyring.

This method MUST be called before AcceptSASL is called or it will have no effect.

telepathy-glib-0.24.2/spec/Protocol_Interface_Presence.xml0000644000175000017500000001063712652510705020525 00000000000000 Copyright © 2009-2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for protocols where it might be possible to set the user's presence, and the supported presence types can be predicted before connecting.

This allows UIs to show or hide presence types that aren't always supported, such as "invisible", while not online.

The properties on this interface SHOULD be cached in the .manager file, in the [Protocol proto] group. For each status s in Statuses, that group should contain a key of the form status-s whose value is the Connection_Presence_Type as an ASCII decimal integer, followed by a space-separated sequence of tokens from the following set:

settable
If present, the user can set this status on themselves using SetPresence; this corresponds to May_Set_On_Self in the Simple_Status_Spec struct.
message
If present, the user can set a non-empty message for this status; this corresponds to Can_Have_Message in the Simple_Status_Spec struct.

Unrecognised tokens MUST be ignored.

For instance, an XMPP connection manager might have this .manager file:

[Protocol jabber]
Interfaces=org.freedesktop.Telepathy.Protocol.Interface.Presence;
param-account=s required
param-password=s required
status-offline=1
status-unknown=7
status-error=8
status-hidden=5 settable message
status-xa=4 settable message
status-away=3 settable message
status-dnd=6 settable message
status-available=2 settable message
status-chat=2 settable message

which corresponds to these property values (using a Python-like syntax):

Statuses = {
    'offline': (OFFLINE, False, False),
    'unknown': (UNKNOWN, False, False),
    'error': (ERROR, False, False),
    'hidden': (HIDDEN, True, True),
    'xa': (EXTENDED_AWAY, True, True),
    'away': (AWAY, True, True),
    'dnd': (BUSY, True, True),
    'available': (AVAILABLE, True, True),
    'chat': (AVAILABLE, True, True),
}

The statuses that might appear in the Connection.Interface.SimplePresence.Statuses property on a connection to this protocol that supports SimplePresence. This property is immutable.

Depending on server capabilities, it is possible that not all of these will actually appear on the Connection.

telepathy-glib-0.24.2/spec/Connection_Interface_Forwarding.xml0000644000175000017500000004000312652510705021347 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd. Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft version, not API-stable)

This connection interface is for protocols that are capable of signaling to remote contacts that incoming communication channels should be instead sent to a separate contact. This might apply to things such as call forwarding, for example.

In some cases, a CM may register forwarding rules with an external service; in those cases, it will never see the incoming channel, and the forwarding will happen automatically.

In other cases, the CM will handle the forwarding itself. When an incoming channel is detected, the status of the local user will determine whether or not a forwarding rule is matched. For some rules, this MAY happen immediately (ie, if the user is Busy); for others, there MAY be a timeout (in seconds) that must expire before the forwarding rule is matched (the timeout is specified by the first element in the Forwarding_Rule_Entry list).

Once a forwarding rule is matched and any necessary timeouts have expired, the CM can forward the incoming channel to the specified handle. If for whatever reason the remote handle does not accept the channel AND the CM supports multiple forwarding entries AND any necessary timeouts have expired (specified by the next entry in the list), the CM can forward the incoming channel to the next handle in the entry list. This continues until the list is exhausted, or the incoming channel is accepted.

Note that the rule matches are only for the first entry in the in the forwarding rule list. Once the incoming channel has been forwarded, the next entry in the list (assuming one exists and the contact that the channel has been forwarded to does not respond after any necessary timeouts) is used regardless of the status of the forwarded channel. The initial match rule might have been Busy, whereas the contact that the channel has been forwarded to might be offline. Even in this case, the Busy list is still traversed until the channel is handled (or there are no more forwarding entries in the list).

For example, assuming the following dict for Forwarding_Rules:

        ForwardingRules = {
          Busy: ( initial-timeout: 30, [
            (handle: 3, timeout: 15),
            (handle: 5, timeout: 20)
          ]),
          NoReply: ( initial-timeout: 15, [
            (handle: 5, timeout: 30),
            (handle: 3, timeout: 20)
          ])
        }

We can imagine a scenario where an incoming channel is detected, the media stream is available (ie, not Busy), and the local user is online. While the CM is waiting for the local user to accept the channel, it looks at NoReply's first timeout value. After 15s if the local user hasn't accepted, the CM forwards the channel to Handle #5. The CM then waits 30s for Handle #5 to accept the channel. If after 30s it does not, the CM forwards the incoming channel to Handle #3, which will have 20s to accept the channel.

When an unanswered StreamedMedia call is forwarded, both the contact and the self handle should be removed from the group with the self handle as the actor, and Channel_Group_Change_Reason No_Answer or Busy, as appropriate. For Call1 channels, the Call_State_Change_Reason Forwarded should be used.

The various forwarding conditions that are supported by this interface. In general, the conditions should not overlap; it should be very clear which rule would be chosen given a CM's behavior with an incoming channel. The exception to this is Unconditional, which will override all other rules. Incoming channels should always be forwarded. Note that setting this will override any other rules. If not set, other rules will be checked when an incoming communication channel is detected.

The incoming channel should be forwarded if a busy signal is detected. What defines "Busy" is CM-specific (perhaps a single resource is already in use, or a user's status is set to Busy Connection_Presence_Type).

If initial timeout is specified for Busy condition and call waiting is not supported by the service, the timeout will be ignored.

The incoming channel should be forwarded if the local user doesn't accept it within the specified amount of time. The incoming channel should be forwarded if the user is offline. This could be a manual setting (the user has chosen to set their presence to offline or invisible) or something specified by the underlying network (the user is not within range of a cell tower).

A forwarding rule entry. These MAY be chained together for CMs that support chaining of forwards (in other words, a forwarding rule may have multiple entries; if the contact in the first entry doesn't respond, the incoming channel might be forwarded to the contact in the second entry).

For CMs and protocols that don't support chaining of entries, only the first entry would be used.

The length of time (in seconds) to wait the contact to respond to the forwarded channel. This MAY be ignored by the CM if it isn't supported by the underlying network/protocol for the specific status of the remote contact (for example, a GSM call that is forwarded may return Not_Reachable immediately without waiting for the timeout value to expire).

A value of 0 means the condition can match immediately. A value of MAX_UINT32 means that the CM's default should be used.

The contact to forward an incoming channel to. If the handle doesn't point to anything (e.g. points to a phone number that doesn't exist), the entry SHOULD be skipped.
A chain of forwarding rules and an initial timeout after which the rules are applied. Initial timeout for the rule. The forwarding targets (an array of type Forwarding_Rule_Entry). A dictionary whose keys are forwarding conditions and whose values are Forwarding_Rule_Chain structs. A dictionary whose keys are forwarding conditions and whose values are maximum number of Forwarding_Rule_Entry for the condition.

A map of forwarding conditions supported on this connection to maximum number of Forwarding_Rule_Entry supported for the specific condition.

When forwarding is done by the provider, different providers might support different chain sizes, or provider and local implementation chain sizes might differ.

The current forwarding rules that are enabled for this connection. Forwarding rules each contain an array of type Forwarding_Rule_Entry.

Emitted when the ForwardingRules property changes.

By the time this is emitted, the property MUST have been updated with the new rules being active. If any protocol/network requests must be made, they should be completed before the signal is emitted.

The condition of the forwarding rule that's been changed. The new initial timeout for the rule. The new (and as of the emission of the signal, currently active) forwards. The order is relevant; those at the lowest array index are used first.
Update the forwarding rules.

The forwarding rule to override. Note that this SHOULD not affect other rules; setting a rule that overrides others (such as Forwarding_Rule_Unconditional) will not modify other rules. This means that when a client sets Forwarding_Rule_Busy and then temporarily sets Forwarding_Rule_Unconditional, the Forwarding_Rule_Busy rule will retain settings after Forwarding_Rule_Unconditional, has been unset.

If the CM has no choice but to adjust multiple rules after a call to this function (ie, due to the network or protocol forcing such behavior), the CM MUST emit multiple ForwardingRuleChanged signals for each changed rule. The order of the signals is implementation-dependent, with the only requirement that the last signal is for the rule that was originally requested to have been changed (e.g. if Unconditional automatically modifies Busy and NoReply, three separate ForwardingRuleChanged signals should be raised with the last signal being for Forwarding_Rule_Unconditional).

Each forwarding condition will occur no more than once in the rule array. Setting a rule will overwrite the old rule with the same Forwarding_Condition in its entirety.

The forwarding targets (an array of type Forwarding_Rule_Entry) to activate for the rule. An empty array will effectively disable the rule. The old forwarding targets (an array of type Forwarding_Rule_Entry). This is the list of entries that is being replaced with the call to SetForwardingRule. The specified Condition is not supported by this connection, or the number of chained SupportedForwardingConditions should be checked prior to calling SetForwardingRule. A Handle that has been supplied is invalid.
telepathy-glib-0.24.2/spec/Channel_Type_Stream_Tube.xml0000644000175000017500000003134512652510705017762 00000000000000 Copyright © 2008-2009 Collabora Limited Copyright © 2008-2009 Nokia Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A stream tube is a transport for ordered, reliable data transfer, similar to SOCK_STREAM sockets.

When offering a stream tube, the initiating client creates a local listening socket and offers it to the recipient client using the Offer method. When a recipient accepts a stream tube using the Accept method, the recipient's connection manager creates a new local listening socket. Each time the recipient's client connects to this socket, the initiator's connection manager proxies this connection to the originally offered socket.

Offer a stream tube exporting the local socket specified. The type of the listening address of the local service, as a member of Socket_Address_Type. The listening address of the local service, as indicated by the address_type. The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. The dictionary of arbitrary Parameters to send with the tube offer. The contact associated with this channel doesn't have tube capabilities. The connection manager doesn't support the given address type or access-control type. Accept a stream tube that's in the "local pending" state. The connection manager will attempt to open the tube. The tube remains in the "local pending" state until the TubeChannelStateChanged signal is emitted. The type of address the connection manager should listen on.

The type of access control the connection manager should apply to the socket.

Note that if you plan to establish more than one connection through the tube, the Socket_Access_Control_Port access control can't be used as you can't connect more than once from the same port.

A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum. The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open. The access_control_param is invalid with the given access_control. The given address type or access-control mechanism is not supported.

Emitted each time a participant opens a new connection to its socket.

This signal is only fired on the offering side.

The handle of the participant who opened the new connection

A parameter which can be used by the listening process to identify the connection. Note that this parameter has a meaningful value only in the Socket_Access_Control_Port and Socket_Access_Control_Credentials cases. If a different Socket_Access_Control has been chosen when offering the tube, this parameter should be ignored.

In the Socket_Access_Control_Port case, the variant contains a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the address from which the CM is connected to the client application.

In the Socket_Access_Control_Credentials case, the variant contains the byte (D-Bus signature 'y') that has been sent with the credentials.

The unique ID associated with this connection. This ID will be used to identifiy the connection when reporting errors with ConnectionClosed.

Emitted when the tube application connects to the CM's socket.

This signal is only fired on the accepting side.

The unique ID associated with this connection. This ID will be used to identifiy the connection when reporting errors with ConnectionClosed.

Emitted when a connection has been closed.

The ID of the connection.

The name of a D-Bus error describing the error that occurred.

The following errors can be used:

  • org.freedesktop.Telepathy.Error.Cancelled: user closed the socket or the tube.
  • org.freedesktop.Telepathy.Error.ConnectionLost: the bytestream relaying connection's data has been broken.
  • org.freedesktop.Telepathy.Error.ConnectionRefused: the tube offer refused the connection.
A debug message.

A string representing the service name that will be used over the tube. It should be a well-known TCP service name as defined by http://www.iana.org/assignments/port-numbers or http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap".

When the tube is offered, the service name is transmitted to the other end.

When requesting a channel with Connection.Interface.Requests.CreateChannel, this property MUST be included in the request.

A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for stream tubes with that address type. For simplicity, if a CM supports offering a particular type of tube, it is assumed to support accepting it.

A typical value for a host without IPv6 support:

          {
            Socket_Address_Type_IPv4:
              [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
               Socket_Access_Control_Netmask],
            Socket_Address_Type_Unix:
              [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
          }
        

Connection Managers MUST support at least IPv4 with the localhost access control.

When requesting a channel with Connection.Interface.Requests.CreateChannel, this property MUST NOT be included in the request.

An identifier for a stream tube connection. These are defined with the NewLocalConnection or NewRemoteConnection signals and are used by ConnectionClosed to identify the closed connection.
telepathy-glib-0.24.2/spec/Call_Stream_Interface_Media.xml0000644000175000017500000007701512652510705020370 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface deals with how to connect a stream to an endpoint. It contains all that is required to describe the local endpoint, to succesfully establish a connection. While a call is established, one may try to connect to multiple remote endpoints at the same time. This is called forking in the SIP jargon. Informations related to the connections are on the Endpoint objects. Once the call is established, there MUST be a single endpoint left.

ICE restarts

If the CM wants to do an ICE restart, then the ICERestartPending property is set, and the ICERestartRequested signal is emitted. The streaming implementation should then call SetCredentials again. This will trigger the actual ICE restart, and cause LocalCandidates to be cleared.

For more information on ICE restarts see RFC 5245 section 9.1.1.1

The type of SendingState and ReceivingState. No data is flowing (or expected to be flowing) at this time. The streaming implementation has been told to start or receiving, but has not yet indicated that it is doing so. The streaming implementation has been told to stop sending or receiving data, but it has not yet indicated that it has done so. The streaming implementation is successfully sending or receiving data, and everything is going swimmingly. Indicates whether the streaming implementation is/should be sending media for this stream. The streaming implementation should be able to rely on reading this value and listening to SendingStateChanged to determine whether it should be sending media or not. It should not need to listen to the Hold interfaces on the Call/Content. Feedback on success should be given via CompleteSendingStateChange. Failures should be reported via ReportSendingFailure. Change notification for SendingState. Note that this information is duplicated onto the Stream interface, so that UIs can ignore the Media interface, and streaming implementations can ignore everything but the media interface. The new value of SendingState.

Called in response to SendingStateChanged(Pending_*, *) to indicate that the media state has successfully progressed from Pending_{Start, Stop, Pause} to the corresponding non-pending state.

The new (non-pending) value of SendingState. The state change made no sense, and was ignored by the CM. The most likely cause for this is a race-condition between the CM emitting a new state change and the streaming implementation responding to the previous state change.
Can be called at any point to indicate a failure in the outgoing portion of the stream. The counterpart of SendingState. Indicates whether the streaming implementation is/should be expecting to receive media for this stream. The CM should only tell the streaming implementation to stop receiving if it has been told to put the stream on hold, or the stream has been removed from the call. Change notification for ReceivingState. The new value of ReceivingState.

Called in response to ReceivingStateChanged(Pending_*, *) to indicate that the media state has successfully progressed from Pending_{Start, Stop, Pause} to the corresponding non-pending state.

The new (non-pending) value of ReceivingState. The state change made no sense, and was ignored by the CM. The most likely cause for this is a race-condition between the CM emitting a new state change and the streaming implementation responding to the previous state change.
Can be called at any point to indicate a failure in the incoming portion of the stream.

Used to set the username fragment and password for streams that have global credentials.

The username to use when authenticating on the stream. The password to use when authenticating on the stream.
The network topology that an IP candidate represents. This can sometimes be used to infer what kind of performance characteristics (latency, bandwith, etc) can be expected of connections made to this candidate. This is not an IP candidate. This is a reserved value, and should not be seen on the bus. This candidate represents a direct connection to the host, as its address is taken directly the host's IP stack. This candidate probably represents a connection to the host through a NAT device, as its address was discovered by sending a binding request to a STUN server or similar. This candidate probably represents a good route between the host and its peer, as its address was discovered by sending a STUN binding request to one of the candidates advertised by the peer. This candidate represents the address of a relay server (usually somewhere on the public internet). This candidate is the most likely to work, but all media will go via a relay server, so latency is likely to be higher than other types of candidate. This candidate represents a Multicast group. This value should only appear if the Stream's Transport is set to Multicast.

Extra information about the candidate. Allowed and mandatory keys depend on the transport protocol used. The following keys are commenly used:

type - u
The type of candidate (Call_Stream_Candidate_Type)
foundation - s
The foundation of this candidate
protocol - u
Underlying protocol of the candidate (Media_Stream_Base_Proto)
priority - u
Priority of the candidate (should be a number between 0 and 65535). Most ICE implementations will prefer the highest priority candidate pair that manages to connect. For backwards compatibility with non-ICE SIP clients, the lowest priority candidate may be sent as a raw UDP fallback candidate. It is recommended that a relay candidate is used as the lowest priority candidate if possible. If both IPv4 and IPv6 raw udp fallback candidates are available, they should be set to the same priority and advertised to the CM at the same time. The CM will decide which to advertise to the remote end.
base-ip - s
The underlying Host address where media sent to this (non-host-type) candidate will eventually arrive.
base-port - u
The underlying Host port where media sent to this (non-host-type) candidate will eventually arrive.
username - s
Username of this candidate (only if credentials are per candidate)
password - s
Password of this candidate (only if credentials are per candidate)
ttl - u
The TTL mandated for RTP/RTCP packets sent to a multicast group (only valid for Multicast Streams)
One of the well-known keys documented here, or an implementation-specific key. The value corresponding to that key.
Media streams can use more than one UDP socket: one for RTP (data) and one for RTCP (control). Most of the time, they are adjacent to each other, but some protocols (xmpp) signal each port separately. The stream transport type is unknown or not applicable (should not appear over dbus). This is the high-traffic data socket, containing the audio/video data for the stream. This is the low-traffic control socket, usually containing feedback about packet loss etc. A Stream Candidate. The component number. The IP address to use. The port number to use. Additional information about the candidate. Add candidates to the LocalCandidates property and signal them to the remote contact(s). Note that connection managers MAY delay the sending of candidates until FinishInitialCandidates is called. The candidates to be added. This indicates to the CM that the initial batch of candidates has been added, and should now be processed/sent to the remote side. Protocols supporting Raw UDP SHOULD wait for FinishInitialCandidates, and then set the lowest priority candidate as the Raw UDP candidate. The minimal required candidates have not been set. For example, for an RTP protocol, at least one candidate on the component 1 (RTP) must have been set. WLM_8_5 was removed A transport that can be used for streaming. The stream transport type is unknown or not applicable (for streams that do not have a configurable transport). Raw UDP, with or without STUN. All streaming clients are assumed to support this transport, so there is no handler capability token for it in the Call1 interface. [This corresponds to "none" or "stun" in the old Media.StreamHandler interface.] Interactive Connectivity Establishment, as defined by RFC 5245. Note that this value covers ICE-UDP only. [This corresponds to "ice-udp" in the old Media.StreamHandler interface.] Google Talk peer-to-peer connectivity establishment, as implemented by libjingle 0.3. [This corresponds to "gtalk-p2p" in the old Media.StreamHandler interface.] The transport used by Windows Live Messenger 2009 or later, which resembles ICE draft 19. [This corresponds to "wlm-2009" in the old Media.StreamHandler interface.] Shared memory transport, as implemented by the GStreamer shmsrc and shmsink plugins. Multicast transport. The transport for this stream. [FIXME]. Change notification is via the LocalCandidatesAdded signal. Emitted when local candidates are added to the LocalCandidates property. Candidates that have been added. A username and password pair. The username. The password. The local credentials are sent to the remote site over the signalling protocol. They are used in ICE to make sure that the connectivity checks come from the right peer. Change notification is via the LocalCredentialsChanged signal. This property will be a pair of empty strings if ICE has not yet been started. renamed from LocalCredentailsSet Emitted when the value of LocalCredentials changes to a non-empty value. This should only happen when the streaming implementation calls SetCredentials, so this signal is mostly useful for debugging. Emitted when the value of RelayInfo changes. Emitted when the value of STUNServers changes.

The IP addresses of possible STUN servers to use for NAT traversal, as dotted-quad IPv4 address literals or RFC2373 IPv6 address literals. Change notification is via the STUNServersChanged signal. The IP addresses MUST NOT be given as DNS hostnames.

High-quality connection managers already need an asynchronous DNS resolver, so they might as well resolve this name to an IP to make life easier for streaming implementations.

A list of mappings describing TURN or Google relay servers available for the client to use in its candidate gathering, as determined from the protocol. Well-known map keys are:

ip - s
The IP address of the relay server as a dotted-quad IPv4 address literal or an RFC2373 IPv6 address literal. This MUST NOT be a DNS hostname. High-quality connection managers already need an asynchronous DNS resolver, so they might as well resolve this name to an IP and make life easier for streaming implementations.
type - s

Either udp for UDP (UDP MUST be assumed if this key is omitted), tcp for TCP, or tls.

The precise meaning of this key depends on the Transport property: if Transport is ICE, tls means TLS over TCP as referenced by ICE draft 19, and if Transport is GTalk_P2P, tls means a fake SSL session over TCP as implemented by libjingle.

port - q
The UDP or TCP port of the relay server as an ASCII unsigned integer
unique-id - s
A string identifying the relay server. If two RelayInfo entries have the same unique-id, but different types, there is usually little point in connecting to both. Use priority to determine which version to prefer in this case. Can also be used by the streaming implementation to avoid connecting to the same relay multiple times if relaying is required for both audio and video.
priority - u
A number determining which version of a server to prefer (if multiple are present with the same unique-id, the one with the highest priority should be used, or the streaming implementation should use the one whose type has the most desirable properties)
username - s
The username to use
password - s
The password to use
component - u
The component number to use this relay server for, as an ASCII unsigned integer; if not included, this relay server may be used for any or all components. In ICE draft 6, as used by Google Talk, credentials are only valid once, so each component needs relaying separately.

An equivalent of the gtalk-p2p-relay-token property on MediaSignalling channels is not included here. The connection manager should be responsible for making the necessary HTTP requests to turn the token into a username and password.

The type of relay server that this represents depends on the value of the Transport property. If Transport is ICE, this is a TURN server; if Transport is GTalk_P2P, this is a Google relay server; otherwise, the meaning of RelayInfo is undefined.

If relaying is not possible for this stream, the list is empty.

Change notification is given via the RelayInfoChanged signal.

Signals that the initial information about STUN and Relay servers has been retrieved, i.e. the HasServerInfo property is now true.

True if all the initial information about STUN servers and Relay servers has been retrieved. Change notification is via the ServerInfoRetrieved signal.

Streaming implementations that can't cope with STUN and relay servers being added later SHOULD wait for this property to become true before proceeding.
Emitted when the Endpoints property changes. Endpoints that were added. Endpoints that no longer exist.

The list of Endpoint objects that exist for this stream.

Change notification is via the EndpointsChanged signal.

Emitted when the remote side requests an ICE restart (e.g. third party call control, when the remote endpoint changes). The streaming implementation should call SetCredentials again. State recovery for ICERestartRequested. Set when the signal is emitted, and unset when SetCredentials is called. Useful for debugging. Signal an unrecoverable error for this stream, and remove it. If all streams are removed from a content, then it will also be removed. A structured reason for stream removal.
telepathy-glib-0.24.2/spec/Media_Stream_Handler.xml0000644000175000017500000011104512652510705017102 00000000000000 Copyright (C) 2005-2008 Collabora Limited Copyright (C) 2005-2008 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Handles signalling the information pertaining to a specific media stream. A client should provide information to this handler as and when it is available. Information about a codec supported by a client or a peer's client. The codec's payload identifier, as per RFC 3551 (static or dynamic) The codec's name Type of stream this codec supports Sampling frequency in Hertz Number of supported channels Codec-specific optional parameters The IP addresses of possible STUN servers to use for NAT traversal, as dotted-quad IPv4 address literals or RFC2373 IPv6 address literals. This property cannot change once the stream has been created, so there is no change notification. The IP addresses MUST NOT be given as DNS hostnames. High-quality connection managers already need an asynchronous DNS resolver, so they might as well resolve this name to an IP to make life easier for streaming implementations. True if we were the creator of this stream, false otherwise. This information is needed for some nat traversal mechanisms, such as ICE-UDP, where the creator gets the role of the controlling agent.

The transport (NAT traversal technique) to be used for this stream. Well-known values include:

none
Raw UDP, with or without STUN, should be used. If the STUNServers property is non-empty, STUN SHOULD be used.
stun
A deprecated synonym for 'none'.
gtalk-p2p
Google Talk peer-to-peer connectivity establishment should be used, as implemented in libjingle 0.3.
ice-udp
Interactive Connectivity Establishment should be used, as defined by the IETF MMUSIC working group.
wlm-8.5
The transport used by Windows Live Messenger 8.5 or later, which resembles ICE draft 6, should be used.
wlm-2009
The transport used by Windows Live Messenger 2009 or later, which resembles ICE draft 19, should be used.

This property cannot change once the stream has been created, so there is no change notification.

A list of mappings describing TURN or Google relay servers available for the client to use in its candidate gathering, as determined from the protocol. Map keys are:

ip - s
The IP address of the relay server as a dotted-quad IPv4 address literal or an RFC2373 IPv6 address literal. This MUST NOT be a DNS hostname. High-quality connection managers already need an asynchronous DNS resolver, so they might as well resolve this name to an IP and make life easier for streaming implementations.
type - s

Either udp for UDP (UDP MUST be assumed if this key is omitted), tcp for TCP, or tls.

The precise meaning of this key depends on the NATTraversal property: if NATTraversal is ice-udp, tls means TLS over TCP as referenced by ICE draft 19, and if NATTraversal is gtalk-p2p, tls means a fake SSL session over TCP as implemented by libjingle.

port - q
The UDP or TCP port of the relay server as an ASCII unsigned integer
username - s
The username to use
password - s
The password to use
component - u
The component number to use this relay server for, as an ASCII unsigned integer; if not included, this relay server may be used for any or all components. In ICE draft 6, as used by Google Talk, credentials are only valid once, so each component needs relaying separately.

An equivalent of the gtalk-p2p-relay-token property on MediaSignalling channels is not included here. The connection manager should be responsible for making the necessary HTTP requests to turn the token into a username and password.

The type of relay server that this represents depends on the value of the NATTraversal property. If NATTraversal is ice-udp, this is a TURN server; if NATTraversal is gtalk-p2p, this is a Google relay server; otherwise, the meaning of RelayInfo is undefined.

If relaying is not possible for this stream, the list is empty.

This property cannot change once the stream has been created, so there is no change notification.

String identifier for this candidate Array of transports for this candidate with fields, as defined in NewNativeCandidate Signal emitted when the connection manager wishes to inform the client of a new remote candidate. Signal emitted when the connection manager wishes the stream to be closed. Inform the connection manager of codec used to receive data. ID of error, from the MediaStreamError enumeration String describing the error Inform the connection manager that an error occured in this stream. The connection manager should emit the StreamError signal for the stream on the relevant channel, and remove the stream from the session. An unknown error occured. The end of the stream was reached. This error has no use anywhere. In Farsight 1 times, it was used to indicate a GStreamer EOS (when the end of a file is reached). But since this is for live calls, it makes no sense. There are no common codecs between the local side and the other particpants in the call. The possible codecs are not signalled here: the streaming implementation is assumed to report them in an implementation-dependent way, e.g. Farsight should use GstMissingElement. A network connection for the Media could not be established or was lost. There was an error in the networking stack (other than the connection failure). There are no installed codecs for this media type. The CM is doing something wrong. There was an error in the media processing stack. Informs the connection manager that all possible native candisates have been discovered for the moment. Informs the connection manager that a valid candidate pair has been discovered and streaming is in progress.

Informs the connection manager that a valid transport pair has been discovered and streaming is in progress. Component id MUST be the same for both transports and the pair is only valid for that component.

The connection manager might need to send the details of the active transport pair (e.g. c and o parameters of SDP body need to contain address of selected native RTP transport as stipulated by RFC 5245). However, the candidate ID might not be enough to determine these info if the transport was found after NativeCandidatesPrepared has been called (e.g. peer reflexive ICE candidate).

This method must be called before NewActiveCandidatePair.

This way, connection managers supporting this method can safely ignore subsequent NewActiveCandidatePair call.

Connection managers SHOULD NOT implement this method unless they need to inform the peer about selected transports. As a result, streaming implementations MUST NOT treat errors raised by this method as fatal.

Usually, connection managers only need to do one answer/offer round-trip. However, some protocols give the possibility to to send an updated offer (e.g. ICE defines such mechanism to avoid some race conditions and to properly set the state of gateway devices).

UDP (User Datagram Protocol) TCP (Transmission Control Protocol) String identifier for this candidate Array of transports for this candidate, with fields:
  • component number
  • IP address (as a string)
  • port
  • base network protocol (one of the values of MediaStreamBaseProto)
  • proto subtype (e.g. RTP)
  • proto profile (e.g. AVP)
  • our preference value of this transport (double in range 0.0-1.0 inclusive); 1 signals the most preferred transport
  • transport type, one of the values of MediaStreamTransportType
  • username if authentication is required
  • password if authentication is required
Inform this MediaStreamHandler that a new native transport candidate has been ascertained.
A local address An external address derived by a method such as STUN An external stream relay Locally-supported codecs. Inform the connection manager that a client is ready to handle this StreamHandler. Also provide it with info about all supported codecs. Locally-supported codecs

Used to provide codecs after Ready(), so the media client can go ready for an incoming call and exchange candidates/codecs before knowing what local codecs are available.

This is useful for gatewaying calls between two connection managers. Given an incoming call, you need to call Ready to get the remote codecs before you can use them as the "local" codecs to place the outgoing call, and hence receive the outgoing call's remote codecs to use as the incoming call's "local" codecs.

In this situation, you would pass an empty list of codecs to the incoming call's Ready method, then later call SetLocalCodecs on the incoming call in order to respond to the offer.

String identifier for remote candidate to drop There is no case where you want to release candidates (except for an ICE reset, and there you'd want to replace then all, using SetRemoteCandidateList). Signal emitted when the connection manager wishes to inform the client that the remote end has removed a previously usable candidate. It seemed like a good idea at the time, but wasn't. Emitted by the connection manager to inform the client that a valid candidate pair has been discovered by the remote end and streaming is in progress. A list of candidate id and a list of transports as defined in NewNativeCandidate Signal emitted when the connection manager wishes to inform the client of all the available remote candidates at once. Codecs supported by the remote peer. Signal emitted when the connection manager wishes to inform the client of the codecs supported by the remote end. If these codecs are compatible with the remote codecs, then the client must call SupportedCodecs, otherwise call Error. If emitted with argument TRUE, this means that the connection manager wishes to set the stream playing; this means that the streaming implementation should expect to receive data. If emitted with argument FALSE this signal is basically meaningless and should be ignored. We're very sorry. Signal emitted when the connection manager wishes to set whether or not the stream sends to the remote end. A telephony event code. Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called. A telephony event code as defined by RFC 4733. The payload type to use when sending events. The value 0xFFFFFFFF means to send with the already configured event type instead of using the specified one. Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called. This differs from StartTelephonyEvent in that you force the event to be transmitted as a RFC 4733 named event, not as sound. You can also force a specific Codec ID. A telephony event code as defined by RFC 4733. Request that a telephony event (as defined by RFC 4733) is transmitted over this stream until StopTelephonyEvent is called. This differs from StartTelephonyEvent in that you force the event to be transmitted as sound instead of as a named event. Request that any ongoing telephony events (as defined by RFC 4733) being transmitted over this stream are stopped. Informs the connection manager of the stream's current state, as as specified in Channel.Type.StreamedMedia::ListStreams. Locally supported codecs. Inform the connection manager of the supported codecs for this session. This is called after the connection manager has emitted SetRemoteCodecs to notify what codecs are supported by the peer, and will thus be an intersection of all locally supported codecs (passed to Ready) and those supported by the peer. Locally supported codecs, which SHOULD be the same as were previously in effect, but possibly with different parameters. Inform the connection manager that the parameters of the supported codecs for this session have changed. The connection manager should send the new parameters to the remote contact. This is required for H.264 and Theora, for example.

Emitted when the connection manager wishes to place the stream on hold (so the streaming client should free hardware or software resources) or take the stream off hold (so the streaming client should reacquire the necessary resources).

When placing a channel's streams on hold, the connection manager SHOULD notify the remote contact that this will be done (if appropriate in the protocol) before it emits this signal.

It is assumed that relinquishing a resource will not fail. If it does, the call is probably doomed anyway.

When unholding a channel's streams, the connection manager SHOULD emit this signal and wait for success to be indicated via HoldState before it notifies the remote contact that the channel has been taken off hold.

This means that if a resource is unavailable, the remote contact will never even be told that we tried to acquire it.

If true, the stream is to be placed on hold.
Notify the connection manager that the stream's hold state has been changed successfully in response to SetStreamHeld. If true, the stream is now on hold. Notify the connection manager that an attempt to reacquire the necessary hardware or software resources to unhold the stream, in response to SetStreamHeld, has failed. This struct is also used by Call, but in call, the CM should know about RTP profiles, and never use MAXUINT as a default value, because it complicates things unnecessarily. The minimum interval between two regular RTCP packets in milliseconds for this content. If no special value is desired, one should put MAXUINT (0xFFFFFFFF). Implementors and users of Call's RTCPFeedback should not use the MAXUINT default. Instead, in RTP/AVP, the default should be 5000 (5 seconds). If using the RTP/AVPF profile, it can be set to a lower value, the default being 0. The RTCP feedback messages for this codec. A struct defining an RTCP feedback message. Feedback type, for example "ack", "nack", or "ccm". Feedback subtype, according to the Type, can be an empty string (""), if there is no subtype. For example, generic nack is Type="nack" Subtype="". Feedback parameters as a string. Format is defined in the relevant RFC A map of codec and its feedback properties. Numeric identifier for the codec. This will be used as the PT in the SDP or content description. The RTCP feedback properties for this codec. Remote Feedback messages desired by the remote side Signal emitted when the connection manager wishes to inform the client of the feedback messages supported by the remote end. This signal is emitted before SetRemoteCodecs. If the client supports any of these messages, it must call SupportedFeedbackMessages before calling SupportedCodecs. Locally supported feedback messages. Inform the connection manager of the supported feedback messages for this session. This is called a before calling SupportedCodecs, Ready or CodecsUpdated to indicate the local, or negotiated feedback messages. A struct defining a RTP Header extension Identifier to be negotiated Direction in which the Header Extension is negotiated. URI defining the extension Feedback parameters as a string. Format is defined in the relevant RFC Header extensions desired by the remote side Signal emitted when the connection manager wishes to inform the client of the RTP header extensions supported by the remote end. This signal is emitted before SetRemoteCodecs. If the client supports any of these messages, it must call SupportedHeaderExtensions before calling SupportedCodecs. Locally supported RTP header extensions. Inform the connection manager of the supported RTP header extensions for this session. This is called before calling SupportedCodecs, Ready or CodecsUpdated to indicate the local or negotiated RTP header extensions.
telepathy-glib-0.24.2/spec/Client_Approver.xml0000644000175000017500000002331312652510705016207 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

Approvers are clients that notify the user that new channels have been created by a contact, and allow the user to accept or reject those channels. The new channels are represented by a ChannelDispatchOperation object, which is passed to the AddDispatchOperation method.

For instance, Empathy's tray icon, or the answer/reject window seen when a Maemo device receives a VoIP call, should be Approvers.

Approvers can also select which channel handler will be used for the channel, for instance by offering the user a list of possible handlers rather than just an accept/reject choice. However, the Channel Dispatcher must be able to prioritize possible handlers on its own using some reasonable heuristic, probably based on user configuration.

It is possible (and useful) to have an approver and a channel handler in the same process; this is particularly useful if a channel handler wants to claim responsibility for particular channels itself.

All approvers are notified simultaneously. For instance, in a desktop system, there might be one approver that displays a notification-area icon, one that is part of a contact list window and highlights contacts there, and one that is part of a full-screen media player.

Any approver can approve the handling of a channel dispatch operation with a particular channel handler by calling the HandleWith method. Approvers can also attempt to Claim channels; if this succeeds, the approver may handle the channels itself (if it is also a Handler), or close the channels in order to reject them.

At the D-Bus level, there is no "reject" operation: approvers wishing to reject channels SHOULD call the Claim method, then (if it succeeds) close the channels in any way they see fit.

The first approver to reply gets its decision acted on; any other approvers that reply at approximately the same time will get a D-Bus error, indicating that the channel has already been dealt with.

Approvers should usually prompt the user and ask for confirmation, rather than dispatching the channel to a handler straight away.

Non-interactive approvers can also be implemented as Observers as described in the interface description.

A specification of the channels in which this approver is interested. The AddDispatchOperation method should be called by the channel dispatcher whenever at least one of the channels in a channel dispatch operation matches this description.

This property works in exactly the same way as the Client.Observer.ObserverChannelFilter property. In particular, it cannot change while the approver process continues to own the corresponding Client bus name.

In the .client file, it is represented in the same way as ObserverChannelFilter, but the group has the same name as this interface and the keys start with ApproverChannelFilter instead of ObserverChannelFilter.

Called by the channel dispatcher when a ChannelDispatchOperation in which the approver has registered an interest is created, or when the approver starts up while such channel dispatch operations already exist.

The channel dispatcher SHOULD call this method on all approvers at the same time. If an approver returns an error from this method, the approver is assumed to be faulty.

If no approvers return from this method successfully (including situations where there are no matching approvers at all), the channel dispatcher SHOULD consider this to be an error, and recover by dispatching the channel to the most preferred handler.

Processes that aren't approvers (or don't at least ensure that there is some approver) probably shouldn't be making connections anyway, so there should always be at least one approver running.

The initial value of the ChannelDispatchOperation.Channels property, containing the Channels to be dispatched and their properties.

This can't be signalled to the approver through the Properties parameter of this method, because Channels is not an immutable property.

This argument always contains all of the channels in the channel dispatch operation, even if not all of them actually match the ApproverChannelFilter.

This seems the least bad way to handle such a situation; see the discussion on bug #21090.

The actual channels to be dispatched may reduce as channels are closed: this is signalled by ChannelDispatchOperation.ChannelLost.

Approvers SHOULD connect to ChannelLost and ChannelDispatchOperation.Finished. (if desired) before returning from AddDispatchOperation, since those signals are guaranteed not to be emitted until after all AddDispatchOperation calls have returned (with success or failure) or timed out.

The ChannelDispatchOperation to be processed.

Properties of the channel dispatch operation. The keys MUST be fully qualified D-Bus property names. This MUST NOT include properties that could change, SHOULD include as many properties as possible given that constraint, and MUST include at least the Account, Connection and PossibleHandlers properties.

telepathy-glib-0.24.2/spec/Call_Content_Interface_DTMF.xml0000644000175000017500000002513212652510705020253 00000000000000 Copyright © 2005-2010 Collabora Limited Copyright © 2005-2010 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) An interface that gives audio Contents the ability to send DTMF events which have been established using the Call1 channel type. The event codes used are in common with those defined in RFC4733, and are listed in the DTMF_Event enumeration. A numeric event code from the DTMF_Event enum.

Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until StopTone is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.

The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.

The event id was invalid. DTMF tones are already being played.
Stop sending any DTMF tones which have been started using the StartTone or MultipleTones methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal. On some protocols it might be impossible to cancel queued tones immediately. Continuous tones are not supported by this stream. Deprecated, since stream IDs are ignored.

A string representation of one or more DTMF events. Implementations of this method MUST support all of the following characters in this string:

  • the digits 0-9, letters A-D and a-d, and symbols '*' and '#' correspond to the members of DTMF_Event
  • any of 'p', 'P', 'x', 'X' or ',' (comma) results in an implementation-defined pause, typically for 3 seconds
  • 'w' or 'W' waits for the user to continue, by stopping interpretation of the string, and if there is more to be played, emitting the TonesDeferred signal with the rest of the string as its argument: see that signal for details

Send multiple DTMF events to all eligible streams in the channel. Each tone will be played for an implementation-defined number of milliseconds (typically 250ms), followed by a gap before the next tone is played (typically 100ms). The duration and gap are defined by the protocol or connection manager.

In cases where the client knows in advance the tone sequence it wants to send, it's easier to use this method than manually start and stop each tone in the sequence.

The tone and gap lengths may need to vary for interoperability, according to the protocol and other implementations' ability to recognise tones. At the time of writing, GStreamer uses a minimum of 250ms tones and 100ms gaps when playing in-band DTMF in the normal audio stream, or 70ms tones and 50ms gaps when encoding DTMF as audio/telephone-event.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.

The supplied Tones string was invalid. DTMF tones are already being played.
Indicates whether there are DTMF tones currently being sent in the channel. If so, the client should wait for StoppedTones signal before trying to send more tones.

The tones waiting for the user to continue, if any.

When this property is set to a non-empty value, TonesDeferred is emitted. When any tones are played (i.e. whenever SendingTones is emitted), this property is reset to the empty string.

The new non-empty value of DeferredTones.

Emitted when 'w' or 'W', indicating "wait for the user to continue", is encountered while playing a DTMF string queued by MultipleTones. Any queued DTMF events after the 'w', which have not yet been played, are placed in the DeferredTones property and copied into this signal's argument.

When the channel handler is ready to continue, it MAY pass the value of DeferredTones to MultipleTones, to resume sending. Alternatively, it MAY ignore the deferred tones, or even play different tones instead. Any deferred tones are discarded the next time a tone is played.

This signal SHOULD NOT be emitted if there is nothing left to play, i.e. if the 'w' was the last character in the DTMF string.

DTMF string (one or more events) that is to be played.

DTMF tone(s)are being sent to all eligible streams in the channel. The signal is provided to indicating the fact that the streams are currently being used to send one or more DTMF tones, so any other media input is not getting through to the audio stream. It also serves as a cue for the StopTone method.

True if the DTMF tones were actively cancelled via StopTone.

DTMF tones have finished playing on streams in this channel.

telepathy-glib-0.24.2/spec/Account_Interface_Addressing.xml0000644000175000017500000001014012652510705020624 00000000000000 Copyright © 2010 Collabora Ltd

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) The standard D-Bus PropertiesChanged signal is now used for URISchemes property change notifications.

Some accounts can be used for multiple protocols; for instance, SIP and Skype accounts can often be used to contact the PSTN, MSN and Yahoo accounts can contact each other, and XMPP accounts can potentially contact many protocols via a transport.

However, if the user does not intend to make use of this functionality, user interfaces can improve clarity by not displaying it: for instance, if a user prefers to call phone numbers via a particular SIP account, when an address book displays a contact with a phone number, it is desirable to display a "call with SIP" button for that account, but avoid displaying similar buttons for any other configured SIP or Skype accounts.

The purpose of this interface is to allow this "for use with" information to be recorded and retrieved.

A list of fields indicating the type of URI addressing scheme the the account should be used for (eg 'tel') indicating the account is intended for use by applications offering a telephony UI, or 'sip' or 'xmpp' for those protocols

Note that these fields signify intent, not ability: It is entirely possible that an account which can be used for a given URI scheme is not wanted for it by the user, and therefore not flagged as such in this field.

Change notification for this property is provided by the standard D-Bus PropertiesChanged signal.

Associate (or disassociate) an account with a particular URI addressing scheme, (such as 'tel' for telephony)

URI scheme to associate/disassociate the account with/from

True to associate this account with a given addressing scheme

False if the account should not be associated with said scheme

telepathy-glib-0.24.2/spec/Channel_Interface_Hold.xml0000644000175000017500000002255712652510705017422 00000000000000 Copyright (C) 2005-2008 Collabora Limited Copyright (C) 2005-2008 Nokia Corporation Copyright (C) 2006 INdT This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. first API-stable version

Interface for channels where you may put the channel on hold. This only makes sense for channels where you are streaming media to or from the members. (To see whether the other participant has put you on hold, see CallState.)

If you place a channel on hold, this indicates that you do not wish to be sent media streams by any of its members and will be ignoring any media streams you continue to receive. It also requests that the connection manager free up any resources that are only needed for an actively used channel (e.g. in a GSM or PBX call, it will be necessary to place an active call on hold before you can start another call).

This can also be used for putting a single Content on hold, if the protocol supports it (This interface is in the Channel namespace for historical reasons).

Return whether the local user has placed the channel on hold. The state of the channel The reason why the channel is in that state Emitted to indicate that the hold state has changed for this channel. This may occur as a consequence of you requesting a change with RequestHold, or the state changing as a result of a request from another process. The state of the channel The reason for the state change The hold state of a channel. All streams are unheld (the call is active). New channels SHOULD have this hold state. All streams are held (the call is on hold) The connection manager is attempting to move to state Held, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information. The connection manager is attempting to move to state Unheld, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information. The reason for a change to the Local_Hold_State. Clients MUST treat unknown values as equivalent to Local_Hold_State_Reason_None. The reason cannot be described by any of the predefined values (connection managers SHOULD avoid this reason, but clients MUST handle it gracefully) The change is in response to a user request The change is because some resource was not available A boolean indicating whether or not the channel should be on hold

Request that the channel be put on hold (be instructed not to send any media streams to you) or be taken off hold.

If the connection manager can immediately tell that the requested state change could not possibly succeed, this method SHOULD return the NotAvailable error. If the requested state is the same as the current state, this method SHOULD return successfully without doing anything.

Otherwise, this method SHOULD immediately set the hold state to Local_Hold_State_Pending_Hold or Local_Hold_State_Pending_Unhold (as appropriate), emitting HoldStateChanged if this is a change, and return successfully.

The eventual success or failure of the request is indicated by a subsequent HoldStateChanged signal, changing the hold state to Local_Hold_State_Held or Local_Hold_State_Unheld.

If the channel has multiple streams, and the connection manager succeeds in changing the hold state of one stream but fails to change the hold state of another, it SHOULD attempt to revert all streams to their previous hold states.

The following state transitions SHOULD be used, where appropriate:

  • Successful hold: (Unheld, any reason) → (Pending_Hold, Requested) → (Held, Requested)
  • Successful unhold: (Held, any reason) → (Pending_Unhold, Requested) → (Unheld, Requested)
  • Attempting to unhold fails at the first attempt to acquire a resource: (Held, any reason) → (Pending_Unhold, Requested) → (Held, Resource_Not_Available)
  • Attempting to unhold acquires one resource, but fails to acquire a second, and takes time to release the first: (Held, any reason) → (Pending_Unhold, Requested) → (Pending_Hold, Resource_Not_Available) → (Held, Resource_Not_Available)
The requested hold state cannot be achieved; for example, if only a limited number of channels can be in the "not on hold" state, attempts to exceed this number will raise NotAvailable.
telepathy-glib-0.24.2/spec/Channel_Dispatcher_Interface_Operation_List.xml0000644000175000017500000001332412652510705023625 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

This interface allows users of the ChannelDispatcher to enumerate all the pending dispatch operations, with change notification.

The existence of the DispatchOperations property allows a newly started approver to pick up existing dispatch operations.

This is on a separate interface so clients that aren't interested in doing this aren't woken up by its signals.

Details of a channel dispatch operation. The object path of the ChannelDispatchOperation.

Properties of the channel dispatch operation.

Connection managers MUST NOT include properties in this mapping if their values can change. Clients MUST ignore properties that appear in this mapping if their values can change.

The rationale is the same as for Channel_Details.

Each dictionary MUST contain at least the following keys:

  • org.freedesktop.Telepathy.ChannelDispatchOperation.Interfaces
  • org.freedesktop.Telepathy.ChannelDispatchOperation.Connection
  • org.freedesktop.Telepathy.ChannelDispatchOperation.Account
  • org.freedesktop.Telepathy.ChannelDispatchOperation.PossibleHandlers

The list of ChannelDispatchOperation objects currently being processed. Change notification is via the NewDispatchOperation and DispatchOperationFinished signals.

Emitted when a dispatch operation is added to DispatchOperations.

The dispatch operation that was created. The same properties that would appear in the Properties member of Dispatch_Operation_Details.
Emitted when a dispatch operation finishes (i.e. exactly once per emission of ChannelDispatchOperation.Finished). Strictly speaking this is redundant with ChannelDispatchOperation.Finished, but it provides full change-notification for the DispatchOperations property. The dispatch operation that was closed.
telepathy-glib-0.24.2/spec/Channel_Interface_Tube.xml0000644000175000017500000003366612652510705017436 00000000000000 Copyright © 2008-2009 Collabora Limited Copyright © 2008-2009 Nokia Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A tube is a mechanism for arbitrary data transfer between two or more IM users, used to allow applications on the users' systems to communicate without having to establish network connections themselves. Currently, two types of tube exist: Channel.Type.DBusTube and Channel.Type.StreamTube. This interface contains the properties, signals and methods common to both types of tube; you can only create channels of a specific tube type, not of this type. A tube channel contains exactly one tube; if you need several tubes, you have to create several tube channels.

Tube channels can be requested for Handle_Type Contact (for 1-1 communication) or Room (to communicate with others in the room simultaneously).

As an exception to the usual handling of capabilities, connection managers for protocols with capability discovery (such as XMPP) SHOULD advertise the capability representing each Tube type that they support (Channel.Type.DBusTube and/or Channel.Type.StreamTube) even if no client has indicated via UpdateCapabilities that such a tube is supported. They SHOULD also allow clients to offer tubes with any Service or ServiceName to any contact which supports the corresponding tube capability.

This lowers the barrier to entry for those writing new tube applications, and preserves interoperability with older versions of the Telepathy stack which did not support rich capabilities.

Each tube has a dictionary of arbitrary parameters. Parameters are commonly used to bootstrap legacy protocols where you can't negotiate parameters in-band. The allowable keys, types and values are defined by the service, but connection managers must support the value being a string (D-Bus type 's'), array of bytes (D-Bus type 'ay'), unsigned integer (D-Bus type 'u'), integer (D-Bus type 'i') and boolean (D-Bus type 'b').

When the tube is offered, the parameters are transmitted with the offer and appear as a property of the incoming tube for other participants.

For example, a stream tube for Service "smb" (Server Message Block over TCP/IP) might use the following properties, as defined in DNS SRV (RFC 2782) Service Types:

{ 'u': 'some-username',
  'p': 'top-secret-password',
  'path': '/etc/passwd',
}

When requesting a tube with CreateChannel, this property MUST NOT be included in the request; instead, it is set when StreamTube.Offer or DBusTube.Offer (as appropriate) is called. Its value is undefined until the tube is offered; once set, its value MUST NOT change.

When receiving an incoming tube, this property is immutable and so advertised in the NewChannels signal.

State of the tube in this channel.

When requesting a tube with CreateChannel, this property MUST NOT be included in the request.

The initiator offered the tube. The tube is waiting to be accepted/closed locally. If the client accepts the tube, the tube's state will be Open. The tube is waiting to be accepted/closed remotely. If the recipient accepts the tube, the tube's state will be Open. The initiator offered the tube and the recipient accepted it. The tube is open for traffic. The tube's state stays in this state until it is closed. The tube channel has been requested but the tube is not yet offered. The client should offer the tube to the recipient and the tube's state will be Remote_Pending. The method used to offer the tube depends on the tube type. Emitted when the state of the tube channel changes. Valid state transitions are documented with Tube_Channel_State. The new state of the tube. A Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket. An abstract Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket including the leading null byte. An IPv4 socket. The address variant contains a Socket_Address_IPv4, i.e. a structure with signature (sq) in which the string is an IPv4 dotted-quad address literal (and must not be a DNS name), while the 16-bit unsigned integer is the port number. An IPv6 socket. The address variant contains a Socket_Address_IPv6, i.e. a structure with signature (sq) in which the string is an IPv6 address literal as specified in RFC2373 (and must not be a DNS name), while the 16-bit unsigned integer is the port number.

The IP or Unix socket can be accessed by any local user (e.g. a Unix socket that accepts all local connections, or an IP socket listening on 127.0.0.1 (or ::1) or rejecting connections not from that address). The associated variant must be ignored.

For a D-Bus tube, this means that the "same user" access control typically provided by default in D-Bus implementations SHOULD be disabled. If the socket is only available to local users (e.g. a Unix socket, an IPv4 socket bound to 127.0.0.1, or an IPv6 socket bound to ::1), the ANONYMOUS authentication mechanism MAY be enabled.

May only be used on IP sockets, and only for Stream tubes. The associated variant must contain a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the string form of an IP address of the appropriate version, and a port number. The socket can only be accessed if the connecting process has that address and port number; all other connections will be rejected. This has never been implemented. If you want to share a service to your whole LAN, Telepathy is not the way to do it. May only be used on IP sockets. The associated variant must contain a struct Socket_Netmask_IPv4 (or Socket_Netmask_IPv6) with signature (sy), containing the string form of an IP address of the appropriate version, and a prefix length "n". The socket can only be accessed if the first n bits of the connecting address match the first n bits of the given address.

The high-level meaning of this access control type is that only the same user (e.g. same numeric Unix uid) is allowed to interact with the tube. Exactly how this is achieved varies by channel type.

For StreamTube channels, this access control type may only be used on UNIX sockets. The connecting process must send a byte when it first connects, which is not considered to be part of the data stream. If the operating system uses sendmsg() with SCM_CREDS or SCM_CREDENTIALS to pass credentials over sockets, the connecting process must do so if possible; if not, it must still send the byte, without any attached credentials. (This mechanism is very similar to the first byte of a D-Bus connection, except that in D-Bus the byte is always zero, whereas in Tubes it can be nonzero.)

For DBusTube channels, this access control type may be used on any type of socket, and there is no extra byte added by Telepathy at the beginning of the stream: all bytes in the stream are part of the D-Bus tube connection. The connecting process should prove its identity via any of the SASL authentication mechanisms usually used for D-Bus (in typical D-Bus implementations this involves either sending and receiving credentials as above, or demonstrating the ability to write to a file in the user's home directory).

In either case, the listening process will disconnect the connection unless it can determine by OS-specific means that the connecting process has the same user ID as the listening process.

In either tube type, the associated variant must be ignored.

telepathy-glib-0.24.2/spec/Channel_Interface_Transfer.xml0000644000175000017500000000472112652510705020311 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The handle of the member to transfer The handle of the destination contact Request that the given channel member instead connects to a different contact ID. An interface for channels where you may request that one of the members connects to somewhere else instead.
telepathy-glib-0.24.2/spec/Connection_Interface_Contact_Capabilities.xml0000644000175000017500000003465412652510705023330 00000000000000 Copyright (C) 2005, 2006, 2008 Collabora Limited Copyright (C) 2005, 2006, 2008 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

Contact capabilities describe the channel classes which may be created with a given contact in advance of attempting to create a channel. Each capability represents a commitment by the connection manager that it will ordinarily be able to create a channel with a contact when given a request with the properties defined by the channel class.

Capabilities pertain to particular contact handles, and represent activities such as having a text chat, a voice call with the user or a stream tube of a defined type.

This interface also enables user interfaces to notify the connection manager what capabilities to advertise for the user to other contacts. This is done by using the UpdateCapabilities method.

XMPP is a major user of this interface: XMPP contacts will not, in general, be callable using VoIP unless they advertise suitable Jingle capabilities.

Many other protocols also have some concept of capability flags, which this interface exposes in a protocol-independent way.

A structure representing the capabilities of a single client. For implementations of the Client interface, the well-known bus name name of the client; for any other process, any other reversed domain name that uniquely identifies it. An array of channel classes that can be handled by this client. This will usually be a copy of the client's HandlerChannelFilter property. An array of client capabilities supported by this client, to be used by the connection manager to determine what capabilities to advertise. This will usually be a copy of the client's Capabilities property.

Alter the connection's advertised capabilities to include the intersection of the given clients' capabilities with what the connection manager is able to implement.

On connections managed by the ChannelDispatcher, processes other than the ChannelDispatcher SHOULD NOT call this method, and the ChannelDispatcher SHOULD use this method to advertise the capabilities of all the registered Client.Handler implementations.On connections not managed by the ChannelDispatcher, clients MAY use this method directly, to indicate the channels they will handle and the extra capabilities they have.

Upon a successful invocation of this method, the connection manager will only emit the ContactCapabilitiesChanged signal for the user's SelfHandle if, in the underlying protocol, the new capabilities are distinct from the previous state.

The connection manager will essentially intersect the provided capabilities and the channel classes it implements. Therefore, certain properties which are never fixed for a channel class (such as the target handle, or the Parameters property of a tube channel) will almost certainly not be advertised.

This method MAY be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the appropriate capabilities. Doing so MUST NOT fail.

The capabilities of one or more clients.

For each client in the given list, any capabilities previously advertised for the same client name are discarded, then replaced by the capabilities indicated.

As a result, if a client becomes unavailable, this method SHOULD be called with a Handler_Capabilities structure containing its name, an empty list of channel classes, and an empty list of capabilities. When this is done, the connection manager SHOULD free all memory associated with that client name.

This method takes a list of clients so that when the channel dispatcher first calls it (with a list of all the Handlers that are initially available), the changes can be made atomically, with only one transmission of updated capabilities to the network. Afterwards, the channel dispatcher will call this method with a single-element list every time a Handler becomes available or unavailable.

The connection manager MUST ignore any channel classes and client capabilities for which there is no representation in the protocol or no support in the connection manager.

An array of contact handles for this connection.

The handle zero MUST NOT be included in the request.

A map from contact handles to lists of requestable channel classes, representing the channel requests that are expected to succeed for that contact.

Contacts listed among Handles whose capabilities are unknown SHOULD be omitted from this map; contacts known to have an empty set of capabilities SHOULD be included in the keys of this map, with an empty array as the corresponding value.

Returns an array of requestable channel classes for the given contact handles, representing the channel requests that are expected to succeed.

The handle does not represent a contact. Zero is always invalid.
All the capabilities of the contacts

Announce that there has been a change of capabilities on the given handles. A single signal can be emitted for several contacts.

The underlying protocol can get several contacts' capabilities at the same time.

A mapping from contact handle to their capabilities. A contact handle.

The contact's capabilities. These should be represented in the same way as in RequestableChannelClasses, except that they may have more fixed properties or fewer allowed properties, to represent contacts who do not have all the capabilities of the connection.

In particular, requestable channel classes for channels with target handle type Contact MUST list TargetHandleType among their fixed properties when they appear here, and clients MAY assume that this will be the case.

This matches the initial implementations - service-side in telepathy-gabble, and client-side in telepathy-qt4 - and means that clients can use exactly the same code to interpret RequestableChannelClasses and contact capabilities.

Channel classes with target handle type Handle_Type_Contact indicate that a request that matches the channel class, and also either has the contact's handle as TargetHandle or the contact's identifier as TargetID, can be expected to succeed. Connection managers SHOULD NOT include the TargetHandle or TargetID as a fixed property in contact capabilities.

This makes one channel class sufficient to describe requests via TargetHandle or TargetID, and is necessary in order to allow clients to interpret RequestableChannelClasses and contact capabilities with the same code.

Channel classes with target handle type Handle_Type_Room or Handle_Type_None indicate that if a channel matching the channel class is created, then inviting the contact to that channel can be expected to succeed.

To support room-based XMPP protocols like Muji and MUC Tubes, it's necessary to be able to discover who can be invited to a given room channel; most XMPP contacts won't support being invited into a Muji conference call, at least in the short to medium term.

No interpretation is defined for channel classes with any other target handle type, or for channel classes that do not fix a target handle type, in this version of the Telepathy specification.

The same structs that would be returned by GetContactCapabilities. Omitted from the result if the contact's capabilities are not known; present in the result as an empty array if the contact is known to have no capabilities at all.

telepathy-glib-0.24.2/spec/Connection_Manager.xml0000644000175000017500000007311212652510705016646 00000000000000 Copyright (C) 2005-2012 Collabora Limited Copyright (C) 2005-2008 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The name of a connection manager, found in its well-known bus name and object path. This must be a non-empty string of ASCII letters, digits and underscores, starting with a letter. This is typically the name of the executable with any "telepathy-" prefix removed, and any hyphen/minus signs replaced by underscores.

Connection manager names SHOULD NOT be the same as the name of the protocol they implement.

This is likely to lead to conflicts between different implementations of the same protocol (or indeed inability to distinguish between the different implementations!). The Telepathy project traditionally uses some sort of pun (Haze is based on libpurple, Salut implements a protocol often called Bonjour, and Wilde implements the OSCAR protocol).

Connection manager names SHOULD NOT be the same as the name of a library on which they are based.

We often abbreviate, for instance, telepathy-haze as “Haze”, but abbreviating telepathy-sofiasip—since renamed to telepathy-rakia for exactly this reason—to “Sofia-SIP” caused confusion between the connection manager and the library it uses. Please don't repeat that mistake.

Prior to version 0.17.1, the allowed characters were not specified

An instant messaging protocol. It must consist only of ASCII letters, digits and hyphen/minus signs (U+002D "-"), and must start with a letter. Where possible, this SHOULD be chosen from the following well-known values:

  • aim - AOL Instant Messenger (OSCAR or TOC)
  • gadugadu - Gadu-Gadu
  • groupwise - Novell Groupwise
  • icq - ICQ (OSCAR)
  • irc - Internet Relay Chat (RFC 1459, 2810-2813)
  • jabber - XMPP (RFC 3920, 3921) or Jabber
  • local-xmpp - Link-local XMPP (XEP-0174) (Bonjour, Salut)
  • msn - MSNP (Windows Live Messenger)
  • myspace - MySpaceIM
  • mxit - MXit
  • napster - Napster
  • qq - Tencent QQ
  • sametime - IBM Lotus Sametime
  • silc - SILC
  • sip - Session Initiation Protocol (SIP), with or without SIMPLE support
  • skype - Skype
  • tel - telephony (the PSTN, including GSM, CDMA and fixed-line telephony)
  • trepia - Trepia
  • yahoo - YMSG (Yahoo! Messenger)
  • yahoojp - Japanese version of YMSG
  • zephyr - Zephyr
Prior to version 0.17.1, the allowed characters were not specified
A struct representing an allowed parameter, as returned by GetParameters on the ConnectionManager interface. A string parameter name A bitwise OR of the parameter flags A string containing the D-Bus type signature for this parameter The default value (if the Has_Default flag is not present, there is no default and this takes some dummy value, which SHOULD be of the appropriate D-Bus type) This parameter is required for connecting to the server. This parameter is required for registering an account on the server. This parameter has a default value, which is returned in GetParameters; not providing this parameter is equivalent to providing the default.

This parameter should be considered private or secret; for instance, clients should store it in a "password safe" like gnome-keyring or kwallet, omit it from debug logs, and use a text input widget that hides the value of the parameter.

(Clients that support older connection managers may also treat any parameter whose name contains "password" as though it had this flag.)

This parameter is also a D-Bus property on the resulting Connection; a parameter named com.example.Duck.Macaroni with this flag corresponds to the Macaroni property on the com.example.Duck interface. Its value can be queried and possibly changed on an existing Connection using methods on the org.freedesktop.DBus.Properties interface.

When a new value for a parameter with this flag is passed to Account.UpdateParameters, the account manager will attempt to update its value on any running connections. Similarly, if the parameter also has the Has_Default flag, and is passed in the second argument to UpdateParameters, the default value will be applied to any running connections. Thus, clients generally do not need to directly access or update the connection property; instead, they SHOULD manipulate Account.Parameters.

This allows runtime-configurable options to be stored and maintained by the AccountManager, without needing to invent a separate account preference for “properties that should be set on the connection as soon as it is created”. It was originally invented to manage Cellular preferences.

The required protocol name An array of structs representing possible parameters. Get a list of the parameters which may be specified in the Parameters of an Account (or, for specialised applications which do not use the account manager, passed to RequestConnection). Some parameters are mandatory, and some parameters only make sense when registering new accounts with the server; see the Param_Spec documentation for more details. The requested protocol is not supported by this manager

A map from protocol identifiers supported by a connection manager to the immutable properties of the corresponding Protocol objects.

A protocol name The immutable properties of the corresponding Protocol object

A map from protocol identifiers supported by this connection manager to the immutable properties of the corresponding Protocol objects.

Providing the immutable properties here means that when the API of Protocol objects has been finalized, most clients will only need one D-Bus round trip to interrogate the ConnectionManager about all its protocols.

If this map is empty or missing, clients SHOULD fall back to calling ListProtocols and GetParameters.

The keys of the Protocols map. Get a list of protocol identifiers that are implemented by this connection manager. The D-Bus service where the connection object can be found The object path of the Connection object on this service The identifier for the protocol this connection uses Emitted when a new Connection object is created. The protocol identifier A dictionary mapping parameter names to values of the appropriate type, as indicated by GetParameters and the well-known list of names and value types documented on the Connection_Parameter_Name type. A D-Bus service name where the new Connection object can be found The D-Bus object path to the Connection on this service

Request a Connection object representing a given account on a given protocol with the given parameters. The method returns the bus name and the object path where the new Connection object can be found, which should have the status of Connection_Status_Disconnected, to allow signal handlers to be attached before connecting is started with the Connect method.

Most applications should not use this method: they should instead use the the Connection property on an Account object obtained from the AccountManager. This method is used internally by the account manager to create connections when needed.

The parameters which must and may be provided in the parameters dictionary can be discovered with the GetParameters method. These parameters, their types, and their default values may be cached in files so that all available connection managers do not need to be started to discover which protocols are available.

To request values for these parameters from the user, a client must have prior knowledge of the meaning of the parameter names, so the well-known names and types defined by the Connection_Parameter_Name type should be used where appropriate.

Connection manager authors SHOULD avoid introducing parameters whose default values would not be serializable in a .manager file.

The same serialization format is used in Mission Control to store accounts.

Every successful RequestConnection call will cause the emission of a NewConnection signal for the same newly created connection. The requester can use the returned object path and service name independently of the emission of that signal. In that case this signal emission is most useful for, e.g. other processes that are monitoring the creation of new connections.

The requested protocol is not supported by this manager The requested connection already appears to exist Unrecognised connection parameters

Well-known connection parameter names, along with their expected type. Where possible, connection managers should use names and types from this list in the Parameters that may be passed to RequestConnection.

account (s)
The identifier for the user's account on the server
server (s)
A fully qualified domain name or numeric IPv4 or IPv6 address. Using the fully-qualified domain name form is recommended whenever possible. If this parameter is specified and the account for that protocol also specifies a server, this parameter should override that in the user id.
port (q)
A TCP or UDP port number. If this parameter is specified and the account for that protocol also specifies a port, this parameter should override that in the account.
password (s)
A password associated with the account.
require-encryption (b)
Require encryption for this connection. A connection should fail to connect if require-encryption is set and an encrypted connection is not possible.
register (b)
This account should be created on the server if it does not already exist.
ident (s)
The local username to report to the server if necessary, such as in IRC.
fullname (s)
The user's full name if the service requires this when authenticating or registering.
stun-server (s)
The IP address or FQDN of a STUN server to use for NAT traversal, without any ":port" suffix.
stun-port (q)
The UDP port number on the stun-server to use for STUN. Only significant if the stun-server is also supplied.
keepalive-interval (u)

The time in seconds between pings sent to the server to ensure that the connection is still alive, or 0 to disable such pings.

This parameter is superseded by the KeepaliveInterval property, which can be updated on an already-established connection as well as being specified when requesting the connection. Clients SHOULD provide that parameter instead, if allowed; new connection managers SHOULD implement it in preference to this one.

The following well-known parameter names correspond to D-Bus properties, and thus their Conn_Mgr_Param_Flags should include DBus_Property. See that flag for more details on this kind of parameter.

A list of the extra interfaces provided by this connection manager (i.e. extra functionality that can be provided even before a connection has been created).

No interfaces suitable for listing in this property are currently defined; it's provided as a hook for possible future functionality.

To be compatible with older connection managers, if retrieving this property fails, clients SHOULD assume that its value is an empty list.

Connection managers with a non-empty list of Interfaces MUST represent them in the .manager file, if they have one, as an Interfaces key in the group headed [ConnectionManager], whose value is a list of strings each followed by a semicolon.

A D-Bus service which allows connections to be created. The manager processes are intended to be started by D-Bus service activation.

For service discovery, each Telepathy connection manager must have a connection manager name (see Connection_Manager_Name for syntax).

The connection manager must then provide a well-known bus name of org.freedesktop.Telepathy.ConnectionManager.cmname where cmname is its connection manager name. If it makes sense to start the connection manager using D-Bus service activation, it must register that well-known name for service activation by installing a .service file.

Clients can list the running connection managers by calling the ListNames method on the D-Bus daemon's org.freedesktop.DBus interface and looking for names matching the above pattern; they can list the activatable connection managers by calling ListActivatableNames, and they should usually combine the two lists to get a complete list of running or activatable connection managers.

When the connection manager is running, it must have an object implementing the ConnectionManager interface at the object path /org/freedesktop/Telepathy/ConnectionManager/cmname.

Connection managers' capabilities can be determined dynamically by calling their ListProtocols method, then for each protocol of interest, calling GetParameters to discover the required and optional parameters. However, since it is inefficient to activate all possible connection managers on the system just to find out what they can do, there is a standard mechanism to store static information about CMs in ".manager files".

To look up a connection manager's supported protocols, clients should search the data directories specified by the freedesktop.org XDG Base Directory Specification ($XDG_DATA_HOME, defaulting to $HOME/.local/share if unset, followed by colon-separated paths from $XDG_DATA_DIRS, defaulting to /usr/local/share:/usr/share if unset) for the first file named telepathy/managers/cmname.manager that can be read without error. This file has the same syntax as a freedesktop.org Desktop Entry file.

Clients must still support connection managers for which no .manager file can be found, which they can do by activating the connection manager and calling its methods; the .manager file is merely an optimization. Connection managers whose list of protocols can change at any time (for instance, via a plugin architecture) should not install a .manager file.

The .manager file SHOULD have a group headed [ConnectionManager], containing a key Interfaces representing Interfaces as a sequence of strings each followed by a semicolon (the "localestrings" type from the Desktop Entry Specification).

The [ConnectionManager] group SHOULD NOT contain keys ObjectPath or BusName. If it does, they MUST be ignored.

The object path and bus name are derivable from the connection manager's name, which is part of the filename, so these keys are redundant. They were required in very old versions of Telepathy.

For each protocol name proto that would be returned by ListProtocols, the .manager file contains a group headed [Protocol proto]. For each parameter p that would be returned by GetParameters(proto), the .manager file contains a key param-p with a value consisting of a D-Bus signature (a single complete type), optionally followed by a space and a space-separated list of flags. The supported flags are:

  • required, corresponding to Conn_Mgr_Param_Flag_Required
  • register, corresponding to Conn_Mgr_Param_Flag_Register
  • secret, corresponding to Conn_Mgr_Param_Flag_Secret
  • dbus-property, corresponding to Conn_Mgr_Param_Flag_DBus_Property

The group may also contain a key default-p whose value is a string form of the default value for the parameter. If this key exists, it sets the default, and also sets the flag Conn_Mgr_Param_Flag_Has_Default. The default value is formatted according to the D-Bus signature as follows:

s (string)
The UTF-8 string, with the standard backslash escape sequences supported by the Desktop Entry Specification (the "localestring" type from the Desktop Entry Specification)
o (object path)
The object path as an ASCII string
b (boolean)
"true" (case-insensitively) or "1" means True, "false" (case-insensitively) or "0" means False; when writing a file, "true" and "false" SHOULD be used
y, q, u, t (8-, 16-, 32-, 64-bit unsigned integer)
ASCII decimal integer
n, i, x (16-, 32-, 64-bit signed integer)
ASCII decimal integer, optionally prefixed with "-"
d (double-precision floating point)
ASCII decimal number
as (array of string), ao (array of object path)
A sequence of UTF-8 strings each followed by a semicolon, with any semicolons they contain escaped with a backslash (the "localestrings" type from the Desktop Entry Specification)

Currently, no other D-Bus signatures are allowed to have default values, but clients parsing the .manager file MUST ignore defaults that they cannot parse, and treat them as if the default-p key was not present at all.

It is not required that a connection manager be able to support multiple protocols, or even multiple connections. When a connection is made, a service name where the connection object can be found is returned. A manager which can only make one connection may then remove itself from its well-known bus name, causing a new connection manager to be activated when somebody attempts to make a new connection.

Prior to version 0.17.2, support for CMs with no .manager file was not explicitly required. Prior to version 0.17.16 the serialization of string arrays (signature 'as') was not defined Prior to version 0.25.2 the serialization of object-path arrays (signature 'ao') was not defined
telepathy-glib-0.24.2/spec/Channel_Dispatcher.xml0000644000175000017500000010270612652510705016635 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

The channel dispatcher is responsible for responding to new channels and launching client processes to handle them. It also provides functionality for client processes to request that new channels are created.

If a channel dispatcher is running, it is responsible for dispatching new channels on all Connections created by the AccountManager. Connections not created by the AccountManager are outside the scope of the channel dispatcher.

Connections created by standalone Telepathy clients that do not intend to interact with the channel dispatcher should be ignored - otherwise, the channel dispatcher would try to launch handlers for channels that the standalone client was already handling internally.

The current channel dispatcher is defined to be the process that owns the well-known bus name org.freedesktop.Telepathy.ChannelDispatcher on the session bus. This process MUST export an object with this interface at the object path /org/freedesktop/Telepathy/ChannelDispatcher.

Until a mechanism exists for making a reasonable automatic choice of ChannelDispatcher implementation, implementations SHOULD NOT register as an activatable service for the ChannelDispatcher's well-known bus name. Instead, it is RECOMMENDED that some component of the user's session will select and activate a particular implementation, and that other Telepathy-enabled programs can detect whether channel request/dispatch functionality is available by checking whether the ChannelDispatcher's well-known name is in use at runtime.

There are three categories of client process defined by this specification:

Observer

Observers monitor the creation of new channels. This functionality can be used for things like message logging. All observers are notified simultaneously.

Approver

Approvers notify the user that new channels have been created, and also select which channel handler will be used for the channel, either by asking the user or by choosing the most appropriate channel handler.

Handler

Each new channel or set of channels is passed to exactly one handler as its final destination. A typical channel handler is a user interface process handling channels of a particular type.

A list of the extra interfaces provided by this channel dispatcher.

Equivalent to calling CreateChannelWithHints with an empty Hints parameter.

The Account for which the new channel is to be created.

A dictionary containing desirable properties.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

Previously, the spec didn't say that this should disregard the handler's filter. This has been implemented since telepathy-mission-control 5.3.2.
A ChannelRequest object. The Preferred_Handler is syntactically invalid or does not start with org.freedesktop.Telepathy.Client., the Account does not exist, or one of the Requested_Properties is invalid

Equivalent to calling EnsureChannelWithHints with an empty Hints parameter.

The Account for which the new channel is to be created.

A dictionary containing desirable properties.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to EnsureChannelWithHints.

A ChannelRequest object. The Preferred_Handler is syntactically invalid or does not start with org.freedesktop.Telepathy.Client., the Account does not exist, or one of the Requested_Properties is invalid
Support for this method is indicated by the SupportsRequestHints property. Clients MUST recover from this method being unsupported by falling back to CreateChannel.

Start a request to create a channel. This initially just creates a ChannelRequest object, which can be used to continue the request and track its success or failure.

The request can take a long time - in the worst case, the channel dispatcher has to ask the account manager to put the account online, the account manager has to ask the operating system to obtain an Internet connection, and the operating system has to ask the user whether to activate an Internet connection using an on-demand mechanism like dialup.

This means that using a single D-Bus method call and response to represent the whole request will tend to lead to that call timing out, which is not the behaviour we want.

If this method is called for an Account that is disabled, invalid or otherwise unusable, no error is signalled until ChannelRequest.Proceed is called, at which point ChannelRequest.Failed is emitted with an appropriate error.

This means there's only one code path for errors, apart from InvalidArgument for "that request makes no sense".

It also means that the request will proceed if the account is enabled after calling CreateChannel, but before calling Proceed.

The Account for which the new channel is to be created.

A dictionary containing desirable properties. This has the same semantics as the corresponding parameter to Connection.Interface.Requests.CreateChannel.

Certain properties will not necessarily make sense in this dictionary: for instance, TargetHandle can only be given if the requester is able to interact with a Connection to the desired account.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action. The UserActionTime property will be set to this value, and it will eventually be passed as the User_Action_Time parameter of HandleChannels.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The channel dispatcher SHOULD dispatch as many as possible of the resulting channels (ideally, all of them) to that handler—irrespective of whether that handler's HandlerChannelFilter matches the channel—and SHOULD remember the preferred handler so it can try to dispatch subsequent channels in the same bundle to the same handler.

This must be the well-known bus name, not the unique name, to ensure that all handlers do indeed have the Client API, and the Client object on the handler can be located easily.

This is partly so the channel dispatcher can call HandleChannels on it, and partly so the channel dispatcher can recover state if it crashes and is restarted.

The filter should be disregarded for ease of use of this interface: clients will usually use this argument to request channels be sent to themself, and this should trump the filter not matching. This also allows a client to become the handler for a channel produced by one of its own requests, while not being a candidate to handle other channels of that type.

If this is a well-known bus name and the handler has the Requests interface, the channel dispatcher SHOULD call AddRequest on that Handler after this method has returned.

This ordering allows a Handler which calls CreateChannel with itself as the preferred handler to associate the call to AddRequest with that call.

This is copied to the ChannelRequest that is returned, as the PreferredHandler property.

Previously, the spec didn't say that this should disregard the handler's filter. This has been implemented since telepathy-mission-control 5.3.2.

Additional information about the channel request, which will be used as the value for the resulting request's Hints property.

See the Hints property's documentation for rationale.

A ChannelRequest object. The Preferred_Handler is syntactically invalid or does not start with org.freedesktop.Telepathy.Client., the Account does not exist, or one of the Requested_Properties is invalid
Support for this method is indicated by the SupportsRequestHints property. Clients MUST recover from this method being unsupported by falling back to EnsureChannel.

Start a request to ensure that a channel exists, creating it if necessary. This initially just creates a ChannelRequest object, which can be used to continue the request and track its success or failure.

If this method is called for an Account that is disabled, invalid or otherwise unusable, no error is signalled until ChannelRequest.Proceed is called, at which point ChannelRequest.Failed is emitted with an appropriate error.

The rationale is as for CreateChannelWithHints.

The Account for which the new channel is to be created.

A dictionary containing desirable properties. This has the same semantics as the corresponding parameter to Connection.Interface.Requests.EnsureChannel.

Certain properties will not necessarily make sense in this dictionary: for instance, TargetHandle can only be given if the requester is able to interact with a Connection to the desired account.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred handler for this channel, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to CreateChannelWithHints, except as noted here.

If any new channels are created in response to this request, the channel dispatcher SHOULD dispatch as many as possible of the resulting channels (ideally, all of them) to that handler, and SHOULD remember the preferred handler so it can try to dispatch subsequent channels in the same bundle to the same handler. If the requested channel already exists (that is, Connection.Interface.Requests.EnsureChannel returns Yours=False) then the channel dispatcher SHOULD re-dispatch the channel to its existing handler, and MUST NOT dispatch it to this client (unless it is the existing handler); the request is still deemed to have succeeded in this case.

An address book application, for example, might call EnsureChannel to ensure that a text channel with a particular contact is displayed to the user; it does not care whether a new channel was made. An IM client might call EnsureChannel in response to the user double-clicking an entry in the contact list, with itself as the Preferred_Handler; if the user already has a conversation with that contact in another application, they would expect the existing window to be presented, rather than their double-click leading to an error message. So the request should succeed, even if its Preferred_Handler is not used.

Additional information about the channel request, which will be used as the value for the resulting request's Hints property. A ChannelRequest object. The Preferred_Handler is syntactically invalid or does not start with org.freedesktop.Telepathy.Client., the Account does not exist, or one of the Requested_Properties is invalid
Implemented since telepathy-mission-control 5.7.12. This method now returns Delegated and Not_Delegated instead of nothing. HandleChannels is now called once per Channel in Channels.

Called by a Handler to redispatch a bunch of channels it is currently handling.

For each Channel in Channels, if another Handler can be found, HandleChannels will be called on it until a Handler accepts it.

This method returns once all the Channels have either been accepted or rejected by Handlers.

If this method fails, the original Handler is still handling the channels.

The list of channels to redispatch. The caller has to be the current Handler of all of these channels

The time at which user action occurred, or 0 if this channels delegation is for some reason not involving user action.

This parameter is used in the same way as the corresponding parameter to CreateChannelWithHints.

Either the well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the preferred new handler for these channels, or an empty string to indicate that any handler would be acceptable. The behaviour and rationale are the same as for the corresponding parameter to CreateChannelWithHints.

The list of channels which have been delegated; the caller is no longer handling these channels.

The client should remove these channels from its HandledChannels property.

The list of channels which have NOT been delegated; the caller is still handling these channels.

The Preferred_Handler is syntactically invalid or does not start with org.freedesktop.Telepathy.Client.. At least one Channel in Channels is not currently handled by the caller. No Channel has been delegated.
A mapping associating not delegated channel with an error. The path of the channel An error describing why the channel has not be delegated the name of a D-Bus error describing what went wrong. a human-readable informative error message. Implemented since telepathy-mission-control 5.7.12.

Equivalent of calling EnsureChannel with a Requested_Properties which would result in ensuring Channel.

If Channel is handled, its handler will be asked to present it the user (e.g. bring it into the foreground).

The channel to present.

The time at which user action occurred, or 0 if this channel request is for some reason not involving user action.

This parameter is used in the same way as the corresponding parameter to EnsureChannelWithHints.

The Account does not exist, the Channel does not exist or it does not belong to the Account.
If True, the channel dispatcher is new enough to support CreateChannelWithHints and EnsureChannelWithHints, in addition to the older CreateChannel and EnsureChannel methods, and also new enough to emit SucceededWithChannel before the older Succeeded signal. If False or missing, only the metadata-less variants are supported.
telepathy-glib-0.24.2/spec/Account_Manager_Interface_Hidden.xml0000644000175000017500000000774312652510705021405 00000000000000 Copyright © 2010 Collabora Ltd. Copyright © 2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface lists accounts whose Hidden property is True.

first draft A list of valid (complete, usable) Accounts intended exclusively for noninteractive applications. These accounts are not included in AccountManager.ValidAccounts. Change notification is via HiddenAccountValidityChanged. A list of incomplete or otherwise unusable Accounts intended exclusively for noninteractive applications. Change notification is via HiddenAccountValidityChanged. The given account has been removed from ValidHiddenAccounts or InvalidHiddenAccounts. An Account, which must not be used any more. The validity of the given account has changed. New magic accounts are also indicated by this signal, as an account validity change (usually to True) on an account that did not previously exist. This is effectively change notification for the valid and invalid accounts lists. An Account. True if the account is now valid.
telepathy-glib-0.24.2/spec/Channel_Interface_Call_State.xml0000644000175000017500000001374012652510705020541 00000000000000 Copyright (C) 2008 Collabora Limited Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

An interface for streamed media channels that can indicate call progress or call states. The presence of this interface is no guarantee that call states will actually be signalled (for instance, SIP implementations are not guaranteed to generate status 180 Ringing, so a call can be accepted without the Ringing flag ever having been set; similarly, Jingle implementations are not guaranteed to send <ringing/>).

To notify the other participant in the call that they are on hold, see Hold.

Get the current call states for all contacts involved in this call. The current call states. Participants where the call state flags would be 0 (all unset) may be omitted from this mapping. Emitted when the state of a member of the channel has changed. An integer handle for the contact. The new state for this contact. A map from contacts to call states. A contact involved in this call. State flags for the given contact. A set of flags representing call states. The contact has been alerted about the call but has not responded (e.g. 180 Ringing in SIP). The contact is temporarily unavailable, and the call has been placed in a queue (e.g. 182 Queued in SIP, or call-waiting in telephony). The contact has placed the call on hold, and will not receive media from the local user or any other participants until they unhold the call again. The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted. Progress has been made in placing the outgoing call, but the destination contact may not have been made aware of the call yet (so the Ringing state is not appropriate). This corresponds to SIP's status code 183 Session Progress, and could be used when the outgoing call has reached a gateway, for instance. This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact.
telepathy-glib-0.24.2/spec/Channel_Interface_Splittable.xml0000644000175000017500000000604412652510705020630 00000000000000 Copyright © 2009 Collabora Limited Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for channels that can be made conceptually part of a Conference, and can then be detached from that conference.

This interface addresses part of freedesktop.org bug #24906 (GSM-compatible conference calls). GSM is currently the only protocol known to implement this; PBXs might implement it too.

Request that this channel is removed from any Conference of which it is a part.

This implies that the media streams within the conference are put on hold and the media streams within the member channel leaving the conference are unheld.

This channel isn't in a conference. This channel is in a conference but can't currently be split away from it.
telepathy-glib-0.24.2/spec/Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml0000644000175000017500000001412312652510705027267 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

This codec offer interface provides a method of signalling for RTCP extended reports, documented by RTP Control Protocol Extended Reports (RTCP XR) (RFC 3611). CMs should ignore all RTCP Extended Report parameters that are not listed in this spec at the time of implementation. More parameters can be added to the spec as required.

For more details on what RTCP extended reports can do and how to use them, one should refer to RFC 3611.

If non-zero, enable Loss Run Length Encoded Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. If non-zero, enable Duplicate Run-Length-Encoded Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. If non-zero, enable Packet Receipt Times Report Blocks. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. If non-zero, enable Receiver Reference Time and Delay since Last Receiver Report Blocks (for estimating Round Trip Times between non-senders and other parties in the call. The value of this integer represents the max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. Who is allowed to send Delay since Last Receiver Reports. Which fields SHOULD be included in the statistics summary report blocks that are sent, and whether to send VoIP Metrics Report Blocks. There can be zero or more flags set. Whether to enable VoIP Metrics Report Blocks. These blocks are of a fixed size. Loss report flag, as defined in RFC3611 section 4.6. Duplicate report flag, as defined in RFC3611 section 4.6. Jitter flag, as defined in RFC3611 section 4.6. First bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6. Second bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6. Both RTP data senders and data receivers MAY send DLRR blocks. Only active RTP senders MAY send DLRR blocks, i.e., non RTP senders SHALL NOT send DLRR blocks.
telepathy-glib-0.24.2/spec/Call_Content_Interface_Media.xml0000644000175000017500000005651412652510705020550 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

Interface to use by a software implementation of media streaming. The reason behind splitting the members of this interface out from the main Content interface is that the software is not necessarily what controls the media. An example of this is in GSM phones, where the CM just tells the phone to dial a number and it does the audio routing in a device specific hardware way and the CM does not need to concern itself with codecs.

Codec Negotiation

When a new Call1 channel appears (whether it was requested or not) a MediaDescription object will either be waiting in the MediaDescriptionOffer property, or will appear at some point via the NewMediaDescriptionOffer signal.

If nothing is known about the remote side's Media capabilities (e.g. outgoing SIP/XMPP call), this MediaDescription will pop up with {HasRemoteInformation = false, FurtherNegotiationRequired = true}, and the local user's streaming implementation SHOULD call Accept, with a description of all supported codecs and other features. The CM will then send this information to the remote side (and LocalMediaDescriptionChanged will fire with details of the description passed into Accept for debugging purposes).

When the remote codecs and other content information are available (e.g. Remote user replies to initial offer, or sends a new offer of their own, a new MediaDescription will appear, with {HasRemoteInformation = true, FurtherNegotiationRequired = false}, and the Codecs property on the description offer set to the codecs which are supported by the remote contact. The local user's streaming implementation SHOULD then call Accept, with a description that is compatible with the one one in the offer. After the codec set is accepted, both LocalMediaDescriptionChanged and RemoteMediaDescriptionsChanged will fire to signal their respective changes, to aid with debugging. Note that if Accept is called, with FurtherNegotiationRequired set to false, the CM should be able to rely on the fact that the description passed into Accept is compatible with the one in the offer, and the description passed into Accept will not be signalled to the remote side.

Changing codecs mid-call

To update the codecs in the local (and optionally remote) media descriptions mid-call, the UpdateLocalMediaDescription method should be called with details of the new codec list. If this is accepted, then LocalMediaDescriptionChanged will be emitted with the new codec set.

If parameters requiring negotiation are changed, then the FurtherNegotiationRequired property should be set to TRUE, and the new media description should only be used once they come in a new MediaDescriptionOffer

If the other side decides to update his or her codec list during a call, a new MediaDescription object will appear through NewMediaDescriptionOffer which should be acted on as documented above.

Protocols without negotiation

For protocols where the codecs are not negotiable, the initial content's MediaDescription object will appear with HasRemoteInformation, set to true and the known supported codec values in Codecs.

A description of a codec. Numeric identifier for the codec. This will be used as the PT in the SDP or content description. The name of the codec. The clockrate of the codec. Number of channels of the codec if applicable, otherwise 0. This should be set to true in calls to Accept and UpdateLocalMediaDescription if this codec has changed in a way that needs to be signalled over the network. If it is set to false, the CM is allowed ignore any differences between the current parameters and the previous ones This mechanism may be used to save bandwidth and avoid the CM having to calculate diffs against previous versions of this struct, which can lead to false-positives (e.g. redundant ptime updates). Extra parameters for this codec. A map from contact to the list of codecs he or she supports. A contact handle. The codecs that the contact supports. The remote contact this description refers to or 0. This matches the RemoteContact property on MediaDescription The properties of the description The remote description offer and its information The object path to the MediaDescription The immutable properties of all interfaces of the codec description. Having all the codec description properties here saves a D-Bus round-trip - it shouldn't be necessary to get the properties from the MediaDescription object, in practice. Update the local codec mapping and other interfaces of the MediaDescription. This method should only be used during an existing call to update the local media description. This may trigger a re-negotiation which may result in new new MediaDescriptionOffers if the "FurtherNegotiationRequired" property is TRUE. Otherwise, only parameters which strictly describe the media being sent can be changed. The updated media description that the local side wants to use. The protocol does not support changing the codecs mid-call. The description given is invalid in some way.

A map from contact handles to descriptions supported by that contact.

Keys of this map will appear in at most one RemoteMembers. See RemoteContact for more details on how to map between MediaDescriptions and Streams.

A map from contact handles to the descriptions the local side responsed with.

Emitted when a new MediaDescription appears. The streaming >implementation MUST respond by calling the Accept or Reject method on the description object appeared.

Emission of this signal indicates that the MediaDescriptionOffer property has changed to (Description, Contact, MediaDescriptionProperties).

When the MediaDescriptionOffer has been dealt with then MediaDescriptionOfferDone must be emitted before NewMediaDescriptionOffer is emitted again.

The object path of the new media description. This replaces any previous media description. The immutable properties of the remote media description. Having all the MediaDescription properties here saves a D-Bus round-trip - it shouldn't be necessary to get the properties from the MediaDescription object, in practice.

Emitted when a MediaDescription has been handled.

Emission of this signal indicates that the MediaDescriptionOffer property has changed to ("/", 0, {}).

Change notification for LocalMediaDescriptions

The local content description that was updated

Change notification for RemoteMediaDescriptions

The remote content descriptions that were updated

Removal notification for RemoteMediaDescriptions and LocalMediaDescriptions

The local and remote content descriptions that are no longer part of this content

The object path to the current MediaDescription object, its RemoteContact and a mapping of the MediaDescriptions properties. If the object path is "/" then there isn't an outstanding content description, and the mapping MUST be empty.

Having all MediaDescription properties here saves a D-Bus round-trip - it shouldn't be necessary to get these properties from the Content MediaDescription object, in practice.

Change notification is via the NewMediaDescriptionOffer and MediaDescriptionOfferDone signals.

A packetization method that can be used for a content. Real-time Transport Protocol, as documented by RFC 3550. Raw media. MSN webcam. This is the video-only one-way type which was used in earlier versions of WLM. Although no longer used, modern WLM clients still support the MSN webcam protocol.

The packetization method in use for this content.

Used by the CM to relay instructions from Channel.Interface.DTMF to the streaming implementation. If any contact in this call supports the telephone-event codec in their MediaDescription, this event should be sent as outlined in RFC 4733. Otherwise, it should be sent as an audible tone. The event to send (or stop sending). Either Pending_Send or Pending_Stop_Sending. Called by the streaming implementation in response to DTMFChangeRequested to confirm that it has started or stopped sending the event in question. The event referred to in the corresponding DTMFChangeRequested signal. Either Sending or None. The currently requested DTMF event (for state-recoverability of DTMFChangeRequested). Should be ignored if CurrentDTMFState is None. The current DTMF state (for state-recoverability of DTMFChangeRequested). Signal an unrecoverable error for this content, and remove it. A reason struct describing the error.
telepathy-glib-0.24.2/spec/Call_Content_Media_Description.xml0000644000175000017500000002446512652510705021133 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) This object represents a remote Description Offer to which the local streaming implementation should reply with its local Description. This is intended as a temporary transactional object for use with Content.Interface.Media. There will always be 0 or 1 MediaDescription object per Content. In most cases, this object will stay alive until you call either Accept or Reject, and then disappear. There are some cases (e.g. an endpoint being removed from the call) where a MediaDescription object will disappear before you have had a chance to either Accept or Reject it. The local description to send to the remote contacts and to use in the Content. Accepts the updated Description and update the corresponding local description. If FurtherNegotiationRequired is True, calling this method will generally cause a network round-trip and a new MediaDescription to be offered (hopefully with FurtherNegotiationRequired set to False). The description given is invalid in some way. Reject the proposed update to the remote description. A structured reason for the rejection.

Extra interfaces provided by this media description. This SHOULD NOT include the Description interface itself.

If this is set to True by the CM in a MediaDescriptionOffer, it means "This is an offer under the SDP Offer/Answer model. Whatever you accept this offer with is what I will send to the other side in my answer." If this is set to False by the CM then it means "This is an Answer under the SDP Offer/Answer model, and if it remains False in the Accept(), no further codec negotiation needs to happen." If this is set to True by the streaming implementation (e.g. in an Accept or UpdateLocalMediaDescription call) then a new SDP Offer/Answer round-trip will be initiated.

True if this offer contains information from the remote side: If False then the Accept response solely depends on the capabilities and preferences of the local side. In most protocols this property will be False for the initial DescriptionOffer on an outgoing call.

A list of codecs the remote contact supports. When used with Accept, it means the locally supported codecs. The contact handle that this description applies to. This property can be used as an opaque identifier, and searched for in RemoteMembers for each Stream in this Content, to determine which Stream this MediaDescription applies to. If multiple MediaDescriptions apply to the same Stream, the SSRCs property should be used to separate media before decoding. If this property is 0, this MediaDescription applies to all streams, so the above matching method is unneccesary (e.g. in conference calls with a mixer, media from all participants is mixed into one stream). When calling Accept or UpdateLocalMediaDescription, this should always be set to 0, or omitted, because it is assumed that you send the same MediaDescription to everyone (Encoding a stream separately for each contact in a call is inefficient, and should be avoided). The remote contact these SSRCs belong to or 0. The list of Synchronisation Sources.

A map from Handle to list of Synchronisation Sources, as defined by RFC 3550.

Some protocols require the negotiation of SSRC identifiers for RTP streams. If this is the case, then MediaDescription offers will appear with this property set. The streaming implementation should then call Accept with a map from 0 to a list containing a single SSRC (which does not collide with these, or any previously seen SSRCs). If a new MediaDescription offer appears with an SSRC the same as one in LocalMediaDescriptions, then the streaming implementation should pick a new SSRC to resolve the collision.

It is expected that this list will normally be at most one element long, but it is kept as a list for extensibility. The concatenation of all SSRCs associated with a Stream should contain no duplicate entries. If there are collisions, then it is the responsibility of the protocol implementation to resolve them and generate new offers.

If this property is omitted, then the streaming implementation can assume that there is only one MediaDescription per Stream.

If there is a single multicast Call Stream with multiple Remote Members, and all members are forced to use the same MediaDescription, this map can be used by the streaming implementation to determine which video sources belong to which contacts (e.g. in order to put a name under each face in the call)

A mapping containing all properties that define the information from a MediaDescription and its interfaces.

If HasRemoteInformation is True, then this mapping will always contains at least Codecs

A D-Bus interface name, followed by a dot and a D-Bus property name. The value of the property
telepathy-glib-0.24.2/spec/Channel_Interface_SMS.xml0000644000175000017500000003140612652510705017167 00000000000000 Copyright © 2008–2010 Nokia Corporation Copyright © 2010 Collabora Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Imported from rtcom-telepathy-glib, with the unused properties removed and the documentation tidied up.

This interface contains SMS-specific properties for text channels.

The presence of this interface on a channel does not imply that messages will be delivered via SMS.

This interface MAY appear in the Interfaces property of channels where SMSChannel would be immutable and false. It SHOULD appear on channels where SMSChannel is immutable and true, and also on channels where SMSChannel is mutable (i.e. channels that might fall back to sending SMS at any time, such as on MSN).

Handler filters

A handler for class 0 SMSes should advertise the following filter:

{ ...ChannelType: ...Text,
  ...TargetHandleType: Contact,
  ...SMS.Flash: True,
}

It should also set its BypassApproval property to True, so that it is invoked immediately for new channels.

Contact Capabilities

Contacts to whom SMSes can be sent SHOULD indicate this via a requestable channel class with SMSChannel = True as a fixed property.

For instance, a contact that can accept both text and SMS channels:

[
({ ...ChannelType: ...Text,
   ...TargetHandleType: Contact,
 },
 [ ...TargetHandle, ...TargetID ]),

({ ...ChannelType: ...Text,
   ...TargetHandleType: Contact,
   ...SMSChannel: True,
 },
 [ ...TargetHandle, ...TargetID ]),
]

If True, then this channel is exclusively for receiving class 0 SMSes (and no SMSes can be sent using SendMessage on this channel). If False, no incoming class 0 SMSes will appear on this channel.

This property is immutable (cannot change), and therefore SHOULD appear wherever immutable properties are reported, e.g. NewChannels signals.

Class 0 SMSes should be displayed immediately to the user, and need not be saved to the device memory unless the user explicitly chooses to do so. This is unlike “normal”, class 1 SMSes, which must be stored, but need not be shown immediately in their entirity to the user.

Separating class 0 SMSes into their own channel with this immutable property allows them to be dispatched to a different Handler—which would include this property in its HandlerChannelFilter—avoiding the normal Text channel handler having to decide for each message whether it should be displayed to the user immediately or handled normally.

Currently, no mechanism is defined for sending class 0 SMSes. It seems reasonable to support specifying the class of an outgoing SMS in its header Message_Part, rather than requiring the UI to request a special channel for such SMSes; hence, we define here that channels with Flash set to True are read-only.

If TRUE, messages sent and received on this channel are transmitted via SMS.

If this property is included in the channel request, the Connection Manager MUST return an appropriate channel (i.e. if TRUE the channel must be for SMSes, if FALSE it must not), or else fail to provide the requested channel with the NotCapable error.

For example, to explicitly request an SMS channel to a contact. You might construct a channel request like:

{
  Channel.Type: Channel.Type.Text,
  Channel.TargetHandleType: Handle_Type_Contact,
  Channel.TargetID: escher.cat,
  Channel.Interface.SMS.SMSChannel: True,
}
Some protocols allow us to send SMSes to a remote contact, without knowing the phone number to which those SMSes will be sent. This provides a mechanism to request such channels.

If this property is not included in the channel request, the Connection Manager MAY return an SMS channel if that is the most appropriate medium (i.e. if the channel target is a phone number).

To some types of identifiers (i.e. phone numbers) it only makes sense to return an SMS channel, this is what happens currently with telepathy-ring. We don't want to break this behaviour when we are not explicit about the type of channel we want. Alternatively, for protocols where there is an SMS fallback for IM messages, it's possible that we don't care what sort of channel we get, and simply want notification of the transport.

Some protocols have a fallback to deliver IM messages via SMS. On these protocols, the Connection Manager SHOULD set the property value as appropriate, and notify its change with SMSChannelChanged.

Protocols such as MSN can fall back to delivering IM messages via SMS. Where possible we want clients to be able to inform the user that their messages are going to be redirected to the remote contact's phone.
The new value for SMSChannel. This signal indicates a change in the SMSChannel property.

Returns the number of 140 octet chunks required to send a message via SMS, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost.

There are a number of different SMS encoding mechanisms, and the client doesn't know which mechanisms an individual CM might support. This method allows the client, without any knowledge of the encoding mechanism, to provide length details to the user.

Clients SHOULD limit the frequency with which this method is called and SHOULD NOT call it for every keystroke. Clients MAY estimate the remaining size between single keystrokes.

The message the user wishes to send.

The number of 140 octet chunks required to send this message.

For example, in the GSM standard 7-bit encoding, a 162 character message would require 2 chunks.

The number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by abs(Remaining_Characters). The value MIN_INT32 (-231) indicates the message will be truncated by an unknown amount.

For example, in the GSM standard 7-bit encoding, a 162 character message would return 144 remaining characters (because of the space required for the multipart SMS header).

The estimated cost of sending this message. The currency and scale of this value are the same as the Balance.AccountBalance property.

A value of -1 indicates the cost could not be estimated.

Raised when the method is not available on this channel. Clients MAY choose to make their own estimation. Raised when the content cannot be encoded into a valid SMS.
telepathy-glib-0.24.2/spec/Connection_Interface_Resources.xml0000644000175000017500000002166312652510705021232 00000000000000 Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface on connections to show contact attributes for specific resources of a contact, if the protocol supports multiple resources. Resources are most common in XMPP, hence the name of this interface, but they are also present in MSN, where they are called points of presence.

When a client requests some attribute of a contact using its handle on the connection, the CM uses an algorithm to choose the most appropriate resource for the job. If there is only one resource, then the choice is obvious. If, however, there is more than one resource connected at any one time, the CM either aggregates all appropriate information to return (in the case of capabilities), or chooses one specific resource (in the case of presence).

Resources in XMPP have names, and it can be extremely useful for the user to be able to know which resources of a contact are online, providing the names are human-readable. Before now, resources have not been exposed in Telepathy, but this interface attempts to change this.

When using this interface, it is a little like using the Contacts interface, but only resource-specific attributes are ever returned. The resource-specific contact attributes are decided on by the CM, but XMPP's are listed below:

  • SimplePresence/presence
  • ContactCapabilities/capabilities
  • ClientTypes/client-types
Return the resource information of the given contacts. If any of the contact attributes for specific resources of the given contacts' are not known return immediately without waiting for a reply. The contacts whose resource attributes should be returned.

The contacts' resources and the contact attributes specific to each resource. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

For every contact handle passed into this method, it is guaranteed that there will be a key in the returned map that corresponds to said handle. If there is no information regarding the contact the resource information map will be empty.

The resource string is never human-readable. The resource string might be human-readable.

Whether the resources returned from GetResources are human readable or not.

If the connection manager knows that all resource names are automatically generated, then the resource strings mean nothing to the user. Showing these strings in the UI would be confusing, so by setting this to Resources_Human_Readability_Never, the UI is advised not to show resources.

If on the other hand, all resources are set to nice names (such as "office" or "home") then it might be wise to expose these strings in the UI, so this property would be set to Resources_Human_Readability_Maybe. This is the case in XMPP -- most resources are set in a way that the user can deduce some information from them. The absence of an Always enum value is because in the case of XMPP, the resource string could be partially human-readable (as on Google Talk, where a resource of "home" is changed by the server to a unique string like "home_1234fdec") or not at all human-readable.

Emitted when a contact has a resource added or removed, or any contact attribute for any resource changes. The contact. The contact's resource information. All resource information is given, not just the details which have changed. A map of a contact's resources to their resource-specific information.

The name of the resource.

A map of contact attributes whose data is specific to this resource.
Mapping returned by GetResources, representing a collection of Contacts, their resources, and their resource-specific contact attributes. A contact. A map of the contact's resources to their resource-specific information.

The same mapping that would be returned by GetResources for this contact.

telepathy-glib-0.24.2/spec/Connection_Interface_Sidecars1.xml0000644000175000017500000001244612652510705021075 00000000000000 Copyright © 2009-2013 Collabora Limited Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) The "primary" interface implemented by an object attached to a connection. For example, a Gabble plugin implementing fine-grained control of XEP-0016 privacy lists might expose an object implementing com.example.PrivacyLists. The object path of the sidecar, exported by the same bus name as the Connection to which it is attached. Immutable properties of the sidecar.

Request an object with a particular interface providing additional connection-specific functionality, together with its immutable properties. These will often be implemented by plug-ins to the connection managers; for example, support for an XMPP XEP for which no generic Telepathy interface exists might be implemented by a Gabble plugin exposing a sidecar with a particular interface.

This method may be called at any point during the lifetime of a connection, even before its Connection_Status changes to Connected. It MAY take a long time to return—perhaps it needs to wait for a connection to be established and for all the services supported by the server to be discovered before determining whether necessary server-side support is available—so callers SHOULD override the default method timeout (25 seconds) with a much higher value (perhaps even MAX_INT32, meaning “no timeout” in recent versions of libdbus).

There is an implicit assumption that any connection manager plugin will only want to export one “primary” object per feature it implements, since there is a one-to-one mapping between interface and object. This is reasonable since Sidecars are (intended to be) analogous to extra interfaces on the connection, providing once-per-connection shared functionality; it also makes client code straightforward (look up the interface you care about in a dictionary, build a proxy object from the value). More “plural” plugins are likely to want to implement new types of Channel instead.

The requested sidecar is not implemented by this connection manager, or a necessary server-side component does not exist. (FIXME: split these two errors out? Then again, once we list the guaranteed and possible sidecars on a Protocol object, clients can tell the difference themselves, because they shouldn't be calling this in the first case.) A server-side component needed by the requested sidecar reported it is currently too busy, or did not respond for some implementation-defined time. The caller may wish to try again later. The connection was disconnected while the sidecar was being set up.
telepathy-glib-0.24.2/spec/Connection_Interface_Mail_Notification.xml0000644000175000017500000007016012652510705022644 00000000000000 Copyright (C) 2007 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) A client MUST notify interest in this feature before it will be enabled. This Connection provides the number of unread e-mails (or e-mail threads) in the main folder of your e-mail account, as the UnreadMailCount property. The connection manager will update this value by emitting the UnreadMailsChanged signal. This Connection provides a detailed list of unread e-mails, as the UnreadMails property. If this flag is set, Supports_Unread_Mail_Count MUST be set, and Emits_Mails_Received MUST NOT be set. The Connection will update the list by emitting the UnreadMailsChanged signals. This Connection emits the MailsReceived signal, which provides details about newly arrived e-mails but does not maintain their read/unread status afterwards. This flag MUST NOT be combined with Supports_Unread_Mails. This Connection can provide a URL (with optional POST data) to open the the inbox of the e-mail account in a web-based client, via the RequestInboxURL method.

This Connection can provide a URL (with optional POST data) to open a specific mail in a web-based client, via the RequestMailURL method. This feature is not useful unless either Emits_Mails_Received or Supports_Unread_Mails is set.

If this flag is not set, clients SHOULD fall back to using RequestInboxURL if available.

Each Mail represents a thread of e-mails, which MAY have more than one sender.

Google Talk notifies users about new mail in terms of unread threads, rather than unread e-mails.

Flags representing capabilities provided by a connection manager. Those values can be used as bitfield. Some flags depend on, or conflict with, each other.

Connections SHOULD implement as many of these features as the underlying protocol allows, preferring to implement Supports_Unread_Mails instead of Emits_Mails_Received if both are possible.

Use the GET method when opening the URL. Use the POST method when opening the URL. Refer to HTTP_Post_Data for more details. The HTTP Method with which to request a URL.

A pair (key, value) representing POST data compatible with the application/x-www-form-urlencoded MIME type. The strings MUST be valid UTF-8 strings, and the characters used in the key MUST obey the requirements of the HTML CDATA type. The value MUST NOT be encoded with HTML entities.

For example, if the POST data should contain a key "less-than" with value "<", and a key "percent" with value "%", this should be represented as two HTTP_Post_Data structures, ("less-than", "<") and ("percent", "%"), resulting in a POST request whose request body is "less-than=&lt;&percent=%25". If a client passes this to a browser by writing it into an HTML form, it could do so by representing it as:

        <input type="hidden" name="less-than">&lt;</input>
        <input type="hidden" name="percent">%</input>
        

This data can be used to generate a HTML file that will automatically load the URL with appropriate POST data, in which case the client MUST convert any characters that are special within HTML into HTML entities. Alternatively, it can be used in an API that will instruct the browser how to load the URL (like the Netscape Plug-in API), in which case the client MUST escape characters that are reserved in URLs, if appropriate for that API.

An array of pairs is used instead of a map from keys to values, because it's valid to repeat keys in both HTML and x-www-form-urlencoded data.

The key, corresponding to a HTML control name The value

A pair (name, address) representing an e-mail address, such as ("Nicolas Dufresne", "nicolas.dufresne@collabora.co.uk"). At least one of name and address MUST be provided. A missing element will be represented by the empty string.

The CM should provide as much information as possible, but not all protocols provide both the displayed name and the address. (If a protocol doesn't provide either, it should omit the appropriate field from the Mail entirely.)

The displayed name corresponding to the e-mail address The actual e-mail address

A structure containing the required information to open a web-based e-mail UI, without needing re-authentication (if possible).

Because the URL and POST data frequently contain short-lived credential tokens, a new URL should be requested (by calling one of the methods that returns a Mail_URL) for each visit to the web-based UI, and the URL should be visited soon after it is returned.

The URL to which to send a request. The HTTP method of the request. An array of name-value pairs containing the POST data to use when opening the URL. This MUST be an empty array if the Method is not POST.
An extensible map representing a mail, or (on protocols where Thread_Based appears in MailNotificationFlags) a thread of mails. All keys are optional where not otherwise stated; however, at least one of "senders" and "subject" must be included.

A key providing information about the mail or thread. Well-known keys are as follows:

id — s

A unique ID for this e-mail. CMs with Supports_Unread_Mails set in MailNotificationFlags MUST provide this key in each Mail.

If provided, the ID SHOULD be unique to a Mail at least until that mail is removed with the UnreadMailsChanged signal (in protocols with Supports_Unread_Emails), or unique for the duration of a session (otherwise).

In protocols with Supports_Unread_Mails, this key is used to indicate which mail was removed. In protocols without that feature, it's impossible to tell when a mail has been removed (and hence how long the identifier will remain valid for use with RequestMailURL).

url-data — any type
An opaque identifier (typically a string or list of strings) provided to the Connection when calling RequestMailURL, containing information used by the Connection to build the URL.
senders — a(ss) (Mail_Address)
An array of sender display name and e-mail address pairs. Note that only e-mails represented as a thread can have multiple senders.
to-addresses — a(ss) (Mail_Address)
An array of display name and e-mail address pairs representing the recipients.
cc-addresses — a(ss) (Mail_Address)
An array of display name and e-mail address pairs representing the carbon-copy recipients.
sent-timestamp — x (Unix_Timestamp64)
A UNIX timestamp indicating when the message was sent, or for a thread, when the most recent message was sent.
received-timestamp — x (Unix_Timestamp64)
A UNIX timestamp indicating when the message was received, or for a thread, when the most recent message was received.
has-attachments — b
If true, this mail has attachments.
subject — s
The subject of the message. This MUST be encoded in UTF-8.
content-type — s

The MIME type of the message content. Two types are currently supported: "text/plain" for plain text, and "text/html" for a HTML document. If omitted, "text/plain" MUST be assumed. Regardless of MIME type, the content MUST be valid UTF-8 (which may require that the Connection transcodes it from a legacy encoding).

All strings on D-Bus must be UTF-8.

truncated — b
If true, the content is only a partial message; if false or omitted, the content is the entire message.
content — s
The body of the message, possibly truncated, encoded as appropriate for "content-type".
folder — s
The name of the folder containing this e-mails. If omitted, the inbox SHOULD be assumed.
The value, of whatever type is appropriate for the key.
Integer representing the bitwise-OR of supported features for e-mails notification on this server. This property MUST NOT change after the Connection becomes CONNECTED. This property indicates the behavior and availability of the other properties and signals within this interface. A connection manager that cannot at least set one of the flags in the Mail_Notification_Flags SHOULD NOT provide this interface.

The number of unread messages in the Inbox. Change notification is via UnreadMailsChanged.

This property is only useful if Supports_Unread_Mail_Count is set in the MailNotificationFlags; otherwise, it MUST be zero.

If Thread_Based appears in the MailNotificationFlags, this property counts the number of threads, not the number of mails.

Note that this count MAY be bigger than the number of items in UnreadMails. See UnreadMails for more details.

An array of unread Mails. Change notification is via UnreadMailsChanged. This property is only useful if Supports_Unread_Mails is set in MailNotificationFlags; otherwise, it MUST be an empty list.

The array size MAY be shorter than UnreadMailCount.

Some servers may limits the amount of detailed e-mails sent. This can significantly reduce the network traffic for large inbox. For this reason, it is normal that UnreadMailCount be bigger or equal to the size of this array.

A string representing the e-mail address of the account. The CMs MUST provide this information. In close integration of MailNotification with other e-mail services, the e-mail address can be used has a unique identifier for the account. Possible integration could be between Telepathy and Evolution where the e-mail address is the common information in both interfaces.

An array of Mails. Those e-mail MUST NOT have the "id" key.

On connections that emit this signal, it's impossible to tell when a mail has been removed, and hence when "id" has become invalid.

Emitted when new e-mails messages arrive to the inbox associated with this connection. This signal is used for protocols that are not able to maintain the UnreadMails list, but do provide real-time notification about newly arrived e-mails. It MUST NOT be emitted unless Emits_Mails_Received is set in MailNotificationFlags.
Number of unread messages in the inbox (the new value of UnreadMailCount).

A list of Mail that are being added or updated in UnreadMails.

Mails may be updated when the URL information (URL and POST data) have changed, or senders were added or removed from an e-mail thread.

If the Supports_Unread_Mails flag is not set, this list MUST be empty, even if Count has increased.

A list of e-mail IDs that are being removed from UnreadMails. If the Supports_Unread_Mails flag is not set, this list MUST be empty, even if Count has decreased.

Emitted when UnreadMails or UnreadMailCount have changed. It MUST NOT be emited if Supports_Unread_Mail_Count flag is not set in MailNotificationFlags.

Mails_Added and Mails_Removed MUST be empty if the Supports_Unread_Mails flag is not set.

A struture containing a URL and optional additional data to open a webmail client, without re-authentication if possible. This method creates and returns a URL and an optional POST data that allow opening the Inbox folder of a webmail account. This URL MAY contain tokens with a short lifetime, so clients SHOULD request a new URL for each visit to the webmail interface. This method is implemented only if the Supports_Request_Inbox_URL flag is set in MailNotificationFlags. We are not using properties here because the tokens are unsuitable for sharing between clients, and network round-trips may be required to obtain the information that leads to authentication free webmail access. The mail's id as found in the Mail structure, or the empty string if no id key was provided. Whatever url-data was found in the Mail structure, or the boolean value False (D-Bus type 'b') if no url-data was provided in the Mail. A struture that contains a URL and optional additional data to open a webmail client, without re-authentication if possible. This method creates and returns a URL and optional POST data that allow opening a specific mail in a webmail interface. This method is implemented only if Supports_Request_Mail_URL flag is set in MailNotificationFlags. See RequestInboxURL for design rationale.

An interface to support receiving notifications about a e-mail account associated with this connection.

In protocols where this is possible, this interface also allows the connection manager to provide the necessary information for clients to open a web-based mail client without having to re-authenticate.

To use this interface, a client MUST first subscribe by passing the name of this interface to the Connection.AddClientInterest method. The subscription mechanic aims at reducing network traffic and memory footprint in the situation where nobody is currently interesting in provided information. When done with this interface, clients SHOULD call Connection.RemoveClientInterest to allow the CM to release resources.

Protocols have various different levels of Mail Notification support. To describe the level of support, the interface provides a property called MailNotificationFlags. Not all combinations are valid; protocols can be divided into four categories as follows.

Connections to the most capable protocols, such as Google's XMPP Mail Notification extension, have the Supports_Unread_Mails flag (this implies that they must also have Supports_Unread_Mail_Count, but not Emits_Mails_Received). On these connections, clients requiring change notification MUST monitor the UnreadMailsChanged signal, and either recover the initial state from the UnreadMails property (if they require details other than the number of mails) or the UnreadMailCount property (if they are only interested in the number of unread mails). The MailsReceived signal is never emitted on these connections, so clients that will display a short-term notification for each new mail MUST do so in response to emission of the UnreadMailsChanged signal.

The most common situation, seen in protocols like MSN and Yahoo, is that the number of unread mails is provided and kept up-to-date, and a separate notification is emitted with some details of each new mail. This is a combination of the following two features, and clients SHOULD implement one or both as appropriate for their requirements.

On protocols that have the Emits_Mails_Received flag (which implies that they do not have Supports_Unread_Mails), the CM does not keep track of any mails; it simply emits a notification whenever new mail arrives. Those events may be used for short term display (like a notification popup) to inform the user. No protocol is known to support only this feature, but it is useful for integration with libraries that that do not implement tracking of the number of mails. Clients requiring these notifications MUST monitor the MailsReceived signal on any connections with this flag.

On protocols that have the Supports_Unread_Mail_Count flag but not the Supports_Unread_Mails flag, clients cannot display complete details of unread email, but can display an up-to-date count of the number of unread mails. To do this, they must monitor the UnreadMailsChanged signal, and retrieve the initial state from the UnreadMailCount property.

Orthogonal features described by the MailNotificationFlags property include the RequestSomethingURL methods, which are used to obtain URLs allowing clients to open a webmail client. Connections SHOULD support as many of these methods as possible.

telepathy-glib-0.24.2/spec/Channel_Interface_Room.xml0000644000175000017500000004427112652510705017445 00000000000000 Copyright © 2010 Collabora Ltd. Copyright © 2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(version 2)

Different IM protocols use a variety of ways to name chat rooms. The simplest example is perhaps IRC, where chat rooms have short, persistent, human-readable string names, and are generally global across the network. Skype chat rooms have persistent string names, so you can leave and re-join a room, but these names are opaque unique identifiers. MSN chat rooms are unnamed, and you can only join one by being invited. And XMPP wins the coveted “most complicated chat rooms” prize: chat rooms may be hosted by different servers with different DNS names; normally they have human-readable names, except that all MUCs on Google Talk's conference server have UUIDs as names, and XEP-0045 §10.1.4 Requesting a Unique Room Name defines a protocol for requesting a unique, opaque room name on the server. Note that this interface is not restricted to Text channels, and can also be used on Call channels.

This interface intends to support and differentiate these mechanisms more clearly than the TargetHandleType and TargetID properties can alone. It initially contains a pair of properties used to represent the human-readable parts of a Room_Handle's identifier, if any. The above examples for different protocols are represented as follows:

  • The IRC channel #telepathy on Freenode is represented by a channel with properties TargetHandleType = Room, TargetID = "#telepathy", RoomName = "#telepathy", Server = "", indicating that the room has a human-readable identifier, and is not confined to a particular server on the network. Actually, IRC supports creating “local” channels specific to the server they are created on. These channels have identifiers starting with & rather than #. These could be represented by setting Server appropriately.
  • A Skype group chat with opaque identifier 0xdeadbeef has TargetHandleType = Room, TargetID = "0xdeadbeef", RoomName = "", Server = "", indicating that the room has an identifier but no human-readable name.
  • An MSN group chat has TargetHandleType = None, RoomName = "", Server = "", indicating that the room has neither an identifier (so it cannot be re-joined later) nor a human-readable name.
  • A standard Jabber multi-user chat jdev@conference.jabber.org has TargetHandleType = Room, TargetID = "jdev@conference.jabber.org", RoomName = "jdev", Server = "conference.jabber.org".
  • A Google Talk private MUC private-chat-11111x1x-11xx-111x-1111-111x1xx11x11@groupchat.google.com has TargetHandleType = Room, TargetID = "private-chat-11111x1x-11xx-111x-1111-111x1xx11x11@groupchat.google.com", RoomName = "", Server = "groupchat.google.com", indicating that the room has a persistent identifier, no human-readable name, and is hosted by a particular server.
  • Similarly, a XEP-0045 §10.1.4 uniquely-named room lrcgsnthzvwm@conference.jabber.org has TargetHandleType = Room, TargetID = "lrcgsnthzvwm@conference.jabber.org", RoomName = "", Server = "conference.jabber.org", indicating that the room has a persistent identifier, no human-readable name, and is hosted by a particular server.

Requestable channel classes

If the connection supports joining text chat rooms by unique identifier, like Skype, it should advertise a Requestable_Channel_Class matching:

( Fixed = { ...ChannelType: ...Text,
            ...TargetHandleType: Room,
          },
  Allowed = [ ...TargetID,
              ...TargetHandle,
            ]
)

Channel requests must specify either TargetID or TargetHandle.

If, like IRC, the room identifiers are also human-readable, the RCCs should also include RoomName in Allowed_Properties:

( Fixed = { ...ChannelType: ...Text,
            ...TargetHandleType: Room,
          },
  Allowed = [ ...TargetID,
              ...TargetHandle,
              ...RoomName
            ]
),

( Fixed = { ...ChannelType: ...Text
          },
  Allowed = [ ...RoomName,
            ]
)

Requests may specify the RoomName in place of TargetID or TargetHandle . Note how RoomName appears in Allowed_Properties of a different RCC because when TargetHandleType is omitted (or is None), both TargetHandle and TargetID must also be omitted. RoomName is allowed in conjuction with TargetID or TargetHandle in some situations, as explained below in the Requesting room channels section.

If rooms may be on different servers, Server should also be included in the allowed properties, but CMs MUST use a reasonable default Server if not explicitly specified in a channel request. The CM's default server MAY be configurable by a connection parameter specified on a RequestConnection call, similarly to how the fallback conference server is specified on jabber connections in gabble.

If the protocol supports unnamed rooms, RoomName should be fixed to the empty string, and TargetHandleType should be None:

( Fixed = { ...ChannelType: ...Text,
            ...TargetHandleType: None,
            ...RoomName: "",
          },
  Allowed = [ ]
)

Requesting room channels

When explicitly joining a room, the CM cannot know whether the room ID is unique or not. As a result, if this is the case, adding an empty string RoomName into the channel request will ensure the CM knows. For example:

{ ...ChannelType: ...Text,
  ...TargetHandleType: Room,
  ...TargetID: "qwerasdfzxcv@conference.jabber.org",
  ...RoomName: ""
}

If RoomName features in Allowed_Properties then the only value allowed in conjunction with TargetID or TargetHandle is the empty string. Requests with conflicting TargetID and RoomName properties will fail with InvalidArgument.

To create a XEP-0045 §10.1.4 uniquely-named room channel on the conference.jabber.org server, then the following channel request should be made:

{ ...ChannelType: ...Text,
  ...RoomName: ""
  ...Server: "conference.jabber.org"
}

If everything is successful, then when the channel request is satisfied, a new channel will appear with the following properties:

{ ...ChannelType: ...Text,
  ...TargetHandleType: Room,
  ...TargetID: "kajsdhkajshdfjkshdfjkhs@conference.jabber.org",
  ...RoomName: ""
  ...Server: "conference.jabber.org"
}

The CM will have received the unique room name (kajsdhkajshdfjkshdfjkhs) and then created a room with such a name on the said server. The empty RoomName property shows that the room name is not human-readable.

The human-readable identifier of a chat room. Note that if non-empty, this property (and perhaps also Server) should be sufficient in a channel request to join the room. XMPP MUCs have a room name concept which is more like a topic, except more persistent. This D-Bus property is not this XMPP room name, but the bit before the @ in the room jid; see RoomConfig1.Title for that concept.

This property cannot change during the lifetime of the channel. It should appear in the Allowed_Properties of a Requestable_Channel_Class for the connection if rooms on this connection have human-readable names, and can be joined by name.

For protocols with a concept of chatrooms on multiple servers with different DNS names (like XMPP), the DNS name of the server hosting this channel (for example, "conference.jabber.org" or "groupchat.google.com"). For other protocols, the empty string.

This property cannot change during the lifetime of the channel. It should appear in the Allowed_Properties of a Requestable_Channel_Class for the connection if and only if non-empty values are supported.

The normalized contact ID representing who created the room; or the empty string if unknown. The handle corresponding to Creator; or 0 if Creator is unknown. A unix timestamp indicating when the room was created; or INT_MAX64 if unknown.
telepathy-glib-0.24.2/spec/Channel_Interface_Messages.xml0000644000175000017500000020462012652510705020274 00000000000000 Copyright © 2008–2010 Collabora Ltd. Copyright © 2008–2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface extends the Text interface to support more general messages, including:

  • messages with attachments (like MIME multipart/mixed)
  • groups of alternatives (like MIME multipart/alternative)
  • delivery reports (which replace Text.SendError), addding support for protocols where the message content is not echoed back to the sender on failure and for receiving positive acknowledgements, as well as ensuring that incoming delivery reports are not lost if no client is handling the channel yet;
  • any extra types of message we need in future

Incoming messages, outgoing messages, and delivery reports are all represented as lists of Message_Part structures, with a format reminiscent of e-mail. Messages are sent by calling SendMessage; outgoing messages are announced to other clients which may be interested in the channel by the MessageSent signal. Incoming messages and delivery reports are signalled by MessageReceived, and are stored in the the PendingMessages property until acknowledged by calling Text.AcknowledgePendingMessages. Only the Handler for a channel should acknowledge messages; Observers (such as loggers) and Approvers for the channel may listen for incoming messages, and send messages of their own, but SHOULD NOT acknowledge messages.

If observers were allowed to acknowledge messages, then messages might have been acknowledged before the handler even got to see the channel, and hence could not be shown to the user.

If this interface is present, clients that support it SHOULD listen for the MessageSent and MessageReceived signals, and ignore the Sent, SendError and Received signals on the Text interface (which are guaranteed to duplicate signals from this interface).

Although this specification supports formatted (rich-text) messages with unformatted alternatives, implementations SHOULD NOT attempt to send formatted messages until the Telepathy specification has also been extended to cover capability discovery for message formatting.

We intend to expose all rich-text messages as XHTML-IM, but on some protocols, formatting is an extremely limited subset of that format (e.g. there are protocols where foreground/background colours, font and size can be set, but only for entire messages). Until we can tell UIs what controls to offer to the user, it's unfriendly to offer the user controls that may have no effect.

A list of MIME types supported by this channel, with more preferred MIME types appearing earlier in the list. The list MAY include "*/*" to indicate that attachments with arbitrary MIME types can be sent. This list MUST NOT be empty, since all Messages implementations MUST accept messages containing a single "text/plain" part.

Items in this list MUST be normalized to lower-case.

Some examples of how this property interacts with the MessagePartSupportFlags:

A simple IM implementation: only plain text messages are allowed
SupportedContentTypes = ['text/plain'], MessagePartSupportFlags = 0
Formatted text with a plain text alternative is allowed (see the HTML interface draft)
SupportedContentTypes = ['text/html', 'text/plain'], MessagePartSupportFlags = 0
JPEG or PNG images may be sent, but without any attached text
SupportedContentTypes = ['text/plain', 'image/jpeg', 'image/png'], MessagePartSupportFlags = 0
Unformatted text to which an optional JPEG or PNG image may be attached
SupportedContentTypes = ['text/plain', 'image/jpeg', 'image/png'], MessagePartSupportFlags = One_Attachment
Formatted text to which arbitrarily many images may be attached
SupportedContentTypes = ['text/html', 'text/plain', 'image/jpeg', 'image/png', 'image/x-ms-bmp'], MessagePartSupportFlags = One_Attachment | Multiple_Attachments
A full SIP implementation: arbitrary MIME messages are allowed
SupportedContentTypes = ['*/*'], MessagePartSupportFlags = One_Attachment | Multiple_Attachments
This supersedes GetMessageTypes; fall back to that method for compatibility with older connection managers.

A list of message types which may be sent on this channel.

Flags indicating the level of support for message parts on this channel.

Flags indicating the level of support for message parts on this channel. They are designed such that setting more flags always implies that the channel has more capabilities.

If no flags are set, this indicates that messages may contain a single message part whose content-type is any of the types from SupportedContentTypes, possibly with some alternatives.

There is no flag indicating support for alternatives. This is because the SendMessage implementation can always accept messages containing alternatives, even if the underlying protocol does not, by deleting all alternatives except the first (most preferred) that is supported.

Each of the flags so far implies the previous flag, so we could have used a simple enumeration here; however, we've defined the message-part support indicator as a flag set for future expansion.

See SupportedContentTypes for some examples.

SendMessage will accept messages containing a textual message body, plus a single attachment of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_Data_Only is not also set (because the connection manager can trivially provide an empty text part if necessary). SendMessage will accept messages containing a textual message body, plus an arbitrary number of attachments of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_One_Attachment is not also set.

Part of a message's content. In practice, this mapping never appears in isolation: incoming messages are represented by a list of Message_Part mappings in the MessageReceived signal, and outgoing messages are passed to SendMessage as a list of these mappings.

The first part of the message contains "headers", which refer to the entire message. The second and subsequent parts contain the message's content, including plain text, formatted text and/or attached files. Well-known keys for the header and body parts are defined by the Message_Header_Key and Message_Body_Key types, respectively. It is an error for a connection manager to put keys referring to the message as a whole in the second or subsequent Message_Part, or keys intended for body parts in the first Message_Part; clients MUST recover from this error by ignoring these mis-placed keys.

Instead of representing messages as aa{sv} where the first dictionary is special (a dictionary of headers), we could have used a signature like (a{sv}aa{sv}) to separate out the headers and the body parts.

However, this would make access to the messages more awkward. In Python, the syntax for access to a header field would remain message[0]['message-type'], but access to a body field in the second body part would change from message[2]['content'] to message[1][1]['content']. In GLib, the message would change from being a GPtrArray(GHashTable) to being a GValueArray(GHashTable, GPtrArray(GHashTable)) which is rather inconvenient to dereference.

In any group of parts with the same non-empty value for the alternative key (which represent alternative versions of the same content), more faithful versions of the intended message MUST come before less faithful versions (note that this order is the opposite of MIME multipart/alternative parts). Clients SHOULD display the first alternative that they understand.

Specifying the preference order means that if the underlying protocol doesn't support alternatives, the CM can safely delete everything apart from the first supported alternative when sending messages.

The order is the reverse of MIME because MIME's rationale for placing the "plainest" part first (legibility in pre-MIME UAs) does not apply to us, and placing the most preferred part first simplifies display (a client can iterate the message in order, display the first alternative that it understands, and skip displaying all subsequent parts with the same "alternative" key).

Clients SHOULD present all parts that are not redundant alternatives in the order they appear in this array, possibly excluding parts that are referenced by another displayed part. It is implementation-specific how the parts are presented to the user.

This allows CMs to assume that all parts are actually shown to the user, even if they are not explicitly referenced - we do not yet recommend formatted text, and there is no way for plain text to reference an attachment since it has no concept of markup or references. This also forces clients to do something sensible with messages that consist entirely of "attachments", with no "body" at all.

For instance, when displaying the above example, a client that understands the HTML part should display the JPEG image once, between the two lines "Here is a photo of my cat:" and "Isn't it cute?"; it may additionally present the image in some way for a second time, after "Isn't it cute?", or may choose not to.

A client that does not understand HTML, displaying the same message, should display the plain-text part, followed by the JPEG image.

Connection managers, clients and extensions to this specification SHOULD NOT include Handles as values in a Message_Part, except for message-sender in the header.

Reference-counting handles in clients becomes problematic if the channel proxy cannot know whether particular map values are handles or not.

Example messages

A rich-text message, with an embedded image, might be represented as:

[
  {
    'message-token': '9de9546a-3400-4419-a505-3ea270cb834c',
    'message-sender': 42,
    'message-sent': 1210067943,
    'message-received': 1210067947,
    'message-type': 0,              # = Channel_Text_Message_Type_Normal
    'pending-message-id': 437,
  },
  { 'alternative': 'main',
    'content-type': 'text/html',
    'content': 'Here is a photo of my cat:<br />' +
               '<img src="cid:catphoto" alt="lol!" />' +
               '<br />Isn't it cute?',
  },
  { 'alternative': 'main',
    'content-type': 'text/plain',
    'content': 'Here is a photo of my cat:\n[IMG: lol!]\nIsn't it cute?',
  },
  { 'identifier': 'catphoto',
    'content-type': 'image/jpeg',
    'size': 101000,
    'needs-retrieval': True,
  },
]

telepathy-ring, Nokia's GSM connection manager, represents vCards sent via SMS as:

[
  {
    'message-token': '9de9546a-3400-4419-a505-3ea270cb834c',
    'message-sender': 42,
    'message-sent': 1210067943,
    'message-received': 1210067947,
    'message-type': 0,              # = Channel_Text_Message_Type_Normal
    'pending-message-id': 437,
  },
  { 'content-type': 'text/x-vcard',
    'content': [ 0x66, 0x69, 0x71, ...], # vCard data as an array of bytes
  },
]

Delivery reports

Delivery reports are also represented as messages with the message-type header mapping to Channel_Text_Message_Type Delivery_Report. Delivery reports SHOULD contain the message-sender header, mapping to the intended recipient of the original message, if possible; other headers specific to delivery reports are defined by the Delivery_Report_Header_Key type. The second and subsequent parts, if present, are a human-readable report from the IM service.

For backwards- and forwards-compatibility, whenever a delivery error report is signalled—that is, with delivery-status mapping to Delivery_Status Temporarily_Failed or Permanently_Failed—SendError SHOULD also be emitted; whenever SendError is emitted, a delivery report MUST also be signalled. Delivery report messages on this interface MUST be represented in emissions of Received as messages with the Non_Text_Content Channel_Text_Message_Flags; clients which understand this interface SHOULD ignore the SendError signal in favour of listening for delivery reports, as mentioned in the introduction.

The result of attempting to send delivery reports using SendMessage is currently undefined.

Example delivery reports

A minimal delivery report indicating permanent failure of the sent message whose token was b9a991bd-8845-4d7f-a704-215186f43bb4 for an unknown reason
[{
# header
'message-sender': 123,
'message-type': Channel_Text_Message_Type_Delivery_Report,
'delivery-status': Delivery_Status_Permanently_Failed,
'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4',
}
# no body
]
A delivery report where the failed message is echoed back to the sender rather than being referenced by ID, and the failure reason is that this protocol cannot send messages to offline contacts such as the contact with handle 123
[{ # header
'message-sender': 123,
'message-type': Channel_Text_Message_Type_Delivery_Report,
'delivery-status': Delivery_Status_Temporarily_Failed,
'delivery-error': Channel_Text_Send_Error_Offline,
'delivery-echo':
    [{ # header of original message
    'message-sender': 1,
    'message-sent': 1210067943,
    },
    { # body of original message
    'content-type': 'text/plain',
    'content': 'Hello, world!',
    }]
  ],

# no body
]
A maximally complex delivery report: the server reports a bilingual human-readable failure message because the user sent a message "Hello, world!" with token b9a991bd-8845-4d7f-a704-215186f43bb4 to a contact with handle 123, but that handle represents a contact who does not actually exist
[{ # header
'message-sender': 123,
'message-type': Channel_Text_Message_Type_Delivery_Report,
'delivery-status': Delivery_Status_Permanently_Failed,
'delivery-error': Channel_Text_Send_Error_Invalid_Contact,
'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4',
'delivery-echo':
    [{ # header of original message
    'message-sender': 1,
    'message-sent': 1210067943,
    },
    { # body of original message
    'content-type': 'text/plain',
    'content': 'Hello, world!',
    }]
  ],
},
{ # message from server (alternative in English)
'alternative': '404',
'content-type': 'text/plain',
'lang': 'en',
'content': 'I have no contact with that name',
},
{ # message from server (alternative in German)
'alternative': '404'.
'content-type': 'text/plain',
'lang': 'de',
'content', 'Ich habe keinen Kontakt mit diesem Namen',
}
]
A minimal delivery report indicating successful delivery of the sent message whose token was b9a991bd-8845-4d7f-a704-215186f43bb4
[{
# header
'message-sender': 123,
'message-type': Channel_Text_Message_Type_Delivery_Report,
'delivery-status': Delivery_Status_Delivered,
'delivery-token': 'b9a991bd-8845-4d7f-a704-215186f43bb4',
}
# no body
]
A key, which SHOULD be one of the well-known keys specified by Message_Header_Key, Message_Body_Key or Delivery_Report_Header_Key if possible. The value corresponding to the given key, which SHOULD be one of the specified types for well-known keys.
Removed protocol-token—which had never been implemented—and respecified message-token not to have unimplementable uniqueness guarantees.

Well-known keys for the first Message_Part of a message, which contains metadata about the message as a whole, along with the corresponding value types. Some keys make sense for both incoming and outgoing messages, while others are only meaningful for one or the other.

message-token (s - Protocol_Message_Token)

An opaque identifier for the message, as used by the underlying protocol. For outgoing messages, this SHOULD be globally unique; for incoming messages, this is not guaranteed to uniquely identify a message, even within the scope of a single channel or contact; the only guarantee made is that two messages with different message-token headers are different messages.

Clients wishing to determine whether a new message with the scrollback header matches a previously-logged message with the same message-token SHOULD compare the message's sender, contents, message-sent or message-received timestamp, etc. Note that, in XMPP, the server only supplies a timestamp for scrollback messages, not for messages received while you are in a room; thus, non-scrollback messages will lack a message-sent timestamp.

In practice, most protocols do not provide globally-unique identifiers for messages. Connection managers, being stateless, do not have the necessary information — namely, IM logs — to generate reliable unique tokens for messages.

For instance, some XMPP clients (including Gabble) stamp messages they send with unique identifiers, but others number outgoing messages in a conversation from 1 upwards.

message-sent (x - Unix_Timestamp64)
The time the message was sent (if unavailable, the time it arrived at a central server MAY be used). Omitted if no reasonable approximation is available; SHOULD always be present on outgoing messages.
message-received (x - Unix_Timestamp64)
The time the message was received locally. SHOULD always be present.
message-sender (u - Contact_Handle)
The contact who sent the message. If 0 or omitted, the contact who sent the message could not be determined.
message-sender-id (s)
The identifier of the contact who sent the message, i.e. the result of calling InspectHandles on message-sender. If omitted, clients MUST fall back to looking at message-sender.
sender-nickname (s)
The nickname chosen by the sender of the message, which can be different for each message in a conversation.
message-type (u - Channel_Text_Message_Type)
The type of message; if omitted, Channel_Text_Message_Type_Normal MUST be assumed. MAY be omitted for normal chat messages.
supersedes (s – Protocol_Message_Token)
If present, this message supersedes a previous message, identified by its message-token header. The user interface MAY, for example, choose to replace the superseded message with this message, or grey out the superseded message. Skype, for example, allows the user to amend messages they have already sent (to correct typos, etc.). Connection Managers SHOULD represent repeatedly edited messages in the following form:
                message {token = a};
                message {token = b, supersedes = a};
                message {token = c, supersedes = a};
              
The alternative form is:
                  message {token = a};
                  message {token = b, supersedes = a};
                  message {token = c, supersedes = b};
                
but it is more difficult to implement in UIs/loggers, and it breaks irrecoverably if message b is lost. If a CM is forced to use this form, it should be tested extensively for interoperability with existing clients.
Clients should deal gracefully if the original message gets lost, but one or more corrections to it get through:
                message {token = x} gets lost;
                message {token = y, supersedes = x};
                message {token = z, supersedes = x};
              
This is the form that CMs will use to mean "I know that this message was edited, but I don't know what it originally said." It is often in the interests of the remote side for message x to be lost (e.g. to hide embarassing mistakes or sensitive information) so it might not be possible to retrieve it (even on protocols with reliable message-delivery guarantees).
original-message-sent (x - Unix_Timestamp64)
The message-sent header of the message that this one supersedes. This key should only be present if supersedes is also present. It MAY be used as a hint to help clients locate the original message in its logs. If present, comparing the tuple (original-message-sent, supersedes) with (message-sent, message-token) SHOULD be enough to uniquely identify the original message.
original-message-received (x - Unix_Timestamp64)
The message-received header of the message that this one supersedes. This key should only be present if supersedes is also present. It MAY be used as a hint in a similar way to original-message-sent.
pending-message-id (u - Message_ID)
The incoming message ID. This MUST NOT be present on outgoing messages. Clients SHOULD NOT store this key - it is only valid for as long as the message remains unacknowledged.
interface (s - DBus_Interface)
This message is specific to the given interface, which is neither Text nor Messages. It SHOULD be ignored if that interface is not supported. (Note that an 'interface' key can also appear on the second and subsequent parts, where it indicates that that part (only) should be ignored if unsupported.)
scrollback (b)
If present and true, the incoming message was part of a replay of message history (this matches the Scrollback flag in Channel_Text_Message_Flags). This flag does not make sense on outgoing messages and SHOULD NOT appear there.
rescued (b)
If present and true, the incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (in which the message now appears) to open. This matches the Rescued flag in Channel_Text_Message_Flags; it does not make sense on outgoing messages, and SHOULD NOT appear there.

Well-known keys for the second and subsequent Message_Parts of a message, which contain the message content, along with the corresponding value types.

identifier (s — Protocol_Content_Identifier)
An opaque identifier for this part. Parts of a message MAY reference other parts by treating this identifier as if it were a MIME Content-ID and using the cid: URI scheme.
alternative (s)

If present, this part of the message is an alternative for all other parts with the same value for "alternative". Clients SHOULD only display one of them (this is expected to be used for XHTML messages in a future version of this specification).

If omitted, this part is not an alternative for any other part.

Parts of a message MAY reference the group of alternatives as a whole (i.e. a reference to whichever of them is chosen) by treating this identifier as if it were the MIME Content-ID of a multipart/alternative part, and using the cid: URI scheme.

content-type (s)

The MIME type of this part. See the documentation for MessageReceived and MessageSent for notes on the special status of "text/plain" parts.

Connection managers MUST NOT signal parts without a 'content-type' key; if a protocol provides no way to determine the MIME type, the connection manager is responsible for guessing it, but MAY fall back to "text/plain" for text and "application/octet-stream" for non-text.

Clients MUST ignore parts without a 'content-type' key, which are reserved for future expansion.

When sending messages, clients SHOULD normalize the content-type to lower case, but connection managers SHOULD NOT rely on this. When signalling sent or received messages, connection managers MUST normalize the content-type to lower case.

lang (s)
The natural language of this part, identified by a RFC 3066 language tag. XMPP allows alternative-selection by language as well as by content-type.
size (u)
The size in bytes (if needs-retrieval is true, this MAY be an estimated or approximate size). SHOULD be omitted if 'content' is provided. There's no point in providing the size if you're already providing all the content.
thumbnail (b)

This part is a thumbnail. To represent an image together with its thumbnail in a single message, there should be one part for the full image followed by a part for the thumbnail (following the “more complete versions first” requirement), with the same 'alternative' value. For example:

[ ... ,
  { 'alternative': 'catphoto',
    'content-type': 'image/jpeg',
    'size': 150000,
    'content': [0xFF, 0xD8, ... 0xFF 0xD9],
  },
  { 'alternative': 'catphoto',
    'content-type': 'image/jpeg'
    'size': 1024,
    'thumbnail': True,
    'content': [0xFF, 0xD8, ... 0xFF 0xD9],
  },
  ...
]
needs-retrieval (b)
If false or omitted, the connection manager already holds this part in memory. If present and true, this part must be retrieved on demand (like MIME's message/external-body) by a mechanism to be defined later. The mechanism was meant to be GetPendingMessageContent, but that didn't work out. It's worth leaving the header in in preparation for a future mechanism.
truncated (b)
The content available via the 'content' key has been truncated by the server or connection manager (equivalent to Channel_Text_Message_Flag_Truncated in the Text interface).
content (s or ay)
The part's content, if it is available and sufficiently small to include here (implies that 'needs-retrieval' is false or omitted). Otherwise, omitted. If the part is human-readable text or HTML, the value for this key MUST be a UTF-8 string (D-Bus signature 's'). If the part is not text, the value MUST be a byte-array (D-Bus signature 'ay'). If the part is a text-based format that is not the main body of the message (e.g. an iCalendar or an attached XML document), the value SHOULD be a UTF-8 string, transcoding from another charset to UTF-8 if necessary, but MAY be a byte-array (of unspecified character set) if transcoding fails or the source charset is not known.
interface (s - DBus_Interface)
This part is specific to the given interface, which is neither Text nor Messages. It SHOULD be ignored if that interface is not supported. (Note that an 'interface' key can also appear on the first part, where it indicates that the entire message should be ignored if unsupported.)

Well-known keys for the first Message_Part of a delivery report, along with the corresponding value types. Some of these are special-cases of headers defined by Message_Header_Key.

message-sender (u - Contact_Handle, as defined by Message_Header_Key)
MUST be the intended recipient of the original message, if available (zero or omitted if the intended recipient is unavailable or is not a contact, e.g. a chatroom), even if the delivery report actually came from an intermediate server.
message-type (u - Channel_Text_Message_Type, as defined by Message_Header_Key)
MUST be Channel_Text_Message_Type_Delivery_Report.
delivery-status (u - Delivery_Status)
The status of the message. All delivery reports MUST contain this key in the first Message_Part.
delivery-token (s - Protocol_Message_Token)

An identifier for the message to which this delivery report refers. MUST NOT be an empty string. Omitted if not available.

Clients may match this against the token produced by the SendMessage method and MessageSent signal. A status report with no token could match any sent message, and a sent message with an empty token could match any status report. If multiple sent messages match, clients SHOULD use some reasonable heuristic.

In an ideal world, we could unambiguously match reports against messages; however, deployed protocols are not ideal, and not all reports and messages can be matched.
delivery-error (u - Channel_Text_Send_Error)
The reason for the failure. MUST be omitted if this was a successful delivery; SHOULD be omitted if it would be Channel_Text_Send_Error_Unknown.
delivery-dbus-error (s - DBus_Error_Name)
The reason for the failure, specified as a (possibly implementation-specific) D-Bus error. MUST be omitted if this was a successful delivery. If set, the 'delivery-error' key SHOULD be set to the closest available value.
delivery-error-message (s)
Debugging information on why the message could not be delivered. MUST be omitted if this was a successful delivery; MAY always be omitted.
delivery-echo (aa{sv} - Message_Part[])

The message content, as defined by the Messages interface. Omitted if no content is available. Content MAY have been truncated, message parts MAY have been removed, and message parts MAY have had their content removed (i.e. the message part metadata is present, but the 'content' key is not).

Some protocols, like XMPP, echo the failing message back to the sender. This is sometimes the only way to match it against the sent message, so we include it here.
This type is only used by GetPendingMessageContent, which is unimplemented and deprecated. The index of a message part within a message. This structure is only used by GetPendingMessageContent, which is unimplemented and deprecated. A mapping from message part indexes to their content, as returned by GetPendingMessageContent. Indexes into the array of Message_Parts that represents a message. The "headers" part (which is not a valid argument to GetPendingMessageContent) is considered to be part 0, so the valid part numbers start at 1 (for the second message part). The message part's content. The variant MUST contain either type 's' or 'ay' (UTF-8 text string, or byte array), following the same rules as for the value of the 'content' key in the Message_Part mappings.

An opaque token used to identify messages in the underlying. protocol. As a special case, the empty string indicates that there is no particular identification for a message.

CM implementations SHOULD use an identifier expected to be unique, such as a UUID, for outgoing messages (if possible).

Some protocols can only track a limited number of messages in a small message-ID space (SMS messages are identified by a single byte), and some implementations send non-unique identifiers (some XMPP clients use very simple message IDs, such as an incrementing integer that resets to 1 at the beginning of each connection). As a result, clients MUST NOT assume that protocol tokens will not be re-used.

In particular, clients SHOULD use a heuristic to assign delivery reports to messages, such as matching on message content or timestamp (if available), or assuming that the delivery report refers to the most recent message with that ID.

A protocol-specific identifier for a blob of content, as used for the identifier key in a Message_Part. The same identifier MAY be re-used if the same content, byte-for-byte, appears as a part of several messages.

On XMPP, these identifiers might be Content-IDs for custom smileys implemented using XEP-0232 Bits of Binary; the same smiley might well appear in multiple messages.

Submit a message to the server for sending. If this method returns successfully, the message has been submitted to the server and the MessageSent signal is emitted. A corresponding Sent signal on the Text interface MUST also be emitted.

This method MUST return before the MessageSent signal is emitted.

This means that the process sending the message is the first to see the Protocol_Message_Token, and can relate the message to the corresponding MessageSent signal by comparing message tokens (if supported by the protocol).

If this method fails, message submission to the server has failed and no signal on this interface (or the Text interface) is emitted.

If this method succeeds, message submission to the server has succeeded, but the message has not necessarily reached its intended recipient. If a delivery failure is detected later, this is signalled by receiving a message whose message-type header maps to Delivery_Report. Similarly, if delivery is detected to have been successful (which is not possible in all protocols), a successful delivery report will be signalled.

The message content, including any attachments or alternatives. This MUST NOT include the following headers, or any others that do not make sense for a client to specify: message-sender, message-sender-id, message-sent, message-received, pending-message-id. Flags affecting how the message is sent. The channel MAY ignore some or all flags, depending on DeliveryReportingSupport; the flags that were handled by the CM are provided in MessageSent. An opaque token used to match any incoming delivery or failure reports against this message, or an empty string if the message is not readily identifiable. The requested message is malformed and cannot be sent.
Flags altering the way a message is sent. The "most usual" action should always be to have these flags unset. Some indication of which flags are supported is provided by the DeliveryReportingSupport property.

Provide a successful delivery report if possible, even if this is not the default for this protocol. Ignored if delivery reports are not possible on this protocol.

In some protocols, like XMPP, it is not conventional to request or send positive delivery notifications.

Delivery failure reports SHOULD always be sent, but if this flag is present, the connection manager MAY also try harder to obtain failed delivery reports or allow them to be matched to outgoing messages.

Provide a delivery report when the message is read by the recipient, even if this is not the default for this protocol. Ignored if read reports are not possible on this protocol.

Provide a delivery report when the message is deleted by the recipient, even if this is not the default for this protocol. Ignored if such reports are not possible on this protocol.

Signals that a message has been submitted for sending. This MUST be emitted exactly once per emission of the Sent signal on the Text interface, for backwards-compatibility; clients SHOULD ignore the latter if this interface is present, as mentioned in the introduction.

This SHOULD be emitted as soon as the CM determines it's theoretically possible to send the message (e.g. the parameters are supported and correct).

This signal allows a process that is not the caller of SendMessage to log sent messages.

The message content (see Message_Part for full details). If the message that was passed to SendMessage has a formatted text part that the connection manager recognises, but no text/plain alternative, the CM MUST use the formatted text part to generate a text/plain alternative which is also included in this signal argument.

The connection manager SHOULD include the message-sender, message-sender-id and message-sent headers in the representation of the message that is signalled here. If the channel has channel-specific handles, the message-sender and message-sender-id SHOULD reflect the sender that other contacts will see.

If the connection manager can predict that the message will be altered during transmission, this argument SHOULD reflect what other contacts will receive, rather than being a copy of the argument to SendMessage (if the message is truncated, formatting or alternatives are dropped, etc., then the edited version SHOULD appear in this signal).

Flags affecting how the message was sent. The flags might be a subset of those passed to SendMessage if the caller requested unsupported flags.

An opaque token used to match any incoming delivery or failure reports against this message, or an empty string if the message is not readily identifiable.

A list of incoming messages that have neither been acknowledged nor rejected. This list is a more detailed version of the one returned by Text.ListPendingMessages, and contains the same messages, uniquely identified by the same pending message IDs. Its items can be removed using Text.AcknowledgePendingMessages.

Change notification is via MessageReceived and PendingMessagesRemoved.

The messages with the given IDs have been removed from the PendingMessages list. Clients SHOULD NOT attempt to acknowledge those messages. This completes change notification for the PendingMessages property (previously, there was change notification when pending messages were added, but not when they were removed). The messages that have been removed from the pending message list. This method has never been implemented, and in any case would have been impossible to use correctly when multiple clients (such as a logger and the handler) are interested in a text channel. See freedesktop.org bug #26417 for more details. Retrieve the content of one or more parts of a pending message. Note that this function may take a considerable amount of time to return if the part's 'needs-retrieval' flag is true; consider extending the default D-Bus method call timeout. Additional API is likely to be added in future, to stream large message parts. The ID of a pending message The desired entries in the array of message parts, identified by their position. The "headers" part (which is not a valid argument to this method) is considered to be part 0, so the valid part numbers start at 1 (for the second Message_Part).

The content of the requested parts. The keys in this mapping are positions in the array of message parts; the values are either of type 's' or 'ay' (UTF-8 text string, or byte array), following the same rules as for the value of the 'content' key in the Message_Part mappings.

If the one of the requested part numbers was greater than zero but referred to a part that had no content (i.e. it had no 'content-type' key or no 'content' key), it is simply omitted from this mapping; this is not considered to be an error condition.

Either there is no pending message with the given message ID, or one of the part numbers given was 0 or too large.
Signals that a message has been received and added to the pending messages queue. This MUST be emitted exactly once per emission of the Received signal on the Text interface, for backwards-compatibility; clients SHOULD ignore the latter in favour of this signal if this interface is present, as mentioned in the introduction.

The message content, including any attachments or alternatives. If the incoming message contains formatted text without a plain text alternative, the connection manager MUST generate a text/plain alternative from the formatted text, and include it in this message (both here, and in the PendingMessages property).

The status of a message as indicated by a delivery report.

If this enum is extended in future specifications, this should only be to add new, non-overlapping conditions (i.e. all failures should still be signalled as either Temporarily_Failed or Permanently_Failed). If additional detail is required (e.g. distinguishing between the various types of permanent failure) this will be done using additional Delivery_Report_Header_Keys.

The message's disposition is unknown. Clients SHOULD consider all messages to have status Delivery_Status_Unknown unless otherwise specified; connection managers SHOULD NOT signal this delivery status explicitly. The message has been delivered to the intended recipient. Delivery of the message has failed. Clients SHOULD notify the user, but MAY automatically try sending another copy of the message. Similar to errors with type="wait" in XMPP; analogous to 4xx errors in SMTP. Delivery of the message has failed. Clients SHOULD NOT try again unless by specific user action. If the user does not modify the message or alter configuration before re-sending, this error is likely to happen again. Similar to errors with type="cancel", type="modify" or type="auth" in XMPP; analogous to 5xx errors in SMTP. An intermediate server has accepted the message but the message has not been yet delivered to the ultimate recipient. The connection manager might send a Failed report or Delivered report later. Similar to "202 Accepted" success code in SIP; analogous to 251 and 252 responses in SMTP. The message has been read by the intended recipient. The message has been deleted by the intended recipient. This MAY be signalled on its own if the message is deleted without being read, or after Read if the message was read before being deleted.
Flags indicating the level of support for delivery reporting on this channel, as found on the DeliveryReportingSupport property. Any future flags added to this set will conform to the convention that the presence of an extra flag implies that more operations will succeed. Note that CMs may always provide more reports than are requested in the Message_Sending_Flags passed to SendMessage. If senders want delivery reports, they should ask for them. If they don't want delivery reports, they can just ignore them, so there's no need to have capability discovery for what will happen if a delivery report isn't requested. Clients MAY expect to receive negative delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending. Clients MAY expect to receive positive delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending. Clients MAY expect to receive Delivery_Status Read reports if Message_Sending_Flag_Report_Read is specified when sending. Clients MAY expect to receive Delivery_Status Deleted reports if Message_Sending_Flag_Report_Deleted is specified when sending. A bitfield indicating features supported by this channel.
telepathy-glib-0.24.2/spec/Channel_Interface_Addressing.xml0000644000175000017500000001221712652510705020607 00000000000000 Copyright © 2010 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as draft)

This interface provides properties that can be used for requesting channels through different contact addressing schemes like vCard addresses or URIs.

The vCard field, normalized to lower case, TargetVCardAddress refers to.

The url vCard field MUST NOT appear here; see TargetURI instead.

In practice, protocols have a limited set of URI schemes that make sense to resolve as a contact.

If this is omitted from a request, TargetVCardAddress MUST be omitted as well.

The URI scheme used in TargetURI

While this seems redundant, since the scheme is included in TargetURI, it exists for constructing RequestableChannelClasses that support a limited set of URI schemes.

If this is omitted from a request, TargetURI MUST be omitted as well.

The vCard address of the Channel's target.

If this is present in a channel request, TargetVCardField MUST be present, and TargetHandle, TargetID, and TargetURI MUST NOT be present. TargetHandleType must either not be present or set to Handle_Type_Contact. The request MUST fail with error InvalidHandle, without side-effects, if the requested vCard address cannot be found.

The URI of the Channel's target. The URI's scheme (i.e. the part before the first colon) MUST be identical to TargetURIScheme.

If this is present in a channel request, TargetVCardField MUST be present, and TargetHandle, TargetID, and TargetVCardAddress MUST NOT be present. TargetHandleType must either not be present or set to Handle_Type_Contact. The request MUST fail with error InvalidHandle, without side-effects, if the requested vCard address cannot be found.

telepathy-glib-0.24.2/spec/Media_Session_Handler.xml0000644000175000017500000000702212652510705017271 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Use StreamHandler.Error on each StreamHandler object instead. Informs the connection manager that an error occured in this session. If used, the connection manager must terminate the session and all of the streams within it, and may also emit a StreamError signal on the channel for each stream within the session. The path of a new object implementing the StreamHandler interface. The unique ID of the new stream Type of media that this stream should handle Direction of this stream Emitted when a new stream handler has been created for this session. Inform the connection manager that a client is ready to handle this session handler (i.e. that it has connected to the NewStreamHandler signal and done any other necessary setup). An media session handler is an object that handles a number of synchronised media streams.
telepathy-glib-0.24.2/spec/Connection_Interface_Simple_Presence.xml0000644000175000017500000007252112652510705022334 00000000000000 Copyright (C) 2005-2008 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A struct representing the presence of a contact. The presence type, e.g. Connection_Presence_Type_Away. The string identifier of the status, e.g. "brb", as defined in the Statuses property.

The user-defined status message, e.g. "Back soon!".

Clients SHOULD set the status message for the local user to the empty string, unless the user has actually provided a specific message (i.e. one that conveys more information than the Status).

User interfaces SHOULD regard an empty status message as unset, and MAY replace it with a localized string corresponding to the Status or Type.

Use case: Daf sets his status in Empathy by choosing the Welsh translation of "Available" from a menu. It is more informative for his English-speaking colleagues to see the English translation of "Available" (as localized by their own clients) than to see "Ar Gael" (which they don't understand anyway).
Mapping returned by GetPresences and signalled by PresencesChanged, indicating the presence of a number of contacts. A contact The contact's presence A struct containing information about a status. The type of a presence. This SHOULD NOT be used as a way to set statuses that the client does not recognise (as explained in SetPresence), but MAY be used to check that the client's assumptions about a particular status name match the connection manager's. If true, the user can set this status on themselves using SetPresence. If true, a non-empty message can be set for this status. Otherwise, the empty string is the only acceptable message. On IRC you can be Away with a status message, but if you are available you cannot set a status message. A mapping describing possible statuses. The string identifier of this status. Details of this status.

The string identifier of the desired status. Possible status identifiers are defined in the Statuses property.

Clients MUST NOT set a status whose string value they do not recognise, even if its presence type in Statuses matches what the user requested.

Suppose a protocol has statuses that include 'phone' (of type BUSY) and 'in-a-meeting' (of type BUSY), but there is no generic 'busy' status.

If the user requests "Busy" status from a menu, a client author might be tempted to pick an arbitrary status that has type BUSY. However, on this protocol, neither of the choices would be appropriate, and incorrect information about the user would be conveyed.

Statuses whose Connection_Presence_Type is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.

To go offline, call Disconnect instead. The "error" and "unknown" statuses make no sense.

The status message associated with the current status.

Request that the presence status and status message are published for the connection. Changes will be indicated by PresencesChanged signals being emitted.

This method may be called on a newly-created connection while it is still in the DISCONNECTED state, to request that when the connection connects, it will do so with the selected status.

In DISCONNECTED state the Statuses property will indicate which statuses are allowed to be set while DISCONNECTED (none, if the Connection Manager doesn't allow this). This value MUST NOT be cached, as the set of allowed presences might change upon connecting.

Either the specified status is not supported, the specified status cannot be set on the user themselves, or a non-empty message was supplied for a status that does not accept a message.
An array of the contacts whose presence should be obtained.

Presence information in the same format as for the PresencesChanged signal. The returned mapping MUST include an entry for each contact in the method's argument.

The definition of the connection presence types Unknown and Offline means that if a connection manager will return Unknown for contacts not on the subscribe list, it MUST delay the reply to this method call until it has found out which contacts are, in fact, on the subscribe list.

Get presence previously emitted by PresencesChanged for the given contacts. Data is returned in the same structure as the PresencesChanged signal; no additional network requests are made. While discovering the subscribe list in order to distinguish between Unknown and Offline statuses, a network error occurred.

A dictionary where the keys are the presence statuses that are available on this connection, and the values are the corresponding presence types.

While the connection is in the DISCONNECTED state, it contains the set of presence statuses allowed to be set before connecting. The connection manager will attempt to set the appropriate status when the connection becomes connected, but cannot necessarily guarantee it. The available statuses cannot change until the connection status changes, so there is no change notification.

While the connection is in the CONNECTED state, this property contains the set of presence statuses which are actually available on this protocol. This set is constant for the remaining lifetime of the connection, so again, there is no change notification.

While the connection is in the CONNECTING state, the value of this property is undefined and SHOULD NOT be used. It can change at any time without notification (in particular, any cached values from when the connection was in the DISCONNECTED or CONNECTING state MUST NOT be assumed to still be correct when the state has become CONNECTED).

This property MUST include the special statuses "unknown" and "error" if and only if the connection manager can emit them as a contact's status.

For instance, connection managers for local-xmpp (XEP-0174) would omit "unknown" since there is no such concept.

The maximum length in characters for any individual status message, or 0 if there is no limit.

While the connection is in the DISCONNECTED state, this property will be 0. The connection manager will attempt to set the appropriate value when the connection becomes connected, but cannot necessarily guarantee it. The maximum length cannot change until the connection status changes, so there is no change notification.

While the connection is in the CONNECTED state, this property contains the maximum length in characters for any individual status message which is actually allowed on this protocol. This value is constant for the remaining lifetime of the connection, so again, there is no change notification.

While the connection is in the CONNECTING state, the value of this property is undefined and SHOULD NOT be used. It can change at any time without notification (in particular, any cached values from when the connection was in the DISCONNECTED or CONNECTING state MUST NOT be assumed to still be correct when the state has become CONNECTED).

If a message passed to SetPresence is longer than allowed by this property, the connection manager MUST truncate the supplied message; when emitting PresencesChanged, the truncated version of the message MUST be used.

Some XMPP servers, like Google Talk, define a maximum length for status messages. Whether the user's server is one of these cannot be detected until quite late in the connection process.

A dictionary of contact handles mapped to the status, presence type and status message. This signal should be emitted when your own presence has been changed, or the presence of the member of any of the connection's channels has been changed. An invalid presence type used as a null value. This value MUST NOT appear in the Statuses property, or in the result of GetStatuses on the deprecated Presence interface. Offline Available Away Away for an extended time Hidden (invisible) Busy, Do Not Disturb. Unknown, unable to determine presence for this contact, for example if the protocol only allows presence of subscribed contacts. Error, an error occurred while trying to determine presence. The message, if set, is an error from the server.

A type for communication access control. These control policies are used in CommunicationPolicy.DRAFT as well as most rich presence interfaces.

New interfaces should use this type, and NOT Rich_Presence_Access_Control_Type.

Only allow contacts that are in a certain whitelist.

The associated variant in Access_Control is a list of Contact_Handle representing the whitelist, with signature au.

Allow contacts in the user's 'publish' list. The associated variant in Access_Control is ignored.

Only allow contacts that are in a certain group.

The associated variant in Access_Control is a Group_Handle representing the permitted group.

Allow all contacts. The associated variant in Access_Control is ignored. Allow all contacts in the user's 'subscribe' or 'publish' list. The associated variant in Access_Control is ignored. Forbid all contacts. The associated variant in Access_Control is ignored.

The access control rule is too complex to be represented in the current Telepathy API. The associated variant is meaningless. Setting this mode is never valid; the connection manager MUST raise an error if this is attempted.

XEP-0016 Privacy Lists can easily produce access control mechanisms that can't be expressed in a simpler API. We need to be able to at least indicate that fact.

The associated variant in Access_Control is ignored.

A type of access control for Rich_Presence_Access_Control. For most types, the exact access control is given by an associated variant.

These are the access control types from XMPP publish/subscribe (XEP-0060).

Location uses this for historical reasons, new interfaces will use Access_Control_Type.

The associated variant is a list of contacts (signature 'au', Contact_Handle[]) who can see the extended presence information. All contacts in the user's 'publish' contact list can see the extended presence information. The associated variant is ignored. The associated variant is a handle of type Group (signature 'u', Group_Handle) representing a group of contacts who can see the extended presence information. Anyone with access to the service can see the extended presence information.

An access control mode for extended presence items like geolocation. This type isn't actually used by the SimplePresence interface, but it's included here so it can be referenced by rich presence interfaces.

New interfaces should use this type, and NOT Rich_Presence_Access_Control.

The type of access control to apply. Any additional information required by the Type. The required type and semantics are defined for each Access_Control_Type.

An access control mode for extended presence items like geolocation. This type isn't actually used by the SimplePresence interface, but it's included here so it can be referenced by rich presence interfaces such as Location.

Location uses this for historical reasons, new interfaces will use Access_Control_Type.

The type of access control to apply. Any additional information required by the Type. The required type and semantics are defined for each Rich_Presence_Access_Control_Type.

The same struct that would be returned by GetPresences (always present with some value if information from the SimplePresence interface was requested)

This interface is for services which have a concept of presence which can be published for yourself and monitored on your contacts.

Presence on an individual (yourself or one of your contacts) is modelled as a status and a status message. Valid statuses are defined per connection, and a list of those that can be set on youself can be obtained from the Statuses property.

Each status has an arbitrary string identifier which should have an agreed meaning between the connection manager and any client which is expected to make use of it. The following well-known values should be used where possible to allow clients to identify common choices:

Status identifier Connection_Presence_Type Remarks
"available" Available
"chat" Available Actively interested in chatting, as opposed to merely available.
"pstn" Available This contact is actually a phone number, not an IM account. As such, the contact is conceptually always available, but not in the same way that a contact can set their IM status to “available”. It does not make sense to allow the user to set this status on herself; hence, on protocols where this status is supported, its entry in Statuses SHOULD have May_Set_On_Self set to False.
"away" Away
"brb" Away Be Right Back (a more specific form of Away)
"busy" Busy
"dnd" Busy Do Not Disturb (a more specific form of Busy)
"xa" Extended_Away Extended Away
"hidden" Hidden Also known as "Invisible" or "Appear Offline"
"offline" Offline
"unknown" Unknown special, see below
"error" Error special, see below

As well as these well-known status identifiers, every status also has a numerical type value chosen from Connection_Presence_Type which can be used by the client to classify even unknown statuses into different fundamental types.

These numerical types exist so that even if a client does not understand the string identifier being used, and hence cannot present the presence to the user to set on themselves, it may display an approximation of the presence if it is set on a contact.

As well as the normal status identifiers, there are two special ones that may be present: 'unknown' with type Unknown and 'error' with type Error. 'unknown' indicates that it is impossible to determine the presence of a contact at this time, for example because it's not on the 'subscribe' list and the protocol only allows one to determine the presence of contacts you're subscribed to. 'error' indicates that there was a failure in determining the status of a contact.

If the connection has a 'subscribe' contact list, PresencesChanged signals should be emitted to indicate changes of contacts on this list, and should also be emitted for changes in your own presence. Depending on the protocol, the signal may also be emitted for others such as people with whom you are communicating, and any user interface should be updated accordingly.

telepathy-glib-0.24.2/spec/Channel_Type_Contact_List.xml0000644000175000017500000001256712652510705020143 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Replaced by Connection.Interface.ContactList

A channel type for representing a list of people on the server which is not used for communication. This is intended for use with the interface Channel.Interface.Group for managing buddy lists and privacy lists on the server. This channel type has no methods because all of the functionality it represents is available via the group interface.

There are currently two types of contact list: HANDLE_TYPE_LIST is a "magic" server-defined list, and HANDLE_TYPE_GROUP is a user-defined contact group.

For server-defined lists like the subscribe list, singleton instances of this channel type should be created by the connection manager at connection time if the list exists on the server, or may be requested by using the appropriate handle. These handles can be obtained using RequestHandles with a Handle_Type of HANDLE_TYPE_LIST and one of the following identifiers:

  • subscribe - the group of contacts for whom you receive presence
  • publish - the group of contacts who may receive your presence
  • hide - a group of contacts who are on the publish list but are temporarily disallowed from receiving your presence
  • allow - a group of contacts who may send you messages
  • deny - a group of contacts who may not send you messages
  • stored - on protocols where the user's contacts are stored, this contact list contains all stored contacts regardless of subscription status.

A contact can be in several server-defined lists. All lists are optional to implement. If RequestHandles or RequestChannel for a particular contact list raises an error, this indicates that the connection manager makes no particular statement about the list's contents; clients MUST NOT consider this to be fatal.

If a client wants to list all of a user's contacts, it is appropriate to use the union of the subscribe, publish and stored lists, including the local and remote pending members.

For example in XMPP, contacts who have the subscription type "none", "from", "to" and "both" can be respectively in the lists:

  • "none": stored
  • "from": stored and publish
  • "to": stored and subscribe
  • "both": stored, publish and subscribe

These contact list channels may not be closed.

For user-defined contact groups, instances of this channel type should be created by the connection manager at connection time for each group that exists on the server. New, empty groups can be created by calling RequestHandles with a Handle_Type of HANDLE_TYPE_GROUP and with the name set to the human-readable UTF-8 name of the group.

User-defined groups may be deleted by calling Close on the channel, but only if the group is already empty. Closing a channel to a non-empty group is not allowed; its members must be set to the empty set first.

On some protocols (e.g. XMPP) empty groups are not represented on the server, so disconnecting from the server and reconnecting might cause empty groups to vanish.

telepathy-glib-0.24.2/spec/Channel_Interface_Picture.xml0000644000175000017500000001740312652510705020141 00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

An interface channels can implement to support a picture. Most of the time this will be implemented by channels implementing the Room2 interface. Note that this interface is not restricted to Text channels, and can also be used on Call channels.

This is a separate interface from RoomConfig1 because (a) it's possible some protocol might support pictures for 1:1 chats; and (b) it avoids downloading an unwanted picture in a GetAll request.
The new picture. The MIME type.

Set the room's picture. Clients SHOULD look at the picture flags before calling this method as the user might not have permission to set the picture.

A successful return of this method indicates a successful change in picture, but clients should still listen for changes to the Picture property for further changes by other users or the server.

Picture is somehow invalid: e.g. unsupported MIME type, too big, etc.

The picture representing this channel.

This property may change during the lifetime of the channel and MUST not be included in a channel request.

The normalized contact ID representing who last modified the picture, or the empty string if it is not known.

The handle corresponding to Actor, or 0 if the Actor is unknown.

A unix timestamp indicating when the picture was last modified, or INT_MAX64 if unknown.

TRUE if the Picture property can be set by the user by calling SetPicture, otherwise FALSE.

If implementations are unsure of what this value should be it SHOULD still be set to what it believes the value is. As a result, clients should be aware that SetPicture can still fail even with this property set to TRUE.

An array of supported MIME types (e.g. "image/jpeg"). Clients MAY assume that the first type in this array is preferred. The minimum height in pixels of the picture, which MAY be 0. The minimum width in pixels of the picture, which MAY be 0. The recommended height in pixels of the picture, or 0 if there is no preferred height. The recommended width in pixels of the picture, or 0 if there is no preferred width. The maximum height in pixels of the picture, or 0 if there is no limit. The maximum width in pixels of the picture, or 0 if there is no limit. The maximum size in bytes of the picture, or 0 if there is no limit.
telepathy-glib-0.24.2/spec/Channel_Interface_Mergeable_Conference.xml0000644000175000017500000001164612652510705022543 00000000000000 Copyright © 2009 Collabora Limited Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for multi-user conference channels that can have additional individual channels merged into them after they are created.

This interface addresses part of freedesktop.org bug #24906 (GSM-compatible conference calls). GSM is currently the only protocol known to implement this; PBXs might implement it too.

It might be made into a mandatory-to-implement part of Conference, or kept as a separate interface, when stabilized.

Request that the given channel be incorporated into this channel.

The given channel SHOULD be added to Conference.Channels if and only if the underlying protocol signals the merge in some way. It MUST NOT be added to Conference.InitialChannels (to preserve immutability).

In GSM it is possible to merge additional calls into an ongoing conference.

In XMPP this method could be implemented to merge a 1-1 Text channel into a MUC Text channel by inviting the peer from the Text channel into the MUC, or to merge a 1-1 Jingle call into a Muji call by inviting the peer from the Jingle call into the Muji call. (MUC and Muji channels are both implemented by XMPP MUCs, with Handle_Type_Room.)

A channel with the same ChannelType as this one, but with TargetHandleType = CONTACT.

The given channel isn't suitable for merging into this one: for instance, it might have the wrong channel type or handle type. It will never be possible to merge channels into this particular conference. The given channel is theoretically suitable for merging into this one, but that's not currently possible for some reason (for instance, this SHOULD be raised if a limit on the number of channels in a conference is exceeded). [FIXME: PermissionDenied?]
telepathy-glib-0.24.2/spec/Connection_Interface_Anonymity.xml0000644000175000017500000001702512652510705021244 00000000000000 Copyright © 2008-2010 Nokia Corporation Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface to support anonymity settings on a per-connection basis. This defines what personal identifying information a remote contact may or may not see. For example, GSM might use this for CLIR, while SIP might use this for privacy service requests.

Flags for the various types of anonymity modes. These modes are solely to inform the CM of the desired anonymous settings. It is up to the CM to determine whether the anonymity modes should be handled within the CM itself, or whether the network that a CM might be talking to should be enforcing anonymity.

CMs MAY support only a subset of these modes, and specific connections MAY support none at all.

Obscure any information that provides user identification, user-agent identification or personal details. Examples of this information might be GSM CallerID, SIP from address, various informational email headers, etc.

The CM should scrub/replace any of this information before passing messages or data onto the network. Note that a CM which has the option of obscuring the information at the CM or privacy service level would choose both (anonymity services are opaque to clients of this interface).

Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info.

Explicitly request showing of client information. In connection context, this can be used to override service default. In channel context, this overrides connection anonymity modes.

In GSM, it's possible to have CLIR enabled by default, and explicitly suppress CLIR for a single phone call.

Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info. The CM MAY set both Client_Info and Show_Client_Info in SupportedAnonymityModes to indicate its support for explicitly hiding and publicising client information.

Obscure any originating IP address information, contact URIs, and anonymize all traffic involved with sending/receiving any media streams or call content. Examples of this include the "headers" portions of RFC 3323 as well as the History-Info (described in RFC 4244) for a SIP CM.

This SHOULD have the effect of hiding address information from the remote contact (ie, the contact cannot know what IP address the session is originated from). Obviously the network still needs to be able to route information between contacts, so this provides no guarantees of what can be seen by intermediaries.

The anonymity modes supported by the CM for this connection. Once Connection.Status has moved to Connected, this property MUST NOT change.

This specifies whether or not the anonymity settings MUST be respected by the CM and any intermediaries between the local and remote contacts. If this is set to true but anonymity settings cannot be followed, then the session MUST be denied with a org.freedesktop.Telepathy.Error.WouldBreakAnonymity error. Any client that sets AnonymityModes SHOULD also set this property first (rather than accepting the CM's default value).

The currently enabled anonymity modes for the connection. Setting has the effect of requesting new modes for the connection, and may raise an error if the unsupported modes are set. Successfully changing the modes will result in emission of AnonymityModesChanged signal.

An unsupported mode was supplied. Supported modes are specified in the SupportedAnonymityModes property, and this should be checked prior to setting AnonymityModes.
Emitted when the anonymity mode has changed. The new anonymity modes for this connection.
telepathy-glib-0.24.2/spec/Connection_Interface_Balance.xml0000644000175000017500000001433512652510705020603 00000000000000 Copyright © 2009 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

In many real-time communication services the user can pay for certain services, typically calls to the PSTN, in advance. In (at least) Skype, it's possible to query the current balance in a machine-readable way.

An amount of money in a specified currency. For example, 3.21 British pounds would conventionally be represented by (Amount = 321, Scale = 2, Currency = "GBP"), but could be represented by (Amount = 3210, Scale = 3, Currency = "GBP") in a service that records balance in units of 0.001 pounds.

As a special case, if Amount = 0, Scale = 2**32 - 1 (i.e. the largest possible 32-bit unsigned integer) and Currency = "", this indicates an unknown amount.

The amount, expressed as a fixed-point number with decimal scale defined by the Scale field; for instance, an Amount value of 1234 with Scale of 2 represents 12.34 in the currency unit given by the Currency field.

The decimal scale for the fixed point value of the Amount field, defining the number of rightmost decimal digits from the integer value which form the fractional part of the resulting currency value.

As well as defining the interpretation of Amount, user interfaces may use this value to determine the precision with which to display the amount.

The currency code represented by this amount, which SHOULD be an international currency code such as "EUR", "USD", or "JPY" if possible. An empty string can be used to indicate that the currency is not known.

The user's balance on the account corresponding to this Connection. A negative amount may be possible on some services, and indicates that the user owes money to the service provider.

On initial connection, this property may have an unknown value, represented by Amount = 0, Scale = 2**32 - 1 (the largest possible 32-bit unsigned integer) and Currency = "".

A URI the user may visit via the web browser to manage and top-up their account balance. This property is not guaranteed to be well-defined until the connection becomes Connected; there is no change notification. Different protocols and even servers or gateways (e.g. SIP and XMPP PSTN gateways) will have a different website used to manage a user's account balance. This property enables the client to provide that to the user. A Connection Manager MAY set this itself (because it is static or discoverable), or expose it as a connection parameter.

Emitted when the user's balance has changed.

The new value of the AccountBalance property.

telepathy-glib-0.24.2/spec/Channel_Type_File_Transfer.xml0000644000175000017500000006726012652510705020300 00000000000000 Copyright © 2008-2009 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

A channel type for transferring files. The transmission of data between contacts is achieved by reading from or writing to a socket. The type of the socket (local Unix, IPv4, etc.) is decided on when the file transfer is offered or accepted.

A socket approach is used to make the transfer less dependent on both client and connection manager knowing the same protocols. As an example, when browsing an SMB share in a file manager, one selects "Send file" and chooses a contact. Instead of passing a URL which would then require the connection manager to connect to the SMB share itself, the client passes a stream from which the connection manager reads, requiring no further connection to the share. It also allows connection managers to be more restricted in their access to the system, allowing tighter security policies with eg SELinux, or more flexible deployments which cross user or system boundaries.

The Telepathy client should connect to the socket or address that the connection manager has set up and provided back to the clients through the two methods.

  • In order to send a file, one should request a FileTransfer channel for a contact, including at least the mandatory properties (Filename, Size and ContentType). Then, one should call ProvideFile to configure the socket that will be used to transfer the file.
  • In order to receive an incoming file transfer, one should call AcceptFile and then wait until the state changes to Open. When the receiver wants to resume a transfer, the Offset argument should be should be set to a non-zero value when calling AcceptFile.
  • Once the offset has been negotiated, the InitialOffsetDefined signal is emitted and the InitialOffset property is defined. The InitialOffsetDefined signal is emitted before channel becomes Open. The receiver MUST check the value of InitialOffset for a difference in offset from the requested value in AcceptFile.
  • When the state changes to Open, Clients can start the transfer of the file using the offset previously announced.

If something goes wrong with the transfer, Channel.Close should be called on the channel.

The File channel type may be requested for handles of type HANDLE_TYPE_CONTACT. If the channel is requested for any other handle type then the behaviour is undefined.

Connection managers SHOULD NOT advertise support for file transfer to other contacts unless it has been indicated by a call to UpdateCapabilities.

People would send us files, and it would always fail. That would be silly.

The state of the file transfer as described by the File_Transfer_State enum.

The file's MIME type. This cannot change once the channel has been created.

This property is mandatory when requesting the channel with the Connection.Interface.Requests.CreateChannel method. Protocols which do not have a content-type property with file transfers should set this value to application/octet-stream.

The name of the file on the sender's side. This is therefore given as a suggested filename for the receiver. This cannot change once the channel has been created.

This property should be the basename of the file being sent. For example, if the sender sends the file /home/user/monkey.pdf then this property should be set to monkey.pdf.

This property is mandatory when requesting the channel with the Connection.Interface.Requests.CreateChannel method. This property cannot be empty and MUST be set to a sensible value.

The size of the file. If this property is set, then the file transfer is guaranteed to be this size. This cannot change once the channel has been created.

When you are creating a channel with this property, its value MUST be accurate and in bytes. However, when receiving a file, this property still MUST be in bytes but might not be entirely accurate to the byte.

This property is mandatory when requesting the channel with the Connection.Interface.Requests.CreateChannel method. If this information isn't provided in the protocol, connection managers MUST set it to UINT64_MAX.

The type of the ContentHash property.

This property is optional when requesting the channel with the Connection.Interface.Requests.CreateChannel method. However, if you wish to include the ContentHash property you MUST also include this property. If you omit this property from a Connection.Interface.Requests.CreateChannel method call then its value will be assumed to be File_Hash_Type_None.

For each supported hash type, implementations SHOULD include an entry in RequestableChannelClasses with this property fixed to that hash type. If the protocol supports offering a file without a content hash, implementations SHOULD list this property in Allowed in a requestable channel class, mapping hash types they don't understand to None.

Hash of the contents of the file transfer, of type described in the value of the ContentHashType property.

This property is optional when requesting the channel with the Connection.Interface.Requests.CreateChannel method. Its value MUST correspond to the appropriate type of the ContentHashType property. If the ContentHashType property is not set, or set to File_Hash_Type_None, then this property will not even be looked at.

Description of the file transfer. This cannot change once the channel has been created.

This property is optional when requesting the channel with the Connection.Interface.Requests.CreateChannel method. If this property was not provided by the remote party, connection managers MUST set it to the empty string.

The last modification time of the file being transferred. This cannot change once the channel has been created

This property is optional when requesting the channel with the Connection.Interface.Requests.CreateChannel method.

A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for sockets with that address type. For simplicity, if a CM supports offering a particular type of file transfer, it is assumed to support accepting it. Connection Managers MUST support at least Socket_Address_Type_IPv4.

A typical value for a host without IPv6 support:

          {
            Socket_Address_Type_IPv4:
              [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
               Socket_Access_Control_Netmask],
            Socket_Address_Type_Unix:
              [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
          }
        

The number of bytes that have been transferred at the time of requesting the property. This will be updated as the file transfer continues.

The offset in bytes from where the file should be sent. This MUST be respected by both the receiver and the sender after the state becomes Open, but before any data is sent or received. Until the InitialOffsetDefined signal is emitted, this property is undefined.

Before setting the State property to Open, the connection manager MUST set the InitialOffset property, possibly to 0.

This property MUST NOT change after the state of the transfer has changed to Open.

For outgoing file transfers, this requestable property allows the channel requester to inform observers (and the handler, if it is not the requester itself) of the URI of the file being transferred. Note that the connection manager SHOULD NOT read this file directly; the handler streams the file into the CM through the socket negotiated using ProvideFile.

On outgoing file transfers, this property MUST NOT change after the channel is requested.

For incoming file transfers, this property MAY be set by the channel handler before calling AcceptFile to inform observers where the incoming file will be saved. If set by an approver, the handler MUST save the file to that location. Setting this property once AcceptFile has been called MUST fail. Once this property has been set URIDefined is emitted.

If set, this URI SHOULD generally point to a file on the local system, as defined by RFC 1738 §3.10; that is, it should be of the form file:///path/to/file or file://localhost/path/to/file. For outgoing files, this URI MAY use a different scheme, such as http:, if a remote resource is being transferred to a contact.

An invalid state type used as a null value. This value MUST NOT appear in the State property. The file transfer is waiting to be accepted/closed by the receiver. The receiver has to call AcceptFile, then wait for the state to change to Open and check the offset value. The receiver has accepted the transfer. The sender now has to call ProvideFile to actually start the transfer. The receiver should now wait for the state to change to Open and check the offset value. The file transfer is open for traffic. The file transfer has been completed successfully. The file transfer has been cancelled. No reason was specified. The change in state was requested. The file transfer was cancelled by the local user. The file transfer was cancelled by the remote user. The file transfer was cancelled because of a local error. The file transfer was cancelled because of a remote error. No hash. MD5 digest as a string of 32 ASCII hex digits. SHA1 digest as a string of ASCII hex digits. SHA256 digest as a string of ASCII hex digits. Accept a file transfer that's in the Pending state. The file transfer's state becomes Accepted after this method is called. At this point the client can connect to the socket. CM MUST emit InitialOffsetDefined and change the state to Open before writing to the socket. Then InitialOffset should be respected in case its value differs from the offset that was specified as an argument to AcceptFile. The type of address the connection manager should listen on. The type of access control the connection manager should apply to the socket. A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum. The desired offset in bytes where the file transfer should start. The offset is taken from the beginning of the file. Specifying an offset of zero will start the transfer from the beginning of the file. The offset that is actually given in the InitialOffset property can differ from this argument where the requested offset is not supported. (For example, some protocols do not support offsets at all so the InitialOffset property will always be 0.) The address on which the connection manager will listen for connections for this file transfer. The given address type or access-control mechanism is not supported. Your address type, access control, access control parameter, offset, or a combination of all four is invalid. The file transfer is not in the Pending state, there isn't or there is a local error with acquiring a socket. Provide the file for an outgoing file transfer which has been offered. Opens a socket that the client can use to provide a file to the connection manager. The channel MUST have been requested, and will change state to Open when this method is called if its state was Accepted. The type of address the connection manager should listen on. The type of access control the connection manager should apply to the socket. A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum. The address on which the connection manager will listen for connections for this file transfer. The given address type or access-control mechanism is not supported. Your address type, access control, access control parameter, or a combination of all three is invalid. Channel is not an outgoing transfer, ProvideFile has already been called, or there was a local error acquiring the socket. Emitted when the state of a file transfer changes. The new state of the file transfer; see the File_Transfer_State enumeration. The reason for the state change; see the File_Transfer_State_Change_Reason enumeration. The value will always be File_Transfer_State_Change_Reason_None, except when changing state to cancelled. Emitted when the number of transferred bytes changes. This will not be signalled with every single byte change. Instead, the most frequent this signal will be emitted is once a second. This should be sufficient, and the TransferredBytes property SHOULD NOT be polled. The number of already transferred bytes. Emitted when the value of the InitialOffset property has been negotiated. This signal MUST be emitted before the channel becomes Open and clients have to use this offset when transferring the file. The value of the InitialOffset property. Emitted when the value of the URI property has been set. This signal MUST only be emitted on incoming file transfers, and only if the handler sets the URI property before accepting the file. The value of the URI property.

The collection of files to which this channel belongs, or the empty string if this channel does not belong to a collection of files.

A channel's FileCollection property can never change.

At least on GTalk and apparently also on iChat the user can send a set of files to a contact and that contact can then pick and choose which files to actually receive.

The CM should emit all new FT channels belonging to one collection at the same time. UIs supporting this feature can then bundle all these channels together in some way, and show a nice UI. UIs not supporting it will treat them as separate transfers, which is not great but a reasonable fallback.

No mechanism is currently defined to indicate whether the UI should expect any more files in the same collection. UIs SHOULD assume that more file transfers may be added to a collection. It is possible that a "no more channels in this collection" indication will be added in a future version of this specification.

telepathy-glib-0.24.2/spec/Channel_Interface_DTMF.xml0000644000175000017500000003642512652510705017265 00000000000000 Copyright © 2005-2010 Collabora Limited Copyright © 2005-2010 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The only part of this spec that should be used with a Call1 channel is the "InitialTones" property. The Stream_IDs in this interface can now be ignored by CMs. An interface that gives a Channel the ability to send DTMF events over audio streams which have been established using the StreamedMedia channel type. The event codes used are in common with those defined in RFC4733, and are listed in the DTMF_Event enumeration. The Stream_ID parameter became vestigial. A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the tone SHOULD be sent to all eligible streams in the channel. A numeric event code from the DTMF_Event enum.

Start sending a DTMF tone to all eligible streams in the channel. Where possible, the tone will continue until StopTone is called. On certain protocols, it may only be possible to send events with a predetermined length. In this case, the implementation MAY emit a fixed-length tone, and the StopTone method call SHOULD return NotAvailable.

The client may wish to control the exact duration and timing of the tones sent as a result of user's interaction with the dialpad, thus starting and stopping the tone sending explicitly.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.

The given stream ID was invalid. Deprecated, since stream IDs are ignored. There are no eligible audio streams. DTMF tones are already being played.
The Stream_ID parameter became vestigial. A stream ID as defined in the StreamedMedia channel type. This argument is included for backwards compatibility and MUST be ignored by the implementations - the sending SHOULD be stoped in all eligible streams in the channel. Stop sending any DTMF tones which have been started using the StartTone or MultipleTones methods. If there is no current tone, this method will do nothing. If MultipleTones was used, the client should not assume the sending has stopped immediately; instead, the client should wait for the StoppedTones signal. On some protocols it might be impossible to cancel queued tones immediately. The given stream ID was invalid. Deprecated, since stream IDs are ignored. Continuous tones are not supported by this stream. Deprecated, since stream IDs are ignored. The characters [pPxXwW,] must also be supported.

A string representation of one or more DTMF events. Implementations of this method MUST support all of the following characters in this string:

  • the digits 0-9, letters A-D and a-d, and symbols '*' and '#' correspond to the members of DTMF_Event
  • any of 'p', 'P', 'x', 'X' or ',' (comma) results in an implementation-defined pause, typically for 3 seconds
  • 'w' or 'W' waits for the user to continue, by stopping interpretation of the string, and if there is more to be played, emitting the TonesDeferred signal with the rest of the string as its argument: see that signal for details

Send multiple DTMF events to all eligible streams in the channel. Each tone will be played for an implementation-defined number of milliseconds (typically 250ms), followed by a gap before the next tone is played (typically 100ms). The duration and gap are defined by the protocol or connection manager.

In cases where the client knows in advance the tone sequence it wants to send, it's easier to use this method than manually start and stop each tone in the sequence.

The tone and gap lengths may need to vary for interoperability, according to the protocol and other implementations' ability to recognise tones. At the time of writing, GStreamer uses a minimum of 250ms tones and 100ms gaps when playing in-band DTMF in the normal audio stream, or 70ms tones and 50ms gaps when encoding DTMF as audio/telephone-event.

Tone overlaping or queueing is not supported, so this method can only be called if no DTMF tones are already being played.

The supplied Tones string was invalid. There are no eligible audio streams. DTMF tones are already being played.
Indicates whether there are DTMF tones currently being sent in the channel. If so, the client should wait for StoppedTones signal before trying to send more tones.

If non-empty in a channel request that will create a new channel, the connection manager should send the tones immediately after at least one eligible audio stream has been created in the channel.

This should only be used with InitialAudio=true.

This property is immutable (cannot change).

The tones waiting for the user to continue, if any.

When this property is set to a non-empty value, TonesDeferred is emitted. When any tones are played (i.e. whenever SendingTones is emitted), this property is reset to the empty string.

The new non-empty value of DeferredTones.

Emitted when 'w' or 'W', indicating "wait for the user to continue", is encountered while playing a DTMF string queued by MultipleTones or InitialTones. Any queued DTMF events after the 'w', which have not yet been played, are placed in the DeferredTones property and copied into this signal's argument.

When the channel handler is ready to continue, it MAY pass the value of DeferredTones to MultipleTones, to resume sending. Alternatively, it MAY ignore the deferred tones, or even play different tones instead. Any deferred tones are discarded the next time a tone is played.

This signal SHOULD NOT be emitted if there is nothing left to play, i.e. if the 'w' was the last character in the DTMF string.

DTMF string (one or more events) that is to be played.

DTMF tone(s)are being sent to all eligible streams in the channel. The signal is provided to indicating the fact that the streams are currently being used to send one or more DTMF tones, so any other media input is not getting through to the audio stream. It also serves as a cue for the StopTone method.

True if the DTMF tones were actively cancelled via StopTone.

DTMF tones have finished playing on streams in this channel.

0 1 2 3 4 5 6 7 8 9 * # A B C D
telepathy-glib-0.24.2/spec/Channel_Interface_Service_Point.xml0000644000175000017500000001021012652510705021264 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for channels that can indicate when/if they are connected to some form of service point. For example, when dialing 9-1-1 in the US, a GSM modem/network will recognize that as an emergency call, and inform higher levels of the stack that the call is being handled by an emergency service. In this example, the call is handled by a Public Safety Answering Point (PSAP) which is labeled as "urn:service:sos". Other networks and protocols may handle this differently while still using this interface.

Note that while the majority of examples given in this documentation are for GSM calls, they could just as easily be SIP calls, GSM SMS's, etc.

This property is used to indicate that the channel target is a well-known service point. Please note that the CM (or lower layers of the stack or network) may forward the connection to other other service points, which the CM SHOULD indicate via ServicePointChanged signal.

This property SHOULD be set for channel requests that are specifically targeting service points.

The service point that the channel is connected to. If the channel is not connected to a service point, the CM MUST set the Service_Point_Type field to None; for instance, this will be the case for ordinary calls.

Emitted when a channel changes the service point that it's connected to. This might be a new call being connected to a service, a call connected to a service being routed to a different service (ie, an emergency call being routed from a generic emergency PSAP to a poison control PSAP), or any number of other things.

Note that this should be emitted as soon as the CM has been notified of the switch, and has updated its internal state. The CM MAY still be in the process of connecting to the new service point.

The new service point that is being used.
telepathy-glib-0.24.2/spec/Channel_Dispatch_Operation.xml0000644000175000017500000005555312652510705020335 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

A channel dispatch operation is an object in the ChannelDispatcher representing a batch of unrequested channels being announced to client Approver processes.

These objects can result from new incoming channels or channels which are automatically created for some reason, but cannot result from outgoing requests for channels.

More specifically, whenever the Connection.Interface.Requests.NewChannels signal contains channels whose Requested property is false, or whenever the Connection.NewChannel signal contains a channel with suppress_handler false, one or more ChannelDispatchOperation objects are created for those channels.

(If some channels in a NewChannels signal are in different bundles, this is an error. The channel dispatcher SHOULD recover by treating the NewChannels signal as if it had been several NewChannels signals each containing one channel.)

First, the channel dispatcher SHOULD construct a list of all the Handlers that could handle all the channels (based on their HandlerChannelFilter property), ordered by priority in some implementation-dependent way. If there are handlers which could handle all the channels, one channel dispatch operation SHOULD be created for all the channels. If there are not, one channel dispatch operation SHOULD be created for each channel, each with a list of channel handlers that could handle that channel.

If no handler at all can handle a channel, the channel dispatcher SHOULD terminate that channel instead of creating a channel dispatcher for it. It is RECOMMENDED that the channel dispatcher closes the channels using Channel.Interface.Destroyable.Destroy if supported, or Channel.Close otherwise. As a special case, the channel dispatcher SHOULD NOT close ContactList channels, and if Close fails, the channel dispatcher SHOULD ignore that channel.

ContactList channels are strange. We hope to replace them with something better, such as an interface on the Connection, in a future version of this specification.

When listing channel handlers, priority SHOULD be given to channel handlers that are already handling channels from the same bundle.

If a handler with BypassApproval = True could handle all of the channels in the dispatch operation, then the channel dispatcher SHOULD call HandleChannels on that handler, and (assuming the call succeeds) emit Finished and stop processing those channels without involving any approvers.

Some channel types can be picked up "quietly" by an existing channel handler. If a Text channel is added to an existing bundle containing a StreamedMedia channel, there shouldn't be any approvers, flashing icons or notification bubbles, if the the UI for the StreamedMedia channel can just add a text box and display the message.

Otherwise, the channel dispatcher SHOULD send the channel dispatch operation to all relevant approvers (in parallel) and wait for an approver to claim the channels or request that they are handled. See AddDispatchOperation for more details on this.

Finally, if the approver requested it, the channel dispatcher SHOULD send the channels to a handler.

A list of the extra interfaces provided by this channel dispatch operation. This property cannot change. The Connection with which the Channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'. This property cannot change. The Account with which the Connection and Channels are associated. This property cannot change. The Channels to be dispatched, and their properties. Change notification is via the ChannelLost signal (channels cannot be added to this property, only removed).

A channel has closed before it could be claimed or handled. If this is emitted for the last remaining channel in a channel dispatch operation, it MUST immediately be followed by Finished.

This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their AddDispatchOperation method.

This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual "connect to signals then recover state" model - first connect to ChannelLost and Finished, then download Channels (and on error, perhaps assume that the operation has already Finished).

The Channel that closed.

The name of a D-Bus error indicating why the channel closed. If no better reason can be found, org.freedesktop.Telepathy.Error.NotAvailable MAY be used as a fallback; this means that this error SHOULD NOT be given any more specific meaning.

A string associated with the D-Bus error.

The well known bus names (starting with org.freedesktop.Telepathy.Client.) of the possible Handlers for these channels. The channel dispatcher MUST place the most preferred handlers first, according to some reasonable heuristic. As a result, approvers SHOULD use the first handler by default.

The heuristic used to prioritize handlers SHOULD give a higher priority to handlers that are already running.

If, for instance, Empathy and Kopete have similar functionality, and Empathy is running, we should prefer to send channels to it rather than launching Kopete via service activation.

Called by an approver to accept a channel bundle and request that the given handler be used to handle it.

If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting Finished.

However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler.

Approvers which are also channel handlers SHOULD use Claim instead of HandleWith to request that they can handle a channel bundle themselves.

(FIXME: list some possible errors)

If the channel handler raises an error from HandleChannels, this method MAY respond by raising that same error, even if it is not specifically documented here.

The well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.

The selected handler is non-empty, but is not a syntactically correct DBus_Bus_Name or does not start with "org.freedesktop.Telepathy.Client.". The selected handler is temporarily unable to handle these channels. The selected handler is syntactically correct, but will never be able to handle these channels (for instance because the channels do not match its HandlerChannelFilter, or because HandleChannels raised NotImplemented). At the time that HandleWith was called, this dispatch operation was processing an earlier call to HandleWith. The earlier call has now succeeded, so some Handler nominated by another approver is now responsible for the channels. In this situation, the second call to HandleWith MUST NOT return until the first one has returned successfully or unsuccessfully, and if the first call to HandleChannels fails, the channel dispatcher SHOULD try to obey the choice of Handler made by the second call to HandleWith.

Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel, but does not have the HandleChannels method called on it.

Clients that call Claim on channels but do not immediately close them SHOULD implement the Handler interface and its HandledChannels property.

Approvers wishing to reject channels MUST call this method to claim ownership of them, and MUST NOT call Close on the channels unless/until this method returns successfully.

The channel dispatcher can't know how best to close arbitrary channel types, so it leaves it up to the approver to do so. For instance, for Text channels it is necessary to acknowledge any messages that have already been displayed to the user first - ideally, the approver would display and then acknowledge the messages - or to call Channel.Interface.Destroyable.Destroy if the destructive behaviour of that method is desired.

Similarly, an Approver for StreamedMedia channels can close the channel with a reason (e.g. "busy") if desired. The channel dispatcher, which is designed to have no specific knowledge of particular channel types, can't do that.

If successful, this method will cause the ChannelDispatchOperation object to disappear, emitting Finished, in the same way as for HandleWith.

This method may fail because the dispatch operation has already been completed. Again, see HandleWith for more details. The approver MUST NOT attempt to interact with the channels further in this case.

(FIXME: list some other possible errors)

At the time that Claim was called, this dispatch operation was processing a call to HandleWith which has now succeeded, so some Handler nominated by another approver is now responsible for the channel.
At the time of writing, no released implementation of the Channel Dispatcher implements this method; clients should fall back to calling HandleWith.

A variant of HandleWith allowing the approver to pass an user action time. This timestamp will be passed to the Handler when HandleChannels is called.

The well-known bus name (starting with org.freedesktop.Telepathy.Client.) of the channel handler that should handle the channel, or the empty string if the client has no preferred channel handler.

The time at which user action occurred.

The selected handler is non-empty, but is not a syntactically correct DBus_Bus_Name or does not start with "org.freedesktop.Telepathy.Client.". The selected handler is temporarily unable to handle these channels. The selected handler is syntactically correct, but will never be able to handle these channels (for instance because the channels do not match its HandlerChannelFilter, or because HandleChannels raised NotImplemented). At the time that HandleWith was called, this dispatch operation was processing an earlier call to HandleWith. The earlier call has now succeeded, so some Handler nominated by another approver is now responsible for the channels. In this situation, the second call to HandleWith MUST NOT return until the first one has returned successfully or unsuccessfully, and if the first call to HandleChannels fails, the channel dispatcher SHOULD try to obey the choice of Handler made by the second call to HandleWith.

Emitted when this dispatch operation finishes. The dispatch operation is no longer present and further methods must not be called on it.

Approvers that have a user interface SHOULD stop notifying the user about the channels in response to this signal; they MAY assume that on errors, they would have received ChannelLost first.

Its object path SHOULD NOT be reused for a subsequent dispatch operation; the ChannelDispatcher MUST choose object paths in a way that avoids immediate re-use.

Otherwise, clients might accidentally call HandleWith or Claim on a new dispatch operation instead of the one they intended to handle.

This signal MUST NOT be emitted until all Approvers that were invoked have returned (successfully or with an error) from their AddDispatchOperation method.

This means that Approvers can connect to the ChannelLost signal in a race-free way. Non-approver processes that discover a channel dispatch operation in some way (such as observers) will have to follow the usual "connect to signals then recover state" model - first connect to ChannelLost and Finished, then download Channels (and on error, perhaps assume that the operation has already Finished).

telepathy-glib-0.24.2/spec/Channel_Interface_Subject.xml0000644000175000017500000001337512652510705020131 00000000000000 Copyright © 2010–2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(version 2)

An interface channels can implement to support subjects. Most of the time this will be implemented by channels implementing the Room2 interface, but some protocols support subjects in 1-to-1 chats (such as XMPP). Note that this interface is not restricted to Text channels, and can also be used on Call channels.

The new subject.

Set the room's subject. Clients SHOULD look at the subject flags before calling this method as the user might not have permission to set the subject.

A successful return of this method indicates a successful change in subject, but clients should still listen for changes to the Subject property for further changes by other users or the server.

The human-readable subject on the channel such as the topic in an IRC channel, or the room name in XMPP MUCs.

This property replaces the subject Telepathy property of Text channels, as Telepathy properties are soon to be deprecated completely.

This property may change during the lifetime of the channel and MUST not be included in a channel request.

The normalized contact ID representing who last modified the subject, or the empty string if it is not known.

This property replaces the subject-contact Telepathy property of Text channels, as Telepathy properties are soon to be deprecated completely.

The handle corresponding to Actor, or 0 if the Actor is unknown.

A unix timestamp indicating when the subject was last modified, or INT_MAX64 if unknown.

This property replaces the subject-timestamp Telepathy property of Text channels, as Telepathy properties are soon to be deprecated completely.

TRUE if the Subject property can be set by the user by calling SetSubject, otherwise FALSE.

If implementations are unsure of what this value should be it SHOULD still be set to what it believes the value is. As a result, clients should be aware that SetSubject can still fail even with this property set to TRUE.

In XMPP it is impossible to know whether an occupant can set the subject as XMPP server implementations are wildly inconsistent.
telepathy-glib-0.24.2/spec/Connection_Interface_Client_Types.xml0000644000175000017500000002201712652510705021654 00000000000000 Copyright (C) 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface on connections to support protocols which allows users to subscribe to the client types of their contacts.

One can connect to instant messaging networks on a huge variety of devices, from PCs, to phones to consoles. It can be useful for users to know what kind of device a contact is using so that he or she can decide not to send that big file or start a video chat. This interface exposes exactly this information for clients to display.

The client types are represented in strings, using the values documented by the XMPP registrar with some additional types added for other protocols. A contact can set one or more client types so this interface returns a list of strings to denote client types for a contact. The well-known client types to be used are:

  • bot
  • console (minimal non-GUI client used on dumb terminals or text-only screens, not a games console)
  • handheld
  • pc
  • phone
  • web

If the empty list is given as the client types, this means that details about the contact's client types are unknown. If there are multiple resources of a contact online at one point in time, the client types of the most available resource will be returned. In other words, the returned client types are those for the resource whose presence will be retreived using the SimplePresence interface.

For example, if a contact has two resources:

  • their phone, with presence "available"; and
  • their pc, with presence "busy";

then the methods in this interface will return an array (with one element: "phone") as the client types because that is the more available resource. If at some later time the contact's phone's presence changes to "away", the ClientTypesUpdated signal will notify that the contact's client types attribute has changed from ["phone"] to ["pc"], because "busy" is a more available presence than "away".

A mapping from contact handle to client types. A contact. The contact's client types as documented earlier in this interface. Return the client types of the given contacts, if they are already known. If any of the given contacts' client types are not known, request their current client types, but return immediately without waiting for a reply; if a reply with a non-empty client type array is later received for those contacts, the ClientTypesUpdated signal will be emitted for them. This method is appropriate for "lazy" client type finding, for instance displaying the client types (if available) of everyone in your contact list. The contacts whose client types should be returned or signalled. The contacts' client types, if already known. Contacts whose client types are not already known are omitted from the mapping; contacts known to have no client type information appear in the mapping with an empty list. Return the current client types of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply. This method is appropriate for use in a "Contact Information..." dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions. The contact whose client types should be returned. The contact's client types. It MAY be empty, indicating that no client type information was found. The requested contact does not allow the local user to see their client type information. Emitted when a contact's client types change or become known. The contact. The contact's client types, or an empty list to indicate that nothing is known about the contact's client types.

The same mapping that would be returned by GetClientTypes for this contact. Omitted from the result if the contact's client types are not known.

A string representing a single client type of a contact.
telepathy-glib-0.24.2/spec/Channel_Type_Server_TLS_Connection.xml0000644000175000017500000001356712652510705021725 00000000000000 Copyright © 2010 Collabora Limited This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

A channel type that carries a TLS certificate between a server and a client connecting to it.

Channels of this kind always have Requested = False, TargetHandleType = None and TargetHandle = 0, and cannot be requested with methods such as CreateChannel. Also, they SHOULD be dispatched while the Connection owning them is in the CONNECTING state.

In this case, handlers SHOULD accept or reject the certificate, using the relevant methods on the provided object, or MAY just Close the channel before doing so, to fall back to a non-interactive verification process done inside the CM.

For example, channels of this kind can pop up while a client is connecting to an XMPP server.

A TLSCertificate containing the certificate chain as sent by the server, and other relevant information.

The hostname or domain that the user expects to connect to. Clients SHOULD use the ReferenceIdentities property to verify the identity of the certificate. Clients MAY display this hostname to the user as the expected identity. Clients SHOULD use this property to lookup pinned certificates or other user preferences for the connection.

If this property is not present, clients SHOULD use the Hostname property as the reference identity to validate server certificates against.

The identities of the server we expect ServerCertificate to certify; clients SHOULD verify that ServerCertificate matches one of these identities when checking its validity.

This property MUST NOT be the empty list; it MUST contain the value of the Hostname property. All other identities included in this property MUST be derived from explicit user input or choices, such as Parameters passed to RequestConnection.

The primary use for this property is for XMPP services hosted by Google Apps. When connecting to Google Talk using an @gmail.com JID, the server correctly presents a certificate for gmail.com; however, for domains hosted via Google Apps, a certificate for talk.google.com is offered, due to unresolved technical limitations.

If the user has explicitly chosen to create a Google Talk account, then trusting a certificate for talk.google.com is reasonable. To handle this case, the connection manager may add the values of any or all of the server, fallback-server and extra-identities parameters; the Google Talk account creation user interface may set these parameters appropriately, or the user may set them for accounts with other services.

telepathy-glib-0.24.2/spec/Makefile.am0000644000175000017500000001071412652510705014426 00000000000000EXTRA_DIST = \ Account.xml \ Account_Interface_Addressing.xml \ Account_Interface_Avatar.xml \ Account_Interface_External_Password_Storage.xml \ Account_Interface_Hidden.xml \ Account_Interface_Storage.xml \ Account_Manager.xml \ Account_Manager_Interface_Hidden.xml \ Authentication_TLS_Certificate.xml \ Call_Content.xml \ Call_Content_Interface_DTMF.xml \ Call_Content_Interface_Media.xml \ Call_Content_Interface_Audio_Control.xml \ Call_Content_Interface_Video_Control.xml \ Call_Content_Media_Description.xml \ Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml \ Call_Content_Media_Description_Interface_RTCP_Feedback.xml \ Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml \ Call_Interface_Mute.xml \ Call_Stream.xml \ Call_Stream_Endpoint.xml \ Call_Stream_Interface_Media.xml \ Channel.xml \ Channel_Dispatch_Operation.xml \ Channel_Dispatcher.xml \ Channel_Dispatcher_Interface_Messages1.xml \ Channel_Dispatcher_Interface_Operation_List.xml \ Channel_Future.xml \ Channel_Handler.xml \ Channel_Interface_Addressing.xml \ Channel_Interface_Anonymity.xml \ Channel_Interface_Call_State.xml \ Channel_Interface_Captcha_Authentication.xml \ Channel_Interface_Chat_State.xml \ Channel_Interface_Conference.xml \ Channel_Interface_Credentials_Storage.xml \ Channel_Interface_DTMF.xml \ Channel_Interface_Destroyable.xml \ Channel_Interface_File_Transfer_Metadata.xml \ Channel_Interface_Group.xml \ Channel_Interface_HTML.xml \ Channel_Interface_Hold.xml \ Channel_Interface_Media_Signalling.xml \ Channel_Interface_Mergeable_Conference.xml \ Channel_Interface_Messages.xml \ Channel_Interface_Password.xml \ Channel_Interface_Picture.xml \ Channel_Interface_Room.xml \ Channel_Interface_Room_Config.xml \ Channel_Interface_SASL_Authentication.xml \ Channel_Interface_SMS.xml \ Channel_Interface_Securable.xml \ Channel_Interface_Service_Point.xml \ Channel_Interface_Splittable.xml \ Channel_Interface_Subject.xml \ Channel_Interface_Transfer.xml \ Channel_Interface_Tube.xml \ Channel_Request.xml \ Channel_Type_Call.xml \ Channel_Type_Contact_List.xml \ Channel_Type_Contact_Search.xml \ Channel_Type_DBus_Tube.xml \ Channel_Type_File_Transfer.xml \ Channel_Type_Room_List.xml \ Channel_Type_Server_Authentication.xml \ Channel_Type_Server_TLS_Connection.xml \ Channel_Type_Stream_Tube.xml \ Channel_Type_Streamed_Media.xml \ Channel_Type_Text.xml \ Channel_Type_Tubes.xml \ Client.xml \ Client_Approver.xml \ Client_Handler.xml \ Client_Handler_Future.xml \ Client_Interface_Requests.xml \ Client_Observer.xml \ Connection.xml \ Connection_Future.xml \ Connection_Interface_Addressing.xml \ Connection_Interface_Aliasing.xml \ Connection_Interface_Anonymity.xml \ Connection_Interface_Avatars.xml \ Connection_Interface_Balance.xml \ Connection_Interface_Capabilities.xml \ Connection_Interface_Cellular.xml \ Connection_Interface_Client_Types.xml \ Connection_Interface_Communication_Policy.xml \ Connection_Interface_Contact_Blocking.xml \ Connection_Interface_Contact_Capabilities.xml \ Connection_Interface_Contact_Groups.xml \ Connection_Interface_Contact_Info.xml \ Connection_Interface_Contact_List.xml \ Connection_Interface_Contacts.xml \ Connection_Interface_Forwarding.xml \ Connection_Interface_IRC_Command1.xml \ Connection_Interface_Keepalive.xml \ Connection_Interface_Location.xml \ Connection_Interface_Mail_Notification.xml \ Connection_Interface_Power_Saving.xml \ Connection_Interface_Presence.xml \ Connection_Interface_Privacy.xml \ Connection_Interface_Renaming.xml \ Connection_Interface_Requests.xml \ Connection_Interface_Resources.xml \ Connection_Interface_Service_Point.xml \ Connection_Interface_Sidecars1.xml \ Connection_Interface_Simple_Presence.xml \ Connection_Manager.xml \ Connection_Manager_Interface_Account_Storage.xml \ Debug.xml \ Media_Session_Handler.xml \ Media_Stream_Handler.xml \ Properties_Interface.xml \ Protocol.xml \ Protocol_Interface_Addressing.xml \ Protocol_Interface_Avatars.xml \ Protocol_Interface_Presence.xml \ all.xml \ errors.xml \ generic-types.xml \ template.xml telepathy-glib-0.24.2/spec/Makefile.in0000644000175000017500000004436514006601553014445 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = spec ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXTRA_DIST = \ Account.xml \ Account_Interface_Addressing.xml \ Account_Interface_Avatar.xml \ Account_Interface_External_Password_Storage.xml \ Account_Interface_Hidden.xml \ Account_Interface_Storage.xml \ Account_Manager.xml \ Account_Manager_Interface_Hidden.xml \ Authentication_TLS_Certificate.xml \ Call_Content.xml \ Call_Content_Interface_DTMF.xml \ Call_Content_Interface_Media.xml \ Call_Content_Interface_Audio_Control.xml \ Call_Content_Interface_Video_Control.xml \ Call_Content_Media_Description.xml \ Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml \ Call_Content_Media_Description_Interface_RTCP_Feedback.xml \ Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml \ Call_Interface_Mute.xml \ Call_Stream.xml \ Call_Stream_Endpoint.xml \ Call_Stream_Interface_Media.xml \ Channel.xml \ Channel_Dispatch_Operation.xml \ Channel_Dispatcher.xml \ Channel_Dispatcher_Interface_Messages1.xml \ Channel_Dispatcher_Interface_Operation_List.xml \ Channel_Future.xml \ Channel_Handler.xml \ Channel_Interface_Addressing.xml \ Channel_Interface_Anonymity.xml \ Channel_Interface_Call_State.xml \ Channel_Interface_Captcha_Authentication.xml \ Channel_Interface_Chat_State.xml \ Channel_Interface_Conference.xml \ Channel_Interface_Credentials_Storage.xml \ Channel_Interface_DTMF.xml \ Channel_Interface_Destroyable.xml \ Channel_Interface_File_Transfer_Metadata.xml \ Channel_Interface_Group.xml \ Channel_Interface_HTML.xml \ Channel_Interface_Hold.xml \ Channel_Interface_Media_Signalling.xml \ Channel_Interface_Mergeable_Conference.xml \ Channel_Interface_Messages.xml \ Channel_Interface_Password.xml \ Channel_Interface_Picture.xml \ Channel_Interface_Room.xml \ Channel_Interface_Room_Config.xml \ Channel_Interface_SASL_Authentication.xml \ Channel_Interface_SMS.xml \ Channel_Interface_Securable.xml \ Channel_Interface_Service_Point.xml \ Channel_Interface_Splittable.xml \ Channel_Interface_Subject.xml \ Channel_Interface_Transfer.xml \ Channel_Interface_Tube.xml \ Channel_Request.xml \ Channel_Type_Call.xml \ Channel_Type_Contact_List.xml \ Channel_Type_Contact_Search.xml \ Channel_Type_DBus_Tube.xml \ Channel_Type_File_Transfer.xml \ Channel_Type_Room_List.xml \ Channel_Type_Server_Authentication.xml \ Channel_Type_Server_TLS_Connection.xml \ Channel_Type_Stream_Tube.xml \ Channel_Type_Streamed_Media.xml \ Channel_Type_Text.xml \ Channel_Type_Tubes.xml \ Client.xml \ Client_Approver.xml \ Client_Handler.xml \ Client_Handler_Future.xml \ Client_Interface_Requests.xml \ Client_Observer.xml \ Connection.xml \ Connection_Future.xml \ Connection_Interface_Addressing.xml \ Connection_Interface_Aliasing.xml \ Connection_Interface_Anonymity.xml \ Connection_Interface_Avatars.xml \ Connection_Interface_Balance.xml \ Connection_Interface_Capabilities.xml \ Connection_Interface_Cellular.xml \ Connection_Interface_Client_Types.xml \ Connection_Interface_Communication_Policy.xml \ Connection_Interface_Contact_Blocking.xml \ Connection_Interface_Contact_Capabilities.xml \ Connection_Interface_Contact_Groups.xml \ Connection_Interface_Contact_Info.xml \ Connection_Interface_Contact_List.xml \ Connection_Interface_Contacts.xml \ Connection_Interface_Forwarding.xml \ Connection_Interface_IRC_Command1.xml \ Connection_Interface_Keepalive.xml \ Connection_Interface_Location.xml \ Connection_Interface_Mail_Notification.xml \ Connection_Interface_Power_Saving.xml \ Connection_Interface_Presence.xml \ Connection_Interface_Privacy.xml \ Connection_Interface_Renaming.xml \ Connection_Interface_Requests.xml \ Connection_Interface_Resources.xml \ Connection_Interface_Service_Point.xml \ Connection_Interface_Sidecars1.xml \ Connection_Interface_Simple_Presence.xml \ Connection_Manager.xml \ Connection_Manager_Interface_Account_Storage.xml \ Debug.xml \ Media_Session_Handler.xml \ Media_Stream_Handler.xml \ Properties_Interface.xml \ Protocol.xml \ Protocol_Interface_Addressing.xml \ Protocol_Interface_Avatars.xml \ Protocol_Interface_Presence.xml \ all.xml \ errors.xml \ generic-types.xml \ template.xml all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu spec/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu spec/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/spec/Connection_Interface_Avatars.xml0000644000175000017500000005436412652510705020665 00000000000000 Copyright (C) 2005-2008 Collabora Limited Copyright (C) 2005-2008 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

strengthened uniqueness requirements so (CM name, protocol, token) is unique; previously only (our Account, remote contact identifier, token) was required to be unique

An opaque token chosen by the connection manager, representing a particular avatar.

Because avatars can be relatively large images, most protocols provide a way to detect whether an old avatar is still valid, or whether an avatar has changed, without pushing the actual avatar data to all clients.

The connection manager MUST choose these tokens in a way that makes it highly unlikely that two different avatars with the same connection manager and protocol will have the same token.

This means that clients MAY use the triple (Connection_Manager_Name, Protocol, avatar token) as a key for their avatar cache. For instance, an avatar for a telepathy-gabble Jabber contact might be stored in a file .../gabble/jabber/4e199b4a1c40b497a95fcd1cd896351733849949.png.

For instance, some protocols (like XMPP) identify avatars by a hash of the avatar data; in this case, the hash can be used as the avatar token.

Some protocols identify avatars by the timestamp of the last change to the avatar; in these protocols it would be necessary for the connection manager to encode both the timestamp and the contact's identifier into the avatar token in order to ensure uniqueness.

This token SHOULD be kept short and reasonably suitable for use in a filename, but MAY contain any UTF-8 character (so clients using avatar tokens in filenames MUST be prepared to escape characters that are not valid in filenames). Connection managers for protocols where tokens would otherwise become inconveniently large or contain many unsuitable characters SHOULD hash the identifying data to generate the token.

A dictionary whose keys are contact handles and whose values are avatar tokens. An integer handle for the contact whose avatar has changed Unique token for their new avatar Emitted when the avatar for a contact has been updated, or first discovered on this connection. If the token differs from the token associated with the client's cached avatar for this contact, the new avatar should be requested with RequestAvatars. The contact whose avatar has been retrieved The token corresponding to the avatar An array of bytes containing the image data A string containing the image MIME type (eg image/jpeg), or empty if unknown Emitted when the avatar for a contact has been retrieved. Fall back to calling GetAvatarRequirements if getting this property fails. An array of supported MIME types (e.g. "image/jpeg"). Clients MAY assume that the first type in this array is preferred. This property cannot change after the Connection goes to the Connected state. Fall back to calling GetAvatarRequirements if getting this property fails. The minimum height in pixels of an avatar on this protocol, which MAY be 0. This property cannot change after the Connection goes to the Connected state. Fall back to calling GetAvatarRequirements if getting this property fails. The minimum width in pixels of an avatar on this protocol, which MAY be 0. This property cannot change after the Connection goes to the Connected state. The recommended height in pixels of an avatar on this protocol, or 0 if there is no preferred height. This property cannot change after the Connection goes to the Connected state. In XMPP a recommended width is given by the protocol specification; in proprietary protocols, using the same avatar size as the proprietary client is likely to lead to the best display to other users. The recommended width in pixels of an avatar on this protocol, or 0 if there is no preferred width. This property cannot change after the Connection goes to the Connected state. The rationale is the same as for RecommendedAvatarHeight. Fall back to calling GetAvatarRequirements if getting this property fails. The maximum height in pixels of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state. Fall back to calling GetAvatarRequirements if getting this property fails. The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state. Fall back to calling GetAvatarRequirements if getting this property fails. The maximum size in bytes of an avatar on this protocol, or 0 if there is no limit. This property cannot change after the Connection goes to the Connected state. Use GetAll to retrieve the D-Bus properties on this interface, falling back to this method on failure. An array of supported MIME types (eg image/jpeg) The minimum image width in pixels The minimum image height in pixels The maximum image width in pixels, or 0 if there is no limit The maximum image height in pixels, or 0 if there is no limit The maximum image size in bytes, or 0 if there is no limit Get the required format of avatars on this connection. An array of handles representing contacts An array of avatar tokens or empty strings (if no avatar is set) in the same order as the given array of contact handles Use GetKnownAvatarTokens instead. Get the unique tokens for all of the given contacts' avatars. Using this method in new Telepathy clients is deprecated; use GetKnownAvatarTokens instead. An array of handles representing contacts A dictionary of handles mapped to avatar tokens, containing only the known avatar tokens. Get the unique tokens for the given contacts' avatars. These tokens can be persisted across connections, and should be used by the client to check whether the avatars have been updated. For handles other than the self handle, only tokens that are already known are returned; an empty token means the given contact has no avatar. However, a CM must always have the tokens for the self handle if one is set (even if it is set to no avatar). On protocols where the avatar does not persist between connections, a CM should omit the self handle from the returned map until an avatar is explicitly set or cleared. An integer handle for the contact to request the avatar for An array of bytes containing the image data A string containing the image MIME type (eg image/jpeg), or empty if unknown Use RequestAvatars instead. Request the avatar for a given contact. Using this method in new Telepathy clients is deprecated; use RequestAvatars instead. The contact does not currently have an avatar. The contacts to retrieve avatars for Request avatars for a number of contacts. The AvatarRetrieved signal is emitted for each avatar retrieved. If the handles are valid but retrieving an avatar fails (for any reason, including the contact not having an avatar) the AvatarRetrieved signal is not emitted for that contact. An array of bytes representing the avatar image data A string representing the image MIME type The string token of the new avatar Set a new avatar image for this connection. The avatar image must respect the requirements obtained by GetAvatarRequirements. Remove the avatar image for this connection.

The same string that would be returned by GetKnownAvatarTokens (omitted from the result if the contact's avatar token is not known, present as an empty string if the contact is known not to have an avatar). Unlike in the GetKnownAvatarTokens method, the avatar tokens for the self handle aren't required to be present. This attribute should not be used to determine whether or not the Avatar needs to be set.

An interface for requesting avatars for contacts on a given connection, receiving notification when avatars are changed, and publishing your own avatar.

Avatars are identified by a string, the Avatar_Token, which represents a particular avatar. Tokens MUST be chosen by the connection manager in such a way that the triple (Connection_Manager_Name, Protocol, Avatar_Token) uniquely identifies an avatar. An empty token means that an avatar has not been set for this contact, and a changed token implies the contact's avatar has changed, but the strings should otherwise be considered opaque by clients.

A client should use GetKnownAvatarTokens to request the tokens for the avatars of all the contacts it is interested in when it connects. The avatars can then be requested using RequestAvatars for the contacts. Clients should bind to the AvatarUpdated signal and request a new copy of the avatar when a contacts' avatar token changes. Clients should cache the token and data of each contact's avatar between connections, to avoid repeatedly retrieving the same avatar.

To publish an avatar, a client should use SetAvatar to provide an image which meets the requirements returned by the GetAvatarRequirements function. On some protocols the avatar is stored on the server, so setting the avatar is persistent, but on others it is transferred via a peer to peer mechanism, so needs to be set every connection. Hence, on every connection, clients should inspect the avatar token of the connection's self handle using GetKnownAvatarTokens; if the self handle is not in the returned map, the client should re-set the avatar. If the self handle's avatar token is known, but the avatar has been changed locally since the last connection, the client should upload the new avatar; if the avatar has not changed locally, then the client should download the avatar from the server if its token differs from the that of the local avatar.

To remove the published avatar on protocols which have persistent avatars, a client should use the ClearAvatar method. This method can safely be used even if there is no avatar for this connection.

telepathy-glib-0.24.2/spec/Account_Interface_Hidden.xml0000644000175000017500000000617612652510705017752 00000000000000 Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for flagging certain accounts as hidden, so that they do not appear in the account manager's standard lists of accounts. Accounts whose Hidden property is True are intended for non-interactive use (by non-user-visible services), and appear on the AccountManager.Interface.Hidden.DRAFT1 interface; in all other respects, they behave like any other account.

XMPP, in particular, is increasingly used for purposes other than instant messaging and VoIP. For instance, extensions exist for inter-device bookmark synchronization.

While obviously these services could re-use connections intended for instant messaging, in some cases you might want to use a different account. (Perhaps your bookmark sync provider is not your IM provider.) This API allows such auxiliary accounts to exist in Telepathy, while not being displayed in standard user interfaces for IM, VoIP, and friends.

If True, this account is intended for non-interactive use, and thus should not be presented to the user. It will not appear in properties and signals on the main AccountManager interface; instead, it will show up on AccountManager.Interface.Hidden.DRAFT1.

telepathy-glib-0.24.2/spec/Channel_Interface_Room_Config.xml0000644000175000017500000003006112652510705020722 00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

version 1. This replaces the old-school Telepathy properties on Text.

Represents the configuration of a chatroom, some aspects of which may be modifiable by the user, depending on their privileges. This corresponds to the room configuration on XMPP, and various channel mode flags on IRC.

The “topic” (on IRC) or “subject” (on XMPP) is not part of this interface; it can be found on the Subject2 interface.

True if people may join the channel without other members being made aware of their identity. True if people may not join the channel until they have been invited. The limit to the number of members; or 0 if there is no limit. True if channel membership is not sufficient to allow participation. A human-visible name for the channel, if it differs from Room2.RoomName; the empty string, otherwise.

On XMPP, this represents the muc#roomconfig_roomname field of the muc#roomconfig form. So for jdev@conference.jabber.org, for example:

  • Room2.RoomName = "jdev";
  • Room2.Server = "conference.jabber.org";
  • Title = "General Jabber development discussion".

XEP-0045 is awful.

A human-readable description of the channel's overall purpose; if any. True if the channel will remain in existence on the server after all members have left it. True if the channel is not visible to non-members. True if contacts joining this channel must provide a password to be granted entry. Note that this property does not indicate that a password is required right now; see the Password interface for the API used to provide a password while joining a room. If PasswordProtected is True, the password required to enter the channel, if known. If the password is unknown, or PasswordProtected is False, the empty string. On XMPP—bless its cotton socks!—non-owners of a MUC cannot see its current password, even if they just provided the password in order to join the room…

If PasswordProtected is True, an optional hint for the password.

On protocols supporting PasswordHint (indicated by its presence in MutableProperties), Password and PasswordHint MUST be set in a single call to UpdateConfiguration.

Skype requires that the password and its hint be supplied together.
If True, the user may call UpdateConfiguration to change the values of the properties listed in MutableProperties.

A list of (unqualified) property names on this interface which may be modified using UpdateConfiguration (if CanUpdateConfiguration is True). Properties not listed here cannot be modified.

For example, IRC does not have the concept of joining a room without other participants knowing your true identity; so on IRC the Anonymous property will always be False, and MutableProperties will not include "Anonymous".

True once the initial room configuration has been retrieved, or False otherwise. On some services, this may take some time after you've joined a room to fetch the configuration. Once this property changes to True, the other properties on this interface can be assumed to be accurate; this property MUST not change to False after it becomes True.

An application's “configure this room” dialog might choose to display a spinner while this property is False, rather than allowing the user to edit probably-inaccurate configuration.

The new values of one or more properties on this interface, which must be listed in MutableProperties. For instance, to set up a channel for discussing top-secret corporate merge plans, this parameter might be:

{
  'Private': True,
  'InviteOnly': True,
  'Description': "The first rule of #inteltakeover is: do not talk about #inteltakeover",
}

If CanUpdateConfiguration is True, modifies the current values of one or more room properties. This method SHOULD NOT return until the change has been accepted or declined by the server.

Note that the server may ostensibly accept the changes (thus allowing this method to return success) but signal different values; for example, the server might truncate Title to some maximum length. Callers SHOULD continue to listen for the PropertiesChanged signal, and trust the values it signals over those provided to this method.

The user is not allowed to reconfigure this room. One or more of the specified properties is unknown, or ill-typed. One or more of the specified properties cannot be modified on this protocol. The room's current configuration has not yet been retrieved, so we cannot update it just yet. The application might like to try again once the ConfigurationRetrieved property becomes True.
telepathy-glib-0.24.2/spec/Channel_Future.xml0000644000175000017500000000617112652510705016020 00000000000000 Copyright (C) 2008 Collabora Ltd. Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface contains functionality which we intend to incorporate into the Channel interface in future. It should be considered to be conceptually part of the core Channel interface, but without API or ABI guarantees.

If we add new functionality to the Channel interface, libraries that use generated code (notably telepathy-glib) will have it as part of their ABI forever, meaning we can't make incompatible changes. By using this interface as a staging area for future Channel functionality, we can try out new properties, signals and methods as application-specific extensions, then merge them into the core Channel interface when we have enough implementation experience to declare them to be stable.

The name is by analogy to Python's __future__ pseudo-module.

(in Channel.FUTURE pseudo-interface)

The ChannelBundle.DRAFT to which this channel belongs.

A channel's Bundle property can never change.

Older connection managers might not have this property. Clients (particularly the channel dispatcher) SHOULD recover by considering each channel to be in a bundle containing only that channel, distinct from all other bundles, which has no additional interfaces.

telepathy-glib-0.24.2/spec/Channel_Type_Tubes.xml0000644000175000017500000005727212652510705016641 00000000000000 Copyright © 2007-2009 Collabora Limited This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Client implementations SHOULD use StreamTube and DBusTube instead.

A "tube" is a mechanism for arbitrary data transfer. Two types of data transfer are currently specified: D-Bus messages, and streams of bytes. Each tube has a service name, which is a string specifying the kind of communication that takes place over it, and a dictionary of arbitrary parameters. Tube parameters are commonly used for bootstrap information such as usernames and passwords. Each tube is identified by a locally unique identifier.

The Tubes channel type may be requested for handles of type HANDLE_TYPE_CONTACT and HANDLE_TYPE_ROOM.

Stream tubes specify listening addresses using pairs of parameters with signature 'u', 'v', where the integer 'u' is a member of Socket_Address_Type and the v is dependent on the type of address.

An identifier for a tube. These are local to a Tubes channel, and may not be assumed to be the same as the other participants' idea of the tube identifier. A struct (tube ID, initiator handle, tube type, service name, parameters, state) representing a tube, as returned by ListTubes on the Tubes channel type. Represents a participant in a multi-user D-Bus tube, as returned by GetDBusNames and seen in the DBusNamesChanged signal. The handle of a participant in this D-Bus tube. That participant's unique name.

The tube is D-Bus tube as described by the org.freedesktop.Telepathy.Channel.Type.DBusTube interface.

The tube is stream tube as described by the org.freedesktop.Telepathy.Channel.Type.StreamTube interface.

The tube is waiting to be accepted/closed locally. The tube is waiting to be accepted/closed remotely. The tube is open for traffic. The supported socket address and access-control types for tubes. See GetAvailableStreamTubeTypes. List the available address types and access-control types for stream tubes.

A mapping from address types (members of Socket_Address_Type) to arrays of access-control type (members of Socket_Access_Control) that the connection manager supports for stream tubes with that address type. For simplicity, if a CM supports offering a particular type of tube, it is assumed to support accepting it.

A typical value for a host without IPv6 support:

            {
              Socket_Address_Type_IPv4:
                [Socket_Access_Control_Localhost, Socket_Access_Control_Port,
                 Socket_Access_Control_Netmask],
              Socket_Address_Type_Unix:
                [Socket_Access_Control_Localhost, Socket_Access_Control_Credentials]
            }
          

If stream tubes are not supported, this will be an empty dictionary.

An array of the available tube types, as defined by the Tube_Type enum. Return an array of tuples, each representing a tube, with the following members:
  • the tube's ID
  • the tube's initiator
  • the tube's type
  • the tube's service
  • the tube's parameters
  • the tube's state
Offers a D-Bus tube providing the service specified. A string representing the service name that will be used over the tube. It should be a well-known D-Bus service name, of the form com.example.ServiceName. A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'. The ID of the new tube. The contact associated with this channel doesn't have tubes capabilities. The connection manager doesn't support D-Bus tubes. Offer a stream tube exporting the local socket specified. A string representing the service name that will be used over the tube. It should be a well-known TCP service name as defined by http://www.iana.org/assignments/port-numbers or http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap".

A dictionary of properties for the new tube; the allowable keys, types and values are defined by the service. Connection managers must support the value being any primitive (non-container) D-Bus type, or a byte array 'ay'.

These should usually be the same key-value pairs specified for use in the DNS-SD TXT record for that service.

The type of the listening address of the local service, as a member of Socket_Address_Type. The listening address of the local service, as indicated by the address_type. The access control the local service applies to the local socket, specified so the connection manager can behave appropriately when it connects. A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum. The ID of the new tube. The contact associated with this channel doesn't have tube capabilities. The connection manager doesn't support stream tubes, or does not support the given address type or access-control type.
Emitted when a tube is created. The ID of the new tube. The handle of the contact who initiated the tube. The tube type, as defined by the Tube_Type enum. A string representing the service that will be used over the tube. The new tube's properties. The new tube's state. Accept a D-Bus tube that's in the "local pending" state. The connection manager will attempt to open the tube. The tube remains in the "local pending" state until the TubeStateChanged signal is emitted. The ID of the tube to accept. The string describing the address of the private bus. The client should not attempt to connect to the address until the tube is open. The given tube ID is invalid or does not refer to a D-Bus tube. Accept a stream tube that's in the "local pending" state. The connection manager will attempt to open the tube. The tube remains in the "local pending" state until the TubeStateChanged signal is emitted. The ID of the tube to accept. The type of address the connection manager should listen on. The type of access control the connection manager should apply to the socket. A parameter for the access control type, to be interpreted as specified in the documentation for the Socket_Access_Control enum. The address on which the connection manager will listen for connections to this tube. The client should not attempt to connect to the address until the tube is open. The given tube ID is invalid or does not refer to a stream tube. The given address type or access-control mechanism is not supported. Emitted when the state of a tube changes. The ID of the tube that changed state. The new state of the tube; see the Tube_State enumeration. Close a tube. The ID of the tube to close. Emitted when a tube has been closed. The ID of a closed tube is no longer valid. The ID may later be reused for a new tube. The ID of the tube that was closed. For a D-Bus tube, return a string describing the address of the private bus. The ID of the tube to get an address for. The bus address. The tube is not a D-Bus tube. This tube is not in the "open" state. For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping between contact handles and their unique bus names on this tube. The ID of the tube to get names for. An array of structures, each containing a contact handle and a D-Bus bus name. The tube is not a multi-user D-Bus tube. This tube is not in the "open" state. Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a participant opens or closes the tube. The ID of the tube whose names have changed. Array of handles and D-Bus names of new participants. Array of handles of former participants. For a stream tube, obtain the address of the socket used to communicate over this tube. The ID of the stream tube to get the socket for. The type of the listening address of the socket, as a member of Socket_Address_Type. The listening address of the socket, as indicated by the address_type. The tube is not a stream tube. This tube is not in the "open" state. Emitted on a stream tube when a participant opens a new connection to its socket. The ID of the tube The handle of the participant who opened the new connection
telepathy-glib-0.24.2/spec/Protocol_Interface_Avatars.xml0000644000175000017500000001435212652510705020360 00000000000000 Copyright © 2009-2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for protocols where it might be possible to set the user's avatar, and the expected size limits and supported MIME types are known before connecting.

If the avatar requirements cannot be discovered while offline, it's impossible to avoid setting the Account's Avatar property to an unsupported avatar.

Each property on this interface SHOULD be cached in the .manager file, using a key of the same name as the property in the [Protocol proto] group. All properties are encoded in ASCII decimal in the obvious way, except for SupportedAvatarMIMETypes which is encoded as a sequence of strings each followed by a semicolon (as for the "localestrings" type in the Desktop Entry Specification).

For instance, an XMPP connection manager might have this .manager file:

[Protocol jabber]
Interfaces=org.freedesktop.Telepathy.Protocol.Interface.Avatars;
param-account=s required
param-password=s required
SupportedAvatarMIMETypes=image/png;image/jpeg;image/gif;
MinimumAvatarHeight=32
RecommendedAvatarHeight=64
MaximumAvatarHeight=96
MinimumAvatarWidth=32
RecommendedAvatarWidth=64
MaximumAvatarWidth=96
MaximumAvatarBytes=8192
The expected value of the Connection.Interface.Avatars.SupportedAvatarMIMETypes property on connections to this protocol. The expected value of the Connection.Interface.Avatars.MinimumAvatarHeight property on connections to this protocol. The expected value of the Connection.Interface.Avatars.MinimumAvatarWidth property on connections to this protocol. The expected value of the Connection.Interface.Avatars.RecommendedAvatarHeight property on connections to this protocol. The expected value of the Connection.Interface.Avatars.RecommendedAvatarWidth property on connections to this protocol. The expected value of the Connection.Interface.Avatars.MaximumAvatarHeight property on connections to this protocol. The expected value of the Connection.Interface.Avatars.MaximumAvatarWidth property on connections to this protocol. The expected value of the Connection.Interface.Avatars.MaximumAvatarBytes property on connections to this protocol.
telepathy-glib-0.24.2/spec/Client.xml0000644000175000017500000001424012652510705014330 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

Telepathy clients use connection managers, the channel dispatcher and optionally the account manager to provide useful functionality.

User interface processes are the obvious example of Telepathy clients, but they can provide other functionality, such as address-book synchronization.

Every running or activatable process with a well-known name of the form org.freedesktop.Telepathy.Client.clientname should be probed by the channel dispatcher to discover its capabilities. Each client is either an observer, an approver, a channel handler, or some combination of these.

Activatable services (those with a D-Bus .service file) must be supported so that we can run clients in response to channel creation.

Non-activatable services (those that do not register a D-Bus .service file for their well-known name, but do request it at runtime) must be supported so that we can have programs that process channels, but only if they are already running - for instance, a full-screen media centre application might do this.

The client name, clientname, MUST be a non-empty string of ASCII digits, letters, dots and/or underscores, starting with a letter, and without sets of two consecutive dots or a dot followed by a digit. For non-activatable services, it MAY contain a part that is generated per instance at runtime.

If each of a client Foo's instances should be able to manipulate channels separately, the instance with unique name :1.25 might request a well-known name like org.freedesktop.Telepathy.Client.Foo._1._25.

(Note that well-known bus-name components may not start with a digit, so o.f.T.Client.Foo.1.25 would not be acceptable.)

Each Client MUST export an object whose object path may be determined by replacing '.' with '/' in the well-known name and prepending '/'. This object represents its API as a Telepathy client; the channel dispatcher will call its methods and read its properties when appropriate.

As an optimization, activatable clients SHOULD install a file $XDG_DATA_DIRS/telepathy/clients/clientname.client containing a cached version of its immutable properties, so that for most clients, the channel dispatcher can just read a file to discover capabilities, instead of having to service-activate the client immediately in order to fetch its read-only properties. However, the D-Bus API is canonical, and the channel dispatcher MUST support clients without such a file.

Non-activatable clients MAY install a .client file, but there's not much point in them doing so.

The .client files MUST contain UTF-8 text with the same syntax as Desktop Entry files (although the allowed groups, keys and values differ). Every .client file MUST contain a group whose name is the name of this interface.

The groups, keys and values in the .client file are defined by individual interfaces. Each interface that can usefully cache information in the .client file SHOULD correspond to a group with the same name.

A list of the extra interfaces provided by this client. This SHOULD include at least one of Client.Observer, Client.Approver or Client.Handler.

In the .client file, this is represented by key "Interfaces" in the group named after this interface. The value of the key is a list of interface names each followed by a semicolon (so it always ends with a semicolon unless it is empty), i.e. a key of type "strings" as described in the Desktop Entry specification.

telepathy-glib-0.24.2/spec/Channel_Interface_Destroyable.xml0000644000175000017500000000742512652510705021006 00000000000000 Copyright (C) 2008 Collabora Ltd. Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface exists to support channels where Channel.Close is insufficiently destructive. At the moment this means Channel.Type.Text, but the existence of this interface means that unsupported channels can be terminated in a non-channel-type-specific way.

Close the channel abruptly, possibly with loss of data. The connection manager MUST NOT re-create the channel unless/until more events occur.

The main motivating situation for this method is that when a Text channel with pending messages is closed with Close, it comes back as an incoming channel (to avoid a race between Close and an incoming message). If Destroy is called on a Text channel, the CM should delete all pending messages and close the channel, and the channel shouldn't be re-created until/unless another message arrives.

Most clients SHOULD call Channel.Close instead. However, if a client explicitly intends to destroy the channel with possible loss of data, it SHOULD call this method if this interface is supported (according to the Channel.Interfaces property), falling back to Close if not.

In particular, channel dispatchers SHOULD use this method if available when terminating channels that cannot be handled correctly (for instance, if no handler has been installed for a channel type, or if the handler crashes repeatedly).

Connection managers do not need to implement this interface on channels where Close and Destroy would be equivalent.

Callers need to be able to fall back to Close in any case.

telepathy-glib-0.24.2/spec/Channel_Interface_Chat_State.xml0000644000175000017500000001424212652510705020543 00000000000000 Copyright (C) 2007 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A map from contacts to their chat states. A contact The contact's chat state

A map containing the chat states of all contacts in this channel whose chat state is not Inactive.

Contacts in this channel, but who are not listed in this map, may be assumed to be in the Inactive state.

In implementations that do not have this property, its value may be assumed to be empty until a ChatStateChanged signal indicates otherwise.

This property was not present in older versions of telepathy-spec, because chat states in XMPP are not state-recoverable (if you miss the change notification signal, there's no way to know the state). However, this property still allows clients to recover state changes that were seen by the CM before the client started to deal with the channel.

In CMs that follow older spec versions, assuming Inactive will mean that initial chat states will always be assumed to be Inactive, which is the best we can do. XEP 0085 specifies Inactive as the "neutral" state to be assumed unless told otherwise.

The new state. Set the local state and notify other members of the channel that it has changed. An integer handle for the contact. The new state of this contact. Emitted when the state of a member of the channel has changed. This includes local state. The contact has effectively ceased participating in the chat. The contact has not been active for some time. The contact is actively participating in the chat. The contact has paused composing a message. The contact is composing a message to be sent to the chat.

An interface for channels for receiving notifications of remote contacts' state, and for notifying remote contacts of the local state.

Clients should assume that a contact's state is Channel_Chat_State_Inactive unless they receive a notification otherwise.

The Channel_Chat_State_Gone state is treated differently to other states:

  • It may not be used for multi-user chats
  • It may not be explicitly sent
  • It should be automatically sent when the channel is closed
  • It must not be sent to the peer if a channel is closed without being used
  • Receiving it must not cause a new channel to be opened

The different states are defined by XEP-0085, but may be applied to any suitable protocol.

telepathy-glib-0.24.2/spec/Connection_Interface_Contact_Blocking.xml0000644000175000017500000002400612652510705022455 00000000000000 Copyright © 2009–2011 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Changes from the draft: methods and signals now return Handle_Identifier_Map (a{us}) rather than bare lists of contact handles (au)

An interface for connections where contacts can be blocked from communicating with this user and receiving this user's presence. Clients may retrieve a list of currently-blocked contacts using RequestBlockedContacts, and listen for BlockedContactsChanged to be notified when contacts are blocked and unblocked. The BlockContacts and UnblockContacts methods do what they say on the tin; depending on the value of the ContactBlockingCapabilities property, contacts may be reported for spam or other abuse when calling BlockContacts.

This interface is intended for protocols where blocking contacts persists on the server between connections; connection managers for protocols with no server-side support for blocking contacts MAY choose to implement this interface using an on-disk file of blocked contacts or some other means to store blocked contacts between connections.

This interface is intended to replace the ContactList channel with TargetHandleType List and TargetID "deny" (along with the ContactList and ContactGroups interfaces replacing other channels with TargetHandleType List and TargetHandleType Group, respectively).

Direct the server to block some contacts. The precise effect is protocol-dependent, but SHOULD include ignoring all current and subsequent communications from the given contacts, avoiding sending presence to them in future, and if they were already receiving the local user's presence, behaving as if the local user went offline.

Some contacts to block. If some of the contacts in this list are already blocked, the connection manager MUST act as if they were not specified in this list.

In addition to blocking, report these contacts as abusive to the server administrators.

Clients can determine whether this capability is available by checking the ContactBlockingCapabilities property. If this argument is set to True by a client despite ContactBlockingCapabilities not containing the Can_Report_Abusive flag, the connection manager SHOULD act as if it were False and simply block the supplied contacts.

A correct user interface shouldn't get this far without knowing that reporting abusive contacts is not supported. If it does, then the user has expressed their intention to block these contacts. Returning an error would leave the UI with three options:

  • Ignore the error, leaving the contacts not actually blocked;
  • Display an error to the user;
  • Call this method again, passing False for this argument.

None of these seem preferable to the CM just ignoring this flag if it doesn't support it: that way, the contacts will be blocked, as the user requested, and UIs have fewer ways to mess up entirely.

Direct the server to unblock some contacts.

Some contacts to unblock. If some of the contacts in this list are not currently blocked, the connection manager MUST act as if they were not specified in this list.

List the contacts that are blocked.

Clients SHOULD allow a relatively long timeout for calls to this method, since on some protocols contact blocking is part of the contact list, which can take a significant time to retrieve.

The blocked contacts’ handles, together with their identifiers.

Emitted when the list of blocked contacts is first retrieved (before returning from any pending calls to RequestBlockedContacts), and whenever the list of blocked contacts subsequently changes.

Contacts added to the result of RequestBlockedContacts. Contacts removed from the result of RequestBlockedContacts.

True if the contact would be in the result of RequestBlockedContacts; False or omitted if the contact is not blocked, or if it is unknown whether the contact is blocked.

Additional capabilities for contact blocking; currently, this is limited to whether contacts may be reported as abusive.

Note that there is no capability for supporting blocking itself: the presence of this interface on a Connection indicates that blocking contacts is supported.

When calling BlockContacts, the contacts may be reporting as abusive to the server administrators by setting Report_Abusive to True.
telepathy-glib-0.24.2/spec/Call_Stream.xml0000644000175000017500000003163412652510705015306 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

One stream inside a Content. A stream is a single flow of packets to and from a single remote endpoint. If your call connects to multiple people, you could have multiple streams.

For protocols that support muting streams separately, this object MAY also implement the Mute interface

Set the stream to start or stop sending media from the local user to other contacts.

If True, the LocalSendingState should change to Sending, if it isn't already.

If False, the LocalSendingState should change to None, if it isn't already.

If the call has not been accepted yet, calling SetSending(True) is an error. See LocalSendingState for details.

Request that a remote contact stops or starts sending on this stream.

The CanRequestReceiving property defines whether the protocol allows the local user to request the other side start sending on this stream.

Contact from which sending is requested

If true, request that the given contact starts to send media. If false, request that the given contact stops sending media.

The request contact is valid but is not involved in this stream. The protocol does not allow the local user to request the other side starts sending on this stream.
renamed from SendersChanged to MembersChanged renamed from MembersChanged to RemoteMembersChanged Emitted when RemoteMembers changes. A mapping from channel-specific handles to their updated sending state, whose keys include at least the members who were added, and the members whose states changed. The identifiers of the contacts in the Updates map. The channel-specific handles that were removed from the keys of the RemoteMembers property, as a result of the contact leaving this stream A structured reason for the change. Emitted when LocalSendingState changes. The new value of LocalSendingState. A structured reason for the change. Enum indicating whether a contact is sending media. The contact is not sending media and has not been asked to do so. The contact has been asked to start sending media. The contact is sending media. The contact has been asked to stop sending media. A map from a contact to his or her sending state. The contact handle. The sending state of the contact.

Extra interfaces provided by this stream, such as Stream.Interface.Media. This SHOULD NOT include the Stream interface itself, and cannot change once the stream has been created.

renamed from Senders

A map from remote contacts to their sending state.

Media sent to this stream will be sent to all members listed here. All members listed here will also appear in CallMembers, and each CallMembers member will be listed in at most one Stream per Content. Therefore, to hide things from a member of the call, UIs only need to mute one Stream per Content.

Contacts' handles in this map indicate whether they are sending media to this stream. Sending_State_Pending_Send indicates contacts who are not sending but have been asked to do so. The local user's sending state is shown in LocalSendingState.

This mapping is also used by the streaming implementation to map from MediaDescriptions to Streams. In this use-case, all of the senders in this stream will be represented in RemoteMediaDescriptions. This use-case should not affect anything that does not handle media streaming.

The string identifiers for handles mentioned in RemoteMembers, to give clients the minimal information necessary to create contacts without waiting for round-trips.

The local user's sending state. Media sent on this stream should be assumed to be received, directly or indirectly, by every other contact in the RemoteMembers mapping. Change notification is given via the LocalSendingStateChanged signal.

Implementations of the first Call draft had the self handle in the RemoteMembers (then called Members) map and this showed that it's annoying having to keep track of the self handle so that it can be special-cased.

A value of Pending_Send for this property indicates that the other side requested the local user start sending media (which can be done by calling either SetSending or Accept).

When Accept is called, all streams with a local sending state of Pending_Send and the associated Disposition set to Initial are automatically set to sending.

If true, the user can request that a remote contact starts sending on this stream.

Not all protocols allow the user to ask the other side to start sending media.
telepathy-glib-0.24.2/spec/Call_Content.xml0000644000175000017500000002100312652510705015452 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This object represents one Content inside a Call1. For example, in an audio/video call there would be one audio content and one video content. Each content has one or more Stream objects which represent the actual transport to one or more remote contacts.

There are two cases where multiple streams may happen:
  • Calls with more than two participants, if the protocol does not support multicast, and does not have mixer proxy.
  • With jingle, when calling a contact connected from multiple resources, a stream is created for each resource. Once the remote contact answered from one of its resources, all other streams get removed.

For protocols that support muting all streams of a given content separately, this object MAY also implement the Mute interface

previously there were no arguments Remove the content from the call. This will cause Call1.ContentRemoved((self_handle, User_Requested, "", "")) to be emitted. Raised when a Call doesn't support removing contents (e.g. a Google Talk video call).

Extra interfaces provided by this content, such as Content.Interface.Media, Interface.Hold or Interface.Mute. This SHOULD NOT include the Content interface itself, and cannot change once the content has been created.

The name of the content.

The content name property should be meaningful, so should be given a name which is significant to the user. The name could be the "audio" or "video" string localized, or perhaps include some string identifying the source, such as a webcam identifier.

The media type of this content.

The disposition of this content, which defines whether to automatically start sending data on the streams when Accept is called on the channel. The content has no specific disposition.

The content was initially part of the call. When Accept is called on the channel, all streams of this content with LocalSendingState set to Pending_Send will be moved to Sending as if SetSending (True) had been called.

The disposition of this content. plural version, renamed from StreamAdded

Emitted when streams are added to a call.

The Streams which were added.
plural version, renamed from StreamRemoved

Emitted when streams are removed from a call

The Streams which were removed. Why the content was removed.

The list of Stream objects that exist in this content.

In a conference call multiple parties can share one media content (say, audio), but the streaming of that media can either be shared or separate. For example, in a multicast conference all contacts would share one stream, while in a Muji conference there would be a stream for each participant.

Change notification is through the StreamsAdded and StreamsRemoved signals.

telepathy-glib-0.24.2/spec/Call_Content_Interface_Audio_Control.xml0000644000175000017500000001227312652510705022264 00000000000000 Copyright © 2009-2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface allows the connection manager to be kept informed of, and control, the input and output volumes of an audio stream. While generally not needed, if the connection manager needs to handle stream volumes directly (typically when using Call_Content_Packetization_Type_Raw), this interface may be necessary.

If this interface is present, the handler should call ReportInputVolume and ReportOutputVolume whenever the input and output volume change, both when the user manually modifies the volume and when the volumes are adjusted in response to RequestedInputVolume and RequestedOutputVolume changing.

The maximum volume as used in this interface represent the unamplified hardware volume (0 dB). No software amplification should be used to boost the signal to a higher level when this Interface is in use

The input volume as requested by the Connection Manager. Initially and on any changes the client should change its input volume to match the requested volume. Report the input volume level as set by the client.

Report to the CM that the Content input volume has been changed by the client.

It is the client's responsibility to change the input volume used for the content. However, the client MUST call this whenever it changes input volume for the content.

The input volume as requested by the Connection Manager. Initially and on any changes the client should change its input volume to match the requested volume. Report the output volume level as set by the client.

Report to the CM that the content output volume has been changed by the client.

It is the client's responsibility to change the output volume used for the content. However, the client MUST call this whenever it changes output volume for the content.

A volume value either reported to or requested by the Connection Manager. This value should either be -1 for an unknown value or in the range of 0-255, with 0 being the minimal volume and 255 being the highest unamplified volume the input or output is capable of (known as 0 dB)

telepathy-glib-0.24.2/spec/Channel_Interface_Conference.xml0000644000175000017500000007502512652510705020601 00000000000000 Copyright © 2009 Collabora Limited Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for multi-user conference channels that can "continue from" one or more individual channels. This could be used to invite other contacts to an existing 1-1 text conversation, combine two phone calls into one conference call, and so on, with roughly the same API in each case.

This interface addresses freedesktop.org bug #24906 (GSM-compatible conference calls) and bug #24939 (upgrading calls and chats to multi-user). See those bugs for more rationale and use cases.

Existing channels are upgraded by requesting a new channel of the same ChannelType, listing the channels to be merged into the new conference in the InitialChannels property of the request. If InitialInviteeHandles and InitialInviteeIDs are Allowed_Properties in RequestableChannelClasses, ad-hoc conferences to a set of contacts may be created by requesting a channel, specifying InitialInviteeHandles and/or InitialInviteeIDs to be the contacts in question. A request may specify these alongside InitialChannels, to simultaneously upgrade a channel to a conference and invite others to join it.

Channels with this interface MAY also implement MergeableConference.DRAFT to support merging more 1-1 channels into an ongoing conference. Similarly, 1-1 channels MAY implement Splittable.DRAFT to support being broken out of a Conference channel.

The Group interface on Conference channels MAY use channel-specific handles for participants; clients SHOULD support both Conferences that have channel-specific handles, and those that do not.

In the GSM case, the Conference's Group interface MAY have channel-specific handles, to represent the fact that the same phone number may be in a conference twice (for instance, it could be the number of a corporate switchboard).

In the XMPP case, the Conference's Group interface SHOULD have channel-specific handles, to reflect the fact that the participants have MUC-specific identities, and the user might also be able to see their global identities, or not.

In most other cases, including MSN and link-local XMPP, the Conference's Group interface SHOULD NOT have channel-specific handles, since users' identities are always visible.

Connection managers implementing channels with this interface MUST NOT allow the object paths of channels that could be merged into a Conference to be re-used, unless the channel re-using the object path is equivalent to the channel that previously used it.

If you upgrade some channels into a conference, and then close the original channels, InitialChannels (which is immutable) will contain paths to channels which no longer exist. This implies that you should not re-use channel object paths, unless future incarnations of the path are equivalent.

For instance, on protocols where you can only have zero or one 1-1 text channels with Emily at one time, it would be OK to re-use the same object path for every 1-1 text channel with Emily; but on protocols where this is not true, it would be misleading.

Examples of usage

A pair of 1-1 GSM calls C1 and C2 can be merged into a single conference call by calling:

CreateChannel({ ...ChannelType: ...Call, ...InitialChannels: [C1, C2] })

which returns a new channel Cn implementing the conference interface. (As a quirk of GSM, both 1-1 will cease to function normally until they are Split from the conference, or the conference ends.)

An XMPP 1-1 conversation C3 (with chris@example.com, say) can be continued in a newly created multi-user chatroom by calling:

CreateChannel({ ...ChannelType: ...Text, ...InitialChannels: [C3] })

Or, to invite emily@example.net to join the newly-created MUC at the same time:

CreateChannel({ ...ChannelType: ...Text, ...InitialChannels: [C3], ...InitialInviteeIDs: ['emily@example.net'] })

To continue C3 in a particular multi-user chatroom (rather than the implementation inventing a unique name for the room), call:

EnsureChannel({ ...ChannelType: ...Text, ...TargetHandleType: ...Room, ...TargetID: 'telepathy@conf.example.com', ...InitialChannels: [C3] })

Note the use of EnsureChannel — if a channel for telepathy@conf.example.com is already open, this SHOULD be equivalent to inviting chris@example.com to the existing channel.

In the above cases, the text channel C3 SHOULD remain open and fully functional (until explicitly closed by a client); new incoming 1-1 messages from chris@example.com SHOULD appear in C3, and messages sent using C3 MUST be relayed only to chris@example.com.

If there is an open 1-1 text channel with a contact, in every other situation new messages will appear in that channel. Given that the old channel remains open — which is the least surprising behaviour, and eases us towards a beautiful world where channels never close themselves — it stands to reason that it should be where new messages from Chris should appear. On MSN, creating a conference from C3 should migrate the underlying switchboard from C3 to the new channel; this is an implementation detail, and should not affect the representation on D-Bus. With a suitable change of terminology, Skype has the same behaviour.

If the current handler of that channel doesn't want this to happen (maybe it transformed the existing tab into the group chat window, and so there'd be no UI element still around to show new messages), then it should just Close the old 1-1 channel; it'll respawn if necessary.

Either of the XMPP cases could work for Call channels, to upgrade from 1-1 Jingle to multi-user Jingle. Any of the XMPP cases could in principle work for link-local XMPP (XEP-0174).

XMPP and MSN do not natively have a concept of merging two or more channels C1, C2... into one channel, Cn. However, the GSM-style merging API can be supported on XMPP and MSN, as an API short-cut for upgrading C1 into a conference Cn (which invites the TargetHandle of C1 into Cn), then immediately inviting the TargetHandle of C2, the TargetHandle of C3, etc. into Cn as well.

Sample RequestableChannelClasses

A GSM connection might advertise the following channel class for conference calls:

( Fixed = {
    ...ChannelType: ...StreamedMedia
  },
  Allowed = [ InitialChannels, InitialAudio ]
)

This indicates support for starting audio-only conference calls by merging two or more existing channels (since InitialInviteeHandles and InitialInviteeIDs are not allowed).

An XMPP connection might advertise the following classes for ad-hoc multi-user text chats:

( Fixed = {
    ...ChannelType: ...Text
  },
  Allowed = [ InitialChannels, InitialInviteeHandles, InitialInviteeIDs, InvitationMessage ]
),
( Fixed = {
    ...ChannelType: ...Text,
    ...TargetHandleType: Room
  },
  Allowed = [ TargetHandle, TargetID,
              InitialChannels, InitialInviteeHandles, InitialInviteeIDs, InvitationMessage ]
)

The first class indicates support for starting ad-hoc (nameless) chat rooms, upgraded from existing 1-1 channels and/or inviting new contacts, along with a message to be sent along with the invitations. The second indicates support for upgrading to a particular named chat room.

The individual Channels that are continued by this conference, which have the same ChannelType as this one, but with TargetHandleType = CONTACT.

This property MUST NOT be requestable; instead, the InitialChannels property may be specified when requesting a channel.

This is consistent with requesting InitialInviteeHandles and InitialInviteeIDs, rather than requesting Group.Members and some hypothetical ID version of that property.

Change notification is via the ChannelMerged and ChannelRemoved signals.

Emitted when a new channel is added to the value of Channels.

The channel that was added to Channels. A new channel-specific handle for the TargetHandle of Channel, as will appear in OriginalChannels, or 0 if a global handle is used for Channel's TargetHandle on the Group interface of this channel. Channel's immutable properties.

Emitted when a channel is removed from the value of Channels, either because it closed or because it was split using the Splittable.DRAFT.Split method.

If a channel is removed because it was closed, Closed should be emitted before this signal.

The channel that was removed from Channels. Additional information about the removal, which may include the same well-known keys as the Details argument of MembersChangedDetailed, with the same semantics.

The initial value of Channels.

This property SHOULD be requestable. Omitting it from a request is equivalent to providing it with an empty list as value. Requests where its value has at least two channel paths SHOULD be expected to succeed on any implementation of this interface. If InitialInviteeHandles and InitialInviteeIDs are Allowed_Properties in RequestableChannelClasses, then requests with zero or one channel paths SHOULD also succeed; otherwise, clients SHOULD NOT make requests with zero or one paths for this property.

In GSM, a pair of calls can be merged into a conference, but you can't start a conference call from zero or one existing calls. In XMPP and MSN, you can create a new chatroom, or upgrade one 1-1 channel into a chatroom; however, on these protocols, it is also possible to fake GSM-style merging by upgrading the first channel, then inviting the targets of all the other channels into it.

If possible, the Channels' states SHOULD NOT be altered by merging them into a conference. However, depending on the protocol, the Channels MAY be placed in a "frozen" state by placing them in this property's value or by calling MergeableConference.DRAFT.Merge on them.

In Jingle, nothing special will happen to merged calls. UIs MAY automatically place calls on hold before merging them, if that is the desired behaviour; this SHOULD always work. Not doing an implicit hold/unhold seems to preserve least-astonishment.

In GSM, the calls that are merged go into a state similar to Hold, but they cannot be unheld, only split from the conference call using Channel.Interface.Splittable.DRAFT.Split.

Depending on the protocol, it might be signalled to remote users that this channel is a continuation of all the requested channels, or that it is only a continuation of the first channel in the list.

In MSN, the conference steals the underlying switchboard (protocol construct) from one of its component channels, so the conference appears to remote users to be a continuation of that channel and no other. The connection manager has to make some arbitrary choice, so we arbitrarily mandate that it SHOULD choose the first channel in the list as the one to continue.

A list of additional contacts invited to this conference when it was created.

If it is possible to invite new contacts when creating a conference (as opposed to merging several channels into one new conference channel), this property SHOULD be requestable, and appear in the allowed properties in RequestableChannelClasses. Otherwise, this property SHOULD NOT be requestable, and its value SHOULD always be the empty list.

On GSM you have to place a 1-1 call before you can merge it into a conference; on the other hand, you can invite new contacts to XMPP Muji calls and XMPP/MSN/Skype ad-hoc chat rooms without starting a 1-1 channel with them first.

If included in a request, the given contacts are automatically invited into the new channel, as if they had been added with Group.AddMembers(InitialInviteeHandles, InvitationMessage) immediately after the channel was created.

This is a simple convenience API for the common case that a UI upgrades a 1-1 chat to a multi-user chat solely in order to invite someone else to participate.

If the local user was not the initiator of this channel, the Group.SelfHandle SHOULD appear in the value of this property, together with any other contacts invited at the same time (if that information is known).

InitialInviteeHandles, InitialInviteeIDs and InitialChannels MAY be combined in a single request.

For example, if you have a 1-1 channel C1 with Rob, and you want to invite Sjoerd to join the discussion, you can do so by requesting a channel with InitialChannels=[C1] and InitialInviteeHandles=[sjoerd], or InitialChannels=[C1] and InitialInviteeIDs=["sjoerd@example.com"].

If a request includes some combination of InitialInviteeHandles, InitialInviteeIDs and InitialChannels, then the value of InitialInviteeHandles on the resulting channel SHOULD be the union of the handles from InitialInviteeHandles, the handles corresponding to the InitialInviteeIDs, and the target handles of the InitialChannels, with any duplicate handles removed. Because this property is immutable, its value SHOULD be computed before the channel is announced via the NewChannels signal.

This simplifies identification of new channels in clients - they only have to look at one of the properties, not both. For example, after either of the requests mentioned above, the NewChannels signal would announce the channel with InitialChannels=[C1], InitialInviteeHandles=[rob, sjoerd], and InitialInviteeIDs=["rob@example.net", "sjoerd.example.com"].

A list of additional contacts invited to this conference when it was created.

This property SHOULD be requestable if and only if InitialInviteeHandles is requestable. Its semantics are the same, except that it takes a list of the string representations of contact handles; invitations are sent to any contact present in either or both of these properties.

When a channel is created, the values of InitialInviteeHandles and InitialInviteeIDs MUST correspond to each other. In particular, this means that the value of InitialInviteeIDs will include the TargetID of each channel in InitialChannels, and the ID corresponding to each handle in InitialInviteeHandles.

The message that was sent to the InitialInviteeHandles when they were invited.

This property SHOULD be requestable, and appear in the allowed properties in RequestableChannelClasses, in protocols where invitations can have an accompanying text message.

This allows invitations with a message to be sent when using InitialInviteeHandles or InitialInviteeIDs.

If the local user was not the initiator of this channel, the message with which they were invited (if any) SHOULD appear in the value of this property.

On GSM conference calls, it is possible to have the same phone number in a conference twice; for instance, it could be the number of a corporate switchboard. This is represented using channel-specific handles; whether or not a channel uses channel-specific handles is reported in Group.GroupFlags. The Group.HandleOwners property specifies the mapping from opaque channel-specific handles to actual numbers; this property specifies the original 1-1 channel corresponding to each channel-specific handle in the conference.

In protocols where this situation cannot arise, such as XMPP, this property MAY remain empty.

For example, consider this situation:

  1. Place a call (with path /call/to/simon) to the contact +441234567890 (which is assigned the handle h, say), and ask to be put through to Simon McVittie;
  2. Put that call on hold;
  3. Place another call (with path /call/to/jonny) to +441234567890, and ask to be put through to Jonny Lamb;
  4. Request a new channel with InitialChannels: ['/call/to/simon', '/call/to/jonny'].

The new channel will have the following properties, for some handles s and j:

{
...Group.GroupFlags: Channel_Specific_Handles | (other flags),
...Group.Members: [self_handle, s, j],
...Group.HandleOwners: { s: h, j: h },
...InitialChannels: ['/call/to/simon', '/call/to/jonny'],
...Channels: ['/call/to/simon', '/call/to/jonny'],
...OriginalChannels: { s: '/call/to/simon', j: '/call/to/jonny' },
# ...standard properties like ChannelType: Group elided...
}

Change notification is via the ChannelMerged and ChannelRemoved signals: if Channel_Specific_Handle in the former is non-zero, this property SHOULD be updated to map that handle to the merged channel's path.

A channel-specific handle for a participant in this conference. The object path of Channels representing the original 1-1 channel with Channel_Specific_Handle. A mapping from members of a conference to the original 1-1 channel with that contact, if any. See OriginalChannels for details.
telepathy-glib-0.24.2/spec/Call_Content_Media_Description_Interface_RTCP_Feedback.xml0000644000175000017500000000525212652510705025500 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

This codec offer interface provides a method of signalling support for RTCP feedback, documented by Extended RTP Profile for Real-time Transport Control Protocol (RTCP)-Based Feedback (RTP/AVPF) (RFC 4585).

The codec identifiers used in the description of the Feedback Messages sent in the Accept's should match those used for the RemoteCodecs in the same Accept call.

For more details on what RTCP Feedback can do and how to use it, one should refer to RFC 4585.

A map of remote feedback codec properties that are supported. True if the remote contact supports Audio-Visual Profile Feedback (AVPF), otherwise False.
telepathy-glib-0.24.2/spec/Connection_Interface_Addressing.xml0000644000175000017500000002627112652510705021343 00000000000000 Copyright (C) 2010-2012 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface deals with the multiple address types that can refer to the same contact, such as vCard fields and URIs.

It can be used to retrieve contacts with a specific addresses through GetContactsByVCardField and GetContactsByURI, as well as defining the various addressing methods for a given contact through this interface's contact attributes.

The vCard field of the addresses we are requesting. The field name SHOULD be in lower case. Supported fields can be found in AddressableVCardFields.

The url vCard field MUST NOT appear here; see GetContactsByURI instead.

In practice, protocols have a limited set of URI schemes that make sense to resolve as a contact.

The addresses to get contact handles for. The address types should match the given vCard field.

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

Attributes from this interface and from org.freedesktop.Telepathy.Connection are always returned, and need not be requested explicitly.

The behavior of this parameter is similar to the same parameter in Contacts.GetContactAttributes.

A mapping from requested vCard addresses to the corresponding contact handles.

Requested addresses that are not valid or understood for this protocol MUST be omitted from the mapping.

A dictionary mapping the contact handles to contact attributes. If any of the requested addresses are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

Requested addresses that are not valid or understood for this protocol MUST be omitted from the mapping.

Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

Request contacts and retrieve their attributes using a given field in their vCards.

The connection manager should record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the Connection.ReleaseHandles method.

The URI addresses to get contact handles for. Supported schemes can be found in AddressableURISchemes.

A list of strings indicating which D-Bus interfaces the calling process is interested in. All supported attributes from these interfaces, whose values can be obtained without additional network activity, will be in the reply.

Attributes from this interface and from org.freedesktop.Telepathy.Connection are always returned, and need not be requested explicitly.

The behavior of this parameter is similar to the same parameter in Contacts.GetContactAttributes.

A mapping of requested URIs to the corresponding contact handles.

Requested URIs that are not valid or understood for this protocol MUST be omitted from the mapping.

A dictionary mapping the contact handles to contact attributes. If any of the requested addresses are in fact invalid, they are simply omitted from this mapping. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value.

Requested URIs that are not valid or understood for this protocol MUST be omitted from the mapping.

Each contact's attributes will always include at least the identifier that would be obtained by inspecting the handle (org.freedesktop.Telepathy.Connection/contact-id).

Request contacts and retrieve their attributes using URI addresses.

The connection manager should record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the Connection.ReleaseHandles method.

A mapping of vCard fields and addresses equivalent to a particular contact's protocol identifier. For instance, on XMPP this would contain x-jabber for all contacts, and x-facebook-id for contacts on Facebook's server.

A vCard field, such as x-jabber. The value of that vCard field for the contact.
The various vCard addresses that identify this contact. The various URI addresses that identify this contact. A map from URIs/vCard addresses to the corresponding handle. The URI or vCard address that has been requested by GetContactsByVCardField or GetContactsByURI. A nonzero handle.
telepathy-glib-0.24.2/spec/Account_Interface_Storage.xml0000644000175000017500000001512712652510705020157 00000000000000 Copyright (C) 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface extends the core Account interface to specify details regarding the storage of this account.

Single-sign-on systems do not generally have directly user-editable properties for Accounts, and require the user to visit a specific UI to alter their account properties. User interfaces should know not to expose these account properties as user-editable, and instead redirect the user to the appropriate interface.

The name of the account storage implementation, which SHOULD start with a reversed domain name in the same way as D-Bus interface names. When this is the empty string the account is internally stored.

This property cannot change once an Account has been created.

Unique identification of the account within the storage backend. The contents of the variant are defined by the StorageProvider.

This property cannot change once an Account has been created.

Different storage systems will have their own way of uniquely identifying an account, typically an integer or a string. Given that all users of this property should have direct knowledge of the backend they should know what types to expect and how to handle it.

Map containing information specific to the storage backend. The keys and the types of their values are defined by the StorageProvider, and are not interpreted by the AccountManager implementation.

As the values in this map may change at any time (due to an external application manipulating the storage provider directly), this property should not be cached; it should instead be retrieved each time it is needed.

This can be used to provide additional hints to user interfaces aware of a specific storage provider, without requiring those user interfaces to use the StorageIdentifier to query the storage provider directly.

Bitfield which defines what restrictions this Storage method has.

This property cannot change once an Account has been created.

Flags indicating restrictions imposed on an Account by its storage method. The account's Parameters property can't be changed by calling UpdateParameters. The account can't be enabled/disabled by setting the Enabled property. The account's presence can't be changed by setting the RequestedPresence and AutomaticPresence properties. The account's Service property cannot be changed.
telepathy-glib-0.24.2/spec/Call_Content_Interface_Video_Control.xml0000644000175000017500000001175512652510705022275 00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface that allows the connection manager to control the video stream.

This interface is generally not needed. In cases where the connection manager handles the network communication and the media is transferred from the client to the connection manager via shared memory, it can sometimes be beneficial for the connection manager to be able to control certain aspects of the video stream.

Request that the video encoder produce a new key frame as soon as possible. With of the video stream. Height of the video stream. The resolution at which the streaming engine should be sending.

Change notification is via the VideoResolutionChanged signal.

The desired video resolution has changed. The bitrate the streaming engine should be sending at.

Change notification is via the BitrateChanged signal.

The desired bitrate has changed The framerate the streaming engine should be sending at.

Change notification is via the FramerateChanged signal.

The desired framerate has changed The Maximum Transmission Unit

Change notification is via the MTUChanged signal.

The Maximum Transmission Unit has changed Only send key frames when manually requested
telepathy-glib-0.24.2/spec/Connection_Interface_Cellular.xml0000644000175000017500000001706512652510705021024 00000000000000 Copyright © 2008-2010 Nokia Corporation Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This interface is for various cellular things (GSM and/or CDMA) that aren't really applicable to other protocols.

Define how long should the service centre try message delivery before giving up, failing delivery and deleting the message. A value of 0 means to use the service centre's default period.

The value specified is in seconds. Note that various protocols or implementations may round the value up (eg. to a minute or hour precision). The maximum validity period may vary depending on protocol or provider.

Previously, as an undocumented feature, setting MessageServiceCentre to the empty string caused the SIM's default SMSC to be used.

If True, SMSes will be sent via the service centre specified by MessageServiceCentre. If False, the SIM's default SMSC will be used, ignoring the value of MessageServiceCentre.

It could be desirable for a configuration interface to remember the user's previous choice of custom SMSC, even if it's not in use. This boolean allows that choice to be saved as an account parameter by Mission Control, rather than the UI needing to save it elsewhere to be restored if the user wants to reactivate it.

This property's value is now ignored unless OverrideMessageServiceCentre is True.

Address for the messaging service centre. Typically (as is the case for GSM's SMSC), it's the ISDN / telephony address (ie. a phone number). If OverrideMessageServiceCentre is False, this property's value should be ignored by the CM in favour of the SIM's default SMSC.

The International Mobile Subscriber Identifier, if it exists. This would originate from a SIM card. If the IMSI is unknown, this will contain an empty string ("").

Emitted when the IMSI for the connection changes. This sort of thing is rare, but could happen on cellular phones that allow hot-swapping of SIM cards. In the case of SIM swapping, this signal would be emitted twice; the first time while the SIM is being ejected (with an empty string), and the second time after a new SIM has been inserted (assuming that the IMSI can be determined from the new SIM). The new IMSI value. This may be an empty string in the case where the IMSI is being reset or removed.

Determines how to encode SMSes containing characters that do not fit into a non-Unicode character set. If False (which SHOULD be the default), messages will be encoded as UCS-2 and sent with no loss of fidelity (at the potential financial cost of using twice as many SMSes); if True, the message will be recoded in an implementation‐specific way to fit into a GSM reduced character set.

Hint for the connection manager for the GSM character set that should be used to send SMSes. The connection manager SHOULD follow this hint unless it has other ways to determine a better encoding. If the value is "gsm" (which SHOULD be the default), SMSes will be encoded in the normal 7-bit GSM character set, eventually falling back to UCS-2; see the MessageReducedCharacterSet property for details. Other valid character sets are specified in the GSM standard and are, for instance, "turkey", "spain" or "portugal". If the SMS cannot be encoded using the requested character set the behaviour is implementation-specific, but it is RECOMMENDED that the connection manager should behave as if this property was set to "gsm".

telepathy-glib-0.24.2/spec/errors.xml0000644000175000017500000006042012652510705014427 00000000000000

The D-Bus errors used in Telepathy all start with org.freedesktop.Telepathy.Error.. They are used in D-Bus messages of type ERROR, and also as plain strings annotated with the DBus_Error_Name type.

In principle, any method can raise any error (this is a general fact of IPC). For instance, generic D-Bus errors starting with org.freedesktop.DBus.Error. will occur in some situations.

Telepathy methods can also raise implementation-specific errors to indicate specialized failure conditions. For better interoperability, if a suitable Telepathy error exists, it should be preferred.

The namespace org.freedesktop.Telepathy.Qt4.Error. is reserved for use by the D-Bus client implementation in telepathy-qt4, which uses it to represent certain error situations that did not involve a D-Bus ERROR message. These errors are defined and documented as part of telepathy-qt4's C++ API, and should not be used on D-Bus.

Raised when there is an error reading from or writing to the network. Raised when the requested method, channel, etc is not available on this connection. Raised when one of the provided arguments is invalid. Raised when the requested functionality is temporarily unavailable. The user is not permitted to perform the requested operation. The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None. The second usage corresponds to None in the Connection_Status_Reason enum; if a better reason is available, the corresponding error should be used instead. The handle specified is unknown on this channel or connection. You are banned from the channel. The channel is full. The requested channel is invite-only.

The requested channel or other resource already exists, and another user interface in this session is responsible for it.

User interfaces SHOULD handle this error unobtrusively, since it indicates that some other user interface is already processing the channel.

Raised by an ongoing request if it is cancelled by user request before it has completed, or when operations are performed on an object which the user has asked to close (for instance, a Connection where the user has called Disconnect, or a Channel where the user has called Close). The second form can be used to correspond to the Requested member in the Connection_Status_Reason enum, or to to represent the situation where disconnecting a Connection, closing a Channel, etc. has been requested by the user but this request has not yet been acted on, for instance because the service will only act on the request when it has finished processing an event queue. Raised when authentication with a service was unsuccessful. This corresponds to Authentication_Failed in the Connection_Status_Reason enum. Raised if a user request insisted that encryption should be used, but encryption was not actually available. This corresponds to part of Encryption_Error in the Connection_Status_Reason enum. It's been separated into a distinct error here because the two concepts that were part of EncryptionError seem to be things that could reasonably appear differently in the UI. Raised if encryption appears to be available, but could not actually be used (for instance if SSL/TLS negotiation fails). This corresponds to part of Encryption_Error in the Connection_Status_Reason enum. Raised if the server did not provide a SSL/TLS certificate. This error MUST NOT be used to represent the absence of a client certificate provided by the Telepathy connection manager. This corresponds to Cert_Not_Provided in the Connection_Status_Reason enum. That error explicitly applied only to server SSL certificates, so this one is similarly limited; having the CM present a client certificate is a possible future feature, but it should have its own error handling. Raised if the server provided a SSL/TLS certificate signed by an untrusted certifying authority. This error SHOULD NOT be used to represent a self-signed certificate: see the Self Signed error for that. This corresponds to Cert_Untrusted in the Connection_Status_Reason enum and to Untrusted in the TLS_Certificate_Reject_Reason enum, with a clarification to avoid ambiguity. Raised if the server provided an expired SSL/TLS certificate. This corresponds to Cert_Expired in the Connection_Status_Reason enum and to Expired in the TLS_Certificate_Reject_Reason enum. Raised if the server provided an SSL/TLS certificate that will become valid at some point in the future. This corresponds to Cert_Not_Activated in the Connection_Status_Reason enum and to Not_Activated in the TLS_Certificate_Reject_Reason enum. Raised if the server provided an SSL/TLS certificate that did not have the expected fingerprint. This corresponds to Cert_Fingerprint_Mismatch in the Connection_Status_Reason enum and to Fingerprint_Mismatch in the TLS_Certificate_Reject_Reason enum.

Raised if the server provided an SSL/TLS certificate that did not match its hostname.

You MAY be able to get more details about the expected and certified hostnames by looking up the 'expected-hostname' and 'certificate-hostname' keys in the details map that came together with this error.

This corresponds to Cert_Hostname_Mismatch in the Connection_Status_Reason enum and to Hostname_Mismatch in the TLS_Certificate_Reject_Reason enum.
Raised if the server provided an SSL/TLS certificate that is self-signed and untrusted. This corresponds to Cert_Self_Signed in the Connection_Status_Reason enum and to Self_Signed in the TLS_Certificate_Reject_Reason enum. Raised if the server provided an SSL/TLS certificate that has been revoked. This corresponds to Cert_Revoked in the Connection_Status_Reason enum and to Revoked in the TLS_Certificate_Reject_Reason enum. Raised if the server provided an SSL/TLS certificate that uses an insecure cipher algorithm or is cryptographically weak. This corresponds to Cert_Insecure in the Connection_Status_Reason enum and to Insecure in the TLS_Certificate_Reject_Reason enum. Raised if the server provided an SSL/TLS certificate that is unacceptable in some way that does not have a more specific error. This corresponds to Cert_Other_Error in the Connection_Status_Reason enum and to Unknown in the TLS_Certificate_Reject_Reason enum. Raised if the length in bytes of the server certificate, or the depth of the server certificate chain exceeds the limits imposed by the crypto library. This corresponds to Cert_Limit_Exceeded in the Connection_Status_Reason enum and to Limit_Exceeded in the TLS_Certificate_Reject_Reason enum. Raised when requested functionality is unavailable due to contact not having required capabilities. Raised when requested functionality is unavailable because a contact is offline. This corresponds to Offline in the Channel_Group_Change_Reason enum. Used to represent a user being ejected from a channel by another user, for instance being kicked from a chatroom. This corresponds to Kicked in the Channel_Group_Change_Reason enum. Used to represent a user being removed from a channel because of a "busy" indication. This error SHOULD NOT be used to represent a server or other infrastructure being too busy to process a request - for that, see ServerBusy. This corresponds to Busy in the Channel_Group_Change_Reason enum. Used to represent a user being removed from a channel because they did not respond, e.g. to a StreamedMedia call. This corresponds to No_Answer in the Channel_Group_Change_Reason enum. Raised when the requested user does not, in fact, exist. This corresponds to Invalid_Contact in the Channel_Group_Change_Reason enum, but can also be used to represent other things not existing (like chatrooms, perhaps). Raised when a channel is terminated for an unspecified reason. In particular, this error SHOULD be used whenever normal termination of a 1-1 StreamedMedia call by the remote user is represented as a D-Bus error name. This corresponds to None in the Channel_Group_Change_Reason enum. Raised when the local streaming implementation has no codecs in common with the remote side. This corresponds to Media_Error. The media stream type requested is not supported by either the local or remote side. This corresponds to Media_Error. Raised when the call's streaming implementation has some kind of internal error. This corresponds to Internal_Error. Raised when a connection is refused. Raised when a connection can't be established. Raised when a connection is broken. Raised when the user attempts to connect to an account but they are already connected (perhaps from another client or computer), and the protocol or account settings do not allow this. XMPP can have this behaviour if the user chooses the same resource in both clients (it is server-dependent whether the result is AlreadyConnected on the new connection, ConnectionReplaced on the old connection, or two successful connections). Raised by an existing connection to an account if it is replaced by a new connection (perhaps from another client or computer). In MSNP, when connecting twice with the same Passport, the new connection "wins" and the old one is automatically disconnected. XMPP can also have this behaviour if the user chooses the same resource in two clients (it is server-dependent whether the result is AlreadyConnected on the new connection, ConnectionReplaced on the old connection, or two successful connections). Raised during in-band registration if the server indicates that the requested account already exists. Raised if a server or some other piece of infrastructure cannot process the request, e.g. due to resource limitations. Clients MAY try again later. This is not the same error as Busy, which indicates that a user is busy. Raised if a request cannot be satisfied because a process local to the user has insufficient resources. Clients MAY try again later. For instance, the ChannelDispatcher might raise this error for some or all channel requests if it has detected that there is not enough free memory. Raised if a request cannot be satisfied without violating an earlier request for anonymity, and the earlier request specified that raising an error is preferable to disclosing the user's identity (for instance via Connection.Interface.Anonymity.AnonymityMandatory or Channel.Interface.Anonymity.AnonymityMandatory). Raised when the requested functionality is not yet available, but is likely to become available after some time has passed. Raised when an incoming or outgoing Call1 is rejected by the the receiver. Raised when a call was terminated as a result of the local user picking up the call on a different resource. Raised when a server or other piece of infrastructure indicates an internal error, or when a message that makes no sense is received from a server or other piece of infrastructure. For instance, this is appropriate for XMPP's internal-server-error, and is also appropriate if you receive sufficiently inconsistent information from a server that you cannot continue. Raised if a server rejects protocol messages from a connection manager claiming that they do not make sense, two local processes fail to understand each other, or an apparently impossible situation is reached. For instance, this would be an appropriate mapping for XMPP's errors bad-format, invalid-xml, etc., which can't happen unless the local (or remote) XMPP implementation is faulty. This is also analogous to Invalid_CM_Behavior, TP_DBUS_ERROR_INCONSISTENT in telepathy-glib, and TELEPATHY_QT4_ERROR_INCONSISTENT in telepathy-qt4.

Raised as a ConnectionError when a Connection cannot be established because either the Connection Manager or its support library (e.g. wocky, papyon, sofiasip) requires upgrading to support a newer protocol version.

This error corresponds to the Connection_Status_Reason of Network_Error.

Some protocols transmit a protocol or library version number to the server, which will disconnect them if the version isn't appropriate. This way we can report the error to the user, and if appropriate, the user's client can check for updates.
Raised if a client attempts to dial a number that is recognized as an emergency number (e.g. '911' in the USA), but the Connection Manager or provider does not support dialling emergency numbers. Many VOIP providers have the ability to dial traditional (PSTN) telephone numbers, but do not provide the ability to dial emergency numbers (for instance, Google Voice). This error provides additional information about why such a call was unsuccessful.

Raised if the user has insufficient Balance to place a call or send a message.

The key 'balance-required' MAY be included in CallStateDetails or a delivery report's Message_Part (with the same units and scale as AccountBalance) to indicate how much credit is required to make this call or send this message.

Raised if the CaptchaAuthentication1 Handler either has no UI to present captchas, or it does, but wasn't able to answer any of the captchas given.

Copyright © 2005-2010 Collabora Limited Copyright © 2005-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

telepathy-glib-0.24.2/spec/Connection.xml0000644000175000017500000016446212652510705015225 00000000000000 Copyright (C) 2005-2009 Collabora Limited Copyright (C) 2005-2009 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A struct representing a channel, as returned by ListChannels on the Connection interface. The object path of the channel, which is on the same bus name as the connection The channel's type The type of the handle that the channel communicates with, or Handle_Type_None if there is no associated handle The handle that the channel communicates with, or 0 if there is no associated handle

Request that the connection be established. This will be done asynchronously and errors will be returned by emitting StatusChanged signals.

Calling this method on a Connection that is already connecting or connected is allowed, and has no effect.

Request that the connection be closed. This closes the connection if it's not already in DISCONNECTED state, and destroys the connection object.

The set of optional interfaces supported by this connection. Before the connection status changes to CONNECTED, this property may change at any time, but it is guaranteed that interfaces will only be added, not removed. After the connection status changes to CONNECTED, this property cannot change further.

There is no explicit change notification; reasonable behaviour for a client would be to retrieve the interfaces list once initially, and once more when it becomes CONNECTED.

In some connection managers, certain capabilities of a connection are known to be implemented for all connections (e.g. support for SimplePresence), and some interfaces (like SimplePresence) can even be used before connecting. Other capabilities may or may not exist, depending on server functionality; by the time the connection goes CONNECTED, the connection manager is expected to have evaluated the server's functionality and enabled any extra interfaces for the remainder of the Connection's lifetime.

Clients SHOULD fall back to calling GetInterfaces if this property is not supported.
The value of the Interfaces property

Returns the set of optional interfaces supported by this connection. See Interfaces for more details.

Before version 0.17.8 calling GetInterfaces while on a connection that is not yet CONNECTED wasn't allowed. If a CM returns this error, its list of interfaces should be regarded as empty until it becomes CONNECTED.
A string identifier for the protocol Get the protocol this connection is using. Emitted whenever the SelfHandle property changes. If the connection is not yet in the CONNECTED state, this signal is not guaranteed to be emitted. Clients MAY assume that if the SelfHandle property exists, this signal will be emitted when necessary. Use SelfContactChanged to get the new SelfID at the same time The new value of the SelfHandle property. Emitted whenever the SelfHandle and SelfID property changes. If the connection is not yet in the CONNECTED state, this signal is not guaranteed to be emitted. Clients MAY assume that if the SelfHandle and SelfID property exists, this signal will be emitted when necessary. The new value of the SelfHandle property. The new value of the SelfID property. The handle which represents the user on this connection, which will remain valid for the lifetime of this connection, or until a change in the user's identifier is signalled by the SelfContactChanged signal. If the connection is not yet in the CONNECTED state, the value of this property MAY be zero. For compatibility with older versions, clients should fall back to calling the GetSelfHandle method. The identifier which represents the user on this connection, which will remain valid for the lifetime of this connection, or until a change in the user's identifier is signalled by the SelfContactChanged signal. If the connection is not yet in the CONNECTED state, the value of this property MAY be empty string. The value of the SelfHandle property Returns the value of the SelfHandle property. Change notification is via the SelfHandleChanged signal. Use GetAll to get the SelfHandle property (and all other Connection properties) instead.

The current status of the connection. Change notification is via the StatusChanged signal.

If retrieval of property succeeds and yields the value Disconnected, this indicates that the connection has not yet been established. If connection has been attempted and failed, the Connection object SHOULD be removed from the bus entirely, meaning that retrieval of this property SHOULD fail.

Clients SHOULD fall back to calling GetStatus if this property is not supported.
The value of the Status property Get the current status as defined in the StatusChanged signal. If HasImmortalHandles is true, this method no longer does anything. The type of handle to be held A array of integer handles to hold

If HasImmortalHandles is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.

In older connection managers, this method notifies the connection manger that your client is holding a copy of handles which may not be in use in any existing channel or list, and were not obtained by using the RequestHandles method. For example, a handle observed in an emitted signal, or displayed somewhere in the UI that is not associated with a channel. The connection manager must not deallocate a handle where any clients have used this method to indicate it is in use until the ReleaseHandles method is called, or the clients disappear from the bus.

Note that HoldHandles is idempotent - calling it multiple times is equivalent to calling it once. If a handle is "referenced" by several components which share a D-Bus unique name, the client should perform reference counting internally, and only call ReleaseHandles when none of the cooperating components need the handle any longer.

The handle type is invalid One of the given handles is not valid
The type of handle to be inspected An array of integer handles of this type An array of identifiers corresponding to the given handles, in the same order. Return a string representation for a number of handles of a given type. The handle type is invalid One of the given handles is not valid Use the Requests.Channels property instead. An array of structs representing channels. List all the channels which currently exist on this connection. Connection managers MUST still emit this signal, but clients SHOULD listen for the Requests.NewChannels signal instead. A D-Bus object path for the channel object on this service A D-Bus interface name representing the channel type An integer representing the type of handle this channel communicates with, or Handle_Type_None if no handle is specified A handle indicating the specific contact, room or list this channel communicates with, or zero if no handle is specified

If true, the channel was requested by a client that intends to present it to the user itself (i.e. it passed suppress_handler=TRUE to the RequestChannel method), so no other handler should be launched. Clients MAY assume that channels where this is true were created by a user request.

If false, either the channel was created due to incoming information from the service, or the channel was requested by a local client that does not intend to handle the channel itself (this usage is deprecated).

Clients MUST NOT assume that only incoming channels will have this flag set to false.

Emitted when a new Channel object is created, either through user request or incoming information from the service.
If HasImmortalHandles is true, this method no longer does anything. An integer handle type (as defined in RequestHandle) An array of integer handles being held by the client

If HasImmortalHandles is true, which SHOULD always be the case in this version of telepathy-spec, this method does nothing and returns successfully, unless the given handle type or any of the given handles is invalid.

In older connection managers, this method explicitly notifies the connection manager that your client is no longer holding any references to the given handles, and that they may be deallocated if they are not held by any other clients or referenced by any existing channels. See HoldHandles for notes.

The handle type is invalid One of the given handles is not valid
Use Requests.CreateChannel or Requests.EnsureChannel instead. Connection managers MAY implement RequestChannel by raising NotImplemented, or implement fewer types of channel via this API. A D-Bus interface name representing base channel type An integer representing the handle type, or Handle_Type_None if no handle is specified A nonzero integer handle representing a contact, room, list etc. according to handle_type, or zero if the handle_type is Handle_Type_None

Clients SHOULD always set this to true.

The historical meaning was that clients that did not intend to take responsibility for displaying the channel to the user could set this to FALSE, in which case the channel dispatcher would launch an appropriate channel handler.

However, clients whose functionality relies on having a working channel dispatcher should obtain that functionality by calling methods on the channel dispatcher, so that they will get an appropriate error if the channel dispatcher is missing or not working.

The channel dispatcher itself should set this to true too, so that it will ignore the NewChannel signal that results from the creation of the channel. It can then dispatch the channel returned from this method to an appropriate handler.

So, there is no sensible use-case for setting this to false, and setting it to false can result in unhandled channels (in the case where clients assume that a channel dispatcher is present, but it isn't).

The D-Bus object path for the channel created or retrieved

Request a channel satisfying the specified type and communicating with the contact, room, list etc. indicated by the given handle_type and handle. The handle_type and handle may both be zero to request the creation of a new, empty channel, which may or may not be possible, depending on the protocol and channel type.

On success, the returned channel will always be of the requested type (i.e. implement the requested channel-type interface).

If a new, empty channel is requested, on success the returned channel will always be an "anonymous" channel for which the type and handle are both zero.

If a channel to a contact, room etc. is requested, on success, the returned channel may either be a new or existing channel to the requested entity (i.e. its TargetHandleType and TargetHandle properties are the requested handle type and handle), or a newly created "anonymous" channel associated with the requested handle in some implementation-specific way.

For example, for a contact handle, the returned channel might be "anonymous", but implement the groups interface and have the requested contact already present among the members.

If the request cannot be satisfied, an error is raised and no channel is created.

Unknown channel type The given handle does not exist or cannot be created The requested channel type cannot be created with the given handle The requested channel cannot be created because contact doesn't have the required capabilities.
A "null" handle type used to indicate the absence of a handle. When a handle type and a handle appear as a pair, if the handle type is zero, the handle must also be zero. A contact A chat room Replaced by Connection.Interface.ContactList A server-generated contact list (see Channel.Interface.Group) Replaced by Connection.Interface.ContactList A user-defined contact list (see Channel.Interface.Group) An unsigned 32-bit integer representing a handle An unsigned 32-bit integer representing a handle of type Handle_Type_Contact An unsigned 32-bit integer representing a handle of type Handle_Type_Room Replaced by Connection.Interface.ContactList An unsigned 32-bit integer representing a handle of type Handle_Type_List Replaced by Connection.Interface.ContactList An unsigned 32-bit integer representing a handle of type Handle_Type_Group If HasImmortalHandles is true, this method no longer has its reference-counting effect. The type of handle required An array of identifiers of entities to request handles for An array of integer handle numbers in the same order as the given identifiers.

Request several handles from the connection manager which represent a number of contacts, rooms or server-stored lists on the service.

If HasImmortalHandles is true, which SHOULD always be the case in this version of telepathy-spec, the handles remain valid until the connection disconnects.

The implementation of this method in older connection managers must record that these handles are in use by the client who invokes this method, and must not deallocate the handles until the client disconnects from the bus or calls the ReleaseHandles method. Where the identifier refers to an entity that already has a handle in this connection manager, this handle should be returned instead. The handle number 0 must not be returned by the connection manager.

The given identifier does not identify a valid entity of the given type. For instance, an XMPP connection would raise this error for identifiers with type Handle_Type_Room that do not contain exactly one '@' character, that contain spaces, and so on. The given handle type is not valid, or is not implemented on this connection. For instance, a connection to a protocol that doesn't have chat rooms would raise this error for room handles, and all CMs would raise this error for Handle_Type_None.
The connection is fully connected and all methods are available. Connect has been called but the connection has not yet been established. Some methods may fail until the connection has been established. If this is retrieved from GetStatus or Status, it indicates that connection has not yet been attempted. If seen in a StatusChanged signal, it indicates that the connection has failed; the Connection object SHOULD be removed from D-Bus immediately, and all subsequent method calls SHOULD fail.

A reason why the status of the connection changed. Apart from Requested, the values of this enumeration only make sense as reasons why the status changed to Disconnected.

There is no reason set for this state change. Unknown status reasons SHOULD be treated like this reason.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Disconnected.

The change is in response to a user request. Changes to the Connecting or Connected status SHOULD always indicate this reason; changes to the Disconnected status SHOULD indicate this reason if and only if the disconnection was requested by the user.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled.

There was an error sending or receiving on the network socket.

When the status changes from Connecting to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionRefused, org.freedesktop.Telepathy.Error.ConnectionFailed or some more specific error.

When the status changes from Connected to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionLost or some more specific error.

The username or password was invalid.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.AuthenticationFailed.

There was an error negotiating SSL on this connection, or encryption was unavailable and require-encryption was set when the connection was created.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.EncryptionNotAvailable if encryption was not available at all, or org.freedesktop.Telepathy.Error.EncryptionError if encryption failed.

In general, this reason indicates that the requested account name or other identification could not be used due to conflict with another connection. It can be divided into three cases:

  • If the status change is from Connecting to Disconnected and the 'register' parameter to RequestConnection was present and true, the requested account could not be created on the server because it already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.RegistrationExists.
  • If the status change is from Connecting to Disconnected but the 'register' parameter is absent or false, the connection manager could not connect to the specified account because a connection to that account already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.AlreadyConnected. In some protocols, like XMPP (when connecting with the same JID and resource as an existing connection), the existing connection "wins" and the new one fails to connect.
  • If the status change is from Connected to Disconnected, the existing connection was automatically disconnected because a new connection to the same account (perhaps from a different client or location) was established. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.ConnectionReplaced. In some protocols, like MSNP (when connecting twice with the same Passport), the new connection "wins" and the existing one is automatically disconnected.

The server did not provide a SSL certificate.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotProvided.

The server's SSL certificate is signed by an untrusted certifying authority. This error SHOULD NOT be used to represent a self-signed certificate: use the more specific Cert_Self_Signed reason for that.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Untrusted.

The server's SSL certificate has expired.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Expired.

The server's SSL certificate is not yet valid.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotActivated.

The server's SSL certificate did not match its hostname.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.HostnameMismatch.

The server's SSL certificate does not have the expected fingerprint.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch.

The server's SSL certificate is self-signed.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.SelfSigned.

There was some other error validating the server's SSL certificate.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Invalid.

The server's SSL certificate has been revoked.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Revoked.

The server's SSL certificate uses an insecure algorithm, or is cryptographically weak.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Insecure.

The length in bytes of the server certificate, or the depth of the sever certificate chain exceed the limits imposed by the crypto library.

When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.LimitExceeded

Emitted when an error occurs that renders this connection unusable.

Whenever this signal is emitted, it MUST immediately be followed by a StatusChanged signal with status Connection_Status_Disconnected and an appropriate reason code.

Connection managers SHOULD emit this signal on disconnection, but need not do so. Clients MUST support connection managers that emit StatusChanged(Disconnected, ...) without first emitting ConnectionError.

This signal provides additional information about the reason for disconnection. The reason for connection is always straightforward - it was requested - so it does not need further explanation. However, on errors, it can be useful to provide additional information.

The Connection_Status_Reason is not given here, since it will be signalled in StatusChanged. A reasonable client implementation would be to store the information given by this signal until StatusChanged is received, at which point the information given by this signal can be used to supplement the StatusChanged signal.

The name of a D-Bus error describing the error that occurred, which may correspond to a Connection_Status_Reason, or may be a more specific Telepathy error (such as org.freedesktop.Telepathy.Error.ConnectionRefused for Connection_Status_Reason_Network_Error) or a protocol-specific or connection-manager-specific error in a suitable namespace. For instance, a SIP connection manager could signal "402 Payment Required" as an error in a connection-manager-specific namespace, or a link-local XMPP implementation that used Avahi could provide the error given to it by the avahi-daemon.

Additional information about the error, which may include the following well-known keys:

debug-message (s)
Debugging information on the change, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances
server-message (s)
A human-readable message from the server explaining what happened. This may be in the user's native language, or in the server operator's native language, or even in Lojban.
user-requested (b), expected-hostname (s), certificate-hostname (s)
The same details defined in TLS_Certificate_Rejection.
An integer indicating the new status, as defined by ConnectionStatus An integer indicating the reason for the status change, as defined by ConnectionStatusReason Emitted when the status of the connection changes. All states and reasons have numerical values, as defined in ConnectionStatus and ConnectionStatusReason.

The same string that would be returned by InspectHandles. As a special case, this is always present in the result of GetContactAttributes, whether it was explicitly requested or not.

Register a client's interest in notifications related to one or more interfaces.

Groups of notifications are identified by a token which is either a D-Bus interface name, or a string that starts with a D-Bus interface name. The meaning of each token is given by that D-Bus interface, which MUST define it in its documentation.

Initially, all interests are in entire interface, but allowing other strings allows subscription to part of an interface; for instance, an interest in ...MailNotification/count could track the number of messages without caring about their detailed content.

For each token with which this method interacts, the Connection tracks an "interest count" (like a reference count) for each unique bus name that has called this method. When a client calls this method, for each token, the interest count for its unique bus name is incremented; when RemoveClientInterest is called, all interest counts for that unique bus name are decremented. If the unique bus name leaves the bus (for instance, if the client crashes or exits), all interest counts for that unique bus name are set to zero.

The Connection can then use these reference counts to avoid subscribing to protocol-level notifications unless at least one client has a non-zero interest count for the relevant token.

This method exists to reduce memory and network overhead when there is no active subscription.

One situation where this is useful is Location: on XMPP, location updates are received over PEP. If the Connection advertises the geoloc+notify capability, it will be sent location updates for all contacts. To avoid consuming resources for this, the connection should avoid advertising that capability until a client has expressed an interest in contacts' locations.

Another example of a protocol that benefits from this method is the Google XMPP Mail Notification extension, which can be used to implement MailNotification. In this protocol, the CM receives a notification that something has changed, but to get more information, the CM must request this information. Knowing that nobody is currently interested in this information, the CM can avoid generating useless network traffic. Similarly, the CM may free the list of unread messages to reduce memory overhead.

If this method is called for an interface that might require protocol-level subscription, but the connection cannot set up that subscription yet (for instance because the Status is not Connected yet), the Connection MUST remember the client's interest, and attempt to subscribe to the appropriate protocol feature when this becomes possible.

Clients MAY ignore any errors raised by this method; it is intended to be called with the reply ignored.

The only reason it could fail is if it's unimplemented, in which case the only thing the client can usefully do is to proceed as if it had succeeded.

Interfaces or parts of interfaces in which to register an interest, represented by either a DBus_Interface, or a string prefixed with a DBus_Interface.

If the Connection does not support one of these tokens, this is not considered to be an error; the unsupported token is simply ignored.

Release an interest registered using AddClientInterest. See that method's documentation for details.

Clients MAY ignore any errors raised by this method; it is intended to be called with the reply ignored.

The only reasons it could fail are if it's unimplemented, or if the client's reference-counting is wrong and it has tried to remove a client interest that it did not add. In both cases, there's nothing the client could do about it.

Interfaces or parts of interfaces that were previously passed to AddClientInterest.

True if handles last for the whole lifetime of the Connection. This SHOULD be the case in all connection managers, but clients MUST interoperate with older connection managers (which reference-count handles).

This models a connection to a single user account on a communication service. Its basic capability is to provide the facility to request and receive channels of differing types (such as text channels or streaming media channels) which are used to carry out further communication.

In order to allow Connection objects to be discovered by new clients, the object path and well-known bus name MUST be of the form /org/freedesktop/Telepathy/Connection/cmname/proto/account and org.freedesktop.Telepathy.Connection.cmname.proto.account where:

  • cmname is the same Connection_Manager_Name that appears in the connection manager's object path and well-known bus name
  • proto is the Protocol name as seen in ListProtocols, but with "-" replaced with "_" to get a valid object path/bus name
  • account is some non-empty sequence of ASCII letters, digits and underscores not starting with a digit

account SHOULD be formed such that any valid distinct connection instance on this protocol has a distinct name. This might be formed by including the server name followed by the user name (escaped via some suitable mechanism like telepathy-glib's tp_escape_as_identifier() function to preserve uniqueness); on protocols where connecting multiple times is permissable, a per-connection identifier might be necessary to ensure uniqueness.

Clients MAY parse the object path to determine the connection manager name and the protocol, but MUST NOT attempt to parse the account part. Connection managers MAY use any unique string for this part.

As well as the methods and signatures below, arbitrary interfaces may be provided by the Connection object to represent extra connection-wide functionality, such as the Connection.Interface.SimplePresence for receiving and reporting presence information, and Connection.Interface.Aliasing for connections where contacts may set and change an alias for themselves. These interfaces can be discovered using the GetInterfaces method.

Contacts, rooms, and server-stored lists (such as subscribed contacts, block lists, or allow lists) on a service are all represented by immutable handles, which are unsigned non-zero integers which are valid only for the lifetime of the connection object, and are used throughout the protocol where these entities are represented, allowing simple testing of equality within clients.

Zero as a handle value is sometimes used as a "null" value to mean the absence of a contact, room, etc.

Handles have per-type uniqueness, meaning that every (handle type, handle number) tuple is guaranteed to be unique within a connection and that a handle alone (without its type) is meaningless or ambiguous. Connection manager implementations should reference count these handles to determine if they are in use either by any active clients or any open channels, and may deallocate them when this ceases to be true. Clients may request handles of a given type and identifier with the RequestHandles method, inspect the entity identifier with the InspectHandles method, keep handles from being released with HoldHandles, and notify that they are no longer storing handles with ReleaseHandles.

Previously, the account part of Connection bus names/object paths was allowed to have more than one component (i.e. contain dots or slashes), resulting in Connection bus names and object paths with more than 7 components. We now restrict Connection bus names/object paths to have exactly 7 components. The Requests and Contacts interfaces are now mandatory. Their functionality will be merged into the main Connection interface at some point in future.
telepathy-glib-0.24.2/spec/Channel_Handler.xml0000644000175000017500000000562612652510705016127 00000000000000 Copyright (C) 2007-2008 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Clients should implement Client.Handler instead.

An interface exported by Mission Control 4 client applications which are able to handle incoming channels.

Called when a channel handler should handle a new channel. The bus name of the connection and channel The object-path of the connection that owns the channel The channel type The object-path of the channel The type of the handle that the channel communicates with, or 0 if there is no associated handle The handle that the channel communicates with, or 0 if there is no associated handle
telepathy-glib-0.24.2/spec/Channel_Type_Call.xml0000644000175000017500000021634512652510705016430 00000000000000 Copyright © 2009-2010 Collabora Limited Copyright © 2009-2010 Nokia Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

A channel type for making audio and video calls. Call channels supersede the old StreamedMedia channel type. Call channels are much more flexible than its predecessor and allow more than two participants.

Handlers are advised against executing all the media signalling, codec and candidate negotiation themselves but instead use a helper library such as telepathy-farstream which when given a new Call channel will set up the transports and codecs and create GStreamer pads which can be added to the handler UI. This is useful as it means the handler does not have to worry how exactly the connection between the call participants is being made.

The TargetHandle and TargetID properties in a Call channel refer to the contact that the user initially called, or which contact initially called the user. Even in a conference call, where there are multiple contacts in the call, these properties refer to the initial contact, who might have left the conference since then. As a result, handlers should not rely on these properties.

Contents

Content objects represent the actual media that forms the Call (for example an audio content and a video content). Calls always have one or more Content objects associated with them. As a result, a new Call channel request MUST have either InitialAudio=True, or InitialVideo=True, or both, as the Requestable Channel Classes will document.

Content objects have one or more stream associated with them. More information on these streams and how to maniuplate them can be found on the Content interface page.

Outgoing calls

To make an audio-only call to a contact foo@example.com handlers should call:

CreateChannel({
  ...ChannelType: ...Call1,
  ...TargetHandleType: Contact,
  ...TargetID: 'foo@example.com',
  ...InitialAudio: True,
})

As always, TargetHandle may be used in place of TargetID if the contact's handle is already known. To make an audio and video call, the handler should also specify InitialVideo The connection manager SHOULD return a channel whose immutable properties contain the local user as the InitiatorHandle, the remote contact as the TargetHandle, Requested = True (indicating the call is outgoing).

After a new Call channel is requested, the CallState property will be Pending_Initiator. As the local user is the initiator, the call must be accepted by the handler by calling the Accept method. At this point, CallState changes to Initialising, which signifies that the call is waiting for the network to do something. When the CM has information indicating that the remote contact has been notified about the call (or immediately if the network is known not to convey such information) it should also change to Initialised. All changes to the CallState property are signalled using the CallStateChanged signal.

When the call is accepted by the remote contact, the CallStateChanged signal fires again to show that CallState = Accepted.

At this point telepathy-farstream will signal that a pad is available for the handler to show in the user interface. Once media is correctly flowing in both directions, the state will change to Active, to inform the user that they have a correctly working call there is nothing amiss.

Missed calls

If the remote contact does not accept the call in time, then the call can be terminated by the server. Note that this only happens in some protocols. Most XMPP clients, for example, do not do this and rely on the call initiator terminating the call. A missed call is shown in a Call channel by the CallState property changing to Ended, and the CallStateReason property changing to (remote contact, No_Answer, "").

Rejected calls

If the remote contact decides he or she does not feel like talking to the local user, he or she can reject his or her incoming call. This will be shown in the Call channel by CallState changing to Ended and the CallStateReason property changing to (remote contact, User_Requested, "org.freedesktop.Telepathy.Error.Rejected").

Incoming calls

When an incoming call occurs, something like the following NewChannels signal will occur:

NewChannels([
  /org/freedesktop/Telepathy/Connection/foo/bar/foo_40bar_2ecom/CallChannel,
  {
    ...ChannelType: ...Call1,
    ...TargetHandleType: Contact,
    ...TargetID: 'foo@example.com',
    ...TargetHandle: 42,
    ...Requested: False,
    ...InitialAudio: True,
    ...InitialVideo: True,
    ...InitialAudioName: "audio",
    ...InitialVideoName: "video",
    ...MutableContents: True,
  }])

The InitialAudio and InitialVideo properties show that the call has been started with two contents: one for audio streaming and one for video streaming. The InitialAudioName and InitialVideoName properties also show that the aforementioned audio and video contents have names "audio" and "video".

Once the handler has notified the local user that there is an incoming call waiting for acceptance, the handler should call SetRinging to let the CM know. The new channel should also be given to telepathy-farstream to work out how the two participants will connect together. telepathy-farstream will call the appropriate methods on the call's Contents to negotiate codecs and transports.

To pick up the call, the handler should call Accept. The CallState property changes to Accepted and once media is being transferred, telepathy-farstream will notify the handler of a new pad to be shown to the local user in the UI. Once media is correctly flowing in both directions, the state will change to Active, to inform the user that they have a correctly working call there is nothing amiss.

To reject the call, the handler should call the Hangup method. The CallState property will change to Ended and the CallStateReason property will change to (self handle, User_Requested, "org.freedesktop.Telepathy.Error.Rejected").

Ongoing calls

Adding and removing contents

When a call is open, new contents can be added as long as the CM supports it. The MutableContents property will let the handler know whether further contents can be added or existing contents removed. An example of this is starting a voice call between a contact and then adding a video content. To do this, the should call AddContent like this:

AddContent("video",
           Video)

Assuming no errors, the new video content will be added to the call. telepathy-farstream will pick up the new content and perform the transport and codec negotiation automatically. telpathy-farstream will signal when the video is ready to show in the handler's user interface.

A similar method is used for removing contents from a call, except that the Remove method is on the Content object.

Ending the call

To end the call, the handler should call the Hangup method. The CallState property will change to Ended and CallStateReason will change to (self handle, User_Requested, "org.freedesktop.Telepathy.Error.Cancelled").

If the other participant hangs up first then the CallState property will change to Ended and CallStateReason will change to (remote contact, User_Requested, "org.freedesktop.Telepathy.Error.Terminated").

Multi-party calls

Requestable channel classes

The RequestableChannelClasses for Call1 channels can be:

[( Fixed = { ...ChannelType: ...Call1,
            ...TargetHandleType: Contact,
            ...InitialVideo: True
          },
  Allowed = [ ...InitialVideoName,
              ...InitialAudio,
              ...InitialAudioName
            ]
),
( Fixed = { ...ChannelType: ...Call1,
            ...TargetHandleType: Contact,
            ...InitialAudio: True
          },
  Allowed = [ ...InitialAudioName,
              ...InitialVideo,
              ...InitialVideoName
            ]
)]

Clients aren't allowed to make outgoing calls that have neither initial audio nor initial video. Clearly, CMs which don't support video should leave out the first class and omit InitialVideo from the second class, and vice versa for CMs without audio support.

Handlers should not close Call1 channels without first calling Hangup on the channel. If a Call handler crashes, the ChannelDispatcher will call Close on the channel which SHOULD also imply a call to Hangup(User_Requested, "org.freedesktop.Telepathy.Error.Terminated", "") before actually closing the channel.

renamed from Ringing

Indicate that the local user has been alerted about the incoming call.

This method is only useful if the channel's Requested property is False, and the CallState is Initialised (an incoming call is ready and waiting for the user to be notified). Calling this method SHOULD set CallFlags' bit Locally_Ringing, and notify the remote contact that the local user has been alerted (if the protocol supports this); repeated calls to this method SHOULD succeed, but have no further effect.

In all other states, this method SHOULD fail with the error NotAvailable.

The call was Requested, so ringing does not make sense. The call is no longer in state Initialised.
renamed from Ringing

Notifies the CM that the local user is already in a call, so this call has been put in a call-waiting style queue.

This method is only useful if the channel's Requested property is False, and the CallState is Initialising or Initialised. Calling this method SHOULD set CallFlags' bit Locally_Queued, and notify the remote contact that the call is in a queue (if the protocol supports this); repeated calls to this method SHOULD succeed, but have no further effect.

Locally_Queued is a little like Locally_Held, but applies to calls that have not been Accepted (the Locally_Queued flag should be unset by the CM when Accept is called). It should also be set in response to the state of the world, rather than in response to user action.

The call was Requested, so queueing does not make sense. The call is no longer in state Initialising or Initialised.

For incoming calls in state Initialised, accept the incoming call. This changes the CallState to Accepted.

For outgoing calls in state Pending_Initiator, actually call the remote contact; this changes the CallState to Initialising.

Otherwise, this method SHOULD fail with the error NotAvailable.

This method should be called exactly once per Call, by whatever client (user interface) is handling the channel.

When this method is called, for each Content whose Disposition is Initial, any streams where the LocalSendingState is Pending_Send will be moved to Sending as if SetSending(True) had been called.

The call is not in one of the states where this method makes sense.
Request that the call is ended. All contents will be removed from the Call so that the Contents property will be the empty list. A generic hangup reason. A more specific reason for the call hangup, if one is available, or an empty string otherwise. A human-readable message to be sent to the remote contact(s). XMPP Jingle allows calls to be terminated with a human-readable message. The call has already been ended. Request that a new Content of type Content_Type is added to the Call1. Handlers should check the value of the MutableContents property before trying to add another content as it might not be allowed.

The suggested name of the content to add.

The content name property should be meaningful, so should be given a name which is significant to the user. The name could be a localized "audio", "video" or perhaps include some string identifying the source, such as a webcam identifier.

If there is already a content with the same name as this property then a sensible suffix should be added. For example, if this argument is "audio" but a content of the same name already exists, a sensible suffix such as " (1)" is appended to name the new content "audio (1)". A further content with the name "audio" would then be named "audio (2)".

The media stream type of the content to be added to the call. The requested initial direction of the new content. Path to the newly-created Call1.Content object. The media stream type given is invalid. The media stream type requested is not implemented by the CM. The media stream type requested is not supported by either the local or remote side. The content type requested cannot be added to this call. Examples of why this might be the case include because a second video stream cannot be added, or a content cannot be added when the content set isn't mutable.

Emitted when a new Content is added to the call.

Path to the newly-created Content object.

Emitted when a Content is removed from the call.

The Content which was removed. Why the content was removed.

The list of Content objects that are part of this call. Change notification is via the ContentAdded and ContentRemoved signals.

The state of a call, as a whole.

The allowed transitions are:

  • Pending_Initiator → Initialising (for outgoing calls, when Accept is called)
  • Initialising → Initialised (for outgoing calls, when the remote client indicates that the user has been notified about the call. If the network is known not to provide feedback about whether the remote side is ringing, then the call should immediately be set to Initialised.
  • Initialising → Initialised (for incoming calls, when e.g. the implementation has been initialised far enough that it is sensible to notify the user about the call (to reduce the probability that the user will pick up the call and have it immediately fail). The UI should then alert the user about the call, and call SetRinging)
  • Initialised → Accepted (for outgoing calls to a contact, when the remote contact accepts the call; for incoming calls, when Accept is called.)
  • Accepted → Active (when the local user successfully joins the call/conference, and media is known to be flowing successfully; also, when temporary connection problems are resolved (See below)). If the network is known not to provide feedback about when the call is properly connected, the call should immediately be set to Active.
  • Active → Accepted (when there are temporary connection problems that the CM is aware of and able to recover from)
  • any state → Ended (when the call is terminated normally, or when an error occurs that the CM is unable to recover from)

Clients MAY consider unknown values from this enum to be an error - additional values will not be defined after the Call specification is declared to be stable.

The call state is not known. This call state MUST NOT appear as a value of the CallState property, but MAY be used by client code to represent calls whose state is as yet unknown. The initiator of the call hasn't accepted the call yet. This state only makes sense for outgoing calls, where it means that the local user has not yet sent any signalling messages to the remote user(s), and will not do so until Accept is called. Progress has been made in placing the call, but the contact has not been made aware of the call yet. This corresponds to SIP's status code 183 Session Progress, and should be used for the period where the CM is waiting for the streaming implementation to initialise (before sending the initial INVITE or equivalent) and when the outgoing call has reached a gateway or ICE negotiation is pending. UIs should not produce a dialtone or start ringing if the call is in this state. In the outgoing case: at least one called user has been alerted about the call (a SIP 180 (Ringing) packet or equivalent has been received) but none have answered, so the call cannot go to Accepted (use Ringing to determine which members have been informed and which haven't, if you care). UIs SHOULD produce a dialtone for outgoing calls in this state. In the incoming case, the local user should be informed of the call as soon as the call reaches this state (and SetRinging should be called to inform the CM that this has happened, so that it can relay this fact to the caller using a SIP 180 (Ringing) packet or equivalent). The contact being called has accepted the call, but the call is not in the Active state (The most common reason for this is that the streaming implementation hasn't connected yet). The contact being called has accepted the call, and discourse between at least two parties should now be possible. The call has ended, either via normal termination or an error.
A set of flags representing additional information than is available in CallState. Many of these flags only make sense in a particular (or may explain why a call is in a specific state). The call has been put on hold by the local user, e.g. using the Hold interface. This flag SHOULD only be set if there is at least one Content, and all Contents are locally held. Otherwise, in transient situations where some but not all contents are on hold, UIs would falsely indicate that the call as a whole is on hold, which could lead to the user saying something they'll regret, while under the impression that the other contacts can't hear them! This flag exists as a simplified proxy for HoldStateChanged, to reduce the number of signals that need to be listened to by a simple UI. This flag exists for observability of the SetRinging method (e.g. so that loggers can tell whether the call got as far as alerting the user, or whether something went wrong before then). It should be set when the SetRinging is called, and unset when the call leaves Initialised. This flag exists for observability of the SetQueued method. It should be set when the SetQueued is called, and unset when the call leaves Initialising or Initialised. The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted. This flag only makes sense on outgoing calls. It SHOULD be set or unset according to informational messages from other contacts. This flag only occurs when the CallState is Ended. The call with this flag set has ended, but not all resources corresponding to the call have been freed yet. Depending on the protocol there might be some audible feedback while the clearing flag is set. In calls following the ITU-T Q.931 standard there is a period of time between the call ending and the underlying channel being completely free for re-use.

A map used to provide optional extensible details for the CallState, CallFlags and/or CallStateReason.

Well-known keys and their corresponding value types include:

hangup-message - s
An optional human-readable message sent when the call was ended, corresponding to the Message argument to the Hangup method. This is only applicable when the call state is Ended. XMPP Jingle can send such messages.
queue-message - s
An optional human-readable message sent when the local contact is being held in a queue. This is only applicable when Locally_Queued is in the call flags. SIP 182 notifications can have human-readable messages attached.
debug-message - s
A message giving further details of any error indicated by the CallStateReason. This will not normally be localized or suitable for display to users, and is only applicable when the call state is Ended.
balance-required - i
Optionally included when a call cannot be connected because there is InsufficientBalance, indicating what the required balance would be to place this call. The value of this key has the same units and scale as AccountBalance.
forwarded-to - u
Optionally included when the CallStateReason is Forwarded. It indicates the handle to whom the Call was forwarded.
forwarded-to-id - s
The string that would result from inspecting the forwarded-to key (i.e. the contact's identifier in the IM protocol).

The current high-level state of this call. The CallFlags provide additional information, and the CallStateReason and CallStateDetails explain the reason for the current values for those properties.

Note that when in a conference call, this property is purely to show your state in joining the call. The receiver (or remote contact) in this context is the conference server itself. The property does not change when other call members' states change.

Clients MAY consider unknown values in this property to be an error.

Flags representing the status of the call as a whole, providing more specific information than the CallState.

Clients are expected to ignore unknown flags in this property, without error.

When an ongoing call is active and not on hold or has any other problems, this property will be 0.

A simple representation of the reason for a change in the call's state, which may be used by simple clients, or used as a fallback when the DBus_Reason member of a Call_State_Reason struct is not understood. We just don't know. Unknown values of this enum SHOULD also be treated like this. Situation normal. Progress has been made in the setup/teardown of the call (and it didn't require any user interaction).

The change was requested by the contact indicated by the Actor member of a Call_State_Reason struct.

The DBus_Reason SHOULD be the empty string if the call was terminated normally, but MAY be a non-empty error name to indicate error-like call termination reasons (kicked from a conference by a moderator, etc.).

The call was forwarded. If known, the handle of the contact the call was forwarded to will be indicated by the "forwarded-to" member of a CallStateDetails dictionnary in the CallStateChanged signal.

The CallState changed from Initialised or Ended (or a content's direction changed) because it was rejected by the remote user.

Corresponds to Rejected

The CallState changed from Initialised or Ended because the initiator ended the call before the receiver accepted it. With an incoming call this state change reason signifies a missed call, or one that was picked up elsewhere before it was picked up here.

Corresponds to NoAnswer or PickedUpElsewhere

The CallState changed because one of the addresses does not exist on the network.

Corresponds to DoesNotExist

The CallState changed because the local user is not authorised.

Corresponds to PermissionDenied or InsufficientBalance

The CallState changed from Initialised Ended because the receiver is busy (e.g. is already engaged in another call, and has not placed the initiator in a call-waiting queue).

Corresponds to Busy

There has been an unexpected error in either the CM or some other local component.

Corresponds to Confused or Media.StreamingError

There has been an unexpected error in the server or some other remote component.

Corresponds to ServiceConfused

There has been a network error related to the CM or the signalling part of the call (compare and contrast: Streaming_Error).

Corresponds to NetworkError

Some aspect of the content is unsupported so has to be removed from the call.

Corresponds to Media.UnsupportedType or Media.CodecsIncompatible

It was not possible for the streaming implementation to connect to any of the users participating in this call or content.

Corresponds to ConnectionFailed or ConnectionLost

A description of the reason for a change to the CallState and/or CallFlags.

The contact responsible for the change, or 0 if no contact was responsible. The reason, chosen from a limited set of possibilities defined by the Telepathy specification. If User_Requested then the Actor member will dictate whether it was the local user or a remote contact responsible.

A specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error.

This SHOULD be an empty string for changes to any state other than Ended.

The errors Cancelled and Terminated SHOULD NOT be used here; an empty string SHOULD be used instead.

Those error names are used to indicate normal call termination by the local user or another user, respectively, in contexts where a D-Bus error name must appear.

An optional debug message, to expediate debugging the potentially many processes involved in a call. This may be communicated across the network in protocols that support doing so, but it is not essential.

The reason for the last change to the CallState and/or CallFlags. The CallStateDetails MAY provide additional information.

Emitted when the state of the call as a whole changes.

This signal is emitted for any change in the properties corresponding to its arguments, even if the other properties referenced remain unchanged.

The new value of the CallState property. The new value of the CallFlags property. The new value of the CallStateReason property. The new value of the CallStateDetails property.

If this property is True, all of the media streaming is done by some mechanism outside the scope of Telepathy.

A connection manager might be intended for a specialized hardware device, which will take care of the audio streaming (e.g. telepathy-ring, which uses GSM hardware which does the actual audio streaming for the call).

If this is False, the handler is responsible for doing the actual media streaming for at least some contents itself. Those contents will have the Media interface, to communicate the necessary information to a streaming implementation. Connection managers SHOULD operate like this, if possible.

Many connection managers (such as telepathy-gabble) only do the call signalling, and expect the client to do the actual streaming using something like Farsight, to improve latency and allow better UI integration.

A set of flags representing the status of a remote contact in a call.

It is protocol- and client-specific whether a particular contact will ever have a particular flag set on them, and Telepathy clients SHOULD NOT assume that a flag will ever be set.

180 Ringing in SIP, and its equivalent in XMPP, are optional informational messages, and implementations are not required to send them. The same applies to the messages used to indicate hold state.

The remote contact's client has told us that the contact has been alerted about the call but has not responded.

This is a flag per member, not a flag for the call as a whole, because in Muji conference calls, you could invite someone and have their state be "ringing" for a while.

The call member has put this call on hold.

This is a flag per member, not a flag for the call as a whole, because in conference calls, any member could put the conference on hold.

This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact.
A mapping from handles to their current state in the call. Emitted when the CallMembers property changes in any way, either because contacts have been added to the call, contacts have been removed from the call, or contacts' flags have changed. A map from members of the call to their new call member flags, including at least the members who have been added to CallMembers, and the members whose flags have changed. The identifiers of the contacts in the Flags_Changed map. A list of members who have left the call, i.e. keys to be removed from CallMembers. A structured reason for the change.

A mapping from the remote contacts that are part of this call to flags describing their status. This mapping never has the local user's handle as a key.

When the call ends, this property should be an empty list, and notified with CallMembersChanged

If the Call implements Group and the Group members are channel-specific handles, then this call SHOULD also use channel-specific handles.

Anonymous members are exposed as channel-specific handles with no owner.

The string identifiers for handles mentioned in CallMembers, to give clients the minimal information necessary to create contacts without waiting for round-trips.

If set on a requested channel, this indicates the transport that should be used for this call. Where not applicable, this property is defined to be Unknown, in particular, on CMs with hardware streaming.

When implementing a voip gateway one wants the outgoing leg of the gatewayed to have the same transport as the incoming leg. This property allows the gateway to request a Call with the right transport from the CM.

If set to True in a channel request that will create a new channel, the connection manager should immediately attempt to establish an audio stream to the remote contact, making it unnecessary for the client to call AddContent.

If this property, or InitialVideo, is passed to EnsureChannel (as opposed to CreateChannel), the connection manager SHOULD ignore these properties when checking whether it can return an existing channel as suitable; these properties only become significant when the connection manager has decided to create a new channel.

If True on a requested channel, this indicates that the audio stream has already been requested and the client does not need to call RequestStreams, although it MAY still do so.

If True on an unrequested (incoming) channel, this indicates that the remote contact initially requested an audio stream; this does not imply that that audio stream is still active (as indicated by Contents).

The name of this new content can be decided by using the InitialAudioName property.

Connection managers that support the ContactCapabilities interface SHOULD represent the capabilities of receiving audio and/or video calls by including a channel class in a contact's capabilities with ChannelType = Call in the fixed properties dictionary, and InitialAudio and/or InitialVideo in the allowed properties list. Clients wishing to discover whether a particular contact is likely to be able to receive audio and/or video calls SHOULD use this information.

Not all clients support video calls, and it would also be possible (although unlikely) to have a client which could only stream video, not audio.

Clients that are willing to receive audio and/or video calls SHOULD include the following among their channel classes if calling UpdateCapabilities (clients of a ChannelDispatcher SHOULD instead arrange for the ChannelDispatcher to do this, by including the filters in their HandlerChannelFilter properties):

  • { ChannelType = Call }
  • { ChannelType = Call, InitialAudio = True } if receiving calls with audio is supported
  • { ChannelType = Call, InitialVideo = True } if receiving calls with video is supported

Connection managers for protocols with capability discovery, like XMPP, need this information to advertise the appropriate capabilities for their protocol.

The same as InitialAudio, but for a video stream. This property is immutable (cannot change).

In particular, note that if this property is False, this does not imply that an active video stream has not been added, only that no video stream was active at the time the channel appeared.

This property is the correct way to discover whether connection managers, contacts etc. support video calls; it appears in capabilities structures in the same way as InitialAudio.

If InitialAudio is set to True, then this property will name the intial audio content with the value of this property.

Content names are meant to be significant, but if no name can be given to initial audio content, then its name cannot be meaningful or even localized.

If this property is empty or missing from the channel request and InitialAudio is True, then the CM must come up with a sensible for the content, such as "audio".

If the protocol has no concept of stream names then this property will not show up in the allowed properties list of the Requestable Channel Classes for call channels.

The same as InitialAudioName, but for a video stream created by setting InitialVideo to True. This property is immutable and so cannot change.

If True, a stream of a different content type can be added after the Channel has been requested

If this property is missing, clients SHOULD assume that it is False, and thus that the channel's streams cannot be changed once the call has started.

If this property isn't present in the "allowed" set in any of the Call entries contact capabilities, then user interfaces MAY choose to show a separate "call" option for each class of call.

For example, once an audio-only Google Talk call has started, it is not possible to add a video stream; both audio and video must be requested at the start of the call if video is desired. User interfaces may use this pseudo-capability as a hint to display separate "Audio call" and "Video call" buttons, rather than a single "Call1" button with the option to add and remove video once the call has started for contacts without this flag.

This client supports audio calls.

This client supports video calls.

The client can implement streaming for streams whose Transport property is GTalk_P2P.

The client can implement streaming for streams whose Transport property is ICE.

The client can implement streaming for streams whose Transport property is WLM_2009.

The client can implement streaming for streams whose Transport property is SHM.

The client supports media streaming with H264 (etc.).

This handler capability token is a one of a family of similar tokens: for any other audio or video codec whose MIME type is audio/subtype or video/subtype, a handler capability token of this form may exist (the subtype MUST appear in lower case in this context). Clients MAY support more codecs than they explicitly advertise support for; clients SHOULD explicitly advertise support for their preferred codec(s), and for codecs like H264 that are, in practice, significant in codec negotiation.

For instance, the XMPP capability used by the Google Video Chat web client to determine whether a client is compatible with it requires support for H264 video, so an XMPP connection manager that supports this version of Jingle should not advertise the Google Video Chat capability unless there is at least one installed client that declares that it supports video/h264 on Call channels.

For example, a client could advertise support for audio and video calls using Speex, Theora and H264 by having five handler capability tokens in its Capabilities property:

  • org.freedesktop.Telepathy.Channel.Type.Call1/audio
  • org.freedesktop.Telepathy.Channel.Type.Call1/audio/speex
  • org.freedesktop.Telepathy.Channel.Type.Call1/video
  • org.freedesktop.Telepathy.Channel.Type.Call1/video/theora
  • org.freedesktop.Telepathy.Channel.Type.Call1/video/h264

Clients MAY have media signalling abilities without explicitly supporting any particular codec, and connection managers SHOULD support this usage.

This is necessary to support gatewaying between two Telepathy connections, in which case the available codecs might not be known to the gatewaying process.

telepathy-glib-0.24.2/spec/Channel_Type_Text.xml0000644000175000017500000006666412652510705016510 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The Messages interface is now mandatory This interface used to have a bunch of clunky Telepathy.Properties. They have been removed in favour of D-Bus properties on the Room2, Subject2 and RoomConfig1 interfaces. A unique-per-channel identifier for an incoming message. These SHOULD be allocated in a way that minimizes collisions (in particular, message IDs SHOULD NOT be re-used until all of the 32-bit integer space has already been used). New APIs should use an array of Message_Part instead. A struct (message ID, timestamp in seconds since 1970-01-01 00:00 UTC, sender's handle, message type, flags, text) representing a pending text message, as returned by ListPendingMessages. The arguments of the Received signal also match this struct's signature. The IDs of the messages to acknowledge Inform the channel that you have handled messages by displaying them to the user (or equivalent), so they can be removed from the pending queue. A given message ID was not found, so no action was taken Consulting MessageTypes is preferred. An array of integer message types (ChannelTextMessageType) Return an array indicating which types of message may be sent on this channel. Consulting PendingMessages is preferred. If true, behave as if AcknowledgePendingMessages had also been called. Setting this to true is NOT RECOMMENDED for clients that have some sort of persistent message storage - clients SHOULD only acknowledge messages after they have actually stored them, which is impossible if this flag is true. An array of structs representing the pending queue. Each contains:
  • a numeric identifier
  • a Unix timestamp indicating when the message was received
  • the contact handle for the contact who sent the message
  • the message type, taken from ChannelTextMessageType
  • the bitwise-OR of the message flags from ChannelTextMessageFlags
  • the text of the message
List the messages currently in the pending queue, and optionally remove then all.
In practice, this signal was not emitted, and does not have useful semantics. This signal is emitted to indicate that an incoming message was not able to be stored and forwarded by the connection manager due to lack of memory. The MessageReceived signal is more informative. A numeric identifier for acknowledging the message A Unix timestamp indicating when the message was received The handle of the contact who sent the message The type of the message (normal, action, notice, etc.) A bitwise OR of the message flags The text of the message Signals that a message with the given id, timestamp, sender, type and text has been received on this channel. Applications that catch this signal and reliably inform the user of the message should acknowledge that they have dealt with the message with the AcknowledgePendingMessages method. The SendMessage method is more flexible. An integer indicating the type of the message The message to send

Request that a message be sent on this channel. When the message has been submitted for delivery, this method will return and the Sent signal will be emitted. If the message cannot be submitted for delivery, the method returns an error and no signal is emitted.

This method SHOULD return before the Sent signal is emitted.

When a Text channel implements the Messages interface, that "SHOULD" becomes a "MUST".

An unknown error occurred The requested contact was offline The requested contact is not valid The user does not have permission to speak on this channel The outgoing message was too long and was rejected by the server The channel doesn't support sending text messages to the requested contact Delivery reporting is now provided by the Messages interface. The error that occurred The Unix timestamp indicating when the message was sent The message type The text of the message

Signals that an outgoing message has failed to send. The error will be one of the values from ChannelTextSendError.

This signal should only be emitted for messages for which Sent has already been emitted and Send has already returned success.

older spec versions claimed that SendError was emitted instead of Sent, rather than in addition to Sent. However, the 0.17.3+ semantics were what we'd always actually implemented.
The MessageSent signal is more informative. Unix timestamp indicating when the message was sent The message type (normal, action, notice, etc) from ChannelTextMessageType The text of the message. If the message was, or will be, altered during transmission, this argument SHOULD reflect what other contacts will receive rather than being a copy of the argument to Send.

Signals that a message has been submitted for sending.

The type of message. An ordinary chat message. Unknown types SHOULD be treated like this. An action which might be presented to the user as "* <sender> <action>", such as an IRC CTCP ACTION (typically selected by the "/me" command). For example, the text of the message might be "drinks more coffee". A one-off or automated message not necessarily expecting a reply An automatically-generated reply message. A delivery report. This message type MUST NOT appear unless the channel supports the Messages interface; see Message_Part for the format that delivery reports must take. The Messages interface has an extensible data structure including separate booleans for most of these flags. The incoming message was truncated to a shorter length by the server or the connection manager.

The incoming message contained non-text content which cannot be represented by this interface, but has been signalled in the Messages interface.

Connection managers SHOULD only set this flag if the non-text content appears to be relatively significant (exactly how significant is up to the implementor). The intention is that if this flag is set, clients using this interface SHOULD inform the user that part of the message was not understood.

The incoming message was part of a replay of message history.

In XMPP multi-user chat, a few past messages are replayed when you join a chatroom. A sufficiently capable IRC connection manager could also set this flag on historical messages when connected to a proxy like bip or irssi-proxy. The existence of this flag allows loggers and UIs to use better heuristics when eliminating duplicates (a simple implementation made possible by this flag would be to avoid logging scrollback at all).

The incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (the channel in which the message now appears) to open.

This means that a logger (which should already have seen the message in the previous channel) is able to recognise and ignore these replayed messages.

A channel type for sending and receiving messages. This channel type is primarily used for textual messages, but can also be used for formatted text, text with "attachments", or binary messages on some protocols.

Most of the methods and signals on this interface are deprecated, since they only support plain-text messages with limited metadata. See the mandatory Messages interface for the modern equivalents.

When a message is received, an identifier is assigned and a MessageReceived signal emitted, and the message is placed in a pending queue represented by the PendingMessages property. When the Handler for a channel has handled the message by showing it to the user (or equivalent), it should acknowledge the receipt of that message using the AcknowledgePendingMessages method, and the message will then be removed from the pending queue. Numeric identifiers for received messages may be reused over the lifetime of the channel.

Sending messages can be requested using the SendMessage method, which will return successfully when the message has been submitted for sending, or return an error with no signal emission if there is an immediate failure. If a message is submitted for sending but delivery of the message later fails, this is indicated by a delivery report, which is received in the same way as an incoming message.

Simple one-to-one chats (such as streams of private messages in XMPP or IRC) should be represented by a Text channel whose TargetHandleType is Contact. The expected way to request such a channel is to set the ChannelType, TargetHandleType, and either TargetHandle or TargetID in a call to EnsureChannel.

Named chat rooms whose identity can be saved and used again later (IRC channels, Jabber MUCs) are expected to be represented by Text channels with TargetHandleType = Room and the Group interface. In protocols where a chatroom can be used as a continuation of one or more one-to-one chats, these channels should also have the Conference interface.

Unnamed, transient chat rooms which cannot be rejoined by their unique identifier (e.g. a conversation on MSN which has, or once had, three or more participants) are expected to be represented by Text channels with TargetHandleType = None (and hence TargetHandle = 0), Group interface, and optionally the Conference interface.

On protocols like MSN where a conversation with a user is actually just a nameless chat room starting with exactly two members, to which more members can be invited, the initial one-to-one conversation SHOULD be represented with TargetHandleType = Contact. If a third participant joins or is invited, this SHOULD be represented by signalling a new Conference channel with the one-to-one channel in its InitialChannels, migrating the underlying protocol object from the one-to-one channel to the Conference channel, and creating a new protocol-level conversation if the one-to-one channel is re-used. See the Conference interface for more details.

This keeps the presentation of all one-to-one conversations uniform, and makes it easier to hand over a conversation from a 1-1-specific UI to a more elaborate multi-user UI; while it does require UIs to understand Conference to follow the upgrade, UIs that will deal with XMPP need to understand Conference anyway.

If a channel of type Text is closed while it has pending messages, the connection manager MUST allow this, but SHOULD open a new channel to deliver those messages, signalling it as a new channel with the NewChannels signal. The new channel should resemble the old channel, but have Requested = FALSE regardless of its previous value; the InitiatorHandle and InitiatorID should correspond to the sender of one of the pending messages.

In effect, this turns this situation, in which a client is likely to lose messages:

  • UI window is closed
  • message arrives
  • text channel emits Received
  • UI calls Close on text channel before it has seen the Received signal
  • text channel emits Closed and closes

into something nearly equivalent to this situation, which is fine:

  • UI window is closed
  • UI calls Close on text channel
  • text channel emits Closed and closes
  • message arrives
  • new text channel is created, connection emits NewChannels
  • (the same or a different) UI handles it

Requested must be set to FALSE so the replacement channel will be handled by something.

In practice, connection managers usually implement this by keeping the same internal object that represented the old channel, adjusting its properties, signalling that it was closed, then immediately re-signalling it as a new channel.

As a result, Text channels SHOULD implement Channel.Interface.Destroyable.

This "respawning" behaviour becomes problematic if there is no suitable handler for Text channels, or if a particular message repeatedly crashes the Text channel handler; a channel dispatcher can't just Close() the channel in these situations, because it will come back.

In these situations, the channel dispatcher needs a last-resort way to destroy the channel and stop it respawning. It could either acknowledge the messages itself, or use the Destroyable interface; the Destroyable interface has the advantage that it's not channel-type-dependent, so the channel dispatcher only has to understand one extra interface, however many channel types eventually need a distinction between Close and Destroy.

Opaquely-named rejoinable chatrooms (such as Skype rooms) are represented using the properties in the Room2 interface. Instructions and examples of how to request such channels are given in said interface's description.

telepathy-glib-0.24.2/spec/Connection_Interface_Service_Point.xml0000644000175000017500000001300112652510705022014 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for connections whose channels may be able to indicate specific they are connected to some form of service station. For example, when dialing 9-1-1 in the US, a GSM modem/network will recognize that as an emergency call, and inform higher levels of the stack that the call is being handled by an emergency service. In this example, the call is handled by a Public Safety Answering Point (PSAP) which is labeled as "urn:service:sos". Other networks and protocols may handle this differently while still using this interface.

The service point. A list of IDs that are mapped to this service. This is provided as a convenience for the UIs, but the preferred method for requesting channel to a service is by setting the InitialServicePoint property in a channel request.

Description of a service point and IDs which are mapped to it.

An example Service Point info for GSM emergency calls (callable through "911" and "112") could look like:

  ServicePointInfo = (
    Service_Point: (
      Service_Point_Type: 1 (Emergency),
      Service_Point: "urn:service:sos"
    ),
    Service_IDs: [ "911", "112" ]
  )
The list of all (known) service points.

The new value of KnownServicePoints.

Emitted when the list of known service points (or their IDs) has changed.
A service point. The service type. String representation of the service point. The representation is service specific; it may be a 'service' Uniform Resource Name as specified by RFC 5031, or may be in some other form. Empty, unused or unknown value is represented by "". The various types of service points a channel might connect to. The channel is not communicating with a service point, or it is not known whether it is communicating with a service point (e.g. an ordinary call). The service point is a generic emergency point. The service point is some kind of counseling service (ie, mental health or child-services counseling).
telepathy-glib-0.24.2/spec/Connection_Future.xml0000644000175000017500000001241712652510705016547 00000000000000 Copyright © 2009 Collabora Limited Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a draft) The "primary" interface implemented by an object attached to a connection. For example, a Gabble plugin implementing fine-grained control of XEP-0016 privacy lists might expose an object implementing com.example.PrivacyLists. The object path of the sidecar, exported by the same bus name as the Connection to which it is attached. Immutable properties of the sidecar.

Request an object with a particular interface providing additional connection-specific functionality, together with its immutable properties. These will often be implemented by plug-ins to the connection managers; for example, support for an XMPP XEP for which no generic Telepathy interface exists might be implemented by a Gabble plugin exposing a sidecar with a particular interface.

This method may be called at any point during the lifetime of a connection, even before its Connection_Status changes to Connected. It MAY take a long time to return—perhaps it needs to wait for a connection to be established and for all the services supported by the server to be discovered before determining whether necessary server-side support is available—so callers SHOULD override the default method timeout (25 seconds) with a much higher value (perhaps even MAX_INT32, meaning “no timeout” in recent versions of libdbus).

There is an implicit assumption that any connection manager plugin will only want to export one “primary” object per feature it implements, since there is a one-to-one mapping between interface and object. This is reasonable since Sidecars are (intended to be) analogous to extra interfaces on the connection, providing once-per-connection shared functionality; it also makes client code straightforward (look up the interface you care about in a dictionary, build a proxy object from the value). More “plural” plugins are likely to want to implement new types of Channel instead.

The requested sidecar is not implemented by this connection manager, or a necessary server-side component does not exist. (FIXME: split these two errors out? Then again, once we list the guaranteed and possible sidecars on a Protocol object, clients can tell the difference themselves, because they shouldn't be calling this in the first case.) A server-side component needed by the requested sidecar reported it is currently too busy, or did not respond for some implementation-defined time. The caller may wish to try again later. The connection was disconnected while the sidecar was being set up.
telepathy-glib-0.24.2/spec/Account_Interface_External_Password_Storage.xml0000644000175000017500000000500712652510705023677 00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for Accounts whose passwords are stored externally and SHOULD NOT be stored by either the AccountManager nor any ServerAuthentication handler.

This interface SHOULD only appear on accounts for which the related Connection Manager implements ConnectionManager.Interface.AccountStorage.DRAFT.

Clears any saved password associated with this account.

Indicates whether the account has a saved password or not.

Change notification for this property is provided by the standard D-Bus PropertiesChanged signal.

telepathy-glib-0.24.2/spec/Account_Manager.xml0000644000175000017500000003057412652510705016150 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The account manager is a central service used to store account details.

The current account manager is defined to be the process that owns the well-known bus name org.freedesktop.Telepathy.AccountManager on the session bus. This process must export an /org/freedesktop/Telepathy/AccountManager object with the AccountManager interface.

A list of the interfaces provided by the account manager object. A list of the valid (complete, usable) Accounts. Change notification is via AccountValidityChanged. This split between valid and invalid accounts makes it easy to ignore the invalid ones. The only things that should be manipulating invalid accounts are account-editing UIs, which might be able to rescue them. A list of incomplete or otherwise unusable Accounts. Change notification is via AccountValidityChanged. The given account has been removed. This is effectively change notification for the valid and invalid accounts lists. On emission of this signal, the Account indicated will no longer be present in either of the lists. An Account, which must not be used any more. The validity of the given account has changed. New accounts are also indicated by this signal, as an account validity change (usually to True) on an account that did not previously exist. This is effectively change notification for the valid and invalid accounts lists. An Account. True if the account is now valid.

A list of the fully qualified names of properties that can be set via the Properties argument to CreateAccount when an account is created.

Examples of good properties to support here include Icon, Enabled, Nickname, AutomaticPresence, ConnectAutomatically, Supersedes, RequestedPresence and Avatar.

Examples of properties that would make no sense here include Valid, Connection, ConnectionStatus, ConnectionStatusReason, CurrentPresence and NormalizedName.

This property MUST NOT include include the DisplayName and Parameters properties, which are set using separate arguments.

This property MAY include the names of properties that, after account creation, will be read-only: this indicates that the property can be set at account creation but not changed later.

For example, an account manager might support migration tools that use this to preserve the HasBeenOnline property, even though that property is usually read-only.

Request the creation of a new Account. The account manager SHOULD NOT allow invalid accounts to be created. added the Properties argument The name of the connection manager, e.g. "salut". The protocol, e.g. "local-xmpp". The initial value of the new account's DisplayName property. The account manager SHOULD modify this to make it unique if an Account already exists with the same display name, for instance by appending a number or the 'account' parameter. Account manager implementations SHOULD accept an empty string, but account editing user interfaces should avoid passing an empty string for this parameter.

The account creation UI may ask the user for a name for the new account. If the author of the UI chooses not to do this, the account creation UI is better able to suggest a default display name because it has protocol-specific knowledge which the account manager does not.

The account manager always knows the complete list of accounts so it can easily tell whether it should append something to the display name to avoid presenting two identically-named accounts to the user.

Initial parameter values, as would be passed to RequestConnection.

The values of any other properties to be set immediately on the new Account.

Only the properties mentioned in SupportedAccountProperties are acceptable here. In particular, the DisplayName and Parameters properties are never allowed here, since they are set using the other arguments to this method.

Account manager implementations SHOULD support creating accounts with an empty value for this argument.

The new Account.

The Connection_Manager is not installed or does not implement the given Protocol.

The Parameters provided were unacceptable: they might omit a Required parameter, include an unsupported parameter, or have a value of the wrong type.

telepathy-glib-0.24.2/spec/Channel.xml0000644000175000017500000006454312652510705014475 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The channel's type. This cannot change once the channel has been created.

For compatibility between older connection managers and newer clients, if this is unavailable or is an empty string, clients MUST use the result of calling GetChannelType.

The GetAll method lets clients retrieve all properties in one round-trip, which is desirable.

When requesting a channel, the request MUST specify a channel type, and the request MUST fail if the specified channel type cannot be supplied.

Common sense.

Extra interfaces provided by this channel. This SHOULD NOT include the channel type and the Channel interface itself, and cannot change once the channel has been created.

For compatibility between older connection managers and newer clients, if this is unavailable, or if this is an empty list and ChannelType is an empty string, clients MUST use the result of calling GetInterfaces instead. If this is an empty list but ChannelType is non-empty, clients SHOULD NOT call GetInterfaces; this implies that connection managers that implement the ChannelType property MUST also implement the Interfaces property correctly.

The GetAll method lets clients retrieve all properties in one round-trip, which is desirable.

When requesting a channel with a particular value for this property, the request must fail without side-effects unless the connection manager expects to be able to provide a channel whose interfaces include at least the interfaces requested.

The handle (a representation for the identifier) of the contact, chatroom, etc. with which this handle communicates. Its type is given by the TargetHandleType property.

This is fixed for the lifetime of the channel, so channels which could potentially be used to communicate with multiple contacts, and do not have an identity of their own (such as a Handle_Type_Room handle), must have TargetHandleType set to Handle_Type_None and TargetHandle set to 0.

Unlike in the telepathy-spec 0.16 API, there is no particular uniqueness guarantee - there can be many channels with the same (channel type, handle type, handle) tuple. This is necessary to support conversation threads in XMPP and SIP, for example.

If this is present in a channel request, it must be nonzero, TargetHandleType MUST be present and not Handle_Type_None, and TargetID MUST NOT be present. Properties from Addressing1 MUST NOT be present.

The channel that satisfies the request MUST either:

  • have the specified TargetHandle property; or
  • have TargetHandleType = Handle_Type_None, TargetHandle = 0, and be configured such that it could communicate with the specified handle in some other way (e.g. have the requested contact handle in its Group interface)

The string that would result from inspecting the TargetHandle property (i.e. the identifier in the IM protocol of the contact, room, etc. with which this channel communicates), or the empty string if the TargetHandle is 0.

The presence of this property avoids the following race condition:

  • New channel C is signalled with target handle T
  • Client calls InspectHandles(CONTACT, [T])
  • Channel C closes, removing the last reference to handle T
  • InspectHandles(CONTACT, [T]) returns an error

If this is present in a channel request, TargetHandleType MUST be present and not Handle_Type_None, and TargetHandle MUST NOT be present. Properties from Addressing1 MUST NOT be present.The request MUST fail with error InvalidHandle, without side-effects, if the requested TargetID would not be accepted by RequestHandles.

The returned channel must be related to the handle corresponding to the given identifier, in the same way as if TargetHandle had been part of the request instead.

Requesting channels with a string identifier saves a round-trip (the call to RequestHandles). It also allows the channel dispatcher to accept a channel request for an account that is not yet connected (and thus has no valid handles), bring the account online, and pass on the same parameters to the new connection's CreateChannel method.

The type of TargetHandle.

If this is omitted from a channel request, connection managers SHOULD treat this as equivalent to Handle_Type_None.

If this is omitted or is Handle_Type_None, TargetHandle and TargetID MUST be omitted from the request.

Request that the channel be closed. This is not the case until the Closed signal has been emitted, and depending on the connection manager this may simply remove you from the channel on the server, rather than causing it to stop existing entirely. Some channels such as contact list channels may not be closed. This channel may never be closed, e.g. a contact list This channel is not currently in a state where it can be closed, e.g. a non-empty user-defined contact group Emitted when the channel has been closed. Method calls on the channel are no longer valid after this signal has been emitted, and the connection manager may then remove the object from the bus at any point. Use the ChannelType property if possible. The interface name Returns the interface name for the type of this channel. Clients SHOULD use the ChannelType property instead, falling back to this method only if necessary. The GetAll method lets clients retrieve all properties in one round-trip. Use the TargetHandleType and TargetHandle properties if possible. The same as TargetHandleType. The same as TargetHandle. Returns the handle type and number if this channel represents a communication with a particular contact, room or server-stored list, or zero if it is transient and defined only by its contents. Clients SHOULD use the TargetHandle and TargetHandleType properties instead, falling back to this method only if necessary. The GetAll method lets clients retrieve all properties in one round-trip. Use the Interfaces property if possible. An array of the D-Bus interface names Get the optional interfaces implemented by the channel. Clients SHOULD use the Interfaces property instead, falling back to this method only if necessary. The GetAll method lets clients retrieve all properties in one round-trip. (as stable API)

True if this channel was created in response to a local request, such as a call to Connection.RequestChannel or Connection.Interface.Requests.CreateChannel.

The idea of this property is to distinguish between "incoming" and "outgoing" channels, in a way that doesn't break down when considering special cases like contact lists that are automatically created on connection to the server, or chatrooms that an IRC proxy/bouncer like irssi-proxy or bip was already in.

The reason we want to make that distinction is that UIs for things that the user explicitly requested should start up automatically, whereas for incoming messages and VoIP calls we should first ask the user whether they want to open the messaging UI or accept the call.

If the channel was not explicitly requested (even if it was created as a side-effect of a call to one of those functions, e.g. because joining a Tube in a MUC context on XMPP implies joining that MUC), then this property is false.

For compatibility with older connection managers, clients SHOULD assume that this property is true if they see a channel announced by the Connection.NewChannel signal with the suppress_handler parameter set to true.

In a correct connection manager, the only way to get such a channel is to request it.

Clients MAY additionally assume that this property is false if they see a channel announced by the NewChannel signal with the suppress_handler parameter set to false.

This is more controversial, since it's possible to get that parameter set to false by requesting a channel. However, there's no good reason to do so, and we've deprecated this practice.

In the particular case of the channel dispatcher, the only side-effect of wrongly thinking a channel is unrequested is likely to be that the user has to confirm that they want to use it, so it seems fairly harmless to assume in the channel dispatcher that channels with suppress_handler false are indeed unrequested.

It does not make sense for this property to be in channel requests—it will always be true for channels returned by CreateChannel, and callers of EnsureChannel cannot control whether an existing channel was originally requested locally—so it MUST NOT be accepted.

(as stable API)

The contact who initiated the channel; for instance, the contact who invited the local user to a chatroom, or the contact who initiated a call.

This does not necessarily represent the contact who created the underlying protocol-level construct. For instance, if Rob creates a chatroom, Will joins that chatroom, and Will invites Simon to join it, then Simon will see Will as the InitiatorHandle of the channel representing the chatroom.

The room creator is generally a less useful piece of information than the inviter, is less likely to be available at invitation time (i.e. can't necessarily be an immutable property), and is less likely to be available at all. The creator of a chatroom is not currently available via Telepathy; if added in future, it is likely to be made available as a property on the Chatroom interface (bug 23151).

For channels requested by the local user, this MUST be the value of Connection.SelfHandle at the time the channel was created (i.e. not a channel-specific handle).

On some protocols, the SelfHandle may change (as signalled by Connection.SelfContactChanged), but this property is immutable. Hence, locally-requested channels' InitiatorHandle and InitiatorID may not match the current SelfHandle; Requested can be used to determine whether the channel was created locally.

For channels requested by a remote user, this MUST be their handle. If unavailable or not applicable, this MUST be 0 (for instance, contact lists are not really initiated by anyone in particular, and it's easy to imagine a protocol where chatroom invitations can be anonymous).

For channels with the Group interface, this SHOULD be the same contact who is signalled as the "Actor" causing the self-handle to be placed in the local-pending set.

This SHOULD NOT be a channel-specific handle, if possible.

It does not make sense for this property to be in channel requests - the initiator will always be the local user - so it MUST NOT be accepted.

(as stable API)

The string that would result from inspecting the InitiatorHandle property (i.e. the initiator's identifier in the IM protocol).

The presence of this property avoids the following race condition:

  • New StreamedMedia channel C is signalled with initiator handle I
  • Client calls InspectHandles(CONTACT, [I])
  • Channel C closes, removing the last reference to handle I
  • InspectHandles(CONTACT, [I]) returns an error
  • Client can indicate that a call was missed, but not who called!

It does not make sense for this property to be in channel requests - the initiator will always be the local user - so it MUST NOT be accepted.

All communication in the Telepathy framework is carried out via channel objects which are created and managed by connections. This interface must be implemented by all channel objects, along with one single channel type, such as Channel.Type.ContactList which represents a list of people (such as a buddy list) or Channel.Type.Text which represents a channel over which textual messages are sent and received.

Each Channel's object path MUST start with the object path of its associated Connection, followed by '/'. There MAY be any number of additional object-path components, which clients MUST NOT attempt to parse.

This ensures that Channel object paths are unique, even between Connections and CMs, because Connection object paths are guaranteed-unique via their link to the well-known bus name.

If all connection managers in use are known to comply with at least spec version 0.17.10, then the Connection's object path can even be determined from the Channel's without any additional information, by taking the first 7 components.

Each channel has a number of immutable properties (which cannot vary after the channel has been announced with NewChannels), provided to clients in the ObserveChannels, AddDispatchOperation and HandleChannels methods to permit immediate identification of the channel. This interface contains immutable properties common to all channels. In brief:

  • ChannelType specifies the kind of communication carried out on this channel;
  • TargetHandleType, TargetHandle and TargetID specify the entity with which this channel communicates, such as the other party in a 1-1 call, or the name of a multi-user chat room;
  • InitiatorHandle and InitiatorID specify who created this channel;
  • Requested indicates whether the local user requested this channel, or whether it is an incoming call, a text conversation started by a remote contact, a chatroom invitation, etc.

Other optional Interfaces can be implemented to indicate other available functionality, such as Channel.Interface.Group if the channel contains a number of contacts, Channel.Interface.Password to indicate that a channel may have a password set to require entry, and Channel.Interface.ChatState for typing notifications. The interfaces implemented may not vary after the channel has been created. These other interfaces (along with the interface named by ChannelType) may themselves specify immutable properties to be announced up-front along with the properties on this interface.

Some channels are “anonymous”, with TargetHandleType set to None, which indicates that the channel is defined by some other properties. For instance, transient ad-hoc chat rooms may be defined only by their members (as visible through the Group interface), and ContactSearch channels represent a single search attempt for a particular Server.

Specific connection manager implementations may implement channel types and interfaces which are not contained within this specification in order to support further functionality. To aid interoperability between client and connection manager implementations, the interfaces specified here should be used wherever applicable, and new interfaces made protocol-independent wherever possible. Because of the potential for 3rd party interfaces adding methods or signals with conflicting names, the D-Bus interface names should always be used to invoke methods and bind signals.

Previously we guaranteed that, for any handle type other than Handle_Type_None, and for any channel type and any handle, there would be no more than one channel with that combination of channel type, handle type and handle. This guarantee has now been removed in order to accommodate features like message threads. Previously we did not explicitly guarantee that Channels' object paths had the Connection's object path as a prefix.
telepathy-glib-0.24.2/spec/Client_Interface_Requests.xml0000644000175000017500000001711312652510705020205 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

This interface can be implemented by a Handler to be notified about requests for channels that it is likely to be asked to handle.

Called by the ChannelDispatcher to indicate that channels have been requested, and that if the request is successful, they will probably be handled by this Handler. The ChannelDispatcher SHOULD only call this method on one handler per request.

This allows the UI to start preparing to handle the channels in advance (e.g. render a window with an "in progress" message), improving perceived responsiveness.

The use of "probably" is because you can't necessarily tell from a channel request which handler will handle particular channels. A reasonable heuristic would be to match the request against the HandlerChannelFilter, and respect the preferred handler (if any).

If the request succeeds and is given to the expected Handler, the Requests_Satisfied parameter to HandleChannels can be used to match the channel to a previous AddRequest call.

This lets the UI direct the channels to the window that it already opened.

If the request fails, the expected handler is notified by the channel dispatcher calling its RemoveRequest method.

This lets the UI close the window or display the error.

The channel dispatcher SHOULD remember which handler was notified, and if the channel request succeeds, it SHOULD dispatch the channels to the expected handler, unless the channels do not match that handler's HandlerChannelFilter. If the channels are not dispatched to the expected handler, the handler that was expected is notified by the channel dispatcher calling its RemoveRequest method with the NotYours error.

Expected handling is for the UI to close the window it previously opened.

Handlers SHOULD NOT return an error from this method; errors returned from this method SHOULD NOT alter the channel dispatcher's behaviour.

Calls to this method are merely a notification.

The ChannelRequest object, which MUST have been returned by CreateChannel or EnsureChannel before this method is called. See those methods for the rationale of this ordering.

Some of the properties of the ChannelRequest. To avoid race conditions, this dictionary MUST NOT include properties whose values could subsequently change. It SHOULD include as many properties as possible, given that constraint.

In particular, the properties Requests, UserActionTime and Account MUST be included, and Hints MUST be included if implemented.

Called by the ChannelDispatcher to indicate that a request previously passed to AddRequest has failed and should be disregarded.

Handlers SHOULD NOT return an error from this method; errors returned from this method SHOULD NOT alter the channel dispatcher's behaviour.

Calls to this method are merely a notification.

The request that failed.

The name of the D-Bus error with which the request failed.

If this is org.freedesktop.Telepathy.Error.NotYours, this indicates that the request succeeded, but all the resulting channels were given to some other handler.

Any message supplied with the D-Bus error.
telepathy-glib-0.24.2/spec/Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml0000644000175000017500000000576512652510705027331 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

This media description interface provides a method of signalling support for RTP Header Extensions, documented by A General Mechanism for RTP Header Extensions (RFC 5285).

For more details on the General Mechanism for RTP Header Extensions and how to use them, one should refer to RFC 5285.

A struct defining a RTP Header extension. Identifier to be negotiated. Direction in which the Header Extension is negotiated. URI defining the extension. Feedback parameters as a string. Format is defined in the relevant RFC. A list of remote header extensions which are supported.
telepathy-glib-0.24.2/spec/Channel_Interface_Group.xml0000644000175000017500000016066512652510705017633 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A structure representing a contact whose attempt to join a group is to be confirmed by the local user using AddMembers. The contact to be added to the group The contact requesting or causing the change The reason for the change A human-readable message from the Actor, or an empty string if there is no message An array of contact handles to invite to the channel A string message, which can be blank if desired

Invite all the given contacts into the channel, or accept requests for channel membership for contacts on the pending local list.

A message may be provided along with the request, which will be sent to the server if supported. See the CHANNEL_GROUP_FLAG_MESSAGE_ADD and CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT GroupFlags to see in which cases this message should be provided.

Attempting to add contacts who are already members is allowed; connection managers must silently accept this, without error.

Use GetAll on the D-Bus Properties D-Bus interface to get properties including Members, RemotePendingMembers and LocalPendingMembers instead, falling back to this method and GetLocalPendingMembersWithInfo if necessary. array of handles of current members array of handles of local pending members array of handles of remote pending members Returns arrays of all current, local and remote pending channel members. The AddMembers method can be used to add or invite members who are not already in the local pending list (which is always valid). The RemoveMembers method can be used to remove channel members (removing those on the pending local list is always valid). The RemoveMembers method can be used on people on the remote pending list. A message may be sent to the server when calling AddMembers on contacts who are not currently pending members. A message may be sent to the server when calling RemoveMembers on contacts who are currently channel members. A message may be sent to the server when calling AddMembers on contacts who are locally pending. A message may be sent to the server when calling RemoveMembers on contacts who are locally pending. A message may be sent to the server when calling RemoveMembers on contacts who are remote pending.

The members of this group have handles which are specific to this channel, and are not valid as general-purpose handles on the connection. Depending on the channel, it may be possible to check the HandleOwners property or call GetHandleOwners to find the owners of these handles, which should be done if you wish to (e.g.) subscribe to the contact's presence.

Connection managers must ensure that any given handle is not simultaneously a general-purpose handle and a channel-specific handle.

Placing a contact in multiple groups of this type is not allowed and will raise NotAvailable (on services where contacts may only be in one user-defined group, user-defined groups will have this flag). In rooms with channel specific handles (ie Channel_Specific_Handles flag is set), this flag indicates that no handle owners are available, apart from the owner of the SelfHandle. This used to be an important optimization to avoid repeated GetHandleOwners calls, before we introduced the HandleOwners property and HandleOwnersChanged signal. This flag indicates that all the properties introduced in specification 0.17.6 are fully supported. Indicates that MembersChangedDetailed will be emitted for changes to this group's members in addition to MembersChanged. Clients can then connect to the former and ignore emission of the latter. This flag's state MUST NOT change over the lifetime of a channel. If it were allowed to change, client bindings would have to always connect to MembersChanged just in case the flag ever went away (and generally be unnecessarily complicated), which would mostly negate the point of having this flag in the first place. A message may be sent to the server when calling RemoveMembers on the SelfHandle. This would be set for XMPP Multi-User Chat or IRC channels, but not for a typical implementation of streamed media calls.
An integer representing the bitwise-OR of flags on this channel. The user interface can use this to present information about which operations are currently valid. Change notification is via the GroupFlagsChanged signal. For backwards compatibility, clients should fall back to calling GetGroupFlags if Channel_Group_Flag_Properties is not present. The value of the GroupFlags property Returns the value of the GroupFlags property. Use GetAll on the D-Bus Properties D-Bus interface to get properties including GroupFlags instead, falling back to this method if necessary. A map from channel-specific handles to their owners. For backwards compatibility, clients should fall back to calling GetHandleOwners if Channel_Group_Flag_Properties is not present. A nonzero channel-specific handle The global handle that owns the corresponding channel-specific handle, or 0 if this could not be determined A map from channel-specific handles to their owners, including at least all of the channel-specific handles in this channel's members, local-pending or remote-pending sets as keys. Any handle not in the keys of this mapping is not channel-specific in this channel. Handles which are channel-specific, but for which the owner is unknown, MUST appear in this mapping with 0 as owner. Change notification is via the HandleOwnersChanged signal. Emitted whenever the HandleOwners property changes. This signal should not be relied on unless Channel_Group_Flag_Properties is present. Clients should listen to HandleOwnersChangedDetailed instead to get the new identifiers as well. A map from channel-specific handles to their owners, in which the keys include all the handles that were added to the keys of the HandleOwners property, and all the handles in that property whose owner has changed The channel-specific handles that were removed from the keys of the HandleOwners property, as a result of the contact leaving this group in a previous MembersChanged signal

Emitted whenever the HandleOwners property changes.

Clients can assume this signal is emitted by the Connection Manager if the MemberIdentifiers property exists

A map from channel-specific handles to their owners, in which the keys include all the handles that were added to the keys of the HandleOwners property, and all the handles in that property whose owner has changed The channel-specific handles that were removed from the keys of the HandleOwners property, as a result of the contact leaving this group in a previous MembersChanged signal The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to create contacts without waiting for round-trips. Connection managers MUST include at least the identifiers for all handles in the Added map, and MAY include those from Removed array.
A list of integer handles representing members of the channel An array of integer handles representing the owner handles of the given room members, in the same order, or 0 if the owner is not available If the CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES flag is set on the channel, then the handles of the group members are specific to this channel, and are not meaningful in a connection-wide context such as contact lists. This method allows you to find the owner of the handle if it can be discovered in this channel, or 0 if the owner is not available. Clients should use the HandleOwners property and HandleOwnersChanged signal if Channel_Group_Flag_Properties is present. This channel doesn't have the CHANNEL_SPECIFIC_HANDLES flag, so handles in this channel are globally meaningful and calling this method is not necessary One of the given handles is not a member Returns the To_Be_Added handle (only) for each structure in the LocalPendingMembers property. Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present. Returns the LocalPendingMembers property. Use the LocalPendingMembers property, if Channel_Group_Flag_Properties is present. An array of structs containing:
  • A handle representing the contact requesting channel membership
  • A handle representing the contact making the request, or 0 if unknown
  • The reason for the request: one of the values of Channel_Group_Change_Reason
  • A string message containing the reason for the request if any (or blank if none)
An array of structs containing handles representing contacts requesting channel membership and awaiting local approval with AddMembers. If Channel_Group_Flag_Properties is not present, clients should fall back to using the deprecated GetLocalPendingMembersWithInfo method, or fall back from that to the deprecated GetAllMembers method. The members of this channel. If Channel_Group_Flag_Properties is not set, fall back to calling GetAllMembers. Returns the Members property. Use the Members property, if Channel_Group_Flag_Properties is present. An array of handles representing contacts who have been invited to the channel and are awaiting remote approval. If Channel_Group_Flag_Properties is not set, fall back to calling GetAllMembers. Returns an array of handles representing contacts who have been invited to the channel and are awaiting remote approval. Use the RemotePendingMembers property, if Channel_Group_Flag_Properties is present. Emitted whenever the SelfHandle property changes. This signal should not be relied on unless Channel_Group_Flag_Properties is present. Clients should listen to SelfContactChanged instead to get the new identifier as well. The new value of the SelfHandle property.

Emitted whenever the SelfHandle property changes.

Clients can assume this signal is emitted by the Connection Manager if the MemberIdentifiers property exists.

The new value of the SelfHandle property. The new value of the SelfHandle property's identifier.
The handle for the user on this channel (which can also be a local or remote pending member), or 0 if the user is not a member at all (which is likely to be the case, for instance, on ContactList channels). Note that this is different from the result of Connection.GetSelfHandle on some protocols, so the value of this handle should always be used with the methods of this interface. For backwards compatibility, clients should fall back to calling GetSelfHandle if Channel_Group_Flag_Properties is not present. The string identifiers for handles mentioned in this channel, to give clients the minimal information necessary to create contacts without waiting for round-trips. Connection managers MUST include at least the identifiers for SelfHandle, Members, LocalPendingMembers (and their actors if any), RemotePendingMembers and HandleOwners. Returns the value of the SelfHandle property. Clients should retrieve the SelfHandle property using GetAll instead, if Channel_Group_Flag_Properties is present. A bitwise OR of the flags which have been set A bitwise OR of the flags which have been cleared Emitted when the flags as returned by GetGroupFlags are changed. The user interface should be updated as appropriate.

The reason for a set of handles to move to one of Members, LocalPendingMembers or RemotePendingMembers, or to be removed from the group. A client may supply a reason when attempting to remove members from a group with RemoveMembersWithReason, and reasons are supplied by the CM when emitting MembersChanged and MembersChangedDetailed. Some reason codes have different meanings depending on the Actor in a MembersChanged signal.

No reason was provided for this change.

In particular, this reason SHOULD be used when representing users joining a named chatroom in the usual way, users leaving a chatroom by their own request, and normal termination of a StreamedMedia call by the remote user.

If the SelfHandle is removed from a group for this reason and the actor is not the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Terminated.

If the SelfHandle is removed from a group for this reason and the actor is also the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled.

The change is due to a user going offline. Also used when user is already offline, but this wasn't known previously.

If a one-to-one StreamedMedia call fails because the contact being called is offline, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Offline.

For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

If a handle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Offline.

The change is due to a kick operation.

If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Kicked.

The change is due to a busy indication.

If a one-to-one StreamedMedia call fails because the contact being called is busy, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Busy.

For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Busy.

The change is due to an invitation. This reason SHOULD only be used when contacts are added to the remote-pending set (to indicate that the contact has been invited) or to the members (to indicate that the contact has accepted the invitation). Otherwise, what would it mean?

The change is due to a kick+ban operation.

If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Banned.

The change is due to an error occurring.

The change is because the requested contact does not exist.

For instance, if the user invites a nonexistent contact to a chatroom or attempts to call a nonexistent contact, this could be indicated by the CM adding that contact's handle to remote-pending for reason None or Invited, then removing it for reason Invalid_Contact. In the case of a 1-1 StreamedMedia call, the CM SHOULD remove the self handle from the Group in the same signal.

For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason.

If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.DoesNotExist.

The change is because the requested contact did not respond.

If a one-to-one StreamedMedia call fails because the contact being called did not respond, or the local user did not respond to an incoming call, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason No_Answer.

Documenting existing practice.

If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.NoAnswer.

The change is because a contact's unique identifier changed. There must be exactly one handle in the removed set and exactly one handle in one of the added sets. The Renamed signal on the Renaming interface will have been emitted for the same handles, shortly before this MembersChanged signal is emitted.

The change is because there was no permission to contact the requested handle.

If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.PermissionDenied.

If members are removed with this reason code, the change is because the group has split into unconnected parts which can only communicate within themselves (e.g. netsplits on IRC use this reason code).

If members are added with this reason code, the change is because unconnected parts of the group have rejoined. If this channel carries messages (e.g. Text or Tubes channels) applications must assume that the contacts being added are likely to have missed some messages as a result of the separation, and that the contacts in the group are likely to have missed some messages from the contacts being added.

Note that from the added contacts' perspective, they have been in the group all along, and the contacts we indicate to be in the group (including the local user) have just rejoined the group with reason Separated. Application protocols in Tubes should be prepared to cope with this situation.

The SelfHandle SHOULD NOT be removed from channels with this reason.

A string message from the server, or blank if not A list of members added to the channel A list of members removed from the channel A list of members who are pending local approval A list of members who are pending remote approval The contact handle of the person who made the change, or 0 if not known A reason for the change

Emitted when contacts join any of the three lists (members, local pending or remote pending) or when they leave any of the three lists. There may also be a message from the server regarding this change, which may be displayed to the user if desired.

All channel-specific handles that are mentioned in this signal MUST be represented in the value of the HandleOwners property. In practice, this will mean that HandleOwnersChanged is emitted before emitting a MembersChanged signal in which channel-specific handles are added, but that it is emitted after emitting a MembersChanged signal in which channel-specific handles are removed.

See StreamedMedia for an overview of how group state changes are used to indicate the progress of a call.

A map from handles to the corresponding normalized string identifier. A nonzero handle The same string that would be returned by InspectHandles for this handle. A list of members added to the channel A list of members removed from the channel A list of members who are pending local approval A list of members who are pending remote approval

Information about the change, which may include the following well-known keys:

actor (u — Contact_Handle)
The contact handle of the person who made the change; 0 or omitted if unknown or not applicable.
change-reason (u — Channel_Group_Change_Reason)
A reason for the change.
contact-ids (a{us} — Handle_Identifier_Map)

The string identifiers for handles mentioned in this signal, to give clients the minimal information necessary to react to the event without waiting for round-trips. Connection managers SHOULD include the identifiers for members added to the group and for the actor (if any); they MAY omit the identifiers for handles which have been removed from the group.

On IRC, an event such as a netsplit could cause the vast majority of a channel to leave. Given that clients should already know the identifiers of a channel's members, including potentially hundreds of strings in the netsplit signal is unnecessary.

Clients MUST NOT assume that the presence or absence of a handle in this mapping is meaningful. This mapping is merely an optimization for round-trip reduction, and connection managers MAY add additional handles, omit some handles, or omit the mapping completely.

message (s)
A string message from the server regarding the change
error (s — DBus_Error_Name)
A (possibly implementation-specific) DBus error describing the change, providing more specific information than the Channel_Group_Change_Reason enum allows. This MUST only be present if it is strictly more informative than 'change-reason'; if present, 'change-reason' MUST be set to the closest available reason. A SIP connection manager might want to signal "402 Payment required" as something more specific than Error or Permission_Denied so that a SIP-aware UI could handle it specially; including a namespaced error permits this to be done without Channel_Group_Change_Reason being extended to encompass every error any CM ever wants to report.
debug-message (s)
Debugging information on the change. SHOULD NOT be shown to users in normal circumstances.

Emitted when contacts join any of the three lists (members, local pending or remote pending) or when they leave any of the three lists. This signal provides a superset of the information provided by MembersChanged; if the channel's GroupFlags contains Members_Changed_Detailed, then clients may listen exclusively to this signal in preference to that signal.

All channel-specific handles that are mentioned in this signal MUST be represented in the value of the HandleOwners property. In practice, this will mean that HandleOwnersChanged is emitted before emitting a MembersChangedDetailed signal in which channel-specific handles are added, but that it is emitted after emitting a MembersChangedDetailed signal in which channel-specific handles are removed.

See StreamedMedia for an overview of how group state changes are used to indicate the progress of a call.

An array of contact handles to remove from the channel A string message, which can be blank if desired

Requests the removal of contacts from a channel, reject their request for channel membership on the pending local list, or rescind their invitation on the pending remote list.

If the SelfHandle is in a Group, it can be removed via this method, in order to leave the group gracefully. This is the recommended way to leave a chatroom, close or reject a StreamedMedia call, and so on.

Accordingly, connection managers SHOULD support doing this, regardless of the value of GroupFlags. If doing so fails with PermissionDenied, this is considered to a bug in the connection manager, but clients MUST recover by falling back to closing the channel with the Close method.

Removing any contact from the local pending list is always allowed. Removing contacts other than the SelfHandle from the channel's members is allowed if and only if Channel_Group_Flag_Can_Remove is in the GroupFlags, while removing contacts other than the SelfHandle from the remote pending list is allowed if and only if Channel_Group_Flag_Can_Rescind is in the GroupFlags.

A message may be provided along with the request, which will be sent to the server if supported. See the Channel_Group_Flag_Message_Remove, Channel_Group_Flag_Message_Depart, Channel_Group_Flag_Message_Reject and Channel_Group_Flag_Message_Rescind GroupFlags to see in which cases this message should be provided.

An array of contact handles to remove from the channel A string message, which can be blank if desired A reason for the change As RemoveMembers, but a reason code may be provided where appropriate. The reason code may be ignored if the underlying protocol is unable to represent the given reason. The provided reason code was invalid.

Interface for channels which have multiple members, and where the members of the channel can change during its lifetime. Your presence in the channel cannot be presumed by the channel's existence (for example, a channel you may request membership of but your request may not be granted).

This interface implements three lists: a list of current members (Members), and two lists of local pending and remote pending members (LocalPendingMembers and RemotePendingMembers, respectively). Contacts on the remote pending list have been invited to the channel, but the remote user has not accepted the invitation. Contacts on the local pending list have requested membership of the channel, but the local user of the framework must accept their request before they may join. A single contact should never appear on more than one of the three lists. The lists are empty when the channel is created, and the MembersChanged signal (and, if the channel's GroupFlags contains Members_Changed_Detailed, the MembersChangedDetailed signal) should be emitted when information is retrieved from the server, or changes occur.

If the MembersChanged or MembersChangedDetailed signal indicates that the SelfHandle has been removed from the channel, and the channel subsequently emits Closed, clients SHOULD consider the details given in the MembersChanged or MembersChangedDetailed signal to be the reason why the channel closed.

Addition of members to the channel may be requested by using AddMembers. If remote acknowledgement is required, use of the AddMembers method will cause users to appear on the remote pending list. If no acknowledgement is required, AddMembers will add contacts to the member list directly. If a contact is awaiting authorisation on the local pending list, AddMembers will grant their membership request.

Removal of contacts from the channel may be requested by using RemoveMembers. If a contact is awaiting authorisation on the local pending list, RemoveMembers will refuse their membership request. If a contact is on the remote pending list but has not yet accepted the invitation, RemoveMembers will rescind the request if possible.

It should not be presumed that the requester of a channel implementing this interface is immediately granted membership, or indeed that they are a member at all, unless they appear in the list. They may, for instance, be placed into the remote pending list until a connection has been established or the request acknowledged remotely.

If the local user joins a Group channel whose members or other state cannot be discovered until the user joins (e.g. many chat room implementations), the connection manager should ensure that the channel is, as far as possible, in a consistent state before adding the local contact to the members set; until this happens, the local contact should be in the remote-pending set. For instance, if the connection manager queries the server to find out the initial members list for the channel, it should leave the local contact in the remote-pending set until it has finished receiving the initial members list.

If the protocol provides no reliable way to tell whether the complete initial members list has been received yet, the connection manager should make a best-effort attempt to wait for the full list (in the worst case, waiting for a suitable arbitrary timeout) rather than requiring user interfaces to do so on its behalf.

telepathy-glib-0.24.2/spec/Connection_Interface_IRC_Command1.xml0000644000175000017500000000520012652510705021401 00000000000000 Copyright (C) 2013 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The command followed by its arguments.

Send an arbitrary IRC command to the server.

For example, an IRC client receiving /bip blreset from the user might call this method with BIP blreset as argument which will send BIP blreset to the server.

The command is supplied in UTF-8 (because strings on D-Bus are always UTF-8). It is transcoded into the connection's configured character set, if different, before sending to the server.

The connection manager MAY raise this error for commands that have a more appropriate D-Bus API.
An interface to send arbitrary IRC commands to the server.
telepathy-glib-0.24.2/spec/Connection_Interface_Location.xml0000644000175000017500000004750112652510705021027 00000000000000 Copyright (C) 2008 Collabora Ltd. Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface on connections to support protocols which allow users to publish their current geographical location, and subscribe to the current location of their contacts.

This interface is geared strongly towards automatic propagation and use of this information, so focuses on latitude, longitude and altitude which can be determined by GPS, although provision is also included for an optional human-readable description of locations. All co-ordinate information is required to be relative to the WGS84 datum.

The information published through this interface is intended to have the same scope as presence information, so will normally be made available to those individuals on the user's "publish" contact list. Even so, user interfaces should not automatically publish location information without the consent of the user, and it is recommended that an option is made available to reduce the accuracy of the reported information to allow the user to maintain their privacy.

Location information is represented using the terminology of XMPP's XEP-0080 or the XEP-0080-derived Geoclue API where possible.

Clients of this interface SHOULD register an interest in it by calling Connection.AddClientInterest with an argument containing the name of this interface, before calling any Location method. If they do so, they SHOULD also call Connection.RemoveClientInterest after use to allow the CM to release resources associated with this interface.

A user's location, represented as an extensible mapping.

Civic addresses are represented by the following well-known keys (all of which have string values), which should be kept in sync with those used in XEP-0080 and in the Geoclue project:

  • countrycode - s: an ISO-3166-1 alpha-2 (two-letter) country code, e.g. "us", "gb", "fr"
  • country - s: a country name in unspecified locale, e.g. "USA"
  • region - s: an administrative region of the nation, such as a state or province
  • locality - s: a locality within the administrative region, such as a town or city
  • area - s: a named area such as a campus or neighborhood
  • postalcode - s: a code used for postal delivery
  • street - s: a thoroughfare within the locality, or a crossing of two thoroughfares

The following address keys are defined in XEP-0080 but not by Geoclue, and are also allowed:

  • building - s: a specific building on a street or in an area
  • floor - s: a particular floor in a building
  • room - s: a particular room in a building
  • text - s: any more specific information, e.g. "Northwest corner of the lobby"
  • description - s: A natural-language name for or description of the location, e.g. "Bill's house"
  • uri - s: a URI representing the location or pointing to more information about it

Since the previous strings have data intended to be read by users, the language used should be stated using:

  • language - s: a specific language or locale of location information in a format compatible to RFC 4646. Note that UTF-8 is the only allowed encoding, e.g. "en" or "fr-CA".

Positions are represented by the following well-known keys:

  • lat - d: latitude in decimal degrees north, -90 to +90, relative to the WGS-84 datum This is from XEP-0080; the XEP allows use of a different datum, but recommends this one. We enforce sanity by requiring a consistent datum: a minimal compliant implementation of this specification in terms of XEP-0080 would simply ignore the <lat> and <lon> elements if <datum> exists and has a value other than WGS-84, while an advanced implementation might correct for the different datum.
  • lon - d: Longitude in decimal degrees east, -180 to +180, relative to the WGS-84 datum Same rationale as 'lat'
  • alt - d: altitude in metres above sea level (negative if below sea level) This is from XEP-0080
  • accuracy - d: horizontal position error in metres if known This is from XEP-0080

Velocities are represented by the following well-known keys:

  • speed - d: speed in metres per second This is from XEP-0080
  • bearing - d: direction of movement in decimal degrees, where North is 0 and East is 90 This is from XEP-0080, and is equivalent to the struct field called "direction" in GeoClue

Other well-known keys:

  • timestamp - x (Unix_Timestamp64): the time that the contact was at this location, in seconds since 1970-01-01T00:00:00Z (i.e. the beginning of 1970 in UTC) XEP-0080 uses an ISO 8601 string for this, but a number of seconds since the epoch is probably easier to work with.
The value corresponding to the well-known key.
A map from contacts to their locations. A contact The contact's location, which MAY be empty to indicate that the contact's location is unknown

Return the current locations of the given contacts, if they are already known. If any of the given contacts' locations are not known, request their current locations, but return immediately without waiting for a reply; if a reply with a non-empty location is later received for those contacts, the LocationUpdated signal will be emitted for them.

This method is appropriate for "lazy" location finding, for instance displaying the location (if available) of everyone in your contact list.

For backwards compatibility, if this method is called by a client whose "interest count" for this interface, as defined by Connection.AddClientInterest, is zero, the Connection SHOULD behave as if AddClientInterest had been called for this interface just before that method call. Clients that do not explicitly call AddClientInterest SHOULD NOT call Connection.RemoveClientInterest either.

The contacts whose locations should be returned or signalled. The contacts' locations, if already known. Contacts whose locations are not already known are omitted from the mapping; contacts known to have no location information appear in the mapping with an empty Location dictionary.
Return the current location of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply. This method is appropriate for use in a "Contact Information..." dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions. The contact whose location should be returned. The contact's location. It MAY be empty, indicating that no location information was found. The requested contact does not allow the local user to see their location information. Emitted when a contact's location changes or becomes known. The contact The contact's location, or empty to indicate that nothing is known about the contact's location. Set the local user's own location. The location to advertise. If the user wants to obscure their exact location by reducing the precision or accuracy, clients MUST do this themselves, rather than relying on the connection manager to do so. Clients that interact with more than one connection SHOULD advertise the same reduced-accuracy location to all of them, so that contacts cannot obtain an undesirably accurate location by assuming that random errors have been added and averaging the locations advertised on multiple connections. The user's server does not support publishing their own location. If it is possible to determine this ahead of time, the Can_Set flag will not be set in SupportedLocationFeatures. The types of access control that are supported by this connection. The current access control mechanism and settings for this connection. Before publishing location for the first time, if this has not been set by a client, implementations SHOULD set it to be as restrictive as possible (an empty whitelist, if supported). Indicates the Location features supported by this connection. This property MAY be undefined before Status becomes Connected, but MUST remain constant thereafter. Indicates that setting your own location with SetLocation is supported on this connection. Flags describing the Location features which may be supported on any given connection.

The same mapping that would be returned by GetLocations for this contact. Omitted from the result if the contact's location is not known.

For backwards compatibility, if contact attributes that include this interface are requested by a client whose "interest count" for this interface, as defined by Connection.AddClientInterest, is zero, the Connection SHOULD behave as if AddClientInterest was called for this interface just before that request. Clients that do not explicitly call AddClientInterest SHOULD NOT call Connection.RemoveClientInterest either.

telepathy-glib-0.24.2/spec/all.xml0000644000175000017500000003333612652510705013671 00000000000000 Telepathy D-Bus Interface Specification 0.27.3 Copyright © 2005-2012 Collabora Limited Copyright © 2005-2011 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A Connection Manager is a factory for connections.

Connections represent active protocol sessions. There are a number of core interfaces which all connections should implement, and a number of optional interfaces which provide various functionality related to contacts and to the connection itself.

On protocols that support contact lists, these interface expose the user's contact lists, along with presence subscription information, contact list groups (if supported), and the ability to block and unblock contacts (if supported).

These optional Connection interfaces expose metadata about contacts on this connection—from their current presence through to the type of client they're connected with—and allow the local user to publish such metadata back to their contacts.

These optional Connection interfaces expose protocol-specific features, and allow configuring the running connection.

A Channel is used by Telepathy to exchange data between local applications and remote servers. A given connection will have many channels, each one represented by a D-Bus object.

Each Channel has a type, represented by a D-Bus interface, and may implement one or more additional interfaces from the list of channel interfaces below.

Each Channel implements one of the following types:

A Channel may also implement one or more of the following interfaces, depending on its type. Some interfaces are only applicable to particular channel types, while others may (in principle) appear on any type of channel.

These interfaces may only appear on channels of type Text.

These interfaces are only applicable to channels of type StreamedMedia, with the exception of the Hold and DTMF interfaces, which may also appear on Call1 channels.

These interfaces provide functionality for ad-hoc conference calls and chat rooms. They are primarily intended for Text, StreamedMedia and Call1 channels, but may also appear on other types of channel.

A set of objects to be used for authentication purposes, such as TLS certificates or handshakes for negotiating end-to-end security.

These interfaces are used when a Call1 channel doesn't have HardwareStreaming to implement the media streaming aspects of a call.

The Account Manager is a desktop service that provides account configuration and can manage the connection managers. In general, clients will use the account manager to find out about instant messaging accounts and their associated connections.

The Channel Dispatcher is a desktop service whose purpose is to dispatch incoming Telepathy Channels to the appropriate client (e.g. incoming text chat, file transfer, tubes, etc.).

Clients should implement one or more of these interfaces to be able to handle channels coming in from the Channel Dispatcher.

telepathy-glib-0.24.2/spec/template.xml0000644000175000017500000000250512652510705014726 00000000000000 Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

Foo.

telepathy-glib-0.24.2/spec/Call_Stream_Endpoint.xml0000644000175000017500000003764612652510705017157 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009-2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

This object represents an endpoint for a stream. In a one-to-one call, there will be one (bidirectional) stream per content and one endpoint per stream (as there is only one remote contact). In a multi-user call there is a stream for each remote contact and each stream has one endpoint as it refers to the one physical machine on the other end of the stream.

The multiple endpoint use case appears when SIP call forking is used. Unlike jingle call forking (which is just making multiple jingle calls to different resources appear as one call), SIP call forking is actually done at the server so you have one stream to the remote contact and then and endpoint for each SIP client to be called.

The ICE credentials used for all candidates. If each candidate has different credentials, then this property SHOULD be ("", ""). Per-candidate credentials are set in the Candidate's Candidate_Info a{sv}. The username set. The password set. Emitted when the remote ICE credentials for the endpoint are set. If each candidate has different credentials, then this signal will never be fired. A list of candidates for this endpoint. Emitted when remote candidates are added to the RemoteCandidates property. The candidates that were added. A Pair of candidates. The local candidate. The remote candidate. Emitted when a candidate is selected for use in the stream by the controlling side of an ICE session. The controlled side should call AcceptSelectedCandidatePair or RejectSelectedCandidatePair when connectivity checks have either succeeded or failed for this candidate pair. See also: SelectedCandidatePairs. The local candidate that has been selected. The remote candidate that has been selected.

The candidates that have been selected for use to stream packets to the remote contact for each component of the stream. Change notification is given via the the CandidatePairSelected signal.

Note to client implementors (from RFC 5245 section 9.2.2.3):

If at least one of the pairs is In-Progress, the agent SHOULD wait for those checks to complete, and as each completes, redo the processing in this section until there are no losing pairs.

Also note that some or all of the local candidates in this list may represent a peer-reflexive candidate that do not appear in LocalCandidates.

See RFC 5245 Appendix B.6. for more details about why this is.

Update the entry in SelectedCandidatePairs for a particular component, and signal it to the remote side.

This method should only be called by the controlling side of an ICE session. See CandidatePairSelected for details.

In the SDP offer/answer model, this signalling will take place as generating an updated offer. Note that updates may be queued up until information about all components of all streams is gathered.

The local candidate that has been selected. The remote candidate that has been selected.
Represents the state of ICE negotiation for a single component of a stream to an endpoint. Candidate gathering and connectivity checks are in progress. The streaming implementation has found at least one working candidate pair. It is possible to send media at this point, but the controlling side has yet to negotiate the final candidates for use in this call. This component of the stream is connected, and an updated offer has been sent and accepted (finalising the candidates to be used for the call). This should be set by the CM in response to AcceptSelectedCandidatePair. The streaming implementation has tried connecting to all of the available candidates and none of them have connected. This is distinct from Failed, because the CM might be able to provide more candidates later (more likely in XMPP than SIP). The CM and streaming implementation are in agreement that it is impossible to connect to this endpoint. This value should only be set by the CM. The state of ICE negotiation with this Endpoint for each component of the stream. Emitted when the EndpointState property changes. The component whose state has changed. The new state of this component. Change the EndpointState of the endpoint. The component whose state needs updating. The new state of this component. Called in response to CandidatePairSelected if/when this candidate pair is known to have passed its connectivity checks. The local candidate that has been selected. The remote candidate that has been selected. Called in response to CandidatePairSelected if/when this candidate pair is known to have failed its connectivity checks. The local candidate that has been selected. The remote candidate that has been selected. The transport type for the stream endpoint. This can be different from the transport of the Stream in the case where of falling back from ICE to Raw_UDP.

The local side is taking the controlling role (as defined by ICE RFC 5245). Change notification is given via the ControllingChanged signal.

In ICE, the Caller is normally in controlling mode (and the Callee in controlled-mode), except if the Caller is doing ICE-Lite, in which case it's reversed. The Controlling side is responsible for selecting nominated pairs, and generating updated offers upon conclusion of ICE.
Set whether the local side is taking the Controlling role. Note that if there are multiple endpoints (e.g. SIP call forking) it may be the case that all endpoints need to have the same controlling/controlled orientation. The new value of Controlling. The value of Controlling has changed. The new value of Controlling. The Remote side is an ICE Lite endpoint. (The local side is assumed to always be an ICE Full implementation.)
telepathy-glib-0.24.2/spec/Connection_Interface_Capabilities.xml0000644000175000017500000003066512652510705021653 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

An interface for connections where it is possible to know what channel types may be requested before the request is made to the connection object. Each capability represents a commitment by the connection manager that it will ordinarily be able to create a channel when given a request with the given type and handle.

Capabilities pertain to particular contact handles, and represent activities such as having a text chat or a voice call with the user. The activities are represented by the D-Bus interface name of the channel type for that activity.

The generic capability flags are defined by Connection_Capability_Flags.

In addition, channel types may have type specific capability flags of their own, which are described in the documentation for each channel type.

This interface also provides for user interfaces notifying the connection manager of what capabilities to advertise for the user. This is done by using the AdvertiseCapabilities method, and deals with the interface names of channel types and the type specific flags pertaining to them which are implemented by available client processes.

Previously, this interface also expressed capabilities of the connection itself, indicating what sorts of channels could be requested (for instance, the ability to open chatroom lists or chatrooms). However, this was never very well-defined or consistent, and as far as we know it was never implemented correctly. This usage is now deprecated. Client implementations SHOULD use ContactCapabilities instead. Connection managers implementing Capabilities MUST implement ContactCapabilities too. The given channel type and handle can be given to RequestChannel to create a new channel of this type. The given contact can be invited to an existing channel of this type. A pair (channel type, type-specific flags) as passed to AdvertiseCapabilities on the Capabilities interface. A struct (contact handle, channel type, generic flags, type-specific flags) representing a capability posessed by a contact, as returned by GetCapabilities on the Capabilities interface. A struct (contact handle, channel type, old generic flags, new generic flags, old type-specific flags, new type-specific flags) representing a change to one of a contact's capabilities, as seen in the CapabilitiesChanged signal on the Capabilities interface. An array of structures containing:
  • a string channel type
  • a bitwise OR of type specific capability flags
An array of D-Bus interface names of channel types to remove An array of structures describing the current capabilities containing:
  • a string channel type
  • a bitwise OR of type specific capability flags

Used by user interfaces to indicate which channel types they are able to handle on this connection. Because these may be provided by different client processes, this method accepts channel types to add and remove from the set already advertised on this connection. The type of advertised capabilities (create versus invite) is protocol-dependent and hence cannot be set by the this method. In the case of a client adding an already advertised channel type but with new channel type specific flags, the connection manager should simply add the new flags to the set of advertised capabilities.

Upon a successful invocation of this method, the CapabilitiesChanged signal will be emitted for the user's own handle ( Connection.GetSelfHandle) by the connection manager to indicate the changes that have been made. This signal should also be monitored to ensure that the set is kept accurate - for example, a client may remove capabilities or type specific capability flags when it exits which are still provided by another client.

On connections managed by the ChannelDispatcher, this method SHOULD NOT be used by clients other than the ChannelDispatcher itself.

An array of structures containing:
  • an integer handle representing the contact
  • a string channel type
  • a bitwise OR of the contact's old generic capability flags
  • a bitwise OR of the contact's new generic capability flags
  • a bitwise OR of the contact's old type specific capability flags
  • a bitwise OR of the contact's new type specific capability flags

Announce that there has been a change of capabilities on the given handle.

If the handle is zero, the capabilities refer to the connection itself, in some poorly defined way. This usage is deprecated and clients should ignore it.

An array of contact handles for this connection.

This may include zero, which originally meant a query for capabilities available on the connection itself. This usage is deprecated; clients SHOULD NOT do this, and connection managers SHOULD proceed as though zero had not been present in this list.

An array of structures containing:
  • an integer handle representing the contact
  • a string channel type
  • a bitwise OR of generic capability flags for the type
  • a bitwise OR of type specific capability flags for the type
Returns an array of capabilities for the given contact handles. The handle does not represent a contact and is not zero

The same structs that would be returned by GetCapabilities (all of them will redundantly have the contact's handle as the first member). Omitted from the result if the contact's capabilities are not known; present in the result as an empty array if the contact is known to have no capabilities at all.

telepathy-glib-0.24.2/spec/Client_Observer.xml0000644000175000017500000005114112652510705016200 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

Observers monitor the creation of new channels. This functionality can be used for things like message logging. All observers are notified simultaneously.

Observers SHOULD NOT modify the state of a channel except via user interaction.

We want Observer UIs for file transfer channels (a progress bar for the transfer) to be able to have a Cancel button.

Observers MUST NOT carry out actions that exactly one process must take responsibility for (e.g. acknowledging Text messages, or carrying out the actual transfer in a file transfer channel).

Since arbitrarily many observers can be activated for each channel, it would not make sense for observers to do things that can only be done by one process (acknowledging Text messages, carrying out streaming for StreamedMedia channels, doing the actual data transfer for file transfers, setting up the out-of-band connection for Tubes). The Handler is responsible for such tasks.

Handlers MAY, of course, delegate responsibility for these tasks to other processes (including those run as observers), but this MUST be done explicitly via a request from the Handler to the Observer.

Whenever a collection of new channels is signalled, the channel dispatcher will notify all running or activatable observers whose ObserverChannelFilter property (possibly as cached in the .client file) indicates that they are interested in some of the channels.

Observers are activated for all channels in which they have registered an interest - incoming, outgoing or automatically created - although of course the ObserverChannelFilter property can be set to filter on the Requested property.

Because it might take time for an observer to become ready (for instance, a Text logger needs to wait until pending messages have been downloaded), the channel dispatcher must wait (up to some timeout) for all observers to return from ObserveChannels before letting anything destructive happen. Destructive things (e.g. acknowledging messages) are defined to be done by handlers, therefore HandleWith and Claim aren't allowed to succeed until all observers are ready.

Non-interactive approvers (for instance, to shoot down spam IM channels before the tray icon blinks at the user, or to grab a SASL channel before the user is prompted for a password) can be implemented as observers by following these steps:

  1. ObserveChannels() is called on the observer.
  2. The observer calls Claim() on the CDO.
  3. The observer then returns from ObserveChannels().
  4. Claim will return successfully if the channels were successfully claimed, or failure if someone else got there first.

Non-interactive approvers implemented as observers SHOULD also set DelayApprovers to TRUE so that other Approvers are not called on until all observers return from ObserveChannels. This gives non-interactive approvers a chance to claim the channels before Approvers are called.

A specification of the channels in which this observer is interested. The ObserveChannels method should be called by the channel dispatcher whenever any of the new channels in a NewChannels signal match this description.

Only certain D-Bus types have useful semantics for matching like this, so only certain types are allowed:

Integers of all sizes, including byte (y, n, q, i, u, x, t)
Matched by numeric value, regardless of type (e.g. 42 as a 16-bit signed integer 'n' is considered equal to 42 as a 32-bit unsigned integer 'u')
Booleans (b)
Matched by equality in the obvious way; not considered equal to any other type
Strings (s)
Matched by equality in the obvious way; not considered equal to any other type
Object paths (o)
Matched by equality in the obvious way; not considered equal to any other type

This property never changes while the observer process owns its Client bus name. For activatable processes, the filter can change due to an upgrade - the channel dispatcher SHOULD observe changes to .client files using a mechanism like inotify.

Not allowing this property to change is a simplification, particularly for activatable processes (we reject the possibility that a process with a .client file, when activated, has a filter that differs from what its .client file said).

If an Observer wants to add extra channels to its list of interests at runtime, it can register an additional Client bus name (for instance, the org.freedesktop.Telepathy.Client.Empathy process with unique name :1.42 could additionally register org.freedesktop.Telepathy.Client.Empathy._1_42) with additional filters. To remove those filters, it can release the bus name; it could even re-claim the bus name immediately, with different filters.

The same principle is applied to Approvers and Handlers.

For observers that have a .client file, the channel dispatcher may discover this property from keys of the form "propertyname type", in groups in the .client file whose name is the name of this interface followed by .ObserverChannelFilter, a space and an ASCII decimal number starting from 0.

Values in the .client file are encoded in exactly the same way as the default-p keys in .manager files, as described in the ConnectionManager interface (but note that not all types supported in .manager files can appear in .client files).

For instance, a .client file for an observer that is only interested in Text channels, with CONTACT or ROOM handles, that were requested by a local client:

[org.freedesktop.Telepathy.Client]
Interfaces=org.freedesktop.Telepathy.Client.Observer;

[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 0]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
org.freedesktop.Telepathy.Channel.Requested b=true

[org.freedesktop.Telepathy.Client.Observer.ObserverChannelFilter 1]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
org.freedesktop.Telepathy.Channel.TargetHandleType u=2
org.freedesktop.Telepathy.Channel.Requested b=true
When using telepathy-mission-control, version 5.4.0 or later is needed for this property to be useful.

If true, upon the startup of this observer, ObserveChannels will be called for every already existing channel matching its ObserverChannelFilter

When an activatable client having this property disappears from the bus and there are channels matching its ObserverChannelFilter, ObserveChannels will be called immediately to reactivate it again. Such clients should specify this property in their .client file as follows:

[org.freedesktop.Telepathy.Client.Observer]
Recover=true

This means that if an activatable Observer crashes, it will be restarted as soon as possible; while there is an unavoidable possibility that it will miss some events during this process (particularly Text messages), this window of event loss is kept to a minimum.

Non-activatable observers can't take advantage of this mechanism, but setting this property on a non-activatable observer does allow it to "catch up" on channels that are currently active at the time that it starts up.

When the ObserveChannels method is called due to observer recovery, the Observer_Info dictionary will contain one extra item mapping the key "recovering" to True.

Called by the channel dispatcher when channels in which the observer has registered an interest are announced in a NewChannels signal.

If the same NewChannels signal announces some channels that match the filter, and some that do not, then only a subset of the channels (those that do match the filter) are passed to this method.

If the channel dispatcher will split up the channels from a single NewChannels signal and dispatch them separately (for instance because no installed Handler can handle all of them), it will call ObserveChannels several times.

The observer MUST NOT return from this method call until it is ready for a handler for the channel to run (which may change the channel's state).

The channel dispatcher must wait for observers to start up, to avoid the following race: text channel logger (observer) gets ObserveChannels, text channel handler gets HandleChannels channel handler starts up faster and acknowledges messages, logger never sees those messages.

The channel dispatcher SHOULD NOT change its behaviour based on whether this method succeeds or fails: there are no defined D-Bus errors for this method, and if it fails, this only indicates that an Observer is somehow broken.

The expected error response in the channel dispatcher is to log a warning, and otherwise continue as though this method had succeeded.

The Account with which the channels are associated. The well-known bus name to use is that of the AccountManager. The Connection with which the channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'. The Channels and their properties. Their well-known bus names are all the same as that of the Connection.

The path to the ChannelDispatchOperation for these channels, or the special value '/' if there is no ChannelDispatchOperation (because the channels were requested, not incoming).

If the Observer calls Claim or HandleWith on the dispatch operation, it MUST be careful to avoid deadlock, since these methods cannot return until the Observer has returned from ObserveChannels.

This allows an Observer to Claim a set of channels without having to match up calls to this method with calls to AddDispatchOperation.

The ChannelRequests satisfied by these channels. If the same process is an Observer and a Handler, it can be useful to be given this information as soon as possible (it will also be passed to Handler.HandleChannels).

Additional information about these channels. Currently defined keys are:

recovering - b
True if ObserveChannels was called for an existing channel (due to the Recover property being True); False or omitted otherwise. This allows observers to distinguish between new channels (the normal case), and existing channels that were given to the observer in order to catch up on previous events (perhaps after a previous instance of the same observer crashed).
request-properties - a{oa{sv}}
A map from ChannelRequest paths listed in Requests_Satisfied to Qualified_Property_Value_Maps containing namespaced immutable properties of each request.

All defined keys for this dictionary are optional; observers MAY safely ignore any entry in this dictionary.

If true, the channel dispatcher will wait for ObserveChannels to return before calling Approver.AddDispatchOperation on appropriate Approvers.

This property SHOULD be false unless there is a reason why a channel should not be given to approvers. An example of this is if an Observer is also a Handler and wants to Claim a channel so that it becomes its handler and doesn't want any approver to be called, this property should be true.

Observers and Approvers should be called at the same time in normal operation (with this property set to false) to improve responsiveness. For example, if an incoming call appears, the approver should get the channel as fast as possible to show a dialog, but if an approver has to make round-trips to set itself up, then the approval of the channel is delayed. As a result, it is recommended for this property to remain false unless absolutely necessary.

For service-activatable clients, this property should be specified in the observer's .client file as follows:

If this property is not implemented (telepathy-mission-control 5.7.5 and older), the channel dispatcher SHOULD consider it as being false.

[org.freedesktop.Telepathy.Client.Observer]
DelayApprovers=true
telepathy-glib-0.24.2/spec/Channel_Interface_Media_Signalling.xml0000644000175000017500000002167012652510705021715 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

The old-style Telepathy properties, deprecated since March 2009, have been removed.

An interface for signalling a channel containing synchronised media sessions which can contain an arbitrary number of streams. The presence of this interface on a Channel indicates that the connection manager will not carry out the actual streaming for this channel, and that the client handling the channel is responsible for doing so; in most cases we recommend doing this by using the telepathy-farsight library.

Streaming audio and (particularly) video requires a high level of integration with the UI, and having the connection manager act as a proxy would be likely to introduce unacceptable latency. As a result, audio/video streaming is offloaded into the client where possible, as an exception to the general design of Telepathy.

The negotiation interface is based on the API of the Farsight library. This, in turn, is based upon the IETF MMusic ICE drafts, where connections are established by signalling potential connection candidates to the peer until a usable connection is found, and codecs are negotiated with an SDP-style offer and answer. However, the principles should be applicable to other media streaming methods and the API re-used without difficulty.

Note that the naming conventions used in the MediaStreamHandler and MediaSessionHandler interfaces are rather confusing; methods have signal-like names and signals have method-like names, due to the API being based rather too closely on that of Farsight. This is for historical reasons and will be fixed in a future release of the Telepathy specification.

The type of a media session. Currently, the only supported value is "rtp". A struct representing a active session handler. The object path of the session handler, which is on the same bus name as the channel. The media session's type Returns all currently active session handlers on this channel as a list of (session_handler_path, type). Object path of the new Media.SessionHandler object String indicating type of session, eg "rtp" Signal that a session handler object has been created. The client should create a session object and create streams for the streams within.

The client can implement streaming for streams whose NATTraversal property is gtalk-p2p.

The client can implement streaming for streams whose NATTraversal property is ice-udp.

The client can implement streaming for streams whose NATTraversal property is wlm-8.5.

The client can implement streaming for streams whose NATTraversal property is wlm-2009.

The client supports media streaming with H264 (etc.).

This handler capability token is a one of a family of similar tokens: for any other audio or video codec whose MIME type is audio/subtype or video/subtype, a handler capability token of this form may exist (the subtype MUST appear in lower case in this context). Clients MAY support more codecs than they explicitly advertise support for; clients SHOULD explicitly advertise support for their preferred codec(s), and for codecs like H264 that are, in practice, significant in codec negotiation.

For instance, the XMPP capability used by the Google Video Chat web client to determine whether a client is compatible with it requires support for H264 video, so an XMPP connection manager that supports this version of Jingle should not advertise the Google Video Chat capability unless there is at least one installed client that declares that it supports video/h264 on StreamedMedia channels.

For example, a client could advertise support for Speex, Theora and H264 by having three handler capability tokens, org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/audio/speex, org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/theora and org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264, in its Capabilities property.

Clients MAY have media signalling abilities without explicitly supporting any particular codec, and connection managers SHOULD support this usage.

This is necessary to support gatewaying between two Telepathy connections, in which case the available codecs might not be known to the gatewaying process.

telepathy-glib-0.24.2/spec/Account_Interface_Avatar.xml0000644000175000017500000000626712652510705017776 00000000000000 Copyright (C) 2008 Collabora Ltd. Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface extends the core Account interface to provide a user-settable avatar image.

The avatar could have been a property on the core Account interface, but was moved to a separate interface because it is likely to be large. This means that clients can safely use GetAll to get properties on the core Account interface without flooding the session bus with large images.

A struct containing avatar data marked with its MIME type.

May be set to an empty byte-array and an empty string, indicating no avatar.

The avatar to set on this account for display to other contacts, represented as a structure containing the bytes of the avatar, and the MIME type as a string; may be set to an empty byte-array and an empty string to indicate no avatar. When the account becomes connected, the account manager SHOULD set this avatar using SetAvatar if appropriate. Emitted when the Avatar property changes. The avatar itself is deliberately not included in this signal, to reduce bus traffic in the (likely common) case where no running application cares about the user's own avatar.
telepathy-glib-0.24.2/spec/Channel_Interface_Password.xml0000644000175000017500000001161012652510705020322 00000000000000 Copyright © 2005-2011 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The ProvidePassword method must be called now for the user to join the channel The RoomConfig1.PasswordHint contains a hint for the password. An integer with the logical OR of all the flags set (values of ChannelPasswordFlags) Returns the bitwise-OR of the flags relevant to the password on this channel. The user interface can use this to present information about which operations are currently valid. A bitwise OR of the flags which have been set A bitwise OR of the flags which have been cleared Emitted when the flags as returned by GetPasswordFlags are changed. The user interface should be updated as appropriate. The password A boolean indicating whether or not the password was correct Provide the password so that the channel can be joined. Must be called with the correct password in order for channel joining to proceed if the 'provide' password flag is set.

Interface for channels that may have a password set that users need to provide before being able to join. The GetPasswordFlags method and the associated PasswordFlagsChanged signal indicate whether the user must now provide a password to join the channel.

Once the user has joined the channel, the current password-protectedness of the room can be checked (and possibly modified) using the RoomConfig1 interface, if implemented.

telepathy-glib-0.24.2/spec/Connection_Interface_Keepalive.xml0000644000175000017500000000675412652510705021171 00000000000000 Copyright © 2010 Collabora Ltd. Copyright © 2010 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

Most messaging protocols allow the client to send periodic content-less pings to the server when the connection is otherwise idle, to reassure both itself and the server that its connection is still alive. Depending on the nature of the network connection, and the device running the client, the desired interval between such pings may vary.

For instance, on a mobile handset connected via 3G, overly-frequent keepalives can drain the battery through needlessly waking up the radio, and a relatively high interval is appropiate. By contrast, a desktop computer is less likely to be asleep in the first place, and users expect dropped connections to be noticed as soon as possible.

This interface provides a KeepaliveInterval property which controls the frequency of keepalive pings, if any. Connection managers implementing this property should also include it in Protocol.Parameters with the DBus_Property flag, allowing the desired value to be stored in Account.Parameters and passed onto the connection by the account manager.

The time in seconds between pings sent to the server to ensure that the connection is still alive, or 0 to disable such pings.

This property (and parameter) supersedes the older keepalive-interval Connection_Parameter_Name.

telepathy-glib-0.24.2/spec/Channel_Type_Contact_Search.xml0000644000175000017500000005401212652510705020424 00000000000000 Copyright © 2005-2009 Collabora Limited Copyright © 2005-2009 Nokia Corporation Copyright © 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

as stable API. Changes from draft 2: Contact_Search_Result_Map keys are now identifiers rather than handles; consequently, the values need not include x-telepathy-identifier.

A channel type for searching server-stored user directories. A new channel should be requested by a client for each search attempt, and closed when the search is completed or the required result has been found.

Connections that support contact search channels SHOULD have an entry in RequestableChannelClasses with the ChannelType fixed to this interface, and no other fixed properties. That requestable channel class MAY also have the Server and Limit properties in its list of allowed properties, depending on the protocol.

The requestable channel class would normally also have TargetHandleType fixed to None, but the initial implementation of ContactSearch (in telepathy-gabble) didn't do this.

All channels of this type should have TargetHandleType None (and hence TargetHandle 0 and TargetID "").

Requests for channels of this type need only optionally specify the Server property (if it is an allowed property in the connection's RequestableChannelClasses).

Before searching, the AvailableSearchKeys property should be inspected to determine the valid search keys which can be provided to the Search method. A search request is then started by providing some of these terms to the Search method, and the SearchState will change from Not_Started to In_Progress. As results are returned by the server, the SearchResultReceived signal is emitted for each contact found; when the search is complete, the search state will be set to Completed. If the search fails after Search has been called, the state will change to Failed. A running search can be cancelled by calling Stop.

If the protocol supports limiting the number of results returned by a search and subsequently requesting more results, after Limit results have been received the search state will be set to More_Available. Clients may call More to request another Limit results. If allowed by the connection manager, clients may specify the "page size" by specifying Limit when calling CreateChannel.

The client should call the channel's Close method when it is finished with the channel.

Each channel can only be used for a single search; a new channel should be requested for each subsequent search. Connection managers MUST support multiple ContactSearch channels being open at once (even to the same server, if applicable).

It does not make sense to request this channel type using EnsureChannel; clients SHOULD request channels of this type using CreateChannel instead.

A contact search channel that is already in use for a different search isn't useful.

The search has not started The search is in progress The search has paused, but more results can be retrieved by calling More. The search has been completed The search has failed The current state of this search channel object. Change notification is via SearchStateChanged. The new search state If the new state is Failed, the name of a D-Bus error describing what went wrong. Otherwise, the empty string.

Additional information about the state transition, which may include the following well-known keys:

debug-message (s)
Debugging information on the change, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances

This argument allows for future extensions. For instance, if moving to state Failed because the server rejected one of our search terms, we could define a key that indicates which terms were invalid.

Emitted when the SearchState property changes. The implementation MUST NOT make transitions other than the following:

  • Not_StartedIn_Progress
  • In_ProgressMore_Available
  • More_AvailableIn_Progress
  • In_ProgressCompleted
  • In_ProgressFailed

Any of the following search keys, with the indicated result for the search:

The empty string
Search for the search term in some implementation-dependent set of fields, using an implementation-dependent algorithm (e.g. searching for each word mentioned) The "one big search box" approach to searching, as is familiar from Google. The Sametime plugin to Pidgin appears to search in this way.
A VCard_Field
Search for the search term in fields matching that name (for instance, nickname would search nicknames, and tel would search any available phone number, regardless of its work/home/mobile/... status).
A VCard_Field followed by ";" and a VCard_Type_Parameter of the form "type=..."
Search for the search term in fields of that name and type only (for instance, tel;type=mobile).
x-telepathy-identifier
Search for contacts whose identifier in the IM protocol matches the search term (e.g. contains it as a substring) Otherwise, starting a search by identifier would require the UI to know the vCard field name corresponding to identifiers in this protocol, which might be non-standard (like x-jabber) or not exist at all.
x-gender
For the search term "male" or "female", search only for contacts listed as male or female, respectively. The results for other search terms are undefined; it is likely that contacts with unspecified gender will only be matched if this search key is omitted from the request. Examples in XEP-0055 suggest this usage, and at least Gadu-Gadu also supports limiting search results by gender.
x-n-family
Search for the search term in contacts' family names (the first component of the vCard field n). Gadu-Gadu and TOC seem to support this mode of searching.
x-n-given
Search for the search term in contacts' given names (the second component of the vCard field n). As for x-n-family.
x-online
For the search term "yes", search only for contacts who are currently online. The results for other search terms are undefined. Gadu-Gadu appears to support this.
x-adr-locality
Search for the search term as a locality or city (the fourth component of the vCard field adr). Gadu-Gadu and TOC appear to support this.

If supported by the protocol, the maximum number of results that should be returned, where 0 represents no limit. If the protocol does not support limiting results, this should be 0.

For example, if the terms passed to Search match Antonius, Bridget and Charles and this property is 2, the search service SHOULD only return Antonius and Bridget.

This property SHOULD be requestable if and only if the protocol supports specifying a limit; implementations SHOULD use 0 as the default if possible, or a protocol-specific sensible default otherwise.

The set of search keys supported by this channel. Example values include [""] (for protocols where several address fields are implicitly searched) or ["x-n-given", "x-n-family", "nickname", "email"] (for XMPP XEP-0055, without extensibility via Data Forms). It can be in the NewChannels signal for round-trip reduction. A map from search keys to search terms. The search key to match against The term or terms to be searched for in the search key; depending on the protocol and the server implementation, this may be matched by exact or approximate equality, substring matching, word matching or any other matching algorithm A dictionary mapping search key names to the desired values Send a request to start a search for contacts on this connection. This may only be called while the SearchState is Not_Started; a valid search request will cause the SearchStateChanged signal to be emitted with the state In_Progress. The SearchState is no longer Not_Started, so this method is no longer available. The search terms included something this connection manager cannot search for. Request that a search in SearchState More_Available move back to state In_Progress and continue listing up to Limit more results. The SearchState is not More_Available.

Stop the current search. This may not be called while the SearchState is Not_Started. If called while the SearchState is In_Progress, SearchStateChanged will be emitted, with the state Failed and the error org.freedesktop.Telepathy.Error.Cancelled.

Calling this method on a search in state Completed or Failed succeeds, but has no effect.

Specifying Stop to succeed when the search has finished means that clients who call Stop just before receiving SearchStateChanged don't have to handle a useless error.

Depending on the protocol, the connection manager may not be able to prevent the server from sending further results after this method returns; if this is the case, it MUST ignore any further results.

The SearchState is Not_Started, so this method is not yet available.
A map from contact identifier to search result, emitted in the SearchResultReceived signal. The identifier of a contact matching the search terms. This is an identifier rather than a handle in case we make handles immortal; see fd.o#23155 and fd.o#13347 comment 5.

An array of fields representing information about this contact, in the same format used in the ContactInfo interface. It is possible that a separate call to RequestContactInfo would return more information than this signal provides.

A mapping from contact identifier to an array of fields representing information about this contact. Emitted when a some search results are received from the server. This signal can be fired arbitrarily many times so clients MUST NOT assume they'll get only one signal.

For protocols which support searching for contacts on multiple servers with different DNS names (like XMPP), the DNS name of the server being searched by this channel, e.g. "characters.shakespeare.lit". Otherwise, the empty string.

XEP 0055 defines a mechanism for XMPP clients to search services of their choice for contacts, such as users.jabber.org (the "Jabber User Directory").

This property SHOULD be requestable if and only if the protocol supports querying multiple different servers; implementations SHOULD use a sensible default if possible if this property is not specified in a channel request.

This allows a client to perform searches on a protocol it knows nothing about without requiring the user to guess a valid server's hostname.

telepathy-glib-0.24.2/spec/Client_Handler_Future.xml0000644000175000017500000000771512652510705017330 00000000000000 Copyright © 2009 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface contains functionality which we intend to incorporate into the Handler interface in future. It should be considered to be conceptually part of the core Handler interface, but without API or ABI guarantees.

If true, channels destined for this handler are not passed to observers for observing.

This is useful in use-cases where the handler doesn't want anyone observing the channel - for example, because channels it handles shouldn't be logged.

For service-activatable handlers, this property should be specified in the handler's .client file as follows:

[org.freedesktop.Telepathy.Client.Handler]
BypassObservers=true

If true, channels destined for this handler that have the Conference interface, with a channel that was previously handled by the same client process in their InitialChannels property, should bypass the approval stage. In effect, this is a weaker form of BypassApproval.

It would be reasonable for a user interface to accept invitations to continuations of an existing channel automatically, or not; this is a matter of UI policy.

It's somewhat complex for an Approver to keep track of which channels are being handled by a particular Handler, but the Channel Dispatcher already has to track this, so it's useful for the channel dispatcher to assist here.

telepathy-glib-0.24.2/spec/Connection_Manager_Interface_Account_Storage.xml0000644000175000017500000001115212652510705023762 00000000000000 Copyright © 2011 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft 1)

An interface for connection managers that store account details internally. At the moment this consists only of storing an account's credentials, but other functionality may be added in the future.

Account objects representing accounts on a connection manager that implements this interface should implement the ExternalPasswordStorage.DRAFT interface.

A set of flags representing the status of the Account stored in the Connection Manager. The associated account has its authentication credentials (password) stored in the connection manager A mapping from Account_Ids to account flags.

The set of Accounts stored in this Connection Manager, and flags indicating their status.

Change notification for this property is provided by the standard D-Bus PropertiesChanged signal.

Clears any saved credentials associated with the specified Account_Id. Any other saved data related to the account will be unaffected. An account id as returned from Protocol.IdentifyAccount. The account id is invalid. Completely removes all data associated with an account from the connection manager's internal storage. An account id as returned from Protocol.IdentifyAccount. The account id is invalid.
telepathy-glib-0.24.2/spec/Connection_Interface_Power_Saving.xml0000644000175000017500000001172712652510705021663 00000000000000 Copyright © 2007-2010 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

Some protocols support mechanisms for reducing bandwidth usage—and hence power usage, on mobile devices—when the user is not directly interacting with their IM client. For instance, Google Talk's XMPP server supports queueing incoming presence updates at the client's instruction; the client can instruct the server to deliver all outstanding presence updates at a later time. This interface may be used to instruct the connection manager to enable and disable such protocol-level features when a screensaver is activated, the device screen is locked, and so on, by calling the SetPowerSaving method.

Enabling power saving SHOULD NOT change behaviour in any way that is noticable to a user not actively interacting with their client. For example, delaying presence updates somewhat is unlikely to be noticed by a user not staring at their device waiting for a contact to come online; on the other hand, requesting that the server queue incoming messages would be noticable by the user, so is not an acceptable effect of calling SetPowerSaving.

Turn power saving mode on or off.

Depending on the device's activity level, the connection can have its power saving mode turned on or off.

Errors raised by this method indicate that power saving could not be enabled, which SHOULD NOT generally be treated as fatal.

If the CM cannot switch modes, either because of the protocol (NotImplemented), or because of the service (NotAvailable), Mission Control (or whoever manages this) should be made aware. The error could be ignored or, in the extreme, be fascist and disconnect the account.
True if protocol-level power saving features should be activated; False if they should be de-activated. The current connection has no power saving features.

True if protocol-level power saving features are currently activated. This property can be changed using the SetPowerSaving method; change notifications is via the PowerSavingChanged signal.

The new state of the power saving feature. The PowerSavingActive property changed.
telepathy-glib-0.24.2/spec/Connection_Interface_Contact_Info.xml0000644000175000017500000005764512652510705021637 00000000000000 Copyright (C) 2008 Collabora Limited Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr".

A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'.

The type parameter 'type' is likely to be the most common, but there can be others, such as 'language=en'.

Characters which are required to be escaped in vCard type parameters should not be escaped in this list. For instance, a field "X-FOO;SEMICOLON=\;:bar" in a vCard would become ('x-foo', ['semicolon=;'], ['bar']) in this interface.

This avoids Telepathy UIs having to understand the escaping and unescaping rules for vCards. The type parameter name is not allowed (by RFC 2425) to contain an '=' character, so no ambiguity is introduced.

For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value.

For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements).

A vCard field with multiple comma-separated values, such as 'nickname', should be represented by several Contact_Info_Fields.

Characters which are required to be escaped in vCard values, such as semi-colons and newlines, should not be escaped in this list (e.g. if a value contains a newline, the data passed over D-Bus should contain a literal newline character).

An earlier draft of this interface split structured vCard fields into multiple Telepathy-level fields; for example, 'n' became 'family-name', 'given-name', etc. But under this representation, omitting empty components leads to difficulty identifying where one name ends and another begins. Consider the fields ['given-name', 'honorific-suffixes', 'family-name', 'honorific-prefixes']: does this represent two 'n' fields, or one with incorrect component ordering?

Represents one piece of information about a contact, as modelled by a single vCard field. Of the fields defined in RFC 2426, common examples include:

fn
The contact's full name, formatted to their liking
n
The contact's full name, divided into five parts: family name, given name, additional names, honorific prefixes, and honorific suffixes
org
The contact's organisation, divided into the organization's name possibly followed by one or more organizational unit names.
adr
A street address for the contact, divided into seven components: post office box, extended address, street address, locality (e.g., city), region (e.g., state or province), the postal code, and the country name.
label
A free-form street address for the contact, formatted as a single value (with embedded newlines where necessary) suitable for printing on an address label
tel
A telephone number for the contact.
email
An email address for the contact.

For example, the following vCard:

   BEGIN:vCard
   VERSION:3.0
   FN:Wee Ninja
   N;LANGUAGE=ja:Ninja;Wee;;;-san
   ORG:Collabora, Ltd.;Management Division;Human Resources\; Company Policy Enforcement
   ADR;TYPE=WORK,POSTAL,PARCEL:;;11 Kings Parade;Cambridge;Cambridgeshire
    ;CB2 1SJ;UK
   LABEL;TYPE=WORK,POSTAL,PARCEL:11 Kings Parade\nCambridge\nCambridgeshire\nUK\nCB2 1SJ
   TEL;TYPE=VOICE,WORK:+44 1223 362967, +44 7700 900753
   EMAIL;TYPE=INTERNET,PREF:wee.ninja@collabora.co.uk
   EMAIL;TYPE=INTERNET:wee.ninja@example.com
   URL:http://www.thinkgeek.com/geektoys/plush/8823/
   NICKNAME:HR Ninja,Enforcement Ninja
   END:vCard

would be represented by (in Python-like syntax):

[
  ('fn', [], ['Wee Ninja']),
  ('n', ['language=ja'], ['Ninja', 'Wee', '', '', '-san']),
  ('org', [], ['Collabora, Ltd.', 'Management Division',
    'Human Resources; Company Policy Enforcement']),
  ('adr', ['type=work','type=postal','type=parcel'],
   ['','','11 Kings Parade','Cambridge', 'Cambridgeshire','CB2 1SJ','UK']),
  ('label', ['type=work','type=postal','type=parcel'],
   ['''11 Kings Parade
  Cambridge
  Cambridgeshire
  UK
  CB2 1SJ''']),
  ('tel', ['type=voice','type=work'], ['+44 1223 362967']),
  ('tel', ['type=voice','type=work'], ['+44 7700 900753']),
  ('email', ['type=internet','type=pref'], ['wee.ninja@collabora.co.uk']),
  ('email', ['type=internet'], ['wee.ninja@example.com']),
  ('url', [], ['http://www.thinkgeek.com/geektoys/plush/8823/']),
  ('nickname', [], ['HR Ninja']),
  ('nickname', [], ['Enforcement Ninja'])
]
A dictionary whose keys are contact handles and whose values are contact information.. An integer handle for the contact whose info has changed. An array of fields representing information about this contact. Emitted when a contact's information has changed or been received for the first time on this connection. An array of handles representing contacts. A dictionary mapping contact handles to information, whose keys are the subset of the requested list of handles for which information was cached. Request information on several contacts at once. This SHOULD only return cached information, omitting handles for which no information is cached from the returned map. Integer handles for contacts. Retrieve information for the given contact, requesting it from the network if an up-to-date version is not cached locally. This method SHOULD return immediately, emitting ContactInfoChanged when the contacts' updated contact information is returned. This method allows a client with cached contact information to update its cache after a number of days. An integer handle for a contact. Information about that contact. Retrieve information for a contact, requesting it from the network if it is not cached locally. This method is appropriate for an explicit user request to show a contact's information; it allows a UI to wait for the contact info to be returned. The contact's information could not be retrieved. Set new contact information for this connection, replacing existing information. This method is only suppported if ContactInfoFlags contains Can_Set, and may only be passed fields conforming to SupportedFields. The new information to be set. Setting your own information is not supported on this protocol. The supplied fields do not match the restrictions specified by SupportedFields. Flags defining the behaviour of contact information on this protocol. Some protocols provide no information on contacts without an explicit request; others always push information to the connection manager as and when it changes. Indicates that SetContactInfo is supported on this connection. Indicates that the protocol pushes all contacts' information to the connection manager without prompting. If set, ContactInfoChanged will be emitted whenever contacts' information changes. A string naming a field in a vCard, such as "fn" or "adr". Although these are case-insensitive in RFC 2425, in Telepathy they MUST be normalized to lower case. In the terminology of RFC 2425 this is called a "type name", and corresponds to the "name" production given in the ABNF. A type parameter as defined by RFC 2426, such as "type=cell" or "language=en".

An integer representing the bitwise-OR of flags on this connection.

This property MAY change, without change notification, at any time before the connection moves to status Connection_Status_Connected. It MUST NOT change after that point.

Some XMPP servers, like Facebook Chat, do not allow the vCard to be changed (and so would not have the Can_Set flag). Whether the user's server is one of these cannot necessarily be detected until quite late in the connection process.

A struct describing a vCard field, with parameters, that may be passed to SetContactInfo on this Connection. A vCard field name, such as 'tel'. The set of vCard type parameters which may be set on this field. If this list is empty and the Contact_Info_Field_Flag_Parameters_Exact flag is not set, any vCard type parameters may be used. Flags describing the behaviour of this field. Maximum number of instances of this field which may be set. MAXUINT32 is used to indicate that there is no limit.

A list of field specifications describing the kinds of fields which may be passed to SetContactInfo. The empty list indicates that arbitrary vCard fields are permitted. This property SHOULD be the empty list, and be ignored by clients, if ContactInfoFlags does not contain the Can_Set flag.

For example, a protocol in which arbitrary vCards were stored as-is would set this property to the empty list. A protocol whose notion of contact information is one each of personal phone number, mobile phone number, location, email address and date of birth, with no attributes allowed on each piece of information, would set this property to (in Python-like syntax):

[
  ('tel', ['type=home'], Parameters_Exact, 1),
  ('tel', ['type=cell'], Parameters_Exact, 1),
  ('adr', [], Parameters_Exact, 1),
  ('bday', [], Parameters_Exact, 1),
  ('email', ['type=internet'], Parameters_Exact, 1),
]

A protocol which allows users to specify up to four phone numbers, which may be labelled as personal and/or mobile, would set this property to [ ('tel', ['type=home', 'type=cell'], 0, 4), ].

Studying existing IM protocols shows that in practice protocols allow either a very restricted set of fields (such as MSN, which seems to correspond roughly to the largest example above), or something mapping 1:1 to a large subset of vCard (such as XMPP's XEP-0054).

This property MAY change, without change notification, at any time before the connection moves to status Connection_Status_Connected. It MUST NOT change after that point.

Some XMPP servers, like Google Talk, only allow a small subset of the "vcard-temp" protocol. Whether the user's server is one of these cannot be detected until quite late in the connection process.

Flags describing the behaviour of a vCard field.

If present, exactly the parameters indicated must be set on this field; in the case of an empty list of parameters, this implies that parameters may not be used.

If absent, and the list of allowed parameters is non-empty, any (possibly empty) subset of that list may be used.

If absent, and the list of allowed parameters is empty, any parameters may be used.

Indicates that this field will be overwritten when the user's alias is changed with SetAliases or when the Account's Nickname is updated. Clients that allow the editing of the Alias and the ContactInfo in the same location should hide fields with this flag.

If a client allowed the user to edit both the nickname and the ContactInfo field at the same time, the user could set them to two different values even though they map to the same property. This would result in surprising behavior where the second value would win over the first.

In addition to hiding this field when editing ContactInfo together with the user's nickname, it is recommended that clients call SetContactInfo before setting the user's nickname.

This ensures that if the user changes the nickname, the correct value will get set even if the stale nickname is mistakenly sent along with SetContactInfo.

If used, this flag typically appears on either the 'nickname' or 'fn' field.

An interface for requesting information about a contact on a given connection. Information is represented as a list of Contact_Info_Fields forming a structured representation of a vCard (as defined by RFC 2426), using field names and semantics defined therein.

On some protocols, information about your contacts is pushed to you, with change notification; on others, like XMPP, the client must explicitly request the avatar, and has no way to tell whether it has changed without retrieving it in its entirety. This distinction is exposed by ContactInfoFlags containing the Push flag.

On protocols with the Push flag set, UIs can connect to ContactInfoChanged, call GetContactInfo once at login for the set of contacts they are interested in, and then be sure they will receive the latest contact info. On protocols like XMPP, clients can do the same, but will receive (at most) opportunistic updates if the info is retrieved for other reasons. Clients may call RequestContactInfo or RefreshContactInfo to force a contact's info to be updated, but MUST NOT do so unless this is either in response to direct user action, or to refresh their own cache after a number of days.

We don't want clients to accidentally cause a ridiculous amount of network traffic.

The same value that would be returned by GetContactInfo for this contact. Omitted from the result if the contact's info is not known.

telepathy-glib-0.24.2/spec/Account.xml0000644000175000017500000010264412652510705014514 00000000000000 Copyright © 2008-2012 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

An Account object encapsulates the necessary details to make a Telepathy connection.

Accounts are uniquely identified by object path. The object path of an Account MUST take the form /org/freedesktop/Telepathy/Account/cm/proto/acct, where:

  • cm is the same Connection_Manager_Name that appears in the connection manager's well-known bus name and object path
  • proto is the Protocol name as seen in ConnectionManager.ListProtocols, but with "-" replaced with "_" (i.e. the same as in the object-path of a Connection)
  • acct is an arbitrary string of ASCII letters, digits and underscores, starting with a letter or underscore, which uniquely identifies this account
  • Clients SHOULD parse the object path to discover the connection manager and protocol
  • Clients MUST NOT attempt to parse acct
  • Clients MUST NOT assume that acct matches the connection-specific part of a Connection's object-path and bus name
  • The account manager SHOULD choose acct such that if an account is deleted, its object path will be re-used if and only if the new account is in some sense "the same" (incorporating the 'account' parameter in some way is recommended)

This API avoids specifying the "profiles" used in Mission Control 4.x or the "presets" that have been proposed to replace them. An optional interface will be provided for AM implementations that want to provide presets.

There is deliberately no functionality here for opening channels; we intend to provide that in the channel dispatcher.

Other missing features which would be better in their own interfaces:

  • dynamic parameter-providing (aka provisioning)
  • saved server capabilities
  • account conditions
  • account grouping
moved the Avatar property to a separate interface A list of the extra interfaces provided by this account. Delete the account. This account has been removed. This is redundant with AccountRemoved, but it's still worth having, to avoid having to bind to AccountManager.AccountRemoved to tell you whether your Account is valid — ideally, an account-editing UI should only care about a single Account. The values of one or more properties on this interface (that do not specify that this signal does not apply to them) may have changed. This does not cover properties of other interfaces, which must provide their own change notification if appropriate. A map from property names in this namespace (e.g. Nickname) to values. Properties whose values have not changed SHOULD be omitted, but this need not be done. The user-visible name of this account. This SHOULD be chosen by the user at account creation time. The account creation user interface is responsible for setting a reasonable default value in the user's locale; something like "Jabber (bob@example.com)" would be sensible. The name of an icon in the system's icon theme, such as "im-msn", or the empty string to not specify an icon. If the icon is set to an empty string, the account manager or any client MAY derive a default icon, for instance from the protocol. If true, this account is considered by the account manager to be complete and usable. If false, user action is required to make it usable, and it will never attempt to connect (for instance, this might be caused by the absence of a required parameter). For connection managers with a plugin architecture, like telepathy-haze, we have little or no control over the parameters offered; for platforms with package management, we have little or no control over the CMs offered. NMC 4.x would just pretend the account didn't exist in these circumstances, but silent data loss is bad, and UIs with CM-specific knowledge (or a user filling in newly-required parameters) might be able to rescue a broken account.

This property gives the users the possibility to prevent an account from being used. This flag does not change the validity of the account.

A disabled account can never be put online.

Use cases:

  • user has two or more accounts capable of calling contact X, but he doesn't want the UI to prompt him everytime about which one he wants to use for the call. He can then disable all the equivalent accounts but one.
  • There is some temporary server error and the user doesn't want to be be bother by error messages, or change the account configuration: temporarily disabling the account is quicker.

The AccountManager SHOULD allow this property to be set on invalid accounts, but MUST NOT attempt to put invalid accounts online even if they become Enabled.

There doesn't seem to be any good reason not to allow this.

The nickname to set on this account for display to other contacts, as set by the user. When the account becomes connected, the account manager SHOULD set this as the user's alias using SetAliases if appropriate. In a later specification revision, we plan to separate the concepts of a contact's nickname as set by themselves, and the local name for them in our contact list (a "handle" or "pet name" as described in XEP-0165 and its references). The terminology change from alias to nickname here is a step in that direction.

Some protocols, like XMPP and SIP, are used by various different user-recognised brands, such as Google Talk and Ovi by Nokia. On accounts for such services, this property SHOULD be set to a string describing the service, which MUST consist only of ASCII letters, numbers and hyphen/minus signs, and start with a letter (matching the requirements for Protocol). For the jabber protocol, one of the following service names should be used if possible:

For the IRC protocol, the network name (freenode, gimpnet, etc.) can be used if relevant.

The Icon property SHOULD be set to a corresponding brand-specific icon name, if possible. In the future, this property may be used as an index into additional service-specific customizations. If this property is the empty string (or missing), the service is determined by the protocol name (either because this is a single-service protocol like msn, or because this is just a generic jabber or sip account without specific branding).

This property MAY be set, if appropriate, when calling CreateAccount. Updating this property will fail on externally-stored accounts whose StorageRestrictions include Cannot_Set_Service.

A map from connection manager parameter names (as in the ConnectionManager interface) to their values. This property includes only those parameters that are stored for this account, and SHOULD only include those parameters that the user has explicitly set.

This property cannot be altered using org.freedesktop.DBus.Properties.Set(); use UpdateParameters instead.

Change the value of the Parameters property.

If any of the Set parameters’ Conn_Mgr_Param_Flags include DBus_Property, the change will be applied immediately to the corresponding D-Bus Property on the active Connection, if there is one. If any of the Unset parameters’ Conn_Mgr_Param_Flags include both DBus_Property and Has_Default, the corresponding D-Bus Property on the connection will be set to the default value. Changes to other parameters will not take effect until the next time the account is disconnected and reconnected. (If parameters are explicitly set to their default value, or are unset when previously set to their default value, the account manager MAY decide that no reconnection is necessary to make the change take effect.)

In general, reconnecting is a destructive operation that shouldn't happen as a side-effect. In particular, migration tools that twiddle the settings of all accounts shouldn't cause an automatic disconnect and reconnect.

parameters which are also D-Bus properties can and should be updated on existing Connections return an array of the parameters that won't change until the account is reconnected A mapping from parameter names to their values. These parameters should be stored for future use. A list of the names of parameters to be removed from the set of stored values, allowing the default values to be used. If the given parameters were not, in fact, stored, or even if they do not exist at all, the account manager MUST accept this without error.

If all of the updates could be applied to the active Connection (if any), the empty list, signifying that no reconnection is required for the new parameters to take effect. For example, if the only parameter updated is ...Cellular.MessageValidityPeriod, the new value can be applied immediately to the connection.

Otherwise, a list of the names of parameters with changes that will not take effect until the account is reconnected. User interfaces that require "instant apply" semantics MAY call Reconnect in response to receiving a non-empty list. For example, if the caller updates both ...Anonymity.AnonymityMandatory and require-encryption, the former can be applied to the current connection, but the latter needs a reconnect to take effect, so this method should return ["require-encryption"].

The presence status that this account should have if it is brought online.

In ITOS2007 and ITOS2008 this is a global preference, not visible on D-Bus (the "default presence"). "Automatic presence" better describes when it is used.

Setting this property MUST NOT actually change the account's status until the next time it is (re)connected for some reason.

The value of this property MUST be one that would be acceptable for RequestedPresence, with the additional restriction that the Connection_Presence_Type MUST NOT be Offline.

Otherwise, it would not be possible to use this presence to bring the account online for a channel request.

If true, the account manager SHOULD attempt to put this account online with the AutomaticPresence whenever possible (in the base Account interface this is deliberately left vague). If false, it MUST NOT put the account online automatically in response to, for instance, connectivity changes, but SHOULD still put the account online with the AutomaticPresence if requested by the user (for instance, if the user tries to start a conversation using this account).

Either the object path of the Connection to this account, or the special value '/' if there is no connection.

If this object path is not '/', the Connection's well-known bus name can be derived from this object path by removing the first '/' and replacing subsequent '/' characters with '.'.

Object paths aren't nullable, so we can't use an empty string.
If the Connection property is non-empty, the status of that connection. If the Connection property is the empty string, this property may either be Disconnected (indicating that the account manager is not attempting to bring it online), or Connecting (indicating that the account manager is attempting to connect). The account manager is expected to set this by observing signals from the Connection. If the AM is doing some sort of backoff/delay on reconnection attempts, the account's status is conceptually "Connecting" even though there is no Connection. The reason for the last change to ConnectionStatus. The account manager is expected to set this by observing signals from the Connection. If you weren't watching the Connection at the time it failed, you can't tell why - unless the AM can tell you.

If the last connection to this account failed with an error, the D-Bus error name of that error; otherwise, the empty string. The account manager is expected to set this by observing the Connection.ConnectionError and Connection.StatusChanged signals.

If ConnectionError is received before the connection disconnects, its first argument should be used to set this property; otherwise, the Reason argument of StatusChanged should be converted to a suitable D-Bus error name.

Whenever the Connection connects successfully, this property should be reset to the empty string.

This combines the state-recoverability of ConnectionStatusReason with the extensibility of Connection.ConnectionError.

If the last connection to this account failed with an error, a mapping representing any additional information about the last disconnection; otherwise, the empty map. The keys and values are the same as for the second argument of Connection.ConnectionError.

Whenever the Connection connects successfully, this property should be reset to the empty map.

This combines the state-recoverability of ConnectionStatusReason with the extensibility of Connection.ConnectionError.

The actual presence. If the connection is not online, the Connection_Presence_Type SHOULD be Connection_Presence_Type_Offline. If the connection is online but does not support the SimplePresence interface, the type SHOULD be Connection_Presence_Type_Unset. The account manager is expected to set this by observing signals from the Connection.

The requested presence for this account. When this is changed, the account manager should attempt to manipulate the connection manager to make CurrentPresence match RequestedPresence as closely as possible. It should not be saved to any sort of persistent storage.

When the account manager automatically connects an account, it must signal this by setting the RequestedPresence to the same thing as the AutomaticPresence.

The Connection_Presence_Type in this property MUST NOT be Unset, Unknown or Error.

Requesting those presence types doesn't make sense.

If true, a change to the presence of this account is in progress.

Whenever RequestedPresence is set on an account that could go online, or whenever an account with a non-offline RequestedPresence becomes able to go online (for instance because Enabled or Valid changes to True), ChangingPresence MUST change to True, and the two property changes MUST be emitted in the same AccountPropertyChanged signal, before the Set method returns.

When the account manager succeeds or fails in changing the presence, or the connection disconnects due to an error, ChangingPresence MUST change to False as part of the same AccountPropertyChanged signal.

This allows UIs to indicate that a presence change is in progress or has finished, even if the change was initiated by a different UI.

For instance, Maemo 5 and Empathy indicate a presence change by having the presence indicator alternate between the RequestedPresence and the CurrentPresence; they should start blinking when ChangingPresence becomes true, and stop when it becomes false.

Re-connect this account. If the account is currently disconnected and the requested presence is offline, or if the account is not Enabled or not Valid, this does nothing.

If the account is disconnected and the requested presence is not offline, this forces an attempt to connect with the requested presence immediately.

If the account is connecting or connected, this is equivalent to remembering the current value of RequestedPresence, setting its value to (OFFLINE, "offline", ""), waiting for the change to take effect, then setting its value to the value that was previously remembered.

Clients desiring "instant apply" semantics for CM parameters MAY call this method to achieve that.

In particular, if the account's Connection is in the Connecting state, calling this method causes the attempt to connect to be aborted and re-tried.

This is necessary to ensure that the new parameters are picked up.

The normalized user ID of the local user on this account (i.e. the string returned when the InspectHandles method is called on the result of GetSelfHandle for an active connection).

It is unspecified whether this user ID is globally unique.

As currently implemented, IRC user IDs are only unique within the same IRCnet. On some saner protocols, the user ID includes a DNS name which provides global uniqueness.

If this value is not known yet (which will always be the case for accounts that have never been online), it will be an empty string.

It is possible that this value will change if the connection manager's normalization algorithm changes, although this SHOULD be avoided.

It's not always completely clear what normalization algorithm should be used; for instance, in Gabble, we currently use JIDs, but it would also have been reasonable to use xmpp URIs.

If true, this account has successfully been put online at some point in the past. UIs could apply a policy that the 'account' parameter can only be edited in accounts that have never been online, or that ConnectAutomatically cannot be set on such accounts. The account manager should not enforce such policies, but it can expose enough information to UIs that the UI can decide what to do.

A list of the object paths of formerly-used accounts which are superseded by this one.

For instance, if an account is migrated from one connection manager implementation to another, or even from one protocol to another (for instance formerly-proprietary services which can now be accessed via XMPP), log storage services could look for logs under all of the superseded object paths as well as the new object path.

This is a list because a single user-visible account could be migrated more than once.

If the Account Manager implementation performs an account migration automatically, it SHOULD set this property. If a client performs an account migration, it SHOULD set this property via via the Properties argument of CreateAccount when creating the migrated account. In either case, the value SHOULD include the old account's path, and every path from the old account's Supersedes property.

telepathy-glib-0.24.2/spec/Channel_Interface_HTML.xml0000644000175000017500000001027212652510705017267 00000000000000 Copyright (C) 2008 Collabora Ltd. Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(draft version, not API-stable)

This interface extends the Messages interface to support capability discovery, so clients can decide what subset of HTML is supported.

(However, the capability discovery mechanism has not been written yet, so this interface MUST NOT be used. It exists only to indicate what direction we intend to go in.)

XMPP supports all of XHTML-IM, and SIP (at least theoretically) supports all of XHTML. However, many protocols are more limited - for instance, in MSN you can only set font properties for a whole message at a time. We should not mislead users into thinking they can send MSN messages where individual words are emphasized.

If this interface is present, clients MAY send XHTML formatted text in message parts with type "text/html", and SHOULD interpret "text/html" message parts received in reply.

Client authors SHOULD pay careful attention to the security considerations in XEP-0071, "XHTML-IM", to avoid exposing client users to security risks. Clients MUST NOT assume that connection managers will filter messages to remove unsafe HTML.

Connection managers are the components in Telepathy that are most likely to be exploitable by a remote attacker to run malicious code (since they are network-facing), so any filtering that the CM does might be subverted.

To avoid misleading users, clients SHOULD only present UI for the subset of HTML that is indicated to be supported by this interface. It follows that clients SHOULD NOT send unsupported markup to the connection manager. However, even if the connection manager cannot send arbitrary XHTML, it MUST cope gracefully with being given arbitrary XHTML by a client.

Connection managers should be lenient in what they receive.

Clients MUST NOT send HTML that is not well-formed XML, but connection managers MAY signal HTML that is malformed or invalid. Clients SHOULD attempt to parse messages as XHTML, but fall back to using a permissive "tag-soup" HTML parser if that fails. (FIXME: or should the presence of this interface imply that the CM fixes up "text/html" to be XHTML? In practice that would result in all the CMs having to link against libxml2 or something... the rationale above no longer applies here, since dropping a malformed message is "safe")

telepathy-glib-0.24.2/spec/Connection_Interface_Renaming.xml0000644000175000017500000001156212652510705021015 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API) The handle of the original identifier The handle of the new identifier

Emitted when the unique identifier of a contact on the server changes.

Any channels associated with the contact's original handle will continue to be to that handle, and so are no longer useful (unless the contact renames back, or another contact connects with that unique ID). Clients may open a similar channel associated with the new handle to continue communicating with the contact.

For example, if a GUI client associates text channels with chat windows, it should detach the old channel from the chat window, closing it, and associate a channel to the new handle with the same window.

If the contact's old handle is in any of the member lists of a channel which has the groups interface, it will be removed from the channel and the new handle will be added. The resulting MembersChanged signal must be emitted after the Renamed signal; the reason should be RENAMED.

The handles may be either general-purpose or channel-specific. If the original handle is general-purpose, the new handle must be general-purpose; if the original handle is channel-specific, the new handle must be channel-specific in the same channel.

The desired identifier

Request that the user's own identifier is changed on the server. If successful, a Renamed signal will be emitted for the current "self handle" as returned by GetSelfHandle.

It is protocol-dependent how the identifier that's actually used will be derived from the supplied identifier; some sort of normalization might take place.

An interface on connections to support protocols where the unique identifiers of contacts can change. Because handles are immutable, this is represented by a pair of handles, that representing the old name, and that representing the new one.
telepathy-glib-0.24.2/spec/Debug.xml0000644000175000017500000001402112652510705014135 00000000000000 Copyright (C) 2009 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for providing debug messages.

This interface is primarily provided by one object per service, at the path /org/freedesktop/Telepathy/debug.

TRUE if the NewDebugMessage signal should be emitted when a new debug message is generated. Retrieve buffered debug messages. An implementation could have a limit on how many message it keeps and so the array returned from this method should not be assumed to be all of the messages in the lifetime of the service. A list of debug messages. Emitted when a debug messages is generated if the Enabled property is set to TRUE. Timestamp of the debug message. Domain of the debug message, as described in the Debug_Message struct. Level of the debug message. The text of the debug message. Log level for errors. Error messages are always fatal, resulting in the service terminating after something completely unexpected occurred. Log level for critical messages. Critical messages are messages that the service might predict and it is up to the service itself to decide whether to terminate following a critical message. Log level for warnings. Log level for messages. Log level for information messages. Log level for debug messages. A struct representing a debug message, as returned by GetMessages. Timestamp of the debug message. This is a double to allow more accuracy in the time the message was logged.

Domain of the debug message. This is used to identify the source of debug messages. For example, debug messages from a connection manager could have this Domain struct member be the name of the connection manager, and logs from any helper library could have the name of the helper library.

The domain could also contain a category as to where the log message originated separated by a forward-slash. For example, if a debug message was output in a connection manager called "dummy", in the file-transfer code, this Domain struct member might be dummy/file-transfer.

Level of the debug message. This states the severity of the debug message. The text of the debug message.
telepathy-glib-0.24.2/spec/Call_Interface_Mute.xml0000644000175000017500000001432312652510705016741 00000000000000 Copyright © 2005-2010 Nokia Corporation Copyright © 2005-2010 Collabora Ltd This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API)

Interface for calls which may be muted. This only makes sense for channels where audio or video is streaming between members.

Muting a call content indicates that the user does not wish to send outgoing audio or video.

It should always be possible to mute an entire call. It is sometimes also possible to mute individual Contents (e.g. to prevent background noise from disturbing other participants, but remain visible on webcam) or to mute individual streams (e.g. to "whisper" to other call participants)

For some protocols, the fact that the content is muted needs to be transmitted to the peer; for others, the notification to the peer is only informational (eg. XMPP), and some protocols may have no notion of muting at all.
The mute state of (at least part of) the call. See LocalMuteState for more details. All streams are unmuted (the call is active). New channels SHOULD have this mute state. All streams are Muted. The connection manager is attempting to move to state Muted, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are muted. Examining the Mute state of Call Contents (if applicable) may provide more useful information. The connection manager is attempting to move to state Unmuted, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are muted. Examining the Mute state of Call Contents or Streams may provide more useful information. Some of the constituent Streams are Muted. This state only makes sense on Call Channels or Contents. Examining the Mute state of Call Contents or Streams should provide more useful information. Emitted to indicate that the mute state has changed for this call content. This may occur as a consequence of the client calling RequestMuted, or as an indication that another client has (un)muted the content. The new mute state. The current mute state of this part of the call. New Contents should inherit the value of this property from the parent Call1. Similarly, Streams should inherit it from the parent Content. renamed from SetMuted to Mute renamed back from Mute to SetMuted True if the client wishes to mute the Content or Call.

Inform the CM that the Call, Content or Stream should be muted or unmuted.

The CM will tell the streaming implementation to Mute Streams as required, and emit MuteStateChanged when done.

telepathy-glib-0.24.2/spec/Connection_Interface_Contact_Groups.xml0000644000175000017500000006155312652510705022214 00000000000000 Copyright © 2009-2010 Collabora Ltd. Copyright © 2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An interface for connections in which contacts can be placed in user-defined groups.

The most basic functionality of this interface is to list and monitor a contact's set of groups. To do this, use the GroupsChanged signal, and the groups contact attribute (this should usually be done by connecting to the GroupsChanged signal, then calling GetContactListAttributes with this interface included in the Interfaces argument). Simple user interfaces can limit themselves to displaying that information, and ignore the rest of this interface: to ensure that this works, GroupsChanged is emitted for every change, even if that change could be inferred from another signal such as GroupsRemoved.

Looking at contacts' lists of groups is sufficient to present a user interface resembling XMPP's data model, in which groups behave like tags applied to contacts, and so an empty group cannot exist or is not interesting. However, some protocols model groups as objects in their own right. User interfaces may either track the set of groups via the Groups property and the GroupsCreated and GroupsRemoved signals, or ignore this extra information.

Similarly, in some protocols it is possible to rename a group as a single atomic operation. Simpler user interfaces will see the new name being created, the old name being removed, and the members moving to the new name, via the signals described above. More advanced user interfaces can optionally distinguish between an atomic rename and a create/remove pair, and display renamed groups differently, by monitoring the GroupRenamed signal.

This interface also provides various methods to manipulate user-defined groups, which can be expected to work if GroupStorage is not None.

Depending on the protocol, some methods might be implemented by more than one protocol operation; for instance, in a "contact-centric" protocol like XMPP, SetContactGroups is a single protocol operation and SetGroupMembers requires a protocol operation per contact, whereas in a more "group-centric" protocol it might be the other way around. User interfaces SHOULD call whichever method most closely resembles the way in which the user's action was represented in the UI, and let the connection manager deal with the details.

True if each contact can be in at most one group; false if each contact can be in many groups.

This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.

Indicates the extent to which contacts' groups can be set and stored.

This property cannot change after the connection has moved to the Connected state. Until then, its value is undefined, and it may change at any time, without notification.

The names of groups of which a contact is a member.

Change notification is via GroupsChanged; clients can also get extra context for group membership changes by receiving GroupRenamed and GroupsRemoved.

Emitted when contacts' groups change. The relevant contacts. The names of groups to which the contacts were added. The names of groups from which the contacts were removed.

The names of all groups that currently exist. This may be a larger set than the union of all contacts' groups contact attributes, if the connection allows groups to be empty.

Change notification is via GroupsCreated and GroupsRemoved; clients can also distinguish between a create/remove pair and a renamed group by receiving GroupRenamed.

This property's value is not meaningful until the ContactListState has become Success.

Emitted when new, empty groups are created. This will often be followed by GroupsChanged signals that add some members. The names of the new groups.

Emitted when a group is renamed, in protocols where this can be distinguished from group creation, removal and membership changes.

Immediately after this signal is emitted, GroupsCreated MUST signal the creation of a group with the new name, and GroupsRemoved MUST signal the removal of a group with the old name.

Emitting these extra signals, in this order, means that clients that are interested in the set of groups that exist (but treat a rename and a create/remove pair identically) can ignore the GroupRenamed signal entirely.

If the group was not empty, immediately after those signals are emitted, GroupsChanged MUST signal that the members of that group were removed from the old name and added to the new name.

On connection managers where groups behave like tags, renaming a group MAY be signalled as a set of GroupsCreated, GroupsRemoved and GroupsChanged signals, instead of emitting this signal.

On protocols like XMPP, another resource "renaming a group" is indistinguishable from changing contacts' groups individually.

The old name of the group. The new name of the group.

Emitted when one or more groups are removed. If they had members at the time that they were removed, then immediately after this signal is emitted, GroupsChanged MUST signal that their members were removed.

Emitting the signals in this order allows for two modes of operation. A client interested only in a contact's set of groups can ignore GroupsRemoved and rely on the GroupsChanged signal that will follow; a more elaborate client wishing to distinguish between all of a group's members being removed, and the group itself being removed, can additionally watch for GroupsRemoved and use it to disambiguate.

The names of the groups.

Add the given contact to the given groups (creating new groups if necessary), and remove them from all other groups.

This is the easiest and most correct way to implement user interfaces that display a single contact with a list of groups, resulting in a user expectation that when they apply the changes, the contact's set of groups will become exactly what was displayed.

If the user is removed from a group of which they were the only member, the group MAY be removed automatically.

In protocols like XMPP where groups behave like tags, a group with no members has no protocol representation.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The contact to alter. The set of groups which the contact should be in. Raised if DisjointGroups is true and the list of groups has more than one member. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.

Add the given members to the given group (creating it if necessary), and remove all other members.

This is the easiest and most correct way to implement user interfaces that display a single group with a list of contacts, resulting in a user expectation that when they apply the changes, the groups's set of members will become exactly what was displayed.

If DisjointGroups is true, this will also remove each member from their previous group.

If the user is removed from a group of which they were the only member, the group MAY be removed automatically.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The group to alter. The set of members for the group. If this set is empty, this method MAY remove the group. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.

Add the given members to the given group, creating it if necessary.

If DisjointGroups is true, this will also remove each member from their previous group.

This is good for user interfaces in which you can edit groups via drag-and-drop.

Any GroupsCreated, GroupsChanged and GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The group to alter. The set of members to include in the group. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.

Remove the given members from the given group.

This is good for user interfaces in which you can edit groups via drag-and-drop.

Any GroupsChanged or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The group to alter. If it does not exist, then it has no members by definition, so this method SHOULD return successfully. The set of members to remove from the group. It is not an error to remove members who are already not in the group. If there are no members left in the group afterwards, the group MAY itself be removed. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.

Remove all members from the given group, then remove the group itself. If the group already does not exist, this method SHOULD return successfully.

Any GroupsChanged or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The group to remove. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited.

Rename the given group.

On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group.

Otherwise, clients can't perform this operation atomically, even if the connection could.

Any GroupRenamed or GroupsRemoved signals that result from this method call MUST be emitted before the method returns.

This method SHOULD NOT be called until the ContactListState changes to Success. If the ContactListState is Failure, this method SHOULD raise the same error as GetContactListAttributes.

The group to rename. The new name for the group. Raised if GroupStorage is Contact_Metadata_Storage_Type_None, i.e. groups cannot be edited. Raised if there is no group with that name. Raised if there is already a group with the new name.
telepathy-glib-0.24.2/spec/Authentication_TLS_Certificate.xml0000644000175000017500000002742512652510705021126 00000000000000 Copyright © 2010 Collabora Limited This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. (as stable API) This object represents a TLS certificate.

The raw data contained in a TLS certificate.

For X.509 certificates (CertificateType = "x509"), this MUST be in DER format, as defined by the X.690 ITU standard.

For PGP certificates (CertificateType = "pgp"), this MUST be a binary OpenPGP key as defined by section 11.1 of RFC 4880.

Struct representing one reason why a TLS certificate was rejected.

Since there can be multiple things wrong with a TLS certificate, arrays of this type are used to represent lists of reasons for rejection. In that case, the most important reason SHOULD be placed first in the list.

The value of the TLS_Certificate_Reject_Reason enumeration for this certificate rejection. Clients that do not understand the Error member, which may be implementation-specific, can use this property to classify rejection reasons into common categories.

The DBus error name for this certificate rejection.

This MAY correspond to the value of the Reason member, or MAY be a more specific D-Bus error name, perhaps implementation-specific.

Additional information about why the certificate was rejected. This MAY also include one or more of the following well-known keys:

user-requested (b)
True if the error was due to an user-requested rejection of the certificate; False if there was an unrecoverable error in the verification process.
expected-hostname (s)
If the rejection reason is Hostname_Mismatch, the hostname that the server certificate was expected to have.
certificate-hostname (s)
If the rejection reason is Hostname_Mismatch, the hostname of the certificate that was presented.

For instance, if you try to connect to gmail.com but are presented with a TLS certificate issued to evil.example.org, the error details for Hostname_Mismatch MAY include:

                {
                  'expected-hostname': 'gmail.com',
                  'certificate-hostname': 'evil.example.org',
                }
              
debug-message (s)
Debugging information on the error, corresponding to the message part of a D-Bus error message, which SHOULD NOT be displayed to users under normal circumstances

The possible states for a TLSCertificate object. The certificate is currently waiting to be accepted or rejected. The certificate has been verified. The certificate has been rejected. Possible reasons to reject a TLS certificate. The certificate has been rejected for another reason not listed in this enumeration. The certificate is not trusted. The certificate is expired. The certificate is not active yet. The certificate provided does not have the expected fingerprint. The hostname certified does not match the provided one. The certificate is self-signed. The certificate has been revoked. The certificate uses an insecure cipher algorithm, or is cryptographically weak. The length in bytes of the certificate, or the depth of the certificate chain exceed the limits imposed by the crypto library. The current state of this certificate. State change notifications happen by means of the Accepted and Rejected signals.

If the State is Rejected, an array of TLS_Certificate_Rejection structures containing the reason why the certificate is rejected.

If the State is not Rejected, this property is not meaningful, and SHOULD be set to an empty array.

The first rejection in the list MAY be assumed to be the most important; if the array contains more than one element, the CM MAY either use the values after the first, or ignore them.

The type of this TLS certificate (e.g. 'x509' or 'pgp').

This property is immutable

One or more TLS certificates forming a trust chain, each encoded as specified by Certificate_Data.

The first certificate in the chain MUST be the server certificate, followed by the issuer's certificate, followed by the issuer's issuer and so on.

The State of this certificate has changed to Accepted. The State of this certificate has changed to Rejected. The new value of the Rejections property. Accepts this certificate, i.e. marks it as verified. Rejects this certificate.

The new value of the Rejections property.

This MUST NOT be an empty array.

Raised when the method is called on an object whose State is not Pending, or when the provided rejection list is empty.
telepathy-glib-0.24.2/spec/Channel_Type_DBus_Tube.xml0000644000175000017500000002211612652510705017360 00000000000000 Copyright © 2008-2009 Collabora Limited Copyright © 2008-2009 Nokia Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A D-Bus tube is an ordered reliable transport, for transporting D-Bus traffic.

For each D-Bus tube, the connection manager listens on a D-Bus server address, as detailed in the D-Bus specification. On this address, it emulates a bus upon which each tube participant appears as an endpoint.

The objects and interfaces which are expected to exist on the emulated bus depend on the well-known name; typically, either the participant who initiated the tube is expected to export the same objects/interfaces that would be exported by a service of that name on a bus, or all participants are expected to export those objects/interfaces.

In a multi-user context (Handle_Type_Room) the tube behaves like the D-Bus bus daemon, so participants can send each other private messages, or can send broadcast messages which are received by everyone in the tube (including themselves). Each participant has a D-Bus unique name; connection managers MUST prevent participants from sending messages with the wrong sender unique name, and SHOULD attempt to avoid participants receiving messages not intended for them.

In a 1-1 context (Handle_Type_Contact) the tube behaves like a peer-to-peer D-Bus connection - arbitrary D-Bus messages with any sender and/or destination can be sent by each participant, and each participant receives all messages sent by the other participant.

Offers a D-Bus tube providing the service specified. The dictionary of arbitrary Parameters to send with the tube offer. The access control the connection manager applies to the D-Bus socket. The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open. The contact associated with this channel doesn't have tubes capabilities. Accept a D-Bus tube that's in the "local pending" state. The connection manager will attempt to open the tube. The tube remains in the "local pending" state until the TubeChannelStateChanged signal is emitted. The access control the connection manager applies to the D-Bus socket. The string describing the address of the private bus. The client SHOULD NOT attempt to connect to the address until the tube is open. Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a participant opens or closes the tube. This provides change notification for the DBusNames property. Array of handles and D-Bus names of new participants. Array of handles of former participants.

A string representing the service name that will be used over the tube. It SHOULD be a well-known D-Bus service name, of the form com.example.ServiceName.

When the tube is offered, the service name is transmitted to the other end.

When requesting a channel with CreateChannel, this property MUST be included in the request.

For a multi-user (i.e. Handle_Type_Room) D-Bus tube, a mapping between contact handles and their unique bus names on this tube. For a peer-to-peer (i.e. Handle_Type_Contact) D-Bus tube, the empty dictionary. Change notification is via DBusNamesChanged. Represents the participants in a multi-user D-Bus tube, as used by the DBusNames property and the DBusNamesChanged signal. The handle of a participant in this D-Bus tube. That participant's unique name.

A list of the access control types that are supported with this channel. Note that only Socket_Access_Control_Localhost and Socket_Access_Control_Credentials can be used with D-Bus tubes. Using Socket_Access_Control_Credentials is recommended.

Socket_Access_Control_Credentials is easy to implement for a D-Bus tube, because typical D-Bus library implementations like libdbus and GDBus already have to support it to be able to connect to the system or session bus, and usually enable it by default; so there's typically no good reason to relax access control to Localhost.

When requesting a channel with Connection.Interface.Requests.CreateChannel, this property MUST NOT be included in the request.

telepathy-glib-0.24.2/spec/Client_Handler.xml0000644000175000017500000003732312652510705015774 00000000000000 Copyright © 2008-2009 Collabora Ltd. Copyright © 2008-2009 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as a stable interface)

Handlers are the user interface for a channel. They turn an abstract Telepathy channel into something the user wants to see, like a text message stream or an audio and/or video call.

For its entire lifetime, each channel on a connection known to the channel dispatcher is either being processed by the channel dispatcher, or being handled by precisely one Handler.

Because each channel is only handled by one Handler, handlers may perform actions that only make sense to do once, such as acknowledging Text messages, doing the actual streaming for StreamedMedia channels with the MediaSignalling interface, or transferring the file in FileTransfer channels.

When a new incoming channel (one with Requested = FALSE) is offered to Approvers by the channel dispatcher, it also offers the Approvers a list of all the running or activatable handlers whose HandlerChannelFilter property (possibly as cached in the .client file) indicates that they are able to handle the channel. The Approvers can choose one of those channel handlers to handle the channel.

When a new outgoing channel (one with Requested = TRUE) appears, the channel dispatcher passes it to an appropriate channel handler automatically.

A specification of the channels that this channel handler can deal with. It will be offered to approvers as a potential channel handler for bundles that contain only suitable channels, or for suitable channels that must be handled separately.

This property works in exactly the same way as the Client.Observer.ObserverChannelFilter property. In particular, it cannot change while the handler process continues to own the corresponding Client bus name.

In the .client file, it is represented in the same way as ObserverChannelFilter, but the group has the same name as this interface and the keys start with HandlerChannelFilter instead of ObserverChannelFilter.

If true, channels destined for this handler are automatically handled, without invoking approvers.

The intended usage is to allow a client handling one channel to pick up closely related channels. Suppose a client capable of handling both Text and StreamedMedia, org.freedesktop.Telepathy.Client.Empathy, is handling a StreamedMedia channel. That client can take a second well-known bus name, say org.freedesktop.Telepathy.Client.Empathy._1._42.Bundle1, and configure an object at /org/freedesktop/Telepathy/Client/Empathy/_1/_42/Bundle1 with BypassApproval = TRUE, whose HandlerChannelFilter matches closely related Text channels by their Bundle property.

For service-activatable handlers, this property should be specified in the handler's .client file as follows:

[org.freedesktop.Telepathy.Client.Handler]
BypassApproval=true
A DBus_Interface, followed by a slash '/' character and an identifier for a capability defined by that interface. The capability identifier SHOULD be in lower case. If an interface references an external specification which is case-insensitive (such as MIME), then names from that specification MUST be normalized to lower-case before providing them to this Telepathy API, so that implementations can safely rely on simple byte-by-byte comparison. These aren't D-Bus core Properties, and we want them to look visibly different.

So far, all client capabilities are defined by the MediaSignalling interface.

The set of additional capabilities supported by this handler. This describes things like support for streamed media codecs and NAT traversal mechanisms: see the Contact Capabilities interface for more details.

For handlers that have a .client file, the channel dispatcher may discover this property from the org.freedesktop.Telepathy.Client.Handler.Capabilities group; for each capability, that group contains a key whose name is the capability, with value true. Keys with other values SHOULD NOT appear in this group.

For instance, the .client file for a streamed media handler that supports ICE-UDP NAT traversal, Speex audio, and Theora and H264 video might contain this group:

[org.freedesktop.Telepathy.Client.Handler.Capabilities]
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/ice-udp=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/audio/speex=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/theora=true
org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/video/h264=true

Like the HandlerChannelFilter property, this property cannot change while the Handler owns its Client bus name. However, the .client file, if any, can change (due to upgrades or installation of pluggable codecs), and the capabilities really supported by the handler might not exactly match what is cached in the .client file.

The client file is installed statically and is intended to list codecs etc. that the handler guarantees it can support (e.g. by having a hard dependency on them), whereas the running handler process might be able to find additional codecs.

Called by the channel dispatcher when this client should handle these channels, or when this client should present channels that it is already handling to the user (e.g. bring them into the foreground).

Clients are expected to know what channels they're already handling, and which channel object path corresponds to which window or tab. This can easily be done using a hash table keyed by channels' object paths.

This method can raise any D-Bus error. If it does, the handler is assumed to have failed or crashed, and the channel dispatcher MUST recover in an implementation-specific way; it MAY attempt to dispatch the channels to another handler, or close the channels.

If closing the channels, it is RECOMMENDED that the channel dispatcher attempts to close the channels using Channel.Close, but resorts to calling Channel.Interface.Destroyable.Destroy (if available) or ignoring the channel (if not) if the same handler repeatedly fails to handle channels.

After HandleChannels returns successfully, the client process is considered to be responsible for the channel until it its unique name disappears from the bus.

If a process has multiple Client bus names - some temporary and some long-lived - and drops one of the temporary bus names in order to reduce the set of channels that it will handle, any channels that it is already handling should remain unaffected.

The Account with which the channels are associated. The well-known bus name to use is that of the AccountManager. The Connection with which the channels are associated. The well-known bus name to use can be derived from this object path by removing the leading '/' and replacing all subsequent '/' by '.'. The channels and their immutable properties. Their well-known bus name is the same as that of the Connection.

The requests satisfied by these channels.

If the handler implements Requests, this tells it that these channels match previous AddRequest calls that it may have received.

There can be more than one, if they were EnsureChannel requests.

The time at which user action occurred, or 0 if this channel is to be handled for some reason not involving user action. Handlers SHOULD use this for focus-stealing prevention, if applicable. This property has the same semantic as User_Action_Timestamp but is unsigned for historical reasons.

Additional information about these channels. Currently defined keys are:

request-properties - a{oa{sv}}
A map from ChannelRequest paths listed in Requests_Satisfied to Qualified_Property_Value_Maps containing namespaced immutable properties of each request.

When more keys are defined for this dictionary, all will be optional; handlers MAY safely ignore any entry in this dictionary.

A list of the channels that this process is currently handling.

There is no change notification.

This property exists for state recovery - it makes it possible for channel handling to survive a ChannelDispatcher crash.

If the channel dispatcher is automatically replaced, the replacement can discover all Handlers by looking for the Client well-known bus names, and discover which channels they are currently handling. Once this has been done, all unhandled channels can be re-dispatched, and the only issue visible to the user is that unhandled channels that they have already approved might be sent back to Approvers.

The value of this property SHOULD be the same for all Client instances that share a unique bus name, and SHOULD include all channels that are being handled, even if they were conceptually handled by a different Client instance.

Otherwise, when a process released a temporary Client name, channels that it handled because of that Client name would no longer be state-recoverable.

telepathy-glib-0.24.2/spec/Channel_Interface_SASL_Authentication.xml0000644000175000017500000010344312652510705022327 00000000000000 Copyright © 2010 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

A channel interface for SASL authentication, as defined by RFC 4422. When this interface appears on a ServerAuthentication channel, it represents authentication with the server. In future, it could also be used to authenticate with secondary services, or even to authenticate end-to-end connections with contacts. As a result, this interface does not REQUIRE ServerAuthentication to allow for a potential future Channel.Type.PeerAuthentication interface.

In any protocol that requires a password, the connection manager can use this channel to let a user interface carry out a simple SASL-like handshake with it, as a way to get the user's credentials interactively. This can be used to connect to protocols that may require a password, without requiring that the password is saved in the Account.Parameters.

In some protocols, such as XMPP, authentication with the server is also carried out using SASL. In these protocols, a channel with this interface can provide a simple 1:1 mapping of the SASL negotiations taking place in the protocol, allowing more advanced clients to perform authentication via SASL mechanisms not known to the connection manager.

By providing SASL directly when the protocol supports it, we can use mechanisms like Kerberos or Google's X-GOOGLE-TOKEN without specific support in the connection manager.

For channels managed by a ChannelDispatcher, only the channel's Handler may call the methods on this interface. Other clients MAY observe the authentication process by watching its signals and properties.

There can only be one Handler, which is a good fit for SASL's 1-1 conversation between a client and a server.

A SASL mechanism, as defined by RFC 4422 and registered in the IANA registry of SASL mechanisms, or an unregistered SASL mechanism such as X-GOOGLE-TOKEN used in the same contexts.

As a special case, pseudo-mechanisms starting with X-TELEPATHY- are defined by this specification. Use of these pseudo-mechanisms indicates that the user's credentials are to be passed to the connection manager, which will then use them for authentication with the service, either by implementing the client side of some SASL mechanisms itself or by using a non-SASL protocol. The only such pseudo-mechanism currently defined is X-TELEPATHY-PASSWORD.

The X-TELEPATHY-PASSWORD mechanism is extremely simple:

  • The client MUST call StartMechanismWithData, with Initial_Data set to the password encoded in UTF-8. For simplicity, calling StartMechanism followed by calling Respond is not allowed in this mechanism.
  • The connection manager uses the password, together with authentication details from the Connection parameters, to authenticate itself to the server.
  • When the connection manager finishes its attempt to authenticate to the server, the channel's state changes to either SASL_Status_Server_Succeeded or SASL_Status_Server_Failed as appropriate.

The SASL mechanisms as offered by the server, plus any pseudo-SASL mechanisms supported by the connection manager for credentials transfer. For instance, in a protocol that natively uses SASL (like XMPP), this might be [ "X-TELEPATHY-PASSWORD", "PLAIN", "DIGEST-MD5", "SCRAM-SHA-1" ].

To make it possible to implement a very simple password-querying user interface without knowledge of any particular SASL mechanism, implementations of this interface MUST implement the pseudo-mechanism X-TELEPATHY-PASSWORD, unless none of the available mechanisms use a password at all.

If true, StartMechanismWithData can be expected to work for SASL mechanisms not starting with X-TELEPATHY- (this is the case in most, but not all, protocols). If false, StartMechanism must be used instead.

This property does not affect the X-TELEPATHY- pseudo-mechanisms such as X-TELEPATHY-PASSWORD, which can use StartMechanismWithData regardless of the value of this property.

If true, StartMechanism and (if supported) StartMechanismWithData can be expected to work when in one of the Failed states. If false, the only thing you can do after failure is to close the channel.

Retrying isn't required to work, although some protocols and implementations allow it.

The current status of this channel. Change notification is via the SASLStatusChanged signal.

The reason for the SASLStatus, or an empty string if the state is neither Server_Failed nor Client_Failed.

In particular, an ordinary authentication failure (as would be produced for an incorrect password) SHOULD be represented by AuthenticationFailed, cancellation by the user's request SHOULD be represented by Cancelled, and cancellation by a local process due to inconsistent or invalid challenges from the server SHOULD be represented by ServiceConfused.

If this interface appears on a ServerAuthentication channel, and connection to the server fails with an authentication failure, this error code SHOULD be copied into the Connection.ConnectionError signal.

If SASLError is non-empty, any additional information about the last disconnection; otherwise, the empty map. The keys and values are the same as for the second argument of Connection.ConnectionError.

If this interface appears on a ServerAuthentication channel, and connection to the server fails with an authentication failure, these details SHOULD be copied into the Connection.ConnectionError signal.

The identity for which authorization is being attempted, typically the 'account' from the RequestConnection parameters, normalized and formatted according to the conventions used for SASL in this protocol.

The normalization used for SASL might not be the same normalization used elsewhere: for instance, in a protocol with email-like identifiers such as XMPP or SIP, the user "juliet@example.com" might have to authenticate to the example.com server via SASL PLAIN as "juliet".

This is usually achieved by using the authorization identity for authentication, but an advanced Handler could offer the option to authenticate under a different identity.

The terminology used here is that the authorization identity is who you want to act as, and the authentication identity is used to prove that you may do so. For instance, if Juliet is authorized to access a role account, "sysadmin@example.com", and act on its behalf, it might be possible to authenticate as "juliet@example.com" with her own password, but request to be authorized as "sysadmin@example.com" instead of her own account. See RFC 4422 §3.4.1 for more details.

In SASL the authorization identity is normally guessed from the authentication identity, but the information available to the connection manager is the identity for which authorization is required, such as the desired JID in XMPP, so that's what we signal to UIs; it's up to the UI to choose whether to authenticate as the authorization identity or some other identity.

As a concrete example, the "sysadmin" XMPP account mentioned above would have { 'account': 'sysadmin@example.com' } in its Parameters, and this property would also be 'sysadmin@example.com'. A simple Handler would merely prompt for sysadmin@example.com's password, and use that JID as both the authorization and authentication identity, which might result in SASL PLAIN authentication with the initial response '\000sysadmin@example.com\000root'.

A more advanced Handler might also ask for an authentication identity, defaulting to 'sysadmin@example.com'; if Juliet provided authentication identity 'juliet@example.com' and password 'romeo', the Handler might perform SASL PLAIN authentication using the initial response 'sysadmin@example.com\000juliet@example.com\000romeo'.

The default username for use with SASL mechanisms that deal with a "simple username" (as defined in RFC 4422). If such a SASL mechanism is in use, clients SHOULD default to using the DefaultUsername; also, if the client uses the DefaultUsername, it SHOULD assume that the authorization identity AuthorizationIdentity will be derived from it by the server.

In XMPP, servers typically expect "user@example.com" to authenticate with username "user"; this was a SHOULD in RFC 3920.

3920bis weakens that SHOULD to "in the absence of local information provided by the server, an XMPP client SHOULD assume that the authentication identity for such a SASL mechanism is the combination of a user name and password, where the simple user name is the localpart of the user's JID".

For example, in the simple case, if the user connects with RequestConnection({ account: "user@example.com" }) and use PLAIN with password "password", he or she should authenticate like so: "\0user\0password" and the channel will look like this:

{ "...DefaultUsername": "user",
  "...AuthorizationIdentity": "user@example.com }

In the complex case, if the same user is using his or her sysadmin powers to log in as the "announcements" role address, he or she would connect with RequestConnection({ account: "announcements@example.com" }) and the SASL channel would look like this:

{ "...DefaultUsername": "announcements",
  "...AuthorizationIdentity": "announcements@example.com }

A sufficiently elaborate UI could give the opportunity to override the username from "announcements" to "user". The user's simple username is still "user", and the password is still "password", but this time he or she is trying to authorize to act as announcements@example.com, so the UI would have to perform SASL PLAIN with this string: "announcements@example.com\0user\0password", where "announcements@example.com" is the AuthorizationIdentity.

The default realm (as defined in RFC 2831) to use for authentication, if the server does not supply one.

The server is not required to provide a realm; if it doesn't, the client is expected to ask the user or provide a sensible default, typically the requested DNS name of the server. In some implementations of DIGEST-MD5, the server does not specify a realm, but expects that the client will choose a particular default, and authentication will fail if the client's default is different. Connection managers for protocols where this occurs are more easily able to work around these implementations than a generic client would be.

Whether or not the client can save the authentication response and re-use it to automate future authentication challenges.

If this property is False, the client SHOULD NOT attempt to cache the authentication response in its own keyring.

If this property is not specified, it should be treated as if it were True.

Some protocols or services may have terms and conditions that prohibit caching a user's credentials.
The chosen mechanism.

Start an authentication try using Mechanism, without sending initial data (an "initial response" as defined in RFC 4422).

This method is appropriate for mechanisms where the client cannot send anything until it receives a challenge from the server, such as DIGEST-MD5 in "initial authentication" mode.

The channel is not in a state where starting authentication makes sense (i.e. SASL_Status_Not_Started, or (if CanTryAgain is true) SASL_Status_Server_Failed or SASL_Status_Client_Failed). You should call AbortSASL and wait for SASL_Status_Client_Failed before starting another attempt. The server or connection manager doesn't implement the given SASL mechanism. Choose a SASL mechanism from AvailableMechanisms, or abort authentication if none of them are suitable.
The chosen mechanism. Initial data (an "initial response" in RFC 4422's terminology) to send with the mechanism.

Start an authentication try using Mechanism, and send Initial_Data as the "initial response" defined in RFC 4422 §3.3.

This method is appropriate for mechanisms where the client may send data first, such as PLAIN, or must send data first, such as DIGEST-MD5 in "subsequent authentication" mode.

Having two methods allows any mechanism where it makes a difference to distinguish between the absence of an initial response (StartMechanism) and a zero-byte initial response (StartMechanismWithData, with Initial_Data empty).

If the HasInitialData property is false, this indicates that the underlying protocol does not make it possible to send initial data. In such protocols, this method may only be used for the X-TELEPATHY- pseudo-mechanisms (such as X-TELEPATHY-PASSWORD), and will fail if used with an ordinary SASL mechanism.

For instance, the IRC SASL extension implemented in Charybdis and Atheme does not support initial data - the first message in the exchange only carries the mechanism. This is significant if using DIGEST-MD5, which cannot be used in the faster "subsequent authentication" mode on a protocol not supporting initial data.

The channel is not in a state where starting authentication makes sense (i.e. SASL_Status_Not_Started, or (if CanTryAgain is true) SASL_Status_Server_Failed or SASL_Status_Client_Failed). You should call AbortSASL and wait for SASL_Status_Client_Failed before starting another attempt. The server or connection manager doesn't implement the given SASL mechanism (choose one from AvailableMechanisms, or abort authentication if none of them are suitable), or doesn't allow initial data to be sent (as indicated by HasInitialData; call StartMechanism instead).
The response data.

Send a response to the the last challenge received via NewChallenge.

Either the state is not In_Progress, or no challenge has been received yet, or you have already responded to the last challenge.

If the channel's status is SASL_Status_Server_Succeeded, this method confirms successful authentication and advances the status of the channel to SASL_Status_Succeeded.

If the channel's status is SASL_Status_In_Progress, calling this method indicates that the last NewChallenge signal was in fact additional data sent after a successful SASL negotiation, and declares that from the client's point of view, authentication was successful. This advances the state of the channel to SASL_Status_Client_Accepted.

In mechanisms where the server authenticates itself to the client, calling this method indicates that the client considers this to have been successful. In the case of ServerAuthentication channels, this means that the connection manager MAY continue to connect, and MAY advance the Connection.Status to Connected.

Either the state is neither In_Progress nor Server_Succeeded, or no challenge has been received yet, or you have already responded to the last challenge.
Reason for abort. Debug message for abort.

Abort the current authentication try.

If the current status is SASL_Status_Server_Failed or SASL_Status_Client_Failed, this method returns successfully, but has no further effect. If the current status is SASL_Status_Succeeded or SASL_Status_Client_Accepted then NotAvailable is raised. Otherwise, it changes the channel's state to SASL_Status_Client_Failed, with an appropriate error name and reason code.

The current state is either Succeeded or Client_Accepted.
Emitted when the status of the channel changes. The new value of SASLStatus. The new value of SASLError. The new value of SASLErrorDetails.

Emitted when a new challenge is received from the server, or when a message indicating successful authentication and containing additional data is received from the server.

When the channel's handler is ready to proceed, it should respond to the challenge by calling Respond, or respond to the additional data by calling AcceptSASL. Alternatively, it may call AbortSASL to abort authentication.

The challenge data or additional data from the server.

A reason why SASL authentication was aborted by the client.

The server sent an invalid challenge or data. The user aborted the authentication.
The initial state. The Handler SHOULD either call AbortSASL, or connect to the NewChallenge signal then call StartMechanism or StartMechanismWithData. The challenge/response exchange is in progress. The Handler SHOULD call either Respond or AcceptSASL exactly once per emission of NewChallenge, or call AbortSASL at any time. The server has indicated successful authentication, and the connection manager is waiting for confirmation from the Handler. The Handler must call either AcceptSASL or AbortSASL to indicate whether it considers authentication to have been successful. The Handler has indicated successful authentication, and the connection manager is waiting for confirmation from the server. The state will progress to either Succeeded or Server_Failed when confirmation is received. Everyone is happy (the server sent success, and the client has called AcceptSASL). Connection to the server will proceed as soon as this state is reached. The Handler SHOULD call Close to close the channel. The server has indicated an authentication failure. If CanTryAgain is true, the client may try to authenticate again, by calling StartMechanism or StartMechanismWithData again. Otherwise, it should give up completely, by calling Close on the channel. The client has indicated an authentication failure. The possible actions are the same as for Server_Failed.
telepathy-glib-0.24.2/spec/Connection_Interface_Requests.xml0000644000175000017500000007171612652510705021077 00000000000000 Copyright (C) 2008 Collabora Limited Copyright (C) 2008 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An enhanced version of the Telepathy connection interface, which can represent bundles of channels that should be dispatched together, and does not assume any particular properties by which channels are uniquely identifiable.

If this interface is implemented on a connection, then NewChannels MUST be emitted for all new channels, even those created with RequestChannel.

(as stable API) Enough details of a channel that clients can work out how to dispatch or handle it. The object path of the channel.

Properties of the channel.

Connection managers MUST NOT include properties in this mapping if their values can change. Clients MUST ignore properties that appear in this mapping if their values can change.

If properties that could change were included, the following race condition would be likely to exist in some cases:

  • NewChannels or Get("Channels") includes a property P with value V1
  • Client creates a proxy object for the channel
  • The value of P changes to V2
  • Client connects to PChanged signal
  • Client should call Get("P") or GetAll here, to avoid the race, but client's author has forgotten to do so
  • Proxy object thinks P == V1, but actually P == V2

We've taken the opportunity to make the API encourage the client author to get it right. Where possible, we intend that properties whose value will be used in channel dispatching or other "early" processing will be defined so that they are immutable (can never change).

Each dictionary MUST contain the keys org.freedesktop.Telepathy.Channel.ChannelType, org.freedesktop.Telepathy.Channel.TargetHandleType, org.freedesktop.Telepathy.Channel.TargetHandle, org.freedesktop.Telepathy.Channel.TargetID and org.freedesktop.Telepathy.Channel.Requested.

We expect these to be crucial to the channel-dispatching process.

(as stable API) It is now guaranteed that CreateChannel returns the channel before NewChannels announces it (the reverse was previously guaranteed).

Request that an entirely new channel is created.

There is deliberately no flag corresponding to the suppress_handler argument to Connection.RequestChannel, because passing a FALSE value for that argument is deprecated. Requests made using this interface always behave as though suppress_handler was TRUE.

A dictionary containing desirable properties, which MUST include ChannelType. Some properties are defined such that only an exact match makes sense, and connection managers MUST NOT satisfy a request with a channel where that property does not match; some properties are defined such that the connection manager MAY treat the request as merely a hint, and make a best-effort attempt to satisfy it. This is documented separately for each property.

If this dictionary contains a property whose semantics are not known to the connection manager, this method MUST fail without side-effects (in particular it must not create a new channel).

This is necessary if we want to be able to invent properties in future that, when used in a request, are hard requirements rather than just hints. A connection manager that did not know the semantics of those properties could incorrectly return a new channel that did not satisfy the requirements.

The connection manager MUST NOT respond successfully, and SHOULD NOT create a new channel or cause any other side-effects, unless it can create a new channel that satisfies the client's requirements.

Properties that will be set by this argument need not have write access after the channel has been created - indeed, it is expected that most will be read-only.

The Channel object, which MUST NOT be signalled with NewChannels until after this method returns.

This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.

Properties of the channel that was produced, equivalent to the properties in Channel_Details. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in Channel_Details.

The channel request was one that can never succeed, such as requesting an unsupported channel type, or requesting a channel type which this connection manager does not support with the given target handle type. An invalid handle was requested as the value of a property whose value is a handle (like Channel.TargetHandle), or a syntactically invalid identifier was requested as the value of a property whose value is the string corresponding to a handle (like Channel.TargetID). The request matched the fixed properties of a Requestable_Channel_Class in RequestableChannelClasses, but the allowed arguments did not make sense; for example, a RoomList was requested, but the Server property provided was not a valid DNS name. The requested channel cannot be created because the requested contact is using a client that lacks a particular feature. The requested channel cannot be created because the target is offline.

The requested channel cannot be created, but in principle, a similar request might succeed in future. For instance, this might be because:

  • a channel matching the request already exists and the protocol requires that only one such channel can exist at a time
  • a channel matching the request has already been requested (by a previous call to CreateChannel, EnsureChannel, Connection.RequestChannel or similar) and the protocol requires that only one such channel can exist at a time
It is now guaranteed that if the channel was created by this call to EnsureChannel, it's returned before NewChannels announces it (the reverse was previously guaranteed).

Request that channels are ensured to exist.

The connection manager is in the best position to determine which existing channels could satisfy which requests.

A dictionary containing desirable properties, with the same semantics as the corresponding parameter to CreateChannel.

If false, the caller of EnsureChannel MUST assume that some other process is handling this channel; if true, the caller of EnsureChannel SHOULD handle it themselves or delegate it to another client.

If the creation of a channel makes several calls to EnsureChannel (and no other requests) successful, exactly one of those calls MUST return a true value for this argument.

If the creation of a channel makes other requests successful, the value returned for this argument MUST be such that exactly one of the clients making requests ends up responsible for the channel. In particular, if CreateChannel returns a channel C, any EnsureChannel calls that also return C MUST return a false value for this argument.

The Channel object. If it was created as a result of this method call, it MUST NOT be signalled by NewChannels until after this method returns.

This allows the requester to alter its handling of NewChannels by knowing whether one of the channels satisfied a request it made.

Properties of the channel that was produced, equivalent to the properties in Channel_Details. Connection managers MUST NOT include properties here whose values can change, for the same reasons as in Channel_Details.

The channel request was one that can never succeed, such as requesting an unsupported channel type, or requesting a channel type which this connection manager does not support with the given target handle type. An invalid handle was requested as the value of a property whose value is a handle (like Channel.TargetHandle), or a syntactically invalid identifier was requested as the value of a property whose value is the string corresponding to a handle (like Channel.TargetID). The request matched the fixed properties of a Requestable_Channel_Class in RequestableChannelClasses, but the allowed arguments did not make sense; for example, a RoomList was requested, but the Server property provided was not a valid DNS name. The requested channel cannot be created because the requested contact is using a client that lacks a particular feature. The requested channel cannot be created because the target is offline. The requested channel cannot be created, but in principle, a similar request might succeed in future.
(as stable API) Added a guarantee of ordering relative to NewChannel

New channels have been created. The connection manager SHOULD emit a single signal for any group of closely related channels that are created at the same time, so that the channel dispatcher can try to dispatch them to a handler as a unit.

In particular, if additional channels are created as a side-effect of a call to CreateChannel, these channels SHOULD appear in the same NewChannels signal as the channel that satisfies the request.

Joining a MUC Tube in XMPP requires joining the corresponding MUC (chatroom), so a Text channel can be created as a side-effect.

Every time NewChannels is emitted, it MUST be followed by a Connection.NewChannel signal for each channel.

The double signal emission is for the benefit of older Telepathy clients, which won't be listening for NewChannels.

The more informative NewChannels signal comes first so that clients that did not examine the connection to find out whether Requests is supported will see the more informative signal for each channel first, and then ignore the less informative signal because it announces a new channel of which they are already aware.

The channels and their details. All channels that are signalled together like this MUST have the same Bundle property, which may either refer to an existing bundle, or establish a new bundle.
(as stable API) A list of all the channels which currently exist on this connection. Change notification is via the NewChannels and ChannelClosed signals. (as stable API) Emitted when a channel is closed and hence disappears from the Channels property. This is redundant with the Closed signal on the channel itself, but it does provide full change notification for the Channels property. The channel which has been removed from the Channels property (as stable API)

Mapping representing a class of channels that can be requested from a connection manager, can be handled by a user interface, are supported by a contact, etc.

Classes of channel are identified by the fixed values of a subset of their properties.

Channel classes SHOULD always include the keys org.freedesktop.Telepathy.Channel.ChannelType and org.freedesktop.Telepathy.Channel.TargetHandleType. (One exception is that ContactSearch channels do not have TargetHandleType None in their requestable channel classes, for historical reasons.)

A D-Bus interface name, followed by a dot and a D-Bus property name. The value of the property.
(as stable API)

Structure representing a class of channels that can be requested, identified by a set of properties that identify that class of channel.

This will often just be the channel type and the handle type, but can include other properties of the channel - for instance, encrypted channels might require properties that unencrypted channels do not, like an encryption key.

In some cases, these classes of channel may overlap, in the sense that one class fixes all the properties that another class does, plus some more properties.

For older clients to still be able to understand how to request channels in the presence of a hypothetical "encryption" interface, we'd need to represent it like this:

  • class 1: ChannelType = Text, TargetHandleType = CONTACT
  • class 2: Channel.ChannelType = Text, Channel.TargetHandleType = CONTACT, Encryption.Encrypted = TRUE

The property values that identify this requestable channel class. These properties MUST be included in requests for a channel of this class, and MUST take these values.

Clients that do not understand the semantics of all the Fixed_Properties MUST NOT request channels of this class, since they would be unable to avoid making an incorrect request.

This implies that connection managers wishing to make channels available to old or minimal clients SHOULD have a channel class with the minimum number of Fixed_Properties, and MAY additionally have channel classes with extra Fixed_Properties.

Interface designers SHOULD avoid introducing fixed properties whose types are not serializable in a .manager file.

Connection managers with a fixed property that is not serializable cannot have a complete .manager file.

Properties that MAY be set when requesting a channel of this channel type and handle type.

This array MUST NOT include properties that are in the Fixed_Properties mapping.

Properties in this array may either be required or optional, according to their documented semantics.

For instance, if TargetHandleType takes a value that is not Handle_Type_None, one or the other of TargetHandle and TargetID is required. Clients are expected to understand the documented relationship between the properties, so we do not have separate arrays of required and optional properties.

If this array contains the Bundle property, then this class of channel can be combined with other channels with that property in a request, or added to an existing bundle. If not, this signifies that the connection manager is unable to mark channels of this class as part of a bundle - this means that to the remote contact they are likely to be indistinguishable from channels requested separately.

(as stable API)

The classes of channel that are expected to be available on this connection, i.e. those for which CreateChannel can reasonably be expected to succeed. User interfaces can use this information to show or hide UI components.

This property cannot change after the connection has gone to state Connection_Status_Connected, so there is no change notification (if the connection has context-dependent capabilities, it SHOULD advertise support for all classes of channel that it might support during its lifetime). Before this state has been reached, the value of this property is undefined.

This is not on an optional interface, because connection managers can always offer some sort of clue about the channel classes they expect to support (at worst, they can announce support for everything for which they have code).

telepathy-glib-0.24.2/spec/Channel_Interface_Anonymity.xml0000644000175000017500000000606012652510705020512 00000000000000 Copyright © 2008-2010 Nokia Corporation Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

Interface for requesting the anonymity modes of a channel (as defined in Connection.Interface.Anonymity).

The list of initially requested anonymity modes on the channel. This MUST NOT change, and is Requestable. Whether or not the anonymity settings are required for this channel. This MUST NOT change, and is Requestable.

This is the ID that the remote user of the channel MAY see (assuming there's a single ID). For example, for SIP connections where the From address has been scrambled by the CM, the scrambled address would be available here for the client to see. This is completely optional, and MAY be an empty string ("") in cases where anonymity modes are not set, or the CM doesn't know what the remote contact will see, or any other case where this doesn't make sense.

This MAY change over the lifetime of the channel, and SHOULD NOT be used with the Request interface.

telepathy-glib-0.24.2/spec/Channel_Interface_Captcha_Authentication.xml0000644000175000017500000005561012652510705023132 00000000000000 Copyright © 2010-2012 Collabora Limited

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(version 1)

A channel interface for captcha authentication. When this interface appears on a ServerAuthentication channel, it represents authentication with the server. In future, it could also be used to authenticate with secondary services, or even to authenticate end-to-end connections with contacts. As a result, this interface does not REQUIRE ServerAuthentication to allow for a potential future Channel.Type.PeerAuthentication interface.

In any protocol that requires a captcha, the connection manager can use this channel to let a user interface carry out a simple captcha handshake with it, as a way to test the user is human interactively.

For channels managed by a ChannelDispatcher, only the channel's Handler may call the methods on this interface. Other clients MAY observe the authentication process by watching its signals and properties.

The most commonly used form of captcha challenge is OCR (recognition of distorted letters or words in an image), but for accessibility reasons, this interface also allows various other types of challenge, such as plain-text questions or recognition of words in audio. Its structure is modelled on XMPP's XEP-0158, but can be used with other protocols by mapping their semantics into those used in XMPP.

It is important to support multiple types of captcha challenge to avoid discriminating against certain users; for instance, blind or partially-sighted users cannot be expected to answer an OCR challenge.

XEP-0158 supports a superset of all other known protocols' captcha interfaces, and is sufficiently elaborate that we expect it will continue to do so.

There can only be one Handler, which is a good fit for the question/answer model implied by captchas.

A struct containing information regarding a single captcha mechanism.

The ID with which to reference this captcha method when retrieving its data and answering it. They are unique within this channel instance only.

The type of challenge as defined by XEP-0158. For instance, the commonly-used "type the letters/words you see in this image" challenge is represented by ocr

A human-readable label for the challenge, as defined in XEP-0158.

If the server does not supply a label for a challenge of type other than qa, connection managers SHOULD set Label to an empty string instead of generating their own text. If the Label is an empty string, the Handler SHOULD replace it with a generic label in the user's locale, such as the strings suggested in XEP-0158 (for instance, Enter the text you see for ocr challenges). The Handler MAY use those generic labels in any case, as per the Internationalization Considerations section of XEP-0158.

Connection managers are not usually localized, so text generated by the connection manager would be in English, regardless of the user's locale. The Handler is better-placed to generate a generic Label in the user's locale.

For challenges of type qa, the Label is a plain-text question for the user to answer. The connection manager SHOULD NOT provide an empty Label; if it does, the Handler SHOULD treat that challenge as impossible, and SHOULD NOT attempt to display it.

One flag defined: Required. Most captchas will have no flags.

A list of MIME types the server is offering to provide for this captcha method.

A mapping of captcha IDs to answer strings. The ID of the captcha to which the associated answer string is answering. The answer string to answer the captcha referenced by the associated ID.

If true, GetCaptchas can be expected to return new captcha information when in the Local_Pending state. If false, GetCaptchas will return NotAvailable on subsequent calls.

Refreshing the captcha isn't required to work, although some protocols and implementations allow it. This is usually done in case a given captcha is unintelligible.

The current status of this channel.

Because only the Handler should call methods on this interface, the Handler MAY reduce round-trips by not fetching the initial value of this property, and instead assume that is initially Local_Pending.

This assumption normally avoids the need to call GetAll(), since the values of CaptchaError and CaptchaErrorDetails are also implied by this assumption, and the only other property is CanRetryCaptcha, which is immutable.

The reason for the CaptchaStatus, or an empty string if the state is neither Try_Again nor Failed.

Typical values: "", Cancelled, AuthenticationFailed, CaptchaNotSupported

In particular, an ordinary authentication failure (as would be produced for an incorrect answer) SHOULD be represented by AuthenticationFailed, cancellation by the user's request SHOULD be represented by Cancelled, cancellation due to the inability to display the captcha to the user or otherwise answer it SHOULD be represented by CaptchaNotSupported, and cancellation by a local process due to inconsistent or invalid challenges from the server SHOULD be represented by ServiceConfused.

If this interface appears on a ServerAuthentication channel, and connection to the server fails with an authentication failure, this error code SHOULD be copied into the Connection.ConnectionError signal.

If CaptchaError is non-empty, any additional information about the last disconnection; otherwise, the empty map. The keys and values are the same as for the second argument of Connection.ConnectionError.

If this interface appears on a ServerAuthentication channel, and connection to the server fails with an authentication failure, these details SHOULD be copied into the Connection.ConnectionError signal.

Information about each of the available captcha methods. The number of captcha methods required to be answered in order to successfully complete this captcha challenge (most frequently 1, but XMPP allows servers to demand that more than one captcha is answered). The language of each Label in Captcha_Info if available, for instance en_US, or "" if unknown.

Gets information regarding each of the captcha methods available and which and how many need to be successfully answered

To call this method successfully, the state must be Local_Pending or Try_Again. If it is Local_Pending, it remains Local_Pending. If called more than once while in Local_Pending state, or if the state is Try_Again, this method fetches a new set of captcha challenges, if possible, and the state returns to Local_Pending.

For instance, you could call GetCaptchas again from Local_Pending state if the user indicates that they can't understand the initially-offered captcha.

This is a method, not a property, so that it can be used to fetch more than one set of captcha challenges, and so that change notification is not required. Only the Handler should call this method and calling GetAll would not reduce round-trips, so the usual reasons to prefer a property do not apply here.

Either the state is not Local_Pending or Try_Again, or it has already been called and CanRetryCaptcha is False.
The ID of the captcha of which to retrieve data. MIME type picked by the Handler, chosen from the list of MIME types received in GetCaptchas. XEP-0158 allows the same captcha to be made available in multiple formats, for instance the same spoken question as audio/x-wav, application/ogg and audio/speex. Captcha data as requested.

Fetch and return the captcha data. In protocols where captchas are downloaded out-of-band (for instance via HTTP), the connection manager is expected to do so.

Returns an empty array if the type was "qa"

If audio-based and image-based captchas are both available, we don't want to waste time downloading the audio until/unless the user asks to hear it. The extra D-Bus round-trips are not a problem, since they are expected to be quick compared with the time taken for the user to solve the captcha.

The state is not in Local_Pending or GetCaptchas had never been called.
The mapping of captcha IDs to answer strings.

Answer as many captchas as desired and/or required.

Callable in state Local_Pending only. State changes to Remote_Pending.

The state is not in Local_Pending.
Reason for cancelling. This MAY be used to choose an error response to the remote server, and SHOULD also be reflected in the CaptchaError. A textual description of the reason for cancelling, supplied by the Handler. This message SHOULD NOT be sent to the remote server, but SHOULD be copied into the 'debug-message' field of the CaptchaErrorDetails and ConnectionError.

Cancel. State changes to Failed with error NotAvailable or Cancelled if it isn't already Failed. All you can do now is to close the channel.

The current state is Failed.

Extra flags to include with Captcha information

This captcha mechanism is required to be successfully answered in order to pass this captcha challenge.

A reason why captcha authentication was aborted by the client.

The user aborted the authentication. If this is used, the CaptchaError SHOULD be set to Cancelled The Handler doesn't support the given/required captcha types. If this is used, the CaptchaError SHOULD be set to CaptchaNotSupported. This SHOULD also be used if Close is called before CancelCaptcha. If no Handler supports captcha channels, the ChannelDispatcher will just call Close, because it has no knowledge of specific channel types. The Handler doesn't understand the captcha data received. The challenger may be sending gibberish. If this is used, the CaptchaError SHOULD be set to ServiceConfused.
The challenge/response exchange is in progress and waiting for a local action. Call AnswerCaptchas to go to the Remote_Pending state, or call CancelCaptcha followed by Close to give up. The challenge/response exchange is in progress and waiting for a response from the server. Wait for a reply from the server, which will result in the Succeeded, Try_Again, or Failed state, or call CancelCaptcha followed by Close to give up. Everyone is happy. Connection to the server will proceed as soon as this state is reached. There is nothing useful to do in this state except to call Close to close the channel. The server has indicated an authentication failure. Call GetCaptchas again to get a new captcha, or CancelCaptcha followed by Close to give up. Authentication has failed in some way. There is nothing useful to do in this state except to close the channel with Close.
telepathy-glib-0.24.2/spec/Channel_Dispatcher_Interface_Messages1.xml0000644000175000017500000001714112652510705022523 00000000000000 Copyright (C) 2011-2013 Collabora Ltd. Copyright (C) 2011 Nokia Corporation

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

This interface allows DBus clients to use the ChannelDispatcher to send one-off text messages to a contact, identified by account and target ID, without requiring the caller to handle channels or be the primary message UI.

This enables entities other than the main UI to send messages to contacts.

The Account through which to communicate. The contact to send the message to. The parts of the message, the same as for Messages.SendMessage. Flags influencing how to send the message, the same as for Messages.SendMessage. An opaque token equivalent to the one returned by Messages.SendMessage.

Submit a message to the server for sending, like the Messages.SendMessage method.

If the Account is connected and a Text channel to the Target_ID already exists, this method is equivalent to sending the same message via that channel.

Otherwise, this method creates a channel (connecting the Account if appropriate), sends the desired message, and closes the channel as if via Channel.Close, without acknowledging any messages received on that channel during that time.

If any messages are received on that channel before it is closed, a correct connection manager implementation will reopen the channel when it is closed, resulting in those "rescued" messages being processed by the system's normal Handler for text channels. In particular, this deals with the situation where a successful or failed delivery report is received before the channel is closed.

Expecting a trivial client (perhaps a send-only IRC bot, or a simple SMS-sending API) to go through all those steps to send a message seems somewhat unreasonable. Having this as a method in the ChannelDispatcher lets it take some short-cuts if required, and centralizes the implementation to reduce the risk of mistakes that cause message loss.

The ChannelDispatcher SHOULD support this method for any connection manager that would accept channel requests of this form:

  {
    …Channel.ChannelType:
        …Channel.Type.Text,
    …Channel.TargetHandleType:
        Contact,
    …Channel.TargetID:
    Target_ID
  }

However, if the connection manager provides additional APIs (such as a way to open "send-only" channels), the ChannelDispatcher MAY use those: it is not required to use those exact request parameters.

This method may raise any error that would be raised by the Requests.EnsureChannel or Messages.SendMessage methods, or signalled by the Failed signal.

The connection manager does not implement Text channels that communicate with a named contact. The Target_ID was not syntactically valid for the Account's protocol. The requested message is malformed and cannot be sent. The requested channel cannot be created because the target is offline. The requested channel cannot be created, but in principle, a similar request might succeed in future.
telepathy-glib-0.24.2/spec/Channel_Interface_Securable.xml0000644000175000017500000000674312652510705020440 00000000000000 Copyright (C) 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

as stable API

This interface exists to expose security information about Channels. The two properties are sometimes immutable and can be used to make decisions on how cautious to be about transferring sensitive data. The special case of ServerAuthentication channels is one example of where the two properties are immutable.

For example, clients MAY use these properties to decide whether the PLAIN mechanism is acceptable for a SASLAuthentication channel.

True if this channel occurs over an encrypted connection. This does not imply that steps have been taken to avoid man-in-the-middle attacks.

For future support for RFC 5056 Channel Binding it is desirable to be able to use some SASL mechanisms over an encrypted connection to an unverified peer, which can prove that it is the desired destination during the SASL negotiation.

True if this channel occurs over a connection that is protected against tampering, and has been verified to be with the desired destination: for instance, one where TLS was previously negotiated, and the TLS certificate has been verified against a configured certificate authority or accepted by the user.

telepathy-glib-0.24.2/spec/Connection_Interface_Presence.xml0000644000175000017500000004154712652510705021027 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Mapping used in Last_Activity_And_Statuses and passed to SetStatus, representing a collection of statuses. Use of this mapping with more than one member is deprecated. Structure representing a contact's presence, containing a last-activity time (deprecated) and a Multiple_Status_Map. Mapping returned by GetPresence and signalled by PresenceUpdate, where the keys are contacts and the values represent their presences. The string identifier of the desired status A dictionary of optional parameter names mapped to their variant-boxed values Request that a single presence status is published for the user, along with any desired parameters. Changes will be indicated by PresenceUpdate signals being emitted. Request that all of a user's presence statuses be removed. Be aware that this request may simply result in the statuses being replaced by a default available status. Changes will be indicated by PresenceUpdate signals being emitted. An array of the contacts whose presence should be obtained Presence information in the same format as for the PresenceUpdate signal Get presence previously emitted by PresenceUpdate for the given contacts. Data is returned in the same structure as the PresenceUpdate signal. Using this method in favour of RequestPresence has the advantage that it will not wake up each client connected to the PresenceUpdate signal. A dictionary of string identifiers mapped to a struct for each status, containing:
  • a type value from one of the values above
  • a boolean to indicate if this status may be set on yourself
  • a boolean to indicate if this is an exclusive status which you may not set alongside any other
  • a dictionary of valid optional string argument names mapped to their types
Get a dictionary of the valid presence statuses for this connection. This is only available when online because only some statuses will be available on some servers.
A dictionary of contact handles mapped to a struct containing a UNIX timestamp of the last activity time (in UTC), and a dictionary mapping the contact's current status identifiers to a dictionary of optional parameter names mapped to their variant-boxed values This signal should be emitted when your own presence has been changed, or the presence of the member of any of the connection's channels has been changed, or when the presence requested by RequestPresence is available. The string identifier of the status not to publish anymore for the user Request that the given presence status is no longer published for the user. Changes will be indicated by PresenceUpdate signals being emitted. As with ClearStatus, removing a status may actually result in it being replaced by a default available status. The status requested is not currently set An array of the contacts whose presence should be obtained Request the presence for contacts on this connection. A PresenceUpdate signal will be emitted when they are received. This is not the same as subscribing to the presence of a contact, which must be done using the 'subscription' ContactList, and on some protocols presence information may not be available unless a subscription exists. The presence of the requested contacts is not reported to this connection A UNIX timestamp of the user's last activity time (in UTC) Request that the recorded last activity time for the user be updated on the server. This protocol has no concept of idle time A dictionary mapping status identifiers to dictionaries, which map optional parameter names to their variant-boxed values

Request that the user's presence be changed to the given statuses and desired parameters. Changes will be reflected by PresenceUpdate signals being emitted.

Statuses whose Connection_Presence_Type is Offline, Error or Unknown MUST NOT be passed to this function. Connection managers SHOULD reject these statuses.

The same rationale as for SimplePresence.SetPresence applies.

On certain protocols, this method may be called on a newly-created connection which is still in the DISCONNECTED state, and will sign on with the requested status. If the requested status is not available after signing on, NotAvailable will be returned and the connection will remain offline, or if the protocol does not support signing on with a certain status, Disconnected will be returned.

Client implementations SHOULD use SimplePresence instead. Connection managers implementing Presence MUST implement SimplePresence too.

This interface is for services which have a concept of presence which can be published for yourself and monitored on your contacts. Telepathy's definition of presence is based on that used by the Galago project.

Presence on an individual (yourself or one of your contacts) is modelled as a last activity time along with a set of zero or more statuses, each of which may have arbitrary key/value parameters. Valid statuses are defined per connection, and a list of them can be obtained with the GetStatuses method.

(The SimplePresence interface which replaces this one restricts presences to one status per contact, with an optional message, which is in practice all that was implemented on this interface.)

Each status has an arbitrary string identifier which should have an agreed meaning between the connection manager and any client which is expected to make use of it. The well-known values defined by the SimplePresence interface SHOULD be used where possible

As well as these well-known status identifiers, every status also has a numerical type value chosen from Connection_Presence_Type which can be used by the client to classify even unknown statuses into different fundamental types.

These numerical types exist so that even if a client does not understand the string identifier being used, and hence cannot present the presence to the user to set on themselves, it may display an approximation of the presence if it is set on a contact.

The dictionary of variant types allows the connection manager to exchange further protocol-specific information with the client. It is recommended that the string (s) argument 'message' be interpreted as an optional message which can be associated with a presence status.

If the connection has a 'subscribe' contact list, PresenceUpdate signals should be emitted to indicate changes of contacts on this list, and should also be emitted for changes in your own presence. Depending on the protocol, the signal may also be emitted for others such as people with whom you are communicating, and any user interface should be updated accordingly.

On some protocols, RequestPresence may only succeed on contacts on your 'subscribe' list, and other contacts will cause a PermissionDenied error. On protocols where there is no 'subscribe' list, and RequestPresence succeeds, a client may poll the server intermittently to update any display of presence information.

telepathy-glib-0.24.2/spec/Protocol.xml0000644000175000017500000005616712652510705014731 00000000000000 Copyright © 2009-2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API)

An object representing a protocol for which this ConnectionManager can create Connections.

Each Protocol object has the same well-known bus name as its parent ConnectionManager. Its object path is formed by taking the ConnectionManager's object path and appending '/', followed by the Protocol name with any hyphen/minus '-' converted to underscores '_'.

This is the same as the representation of protocol names in Account object paths, and in Connection object paths and bus names. For instance, telepathy-gabble and telepathy-salut would implement objects at /org/freedesktop/Telepathy/ConnectionManager/gabble/jabber and /org/freedesktop/Telepathy/ConnectionManager/salut/local_xmpp, respectively.

If the ConnectionManager has a .manager file, each Protocol's immutable properties must be represented in that file; the representation is described as part of the documentation for each property. For instance, a very simple ConnectionManager with one Protocol might be represented like this:

[ConnectionManager]
Interfaces=

[Protocol example]
Interfaces=
ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;
param-account=s required
param-password=s required secret
RequestableChannelClasses=text;
VCardField=x-example
EnglishName=Example
Icon=im-example
AuthenticationTypes=org.freedesktop.Telepathy.Channel.Type.ServerTLSConnection;org.freedesktop.Telepathy.Channel.Interface.SASLAuthentication;

[text]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;

A list of interfaces supported by this Protocol object.

This property should not be confused with ConnectionInterfaces, which refers to the interfaces of connections to this protocol.

Connection managers with a .manager file (as described as part of the ConnectionManager interface) MUST cache this property in the protocol's section of the .manager file, using the key Interfaces. The corresponding value is a list of D-Bus interface names, each followed by a semicolon.

The parameters which may be specified in the Parameters of an Account (or, for specialised applications which do not use the account manager, passed to RequestConnection). Some parameters are mandatory, and some parameters only make sense when registering new accounts with the server; see the Param_Spec documentation for more details.

Connection managers with a .manager file (as described as part of the ConnectionManager interface) MUST cache this property in the protocol's section of the .manager file via keys of the form param-p and default-p, as documented in the ConnectionManager interface.

A list of interface names which might be in the Interfaces property of a Connection to this protocol. Whether a Connection will have all, some or none of these interfaces depends on server capabilities.

This property should not be confused with Interfaces.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file, using the key ConnectionInterfaces. The corresponding value is a list of D-Bus interface names, each followed by a semicolon.

A list of channel classes which might be requestable from a Connection to this protocol (i.e. they will, or might, appear in the Connection's RequestableChannelClasses property).

Whether a Connection will have all, some or none of these requestable channel classes depends on server capabilities; similarly, individual contacts are not guaranteed to support all of these channel classes.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file, using the key RequestableChannelClasses. The corresponding value is a list of opaque strings, each followed by a semicolon; each of those strings is the name of a group in the .manager file which represents a channel class.

The names of the groups representing channel classes are not significant, and MUST NOT be interpreted. When writing .manager files, authors MAY choose mnemonic group names, generate group names mechanically (e.g. with an incrementing integer), or use some combination of these.

Each group representing a channel class has a key allowed which is a list of D-Bus property names representing allowed parameters. Any other keys that do not contain a space MUST be ignored. Any key containing a space represents a fixed property; the key has the form "propertyname type", and the value is encoded in the same way as for the default-p keys described in the ConnectionManager documentation.

Connection managers that have channel classes whose fixed properties are not representable in this form SHOULD NOT have .manager files.

For instance, this .manager file could represent a connection manager that supports 1-1 Text messages and StreamedMedia audio calls:

[Protocol jabber]
param-account=s required
param-password=s required
RequestableChannelClasses=rcc0;rcc1;

[rcc0]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;

[rcc1]
org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.StreamedMedia
org.freedesktop.Telepathy.Channel.TargetHandleType u=1
allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio;

The name of the most common vCard field used for this protocol's contact identifiers, normalized to lower case, or the empty string if there is no such field.

For example, this would be x-jabber for Jabber/XMPP (including Google Talk), or tel for the PSTN.

A more exhaustive list of addressable vCard fields can be found in the Protocol's Addressing interface's AddressableVCardFields.

It is not necessarily valid to interpret contacts' identifiers as values of this vCard field. For instance, telepathy-sofiasip supports contacts whose identifiers are of the form sip:jenny@example.com or tel:8675309, which would not normally both be represented by any single vCard field. Arbitrary handles/identifiers as vCard fields are represented through the Connection's Addressing1 contact attributes.

This is taken from Mission Control profiles as used on Maemo 5. One valid use of this field is to answer the question: given a contact's vCard containing an X-JABBER field, how can you communicate with the contact? By iterating through protocols looking for an x-jabber VCardField, one can build up a list of protocols that handle x-jabber, then offer the user a list of accounts for those protocols and/or the option to create a new account for one of those protocols.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file if it is non-empty, using the key VCardField. The corresponding value is a string, following the syntax of the "localestring" type from the Desktop Entry Specification.

The name of the protocol in a form suitable for display to users, such as "AIM" or "Yahoo!", or the empty string if none is available.

This is effectively in the C locale (international English); user interfaces requiring a localized protocol name SHOULD look one up in their own message catalog based on either the Telepathy Protocol name or this property, but SHOULD use this English version as a fallback if no translated version can be found.

Many protocols are named after a company or product which isn't translated in non-English locales. This also provides a fallback display name, for UIs with no prior knowledge of a particular protocol.

If this property's value is empty, clients MAY fall back to using the Telepathy Protocol name, possibly with its capitalization adjusted.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file if it is non-empty, using the key EnglishName. The corresponding value is a string, following the syntax of the "localestring" type from the Desktop Entry Specification.

The name of an icon in the system's icon theme, such as "im-msn", or the empty string.

This can be used as a default if the Icon property is not set on an Account, or used by the AccountManager to choose a default icon if none is set during account creation.

If this property's value is empty, clients MAY fall back to generating a name based on the Protocol name.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file if it is non-empty, using the key Icon. The corresponding value is a string, following the syntax of the "localestring" type from the Desktop Entry Specification.

Return a string which uniquely identifies the account to which the given parameters would connect.

For many protocols, this would return the well-known 'account' parameter. However, for IRC the returned string would be composed from the 'account' (i.e. nickname) and 'server' parameters. AccountManager implementations can use this to form the account-specific part of an Account's object path.

A set of parameters as would be provided to RequestConnection

An opaque string suitable for use as the account-specific part of an Account's object path. This is not necessarily globally unique, but should represent a "best-effort" identification of the account.

For a pathological case, consider a user signing in as 'me@example.com' with 'server' set to either jabber1.example.com or jabber2.example.com. Both of these should result in me@example.com being returned from this method, even if the user can actually be signed in to those two servers simultaneously.

The IdentifyAccount method is not supported by this connection manager. The caller SHOULD fall back to deriving identification from the parameters.

Attempt to normalize the given contact ID. Where possible, this SHOULD return the same thing that would be returned by InspectHandles(RequestHandles(CONTACT, [Contact_ID])) on a connected Connection.

If full normalization requires network activity or is otherwise impossible to do without a Connection, this method SHOULD perform a best-effort normalization.

One common example of a best-effort offline normalization differing from the ideal normalization is XMPP.

On XMPP, contacts' JIDs should normally have the resource removed during normalization, but for contacts in a MUC (chatroom), the resource is an integral part of the JID - so the contact JID alice@example.com/Empathy should normalize to alice@example.com, but the in-MUC JID wonderland@conference.example.com/Alice should normalize to itself.

While online, the connection manager has enough context to know which chatrooms the user is in, and can infer from that whether to remove resources, but the best-effort normalization performed while offline does not have this context, so the best that can be done is to remove the resource from all JIDs.

This method MAY simply raise NotImplemented on some protocols.

In link-local XMPP, you can't talk to someone who isn't present on your local network, so normalizing identifiers in advance is meaningless.

The identifier of a contact in this protocol The identifier of a contact in this protocol, normalized as much as possible The NormalizeContact method is not supported by this connection manager. The caller MAY recover by using the contact ID as-is.

A list of D-Bus interfaces which provide information as to what kind of authentication channels can possibly appear before the connection reaches the CONNECTED state.

These can either be channel types, or where the channel type isn't enough information to be useful, interfaces indicating a specific use of a channel type. For example, ServerTLSConnection channels are obviously about TLS certificates so the channel type would appear in this list. However, a ServerAuthentication channel type alone does not explain enough about the authentication type in use as it is merely a base for the channel interfaces that appear in said channels. In this case, CMs should use the value of the ServerAuthentication.AuthenticationMethod property in this list.

For example, if a protocol's AuthenticationTypes contains two values:

[ ...Channel.Type.ServerTLSConnection,
  ...Channel.Interface.SASLAuthentication ]

This tells a client that before the connection status reached CONNECTED, a ServerTLSConnection could appear carrying a TLS certificate. It also tells the client that before the connection status reaches CONNECTED, a ServerAuthentication channel could also appear, where ServerAuthentication.AuthenticationMethod=SASLAuthentication. A hypothetical future Channel.Interface.Captcha interface would also appear in this list if the CM might require the user solve a captcha before connecting.

telepathy-glib-0.24.2/spec/Connection_Interface_Privacy.xml0000644000175000017500000001041512652510705020666 00000000000000 Copyright (C) 2005, 2006 Collabora Limited Copyright (C) 2005, 2006 Nokia Corporation Copyright (C) 2006 INdT

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

A string representing the current privacy mode Return the current privacy mode, which must be one of the values returned by GetPrivacyModes. An array of valid privacy modes for this connection Returns the privacy modes available on this connection. The following well-known names should be used where appropriate:
allow-all
any contact may initiate communication
allow-specified
only contacts on your 'allow' list may initiate communication
allow-subscribed
only contacts on your subscription list may initiate communication
The current privacy mode Emitted when the privacy mode is changed or the value has been initially received from the server. The desired privacy mode Request that the privacy mode be changed to the given value, which must be one of the values returned by GetPrivacyModes. Success is indicated by the method returning and the PrivacyModeChanged signal being emitted. An interface to support getting and setting privacy modes to configure situations such as not being contactable by people who are not on your subscribe list. If this interface is not implemented, the default can be presumed to be allow-all (as defined in GetPrivacyModes).
telepathy-glib-0.24.2/spec/Protocol_Interface_Addressing.xml0000644000175000017500000003551112652510705021042 00000000000000 Copyright © 2010 Collabora Ltd.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

(as stable API). From the draft, NormalizeURI was renamed to NormalizeContactURI, clarifying that it removes any actions from the URI.

An interface for protocols that support multiple forms of addressing contacts, for example through vCard addresses and URIs.

If the ConnectionManager has a .manager file, and it supports this interface, the interface's immutable properties must be represented in the file; the representation is described as part of the documentation for each property.

For instance, a SIP connection manager might have the following lines in the .manager file.

[Protocol sip]
AddressableVCardFields=tel;x-sip;
AddressableURISchemes=tel;sip;

The vCard fields that can be used to request a contact with normalized to lower case. If the URL vCard field is addressable, a colon, followed by the supported URI schemes will be concatenated.

For example: ["tel", "x-sip"].

The url vCard field MUST NOT appear here; see AddressableURISchemes instead.

In practice, protocols have a limited set of URI schemes that make sense to resolve as a contact.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file if it is non-empty, using the key AddressableVCardFields. The corresponding value is a list of strings, each followed with a semicolon and in the syntax of the "localestring" type from the Desktop Entry Specification.

Well-known vCard fields:

tel
The TEL vCard field. Used for phone numbers.
x-sip
The X-SIP vCard field. Used for SIP addresses.
x-aim
The X-AIM vCard field. Used for AIM user IDs.
x-icq
The X-ICQ vCard field. Used for ICQ UINs.
x-skype
The X-SKYPE vCard field. Used for Skype user names or telephone numbers. There is also a X-SKYPE-USERNAME field, but for Telepathy purposes, x-skype is preferred
x-groupwise
The X-GROUPWISE vCard field. Used for Groupwise contacts.
x-gadugadu
The X-GADUGADU vCard field. Used for Gadu-Gadu contacts.
x-jabber
The X-JABBER vCard field. Used for XMPP JIDs.
x-msn
The X-MSN vCard field. Used for MSN contacts.
x-yahoo
The X-YAHOO vCard field. Used for Yahoo! IDs.
x-facebook-id
Used for Facebook IDs in XMPP. If the user JID is "-12345@chat.facebook.com" then the x-facebook-id is "12345"

The URI schemes that are supported by this protocol.

For example: ["tel", "sip"].

This property should only be used when the connection is offline. When it is connected the addressable URI schemes should be retrieved from the Requests.RequestableChannelClasses's TargetURIScheme fixed-property instead.

Connection managers with a .manager file MUST cache this property in the protocol's section of the .manager file if it is non-empty, using the key AddressableURISchemes. The corresponding value is a list of strings, each followed with a semicolon and in the syntax of the "localestring" type from the Desktop Entry Specification.

Well-known URI schemes:

sip
SIP protocol. For example: sip:julien@example.com.
sips
Secure (encrypted) SIP protocol. For example: sips:julien@example.com.
tel
Used for telephone numbers. For example: tel:+12065551234.
xmpp
XMPP protocol. For example: xmpp:julien@example.com.
msnim
For the purposes of Protocol.Interface.Addressing, Connection.Interface.Addressing1, and Channel.Interface.Addressing1, the verb part is ignored, and SHOULD be add; the contact field in the query string is used to identify the contact. For example: msnim:add?contact=julien.
aim
For the purposes of Protocol.Interface.Addressing, Connection.Interface.Addressing1, and Channel.Interface.Addressing1, the verb part is ignored, and SHOULD be addbuddy; the screenname field in the query string is used to identify the contact. For example: aim:addbuddy?screenname=julien.
skype
Skype protocol. For example: skype:julien.
ymsgr
For the purposes of Protocol.Interface.Addressing, Connection.Interface.Addressing1, and Channel.Interface.Addressing1, the verb part is ignored, and SHOULD be addfriend; the query string is used to identify the contact. For example: ymsgr:addfriend?julien.
gg
Gadu-Gadu protocol. For example: gg:julien.

Attempt to normalize the given vCard address. Where possible, this SHOULD return an address that would appear in the org.freedesktop.Telepathy.Connection.Interface.Addressing1/addresses attribute for a contact on a connected Connection.

If full normalization requires network activity or is otherwise impossible to do without a Connection, this method SHOULD perform a best-effort normalization.

An example would be a vCard TEL field with a formatted number in the form of +1 (206) 555 1234, this would be normalized to +12065551234.

This method MAY simply raise NotImplemented on some protocols, if it has no use.

The vCard field of the address we are normalizing. The field name SHOULD be in lower case, and MUST appear in AddressableVCardFields. The address to normalize, which is assumed to belong to a contact (and not, for instance, a chatroom or server). The vCard address, normalized as much as possible. The vCard field is not supported (it is not in AddressableVCardFields). The address is syntactically incorrect.
(renamed from NormalizeURI)

Attempt to normalize the given contact URI. Where possible, this SHOULD return an address that would appear in the org.freedesktop.Telepathy.Connection.Interface.Addressing1/uris attribute for a contact on a connected Connection.

If full normalization requires network activity or is otherwise impossible to do without a Connection, this method SHOULD perform a best-effort normalization.

If the URI has extra information beyond what's necessary to identify a particular contact, such as an XMPP resource or an action to carry out, this extra information SHOULD be removed. If all URIs in a scheme contain a verb or action (like aim, ymsgr and msnim URIs), then the verb SHOULD be replaced with the one specified in AddressableURISchemes.

This method is intended to normalize URIs stored in address books, for instance. In protocols like XMPP, if you vary the resource or action (query string), the URI still refers to the same high-level contact.

For instance, xmpp:romeo@Example.Com/Empathy?message;body=Hello would be normalized to xmpp:romeo@example.com, and aim:goim?screenname=Romeo%20M&message=Hello would be normalized to aim:addbuddy?screenname=romeom.

This method MAY simply raise NotImplemented on some protocols, if it has no use.

The URI to normalize, which is assumed to refer to a contact (as opposed to, for instance, a chatroom or a server).

In some protocols, like XMPP, there is no way to tell whether a given URI refers to a contact or a chatroom by looking at its syntax.

The URI's scheme (i.e. the part before the first colon) MUST appear in AddressableURISchemes.

A URI, normalized as much as possible. The URI scheme is not supported (it is not in AddressableURISchemes).

The URI is syntactically incorrect or cannot be interpreted as a reference to a contact.

For instance, aim:!? is not a valid AIM URI, while aim:goaway?message=Absent is a valid AIM URI, but not a contact.

telepathy-glib-0.24.2/vala/0000755000175000017500000000000014006623342012435 500000000000000telepathy-glib-0.24.2/vala/telepathy-glib.deps0000644000175000017500000000002412652510705016143 00000000000000gobject-2.0 gio-2.0 telepathy-glib-0.24.2/vala/Makefile.am0000644000175000017500000000120112652510705014406 00000000000000vapidir = $(datarootdir)/vala/vapi vapi_DATA = \ telepathy-glib.vapi \ $(NULL) dist_vapi_DATA = \ telepathy-glib.deps \ $(NULL) BUILT_SOURCES = \ $(vapi_DATA) \ $(NULL) pkgconfigdir = ${libdir}/pkgconfig telepathy-glib.vapi: $(top_builddir)/telepathy-glib/TelepathyGLib-0.12.gir $(VAPIGEN_V)$(VAPIGEN) \ --library telepathy-glib \ --metadatadir=$(top_srcdir)/telepathy-glib \ --pkg gio-2.0 \ $< \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) # set up the verbosity rules to avoid some build noise VAPIGEN_V = $(VAPIGEN_V_$(V)) VAPIGEN_V_ = $(VAPIGEN_V_$(AM_DEFAULT_VERBOSITY)) VAPIGEN_V_0 = @echo " VAPIG " $^; telepathy-glib-0.24.2/vala/Makefile.in0000644000175000017500000004334614006601553014434 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = vala ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_vapi_DATA) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(vapidir)" DATA = $(dist_vapi_DATA) $(vapi_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ vapidir = $(datarootdir)/vala/vapi vapi_DATA = \ telepathy-glib.vapi \ $(NULL) dist_vapi_DATA = \ telepathy-glib.deps \ $(NULL) BUILT_SOURCES = \ $(vapi_DATA) \ $(NULL) pkgconfigdir = ${libdir}/pkgconfig CLEANFILES = \ $(BUILT_SOURCES) \ $(NULL) # set up the verbosity rules to avoid some build noise VAPIGEN_V = $(VAPIGEN_V_$(V)) VAPIGEN_V_ = $(VAPIGEN_V_$(AM_DEFAULT_VERBOSITY)) VAPIGEN_V_0 = @echo " VAPIG " $^; all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu vala/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu vala/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_vapiDATA: $(dist_vapi_DATA) @$(NORMAL_INSTALL) @list='$(dist_vapi_DATA)'; test -n "$(vapidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(vapidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(vapidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vapidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(vapidir)" || exit $$?; \ done uninstall-dist_vapiDATA: @$(NORMAL_UNINSTALL) @list='$(dist_vapi_DATA)'; test -n "$(vapidir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(vapidir)'; $(am__uninstall_files_from_dir) install-vapiDATA: $(vapi_DATA) @$(NORMAL_INSTALL) @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(vapidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(vapidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(vapidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(vapidir)" || exit $$?; \ done uninstall-vapiDATA: @$(NORMAL_UNINSTALL) @list='$(vapi_DATA)'; test -n "$(vapidir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(vapidir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(vapidir)" "$(DESTDIR)$(vapidir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_vapiDATA install-vapiDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_vapiDATA uninstall-vapiDATA .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_vapiDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip install-vapiDATA \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dist_vapiDATA uninstall-vapiDATA .PRECIOUS: Makefile telepathy-glib.vapi: $(top_builddir)/telepathy-glib/TelepathyGLib-0.12.gir $(VAPIGEN_V)$(VAPIGEN) \ --library telepathy-glib \ --metadatadir=$(top_srcdir)/telepathy-glib \ --pkg gio-2.0 \ $< \ $(NULL) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/aclocal.m40000644000175000017500000017346314006601552013307 00000000000000# generated automatically by aclocal 1.16.2 -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR # Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 dnl python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl python3.2 python3.1 python3.0 dnl python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version is >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Python interpreter is too old])]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) # Just factor out some code duplication. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': can_use_sysconfig = 0 except ImportError: pass" dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR # Autoconf support for the Vala compiler # Copyright (C) 2008-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the Vala compiler exists in $PATH. If it is found, the # variable VALAC is set pointing to its absolute path. Otherwise, it is # simply set to 'valac'. # Optionally a minimum release number of the compiler can be requested. # If the ACTION-IF-FOUND parameter is given, it will be run if a proper # Vala compiler is found. # Similarly, if the ACTION-IF-FOUND is given, it will be run if no proper # Vala compiler is found. It defaults to simply print a warning about the # situation, but otherwise proceeding with the configuration. # # AM_PROG_VALAC([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # -------------------------------------------------------------------------- AC_DEFUN([AM_PROG_VALAC], [AC_PATH_PROG([VALAC], [valac], [valac]) AS_IF([test "$VALAC" != valac && test -n "$1"], [AC_MSG_CHECKING([whether $VALAC is at least version $1]) am__vala_version=`$VALAC --version | sed 's/Vala *//'` AS_VERSION_COMPARE([$1], ["$am__vala_version"], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) VALAC=valac])]) if test "$VALAC" = valac; then m4_default([$3], [AC_MSG_WARN([no proper vala compiler found]) AC_MSG_WARN([you will not be able to compile vala source files])]) else m4_default([$2], [:]) fi]) m4_include([m4/compiler.m4]) m4_include([m4/gtk-doc.m4]) m4_include([m4/introspection.m4]) m4_include([m4/libtool.m4]) m4_include([m4/linker.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/tp-compiler-flag.m4]) m4_include([m4/tp-compiler-warnings.m4]) m4_include([m4/tp-linker-flag.m4]) telepathy-glib-0.24.2/tests/0000755000175000017500000000000014006623343012655 500000000000000telepathy-glib-0.24.2/tests/lib/0000755000175000017500000000000014006623343013423 500000000000000telepathy-glib-0.24.2/tests/lib/debug.h0000644000175000017500000000013612652510705014604 00000000000000#undef DEBUG #define DEBUG(format, ...) \ g_debug ("%s: " format, G_STRFUNC, ##__VA_ARGS__) telepathy-glib-0.24.2/tests/lib/tls-certificate.c0000644000175000017500000002465512652510705016607 00000000000000/* * tls-certificate.c - Source for TpTestsTLSCertificate * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "tls-certificate.h" #include #include #define DEBUG_FLAG TP_TESTS_DEBUG_TLS #include "debug.h" static void tls_certificate_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpTestsTLSCertificate, tp_tests_tls_certificate, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_AUTHENTICATION_TLS_CERTIFICATE, tls_certificate_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init);) struct _TpTestsTLSCertificatePrivate { gchar *object_path; gchar *cert_type; TpTLSCertificateState cert_state; GPtrArray *rejections; GPtrArray *cert_data; TpDBusDaemon *daemon; gboolean dispose_has_run; }; enum { PROP_OBJECT_PATH = 1, PROP_STATE, PROP_REJECTIONS, PROP_CERTIFICATE_TYPE, PROP_CERTIFICATE_CHAIN_DATA, /* not exported */ PROP_DBUS_DAEMON, NUM_PROPERTIES }; static void tp_tests_tls_certificate_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (object); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_STATE: g_value_set_uint (value, self->priv->cert_state); break; case PROP_REJECTIONS: g_value_set_boxed (value, self->priv->rejections); break; case PROP_CERTIFICATE_TYPE: g_value_set_string (value, self->priv->cert_type); break; case PROP_CERTIFICATE_CHAIN_DATA: g_value_set_boxed (value, self->priv->cert_data); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tests_tls_certificate_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (object); switch (property_id) { case PROP_OBJECT_PATH: self->priv->object_path = g_value_dup_string (value); break; case PROP_CERTIFICATE_TYPE: self->priv->cert_type = g_value_dup_string (value); break; case PROP_CERTIFICATE_CHAIN_DATA: self->priv->cert_data = g_value_dup_boxed (value); break; case PROP_DBUS_DAEMON: self->priv->daemon = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, value); break; } } static void tp_tests_tls_certificate_finalize (GObject *object) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (object); tp_clear_boxed (TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, &self->priv->rejections); g_free (self->priv->object_path); g_free (self->priv->cert_type); g_ptr_array_unref (self->priv->cert_data); G_OBJECT_CLASS (tp_tests_tls_certificate_parent_class)->finalize (object); } static void tp_tests_tls_certificate_dispose (GObject *object) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (object); if (self->priv->dispose_has_run) return; self->priv->dispose_has_run = TRUE; tp_clear_object (&self->priv->daemon); G_OBJECT_CLASS (tp_tests_tls_certificate_parent_class)->dispose (object); } static void tp_tests_tls_certificate_constructed (GObject *object) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (tp_tests_tls_certificate_parent_class)->constructed; if (chain_up != NULL) chain_up (object); /* register the certificate on the bus */ tp_dbus_daemon_register_object (self->priv->daemon, self->priv->object_path, self); } static void tp_tests_tls_certificate_init (TpTestsTLSCertificate *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_TLS_CERTIFICATE, TpTestsTLSCertificatePrivate); self->priv->rejections = g_ptr_array_new (); } static void tp_tests_tls_certificate_class_init (TpTestsTLSCertificateClass *klass) { static TpDBusPropertiesMixinPropImpl object_props[] = { { "State", "state", NULL }, { "Rejections", "rejections", NULL }, { "CertificateType", "certificate-type", NULL }, { "CertificateChainData", "certificate-chain-data", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, object_props, }, { NULL } }; GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *pspec; g_type_class_add_private (klass, sizeof (TpTestsTLSCertificatePrivate)); oclass->finalize = tp_tests_tls_certificate_finalize; oclass->dispose = tp_tests_tls_certificate_dispose; oclass->set_property = tp_tests_tls_certificate_set_property; oclass->get_property = tp_tests_tls_certificate_get_property; oclass->constructed = tp_tests_tls_certificate_constructed; pspec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_OBJECT_PATH, pspec); pspec = g_param_spec_uint ("state", "State of this certificate", "The state of this TLS certificate.", 0, NUM_TP_TLS_CERTIFICATE_STATES - 1, TP_TLS_CERTIFICATE_STATE_PENDING, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_STATE, pspec); pspec = g_param_spec_boxed ("rejections", "The reject reasons", "The reasons why this TLS certificate has been rejected", TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_REJECTIONS, pspec); pspec = g_param_spec_string ("certificate-type", "The certificate type", "The type of this certificate.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_CERTIFICATE_TYPE, pspec); pspec = g_param_spec_boxed ("certificate-chain-data", "The certificate chain data", "The raw PEM-encoded trust chain of this certificate.", TP_ARRAY_TYPE_UCHAR_ARRAY_LIST, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_CERTIFICATE_CHAIN_DATA, pspec); pspec = g_param_spec_object ("dbus-daemon", "The DBus daemon connection", "The connection to the DBus daemon owning the CM", TP_TYPE_DBUS_DAEMON, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_DBUS_DAEMON, pspec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (oclass, G_STRUCT_OFFSET (TpTestsTLSCertificateClass, dbus_props_class)); } static void tp_tests_tls_certificate_accept (TpSvcAuthenticationTLSCertificate *cert, DBusGMethodInvocation *context) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (cert); DEBUG ("Accept() called on the TLS certificate; current state %u", self->priv->cert_state); if (self->priv->cert_state != TP_TLS_CERTIFICATE_STATE_PENDING) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Accept() on a certificate with state != PENDING " "doesn't make sense." }; dbus_g_method_return_error (context, &error); return; } self->priv->cert_state = TP_TLS_CERTIFICATE_STATE_ACCEPTED; tp_svc_authentication_tls_certificate_emit_accepted (self); tp_svc_authentication_tls_certificate_return_from_accept (context); } static void tp_tests_tls_certificate_reject (TpSvcAuthenticationTLSCertificate *cert, const GPtrArray *rejections, DBusGMethodInvocation *context) { TpTestsTLSCertificate *self = TP_TESTS_TLS_CERTIFICATE (cert); DEBUG ("Reject() called on the TLS certificate with rejections %p, " "length %u; current state %u", rejections, rejections->len, self->priv->cert_state); if (rejections->len < 1) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Reject() with a zero-length rejection list." }; dbus_g_method_return_error (context, &error); return; } if (self->priv->cert_state != TP_TLS_CERTIFICATE_STATE_PENDING) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Calling Reject() on a certificate with state != PENDING " "doesn't make sense." }; dbus_g_method_return_error (context, &error); return; } tp_clear_boxed (TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, &self->priv->rejections); self->priv->rejections = g_boxed_copy (TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, rejections); self->priv->cert_state = TP_TLS_CERTIFICATE_STATE_REJECTED; tp_svc_authentication_tls_certificate_emit_rejected ( self, self->priv->rejections); tp_svc_authentication_tls_certificate_return_from_reject (context); } static void tls_certificate_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcAuthenticationTLSCertificateClass *klass = g_iface; #define IMPLEMENT(x) \ tp_svc_authentication_tls_certificate_implement_##x ( \ klass, tp_tests_tls_certificate_##x) IMPLEMENT (accept); IMPLEMENT (reject); #undef IMPLEMENT } void tp_tests_tls_certificate_clear_rejection (TpTestsTLSCertificate *self) { g_ptr_array_set_size (self->priv->rejections, 0); } telepathy-glib-0.24.2/tests/lib/tls-certificate.h0000644000175000017500000000460012652510705016600 00000000000000/* * tls-certificate.h - Header for TpTestsTLSCertificate * Copyright (C) 2010 Collabora Ltd. * @author Cosimo Cecchi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_TESTS_TLS_CERTIFICATE_H__ #define __TP_TESTS_TLS_CERTIFICATE_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsTLSCertificate TpTestsTLSCertificate; typedef struct _TpTestsTLSCertificateClass TpTestsTLSCertificateClass; typedef struct _TpTestsTLSCertificatePrivate TpTestsTLSCertificatePrivate; struct _TpTestsTLSCertificateClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpTestsTLSCertificate { GObject parent; TpTestsTLSCertificatePrivate *priv; }; GType tp_tests_tls_certificate_get_type (void); #define TP_TESTS_TYPE_TLS_CERTIFICATE \ (tp_tests_tls_certificate_get_type ()) #define TP_TESTS_TLS_CERTIFICATE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_TLS_CERTIFICATE, \ TpTestsTLSCertificate)) #define TP_TESTS_TLS_CERTIFICATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_TLS_CERTIFICATE, \ TpTestsTLSCertificateClass)) #define TP_TESTS_IS_TLS_CERTIFICATE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_TLS_CERTIFICATE)) #define TP_TESTS_IS_TLS_CERTIFICATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_TLS_CERTIFICATE)) #define TP_TESTS_TLS_CERTIFICATE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_TLS_CERTIFICATE, \ TpTestsTLSCertificateClass)) void tp_tests_tls_certificate_clear_rejection (TpTestsTLSCertificate *self); G_END_DECLS #endif /* #ifndef __TP_TESTS_TLS_CERTIFICATE_H__*/ telepathy-glib-0.24.2/tests/lib/my-conn-proxy.c0000644000175000017500000002446112652510705016257 00000000000000/* * my-conn-proxy.c - a simple subclass of TpConnection * * Copyright (C) 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "my-conn-proxy.h" #include G_DEFINE_TYPE (TpTestsMyConnProxy, tp_tests_my_conn_proxy, TP_TYPE_CONNECTION) static void tp_tests_my_conn_proxy_init (TpTestsMyConnProxy *self) { } enum { FEAT_CORE, FEAT_A, FEAT_B, FEAT_WRONG_IFACE, FEAT_BAD_DEP, FEAT_FAIL, FEAT_FAIL_DEP, FEAT_RETRY, FEAT_RETRY_DEP, FEAT_BEFORE_CONNECTED, FEAT_INTERFACE_LATER, N_FEAT }; static void prepare_core_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; /* superclass core features are prepared first */ g_assert (tp_proxy_is_prepared (proxy, TP_CONNECTION_FEATURE_CORE)); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_core_async); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_a_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_a_async); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_b_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_A)); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_b_async); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void cannot_be_prepared_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { g_assert_not_reached (); } static void prepare_fail_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); result = g_simple_async_result_new_error ((GObject *) proxy, callback, user_data, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No feature for you!"); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_retry_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_retry_async); if (!self->retry_feature_success) { /* Fail the first time we try to prepare the feature */ g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_YET, "Nah"); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_retry_dep_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_retry_dep_async); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_before_connected_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy; GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_before_connected_async); if (tp_connection_get_status (TP_CONNECTION (self), NULL) == TP_CONNECTION_STATUS_CONNECTED) self->before_connected_state = BEFORE_CONNECTED_STATE_CONNECTED; else self->before_connected_state = BEFORE_CONNECTED_STATE_NOT_CONNECTED; g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_before_connected_before_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy; GSimpleAsyncResult *result; g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert_cmpuint (tp_connection_get_status (TP_CONNECTION (proxy), NULL), ==, TP_CONNECTION_STATUS_CONNECTING); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_before_connected_before_async); self->before_connected_state = BEFORE_CONNECTED_STATE_CONNECTED; g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void prepare_interface_later_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_interface_later_async); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static const TpProxyFeature * list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; static GQuark need_a[2] = {0, 0}; static GQuark need_channel_core[2] = {0, 0}; static GQuark need_wrong_iface[2] = {0, 0}; static GQuark need_fail[2] = {0, 0}; static GQuark need_retry[2] = {0, 0}; static GQuark need_iface_later[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_TESTS_MY_CONN_PROXY_FEATURE_CORE; features[FEAT_CORE].core = TRUE; features[FEAT_CORE].prepare_async = prepare_core_async; features[FEAT_A].name = TP_TESTS_MY_CONN_PROXY_FEATURE_A; features[FEAT_A].prepare_async = prepare_a_async; features[FEAT_B].name = TP_TESTS_MY_CONN_PROXY_FEATURE_B; features[FEAT_B].prepare_async = prepare_b_async; need_a[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_A; features[FEAT_B].depends_on = need_a; features[FEAT_WRONG_IFACE].name = TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE; features[FEAT_WRONG_IFACE].prepare_async = cannot_be_prepared_async; need_channel_core[0] = TP_CHANNEL_FEATURE_CORE; features[FEAT_WRONG_IFACE].interfaces_needed = need_channel_core; features[FEAT_BAD_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP; features[FEAT_BAD_DEP].prepare_async = cannot_be_prepared_async; need_wrong_iface[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE; features[FEAT_BAD_DEP].depends_on = need_wrong_iface; features[FEAT_FAIL].name = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL; features[FEAT_FAIL].prepare_async = prepare_fail_async; features[FEAT_FAIL_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP; features[FEAT_FAIL_DEP].prepare_async = cannot_be_prepared_async; need_fail[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL; features[FEAT_FAIL_DEP].depends_on = need_fail; features[FEAT_RETRY].name = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY; features[FEAT_RETRY].prepare_async = prepare_retry_async; features[FEAT_RETRY].can_retry = TRUE; features[FEAT_RETRY_DEP].name = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP; need_retry[0] = TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY; features[FEAT_RETRY_DEP].prepare_async = prepare_retry_dep_async; features[FEAT_RETRY_DEP].depends_on = need_retry; features[FEAT_BEFORE_CONNECTED].name = TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED; features[FEAT_BEFORE_CONNECTED].prepare_async = prepare_before_connected_async; features[FEAT_BEFORE_CONNECTED].prepare_before_signalling_connected_async = prepare_before_connected_before_async; features[FEAT_INTERFACE_LATER].name = TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER; features[FEAT_INTERFACE_LATER].prepare_async = prepare_interface_later_async; need_iface_later[0] = g_quark_from_static_string ( TP_TESTS_MY_CONN_PROXY_IFACE_LATER); features[FEAT_INTERFACE_LATER].interfaces_needed = need_iface_later; return features; } static void tp_tests_my_conn_proxy_class_init (TpTestsMyConnProxyClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; proxy_class->list_features = list_features; } GQuark tp_tests_my_conn_proxy_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-core"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_a (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-a"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_b (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-b"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_wrong_iface (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-wrong_iface"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_bad_dep (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-bad-dep"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_fail (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-fail"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_fail_dep (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-fail-dep"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_retry (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-retry"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_retry_dep (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-retry-dep"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_before_connected (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-before-connected"); } GQuark tp_tests_my_conn_proxy_get_feature_quark_interface_later (void) { return g_quark_from_static_string ("tp-my-conn-proxy-feature-interface-later"); } telepathy-glib-0.24.2/tests/lib/my-conn-proxy.h0000644000175000017500000001115612652510705016261 00000000000000/* * my-conn-proxy.h - header for a simple subclass of TpConnection * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_MY_CONN_PROXY_H__ #define __TP_TESTS_MY_CONN_PROXY_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsMyConnProxy TpTestsMyConnProxy; typedef struct _TpTestsMyConnProxyClass TpTestsMyConnProxyClass; typedef struct _TpTestsMyConnProxyPrivate TpTestsMyConnProxyPrivate; struct _TpTestsMyConnProxyClass { TpConnectionClass parent_class; }; typedef enum { BEFORE_CONNECTED_STATE_UNPREPARED = 0, BEFORE_CONNECTED_STATE_NOT_CONNECTED, BEFORE_CONNECTED_STATE_CONNECTED, } TpTestsMyConnProxyBeforeConnectedState; struct _TpTestsMyConnProxy { TpConnection parent; gboolean retry_feature_success; TpTestsMyConnProxyBeforeConnectedState before_connected_state; }; GType tp_tests_my_conn_proxy_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_MY_CONN_PROXY \ (tp_tests_my_conn_proxy_get_type ()) #define TP_TESTS_MY_CONN_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \ TpTestsMyConnProxy)) #define TP_TESTS_MY_CONN_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_MY_CONN_PROXY, \ TpTestsMyConnProxyClass)) #define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_MY_CONN_PROXY)) #define TP_TESTS_SIMPLE_IS_MY_CONN_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_MY_CONN_PROXY)) #define TP_TESTS_MY_CONN_PROXY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_MY_CONN_PROXY, \ TpTestsMyConnProxyClass)) /* Core feature */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_CORE \ (tp_tests_my_conn_proxy_get_feature_quark_core ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_core (void) G_GNUC_CONST; /* No depends */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_A \ (tp_tests_my_conn_proxy_get_feature_quark_a ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_a (void) G_GNUC_CONST; /* Depends on A */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_B \ (tp_tests_my_conn_proxy_get_feature_quark_b ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_b (void) G_GNUC_CONST; /* Depends on an unimplemented iface */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE \ (tp_tests_my_conn_proxy_get_feature_quark_wrong_iface ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_wrong_iface (void) G_GNUC_CONST; /* Depends on WRONG_IFACE */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP \ (tp_tests_my_conn_proxy_get_feature_quark_bad_dep ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_bad_dep (void) G_GNUC_CONST; /* Fail during preparation */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL \ (tp_tests_my_conn_proxy_get_feature_quark_fail ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_fail (void) G_GNUC_CONST; /* Depends on FAIL */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP \ (tp_tests_my_conn_proxy_get_feature_quark_fail_dep ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_fail_dep (void) G_GNUC_CONST; /* Fail at first attempt but succeed after */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY \ (tp_tests_my_conn_proxy_get_feature_quark_retry ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_retry (void) G_GNUC_CONST; /* Depends on FEATURE_RETRY */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP \ (tp_tests_my_conn_proxy_get_feature_quark_retry_dep ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_retry_dep (void) G_GNUC_CONST; /* Can be prepared before the connection is connected and block announcing the * connected state */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED \ (tp_tests_my_conn_proxy_get_feature_quark_before_connected ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_before_connected (void) G_GNUC_CONST; #define TP_TESTS_MY_CONN_PROXY_IFACE_LATER "org.freedesktop.Telepathy.Conncetion.Interface.Test.Later" /* Need the interface TP_TESTS_MY_CONN_PROXY_IFACE_LATER to be prepared but * this interface is not in the initial set of interfaces of the connection. * It is added when the connection is connected. */ #define TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER \ (tp_tests_my_conn_proxy_get_feature_quark_interface_later ()) GQuark tp_tests_my_conn_proxy_get_feature_quark_interface_later (void) G_GNUC_CONST; G_END_DECLS #endif /* #ifndef __TP_TESTS_MY_CONN_PROXY_H__ */ telepathy-glib-0.24.2/tests/lib/echo-im-manager.c0000644000175000017500000002474712652510705016460 00000000000000/* * im-manager.c - an example channel manager for channels talking to a * particular contact. Similar code is used for 1-1 IM channels in many * protocols (IRC private messages ("/query"), XMPP IM etc.) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "echo-im-manager.h" #include #include #include "echo-chan.h" static void channel_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsEchoImManager, tp_tests_echo_im_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init)) /* type definition stuff */ enum { PROP_CONNECTION = 1, N_PROPS }; struct _TpTestsEchoImManagerPrivate { TpBaseConnection *conn; /* GUINT_TO_POINTER (handle) => TpTestsEchoChannel */ GHashTable *channels; gulong status_changed_id; }; static void tp_tests_echo_im_manager_init (TpTestsEchoImManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_ECHO_IM_MANAGER, TpTestsEchoImManagerPrivate); self->priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref); } static void tp_tests_echo_im_manager_close_all (TpTestsEchoImManager *self); static void dispose (GObject *object) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (object); tp_tests_echo_im_manager_close_all (self); g_assert (self->priv->channels == NULL); ((GObjectClass *) tp_tests_echo_im_manager_parent_class)->dispose (object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: /* We don't ref the connection, because it owns a reference to the * channel manager, and it guarantees that the manager's lifetime is * less than its lifetime */ self->priv->conn = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, TpTestsEchoImManager *self) { if (status == TP_CONNECTION_STATUS_DISCONNECTED) tp_tests_echo_im_manager_close_all (self); } static void constructed (GObject *object) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tests_echo_im_manager_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); } static void tp_tests_echo_im_manager_class_init (TpTestsEchoImManagerClass *klass) { GParamSpec *param_spec; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; param_spec = g_param_spec_object ("connection", "Connection object", "The connection that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); g_type_class_add_private (klass, sizeof (TpTestsEchoImManagerPrivate)); } static void tp_tests_echo_im_manager_close_all (TpTestsEchoImManager *self) { if (self->priv->channels != NULL) { GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } } static void tp_tests_echo_im_manager_foreach_channel (TpChannelManager *iface, TpExportableChannelFunc callback, gpointer user_data) { TpTestsEchoImManager *self = TP_TESTS_ECHO_IM_MANAGER (iface); GHashTableIter iter; gpointer handle, channel; g_hash_table_iter_init (&iter, self->priv->channels); while (g_hash_table_iter_next (&iter, &handle, &channel)) { callback (TP_EXPORTABLE_CHANNEL (channel), user_data); } } static void channel_closed_cb (TpTestsEchoChannel *chan, TpTestsEchoImManager *self) { tp_channel_manager_emit_channel_closed_for_object (self, TP_EXPORTABLE_CHANNEL (chan)); if (self->priv->channels != NULL) { TpHandle handle; gboolean really_destroyed; g_object_get (chan, "handle", &handle, "channel-destroyed", &really_destroyed, NULL); /* Re-announce the channel if it's not yet ready to go away (pending * messages) */ if (really_destroyed) { g_hash_table_remove (self->priv->channels, GUINT_TO_POINTER (handle)); } else { tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), NULL); } } } static void new_channel (TpTestsEchoImManager *self, TpHandle handle, TpHandle initiator, gpointer request_token) { TpTestsEchoChannel *chan; gchar *object_path; GSList *requests = NULL; object_path = g_strdup_printf ("%s/EchoChannel%u", tp_base_connection_get_object_path (self->priv->conn), handle); chan = g_object_new (TP_TESTS_TYPE_ECHO_CHANNEL, "connection", self->priv->conn, "object-path", object_path, "handle", handle, "initiator-handle", initiator, NULL); g_free (object_path); g_signal_connect (chan, "closed", (GCallback) channel_closed_cb, self); /* self->priv->channels takes ownership of 'chan' */ g_hash_table_insert (self->priv->channels, GUINT_TO_POINTER (handle), chan); if (request_token != NULL) requests = g_slist_prepend (requests, request_token); tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), requests); g_slist_free (requests); } static const gchar * const fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL }; static const gchar * const allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, NULL }; static void tp_tests_echo_im_manager_foreach_channel_class (TpChannelManager *manager, TpChannelManagerChannelClassFunc func, gpointer user_data) { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL); func (manager, table, allowed_properties, user_data); g_hash_table_unref (table); } static gboolean tp_tests_echo_im_manager_request (TpTestsEchoImManager *self, gpointer request_token, GHashTable *request_properties, gboolean require_new) { TpHandle handle; TpTestsEchoChannel *chan; GError *error = NULL; if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_TEXT)) { return FALSE; } if (tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) != TP_HANDLE_TYPE_CONTACT) { return FALSE; } handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); g_assert (handle != 0); if (tp_channel_manager_asv_has_unknown_properties (request_properties, fixed_properties, allowed_properties, &error)) { goto error; } chan = g_hash_table_lookup (self->priv->channels, GUINT_TO_POINTER (handle)); if (chan == NULL) { new_channel (self, handle, tp_base_connection_get_self_handle (self->priv->conn), request_token); } else if (require_new) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "An echo channel to contact #%u already exists", handle); goto error; } else { tp_channel_manager_emit_request_already_satisfied (self, request_token, TP_EXPORTABLE_CHANNEL (chan)); } return TRUE; error: tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); g_error_free (error); return TRUE; } static gboolean tp_tests_echo_im_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return tp_tests_echo_im_manager_request (TP_TESTS_ECHO_IM_MANAGER (manager), request_token, request_properties, TRUE); } static gboolean tp_tests_echo_im_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return tp_tests_echo_im_manager_request (TP_TESTS_ECHO_IM_MANAGER (manager), request_token, request_properties, FALSE); } static void channel_manager_iface_init (gpointer g_iface, gpointer iface_data G_GNUC_UNUSED) { TpChannelManagerIface *iface = g_iface; iface->foreach_channel = tp_tests_echo_im_manager_foreach_channel; iface->foreach_channel_class = tp_tests_echo_im_manager_foreach_channel_class; iface->create_channel = tp_tests_echo_im_manager_create_channel; iface->ensure_channel = tp_tests_echo_im_manager_ensure_channel; /* In this channel manager, Request has the same semantics as Ensure */ iface->request_channel = tp_tests_echo_im_manager_ensure_channel; } telepathy-glib-0.24.2/tests/lib/echo-im-manager.h0000644000175000017500000000334112652510705016450 00000000000000/* * im-manager.h - header for an example channel manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_ECHO_IM_MANAGER_H__ #define __TP_TESTS_ECHO_IM_MANAGER_H__ #include G_BEGIN_DECLS typedef struct _TpTestsEchoImManager TpTestsEchoImManager; typedef struct _TpTestsEchoImManagerClass TpTestsEchoImManagerClass; typedef struct _TpTestsEchoImManagerPrivate TpTestsEchoImManagerPrivate; struct _TpTestsEchoImManagerClass { GObjectClass parent_class; }; struct _TpTestsEchoImManager { GObject parent; TpTestsEchoImManagerPrivate *priv; }; GType tp_tests_echo_im_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_ECHO_IM_MANAGER \ (tp_tests_echo_im_manager_get_type ()) #define TP_TESTS_ECHO_IM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_ECHO_IM_MANAGER, \ TpTestsEchoImManager)) #define TP_TESTS_ECHO_IM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_ECHO_IM_MANAGER, \ TpTestsEchoImManagerClass)) #define TP_TESTS_IS_ECHO_IM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_ECHO_IM_MANAGER)) #define TP_TESTS_IS_ECHO_IM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_ECHO_IM_MANAGER)) #define TP_TESTS_ECHO_IM_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ECHO_IM_MANAGER, \ TpTestsEchoImManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/contacts-conn.c0000644000175000017500000013116212652510705016266 00000000000000/* * contacts-conn.c - connection with contact info * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "contacts-conn.h" #include #include #include #include "debug.h" static void init_aliasing (gpointer, gpointer); static void init_avatars (gpointer, gpointer); static void init_location (gpointer, gpointer); static void init_contact_caps (gpointer, gpointer); static void init_contact_info (gpointer, gpointer); static void conn_avatars_properties_getter (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data); G_DEFINE_TYPE_WITH_CODE (TpTestsContactsConnection, tp_tests_contacts_connection, TP_TESTS_TYPE_SIMPLE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, init_aliasing); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_AVATARS, init_avatars); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, tp_presence_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE, tp_presence_mixin_simple_presence_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_LOCATION, init_location) G_IMPLEMENT_INTERFACE ( TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_CAPABILITIES, init_contact_caps) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_INFO, init_contact_info) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST, tp_base_contact_list_mixin_list_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS, tp_base_contact_list_mixin_groups_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CLIENT_TYPES, NULL); ); /* type definition stuff */ static const char *mime_types[] = { "image/png", NULL }; static TpDBusPropertiesMixinPropImpl conn_avatars_properties[] = { { "MinimumAvatarWidth", GUINT_TO_POINTER (1), NULL }, { "MinimumAvatarHeight", GUINT_TO_POINTER (2), NULL }, { "RecommendedAvatarWidth", GUINT_TO_POINTER (3), NULL }, { "RecommendedAvatarHeight", GUINT_TO_POINTER (4), NULL }, { "MaximumAvatarWidth", GUINT_TO_POINTER (5), NULL }, { "MaximumAvatarHeight", GUINT_TO_POINTER (6), NULL }, { "MaximumAvatarBytes", GUINT_TO_POINTER (7), NULL }, /* special-cased - it's the only one with a non-guint value */ { "SupportedAvatarMIMETypes", NULL, NULL }, { NULL } }; enum { N_SIGNALS }; struct _TpTestsContactsConnectionPrivate { /* TpHandle => gchar * */ GHashTable *aliases; /* TpHandle => AvatarData */ GHashTable *avatars; /* TpHandle => ContactsConnectionPresenceStatusIndex */ GHashTable *presence_statuses; /* TpHandle => gchar * */ GHashTable *presence_messages; /* TpHandle => GHashTable * */ GHashTable *locations; /* TpHandle => GPtrArray * */ GHashTable *capabilities; /* TpHandle => GPtrArray * */ GHashTable *contact_info; GPtrArray *default_contact_info; TpTestsContactListManager *list_manager; }; typedef struct { GArray *data; gchar *mime_type; gchar *token; } AvatarData; static AvatarData * avatar_data_new (GArray *data, const gchar *mime_type, const gchar *token) { AvatarData *a; a = g_slice_new (AvatarData); a->data = data ? g_array_ref (data) : NULL; a->mime_type = g_strdup (mime_type); a->token = g_strdup (token); return a; } static void avatar_data_free (gpointer data) { AvatarData *a = data; if (a != NULL) { if (a->data != NULL) g_array_unref (a->data); g_free (a->mime_type); g_free (a->token); g_slice_free (AvatarData, a); } } static void free_rcc_list (GPtrArray *rccs) { g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, rccs); } static void tp_tests_contacts_connection_init (TpTestsContactsConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_CONTACTS_CONNECTION, TpTestsContactsConnectionPrivate); self->priv->aliases = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); self->priv->avatars = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, avatar_data_free); self->priv->presence_statuses = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); self->priv->presence_messages = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); self->priv->locations = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_hash_table_unref); self->priv->capabilities = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) free_rcc_list); self->priv->contact_info = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_ptr_array_unref); } static void finalize (GObject *object) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); tp_contacts_mixin_finalize (object); g_hash_table_unref (self->priv->aliases); g_hash_table_unref (self->priv->avatars); g_hash_table_unref (self->priv->presence_statuses); g_hash_table_unref (self->priv->presence_messages); g_hash_table_unref (self->priv->locations); g_hash_table_unref (self->priv->capabilities); g_hash_table_unref (self->priv->contact_info); if (self->priv->default_contact_info != NULL) g_ptr_array_unref (self->priv->default_contact_info); G_OBJECT_CLASS (tp_tests_contacts_connection_parent_class)->finalize (object); } static void aliasing_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); const gchar *alias = g_hash_table_lookup (self->priv->aliases, GUINT_TO_POINTER (handle)); if (alias == NULL) { alias = tp_handle_inspect (contact_repo, handle); } tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias", tp_g_value_slice_new_string (alias)); } } static void avatars_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); AvatarData *a = g_hash_table_lookup (self->priv->avatars, GUINT_TO_POINTER (handle)); if (a != NULL && a->token != NULL) { tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_IFACE_CONNECTION_INTERFACE_AVATARS "/token", tp_g_value_slice_new_string (a->token)); } } } static void location_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); GHashTable *location = g_hash_table_lookup (self->priv->locations, GUINT_TO_POINTER (handle)); if (location != NULL) { tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_IFACE_CONNECTION_INTERFACE_LOCATION "/location", tp_g_value_slice_new_boxed (TP_HASH_TYPE_LOCATION, location)); } } } static void contact_caps_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); GPtrArray *caps = g_hash_table_lookup (self->priv->capabilities, GUINT_TO_POINTER (handle)); if (caps != NULL) { tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES "/capabilities", tp_g_value_slice_new_boxed ( TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps)); } } } static void contact_info_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); GPtrArray *info = g_hash_table_lookup (self->priv->contact_info, GUINT_TO_POINTER (handle)); if (info != NULL) { tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO "/info", tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST, info)); } } } static TpDBusPropertiesMixinPropImpl conn_contact_info_properties[] = { { "ContactInfoFlags", GUINT_TO_POINTER (TP_CONTACT_INFO_FLAG_PUSH | TP_CONTACT_INFO_FLAG_CAN_SET), NULL }, { "SupportedFields", NULL, NULL }, { NULL } }; static void conn_contact_info_properties_getter (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data) { GQuark q_supported_fields = g_quark_from_static_string ("SupportedFields"); static GPtrArray *supported_fields = NULL; if (name == q_supported_fields) { if (supported_fields == NULL) { supported_fields = g_ptr_array_new (); g_ptr_array_add (supported_fields, tp_value_array_build (4, G_TYPE_STRING, "bday", G_TYPE_STRV, NULL, G_TYPE_UINT, 0, G_TYPE_UINT, 1, G_TYPE_INVALID)); g_ptr_array_add (supported_fields, tp_value_array_build (4, G_TYPE_STRING, "email", G_TYPE_STRV, NULL, G_TYPE_UINT, 0, G_TYPE_UINT, G_MAXUINT32, G_TYPE_INVALID)); g_ptr_array_add (supported_fields, tp_value_array_build (4, G_TYPE_STRING, "fn", G_TYPE_STRV, NULL, G_TYPE_UINT, 0, G_TYPE_UINT, 1, G_TYPE_INVALID)); g_ptr_array_add (supported_fields, tp_value_array_build (4, G_TYPE_STRING, "tel", G_TYPE_STRV, NULL, G_TYPE_UINT, 0, G_TYPE_UINT, G_MAXUINT32, G_TYPE_INVALID)); g_ptr_array_add (supported_fields, tp_value_array_build (4, G_TYPE_STRING, "url", G_TYPE_STRV, NULL, G_TYPE_UINT, 0, G_TYPE_UINT, G_MAXUINT32, G_TYPE_INVALID)); } g_value_set_boxed (value, supported_fields); } else { g_value_set_uint (value, GPOINTER_TO_UINT (getter_data)); } } static void client_types_fill_contact_attributes ( GObject *object, const GArray *contacts, GHashTable *attributes) { TpTestsContactsConnectionClass *klass = TP_TESTS_CONTACTS_CONNECTION_GET_CLASS (object); if (klass->fill_client_types != NULL) klass->fill_client_types (object, contacts, attributes); /* …else do nothing: a no-op implementation is valid, relatively speaking. * The spec sez the /client-types attribute should be “omitted from the * result if the contact's client types are not known.” */ } static void constructed (GObject *object) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*parent_impl) (GObject *) = G_OBJECT_CLASS (tp_tests_contacts_connection_parent_class)->constructed; if (parent_impl != NULL) parent_impl (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (TpTestsContactsConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); if (self->priv->list_manager) tp_base_contact_list_mixin_register_with_contacts_mixin (base); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_ALIASING, aliasing_fill_contact_attributes); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_AVATARS, avatars_fill_contact_attributes); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_LOCATION, location_fill_contact_attributes); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES, contact_caps_fill_contact_attributes); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, contact_info_fill_contact_attributes); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES, client_types_fill_contact_attributes); tp_presence_mixin_init (object, G_STRUCT_OFFSET (TpTestsContactsConnection, presence_mixin)); tp_presence_mixin_simple_presence_register_with_contacts_mixin (object); } static const TpPresenceStatusOptionalArgumentSpec can_have_message[] = { { "message", "s", NULL, NULL }, { NULL } }; /* Must match TpTestsContactsConnectionPresenceStatusIndex in the .h */ static const TpPresenceStatusSpec my_statuses[] = { { "available", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, TRUE, can_have_message }, { "busy", TP_CONNECTION_PRESENCE_TYPE_BUSY, TRUE, can_have_message }, { "away", TP_CONNECTION_PRESENCE_TYPE_AWAY, TRUE, can_have_message }, { "offline", TP_CONNECTION_PRESENCE_TYPE_OFFLINE, FALSE, NULL }, { "unknown", TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, FALSE, NULL }, { "error", TP_CONNECTION_PRESENCE_TYPE_ERROR, FALSE, NULL }, { NULL } }; static gboolean my_status_available (GObject *object, guint index) { TpBaseConnection *base = TP_BASE_CONNECTION (object); return tp_base_connection_check_connected (base, NULL); } static GHashTable * my_get_contact_statuses (GObject *object, const GArray *contacts, GError **error) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) tp_presence_status_free); guint i; for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); gpointer key = GUINT_TO_POINTER (handle); TpTestsContactsConnectionPresenceStatusIndex index; const gchar *presence_message; GHashTable *parameters; index = GPOINTER_TO_UINT (g_hash_table_lookup ( self->priv->presence_statuses, key)); presence_message = g_hash_table_lookup ( self->priv->presence_messages, key); parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); if (presence_message != NULL) g_hash_table_insert (parameters, (gpointer) "message", tp_g_value_slice_new_string (presence_message)); g_hash_table_insert (result, key, tp_presence_status_new (index, parameters)); g_hash_table_unref (parameters); } return result; } static gboolean my_set_own_status (GObject *object, const TpPresenceStatus *status, GError **error) { TpBaseConnection *base_conn = TP_BASE_CONNECTION (object); TpTestsContactsConnectionPresenceStatusIndex index = status->index; const gchar *message = ""; TpHandle self_handle; if (status->optional_arguments != NULL) { message = g_hash_table_lookup (status->optional_arguments, "message"); if (message == NULL) message = ""; } self_handle = tp_base_connection_get_self_handle (base_conn); tp_tests_contacts_connection_change_presences (TP_TESTS_CONTACTS_CONNECTION (object), 1, &self_handle, &index, &message); return TRUE; } static guint my_get_maximum_status_message_length_cb (GObject *obj) { return 512; } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (conn); GPtrArray *ret = g_ptr_array_sized_new (1); self->priv->list_manager = g_object_new (TP_TESTS_TYPE_CONTACT_LIST_MANAGER, "connection", conn, NULL); g_ptr_array_add (ret, self->priv->list_manager); return ret; } static GPtrArray * tp_tests_contacts_get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_AVATARS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, TP_IFACE_CONNECTION_INTERFACE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_LOCATION, TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, NULL }; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_contacts_connection_parent_class)->get_interfaces_always_present (base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void tp_tests_contacts_connection_class_init (TpTestsContactsConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; TpPresenceMixinClass *mixin_class; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CONNECTION_INTERFACE_AVATARS, conn_avatars_properties_getter, NULL, conn_avatars_properties, }, { TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, conn_contact_info_properties_getter, NULL, conn_contact_info_properties, }, { NULL } }; object_class->constructed = constructed; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (TpTestsContactsConnectionPrivate)); base_class->get_interfaces_always_present = tp_tests_contacts_get_interfaces_always_present; base_class->create_channel_managers = create_channel_managers; tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsContactsConnectionClass, contacts_mixin)); tp_presence_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsContactsConnectionClass, presence_mixin), my_status_available, my_get_contact_statuses, my_set_own_status, my_statuses); mixin_class = TP_PRESENCE_MIXIN_CLASS(klass); mixin_class->get_maximum_status_message_length = my_get_maximum_status_message_length_cb; tp_presence_mixin_simple_presence_init_dbus_properties (object_class); klass->properties_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsContactsConnectionClass, properties_class)); tp_base_contact_list_mixin_class_init (base_class); } TpTestsContactListManager * tp_tests_contacts_connection_get_contact_list_manager ( TpTestsContactsConnection *self) { return self->priv->list_manager; } /** * tp_tests_contacts_connection_change_aliases: * @self: a #TpTestsContactsConnection * @n: the number of handles * @handles: (array length=n): the handles * @aliases: (array length=n): aliases * */ void tp_tests_contacts_connection_change_aliases (TpTestsContactsConnection *self, guint n, const TpHandle *handles, const gchar * const *aliases) { GPtrArray *structs = g_ptr_array_sized_new (n); guint i; for (i = 0; i < n; i++) { GValueArray *pair = tp_value_array_build (2, G_TYPE_UINT, handles[i], G_TYPE_STRING, aliases[i], G_TYPE_INVALID); DEBUG ("contact#%u -> %s", handles[i], aliases[i]); g_hash_table_insert (self->priv->aliases, GUINT_TO_POINTER (handles[i]), g_strdup (aliases[i])); g_ptr_array_add (structs, pair); } tp_svc_connection_interface_aliasing_emit_aliases_changed (self, structs); g_ptr_array_foreach (structs, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (structs); } void tp_tests_contacts_connection_change_presences ( TpTestsContactsConnection *self, guint n, const TpHandle *handles, const TpTestsContactsConnectionPresenceStatusIndex *indexes, const gchar * const *messages) { GHashTable *presences = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) tp_presence_status_free); guint i; for (i = 0; i < n; i++) { GHashTable *parameters; gpointer key = GUINT_TO_POINTER (handles[i]); DEBUG ("contact#%u -> %s \"%s\"", handles[i], my_statuses[indexes[i]].name, messages[i]); g_hash_table_insert (self->priv->presence_statuses, key, GUINT_TO_POINTER (indexes[i])); g_hash_table_insert (self->priv->presence_messages, key, g_strdup (messages[i])); parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); if (messages[i] != NULL && messages[i][0] != '\0') g_hash_table_insert (parameters, (gpointer) "message", tp_g_value_slice_new_string (messages[i])); g_hash_table_insert (presences, key, tp_presence_status_new (indexes[i], parameters)); g_hash_table_unref (parameters); } tp_presence_mixin_emit_presence_update ((GObject *) self, presences); g_hash_table_unref (presences); } void tp_tests_contacts_connection_change_avatar_tokens (TpTestsContactsConnection *self, guint n, const TpHandle *handles, const gchar * const *tokens) { guint i; for (i = 0; i < n; i++) { DEBUG ("contact#%u -> %s", handles[i], tokens[i]); g_hash_table_insert (self->priv->avatars, GUINT_TO_POINTER (handles[i]), avatar_data_new (NULL, NULL, tokens[i])); tp_svc_connection_interface_avatars_emit_avatar_updated (self, handles[i], tokens[i]); } } void tp_tests_contacts_connection_change_avatar_data ( TpTestsContactsConnection *self, TpHandle handle, GArray *data, const gchar *mime_type, const gchar *token) { g_hash_table_insert (self->priv->avatars, GUINT_TO_POINTER (handle), avatar_data_new (data, mime_type, token)); tp_svc_connection_interface_avatars_emit_avatar_updated (self, handle, token); } void tp_tests_contacts_connection_change_locations (TpTestsContactsConnection *self, guint n, const TpHandle *handles, GHashTable **locations) { guint i; for (i = 0; i < n; i++) { DEBUG ("contact#%u ->", handles[i]); tp_asv_dump (locations[i]); g_hash_table_insert (self->priv->locations, GUINT_TO_POINTER (handles[i]), g_hash_table_ref (locations[i])); tp_svc_connection_interface_location_emit_location_updated (self, handles[i], locations[i]); } } void tp_tests_contacts_connection_change_capabilities ( TpTestsContactsConnection *self, GHashTable *capabilities) { GHashTableIter iter; gpointer handle, caps; g_hash_table_iter_init (&iter, capabilities); while (g_hash_table_iter_next (&iter, &handle, &caps)) { g_hash_table_insert (self->priv->capabilities, handle, g_boxed_copy (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, caps)); } tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed ( self, capabilities); } void tp_tests_contacts_connection_change_contact_info ( TpTestsContactsConnection *self, TpHandle handle, GPtrArray *info) { g_hash_table_insert (self->priv->contact_info, GUINT_TO_POINTER (handle), g_ptr_array_ref (info)); tp_svc_connection_interface_contact_info_emit_contact_info_changed (self, handle, info); } void tp_tests_contacts_connection_set_default_contact_info ( TpTestsContactsConnection *self, GPtrArray *info) { if (self->priv->default_contact_info != NULL) g_ptr_array_unref (self->priv->default_contact_info); self->priv->default_contact_info = g_ptr_array_ref (info); } static void my_get_alias_flags (TpSvcConnectionInterfaceAliasing *aliasing, DBusGMethodInvocation *context) { TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); tp_svc_connection_interface_aliasing_return_from_get_alias_flags (context, TP_CONNECTION_ALIAS_FLAG_USER_SET); } static void my_get_aliases (TpSvcConnectionInterfaceAliasing *aliasing, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GHashTable *result; GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); const gchar *alias = g_hash_table_lookup (self->priv->aliases, GUINT_TO_POINTER (handle)); if (alias == NULL) g_hash_table_insert (result, GUINT_TO_POINTER (handle), (gchar *) tp_handle_inspect (contact_repo, handle)); else g_hash_table_insert (result, GUINT_TO_POINTER (handle), (gchar *) alias); } tp_svc_connection_interface_aliasing_return_from_get_aliases (context, result); g_hash_table_unref (result); } static void my_request_aliases (TpSvcConnectionInterfaceAliasing *aliasing, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GPtrArray *result; gchar **strings; GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_ptr_array_sized_new (contacts->len + 1); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); const gchar *alias = g_hash_table_lookup (self->priv->aliases, GUINT_TO_POINTER (handle)); if (alias == NULL) g_ptr_array_add (result, (gchar *) tp_handle_inspect (contact_repo, handle)); else g_ptr_array_add (result, (gchar *) alias); } g_ptr_array_add (result, NULL); strings = (gchar **) g_ptr_array_free (result, FALSE); tp_svc_connection_interface_aliasing_return_from_request_aliases (context, (const gchar **) strings); g_free (strings); } static void my_set_aliases (TpSvcConnectionInterfaceAliasing *aliasing, GHashTable *table, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); guint n; GArray *handles; GPtrArray *aliases; GHashTableIter iter; gpointer key, value; GError *error = NULL; /* Convert the hash table to arrays of handles and aliases */ n = g_hash_table_size (table); handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n); aliases = g_ptr_array_sized_new (n); g_hash_table_iter_init (&iter, table); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); g_array_append_val (handles, handle); g_ptr_array_add (aliases, value); } g_assert_cmpuint (handles->len, ==, n); g_assert_cmpuint (aliases->len, ==, n); /* Verify all handles are valid */ if (!tp_handles_are_valid (contact_repo, handles, FALSE, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); goto out; } /* Change aliases */ tp_tests_contacts_connection_change_aliases (self, n, (const TpHandle *) handles->data, (const gchar * const *) aliases->pdata); tp_svc_connection_interface_aliasing_return_from_set_aliases (context); out: g_array_unref (handles); g_ptr_array_unref (aliases); } static void init_aliasing (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceAliasingClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x (\ klass, my_##x) IMPLEMENT(get_alias_flags); IMPLEMENT(request_aliases); IMPLEMENT(get_aliases); IMPLEMENT(set_aliases); #undef IMPLEMENT } static void my_get_avatar_tokens (TpSvcConnectionInterfaceAvatars *avatars, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (avatars); TpBaseConnection *base = TP_BASE_CONNECTION (avatars); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; GHashTable *result; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); AvatarData *a = g_hash_table_lookup (self->priv->avatars, GUINT_TO_POINTER (handle)); if (a == NULL || a->token == NULL) { /* we're expected to do a round-trip to the server to find out * their token, so we have to give some sort of result. Assume * no avatar, here */ a = avatar_data_new (NULL, NULL, ""); g_hash_table_insert (self->priv->avatars, GUINT_TO_POINTER (handle), a); tp_svc_connection_interface_avatars_emit_avatar_updated (self, handle, a->token); } g_hash_table_insert (result, GUINT_TO_POINTER (handle), a->token); } tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ( context, result); g_hash_table_unref (result); } static void my_get_known_avatar_tokens (TpSvcConnectionInterfaceAvatars *avatars, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (avatars); TpBaseConnection *base = TP_BASE_CONNECTION (avatars); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; GHashTable *result; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); AvatarData *a = g_hash_table_lookup (self->priv->avatars, GUINT_TO_POINTER (handle)); const gchar *token = a ? a->token : NULL; g_hash_table_insert (result, GUINT_TO_POINTER (handle), (gchar *) (token != NULL ? token : "")); } tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ( context, result); g_hash_table_unref (result); } static void my_request_avatars (TpSvcConnectionInterfaceAvatars *avatars, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (avatars); TpBaseConnection *base = TP_BASE_CONNECTION (avatars); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); AvatarData *a = g_hash_table_lookup (self->priv->avatars, GUINT_TO_POINTER (handle)); if (a != NULL) tp_svc_connection_interface_avatars_emit_avatar_retrieved (self, handle, a->token, a->data, a->mime_type); } tp_svc_connection_interface_avatars_return_from_request_avatars (context); } static void conn_avatars_properties_getter (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data) { GQuark q_mime_types = g_quark_from_static_string ( "SupportedAvatarMIMETypes"); if (name == q_mime_types) { g_value_set_static_boxed (value, mime_types); } else { g_value_set_uint (value, GPOINTER_TO_UINT (getter_data)); } } static void init_avatars (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceAvatarsClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_avatars_implement_##x (\ klass, my_##x) /* IMPLEMENT(get_avatar_requirements); */ IMPLEMENT(get_avatar_tokens); IMPLEMENT(get_known_avatar_tokens); /* IMPLEMENT(request_avatar); */ IMPLEMENT(request_avatars); /* IMPLEMENT(set_avatar); */ /* IMPLEMENT(clear_avatar); */ #undef IMPLEMENT } static void my_get_locations (TpSvcConnectionInterfaceLocation *avatars, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (avatars); TpBaseConnection *base = TP_BASE_CONNECTION (avatars); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; GHashTable *result; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); GHashTable *location = g_hash_table_lookup (self->priv->locations, GUINT_TO_POINTER (handle)); if (location != NULL) { g_hash_table_insert (result, GUINT_TO_POINTER (handle), location); } } tp_svc_connection_interface_location_return_from_get_locations ( context, result); g_hash_table_unref (result); } static void init_location (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceLocationClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_location_implement_##x (\ klass, my_##x) IMPLEMENT(get_locations); #undef IMPLEMENT } static void my_get_contact_capabilities (TpSvcConnectionInterfaceContactCapabilities *obj, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (obj); TpBaseConnection *base = TP_BASE_CONNECTION (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; GHashTable *result; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); GPtrArray *arr = g_hash_table_lookup (self->priv->capabilities, GUINT_TO_POINTER (handle)); if (arr != NULL) { g_hash_table_insert (result, GUINT_TO_POINTER (handle), arr); } } tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities ( context, result); g_hash_table_unref (result); } static void init_contact_caps (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactCapabilitiesClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_contact_capabilities_implement_##x (\ klass, my_##x) IMPLEMENT(get_contact_capabilities); #undef IMPLEMENT } static GPtrArray * lookup_contact_info (TpTestsContactsConnection *self, TpHandle handle) { GPtrArray *ret = g_hash_table_lookup (self->priv->contact_info, GUINT_TO_POINTER (handle)); if (ret == NULL && self->priv->default_contact_info != NULL) { ret = self->priv->default_contact_info; g_hash_table_insert (self->priv->contact_info, GUINT_TO_POINTER (handle), g_ptr_array_ref (ret)); } if (ret == NULL) return g_ptr_array_new (); return g_ptr_array_ref (ret); } static void my_refresh_contact_info (TpSvcConnectionInterfaceContactInfo *obj, const GArray *contacts, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (obj); TpBaseConnection *base = TP_BASE_CONNECTION (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); GPtrArray *arr = lookup_contact_info (self, handle); tp_svc_connection_interface_contact_info_emit_contact_info_changed (self, handle, arr); g_ptr_array_unref (arr); } tp_svc_connection_interface_contact_info_return_from_refresh_contact_info ( context); } static void my_request_contact_info (TpSvcConnectionInterfaceContactInfo *obj, guint handle, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (obj); TpBaseConnection *base = TP_BASE_CONNECTION (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; GPtrArray *ret; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handle_is_valid (contact_repo, handle, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } ret = lookup_contact_info (self, handle); tp_svc_connection_interface_contact_info_return_from_request_contact_info ( context, ret); g_ptr_array_unref (ret); } static void my_set_contact_info (TpSvcConnectionInterfaceContactInfo *obj, const GPtrArray *info, DBusGMethodInvocation *context) { TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (obj); TpBaseConnection *base = TP_BASE_CONNECTION (obj); GPtrArray *copy; guint i; TpHandle self_handle; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); /* Deep copy info */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS copy = g_ptr_array_new_with_free_func ((GDestroyNotify) g_value_array_free); for (i = 0; i < info->len; i++) g_ptr_array_add (copy, g_value_array_copy (g_ptr_array_index (info, i))); G_GNUC_END_IGNORE_DEPRECATIONS self_handle = tp_base_connection_get_self_handle (base); tp_tests_contacts_connection_change_contact_info (self, self_handle, copy); g_ptr_array_unref (copy); tp_svc_connection_interface_contact_info_return_from_set_contact_info ( context); } static void init_contact_info (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactInfoClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_contact_info_implement_##x (\ klass, my_##x) IMPLEMENT (refresh_contact_info); IMPLEMENT (request_contact_info); IMPLEMENT (set_contact_info); #undef IMPLEMENT } /* =============== Legacy version (no Contacts interface) ================= */ G_DEFINE_TYPE (TpTestsLegacyContactsConnection, tp_tests_legacy_contacts_connection, TP_TESTS_TYPE_CONTACTS_CONNECTION); enum { LEGACY_PROP_HAS_IMMORTAL_HANDLES = 1 }; static void legacy_contacts_connection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case LEGACY_PROP_HAS_IMMORTAL_HANDLES: /* Pretend we don't. */ g_value_set_boolean (value, FALSE); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tests_legacy_contacts_connection_init (TpTestsLegacyContactsConnection *self) { } static GPtrArray * tp_tests_legacy_contacts_get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_legacy_contacts_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_remove (interfaces, TP_IFACE_CONNECTION_INTERFACE_CONTACTS); g_ptr_array_remove (interfaces, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES); return interfaces; } static void tp_tests_legacy_contacts_connection_class_init ( TpTestsLegacyContactsConnectionClass *klass) { /* Leave Contacts out of the interfaces we say are present, so clients * won't use it */ TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; object_class->get_property = legacy_contacts_connection_get_property; base_class->get_interfaces_always_present = tp_tests_legacy_contacts_get_interfaces_always_present; g_object_class_override_property (object_class, LEGACY_PROP_HAS_IMMORTAL_HANDLES, "has-immortal-handles"); } /* =============== No Requests and no ContactCapabilities ================= */ G_DEFINE_TYPE (TpTestsNoRequestsConnection, tp_tests_no_requests_connection, TP_TESTS_TYPE_CONTACTS_CONNECTION); static void tp_tests_no_requests_connection_init (TpTestsNoRequestsConnection *self) { } static GPtrArray * tp_tests_no_requests_get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_no_requests_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_remove (interfaces, TP_IFACE_CONNECTION_INTERFACE_REQUESTS); g_ptr_array_remove (interfaces, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES); return interfaces; } static void tp_tests_no_requests_connection_class_init ( TpTestsNoRequestsConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; base_class->get_interfaces_always_present = tp_tests_no_requests_get_interfaces_always_present; base_class->create_channel_managers = NULL; } telepathy-glib-0.24.2/tests/lib/contacts-conn.h0000644000175000017500000001613012652510705016270 00000000000000/* * contacts-conn.h - header for a connection with contact info * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_CONTACTS_CONN_H__ #define __TP_TESTS_CONTACTS_CONN_H__ #include #include #include "simple-conn.h" #include "contact-list-manager.h" G_BEGIN_DECLS typedef struct _TpTestsContactsConnection TpTestsContactsConnection; typedef struct _TpTestsContactsConnectionClass TpTestsContactsConnectionClass; typedef struct _TpTestsContactsConnectionPrivate TpTestsContactsConnectionPrivate; struct _TpTestsContactsConnectionClass { TpTestsSimpleConnectionClass parent_class; TpPresenceMixinClass presence_mixin; TpContactsMixinClass contacts_mixin; TpDBusPropertiesMixinClass properties_class; TpContactsMixinFillContactAttributesFunc fill_client_types; }; struct _TpTestsContactsConnection { TpTestsSimpleConnection parent; TpPresenceMixin presence_mixin; TpContactsMixin contacts_mixin; TpTestsContactsConnectionPrivate *priv; }; GType tp_tests_contacts_connection_get_type (void); /* Must match my_statuses in the .c */ typedef enum { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY, TP_TESTS_CONTACTS_CONNECTION_STATUS_OFFLINE, TP_TESTS_CONTACTS_CONNECTION_STATUS_UNKNOWN, TP_TESTS_CONTACTS_CONNECTION_STATUS_ERROR } TpTestsContactsConnectionPresenceStatusIndex; /* TYPE MACROS */ #define TP_TESTS_TYPE_CONTACTS_CONNECTION \ (tp_tests_contacts_connection_get_type ()) #define TP_TESTS_CONTACTS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION, \ TpTestsContactsConnection)) #define TP_TESTS_CONTACTS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_CONTACTS_CONNECTION, \ TpTestsContactsConnectionClass)) #define TP_TESTS_IS_CONTACTS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION)) #define TP_TESTS_IS_CONTACTS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_CONTACTS_CONNECTION)) #define TP_TESTS_CONTACTS_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_CONTACTS_CONNECTION, \ TpTestsContactsConnectionClass)) TpTestsContactListManager *tp_tests_contacts_connection_get_contact_list_manager ( TpTestsContactsConnection *self); void tp_tests_contacts_connection_change_aliases ( TpTestsContactsConnection *self, guint n, const TpHandle *handles, const gchar * const *aliases); void tp_tests_contacts_connection_change_presences ( TpTestsContactsConnection *self, guint n, const TpHandle *handles, const TpTestsContactsConnectionPresenceStatusIndex *indexes, const gchar * const *messages); void tp_tests_contacts_connection_change_avatar_tokens ( TpTestsContactsConnection *self, guint n, const TpHandle *handles, const gchar * const *tokens); void tp_tests_contacts_connection_change_avatar_data ( TpTestsContactsConnection *self, TpHandle handle, GArray *data, const gchar *mime_type, const gchar *token); void tp_tests_contacts_connection_change_locations ( TpTestsContactsConnection *self, guint n, const TpHandle *handles, GHashTable **locations); void tp_tests_contacts_connection_change_capabilities ( TpTestsContactsConnection *self, GHashTable *capabilities); void tp_tests_contacts_connection_change_contact_info ( TpTestsContactsConnection *self, TpHandle handle, GPtrArray *info); void tp_tests_contacts_connection_set_default_contact_info ( TpTestsContactsConnection *self, GPtrArray *info); /* Legacy version (no Contacts interface, and no immortal handles) */ typedef struct _TpTestsLegacyContactsConnection TpTestsLegacyContactsConnection; typedef struct _TpTestsLegacyContactsConnectionClass TpTestsLegacyContactsConnectionClass; typedef struct _TpTestsLegacyContactsConnectionPrivate TpTestsLegacyContactsConnectionPrivate; struct _TpTestsLegacyContactsConnectionClass { TpTestsContactsConnectionClass parent_class; }; struct _TpTestsLegacyContactsConnection { TpTestsContactsConnection parent; TpTestsLegacyContactsConnectionPrivate *priv; }; GType tp_tests_legacy_contacts_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION \ (tp_tests_legacy_contacts_connection_get_type ()) #define LEGACY_TP_TESTS_CONTACTS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \ TpTestsLegacyContactsConnection)) #define LEGACY_TP_TESTS_CONTACTS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \ TpTestsLegacyContactsConnectionClass)) #define TP_TESTS_LEGACY_CONTACTS_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION)) #define TP_TESTS_LEGACY_CONTACTS_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION)) #define LEGACY_TP_TESTS_CONTACTS_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, \ TpTestsLegacyContactsConnectionClass)) /* No Requests version */ typedef struct _TpTestsNoRequestsConnection TpTestsNoRequestsConnection; typedef struct _TpTestsNoRequestsConnectionClass TpTestsNoRequestsConnectionClass; typedef struct _TpTestsNoRequestsConnectionPrivate TpTestsNoRequestsConnectionPrivate; struct _TpTestsNoRequestsConnectionClass { TpTestsContactsConnectionClass parent_class; }; struct _TpTestsNoRequestsConnection { TpTestsContactsConnection parent; TpTestsNoRequestsConnectionPrivate *priv; }; GType tp_tests_no_requests_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_NO_REQUESTS_CONNECTION \ (tp_tests_no_requests_connection_get_type ()) #define TP_TESTS_NO_REQUESTS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \ TpTestsNoRequestsConnection)) #define TP_TESTS_NO_REQUESTS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \ TpTestsNoRequestsConnectionClass)) #define TP_TESTS_NO_REQUESTS_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION)) #define TP_TESTS_NO_REQUESTS_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION)) #define TP_TESTS_NO_REQUESTS_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, \ TpTestsNoRequestsConnectionClass)) G_END_DECLS #endif /* ifndef __TP_TESTS_CONTACTS_CONN_H__ */ telepathy-glib-0.24.2/tests/lib/echo-chan.c0000644000175000017500000001510512652510705015340 00000000000000/* * chan.c - an example text channel talking to a particular * contact. Similar code is used for 1-1 IM channels in many protocols * (IRC private messages ("/query"), XMPP IM etc.) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "echo-chan.h" #include #include /* This is for text-mixin unit tests, others should be using ExampleEcho2Channel * which uses newer TpMessageMixin */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void text_iface_init (gpointer iface, gpointer data); static void destroyable_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TpTestsEchoChannel, tp_tests_echo_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE, destroyable_iface_init); ) /* type definition stuff */ static GPtrArray * tp_tests_echo_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS (tp_tests_echo_channel_parent_class)-> get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE); return interfaces; }; static void tp_tests_echo_channel_init (TpTestsEchoChannel *self) { } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_echo_channel_parent_class)->constructor (type, n_props, props); TpTestsEchoChannel *self = TP_TESTS_ECHO_CHANNEL (object); TpHandleRepoIface *contact_repo = NULL; TpBaseConnection *conn = tp_base_channel_get_connection (TP_BASE_CHANNEL (self)); g_assert (conn != NULL); contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); tp_base_channel_register (TP_BASE_CHANNEL (self)); tp_text_mixin_init (object, G_STRUCT_OFFSET (TpTestsEchoChannel, text), contact_repo); tp_text_mixin_set_message_types (object, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, G_MAXUINT); return object; } static void finalize (GObject *object) { tp_text_mixin_finalize (object); ((GObjectClass *) tp_tests_echo_channel_parent_class)->finalize (object); } static void tp_tests_echo_channel_close (TpTestsEchoChannel *self) { GObject *object = (GObject *) self; gboolean closed = tp_base_channel_is_destroyed (TP_BASE_CHANNEL (self)); if (!closed) { TpHandle first_sender; /* The manager wants to be able to respawn the channel if it has pending * messages. When respawned, the channel must have the initiator set * to the contact who sent us those messages (if it isn't already), * and the messages must be marked as having been rescued so they * don't get logged twice. */ if (tp_text_mixin_has_pending_messages (object, &first_sender)) { tp_base_channel_reopened (TP_BASE_CHANNEL (self), first_sender); tp_text_mixin_set_rescued (object); } else { tp_base_channel_destroyed (TP_BASE_CHANNEL (self)); } } } static void channel_close (TpBaseChannel *channel) { TpTestsEchoChannel *self = TP_TESTS_ECHO_CHANNEL (channel); tp_tests_echo_channel_close (self); } static void tp_tests_echo_channel_class_init (TpTestsEchoChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); object_class->constructor = constructor; object_class->finalize = finalize; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->get_interfaces = tp_tests_echo_channel_get_interfaces; base_class->close = channel_close; tp_text_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsEchoChannelClass, text_class)); } static void text_send (TpSvcChannelTypeText *iface, guint type, const gchar *text, DBusGMethodInvocation *context) { TpTestsEchoChannel *self = TP_TESTS_ECHO_CHANNEL (iface); time_t timestamp = time (NULL); gchar *echo; guint echo_type = type; TpHandle target = tp_base_channel_get_target_handle (TP_BASE_CHANNEL (self)); /* Send should return just before Sent is emitted. */ tp_svc_channel_type_text_return_from_send (context); /* Tell the client that the message was submitted for sending */ tp_svc_channel_type_text_emit_sent ((GObject *) self, timestamp, type, text); /* Pretend that the remote contact has replied. Normally, you'd * call tp_text_mixin_receive or tp_text_mixin_receive_with_flags * in response to network events */ switch (type) { case TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL: echo = g_strdup_printf ("You said: %s", text); break; case TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION: echo = g_strdup_printf ("notices that the user %s", text); break; case TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE: echo = g_strdup_printf ("You sent a notice: %s", text); break; default: echo = g_strdup_printf ("You sent some weird message type, %u: \"%s\"", type, text); echo_type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL; } tp_text_mixin_receive ((GObject *) self, echo_type, target, timestamp, echo); g_free (echo); } static void text_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeTextClass *klass = iface; tp_text_mixin_iface_init (iface, data); #define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (klass, text_##x) IMPLEMENT (send); #undef IMPLEMENT } static void destroyable_destroy (TpSvcChannelInterfaceDestroyable *iface, DBusGMethodInvocation *context) { TpTestsEchoChannel *self = TP_TESTS_ECHO_CHANNEL (iface); tp_text_mixin_clear ((GObject *) self); tp_base_channel_destroyed (TP_BASE_CHANNEL (self)); tp_svc_channel_interface_destroyable_return_from_destroy (context); } static void destroyable_iface_init (gpointer iface, gpointer data) { TpSvcChannelInterfaceDestroyableClass *klass = iface; #define IMPLEMENT(x) \ tp_svc_channel_interface_destroyable_implement_##x (klass, destroyable_##x) IMPLEMENT (destroy); #undef IMPLEMENT } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/tests/lib/echo-chan.h0000644000175000017500000000347012652510705015347 00000000000000/* * chan.h - header for an example channel * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_CHAN_H__ #define __TP_TESTS_CHAN_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsEchoChannel TpTestsEchoChannel; typedef struct _TpTestsEchoChannelClass TpTestsEchoChannelClass; typedef struct _TpTestsEchoChannelPrivate TpTestsEchoChannelPrivate; GType tp_tests_echo_channel_get_type (void); #define TP_TESTS_TYPE_ECHO_CHANNEL \ (tp_tests_echo_channel_get_type ()) #define TP_TESTS_ECHO_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_ECHO_CHANNEL, \ TpTestsEchoChannel)) #define TP_TESTS_ECHO_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_ECHO_CHANNEL, \ TpTestsEchoChannelClass)) #define TP_TESTS_IS_ECHO_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_ECHO_CHANNEL)) #define TP_TESTS_IS_ECHO_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_ECHO_CHANNEL)) #define TP_TESTS_ECHO_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ECHO_CHANNEL, \ TpTestsEchoChannelClass)) struct _TpTestsEchoChannelClass { TpBaseChannelClass parent_class; TpTextMixinClass text_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsEchoChannel { TpBaseChannel parent; TpTextMixin text; TpTestsEchoChannelPrivate *priv; }; G_END_DECLS #endif /* #ifndef __TP_TESTS_CHAN_H__ */ telepathy-glib-0.24.2/tests/lib/simple-channel-dispatch-operation.c0000644000175000017500000002176112652510705022212 00000000000000/* * simple-channel-dispatch-operation.c - a simple channel dispatch operation * service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-channel-dispatch-operation.h" #include #include static void channel_dispatch_operation_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleChannelDispatchOperation, tp_tests_simple_channel_dispatch_operation, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_DISPATCH_OPERATION, channel_dispatch_operation_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) ) /* TP_IFACE_CHANNEL_DISPATCH_OPERATION is implied */ static const char *CHANNEL_DISPATCH_OPERATION_INTERFACES[] = { NULL }; static const gchar *CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS[] = { TP_CLIENT_BUS_NAME_BASE ".Badger", NULL, }; enum { PROP_0, PROP_INTERFACES, PROP_CONNECTION, PROP_ACCOUNT, PROP_CHANNELS, PROP_POSSIBLE_HANDLERS, }; struct _SimpleChannelDispatchOperationPrivate { gchar *conn_path; gchar *account_path; /* Array of TpChannel */ GPtrArray *channels; }; static void tp_tests_simple_channel_dispatch_operation_handle_with ( TpSvcChannelDispatchOperation *iface, const gchar *handler, DBusGMethodInvocation *context) { if (!tp_strdiff (handler, "FAIL")) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Nope" }; dbus_g_method_return_error (context, &error); return; } dbus_g_method_return (context); } static void tp_tests_simple_channel_dispatch_operation_claim ( TpSvcChannelDispatchOperation *iface, DBusGMethodInvocation *context) { tp_svc_channel_dispatch_operation_emit_finished (iface); dbus_g_method_return (context); } static void tp_tests_simple_channel_dispatch_operation_handle_with_time ( TpSvcChannelDispatchOperation *iface, const gchar *handler, gint64 user_action_timestamp, DBusGMethodInvocation *context) { dbus_g_method_return (context); } static void channel_dispatch_operation_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_channel_dispatch_operation_implement_##x (\ klass, tp_tests_simple_channel_dispatch_operation_##x) IMPLEMENT(handle_with); IMPLEMENT(claim); IMPLEMENT(handle_with_time); #undef IMPLEMENT } static void tp_tests_simple_channel_dispatch_operation_init (TpTestsSimpleChannelDispatchOperation *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, TpTestsSimpleChannelDispatchOperationPrivate); self->priv->channels = g_ptr_array_new_with_free_func ( (GDestroyNotify) g_object_unref); } static void tp_tests_simple_channel_dispatch_operation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsSimpleChannelDispatchOperation *self = TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION (object); switch (property_id) { case PROP_INTERFACES: g_value_set_boxed (value, CHANNEL_DISPATCH_OPERATION_INTERFACES); break; case PROP_ACCOUNT: g_value_set_boxed (value, self->priv->account_path); break; case PROP_CONNECTION: g_value_set_boxed (value, self->priv->conn_path); break; case PROP_CHANNELS: { GPtrArray *arr = g_ptr_array_new (); guint i; for (i = 0; i < self->priv->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->priv->channels, i); GValue props_value = G_VALUE_INIT; GVariant *props_variant; /* Yay, double conversion! But this is for tests corner case */ props_variant = tp_channel_dup_immutable_properties (channel); dbus_g_value_parse_g_variant (props_variant, &props_value); g_ptr_array_add (arr, tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, g_value_get_boxed (&props_value), G_TYPE_INVALID)); g_variant_unref (props_variant); g_value_unset (&props_value); } g_value_take_boxed (value, arr); } break; case PROP_POSSIBLE_HANDLERS: g_value_set_boxed (value, CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_channel_dispatch_operation_finalize (GObject *object) { TpTestsSimpleChannelDispatchOperation *self = TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION (object); void (*finalize) (GObject *) = G_OBJECT_CLASS (tp_tests_simple_channel_dispatch_operation_parent_class)->finalize; g_free (self->priv->conn_path); g_free (self->priv->account_path); g_ptr_array_unref (self->priv->channels); if (finalize != NULL) finalize (object); } /** * This class currently only provides the minimum for * tp_channel_dispatch_operation_prepare to succeed. This turns out to be only a working * Properties.GetAll(). */ static void tp_tests_simple_channel_dispatch_operation_class_init (TpTestsSimpleChannelDispatchOperationClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl a_props[] = { { "Interfaces", "interfaces", NULL }, { "Connection", "connection", NULL }, { "Account", "account", NULL }, { "Channels", "channels", NULL }, { "PossibleHandlers", "possible-handlers", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_DISPATCH_OPERATION, tp_dbus_properties_mixin_getter_gobject_properties, NULL, a_props }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpTestsSimpleChannelDispatchOperationPrivate)); object_class->get_property = tp_tests_simple_channel_dispatch_operation_get_property; object_class->finalize = tp_tests_simple_channel_dispatch_operation_finalize; param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "In this case we only implement ChannelDispatchOperation, so none.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_boxed ("connection", "connection path", "Connection path", DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_boxed ("account", "account path", "Account path", DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_boxed ("channels", "channel paths", "Channel paths", TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNELS, param_spec); param_spec = g_param_spec_boxed ("possible-handlers", "possible handlers", "possible handles", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_POSSIBLE_HANDLERS, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsSimpleChannelDispatchOperationClass, dbus_props_class)); } void tp_tests_simple_channel_dispatch_operation_set_conn_path ( TpTestsSimpleChannelDispatchOperation *self, const gchar *conn_path) { self->priv->conn_path = g_strdup (conn_path); } void tp_tests_simple_channel_dispatch_operation_add_channel ( TpTestsSimpleChannelDispatchOperation *self, TpChannel *chan) { g_ptr_array_add (self->priv->channels, g_object_ref (chan)); } void tp_tests_simple_channel_dispatch_operation_lost_channel ( TpTestsSimpleChannelDispatchOperation *self, TpChannel *chan) { const gchar *path = tp_proxy_get_object_path (chan); g_ptr_array_remove (self->priv->channels, chan); tp_svc_channel_dispatch_operation_emit_channel_lost (self, path, TP_ERROR_STR_NOT_AVAILABLE, "Badger"); if (self->priv->channels->len == 0) { /* We removed the last channel; fire Finished */ tp_svc_channel_dispatch_operation_emit_finished (self); } } void tp_tests_simple_channel_dispatch_operation_set_account_path ( TpTestsSimpleChannelDispatchOperation *self, const gchar *account_path) { self->priv->account_path = g_strdup (account_path); } telepathy-glib-0.24.2/tests/lib/simple-channel-dispatch-operation.h0000644000175000017500000000551312652510705022214 00000000000000/* * simple-channel-dispatch-operation.h - a simple channel dispatch operation * service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION_H__ #define __TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION_H__ #include #include G_BEGIN_DECLS typedef struct _SimpleChannelDispatchOperation TpTestsSimpleChannelDispatchOperation; typedef struct _SimpleChannelDispatchOperationClass TpTestsSimpleChannelDispatchOperationClass; typedef struct _SimpleChannelDispatchOperationPrivate TpTestsSimpleChannelDispatchOperationPrivate; struct _SimpleChannelDispatchOperationClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _SimpleChannelDispatchOperation { GObject parent; TpTestsSimpleChannelDispatchOperationPrivate *priv; }; GType tp_tests_simple_channel_dispatch_operation_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION \ (tp_tests_simple_channel_dispatch_operation_get_type ()) #define TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, \ TpTestsSimpleChannelDispatchOperation)) #define TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, \ TpTestsSimpleChannelDispatchOperationClass)) #define SIMPLE_IS_CHANNEL_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION)) #define SIMPLE_IS_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION)) #define TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, \ TpTestsSimpleChannelDispatchOperationClass)) void tp_tests_simple_channel_dispatch_operation_set_conn_path ( TpTestsSimpleChannelDispatchOperation *self, const gchar *conn_path); void tp_tests_simple_channel_dispatch_operation_add_channel ( TpTestsSimpleChannelDispatchOperation *self, TpChannel *chan); void tp_tests_simple_channel_dispatch_operation_lost_channel ( TpTestsSimpleChannelDispatchOperation *self, TpChannel *chan); void tp_tests_simple_channel_dispatch_operation_set_account_path ( TpTestsSimpleChannelDispatchOperation *self, const gchar *account_path); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CHANNEL_DISPATCH_OPERATION_H__ */ telepathy-glib-0.24.2/tests/lib/echo-conn.c0000644000175000017500000001323412652510705015365 00000000000000/* * conn.c - an example connection * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "echo-conn.h" #include #include #include "echo-im-manager.h" G_DEFINE_TYPE (TpTestsEchoConnection, tp_tests_echo_connection, TP_TYPE_BASE_CONNECTION) /* type definition stuff */ enum { PROP_ACCOUNT = 1, N_PROPS }; struct _TpTestsEchoConnectionPrivate { gchar *account; }; static void tp_tests_echo_connection_init (TpTestsEchoConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_ECHO_CONNECTION, TpTestsEchoConnectionPrivate); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsEchoConnection *self = TP_TESTS_ECHO_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsEchoConnection *self = TP_TESTS_ECHO_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_utf8_strdown (g_value_get_string (value), -1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { TpTestsEchoConnection *self = TP_TESTS_ECHO_CONNECTION (object); g_free (self->priv->account); G_OBJECT_CLASS (tp_tests_echo_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { TpTestsEchoConnection *self = TP_TESTS_ECHO_CONNECTION (conn); return g_strdup (self->priv->account); } /* Returns the same id given in but in lowercase. If '#' is present, * the normalized contact will be the lhs of it. For example: * * LOL -> lol * Lol#foo -> lol */ static gchar * tp_tests_echo_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { gchar *hash; if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return NULL; } hash = g_utf8_strchr (id, -1, '#'); return g_utf8_strdown (id, hash != NULL ? (hash - id) : -1); } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, tp_tests_echo_normalize_contact, NULL); } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { GPtrArray *ret = g_ptr_array_sized_new (1); g_ptr_array_add (ret, g_object_new (TP_TESTS_TYPE_ECHO_IM_MANAGER, "connection", conn, NULL)); return ret; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { TpTestsEchoConnection *self = TP_TESTS_ECHO_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, NULL); tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_echo_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_REQUESTS); return interfaces; } static void tp_tests_echo_connection_class_init (TpTestsEchoConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->get_property = get_property; object_class->set_property = set_property; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (TpTestsEchoConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_managers = create_channel_managers; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); } telepathy-glib-0.24.2/tests/lib/echo-conn.h0000644000175000017500000000342312652510705015371 00000000000000/* * conn.h - header for an example connection * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_ECHO_CONN_H__ #define __TP_TESTS_ECHO_CONN_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsEchoConnection TpTestsEchoConnection; typedef struct _TpTestsEchoConnectionClass TpTestsEchoConnectionClass; typedef struct _TpTestsEchoConnectionPrivate TpTestsEchoConnectionPrivate; struct _TpTestsEchoConnectionClass { TpBaseConnectionClass parent_class; }; struct _TpTestsEchoConnection { TpBaseConnection parent; TpTestsEchoConnectionPrivate *priv; }; GType tp_tests_echo_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_ECHO_CONNECTION \ (tp_tests_echo_connection_get_type ()) #define TP_TESTS_ECHO_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_ECHO_CONNECTION, \ TpTestsEchoConnection)) #define TP_TESTS_ECHO_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_ECHO_CONNECTION, \ TpTestsEchoConnectionClass)) #define TP_TESTS_IS_ECHO_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_ECHO_CONNECTION)) #define TP_TESTS_IS_ECHO_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_ECHO_CONNECTION)) #define TP_TESTS_ECHO_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ECHO_CONNECTION, \ TpTestsEchoConnectionClass)) G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/simple-conn.c0000644000175000017500000003606412652510705015746 00000000000000/* * simple-conn.c - a simple connection * * Copyright (C) 2007-2010 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-conn.h" #include #include #include #include #include "textchan-null.h" #include "room-list-chan.h" #include "util.h" static void props_iface_init (TpSvcDBusPropertiesClass *); static void conn_iface_init (TpSvcConnectionClass *); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleConnection, tp_tests_simple_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, props_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, conn_iface_init)) /* type definition stuff */ enum { PROP_ACCOUNT = 1, PROP_BREAK_PROPS = 2, PROP_DBUS_STATUS = 3, N_PROPS }; enum { SIGNAL_GOT_SELF_HANDLE, SIGNAL_GOT_ALL, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; struct _TpTestsSimpleConnectionPrivate { gchar *account; guint connect_source; guint disconnect_source; gboolean break_fastpath_props; /* TpHandle => reffed TpTestsTextChannelNull */ GHashTable *text_channels; TpTestsRoomListChan *room_list_chan; GError *get_self_handle_error /* initially NULL */ ; }; static void tp_tests_simple_connection_init (TpTestsSimpleConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_CONNECTION, TpTestsSimpleConnectionPrivate); self->priv->text_channels = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_object_unref); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; case PROP_BREAK_PROPS: g_value_set_boolean (value, self->priv->break_fastpath_props); break; case PROP_DBUS_STATUS: if (self->priv->break_fastpath_props) { g_debug ("returning broken value for Connection.Status"); g_value_set_uint (value, 0xdeadbeefU); } else { g_value_set_uint (value, tp_base_connection_get_status (TP_BASE_CONNECTION (self))); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_utf8_strdown (g_value_get_string (value), -1); break; case PROP_BREAK_PROPS: self->priv->break_fastpath_props = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void dispose (GObject *object) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (object); g_hash_table_unref (self->priv->text_channels); g_clear_object (&self->priv->room_list_chan); G_OBJECT_CLASS (tp_tests_simple_connection_parent_class)->dispose (object); } static void finalize (GObject *object) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (object); if (self->priv->connect_source != 0) { g_source_remove (self->priv->connect_source); } if (self->priv->disconnect_source != 0) { g_source_remove (self->priv->disconnect_source); } g_clear_error (&self->priv->get_self_handle_error); g_free (self->priv->account); G_OBJECT_CLASS (tp_tests_simple_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (conn); return g_strdup (self->priv->account); } static gchar * tp_tests_simple_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return NULL; } if (strchr (id, ' ') != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not contain spaces"); return NULL; } return g_utf8_strdown (id, -1); } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, tp_tests_simple_normalize_contact, NULL); repos[TP_HANDLE_TYPE_ROOM] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_ROOM, NULL, NULL); } static GPtrArray * create_channel_factories (TpBaseConnection *conn) { return g_ptr_array_sized_new (0); } void tp_tests_simple_connection_inject_disconnect (TpTestsSimpleConnection *self) { tp_base_connection_change_status ((TpBaseConnection *) self, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); } static gboolean pretend_connected (gpointer data) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (data); TpBaseConnection *conn = (TpBaseConnection *) self; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, NULL); tp_base_connection_set_self_handle (conn, self_handle); if (tp_base_connection_get_status (conn) == TP_CONNECTION_STATUS_CONNECTING) { tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); } self->priv->connect_source = 0; return FALSE; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (conn); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED); /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished. Here there * isn't actually a connection, so we'll fake a connection process that * takes time. */ self->priv->connect_source = g_timeout_add (0, pretend_connected, self); return TRUE; } static gboolean pretend_disconnected (gpointer data) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (data); /* We are disconnected, all our channels are invalidated */ g_hash_table_remove_all (self->priv->text_channels); g_clear_object (&self->priv->room_list_chan); tp_base_connection_finish_shutdown (TP_BASE_CONNECTION (data)); self->priv->disconnect_source = 0; return FALSE; } static void shut_down (TpBaseConnection *conn) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (conn); /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished. Here there * isn't actually a connection, so we'll fake a disconnection process that * takes time. */ self->priv->disconnect_source = g_timeout_add (0, pretend_disconnected, conn); } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_simple_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_REQUESTS); return interfaces; } static void tp_tests_simple_connection_class_init (TpTestsSimpleConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->get_property = get_property; object_class->set_property = set_property; object_class->dispose = dispose; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (TpTestsSimpleConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_factories = create_channel_factories; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_boolean ("break-0192-properties", "Break 0.19.2 properties", "Break Connection D-Bus properties introduced in spec 0.19.2", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BREAK_PROPS, param_spec); param_spec = g_param_spec_uint ("dbus-status", "Connection.Status", "The connection status as visible on D-Bus (overridden so can break it)", TP_CONNECTION_STATUS_CONNECTED, G_MAXUINT, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_STATUS, param_spec); signals[SIGNAL_GOT_SELF_HANDLE] = g_signal_new ("got-self-handle", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); signals[SIGNAL_GOT_ALL] = g_signal_new ("got-all", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); } void tp_tests_simple_connection_set_identifier (TpTestsSimpleConnection *self, const gchar *identifier) { TpBaseConnection *conn = (TpBaseConnection *) self; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle handle = tp_handle_ensure (contact_repo, identifier, NULL, NULL); /* if this fails then the identifier was bad - caller error */ g_return_if_fail (handle != 0); tp_base_connection_set_self_handle (conn, handle); } TpTestsSimpleConnection * tp_tests_simple_connection_new (const gchar *account, const gchar *protocol) { return TP_TESTS_SIMPLE_CONNECTION (g_object_new ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", account, "protocol", protocol, NULL)); } gchar * tp_tests_simple_connection_ensure_text_chan (TpTestsSimpleConnection *self, const gchar *target_id, GHashTable **props) { TpTestsTextChannelNull *chan; gchar *chan_path; TpHandleRepoIface *contact_repo; TpHandle handle; static guint count = 0; TpBaseConnection *base_conn = (TpBaseConnection *) self; /* Get contact handle */ contact_repo = tp_base_connection_get_handles (base_conn, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, target_id, NULL, NULL); chan = g_hash_table_lookup (self->priv->text_channels, GUINT_TO_POINTER (handle)); if (chan != NULL) { /* Channel already exist, reuse it */ g_object_get (chan, "object-path", &chan_path, NULL); } else { chan_path = g_strdup_printf ("%s/Channel%u", tp_base_connection_get_object_path (base_conn), count++); chan = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", self, "object-path", chan_path, "handle", handle, NULL)); g_hash_table_insert (self->priv->text_channels, GUINT_TO_POINTER (handle), chan); } if (props != NULL) *props = tp_tests_text_channel_get_props (chan); return chan_path; } static void room_list_chan_closed_cb (TpBaseChannel *channel, TpTestsSimpleConnection *self) { g_clear_object (&self->priv->room_list_chan); } gchar * tp_tests_simple_connection_ensure_room_list_chan (TpTestsSimpleConnection *self, const gchar *server, GHashTable **props) { gchar *chan_path; TpBaseConnection *base_conn = (TpBaseConnection *) self; if (self->priv->room_list_chan != NULL) { /* Channel already exist, reuse it */ g_object_get (self->priv->room_list_chan, "object-path", &chan_path, NULL); } else { chan_path = g_strdup_printf ("%s/RoomListChannel", tp_base_connection_get_object_path (base_conn)); self->priv->room_list_chan = TP_TESTS_ROOM_LIST_CHAN ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_ROOM_LIST_CHAN, "connection", self, "object-path", chan_path, "server", server ? server : "", NULL)); g_signal_connect (self->priv->room_list_chan, "closed", G_CALLBACK (room_list_chan_closed_cb), self); } if (props != NULL) g_object_get (self->priv->room_list_chan, "channel-properties", props, NULL); return chan_path; } void tp_tests_simple_connection_set_get_self_handle_error ( TpTestsSimpleConnection *self, GQuark domain, gint code, const gchar *message) { self->priv->get_self_handle_error = g_error_new_literal (domain, code, message); } static void get_self_handle (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpTestsSimpleConnection *self = TP_TESTS_SIMPLE_CONNECTION (iface); TpBaseConnection *base = TP_BASE_CONNECTION (iface); g_assert (TP_IS_BASE_CONNECTION (base)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (self->priv->get_self_handle_error != NULL) { dbus_g_method_return_error (context, self->priv->get_self_handle_error); return; } tp_svc_connection_return_from_get_self_handle (context, tp_base_connection_get_self_handle (base)); g_signal_emit (self, signals[SIGNAL_GOT_SELF_HANDLE], 0); } static void conn_iface_init (TpSvcConnectionClass *iface) { #define IMPLEMENT(prefix,x) \ tp_svc_connection_implement_##x (iface, prefix##x) IMPLEMENT(,get_self_handle); #undef IMPLEMENT } static void get_all (TpSvcDBusProperties *iface, const gchar *interface_name, DBusGMethodInvocation *context) { GHashTable *values = tp_dbus_properties_mixin_dup_all (G_OBJECT (iface), interface_name); tp_svc_dbus_properties_return_from_get_all (context, values); g_hash_table_unref (values); g_signal_emit (iface, signals[SIGNAL_GOT_ALL], g_quark_from_string (interface_name)); } static void props_iface_init (TpSvcDBusPropertiesClass *iface) { #define IMPLEMENT(x) \ tp_svc_dbus_properties_implement_##x (iface, x) IMPLEMENT (get_all); #undef IMPLEMENT } telepathy-glib-0.24.2/tests/lib/simple-conn.h0000644000175000017500000000524712652510705015752 00000000000000/* * simple-conn.h - header for a simple connection * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CONN_H__ #define __TP_TESTS_SIMPLE_CONN_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleConnection TpTestsSimpleConnection; typedef struct _TpTestsSimpleConnectionClass TpTestsSimpleConnectionClass; typedef struct _TpTestsSimpleConnectionPrivate TpTestsSimpleConnectionPrivate; struct _TpTestsSimpleConnectionClass { TpBaseConnectionClass parent_class; }; struct _TpTestsSimpleConnection { TpBaseConnection parent; TpTestsSimpleConnectionPrivate *priv; }; GType tp_tests_simple_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CONNECTION \ (tp_tests_simple_connection_get_type ()) #define TP_TESTS_SIMPLE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION, \ TpTestsSimpleConnection)) #define TP_TESTS_SIMPLE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CONNECTION, \ TpTestsSimpleConnectionClass)) #define TP_TESTS_SIMPLE_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION)) #define TP_TESTS_SIMPLE_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CONNECTION)) #define TP_TESTS_SIMPLE_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION, \ TpTestsSimpleConnectionClass)) TpTestsSimpleConnection * tp_tests_simple_connection_new (const gchar *account, const gchar *protocol); /* Cause "network events", for debugging/testing */ void tp_tests_simple_connection_inject_disconnect ( TpTestsSimpleConnection *self); void tp_tests_simple_connection_set_identifier (TpTestsSimpleConnection *self, const gchar *identifier); gchar * tp_tests_simple_connection_ensure_text_chan ( TpTestsSimpleConnection *self, const gchar *target_id, GHashTable **props); void tp_tests_simple_connection_set_get_self_handle_error ( TpTestsSimpleConnection *self, GQuark domain, gint code, const gchar *message); gchar * tp_tests_simple_connection_ensure_room_list_chan ( TpTestsSimpleConnection *self, const gchar *server, GHashTable **props); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CONN_H__ */ telepathy-glib-0.24.2/tests/lib/echo-cm.c0000644000175000017500000000524112652510705015026 00000000000000/* * manager.c - an example connection manager * * Copyright (C) 2007 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "echo-cm.h" #include #include #include #include "echo-conn.h" G_DEFINE_TYPE (TpTestsEchoConnectionManager, tp_tests_echo_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) /* type definition stuff */ static void tp_tests_echo_connection_manager_init (TpTestsEchoConnectionManager *self) { } /* private data */ typedef struct { gchar *account; } ExampleParams; static const TpCMParamSpec tp_tests_echo_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* default */ G_STRUCT_OFFSET (ExampleParams, account), /* struct offset */ tp_cm_param_filter_string_nonempty, /* filter */ NULL, /* filter data */ NULL /* setter data */ }, { NULL } }; static gpointer alloc_params (void) { return g_slice_new0 (ExampleParams); } static void free_params (gpointer p) { ExampleParams *params = p; g_free (params->account); g_slice_free (ExampleParams, params); } static const TpCMProtocolSpec example_protocols[] = { { "example", tp_tests_echo_example_params, alloc_params, free_params }, { NULL, NULL } }; static TpBaseConnection * new_connection (TpBaseConnectionManager *self, const gchar *proto, TpIntset *params_present, gpointer parsed_params, GError **error) { ExampleParams *params = parsed_params; TpTestsEchoConnection *conn = TP_TESTS_ECHO_CONNECTION (g_object_new (TP_TESTS_TYPE_ECHO_CONNECTION, "account", params->account, "protocol", proto, NULL)); return (TpBaseConnection *) conn; } static GPtrArray * get_interfaces (TpBaseConnectionManager *self) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_MANAGER_CLASS ( tp_tests_echo_connection_manager_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, "im.telepathy.Tests.Example"); return interfaces; } static void tp_tests_echo_connection_manager_class_init ( TpTestsEchoConnectionManagerClass *klass) { TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; base_class->new_connection = new_connection; base_class->cm_dbus_name = "example_echo"; base_class->protocol_params = example_protocols; base_class->get_interfaces = get_interfaces; } telepathy-glib-0.24.2/tests/lib/echo-cm.h0000644000175000017500000000413712652510705015036 00000000000000/* * manager.h - header for an example connection manager * Copyright (C) 2007 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_ECHO_CONNECTION_MANAGER_H__ #define __TP_TESTS_ECHO_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsEchoConnectionManager TpTestsEchoConnectionManager; typedef struct _TpTestsEchoConnectionManagerPrivate TpTestsEchoConnectionManagerPrivate; typedef struct _TpTestsEchoConnectionManagerClass TpTestsEchoConnectionManagerClass; typedef struct _TpTestsEchoConnectionManagerClassPrivate TpTestsEchoConnectionManagerClassPrivate; struct _TpTestsEchoConnectionManagerClass { TpBaseConnectionManagerClass parent_class; TpTestsEchoConnectionManagerClassPrivate *priv; }; struct _TpTestsEchoConnectionManager { TpBaseConnectionManager parent; TpTestsEchoConnectionManagerPrivate *priv; }; GType tp_tests_echo_connection_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER \ (tp_tests_echo_connection_manager_get_type ()) #define TP_TESTS_ECHO_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER, \ TpTestsEchoConnectionManager)) #define TP_TESTS_ECHO_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER, \ TpTestsEchoConnectionManagerClass)) #define TP_TESTS_IS_ECHO_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER)) #define TP_TESTS_IS_ECHO_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER)) #define TP_TESTS_ECHO_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER, \ TpTestsEchoConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/simple-channel-dispatcher.c0000644000175000017500000003221712652510705020541 00000000000000/* * simple-channel-dispatcher.c - simple channel dispatcher service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-channel-dispatcher.h" #include #include #include "simple-channel-request.h" #include "simple-conn.h" static void channel_dispatcher_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleChannelDispatcher, tp_tests_simple_channel_dispatcher, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_DISPATCHER, channel_dispatcher_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) ) /* signals */ enum { CHANNEL_REQUEST_CREATED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; /* TP_IFACE_CHANNEL_DISPATCHER is implied */ static const char *CHANNEL_DISPATCHER_INTERFACES[] = { NULL }; enum { PROP_0, PROP_INTERFACES, PROP_CONNECTION, }; struct _TpTestsSimpleChannelDispatcherPrivate { /* To keep things simpler, this CD can only create channels using one * connection */ TpTestsSimpleConnection *conn; /* List of reffed TpTestsSimpleChannelRequest */ GSList *requests; /* Used when ensuring a channel to store its handler. * If this is set we fake that the channel already exist and re-call * HandleChannels() on the handler rather than creating a new channel. * This is pretty stupid but good enough for our tests. */ gchar *old_handler; }; static gchar * create_channel_request (TpTestsSimpleChannelDispatcher *self, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints_) { TpTestsSimpleChannelRequest *chan_request; GPtrArray *requests; static guint count = 0; gchar *path; TpDBusDaemon *dbus; GHashTable *hints; requests = g_ptr_array_sized_new (1); g_ptr_array_add (requests, request); path = g_strdup_printf ("/Request%u", count++); if (hints_ == NULL) hints = g_hash_table_new (NULL, NULL); else hints = g_hash_table_ref (hints_); chan_request = tp_tests_simple_channel_request_new (path, self->priv->conn, account, user_action_time, preferred_handler, requests, hints); g_hash_table_unref (hints); self->priv->requests = g_slist_append (self->priv->requests, chan_request); g_ptr_array_unref (requests); dbus = tp_dbus_daemon_dup (NULL); g_assert (dbus != NULL); tp_dbus_daemon_register_object (dbus, path, chan_request); g_object_unref (dbus); g_signal_emit (self, signals[CHANNEL_REQUEST_CREATED], 0, chan_request); return path; } static gchar * create_channel (TpTestsSimpleChannelDispatcher *self, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { tp_clear_pointer (&self->last_request, g_hash_table_unref); self->last_request = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); tp_clear_pointer (&self->last_hints, g_hash_table_unref); self->last_hints = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); self->last_user_action_time = user_action_time; g_free (self->last_account); self->last_account = g_strdup (account); g_free (self->last_preferred_handler); self->last_preferred_handler = g_strdup (preferred_handler); if (tp_asv_get_boolean (request, "CreateChannelFail", NULL)) { /* Fail to create the channel */ GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Computer says no" }; dbus_g_method_return_error (context, &error); return NULL; } return create_channel_request (self, account, request, user_action_time, preferred_handler, hints); } static void tp_tests_simple_channel_dispatcher_create_channel ( TpSvcChannelDispatcher *dispatcher, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (dispatcher); gchar *path; path = create_channel (self, account, request, user_action_time, preferred_handler, NULL, context); if (path == NULL) return; tp_svc_channel_dispatcher_return_from_create_channel (context, path); g_free (path); } static void tp_tests_simple_channel_dispatcher_create_channel_with_hints ( TpSvcChannelDispatcher *dispatcher, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (dispatcher); gchar *path; path = create_channel (self, account, request, user_action_time, preferred_handler, hints, context); if (path == NULL) return; tp_svc_channel_dispatcher_return_from_create_channel_with_hints (context, path); g_free (path); } static gchar * ensure_channel (TpTestsSimpleChannelDispatcher *self, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { tp_clear_pointer (&self->last_request, g_hash_table_unref); self->last_request = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); tp_clear_pointer (&self->last_hints, g_hash_table_unref); self->last_hints = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, request); self->last_user_action_time = user_action_time; g_free (self->last_account); self->last_account = g_strdup (account); g_free (self->last_preferred_handler); self->last_preferred_handler = g_strdup (preferred_handler); if (self->priv->old_handler != NULL) { /* Pretend that the channel already exists */ return create_channel_request (self, account, request, user_action_time, self->priv->old_handler, hints); } self->priv->old_handler = g_strdup (preferred_handler); return create_channel_request (self, account, request, user_action_time, preferred_handler, hints); } static void tp_tests_simple_channel_dispatcher_ensure_channel ( TpSvcChannelDispatcher *dispatcher, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (dispatcher); gchar *path; path = ensure_channel (self, account, request, user_action_time, preferred_handler, NULL, context); tp_svc_channel_dispatcher_return_from_ensure_channel (context, path); g_free (path); } static void tp_tests_simple_channel_dispatcher_ensure_channel_with_hints ( TpSvcChannelDispatcher *dispatcher, const gchar *account, GHashTable *request, gint64 user_action_time, const gchar *preferred_handler, GHashTable *hints, DBusGMethodInvocation *context) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (dispatcher); gchar *path; path = ensure_channel (self, account, request, user_action_time, preferred_handler, hints, context); tp_svc_channel_dispatcher_return_from_ensure_channel_with_hints (context, path); g_free (path); } static void free_not_delegated_error (gpointer data) { g_boxed_free (TP_STRUCT_TYPE_NOT_DELEGATED_ERROR, data); } static void tp_tests_simple_channel_dispatcher_delegate_channels ( TpSvcChannelDispatcher *dispatcher, const GPtrArray *channels, gint64 user_action_time, const gchar *preferred_handler, DBusGMethodInvocation *context) { TpTestsSimpleChannelDispatcher *self = (TpTestsSimpleChannelDispatcher *) dispatcher; GPtrArray *delegated; GHashTable *not_delegated; guint i; delegated = g_ptr_array_new (); not_delegated = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_not_delegated_error); for (i = 0; i < channels->len; i++) { gpointer chan_path = g_ptr_array_index (channels, i); GValueArray *v; if (!self->refuse_delegate) { g_ptr_array_add (delegated, chan_path); continue; } v = tp_value_array_build (2, G_TYPE_STRING, TP_ERROR_STR_BUSY, G_TYPE_STRING, "Nah!", G_TYPE_INVALID); g_hash_table_insert (not_delegated, chan_path, v); } tp_svc_channel_dispatcher_return_from_delegate_channels (context, delegated, not_delegated); g_ptr_array_unref (delegated); g_hash_table_unref (not_delegated); } static void tp_tests_simple_channel_dispatcher_present_channel ( TpSvcChannelDispatcher *dispatcher, const gchar *channel, gint64 user_action_time, DBusGMethodInvocation *context) { tp_svc_channel_dispatcher_return_from_present_channel (context); } static void channel_dispatcher_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_channel_dispatcher_implement_##x (\ klass, tp_tests_simple_channel_dispatcher_##x) IMPLEMENT (create_channel); IMPLEMENT (ensure_channel); IMPLEMENT (create_channel_with_hints); IMPLEMENT (ensure_channel_with_hints); IMPLEMENT (delegate_channels); IMPLEMENT (present_channel); #undef IMPLEMENT } static void tp_tests_simple_channel_dispatcher_init (TpTestsSimpleChannelDispatcher *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, TpTestsSimpleChannelDispatcherPrivate); } static void tp_tests_simple_channel_dispatcher_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { switch (property_id) { case PROP_INTERFACES: g_value_set_boxed (value, CHANNEL_DISPATCHER_INTERFACES); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_channel_dispatcher_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (object); switch (property_id) { case PROP_CONNECTION: self->priv->conn = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_channel_dispatcher_dispose (GObject *object) { TpTestsSimpleChannelDispatcher *self = SIMPLE_CHANNEL_DISPATCHER (object); tp_clear_object (&self->priv->conn); g_slist_foreach (self->priv->requests, (GFunc) g_object_unref, NULL); g_slist_free (self->priv->requests); g_free (self->priv->old_handler); tp_clear_pointer (&self->last_request, g_hash_table_unref); tp_clear_pointer (&self->last_hints, g_hash_table_unref); tp_clear_pointer (&self->last_account, g_free); tp_clear_pointer (&self->last_preferred_handler, g_free); if (G_OBJECT_CLASS (tp_tests_simple_channel_dispatcher_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_tests_simple_channel_dispatcher_parent_class)->dispose (object); } static void tp_tests_simple_channel_dispatcher_class_init ( TpTestsSimpleChannelDispatcherClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl am_props[] = { { "Interfaces", "interfaces", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_DISPATCHER, tp_dbus_properties_mixin_getter_gobject_properties, NULL, am_props }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpTestsSimpleChannelDispatcherPrivate)); object_class->get_property = tp_tests_simple_channel_dispatcher_get_property; object_class->set_property = tp_tests_simple_channel_dispatcher_set_property; object_class->dispose = tp_tests_simple_channel_dispatcher_dispose; param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "In this case we only implement ChannelDispatcher, so none.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_object ("connection", "TpTestsSimpleConnection", "connection to use when creating channels", TP_TESTS_TYPE_SIMPLE_CONNECTION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /* Fired when we create a new channel request object. This can be used in * test to track the progression of a request. */ signals[CHANNEL_REQUEST_CREATED] = g_signal_new ("channel-request-created", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsSimpleChannelDispatcherClass, dbus_props_class)); } telepathy-glib-0.24.2/tests/lib/simple-channel-dispatcher.h0000644000175000017500000000443512652510705020547 00000000000000/* * simple-channel-dispatcher.h - header for a simple channel dispatcher service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CHANNEL_DISPATCHER_H__ #define __TP_TESTS_SIMPLE_CHANNEL_DISPATCHER_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleChannelDispatcher TpTestsSimpleChannelDispatcher; typedef struct _TpTestsSimpleChannelDispatcherClass TpTestsSimpleChannelDispatcherClass; typedef struct _TpTestsSimpleChannelDispatcherPrivate TpTestsSimpleChannelDispatcherPrivate; struct _TpTestsSimpleChannelDispatcherClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpTestsSimpleChannelDispatcher { GObject parent; /* so regression tests can verify what was asked for */ GHashTable *last_request; gchar *last_account; gint64 last_user_action_time; gchar *last_preferred_handler; GHashTable *last_hints; TpTestsSimpleChannelDispatcherPrivate *priv; gboolean refuse_delegate; }; GType tp_tests_simple_channel_dispatcher_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER \ (tp_tests_simple_channel_dispatcher_get_type ()) #define SIMPLE_CHANNEL_DISPATCHER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, \ TpTestsSimpleChannelDispatcher)) #define SIMPLE_CHANNEL_DISPATCHER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, \ TpTestsSimpleChannelDispatcherClass)) #define SIMPLE_IS_CHANNEL_DISPATCHER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER)) #define SIMPLE_IS_CHANNEL_DISPATCHER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER)) #define SIMPLE_CHANNEL_DISPATCHER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, \ TpTestsSimpleChannelDispatcherClass)) G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CHANNEL_DISPATCHER_H__ */ telepathy-glib-0.24.2/tests/lib/bug-19101-conn.c0000644000175000017500000000562112652510705015676 00000000000000/* * bug-19101-conn.c - a broken connection to reproduce bug #19101 * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "bug-19101-conn.h" #include #include #include "debug.h" static void contacts_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpTestsBug19101Connection, tp_tests_bug19101_connection, TP_TESTS_TYPE_CONTACTS_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, contacts_iface_init); ) static void tp_tests_bug19101_connection_init (TpTestsBug19101Connection *self) { } static void tp_tests_bug19101_connection_class_init (TpTestsBug19101ConnectionClass *klass) { } /* A broken implementation of GetContactAttributes, which returns an empty dict * of attributes for each handle (other than the self-handle). */ static void tp_tests_bug19101_connection_get_contact_attributes ( TpSvcConnectionInterfaceContacts *iface, const GArray *handles, const char **interfaces, gboolean hold, DBusGMethodInvocation *context) { TpBaseConnection *base_conn = TP_BASE_CONNECTION (iface); GHashTable *result; guint i; const gchar *assumed_interfaces[] = { TP_IFACE_CONNECTION, NULL }; if (handles->len == 1 && g_array_index (handles, TpHandle, 0) == tp_base_connection_get_self_handle (base_conn)) { DEBUG ("called for self-handle (during preparation), not being rubbish"); /* strictly speaking this should hold the handles on behalf of the * sending process, but handles are immortal now anyway... */ result = tp_contacts_mixin_get_contact_attributes ((GObject *) iface, handles, interfaces, assumed_interfaces, NULL); goto finally; } DEBUG ("called; returning rubbish"); result = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_unref); for (i = 0 ; i < handles->len ; i++) { TpHandle h= g_array_index (handles, TpHandle, i); GHashTable *attr_hash = g_hash_table_new_full (NULL, NULL, NULL, NULL); g_hash_table_insert (result, GUINT_TO_POINTER(h), attr_hash); } finally: tp_svc_connection_interface_contacts_return_from_get_contact_attributes ( context, result); g_hash_table_unref (result); } static void contacts_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactsClass *klass = (TpSvcConnectionInterfaceContactsClass *) g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_contacts_implement_##x ( \ klass, tp_tests_bug19101_connection_##x) IMPLEMENT(get_contact_attributes); #undef IMPLEMENT } telepathy-glib-0.24.2/tests/lib/bug-19101-conn.h0000644000175000017500000000342512652510705015703 00000000000000/* * bug-19101-conn.h - header for a broken connection to reproduce bug #19101 * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_BUG19101_CONN_H__ #define __TP_TESTS_BUG19101_CONN_H__ #include "contacts-conn.h" G_BEGIN_DECLS typedef struct _TpTestsBug19101Connection TpTestsBug19101Connection; typedef struct _TpTestsBug19101ConnectionClass TpTestsBug19101ConnectionClass; struct _TpTestsBug19101ConnectionClass { TpTestsContactsConnectionClass parent_class; }; struct _TpTestsBug19101Connection { TpTestsContactsConnection parent; }; GType tp_tests_bug19101_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_BUG19101_CONNECTION \ (tp_tests_bug19101_connection_get_type ()) #define BUG_19101_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_BUG19101_CONNECTION, \ TpTestsBug19101Connection)) #define BUG_19101_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_BUG19101_CONNECTION, \ TpTestsBug19101ConnectionClass)) #define BUG_19101_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_BUG19101_CONNECTION)) #define BUG_19101_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_BUG19101_CONNECTION)) #define BUG_19101_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_BUG19101_CONNECTION, \ TpTestsBug19101ConnectionClass)) G_END_DECLS #endif /* #ifndef __TP_TESTS_BUG19101_CONN_H__ */ telepathy-glib-0.24.2/tests/lib/Makefile.am0000644000175000017500000000553112652510705015405 00000000000000# It's necessary to distinguish between modules that link to # libtelepathy-glib.la (normally a shared library, containing a copy of # libtelepathy-glib-internal.la) and libtelepathy-glib-internal.la (a static # convenience library). Under -Bsymbolic, you can't safely link both. # # You can either link to libtp-glib-tests.la and libtelepathy-glib.la, # or to libtp-glib-tests-internal.la and libtelepathy-glib-internal.la. # Do not mix the versions. # # See https://bugs.freedesktop.org/show_bug.cgi?id=39183 noinst_LTLIBRARIES = \ libtp-glib-tests.la \ libtp-glib-tests-internal.la \ $(NULL) libtp_glib_tests_la_SOURCES = \ bug-19101-conn.c \ bug-19101-conn.h \ bug16307-conn.c \ bug16307-conn.h \ broken-client-types-conn.c \ broken-client-types-conn.h \ contacts-conn.c \ contacts-conn.h \ contact-list-manager.c \ contact-list-manager.h \ debug.h \ dbus-tube-chan.c \ dbus-tube-chan.h \ echo-chan.h \ echo-chan.c \ echo-cm.h \ echo-cm.c \ echo-conn.h \ echo-conn.c \ echo-channel-manager-conn.h \ echo-channel-manager-conn.c \ echo-im-manager.h \ echo-im-manager.c \ file-transfer-chan.h \ file-transfer-chan.c \ myassert.h \ my-conn-proxy.h \ my-conn-proxy.c \ params-cm.h \ params-cm.c \ room-list-chan.h \ room-list-chan.c \ simple-account.c \ simple-account.h \ simple-account-manager.c\ simple-account-manager.h\ simple-channel-manager.c \ simple-channel-manager.h \ simple-channel-dispatch-operation.c \ simple-channel-dispatch-operation.h \ simple-channel-dispatcher.c \ simple-channel-dispatcher.h \ simple-channel-request.c \ simple-channel-request.h \ simple-client.c \ simple-client.h \ simple-conn.c \ simple-conn.h \ simple-manager.c \ simple-manager.h \ stream-tube-chan.c \ stream-tube-chan.h \ stub-object.c \ stub-object.h \ textchan-null.c \ textchan-null.h \ textchan-group.c \ textchan-group.h \ tls-certificate.h \ tls-certificate.c \ util.c \ util.h libtp_glib_tests_internal_la_SOURCES = $(libtp_glib_tests_la_SOURCES) check_c_sources = *.c include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TP_GLIB_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) libtp_glib_tests_internal_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DTP_GLIB_TESTS_INTERNAL \ $(NULL) libtp_glib_tests_internal_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la libtp_glib_tests_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la telepathy-glib-0.24.2/tests/lib/Makefile.in0000644000175000017500000024172314006601553015420 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libtp_glib_tests_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la am__objects_1 = libtp_glib_tests_internal_la-bug-19101-conn.lo \ libtp_glib_tests_internal_la-bug16307-conn.lo \ libtp_glib_tests_internal_la-broken-client-types-conn.lo \ libtp_glib_tests_internal_la-contacts-conn.lo \ libtp_glib_tests_internal_la-contact-list-manager.lo \ libtp_glib_tests_internal_la-dbus-tube-chan.lo \ libtp_glib_tests_internal_la-echo-chan.lo \ libtp_glib_tests_internal_la-echo-cm.lo \ libtp_glib_tests_internal_la-echo-conn.lo \ libtp_glib_tests_internal_la-echo-channel-manager-conn.lo \ libtp_glib_tests_internal_la-echo-im-manager.lo \ libtp_glib_tests_internal_la-file-transfer-chan.lo \ libtp_glib_tests_internal_la-my-conn-proxy.lo \ libtp_glib_tests_internal_la-params-cm.lo \ libtp_glib_tests_internal_la-room-list-chan.lo \ libtp_glib_tests_internal_la-simple-account.lo \ libtp_glib_tests_internal_la-simple-account-manager.lo \ libtp_glib_tests_internal_la-simple-channel-manager.lo \ libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo \ libtp_glib_tests_internal_la-simple-channel-dispatcher.lo \ libtp_glib_tests_internal_la-simple-channel-request.lo \ libtp_glib_tests_internal_la-simple-client.lo \ libtp_glib_tests_internal_la-simple-conn.lo \ libtp_glib_tests_internal_la-simple-manager.lo \ libtp_glib_tests_internal_la-stream-tube-chan.lo \ libtp_glib_tests_internal_la-stub-object.lo \ libtp_glib_tests_internal_la-textchan-null.lo \ libtp_glib_tests_internal_la-textchan-group.lo \ libtp_glib_tests_internal_la-tls-certificate.lo \ libtp_glib_tests_internal_la-util.lo am_libtp_glib_tests_internal_la_OBJECTS = $(am__objects_1) libtp_glib_tests_internal_la_OBJECTS = \ $(am_libtp_glib_tests_internal_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libtp_glib_tests_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la am_libtp_glib_tests_la_OBJECTS = bug-19101-conn.lo bug16307-conn.lo \ broken-client-types-conn.lo contacts-conn.lo \ contact-list-manager.lo dbus-tube-chan.lo echo-chan.lo \ echo-cm.lo echo-conn.lo echo-channel-manager-conn.lo \ echo-im-manager.lo file-transfer-chan.lo my-conn-proxy.lo \ params-cm.lo room-list-chan.lo simple-account.lo \ simple-account-manager.lo simple-channel-manager.lo \ simple-channel-dispatch-operation.lo \ simple-channel-dispatcher.lo simple-channel-request.lo \ simple-client.lo simple-conn.lo simple-manager.lo \ stream-tube-chan.lo stub-object.lo textchan-null.lo \ textchan-group.lo tls-certificate.lo util.lo libtp_glib_tests_la_OBJECTS = $(am_libtp_glib_tests_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/broken-client-types-conn.Plo \ ./$(DEPDIR)/bug-19101-conn.Plo ./$(DEPDIR)/bug16307-conn.Plo \ ./$(DEPDIR)/contact-list-manager.Plo \ ./$(DEPDIR)/contacts-conn.Plo ./$(DEPDIR)/dbus-tube-chan.Plo \ ./$(DEPDIR)/echo-chan.Plo \ ./$(DEPDIR)/echo-channel-manager-conn.Plo \ ./$(DEPDIR)/echo-cm.Plo ./$(DEPDIR)/echo-conn.Plo \ ./$(DEPDIR)/echo-im-manager.Plo \ ./$(DEPDIR)/file-transfer-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Plo \ ./$(DEPDIR)/libtp_glib_tests_internal_la-util.Plo \ ./$(DEPDIR)/my-conn-proxy.Plo ./$(DEPDIR)/params-cm.Plo \ ./$(DEPDIR)/room-list-chan.Plo \ ./$(DEPDIR)/simple-account-manager.Plo \ ./$(DEPDIR)/simple-account.Plo \ ./$(DEPDIR)/simple-channel-dispatch-operation.Plo \ ./$(DEPDIR)/simple-channel-dispatcher.Plo \ ./$(DEPDIR)/simple-channel-manager.Plo \ ./$(DEPDIR)/simple-channel-request.Plo \ ./$(DEPDIR)/simple-client.Plo ./$(DEPDIR)/simple-conn.Plo \ ./$(DEPDIR)/simple-manager.Plo \ ./$(DEPDIR)/stream-tube-chan.Plo ./$(DEPDIR)/stub-object.Plo \ ./$(DEPDIR)/textchan-group.Plo ./$(DEPDIR)/textchan-null.Plo \ ./$(DEPDIR)/tls-certificate.Plo ./$(DEPDIR)/util.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtp_glib_tests_internal_la_SOURCES) \ $(libtp_glib_tests_la_SOURCES) DIST_SOURCES = $(libtp_glib_tests_internal_la_SOURCES) \ $(libtp_glib_tests_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/tools/check-coding-style.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ # It's necessary to distinguish between modules that link to # libtelepathy-glib.la (normally a shared library, containing a copy of # libtelepathy-glib-internal.la) and libtelepathy-glib-internal.la (a static # convenience library). Under -Bsymbolic, you can't safely link both. # # You can either link to libtp-glib-tests.la and libtelepathy-glib.la, # or to libtp-glib-tests-internal.la and libtelepathy-glib-internal.la. # Do not mix the versions. # # See https://bugs.freedesktop.org/show_bug.cgi?id=39183 noinst_LTLIBRARIES = \ libtp-glib-tests.la \ libtp-glib-tests-internal.la \ $(NULL) libtp_glib_tests_la_SOURCES = \ bug-19101-conn.c \ bug-19101-conn.h \ bug16307-conn.c \ bug16307-conn.h \ broken-client-types-conn.c \ broken-client-types-conn.h \ contacts-conn.c \ contacts-conn.h \ contact-list-manager.c \ contact-list-manager.h \ debug.h \ dbus-tube-chan.c \ dbus-tube-chan.h \ echo-chan.h \ echo-chan.c \ echo-cm.h \ echo-cm.c \ echo-conn.h \ echo-conn.c \ echo-channel-manager-conn.h \ echo-channel-manager-conn.c \ echo-im-manager.h \ echo-im-manager.c \ file-transfer-chan.h \ file-transfer-chan.c \ myassert.h \ my-conn-proxy.h \ my-conn-proxy.c \ params-cm.h \ params-cm.c \ room-list-chan.h \ room-list-chan.c \ simple-account.c \ simple-account.h \ simple-account-manager.c\ simple-account-manager.h\ simple-channel-manager.c \ simple-channel-manager.h \ simple-channel-dispatch-operation.c \ simple-channel-dispatch-operation.h \ simple-channel-dispatcher.c \ simple-channel-dispatcher.h \ simple-channel-request.c \ simple-channel-request.h \ simple-client.c \ simple-client.h \ simple-conn.c \ simple-conn.h \ simple-manager.c \ simple-manager.h \ stream-tube-chan.c \ stream-tube-chan.h \ stub-object.c \ stub-object.h \ textchan-null.c \ textchan-null.h \ textchan-group.c \ textchan-group.h \ tls-certificate.h \ tls-certificate.c \ util.c \ util.h libtp_glib_tests_internal_la_SOURCES = $(libtp_glib_tests_la_SOURCES) check_c_sources = *.c AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TP_GLIB_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) libtp_glib_tests_internal_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -DTP_GLIB_TESTS_INTERNAL \ $(NULL) libtp_glib_tests_internal_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la libtp_glib_tests_la_LIBADD = \ $(DBUS_LIBS) \ $(GLIB_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/check-coding-style.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/tools/check-coding-style.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtp-glib-tests-internal.la: $(libtp_glib_tests_internal_la_OBJECTS) $(libtp_glib_tests_internal_la_DEPENDENCIES) $(EXTRA_libtp_glib_tests_internal_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtp_glib_tests_internal_la_OBJECTS) $(libtp_glib_tests_internal_la_LIBADD) $(LIBS) libtp-glib-tests.la: $(libtp_glib_tests_la_OBJECTS) $(libtp_glib_tests_la_DEPENDENCIES) $(EXTRA_libtp_glib_tests_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtp_glib_tests_la_OBJECTS) $(libtp_glib_tests_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/broken-client-types-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug-19101-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bug16307-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-list-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-tube-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-channel-manager-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-cm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo-im-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-transfer-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtp_glib_tests_internal_la-util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/my-conn-proxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/params-cm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room-list-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-account-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-account.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-channel-dispatch-operation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-channel-dispatcher.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-channel-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-channel-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream-tube-chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-object.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textchan-group.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/textchan-null.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls-certificate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libtp_glib_tests_internal_la-bug-19101-conn.lo: bug-19101-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-bug-19101-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Tpo -c -o libtp_glib_tests_internal_la-bug-19101-conn.lo `test -f 'bug-19101-conn.c' || echo '$(srcdir)/'`bug-19101-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bug-19101-conn.c' object='libtp_glib_tests_internal_la-bug-19101-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-bug-19101-conn.lo `test -f 'bug-19101-conn.c' || echo '$(srcdir)/'`bug-19101-conn.c libtp_glib_tests_internal_la-bug16307-conn.lo: bug16307-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-bug16307-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Tpo -c -o libtp_glib_tests_internal_la-bug16307-conn.lo `test -f 'bug16307-conn.c' || echo '$(srcdir)/'`bug16307-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bug16307-conn.c' object='libtp_glib_tests_internal_la-bug16307-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-bug16307-conn.lo `test -f 'bug16307-conn.c' || echo '$(srcdir)/'`bug16307-conn.c libtp_glib_tests_internal_la-broken-client-types-conn.lo: broken-client-types-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-broken-client-types-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Tpo -c -o libtp_glib_tests_internal_la-broken-client-types-conn.lo `test -f 'broken-client-types-conn.c' || echo '$(srcdir)/'`broken-client-types-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='broken-client-types-conn.c' object='libtp_glib_tests_internal_la-broken-client-types-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-broken-client-types-conn.lo `test -f 'broken-client-types-conn.c' || echo '$(srcdir)/'`broken-client-types-conn.c libtp_glib_tests_internal_la-contacts-conn.lo: contacts-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-contacts-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Tpo -c -o libtp_glib_tests_internal_la-contacts-conn.lo `test -f 'contacts-conn.c' || echo '$(srcdir)/'`contacts-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='contacts-conn.c' object='libtp_glib_tests_internal_la-contacts-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-contacts-conn.lo `test -f 'contacts-conn.c' || echo '$(srcdir)/'`contacts-conn.c libtp_glib_tests_internal_la-contact-list-manager.lo: contact-list-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-contact-list-manager.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Tpo -c -o libtp_glib_tests_internal_la-contact-list-manager.lo `test -f 'contact-list-manager.c' || echo '$(srcdir)/'`contact-list-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='contact-list-manager.c' object='libtp_glib_tests_internal_la-contact-list-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-contact-list-manager.lo `test -f 'contact-list-manager.c' || echo '$(srcdir)/'`contact-list-manager.c libtp_glib_tests_internal_la-dbus-tube-chan.lo: dbus-tube-chan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-dbus-tube-chan.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Tpo -c -o libtp_glib_tests_internal_la-dbus-tube-chan.lo `test -f 'dbus-tube-chan.c' || echo '$(srcdir)/'`dbus-tube-chan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbus-tube-chan.c' object='libtp_glib_tests_internal_la-dbus-tube-chan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-dbus-tube-chan.lo `test -f 'dbus-tube-chan.c' || echo '$(srcdir)/'`dbus-tube-chan.c libtp_glib_tests_internal_la-echo-chan.lo: echo-chan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-echo-chan.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Tpo -c -o libtp_glib_tests_internal_la-echo-chan.lo `test -f 'echo-chan.c' || echo '$(srcdir)/'`echo-chan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='echo-chan.c' object='libtp_glib_tests_internal_la-echo-chan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-echo-chan.lo `test -f 'echo-chan.c' || echo '$(srcdir)/'`echo-chan.c libtp_glib_tests_internal_la-echo-cm.lo: echo-cm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-echo-cm.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Tpo -c -o libtp_glib_tests_internal_la-echo-cm.lo `test -f 'echo-cm.c' || echo '$(srcdir)/'`echo-cm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='echo-cm.c' object='libtp_glib_tests_internal_la-echo-cm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-echo-cm.lo `test -f 'echo-cm.c' || echo '$(srcdir)/'`echo-cm.c libtp_glib_tests_internal_la-echo-conn.lo: echo-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-echo-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Tpo -c -o libtp_glib_tests_internal_la-echo-conn.lo `test -f 'echo-conn.c' || echo '$(srcdir)/'`echo-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='echo-conn.c' object='libtp_glib_tests_internal_la-echo-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-echo-conn.lo `test -f 'echo-conn.c' || echo '$(srcdir)/'`echo-conn.c libtp_glib_tests_internal_la-echo-channel-manager-conn.lo: echo-channel-manager-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-echo-channel-manager-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Tpo -c -o libtp_glib_tests_internal_la-echo-channel-manager-conn.lo `test -f 'echo-channel-manager-conn.c' || echo '$(srcdir)/'`echo-channel-manager-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='echo-channel-manager-conn.c' object='libtp_glib_tests_internal_la-echo-channel-manager-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-echo-channel-manager-conn.lo `test -f 'echo-channel-manager-conn.c' || echo '$(srcdir)/'`echo-channel-manager-conn.c libtp_glib_tests_internal_la-echo-im-manager.lo: echo-im-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-echo-im-manager.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Tpo -c -o libtp_glib_tests_internal_la-echo-im-manager.lo `test -f 'echo-im-manager.c' || echo '$(srcdir)/'`echo-im-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='echo-im-manager.c' object='libtp_glib_tests_internal_la-echo-im-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-echo-im-manager.lo `test -f 'echo-im-manager.c' || echo '$(srcdir)/'`echo-im-manager.c libtp_glib_tests_internal_la-file-transfer-chan.lo: file-transfer-chan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-file-transfer-chan.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Tpo -c -o libtp_glib_tests_internal_la-file-transfer-chan.lo `test -f 'file-transfer-chan.c' || echo '$(srcdir)/'`file-transfer-chan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file-transfer-chan.c' object='libtp_glib_tests_internal_la-file-transfer-chan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-file-transfer-chan.lo `test -f 'file-transfer-chan.c' || echo '$(srcdir)/'`file-transfer-chan.c libtp_glib_tests_internal_la-my-conn-proxy.lo: my-conn-proxy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-my-conn-proxy.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Tpo -c -o libtp_glib_tests_internal_la-my-conn-proxy.lo `test -f 'my-conn-proxy.c' || echo '$(srcdir)/'`my-conn-proxy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='my-conn-proxy.c' object='libtp_glib_tests_internal_la-my-conn-proxy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-my-conn-proxy.lo `test -f 'my-conn-proxy.c' || echo '$(srcdir)/'`my-conn-proxy.c libtp_glib_tests_internal_la-params-cm.lo: params-cm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-params-cm.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Tpo -c -o libtp_glib_tests_internal_la-params-cm.lo `test -f 'params-cm.c' || echo '$(srcdir)/'`params-cm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='params-cm.c' object='libtp_glib_tests_internal_la-params-cm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-params-cm.lo `test -f 'params-cm.c' || echo '$(srcdir)/'`params-cm.c libtp_glib_tests_internal_la-room-list-chan.lo: room-list-chan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-room-list-chan.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Tpo -c -o libtp_glib_tests_internal_la-room-list-chan.lo `test -f 'room-list-chan.c' || echo '$(srcdir)/'`room-list-chan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='room-list-chan.c' object='libtp_glib_tests_internal_la-room-list-chan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-room-list-chan.lo `test -f 'room-list-chan.c' || echo '$(srcdir)/'`room-list-chan.c libtp_glib_tests_internal_la-simple-account.lo: simple-account.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-account.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Tpo -c -o libtp_glib_tests_internal_la-simple-account.lo `test -f 'simple-account.c' || echo '$(srcdir)/'`simple-account.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-account.c' object='libtp_glib_tests_internal_la-simple-account.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-account.lo `test -f 'simple-account.c' || echo '$(srcdir)/'`simple-account.c libtp_glib_tests_internal_la-simple-account-manager.lo: simple-account-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-account-manager.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Tpo -c -o libtp_glib_tests_internal_la-simple-account-manager.lo `test -f 'simple-account-manager.c' || echo '$(srcdir)/'`simple-account-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-account-manager.c' object='libtp_glib_tests_internal_la-simple-account-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-account-manager.lo `test -f 'simple-account-manager.c' || echo '$(srcdir)/'`simple-account-manager.c libtp_glib_tests_internal_la-simple-channel-manager.lo: simple-channel-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-channel-manager.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Tpo -c -o libtp_glib_tests_internal_la-simple-channel-manager.lo `test -f 'simple-channel-manager.c' || echo '$(srcdir)/'`simple-channel-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-channel-manager.c' object='libtp_glib_tests_internal_la-simple-channel-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-channel-manager.lo `test -f 'simple-channel-manager.c' || echo '$(srcdir)/'`simple-channel-manager.c libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo: simple-channel-dispatch-operation.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Tpo -c -o libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo `test -f 'simple-channel-dispatch-operation.c' || echo '$(srcdir)/'`simple-channel-dispatch-operation.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-channel-dispatch-operation.c' object='libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-channel-dispatch-operation.lo `test -f 'simple-channel-dispatch-operation.c' || echo '$(srcdir)/'`simple-channel-dispatch-operation.c libtp_glib_tests_internal_la-simple-channel-dispatcher.lo: simple-channel-dispatcher.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-channel-dispatcher.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Tpo -c -o libtp_glib_tests_internal_la-simple-channel-dispatcher.lo `test -f 'simple-channel-dispatcher.c' || echo '$(srcdir)/'`simple-channel-dispatcher.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-channel-dispatcher.c' object='libtp_glib_tests_internal_la-simple-channel-dispatcher.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-channel-dispatcher.lo `test -f 'simple-channel-dispatcher.c' || echo '$(srcdir)/'`simple-channel-dispatcher.c libtp_glib_tests_internal_la-simple-channel-request.lo: simple-channel-request.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-channel-request.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Tpo -c -o libtp_glib_tests_internal_la-simple-channel-request.lo `test -f 'simple-channel-request.c' || echo '$(srcdir)/'`simple-channel-request.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-channel-request.c' object='libtp_glib_tests_internal_la-simple-channel-request.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-channel-request.lo `test -f 'simple-channel-request.c' || echo '$(srcdir)/'`simple-channel-request.c libtp_glib_tests_internal_la-simple-client.lo: simple-client.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-client.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Tpo -c -o libtp_glib_tests_internal_la-simple-client.lo `test -f 'simple-client.c' || echo '$(srcdir)/'`simple-client.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-client.c' object='libtp_glib_tests_internal_la-simple-client.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-client.lo `test -f 'simple-client.c' || echo '$(srcdir)/'`simple-client.c libtp_glib_tests_internal_la-simple-conn.lo: simple-conn.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-conn.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Tpo -c -o libtp_glib_tests_internal_la-simple-conn.lo `test -f 'simple-conn.c' || echo '$(srcdir)/'`simple-conn.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-conn.c' object='libtp_glib_tests_internal_la-simple-conn.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-conn.lo `test -f 'simple-conn.c' || echo '$(srcdir)/'`simple-conn.c libtp_glib_tests_internal_la-simple-manager.lo: simple-manager.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-simple-manager.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Tpo -c -o libtp_glib_tests_internal_la-simple-manager.lo `test -f 'simple-manager.c' || echo '$(srcdir)/'`simple-manager.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='simple-manager.c' object='libtp_glib_tests_internal_la-simple-manager.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-simple-manager.lo `test -f 'simple-manager.c' || echo '$(srcdir)/'`simple-manager.c libtp_glib_tests_internal_la-stream-tube-chan.lo: stream-tube-chan.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-stream-tube-chan.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Tpo -c -o libtp_glib_tests_internal_la-stream-tube-chan.lo `test -f 'stream-tube-chan.c' || echo '$(srcdir)/'`stream-tube-chan.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stream-tube-chan.c' object='libtp_glib_tests_internal_la-stream-tube-chan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-stream-tube-chan.lo `test -f 'stream-tube-chan.c' || echo '$(srcdir)/'`stream-tube-chan.c libtp_glib_tests_internal_la-stub-object.lo: stub-object.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-stub-object.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Tpo -c -o libtp_glib_tests_internal_la-stub-object.lo `test -f 'stub-object.c' || echo '$(srcdir)/'`stub-object.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stub-object.c' object='libtp_glib_tests_internal_la-stub-object.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-stub-object.lo `test -f 'stub-object.c' || echo '$(srcdir)/'`stub-object.c libtp_glib_tests_internal_la-textchan-null.lo: textchan-null.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-textchan-null.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Tpo -c -o libtp_glib_tests_internal_la-textchan-null.lo `test -f 'textchan-null.c' || echo '$(srcdir)/'`textchan-null.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='textchan-null.c' object='libtp_glib_tests_internal_la-textchan-null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-textchan-null.lo `test -f 'textchan-null.c' || echo '$(srcdir)/'`textchan-null.c libtp_glib_tests_internal_la-textchan-group.lo: textchan-group.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-textchan-group.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Tpo -c -o libtp_glib_tests_internal_la-textchan-group.lo `test -f 'textchan-group.c' || echo '$(srcdir)/'`textchan-group.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='textchan-group.c' object='libtp_glib_tests_internal_la-textchan-group.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-textchan-group.lo `test -f 'textchan-group.c' || echo '$(srcdir)/'`textchan-group.c libtp_glib_tests_internal_la-tls-certificate.lo: tls-certificate.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-tls-certificate.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Tpo -c -o libtp_glib_tests_internal_la-tls-certificate.lo `test -f 'tls-certificate.c' || echo '$(srcdir)/'`tls-certificate.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tls-certificate.c' object='libtp_glib_tests_internal_la-tls-certificate.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-tls-certificate.lo `test -f 'tls-certificate.c' || echo '$(srcdir)/'`tls-certificate.c libtp_glib_tests_internal_la-util.lo: util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtp_glib_tests_internal_la-util.lo -MD -MP -MF $(DEPDIR)/libtp_glib_tests_internal_la-util.Tpo -c -o libtp_glib_tests_internal_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtp_glib_tests_internal_la-util.Tpo $(DEPDIR)/libtp_glib_tests_internal_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libtp_glib_tests_internal_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtp_glib_tests_internal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtp_glib_tests_internal_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/broken-client-types-conn.Plo -rm -f ./$(DEPDIR)/bug-19101-conn.Plo -rm -f ./$(DEPDIR)/bug16307-conn.Plo -rm -f ./$(DEPDIR)/contact-list-manager.Plo -rm -f ./$(DEPDIR)/contacts-conn.Plo -rm -f ./$(DEPDIR)/dbus-tube-chan.Plo -rm -f ./$(DEPDIR)/echo-chan.Plo -rm -f ./$(DEPDIR)/echo-channel-manager-conn.Plo -rm -f ./$(DEPDIR)/echo-cm.Plo -rm -f ./$(DEPDIR)/echo-conn.Plo -rm -f ./$(DEPDIR)/echo-im-manager.Plo -rm -f ./$(DEPDIR)/file-transfer-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-util.Plo -rm -f ./$(DEPDIR)/my-conn-proxy.Plo -rm -f ./$(DEPDIR)/params-cm.Plo -rm -f ./$(DEPDIR)/room-list-chan.Plo -rm -f ./$(DEPDIR)/simple-account-manager.Plo -rm -f ./$(DEPDIR)/simple-account.Plo -rm -f ./$(DEPDIR)/simple-channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/simple-channel-dispatcher.Plo -rm -f ./$(DEPDIR)/simple-channel-manager.Plo -rm -f ./$(DEPDIR)/simple-channel-request.Plo -rm -f ./$(DEPDIR)/simple-client.Plo -rm -f ./$(DEPDIR)/simple-conn.Plo -rm -f ./$(DEPDIR)/simple-manager.Plo -rm -f ./$(DEPDIR)/stream-tube-chan.Plo -rm -f ./$(DEPDIR)/stub-object.Plo -rm -f ./$(DEPDIR)/textchan-group.Plo -rm -f ./$(DEPDIR)/textchan-null.Plo -rm -f ./$(DEPDIR)/tls-certificate.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/broken-client-types-conn.Plo -rm -f ./$(DEPDIR)/bug-19101-conn.Plo -rm -f ./$(DEPDIR)/bug16307-conn.Plo -rm -f ./$(DEPDIR)/contact-list-manager.Plo -rm -f ./$(DEPDIR)/contacts-conn.Plo -rm -f ./$(DEPDIR)/dbus-tube-chan.Plo -rm -f ./$(DEPDIR)/echo-chan.Plo -rm -f ./$(DEPDIR)/echo-channel-manager-conn.Plo -rm -f ./$(DEPDIR)/echo-cm.Plo -rm -f ./$(DEPDIR)/echo-conn.Plo -rm -f ./$(DEPDIR)/echo-im-manager.Plo -rm -f ./$(DEPDIR)/file-transfer-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-broken-client-types-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-bug-19101-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-bug16307-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-contact-list-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-contacts-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-dbus-tube-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-channel-manager-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-cm.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-echo-im-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-file-transfer-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-my-conn-proxy.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-params-cm.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-room-list-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-account.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-dispatcher.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-channel-request.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-client.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-conn.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-simple-manager.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-stream-tube-chan.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-stub-object.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-group.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-textchan-null.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-tls-certificate.Plo -rm -f ./$(DEPDIR)/libtp_glib_tests_internal_la-util.Plo -rm -f ./$(DEPDIR)/my-conn-proxy.Plo -rm -f ./$(DEPDIR)/params-cm.Plo -rm -f ./$(DEPDIR)/room-list-chan.Plo -rm -f ./$(DEPDIR)/simple-account-manager.Plo -rm -f ./$(DEPDIR)/simple-account.Plo -rm -f ./$(DEPDIR)/simple-channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/simple-channel-dispatcher.Plo -rm -f ./$(DEPDIR)/simple-channel-manager.Plo -rm -f ./$(DEPDIR)/simple-channel-request.Plo -rm -f ./$(DEPDIR)/simple-client.Plo -rm -f ./$(DEPDIR)/simple-conn.Plo -rm -f ./$(DEPDIR)/simple-manager.Plo -rm -f ./$(DEPDIR)/stream-tube-chan.Plo -rm -f ./$(DEPDIR)/stub-object.Plo -rm -f ./$(DEPDIR)/textchan-group.Plo -rm -f ./$(DEPDIR)/textchan-null.Plo -rm -f ./$(DEPDIR)/tls-certificate.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ check-local clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(enable_fatal_warnings)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/tests/lib/bug16307-conn.c0000644000175000017500000001455112652510705015630 00000000000000/* * bug16307-conn.c - connection that reproduces the #15307 bug * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "bug16307-conn.h" #include #include #include static void service_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsBug16307Connection, tp_tests_bug16307_connection, TP_TESTS_TYPE_SIMPLE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, service_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, NULL); ); /* type definition stuff */ enum { SIGNAL_GET_STATUS_RECEIVED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; struct _TpTestsBug16307ConnectionPrivate { /* In a real connection manager, the underlying implementation start * connecting, then go to state CONNECTED when finished. Here there isn't * actually a connection, so the connection process is fake and the time * when it connects is, for this test purpose, when the D-Bus method GetStatus * is called. * * Also, the GetStatus D-Bus reply is delayed until * tp_tests_bug16307_connection_inject_get_status_return() is called */ DBusGMethodInvocation *get_status_invocation; }; static void tp_tests_bug16307_connection_init (TpTestsBug16307Connection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_BUG16307_CONNECTION, TpTestsBug16307ConnectionPrivate); } static void finalize (GObject *object) { G_OBJECT_CLASS (tp_tests_bug16307_connection_parent_class)->finalize (object); } static gboolean pretend_connected (gpointer data) { TpTestsBug16307Connection *self = TP_TESTS_BUG16307_CONNECTION (data); TpBaseConnection *conn = (TpBaseConnection *) self; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); gchar *account; TpHandle self_handle; g_object_get (self, "account", &account, NULL); self_handle = tp_handle_ensure (contact_repo, account, NULL, NULL); g_free (account); tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return FALSE; } void tp_tests_bug16307_connection_inject_get_status_return (TpTestsBug16307Connection *self) { TpBaseConnection *self_base = TP_BASE_CONNECTION (self); DBusGMethodInvocation *context; gulong get_signal_id; /* if we don't have a pending get_status yet, wait for it */ if (self->priv->get_status_invocation == NULL) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); get_signal_id = g_signal_connect_swapped (self, "get-status-received", G_CALLBACK (g_main_loop_quit), loop); g_main_loop_run (loop); g_signal_handler_disconnect (self, get_signal_id); g_main_loop_unref (loop); } context = self->priv->get_status_invocation; g_assert (context != NULL); tp_svc_connection_return_from_get_status (context, tp_base_connection_get_status (self_base)); self->priv->get_status_invocation = NULL; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( tp_tests_bug16307_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_ALIASING); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_CAPABILITIES); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_PRESENCE); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_AVATARS); return interfaces; } static void tp_tests_bug16307_connection_class_init (TpTestsBug16307ConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; static TpDBusPropertiesMixinPropImpl connection_properties[] = { { "Status", "dbus-status-except-i-broke-it", NULL }, { NULL } }; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (TpTestsBug16307ConnectionPrivate)); base_class->start_connecting = start_connecting; base_class->get_interfaces_always_present = get_interfaces_always_present; signals[SIGNAL_GET_STATUS_RECEIVED] = g_signal_new ("get-status-received", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /* break the Connection D-Bus properties implementation, so that we always * cause the slower introspection codepath (the one that actually calls * GetStatus) in TpConnection to be invoked */ tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CONNECTION, NULL, NULL, connection_properties); } /** * tp_tests_bug16307_connection_get_status * * Implements D-Bus method GetStatus * on interface org.freedesktop.Telepathy.Connection */ static void tp_tests_bug16307_connection_get_status (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self_base = TP_BASE_CONNECTION (iface); TpTestsBug16307Connection *self = TP_TESTS_BUG16307_CONNECTION (iface); /* auto-connect on get_status */ if (tp_base_connection_get_status (self_base) == TP_CONNECTION_STATUS_DISCONNECTED) { pretend_connected (self); } /* D-Bus return call later */ g_assert (self->priv->get_status_invocation == NULL); g_assert (context != NULL); self->priv->get_status_invocation = context; g_signal_emit (self, signals[SIGNAL_GET_STATUS_RECEIVED], 0); } static void service_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionClass *klass = g_iface; #define IMPLEMENT(prefix,x) tp_svc_connection_implement_##x (klass, \ tp_tests_bug16307_connection_##prefix##x) IMPLEMENT(,get_status); #undef IMPLEMENT } telepathy-glib-0.24.2/tests/lib/bug16307-conn.h0000644000175000017500000000421712652510705015633 00000000000000/* * bug16307-conn.h - header for a connection that reproduces the #15307 bug * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_BUG16307_CONN_H__ #define __TP_TESTS_BUG16307_CONN_H__ #include #include #include "simple-conn.h" G_BEGIN_DECLS typedef struct _TpTestsBug16307Connection TpTestsBug16307Connection; typedef struct _TpTestsBug16307ConnectionClass TpTestsBug16307ConnectionClass; typedef struct _TpTestsBug16307ConnectionPrivate TpTestsBug16307ConnectionPrivate; struct _TpTestsBug16307ConnectionClass { TpTestsSimpleConnectionClass parent_class; }; struct _TpTestsBug16307Connection { TpTestsSimpleConnection parent; TpTestsBug16307ConnectionPrivate *priv; }; GType tp_tests_bug16307_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_BUG16307_CONNECTION \ (tp_tests_bug16307_connection_get_type ()) #define TP_TESTS_BUG16307_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_BUG16307_CONNECTION, \ TpTestsBug16307Connection)) #define TP_TESTS_BUG16307_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_BUG16307_CONNECTION, \ TpTestsBug16307ConnectionClass)) #define TP_TESTS_BUG16307_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_BUG16307_CONNECTION)) #define TP_TESTS_BUG16307_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_BUG16307_CONNECTION)) #define TP_TESTS_BUG16307_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_BUG16307_CONNECTION, \ TpTestsBug16307ConnectionClass)) /* Cause "network events", for debugging/testing */ void tp_tests_bug16307_connection_inject_get_status_return (TpTestsBug16307Connection *self); G_END_DECLS #endif /* #ifndef __TP_TESTS_BUG16307_CONN_H__ */ telepathy-glib-0.24.2/tests/lib/dbus-tube-chan.c0000644000175000017500000003047412652510705016322 00000000000000/* * dbus-tube-chan.c - Simple dbus tube channel * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "dbus-tube-chan.h" #include #include #if defined(G_OS_UNIX) # define LISTEN_ADDRESS "unix:tmpdir=/tmp" #else # define LISTEN_ADDRESS "tcp:host=127.0.0.1" #endif enum { PROP_SERVICE_NAME = 1, PROP_DBUS_NAMES, PROP_SUPPORTED_ACCESS_CONTROLS, PROP_PARAMETERS, PROP_STATE, }; enum { SIG_NEW_CONNECTION, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; struct _TpTestsDBusTubeChannelPrivate { /* Controls whether the channel should become open before returning from * Open/Accept, after returning, or never. */ TpTestsDBusTubeChannelOpenMode open_mode; TpTubeChannelState state; /* TpHandle -> gchar * */ GHashTable *dbus_names; GDBusServer *dbus_server; }; static void tp_tests_dbus_tube_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsDBusTubeChannel *self = (TpTestsDBusTubeChannel *) object; switch (property_id) { case PROP_SERVICE_NAME: g_value_set_string (value, "com.test.Test"); break; case PROP_DBUS_NAMES: g_value_set_boxed (value, self->priv->dbus_names); break; case PROP_SUPPORTED_ACCESS_CONTROLS: { GArray *array; TpSocketAccessControl a; array = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); a = TP_SOCKET_ACCESS_CONTROL_LOCALHOST; g_array_append_val (array, a); g_value_set_boxed (value, array); g_array_unref (array); } break; case PROP_PARAMETERS: g_value_take_boxed (value, tp_asv_new ( "badger", G_TYPE_UINT, 42, NULL)); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void dbus_tube_iface_init (gpointer iface, gpointer data); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpTestsDBusTubeChannel, tp_tests_dbus_tube_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_DBUS_TUBE, dbus_tube_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_TUBE, NULL); ) /* type definition stuff */ static GPtrArray * tp_tests_dbus_tube_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( tp_tests_dbus_tube_channel_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_TUBE); return interfaces; }; static void tp_tests_dbus_tube_channel_init (TpTestsDBusTubeChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL, TpTestsDBusTubeChannelPrivate); self->priv->open_mode = TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST; self->priv->dbus_names = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_dbus_tube_channel_parent_class)->constructor ( type, n_props, props); TpTestsDBusTubeChannel *self = TP_TESTS_DBUS_TUBE_CHANNEL (object); if (tp_base_channel_is_requested (TP_BASE_CHANNEL (self))) self->priv->state = TP_TUBE_CHANNEL_STATE_NOT_OFFERED; else self->priv->state = TP_TUBE_CHANNEL_STATE_LOCAL_PENDING; tp_base_channel_register (TP_BASE_CHANNEL (self)); return object; } static void dispose (GObject *object) { TpTestsDBusTubeChannel *self = (TpTestsDBusTubeChannel *) object; tp_clear_pointer (&self->priv->dbus_names, g_hash_table_unref); if (self->priv->dbus_server != NULL) { /* FIXME: this is pretty stupid but apparently unless you start and then * stop the server before freeing it, it doesn't stop listening. Calling * _start() twice is a no-op. * * https://bugzilla.gnome.org/show_bug.cgi?id=673372 */ g_dbus_server_start (self->priv->dbus_server); g_dbus_server_stop (self->priv->dbus_server); g_clear_object (&self->priv->dbus_server); } ((GObjectClass *) tp_tests_dbus_tube_channel_parent_class)->dispose ( object); } static void channel_close (TpBaseChannel *channel) { tp_base_channel_destroyed (channel); } static void fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_dbus_tube_channel_parent_class); klass->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "ServiceName", TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, "SupportedAccessControls", NULL); if (!tp_base_channel_is_requested (chan)) { /* Parameters is immutable only for incoming tubes */ tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters", NULL); } } static void tp_tests_dbus_tube_channel_class_init (TpTestsDBusTubeChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl dbus_tube_props[] = { { "ServiceName", "service-name", NULL, }, { "DBusNames", "dbus-names", NULL, }, { "SupportedAccessControls", "supported-access-controls", NULL, }, { NULL } }; static TpDBusPropertiesMixinPropImpl tube_props[] = { { "Parameters", "parameters", NULL, }, { "State", "state", NULL, }, { NULL } }; object_class->constructor = constructor; object_class->get_property = tp_tests_dbus_tube_channel_get_property; object_class->dispose = dispose; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_DBUS_TUBE; base_class->get_interfaces = tp_tests_dbus_tube_channel_get_interfaces; base_class->close = channel_close; base_class->fill_immutable_properties = fill_immutable_properties; /* base_class->target_handle_type is defined in subclasses */ param_spec = g_param_spec_string ("service-name", "Service Name", "the service name associated with this tube object.", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE_NAME, param_spec); param_spec = g_param_spec_boxed ("dbus-names", "DBus Names", "DBusTube.DBusNames", TP_HASH_TYPE_DBUS_TUBE_PARTICIPANTS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_NAMES, param_spec); param_spec = g_param_spec_boxed ("supported-access-controls", "Supported access-controls", "GArray containing supported access controls.", DBUS_TYPE_G_UINT_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUPPORTED_ACCESS_CONTROLS, param_spec); param_spec = g_param_spec_boxed ( "parameters", "Parameters", "parameters of the tube", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PARAMETERS, param_spec); param_spec = g_param_spec_uint ( "state", "TpTubeState", "state of the tube", 0, TP_NUM_TUBE_CHANNEL_STATES - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); _signals[SIG_NEW_CONNECTION] = g_signal_new ("new-connection", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, g_signal_accumulator_true_handled, NULL, NULL, G_TYPE_BOOLEAN, 1, G_TYPE_DBUS_CONNECTION); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, dbus_tube_props); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, tube_props); g_type_class_add_private (object_class, sizeof (TpTestsDBusTubeChannelPrivate)); } static void change_state (TpTestsDBusTubeChannel *self, TpTubeChannelState state) { self->priv->state = state; tp_svc_channel_interface_tube_emit_tube_channel_state_changed (self, state); } static gboolean dbus_new_connection_cb (GDBusServer *server, GDBusConnection *connection, gpointer user_data) { TpTestsDBusTubeChannel *self = user_data; gboolean ret = FALSE; g_signal_emit (self, _signals[SIG_NEW_CONNECTION], 0, connection, &ret); return ret; } static void open_tube (TpTestsDBusTubeChannel *self) { GError *error = NULL; gchar *guid; guid = g_dbus_generate_guid (); self->priv->dbus_server = g_dbus_server_new_sync (LISTEN_ADDRESS, G_DBUS_SERVER_FLAGS_NONE, guid, NULL, NULL, &error); g_assert_no_error (error); g_free (guid); g_signal_connect (self->priv->dbus_server, "new-connection", G_CALLBACK (dbus_new_connection_cb), self); } static void really_open_tube (TpTestsDBusTubeChannel *self) { g_dbus_server_start (self->priv->dbus_server); change_state (self, TP_TUBE_CHANNEL_STATE_OPEN); } static void dbus_tube_offer (TpSvcChannelTypeDBusTube *chan, GHashTable *parameters, guint access_control, DBusGMethodInvocation *context) { TpTestsDBusTubeChannel *self = (TpTestsDBusTubeChannel *) chan; open_tube (self); if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST) really_open_tube (self); tp_svc_channel_type_dbus_tube_return_from_offer (context, g_dbus_server_get_client_address (self->priv->dbus_server)); if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_SECOND) really_open_tube (self); else if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_NEVER_OPEN) tp_base_channel_close (TP_BASE_CHANNEL (self)); } static void dbus_tube_accept (TpSvcChannelTypeDBusTube *chan, guint access_control, DBusGMethodInvocation *context) { TpTestsDBusTubeChannel *self = (TpTestsDBusTubeChannel *) chan; open_tube (self); if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST) really_open_tube (self); tp_svc_channel_type_dbus_tube_return_from_accept (context, g_dbus_server_get_client_address (self->priv->dbus_server)); if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_SECOND) really_open_tube (self); else if (self->priv->open_mode == TP_TESTS_DBUS_TUBE_CHANNEL_NEVER_OPEN) tp_base_channel_close (TP_BASE_CHANNEL (self)); } void tp_tests_dbus_tube_channel_set_open_mode ( TpTestsDBusTubeChannel *self, TpTestsDBusTubeChannelOpenMode open_mode) { self->priv->open_mode = open_mode; } static void dbus_tube_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeDBusTubeClass *klass = iface; #define IMPLEMENT(x) tp_svc_channel_type_dbus_tube_implement_##x (klass, dbus_tube_##x) IMPLEMENT (offer); IMPLEMENT (accept); #undef IMPLEMENT } /* Contact DBus Tube */ G_DEFINE_TYPE (TpTestsContactDBusTubeChannel, tp_tests_contact_dbus_tube_channel, TP_TESTS_TYPE_DBUS_TUBE_CHANNEL) static void tp_tests_contact_dbus_tube_channel_init ( TpTestsContactDBusTubeChannel *self) { } static void tp_tests_contact_dbus_tube_channel_class_init ( TpTestsContactDBusTubeChannelClass *klass) { TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; } /* Room DBus Tube */ G_DEFINE_TYPE (TpTestsRoomDBusTubeChannel, tp_tests_room_dbus_tube_channel, TP_TESTS_TYPE_DBUS_TUBE_CHANNEL) static void tp_tests_room_dbus_tube_channel_init ( TpTestsRoomDBusTubeChannel *self) { } static void tp_tests_room_dbus_tube_channel_class_init ( TpTestsRoomDBusTubeChannelClass *klass) { TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); base_class->target_handle_type = TP_HANDLE_TYPE_ROOM; } telepathy-glib-0.24.2/tests/lib/dbus-tube-chan.h0000644000175000017500000001152012652510705016316 00000000000000/* * dbus-tube-chan.h - Simple dbus tube channel * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_DBUS_TUBE_CHAN_H__ #define __TP_DBUS_TUBE_CHAN_H__ #include #include G_BEGIN_DECLS /* Base Class */ typedef struct _TpTestsDBusTubeChannel TpTestsDBusTubeChannel; typedef struct _TpTestsDBusTubeChannelClass TpTestsDBusTubeChannelClass; typedef struct _TpTestsDBusTubeChannelPrivate TpTestsDBusTubeChannelPrivate; GType tp_tests_dbus_tube_channel_get_type (void); #define TP_TESTS_TYPE_DBUS_TUBE_CHANNEL \ (tp_tests_dbus_tube_channel_get_type ()) #define TP_TESTS_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL, \ TpTestsDBusTubeChannel)) #define TP_TESTS_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL, \ TpTestsDBusTubeChannelClass)) #define TP_TESTS_IS_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL)) #define TP_TESTS_IS_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL)) #define TP_TESTS_DBUS_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_DBUS_TUBE_CHANNEL, \ TpTestsDBusTubeChannelClass)) struct _TpTestsDBusTubeChannelClass { TpBaseChannelClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsDBusTubeChannel { TpBaseChannel parent; TpTestsDBusTubeChannelPrivate *priv; }; typedef enum { TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST, TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_SECOND, TP_TESTS_DBUS_TUBE_CHANNEL_NEVER_OPEN } TpTestsDBusTubeChannelOpenMode; void tp_tests_dbus_tube_channel_set_open_mode ( TpTestsDBusTubeChannel *self, TpTestsDBusTubeChannelOpenMode open_mode); /* Contact DBus Tube */ typedef struct _TpTestsContactDBusTubeChannel TpTestsContactDBusTubeChannel; typedef struct _TpTestsContactDBusTubeChannelClass TpTestsContactDBusTubeChannelClass; GType tp_tests_contact_dbus_tube_channel_get_type (void); #define TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL \ (tp_tests_contact_dbus_tube_channel_get_type ()) #define TP_TESTS_CONTACT_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL, \ TpTestsContactDBusTubeChannel)) #define TP_TESTS_CONTACT_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL, \ TpTestsContactDBusTubeChannelClass)) #define TP_TESTS_IS_CONTACT_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL)) #define TP_TESTS_IS_CONTACT_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL)) #define TP_TESTS_CONTACT_DBUS_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL, \ TpTestsContactDBusTubeChannelClass)) struct _TpTestsContactDBusTubeChannelClass { TpTestsDBusTubeChannelClass parent_class; }; struct _TpTestsContactDBusTubeChannel { TpTestsDBusTubeChannel parent; }; /* Room DBus Tube */ typedef struct _TpTestsRoomDBusTubeChannel TpTestsRoomDBusTubeChannel; typedef struct _TpTestsRoomDBusTubeChannelClass TpTestsRoomDBusTubeChannelClass; GType tp_tests_room_dbus_tube_channel_get_type (void); #define TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL \ (tp_tests_room_dbus_tube_channel_get_type ()) #define TP_TESTS_ROOM_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL, \ TpTestsRoomDBusTubeChannel)) #define TP_TESTS_ROOM_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL, \ TpTestsRoomDBusTubeChannelClass)) #define TP_TESTS_IS_ROOM_DBUS_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL)) #define TP_TESTS_IS_ROOM_DBUS_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL)) #define TP_TESTS_ROOM_DBUS_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL, \ TpTestsRoomDBusTubeChannelClass)) struct _TpTestsRoomDBusTubeChannelClass { TpTestsDBusTubeChannelClass parent_class; }; struct _TpTestsRoomDBusTubeChannel { TpTestsDBusTubeChannel parent; }; G_END_DECLS #endif /* #ifndef __TP_DBUS_TUBE_CHAN_H__ */ telepathy-glib-0.24.2/tests/lib/textchan-null.c0000644000175000017500000004144612652510705016310 00000000000000/* * /dev/null as a text channel * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "textchan-null.h" #include #include /* This is for text-mixin unit tests, others should be using ExampleEcho2Channel * which uses newer TpMessageMixin */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void text_iface_init (gpointer iface, gpointer data); static void channel_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TpTestsTextChannelNull, tp_tests_text_channel_null, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL)) G_DEFINE_TYPE_WITH_CODE (TpTestsPropsTextChannel, tp_tests_props_text_channel, TP_TESTS_TYPE_TEXT_CHANNEL_NULL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init)) G_DEFINE_TYPE_WITH_CODE (TpTestsPropsGroupTextChannel, tp_tests_props_group_text_channel, TP_TESTS_TYPE_PROPS_TEXT_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_group_mixin_iface_init)) static const char *tp_tests_text_channel_null_interfaces[] = { NULL }; /* type definition stuff */ enum { PROP_OBJECT_PATH = 1, PROP_CHANNEL_TYPE, PROP_HANDLE_TYPE, PROP_HANDLE, PROP_TARGET_ID, PROP_CONNECTION, PROP_INTERFACES, PROP_REQUESTED, PROP_INITIATOR_HANDLE, PROP_INITIATOR_ID, N_PROPS }; struct _TpTestsTextChannelNullPrivate { TpBaseConnection *conn; gchar *object_path; TpHandle handle; unsigned closed:1; unsigned disposed:1; }; static void tp_tests_text_channel_null_init (TpTestsTextChannelNull *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_TEXT_CHANNEL_NULL, TpTestsTextChannelNullPrivate); } static void tp_tests_props_text_channel_init (TpTestsPropsTextChannel *self) { self->dbus_property_interfaces_retrieved = g_hash_table_new (NULL, NULL); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_text_channel_null_parent_class)->constructor (type, n_props, props); TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (object); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); tp_handle_ref (contact_repo, self->priv->handle); tp_dbus_daemon_register_object ( tp_base_connection_get_dbus_daemon (self->priv->conn), self->priv->object_path, self); tp_text_mixin_init (object, G_STRUCT_OFFSET (TpTestsTextChannelNull, text), contact_repo); tp_text_mixin_set_message_types (object, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, G_MAXUINT); return object; } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (object); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_CHANNEL_TYPE: g_value_set_static_string (value, TP_IFACE_CHANNEL_TYPE_TEXT); break; case PROP_HANDLE_TYPE: g_value_set_uint (value, TP_HANDLE_TYPE_CONTACT); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; case PROP_TARGET_ID: { TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( self->priv->conn, TP_HANDLE_TYPE_CONTACT); g_value_set_string (value, tp_handle_inspect (contact_repo, self->priv->handle)); } break; case PROP_REQUESTED: g_value_set_boolean (value, TRUE); break; case PROP_INITIATOR_HANDLE: g_value_set_uint (value, tp_base_connection_get_self_handle ( self->priv->conn)); break; case PROP_INITIATOR_ID: { TpHandleRepoIface *contact_repo = tp_base_connection_get_handles ( self->priv->conn, TP_HANDLE_TYPE_CONTACT); g_value_set_string (value, tp_handle_inspect (contact_repo, tp_base_connection_get_self_handle (self->priv->conn))); } break; case PROP_INTERFACES: g_value_set_boxed (value, tp_tests_text_channel_null_interfaces); break; case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (object); switch (property_id) { case PROP_OBJECT_PATH: g_free (self->priv->object_path); self->priv->object_path = g_value_dup_string (value); break; case PROP_HANDLE: /* we don't ref it here because we don't necessarily have access to the * contact repo yet - instead we ref it in the constructor. */ self->priv->handle = g_value_get_uint (value); break; case PROP_HANDLE_TYPE: case PROP_CHANNEL_TYPE: /* these properties are writable in the interface, but not actually * meaningfully changable on this channel, so we do nothing */ break; case PROP_CONNECTION: self->priv->conn = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } void tp_tests_text_channel_null_close (TpTestsTextChannelNull *self) { if (!self->priv->closed) { self->priv->closed = TRUE; tp_svc_channel_emit_closed (self); tp_dbus_daemon_unregister_object ( tp_base_connection_get_dbus_daemon (self->priv->conn), self); } } static void dispose (GObject *object) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (object); if (self->priv->disposed) return; self->priv->disposed = TRUE; tp_tests_text_channel_null_close (self); ((GObjectClass *) tp_tests_text_channel_null_parent_class)->dispose (object); } static void finalize (GObject *object) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (object); TpHandleRepoIface *contact_handles = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); tp_handle_unref (contact_handles, self->priv->handle); g_free (self->priv->object_path); tp_text_mixin_finalize (object); ((GObjectClass *) tp_tests_text_channel_null_parent_class)->finalize (object); } static void tp_tests_text_channel_null_class_init (TpTestsTextChannelNullClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpTestsTextChannelNullPrivate)); object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; object_class->dispose = dispose; object_class->finalize = finalize; g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "Connection object that owns this channel", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "Additional Channel.Interface.* interfaces", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_string ("target-id", "Peer's ID", "The string obtained by inspecting the target handle", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec); param_spec = g_param_spec_uint ("initiator-handle", "Initiator's handle", "The contact who initiated the channel", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE, param_spec); param_spec = g_param_spec_string ("initiator-id", "Initiator's ID", "The string obtained by inspecting the initiator-handle", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_ID, param_spec); param_spec = g_param_spec_boolean ("requested", "Requested?", "True if this channel was requested by the local user", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTED, param_spec); tp_text_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsTextChannelNullClass, text_class)); } static void tp_tests_props_text_channel_getter_gobject_properties (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data) { TpTestsPropsTextChannel *self = TP_TESTS_PROPS_TEXT_CHANNEL (object); g_hash_table_insert (self->dbus_property_interfaces_retrieved, GUINT_TO_POINTER (interface), GUINT_TO_POINTER (interface)); tp_dbus_properties_mixin_getter_gobject_properties (object, interface, name, value, getter_data); } static void props_finalize (GObject *object) { TpTestsPropsTextChannel *self = TP_TESTS_PROPS_TEXT_CHANNEL (object); g_hash_table_unref (self->dbus_property_interfaces_retrieved); ((GObjectClass *) tp_tests_props_text_channel_parent_class)->finalize (object); } static void tp_tests_props_text_channel_class_init (TpTestsPropsTextChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; static TpDBusPropertiesMixinPropImpl channel_props[] = { { "TargetHandleType", "handle-type", NULL }, { "TargetHandle", "handle", NULL }, { "ChannelType", "channel-type", NULL }, { "Interfaces", "interfaces", NULL }, { "TargetID", "target-id", NULL }, { "Requested", "requested", NULL }, { "InitiatorHandle", "initiator-handle", NULL }, { "InitiatorID", "initiator-id", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL, tp_tests_props_text_channel_getter_gobject_properties, NULL, channel_props, }, { NULL } }; object_class->finalize = props_finalize; klass->dbus_properties_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsPropsTextChannelClass, dbus_properties_class)); } static void tp_tests_props_group_text_channel_init (TpTestsPropsGroupTextChannel *self) { } static void group_constructed (GObject *self) { TpBaseConnection *conn = TP_TESTS_TEXT_CHANNEL_NULL (self)->priv->conn; void (*chain_up) (GObject *) = ((GObjectClass *) tp_tests_props_group_text_channel_parent_class)->constructed; if (chain_up != NULL) chain_up (self); tp_group_mixin_init (self, G_STRUCT_OFFSET (TpTestsPropsGroupTextChannel, group), tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT), tp_base_connection_get_self_handle (conn)); tp_group_mixin_change_flags (self, TP_CHANNEL_GROUP_FLAG_PROPERTIES, 0); } static void group_finalize (GObject *self) { tp_group_mixin_finalize (self); ((GObjectClass *) tp_tests_props_group_text_channel_parent_class)->finalize (self); } static gboolean dummy_add_remove_member (GObject *obj, TpHandle handle, const gchar *message, GError **error) { return TRUE; } static void group_iface_props_getter (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer getter_data) { TpTestsPropsTextChannel *self = TP_TESTS_PROPS_TEXT_CHANNEL (object); g_hash_table_insert (self->dbus_property_interfaces_retrieved, GUINT_TO_POINTER (interface), GUINT_TO_POINTER (interface)); tp_group_mixin_get_dbus_property (object, interface, name, value, getter_data); } static void tp_tests_props_group_text_channel_class_init (TpTestsPropsGroupTextChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; static TpDBusPropertiesMixinPropImpl group_props[] = { { "GroupFlags", NULL, NULL }, { "HandleOwners", NULL, NULL }, { "LocalPendingMembers", NULL, NULL }, { "Members", NULL, NULL }, { "RemotePendingMembers", NULL, NULL }, { "SelfHandle", NULL, NULL }, { NULL } }; object_class->constructed = group_constructed; object_class->finalize = group_finalize; tp_group_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsPropsGroupTextChannelClass, group_class), dummy_add_remove_member, dummy_add_remove_member); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP, group_iface_props_getter, NULL, group_props); } static void channel_close (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (iface); tp_tests_text_channel_null_close (self); tp_svc_channel_return_from_close (context); } static void channel_get_channel_type (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (iface); self->get_channel_type_called++; tp_svc_channel_return_from_get_channel_type (context, TP_IFACE_CHANNEL_TYPE_TEXT); } static void channel_get_handle (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (iface); self->get_handle_called++; tp_svc_channel_return_from_get_handle (context, TP_HANDLE_TYPE_CONTACT, self->priv->handle); } static void channel_get_interfaces (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpTestsTextChannelNull *self = TP_TESTS_TEXT_CHANNEL_NULL (iface); self->get_interfaces_called++; tp_svc_channel_return_from_get_interfaces (context, tp_tests_text_channel_null_interfaces); } static void channel_iface_init (gpointer iface, gpointer data) { TpSvcChannelClass *klass = iface; #define IMPLEMENT(x) tp_svc_channel_implement_##x (klass, channel_##x) IMPLEMENT (close); IMPLEMENT (get_channel_type); IMPLEMENT (get_handle); IMPLEMENT (get_interfaces); #undef IMPLEMENT } static void text_send (TpSvcChannelTypeText *iface, guint type, const gchar *text, DBusGMethodInvocation *context) { /* silently swallow the message */ tp_svc_channel_type_text_return_from_send (context); } static void text_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeTextClass *klass = iface; tp_text_mixin_iface_init (iface, data); #define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (klass, text_##x) IMPLEMENT (send); #undef IMPLEMENT } GHashTable * tp_tests_text_channel_get_props (TpTestsTextChannelNull *self) { GHashTable *props; TpHandleType handle_type; TpHandle handle; gchar *target_id; gboolean requested; TpHandle initiator_handle; gchar *initiator_id; GStrv interfaces; g_object_get (self, "handle-type", &handle_type, "handle", &handle, "target-id", &target_id, "requested", &requested, "initiator-handle", &initiator_handle, "initiator-id", &initiator_id, "interfaces", &interfaces, NULL); props = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, target_id, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, requested, TP_PROP_CHANNEL_INITIATOR_HANDLE, G_TYPE_UINT, initiator_handle, TP_PROP_CHANNEL_INITIATOR_ID, G_TYPE_STRING, initiator_id, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV, interfaces, NULL); g_free (target_id); g_free (initiator_id); g_strfreev (interfaces); return props; } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/tests/lib/textchan-null.h0000644000175000017500000001156312652510705016312 00000000000000/* * /dev/null as a text channel * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_TEXT_CHANNEL_NULL_H__ #define __TP_TESTS_TEXT_CHANNEL_NULL_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsTextChannelNull TpTestsTextChannelNull; typedef struct _TpTestsTextChannelNullClass TpTestsTextChannelNullClass; typedef struct _TpTestsTextChannelNullPrivate TpTestsTextChannelNullPrivate; GType tp_tests_text_channel_null_get_type (void); #define TP_TESTS_TYPE_TEXT_CHANNEL_NULL \ (tp_tests_text_channel_null_get_type ()) #define TP_TESTS_TEXT_CHANNEL_NULL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_NULL, \ TpTestsTextChannelNull)) #define TP_TESTS_TEXT_CHANNEL_NULL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_TEXT_CHANNEL_NULL, \ TpTestsTextChannelNullClass)) #define TP_TESTS_IS_TEXT_CHANNEL_NULL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_NULL)) #define TP_TESTS_IS_TEXT_CHANNEL_NULL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_TEXT_CHANNEL_NULL)) #define TP_TESTS_TEXT_CHANNEL_NULL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_NULL, \ TpTestsTextChannelNullClass)) struct _TpTestsTextChannelNullClass { GObjectClass parent_class; TpTextMixinClass text_class; }; struct _TpTestsTextChannelNull { GObject parent; TpTextMixin text; guint get_handle_called; guint get_interfaces_called; guint get_channel_type_called; TpTestsTextChannelNullPrivate *priv; }; /* Subclass with D-Bus properties */ typedef struct _TestPropsTextChannel TpTestsPropsTextChannel; typedef struct _TestPropsTextChannelClass TpTestsPropsTextChannelClass; struct _TestPropsTextChannel { TpTestsTextChannelNull parent; GHashTable *dbus_property_interfaces_retrieved; }; struct _TestPropsTextChannelClass { TpTestsTextChannelNullClass parent; TpDBusPropertiesMixinClass dbus_properties_class; }; GType tp_tests_props_text_channel_get_type (void); #define TP_TESTS_TYPE_PROPS_TEXT_CHANNEL \ (tp_tests_props_text_channel_get_type ()) #define TP_TESTS_PROPS_TEXT_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_PROPS_TEXT_CHANNEL, \ TpTestsPropsTextChannel)) #define TP_TESTS_PROPS_TEXT_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_PROPS_TEXT_CHANNEL, \ TpTestsPropsTextChannelClass)) #define TP_TESTS_IS_PROPS_TEXT_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_PROPS_TEXT_CHANNEL)) #define TP_TESTS_IS_PROPS_TEXT_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_PROPS_TEXT_CHANNEL)) #define TP_TESTS_PROPS_TEXT_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_PROPS_TEXT_CHANNEL, \ TpTestsPropsTextChannelClass)) /* Subclass with D-Bus properties and Group */ typedef struct _TestPropsGroupTextChannel TpTestsPropsGroupTextChannel; typedef struct _TestPropsGroupTextChannelClass TpTestsPropsGroupTextChannelClass; struct _TestPropsGroupTextChannel { TpTestsPropsTextChannel parent; TpGroupMixin group; }; struct _TestPropsGroupTextChannelClass { TpTestsPropsTextChannelClass parent; TpGroupMixinClass group_class; }; GType tp_tests_props_group_text_channel_get_type (void); #define TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL \ (tp_tests_props_group_text_channel_get_type ()) #define TP_TESTS_PROPS_GROUP_TEXT_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL, \ TpTestsPropsGroupTextChannel)) #define TP_TESTS_PROPS_GROUP_TEXT_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL, \ TpTestsPropsGroupTextChannelClass)) #define TP_TESTS_IS_PROPS_GROUP_TEXT_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL)) #define TP_TESTS_IS_PROPS_GROUP_TEXT_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL)) #define TP_TESTS_PROPS_GROUP_TEXT_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL, \ TpTestsPropsGroupTextChannelClass)) void tp_tests_text_channel_null_close (TpTestsTextChannelNull *self); GHashTable * tp_tests_text_channel_get_props (TpTestsTextChannelNull *self); G_END_DECLS #endif /* #ifndef __TP_TESTS_TEXT_CHANNEL_NULL_H__ */ telepathy-glib-0.24.2/tests/lib/params-cm.c0000644000175000017500000001453212652510705015376 00000000000000/* * params-cm.h - source for TpTestsParamConnectionManager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "params-cm.h" #include #include G_DEFINE_TYPE (TpTestsParamConnectionManager, tp_tests_param_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) struct _TpTestsParamConnectionManagerPrivate { int dummy; }; static void tp_tests_param_connection_manager_init ( TpTestsParamConnectionManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER, TpTestsParamConnectionManagerPrivate); } enum { TP_TESTS_PARAM_STRING, TP_TESTS_PARAM_INT16, TP_TESTS_PARAM_INT32, TP_TESTS_PARAM_UINT16, TP_TESTS_PARAM_UINT32, TP_TESTS_PARAM_INT64, TP_TESTS_PARAM_UINT64, TP_TESTS_PARAM_BOOLEAN, TP_TESTS_PARAM_DOUBLE, TP_TESTS_PARAM_ARRAY_STRINGS, TP_TESTS_PARAM_ARRAY_BYTES, TP_TESTS_PARAM_OBJECT_PATH, TP_TESTS_PARAM_LC_STRING, TP_TESTS_PARAM_UC_STRING, NUM_PARAM }; static gboolean filter_string_ascii_case (const TpCMParamSpec *param_spec, GValue *value, GError **error) { const gchar *s = g_value_get_string (value); guint i; for (i = 0; s[i] != '\0'; i++) { int c = s[i]; /* just to avoid -Wtype-limits */ if (c < 0 || c > 127) /* char might be signed or unsigned */ { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s must be ASCII", param_spec->name); return FALSE; } } if (GINT_TO_POINTER (param_spec->filter_data)) g_value_take_string (value, g_ascii_strup (s, -1)); else g_value_take_string (value, g_ascii_strdown (s, -1)); return TRUE; } static TpCMParamSpec param_example_params[] = { { "a-string", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, "the default string", G_STRUCT_OFFSET (TpTestsCMParams, a_string), NULL, NULL, NULL }, { "a-int16", "n", G_TYPE_INT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GINT_TO_POINTER (42), G_STRUCT_OFFSET (TpTestsCMParams, a_int16), NULL, NULL, NULL }, { "a-int32", "i", G_TYPE_INT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GINT_TO_POINTER (42), G_STRUCT_OFFSET (TpTestsCMParams, a_int32), NULL, NULL, NULL }, { "a-uint16", "q", G_TYPE_UINT, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_uint16), NULL, NULL, NULL }, { "a-uint32", "u", G_TYPE_UINT, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_uint32), NULL, NULL, NULL }, { "a-int64", "x", G_TYPE_INT64, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_int64), NULL, NULL, NULL }, { "a-uint64", "t", G_TYPE_UINT64, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_uint64), NULL, NULL, NULL }, { "a-boolean", "b", G_TYPE_BOOLEAN, TP_CONN_MGR_PARAM_FLAG_REQUIRED, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_boolean), NULL, NULL, NULL }, { "a-double", "d", G_TYPE_DOUBLE, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_double), NULL, NULL, NULL }, { "a-array-of-strings", "as", 0, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_array_of_strings), NULL, NULL, NULL }, { "a-array-of-bytes", "ay", 0, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_array_of_bytes), NULL, NULL, NULL }, { "a-object-path", "o", 0, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, a_object_path), NULL, NULL, NULL }, /* demo of a filter */ { "lc-string", "s", G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, lc_string), filter_string_ascii_case, GINT_TO_POINTER (FALSE), NULL }, { "uc-string", "s", G_TYPE_STRING, 0, NULL, G_STRUCT_OFFSET (TpTestsCMParams, uc_string), filter_string_ascii_case, GINT_TO_POINTER (TRUE), NULL }, { NULL } }; static TpTestsCMParams *params = NULL; static gpointer alloc_params (void) { params = g_slice_new0 (TpTestsCMParams); return params; } static void free_params (gpointer p) { /* CM user is responsible to free params so he can check their values */ params = (TpTestsCMParams *) p; params->would_have_been_freed = TRUE; } static const TpCMProtocolSpec example_protocols[] = { { "example", param_example_params, alloc_params, free_params }, { NULL, NULL } }; static TpBaseConnection * new_connection (TpBaseConnectionManager *self, const gchar *proto, TpIntset *params_present, gpointer parsed_params, GError **error) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No connection for you"); return NULL; } static void tp_tests_param_connection_manager_class_init ( TpTestsParamConnectionManagerClass *klass) { TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; g_type_class_add_private (klass, sizeof (TpTestsParamConnectionManagerPrivate)); param_example_params[TP_TESTS_PARAM_ARRAY_STRINGS].gtype = G_TYPE_STRV; param_example_params[TP_TESTS_PARAM_ARRAY_BYTES].gtype = DBUS_TYPE_G_UCHAR_ARRAY; param_example_params[TP_TESTS_PARAM_OBJECT_PATH].gtype = DBUS_TYPE_G_OBJECT_PATH; base_class->new_connection = new_connection; base_class->cm_dbus_name = "params_cm"; base_class->protocol_params = example_protocols; } TpTestsCMParams * tp_tests_param_connection_manager_steal_params_last_conn (void) { TpTestsCMParams *p = params; params = NULL; return p; } void tp_tests_param_connection_manager_free_params (TpTestsCMParams *p) { g_free (p->a_string); g_strfreev (p->a_array_of_strings); if (p->a_array_of_bytes != NULL) g_array_unref (p->a_array_of_bytes); g_free (p->a_object_path); g_slice_free (TpTestsCMParams, p); } telepathy-glib-0.24.2/tests/lib/params-cm.h0000644000175000017500000000651612652510705015406 00000000000000/* * params-cm.h - header for TpTestsParamConnectionManager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_TESTS_PARAM_CONNECTION_MANAGER_H__ #define __TP_TESTS_PARAM_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsParamConnectionManager TpTestsParamConnectionManager; typedef struct _TpTestsParamConnectionManagerPrivate TpTestsParamConnectionManagerPrivate; typedef struct _TpTestsParamConnectionManagerClass TpTestsParamConnectionManagerClass; typedef struct _TpTestsParamConnectionManagerClassPrivate TpTestsParamConnectionManagerClassPrivate; struct _TpTestsParamConnectionManagerClass { TpBaseConnectionManagerClass parent_class; TpTestsParamConnectionManagerClassPrivate *priv; }; struct _TpTestsParamConnectionManager { TpBaseConnectionManager parent; TpTestsParamConnectionManagerPrivate *priv; }; GType tp_tests_param_connection_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER \ (tp_tests_param_connection_manager_get_type ()) #define TP_TESTS_PARAM_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER, \ TpTestsParamConnectionManager)) #define TP_TESTS_PARAM_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER, \ TpTestsParamConnectionManagerClass)) #define IS_PARAM_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER)) #define IS_PARAM_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER)) #define TP_TESTS_PARAM_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER, \ TpTestsParamConnectionManagerClass)) typedef struct { gchar *a_string; gint a_int16; gint a_int32; guint a_uint16; guint a_uint32; gint64 a_int64; guint64 a_uint64; gboolean a_boolean; gdouble a_double; GStrv a_array_of_strings; GArray *a_array_of_bytes; gchar *a_object_path; gchar *lc_string; gchar *uc_string; gboolean would_have_been_freed; } TpTestsCMParams; TpTestsCMParams * tp_tests_param_connection_manager_steal_params_last_conn ( void); void tp_tests_param_connection_manager_free_params (TpTestsCMParams *params); G_END_DECLS #endif /* #ifndef __TP_TESTS_PARAM_CONNECTION_MANAGER_H__ */ telepathy-glib-0.24.2/tests/lib/util.c0000644000175000017500000003307712652510705014500 00000000000000/* Simple utility code used by the regression tests. * * Copyright © 2008-2010 Collabora Ltd. * Copyright © 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "util.h" #include #include #include #ifdef G_OS_UNIX # include /* for alarm() */ #endif #ifdef HAVE_GIO_UNIX #include #include #endif void tp_tests_proxy_run_until_prepared (gpointer proxy, const GQuark *features) { GError *error = NULL; tp_tests_proxy_run_until_prepared_or_failed (proxy, features, &error); g_assert_no_error (error); } /* A GAsyncReadyCallback whose user_data is a GAsyncResult **. It writes a * reference to the result into that pointer. */ void tp_tests_result_ready_cb (GObject *object, GAsyncResult *res, gpointer user_data) { GAsyncResult **result = user_data; *result = g_object_ref (res); } /* Run until *result contains a result. Intended to be used with a pending * async call that uses tp_tests_result_ready_cb. */ void tp_tests_run_until_result (GAsyncResult **result) { /* not synchronous */ g_assert (*result == NULL); while (*result == NULL) g_main_context_iteration (NULL, TRUE); } gboolean tp_tests_proxy_run_until_prepared_or_failed (gpointer proxy, const GQuark *features, GError **error) { GAsyncResult *result = NULL; gboolean r; tp_proxy_prepare_async (proxy, features, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); r = tp_proxy_prepare_finish (proxy, result, error); g_object_unref (result); return r; } static GTestDBus *test_dbus = NULL; static void start_dbus_session (void) { g_assert (test_dbus == NULL); g_test_dbus_unset (); /* GLib 2.36 does not unset STARTER env variables but tp-glib are using them. * See https://bugzilla.gnome.org/show_bug.cgi?id=697348 */ g_unsetenv ("DBUS_STARTER_ADDRESS"); g_unsetenv ("DBUS_STARTER_BUS_TYPE"); test_dbus = g_test_dbus_new (G_TEST_DBUS_NONE); g_test_dbus_add_service_dir (test_dbus, g_getenv ("TP_TESTS_SERVICES_DIR")); g_test_dbus_up (test_dbus); } static void stop_dbus_session (void) { g_assert (test_dbus != NULL); g_test_dbus_down (test_dbus); g_clear_object (&test_dbus); } gint tp_tests_run_with_bus (void) { gint ret; if (test_dbus != NULL) return g_test_run (); start_dbus_session (); ret = g_test_run (); stop_dbus_session (); return ret; } TpDBusDaemon * tp_tests_dbus_daemon_dup_or_die (void) { TpDBusDaemon *d; if (test_dbus == NULL) { /* HACK: Some tests are not yet ported to GTest and thus are not using * tp_tests_run_with_bus(). In that case we make sure to start the dbus * session before aquiring the TpDBusDaemon and we stop the session when * the daemon is disposed. In a perfect world this should not be needed. */ start_dbus_session (); d = tp_dbus_daemon_dup (NULL); g_object_weak_ref ((GObject *) d, (GWeakNotify) stop_dbus_session, NULL); } else { d = tp_dbus_daemon_dup (NULL); } /* In a shared library, this would be very bad (see fd.o #18832), but in a * regression test that's going to be run under a temporary session bus, * it's just what we want. */ if (d == NULL) { g_error ("Unable to connect to session bus"); } return d; } static void introspect_cb (TpProxy *proxy G_GNUC_UNUSED, const gchar *xml G_GNUC_UNUSED, const GError *error G_GNUC_UNUSED, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { g_main_loop_quit (user_data); } void tp_tests_proxy_run_until_dbus_queue_processed (gpointer proxy) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); tp_cli_dbus_introspectable_call_introspect (proxy, -1, introspect_cb, loop, NULL, NULL); g_main_loop_run (loop); g_main_loop_unref (loop); } void _test_assert_empty_strv (const char *file, int line, gconstpointer strv) { const gchar * const *strings = strv; if (strv != NULL && strings[0] != NULL) { guint i; g_message ("%s:%d: expected empty strv, but got:", file, line); for (i = 0; strings[i] != NULL; i++) { g_message ("* \"%s\"", strings[i]); } g_error ("%s:%d: strv wasn't empty (see above for contents", file, line); } } void _tp_tests_assert_strv_equals (const char *file, int line, const char *expected_desc, gconstpointer expected_strv, const char *actual_desc, gconstpointer actual_strv) { const gchar * const *expected = expected_strv; const gchar * const *actual = actual_strv; guint i; g_assert (expected != NULL); g_assert (actual != NULL); for (i = 0; expected[i] != NULL || actual[i] != NULL; i++) { if (expected[i] == NULL) { g_error ("%s:%d: assertion failed: (%s)[%u] == (%s)[%u]: " "NULL == %s", file, line, expected_desc, i, actual_desc, i, actual[i]); } else if (actual[i] == NULL) { g_error ("%s:%d: assertion failed: (%s)[%u] == (%s)[%u]: " "%s == NULL", file, line, expected_desc, i, actual_desc, i, expected[i]); } else if (tp_strdiff (expected[i], actual[i])) { g_error ("%s:%d: assertion failed: (%s)[%u] == (%s)[%u]: " "%s == %s", file, line, expected_desc, i, actual_desc, i, expected[i], actual[i]); } } } void _tp_tests_assert_bytes_equal (const gchar *file, int line, GBytes *actual, gconstpointer expected_data, gsize expected_length) { if (expected_length != g_bytes_get_size (actual)) { g_error ("%s:%d: assertion failed: expected %"G_GSIZE_FORMAT " bytes, got %"G_GSIZE_FORMAT, file, line, expected_length, g_bytes_get_size (actual)); } else if (memcmp (g_bytes_get_data (actual, NULL), expected_data, expected_length) != 0) { g_error ( "%s:%d: assertion failed: expected data didn't match the actual data", file, line); } } void tp_tests_create_conn (GType conn_type, const gchar *account, gboolean connect, TpBaseConnection **service_conn, TpConnection **client_conn) { TpDBusDaemon *dbus; TpSimpleClientFactory *factory; gchar *name; gchar *conn_path; GError *error = NULL; g_assert (service_conn != NULL); g_assert (client_conn != NULL); dbus = tp_tests_dbus_daemon_dup_or_die (); factory = (TpSimpleClientFactory *) tp_automatic_client_factory_new (dbus); *service_conn = tp_tests_object_new_static_class ( conn_type, "account", account, "protocol", "simple", NULL); g_assert (*service_conn != NULL); g_assert (tp_base_connection_register (*service_conn, "simple", &name, &conn_path, &error)); g_assert_no_error (error); *client_conn = tp_simple_client_factory_ensure_connection (factory, conn_path, NULL, &error); g_assert (*client_conn != NULL); g_assert_no_error (error); if (connect) { GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; tp_cli_connection_call_connect (*client_conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (*client_conn, conn_features); } g_free (name); g_free (conn_path); g_object_unref (dbus); g_object_unref (factory); } void tp_tests_create_and_connect_conn (GType conn_type, const gchar *account, TpBaseConnection **service_conn, TpConnection **client_conn) { tp_tests_create_conn (conn_type, account, TRUE, service_conn, client_conn); } /* This object exists solely so that tests/tests.supp can ignore "leaked" * classes. */ gpointer tp_tests_object_new_static_class (GType type, ...) { va_list ap; GObject *object; const gchar *first_property; va_start (ap, type); first_property = va_arg (ap, const gchar *); object = g_object_new_valist (type, first_property, ap); va_end (ap); return object; } static gboolean time_out (gpointer nil G_GNUC_UNUSED) { g_error ("Timed out"); g_assert_not_reached (); return FALSE; } void tp_tests_abort_after (guint sec) { gboolean debugger = FALSE; gchar *contents; if (g_file_get_contents ("/proc/self/status", &contents, NULL, NULL)) { /* http://www.youtube.com/watch?v=SXmv8quf_xM */ #define TRACER_T "\nTracerPid:\t" gchar *line = strstr (contents, TRACER_T); if (line != NULL) { gchar *value = line + strlen (TRACER_T); if (value[0] != '0' || value[1] != '\n') debugger = TRUE; } g_free (contents); } if (g_getenv ("TP_TESTS_NO_TIMEOUT") != NULL || debugger) return; g_timeout_add_seconds (sec, time_out, NULL); #ifdef G_OS_UNIX /* On Unix, we can kill the process more reliably; this is a safety-catch * in case it deadlocks or something, in which case the main loop won't be * processed. The default handler for SIGALRM is process termination. */ alarm (sec + 2); #endif } void tp_tests_init (int *argc, char ***argv) { tp_tests_abort_after (10); tp_debug_set_flags ("all"); g_test_init (argc, argv, NULL); } void _tp_destroy_socket_control_list (gpointer data) { GArray *tab = data; g_array_unref (tab); } GValue * _tp_create_local_socket (TpSocketAddressType address_type, TpSocketAccessControl access_control, GSocketService **service, gchar **unix_address, gchar **unix_tmpdir, GError **error) { gboolean success; GSocketAddress *address, *effective_address; GValue *address_gvalue; g_assert (service != NULL); g_assert (unix_address != NULL); switch (access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: case TP_SOCKET_ACCESS_CONTROL_PORT: break; default: g_assert_not_reached (); } switch (address_type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: { GError *e = NULL; gchar *dir = g_dir_make_tmp ("tp-glib-tests.XXXXXX", &e); gchar *name; g_assert_no_error (e); name = g_build_filename (dir, "s", NULL); address = g_unix_socket_address_new (name); g_free (name); if (unix_tmpdir != NULL) *unix_tmpdir = dir; else g_free (dir); break; } #endif case TP_SOCKET_ADDRESS_TYPE_IPV4: case TP_SOCKET_ADDRESS_TYPE_IPV6: { GInetAddress *localhost; localhost = g_inet_address_new_loopback ( address_type == TP_SOCKET_ADDRESS_TYPE_IPV4 ? G_SOCKET_FAMILY_IPV4 : G_SOCKET_FAMILY_IPV6); address = g_inet_socket_address_new (localhost, 0); g_object_unref (localhost); break; } default: g_assert_not_reached (); } *service = g_socket_service_new (); success = g_socket_listener_add_address ( G_SOCKET_LISTENER (*service), address, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, NULL, &effective_address, NULL); g_assert (success); switch (address_type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: *unix_address = g_strdup (g_unix_socket_address_get_path ( G_UNIX_SOCKET_ADDRESS (effective_address))); address_gvalue = tp_g_value_slice_new_bytes ( g_unix_socket_address_get_path_len ( G_UNIX_SOCKET_ADDRESS (effective_address)), g_unix_socket_address_get_path ( G_UNIX_SOCKET_ADDRESS (effective_address))); break; #endif case TP_SOCKET_ADDRESS_TYPE_IPV4: case TP_SOCKET_ADDRESS_TYPE_IPV6: *unix_address = NULL; address_gvalue = tp_g_value_slice_new_take_boxed ( TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4, dbus_g_type_specialized_construct ( TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4)); dbus_g_type_struct_set (address_gvalue, 0, address_type == TP_SOCKET_ADDRESS_TYPE_IPV4 ? "127.0.0.1" : "::1", 1, g_inet_socket_address_get_port ( G_INET_SOCKET_ADDRESS (effective_address)), G_MAXUINT); break; default: g_assert_not_reached (); } g_object_unref (address); g_object_unref (effective_address); return address_gvalue; } void tp_tests_connection_assert_disconnect_succeeds (TpConnection *connection) { GAsyncResult *result = NULL; GError *error = NULL; gboolean ok; tp_connection_disconnect_async (connection, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); ok = tp_connection_disconnect_finish (connection, result, &error); g_assert_no_error (error); g_assert (ok); g_object_unref (result); } static void one_contact_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpConnection *connection = (TpConnection *) object; TpContact **contact_loc = user_data; GError *error = NULL; *contact_loc = tp_connection_dup_contact_by_id_finish (connection, result, &error); g_assert_no_error (error); g_assert (TP_IS_CONTACT (*contact_loc)); } TpContact * tp_tests_connection_run_until_contact_by_id (TpConnection *connection, const gchar *id, guint n_features, const TpContactFeature *features) { TpContact *contact = NULL; tp_connection_dup_contact_by_id_async (connection, id, n_features, features, one_contact_cb, &contact); while (contact == NULL) g_main_context_iteration (NULL, TRUE); return contact; } telepathy-glib-0.24.2/tests/lib/util.h0000644000175000017500000000545012652510705014477 00000000000000/* Simple utility code used by the regression tests. * * Copyright © 2008-2010 Collabora Ltd. * Copyright © 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_LIB_UTIL_H__ #define __TP_TESTS_LIB_UTIL_H__ #include gint tp_tests_run_with_bus (void); TpDBusDaemon *tp_tests_dbus_daemon_dup_or_die (void); void tp_tests_proxy_run_until_dbus_queue_processed (gpointer proxy); void tp_tests_proxy_run_until_prepared (gpointer proxy, const GQuark *features); gboolean tp_tests_proxy_run_until_prepared_or_failed (gpointer proxy, const GQuark *features, GError **error); #define test_assert_empty_strv(strv) \ _test_assert_empty_strv (__FILE__, __LINE__, strv) void _test_assert_empty_strv (const char *file, int line, gconstpointer strv); #define tp_tests_assert_strv_equals(actual, expected) \ _tp_tests_assert_strv_equals (__FILE__, __LINE__, \ #actual, actual, \ #expected, expected) void _tp_tests_assert_strv_equals (const char *file, int line, const char *actual_desc, gconstpointer actual_strv, const char *expected_desc, gconstpointer expected_strv); #define tp_tests_assert_bytes_equals(actual, expected, expected_length) \ _tp_tests_assert_bytes_equal (__FILE__, __LINE__, \ actual, expected, expected_length) void _tp_tests_assert_bytes_equal (const gchar *file, int line, GBytes *actual, gconstpointer expected_data, gsize expected_length); void tp_tests_create_conn (GType conn_type, const gchar *account, gboolean connect, TpBaseConnection **service_conn, TpConnection **client_conn); void tp_tests_create_and_connect_conn (GType conn_type, const gchar *account, TpBaseConnection **service_conn, TpConnection **client_conn); gpointer tp_tests_object_new_static_class (GType type, ...) G_GNUC_NULL_TERMINATED; void tp_tests_run_until_result (GAsyncResult **result); void tp_tests_result_ready_cb (GObject *object, GAsyncResult *res, gpointer user_data); void tp_tests_abort_after (guint sec); void tp_tests_init (int *argc, char ***argv); GValue *_tp_create_local_socket (TpSocketAddressType address_type, TpSocketAccessControl access_control, GSocketService **service, gchar **unix_address, gchar **unix_tmpdir, GError **error); void _tp_destroy_socket_control_list (gpointer data); void tp_tests_connection_assert_disconnect_succeeds (TpConnection *connection); TpContact *tp_tests_connection_run_until_contact_by_id ( TpConnection *connection, const gchar *id, guint n_features, const TpContactFeature *features); #endif /* #ifndef __TP_TESTS_LIB_UTIL_H__ */ telepathy-glib-0.24.2/tests/lib/echo-channel-manager-conn.c0000644000175000017500000000572612652510705020412 00000000000000/* * echo-channel-manager-conn.c * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "echo-channel-manager-conn.h" #include "simple-channel-manager.h" G_DEFINE_TYPE (TpTestsEchoChannelManagerConnection, tp_tests_echo_channel_manager_connection, TP_TESTS_TYPE_ECHO_CONNECTION) /* type definition stuff */ enum { PROP_CHANNEL_MANAGER = 1, N_PROPS }; struct _TpTestsEchoChannelManagerConnectionPrivate { TpTestsSimpleChannelManager *channel_manager; }; static void tp_tests_echo_channel_manager_connection_init (TpTestsEchoChannelManagerConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION, TpTestsEchoChannelManagerConnectionPrivate); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsEchoChannelManagerConnection *self = TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION (object); switch (property_id) { case PROP_CHANNEL_MANAGER: g_value_set_object (value, self->priv->channel_manager); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsEchoChannelManagerConnection *self = TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION (object); switch (property_id) { case PROP_CHANNEL_MANAGER: self->priv->channel_manager = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { TpTestsEchoChannelManagerConnection *self = TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION (conn); GPtrArray *ret = g_ptr_array_sized_new (1); /* tp-glib will free this for us so we don't need to worry about doing it ourselves. */ g_ptr_array_add (ret, self->priv->channel_manager); return ret; } static void tp_tests_echo_channel_manager_connection_class_init (TpTestsEchoChannelManagerConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->get_property = get_property; object_class->set_property = set_property; g_type_class_add_private (klass, sizeof (TpTestsEchoChannelManagerConnectionPrivate)); base_class->create_channel_managers = create_channel_managers; param_spec = g_param_spec_object ("channel-manager", "Channel manager", "The channel manager", TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_MANAGER, param_spec); } telepathy-glib-0.24.2/tests/lib/echo-channel-manager-conn.h0000644000175000017500000000417312652510705020412 00000000000000/* * echo-channel-manager-conn.h - header for an example conn * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION_H__ #define __TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION_H__ #include "echo-conn.h" G_BEGIN_DECLS typedef struct _TpTestsEchoChannelManagerConnection TpTestsEchoChannelManagerConnection; typedef struct _TpTestsEchoChannelManagerConnectionClass TpTestsEchoChannelManagerConnectionClass; typedef struct _TpTestsEchoChannelManagerConnectionPrivate TpTestsEchoChannelManagerConnectionPrivate; struct _TpTestsEchoChannelManagerConnectionClass { TpTestsEchoConnectionClass parent_class; }; struct _TpTestsEchoChannelManagerConnection { TpTestsEchoConnection parent; TpTestsEchoChannelManagerConnectionPrivate *priv; }; GType tp_tests_echo_channel_manager_connection_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION \ (tp_tests_echo_channel_manager_connection_get_type ()) #define TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION, \ TpTestsEchoChannelManagerConnection)) #define TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION, \ TpTestsEchoChannelManagerConnectionClass)) #define TP_TESTS_IS_ECHO_CHANNEL_MANAGER_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION)) #define TP_TESTS_IS_ECHO_CHANNEL_MANAGER_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION)) #define TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION, \ TpTestsEchoChannelManagerConnectionClass)) G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/file-transfer-chan.c0000644000175000017500000005364712652510705017200 00000000000000/* * file-transfer-chan.c - Simple file transfer channel * * Copyright (C) 2010-2011 Morten Mjelva * Copyright (C) 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "file-transfer-chan.h" #include "util.h" #include "debug.h" #include #include static void file_transfer_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TpTestsFileTransferChannel, tp_tests_file_transfer_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_FILE_TRANSFER, file_transfer_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, NULL); ) enum /* properties */ { PROP_AVAILABLE_SOCKET_TYPES = 1, PROP_CONTENT_TYPE, PROP_CONTENT_HASH, PROP_CONTENT_HASH_TYPE, PROP_DATE, PROP_DESCRIPTION, PROP_FILENAME, PROP_INITIAL_OFFSET, PROP_SIZE, PROP_STATE, PROP_TRANSFERRED_BYTES, PROP_URI, PROP_SERVICE_NAME, PROP_METADATA, N_PROPS, }; struct _TpTestsFileTransferChannelPrivate { /* Exposed properties */ gchar *content_type; guint64 date; gchar *description; gchar *filename; guint64 size; TpFileTransferState state; guint64 transferred_bytes; gchar *uri; gchar *service_name; GHashTable *metadata; /* Hidden properties */ TpFileHashType content_hash_type; gchar *content_hash; GHashTable *available_socket_types; gint64 initial_offset; /* Accepting side */ GSocketService *service; GValue *access_control_param; /* Offering side */ TpSocketAddressType address_type; GValue *address; gchar *unix_address; gchar *unix_tmpdir; guint connection_id; TpSocketAccessControl access_control; guint timer_id; }; static void tp_tests_file_transfer_channel_init (TpTestsFileTransferChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, TpTestsFileTransferChannelPrivate); } static void create_available_socket_types (TpTestsFileTransferChannel *self) { TpSocketAccessControl access_control; GArray *unix_tab; g_assert (self->priv->available_socket_types == NULL); self->priv->available_socket_types = g_hash_table_new_full (NULL, NULL, NULL, _tp_destroy_socket_control_list); /* SocketAddressTypeUnix */ unix_tab = g_array_sized_new (FALSE, FALSE, sizeof (TpSocketAccessControl), 1); access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST; g_array_append_val (unix_tab, access_control); g_hash_table_insert (self->priv->available_socket_types, GUINT_TO_POINTER (TP_SOCKET_ADDRESS_TYPE_UNIX), unix_tab); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_file_transfer_channel_parent_class)->constructor (type, n_props, props); TpTestsFileTransferChannel *self = TP_TESTS_FILE_TRANSFER_CHANNEL (object); self->priv->state = TP_FILE_TRANSFER_STATE_PENDING; if (self->priv->available_socket_types == NULL) create_available_socket_types (self); tp_base_channel_register (TP_BASE_CHANNEL (self)); return object; } static void dispose (GObject *object) { TpTestsFileTransferChannel *self = TP_TESTS_FILE_TRANSFER_CHANNEL (object); if (self->priv->timer_id != 0) { g_source_remove (self->priv->timer_id); self->priv->timer_id = 0; } g_free (self->priv->content_hash); g_free (self->priv->content_type); g_free (self->priv->description); g_free (self->priv->filename); g_free (self->priv->uri); g_free (self->priv->service_name); tp_clear_pointer (&self->priv->address, tp_g_value_slice_free); tp_clear_pointer (&self->priv->available_socket_types, g_hash_table_unref); tp_clear_pointer (&self->priv->access_control_param, tp_g_value_slice_free); tp_clear_pointer (&self->priv->metadata, g_hash_table_unref); if (self->priv->unix_address != NULL) g_unlink (self->priv->unix_address); tp_clear_pointer (&self->priv->unix_address, g_free); if (self->priv->unix_tmpdir != NULL) g_rmdir (self->priv->unix_tmpdir); tp_clear_pointer (&self->priv->unix_tmpdir, g_free); ((GObjectClass *) tp_tests_file_transfer_channel_parent_class)->dispose ( object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsFileTransferChannel *self = (TpTestsFileTransferChannel *) object; switch (property_id) { case PROP_AVAILABLE_SOCKET_TYPES: g_value_set_boxed (value, self->priv->available_socket_types); break; case PROP_CONTENT_HASH: g_value_set_string (value, self->priv->content_hash); case PROP_CONTENT_HASH_TYPE: g_value_set_uint (value, self->priv->content_hash_type); break; case PROP_CONTENT_TYPE: g_value_set_string (value, self->priv->content_type); break; case PROP_DATE: g_value_set_uint64 (value, self->priv->date); break; case PROP_DESCRIPTION: g_value_set_string (value, self->priv->description); break; case PROP_FILENAME: g_value_set_string (value, self->priv->filename); break; case PROP_INITIAL_OFFSET: g_value_set_uint64 (value, self->priv->initial_offset); break; case PROP_SIZE: g_value_set_uint64 (value, self->priv->size); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; case PROP_TRANSFERRED_BYTES: g_value_set_uint64 (value, self->priv->transferred_bytes); break; case PROP_URI: g_value_set_string (value, self->priv->uri); break; case PROP_SERVICE_NAME: g_value_set_string (value, self->priv->service_name); break; case PROP_METADATA: g_value_set_boxed (value, self->priv->metadata); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsFileTransferChannel *self = (TpTestsFileTransferChannel *) object; switch (property_id) { case PROP_AVAILABLE_SOCKET_TYPES: self->priv->available_socket_types = g_value_dup_boxed (value); break; case PROP_CONTENT_HASH: self->priv->content_hash = g_value_dup_string (value); break; case PROP_CONTENT_HASH_TYPE: break; case PROP_CONTENT_TYPE: self->priv->content_type = g_value_dup_string (value); break; case PROP_DATE: self->priv->date = g_value_get_uint64 (value); break; case PROP_DESCRIPTION: self->priv->description = g_value_dup_string (value); break; case PROP_FILENAME: self->priv->filename = g_value_dup_string (value); break; case PROP_INITIAL_OFFSET: self->priv->initial_offset = g_value_get_uint64 (value); break; case PROP_SIZE: self->priv->size = g_value_get_uint64 (value); break; case PROP_STATE: self->priv->state = g_value_get_uint (value); break; case PROP_TRANSFERRED_BYTES: self->priv->transferred_bytes = g_value_get_uint64 (value); break; case PROP_URI: self->priv->uri = g_value_dup_string (value); break; case PROP_SERVICE_NAME: self->priv->service_name = g_value_dup_string (value); break; case PROP_METADATA: self->priv->metadata = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void channel_close (TpBaseChannel *self) { g_print ("entered channel_close"); tp_base_channel_destroyed (self); } static void fill_immutable_properties (TpBaseChannel *self, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_file_transfer_channel_parent_class); klass->fill_immutable_properties (self, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (self), properties, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "AvailableSocketTypes", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "ContentType", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Filename", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Size", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Description", TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "Date", TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "ServiceName", TP_IFACE_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, "Metadata", NULL); /* URI is immutable only for outgoing transfers */ if (tp_base_channel_is_requested (self)) { tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (self), properties, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "URI", NULL); } } static void change_state (TpTestsFileTransferChannel *self, TpFileTransferState state, TpFileTransferStateChangeReason reason) { self->priv->state = state; tp_svc_channel_type_file_transfer_emit_file_transfer_state_changed (self, state, reason); } /* This function imitates the beginning of a filetransfer. It sets the state * to open, and connects to the "incoming" signal of the GSocketService. */ static gboolean start_file_transfer (gpointer data) { TpTestsFileTransferChannel *self = (TpTestsFileTransferChannel *) data; DEBUG ("Setting TP_FILE_TRANSFER_STATE_OPEN"); change_state (self, TP_FILE_TRANSFER_STATE_OPEN, TP_FILE_TRANSFER_STATE_CHANGE_REASON_REQUESTED); g_object_notify ((GObject *) data, "state"); DEBUG ("Fired state signal"); // g_signal_connect (self->priv->service, "incoming", G_CALLBACK // (incoming_file_transfer_cb)); self->priv->timer_id = 0; return FALSE; } static gboolean check_address_type (TpTestsFileTransferChannel *self, TpSocketAddressType address_type, TpSocketAccessControl access_control) { GArray *arr; guint i; arr = g_hash_table_lookup (self->priv->available_socket_types, GUINT_TO_POINTER (address_type)); if (arr == NULL) return FALSE; for (i = 0; i < arr->len; i++) { if (g_array_index (arr, TpSocketAccessControl, i) == access_control) return TRUE; } return FALSE; } static void service_incoming_cb (GSocketService *service, GSocketConnection *connection, GObject *source_object, gpointer user_data) { TpTestsFileTransferChannel *self = user_data; GError *error = NULL; DEBUG ("Servicing incoming connection"); if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { GCredentials *creds; guchar byte; /* TODO: Async version */ creds = tp_unix_connection_receive_credentials_with_byte ( connection, &byte, NULL, &error); g_assert_no_error (error); g_assert_cmpuint (byte, ==, g_value_get_uchar (self->priv->access_control_param)); g_object_unref (creds); } else if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_PORT) { GSocketAddress *addr; guint16 port; addr = g_socket_connection_get_remote_address (connection, &error); g_assert_no_error (error); port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); g_assert_cmpuint (port, ==, g_value_get_uint (self->priv->access_control_param)); g_object_unref (addr); } } static void file_transfer_provide_file (TpSvcChannelTypeFileTransfer *iface, TpSocketAddressType address_type, TpSocketAccessControl access_control, const GValue *access_control_param, DBusGMethodInvocation *context) { TpTestsFileTransferChannel *self = (TpTestsFileTransferChannel *) iface; TpBaseChannel *base_chan = (TpBaseChannel *) iface; GError *error = NULL; if (tp_base_channel_is_requested (base_chan) != TRUE) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "File transfer is not outgoing. Cannot offer file"); goto fail; } if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING && self->priv->state != TP_FILE_TRANSFER_STATE_ACCEPTED) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "File transfer is not pending or accepted. Cannot offer file"); goto fail; } if (self->priv->address != NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "ProvideFile has already been called for this channel"); goto fail; } if (!check_address_type (self, address_type, access_control)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Address type %i is not supported with access control %i", address_type, access_control); goto fail; } self->priv->address = _tp_create_local_socket (address_type, access_control, &self->priv->service, &self->priv->unix_address, &self->priv->unix_tmpdir, &error); if (self->priv->address == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Could not set up local socket"); goto fail; } self->priv->address_type = address_type; self->priv->access_control = access_control; DEBUG ("Waiting 500ms and setting state to OPEN"); self->priv->timer_id = g_timeout_add (500, start_file_transfer, self); // connect to self->priv->service incoming signal // when the signal returns, add x bytes per n seconds using timeout // then close the socket // g_output_stream_write_async tp_svc_channel_type_file_transfer_return_from_provide_file (context, self->priv->address); return; fail: dbus_g_method_return_error (context, error); g_error_free (error); } static void file_transfer_accept_file (TpSvcChannelTypeFileTransfer *iface, TpSocketAddressType address_type, TpSocketAccessControl access_control, const GValue *access_control_param, guint64 offset, DBusGMethodInvocation *context) { TpTestsFileTransferChannel *self = (TpTestsFileTransferChannel *) iface; TpBaseChannel *base_chan = (TpBaseChannel *) iface; GError *error = NULL; GValue *address; if (tp_base_channel_is_requested (base_chan) == TRUE) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "File transfer is not incoming. Cannot accept file"); goto fail; } if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "File transfer is not in the pending state"); goto fail; } if (!check_address_type (self, address_type, access_control)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Address type %i is not supported with access control %i", address_type, access_control); goto fail; } address = _tp_create_local_socket (address_type, access_control, &self->priv->service, &self->priv->unix_address, &self->priv->unix_tmpdir, &error); tp_g_signal_connect_object (self->priv->service, "incoming", G_CALLBACK (service_incoming_cb), self, 0); self->priv->access_control = access_control; self->priv->access_control_param = tp_g_value_slice_dup ( access_control_param); DEBUG ("Setting TP_FILE_TRANSFER_STATE_ACCEPTED"); change_state (self, TP_FILE_TRANSFER_STATE_ACCEPTED, TP_FILE_TRANSFER_STATE_CHANGE_REASON_REQUESTED); DEBUG ("Waiting 500ms and setting state to OPEN"); self->priv->timer_id = g_timeout_add (500, start_file_transfer, self); tp_svc_channel_type_file_transfer_return_from_accept_file (context, address); tp_clear_pointer (&address, tp_g_value_slice_free); return; fail: dbus_g_method_return_error (context, error); g_error_free (error); } static void tp_tests_file_transfer_channel_class_init ( TpTestsFileTransferChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl file_transfer_props[] = { { "AvailableSocketTypes", "available-socket-types", NULL }, { "ContentType", "content-type", NULL }, { "Date", "date", NULL }, { "Description", "description", NULL }, { "Filename", "filename", NULL }, { "Size", "size", NULL }, { "State", "state", NULL }, { "TransferredBytes", "transferred-bytes", NULL }, { "URI", "uri", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl metadata_props[] = { { "ServiceName", "service-name", NULL }, { "Metadata", "metadata", NULL }, { NULL } }; object_class->constructor = constructor; object_class->get_property = get_property; object_class->set_property = set_property; object_class->dispose = dispose; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->close = channel_close; base_class->fill_immutable_properties = fill_immutable_properties; param_spec = g_param_spec_boxed ("available-socket-types", "AvailableSocketTypes", "The AvailableSocketTypes property of this channel", TP_HASH_TYPE_SUPPORTED_SOCKET_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVAILABLE_SOCKET_TYPES, param_spec); param_spec = g_param_spec_string ("content-type", "ContentType", "The ContentType property of this channel", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTENT_TYPE, param_spec); param_spec = g_param_spec_uint64 ("date", "Date", "The Date property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DATE, param_spec); param_spec = g_param_spec_string ("description", "Description", "The Description property of this channel", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec); param_spec = g_param_spec_string ("filename", "Filename", "The Filename property of this channel", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FILENAME, param_spec); param_spec = g_param_spec_uint64 ("initial-offset", "InitialOffset", "The InitialOffset property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_OFFSET, param_spec); param_spec = g_param_spec_uint64 ("size", "Size", "The Size property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIZE, param_spec); param_spec = g_param_spec_uint ("state", "State", "The State property of this channel", 0, TP_NUM_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); param_spec = g_param_spec_uint64 ("transferred-bytes", "TransferredBytes", "The TransferredBytes property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TRANSFERRED_BYTES, param_spec); param_spec = g_param_spec_string ("uri", "URI", "The URI property of this channel", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_URI, param_spec); param_spec = g_param_spec_string ("service-name", "ServiceName", "The Metadata.ServiceName property of this channel", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE_NAME, param_spec); param_spec = g_param_spec_boxed ("metadata", "Metadata", "The Metadata.Metadata property of this channel", TP_HASH_TYPE_METADATA, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_METADATA, param_spec); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER, tp_dbus_properties_mixin_getter_gobject_properties, NULL, file_transfer_props); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA, tp_dbus_properties_mixin_getter_gobject_properties, NULL, metadata_props); g_type_class_add_private (object_class, sizeof (TpTestsFileTransferChannelPrivate)); } static void file_transfer_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeFileTransferClass *klass = iface; #define IMPLEMENT(x) tp_svc_channel_type_file_transfer_implement_##x (klass, \ file_transfer_##x) IMPLEMENT(accept_file); IMPLEMENT(provide_file); #undef IMPLEMENT } /* Return the address of the file transfer's socket */ GSocketAddress * tp_tests_file_transfer_channel_get_server_address ( TpTestsFileTransferChannel *self) { GSocketAddress *address; GError *error = NULL; g_assert (self->priv->address != NULL); address = tp_g_socket_address_from_variant (self->priv->address_type, self->priv->address, &error); if (error != NULL) { g_printf ("%s\n", error->message); } return address; } telepathy-glib-0.24.2/tests/lib/file-transfer-chan.h0000644000175000017500000000442312652510705017171 00000000000000/* * stream-tube-chan.h - Simple stream tube channel * * Copyright (C) 2010-2011 Morten Mjelva * Copyright (C) 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_FILE_TRANSFER_CHAN_H__ #define __TP_FILE_TRANSFER_CHAN_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsFileTransferChannel TpTestsFileTransferChannel; typedef struct _TpTestsFileTransferChannelClass TpTestsFileTransferChannelClass; typedef struct _TpTestsFileTransferChannelPrivate TpTestsFileTransferChannelPrivate; GType tp_tests_file_transfer_channel_get_type (void); #define TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL \ (tp_tests_file_transfer_channel_get_type ()) #define TP_TESTS_FILE_TRANSFER_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, \ TpTestsFileTransferChannel)) #define TP_TESTS_FILE_TRANSFER_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, \ TpTestsFileTransferChannelClass)) #define TP_TESTS_IS_FILE_TRANSFER_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL)) #define TP_TESTS_IS_FILE_TRANSFER_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL)) #define TP_TESTS_FILE_TRANSFER_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, \ TpTestsFileTransferChannelClass)) struct _TpTestsFileTransferChannelClass { TpBaseChannelClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsFileTransferChannel { TpBaseChannel parent; TpTestsFileTransferChannelPrivate *priv; }; void tp_tests_file_transfer_channel_close (TpTestsFileTransferChannel *self); GHashTable * tp_tests_file_transfer_channel_get_props ( TpTestsFileTransferChannel *self); GSocketAddress * tp_tests_file_transfer_channel_get_server_address ( TpTestsFileTransferChannel *self); G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/textchan-group.c0000644000175000017500000002624312652510705016470 00000000000000/* * a stub anonymous MUC * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "textchan-group.h" #include #include /* This is for text-mixin unit tests, others should be using ExampleEcho2Channel * which uses newer TpMessageMixin */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void text_iface_init (gpointer iface, gpointer data); static void password_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TpTestsTextChannelGroup, tp_tests_text_channel_group, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, text_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_group_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_PASSWORD, password_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init)) static GPtrArray * text_channel_group_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( tp_tests_text_channel_group_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_PASSWORD); return interfaces; }; /* type definition stuff */ enum { PROP_DETAILED = 1, PROP_PROPERTIES, N_PROPS }; struct _TpTestsTextChannelGroupPrivate { gboolean detailed; gboolean properties; gboolean closed; gboolean disposed; gchar *password; }; static gboolean add_member (GObject *obj, TpHandle handle, const gchar *message, GError **error) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (obj); TpIntset *add = tp_intset_new (); tp_intset_add (add, handle); tp_group_mixin_change_members (obj, message, add, NULL, NULL, NULL, tp_base_connection_get_self_handle (self->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (add); return TRUE; } static gboolean remove_with_reason (GObject *obj, TpHandle handle, const gchar *message, guint reason, GError **error) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (obj); TpGroupMixin *group = TP_GROUP_MIXIN (self); tp_clear_pointer (&self->removed_message, g_free); self->removed_handle = handle; self->removed_message = g_strdup (message); self->removed_reason = reason; if (handle == group->self_handle) { /* User wants to leave */ if (!self->priv->closed) { self->priv->closed = TRUE; tp_svc_channel_emit_closed (self); } return TRUE; } return TRUE; } static void tp_tests_text_channel_group_init (TpTestsTextChannelGroup *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, TpTestsTextChannelGroupPrivate); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_text_channel_group_parent_class)->constructor (type, n_props, props); TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (object); TpHandleRepoIface *contact_repo; TpChannelGroupFlags flags = 0; TpBaseChannel *base = TP_BASE_CHANNEL (self); self->conn = tp_base_channel_get_connection (base); contact_repo = tp_base_connection_get_handles (self->conn, TP_HANDLE_TYPE_CONTACT); tp_base_channel_register (base); tp_text_mixin_init (object, G_STRUCT_OFFSET (TpTestsTextChannelGroup, text), contact_repo); tp_text_mixin_set_message_types (object, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, G_MAXUINT); if (self->priv->properties) flags |= TP_CHANNEL_GROUP_FLAG_PROPERTIES; flags |= TP_CHANNEL_GROUP_FLAG_CAN_ADD; tp_group_mixin_init (object, G_STRUCT_OFFSET (TpTestsTextChannelGroup, group), contact_repo, tp_base_connection_get_self_handle (self->conn)); if (!self->priv->detailed) { /* TpGroupMixin always set the Members_Changed_Detailed flag so we have * to cheat and manually remove it to pretend we don't implement it. */ TpGroupMixin *group = TP_GROUP_MIXIN (self); group->group_flags &= ~TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED; } tp_group_mixin_change_flags (object, flags, 0); return object; } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (object); switch (property_id) { case PROP_DETAILED: g_value_set_boolean (value, self->priv->detailed); break; case PROP_PROPERTIES: g_value_set_boolean (value, self->priv->properties); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (object); switch (property_id) { case PROP_DETAILED: self->priv->detailed = g_value_get_boolean (value); break; case PROP_PROPERTIES: self->priv->properties = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void dispose (GObject *object) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (object); if (self->priv->disposed) return; self->priv->disposed = TRUE; if (!self->priv->closed) { tp_svc_channel_emit_closed (self); } ((GObjectClass *) tp_tests_text_channel_group_parent_class)->dispose (object); } static void finalize (GObject *object) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (object); tp_text_mixin_finalize (object); tp_group_mixin_finalize (object); tp_clear_pointer (&self->priv->password, g_free); ((GObjectClass *) tp_tests_text_channel_group_parent_class)->finalize (object); } static void channel_close (TpBaseChannel *base) { TpTestsTextChannelGroup *self = TP_TESTS_TEXT_CHANNEL_GROUP (base); if (!self->priv->closed) { self->priv->closed = TRUE; tp_svc_channel_emit_closed (self); } } static void tp_tests_text_channel_group_class_init (TpTestsTextChannelGroupClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; TpBaseChannelClass *base_class = (TpBaseChannelClass *) klass; g_type_class_add_private (klass, sizeof (TpTestsTextChannelGroupPrivate)); object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; object_class->dispose = dispose; object_class->finalize = finalize; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_NONE; base_class->get_interfaces = text_channel_group_get_interfaces; base_class->close = channel_close; param_spec = g_param_spec_boolean ("detailed", "Has the Members_Changed_Detailed flag?", "True if the Members_Changed_Detailed group flag should be set", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DETAILED, param_spec); param_spec = g_param_spec_boolean ("properties", "Has the Properties flag?", "True if the Properties group flag should be set", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PROPERTIES, param_spec); tp_text_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsTextChannelGroupClass, text_class)); tp_group_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsTextChannelGroupClass, group_class), add_member, NULL); tp_group_mixin_class_set_remove_with_reason_func (object_class, remove_with_reason); tp_group_mixin_class_allow_self_removal (object_class); tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsTextChannelGroupClass, dbus_properties_class)); tp_group_mixin_init_dbus_properties (object_class); } static void text_send (TpSvcChannelTypeText *iface, guint type, const gchar *text, DBusGMethodInvocation *context) { /* silently swallow the message */ tp_svc_channel_type_text_return_from_send (context); } static void text_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeTextClass *klass = iface; tp_text_mixin_iface_init (iface, data); #define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (klass, text_##x) IMPLEMENT (send); #undef IMPLEMENT } void tp_tests_text_channel_group_join (TpTestsTextChannelGroup *self) { TpIntset *add, *empty; /* Add ourself as a member */ add = tp_intset_new_containing ( tp_base_connection_get_self_handle (self->conn)); empty = tp_intset_new (); tp_group_mixin_change_members ((GObject *) self, NULL, add, empty, empty, empty, 0, 0); tp_intset_destroy (add); tp_intset_destroy (empty); } void tp_tests_text_channel_set_password (TpTestsTextChannelGroup *self, const gchar *password) { gboolean pass_was_needed, pass_needed; pass_was_needed = (self->priv->password != NULL); tp_clear_pointer (&self->priv->password, g_free); self->priv->password = g_strdup (password); pass_needed = (self->priv->password != NULL); if (pass_needed == pass_was_needed) return; if (pass_needed) tp_svc_channel_interface_password_emit_password_flags_changed (self, TP_CHANNEL_PASSWORD_FLAG_PROVIDE, 0); else tp_svc_channel_interface_password_emit_password_flags_changed (self, 0, TP_CHANNEL_PASSWORD_FLAG_PROVIDE); } static void password_get_password_flags (TpSvcChannelInterfacePassword *chan, DBusGMethodInvocation *context) { TpTestsTextChannelGroup *self = (TpTestsTextChannelGroup *) chan; TpChannelPasswordFlags flags = 0; if (self->priv->password != NULL) flags |= TP_CHANNEL_PASSWORD_FLAG_PROVIDE; tp_svc_channel_interface_password_return_from_get_password_flags (context, flags); } static void password_provide_password (TpSvcChannelInterfacePassword *chan, const gchar *password, DBusGMethodInvocation *context) { TpTestsTextChannelGroup *self = (TpTestsTextChannelGroup *) chan; tp_svc_channel_interface_password_return_from_provide_password (context, !tp_strdiff (password, self->priv->password)); } static void password_iface_init (gpointer iface, gpointer data) { TpSvcChannelInterfacePasswordClass *klass = iface; #define IMPLEMENT(x) tp_svc_channel_interface_password_implement_##x (klass, password_##x) IMPLEMENT (get_password_flags); IMPLEMENT (provide_password); #undef IMPLEMENT } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/tests/lib/textchan-group.h0000644000175000017500000000446712652510705016501 00000000000000/* * a stub anonymous MUC * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TEST_TEXT_CHANNEL_GROUP_H__ #define __TEST_TEXT_CHANNEL_GROUP_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsTextChannelGroup TpTestsTextChannelGroup; typedef struct _TpTestsTextChannelGroupClass TpTestsTextChannelGroupClass; typedef struct _TpTestsTextChannelGroupPrivate TpTestsTextChannelGroupPrivate; GType tp_tests_text_channel_group_get_type (void); #define TP_TESTS_TYPE_TEXT_CHANNEL_GROUP \ (tp_tests_text_channel_group_get_type ()) #define TP_TESTS_TEXT_CHANNEL_GROUP(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, \ TpTestsTextChannelGroup)) #define TP_TESTS_TEXT_CHANNEL_GROUP_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, \ TpTestsTextChannelGroupClass)) #define TEST_IS_TEXT_CHANNEL_GROUP(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_GROUP)) #define TEST_IS_TEXT_CHANNEL_GROUP_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_TEXT_CHANNEL_GROUP)) #define TP_TESTS_TEXT_CHANNEL_GROUP_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, \ TpTestsTextChannelGroupClass)) struct _TpTestsTextChannelGroupClass { TpBaseChannelClass parent_class; TpTextMixinClass text_class; TpGroupMixinClass group_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsTextChannelGroup { TpBaseChannel parent; TpBaseConnection *conn; TpTextMixin text; TpGroupMixin group; TpHandle removed_handle; gchar *removed_message; TpChannelGroupChangeReason removed_reason; TpTestsTextChannelGroupPrivate *priv; }; void tp_tests_text_channel_group_join (TpTestsTextChannelGroup *self); void tp_tests_text_channel_set_password (TpTestsTextChannelGroup *self, const gchar *password); G_END_DECLS #endif /* #ifndef __TEST_TEXT_CHANNEL_GROUP_H__ */ telepathy-glib-0.24.2/tests/lib/stub-object.c0000644000175000017500000000252612652510705015737 00000000000000#include "config.h" #include "stub-object.h" G_DEFINE_TYPE (TpTestsStubObject, tp_tests_stub_object, G_TYPE_OBJECT) enum { PROP_0, PROP_NAME, N_PROPS }; static void stub_object_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *param_spec) { switch (prop_id) { case PROP_NAME: g_value_set_string (value, "Bruce"); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; } } static void stub_object_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *param_spec) { switch (prop_id) { case PROP_NAME: /* do nothing */ break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, param_spec); break; } } static void tp_tests_stub_object_class_init (TpTestsStubObjectClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; object_class->get_property = stub_object_get_property; object_class->set_property = stub_object_set_property; g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "Name", "The name of the stub object", "Bruce", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE)); } static void tp_tests_stub_object_init (TpTestsStubObject *self) { } telepathy-glib-0.24.2/tests/lib/stub-object.h0000644000175000017500000000045312652510705015741 00000000000000#ifndef __TP_TESTS_STUB_OBJECT_H__ #define __TP_TESTS_STUB_OBJECT_H__ #include typedef struct { GObject p; } TpTestsStubObject; typedef struct { GObjectClass p; } TpTestsStubObjectClass; GType tp_tests_stub_object_get_type (void); #endif /* #ifndef __TP_TESTS_STUB_OBJECT_H__ */ telepathy-glib-0.24.2/tests/lib/simple-client.c0000644000175000017500000001475012652510705016265 00000000000000/* * simple-client.c - a simple client * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-client.h" #include #include #include #include #include "tests/lib/util.h" G_DEFINE_TYPE (TpTestsSimpleClient, tp_tests_simple_client, TP_TYPE_BASE_CLIENT) static void simple_observe_channels ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context) { TpTestsSimpleClient *self = TP_TESTS_SIMPLE_CLIENT (client); GHashTable *info; gboolean fail; GList *l; /* Fail if caller set the fake "FAIL" info */ g_object_get (context, "observer-info", &info, NULL); fail = tp_asv_get_boolean (info, "FAIL", NULL); g_hash_table_unref (info); if (self->observe_ctx != NULL) { g_object_unref (self->observe_ctx); self->observe_ctx = NULL; } if (fail) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No observation for you!" }; tp_observe_channels_context_fail (context, &error); return; } g_assert (TP_IS_ACCOUNT (account)); g_assert (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)); g_assert (TP_IS_CONNECTION (connection)); g_assert (tp_proxy_is_prepared (connection, TP_CONNECTION_FEATURE_CORE)); g_assert_cmpuint (g_list_length (channels), >, 0); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_assert (TP_IS_CHANNEL (channel)); g_assert (tp_proxy_is_prepared (channel, TP_CHANNEL_FEATURE_CORE) || tp_proxy_get_invalidated (channel) != NULL); } if (dispatch_operation != NULL) g_assert (TP_IS_CHANNEL_DISPATCH_OPERATION (dispatch_operation)); for (l = requests; l != NULL; l = g_list_next (l)) { TpChannelRequest *request = l->data; g_assert (TP_IS_CHANNEL_REQUEST (request)); } self->observe_ctx = g_object_ref (context); tp_observe_channels_context_accept (context); } static void simple_add_dispatch_operation ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context) { TpTestsSimpleClient *self = TP_TESTS_SIMPLE_CLIENT (client); GList *l; g_assert (TP_IS_ACCOUNT (account)); g_assert (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)); g_assert (TP_IS_CONNECTION (connection)); g_assert (tp_proxy_is_prepared (connection, TP_CONNECTION_FEATURE_CORE)); g_assert (TP_IS_CHANNEL_DISPATCH_OPERATION (dispatch_operation)); g_assert (tp_proxy_is_prepared (dispatch_operation, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE) || tp_proxy_get_invalidated (dispatch_operation) != NULL); if (self->add_dispatch_ctx != NULL) { g_object_unref (self->add_dispatch_ctx); self->add_dispatch_ctx = NULL; } g_assert_cmpuint (g_list_length (channels), >, 0); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_assert (TP_IS_CHANNEL (channel)); g_assert (tp_proxy_is_prepared (channel, TP_CHANNEL_FEATURE_CORE) || tp_proxy_get_invalidated (channel) != NULL); } self->add_dispatch_ctx = g_object_ref (context); tp_add_dispatch_operation_context_accept (context); } static void simple_handle_channels (TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisfied, gint64 user_action_time, TpHandleChannelsContext *context) { TpTestsSimpleClient *self = TP_TESTS_SIMPLE_CLIENT (client); GList *l; if (self->handle_channels_ctx != NULL) { g_object_unref (self->handle_channels_ctx); self->handle_channels_ctx = NULL; } g_assert (TP_IS_ACCOUNT (account)); g_assert (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)); g_assert (TP_IS_CONNECTION (connection)); g_assert (tp_proxy_is_prepared (connection, TP_CONNECTION_FEATURE_CORE)); g_assert_cmpuint (g_list_length (channels), >, 0); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_assert (TP_IS_CHANNEL (channel)); g_assert (tp_proxy_is_prepared (channel, TP_CHANNEL_FEATURE_CORE) || tp_proxy_get_invalidated (channel) != NULL); } for (l = requests_satisfied; l != NULL; l = g_list_next (l)) { TpChannelRequest *request = l->data; g_assert (TP_IS_CHANNEL_REQUEST (request)); } self->handle_channels_ctx = g_object_ref (context); tp_handle_channels_context_accept (context); } static void tp_tests_simple_client_init (TpTestsSimpleClient *self) { } static void tp_tests_simple_client_dispose (GObject *object) { TpTestsSimpleClient *self = TP_TESTS_SIMPLE_CLIENT (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_tests_simple_client_parent_class)->dispose; if (self->observe_ctx != NULL) { g_object_unref (self->observe_ctx); self->observe_ctx = NULL; } if (self->add_dispatch_ctx != NULL) { g_object_unref (self->add_dispatch_ctx); self->add_dispatch_ctx = NULL; } if (self->handle_channels_ctx != NULL) { g_object_unref (self->handle_channels_ctx); self->handle_channels_ctx = NULL; } if (dispose != NULL) dispose (object); } static void tp_tests_simple_client_class_init (TpTestsSimpleClientClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseClientClass *base_class = TP_BASE_CLIENT_CLASS (klass); object_class->dispose = tp_tests_simple_client_dispose; tp_base_client_implement_observe_channels (base_class, simple_observe_channels); tp_base_client_implement_add_dispatch_operation (base_class, simple_add_dispatch_operation); tp_base_client_implement_handle_channels (base_class, simple_handle_channels); } TpTestsSimpleClient * tp_tests_simple_client_new (TpDBusDaemon *dbus_daemon, const gchar *name, gboolean uniquify_name) { return tp_tests_object_new_static_class (TP_TESTS_TYPE_SIMPLE_CLIENT, "dbus-daemon", dbus_daemon, "name", name, "uniquify-name", uniquify_name, NULL); } telepathy-glib-0.24.2/tests/lib/simple-client.h0000644000175000017500000000357112652510705016271 00000000000000/* * simple-client.h - header for a simple client * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CLIENT_H__ #define __TP_TESTS_SIMPLE_CLIENT_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleClient TpTestsSimpleClient; typedef struct _TpTestsSimpleClientClass TpTestsSimpleClientClass; struct _TpTestsSimpleClientClass { TpBaseClientClass parent_class; }; struct _TpTestsSimpleClient { TpBaseClient parent; TpObserveChannelsContext *observe_ctx; TpAddDispatchOperationContext *add_dispatch_ctx; TpHandleChannelsContext *handle_channels_ctx; }; GType tp_tests_simple_client_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CLIENT \ (tp_tests_simple_client_get_type ()) #define TP_TESTS_SIMPLE_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CLIENT, \ TpTestsSimpleClient)) #define TP_TESTS_SIMPLE_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CLIENT, \ TpTestsSimpleClientClass)) #define SIMPLE_IS_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CLIENT)) #define SIMPLE_IS_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CLIENT)) #define TP_TESTS_SIMPLE_CLIENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CLIENT, \ TpTestsSimpleClientClass)) TpTestsSimpleClient * tp_tests_simple_client_new (TpDBusDaemon *dbus_daemon, const gchar *name, gboolean uniquify_name); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CONN_H__ */ telepathy-glib-0.24.2/tests/lib/contact-list-manager.c0000644000175000017500000006130112652510705017526 00000000000000/* * Example channel manager for contact lists * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2010 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "contact-list-manager.h" #include #include struct _TpTestsContactListManagerPrivate { TpBaseConnection *conn; gulong status_changed_id; /* TpHandle => ContactDetails */ GHashTable *contact_details; TpHandleRepoIface *contact_repo; TpHandleRepoIface *group_repo; TpHandleSet *groups; }; static void contact_groups_iface_init (TpContactGroupListInterface *iface); static void mutable_contact_groups_iface_init ( TpMutableContactGroupListInterface *iface); static void mutable_iface_init ( TpMutableContactListInterface *iface); G_DEFINE_TYPE_WITH_CODE (TpTestsContactListManager, tp_tests_contact_list_manager, TP_TYPE_BASE_CONTACT_LIST, G_IMPLEMENT_INTERFACE (TP_TYPE_CONTACT_GROUP_LIST, contact_groups_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, mutable_contact_groups_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_MUTABLE_CONTACT_LIST, mutable_iface_init)) typedef struct { TpSubscriptionState subscribe; TpSubscriptionState publish; gchar *publish_request; TpHandleSet *groups; TpHandle handle; TpHandleRepoIface *contact_repo; } ContactDetails; static void contact_detail_destroy (gpointer p) { ContactDetails *d = p; g_free (d->publish_request); tp_handle_set_destroy (d->groups); g_slice_free (ContactDetails, d); } static ContactDetails * lookup_contact (TpTestsContactListManager *self, TpHandle handle) { return g_hash_table_lookup (self->priv->contact_details, GUINT_TO_POINTER (handle)); } static ContactDetails * ensure_contact (TpTestsContactListManager *self, TpHandle handle) { ContactDetails *d = lookup_contact (self, handle); if (d == NULL) { d = g_slice_new0 (ContactDetails); d->subscribe = TP_SUBSCRIPTION_STATE_NO; d->publish = TP_SUBSCRIPTION_STATE_NO; d->publish_request = NULL; d->groups = tp_handle_set_new (self->priv->group_repo); d->handle = handle; d->contact_repo = self->priv->contact_repo; g_hash_table_insert (self->priv->contact_details, GUINT_TO_POINTER (handle), d); } return d; } static void tp_tests_contact_list_manager_init (TpTestsContactListManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_CONTACT_LIST_MANAGER, TpTestsContactListManagerPrivate); self->priv->contact_details = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, contact_detail_destroy); } static void close_all (TpTestsContactListManager *self) { if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } tp_clear_pointer (&self->priv->contact_details, g_hash_table_unref); tp_clear_pointer (&self->priv->groups, tp_handle_set_destroy); } static void dispose (GObject *object) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (object); close_all (self); ((GObjectClass *) tp_tests_contact_list_manager_parent_class)->dispose ( object); } static TpHandleSet * contact_list_dup_contacts (TpBaseContactList *base) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); TpHandleSet *set; GHashTableIter iter; gpointer k, v; set = tp_handle_set_new (self->priv->contact_repo); g_hash_table_iter_init (&iter, self->priv->contact_details); while (g_hash_table_iter_next (&iter, &k, &v)) { ContactDetails *d = v; /* add all the interesting items */ if (d->subscribe != TP_SUBSCRIPTION_STATE_NO || d->publish != TP_SUBSCRIPTION_STATE_NO) tp_handle_set_add (set, GPOINTER_TO_UINT (k)); } return set; } static void contact_list_dup_states (TpBaseContactList *base, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); ContactDetails *d = lookup_contact (self, contact); if (d == NULL) { if (subscribe != NULL) *subscribe = TP_SUBSCRIPTION_STATE_NO; if (publish != NULL) *publish = TP_SUBSCRIPTION_STATE_NO; if (publish_request != NULL) *publish_request = NULL; } else { if (subscribe != NULL) *subscribe = d->subscribe; if (publish != NULL) *publish = d->publish; if (publish_request != NULL) *publish_request = g_strdup (d->publish_request); } } static GStrv contact_list_dup_groups (TpBaseContactList *base) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); GPtrArray *ret; if (self->priv->groups != NULL) { TpIntsetFastIter iter; TpHandle group; ret = g_ptr_array_sized_new (tp_handle_set_size (self->priv->groups) + 1); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (self->priv->groups)); while (tp_intset_fast_iter_next (&iter, &group)) { g_ptr_array_add (ret, g_strdup (tp_handle_inspect ( self->priv->group_repo, group))); } } else { ret = g_ptr_array_sized_new (1); } g_ptr_array_add (ret, NULL); return (GStrv) g_ptr_array_free (ret, FALSE); } static GStrv contact_list_dup_contact_groups (TpBaseContactList *base, TpHandle contact) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); ContactDetails *d = lookup_contact (self, contact); GPtrArray *ret; if (d != NULL && d->groups != NULL) { TpIntsetFastIter iter; TpHandle group; ret = g_ptr_array_sized_new (tp_handle_set_size (d->groups) + 1); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (d->groups)); while (tp_intset_fast_iter_next (&iter, &group)) { g_ptr_array_add (ret, g_strdup (tp_handle_inspect ( self->priv->group_repo, group))); } } else { ret = g_ptr_array_sized_new (1); } g_ptr_array_add (ret, NULL); return (GStrv) g_ptr_array_free (ret, FALSE); } static TpHandleSet * contact_list_dup_group_members (TpBaseContactList *base, const gchar *group) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); TpHandleSet *set; TpHandle group_handle; GHashTableIter iter; gpointer k, v; set = tp_handle_set_new (self->priv->contact_repo); group_handle = tp_handle_lookup (self->priv->group_repo, group, NULL, NULL); if (G_UNLIKELY (group_handle == 0)) { /* clearly it doesn't have members */ return set; } g_hash_table_iter_init (&iter, self->priv->contact_details); while (g_hash_table_iter_next (&iter, &k, &v)) { ContactDetails *d = v; if (d->groups != NULL && tp_handle_set_is_member (d->groups, group_handle)) tp_handle_set_add (set, GPOINTER_TO_UINT (k)); } return set; } static void contact_list_set_contact_groups_async (TpBaseContactList *base, TpHandle contact, const gchar * const *names, gsize n, GAsyncReadyCallback callback, gpointer user_data) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (base); ContactDetails *d; TpIntset *set, *added_set, *removed_set; GPtrArray *added_names, *removed_names; GPtrArray *new_groups; TpIntsetFastIter iter; TpHandle group_handle; guint i; d = ensure_contact (self, contact); new_groups = g_ptr_array_new (); set = tp_intset_new (); for (i = 0; i < n; i++) { group_handle = tp_handle_ensure (self->priv->group_repo, names[i], NULL, NULL); tp_intset_add (set, group_handle); if (!tp_handle_set_is_member (self->priv->groups, group_handle)) { tp_handle_set_add (self->priv->groups, group_handle); g_ptr_array_add (new_groups, (gchar *) names[i]); } } if (new_groups->len > 0) { tp_base_contact_list_groups_created ((TpBaseContactList *) self, (const gchar * const *) new_groups->pdata, new_groups->len); } added_set = tp_intset_difference (set, tp_handle_set_peek (d->groups)); added_names = g_ptr_array_sized_new (tp_intset_size (added_set)); tp_intset_fast_iter_init (&iter, added_set); while (tp_intset_fast_iter_next (&iter, &group_handle)) { g_ptr_array_add (added_names, (gchar *) tp_handle_inspect ( self->priv->group_repo, group_handle)); } tp_intset_destroy (added_set); removed_set = tp_intset_difference (tp_handle_set_peek (d->groups), set); removed_names = g_ptr_array_sized_new (tp_intset_size (removed_set)); tp_intset_fast_iter_init (&iter, removed_set); while (tp_intset_fast_iter_next (&iter, &group_handle)) { g_ptr_array_add (removed_names, (gchar *) tp_handle_inspect ( self->priv->group_repo, group_handle)); } tp_intset_destroy (removed_set); tp_handle_set_destroy (d->groups); d->groups = tp_handle_set_new_from_intset (self->priv->group_repo, set); tp_intset_destroy (set); if (added_names->len > 0 || removed_names->len > 0) { tp_base_contact_list_one_contact_groups_changed (base, contact, (const gchar * const *) added_names->pdata, added_names->len, (const gchar * const *) removed_names->pdata, removed_names->len); } tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_set_contact_groups_async); g_ptr_array_unref (added_names); g_ptr_array_unref (removed_names); g_ptr_array_unref (new_groups); } static void contact_list_set_group_members_async (TpBaseContactList *base, const gchar *normalized_group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new_error ((GObject *) base, callback, user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Not implemented"); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static void contact_list_add_to_group_async (TpBaseContactList *base, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new_error ((GObject *) base, callback, user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Not implemented"); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static void contact_list_remove_from_group_async (TpBaseContactList *base, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new_error ((GObject *) base, callback, user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Not implemented"); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static void contact_list_remove_group_async (TpBaseContactList *base, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new_error ((GObject *) base, callback, user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Not implemented"); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } static void contact_list_request_subscription_async (TpBaseContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GArray *handles; handles = tp_handle_set_to_array (contacts); tp_tests_contact_list_manager_request_subscription ( (TpTestsContactListManager *) self, handles->len, (TpHandle *) handles->data, message); g_array_unref (handles); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_request_subscription_async); } static void contact_list_authorize_publication_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GArray *handles; handles = tp_handle_set_to_array (contacts); tp_tests_contact_list_manager_authorize_publication ( (TpTestsContactListManager *) self, handles->len, (TpHandle *) handles->data); g_array_unref (handles); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_authorize_publication_async); } static void contact_list_remove_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GArray *handles; handles = tp_handle_set_to_array (contacts); tp_tests_contact_list_manager_remove ( (TpTestsContactListManager *) self, handles->len, (TpHandle *) handles->data); g_array_unref (handles); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_remove_contacts_async); } static void contact_list_unsubscribe_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GArray *handles; handles = tp_handle_set_to_array (contacts); tp_tests_contact_list_manager_unsubscribe ( (TpTestsContactListManager *) self, handles->len, (TpHandle *) handles->data); g_array_unref (handles); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_unsubscribe_async); } static void contact_list_unpublish_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { GArray *handles; handles = tp_handle_set_to_array (contacts); tp_tests_contact_list_manager_unpublish ( (TpTestsContactListManager *) self, handles->len, (TpHandle *) handles->data); g_array_unref (handles); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, contact_list_unpublish_async); } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, TpTestsContactListManager *self) { switch (status) { case TP_CONNECTION_STATUS_CONNECTED: { tp_base_contact_list_set_list_received (TP_BASE_CONTACT_LIST (self)); } break; case TP_CONNECTION_STATUS_DISCONNECTED: { close_all (self); } break; } } static void constructed (GObject *object) { TpTestsContactListManager *self = TP_TESTS_CONTACT_LIST_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tests_contact_list_manager_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } self->priv->conn = tp_base_contact_list_get_connection ( TP_BASE_CONTACT_LIST (self), NULL); self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", G_CALLBACK (status_changed_cb), self); self->priv->contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); self->priv->group_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_GROUP); self->priv->groups = tp_handle_set_new (self->priv->group_repo); } static void contact_groups_iface_init (TpContactGroupListInterface *iface) { iface->dup_groups = contact_list_dup_groups; iface->dup_contact_groups = contact_list_dup_contact_groups; iface->dup_group_members = contact_list_dup_group_members; } static void mutable_contact_groups_iface_init ( TpMutableContactGroupListInterface *iface) { iface->set_contact_groups_async = contact_list_set_contact_groups_async; iface->set_group_members_async = contact_list_set_group_members_async; iface->add_to_group_async = contact_list_add_to_group_async; iface->remove_from_group_async = contact_list_remove_from_group_async; iface->remove_group_async = contact_list_remove_group_async; } static void mutable_iface_init (TpMutableContactListInterface *iface) { iface->request_subscription_async = contact_list_request_subscription_async; iface->authorize_publication_async = contact_list_authorize_publication_async; iface->remove_contacts_async = contact_list_remove_contacts_async; iface->unsubscribe_async = contact_list_unsubscribe_async; iface->unpublish_async = contact_list_unpublish_async; } static void tp_tests_contact_list_manager_class_init (TpTestsContactListManagerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseContactListClass *base_class =(TpBaseContactListClass *) klass; g_type_class_add_private (klass, sizeof (TpTestsContactListManagerPrivate)); object_class->constructed = constructed; object_class->dispose = dispose; base_class->dup_states = contact_list_dup_states; base_class->dup_contacts = contact_list_dup_contacts; } void tp_tests_contact_list_manager_add_to_group (TpTestsContactListManager *self, const gchar *group_name, TpHandle member) { TpBaseContactList *base = TP_BASE_CONTACT_LIST (self); ContactDetails *d = ensure_contact (self, member); TpHandle group_handle; group_handle = tp_handle_ensure (self->priv->group_repo, group_name, NULL, NULL); if (!tp_handle_set_is_member (self->priv->groups, group_handle)) { tp_handle_set_add (self->priv->groups, group_handle); tp_base_contact_list_groups_created ((TpBaseContactList *) self, &group_name, 1); } tp_handle_set_add (d->groups, group_handle); tp_base_contact_list_one_contact_groups_changed (base, member, &group_name, 1, NULL, 0); } void tp_tests_contact_list_manager_remove_from_group (TpTestsContactListManager *self, const gchar *group_name, TpHandle member) { TpBaseContactList *base = TP_BASE_CONTACT_LIST (self); ContactDetails *d = lookup_contact (self, member); TpHandle group_handle; if (d == NULL) return; group_handle = tp_handle_ensure (self->priv->group_repo, group_name, NULL, NULL); tp_handle_set_remove (d->groups, group_handle); tp_base_contact_list_one_contact_groups_changed (base, member, NULL, 0, &group_name, 1); } typedef struct { TpTestsContactListManager *self; TpHandleSet *handles; } SelfAndContact; static SelfAndContact * self_and_contact_new (TpTestsContactListManager *self, TpHandleSet *handles) { SelfAndContact *ret = g_slice_new0 (SelfAndContact); ret->self = g_object_ref (self); ret->handles = tp_handle_set_copy (handles); return ret; } static void self_and_contact_destroy (gpointer p) { SelfAndContact *s = p; tp_handle_set_destroy (s->handles); g_object_unref (s->self); g_slice_free (SelfAndContact, s); } static gboolean receive_authorized (gpointer p) { SelfAndContact *s = p; GArray *handles_array; guint i; handles_array = tp_handle_set_to_array (s->handles); for (i = 0; i < handles_array->len; i++) { ContactDetails *d = lookup_contact (s->self, g_array_index (handles_array, TpHandle, i)); if (d == NULL) continue; d->subscribe = TP_SUBSCRIPTION_STATE_YES; /* if we're not publishing to them, also pretend they have asked us to do so */ if (d->publish != TP_SUBSCRIPTION_STATE_YES) { d->publish = TP_SUBSCRIPTION_STATE_ASK; tp_clear_pointer (&d->publish_request, g_free); d->publish_request = g_strdup ("automatic publish request"); } } g_array_unref (handles_array); tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (s->self), s->handles, NULL); return FALSE; } static gboolean receive_unauthorized (gpointer p) { SelfAndContact *s = p; GArray *handles_array; guint i; handles_array = tp_handle_set_to_array (s->handles); for (i = 0; i < handles_array->len; i++) { ContactDetails *d = lookup_contact (s->self, g_array_index (handles_array, TpHandle, i)); if (d == NULL) continue; d->subscribe = TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY; } g_array_unref (handles_array); tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (s->self), s->handles, NULL); return FALSE; } void tp_tests_contact_list_manager_request_subscription (TpTestsContactListManager *self, guint n_members, TpHandle *members, const gchar *message) { TpHandleSet *handles; guint i; gchar *message_lc; handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d = ensure_contact (self, members[i]); if (d->subscribe == TP_SUBSCRIPTION_STATE_YES) continue; d->subscribe = TP_SUBSCRIPTION_STATE_ASK; tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), handles, NULL); message_lc = g_ascii_strdown (message, -1); if (strstr (message_lc, "please") != NULL) { g_idle_add_full (G_PRIORITY_DEFAULT, receive_authorized, self_and_contact_new (self, handles), self_and_contact_destroy); } else if (strstr (message_lc, "no") != NULL) { g_idle_add_full (G_PRIORITY_DEFAULT, receive_unauthorized, self_and_contact_new (self, handles), self_and_contact_destroy); } g_free (message_lc); tp_handle_set_destroy (handles); } void tp_tests_contact_list_manager_unsubscribe (TpTestsContactListManager *self, guint n_members, TpHandle *members) { TpHandleSet *handles; guint i; handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d = lookup_contact (self, members[i]); if (d == NULL || d->subscribe == TP_SUBSCRIPTION_STATE_NO) continue; d->subscribe = TP_SUBSCRIPTION_STATE_NO; tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), handles, NULL); tp_handle_set_destroy (handles); } void tp_tests_contact_list_manager_authorize_publication (TpTestsContactListManager *self, guint n_members, TpHandle *members) { TpHandleSet *handles; guint i; handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d = lookup_contact (self, members[i]); if (d == NULL || d->publish != TP_SUBSCRIPTION_STATE_ASK) continue; d->publish = TP_SUBSCRIPTION_STATE_YES; tp_clear_pointer (&d->publish_request, g_free); tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), handles, NULL); tp_handle_set_destroy (handles); } void tp_tests_contact_list_manager_unpublish (TpTestsContactListManager *self, guint n_members, TpHandle *members) { TpHandleSet *handles; guint i; handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d = lookup_contact (self, members[i]); if (d == NULL || d->publish == TP_SUBSCRIPTION_STATE_NO) continue; d->publish = TP_SUBSCRIPTION_STATE_NO; tp_clear_pointer (&d->publish_request, g_free); tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), handles, NULL); tp_handle_set_destroy (handles); } void tp_tests_contact_list_manager_remove (TpTestsContactListManager *self, guint n_members, TpHandle *members) { TpHandleSet *handles; guint i; handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d = lookup_contact (self, members[i]); if (d == NULL) continue; g_hash_table_remove (self->priv->contact_details, GUINT_TO_POINTER (members[i])); tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), NULL, handles); tp_handle_set_destroy (handles); } void tp_tests_contact_list_manager_add_initial_contacts (TpTestsContactListManager *self, guint n_members, TpHandle *members) { TpHandleSet *handles; guint i; g_assert_cmpint (tp_base_connection_get_status (self->priv->conn), ==, TP_CONNECTION_STATUS_DISCONNECTED); g_assert (!tp_base_connection_is_destroyed (self->priv->conn)); handles = tp_handle_set_new (self->priv->contact_repo); for (i = 0; i < n_members; i++) { ContactDetails *d; g_assert (lookup_contact (self, members[i]) == NULL); d = ensure_contact (self, members[i]); d->subscribe = TP_SUBSCRIPTION_STATE_YES; d->publish = TP_SUBSCRIPTION_STATE_YES; tp_handle_set_add (handles, members[i]); } tp_base_contact_list_contacts_changed (TP_BASE_CONTACT_LIST (self), handles, NULL); tp_handle_set_destroy (handles); } telepathy-glib-0.24.2/tests/lib/contact-list-manager.h0000644000175000017500000000561212652510705017536 00000000000000/* * Example channel manager for contact lists * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2010 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_CONTACT_LIST_MANAGER_H__ #define __TP_TESTS_CONTACT_LIST_MANAGER_H__ #include G_BEGIN_DECLS #define TP_TESTS_TYPE_CONTACT_LIST_MANAGER \ (tp_tests_contact_list_manager_get_type ()) #define TP_TESTS_CONTACT_LIST_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_CONTACT_LIST_MANAGER, \ TpTestsContactListManager)) #define TP_TESTS_CONTACT_LIST_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_CONTACT_LIST_MANAGER, \ TpTestsContactListManagerClass)) #define TP_TESTS_IS_CONTACT_LIST_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_CONTACT_LIST_MANAGER)) #define TP_TESTS_IS_CONTACT_LIST_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_CONTACT_LIST_MANAGER)) #define TP_TESTS_CONTACT_LIST_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_CONTACT_LIST_MANAGER, \ TpTestsContactListManagerClass)) typedef struct _TpTestsContactListManager TpTestsContactListManager; typedef struct _TpTestsContactListManagerClass TpTestsContactListManagerClass; typedef struct _TpTestsContactListManagerPrivate TpTestsContactListManagerPrivate; struct _TpTestsContactListManagerClass { TpBaseContactListClass parent_class; }; struct _TpTestsContactListManager { TpBaseContactList parent; TpTestsContactListManagerPrivate *priv; }; GType tp_tests_contact_list_manager_get_type (void); void tp_tests_contact_list_manager_add_to_group (TpTestsContactListManager *self, const gchar *group_name, TpHandle member); void tp_tests_contact_list_manager_remove_from_group (TpTestsContactListManager *self, const gchar *group_name, TpHandle member); void tp_tests_contact_list_manager_request_subscription (TpTestsContactListManager *self, guint n_members, TpHandle *members, const gchar *message); void tp_tests_contact_list_manager_unsubscribe (TpTestsContactListManager *self, guint n_members, TpHandle *members); void tp_tests_contact_list_manager_authorize_publication (TpTestsContactListManager *self, guint n_members, TpHandle *members); void tp_tests_contact_list_manager_unpublish (TpTestsContactListManager *self, guint n_members, TpHandle *members); void tp_tests_contact_list_manager_remove (TpTestsContactListManager *self, guint n_members, TpHandle *members); void tp_tests_contact_list_manager_add_initial_contacts (TpTestsContactListManager *self, guint n_members, TpHandle *members); G_END_DECLS #endif telepathy-glib-0.24.2/tests/lib/simple-channel-manager.c0000644000175000017500000000461312652510705020024 00000000000000/* * simple-channel-manager.c * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "simple-channel-manager.h" #include "util.h" #include "echo-chan.h" static void channel_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleChannelManager, tp_tests_simple_channel_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init); ) /* signals */ enum { REQUEST, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; static void tp_tests_simple_channel_manager_class_init (TpTestsSimpleChannelManagerClass *klass) { signals[REQUEST] = g_signal_new ("request", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_HASH_TABLE); } static void tp_tests_simple_channel_manager_init (TpTestsSimpleChannelManager *self) { } static gboolean tp_tests_simple_channel_manager_request (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { TpTestsSimpleChannelManager *self = TP_TESTS_SIMPLE_CHANNEL_MANAGER (manager); GSList *tokens; TpExportableChannel *channel; TpHandle handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); gchar *path; g_signal_emit (manager, signals[REQUEST], 0, request_properties); tokens = g_slist_append (NULL, request_token); path = g_strdup_printf ("%s/Channel", tp_base_connection_get_object_path (self->conn)); channel = tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CHANNEL, "connection", self->conn, "object-path", path, "handle", handle, NULL); tp_channel_manager_emit_new_channel (manager, channel, tokens); g_free (path); g_slist_free (tokens); g_object_unref (channel); return TRUE; } static void channel_manager_iface_init (gpointer g_iface, gpointer giface_data G_GNUC_UNUSED) { TpChannelManagerIface *iface = g_iface; iface->create_channel = tp_tests_simple_channel_manager_request; iface->ensure_channel = tp_tests_simple_channel_manager_request; iface->request_channel = tp_tests_simple_channel_manager_request; } telepathy-glib-0.24.2/tests/lib/simple-channel-manager.h0000644000175000017500000000347412652510705020035 00000000000000/* * simple-channel-manager.h * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CHANNEL_MANAGER_H__ #define __TP_TESTS_SIMPLE_CHANNEL_MANAGER_H__ #include #include typedef struct _TpTestsSimpleChannelManager TpTestsSimpleChannelManager; typedef struct _TpTestsSimpleChannelManagerClass TpTestsSimpleChannelManagerClass; struct _TpTestsSimpleChannelManager { GObject parent; TpBaseConnection *conn; }; struct _TpTestsSimpleChannelManagerClass { GObjectClass parent_class; }; GType tp_tests_simple_channel_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER \ (tp_tests_simple_channel_manager_get_type ()) #define TP_TESTS_SIMPLE_CHANNEL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER, \ TpTestsSimpleChannelManager)) #define TP_TESTS_SIMPLE_CHANNEL_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER, \ TpTestsSimpleChannelManagerClass)) #define TP_TESTS_IS_SIMPLE_CHANNEL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER)) #define TP_TESTS_IS_SIMPLE_CHANNEL_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER)) #define TP_TESTS_SIMPLE_CHANNEL_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER, \ TpTestsSimpleChannelManagerClass)) G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CHANNEL_MANAGER_H__ */ telepathy-glib-0.24.2/tests/lib/simple-account.c0000644000175000017500000005126612652510705016446 00000000000000/* * simple-account.c - a simple account service. * * Copyright (C) 2010-2012 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "simple-account.h" #include #include static void account_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleAccount, tp_tests_simple_account, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_ACCOUNT, account_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_ACCOUNT_INTERFACE_AVATAR, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_ACCOUNT_INTERFACE_ADDRESSING, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_ACCOUNT_INTERFACE_STORAGE, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) ) /* TP_IFACE_ACCOUNT is implied */ static const char *ACCOUNT_INTERFACES[] = { TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, TP_IFACE_ACCOUNT_INTERFACE_STORAGE, TP_IFACE_ACCOUNT_INTERFACE_AVATAR, NULL }; enum { PROP_0, PROP_INTERFACES, PROP_DISPLAY_NAME, PROP_ICON, PROP_VALID, PROP_ENABLED, PROP_NICKNAME, PROP_PARAMETERS, PROP_AUTOMATIC_PRESENCE, PROP_CONNECT_AUTO, PROP_CONNECTION, PROP_CONNECTION_STATUS, PROP_CONNECTION_STATUS_REASON, PROP_CURRENT_PRESENCE, PROP_REQUESTED_PRESENCE, PROP_NORMALIZED_NAME, PROP_HAS_BEEN_ONLINE, PROP_URI_SCHEMES, PROP_STORAGE_PROVIDER, PROP_STORAGE_IDENTIFIER, PROP_STORAGE_SPECIFIC_INFORMATION, PROP_STORAGE_RESTRICTIONS, PROP_AVATAR, PROP_SUPERSEDES, N_PROPS }; struct _TpTestsSimpleAccountPrivate { TpConnectionPresenceType presence; gchar *presence_status; gchar *presence_msg; gchar *connection_path; gboolean enabled; GPtrArray *uri_schemes; GHashTable *parameters; GArray *avatar; }; static void tp_tests_simple_account_update_parameters (TpSvcAccount *svc, GHashTable *parameters, const gchar **unset_parameters, DBusGMethodInvocation *context) { GPtrArray *reconnect_required = g_ptr_array_new (); GHashTableIter iter; gpointer k; guint i; /* We don't actually store any parameters, but for the purposes * of this method we pretend that every parameter provided is * valid and requires reconnection. */ g_hash_table_iter_init (&iter, parameters); while (g_hash_table_iter_next (&iter, &k, NULL)) g_ptr_array_add (reconnect_required, k); for (i = 0; unset_parameters != NULL && unset_parameters[i] != NULL; i++) g_ptr_array_add (reconnect_required, (gchar *) unset_parameters[i]); g_ptr_array_add (reconnect_required, NULL); tp_svc_account_return_from_update_parameters (context, (const gchar **) reconnect_required->pdata); g_ptr_array_unref (reconnect_required); } static void account_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_account_implement_##x (\ klass, tp_tests_simple_account_##x) IMPLEMENT (update_parameters); #undef IMPLEMENT } /* you may have noticed this is not entirely realistic */ static const gchar * const uri_schemes[] = { "about", "telnet", NULL }; static void tp_tests_simple_account_init (TpTestsSimpleAccount *self) { guint i; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_ACCOUNT, TpTestsSimpleAccountPrivate); self->priv->presence = TP_CONNECTION_PRESENCE_TYPE_AWAY; self->priv->presence_status = g_strdup ("currently-away"); self->priv->presence_msg = g_strdup ("this is my CurrentPresence"); self->priv->connection_path = g_strdup ("/"); self->priv->enabled = TRUE; self->priv->uri_schemes = g_ptr_array_new_with_free_func (g_free); for (i = 0; uri_schemes[i] != NULL; i++) g_ptr_array_add (self->priv->uri_schemes, g_strdup (uri_schemes[i])); self->priv->parameters = g_hash_table_new (NULL, NULL); self->priv->avatar = g_array_new (FALSE, FALSE, sizeof (char)); tp_tests_simple_account_set_avatar (self, ":-)"); } static void tp_tests_simple_account_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsSimpleAccount *self = TP_TESTS_SIMPLE_ACCOUNT (object); GValue identifier = { 0, }; g_value_init (&identifier, G_TYPE_STRING); g_value_set_string (&identifier, "unique-identifier"); switch (property_id) { case PROP_INTERFACES: g_value_set_boxed (value, ACCOUNT_INTERFACES); break; case PROP_DISPLAY_NAME: g_value_set_string (value, "Fake Account"); break; case PROP_ICON: g_value_set_string (value, ""); break; case PROP_VALID: g_value_set_boolean (value, TRUE); break; case PROP_ENABLED: g_value_set_boolean (value, self->priv->enabled); break; case PROP_NICKNAME: g_value_set_string (value, "badger"); break; case PROP_PARAMETERS: g_value_set_boxed (value, self->priv->parameters); break; case PROP_AUTOMATIC_PRESENCE: g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_UINT, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, G_TYPE_STRING, "automatically-available", G_TYPE_STRING, "this is my AutomaticPresence", G_TYPE_INVALID)); break; case PROP_CONNECT_AUTO: g_value_set_boolean (value, FALSE); break; case PROP_CONNECTION: g_value_set_boxed (value, self->priv->connection_path); break; case PROP_CONNECTION_STATUS: g_value_set_uint (value, TP_CONNECTION_STATUS_CONNECTED); break; case PROP_CONNECTION_STATUS_REASON: g_value_set_uint (value, TP_CONNECTION_STATUS_REASON_REQUESTED); break; case PROP_CURRENT_PRESENCE: g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_UINT, self->priv->presence, G_TYPE_STRING, self->priv->presence_status, G_TYPE_STRING, self->priv->presence_msg, G_TYPE_INVALID)); break; case PROP_REQUESTED_PRESENCE: g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_UINT, TP_CONNECTION_PRESENCE_TYPE_BUSY, G_TYPE_STRING, "requesting", G_TYPE_STRING, "this is my RequestedPresence", G_TYPE_INVALID)); break; case PROP_NORMALIZED_NAME: g_value_set_string (value, "bob.mcbadgers@example.com"); break; case PROP_HAS_BEEN_ONLINE: g_value_set_boolean (value, TRUE); break; case PROP_STORAGE_PROVIDER: g_value_set_string (value, "org.freedesktop.Telepathy.glib.test"); break; case PROP_STORAGE_IDENTIFIER: g_value_set_boxed (value, &identifier); break; case PROP_STORAGE_SPECIFIC_INFORMATION: g_value_take_boxed (value, tp_asv_new ( "one", G_TYPE_INT, 1, "two", G_TYPE_UINT, 2, "marco", G_TYPE_STRING, "polo", NULL)); break; case PROP_STORAGE_RESTRICTIONS: g_value_set_uint (value, TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED | TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS); break; case PROP_URI_SCHEMES: { GPtrArray *arr; guint i; arr = g_ptr_array_sized_new (self->priv->uri_schemes->len + 1); for (i = 0; i < self->priv->uri_schemes->len; i++) g_ptr_array_add (arr, g_ptr_array_index (self->priv->uri_schemes, i)); g_ptr_array_add (arr, NULL); g_value_set_boxed (value, arr->pdata); g_ptr_array_unref (arr); } break; case PROP_AVATAR: { g_value_take_boxed (value, tp_value_array_build (2, TP_TYPE_UCHAR_ARRAY, self->priv->avatar, G_TYPE_STRING, "text/plain", G_TYPE_INVALID)); } break; case PROP_SUPERSEDES: { GPtrArray *arr = g_ptr_array_new (); g_ptr_array_add (arr, g_strdup (TP_ACCOUNT_OBJECT_PATH_BASE "super/seded/whatever")); g_value_take_boxed (value, arr); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } g_value_unset (&identifier); } static void tp_tests_simple_account_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsSimpleAccount *self = TP_TESTS_SIMPLE_ACCOUNT (object); switch (property_id) { case PROP_PARAMETERS: self->priv->parameters = g_value_dup_boxed (value); /* In principle we should be emitting AccountPropertyChanged here */ break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_account_finalize (GObject *object) { TpTestsSimpleAccount *self = TP_TESTS_SIMPLE_ACCOUNT (object); g_free (self->priv->presence_status); g_free (self->priv->presence_msg); g_free (self->priv->connection_path); g_ptr_array_unref (self->priv->uri_schemes); g_hash_table_unref (self->priv->parameters); g_array_unref (self->priv->avatar); G_OBJECT_CLASS (tp_tests_simple_account_parent_class)->finalize (object); } /** * This class currently only provides the minimum for * tp_account_prepare to succeed. This turns out to be only a working * Properties.GetAll(). */ static void tp_tests_simple_account_class_init (TpTestsSimpleAccountClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl a_props[] = { { "Interfaces", "interfaces", NULL }, { "DisplayName", "display-name", NULL }, { "Icon", "icon", NULL }, { "Valid", "valid", NULL }, { "Enabled", "enabled", NULL }, { "Nickname", "nickname", NULL }, { "Parameters", "parameters", NULL }, { "AutomaticPresence", "automatic-presence", NULL }, { "ConnectAutomatically", "connect-automatically", NULL }, { "Connection", "connection", NULL }, { "ConnectionStatus", "connection-status", NULL }, { "ConnectionStatusReason", "connection-status-reason", NULL }, { "CurrentPresence", "current-presence", NULL }, { "RequestedPresence", "requested-presence", NULL }, { "NormalizedName", "normalized-name", NULL }, { "HasBeenOnline", "has-been-online", NULL }, { "Supersedes", "supersedes", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl ais_props[] = { { "StorageProvider", "storage-provider", NULL }, { "StorageIdentifier", "storage-identifier", NULL }, { "StorageSpecificInformation", "storage-specific-information", NULL }, { "StorageRestrictions", "storage-restrictions", NULL }, { NULL }, }; static TpDBusPropertiesMixinPropImpl aia_props[] = { { "URISchemes", "uri-schemes", NULL }, { NULL }, }; static TpDBusPropertiesMixinPropImpl avatar_props[] = { { "Avatar", "avatar", NULL }, { NULL }, }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_ACCOUNT, tp_dbus_properties_mixin_getter_gobject_properties, NULL, a_props }, { TP_IFACE_ACCOUNT_INTERFACE_STORAGE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, ais_props }, { TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, tp_dbus_properties_mixin_getter_gobject_properties, NULL, aia_props }, { TP_IFACE_ACCOUNT_INTERFACE_AVATAR, tp_dbus_properties_mixin_getter_gobject_properties, NULL, avatar_props }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpTestsSimpleAccountPrivate)); object_class->get_property = tp_tests_simple_account_get_property; object_class->set_property = tp_tests_simple_account_set_property; object_class->finalize = tp_tests_simple_account_finalize; param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "In this case we only implement Account, so none.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_string ("display-name", "display name", "DisplayName property", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISPLAY_NAME, param_spec); param_spec = g_param_spec_string ("icon", "icon", "Icon property", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ICON, param_spec); param_spec = g_param_spec_boolean ("valid", "valid", "Valid property", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_VALID, param_spec); param_spec = g_param_spec_boolean ("enabled", "enabled", "Enabled property", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ENABLED, param_spec); param_spec = g_param_spec_string ("nickname", "nickname", "Nickname property", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NICKNAME, param_spec); param_spec = g_param_spec_boxed ("parameters", "parameters", "Parameters property", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PARAMETERS, param_spec); param_spec = g_param_spec_boxed ("automatic-presence", "automatic presence", "AutomaticPresence property", TP_STRUCT_TYPE_SIMPLE_PRESENCE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AUTOMATIC_PRESENCE, param_spec); param_spec = g_param_spec_boolean ("connect-automatically", "connect automatically", "ConnectAutomatically property", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECT_AUTO, param_spec); param_spec = g_param_spec_boxed ("connection", "connection", "Connection property", DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_uint ("connection-status", "connection status", "ConnectionStatus property", 0, TP_NUM_CONNECTION_STATUSES, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION_STATUS, param_spec); param_spec = g_param_spec_uint ("connection-status-reason", "connection status reason", "ConnectionStatusReason property", 0, TP_NUM_CONNECTION_STATUS_REASONS, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION_STATUS_REASON, param_spec); param_spec = g_param_spec_boxed ("current-presence", "current presence", "CurrentPresence property", TP_STRUCT_TYPE_SIMPLE_PRESENCE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENT_PRESENCE, param_spec); param_spec = g_param_spec_boxed ("requested-presence", "requested presence", "RequestedPresence property", TP_STRUCT_TYPE_SIMPLE_PRESENCE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTED_PRESENCE, param_spec); param_spec = g_param_spec_string ("normalized-name", "normalized name", "NormalizedName property", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NORMALIZED_NAME, param_spec); param_spec = g_param_spec_boolean ("has-been-online", "has been online", "HasBeenOnline property", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HAS_BEEN_ONLINE, param_spec); param_spec = g_param_spec_string ("storage-provider", "storage provider", "StorageProvider property", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STORAGE_PROVIDER, param_spec); param_spec = g_param_spec_boxed ("storage-identifier", "storage identifier", "StorageIdentifier property", G_TYPE_VALUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STORAGE_IDENTIFIER, param_spec); param_spec = g_param_spec_boxed ("storage-specific-information", "storage specific information", "StorageSpecificInformation property", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STORAGE_SPECIFIC_INFORMATION, param_spec); param_spec = g_param_spec_uint ("storage-restrictions", "storage restrictions", "StorageRestrictions property", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STORAGE_RESTRICTIONS, param_spec); param_spec = g_param_spec_boxed ("uri-schemes", "URI schemes", "Some URI schemes", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_URI_SCHEMES, param_spec); param_spec = g_param_spec_boxed ("avatar", "Avatar", "Avatar", TP_STRUCT_TYPE_AVATAR, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVATAR, param_spec); param_spec = g_param_spec_boxed ("supersedes", "Supersedes", "List of superseded accounts", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUPERSEDES, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsSimpleAccountClass, dbus_props_class)); } void tp_tests_simple_account_set_presence (TpTestsSimpleAccount *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { GHashTable *props; GValueArray *v; g_free (self->priv->presence_status); g_free (self->priv->presence_msg); self->priv->presence = presence; self->priv->presence_status = g_strdup (status); self->priv->presence_msg = g_strdup (message); g_object_get (self, "current-presence", &v, NULL); props = tp_asv_new ( "CurrentPresence", TP_STRUCT_TYPE_SIMPLE_PRESENCE, v, NULL); tp_svc_account_emit_account_property_changed (self, props); g_boxed_free (TP_STRUCT_TYPE_SIMPLE_PRESENCE, v); } void tp_tests_simple_account_set_connection (TpTestsSimpleAccount *self, const gchar *object_path) { GHashTable *change; if (object_path == NULL) object_path = "/"; g_free (self->priv->connection_path); self->priv->connection_path = g_strdup (object_path); change = tp_asv_new (NULL, NULL); tp_asv_set_string (change, "Connection", object_path); tp_svc_account_emit_account_property_changed (self, change); g_hash_table_unref (change); } void tp_tests_simple_account_removed (TpTestsSimpleAccount *self) { tp_svc_account_emit_removed (self); } void tp_tests_simple_account_set_enabled (TpTestsSimpleAccount *self, gboolean enabled) { GHashTable *change; self->priv->enabled = enabled; change = tp_asv_new (NULL, NULL); tp_asv_set_boolean (change, "Enabled", enabled); tp_svc_account_emit_account_property_changed (self, change); g_hash_table_unref (change); } void tp_tests_simple_account_add_uri_scheme (TpTestsSimpleAccount *self, const gchar *uri_scheme) { GHashTable *changed; GStrv schemes; g_ptr_array_add (self->priv->uri_schemes, g_strdup (uri_scheme)); g_object_get (self, "uri-schemes", &schemes, NULL); changed = tp_asv_new ( "URISchemes", G_TYPE_STRV, schemes, NULL); tp_svc_dbus_properties_emit_properties_changed (self, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, changed, NULL); g_strfreev (schemes); g_hash_table_unref (changed); } void tp_tests_simple_account_set_avatar (TpTestsSimpleAccount *self, const gchar *avatar) { g_return_if_fail (avatar != NULL); g_array_set_size (self->priv->avatar, 0); /* includes NULL for simplicity */ g_array_append_vals (self->priv->avatar, avatar, strlen (avatar) +1); tp_svc_account_interface_avatar_emit_avatar_changed (self); } telepathy-glib-0.24.2/tests/lib/simple-account.h0000644000175000017500000000466112652510705016450 00000000000000/* * simple-account.h - header for a simple account service. * * Copyright (C) 2010-2012 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_ACCOUNT_H__ #define __TP_TESTS_SIMPLE_ACCOUNT_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleAccount TpTestsSimpleAccount; typedef struct _TpTestsSimpleAccountClass TpTestsSimpleAccountClass; typedef struct _TpTestsSimpleAccountPrivate TpTestsSimpleAccountPrivate; struct _TpTestsSimpleAccountClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpTestsSimpleAccount { GObject parent; TpTestsSimpleAccountPrivate *priv; }; GType tp_tests_simple_account_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_ACCOUNT \ (tp_tests_simple_account_get_type ()) #define TP_TESTS_SIMPLE_ACCOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT, \ TpTestsSimpleAccount)) #define TP_TESTS_SIMPLE_ACCOUNT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_ACCOUNT, \ TpTestsSimpleAccountClass)) #define TP_TESTS_SIMPLE_IS_ACCOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT)) #define TP_TESTS_SIMPLE_IS_ACCOUNT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_ACCOUNT)) #define TP_TESTS_SIMPLE_ACCOUNT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT, \ TpTestsSimpleAccountClass)) void tp_tests_simple_account_set_presence (TpTestsSimpleAccount *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message); void tp_tests_simple_account_set_connection (TpTestsSimpleAccount *self, const gchar *object_path); void tp_tests_simple_account_removed (TpTestsSimpleAccount *self); void tp_tests_simple_account_set_enabled (TpTestsSimpleAccount *self, gboolean enabled); void tp_tests_simple_account_add_uri_scheme (TpTestsSimpleAccount *self, const gchar * uri_scheme); void tp_tests_simple_account_set_avatar (TpTestsSimpleAccount *self, const gchar *avatar); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_ACCOUNT_H__ */ telepathy-glib-0.24.2/tests/lib/simple-channel-request.c0000644000175000017500000003561512652510705020110 00000000000000/* * simple-channel-request.c - simple channel request service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-channel-request.h" #include #include #include #include "tests/lib/util.h" #include "tests/lib/textchan-null.h" static void channel_request_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleChannelRequest, tp_tests_simple_channel_request, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_REQUEST, channel_request_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) ) /* TP_IFACE_CHANNEL_REQUEST is implied */ static const char *CHANNEL_REQUEST_INTERFACES[] = { NULL }; enum { PROP_0, PROP_PATH, PROP_ACCOUNT, PROP_USER_ACTION_TIME, PROP_PREFERRED_HANDLER, PROP_REQUESTS, PROP_CONNECTION, PROP_INTERFACES, PROP_HINTS, }; struct _TpTestsSimpleChannelRequestPrivate { /* D-Bus properties */ gchar *account_path; gint64 user_action_time; gchar *preferred_handler; GPtrArray *requests; GHashTable *hints; /* Our own path */ gchar *path; /* connection used to create channels */ TpTestsSimpleConnection *conn; }; static void handle_channels_cb (TpClient *client, const GError *error, gpointer user_data, GObject *weak_object) { TpTestsSimpleChannelRequest *self = SIMPLE_CHANNEL_REQUEST (weak_object); if (error != NULL) { tp_svc_channel_request_emit_failed (self, tp_error_get_dbus_name (error->code), error->message); return; } tp_svc_channel_request_emit_succeeded (self); } static void add_channel (TpTestsSimpleChannelRequest *self, GPtrArray *channels) { const gchar *target_id; gchar *chan_path; GHashTable *request; GHashTable *props; const char *chan_type; request = g_ptr_array_index (self->priv->requests, 0); chan_type = tp_asv_get_string (request, TP_PROP_CHANNEL_CHANNEL_TYPE); if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT)) { target_id = tp_asv_get_string (request, TP_PROP_CHANNEL_TARGET_ID); g_assert (target_id != NULL); chan_path = tp_tests_simple_connection_ensure_text_chan (self->priv->conn, target_id, &props); } else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_ROOM_LIST)) { chan_path = tp_tests_simple_connection_ensure_room_list_chan ( self->priv->conn, tp_asv_get_string (request, TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER), &props); } else { g_assert_not_reached (); } g_ptr_array_add (channels, tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, chan_path, TP_HASH_TYPE_STRING_VARIANT_MAP, props, G_TYPE_INVALID)); g_free (chan_path); g_hash_table_unref (props); } static void free_channel_details (gpointer data, gpointer user_data) { g_boxed_free (TP_STRUCT_TYPE_CHANNEL_DETAILS, data); } GHashTable * tp_tests_simple_channel_request_dup_immutable_props ( TpTestsSimpleChannelRequest *self) { return tp_asv_new ( TP_PROP_CHANNEL_REQUEST_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, self->priv->account_path, TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME, G_TYPE_INT64, self->priv->user_action_time, TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER, G_TYPE_STRING, self->priv->preferred_handler, TP_PROP_CHANNEL_REQUEST_REQUESTS, TP_ARRAY_TYPE_CHANNEL_CLASS_LIST, self->priv->requests, TP_PROP_CHANNEL_REQUEST_INTERFACES, G_TYPE_STRV, NULL, TP_PROP_CHANNEL_REQUEST_HINTS, TP_HASH_TYPE_STRING_VARIANT_MAP, self->priv->hints, NULL); } static void tp_tests_simple_channel_request_proceed (TpSvcChannelRequest *request, DBusGMethodInvocation *context) { TpTestsSimpleChannelRequest *self = SIMPLE_CHANNEL_REQUEST (request); TpClient *client; TpDBusDaemon *dbus; gchar *client_path; GPtrArray *channels; GPtrArray *satisfied; GHashTable *info; TpBaseConnection *base_conn = (TpBaseConnection *) self->priv->conn; GHashTable *req; GHashTable *request_props; req = g_ptr_array_index (self->priv->requests, 0); g_assert (req != NULL); if (tp_asv_get_boolean (req, "ProceedFail", NULL)) { /* We have been asked to fail */ GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Computer says no" }; dbus_g_method_return_error (context, &error); return; } tp_svc_channel_request_return_from_proceed (context); if (tp_asv_get_boolean (req, "FireFailed", NULL)) { /* We have been asked to fire the 'Failed' signal */ tp_svc_channel_request_emit_failed (self, TP_ERROR_STR_INVALID_ARGUMENT, "Let's fail!"); return; } /* We just support handling request having a preferred handler */ if (self->priv->preferred_handler == NULL || !tp_strdiff (self->priv->preferred_handler, "")) { tp_svc_channel_request_emit_failed (self, TP_ERROR_STR_NOT_AVAILABLE, "ChannelRequest doesn't have a preferred handler"); return; } if (!tp_strdiff (self->priv->preferred_handler, "Fake")) { /* Pretend that the channel has been handled */ GHashTable *props; props = g_hash_table_new (NULL, NULL); tp_svc_channel_request_emit_succeeded_with_channel (self, tp_base_connection_get_object_path (base_conn), props, "/chan", props); tp_svc_channel_request_emit_succeeded (self); g_hash_table_unref (props); return; } else if (!tp_strdiff (self->priv->preferred_handler, "FakeNoChannel")) { /* Pretend that the channel has been handled but only fire the old * Succeeded signal. */ tp_svc_channel_request_emit_succeeded (self); return; } /* Call HandleChannels() on the preferred handler */ client_path = g_strdelimit (g_strdup_printf ("/%s", self->priv->preferred_handler), ".", '/'); dbus = tp_dbus_daemon_dup (NULL); g_assert (dbus != NULL); client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", dbus, "bus-name", self->priv->preferred_handler, "object-path", client_path, NULL); tp_proxy_add_interface_by_id (TP_PROXY (client), TP_IFACE_QUARK_CLIENT); tp_proxy_add_interface_by_id (TP_PROXY (client), TP_IFACE_QUARK_CLIENT_HANDLER); channels = g_ptr_array_sized_new (1); add_channel (self, channels); satisfied = g_ptr_array_sized_new (1); g_ptr_array_add (satisfied, self->priv->path); request_props = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); g_hash_table_insert (request_props, g_strdup (self->priv->path), tp_tests_simple_channel_request_dup_immutable_props (self)); info = tp_asv_new ( "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_props, NULL); tp_cli_client_handler_call_handle_channels (client, -1, self->priv->account_path, tp_base_connection_get_object_path (base_conn), channels, satisfied, self->priv->user_action_time, info, handle_channels_cb, NULL, NULL, G_OBJECT (self)); g_free (client_path); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (satisfied); g_hash_table_unref (info); g_hash_table_unref (request_props); g_object_unref (dbus); g_object_unref (client); } static void tp_tests_simple_channel_request_cancel (TpSvcChannelRequest *request, DBusGMethodInvocation *context) { tp_svc_channel_request_emit_failed (request, TP_ERROR_STR_CANCELLED, "ChannelRequest has been cancelled"); tp_svc_channel_request_return_from_cancel (context); } static void channel_request_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_channel_request_implement_##x (\ klass, tp_tests_simple_channel_request_##x) IMPLEMENT (proceed); IMPLEMENT (cancel); #undef IMPLEMENT } static void tp_tests_simple_channel_request_init (TpTestsSimpleChannelRequest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST, TpTestsSimpleChannelRequestPrivate); } static void tp_tests_simple_channel_request_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsSimpleChannelRequest *self = SIMPLE_CHANNEL_REQUEST (object); switch (property_id) { case PROP_PATH: g_value_set_string (value, self->priv->path); break; case PROP_ACCOUNT: g_value_set_string (value, self->priv->account_path); break; case PROP_USER_ACTION_TIME: g_value_set_int64 (value, self->priv->user_action_time); break; case PROP_PREFERRED_HANDLER: g_value_set_string (value, self->priv->preferred_handler); break; case PROP_REQUESTS: g_value_set_boxed (value, self->priv->requests); break; case PROP_INTERFACES: g_value_set_boxed (value, CHANNEL_REQUEST_INTERFACES); break; case PROP_HINTS: g_value_set_boxed (value, self->priv->hints); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_channel_request_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { TpTestsSimpleChannelRequest *self = SIMPLE_CHANNEL_REQUEST (object); switch (property_id) { case PROP_PATH: self->priv->path = g_value_dup_string (value); break; case PROP_ACCOUNT: self->priv->account_path = g_value_dup_string (value); break; case PROP_USER_ACTION_TIME: self->priv->user_action_time = g_value_get_int64 (value); break; case PROP_PREFERRED_HANDLER: self->priv->preferred_handler = g_value_dup_string (value); break; case PROP_REQUESTS: self->priv->requests = g_value_dup_boxed (value); break; case PROP_CONNECTION: self->priv->conn = g_value_dup_object (value); break; case PROP_HINTS: self->priv->hints = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_channel_request_dispose (GObject *object) { TpTestsSimpleChannelRequest *self = SIMPLE_CHANNEL_REQUEST (object); g_free (self->priv->path); g_free (self->priv->account_path); g_free (self->priv->preferred_handler); if (self->priv->requests != NULL) { g_boxed_free (TP_ARRAY_TYPE_CHANNEL_CLASS_LIST, self->priv->requests); self->priv->requests = NULL; } tp_clear_object (&self->priv->conn); tp_clear_pointer (&self->priv->hints, g_hash_table_unref); if (G_OBJECT_CLASS (tp_tests_simple_channel_request_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_tests_simple_channel_request_parent_class)->dispose (object); } static void tp_tests_simple_channel_request_class_init ( TpTestsSimpleChannelRequestClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl am_props[] = { { "Interfaces", "interfaces", NULL }, { "Hints", "hints", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_REQUEST, tp_dbus_properties_mixin_getter_gobject_properties, NULL, am_props }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpTestsSimpleChannelRequestPrivate)); object_class->get_property = tp_tests_simple_channel_request_get_property; object_class->set_property = tp_tests_simple_channel_request_set_property; object_class->dispose = tp_tests_simple_channel_request_dispose; param_spec = g_param_spec_string ("path", "Path", "Path of this ChannelRequest", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PATH, param_spec); param_spec = g_param_spec_string ("account", "Account", "Path of the Account", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_int64 ("user-action-time", "UserActionTime", "UserActionTime", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, param_spec); param_spec = g_param_spec_string ("preferred-handler", "PreferredHandler", "PreferredHandler", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PREFERRED_HANDLER, param_spec); param_spec = g_param_spec_boxed ("requests", "Requests", "Requests", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTS, param_spec); param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "In this case we only implement ChannelRequest, so none.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_object ("connection", "TpBaseConnection", "connection to use when creating channels", TP_TYPE_BASE_CONNECTION, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_boxed ("hints", "Hints", "Metadata provided by the channel's requester, if any", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HINTS, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsSimpleChannelRequestClass, dbus_props_class)); } TpTestsSimpleChannelRequest * tp_tests_simple_channel_request_new (const gchar *path, TpTestsSimpleConnection *conn, const gchar *account_path, gint64 user_action_time, const gchar *preferred_handler, GPtrArray *requests, GHashTable *hints) { return tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST, "path", path, "connection", conn, "account", account_path, "user-action-time", user_action_time, "preferred-handler", preferred_handler, "requests", requests, "hints", hints, NULL); } telepathy-glib-0.24.2/tests/lib/simple-channel-request.h0000644000175000017500000000453712652510705020114 00000000000000/* * simple-channel-request.h - header for a simple channel request service. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CHANNEL_REQUEST_H__ #define __TP_TESTS_SIMPLE_CHANNEL_REQUEST_H__ #include #include #include "simple-conn.h" G_BEGIN_DECLS typedef struct _TpTestsSimpleChannelRequest TpTestsSimpleChannelRequest; typedef struct _TpTestsSimpleChannelRequestClass TpTestsSimpleChannelRequestClass; typedef struct _TpTestsSimpleChannelRequestPrivate TpTestsSimpleChannelRequestPrivate; struct _TpTestsSimpleChannelRequestClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpTestsSimpleChannelRequest { GObject parent; TpTestsSimpleChannelRequestPrivate *priv; }; GType tp_tests_simple_channel_request_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST \ (tp_tests_simple_channel_request_get_type ()) #define SIMPLE_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST, \ TpTestsSimpleChannelRequest)) #define SIMPLE_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST, \ TpTestsSimpleChannelRequestClass)) #define SIMPLE_IS_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST)) #define SIMPLE_IS_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST)) #define SIMPLE_CHANNEL_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CHANNEL_REQUEST, \ TpTestsSimpleChannelRequestClass)) TpTestsSimpleChannelRequest * tp_tests_simple_channel_request_new (const gchar *path, TpTestsSimpleConnection *conn, const gchar *account_path, gint64 user_action_time, const gchar *preferred_handler, GPtrArray *requests, GHashTable *hints); GHashTable * tp_tests_simple_channel_request_dup_immutable_props ( TpTestsSimpleChannelRequest *self); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CHANNEL_REQUEST_H__ */ telepathy-glib-0.24.2/tests/lib/broken-client-types-conn.c0000644000175000017500000000374112652510705020347 00000000000000/* * broken-client-types-conn.c - a connection with a broken client * types implementation which inexplicably returns presence information! * * Copyright © 2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "broken-client-types-conn.h" #include #include G_DEFINE_TYPE_WITH_CODE (TpTestsBrokenClientTypesConnection, tp_tests_broken_client_types_connection, TP_TESTS_TYPE_CONTACTS_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CLIENT_TYPES, NULL); ); static void tp_tests_broken_client_types_connection_init ( TpTestsBrokenClientTypesConnection *self) { } static void broken_fill_client_types ( GObject *object, const GArray *contacts, GHashTable *attributes) { guint i; G_GNUC_BEGIN_IGNORE_DEPRECATIONS GType type = G_TYPE_VALUE_ARRAY; G_GNUC_END_IGNORE_DEPRECATIONS for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); /* Muahaha. Actually we add SimplePresence information. */ GValueArray *presence = tp_value_array_build (3, G_TYPE_UINT, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, G_TYPE_STRING, "available", G_TYPE_STRING, "hi mum!", G_TYPE_INVALID); tp_contacts_mixin_set_contact_attribute (attributes, handle, TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE, tp_g_value_slice_new_take_boxed (type, presence)); } } static void tp_tests_broken_client_types_connection_class_init ( TpTestsBrokenClientTypesConnectionClass *klass) { TpTestsContactsConnectionClass *cc_class = TP_TESTS_CONTACTS_CONNECTION_CLASS (klass); cc_class->fill_client_types = broken_fill_client_types; } telepathy-glib-0.24.2/tests/lib/broken-client-types-conn.h0000644000175000017500000000427112652510705020353 00000000000000/* * broken-client-types-conn.h - header for a connection with a broken client * types implementation which inexplicably returns presence information! * * Copyright © 2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef TP_TESTS_BROKEN_CLIENT_TYPES_CONN_H #define TP_TESTS_BROKEN_CLIENT_TYPES_CONN_H #include "contacts-conn.h" typedef struct _TpTestsBrokenClientTypesConnection TpTestsBrokenClientTypesConnection; typedef struct _TpTestsBrokenClientTypesConnectionClass TpTestsBrokenClientTypesConnectionClass; typedef struct _TpTestsBrokenClientTypesConnectionPrivate TpTestsBrokenClientTypesConnectionPrivate; struct _TpTestsBrokenClientTypesConnectionClass { TpTestsContactsConnectionClass parent_class; }; struct _TpTestsBrokenClientTypesConnection { TpTestsContactsConnection parent; TpTestsBrokenClientTypesConnectionPrivate *priv; }; GType tp_tests_broken_client_types_connection_get_type (void); /* HI MUM */ #define TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION \ (tp_tests_broken_client_types_connection_get_type ()) #define TP_TESTS_BROKEN_CLIENT_TYPES_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION, \ TpTestsBrokenClientTypesConnection)) #define TP_TESTS_BROKEN_CLIENT_TYPES_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION, \ TpTestsBrokenClientTypesConnectionClass)) #define TP_TESTS_IS_BROKEN_CLIENT_TYPES_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION)) #define TP_TESTS_IS_BROKEN_CLIENT_TYPES_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION)) #define TP_TESTS_BROKEN_CLIENT_TYPES_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION, \ TpTestsBrokenClientTypesConnectionClass)) #endif // TP_TESTS_BROKEN_CLIENT_TYPES_CONN_H telepathy-glib-0.24.2/tests/lib/simple-manager.c0000644000175000017500000000456112652510705016420 00000000000000/* * simple-manager.c - an simple connection manager * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-manager.h" #include #include #include #include "simple-conn.h" #include "tests/lib/util.h" G_DEFINE_TYPE (TpTestsSimpleConnectionManager, tp_tests_simple_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) /* type definition stuff */ static void tp_tests_simple_connection_manager_init (TpTestsSimpleConnectionManager *self) { } /* private data */ typedef struct { gchar *account; } TpTestsSimpleParams; static const TpCMParamSpec simple_params[] = { { "account", DBUS_TYPE_STRING_AS_STRING, G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, G_STRUCT_OFFSET (TpTestsSimpleParams, account), tp_cm_param_filter_string_nonempty, NULL }, { NULL } }; static gpointer alloc_params (void) { return g_slice_new0 (TpTestsSimpleParams); } static void free_params (gpointer p) { TpTestsSimpleParams *params = p; g_free (params->account); g_slice_free (TpTestsSimpleParams, params); } static const TpCMProtocolSpec simple_protocols[] = { { "simple", simple_params, alloc_params, free_params }, { NULL, NULL } }; static TpBaseConnection * new_connection (TpBaseConnectionManager *self, const gchar *proto, TpIntset *params_present, gpointer parsed_params, GError **error) { TpTestsSimpleParams *params = parsed_params; TpTestsSimpleConnection *conn = TP_TESTS_SIMPLE_CONNECTION ( tp_tests_object_new_static_class (TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", params->account, "protocol", proto, NULL)); return (TpBaseConnection *) conn; } static void tp_tests_simple_connection_manager_class_init ( TpTestsSimpleConnectionManagerClass *klass) { TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; base_class->new_connection = new_connection; base_class->cm_dbus_name = "simple"; base_class->protocol_params = simple_protocols; } telepathy-glib-0.24.2/tests/lib/simple-manager.h0000644000175000017500000000436612652510705016430 00000000000000/* * simple-manager.h - header for a simple connection manager * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_CONNECTION_MANAGER_H__ #define __TP_TESTS_SIMPLE_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleConnectionManager TpTestsSimpleConnectionManager; typedef struct _TpTestsSimpleConnectionManagerPrivate TpTestsSimpleConnectionManagerPrivate; typedef struct _TpTestsSimpleConnectionManagerClass TpTestsSimpleConnectionManagerClass; typedef struct _TpTestsSimpleConnectionManagerClassPrivate TpTestsSimpleConnectionManagerClassPrivate; struct _TpTestsSimpleConnectionManagerClass { TpBaseConnectionManagerClass parent_class; TpTestsSimpleConnectionManagerClassPrivate *priv; }; struct _TpTestsSimpleConnectionManager { TpBaseConnectionManager parent; TpTestsSimpleConnectionManagerPrivate *priv; }; GType tp_tests_simple_connection_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER \ (tp_tests_simpleconnection_manager_get_type ()) #define TP_TESTS_SIMPLE_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER, \ simpleConnectionManager)) #define TP_TESTS_SIMPLE_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER, \ TpTestsSimpleConnectionManagerClass)) #define TP_TESTS_SIMPLE_IS_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER)) #define TP_TESTS_SIMPLE_IS_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER)) #define TP_TESTS_SIMPLE_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_CONNECTION_MANAGER, \ TpTestsSimpleConnectionManagerClass)) G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_CONNECTION_MANAGER_H__*/ telepathy-glib-0.24.2/tests/lib/room-list-chan.c0000644000175000017500000001443512652510705016354 00000000000000 #include "config.h" #include "room-list-chan.h" #include static void room_list_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (TpTestsRoomListChan, tp_tests_room_list_chan, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_ROOM_LIST, room_list_iface_init)) enum { PROP_SERVER = 1, LAST_PROPERTY, }; /* enum { LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; */ struct _TpTestsRoomListChanPriv { gchar *server; gboolean listing; }; static void tp_tests_room_list_chan_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (object); switch (property_id) { case PROP_SERVER: g_value_set_string (value, self->priv->server); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tests_room_list_chan_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (object); switch (property_id) { case PROP_SERVER: g_assert (self->priv->server == NULL); /* construct only */ self->priv->server = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tests_room_list_chan_constructed (GObject *object) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tests_room_list_chan_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_base_channel_register (TP_BASE_CHANNEL (self)); } static void tp_tests_room_list_chan_finalize (GObject *object) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tests_room_list_chan_parent_class)->finalize; g_free (self->priv->server); if (chain_up != NULL) chain_up (object); } static void fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_room_list_chan_parent_class); klass->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, "Server", NULL); } static void room_list_chan_close (TpBaseChannel *channel) { tp_base_channel_destroyed (channel); } static void tp_tests_room_list_chan_class_init ( TpTestsRoomListChanClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *spec; static TpDBusPropertiesMixinPropImpl room_list_props[] = { { "Server", "server", NULL, }, { NULL } }; oclass->get_property = tp_tests_room_list_chan_get_property; oclass->set_property = tp_tests_room_list_chan_set_property; oclass->constructed = tp_tests_room_list_chan_constructed; oclass->finalize = tp_tests_room_list_chan_finalize; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_ROOM_LIST; base_class->target_handle_type = TP_HANDLE_TYPE_NONE; base_class->fill_immutable_properties = fill_immutable_properties; base_class->close = room_list_chan_close; spec = g_param_spec_string ("server", "server", "Server", "", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_SERVER, spec); tp_dbus_properties_mixin_implement_interface (oclass, TP_IFACE_QUARK_CHANNEL_TYPE_ROOM_LIST, tp_dbus_properties_mixin_getter_gobject_properties, NULL, room_list_props); g_type_class_add_private (klass, sizeof (TpTestsRoomListChanPriv)); } static void tp_tests_room_list_chan_init (TpTestsRoomListChan *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_ROOM_LIST_CHAN, TpTestsRoomListChanPriv); } static void add_room (GPtrArray *rooms) { GHashTable *hash; hash = tp_asv_new ( "handle-name", G_TYPE_STRING, "the handle name", "name", G_TYPE_STRING, "the name", "description", G_TYPE_STRING, "the description", "subject", G_TYPE_STRING, "the subject", "members", G_TYPE_UINT, 10, "password", G_TYPE_BOOLEAN, TRUE, "invite-only", G_TYPE_BOOLEAN, TRUE, "room-id", G_TYPE_STRING, "the room id", "server", G_TYPE_STRING, "the server", NULL); g_ptr_array_add (rooms, tp_value_array_build (3, G_TYPE_UINT, 0, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HASH_TYPE_STRING_VARIANT_MAP, hash, G_TYPE_INVALID)); g_hash_table_unref (hash); } static gboolean find_rooms (gpointer data) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (data); GPtrArray *rooms; rooms = g_ptr_array_new_with_free_func ((GDestroyNotify) tp_value_array_free); /* Find 2 rooms */ add_room (rooms); add_room (rooms); tp_svc_channel_type_room_list_emit_got_rooms (self, rooms); g_ptr_array_set_size (rooms, 0); /* Find 1 room */ add_room (rooms); tp_svc_channel_type_room_list_emit_got_rooms (self, rooms); g_ptr_array_unref (rooms); return FALSE; } static void room_list_list_rooms (TpSvcChannelTypeRoomList *chan, DBusGMethodInvocation *context) { TpTestsRoomListChan *self = TP_TESTS_ROOM_LIST_CHAN (chan); if (self->priv->listing) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Already listing" }; dbus_g_method_return_error (context, &error); return; } if (!tp_strdiff (self->priv->server, "ListRoomsFail")) { GError error = { TP_ERROR, TP_ERROR_SERVICE_CONFUSED, "Computer says no" }; dbus_g_method_return_error (context, &error); return; } self->priv->listing = TRUE; tp_svc_channel_type_room_list_emit_listing_rooms (self, TRUE); g_idle_add (find_rooms, self); tp_svc_channel_type_room_list_return_from_list_rooms (context); } static void room_list_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeRoomListClass *klass = iface; #define IMPLEMENT(x) \ tp_svc_channel_type_room_list_implement_##x (klass, room_list_##x) IMPLEMENT(list_rooms); #undef IMPLEMENT } telepathy-glib-0.24.2/tests/lib/room-list-chan.h0000644000175000017500000000270012652510705016351 00000000000000 #ifndef __TP_TESTS_ROOM_LIST_CHAN_H__ #define __TP_TESTS_ROOM_LIST_CHAN_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsRoomListChan TpTestsRoomListChan; typedef struct _TpTestsRoomListChanClass TpTestsRoomListChanClass; typedef struct _TpTestsRoomListChanPriv TpTestsRoomListChanPriv; struct _TpTestsRoomListChanClass { TpBaseChannelClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsRoomListChan { TpBaseChannel parent; TpTestsRoomListChanPriv *priv; }; GType tp_tests_room_list_chan_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_ROOM_LIST_CHAN \ (tp_tests_room_list_chan_get_type ()) #define TP_TESTS_ROOM_LIST_CHAN(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TESTS_TYPE_ROOM_LIST_CHAN, \ TpTestsRoomListChan)) #define TP_TESTS_ROOM_LIST_CHAN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TESTS_TYPE_ROOM_LIST_CHAN, \ TpTestsRoomListChanClass)) #define TP_TESTS_IS_ROOM_LIST_CHAN(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ TP_TESTS_TYPE_ROOM_LIST_CHAN)) #define TP_TESTS_IS_ROOM_LIST_CHAN_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ TP_TESTS_TYPE_ROOM_LIST_CHAN)) #define TP_TESTS_ROOM_LIST_CHAN_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TESTS_TYPE_ROOM_LIST_CHAN, \ TpTestsRoomListChanClass)) G_END_DECLS #endif /* #ifndef __TP_TESTS_ROOM_LIST_CHAN_H__*/ telepathy-glib-0.24.2/tests/lib/simple-account-manager.c0000644000175000017500000001677412652510705020063 00000000000000/* * simple-account-manager.c - a simple account manager service. * * Copyright (C) 2007-2012 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "simple-account-manager.h" #include #include static void account_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (TpTestsSimpleAccountManager, tp_tests_simple_account_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_ACCOUNT_MANAGER, account_manager_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) ) /* TP_IFACE_ACCOUNT_MANAGER is implied */ static const char *ACCOUNT_MANAGER_INTERFACES[] = { NULL }; enum { PROP_0, PROP_INTERFACES, PROP_VALID_ACCOUNTS, PROP_INVALID_ACCOUNTS, }; struct _TpTestsSimpleAccountManagerPrivate { GPtrArray *valid_accounts; GPtrArray *invalid_accounts; }; static void tp_tests_simple_account_manager_create_account (TpSvcAccountManager *svc, const gchar *in_Connection_Manager, const gchar *in_Protocol, const gchar *in_Display_Name, GHashTable *in_Parameters, GHashTable *in_Properties, DBusGMethodInvocation *context) { TpTestsSimpleAccountManager *self = (TpTestsSimpleAccountManager *) svc; const gchar *out = TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/lospolloshermanos"; /* if we have fail=yes as a parameter, make the call fail */ if (!tp_strdiff (tp_asv_get_string (in_Parameters, "fail"), "yes")) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "loldongs" }; dbus_g_method_return_error (context, &e); return; } self->create_cm = g_strdup (in_Connection_Manager); self->create_protocol = g_strdup (in_Protocol); self->create_display_name = g_strdup (in_Display_Name); self->create_parameters = g_hash_table_ref (in_Parameters); self->create_properties = g_hash_table_ref (in_Properties); tp_svc_account_manager_return_from_create_account (context, out); } static void account_manager_iface_init (gpointer klass, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_account_manager_implement_##x (\ klass, tp_tests_simple_account_manager_##x) IMPLEMENT (create_account); #undef IMPLEMENT } static void tp_tests_simple_account_manager_init (TpTestsSimpleAccountManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, TpTestsSimpleAccountManagerPrivate); self->priv->valid_accounts = g_ptr_array_new_with_free_func (g_free); self->priv->invalid_accounts = g_ptr_array_new_with_free_func (g_free); } static void tp_tests_simple_account_manager_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { TpTestsSimpleAccountManager *self = SIMPLE_ACCOUNT_MANAGER (object); switch (property_id) { case PROP_INTERFACES: g_value_set_boxed (value, ACCOUNT_MANAGER_INTERFACES); break; case PROP_VALID_ACCOUNTS: g_value_set_boxed (value, self->priv->valid_accounts); break; case PROP_INVALID_ACCOUNTS: g_value_set_boxed (value, self->priv->invalid_accounts); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); break; } } static void tp_tests_simple_account_manager_finalize (GObject *object) { TpTestsSimpleAccountManager *self = SIMPLE_ACCOUNT_MANAGER (object); g_ptr_array_unref (self->priv->valid_accounts); g_ptr_array_unref (self->priv->invalid_accounts); tp_clear_pointer (&self->create_cm, g_free); tp_clear_pointer (&self->create_protocol, g_free); tp_clear_pointer (&self->create_display_name, g_free); tp_clear_pointer (&self->create_parameters, g_hash_table_unref); tp_clear_pointer (&self->create_properties, g_hash_table_unref); G_OBJECT_CLASS (tp_tests_simple_account_manager_parent_class)->finalize ( object); } /** * This class currently only provides the minimum for * tp_account_manager_prepare to succeed. This turns out to be only a working * Properties.GetAll(). If we wanted later to check the case where * tp_account_prepare succeeds, we would need to implement an account object * too. */ static void tp_tests_simple_account_manager_class_init ( TpTestsSimpleAccountManagerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl am_props[] = { { "Interfaces", "interfaces", NULL }, { "ValidAccounts", "valid-accounts", NULL }, { "InvalidAccounts", "invalid-accounts", NULL }, /* { "SupportedAccountProperties", "supported-account-properties", NULL }, */ { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_ACCOUNT_MANAGER, tp_dbus_properties_mixin_getter_gobject_properties, NULL, am_props }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpTestsSimpleAccountManagerPrivate)); object_class->finalize = tp_tests_simple_account_manager_finalize; object_class->get_property = tp_tests_simple_account_manager_get_property; param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "In this case we only implement AccountManager, so none.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_boxed ("valid-accounts", "Valid accounts", "The accounts which are valid on this account. This may be a lie.", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_VALID_ACCOUNTS, param_spec); param_spec = g_param_spec_boxed ("invalid-accounts", "Invalid accounts", "The accounts which are invalid on this account. This may be a lie.", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE); g_object_class_install_property (object_class, PROP_INVALID_ACCOUNTS, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpTestsSimpleAccountManagerClass, dbus_props_class)); } static void remove_from_array (GPtrArray *array, const gchar *str) { guint i; for (i = 0; i < array->len; i++) if (!tp_strdiff (str, g_ptr_array_index (array, i))) { g_ptr_array_remove_index_fast (array, i); return; } } void tp_tests_simple_account_manager_add_account ( TpTestsSimpleAccountManager *self, const gchar *object_path, gboolean valid) { remove_from_array (self->priv->valid_accounts, object_path); remove_from_array (self->priv->valid_accounts, object_path); if (valid) g_ptr_array_add (self->priv->valid_accounts, g_strdup (object_path)); else g_ptr_array_add (self->priv->invalid_accounts, g_strdup (object_path)); tp_svc_account_manager_emit_account_validity_changed (self, object_path, valid); } void tp_tests_simple_account_manager_remove_account ( TpTestsSimpleAccountManager *self, const gchar *object_path) { remove_from_array (self->priv->valid_accounts, object_path); remove_from_array (self->priv->valid_accounts, object_path); tp_svc_account_manager_emit_account_removed (self, object_path); } telepathy-glib-0.24.2/tests/lib/simple-account-manager.h0000644000175000017500000000470312652510705020055 00000000000000/* * simple-account-manager.h - header for a simple account manager service. * * Copyright (C) 2007-2012 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_TESTS_SIMPLE_ACCOUNT_MANAGER_H__ #define __TP_TESTS_SIMPLE_ACCOUNT_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _TpTestsSimpleAccountManager TpTestsSimpleAccountManager; typedef struct _TpTestsSimpleAccountManagerClass TpTestsSimpleAccountManagerClass; typedef struct _TpTestsSimpleAccountManagerPrivate TpTestsSimpleAccountManagerPrivate; struct _TpTestsSimpleAccountManagerClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpTestsSimpleAccountManager { GObject parent; gchar *create_cm; gchar *create_protocol; gchar *create_display_name; GHashTable *create_parameters; GHashTable *create_properties; TpTestsSimpleAccountManagerPrivate *priv; }; GType tp_tests_simple_account_manager_get_type (void); /* TYPE MACROS */ #define TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER \ (tp_tests_simple_account_manager_get_type ()) #define SIMPLE_ACCOUNT_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, \ TpTestsSimpleAccountManager)) #define SIMPLE_ACCOUNT_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, \ TpTestsSimpleAccountManagerClass)) #define SIMPLE_IS_ACCOUNT_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER)) #define SIMPLE_IS_ACCOUNT_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER)) #define SIMPLE_ACCOUNT_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, \ TpTestsSimpleAccountManagerClass)) void tp_tests_simple_account_manager_add_account ( TpTestsSimpleAccountManager *self, const gchar *object_path, gboolean valid); void tp_tests_simple_account_manager_remove_account ( TpTestsSimpleAccountManager *self, const gchar *object_path); G_END_DECLS #endif /* #ifndef __TP_TESTS_SIMPLE_ACCOUNT_MANAGER_H__ */ telepathy-glib-0.24.2/tests/lib/stream-tube-chan.c0000644000175000017500000004330312652510705016653 00000000000000/* * stream-tube-chan.c - Simple stream tube channel * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "config.h" #include "stream-tube-chan.h" #include "util.h" #include #ifdef HAVE_GIO_UNIX #include #include #endif #include enum { PROP_SERVICE = 1, PROP_SUPPORTED_SOCKET_TYPES, PROP_PARAMETERS, PROP_STATE, }; enum { SIG_INCOMING_CONNECTION, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = {0, }; struct _TpTestsStreamTubeChannelPrivate { TpTubeChannelState state; GHashTable *supported_socket_types; /* Accepting side */ GSocketService *service; GValue *access_control_param; /* Offering side */ TpSocketAddressType address_type; GValue *address; gchar *unix_address; gchar *unix_tmpdir; guint connection_id; TpSocketAccessControl access_control; }; static void create_supported_socket_types (TpTestsStreamTubeChannel *self) { TpSocketAccessControl access_control; GArray *unix_tab; g_assert (self->priv->supported_socket_types == NULL); self->priv->supported_socket_types = g_hash_table_new_full (NULL, NULL, NULL, _tp_destroy_socket_control_list); /* Socket_Address_Type_Unix */ unix_tab = g_array_sized_new (FALSE, FALSE, sizeof (TpSocketAccessControl), 1); access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST; g_array_append_val (unix_tab, access_control); g_hash_table_insert (self->priv->supported_socket_types, GUINT_TO_POINTER (TP_SOCKET_ADDRESS_TYPE_UNIX), unix_tab); } static void tp_tests_stream_tube_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTestsStreamTubeChannel *self = (TpTestsStreamTubeChannel *) object; switch (property_id) { case PROP_SERVICE: g_value_set_string (value, "test-service"); break; case PROP_SUPPORTED_SOCKET_TYPES: g_value_set_boxed (value, self->priv->supported_socket_types); break; case PROP_PARAMETERS: g_value_take_boxed (value, tp_asv_new ( "badger", G_TYPE_UINT, 42, NULL)); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tests_stream_tube_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTestsStreamTubeChannel *self = (TpTestsStreamTubeChannel *) object; switch (property_id) { case PROP_SUPPORTED_SOCKET_TYPES: self->priv->supported_socket_types = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void stream_tube_iface_init (gpointer iface, gpointer data); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpTestsStreamTubeChannel, tp_tests_stream_tube_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_STREAM_TUBE, stream_tube_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_TUBE, NULL); ) /* type definition stuff */ static GPtrArray * tp_tests_stream_tube_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( tp_tests_stream_tube_channel_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_TUBE); return interfaces; }; static void tp_tests_stream_tube_channel_init (TpTestsStreamTubeChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL, TpTestsStreamTubeChannelPrivate); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (tp_tests_stream_tube_channel_parent_class)->constructor ( type, n_props, props); TpTestsStreamTubeChannel *self = TP_TESTS_STREAM_TUBE_CHANNEL (object); if (tp_base_channel_is_requested (TP_BASE_CHANNEL (self))) self->priv->state = TP_TUBE_CHANNEL_STATE_NOT_OFFERED; else self->priv->state = TP_TUBE_CHANNEL_STATE_LOCAL_PENDING; if (self->priv->supported_socket_types == NULL) create_supported_socket_types (self); tp_base_channel_register (TP_BASE_CHANNEL (self)); return object; } static void dispose (GObject *object) { TpTestsStreamTubeChannel *self = (TpTestsStreamTubeChannel *) object; if (self->priv->service != NULL) { g_socket_service_stop (self->priv->service); tp_clear_object (&self->priv->service); } tp_clear_pointer (&self->priv->address, tp_g_value_slice_free); tp_clear_pointer (&self->priv->supported_socket_types, g_hash_table_unref); tp_clear_pointer (&self->priv->access_control_param, tp_g_value_slice_free); if (self->priv->unix_address != NULL) g_unlink (self->priv->unix_address); tp_clear_pointer (&self->priv->unix_address, g_free); if (self->priv->unix_tmpdir != NULL) g_rmdir (self->priv->unix_tmpdir); tp_clear_pointer (&self->priv->unix_tmpdir, g_free); ((GObjectClass *) tp_tests_stream_tube_channel_parent_class)->dispose ( object); } static void channel_close (TpBaseChannel *channel) { tp_base_channel_destroyed (channel); } static void fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_tests_stream_tube_channel_parent_class); klass->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "Service", TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, "SupportedSocketTypes", NULL); if (!tp_base_channel_is_requested (chan)) { /* Parameters is immutable only for incoming tubes */ tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_INTERFACE_TUBE, "Parameters", NULL); } } static void tp_tests_stream_tube_channel_class_init (TpTestsStreamTubeChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl stream_tube_props[] = { { "Service", "service", NULL, }, { "SupportedSocketTypes", "supported-socket-types", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl tube_props[] = { { "Parameters", "parameters", NULL, }, { "State", "state", NULL, }, { NULL } }; object_class->constructor = constructor; object_class->get_property = tp_tests_stream_tube_channel_get_property; object_class->set_property = tp_tests_stream_tube_channel_set_property; object_class->dispose = dispose; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_STREAM_TUBE; base_class->get_interfaces = tp_tests_stream_tube_channel_get_interfaces; base_class->close = channel_close; base_class->fill_immutable_properties = fill_immutable_properties; /* base_class->target_handle_type is defined in subclasses */ param_spec = g_param_spec_string ("service", "service name", "the service associated with this tube object.", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE, param_spec); param_spec = g_param_spec_boxed ( "supported-socket-types", "Supported socket types", "GHashTable containing supported socket types.", TP_HASH_TYPE_SUPPORTED_SOCKET_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUPPORTED_SOCKET_TYPES, param_spec); param_spec = g_param_spec_boxed ( "parameters", "Parameters", "parameters of the tube", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PARAMETERS, param_spec); param_spec = g_param_spec_uint ( "state", "TpTubeState", "state of the tube", 0, TP_NUM_TUBE_CHANNEL_STATES - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); signals[SIG_INCOMING_CONNECTION] = g_signal_new ("incoming-connection", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_IO_STREAM); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, stream_tube_props); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_TUBE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, tube_props); g_type_class_add_private (object_class, sizeof (TpTestsStreamTubeChannelPrivate)); } static void change_state (TpTestsStreamTubeChannel *self, TpTubeChannelState state) { self->priv->state = state; tp_svc_channel_interface_tube_emit_tube_channel_state_changed (self, state); } /* Return the address of the socket which has been shared over the tube */ GSocketAddress * tp_tests_stream_tube_channel_get_server_address (TpTestsStreamTubeChannel *self) { return tp_g_socket_address_from_variant (self->priv->address_type, self->priv->address, NULL); } static gboolean check_address_type (TpTestsStreamTubeChannel *self, TpSocketAddressType address_type, TpSocketAccessControl access_control) { GArray *arr; guint i; arr = g_hash_table_lookup (self->priv->supported_socket_types, GUINT_TO_POINTER (address_type)); if (arr == NULL) return FALSE; for (i = 0; i < arr->len; i++) { if (g_array_index (arr, TpSocketAccessControl, i) == access_control) return TRUE; } return FALSE; } static void stream_tube_offer (TpSvcChannelTypeStreamTube *iface, guint address_type, const GValue *address, guint access_control, GHashTable *parameters, DBusGMethodInvocation *context) { TpTestsStreamTubeChannel *self = (TpTestsStreamTubeChannel *) iface; GError *error = NULL; if (self->priv->state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the not offered state"); goto fail; } if (!check_address_type (self, address_type, access_control)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Address type not supported with this access control"); goto fail; } self->priv->address_type = address_type; self->priv->address = tp_g_value_slice_dup (address); self->priv->access_control = access_control; change_state (self, TP_TUBE_CHANNEL_STATE_REMOTE_PENDING); tp_svc_channel_type_stream_tube_return_from_offer (context); return; fail: dbus_g_method_return_error (context, error); g_error_free (error); } static void service_incoming_cb (GSocketService *service, GSocketConnection *connection, GObject *source_object, gpointer user_data) { TpTestsStreamTubeChannel *self = user_data; GError *error = NULL; if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { #ifdef HAVE_GIO_UNIX GCredentials *creds; guchar byte; /* FIXME: we should an async version of this API (bgo #629503) */ creds = tp_unix_connection_receive_credentials_with_byte ( connection, &byte, NULL, &error); g_assert_no_error (error); g_assert_cmpuint (byte, ==, g_value_get_uchar (self->priv->access_control_param)); g_object_unref (creds); #else /* Tests shouldn't use this if not supported */ g_assert_not_reached (); #endif } else if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_PORT) { GSocketAddress *addr; guint16 port; addr = g_socket_connection_get_remote_address (connection, &error); g_assert_no_error (error); port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); g_assert_cmpuint (port, ==, g_value_get_uint (self->priv->access_control_param)); g_object_unref (addr); } tp_svc_channel_type_stream_tube_emit_new_local_connection (self, self->priv->connection_id); self->priv->connection_id++; g_signal_emit (self, signals[SIG_INCOMING_CONNECTION], 0, connection); } static void stream_tube_accept (TpSvcChannelTypeStreamTube *iface, TpSocketAddressType address_type, TpSocketAccessControl access_control, const GValue *access_control_param, DBusGMethodInvocation *context) { TpTestsStreamTubeChannel *self = (TpTestsStreamTubeChannel *) iface; GError *error = NULL; GValue *address; if (self->priv->state != TP_TUBE_CHANNEL_STATE_LOCAL_PENDING) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the local pending state"); goto fail; } if (!check_address_type (self, address_type, access_control)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Address type not supported with this access control"); goto fail; } address = _tp_create_local_socket (address_type, access_control, &self->priv->service, &self->priv->unix_address, &self->priv->unix_tmpdir, &error); tp_g_signal_connect_object (self->priv->service, "incoming", G_CALLBACK (service_incoming_cb), self, 0); self->priv->access_control = access_control; self->priv->access_control_param = tp_g_value_slice_dup ( access_control_param); change_state (self, TP_TUBE_CHANNEL_STATE_OPEN); tp_svc_channel_type_stream_tube_return_from_accept (context, address); tp_g_value_slice_free (address); return; fail: dbus_g_method_return_error (context, error); g_error_free (error); } static void stream_tube_iface_init (gpointer iface, gpointer data) { TpSvcChannelTypeStreamTubeClass *klass = iface; #define IMPLEMENT(x) tp_svc_channel_type_stream_tube_implement_##x (klass, stream_tube_##x) IMPLEMENT(offer); IMPLEMENT(accept); #undef IMPLEMENT } /* Called to emulate a peer connecting to an offered tube */ void tp_tests_stream_tube_channel_peer_connected (TpTestsStreamTubeChannel *self, GIOStream *stream, TpHandle handle) { GValue *connection_param; if (self->priv->state == TP_TUBE_CHANNEL_STATE_REMOTE_PENDING) change_state (self, TP_TUBE_CHANNEL_STATE_OPEN); g_assert (self->priv->state == TP_TUBE_CHANNEL_STATE_OPEN); switch (self->priv->access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: connection_param = tp_g_value_slice_new_static_string ("dummy"); break; case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: { #ifdef HAVE_GIO_UNIX GError *error = NULL; guchar byte = g_random_int_range (0, G_MAXUINT8); /* FIXME: we should an async version of this API (bgo #629503) */ tp_unix_connection_send_credentials_with_byte ( G_SOCKET_CONNECTION (stream), byte, NULL, &error); g_assert_no_error (error); connection_param = tp_g_value_slice_new_byte (byte); #else /* Tests shouldn't use this if not supported */ g_assert_not_reached (); #endif } break; case TP_SOCKET_ACCESS_CONTROL_PORT: { GSocketAddress *addr; GError *error = NULL; addr = g_socket_connection_get_local_address ( G_SOCKET_CONNECTION (stream), &error); g_assert_no_error (error); connection_param = tp_g_value_slice_new_take_boxed ( TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4, dbus_g_type_specialized_construct ( TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4)); dbus_g_type_struct_set (connection_param, 0, "badger", 1, g_inet_socket_address_get_port ( G_INET_SOCKET_ADDRESS (addr)), G_MAXUINT); g_object_unref (addr); } break; default: g_assert_not_reached (); } tp_svc_channel_type_stream_tube_emit_new_remote_connection (self, handle, connection_param, self->priv->connection_id); self->priv->connection_id++; tp_g_value_slice_free (connection_param); } void tp_tests_stream_tube_channel_last_connection_disconnected ( TpTestsStreamTubeChannel *self, const gchar *error) { tp_svc_channel_type_stream_tube_emit_connection_closed (self, self->priv->connection_id - 1, error, "kaboum"); } /* Contact Stream Tube */ G_DEFINE_TYPE (TpTestsContactStreamTubeChannel, tp_tests_contact_stream_tube_channel, TP_TESTS_TYPE_STREAM_TUBE_CHANNEL) static void tp_tests_contact_stream_tube_channel_init ( TpTestsContactStreamTubeChannel *self) { } static void tp_tests_contact_stream_tube_channel_class_init ( TpTestsContactStreamTubeChannelClass *klass) { TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; } /* Room Stream Tube */ G_DEFINE_TYPE (TpTestsRoomStreamTubeChannel, tp_tests_room_stream_tube_channel, TP_TESTS_TYPE_STREAM_TUBE_CHANNEL) static void tp_tests_room_stream_tube_channel_init ( TpTestsRoomStreamTubeChannel *self) { } static void tp_tests_room_stream_tube_channel_class_init ( TpTestsRoomStreamTubeChannelClass *klass) { TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); base_class->target_handle_type = TP_HANDLE_TYPE_ROOM; } telepathy-glib-0.24.2/tests/lib/stream-tube-chan.h0000644000175000017500000001205012652510705016653 00000000000000/* * stream-tube-chan.h - Simple stream tube channel * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __TP_STREAM_TUBE_CHAN_H__ #define __TP_STREAM_TUBE_CHAN_H__ #include #include G_BEGIN_DECLS /* Base Class */ typedef struct _TpTestsStreamTubeChannel TpTestsStreamTubeChannel; typedef struct _TpTestsStreamTubeChannelClass TpTestsStreamTubeChannelClass; typedef struct _TpTestsStreamTubeChannelPrivate TpTestsStreamTubeChannelPrivate; GType tp_tests_stream_tube_channel_get_type (void); #define TP_TESTS_TYPE_STREAM_TUBE_CHANNEL \ (tp_tests_stream_tube_channel_get_type ()) #define TP_TESTS_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL, \ TpTestsStreamTubeChannel)) #define TP_TESTS_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL, \ TpTestsStreamTubeChannelClass)) #define TP_TESTS_IS_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL)) #define TP_TESTS_IS_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL)) #define TP_TESTS_STREAM_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_STREAM_TUBE_CHANNEL, \ TpTestsStreamTubeChannelClass)) struct _TpTestsStreamTubeChannelClass { TpBaseChannelClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; }; struct _TpTestsStreamTubeChannel { TpBaseChannel parent; TpTestsStreamTubeChannelPrivate *priv; }; GSocketAddress * tp_tests_stream_tube_channel_get_server_address ( TpTestsStreamTubeChannel *self); void tp_tests_stream_tube_channel_peer_connected ( TpTestsStreamTubeChannel *self, GIOStream *stream, TpHandle handle); void tp_tests_stream_tube_channel_last_connection_disconnected ( TpTestsStreamTubeChannel *self, const gchar *error); /* Contact Stream Tube */ typedef struct _TpTestsContactStreamTubeChannel TpTestsContactStreamTubeChannel; typedef struct _TpTestsContactStreamTubeChannelClass TpTestsContactStreamTubeChannelClass; GType tp_tests_contact_stream_tube_channel_get_type (void); #define TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL \ (tp_tests_contact_stream_tube_channel_get_type ()) #define TP_TESTS_CONTACT_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL, \ TpTestsContactStreamTubeChannel)) #define TP_TESTS_CONTACT_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL, \ TpTestsContactStreamTubeChannelClass)) #define TP_TESTS_IS_CONTACT_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL)) #define TP_TESTS_IS_CONTACT_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL)) #define TP_TESTS_CONTACT_STREAM_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL, \ TpTestsContactStreamTubeChannelClass)) struct _TpTestsContactStreamTubeChannelClass { TpTestsStreamTubeChannelClass parent_class; }; struct _TpTestsContactStreamTubeChannel { TpTestsStreamTubeChannel parent; }; /* Room Stream Tube */ typedef struct _TpTestsRoomStreamTubeChannel TpTestsRoomStreamTubeChannel; typedef struct _TpTestsRoomStreamTubeChannelClass TpTestsRoomStreamTubeChannelClass; GType tp_tests_room_stream_tube_channel_get_type (void); #define TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL \ (tp_tests_room_stream_tube_channel_get_type ()) #define TP_TESTS_ROOM_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL, \ TpTestsRoomStreamTubeChannel)) #define TP_TESTS_ROOM_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL, \ TpTestsRoomStreamTubeChannelClass)) #define TP_TESTS_IS_ROOM_STREAM_TUBE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL)) #define TP_TESTS_IS_ROOM_STREAM_TUBE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL)) #define TP_TESTS_ROOM_STREAM_TUBE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL, \ TpTestsRoomStreamTubeChannelClass)) struct _TpTestsRoomStreamTubeChannelClass { TpTestsStreamTubeChannelClass parent_class; }; struct _TpTestsRoomStreamTubeChannel { TpTestsStreamTubeChannel parent; }; G_END_DECLS #endif /* #ifndef __TP_STREAM_TUBE_CHAN_H__ */ telepathy-glib-0.24.2/tests/lib/myassert.h0000644000175000017500000000057612652510705015375 00000000000000#ifndef TP_TESTS_MYASSERT_H #define TP_TESTS_MYASSERT_H #include #include #define MYASSERT(assertion, extra_format, ...)\ G_STMT_START {\ if (!(assertion))\ {\ g_error ("\n%s:%d: Assertion failed: %s" extra_format,\ __FILE__, __LINE__, #assertion, ##__VA_ARGS__);\ }\ } G_STMT_END #endif telepathy-glib-0.24.2/tests/intset.c0000644000175000017500000001336512652510705014261 00000000000000#include "config.h" #include #include #include static void iterate_in_order (TpIntset *set) { TpIntsetIter iter; guint n = 0; gint64 prev = (guint) -1; tp_intset_iter_init (&iter, set); while (tp_intset_iter_next (&iter)) { g_assert (tp_intset_is_member (set, iter.element)); if (prev != (guint) -1) g_assert_cmpuint (iter.element, >, prev); prev = iter.element; n++; } g_assert_cmpuint (n, ==, tp_intset_size (set)); } static void iterate_fast (TpIntset *set) { TpIntsetFastIter iter; guint n = 0; guint i; tp_intset_fast_iter_init (&iter, set); while (tp_intset_fast_iter_next (&iter, &i)) { g_assert (tp_intset_is_member (set, i)); n++; } g_assert_cmpuint (n, ==, tp_intset_size (set)); } static void test_iteration (TpIntset *set) { iterate_fast (set); iterate_in_order (set); } int main (int argc, char **argv) { TpIntset *set1 = tp_intset_new (); TpIntset *a, *b, *copy; TpIntset *ab_union, *ab_expected_union; TpIntset *ab_inter, *ab_expected_inter; TpIntset *a_diff_b, *a_expected_diff_b; TpIntset *b_diff_a, *b_expected_diff_a; TpIntset *ab_symmdiff, *ab_expected_symmdiff; GValue *value; g_assert (tp_intset_is_empty (set1)); g_assert_cmpuint (tp_intset_size (set1), ==, 0); tp_intset_add (set1, 0); tp_intset_add (set1, 2); tp_intset_add (set1, 3); tp_intset_add (set1, 5); tp_intset_add (set1, 8); tp_intset_add (set1, 1024); tp_intset_add (set1, 32); g_assert (!tp_intset_is_empty (set1)); g_assert_cmpuint (tp_intset_size (set1), ==, 7); g_assert (tp_intset_is_member (set1, 2)); g_assert (tp_intset_is_member (set1, 5)); g_assert (tp_intset_is_member (set1, 1024)); g_assert (!tp_intset_is_member (set1, 1023)); g_assert (!tp_intset_is_member (set1, 1025)); g_assert (tp_intset_is_member (set1, 0)); g_assert (tp_intset_is_member (set1, 32)); g_assert (!tp_intset_is_member (set1, 31)); g_assert (!tp_intset_is_member (set1, 33)); tp_intset_remove (set1, 8); tp_intset_remove (set1, 1024); g_assert_cmpuint (tp_intset_size (set1), ==, 5); test_iteration (set1); tp_intset_destroy (set1); #define NUM_A 11 #define NUM_B 823 #define NUM_C 367 #define NUM_D 4177 #define NUM_E 109 #define NUM_F 1861 a = tp_intset_new (); tp_intset_add (a, NUM_A); tp_intset_add (a, NUM_B); tp_intset_add (a, NUM_C); tp_intset_add (a, NUM_D); test_iteration (a); g_assert (tp_intset_is_equal (a, a)); b = tp_intset_new (); tp_intset_add (b, NUM_C); tp_intset_add (b, NUM_D); tp_intset_add (b, NUM_E); tp_intset_add (b, NUM_F); test_iteration (b); g_assert (tp_intset_is_equal (b, b)); g_assert (!tp_intset_is_equal (a, b)); ab_expected_union = tp_intset_new (); tp_intset_add (ab_expected_union, NUM_A); tp_intset_add (ab_expected_union, NUM_B); tp_intset_add (ab_expected_union, NUM_C); tp_intset_add (ab_expected_union, NUM_D); tp_intset_add (ab_expected_union, NUM_E); tp_intset_add (ab_expected_union, NUM_F); ab_union = tp_intset_union (a, b); g_assert (tp_intset_is_equal (ab_union, ab_expected_union)); test_iteration (ab_union); tp_intset_destroy (ab_union); tp_intset_destroy (ab_expected_union); ab_union = NULL; ab_expected_union = NULL; ab_expected_inter = tp_intset_new (); tp_intset_add (ab_expected_inter, NUM_C); tp_intset_add (ab_expected_inter, NUM_D); ab_inter = tp_intset_intersection (a, b); test_iteration (ab_inter); g_assert (tp_intset_is_equal (ab_inter, ab_expected_inter)); tp_intset_destroy (ab_inter); tp_intset_destroy (ab_expected_inter); ab_inter = NULL; ab_expected_inter = NULL; a_expected_diff_b = tp_intset_new (); tp_intset_add (a_expected_diff_b, NUM_A); tp_intset_add (a_expected_diff_b, NUM_B); a_diff_b = tp_intset_difference (a, b); test_iteration (a_diff_b); g_assert (tp_intset_is_equal (a_diff_b, a_expected_diff_b)); tp_intset_destroy (a_diff_b); tp_intset_destroy (a_expected_diff_b); a_diff_b = NULL; a_expected_diff_b = NULL; b_expected_diff_a = tp_intset_new (); tp_intset_add (b_expected_diff_a, NUM_E); tp_intset_add (b_expected_diff_a, NUM_F); b_diff_a = tp_intset_difference (b, a); test_iteration (b_diff_a); g_assert (tp_intset_is_equal (b_diff_a, b_expected_diff_a)); tp_intset_destroy (b_diff_a); tp_intset_destroy (b_expected_diff_a); b_diff_a = NULL; b_expected_diff_a = NULL; ab_expected_symmdiff = tp_intset_new (); tp_intset_add (ab_expected_symmdiff, NUM_A); tp_intset_add (ab_expected_symmdiff, NUM_B); tp_intset_add (ab_expected_symmdiff, NUM_E); tp_intset_add (ab_expected_symmdiff, NUM_F); ab_symmdiff = tp_intset_symmetric_difference (a, b); test_iteration (ab_symmdiff); g_assert (tp_intset_is_equal (ab_symmdiff, ab_expected_symmdiff)); tp_intset_destroy (ab_symmdiff); tp_intset_destroy (ab_expected_symmdiff); ab_symmdiff = NULL; ab_expected_symmdiff = NULL; { GArray *arr; TpIntset *tmp; arr = tp_intset_to_array (a); tmp = tp_intset_from_array (arr); g_assert (tp_intset_is_equal (a, tmp)); g_array_unref (arr); tp_intset_destroy (tmp); arr = NULL; tmp = NULL; arr = tp_intset_to_array (b); tmp = tp_intset_from_array (arr); g_assert (tp_intset_is_equal (b, tmp)); g_array_unref (arr); tp_intset_destroy (tmp); arr = NULL; tmp = NULL; } value = tp_g_value_slice_new_take_boxed (TP_TYPE_INTSET, a); copy = g_value_dup_boxed (value); g_assert (copy != a); g_assert (tp_intset_is_equal (copy, a)); test_iteration (copy); g_boxed_free (TP_TYPE_INTSET, copy); /* a is owned by value now, so don't free it explicitly */ tp_g_value_slice_free (value); tp_intset_destroy (b); a = NULL; value = NULL; b = NULL; return 0; } telepathy-glib-0.24.2/tests/dbus/0000755000175000017500000000000014006623343013612 500000000000000telepathy-glib-0.24.2/tests/dbus/cm.c0000644000175000017500000012023414004031760014271 00000000000000/* Feature test for https://bugs.freedesktop.org/show_bug.cgi?id=18291 * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "tests/lib/echo-cm.h" #include "tests/lib/util.h" typedef enum { ACTIVATE_CM = (1 << 0), USE_CWR = (1 << 1), USE_OLD_LIST = (1 << 2), DROP_NAME_ON_GET = (1 << 3), DROP_NAME_ON_GET_TWICE = (1 << 4), NO_PROPERTIES = (1 << 5) } TestFlags; typedef struct { TpTestsEchoConnectionManager parent; guint drop_name_on_get; gboolean implement_properties; } MyConnectionManager; typedef TpTestsEchoConnectionManagerClass MyConnectionManagerClass; typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; MyConnectionManager *service_cm; TpConnectionManager *cm; TpConnectionManager *echo; TpConnectionManager *spurious; GError *error /* initialized where needed */; } Test; static void my_properties_iface_init (gpointer iface); static GType my_connection_manager_get_type (void); G_DEFINE_TYPE_WITH_CODE (MyConnectionManager, my_connection_manager, TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, my_properties_iface_init)) static void my_connection_manager_class_init (MyConnectionManagerClass *cls) { } static void my_connection_manager_init (MyConnectionManager *self) { self->implement_properties = TRUE; } static void my_get (TpSvcDBusProperties *iface G_GNUC_UNUSED, const gchar *i G_GNUC_UNUSED, const gchar *p G_GNUC_UNUSED, DBusGMethodInvocation *context) { /* The telepathy-glib client side should never call this: * GetAll() is better. */ g_assert_not_reached (); } static void my_get_all (TpSvcDBusProperties *iface, const gchar *i, DBusGMethodInvocation *context) { MyConnectionManager *cm = (MyConnectionManager *) iface; /* If necessary, emulate the CM exiting and coming back. */ if (cm->drop_name_on_get) { TpDBusDaemon *dbus = tp_base_connection_manager_get_dbus_daemon ( TP_BASE_CONNECTION_MANAGER (cm)); GString *string = g_string_new (TP_CM_BUS_NAME_BASE); GError *error = NULL; g_string_append (string, "example_echo"); cm->drop_name_on_get--; tp_dbus_daemon_release_name (dbus, string->str, &error); g_assert_no_error (error); tp_dbus_daemon_request_name (dbus, string->str, FALSE, &error); g_assert_no_error (error); } /* Do we implement properties? */ if (cm->implement_properties) { GHashTable *ht = tp_dbus_properties_mixin_dup_all ((GObject *) cm, i); tp_svc_dbus_properties_return_from_get_all (context, ht); g_hash_table_unref (ht); } else { tp_dbus_g_method_return_not_implemented (context); } } static void my_properties_iface_init (gpointer iface) { TpSvcDBusPropertiesClass *cls = iface; #define IMPLEMENT(x) \ tp_svc_dbus_properties_implement_##x (cls, my_##x) IMPLEMENT (get); IMPLEMENT (get_all); #undef IMPLEMENT } static void setup (Test *test, gconstpointer data) { TpBaseConnectionManager *service_cm_as_base; gboolean ok; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->service_cm = tp_tests_object_new_static_class ( my_connection_manager_get_type (), NULL); g_assert (test->service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (test->service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); test->cm = NULL; } static void teardown (Test *test, gconstpointer data) { g_clear_object (&test->service_cm); g_clear_object (&test->dbus); g_clear_object (&test->cm); g_clear_object (&test->echo); g_clear_object (&test->spurious); g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_valid_name (void) { GError *error = NULL; g_assert (tp_connection_manager_check_valid_name ("gabble", NULL)); g_assert (tp_connection_manager_check_valid_name ("l33t_cm", NULL)); g_assert (!tp_connection_manager_check_valid_name ("wtf tbh", &error)); g_assert (error != NULL); g_clear_error (&error); g_assert (!tp_connection_manager_check_valid_name ("0pointer", &error)); g_assert (error != NULL); g_clear_error (&error); } static void on_got_info_expect_none (TpConnectionManager *self, guint info_source, gpointer p) { Test *test = p; g_assert (self == test->cm); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_NONE); g_assert_cmpuint (info_source, ==, test->cm->info_source); g_main_loop_quit (test->mainloop); } static void test_nothing_got_info (Test *test, gconstpointer data) { GError *error = NULL; gulong id; test->cm = tp_connection_manager_new (test->dbus, "not_actually_there", NULL, &error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (error); /* Spin the mainloop until we get the got-info signal. This API is rubbish, * but it's better than it used to be... */ g_test_bug ("18207"); id = g_signal_connect (test->cm, "got-info", G_CALLBACK (on_got_info_expect_none), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->cm, id); g_assert_cmpstr (test->cm->name, ==, "not_actually_there"); g_assert_cmpuint (test->cm->running, ==, FALSE); g_assert_cmpuint (test->cm->info_source, ==, TP_CM_INFO_SOURCE_NONE); g_assert (test->cm->protocols == NULL); g_assert (tp_connection_manager_dup_protocols (test->cm) == NULL); } static void on_got_info_expect_file (TpConnectionManager *self, guint info_source, gpointer p) { Test *test = p; g_assert (self == test->cm); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_FILE); g_assert_cmpuint (info_source, ==, test->cm->info_source); g_main_loop_quit (test->mainloop); } static void test_file_got_info (Test *test, gconstpointer data) { GError *error = NULL; gulong id; const TpConnectionManagerParam *param; const TpConnectionManagerProtocol *protocol; gchar **strv; GValue value = { 0 }; gboolean ok; GVariant *variant; test->cm = tp_connection_manager_new (test->dbus, "spurious", NULL, &error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (error); g_test_bug ("18207"); id = g_signal_connect (test->cm, "got-info", G_CALLBACK (on_got_info_expect_file), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->cm, id); g_assert_cmpstr (test->cm->name, ==, "spurious"); g_assert_cmpuint (test->cm->running, ==, FALSE); g_assert_cmpuint (test->cm->info_source, ==, TP_CM_INFO_SOURCE_FILE); g_assert (test->cm->protocols != NULL); g_assert (test->cm->protocols[0] != NULL); g_assert (test->cm->protocols[1] != NULL); g_assert (test->cm->protocols[2] == NULL); strv = tp_connection_manager_dup_protocol_names (test->cm); if (tp_strdiff (strv[0], "normal")) { g_assert_cmpstr (strv[0], ==, "weird"); g_assert_cmpstr (strv[1], ==, "normal"); } else { g_assert_cmpstr (strv[0], ==, "normal"); g_assert_cmpstr (strv[1], ==, "weird"); } g_assert (strv[2] == NULL); g_strfreev (strv); g_assert (tp_connection_manager_has_protocol (test->cm, "normal")); g_assert (!tp_connection_manager_has_protocol (test->cm, "not-there")); protocol = tp_connection_manager_get_protocol (test->cm, "normal"); g_assert_cmpstr (protocol->name, ==, "normal"); g_assert (tp_connection_manager_protocol_can_register (protocol)); g_assert (tp_connection_manager_protocol_has_param (protocol, "account")); g_assert (!tp_connection_manager_protocol_has_param (protocol, "not-there")); /* FIXME: it's not technically an API guarantee that params * come out in this order... */ param = &protocol->params[0]; g_assert_cmpstr (param->name, ==, "account"); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER); g_assert (param == tp_connection_manager_protocol_get_param (protocol, "account")); g_assert_cmpstr (tp_connection_manager_param_get_name (param), ==, "account"); g_assert_cmpstr (tp_connection_manager_param_get_dbus_signature (param), ==, "s"); g_assert (tp_connection_manager_param_is_required (param)); g_assert (tp_connection_manager_param_is_required_for_registration (param)); g_assert (!tp_connection_manager_param_is_secret (param)); g_assert (!tp_connection_manager_param_is_dbus_property (param)); g_assert (!tp_connection_manager_param_is_dbus_property (param)); ok = tp_connection_manager_param_get_default (param, &value); g_assert (!ok); g_assert (!G_IS_VALUE (&value)); g_assert (tp_connection_manager_param_dup_default_variant (param) == NULL); param = &protocol->params[1]; g_assert_cmpstr (param->name, ==, "password"); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER | TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert (param == tp_connection_manager_protocol_get_param (protocol, "password")); param = &protocol->params[2]; g_assert_cmpstr (param->name, ==, "register"); g_assert_cmpstr (param->dbus_signature, ==, "b"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (param == tp_connection_manager_protocol_get_param (protocol, "register")); ok = tp_connection_manager_param_get_default (param, &value); g_assert (ok); g_assert (G_IS_VALUE (&value)); g_assert (G_VALUE_HOLDS_BOOLEAN (&value)); g_value_unset (&value); variant = tp_connection_manager_param_dup_default_variant (param); g_assert_cmpstr (g_variant_get_type_string (variant), ==, "b"); g_assert_cmpint (g_variant_get_boolean (variant), ==, TRUE); param = &protocol->params[3]; g_assert (param->name == NULL); strv = tp_connection_manager_protocol_dup_param_names (protocol); g_assert_cmpstr (strv[0], ==, "account"); g_assert_cmpstr (strv[1], ==, "password"); g_assert_cmpstr (strv[2], ==, "register"); g_assert (strv[3] == NULL); g_strfreev (strv); /* switch to the other protocol, whichever one that actually is */ if (protocol == test->cm->protocols[0]) { protocol = test->cm->protocols[1]; } else { g_assert (protocol == test->cm->protocols[1]); protocol = test->cm->protocols[0]; } g_assert_cmpstr (protocol->name, ==, "weird"); g_assert (protocol == tp_connection_manager_get_protocol (test->cm, "weird")); g_assert (!tp_connection_manager_protocol_can_register (protocol)); param = &protocol->params[0]; g_assert_cmpstr (param->name, ==, "com.example.Bork.Bork.Bork"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY | TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "u"); param = &protocol->params[1]; g_assert (param->name == NULL); g_assert (test->cm->protocols[2] == NULL); } static void test_complex_file_got_info (Test *test, gconstpointer data) { GError *error = NULL; gulong id; const TpConnectionManagerParam *param; const TpConnectionManagerProtocol *protocol; gchar **strv; GPtrArray *arr; test->cm = tp_connection_manager_new (test->dbus, "test_manager_file", NULL, &error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (error); g_test_bug ("18207"); id = g_signal_connect (test->cm, "got-info", G_CALLBACK (on_got_info_expect_file), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->cm, id); g_assert_cmpstr (test->cm->name, ==, "test_manager_file"); g_assert_cmpuint (test->cm->running, ==, FALSE); g_assert_cmpuint (test->cm->info_source, ==, TP_CM_INFO_SOURCE_FILE); g_assert (test->cm->protocols != NULL); g_assert (test->cm->protocols[0] != NULL); g_assert (test->cm->protocols[1] != NULL); g_assert (test->cm->protocols[2] != NULL); g_assert (test->cm->protocols[3] == NULL); /* FIXME: it's not technically an API guarantee that params * come out in this order... */ protocol = tp_connection_manager_get_protocol (test->cm, "foo"); g_assert_cmpstr (protocol->name, ==, "foo"); param = &protocol->params[0]; g_assert_cmpstr (param->name, ==, "account"); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); g_assert_cmpstr (g_value_get_string (¶m->default_value), ==, "foo@default"); param = &protocol->params[1]; g_assert_cmpstr (param->name, ==, "password"); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); param = &protocol->params[2]; g_assert_cmpstr (param->name, ==, "encryption-key"); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); param = &protocol->params[3]; g_assert_cmpstr (param->name, ==, "port"); g_assert_cmpstr (param->dbus_signature, ==, "q"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (G_VALUE_HOLDS_UINT (¶m->default_value)); g_assert_cmpuint (g_value_get_uint (¶m->default_value), ==, 1234); param = &protocol->params[4]; g_assert_cmpstr (param->name, ==, "register"); g_assert_cmpstr (param->dbus_signature, ==, "b"); g_assert_cmpuint (param->flags, ==, 0); g_assert (G_VALUE_HOLDS_BOOLEAN (¶m->default_value)); param = &protocol->params[5]; g_assert_cmpstr (param->name, ==, "server-list"); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "foo"); g_assert_cmpstr (strv[1], ==, "bar"); g_assert (strv[2] == NULL); param = &protocol->params[6]; g_assert (param->name == NULL); protocol = tp_connection_manager_get_protocol (test->cm, "bar"); g_assert_cmpstr (protocol->name, ==, "bar"); param = &protocol->params[0]; g_assert_cmpstr (param->name, ==, "account"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); g_assert_cmpstr (g_value_get_string (¶m->default_value), ==, "bar@default"); param = &protocol->params[1]; g_assert_cmpstr (param->name, ==, "encryption-key"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); param = &protocol->params[2]; g_assert_cmpstr (param->name, ==, "password"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); param = &protocol->params[3]; g_assert_cmpstr (param->name, ==, "port"); g_assert_cmpstr (param->dbus_signature, ==, "q"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (G_VALUE_HOLDS_UINT (¶m->default_value)); g_assert_cmpuint (g_value_get_uint (¶m->default_value), ==, 4321); param = &protocol->params[4]; g_assert_cmpstr (param->name, ==, "register"); g_assert_cmpstr (param->dbus_signature, ==, "b"); g_assert_cmpuint (param->flags, ==, 0); g_assert (G_VALUE_HOLDS_BOOLEAN (¶m->default_value)); param = &protocol->params[5]; g_assert_cmpstr (param->name, ==, "server-list"); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "bar"); g_assert_cmpstr (strv[1], ==, "foo"); g_assert (strv[2] == NULL); param = &protocol->params[6]; g_assert (param->name == NULL); protocol = tp_connection_manager_get_protocol (test->cm, "somewhat-pathological"); g_assert_cmpstr (protocol->name, ==, "somewhat-pathological"); param = &protocol->params[0]; g_assert_cmpstr (param->name, ==, "foo"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); g_assert_cmpstr (g_value_get_string (¶m->default_value), ==, "hello world"); param = &protocol->params[1]; g_assert_cmpstr (param->name, ==, "semicolons"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT | TP_CONN_MGR_PARAM_FLAG_SECRET); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); g_assert_cmpstr (g_value_get_string (¶m->default_value), ==, "list;of;misc;"); param = &protocol->params[2]; g_assert_cmpstr (param->name, ==, "list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list"); g_assert_cmpstr (strv[1], ==, "of"); g_assert_cmpstr (strv[2], ==, "misc"); g_assert (strv[3] == NULL); param = &protocol->params[3]; g_assert_cmpstr (param->name, ==, "unterminated-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list"); g_assert_cmpstr (strv[1], ==, "of"); g_assert_cmpstr (strv[2], ==, "misc"); g_assert (strv[3] == NULL); param = &protocol->params[4]; g_assert_cmpstr (param->name, ==, "spaces-in-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list"); g_assert_cmpstr (strv[1], ==, " of"); g_assert_cmpstr (strv[2], ==, " misc "); g_assert (strv[3] == NULL); param = &protocol->params[5]; g_assert_cmpstr (param->name, ==, "escaped-semicolon-in-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list;of"); g_assert_cmpstr (strv[1], ==, "misc"); g_assert (strv[2] == NULL); param = &protocol->params[6]; g_assert_cmpstr (param->name, ==, "doubly-escaped-semicolon-in-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list\\"); g_assert_cmpstr (strv[1], ==, "of"); g_assert_cmpstr (strv[2], ==, "misc"); g_assert (strv[3] == NULL); param = &protocol->params[7]; g_assert_cmpstr (param->name, ==, "triply-escaped-semicolon-in-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, "list\\;of"); g_assert_cmpstr (strv[1], ==, "misc"); g_assert (strv[2] == NULL); param = &protocol->params[8]; g_assert_cmpstr (param->name, ==, "empty-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert (strv == NULL || strv[0] == NULL); param = &protocol->params[9]; g_assert_cmpstr (param->name, ==, "escaped-semicolon"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "s"); g_assert (G_VALUE_HOLDS_STRING (¶m->default_value)); g_assert_cmpstr (g_value_get_string (¶m->default_value), ==, "foo\\;bar"); param = &protocol->params[10]; g_assert_cmpstr (param->name, ==, "object"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "o"); g_assert (G_VALUE_HOLDS (¶m->default_value, DBUS_TYPE_G_OBJECT_PATH)); g_assert_cmpstr (g_value_get_boxed (¶m->default_value), ==, "/misc"); param = &protocol->params[11]; g_assert_cmpstr (param->name, ==, "q"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "q"); g_assert (G_VALUE_HOLDS_UINT (¶m->default_value)); g_assert_cmpint (g_value_get_uint (¶m->default_value), ==, 42); param = &protocol->params[12]; g_assert_cmpstr (param->name, ==, "u"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "u"); g_assert (G_VALUE_HOLDS_UINT (¶m->default_value)); g_assert_cmpint (g_value_get_uint (¶m->default_value), ==, 42); param = &protocol->params[13]; g_assert_cmpstr (param->name, ==, "t"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "t"); g_assert (G_VALUE_HOLDS_UINT64 (¶m->default_value)); g_assert_cmpuint ((guint) g_value_get_uint64 (¶m->default_value), ==, 42); param = &protocol->params[14]; g_assert_cmpstr (param->name, ==, "n"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "n"); g_assert (G_VALUE_HOLDS_INT (¶m->default_value)); g_assert_cmpint (g_value_get_int (¶m->default_value), ==, -42); param = &protocol->params[15]; g_assert_cmpstr (param->name, ==, "i"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "i"); g_assert (G_VALUE_HOLDS_INT (¶m->default_value)); g_assert_cmpint (g_value_get_int (¶m->default_value), ==, -42); param = &protocol->params[16]; g_assert_cmpstr (param->name, ==, "x"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "x"); g_assert (G_VALUE_HOLDS_INT64 (¶m->default_value)); g_assert_cmpint ((int) g_value_get_int64 (¶m->default_value), ==, -42); param = &protocol->params[17]; g_assert_cmpstr (param->name, ==, "d"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "d"); g_assert (G_VALUE_HOLDS_DOUBLE (¶m->default_value)); param = &protocol->params[18]; g_assert_cmpstr (param->name, ==, "empty-string-in-list"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "as"); g_assert (G_VALUE_HOLDS (¶m->default_value, G_TYPE_STRV)); strv = g_value_get_boxed (¶m->default_value); g_assert_cmpstr (strv[0], ==, ""); g_assert (strv[1] == NULL); param = &protocol->params[19]; g_assert_cmpstr (param->name, ==, "true"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "b"); g_assert (G_VALUE_HOLDS_BOOLEAN (¶m->default_value)); g_assert_cmpint (g_value_get_boolean (¶m->default_value), ==, TRUE); param = &protocol->params[20]; g_assert_cmpstr (param->name, ==, "false"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "b"); g_assert (G_VALUE_HOLDS_BOOLEAN (¶m->default_value)); g_assert_cmpint (g_value_get_boolean (¶m->default_value), ==, FALSE); param = &protocol->params[21]; g_assert_cmpstr (param->name, ==, "y"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "y"); g_assert (G_VALUE_HOLDS_UCHAR (¶m->default_value)); g_assert_cmpint (g_value_get_uchar (¶m->default_value), ==, 42); param = &protocol->params[22]; g_assert_cmpstr (param->name, ==, "ao"); g_assert_cmpuint (param->flags, ==, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT); g_assert_cmpstr (param->dbus_signature, ==, "ao"); g_assert (G_VALUE_HOLDS (¶m->default_value, TP_ARRAY_TYPE_OBJECT_PATH_LIST)); arr = g_value_get_boxed (¶m->default_value); g_assert_cmpuint (arr->len, ==, 2); g_assert_cmpstr ((gchar *) g_ptr_array_index (arr, 0), ==, "/misc"); g_assert_cmpstr ((gchar *) g_ptr_array_index (arr, 1), ==, "/other"); param = &protocol->params[23]; g_assert (param->name == NULL); } static void on_got_info_expect_live (TpConnectionManager *self, guint info_source, gpointer p) { Test *test = p; g_assert (self == test->cm); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_LIVE); g_assert_cmpuint (info_source, ==, test->cm->info_source); g_main_loop_quit (test->mainloop); } static void test_dbus_got_info (Test *test, gconstpointer data) { GError *error = NULL; gulong id; test->cm = tp_connection_manager_new (test->dbus, TP_BASE_CONNECTION_MANAGER_GET_CLASS (test->service_cm)->cm_dbus_name, NULL, &error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (error); g_test_bug ("18207"); id = g_signal_connect (test->cm, "got-info", G_CALLBACK (on_got_info_expect_live), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->cm, id); } static void ready_or_not (TpConnectionManager *self, const GError *error, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; if (error != NULL) test->error = g_error_copy (error); g_main_loop_quit (test->mainloop); } static void test_nothing_ready (Test *test, gconstpointer data) { gchar *name; guint info_source; TestFlags flags = GPOINTER_TO_INT (data); test->error = NULL; test->cm = tp_connection_manager_new (test->dbus, "nonexistent_cm", NULL, &test->error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (test->error); g_test_bug ("18291"); if (flags & USE_CWR) { tp_connection_manager_call_when_ready (test->cm, ready_or_not, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert (test->error != NULL); g_clear_error (&test->error); } else { tp_tests_proxy_run_until_prepared_or_failed (test->cm, NULL, &test->error); g_assert_error (test->error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN); } g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "nonexistent_cm"); g_assert_cmpuint (tp_connection_manager_is_ready (test->cm), ==, FALSE); g_assert_cmpuint (tp_proxy_is_prepared (test->cm, TP_CONNECTION_MANAGER_FEATURE_CORE), ==, FALSE); g_assert (tp_proxy_get_invalidated (test->cm) == NULL); g_assert_cmpuint (tp_connection_manager_is_running (test->cm), ==, FALSE); g_assert_cmpuint (tp_connection_manager_get_info_source (test->cm), ==, TP_CM_INFO_SOURCE_NONE); g_object_get (test->cm, "info-source", &info_source, "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "nonexistent_cm"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_NONE); g_free (name); } static void test_file_ready (Test *test, gconstpointer data) { gchar *name; guint info_source; TestFlags flags = GPOINTER_TO_INT (data); GList *l; test->error = NULL; test->cm = tp_connection_manager_new (test->dbus, "spurious", NULL, &test->error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (test->error); g_test_bug ("18291"); if (flags & USE_CWR) { tp_connection_manager_call_when_ready (test->cm, ready_or_not, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } else { tp_tests_proxy_run_until_prepared (test->cm, NULL); } g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "spurious"); g_assert_cmpuint (tp_connection_manager_is_ready (test->cm), ==, TRUE); g_assert_cmpuint (tp_connection_manager_is_running (test->cm), ==, FALSE); g_assert_cmpuint (tp_proxy_is_prepared (test->cm, TP_CONNECTION_MANAGER_FEATURE_CORE), ==, TRUE); g_assert (tp_proxy_get_invalidated (test->cm) == NULL); g_assert_cmpuint (tp_connection_manager_get_info_source (test->cm), ==, TP_CM_INFO_SOURCE_FILE); g_object_get (test->cm, "info-source", &info_source, "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "spurious"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_FILE); g_free (name); l = tp_connection_manager_dup_protocols (test->cm); g_assert_cmpuint (g_list_length (l), ==, 2); g_assert (TP_IS_PROTOCOL (l->data)); g_assert (TP_IS_PROTOCOL (l->next->data)); g_list_free_full (l, g_object_unref); } static void test_complex_file_ready (Test *test, gconstpointer data) { gchar *name; guint info_source; TestFlags flags = GPOINTER_TO_INT (data); test->error = NULL; test->cm = tp_connection_manager_new (test->dbus, "test_manager_file", NULL, &test->error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (test->error); g_test_bug ("18291"); if (flags & USE_CWR) { tp_connection_manager_call_when_ready (test->cm, ready_or_not, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } else { tp_tests_proxy_run_until_prepared (test->cm, NULL); } g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "test_manager_file"); g_assert_cmpuint (tp_proxy_is_prepared (test->cm, TP_CONNECTION_MANAGER_FEATURE_CORE), ==, TRUE); g_assert (tp_proxy_get_invalidated (test->cm) == NULL); g_assert_cmpuint (tp_connection_manager_is_ready (test->cm), ==, TRUE); g_assert_cmpuint (tp_connection_manager_is_running (test->cm), ==, FALSE); g_assert_cmpuint (tp_connection_manager_get_info_source (test->cm), ==, TP_CM_INFO_SOURCE_FILE); g_object_get (test->cm, "info-source", &info_source, "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "test_manager_file"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_FILE); g_free (name); } static gboolean idle_activate (gpointer cm) { tp_connection_manager_activate (cm); return FALSE; } static void test_dbus_ready (Test *test, gconstpointer data) { gchar *name; guint info_source; const TestFlags flags = GPOINTER_TO_INT (data); GList *l; test->error = NULL; test->cm = tp_connection_manager_new (test->dbus, TP_BASE_CONNECTION_MANAGER_GET_CLASS (test->service_cm)->cm_dbus_name, NULL, &test->error); g_assert (TP_IS_CONNECTION_MANAGER (test->cm)); g_assert_no_error (test->error); if (flags & NO_PROPERTIES) test->service_cm->implement_properties = FALSE; if (flags & DROP_NAME_ON_GET_TWICE) { test->service_cm->drop_name_on_get = 2; } else if (flags & DROP_NAME_ON_GET) { test->service_cm->drop_name_on_get = 1; } if (flags & ACTIVATE_CM) { g_test_bug ("23524"); /* The bug being tested here was caused by ListProtocols being called * twice on the same CM; this can be triggered by _activate()ing at * exactly the wrong moment. But the wrong moment involves racing an * idle. This triggered the assertion about 1/3 of the time on my laptop. * --wjt */ g_idle_add (idle_activate, test->cm); } else { g_test_bug ("18291"); } if (flags & USE_CWR) { tp_connection_manager_call_when_ready (test->cm, ready_or_not, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } else { tp_tests_proxy_run_until_prepared_or_failed (test->cm, NULL, &test->error); } g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "example_echo"); if (flags & DROP_NAME_ON_GET_TWICE) { /* If it dies during introspection *twice*, we assume it has crashed * or something. */ g_assert_error (test->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST); g_clear_error (&test->error); g_assert_cmpuint (tp_proxy_is_prepared (test->cm, TP_CONNECTION_MANAGER_FEATURE_CORE), ==, FALSE); g_assert_cmpuint (tp_connection_manager_is_ready (test->cm), ==, FALSE); g_assert_cmpuint (tp_connection_manager_get_info_source (test->cm), ==, TP_CM_INFO_SOURCE_NONE); return; } g_assert_no_error (test->error); g_assert_cmpuint (tp_proxy_is_prepared (test->cm, TP_CONNECTION_MANAGER_FEATURE_CORE), ==, TRUE); g_assert (tp_proxy_get_invalidated (test->cm) == NULL); g_assert_cmpuint (tp_connection_manager_is_ready (test->cm), ==, TRUE); g_assert_cmpuint (tp_connection_manager_is_running (test->cm), ==, TRUE); g_assert_cmpuint (tp_connection_manager_get_info_source (test->cm), ==, TP_CM_INFO_SOURCE_LIVE); g_object_get (test->cm, "info-source", &info_source, "cm-name", &name, NULL); g_assert_cmpstr (name, ==, "example_echo"); g_assert_cmpuint (info_source, ==, TP_CM_INFO_SOURCE_LIVE); g_free (name); l = tp_connection_manager_dup_protocols (test->cm); g_assert_cmpuint (g_list_length (l), ==, 1); g_assert_cmpstr (tp_protocol_get_name (l->data), ==, "example"); g_list_free_full (l, g_object_unref); } static void on_listed_connection_managers (TpConnectionManager * const * cms, gsize n_cms, const GError *error, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; g_assert_cmpuint ((guint) n_cms, ==, 2); g_assert (cms[2] == NULL); if (tp_connection_manager_is_running (cms[0])) { test->echo = g_object_ref (cms[0]); test->spurious = g_object_ref (cms[1]); } else { test->spurious = g_object_ref (cms[0]); test->echo = g_object_ref (cms[1]); } g_main_loop_quit (test->mainloop); } static void test_list (Test *test, gconstpointer data) { TestFlags flags = GPOINTER_TO_INT (data); if (flags & USE_OLD_LIST) { tp_list_connection_managers (test->dbus, on_listed_connection_managers, test, NULL, NULL); g_main_loop_run (test->mainloop); } else { GAsyncResult *res = NULL; GList *cms; tp_list_connection_managers_async (test->dbus, tp_tests_result_ready_cb, &res); tp_tests_run_until_result (&res); cms = tp_list_connection_managers_finish (res, &test->error); g_assert_no_error (test->error); g_assert_cmpuint (g_list_length (cms), ==, 2); /* transfer ownership */ if (tp_connection_manager_is_running (cms->data)) { test->echo = cms->data; test->spurious = cms->next->data; } else { test->spurious = cms->data; test->echo = cms->next->data; } g_object_unref (res); g_list_free (cms); } g_assert (tp_connection_manager_is_running (test->echo)); g_assert (!tp_connection_manager_is_running (test->spurious)); g_assert (tp_proxy_is_prepared (test->echo, TP_CONNECTION_MANAGER_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->spurious, TP_CONNECTION_MANAGER_FEATURE_CORE)); g_assert (tp_proxy_get_invalidated (test->echo) == NULL); g_assert (tp_proxy_get_invalidated (test->spurious) == NULL); g_assert (tp_connection_manager_is_ready (test->echo)); g_assert (tp_connection_manager_is_ready (test->spurious)); g_assert_cmpuint (tp_connection_manager_get_info_source (test->echo), ==, TP_CM_INFO_SOURCE_LIVE); g_assert_cmpuint (tp_connection_manager_get_info_source (test->spurious), ==, TP_CM_INFO_SOURCE_FILE); g_assert (tp_connection_manager_has_protocol (test->echo, "example")); g_assert (tp_connection_manager_has_protocol (test->spurious, "normal")); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add_func ("/cm/valid-name", test_valid_name); g_test_add ("/cm/nothing (old)", Test, NULL, setup, test_nothing_got_info, teardown); g_test_add ("/cm/file (old)", Test, NULL, setup, test_file_got_info, teardown); g_test_add ("/cm/file (old, complex)", Test, NULL, setup, test_complex_file_got_info, teardown); g_test_add ("/cm/dbus (old)", Test, NULL, setup, test_dbus_got_info, teardown); g_test_add ("/cm/nothing", Test, GINT_TO_POINTER (0), setup, test_nothing_ready, teardown); g_test_add ("/cm/nothing/cwr", Test, GINT_TO_POINTER (USE_CWR), setup, test_nothing_ready, teardown); g_test_add ("/cm/file", Test, GINT_TO_POINTER (0), setup, test_file_ready, teardown); g_test_add ("/cm/file/cwr", Test, GINT_TO_POINTER (USE_CWR), setup, test_file_ready, teardown); g_test_add ("/cm/file/complex", Test, GINT_TO_POINTER (0), setup, test_complex_file_ready, teardown); g_test_add ("/cm/file/complex/cwr", Test, GINT_TO_POINTER (USE_CWR), setup, test_complex_file_ready, teardown); g_test_add ("/cm/dbus", Test, GINT_TO_POINTER (0), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus/cwr", Test, GINT_TO_POINTER (USE_CWR), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus/activate", Test, GINT_TO_POINTER (ACTIVATE_CM), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus/activate/cwr", Test, GINT_TO_POINTER (USE_CWR|ACTIVATE_CM), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback", Test, GINT_TO_POINTER (NO_PROPERTIES), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback/cwr", Test, GINT_TO_POINTER (NO_PROPERTIES | USE_CWR), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback/activate", Test, GINT_TO_POINTER (NO_PROPERTIES | ACTIVATE_CM), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback/activate/cwr", Test, GINT_TO_POINTER (NO_PROPERTIES | ACTIVATE_CM | USE_CWR), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus/dies", Test, GINT_TO_POINTER (DROP_NAME_ON_GET), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback/dies", Test, GINT_TO_POINTER (NO_PROPERTIES | DROP_NAME_ON_GET), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus/dies-twice", Test, GINT_TO_POINTER (DROP_NAME_ON_GET_TWICE), setup, test_dbus_ready, teardown); g_test_add ("/cm/dbus-fallback/dies-twice", Test, GINT_TO_POINTER (NO_PROPERTIES | DROP_NAME_ON_GET_TWICE), setup, test_dbus_ready, teardown); g_test_add ("/cm/list", Test, GINT_TO_POINTER (0), setup, test_list, teardown); g_test_add ("/cm/list/old", Test, GINT_TO_POINTER (USE_OLD_LIST), setup, test_list, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/run-test.sh.in0000644000175000017500000000150712652510705016261 00000000000000#!/bin/sh script_fullname=`readlink -e "@tpglibtestsdir@/run-test.sh"` if [ `readlink -e "$0"` != "$script_fullname" ] ; then echo "This script is meant to be installed at $script_fullname" exit 1 fi XDG_DATA_DIRS=@tpglibtestsdir@:$XDG_DATA_DIRS export XDG_DATA_DIRS G_SLICE=debug-blocks export G_SLICE G_DEBUG=fatal_warnings,fatal_criticals export G_DEBUG libexec=@libexec@ export libexec TP_TESTS_SERVICES_DIR=@tpglibtestsdir@/dbus-1/services export TP_TESTS_SERVICES_DIR GIO_USE_VFS=local export GIO_USE_VFS GSETTINGS_BACKEND=memory export GSETTINGS_BACKEND DBUS_SESSION_BUS_ADDRESS=this-is-clearly-not-valid export DBUS_SESSION_BUS_ADDRESS if [ -n "$1" ] ; then list="$1" else echo "Usage: $0 testname" exit 1 fi for i in $list ; do echo "Testing $i" @tpglibtestsdir@/tools/test-wrapper.sh @tpglibtestsdir@/$i done telepathy-glib-0.24.2/tests/dbus/connection-error.c0000644000175000017500000002672114004033172017165 00000000000000/* Feature test for ConnectionError signal emission * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" static int connection_errors; static void on_connection_error (TpConnection *conn, const gchar *error, GHashTable *details, gpointer user_data, GObject *weak_object) { connection_errors++; g_assert_cmpstr (error, ==, "com.example.DomainSpecificError"); g_assert_cmpuint (g_hash_table_size (details), ==, 0); } static void on_status_changed (TpConnection *conn, guint status, guint reason, gpointer user_data, GObject *weak_object) { g_assert_cmpuint (status, ==, TP_CONNECTION_STATUS_DISCONNECTED); g_assert_cmpuint (reason, ==, TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); g_main_loop_quit (user_data); } typedef enum { DOMAIN_SPECIFIC_ERROR = 0, } ExampleError; /* example_com_error_get_type relies on this */ G_STATIC_ASSERT (sizeof (GType) <= sizeof (gsize)); static GType example_com_error_get_type (void) { static gsize type = 0; if (g_once_init_enter (&type)) { static const GEnumValue values[] = { { DOMAIN_SPECIFIC_ERROR, "DOMAIN_SPECIFIC_ERROR", "DomainSpecificError" }, { 0 } }; GType gtype; gtype = g_enum_register_static ("ExampleError", values); g_once_init_leave (&type, gtype); } return (GType) type; } static GQuark example_com_error_quark (void) { static gsize quark = 0; if (g_once_init_enter (&quark)) { GQuark domain = g_quark_from_static_string ("com.example"); g_assert (sizeof (GQuark) <= sizeof (gsize)); dbus_g_error_domain_register (domain, "com.example", example_com_error_get_type ()); g_once_init_leave (&quark, domain); } return (GQuark) quark; } typedef struct { TpDBusDaemon *dbus; GMainLoop *mainloop; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; } Test; static void global_setup (void) { static gboolean done = FALSE; if (done) return; done = TRUE; tp_debug_set_flags ("all"); tp_proxy_subclass_add_error_mapping (TP_TYPE_CONNECTION, "com.example", example_com_error_quark (), example_com_error_get_type ()); } static void setup (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; global_setup (); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->service_conn = TP_TESTS_SIMPLE_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); MYASSERT (test->service_conn != NULL, ""); MYASSERT (test->service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (test->service_conn_as_base, "simple", &test->conn_name, &test->conn_path, &error), ""); g_assert_no_error (error); test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); MYASSERT (test->conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (test->conn, TRUE, &error, NULL), ""); g_assert_no_error (error); } static void teardown (Test *test, gconstpointer nil G_GNUC_UNUSED) { GAsyncResult *result = NULL; tp_connection_disconnect_async (test->conn, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); /* Ignore success/failure: it might already have gone */ g_object_unref (result); test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); g_object_unref (test->dbus); g_main_loop_unref (test->mainloop); } static void test_registered_error (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; const GHashTable *asv; asv = GUINT_TO_POINTER (0xDEADBEEF); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, NULL); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, NULL); g_assert_cmpuint (GPOINTER_TO_UINT (asv), ==, 0xDEADBEEF); connection_errors = 0; tp_cli_connection_connect_to_connection_error (test->conn, on_connection_error, NULL, NULL, NULL, NULL); tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed, test->mainloop, NULL, NULL, NULL); tp_base_connection_disconnect_with_dbus_error (test->service_conn_as_base, "com.example.DomainSpecificError", NULL, TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); g_main_loop_run (test->mainloop); g_assert_cmpuint (connection_errors, ==, 1); MYASSERT (!tp_connection_run_until_ready (test->conn, FALSE, &error, NULL), ""); g_assert_error (error, example_com_error_quark (), DOMAIN_SPECIFIC_ERROR); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, "com.example.DomainSpecificError"); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, "com.example.DomainSpecificError"); g_assert (asv != NULL); g_assert_cmpstr (g_quark_to_string (error->domain), ==, g_quark_to_string (example_com_error_quark ())); g_assert_cmpuint (error->code, ==, DOMAIN_SPECIFIC_ERROR); g_error_free (error); error = NULL; } static void on_unregistered_connection_error (TpConnection *conn, const gchar *error, GHashTable *details, gpointer user_data, GObject *weak_object) { connection_errors++; g_assert_cmpstr (error, ==, "net.example.WTF"); g_assert_cmpuint (g_hash_table_size (details), ==, 0); } static void test_unregistered_error (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; const GHashTable *asv; connection_errors = 0; tp_cli_connection_connect_to_connection_error (test->conn, on_unregistered_connection_error, NULL, NULL, NULL, NULL); tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed, test->mainloop, NULL, NULL, NULL); tp_base_connection_disconnect_with_dbus_error (test->service_conn_as_base, "net.example.WTF", NULL, TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); g_main_loop_run (test->mainloop); g_assert_cmpuint (connection_errors, ==, 1); MYASSERT (!tp_connection_run_until_ready (test->conn, FALSE, &error, NULL), ""); /* Because we didn't understand net.example.WTF as a GError, TpConnection * falls back to turning the Connection_Status_Reason into a GError. */ g_assert_error (error, TP_ERROR, TP_ERROR_NETWORK_ERROR); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, "net.example.WTF"); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, "net.example.WTF"); g_assert (asv != NULL); g_error_free (error); error = NULL; } static void on_detailed_connection_error (TpConnection *conn, const gchar *error, GHashTable *details, gpointer user_data, GObject *weak_object) { connection_errors++; g_assert_cmpstr (error, ==, "com.example.DomainSpecificError"); g_assert_cmpuint (g_hash_table_size (details), ==, 2); } static void test_detailed_error (Test *test, gconstpointer mode) { GError *error = NULL; const GHashTable *asv; gchar *str; GVariant *variant; gboolean ok; gint32 bees; asv = GUINT_TO_POINTER (0xDEADBEEF); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, NULL); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, NULL); g_assert_cmpuint (GPOINTER_TO_UINT (asv), ==, 0xDEADBEEF); connection_errors = 0; tp_cli_connection_connect_to_connection_error (test->conn, on_detailed_connection_error, NULL, NULL, NULL, NULL); tp_cli_connection_connect_to_status_changed (test->conn, on_status_changed, test->mainloop, NULL, NULL, NULL); if (!tp_strdiff (mode, "variant")) { GVariant *details = g_variant_parse (G_VARIANT_TYPE_VARDICT, "{ 'debug-message': <'not enough bees'>, " " 'bees-required': <2342> }", NULL, NULL, &error); g_assert_no_error (error); tp_base_connection_disconnect_with_dbus_error_vardict ( test->service_conn_as_base, "com.example.DomainSpecificError", details, TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); g_variant_unref (details); } else { GHashTable *details = tp_asv_new ( "debug-message", G_TYPE_STRING, "not enough bees", "bees-required", G_TYPE_INT, 2342, NULL); tp_base_connection_disconnect_with_dbus_error ( test->service_conn_as_base, "com.example.DomainSpecificError", details, TP_CONNECTION_STATUS_REASON_NETWORK_ERROR); g_hash_table_unref (details); } g_main_loop_run (test->mainloop); g_assert_cmpuint (connection_errors, ==, 1); MYASSERT (!tp_connection_run_until_ready (test->conn, FALSE, &error, NULL), ""); g_assert_error (error, example_com_error_quark (), DOMAIN_SPECIFIC_ERROR); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, "com.example.DomainSpecificError"); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, "com.example.DomainSpecificError"); g_assert (asv != NULL); g_assert_cmpstr (tp_asv_get_string (asv, "debug-message"), ==, "not enough bees"); g_assert_cmpint (tp_asv_get_int32 (asv, "bees-required", NULL), ==, 2342); str = tp_connection_dup_detailed_error_vardict (test->conn, NULL); g_assert_cmpstr (str, ==, "com.example.DomainSpecificError"); g_free (str); str = tp_connection_dup_detailed_error_vardict (test->conn, &variant); g_assert_cmpstr (str, ==, "com.example.DomainSpecificError"); g_free (str); g_assert (variant != NULL); ok = g_variant_lookup (variant, "debug-message", "s", &str); g_assert (ok); g_assert_cmpstr (str, ==, "not enough bees"); g_free (str); ok = g_variant_lookup (variant, "bees-required", "i", &bees); g_assert (ok); g_assert_cmpint (bees, ==, 2342); g_assert_cmpstr (g_quark_to_string (error->domain), ==, g_quark_to_string (example_com_error_quark ())); g_assert_cmpuint (error->code, ==, DOMAIN_SPECIFIC_ERROR); g_error_free (error); error = NULL; } int main (int argc, char **argv) { tp_tests_abort_after (10); g_test_init (&argc, &argv, NULL); g_test_add ("/connection/registered-error", Test, NULL, setup, test_registered_error, teardown); g_test_add ("/connection/unregistered-error", Test, NULL, setup, test_unregistered_error, teardown); g_test_add ("/connection/detailed-error", Test, NULL, setup, test_detailed_error, teardown); g_test_add ("/connection/detailed-error-vardict", Test, "variant", setup, test_detailed_error, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/connection-getinterfaces-failure.c0000644000175000017500000000736312652510705022316 00000000000000/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=15306 * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" static GType bug15306_connection_get_type (void); typedef TpTestsSimpleConnection Bug15306Connection; typedef TpTestsSimpleConnectionClass Bug15306ConnectionClass; static void bug15306_conn_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (Bug15306Connection, bug15306_connection, TP_TESTS_TYPE_SIMPLE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, bug15306_conn_iface_init)) static void bug15306_connection_init (Bug15306Connection *self) { } static void bug15306_connection_class_init (Bug15306ConnectionClass *klass) { } static void bug15306_get_interfaces (TpSvcConnection *iface, DBusGMethodInvocation *context) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "testing fd.o #15306" }; dbus_g_method_return_error (context, &e); } static void bug15306_conn_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_implement_##x (klass, \ bug15306_##x) IMPLEMENT (get_interfaces); #undef IMPLEMENT } static GMainLoop *mainloop; static void on_status_changed (TpConnection *connection, guint status, guint reason, gpointer user_data, GObject *weak_object) { MYASSERT (status == TP_CONNECTION_STATUS_DISCONNECTED, "%u", status); } static void on_shutdown_finished (TpBaseConnection *base_conn, gpointer user_data) { g_main_loop_quit (mainloop); } int main (int argc, char **argv) { TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; TpDBusDaemon *dbus; TpConnection *conn; GError *error = NULL; gchar *name; gchar *conn_path; tp_tests_abort_after (10); tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( bug15306_connection_get_type (), "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); g_signal_connect (service_conn, "shutdown-finished", G_CALLBACK (on_shutdown_finished), NULL); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* disconnect the service_conn */ MYASSERT (tp_cli_connection_connect_to_status_changed (conn, on_status_changed, NULL, NULL, NULL, NULL), ""); tp_tests_simple_connection_inject_disconnect (service_conn); g_main_loop_run (mainloop); g_object_unref (conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_main_loop_unref (mainloop); g_free (name); g_free (conn_path); return 0; } telepathy-glib-0.24.2/tests/dbus/text-channel.c0000644000175000017500000007517012652510705016304 00000000000000/* Tests of TpTextChannel * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "examples/cm/echo-message-parts/chan.h" #include "tests/lib/contacts-conn.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; ExampleEcho2Channel *chan_service; ExampleEcho2Channel *sms_chan_service; TpHandleRepoIface *contact_repo; TpHandle bob; /* Client side objects */ TpConnection *connection; TpTextChannel *channel; TpTextChannel *sms_channel; TpMessage *received_msg; TpMessage *removed_msg; TpMessage *sent_msg; gchar *token; gchar *sent_token; TpMessageSendingFlags sending_flags; GError *error /* initialized where needed */; gint wait; } Test; static void create_contact_chan (Test *test) { gchar *chan_path; GHashTable *props; tp_clear_object (&test->chan_service); tp_clear_object (&test->sms_chan_service); /* Create service-side tube channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); test->bob = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); g_assert (test->bob != 0); test->chan_service = g_object_new ( EXAMPLE_TYPE_ECHO_2_CHANNEL, "connection", test->base_connection, "handle", test->bob, "object-path", chan_path, NULL); g_object_get (test->chan_service, "channel-properties", &props, NULL); test->channel = tp_text_channel_new (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_free (chan_path); g_hash_table_unref (props); /* Register channel implementing SMS */ chan_path = g_strdup_printf ("%s/ChannelSMS", tp_proxy_get_object_path (test->connection)); test->sms_chan_service = g_object_new ( EXAMPLE_TYPE_ECHO_2_CHANNEL, "connection", test->base_connection, "handle", test->bob, "object-path", chan_path, "sms", TRUE, NULL); g_object_get (test->chan_service, "channel-properties", &props, NULL); test->sms_channel = tp_text_channel_new (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_free (chan_path); g_hash_table_unref (props); } static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", &test->base_connection, &test->connection); create_contact_chan (test); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->chan_service); tp_clear_object (&test->sms_chan_service); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->received_msg); tp_clear_object (&test->removed_msg); tp_clear_object (&test->sent_msg); tp_clear_pointer (&test->token, g_free); tp_clear_pointer (&test->sent_token, g_free); tp_clear_object (&test->channel); tp_clear_object (&test->sms_channel); } static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { const GError *error = NULL; g_assert (TP_IS_TEXT_CHANNEL (test->channel)); error = tp_proxy_get_invalidated (test->channel); g_assert_no_error (error); } static void check_messages_types (GArray *message_types) { TpChannelTextMessageType type; g_assert (message_types != NULL); g_assert_cmpuint (message_types->len, ==, 3); type = g_array_index (message_types, TpChannelTextMessageType, 0); g_assert_cmpuint (type, ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL); type = g_array_index (message_types, TpChannelTextMessageType, 1); g_assert_cmpuint (type, ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); type = g_array_index (message_types, TpChannelTextMessageType, 2); g_assert_cmpuint (type, ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GStrv content_types; const gchar * const * content_types2; TpMessagePartSupportFlags message_part; TpDeliveryReportingSupportFlags delivery; GArray *message_types; g_object_get (test->channel, "supported-content-types", &content_types, "message-part-support-flags", &message_part, "delivery-reporting-support", &delivery, "message-types", &message_types, NULL); /* SupportedContentTypes */ g_assert_cmpuint (g_strv_length (content_types), ==, 1); g_assert_cmpstr (content_types[0], ==, "*/*"); g_strfreev (content_types); content_types2 = tp_text_channel_get_supported_content_types (test->channel); g_assert_cmpstr (content_types2[0], ==, "*/*"); /* MessagePartSupportFlags */ g_assert_cmpuint (message_part, ==, TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT | TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS | TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES); g_assert_cmpuint (message_part, ==, tp_text_channel_get_message_part_support_flags (test->channel)); /* DeliveryReportingSupport */ g_assert_cmpuint (delivery, ==, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES); g_assert_cmpuint (delivery, ==, tp_text_channel_get_delivery_reporting_support (test->channel)); /* MessageTypes */ check_messages_types (message_types); g_array_unref (message_types); message_types = tp_text_channel_get_message_types (test->channel); check_messages_types (message_types); g_assert (tp_text_channel_supports_message_type (test->channel, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL)); g_assert (tp_text_channel_supports_message_type (test->channel, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION)); g_assert (tp_text_channel_supports_message_type (test->channel, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE)); g_assert (!tp_text_channel_supports_message_type (test->channel, TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY)); g_assert (!tp_text_channel_supports_message_type (test->channel, TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT)); } static void proxy_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void send_message_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_clear_pointer (&test->token, g_free); tp_text_channel_send_message_finish (TP_TEXT_CHANNEL (source), result, &test->token, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void on_received (TpChannel *chan, guint id, guint timestamp, guint sender, guint type, guint flags, const gchar *text, gpointer user_data, GObject *object) { Test *test = user_data; test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_pending_messages (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; GList *messages; TpMessage *msg; gchar *text; TpContact *sender; /* connect on the Received sig to check if the message has been received */ tp_cli_channel_type_text_connect_to_received (TP_CHANNEL (test->channel), on_received, test, NULL, NULL, NULL); /* Send a first message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Badger"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Send a second message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Snake"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* We didn't prepare the feature yet so there is no pending msg */ messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 0); g_list_free (messages); tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->channel, TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES)); /* We have the pending messages now */ messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 2); /* Check first message */ msg = messages->data; g_assert (TP_IS_SIGNALLED_MESSAGE (msg)); text = tp_message_to_text (msg, NULL); g_assert_cmpstr (text, ==, "Badger"); g_free (text); sender = tp_signalled_message_get_sender (msg); g_assert (sender != NULL); g_assert_cmpstr (tp_contact_get_identifier (sender), ==, "bob"); /* Check second message */ msg = messages->next->data; g_assert (TP_IS_SIGNALLED_MESSAGE (msg)); text = tp_message_to_text (msg, NULL); g_assert_cmpstr (text, ==, "Snake"); g_free (text); sender = tp_signalled_message_get_sender (msg); g_assert (sender != NULL); g_assert_cmpstr (tp_contact_get_identifier (sender), ==, "bob"); g_list_free (messages); } static void message_received_cb (TpTextChannel *chan, TpSignalledMessage *msg, Test *test) { tp_clear_object (&test->received_msg); test->received_msg = g_object_ref (msg); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_message_received (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; TpMessage *msg; gchar *text; TpContact *sender; /* We have to prepare the pending messages feature to be notified about * incoming messages */ tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_signal_connect (test->channel, "message-received", G_CALLBACK (message_received_cb), test); msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Snake"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); text = tp_message_to_text (test->received_msg, NULL); g_assert_cmpstr (text, ==, "Snake"); g_free (text); sender = tp_signalled_message_get_sender (test->received_msg); g_assert (sender != NULL); g_assert_cmpstr (tp_contact_get_identifier (sender), ==, "bob"); g_object_unref (msg); } static void messages_acked_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_text_channel_ack_messages_finish (TP_TEXT_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_ack_messages (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; GList *messages; TpMessage *msg; /* Send a first message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Badger"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); /* Send a second message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Snake"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 2); tp_text_channel_ack_messages_async (test->channel, messages, messages_acked_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_list_free (messages); /* Messages have been acked so there is no pending messages */ messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 0); } static void message_acked_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_text_channel_ack_message_finish (TP_TEXT_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void pending_message_removed_cb (TpTextChannel *chan, TpSignalledMessage *msg, Test *test) { tp_clear_object (&test->removed_msg); test->removed_msg = g_object_ref (msg); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_ack_message (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; GList *messages; TpMessage *msg; tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_signal_connect (test->channel, "message-received", G_CALLBACK (message_received_cb), test); /* Send message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Badger"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (TP_IS_SIGNALLED_MESSAGE (test->received_msg)); g_signal_connect (test->channel, "pending-message-removed", G_CALLBACK (pending_message_removed_cb), test); tp_text_channel_ack_message_async (test->channel, test->received_msg, message_acked_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->received_msg == test->removed_msg); /* Messages has been acked so there is no pending messages */ messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 0); } static void message_sent_cb (TpTextChannel *channel, TpSignalledMessage *message, TpMessageSendingFlags flags, const gchar *token, Test *test) { tp_clear_object (&test->sent_msg); tp_clear_pointer (&test->sent_token, g_free); test->sent_msg = g_object_ref (message); test->sending_flags = flags; if (token != NULL) test->sent_token = g_strdup (token); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_message_sent (Test *test, gconstpointer data G_GNUC_UNUSED) { TpMessage *msg; gchar *text; g_signal_connect (test->channel, "message-sent", G_CALLBACK (message_sent_cb), test); /* Send message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Badger"); tp_text_channel_send_message_async (test->channel, msg, TP_MESSAGE_SENDING_FLAG_REPORT_DELIVERY, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (TP_IS_SIGNALLED_MESSAGE (test->sent_msg)); text = tp_message_to_text (test->sent_msg, NULL); g_assert_cmpstr (text, ==, "Badger"); g_free (text); g_assert_cmpuint (test->sending_flags, ==, TP_MESSAGE_SENDING_FLAG_REPORT_DELIVERY); g_assert (test->sent_token == NULL); } static void notify_cb (GObject *object, GParamSpec *spec, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_sms_feature (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean is_sms; GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_SMS, 0 }; g_assert (tp_text_channel_get_sms_flash (test->sms_channel)); /* SMS feature is not prepared yet */ g_assert (!tp_text_channel_is_sms_channel (test->sms_channel)); g_object_get (test->sms_channel, "is-sms-channel", &is_sms, NULL); g_assert (!is_sms); test->wait++; tp_proxy_prepare_async (test->sms_channel, features, proxy_prepare_cb, test); test->wait++; g_signal_connect (test->sms_channel, "notify::is-sms-channel", G_CALLBACK (notify_cb), test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Feature has been prepared */ g_assert (tp_text_channel_is_sms_channel (test->sms_channel)); g_object_get (test->sms_channel, "is-sms-channel", &is_sms, NULL); g_assert (is_sms); /* Property is changed */ example_echo_2_channel_set_sms (test->sms_chan_service, FALSE); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (!tp_text_channel_is_sms_channel (test->sms_channel)); g_object_get (test->sms_channel, "is-sms-channel", &is_sms, NULL); g_assert (!is_sms); } #define MSG "Oh hi!" static void get_sms_length_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; guint chunks_required; gint remaining_characters; gint estimated_cost; tp_text_channel_get_sms_length_finish (TP_TEXT_CHANNEL (source), result, &chunks_required, &remaining_characters, &estimated_cost, &test->error); g_assert_cmpuint (chunks_required, ==, strlen (MSG)); g_assert_cmpint (remaining_characters, ==, EXAMPLE_ECHO_2_CHANNEL_MAX_SMS_LENGTH - strlen (MSG)); g_assert_cmpint (estimated_cost, ==, -1); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_get_sms_length (Test *test, gconstpointer data G_GNUC_UNUSED) { TpMessage *msg; msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, MSG); tp_text_channel_get_sms_length_async (test->channel, msg, get_sms_length_cb, test); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_object_unref (msg); } static void all_pending_messages_acked_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_text_channel_ack_all_pending_messages_finish (TP_TEXT_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_ack_all_pending_messages (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; GList *messages; TpMessage *msg; /* Send a first message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Badger"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); /* Send a second message */ msg = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Snake"); tp_text_channel_send_message_async (test->channel, msg, 0, send_message_cb, test); g_object_unref (msg); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 2); tp_text_channel_ack_all_pending_messages_async (test->channel, all_pending_messages_acked_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_list_free (messages); /* Messages have been acked so there is no pending messages */ messages = tp_text_channel_get_pending_messages (test->channel); g_assert_cmpuint (g_list_length (messages), ==, 0); } static void test_pending_messages_with_no_sender_id (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; TpMessage *cm_message; TpMessage *signalled_message; GList *messages; TpContact *sender; gchar *text; g_test_bug ("39172"); /* Deliberately passing sender=0 so we can set message-sender manually; if we set * it here, or using tp_cm_message_set_sender(), message-sender-id will be * filled in, which is exactly what we don't want. */ cm_message = tp_cm_message_new_text (test->base_connection, 0, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "hi mum"); tp_message_set_uint32 (cm_message, 0, "message-sender", test->bob); g_assert_cmpstr (NULL, ==, tp_asv_get_string (tp_message_peek (cm_message, 0), "message-sender-id")); tp_message_mixin_take_received (G_OBJECT (test->chan_service), cm_message); test->wait = 1; tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); messages = tp_text_channel_get_pending_messages (test->channel); g_assert (messages != NULL); g_assert_cmpuint (g_list_length (messages), ==, 1); signalled_message = messages->data; sender = tp_signalled_message_get_sender (signalled_message); g_assert (sender != NULL); g_assert_cmpstr (tp_contact_get_identifier (sender), ==, "bob"); text = tp_message_to_text ((TpMessage *) signalled_message, NULL); g_assert_cmpstr (text, ==, "hi mum"); g_free (text); g_list_free (messages); } static void test_sender_prepared (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; TpSimpleClientFactory *factory; TpHandle admin; TpContact *sender; TpMessage *msg; tp_tests_proxy_run_until_prepared (test->channel, features); /* Simulate a message received from a new contact */ admin = tp_handle_ensure (test->contact_repo, "admin", NULL, NULL); msg = tp_cm_message_new_text (test->base_connection, admin, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Service interuption in 1h"); tp_message_mixin_take_received ((GObject *) test->chan_service, msg); g_signal_connect (test->channel, "message-received", G_CALLBACK (message_received_cb), test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* No feature was set on the factory */ sender = tp_signalled_message_get_sender (test->received_msg); g_assert (!tp_contact_has_feature (sender, TP_CONTACT_FEATURE_ALIAS)); /* Now ask to prepare ALIAS, on next msg it will be prepared */ factory = tp_proxy_get_factory (test->connection); tp_simple_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_INVALID); msg = tp_cm_message_new_text (test->base_connection, admin, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Service interuption in 30min"); tp_message_mixin_take_received ((GObject *) test->chan_service, msg); g_signal_connect (test->channel, "message-received", G_CALLBACK (message_received_cb), test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); sender = tp_signalled_message_get_sender (test->received_msg); g_assert (tp_contact_has_feature (sender, TP_CONTACT_FEATURE_ALIAS)); } static void test_sent_with_no_sender (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *parts; TpContact *sender; tp_tests_proxy_run_until_prepared (test->channel, NULL); /* Simulate a message sent with no sender, it must fallback to * connection's self-contact. Unfortunately we cannot use the message mixin * because it force setting a sender, and we can't use TpCMMessage to create * parts because it's kept private. So back to old school. */ parts = g_ptr_array_new_with_free_func ((GDestroyNotify) g_hash_table_unref); g_ptr_array_add (parts, tp_asv_new ( "message-type", G_TYPE_UINT, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, NULL)); g_ptr_array_add (parts, tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, "bla bla bla", NULL)); g_signal_connect (test->channel, "message-sent", G_CALLBACK (message_sent_cb), test); tp_svc_channel_interface_messages_emit_message_sent (test->chan_service, parts, 0, "this-is-a-token"); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); sender = tp_signalled_message_get_sender (test->sent_msg); g_assert (sender == tp_connection_get_self_contact (test->connection)); g_ptr_array_unref (parts); } static void test_receive_muc_delivery (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, 0 }; GPtrArray *parts; GHashTable *header; g_test_bug ("41929 "); /* We have to prepare the pending messages feature to be notified about * incoming messages */ tp_proxy_prepare_async (test->channel, features, proxy_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_signal_connect (test->channel, "message-received", G_CALLBACK (message_received_cb), test); /* build delivery report */ parts = g_ptr_array_new_with_free_func ((GDestroyNotify) g_hash_table_unref); header = tp_asv_new (NULL, NULL); g_ptr_array_add (parts, header); tp_asv_set_uint32 (header, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); tp_asv_set_uint32 (header, "pending-message-id", 5); tp_asv_set_string (header, "message-token", "message_token"); tp_asv_set_string (header, "delivery-token", "delivery_token"); tp_asv_set_uint32 (header, "delivery-status", TP_DELIVERY_STATUS_DELIVERED); tp_svc_channel_interface_messages_emit_message_received (test->chan_service, parts); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (tp_message_get_message_type (test->received_msg), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); g_ptr_array_unref (parts); } static void set_chat_state_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_text_channel_set_chat_state_finish (TP_TEXT_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void contact_chat_state_changed_cb (TpTextChannel *channel, TpContact *contact, TpChannelChatState state, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_chat_state (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_CONTACTS, TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, 0 }; TpContact *contact; TpChannelChatState state; /* Set an initial chat state, prepare the channel, and verify target contact * has that state */ tp_message_mixin_change_chat_state (G_OBJECT (test->chan_service), test->bob, TP_CHANNEL_CHAT_STATE_COMPOSING); tp_tests_proxy_run_until_prepared (test->channel, features); contact = tp_channel_get_target_contact ((TpChannel *) test->channel); state = tp_text_channel_get_chat_state (test->channel, contact); g_assert_cmpuint (state, ==, TP_CHANNEL_CHAT_STATE_COMPOSING); /* Test setting invalid chat state */ tp_text_channel_set_chat_state_async (test->channel, -1, set_chat_state_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); tp_text_channel_set_chat_state_async (test->channel, TP_CHANNEL_CHAT_STATE_GONE, set_chat_state_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); /* Now set a valid chat state and verify self contact has that state */ tp_text_channel_set_chat_state_async (test->channel, TP_CHANNEL_CHAT_STATE_COMPOSING, set_chat_state_cb, test); g_signal_connect (test->channel, "contact-chat-state-changed", G_CALLBACK (contact_chat_state_changed_cb), test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); contact = tp_connection_get_self_contact (test->connection); state = tp_text_channel_get_chat_state (test->channel, contact); g_assert_cmpuint (state, ==, TP_CHANNEL_CHAT_STATE_COMPOSING); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/text-channel/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/text-channel/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/text-channel/pending-messages", Test, NULL, setup, test_pending_messages, teardown); g_test_add ("/text-channel/message-received", Test, NULL, setup, test_message_received, teardown); g_test_add ("/text-channel/ack-messages", Test, NULL, setup, test_ack_messages, teardown); g_test_add ("/text-channel/ack-message", Test, NULL, setup, test_ack_message, teardown); g_test_add ("/text-channel/message-sent", Test, NULL, setup, test_message_sent, teardown); g_test_add ("/text-channel/sms-feature", Test, NULL, setup, test_sms_feature, teardown); g_test_add ("/text-channel/get-sms-length", Test, NULL, setup, test_get_sms_length, teardown); g_test_add ("/text-channel/ack-all-pending-messages", Test, NULL, setup, test_ack_all_pending_messages, teardown); g_test_add ("/text-channel/pending-messages-with-no-sender-id", Test, NULL, setup, test_pending_messages_with_no_sender_id, teardown); g_test_add ("/text-channel/sender-prepared", Test, NULL, setup, test_sender_prepared, teardown); g_test_add ("/text-channel/sent-with-no-sender", Test, NULL, setup, test_sent_with_no_sender, teardown); g_test_add ("/text-channel/receive-muc-delivery", Test, NULL, setup, test_receive_muc_delivery, teardown); g_test_add ("/text-channel/chat-state", Test, NULL, setup, test_chat_state, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/get-interface-after-invalidate.c0000644000175000017500000000233512652510705021635 00000000000000#include "config.h" #include #include #include #include #include "tests/lib/util.h" static void test_get_interface_after_invalidate (void) { TpDBusDaemon *bus_daemon; DBusGProxy *props; GError invalidation_reason = { TP_ERROR, TP_ERROR_NOT_YOURS, "bees!" }; GError *error = NULL; bus_daemon = tp_tests_dbus_daemon_dup_or_die (); tp_proxy_invalidate ((TpProxy *) bus_daemon, &invalidation_reason); props = tp_proxy_borrow_interface_by_id ((TpProxy *) bus_daemon, TP_IFACE_QUARK_DBUS_DAEMON, &error); /* Borrowing the interface should fail because the proxy is invalidated. */ g_assert (props == NULL); g_assert (error != NULL); g_assert_cmpuint (error->domain, ==, invalidation_reason.domain); g_assert_cmpint (error->code, ==, invalidation_reason.code); g_assert_cmpstr (error->message, ==, invalidation_reason.message); g_error_free (error); g_object_unref (bus_daemon); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_add_func ("/test-get-interface-after-invalidate", test_get_interface_after_invalidate); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/call-channel.c0000644000175000017500000010334212652510705016224 00000000000000/* Tests for TpCallChannel, TpCallContent and TpCallStream * * Copyright © 2009-2011 Collabora Ltd. * Copyright © 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include "examples/cm/call/cm.h" #include "examples/cm/call/conn.h" #include "examples/cm/call/call-channel.h" #include "examples/cm/call/call-stream.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; GError *error /* statically initialized to NULL */ ; guint wait_count; ExampleCallConnectionManager *service_cm; TpSimpleClientFactory *factory; TpConnectionManager *cm; TpConnection *conn; TpChannel *chan; TpCallChannel *call_chan; TpHandle self_handle; TpHandle peer_handle; GArray *audio_request; GArray *video_request; GArray *invalid_request; GArray *stream_ids; GArray *contacts; TpCallContent *added_content; } Test; static void setup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpBaseConnectionManager *service_cm_as_base; gboolean ok; gchar *bus_name; gchar *object_path; GHashTable *parameters; guint audio = TP_MEDIA_STREAM_TYPE_AUDIO; guint video = TP_MEDIA_STREAM_TYPE_VIDEO; guint not_a_media_type = 31337; GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->service_cm = EXAMPLE_CALL_CONNECTION_MANAGER ( tp_tests_object_new_static_class ( EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, NULL)); g_assert (test->service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (test->service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); test->cm = tp_connection_manager_new (test->dbus, "example_call", NULL, &test->error); g_assert (test->cm != NULL); tp_tests_proxy_run_until_prepared (test->cm, NULL); parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "account", tp_g_value_slice_new_static_string ("me")); g_hash_table_insert (parameters, "simulation-delay", tp_g_value_slice_new_uint (0)); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, &bus_name, &object_path, &test->error, NULL); g_assert_no_error (test->error); test->factory = (TpSimpleClientFactory *) tp_automatic_client_factory_new (test->dbus); tp_simple_client_factory_add_channel_features_varargs (test->factory, TP_CHANNEL_FEATURE_CONTACTS, 0); test->conn = tp_simple_client_factory_ensure_connection (test->factory, object_path, NULL, &test->error); g_assert_no_error (test->error); g_assert (test->conn != NULL); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (test->conn, conn_features); test->self_handle = tp_connection_get_self_handle (test->conn); g_assert (test->self_handle != 0); test->audio_request = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); g_array_append_val (test->audio_request, audio); test->video_request = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); g_array_append_val (test->video_request, video); test->invalid_request = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); g_array_append_val (test->invalid_request, not_a_media_type); test->stream_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); g_hash_table_unref (parameters); g_free (bus_name); g_free (object_path); } static void channel_created_cb (TpConnection *connection, const gchar *object_path, GHashTable *immutable_properties, const GError *error, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; GError *new_error = NULL; g_assert_no_error ((GError *) error); test->chan = tp_simple_client_factory_ensure_channel (test->factory, connection, object_path, immutable_properties, &new_error); g_assert_no_error (new_error); g_assert (TP_IS_CALL_CHANNEL (test->chan)); test->call_chan = (TpCallChannel *) test->chan; test->peer_handle = tp_channel_get_handle (test->chan, NULL); g_main_loop_quit (test->mainloop); } static void outgoing_call (Test *test, const gchar *id, gboolean initial_audio, gboolean initial_video) { GHashTable *request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, id, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, initial_audio, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, initial_video, NULL); tp_cli_connection_interface_requests_call_create_channel (test->conn, -1, request, channel_created_cb, test, NULL, NULL); g_hash_table_unref (request); request = NULL; g_main_loop_run (test->mainloop); tp_tests_proxy_run_until_prepared (test->chan, NULL); } static void assert_call_properties (TpCallChannel *channel, TpCallState call_state, TpHandle actor, TpCallStateChangeReason reason, const gchar *dbus_reason, gboolean check_call_flags, TpCallFlags call_flags, gboolean check_initials, gboolean initial_audio, gboolean initial_video) { TpCallState state; TpCallFlags flags; GHashTable *details; TpCallStateReason *r; state = tp_call_channel_get_state (channel, &flags, &details, &r); /* FIXME: details */ g_assert_cmpuint (state, ==, call_state); g_assert_cmpuint (r->actor, ==, actor); g_assert_cmpuint (r->reason, ==, reason); g_assert_cmpstr (r->dbus_reason, ==, dbus_reason); if (check_call_flags) g_assert_cmpuint (flags, ==, call_flags); /* Hard-coded properties */ g_assert_cmpint (tp_call_channel_has_hardware_streaming (channel), ==, FALSE); g_assert_cmpint (tp_call_channel_has_mutable_contents (channel), ==, TRUE); if (check_initials) { const gchar *initial_audio_name; const gchar *initial_video_name; g_assert_cmpint (tp_call_channel_has_initial_audio (channel, &initial_audio_name), ==, initial_audio); g_assert_cmpint (tp_call_channel_has_initial_video (channel, &initial_video_name), ==, initial_video); g_assert_cmpstr (initial_audio_name, ==, initial_audio ? "audio" : NULL); g_assert_cmpstr (initial_video_name, ==, initial_video ? "video" : NULL); } } static void assert_content_properties (TpCallContent *content, TpMediaStreamType type, TpCallContentDisposition disposition) { g_assert_cmpstr (tp_call_content_get_name (content), !=, NULL); g_assert_cmpuint (tp_call_content_get_media_type (content), ==, type); g_assert_cmpuint (tp_call_content_get_disposition (content), ==, disposition); } static void close_cb (GObject *object, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_channel_close_finish (test->chan, result, &test->error); g_main_loop_quit (test->mainloop); } static void assert_ended_and_run_close (Test *test, TpHandle expected_actor, TpCallStateChangeReason expected_reason, const gchar *expected_error) { GPtrArray *contents; tp_tests_proxy_run_until_dbus_queue_processed (test->conn); /* In response to whatever we just did, the call ends... */ assert_call_properties (test->call_chan, TP_CALL_STATE_ENDED, expected_actor, expected_reason, expected_error, FALSE, 0, /* ignore call flags */ FALSE, FALSE, FALSE); /* ignore initial audio/video */ /* ... which means there are no contents ... */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 0); /* ... but the channel doesn't close */ g_assert (tp_proxy_get_invalidated (test->chan) == NULL); /* When we call Close it finally closes */ tp_channel_close_async (test->chan, close_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_tests_proxy_run_until_dbus_queue_processed (test->conn); g_assert (tp_proxy_get_invalidated (test->chan) != NULL); } static void run_until_answered_cb (TpCallChannel *channel, TpCallState state, TpCallFlags flags, TpCallStateReason *reason, GHashTable *details, Test *test) { if (state != TP_CALL_STATE_INITIALISED) g_main_loop_quit (test->mainloop); } static void run_until_answered (Test *test) { TpCallState state; guint id; state = tp_call_channel_get_state (test->call_chan, NULL, NULL, NULL); if (state != TP_CALL_STATE_INITIALISED) return; id = g_signal_connect (test->call_chan, "state-changed", G_CALLBACK (run_until_answered_cb), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->call_chan, id); } static void run_until_ended_cb (TpCallChannel *channel, TpCallState state, TpCallFlags flags, TpCallStateReason *reason, GHashTable *details, Test *test) { if (state == TP_CALL_STATE_ENDED) g_main_loop_quit (test->mainloop); } static void run_until_ended (Test *test) { TpCallState state; guint id; state = tp_call_channel_get_state (test->call_chan, NULL, NULL, NULL); if (state == TP_CALL_STATE_ENDED) return; id = g_signal_connect (test->call_chan, "state-changed", G_CALLBACK (run_until_ended_cb), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->call_chan, id); } static void run_until_active_cb (TpCallChannel *channel, TpCallState state, TpCallFlags flags, TpCallStateReason *reason, GHashTable *details, Test *test) { if (state == TP_CALL_STATE_ACTIVE) g_main_loop_quit (test->mainloop); } static void run_until_active_get_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { GPtrArray *endpoints; guint i; g_assert_no_error (error); tp_asv_dump (properties); endpoints = tp_asv_get_boxed (properties, "Endpoints", TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_assert (endpoints != NULL); g_assert (endpoints->len > 0); for (i = 0; i < endpoints->len; i++) { const gchar *object_path = g_ptr_array_index (endpoints, i); TpProxy *endpoint; endpoint = g_object_new (TP_TYPE_PROXY, "dbus-daemon", tp_proxy_get_dbus_daemon (proxy), "bus-name", tp_proxy_get_bus_name (proxy), "object-path", object_path, NULL); tp_proxy_add_interface_by_id (endpoint, TP_IFACE_QUARK_CALL_STREAM_ENDPOINT); tp_cli_call_stream_endpoint_call_set_endpoint_state (endpoint, -1, TP_STREAM_COMPONENT_DATA, TP_STREAM_ENDPOINT_STATE_FULLY_CONNECTED, NULL, NULL, NULL, NULL); g_object_unref (endpoint); } } static void run_until_active_stream_prepared_cb (GObject *stream, GAsyncResult *res, gpointer test) { GError *error = NULL; if (!tp_proxy_prepare_finish (stream, res, &error)) { g_error ("error %s", error->message); } g_assert (tp_proxy_has_interface_by_id (stream, TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA)); tp_cli_dbus_properties_call_get_all (stream, -1, TP_IFACE_CALL_STREAM_INTERFACE_MEDIA, run_until_active_get_all_cb, test, NULL, NULL); } static void run_until_active (Test *test) { GPtrArray *contents; guint i, j; guint id; if (tp_call_channel_get_state (test->call_chan, NULL, NULL, NULL) == TP_CALL_STATE_ACTIVE) return; g_assert (tp_call_channel_get_state (test->call_chan, NULL, NULL, NULL) == TP_CALL_STATE_ACCEPTED); contents = tp_call_channel_get_contents (test->call_chan); for (i = 0; i < contents->len; i++) { TpCallContent *content = g_ptr_array_index (contents, i); GPtrArray *streams; streams = tp_call_content_get_streams (content); for (j = 0; j < streams->len; j++) { TpCallStream *stream = g_ptr_array_index (streams, j); tp_proxy_prepare_async (stream, NULL, run_until_active_stream_prepared_cb, test); } } id = g_signal_connect (test->call_chan, "state-changed", G_CALLBACK (run_until_active_cb), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->call_chan, id); } static void accept_cb (GObject *object, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_call_channel_accept_finish (test->call_chan, result, &test->error); g_main_loop_quit (test->mainloop); } static void run_until_accepted_cb (TpCallChannel *channel, TpCallState state, TpCallFlags flags, TpCallStateReason *reason, GHashTable *details, Test *test) { if (state == TP_CALL_STATE_ACCEPTED) g_main_loop_quit (test->mainloop); } static void run_until_accepted (Test *test) { guint id; tp_call_channel_accept_async (test->call_chan, NULL, NULL); id = g_signal_connect (test->call_chan, "state-changed", G_CALLBACK (run_until_accepted_cb), test); g_main_loop_run (test->mainloop); g_signal_handler_disconnect (test->call_chan, id); } static void hangup_cb (GObject *object, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_call_channel_hangup_finish (test->call_chan, result, &test->error); g_main_loop_quit (test->mainloop); } static void add_content_cb (GObject *object, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_clear_object (&test->added_content); test->added_content = tp_call_channel_add_content_finish (test->call_chan, result, &test->error); g_main_loop_quit (test->mainloop); } /* static void content_remove_cb (GObject *object, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_call_content_remove_finish ((TpCallContent *) object, result, &test->error); g_main_loop_quit (test->mainloop); } */ static void test_basics (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *contents; GPtrArray *streams; TpCallContent *audio_content; TpCallContent *video_content; TpCallStream *audio_stream; TpCallStream *video_stream; GHashTable *remote_members; gpointer v; outgoing_call (test, "basic-test", TRUE, FALSE); assert_call_properties (test->call_chan, TP_CALL_STATE_PENDING_INITIATOR, 0, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be what we said */ /* We have one audio content but it's not active just yet */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 1); audio_content = g_ptr_array_index (contents, 0); tp_tests_proxy_run_until_prepared (audio_content, NULL); assert_content_properties (audio_content, TP_MEDIA_STREAM_TYPE_AUDIO, TP_CALL_CONTENT_DISPOSITION_INITIAL); streams = tp_call_content_get_streams (audio_content); g_assert_cmpuint (streams->len, ==, 1); audio_stream = g_ptr_array_index (streams, 0); tp_tests_proxy_run_until_prepared (audio_stream, NULL); remote_members = tp_call_stream_get_remote_members (audio_stream); g_assert_cmpuint (g_hash_table_size (remote_members), ==, 1); v = g_hash_table_lookup (remote_members, tp_channel_get_target_contact (test->chan)); g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, TP_SENDING_STATE_PENDING_SEND); g_assert (tp_proxy_get_factory (audio_stream) == tp_proxy_get_factory (test->call_chan)); g_assert_cmpuint (tp_call_stream_get_local_sending_state (audio_stream), ==, TP_SENDING_STATE_SENDING); /* OK, that looks good. Actually make the call */ tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Calling Accept again makes no sense, but mustn't crash */ tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); g_clear_error (&test->error); /* Wait for the remote contact to answer, if they haven't already */ run_until_answered (test); /* Calling Accept again makes no sense, but mustn't crash */ tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); g_clear_error (&test->error); /* Check the call state. */ assert_call_properties (test->call_chan, TP_CALL_STATE_ACCEPTED, tp_channel_get_handle (test->chan, NULL), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", TRUE, 0, /* call flags */ FALSE, FALSE, FALSE); /* don't care about initial audio/video */ /* Connecting endpoints makes state become active */ run_until_active (test); assert_call_properties (test->call_chan, TP_CALL_STATE_ACTIVE, test->self_handle, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", TRUE, 0, /* call flags */ FALSE, FALSE, FALSE); /* don't care about initial audio/video */ /* There's still one content */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 1); g_assert (g_ptr_array_index (contents, 0) == audio_content); /* Other contact is sending now */ remote_members = tp_call_stream_get_remote_members (audio_stream); g_assert_cmpuint (g_hash_table_size (remote_members), == , 1); v = g_hash_table_lookup (remote_members, tp_channel_get_target_contact (test->chan)); g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, TP_SENDING_STATE_SENDING); g_assert_cmpuint (tp_call_stream_get_local_sending_state (audio_stream), ==, TP_SENDING_STATE_SENDING); /* AddContent with bad content-type must fail */ tp_call_channel_add_content_async (test->call_chan, "", 31337, TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL, add_content_cb, test); g_main_loop_run (test->mainloop); g_assert (test->error != NULL); g_assert (test->added_content == NULL); g_clear_error (&test->error); /* AddContent with bad initial-direction must fail */ tp_call_channel_add_content_async (test->call_chan, "", TP_MEDIA_STREAM_TYPE_AUDIO, 31337, add_content_cb, test); g_main_loop_run (test->mainloop); g_assert (test->error != NULL); g_assert (test->added_content == NULL); g_clear_error (&test->error); /* AddContent again, to add a video stream */ tp_call_channel_add_content_async (test->call_chan, "", TP_MEDIA_STREAM_TYPE_VIDEO, TP_MEDIA_STREAM_DIRECTION_BIDIRECTIONAL, add_content_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (TP_IS_CALL_CONTENT (test->added_content)); g_assert (tp_proxy_get_factory (test->added_content) == tp_proxy_get_factory (test->call_chan)); video_content = test->added_content; tp_tests_proxy_run_until_prepared (video_content, NULL); /* There are two Contents, because now we have the video content too */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 2); /* they could be either way round */ if (g_ptr_array_index (contents, 0) == audio_content) { g_assert (g_ptr_array_index (contents, 1) == video_content); } else { g_assert (g_ptr_array_index (contents, 0) == video_content); g_assert (g_ptr_array_index (contents, 1) == audio_content); } assert_content_properties (video_content, TP_MEDIA_STREAM_TYPE_VIDEO, TP_CALL_CONTENT_DISPOSITION_NONE); streams = tp_call_content_get_streams (video_content); g_assert (streams != NULL); g_assert_cmpuint (streams->len, ==, 1); video_stream = g_ptr_array_index (streams, 0); tp_tests_proxy_run_until_prepared (video_stream, NULL); g_assert_cmpuint (tp_call_stream_get_local_sending_state (video_stream), ==, TP_SENDING_STATE_SENDING); remote_members = tp_call_stream_get_remote_members (video_stream); g_assert_cmpuint (g_hash_table_size (remote_members), ==, 1); v = g_hash_table_lookup (remote_members, tp_channel_get_target_contact (test->chan)); g_assert (tp_proxy_get_factory (video_stream) == tp_proxy_get_factory (test->call_chan)); /* After a moment, the video stream becomes connected, and the remote user * accepts our proposed direction change. These might happen in either * order, at least in this implementation. */ if (GPOINTER_TO_UINT (v) != TP_SENDING_STATE_SENDING) g_assert_cmpuint (GPOINTER_TO_UINT (v), ==, TP_SENDING_STATE_PENDING_SEND); #if 0 /* FIXME: Content.Remove() is not implemented in example CM */ /* Drop the video content */ tp_call_content_remove_async (video_content, content_remove_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Get contents again: now there's only the audio */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 1); g_assert (g_ptr_array_index (contents, 0) == audio_content); #endif /* Hang up the call in the recommended way */ tp_call_channel_hangup_async (test->call_chan, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", hangup_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } static void test_no_answer (Test *test, gconstpointer data G_GNUC_UNUSED) { /* This identifier contains the magic string (no answer), which means the * example will never answer. */ outgoing_call (test, "smcv (no answer)", TRUE, FALSE); tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* After the initial flurry of D-Bus messages, smcv still hasn't answered */ tp_tests_proxy_run_until_dbus_queue_processed (test->conn); assert_call_properties (test->call_chan, TP_CALL_STATE_INITIALISED, test->self_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be TRUE, FALSE */ /* assume we're never going to get an answer, and hang up */ tp_call_channel_hangup_async (test->call_chan, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", hangup_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } static void test_busy (Test *test, gconstpointer data G_GNUC_UNUSED) { /* This identifier contains the magic string (busy), which means the example * will simulate rejection of the call as busy rather than accepting it. */ outgoing_call (test, "Robot101 (busy)", TRUE, FALSE); tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Wait for the remote contact to end the call as busy */ run_until_ended (test); assert_ended_and_run_close (test, tp_channel_get_handle (test->chan, NULL), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, TP_ERROR_STR_BUSY); } static void test_terminated_by_peer (Test *test, gconstpointer data G_GNUC_UNUSED) { /* This contact contains the magic string "(terminate)", meaning the example * simulates answering the call but then terminating it */ outgoing_call (test, "The Governator (terminate)", TRUE, TRUE); tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Wait for the remote contact to answer, if they haven't already */ run_until_answered (test); /* After that, the remote contact immediately ends the call */ run_until_ended (test); assert_ended_and_run_close (test, tp_channel_get_handle (test->chan, NULL), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } static void test_terminate_via_close (Test *test, gconstpointer data G_GNUC_UNUSED) { outgoing_call (test, "basic-test", FALSE, TRUE); tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Wait for the remote contact to answer, if they haven't already */ run_until_answered (test); assert_call_properties (test->call_chan, TP_CALL_STATE_ACCEPTED, test->peer_handle, TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", TRUE, 0, /* call flags */ TRUE, FALSE, TRUE); /* initial audio/video must be FALSE, TRUE */ /* Terminate the call unceremoniously, by calling Close. This is not a * graceful hangup; rather, it's what the ChannelDispatcher would do to * signal a client crash, undispatchability, or whatever */ tp_channel_close_async (test->chan, close_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* In response to termination, the channel does genuinely close */ tp_tests_proxy_run_until_dbus_queue_processed (test->conn); g_assert (tp_proxy_get_invalidated (test->chan) != NULL); /* FIXME: when we hook up signals, check for expected call state * transition before invalidation */ } /* FIXME: try removing the last stream, it should fail */ /* FIXME: add a special contact who refuses to have video */ /* FIXME: add a special contact who asks us for video */ /* FIXME: add a special contact whose stream errors */ static void expect_incoming_call_cb (TpConnection *conn, const GPtrArray *channels, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; guint i; for (i = 0; i < channels->len; i++) { GValueArray *va = g_ptr_array_index (channels, i); const gchar *object_path = g_value_get_boxed (va->values + 0); GHashTable *properties = g_value_get_boxed (va->values + 1); GError *error = NULL; /* we only expect to receive one call */ g_assert (test->chan == NULL); test->chan = tp_simple_client_factory_ensure_channel (test->factory, conn, object_path, properties, &error); g_assert_no_error (error); g_assert (TP_IS_CALL_CHANNEL (test->chan)); test->call_chan = (TpCallChannel *) test->chan; g_assert_cmpint (tp_channel_get_requested (test->chan), ==, FALSE); } } /* In this example connection manager, every time the presence status changes * to available or the message changes, an incoming call is simulated. */ static void trigger_incoming_call (Test *test, const gchar *message, const gchar *expected_caller) { TpProxySignalConnection *new_channels_sig; tp_cli_connection_interface_simple_presence_run_set_presence (test->conn, -1, "away", "preparing for a test", &test->error, NULL); g_assert_no_error (test->error); new_channels_sig = tp_cli_connection_interface_requests_connect_to_new_channels (test->conn, expect_incoming_call_cb, test, NULL, NULL, &test->error); g_assert_no_error (test->error); tp_cli_connection_interface_simple_presence_run_set_presence (test->conn, -1, "available", message, &test->error, NULL); g_assert_no_error (test->error); /* wait for the call to happen if it hasn't already */ while (test->chan == NULL) { g_main_context_iteration (NULL, TRUE); } g_assert_cmpstr (tp_channel_get_identifier (test->chan), ==, expected_caller); test->peer_handle = tp_channel_get_handle (test->chan, NULL); tp_proxy_signal_connection_disconnect (new_channels_sig); tp_tests_proxy_run_until_prepared (test->chan, NULL); } static void test_incoming (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *contents; TpCallContent *audio_content; trigger_incoming_call (test, "call me?", "caller"); /* ring, ring! */ assert_call_properties (test->call_chan, TP_CALL_STATE_INITIALISED, test->peer_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video must be TRUE, FALSE */ /* Get Contents: we have an audio content */ contents = tp_call_channel_get_contents (test->call_chan); g_assert_cmpuint (contents->len, ==, 1); audio_content = g_ptr_array_index (contents, 0); tp_tests_proxy_run_until_prepared (audio_content, NULL); g_assert_cmpuint (tp_call_content_get_media_type (audio_content), ==, TP_MEDIA_STREAM_TYPE_AUDIO); /* FIXME: assert about the properties of the content and the stream */ /* Accept the call */ tp_call_channel_accept_async (test->call_chan, accept_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_call_properties (test->call_chan, TP_CALL_STATE_ACCEPTED, test->self_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", TRUE, 0, /* call flags */ TRUE, TRUE, FALSE); /* initial audio/video are still TRUE, FALSE */ /* FIXME: check for stream directionality changes */ /* Hang up the call */ tp_call_channel_hangup_async (test->call_chan, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", hangup_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); assert_ended_and_run_close (test, test->self_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); } static void send_tones_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; GError *error = NULL; tp_call_channel_send_tones_finish (test->call_chan, result, &error); g_assert_no_error (error); test->wait_count--; if (test->wait_count <= 0) g_main_loop_quit (test->mainloop); } static void dtmf_change_requested_cb (TpCallContent *content, guchar event, TpSendingState state, gpointer user_data, GObject *weak_object) { /* Only PENDING states can be requested */ g_assert (state == TP_SENDING_STATE_PENDING_SEND || state == TP_SENDING_STATE_PENDING_STOP_SENDING); if (state == TP_SENDING_STATE_PENDING_SEND) { tp_cli_call_content_interface_media_call_acknowledge_dtmf_change (content, -1, event, TP_SENDING_STATE_SENDING, NULL, NULL, NULL, NULL); } else if (state == TP_SENDING_STATE_PENDING_STOP_SENDING) { tp_cli_call_content_interface_media_call_acknowledge_dtmf_change (content, -1, event, TP_SENDING_STATE_NONE, NULL, NULL, NULL, NULL); } } static void test_dtmf (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *contents; TpCallContent *content; outgoing_call (test, "dtmf-badger", TRUE, FALSE); run_until_accepted (test); run_until_active (test); contents = tp_call_channel_get_contents (test->call_chan); g_assert (contents->len == 1); content = g_ptr_array_index (contents, 0); tp_cli_call_content_interface_media_connect_to_dtmf_change_requested (content, dtmf_change_requested_cb, test, NULL, NULL, NULL); tp_call_channel_send_tones_async (test->call_chan, "123456789", NULL, send_tones_cb, test); tp_call_channel_send_tones_async (test->call_chan, "ABCD", NULL, send_tones_cb, test); test->wait_count = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_cli_connection_run_disconnect (test->conn, -1, &test->error, NULL); g_assert_no_error (test->error); g_array_unref (test->audio_request); g_array_unref (test->video_request); g_array_unref (test->invalid_request); g_array_unref (test->stream_ids); tp_clear_object (&test->added_content); tp_clear_object (&test->chan); tp_clear_object (&test->conn); tp_clear_object (&test->cm); tp_clear_object (&test->service_cm); /* make sure any pending things have happened */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_set_prgname ("call-channel"); g_test_add ("/call/basics", Test, NULL, setup, test_basics, teardown); g_test_add ("/call/busy", Test, NULL, setup, test_busy, teardown); g_test_add ("/call/no-answer", Test, NULL, setup, test_no_answer, teardown); g_test_add ("/call/terminated-by-peer", Test, NULL, setup, test_terminated_by_peer, teardown); g_test_add ("/call/terminate-via-close", Test, NULL, setup, test_terminate_via_close, teardown); g_test_add ("/call/incoming", Test, NULL, setup, test_incoming, teardown); g_test_add ("/call/dtmf", Test, NULL, setup, test_dtmf, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/simple-handler.c0000644000175000017500000003350612652510705016613 00000000000000/* Tests of TpSimpleHandler * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseClient *simple_handler; TpBaseConnection *base_connection; TpTestsSimpleAccount *account_service; TpTestsTextChannelNull *text_chan_service; /* Client side objects */ TpClient *client; TpConnection *connection; TpAccount *account; TpChannel *text_chan; GError *error /* initialized where needed */; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" static void setup (Test *test, gconstpointer data) { gchar *chan_path; TpHandle handle; TpHandleRepoIface *contact_repo; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Claim AccountManager bus-name (needed as we're going to export an Account * object). */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create service-side Account object */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); /* Create client-side Account object */ test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create service-side text channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); } static void teardown_channel_invalidated_cb (TpChannel *self, guint domain, gint code, gchar *message, Test *test) { g_main_loop_quit (test->mainloop); } static void teardown_run_close_channel (Test *test, TpChannel *channel) { if (channel != NULL && tp_proxy_get_invalidated (channel) == NULL) { g_signal_connect (channel, "invalidated", G_CALLBACK (teardown_channel_invalidated_cb), test); tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL); g_main_loop_run (test->mainloop); } } static void teardown (Test *test, gconstpointer data) { teardown_run_close_channel (test, test->text_chan); g_clear_error (&test->error); g_object_unref (test->simple_handler); g_object_unref (test->client); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_object_unref (test->account_service); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; g_object_unref (test->account); g_object_unref (test->text_chan_service); g_object_unref (test->text_chan); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); } static void create_simple_handler (Test *test, gboolean bypass_approval, gboolean requests, TpSimpleHandlerHandleChannelsImpl impl) { /* Create service-side Client object */ test->simple_handler = tp_tests_object_new_static_class ( TP_TYPE_SIMPLE_HANDLER, "dbus-daemon", test->dbus, "bypass-approval", bypass_approval, "requests", requests, "name", "MySimpleHandler", "uniquify-name", FALSE, "callback", impl, "user-data", test, "destroy", NULL, NULL); g_assert (test->simple_handler != NULL); /* Create client-side Client object */ test->client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", test->dbus, "bus-name", tp_base_client_get_bus_name (test->simple_handler), "object-path", tp_base_client_get_object_path (test->simple_handler), NULL); g_assert (test->client != NULL); } static void get_client_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; const gchar * const *interfaces; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); interfaces = tp_asv_get_strv (properties, "Interfaces"); g_assert_cmpint (g_strv_length ((GStrv) interfaces), ==, 2); g_assert (tp_strv_contains (interfaces, TP_IFACE_CLIENT_HANDLER)); g_assert (tp_strv_contains (interfaces, TP_IFACE_CLIENT_INTERFACE_REQUESTS)); out: g_main_loop_quit (test->mainloop); } static void check_filters (GPtrArray *filters) { GHashTable *filter; g_assert (filters != NULL); g_assert_cmpuint (filters->len, ==, 2); filter = g_ptr_array_index (filters, 0); g_assert_cmpuint (g_hash_table_size (filter), ==, 1); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); filter = g_ptr_array_index (filters, 1); g_assert_cmpuint (g_hash_table_size (filter), ==, 2); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); g_assert_cmpuint (tp_asv_get_uint32 (filter, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); } static void get_handler_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; gboolean bypass; gboolean valid; const gchar * const * capabilities; GPtrArray *handled; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 4); filters = tp_asv_get_boxed (properties, "HandlerChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); bypass = tp_asv_get_boolean (properties, "BypassApproval", &valid); g_assert (valid); g_assert (!bypass); capabilities = tp_asv_get_strv (properties, "Capabilities"); g_assert_cmpint (g_strv_length ((GStrv) capabilities), ==, 0); handled = tp_asv_get_boxed (properties, "HandledChannels", TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_assert (handled != NULL); g_assert_cmpint (handled->len, ==, 0); out: g_main_loop_quit (test->mainloop); } static void handle_channels_success ( TpSimpleHandler *handler, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisified, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data) { tp_handle_channels_context_accept (context); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_handler (test, FALSE, TRUE, handle_channels_success); tp_base_client_add_handler_filter_vardict (test->simple_handler, g_variant_new_parsed ("{ %s: <%s> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT)); tp_base_client_add_handler_filter_vardict (test->simple_handler, g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT)); tp_base_client_register (test->simple_handler, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Check Handler properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_HANDLER, get_handler_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void no_return_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_error (&test->error); if (error != NULL) { test->error = g_error_copy (error); goto out; } out: g_main_loop_quit (test->mainloop); } static void add_channel_to_ptr_array (GPtrArray *arr, TpChannel *channel) { GValueArray *tmp; g_assert (arr != NULL); g_assert (channel != NULL); tmp = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, tp_channel_borrow_immutable_properties ( channel), G_TYPE_INVALID); g_ptr_array_add (arr, tmp); } static void free_channel_details (gpointer data, gpointer user_data) { g_boxed_free (TP_STRUCT_TYPE_CHANNEL_DETAILS, data); } static void call_handle_channels (Test *test) { GPtrArray *channels, *requests_satisified; GHashTable *info; int i; channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->text_chan); requests_satisified = g_ptr_array_sized_new (0); info = g_hash_table_new (NULL, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); for (i = 0 ; i < 10 ; i ++) { tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); } g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } /* HandleChannels returns immediately */ static void test_success (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_handler (test, FALSE, FALSE, handle_channels_success); tp_base_client_add_handler_filter_vardict (test->simple_handler, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_handler, &test->error); g_assert_no_error (test->error); call_handle_channels (test); g_assert_no_error (test->error); } /* HandleChannels returns in an async way */ static gboolean accept_idle_cb (gpointer data) { TpHandleChannelsContext *context = data; tp_handle_channels_context_accept (context); g_object_unref (context); return FALSE; } static void handle_channels_async ( TpSimpleHandler *handler, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisified, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data) { g_idle_add (accept_idle_cb, g_object_ref (context)); tp_handle_channels_context_delay (context); } static void test_delayed (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_handler (test, FALSE, FALSE, handle_channels_async); tp_base_client_add_handler_filter_vardict (test->simple_handler, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_handler, &test->error); g_assert_no_error (test->error); call_handle_channels (test); g_assert_no_error (test->error); } /* HandleChannels fails */ static void handle_channels_fail ( TpSimpleHandler *handler, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisified, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data) { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No HandleChannels for you!" }; tp_handle_channels_context_fail (context, &error); } static void test_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_handler (test, FALSE, FALSE, handle_channels_fail); tp_base_client_add_handler_filter_vardict (test->simple_handler, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_handler, &test->error); g_assert_no_error (test->error); call_handle_channels (test); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/simple-handler/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/simple-handler/success", Test, NULL, setup, test_success, teardown); g_test_add ("/simple-handler/delayed", Test, NULL, setup, test_delayed, teardown); g_test_add ("/simple-handler/fail", Test, NULL, setup, test_fail, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/channel-request.c0000644000175000017500000003133512652510705017003 00000000000000/* A very basic feature test for TpChannelRequest * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" /* This object implements no methods and no properties - TpChannelRequest * doesn't actually use them yet */ static GType test_simple_cr_get_type (void); typedef struct { GObject parent; } TestSimpleCR; typedef struct { GObjectClass parent; } TestSimpleCRClass; G_DEFINE_TYPE_WITH_CODE (TestSimpleCR, test_simple_cr, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_REQUEST, NULL)); static void test_simple_cr_init (TestSimpleCR *self) { } static void test_simple_cr_class_init (TestSimpleCRClass *klass) { } typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; DBusGConnection *private_conn; TpDBusDaemon *private_dbus; GObject *cr_service; /* Service side objects */ TpBaseConnection *base_connection; /* Client side objects */ TpConnection *connection; TpChannel *channel; TpChannelRequest *cr; GError *error /* initialized where needed */; guint succeeded; } Test; static void setup (Test *test, gconstpointer data) { DBusConnection *libdbus; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); g_assert (test->dbus != NULL); libdbus = dbus_bus_get_private (DBUS_BUS_STARTER, NULL); g_assert (libdbus != NULL); dbus_connection_setup_with_g_main (libdbus, NULL); dbus_connection_set_exit_on_disconnect (libdbus, FALSE); test->private_conn = dbus_connection_get_g_connection (libdbus); /* transfer ref */ dbus_g_connection_ref (test->private_conn); dbus_connection_unref (libdbus); g_assert (test->private_conn != NULL); test->private_dbus = tp_dbus_daemon_new (test->private_conn); g_assert (test->private_dbus != NULL); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); test->cr = NULL; test->cr_service = tp_tests_object_new_static_class (test_simple_cr_get_type (), NULL); tp_dbus_daemon_register_object (test->private_dbus, "/whatever", test->cr_service); } static void teardown (Test *test, gconstpointer data) { tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); if (test->cr != NULL) { g_object_unref (test->cr); test->cr = NULL; } if (test->private_dbus != NULL) { tp_dbus_daemon_release_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); g_object_unref (test->private_dbus); test->private_dbus = NULL; } g_object_unref (test->cr_service); test->cr_service = NULL; if (test->private_conn != NULL) { dbus_connection_close (dbus_g_connection_get_connection ( test->private_conn)); dbus_g_connection_unref (test->private_conn); test->private_conn = NULL; } /* make sure any pending things have happened */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; /* CD not running */ test->cr = tp_channel_request_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cr == NULL); ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "not even syntactically valid", NULL, NULL); g_assert (test->cr == NULL); test->cr = tp_channel_request_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cr != NULL); } static void test_crash (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cr != NULL); g_assert (tp_proxy_get_invalidated (test->cr) == NULL); tp_dbus_daemon_release_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); tp_tests_proxy_run_until_dbus_queue_processed (test->cr); g_assert (tp_proxy_get_invalidated (test->cr) == NULL); dbus_connection_close (dbus_g_connection_get_connection ( test->private_conn)); dbus_g_connection_unref (test->private_conn); test->private_conn = NULL; while (tp_proxy_get_invalidated (test->cr) == NULL) g_main_context_iteration (NULL, TRUE); g_assert (tp_proxy_get_invalidated (test->cr)->domain == TP_DBUS_ERRORS); g_assert (tp_proxy_get_invalidated (test->cr)->code == TP_DBUS_ERROR_NAME_OWNER_LOST); } static void succeeded_cb (Test *test) { test->succeeded++; } static void succeeded_with_channel_cb (TpChannelRequest *request, TpConnection *connection, TpChannel *channel, Test *test) { g_assert (TP_IS_CONNECTION (connection)); g_assert (TP_IS_CHANNEL (channel)); g_assert_cmpstr (tp_proxy_get_object_path (connection), ==, tp_base_connection_get_object_path (test->base_connection)); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, "/Channel"); test->succeeded++; } static void test_succeeded (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; GHashTable *props; ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cr != NULL); g_assert (tp_proxy_get_invalidated (test->cr) == NULL); g_signal_connect_swapped (test->cr, "succeeded", G_CALLBACK (succeeded_cb), test); g_signal_connect (test->cr, "succeeded-with-channel", G_CALLBACK (succeeded_with_channel_cb), test); /* sync up both sockets to ensure that the match rules are in place */ tp_tests_proxy_run_until_dbus_queue_processed (test->cr); props = g_hash_table_new (NULL, NULL); tp_svc_channel_request_emit_succeeded_with_channel (test->cr_service, tp_base_connection_get_object_path (test->base_connection), props, "/Channel", props); g_hash_table_unref (props); tp_svc_channel_request_emit_succeeded (test->cr_service); tp_tests_proxy_run_until_dbus_queue_processed (test->cr); g_assert (tp_proxy_get_invalidated (test->cr) != NULL); g_assert (tp_proxy_get_invalidated (test->cr)->domain == TP_DBUS_ERRORS); g_assert (tp_proxy_get_invalidated (test->cr)->code == TP_DBUS_ERROR_OBJECT_REMOVED); g_assert_cmpuint (test->succeeded, ==, 2); g_signal_handlers_disconnect_by_func (test->cr, G_CALLBACK (succeeded_cb), test); } static void test_failed (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cr != NULL); g_assert (tp_proxy_get_invalidated (test->cr) == NULL); g_signal_connect_swapped (test->cr, "succeeded", G_CALLBACK (succeeded_cb), test); /* sync up both sockets to ensure that the match rules are in place */ tp_tests_proxy_run_until_dbus_queue_processed (test->cr); tp_svc_channel_request_emit_failed (test->cr_service, TP_ERROR_STR_NOT_YOURS, "lalala"); tp_tests_proxy_run_until_dbus_queue_processed (test->cr); g_assert (tp_proxy_get_invalidated (test->cr) != NULL); g_assert (tp_proxy_get_invalidated (test->cr)->domain == TP_ERROR); g_assert (tp_proxy_get_invalidated (test->cr)->code == TP_ERROR_NOT_YOURS); g_assert_cmpstr (tp_proxy_get_invalidated (test->cr)->message, ==, "lalala"); g_assert_cmpuint (test->succeeded, ==, 0); g_signal_handlers_disconnect_by_func (test->cr, G_CALLBACK (succeeded_cb), test); } static void test_immutable_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; GHashTable *props; GVariant *vardict; props = tp_asv_new ("badger", G_TYPE_UINT, 42, NULL); ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "/whatever", props, NULL); g_assert (test->cr != NULL); g_hash_table_unref (props); props = (GHashTable *) tp_channel_request_get_immutable_properties (test->cr); g_assert_cmpuint (tp_asv_get_uint32 (props, "badger", NULL), ==, 42); g_object_get (test->cr, "immutable-properties", &props, NULL); g_assert_cmpuint (tp_asv_get_uint32 (props, "badger", NULL), ==, 42); g_hash_table_unref (props); vardict = tp_channel_request_dup_immutable_properties (test->cr); g_assert_cmpuint (tp_vardict_get_uint32 (vardict, "badger", NULL), ==, 42); g_variant_unref (vardict); g_object_get (test->cr, "immutable-properties-vardict", &vardict, NULL); g_assert_cmpuint (tp_vardict_get_uint32 (vardict, "badger", NULL), ==, 42); g_variant_unref (vardict); } #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "a/b/c" static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; GHashTable *props, *hints; TpAccount *account; gint64 user_action_time; const gchar *handler; GVariant *vardict; hints = tp_asv_new ("test", G_TYPE_STRING, "hi", NULL); props = tp_asv_new ( TP_PROP_CHANNEL_REQUEST_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, ACCOUNT_PATH, TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME, G_TYPE_INT64, (gint64) 12345, TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER, G_TYPE_STRING, "Badger", TP_PROP_CHANNEL_REQUEST_HINTS, TP_HASH_TYPE_STRING_VARIANT_MAP, hints, NULL); ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cr = tp_channel_request_new (test->dbus, "/whatever", props, NULL); g_assert (test->cr != NULL); g_hash_table_unref (props); g_hash_table_unref (hints); /* Account */ account = tp_channel_request_get_account (test->cr); g_assert (TP_IS_ACCOUNT (account)); g_assert_cmpstr (tp_proxy_get_object_path (account), ==, ACCOUNT_PATH); g_object_get (test->cr, "account", &account, NULL); g_assert (TP_IS_ACCOUNT (account)); g_assert_cmpstr (tp_proxy_get_object_path (account), ==, ACCOUNT_PATH); g_object_unref (account); /* UserActionTime */ user_action_time = tp_channel_request_get_user_action_time (test->cr); g_assert_cmpint (user_action_time, ==, 12345); g_object_get (test->cr, "user-action-time", &user_action_time, NULL); g_assert_cmpint (user_action_time, ==, 12345); /* PreferredHandler */ handler = tp_channel_request_get_preferred_handler (test->cr); g_assert_cmpstr (handler, ==, "Badger"); g_object_get (test->cr, "preferred-handler", &handler, NULL); g_assert_cmpstr (handler, ==, "Badger"); /* Hints */ hints = (GHashTable *) tp_channel_request_get_hints (test->cr); g_assert_cmpstr (tp_asv_get_string (hints, "test"), ==, "hi"); g_object_get (test->cr, "hints", &hints, NULL); g_assert_cmpstr (tp_asv_get_string (hints, "test"), ==, "hi"); g_hash_table_unref (hints); vardict = tp_channel_request_dup_hints (test->cr); g_assert_cmpstr (tp_vardict_get_string (vardict, "test"), ==, "hi"); g_variant_unref (vardict); g_object_get (test->cr, "hints-vardict", &vardict, NULL); g_assert_cmpstr (tp_vardict_get_string (vardict, "test"), ==, "hi"); g_variant_unref (vardict); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/cr/new", Test, NULL, setup, test_new, teardown); g_test_add ("/cr/crash", Test, NULL, setup, test_crash, teardown); g_test_add ("/cr/succeeded", Test, NULL, setup, test_succeeded, teardown); g_test_add ("/cr/failed", Test, NULL, setup, test_failed, teardown); g_test_add ("/cr/immutable-properties", Test, NULL, setup, test_immutable_properties, teardown); g_test_add ("/cr/properties", Test, NULL, setup, test_properties, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/proxy-preparation.c0000644000175000017500000003270612652510705017413 00000000000000/* Tests of TpBaseClient * * Copyright © 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/simple-conn.h" #include "tests/lib/my-conn-proxy.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; /* Client side objects */ TpConnection *connection; TpTestsMyConnProxy *my_conn; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); test->my_conn = g_object_new (TP_TESTS_TYPE_MY_CONN_PROXY, "dbus-daemon", test->dbus, "bus-name", tp_proxy_get_bus_name (test->connection), "object-path", tp_proxy_get_object_path (test->connection), NULL); } static void disconnect_and_destroy_conn (Test *test) { tp_tests_connection_assert_disconnect_succeeds ( TP_CONNECTION (test->my_conn)); tp_clear_object (&test->connection); tp_clear_object (&test->base_connection); tp_clear_object (&test->my_conn); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; disconnect_and_destroy_conn (test); } static void prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (TP_PROXY (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_prepare_capabilities (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Prepare capabilities on a new proxy. CORE should be automatically prepared * *before* checking if Requests is implemented as * tp_proxy_has_interface_by_id() can't work without CORE. */ GQuark features[] = { TP_CONNECTION_FEATURE_CAPABILITIES, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_CONNECTION_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_CONNECTION_FEATURE_CAPABILITIES)); } static void test_prepare_core (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Test than preparing the 'top' core feature prepare the other core * features as well */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_CORE, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_CONNECTION_FEATURE_CAPABILITIES)); } static void test_depends (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Test if A is automatically prepared when preparing B */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_B, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_A)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_B)); } static void test_wrong_iface (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Feature can't be prepared because proxy doesn't support the right * interface */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE)); } static void test_bad_dep (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Feature can't be prepared because it depends on an unpreparable * feature */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_WRONG_IFACE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_BAD_DEP)); } static void test_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Feature preparation fails */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL)); } static void test_fail_dep (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Feature can't be prepared because its deps can't be prepared */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_FAIL_DEP)); } static void test_retry (Test *test, gconstpointer data G_GNUC_UNUSED) { /* We have the prepare the feature twice */ GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY, 0 }; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY)); /* second attempt */ test->my_conn->retry_feature_success = TRUE; tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY)); } static void test_retry_dep (Test *test, gconstpointer data G_GNUC_UNUSED) { /* RETRY_DEP depends on a feature having can_retry and which failed, so * preparing RETRY_DEP will re-prepare it successfully */ GQuark features_retry[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY, 0 }; GQuark features_retry_dep[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP, 0 }; /* Try preparing TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY, will fail */ tp_proxy_prepare_async (test->my_conn, features_retry, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY)); g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP)); /* Try prepare TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP, will re-prepare * TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY */ test->my_conn->retry_feature_success = TRUE; tp_proxy_prepare_async (test->my_conn, features_retry_dep, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY)); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_RETRY_DEP)); } static void recreate_connection (Test *test) { gchar *name; gchar *conn_path; disconnect_and_destroy_conn (test); test->base_connection = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@test.com", "protocol", "simple", NULL); g_assert (test->base_connection != NULL); g_assert (tp_base_connection_register (test->base_connection, "simple", &name, &conn_path, &test->error)); g_assert_no_error (test->error); test->connection = tp_connection_new (test->dbus, name, conn_path, &test->error); g_assert_no_error (test->error); test->my_conn = g_object_new (TP_TESTS_TYPE_MY_CONN_PROXY, "dbus-daemon", test->dbus, "bus-name", tp_proxy_get_bus_name (test->connection), "object-path", tp_proxy_get_object_path (test->connection), NULL); g_assert (test->my_conn != NULL); g_free (name); g_free (conn_path); } static void test_before_connected (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED, 0 }; GQuark connected[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; /* We need a not yet connected connection */ recreate_connection (test); g_assert_cmpuint (test->my_conn->before_connected_state, ==, BEFORE_CONNECTED_STATE_UNPREPARED); /* Connection is not yet connected, prepare the feature */ tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_BEFORE_CONNECTED)); g_assert_cmpuint (test->my_conn->before_connected_state, ==, BEFORE_CONNECTED_STATE_NOT_CONNECTED); tp_cli_connection_call_connect (test->connection, -1, NULL, NULL, NULL, NULL); /* Wait that CONNECTED is announced */ tp_proxy_prepare_async (test->my_conn, connected, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* state has been updated */ g_assert_cmpuint (test->my_conn->before_connected_state, ==, BEFORE_CONNECTED_STATE_CONNECTED); } static void test_interface_later (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER, 0 }; GQuark connected[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; const gchar *interfaces[] = { TP_TESTS_MY_CONN_PROXY_IFACE_LATER, NULL }; /* We need a not yet connected connection */ recreate_connection (test); /* Try preparing before the connection is connected */ tp_proxy_prepare_async (test->my_conn, features, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Feature isn't prepared */ g_assert (!tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER)); tp_cli_connection_call_connect (test->connection, -1, NULL, NULL, NULL, NULL); /* While connecting the interface is added */ tp_base_connection_add_interfaces (test->base_connection, interfaces); /* Wait that CONNECTED is announced */ tp_proxy_prepare_async (test->my_conn, connected, prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* The feature has been prepared now */ g_assert (tp_proxy_is_prepared (test->my_conn, TP_TESTS_MY_CONN_PROXY_FEATURE_INTERFACE_LATER)); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/proxy-preparation/prepare-capabilities", Test, NULL, setup, test_prepare_capabilities, teardown); g_test_add ("/proxy-preparation/prepare-core", Test, NULL, setup, test_prepare_core, teardown); g_test_add ("/proxy-preparation/depends", Test, NULL, setup, test_depends, teardown); g_test_add ("/proxy-preparation/wrong-iface", Test, NULL, setup, test_wrong_iface, teardown); g_test_add ("/proxy-preparation/bad-dep", Test, NULL, setup, test_bad_dep, teardown); g_test_add ("/proxy-preparation/fail", Test, NULL, setup, test_fail, teardown); g_test_add ("/proxy-preparation/fail-dep", Test, NULL, setup, test_fail_dep, teardown); g_test_add ("/proxy-preparation/retry", Test, NULL, setup, test_retry, teardown); g_test_add ("/proxy-preparation/retry-dep", Test, NULL, setup, test_retry_dep, teardown); g_test_add ("/proxy-preparation/before-connected", Test, NULL, setup, test_before_connected, teardown); g_test_add ("/proxy-preparation/interface-later", Test, NULL, setup, test_interface_later, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/account-manager.c0000644000175000017500000005363012652510705016753 00000000000000/* A very basic feature test for TpAccountManager * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/simple-account.h" #include "tests/lib/simple-account-manager.h" #include "tests/lib/util.h" #define ACCOUNT1_PATH TP_ACCOUNT_OBJECT_PATH_BASE "badger/musher/account1" #define ACCOUNT2_PATH TP_ACCOUNT_OBJECT_PATH_BASE "badger/musher/account2" typedef struct { GFunc action; gpointer user_data; } ScriptAction; typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpTestsSimpleAccountManager *service /* initialized in prepare_service */; TpAccountManager *am; TpAccount *account; gboolean prepared /* The result of prepare_finish */; guint timeout_id; GQueue *script /* A list of GAsyncReadyCallback */; TpTestsSimpleAccount *account1_service; TpTestsSimpleAccount *account2_service; TpAccount *account1; TpAccount *account2; GError *error /* initialized where needed */; } Test; /** * Functions for manipulating scripts follow this comment. * In order to be generally useful, the script should probably be stored in its * own data structure, rather than passed around with the test, and the * user_data argument would need to be the test or something. As it is, these * library-like functions rely on being defined after the Test struct. */ static ScriptAction * script_action_new (GFunc action, gpointer data) { ScriptAction *script_action = g_new (ScriptAction, 1); script_action->action = action; script_action->user_data = data; return script_action; } static void script_action_free (ScriptAction *action) { g_free (action); } /** * If data is passed in, you are responsible for freeing it. This will not be * done for you. */ static void script_append_action (Test *test, GFunc action, gpointer data) { g_queue_push_tail (test->script, script_action_new (action, data)); } static void script_continue (gpointer script_data) { Test *test = (Test *) script_data; ScriptAction *action; /* pop the next action */ action = (ScriptAction *) g_queue_pop_head (test->script); action->action (script_data, action->user_data); script_action_free (action); } static gboolean test_timed_out (gpointer data) { Test *test = (Test *) data; g_assert_not_reached (); test->prepared = FALSE; /* Note that this is a completely bogus error, but it only gets returned if * you comment out the g_assert_not_reached() above. */ test->error = g_error_new_literal (TP_ERROR, TP_DBUS_ERROR_INCONSISTENT, "timeout"); g_print ("about to quit"); g_main_loop_quit (test->mainloop); g_print ("just quit"); return FALSE; } static void quit_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; g_main_loop_quit (test->mainloop); } static void script_start_with_deadline (Test *test, guint timeout) { script_append_action (test, quit_action, NULL); test->timeout_id = g_timeout_add (timeout, test_timed_out, test); script_continue (test); g_main_loop_run (test->mainloop); } /** * Setup and teardown functions follow this comment. */ static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->am = NULL; test->timeout_id = 0; test->script = g_queue_new (); } static void setup_service (Test *test, gconstpointer data) { setup (test, data); g_assert (tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error)); test->service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, NULL); tp_dbus_daemon_register_object (test->dbus, TP_ACCOUNT_MANAGER_OBJECT_PATH, test->service); test->account1_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT1_PATH, test->account1_service); test->account2_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT2_PATH, test->account2_service); } static void teardown (Test *test, gconstpointer data) { if (test->am != NULL) { g_object_unref (test->am); test->am = NULL; } if (test->timeout_id != 0) { g_source_remove (test->timeout_id); test->timeout_id = 0; } g_queue_free (test->script); test->script = NULL; /* make sure any pending things have happened */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void teardown_service (Test *test, gconstpointer data) { script_start_with_deadline (test, 1000); g_assert ( tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error)); tp_dbus_daemon_unregister_object (test->dbus, test->service); g_object_unref (test->service); tp_dbus_daemon_unregister_object (test->dbus, test->account1_service); g_object_unref (test->account1_service); tp_dbus_daemon_unregister_object (test->dbus, test->account2_service); g_object_unref (test->account2_service); g_clear_object (&test->account1); g_clear_object (&test->account2); test->service = NULL; teardown (test, data); } /** * Non-dbus tests follow this comment */ static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { test->am = tp_account_manager_new (test->dbus); } static void test_dup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountManager *one, *two; TpDBusDaemon *dbus_one, *dbus_two; one = tp_account_manager_dup (); two = tp_account_manager_dup (); g_assert (one == two); dbus_one = tp_dbus_daemon_dup (NULL); dbus_two = tp_proxy_get_dbus_daemon (one); g_assert (dbus_one == dbus_two); g_object_unref (dbus_one); g_object_unref (two); g_object_unref (one); } /** * Actions for use with script_append_action() follow this comment. They are * used in tests which involve asyncronous actions. */ static void noop_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { script_continue (script_data); } static void finish_prepare_action (GObject *source_object, GAsyncResult *res, gpointer user_data) { Test *test = (Test *) user_data; gboolean is_prepared_reply; TpAccountManager *am = TP_ACCOUNT_MANAGER (source_object); g_assert (test->am == am); test->prepared = tp_account_manager_prepare_finish (am, res, &test->error); is_prepared_reply = tp_proxy_is_prepared (test->am, TP_ACCOUNT_MANAGER_FEATURE_CORE); g_assert_cmpint (is_prepared_reply, ==, test->prepared); script_continue (test); } static void prepare_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; tp_account_manager_prepare_async (test->am, NULL, finish_prepare_action, test); } static void manager_new_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; test->am = tp_account_manager_new (test->dbus); script_continue (test); } /* We really don't want to have MC being launched during this test */ static void finish_assert_am_not_activatable_action (TpDBusDaemon *proxy, const gchar * const *names, const GError *error, gpointer user_data, GObject *weak_object) { guint i; g_assert (error == NULL); for (i=0; names[i] != NULL; i++) { g_assert_cmpstr (names[i], !=, TP_ACCOUNT_MANAGER_BUS_NAME); g_assert_cmpstr (names[i], !=, "org.freedesktop.Telepathy.MissionControl5"); } script_continue (user_data); } static void assert_am_not_activatable_action (gpointer script_data, gpointer user_data) { Test *test = (Test *) script_data; tp_dbus_daemon_list_activatable_names (test->dbus, 500, finish_assert_am_not_activatable_action, test, NULL, NULL); } static void assert_core_not_ready_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; g_assert (!tp_proxy_is_prepared (test->am, TP_ACCOUNT_MANAGER_FEATURE_CORE)); script_continue (script_data); } static void assert_feature_not_ready_action (gpointer script_data, gpointer user_data) { Test *test = (Test *) script_data; g_assert (!tp_proxy_is_prepared (test->am, g_quark_from_string ((gchar *) user_data))); g_free (user_data); script_continue (script_data); } static void prepare_feature_action (gpointer script_data, gpointer user_data) { Test *test = (Test *) script_data; GQuark features[3]; features[0] = TP_ACCOUNT_MANAGER_FEATURE_CORE; features[1] = g_quark_from_string ((gchar *) user_data); features[2] = 0; tp_account_manager_prepare_async (test->am, features, finish_prepare_action, test); g_free (user_data); } static void assert_ok_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; g_assert_no_error (test->error); g_assert (test->prepared); script_continue (script_data); } static void assert_failed_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; g_assert (test->error != NULL); g_error_free (test->error); test->error = NULL; script_continue (script_data); } /** * account related functions below this comment */ static void ensure_action (gpointer script_data, gpointer user_data) { char *path = (char *) user_data; Test *test = (Test *) script_data; g_assert (test != NULL); g_assert (test->am != NULL); g_assert (tp_proxy_is_prepared (test->am, TP_ACCOUNT_MANAGER_FEATURE_CORE)); test->account = tp_account_manager_ensure_account (test->am, path); script_continue (script_data); } static void assert_account_ok_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; g_assert (test->account != NULL); script_continue (script_data); } static void finish_account_prepare_action (GObject *source_object, GAsyncResult *res, gpointer user_data) { Test *test = (Test *) user_data; TpAccount *account = TP_ACCOUNT (source_object); g_assert (test->account == account); test->prepared = tp_account_prepare_finish (account, res, &test->error); g_assert (test->prepared == tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)); script_continue (test); } static void account_prepare_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; tp_account_prepare_async (test->account, NULL, finish_account_prepare_action, test); } static void register_service_action (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; tp_dbus_daemon_register_object (test->dbus, TP_ACCOUNT_MANAGER_OBJECT_PATH, test->service); script_continue (test); } /** * Asyncronous tests below this comment. Tests append action functions and * arguments to a script. Once the test function has returned, the teardown * function is responsible for running the script, and quitting the mainloop * afterwards. * Action functions are each responsible for ensuring that the next action is * called. */ static void test_prepare (Test *test, gconstpointer data G_GNUC_UNUSED) { script_append_action (test, assert_am_not_activatable_action, NULL); script_append_action (test, manager_new_action, NULL); script_append_action (test, assert_core_not_ready_action, NULL); script_append_action (test, prepare_action, NULL); script_append_action (test, noop_action, NULL); } /** * Tests the usual case where prepare succeeds. */ static void test_prepare_success (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare (test, data); script_append_action (test, assert_ok_action, NULL); } /** * Tests the case where the well-known name is not provided. * This should be run with setup rather than setup_service to make this the case. * TODO: use g_assert_error (err, dom, c) to fix the domain and code. */ static void test_prepare_no_name (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare (test, data); script_append_action (test, assert_failed_action, NULL); /* Since we are using teardown rather than teardown_service, we need to * run the script ourselves */ script_start_with_deadline (test, 1000); } /** * Tests the case where the object has been destroyed. * TODO: use g_assert_error (err, dom, c) to fix the domain and code. */ static void test_prepare_destroyed (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_dbus_daemon_unregister_object (test->dbus, test->service); test_prepare (test, data); script_append_action (test, assert_failed_action, NULL); script_append_action (test, register_service_action, NULL); } /** * Calling prepare with unknown features should succeed, but is_prepared() * on an unknown feature should return FALSE. */ static void test_prepare_unknown_features (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_success (test, data); script_append_action (test, prepare_feature_action, g_strdup ("fake-feature")); script_append_action (test, assert_ok_action, NULL); script_append_action (test, assert_feature_not_ready_action, g_strdup ("fake-feature")); } static void test_ensure (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare (test, data); script_append_action (test, assert_ok_action, NULL); script_append_action (test, ensure_action, TP_ACCOUNT_OBJECT_PATH_BASE "fakecm/fakeproto/account"); script_append_action (test, assert_account_ok_action, NULL); script_append_action (test, account_prepare_action, NULL); script_append_action (test, assert_failed_action, NULL); } /* tp_account_manager_get_most_available_presence() tests */ static void create_tp_accounts (gpointer script_data, gpointer user_data G_GNUC_UNUSED) { Test *test = (Test *) script_data; test->account1 = tp_account_manager_ensure_account (test->am, ACCOUNT1_PATH); g_object_ref (test->account1); test->account2 = tp_account_manager_ensure_account (test->am, ACCOUNT2_PATH); g_object_ref (test->account2); script_continue (test); } static void test_prepare_most_available (Test *test, gconstpointer data, guint nb_accounts) { if (nb_accounts >= 1) tp_tests_simple_account_manager_add_account (test->service, ACCOUNT1_PATH, TRUE); if (nb_accounts >= 2) tp_tests_simple_account_manager_add_account (test->service, ACCOUNT2_PATH, TRUE); test_prepare (test, data); script_append_action (test, manager_new_action, NULL); script_append_action (test, prepare_action, NULL); script_append_action (test, create_tp_accounts, NULL); } typedef struct { TpConnectionPresenceType presence; gchar *status; gchar *message; } Presence; static Presence * presence_new (TpConnectionPresenceType presence, const gchar *status, const gchar *message) { Presence *p = g_slice_new (Presence); p->presence = presence; p->status = g_strdup (status); p->message = g_strdup (message); return p; } static void presence_free (Presence *p) { g_free (p->status); g_free (p->message); g_slice_free (Presence, p); } static void check_presence_action (gpointer script_data, gpointer user_data) { Test *test = script_data; Presence *p = user_data; TpConnectionPresenceType presence; gchar *status, *message; presence = tp_account_manager_get_most_available_presence (test->am, &status, &message); g_assert_cmpuint (presence, ==, p->presence); g_assert_cmpstr (status, ==, p->status); g_assert_cmpstr (message, ==, p->message); presence_free (p); g_free (status); g_free (message); script_continue (script_data); } static void account_presence_changed (TpAccount *account, TpConnectionPresenceType presence, const gchar *status, const gchar *message, Test *test) { g_signal_handlers_disconnect_by_func (account, account_presence_changed, test); script_continue (test); } static void change_account_presence (Test *test, TpTestsSimpleAccount *service, TpAccount *account, gpointer user_data) { Presence *p = user_data; tp_tests_simple_account_set_presence (service, p->presence, p->status, p->message); presence_free (p); /* Wait for the presence change notification */ g_signal_connect (account, "presence-changed", G_CALLBACK (account_presence_changed), test); } static void change_account1_presence (gpointer script_data, gpointer user_data) { Test *test = script_data; change_account_presence (test, test->account1_service, test->account1, user_data); } static void change_account2_presence (gpointer script_data, gpointer user_data) { Test *test = script_data; change_account_presence (test, test->account2_service, test->account2, user_data); } static void test_most_available_no_account (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_most_available (test, data, 0); script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "")); } static void test_most_available_one_account (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_most_available (test, data, 1); script_append_action (test, change_account1_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); } static void test_most_available_two_account (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_most_available (test, data, 2); script_append_action (test, change_account1_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); script_append_action (test, change_account2_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_AWAY, "away", "")); script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); /* account1 disconnects */ script_append_action (test, change_account1_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "")); script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AWAY, "away", "")); } static void test_most_available_one_unset (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_most_available (test, data, 1); script_append_action (test, change_account1_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_UNSET, "unset", "")); /* Pretend that we are available */ script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); } static void test_most_available_two_unset (Test *test, gconstpointer data G_GNUC_UNUSED) { test_prepare_most_available (test, data, 2); script_append_action (test, change_account1_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_UNSET, "unset", "")); script_append_action (test, change_account2_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_AWAY, "away", "")); /* Use account2 away presence */ script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AWAY, "away", "")); /* account2 disconnects */ script_append_action (test, change_account2_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "")); /* Pretent that we are available */ script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "")); /* account2 reconnects with busy */ script_append_action (test, change_account2_presence, presence_new (TP_CONNECTION_PRESENCE_TYPE_BUSY, "busy", "")); script_append_action (test, check_presence_action, presence_new (TP_CONNECTION_PRESENCE_TYPE_BUSY, "busy", "")); } int main (int argc, char **argv) { tp_tests_abort_after (10); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/am/new", Test, NULL, setup, test_new, teardown); g_test_add ("/am/dup", Test, NULL, setup, test_dup, teardown); g_test_add ("/am/prepare/success", Test, NULL, setup_service, test_prepare_success, teardown_service); g_test_add ("/am/prepare/destroyed", Test, NULL, setup_service, test_prepare_destroyed, teardown_service); /* WARNING: This test is run using setup/teardown rather than setup_service*/ g_test_add ("/am/prepare/name-not-provided", Test, NULL, setup, test_prepare_no_name, teardown); g_test_add ("/am/prepare/unknown_features", Test, NULL, setup_service, test_prepare_unknown_features, teardown_service); g_test_add ("/am/ensure", Test, NULL, setup_service, test_ensure, teardown_service); g_test_add ("/am/most-available/no-account", Test, NULL, setup_service, test_most_available_no_account, teardown_service); g_test_add ("/am/most-available/one-account", Test, NULL, setup_service, test_most_available_one_account, teardown_service); g_test_add ("/am/most-available/two-account", Test, NULL, setup_service, test_most_available_two_account, teardown_service); g_test_add ("/am/most-available/one-unset", Test, NULL, setup_service, test_most_available_one_unset, teardown_service); g_test_add ("/am/most-available/two-unset", Test, NULL, setup_service, test_most_available_two_unset, teardown_service); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/tls-certificate.c0000644000175000017500000002305212652510705016764 00000000000000/* Tests of TpTLSCertificate * * Copyright © 2012 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/tls-certificate.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsTLSCertificate *service_cert; /* Client side objects */ TpConnection *connection; TpTLSCertificate *cert; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { gchar *path; GPtrArray *chain_data; GArray *cert; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", &test->base_connection, &test->connection); path = g_strdup_printf ("%s/TlsCertificate", tp_proxy_get_object_path (test->connection)); chain_data = g_ptr_array_new_with_free_func ((GDestroyNotify) g_array_unref); cert = g_array_new (TRUE, TRUE, sizeof (guchar)); g_array_append_vals (cert, "BADGER", 6); g_ptr_array_add (chain_data, cert); test->service_cert = g_object_new (TP_TESTS_TYPE_TLS_CERTIFICATE, "object-path", path, "certificate-type", "x509", "certificate-chain-data", chain_data, "dbus-daemon", test->dbus, NULL); g_ptr_array_unref (chain_data); test->cert = tp_tls_certificate_new (TP_PROXY (test->connection), path, &test->error); g_assert_no_error (test->error); g_free (path); } static void disconnect_conn (Test *test) { if (test->connection == NULL) return; tp_tests_connection_assert_disconnect_succeeds (test->connection); tp_clear_object (&test->connection); tp_clear_object (&test->base_connection); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->service_cert); tp_clear_object (&test->cert); disconnect_conn (test); } static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (TP_IS_TLS_CERTIFICATE (test->cert)); } static void proxy_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void prepare_cert (Test *test, TpTLSCertificate *cert) { GQuark features[] = { TP_TLS_CERTIFICATE_FEATURE_CORE, 0 }; tp_proxy_prepare_async (cert, features, proxy_prepare_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void test_core (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *cert_data; GBytes *d; /* Properties are not valid yet */ g_assert_cmpstr (tp_tls_certificate_get_cert_type (test->cert), ==, NULL); g_assert (tp_tls_certificate_get_cert_data (test->cert) == NULL); g_assert_cmpuint (tp_tls_certificate_get_state (test->cert), ==, TP_TLS_CERTIFICATE_STATE_PENDING); prepare_cert (test, test->cert); g_assert_cmpstr (tp_tls_certificate_get_cert_type (test->cert), ==, "x509"); g_assert_cmpuint (tp_tls_certificate_get_state (test->cert), ==, TP_TLS_CERTIFICATE_STATE_PENDING); cert_data = tp_tls_certificate_get_cert_data (test->cert); g_assert (cert_data != NULL); g_assert_cmpuint (cert_data->len, ==, 1); d = g_ptr_array_index (cert_data, 0); tp_tests_assert_bytes_equals (d, "BADGER", 6); } static void notify_cb (GObject *object, GParamSpec *spec, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void accept_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_tls_certificate_accept_finish (TP_TLS_CERTIFICATE (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_accept (Test *test, gconstpointer data G_GNUC_UNUSED) { g_signal_connect (test->cert, "notify::state", G_CALLBACK (notify_cb), test); tp_tls_certificate_accept_async (test->cert, accept_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (tp_tls_certificate_get_state (test->cert), ==, TP_TLS_CERTIFICATE_STATE_ACCEPTED); } static void reject_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_tls_certificate_reject_finish (TP_TLS_CERTIFICATE (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_reject (Test *test, gconstpointer data G_GNUC_UNUSED) { GVariant *details; const GError *error; TpTLSCertificateRejectReason reason; const gchar *dbus_error; gboolean enabled; TpTLSCertificate *cert; TpTLSCertificateRejection *rej; GError *err = NULL; g_signal_connect (test->cert, "notify::state", G_CALLBACK (notify_cb), test); tp_tls_certificate_add_rejection (test->cert, TP_TLS_CERTIFICATE_REJECT_REASON_REVOKED, NULL, g_variant_new_parsed ("{ 'user-requested': <%b> }", TRUE)); tp_tls_certificate_add_rejection (test->cert, TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN, TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED, NULL); tp_tls_certificate_reject_async (test->cert, reject_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (tp_tls_certificate_get_state (test->cert), ==, TP_TLS_CERTIFICATE_STATE_REJECTED); rej = tp_tls_certificate_get_rejection (test->cert); g_assert (TP_IS_TLS_CERTIFICATE_REJECTION (rej)); error = tp_tls_certificate_rejection_get_error (rej); dbus_error = tp_tls_certificate_rejection_get_dbus_error (rej); reason = tp_tls_certificate_rejection_get_reason (rej); details = tp_tls_certificate_rejection_get_details (rej); g_assert_error (error, TP_ERROR, TP_ERROR_CERT_REVOKED); g_assert_cmpstr (dbus_error, ==, TP_ERROR_STR_CERT_REVOKED); g_assert_cmpuint (reason, ==, TP_TLS_CERTIFICATE_REJECT_REASON_REVOKED); g_assert (g_variant_is_of_type (details, G_VARIANT_TYPE_VARDICT)); g_assert_cmpuint (g_variant_n_children (details), ==, 1); g_assert (g_variant_lookup (details, "user-requested", "b", &enabled)); g_assert (enabled); g_assert (!tp_tls_certificate_rejection_raise_error (rej, &err)); g_assert_error (err, TP_ERROR, TP_ERROR_CERT_REVOKED); g_error_free (err); rej = tp_tls_certificate_get_nth_rejection (test->cert, 1); g_assert (TP_IS_TLS_CERTIFICATE_REJECTION (rej)); error = tp_tls_certificate_rejection_get_error (rej); dbus_error = tp_tls_certificate_rejection_get_dbus_error (rej); details = tp_tls_certificate_rejection_get_details (rej); g_assert_error (error, TP_ERROR, TP_ERROR_CAPTCHA_NOT_SUPPORTED); g_assert_cmpstr (dbus_error, ==, TP_ERROR_STR_CAPTCHA_NOT_SUPPORTED); g_assert (g_variant_is_of_type (details, G_VARIANT_TYPE_VARDICT)); g_assert_cmpuint (g_variant_n_children (details), ==, 0); /* Test if we cope with an empty rejections list */ tp_tests_tls_certificate_clear_rejection (test->service_cert); cert = tp_tls_certificate_new (TP_PROXY (test->connection), tp_proxy_get_object_path (test->cert), &test->error); g_assert_no_error (test->error); prepare_cert (test, cert); rej = tp_tls_certificate_get_rejection (cert); g_assert (TP_IS_TLS_CERTIFICATE_REJECTION (rej)); error = tp_tls_certificate_rejection_get_error (rej); dbus_error = tp_tls_certificate_rejection_get_dbus_error (rej); details = tp_tls_certificate_rejection_get_details (rej); g_assert_error (error, TP_ERROR, TP_ERROR_CERT_INVALID); g_assert_cmpstr (dbus_error, ==, TP_ERROR_STR_CERT_INVALID); g_assert (g_variant_is_of_type (details, G_VARIANT_TYPE_VARDICT)); g_assert_cmpuint (g_variant_n_children (details), ==, 0); g_object_unref (cert); } static void invalidated_cb (TpProxy *cert, guint domain, gint code, const gchar *message, Test *test) { g_clear_error (&test->error); test->error = g_error_new_literal (domain, code, message); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_invalidated (Test *test, gconstpointer data G_GNUC_UNUSED) { g_signal_connect (test->cert, "invalidated", G_CALLBACK (invalidated_cb), test); disconnect_conn (test); g_assert_error (test->error, TP_ERROR, TP_ERROR_CANCELLED); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/tls-certificate/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/tls-certificate/core", Test, NULL, setup, test_core, teardown); g_test_add ("/tls-certificate/accept", Test, NULL, setup, test_accept, teardown); g_test_add ("/tls-certificate/reject", Test, NULL, setup, test_reject, teardown); g_test_add ("/tls-certificate/invalidated", Test, NULL, setup, test_invalidated, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/unsupported-interface.c0000644000175000017500000001472612652510705020240 00000000000000/* Regression test for unsupported interfaces on objects. * * Copyright © 2007-2012 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. No warranty. */ #include "config.h" #include #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/util.h" typedef struct { TpDBusDaemon *dbus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; guint wait; gboolean reentrant; gboolean freed; GError *error /* initialized by GTest */; } Fixture; static void setup (Fixture *f, gconstpointer data) { tp_debug_set_flags ("all"); f->dbus = tp_tests_dbus_daemon_dup_or_die (); f->service_conn = TP_TESTS_SIMPLE_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_CONTACTS_CONNECTION, "account", "me@example.com", "protocol", "simple-protocol", NULL)); f->service_conn_as_base = TP_BASE_CONNECTION (f->service_conn); g_assert (f->service_conn != NULL); g_assert (f->service_conn_as_base != NULL); g_assert (tp_base_connection_register (f->service_conn_as_base, "simple", &f->conn_name, &f->conn_path, &f->error)); g_assert_no_error (f->error); f->conn = tp_connection_new (f->dbus, f->conn_name, f->conn_path, &f->error); g_assert_no_error (f->error); } static void test_supported_run (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_cli_connection_run_connect (f->conn, -1, &f->error, NULL); g_assert_no_error (f->error); g_assert (ok); } static void test_unsupported_run (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_cli_connection_interface_mail_notification_run_request_inbox_url ( f->conn, -1, NULL /* "out" arg */, &f->error, NULL); g_assert_error (f->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NO_INTERFACE); g_assert (!ok); } static void pretend_to_free (gpointer p) { Fixture *f = p; g_assert (!f->freed); f->freed = TRUE; } static void connect_cb (TpConnection *conn, const GError *error, gpointer user_data, GObject *weak_object) { Fixture *f = user_data; g_assert_no_error (f->error); g_assert (!f->reentrant); g_assert (!f->freed); if (error != NULL) f->error = g_error_copy (error); f->wait--; } static void test_supported_async (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { TpProxyPendingCall *call; f->reentrant = TRUE; f->wait = 1; call = tp_cli_connection_call_connect (f->conn, -1, connect_cb, f, pretend_to_free, NULL); f->reentrant = FALSE; g_assert (call != NULL); g_assert (!f->freed); while (f->wait) g_main_context_iteration (NULL, TRUE); g_assert_no_error (f->error); g_assert (f->freed); } static void inbox_url_cb (TpConnection *conn, const GValueArray *va, const GError *error, gpointer user_data, GObject *weak_object) { Fixture *f = user_data; g_assert_no_error (f->error); /* Unsupported interfaces are signalled by a re-entrant callback in 0.x */ g_assert (f->reentrant); g_assert (!f->freed); if (error != NULL) f->error = g_error_copy (error); f->wait--; } static void test_unsupported_async (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { TpProxyPendingCall *call; f->reentrant = TRUE; f->wait = 1; call = tp_cli_connection_interface_mail_notification_call_request_inbox_url ( f->conn, -1, inbox_url_cb, f, pretend_to_free, NULL); f->reentrant = FALSE; /* Unsupported interfaces are signalled by a re-entrant callback in 0.x */ g_assert (call == NULL); g_assert (f->freed); while (f->wait) g_main_context_iteration (NULL, TRUE); g_assert_error (f->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NO_INTERFACE); } static void do_nothing (TpConnection *conn, ...) { } static void test_supported_signal (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { TpProxySignalConnection *sc; sc = tp_cli_connection_connect_to_status_changed (f->conn, (void (*)(TpConnection *, guint, guint, gpointer, GObject *)) do_nothing, f, pretend_to_free, NULL, &f->error); g_assert_no_error (f->error); g_assert (sc != NULL); g_assert (!f->freed); tp_proxy_signal_connection_disconnect (sc); g_assert (f->freed); } static void test_unsupported_signal (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { TpProxySignalConnection *sc; sc = tp_cli_connection_interface_mail_notification_connect_to_mails_received ( f->conn, (void (*)(TpConnection *, const GPtrArray *, gpointer, GObject *)) do_nothing, f, pretend_to_free, NULL, &f->error); g_assert_error (f->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NO_INTERFACE); g_assert (sc == NULL); g_assert (f->freed); } static void teardown (Fixture *f, gconstpointer data) { TpConnection *conn; g_clear_error (&f->error); g_clear_object (&f->conn); /* disconnect the connection so we don't leak it */ conn = tp_connection_new (f->dbus, f->conn_name, f->conn_path, &f->error); g_assert (conn != NULL); g_assert_no_error (f->error); tp_tests_connection_assert_disconnect_succeeds (conn); tp_tests_proxy_run_until_prepared_or_failed (conn, NULL, &f->error); g_assert_error (f->error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&f->error); g_object_unref (conn); /* borrowed from service_conn */ f->service_conn_as_base = NULL; g_clear_object (&f->service_conn); g_free (f->conn_name); g_free (f->conn_path); g_clear_object (&f->dbus); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_add ("/supported/run", Fixture, NULL, setup, test_supported_run, teardown); g_test_add ("/supported/async", Fixture, NULL, setup, test_supported_async, teardown); g_test_add ("/supported/signal", Fixture, NULL, setup, test_supported_signal, teardown); g_test_add ("/unsupported/run", Fixture, NULL, setup, test_unsupported_run, teardown); g_test_add ("/unsupported/async", Fixture, NULL, setup, test_unsupported_async, teardown); g_test_add ("/unsupported/signal", Fixture, NULL, setup, test_unsupported_signal, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/channel-dispatcher.c0000644000175000017500000000332412652510705017436 00000000000000/* A very basic feature test for TpChannelDispatcher * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpChannelDispatcher *cd; GError *error /* initialized where needed */; } Test; static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->cd = NULL; } static void teardown (Test *test, gconstpointer data) { if (test->cd != NULL) { g_object_unref (test->cd); test->cd = NULL; } /* make sure any pending things have happened */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cd = tp_channel_dispatcher_new (test->dbus); g_assert (test->cd != NULL); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/cd/new", Test, NULL, setup, test_new, teardown); /* tp_channel_dispatcher_present_channel_async() is tested in * test-base-client */ return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/account-request.c0000644000175000017500000004216512652510705017032 00000000000000/* A very basic feature test for TpAccountRequest * * Copyright (C) 2012 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/simple-account.h" #include "tests/lib/simple-account-manager.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpTestsSimpleAccountManager *am; TpTestsSimpleAccount *account_service; TpAccountManager *account_manager; TpAccountRequest *account; GAsyncResult *result; GError *error /* initialized where needed */; } Test; static void setup (Test *test, gconstpointer data G_GNUC_UNUSED) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); g_assert (test->dbus != NULL); /* create the account manager service */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); test->am = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT_MANAGER, NULL); tp_dbus_daemon_register_object (test->dbus, TP_ACCOUNT_MANAGER_OBJECT_PATH, test->am); /* and now the account manager proxy */ test->account_manager = tp_account_manager_dup (); g_assert (test->account_manager != NULL); /* finally create the account service */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/lospolloshermanos", test->account_service); test->account = NULL; } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { g_clear_object (&test->account); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); tp_dbus_daemon_unregister_object (test->dbus, test->am); g_clear_object (&test->am); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_clear_object (&test->account_service); g_clear_object (&test->dbus); tp_clear_pointer (&test->mainloop, g_main_loop_unref); g_clear_error (&test->error); g_clear_object (&test->result); } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Gustavo Fring"); g_assert (TP_IS_ACCOUNT_REQUEST (test->account)); } static void test_gobject_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountManager *am; gchar *manager, *protocol, *display_name; test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Charles Dickens"); g_object_get (test->account, "account-manager", &am, "connection-manager", &manager, "protocol", &protocol, "display-name", &display_name, NULL); g_assert (am == test->account_manager); g_assert_cmpstr (manager, ==, "gabble"); g_assert_cmpstr (protocol, ==, "jabber"); g_assert_cmpstr (display_name, ==, "Charles Dickens"); g_object_unref (am); g_free (manager); g_free (protocol); g_free (display_name); } static void test_parameters (Test *test, gconstpointer data G_GNUC_UNUSED) { GVariant *v_str, *v_int; GVariant *params; gboolean found; const gchar *s; guint u; test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Mike Ehrmantraut"); v_str = g_variant_new_string ("banana"); tp_account_request_set_parameter (test->account, "cheese", v_str); g_variant_unref (v_str); v_int = g_variant_new_uint32 (42); tp_account_request_set_parameter (test->account, "life", v_int); g_variant_unref (v_int); tp_account_request_set_parameter_string (test->account, "great", "expectations"); g_object_get (test->account, "parameters", ¶ms, NULL); g_assert_cmpuint (g_variant_n_children (params), ==, 3); found = g_variant_lookup (params, "cheese", "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "banana"); found = g_variant_lookup (params, "life", "u", &u); g_assert (found); g_assert_cmpuint (u, ==, 42); found = g_variant_lookup (params, "great", "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "expectations"); g_variant_unref (params); /* now let's unset one and see if it's okay */ tp_account_request_unset_parameter (test->account, "cheese"); g_object_get (test->account, "parameters", ¶ms, NULL); g_assert_cmpuint (g_variant_n_children (params), ==, 2); found = g_variant_lookup (params, "life", "u", &u); g_assert (found); g_assert_cmpuint (u, ==, 42); found = g_variant_lookup (params, "great", "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "expectations"); g_variant_unref (params); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GVariant *props; gchar *icon_name, *nickname; TpConnectionPresenceType presence_type; gchar *presence_status, *presence_message; gboolean enabled, connect_automatically; gchar **supersedes; GArray *avatar; gchar *mime_type; gboolean found; const gchar *s; gboolean b; GVariant *v; gchar *service, *storage_provider; test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Walter Jr."); g_object_get (test->account, "properties", &props, NULL); g_assert_cmpuint (g_variant_n_children (props), ==, 0); g_variant_unref (props); /* now set an icon and try again */ tp_account_request_set_icon_name (test->account, "user32.dll"); g_object_get (test->account, "properties", &props, "icon-name", &icon_name, NULL); g_assert_cmpuint (g_variant_n_children (props), ==, 1); found = g_variant_lookup (props, TP_PROP_ACCOUNT_ICON, "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "user32.dll"); g_assert_cmpstr (icon_name, ==, "user32.dll"); g_variant_unref (props); g_free (icon_name); /* now set the nickname and try again */ tp_account_request_set_nickname (test->account, "Walter Jr."); g_object_get (test->account, "properties", &props, "nickname", &nickname, NULL); g_assert_cmpuint (g_variant_n_children (props), ==, 2); found = g_variant_lookup (props, TP_PROP_ACCOUNT_ICON, "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "user32.dll"); found = g_variant_lookup (props, TP_PROP_ACCOUNT_NICKNAME, "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "Walter Jr."); g_assert_cmpstr (nickname, ==, "Walter Jr."); g_variant_unref (props); g_free (nickname); /* next is requested presence */ tp_account_request_set_requested_presence (test->account, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "come at me, bro!"); g_object_get (test->account, "requested-presence-type", &presence_type, "requested-status", &presence_status, "requested-status-message", &presence_message, NULL); g_assert_cmpuint (presence_type, ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (presence_status, ==, "available"); g_assert_cmpstr (presence_message, ==, "come at me, bro!"); g_free (presence_status); g_free (presence_message); /* and automatic presence */ tp_account_request_set_automatic_presence (test->account, TP_CONNECTION_PRESENCE_TYPE_BUSY, "busy", "come at me later, actually!"); g_object_get (test->account, "automatic-presence-type", &presence_type, "automatic-status", &presence_status, "automatic-status-message", &presence_message, NULL); g_assert_cmpuint (presence_type, ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (presence_status, ==, "busy"); g_assert_cmpstr (presence_message, ==, "come at me later, actually!"); g_free (presence_status); g_free (presence_message); /* now enabled and connect automatically */ tp_account_request_set_enabled (test->account, FALSE); tp_account_request_set_connect_automatically (test->account, TRUE); g_object_get (test->account, "properties", &props, "enabled", &enabled, "connect-automatically", &connect_automatically, NULL); g_assert_cmpint (enabled, ==, FALSE); g_assert_cmpint (connect_automatically, ==, TRUE); found = g_variant_lookup (props, TP_PROP_ACCOUNT_ENABLED, "b", &b); g_assert (found); g_assert_cmpint (b, ==, FALSE); found = g_variant_lookup (props, TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY, "b", &b); g_assert (found); g_assert_cmpint (b, ==, TRUE); g_variant_unref (props); /* supersedes */ tp_account_request_add_supersedes (test->account, "/science/yeah/woo"); g_object_get (test->account, "properties", &props, "supersedes", &supersedes, NULL); g_assert_cmpuint (g_strv_length (supersedes), ==, 1); g_assert_cmpstr (supersedes[0], ==, "/science/yeah/woo"); g_assert (supersedes[1] == NULL); found = g_variant_lookup (props, TP_PROP_ACCOUNT_SUPERSEDES, "^a&o", NULL); g_assert (found); g_strfreev (supersedes); g_variant_unref (props); /* avatar */ avatar = g_array_new (FALSE, FALSE, sizeof (guchar)); g_array_append_vals (avatar, "hello world", strlen ("hello world") + 1); tp_account_request_set_avatar (test->account, (const guchar *) avatar->data, avatar->len, "image/lolz"); g_array_unref (avatar); avatar = NULL; g_object_get (test->account, "properties", &props, "avatar", &avatar, "avatar-mime-type", &mime_type, NULL); g_assert_cmpstr (avatar->data, ==, "hello world"); g_assert_cmpuint (avatar->len, ==, strlen ("hello world") + 1); g_assert_cmpstr (mime_type, ==, "image/lolz"); v = g_variant_lookup_value (props, TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR, NULL); g_assert (v != NULL); g_variant_unref (v); g_variant_unref (props); g_array_unref (avatar); g_free (mime_type); /* service */ tp_account_request_set_service (test->account, "Mushroom"); g_object_get (test->account, "properties", &props, "service", &service, NULL); v = g_variant_lookup_value (props, TP_PROP_ACCOUNT_SERVICE, NULL); g_assert (v != NULL); g_assert_cmpstr (g_variant_get_string (v, NULL), ==, "Mushroom"); g_variant_unref (v); g_assert_cmpstr (service, ==, "Mushroom"); g_variant_unref (props); g_free (service); /* storage provider */ tp_account_request_set_storage_provider (test->account, "my.provider"); g_object_get (test->account, "properties", &props, "storage-provider", &storage_provider, NULL); v = g_variant_lookup_value (props, TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER, NULL); g_assert (v != NULL); g_assert_cmpstr (g_variant_get_string (v, NULL), ==, "my.provider"); g_variant_unref (v); g_assert_cmpstr (storage_provider, ==, "my.provider"); g_variant_unref (props); g_free (storage_provider); } static void test_create_succeed (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccount *account; GValueArray *array; GPtrArray *supersedes; GArray *avatar; test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Hank Schrader"); tp_account_request_set_display_name (test->account, "Walter White"); tp_account_request_set_icon_name (test->account, "gasmask"); tp_account_request_set_nickname (test->account, "Heisenberg"); tp_account_request_set_requested_presence (test->account, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", "Better call Saul!"); tp_account_request_set_automatic_presence (test->account, TP_CONNECTION_PRESENCE_TYPE_BUSY, "busy", "Cooking"); tp_account_request_set_enabled (test->account, TRUE); tp_account_request_set_connect_automatically (test->account, TRUE); tp_account_request_set_parameter_string (test->account, "account", "walter@white.us"); tp_account_request_set_parameter_string (test->account, "password", "holly"); tp_account_request_add_supersedes (test->account, "/some/silly/account"); avatar = g_array_new (FALSE, FALSE, sizeof (guchar)); g_array_append_vals (avatar, "blue meth", strlen ("blue meth") + 1); tp_account_request_set_avatar (test->account, (const guchar *) avatar->data, avatar->len, "image/png"); g_array_unref (avatar); avatar = NULL; tp_account_request_create_account_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); account = tp_account_request_create_account_finish (test->account, test->result, &test->error); g_assert_no_error (test->error); g_assert (account != NULL); g_assert_cmpstr (test->am->create_cm, ==, "gabble"); g_assert_cmpstr (test->am->create_protocol, ==, "jabber"); g_assert_cmpstr (test->am->create_display_name, ==, "Walter White"); g_assert_cmpuint (g_hash_table_size (test->am->create_parameters), ==, 2); g_assert_cmpstr (tp_asv_get_string (test->am->create_parameters, "account"), ==, "walter@white.us"); g_assert_cmpstr (tp_asv_get_string (test->am->create_parameters, "password"), ==, "holly"); g_assert_cmpuint (g_hash_table_size (test->am->create_properties), ==, 8); g_assert_cmpstr (tp_asv_get_string (test->am->create_properties, TP_PROP_ACCOUNT_ICON), ==, "gasmask"); g_assert_cmpstr (tp_asv_get_string (test->am->create_properties, TP_PROP_ACCOUNT_NICKNAME), ==, "Heisenberg"); g_assert_cmpint (tp_asv_get_boolean (test->am->create_properties, TP_PROP_ACCOUNT_ENABLED, NULL), ==, TRUE); g_assert_cmpint (tp_asv_get_boolean (test->am->create_properties, TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY, NULL), ==, TRUE); array = tp_asv_get_boxed (test->am->create_properties, TP_PROP_ACCOUNT_REQUESTED_PRESENCE, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_assert_cmpuint (g_value_get_uint (array->values), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (g_value_get_string (array->values + 1), ==, "available"); g_assert_cmpstr (g_value_get_string (array->values + 2), ==, "Better call Saul!"); array = tp_asv_get_boxed (test->am->create_properties, TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_assert_cmpuint (g_value_get_uint (array->values), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (g_value_get_string (array->values + 1), ==, "busy"); g_assert_cmpstr (g_value_get_string (array->values + 2), ==, "Cooking"); supersedes = tp_asv_get_boxed (test->am->create_properties, TP_PROP_ACCOUNT_SUPERSEDES, TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_assert_cmpuint (supersedes->len, ==, 1); g_assert_cmpstr (g_ptr_array_index (supersedes, 0), ==, "/some/silly/account"); array = tp_asv_get_boxed (test->am->create_properties, TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR, TP_STRUCT_TYPE_AVATAR); avatar = g_value_get_boxed (array->values); g_assert_cmpstr (avatar->data, ==, "blue meth"); g_assert_cmpstr (g_value_get_string (array->values + 1), ==, "image/png"); g_object_unref (account); } static void test_create_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccount *account; test->account = tp_account_request_new (test->account_manager, "gabble", "jabber", "Walter White"); /* this will make CreateAccount fail */ tp_account_request_set_parameter_string (test->account, "fail", "yes"); tp_account_request_create_account_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); account = tp_account_request_create_account_finish (test->account, test->result, &test->error); g_assert (test->error != NULL); g_assert (account == NULL); g_clear_error (&test->error); test->result = NULL; /* now let's unset the fail=yes and make sure it works */ tp_account_request_unset_parameter (test->account, "fail"); tp_account_request_create_account_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); account = tp_account_request_create_account_finish (test->account, test->result, &test->error); g_assert_no_error (test->error); g_assert (account != NULL); g_object_unref (account); } int main (int argc, char **argv) { tp_tests_abort_after (10); tp_debug_set_flags ("all"); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/account-request/new", Test, NULL, setup, test_new, teardown); g_test_add ("/account-request/gobject-properties", Test, NULL, setup, test_gobject_properties, teardown); g_test_add ("/account-request/parameters", Test, NULL, setup, test_parameters, teardown); g_test_add ("/account-request/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/account-request/create-succeed", Test, NULL, setup, test_create_succeed, teardown); g_test_add ("/account-request/create-fail", Test, NULL, setup, test_create_fail, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/channel-introspect.c0000644000175000017500000006551212652510705017511 00000000000000/* Basic introspection on a channel (template for further regression tests) * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" #include "tests/lib/util.h" #define IDENTIFIER "them@example.org" static GError *invalidated = NULL; static GMainLoop *mainloop; static void channel_ready (TpChannel *channel, const GError *error, gpointer user_data) { gboolean *set = user_data; *set = TRUE; if (error == NULL) { g_message ("channel %p ready", channel); } else { g_message ("channel %p invalidated: %s #%u \"%s\"", channel, g_quark_to_string (error->domain), error->code, error->message); invalidated = g_error_copy (error); } if (mainloop != NULL) g_main_loop_quit (mainloop); } static void channel_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { GAsyncResult **output = user_data; g_message ("channel %p prepared", object); *output = g_object_ref (res); if (mainloop != NULL) g_main_loop_quit (mainloop); } static void assert_chan_sane (TpChannel *chan, TpHandle handle, gboolean requested, TpHandle initiator_handle, const gchar *initiator_id) { GHashTable *asv; TpHandleType type; g_assert (tp_channel_is_ready (chan)); g_assert_cmpuint (tp_channel_get_handle (chan, NULL), ==, handle); g_assert_cmpuint (tp_channel_get_handle (chan, &type), ==, handle); g_assert_cmpuint (type, ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpstr (tp_channel_get_channel_type (chan), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpuint (tp_channel_get_channel_type_id (chan), ==, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT); g_assert (TP_IS_CONNECTION (tp_channel_borrow_connection (chan))); g_assert_cmpstr (tp_channel_get_identifier (chan), ==, IDENTIFIER); g_assert (tp_channel_get_requested (chan) == requested); g_assert_cmpuint (tp_channel_get_initiator_handle (chan), ==, initiator_handle); g_assert_cmpstr (tp_channel_get_initiator_identifier (chan), ==, initiator_id); asv = tp_channel_borrow_immutable_properties (chan); g_assert (asv != NULL); g_assert_cmpstr ( tp_asv_get_string (asv, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpuint ( tp_asv_get_uint32 (asv, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint ( tp_asv_get_uint32 (asv, TP_PROP_CHANNEL_TARGET_HANDLE, NULL), ==, handle); g_assert_cmpstr ( tp_asv_get_string (asv, TP_PROP_CHANNEL_TARGET_ID), ==, IDENTIFIER); } int main (int argc, char **argv) { TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; TpHandleRepoIface *contact_repo; TpTestsTextChannelNull *service_chan; TpTestsPropsTextChannel *service_props_chan; TpTestsPropsGroupTextChannel *service_props_group_chan; TpDBusDaemon *dbus; TpConnection *conn, *conn2; TpChannel *chan, *chan2; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; gchar *props_chan_path; gchar *props_group_chan_path; gchar *bad_chan_path; TpHandle handle; gboolean was_ready; GError invalidated_for_test = { TP_ERROR, TP_ERROR_PERMISSION_DENIED, "No channel for you!" }; GHashTable *asv; GAsyncResult *prepare_result; GQuark some_features[] = { TP_CHANNEL_FEATURE_CORE, TP_CHANNEL_FEATURE_CHAT_STATES, 0 }; tp_tests_abort_after (10); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); g_assert (service_conn != NULL); g_assert (service_conn_as_base != NULL); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, IDENTIFIER, NULL, &error); g_assert_no_error (error); chan_path = g_strdup_printf ("%s/Channel", conn_path); service_chan = TP_TESTS_TEXT_CHANNEL_NULL (tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", service_conn, "object-path", chan_path, "handle", handle, NULL)); props_chan_path = g_strdup_printf ("%s/PropertiesChannel", conn_path); service_props_chan = TP_TESTS_PROPS_TEXT_CHANNEL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_PROPS_TEXT_CHANNEL, "connection", service_conn, "object-path", props_chan_path, "handle", handle, NULL)); props_group_chan_path = g_strdup_printf ("%s/PropsGroupChannel", conn_path); service_props_group_chan = TP_TESTS_PROPS_GROUP_TEXT_CHANNEL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_PROPS_GROUP_TEXT_CHANNEL, "connection", service_conn, "object-path", props_group_chan_path, "handle", handle, NULL)); mainloop = g_main_loop_new (NULL, FALSE); g_message ("Channel becomes invalid while we wait"); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); tp_proxy_invalidate ((TpProxy *) chan, &invalidated_for_test); prepare_result = NULL; tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_error (error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (error->message, ==, invalidated_for_test.message); g_error_free (error); error = NULL; if (prepare_result == NULL) g_main_loop_run (mainloop); MYASSERT (!tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_error (error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (error->message, ==, invalidated_for_test.message); g_clear_error (&error); /* it was never ready */ g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); g_object_unref (prepare_result); prepare_result = NULL; g_object_unref (chan); chan = NULL; g_message ("Channel becomes invalid and we are called back synchronously"); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); was_ready = FALSE; tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); /* no way to see what this is doing - just make sure it doesn't crash */ tp_proxy_prepare_async (chan, some_features, NULL, NULL); tp_channel_call_when_ready (chan, channel_ready, &was_ready); tp_proxy_invalidate ((TpProxy *) chan, &invalidated_for_test); g_assert (was_ready); g_assert (invalidated != NULL); g_assert_error (invalidated, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (invalidated->message, ==, invalidated_for_test.message); g_error_free (invalidated); invalidated = NULL; /* prepare_async never calls back synchronously */ g_assert (prepare_result == NULL); g_main_loop_run (mainloop); MYASSERT (!tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_error (error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (error->message, ==, invalidated_for_test.message); g_clear_error (&error); g_object_unref (prepare_result); prepare_result = NULL; /* it was never ready */ g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); prepare_result = NULL; tp_proxy_prepare_async (chan, NULL, channel_prepared_cb, &prepare_result); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (service_chan->get_handle_called, ==, 0); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 1); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 0); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, TRUE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); if (prepare_result == NULL) g_main_loop_run (mainloop); MYASSERT (tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_no_error (error); g_object_unref (prepare_result); prepare_result = NULL; /* No property so we can't know if the channel was requested and its * initiator */ assert_chan_sane (chan, handle, FALSE, 0, ""); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait (the version with " "Properties)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_handle_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_interfaces_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_channel_type_called = 0; chan = tp_channel_new (conn, props_chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); prepare_result = NULL; tp_proxy_prepare_async (chan, some_features, channel_prepared_cb, &prepare_result); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_handle_called, ==, 0); g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_channel_type_called, ==, 0); g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_interfaces_called, ==, 0); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, TRUE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); if (prepare_result == NULL) g_main_loop_run (mainloop); MYASSERT (tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_no_error (error); g_object_unref (prepare_result); prepare_result = NULL; assert_chan_sane (chan, handle, TRUE, tp_base_connection_get_self_handle (service_conn_as_base), tp_handle_inspect (contact_repo, tp_base_connection_get_self_handle (service_conn_as_base))); /* no way to see what this is doing - just make sure it doesn't crash */ tp_proxy_prepare_async (chan, some_features, NULL, NULL); prepare_result = NULL; tp_proxy_prepare_async (chan, some_features, channel_prepared_cb, &prepare_result); if (prepare_result == NULL) g_main_loop_run (mainloop); MYASSERT (tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_no_error (error); g_object_unref (prepare_result); prepare_result = NULL; g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait (preloading immutable " "properties)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_handle_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_interfaces_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_channel_type_called = 0; g_hash_table_remove_all (TP_TESTS_PROPS_TEXT_CHANNEL (service_props_chan) ->dbus_property_interfaces_retrieved); asv = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INITIATOR_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_INITIATOR_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV, NULL, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, NULL); chan = tp_channel_new_from_properties (conn, props_chan_path, asv, &error); g_assert_no_error (error); g_hash_table_unref (asv); asv = NULL; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size ( service_props_chan->dbus_property_interfaces_retrieved), ==, 0); g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_handle_called, ==, 0); g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_channel_type_called, ==, 0); /* FIXME: with an improved fast-path we could avoid this one too maybe? */ /* g_assert_cmpuint ( TP_TESTS_TEXT_CHANNEL_NULL (service_props_chan)->get_interfaces_called, ==, 0); */ assert_chan_sane (chan, handle, FALSE, handle, IDENTIFIER); g_object_unref (chan); chan = NULL; g_message ("Group channel becomes ready while we wait (preloading immutable " "properties)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan)->get_handle_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan)->get_interfaces_called = 0; TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan)->get_channel_type_called = 0; g_hash_table_remove_all (TP_TESTS_PROPS_TEXT_CHANNEL ( service_props_group_chan) ->dbus_property_interfaces_retrieved); { const gchar *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL }; asv = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INITIATOR_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_INITIATOR_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, NULL); } chan = tp_channel_new_from_properties (conn, props_group_chan_path, asv, &error); g_assert_no_error (error); g_hash_table_unref (asv); asv = NULL; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan) ->get_handle_called, ==, 0); g_assert_cmpuint (TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan) ->get_channel_type_called, ==, 0); g_assert_cmpuint (TP_TESTS_TEXT_CHANNEL_NULL (service_props_group_chan) ->get_interfaces_called, ==, 0); g_assert_cmpuint (g_hash_table_size ( TP_TESTS_PROPS_TEXT_CHANNEL (service_props_group_chan) ->dbus_property_interfaces_retrieved), ==, 1); /* Only Chan.I.Group's properties should have been retrieved */ g_assert (g_hash_table_lookup ( TP_TESTS_PROPS_TEXT_CHANNEL (service_props_group_chan) ->dbus_property_interfaces_retrieved, GUINT_TO_POINTER (TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)) != NULL); assert_chan_sane (chan, handle, FALSE, handle, IDENTIFIER); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait (in the case where we " "have to discover the channel type)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; chan = tp_channel_new (conn, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (service_chan->get_handle_called, ==, 0); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 1); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 1); assert_chan_sane (chan, handle, FALSE, 0, ""); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait (in the case where we " "have to discover the handle type)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (service_chan->get_handle_called, ==, 1); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 1); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 0); assert_chan_sane (chan, handle, FALSE, 0, ""); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready while we wait (in the case where we " "have to discover the handle)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, 0, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (service_chan->get_handle_called, ==, 1); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 1); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 0); assert_chan_sane (chan, handle, FALSE, 0, ""); g_object_unref (chan); chan = NULL; g_message ("channel does not, in fact, exist (callback)"); bad_chan_path = g_strdup_printf ("%s/Does/Not/Actually/Exist", conn_path); chan = tp_channel_new (conn, bad_chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); was_ready = FALSE; tp_channel_call_when_ready (chan, channel_ready, &was_ready); g_main_loop_run (mainloop); g_assert (was_ready); g_assert_error (invalidated, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_error_free (invalidated); invalidated = NULL; g_object_unref (chan); chan = NULL; g_free (bad_chan_path); bad_chan_path = NULL; g_message ("channel does not, in fact, exist (run_until_ready)"); bad_chan_path = g_strdup_printf ("%s/Does/Not/Actually/Exist", conn_path); chan = tp_channel_new (conn, bad_chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_error_free (error); error = NULL; g_object_unref (chan); chan = NULL; g_free (bad_chan_path); bad_chan_path = NULL; g_message ("Channel doesn't actually implement Group (preloading immutable " "properties)"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; { const gchar *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL }; asv = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INITIATOR_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_INITIATOR_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, NULL); } /* We lie and say that the basic Text channel has the Group interface; this * should make introspection fail. */ chan = tp_channel_new_from_properties (conn, chan_path, asv, &error); g_assert_no_error (error); g_hash_table_unref (asv); asv = NULL; MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_error_free (error); error = NULL; g_assert_cmpuint (service_chan->get_handle_called, ==, 0); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 0); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 0); g_object_unref (chan); chan = NULL; g_message ("Channel becomes ready and we are called back"); tp_tests_proxy_run_until_dbus_queue_processed (conn); service_chan->get_handle_called = 0; service_chan->get_interfaces_called = 0; service_chan->get_channel_type_called = 0; chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); was_ready = FALSE; tp_channel_call_when_ready (chan, channel_ready, &was_ready); g_message ("Entering main loop"); g_main_loop_run (mainloop); g_message ("Leaving main loop"); g_assert (was_ready); g_assert_no_error (invalidated); g_assert_cmpuint (service_chan->get_handle_called, ==, 0); g_assert_cmpuint (service_chan->get_interfaces_called, ==, 1); g_assert_cmpuint (service_chan->get_channel_type_called, ==, 0); assert_chan_sane (chan, handle, FALSE, 0, ""); /* ... keep the same channel for the next test */ g_message ("Channel already ready, so we are called back synchronously"); was_ready = FALSE; tp_channel_call_when_ready (chan, channel_ready, &was_ready); g_assert (was_ready); g_assert_no_error (invalidated); assert_chan_sane (chan, handle, FALSE, 0, ""); /* regression test for fdo#41729 * * tp-glib uses to rely on its introspection queue to add the interface ID * of its channel type even when the type was already known during * construction. * * This test create new proxies, ensuring that the TpConnection of the * TpChannel isn't prepared yet, and check that the interface is added right * away after its construction. * */ conn2 = tp_connection_new (dbus, name, conn_path, &error); g_assert_no_error (error); { const gchar *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL }; asv = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INITIATOR_HANDLE, G_TYPE_UINT, handle, TP_PROP_CHANNEL_INITIATOR_ID, G_TYPE_STRING, IDENTIFIER, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, NULL); } chan2 = tp_channel_new_from_properties (conn2, props_group_chan_path, asv, &error); g_assert_no_error (error); g_assert (tp_proxy_has_interface_by_id (chan2, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT)); g_assert (tp_proxy_has_interface_by_id (chan2, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)); g_hash_table_unref (asv); g_clear_object (&chan2); g_clear_object (&conn2); /* ... keep the same channel for the next test */ g_message ("Channel already dead, so we are called back synchronously"); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, TRUE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); tp_tests_connection_assert_disconnect_succeeds (conn); was_ready = FALSE; prepare_result = NULL; tp_proxy_prepare_async (chan, some_features, channel_prepared_cb, &prepare_result); tp_channel_call_when_ready (chan, channel_ready, &was_ready); g_assert (was_ready); g_assert_error (invalidated, TP_ERROR, TP_ERROR_CANCELLED); /* is_prepared becomes FALSE because the channel broke */ g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CORE), ==, FALSE); g_assert_cmpint (tp_proxy_is_prepared (chan, TP_CHANNEL_FEATURE_CHAT_STATES), ==, FALSE); g_assert_error (invalidated, tp_proxy_get_invalidated (chan)->domain, tp_proxy_get_invalidated (chan)->code); g_assert_cmpstr (invalidated->message, ==, tp_proxy_get_invalidated (chan)->message); /* ... but prepare_async still hasn't finished until we run the main loop */ g_assert (prepare_result == NULL); g_main_loop_run (mainloop); g_assert (prepare_result != NULL); MYASSERT (!tp_proxy_prepare_finish (chan, prepare_result, &error), ""); g_assert_error (error, invalidated->domain, invalidated->code); g_assert_cmpstr (error->message, ==, invalidated->message); tp_clear_object (&prepare_result); g_clear_error (&error); g_clear_error (&invalidated); g_object_unref (chan); chan = NULL; /* clean up */ g_assert (chan == NULL); g_main_loop_unref (mainloop); mainloop = NULL; tp_handle_unref (contact_repo, handle); g_object_unref (conn); g_object_unref (service_chan); g_object_unref (service_props_chan); g_object_unref (service_props_group_chan); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); g_free (chan_path); g_free (props_chan_path); g_free (props_group_chan_path); return 0; } telepathy-glib-0.24.2/tests/dbus/protocol-objects.c0000644000175000017500000006204112652510705017173 00000000000000/* Regression test for Protocol objects in the echo-2 example CM. * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/echo-cm.h" #include "examples/cm/echo-message-parts/connection-manager.h" #include "examples/cm/echo-message-parts/chan.h" #include "examples/cm/echo-message-parts/conn.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; GError *error /* statically initialized to NULL */ ; ExampleEcho2ConnectionManager *service_cm; TpConnectionManager *cm; TpProtocol *protocol; TpTestsEchoConnectionManager *old_service_cm; TpConnectionManager *old_cm; TpProtocol *old_protocol; TpConnectionManager *file_cm; TpProtocol *file_protocol; } Test; static void setup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpBaseConnectionManager *service_cm_as_base; gboolean ok; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_dbus_daemon_dup (NULL); g_assert (test->dbus != NULL); test->service_cm = EXAMPLE_ECHO_2_CONNECTION_MANAGER (g_object_new ( EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, NULL)); g_assert (test->service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (test->service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); test->cm = tp_connection_manager_new (test->dbus, "example_echo_2", NULL, &test->error); g_assert (test->cm != NULL); tp_tests_proxy_run_until_prepared (test->cm, NULL); test->old_service_cm = TP_TESTS_ECHO_CONNECTION_MANAGER (g_object_new ( TP_TESTS_TYPE_ECHO_CONNECTION_MANAGER, NULL)); g_assert (test->old_service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (test->old_service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); test->old_cm = tp_connection_manager_new (test->dbus, "example_echo", NULL, &test->error); g_assert (test->old_cm != NULL); tp_tests_proxy_run_until_prepared (test->old_cm, NULL); test->file_cm = tp_connection_manager_new (test->dbus, "test_manager_file", NULL, &test->error); g_assert (test->file_cm != NULL); tp_tests_proxy_run_until_prepared (test->file_cm, NULL); test->old_protocol = NULL; } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_clear_object (&test->protocol); tp_clear_object (&test->cm); tp_clear_object (&test->service_cm); tp_clear_object (&test->old_service_cm); tp_clear_object (&test->old_cm); tp_clear_object (&test->old_protocol); tp_clear_object (&test->file_cm); tp_clear_object (&test->file_protocol); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; } const gchar * const expected_interfaces[] = { TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, NULL }; const gchar * const expected_protocol_interfaces[] = { TP_IFACE_PROTOCOL_INTERFACE_AVATARS, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING, NULL }; const gchar * const expected_cm_interfaces[] = { "im.telepathy.Tests.Example", NULL }; const gchar * const expected_supported_avatar_mime_types[] = { "image/png", "image/jpeg", "image/gif", NULL }; const gchar * const expected_addressable_vcard_fields[] = { "x-jabber", "tel", NULL }; const gchar * const expected_addressable_uri_schemes[] = { "xmpp", "tel", NULL }; static void test_protocol_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties = NULL; GPtrArray *arr; GValueArray *va; GHashTable *fixed; test->protocol = tp_protocol_new (test->dbus, "example_echo_2", "example", NULL, NULL); g_assert (test->protocol != NULL); tp_cli_dbus_properties_run_get_all (test->protocol, -1, TP_IFACE_PROTOCOL, &properties, &test->error, NULL); g_assert_no_error (test->error); tp_tests_assert_strv_equals ( tp_asv_get_boxed (properties, "Interfaces", G_TYPE_STRV), expected_protocol_interfaces); g_assert_cmpstr (tp_asv_get_string (properties, "Icon"), ==, "im-icq"); g_assert_cmpstr (tp_asv_get_string (properties, "EnglishName"), ==, "Echo II example"); g_assert_cmpstr (tp_asv_get_string (properties, "VCardField"), ==, "x-telepathy-example"); g_assert_cmpstr (tp_asv_get_string (properties, "VCardField"), ==, "x-telepathy-example"); tp_tests_assert_strv_equals (tp_asv_get_boxed (properties, "ConnectionInterfaces", G_TYPE_STRV), expected_interfaces); arr = tp_asv_get_boxed (properties, "RequestableChannelClasses", TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST); g_assert (arr != NULL); g_assert_cmpuint (arr->len, ==, 1); va = g_ptr_array_index (arr, 0); g_assert (G_VALUE_HOLDS (va->values + 0, TP_HASH_TYPE_CHANNEL_CLASS)); g_assert (G_VALUE_HOLDS (va->values + 1, G_TYPE_STRV)); fixed = g_value_get_boxed (va->values + 0); g_assert_cmpstr (tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); arr = tp_asv_get_boxed (properties, "Parameters", TP_ARRAY_TYPE_PARAM_SPEC_LIST); g_assert (arr != NULL); g_assert_cmpuint (arr->len, >=, 1); } static void test_protocol_avatar_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties = NULL; gboolean is_set; guint num; test->protocol = tp_protocol_new (test->dbus, "example_echo_2", "example", NULL, NULL); g_assert (test->protocol != NULL); tp_cli_dbus_properties_run_get_all (test->protocol, -1, TP_IFACE_PROTOCOL_INTERFACE_AVATARS, &properties, &test->error, NULL); g_assert_no_error (test->error); tp_tests_assert_strv_equals ( tp_asv_get_boxed (properties, "SupportedAvatarMIMETypes", G_TYPE_STRV), expected_supported_avatar_mime_types); num = tp_asv_get_uint32 (properties, "MinimumAvatarHeight", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 32); num = tp_asv_get_uint32 (properties, "MinimumAvatarWidth", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 32); num = tp_asv_get_uint32 (properties, "RecommendedAvatarHeight", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 64); num = tp_asv_get_uint32 (properties, "RecommendedAvatarWidth", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 64); num = tp_asv_get_uint32 (properties, "MaximumAvatarHeight", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 96); num = tp_asv_get_uint32 (properties, "MaximumAvatarWidth", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 96); num = tp_asv_get_uint32 (properties, "MaximumAvatarBytes", &is_set); g_assert (is_set); g_assert_cmpuint (num, ==, 37748736); } static void test_protocol_addressing_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties = NULL; test->protocol = tp_protocol_new (test->dbus, "example_echo_2", "example", NULL, NULL); g_assert (test->protocol != NULL); tp_cli_dbus_properties_run_get_all (test->protocol, -1, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING, &properties, &test->error, NULL); g_assert_no_error (test->error); tp_tests_assert_strv_equals ( tp_asv_get_boxed (properties, "AddressableVCardFields", G_TYPE_STRV), expected_addressable_vcard_fields); tp_tests_assert_strv_equals ( tp_asv_get_boxed (properties, "AddressableURISchemes", G_TYPE_STRV), expected_addressable_uri_schemes); } static void test_protocols_property (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties = NULL; GHashTable *protocols; GHashTable *pp; GPtrArray *arr; GValueArray *va; GHashTable *fixed; tp_cli_dbus_properties_run_get_all (test->cm, -1, TP_IFACE_CONNECTION_MANAGER, &properties, &test->error, NULL); g_assert_no_error (test->error); g_assert (tp_asv_lookup (properties, "Interfaces") != NULL); test_assert_empty_strv (tp_asv_get_boxed (properties, "Interfaces", G_TYPE_STRV)); protocols = tp_asv_get_boxed (properties, "Protocols", TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP); g_assert (protocols != NULL); g_assert_cmpuint (g_hash_table_size (protocols), ==, 1); pp = g_hash_table_lookup (protocols, "example"); g_assert (pp != NULL); tp_tests_assert_strv_equals ( tp_asv_get_boxed (pp, TP_PROP_PROTOCOL_INTERFACES, G_TYPE_STRV), expected_protocol_interfaces); g_assert_cmpstr (tp_asv_get_string (pp, TP_PROP_PROTOCOL_ICON), ==, "im-icq"); g_assert_cmpstr (tp_asv_get_string (pp, TP_PROP_PROTOCOL_ENGLISH_NAME), ==, "Echo II example"); g_assert_cmpstr (tp_asv_get_string (pp, TP_PROP_PROTOCOL_VCARD_FIELD), ==, "x-telepathy-example"); tp_tests_assert_strv_equals (tp_asv_get_boxed (pp, TP_PROP_PROTOCOL_CONNECTION_INTERFACES, G_TYPE_STRV), expected_interfaces); arr = tp_asv_get_boxed (pp, TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST); g_assert (arr != NULL); g_assert_cmpuint (arr->len, ==, 1); va = g_ptr_array_index (arr, 0); g_assert (G_VALUE_HOLDS (va->values + 0, TP_HASH_TYPE_CHANNEL_CLASS)); g_assert (G_VALUE_HOLDS (va->values + 1, G_TYPE_STRV)); fixed = g_value_get_boxed (va->values + 0); g_assert_cmpstr (tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); arr = tp_asv_get_boxed (pp, TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST); g_assert (arr != NULL); g_assert_cmpuint (arr->len, >=, 1); } static void test_protocols_property_old (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties = NULL; GHashTable *protocols; GHashTable *pp; GPtrArray *arr; tp_cli_dbus_properties_run_get_all (test->old_cm, -1, TP_IFACE_CONNECTION_MANAGER, &properties, &test->error, NULL); g_assert_no_error (test->error); g_assert (tp_asv_lookup (properties, "Interfaces") != NULL); tp_tests_assert_strv_equals (tp_asv_get_boxed (properties, "Interfaces", G_TYPE_STRV), expected_cm_interfaces); protocols = tp_asv_get_boxed (properties, "Protocols", TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP); g_assert (protocols != NULL); g_assert_cmpuint (g_hash_table_size (protocols), ==, 1); pp = g_hash_table_lookup (protocols, "example"); g_assert (pp != NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_INTERFACES) == NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_ICON) == NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_ENGLISH_NAME) == NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_VCARD_FIELD) == NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_CONNECTION_INTERFACES) == NULL); g_assert (tp_asv_lookup (pp, TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES) == NULL); arr = tp_asv_get_boxed (pp, TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST); g_assert (arr != NULL); g_assert_cmpuint (arr->len, >=, 1); } static void check_avatar_requirements (TpAvatarRequirements *req) { g_assert (req != NULL); g_assert (req->supported_mime_types != NULL); g_assert_cmpuint (g_strv_length (req->supported_mime_types), ==, 3); g_assert (tp_strv_contains ((const gchar * const *) req->supported_mime_types, "image/png")); g_assert (tp_strv_contains ((const gchar * const *) req->supported_mime_types, "image/jpeg")); g_assert (tp_strv_contains ((const gchar * const *) req->supported_mime_types, "image/gif")); g_assert_cmpuint (req->minimum_width, ==, 32); g_assert_cmpuint (req->minimum_height, ==, 32); g_assert_cmpuint (req->recommended_width, ==, 64); g_assert_cmpuint (req->recommended_height, ==, 64); g_assert_cmpuint (req->maximum_width, ==, 96); g_assert_cmpuint (req->maximum_height, ==, 96); g_assert_cmpuint (req->maximum_bytes, ==, 37748736); } static void check_tp_protocol (TpProtocol *protocol) { TpAvatarRequirements *req; GList *l; TpConnectionManagerParam *param; g_assert_cmpstr (tp_protocol_get_name (protocol), ==, "example"); g_assert_cmpstr (tp_protocol_get_cm_name (protocol), ==, "example_echo_2"); g_assert (tp_proxy_has_interface_by_id (protocol, TP_IFACE_QUARK_PROTOCOL)); g_assert (tp_proxy_has_interface_by_id (protocol, TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS)); g_assert (tp_proxy_is_prepared (protocol, TP_PROTOCOL_FEATURE_PARAMETERS)); g_assert (tp_protocol_has_param (protocol, "account")); g_assert (!tp_protocol_has_param (protocol, "no-way")); g_assert (tp_proxy_is_prepared (protocol, TP_PROTOCOL_FEATURE_CORE)); g_assert_cmpstr (tp_protocol_get_icon_name (protocol), ==, "im-icq"); g_assert_cmpstr (tp_protocol_get_english_name (protocol), ==, "Echo II example"); g_assert_cmpstr (tp_protocol_get_vcard_field (protocol), ==, "x-telepathy-example"); g_assert (TP_IS_CAPABILITIES (tp_protocol_get_capabilities ( protocol))); req = tp_protocol_get_avatar_requirements (protocol); check_avatar_requirements (req); g_object_get (protocol, "avatar-requirements", &req, NULL); check_avatar_requirements (req); l = tp_protocol_dup_params (protocol); g_assert_cmpuint (g_list_length (l), ==, 1); param = l->data; g_assert_cmpstr (param->name, ==, "account"); g_list_free_full (l, (GDestroyNotify) tp_connection_manager_param_free); g_assert_cmpstr (tp_protocol_get_param (protocol, "account")->name, ==, "account"); param = tp_protocol_dup_param (protocol, "account"); /* it's a copy */ g_assert (param != tp_protocol_get_param (protocol, "account")); g_assert_cmpstr (param->name, ==, "account"); tp_connection_manager_param_free (param); g_assert_cmpstr (tp_protocol_borrow_params (protocol)[0].name, ==, "account"); g_assert_cmpstr (tp_protocol_borrow_params (protocol)[1].name, ==, NULL); } static void test_protocol_object (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *props; TpProtocol *protocol; GVariant *vardict; g_assert_cmpstr (tp_connection_manager_get_name (test->cm), ==, "example_echo_2"); tp_tests_proxy_run_until_prepared (test->cm, NULL); test->protocol = g_object_ref ( tp_connection_manager_get_protocol_object (test->cm, "example")); check_tp_protocol (test->protocol); /* Create a new TpProtocol for the same protocol but by passing it all its * immutable properities */ g_object_get (test->protocol, "protocol-properties", &props, NULL); protocol = tp_protocol_new (test->dbus, "example_echo_2", "example", props, &test->error); g_assert_no_error (test->error); g_assert (TP_IS_PROTOCOL (protocol)); check_tp_protocol (protocol); vardict = tp_protocol_dup_immutable_properties (test->protocol); g_assert (vardict != NULL); g_assert (g_variant_is_of_type (vardict, G_VARIANT_TYPE_VARDICT)); g_object_unref (protocol); /* Same but using tp_protocol_new_vardict */ protocol = tp_protocol_new_vardict (test->dbus, "example_echo_2", "example", vardict, &test->error); g_assert_no_error (test->error); g_assert (TP_IS_PROTOCOL (protocol)); check_tp_protocol (protocol); g_object_unref (protocol); g_variant_unref (vardict); g_hash_table_unref (props); } static void test_protocol_object_old (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAvatarRequirements *req; g_assert_cmpstr (tp_connection_manager_get_name (test->old_cm), ==, "example_echo"); tp_tests_proxy_run_until_prepared (test->old_cm, NULL); test->old_protocol = g_object_ref ( tp_connection_manager_get_protocol_object (test->old_cm, "example")); g_assert_cmpstr (tp_protocol_get_name (test->old_protocol), ==, "example"); g_assert (tp_proxy_is_prepared (test->old_protocol, TP_PROTOCOL_FEATURE_PARAMETERS)); g_assert (tp_protocol_has_param (test->old_protocol, "account")); g_assert (!tp_protocol_has_param (test->old_protocol, "no-way")); g_assert (!tp_proxy_is_prepared (test->old_protocol, TP_PROTOCOL_FEATURE_CORE)); g_assert_cmpstr (tp_protocol_get_icon_name (test->old_protocol), ==, "im-example"); g_assert_cmpstr (tp_protocol_get_english_name (test->old_protocol), ==, "Example"); g_assert_cmpstr (tp_protocol_get_vcard_field (test->old_protocol), ==, NULL); g_assert (tp_protocol_get_capabilities (test->old_protocol) == NULL); req = tp_protocol_get_avatar_requirements (test->old_protocol); g_assert (req == NULL); } static void test_protocol_object_from_file (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_PROTOCOL_FEATURE_CORE, 0 }; TpCapabilities *caps; TpAvatarRequirements *req; g_assert_cmpstr (tp_connection_manager_get_name (test->file_cm), ==, "test_manager_file"); tp_tests_proxy_run_until_prepared (test->file_cm, NULL); test->file_protocol = g_object_ref ( tp_connection_manager_get_protocol_object (test->file_cm, "foo")); g_assert_cmpstr (tp_protocol_get_name (test->file_protocol), ==, "foo"); g_assert (tp_proxy_is_prepared (test->file_protocol, TP_PROTOCOL_FEATURE_PARAMETERS)); g_assert (tp_protocol_has_param (test->file_protocol, "account")); g_assert (!tp_protocol_has_param (test->file_protocol, "no-way")); tp_tests_proxy_run_until_prepared (test->file_protocol, features); g_assert (tp_proxy_is_prepared (test->file_protocol, TP_PROTOCOL_FEATURE_CORE)); g_assert_cmpstr (tp_protocol_get_icon_name (test->file_protocol), ==, "im-icq"); g_assert_cmpstr (tp_protocol_get_english_name (test->file_protocol), ==, "Regression tests"); g_assert_cmpstr (tp_protocol_get_vcard_field (test->file_protocol), ==, "x-telepathy-tests"); g_assert (tp_protocol_get_capabilities (test->file_protocol) != NULL); caps = tp_protocol_get_capabilities (test->file_protocol); g_assert (!tp_capabilities_is_specific_to_contact (caps)); g_assert (tp_capabilities_supports_text_chats (caps)); g_assert (!tp_capabilities_supports_text_chatrooms (caps)); req = tp_protocol_get_avatar_requirements (test->file_protocol); check_avatar_requirements (req); g_object_get (test->file_protocol, "avatar-requirements", &req, NULL); check_avatar_requirements (req); } static void test_normalize (Test *test, gconstpointer data G_GNUC_UNUSED) { GAsyncResult *result = NULL; gchar *s; tp_tests_proxy_run_until_prepared (test->cm, NULL); test->protocol = g_object_ref ( tp_connection_manager_get_protocol_object (test->cm, "example")); tp_protocol_normalize_contact_async (test->protocol, "MiXeDcAsE", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_contact_finish (test->protocol, result, &test->error); g_assert_no_error (test->error); g_assert_cmpstr (s, ==, "mixedcase"); g_clear_object (&result); g_free (s); tp_protocol_normalize_contact_async (test->protocol, "", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_contact_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_HANDLE); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_normalize_contact_uri_async (test->protocol, "xmpp:MiXeDcAsE", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, &test->error); g_assert_no_error (test->error); g_assert_cmpstr (s, ==, "xmpp:mixedcase"); g_clear_object (&result); g_free (s); tp_protocol_normalize_contact_uri_async (test->protocol, "xmpp:", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, &test->error); g_assert_cmpstr (s, ==, NULL); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_normalize_contact_uri_async (test->protocol, "http://example.com", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_contact_uri_finish (test->protocol, result, &test->error); g_assert_cmpstr (s, ==, NULL); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_normalize_vcard_address_async (test->protocol, "x-jabber", "MiXeDcAsE", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, &test->error); g_assert_no_error (test->error); g_assert_cmpstr (s, ==, "mixedcase"); g_clear_object (&result); g_free (s); tp_protocol_normalize_vcard_address_async (test->protocol, "x-jabber", "", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_normalize_vcard_address_async (test->protocol, "x-skype", "", NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_normalize_vcard_address_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); } static void test_id (Test *test, gconstpointer data G_GNUC_UNUSED) { GAsyncResult *result = NULL; gchar *s; tp_tests_proxy_run_until_prepared (test->cm, NULL); test->protocol = g_object_ref ( tp_connection_manager_get_protocol_object (test->cm, "example")); tp_protocol_identify_account_async (test->protocol, g_variant_new_parsed ("{ 'account': <'Hello'> }"), NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_identify_account_finish (test->protocol, result, &test->error); g_assert_no_error (test->error); g_assert_cmpstr (s, ==, "hello"); g_clear_object (&result); g_free (s); tp_protocol_identify_account_async (test->protocol, g_variant_new_parsed ("{ 'account': <'Hello'>, 'unknown-param': <42> }"), NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_identify_account_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_identify_account_async (test->protocol, g_variant_new_parsed ("@a{sv} {}"), NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_identify_account_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); tp_protocol_identify_account_async (test->protocol, g_variant_new_parsed ("@a{sv} { 'account': <''> }"), NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); s = tp_protocol_identify_account_finish (test->protocol, result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert_cmpstr (s, ==, NULL); g_clear_object (&result); g_clear_error (&test->error); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/protocol-objects/protocol-properties", Test, NULL, setup, test_protocol_properties, teardown); g_test_add ("/protocol-objects/protocol-avatar-properties", Test, NULL, setup, test_protocol_avatar_properties, teardown); g_test_add ("/protocol-objects/protocol-addressing-properties", Test, NULL, setup, test_protocol_addressing_properties, teardown); g_test_add ("/protocol-objects/protocols-property", Test, NULL, setup, test_protocols_property, teardown); g_test_add ("/protocol-objects/protocols-property-old", Test, NULL, setup, test_protocols_property_old, teardown); g_test_add ("/protocol-objects/object", Test, NULL, setup, test_protocol_object, teardown); g_test_add ("/protocol-objects/object-old", Test, NULL, setup, test_protocol_object_old, teardown); g_test_add ("/protocol-objects/object-from-file", Test, NULL, setup, test_protocol_object_from_file, teardown); g_test_add ("/protocol-objects/normalize", Test, NULL, setup, test_normalize, teardown); g_test_add ("/protocol-objects/id", Test, NULL, setup, test_id, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/contact-lists.c0000644000175000017500000027375514004031760016502 00000000000000/* Feature test for contact lists * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "examples/cm/contactlist/conn.h" #include "tests/lib/debug.h" #include "tests/lib/util.h" typedef enum { CONTACTS_CHANGED, GROUPS_CHANGED, GROUPS_CREATED, GROUPS_REMOVED, GROUP_RENAMED, BLOCKED_CONTACTS_CHANGED } LogEntryType; typedef struct { LogEntryType type; /* ContactsChanged */ GHashTable *contacts_changed; TpIntset *contacts_removed; /* GroupsChanged */ GArray *contacts; /* GroupsChanged, GroupsCreated, GroupRenamed */ GStrv groups_added; /* GroupsChanged, GroupsRemoved, GroupRenamed */ GStrv groups_removed; /* BlockedContactsChanged */ GHashTable *blocked_contacts; GHashTable *unblocked_contacts; } LogEntry; static void log_entry_free (LogEntry *le) { if (le->contacts_changed != NULL) g_hash_table_unref (le->contacts_changed); if (le->contacts_removed != NULL) tp_intset_destroy (le->contacts_removed); if (le->contacts != NULL) g_array_unref (le->contacts); g_strfreev (le->groups_added); g_strfreev (le->groups_removed); if (le->blocked_contacts != NULL) g_hash_table_unref (le->blocked_contacts); if (le->unblocked_contacts != NULL) g_hash_table_unref (le->unblocked_contacts); g_slice_free (LogEntry, le); } typedef struct { TpDBusDaemon *dbus; ExampleContactListConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; TpChannel *publish; TpChannel *subscribe; TpChannel *stored; TpChannel *deny; TpChannel *group; TpHandleRepoIface *contact_repo; TpHandle sjoerd; TpHandle helen; TpHandle wim; TpHandle bill; TpHandle ninja; TpHandle canceller; GArray *arr; /* list of LogEntry */ GPtrArray *log; GAsyncResult *prepare_result; GHashTable *contact_attributes; GMainLoop *main_loop; GError *error /* = NULL */; } Test; static void test_quit_loop (gpointer p) { Test *test = p; g_main_loop_quit (test->main_loop); } static void contacts_changed_with_id_cb (TpConnection *connection, GHashTable *changes, GHashTable *identifiers, GHashTable *removals, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); GHashTableIter i; gpointer key, value; if (g_hash_table_size (changes) > 0) g_assert_cmpuint (g_hash_table_size (changes), ==, g_hash_table_size (identifiers)); else g_assert_cmpuint (g_hash_table_size (removals), >, 0); le->type = CONTACTS_CHANGED; le->contacts_changed = g_boxed_copy (TP_HASH_TYPE_CONTACT_SUBSCRIPTION_MAP, changes); /* We asserted above that we have as many identifiers as we have changes. */ g_hash_table_iter_init (&i, identifiers); while (g_hash_table_iter_next (&i, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); g_assert_cmpstr (value, ==, tp_handle_inspect (test->contact_repo, handle)); } le->contacts_removed = tp_intset_new (); g_hash_table_iter_init (&i, removals); while (g_hash_table_iter_next (&i, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); g_assert_cmpstr (value, ==, tp_handle_inspect (test->contact_repo, handle)); tp_intset_add (le->contacts_removed, handle); } g_ptr_array_add (test->log, le); } static void contacts_changed_cb (TpConnection *connection, GHashTable *changes, const GArray *removals, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le; GHashTableIter i; gpointer key, value; TpIntset *removal_set; g_assert (g_hash_table_size (changes) > 0 || removals->len > 0); /* We should have had a ContactsChangedByID signal immediately before this * signal */ g_assert_cmpuint (test->log->len, >, 0); le = g_ptr_array_index (test->log, test->log->len - 1); g_assert_cmpuint (le->type, ==, CONTACTS_CHANGED); /* The changes should all have been the same as in the previous signal */ g_assert_cmpuint (g_hash_table_size (changes), ==, g_hash_table_size (le->contacts_changed)); g_hash_table_iter_init (&i, changes); while (g_hash_table_iter_next (&i, &key, &value)) { GValueArray *existing = g_hash_table_lookup (le->contacts_changed, key); GValueArray *emitted = value; guint existing_sub, existing_pub, emitted_sub, emitted_pub; const gchar *existing_req, *emitted_req; g_assert (existing != NULL); tp_value_array_unpack (existing, 3, &existing_sub, &existing_pub, &existing_req); tp_value_array_unpack (emitted, 3, &emitted_sub, &emitted_pub, &emitted_req); g_assert_cmpuint (existing_sub, ==, emitted_sub); g_assert_cmpuint (existing_pub, ==, emitted_pub); g_assert_cmpstr (existing_req, ==, emitted_req); } removal_set = tp_intset_from_array (removals); if (!tp_intset_is_equal (removal_set, le->contacts_removed)) g_error ("Removals from ContactsChangedById (%s) != " "Removals from ContactsChanged (%s)", tp_intset_dump (le->contacts_removed), tp_intset_dump (removal_set)); tp_intset_destroy (removal_set); } static void groups_changed_cb (TpConnection *connection, const GArray *contacts, const gchar **groups_added, const gchar **groups_removed, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); g_assert (contacts->len > 0); g_assert ((groups_added != NULL && groups_added[0] != NULL) || (groups_removed != NULL && groups_removed[0] != NULL)); le->type = GROUPS_CHANGED; le->contacts = g_array_sized_new (FALSE, FALSE, sizeof (guint), contacts->len); g_array_append_vals (le->contacts, contacts->data, contacts->len); le->groups_added = g_strdupv ((GStrv) groups_added); le->groups_removed = g_strdupv ((GStrv) groups_removed); g_ptr_array_add (test->log, le); } static void groups_created_cb (TpConnection *connection, const gchar **groups_added, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); g_assert (groups_added != NULL); g_assert (groups_added[0] != NULL); le->type = GROUPS_CREATED; le->groups_added = g_strdupv ((GStrv) groups_added); g_ptr_array_add (test->log, le); } static void groups_removed_cb (TpConnection *connection, const gchar **groups_removed, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); g_assert (groups_removed != NULL); g_assert (groups_removed[0] != NULL); le->type = GROUPS_REMOVED; le->groups_removed = g_strdupv ((GStrv) groups_removed); g_ptr_array_add (test->log, le); } static void group_renamed_cb (TpConnection *connection, const gchar *old_name, const gchar *new_name, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); le->type = GROUP_RENAMED; le->groups_added = g_new0 (gchar *, 2); le->groups_added[0] = g_strdup (new_name); le->groups_removed = g_new0 (gchar *, 2); le->groups_removed[0] = g_strdup (old_name); g_ptr_array_add (test->log, le); } static void blocked_contacts_changed_cb (TpConnection *connection, GHashTable *blocked_contacts, GHashTable *unblocked_contacts, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; LogEntry *le = g_slice_new0 (LogEntry); le->type = BLOCKED_CONTACTS_CHANGED; le->blocked_contacts = g_hash_table_ref (blocked_contacts); le->unblocked_contacts = g_hash_table_ref (unblocked_contacts); g_ptr_array_add (test->log, le); } static void maybe_queue_disconnect (TpProxySignalConnection *sc) { if (sc != NULL) g_test_queue_destroy ( (GDestroyNotify) tp_proxy_signal_connection_disconnect, sc); } static void setup_pre_connect ( Test *test, gconstpointer data) { GError *error = NULL; const gchar *account; tp_debug_set_flags ("all"); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->main_loop = g_main_loop_new (NULL, FALSE); /* Some tests want 'account' to be an invalid identifier, so that Connect() * will fail (and the status will change to Disconnected). */ if (!tp_strdiff (data, "break-account-parameter")) account = ""; else account = "me@example.com"; test->service_conn = tp_tests_object_new_static_class ( EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, "account", account, "simulation-delay", 0, "protocol", "example-contact-list", NULL); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (test->service_conn != NULL); g_assert (test->service_conn_as_base != NULL); g_assert (tp_base_connection_register (test->service_conn_as_base, "example", &test->conn_name, &test->conn_path, &error)); g_assert_no_error (error); test->contact_repo = tp_base_connection_get_handles ( test->service_conn_as_base, TP_HANDLE_TYPE_CONTACT); test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); /* Prepare the connection far enough to know its own interfaces. */ tp_tests_proxy_run_until_prepared (test->conn, NULL); } static void test_connect_and_finish_setup (Test *test) { GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (test->conn, features); g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); test->log = g_ptr_array_new (); maybe_queue_disconnect ( tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id ( test->conn, contacts_changed_with_id_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_list_connect_to_contacts_changed ( test->conn, contacts_changed_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_groups_connect_to_groups_changed ( test->conn, groups_changed_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_groups_connect_to_groups_created ( test->conn, groups_created_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_groups_connect_to_groups_removed ( test->conn, groups_removed_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_groups_connect_to_group_renamed ( test->conn, group_renamed_cb, test, NULL, NULL, NULL)); maybe_queue_disconnect ( tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed ( test->conn, blocked_contacts_changed_cb, test, NULL, NULL, NULL)); test->sjoerd = tp_handle_ensure (test->contact_repo, "sjoerd@example.com", NULL, NULL); g_assert (test->sjoerd != 0); test->helen = tp_handle_ensure (test->contact_repo, "helen@example.com", NULL, NULL); g_assert (test->helen != 0); test->wim = tp_handle_ensure (test->contact_repo, "wim@example.com", NULL, NULL); g_assert (test->wim != 0); test->bill = tp_handle_ensure (test->contact_repo, "bill@example.com", NULL, NULL); g_assert (test->bill != 0); test->ninja = tp_handle_ensure (test->contact_repo, "ninja@example.com", NULL, NULL); g_assert (test->ninja != 0); test->canceller = tp_handle_ensure (test->contact_repo, "canceller@cancel.example.com", NULL, NULL); g_assert (test->canceller != 0); test->arr = g_array_new (FALSE, FALSE, sizeof (TpHandle)); } static void setup (Test *test, gconstpointer data) { setup_pre_connect (test, data); test_connect_and_finish_setup (test); } static void test_clear_log (Test *test) { g_ptr_array_foreach (test->log, (GFunc) log_entry_free, NULL); g_ptr_array_set_size (test->log, 0); } static void teardown_pre_connect ( Test *test, gconstpointer data) { test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); tp_clear_object (&test->conn); tp_clear_object (&test->dbus); tp_clear_pointer (&test->main_loop, g_main_loop_unref); g_clear_error (&test->error); } static void teardown (Test *test, gconstpointer data) { TpConnection *conn; GError *error = NULL; g_array_unref (test->arr); test_clear_log (test); g_ptr_array_unref (test->log); tp_handle_unref (test->contact_repo, test->sjoerd); tp_handle_unref (test->contact_repo, test->helen); tp_handle_unref (test->contact_repo, test->wim); tp_handle_unref (test->contact_repo, test->bill); tp_handle_unref (test->contact_repo, test->ninja); tp_handle_unref (test->contact_repo, test->canceller); tp_clear_object (&test->publish); tp_clear_object (&test->subscribe); tp_clear_object (&test->stored); tp_clear_object (&test->group); /* make a new TpConnection just to disconnect the underlying Connection, * so we don't leak it */ conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_assert (!tp_connection_run_until_ready (conn, FALSE, &error, NULL)); g_assert_error (error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&error); tp_clear_pointer (&test->contact_attributes, g_hash_table_unref); teardown_pre_connect (test, data); } static TpChannel * test_ensure_channel (Test *test, guint channel_type, const gchar *id) { GError *error = NULL; GHashTable *asv, *props; gchar *path; TpChannel *ret; asv = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, channel_type, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, id, NULL); tp_cli_connection_interface_requests_run_ensure_channel (test->conn, -1, asv, NULL, &path, &props, &error, NULL); g_assert_no_error (error); ret = tp_channel_new_from_properties (test->conn, path, props, &error); g_assert (ret != NULL); g_assert_no_error (error); g_free (path); g_hash_table_unref (props); g_hash_table_unref (asv); tp_tests_proxy_run_until_prepared (ret, NULL); return ret; } static void test_assert_one_contact_changed (Test *test, guint index, TpHandle handle, TpSubscriptionState expected_sub_state, TpSubscriptionState expected_pub_state, const gchar *expected_pub_request) { LogEntry *le; GValueArray *va; guint sub_state; guint pub_state; const gchar *pub_request; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, CONTACTS_CHANGED); g_assert_cmpuint (g_hash_table_size (le->contacts_changed), ==, 1); va = g_hash_table_lookup (le->contacts_changed, GUINT_TO_POINTER (handle)); g_assert (va != NULL); tp_value_array_unpack (va, 3, &sub_state, &pub_state, &pub_request); g_assert_cmpuint (sub_state, ==, expected_sub_state); g_assert_cmpuint (pub_state, ==, expected_pub_state); g_assert_cmpstr (pub_request, ==, expected_pub_request); g_assert_cmpuint (tp_intset_size (le->contacts_removed), ==, 0); } static void test_assert_one_contact_removed (Test *test, guint index, TpHandle handle) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, CONTACTS_CHANGED); g_assert_cmpuint (g_hash_table_size (le->contacts_changed), ==, 0); g_assert_cmpuint (tp_intset_size (le->contacts_removed), ==, 1); g_assert (tp_intset_is_member (le->contacts_removed, handle)); } static void test_assert_one_group_joined (Test *test, guint index, TpHandle handle, const gchar *group) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 1); g_assert_cmpuint (g_array_index (le->contacts, guint, 0), ==, handle); g_assert (le->groups_added != NULL); g_assert_cmpstr (le->groups_added[0], ==, group); g_assert_cmpstr (le->groups_added[1], ==, NULL); g_assert (le->groups_removed == NULL || le->groups_removed[0] == NULL); } static void test_assert_one_group_left (Test *test, guint index, TpHandle handle, const gchar *group) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 1); g_assert_cmpuint (g_array_index (le->contacts, guint, 0), ==, handle); g_assert (le->groups_added == NULL || le->groups_added[0] == NULL); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, group); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } static void test_assert_one_group_created (Test *test, guint index, const gchar *group) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, GROUPS_CREATED); g_assert (le->groups_added != NULL); g_assert_cmpstr (le->groups_added[0], ==, group); g_assert_cmpstr (le->groups_added[1], ==, NULL); } static void test_assert_one_group_removed (Test *test, guint index, const gchar *group) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, GROUPS_REMOVED); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, group); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } static void test_assert_one_contact_blocked (Test *test, guint index, TpHandle handle, const gchar *id) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, BLOCKED_CONTACTS_CHANGED); g_assert (le->blocked_contacts != NULL); g_assert_cmpuint (g_hash_table_size (le->blocked_contacts), ==, 1); g_assert_cmpstr (g_hash_table_lookup (le->blocked_contacts, GUINT_TO_POINTER (handle)), ==, id); g_assert (le->unblocked_contacts != NULL); g_assert_cmpuint (g_hash_table_size (le->unblocked_contacts), ==, 0); } static void test_assert_one_contact_unblocked (Test *test, guint index, TpHandle handle, const gchar *id) { LogEntry *le; le = g_ptr_array_index (test->log, index); g_assert_cmpint (le->type, ==, BLOCKED_CONTACTS_CHANGED); g_assert (le->blocked_contacts != NULL); g_assert_cmpuint (g_hash_table_size (le->blocked_contacts), ==, 0); g_assert (le->unblocked_contacts != NULL); g_assert_cmpuint (g_hash_table_size (le->unblocked_contacts), ==, 1); g_assert_cmpstr (g_hash_table_lookup (le->unblocked_contacts, GUINT_TO_POINTER (handle)), ==, id); } static void test_nothing (Test *test, gconstpointer nil G_GNUC_UNUSED) { /* this is actually a valuable test - it ensures that shutting down the * CM before the contact list has been retrieved works! */ } static void expect_cambridge_once_cb (TpConnection *conn, const GPtrArray *channels, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { Test *test = user_data; GValueArray *va; const gchar *object_path; GHashTable *properties; g_assert_cmpuint (channels->len, ==, 1); va = g_ptr_array_index (channels, 0); object_path = g_value_get_boxed (va->values + 0); properties = g_value_get_boxed (va->values + 1); if (tp_asv_get_uint32 (properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) != TP_HANDLE_TYPE_GROUP || tp_strdiff (tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_CONTACT_LIST) || tp_strdiff (tp_asv_get_string (properties, TP_PROP_CHANNEL_TARGET_ID), "Cambridge")) { /* either this is not a ContactList, or it's a LIST ContactList, * or it's one of the other groups - Montreal or Francophones. * Either way, it's not interesting right now. */ DEBUG ("NewChannels not for Cambridge group, ignoring"); return; } DEBUG ("NewChannels for Cambridge group"); /* the Cambridge group should only be created once (fd.o #52011) */ g_assert (test->group == NULL); test->group = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (conn), conn, object_path, properties, &test->error); g_assert_no_error (test->error); } static void test_initial_channels (Test *test, gconstpointer nil G_GNUC_UNUSED) { TpProxySignalConnection *new_channels_sig; /* legacy interface for the Group channels */ new_channels_sig = tp_cli_connection_interface_requests_connect_to_new_channels ( test->conn, expect_cambridge_once_cb, test, NULL, NULL, &test->error); g_assert_no_error (test->error); test_connect_and_finish_setup (test); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); test->deny = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "deny"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->publish)), ==, 4); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->publish)), ==, 2); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_remote_pending (test->publish)), ==, 0); g_assert (tp_intset_is_member (tp_channel_group_get_members (test->publish), test->sjoerd)); g_assert (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->wim)); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->subscribe)), ==, 0); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_remote_pending (test->subscribe)), ==, 2); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->sjoerd)); g_assert (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->helen)); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->stored)), ==, 8); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->stored)), ==, 0); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_remote_pending (test->stored)), ==, 0); g_assert (tp_intset_is_member (tp_channel_group_get_members (test->stored), test->sjoerd)); g_assert (!tp_intset_is_member (tp_channel_group_get_members (test->publish), test->ninja)); g_assert (!tp_intset_is_member (tp_channel_group_get_members ( test->subscribe), test->ninja)); g_assert (!tp_intset_is_member (tp_channel_group_get_members (test->stored), test->ninja)); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->deny)), ==, 2); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->deny)), ==, 0); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_remote_pending (test->deny)), ==, 0); g_assert (tp_intset_is_member (tp_channel_group_get_members (test->deny), test->bill)); /* the Cambridge group was announced (fd.o #52011) */ tp_tests_proxy_run_until_dbus_queue_processed (test->conn); tp_proxy_signal_connection_disconnect (new_channels_sig); g_assert (TP_IS_CHANNEL (test->group)); } static void test_properties (Test *test, gconstpointer nil G_GNUC_UNUSED) { GHashTable *asv; GError *error = NULL; guint32 blocking_caps; gboolean valid; tp_cli_dbus_properties_run_get_all (test->conn, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, &asv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (asv), >=, 3); g_assert (tp_asv_get_boolean (asv, "ContactListPersists", NULL)); g_assert (tp_asv_get_boolean (asv, "CanChangeContactList", NULL)); g_assert (tp_asv_get_boolean (asv, "RequestUsesMessage", NULL)); g_hash_table_unref (asv); tp_cli_dbus_properties_run_get_all (test->conn, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, &asv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (asv), >=, 3); g_assert (G_VALUE_HOLDS_BOOLEAN (tp_asv_lookup (asv, "DisjointGroups"))); g_assert (!tp_asv_get_boolean (asv, "DisjointGroups", NULL)); g_assert (G_VALUE_HOLDS_UINT (tp_asv_lookup (asv, "GroupStorage"))); g_assert_cmpuint (tp_asv_get_uint32 (asv, "GroupStorage", NULL), ==, TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE); /* Don't assert about the contents yet - we might not have received the * contact list yet */ g_assert (G_VALUE_HOLDS (tp_asv_lookup (asv, "Groups"), G_TYPE_STRV)); g_hash_table_unref (asv); /* this has the side-effect of waiting for the contact list to be received */ test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); tp_cli_dbus_properties_run_get_all (test->conn, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, &asv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (asv), >=, 3); g_assert (tp_asv_get_boolean (asv, "ContactListPersists", NULL)); g_assert (tp_asv_get_boolean (asv, "CanChangeContactList", NULL)); g_assert (tp_asv_get_boolean (asv, "RequestUsesMessage", NULL)); g_hash_table_unref (asv); tp_cli_dbus_properties_run_get_all (test->conn, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, &asv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (asv), >=, 3); g_assert (G_VALUE_HOLDS_BOOLEAN (tp_asv_lookup (asv, "DisjointGroups"))); g_assert (G_VALUE_HOLDS_UINT (tp_asv_lookup (asv, "GroupStorage"))); g_assert (tp_asv_get_strv (asv, "Groups") != NULL); g_assert (tp_strv_contains (tp_asv_get_strv (asv, "Groups"), "Cambridge")); g_assert (tp_strv_contains (tp_asv_get_strv (asv, "Groups"), "Montreal")); g_assert (tp_strv_contains (tp_asv_get_strv (asv, "Groups"), "Francophones")); g_hash_table_unref (asv); tp_cli_dbus_properties_run_get_all (test->conn, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, &asv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (asv), ==, 1); blocking_caps = tp_asv_get_uint32 (asv, "ContactBlockingCapabilities", &valid); g_assert (valid); g_assert_cmpuint (blocking_caps, ==, TP_CONTACT_BLOCKING_CAPABILITY_CAN_REPORT_ABUSIVE); g_hash_table_unref (asv); g_assert_cmpuint (test->log->len, ==, 0); } static void contact_attrs_cb (TpConnection *conn G_GNUC_UNUSED, GHashTable *attributes, const GError *error, gpointer user_data, GObject *object G_GNUC_UNUSED) { Test *test = user_data; g_assert_no_error ((GError *) error); tp_clear_pointer (&test->contact_attributes, g_hash_table_unref); test->contact_attributes = g_boxed_copy (TP_HASH_TYPE_CONTACT_ATTRIBUTES_MAP, attributes); } static void test_assert_contact_list_attrs (Test *test, TpHandle handle, TpSubscriptionState expected_sub_state, TpSubscriptionState expected_pub_state, const gchar *expected_pub_request) { GHashTable *asv; gboolean valid; g_assert_cmpuint (g_hash_table_size (test->contact_attributes), >=, 1); asv = g_hash_table_lookup (test->contact_attributes, GUINT_TO_POINTER (handle)); g_assert (asv != NULL); g_assert_cmpuint (tp_asv_get_uint32 (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE, &valid), ==, expected_sub_state); g_assert (valid); g_assert_cmpuint (tp_asv_get_uint32 (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH, &valid), ==, expected_pub_state); g_assert (valid); g_assert_cmpstr (tp_asv_get_string (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST), ==, expected_pub_request); g_assert (valid); } /* We simplify here by assuming that contacts are in at most one group, * which happens to be true for all of these tests. */ static void test_assert_contact_groups_attr (Test *test, TpHandle handle, const gchar *group) { GHashTable *asv; const gchar * const *strv; g_assert_cmpuint (g_hash_table_size (test->contact_attributes), >=, 1); asv = g_hash_table_lookup (test->contact_attributes, GUINT_TO_POINTER (handle)); g_assert (asv != NULL); tp_asv_dump (asv); g_assert (tp_asv_lookup (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS) != NULL); g_assert (G_VALUE_HOLDS (tp_asv_lookup (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS), G_TYPE_STRV)); strv = tp_asv_get_strv (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS); if (group == NULL) { if (strv != NULL) g_assert_cmpstr (strv[0], ==, NULL); } else { g_assert (strv != NULL); g_assert_cmpstr (strv[0], ==, group); g_assert_cmpstr (strv[1], ==, NULL); } } static void test_assert_contact_state (Test *test, TpHandle handle, TpSubscriptionState expected_sub_state, TpSubscriptionState expected_pub_state, const gchar *expected_pub_request, const gchar *expected_group) { const gchar * const interfaces[] = { TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, NULL }; tp_connection_get_contact_attributes (test->conn, -1, 1, &handle, interfaces, FALSE, contact_attrs_cb, test, test_quit_loop, NULL); g_main_loop_run (test->main_loop); g_assert_cmpuint (g_hash_table_size (test->contact_attributes), ==, 1); test_assert_contact_list_attrs (test, handle, expected_sub_state, expected_pub_state, expected_pub_request); test_assert_contact_groups_attr (test, handle, expected_group); } static void test_contacts (Test *test, gconstpointer nil G_GNUC_UNUSED) { /* ensure the contact list has been received */ test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, "Cambridge"); test_assert_contact_state (test, test->wim, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_ASK, "I'm more metal than you!", NULL); test_assert_contact_state (test, test->helen, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, NULL, "Cambridge"); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); test_assert_contact_state (test, test->bill, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_contact_list_attrs (Test *test, gconstpointer nil G_GNUC_UNUSED) { const gchar * const interfaces[] = { TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, NULL }; tp_connection_get_contact_list_attributes (test->conn, -1, interfaces, FALSE, contact_attrs_cb, test, test_quit_loop, NULL); g_main_loop_run (test->main_loop); test_assert_contact_list_attrs (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL); test_assert_contact_list_attrs (test, test->wim, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_ASK, "I'm more metal than you!"); test_assert_contact_list_attrs (test, test->helen, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, NULL); test_assert_contact_groups_attr (test, test->sjoerd, "Cambridge"); test_assert_contact_groups_attr (test, test->wim, NULL); test_assert_contact_groups_attr (test, test->helen, "Cambridge"); /* bill is blocked, but is not on the contact list as such; the ninja isn't * in the initial state at all */ g_assert (g_hash_table_lookup (test->contact_attributes, GUINT_TO_POINTER (test->bill)) == NULL); g_assert (g_hash_table_lookup (test->contact_attributes, GUINT_TO_POINTER (test->ninja)) == NULL); } static void test_assert_contact_blocking_attrs (Test *test, TpHandle handle, gboolean expected_blocked) { GHashTable *asv; gboolean blocked, valid; g_assert_cmpuint (g_hash_table_size (test->contact_attributes), >=, 1); asv = g_hash_table_lookup (test->contact_attributes, GUINT_TO_POINTER (handle)); g_assert (asv != NULL); tp_asv_dump (asv); blocked = tp_asv_get_boolean (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED, &valid); g_assert (valid); g_assert (blocked == expected_blocked); } static void test_contact_blocking_attrs (Test *test, gconstpointer nil G_GNUC_UNUSED) { const gchar * const interfaces[] = { TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, NULL }; TpHandle handles[] = { test->sjoerd, test->bill }; tp_connection_get_contact_attributes (test->conn, -1, G_N_ELEMENTS (handles), handles, interfaces, FALSE, contact_attrs_cb, test, test_quit_loop, NULL); g_main_loop_run (test->main_loop); test_assert_contact_blocking_attrs (test, test->sjoerd, FALSE); test_assert_contact_blocking_attrs (test, test->bill, TRUE); } static void test_accept_publish_request (Test *test, gconstpointer mode) { GError *error = NULL; test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->publish)), ==, 2); g_assert (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->wim)); g_array_append_val (test->arr, test->wim); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->publish, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_authorize_publication ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->publish)), ==, 1); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->wim)); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->wim)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_changed (test, 0, test->wim, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_YES, ""); test_assert_contact_state (test, test->wim, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_YES, NULL, NULL); } static void test_reject_publish_request (Test *test, gconstpointer mode) { GError *error = NULL; test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); g_assert (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->wim)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->wim)); g_array_append_val (test->arr, test->wim); if (!tp_strdiff (mode, "old")) { tp_cli_channel_interface_group_run_remove_members (test->publish, -1, test->arr, "", &error, NULL); } else if (!tp_strdiff (mode, "unpublish")) { /* directly equivalent, but in practice people won't do this */ tp_cli_connection_interface_contact_list_run_unpublish ( test->conn, -1, test->arr, &error, NULL); } else { /* this isn't directly equivalent, but in practice it's what people * will do */ tp_cli_connection_interface_contact_list_run_remove_contacts ( test->conn, -1, test->arr, &error, NULL); } g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_local_pending (test->publish)), ==, 1); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->wim)); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->wim)); g_assert_cmpuint (test->log->len, ==, 1); /* because Wim wasn't really on our contact list, he's removed as a * side-effect, even if we only unpublished */ test_assert_one_contact_removed (test, 0, test->wim); test_assert_contact_state (test, test->wim, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_add_to_publish_pre_approve (Test *test, gconstpointer mode) { GError *error = NULL; /* Unilaterally adding a member to the publish channel doesn't work, but * in the new contact list manager the method "succeeds" anyway, and * any subsequent subscription request succeeds instantly. */ test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_array_append_val (test->arr, test->ninja); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->ninja)); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->publish, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_authorize_publication ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->ninja)); /* the example CM's fake contacts accept requests that contain "please" */ if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->subscribe, -1, test->arr, "Please may I see your presence?", &error, NULL); else tp_cli_connection_interface_contact_list_run_request_subscription ( test->conn, -1, test->arr, "Please may I see your presence?", &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->stored), test->ninja)); /* after a short delay, the contact accepts our request */ while (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)) g_main_context_iteration (NULL, TRUE); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); /* the contact also requests our presence after a short delay - we * pre-approved, so they go straight to full membership */ while (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja) || test->log->len < 3) g_main_context_iteration (NULL, TRUE); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->ninja)); g_assert_cmpuint (test->log->len, ==, 3); test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 1, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 2, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, ""); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, NULL); } static void test_add_to_publish_no_op (Test *test, gconstpointer mode) { GError *error = NULL; /* Adding a member to the publish channel when they're already there is * valid. */ test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->publish, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_authorize_publication ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, "Cambridge"); } static void test_remove_from_publish (Test *test, gconstpointer mode) { GError *error = NULL; test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->publish)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->publish, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_unpublish ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); /* the contact re-requests our presence after a short delay */ while (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->sjoerd) || test->log->len < 2) g_main_context_iteration (NULL, TRUE); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); g_assert (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 2); test_assert_one_contact_changed (test, 0, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 1, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_ASK, "May I see your presence, please?"); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_ASK, "May I see your presence, please?", "Cambridge"); } static void test_remove_from_publish_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->publish)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->publish, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_unpublish ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_cancelled_publish_request (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->canceller)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->canceller)); /* the example CM's fake contacts accept requests that contain "please" */ g_array_append_val (test->arr, test->canceller); tp_cli_connection_interface_contact_list_run_request_subscription ( test->conn, -1, test->arr, "Please may I see your presence?", &error, NULL); /* It starts off the same as test_accept_subscribe_request, but because * we're using an identifier with special significance, the contact cancels * the request immediately after */ while (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->canceller) || test->log->len < 4) g_main_context_iteration (NULL, TRUE); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->canceller)); g_assert (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->canceller)); g_assert_cmpuint (test->log->len, ==, 4); test_assert_one_contact_changed (test, 0, test->canceller, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 1, test->canceller, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 2, test->canceller, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_ASK, "May I see your presence, please?"); test_assert_one_contact_changed (test, 3, test->canceller, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY, ""); test_assert_contact_state (test, test->canceller, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY, NULL, NULL); test_clear_log (test); /* We can acknowledge the cancellation with Unpublish() or * RemoveContacts(). We can't use the old API here, because in the old API, * the contact has already vanished from the Group */ if (!tp_strdiff (mode, "remove-after")) tp_cli_connection_interface_contact_list_run_remove_contacts (test->conn, -1, test->arr, &error, NULL); else tp_cli_connection_interface_contact_list_run_unpublish ( test->conn, -1, test->arr, &error, NULL); while (test->log->len < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (test->log->len, ==, 1); if (!tp_strdiff (mode, "remove-after")) test_assert_one_contact_removed (test, 0, test->canceller); else test_assert_one_contact_changed (test, 0, test->canceller, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_NO, ""); } static void test_add_to_stored (Test *test, gconstpointer mode) { GError *error = NULL; test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->stored)), ==, 8); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) { tp_cli_channel_interface_group_run_add_members (test->stored, -1, test->arr, "", &error, NULL); } else { /* there's no specific API for adding contacts to stored (it's not a * very useful action in general), but setting an alias has it as a * side-effect */ GHashTable *table = g_hash_table_new (NULL, NULL); g_hash_table_insert (table, GUINT_TO_POINTER (test->ninja), "The Wee Ninja"); tp_cli_connection_interface_aliasing_run_set_aliases (test->conn, -1, table, &error, NULL); g_hash_table_unref (table); } g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->stored)), ==, 9); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_add_to_stored_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->stored)), ==, 8); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) { tp_cli_channel_interface_group_run_add_members (test->stored, -1, test->arr, "", &error, NULL); } else { /* there's no specific API for adding contacts to stored (it's not a * very useful action in general), but setting an alias has it as a * side-effect */ GHashTable *table = g_hash_table_new (NULL, NULL); g_hash_table_insert (table, GUINT_TO_POINTER (test->sjoerd), "Sjoerd"); tp_cli_connection_interface_aliasing_run_set_aliases (test->conn, -1, table, &error, NULL); g_hash_table_unref (table); } g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, "Cambridge"); } static void test_remove_from_stored (Test *test, gconstpointer mode) { GError *error = NULL; test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->stored, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_remove_contacts (test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->sjoerd)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->sjoerd)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_removed (test, 0, test->sjoerd); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_remove_from_stored_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->stored)), ==, 8); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->stored, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_remove_contacts (test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_accept_subscribe_request (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); /* the example CM's fake contacts accept requests that contain "please" */ g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->subscribe, -1, test->arr, "Please may I see your presence?", &error, NULL); else tp_cli_connection_interface_contact_list_run_request_subscription ( test->conn, -1, test->arr, "Please may I see your presence?", &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->stored), test->ninja)); /* after a short delay, the contact accepts our request */ while (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)) g_main_context_iteration (NULL, TRUE); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); /* the contact also requests our presence after a short delay */ while (!tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->ninja) || test->log->len < 3) g_main_context_iteration (NULL, TRUE); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja)); g_assert (tp_intset_is_member ( tp_channel_group_get_local_pending (test->publish), test->ninja)); g_assert_cmpuint (test->log->len, ==, 3); test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 1, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 2, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_ASK, "May I see your presence, please?"); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_ASK, "May I see your presence, please?", NULL); } static void test_reject_subscribe_request (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); /* the example CM's fake contacts reject requests that don't contain * "please" */ g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->subscribe, -1, test->arr, "I demand to see your presence?", &error, NULL); else tp_cli_connection_interface_contact_list_run_request_subscription ( test->conn, -1, test->arr, "I demand to see your presence?", &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->stored), test->ninja)); /* after a short delay, the contact rejects our request. Say please! */ while (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja) || test->log->len < 2) g_main_context_iteration (NULL, TRUE); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->ninja)); /* the ninja is still on the stored list */ g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->stored), test->ninja)); g_assert_cmpuint (test->log->len, ==, 2); test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_ASK, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_one_contact_changed (test, 1, test->ninja, TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); test_clear_log (test); /* We can acknowledge the failure to subscribe with Unsubscribe() or * RemoveContacts(). We can't use the old API here, because in the old API, * the contact has already vanished from the Group */ if (!tp_strdiff (mode, "remove-after")) tp_cli_connection_interface_contact_list_run_remove_contacts (test->conn, -1, test->arr, &error, NULL); else tp_cli_connection_interface_contact_list_run_unsubscribe ( test->conn, -1, test->arr, &error, NULL); /* the ninja falls off our subscribe list */ while (test->log->len < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (test->log->len, ==, 1); if (!tp_strdiff (mode, "remove-after")) test_assert_one_contact_removed (test, 0, test->ninja); else test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, ""); } static void test_remove_from_subscribe (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->subscribe, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_unsubscribe ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->sjoerd)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_changed (test, 0, test->sjoerd, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_YES, ""); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_YES, NULL, "Cambridge"); } static void test_remove_from_subscribe_pending (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_remote_pending (test->subscribe)), ==, 2); g_assert (tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->helen)); g_array_append_val (test->arr, test->helen); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->subscribe, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_unsubscribe ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->helen)); g_assert (!tp_intset_is_member ( tp_channel_group_get_remote_pending (test->subscribe), test->helen)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->helen)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_changed (test, 0, test->helen, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, ""); test_assert_contact_state (test, test->helen, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, "Cambridge"); } static void test_remove_from_subscribe_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->subscribe)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->subscribe, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_list_run_unsubscribe ( test->conn, -1, test->arr, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_add_to_group (Test *test, gconstpointer mode) { GError *error = NULL; LogEntry *le; guint i; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->group, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_groups_run_add_to_group (test->conn, -1, "Cambridge", test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 5); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->ninja)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->subscribe), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->publish), test->ninja)); g_assert_cmpuint (test->log->len, ==, 2); le = g_ptr_array_index (test->log, 0); if (le->type == CONTACTS_CHANGED) { test_assert_one_contact_changed (test, 0, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, ""); i = 1; } else { test_assert_one_contact_changed (test, 1, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, ""); i = 0; } /* either way, the i'th entry is now the GroupsChanged signal */ test_assert_one_group_joined (test, i, test->ninja, "Cambridge"); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, "Cambridge"); } static void test_add_to_group_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_add_members (test->group, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_groups_run_add_to_group (test->conn, -1, "Cambridge", test->arr, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, "Cambridge"); } static void test_remove_from_group (Test *test, gconstpointer mode) { GError *error = NULL; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->group, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_groups_run_remove_from_group ( test->conn, -1, "Cambridge", test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_group_left (test, 0, test->sjoerd, "Cambridge"); test_assert_contact_state (test, test->sjoerd, TP_SUBSCRIPTION_STATE_YES, TP_SUBSCRIPTION_STATE_YES, NULL, NULL); } static void test_remove_from_group_no_op (Test *test, gconstpointer mode) { GError *error = NULL; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->ninja)); g_array_append_val (test->arr, test->ninja); if (!tp_strdiff (mode, "old")) tp_cli_channel_interface_group_run_remove_members (test->group, -1, test->arr, "", &error, NULL); else tp_cli_connection_interface_contact_groups_run_remove_from_group ( test->conn, -1, "Cambridge", test->arr, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 0); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); } static void test_remove_group (Test *test, gconstpointer mode) { GError *error = NULL; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert (!tp_intset_is_empty ( tp_channel_group_get_members (test->group))); if (!tp_strdiff (mode, "old")) { /* The old API can't remove non-empty groups... */ tp_cli_channel_run_close (test->group, -1, &error, NULL); g_assert_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); g_assert_cmpuint (test->log->len, ==, 0); } else { /* ... but the new API can */ LogEntry *le; tp_cli_connection_interface_contact_groups_run_remove_group (test->conn, -1, "Cambridge", &error, NULL); g_assert_no_error (error); g_assert (tp_proxy_get_invalidated (test->group) != NULL); g_assert_cmpuint (test->log->len, ==, 2); test_assert_one_group_removed (test, 0, "Cambridge"); le = g_ptr_array_index (test->log, 1); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 4); g_assert (le->groups_added == NULL || le->groups_added[0] == NULL); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, "Cambridge"); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } } static void test_remove_group_empty (Test *test, gconstpointer mode) { GError *error = NULL; g_assert_cmpuint (test->log->len, ==, 0); test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "people who understand const in C"); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_group_created (test, 0, "people who understand const in C"); g_assert (tp_intset_is_empty ( tp_channel_group_get_members (test->group))); tp_cli_channel_run_close (test->group, -1, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (test->log->len, ==, 2); test_assert_one_group_removed (test, 1, "people who understand const in C"); } static void test_set_contact_groups (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; LogEntry *le; const gchar *montreal_strv[] = { "Montreal", NULL }; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); g_array_append_val (test->arr, test->wim); tp_cli_connection_interface_contact_groups_run_set_contact_groups ( test->conn, -1, test->sjoerd, montreal_strv, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 3); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 1); le = g_ptr_array_index (test->log, 0); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 1); g_assert_cmpuint (g_array_index (le->contacts, guint, 0), ==, test->sjoerd); g_assert (le->groups_added != NULL); g_assert_cmpstr (le->groups_added[0], ==, "Montreal"); g_assert_cmpstr (le->groups_added[1], ==, NULL); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, "Cambridge"); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } static void test_set_contact_groups_no_op (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; const gchar *cambridge_strv[] = { "Cambridge", NULL }; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_array_append_val (test->arr, test->sjoerd); g_array_append_val (test->arr, test->wim); tp_cli_connection_interface_contact_groups_run_set_contact_groups ( test->conn, -1, test->sjoerd, cambridge_strv, &error, NULL); g_assert_no_error (error); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_assert_cmpuint (test->log->len, ==, 0); } static void test_set_group_members (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; LogEntry *le; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->helen)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->wim)); g_array_append_val (test->arr, test->sjoerd); g_array_append_val (test->arr, test->wim); tp_cli_connection_interface_contact_groups_run_set_group_members (test->conn, -1, "Cambridge", test->arr, &error, NULL); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, too */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 2); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->wim)); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->group), test->sjoerd)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->group), test->helen)); g_assert_cmpuint (test->log->len, ==, 2); /* Wim was added */ test_assert_one_group_joined (test, 0, test->wim, "Cambridge"); /* The three other members, other than Sjoerd, left */ le = g_ptr_array_index (test->log, 1); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 3); g_assert (le->groups_added == NULL || le->groups_added[0] == NULL); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, "Cambridge"); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } static void test_rename_group (Test *test, gconstpointer nil G_GNUC_UNUSED) { LogEntry *le; GError *error = NULL; test->group = test_ensure_channel (test, TP_HANDLE_TYPE_GROUP, "Cambridge"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->group)), ==, 4); tp_cli_connection_interface_contact_groups_run_rename_group (test->conn, -1, "Cambridge", "Grantabrugge", &error, NULL); g_assert_no_error (error); g_assert (tp_proxy_get_invalidated (test->group) != NULL); g_assert_cmpuint (test->log->len, ==, 4); le = g_ptr_array_index (test->log, 0); g_assert_cmpint (le->type, ==, GROUP_RENAMED); g_assert (le->groups_added != NULL); g_assert_cmpstr (le->groups_added[0], ==, "Grantabrugge"); g_assert_cmpstr (le->groups_added[1], ==, NULL); g_assert (le->groups_removed != NULL); g_assert_cmpstr (le->groups_removed[0], ==, "Cambridge"); g_assert_cmpstr (le->groups_removed[1], ==, NULL); test_assert_one_group_created (test, 1, "Grantabrugge"); test_assert_one_group_removed (test, 2, "Cambridge"); le = g_ptr_array_index (test->log, 3); g_assert_cmpint (le->type, ==, GROUPS_CHANGED); g_assert_cmpuint (le->contacts->len, ==, 4); g_assert (le->groups_added != NULL); g_assert_cmpstr (le->groups_added[0], ==, "Grantabrugge"); g_assert_cmpstr (le->groups_added[1], ==, NULL); g_assert_cmpstr (le->groups_removed[0], ==, "Cambridge"); g_assert_cmpstr (le->groups_removed[1], ==, NULL); } static void test_rename_group_overwrite (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; tp_cli_connection_interface_contact_groups_run_rename_group (test->conn, -1, "Cambridge", "Montreal", &error, NULL); g_assert_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); g_assert_cmpuint (test->log->len, ==, 0); g_clear_error (&error); } static void test_rename_group_absent (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; tp_cli_connection_interface_contact_groups_run_rename_group (test->conn, -1, "Badgers", "Mushrooms", &error, NULL); g_assert_error (error, TP_ERROR, TP_ERROR_DOES_NOT_EXIST); g_assert_cmpuint (test->log->len, ==, 0); g_clear_error (&error); } /* Signature of a function which does something with test->arr */ typedef void (*ManipulateContactsFunc) ( Test *test, GError **error); static void block_contacts (Test *test, ManipulateContactsFunc func) { GError *error = NULL; test->deny = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "deny"); test->stored = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "stored"); g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->deny)), ==, 2); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->ninja)); g_array_append_val (test->arr, test->ninja); func (test, &error); g_assert_no_error (error); /* by the time the method returns, we should have had the * change-notification, on both the deny channel and the ContactBlocking * connection interface */ g_assert_cmpuint ( tp_intset_size (tp_channel_group_get_members (test->deny)), ==, 3); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->ninja)); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->stored), test->ninja)); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_blocked (test, 0, test->ninja, tp_handle_inspect (test->contact_repo, test->ninja)); } static void block_contacts_no_op (Test *test, ManipulateContactsFunc func) { GError *error = NULL; test->deny = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "deny"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->bill)); g_array_append_val (test->arr, test->bill); func (test, &error); g_assert_no_error (error); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->bill)); test_assert_contact_state (test, test->bill, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); /* We shouldn't emit spurious empty BlockedContactsChanged signals. */ g_assert_cmpuint (test->log->len, ==, 0); } static void unblock_contacts (Test *test, ManipulateContactsFunc func) { GError *error = NULL; test->deny = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "deny"); test->publish = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "publish"); test->subscribe = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "subscribe"); g_assert (tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->bill)); g_array_append_val (test->arr, test->bill); func (test, &error); g_assert_no_error (error); /* by the time the method returns, we should have had the * removal-notification, too */ g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->bill)); test_assert_contact_state (test, test->bill, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); g_assert_cmpuint (test->log->len, ==, 1); test_assert_one_contact_unblocked (test, 0, test->bill, tp_handle_inspect (test->contact_repo, test->bill)); } static void unblock_contacts_no_op (Test *test, ManipulateContactsFunc func) { GError *error = NULL; test->deny = test_ensure_channel (test, TP_HANDLE_TYPE_LIST, "deny"); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->ninja)); g_array_append_val (test->arr, test->ninja); func (test, &error); g_assert_no_error (error); g_assert (!tp_intset_is_member ( tp_channel_group_get_members (test->deny), test->ninja)); test_assert_contact_state (test, test->ninja, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL, NULL); /* We shouldn't emit spurious empty BlockedContactsChanged signals. */ g_assert_cmpuint (test->log->len, ==, 0); } static void add_to_deny (Test *test, GError **error) { tp_cli_channel_interface_group_run_add_members (test->deny, -1, test->arr, "", error, NULL); } static void test_add_to_deny (Test *test, gconstpointer nil G_GNUC_UNUSED) { block_contacts (test, add_to_deny); } static void test_add_to_deny_no_op (Test *test, gconstpointer nil G_GNUC_UNUSED) { block_contacts_no_op (test, add_to_deny); } static void remove_from_deny (Test *test, GError **error) { tp_cli_channel_interface_group_run_remove_members (test->deny, -1, test->arr, "", error, NULL); } static void test_remove_from_deny (Test *test, gconstpointer nil G_GNUC_UNUSED) { unblock_contacts (test, remove_from_deny); } static void test_remove_from_deny_no_op (Test *test, gconstpointer nil G_GNUC_UNUSED) { unblock_contacts_no_op (test, remove_from_deny); } static void test_request_blocked_contacts (Test *test, gconstpointer nil G_GNUC_UNUSED) { GHashTable *blocked_contacts; GError *error = NULL; tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts ( test->conn, -1, &blocked_contacts, &error, NULL); g_assert_no_error (error); g_assert (blocked_contacts != NULL); /* Both Bill and the shadowy Steve are blocked; Steve does not appear in this * test, as he is in poor health. */ g_assert_cmpuint (g_hash_table_size (blocked_contacts), ==, 2); g_assert_cmpstr (tp_handle_inspect (test->contact_repo, test->bill), ==, g_hash_table_lookup (blocked_contacts, GUINT_TO_POINTER (test->bill))); g_hash_table_unref (blocked_contacts); } static void request_blocked_contacts_succeeded_cb ( TpConnection *conn, GHashTable *blocked_contacts, const GError *error, gpointer user_data, GObject *weak_object) { g_assert_no_error (error); /* As above. */ g_assert_cmpuint (g_hash_table_size (blocked_contacts), ==, 2); } static void test_request_blocked_contacts_pre_connect (Test *test, gconstpointer nil G_GNUC_UNUSED) { /* This verifies that calling RequestBlockedContacts() * before Connect(), when Connect() ultimately succeeds, returns correctly. */ tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ( test->conn, -1, request_blocked_contacts_succeeded_cb, test, test_quit_loop, NULL); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); g_main_loop_run (test->main_loop); tp_tests_connection_assert_disconnect_succeeds (test->conn); } static void request_blocked_contacts_failed_cb ( TpConnection *conn, GHashTable *blocked_contacts, const GError *error, gpointer user_data, GObject *weak_object) { g_assert_error (error, TP_ERROR, TP_ERROR_DISCONNECTED); } static void test_request_blocked_contacts_connect_failed (Test *test, gconstpointer nil G_GNUC_UNUSED) { /* This verifies that calling RequestBlockedContacts() (twice, no less) * before Connect(), when Connect() ultimately fails, returns an appropriate * error. */ tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ( test->conn, -1, request_blocked_contacts_failed_cb, test, test_quit_loop, NULL); tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ( test->conn, -1, request_blocked_contacts_failed_cb, test, test_quit_loop, NULL); /* We expect calling Connect() to fail because the handle was invalid, but * don't wait around for it. */ tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); /* Spin the mainloop twice, once for each outstanding call. */ g_main_loop_run (test->main_loop); g_main_loop_run (test->main_loop); } static void call_block_contacts (Test *test, GError **error) { tp_cli_connection_interface_contact_blocking_run_block_contacts (test->conn, -1, test->arr, FALSE, error, NULL); } static void test_block_contacts (Test *test, gconstpointer nil G_GNUC_UNUSED) { block_contacts (test, call_block_contacts); } static void test_block_contacts_no_op (Test *test, gconstpointer nil G_GNUC_UNUSED) { block_contacts_no_op (test, call_block_contacts); } static void call_unblock_contacts (Test *test, GError **error) { tp_cli_connection_interface_contact_blocking_run_unblock_contacts ( test->conn, -1, test->arr, error, NULL); } static void test_unblock_contacts (Test *test, gconstpointer nil G_GNUC_UNUSED) { unblock_contacts (test, call_unblock_contacts); } static void test_unblock_contacts_no_op (Test *test, gconstpointer nil G_GNUC_UNUSED) { unblock_contacts_no_op (test, call_unblock_contacts); } static void download_contacts_cb ( TpConnection *conn, const GError *error, gpointer user_data, GObject *weak_object) { g_assert_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); } static void test_download_contacts (Test *test, gconstpointer nil G_GNUC_UNUSED) { tp_cli_connection_interface_contact_list_call_download ( test->conn, -1, download_contacts_cb, test, test_quit_loop, NULL); g_main_loop_run (test->main_loop); } int main (int argc, char **argv) { tp_tests_abort_after (30); tp_debug_set_flags ("all"); g_test_init (&argc, &argv, NULL); g_test_add ("/contact-lists/nothing", Test, NULL, setup, test_nothing, teardown); g_test_add ("/contact-lists/initial-channels", Test, NULL, setup_pre_connect, test_initial_channels, teardown); g_test_add ("/contact-lists/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/contact-lists/contacts", Test, NULL, setup, test_contacts, teardown); g_test_add ("/contact-lists/contact-list-attrs", Test, NULL, setup, test_contact_list_attrs, teardown); g_test_add ("/contact-lists/contact-blocking-attrs", Test, NULL, setup, test_contact_blocking_attrs, teardown); g_test_add ("/contact-lists/accept-publish-request", Test, NULL, setup, test_accept_publish_request, teardown); g_test_add ("/contact-lists/reject-publish-request", Test, NULL, setup, test_reject_publish_request, teardown); g_test_add ("/contact-lists/reject-publish-request/unpublish", Test, "unpublish", setup, test_reject_publish_request, teardown); g_test_add ("/contact-lists/add-to-publish/pre-approve", Test, NULL, setup, test_add_to_publish_pre_approve, teardown); g_test_add ("/contact-lists/add-to-publish/no-op", Test, NULL, setup, test_add_to_publish_no_op, teardown); g_test_add ("/contact-lists/remove-from-publish", Test, NULL, setup, test_remove_from_publish, teardown); g_test_add ("/contact-lists/remove-from-publish/no-op", Test, NULL, setup, test_remove_from_publish_no_op, teardown); g_test_add ("/contact-lists/accept-publish-request/old", Test, "old", setup, test_accept_publish_request, teardown); g_test_add ("/contact-lists/reject-publish-request/old", Test, "old", setup, test_reject_publish_request, teardown); g_test_add ("/contact-lists/add-to-publish/pre-approve/old", Test, "old", setup, test_add_to_publish_pre_approve, teardown); g_test_add ("/contact-lists/add-to-publish/no-op/old", Test, "old", setup, test_add_to_publish_no_op, teardown); g_test_add ("/contact-lists/remove-from-publish/old", Test, "old", setup, test_remove_from_publish, teardown); g_test_add ("/contact-lists/remove-from-publish/no-op/old", Test, "old", setup, test_remove_from_publish_no_op, teardown); g_test_add ("/contact-lists/cancelled-publish-request", Test, NULL, setup, test_cancelled_publish_request, teardown); g_test_add ("/contact-lists/cancelled-publish-request/remove-after", Test, "remove-after", setup, test_cancelled_publish_request, teardown); g_test_add ("/contact-lists/add-to-stored", Test, NULL, setup, test_add_to_stored, teardown); g_test_add ("/contact-lists/add-to-stored/no-op", Test, NULL, setup, test_add_to_stored_no_op, teardown); g_test_add ("/contact-lists/remove-from-stored", Test, NULL, setup, test_remove_from_stored, teardown); g_test_add ("/contact-lists/remove-from-stored/no-op", Test, NULL, setup, test_remove_from_stored_no_op, teardown); g_test_add ("/contact-lists/add-to-stored/old", Test, "old", setup, test_add_to_stored, teardown); g_test_add ("/contact-lists/add-to-stored/no-op/old", Test, "old", setup, test_add_to_stored_no_op, teardown); g_test_add ("/contact-lists/remove-from-stored/old", Test, "old", setup, test_remove_from_stored, teardown); g_test_add ("/contact-lists/remove-from-stored/no-op/old", Test, "old", setup, test_remove_from_stored_no_op, teardown); g_test_add ("/contact-lists/accept-subscribe-request", Test, NULL, setup, test_accept_subscribe_request, teardown); g_test_add ("/contact-lists/reject-subscribe-request", Test, NULL, setup, test_reject_subscribe_request, teardown); g_test_add ("/contact-lists/remove-from-subscribe", Test, NULL, setup, test_remove_from_subscribe, teardown); g_test_add ("/contact-lists/remove-from-subscribe/pending", Test, NULL, setup, test_remove_from_subscribe_pending, teardown); g_test_add ("/contact-lists/remove-from-subscribe/no-op", Test, NULL, setup, test_remove_from_subscribe_no_op, teardown); g_test_add ("/contact-lists/accept-subscribe-request/old", Test, "old", setup, test_accept_subscribe_request, teardown); g_test_add ("/contact-lists/reject-subscribe-request/old", Test, "old", setup, test_reject_subscribe_request, teardown); g_test_add ("/contact-lists/remove-from-subscribe/old", Test, "old", setup, test_remove_from_subscribe, teardown); g_test_add ("/contact-lists/remove-from-subscribe/pending/old", Test, "old", setup, test_remove_from_subscribe_pending, teardown); g_test_add ("/contact-lists/remove-from-subscribe/no-op/old", Test, "old", setup, test_remove_from_subscribe_no_op, teardown); g_test_add ("/contact-lists/reject-subscribe-request/remove-after", Test, "remove-after", setup, test_reject_subscribe_request, teardown); g_test_add ("/contact-lists/add-to-group", Test, NULL, setup, test_add_to_group, teardown); g_test_add ("/contact-lists/add-to-group/no-op", Test, NULL, setup, test_add_to_group_no_op, teardown); g_test_add ("/contact-lists/remove-from-group", Test, NULL, setup, test_remove_from_group, teardown); g_test_add ("/contact-lists/remove-from-group/no-op", Test, NULL, setup, test_remove_from_group_no_op, teardown); g_test_add ("/contact-lists/remove-group", Test, NULL, setup, test_remove_group, teardown); g_test_add ("/contact-lists/remove-group/empty", Test, NULL, setup, test_remove_group_empty, teardown); g_test_add ("/contact-lists/add-to-group/old", Test, "old", setup, test_add_to_group, teardown); g_test_add ("/contact-lists/add-to-group/no-op/old", Test, "old", setup, test_add_to_group_no_op, teardown); g_test_add ("/contact-lists/remove-from-group/old", Test, "old", setup, test_remove_from_group, teardown); g_test_add ("/contact-lists/remove-from-group/no-op/old", Test, "old", setup, test_remove_from_group_no_op, teardown); g_test_add ("/contact-lists/remove-group/old", Test, "old", setup, test_remove_group, teardown); g_test_add ("/contact-lists/remove-group/empty/old", Test, "old", setup, test_remove_group_empty, teardown); g_test_add ("/contact-lists/set_contact_groups", Test, NULL, setup, test_set_contact_groups, teardown); g_test_add ("/contact-lists/set_contact_groups/no-op", Test, NULL, setup, test_set_contact_groups_no_op, teardown); g_test_add ("/contact-lists/set_group_members", Test, NULL, setup, test_set_group_members, teardown); g_test_add ("/contact-lists/rename_group", Test, NULL, setup, test_rename_group, teardown); g_test_add ("/contact-lists/rename_group/absent", Test, NULL, setup, test_rename_group_absent, teardown); g_test_add ("/contact-lists/rename_group/overwrite", Test, NULL, setup, test_rename_group_overwrite, teardown); g_test_add ("/contact-lists/add-to-deny", Test, NULL, setup, test_add_to_deny, teardown); g_test_add ("/contact-lists/add-to-deny/no-op", Test, NULL, setup, test_add_to_deny_no_op, teardown); g_test_add ("/contact-lists/remove-from-deny", Test, NULL, setup, test_remove_from_deny, teardown); g_test_add ("/contact-lists/remove-from-deny/no-op", Test, NULL, setup, test_remove_from_deny_no_op, teardown); g_test_add ("/contact-lists/request-blocked-contacts", Test, NULL, setup, test_request_blocked_contacts, teardown); g_test_add ("/contact-lists/request-blocked-contacts-before-connect", Test, NULL, setup_pre_connect, test_request_blocked_contacts_pre_connect, teardown_pre_connect); g_test_add ("/contact-lists/request-blocked-contacts-connect-failed", Test, "break-account-parameter", setup_pre_connect, test_request_blocked_contacts_connect_failed, teardown_pre_connect); g_test_add ("/contact-lists/block-contacts", Test, NULL, setup, test_block_contacts, teardown); g_test_add ("/contact-lists/block-contacts/no-op", Test, NULL, setup, test_block_contacts_no_op, teardown); g_test_add ("/contact-lists/unblock-contacts", Test, NULL, setup, test_unblock_contacts, teardown); g_test_add ("/contact-lists/unblock-contacts/no-op", Test, NULL, setup, test_unblock_contacts_no_op, teardown); g_test_add ("/contact-lists/download", Test, NULL, setup, test_download_contacts, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/channel.c0000644000175000017500000005034012652510705015312 00000000000000/* Tests of TpChannel * TODO: tests/dbus/channel-introspect.c should probably move here at some * point * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/util.h" #include "tests/lib/contacts-conn.h" #include "tests/lib/textchan-null.h" #include "tests/lib/textchan-group.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsTextChannelNull *chan_contact_service; TpTestsTextChannelGroup *chan_room_service; TpHandleRepoIface *contact_repo; TpHandleRepoIface *room_repo; /* Client side objects */ TpConnection *connection; TpChannel *channel_contact; TpChannel *channel_room; GError *error /* initialized where needed */; gint wait; } Test; static void create_contact_chan (Test *test) { gchar *chan_path; TpHandle handle; GHashTable *props; tp_clear_object (&test->chan_contact_service); tp_clear_object (&test->chan_room_service); /* Create service-side channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); handle = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->chan_contact_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "handle", handle, "object-path", chan_path, NULL); props = tp_tests_text_channel_get_props (test->chan_contact_service); test->channel_contact = tp_channel_new_from_properties (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_free (chan_path); tp_handle_unref (test->contact_repo, handle); g_hash_table_unref (props); } static void create_room_chan (Test *test) { gchar *chan_path; GHashTable *props; tp_clear_object (&test->chan_room_service); /* Create service-side channel object */ chan_path = g_strdup_printf ("%s/Channel2", tp_proxy_get_object_path (test->connection)); test->room_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_ROOM); g_assert (test->room_repo != NULL); test->chan_room_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, "connection", test->base_connection, "object-path", chan_path, NULL); g_object_get (test->chan_room_service, "channel-properties", &props, NULL); test->channel_room = tp_channel_new_from_properties (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); /* We are in the muc */ tp_tests_text_channel_group_join (test->chan_room_service); g_free (chan_path); g_hash_table_unref (props); } static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", &test->base_connection, &test->connection); create_contact_chan (test); create_room_chan (test); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->chan_contact_service); tp_clear_object (&test->chan_room_service); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->channel_contact); tp_clear_object (&test->channel_room); } static void channel_leave_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_leave_finish (TP_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_leave_contact_unprepared_no_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_channel_leave_async (test->channel_contact, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, NULL, channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } static void test_leave_contact_unprepared_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_channel_leave_async (test->channel_contact, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, "Bye Bye", channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } static void channel_prepared_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_leave_contact_prepared_no_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_proxy_prepare_async (test->channel_contact, features, channel_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_leave_async (test->channel_contact, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, NULL, channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } static void test_leave_contact_prepared_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_proxy_prepare_async (test->channel_contact, features, channel_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_leave_async (test->channel_contact, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, "Bye Bye", channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } /* Room tests */ static void check_not_removed (TpTestsTextChannelGroup *chan) { g_assert_cmpuint (chan->removed_handle, ==, 0); g_assert (chan->removed_message == NULL); g_assert_cmpuint (chan->removed_reason, ==, 0); } static void check_removed (TpTestsTextChannelGroup *chan) { g_assert_cmpuint (chan->removed_handle, !=, 0); g_assert_cmpstr (chan->removed_message, ==, "Bye Bye"); g_assert_cmpuint (chan->removed_reason, ==, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY); } static void test_leave_room_unprepared_no_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_room) == NULL); tp_channel_leave_async (test->channel_room, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, NULL, channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_room) != NULL); g_assert_cmpuint (test->chan_room_service->removed_handle, !=, 0); g_assert_cmpstr (test->chan_room_service->removed_message, ==, ""); g_assert_cmpuint (test->chan_room_service->removed_reason, ==, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); } static void test_leave_room_unprepared_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_room) == NULL); tp_channel_leave_async (test->channel_room, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, "Bye Bye", channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_room) != NULL); check_removed (test->chan_room_service); } static void test_leave_room_prepared_no_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; g_assert (tp_proxy_get_invalidated (test->channel_room) == NULL); tp_proxy_prepare_async (test->channel_room, features, channel_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_leave_async (test->channel_room, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, NULL, channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_room) != NULL); g_assert_cmpuint (test->chan_room_service->removed_handle, !=, 0); g_assert_cmpstr (test->chan_room_service->removed_message, ==, ""); g_assert_cmpuint (test->chan_room_service->removed_reason, ==, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); } static void test_leave_room_prepared_reason (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; g_assert (tp_proxy_get_invalidated (test->channel_room) == NULL); tp_proxy_prepare_async (test->channel_room, features, channel_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_leave_async (test->channel_room, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, "Bye Bye", channel_leave_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_room) != NULL); check_removed (test->chan_room_service); } static void channel_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_close_finish (TP_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_close (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_channel_close_async (test->channel_contact, channel_close_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } static void test_close_room (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_room) == NULL); tp_channel_close_async (test->channel_room, channel_close_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_room) != NULL); check_not_removed (test->chan_room_service); } static void channel_destroy_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_destroy_finish (TP_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_destroy (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (tp_proxy_get_invalidated (test->channel_contact) == NULL); tp_channel_destroy_async (test->channel_contact, channel_destroy_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_get_invalidated (test->channel_contact) != NULL); } static void property_changed_cb (GObject *object, GParamSpec *spec, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_password_feature (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_PASSWORD, 0 }; gboolean pass_needed; /* Channel needs a password */ tp_tests_text_channel_set_password (test->chan_room_service, "test"); /* Feature is not yet prepared */ g_assert (!tp_channel_password_needed (test->channel_room)); g_object_get (test->channel_room, "password-needed", &pass_needed, NULL); g_assert (!pass_needed); g_signal_connect (test->channel_room, "notify::password-needed", G_CALLBACK (property_changed_cb), test); tp_proxy_prepare_async (test->channel_room, features, channel_prepared_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_channel_password_needed (test->channel_room)); g_object_get (test->channel_room, "password-needed", &pass_needed, NULL); g_assert (pass_needed); /* Channel does not need a password any more */ tp_tests_text_channel_set_password (test->chan_room_service, NULL); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (!tp_channel_password_needed (test->channel_room)); g_object_get (test->channel_room, "password-needed", &pass_needed, NULL); g_assert (!pass_needed); /* Channel does not re-need a password */ tp_tests_text_channel_set_password (test->chan_room_service, "test"); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_channel_password_needed (test->channel_room)); g_object_get (test->channel_room, "password-needed", &pass_needed, NULL); g_assert (pass_needed); } static void provide_password_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_error (&test->error); tp_channel_provide_password_finish (TP_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_password_provide (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_tests_text_channel_set_password (test->chan_room_service, "test"); /* Try a wrong password */ tp_channel_provide_password_async (test->channel_room, "badger", provide_password_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_AUTHENTICATION_FAILED); /* Try the right password */ tp_channel_provide_password_async (test->channel_room, "test", provide_password_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void join_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_join_finish (TP_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_join_room (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_FEATURE_GROUP, 0 }; tp_proxy_prepare_async (test->channel_room, features, channel_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_join_async (test->channel_room, "Hello World", join_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void group_contacts_changed_cb (TpChannel *self, GPtrArray *added, GPtrArray *removed, GPtrArray *local_pending, GPtrArray *remote_pending, TpContact *actor, GHashTable *details, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_contacts (Test *test, gconstpointer data G_GNUC_UNUSED) { TpSimpleClientFactory *factory; const gchar *id = "badger"; const gchar *alias1 = "Alias 1"; const gchar *alias2 = "Alias 2"; GQuark channel_features[] = { TP_CHANNEL_FEATURE_CONTACTS, 0 }; TpHandle handle; GArray *handles; TpContact *contact; GPtrArray *contacts; /* Tell factory we want to prepare ALIAS feature on TpContact objects */ factory = tp_proxy_get_factory (test->connection); tp_simple_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_INVALID); /* Set an alias for channel's target contact */ handle = tp_channel_get_handle (test->channel_contact, NULL); g_assert (handle != 0); tp_tests_contacts_connection_change_aliases ( TP_TESTS_CONTACTS_CONNECTION (test->base_connection), 1, &handle, &alias1); /* Prepare channel with CONTACTS feature. assert it has created its TpContact * and prepared alias feature. */ tp_tests_proxy_run_until_prepared (test->channel_contact, channel_features); contact = tp_channel_get_target_contact (test->channel_contact); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "bob"); g_assert_cmpstr (tp_contact_get_alias (contact), ==, alias1); contact = tp_channel_get_initiator_contact (test->channel_contact); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "me@test.com"); /* Prepare room channel and assert it prepared the self contact */ tp_tests_proxy_run_until_prepared (test->channel_room, channel_features); contact = tp_channel_group_get_self_contact (test->channel_room); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "me@test.com"); /* Add a member in the room, assert that the member fetched its alias before * being signaled. */ handle = tp_handle_ensure (test->contact_repo, id, NULL, NULL); tp_tests_contacts_connection_change_aliases ( TP_TESTS_CONTACTS_CONNECTION (test->base_connection), 1, &handle, &alias2); g_signal_connect (test->channel_room, "group-contacts-changed", G_CALLBACK (group_contacts_changed_cb), test); handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (handles, handle); tp_cli_channel_interface_group_call_add_members (test->channel_room, -1, handles, "hello", NULL, NULL, NULL, NULL); g_array_unref (handles); g_main_loop_run (test->mainloop); /* There is ourself and the new contact, get the new one */ contacts = tp_channel_group_dup_members_contacts (test->channel_room); g_assert (contacts != NULL); g_assert (contacts->len == 2); contact = g_ptr_array_index (contacts, 0); if (!tp_strdiff (tp_contact_get_identifier (contact), "me@test.com")) contact = g_ptr_array_index (contacts, 1); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, id); g_assert_cmpstr (tp_contact_get_alias (contact), ==, alias2); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/channel/leave/contact/unprepared/no-reason", Test, NULL, setup, test_leave_contact_unprepared_no_reason, teardown); g_test_add ("/channel/leave/contact/unprepared/reason", Test, NULL, setup, test_leave_contact_unprepared_reason, teardown); g_test_add ("/channel/leave/contact/prepared/no-reason", Test, NULL, setup, test_leave_contact_prepared_no_reason, teardown); g_test_add ("/channel/leave/contact/prepared/reason", Test, NULL, setup, test_leave_contact_prepared_reason, teardown); g_test_add ("/channel/leave/room/unprepared/no-reason", Test, NULL, setup, test_leave_room_unprepared_no_reason, teardown); g_test_add ("/channel/leave/room/unprepared/reason", Test, NULL, setup, test_leave_room_unprepared_reason, teardown); g_test_add ("/channel/leave/room/prepared/no-reason", Test, NULL, setup, test_leave_room_prepared_no_reason, teardown); g_test_add ("/channel/leave/room/prepared/reason", Test, NULL, setup, test_leave_room_prepared_reason, teardown); g_test_add ("/channel/close/contact", Test, NULL, setup, test_close, teardown); g_test_add ("/channel/close/room", Test, NULL, setup, test_close_room, teardown); g_test_add ("/channel/destroy", Test, NULL, setup, test_destroy, teardown); g_test_add ("/channel/password/feature", Test, NULL, setup, test_password_feature, teardown); g_test_add ("/channel/password/provide", Test, NULL, setup, test_password_provide, teardown); g_test_add ("/channel/join/room", Test, NULL, setup, test_join_room, teardown); g_test_add ("/channel/contacts", Test, NULL, setup, test_contacts, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/contacts-bug-19101.c0000644000175000017500000001232012652510705016740 00000000000000/* Regression test for fd.o bug #19101. */ #include "config.h" #include #include #include #include #include "tests/lib/bug-19101-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" typedef struct { GMainLoop *loop; GError *error /* initialized to 0 */; GPtrArray *contacts; gchar **good_ids; GHashTable *bad_ids; } Result; static void finish (gpointer r) { Result *result = r; g_main_loop_quit (result->loop); } static void by_id_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *good_ids, GHashTable *bad_ids, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { GHashTableIter iter; gpointer key, value; guint i; DEBUG ("got %u contacts and %u bad IDs", n_contacts, g_hash_table_size (bad_ids)); result->bad_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_error_free); tp_g_hash_table_update (result->bad_ids, bad_ids, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) g_error_copy); g_hash_table_iter_init (&iter, result->bad_ids); while (g_hash_table_iter_next (&iter, &key, &value)) { gchar *id = key; GError *e = value; DEBUG ("bad ID %s: %s %u: %s", id, g_quark_to_string (e->domain), e->code, e->message); } result->good_ids = g_strdupv ((GStrv) good_ids); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u we asked for ID %s", i, good_ids[i]); DEBUG ("contact #%u we got ID %s", i, tp_contact_get_identifier (contact)); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void test_by_id (TpConnection *client_conn) { Result result = { g_main_loop_new (NULL, FALSE) }; static const gchar * const ids[] = { "Alice", "Bob", "Not valid", "Chris", "not valid either", NULL }; tp_connection_get_contacts_by_id (client_conn, 2, ids, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.error != NULL, ": should fail as the CM is broken"); g_assert_cmpuint (result.error->domain, ==, TP_DBUS_ERRORS); MYASSERT (result.error->code == TP_DBUS_ERROR_INCONSISTENT, ": %i != %i", result.error->code, TP_DBUS_ERROR_INCONSISTENT); MYASSERT (result.contacts == NULL, ""); MYASSERT (result.good_ids == NULL, ""); MYASSERT (result.bad_ids == NULL, ""); /* clean up */ g_main_loop_unref (result.loop); g_error_free (result.error); } int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsContactsConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *client_conn; /* Setup */ tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); DEBUG ("a"); service_conn = TP_TESTS_CONTACTS_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_BUG19101_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); DEBUG ("b"); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); client_conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (client_conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* Tests */ test_by_id (client_conn); /* Teardown */ tp_tests_connection_assert_disconnect_succeeds (client_conn); g_object_unref (client_conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); return 0; } telepathy-glib-0.24.2/tests/dbus/example-no-protocols.c0000644000175000017500000001017312652510705017771 00000000000000#include "config.h" #include #include #include #include #include #include "tests/lib/util.h" static void prepare (void) { GError *error = NULL; const gchar *abs_top_builddir = g_getenv ("abs_top_builddir"); const gchar *libexec = g_getenv ("libexec"); gchar *command[] = { NULL, NULL }; g_assert (abs_top_builddir != NULL || libexec != NULL); if (abs_top_builddir != NULL) { command[0] = g_strdup_printf ("%s/%s", abs_top_builddir, "examples/cm/no-protocols/telepathy-example-no-protocols"); } else { command[0] = g_strdup_printf ("%s/%s", libexec, "telepathy-example-no-protocols"); } if (!g_spawn_async (NULL, command, NULL, 0, NULL, NULL, NULL, &error)) { g_error ("g_spawn_async: %s", error->message); } g_free (command[0]); } static void connection_manager_got_info (TpConnectionManager *cm, guint source, GMainLoop *mainloop) { GHashTable *empty = g_hash_table_new (NULL, NULL); gchar *bus_name = NULL; gchar *object_path = NULL; GError *error = NULL; g_message ("Emitted got-info (source=%d)", source); if (source < TP_CM_INFO_SOURCE_LIVE) return; tp_cli_connection_manager_run_request_connection (cm, -1, "jabber", empty, &bus_name, &object_path, &error, NULL); g_assert (error != NULL); g_assert (error->domain == TP_ERROR); g_assert (error->code == TP_ERROR_NOT_IMPLEMENTED); g_error_free (error); g_main_loop_quit (mainloop); g_hash_table_unref (empty); } static void wait_for_name_owner_cb (TpDBusDaemon *dbus_daemon, const gchar *name, const gchar *new_owner, gpointer main_loop) { if (new_owner[0] != '\0') g_main_loop_quit (main_loop); } static void early_cm_exited (TpConnectionManager *cm, gboolean *saw_exited) { *saw_exited = TRUE; } int main (int argc, char **argv) { GMainLoop *mainloop; TpConnectionManager *early_cm, *late_cm; TpDBusDaemon *dbus_daemon; gulong handler; GError *error = NULL; gboolean saw_exited; tp_tests_abort_after (5); tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus_daemon = tp_tests_dbus_daemon_dup_or_die (); /* First try making a TpConnectionManager before the CM is available. This * will fail. */ early_cm = tp_connection_manager_new (dbus_daemon, "example_no_protocols", NULL, NULL); g_assert (early_cm != NULL); /* Failure to introspect is signalled as 'exited' */ handler = g_signal_connect (early_cm, "exited", G_CALLBACK (early_cm_exited), &saw_exited); tp_tests_proxy_run_until_prepared_or_failed (early_cm, NULL, &error); g_assert (error != NULL); g_assert (tp_proxy_get_invalidated (early_cm) == NULL); g_assert_cmpuint (error->domain, ==, DBUS_GERROR); g_assert_cmpint (error->code, ==, DBUS_GERROR_SERVICE_UNKNOWN); g_clear_error (&error); if (!saw_exited) { g_debug ("waiting for 'exited'..."); while (!saw_exited) g_main_context_iteration (NULL, TRUE); } g_signal_handler_disconnect (early_cm, handler); /* Now start the connection manager and wait for it to start */ prepare (); tp_dbus_daemon_watch_name_owner (dbus_daemon, TP_CM_BUS_NAME_BASE "example_no_protocols", wait_for_name_owner_cb, g_main_loop_ref (mainloop), (GDestroyNotify) g_main_loop_unref); g_main_loop_run (mainloop); /* This TpConnectionManager works fine. */ late_cm = tp_connection_manager_new (dbus_daemon, "example_no_protocols", NULL, NULL); g_assert (late_cm != NULL); handler = g_signal_connect (late_cm, "got-info", G_CALLBACK (connection_manager_got_info), mainloop); g_main_loop_run (mainloop); g_signal_handler_disconnect (late_cm, handler); /* Now both objects can become ready */ tp_tests_proxy_run_until_prepared (early_cm, NULL); tp_tests_proxy_run_until_prepared (late_cm, NULL); g_object_unref (late_cm); g_object_unref (early_cm); g_object_unref (dbus_daemon); g_main_loop_unref (mainloop); return 0; } telepathy-glib-0.24.2/tests/dbus/contacts.c0000644000175000017500000031321412652510705015522 00000000000000/* Feature test for TpContact creation. * * Code missing coverage in contact.c: * - connection becoming invalid * - fatal error on the connection * - inconsistent CM * - having to fall back to RequestAliases * - get_contacts_by_id with features (but it's trivial) * * Copyright © 2008–2011 Collabora Ltd. * Copyright © 2008 Nokia Corporation * Copyright © 2007 Will Thompson * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/broken-client-types-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" #define MEMBERS_CHANGED_MATCH_RULE \ "type='signal'," \ "interface='" TP_IFACE_CHANNEL_INTERFACE_GROUP "'," \ "member='MembersChanged'" typedef struct { GMainLoop *loop; GError *error /* initialized to 0 */; GPtrArray *contacts; GArray *invalid; gchar **good_ids; GHashTable *bad_ids; } Result; typedef struct { Result result; TpBaseConnection *base_connection; TpBaseConnection *legacy_base_connection; TpBaseConnection *no_requests_base_connection; TpTestsContactsConnection *service_conn; TpHandleRepoIface *service_repo; TpConnection *client_conn; TpConnection *legacy_client_conn; TpConnection *no_requests_client_conn; } Fixture; /* We only really actively test TP_CONTACT_FEATURE_ALIAS, but preparing any * of these once should be enough, assuming that the CM is not broken. */ static TpContactFeature all_contact_features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE, TP_CONTACT_FEATURE_LOCATION, TP_CONTACT_FEATURE_CAPABILITIES, TP_CONTACT_FEATURE_AVATAR_DATA, TP_CONTACT_FEATURE_CONTACT_INFO, TP_CONTACT_FEATURE_CLIENT_TYPES, TP_CONTACT_FEATURE_SUBSCRIPTION_STATES, TP_CONTACT_FEATURE_CONTACT_GROUPS, TP_CONTACT_FEATURE_CONTACT_BLOCKING }; /* If people add new features, they should add them to this test. We could * generate the list dynamically but this seems less brittle. */ G_STATIC_ASSERT (G_N_ELEMENTS (all_contact_features) == TP_NUM_CONTACT_FEATURES); static void by_handle_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, guint n_invalid, const TpHandle *invalid, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { guint i; DEBUG ("got %u contacts and %u invalid", n_contacts, n_invalid); result->invalid = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_invalid); g_array_append_vals (result->invalid, invalid, n_invalid); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; GFile *avatar_file; gchar *avatar_uri = NULL; avatar_file = tp_contact_get_avatar_file (contact); if (avatar_file != NULL) avatar_uri = g_file_get_uri (avatar_file); DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u avatar MIME type: %s", i, tp_contact_get_avatar_mime_type (contact)); DEBUG ("contact #%u avatar file: %s", i, avatar_uri); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); g_free (avatar_uri); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void finish (gpointer r) { Result *result = r; g_main_loop_quit (result->loop); } static void reset_result (Result *result) { tp_clear_pointer (&result->invalid, g_array_unref); if (result->contacts != NULL) g_ptr_array_foreach (result->contacts, (GFunc) g_object_unref, NULL); tp_clear_pointer (&result->contacts, g_ptr_array_unref); tp_clear_pointer (&result->good_ids, g_strfreev); tp_clear_pointer (&result->bad_ids, g_hash_table_unref); g_clear_error (&result->error); } static void contact_info_verify (TpContact *contact) { GList *info; TpContactInfoField *field; g_assert (tp_contact_has_feature (contact, TP_CONTACT_FEATURE_CONTACT_INFO)); info = tp_contact_get_contact_info (contact); g_assert (info != NULL); g_assert (info->data != NULL); g_assert (info->next == NULL); field = info->data; g_assert_cmpstr (field->field_name, ==, "n"); g_assert (field->parameters != NULL); g_assert (field->parameters[0] == NULL); g_assert (field->field_value != NULL); g_assert_cmpstr (field->field_value[0], ==, "Foo"); g_assert (field->field_value[1] == NULL); g_list_free (info); } static void contact_info_notify_cb (TpContact *contact, GParamSpec *pspec, Result *result) { contact_info_verify (contact); finish (result); } static void contact_info_prepare_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpConnection *connection = TP_CONNECTION (object); Result *result = user_data; if (tp_proxy_prepare_finish (connection, res, &result->error)) { TpContactInfoFlags flags; GList *specs, *l; flags = tp_connection_get_contact_info_flags (connection); g_assert_cmpint (flags, ==, TP_CONTACT_INFO_FLAG_PUSH | TP_CONTACT_INFO_FLAG_CAN_SET); specs = tp_connection_get_contact_info_supported_fields (connection); g_assert_cmpuint (g_list_length (specs), ==, 5); for (l = specs; l != NULL; l = l->next) { TpContactInfoFieldSpec *spec = l->data; if (!tp_strdiff (spec->name, "bday") || !tp_strdiff (spec->name, "fn")) { g_assert (spec->parameters != NULL); g_assert (spec->parameters[0] == NULL); g_assert_cmpint (spec->flags, ==, 0); g_assert_cmpint (spec->max, ==, 1); } else if (!tp_strdiff (spec->name, "email") || !tp_strdiff (spec->name, "tel") || !tp_strdiff (spec->name, "url")) { g_assert (spec->parameters != NULL); g_assert (spec->parameters[0] == NULL); g_assert_cmpint (spec->flags, ==, 0); g_assert_cmpint (spec->max, ==, G_MAXUINT32); } else { g_assert_not_reached (); } } g_list_free (specs); } finish (result); } static void contact_info_set_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpConnection *connection = TP_CONNECTION (object); Result *result = user_data; tp_connection_set_contact_info_finish (connection, res, &result->error); finish (result); } static void contact_info_request_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpContact *contact = TP_CONTACT (object); Result *result = user_data; contact_info_verify (contact); tp_contact_request_contact_info_finish (contact, res, &result->error); finish (result); } static void contact_info_request_cancelled_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpContact *contact = TP_CONTACT (object); Result *result = user_data; GError *error = NULL; tp_contact_request_contact_info_finish (contact, res, &error); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); g_clear_error (&error); finish (result); } static gboolean contact_info_request_cancel (gpointer cancellable) { g_cancellable_cancel (cancellable); return FALSE; } static void test_contact_info (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContactFeature features[] = { TP_CONTACT_FEATURE_CONTACT_INFO }; TpContact *contact; TpHandle handle; const gchar *field_value[] = { "Foo", NULL }; GPtrArray *info; GList *info_list = NULL; GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_INFO, 0 }; GCancellable *cancellable; /* Create fake info fields */ info = g_ptr_array_new_with_free_func ((GDestroyNotify) tp_value_array_free); g_ptr_array_add (info, tp_value_array_build (3, G_TYPE_STRING, "n", G_TYPE_STRV, NULL, G_TYPE_STRV, field_value, G_TYPE_INVALID)); info_list = g_list_prepend (info_list, tp_contact_info_field_new ("n", NULL, (GStrv) field_value)); tp_tests_contacts_connection_set_default_contact_info (service_conn, info); /* TEST1: Verify ContactInfo properties are correctly introspected on * TpConnection */ tp_proxy_prepare_async (client_conn, conn_features, contact_info_prepare_cb, &result); g_main_loop_run (result.loop); g_assert_no_error (result.error); /* TEST2: Set contact info on the connection, then get the self TpContact. * This tests the set operation works correctly and also test TpContact * correctly introspects the ContactInfo when the feature is requested. */ /* ... but first, get the SelfHandle contact without any features (regression * test for a related bug, fd.o #32191) */ handle = tp_connection_get_self_handle (client_conn); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); tp_connection_set_contact_info_async (client_conn, info_list, contact_info_set_cb, &result); g_main_loop_run (result.loop); g_assert_no_error (result.error); handle = tp_connection_get_self_handle (client_conn); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_ptr_array_index (result.contacts, 0); contact_info_verify (contact); reset_result (&result); /* TEST3: Create a TpContact with the INFO feature. Then change its info in * the CM. That should emit "notify::info" signal on the TpContact. */ handle = tp_handle_ensure (service_repo, "info-test-3", NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_ptr_array_index (result.contacts, 0); g_signal_connect (contact, "notify::contact-info", G_CALLBACK (contact_info_notify_cb), &result); tp_tests_contacts_connection_change_contact_info (service_conn, handle, info); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); tp_handle_unref (service_repo, handle); /* TEST 4: First set the info in the CM for an handle, then create a TpContact * without INFO feature, and finally refresh the contact's info. */ handle = tp_handle_ensure (service_repo, "info-test-4", NULL, NULL); tp_tests_contacts_connection_change_contact_info (service_conn, handle, info); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_ptr_array_index (result.contacts, 0); g_assert (tp_contact_get_contact_info (contact) == NULL); g_signal_connect (contact, "notify::contact-info", G_CALLBACK (contact_info_notify_cb), &result); tp_connection_refresh_contact_info (client_conn, 1, &contact); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); tp_handle_unref (service_repo, handle); /* TEST5: Create a TpContact without INFO feature, then request the contact's * info. */ handle = tp_handle_ensure (service_repo, "info-test-5", NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_ptr_array_index (result.contacts, 0); g_assert (tp_contact_get_contact_info (contact) == NULL); tp_contact_request_contact_info_async (contact, NULL, contact_info_request_cb, &result); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); tp_handle_unref (service_repo, handle); /* TEST6: Create a TpContact without INFO feature, then request the contact's * info, and cancel the request. */ handle = tp_handle_ensure (service_repo, "info-test-6", NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_ptr_array_index (result.contacts, 0); g_assert (tp_contact_get_contact_info (contact) == NULL); cancellable = g_cancellable_new (); tp_contact_request_contact_info_async (contact, cancellable, contact_info_request_cancelled_cb, &result); g_idle_add_full (G_PRIORITY_HIGH, contact_info_request_cancel, cancellable, g_object_unref); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); tp_handle_unref (service_repo, handle); /* Cleanup */ g_main_loop_unref (result.loop); g_ptr_array_unref (info); tp_contact_info_list_free (info_list); } static void prepare_avatar_requirements_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpConnection *connection = TP_CONNECTION (object); Result *result = user_data; if (tp_proxy_prepare_finish (connection, res, &result->error)) { TpAvatarRequirements *req; req = tp_connection_get_avatar_requirements (connection); g_assert (req != NULL); g_assert (req->supported_mime_types != NULL); g_assert_cmpstr (req->supported_mime_types[0], ==, "image/png"); g_assert (req->supported_mime_types[1] == NULL); g_assert_cmpuint (req->minimum_width, ==, 1); g_assert_cmpuint (req->minimum_height, ==, 2); g_assert_cmpuint (req->recommended_width, ==, 3); g_assert_cmpuint (req->recommended_height, ==, 4); g_assert_cmpuint (req->maximum_width, ==, 5); g_assert_cmpuint (req->maximum_height, ==, 6); g_assert_cmpuint (req->maximum_bytes, ==, 7); } finish (result); } static void test_avatar_requirements (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; GQuark features[] = { TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS, 0 }; g_message (G_STRFUNC); tp_proxy_prepare_async (TP_PROXY (client_conn), features, prepare_avatar_requirements_cb, &result); g_main_loop_run (result.loop); g_assert_no_error (result.error); g_main_loop_unref (result.loop); } static TpContact * create_contact_with_fake_avatar (TpTestsContactsConnection *service_conn, TpConnection *client_conn, const gchar *id, gboolean request_avatar) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContactFeature feature; const gchar avatar_data[] = "fake-avatar-data"; const gchar avatar_token[] = "fake-avatar-token"; const gchar avatar_mime_type[] = "fake-avatar-mime-type"; TpContact *contact; TpHandle handle; GArray *array; gchar *content = NULL; handle = tp_handle_ensure (service_repo, id, NULL, NULL); array = g_array_new (FALSE, FALSE, sizeof (gchar)); g_array_append_vals (array, avatar_data, strlen (avatar_data) + 1); tp_tests_contacts_connection_change_avatar_data (service_conn, handle, array, avatar_mime_type, avatar_token); if (request_avatar) feature = TP_CONTACT_FEATURE_AVATAR_DATA; else feature = TP_CONTACT_FEATURE_AVATAR_TOKEN; tp_connection_get_contacts_by_handle (client_conn, 1, &handle, 1, &feature, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpstr (tp_contact_get_avatar_token (contact), ==, avatar_token); if (request_avatar) { GFile *avatar_file; /* If we requested avatar, it could come later */ if (tp_contact_get_avatar_file (contact) == NULL) { g_signal_connect_swapped (contact, "notify::avatar-file", G_CALLBACK (finish), &result); g_main_loop_run (result.loop); } g_assert_cmpstr (tp_contact_get_avatar_mime_type (contact), ==, avatar_mime_type); avatar_file = tp_contact_get_avatar_file (contact); g_assert (avatar_file != NULL); g_file_load_contents (avatar_file, NULL, &content, NULL, NULL, &result.error); g_assert_no_error (result.error); g_assert_cmpstr (content, ==, avatar_data); g_free (content); } reset_result (&result); g_main_loop_unref (result.loop); tp_handle_unref (service_repo, handle); g_array_unref (array); return contact; } static void avatar_retrieved_cb (TpConnection *connection, guint handle, const gchar *token, const GArray *avatar, const gchar *mime_type, gpointer user_data, GObject *weak_object) { gboolean *called = user_data; *called = TRUE; } /* From telepathy-haze, with permission */ static gboolean haze_remove_directory (const gchar *path) { const gchar *child_path; GDir *dir = g_dir_open (path, 0, NULL); gboolean ret = TRUE; if (!dir) return FALSE; while (ret && (child_path = g_dir_read_name (dir))) { gchar *child_full_path = g_build_filename (path, child_path, NULL); if (g_file_test (child_full_path, G_FILE_TEST_IS_DIR)) { if (!haze_remove_directory (child_full_path)) ret = FALSE; } else { DEBUG ("deleting %s", child_full_path); if (g_unlink (child_full_path)) ret = FALSE; } g_free (child_full_path); } g_dir_close (dir); if (ret) { DEBUG ("deleting %s", path); ret = !g_rmdir (path); } return ret; } static void test_avatar_data (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; gboolean avatar_retrieved_called; GError *error = NULL; TpContact *contact1, *contact2; TpProxySignalConnection *signal_id; g_message (G_STRFUNC); /* Check if AvatarRetrieved gets called */ signal_id = tp_cli_connection_interface_avatars_connect_to_avatar_retrieved ( client_conn, avatar_retrieved_cb, &avatar_retrieved_called, NULL, NULL, &error); g_assert_no_error (error); /* First time we create a contact, avatar should not be in cache, so * AvatarRetrived should be called */ avatar_retrieved_called = FALSE; contact1 = create_contact_with_fake_avatar (service_conn, client_conn, "fake-id1", TRUE); g_assert (avatar_retrieved_called); g_assert (contact1 != NULL); g_assert (tp_contact_get_avatar_file (contact1) != NULL); /* Second time we create a contact, avatar should be in cache now, so * AvatarRetrived should NOT be called */ avatar_retrieved_called = FALSE; contact2 = create_contact_with_fake_avatar (service_conn, client_conn, "fake-id2", TRUE); g_assert (!avatar_retrieved_called); g_assert (contact2 != NULL); g_assert (tp_contact_get_avatar_file (contact2) != NULL); g_assert (g_file_equal ( tp_contact_get_avatar_file (contact1), tp_contact_get_avatar_file (contact2))); tp_proxy_signal_connection_disconnect (signal_id); g_object_unref (contact1); g_object_unref (contact2); } static void test_avatar_data_after_token (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; const gchar *id = "avatar-data-after-token"; TpContact *contact1, *contact2; g_message (G_STRFUNC); /* Create a contact with AVATAR_TOKEN feature */ contact1 = create_contact_with_fake_avatar (service_conn, client_conn, id, FALSE); g_assert (contact1 != NULL); g_assert (tp_contact_get_avatar_file (contact1) == NULL); /* Now create the same contact with AVATAR_DATA feature */ contact2 = create_contact_with_fake_avatar (service_conn, client_conn, id, TRUE); g_assert (contact2 != NULL); g_assert (tp_contact_get_avatar_file (contact2) != NULL); g_assert (contact1 == contact2); /* Cleanup */ g_object_unref (contact1); g_object_unref (contact2); } static void test_by_handle (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[5] = { 0, 0, 0, 0, 0 }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[4]; gpointer weak_pointers[4]; guint i; g_message (G_STRFUNC); /* arrange for some handles to exist */ handles[0] = tp_handle_ensure (service_repo, "alice", NULL, NULL); MYASSERT (handles[0] != 0, ""); handles[1] = tp_handle_ensure (service_repo, "bob", NULL, NULL); MYASSERT (handles[1] != 0, ""); /* randomly guess at a handle that shouldn't exist */ handles[2] = 31337; MYASSERT (!tp_handle_is_valid (service_repo, 31337, NULL), ""); /* another valid handle */ handles[3] = tp_handle_ensure (service_repo, "chris", NULL, NULL); MYASSERT (handles[3] != 0, ""); /* another invalid handle */ handles[4] = 12345; MYASSERT (!tp_handle_is_valid (service_repo, 12345, NULL), ""); /* Make a request for the following 5 contacts: * - alice * - bob * - invalid handle 31337 * - chris * - invalid handle 12345 */ tp_connection_get_contacts_by_handle (client_conn, 5, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 2, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); contacts[0] = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contacts[0]), ==, handles[0]); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_object_ref (g_ptr_array_index (result.contacts, 1)); g_assert_cmpuint (tp_contact_get_handle (contacts[1]), ==, handles[1]); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); contacts[3] = g_object_ref (g_ptr_array_index (result.contacts, 2)); g_assert_cmpuint (tp_contact_get_handle (contacts[3]), ==, handles[3]); g_assert_cmpstr (tp_contact_get_identifier (contacts[3]), ==, "chris"); /* clean up before doing the second request */ reset_result (&result); g_assert (result.error == NULL); /* Replace one of the invalid handles with a valid one */ handles[2] = tp_handle_ensure (service_repo, "dora", NULL, NULL); MYASSERT (handles[2] != 0, ""); /* Make a request for the following 4 contacts: * - alice (TpContact exists) * - bob (TpContact exists) * - dora (TpContact needs to be created) * - chris (TpContact exists) */ tp_connection_get_contacts_by_handle (client_conn, 4, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); /* assert that we got the same contacts back */ MYASSERT (result.contacts->len == 4, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); /* 0, 1 and 3 we already have a reference to */ MYASSERT (g_ptr_array_index (result.contacts, 0) == contacts[0], ""); g_object_unref (g_ptr_array_index (result.contacts, 0)); MYASSERT (g_ptr_array_index (result.contacts, 1) == contacts[1], ""); g_object_unref (g_ptr_array_index (result.contacts, 1)); MYASSERT (g_ptr_array_index (result.contacts, 3) == contacts[3], ""); g_object_unref (g_ptr_array_index (result.contacts, 3)); /* 2 we don't */ contacts[2] = g_ptr_array_index (result.contacts, 2); g_assert_cmpuint (tp_contact_get_handle (contacts[2]), ==, handles[2]); g_assert_cmpstr (tp_contact_get_identifier (contacts[2]), ==, "dora"); g_ptr_array_unref (result.contacts); result.contacts = NULL; /* clean up refs to contacts and assert that they aren't leaked */ for (i = 0; i < 4; i++) { weak_pointers[i] = contacts[i]; g_object_add_weak_pointer ((GObject *) contacts[i],weak_pointers +i); } for (i = 0; i < 4; i++) { g_object_unref (contacts[i]); MYASSERT (weak_pointers[i] == NULL, ": %u", i); } /* wait for ReleaseHandles to run */ tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* remaining cleanup */ g_assert (result.error == NULL); reset_result (&result); g_main_loop_unref (result.loop); } /* Silently removes the TpBaseConnection object from D-Bus, so that if the test * makes any D-Bus calls on it, it will fail (but the TpConnection proxy isn't * invalidated otherwise) */ static void make_the_connection_disappear (Fixture *f) { GError *error = NULL; gboolean ok; tp_dbus_daemon_unregister_object ( tp_base_connection_get_dbus_daemon (f->base_connection), f->base_connection); /* check that that worked */ ok = tp_cli_connection_run_get_self_handle (f->client_conn, -1, NULL, &error, NULL); g_assert_error (error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_assert (!ok); g_clear_error (&error); } /* Returns the TpBaseConnection to D-Bus (after a previous call to * make_the_connection_disappear()) */ static void put_the_connection_back (Fixture *f) { GError *error = NULL; gboolean ok; tp_dbus_daemon_register_object ( tp_base_connection_get_dbus_daemon (f->base_connection), tp_base_connection_get_object_path (f->base_connection), f->base_connection); /* check that *that* worked */ ok = tp_cli_connection_run_get_self_handle (f->client_conn, -1, NULL, &error, NULL); g_assert_no_error (error); g_assert (ok); } static TpHandle get_handle_with_no_caps (Fixture *f, const gchar *id) { TpHandle handle; GHashTable *capabilities; handle = tp_handle_ensure (f->service_repo, id, NULL, NULL); g_assert_cmpuint (handle, !=, 0); /* Unlike almost every other feature, with capabilities “not sure” and “none” * are different: you really might care about the difference between “I don't * know if blah can do video” versus “I know blah cannot do video”. * * It happens that we get the repeated-reintrospection behaviour for the * former case of contact caps. I can't really be bothered to fix this. */ capabilities = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_ptr_array_unref); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handle), g_ptr_array_new ()); tp_tests_contacts_connection_change_capabilities (f->service_conn, capabilities); g_hash_table_unref (capabilities); return handle; } static void test_by_handle_again (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handle; TpContact *contact; gpointer weak_pointer; const gchar *alias = "Alice in Wonderland"; g_test_bug ("25181"); handle = get_handle_with_no_caps (f, "alice"); tp_tests_contacts_connection_change_aliases (f->service_conn, 1, &handle, &alias); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, G_N_ELEMENTS (all_contact_features), all_contact_features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alice"); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); /* clean up before doing the second request */ reset_result (&result); g_assert (result.error == NULL); make_the_connection_disappear (f); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, G_N_ELEMENTS (all_contact_features), all_contact_features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert (g_ptr_array_index (result.contacts, 0) == contact); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); put_the_connection_back (f); g_assert (result.error == NULL); reset_result (&result); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); tp_tests_proxy_run_until_dbus_queue_processed (f->client_conn); g_main_loop_unref (result.loop); } static void test_by_handle_upgrade (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handle; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( f->base_connection, TP_HANDLE_TYPE_CONTACT); TpContact *contact; gpointer weak_pointer; const gchar *alias = "Alice in Wonderland"; TpContactFeature feature = TP_CONTACT_FEATURE_ALIAS; g_test_bug ("32191"); handle = tp_handle_ensure (service_repo, "alice", NULL, NULL); g_assert_cmpuint (handle, !=, 0); tp_tests_contacts_connection_change_aliases (f->service_conn, 1, &handle, &alias); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alice"); /* fallback alias is still in effect */ g_assert_cmpstr (tp_contact_get_alias (contact), ==, "alice"); /* clean up before doing the second request */ reset_result (&result); g_assert (result.error == NULL); /* the second request enables the Alias feature, so it must make more D-Bus * round trips */ tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 1, &feature, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) == contact); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); g_assert (result.error == NULL); reset_result (&result); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); tp_tests_proxy_run_until_dbus_queue_processed (f->client_conn); g_main_loop_unref (result.loop); } static void test_no_features (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; const gchar * const ids[] = { "alice", "bob", "chris" }; TpHandle handles[3] = { 0, 0, 0 }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; guint i; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 3, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_object_ref (g_ptr_array_index (result.contacts, i)); g_assert (result.error == NULL); reset_result (&result); for (i = 0; i < 3; i++) { MYASSERT (tp_contact_get_connection (contacts[i]) == client_conn, ""); g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, tp_contact_get_identifier (contacts[i])); MYASSERT (tp_contact_get_avatar_token (contacts[i]) == NULL, ": %s", tp_contact_get_avatar_token (contacts[i])); g_assert_cmpuint (tp_contact_get_presence_type (contacts[i]), ==, TP_CONNECTION_PRESENCE_TYPE_UNSET); g_assert_cmpstr (tp_contact_get_presence_status (contacts[i]), ==, ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); } for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_main_loop_unref (result.loop); } static void upgrade_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { guint i; DEBUG ("got %u contacts", n_contacts); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } /* Just put a country in locations for easier comparaisons. * FIXME: Ideally we should have a MYASSERT_SAME_ASV */ #define ASSERT_SAME_LOCATION(left, left_vardict, right)\ G_STMT_START {\ g_assert_cmpuint (g_hash_table_size (left), ==, \ g_hash_table_size (right));\ g_assert_cmpstr (tp_asv_get_string (left, "country"), ==,\ tp_asv_get_string (right, "country"));\ \ g_assert_cmpstr (g_variant_get_type_string (left_vardict), ==, "a{sv}"); \ g_assert_cmpuint (g_variant_n_children (left_vardict), ==, \ g_hash_table_size (right));\ g_assert_cmpstr (tp_vardict_get_string (left_vardict, "country"), ==,\ tp_asv_get_string (right, "country"));\ } G_STMT_END static void free_rcc_list (GPtrArray *rccs) { g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, rccs); } static void add_text_chat_class (GPtrArray *classes, TpHandleType handle_type) { GHashTable *fixed; const gchar * const allowed[] = { NULL }; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static GHashTable * create_contact_caps (TpHandle *handles) { GHashTable *capabilities; GPtrArray *caps1, *caps2, *caps3; capabilities = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) free_rcc_list); /* Support private text chats */ caps1 = g_ptr_array_sized_new (2); add_text_chat_class (caps1, TP_HANDLE_TYPE_CONTACT); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handles[0]), caps1); /* Support text chatrooms */ caps2 = g_ptr_array_sized_new (1); add_text_chat_class (caps2, TP_HANDLE_TYPE_ROOM); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handles[1]), caps2); /* Don't support anything */ caps3 = g_ptr_array_sized_new (0); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handles[2]), caps3); return capabilities; } static void test_upgrade (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; static const gchar * const aliases[] = { "Alice in Wonderland", "Bob the Builder", "Christopher Robin" }; static const gchar * const tokens[] = { "aaaaa", "bbbbb", "ccccc" }; static TpTestsContactsConnectionPresenceStatusIndex statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY }; static const gchar * const messages[] = { "", "Fixing it", "GON OUT BACKSON" }; GHashTable *location_1 = tp_asv_new ( "country", G_TYPE_STRING, "United Kingdom of Great Britain and Northern Ireland", NULL); GHashTable *location_2 = tp_asv_new ( "country", G_TYPE_STRING, "Atlantis", NULL); GHashTable *location_3 = tp_asv_new ( "country", G_TYPE_STRING, "Belgium", NULL); GHashTable *locations[] = { location_1, location_2, location_3 }; GHashTable *capabilities; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE, TP_CONTACT_FEATURE_LOCATION, TP_CONTACT_FEATURE_CAPABILITIES }; guint i; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_tests_contacts_connection_change_aliases (service_conn, 3, handles, aliases); tp_tests_contacts_connection_change_presences (service_conn, 3, handles, statuses, messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 3, handles, tokens); tp_tests_contacts_connection_change_locations (service_conn, 3, handles, locations); capabilities = create_contact_caps (handles); tp_tests_contacts_connection_change_capabilities (service_conn, capabilities); g_hash_table_unref (capabilities); tp_connection_get_contacts_by_handle (client_conn, 3, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_object_ref (g_ptr_array_index (result.contacts, i)); for (i = 0; i < 3; i++) { MYASSERT (tp_contact_get_connection (contacts[i]) == client_conn, ""); g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, tp_contact_get_identifier (contacts[i])); MYASSERT (tp_contact_get_avatar_token (contacts[i]) == NULL, ": %s", tp_contact_get_avatar_token (contacts[i])); g_assert_cmpuint (tp_contact_get_presence_type (contacts[i]), ==, TP_CONNECTION_PRESENCE_TYPE_UNSET); g_assert_cmpstr (tp_contact_get_presence_status (contacts[i]), ==, ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); } /* clean up before doing the second request */ g_assert (result.error == NULL); reset_result (&result); tp_connection_upgrade_contacts (client_conn, 3, contacts, G_N_ELEMENTS (features), features, upgrade_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid == NULL, ""); g_assert_no_error (result.error); for (i = 0; i < 3; i++) { MYASSERT (g_ptr_array_index (result.contacts, 0) == contacts[0], ""); } g_assert (result.invalid == NULL); g_assert (result.error == NULL); reset_result (&result); for (i = 0; i < 3; i++) { GVariant *vardict; g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, messages[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); vardict = tp_contact_dup_location (contacts[i]); ASSERT_SAME_LOCATION (tp_contact_get_location (contacts[i]), vardict, locations[i]); g_variant_unref (vardict); g_object_get (contacts[i], "location-vardict", &vardict, NULL); ASSERT_SAME_LOCATION (tp_contact_get_location (contacts[i]), vardict, locations[i]); g_variant_unref (vardict); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); MYASSERT (tp_contact_get_capabilities (contacts[i]) != NULL, ""); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "available"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "busy"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[2]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[2]), ==, "away"); for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_hash_table_unref (location_1); g_hash_table_unref (location_2); g_hash_table_unref (location_3); g_main_loop_unref (result.loop); } /* Regression test case for fd.o#41414 */ static void test_upgrade_noop (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handle; TpContact *contact; g_test_bug ("41414"); /* Get a contact by handle */ handle = get_handle_with_no_caps (f, "test-upgrade-noop"); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, G_N_ELEMENTS (all_contact_features), all_contact_features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); reset_result (&result); /* Upgrade it, but it should already have all features */ make_the_connection_disappear (f); tp_connection_upgrade_contacts (f->client_conn, 1, &contact, G_N_ELEMENTS (all_contact_features), all_contact_features, upgrade_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); reset_result (&result); put_the_connection_back (f); g_object_unref (contact); } typedef struct { gboolean alias_changed; gboolean avatar_token_changed; gboolean presence_type_changed; gboolean presence_status_changed; gboolean presence_msg_changed; gboolean location_changed; gboolean location_vardict_changed; gboolean capabilities_changed; } notify_ctx; static void notify_ctx_init (notify_ctx *ctx) { ctx->alias_changed = FALSE; ctx->avatar_token_changed = FALSE; ctx->presence_type_changed = FALSE; ctx->presence_status_changed = FALSE; ctx->presence_msg_changed = FALSE; ctx->location_changed = FALSE; ctx->location_vardict_changed = FALSE; ctx->capabilities_changed = FALSE; } static gboolean notify_ctx_is_fully_changed (notify_ctx *ctx) { return ctx->alias_changed && ctx->avatar_token_changed && ctx->presence_type_changed && ctx->presence_status_changed && ctx->presence_msg_changed && ctx->location_changed && ctx->location_vardict_changed && ctx->capabilities_changed; } static gboolean notify_ctx_is_changed (notify_ctx *ctx) { return ctx->alias_changed || ctx->avatar_token_changed || ctx->presence_type_changed || ctx->presence_status_changed || ctx->presence_msg_changed || ctx->location_changed || ctx->location_vardict_changed || ctx->capabilities_changed; } static void contact_notify_cb (TpContact *contact, GParamSpec *param, notify_ctx *ctx) { if (!tp_strdiff (param->name, "alias")) ctx->alias_changed = TRUE; else if (!tp_strdiff (param->name, "avatar-token")) ctx->avatar_token_changed = TRUE; else if (!tp_strdiff (param->name, "presence-type")) ctx->presence_type_changed = TRUE; else if (!tp_strdiff (param->name, "presence-status")) ctx->presence_status_changed = TRUE; else if (!tp_strdiff (param->name, "presence-message")) ctx->presence_msg_changed = TRUE; else if (!tp_strdiff (param->name, "location")) ctx->location_changed = TRUE; else if (!tp_strdiff (param->name, "location-vardict")) ctx->location_vardict_changed = TRUE; else if (!tp_strdiff (param->name, "capabilities")) ctx->capabilities_changed = TRUE; } static GHashTable * create_new_contact_caps (TpHandle *handles) { GHashTable *capabilities; GPtrArray *caps1, *caps2; capabilities = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) free_rcc_list); /* Support private text chats and chatrooms */ caps1 = g_ptr_array_sized_new (2); add_text_chat_class (caps1, TP_HANDLE_TYPE_CONTACT); add_text_chat_class (caps1, TP_HANDLE_TYPE_ROOM); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handles[0]), caps1); /* Don't support anything */ caps2 = g_ptr_array_sized_new (0); g_hash_table_insert (capabilities, GUINT_TO_POINTER (handles[1]), caps2); return capabilities; } static void test_features (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->service_conn; TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; static const gchar * const aliases[] = { "Alice in Wonderland", "Bob the Builder", "Christopher Robin" }; static const gchar * const tokens[] = { "aaaaa", "bbbbb", "ccccc" }; static TpTestsContactsConnectionPresenceStatusIndex statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY }; static const gchar * const messages[] = { "", "Fixing it", "GON OUT BACKSON" }; static const gchar * const new_aliases[] = { "Alice [at a tea party]", "Bob the Plumber" }; static const gchar * const new_tokens[] = { "AAAA", "BBBB" }; static TpTestsContactsConnectionPresenceStatusIndex new_statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE }; static const gchar * const new_messages[] = { "At the Mad Hatter's", "It'll cost you" }; GHashTable *location_1 = tp_asv_new ( "country", G_TYPE_STRING, "United Kingdom of Great Britain and Northern Ireland", NULL); GHashTable *location_2 = tp_asv_new ( "country", G_TYPE_STRING, "Atlantis", NULL); GHashTable *location_3 = tp_asv_new ( "country", G_TYPE_STRING, "Belgium", NULL); GHashTable *locations[] = { location_1, location_2, location_3 }; GHashTable *location_4 = tp_asv_new ( "country", G_TYPE_STRING, "France", NULL); GHashTable *location_5 = tp_asv_new ( "country", G_TYPE_STRING, "Éire", NULL); GHashTable *new_locations[] = { location_4, location_5 }; GHashTable *capabilities, *new_capabilities; gboolean support_text_chats[] = { TRUE, FALSE, FALSE }; gboolean support_text_chatrooms[] = { FALSE, TRUE, FALSE }; gboolean new_support_text_chats[] = { TRUE, FALSE }; gboolean new_support_text_chatrooms[] = { TRUE, FALSE }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE, TP_CONTACT_FEATURE_LOCATION, TP_CONTACT_FEATURE_CAPABILITIES }; guint i; struct { TpConnection *connection; TpHandle handle; gchar *identifier; gchar *alias; gchar *avatar_token; TpConnectionPresenceType presence_type; gchar *presence_status; gchar *presence_message; GHashTable *location; GVariant *location_vardict; TpCapabilities *capabilities; } from_gobject; notify_ctx notify_ctx_alice, notify_ctx_chris; GVariant *vardict; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_tests_contacts_connection_change_aliases (service_conn, 3, handles, aliases); tp_tests_contacts_connection_change_presences (service_conn, 3, handles, statuses, messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 3, handles, tokens); tp_tests_contacts_connection_change_locations (service_conn, 3, handles, locations); /* contact capabilities */ capabilities = create_contact_caps (handles); tp_tests_contacts_connection_change_capabilities (service_conn, capabilities); g_hash_table_unref (capabilities); tp_connection_get_contacts_by_handle (client_conn, 3, handles, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_object_ref (g_ptr_array_index (result.contacts, i)); g_assert (result.error == NULL); reset_result (&result); for (i = 0; i < 3; i++) { TpCapabilities *caps; g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, messages[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); vardict = tp_contact_dup_location (contacts[i]); ASSERT_SAME_LOCATION (tp_contact_get_location (contacts[i]), vardict, locations[i]); g_variant_unref (vardict); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); caps = tp_contact_get_capabilities (contacts[i]); MYASSERT (caps != NULL, ""); MYASSERT (tp_capabilities_is_specific_to_contact (caps), ""); MYASSERT (tp_capabilities_supports_text_chats (caps) == support_text_chats[i], " contact %u", i); MYASSERT (tp_capabilities_supports_text_chatrooms (caps) == support_text_chatrooms[i], " contact %u", i); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "available"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "busy"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[2]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[2]), ==, "away"); /* exercise GObject properties in a basic way */ g_object_get (contacts[0], "connection", &from_gobject.connection, "handle", &from_gobject.handle, "identifier", &from_gobject.identifier, "alias", &from_gobject.alias, "avatar-token", &from_gobject.avatar_token, "presence-type", &from_gobject.presence_type, "presence-status", &from_gobject.presence_status, "presence-message", &from_gobject.presence_message, "location", &from_gobject.location, "location-vardict", &from_gobject.location_vardict, "capabilities", &from_gobject.capabilities, NULL); MYASSERT (from_gobject.connection == client_conn, ""); g_assert_cmpuint (from_gobject.handle, ==, handles[0]); g_assert_cmpstr (from_gobject.identifier, ==, "alice"); g_assert_cmpstr (from_gobject.alias, ==, "Alice in Wonderland"); g_assert_cmpstr (from_gobject.avatar_token, ==, "aaaaa"); g_assert_cmpuint (from_gobject.presence_type, ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (from_gobject.presence_status, ==, "available"); g_assert_cmpstr (from_gobject.presence_message, ==, ""); ASSERT_SAME_LOCATION (from_gobject.location, from_gobject.location_vardict, locations[0]); MYASSERT (tp_capabilities_is_specific_to_contact (from_gobject.capabilities), ""); MYASSERT (tp_capabilities_supports_text_chats (from_gobject.capabilities) == support_text_chats[0], ""); MYASSERT (tp_capabilities_supports_text_chatrooms (from_gobject.capabilities) == support_text_chatrooms[0], ""); g_object_unref (from_gobject.connection); g_free (from_gobject.identifier); g_free (from_gobject.alias); g_free (from_gobject.avatar_token); g_free (from_gobject.presence_status); g_free (from_gobject.presence_message); g_hash_table_unref (from_gobject.location); g_variant_unref (from_gobject.location_vardict); g_object_unref (from_gobject.capabilities); notify_ctx_init (¬ify_ctx_alice); g_signal_connect (contacts[0], "notify", G_CALLBACK (contact_notify_cb), ¬ify_ctx_alice); notify_ctx_init (¬ify_ctx_chris); g_signal_connect (contacts[2], "notify", G_CALLBACK (contact_notify_cb), ¬ify_ctx_chris); /* Change Alice and Bob's contact info, leave Chris as-is */ tp_tests_contacts_connection_change_aliases (service_conn, 2, handles, new_aliases); tp_tests_contacts_connection_change_presences (service_conn, 2, handles, new_statuses, new_messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 2, handles, new_tokens); tp_tests_contacts_connection_change_locations (service_conn, 2, handles, new_locations); new_capabilities = create_new_contact_caps (handles); tp_tests_contacts_connection_change_capabilities (service_conn, new_capabilities); g_hash_table_unref (new_capabilities); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); g_assert (notify_ctx_is_fully_changed (¬ify_ctx_alice)); g_assert (!notify_ctx_is_changed (¬ify_ctx_chris)); for (i = 0; i < 2; i++) { TpCapabilities *caps; g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, new_aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, new_tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, new_messages[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); vardict = tp_contact_dup_location (contacts[i]); ASSERT_SAME_LOCATION (tp_contact_get_location (contacts[i]), vardict, new_locations[i]); g_variant_unref (vardict); caps = tp_contact_get_capabilities (contacts[i]); MYASSERT (caps != NULL, ""); MYASSERT (tp_capabilities_is_specific_to_contact (caps), ""); MYASSERT (tp_capabilities_supports_text_chats (caps) == new_support_text_chats[i], " contact %u", i); MYASSERT (tp_capabilities_supports_text_chatrooms (caps) == new_support_text_chatrooms[i], " contact %u", i); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "away"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "available"); for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_main_loop_unref (result.loop); g_hash_table_unref (location_1); g_hash_table_unref (location_2); g_hash_table_unref (location_3); g_hash_table_unref (location_4); g_hash_table_unref (location_5); } static void by_id_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *good_ids, GHashTable *bad_ids, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { GHashTableIter iter; gpointer key, value; guint i; DEBUG ("got %u contacts and %u bad IDs", n_contacts, g_hash_table_size (bad_ids)); result->bad_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_error_free); tp_g_hash_table_update (result->bad_ids, bad_ids, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) g_error_copy); g_hash_table_iter_init (&iter, result->bad_ids); while (g_hash_table_iter_next (&iter, &key, &value)) { gchar *id = key; GError *e = value; DEBUG ("bad ID %s: %s %u: %s", id, g_quark_to_string (e->domain), e->code, e->message); } result->good_ids = g_strdupv ((GStrv) good_ids); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u we asked for ID %s", i, good_ids[i]); DEBUG ("contact #%u we got ID %s", i, tp_contact_get_identifier (contact)); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void test_by_id (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpConnection *client_conn = f->client_conn; Result result = { g_main_loop_new (NULL, FALSE) }; static const gchar * const ids[] = { "Alice", "Bob", "Not valid", "Chris", "not valid either", NULL }; TpContact *contacts[3]; GError *e /* no initialization needed */; g_message ("%s: all bad (fd.o #19688)", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 1, ids + 2, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 0, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 1, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); e = g_hash_table_lookup (result.bad_ids, "Not valid"); MYASSERT (e != NULL, ""); reset_result (&result); g_message ("%s: all good", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 2, ids, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 2, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 0, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); contacts[0] = g_ptr_array_index (result.contacts, 0); g_assert_cmpstr (result.good_ids[0], ==, "Alice"); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_ptr_array_index (result.contacts, 1); g_assert_cmpstr (result.good_ids[1], ==, "Bob"); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); reset_result (&result); g_message ("%s: not all good", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 5, ids, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 2, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); e = g_hash_table_lookup (result.bad_ids, "Not valid"); MYASSERT (e != NULL, ""); e = g_hash_table_lookup (result.bad_ids, "not valid either"); MYASSERT (e != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); contacts[0] = g_ptr_array_index (result.contacts, 0); g_assert_cmpstr (result.good_ids[0], ==, "Alice"); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_ptr_array_index (result.contacts, 1); g_assert_cmpstr (result.good_ids[1], ==, "Bob"); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); contacts[2] = g_ptr_array_index (result.contacts, 2); g_assert_cmpstr (result.good_ids[2], ==, "Chris"); g_assert_cmpstr (tp_contact_get_identifier (contacts[2]), ==, "chris"); /* wait for ReleaseHandles to run */ tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* remaining cleanup */ reset_result (&result); g_main_loop_unref (result.loop); } static void test_capabilities_without_contact_caps (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( f->legacy_base_connection, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; guint i; TpContactFeature features[] = { TP_CONTACT_FEATURE_CAPABILITIES }; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 3, handles, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_ptr_array_index (result.contacts, i); for (i = 0; i < 3; i++) { TpCapabilities *caps; g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); caps = tp_contact_get_capabilities (contacts[i]); MYASSERT (caps != NULL, ""); MYASSERT (!tp_capabilities_is_specific_to_contact (caps), ""); MYASSERT (!tp_capabilities_supports_text_chats (caps), " contact %u", i); MYASSERT (!tp_capabilities_supports_text_chatrooms (caps), " contact %u", i); } g_assert (result.error == NULL); reset_result (&result); g_main_loop_unref (result.loop); } static void test_prepare_contact_caps_without_request (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpConnection *client_conn = f->no_requests_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( f->no_requests_base_connection, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; guint i; TpContactFeature features[] = { TP_CONTACT_FEATURE_CAPABILITIES }; g_test_bug ("27686"); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 3, handles, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_ptr_array_index (result.contacts, i); for (i = 0; i < 3; i++) { TpCapabilities *caps; g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_CAPABILITIES), ""); caps = tp_contact_get_capabilities (contacts[i]); MYASSERT (caps == NULL, ""); } g_assert (result.error == NULL); reset_result (&result); g_main_loop_unref (result.loop); } static void test_dup_if_possible (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle alice_handle, bob_handle; TpContact *alice; TpContact *contact; alice_handle = tp_handle_ensure (f->service_repo, "alice", NULL, NULL); g_assert_cmpuint (alice_handle, !=, 0); bob_handle = tp_handle_ensure (f->service_repo, "bob", NULL, NULL); g_assert_cmpuint (bob_handle, !=, 0); tp_connection_get_contacts_by_handle (f->client_conn, 1, &alice_handle, 0, NULL, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); alice = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (alice), ==, alice_handle); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); reset_result (&f->result); /* we already have a cached TpContact for Alice, so we can get another * copy of it synchronously */ contact = tp_connection_dup_contact_if_possible (f->client_conn, alice_handle, "alice"); g_assert (contact == alice); g_object_unref (contact); contact = tp_connection_dup_contact_if_possible (f->client_conn, alice_handle, NULL); g_assert (contact == alice); g_object_unref (contact); /* because this connection has immortal handles, we can reliably get a * contact for Bob synchronously, but only if we supply his identifier */ contact = tp_connection_dup_contact_if_possible (f->client_conn, bob_handle, NULL); g_assert (contact == NULL); contact = tp_connection_dup_contact_if_possible (f->client_conn, bob_handle, "bob"); g_assert (contact != alice); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "bob"); g_assert_cmpuint (tp_contact_get_handle (contact), ==, bob_handle); g_object_unref (contact); g_object_unref (alice); } typedef struct { TpSubscriptionState subscribe; TpSubscriptionState publish; const gchar *publish_request; GMainLoop *loop; } SubscriptionStates; static void assert_subscription_states (TpContact *contact, SubscriptionStates *states) { g_assert_cmpint (tp_contact_get_subscribe_state (contact), ==, states->subscribe); g_assert_cmpint (tp_contact_get_publish_state (contact), ==, states->publish); g_assert_cmpstr (tp_contact_get_publish_request (contact), ==, states->publish_request); } static void subscription_states_changed_cb (TpContact *contact, TpSubscriptionState subscribe, TpSubscriptionState publish, const gchar *publish_request, SubscriptionStates *states) { assert_subscription_states (contact, states); g_main_loop_quit (states->loop); } static void test_subscription_states (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle alice_handle; TpContact *alice; TpTestsContactListManager *manager; TpContactFeature features[] = { TP_CONTACT_FEATURE_SUBSCRIPTION_STATES }; SubscriptionStates states = { TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, "", f->result.loop }; manager = tp_tests_contacts_connection_get_contact_list_manager ( f->service_conn); alice_handle = tp_handle_ensure (f->service_repo, "alice", NULL, NULL); g_assert_cmpuint (alice_handle, !=, 0); tp_connection_get_contacts_by_handle (f->client_conn, 1, &alice_handle, G_N_ELEMENTS (features), features, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); alice = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (alice), ==, alice_handle); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); assert_subscription_states (alice, &states); reset_result (&f->result); g_signal_connect (alice, "subscription-states-changed", G_CALLBACK (subscription_states_changed_cb), &states); /* Request subscription */ tp_tests_contact_list_manager_request_subscription (manager, 1, &alice_handle, ""); states.subscribe = TP_SUBSCRIPTION_STATE_ASK; g_main_loop_run (states.loop); /* Request again must re-emit the signal. Saying please this time will make * the request accepted and will ask for publish. */ tp_tests_contact_list_manager_request_subscription (manager, 1, &alice_handle, "please"); g_main_loop_run (states.loop); states.subscribe = TP_SUBSCRIPTION_STATE_YES; states.publish = TP_SUBSCRIPTION_STATE_ASK; states.publish_request = "automatic publish request"; g_main_loop_run (states.loop); /* Remove the contact */ tp_tests_contact_list_manager_remove (manager, 1, &alice_handle); states.subscribe = TP_SUBSCRIPTION_STATE_NO; states.publish = TP_SUBSCRIPTION_STATE_NO; states.publish_request = ""; g_main_loop_run (states.loop); g_object_unref (alice); } typedef struct { GPtrArray *groups; GMainLoop *loop; } ContactGroups; static void assert_contact_groups (TpContact *contact, ContactGroups *data) { const gchar * const *groups = tp_contact_get_contact_groups (contact); guint i; g_assert (groups != NULL); g_assert_cmpuint (g_strv_length ((GStrv) groups), ==, data->groups->len); for (i = 0; i < data->groups->len; i++) g_assert (tp_strv_contains (groups, g_ptr_array_index (data->groups, i))); } static void contact_groups_changed_cb (TpContact *contact, GStrv added, GStrv removed, ContactGroups *data) { assert_contact_groups (contact, data); g_main_loop_quit (data->loop); } static void test_contact_groups (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle alice_handle; TpContact *alice; TpTestsContactListManager *manager; TpContactFeature features[] = { TP_CONTACT_FEATURE_CONTACT_GROUPS }; ContactGroups data; data.groups = g_ptr_array_new (); data.loop = f->result.loop; manager = tp_tests_contacts_connection_get_contact_list_manager ( f->service_conn); alice_handle = tp_handle_ensure (f->service_repo, "alice", NULL, NULL); g_assert_cmpuint (alice_handle, !=, 0); tp_connection_get_contacts_by_handle (f->client_conn, 1, &alice_handle, G_N_ELEMENTS (features), features, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); alice = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (alice), ==, alice_handle); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); assert_contact_groups (alice, &data); reset_result (&f->result); g_signal_connect (alice, "contact-groups-changed", G_CALLBACK (contact_groups_changed_cb), &data); g_ptr_array_add (data.groups, "group1"); tp_tests_contact_list_manager_add_to_group (manager, "group1", alice_handle); g_main_loop_run (data.loop); g_ptr_array_add (data.groups, "group2"); tp_tests_contact_list_manager_add_to_group (manager, "group2", alice_handle); g_main_loop_run (data.loop); g_ptr_array_remove_index_fast (data.groups, 0); tp_tests_contact_list_manager_remove_from_group (manager, "group1", alice_handle); g_main_loop_run (data.loop); g_ptr_array_set_size (data.groups, 0); g_ptr_array_add (data.groups, "group1"); g_ptr_array_add (data.groups, "group2"); g_ptr_array_add (data.groups, "group3"); tp_contact_set_contact_groups_async (alice, data.groups->len, (const gchar * const *) data.groups->pdata, NULL, NULL); g_main_loop_run (data.loop); g_ptr_array_unref (data.groups); g_object_unref (alice); } static void assert_no_location (TpContact *contact) { /* We could reasonably represent “no published location” as NULL or as an * empty a{sv}, so allow both. */ GHashTable *retrieved_location = tp_contact_get_location (contact); if (retrieved_location != NULL) g_assert (g_hash_table_size (retrieved_location) == 0); } /* This is a regression test for an issue where the LOCATION feature would * never be marked as prepared for contacts with no published location, so * repeated calls to tp_connection_get_contacts_by_handle() would call * GetContactAttributes() over and over. It's really a special case of * test_by_handle_again(), but presented separately for clarity. */ static void test_no_location (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle handle; TpContact *contact; gpointer weak_pointer; TpContactFeature feature = TP_CONTACT_FEATURE_LOCATION; GHashTable *norway = tp_asv_new ("country", G_TYPE_STRING, "Norway", NULL); notify_ctx notify_ctx_alice; GVariant *vardict; g_test_bug ("39377"); handle = tp_handle_ensure (f->service_repo, "alice", NULL, NULL); g_assert_cmpuint (handle, !=, 0); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 1, &feature, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); assert_no_location (contact); reset_result (&f->result); /* Although Alice doesn't have a published location, the feature's still been * prepared, so we shouldn't need any D-Bus traffic to re-fetch her TpContact. */ make_the_connection_disappear (f); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 1, &feature, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_no_error (f->result.error); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert (g_ptr_array_index (f->result.contacts, 0) == contact); assert_no_location (contact); put_the_connection_back (f); g_assert (f->result.error == NULL); reset_result (&f->result); /* Despite Alice not currently having a published location, we should * certainly be listening to changes to her location. */ notify_ctx_init (¬ify_ctx_alice); g_signal_connect (contact, "notify", G_CALLBACK (contact_notify_cb), ¬ify_ctx_alice); tp_tests_contacts_connection_change_locations (f->service_conn, 1, &handle, &norway); tp_tests_proxy_run_until_dbus_queue_processed (f->client_conn); g_assert (notify_ctx_alice.location_changed); g_assert (notify_ctx_alice.location_vardict_changed); vardict = tp_contact_dup_location (contact); ASSERT_SAME_LOCATION (tp_contact_get_location (contact), vardict, norway); g_variant_unref (vardict); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); /* Check that first retrieving a contact without the LOCATION feature, and * later upgrading it to have the LOCATION feature, does the right thing. */ handle = tp_handle_ensure (f->service_repo, "rupert", NULL, NULL); g_assert_cmpuint (handle, !=, 0); tp_tests_contacts_connection_change_locations (f->service_conn, 1, &handle, &norway); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 0, NULL, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); assert_no_location (contact); /* clean up before doing the second request */ reset_result (&f->result); tp_connection_upgrade_contacts (f->client_conn, 1, &contact, 1, &feature, upgrade_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_no_error (f->result.error); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert (g_ptr_array_index (f->result.contacts, 0) == contact); vardict = tp_contact_dup_location (contact); ASSERT_SAME_LOCATION (tp_contact_get_location (contact), vardict, norway); g_variant_unref (vardict); reset_result (&f->result); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); tp_tests_proxy_run_until_dbus_queue_processed (f->client_conn); } static void setup_broken_client_types_conn (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { tp_tests_create_and_connect_conn ( TP_TESTS_TYPE_BROKEN_CLIENT_TYPES_CONNECTION, "me@test.com", &f->base_connection, &f->client_conn); f->service_conn = TP_TESTS_CONTACTS_CONNECTION (f->base_connection); g_object_ref (f->service_conn); f->service_repo = tp_base_connection_get_handles (f->base_connection, TP_HANDLE_TYPE_CONTACT); f->result.loop = g_main_loop_new (NULL, FALSE); } static void test_superfluous_attributes (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle handle; TpContact *contact; const gchar * const *client_types; TpContactFeature client_types_feature = TP_CONTACT_FEATURE_CLIENT_TYPES; TpContactFeature presence_feature = TP_CONTACT_FEATURE_PRESENCE; g_assert (TP_TESTS_IS_BROKEN_CLIENT_TYPES_CONNECTION (f->service_conn)); handle = tp_handle_ensure (f->service_repo, "helge", NULL, NULL); g_assert_cmpuint (handle, !=, 0); /* We ask for ClientTypes; the CM is broken and adds SimplePresence * information to the reply... it also omits the /client-types attribute from * the reply, which, since the spec says “Omitted from the result if the * contact's client types are not known.” leaves us in the exciting position * of having to decide between marking the feature as prepared anyway or * saying it failed, and also deciding whether get_client_types returns [] or * NULL... */ tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 1, &client_types_feature, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); /* She doesn't have any client types. There are two reasonable ways to * represent this. */ client_types = tp_contact_get_client_types (contact); if (client_types != NULL) g_assert_cmpstr (client_types[0], ==, NULL); /* She also shouldn't have any presence information, despite it being * inexplicably included in the GetContactAttributes reply. Specifically: * because we have not connected to PresencesChanged, it's not safe to just * randomly stash this information and mark the feature as prepared. * * (If we wanted to be really smart we could do something like: if the * information's there for some reason, and we happen already to be bound to * PresencesChanged due to preparing that feature on another contact … then * accept the mysterious information. But that seems fragile and prone to * people relying on sketchy behaviour.) */ g_assert_cmpstr (tp_contact_get_presence_message (contact), ==, ""); g_assert_cmpstr (tp_contact_get_presence_status (contact), ==, ""); g_assert_cmpuint (tp_contact_get_presence_type (contact), ==, TP_CONNECTION_PRESENCE_TYPE_UNSET); reset_result (&f->result); /* So now if we try to prepare TP_CONTACT_FEATURE_PRESENCE, we should need to * make some D-Bus calls: it shouldn't have been marked prepared by the * previous call. Successfully upgrading to this feature is tested * elsewhere, so we'll test that upgrading fails if the connection's * mysteriously died. */ make_the_connection_disappear (f); tp_connection_get_contacts_by_handle (f->client_conn, 1, &handle, 1, &presence_feature, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); /* Not gonna make any particular assertions about what the error is. */ g_assert_error (f->result.error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); put_the_connection_back (f); reset_result (&f->result); g_object_unref (contact); } static void contact_list_changed_cb (TpConnection *connection, GPtrArray *added, GPtrArray *removed, gpointer user_data) { gboolean *received = user_data; g_assert (added != NULL); g_assert (removed != NULL); *received = TRUE; } static void test_contact_list (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { const GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 }; const GQuark feature_connected[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpTestsContactListManager *manager; TpSimpleClientFactory *factory; const gchar *id = "contact-list-id"; const gchar *alias = "Contact List Alias"; const gchar *message = "I'm your best friend"; TpHandle handle; GPtrArray *contacts; TpContact *contact; gboolean got_contact_list_changed = FALSE; manager = tp_tests_contacts_connection_get_contact_list_manager ( f->service_conn); /* Connection is OFFLINE initially */ tp_tests_proxy_run_until_prepared (f->client_conn, conn_features); g_assert_cmpint (tp_connection_get_contact_list_state (f->client_conn), ==, TP_CONTACT_LIST_STATE_NONE); g_assert (tp_connection_get_contact_list_persists (f->client_conn)); g_assert (tp_connection_get_can_change_contact_list (f->client_conn)); g_assert (tp_connection_get_request_uses_message (f->client_conn)); /* Add a remote-pending contact in our roster CM-side */ handle = tp_handle_ensure (f->service_repo, id, NULL, NULL); tp_tests_contacts_connection_change_aliases (f->service_conn, 1, &handle, &alias); tp_tests_contact_list_manager_request_subscription (manager, 1, &handle, message); /* Tell connection's factory contact features we want */ factory = tp_proxy_get_factory (f->client_conn); tp_simple_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_DATA, TP_CONTACT_FEATURE_INVALID); /* Now put it online and wait for contact list state move to success */ g_signal_connect (f->client_conn, "contact-list-changed", G_CALLBACK (contact_list_changed_cb), &got_contact_list_changed); g_signal_connect_swapped (f->client_conn, "notify::contact-list-state", G_CALLBACK (finish), &result); tp_cli_connection_call_connect (f->client_conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (f->client_conn, feature_connected); g_assert_cmpint (tp_connection_get_contact_list_state (f->client_conn), ==, TP_CONTACT_LIST_STATE_SUCCESS); /* SUCCESS state must have been delayed until TpContact is prepared, and contact-list-changed must have been emitted just before */ g_assert (got_contact_list_changed); contacts = tp_connection_dup_contact_list (f->client_conn); g_assert (contacts != NULL); g_assert_cmpint (contacts->len, ==, 1); contact = g_ptr_array_index (contacts, 0); g_assert (contact != NULL); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, id); g_assert_cmpstr (tp_contact_get_alias (contact), ==, alias); /* Even if we didn't explicitely asked that feature, we should have it for free */ g_assert (tp_contact_has_feature (contact, TP_CONTACT_FEATURE_SUBSCRIPTION_STATES)); g_assert_cmpint (tp_contact_get_subscribe_state (contact), ==, TP_SUBSCRIPTION_STATE_ASK); /* We asked for AVATAR_DATA, verify we got it. This is special because it has * no contact attribute, and ContactList preparation does not go through * the slow path. */ g_assert (tp_contact_has_feature (contact, TP_CONTACT_FEATURE_AVATAR_DATA)); g_ptr_array_unref (contacts); } typedef struct { Fixture *f; GMainLoop *loop; gboolean expecting_signal; gboolean got_stored; gboolean got_publish; gboolean got_subscribe; } MembersChangedClosure; static void channel_prepared_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { TpChannel *channel = TP_CHANNEL (source_object); MembersChangedClosure *closure = user_data; const gchar *identifier; GError *error = NULL; tp_proxy_prepare_finish (channel, res, &error); g_assert_no_error (error); g_assert (closure->expecting_signal); /* We expect to just get the stored, publish and subscribe lists exactly * once */ identifier = tp_channel_get_identifier (channel); if (g_strcmp0 (identifier, "stored") == 0) { g_assert (!closure->got_stored); closure->got_stored = TRUE; } else if (g_strcmp0 (identifier, "publish") == 0) { g_assert (!closure->got_publish); closure->got_publish = TRUE; } else if (g_strcmp0 (identifier, "subscribe") == 0) { g_assert (!closure->got_subscribe); closure->got_subscribe = TRUE; } else { g_assert_not_reached (); } if (closure->got_stored && closure->got_publish && closure->got_subscribe) g_main_loop_quit (closure->loop); } static DBusHandlerResult message_filter (DBusConnection *connection, DBusMessage *msg, gpointer user_data) { MembersChangedClosure *closure = user_data; if (dbus_message_is_signal (msg, TP_IFACE_CHANNEL_INTERFACE_GROUP, "MembersChanged")) { TpChannel *channel; DBusMessageIter iter, sub_iter; gint type; dbus_int32_t *added; gint n_added; channel = tp_channel_new (closure->f->client_conn, dbus_message_get_path (msg), TP_IFACE_CHANNEL_INTERFACE_GROUP, TP_HANDLE_TYPE_LIST, 0, NULL); tp_proxy_prepare_async (channel, NULL, channel_prepared_cb, closure); g_object_unref (channel); /* Extract the number of added handles */ dbus_message_iter_init (msg, &iter); dbus_message_iter_next (&iter); /* Skipe the message */ type = dbus_message_iter_get_arg_type (&iter); g_assert_cmpint (type, ==, DBUS_TYPE_ARRAY); dbus_message_iter_recurse (&iter, &sub_iter); type = dbus_message_iter_get_arg_type (&sub_iter); g_assert_cmpint (type, ==, DBUS_TYPE_UINT32); dbus_message_iter_get_fixed_array (&sub_iter, &added, &n_added); /* Bob, Alice and Carol == 3 */ g_assert_cmpint (n_added, ==, 3); } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } static void test_initial_contact_list (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { const GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 }; const GQuark feature_connected[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; TpTestsContactListManager *manager; MembersChangedClosure closure; DBusConnection *dbus_connection; TpHandle alice; const gchar *alice_id = "alice"; TpHandle bob_carol[2]; const gchar *bob_id = "bob"; const gchar *carol_id = "carol"; manager = tp_tests_contacts_connection_get_contact_list_manager ( f->service_conn); /* We use a filter to be sure not to miss the initial MembersChanged * signals */ closure.f = f; closure.loop = g_main_loop_new (NULL, FALSE); closure.got_stored = FALSE; closure.got_publish = FALSE; closure.got_subscribe = FALSE; /* No signal is expected until after we connect */ closure.expecting_signal = FALSE; dbus_connection = dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (TP_PROXY (f->client_conn))); dbus_connection_ref (dbus_connection); dbus_connection_add_filter (dbus_connection, message_filter, &closure, NULL); dbus_bus_add_match (dbus_connection, MEMBERS_CHANGED_MATCH_RULE, NULL); /* Connection is OFFLINE initially */ tp_tests_proxy_run_until_prepared (f->client_conn, conn_features); g_assert_cmpint (tp_connection_get_contact_list_state (f->client_conn), ==, TP_CONTACT_LIST_STATE_NONE); /* Add contacts in our initial roster CM-side */ alice = tp_handle_ensure (f->service_repo, alice_id, NULL, NULL); tp_tests_contact_list_manager_add_initial_contacts (manager, 1, &alice); bob_carol[0] = tp_handle_ensure (f->service_repo, bob_id, NULL, NULL); bob_carol[1] = tp_handle_ensure (f->service_repo, carol_id, NULL, NULL); tp_tests_contact_list_manager_add_initial_contacts (manager, 2, bob_carol); /* Now put it online and wait for the contact list state to move to * success */ closure.expecting_signal = TRUE; tp_cli_connection_call_connect (f->client_conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (f->client_conn, feature_connected); dbus_bus_remove_match (dbus_connection, MEMBERS_CHANGED_MATCH_RULE, NULL); dbus_connection_remove_filter (dbus_connection, message_filter, &closure); dbus_connection_unref (dbus_connection); g_main_loop_unref (closure.loop); } static void test_self_contact (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { const GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; TpSimpleClientFactory *factory; TpContact *contact; factory = tp_proxy_get_factory (f->client_conn); tp_simple_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_INVALID); tp_cli_connection_call_connect (f->client_conn, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (f->client_conn, conn_features); contact = tp_connection_get_self_contact (f->client_conn); g_assert (contact != NULL); g_assert (tp_contact_has_feature (contact, TP_CONTACT_FEATURE_ALIAS)); } static void setup_internal (Fixture *f, gboolean connect, gconstpointer user_data) { tp_tests_create_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", connect, &f->base_connection, &f->client_conn); f->service_conn = TP_TESTS_CONTACTS_CONNECTION (f->base_connection); g_object_ref (f->service_conn); tp_tests_create_conn (TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, "me2@test.com", connect, &f->legacy_base_connection, &f->legacy_client_conn); tp_tests_create_conn (TP_TESTS_TYPE_NO_REQUESTS_CONNECTION, "me3@test.com", connect, &f->no_requests_base_connection, &f->no_requests_client_conn); f->service_repo = tp_base_connection_get_handles (f->base_connection, TP_HANDLE_TYPE_CONTACT); f->result.loop = g_main_loop_new (NULL, FALSE); } static void setup (Fixture *f, gconstpointer user_data) { setup_internal (f, TRUE, user_data); } static void setup_no_connect (Fixture *f, gconstpointer user_data) { setup_internal (f, FALSE, user_data); } static void teardown (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { if (f->client_conn != NULL) { TpConnection *conn = f->client_conn; g_object_add_weak_pointer ((GObject *) conn, (gpointer *) &conn); tp_tests_connection_assert_disconnect_succeeds (conn); g_object_unref (conn); g_assert (conn == NULL); f->client_conn = NULL; } f->service_repo = NULL; tp_clear_object (&f->service_conn); tp_clear_object (&f->base_connection); if (f->legacy_client_conn != NULL) tp_tests_connection_assert_disconnect_succeeds (f->legacy_client_conn); tp_clear_object (&f->legacy_client_conn); tp_clear_object (&f->legacy_base_connection); if (f->no_requests_client_conn != NULL) { tp_tests_connection_assert_disconnect_succeeds ( f->no_requests_client_conn); } tp_clear_object (&f->no_requests_client_conn); tp_clear_object (&f->no_requests_base_connection); reset_result (&f->result); tp_clear_pointer (&f->result.loop, g_main_loop_unref); } int main (int argc, char **argv) { gint ret; gchar *dir; GError *error = NULL; tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); /* Make sure g_get_user_cache_dir() returns a tmp directory, to not mess up * user's cache dir. */ dir = g_dir_make_tmp ("tp-glib-tests-XXXXXX", &error); g_assert_no_error (error); g_setenv ("XDG_CACHE_HOME", dir, TRUE); g_assert_cmpstr (g_get_user_cache_dir (), ==, dir); #define ADD(x) \ g_test_add ("/contacts/" #x, Fixture, NULL, setup, test_ ## x, teardown) ADD (by_handle); ADD (by_handle_again); ADD (by_handle_upgrade); ADD (no_features); ADD (features); ADD (upgrade); ADD (upgrade_noop); ADD (by_id); ADD (avatar_requirements); ADD (avatar_data); ADD (avatar_data_after_token); ADD (contact_info); ADD (dup_if_possible); ADD (subscription_states); ADD (contact_groups); /* test if TpContact fallbacks to connection's capabilities if * ContactCapabilities is not implemented. */ ADD (capabilities_without_contact_caps); /* test if TP_CONTACT_FEATURE_CAPABILITIES is prepared but with * an empty set of capabilities if the connection doesn't support * ContactCapabilities and Requests. */ ADD (prepare_contact_caps_without_request); ADD (no_location); g_test_add ("/contacts/superfluous-attributes", Fixture, NULL, setup_broken_client_types_conn, test_superfluous_attributes, teardown); g_test_add ("/contacts/contact-list", Fixture, NULL, setup_no_connect, test_contact_list, teardown); g_test_add ("/contacts/initial-contact-list", Fixture, NULL, setup_no_connect, test_initial_contact_list, teardown); g_test_add ("/contacts/self-contact", Fixture, NULL, setup_no_connect, test_self_contact, teardown); ret = tp_tests_run_with_bus (); g_assert (haze_remove_directory (dir)); g_free (dir); return ret; } telepathy-glib-0.24.2/tests/dbus/debug-client.c0000644000175000017500000002100312652510705016236 00000000000000/* Tests of TpDebugClient * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side object */ TpDebugSender *sender; /* Client side object */ TpDebugClient *client; GPtrArray *messages; TpDebugMessage *message; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; test->sender = tp_debug_sender_dup (); g_assert (test->sender != NULL); test->client = tp_debug_client_new (test->dbus, tp_dbus_daemon_get_unique_name (test->dbus), &test->error); g_assert_no_error (test->error); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->sender); tp_clear_object (&test->client); tp_clear_pointer (&test->messages, g_ptr_array_unref); tp_clear_object (&test->message); } static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (TP_IS_DEBUG_CLIENT (test->client)); } static void invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_invalidated (Test *test, gconstpointer data G_GNUC_UNUSED) { g_signal_connect (test->client, "invalidated", G_CALLBACK (invalidated_cb), test); tp_clear_object (&test->sender); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void proxy_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_core_feature (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_DEBUG_CLIENT_FEATURE_CORE, 0 }; g_object_set (test->sender, "enabled", TRUE, NULL); /* feature is not prepared yet */ g_assert (!tp_debug_client_is_enabled (test->client)); tp_proxy_prepare_async (test->client, features, proxy_prepare_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_debug_client_is_enabled (test->client)); } static void set_enabled_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_debug_client_set_enabled_finish (TP_DEBUG_CLIENT (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_set_enabled (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean enabled; g_object_get (test->sender, "enabled", &enabled, NULL); g_assert (!enabled); /* Enable */ tp_debug_client_set_enabled_async (test->client, TRUE, set_enabled_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_object_get (test->sender, "enabled", &enabled, NULL); g_assert (enabled); /* Disable */ tp_debug_client_set_enabled_async (test->client, FALSE, set_enabled_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_object_get (test->sender, "enabled", &enabled, NULL); g_assert (!enabled); } static void get_messages_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_clear_pointer (&test->messages, g_ptr_array_unref); test->messages = tp_debug_client_get_messages_finish ( TP_DEBUG_CLIENT (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_get_messages (Test *test, gconstpointer data G_GNUC_UNUSED) { GDateTime *time1, *time2, *t; GTimeVal time_val; TpDebugMessage *msg; time1 = g_date_time_new_now_utc (); g_date_time_to_timeval (time1, &time_val); tp_debug_sender_add_message (test->sender, &time_val, "domain1", G_LOG_LEVEL_MESSAGE, "message1\n"); time2 = g_date_time_new_now_local (); g_date_time_to_timeval (time2, &time_val); tp_debug_sender_add_message (test->sender, &time_val, "domain2/category", G_LOG_LEVEL_DEBUG, "message2"); tp_debug_client_get_messages_async (test->client, get_messages_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->messages != NULL); g_assert_cmpuint (test->messages->len, ==, 2); /* first message */ msg = g_ptr_array_index (test->messages, 0); g_assert (TP_IS_DEBUG_MESSAGE (msg)); t = tp_debug_message_get_time (msg); g_assert (t != NULL); /* Don't use g_date_time_equal() as the gouble -> GDateTime conversion in * _tp_debug_message_new() may result in a difference of one (!) * millisecond */ g_assert_cmpuint (g_date_time_to_unix (t), ==, g_date_time_to_unix (time1)); g_assert_cmpstr (tp_debug_message_get_domain (msg), ==, "domain1"); g_assert (tp_debug_message_get_category (msg) == NULL); g_assert_cmpuint (tp_debug_message_get_level (msg), ==, G_LOG_LEVEL_MESSAGE); g_assert_cmpstr (tp_debug_message_get_message (msg), ==, "message1"); /* second message */ msg = g_ptr_array_index (test->messages, 1); g_assert (TP_IS_DEBUG_MESSAGE (msg)); t = tp_debug_message_get_time (msg); g_assert (t != NULL); g_assert_cmpuint (g_date_time_to_unix (t), ==, g_date_time_to_unix (time2)); g_assert_cmpstr (tp_debug_message_get_domain (msg), ==, "domain2"); g_assert_cmpstr (tp_debug_message_get_category (msg), ==, "category"); g_assert_cmpuint (tp_debug_message_get_level (msg), ==, G_LOG_LEVEL_DEBUG); g_assert_cmpstr (tp_debug_message_get_message (msg), ==, "message2"); } static void new_debug_message_cb (TpDebugClient *client, TpDebugMessage *message, Test *test) { tp_clear_object (&test->message); test->message = g_object_ref (message); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_new_debug_message (Test *test, gconstpointer data G_GNUC_UNUSED) { g_signal_connect (test->client, "new-debug-message", G_CALLBACK (new_debug_message_cb), test); g_object_set (test->sender, "enabled", TRUE, NULL); tp_debug_sender_add_message (test->sender, NULL, "domain", G_LOG_LEVEL_DEBUG, "new message"); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (TP_IS_DEBUG_MESSAGE (test->message)); g_assert_cmpstr (tp_debug_message_get_domain (test->message), ==, "domain"); g_assert_cmpuint (tp_debug_message_get_level (test->message), ==, G_LOG_LEVEL_DEBUG); g_assert_cmpstr (tp_debug_message_get_message (test->message), ==, "new message"); } static void test_get_messages_failed (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Remove debug service */ tp_clear_object (&test->sender); tp_debug_client_get_messages_async (test->client, get_messages_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_assert (test->messages == NULL); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/debug-client/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/debug-client/invalidated", Test, NULL, setup, test_invalidated, teardown); g_test_add ("/debug-client/core-feature", Test, NULL, setup, test_core_feature, teardown); g_test_add ("/debug-client/set-enabled", Test, NULL, setup, test_set_enabled, teardown); g_test_add ("/debug-client/get-messages", Test, NULL, setup, test_get_messages, teardown); g_test_add ("/debug-client/new-debug-message", Test, NULL, setup, test_new_debug_message, teardown); g_test_add ("/debug-client/get-messages-failed", Test, NULL, setup, test_get_messages_failed, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/text-mixin.c0000644000175000017500000002410512652510705016010 00000000000000/* Basic test for the text mixin and the echo example CM. * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/echo-chan.h" #include "tests/lib/echo-conn.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" static guint received_count = 0; static guint last_received_id = 0; static guint last_received_sender = 0; static guint last_received_type = 0; static guint last_received_flags = 0; static gchar *last_received_text = NULL; static guint sent_count = 0; static guint last_sent_type = 0; static gchar *last_sent_text = NULL; static void on_sent (TpChannel *chan, guint timestamp, guint type, const gchar *text, gpointer data, GObject *object) { g_message ("%p: Sent: time %u, type %u, text '%s'", chan, timestamp, type, text); sent_count++; last_sent_type = type; g_free (last_sent_text); last_sent_text = g_strdup (text); } static void on_received (TpChannel *chan, guint id, guint timestamp, guint sender, guint type, guint flags, const gchar *text, gpointer data, GObject *object) { TpHandleRepoIface *contact_repo = data; g_message ("%p: Received #%u: time %u, sender %u '%s', type %u, flags %u, " "text '%s'", chan, id, timestamp, sender, tp_handle_inspect (contact_repo, sender), type, flags, text); received_count++; last_received_id = id; last_received_sender = sender; last_received_type = type; last_received_flags = flags; g_free (last_received_text); last_received_text = g_strdup (text); } int main (int argc, char **argv) { TpTestsEchoConnection *service_conn; TpBaseConnection *service_conn_as_base; TpHandleRepoIface *contact_repo; TpTestsEchoChannel *service_chan; TpDBusDaemon *dbus; TpConnection *conn; TpChannel *chan; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; TpHandle handle; tp_tests_abort_after (10); /* tp_debug_set_flags ("all"); */ dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_ECHO_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CONNECTION, "account", "me@example.com", "protocol", "example", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "example", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); MYASSERT (contact_repo != NULL, ""); handle = tp_handle_ensure (contact_repo, "them@example.org", NULL, &error); g_assert_no_error (error); /* FIXME: exercise RequestChannel rather than just pasting on a channel */ chan_path = g_strdup_printf ("%s/Channel", conn_path); service_chan = TP_TESTS_ECHO_CHANNEL (tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CHANNEL, "connection", service_conn, "object-path", chan_path, "handle", handle, NULL)); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); tp_channel_run_until_ready (chan, &error, NULL); g_assert_no_error (error); MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received, g_object_ref (contact_repo), g_object_unref, NULL, NULL) != NULL, ""); MYASSERT (tp_cli_channel_type_text_connect_to_sent (chan, on_sent, NULL, NULL, NULL, NULL) != NULL, ""); sent_count = 0; received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Hello, world!", &error, NULL); g_assert_no_error (error); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "Hello, world!"), "'%s' != '%s'", last_sent_text, "Hello, world!"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "You said: Hello, world!"), "'%s'", last_received_text); sent_count = 0; received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "drinks coffee", &error, NULL); g_assert_no_error (error); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "drinks coffee"), ": '%s' != '%s'", last_sent_text, "drinks coffee"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "notices that the user drinks coffee"), ": '%s'", last_received_text); sent_count = 0; received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, "Printer on fire", &error, NULL); g_assert_no_error (error); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "Printer on fire"), ": '%s' != '%s'", last_sent_text, "Printer on fire"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "You sent a notice: Printer on fire"), ": '%s'", last_received_text); g_print ("\n\n==== Listing messages ====\n"); { GPtrArray *messages; tp_cli_channel_type_text_run_list_pending_messages (chan, -1, FALSE, &messages, &error, NULL); g_assert_no_error (error); g_print ("Freeing\n"); g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages); } g_print ("\n\n==== Acknowledging messages using a wrong ID ====\n"); { GArray *ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); /* we assume this ID won't be valid (implementation detail: message * IDs are increasing integers) */ guint bad_id = 31337; g_array_append_val (ids, last_received_id); g_array_append_val (ids, bad_id); MYASSERT ( !tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1, ids, &error, NULL), ""); MYASSERT (error != NULL, ""); MYASSERT (error->domain == TP_ERROR, "%s", g_quark_to_string (error->domain)); MYASSERT (error->code == TP_ERROR_INVALID_ARGUMENT, "%u", error->code); g_error_free (error); error = NULL; g_array_unref (ids); /* The next test, "Acknowledging one message", will fail if the * last_received_id was acknowledged despite the error */ } g_print ("\n\n==== Acknowledging one message ====\n"); { GArray *ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); g_array_append_val (ids, last_received_id); tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1, ids, &error, NULL); g_assert_no_error (error); g_array_unref (ids); } g_print ("\n\n==== Acknowledging all remaining messages using deprecated " "API ====\n"); { GPtrArray *messages; tp_cli_channel_type_text_run_list_pending_messages (chan, -1, TRUE, &messages, &error, NULL); g_assert_no_error (error); g_print ("Freeing\n"); g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages); } g_print ("\n\n==== Closing channel ====\n"); { gboolean dead; MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_proxy_get_invalidated (chan) != NULL, ""); g_object_get (service_chan, "channel-destroyed", &dead, NULL); MYASSERT (dead, ""); } g_print ("\n\n==== End of tests ====\n"); tp_tests_connection_assert_disconnect_succeeds (conn); tp_handle_unref (contact_repo, handle); g_object_unref (chan); g_object_unref (conn); g_object_unref (service_chan); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); g_free (chan_path); g_free (last_sent_text); g_free (last_received_text); return 0; } telepathy-glib-0.24.2/tests/dbus/connection-interests.c0000644000175000017500000002715612652510705020070 00000000000000/* Feature test for https://bugs.freedesktop.org/show_bug.cgi?id=27835 * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" /* an almost-no-op subclass... */ typedef TpTestsSimpleConnection InterestedConnection; typedef TpTestsSimpleConnectionClass InterestedConnectionClass; static GType interested_connection_get_type (void); G_DEFINE_TYPE_WITH_CODE (InterestedConnection, interested_connection, TP_TESTS_TYPE_SIMPLE_CONNECTION, G_STMT_START { } G_STMT_END) /* Lord Pearson of Rannoch: My Lords, I beg leave to ask the Question * standing in my name on the Order Paper. In doing so, I declare an * interest as patron of the British Register of Chinese Herbal Medicine. * -- Hansard, 2010-02-01 */ #define SUPPORTED_TOKEN "com.example.rannoch/ChineseHerbalMedicine" /* Lord Hoyle: My Lords, in thanking my noble friend for his Answer, I declare * an interest as the chairman and now president of Warrington Wolves Rugby * League Club. -- Hansard, 2010-01-11 */ #define UNSUPPORTED_TOKEN "org.example.Warrington/Wolves" static void interested_connection_init (InterestedConnection *self G_GNUC_UNUSED) { } static void interested_connection_constructed (GObject *object) { TpBaseConnection *base = (TpBaseConnection *) object; void (*chain_up) (GObject *) = ((GObjectClass *) interested_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_base_connection_add_possible_client_interest (base, TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION); tp_base_connection_add_possible_client_interest (base, g_quark_from_static_string (SUPPORTED_TOKEN)); } static void interested_connection_class_init (InterestedConnectionClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; object_class->constructed = interested_connection_constructed; } typedef struct { TpDBusDaemon *dbus; DBusConnection *client_libdbus; DBusGConnection *client_dbusglib; TpDBusDaemon *client_bus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; gboolean cwr_ready; GError *cwr_error /* initialized in setup */; GAsyncResult *prepare_result; GPtrArray *log; } Test; static void connection_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { Test *test = user_data; g_message ("%p prepared", object); g_assert (test->prepare_result == NULL); test->prepare_result = g_object_ref (res); } static void interested_cb (TpBaseConnection *unused G_GNUC_UNUSED, const gchar *iface, Test *test) { g_ptr_array_add (test->log, g_strdup_printf ("interested in %s", iface)); } static void location_interested_cb (TpBaseConnection *unused G_GNUC_UNUSED, const gchar *iface, Test *test) { g_assert_cmpstr (iface, ==, TP_IFACE_CONNECTION_INTERFACE_LOCATION); g_ptr_array_add (test->log, g_strdup ("Location interested")); } static void uninterested_cb (TpBaseConnection *unused G_GNUC_UNUSED, const gchar *iface, Test *test) { g_ptr_array_add (test->log, g_strdup_printf ("uninterested in %s", iface)); } static void location_uninterested_cb (TpBaseConnection *unused G_GNUC_UNUSED, const gchar *iface, Test *test) { g_assert_cmpstr (iface, ==, TP_IFACE_CONNECTION_INTERFACE_LOCATION); g_ptr_array_add (test->log, g_strdup ("Location uninterested")); } static void setup (Test *test, gconstpointer data) { GError *error = NULL; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; tp_debug_set_flags ("all"); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->client_libdbus = dbus_bus_get_private (DBUS_BUS_STARTER, NULL); g_assert (test->client_libdbus != NULL); dbus_connection_setup_with_g_main (test->client_libdbus, NULL); dbus_connection_set_exit_on_disconnect (test->client_libdbus, FALSE); test->client_dbusglib = dbus_connection_get_g_connection ( test->client_libdbus); dbus_g_connection_ref (test->client_dbusglib); test->client_bus = tp_dbus_daemon_new (test->client_dbusglib); g_assert (test->client_bus != NULL); test->service_conn = tp_tests_object_new_static_class ( interested_connection_get_type (), "account", "me@example.com", "protocol", "simple-protocol", NULL); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (test->service_conn != NULL); g_assert (test->service_conn_as_base != NULL); g_assert (tp_base_connection_register (test->service_conn_as_base, "simple", &test->conn_name, &test->conn_path, &error)); g_assert_no_error (error); test->cwr_ready = FALSE; test->cwr_error = NULL; test->conn = tp_connection_new (test->client_bus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); tp_proxy_prepare_async (test->conn, features, connection_prepared_cb, test); g_assert (test->prepare_result == NULL); while (test->prepare_result == NULL) g_main_context_iteration (NULL, TRUE); g_assert (tp_proxy_prepare_finish (test->conn, test->prepare_result, &error)); g_assert_no_error (error); g_object_unref (test->prepare_result); test->prepare_result = NULL; test->log = g_ptr_array_new_with_free_func (g_free); g_signal_connect (test->service_conn, "clients-interested", G_CALLBACK (interested_cb), test); g_signal_connect (test->service_conn, "clients-interested::" TP_IFACE_CONNECTION_INTERFACE_LOCATION, G_CALLBACK (location_interested_cb), test); g_signal_connect (test->service_conn, "clients-uninterested", G_CALLBACK (uninterested_cb), test); g_signal_connect (test->service_conn, "clients-uninterested::" TP_IFACE_CONNECTION_INTERFACE_LOCATION, G_CALLBACK (location_uninterested_cb), test); } static void teardown (Test *test, gconstpointer data) { TpConnection *conn; GError *error = NULL; if (test->conn != NULL) { g_object_unref (test->conn); test->conn = NULL; } /* disconnect the connection so we don't leak it */ conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_assert (!tp_connection_run_until_ready (conn, FALSE, &error, NULL)); g_assert_error (error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&error); test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); g_object_unref (test->dbus); test->dbus = NULL; g_object_unref (test->client_bus); test->client_bus = NULL; dbus_g_connection_unref (test->client_dbusglib); dbus_connection_close (test->client_libdbus); dbus_connection_unref (test->client_libdbus); g_ptr_array_unref (test->log); } static void test_interested_client (Test *test, gconstpointer nil G_GNUC_UNUSED) { guint i; tp_connection_add_client_interest_by_id (test->conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION); tp_connection_add_client_interest_by_id (test->conn, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS); /* run until (after) the AddClientInterest calls have gone out */ tp_tests_proxy_run_until_dbus_queue_processed (test->client_bus); /* we auto-release the Location client interest by disposing the client * connection */ g_object_run_dispose ((GObject *) test->conn); g_object_unref (test->conn); test->conn = NULL; /* run until (after) the RemoveClientInterest call has gone out */ tp_tests_proxy_run_until_dbus_queue_processed (test->client_bus); /* then, run until (after) the CM should have processed both ACI and RCI */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); i = 0; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "interested in " TP_IFACE_CONNECTION_INTERFACE_LOCATION); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "Location interested"); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "uninterested in " TP_IFACE_CONNECTION_INTERFACE_LOCATION); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "Location uninterested"); i++; g_assert_cmpuint (test->log->len, ==, i); } static void test_interest (Test *test, gconstpointer nil G_GNUC_UNUSED) { static const gchar * telepathy[] = { TP_IFACE_CONNECTION_INTERFACE_LOCATION, TP_IFACE_CONNECTION_INTERFACE_AVATARS, NULL }; static const gchar * hansard[] = { SUPPORTED_TOKEN, UNSUPPORTED_TOKEN, NULL }; GError *error = NULL; guint i; tp_cli_connection_run_add_client_interest (test->conn, -1, telepathy, &error, NULL); g_assert_no_error (error); tp_cli_connection_run_add_client_interest (test->conn, -1, hansard, &error, NULL); g_assert_no_error (error); tp_cli_connection_run_add_client_interest (test->conn, -1, telepathy, &error, NULL); g_assert_no_error (error); tp_cli_connection_run_remove_client_interest (test->conn, -1, telepathy, &error, NULL); g_assert_no_error (error); tp_cli_connection_run_remove_client_interest (test->conn, -1, hansard, &error, NULL); g_assert_no_error (error); /* we auto-release the Location client interest by dropping the client * connection */ dbus_connection_flush (test->client_libdbus); dbus_connection_close (test->client_libdbus); while (test->log->len < 6) g_main_context_iteration (NULL, TRUE); i = 0; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "interested in " TP_IFACE_CONNECTION_INTERFACE_LOCATION); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "Location interested"); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "interested in " SUPPORTED_TOKEN); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "uninterested in " SUPPORTED_TOKEN); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "uninterested in " TP_IFACE_CONNECTION_INTERFACE_LOCATION); i++; g_assert_cmpuint (test->log->len, >, i); g_assert_cmpstr (g_ptr_array_index (test->log, i), ==, "Location uninterested"); i++; g_assert_cmpuint (test->log->len, ==, i); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_add ("/conn/interest", Test, NULL, setup, test_interest, teardown); g_test_add ("/conn/interested-client", Test, NULL, setup, test_interested_client, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/simple-approver.c0000644000175000017500000003371412652510705017035 00000000000000/* Tests of TpSimpleApprover * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/simple-channel-dispatch-operation.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseClient *simple_approver; TpBaseConnection *base_connection; TpTestsSimpleAccount *account_service; TpTestsTextChannelNull *text_chan_service; TpTestsSimpleChannelDispatchOperation *cdo_service; /* Client side objects */ TpClient *client; TpConnection *connection; TpAccount *account; TpAccountManager *account_manager; TpChannel *text_chan; GError *error /* initialized where needed */; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" #define CDO_PATH "/whatever" static void setup (Test *test, gconstpointer data) { gchar *chan_path; TpHandle handle; TpHandleRepoIface *contact_repo; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Claim AccountManager bus-name (needed as we're going to export an Account * object). */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create service-side Account object */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); test->account_manager = tp_account_manager_new (test->dbus); g_assert (test->account_manager != NULL); /* Create client-side Account object */ test->account = tp_account_manager_ensure_account (test->account_manager, ACCOUNT_PATH); g_assert (test->account != NULL); g_object_ref (test->account); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create service-side text channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); /* Create Service side ChannelDispatchOperation object */ test->cdo_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, NULL); tp_dbus_daemon_register_object (test->dbus, CDO_PATH, test->cdo_service); tp_tests_simple_channel_dispatch_operation_set_conn_path (test->cdo_service, tp_proxy_get_object_path (test->connection)); tp_tests_simple_channel_dispatch_operation_set_account_path ( test->cdo_service, tp_proxy_get_object_path (test->account)); tp_tests_simple_channel_dispatch_operation_add_channel (test->cdo_service, test->text_chan); g_assert (tp_dbus_daemon_request_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL)); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_dbus_daemon_release_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); g_object_unref (test->simple_approver); g_object_unref (test->client); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_object_unref (test->account_service); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; g_object_unref (test->account); g_object_unref (test->text_chan_service); g_object_unref (test->text_chan); g_object_unref (test->cdo_service); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); } static void create_simple_approver (Test *test, TpSimpleApproverAddDispatchOperationImpl impl) { /* Create service-side Client object */ test->simple_approver = tp_simple_approver_new_with_am ( test->account_manager, "MySimpleApprover", FALSE, impl, test, NULL); g_assert (test->simple_approver != NULL); /* Create client-side Client object */ test->client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", test->dbus, "bus-name", tp_base_client_get_bus_name (test->simple_approver), "object-path", tp_base_client_get_object_path (test->simple_approver), NULL); g_assert (test->client != NULL); } static void get_client_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; const gchar * const *interfaces; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); interfaces = tp_asv_get_strv (properties, "Interfaces"); g_assert_cmpint (g_strv_length ((GStrv) interfaces), ==, 1); g_assert (tp_strv_contains (interfaces, TP_IFACE_CLIENT_APPROVER)); out: g_main_loop_quit (test->mainloop); } static void check_filters (GPtrArray *filters) { GHashTable *filter; g_assert (filters != NULL); g_assert_cmpuint (filters->len, ==, 2); filter = g_ptr_array_index (filters, 0); g_assert_cmpuint (g_hash_table_size (filter), ==, 1); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); filter = g_ptr_array_index (filters, 1); g_assert_cmpuint (g_hash_table_size (filter), ==, 2); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); g_assert_cmpuint (tp_asv_get_uint32 (filter, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); } static void get_approver_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); filters = tp_asv_get_boxed (properties, "ApproverChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); out: g_main_loop_quit (test->mainloop); } static void add_dispatch_success ( TpSimpleApprover *approver, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context, gpointer user_data) { tp_add_dispatch_operation_context_accept (context); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_approver (test, add_dispatch_success); tp_base_client_add_approver_filter_vardict (test->simple_approver, g_variant_new_parsed ("{ %s: <%s> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT)); tp_base_client_add_approver_filter_vardict (test->simple_approver, g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT)); tp_base_client_register (test->simple_approver, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Check Approver properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_APPROVER, get_approver_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void no_return_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_error (&test->error); if (error != NULL) { test->error = g_error_copy (error); goto out; } out: g_main_loop_quit (test->mainloop); } static void add_channel_to_ptr_array (GPtrArray *arr, TpChannel *channel) { GValueArray *tmp; g_assert (arr != NULL); g_assert (channel != NULL); tmp = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, tp_channel_borrow_immutable_properties ( channel), G_TYPE_INVALID); g_ptr_array_add (arr, tmp); } static void free_channel_details (gpointer data, gpointer user_data) { g_boxed_free (TP_STRUCT_TYPE_CHANNEL_DETAILS, data); } static void call_add_dispatch (Test *test) { GPtrArray *channels; GHashTable *properties; static const char *interfaces[] = { NULL }; static const gchar *possible_handlers[] = { TP_CLIENT_BUS_NAME_BASE ".Badger", NULL, }; channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->text_chan); properties = tp_asv_new ( TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->connection), TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->account), TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS, G_TYPE_STRV, possible_handlers, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_APPROVER); tp_cli_client_approver_call_add_dispatch_operation (test->client, -1, channels, CDO_PATH, properties, no_return_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_hash_table_unref (properties); } /* AddDispatchOperation returns immediately */ static void test_success (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_approver (test, add_dispatch_success); tp_base_client_add_approver_filter_vardict (test->simple_approver, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_approver, &test->error); g_assert_no_error (test->error); call_add_dispatch (test); g_assert_no_error (test->error); } /* AddDispatchOperation returns in an async way */ static gboolean accept_idle_cb (gpointer data) { TpAddDispatchOperationContext *context = data; tp_add_dispatch_operation_context_accept (context); g_object_unref (context); return FALSE; } static void add_dispatch_async ( TpSimpleApprover *approver, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context, gpointer user_data) { Test *test = user_data; g_idle_add (accept_idle_cb, g_object_ref (context)); g_assert (account == test->account); tp_add_dispatch_operation_context_delay (context); } static void test_delayed (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_approver (test, add_dispatch_async); tp_base_client_add_approver_filter_vardict (test->simple_approver, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_approver, &test->error); g_assert_no_error (test->error); call_add_dispatch (test); g_assert_no_error (test->error); } /* AddDispatchOperation fails */ static void add_dispatch_fail ( TpSimpleApprover *approver, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context, gpointer user_data) { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No AddDispatchOperation for you!" }; tp_add_dispatch_operation_context_fail (context, &error); } static void test_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_approver (test, add_dispatch_fail); tp_base_client_add_approver_filter_vardict (test->simple_approver, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_approver, &test->error); g_assert_no_error (test->error); call_add_dispatch (test); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/simple-/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/simple-approver/success", Test, NULL, setup, test_success, teardown); g_test_add ("/simple-approver/delayed", Test, NULL, setup, test_delayed, teardown); g_test_add ("/simple-approver/fail", Test, NULL, setup, test_fail, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/long-connection-name.c0000644000175000017500000000417312652510705017717 00000000000000/* Test support for shortening connection service names. * * Copyright (C) 2007-2009 Collabora Ltd. * Copyright (C) 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/echo-chan.h" #include "tests/lib/echo-conn.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" /* 256 characters */ #define LONG_ACCOUNT_IS_LONG \ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" \ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" \ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" \ "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsEchoConnection *service_conn; TpBaseConnection *service_conn_as_base; GError *error = NULL; gchar *name; gchar *conn_path; tp_tests_abort_after (10); dbus = tp_tests_dbus_daemon_dup_or_die (); MYASSERT (strlen (LONG_ACCOUNT_IS_LONG) == 256, ""); service_conn = TP_TESTS_ECHO_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CONNECTION, "account", LONG_ACCOUNT_IS_LONG, "protocol", "example", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "example", &name, &conn_path, &error), ""); g_assert_no_error (error); /* Name is too long to be used unmodified; check that it's shortened to 255 * characters. */ MYASSERT (strlen (name) == 255, ""); g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); return 0; } telepathy-glib-0.24.2/tests/dbus/account.c0000644000175000017500000010300314004031760015321 00000000000000/* A very basic feature test for TpAccount * * Copyright (C) 2009-2012 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/simple-account.h" #include "tests/lib/util.h" #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" #define SUPERSEDED_PATH TP_ACCOUNT_OBJECT_PATH_BASE "super/seded/whatever" static void test_parse_failure (gconstpointer test_data) { GError *error = NULL; g_assert (!tp_account_parse_object_path (test_data, NULL, NULL, NULL, &error)); g_assert (error != NULL); g_error_free (error); } typedef struct { const gchar *path; const gchar *cm; const gchar *protocol; const gchar *account_id; } TestParseData; static TestParseData * test_parse_data_new (const gchar *path, const gchar *cm, const gchar *protocol, const gchar *account_id) { TestParseData *t = g_slice_new (TestParseData); t->path = path; t->cm = cm; t->protocol = protocol; t->account_id = account_id; return t; } static void test_parse_success (gconstpointer test_data) { TestParseData *t = (TestParseData *) test_data; gchar *cm, *protocol, *account_id; GError *error = NULL; g_assert (tp_account_parse_object_path (t->path, &cm, &protocol, &account_id, &error)); g_assert_no_error (error); g_assert_cmpstr (cm, ==, t->cm); g_assert_cmpstr (protocol, ==, t->protocol); g_assert_cmpstr (account_id, ==, t->account_id); g_free (cm); g_free (protocol); g_free (account_id); g_slice_free (TestParseData, t); } typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpAccount *account; gulong notify_id; /* g_strdup (property name) => GUINT_TO_POINTER (counter) */ GHashTable *times_notified; GAsyncResult *result; GError *error /* initialized where needed */; /* initialized in prepare_service */ TpTestsSimpleAccount *account_service; TpBaseConnection *conn1_service; TpBaseConnection *conn2_service; TpConnection *conn1; TpConnection *conn2; } Test; static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); g_assert (test->dbus != NULL); test->account = NULL; test->times_notified = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } static void setup_service (Test *test, gconstpointer data) { setup (test, data); tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); test->account_service = g_object_new (TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "what@ever", &test->conn1_service, &test->conn1); tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "what2@ever", &test->conn2_service, &test->conn2); } static guint test_get_times_notified (Test *test, const gchar *property) { return GPOINTER_TO_UINT (g_hash_table_lookup (test->times_notified, property)); } static void test_notify_cb (Test *test, GParamSpec *pspec, TpAccount *account) { guint counter = test_get_times_notified (test, pspec->name); g_hash_table_insert (test->times_notified, g_strdup (pspec->name), GUINT_TO_POINTER (++counter)); } static void test_set_up_account_notify (Test *test) { g_assert (test->account != NULL); g_hash_table_remove_all (test->times_notified); if (test->notify_id != 0) { g_signal_handler_disconnect (test->account, test->notify_id); } test->notify_id = g_signal_connect_swapped (test->account, "notify", G_CALLBACK (test_notify_cb), test); } static void teardown (Test *test, gconstpointer data) { if (test->account != NULL) { tp_tests_proxy_run_until_dbus_queue_processed (test->account); if (test->notify_id != 0) { g_signal_handler_disconnect (test->account, test->notify_id); } g_object_unref (test->account); test->account = NULL; } g_hash_table_unref (test->times_notified); test->times_notified = NULL; /* make sure any pending calls on the account have happened, so it can die */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; g_clear_error (&test->error); tp_clear_object (&test->result); } static void teardown_service (Test *test, gconstpointer data) { tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_clear_object (&test->account_service); tp_tests_connection_assert_disconnect_succeeds (test->conn1); g_clear_object (&test->conn1); g_clear_object (&test->conn1_service); tp_tests_connection_assert_disconnect_succeeds (test->conn2); g_clear_object (&test->conn2); g_clear_object (&test->conn2_service); teardown (test, data); } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { test->account = tp_account_new (test->dbus, "/secretly/not/an/object", NULL); g_assert (test->account == NULL); test->account = tp_account_new (test->dbus, "not even syntactically valid", NULL); g_assert (test->account == NULL); test->account = tp_account_new (test->dbus, "/org/freedesktop/Telepathy/Account/what/ev/er", NULL); g_assert (test->account != NULL); } static void test_setters (Test *test, gconstpointer data G_GNUC_UNUSED) { test->account = tp_account_new (test->dbus, "/org/freedesktop/Telepathy/Account/what/ev/er", NULL); g_assert (test->account != NULL); tp_account_set_enabled_async (test->account, TRUE, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); tp_account_set_enabled_finish (test->account, test->result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); g_clear_error (&test->error); tp_clear_object (&test->result); } static void test_reconnect (Test *test, gconstpointer data) { GStrv reconnect_required; const gchar *unset[] = { "unset", NULL }; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); if (!tp_strdiff (data, "vardict")) { tp_account_update_parameters_vardict_async (test->account, g_variant_new_parsed ("{ 'set': <%s> }", "value"), unset, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); tp_account_update_parameters_vardict_finish (test->account, test->result, &reconnect_required, &test->error); } else { GHashTable *set = tp_asv_new ( "set", G_TYPE_STRING, "value", NULL); tp_account_update_parameters_async (test->account, set, unset, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); tp_account_update_parameters_finish (test->account, test->result, &reconnect_required, &test->error); g_hash_table_unref (set); } g_assert_no_error (test->error); /* check that reconnect_required survives longer than result */ tp_clear_object (&test->result); g_assert (reconnect_required != NULL); g_assert_cmpstr (reconnect_required[0], ==, "set"); g_assert_cmpstr (reconnect_required[1], ==, "unset"); g_assert_cmpstr (reconnect_required[2], ==, NULL); g_strfreev (reconnect_required); tp_account_reconnect_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); tp_account_reconnect_finish (test->account, test->result, &test->error); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED); g_clear_error (&test->error); tp_clear_object (&test->result); } static void account_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; GError *error = NULL; tp_proxy_prepare_finish (source, result, &error); g_assert_no_error (error); g_main_loop_quit (test->mainloop); } #define assert_strprop(self, prop, val) \ {\ gchar *_s; \ \ g_object_get (self, \ prop, &_s, \ NULL); \ g_assert_cmpstr (_s, ==, val);\ g_free (_s); \ } #define assert_uintprop(self, prop, val) \ {\ guint _u; \ \ g_object_get (self, \ prop, &_u, \ NULL); \ g_assert_cmpuint (_u, ==, val);\ } #define assert_boolprop(self, prop, val) \ {\ gboolean _b; \ \ g_object_get (self, \ prop, &_b, \ NULL); \ g_assert_cmpint (_b, ==, val);\ } static void test_prepare_success (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark account_features[] = { TP_ACCOUNT_FEATURE_CORE, 0 }; TpConnectionStatusReason reason; gchar *status = NULL; gchar *message = NULL; const GHashTable *details = GUINT_TO_POINTER (666); GStrv strv; const gchar * const *cstrv; GVariant *variant; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); tp_proxy_prepare_async (test->account, account_features, account_prepare_cb, test); g_main_loop_run (test->mainloop); /* the obvious accessors */ g_assert (tp_proxy_is_prepared (test->account, TP_ACCOUNT_FEATURE_CORE)); g_assert (tp_account_is_enabled (test->account)); assert_boolprop (test->account, "enabled", TRUE); g_assert (tp_account_is_valid (test->account)); assert_boolprop (test->account, "valid", TRUE); g_assert_cmpstr (tp_account_get_display_name (test->account), ==, "Fake Account"); assert_strprop (test->account, "display-name", "Fake Account"); g_assert_cmpstr (tp_account_get_nickname (test->account), ==, "badger"); assert_strprop (test->account, "nickname", "badger"); g_assert_cmpuint (tp_asv_size (tp_account_get_parameters (test->account)), ==, 0); variant = tp_account_dup_parameters_vardict (test->account); g_assert_cmpstr (g_variant_get_type_string (variant), ==, "a{sv}"); g_assert_cmpuint (g_variant_n_children (variant), ==, 0); g_variant_unref (variant); g_assert (!tp_account_get_connect_automatically (test->account)); assert_boolprop (test->account, "connect-automatically", FALSE); g_assert (tp_account_get_has_been_online (test->account)); assert_boolprop (test->account, "has-been-online", TRUE); g_assert_cmpint (tp_account_get_connection_status (test->account, NULL), ==, TP_CONNECTION_STATUS_CONNECTED); assert_uintprop (test->account, "connection-status", TP_CONNECTION_STATUS_CONNECTED); g_assert_cmpint (tp_account_get_connection_status (test->account, &reason), ==, TP_CONNECTION_STATUS_CONNECTED); g_assert_cmpint (reason, ==, TP_CONNECTION_STATUS_REASON_REQUESTED); assert_uintprop (test->account, "connection-status-reason", TP_CONNECTION_STATUS_REASON_REQUESTED); g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==, NULL); assert_strprop (test->account, "connection-error", NULL); g_assert_cmpstr (tp_account_get_detailed_error (test->account, &details), ==, NULL); /* this is documented to be untouched */ g_assert_cmpuint (GPOINTER_TO_UINT (details), ==, 666); /* the CM and protocol come from the object path */ g_assert_cmpstr (tp_account_get_cm_name (test->account), ==, "what"); assert_strprop (test->account, "cm-name", "what"); g_assert_cmpstr (tp_account_get_protocol_name (test->account), ==, "ev"); assert_strprop (test->account, "protocol-name", "ev"); /* the icon name in SimpleAccount is "", so we guess based on the protocol */ g_assert_cmpstr (tp_account_get_icon_name (test->account), ==, "im-ev"); assert_strprop (test->account, "icon-name", "im-ev"); /* RequestedPresence */ g_assert_cmpint (tp_account_get_requested_presence (test->account, NULL, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); assert_uintprop (test->account, "requested-presence-type", TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpint (tp_account_get_requested_presence (test->account, &status, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (status, ==, "requesting"); g_free (status); assert_strprop (test->account, "requested-status", "requesting"); g_assert_cmpint (tp_account_get_requested_presence (test->account, NULL, &message), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (message, ==, "this is my RequestedPresence"); g_free (message); assert_strprop (test->account, "requested-status-message", "this is my RequestedPresence"); /* CurrentPresence */ g_assert_cmpint (tp_account_get_current_presence (test->account, NULL, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); assert_uintprop (test->account, "current-presence-type", TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpint (tp_account_get_current_presence (test->account, &status, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (status, ==, "currently-away"); g_free (status); assert_strprop (test->account, "current-status", "currently-away"); g_assert_cmpint (tp_account_get_current_presence (test->account, NULL, &message), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (message, ==, "this is my CurrentPresence"); g_free (message); assert_strprop (test->account, "current-status-message", "this is my CurrentPresence"); /* AutomaticPresence */ g_assert_cmpint (tp_account_get_automatic_presence (test->account, NULL, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); assert_uintprop (test->account, "automatic-presence-type", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpint (tp_account_get_automatic_presence (test->account, &status, NULL), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (status, ==, "automatically-available"); g_free (status); assert_strprop (test->account, "automatic-status", "automatically-available"); g_assert_cmpint (tp_account_get_automatic_presence (test->account, NULL, &message), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (message, ==, "this is my AutomaticPresence"); g_free (message); assert_strprop (test->account, "automatic-status-message", "this is my AutomaticPresence"); /* NormalizedName */ g_assert_cmpstr (tp_account_get_normalized_name (test->account), ==, "bob.mcbadgers@example.com"); assert_strprop (test->account, "normalized-name", "bob.mcbadgers@example.com"); g_object_get (test->account, "supersedes", &strv, NULL); g_assert_cmpstr (strv[0], ==, SUPERSEDED_PATH); g_assert_cmpstr (strv[1], ==, NULL); g_strfreev (strv); cstrv = tp_account_get_supersedes (test->account); g_assert_cmpstr (cstrv[0], ==, SUPERSEDED_PATH); g_assert_cmpstr (cstrv[1], ==, NULL); } static void test_storage (Test *test, gconstpointer mode) { GQuark account_features[] = { TP_ACCOUNT_FEATURE_STORAGE, 0 }; GValue *gvalue; GVariant *gvariant; GHashTable *info; GError *error = NULL; gboolean found; gint32 i; guint32 u; const gchar *s; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); if (g_str_equal (mode, "later")) { /* prepare the core feature first */ tp_proxy_prepare_async (test->account, NULL, account_prepare_cb, test); g_main_loop_run (test->mainloop); /* storage stuff doesn't work yet */ g_assert_cmpstr (tp_account_get_storage_provider (test->account), ==, NULL); assert_strprop (test->account, "storage-provider", NULL); g_assert (tp_account_get_storage_identifier (test->account) == NULL); g_object_get (test->account, "storage-identifier", &gvalue, NULL); g_assert (gvalue == NULL); g_assert (tp_account_get_storage_identifier (test->account) == NULL); g_object_get (test->account, "storage-identifier", &gvariant, NULL); g_assert (gvariant == NULL); g_assert_cmpuint (tp_account_get_storage_restrictions (test->account), ==, 0); assert_uintprop (test->account, "storage-restrictions", 0); } /* prepare the storage feature */ tp_proxy_prepare_async (test->account, account_features, account_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert_cmpstr (tp_account_get_storage_provider (test->account), ==, "org.freedesktop.Telepathy.glib.test"); assert_strprop (test->account, "storage-provider", "org.freedesktop.Telepathy.glib.test"); g_assert_cmpstr ( g_value_get_string (tp_account_get_storage_identifier (test->account)), ==, "unique-identifier"); g_object_get (test->account, "storage-identifier", &gvalue, NULL); g_assert_cmpstr (g_value_get_string (gvalue), ==, "unique-identifier"); g_boxed_free (G_TYPE_VALUE, gvalue); gvariant = tp_account_dup_storage_identifier_variant (test->account); g_assert_cmpstr (g_variant_get_type_string (gvariant), ==, "s"); g_assert_cmpstr (g_variant_get_string (gvariant, NULL), ==, "unique-identifier"); g_variant_unref (gvariant); g_object_get (test->account, "storage-identifier-variant", &gvariant, NULL); g_assert_cmpstr (g_variant_get_type_string (gvariant), ==, "s"); g_assert_cmpstr (g_variant_get_string (gvariant, NULL), ==, "unique-identifier"); g_variant_unref (gvariant); g_assert_cmpuint (tp_account_get_storage_restrictions (test->account), ==, TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED | TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS); assert_uintprop (test->account, "storage-restrictions", TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED | TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_PARAMETERS); /* request the StorageSpecificProperties hash */ tp_account_get_storage_specific_information_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); info = tp_account_get_storage_specific_information_finish ( test->account, test->result, &error); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (info), ==, 3); g_assert_cmpint (tp_asv_get_int32 (info, "one", NULL), ==, 1); g_assert_cmpuint (tp_asv_get_uint32 (info, "two", NULL), ==, 2); g_assert_cmpstr (tp_asv_get_string (info, "marco"), ==, "polo"); tp_clear_object (&test->result); /* the same, but with 100% more GVariant */ tp_account_dup_storage_specific_information_vardict_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); gvariant = tp_account_dup_storage_specific_information_vardict_finish ( test->account, test->result, &error); g_assert_no_error (error); g_assert_cmpstr (g_variant_get_type_string (gvariant), ==, "a{sv}"); found = g_variant_lookup (gvariant, "one", "i", &i); g_assert (found); g_assert_cmpint (i, ==, 1); found = g_variant_lookup (gvariant, "two", "u", &u); g_assert (found); g_assert_cmpint (u, ==, 2); found = g_variant_lookup (gvariant, "marco", "&s", &s); g_assert (found); g_assert_cmpstr (s, ==, "polo"); found = g_variant_lookup (gvariant, "barisione", "&s", &s); g_assert (!found); g_variant_unref (gvariant); tp_clear_object (&test->result); } static void check_uri_schemes (const gchar * const * schemes) { g_assert (schemes != NULL); g_assert (tp_strv_contains (schemes, "about")); g_assert (tp_strv_contains (schemes, "telnet")); g_assert (schemes[2] == NULL); } static void notify_cb (GObject *object, GParamSpec *spec, Test *test) { g_main_loop_quit (test->mainloop); } static void test_addressing (Test *test, gconstpointer mode) { GQuark account_features[] = { TP_ACCOUNT_FEATURE_ADDRESSING, 0 }; const gchar * const *schemes; GStrv tmp; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); if (g_str_equal (mode, "later")) { /* prepare the core feature first */ tp_proxy_prepare_async (test->account, NULL, account_prepare_cb, test); g_main_loop_run (test->mainloop); /* addressing stuff doesn't work yet */ g_assert (tp_account_get_uri_schemes (test->account) == NULL); g_assert (!tp_account_associated_with_uri_scheme (test->account, "about")); g_assert (!tp_account_associated_with_uri_scheme (test->account, "telnet")); g_assert (!tp_account_associated_with_uri_scheme (test->account, "xmpp")); } /* prepare the addressing feature */ tp_proxy_prepare_async (test->account, account_features, account_prepare_cb, test); g_main_loop_run (test->mainloop); schemes = tp_account_get_uri_schemes (test->account); check_uri_schemes (schemes); g_object_get (test->account, "uri-schemes", &tmp, NULL); check_uri_schemes ((const gchar * const *) tmp); g_strfreev (tmp); g_assert (tp_account_associated_with_uri_scheme (test->account, "about")); g_assert (tp_account_associated_with_uri_scheme (test->account, "telnet")); g_assert (!tp_account_associated_with_uri_scheme (test->account, "xmpp")); g_signal_connect (test->account, "notify::uri-schemes", G_CALLBACK (notify_cb), test); tp_tests_simple_account_add_uri_scheme (test->account_service, "xmpp"); g_main_loop_run (test->mainloop); g_assert (tp_account_associated_with_uri_scheme (test->account, "xmpp")); } static void avatar_changed_cb (TpAccount *account, Test *test) { g_main_loop_quit (test->mainloop); } static void test_avatar (Test *test, gconstpointer mode) { const GArray *blob; GError *error = NULL; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); tp_proxy_prepare_async (test->account, NULL, account_prepare_cb, test); g_main_loop_run (test->mainloop); tp_account_get_avatar_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); blob = tp_account_get_avatar_finish ( test->account, test->result, &error); g_assert_no_error (error); g_assert_cmpuint (blob->len, ==, 4); g_assert_cmpstr (((char *) blob->data), ==, ":-)"); tp_clear_object (&test->result); /* change the avatar */ g_signal_connect (test->account, "avatar-changed", G_CALLBACK (avatar_changed_cb), test); tp_tests_simple_account_set_avatar (test->account_service, ":-("); g_main_loop_run (test->mainloop); tp_account_get_avatar_async (test->account, tp_tests_result_ready_cb, &test->result); tp_tests_run_until_result (&test->result); blob = tp_account_get_avatar_finish ( test->account, test->result, &error); g_assert_no_error (error); g_assert (blob != NULL); g_assert_cmpuint (blob->len, ==, 4); g_assert_cmpstr (((char *) blob->data), ==, ":-("); tp_clear_object (&test->result); } static void test_connection (Test *test, gconstpointer data G_GNUC_UNUSED) { const gchar *conn1_path = tp_proxy_get_object_path (test->conn1); const gchar *conn2_path = tp_proxy_get_object_path (test->conn2); GQuark account_features[] = { TP_ACCOUNT_FEATURE_CORE, 0 }; GHashTable *change = tp_asv_new (NULL, NULL); TpConnection *conn; const GHashTable *details; GVariant *details_v; gboolean found; gchar *s; guint32 u; test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); tp_proxy_prepare_async (test->account, account_features, account_prepare_cb, test); g_main_loop_run (test->mainloop); g_assert (tp_proxy_is_prepared (test->account, TP_ACCOUNT_FEATURE_CORE)); /* a connection turns up */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", conn1_path); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_CONNECTING); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_REQUESTED); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); while (test_get_times_notified (test, "connection") < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); conn = tp_account_get_connection (test->account); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==, TP_ERROR_STR_CANCELLED); /* ensure the same connection - no change notification */ test_set_up_account_notify (test); conn = tp_account_ensure_connection (test->account, conn1_path); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 0); /* a no-op "change" */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", conn1_path); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_CONNECTING); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_REQUESTED); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); tp_tests_proxy_run_until_dbus_queue_processed (test->account); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 0); conn = tp_account_get_connection (test->account); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 0); /* atomically flip from one connection to another (unlikely) */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", conn2_path); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_CONNECTED); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_REQUESTED); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); while (test_get_times_notified (test, "connection") < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); conn = tp_account_get_connection (test->account); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn2_path); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); /* no more connection for you */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", "/"); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_DISCONNECTED); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); while (test_get_times_notified (test, "connection") < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); conn = tp_account_get_connection (test->account); g_assert (conn == NULL); g_assert_cmpstr (tp_account_get_detailed_error (test->account, NULL), ==, TP_ERROR_STR_ENCRYPTION_ERROR); /* another connection */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", conn1_path); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_CONNECTING); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_REQUESTED); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); tp_tests_proxy_run_until_dbus_queue_processed (test->account); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); /* lose the connection again */ test_set_up_account_notify (test); tp_asv_set_object_path (change, "Connection", "/"); tp_asv_set_uint32 (change, "ConnectionStatus", TP_CONNECTION_STATUS_DISCONNECTED); tp_asv_set_uint32 (change, "ConnectionStatusReason", TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR); tp_asv_set_static_string (change, "ConnectionError", "org.debian.packages.OpenSSL.NotRandomEnough"); tp_asv_take_boxed (change, "ConnectionErrorDetails", TP_HASH_TYPE_STRING_VARIANT_MAP, tp_asv_new ( "bits-of-entropy", G_TYPE_UINT, 15, "debug-message", G_TYPE_STRING, "shiiiiii-", NULL)); tp_svc_account_emit_account_property_changed (test->account_service, change); g_hash_table_remove_all (change); tp_tests_proxy_run_until_dbus_queue_processed (test->account); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); g_assert_cmpuint (test_get_times_notified (test, "connection-error"), ==, 1); g_assert_cmpstr (tp_account_get_detailed_error (test->account, &details), ==, "org.debian.packages.OpenSSL.NotRandomEnough"); g_assert_cmpuint (tp_asv_size (details), >=, 2); g_assert_cmpstr (tp_asv_get_string (details, "debug-message"), ==, "shiiiiii-"); g_assert_cmpuint (tp_asv_get_uint32 (details, "bits-of-entropy", NULL), ==, 15); s = tp_account_dup_detailed_error_vardict (test->account, &details_v); g_assert_cmpstr (s, ==, "org.debian.packages.OpenSSL.NotRandomEnough"); g_free (s); g_assert_cmpuint (g_variant_n_children (details_v), >=, 2); g_assert_cmpstr (g_variant_get_type_string (details_v), ==, "a{sv}"); found = g_variant_lookup (details_v, "debug-message", "s", &s); g_assert (found); g_assert_cmpstr (s, ==, "shiiiiii-"); g_free (s); found = g_variant_lookup (details_v, "bits-of-entropy", "u", &u); g_assert (found); g_assert_cmpint (u, ==, 15); g_variant_unref (details_v); /* staple on a Connection (this is intended for use in e.g. observers, * if they're told about a Connection that the Account hasn't told them * about yet) */ test_set_up_account_notify (test); conn = tp_account_ensure_connection (test->account, conn1_path); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, conn1_path); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); g_hash_table_unref (change); } int main (int argc, char **argv) { tp_tests_abort_after (10); tp_debug_set_flags ("all"); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add_data_func ("/account/parse/spaces", "this is not an object path", test_parse_failure); g_test_add_data_func ("/account/parse/no-prefix", "/this/is/not/an/account/path", test_parse_failure); g_test_add_data_func ("/account/parse/too-few-components", "/org/freedesktop/Telepathy/Account/wrong", test_parse_failure); g_test_add_data_func ("/account/parse/too-many-components", "/org/freedesktop/Telepathy/Account/a/b/c/d", test_parse_failure); g_test_add_data_func ("/account/parse/illegal-components", "/org/freedesktop/Telepathy/Account/1/2/3", test_parse_failure); g_test_add_data_func ("/account/parse/legal", test_parse_data_new ( TP_ACCOUNT_OBJECT_PATH_BASE "gabble/jabber/badgers", "gabble", "jabber", "badgers"), test_parse_success); g_test_add_data_func ("/account/parse/hyphenated-protocol", test_parse_data_new ( TP_ACCOUNT_OBJECT_PATH_BASE "salut/local_xmpp/badgers", "salut", "local-xmpp", "badgers"), test_parse_success); g_test_add_data_func ("/account/parse/wrongly-escaped-protocol", test_parse_data_new ( TP_ACCOUNT_OBJECT_PATH_BASE "salut/local_2dxmpp/badgers", "salut", "local-xmpp", "badgers"), test_parse_success); g_test_add_data_func ("/account/parse/wrongly-escaped-corner-case", test_parse_data_new ( TP_ACCOUNT_OBJECT_PATH_BASE "salut/local_2d/badgers", "salut", "local-", "badgers"), test_parse_success); g_test_add_data_func ("/account/parse/underscored-account", test_parse_data_new ( TP_ACCOUNT_OBJECT_PATH_BASE "haze/msn/_thisseemsunlikely", "haze", "msn", "_thisseemsunlikely"), test_parse_success); g_test_add ("/account/new", Test, NULL, setup, test_new, teardown); g_test_add ("/account/setters", Test, NULL, setup_service, test_setters, teardown_service); g_test_add ("/account/reconnect", Test, NULL, setup_service, test_reconnect, teardown_service); g_test_add ("/account/reconnect/vardict", Test, "vardict", setup_service, test_reconnect, teardown_service); g_test_add ("/account/prepare/success", Test, NULL, setup_service, test_prepare_success, teardown_service); g_test_add ("/account/connection", Test, NULL, setup_service, test_connection, teardown_service); g_test_add ("/account/storage", Test, "first", setup_service, test_storage, teardown_service); g_test_add ("/account/storage/later", Test, "later", setup_service, test_storage, teardown_service); g_test_add ("/account/avatar", Test, NULL, setup_service, test_avatar, teardown_service); g_test_add ("/account/addressing", Test, "first", setup_service, test_addressing, teardown_service); g_test_add ("/account/addressing/later", Test, "later", setup_service, test_addressing, teardown_service); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/dbus-1/0000755000175000017500000000000014006623343014705 500000000000000telepathy-glib-0.24.2/tests/dbus/dbus-1/services/0000755000175000017500000000000014006623343016530 500000000000000telepathy-glib-0.24.2/tests/dbus/dbus-1/services/spurious.service0000644000175000017500000000013212652510705021721 00000000000000[D-BUS Service] Name=org.freedesktop.Telepathy.ConnectionManager.spurious Exec=/bin/false telepathy-glib-0.24.2/tests/dbus/dbus.c0000644000175000017500000002757312652510705014653 00000000000000#include "config.h" #include #include #include #include #include #include "tests/lib/util.h" static void test_validation (void) { g_assert (tp_dbus_check_valid_object_path ("/", NULL)); g_assert (tp_dbus_check_valid_object_path ("/a", NULL)); g_assert (tp_dbus_check_valid_object_path ("/foo", NULL)); g_assert (!tp_dbus_check_valid_object_path ("//", NULL)); g_assert (!tp_dbus_check_valid_object_path ("/a//b", NULL)); g_assert (tp_dbus_check_valid_object_path ("/a/b", NULL)); g_assert (!tp_dbus_check_valid_object_path ("/a/b/", NULL)); g_assert (!tp_dbus_check_valid_object_path ("a/b", NULL)); g_assert (!tp_dbus_check_valid_object_path ("/*a", NULL)); #define TEST_LONG_BIT "excessively.long.name.longer.than._255.characters" #define TEST_LONG (TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT \ TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT TEST_LONG_BIT) g_assert (!tp_dbus_check_valid_member_name ("", NULL)); g_assert (!tp_dbus_check_valid_member_name ("123abc", NULL)); g_assert (!tp_dbus_check_valid_member_name ("a.b", NULL)); g_assert (!tp_dbus_check_valid_member_name ("a*b", NULL)); g_assert (tp_dbus_check_valid_member_name ("example", NULL)); g_assert (tp_dbus_check_valid_member_name ("_1", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("", NULL)); g_assert (!tp_dbus_check_valid_interface_name (TEST_LONG, NULL)); g_assert (!tp_dbus_check_valid_interface_name ("hasnodot", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("123abc.example", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("com.1", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("com.e*ample", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("com..example", NULL)); g_assert (!tp_dbus_check_valid_interface_name (".com.example", NULL)); g_assert (!tp_dbus_check_valid_interface_name ("com.example.", NULL)); g_assert (tp_dbus_check_valid_interface_name ("com.example", NULL)); g_assert (tp_dbus_check_valid_interface_name ("com._1", NULL)); g_assert (tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS, TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL)); g_assert (tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL)); g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS, TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, NULL)); g_assert (!tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL)); g_assert (tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS, TP_DBUS_NAME_TYPE_BUS_DAEMON, NULL)); g_assert (!tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)); g_assert (tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)); g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS, TP_DBUS_NAME_TYPE_WELL_KNOWN, NULL)); g_assert (tp_dbus_check_valid_bus_name (":1.1", TP_DBUS_NAME_TYPE_UNIQUE, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com.example", TP_DBUS_NAME_TYPE_UNIQUE, NULL)); g_assert (!tp_dbus_check_valid_bus_name (DBUS_SERVICE_DBUS, TP_DBUS_NAME_TYPE_UNIQUE, NULL)); g_assert (tp_dbus_check_valid_bus_name ("com._1", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name (TEST_LONG, TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("hasnodot", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("123abc.example", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com.1", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com.e*ample", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com..example", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name (".com.example", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name ("com.example.", TP_DBUS_NAME_TYPE_ANY, NULL)); g_assert (!tp_dbus_check_valid_bus_name (":1.1.", TP_DBUS_NAME_TYPE_ANY, NULL)); } static void test_properties (void) { TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL); gchar *bus_name; gchar *object_path; DBusGConnection *dbus_conn; g_object_get (bus, "dbus-connection", &dbus_conn, "bus-name", &bus_name, "object-path", &object_path, NULL); if (object_path[0] != '/') g_error ("supposed object-path \"%s\" doesn't start with a /", object_path); g_assert_cmpstr (bus_name, ==, "org.freedesktop.DBus"); g_assert (dbus_conn != NULL); g_assert (dbus_conn == tp_get_bus ()); g_free (bus_name); g_free (object_path); dbus_g_connection_unref (dbus_conn); g_object_unref (bus); } static GPtrArray *events; static GMainLoop *mainloop; static gchar *two = "2", *five = "5"; static gboolean had_owners = FALSE; static void noc (TpDBusDaemon *obj, const gchar *name, const gchar *new_owner, gpointer user_data) { const gchar *tag = user_data; g_message ("[%s] %s -> <%s>", tag, name, new_owner); g_ptr_array_add (events, g_strdup_printf ("[%s] %s %d", tag, name, new_owner[0])); if (new_owner[0] != '\0') had_owners = TRUE; if (!tp_strdiff (name, "net.example")) { if (new_owner[0] == '\0') { if (had_owners) { g_main_loop_quit (mainloop); } else { guint ret; GError *error = NULL; g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1, "com.example", 0, &ret, &error, NULL)); g_assert (ret == 1 && error == NULL); g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1, "org.example", 0, &ret, &error, NULL)); g_assert (ret == 1 && error == NULL); g_assert (tp_cli_dbus_daemon_run_request_name (obj, -1, "net.example", 0, &ret, &error, NULL)); g_assert (ret == 1 && error == NULL); } } else { guint ret; GError *error = NULL; g_assert (tp_dbus_daemon_cancel_name_owner_watch (obj, "org.example", noc, five)); g_assert (tp_cli_dbus_daemon_run_release_name (obj, -1, "org.example", &ret, &error, NULL)); g_assert (ret == 1 && error == NULL); g_assert (tp_cli_dbus_daemon_run_release_name (obj, -1, "net.example", &ret, &error, NULL)); g_assert (ret == 1 && error == NULL); } } } static void test_watch_name_owner (void) { TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL); guint i; events = g_ptr_array_new (); tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, "1", NULL); tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, two, NULL); tp_dbus_daemon_watch_name_owner (bus, "com.example", noc, "3", NULL); tp_dbus_daemon_cancel_name_owner_watch (bus, "com.example", noc, two); tp_dbus_daemon_watch_name_owner (bus, "net.example", noc, "4", NULL); tp_dbus_daemon_watch_name_owner (bus, "org.example", noc, five, NULL); mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); g_assert_cmpuint (events->len, ==, 9); /* 58 == ':' - i.e. the beginning of a unique name */ g_assert_cmpstr (g_ptr_array_index (events, 0), ==, "[1] com.example 0"); g_assert_cmpstr (g_ptr_array_index (events, 1), ==, "[3] com.example 0"); g_assert_cmpstr (g_ptr_array_index (events, 2), ==, "[4] net.example 0"); g_assert_cmpstr (g_ptr_array_index (events, 3), ==, "[5] org.example 0"); g_assert_cmpstr (g_ptr_array_index (events, 4), ==, "[1] com.example 58"); g_assert_cmpstr (g_ptr_array_index (events, 5), ==, "[3] com.example 58"); g_assert_cmpstr (g_ptr_array_index (events, 6), ==, "[5] org.example 58"); g_assert_cmpstr (g_ptr_array_index (events, 7), ==, "[4] net.example 58"); g_assert_cmpstr (g_ptr_array_index (events, 8), ==, "[4] net.example 0"); /* keep valgrind happy, at least in the successful case */ for (i = 0; i < events->len; i++) { g_free (events->pdata[i]); } g_ptr_array_unref (events); g_main_loop_unref (mainloop); mainloop = NULL; } /* Here's a regression test for a bug where, if a name owner watch callback * removes itself, subsequent callbacks for the same change would not fire. * This was because the implementation was an array of callbacks, with an index * i, calling each in turn. So imagine we're dispatching three callbacks, * starting with 'foo': * * | foo | bar | baz | * i=0 * * If 'foo' cancels its own watch, it would be removed from the array. Then the * iteration would continue by incrementing i: * * | bar | baz | * i=1 * * and 'bar' has not been called! Gulp. This test checks this case by setting * up ten numbered callbacks, each one of which removes itself and itself ±1, * so that each of (0, 1), (2, 3), (4, 5), (6, 7), (8, 9) should fire exactly * once. It should work regardless of the internal order of callbacks. */ #define N_CALLBACK_PAIRS 5 gboolean callbacks_fired[N_CALLBACK_PAIRS] = { FALSE, FALSE, FALSE, FALSE, FALSE }; /* Overwritten with '.' when "freed" */ gchar user_data_flags[N_CALLBACK_PAIRS * 2 + 1] = "0123456789"; static void free_fake_user_data (gpointer user_data) { guint i = GPOINTER_TO_UINT (user_data); if (user_data_flags[i] == '.') g_error ("Double 'free' of user-data %u. Still to free: %s", i, user_data_flags); g_assert_cmpuint ((guint) user_data_flags[i], ==, i + '0'); user_data_flags[i] = '.'; } static void bbf3_performed_cb ( TpDBusDaemon *bus_daemon, const gchar *name, const gchar *new_owner, gpointer user_data) { guint i = GPOINTER_TO_UINT (user_data); guint even = i - (i % 2); guint odd = even + 1; guint j; g_message ("%u fired; cancelling %u and %u", i, even, odd); tp_dbus_daemon_cancel_name_owner_watch (bus_daemon, name, bbf3_performed_cb, GUINT_TO_POINTER (even)); tp_dbus_daemon_cancel_name_owner_watch (bus_daemon, name, bbf3_performed_cb, GUINT_TO_POINTER (odd)); g_assert (!callbacks_fired[even / 2]); callbacks_fired[even / 2] = TRUE; for (j = 0; j < N_CALLBACK_PAIRS; j++) if (!callbacks_fired[j]) { g_message ("still waiting for %u or %u, at least", j * 2, j * 2 + 1); return; } g_main_loop_quit (mainloop); } static void cancel_watch_during_dispatch (void) { TpDBusDaemon *bus = tp_dbus_daemon_dup (NULL); guint i; tp_dbus_daemon_request_name (bus, "ca.bbf3", FALSE, NULL); for (i = 0; i < N_CALLBACK_PAIRS * 2; i++) { tp_dbus_daemon_watch_name_owner (bus, "ca.bbf3", bbf3_performed_cb, GUINT_TO_POINTER (i), free_fake_user_data); g_assert_cmpuint ((guint) user_data_flags[i], ==, i + '0'); } mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); g_main_loop_unref (mainloop); g_object_unref (bus); /* everything should have been "freed" */ g_assert_cmpstr (user_data_flags, ==, ".........."); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_add_func ("/dbus/validation", test_validation); g_test_add_func ("/dbus-daemon/properties", test_properties); g_test_add_func ("/dbus-daemon/watch-name-owner", test_watch_name_owner); g_test_add_func ("/dbus-daemon/cancel-watch-during-dispatch", cancel_watch_during_dispatch); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/connection-handles.c0000644000175000017500000002262212652510705017457 00000000000000/* Feature test for handle reference tracking. * * Code missing coverage in connection-handles.c: * - having two connections, one of them becoming invalid * - unreffing handles on a dead connection * - failing to request handles * - inconsistent CMs * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" typedef struct { GMainLoop *loop; GError *error /* initialized to 0 */; GArray *handles; gchar **ids; } Result; static void requested (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const gchar * const *ids, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->ids == NULL); g_assert (result->handles == NULL); g_assert (result->error == NULL); if (error == NULL) { DEBUG ("got %u handles", n_handles); result->ids = g_strdupv ((GStrv) ids); result->handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_handles); g_array_append_vals (result->handles, handles, n_handles); } else { DEBUG ("got an error"); result->error = g_error_copy (error); } } static void held (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->ids == NULL); g_assert (result->handles == NULL); g_assert (result->error == NULL); if (error == NULL) { DEBUG ("got %u handles", n_handles); result->handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_handles); g_array_append_vals (result->handles, handles, n_handles); } else { DEBUG ("got an error"); result->error = g_error_copy (error); } } static void finish (gpointer r) { Result *result = r; g_main_loop_quit (result->loop); } /* * Assert that RequestHandles + unref doesn't crash. (It doesn't * do anything any more, however.) */ static void test_request_and_release (TpTestsSimpleConnection *service_conn, TpConnection *client_conn) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; const gchar * const ids[] = { "alice", "bob", "chris", NULL }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); guint i; g_message (G_STRFUNC); /* request three handles */ tp_connection_request_handles (client_conn, -1, TP_HANDLE_TYPE_CONTACT, ids, requested, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); MYASSERT (result.ids != NULL, ""); MYASSERT (result.handles != NULL, ""); for (i = 0; i < 3; i++) { MYASSERT (result.ids[i] != NULL, " [%u]", i); MYASSERT (!tp_strdiff (result.ids[i], ids[i]), " [%u] %s != %s", i, result.ids[i], ids[i]); } MYASSERT (result.ids[3] == NULL, ""); MYASSERT (result.handles->len == 3, ": %u != 3", result.handles->len); /* check that the service and the client agree */ MYASSERT (tp_handles_are_valid (service_repo, result.handles, FALSE, NULL), ""); for (i = 0; i < 3; i++) { TpHandle handle = g_array_index (result.handles, TpHandle, i); MYASSERT (!tp_strdiff (tp_handle_inspect (service_repo, handle), ids[i]), "%s != %s", tp_handle_inspect (service_repo, handle), ids[i]); } /* release the handles (but don't assert that it isn't a no-op) */ tp_connection_unref_handles (client_conn, TP_HANDLE_TYPE_CONTACT, result.handles->len, (const TpHandle *) result.handles->data); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* clean up */ g_strfreev (result.ids); g_array_unref (result.handles); g_assert (result.error == NULL); g_main_loop_unref (result.loop); } /* * Assert that RequestHandles + HoldHandles + unref does not release the * handles, but a second unref does. */ static void test_request_hold_release (TpTestsSimpleConnection *service_conn, TpConnection *client_conn) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; const gchar * const ids[] = { "alice", "bob", "chris", NULL }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); guint i; GArray *saved_handles; g_message (G_STRFUNC); /* request three handles */ tp_connection_request_handles (client_conn, -1, TP_HANDLE_TYPE_CONTACT, ids, requested, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); MYASSERT (result.ids != NULL, ""); MYASSERT (result.handles != NULL, ""); for (i = 0; i < 3; i++) { MYASSERT (result.ids[i] != NULL, " [%u]", i); MYASSERT (!tp_strdiff (result.ids[i], ids[i]), " [%u] %s != %s", i, result.ids[i], ids[i]); } MYASSERT (result.ids[3] == NULL, ""); MYASSERT (result.handles->len == 3, ": %u != 3", result.handles->len); /* check that the service and the client agree */ MYASSERT (tp_handles_are_valid (service_repo, result.handles, FALSE, NULL), ""); for (i = 0; i < 3; i++) { TpHandle handle = g_array_index (result.handles, TpHandle, i); MYASSERT (!tp_strdiff (tp_handle_inspect (service_repo, handle), ids[i]), "%s != %s", tp_handle_inspect (service_repo, handle), ids[i]); } /* hold the handles */ g_strfreev (result.ids); result.ids = NULL; saved_handles = result.handles; result.handles = NULL; g_assert (result.error == NULL); tp_connection_hold_handles (client_conn, -1, TP_HANDLE_TYPE_CONTACT, saved_handles->len, (const TpHandle *) saved_handles->data, held, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_no_error (result.error); MYASSERT (result.ids == NULL, ""); MYASSERT (result.handles != NULL, ""); for (i = 0; i < 3; i++) { TpHandle want = g_array_index (saved_handles, TpHandle, i); TpHandle got = g_array_index (result.handles, TpHandle, i); MYASSERT (want == got, "%u != %u", want, got); } g_array_unref (saved_handles); /* unref the handles */ tp_connection_unref_handles (client_conn, TP_HANDLE_TYPE_CONTACT, result.handles->len, (const TpHandle *) result.handles->data); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* check that the handles have not been released */ MYASSERT (tp_handles_are_valid (service_repo, result.handles, FALSE, NULL), ""); for (i = 0; i < 3; i++) { TpHandle handle = g_array_index (result.handles, TpHandle, i); MYASSERT (!tp_strdiff (tp_handle_inspect (service_repo, handle), ids[i]), "%s != %s", tp_handle_inspect (service_repo, handle), ids[i]); } /* release the handles (but don't assert that it isn't a no-op) */ tp_connection_unref_handles (client_conn, TP_HANDLE_TYPE_CONTACT, result.handles->len, (const TpHandle *) result.handles->data); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* clean up */ g_main_loop_unref (result.loop); g_strfreev (result.ids); g_array_unref (result.handles); g_assert (result.error == NULL); } int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *client_conn; /* Setup */ tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); client_conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (client_conn != NULL, ""); /* It does in fact have immortal handles, but we can't know that yet */ g_assert (!tp_connection_has_immortal_handles (client_conn)); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* now we know */ g_assert (tp_connection_has_immortal_handles (client_conn)); /* Tests */ test_request_and_release (service_conn, client_conn); test_request_hold_release (service_conn, client_conn); /* Teardown */ tp_tests_connection_assert_disconnect_succeeds (client_conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); return 0; } telepathy-glib-0.24.2/tests/dbus/cli-group.c0000644000175000017500000004346212652510705015612 00000000000000/* Test TpChannel's group code. * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-group.h" #include "tests/lib/util.h" static GMainLoop *mainloop; TpTestsSimpleConnection *service_conn; gchar *conn_path; TpConnection *conn; TpHandleRepoIface *contact_repo; TpHandle self_handle, h1, h2, h3; gboolean expecting_group_members_changed = FALSE; gboolean expecting_group_members_changed_detailed = FALSE; TpChannelGroupChangeReason expected_reason = TP_CHANNEL_GROUP_CHANGE_REASON_NONE; gboolean expecting_invalidated = FALSE; static void group_members_changed_cb (TpChannel *chan_, gchar *message, GArray *added, GArray *removed, GArray *local_pending, GArray *remote_pending, guint actor, guint reason, gpointer user_data) { DEBUG ("\"%s\", %u, %u, %u, %u, %u, %u", message, added->len, removed->len, local_pending->len, remote_pending->len, actor, reason); MYASSERT (expecting_group_members_changed, ""); g_assert_cmpuint (reason, ==, expected_reason); expecting_group_members_changed = FALSE; } static void group_members_changed_detailed_cb (TpChannel *chan_, GArray *added, GArray *removed, GArray *local_pending, GArray *remote_pending, GHashTable *details, gpointer user_data) { guint reason = tp_asv_get_uint32 (details, "change-reason", NULL); DEBUG ("%u, %u, %u, %u, %u details", added->len, removed->len, local_pending->len, remote_pending->len, g_hash_table_size (details)); MYASSERT (expecting_group_members_changed_detailed, ""); g_assert_cmpuint (reason, ==, expected_reason); expecting_group_members_changed_detailed = FALSE; } static void test_channel_proxy (TpTestsTextChannelGroup *service_chan, TpChannel *chan, gboolean detailed, gboolean properties) { TpIntset *add, *rem, *expected_members; GArray *arr, *yarr; GError *error = NULL; TpChannelGroupFlags flags; gboolean has_detailed_flag, has_properties_flag; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); /* We want to ensure that each of these signals fires exactly once per * change. The channel emits both MembersChanged and MembersChangedDetailed, * but TpChannel should only be reacting to one of them, based on whether the * Members_Changed_Detailed flag is set. So, each signal's handler has a * corresponding "expected" flag, which it asserts on then sets back to FALSE. */ g_signal_connect (chan, "group-members-changed", (GCallback) group_members_changed_cb, NULL); g_signal_connect (chan, "group-members-changed-detailed", (GCallback) group_members_changed_detailed_cb, NULL); flags = tp_channel_group_get_flags (chan); has_detailed_flag = !!(flags & TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED); MYASSERT (detailed == has_detailed_flag, ": expected Members_Changed_Detailed to be %sset", (detailed ? "" : "un")); has_properties_flag = !!(flags & TP_CHANNEL_GROUP_FLAG_PROPERTIES); MYASSERT (properties == has_properties_flag, ": expected Properties to be %sset", (detailed ? "" : "un")); /* Add a couple of members. */ add = tp_intset_new (); tp_intset_add (add, h1); tp_intset_add (add, h2); expecting_group_members_changed = TRUE; expecting_group_members_changed_detailed = TRUE; expected_reason++; tp_group_mixin_change_members ((GObject *) service_chan, "quantum tunnelling", add, NULL, NULL, NULL, 0, expected_reason); /* Clear the queue to ensure that there aren't any more * MembersChanged[Detailed] signals waiting for us. */ tp_tests_proxy_run_until_dbus_queue_processed (conn); expected_members = add; MYASSERT (tp_intset_is_equal (expected_members, tp_channel_group_get_members (chan)), ""); /* Add one, remove one. Check that the cache is properly updated. */ add = tp_intset_new (); tp_intset_add (add, h3); rem = tp_intset_new (); tp_intset_add (rem, h1); expecting_group_members_changed = TRUE; expecting_group_members_changed_detailed = TRUE; expected_reason++; tp_group_mixin_change_members ((GObject *) service_chan, "goat", add, rem, NULL, NULL, 0, expected_reason); tp_intset_destroy (add); tp_intset_destroy (rem); tp_tests_proxy_run_until_dbus_queue_processed (conn); tp_intset_add (expected_members, h3); tp_intset_remove (expected_members, h1); MYASSERT (tp_intset_is_equal (expected_members, tp_channel_group_get_members (chan)), ""); /* Now, emit a spurious instance of whichever DBus signal the proxy should * not be listening to to check it's really not listening to it. If the * TpChannel is reacting to the wrong DBus signal, it'll trigger an assertion * in the GObject signal handlers. */ yarr = g_array_new (FALSE, FALSE, sizeof (TpHandle)); arr = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1); g_array_insert_val (arr, 0, h1); expecting_group_members_changed = FALSE; expecting_group_members_changed_detailed = FALSE; if (detailed) { tp_svc_channel_interface_group_emit_members_changed (service_chan, "whee", arr, yarr, yarr, yarr, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); } else { GHashTable *details = g_hash_table_new (NULL, NULL); tp_svc_channel_interface_group_emit_members_changed_detailed ( service_chan, arr, yarr, yarr, yarr, details); g_hash_table_unref (details); } g_array_unref (yarr); g_array_unref (arr); tp_tests_proxy_run_until_dbus_queue_processed (conn); /* And, the cache of group members should be unaltered, since the signal the * TpChannel cares about was not fired. */ MYASSERT (tp_intset_is_equal (expected_members, tp_channel_group_get_members (chan)), ""); tp_intset_destroy (expected_members); } static void channel_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { DEBUG ("called"); MYASSERT (expecting_invalidated, ": I've been EXPECTING YOU"); g_assert_cmpuint (domain, ==, TP_DBUS_ERRORS); MYASSERT (code == TP_DBUS_ERROR_INCONSISTENT, ": was %i", code); expecting_invalidated = FALSE; } static void test_invalidated_on_illegal_change (TpTestsTextChannelGroup *serv_chan, TpChannel *chan, gboolean detailed, gboolean properties) { TpChannelGroupFlags add, del; DEBUG ("This channel has detailed %sset and properties %sset", (detailed ? "" : "un"), (properties ? "" : "un")); /* If we re-set or -unset the flags the channel already has, then the * TpChannel shouldn't care. This emits the signal directly rather than going * through the mixin, because the mixin helpfully optimizes out the spurious * change notification. */ expecting_invalidated = FALSE; add = del = 0; *(detailed ? &add : &del) |= TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED; *(properties ? &add : &del) |= TP_CHANNEL_GROUP_FLAG_PROPERTIES; DEBUG ("Changing flags: add %u, del %u", add, del); tp_svc_channel_interface_group_emit_group_flags_changed (serv_chan, add, del); tp_tests_proxy_run_until_dbus_queue_processed (conn); /* Now, let's flip the Detailed and Properties flags, and check that the * proxy gets invalidated due to inconsistency on the part of the service. */ expecting_invalidated = TRUE; DEBUG ("Changing flags: add %u, del %u", del, add); tp_group_mixin_change_flags ((GObject *) serv_chan, del, add); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (!expecting_invalidated, ": invalidated should have fired"); } static void run_membership_test (guint channel_number, gboolean detailed, gboolean properties) { gchar *chan_path; TpTestsTextChannelGroup *service_chan; TpChannel *chan; GError *error = NULL; chan_path = g_strdup_printf ("%s/Channel%u", conn_path, channel_number); service_chan = TP_TESTS_TEXT_CHANNEL_GROUP ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, "connection", service_conn, "object-path", chan_path, "detailed", detailed, "properties", properties, NULL)); chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); expecting_invalidated = FALSE; g_signal_connect (chan, "invalidated", (GCallback) channel_invalidated_cb, NULL); test_channel_proxy (service_chan, chan, detailed, properties); test_invalidated_on_illegal_change (service_chan, chan, detailed, properties); g_object_unref (chan); g_object_unref (service_chan); g_free (chan_path); } static void run_membership_tests (void) { /* Run a set of sanity checks on a series of channels, with all 4 * combinations of states of the of the Members_Changed_Detailed and * Properties group flags. */ run_membership_test (1, FALSE, FALSE); run_membership_test (2, FALSE, TRUE); run_membership_test (3, TRUE, FALSE); run_membership_test (4, TRUE, TRUE); } #define REMOVED_REASON TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER #define REMOVED_KNOWN_ERROR_CODE TP_ERROR_CONNECTION_REFUSED #define REMOVED_KNOWN_ERROR_STR TP_ERROR_STR_CONNECTION_REFUSED #define REMOVED_UNKNOWN_ERROR "if.bob.dylan.were.hiding.at.the.bottom.of.a.well" #define REMOVED_MESSAGE \ "I'm just sittin' here, hidin' inside of a well, and I ain't comin' out!" static void check_invalidated_unknown_error_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { gboolean *invalidated = user_data; GError e = { domain, code, message }; GError *error = &e; MYASSERT (!*invalidated, ""); *invalidated = TRUE; /* Because we didn't understand the D-Bus error string, the Telepathy error * is derived from the Channel_Group_Change_Reason; since 0.11.5 * it's remapped into the TP_ERROR domain if possible */ g_assert_error (error, TP_ERROR, TP_ERROR_NO_ANSWER); MYASSERT (strstr (message, REMOVED_UNKNOWN_ERROR) != NULL, " (%s, %s)", message, REMOVED_UNKNOWN_ERROR); MYASSERT (strstr (message, REMOVED_MESSAGE) != NULL, " (%s, %s)", message, REMOVED_MESSAGE); } static void check_removed_unknown_error_in_invalidated (void) { gchar *chan_path; TpTestsTextChannelGroup *service_chan; TpChannel *chan; TpIntset *self_handle_singleton = tp_intset_new (); GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); gboolean invalidated = FALSE; GError *error = NULL; chan_path = g_strdup_printf ("%s/Channel_1_6180339887", conn_path); service_chan = TP_TESTS_TEXT_CHANNEL_GROUP ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, "connection", service_conn, "object-path", chan_path, "detailed", TRUE, "properties", TRUE, NULL)); chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); DEBUG ("ready!"); g_signal_connect (chan, "invalidated", (GCallback) check_invalidated_unknown_error_cb, &invalidated); tp_intset_add (self_handle_singleton, self_handle); tp_group_mixin_change_members ((GObject *) service_chan, "hello", self_handle_singleton, NULL, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_tests_proxy_run_until_dbus_queue_processed (conn); g_hash_table_insert (details, "change-reason", tp_g_value_slice_new_uint (REMOVED_REASON)); g_hash_table_insert (details, "message", tp_g_value_slice_new_static_string (REMOVED_MESSAGE)); g_hash_table_insert (details, "error", tp_g_value_slice_new_static_string (REMOVED_UNKNOWN_ERROR)); tp_group_mixin_change_members_detailed ((GObject *) service_chan, NULL, self_handle_singleton, NULL, NULL, details); tp_tests_proxy_run_until_dbus_queue_processed (conn); tp_cli_channel_call_close (chan, -1, NULL, NULL, NULL, NULL); g_hash_table_unref (details); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (invalidated, ""); g_object_unref (chan); g_object_unref (service_chan); g_free (chan_path); tp_intset_destroy (self_handle_singleton); } static void check_invalidated_known_error_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { gboolean *invalidated = user_data; GError e = { domain, code, message }; GError *error = &e; MYASSERT (!*invalidated, ""); *invalidated = TRUE; g_assert_error (error, TP_ERROR, REMOVED_KNOWN_ERROR_CODE); MYASSERT (strstr (message, REMOVED_KNOWN_ERROR_STR) == NULL, " (%s, %s)", message, REMOVED_KNOWN_ERROR_STR); MYASSERT (strstr (message, REMOVED_MESSAGE) != NULL, " (%s, %s)", message, REMOVED_MESSAGE); } static void check_removed_known_error_in_invalidated (void) { gchar *chan_path; TpTestsTextChannelGroup *service_chan; TpChannel *chan; TpIntset *self_handle_singleton = tp_intset_new (); GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); gboolean invalidated = FALSE; GError *error = NULL; chan_path = g_strdup_printf ("%s/Channel_1_6180339887", conn_path); service_chan = TP_TESTS_TEXT_CHANNEL_GROUP (g_object_new ( TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, "connection", service_conn, "object-path", chan_path, "detailed", TRUE, "properties", TRUE, NULL)); chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); DEBUG ("ready!"); g_signal_connect (chan, "invalidated", (GCallback) check_invalidated_known_error_cb, &invalidated); tp_intset_add (self_handle_singleton, self_handle); tp_group_mixin_change_members ((GObject *) service_chan, "hello", self_handle_singleton, NULL, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_tests_proxy_run_until_dbus_queue_processed (conn); g_hash_table_insert (details, "change-reason", tp_g_value_slice_new_uint (REMOVED_REASON)); g_hash_table_insert (details, "message", tp_g_value_slice_new_static_string (REMOVED_MESSAGE)); g_hash_table_insert (details, "error", tp_g_value_slice_new_static_string (REMOVED_KNOWN_ERROR_STR)); tp_group_mixin_change_members_detailed ((GObject *) service_chan, NULL, self_handle_singleton, NULL, NULL, details); tp_tests_proxy_run_until_dbus_queue_processed (conn); tp_cli_channel_call_close (chan, -1, NULL, NULL, NULL, NULL); g_hash_table_unref (details); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (invalidated, ""); g_object_unref (chan); g_object_unref (service_chan); g_free (chan_path); tp_intset_destroy (self_handle_singleton); } int main (int argc, char **argv) { TpBaseConnection *service_conn_as_base; TpDBusDaemon *dbus; GError *error = NULL; gchar *name; tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); MYASSERT (contact_repo != NULL, ""); self_handle = tp_handle_ensure (contact_repo, "me@example.com", NULL, NULL); h1 = tp_handle_ensure (contact_repo, "h1", NULL, NULL); h2 = tp_handle_ensure (contact_repo, "h2", NULL, NULL); h3 = tp_handle_ensure (contact_repo, "h3", NULL, NULL); mainloop = g_main_loop_new (NULL, FALSE); MYASSERT (tp_cli_connection_run_connect (conn, -1, &error, NULL), ""); g_assert_no_error (error); run_membership_tests (); check_removed_unknown_error_in_invalidated (); check_removed_known_error_in_invalidated (); tp_tests_connection_assert_disconnect_succeeds (conn); /* clean up */ g_main_loop_unref (mainloop); mainloop = NULL; g_object_unref (conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); return 0; } telepathy-glib-0.24.2/tests/dbus/channel-dispatch-operation.c0000644000175000017500000006702212652510705021112 00000000000000/* A very basic feature test for TpChannelDispatchOperation * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/simple-channel-dispatch-operation.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" #include "tests/lib/util.h" #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "fake/fake/fake" static const gchar *POSSIBLE_HANDLERS[] = { TP_CLIENT_BUS_NAME_BASE ".Badger", NULL, }; typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; DBusGConnection *private_conn; TpDBusDaemon *private_dbus; TpTestsSimpleChannelDispatchOperation *cdo_service; TpTestsTextChannelNull *text_chan_service; TpTestsTextChannelNull *text_chan_service_2; TpChannelDispatchOperation *cdo; GError *error /* initialized where needed */; TpBaseConnection *base_connection; TpConnection *connection; TpChannel *text_chan; TpChannel *text_chan_2; guint sig; } Test; static void setup (Test *test, gconstpointer data) { DBusConnection *libdbus; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); libdbus = dbus_bus_get_private (DBUS_BUS_STARTER, NULL); g_assert (libdbus != NULL); dbus_connection_setup_with_g_main (libdbus, NULL); dbus_connection_set_exit_on_disconnect (libdbus, FALSE); test->private_conn = dbus_connection_get_g_connection (libdbus); /* transfer ref */ dbus_g_connection_ref (test->private_conn); dbus_connection_unref (libdbus); g_assert (test->private_conn != NULL); test->private_dbus = tp_dbus_daemon_new (test->private_conn); g_assert (test->private_dbus != NULL); test->cdo = NULL; test->cdo_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, NULL); tp_dbus_daemon_register_object (test->private_dbus, "/whatever", test->cdo_service); } static void setup_services (Test *test, gconstpointer data) { gchar *chan_path; TpHandle handle; TpHandleRepoIface *contact_repo; setup (test, data); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create service-side text channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); /* Create a second channel */ chan_path = g_strdup_printf ("%s/Channel2", tp_proxy_get_object_path (test->connection)); handle = tp_handle_ensure (contact_repo, "alice", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service_2 = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan_2 = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); /* Configure fake ChannelDispatchOperation service */ tp_tests_simple_channel_dispatch_operation_set_conn_path (test->cdo_service, tp_proxy_get_object_path (test->connection)); tp_tests_simple_channel_dispatch_operation_add_channel (test->cdo_service, test->text_chan); tp_tests_simple_channel_dispatch_operation_add_channel (test->cdo_service, test->text_chan_2); tp_tests_simple_channel_dispatch_operation_set_account_path (test->cdo_service, ACCOUNT_PATH); g_assert (tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL)); } static void teardown (Test *test, gconstpointer data) { if (test->cdo != NULL) { g_object_unref (test->cdo); test->cdo = NULL; } tp_dbus_daemon_release_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); if (test->private_dbus != NULL) { tp_dbus_daemon_release_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); g_object_unref (test->private_dbus); test->private_dbus = NULL; } g_object_unref (test->cdo_service); test->cdo_service = NULL; if (test->private_conn != NULL) { dbus_connection_close (dbus_g_connection_get_connection ( test->private_conn)); dbus_g_connection_unref (test->private_conn); test->private_conn = NULL; } /* make sure any pending things have happened */ tp_tests_proxy_run_until_dbus_queue_processed (test->dbus); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void teardown_services (Test *test, gconstpointer data) { g_object_unref (test->text_chan); if (test->text_chan_service != NULL) g_object_unref (test->text_chan_service); g_object_unref (test->text_chan_2); if (test->text_chan_service_2 != NULL) g_object_unref (test->text_chan_service_2); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); teardown (test, data); } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; /* CD not running */ test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cdo == NULL); ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cdo = tp_channel_dispatch_operation_new (test->dbus, "not even syntactically valid", NULL, NULL); g_assert (test->cdo == NULL); test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cdo != NULL); } static void test_crash (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cdo != NULL); g_assert (tp_proxy_get_invalidated (test->cdo) == NULL); tp_dbus_daemon_release_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); tp_tests_proxy_run_until_dbus_queue_processed (test->cdo); g_assert (tp_proxy_get_invalidated (test->cdo) == NULL); dbus_connection_close (dbus_g_connection_get_connection ( test->private_conn)); dbus_g_connection_unref (test->private_conn); test->private_conn = NULL; while (tp_proxy_get_invalidated (test->cdo) == NULL) g_main_context_iteration (NULL, TRUE); g_assert (tp_proxy_get_invalidated (test->cdo)->domain == TP_DBUS_ERRORS); g_assert (tp_proxy_get_invalidated (test->cdo)->code == TP_DBUS_ERROR_NAME_OWNER_LOST); } static void test_finished (Test *test, gconstpointer data G_GNUC_UNUSED) { gboolean ok; ok = tp_dbus_daemon_request_name (test->private_dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL); g_assert (ok); test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, NULL); g_assert (test->cdo != NULL); g_assert (tp_proxy_get_invalidated (test->cdo) == NULL); tp_svc_channel_dispatch_operation_emit_finished (test->cdo_service); tp_tests_proxy_run_until_dbus_queue_processed (test->cdo); g_assert (tp_proxy_get_invalidated (test->cdo) != NULL); g_assert (tp_proxy_get_invalidated (test->cdo)->domain == TP_DBUS_ERRORS); g_assert (tp_proxy_get_invalidated (test->cdo)->code == TP_DBUS_ERROR_OBJECT_REMOVED); } static void features_prepared_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); g_assert_no_error (test->error); g_main_loop_quit (test->mainloop); } /* Test properties when passing the immutable properties to * tp_channel_dispatch_operation_new() */ static void check_immutable_properties (Test *test) { TpConnection *conn; TpAccount *account; GStrv possible_handlers; GHashTable *immutable_props; g_object_get (test->cdo, "connection", &conn, "account", &account, "possible-handlers", &possible_handlers, "cdo-properties", &immutable_props, NULL); /* connection */ g_assert (conn != NULL); g_assert (TP_IS_CONNECTION (conn)); g_assert (tp_channel_dispatch_operation_borrow_connection (test->cdo) == conn); g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, tp_proxy_get_object_path (test->connection)); g_object_unref (conn); /* account */ g_assert (account != NULL); g_assert (TP_IS_ACCOUNT (account)); g_assert (tp_channel_dispatch_operation_borrow_account (test->cdo) == account); g_assert_cmpstr (tp_proxy_get_object_path (account), ==, ACCOUNT_PATH); g_object_unref (account); /* possible handlers */ g_assert (possible_handlers != NULL); g_assert_cmpuint (g_strv_length (possible_handlers), ==, 1); g_assert (tp_strv_contains ((const gchar * const *) possible_handlers, POSSIBLE_HANDLERS[0])); g_strfreev (possible_handlers); possible_handlers = tp_channel_dispatch_operation_borrow_possible_handlers ( test->cdo); g_assert_cmpuint (g_strv_length (possible_handlers), ==, 1); g_assert (tp_strv_contains ((const gchar * const *) possible_handlers, POSSIBLE_HANDLERS[0])); /* immutable properties */ g_assert (tp_asv_get_object_path (immutable_props, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION) != NULL); g_assert (tp_asv_get_object_path (immutable_props, TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT) != NULL); g_assert (tp_asv_get_strv (immutable_props, TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS) != NULL); g_assert (tp_asv_get_strv (immutable_props, TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES) != NULL); g_assert_cmpuint (g_hash_table_size (immutable_props), ==, 4); g_hash_table_unref (immutable_props); immutable_props = tp_channel_dispatch_operation_borrow_immutable_properties ( test->cdo); g_assert_cmpuint (g_hash_table_size (immutable_props), ==, 4); } static void check_channels (Test *test) { GPtrArray *channels; TpChannel *channel; channels = tp_channel_dispatch_operation_borrow_channels (test->cdo); g_assert (channels != NULL); g_assert_cmpuint (channels->len, ==, 2); channel = g_ptr_array_index (channels, 0); g_assert (TP_IS_CHANNEL (channel)); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan)); channel = g_ptr_array_index (channels, 1); g_assert (TP_IS_CHANNEL (channel)); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan_2)); } static void test_properties_passed (Test *test, gconstpointer data G_GNUC_UNUSED) { static const char *interfaces[] = { NULL }; GHashTable *props; GPtrArray *channels; GQuark features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; props = tp_asv_new ( TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->connection), TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, ACCOUNT_PATH, TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS, G_TYPE_STRV, POSSIBLE_HANDLERS, NULL); test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", props, &test->error); g_assert_no_error (test->error); check_immutable_properties (test); g_object_get (test->cdo, "channels", &channels, NULL); /* Channels is not an immutable property so have to be fetched when * preparing the TpChannelDispatchOperation */ g_assert (channels == NULL); g_assert (tp_channel_dispatch_operation_borrow_channels (test->cdo) == NULL); g_hash_table_unref (props); /* Prepare TpChannelDispatchOperation */ tp_proxy_prepare_async (test->cdo, features, features_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert (tp_proxy_is_prepared (test->cdo, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); /* Channels are now defined */ check_immutable_properties (test); check_channels (test); } /* Don't pass immutable properties to tp_channel_dispatch_operation_new so * properties are fetched when preparing the core feature. */ static void test_properties_fetched (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *props; GQuark features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); /* Properties are not defined yet */ g_assert (tp_channel_dispatch_operation_borrow_connection (test->cdo) == NULL); g_assert (tp_channel_dispatch_operation_borrow_account (test->cdo) == NULL); g_assert (tp_channel_dispatch_operation_borrow_channels (test->cdo) == NULL); g_assert (tp_channel_dispatch_operation_borrow_possible_handlers (test->cdo) == NULL); props = tp_channel_dispatch_operation_borrow_immutable_properties ( test->cdo); g_assert_cmpuint (g_hash_table_size (props), ==, 0); tp_proxy_prepare_async (test->cdo, features, features_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert (tp_proxy_is_prepared (test->cdo, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); /* Immutable properties and Channels are now defined */ check_immutable_properties (test); check_channels (test); } static void channe_lost_cb (TpChannelDispatchOperation *cdo, TpChannel *channel, guint domain, gint code, gchar *message, Test *test) { GError *error = g_error_new_literal (domain, code, message); if (test->text_chan_service_2 != NULL) { /* The second channel is still there so we removed the first one */ g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan)); } else { g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan_2)); } g_assert_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); g_error_free (error); test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void invalidated_cb (TpProxy *self, guint domain, gint code, gchar *message, Test *test) { test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void test_channel_lost (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; GPtrArray *channels; TpChannel *channel; test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_proxy_prepare_async (test->cdo, features, features_prepared_cb, test); g_main_loop_run (test->mainloop); g_assert (tp_proxy_is_prepared (test->cdo, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); check_channels (test); test->sig = 1; g_signal_connect (test->cdo, "channel-lost", G_CALLBACK (channe_lost_cb), test); /* First channel disappears and so is lost */ tp_tests_text_channel_null_close (test->text_chan_service); g_object_unref (test->text_chan_service); test->text_chan_service = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan); g_main_loop_run (test->mainloop); channels = tp_channel_dispatch_operation_borrow_channels (test->cdo); g_assert (channels != NULL); /* Channel has been removed */ g_assert_cmpuint (channels->len, ==, 1); channel = g_ptr_array_index (channels, 0); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan_2)); /* Second channel disappears, Finished is emited and so the CDO is * invalidated */ test->sig = 2; g_signal_connect (test->cdo, "invalidated", G_CALLBACK (invalidated_cb), test); tp_tests_text_channel_null_close (test->text_chan_service_2); g_object_unref (test->text_chan_service_2); test->text_chan_service_2 = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan_2); g_main_loop_run (test->mainloop); g_assert_cmpuint (channels->len, ==, 0); } static void handle_with_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_handle_with_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); g_main_loop_quit (test->mainloop); } static void test_handle_with (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_channel_dispatch_operation_handle_with_async (test->cdo, NULL, handle_with_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); tp_channel_dispatch_operation_handle_with_async (test->cdo, "FAIL", handle_with_cb, test); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); } static void claim_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_claim_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); g_main_loop_quit (test->mainloop); } static void test_claim (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_channel_dispatch_operation_claim_async (test->cdo, claim_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* tp_channel_dispatch_operation_claim_with_async() is tested in * tests/dbus/base-client.c */ } static void test_channel_lost_preparing (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; GPtrArray *channels; TpChannel *channel; test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_proxy_prepare_async (test->cdo, features, features_prepared_cb, test); /* First channel disappears while preparing */ tp_tests_text_channel_null_close (test->text_chan_service); g_object_unref (test->text_chan_service); test->text_chan_service = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan); g_main_loop_run (test->mainloop); g_assert (tp_proxy_is_prepared (test->cdo, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); channels = tp_channel_dispatch_operation_borrow_channels (test->cdo); g_assert (channels != NULL); /* Channel has been removed */ g_assert_cmpuint (channels->len, ==, 1); channel = g_ptr_array_index (channels, 0); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->text_chan_2)); } static void features_not_prepared_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); g_assert_error (test->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED); g_clear_error (&test->error); g_main_loop_quit (test->mainloop); } static void test_finished_preparing (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; GPtrArray *channels; test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_proxy_prepare_async (test->cdo, features, features_not_prepared_cb, test); /* The 2 channels are lost while preparing */ tp_tests_text_channel_null_close (test->text_chan_service); g_object_unref (test->text_chan_service); test->text_chan_service = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan); tp_tests_text_channel_null_close (test->text_chan_service_2); g_object_unref (test->text_chan_service_2); test->text_chan_service_2 = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan_2); g_main_loop_run (test->mainloop); g_assert (!tp_proxy_is_prepared (test->cdo, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); channels = tp_channel_dispatch_operation_borrow_channels (test->cdo); g_assert (channels == NULL); } static void handle_with_time_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_handle_with_time_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); g_main_loop_quit (test->mainloop); } static void test_handle_with_time (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_channel_dispatch_operation_handle_with_time_async (test->cdo, NULL, 666, handle_with_time_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void close_channels_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_close_channels_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void channel_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { Test *test = user_data; test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void test_close_channels (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_tests_proxy_run_until_prepared (test->cdo, NULL); g_signal_connect (test->text_chan, "invalidated", G_CALLBACK (channel_invalidated_cb), test); g_signal_connect (test->text_chan_2, "invalidated", G_CALLBACK (channel_invalidated_cb), test); tp_channel_dispatch_operation_close_channels_async (test->cdo, close_channels_cb, test); test->sig = 3; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void leave_channels_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_leave_channels_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void test_leave_channels (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_tests_proxy_run_until_prepared (test->cdo, NULL); g_signal_connect (test->text_chan, "invalidated", G_CALLBACK (channel_invalidated_cb), test); g_signal_connect (test->text_chan_2, "invalidated", G_CALLBACK (channel_invalidated_cb), test); tp_channel_dispatch_operation_leave_channels_async (test->cdo, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, "Busy right now", leave_channels_cb, test); test->sig = 3; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void destroy_channels_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_destroy_channels_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); test->sig--; if (test->sig == 0) g_main_loop_quit (test->mainloop); } static void test_destroy_channels (Test *test, gconstpointer data G_GNUC_UNUSED) { test->cdo = tp_channel_dispatch_operation_new (test->dbus, "/whatever", NULL, &test->error); g_assert_no_error (test->error); tp_tests_proxy_run_until_prepared (test->cdo, NULL); g_signal_connect (test->text_chan, "invalidated", G_CALLBACK (channel_invalidated_cb), test); g_signal_connect (test->text_chan_2, "invalidated", G_CALLBACK (channel_invalidated_cb), test); tp_channel_dispatch_operation_destroy_channels_async (test->cdo, destroy_channels_cb, test); test->sig = 3; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/cdo/new", Test, NULL, setup, test_new, teardown); g_test_add ("/cdo/crash", Test, NULL, setup, test_crash, teardown); g_test_add ("/cdo/finished", Test, NULL, setup, test_finished, teardown); g_test_add ("/cdo/properties-passed", Test, NULL, setup_services, test_properties_passed, teardown_services); g_test_add ("/cdo/properties-fetched", Test, NULL, setup_services, test_properties_fetched, teardown_services); g_test_add ("/cdo/channel-lost", Test, NULL, setup_services, test_channel_lost, teardown_services); g_test_add ("/cdo/handle-with", Test, NULL, setup_services, test_handle_with, teardown_services); g_test_add ("/cdo/claim", Test, NULL, setup_services, test_claim, teardown_services); g_test_add ("/cdo/channel-lost-preparing", Test, NULL, setup_services, test_channel_lost_preparing, teardown_services); g_test_add ("/cdo/finished--preparing", Test, NULL, setup_services, test_finished_preparing, teardown_services); g_test_add ("/cdo/handle-with-time", Test, NULL, setup_services, test_handle_with_time, teardown_services); g_test_add ("/cdo/close-channels", Test, NULL, setup_services, test_close_channels, teardown_services); g_test_add ("/cdo/leave-channels", Test, NULL, setup_services, test_leave_channels, teardown_services); g_test_add ("/cdo/destroy-channels", Test, NULL, setup_services, test_destroy_channels, teardown_services); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/connection-aliasing.c0000644000175000017500000001142112652510705017623 00000000000000/* Feature test for Conn.I.Aliasing * * Copyright © 2007-2011 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "examples/cm/contactlist/conn.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; DBusConnection *client_libdbus; DBusGConnection *client_dbusglib; TpDBusDaemon *client_bus; ExampleContactListConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; gboolean cwr_ready; GError *cwr_error /* initialized in setup */; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { GError *error = NULL; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; tp_debug_set_flags ("all"); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->mainloop = g_main_loop_new (NULL, FALSE); test->error = NULL; test->client_libdbus = dbus_bus_get_private (DBUS_BUS_STARTER, NULL); g_assert (test->client_libdbus != NULL); dbus_connection_setup_with_g_main (test->client_libdbus, NULL); dbus_connection_set_exit_on_disconnect (test->client_libdbus, FALSE); test->client_dbusglib = dbus_connection_get_g_connection ( test->client_libdbus); dbus_g_connection_ref (test->client_dbusglib); test->client_bus = tp_dbus_daemon_new (test->client_dbusglib); g_assert (test->client_bus != NULL); test->service_conn = tp_tests_object_new_static_class ( EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, "account", "me@example.com", "protocol", "simple-protocol", NULL); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (test->service_conn != NULL); g_assert (test->service_conn_as_base != NULL); g_assert (tp_base_connection_register (test->service_conn_as_base, "simple", &test->conn_name, &test->conn_path, &error)); g_assert_no_error (error); test->cwr_ready = FALSE; test->cwr_error = NULL; test->conn = tp_connection_new (test->client_bus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_BALANCE)); tp_tests_proxy_run_until_prepared (test->conn, features); } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { TpConnection *conn; GError *error = NULL; g_clear_error (&test->error); tp_clear_pointer (&test->mainloop, g_main_loop_unref); tp_clear_object (&test->conn); /* disconnect the connection so we don't leak it */ conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_assert (!tp_connection_run_until_ready (conn, FALSE, &error, NULL)); g_assert_error (error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&error); test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); g_object_unref (test->dbus); test->dbus = NULL; g_object_unref (test->client_bus); test->client_bus = NULL; dbus_g_connection_unref (test->client_dbusglib); dbus_connection_close (test->client_libdbus); dbus_connection_unref (test->client_libdbus); } static void test_user_set (Test *test, gconstpointer nil G_GNUC_UNUSED) { GQuark features[] = { TP_CONNECTION_FEATURE_ALIASING, 0 }; g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_ALIASING)); g_assert (!tp_connection_can_set_contact_alias (test->conn)); tp_tests_proxy_run_until_prepared (test->conn, features); g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_ALIASING)); g_assert (tp_connection_can_set_contact_alias (test->conn)); } int main (int argc, char **argv) { tp_tests_abort_after (5); g_test_init (&argc, &argv, NULL); g_test_add ("/conn/aliasing/user-set", Test, NULL, setup, test_user_set, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/stream-tube.c0000644000175000017500000007444112652510705016142 00000000000000/* Tests of TpStreamTubeChannel * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-conn.h" #include "tests/lib/stream-tube-chan.h" #ifdef HAVE_GIO_UNIX #include #include #endif #define BUFFER_SIZE 128 typedef struct { gboolean contact; TpSocketAddressType address_type; TpSocketAccessControl access_control; } TestContext; TestContext contexts[] = { #ifdef HAVE_GIO_UNIX { FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS }, #endif { FALSE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { FALSE, TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { FALSE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_PORT }, #ifdef HAVE_GIO_UNIX { TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS }, #endif { TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { TRUE, TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, { TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_PORT }, { FALSE, TP_NUM_SOCKET_ADDRESS_TYPES, TP_NUM_SOCKET_ACCESS_CONTROLS } }; static gboolean have_ipv6 = FALSE; static gboolean have_creds = FALSE; typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsStreamTubeChannel *tube_chan_service; TpHandleRepoIface *contact_repo; TpHandleRepoIface *room_repo; /* Client side objects */ TpConnection *connection; TpStreamTubeChannel *tube; TpStreamTubeConnection *tube_conn; GIOStream *cm_stream; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->tube_chan_service); tp_clear_object (&test->tube); tp_clear_object (&test->tube_conn); tp_clear_object (&test->cm_stream); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); } static void destroy_socket_control_list (gpointer data) { GArray *tab = data; g_array_unref (tab); } static GHashTable * create_supported_socket_types_hash (TpSocketAddressType address_type, TpSocketAccessControl access_control) { GHashTable *ret; GArray *tab; ret = g_hash_table_new_full (NULL, NULL, NULL, destroy_socket_control_list); tab = g_array_sized_new (FALSE, FALSE, sizeof (TpSocketAccessControl), 1); g_array_append_val (tab, access_control); g_hash_table_insert (ret, GUINT_TO_POINTER (address_type), tab); return ret; } static void create_tube_service (Test *test, gboolean requested, TpSocketAddressType address_type, TpSocketAccessControl access_control, gboolean contact) { gchar *chan_path; TpHandle handle, alf_handle; GHashTable *props; GHashTable *sockets; GType type; tp_clear_object (&test->tube_chan_service); tp_clear_object (&test->tube); /* Create service-side tube channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); test->room_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_ROOM); g_assert (test->room_repo != NULL); if (contact) { handle = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); type = TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL; } else { handle = tp_handle_ensure (test->room_repo, "#test", NULL, &test->error); type = TP_TESTS_TYPE_ROOM_STREAM_TUBE_CHANNEL; } g_assert_no_error (test->error); alf_handle = tp_handle_ensure (test->contact_repo, "alf", NULL, &test->error); g_assert_no_error (test->error); sockets = create_supported_socket_types_hash (address_type, access_control); test->tube_chan_service = g_object_new ( type, "connection", test->base_connection, "handle", handle, "requested", requested, "object-path", chan_path, "supported-socket-types", sockets, "initiator-handle", alf_handle, NULL); /* Create client-side tube channel object */ g_object_get (test->tube_chan_service, "channel-properties", &props, NULL); test->tube = tp_stream_tube_channel_new (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_free (chan_path); g_hash_table_unref (props); g_hash_table_unref (sockets); if (contact) tp_handle_unref (test->contact_repo, handle); else tp_handle_unref (test->room_repo, handle); } /* Test Basis */ static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { create_tube_service (test, TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, TRUE); g_assert (TP_IS_STREAM_TUBE_CHANNEL (test->tube)); g_assert (TP_IS_CHANNEL (test->tube)); create_tube_service (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, FALSE); g_assert (TP_IS_STREAM_TUBE_CHANNEL (test->tube)); g_assert (TP_IS_CHANNEL (test->tube)); } static void check_parameters (GHashTable *parameters, GVariant *parameters_vardict) { gboolean found; guint32 u32; g_assert (parameters != NULL); g_assert (parameters_vardict != NULL); g_assert_cmpstr (g_variant_get_type_string (parameters_vardict), ==, "a{sv}"); g_assert_cmpuint (g_hash_table_size (parameters), ==, 1); g_assert_cmpuint (g_variant_n_children (parameters_vardict), ==, 1); g_assert_cmpuint (tp_asv_get_uint32 (parameters, "badger", NULL), ==, 42); found = g_variant_lookup (parameters_vardict, "badger", "u", &u32); g_assert_cmpint (found, ==, TRUE); g_assert_cmpuint (u32, ==, 42); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { gchar *service; GHashTable *parameters; GVariant *parameters_vardict; /* Outgoing tube */ create_tube_service (test, TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, TRUE); /* Service */ g_assert_cmpstr (tp_stream_tube_channel_get_service (test->tube), ==, "test-service"); g_object_get (test->tube, "service", &service, NULL); g_assert_cmpstr (service, ==, "test-service"); g_free (service); /* Parameters */ parameters = tp_stream_tube_channel_get_parameters (test->tube); /* NULL as the tube has not been offered yet */ g_assert (parameters == NULL); g_object_get (test->tube, "parameters", ¶meters, NULL); g_assert (parameters == NULL); parameters_vardict = tp_stream_tube_channel_dup_parameters_vardict ( test->tube); /* NULL as the tube has not been offered yet */ g_assert (parameters_vardict == NULL); g_object_get (test->tube, "parameters-vardict", ¶meters_vardict, NULL); g_assert (parameters_vardict == NULL); /* Incoming tube */ create_tube_service (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, FALSE); /* Parameters */ parameters = tp_stream_tube_channel_get_parameters (test->tube); parameters_vardict = tp_stream_tube_channel_dup_parameters_vardict ( test->tube); check_parameters (parameters, parameters_vardict); g_variant_unref (parameters_vardict); g_object_get (test->tube, "parameters", ¶meters, "parameters-vardict", ¶meters_vardict, NULL); g_assert (parameters_vardict != NULL); check_parameters (parameters, parameters_vardict); g_hash_table_unref (parameters); g_variant_unref (parameters_vardict); } static void tube_accept_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; test->tube_conn = tp_stream_tube_channel_accept_finish ( TP_STREAM_TUBE_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void write_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_output_stream_write_finish (G_OUTPUT_STREAM (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void read_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; gssize size; size = g_input_stream_read_finish (G_INPUT_STREAM (source), result, &test->error); g_assert_no_error (test->error); g_assert_cmpuint (size, !=, 0); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void chan_incoming_connection_cb (TpTestsStreamTubeChannel *chan, GIOStream *stream, Test *test) { test->cm_stream = g_object_ref (stream); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void use_tube_with_streams (Test *test, GIOStream *stream, GIOStream *cm_stream) { GOutputStream *out; GInputStream *in; gchar buffer[BUFFER_SIZE]; gchar cm_buffer[BUFFER_SIZE]; g_assert (stream != NULL); g_assert (cm_stream != NULL); /* User sends something through the tube */ out = g_io_stream_get_output_stream (stream); strcpy (buffer, "badger"); g_output_stream_write_async (out, buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, write_cb, test); /* ...CM reads them */ in = g_io_stream_get_input_stream (cm_stream); g_input_stream_read_async (in, cm_buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, read_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* CM received the right data */ g_assert_cmpstr (buffer, ==, cm_buffer); /* Now the CM writes some data to the tube */ out = g_io_stream_get_output_stream (cm_stream); strcpy (cm_buffer, "mushroom"); g_output_stream_write_async (out, cm_buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, write_cb, test); /* ...users reads them */ in = g_io_stream_get_input_stream (stream); g_input_stream_read_async (in, buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, read_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* client reads the right data */ g_assert_cmpstr (buffer, ==, cm_buffer); } static void use_tube (Test *test) { GSocketConnection *conn; conn = tp_stream_tube_connection_get_socket_connection (test->tube_conn); use_tube_with_streams (test, G_IO_STREAM (conn), test->cm_stream); } static void tube_conn_closed_cb (TpStreamTubeConnection *conn, GError *error, Test *test) { test->error = g_error_copy (error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_accept_success (Test *test, gconstpointer data) { guint i = GPOINTER_TO_UINT (data); TpContact *contact; if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && !have_creds) { g_message ("skipped: credentials-passing not supported here"); return; } if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { g_message ("skipped: IPv6 not supported here"); return; } create_tube_service (test, FALSE, contexts[i].address_type, contexts[i].access_control, contexts[i].contact); g_signal_connect (test->tube_chan_service, "incoming-connection", G_CALLBACK (chan_incoming_connection_cb), test); tp_stream_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->tube_conn != NULL); contact = tp_stream_tube_connection_get_contact (test->tube_conn); g_assert (contact != NULL); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alf"); use_tube (test); /* Connection is closed */ g_signal_connect (test->tube_conn, "closed", G_CALLBACK (tube_conn_closed_cb), test); tp_tests_stream_tube_channel_last_connection_disconnected ( test->tube_chan_service, TP_ERROR_STR_DISCONNECTED); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_DISCONNECTED); } static void tube_offer_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_stream_tube_channel_offer_finish (TP_STREAM_TUBE_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void tube_incoming_cb (TpStreamTubeChannel *tube, TpStreamTubeConnection *tube_conn, Test *test) { tp_clear_object (&test->tube_conn); test->tube_conn = g_object_ref (tube_conn); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void socket_connected (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_clear_object (&test->cm_stream); test->cm_stream = G_IO_STREAM (g_socket_client_connect_finish ( G_SOCKET_CLIENT (source), result, &test->error)); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static gboolean can_identify_contacts (gboolean contact, TpSocketAccessControl access_control) { if (contact) return TRUE; return access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS || access_control == TP_SOCKET_ACCESS_CONTROL_PORT; } static void test_offer_success (Test *test, gconstpointer data G_GNUC_UNUSED) { guint i = GPOINTER_TO_UINT (data); GHashTable *params; GSocketAddress *address; GSocketClient *client; TpHandle bob_handle; TpContact *contact; GVariant *parameters_vardict; if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && !have_creds) { g_message ("skipped: credentials-passing not supported here"); return; } if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { g_message ("skipped: IPv6 not supported here"); return; } create_tube_service (test, TRUE, contexts[i].address_type, contexts[i].access_control, contexts[i].contact); params = tp_asv_new ("badger", G_TYPE_UINT, 42, NULL); g_assert (tp_stream_tube_channel_get_parameters (test->tube) == NULL); tp_stream_tube_channel_offer_async (test->tube, params, tube_offer_cb, test); g_hash_table_unref (params); parameters_vardict = tp_stream_tube_channel_dup_parameters_vardict ( test->tube); check_parameters (tp_stream_tube_channel_get_parameters (test->tube), parameters_vardict); g_variant_unref (parameters_vardict); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* A client connects to the tube */ address = tp_tests_stream_tube_channel_get_server_address ( test->tube_chan_service); g_assert (address != NULL); client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); g_object_unref (address); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); /* The connection is announced on TpStreamTubeChannel */ g_signal_connect (test->tube, "incoming", G_CALLBACK (tube_incoming_cb), test); bob_handle = tp_handle_ensure (test->contact_repo, "bob", NULL, NULL); tp_tests_stream_tube_channel_peer_connected (test->tube_chan_service, test->cm_stream, bob_handle); test->wait = 1; g_main_loop_run (test->mainloop); g_assert (test->tube_conn != NULL); contact = tp_stream_tube_connection_get_contact (test->tube_conn); if (can_identify_contacts (contexts[i].contact, contexts[i].access_control)) { g_assert (contact != NULL); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "bob"); } else { g_assert (contact == NULL); } use_tube (test); /* Connection is closed */ g_signal_connect (test->tube_conn, "closed", G_CALLBACK (tube_conn_closed_cb), test); tp_tests_stream_tube_channel_last_connection_disconnected ( test->tube_chan_service, TP_ERROR_STR_DISCONNECTED); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_DISCONNECTED); tp_handle_unref (test->contact_repo, bob_handle); } static void test_accept_twice (Test *test, gconstpointer data G_GNUC_UNUSED) { create_tube_service (test, FALSE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, FALSE); tp_stream_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Try to re-accept the tube */ tp_stream_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); } static void test_accept_outgoing (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Try to accept an outgoing channel */ create_tube_service (test, TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, FALSE); tp_stream_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); } typedef void (*TestFunc) (Test *, gconstpointer); static gchar * test_context_to_str (TestContext *ctx, const gchar *base) { const gchar *type, *socket, *access_control; if (ctx->contact) type = "contact"; else type = "room"; switch (ctx->address_type) { case TP_SOCKET_ADDRESS_TYPE_UNIX: socket = "unix"; break; case TP_SOCKET_ADDRESS_TYPE_IPV4: socket = "ipv4"; break; case TP_SOCKET_ADDRESS_TYPE_IPV6: socket = "ipv6"; break; default: g_assert_not_reached (); } switch (ctx->access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: access_control = "localhost"; break; case TP_SOCKET_ACCESS_CONTROL_PORT: access_control = "port"; break; case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: access_control = "credentials"; break; default: g_assert_not_reached (); } return g_strdup_printf ("%s/%s/%s/%s", base, type, socket, access_control); } /* Run a test with each TestContext defined in contexts */ static void run_tube_test (const char *test_path, TestFunc ftest) { guint i; for (i = 0; contexts[i].address_type != TP_NUM_SOCKET_ADDRESS_TYPES; i++) { gchar *path = test_context_to_str (&contexts[i], test_path); g_test_add (path, Test, GUINT_TO_POINTER (i), setup, ftest, teardown); g_free (path); } } static void wait_tube_conn (Test *test, GIOStream **alice_stream, GIOStream **bob_stream) { GSocketConnection *conn; TpContact *contact; test->wait = 1; g_main_loop_run (test->mainloop); g_assert (test->tube_conn != NULL); conn = tp_stream_tube_connection_get_socket_connection (test->tube_conn); contact = tp_stream_tube_connection_get_contact (test->tube_conn); if (!tp_strdiff (tp_contact_get_identifier (contact), "bob")) { g_assert (*bob_stream == NULL); *bob_stream = g_object_ref (conn); } else if (!tp_strdiff (tp_contact_get_identifier (contact), "alice")) { g_assert (*alice_stream == NULL); *alice_stream = g_object_ref (conn); } else { g_assert_not_reached (); } } static void test_offer_race (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Two clients connect to the tube we offered but they are announced in a * racy way. */ guint i = GPOINTER_TO_UINT (data); GSocketAddress *address; GSocketClient *client; TpHandle alice_handle, bob_handle; GIOStream *alice_cm_stream, *bob_cm_stream; GIOStream *alice_stream = NULL, *bob_stream = NULL; if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_UNIX && contexts[i].access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS && !have_creds) { g_message ("skipped: credentials-passing not supported here"); return; } if (contexts[i].address_type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !have_ipv6) { g_message ("skipped: IPv6 not supported here"); return; } /* The race only appear in room stream tubes */ if (contexts[i].contact) return; /* We can't break the race with other access controles :( */ if (contexts[i].access_control != TP_SOCKET_ACCESS_CONTROL_PORT && contexts[i].access_control != TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) return; create_tube_service (test, TRUE, contexts[i].address_type, contexts[i].access_control, contexts[i].contact); tp_stream_tube_channel_offer_async (test->tube, NULL, tube_offer_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_signal_connect (test->tube, "incoming", G_CALLBACK (tube_incoming_cb), test); alice_handle = tp_handle_ensure (test->contact_repo, "alice", NULL, NULL); bob_handle = tp_handle_ensure (test->contact_repo, "bob", NULL, NULL); /* Alice connects to the tube */ address = tp_tests_stream_tube_channel_get_server_address ( test->tube_chan_service); g_assert (address != NULL); client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); alice_cm_stream = g_object_ref (test->cm_stream); /* Now Bob connects to the tube */ client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); bob_cm_stream = g_object_ref (test->cm_stream); /* The CM detects Bob's connection first */ tp_tests_stream_tube_channel_peer_connected (test->tube_chan_service, bob_cm_stream, bob_handle); /* ...and then detects Alice's connection */ tp_tests_stream_tube_channel_peer_connected (test->tube_chan_service, alice_cm_stream, alice_handle); /* Both connections are received and identified */ wait_tube_conn (test, &alice_stream, &bob_stream); wait_tube_conn (test, &alice_stream, &bob_stream); g_assert (alice_stream != NULL); g_assert (bob_stream != NULL); /* Check that the streams have been mapped to the right contact */ use_tube_with_streams (test, alice_stream, alice_cm_stream); use_tube_with_streams (test, bob_stream, bob_cm_stream); tp_handle_unref (test->contact_repo, alice_handle); g_object_unref (address); g_object_unref (alice_cm_stream); g_object_unref (bob_cm_stream); } static void read_eof_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; gssize size; size = g_input_stream_read_finish (G_INPUT_STREAM (source), result, &test->error); g_assert_no_error (test->error); g_assert_cmpuint (size, ==, 0); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } /* We offer a contact stream tube to bob. The CM is bugged and claim that * another contact has connected to the tube. Tp-glib ignores it. */ static void test_offer_bad_connection_conn_first (Test *test, gconstpointer data G_GNUC_UNUSED) { GSocketAddress *address; GSocketClient *client; TpHandle alice_handle; GInputStream *in; gchar cm_buffer[BUFFER_SIZE]; /* Offer a tube to Bob */ create_tube_service (test, TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, TRUE); tp_stream_tube_channel_offer_async (test->tube, NULL, tube_offer_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Alice client connects to the tube */ address = tp_tests_stream_tube_channel_get_server_address ( test->tube_chan_service); g_assert (address != NULL); client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); g_object_unref (address); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); /* The connection is *not* announced on TpStreamTubeChannel */ g_signal_connect (test->tube, "incoming", G_CALLBACK (tube_incoming_cb), test); /* Try to read on the stream to get EOF when it's closed */ in = g_io_stream_get_input_stream (test->cm_stream); g_input_stream_read_async (in, cm_buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, read_eof_cb, test); alice_handle = tp_handle_ensure (test->contact_repo, "alice", NULL, NULL); tp_tests_stream_tube_channel_peer_connected (test->tube_chan_service, test->cm_stream, alice_handle); test->wait = 1; g_main_loop_run (test->mainloop); /* "incoming" has not be fired */ g_assert (test->tube_conn == NULL); } /* Same test but now NewRemoteConnection is fired before the socket * connects */ static void test_offer_bad_connection_sig_first (Test *test, gconstpointer data G_GNUC_UNUSED) { GSocketAddress *address; GSocketClient *client; TpHandle alice_handle; GInputStream *in; gchar cm_buffer[BUFFER_SIZE]; /* Offer a tube to Bob */ create_tube_service (test, TRUE, TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST, TRUE); tp_stream_tube_channel_offer_async (test->tube, NULL, tube_offer_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* CM announces that Alice is connected */ alice_handle = tp_handle_ensure (test->contact_repo, "alice", NULL, NULL); tp_tests_stream_tube_channel_peer_connected (test->tube_chan_service, test->cm_stream, alice_handle); /* Alice client connects to the tube */ address = tp_tests_stream_tube_channel_get_server_address ( test->tube_chan_service); g_assert (address != NULL); client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); g_object_unref (address); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); /* The connection is *not* announced on TpStreamTubeChannel */ g_signal_connect (test->tube, "incoming", G_CALLBACK (tube_incoming_cb), test); /* Try to read on the stream to get EOF when it's closed */ in = g_io_stream_get_input_stream (test->cm_stream); g_input_stream_read_async (in, cm_buffer, BUFFER_SIZE, G_PRIORITY_DEFAULT, NULL, read_eof_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); /* "incoming" has not be fired */ g_assert (test->tube_conn == NULL); } static gboolean check_ipv6_support (void) { GInetAddress *address = NULL; GSocketAddress *socket_address = NULL; GSocket *sock = NULL; GError *error = NULL; const gchar *action; gboolean ret = TRUE; address = g_inet_address_new_loopback (G_SOCKET_FAMILY_IPV6); socket_address = g_inet_socket_address_new (address, 0); g_assert (address != NULL); g_assert (socket_address != NULL); action = "g_socket_new"; sock = g_socket_new (G_SOCKET_FAMILY_IPV6, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, &error); if (sock == NULL) goto denied; action = "g_socket_bind"; if (!g_socket_bind (sock, socket_address, TRUE, &error)) goto denied; action = "g_socket_listen"; if (!g_socket_listen (sock, &error)) goto denied; g_socket_close (sock, &error); g_assert_no_error (error); goto finally; denied: g_message ("IPv6 doesn't seem to work here and will not be tested.\n" "(%s failed: %s#%u: %s)", action, g_quark_to_string (error->domain), error->code, error->message); ret = FALSE; finally: tp_clear_object (&sock); tp_clear_object (&address); tp_clear_object (&socket_address); g_clear_error (&error); return ret; } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); have_ipv6 = check_ipv6_support (); #ifdef HAVE_GIO_UNIX have_creds = g_unix_credentials_message_is_supported (); #else have_creds = FALSE; #endif g_test_add ("/stream-tube/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/stream-tube/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/stream-tube/accept/twice", Test, NULL, setup, test_accept_twice, teardown); g_test_add ("/stream-tube/accept/outgoing", Test, NULL, setup, test_accept_outgoing, teardown); run_tube_test ("/stream-tube/accept/success", test_accept_success); run_tube_test ("/stream-tube/offer/success", test_offer_success); run_tube_test ("/stream-tube/offer/race", test_offer_race); g_test_add ("/stream-tube/offer/bad-connection/conn-first", Test, NULL, setup, test_offer_bad_connection_conn_first, teardown); g_test_add ("/stream-tube/offer/bad-connection/sig-first", Test, NULL, setup, test_offer_bad_connection_sig_first, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/Makefile.am0000644000175000017500000002316314004031760015565 00000000000000tests_list = \ test-account \ test-account-channel-request \ test-account-manager \ test-account-request \ test-base-client \ test-call-cancellation \ test-call-channel \ test-channel \ test-channel-dispatcher \ test-channel-dispatch-operation \ test-channel-introspect \ test-channel-request \ test-channel-manager-request-properties \ test-cli-group \ test-client \ test-client-channel-factory \ test-cm \ test-cm-message \ test-connection \ test-connection-aliasing \ test-connection-balance \ test-connection-bug-18845 \ test-connection-error \ test-connection-handles \ test-connection-inject-bug16307 \ test-connection-interests \ test-connection-getinterfaces-failure \ test-contact-lists \ test-contact-list-client \ test-contacts \ test-contacts-bug-19101 \ test-contacts-mixin \ test-contacts-slow-path \ test-dbus \ test-dbus-tube \ test-debug-client \ test-disconnection \ test-error-enum \ test-example-no-protocols \ test-file-transfer-channel \ test-finalized-in-invalidated-handler \ test-get-interface-after-invalidate \ test-group-mixin \ test-handle-repo \ test-handle-set \ test-invalidated-while-invoking-signals \ test-list-cm-no-cm \ test-long-connection-name \ test-message-mixin \ test-params-cm \ test-properties \ test-protocol-objects \ test-proxy-preparation \ test-room-list \ test-self-handle \ test-self-presence \ test-simple-approver \ test-simple-handler \ test-simple-observer \ test-stream-tube \ test-text-channel \ test-text-mixin \ test-text-respawn \ test-tls-certificate \ test-unsupported-interface if ENABLE_INSTALLED_TESTS managersdir = @tpglibtestsdir@/telepathy/managers/ managers_DATA = \ telepathy/managers/spurious.manager \ telepathy/managers/test_manager_file_invalid.manager \ telepathy/managers/test_manager_file.manager \ $(NULL) testsdir = @tpglibtestsdir@ tests_PROGRAMS = $(tests_list) tests_SCRIPTS = run-test.sh tests_DATA = tpglib-dbus-tests.list else noinst_PROGRAMS = $(tests_list) endif TESTS = $(tests_list) tpglib-dbus-tests.list: $(AM_V_GEN)echo $(tests_list) > $@ LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) test_account_SOURCES = account.c # this one uses internal ABI test_account_channel_request_SOURCES = account-channel-request.c test_account_channel_request_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_account_request_SOURCES = account-request.c test_account_manager_SOURCES = account-manager.c test_base_client_SOURCES = base-client.c test_call_cancellation_SOURCES = call-cancellation.c test_channel_SOURCES = channel.c test_channel_dispatcher_SOURCES = channel-dispatcher.c test_channel_dispatch_operation_SOURCES = channel-dispatch-operation.c test_channel_introspect_SOURCES = channel-introspect.c test_channel_request_SOURCES = channel-request.c test_call_channel_SOURCES = call-channel.c test_call_channel_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/call/libexample-cm-call.la test_client_SOURCES = client.c test_cli_group_SOURCES = cli-group.c test_cm_SOURCES = cm.c test_list_cm_no_cm_SOURCES = list-cm-no-cm.c test_connection_SOURCES = connection.c test_contact_lists_SOURCES = contact-lists.c test_contact_lists_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_contact_list_client_SOURCES = contact-list-client.c test_contact_list_client_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_connection_aliasing_SOURCES = connection-aliasing.c test_connection_aliasing_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_connection_balance_SOURCES = connection-balance.c test_connection_bug_18845_SOURCES = connection-bug-18845.c test_connection_handles_SOURCES = connection-handles.c test_connection_error_SOURCES = connection-error.c test_connection_inject_bug16307_SOURCES = connection-inject-bug16307.c test_connection_interests_SOURCES = connection-interests.c test_connection_getinterfaces_failure_SOURCES = \ connection-getinterfaces-failure.c test_contacts_SOURCES = contacts.c test_contacts_bug_19101_SOURCES = contacts-bug-19101.c test_contacts_mixin_SOURCES = contacts-mixin.c test_contacts_slow_path_SOURCES = contacts-slow-path.c test_dbus_SOURCES = dbus.c test_disconnection_SOURCES = disconnection.c test_error_enum_SOURCES = error-enum.c nodist_test_error_enum_SOURCES = _gen/errors-check.h test_example_no_protocols_SOURCES = example-no-protocols.c test_file_transfer_channel_SOURCES = file-transfer-channel.c test_finalized_in_invalidated_handler_SOURCES = \ finalized-in-invalidated-handler.c test_get_interface_after_invalidate_SOURCES = \ get-interface-after-invalidate.c test_group_mixin_SOURCES = group-mixin.c test_handle_repo_SOURCES = handle-repo.c test_handle_set_SOURCES = handle-set.c test_invalidated_while_invoking_signals_SOURCES = \ invalidated-while-invoking-signals.c test_long_connection_name_SOURCES = long-connection-name.c test_message_mixin_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_message_mixin_SOURCES = \ message-mixin.c test_properties_SOURCES = properties.c nodist_test_properties_SOURCES = \ _gen/svc.h \ _gen/svc.c test_protocol_objects_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_protocol_objects_SOURCES = protocol-objects.c test_self_handle_SOURCES = self-handle.c test_self_presence_SOURCES = self-presence.c test_text_mixin_SOURCES = text-mixin.c test_text_respawn_SOURCES = text-respawn.c test_unsupported_interface_SOURCES = unsupported-interface.c test_params_cm_SOURCES = \ params-cm.c test_simple_observer_SOURCES = simple-observer.c test_simple_approver_SOURCES = simple-approver.c test_simple_handler_SOURCES = simple-handler.c test_stream_tube_SOURCES = stream-tube.c test_client_channel_factory_SOURCES = client-channel-factory.c test_proxy_preparation_SOURCES = proxy-preparation.c test_channel_manager_request_properties_SOURCES = channel-manager-request-properties.c test_dbus_tube_SOURCES = dbus-tube.c # this one uses internal ABI test_cm_message_SOURCES = \ cm-message.c test_cm_message_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_text_channel_SOURCES = text-channel.c test_text_channel_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_debug_client_SOURCES = debug-client.c test_room_list_SOURCES = room-list.c test_tls_certificate_SOURCES = tls-certificate.c check_c_sources = *.c include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -D_TP_COMPILATION \ -D_TP_IGNORE_DEPRECATIONS \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) TESTS_ENVIRONMENT = \ abs_top_builddir=@abs_top_builddir@ \ XDG_DATA_HOME=@abs_builddir@ \ XDG_DATA_DIRS=@abs_srcdir@:$${XDG_DATA_DIRS:=/usr/local/share:/usr/share} \ G_SLICE=debug-blocks \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ GIO_USE_VFS=local \ GSETTINGS_BACKEND=memory \ TP_TESTS_SERVICES_DIR=@abs_srcdir@/dbus-1/services \ DBUS_SESSION_BUS_ADDRESS=this-is-clearly-not-valid \ $(top_srcdir)/tools/test-wrapper.sh \ $(EXTRA_TESTS_ENVIRONMENT) EXTRA_TESTS_ENVIRONMENT = check-valgrind: $(MAKE) check-TESTS \ maybe_gc_friendly=,gc-friendly \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" include $(top_srcdir)/tools/valgrind.mk VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env G_SLICE=always-malloc CHECK_VERBOSE=1 \ $(top_builddir)/libtool --mode=execute \ $(VALGRIND) --suppressions=$(top_srcdir)/tests/tests.supp $(VALGRIND_FLAGS) BUILT_SOURCES = \ _gen/errors-check.h \ _gen/svc.h \ _gen/svc.c \ run-test.sh \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) distclean-local: rm -f capture-*.log rm -rf _gen EXTRA_DIST = \ dbus-1/services/spurious.service \ telepathy/managers/spurious.manager \ telepathy/managers/test_manager_file.manager \ telepathy/managers/test_manager_file_invalid.manager \ with-properties.xml \ run-test.sh.in \ $(NULL) run-test.sh: run-test.sh.in $(AM_V_GEN)sed \ -e "s|[@]tpglibtestsdir[@]|@tpglibtestsdir@|g" \ -e "s|[@]libexec[@]|${libexecdir}|g" \ $< > $@ @chmod +x $@ service_files = dbus-1/services/spurious.service if ENABLE_INSTALLED_TESTS dbusservicedir = @tpglibtestsdir@/dbus-1/services dbusservice_DATA = $(service_files) endif _gen/svc.h: _gen/svc.c @: _gen/svc.c: with-properties.xml \ $(top_srcdir)/tools/glib-ginterface-gen.py \ Makefile.am $(AM_V_at)$(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-ginterface-gen.py \ --filename=_gen/svc \ --signal-marshal-prefix=NOT_NEEDED \ --include='' \ $< Test_Svc_ _gen/errors-check.h: $(top_srcdir)/spec/errors.xml \ $(top_srcdir)/tools/glib-errors-check-gen.py $(AM_V_at)$(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-errors-check-gen.py $< > $@ telepathy-glib-0.24.2/tests/dbus/Makefile.in0000644000175000017500000041056514006601553015611 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @ENABLE_INSTALLED_TESTS_TRUE@tests_PROGRAMS = $(am__EXEEXT_1) @ENABLE_INSTALLED_TESTS_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) TESTS = $(am__EXEEXT_1) subdir = tests/dbus ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test-account$(EXEEXT) \ test-account-channel-request$(EXEEXT) \ test-account-manager$(EXEEXT) test-account-request$(EXEEXT) \ test-base-client$(EXEEXT) test-call-cancellation$(EXEEXT) \ test-call-channel$(EXEEXT) test-channel$(EXEEXT) \ test-channel-dispatcher$(EXEEXT) \ test-channel-dispatch-operation$(EXEEXT) \ test-channel-introspect$(EXEEXT) test-channel-request$(EXEEXT) \ test-channel-manager-request-properties$(EXEEXT) \ test-cli-group$(EXEEXT) test-client$(EXEEXT) \ test-client-channel-factory$(EXEEXT) test-cm$(EXEEXT) \ test-cm-message$(EXEEXT) test-connection$(EXEEXT) \ test-connection-aliasing$(EXEEXT) \ test-connection-balance$(EXEEXT) \ test-connection-bug-18845$(EXEEXT) \ test-connection-error$(EXEEXT) \ test-connection-handles$(EXEEXT) \ test-connection-inject-bug16307$(EXEEXT) \ test-connection-interests$(EXEEXT) \ test-connection-getinterfaces-failure$(EXEEXT) \ test-contact-lists$(EXEEXT) test-contact-list-client$(EXEEXT) \ test-contacts$(EXEEXT) test-contacts-bug-19101$(EXEEXT) \ test-contacts-mixin$(EXEEXT) test-contacts-slow-path$(EXEEXT) \ test-dbus$(EXEEXT) test-dbus-tube$(EXEEXT) \ test-debug-client$(EXEEXT) test-disconnection$(EXEEXT) \ test-error-enum$(EXEEXT) test-example-no-protocols$(EXEEXT) \ test-file-transfer-channel$(EXEEXT) \ test-finalized-in-invalidated-handler$(EXEEXT) \ test-get-interface-after-invalidate$(EXEEXT) \ test-group-mixin$(EXEEXT) test-handle-repo$(EXEEXT) \ test-handle-set$(EXEEXT) \ test-invalidated-while-invoking-signals$(EXEEXT) \ test-list-cm-no-cm$(EXEEXT) test-long-connection-name$(EXEEXT) \ test-message-mixin$(EXEEXT) test-params-cm$(EXEEXT) \ test-properties$(EXEEXT) test-protocol-objects$(EXEEXT) \ test-proxy-preparation$(EXEEXT) test-room-list$(EXEEXT) \ test-self-handle$(EXEEXT) test-self-presence$(EXEEXT) \ test-simple-approver$(EXEEXT) test-simple-handler$(EXEEXT) \ test-simple-observer$(EXEEXT) test-stream-tube$(EXEEXT) \ test-text-channel$(EXEEXT) test-text-mixin$(EXEEXT) \ test-text-respawn$(EXEEXT) test-tls-certificate$(EXEEXT) \ test-unsupported-interface$(EXEEXT) am__installdirs = "$(DESTDIR)$(testsdir)" "$(DESTDIR)$(testsdir)" \ "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(managersdir)" \ "$(DESTDIR)$(testsdir)" PROGRAMS = $(noinst_PROGRAMS) $(tests_PROGRAMS) am_test_account_OBJECTS = account.$(OBJEXT) test_account_OBJECTS = $(am_test_account_OBJECTS) test_account_LDADD = $(LDADD) am__DEPENDENCIES_1 = test_account_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_test_account_channel_request_OBJECTS = \ account-channel-request.$(OBJEXT) test_account_channel_request_OBJECTS = \ $(am_test_account_channel_request_OBJECTS) test_account_channel_request_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(am__DEPENDENCIES_1) am_test_account_manager_OBJECTS = account-manager.$(OBJEXT) test_account_manager_OBJECTS = $(am_test_account_manager_OBJECTS) test_account_manager_LDADD = $(LDADD) test_account_manager_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_account_request_OBJECTS = account-request.$(OBJEXT) test_account_request_OBJECTS = $(am_test_account_request_OBJECTS) test_account_request_LDADD = $(LDADD) test_account_request_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_base_client_OBJECTS = base-client.$(OBJEXT) test_base_client_OBJECTS = $(am_test_base_client_OBJECTS) test_base_client_LDADD = $(LDADD) test_base_client_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_call_cancellation_OBJECTS = call-cancellation.$(OBJEXT) test_call_cancellation_OBJECTS = $(am_test_call_cancellation_OBJECTS) test_call_cancellation_LDADD = $(LDADD) test_call_cancellation_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_call_channel_OBJECTS = call-channel.$(OBJEXT) test_call_channel_OBJECTS = $(am_test_call_channel_OBJECTS) am__DEPENDENCIES_2 = $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_call_channel_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/call/libexample-cm-call.la am_test_channel_OBJECTS = channel.$(OBJEXT) test_channel_OBJECTS = $(am_test_channel_OBJECTS) test_channel_LDADD = $(LDADD) test_channel_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_channel_dispatch_operation_OBJECTS = \ channel-dispatch-operation.$(OBJEXT) test_channel_dispatch_operation_OBJECTS = \ $(am_test_channel_dispatch_operation_OBJECTS) test_channel_dispatch_operation_LDADD = $(LDADD) test_channel_dispatch_operation_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_channel_dispatcher_OBJECTS = channel-dispatcher.$(OBJEXT) test_channel_dispatcher_OBJECTS = \ $(am_test_channel_dispatcher_OBJECTS) test_channel_dispatcher_LDADD = $(LDADD) test_channel_dispatcher_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_channel_introspect_OBJECTS = channel-introspect.$(OBJEXT) test_channel_introspect_OBJECTS = \ $(am_test_channel_introspect_OBJECTS) test_channel_introspect_LDADD = $(LDADD) test_channel_introspect_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_channel_manager_request_properties_OBJECTS = \ channel-manager-request-properties.$(OBJEXT) test_channel_manager_request_properties_OBJECTS = \ $(am_test_channel_manager_request_properties_OBJECTS) test_channel_manager_request_properties_LDADD = $(LDADD) test_channel_manager_request_properties_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_channel_request_OBJECTS = channel-request.$(OBJEXT) test_channel_request_OBJECTS = $(am_test_channel_request_OBJECTS) test_channel_request_LDADD = $(LDADD) test_channel_request_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_cli_group_OBJECTS = cli-group.$(OBJEXT) test_cli_group_OBJECTS = $(am_test_cli_group_OBJECTS) test_cli_group_LDADD = $(LDADD) test_cli_group_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_client_OBJECTS = client.$(OBJEXT) test_client_OBJECTS = $(am_test_client_OBJECTS) test_client_LDADD = $(LDADD) test_client_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_client_channel_factory_OBJECTS = \ client-channel-factory.$(OBJEXT) test_client_channel_factory_OBJECTS = \ $(am_test_client_channel_factory_OBJECTS) test_client_channel_factory_LDADD = $(LDADD) test_client_channel_factory_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_cm_OBJECTS = cm.$(OBJEXT) test_cm_OBJECTS = $(am_test_cm_OBJECTS) test_cm_LDADD = $(LDADD) test_cm_DEPENDENCIES = $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_cm_message_OBJECTS = cm-message.$(OBJEXT) test_cm_message_OBJECTS = $(am_test_cm_message_OBJECTS) test_cm_message_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(am__DEPENDENCIES_1) am_test_connection_OBJECTS = connection.$(OBJEXT) test_connection_OBJECTS = $(am_test_connection_OBJECTS) test_connection_LDADD = $(LDADD) test_connection_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_aliasing_OBJECTS = connection-aliasing.$(OBJEXT) test_connection_aliasing_OBJECTS = \ $(am_test_connection_aliasing_OBJECTS) test_connection_aliasing_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la am_test_connection_balance_OBJECTS = connection-balance.$(OBJEXT) test_connection_balance_OBJECTS = \ $(am_test_connection_balance_OBJECTS) test_connection_balance_LDADD = $(LDADD) test_connection_balance_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_bug_18845_OBJECTS = connection-bug-18845.$(OBJEXT) test_connection_bug_18845_OBJECTS = \ $(am_test_connection_bug_18845_OBJECTS) test_connection_bug_18845_LDADD = $(LDADD) test_connection_bug_18845_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_error_OBJECTS = connection-error.$(OBJEXT) test_connection_error_OBJECTS = $(am_test_connection_error_OBJECTS) test_connection_error_LDADD = $(LDADD) test_connection_error_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_getinterfaces_failure_OBJECTS = \ connection-getinterfaces-failure.$(OBJEXT) test_connection_getinterfaces_failure_OBJECTS = \ $(am_test_connection_getinterfaces_failure_OBJECTS) test_connection_getinterfaces_failure_LDADD = $(LDADD) test_connection_getinterfaces_failure_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_handles_OBJECTS = connection-handles.$(OBJEXT) test_connection_handles_OBJECTS = \ $(am_test_connection_handles_OBJECTS) test_connection_handles_LDADD = $(LDADD) test_connection_handles_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_inject_bug16307_OBJECTS = \ connection-inject-bug16307.$(OBJEXT) test_connection_inject_bug16307_OBJECTS = \ $(am_test_connection_inject_bug16307_OBJECTS) test_connection_inject_bug16307_LDADD = $(LDADD) test_connection_inject_bug16307_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_connection_interests_OBJECTS = connection-interests.$(OBJEXT) test_connection_interests_OBJECTS = \ $(am_test_connection_interests_OBJECTS) test_connection_interests_LDADD = $(LDADD) test_connection_interests_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_contact_list_client_OBJECTS = contact-list-client.$(OBJEXT) test_contact_list_client_OBJECTS = \ $(am_test_contact_list_client_OBJECTS) test_contact_list_client_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la am_test_contact_lists_OBJECTS = contact-lists.$(OBJEXT) test_contact_lists_OBJECTS = $(am_test_contact_lists_OBJECTS) test_contact_lists_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la am_test_contacts_OBJECTS = contacts.$(OBJEXT) test_contacts_OBJECTS = $(am_test_contacts_OBJECTS) test_contacts_LDADD = $(LDADD) test_contacts_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_contacts_bug_19101_OBJECTS = contacts-bug-19101.$(OBJEXT) test_contacts_bug_19101_OBJECTS = \ $(am_test_contacts_bug_19101_OBJECTS) test_contacts_bug_19101_LDADD = $(LDADD) test_contacts_bug_19101_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_contacts_mixin_OBJECTS = contacts-mixin.$(OBJEXT) test_contacts_mixin_OBJECTS = $(am_test_contacts_mixin_OBJECTS) test_contacts_mixin_LDADD = $(LDADD) test_contacts_mixin_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_contacts_slow_path_OBJECTS = contacts-slow-path.$(OBJEXT) test_contacts_slow_path_OBJECTS = \ $(am_test_contacts_slow_path_OBJECTS) test_contacts_slow_path_LDADD = $(LDADD) test_contacts_slow_path_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_dbus_OBJECTS = dbus.$(OBJEXT) test_dbus_OBJECTS = $(am_test_dbus_OBJECTS) test_dbus_LDADD = $(LDADD) test_dbus_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_dbus_tube_OBJECTS = dbus-tube.$(OBJEXT) test_dbus_tube_OBJECTS = $(am_test_dbus_tube_OBJECTS) test_dbus_tube_LDADD = $(LDADD) test_dbus_tube_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_debug_client_OBJECTS = debug-client.$(OBJEXT) test_debug_client_OBJECTS = $(am_test_debug_client_OBJECTS) test_debug_client_LDADD = $(LDADD) test_debug_client_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_disconnection_OBJECTS = disconnection.$(OBJEXT) test_disconnection_OBJECTS = $(am_test_disconnection_OBJECTS) test_disconnection_LDADD = $(LDADD) test_disconnection_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_error_enum_OBJECTS = error-enum.$(OBJEXT) nodist_test_error_enum_OBJECTS = test_error_enum_OBJECTS = $(am_test_error_enum_OBJECTS) \ $(nodist_test_error_enum_OBJECTS) test_error_enum_LDADD = $(LDADD) test_error_enum_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_example_no_protocols_OBJECTS = example-no-protocols.$(OBJEXT) test_example_no_protocols_OBJECTS = \ $(am_test_example_no_protocols_OBJECTS) test_example_no_protocols_LDADD = $(LDADD) test_example_no_protocols_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_file_transfer_channel_OBJECTS = \ file-transfer-channel.$(OBJEXT) test_file_transfer_channel_OBJECTS = \ $(am_test_file_transfer_channel_OBJECTS) test_file_transfer_channel_LDADD = $(LDADD) test_file_transfer_channel_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_finalized_in_invalidated_handler_OBJECTS = \ finalized-in-invalidated-handler.$(OBJEXT) test_finalized_in_invalidated_handler_OBJECTS = \ $(am_test_finalized_in_invalidated_handler_OBJECTS) test_finalized_in_invalidated_handler_LDADD = $(LDADD) test_finalized_in_invalidated_handler_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_get_interface_after_invalidate_OBJECTS = \ get-interface-after-invalidate.$(OBJEXT) test_get_interface_after_invalidate_OBJECTS = \ $(am_test_get_interface_after_invalidate_OBJECTS) test_get_interface_after_invalidate_LDADD = $(LDADD) test_get_interface_after_invalidate_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_group_mixin_OBJECTS = group-mixin.$(OBJEXT) test_group_mixin_OBJECTS = $(am_test_group_mixin_OBJECTS) test_group_mixin_LDADD = $(LDADD) test_group_mixin_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_handle_repo_OBJECTS = handle-repo.$(OBJEXT) test_handle_repo_OBJECTS = $(am_test_handle_repo_OBJECTS) test_handle_repo_LDADD = $(LDADD) test_handle_repo_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_handle_set_OBJECTS = handle-set.$(OBJEXT) test_handle_set_OBJECTS = $(am_test_handle_set_OBJECTS) test_handle_set_LDADD = $(LDADD) test_handle_set_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_invalidated_while_invoking_signals_OBJECTS = \ invalidated-while-invoking-signals.$(OBJEXT) test_invalidated_while_invoking_signals_OBJECTS = \ $(am_test_invalidated_while_invoking_signals_OBJECTS) test_invalidated_while_invoking_signals_LDADD = $(LDADD) test_invalidated_while_invoking_signals_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_list_cm_no_cm_OBJECTS = list-cm-no-cm.$(OBJEXT) test_list_cm_no_cm_OBJECTS = $(am_test_list_cm_no_cm_OBJECTS) test_list_cm_no_cm_LDADD = $(LDADD) test_list_cm_no_cm_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_long_connection_name_OBJECTS = long-connection-name.$(OBJEXT) test_long_connection_name_OBJECTS = \ $(am_test_long_connection_name_OBJECTS) test_long_connection_name_LDADD = $(LDADD) test_long_connection_name_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_message_mixin_OBJECTS = message-mixin.$(OBJEXT) test_message_mixin_OBJECTS = $(am_test_message_mixin_OBJECTS) test_message_mixin_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la am_test_params_cm_OBJECTS = params-cm.$(OBJEXT) test_params_cm_OBJECTS = $(am_test_params_cm_OBJECTS) test_params_cm_LDADD = $(LDADD) test_params_cm_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_properties_OBJECTS = properties.$(OBJEXT) am__dirstamp = $(am__leading_dot)dirstamp nodist_test_properties_OBJECTS = _gen/svc.$(OBJEXT) test_properties_OBJECTS = $(am_test_properties_OBJECTS) \ $(nodist_test_properties_OBJECTS) test_properties_LDADD = $(LDADD) test_properties_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_protocol_objects_OBJECTS = protocol-objects.$(OBJEXT) test_protocol_objects_OBJECTS = $(am_test_protocol_objects_OBJECTS) test_protocol_objects_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la am_test_proxy_preparation_OBJECTS = proxy-preparation.$(OBJEXT) test_proxy_preparation_OBJECTS = $(am_test_proxy_preparation_OBJECTS) test_proxy_preparation_LDADD = $(LDADD) test_proxy_preparation_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_room_list_OBJECTS = room-list.$(OBJEXT) test_room_list_OBJECTS = $(am_test_room_list_OBJECTS) test_room_list_LDADD = $(LDADD) test_room_list_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_self_handle_OBJECTS = self-handle.$(OBJEXT) test_self_handle_OBJECTS = $(am_test_self_handle_OBJECTS) test_self_handle_LDADD = $(LDADD) test_self_handle_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_self_presence_OBJECTS = self-presence.$(OBJEXT) test_self_presence_OBJECTS = $(am_test_self_presence_OBJECTS) test_self_presence_LDADD = $(LDADD) test_self_presence_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_simple_approver_OBJECTS = simple-approver.$(OBJEXT) test_simple_approver_OBJECTS = $(am_test_simple_approver_OBJECTS) test_simple_approver_LDADD = $(LDADD) test_simple_approver_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_simple_handler_OBJECTS = simple-handler.$(OBJEXT) test_simple_handler_OBJECTS = $(am_test_simple_handler_OBJECTS) test_simple_handler_LDADD = $(LDADD) test_simple_handler_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_simple_observer_OBJECTS = simple-observer.$(OBJEXT) test_simple_observer_OBJECTS = $(am_test_simple_observer_OBJECTS) test_simple_observer_LDADD = $(LDADD) test_simple_observer_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_stream_tube_OBJECTS = stream-tube.$(OBJEXT) test_stream_tube_OBJECTS = $(am_test_stream_tube_OBJECTS) test_stream_tube_LDADD = $(LDADD) test_stream_tube_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_text_channel_OBJECTS = text-channel.$(OBJEXT) test_text_channel_OBJECTS = $(am_test_text_channel_OBJECTS) test_text_channel_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la am_test_text_mixin_OBJECTS = text-mixin.$(OBJEXT) test_text_mixin_OBJECTS = $(am_test_text_mixin_OBJECTS) test_text_mixin_LDADD = $(LDADD) test_text_mixin_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_text_respawn_OBJECTS = text-respawn.$(OBJEXT) test_text_respawn_OBJECTS = $(am_test_text_respawn_OBJECTS) test_text_respawn_LDADD = $(LDADD) test_text_respawn_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_tls_certificate_OBJECTS = tls-certificate.$(OBJEXT) test_tls_certificate_OBJECTS = $(am_test_tls_certificate_OBJECTS) test_tls_certificate_LDADD = $(LDADD) test_tls_certificate_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_unsupported_interface_OBJECTS = \ unsupported-interface.$(OBJEXT) test_unsupported_interface_OBJECTS = \ $(am_test_unsupported_interface_OBJECTS) test_unsupported_interface_LDADD = $(LDADD) test_unsupported_interface_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(tests_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/account-channel-request.Po \ ./$(DEPDIR)/account-manager.Po ./$(DEPDIR)/account-request.Po \ ./$(DEPDIR)/account.Po ./$(DEPDIR)/base-client.Po \ ./$(DEPDIR)/call-cancellation.Po ./$(DEPDIR)/call-channel.Po \ ./$(DEPDIR)/channel-dispatch-operation.Po \ ./$(DEPDIR)/channel-dispatcher.Po \ ./$(DEPDIR)/channel-introspect.Po \ ./$(DEPDIR)/channel-manager-request-properties.Po \ ./$(DEPDIR)/channel-request.Po ./$(DEPDIR)/channel.Po \ ./$(DEPDIR)/cli-group.Po ./$(DEPDIR)/client-channel-factory.Po \ ./$(DEPDIR)/client.Po ./$(DEPDIR)/cm-message.Po \ ./$(DEPDIR)/cm.Po ./$(DEPDIR)/connection-aliasing.Po \ ./$(DEPDIR)/connection-balance.Po \ ./$(DEPDIR)/connection-bug-18845.Po \ ./$(DEPDIR)/connection-error.Po \ ./$(DEPDIR)/connection-getinterfaces-failure.Po \ ./$(DEPDIR)/connection-handles.Po \ ./$(DEPDIR)/connection-inject-bug16307.Po \ ./$(DEPDIR)/connection-interests.Po ./$(DEPDIR)/connection.Po \ ./$(DEPDIR)/contact-list-client.Po \ ./$(DEPDIR)/contact-lists.Po ./$(DEPDIR)/contacts-bug-19101.Po \ ./$(DEPDIR)/contacts-mixin.Po \ ./$(DEPDIR)/contacts-slow-path.Po ./$(DEPDIR)/contacts.Po \ ./$(DEPDIR)/dbus-tube.Po ./$(DEPDIR)/dbus.Po \ ./$(DEPDIR)/debug-client.Po ./$(DEPDIR)/disconnection.Po \ ./$(DEPDIR)/error-enum.Po ./$(DEPDIR)/example-no-protocols.Po \ ./$(DEPDIR)/file-transfer-channel.Po \ ./$(DEPDIR)/finalized-in-invalidated-handler.Po \ ./$(DEPDIR)/get-interface-after-invalidate.Po \ ./$(DEPDIR)/group-mixin.Po ./$(DEPDIR)/handle-repo.Po \ ./$(DEPDIR)/handle-set.Po \ ./$(DEPDIR)/invalidated-while-invoking-signals.Po \ ./$(DEPDIR)/list-cm-no-cm.Po \ ./$(DEPDIR)/long-connection-name.Po \ ./$(DEPDIR)/message-mixin.Po ./$(DEPDIR)/params-cm.Po \ ./$(DEPDIR)/properties.Po ./$(DEPDIR)/protocol-objects.Po \ ./$(DEPDIR)/proxy-preparation.Po ./$(DEPDIR)/room-list.Po \ ./$(DEPDIR)/self-handle.Po ./$(DEPDIR)/self-presence.Po \ ./$(DEPDIR)/simple-approver.Po ./$(DEPDIR)/simple-handler.Po \ ./$(DEPDIR)/simple-observer.Po ./$(DEPDIR)/stream-tube.Po \ ./$(DEPDIR)/text-channel.Po ./$(DEPDIR)/text-mixin.Po \ ./$(DEPDIR)/text-respawn.Po ./$(DEPDIR)/tls-certificate.Po \ ./$(DEPDIR)/unsupported-interface.Po _gen/$(DEPDIR)/svc.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(test_account_SOURCES) \ $(test_account_channel_request_SOURCES) \ $(test_account_manager_SOURCES) \ $(test_account_request_SOURCES) $(test_base_client_SOURCES) \ $(test_call_cancellation_SOURCES) $(test_call_channel_SOURCES) \ $(test_channel_SOURCES) \ $(test_channel_dispatch_operation_SOURCES) \ $(test_channel_dispatcher_SOURCES) \ $(test_channel_introspect_SOURCES) \ $(test_channel_manager_request_properties_SOURCES) \ $(test_channel_request_SOURCES) $(test_cli_group_SOURCES) \ $(test_client_SOURCES) $(test_client_channel_factory_SOURCES) \ $(test_cm_SOURCES) $(test_cm_message_SOURCES) \ $(test_connection_SOURCES) $(test_connection_aliasing_SOURCES) \ $(test_connection_balance_SOURCES) \ $(test_connection_bug_18845_SOURCES) \ $(test_connection_error_SOURCES) \ $(test_connection_getinterfaces_failure_SOURCES) \ $(test_connection_handles_SOURCES) \ $(test_connection_inject_bug16307_SOURCES) \ $(test_connection_interests_SOURCES) \ $(test_contact_list_client_SOURCES) \ $(test_contact_lists_SOURCES) $(test_contacts_SOURCES) \ $(test_contacts_bug_19101_SOURCES) \ $(test_contacts_mixin_SOURCES) \ $(test_contacts_slow_path_SOURCES) $(test_dbus_SOURCES) \ $(test_dbus_tube_SOURCES) $(test_debug_client_SOURCES) \ $(test_disconnection_SOURCES) $(test_error_enum_SOURCES) \ $(nodist_test_error_enum_SOURCES) \ $(test_example_no_protocols_SOURCES) \ $(test_file_transfer_channel_SOURCES) \ $(test_finalized_in_invalidated_handler_SOURCES) \ $(test_get_interface_after_invalidate_SOURCES) \ $(test_group_mixin_SOURCES) $(test_handle_repo_SOURCES) \ $(test_handle_set_SOURCES) \ $(test_invalidated_while_invoking_signals_SOURCES) \ $(test_list_cm_no_cm_SOURCES) \ $(test_long_connection_name_SOURCES) \ $(test_message_mixin_SOURCES) $(test_params_cm_SOURCES) \ $(test_properties_SOURCES) $(nodist_test_properties_SOURCES) \ $(test_protocol_objects_SOURCES) \ $(test_proxy_preparation_SOURCES) $(test_room_list_SOURCES) \ $(test_self_handle_SOURCES) $(test_self_presence_SOURCES) \ $(test_simple_approver_SOURCES) $(test_simple_handler_SOURCES) \ $(test_simple_observer_SOURCES) $(test_stream_tube_SOURCES) \ $(test_text_channel_SOURCES) $(test_text_mixin_SOURCES) \ $(test_text_respawn_SOURCES) $(test_tls_certificate_SOURCES) \ $(test_unsupported_interface_SOURCES) DIST_SOURCES = $(test_account_SOURCES) \ $(test_account_channel_request_SOURCES) \ $(test_account_manager_SOURCES) \ $(test_account_request_SOURCES) $(test_base_client_SOURCES) \ $(test_call_cancellation_SOURCES) $(test_call_channel_SOURCES) \ $(test_channel_SOURCES) \ $(test_channel_dispatch_operation_SOURCES) \ $(test_channel_dispatcher_SOURCES) \ $(test_channel_introspect_SOURCES) \ $(test_channel_manager_request_properties_SOURCES) \ $(test_channel_request_SOURCES) $(test_cli_group_SOURCES) \ $(test_client_SOURCES) $(test_client_channel_factory_SOURCES) \ $(test_cm_SOURCES) $(test_cm_message_SOURCES) \ $(test_connection_SOURCES) $(test_connection_aliasing_SOURCES) \ $(test_connection_balance_SOURCES) \ $(test_connection_bug_18845_SOURCES) \ $(test_connection_error_SOURCES) \ $(test_connection_getinterfaces_failure_SOURCES) \ $(test_connection_handles_SOURCES) \ $(test_connection_inject_bug16307_SOURCES) \ $(test_connection_interests_SOURCES) \ $(test_contact_list_client_SOURCES) \ $(test_contact_lists_SOURCES) $(test_contacts_SOURCES) \ $(test_contacts_bug_19101_SOURCES) \ $(test_contacts_mixin_SOURCES) \ $(test_contacts_slow_path_SOURCES) $(test_dbus_SOURCES) \ $(test_dbus_tube_SOURCES) $(test_debug_client_SOURCES) \ $(test_disconnection_SOURCES) $(test_error_enum_SOURCES) \ $(test_example_no_protocols_SOURCES) \ $(test_file_transfer_channel_SOURCES) \ $(test_finalized_in_invalidated_handler_SOURCES) \ $(test_get_interface_after_invalidate_SOURCES) \ $(test_group_mixin_SOURCES) $(test_handle_repo_SOURCES) \ $(test_handle_set_SOURCES) \ $(test_invalidated_while_invoking_signals_SOURCES) \ $(test_list_cm_no_cm_SOURCES) \ $(test_long_connection_name_SOURCES) \ $(test_message_mixin_SOURCES) $(test_params_cm_SOURCES) \ $(test_properties_SOURCES) $(test_protocol_objects_SOURCES) \ $(test_proxy_preparation_SOURCES) $(test_room_list_SOURCES) \ $(test_self_handle_SOURCES) $(test_self_presence_SOURCES) \ $(test_simple_approver_SOURCES) $(test_simple_handler_SOURCES) \ $(test_simple_observer_SOURCES) $(test_stream_tube_SOURCES) \ $(test_text_channel_SOURCES) $(test_text_mixin_SOURCES) \ $(test_text_respawn_SOURCES) $(test_tls_certificate_SOURCES) \ $(test_unsupported_interface_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(dbusservice_DATA) $(managers_DATA) $(tests_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver \ $(top_srcdir)/tools/check-coding-style.mk \ $(top_srcdir)/tools/valgrind.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ tests_list = \ test-account \ test-account-channel-request \ test-account-manager \ test-account-request \ test-base-client \ test-call-cancellation \ test-call-channel \ test-channel \ test-channel-dispatcher \ test-channel-dispatch-operation \ test-channel-introspect \ test-channel-request \ test-channel-manager-request-properties \ test-cli-group \ test-client \ test-client-channel-factory \ test-cm \ test-cm-message \ test-connection \ test-connection-aliasing \ test-connection-balance \ test-connection-bug-18845 \ test-connection-error \ test-connection-handles \ test-connection-inject-bug16307 \ test-connection-interests \ test-connection-getinterfaces-failure \ test-contact-lists \ test-contact-list-client \ test-contacts \ test-contacts-bug-19101 \ test-contacts-mixin \ test-contacts-slow-path \ test-dbus \ test-dbus-tube \ test-debug-client \ test-disconnection \ test-error-enum \ test-example-no-protocols \ test-file-transfer-channel \ test-finalized-in-invalidated-handler \ test-get-interface-after-invalidate \ test-group-mixin \ test-handle-repo \ test-handle-set \ test-invalidated-while-invoking-signals \ test-list-cm-no-cm \ test-long-connection-name \ test-message-mixin \ test-params-cm \ test-properties \ test-protocol-objects \ test-proxy-preparation \ test-room-list \ test-self-handle \ test-self-presence \ test-simple-approver \ test-simple-handler \ test-simple-observer \ test-stream-tube \ test-text-channel \ test-text-mixin \ test-text-respawn \ test-tls-certificate \ test-unsupported-interface @ENABLE_INSTALLED_TESTS_TRUE@managersdir = @tpglibtestsdir@/telepathy/managers/ @ENABLE_INSTALLED_TESTS_TRUE@managers_DATA = \ @ENABLE_INSTALLED_TESTS_TRUE@ telepathy/managers/spurious.manager \ @ENABLE_INSTALLED_TESTS_TRUE@ telepathy/managers/test_manager_file_invalid.manager \ @ENABLE_INSTALLED_TESTS_TRUE@ telepathy/managers/test_manager_file.manager \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) @ENABLE_INSTALLED_TESTS_TRUE@testsdir = @tpglibtestsdir@ @ENABLE_INSTALLED_TESTS_TRUE@tests_SCRIPTS = run-test.sh @ENABLE_INSTALLED_TESTS_TRUE@tests_DATA = tpglib-dbus-tests.list LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) test_account_SOURCES = account.c # this one uses internal ABI test_account_channel_request_SOURCES = account-channel-request.c test_account_channel_request_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_account_request_SOURCES = account-request.c test_account_manager_SOURCES = account-manager.c test_base_client_SOURCES = base-client.c test_call_cancellation_SOURCES = call-cancellation.c test_channel_SOURCES = channel.c test_channel_dispatcher_SOURCES = channel-dispatcher.c test_channel_dispatch_operation_SOURCES = channel-dispatch-operation.c test_channel_introspect_SOURCES = channel-introspect.c test_channel_request_SOURCES = channel-request.c test_call_channel_SOURCES = call-channel.c test_call_channel_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/call/libexample-cm-call.la test_client_SOURCES = client.c test_cli_group_SOURCES = cli-group.c test_cm_SOURCES = cm.c test_list_cm_no_cm_SOURCES = list-cm-no-cm.c test_connection_SOURCES = connection.c test_contact_lists_SOURCES = contact-lists.c test_contact_lists_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_contact_list_client_SOURCES = contact-list-client.c test_contact_list_client_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_connection_aliasing_SOURCES = connection-aliasing.c test_connection_aliasing_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/contactlist/libexample-cm-contactlist.la test_connection_balance_SOURCES = connection-balance.c test_connection_bug_18845_SOURCES = connection-bug-18845.c test_connection_handles_SOURCES = connection-handles.c test_connection_error_SOURCES = connection-error.c test_connection_inject_bug16307_SOURCES = connection-inject-bug16307.c test_connection_interests_SOURCES = connection-interests.c test_connection_getinterfaces_failure_SOURCES = \ connection-getinterfaces-failure.c test_contacts_SOURCES = contacts.c test_contacts_bug_19101_SOURCES = contacts-bug-19101.c test_contacts_mixin_SOURCES = contacts-mixin.c test_contacts_slow_path_SOURCES = contacts-slow-path.c test_dbus_SOURCES = dbus.c test_disconnection_SOURCES = disconnection.c test_error_enum_SOURCES = error-enum.c nodist_test_error_enum_SOURCES = _gen/errors-check.h test_example_no_protocols_SOURCES = example-no-protocols.c test_file_transfer_channel_SOURCES = file-transfer-channel.c test_finalized_in_invalidated_handler_SOURCES = \ finalized-in-invalidated-handler.c test_get_interface_after_invalidate_SOURCES = \ get-interface-after-invalidate.c test_group_mixin_SOURCES = group-mixin.c test_handle_repo_SOURCES = handle-repo.c test_handle_set_SOURCES = handle-set.c test_invalidated_while_invoking_signals_SOURCES = \ invalidated-while-invoking-signals.c test_long_connection_name_SOURCES = long-connection-name.c test_message_mixin_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_message_mixin_SOURCES = \ message-mixin.c test_properties_SOURCES = properties.c nodist_test_properties_SOURCES = \ _gen/svc.h \ _gen/svc.c test_protocol_objects_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_protocol_objects_SOURCES = protocol-objects.c test_self_handle_SOURCES = self-handle.c test_self_presence_SOURCES = self-presence.c test_text_mixin_SOURCES = text-mixin.c test_text_respawn_SOURCES = text-respawn.c test_unsupported_interface_SOURCES = unsupported-interface.c test_params_cm_SOURCES = \ params-cm.c test_simple_observer_SOURCES = simple-observer.c test_simple_approver_SOURCES = simple-approver.c test_simple_handler_SOURCES = simple-handler.c test_stream_tube_SOURCES = stream-tube.c test_client_channel_factory_SOURCES = client-channel-factory.c test_proxy_preparation_SOURCES = proxy-preparation.c test_channel_manager_request_properties_SOURCES = channel-manager-request-properties.c test_dbus_tube_SOURCES = dbus-tube.c # this one uses internal ABI test_cm_message_SOURCES = \ cm-message.c test_cm_message_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_text_channel_SOURCES = text-channel.c test_text_channel_LDADD = \ $(LDADD) \ $(top_builddir)/examples/cm/echo-message-parts/libexample-cm-echo-2.la test_debug_client_SOURCES = debug-client.c test_room_list_SOURCES = room-list.c test_tls_certificate_SOURCES = tls-certificate.c check_c_sources = *.c AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -D_TP_COMPILATION \ -D_TP_IGNORE_DEPRECATIONS \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) TESTS_ENVIRONMENT = \ abs_top_builddir=@abs_top_builddir@ \ XDG_DATA_HOME=@abs_builddir@ \ XDG_DATA_DIRS=@abs_srcdir@:$${XDG_DATA_DIRS:=/usr/local/share:/usr/share} \ G_SLICE=debug-blocks \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ GIO_USE_VFS=local \ GSETTINGS_BACKEND=memory \ TP_TESTS_SERVICES_DIR=@abs_srcdir@/dbus-1/services \ DBUS_SESSION_BUS_ADDRESS=this-is-clearly-not-valid \ $(top_srcdir)/tools/test-wrapper.sh \ $(EXTRA_TESTS_ENVIRONMENT) EXTRA_TESTS_ENVIRONMENT = VALGRIND = valgrind --tool=memcheck \ --verbose \ --leak-check=full \ --leak-resolution=high \ --suppressions=$(top_srcdir)/tools/telepathy-glib.supp \ --child-silent-after-fork=yes \ --num-callers=20 \ --gen-suppressions=all VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env G_SLICE=always-malloc CHECK_VERBOSE=1 \ $(top_builddir)/libtool --mode=execute \ $(VALGRIND) --suppressions=$(top_srcdir)/tests/tests.supp $(VALGRIND_FLAGS) BUILT_SOURCES = \ _gen/errors-check.h \ _gen/svc.h \ _gen/svc.c \ run-test.sh \ $(NULL) CLEANFILES = \ $(BUILT_SOURCES) EXTRA_DIST = \ dbus-1/services/spurious.service \ telepathy/managers/spurious.manager \ telepathy/managers/test_manager_file.manager \ telepathy/managers/test_manager_file_invalid.manager \ with-properties.xml \ run-test.sh.in \ $(NULL) service_files = dbus-1/services/spurious.service @ENABLE_INSTALLED_TESTS_TRUE@dbusservicedir = @tpglibtestsdir@/dbus-1/services @ENABLE_INSTALLED_TESTS_TRUE@dbusservice_DATA = $(service_files) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/check-coding-style.mk $(top_srcdir)/tools/valgrind.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/dbus/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/dbus/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/tools/check-coding-style.mk $(top_srcdir)/tools/valgrind.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-testsPROGRAMS: $(tests_PROGRAMS) @$(NORMAL_INSTALL) @list='$(tests_PROGRAMS)'; test -n "$(testsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(testsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testsdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testsdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testsdir)$$dir" || exit $$?; \ } \ ; done uninstall-testsPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(tests_PROGRAMS)'; test -n "$(testsdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(testsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(testsdir)" && rm -f $$files clean-testsPROGRAMS: @list='$(tests_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-account$(EXEEXT): $(test_account_OBJECTS) $(test_account_DEPENDENCIES) $(EXTRA_test_account_DEPENDENCIES) @rm -f test-account$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_account_OBJECTS) $(test_account_LDADD) $(LIBS) test-account-channel-request$(EXEEXT): $(test_account_channel_request_OBJECTS) $(test_account_channel_request_DEPENDENCIES) $(EXTRA_test_account_channel_request_DEPENDENCIES) @rm -f test-account-channel-request$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_account_channel_request_OBJECTS) $(test_account_channel_request_LDADD) $(LIBS) test-account-manager$(EXEEXT): $(test_account_manager_OBJECTS) $(test_account_manager_DEPENDENCIES) $(EXTRA_test_account_manager_DEPENDENCIES) @rm -f test-account-manager$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_account_manager_OBJECTS) $(test_account_manager_LDADD) $(LIBS) test-account-request$(EXEEXT): $(test_account_request_OBJECTS) $(test_account_request_DEPENDENCIES) $(EXTRA_test_account_request_DEPENDENCIES) @rm -f test-account-request$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_account_request_OBJECTS) $(test_account_request_LDADD) $(LIBS) test-base-client$(EXEEXT): $(test_base_client_OBJECTS) $(test_base_client_DEPENDENCIES) $(EXTRA_test_base_client_DEPENDENCIES) @rm -f test-base-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_base_client_OBJECTS) $(test_base_client_LDADD) $(LIBS) test-call-cancellation$(EXEEXT): $(test_call_cancellation_OBJECTS) $(test_call_cancellation_DEPENDENCIES) $(EXTRA_test_call_cancellation_DEPENDENCIES) @rm -f test-call-cancellation$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_call_cancellation_OBJECTS) $(test_call_cancellation_LDADD) $(LIBS) test-call-channel$(EXEEXT): $(test_call_channel_OBJECTS) $(test_call_channel_DEPENDENCIES) $(EXTRA_test_call_channel_DEPENDENCIES) @rm -f test-call-channel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_call_channel_OBJECTS) $(test_call_channel_LDADD) $(LIBS) test-channel$(EXEEXT): $(test_channel_OBJECTS) $(test_channel_DEPENDENCIES) $(EXTRA_test_channel_DEPENDENCIES) @rm -f test-channel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_OBJECTS) $(test_channel_LDADD) $(LIBS) test-channel-dispatch-operation$(EXEEXT): $(test_channel_dispatch_operation_OBJECTS) $(test_channel_dispatch_operation_DEPENDENCIES) $(EXTRA_test_channel_dispatch_operation_DEPENDENCIES) @rm -f test-channel-dispatch-operation$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_dispatch_operation_OBJECTS) $(test_channel_dispatch_operation_LDADD) $(LIBS) test-channel-dispatcher$(EXEEXT): $(test_channel_dispatcher_OBJECTS) $(test_channel_dispatcher_DEPENDENCIES) $(EXTRA_test_channel_dispatcher_DEPENDENCIES) @rm -f test-channel-dispatcher$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_dispatcher_OBJECTS) $(test_channel_dispatcher_LDADD) $(LIBS) test-channel-introspect$(EXEEXT): $(test_channel_introspect_OBJECTS) $(test_channel_introspect_DEPENDENCIES) $(EXTRA_test_channel_introspect_DEPENDENCIES) @rm -f test-channel-introspect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_introspect_OBJECTS) $(test_channel_introspect_LDADD) $(LIBS) test-channel-manager-request-properties$(EXEEXT): $(test_channel_manager_request_properties_OBJECTS) $(test_channel_manager_request_properties_DEPENDENCIES) $(EXTRA_test_channel_manager_request_properties_DEPENDENCIES) @rm -f test-channel-manager-request-properties$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_manager_request_properties_OBJECTS) $(test_channel_manager_request_properties_LDADD) $(LIBS) test-channel-request$(EXEEXT): $(test_channel_request_OBJECTS) $(test_channel_request_DEPENDENCIES) $(EXTRA_test_channel_request_DEPENDENCIES) @rm -f test-channel-request$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_channel_request_OBJECTS) $(test_channel_request_LDADD) $(LIBS) test-cli-group$(EXEEXT): $(test_cli_group_OBJECTS) $(test_cli_group_DEPENDENCIES) $(EXTRA_test_cli_group_DEPENDENCIES) @rm -f test-cli-group$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cli_group_OBJECTS) $(test_cli_group_LDADD) $(LIBS) test-client$(EXEEXT): $(test_client_OBJECTS) $(test_client_DEPENDENCIES) $(EXTRA_test_client_DEPENDENCIES) @rm -f test-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_client_OBJECTS) $(test_client_LDADD) $(LIBS) test-client-channel-factory$(EXEEXT): $(test_client_channel_factory_OBJECTS) $(test_client_channel_factory_DEPENDENCIES) $(EXTRA_test_client_channel_factory_DEPENDENCIES) @rm -f test-client-channel-factory$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_client_channel_factory_OBJECTS) $(test_client_channel_factory_LDADD) $(LIBS) test-cm$(EXEEXT): $(test_cm_OBJECTS) $(test_cm_DEPENDENCIES) $(EXTRA_test_cm_DEPENDENCIES) @rm -f test-cm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cm_OBJECTS) $(test_cm_LDADD) $(LIBS) test-cm-message$(EXEEXT): $(test_cm_message_OBJECTS) $(test_cm_message_DEPENDENCIES) $(EXTRA_test_cm_message_DEPENDENCIES) @rm -f test-cm-message$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_cm_message_OBJECTS) $(test_cm_message_LDADD) $(LIBS) test-connection$(EXEEXT): $(test_connection_OBJECTS) $(test_connection_DEPENDENCIES) $(EXTRA_test_connection_DEPENDENCIES) @rm -f test-connection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_OBJECTS) $(test_connection_LDADD) $(LIBS) test-connection-aliasing$(EXEEXT): $(test_connection_aliasing_OBJECTS) $(test_connection_aliasing_DEPENDENCIES) $(EXTRA_test_connection_aliasing_DEPENDENCIES) @rm -f test-connection-aliasing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_aliasing_OBJECTS) $(test_connection_aliasing_LDADD) $(LIBS) test-connection-balance$(EXEEXT): $(test_connection_balance_OBJECTS) $(test_connection_balance_DEPENDENCIES) $(EXTRA_test_connection_balance_DEPENDENCIES) @rm -f test-connection-balance$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_balance_OBJECTS) $(test_connection_balance_LDADD) $(LIBS) test-connection-bug-18845$(EXEEXT): $(test_connection_bug_18845_OBJECTS) $(test_connection_bug_18845_DEPENDENCIES) $(EXTRA_test_connection_bug_18845_DEPENDENCIES) @rm -f test-connection-bug-18845$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_bug_18845_OBJECTS) $(test_connection_bug_18845_LDADD) $(LIBS) test-connection-error$(EXEEXT): $(test_connection_error_OBJECTS) $(test_connection_error_DEPENDENCIES) $(EXTRA_test_connection_error_DEPENDENCIES) @rm -f test-connection-error$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_error_OBJECTS) $(test_connection_error_LDADD) $(LIBS) test-connection-getinterfaces-failure$(EXEEXT): $(test_connection_getinterfaces_failure_OBJECTS) $(test_connection_getinterfaces_failure_DEPENDENCIES) $(EXTRA_test_connection_getinterfaces_failure_DEPENDENCIES) @rm -f test-connection-getinterfaces-failure$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_getinterfaces_failure_OBJECTS) $(test_connection_getinterfaces_failure_LDADD) $(LIBS) test-connection-handles$(EXEEXT): $(test_connection_handles_OBJECTS) $(test_connection_handles_DEPENDENCIES) $(EXTRA_test_connection_handles_DEPENDENCIES) @rm -f test-connection-handles$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_handles_OBJECTS) $(test_connection_handles_LDADD) $(LIBS) test-connection-inject-bug16307$(EXEEXT): $(test_connection_inject_bug16307_OBJECTS) $(test_connection_inject_bug16307_DEPENDENCIES) $(EXTRA_test_connection_inject_bug16307_DEPENDENCIES) @rm -f test-connection-inject-bug16307$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_inject_bug16307_OBJECTS) $(test_connection_inject_bug16307_LDADD) $(LIBS) test-connection-interests$(EXEEXT): $(test_connection_interests_OBJECTS) $(test_connection_interests_DEPENDENCIES) $(EXTRA_test_connection_interests_DEPENDENCIES) @rm -f test-connection-interests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_connection_interests_OBJECTS) $(test_connection_interests_LDADD) $(LIBS) test-contact-list-client$(EXEEXT): $(test_contact_list_client_OBJECTS) $(test_contact_list_client_DEPENDENCIES) $(EXTRA_test_contact_list_client_DEPENDENCIES) @rm -f test-contact-list-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contact_list_client_OBJECTS) $(test_contact_list_client_LDADD) $(LIBS) test-contact-lists$(EXEEXT): $(test_contact_lists_OBJECTS) $(test_contact_lists_DEPENDENCIES) $(EXTRA_test_contact_lists_DEPENDENCIES) @rm -f test-contact-lists$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contact_lists_OBJECTS) $(test_contact_lists_LDADD) $(LIBS) test-contacts$(EXEEXT): $(test_contacts_OBJECTS) $(test_contacts_DEPENDENCIES) $(EXTRA_test_contacts_DEPENDENCIES) @rm -f test-contacts$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contacts_OBJECTS) $(test_contacts_LDADD) $(LIBS) test-contacts-bug-19101$(EXEEXT): $(test_contacts_bug_19101_OBJECTS) $(test_contacts_bug_19101_DEPENDENCIES) $(EXTRA_test_contacts_bug_19101_DEPENDENCIES) @rm -f test-contacts-bug-19101$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contacts_bug_19101_OBJECTS) $(test_contacts_bug_19101_LDADD) $(LIBS) test-contacts-mixin$(EXEEXT): $(test_contacts_mixin_OBJECTS) $(test_contacts_mixin_DEPENDENCIES) $(EXTRA_test_contacts_mixin_DEPENDENCIES) @rm -f test-contacts-mixin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contacts_mixin_OBJECTS) $(test_contacts_mixin_LDADD) $(LIBS) test-contacts-slow-path$(EXEEXT): $(test_contacts_slow_path_OBJECTS) $(test_contacts_slow_path_DEPENDENCIES) $(EXTRA_test_contacts_slow_path_DEPENDENCIES) @rm -f test-contacts-slow-path$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contacts_slow_path_OBJECTS) $(test_contacts_slow_path_LDADD) $(LIBS) test-dbus$(EXEEXT): $(test_dbus_OBJECTS) $(test_dbus_DEPENDENCIES) $(EXTRA_test_dbus_DEPENDENCIES) @rm -f test-dbus$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dbus_OBJECTS) $(test_dbus_LDADD) $(LIBS) test-dbus-tube$(EXEEXT): $(test_dbus_tube_OBJECTS) $(test_dbus_tube_DEPENDENCIES) $(EXTRA_test_dbus_tube_DEPENDENCIES) @rm -f test-dbus-tube$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dbus_tube_OBJECTS) $(test_dbus_tube_LDADD) $(LIBS) test-debug-client$(EXEEXT): $(test_debug_client_OBJECTS) $(test_debug_client_DEPENDENCIES) $(EXTRA_test_debug_client_DEPENDENCIES) @rm -f test-debug-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_debug_client_OBJECTS) $(test_debug_client_LDADD) $(LIBS) test-disconnection$(EXEEXT): $(test_disconnection_OBJECTS) $(test_disconnection_DEPENDENCIES) $(EXTRA_test_disconnection_DEPENDENCIES) @rm -f test-disconnection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_disconnection_OBJECTS) $(test_disconnection_LDADD) $(LIBS) test-error-enum$(EXEEXT): $(test_error_enum_OBJECTS) $(test_error_enum_DEPENDENCIES) $(EXTRA_test_error_enum_DEPENDENCIES) @rm -f test-error-enum$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_error_enum_OBJECTS) $(test_error_enum_LDADD) $(LIBS) test-example-no-protocols$(EXEEXT): $(test_example_no_protocols_OBJECTS) $(test_example_no_protocols_DEPENDENCIES) $(EXTRA_test_example_no_protocols_DEPENDENCIES) @rm -f test-example-no-protocols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_example_no_protocols_OBJECTS) $(test_example_no_protocols_LDADD) $(LIBS) test-file-transfer-channel$(EXEEXT): $(test_file_transfer_channel_OBJECTS) $(test_file_transfer_channel_DEPENDENCIES) $(EXTRA_test_file_transfer_channel_DEPENDENCIES) @rm -f test-file-transfer-channel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_file_transfer_channel_OBJECTS) $(test_file_transfer_channel_LDADD) $(LIBS) test-finalized-in-invalidated-handler$(EXEEXT): $(test_finalized_in_invalidated_handler_OBJECTS) $(test_finalized_in_invalidated_handler_DEPENDENCIES) $(EXTRA_test_finalized_in_invalidated_handler_DEPENDENCIES) @rm -f test-finalized-in-invalidated-handler$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_finalized_in_invalidated_handler_OBJECTS) $(test_finalized_in_invalidated_handler_LDADD) $(LIBS) test-get-interface-after-invalidate$(EXEEXT): $(test_get_interface_after_invalidate_OBJECTS) $(test_get_interface_after_invalidate_DEPENDENCIES) $(EXTRA_test_get_interface_after_invalidate_DEPENDENCIES) @rm -f test-get-interface-after-invalidate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_get_interface_after_invalidate_OBJECTS) $(test_get_interface_after_invalidate_LDADD) $(LIBS) test-group-mixin$(EXEEXT): $(test_group_mixin_OBJECTS) $(test_group_mixin_DEPENDENCIES) $(EXTRA_test_group_mixin_DEPENDENCIES) @rm -f test-group-mixin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_group_mixin_OBJECTS) $(test_group_mixin_LDADD) $(LIBS) test-handle-repo$(EXEEXT): $(test_handle_repo_OBJECTS) $(test_handle_repo_DEPENDENCIES) $(EXTRA_test_handle_repo_DEPENDENCIES) @rm -f test-handle-repo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_handle_repo_OBJECTS) $(test_handle_repo_LDADD) $(LIBS) test-handle-set$(EXEEXT): $(test_handle_set_OBJECTS) $(test_handle_set_DEPENDENCIES) $(EXTRA_test_handle_set_DEPENDENCIES) @rm -f test-handle-set$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_handle_set_OBJECTS) $(test_handle_set_LDADD) $(LIBS) test-invalidated-while-invoking-signals$(EXEEXT): $(test_invalidated_while_invoking_signals_OBJECTS) $(test_invalidated_while_invoking_signals_DEPENDENCIES) $(EXTRA_test_invalidated_while_invoking_signals_DEPENDENCIES) @rm -f test-invalidated-while-invoking-signals$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_invalidated_while_invoking_signals_OBJECTS) $(test_invalidated_while_invoking_signals_LDADD) $(LIBS) test-list-cm-no-cm$(EXEEXT): $(test_list_cm_no_cm_OBJECTS) $(test_list_cm_no_cm_DEPENDENCIES) $(EXTRA_test_list_cm_no_cm_DEPENDENCIES) @rm -f test-list-cm-no-cm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_list_cm_no_cm_OBJECTS) $(test_list_cm_no_cm_LDADD) $(LIBS) test-long-connection-name$(EXEEXT): $(test_long_connection_name_OBJECTS) $(test_long_connection_name_DEPENDENCIES) $(EXTRA_test_long_connection_name_DEPENDENCIES) @rm -f test-long-connection-name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_long_connection_name_OBJECTS) $(test_long_connection_name_LDADD) $(LIBS) test-message-mixin$(EXEEXT): $(test_message_mixin_OBJECTS) $(test_message_mixin_DEPENDENCIES) $(EXTRA_test_message_mixin_DEPENDENCIES) @rm -f test-message-mixin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_message_mixin_OBJECTS) $(test_message_mixin_LDADD) $(LIBS) test-params-cm$(EXEEXT): $(test_params_cm_OBJECTS) $(test_params_cm_DEPENDENCIES) $(EXTRA_test_params_cm_DEPENDENCIES) @rm -f test-params-cm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_params_cm_OBJECTS) $(test_params_cm_LDADD) $(LIBS) _gen/$(am__dirstamp): @$(MKDIR_P) _gen @: > _gen/$(am__dirstamp) _gen/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) _gen/$(DEPDIR) @: > _gen/$(DEPDIR)/$(am__dirstamp) _gen/svc.$(OBJEXT): _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) test-properties$(EXEEXT): $(test_properties_OBJECTS) $(test_properties_DEPENDENCIES) $(EXTRA_test_properties_DEPENDENCIES) @rm -f test-properties$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_properties_OBJECTS) $(test_properties_LDADD) $(LIBS) test-protocol-objects$(EXEEXT): $(test_protocol_objects_OBJECTS) $(test_protocol_objects_DEPENDENCIES) $(EXTRA_test_protocol_objects_DEPENDENCIES) @rm -f test-protocol-objects$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_protocol_objects_OBJECTS) $(test_protocol_objects_LDADD) $(LIBS) test-proxy-preparation$(EXEEXT): $(test_proxy_preparation_OBJECTS) $(test_proxy_preparation_DEPENDENCIES) $(EXTRA_test_proxy_preparation_DEPENDENCIES) @rm -f test-proxy-preparation$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_proxy_preparation_OBJECTS) $(test_proxy_preparation_LDADD) $(LIBS) test-room-list$(EXEEXT): $(test_room_list_OBJECTS) $(test_room_list_DEPENDENCIES) $(EXTRA_test_room_list_DEPENDENCIES) @rm -f test-room-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_room_list_OBJECTS) $(test_room_list_LDADD) $(LIBS) test-self-handle$(EXEEXT): $(test_self_handle_OBJECTS) $(test_self_handle_DEPENDENCIES) $(EXTRA_test_self_handle_DEPENDENCIES) @rm -f test-self-handle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_self_handle_OBJECTS) $(test_self_handle_LDADD) $(LIBS) test-self-presence$(EXEEXT): $(test_self_presence_OBJECTS) $(test_self_presence_DEPENDENCIES) $(EXTRA_test_self_presence_DEPENDENCIES) @rm -f test-self-presence$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_self_presence_OBJECTS) $(test_self_presence_LDADD) $(LIBS) test-simple-approver$(EXEEXT): $(test_simple_approver_OBJECTS) $(test_simple_approver_DEPENDENCIES) $(EXTRA_test_simple_approver_DEPENDENCIES) @rm -f test-simple-approver$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_simple_approver_OBJECTS) $(test_simple_approver_LDADD) $(LIBS) test-simple-handler$(EXEEXT): $(test_simple_handler_OBJECTS) $(test_simple_handler_DEPENDENCIES) $(EXTRA_test_simple_handler_DEPENDENCIES) @rm -f test-simple-handler$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_simple_handler_OBJECTS) $(test_simple_handler_LDADD) $(LIBS) test-simple-observer$(EXEEXT): $(test_simple_observer_OBJECTS) $(test_simple_observer_DEPENDENCIES) $(EXTRA_test_simple_observer_DEPENDENCIES) @rm -f test-simple-observer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_simple_observer_OBJECTS) $(test_simple_observer_LDADD) $(LIBS) test-stream-tube$(EXEEXT): $(test_stream_tube_OBJECTS) $(test_stream_tube_DEPENDENCIES) $(EXTRA_test_stream_tube_DEPENDENCIES) @rm -f test-stream-tube$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_stream_tube_OBJECTS) $(test_stream_tube_LDADD) $(LIBS) test-text-channel$(EXEEXT): $(test_text_channel_OBJECTS) $(test_text_channel_DEPENDENCIES) $(EXTRA_test_text_channel_DEPENDENCIES) @rm -f test-text-channel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_text_channel_OBJECTS) $(test_text_channel_LDADD) $(LIBS) test-text-mixin$(EXEEXT): $(test_text_mixin_OBJECTS) $(test_text_mixin_DEPENDENCIES) $(EXTRA_test_text_mixin_DEPENDENCIES) @rm -f test-text-mixin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_text_mixin_OBJECTS) $(test_text_mixin_LDADD) $(LIBS) test-text-respawn$(EXEEXT): $(test_text_respawn_OBJECTS) $(test_text_respawn_DEPENDENCIES) $(EXTRA_test_text_respawn_DEPENDENCIES) @rm -f test-text-respawn$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_text_respawn_OBJECTS) $(test_text_respawn_LDADD) $(LIBS) test-tls-certificate$(EXEEXT): $(test_tls_certificate_OBJECTS) $(test_tls_certificate_DEPENDENCIES) $(EXTRA_test_tls_certificate_DEPENDENCIES) @rm -f test-tls-certificate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_tls_certificate_OBJECTS) $(test_tls_certificate_LDADD) $(LIBS) test-unsupported-interface$(EXEEXT): $(test_unsupported_interface_OBJECTS) $(test_unsupported_interface_DEPENDENCIES) $(EXTRA_test_unsupported_interface_DEPENDENCIES) @rm -f test-unsupported-interface$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_unsupported_interface_OBJECTS) $(test_unsupported_interface_LDADD) $(LIBS) install-testsSCRIPTS: $(tests_SCRIPTS) @$(NORMAL_INSTALL) @list='$(tests_SCRIPTS)'; test -n "$(testsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(testsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(testsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(testsdir)$$dir" || exit $$?; \ } \ ; done uninstall-testsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(tests_SCRIPTS)'; test -n "$(testsdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(testsdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f _gen/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-channel-request.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-manager.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-request.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-cancellation.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-channel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-dispatch-operation.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-dispatcher.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-introspect.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-manager-request-properties.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-request.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cli-group.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-channel-factory.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cm-message.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-aliasing.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-balance.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-bug-18845.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-getinterfaces-failure.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-handles.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-inject-bug16307.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-interests.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-list-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-lists.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts-bug-19101.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts-mixin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts-slow-path.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-tube.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disconnection.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error-enum.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example-no-protocols.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-transfer-channel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finalized-in-invalidated-handler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get-interface-after-invalidate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-mixin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-repo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-set.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/invalidated-while-invoking-signals.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-cm-no-cm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/long-connection-name.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message-mixin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/params-cm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol-objects.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-preparation.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room-list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/self-handle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/self-presence.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-approver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-handler.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-observer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream-tube.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-channel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-mixin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-respawn.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls-certificate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsupported-interface.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/svc.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dbusserviceDATA: $(dbusservice_DATA) @$(NORMAL_INSTALL) @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dbusservicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dbusservicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dbusservicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dbusservicedir)" || exit $$?; \ done uninstall-dbusserviceDATA: @$(NORMAL_UNINSTALL) @list='$(dbusservice_DATA)'; test -n "$(dbusservicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(dbusservicedir)'; $(am__uninstall_files_from_dir) install-managersDATA: $(managers_DATA) @$(NORMAL_INSTALL) @list='$(managers_DATA)'; test -n "$(managersdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managersdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managersdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managersdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managersdir)" || exit $$?; \ done uninstall-managersDATA: @$(NORMAL_UNINSTALL) @list='$(managers_DATA)'; test -n "$(managersdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managersdir)'; $(am__uninstall_files_from_dir) install-testsDATA: $(tests_DATA) @$(NORMAL_INSTALL) @list='$(tests_DATA)'; test -n "$(testsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(testsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(testsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(testsdir)" || exit $$?; \ done uninstall-testsDATA: @$(NORMAL_UNINSTALL) @list='$(tests_DATA)'; test -n "$(testsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(testsdir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-account.log: test-account$(EXEEXT) @p='test-account$(EXEEXT)'; \ b='test-account'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-account-channel-request.log: test-account-channel-request$(EXEEXT) @p='test-account-channel-request$(EXEEXT)'; \ b='test-account-channel-request'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-account-manager.log: test-account-manager$(EXEEXT) @p='test-account-manager$(EXEEXT)'; \ b='test-account-manager'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-account-request.log: test-account-request$(EXEEXT) @p='test-account-request$(EXEEXT)'; \ b='test-account-request'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-base-client.log: test-base-client$(EXEEXT) @p='test-base-client$(EXEEXT)'; \ b='test-base-client'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-call-cancellation.log: test-call-cancellation$(EXEEXT) @p='test-call-cancellation$(EXEEXT)'; \ b='test-call-cancellation'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-call-channel.log: test-call-channel$(EXEEXT) @p='test-call-channel$(EXEEXT)'; \ b='test-call-channel'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel.log: test-channel$(EXEEXT) @p='test-channel$(EXEEXT)'; \ b='test-channel'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel-dispatcher.log: test-channel-dispatcher$(EXEEXT) @p='test-channel-dispatcher$(EXEEXT)'; \ b='test-channel-dispatcher'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel-dispatch-operation.log: test-channel-dispatch-operation$(EXEEXT) @p='test-channel-dispatch-operation$(EXEEXT)'; \ b='test-channel-dispatch-operation'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel-introspect.log: test-channel-introspect$(EXEEXT) @p='test-channel-introspect$(EXEEXT)'; \ b='test-channel-introspect'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel-request.log: test-channel-request$(EXEEXT) @p='test-channel-request$(EXEEXT)'; \ b='test-channel-request'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-channel-manager-request-properties.log: test-channel-manager-request-properties$(EXEEXT) @p='test-channel-manager-request-properties$(EXEEXT)'; \ b='test-channel-manager-request-properties'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-cli-group.log: test-cli-group$(EXEEXT) @p='test-cli-group$(EXEEXT)'; \ b='test-cli-group'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-client.log: test-client$(EXEEXT) @p='test-client$(EXEEXT)'; \ b='test-client'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-client-channel-factory.log: test-client-channel-factory$(EXEEXT) @p='test-client-channel-factory$(EXEEXT)'; \ b='test-client-channel-factory'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-cm.log: test-cm$(EXEEXT) @p='test-cm$(EXEEXT)'; \ b='test-cm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-cm-message.log: test-cm-message$(EXEEXT) @p='test-cm-message$(EXEEXT)'; \ b='test-cm-message'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection.log: test-connection$(EXEEXT) @p='test-connection$(EXEEXT)'; \ b='test-connection'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-aliasing.log: test-connection-aliasing$(EXEEXT) @p='test-connection-aliasing$(EXEEXT)'; \ b='test-connection-aliasing'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-balance.log: test-connection-balance$(EXEEXT) @p='test-connection-balance$(EXEEXT)'; \ b='test-connection-balance'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-bug-18845.log: test-connection-bug-18845$(EXEEXT) @p='test-connection-bug-18845$(EXEEXT)'; \ b='test-connection-bug-18845'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-error.log: test-connection-error$(EXEEXT) @p='test-connection-error$(EXEEXT)'; \ b='test-connection-error'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-handles.log: test-connection-handles$(EXEEXT) @p='test-connection-handles$(EXEEXT)'; \ b='test-connection-handles'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-inject-bug16307.log: test-connection-inject-bug16307$(EXEEXT) @p='test-connection-inject-bug16307$(EXEEXT)'; \ b='test-connection-inject-bug16307'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-interests.log: test-connection-interests$(EXEEXT) @p='test-connection-interests$(EXEEXT)'; \ b='test-connection-interests'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-connection-getinterfaces-failure.log: test-connection-getinterfaces-failure$(EXEEXT) @p='test-connection-getinterfaces-failure$(EXEEXT)'; \ b='test-connection-getinterfaces-failure'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contact-lists.log: test-contact-lists$(EXEEXT) @p='test-contact-lists$(EXEEXT)'; \ b='test-contact-lists'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contact-list-client.log: test-contact-list-client$(EXEEXT) @p='test-contact-list-client$(EXEEXT)'; \ b='test-contact-list-client'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contacts.log: test-contacts$(EXEEXT) @p='test-contacts$(EXEEXT)'; \ b='test-contacts'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contacts-bug-19101.log: test-contacts-bug-19101$(EXEEXT) @p='test-contacts-bug-19101$(EXEEXT)'; \ b='test-contacts-bug-19101'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contacts-mixin.log: test-contacts-mixin$(EXEEXT) @p='test-contacts-mixin$(EXEEXT)'; \ b='test-contacts-mixin'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contacts-slow-path.log: test-contacts-slow-path$(EXEEXT) @p='test-contacts-slow-path$(EXEEXT)'; \ b='test-contacts-slow-path'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-dbus.log: test-dbus$(EXEEXT) @p='test-dbus$(EXEEXT)'; \ b='test-dbus'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-dbus-tube.log: test-dbus-tube$(EXEEXT) @p='test-dbus-tube$(EXEEXT)'; \ b='test-dbus-tube'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-debug-client.log: test-debug-client$(EXEEXT) @p='test-debug-client$(EXEEXT)'; \ b='test-debug-client'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-disconnection.log: test-disconnection$(EXEEXT) @p='test-disconnection$(EXEEXT)'; \ b='test-disconnection'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-error-enum.log: test-error-enum$(EXEEXT) @p='test-error-enum$(EXEEXT)'; \ b='test-error-enum'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-example-no-protocols.log: test-example-no-protocols$(EXEEXT) @p='test-example-no-protocols$(EXEEXT)'; \ b='test-example-no-protocols'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-file-transfer-channel.log: test-file-transfer-channel$(EXEEXT) @p='test-file-transfer-channel$(EXEEXT)'; \ b='test-file-transfer-channel'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-finalized-in-invalidated-handler.log: test-finalized-in-invalidated-handler$(EXEEXT) @p='test-finalized-in-invalidated-handler$(EXEEXT)'; \ b='test-finalized-in-invalidated-handler'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-get-interface-after-invalidate.log: test-get-interface-after-invalidate$(EXEEXT) @p='test-get-interface-after-invalidate$(EXEEXT)'; \ b='test-get-interface-after-invalidate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-group-mixin.log: test-group-mixin$(EXEEXT) @p='test-group-mixin$(EXEEXT)'; \ b='test-group-mixin'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-handle-repo.log: test-handle-repo$(EXEEXT) @p='test-handle-repo$(EXEEXT)'; \ b='test-handle-repo'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-handle-set.log: test-handle-set$(EXEEXT) @p='test-handle-set$(EXEEXT)'; \ b='test-handle-set'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-invalidated-while-invoking-signals.log: test-invalidated-while-invoking-signals$(EXEEXT) @p='test-invalidated-while-invoking-signals$(EXEEXT)'; \ b='test-invalidated-while-invoking-signals'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-list-cm-no-cm.log: test-list-cm-no-cm$(EXEEXT) @p='test-list-cm-no-cm$(EXEEXT)'; \ b='test-list-cm-no-cm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-long-connection-name.log: test-long-connection-name$(EXEEXT) @p='test-long-connection-name$(EXEEXT)'; \ b='test-long-connection-name'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-message-mixin.log: test-message-mixin$(EXEEXT) @p='test-message-mixin$(EXEEXT)'; \ b='test-message-mixin'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-params-cm.log: test-params-cm$(EXEEXT) @p='test-params-cm$(EXEEXT)'; \ b='test-params-cm'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-properties.log: test-properties$(EXEEXT) @p='test-properties$(EXEEXT)'; \ b='test-properties'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-protocol-objects.log: test-protocol-objects$(EXEEXT) @p='test-protocol-objects$(EXEEXT)'; \ b='test-protocol-objects'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-proxy-preparation.log: test-proxy-preparation$(EXEEXT) @p='test-proxy-preparation$(EXEEXT)'; \ b='test-proxy-preparation'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-room-list.log: test-room-list$(EXEEXT) @p='test-room-list$(EXEEXT)'; \ b='test-room-list'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-self-handle.log: test-self-handle$(EXEEXT) @p='test-self-handle$(EXEEXT)'; \ b='test-self-handle'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-self-presence.log: test-self-presence$(EXEEXT) @p='test-self-presence$(EXEEXT)'; \ b='test-self-presence'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-simple-approver.log: test-simple-approver$(EXEEXT) @p='test-simple-approver$(EXEEXT)'; \ b='test-simple-approver'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-simple-handler.log: test-simple-handler$(EXEEXT) @p='test-simple-handler$(EXEEXT)'; \ b='test-simple-handler'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-simple-observer.log: test-simple-observer$(EXEEXT) @p='test-simple-observer$(EXEEXT)'; \ b='test-simple-observer'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-stream-tube.log: test-stream-tube$(EXEEXT) @p='test-stream-tube$(EXEEXT)'; \ b='test-stream-tube'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-text-channel.log: test-text-channel$(EXEEXT) @p='test-text-channel$(EXEEXT)'; \ b='test-text-channel'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-text-mixin.log: test-text-mixin$(EXEEXT) @p='test-text-mixin$(EXEEXT)'; \ b='test-text-mixin'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-text-respawn.log: test-text-respawn$(EXEEXT) @p='test-text-respawn$(EXEEXT)'; \ b='test-text-respawn'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-tls-certificate.log: test-tls-certificate$(EXEEXT) @p='test-tls-certificate$(EXEEXT)'; \ b='test-tls-certificate'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-unsupported-interface.log: test-unsupported-interface$(EXEEXT) @p='test-unsupported-interface$(EXEEXT)'; \ b='test-unsupported-interface'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) installdirs: for dir in "$(DESTDIR)$(testsdir)" "$(DESTDIR)$(testsdir)" "$(DESTDIR)$(dbusservicedir)" "$(DESTDIR)$(managersdir)" "$(DESTDIR)$(testsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f _gen/$(DEPDIR)/$(am__dirstamp) -rm -f _gen/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ clean-testsPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/account-channel-request.Po -rm -f ./$(DEPDIR)/account-manager.Po -rm -f ./$(DEPDIR)/account-request.Po -rm -f ./$(DEPDIR)/account.Po -rm -f ./$(DEPDIR)/base-client.Po -rm -f ./$(DEPDIR)/call-cancellation.Po -rm -f ./$(DEPDIR)/call-channel.Po -rm -f ./$(DEPDIR)/channel-dispatch-operation.Po -rm -f ./$(DEPDIR)/channel-dispatcher.Po -rm -f ./$(DEPDIR)/channel-introspect.Po -rm -f ./$(DEPDIR)/channel-manager-request-properties.Po -rm -f ./$(DEPDIR)/channel-request.Po -rm -f ./$(DEPDIR)/channel.Po -rm -f ./$(DEPDIR)/cli-group.Po -rm -f ./$(DEPDIR)/client-channel-factory.Po -rm -f ./$(DEPDIR)/client.Po -rm -f ./$(DEPDIR)/cm-message.Po -rm -f ./$(DEPDIR)/cm.Po -rm -f ./$(DEPDIR)/connection-aliasing.Po -rm -f ./$(DEPDIR)/connection-balance.Po -rm -f ./$(DEPDIR)/connection-bug-18845.Po -rm -f ./$(DEPDIR)/connection-error.Po -rm -f ./$(DEPDIR)/connection-getinterfaces-failure.Po -rm -f ./$(DEPDIR)/connection-handles.Po -rm -f ./$(DEPDIR)/connection-inject-bug16307.Po -rm -f ./$(DEPDIR)/connection-interests.Po -rm -f ./$(DEPDIR)/connection.Po -rm -f ./$(DEPDIR)/contact-list-client.Po -rm -f ./$(DEPDIR)/contact-lists.Po -rm -f ./$(DEPDIR)/contacts-bug-19101.Po -rm -f ./$(DEPDIR)/contacts-mixin.Po -rm -f ./$(DEPDIR)/contacts-slow-path.Po -rm -f ./$(DEPDIR)/contacts.Po -rm -f ./$(DEPDIR)/dbus-tube.Po -rm -f ./$(DEPDIR)/dbus.Po -rm -f ./$(DEPDIR)/debug-client.Po -rm -f ./$(DEPDIR)/disconnection.Po -rm -f ./$(DEPDIR)/error-enum.Po -rm -f ./$(DEPDIR)/example-no-protocols.Po -rm -f ./$(DEPDIR)/file-transfer-channel.Po -rm -f ./$(DEPDIR)/finalized-in-invalidated-handler.Po -rm -f ./$(DEPDIR)/get-interface-after-invalidate.Po -rm -f ./$(DEPDIR)/group-mixin.Po -rm -f ./$(DEPDIR)/handle-repo.Po -rm -f ./$(DEPDIR)/handle-set.Po -rm -f ./$(DEPDIR)/invalidated-while-invoking-signals.Po -rm -f ./$(DEPDIR)/list-cm-no-cm.Po -rm -f ./$(DEPDIR)/long-connection-name.Po -rm -f ./$(DEPDIR)/message-mixin.Po -rm -f ./$(DEPDIR)/params-cm.Po -rm -f ./$(DEPDIR)/properties.Po -rm -f ./$(DEPDIR)/protocol-objects.Po -rm -f ./$(DEPDIR)/proxy-preparation.Po -rm -f ./$(DEPDIR)/room-list.Po -rm -f ./$(DEPDIR)/self-handle.Po -rm -f ./$(DEPDIR)/self-presence.Po -rm -f ./$(DEPDIR)/simple-approver.Po -rm -f ./$(DEPDIR)/simple-handler.Po -rm -f ./$(DEPDIR)/simple-observer.Po -rm -f ./$(DEPDIR)/stream-tube.Po -rm -f ./$(DEPDIR)/text-channel.Po -rm -f ./$(DEPDIR)/text-mixin.Po -rm -f ./$(DEPDIR)/text-respawn.Po -rm -f ./$(DEPDIR)/tls-certificate.Po -rm -f ./$(DEPDIR)/unsupported-interface.Po -rm -f _gen/$(DEPDIR)/svc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dbusserviceDATA install-managersDATA \ install-testsDATA install-testsPROGRAMS install-testsSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/account-channel-request.Po -rm -f ./$(DEPDIR)/account-manager.Po -rm -f ./$(DEPDIR)/account-request.Po -rm -f ./$(DEPDIR)/account.Po -rm -f ./$(DEPDIR)/base-client.Po -rm -f ./$(DEPDIR)/call-cancellation.Po -rm -f ./$(DEPDIR)/call-channel.Po -rm -f ./$(DEPDIR)/channel-dispatch-operation.Po -rm -f ./$(DEPDIR)/channel-dispatcher.Po -rm -f ./$(DEPDIR)/channel-introspect.Po -rm -f ./$(DEPDIR)/channel-manager-request-properties.Po -rm -f ./$(DEPDIR)/channel-request.Po -rm -f ./$(DEPDIR)/channel.Po -rm -f ./$(DEPDIR)/cli-group.Po -rm -f ./$(DEPDIR)/client-channel-factory.Po -rm -f ./$(DEPDIR)/client.Po -rm -f ./$(DEPDIR)/cm-message.Po -rm -f ./$(DEPDIR)/cm.Po -rm -f ./$(DEPDIR)/connection-aliasing.Po -rm -f ./$(DEPDIR)/connection-balance.Po -rm -f ./$(DEPDIR)/connection-bug-18845.Po -rm -f ./$(DEPDIR)/connection-error.Po -rm -f ./$(DEPDIR)/connection-getinterfaces-failure.Po -rm -f ./$(DEPDIR)/connection-handles.Po -rm -f ./$(DEPDIR)/connection-inject-bug16307.Po -rm -f ./$(DEPDIR)/connection-interests.Po -rm -f ./$(DEPDIR)/connection.Po -rm -f ./$(DEPDIR)/contact-list-client.Po -rm -f ./$(DEPDIR)/contact-lists.Po -rm -f ./$(DEPDIR)/contacts-bug-19101.Po -rm -f ./$(DEPDIR)/contacts-mixin.Po -rm -f ./$(DEPDIR)/contacts-slow-path.Po -rm -f ./$(DEPDIR)/contacts.Po -rm -f ./$(DEPDIR)/dbus-tube.Po -rm -f ./$(DEPDIR)/dbus.Po -rm -f ./$(DEPDIR)/debug-client.Po -rm -f ./$(DEPDIR)/disconnection.Po -rm -f ./$(DEPDIR)/error-enum.Po -rm -f ./$(DEPDIR)/example-no-protocols.Po -rm -f ./$(DEPDIR)/file-transfer-channel.Po -rm -f ./$(DEPDIR)/finalized-in-invalidated-handler.Po -rm -f ./$(DEPDIR)/get-interface-after-invalidate.Po -rm -f ./$(DEPDIR)/group-mixin.Po -rm -f ./$(DEPDIR)/handle-repo.Po -rm -f ./$(DEPDIR)/handle-set.Po -rm -f ./$(DEPDIR)/invalidated-while-invoking-signals.Po -rm -f ./$(DEPDIR)/list-cm-no-cm.Po -rm -f ./$(DEPDIR)/long-connection-name.Po -rm -f ./$(DEPDIR)/message-mixin.Po -rm -f ./$(DEPDIR)/params-cm.Po -rm -f ./$(DEPDIR)/properties.Po -rm -f ./$(DEPDIR)/protocol-objects.Po -rm -f ./$(DEPDIR)/proxy-preparation.Po -rm -f ./$(DEPDIR)/room-list.Po -rm -f ./$(DEPDIR)/self-handle.Po -rm -f ./$(DEPDIR)/self-presence.Po -rm -f ./$(DEPDIR)/simple-approver.Po -rm -f ./$(DEPDIR)/simple-handler.Po -rm -f ./$(DEPDIR)/simple-observer.Po -rm -f ./$(DEPDIR)/stream-tube.Po -rm -f ./$(DEPDIR)/text-channel.Po -rm -f ./$(DEPDIR)/text-mixin.Po -rm -f ./$(DEPDIR)/text-respawn.Po -rm -f ./$(DEPDIR)/tls-certificate.Po -rm -f ./$(DEPDIR)/unsupported-interface.Po -rm -f _gen/$(DEPDIR)/svc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dbusserviceDATA uninstall-managersDATA \ uninstall-testsDATA uninstall-testsPROGRAMS \ uninstall-testsSCRIPTS .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ check-am check-local clean clean-generic clean-libtool \ clean-noinstPROGRAMS clean-testsPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-local distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dbusserviceDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-managersDATA install-pdf install-pdf-am \ install-ps install-ps-am install-strip install-testsDATA \ install-testsPROGRAMS install-testsSCRIPTS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ recheck tags tags-am uninstall uninstall-am \ uninstall-dbusserviceDATA uninstall-managersDATA \ uninstall-testsDATA uninstall-testsPROGRAMS \ uninstall-testsSCRIPTS .PRECIOUS: Makefile tpglib-dbus-tests.list: $(AM_V_GEN)echo $(tests_list) > $@ check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(enable_fatal_warnings)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style check-valgrind: $(MAKE) check-TESTS \ maybe_gc_friendly=,gc-friendly \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" # other potentially interesting options: # --show-reachable=yes reachable objects (many!) # --read-var-info=yes better diagnostics from DWARF3 info # --track-origins=yes better diagnostics for uninit values (slow) distclean-local: rm -f capture-*.log rm -rf _gen run-test.sh: run-test.sh.in $(AM_V_GEN)sed \ -e "s|[@]tpglibtestsdir[@]|@tpglibtestsdir@|g" \ -e "s|[@]libexec[@]|${libexecdir}|g" \ $< > $@ @chmod +x $@ _gen/svc.h: _gen/svc.c @: _gen/svc.c: with-properties.xml \ $(top_srcdir)/tools/glib-ginterface-gen.py \ Makefile.am $(AM_V_at)$(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-ginterface-gen.py \ --filename=_gen/svc \ --signal-marshal-prefix=NOT_NEEDED \ --include='' \ $< Test_Svc_ _gen/errors-check.h: $(top_srcdir)/spec/errors.xml \ $(top_srcdir)/tools/glib-errors-check-gen.py $(AM_V_at)$(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-errors-check-gen.py $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/tests/dbus/contacts-mixin.c0000644000175000017500000001555612652510705016654 00000000000000/* Feature test for TpContactsMixin * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" static void test_no_features (TpTestsContactsConnection *service_conn, TpConnection *client_conn, GArray *handles) { GError *error = NULL; GHashTable *contacts; GHashTable *attrs; g_message (G_STRFUNC); MYASSERT (tp_cli_connection_interface_contacts_run_get_contact_attributes ( client_conn, -1, handles, NULL, FALSE, &contacts, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (contacts), ==, 3); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 0))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "alice"); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 1))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "bob"); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 2))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "chris"); g_hash_table_unref (contacts); } static void test_features (TpTestsContactsConnection *service_conn, TpConnection *client_conn, GArray *handles) { const gchar *interfaces[] = { TP_IFACE_CONNECTION, TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_AVATARS, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, NULL }; GError *error = NULL; GHashTable *contacts; GHashTable *attrs; g_message (G_STRFUNC); MYASSERT (tp_cli_connection_interface_contacts_run_get_contact_attributes ( client_conn, -1, handles, interfaces, FALSE, &contacts, &error, NULL), ""); g_assert_no_error (error); g_assert_cmpuint (g_hash_table_size (contacts), ==, 3); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 0))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "alice"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias"), ==, "Alice in Wonderland"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_AVATARS "/token"), ==, "aaaaa"); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 1))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "bob"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias"), ==, "Bob the Builder"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_AVATARS "/token"), ==, "bbbbb"); attrs = g_hash_table_lookup (contacts, GUINT_TO_POINTER (g_array_index (handles, guint, 2))); MYASSERT (attrs != NULL, ""); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "chris"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias"), ==, "Christopher Robin"); g_assert_cmpstr ( tp_asv_get_string (attrs, TP_IFACE_CONNECTION_INTERFACE_AVATARS "/token"), ==, "ccccc"); g_hash_table_unref (contacts); } int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsContactsConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *client_conn; GArray *handles = g_array_sized_new (FALSE, FALSE, sizeof (guint), 3); static const gchar * const ids[] = { "alice", "bob", "chris" }; static const gchar * const aliases[] = { "Alice in Wonderland", "Bob the Builder", "Christopher Robin" }; static const gchar * const tokens[] = { "aaaaa", "bbbbb", "ccccc" }; static TpTestsContactsConnectionPresenceStatusIndex statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY }; static const gchar * const messages[] = { "", "Fixing it", "GON OUT BACKSON" }; TpHandleRepoIface *service_repo; guint i; /* Setup */ tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_CONTACTS_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_CONTACTS_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); client_conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (client_conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* Set up some contacts */ for (i = 0; i < 3; i++) { TpHandle handle = tp_handle_ensure (service_repo, ids[i], NULL, NULL); g_array_append_val (handles, handle); } tp_tests_contacts_connection_change_aliases (service_conn, 3, (const TpHandle *) handles->data, aliases); tp_tests_contacts_connection_change_presences (service_conn, 3, (const TpHandle *) handles->data, statuses, messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 3, (const TpHandle *) handles->data, tokens); /* Tests */ test_no_features (service_conn, client_conn, handles); test_features (service_conn, client_conn, handles); /* Teardown */ tp_tests_connection_assert_disconnect_succeeds (client_conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); g_array_unref (handles); return 0; } telepathy-glib-0.24.2/tests/dbus/dbus-tube.c0000644000175000017500000003436112652510705015601 00000000000000/* Tests of TpDbusTubeChannel * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-conn.h" #include "tests/lib/dbus-tube-chan.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsDBusTubeChannel *tube_chan_service; TpHandleRepoIface *contact_repo; TpHandleRepoIface *room_repo; /* Client side objects */ TpConnection *connection; TpDBusTubeChannel *tube; GDBusConnection *tube_conn; GDBusConnection *cm_conn; GVariant *call_result; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->tube_chan_service); tp_clear_object (&test->tube); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); g_clear_object (&test->tube_conn); g_clear_object (&test->cm_conn); tp_clear_pointer (&test->call_result, g_variant_unref); } static void create_tube_service (Test *test, gboolean requested, gboolean contact) { gchar *chan_path; TpHandle handle, alf_handle; GHashTable *props; GType type; TpSimpleClientFactory *factory; /* If previous tube is still preparing, refs are kept on it. We want it to be * destroyed now otherwise it will get reused by the factory. */ if (test->tube != NULL) tp_tests_proxy_run_until_prepared (test->tube, NULL); tp_clear_object (&test->tube_chan_service); tp_clear_object (&test->tube); /* Create service-side tube channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); test->room_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_ROOM); g_assert (test->room_repo != NULL); if (contact) { handle = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); type = TP_TESTS_TYPE_CONTACT_DBUS_TUBE_CHANNEL; } else { handle = tp_handle_ensure (test->room_repo, "#test", NULL, &test->error); type = TP_TESTS_TYPE_ROOM_DBUS_TUBE_CHANNEL; } g_assert_no_error (test->error); alf_handle = tp_handle_ensure (test->contact_repo, "alf", NULL, &test->error); g_assert_no_error (test->error); test->tube_chan_service = g_object_new ( type, "connection", test->base_connection, "handle", handle, "requested", requested, "object-path", chan_path, "initiator-handle", alf_handle, NULL); /* Create client-side tube channel object */ g_object_get (test->tube_chan_service, "channel-properties", &props, NULL); factory = tp_proxy_get_factory (test->connection); test->tube = (TpDBusTubeChannel *) tp_simple_client_factory_ensure_channel ( factory, test->connection, chan_path, props, &test->error); g_assert (TP_IS_DBUS_TUBE_CHANNEL (test->tube)); g_assert_no_error (test->error); g_free (chan_path); g_hash_table_unref (props); if (contact) tp_handle_unref (test->contact_repo, handle); else tp_handle_unref (test->room_repo, handle); } /* Test Basis */ static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { create_tube_service (test, TRUE, TRUE); g_assert (TP_IS_DBUS_TUBE_CHANNEL (test->tube)); g_assert (TP_IS_CHANNEL (test->tube)); create_tube_service (test, FALSE, FALSE); g_assert (TP_IS_DBUS_TUBE_CHANNEL (test->tube)); g_assert (TP_IS_CHANNEL (test->tube)); } static void check_parameters (GHashTable *parameters) { g_assert (parameters != NULL); g_assert_cmpuint (g_hash_table_size (parameters), ==, 1); g_assert_cmpuint (tp_asv_get_uint32 (parameters, "badger", NULL), ==, 42); } static void check_parameters_vardict (GVariant *parameters_vardict) { guint32 badger_value; g_assert (parameters_vardict != NULL); g_assert (g_variant_lookup (parameters_vardict, "badger", "u", &badger_value)); g_assert_cmpuint (badger_value, ==, 42); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { gchar *service; GHashTable *parameters; GVariant *parameters_vardict; /* Outgoing tube */ create_tube_service (test, TRUE, TRUE); /* Service */ g_assert_cmpstr (tp_dbus_tube_channel_get_service_name (test->tube), ==, "com.test.Test"); g_object_get (test->tube, "service-name", &service, NULL); g_assert_cmpstr (service, ==, "com.test.Test"); g_free (service); /* Parameters */ parameters = tp_dbus_tube_channel_get_parameters (test->tube); parameters_vardict = tp_dbus_tube_channel_dup_parameters_vardict ( test->tube); /* NULL as the tube has not be offered yet */ g_assert (parameters == NULL); g_object_get (test->tube, "parameters", ¶meters, NULL); g_assert (parameters == NULL); g_assert (parameters_vardict == NULL); /* Incoming tube */ create_tube_service (test, FALSE, FALSE); /* Parameters */ parameters = tp_dbus_tube_channel_get_parameters (test->tube); check_parameters (parameters); g_object_get (test->tube, "parameters", ¶meters, NULL); check_parameters (parameters); parameters_vardict = tp_dbus_tube_channel_dup_parameters_vardict ( test->tube); check_parameters_vardict (parameters_vardict); g_hash_table_unref (parameters); g_variant_unref (parameters_vardict); g_object_get (test->tube, "parameters-vardict", ¶meters_vardict, NULL); check_parameters_vardict (parameters_vardict); g_variant_unref (parameters_vardict); } static void tube_offer_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_object (&test->tube_conn); test->tube_conn = tp_dbus_tube_channel_offer_finish ( TP_DBUS_TUBE_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static gboolean new_connection_cb (TpTestsDBusTubeChannel *chan, GDBusConnection *connection, Test *test) { g_clear_object (&test->cm_conn); test->cm_conn = g_object_ref (connection); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); return TRUE; } static void handle_double_call (GDBusConnection *connection, const gchar *sender, const gchar *object_path, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { if (!tp_strdiff (method_name, "Double")) { guint value; g_variant_get (parameters, "(i)", &value); g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", value * 2)); } } static void register_object (GDBusConnection *connection) { GDBusNodeInfo *introspection_data; guint registration_id; static const GDBusInterfaceVTable interface_vtable = { handle_double_call, NULL, NULL, }; static const gchar introspection_xml[] = "" " " " " " " " " " " " " ""; introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); g_assert (introspection_data != NULL); registration_id = g_dbus_connection_register_object (connection, "/org/Example/TestObject", introspection_data->interfaces[0], &interface_vtable, NULL, NULL, NULL); g_assert (registration_id > 0); g_dbus_node_info_unref (introspection_data); } static void double_call_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_clear_pointer (&test->call_result, g_variant_unref); test->call_result = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void use_tube (Test *test, GDBusConnection *server_conn, GDBusConnection *client_conn) { gint result; /* Server publishes an object on the tube */ register_object (server_conn); /* Client calls a remote method */ g_dbus_connection_call (client_conn, NULL, "/org/Example/TestObject", "org.Example.TestInterface", "Double", g_variant_new ("(i)", 42), G_VARIANT_TYPE ("(i)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, double_call_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_variant_get (test->call_result, "(i)", &result); g_assert_cmpuint (result, ==, 42 * 2); } static void test_offer (Test *test, gconstpointer data) { const TpTestsDBusTubeChannelOpenMode open_mode = GPOINTER_TO_UINT (data); GHashTable *params; /* Outgoing tube */ create_tube_service (test, TRUE, TRUE); tp_tests_dbus_tube_channel_set_open_mode (test->tube_chan_service, open_mode); params = tp_asv_new ("badger", G_TYPE_UINT, 42, NULL); g_signal_connect (test->tube_chan_service, "new-connection", G_CALLBACK (new_connection_cb), test); tp_dbus_tube_channel_offer_async (test->tube, params, tube_offer_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); check_parameters (tp_dbus_tube_channel_get_parameters (test->tube)); g_assert (G_IS_DBUS_CONNECTION (test->tube_conn)); g_assert (G_IS_DBUS_CONNECTION (test->cm_conn)); use_tube (test, test->tube_conn, test->cm_conn); } static void test_offer_invalidated_before_open (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Outgoing tube */ create_tube_service (test, TRUE, TRUE); tp_tests_dbus_tube_channel_set_open_mode (test->tube_chan_service, TP_TESTS_DBUS_TUBE_CHANNEL_NEVER_OPEN); tp_dbus_tube_channel_offer_async (test->tube, NULL, tube_offer_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); /* FIXME: this isn't a particularly good error… it's just what comes out when * the channel gets closed from under us, and there isn't really API on * DBusTube to give a better error. * * https://bugs.freedesktop.org/show_bug.cgi?id=48196 */ g_assert_error (test->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED); } static void tube_accept_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; g_clear_object (&test->tube_conn); test->tube_conn = tp_dbus_tube_channel_accept_finish ( TP_DBUS_TUBE_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_accept (Test *test, gconstpointer data) { const TpTestsDBusTubeChannelOpenMode open_mode = GPOINTER_TO_UINT (data); /* Incoming tube */ create_tube_service (test, FALSE, TRUE); tp_tests_dbus_tube_channel_set_open_mode (test->tube_chan_service, open_mode); g_signal_connect (test->tube_chan_service, "new-connection", G_CALLBACK (new_connection_cb), test); tp_dbus_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (G_IS_DBUS_CONNECTION (test->tube_conn)); g_assert (G_IS_DBUS_CONNECTION (test->cm_conn)); use_tube (test, test->cm_conn, test->tube_conn); } static void test_accept_invalidated_before_open (Test *test, gconstpointer data G_GNUC_UNUSED) { /* Incoming tube */ create_tube_service (test, FALSE, TRUE); tp_tests_dbus_tube_channel_set_open_mode (test->tube_chan_service, TP_TESTS_DBUS_TUBE_CHANNEL_NEVER_OPEN); tp_dbus_tube_channel_accept_async (test->tube, tube_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); /* FIXME: this isn't a particularly good error… it's just what comes out when * the channel gets closed from under us, and there isn't really API on * DBusTube to give a better error. * * https://bugs.freedesktop.org/show_bug.cgi?id=48196 */ g_assert_error (test->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/dbus-tube/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/dbus-tube/properties", Test, NULL, setup, test_properties, teardown); /* Han shot first. */ g_test_add ("/dbus-tube/offer-open-first", Test, GUINT_TO_POINTER (TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST), setup, test_offer, teardown); g_test_add ("/dbus-tube/offer-open-second", Test, GUINT_TO_POINTER (TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_SECOND), setup, test_offer, teardown); g_test_add ("/dbus-tube/offer-invalidated-before-open", Test, NULL, setup, test_offer_invalidated_before_open, teardown); g_test_add ("/dbus-tube/accept-open-first", Test, GUINT_TO_POINTER (TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_FIRST), setup, test_accept, teardown); g_test_add ("/dbus-tube/accept-open-second", Test, GUINT_TO_POINTER (TP_TESTS_DBUS_TUBE_CHANNEL_OPEN_SECOND), setup, test_accept, teardown); g_test_add ("/dbus-tube/accept-invalidated-before-open", Test, NULL, setup, test_accept_invalidated_before_open, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/properties.c0000644000175000017500000001601712652510705016101 00000000000000#include "config.h" #include #include #include #include #include #include #include #include #include #include #include "_gen/svc.h" #include "tests/lib/util.h" #define WITH_PROPERTIES_IFACE "com.example.WithProperties" typedef struct _TestProperties { GObject parent; } TestProperties; typedef struct _TestPropertiesClass { GObjectClass parent; TpDBusPropertiesMixinClass props; } TestPropertiesClass; GType test_properties_get_type (void); #define TEST_TYPE_PROPERTIES \ (test_properties_get_type ()) #define TEST_PROPERTIES(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TEST_TYPE_PROPERTIES, \ TestProperties)) #define TEST_PROPERTIES_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TEST_TYPE_PROPERTIES, \ TestPropertiesClass)) #define TEST_IS_PROPERTIES(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TEST_TYPE_PROPERTIES)) #define TEST_IS_PROPERTIES_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TEST_TYPE_PROPERTIES)) #define TEST_PROPERTIES_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TEST_TYPE_PROPERTIES, \ TestPropertiesClass)) G_DEFINE_TYPE_WITH_CODE (TestProperties, test_properties, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TEST_TYPE_SVC_WITH_PROPERTIES, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init)); static void test_properties_init (TestProperties *self) { } static void prop_getter (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer user_data) { if (tp_strdiff (user_data, "read")) g_assert_cmpstr (user_data, ==, "full-access"); g_value_set_uint (value, 42); } static gboolean prop_setter (GObject *object, GQuark interface, GQuark name, const GValue *value, gpointer user_data, GError **error) { g_assert (G_VALUE_HOLDS_UINT (value)); if (tp_strdiff (user_data, "FULL ACCESS")) g_assert_cmpstr (user_data, ==, "BLACK HOLE"); g_assert_cmpuint (g_value_get_uint (value), ==, 57); return TRUE; } static void test_properties_class_init (TestPropertiesClass *cls) { static TpDBusPropertiesMixinPropImpl with_properties_props[] = { { "ReadOnly", "read", "READ" }, { "ReadWrite", "full-access", "FULL ACCESS" }, { "WriteOnly", "black-hole", "BLACK HOLE" }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl interfaces[] = { { WITH_PROPERTIES_IFACE, prop_getter, prop_setter, with_properties_props }, { NULL } }; cls->props.interfaces = interfaces; tp_dbus_properties_mixin_class_init (G_OBJECT_CLASS (cls), G_STRUCT_OFFSET (TestPropertiesClass, props)); } static void test_get (TpProxy *proxy) { GValue *value; g_assert (tp_cli_dbus_properties_run_get (proxy, -1, WITH_PROPERTIES_IFACE, "ReadOnly", &value, NULL, NULL)); g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, 42); g_boxed_free (G_TYPE_VALUE, value); } static void test_set (TpProxy *proxy) { GValue value = { 0, }; g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, 57); g_assert (tp_cli_dbus_properties_run_set (proxy, -1, WITH_PROPERTIES_IFACE, "ReadWrite", &value, NULL, NULL)); g_assert (tp_cli_dbus_properties_run_set (proxy, -1, WITH_PROPERTIES_IFACE, "WriteOnly", &value, NULL, NULL)); g_value_unset (&value); } static void test_get_all (TpProxy *proxy) { GHashTable *hash; GValue *value; g_assert (tp_cli_dbus_properties_run_get_all (proxy, -1, WITH_PROPERTIES_IFACE, &hash, NULL, NULL)); g_assert (hash != NULL); tp_asv_dump (hash); g_assert_cmpuint (g_hash_table_size (hash), ==, 2); value = g_hash_table_lookup (hash, "WriteOnly"); g_assert (value == NULL); value = g_hash_table_lookup (hash, "ReadOnly"); g_assert (value != NULL); g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, 42); value = g_hash_table_lookup (hash, "ReadWrite"); g_assert (value != NULL); g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, 42); g_hash_table_unref (hash); } static void properties_changed_cb ( TpProxy *proxy, const gchar *interface_name, GHashTable *changed_properties, const gchar **invalidated_properties, gpointer user_data, GObject *weak_object) { GMainLoop *loop = user_data; guint value; gboolean valid; g_assert_cmpuint (g_hash_table_size (changed_properties), ==, 1); value = tp_asv_get_uint32 (changed_properties, "ReadOnly", &valid); g_assert (valid); g_assert_cmpuint (value, ==, 42); g_assert_cmpuint (g_strv_length ((gchar **) invalidated_properties), ==, 1); g_assert_cmpstr (invalidated_properties[0], ==, "ReadWrite"); g_main_loop_quit (loop); } typedef struct { TestProperties *obj; TpProxy *proxy; } Context; static void test_emit_changed (Context *ctx) { GMainLoop *loop = g_main_loop_new (NULL, FALSE); TpProxySignalConnection *signal_conn; const gchar *properties[] = { "ReadOnly", "ReadWrite", NULL }; GError *error = NULL; signal_conn = tp_cli_dbus_properties_connect_to_properties_changed ( ctx->proxy, properties_changed_cb, loop, NULL, NULL, &error); g_assert_no_error (error); g_assert (signal_conn != NULL); tp_dbus_properties_mixin_emit_properties_changed (G_OBJECT (ctx->obj), WITH_PROPERTIES_IFACE, properties); g_main_loop_run (loop); tp_dbus_properties_mixin_emit_properties_changed_varargs (G_OBJECT (ctx->obj), WITH_PROPERTIES_IFACE, "ReadOnly", "ReadWrite", NULL); g_main_loop_run (loop); tp_proxy_signal_connection_disconnect (signal_conn); } int main (int argc, char **argv) { Context ctx; TpDBusDaemon *dbus_daemon; tp_tests_init (&argc, &argv); dbus_daemon = tp_tests_dbus_daemon_dup_or_die (); ctx.obj = tp_tests_object_new_static_class (TEST_TYPE_PROPERTIES, NULL); tp_dbus_daemon_register_object (dbus_daemon, "/", ctx.obj); /* Open a D-Bus connection to myself */ ctx.proxy = TP_PROXY (tp_tests_object_new_static_class (TP_TYPE_PROXY, "dbus-daemon", dbus_daemon, "bus-name", tp_dbus_daemon_get_unique_name (dbus_daemon), "object-path", "/", NULL)); g_assert (tp_proxy_has_interface (ctx.proxy, "org.freedesktop.DBus.Properties")); g_test_add_data_func ("/properties/get", ctx.proxy, (GTestDataFunc) test_get); g_test_add_data_func ("/properties/set", ctx.proxy, (GTestDataFunc) test_set); g_test_add_data_func ("/properties/get-all", ctx.proxy, (GTestDataFunc) test_get_all); g_test_add_data_func ("/properties/changed", &ctx, (GTestDataFunc) test_emit_changed); tp_tests_run_with_bus (); g_object_unref (ctx.obj); g_object_unref (ctx.proxy); g_object_unref (dbus_daemon); return 0; } telepathy-glib-0.24.2/tests/dbus/text-respawn.c0000644000175000017500000002156012652510705016345 00000000000000/* Basic test for the text mixin and the echo example CM. * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/echo-chan.h" #include "tests/lib/echo-conn.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" static guint received_count = 0; static guint last_received_id = 0; static guint last_received_time = 0; static guint last_received_sender = 0; static guint last_received_type = 0; static guint last_received_flags = 0; static gchar *last_received_text = NULL; static guint sent_count = 0; static guint last_sent_type = 0; static gchar *last_sent_text = NULL; static void on_sent (TpChannel *chan, guint timestamp, guint type, const gchar *text, gpointer data, GObject *object) { g_message ("%p: Sent: time %u, type %u, text '%s'", chan, timestamp, type, text); sent_count++; last_sent_type = type; g_free (last_sent_text); last_sent_text = g_strdup (text); } static void on_received (TpChannel *chan, guint id, guint timestamp, guint sender, guint type, guint flags, const gchar *text, gpointer data, GObject *object) { TpHandleRepoIface *contact_repo = data; g_message ("%p: Received #%u: time %u, sender %u '%s', type %u, flags %u, " "text '%s'", chan, id, timestamp, sender, tp_handle_inspect (contact_repo, sender), type, flags, text); received_count++; last_received_id = id; last_received_time = timestamp; last_received_sender = sender; last_received_type = type; last_received_flags = flags; g_free (last_received_text); last_received_text = g_strdup (text); } int main (int argc, char **argv) { TpTestsEchoConnection *service_conn; TpBaseConnection *service_conn_as_base; TpHandleRepoIface *contact_repo; TpTestsEchoChannel *service_chan; TpDBusDaemon *dbus; TpConnection *conn; TpChannel *chan; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; TpHandle handle; tp_tests_abort_after (10); /* tp_debug_set_flags ("all"); */ dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_ECHO_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CONNECTION, "account", "me@example.com", "protocol", "example", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "example", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); MYASSERT (contact_repo != NULL, ""); handle = tp_handle_ensure (contact_repo, "them@example.org", NULL, &error); g_assert_no_error (error); /* FIXME: exercise RequestChannel rather than just pasting on a channel */ chan_path = g_strdup_printf ("%s/Channel", conn_path); service_chan = TP_TESTS_ECHO_CHANNEL (tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CHANNEL, "connection", service_conn, "object-path", chan_path, "handle", handle, NULL)); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); tp_channel_run_until_ready (chan, &error, NULL); g_assert_no_error (error); MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received, g_object_ref (contact_repo), g_object_unref, NULL, NULL) != NULL, ""); MYASSERT (tp_cli_channel_type_text_connect_to_sent (chan, on_sent, NULL, NULL, NULL, NULL) != NULL, ""); sent_count = 0; received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Hello, world!", &error, NULL); g_assert_no_error (error); tp_tests_proxy_run_until_dbus_queue_processed (conn); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "Hello, world!"), "'%s' != '%s'", last_sent_text, "Hello, world!"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "You said: Hello, world!"), "'%s'", last_received_text); g_print ("\n\n==== Closing channel (it will respawn) ====\n"); { gboolean dead; TpHandle new_initiator; MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_proxy_get_invalidated (chan) != NULL, ""); g_object_get (service_chan, "channel-destroyed", &dead, "initiator-handle", &new_initiator, NULL); MYASSERT (!dead, ""); g_assert_cmpuint (new_initiator, ==, handle); } g_print ("\n\n==== Re-creating TpChannel ====\n"); g_object_unref (chan); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); tp_channel_run_until_ready (chan, &error, NULL); g_assert_no_error (error); g_print ("\n\n==== Listing messages ====\n"); { GPtrArray *messages; GValueArray *structure; tp_cli_channel_type_text_run_list_pending_messages (chan, -1, FALSE, &messages, &error, NULL); g_assert_no_error (error); g_assert_cmpuint (messages->len, ==, 1); structure = g_ptr_array_index (messages, 0); g_assert_cmpuint (g_value_get_uint (structure->values + 0), ==, last_received_id); g_assert_cmpuint (g_value_get_uint (structure->values + 1), ==, last_received_time); g_assert_cmpuint (g_value_get_uint (structure->values + 2), ==, handle); g_assert_cmpuint (g_value_get_uint (structure->values + 3), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL); g_assert_cmpuint (g_value_get_uint (structure->values + 4), ==, TP_CHANNEL_TEXT_MESSAGE_FLAG_RESCUED); g_assert_cmpstr (g_value_get_string (structure->values + 5), ==, "You said: Hello, world!"); g_print ("Freeing\n"); g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages); } g_print ("\n\n==== Disappearing channel ====\n"); { TpBaseChannel *base = TP_BASE_CHANNEL (service_chan); TpHandle self_handle = tp_base_connection_get_self_handle ( service_conn_as_base); /* first make the channel disappear and make sure it's off the * bus */ tp_base_channel_disappear (base); g_assert (!tp_base_channel_is_registered (base)); /* now reopen it and make sure it's got new requested/initiator * values, as well as being back on the bus. */ tp_base_channel_reopened_with_requested (base, TRUE, self_handle); g_assert_cmpuint (tp_base_channel_get_initiator (base), ==, self_handle); g_assert (tp_base_channel_is_requested (base)); g_assert (tp_base_channel_is_registered (base)); } g_print ("\n\n==== Destroying channel ====\n"); { gboolean dead; MYASSERT (tp_cli_channel_interface_destroyable_run_destroy (chan, -1, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_proxy_get_invalidated (chan) != NULL, ""); g_object_get (service_chan, "channel-destroyed", &dead, NULL); MYASSERT (dead, ""); } g_print ("\n\n==== End of tests ====\n"); tp_tests_connection_assert_disconnect_succeeds (conn); tp_handle_unref (contact_repo, handle); g_object_unref (chan); g_object_unref (conn); g_object_unref (service_chan); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); g_free (chan_path); g_free (last_sent_text); g_free (last_received_text); return 0; } telepathy-glib-0.24.2/tests/dbus/group-mixin.c0000644000175000017500000004412012652510705016157 00000000000000/* Test TpGroupMixin * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-group.h" #include "tests/lib/util.h" #define IDENTIFIER "them@example.org" static GMainLoop *mainloop; TpTestsTextChannelGroup *service_chan; TpChannel *chan = NULL; TpHandleRepoIface *contact_repo; TpHandle self_handle, camel, camel2; typedef void (*diff_checker) (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details); static gboolean expecting_members_changed = FALSE; static gboolean expecting_members_changed_detailed = FALSE; static const gchar *expected_message; static TpHandle expected_actor; static TpChannelGroupChangeReason expected_reason; static diff_checker expected_diffs; static void expect_signals (const gchar *message, TpHandle actor, TpChannelGroupChangeReason reason, diff_checker check_diffs) { expecting_members_changed = TRUE; expecting_members_changed_detailed = TRUE; expected_message = message; expected_actor = actor; expected_reason = reason; expected_diffs = check_diffs; } static gboolean outstanding_signals (void) { return (expecting_members_changed || expecting_members_changed_detailed); } static void wait_for_outstanding_signals (void) { if (outstanding_signals ()) g_main_loop_run (mainloop); } static void on_members_changed (TpChannel *proxy, const gchar *arg_Message, const GArray *arg_Added, const GArray *arg_Removed, const GArray *arg_Local_Pending, const GArray *arg_Remote_Pending, guint arg_Actor, guint arg_Reason, gpointer user_data, GObject *weak_object) { MYASSERT (expecting_members_changed, ": got unexpected MembersChanged"); expecting_members_changed = FALSE; g_assert_cmpstr (arg_Message, ==, expected_message); g_assert_cmpuint (arg_Actor, ==, expected_actor); g_assert_cmpuint (arg_Reason, ==, expected_reason); expected_diffs (arg_Added, arg_Removed, arg_Local_Pending, arg_Remote_Pending, NULL); if (!outstanding_signals ()) g_main_loop_quit (mainloop); } static void on_members_changed_detailed (TpChannel *proxy, const GArray *arg_Added, const GArray *arg_Removed, const GArray *arg_Local_Pending, const GArray *arg_Remote_Pending, GHashTable *arg_Details, gpointer user_data, GObject *weak_object) { const gchar *message; TpHandle actor; TpChannelGroupChangeReason reason; gboolean valid; MYASSERT (expecting_members_changed_detailed, ": got unexpected MembersChangedDetailed"); expecting_members_changed_detailed = FALSE; message = tp_asv_get_string (arg_Details, "message"); if (message == NULL) message = ""; g_assert_cmpstr (message, ==, expected_message); actor = tp_asv_get_uint32 (arg_Details, "actor", &valid); if (valid) { g_assert_cmpuint (actor, ==, expected_actor); } else { g_assert_cmpuint (expected_actor, ==, 0); MYASSERT (tp_asv_lookup (arg_Details, "actor") == NULL, ": wanted an actor, not an imposter"); } reason = tp_asv_get_uint32 (arg_Details, "change-reason", &valid); if (valid) { g_assert_cmpuint (reason, ==, expected_reason); } else { g_assert_cmpuint (expected_reason, ==, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); MYASSERT (tp_asv_lookup (arg_Details, "reason") == NULL, ": utterly unreasonable"); } expected_diffs (arg_Added, arg_Removed, arg_Local_Pending, arg_Remote_Pending, arg_Details); if (!outstanding_signals ()) g_main_loop_quit (mainloop); } static void check_initial_properties (void) { GHashTable *props = NULL; GArray *members; gboolean valid; GError *error = NULL; TpChannelGroupFlags flags; MYASSERT (tp_cli_dbus_properties_run_get_all (chan, -1, TP_IFACE_CHANNEL_INTERFACE_GROUP, &props, &error, NULL), ""); g_assert_no_error (error); members = tp_asv_get_boxed (props, "Members", DBUS_TYPE_G_UINT_ARRAY); MYASSERT (members != NULL, ": Members should be defined"); \ MYASSERT (members->len == 0, ": Members should be empty initally"); members = tp_asv_get_boxed (props, "RemotePendingMembers", DBUS_TYPE_G_UINT_ARRAY); MYASSERT (members != NULL, ": RemotePendingMembers should be defined"); \ MYASSERT (members->len == 0, ": RemotePendingMembers should be empty initally"); members = tp_asv_get_boxed (props, "LocalPendingMembers", TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST); MYASSERT (members != NULL, ": LocalPendingMembers should be defined"); \ MYASSERT (members->len == 0, ": LocalPendingMembers should be empty initally"); tp_asv_get_uint32 (props, "SelfHandle", &valid); MYASSERT (valid, ": SelfHandle property should be defined"); flags = tp_asv_get_uint32 (props, "GroupFlags", &valid); MYASSERT (flags, ": GroupFlags property should be defined"); g_assert_cmpuint (flags, ==, TP_CHANNEL_GROUP_FLAG_PROPERTIES | TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED | TP_CHANNEL_GROUP_FLAG_CAN_ADD); g_hash_table_unref (props); } static void details_contains_ids_for (const GHashTable *details, TpHandle *hs) { GHashTable *contact_ids; const gchar *id; guint n = 0; TpHandle *h; if (details == NULL) return; contact_ids = tp_asv_get_boxed (details, "contact-ids", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP); g_assert (contact_ids != NULL); for (h = hs; *h != 0; h++) { n++; id = g_hash_table_lookup (contact_ids, GUINT_TO_POINTER (*h)); MYASSERT (id != NULL, ": id for %u in map", *h); g_assert_cmpstr (id, ==, tp_handle_inspect (contact_repo, *h)); } MYASSERT (g_hash_table_size (contact_ids) == n, ": %u contact IDs", n); } static void self_added_to_lp (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details) { TpHandle h; TpHandle hs[] = { self_handle, 0 }; MYASSERT (added->len == 0, ": no new added to members"); MYASSERT (removed->len == 0, ": no-one removed"); MYASSERT (remote_pending->len == 0, ": no new remote pending"); MYASSERT (local_pending->len == 1, ": one local pending..."); /* ...which is us */ h = g_array_index (local_pending, TpHandle, 0); g_assert_cmpuint (h, ==, self_handle); details_contains_ids_for (details, hs); } static void self_added_to_members (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details) { TpHandle h; TpHandle hs[] = { self_handle, 0 }; MYASSERT (added->len == 1, ": one added"); h = g_array_index (added, TpHandle, 0); g_assert_cmpuint (h, ==, self_handle); MYASSERT (removed->len == 0, ": no-one removed"); MYASSERT (local_pending->len == 0, ": no new local pending"); MYASSERT (remote_pending->len == 0, ": no new remote pending"); details_contains_ids_for (details, hs); } static void check_incoming_invitation (void) { GError *error = NULL; /* We get an invitation to the channel */ { TpIntset *add_local_pending = tp_intset_new (); tp_intset_add (add_local_pending, self_handle); expect_signals ("HELLO THAR", 0, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED, self_added_to_lp); tp_group_mixin_change_members ((GObject *) service_chan, "HELLO THAR", NULL, NULL, add_local_pending, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_INVITED); wait_for_outstanding_signals (); MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); tp_intset_destroy (add_local_pending); } /* We accept the invitation; even though the channel lacks CanAdd we should * be able to move someone from local pending to members by calling Add(). */ { GArray *contacts = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1); g_array_append_val (contacts, self_handle); expect_signals ("", self_handle, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, self_added_to_members); MYASSERT (tp_cli_channel_interface_group_run_add_members (chan, -1, contacts, "", &error, NULL), ""); g_assert_no_error (error); wait_for_outstanding_signals (); MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); g_array_unref (contacts); } } static void camel_added (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details) { TpHandle h; TpHandle hs[] = { camel, 0 }; MYASSERT (added->len == 1, ": one added"); h = g_array_index (added, TpHandle, 0); g_assert_cmpuint (h, ==, camel); details_contains_ids_for (details, hs); MYASSERT (removed->len == 0, ": no-one removed"); MYASSERT (local_pending->len == 0, ": no new local pending"); MYASSERT (remote_pending->len == 0, ": no new remote pending"); } static void camel2_added (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details) { TpHandle h; /* camel is the actor */ TpHandle hs[] = { camel, camel2, 0 }; MYASSERT (added->len == 1, ": one added"); h = g_array_index (added, TpHandle, 0); g_assert_cmpuint (h, ==, camel2); details_contains_ids_for (details, hs); MYASSERT (removed->len == 0, ": no-one removed"); MYASSERT (local_pending->len == 0, ": no new local pending"); MYASSERT (remote_pending->len == 0, ": no new remote pending"); } static void camel_removed (const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, const GHashTable *details) { TpHandle h; /* camel2 is the actor. camel shouldn't be in the ids, because they were * removed and the spec says that you can leave those out, and we want * tp-glib's automatic construction of contact-ids to work in the #ubuntu * case. */ TpHandle hs[] = { camel2, 0 }; MYASSERT (removed->len == 1, ": one removed"); h = g_array_index (removed, TpHandle, 0); g_assert_cmpuint (h, ==, camel); MYASSERT (added->len == 0, ": no-one added"); MYASSERT (local_pending->len == 0, ": no new local pending"); MYASSERT (remote_pending->len == 0, ": no new remote pending"); details_contains_ids_for (details, hs); } static void in_the_desert (void) { camel = tp_handle_ensure (contact_repo, "camel", NULL, NULL); camel2 = tp_handle_ensure (contact_repo, "camel2", NULL, NULL); /* A camel is approaching */ { TpIntset *add = tp_intset_new (); tp_intset_add (add, camel); expect_signals ("", camel, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, camel_added); tp_group_mixin_change_members ((GObject *) service_chan, NULL, add, NULL, NULL, NULL, camel, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); wait_for_outstanding_signals (); MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); tp_intset_destroy (add); } /* A second camel is approaching (invited by the first camel) */ { TpIntset *add = tp_intset_new (); GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); tp_intset_add (add, camel2); g_hash_table_insert (details, "actor", tp_g_value_slice_new_uint (camel)); expect_signals ("", camel, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, camel2_added); tp_group_mixin_change_members_detailed ((GObject *) service_chan, add, NULL, NULL, NULL, details); wait_for_outstanding_signals (); MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); tp_intset_destroy (add); g_hash_table_unref (details); } { TpIntset *del = tp_intset_new (); GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); tp_intset_add (del, camel); g_hash_table_insert (details, "actor", tp_g_value_slice_new_uint (camel2)); /* It turns out that spitting was not included in the GroupChangeReason * enum. */ g_hash_table_insert (details, "error", tp_g_value_slice_new_static_string ("le.mac.Spat")); g_hash_table_insert (details, "saliva-consistency", tp_g_value_slice_new_static_string ("fluid")); /* Kicking is the closest we have to this .. unsavory act. */ g_hash_table_insert (details, "change-reason", tp_g_value_slice_new_uint (TP_CHANNEL_GROUP_CHANGE_REASON_KICKED)); g_hash_table_insert (details, "message", tp_g_value_slice_new_static_string ("*ptooey*")); /* Check that all the right information was extracted from the dict. */ expect_signals ("*ptooey*", camel2, TP_CHANNEL_GROUP_CHANGE_REASON_KICKED, camel_removed); tp_group_mixin_change_members_detailed ((GObject *) service_chan, NULL, del, NULL, NULL, details); wait_for_outstanding_signals (); MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); tp_intset_destroy (del); g_hash_table_unref (details); } /* We and the second camel should be left in the channel */ { const TpIntset *members = tp_channel_group_get_members (chan); GArray *service_members; TpHandle a, b; g_assert_cmpuint (tp_intset_size (members), ==, 2); MYASSERT (tp_intset_is_member (members, self_handle), ""); MYASSERT (tp_intset_is_member (members, camel2), ": what a pity"); /* And let's check that the group mixin agrees, in case that's just the * client binding being wrong. */ tp_group_mixin_get_members ((GObject *) service_chan, &service_members, NULL); g_assert_cmpuint (service_members->len, ==, 2); a = g_array_index (service_members, TpHandle, 0); b = g_array_index (service_members, TpHandle, 1); MYASSERT (a != b, ""); MYASSERT (a == self_handle || b == self_handle, ""); MYASSERT (a == camel2 || b == camel2, ""); g_array_unref (service_members); } tp_handle_unref (contact_repo, camel); tp_handle_unref (contact_repo, camel2); } static void test_group_mixin (void) { GError *error = NULL; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_proxy_has_interface (chan, TP_IFACE_CHANNEL_INTERFACE_GROUP), ""); tp_cli_channel_interface_group_connect_to_members_changed (chan, on_members_changed, NULL, NULL, NULL, NULL); tp_cli_channel_interface_group_connect_to_members_changed_detailed (chan, on_members_changed_detailed, NULL, NULL, NULL, NULL); check_initial_properties (); check_incoming_invitation (); in_the_desert (); } int main (int argc, char **argv) { TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; TpDBusDaemon *dbus; TpConnection *conn; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); MYASSERT (contact_repo != NULL, ""); self_handle = tp_handle_ensure (contact_repo, "me@example.com", NULL, NULL); chan_path = g_strdup_printf ("%s/Channel", conn_path); service_chan = TP_TESTS_TEXT_CHANNEL_GROUP ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_GROUP, "connection", service_conn, "object-path", chan_path, "detailed", TRUE, NULL)); mainloop = g_main_loop_new (NULL, FALSE); MYASSERT (tp_cli_connection_run_connect (conn, -1, &error, NULL), ""); g_assert_no_error (error); chan = tp_channel_new (conn, chan_path, NULL, TP_UNKNOWN_HANDLE_TYPE, 0, &error); g_assert_no_error (error); MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); g_assert_no_error (error); test_group_mixin (); tp_tests_connection_assert_disconnect_succeeds (conn); /* clean up */ g_object_unref (chan); g_main_loop_unref (mainloop); mainloop = NULL; g_object_unref (conn); g_object_unref (service_chan); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_free (name); g_free (conn_path); g_free (chan_path); return 0; } telepathy-glib-0.24.2/tests/dbus/call-cancellation.c0000644000175000017500000004270512652510705017255 00000000000000#include "config.h" #include #include #include #include #include #include /* for _invalidated etc. */ #include #include "tests/lib/myassert.h" #include "tests/lib/stub-object.h" #include "tests/lib/util.h" /* just for convenience, since it's used a lot */ #define PTR(ui) GUINT_TO_POINTER(ui) /* state tracking */ static GMainLoop *mainloop; static TpDBusDaemon *a; static TpDBusDaemon *b; static TpDBusDaemon *c; static TpDBusDaemon *d; static TpDBusDaemon *e; static TpDBusDaemon *f; static TpDBusDaemon *g; static TpDBusDaemon *h; static TpDBusDaemon *i; static TpDBusDaemon *j; static TpDBusDaemon *k; static TpDBusDaemon *z; static TpIntset *method_ok; static TpIntset *method_error; static TpIntset *freed_user_data; static gpointer copy_of_d; static gpointer copy_of_g; static gpointer copy_of_h; static gpointer copy_of_i; enum { TEST_A, TEST_B, TEST_C, TEST_D, TEST_E, TEST_F, TEST_G, TEST_H, TEST_I, TEST_J, TEST_K, TEST_Z = 25, N_DAEMONS }; static void destroy_user_data (gpointer user_data) { guint which = GPOINTER_TO_UINT (user_data); g_message ("User data %c destroyed", 'A' + which); tp_intset_add (freed_user_data, which); } static void j_stub_destroyed (gpointer data, GObject *stub) { destroy_user_data (data); } static void k_stub_destroyed (gpointer data, GObject *stub) { TpProxyPendingCall **p = data; tp_proxy_pending_call_cancel (*p); } static void listed_names (TpDBusDaemon *proxy, const gchar **names, const GError *error, gpointer user_data, GObject *weak_object) { guint which = GPOINTER_TO_UINT (user_data); TpDBusDaemon *want_proxy = NULL; GObject *want_object = NULL; if (error == NULL) { g_message ("ListNames() succeeded (first name: %s), according to " "user_data this was on proxy #%d '%c'", *names, which, 'a' + which); tp_intset_add (method_ok, which); switch (which) { case TEST_A: want_proxy = a; want_object = (GObject *) z; break; case TEST_C: want_proxy = c; want_object = NULL; break; case TEST_D: want_proxy = copy_of_d; want_object = NULL; break; case TEST_G: want_proxy = copy_of_g; want_object = (GObject *) copy_of_g; break; case TEST_Z: want_proxy = z; want_object = (GObject *) a; break; default: MYASSERT (FALSE, ": %c (%p) method call succeeded, which shouldn't " "happen", 'a' + which, proxy); return; } } else { g_message ("ListNames() failed (%s), according to " "user_data this was on proxy #%d '%c'", error->message, which, 'a' + which); tp_intset_add (method_error, which); switch (which) { case TEST_C: want_proxy = c; want_object = NULL; break; case TEST_F: want_proxy = f; want_object = NULL; break; default: MYASSERT (FALSE, ": %c (%p) method call failed, which shouldn't " "happen", 'a' + which, proxy); } } MYASSERT (proxy == want_proxy, ": Proxy is %p, expected %p", proxy, want_proxy); MYASSERT (weak_object == want_object, ": Weak object is %p, expected %p", weak_object, want_object); if (which == TEST_Z) g_main_loop_quit (mainloop); } static void noc (TpDBusDaemon *proxy, const gchar *name, const gchar *old, const gchar *new, gpointer user_data, GObject *weak_object) { /* do nothing */ } int main (int argc, char **argv) { GObject *b_stub, *i_stub, *j_stub, *k_stub; GError err = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Because I said so" }; TpProxyPendingCall *pc; gpointer tmp_obj; tp_tests_abort_after (10); tp_debug_set_flags ("all"); freed_user_data = tp_intset_sized_new (N_DAEMONS); method_ok = tp_intset_sized_new (N_DAEMONS); method_error = tp_intset_sized_new (N_DAEMONS); mainloop = g_main_loop_new (NULL, FALSE); /* We use TpDBusDaemon because it's a convenient concrete subclass of * TpProxy. */ g_message ("Creating proxies"); a = tp_tests_dbus_daemon_dup_or_die (); g_message ("a=%p", a); b = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("b=%p", b); c = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("c=%p", c); d = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("d=%p", d); e = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("e=%p", e); f = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("f=%p", f); g = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("g=%p", g); h = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("h=%p", h); i = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("i=%p", i); j = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("j=%p", j); k = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("k=%p", k); z = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("z=%p", z); /* a survives */ g_message ("Starting call on a"); tp_cli_dbus_daemon_call_list_names (a, -1, listed_names, PTR (TEST_A), destroy_user_data, (GObject *) z); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_A), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_A), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_A), ""); /* b gets its pending call cancelled because the weak object is * destroyed */ b_stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); g_message ("Starting call on b"); tp_cli_dbus_daemon_call_list_names (b, -1, listed_names, PTR (TEST_B), destroy_user_data, b_stub); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_B), ""); g_object_unref (b_stub); MYASSERT (!tp_intset_is_member (method_ok, TEST_B), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_B), ""); /* c is explicitly invalidated for an application-specific reason, * but its call still proceeds */ g_message ("Starting call on c"); tp_cli_dbus_daemon_call_list_names (c, -1, listed_names, PTR (TEST_C), destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), ""); g_message ("Forcibly invalidating c"); tp_proxy_invalidate ((TpProxy *) c, &err); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_C), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_C), ""); /* d gets unreferenced, but survives long enough for the call to complete * successfully later, because the pending call holds a reference */ g_message ("Starting call on d"); tp_cli_dbus_daemon_call_list_names (d, -1, listed_names, PTR (TEST_D), destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_D), ""); g_message ("Unreferencing d"); copy_of_d = d; g_object_add_weak_pointer (copy_of_d, ©_of_d); g_object_unref (d); d = NULL; MYASSERT (copy_of_d != NULL, ""); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_D), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_D), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_D), ""); /* e gets its method call cancelled explicitly */ g_message ("Starting call on e"); pc = tp_cli_dbus_daemon_call_list_names (e, -1, listed_names, PTR (TEST_E), destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_E), ""); g_message ("Cancelling call on e"); tp_proxy_pending_call_cancel (pc); MYASSERT (!tp_intset_is_member (method_ok, TEST_E), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_E), ""); /* f's method call fails with an error, because it's implicitly * invalidated by its DBusGProxy being destroyed. * * Note that this test case exploits implementation details of dbus-glib. * If it stops working after a dbus-glib upgrade, that's probably why. */ g_message ("Starting call on f"); tp_cli_dbus_daemon_call_list_names (f, -1, listed_names, PTR (TEST_F), destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_F), ""); g_message ("Forcibly disposing f's DBusGProxy to simulate name owner loss"); tmp_obj = tp_proxy_borrow_interface_by_id ((TpProxy *) f, TP_IFACE_QUARK_DBUS_DAEMON, NULL); MYASSERT (tmp_obj != NULL, ""); g_object_run_dispose (tmp_obj); /* the callback will be queued (to avoid reentrancy), so we don't get it * until the main loop runs */ MYASSERT (!tp_intset_is_member (freed_user_data, TEST_F), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_F), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_F), ""); /* g gets unreferenced, but survives long enough for the call to complete * successfully later, because the pending call holds a reference; * however, unlike case D, here the pending call weakly references the * proxy. This is never necessary, but is an interesting corner case that * should be tested. */ g_message ("Starting call on g"); tp_cli_dbus_daemon_call_list_names (g, -1, listed_names, PTR (TEST_G), destroy_user_data, (GObject *) g); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_G), ""); g_message ("Unreferencing g"); copy_of_g = g; g_object_add_weak_pointer (copy_of_g, ©_of_g); g_object_unref (g); g = NULL; MYASSERT (copy_of_g != NULL, ""); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_G), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_G), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_G), ""); /* h gets unreferenced, *and* the call is cancelled (regression test for * fd.o #14576) */ g_message ("Starting call on h"); pc = tp_cli_dbus_daemon_call_list_names (h, -1, listed_names, PTR (TEST_H), destroy_user_data, NULL); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_H), ""); g_message ("Unreferencing h"); copy_of_h = h; g_object_add_weak_pointer (copy_of_h, ©_of_h); g_object_unref (h); h = NULL; MYASSERT (copy_of_h != NULL, ""); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_H), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_H), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_H), ""); g_message ("Cancelling call on h"); tp_proxy_pending_call_cancel (pc); MYASSERT (!tp_intset_is_member (method_ok, TEST_H), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_H), ""); /* i gets its pending call cancelled because i_stub is * destroyed, *and* the pending call holds the last reference to it, * *and* there is a signal connection * (used to reproduce fd.o #14750 - see case h in test-disconnection.c * for the minimal regression test) */ i_stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); tp_cli_dbus_daemon_connect_to_name_owner_changed (i, noc, PTR (TEST_I), NULL, i_stub, NULL); g_message ("Starting call on i"); tp_cli_dbus_daemon_call_list_names (i, -1, listed_names, PTR (TEST_I), destroy_user_data, i_stub); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_I), ""); tp_cli_dbus_daemon_connect_to_name_owner_changed (i, noc, PTR (TEST_I), NULL, i_stub, NULL); g_message ("Unreferencing i"); copy_of_i = i; g_object_add_weak_pointer (copy_of_i, ©_of_i); g_object_unref (i); i = NULL; MYASSERT (copy_of_i != NULL, ""); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_I), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_I), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_I), ""); g_object_unref (i_stub); MYASSERT (!tp_intset_is_member (method_ok, TEST_I), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_I), ""); /* j gets its pending call cancelled explicitly, and j_stub is * destroyed in response (related to fd.o #14750) */ j_stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); g_object_weak_ref (j_stub, j_stub_destroyed, PTR (TEST_J)); g_message ("Starting call on j"); pc = tp_cli_dbus_daemon_call_list_names (j, -1, listed_names, j_stub, g_object_unref, j_stub); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_J), ""); g_message ("Cancelling call on j"); tp_proxy_pending_call_cancel (pc); MYASSERT (!tp_intset_is_member (method_ok, TEST_J), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_J), ""); /* k gets its pending call cancelled explicitly because its weak object * is destroyed, meaning there are simultaneously two reasons for it * to become cancelled (equivalent to fd.o#14750, but for pending calls * rather than signal connections) */ k_stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); g_message ("Starting call on k"); g_object_weak_ref (k_stub, k_stub_destroyed, &pc); tp_cli_dbus_daemon_call_list_names (k, -1, listed_names, PTR (TEST_K), destroy_user_data, k_stub); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_K), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_K), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_K), ""); g_object_unref (k_stub); MYASSERT (!tp_intset_is_member (method_ok, TEST_K), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_K), ""); /* z survives too; we assume that method calls succeed in order, * so when z has had its reply, we can stop the main loop */ g_message ("Starting call on z"); tp_cli_dbus_daemon_call_list_names (z, -1, listed_names, PTR (TEST_Z), destroy_user_data, (GObject *) a); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_Z), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_Z), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_Z), ""); g_message ("Running main loop"); g_main_loop_run (mainloop); g_main_loop_unref (mainloop); /* now that the calls have been delivered, d will finally have gone away */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_D), ""); MYASSERT (tp_intset_is_member (method_ok, TEST_D), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_D), ""); MYASSERT (copy_of_d == NULL, ""); /* ... and g too */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_G), ""); MYASSERT (tp_intset_is_member (method_ok, TEST_G), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_G), ""); MYASSERT (copy_of_g == NULL, ""); /* also, F will have been invalidated */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_F), ""); MYASSERT (!tp_intset_is_member (method_ok, TEST_F), ""); MYASSERT (tp_intset_is_member (method_error, TEST_F), ""); /* Now that its call has been cancelled, h will have gone away. Likewise * for i */ MYASSERT (copy_of_h == NULL, ""); MYASSERT (copy_of_i == NULL, ""); /* User data for all the cancelled calls has also gone away */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_B), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_E), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_H), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_I), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_J), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_K), ""); /* the calls have been delivered to A, C and Z by now */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_A), ""); MYASSERT (tp_intset_is_member (method_ok, TEST_A), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_A), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (tp_intset_is_member (method_ok, TEST_C), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_C), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_Z), ""); MYASSERT (tp_intset_is_member (method_ok, TEST_Z), ""); MYASSERT (!tp_intset_is_member (method_error, TEST_Z), ""); g_message ("Dereferencing remaining proxies"); g_object_unref (a); a = NULL; g_object_unref (b); b = NULL; g_object_unref (c); c = NULL; MYASSERT (d == NULL, ""); g_object_unref (e); e = NULL; g_object_unref (f); f = NULL; MYASSERT (g == NULL, ""); MYASSERT (h == NULL, ""); MYASSERT (i == NULL, ""); g_object_unref (j); j = NULL; g_object_unref (k); k = NULL; g_object_unref (z); z = NULL; /* we should already have checked each of these at least once, but just to * make sure we have a systematic test that all user data is freed... */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_A), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_B), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_D), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_E), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_F), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_G), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_H), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_I), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_J), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_K), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_Z), ""); tp_intset_destroy (freed_user_data); tp_intset_destroy (method_ok); tp_intset_destroy (method_error); return 0; } telepathy-glib-0.24.2/tests/dbus/file-transfer-channel.c0000644000175000017500000004200012652510705020043 00000000000000/* Tests of TpFileTransferChannel * * Copyright (C) 2010-2011 Morten Mjelva * Copyright (C) 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/debug.h" #include "tests/lib/simple-conn.h" #include "tests/lib/file-transfer-chan.h" #include "tests/lib/stream-tube-chan.h" typedef struct { TpSocketAddressType address_type; TpSocketAccessControl access_control; } TestContext; TestContext contexts[] = { { TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, // { TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS }, // { TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, // { TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ACCESS_CONTROL_PORT }, // { TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_LOCALHOST }, // { TP_SOCKET_ADDRESS_TYPE_IPV6, TP_SOCKET_ACCESS_CONTROL_PORT }, { TP_NUM_SOCKET_ADDRESS_TYPES, TP_NUM_SOCKET_ACCESS_CONTROLS } }; typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsFileTransferChannel *chan_service; TpHandleRepoIface *contact_repo; TpHandleRepoIface *room_repo; /* Client side objects */ TpConnection *connection; TpFileTransferChannel *channel; GIOStream *cm_stream; GError *error /* initialized where needed */; gint wait; } Test; /* Callbacks */ static void state_notify_cb (GObject *source, GParamSpec *pspec, Test *test) { DEBUG ("state_notify_cb was triggered"); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void channel_prepared_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void file_provide_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; DEBUG ("file_provide_cb reached"); tp_file_transfer_channel_provide_file_finish ( TP_FILE_TRANSFER_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void file_accept_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; DEBUG ("file_accept_cb reached"); tp_file_transfer_channel_accept_file_finish ( TP_FILE_TRANSFER_CHANNEL (source), result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } /* Internal functions */ static void destroy_socket_control_list (gpointer data) { GArray *tab = data; g_array_unref (tab); } static GHashTable * create_available_socket_types_hash (TpSocketAddressType address_type, TpSocketAccessControl access_control) { GHashTable *ret; GArray *tab; ret = g_hash_table_new_full (NULL, NULL, NULL, destroy_socket_control_list); tab = g_array_sized_new (FALSE, FALSE, sizeof (TpSocketAccessControl), 1); g_array_append_val (tab, access_control); g_hash_table_insert (ret, GUINT_TO_POINTER (address_type), tab); return ret; } static void create_file_transfer_channel (Test *test, gboolean requested, TpSocketAddressType address_type, TpSocketAccessControl access_control) { gchar *chan_path; TpHandle handle, alf_handle; GHashTable *props; GHashTable *sockets; GHashTable *metadata; GQuark features[] = { TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE, 0}; const gchar * const metadata_values[] = { "cheese", NULL }; /* Create service-side file transfer channel object */ tp_proxy_get_object_path (test->connection); chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); handle = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); alf_handle = tp_handle_ensure (test->contact_repo, "alf", NULL, &test->error); g_assert_no_error (test->error); sockets = create_available_socket_types_hash (address_type, access_control); metadata = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (metadata, "banana", (gpointer) metadata_values); test->chan_service = g_object_new ( TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, /* TpProxy properties */ "object-path", chan_path, /* TpChannel properties */ "connection", test->base_connection, "handle", handle, "initiator-handle", alf_handle, "requested", requested, /* TpFileTransferChannel properties */ "available-socket-types", sockets, "content-type", "text/plain", "date", (guint64) 271828, "description", "badger", "filename", "snake.txt", "initial-offset", (guint64) 0, "size", (guint64) 9001, "state", TP_FILE_TRANSFER_STATE_PENDING, "transferred-bytes", (guint64) 42, /* Metadata properties */ "service-name", "fit.service.name", "metadata", metadata, NULL); /* Create client-side file transfer channel object */ g_object_get (test->chan_service, "channel-properties", &props, NULL); test->channel = tp_file_transfer_channel_new (test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); /* Prepare core feature */ tp_proxy_prepare_async (test->channel, features, channel_prepared_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_free (chan_path); g_hash_table_unref (metadata); g_hash_table_unref (props); g_hash_table_unref (sockets); tp_handle_unref (test->contact_repo, handle); } static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->chan_service); tp_clear_object (&test->cm_stream); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->channel); } typedef void (*TestFunc) (Test *, gconstpointer); static gchar * test_context_to_str (TestContext *ctx, const gchar *base) { const gchar *socket, *access_control; switch (ctx->address_type) { case TP_SOCKET_ADDRESS_TYPE_UNIX: socket = "unix"; break; case TP_SOCKET_ADDRESS_TYPE_IPV4: socket = "ipv4"; break; case TP_SOCKET_ADDRESS_TYPE_IPV6: socket = "ipv6"; break; default: g_assert_not_reached (); } switch (ctx->access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: access_control = "localhost"; break; case TP_SOCKET_ACCESS_CONTROL_PORT: access_control = "port"; break; case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: access_control = "credentials"; break; default: g_assert_not_reached (); } return g_strdup_printf ("%s/%s/%s", base, socket, access_control); } static void socket_connected (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_clear_object (&test->cm_stream); test->cm_stream = G_IO_STREAM (g_socket_client_connect_finish ( G_SOCKET_CLIENT (source), result, &test->error)); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void run_file_transfer_test (const char *test_path, TestFunc ftest) { guint i; for (i = 0; contexts[i].address_type != TP_NUM_SOCKET_ADDRESS_TYPES; i++) { gchar *path = test_context_to_str (&contexts[i], test_path); g_test_add (path, Test, GUINT_TO_POINTER (i), setup, ftest, teardown); g_free (path); } } /* Tests */ /* Test channel creation */ static void test_create_requested (Test *test, gconstpointer data G_GNUC_UNUSED) { const GError *error = NULL; create_file_transfer_channel (test, TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); g_assert (TP_IS_FILE_TRANSFER_CHANNEL (test->channel)); g_assert (G_IS_OBJECT (test->channel)); error = tp_proxy_get_invalidated (test->channel); g_assert_no_error (error); } static void test_create_unrequested (Test *test, gconstpointer data G_GNUC_UNUSED) { const GError *error = NULL; create_file_transfer_channel (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); g_assert (TP_IS_FILE_TRANSFER_CHANNEL (test->channel)); g_assert (G_IS_OBJECT (test->channel)); error = tp_proxy_get_invalidated (test->channel); g_assert_no_error (error); } /* Test setting and getting properties */ static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { GDateTime *date1, *date2; TpFileTransferStateChangeReason reason; const GError *error = NULL; const GHashTable *metadata; const gchar * const *metadata_values; create_file_transfer_channel (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); g_assert_cmpstr (tp_file_transfer_channel_get_mime_type (test->channel), ==, "text/plain"); date1 = tp_file_transfer_channel_get_date (test->channel); date2 = g_date_time_new_from_unix_utc (271828); g_assert (g_date_time_equal (date1, date2)); g_date_time_unref (date2); g_assert_cmpstr (tp_file_transfer_channel_get_description (test->channel), ==, "badger"); g_assert_cmpstr (tp_file_transfer_channel_get_filename (test->channel), ==, "snake.txt"); g_assert_cmpuint (tp_file_transfer_channel_get_size (test->channel), ==, 9001); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_PENDING); g_assert_cmpuint (tp_file_transfer_channel_get_transferred_bytes (test->channel), ==, 42); g_assert_cmpstr (tp_file_transfer_channel_get_service_name (test->channel), ==, "fit.service.name"); metadata = tp_file_transfer_channel_get_metadata (test->channel); g_assert_cmpuint (g_hash_table_size ((GHashTable *) metadata), ==, 1); metadata_values = g_hash_table_lookup ((GHashTable *) metadata, "banana"); g_assert_cmpuint (g_strv_length ((GStrv) metadata_values), ==, 1); g_assert_cmpstr (metadata_values[0], ==, "cheese"); error = tp_proxy_get_invalidated (test->channel); g_assert_no_error (error); } /* Test sending files */ static void test_provide_success (Test *test, gconstpointer data G_GNUC_UNUSED) { GSocketAddress *address; GSocketClient *client; GFile *file; TpFileTransferStateChangeReason reason; guint i = GPOINTER_TO_UINT (data); create_file_transfer_channel (test, TRUE, contexts[i].address_type, contexts[i].access_control); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_PENDING); /* not very pretty */ g_file_set_contents ("/tmp/file-transfer", "test", -1, NULL); file = g_file_new_for_uri ("file:///tmp/file-transfer"); tp_file_transfer_channel_provide_file_async (test->channel, file, file_provide_cb, test); g_object_unref (file); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_PENDING); g_signal_connect (test->channel, "notify::state", G_CALLBACK (state_notify_cb), test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* File transfer should be in the open state by now */ g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_OPEN); /* A wild CLIENT appears */ address = tp_tests_file_transfer_channel_get_server_address (test->chan_service); g_assert (address != NULL); client = g_socket_client_new (); g_socket_client_connect_async (client, G_SOCKET_CONNECTABLE (address), NULL, socket_connected, test); g_object_unref (client); g_object_unref (address); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->cm_stream != NULL); } static void test_cancel_transfer (Test *test, gconstpointer data G_GNUC_UNUSED) { TpFileTransferStateChangeReason reason; create_file_transfer_channel (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_PENDING); } /* Test receiving files */ static void test_accept_success (Test *test, gconstpointer data G_GNUC_UNUSED) { GFile *file; TpFileTransferStateChangeReason reason; guint i = GPOINTER_TO_UINT (data); create_file_transfer_channel (test, FALSE, contexts[i].address_type, contexts[i].access_control); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_PENDING); file = g_file_new_for_uri ("file:///tmp/file-transfer"); tp_file_transfer_channel_accept_file_async (test->channel, file, 0, file_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_ACCEPTED); g_signal_connect (test->channel, "notify::state", G_CALLBACK (state_notify_cb), test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* File transfer should be in the open state by now */ g_assert_cmpuint (tp_file_transfer_channel_get_state (test->channel, &reason), ==, TP_FILE_TRANSFER_STATE_OPEN); g_object_unref (file); } static void test_accept_twice (Test *test, gconstpointer data G_GNUC_UNUSED) { GFile *file; create_file_transfer_channel (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); file = g_file_new_for_uri ("file:///tmp/file-transfer"); tp_file_transfer_channel_accept_file_async (test->channel, file, 0, file_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Try to re-accept the transfer */ tp_file_transfer_channel_accept_file_async (test->channel, file, 0, file_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_object_unref (file); } static void test_accept_outgoing (Test *test, gconstpointer data G_GNUC_UNUSED) { GFile *file; create_file_transfer_channel (test, TRUE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); file = g_file_new_for_uri ("file:///tmp/file-transfer"); tp_file_transfer_channel_accept_file_async (test->channel, file, 0, file_accept_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); } int main (int argc, char **argv) { tp_tests_abort_after (10); tp_debug_set_flags ("all"); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); /* Test basic object creation etc */ g_test_add ("/file-transfer-channel/create/requested", Test, NULL, setup, test_create_requested, teardown); g_test_add ("/file-transfer-channel/create/unrequested", Test, NULL, setup, test_create_unrequested, teardown); g_test_add ("/file-transfer-channel/properties", Test, NULL, setup, test_properties, teardown); /* Run provide and accept in different contexts */ run_file_transfer_test ("/file-transfer-channel/accept/success", test_accept_success); run_file_transfer_test ("/file-transfer-channel/provide/success", test_provide_success); /* Test edge cases */ /* FIXME: accept_twice has to be after provide/accept_success */ g_test_add ("/file-transfer-channel/accept/twice", Test, NULL, setup, test_accept_twice, teardown); g_test_add ("/file-transfer-channel/accept/outgoing", Test, NULL, setup, test_accept_outgoing, teardown); g_test_add ("/file-transfer-channel/provide/cancel", Test, NULL, setup, test_cancel_transfer, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/client-channel-factory.c0000644000175000017500000001625012652510705020235 00000000000000/* Tests of TpAutomaticProxyFactory and TpBasicProxyFactory * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/util.h" #include "tests/lib/simple-conn.h" #include "tests/lib/stream-tube-chan.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsStreamTubeChannel *tube_chan_service; TpHandleRepoIface *contact_repo; /* Client side objects */ TpConnection *connection; TpClientChannelFactory *factory; GError *error /* initialized where needed */; gint wait; } Test; static void create_tube_service (Test *test) { gchar *chan_path; TpHandle handle, alf_handle; GType type; tp_clear_object (&test->tube_chan_service); /* Create service-side tube channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); handle = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); type = TP_TESTS_TYPE_CONTACT_STREAM_TUBE_CHANNEL; g_assert_no_error (test->error); alf_handle = tp_handle_ensure (test->contact_repo, "alf", NULL, &test->error); g_assert_no_error (test->error); test->tube_chan_service = g_object_new ( type, "connection", test->base_connection, "handle", handle, "requested", TRUE, "object-path", chan_path, "initiator-handle", alf_handle, NULL); g_free (chan_path); tp_handle_unref (test->contact_repo, handle); } static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); create_tube_service (test); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->tube_chan_service); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->factory); } static void test_basic_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { test->factory = TP_CLIENT_CHANNEL_FACTORY (tp_basic_proxy_factory_new ()); g_assert (TP_IS_BASIC_PROXY_FACTORY (test->factory)); g_assert (TP_IS_CLIENT_CHANNEL_FACTORY (test->factory)); } static void test_auto_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { test->factory = TP_CLIENT_CHANNEL_FACTORY ( tp_automatic_proxy_factory_new ()); g_assert (TP_IS_AUTOMATIC_PROXY_FACTORY (test->factory)); g_assert (TP_IS_CLIENT_CHANNEL_FACTORY (test->factory)); } static gboolean array_contains_feature (GArray *features, const GQuark feature) { guint i; for (i = 0; i < features->len; i++) { if (g_array_index (features, GQuark, i) == feature) return TRUE; } return FALSE; } /* Create a proxy for a stream tube */ static void test_basic_stream_tube (Test *test, gconstpointer data G_GNUC_UNUSED) { TpChannel *chan; gchar *chan_path; GHashTable *props; GArray *features; test->factory = TP_CLIENT_CHANNEL_FACTORY (tp_basic_proxy_factory_new ()); g_object_get (test->tube_chan_service, "object-path", &chan_path, "channel-properties", &props, NULL); chan = tp_client_channel_factory_create_channel (test->factory, test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_assert (TP_IS_CHANNEL (chan)); g_assert (!TP_IS_STREAM_TUBE_CHANNEL (chan)); features = tp_client_channel_factory_dup_channel_features (test->factory, chan); g_assert_cmpuint (features->len, ==, 1); g_assert (array_contains_feature (features, TP_CHANNEL_FEATURE_CORE)); g_free (chan_path); g_hash_table_unref (props); g_array_unref (features); } static void test_auto_stream_tube (Test *test, gconstpointer data G_GNUC_UNUSED) { TpChannel *chan; gchar *chan_path; GHashTable *props; GArray *features; test->factory = TP_CLIENT_CHANNEL_FACTORY ( tp_automatic_proxy_factory_new ()); g_object_get (test->tube_chan_service, "object-path", &chan_path, "channel-properties", &props, NULL); chan = tp_client_channel_factory_create_channel (test->factory, test->connection, chan_path, props, &test->error); g_assert_no_error (test->error); g_assert (TP_IS_CHANNEL (chan)); g_assert (TP_IS_STREAM_TUBE_CHANNEL (chan)); features = tp_client_channel_factory_dup_channel_features (test->factory, chan); g_assert_cmpuint (features->len, ==, 3); g_assert (array_contains_feature (features, TP_CHANNEL_FEATURE_CORE)); g_assert (array_contains_feature (features, TP_CHANNEL_FEATURE_GROUP)); g_assert (array_contains_feature (features, TP_CHANNEL_FEATURE_PASSWORD)); g_free (chan_path); g_hash_table_unref (props); g_array_unref (features); } static void test_basic_dup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpBasicProxyFactory *fac; test->factory = TP_CLIENT_CHANNEL_FACTORY (tp_basic_proxy_factory_dup ()); g_assert (TP_IS_BASIC_PROXY_FACTORY (test->factory)); g_assert (TP_IS_CLIENT_CHANNEL_FACTORY (test->factory)); fac = tp_basic_proxy_factory_dup (); g_assert ((gpointer) fac == (gpointer) test->factory); g_object_unref (fac); } static void test_auto_dup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAutomaticProxyFactory *fac; test->factory = TP_CLIENT_CHANNEL_FACTORY (tp_automatic_proxy_factory_dup ()); g_assert (TP_IS_AUTOMATIC_PROXY_FACTORY (test->factory)); g_assert (TP_IS_CLIENT_CHANNEL_FACTORY (test->factory)); fac = tp_automatic_proxy_factory_dup (); g_assert ((gpointer) fac == (gpointer) test->factory); g_object_unref (fac); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/client-channel-factory/basic/creation", Test, NULL, setup, test_basic_creation, teardown); g_test_add ("/client-channel-factory/auto/creation", Test, NULL, setup, test_auto_creation, teardown); g_test_add ("/client-channel-factory/basic/stream-tube", Test, NULL, setup, test_basic_stream_tube, teardown); g_test_add ("/client-channel-factory/auto/stream-tube", Test, NULL, setup, test_auto_stream_tube, teardown); g_test_add ("/client-channel-factory/basic/dup", Test, NULL, setup, test_basic_dup, teardown); g_test_add ("/client-channel-factory/auto/dup", Test, NULL, setup, test_auto_dup, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/error-enum.c0000644000175000017500000000053412652510705015775 00000000000000#include "config.h" #include #include "tests/lib/util.h" static void test_tp_errors (void) { #include "tests/dbus/_gen/errors-check.h" } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_add_func ("/test-error-enum/TP_ERROR", test_tp_errors); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/connection-bug-18845.c0000644000175000017500000000654612652510705017314 00000000000000/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=18845 * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" static GMainLoop *mainloop; static GError invalidated_for_test = { 0, TP_ERROR_PERMISSION_DENIED, "No connection for you!" }; static gboolean no_more_idling_around (gpointer data) { g_main_loop_quit (data); return FALSE; } int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *conn; DBusGProxy *proxy; tp_tests_abort_after (10); invalidated_for_test.domain = TP_ERROR; tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); { const gchar *ids[] = { "flarglybadger", NULL }; GArray *handles = NULL; MYASSERT (tp_cli_connection_run_request_handles (conn, -1, TP_HANDLE_TYPE_CONTACT, ids, &handles, &error, NULL), ""); g_assert_no_error (error); g_array_unref (handles); } /* The bug was in cleaning up handle refs when the CM fell off the bus. * Emitting "destroy" on the proxy simulates the CM falling off the bus. */ proxy = tp_proxy_borrow_interface_by_id ((TpProxy *) conn, TP_IFACE_QUARK_CONNECTION, &error); g_assert_no_error (error); g_signal_emit_by_name (proxy, "destroy"); g_idle_add_full (G_PRIORITY_LOW, no_more_idling_around, mainloop, NULL); g_main_loop_run (mainloop); g_object_unref (conn); /* Make a new connection proxy so that we can call Disconnect() on the * connection. */ conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_object_unref (conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); g_main_loop_unref (mainloop); return 0; } telepathy-glib-0.24.2/tests/dbus/base-client.c0000644000175000017500000014103712652510705016074 00000000000000/* Tests of TpBaseClient * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" /* We include -internal headers of context to be able to easily access to * their semi-private attributes (connection, account, channels, etc). */ #include #include #include #include #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/simple-channel-dispatch-operation.h" #include "tests/lib/simple-channel-dispatcher.h" #include "tests/lib/simple-channel-request.h" #include "tests/lib/simple-client.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseClient *base_client; TpTestsSimpleClient *simple_client; TpBaseConnection *base_connection; TpTestsSimpleAccount *account_service; TpTestsTextChannelNull *text_chan_service; TpTestsTextChannelNull *text_chan_service_2; TpTestsSimpleChannelDispatchOperation *cdo_service; TpTestsSimpleChannelDispatcher *cd_service; /* Client side objects */ TpAccountManager *account_mgr; TpClient *client; TpConnection *connection; TpAccount *account; TpChannel *text_chan; TpChannel *text_chan_2; GError *error /* initialized where needed */; GStrv interfaces; gint wait; GPtrArray *delegated; GHashTable *not_delegated; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" #define CDO_PATH "/whatever" static void setup (Test *test, gconstpointer data) { gchar *chan_path; TpHandle handle; TpHandleRepoIface *contact_repo; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; test->interfaces = NULL; /* The case of a non-shared TpAccountManager is tested in * simple-approver.c */ test->account_mgr = tp_account_manager_dup (); g_assert (test->account_mgr != NULL); /* Claim AccountManager bus-name (needed as we're going to export an Account * object). */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create service-side Client object */ test->simple_client = tp_tests_simple_client_new (test->dbus, "Test", FALSE); g_assert (test->simple_client != NULL); test->base_client = TP_BASE_CLIENT (test->simple_client); /* Create service-side Account object */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); /* Create client-side Client object */ test->client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", test->dbus, "bus-name", tp_base_client_get_bus_name (test->base_client), "object-path", tp_base_client_get_object_path (test->base_client), NULL); g_assert (test->client != NULL); /* Create client-side Account object */ test->account = tp_account_manager_ensure_account (test->account_mgr, ACCOUNT_PATH); g_assert (test->account != NULL); g_object_ref (test->account); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create service-side text channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); /* Create a second channel */ chan_path = g_strdup_printf ("%s/Channel2", tp_proxy_get_object_path (test->connection)); handle = tp_handle_ensure (contact_repo, "alice", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service_2 = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan_2 = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); /* Create Service side ChannelDispatchOperation object */ test->cdo_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCH_OPERATION, NULL); tp_dbus_daemon_register_object (test->dbus, CDO_PATH, test->cdo_service); tp_tests_simple_channel_dispatch_operation_set_conn_path (test->cdo_service, tp_proxy_get_object_path (test->connection)); tp_tests_simple_channel_dispatch_operation_set_account_path ( test->cdo_service, tp_proxy_get_object_path (test->account)); tp_tests_simple_channel_dispatch_operation_add_channel (test->cdo_service, test->text_chan); tp_tests_simple_channel_dispatch_operation_add_channel (test->cdo_service, test->text_chan_2); g_assert (tp_dbus_daemon_request_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, NULL)); /* Create and register CD */ test->cd_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, "connection", test->base_connection, NULL); tp_dbus_daemon_register_object (test->dbus, TP_CHANNEL_DISPATCHER_OBJECT_PATH, test->cd_service); } static void teardown_channel_invalidated_cb (TpChannel *self, guint domain, gint code, gchar *message, Test *test) { g_main_loop_quit (test->mainloop); } static void teardown_run_close_channel (Test *test, TpChannel *channel) { if (channel != NULL && tp_proxy_get_invalidated (channel) == NULL) { g_signal_connect (channel, "invalidated", G_CALLBACK (teardown_channel_invalidated_cb), test); tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL); g_main_loop_run (test->mainloop); } } static void teardown (Test *test, gconstpointer data) { teardown_run_close_channel (test, test->text_chan); teardown_run_close_channel (test, test->text_chan_2); g_clear_error (&test->error); g_strfreev (test->interfaces); g_object_unref (test->account_mgr); tp_dbus_daemon_release_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, NULL); g_object_unref (test->base_client); g_object_unref (test->client); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_object_unref (test->account_service); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; g_object_unref (test->account); if (test->text_chan_service != NULL) g_object_unref (test->text_chan_service); g_object_unref (test->text_chan); if (test->text_chan_service_2 != NULL) g_object_unref (test->text_chan_service_2); g_object_unref (test->text_chan_2); tp_clear_object (&test->cdo_service); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->cd_service); tp_clear_pointer (&test->delegated, g_ptr_array_unref); tp_clear_pointer (&test->not_delegated, g_hash_table_unref); } /* Test Basis */ static void test_basics (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountManager *account_manager; TpDBusDaemon *dbus; gchar *name; gboolean unique; g_object_get (test->base_client, "account-manager", &account_manager, "dbus-daemon", &dbus, "name", &name, "uniquify-name", &unique, NULL); g_assert (test->account_mgr == account_manager); g_assert (test->dbus == dbus); g_assert_cmpstr ("Test", ==, name); g_assert (!unique); g_assert (test->account_mgr == tp_base_client_get_account_manager ( test->base_client)); g_assert (test->dbus == tp_base_client_get_dbus_daemon (test->base_client)); g_assert_cmpstr ("Test", ==, tp_base_client_get_name (test->base_client)); g_assert (!tp_base_client_get_uniquify_name (test->base_client)); g_object_unref (account_manager); g_object_unref (dbus); g_free (name); } /* Test register */ static void get_client_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); g_strfreev (test->interfaces); test->interfaces = g_strdupv ((GStrv) tp_asv_get_strv ( properties, "Interfaces")); out: g_main_loop_quit (test->mainloop); } static void test_register (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_base_client_be_a_handler (test->base_client); /* no-op as the client is not registered yet */ tp_base_client_unregister (test->base_client); /* Client is not registered yet */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_error (test->error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN); g_error_free (test->error); test->error = NULL; /* register the client */ tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* unregister the client */ tp_base_client_unregister (test->base_client); tp_tests_proxy_run_until_dbus_queue_processed (test->client); tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_error (test->error, DBUS_GERROR, DBUS_GERROR_SERVICE_UNKNOWN); g_error_free (test->error); test->error = NULL; /* re-register the client */ tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } /* Test Observer */ static void check_filters (GPtrArray *filters) { GHashTable *filter; g_assert (filters != NULL); g_assert_cmpuint (filters->len, ==, 2); filter = g_ptr_array_index (filters, 0); g_assert_cmpuint (g_hash_table_size (filter), ==, 1); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); filter = g_ptr_array_index (filters, 1); g_assert_cmpuint (g_hash_table_size (filter), ==, 2); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); g_assert_cmpuint (tp_asv_get_uint32 (filter, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); } static void get_observer_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; gboolean recover, delay; gboolean valid; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 3); filters = tp_asv_get_boxed (properties, "ObserverChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); recover = tp_asv_get_boolean (properties, "Recover", &valid); g_assert (valid); g_assert (recover); delay = tp_asv_get_boolean (properties, "DelayApprovers", &valid); g_assert (valid); g_assert (delay); out: g_main_loop_quit (test->mainloop); } static void no_return_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_error (&test->error); if (error != NULL) { test->error = g_error_copy (error); goto out; } out: test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void add_channel_to_ptr_array (GPtrArray *arr, TpChannel *channel) { GValueArray *tmp; g_assert (arr != NULL); g_assert (channel != NULL); tmp = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, tp_channel_borrow_immutable_properties ( channel), G_TYPE_INVALID); g_ptr_array_add (arr, tmp); } static void free_channel_details (gpointer data, gpointer user_data) { g_boxed_free (TP_STRUCT_TYPE_CHANNEL_DETAILS, data); } static void test_observer (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *filter; GPtrArray *channels, *requests_satisified; GHashTable *info; TpChannel *chan; filter = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL); tp_base_client_add_observer_filter (test->base_client, filter); g_hash_table_unref (filter); tp_base_client_take_observer_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_set_observer_recover (test->base_client, TRUE); tp_base_client_set_observer_delay_approvers (test->base_client, TRUE); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpint (g_strv_length (test->interfaces), ==, 1); g_assert (tp_strv_contains ((const gchar * const *) test->interfaces, TP_IFACE_CLIENT_OBSERVER)); /* Check Observer properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_OBSERVER, get_observer_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Call ObserveChannels */ channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->text_chan); requests_satisified = g_ptr_array_sized_new (0); info = tp_asv_new ( "recovering", G_TYPE_BOOLEAN, TRUE, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_OBSERVER); tp_cli_client_observer_call_observe_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, "/", requests_satisified, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->simple_client->observe_ctx != NULL); g_assert (tp_observe_channels_context_is_recovering ( test->simple_client->observe_ctx)); g_assert (test->simple_client->observe_ctx->account == test->account); /* Now call it with an invalid argument */ tp_asv_set_boolean (info, "FAIL", TRUE); tp_cli_client_observer_call_observe_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, "/", requests_satisified, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); /* The channel being observed is invalidated while preparing */ g_hash_table_remove (info, "FAIL"); tp_cli_client_observer_call_observe_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, "/", requests_satisified, info, no_return_cb, test, NULL, NULL); tp_tests_text_channel_null_close (test->text_chan_service); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); chan = g_ptr_array_index (test->simple_client->observe_ctx->channels, 0); g_assert (TP_IS_CHANNEL (chan)); g_assert (tp_proxy_get_invalidated (chan) != NULL); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } /* Test Approver */ static void get_approver_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); filters = tp_asv_get_boxed (properties, "ApproverChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); out: g_main_loop_quit (test->mainloop); } static void test_approver (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *filter; GPtrArray *channels, *chans; GHashTable *properties; static const char *interfaces[] = { NULL }; static const gchar *possible_handlers[] = { TP_CLIENT_BUS_NAME_BASE ".Badger", NULL, }; guint i; filter = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL); tp_base_client_add_approver_filter (test->base_client, filter); g_hash_table_unref (filter); tp_base_client_take_approver_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpint (g_strv_length (test->interfaces), ==, 1); g_assert (tp_strv_contains ((const gchar * const *) test->interfaces, TP_IFACE_CLIENT_APPROVER)); /* Check Approver properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_APPROVER, get_approver_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Call AddDispatchOperation */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); add_channel_to_ptr_array (channels, test->text_chan_2); properties = tp_asv_new ( TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->connection), TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->account), TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS, G_TYPE_STRV, possible_handlers, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_APPROVER); tp_cli_client_approver_call_add_dispatch_operation (test->client, -1, channels, CDO_PATH, properties, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->simple_client->add_dispatch_ctx != NULL); chans = tp_channel_dispatch_operation_borrow_channels ( test->simple_client->add_dispatch_ctx->dispatch_operation); g_assert_cmpuint (chans->len, ==, 2); /* Check that we reuse existing proxies rather than creating new ones */ g_assert (test->simple_client->add_dispatch_ctx->account == test->account); g_assert (tp_channel_dispatch_operation_borrow_account ( test->simple_client->add_dispatch_ctx->dispatch_operation) == test->account); g_assert (tp_channel_dispatch_operation_borrow_connection ( test->simple_client->add_dispatch_ctx->dispatch_operation) == test->simple_client->add_dispatch_ctx->connection); g_assert (chans->len == test->simple_client->add_dispatch_ctx->channels->len); for (i = 0; i < chans->len; i++) { g_assert (g_ptr_array_index (chans, i) == g_ptr_array_index (test->simple_client->add_dispatch_ctx->channels, i)); } /* Another call to AddDispatchOperation, the second channel will be * invalidated during the call */ tp_cli_client_approver_call_add_dispatch_operation (test->client, -1, channels, CDO_PATH, properties, no_return_cb, test, NULL, NULL); tp_tests_text_channel_null_close (test->text_chan_service_2); test->wait++; g_object_unref (test->text_chan_service_2); test->text_chan_service_2 = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan_2); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->simple_client->add_dispatch_ctx != NULL); /* The CDO only contain valid channels */ chans = tp_channel_dispatch_operation_borrow_channels ( test->simple_client->add_dispatch_ctx->dispatch_operation); g_assert_cmpuint (chans->len, ==, 1); /* But the context contains both */ g_assert_cmpuint (test->simple_client->add_dispatch_ctx->channels->len, ==, 2); /* Another call to AddDispatchOperation, the last channel will be * invalidated during the call */ tp_cli_client_approver_call_add_dispatch_operation (test->client, -1, channels, CDO_PATH, properties, no_return_cb, test, NULL, NULL); tp_tests_text_channel_null_close (test->text_chan_service); g_object_unref (test->text_chan_service); test->text_chan_service = NULL; tp_tests_simple_channel_dispatch_operation_lost_channel (test->cdo_service, test->text_chan); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_hash_table_unref (properties); } /* Test Handler */ static void get_handler_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; gboolean bypass; gboolean valid; const gchar * const * capabilities; GPtrArray *handled; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 4); filters = tp_asv_get_boxed (properties, "HandlerChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); bypass = tp_asv_get_boolean (properties, "BypassApproval", &valid); g_assert (valid); g_assert (bypass); capabilities = tp_asv_get_strv (properties, "Capabilities"); g_assert_cmpint (g_strv_length ((GStrv) capabilities), ==, 5); g_assert (tp_strv_contains (capabilities, "badger")); g_assert (tp_strv_contains (capabilities, "mushroom")); g_assert (tp_strv_contains (capabilities, "snake")); g_assert (tp_strv_contains (capabilities, "goat")); g_assert (tp_strv_contains (capabilities, "pony")); handled = tp_asv_get_boxed (properties, "HandledChannels", TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_assert (handled != NULL); g_assert_cmpint (handled->len, ==, 0); out: g_main_loop_quit (test->mainloop); } static void channel_invalidated_cb (TpChannel *channel, guint domain, gint code, gchar *message, Test *test) { g_main_loop_quit (test->mainloop); } static void test_handler (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *filter; const gchar *caps[] = { "mushroom", "snake", NULL }; GPtrArray *channels; GPtrArray *requests_satisified; GHashTable *info; GList *chans; TpTestsSimpleClient *client_2; filter = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL); tp_base_client_add_handler_filter (test->base_client, filter); g_hash_table_unref (filter); tp_base_client_take_handler_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_set_handler_bypass_approval (test->base_client, TRUE); tp_base_client_add_handler_capability (test->base_client, "badger"); tp_base_client_add_handler_capabilities (test->base_client, caps); tp_base_client_add_handler_capabilities_varargs (test->base_client, "goat", "pony", NULL); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpint (g_strv_length (test->interfaces), ==, 1); g_assert (tp_strv_contains ((const gchar * const *) test->interfaces, TP_IFACE_CLIENT_HANDLER)); /* Check Handler properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_HANDLER, get_handler_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* Call HandleChannels */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); add_channel_to_ptr_array (channels, test->text_chan_2); requests_satisified = g_ptr_array_sized_new (0); info = g_hash_table_new (NULL, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->simple_client->handle_channels_ctx != NULL); g_assert (test->simple_client->handle_channels_ctx->account == test->account); chans = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (chans), ==, 2); g_list_free (chans); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* One of the channel is closed */ g_signal_connect (test->text_chan, "invalidated", G_CALLBACK (channel_invalidated_cb), test); tp_tests_text_channel_null_close (test->text_chan_service); g_main_loop_run (test->mainloop); chans = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (chans), ==, 1); g_list_free (chans); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* Create another client sharing the same unique name */ client_2 = tp_tests_simple_client_new (test->dbus, "Test", TRUE); tp_base_client_be_a_handler (TP_BASE_CLIENT (client_2)); tp_base_client_register (TP_BASE_CLIENT (client_2), &test->error); g_assert_no_error (test->error); chans = tp_base_client_get_handled_channels (TP_BASE_CLIENT (client_2)); g_assert_cmpuint (g_list_length (chans), ==, 1); g_list_free (chans); g_assert (!tp_base_client_is_handling_channel (TP_BASE_CLIENT (client_2), test->text_chan)); g_assert (tp_base_client_is_handling_channel (TP_BASE_CLIENT (client_2), test->text_chan_2)); g_object_unref (client_2); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } /* Test Requests interface on Handler */ static void get_requests_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 0); out: g_main_loop_quit (test->mainloop); } static void request_added_cb (TpBaseClient *client, TpAccount *account, TpChannelRequest *request, Test *test) { GList *requests; g_assert (TP_IS_CHANNEL_REQUEST (request)); g_assert (TP_IS_ACCOUNT (account)); g_assert (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)); requests = tp_base_client_get_pending_requests (test->base_client); g_assert_cmpuint (g_list_length ((GList *) requests), ==, 1); g_assert (requests->data == request); g_list_free (requests); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void request_removed_cb (TpBaseClient *client, TpChannelRequest *request, const gchar *error, const gchar *reason, Test *test) { g_assert (TP_IS_CHANNEL_REQUEST (request)); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void test_handler_requests (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *properties; GPtrArray *channels; GPtrArray *requests_satisified; GHashTable *info; TpChannelRequest *request; GList *requests; tp_base_client_take_handler_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_set_handler_request_notification (test->base_client); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpint (g_strv_length (test->interfaces), ==, 2); g_assert (tp_strv_contains ((const gchar * const *) test->interfaces, TP_IFACE_CLIENT_HANDLER)); g_assert (tp_strv_contains ((const gchar * const *) test->interfaces, TP_IFACE_CLIENT_INTERFACE_REQUESTS)); /* Check Requests properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_INTERFACE_REQUESTS, get_requests_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_base_client_get_pending_requests (test->base_client) == NULL); /* Call AddRequest */ properties = tp_asv_new ( TP_PROP_CHANNEL_REQUEST_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, ACCOUNT_PATH, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_INTERFACE_REQUESTS); g_signal_connect (test->base_client, "request-added", G_CALLBACK (request_added_cb), test); tp_cli_client_interface_requests_call_add_request (test->client, -1, "/Request", properties, no_return_cb, test, NULL, NULL); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); requests = tp_base_client_get_pending_requests (test->base_client); g_assert (requests != NULL); g_list_free (requests); /* Call HandleChannels */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); requests_satisified = g_ptr_array_sized_new (1); g_ptr_array_add (requests_satisified, "/Request"); info = g_hash_table_new (NULL, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (test->simple_client->handle_channels_ctx != NULL); g_assert_cmpint ( test->simple_client->handle_channels_ctx->requests_satisfied->len, ==, 1); request = g_ptr_array_index ( test->simple_client->handle_channels_ctx->requests_satisfied, 0); requests = tp_base_client_get_pending_requests (test->base_client); g_assert (requests->data == request); g_list_free (requests); /* Call RemoveRequest */ g_signal_connect (test->base_client, "request-removed", G_CALLBACK (request_removed_cb), test); tp_cli_client_interface_requests_call_remove_request (test->client, -1, "/Request", "Badger", "snake", no_return_cb, test, NULL, NULL); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_base_client_get_pending_requests (test->base_client) == NULL); g_hash_table_unref (properties); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } static void claim_with_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatch_operation_claim_with_finish ( TP_CHANNEL_DISPATCH_OPERATION (source), result, &test->error); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void cdo_finished_cb (TpTestsSimpleChannelDispatchOperation *cdo, Test *test) { tp_clear_object (&test->cdo_service); } static void test_channel_dispatch_operation_claim_with_async (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *channels; GHashTable *properties; static const char *interfaces[] = { NULL }; static const gchar *possible_handlers[] = { TP_CLIENT_BUS_NAME_BASE ".Badger", NULL, }; TpChannelDispatchOperation *cdo; GList *handled; /* Register an Approver and Handler */ tp_base_client_take_approver_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL)); tp_base_client_take_handler_filter (test->base_client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL)); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Call AddDispatchOperation */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); add_channel_to_ptr_array (channels, test->text_chan_2); properties = tp_asv_new ( TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES, G_TYPE_STRV, interfaces, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->connection), TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (test->account), TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS, G_TYPE_STRV, possible_handlers, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_APPROVER); tp_cli_client_approver_call_add_dispatch_operation (test->client, -1, channels, CDO_PATH, properties, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); cdo = test->simple_client->add_dispatch_ctx->dispatch_operation; g_assert (TP_IS_CHANNEL_DISPATCH_OPERATION (cdo)); handled = tp_base_client_get_handled_channels (test->base_client); g_assert (handled == NULL); /* Connect to CDO's Finished signal so we can remove it from the bus when * it's claimed as MC would do. */ g_signal_connect (test->cdo_service, "finished", G_CALLBACK (cdo_finished_cb), test); /* Claim the CDO, as the client is also a Handler, it is now handling the * channels */ tp_channel_dispatch_operation_claim_with_async (cdo, test->base_client, claim_with_cb, test); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); handled = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (handled), ==, 2); g_list_free (handled); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_hash_table_unref (properties); } static void delegate_channels_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_base_client_delegate_channels_finish ( TP_BASE_CLIENT (source), result, &test->delegated, &test->not_delegated, &test->error); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void test_delegate_channels (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *channels; GPtrArray *requests_satisified; GHashTable *info; GList *chans; GError *error = NULL; tp_base_client_be_a_handler (test->base_client); tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Call HandleChannels */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); add_channel_to_ptr_array (channels, test->text_chan_2); requests_satisified = g_ptr_array_sized_new (0); info = g_hash_table_new (NULL, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* The client is handling the 2 channels */ chans = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (chans), ==, 2); g_list_free (chans); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* Try to delegate the first one */ chans = g_list_append (NULL, test->text_chan); tp_base_client_delegate_channels_async (test->base_client, chans, TP_USER_ACTION_TIME_CURRENT_TIME, NULL, delegate_channels_cb, test); g_list_free (chans); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (test->delegated->len, ==, 1); g_assert (g_ptr_array_index (test->delegated, 0) == test->text_chan); g_assert_cmpuint (g_hash_table_size (test->not_delegated), ==, 0); /* Client is not handling the channel any more */ chans = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (chans), ==, 1); g_list_free (chans); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* Try delegating the second channel, but MC refuses */ test->cd_service->refuse_delegate = TRUE; chans = g_list_append (NULL, test->text_chan_2); tp_base_client_delegate_channels_async (test->base_client, chans, TP_USER_ACTION_TIME_CURRENT_TIME, NULL, delegate_channels_cb, test); g_list_free (chans); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (test->delegated->len, ==, 0); g_assert_cmpuint (g_hash_table_size (test->not_delegated), ==, 1); error = g_hash_table_lookup (test->not_delegated, test->text_chan_2); g_assert_error (error, TP_ERROR, TP_ERROR_BUSY); /* Client is still handling the channel */ chans = tp_base_client_get_handled_channels (test->base_client); g_assert_cmpuint (g_list_length (chans), ==, 1); g_list_free (chans); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } static void present_channel_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_channel_dispatcher_present_channel_finish ( TP_CHANNEL_DISPATCHER (source), result, &test->error); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void test_present_channel (Test *test, gconstpointer data G_GNUC_UNUSED) { TpChannelDispatcher *cd; cd = tp_channel_dispatcher_new (test->dbus); tp_channel_dispatcher_present_channel_async (cd, test->text_chan, TP_USER_ACTION_TIME_CURRENT_TIME, present_channel_cb, test); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_object_unref (cd); } #define PREFERRED_HANDLER_NAME TP_CLIENT_BUS_NAME_BASE ".Badger" static gboolean channel_in_array (GPtrArray *array, TpChannel *channel) { guint i; for (i = 0; i < array->len; i++) { TpChannel *c = g_ptr_array_index (array, i); if (!tp_strdiff (tp_proxy_get_object_path (channel), tp_proxy_get_object_path (c))) return TRUE; } return FALSE; } static void delegated_channels_cb (TpBaseClient *client, GPtrArray *channels, gpointer user_data) { Test *test = user_data; g_assert_cmpuint (channels->len, ==, 2); g_assert (channel_in_array (channels, test->text_chan)); g_assert (channel_in_array (channels, test->text_chan_2)); test->wait--; if (test->wait == 0) g_main_loop_quit (test->mainloop); } static void delegate_to_preferred_handler (Test *test, gboolean supported) { GPtrArray *channels; GPtrArray *requests_satisified; GPtrArray *requests; GHashTable *request_props; GHashTable *info; TpTestsSimpleChannelRequest *cr; GHashTable *hints; tp_base_client_be_a_handler (test->base_client); if (supported) { tp_base_client_set_delegated_channels_callback (test->base_client, delegated_channels_cb, test, NULL); } tp_base_client_register (test->base_client, &test->error); g_assert_no_error (test->error); /* Call HandleChannels */ channels = g_ptr_array_sized_new (2); add_channel_to_ptr_array (channels, test->text_chan); add_channel_to_ptr_array (channels, test->text_chan_2); requests_satisified = g_ptr_array_sized_new (0); info = g_hash_table_new (NULL, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_HANDLER); tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* The client is handling the 2 channels */ g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); /* Another client asks to dispatch the channel to it */ requests = g_ptr_array_new (); hints = tp_asv_new ( "org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler", G_TYPE_BOOLEAN, TRUE, NULL); cr = tp_tests_simple_channel_request_new ("/CR", TP_TESTS_SIMPLE_CONNECTION (test->base_connection), ACCOUNT_PATH, TP_USER_ACTION_TIME_CURRENT_TIME, PREFERRED_HANDLER_NAME, requests, hints); g_ptr_array_add (requests_satisified, "/CR"); request_props = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_hash_table_unref); g_hash_table_insert (request_props, "/CR", tp_tests_simple_channel_request_dup_immutable_props (cr)); tp_asv_set_boxed (info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_props); tp_cli_client_handler_call_handle_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->wait = 1; /* If we support the DelegateToPreferredHandler hint, we wait for * delegated_channels_cb to be called */ if (supported) test->wait++; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); if (supported) { /* We are not handling the channels any more */ g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (!tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); } else { /* We are still handling the channels */ g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan)); g_assert (tp_base_client_is_handling_channel (test->base_client, test->text_chan_2)); } tp_base_client_unregister (test->base_client); g_object_unref (cr); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_ptr_array_unref (requests); g_hash_table_unref (info); g_hash_table_unref (hints); g_hash_table_unref (request_props); } static void test_delegate_to_preferred_handler_not_supported (Test *test, gconstpointer data G_GNUC_UNUSED) { delegate_to_preferred_handler (test, FALSE); } static void test_delegate_to_preferred_handler_supported (Test *test, gconstpointer data G_GNUC_UNUSED) { delegate_to_preferred_handler (test, TRUE); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/base-client/basics", Test, NULL, setup, test_basics, teardown); g_test_add ("/base-client/register", Test, NULL, setup, test_register, teardown); g_test_add ("/base-client/observer", Test, NULL, setup, test_observer, teardown); g_test_add ("/base-client/approver", Test, NULL, setup, test_approver, teardown); g_test_add ("/base-client/handler", Test, NULL, setup, test_handler, teardown); g_test_add ("/base-client/handler-requests", Test, NULL, setup, test_handler_requests, teardown); g_test_add ("/cdo/claim_with", Test, NULL, setup, test_channel_dispatch_operation_claim_with_async, teardown); g_test_add ("/base-client/delegate-channels", Test, NULL, setup, test_delegate_channels, teardown); g_test_add ("/cd/present-channel", Test, NULL, setup, test_present_channel, teardown); g_test_add ("/cd/delegate-to-preferred-handler/not-supported", Test, NULL, setup, test_delegate_to_preferred_handler_not_supported, teardown); g_test_add ("/cd/delegate-to-preferred-handler/supported", Test, NULL, setup, test_delegate_to_preferred_handler_supported, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/handle-repo.c0000644000175000017500000000652512652510705016106 00000000000000#include "config.h" #include #include #include #include #include #include #include #include #include #include "tests/lib/util.h" static void test_handles (void) { TpDBusDaemon *bus_daemon = tp_tests_dbus_daemon_dup_or_die (); TpHandleRepoIface *tp_repo = NULL; GError *error = NULL; TpHandle handle = 0; const gchar *jid = "handle.test@foobar"; const gchar *return_jid; tp_repo = tp_tests_object_new_static_class (TP_TYPE_DYNAMIC_HANDLE_REPO, "handle-type", TP_HANDLE_TYPE_CONTACT, NULL); g_assert (tp_repo != NULL); /* Handle zero is never valid */ g_assert (tp_handle_is_valid (tp_repo, 0, &error) == FALSE); /* this should probably be InvalidHandle, but it was InvalidArgument in * older telepathy-glib */ g_assert (error->code == TP_ERROR_INVALID_ARGUMENT || error->code == TP_ERROR_INVALID_HANDLE); g_error_free (error); error = NULL; /* Properly return error when handle isn't in the repo */ g_assert (tp_handle_is_valid (tp_repo, 65536, &error) == FALSE); /* this should really be InvalidHandle, but it was InvalidArgument in * older telepathy-glib */ g_assert (error->code == TP_ERROR_INVALID_ARGUMENT || error->code == TP_ERROR_INVALID_HANDLE); g_error_free (error); error = NULL; /* Properly return when error out argument isn't provided */ g_assert (tp_handle_is_valid (tp_repo, 65536, NULL) == FALSE); /* It's not there to start with */ handle = tp_handle_lookup (tp_repo, jid, NULL, NULL); g_assert (handle == 0); /* ... but when we call tp_handle_ensure we get a new ref to it [ref 1] */ handle = tp_handle_ensure (tp_repo, jid, NULL, NULL); g_assert (handle != 0); /* Try to inspect it */ return_jid = tp_handle_inspect (tp_repo, handle); g_assert (!strcmp (return_jid, jid)); /* Hold the handle on behalf of a bus name that will not go away (my own) * [ref 2] */ g_assert (tp_handle_client_hold (tp_repo, tp_dbus_daemon_get_unique_name (bus_daemon), handle, NULL) == TRUE); /* Now unref it [ref 1] */ tp_handle_unref (tp_repo, handle); /* Validate it, should be all healthy because client holds it still */ g_assert (tp_handle_is_valid (tp_repo, handle, NULL) == TRUE); /* Ref it again [ref 3] */ tp_handle_ref (tp_repo, handle); /* Client releases it [ref 2] */ g_assert (tp_handle_client_release (tp_repo, tp_dbus_daemon_get_unique_name (bus_daemon), handle, NULL) == TRUE); /* Hold the handle on behalf of a bus name that does not, in fact, exist; * this will be detected asynchronously [ref 4] */ g_assert (tp_handle_client_hold (tp_repo, ":666.666", handle, NULL) == TRUE); /* Now unref it [ref 3] */ tp_handle_unref (tp_repo, handle); /* ref 4 ensures still valid */ g_assert (tp_handle_is_valid (tp_repo, handle, NULL) == TRUE); /* wait for D-Bus to catch up (just to detect any crashes) but don't assert * that the handle doesn't remain valid - unref is a no-op since * 0.13.8 */ tp_tests_proxy_run_until_dbus_queue_processed (bus_daemon); g_object_unref (tp_repo); g_object_unref (bus_daemon); } int main (int argc, char **argv) { tp_tests_abort_after (10); test_handles (); return 0; } telepathy-glib-0.24.2/tests/dbus/room-list.c0000644000175000017500000002026512652510705015632 00000000000000/* Tests of TpTextChannel * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/util.h" #include "tests/lib/simple-channel-dispatcher.h" #define SERVER "TestServer" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsSimpleChannelDispatcher *cd_service; /* Client side objects */ TpAccount *account; TpConnection *connection; TpRoomList *room_list; GPtrArray *rooms; /* reffed TpRoomInfo */ GError *error /* initialized where needed */; gint wait; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" static void new_async_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; test->room_list = tp_room_list_new_finish (result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void create_room_list (Test *test, const char *server) { tp_clear_object (&test->room_list); tp_room_list_new_async (test->account, server, new_async_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); } static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; test->rooms = g_ptr_array_new_with_free_func (g_object_unref); test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Claim CD bus-name */ tp_dbus_daemon_request_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create and register CD */ test->cd_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, "connection", test->base_connection, NULL); tp_dbus_daemon_register_object (test->dbus, TP_CHANNEL_DISPATCHER_OBJECT_PATH, test->cd_service); create_room_list (test, SERVER); g_assert_no_error (test->error); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_dbus_daemon_release_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, &test->error); g_assert_no_error (test->error); tp_clear_object (&test->cd_service); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_tests_connection_assert_disconnect_succeeds (test->connection); tp_clear_object (&test->account); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_object (&test->room_list); g_ptr_array_unref (test->rooms); } static void test_creation (Test *test, gconstpointer data G_GNUC_UNUSED) { g_assert (TP_IS_ROOM_LIST (test->room_list)); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { gchar *server; gboolean listing; g_object_get (test->room_list, "server", &server, "listing", &listing, NULL); g_assert_cmpstr (server, ==, SERVER); g_assert_cmpstr (tp_room_list_get_server (test->room_list), ==, SERVER); g_assert (!listing); g_assert (!tp_room_list_is_listing (test->room_list)); /* Create new one without server */ tp_clear_object (&test->room_list); create_room_list (test, NULL); g_assert_no_error (test->error); g_assert_cmpstr (tp_room_list_get_server (test->room_list), ==, NULL); } static void notify_cb (GObject *object, GParamSpec *spec, Test *test) { test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void got_room_cb (TpRoomList *channel, TpRoomInfo *room, Test *test) { g_ptr_array_add (test->rooms, g_object_ref (room)); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_listing (Test *test, gconstpointer data G_GNUC_UNUSED) { TpRoomInfo *room; gboolean known; g_assert (!tp_room_list_is_listing (test->room_list)); g_signal_connect (test->room_list, "notify::listing", G_CALLBACK (notify_cb), test); g_signal_connect (test->room_list, "got-room", G_CALLBACK (got_room_cb), test); tp_room_list_start (test->room_list); test->wait = 4; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_room_list_is_listing (test->room_list)); g_assert_cmpuint (test->rooms->len, ==, 3); room = g_ptr_array_index (test->rooms, 0); g_assert (TP_IS_ROOM_INFO (room)); g_assert_cmpuint (tp_room_info_get_handle (room), ==, 0); g_assert_cmpstr (tp_room_info_get_channel_type (room), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpstr (tp_room_info_get_handle_name (room), ==, "the handle name"); g_assert_cmpstr (tp_room_info_get_name (room), ==, "the name"); g_assert_cmpstr (tp_room_info_get_description (room), ==, "the description"); g_assert_cmpstr (tp_room_info_get_subject (room), ==, "the subject"); g_assert_cmpuint (tp_room_info_get_members_count (room, &known), ==, 10); g_assert (known); g_assert (tp_room_info_get_requires_password (room, &known)); g_assert (known); g_assert (tp_room_info_get_invite_only (room, &known)); g_assert (known); g_assert_cmpstr (tp_room_info_get_room_id (room), ==, "the room id"); g_assert_cmpstr (tp_room_info_get_server (room), ==, "the server"); } static void room_list_failed_cb (TpRoomList *room_list, GError *error, Test *test) { g_clear_error (&test->error); test->error = g_error_copy (error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_list_room_fails (Test *test, gconstpointer data G_GNUC_UNUSED) { gulong id; /* Use magic server to tell to the channel to fail ListRooms() */ tp_clear_object (&test->room_list); create_room_list (test, "ListRoomsFail"); id = g_signal_connect (test->room_list, "failed", G_CALLBACK (room_list_failed_cb), test); tp_room_list_start (test->room_list); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_SERVICE_CONFUSED); /* We don't want the 'failed' cb be called when disconnecting the * connection */ g_signal_handler_disconnect (test->room_list, id); } static void test_invalidated (Test *test, gconstpointer data G_GNUC_UNUSED) { const gchar *path; TpChannel *chan; gulong id; id = g_signal_connect (test->room_list, "failed", G_CALLBACK (room_list_failed_cb), test); /* Create a proxy on the room list channel to close it */ path = tp_tests_simple_connection_ensure_room_list_chan ( TP_TESTS_SIMPLE_CONNECTION (test->base_connection), SERVER, NULL); chan = tp_channel_new (test->connection, path, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, TP_HANDLE_TYPE_NONE, 0, &test->error); g_assert_no_error (test->error); tp_channel_close_async (chan, NULL, NULL); g_object_unref (chan); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED); g_signal_handler_disconnect (test->room_list, id); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/room-list-channel/creation", Test, NULL, setup, test_creation, teardown); g_test_add ("/room-list-channel/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/room-list-channel/listing", Test, NULL, setup, test_listing, teardown); g_test_add ("/room-list-channel/list-rooms-fail", Test, NULL, setup, test_list_room_fails, teardown); g_test_add ("/room-list-channel/invalidated", Test, NULL, setup, test_invalidated, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/contact-list-client.c0000644000175000017500000003772114004031760017562 00000000000000/* Tests of TpTextChannel * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "examples/cm/contactlist/conn.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpHandleRepoIface *contact_repo; /* Client side objects */ TpConnection *connection; TpTextChannel *channel; TpTextChannel *sms_channel; GPtrArray *blocked_added; GPtrArray *blocked_removed; TpContact *contact; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { gchar *conn_name, *conn_path; GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Create (service and client sides) connection objects */ test->base_connection = tp_tests_object_new_static_class ( EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, "account", "me@test.com", "simulation-delay", 0, "protocol", "test", NULL); g_assert (tp_base_connection_register (test->base_connection, "example", &conn_name, &conn_path, &test->error)); g_assert_no_error (test->error); test->connection = tp_connection_new (test->dbus, conn_name, conn_path, &test->error); g_assert_no_error (test->error); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); /* Connect the connection */ tp_cli_connection_call_connect (test->connection, -1, NULL, NULL, NULL, NULL); tp_tests_proxy_run_until_prepared (test->connection, conn_features); g_free (conn_name); g_free (conn_path); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); tp_clear_pointer (&test->blocked_added, g_ptr_array_unref); tp_clear_pointer (&test->blocked_removed, g_ptr_array_unref); g_clear_object (&test->contact); } static void block_contacts_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_connection_block_contacts_finish (TP_CONNECTION (source), result, &test->error); g_assert_no_error (test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void unblock_contacts_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_connection_unblock_contacts_finish (TP_CONNECTION (source), result, &test->error); g_assert_no_error (test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void contact_block_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_contact_block_finish (TP_CONTACT (source), result, &test->error); g_assert_no_error (test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void contact_unblock_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_contact_unblock_finish (TP_CONTACT (source), result, &test->error); g_assert_no_error (test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static TpContact * create_contact (Test *test, const gchar *id) { TpHandle handle; TpContact *contact; handle = tp_handle_ensure (test->contact_repo, id, NULL, &test->error); g_assert_no_error (test->error); contact = tp_connection_dup_contact_if_possible (test->connection, handle, id); g_assert (contact != NULL); return contact; } static void test_block_unblock (Test *test, gconstpointer data G_GNUC_UNUSED) { TpContact *alice, *bob; GPtrArray *arr; alice = create_contact (test, "alice"); bob = create_contact (test, "bob"); arr = g_ptr_array_sized_new (2); g_ptr_array_add (arr, alice); g_ptr_array_add (arr, bob); /* Block contacts */ tp_connection_block_contacts_async (test->connection, arr->len, (TpContact * const *) arr->pdata, FALSE, block_contacts_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Unblock contacts */ tp_connection_unblock_contacts_async (test->connection, arr->len, (TpContact * const *) arr->pdata, unblock_contacts_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_object_unref (alice); g_object_unref (bob); g_ptr_array_unref (arr); } static void proxy_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_proxy_prepare_finish (source, result, &test->error); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_can_report_abusive (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CONNECTION_FEATURE_CONTACT_BLOCKING, 0 }; gboolean abuse; /* Feature is not prepared yet */ g_object_get (test->connection, "can-report-abusive", &abuse, NULL); g_assert (!abuse); g_assert (!tp_connection_can_report_abusive (test->connection)); tp_proxy_prepare_async (test->connection, features, proxy_prepare_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->connection, TP_CONNECTION_FEATURE_CONTACT_BLOCKING)); g_object_get (test->connection, "can-report-abusive", &abuse, NULL); g_assert (abuse); g_assert (tp_connection_can_report_abusive (test->connection)); } static void blocked_contacts_changed_cb (TpConnection *conn, GPtrArray *added, GPtrArray *removed, Test *test) { tp_clear_pointer (&test->blocked_added, g_ptr_array_unref); tp_clear_pointer (&test->blocked_removed, g_ptr_array_unref); test->blocked_added = g_ptr_array_ref (added); test->blocked_removed = g_ptr_array_ref (removed); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_blocked_contacts (Test *test, gconstpointer data G_GNUC_UNUSED) { GQuark features[] = { TP_CONNECTION_FEATURE_CONTACT_BLOCKING, 0 }; GPtrArray *blocked; TpContact *alice, *bill, *guillaume, *sjoerd, *steve; gboolean use_contact_api = GPOINTER_TO_UINT (data); sjoerd = create_contact (test, "sjoerd@example.com"); steve = create_contact (test, "steve@example.com"); /* Feature is not prepared yet */ g_object_get (test->connection, "blocked-contacts", &blocked, NULL); g_assert_cmpuint (blocked->len, == , 0); g_ptr_array_unref (blocked); blocked = tp_connection_get_blocked_contacts (test->connection); g_assert_cmpuint (blocked->len, == , 0); /* Prepare the feature */ tp_proxy_prepare_async (test->connection, features, proxy_prepare_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* 2 contacts are already blocked in the CM */ g_object_get (test->connection, "blocked-contacts", &blocked, NULL); g_assert_cmpuint (blocked->len, == , 2); g_ptr_array_unref (blocked); blocked = tp_connection_get_blocked_contacts (test->connection); g_assert_cmpuint (blocked->len, == , 2); /* Preparing TP_CONNECTION_FEATURE_CONTACT_BLOCKING gives us * TP_CONTACT_FEATURE_CONTACT_BLOCKING for free. Test that this works with * existing and newly created TpContact. */ bill = create_contact (test, "bill@example.com"); guillaume = create_contact (test, "guillaume@example.com"); g_assert (tp_contact_has_feature (sjoerd, TP_CONTACT_FEATURE_CONTACT_BLOCKING)); g_assert (!tp_contact_is_blocked (sjoerd)); g_assert (tp_contact_has_feature (steve, TP_CONTACT_FEATURE_CONTACT_BLOCKING)); g_assert (tp_contact_is_blocked (steve)); g_assert (tp_contact_has_feature (bill, TP_CONTACT_FEATURE_CONTACT_BLOCKING)); g_assert (tp_contact_is_blocked (bill)); g_assert (tp_contact_has_feature (guillaume, TP_CONTACT_FEATURE_CONTACT_BLOCKING)); g_assert (!tp_contact_is_blocked (guillaume)); g_object_unref (steve); g_object_unref (sjoerd); g_object_unref (bill); g_object_unref (guillaume); /* Let's block another contact */ alice = create_contact (test, "alice"); g_signal_connect (test->connection, "blocked-contacts-changed", G_CALLBACK (blocked_contacts_changed_cb), test); if (use_contact_api) { tp_contact_block_async (alice, FALSE, contact_block_cb, test); } else { tp_connection_block_contacts_async (test->connection, 1, &alice, FALSE, block_contacts_cb, test); } g_object_unref (alice); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (test->blocked_added->len, ==, 1); g_assert_cmpuint (test->blocked_removed->len, ==, 0); alice = g_ptr_array_index (test->blocked_added, 0); g_assert (TP_IS_CONTACT (alice)); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); blocked = tp_connection_get_blocked_contacts (test->connection); g_assert_cmpuint (blocked->len, == , 3); /* Cool, now unblock the poor Alice */ if (use_contact_api) { tp_contact_unblock_async (alice, contact_unblock_cb, test); } else { tp_connection_unblock_contacts_async (test->connection, 1, &alice, unblock_contacts_cb, test); } test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert_cmpuint (test->blocked_added->len, ==, 0); g_assert_cmpuint (test->blocked_removed->len, ==, 1); alice = g_ptr_array_index (test->blocked_removed, 0); g_assert (TP_IS_CONTACT (alice)); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); blocked = tp_connection_get_blocked_contacts (test->connection); g_assert_cmpuint (blocked->len, == , 2); } static void get_contacts_by_id_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *requested_ids, GHashTable *failed_id_errors, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_object (&test->contact); if (error != NULL) { test->error = g_error_copy (error); } else { test->contact = g_object_ref (contacts[0]); } test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void contact_list_state_change_cb (GObject *object, GParamSpec *pspec, gpointer user_data) { TpConnection *conn = (TpConnection *) object; Test *test = user_data; if (tp_connection_get_contact_list_state (conn) != TP_CONTACT_LIST_STATE_SUCCESS) return; test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void property_change_cb (GObject *object, GParamSpec *pspec, gpointer user_data) { Test *test = user_data; test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_is_blocked (Test *test, gconstpointer data G_GNUC_UNUSED) { const gchar *id = "bill@example.com"; TpContactFeature features[] = { TP_CONTACT_FEATURE_CONTACT_BLOCKING }; GQuark conn_features[] = { TP_CONNECTION_FEATURE_CONTACT_LIST, 0 }; tp_proxy_prepare_async (test->connection, conn_features, proxy_prepare_cb, test); test->wait = 1; /* We have to wait that the ContactList has been fetched by the CM */ if (tp_connection_get_contact_list_state (test->connection) != TP_CONTACT_LIST_STATE_SUCCESS) { g_signal_connect (test->connection, "notify::contact-list-state", G_CALLBACK (contact_list_state_change_cb), test); test->wait++; } g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Bill is already blocked in the CM */ tp_connection_get_contacts_by_id (test->connection, 1, &id, G_N_ELEMENTS (features), features, get_contacts_by_id_cb, test, NULL, NULL); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (TP_IS_CONTACT (test->contact)); g_assert (tp_contact_has_feature (test->contact, TP_CONTACT_FEATURE_CONTACT_BLOCKING)); g_assert (tp_contact_is_blocked (test->contact)); /* Unblock Bill */ g_signal_connect (test->contact, "notify::is-blocked", G_CALLBACK (property_change_cb), test); tp_contact_unblock_async (test->contact, contact_unblock_cb, test); test->wait = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (!tp_contact_is_blocked (test->contact)); } static void test_contact_list_properties (Test *test, gconstpointer data) { gboolean props_only = GPOINTER_TO_UINT (data); GQuark conn_features[] = { 0, 0 }; GPtrArray *contacts; if (props_only) conn_features[0] = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES; else conn_features[0] = TP_CONNECTION_FEATURE_CONTACT_LIST; /* Feature isn't prepared yet */ g_assert (!tp_proxy_is_prepared (test->connection, TP_CONNECTION_FEATURE_CONTACT_LIST)); g_assert (!tp_proxy_is_prepared (test->connection, TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES)); g_assert_cmpuint (tp_connection_get_contact_list_state (test->connection), ==, TP_CONTACT_LIST_STATE_NONE); g_assert (!tp_connection_get_contact_list_persists (test->connection)); g_assert (!tp_connection_get_can_change_contact_list (test->connection)); g_assert (!tp_connection_get_request_uses_message (test->connection)); tp_proxy_prepare_async (test->connection, conn_features, proxy_prepare_cb, test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_assert (tp_proxy_is_prepared (test->connection, TP_CONNECTION_FEATURE_CONTACT_LIST) == !props_only); g_assert (tp_proxy_is_prepared (test->connection, TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES)); g_assert (tp_connection_get_contact_list_persists (test->connection)); g_assert (tp_connection_get_can_change_contact_list (test->connection)); g_assert (tp_connection_get_request_uses_message (test->connection)); contacts = tp_connection_dup_contact_list (test->connection); if (props_only) { /* Contacts haven't be fetched */ g_assert_cmpuint (contacts->len, ==, 0); } else { g_assert_cmpuint (contacts->len, >, 0); } g_ptr_array_unref (contacts); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/contact-list-client/blocking/block-unblock", Test, NULL, setup, test_block_unblock, teardown); g_test_add ("/contact-list-client/blocking/can-report-abusive", Test, NULL, setup, test_can_report_abusive, teardown); g_test_add ("/contact-list-client/blocking/connection/blocked-contacts", Test, GUINT_TO_POINTER (FALSE), setup, test_blocked_contacts, teardown); g_test_add ("/contact-list-client/blocking/contact/blocked-contacts", Test, GUINT_TO_POINTER (TRUE), setup, test_blocked_contacts, teardown); g_test_add ("/contact-list-client/blocking/is-blocked", Test, NULL, setup, test_is_blocked, teardown); g_test_add ("/contact-list-client/contact-list/properties", Test, GUINT_TO_POINTER (FALSE), setup, test_contact_list_properties, teardown); g_test_add ("/contact-list-client/contact-list/properties/props-only", Test, GUINT_TO_POINTER (TRUE), setup, test_contact_list_properties, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/cm-message.c0000644000175000017500000002556412652510705015735 00000000000000#include "config.h" #include #include #include "telepathy-glib/cm-message-internal.h" #include #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" typedef struct { TpBaseConnection *base_connection; TpHandleRepoIface *contact_repo; TpConnection *connection; GError *error /* initialized where needed */; } Test; static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); test->contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (test->contact_repo != NULL); } static void teardown (Test *test, gconstpointer data) { tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); } static void test_new_from_parts (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *parts; TpHandle sender; TpMessage *msg; const GHashTable *part; GVariant *part_vardict; gboolean valid; const gchar *s; parts = g_ptr_array_new_full (2, (GDestroyNotify) g_hash_table_unref); sender = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); g_ptr_array_add (parts, tp_asv_new ( "message-type", G_TYPE_UINT, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, "message-sender", G_TYPE_UINT, sender, "message-token", G_TYPE_STRING, "token", "message-sent", G_TYPE_INT64, G_GINT64_CONSTANT (42), "message-received", G_TYPE_INT64, G_GINT64_CONSTANT (666), "scrollback", G_TYPE_BOOLEAN, TRUE, "pending-message-id", G_TYPE_UINT, 666, NULL)); g_ptr_array_add (parts, tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, "Badger", NULL)); msg = _tp_cm_message_new_from_parts (test->base_connection, parts); g_ptr_array_unref (parts); g_assert (TP_IS_CM_MESSAGE (msg)); g_assert_cmpuint (tp_message_count_parts (msg), ==, 2); part = tp_message_peek (msg, 0); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-sender", NULL), ==, sender); g_assert_cmpstr (tp_asv_get_string (part, "message-sender-id"), ==, "bob"); g_assert_cmpstr (tp_asv_get_string (part, "message-token"), ==, "token"); part = tp_message_peek (msg, 1); g_assert_cmpstr (tp_asv_get_string (part, "content-type"), ==, "text/plain"); g_assert_cmpstr (tp_asv_get_string (part, "content"), ==, "Badger"); part_vardict = tp_message_dup_part (msg, 1); g_assert_cmpstr (g_variant_get_type_string (part_vardict), ==, "a{sv}"); valid = g_variant_lookup (part_vardict, "content-type", "&s", &s); g_assert (valid); g_assert_cmpstr (s, ==, "text/plain"); valid = g_variant_lookup (part_vardict, "content", "&s", &s); g_assert (valid); g_assert_cmpstr (s, ==, "Badger"); g_variant_unref (part_vardict); g_assert_cmpuint (tp_message_get_message_type (msg), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE); g_assert_cmpuint (tp_cm_message_get_sender (msg), ==, sender); g_assert_cmpstr (tp_message_get_token (msg), ==, "token"); g_assert_cmpint ((gint) tp_message_get_sent_timestamp (msg), ==, 42); g_assert_cmpint ((gint) tp_message_get_received_timestamp (msg), ==, 666); g_assert_cmpint (tp_message_is_scrollback (msg), ==, TRUE); g_assert_cmpint (tp_message_is_rescued (msg), ==, FALSE); g_assert_cmpstr (tp_message_get_supersedes (msg), ==, NULL); g_assert_cmpstr (tp_message_get_specific_to_interface (msg), ==, NULL); g_assert_cmpint (tp_message_is_delivery_report (msg), ==, FALSE); g_assert_cmpuint (tp_message_get_pending_message_id (msg, &valid), ==, 666); g_assert (valid); g_object_unref (msg); } static void test_new_text (Test *test, gconstpointer data G_GNUC_UNUSED) { TpHandle sender; TpMessage *msg; const GHashTable *part; sender = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); msg = tp_cm_message_new_text (test->base_connection, sender, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "builds some stuff"); g_assert (TP_IS_CM_MESSAGE (msg)); g_assert_cmpuint (tp_message_count_parts (msg), ==, 2); part = tp_message_peek (msg, 0); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-sender", NULL), ==, sender); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-type", NULL), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); g_assert_cmpstr (tp_asv_get_string (part, "message-sender-id"), ==, "bob"); g_assert_cmpstr (tp_asv_get_string (part, "message-token"), ==, NULL); part = tp_message_peek (msg, 1); g_assert_cmpstr (tp_asv_get_string (part, "content-type"), ==, "text/plain"); g_assert_cmpstr (tp_asv_get_string (part, "content"), ==, "builds some stuff"); g_assert_cmpuint (tp_message_get_message_type (msg), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); g_assert_cmpuint (tp_cm_message_get_sender (msg), ==, sender); g_assert_cmpstr (tp_message_get_token (msg), ==, NULL); g_assert_cmpint ((gint) tp_message_get_sent_timestamp (msg), ==, 0); g_assert_cmpint ((gint) tp_message_get_received_timestamp (msg), ==, 0); g_assert_cmpint (tp_message_is_scrollback (msg), ==, FALSE); g_assert_cmpint (tp_message_is_rescued (msg), ==, FALSE); g_assert_cmpstr (tp_message_get_supersedes (msg), ==, NULL); g_assert_cmpstr (tp_message_get_specific_to_interface (msg), ==, NULL); g_assert_cmpint (tp_message_is_delivery_report (msg), ==, FALSE); g_object_unref (msg); } static void test_set_message (Test *test, gconstpointer data G_GNUC_UNUSED) { TpHandle sender; TpMessage *msg, *echo; const GHashTable *part; GPtrArray *echo_parts; sender = tp_handle_ensure (test->contact_repo, "escher@tuxedo.cat", NULL, &test->error); g_assert_no_error (test->error); msg = tp_cm_message_new (test->base_connection, 1); echo = tp_cm_message_new_text (test->base_connection, sender, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "meows"); g_assert_cmpuint (tp_message_count_parts (echo), ==, 2); tp_message_set_uint32 (msg, 0, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); tp_message_set_uint32 (msg, 0, "delivery-status", TP_DELIVERY_STATUS_DELIVERED); tp_cm_message_set_message (msg, 0, "delivery-echo", echo); /* destroy the echo */ g_object_unref (echo); part = tp_message_peek (msg, 0); g_assert (G_VALUE_HOLDS (tp_asv_lookup (part, "delivery-echo"), TP_ARRAY_TYPE_MESSAGE_PART_LIST)); echo_parts = tp_asv_get_boxed (part, "delivery-echo", TP_ARRAY_TYPE_MESSAGE_PART_LIST); g_assert (echo_parts != NULL); g_assert_cmpuint (echo_parts->len, ==, 2); part = g_ptr_array_index (echo_parts, 0); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-type", NULL), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); part = g_ptr_array_index (echo_parts, 1); g_assert_cmpstr (tp_asv_get_string (part, "content"), ==, "meows"); g_object_unref (msg); } static void test_set_message_2 (Test *test, gconstpointer data G_GNUC_UNUSED) { TpHandle sender; TpMessage *msg, *echo; const GHashTable *part; GPtrArray *echo_parts; sender = tp_handle_ensure (test->contact_repo, "escher@tuxedo.cat", NULL, &test->error); g_assert_no_error (test->error); msg = tp_cm_message_new (test->base_connection, 1); echo = tp_cm_message_new_text (test->base_connection, sender, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "meows"); tp_message_set_uint32 (msg, 0, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); tp_message_set_uint32 (msg, 0, "delivery-status", TP_DELIVERY_STATUS_DELIVERED); tp_cm_message_set_message (msg, 0, "delivery-echo", echo); /* change the echo */ tp_message_set_string (echo, 1, "content", "yawns"); part = tp_message_peek (msg, 0); g_assert (G_VALUE_HOLDS (tp_asv_lookup (part, "delivery-echo"), TP_ARRAY_TYPE_MESSAGE_PART_LIST)); echo_parts = tp_asv_get_boxed (part, "delivery-echo", TP_ARRAY_TYPE_MESSAGE_PART_LIST); g_assert (echo_parts != NULL); part = g_ptr_array_index (echo_parts, 0); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-type", NULL), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); part = g_ptr_array_index (echo_parts, 1); g_assert_cmpstr (tp_asv_get_string (part, "content"), ==, "meows"); g_object_unref (echo); g_object_unref (msg); } static void _test_take_message_echo_destroyed (gpointer data, GObject *obj) { gboolean *destroyed = data; *destroyed = TRUE; } static void test_take_message (Test *test, gconstpointer data G_GNUC_UNUSED) { TpHandle sender; TpMessage *msg, *echo; const GHashTable *part; GPtrArray *echo_parts; gboolean destroyed = FALSE; sender = tp_handle_ensure (test->contact_repo, "escher@tuxedo.cat", NULL, &test->error); g_assert_no_error (test->error); msg = tp_cm_message_new (test->base_connection, 1); echo = tp_cm_message_new_text (test->base_connection, sender, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "meows"); /* add a weak ref so we know echo was destroyed */ g_object_weak_ref (G_OBJECT (echo), _test_take_message_echo_destroyed, &destroyed); tp_message_set_uint32 (msg, 0, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); tp_message_set_variant (msg, 0, "delivery-status", g_variant_new_uint32 (TP_DELIVERY_STATUS_DELIVERED)); tp_cm_message_take_message (msg, 0, "delivery-echo", echo); /* ensure the message was destroyed */ g_assert (destroyed == TRUE); part = tp_message_peek (msg, 0); g_assert (G_VALUE_HOLDS (tp_asv_lookup (part, "delivery-echo"), TP_ARRAY_TYPE_MESSAGE_PART_LIST)); echo_parts = tp_asv_get_boxed (part, "delivery-echo", TP_ARRAY_TYPE_MESSAGE_PART_LIST); g_assert (echo_parts != NULL); part = g_ptr_array_index (echo_parts, 0); g_assert_cmpuint (tp_asv_get_uint32 (part, "message-type", NULL), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); part = g_ptr_array_index (echo_parts, 1); g_assert_cmpstr (tp_asv_get_string (part, "content"), ==, "meows"); g_object_unref (msg); } int main (int argc, char **argv) { #define TEST_PREFIX "/cm-message/" g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add (TEST_PREFIX "new_from_parts", Test, NULL, setup, test_new_from_parts, teardown); g_test_add (TEST_PREFIX "new_text", Test, NULL, setup, test_new_text, teardown); g_test_add (TEST_PREFIX "set_message", Test, NULL, setup, test_set_message, teardown); g_test_add (TEST_PREFIX "set_message_2", Test, NULL, setup, test_set_message_2, teardown); g_test_add (TEST_PREFIX "take_message", Test, NULL, setup, test_take_message, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/finalized-in-invalidated-handler.c0000644000175000017500000001033212652510705022145 00000000000000/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=15644 * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" #include "tests/lib/util.h" static GMainLoop *mainloop; gboolean shutdown_finished = FALSE; gboolean invalidated = FALSE; static void on_invalidated (TpChannel *chan, guint domain, gint code, gchar *message, gpointer user_data) { TpChannel **client = user_data; MYASSERT (domain == TP_ERROR, ": domain \"%s\"", g_quark_to_string (domain)); MYASSERT (code == TP_ERROR_CANCELLED, ": code %u", code); MYASSERT (*client == chan, "%p vs %p", *client, chan); g_object_unref (*client); *client = NULL; invalidated = TRUE; if (shutdown_finished) g_main_loop_quit (mainloop); } static gboolean disconnect (gpointer data) { tp_tests_simple_connection_inject_disconnect (data); return FALSE; } static void on_shutdown_finished (TpBaseConnection *base_conn, gpointer user_data) { shutdown_finished = TRUE; if (invalidated) g_main_loop_quit (mainloop); } int main (int argc, char **argv) { TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; TpHandleRepoIface *contact_repo; TpTestsTextChannelNull *service_chan; TpDBusDaemon *dbus; TpConnection *conn; TpChannel *chan; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; TpHandle handle; tp_tests_abort_after (10); tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); g_signal_connect (service_conn, "shutdown-finished", G_CALLBACK (on_shutdown_finished), NULL); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* Paste on a channel */ contact_repo = tp_base_connection_get_handles (service_conn_as_base, TP_HANDLE_TYPE_CONTACT); MYASSERT (contact_repo != NULL, ""); handle = tp_handle_ensure (contact_repo, "them@example.org", NULL, &error); g_assert_no_error (error); chan_path = g_strdup_printf ("%s/Channel", conn_path); service_chan = TP_TESTS_TEXT_CHANNEL_NULL (tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", service_conn, "object-path", chan_path, "handle", handle, NULL)); chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT, handle, &error); g_assert_no_error (error); tp_channel_run_until_ready (chan, &error, NULL); g_assert_no_error (error); g_signal_connect (chan, "invalidated", G_CALLBACK (on_invalidated), &chan); g_idle_add (disconnect, service_conn); g_main_loop_run (mainloop); g_message ("Cleaning up"); tp_handle_unref (contact_repo, handle); g_object_unref (conn); g_assert (chan == NULL); g_object_unref (service_chan); service_conn_as_base = NULL; g_object_unref (service_conn); g_object_unref (dbus); g_main_loop_unref (mainloop); g_free (name); g_free (conn_path); g_free (chan_path); return 0; } telepathy-glib-0.24.2/tests/dbus/account-channel-request.c0000644000175000017500000013604512652510705020441 00000000000000/* Tests of TpAccount channel request API * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/contacts-conn.h" #include "tests/lib/textchan-null.h" #include "tests/lib/simple-channel-dispatcher.h" #include "tests/lib/simple-channel-request.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseConnection *base_connection; TpTestsSimpleAccount *account_service; TpTestsSimpleChannelDispatcher *cd_service; /* Client side objects */ TpConnection *connection; TpAccount *account; TpChannel *channel; GCancellable *cancellable; gint count; GError *error /* initialized where needed */; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" static void setup (Test *test, gconstpointer data) { test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->cancellable = g_cancellable_new (); test->error = NULL; /* Claim AccountManager bus-name (needed as we're going to export an Account * object). */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create service-side Account object */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); /* Claim CD bus-name */ tp_dbus_daemon_request_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create client-side Account object */ test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_CONTACTS_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create and register CD */ test->cd_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_DISPATCHER, "connection", test->base_connection, NULL); tp_dbus_daemon_register_object (test->dbus, TP_CHANNEL_DISPATCHER_OBJECT_PATH, test->cd_service); } static void teardown_channel_invalidated_cb (TpChannel *self, guint domain, gint code, gchar *message, Test *test) { g_main_loop_quit (test->mainloop); } static void teardown_run_close_channel (Test *test, TpChannel *channel) { if (channel != NULL && tp_proxy_get_invalidated (channel) == NULL) { g_signal_connect (channel, "invalidated", G_CALLBACK (teardown_channel_invalidated_cb), test); tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL); g_main_loop_run (test->mainloop); } } static void teardown (Test *test, gconstpointer data) { teardown_run_close_channel (test, test->channel); g_clear_error (&test->error); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_object_unref (test->account_service); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); tp_dbus_daemon_release_name (test->dbus, TP_CHANNEL_DISPATCHER_BUS_NAME, &test->error); g_assert_no_error (test->error); tp_clear_object (&test->cd_service); tp_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; tp_clear_object (&test->account); tp_clear_object (&test->channel); tp_tests_connection_assert_disconnect_succeeds (test->connection); tp_clear_object (&test->connection); tp_clear_object (&test->base_connection); tp_clear_object (&test->cancellable); } /* Request and handle tests */ static void create_and_handle_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; TpHandleChannelsContext *context = NULL; TpChannel *channel; channel = tp_account_channel_request_create_and_handle_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &context, &test->error); if (channel == NULL) goto out; g_assert (TP_IS_CHANNEL (channel)); g_assert (test->channel == NULL || test->channel == channel); test->channel = channel; g_assert (TP_IS_HANDLE_CHANNELS_CONTEXT (context)); g_object_unref (context); out: g_main_loop_quit (test->mainloop); } static GHashTable * create_request (void) { return tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "alice", NULL); } static GVariant * floating_request (void) { return g_variant_new_parsed ( "{ %s: <%s>, %s: <%u>, %s: <%s> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, "alice"); } static void test_handle_create_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; TpChannelRequest *chan_req; req = tp_account_channel_request_new_text (test->account, 0); tp_account_channel_request_set_target_id (req, TP_HANDLE_TYPE_CONTACT, "alice"); tp_account_channel_request_set_sms_channel (req, TRUE); /* We didn't start requesting the channel yet, so there is no * ChannelRequest */ chan_req = tp_account_channel_request_get_channel_request (req); g_assert (chan_req == NULL); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* The ChannelRequest has been defined */ g_object_get (req, "channel-request", &chan_req, NULL); g_assert (TP_IS_CHANNEL_REQUEST (chan_req)); g_assert (tp_account_channel_request_get_channel_request (req) == chan_req); g_object_unref (chan_req); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4); g_assert (tp_asv_get_boolean (test->cd_service->last_request, TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL)); } /* ChannelDispatcher.CreateChannel() call fails */ static void test_handle_create_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_audio_call (test->account, 666); tp_account_channel_request_set_target_id (req, TP_HANDLE_TYPE_CONTACT, "alice"); tp_account_channel_request_set_request_property (req, "com.example.Int", g_variant_new_int32 (17)); tp_account_channel_request_set_request_property (req, "com.example.String", g_variant_new_string ("ferret")); /* Ask the CD to fail */ tp_account_channel_request_set_request_property (req, "CreateChannelFail", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_CALL); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL), ==, TRUE); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, "com.example.String"), ==, "ferret"); g_assert_cmpuint (tp_asv_get_int32 (test->cd_service->last_request, "com.example.Int", NULL), ==, 17); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "CreateChannelFail", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 7); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 666); } /* ChannelRequest.Proceed() call fails */ static void test_handle_proceed_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_audio_video_call (test->account, 0); /* Ask the CD to fail */ tp_account_channel_request_set_request_property (req, "ProceedFail", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_CALL); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL), ==, TRUE); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL), ==, TRUE); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "ProceedFail", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 5); } /* ChannelRequest fire the 'Failed' signal */ static void test_handle_cr_failed (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_file_transfer (test->account, "warez.rar", "application/x-rar", G_GUINT64_CONSTANT (1234567890123), 0); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME), ==, "warez.rar"); g_assert_cmpuint (tp_asv_get_uint64 (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, NULL), ==, G_GUINT64_CONSTANT (1234567890123)); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE), ==, "application/x-rar"); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 6); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); } static void test_ft_props (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_file_transfer (test->account, "warez.rar", "application/x-rar", G_GUINT64_CONSTANT (1234567890123), 0); tp_account_channel_request_set_file_transfer_description (req, "A collection of l33t warez"); tp_account_channel_request_set_file_transfer_initial_offset (req, 1024 * 1024); tp_account_channel_request_set_file_transfer_timestamp (req, 1111222233); tp_account_channel_request_set_file_transfer_uri (req, "file:///home/Downloads/warez.rar"); tp_account_channel_request_set_file_transfer_hash (req, TP_FILE_HASH_TYPE_SHA256, "This is not a hash"); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME), ==, "warez.rar"); g_assert_cmpuint (tp_asv_get_uint64 (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, NULL), ==, G_GUINT64_CONSTANT (1234567890123)); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE), ==, "application/x-rar"); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION), ==, "A collection of l33t warez"); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI), ==, "file:///home/Downloads/warez.rar"); g_assert_cmpuint (tp_asv_get_uint64 (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, NULL), ==, 1024 * 1024); g_assert_cmpuint (tp_asv_get_uint64 (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, NULL), ==, 1111222233); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE, NULL), ==, TP_FILE_HASH_TYPE_SHA256); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH), ==, "This is not a hash"); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 12); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); } static void test_stream_tube_props (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_stream_tube (test->account, "daap", 0); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE), ==, "daap"); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); } static void test_dbus_tube_props (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_dbus_tube (test->account, "com.example.ServiceName", 0); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME), ==, "com.example.ServiceName"); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); } static void ensure_and_handle_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; TpChannel *channel; channel = tp_account_channel_request_ensure_and_handle_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, NULL, &test->error); if (channel == NULL) goto out; g_assert (TP_IS_CHANNEL (channel)); g_assert (test->channel == NULL || test->channel == channel); test->channel = channel; out: test->count--; if (test->count <= 0) g_main_loop_quit (test->mainloop); } static void test_handle_ensure_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; TpContact *alice; GHashTable *asv; GVariant *vardict; alice = tp_tests_connection_run_until_contact_by_id (test->connection, "alice", 0, NULL); req = tp_account_channel_request_new_text (test->account, 0); tp_account_channel_request_set_target_contact (req, alice); asv = (GHashTable *) tp_account_channel_request_get_request (req); vardict = tp_account_channel_request_dup_request (req); g_assert_cmpstr (tp_asv_get_string (asv, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_assert_cmpstr (tp_vardict_get_string (vardict, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_variant_unref (vardict); g_object_get (req, "request", &asv, "request-vardict", &vardict, NULL); g_assert_cmpstr (tp_asv_get_string (asv, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_assert_cmpstr (tp_vardict_get_string (vardict, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_hash_table_unref (asv); g_variant_unref (vardict); tp_account_channel_request_ensure_and_handle_channel_async (req, NULL, ensure_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Try again, now it will fail as the channel already exist */ req = tp_account_channel_request_new_text (test->account, 0); tp_account_channel_request_set_target_contact (req, alice); tp_account_channel_request_ensure_and_handle_channel_async (req, NULL, ensure_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_YOURS); g_object_unref (alice); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_ID), ==, "alice"); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 3); } /* Cancel the operation before starting it */ static void test_handle_cancel_before (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); g_cancellable_cancel (test->cancellable); tp_account_channel_request_ensure_and_handle_channel_async (req, test->cancellable, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, G_IO_ERROR, G_IO_ERROR_CANCELLED); } /* Cancel the operation after the channel request has been created */ static void channel_request_created_cb (TpTestsSimpleChannelDispatcher *dispatcher, TpTestsSimpleChannelRequest *request, Test *test) { g_cancellable_cancel (test->cancellable); } static void test_handle_cancel_after_create (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_ensure_and_handle_channel_async (req, test->cancellable, create_and_handle_cb, test); g_signal_connect (test->cd_service, "channel-request-created", G_CALLBACK (channel_request_created_cb), test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_CANCELLED); } /* Test if re-handled is properly fired when a channel is * re-handled */ static void re_handled_cb (TpAccountChannelRequest *req, TpChannel *channel, gint64 timestamp, TpHandleChannelsContext *context, Test *test) { g_assert (TP_IS_CHANNEL (channel)); g_assert_cmpint (timestamp, ==, 666); g_assert (TP_IS_HANDLE_CHANNELS_CONTEXT (context)); test->count--; if (test->count <= 0) g_main_loop_quit (test->mainloop); } static void test_handle_re_handle (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req, *req2; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_ensure_and_handle_channel_async (req, NULL, ensure_and_handle_cb, test); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_signal_connect (req, "re-handled", G_CALLBACK (re_handled_cb), test); /* Ensure the same channel to re-handle it */ req2 = tp_account_channel_request_new_vardict (test->account, floating_request (), 666); tp_account_channel_request_ensure_and_handle_channel_async (req2, NULL, ensure_and_handle_cb, test); /* Wait that the operation finished and the sig has been fired */ test->count = 2; g_main_loop_run (test->mainloop); g_object_unref (req); g_object_unref (req2); } static void create_and_handle_hints_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; TpHandleChannelsContext *context = NULL; GList *reqs; const GHashTable *hints; TpChannelRequest *req; test->channel = tp_account_channel_request_create_and_handle_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &context, &test->error); if (test->channel == NULL) goto out; g_assert (TP_IS_CHANNEL (test->channel)); tp_clear_object (&test->channel); g_assert (TP_IS_HANDLE_CHANNELS_CONTEXT (context)); reqs = tp_handle_channels_context_get_requests (context); g_assert_cmpuint (g_list_length (reqs), ==, 1); req = reqs->data; g_assert (TP_IS_CHANNEL_REQUEST (req)); hints = tp_channel_request_get_hints (req); g_assert_cmpuint (g_hash_table_size ((GHashTable *) hints), ==, 1); g_assert_cmpuint (tp_asv_get_uint32 (hints, "Badger", NULL), ==, 42); g_list_foreach (reqs, (GFunc) g_object_unref, NULL); g_list_free (reqs); g_object_unref (context); out: g_main_loop_quit (test->mainloop); } static GHashTable * create_hints (void) { return tp_asv_new ( "Badger", G_TYPE_UINT, 42, NULL); } static void test_handle_create_success_hints (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; GHashTable *hints; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); hints = create_hints (); tp_account_channel_request_set_hints (req, hints); g_hash_table_unref (hints); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_hints_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void channel_delegated_cb (TpAccountChannelRequest *req, TpChannel *channel, gpointer user_data) { Test *test = user_data; g_assert (TP_IS_ACCOUNT_CHANNEL_REQUEST (req)); g_assert (TP_IS_CHANNEL (channel)); g_assert_cmpstr (tp_proxy_get_object_path (channel), ==, tp_proxy_get_object_path (test->channel)); test->count--; if (test->count <= 0) g_main_loop_quit (test->mainloop); } static void add_channel_to_ptr_array (GPtrArray *arr, TpChannel *channel) { GValueArray *tmp; g_assert (arr != NULL); g_assert (channel != NULL); tmp = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, tp_channel_borrow_immutable_properties ( channel), G_TYPE_INVALID); g_ptr_array_add (arr, tmp); } static void no_return_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_error (&test->error); if (error != NULL) { test->error = g_error_copy (error); goto out; } out: test->count--; if (test->count == 0) g_main_loop_quit (test->mainloop); } #define PREFERRED_HANDLER_NAME TP_CLIENT_BUS_NAME_BASE ".Badger" static void test_handle_delegated (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; GPtrArray *requests, *requests_satisified, *channels; GHashTable *hints, *request_props, *info; TpTestsSimpleChannelRequest *cr; TpBaseClient *base_client; TpClient *client; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); /* Allow other clients to preempt the channel */ tp_account_channel_request_set_delegated_channel_callback (req, channel_delegated_cb, test, NULL); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Another client asks to dispatch the channel to it */ requests = g_ptr_array_new (); hints = tp_asv_new ( "org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler", G_TYPE_BOOLEAN, TRUE, NULL); cr = tp_tests_simple_channel_request_new ("/CR", TP_TESTS_SIMPLE_CONNECTION (test->base_connection), tp_proxy_get_object_path (test->account), TP_USER_ACTION_TIME_CURRENT_TIME, PREFERRED_HANDLER_NAME, requests, hints); requests_satisified = g_ptr_array_sized_new (1); g_ptr_array_add (requests_satisified, "/CR"); request_props = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_hash_table_unref); g_hash_table_insert (request_props, "/CR", tp_tests_simple_channel_request_dup_immutable_props (cr)); info = tp_asv_new ( "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP, request_props, NULL); channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->channel); base_client = _tp_account_channel_request_get_client (req); g_assert (TP_IS_BASE_CLIENT (base_client)); client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", tp_base_client_get_dbus_daemon (base_client), "bus-name", tp_base_client_get_bus_name (base_client), "object-path", tp_base_client_get_object_path (base_client), NULL); tp_proxy_add_interface_by_id (TP_PROXY (client), TP_IFACE_QUARK_CLIENT_HANDLER); tp_cli_client_handler_call_handle_channels (client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, requests_satisified, 0, info, no_return_cb, test, NULL, NULL); test->count = 2; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_ptr_array_unref (requests); g_hash_table_unref (hints); g_object_unref (cr); g_ptr_array_unref (requests_satisified); g_ptr_array_unref (channels); g_hash_table_unref (request_props); g_hash_table_unref (info); g_object_unref (client); } /* Request and forget tests */ static void create_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_account_channel_request_create_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &test->error); g_main_loop_quit (test->mainloop); } static void test_forget_create_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_create_channel_async (req, "Fake", NULL, create_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void ensure_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; tp_account_channel_request_ensure_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &test->error); g_main_loop_quit (test->mainloop); } static void test_forget_ensure_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_ensure_channel_async (req, "Fake", NULL, ensure_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } /* ChannelDispatcher.CreateChannel() call fails */ static void test_forget_create_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CD to fail */ tp_asv_set_boolean (request, "CreateChannelFail", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_channel_async (req, "Fake", NULL, create_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } /* ChannelRequest.Proceed() call fails */ static void test_forget_proceed_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CD to fail */ tp_asv_set_boolean (request, "ProceedFail", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_channel_async (req, "Fake", NULL, create_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } /* ChannelRequest fire the 'Failed' signal */ static void test_forget_cr_failed (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CR to fire the signal */ tp_asv_set_boolean (request, "FireFailed", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_channel_async (req, "Fake", NULL, create_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } /* Cancel the operation before starting it */ static void test_forget_cancel_before (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); g_cancellable_cancel (test->cancellable); tp_account_channel_request_create_channel_async (req, "Fake", test->cancellable, create_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, G_IO_ERROR, G_IO_ERROR_CANCELLED); } static void test_forget_cancel_after_create (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_create_channel_async (req, "Fake", test->cancellable, create_cb, test); g_signal_connect (test->cd_service, "channel-request-created", G_CALLBACK (channel_request_created_cb), test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_CANCELLED); } /* Request and observe tests */ static void create_and_observe_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; test->channel = tp_account_channel_request_create_and_observe_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &test->error); if (test->channel == NULL) goto out; g_assert (TP_IS_CHANNEL (test->channel)); tp_clear_object (&test->channel); out: g_main_loop_quit (test->mainloop); } static void test_observe_create_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", NULL, create_and_observe_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } /* ChannelDispatcher.CreateChannel() call fails */ static void test_observe_create_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CD to fail */ tp_asv_set_boolean (request, "CreateChannelFail", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", NULL, create_and_observe_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } /* ChannelRequest.Proceed() call fails */ static void test_observe_proceed_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CD to fail */ tp_asv_set_boolean (request, "ProceedFail", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", NULL, create_and_observe_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } /* ChannelRequest fire the 'Failed' signal */ static void test_observe_cr_failed (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; TpAccountChannelRequest *req; request = create_request (); /* Ask to the CR to fire the signal */ tp_asv_set_boolean (request, "FireFailed", TRUE); req = tp_account_channel_request_new (test->account, request, 0); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", NULL, create_and_observe_cb, test); g_hash_table_unref (request); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); } static void ensure_and_observe_cb (GObject *source, GAsyncResult *result, gpointer user_data) { Test *test = user_data; test->channel = tp_account_channel_request_ensure_and_observe_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, &test->error); if (test->channel == NULL) goto out; g_assert (TP_IS_CHANNEL (test->channel)); tp_clear_object (&test->channel); out: g_main_loop_quit (test->mainloop); } static void test_observe_ensure_success (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_ensure_and_observe_channel_async (req, "Fake", NULL, ensure_and_observe_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } /* Cancel the operation before starting it */ static void test_observe_cancel_before (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); g_cancellable_cancel (test->cancellable); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", test->cancellable, create_and_observe_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, G_IO_ERROR, G_IO_ERROR_CANCELLED); } static void test_observe_cancel_after_create (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_create_and_observe_channel_async (req, "Fake", test->cancellable, create_and_observe_cb, test); g_signal_connect (test->cd_service, "channel-request-created", G_CALLBACK (channel_request_created_cb), test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_CANCELLED); } /* Succeeded is fired but not SucceededWithChannel */ static void test_observe_no_channel (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; req = tp_account_channel_request_new_vardict (test->account, floating_request (), 0); tp_account_channel_request_create_and_observe_channel_async (req, "FakeNoChannel", NULL, create_and_observe_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_CONFUSED); } /* Check if TargetHandleType: TP_HANDLE_TYPE_NONE is automatically added if no * target has been specified by the user. */ static void test_no_handle_type (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; gboolean valid; const gchar * const channels[] = { "/chan1", "/chan2", NULL }; GPtrArray *chans; const gchar * const invitees[] = { "badger@badger.com", "snake@badger.com", NULL }; const gchar * const *strv; req = tp_account_channel_request_new_text (test->account, 0); tp_account_channel_request_set_conference_initial_channels (req, channels); tp_account_channel_request_set_initial_invitee_ids (req, invitees); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid), ==, TP_HANDLE_TYPE_NONE); g_assert (valid); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 5); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); chans = tp_asv_get_boxed (test->cd_service->last_request, TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS, TP_ARRAY_TYPE_OBJECT_PATH_LIST); g_assert (chans != NULL); g_assert_cmpuint (chans->len, ==, 2); g_assert_cmpstr (g_ptr_array_index (chans, 0), ==, "/chan1"); g_assert_cmpstr (g_ptr_array_index (chans, 1), ==, "/chan2"); strv = tp_asv_get_boxed (test->cd_service->last_request, TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS, G_TYPE_STRV); g_assert (strv != NULL); g_assert_cmpuint (g_strv_length ((GStrv) strv), ==, 2); g_assert (tp_strv_contains (strv, "badger@badger.com")); g_assert (tp_strv_contains (strv, "snake@badger.com")); } static void test_initial_invitees (Test *test, gconstpointer data G_GNUC_UNUSED) { TpAccountChannelRequest *req; gboolean valid; GPtrArray *invitees; TpContact *contact; const gchar * const *strv; req = tp_account_channel_request_new_text (test->account, 0); invitees = g_ptr_array_new_with_free_func (g_object_unref); contact = tp_tests_connection_run_until_contact_by_id (test->connection, "badger@badger.com", 0, NULL); g_ptr_array_add (invitees, contact); contact = tp_tests_connection_run_until_contact_by_id (test->connection, "snake@badger.com", 0, NULL); g_ptr_array_add (invitees, contact); tp_account_channel_request_set_initial_invitees (req, invitees); g_ptr_array_unref (invitees); /* Ask to the CR to fire the signal */ tp_account_channel_request_set_request_property (req, "FireFailed", g_variant_new_boolean (TRUE)); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_and_handle_cb, test); g_object_unref (req); g_main_loop_run (test->mainloop); g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT); g_assert (test->channel == NULL); /* The request had the properties we wanted */ g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid), ==, TP_HANDLE_TYPE_NONE); g_assert (valid); g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request, "FireFailed", NULL), ==, TRUE); g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4); g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0); strv = tp_asv_get_boxed (test->cd_service->last_request, TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS, G_TYPE_STRV); g_assert (strv != NULL); g_assert_cmpuint (g_strv_length ((GStrv) strv), ==, 2); g_assert (tp_strv_contains (strv, "badger@badger.com")); g_assert (tp_strv_contains (strv, "snake@badger.com")); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); /* Request and handle tests */ g_test_add ("/account-channels/request-handle/create-success", Test, NULL, setup, test_handle_create_success, teardown); g_test_add ("/account-channels/request-handle/create-fail", Test, NULL, setup, test_handle_create_fail, teardown); g_test_add ("/account-channels/request-handle/proceed-fail", Test, NULL, setup, test_handle_proceed_fail, teardown); g_test_add ("/account-channels/request-handle/cr-failed", Test, NULL, setup, test_handle_cr_failed, teardown); g_test_add ("/account-channels/request-handle/ensure-success", Test, NULL, setup, test_handle_ensure_success, teardown); g_test_add ("/account-channels/request-handle/cancel-before", Test, NULL, setup, test_handle_cancel_before, teardown); g_test_add ("/account-channels/request-handle/after-create", Test, NULL, setup, test_handle_cancel_after_create, teardown); g_test_add ("/account-channels/request-handle/re-handle", Test, NULL, setup, test_handle_re_handle, teardown); g_test_add ("/account-channels/request-handle/create-success-hints", Test, NULL, setup, test_handle_create_success_hints, teardown); g_test_add ("/account-channels/request-handle/delegated", Test, NULL, setup, test_handle_delegated, teardown); /* Request and forget tests */ g_test_add ("/account-channels/request-forget/create-success", Test, NULL, setup, test_forget_create_success, teardown); g_test_add ("/account-channels/request-forget/create-fail", Test, NULL, setup, test_forget_create_fail, teardown); g_test_add ("/account-channels/request-foget/proceed-fail", Test, NULL, setup, test_forget_proceed_fail, teardown); g_test_add ("/account-channels/request-forget/cr-failed", Test, NULL, setup, test_forget_cr_failed, teardown); g_test_add ("/account-channels/request-forget/ensure-success", Test, NULL, setup, test_forget_ensure_success, teardown); g_test_add ("/account-channels/request-forget/cancel-before", Test, NULL, setup, test_forget_cancel_before, teardown); g_test_add ("/account-channels/request-forget/after-create", Test, NULL, setup, test_forget_cancel_after_create, teardown); /* Request and observe tests */ g_test_add ("/account-channels/request-observe/create-success", Test, NULL, setup, test_observe_create_success, teardown); g_test_add ("/account-channels/request-observe/create-fail", Test, NULL, setup, test_observe_create_fail, teardown); g_test_add ("/account-channels/request-observe/proceed-fail", Test, NULL, setup, test_observe_proceed_fail, teardown); g_test_add ("/account-channels/request-observe/cr-failed", Test, NULL, setup, test_observe_cr_failed, teardown); g_test_add ("/account-channels/request-observe/ensure-success", Test, NULL, setup, test_observe_ensure_success, teardown); g_test_add ("/account-channels/request-observe/cancel-before", Test, NULL, setup, test_observe_cancel_before, teardown); g_test_add ("/account-channels/request-observe/after-create", Test, NULL, setup, test_observe_cancel_after_create, teardown); g_test_add ("/account-channels/request-observe/no-channel", Test, NULL, setup, test_observe_no_channel, teardown); /* Particular properties of the request */ g_test_add ("/account-channels/test-ft-props", Test, NULL, setup, test_ft_props, teardown); g_test_add ("/account-channels/test-stream-tube-props", Test, NULL, setup, test_stream_tube_props, teardown); g_test_add ("/account-channels/test-dbus-tube-props", Test, NULL, setup, test_dbus_tube_props, teardown); g_test_add ("/account-channels/test-no-handle-type", Test, NULL, setup, test_no_handle_type, teardown); g_test_add ("/account-channels/test-initial-invitees", Test, NULL, setup, test_initial_invitees, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/params-cm.c0000644000175000017500000002776512652510705015601 00000000000000/* Test CM parameters * * Copyright © 2009 Collabora Ltd. * Copyright © 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/params-cm.h" #define CLEAR_OBJECT(o) \ G_STMT_START { \ if (*(o) != NULL) \ { \ g_object_unref (*(o)); \ *(o) = NULL; \ } \ } G_STMT_END typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; GError *error /* statically initialized to NULL */ ; TpTestsParamConnectionManager *service_cm; TpConnectionManager *cm; TpConnection *conn; } Test; static void setup (Test *test, gconstpointer data G_GNUC_UNUSED) { TpBaseConnectionManager *service_cm_as_base; gboolean ok; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->service_cm = TP_TESTS_PARAM_CONNECTION_MANAGER ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_PARAM_CONNECTION_MANAGER, NULL)); g_assert (test->service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (test->service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); test->cm = tp_connection_manager_new (test->dbus, "params_cm", NULL, &test->error); g_assert (test->cm != NULL); tp_tests_proxy_run_until_prepared (test->cm, NULL); } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { CLEAR_OBJECT (&test->cm); CLEAR_OBJECT (&test->service_cm); CLEAR_OBJECT (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_set_params (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; gchar *array_of_strings[] = { "Telepathy", "rocks", "!", NULL }; guint i; GArray *array_of_bytes; guint8 bytes[] = { 0x1, 0x10, 0xA, 0xB, 0xC }; array_of_bytes = g_array_new (FALSE, FALSE, sizeof (guint8)); g_array_append_vals (array_of_bytes, bytes, sizeof (bytes)); parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "a-string", tp_g_value_slice_new_static_string ("a string")); g_hash_table_insert (parameters, "a-int16", tp_g_value_slice_new_int (G_MININT16)); g_hash_table_insert (parameters, "a-int32", tp_g_value_slice_new_int (G_MININT32)); g_hash_table_insert (parameters, "a-uint16", tp_g_value_slice_new_uint (G_MAXUINT16)); g_hash_table_insert (parameters, "a-uint32", tp_g_value_slice_new_uint (G_MAXUINT32)); g_hash_table_insert (parameters, "a-int64", tp_g_value_slice_new_int64 (G_MAXINT64)); g_hash_table_insert (parameters, "a-uint64", tp_g_value_slice_new_uint64 (G_MAXUINT64)); g_hash_table_insert (parameters, "a-boolean", tp_g_value_slice_new_boolean (TRUE)); g_hash_table_insert (parameters, "a-double", tp_g_value_slice_new_double (G_MAXDOUBLE)); g_hash_table_insert (parameters, "a-array-of-strings", tp_g_value_slice_new_static_boxed (G_TYPE_STRV, array_of_strings)); g_hash_table_insert (parameters, "a-array-of-bytes", tp_g_value_slice_new_boxed (DBUS_TYPE_G_UCHAR_ARRAY, array_of_bytes)); g_hash_table_insert (parameters, "a-object-path", tp_g_value_slice_new_static_boxed (DBUS_TYPE_G_OBJECT_PATH, "/A/Object/Path")); g_hash_table_insert (parameters, "lc-string", tp_g_value_slice_new_static_string ("Filter Me")); g_hash_table_insert (parameters, "uc-string", tp_g_value_slice_new_static_string ("Filter Me")); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert (test->error->code == TP_ERROR_NOT_IMPLEMENTED); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); g_assert (params != NULL); g_assert (!tp_strdiff (params->a_string, "a string")); g_assert_cmpint (params->a_int16, ==, G_MININT16); g_assert_cmpint (params->a_int32, ==, G_MININT32); g_assert_cmpuint (params->a_uint16, ==, G_MAXUINT16); g_assert_cmpuint (params->a_uint32, ==, G_MAXUINT32); g_assert_cmpuint (params->a_int64, ==, G_MAXINT64); g_assert_cmpuint (params->a_uint64, ==, G_MAXUINT64); g_assert (params->a_boolean); g_assert_cmpfloat (params->a_double, ==, G_MAXDOUBLE); g_assert_cmpuint (g_strv_length (params->a_array_of_strings), ==, g_strv_length (array_of_strings)); for (i = 0; array_of_strings[i] != NULL; i++) g_assert (!tp_strdiff (params->a_array_of_strings[i], array_of_strings[i])); g_assert_cmpuint (params->a_array_of_bytes->len, ==, array_of_bytes->len); for (i = 0; i < array_of_bytes->len; i++) g_assert (params->a_array_of_bytes->data[i] == array_of_bytes->data[i]); g_assert (!tp_strdiff (params->a_object_path, "/A/Object/Path")); g_assert (!tp_strdiff (params->lc_string, "filter me")); g_assert (!tp_strdiff (params->uc_string, "FILTER ME")); tp_tests_param_connection_manager_free_params (params); g_hash_table_unref (parameters); g_array_unref (array_of_bytes); } static void test_defaults (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "a-boolean", tp_g_value_slice_new_boolean (FALSE)); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_NOT_IMPLEMENTED); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); g_assert (params->would_have_been_freed); g_assert_cmpstr (params->a_string, ==, "the default string"); g_assert_cmpint (params->a_int16, ==, 42); g_assert_cmpint (params->a_int32, ==, 42); tp_tests_param_connection_manager_free_params (params); g_hash_table_unref (parameters); } static void test_missing_required (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); if (params != NULL) { g_assert (params->would_have_been_freed); tp_tests_param_connection_manager_free_params (params); } g_hash_table_unref (parameters); } static void test_fail_filter (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "a-boolean", tp_g_value_slice_new_boolean (FALSE)); /* The lc-string and uc-string parameters have a filter which rejects * anything outside ASCII, like these gratuitous umlauts */ g_hash_table_insert (parameters, "uc-string", tp_g_value_slice_new_static_string ("M\xc3\xb6t\xc3\xb6rhead")); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); if (params != NULL) { g_assert (params->would_have_been_freed); tp_tests_param_connection_manager_free_params (params); } g_hash_table_unref (parameters); } static void test_wrong_type (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "a-boolean", tp_g_value_slice_new_string ("FALSE")); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); if (params != NULL) { g_assert (params->would_have_been_freed); tp_tests_param_connection_manager_free_params (params); } g_hash_table_unref (parameters); } static void test_unwelcome (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *parameters; TpTestsCMParams *params; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (parameters, "a-boolean", tp_g_value_slice_new_boolean (FALSE)); g_hash_table_insert (parameters, "a-piece-of-cheese", tp_g_value_slice_new_boolean (TRUE)); tp_cli_connection_manager_run_request_connection (test->cm, -1, "example", parameters, NULL, NULL, &test->error, NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_INVALID_ARGUMENT); g_clear_error (&test->error); params = tp_tests_param_connection_manager_steal_params_last_conn (); if (params != NULL) { g_assert (params->would_have_been_freed); tp_tests_param_connection_manager_free_params (params); } g_hash_table_unref (parameters); } static void test_get_parameters_bad_proto (Test *test, gconstpointer data G_GNUC_UNUSED) { GPtrArray *out = NULL; tp_cli_connection_manager_run_get_parameters (test->cm, -1, "not-example", &out, &test->error, NULL); g_assert (out == NULL); g_assert (test->error != NULL); g_assert_cmpint (test->error->code, ==, TP_ERROR_NOT_IMPLEMENTED); g_clear_error (&test->error); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/params-cm/set-params", Test, NULL, setup, test_set_params, teardown); g_test_add ("/params-cm/defaults", Test, NULL, setup, test_defaults, teardown); g_test_add ("/params-cm/fail-filter", Test, NULL, setup, test_fail_filter, teardown); g_test_add ("/params-cm/missing-required", Test, NULL, setup, test_missing_required, teardown); g_test_add ("/params-cm/wrong-type", Test, NULL, setup, test_wrong_type, teardown); g_test_add ("/params-cm/unwelcome", Test, NULL, setup, test_unwelcome, teardown); g_test_add ("/params-cm/get-parameters-bad-proto", Test, NULL, setup, test_get_parameters_bad_proto, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/telepathy/0000755000175000017500000000000014006623343015611 500000000000000telepathy-glib-0.24.2/tests/dbus/telepathy/managers/0000755000175000017500000000000014006623343017406 500000000000000telepathy-glib-0.24.2/tests/dbus/telepathy/managers/test_manager_file_invalid.manager0000644000175000017500000000007412652510705026043 00000000000000[Protocol foo [Protocol bar param-account = s required = = telepathy-glib-0.24.2/tests/dbus/telepathy/managers/test_manager_file.manager0000644000175000017500000000606212652510705024340 00000000000000[ConnectionManager] Interfaces= [Protocol foo] param-account = s required param-password = s required param-encryption-key = s secret param-port = q param-register = b param-server-list = as default-account = foo@default default-port = 1234 default-server-list = foo;bar; Interfaces=org.freedesktop.Telepathy.Protocol.Interface.Avatars; ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts; RequestableChannelClasses=1-1-text; VCardField=x-telepathy-tests EnglishName=Regression tests Icon=im-icq SupportedAvatarMIMETypes=image/png;image/jpeg;image/gif; MinimumAvatarHeight=32 RecommendedAvatarHeight=64 MaximumAvatarHeight=96 MinimumAvatarWidth=32 RecommendedAvatarWidth=64 MaximumAvatarWidth=96 MaximumAvatarBytes=37748736 [1-1-text] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text org.freedesktop.Telepathy.Channel.TargetHandleType u=1 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID; [Protocol bar] param-account = s required param-encryption-key = s required secret param-password = s required param-port = q param-register = b param-server-list = as default-account = bar@default default-port = 4321 default-server-list = bar;foo; [Protocol somewhat-pathological] # the value is "hello world" param-foo = s required default-foo = hello world # the value is "list;of;misc;" (it's not parsed as a list) param-semicolons=s secret default-semicolons=list;of;misc; # the values is a list ["list", "of", "misc"] param-list = as default-list = list;of;misc; # the spec says this is invalid but we should probably be permissive param-unterminated-list = as default-unterminated-list = list;of;misc # the value is a list ["list", " of", " misc "] (spaces significant) param-spaces-in-list = as default-spaces-in-list = list; of; misc ; # the value is a list ["list;of", "misc"] param-escaped-semicolon-in-list = as default-escaped-semicolon-in-list = list\;of;misc; # the value is a list ["list\", "of", "misc"] param-doubly-escaped-semicolon-in-list = as default-doubly-escaped-semicolon-in-list = list\\;of;misc; # the value is a list ["list\;of", "misc"] param-triply-escaped-semicolon-in-list = as default-triply-escaped-semicolon-in-list = list\\\;of;misc; # the value is [] param-empty-list = as default-empty-list = # this is probably technically a Desktop Entry spec violation? # we should be permissive, interpreting this as either "foo\;bar" or "foo;bar" # seems reasonable param-escaped-semicolon = s default-escaped-semicolon = foo\;bar # all the other types param-object = o default-object = /misc param-q = q default-q = 42 param-u = u default-u = 42 param-t = t default-t = 42 param-n = n default-n = -42 param-i = i default-i = -42 param-x = x default-x = -42 param-d = d default-d = 42.0 # the value is [""] param-empty-string-in-list = as default-empty-string-in-list = ; param-true = b default-true = true param-false = b default-false = false param-y = y default-y = 42 param-ao = ao default-ao = /misc;/other; telepathy-glib-0.24.2/tests/dbus/telepathy/managers/spurious.manager0000644000175000017500000000040312652510705022552 00000000000000[ConnectionManager] [Protocol normal] param-account=s required register param-password=s required register secret param-register=b default-register=true [Protocol weird] param-com.example.Bork.Bork.Bork=u dbus-property default-com.example.Bork.Bork.Bork=42 telepathy-glib-0.24.2/tests/dbus/connection-balance.c0000644000175000017500000002614312652510705017430 00000000000000/* Feature test for Conn.I.Balance * * Copyright © 2007-2011 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" #define BALANCE 1234 #define BALANCE_SCALE 2 #define BALANCE_CURRENCY "BDD" /* badger dollars */ #define MANAGE_CREDIT_URI "http://chat.badger.net/topup" /* -- BalancedConnection -- */ typedef TpTestsSimpleConnection BalancedConnection; typedef TpTestsSimpleConnectionClass BalancedConnectionClass; #define TYPE_BALANCED_CONNECTION (balanced_connection_get_type ()) static GType balanced_connection_get_type (void); G_DEFINE_TYPE_WITH_CODE (BalancedConnection, balanced_connection, TP_TESTS_TYPE_SIMPLE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_BALANCE, NULL)) enum { PROP_0, PROP_ACCOUNT_BALANCE, PROP_MANAGE_CREDIT_URI }; static void balanced_connection_get_property (GObject *self G_GNUC_UNUSED, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_ACCOUNT_BALANCE: /* known balance */ g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_INT, BALANCE, G_TYPE_UINT, BALANCE_SCALE, G_TYPE_STRING, BALANCE_CURRENCY, G_TYPE_INVALID)); break; case PROP_MANAGE_CREDIT_URI: g_value_set_static_string (value, MANAGE_CREDIT_URI); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); break; } } static void balanced_connection_init (BalancedConnection *self G_GNUC_UNUSED) { } static GPtrArray * get_interfaces (TpBaseConnection *base) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( balanced_connection_parent_class)->get_interfaces_always_present (base); g_ptr_array_add (interfaces, TP_IFACE_CONNECTION_INTERFACE_BALANCE); return interfaces; } static void balanced_connection_class_init (BalancedConnectionClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; TpBaseConnectionClass *base_class = TP_BASE_CONNECTION_CLASS (cls); static TpDBusPropertiesMixinPropImpl balance_props[] = { { "AccountBalance", "account-balance", NULL }, { "ManageCreditURI", "manage-credit-uri", NULL }, { NULL } }; object_class->get_property = balanced_connection_get_property; base_class->get_interfaces_always_present = get_interfaces; g_object_class_install_property (object_class, PROP_ACCOUNT_BALANCE, g_param_spec_boxed ("account-balance", "", "", TP_STRUCT_TYPE_CURRENCY_AMOUNT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_MANAGE_CREDIT_URI, g_param_spec_string ("manage-credit-uri", "", "", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE, tp_dbus_properties_mixin_getter_gobject_properties, NULL, balance_props); } /* -- UnbalancedConnection -- */ typedef TpTestsSimpleConnection UnbalancedConnection; typedef TpTestsSimpleConnectionClass UnbalancedConnectionClass; #define TYPE_UNBALANCED_CONNECTION (unbalanced_connection_get_type ()) static GType unbalanced_connection_get_type (void); G_DEFINE_TYPE (UnbalancedConnection, unbalanced_connection, TYPE_BALANCED_CONNECTION) static void unbalanced_connection_get_property (GObject *self G_GNUC_UNUSED, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_ACCOUNT_BALANCE: /* unknown balance */ g_value_take_boxed (value, tp_value_array_build (3, G_TYPE_INT, 0, G_TYPE_UINT, G_MAXUINT32, G_TYPE_STRING, "", G_TYPE_INVALID)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); break; } } static void unbalanced_connection_init (UnbalancedConnection *self G_GNUC_UNUSED) { } static void unbalanced_connection_class_init (UnbalancedConnectionClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; object_class->get_property = unbalanced_connection_get_property; g_object_class_override_property (object_class, PROP_ACCOUNT_BALANCE, "account-balance"); } /* -- Tests -- */ typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; DBusConnection *client_libdbus; DBusGConnection *client_dbusglib; TpDBusDaemon *client_bus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; gboolean cwr_ready; GError *cwr_error /* initialized in setup */; GError *error /* initialized where needed */; gint wait; } Test; static void setup (Test *test, gconstpointer data) { GError *error = NULL; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; GType conn_type = GPOINTER_TO_SIZE (data); tp_debug_set_flags ("all"); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->mainloop = g_main_loop_new (NULL, FALSE); test->error = NULL; test->client_libdbus = dbus_bus_get_private (DBUS_BUS_STARTER, NULL); g_assert (test->client_libdbus != NULL); dbus_connection_setup_with_g_main (test->client_libdbus, NULL); dbus_connection_set_exit_on_disconnect (test->client_libdbus, FALSE); test->client_dbusglib = dbus_connection_get_g_connection ( test->client_libdbus); dbus_g_connection_ref (test->client_dbusglib); test->client_bus = tp_dbus_daemon_new (test->client_dbusglib); g_assert (test->client_bus != NULL); test->service_conn = tp_tests_object_new_static_class ( conn_type, "account", "me@example.com", "protocol", "simple-protocol", NULL); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (test->service_conn != NULL); g_assert (test->service_conn_as_base != NULL); g_assert (tp_base_connection_register (test->service_conn_as_base, "simple", &test->conn_name, &test->conn_path, &error)); g_assert_no_error (error); test->cwr_ready = FALSE; test->cwr_error = NULL; test->conn = tp_connection_new (test->client_bus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_BALANCE)); tp_tests_proxy_run_until_prepared (test->conn, features); } static void teardown (Test *test, gconstpointer data G_GNUC_UNUSED) { TpConnection *conn; GError *error = NULL; g_clear_error (&test->error); tp_clear_pointer (&test->mainloop, g_main_loop_unref); tp_clear_object (&test->conn); /* disconnect the connection so we don't leak it */ conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_assert (!tp_connection_run_until_ready (conn, FALSE, &error, NULL)); g_assert_error (error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&error); test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); g_object_unref (test->dbus); test->dbus = NULL; g_object_unref (test->client_bus); test->client_bus = NULL; dbus_g_connection_unref (test->client_dbusglib); dbus_connection_close (test->client_libdbus); dbus_connection_unref (test->client_libdbus); } static void balance_changed_cb (TpConnection *conn, gint balance, guint scale, const gchar *currency, Test *test) { g_assert_cmpint (balance, ==, BALANCE * 2); g_assert_cmpuint (scale, ==, BALANCE_SCALE); g_assert_cmpstr (currency, ==, BALANCE_CURRENCY); test->wait--; if (test->wait <= 0) g_main_loop_quit (test->mainloop); } static void test_balance (Test *test, gconstpointer nil G_GNUC_UNUSED) { GQuark features[] = { TP_CONNECTION_FEATURE_BALANCE, 0 }; gint balance; guint scale; const gchar *currency, *uri; gchar *currency_alloc, *uri_alloc; GValueArray *v; g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_BALANCE)); tp_tests_proxy_run_until_prepared (test->conn, features); g_assert (tp_connection_get_balance (test->conn, &balance, &scale, ¤cy)); g_assert_cmpint (balance, ==, BALANCE); g_assert_cmpuint (scale, ==, BALANCE_SCALE); g_assert_cmpstr (currency, ==, BALANCE_CURRENCY); uri = tp_connection_get_balance_uri (test->conn); g_assert_cmpstr (uri, ==, MANAGE_CREDIT_URI); g_object_get (test->conn, "balance", &balance, "balance-scale", &scale, "balance-currency", ¤cy_alloc, "balance-uri", &uri_alloc, NULL); g_assert_cmpint (balance, ==, BALANCE); g_assert_cmpuint (scale, ==, BALANCE_SCALE); g_assert_cmpstr (currency_alloc, ==, BALANCE_CURRENCY); g_assert_cmpstr (uri_alloc, ==, MANAGE_CREDIT_URI); v = tp_value_array_build (3, G_TYPE_INT, BALANCE * 2, G_TYPE_UINT, BALANCE_SCALE, G_TYPE_STRING, BALANCE_CURRENCY, G_TYPE_INVALID); tp_svc_connection_interface_balance_emit_balance_changed ( test->service_conn_as_base, v); g_signal_connect (test->conn, "balance-changed", G_CALLBACK (balance_changed_cb), test); test->wait = 1; g_main_loop_run (test->mainloop); g_assert_no_error (test->error); g_free (currency_alloc); g_free (uri_alloc); } static void test_balance_unknown (Test *test, gconstpointer nil G_GNUC_UNUSED) { GQuark features[] = { TP_CONNECTION_FEATURE_BALANCE, 0 }; gint balance; guint scale; const gchar *currency; g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_BALANCE)); tp_tests_proxy_run_until_prepared (test->conn, features); g_assert (!tp_connection_get_balance (test->conn, &balance, &scale, ¤cy)); } int main (int argc, char **argv) { tp_tests_abort_after (5); g_test_init (&argc, &argv, NULL); g_test_add ("/conn/balance", Test, GSIZE_TO_POINTER (TYPE_BALANCED_CONNECTION), setup, test_balance, teardown); g_test_add ("/conn/balance-unknown", Test, GSIZE_TO_POINTER (TYPE_UNBALANCED_CONNECTION), setup, test_balance_unknown, teardown); g_test_add ("/conn/balance-unimplemented", Test, GSIZE_TO_POINTER (TP_TESTS_TYPE_SIMPLE_CONNECTION), setup, test_balance_unknown, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/channel-manager-request-properties.c0000644000175000017500000001310712652510705022602 00000000000000/* Basic test for the request properties given to channel managers. * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "tests/lib/echo-channel-manager-conn.h" #include "tests/lib/simple-channel-manager.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpTestsEchoChannelManagerConnection *service_conn; TpTestsSimpleChannelManager *channel_manager; TpConnection *conn; GError *error /* initialized where needed */; guint waiting; } Test; static void setup (Test *test, gconstpointer data) { TpBaseConnection *service_conn_as_base; gboolean ok; gchar *name, *conn_path; tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->channel_manager = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CHANNEL_MANAGER, NULL); g_assert (test->channel_manager != NULL); test->service_conn = TP_TESTS_ECHO_CHANNEL_MANAGER_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_ECHO_CHANNEL_MANAGER_CONNECTION, "account", "me@example", "protocol", "example", "channel-manager", test->channel_manager, NULL)); g_assert (test->service_conn != NULL); service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (service_conn_as_base != NULL); test->channel_manager->conn = TP_BASE_CONNECTION (test->service_conn); ok = tp_base_connection_register (service_conn_as_base, "example", &name, &conn_path, &test->error); g_assert (ok); g_assert_no_error (test->error); test->conn = tp_connection_new (test->dbus, name, conn_path, &test->error); g_assert (test->conn != NULL); g_assert_no_error (test->error); g_assert (tp_connection_run_until_ready (test->conn, TRUE, &test->error, NULL)); g_assert_no_error (test->error); g_free (name); g_free (conn_path); test->waiting = 0; } static void teardown (Test *test, gconstpointer data) { tp_tests_connection_assert_disconnect_succeeds (test->conn); g_object_unref (test->service_conn); test->service_conn = NULL; g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_wait (Test *test) { while (test->waiting > 0) g_main_loop_run (test->mainloop); } static void connection_inspect_handles_cb (TpConnection *conn, const gchar **ids, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; const gchar *id; g_assert_no_error (error); g_assert_cmpuint (g_strv_length ((gchar **) ids), ==, 1); id = ids[0]; g_assert_cmpstr (id, ==, "lolbags"); test->waiting--; g_main_loop_quit (test->mainloop); } static void channel_manager_request_cb (TpTestsSimpleChannelManager *channel_manager, GHashTable *request_properties, Test *test) { const gchar *target_id = tp_asv_get_string (request_properties, TP_PROP_CHANNEL_TARGET_ID); TpHandle handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); GArray *handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1); tp_asv_dump (request_properties); g_assert (handle != 0); g_assert (target_id != NULL); g_assert_cmpstr (target_id, ==, "lolbags#dingdong"); g_array_append_val (handles, handle); tp_cli_connection_call_inspect_handles (test->conn, -1, TP_HANDLE_TYPE_CONTACT, handles, connection_inspect_handles_cb, test, NULL, NULL); test->waiting++; g_array_unref (handles); test->waiting--; g_main_loop_quit (test->mainloop); } static void create_channel_cb (TpConnection *proxy, const gchar *object_path, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; const gchar *target_id = tp_asv_get_string (properties, TP_PROP_CHANNEL_TARGET_ID); g_assert_no_error (error); tp_asv_dump (properties); g_assert (target_id != NULL); g_assert_cmpstr (target_id, ==, "lolbags"); test->waiting--; g_main_loop_quit (test->mainloop); } static void test_target_id (Test *test, gconstpointer data G_GNUC_UNUSED) { GHashTable *request; g_test_bug ("27855"); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "lolbags#dingdong", NULL); g_signal_connect (test->channel_manager, "request", G_CALLBACK (channel_manager_request_cb), test); test->waiting++; tp_cli_connection_interface_requests_call_create_channel (test->conn, -1, request, create_channel_cb, test, NULL, NULL); test->waiting++; test_wait (test); g_hash_table_unref (request); } int main (int argc, char **argv) { tp_tests_abort_after (10); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/channel-manager-request-properties/target-id", Test, NULL, setup, test_target_id, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/list-cm-no-cm.c0000644000175000017500000000372012652510705016261 00000000000000/* Feature test for https://bugs.freedesktop.org/show_bug.cgi?id=68892 * * Copyright (C) 2014 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; GError *error; } Test; static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; } static void teardown (Test *test, gconstpointer data) { g_clear_object (&test->dbus); g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_list_cm_no_cm (Test *test, gconstpointer data) { GAsyncResult *res = NULL; GList *cms; tp_list_connection_managers_async (test->dbus, tp_tests_result_ready_cb, &res); tp_tests_run_until_result (&res); cms = tp_list_connection_managers_finish (res, &test->error); g_assert_no_error (test->error); g_assert_cmpuint (g_list_length (cms), ==, 0); g_object_unref (res); g_list_free (cms); } int main (int argc, char **argv) { gchar *dir; GError *error = NULL; int result; /* This test relies on D-Bus not finding any service file so tweak * TP_TESTS_SERVICES_DIR to point to an empty directory. */ dir = g_dir_make_tmp ("tp-glib-tests.XXXXXX", &error); g_assert_no_error (error); g_setenv ("TP_TESTS_SERVICES_DIR", dir, TRUE); tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/cm/list-cm-no-cm", Test, NULL, setup, test_list_cm_no_cm, teardown); result = tp_tests_run_with_bus (); g_rmdir (dir); g_free (dir); return result; } telepathy-glib-0.24.2/tests/dbus/simple-observer.c0000644000175000017500000003162012652510705017020 00000000000000/* Tests of TpSimpleObserver * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/util.h" #include "tests/lib/simple-account.h" #include "tests/lib/simple-conn.h" #include "tests/lib/textchan-null.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; /* Service side objects */ TpBaseClient *simple_observer; TpBaseConnection *base_connection; TpTestsSimpleAccount *account_service; TpTestsTextChannelNull *text_chan_service; /* Client side objects */ TpClient *client; TpConnection *connection; TpAccount *account; TpChannel *text_chan; GError *error /* initialized where needed */; } Test; #define ACCOUNT_PATH TP_ACCOUNT_OBJECT_PATH_BASE "what/ev/er" static void setup (Test *test, gconstpointer data) { gchar *chan_path; TpHandle handle; TpHandleRepoIface *contact_repo; test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->error = NULL; /* Claim AccountManager bus-name (needed as we're going to export an Account * object). */ tp_dbus_daemon_request_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, FALSE, &test->error); g_assert_no_error (test->error); /* Create service-side Account object */ test->account_service = tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_ACCOUNT, NULL); tp_dbus_daemon_register_object (test->dbus, ACCOUNT_PATH, test->account_service); /* Create client-side Account object */ test->account = tp_account_new (test->dbus, ACCOUNT_PATH, NULL); g_assert (test->account != NULL); /* Create (service and client sides) connection objects */ tp_tests_create_and_connect_conn (TP_TESTS_TYPE_SIMPLE_CONNECTION, "me@test.com", &test->base_connection, &test->connection); /* Create service-side text channel object */ chan_path = g_strdup_printf ("%s/Channel", tp_proxy_get_object_path (test->connection)); contact_repo = tp_base_connection_get_handles (test->base_connection, TP_HANDLE_TYPE_CONTACT); g_assert (contact_repo != NULL); handle = tp_handle_ensure (contact_repo, "bob", NULL, &test->error); g_assert_no_error (test->error); test->text_chan_service = TP_TESTS_TEXT_CHANNEL_NULL ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_TEXT_CHANNEL_NULL, "connection", test->base_connection, "object-path", chan_path, "handle", handle, NULL)); /* Create client-side text channel object */ test->text_chan = tp_channel_new (test->connection, chan_path, NULL, TP_HANDLE_TYPE_CONTACT, handle, &test->error); g_assert_no_error (test->error); tp_handle_unref (contact_repo, handle); g_free (chan_path); } static void teardown (Test *test, gconstpointer data) { g_clear_error (&test->error); g_object_unref (test->simple_observer); g_object_unref (test->client); tp_dbus_daemon_unregister_object (test->dbus, test->account_service); g_object_unref (test->account_service); tp_dbus_daemon_release_name (test->dbus, TP_ACCOUNT_MANAGER_BUS_NAME, &test->error); g_assert_no_error (test->error); g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; g_object_unref (test->account); g_object_unref (test->text_chan_service); g_object_unref (test->text_chan); tp_tests_connection_assert_disconnect_succeeds (test->connection); g_object_unref (test->connection); g_object_unref (test->base_connection); } static void create_simple_observer (Test *test, gboolean recover, TpSimpleObserverObserveChannelsImpl impl) { /* Create service-side Client object */ test->simple_observer = tp_tests_object_new_static_class ( TP_TYPE_SIMPLE_OBSERVER, "dbus-daemon", test->dbus, "recover", recover, "name", "MySimpleObserver", "uniquify-name", FALSE, "callback", impl, "user-data", test, "destroy", NULL, NULL); g_assert (test->simple_observer != NULL); /* Create client-side Client object */ test->client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", test->dbus, "bus-name", tp_base_client_get_bus_name (test->simple_observer), "object-path", tp_base_client_get_object_path (test->simple_observer), NULL); g_assert (test->client != NULL); } static void get_client_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; const gchar * const *interfaces; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 1); interfaces = tp_asv_get_strv (properties, "Interfaces"); g_assert_cmpint (g_strv_length ((GStrv) interfaces), ==, 1); g_assert (tp_strv_contains (interfaces, TP_IFACE_CLIENT_OBSERVER)); out: g_main_loop_quit (test->mainloop); } static void check_filters (GPtrArray *filters) { GHashTable *filter; g_assert (filters != NULL); g_assert_cmpuint (filters->len, ==, 2); filter = g_ptr_array_index (filters, 0); g_assert_cmpuint (g_hash_table_size (filter), ==, 1); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT); filter = g_ptr_array_index (filters, 1); g_assert_cmpuint (g_hash_table_size (filter), ==, 2); g_assert_cmpstr (tp_asv_get_string (filter, TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE); g_assert_cmpuint (tp_asv_get_uint32 (filter, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL), ==, TP_HANDLE_TYPE_CONTACT); } static void get_observer_prop_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; GPtrArray *filters; gboolean recover; gboolean valid; gboolean delay; if (error != NULL) { test->error = g_error_copy (error); goto out; } g_assert_cmpint (g_hash_table_size (properties), == , 3); filters = tp_asv_get_boxed (properties, "ObserverChannelFilter", TP_ARRAY_TYPE_CHANNEL_CLASS_LIST); check_filters (filters); recover = tp_asv_get_boolean (properties, "Recover", &valid); g_assert (valid); g_assert (recover); delay = tp_asv_get_boolean (properties, "DelayApprovers", &valid); g_assert (valid); g_assert (!delay); out: g_main_loop_quit (test->mainloop); } static void observe_channels_success ( TpSimpleObserver *observer, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context, gpointer user_data) { tp_observe_channels_context_accept (context); } static void test_properties (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_observer (test, TRUE, observe_channels_success); tp_base_client_add_observer_filter_vardict (test->simple_observer, g_variant_new_parsed ("{ %s: <%s> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT)); tp_base_client_add_observer_filter_vardict (test->simple_observer, g_variant_new_parsed ("{ %s: <%s>, %s: <%u> }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT)); tp_base_client_register (test->simple_observer, &test->error); g_assert_no_error (test->error); /* Check Client properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT, get_client_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); /* Check Observer properties */ tp_cli_dbus_properties_call_get_all (test->client, -1, TP_IFACE_CLIENT_OBSERVER, get_observer_prop_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_assert_no_error (test->error); } static void no_return_cb (TpClient *proxy, const GError *error, gpointer user_data, GObject *weak_object) { Test *test = user_data; g_clear_error (&test->error); if (error != NULL) { test->error = g_error_copy (error); goto out; } out: g_main_loop_quit (test->mainloop); } static void add_channel_to_ptr_array (GPtrArray *arr, TpChannel *channel) { GValueArray *tmp; g_assert (arr != NULL); g_assert (channel != NULL); tmp = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, tp_proxy_get_object_path (channel), TP_HASH_TYPE_STRING_VARIANT_MAP, tp_channel_borrow_immutable_properties ( channel), G_TYPE_INVALID); g_ptr_array_add (arr, tmp); } static void free_channel_details (gpointer data, gpointer user_data) { g_boxed_free (TP_STRUCT_TYPE_CHANNEL_DETAILS, data); } static void call_observe_channels (Test *test) { GPtrArray *channels, *requests_satisified; GHashTable *info; channels = g_ptr_array_sized_new (1); add_channel_to_ptr_array (channels, test->text_chan); requests_satisified = g_ptr_array_sized_new (0); info = tp_asv_new ( "recovering", G_TYPE_BOOLEAN, TRUE, NULL); tp_proxy_add_interface_by_id (TP_PROXY (test->client), TP_IFACE_QUARK_CLIENT_OBSERVER); tp_cli_client_observer_call_observe_channels (test->client, -1, tp_proxy_get_object_path (test->account), tp_proxy_get_object_path (test->connection), channels, "/", requests_satisified, info, no_return_cb, test, NULL, NULL); g_main_loop_run (test->mainloop); g_ptr_array_foreach (channels, free_channel_details, NULL); g_ptr_array_unref (channels); g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } /* ObserveChannels returns immediately */ static void test_success (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_observer (test, TRUE, observe_channels_success); tp_base_client_add_observer_filter_vardict (test->simple_observer, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_observer, &test->error); g_assert_no_error (test->error); call_observe_channels (test); g_assert_no_error (test->error); } /* ObserveChannels returns in an async way */ static gboolean accept_idle_cb (gpointer data) { TpObserveChannelsContext *context = data; tp_observe_channels_context_accept (context); g_object_unref (context); return FALSE; } static void observe_channels_async ( TpSimpleObserver *observer, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context, gpointer user_data) { g_idle_add (accept_idle_cb, g_object_ref (context)); tp_observe_channels_context_delay (context); } static void test_delayed (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_observer (test, TRUE, observe_channels_async); tp_base_client_add_observer_filter_vardict (test->simple_observer, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_observer, &test->error); g_assert_no_error (test->error); call_observe_channels (test); g_assert_no_error (test->error); } /* ObserveChannels fails */ static void observe_channels_fail ( TpSimpleObserver *observer, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context, gpointer user_data) { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No ObserveChannels for you!" }; tp_observe_channels_context_fail (context, &error); } static void test_fail (Test *test, gconstpointer data G_GNUC_UNUSED) { create_simple_observer (test, TRUE, observe_channels_fail); tp_base_client_add_observer_filter_vardict (test->simple_observer, g_variant_new_parsed ("@a{sv} {}")); tp_base_client_register (test->simple_observer, &test->error); g_assert_no_error (test->error); call_observe_channels (test); g_assert_error (test->error, TP_ERROR, TP_ERROR_NOT_AVAILABLE); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/simple-observer/properties", Test, NULL, setup, test_properties, teardown); g_test_add ("/simple-observer/success", Test, NULL, setup, test_success, teardown); g_test_add ("/simple-observer/delayed", Test, NULL, setup, test_delayed, teardown); g_test_add ("/simple-observer/fail", Test, NULL, setup, test_fail, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/self-presence.c0000644000175000017500000002545012652510705016441 00000000000000/* Feature test for setting your own presence. * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" static void test_simple_presence (TpTestsContactsConnection *service_conn, TpConnection *client_conn) { GError *error = NULL; GValue *value = NULL; GHashTable *statuses; GValueArray *spec; MYASSERT (tp_cli_dbus_properties_run_get (client_conn, -1, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, "Statuses", &value, &error, NULL), ""); g_assert_no_error (error); MYASSERT (G_VALUE_TYPE (value) == TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP, ": %s != %s", G_VALUE_TYPE_NAME (value), g_type_name (TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP)); statuses = g_value_get_boxed (value); spec = g_hash_table_lookup (statuses, "available"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* can have message */ spec = g_hash_table_lookup (statuses, "busy"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* can have message */ spec = g_hash_table_lookup (statuses, "away"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* can have message */ spec = g_hash_table_lookup (statuses, "offline"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_OFFLINE); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ spec = g_hash_table_lookup (statuses, "unknown"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_UNKNOWN); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ spec = g_hash_table_lookup (statuses, "error"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_ERROR); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ g_value_unset (value); g_free (value); MYASSERT (!tp_cli_connection_interface_simple_presence_run_set_presence ( client_conn, -1, "offline", "", &error, NULL), ""); g_assert_cmpstr (g_quark_to_string (error->domain), ==, g_quark_to_string (TP_ERROR)); g_error_free (error); error = NULL; MYASSERT (tp_cli_connection_interface_simple_presence_run_set_presence ( client_conn, -1, "available", "Here I am", &error, NULL), ""); g_assert_no_error (error); value = NULL; MYASSERT (tp_cli_dbus_properties_run_get (client_conn, -1, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, "MaximumStatusMessageLength", &value, &error, NULL), ""); g_assert_no_error (error); MYASSERT (G_VALUE_TYPE (value) == G_TYPE_UINT, ": %s != %s", G_VALUE_TYPE_NAME (value), g_type_name (G_TYPE_UINT)); g_assert_cmpuint (g_value_get_uint (value), ==, 512); g_value_unset (value); g_free (value); } static void test_complex_presence (TpTestsContactsConnection *service_conn, TpConnection *client_conn) { GHashTable *statuses = NULL; GValueArray *spec; GHashTable *params; GError *error = NULL; GHashTable *monster; MYASSERT (tp_cli_connection_interface_presence_run_get_statuses ( client_conn, -1, &statuses, &error, NULL), ""); g_assert_no_error (error); spec = g_hash_table_lookup (statuses, "available"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 1); g_assert_cmpstr ( (const gchar *) g_hash_table_lookup (params, "message"), ==, "s"); spec = g_hash_table_lookup (statuses, "away"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 1); g_assert_cmpstr ( (const gchar *) g_hash_table_lookup (params, "message"), ==, "s"); spec = g_hash_table_lookup (statuses, "busy"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); MYASSERT (g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 1); g_assert_cmpstr ( (const gchar *) g_hash_table_lookup (params, "message"), ==, "s"); spec = g_hash_table_lookup (statuses, "offline"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_OFFLINE); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 0); spec = g_hash_table_lookup (statuses, "error"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_ERROR); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 0); spec = g_hash_table_lookup (statuses, "unknown"); MYASSERT (spec != NULL, ""); g_assert_cmpuint (g_value_get_uint (spec->values + 0), ==, TP_CONNECTION_PRESENCE_TYPE_UNKNOWN); MYASSERT (!g_value_get_boolean (spec->values + 1), ""); /* can set on self */ MYASSERT (g_value_get_boolean (spec->values + 2), ""); /* exclusive */ params = g_value_get_boxed (spec->values + 3); MYASSERT (params != NULL, ""); g_assert_cmpuint (g_hash_table_size (params), ==, 0); monster = g_hash_table_new (g_str_hash, g_str_equal); params = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (monster, "offline", params); MYASSERT (!tp_cli_connection_interface_presence_run_set_status ( client_conn, -1, monster, &error, NULL), ""); g_assert_cmpstr (g_quark_to_string (error->domain), ==, g_quark_to_string (TP_ERROR)); g_error_free (error); error = NULL; g_hash_table_remove (monster, "offline"); g_hash_table_insert (monster, "available", params); MYASSERT (tp_cli_connection_interface_presence_run_set_status ( client_conn, -1, monster, &error, NULL), ""); g_assert_no_error (error); g_hash_table_unref (params); params = NULL; g_hash_table_unref (monster); monster = NULL; g_hash_table_unref (statuses); statuses = NULL; } int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsContactsConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *client_conn; guint status; gchar **interfaces; /* Setup */ tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_conn = TP_TESTS_CONTACTS_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_CONTACTS_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); client_conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (client_conn != NULL, ""); g_assert_no_error (error); /* Assert that GetInterfaces succeeds before we're CONNECTED */ MYASSERT (tp_cli_connection_run_get_interfaces (client_conn, -1, &interfaces, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_strv_contains ((const gchar * const *) interfaces, TP_IFACE_CONNECTION_INTERFACE_ALIASING), ""); MYASSERT (tp_strv_contains ((const gchar * const *) interfaces, TP_IFACE_CONNECTION_INTERFACE_AVATARS), ""); MYASSERT (tp_strv_contains ((const gchar * const *) interfaces, TP_IFACE_CONNECTION_INTERFACE_CONTACTS), ""); MYASSERT (tp_strv_contains ((const gchar * const *) interfaces, TP_IFACE_CONNECTION_INTERFACE_PRESENCE), ""); MYASSERT (tp_strv_contains ((const gchar * const *) interfaces, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE), ""); g_strfreev (interfaces); MYASSERT (tp_cli_connection_run_get_status (client_conn, -1, &status, &error, NULL), ""); g_assert_cmpuint (status, ==, (guint) TP_CONNECTION_STATUS_DISCONNECTED); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (client_conn, TRUE, &error, NULL), ""); g_assert_no_error (error); /* Tests */ test_simple_presence (service_conn, client_conn); test_complex_presence (service_conn, client_conn); /* Teardown */ tp_tests_connection_assert_disconnect_succeeds (client_conn); g_object_unref (client_conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); return 0; } telepathy-glib-0.24.2/tests/dbus/contacts-slow-path.c0000644000175000017500000013073612652510705017444 00000000000000/* Feature test for TpContact creation using a connection which doesn't * support Contacts. * Those tests are not updated any more as Contacts is now mandatory. * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" typedef struct { GMainLoop *loop; GError *error /* initialized to 0 */; GPtrArray *contacts; GArray *invalid; gchar **good_ids; GHashTable *bad_ids; } Result; typedef struct { Result result; TpBaseConnection *base_connection; TpTestsContactsConnection *legacy_service_conn; TpConnection *legacy_client_conn; TpHandleRepoIface *service_repo; } Fixture; static void reset_result (Result *result) { tp_clear_pointer (&result->invalid, g_array_unref); if (result->contacts != NULL) g_ptr_array_foreach (result->contacts, (GFunc) g_object_unref, NULL); tp_clear_pointer (&result->contacts, g_ptr_array_unref); tp_clear_pointer (&result->good_ids, g_strfreev); tp_clear_pointer (&result->bad_ids, g_hash_table_unref); g_clear_error (&result->error); } static void by_handle_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, guint n_invalid, const TpHandle *invalid, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { guint i; DEBUG ("got %u contacts and %u invalid", n_contacts, n_invalid); result->invalid = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_invalid); g_array_append_vals (result->invalid, invalid, n_invalid); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void finish (gpointer r) { Result *result = r; g_main_loop_quit (result->loop); } static void test_by_handle (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->legacy_service_conn; TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[5] = { 0, 0, 0, 0, 0 }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[4]; gpointer weak_pointers[4]; guint i; g_message (G_STRFUNC); /* arrange for some handles to exist */ handles[0] = tp_handle_ensure (service_repo, "alice", NULL, NULL); MYASSERT (handles[0] != 0, ""); handles[1] = tp_handle_ensure (service_repo, "bob", NULL, NULL); MYASSERT (handles[1] != 0, ""); /* randomly guess at a handle that shouldn't exist */ handles[2] = 31337; MYASSERT (!tp_handle_is_valid (service_repo, 31337, NULL), ""); /* another valid handle */ handles[3] = tp_handle_ensure (service_repo, "chris", NULL, NULL); MYASSERT (handles[3] != 0, ""); /* another invalid handle */ handles[4] = 12345; MYASSERT (!tp_handle_is_valid (service_repo, 12345, NULL), ""); /* Make a request for the following 5 contacts: * - alice * - bob * - invalid handle 31337 * - chris * - invalid handle 12345 */ tp_connection_get_contacts_by_handle (client_conn, 5, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 2, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); contacts[0] = g_ptr_array_index (result.contacts, 0); g_assert_cmpuint (tp_contact_get_handle (contacts[0]), ==, handles[0]); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_ptr_array_index (result.contacts, 1); g_assert_cmpuint (tp_contact_get_handle (contacts[1]), ==, handles[1]); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); contacts[3] = g_ptr_array_index (result.contacts, 2); g_assert_cmpuint (tp_contact_get_handle (contacts[3]), ==, handles[3]); g_assert_cmpstr (tp_contact_get_identifier (contacts[3]), ==, "chris"); /* clean up before doing the second request */ g_array_unref (result.invalid); result.invalid = NULL; g_ptr_array_unref (result.contacts); result.contacts = NULL; g_assert (result.error == NULL); /* Replace one of the invalid handles with a valid one */ handles[2] = tp_handle_ensure (service_repo, "dora", NULL, NULL); MYASSERT (handles[2] != 0, ""); /* Make a request for the following 4 contacts: * - alice (TpContact exists) * - bob (TpContact exists) * - dora (TpContact needs to be created) * - chris (TpContact exists) */ tp_connection_get_contacts_by_handle (client_conn, 4, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); /* assert that we got the same contacts back */ MYASSERT (result.contacts->len == 4, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); /* 0, 1 and 3 we already have a reference to */ MYASSERT (g_ptr_array_index (result.contacts, 0) == contacts[0], ""); g_object_unref (g_ptr_array_index (result.contacts, 0)); MYASSERT (g_ptr_array_index (result.contacts, 1) == contacts[1], ""); g_object_unref (g_ptr_array_index (result.contacts, 1)); MYASSERT (g_ptr_array_index (result.contacts, 3) == contacts[3], ""); g_object_unref (g_ptr_array_index (result.contacts, 3)); /* 2 we don't */ contacts[2] = g_ptr_array_index (result.contacts, 2); g_assert_cmpuint (tp_contact_get_handle (contacts[2]), ==, handles[2]); g_assert_cmpstr (tp_contact_get_identifier (contacts[2]), ==, "dora"); /* clean up refs to contacts and assert that they aren't leaked */ for (i = 0; i < 4; i++) { weak_pointers[i] = contacts[i]; g_object_add_weak_pointer ((GObject *) contacts[i],weak_pointers +i); } for (i = 0; i < 4; i++) { g_object_unref (contacts[i]); MYASSERT (weak_pointers[i] == NULL, ": %u", i); } /* wait for ReleaseHandles to run */ tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* unref all the handles we created service-side */ tp_handle_unref (service_repo, handles[0]); tp_handle_unref (service_repo, handles[1]); tp_handle_unref (service_repo, handles[2]); tp_handle_unref (service_repo, handles[3]); /* remaining cleanup */ g_main_loop_unref (result.loop); g_array_unref (result.invalid); g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } static void test_no_features (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->legacy_service_conn; TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; const gchar * const ids[] = { "alice", "bob", "chris" }; TpHandle handles[3] = { 0, 0, 0 }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; guint i; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_connection_get_contacts_by_handle (client_conn, 3, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_ptr_array_index (result.contacts, i); for (i = 0; i < 3; i++) { MYASSERT (tp_contact_get_connection (contacts[i]) == client_conn, ""); g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, tp_contact_get_identifier (contacts[i])); MYASSERT (tp_contact_get_avatar_token (contacts[i]) == NULL, ": %s", tp_contact_get_avatar_token (contacts[i])); g_assert_cmpuint (tp_contact_get_presence_type (contacts[i]), ==, TP_CONNECTION_PRESENCE_TYPE_UNSET); g_assert_cmpstr (tp_contact_get_presence_status (contacts[i]), ==, ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); } for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_main_loop_unref (result.loop); g_array_unref (result.invalid); g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } static void upgrade_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { guint i; DEBUG ("got %u contacts", n_contacts); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void test_upgrade (Fixture *f, gconstpointer mode) { TpTestsContactsConnection *service_conn = f->legacy_service_conn; TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; static const gchar * const aliases[] = { "Alice in Wonderland", "Bob the Builder", "Christopher Robin" }; static const gchar * const tokens[] = { "aaaaa", "bbbbb", "ccccc" }; static TpTestsContactsConnectionPresenceStatusIndex statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY }; static const gchar * const messages[] = { "", "Fixing it", "GON OUT BACKSON" }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE }; guint i; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_tests_contacts_connection_change_aliases (service_conn, 3, handles, aliases); tp_tests_contacts_connection_change_presences (service_conn, 3, handles, statuses, messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 3, handles, tokens); tp_connection_get_contacts_by_handle (client_conn, 3, handles, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_ptr_array_index (result.contacts, i); for (i = 0; i < 3; i++) { MYASSERT (tp_contact_get_connection (contacts[i]) == client_conn, ""); g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, tp_contact_get_identifier (contacts[i])); MYASSERT (tp_contact_get_avatar_token (contacts[i]) == NULL, ": %s", tp_contact_get_avatar_token (contacts[i])); g_assert_cmpuint (tp_contact_get_presence_type (contacts[i]), ==, TP_CONNECTION_PRESENCE_TYPE_UNSET); g_assert_cmpstr (tp_contact_get_presence_status (contacts[i]), ==, ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); } /* clean up before doing the second request */ g_array_unref (result.invalid); result.invalid = NULL; g_ptr_array_unref (result.contacts); result.contacts = NULL; g_assert (result.error == NULL); if (!tp_strdiff (mode, "old")) { tp_connection_upgrade_contacts (client_conn, 3, contacts, G_N_ELEMENTS (features), features, upgrade_cb, &result, finish, NULL); g_main_loop_run (result.loop); } else { GAsyncResult *res = NULL; tp_connection_upgrade_contacts_async (client_conn, 3, contacts, G_N_ELEMENTS (features), features, tp_tests_result_ready_cb, &res); tp_tests_run_until_result (&res); tp_connection_upgrade_contacts_finish (client_conn, res, &result.contacts, &result.error); } MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid == NULL, ""); g_assert_no_error (result.error); for (i = 0; i < 3; i++) { MYASSERT (g_ptr_array_index (result.contacts, 0) == contacts[0], ""); g_object_unref (g_ptr_array_index (result.contacts, i)); } for (i = 0; i < 3; i++) { g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, messages[i]); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "available"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "busy"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[2]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[2]), ==, "away"); for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_main_loop_unref (result.loop); g_ptr_array_unref (result.contacts); g_assert (result.invalid == NULL); g_assert (result.error == NULL); } typedef struct { gboolean alias_changed; gboolean avatar_token_changed; gboolean presence_type_changed; gboolean presence_status_changed; gboolean presence_msg_changed; } notify_ctx; static void notify_ctx_init (notify_ctx *ctx) { ctx->alias_changed = FALSE; ctx->avatar_token_changed = FALSE; ctx->presence_type_changed = FALSE; ctx->presence_status_changed = FALSE; ctx->presence_msg_changed = FALSE; } static gboolean notify_ctx_is_fully_changed (notify_ctx *ctx) { return ctx->alias_changed && ctx->avatar_token_changed && ctx->presence_type_changed && ctx->presence_status_changed && ctx->presence_msg_changed; } static gboolean notify_ctx_is_changed (notify_ctx *ctx) { return ctx->alias_changed || ctx->avatar_token_changed || ctx->presence_type_changed || ctx->presence_status_changed || ctx->presence_msg_changed; } static void contact_notify_cb (TpContact *contact, GParamSpec *param, notify_ctx *ctx) { if (!tp_strdiff (param->name, "alias")) ctx->alias_changed = TRUE; else if (!tp_strdiff (param->name, "avatar-token")) ctx->avatar_token_changed = TRUE; else if (!tp_strdiff (param->name, "presence-type")) ctx->presence_type_changed = TRUE; else if (!tp_strdiff (param->name, "presence-status")) ctx->presence_status_changed = TRUE; else if (!tp_strdiff (param->name, "presence-message")) ctx->presence_msg_changed = TRUE; } static void test_features (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpTestsContactsConnection *service_conn = f->legacy_service_conn; TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handles[] = { 0, 0, 0 }; static const gchar * const ids[] = { "alice", "bob", "chris" }; static const gchar * const aliases[] = { "Alice in Wonderland", "Bob the Builder", "Christopher Robin" }; static const gchar * const tokens[] = { "aaaaa", "bbbbb", "ccccc" }; static TpTestsContactsConnectionPresenceStatusIndex statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE, TP_TESTS_CONTACTS_CONNECTION_STATUS_BUSY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY }; static const gchar * const messages[] = { "", "Fixing it", "GON OUT BACKSON" }; static const gchar * const new_aliases[] = { "Alice [at a tea party]", "Bob the Plumber" }; static const gchar * const new_tokens[] = { "AAAA", "BBBB" }; static TpTestsContactsConnectionPresenceStatusIndex new_statuses[] = { TP_TESTS_CONTACTS_CONNECTION_STATUS_AWAY, TP_TESTS_CONTACTS_CONNECTION_STATUS_AVAILABLE }; static const gchar * const new_messages[] = { "At the Mad Hatter's", "It'll cost you" }; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( (TpBaseConnection *) service_conn, TP_HANDLE_TYPE_CONTACT); TpContact *contacts[3]; TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE }; guint i; struct { TpConnection *connection; TpHandle handle; gchar *identifier; gchar *alias; gchar *avatar_token; TpConnectionPresenceType presence_type; gchar *presence_status; gchar *presence_message; } from_gobject; notify_ctx notify_ctx_alice, notify_ctx_chris; g_message (G_STRFUNC); for (i = 0; i < 3; i++) handles[i] = tp_handle_ensure (service_repo, ids[i], NULL, NULL); tp_tests_contacts_connection_change_aliases (service_conn, 3, handles, aliases); tp_tests_contacts_connection_change_presences (service_conn, 3, handles, statuses, messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 3, handles, tokens); tp_connection_get_contacts_by_handle (client_conn, 3, handles, G_N_ELEMENTS (features), features, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (result.invalid->len == 0, ": %u", result.invalid->len); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); for (i = 0; i < 3; i++) contacts[i] = g_ptr_array_index (result.contacts, i); for (i = 0; i < 3; i++) { g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, messages[i]); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "available"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_BUSY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "busy"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[2]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[2]), ==, "away"); /* exercise GObject properties in a basic way */ g_object_get (contacts[0], "connection", &from_gobject.connection, "handle", &from_gobject.handle, "identifier", &from_gobject.identifier, "alias", &from_gobject.alias, "avatar-token", &from_gobject.avatar_token, "presence-type", &from_gobject.presence_type, "presence-status", &from_gobject.presence_status, "presence-message", &from_gobject.presence_message, NULL); MYASSERT (from_gobject.connection == client_conn, ""); g_assert_cmpuint (from_gobject.handle, ==, handles[0]); g_assert_cmpstr (from_gobject.identifier, ==, "alice"); g_assert_cmpstr (from_gobject.alias, ==, "Alice in Wonderland"); g_assert_cmpstr (from_gobject.avatar_token, ==, "aaaaa"); g_assert_cmpuint (from_gobject.presence_type, ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (from_gobject.presence_status, ==, "available"); g_assert_cmpstr (from_gobject.presence_message, ==, ""); g_object_unref (from_gobject.connection); g_free (from_gobject.identifier); g_free (from_gobject.alias); g_free (from_gobject.avatar_token); g_free (from_gobject.presence_status); g_free (from_gobject.presence_message); notify_ctx_init (¬ify_ctx_alice); g_signal_connect (contacts[0], "notify", G_CALLBACK (contact_notify_cb), ¬ify_ctx_alice); notify_ctx_init (¬ify_ctx_chris); g_signal_connect (contacts[2], "notify", G_CALLBACK (contact_notify_cb), ¬ify_ctx_chris); /* Change Alice and Bob's contact info, leave Chris as-is */ tp_tests_contacts_connection_change_aliases (service_conn, 2, handles, new_aliases); tp_tests_contacts_connection_change_presences (service_conn, 2, handles, new_statuses, new_messages); tp_tests_contacts_connection_change_avatar_tokens (service_conn, 2, handles, new_tokens); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); g_assert (notify_ctx_is_fully_changed (¬ify_ctx_alice)); g_assert (!notify_ctx_is_changed (¬ify_ctx_chris)); for (i = 0; i < 2; i++) { g_assert_cmpuint (tp_contact_get_handle (contacts[i]), ==, handles[i]); g_assert_cmpstr (tp_contact_get_identifier (contacts[i]), ==, ids[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_ALIAS), ""); g_assert_cmpstr (tp_contact_get_alias (contacts[i]), ==, new_aliases[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_AVATAR_TOKEN), ""); g_assert_cmpstr (tp_contact_get_avatar_token (contacts[i]), ==, new_tokens[i]); MYASSERT (tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_PRESENCE), ""); g_assert_cmpstr (tp_contact_get_presence_message (contacts[i]), ==, new_messages[i]); MYASSERT (!tp_contact_has_feature (contacts[i], TP_CONTACT_FEATURE_LOCATION), ""); } g_assert_cmpuint (tp_contact_get_presence_type (contacts[0]), ==, TP_CONNECTION_PRESENCE_TYPE_AWAY); g_assert_cmpstr (tp_contact_get_presence_status (contacts[0]), ==, "away"); g_assert_cmpuint (tp_contact_get_presence_type (contacts[1]), ==, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE); g_assert_cmpstr (tp_contact_get_presence_status (contacts[1]), ==, "available"); for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); tp_tests_proxy_run_until_dbus_queue_processed (client_conn); tp_handle_unref (service_repo, handles[i]); } /* remaining cleanup */ g_main_loop_unref (result.loop); g_array_unref (result.invalid); g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } static void by_id_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *good_ids, GHashTable *bad_ids, const GError *error, gpointer user_data, GObject *weak_object) { Result *result = user_data; g_assert (result->invalid == NULL); g_assert (result->contacts == NULL); g_assert (result->error == NULL); g_assert (result->good_ids == NULL); g_assert (result->bad_ids == NULL); if (error == NULL) { GHashTableIter iter; gpointer key, value; guint i; DEBUG ("got %u contacts and %u bad IDs", n_contacts, g_hash_table_size (bad_ids)); result->bad_ids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_error_free); tp_g_hash_table_update (result->bad_ids, bad_ids, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) g_error_copy); g_hash_table_iter_init (&iter, result->bad_ids); while (g_hash_table_iter_next (&iter, &key, &value)) { gchar *id = key; GError *e = value; DEBUG ("bad ID %s: %s %u: %s", id, g_quark_to_string (e->domain), e->code, e->message); } result->good_ids = g_strdupv ((GStrv) good_ids); result->contacts = g_ptr_array_sized_new (n_contacts); for (i = 0; i < n_contacts; i++) { TpContact *contact = contacts[i]; DEBUG ("contact #%u: %p", i, contact); DEBUG ("contact #%u we asked for ID %s", i, good_ids[i]); DEBUG ("contact #%u we got ID %s", i, tp_contact_get_identifier (contact)); DEBUG ("contact #%u alias: %s", i, tp_contact_get_alias (contact)); DEBUG ("contact #%u avatar token: %s", i, tp_contact_get_avatar_token (contact)); DEBUG ("contact #%u presence type: %u", i, tp_contact_get_presence_type (contact)); DEBUG ("contact #%u presence status: %s", i, tp_contact_get_presence_status (contact)); DEBUG ("contact #%u presence message: %s", i, tp_contact_get_presence_message (contact)); g_ptr_array_add (result->contacts, g_object_ref (contact)); } } else { DEBUG ("got an error: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); result->error = g_error_copy (error); } } static void test_by_id (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpConnection *client_conn = f->legacy_client_conn; Result result = { g_main_loop_new (NULL, FALSE) }; static const gchar * const ids[] = { "Alice", "Bob", "Not valid", "Chris", "not valid either", NULL }; TpContact *contacts[3]; guint i; GError *e /* no initialization needed */; g_message ("%s: all bad (fd.o #19688)", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 1, ids + 2, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 0, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 1, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); e = g_hash_table_lookup (result.bad_ids, "Not valid"); MYASSERT (e != NULL, ""); g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; g_message ("%s: all good", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 2, ids, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 2, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 0, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); contacts[0] = g_ptr_array_index (result.contacts, 0); g_assert_cmpstr (result.good_ids[0], ==, "Alice"); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_ptr_array_index (result.contacts, 1); g_assert_cmpstr (result.good_ids[1], ==, "Bob"); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); for (i = 0; i < 2; i++) { g_object_unref (contacts[i]); } g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; g_message ("%s: not all good", G_STRFUNC); tp_connection_get_contacts_by_id (client_conn, 5, ids, 0, NULL, by_id_cb, &result, finish, NULL); g_main_loop_run (result.loop); MYASSERT (result.contacts->len == 3, ": %u", result.contacts->len); MYASSERT (g_hash_table_size (result.bad_ids) == 2, ": %u", g_hash_table_size (result.bad_ids)); g_assert_no_error (result.error); e = g_hash_table_lookup (result.bad_ids, "Not valid"); MYASSERT (e != NULL, ""); e = g_hash_table_lookup (result.bad_ids, "not valid either"); MYASSERT (e != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 0) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 1) != NULL, ""); MYASSERT (g_ptr_array_index (result.contacts, 2) != NULL, ""); contacts[0] = g_ptr_array_index (result.contacts, 0); g_assert_cmpstr (result.good_ids[0], ==, "Alice"); g_assert_cmpstr (tp_contact_get_identifier (contacts[0]), ==, "alice"); contacts[1] = g_ptr_array_index (result.contacts, 1); g_assert_cmpstr (result.good_ids[1], ==, "Bob"); g_assert_cmpstr (tp_contact_get_identifier (contacts[1]), ==, "bob"); contacts[2] = g_ptr_array_index (result.contacts, 2); g_assert_cmpstr (result.good_ids[2], ==, "Chris"); g_assert_cmpstr (tp_contact_get_identifier (contacts[2]), ==, "chris"); /* clean up refs to contacts */ for (i = 0; i < 3; i++) { g_object_unref (contacts[i]); } /* wait for ReleaseHandles to run */ tp_tests_proxy_run_until_dbus_queue_processed (client_conn); /* remaining cleanup */ g_main_loop_unref (result.loop); g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; } static void test_one_by_id (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { GAsyncResult *result = NULL; GError *error = NULL; TpContact *contact; tp_connection_dup_contact_by_id_async (f->legacy_client_conn, "Alice", 0, NULL, tp_tests_result_ready_cb, &result); tp_tests_run_until_result (&result); contact = tp_connection_dup_contact_by_id_finish (f->legacy_client_conn, result, &error); g_assert_no_error (error); g_assert (TP_IS_CONTACT (contact)); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alice"); g_clear_object (&result); g_clear_object (&contact); } static void test_by_handle_again (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handle; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( f->base_connection, TP_HANDLE_TYPE_CONTACT); TpContact *contact; gpointer weak_pointer; const gchar *alias = "Alice in Wonderland"; TpContactFeature feature = TP_CONTACT_FEATURE_ALIAS; gboolean ok; g_test_bug ("25181"); handle = tp_handle_ensure (service_repo, "alice", NULL, NULL); g_assert_cmpuint (handle, !=, 0); tp_tests_contacts_connection_change_aliases (f->legacy_service_conn, 1, &handle, &alias); tp_connection_get_contacts_by_handle (f->legacy_client_conn, 1, &handle, 1, &feature, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alice"); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); /* clean up before doing the second request */ reset_result (&result); g_assert (result.error == NULL); /* silently remove the object from D-Bus, so that if the second request * makes any D-Bus calls, it will fail (but the client conn isn't * invalidated) */ tp_dbus_daemon_unregister_object ( tp_base_connection_get_dbus_daemon (f->base_connection), f->base_connection); /* check that that worked */ ok = tp_cli_connection_run_get_self_handle (f->legacy_client_conn, -1, NULL, &result.error, NULL); g_assert_error (result.error, DBUS_GERROR, DBUS_GERROR_UNKNOWN_METHOD); g_assert (!ok); g_clear_error (&result.error); tp_connection_get_contacts_by_handle (f->legacy_client_conn, 1, &handle, 1, &feature, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) == contact); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); /* OK, put it back so teardown() can use it */ tp_dbus_daemon_register_object ( tp_base_connection_get_dbus_daemon (f->base_connection), tp_base_connection_get_object_path (f->base_connection), f->base_connection); /* check that *that* worked */ ok = tp_cli_connection_run_get_self_handle (f->legacy_client_conn, -1, NULL, &result.error, NULL); g_assert_no_error (result.error); g_assert (ok); g_assert (result.error == NULL); reset_result (&result); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); tp_tests_proxy_run_until_dbus_queue_processed (f->legacy_client_conn); g_main_loop_unref (result.loop); } static void test_by_handle_upgrade (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { Result result = { g_main_loop_new (NULL, FALSE), NULL, NULL, NULL }; TpHandle handle; TpHandleRepoIface *service_repo = tp_base_connection_get_handles ( f->base_connection, TP_HANDLE_TYPE_CONTACT); TpContact *contact; gpointer weak_pointer; const gchar *alias = "Alice in Wonderland"; TpContactFeature feature = TP_CONTACT_FEATURE_ALIAS; g_test_bug ("32191"); handle = tp_handle_ensure (service_repo, "alice", NULL, NULL); g_assert_cmpuint (handle, !=, 0); tp_tests_contacts_connection_change_aliases (f->legacy_service_conn, 1, &handle, &alias); tp_connection_get_contacts_by_handle (f->legacy_client_conn, 1, &handle, 0, NULL, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) != NULL); contact = g_object_ref (g_ptr_array_index (result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (contact), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (contact), ==, "alice"); /* fallback alias is still in effect */ g_assert_cmpstr (tp_contact_get_alias (contact), ==, "alice"); /* clean up before doing the second request */ reset_result (&result); g_assert (result.error == NULL); /* the second request enables the Alias feature, so it must make more D-Bus * round trips */ tp_connection_get_contacts_by_handle (f->legacy_client_conn, 1, &handle, 1, &feature, by_handle_cb, &result, finish, NULL); g_main_loop_run (result.loop); g_assert_cmpuint (result.contacts->len, ==, 1); g_assert_cmpuint (result.invalid->len, ==, 0); g_assert_no_error (result.error); g_assert (g_ptr_array_index (result.contacts, 0) == contact); g_assert_cmpstr (tp_contact_get_alias (contact), ==, "Alice in Wonderland"); g_assert (result.error == NULL); reset_result (&result); weak_pointer = contact; g_object_add_weak_pointer ((GObject *) contact, &weak_pointer); g_object_unref (contact); g_assert (weak_pointer == NULL); tp_tests_proxy_run_until_dbus_queue_processed (f->legacy_client_conn); g_main_loop_unref (result.loop); } static void test_dup_if_possible (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle alice_handle, bob_handle; TpContact *alice; TpContact *contact; alice_handle = tp_handle_ensure (f->service_repo, "alice", NULL, NULL); g_assert_cmpuint (alice_handle, !=, 0); bob_handle = tp_handle_ensure (f->service_repo, "bob", NULL, NULL); g_assert_cmpuint (bob_handle, !=, 0); tp_connection_get_contacts_by_handle (f->legacy_client_conn, 1, &alice_handle, 0, NULL, by_handle_cb, &f->result, finish, NULL); g_main_loop_run (f->result.loop); g_assert_cmpuint (f->result.contacts->len, ==, 1); g_assert_cmpuint (f->result.invalid->len, ==, 0); g_assert_no_error (f->result.error); g_assert (g_ptr_array_index (f->result.contacts, 0) != NULL); alice = g_object_ref (g_ptr_array_index (f->result.contacts, 0)); g_assert_cmpuint (tp_contact_get_handle (alice), ==, alice_handle); g_assert_cmpstr (tp_contact_get_identifier (alice), ==, "alice"); reset_result (&f->result); /* we already have a cached TpContact for Alice, so we can get another * copy of it synchronously */ contact = tp_connection_dup_contact_if_possible (f->legacy_client_conn, alice_handle, "alice"); g_assert (contact == alice); g_object_unref (contact); contact = tp_connection_dup_contact_if_possible (f->legacy_client_conn, alice_handle, NULL); g_assert (contact == alice); g_object_unref (contact); /* because this connection pretends not to have immortal handles, we can't * reliably get a contact for Bob synchronously, even if we supply his * identifier */ contact = tp_connection_dup_contact_if_possible (f->legacy_client_conn, bob_handle, "bob"); g_assert (contact == NULL); contact = tp_connection_dup_contact_if_possible (f->legacy_client_conn, bob_handle, NULL); g_assert (contact == NULL); } static void setup (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { tp_tests_create_and_connect_conn (TP_TESTS_TYPE_LEGACY_CONTACTS_CONNECTION, "me@test.com", &f->base_connection, &f->legacy_client_conn); f->legacy_service_conn = g_object_ref (TP_TESTS_CONTACTS_CONNECTION ( f->base_connection)); f->service_repo = tp_base_connection_get_handles (f->base_connection, TP_HANDLE_TYPE_CONTACT); f->result.loop = g_main_loop_new (NULL, FALSE); } static void teardown (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { if (f->legacy_client_conn != NULL) tp_tests_connection_assert_disconnect_succeeds (f->legacy_client_conn); f->service_repo = NULL; tp_clear_object (&f->legacy_client_conn); tp_clear_object (&f->legacy_service_conn); tp_clear_object (&f->base_connection); reset_result (&f->result); tp_clear_pointer (&f->result.loop, g_main_loop_unref); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/contacts-slow-path/by-handle", Fixture, NULL, setup, test_by_handle, teardown); g_test_add ("/contacts-slow-path/no-features", Fixture, NULL, setup, test_no_features, teardown); g_test_add ("/contacts-slow-path/features", Fixture, NULL, setup, test_features, teardown); g_test_add ("/contacts-slow-path/upgrade/old", Fixture, "old", setup, test_upgrade, teardown); g_test_add ("/contacts-slow-path/upgrade", Fixture, "async", setup, test_upgrade, teardown); g_test_add ("/contacts-slow-path/by-id", Fixture, NULL, setup, test_by_id, teardown); g_test_add ("/contacts-slow-path/by-handle-again", Fixture, NULL, setup, test_by_handle_again, teardown); g_test_add ("/contacts-slow-path/by-handle-upgrade", Fixture, NULL, setup, test_by_handle_upgrade, teardown); g_test_add ("/contacts-slow-path/dup-if-possible", Fixture, NULL, setup, test_dup_if_possible, teardown); g_test_add ("/contacts-slow-path/one-by-id", Fixture, NULL, setup, test_one_by_id, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/invalidated-while-invoking-signals.c0000644000175000017500000000557412652510705022565 00000000000000/* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=14854 * (the original bug involved a TpChannel, but the principle is the same) * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" static GMainLoop *mainloop; static void on_status_changed (TpConnection *connection, guint status, guint reason, gpointer user_data, GObject *weak_object) { TpConnection **client = user_data; MYASSERT (status == TP_CONNECTION_STATUS_DISCONNECTED, "%u", status); MYASSERT (*client == connection, "%p vs %p", *client, connection); g_object_unref (*client); *client = NULL; } static gboolean disconnect (gpointer data) { tp_tests_simple_connection_inject_disconnect (data); return FALSE; } static void on_shutdown_finished (TpBaseConnection *base_conn, gpointer user_data) { g_main_loop_quit (mainloop); } int main (int argc, char **argv) { TpTestsSimpleConnection *service; TpBaseConnection *service_as_base; TpDBusDaemon *dbus; TpConnection *client; GError *error = NULL; gchar *name; gchar *path; tp_tests_abort_after (10); tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus = tp_tests_dbus_daemon_dup_or_die (); service = TP_TESTS_SIMPLE_CONNECTION (tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_as_base = TP_BASE_CONNECTION (service); MYASSERT (service != NULL, ""); MYASSERT (service_as_base != NULL, ""); g_signal_connect (service, "shutdown-finished", G_CALLBACK (on_shutdown_finished), NULL); MYASSERT (tp_base_connection_register (service_as_base, "simple", &name, &path, &error), ""); g_assert_no_error (error); client = tp_connection_new (dbus, name, path, &error); MYASSERT (client != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (client, TRUE, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_cli_connection_connect_to_status_changed (client, on_status_changed, &client, NULL, NULL, NULL), ""); g_idle_add (disconnect, service); g_main_loop_run (mainloop); g_message ("Cleaning up"); service_as_base = NULL; g_object_unref (service); g_object_unref (dbus); g_main_loop_unref (mainloop); g_free (name); g_free (path); return 0; } telepathy-glib-0.24.2/tests/dbus/with-properties.xml0000644000175000017500000000151712652510705017427 00000000000000 Something with properties telepathy-glib-0.24.2/tests/dbus/connection.c0000644000175000017500000003362312652510705016046 00000000000000/* Feature test for https://bugs.freedesktop.org/show_bug.cgi?id=15300 * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/simple-conn.h" #include "tests/lib/util.h" typedef struct { TpDBusDaemon *dbus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *conn_name; gchar *conn_path; TpConnection *conn; gboolean cwr_ready; GError *cwr_error /* initialized in setup */; GAsyncResult *prepare_result; } Test; static GError invalidated_for_test = { 0, TP_ERROR_PERMISSION_DENIED, "No connection for you!" }; static void connection_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { Test *test = user_data; g_message ("%p prepared", object); g_assert (test->prepare_result == NULL); test->prepare_result = g_object_ref (res); } static void setup (Test *test, gconstpointer data) { GError *error = NULL; invalidated_for_test.domain = TP_ERROR; tp_debug_set_flags ("all"); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->service_conn = TP_TESTS_SIMPLE_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple-protocol", NULL)); test->service_conn_as_base = TP_BASE_CONNECTION (test->service_conn); g_assert (test->service_conn != NULL); g_assert (test->service_conn_as_base != NULL); g_assert (tp_base_connection_register (test->service_conn_as_base, "simple", &test->conn_name, &test->conn_path, &error)); g_assert_no_error (error); test->cwr_ready = FALSE; test->cwr_error = NULL; } static void teardown (Test *test, gconstpointer data) { TpConnection *conn; GError *error = NULL; if (test->conn != NULL) { g_object_unref (test->conn); test->conn = NULL; } /* disconnect the connection so we don't leak it */ conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (conn != NULL); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); g_assert (!tp_connection_run_until_ready (conn, FALSE, &error, NULL)); g_assert_error (error, TP_ERROR, TP_ERROR_CANCELLED); g_clear_error (&error); test->service_conn_as_base = NULL; g_object_unref (test->service_conn); g_free (test->conn_name); g_free (test->conn_path); g_object_unref (test->dbus); test->dbus = NULL; } static void test_run_until_invalid (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_proxy_invalidate ((TpProxy *) test->conn, &invalidated_for_test); MYASSERT (!tp_connection_run_until_ready (test->conn, TRUE, &error, NULL), ""); g_assert (error != NULL); g_assert_error (error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (error->message, ==, invalidated_for_test.message); g_error_free (error); } static void test_run_until_ready (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (test->conn, TRUE, &error, NULL), ""); g_assert_no_error (error); } static void conn_ready (TpConnection *connection, const GError *error, gpointer user_data) { Test *test = user_data; test->cwr_ready = TRUE; if (error == NULL) { gboolean parsed; gchar *proto = NULL; gchar *cm_name = NULL; g_message ("connection %p ready", connection); parsed = tp_connection_parse_object_path (connection, &proto, &cm_name); g_assert (parsed); g_assert_cmpstr (proto, ==, "simple-protocol"); g_assert_cmpstr (cm_name, ==, "simple"); g_free (proto); g_free (cm_name); } else { g_message ("connection %p invalidated: %s #%u \"%s\"", connection, g_quark_to_string (error->domain), error->code, error->message); test->cwr_error = g_error_copy (error); } } static void test_prepare (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, TP_CONNECTION_FEATURE_CAPABILITIES, 0 }; TpConnectionStatusReason reason; TpCapabilities *caps; GPtrArray *classes; gchar *cm_name, *protocol_name; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); tp_proxy_prepare_async (test->conn, NULL, connection_prepared_cb, test); /* this is not synchronous */ g_assert (test->prepare_result == NULL); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); while (test->prepare_result == NULL) g_main_context_iteration (NULL, TRUE); g_assert (tp_proxy_prepare_finish (test->conn, test->prepare_result, &error)); g_assert_no_error (error); g_object_unref (test->prepare_result); test->prepare_result = NULL; g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); g_assert_cmpuint (tp_connection_get_self_handle (test->conn), ==, 0); g_assert_cmpint (tp_connection_get_status (test->conn, NULL), ==, TP_CONNECTION_STATUS_DISCONNECTED); g_assert_cmpstr (tp_connection_get_cm_name (test->conn), ==, "simple"); g_assert_cmpstr (tp_connection_get_protocol_name (test->conn), ==, "simple-protocol"); g_object_get (test->conn, "cm-name", &cm_name, "protocol-name", &protocol_name, NULL); g_assert_cmpstr (cm_name, ==, "simple"); g_assert_cmpstr (protocol_name, ==, "simple-protocol"); g_free (cm_name); g_free (protocol_name); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); tp_proxy_prepare_async (test->conn, features, connection_prepared_cb, test); while (test->prepare_result == NULL) g_main_context_iteration (NULL, TRUE); g_assert (tp_proxy_prepare_finish (test->conn, test->prepare_result, &error)); g_assert_no_error (error); g_object_unref (test->prepare_result); test->prepare_result = NULL; g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); g_assert (tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CAPABILITIES)); g_assert_cmpuint (tp_connection_get_self_handle (test->conn), !=, 0); g_assert_cmpint (tp_connection_get_status (test->conn, &reason), ==, TP_CONNECTION_STATUS_CONNECTED); g_assert_cmpint (reason, ==, TP_CONNECTION_STATUS_REASON_REQUESTED); caps = tp_connection_get_capabilities (test->conn); g_assert (caps != NULL); classes = tp_capabilities_get_channel_classes (caps); g_assert (classes != NULL); g_assert_cmpint (classes->len, ==, 0); } static void test_fail_to_prepare (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; const GHashTable *asv; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); tp_proxy_prepare_async (test->conn, NULL, connection_prepared_cb, test); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); tp_proxy_invalidate ((TpProxy *) test->conn, &invalidated_for_test); /* this is not synchronous */ g_assert (test->prepare_result == NULL); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); while (test->prepare_result == NULL) g_main_context_iteration (NULL, TRUE); g_assert (!tp_proxy_prepare_finish (test->conn, test->prepare_result, &error)); g_assert_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED); g_clear_error (&error); g_object_unref (test->prepare_result); test->prepare_result = NULL; g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); /* it's not synchronous even if we were already invalidated */ tp_proxy_prepare_async (test->conn, features, connection_prepared_cb, test); g_assert (test->prepare_result == NULL); while (test->prepare_result == NULL) g_main_context_iteration (NULL, TRUE); g_assert (!tp_proxy_prepare_finish (test->conn, test->prepare_result, &error)); g_assert_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED); g_clear_error (&error); g_object_unref (test->prepare_result); test->prepare_result = NULL; g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CORE)); g_assert (!tp_proxy_is_prepared (test->conn, TP_CONNECTION_FEATURE_CONNECTED)); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, NULL), ==, TP_ERROR_STR_PERMISSION_DENIED); g_assert_cmpstr (tp_connection_get_detailed_error (test->conn, &asv), ==, TP_ERROR_STR_PERMISSION_DENIED); g_assert (asv != NULL); } static void test_call_when_ready (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_cli_connection_call_connect (test->conn, -1, NULL, NULL, NULL, NULL); tp_connection_call_when_ready (test->conn, conn_ready, test); while (!test->cwr_ready) g_main_context_iteration (NULL, TRUE); g_assert_no_error (test->cwr_error); /* Connection already ready here, so we are called back synchronously */ test->cwr_ready = FALSE; test->cwr_error = NULL; tp_connection_call_when_ready (test->conn, conn_ready, test); g_assert_cmpint (test->cwr_ready, ==, TRUE); g_assert_no_error (test->cwr_error); } static void test_call_when_invalid (Test *test, gconstpointer nil G_GNUC_UNUSED) { GError *error = NULL; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); /* Connection becomes invalid, so we are called back synchronously */ tp_connection_call_when_ready (test->conn, conn_ready, test); tp_proxy_invalidate ((TpProxy *) test->conn, &invalidated_for_test); g_assert_cmpint (test->cwr_ready, ==, TRUE); g_assert_error (test->cwr_error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (test->cwr_error->message, ==, invalidated_for_test.message); g_clear_error (&test->cwr_error); /* Connection already invalid, so we are called back synchronously */ test->cwr_ready = FALSE; test->cwr_error = NULL; tp_connection_call_when_ready (test->conn, conn_ready, test); g_assert (test->cwr_ready); g_assert_error (test->cwr_error, invalidated_for_test.domain, invalidated_for_test.code); g_assert_cmpstr (test->cwr_error->message, ==, invalidated_for_test.message); g_error_free (test->cwr_error); test->cwr_error = NULL; } static void test_object_path (Test *test, gconstpointer nil G_GNUC_UNUSED) { const gchar *invalid_path = TP_CONN_OBJECT_PATH_BASE "invalid"; const gchar *invalid_name = TP_CONN_BUS_NAME_BASE "invalid"; TpConnection *connection; GError *error = NULL; test->conn = tp_connection_new (test->dbus, test->conn_name, test->conn_path, &error); g_assert (test->conn != NULL); g_assert_no_error (error); tp_tests_proxy_run_until_prepared (test->conn, NULL); g_assert_cmpstr (tp_connection_get_cm_name (test->conn), ==, "simple"); g_assert_cmpstr (tp_connection_get_protocol_name (test->conn), ==, "simple-protocol"); /* Register the same connection with an invalid object path */ tp_dbus_daemon_register_object (test->dbus, invalid_path, test->service_conn); tp_dbus_daemon_request_name (test->dbus, invalid_name, FALSE, &error); g_assert_no_error (error); /* Create a TpConnection for that path, it return invalidated connection */ connection = tp_connection_new (test->dbus, NULL, invalid_path, &error); g_assert (connection == NULL); g_assert_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH); g_clear_error (&error); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_add ("/conn/prepare", Test, NULL, setup, test_prepare, teardown); g_test_add ("/conn/fail_to_prepare", Test, NULL, setup, test_fail_to_prepare, teardown); g_test_add ("/conn/run_until_invalid", Test, NULL, setup, test_run_until_invalid, teardown); g_test_add ("/conn/run_until_ready", Test, NULL, setup, test_run_until_ready, teardown); g_test_add ("/conn/call_when_ready", Test, NULL, setup, test_call_when_ready, teardown); g_test_add ("/conn/call_when_invalid", Test, NULL, setup, test_call_when_invalid, teardown); g_test_add ("/conn/object_path", Test, NULL, setup, test_object_path, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/self-handle.c0000644000175000017500000003137612652510705016074 00000000000000/* Feature test for the user's self-handle/self-contact changing. * * Copyright (C) 2009-2010 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/contacts-conn.h" #include "tests/lib/debug.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" typedef struct { TpDBusDaemon *dbus; TpTestsSimpleConnection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error /* zero-initialized */; TpConnection *client_conn; TpHandleRepoIface *contact_repo; GAsyncResult *result; } Fixture; static void setup (Fixture *f, gconstpointer arg) { gboolean ok; f->dbus = tp_tests_dbus_daemon_dup_or_die (); f->service_conn = TP_TESTS_SIMPLE_CONNECTION ( tp_tests_object_new_static_class (TP_TESTS_TYPE_SIMPLE_CONNECTION, "account", "me@example.com", "protocol", "simple", "break-0192-properties", (!tp_strdiff (arg, "archaic")), NULL)); f->service_conn_as_base = TP_BASE_CONNECTION (f->service_conn); g_object_ref (f->service_conn_as_base); g_assert (f->service_conn != NULL); g_assert (f->service_conn_as_base != NULL); f->contact_repo = tp_base_connection_get_handles (f->service_conn_as_base, TP_HANDLE_TYPE_CONTACT); ok = tp_base_connection_register (f->service_conn_as_base, "simple", &f->name, &f->conn_path, &f->error); g_assert_no_error (f->error); g_assert (ok); f->client_conn = tp_connection_new (f->dbus, f->name, f->conn_path, &f->error); g_assert_no_error (f->error); g_assert (f->client_conn != NULL); } static void setup_and_connect (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { gboolean ok; setup (f, unused); ok = tp_connection_run_until_ready (f->client_conn, TRUE, &f->error, NULL); g_assert_no_error (f->error); g_assert (ok); } /* we'll get more arguments, but just ignore them */ static void swapped_counter_cb (gpointer user_data) { guint *times = user_data; ++*times; } static void test_self_handle (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle handle; TpContact *before, *after; guint handle_times = 0, contact_times = 0; g_signal_connect_swapped (f->client_conn, "notify::self-handle", G_CALLBACK (swapped_counter_cb), &handle_times); g_signal_connect_swapped (f->client_conn, "notify::self-contact", G_CALLBACK (swapped_counter_cb), &contact_times); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "me@example.com"); g_assert_cmpuint (tp_connection_get_self_handle (f->client_conn), ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_object_get (f->client_conn, "self-handle", &handle, "self-contact", &before, NULL); g_assert_cmpuint (handle, ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_assert_cmpuint (tp_contact_get_handle (before), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (before), ==, "me@example.com"); g_assert_cmpuint (handle_times, ==, 0); g_assert_cmpuint (contact_times, ==, 0); /* similar to /nick in IRC */ tp_tests_simple_connection_set_identifier (f->service_conn, "myself@example.org"); tp_tests_proxy_run_until_dbus_queue_processed (f->client_conn); while (handle_times < 1 || contact_times < 1) g_main_context_iteration (NULL, TRUE); g_assert_cmpuint (handle_times, ==, 1); g_assert_cmpuint (contact_times, ==, 1); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "myself@example.org"); g_assert_cmpuint (tp_connection_get_self_handle (f->client_conn), ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_object_get (f->client_conn, "self-handle", &handle, "self-contact", &after, NULL); g_assert (before != after); g_assert_cmpuint (handle, ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_assert_cmpuint (tp_contact_get_handle (after), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (after), ==, "myself@example.org"); g_object_unref (before); g_object_unref (after); } static void test_change_early (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { TpHandle handle; TpContact *after; guint handle_times = 0, contact_times = 0; gboolean ok; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; g_signal_connect_swapped (f->client_conn, "notify::self-handle", G_CALLBACK (swapped_counter_cb), &handle_times); g_signal_connect_swapped (f->client_conn, "notify::self-contact", G_CALLBACK (swapped_counter_cb), &contact_times); tp_proxy_prepare_async (f->client_conn, features, tp_tests_result_ready_cb, &f->result); g_assert (f->result == NULL); /* act as though someone else called Connect; emit signals in quick * succession, so that by the time the TpConnection tries to investigate * the self-handle, it has already changed */ tp_base_connection_change_status (f->service_conn_as_base, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED); tp_tests_simple_connection_set_identifier (f->service_conn, "me@example.com"); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "me@example.com"); tp_base_connection_change_status (f->service_conn_as_base, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); tp_tests_simple_connection_set_identifier (f->service_conn, "myself@example.org"); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "myself@example.org"); /* now run the main loop and let the client catch up */ tp_tests_run_until_result (&f->result); ok = tp_proxy_prepare_finish (f->client_conn, f->result, &f->error); g_assert_no_error (f->error); g_assert (ok); /* the self-handle and self-contact change once during connection */ g_assert_cmpuint (handle_times, ==, 1); g_assert_cmpuint (contact_times, ==, 1); g_assert_cmpuint (tp_connection_get_self_handle (f->client_conn), ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_object_get (f->client_conn, "self-handle", &handle, "self-contact", &after, NULL); g_assert_cmpuint (handle, ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_assert_cmpuint (tp_contact_get_handle (after), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (after), ==, "myself@example.org"); g_object_unref (after); } static void test_change_inconveniently (Fixture *f, gconstpointer arg) { TpHandle handle; TpContact *after; guint handle_times = 0, contact_times = 0, got_self_handle_times = 0; guint got_all_times = 0; gboolean ok; GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; g_signal_connect_swapped (f->client_conn, "notify::self-handle", G_CALLBACK (swapped_counter_cb), &handle_times); g_signal_connect_swapped (f->client_conn, "notify::self-contact", G_CALLBACK (swapped_counter_cb), &contact_times); if (!tp_strdiff (arg, "archaic")) { g_signal_connect_swapped (f->service_conn, "got-self-handle", G_CALLBACK (swapped_counter_cb), &got_self_handle_times); } else { g_signal_connect_swapped (f->service_conn, "got-all::" TP_IFACE_CONNECTION, G_CALLBACK (swapped_counter_cb), &got_all_times); } tp_proxy_prepare_async (f->client_conn, features, tp_tests_result_ready_cb, &f->result); g_assert (f->result == NULL); /* act as though someone else called Connect */ tp_base_connection_change_status (f->service_conn_as_base, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED); tp_tests_simple_connection_set_identifier (f->service_conn, "me@example.com"); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "me@example.com"); tp_base_connection_change_status (f->service_conn_as_base, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); /* run the main loop until just after GetSelfHandle or GetAll(Connection) * is processed, to make sure the client first saw the old self handle */ while (got_self_handle_times == 0 && got_all_times == 0) g_main_context_iteration (NULL, TRUE); DEBUG ("changing my own identifier to something else"); tp_tests_simple_connection_set_identifier (f->service_conn, "myself@example.org"); g_assert_cmpstr (tp_handle_inspect (f->contact_repo, tp_base_connection_get_self_handle (f->service_conn_as_base)), ==, "myself@example.org"); /* now run the main loop and let the client catch up */ tp_tests_run_until_result (&f->result); ok = tp_proxy_prepare_finish (f->client_conn, f->result, &f->error); g_assert_no_error (f->error); g_assert (ok); /* the self-handle and self-contact change once during connection */ g_assert_cmpuint (handle_times, ==, 1); g_assert_cmpuint (contact_times, ==, 1); g_assert_cmpuint (tp_connection_get_self_handle (f->client_conn), ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_object_get (f->client_conn, "self-handle", &handle, "self-contact", &after, NULL); g_assert_cmpuint (handle, ==, tp_base_connection_get_self_handle (f->service_conn_as_base)); g_assert_cmpuint (tp_contact_get_handle (after), ==, handle); g_assert_cmpstr (tp_contact_get_identifier (after), ==, "myself@example.org"); g_object_unref (after); } static void test_self_handle_fails (Fixture *f, gconstpointer arg) { GQuark features[] = { TP_CONNECTION_FEATURE_CONNECTED, 0 }; gboolean ok; /* This test assumes that spec 0.19.2 properties are unsupported. */ g_assert_cmpstr (arg, ==, "archaic"); tp_proxy_prepare_async (f->client_conn, features, tp_tests_result_ready_cb, &f->result); g_assert (f->result == NULL); tp_tests_simple_connection_set_identifier (f->service_conn, "me@example.com"); tp_tests_simple_connection_set_get_self_handle_error (f->service_conn, TP_ERROR, TP_ERROR_CONFUSED, "totally wasted"); tp_base_connection_change_status (f->service_conn_as_base, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); /* now run the main loop and let the client catch up */ tp_tests_run_until_result (&f->result); ok = tp_proxy_prepare_finish (f->client_conn, f->result, &f->error); g_assert_error (f->error, TP_ERROR, TP_ERROR_CONFUSED); g_assert (!ok); g_clear_error (&f->error); g_assert_error (tp_proxy_get_invalidated (f->client_conn), TP_ERROR, TP_ERROR_CONFUSED); /* don't want to Disconnect during teardown - it'll just fail */ tp_tests_simple_connection_inject_disconnect (f->service_conn); tp_clear_object (&f->client_conn); } static void teardown (Fixture *f, gconstpointer unused G_GNUC_UNUSED) { g_clear_error (&f->error); if (f->client_conn != NULL) tp_tests_connection_assert_disconnect_succeeds (f->client_conn); tp_clear_object (&f->result); tp_clear_object (&f->client_conn); tp_clear_object (&f->service_conn_as_base); tp_clear_object (&f->service_conn); tp_clear_pointer (&f->name, g_free); tp_clear_pointer (&f->conn_path, g_free); tp_clear_object (&f->dbus); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_set_prgname ("self-handle"); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/self-handle", Fixture, NULL, setup_and_connect, test_self_handle, teardown); g_test_add ("/self-handle/archaic", Fixture, "archaic", setup_and_connect, test_self_handle, teardown); g_test_add ("/self-handle/change-early", Fixture, NULL, setup, test_change_early, teardown); g_test_add ("/self-handle/change-early/archaic", Fixture, "archaic", setup, test_change_early, teardown); g_test_add ("/self-handle/change-inconveniently", Fixture, NULL, setup, test_change_inconveniently, teardown); g_test_add ("/self-handle/change-inconveniently/archaic", Fixture, "archaic", setup, test_change_inconveniently, teardown); g_test_add ("/self-handle/fails", Fixture, "archaic", setup, test_self_handle_fails, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/disconnection.c0000644000175000017500000003151512652510705016544 00000000000000#include "config.h" #include #include #include #include #include #include /* for _invalidated etc. */ #include #include "tests/lib/myassert.h" #include "tests/lib/stub-object.h" #include "tests/lib/util.h" /* just for convenience, since it's used a lot */ #define PTR(ui) GUINT_TO_POINTER(ui) /* state tracking */ static GMainLoop *mainloop; static TpDBusDaemon *a; static TpDBusDaemon *b; static TpDBusDaemon *c; static TpDBusDaemon *d; static TpDBusDaemon *e; static TpDBusDaemon *f; static TpDBusDaemon *g; static TpDBusDaemon *h; static TpDBusDaemon *z; static TpIntset *caught_signal; static TpIntset *freed_user_data; enum { TEST_A, TEST_B, TEST_C, TEST_D, TEST_E, TEST_F, TEST_G, TEST_H, TEST_Z = 25, N_DAEMONS }; static void h_stub_destroyed (gpointer data, GObject *stub) { TpProxySignalConnection **p = data; tp_proxy_signal_connection_disconnect (*p); } static void destroy_user_data (gpointer user_data) { guint which = GPOINTER_TO_UINT (user_data); g_message ("User data %c destroyed", 'A' + which); MYASSERT (!tp_intset_is_member (freed_user_data, which), ""); tp_intset_add (freed_user_data, which); } static void requested_name (TpDBusDaemon *proxy, guint result, const GError *error, gpointer user_data, GObject *weak_object) { g_message ("RequestName raised %s", (error == NULL ? "no error" : error->message)); /* we're on a private bus, so certainly nobody else should own this name */ g_assert_no_error ((GError *) error); MYASSERT (result == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER, ": %u", result); } static void prop_changed (TpProxy *proxy, const GPtrArray *properties, gpointer user_data, GObject *weak_object) { g_error ("prop_changed called - a signal connection which should have " "failed has succeeded. Args: proxy=%p user_data=%p", proxy, user_data); } static void dummy_noc (TpDBusDaemon *proxy, const gchar *name, const gchar *old, const gchar *new, gpointer user_data, GObject *weak_object) { g_error ("dummy_noc called - a signal connection which should have " "failed has succeeded. Args: proxy=%p user_data=%p", proxy, user_data); } static void noc (TpDBusDaemon *proxy, const gchar *name, const gchar *old, const gchar *new, gpointer user_data, GObject *weak_object) { guint which = GPOINTER_TO_UINT (user_data); TpDBusDaemon *want_proxy = NULL; GObject *want_object = NULL; g_message ("Caught signal (%s: %s -> %s) with proxy #%d '%c' according to " "user_data", name, old, new, which, 'a' + which); g_message ("Proxy is %p, weak object is %p", proxy, weak_object); tp_intset_add (caught_signal, which); switch (which) { case TEST_A: want_proxy = a; want_object = (GObject *) z; break; case TEST_Z: want_proxy = z; want_object = (GObject *) a; break; default: g_error ("%c (%p) got the signal, which shouldn't have happened", 'a' + which, proxy); } g_message ("Expecting proxy %p, weak object %p", want_proxy, want_object); MYASSERT (proxy == want_proxy, ": %p != %p", proxy, want_proxy); MYASSERT (weak_object == want_object, ": %p != %p", weak_object, want_object); if (tp_intset_is_member (caught_signal, TEST_A) && tp_intset_is_member (caught_signal, TEST_Z)) { /* we've had all the signals we're going to */ g_main_loop_quit (mainloop); } } static void set_freed (gpointer user_data) { gboolean *boolptr = user_data; MYASSERT (*boolptr == FALSE, ""); *boolptr = TRUE; } int main (int argc, char **argv) { GObject *stub; GError *error_out = NULL; GError err = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Because I said so" }; TpProxySignalConnection *sc; gpointer tmp_obj; gboolean freed = FALSE; tp_tests_abort_after (10); tp_debug_set_flags ("all"); freed_user_data = tp_intset_sized_new (N_DAEMONS); caught_signal = tp_intset_sized_new (N_DAEMONS); mainloop = g_main_loop_new (NULL, FALSE); /* We use TpDBusDaemon because it's a convenient concrete subclass of * TpProxy. */ g_message ("Creating proxies"); a = tp_tests_dbus_daemon_dup_or_die (); g_message ("a=%p", a); b = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("b=%p", b); c = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("c=%p", c); d = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("d=%p", d); e = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("e=%p", e); f = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("f=%p", f); g = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("g=%p", g); h = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("h=%p", h); z = tp_dbus_daemon_new (tp_proxy_get_dbus_connection (a)); g_message ("z=%p", z); /* a survives */ g_message ("Connecting signal to a"); tp_cli_dbus_daemon_connect_to_name_owner_changed (a, noc, PTR (TEST_A), destroy_user_data, (GObject *) z, &error_out); g_assert_no_error (error_out); /* assert that connecting to a signal on an interface we don't have fails */ freed = FALSE; tp_cli_properties_interface_connect_to_properties_changed (a, prop_changed, &freed, set_freed, NULL, &error_out); MYASSERT (freed, ""); MYASSERT (error_out != NULL, ""); MYASSERT (error_out->code == TP_DBUS_ERROR_NO_INTERFACE, ""); g_error_free (error_out); error_out = NULL; /* b gets its signal connection cancelled because stub is * destroyed */ stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); g_message ("Connecting signal to b"); tp_cli_dbus_daemon_connect_to_name_owner_changed (b, noc, PTR (TEST_B), destroy_user_data, stub, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_B), ""); g_object_unref (stub); /* c gets its signal connection cancelled because it's explicitly * invalidated */ g_message ("Connecting signal to c"); tp_cli_dbus_daemon_connect_to_name_owner_changed (c, noc, PTR (TEST_C), destroy_user_data, NULL, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_C), ""); g_message ("Forcibly invalidating c"); tp_proxy_invalidate ((TpProxy *) c, &err); /* assert that connecting to a signal on an invalid proxy fails */ freed = FALSE; tp_cli_dbus_daemon_connect_to_name_owner_changed (c, dummy_noc, &freed, set_freed, NULL, &error_out); MYASSERT (freed, ""); MYASSERT (error_out != NULL, ""); g_message ("%d: %d: %s", error_out->domain, error_out->code, error_out->message); MYASSERT (error_out->code == err.code, "%d != %d", error_out->code, err.code); g_error_free (error_out); error_out = NULL; /* d gets its signal connection cancelled because it's * implicitly invalidated by being destroyed */ g_message ("Connecting signal to d"); tp_cli_dbus_daemon_connect_to_name_owner_changed (d, noc, PTR (TEST_D), destroy_user_data, NULL, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_D), ""); g_message ("Destroying d"); tmp_obj = d; g_object_add_weak_pointer (tmp_obj, &tmp_obj); g_object_unref (d); MYASSERT (tmp_obj == NULL, ""); d = NULL; /* e gets its signal connection cancelled explicitly */ g_message ("Connecting signal to e"); sc = tp_cli_dbus_daemon_connect_to_name_owner_changed (e, noc, PTR (TEST_E), destroy_user_data, NULL, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_E), ""); g_message ("Disconnecting signal from e"); tp_proxy_signal_connection_disconnect (sc); /* f gets its signal connection cancelled because it's implicitly * invalidated by its DBusGProxy being destroyed. * * Note that this test case exploits implementation details of dbus-glib. * If it stops working after a dbus-glib upgrade, that's probably why. */ g_message ("Connecting signal to f"); tp_cli_dbus_daemon_connect_to_name_owner_changed (f, noc, PTR (TEST_F), destroy_user_data, NULL, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_F), ""); g_message ("Forcibly disposing f's DBusGProxy to simulate name owner loss"); tmp_obj = tp_proxy_borrow_interface_by_id ((TpProxy *) f, TP_IFACE_QUARK_DBUS_DAEMON, NULL); MYASSERT (tmp_obj != NULL, ""); g_object_run_dispose (tmp_obj); /* assert that connecting to a signal on an invalid proxy fails */ freed = FALSE; tp_cli_dbus_daemon_connect_to_name_owner_changed (f, dummy_noc, &freed, set_freed, NULL, &error_out); MYASSERT (freed, ""); MYASSERT (error_out != NULL, ""); MYASSERT (error_out->code == DBUS_GERROR_NAME_HAS_NO_OWNER, ""); g_error_free (error_out); error_out = NULL; /* g gets its signal connection cancelled because it's * implicitly invalidated by being destroyed; unlike d, the signal * connection weakly references the proxy. This is never necessary, but is * an interesting corner case that should be tested. */ g_message ("Connecting signal to g"); tp_cli_dbus_daemon_connect_to_name_owner_changed (g, noc, PTR (TEST_G), destroy_user_data, (GObject *) g, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_G), ""); g_message ("Destroying g"); tmp_obj = g; g_object_add_weak_pointer (tmp_obj, &tmp_obj); g_object_unref (g); MYASSERT (tmp_obj == NULL, ""); g = NULL; /* h gets its signal connection cancelled because its weak object is * destroyed, meaning there are simultaneously two reasons for it to become * cancelled (fd.o#14750) */ stub = tp_tests_object_new_static_class (tp_tests_stub_object_get_type (), NULL); g_object_weak_ref (stub, h_stub_destroyed, &sc); g_message ("Connecting signal to h"); tp_cli_dbus_daemon_connect_to_name_owner_changed (h, noc, PTR (TEST_H), destroy_user_data, stub, &error_out); g_assert_no_error (error_out); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_H), ""); g_object_unref (stub); /* z survives; we assume that the signals are delivered in either * forward or reverse order, so if both a and z have had their signal, we * can stop the main loop */ g_message ("Connecting signal to z"); tp_cli_dbus_daemon_connect_to_name_owner_changed (z, noc, PTR (TEST_Z), destroy_user_data, (GObject *) a, &error_out); g_assert_no_error (error_out); /* make sure a NameOwnerChanged signal occurs */ g_message ("Requesting name"); tp_cli_dbus_daemon_call_request_name (a, -1, "com.example.NameTest", 0, requested_name, NULL, NULL, NULL); g_message ("Running main loop"); g_main_loop_run (mainloop); g_main_loop_unref (mainloop); /* Now that the main loop has run, cancelled signal connections have been * freed */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_B), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_D), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_E), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_F), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_G), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_H), ""); /* both A and Z are still listening for signals, so their user data is * still held */ MYASSERT (!tp_intset_is_member (freed_user_data, TEST_A), ""); MYASSERT (!tp_intset_is_member (freed_user_data, TEST_Z), ""); g_message ("Dereferencing remaining proxies"); g_object_unref (a); g_object_unref (b); g_object_unref (c); MYASSERT (d == NULL, ""); g_object_unref (e); g_object_unref (f); MYASSERT (g == NULL, ""); g_object_unref (z); /* we should already have checked each of these at least once, but just to * make sure we have a systematic test that all user data is freed... */ MYASSERT (tp_intset_is_member (freed_user_data, TEST_A), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_B), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_C), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_D), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_E), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_F), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_G), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_H), ""); MYASSERT (tp_intset_is_member (freed_user_data, TEST_Z), ""); tp_intset_destroy (freed_user_data); tp_intset_destroy (caught_signal); return 0; } telepathy-glib-0.24.2/tests/dbus/handle-set.c0000644000175000017500000000751412652510705015733 00000000000000#include "config.h" #include #include #include #include #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/util.h" int main (int argc, char **argv) { TpHandleRepoIface *repo = NULL; TpHandleSet *set = NULL; TpHandleSet *other = NULL; TpIntset *iset = NULL, *result = NULL; GError *error = NULL; gchar *s; TpHandle h1, h2, h3, h4; tp_tests_abort_after (10); repo = tp_tests_object_new_static_class (TP_TYPE_DYNAMIC_HANDLE_REPO, "handle-type", TP_HANDLE_TYPE_CONTACT, NULL); MYASSERT (repo != NULL, ""); set = tp_handle_set_new (repo); MYASSERT (set != NULL, ""); h1 = tp_handle_ensure (repo, "h1@foo", NULL, NULL); h2 = tp_handle_ensure (repo, "h2@foo", NULL, NULL); h3 = tp_handle_ensure (repo, "h3@foo", NULL, NULL); h4 = tp_handle_ensure (repo, "h4@foo", NULL, NULL); MYASSERT (h1 != 0, ""); MYASSERT (h2 != 0, ""); MYASSERT (h3 != 0, ""); MYASSERT (h4 != 0, ""); MYASSERT (tp_handle_lookup (repo, "not-there", NULL, &error) == 0, ""); /* Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=15387 */ MYASSERT (error != NULL, ""); g_error_free (error); error = NULL; /* Add one handle, check that it's in, check the size */ tp_handle_set_add (set, h1); MYASSERT (tp_handle_set_is_member (set, h1), ""); MYASSERT (tp_handle_set_size (set) == 1, ": size really %i", tp_handle_set_size (set)); /* Adding it again should be no-op */ tp_handle_set_add (set, h1); MYASSERT (tp_handle_set_size (set) == 1, ": size really %i", tp_handle_set_size (set)); /* Removing a non-member should fail */ MYASSERT (tp_handle_set_remove (set, h2) == FALSE, ""); /* Add some members via _update() */ iset = tp_intset_new (); tp_intset_add (iset, h1); tp_intset_add (iset, h2); tp_intset_add (iset, h3); result = tp_handle_set_update (set, iset); tp_intset_destroy (iset); /* h2 and h3 should be added, and h1 not */ MYASSERT (!tp_intset_is_member (result, h1), ""); MYASSERT (tp_intset_is_member (result, h2), ""); MYASSERT (tp_intset_is_member (result, h3), ""); tp_intset_destroy (result); MYASSERT (tp_handle_set_is_member (set, h2), ""); MYASSERT (tp_handle_set_is_member (set, h3), ""); /* Remove some members via _update_difference() */ iset = tp_intset_new (); tp_intset_add (iset, h1); tp_intset_add (iset, h4); result = tp_handle_set_difference_update (set, iset); tp_intset_destroy (iset); /* h1 should be removed, h4 not */ MYASSERT (tp_intset_is_member (result, h1), ""); MYASSERT (!tp_intset_is_member (result, h4), ""); other = tp_handle_set_new_from_intset (repo, result); g_assert (tp_intset_is_equal (tp_handle_set_peek (other), result)); tp_clear_pointer (&other, tp_handle_set_destroy); tp_intset_destroy (result); /* Removing a member should succeed */ MYASSERT (tp_handle_set_remove (set, h2) == TRUE, ""); /* Finally, only h3 should be in the set */ MYASSERT (tp_handle_set_is_member (set, h3), ""); MYASSERT (tp_handle_set_size (set) == 1, ": size really %i", tp_handle_set_size (set)); other = tp_handle_set_new_containing (repo, h3); g_assert (tp_intset_is_equal (tp_handle_set_peek (set), tp_handle_set_peek (other))); tp_clear_pointer (&other, tp_handle_set_destroy); /* can't really assert about the contents */ s = tp_handle_set_dump (set); g_free (s); MYASSERT (tp_handle_set_remove (set, h3) == TRUE, ""); tp_handle_set_destroy (set); tp_handle_unref (repo, h1); tp_handle_unref (repo, h2); tp_handle_unref (repo, h3); tp_handle_unref (repo, h4); g_object_unref (G_OBJECT (repo)); return 0; } telepathy-glib-0.24.2/tests/dbus/client.c0000644000175000017500000000330112652510705015153 00000000000000/* A very basic feature test for TpClient * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/util.h" typedef struct { GMainLoop *mainloop; TpDBusDaemon *dbus; TpClient *client; GError *error /* initialized where needed */; } Test; static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); test->mainloop = g_main_loop_new (NULL, FALSE); test->dbus = tp_tests_dbus_daemon_dup_or_die (); test->client = NULL; } static void teardown (Test *test, gconstpointer data) { if (test->client != NULL) { g_object_unref (test->client); test->client = NULL; } g_object_unref (test->dbus); test->dbus = NULL; g_main_loop_unref (test->mainloop); test->mainloop = NULL; } static void test_new (Test *test, gconstpointer data G_GNUC_UNUSED) { test->client = tp_tests_object_new_static_class (TP_TYPE_CLIENT, "dbus-daemon", test->dbus, "object-path", "/org/freedesktop/Telepathy/Client/whatever", "bus-name", "org.freedesktop.Telepathy.Client.whatever", NULL); g_assert (test->client != NULL); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add ("/client/new", Test, NULL, setup, test_new, teardown); return tp_tests_run_with_bus (); } telepathy-glib-0.24.2/tests/dbus/connection-inject-bug16307.c0000644000175000017500000000442112652510705020466 00000000000000/* Feature test for https://bugs.freedesktop.org/show_bug.cgi?id=16307 * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include "tests/lib/myassert.h" #include "tests/lib/bug16307-conn.h" #include "tests/lib/util.h" static GMainLoop *mainloop; typedef struct { gboolean ready; GError *error /* initialized to NULL statically */; GMainLoop *mainloop; } WhenReadyContext; int main (int argc, char **argv) { TpDBusDaemon *dbus; TpTestsBug16307Connection *service_conn; TpBaseConnection *service_conn_as_base; gchar *name; gchar *conn_path; GError *error = NULL; TpConnection *conn; tp_tests_abort_after (10); tp_debug_set_flags ("all"); mainloop = g_main_loop_new (NULL, FALSE); dbus = tp_tests_dbus_daemon_dup_or_die (); /* service side */ service_conn = TP_TESTS_BUG16307_CONNECTION ( tp_tests_object_new_static_class ( TP_TESTS_TYPE_BUG16307_CONNECTION, "account", "me@example.com", "protocol", "simple", NULL)); service_conn_as_base = TP_BASE_CONNECTION (service_conn); MYASSERT (service_conn != NULL, ""); MYASSERT (service_conn_as_base != NULL, ""); MYASSERT (tp_base_connection_register (service_conn_as_base, "simple", &name, &conn_path, &error), ""); g_assert_no_error (error); /* client side */ conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); tp_tests_bug16307_connection_inject_get_status_return (service_conn); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); tp_tests_connection_assert_disconnect_succeeds (conn); service_conn_as_base = NULL; g_object_unref (service_conn); g_free (name); g_free (conn_path); g_object_unref (dbus); g_main_loop_unref (mainloop); return 0; } telepathy-glib-0.24.2/tests/dbus/message-mixin.c0000644000175000017500000011507212652510705016454 00000000000000/* Regression test for the message mixin and the echo-2 example CM. * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include #include #include #include "examples/cm/echo-message-parts/connection-manager.h" #include "examples/cm/echo-message-parts/chan.h" #include "examples/cm/echo-message-parts/conn.h" #include "tests/lib/myassert.h" #include "tests/lib/util.h" static guint received_count = 0; static guint last_received_id = 0; static guint last_received_sender = 0; static guint last_received_type = 0; static guint last_received_flags = 0; static gchar *last_received_text = NULL; static guint sent_count = 0; static guint last_sent_type = 0; static gchar *last_sent_text = NULL; static void on_sent (TpChannel *chan, guint timestamp, guint type, const gchar *text, gpointer data, GObject *object) { g_print ("%p: Sent: time %u, type %u, text '%s'\n", chan, timestamp, type, text); sent_count++; last_sent_type = type; g_free (last_sent_text); last_sent_text = g_strdup (text); } static void on_received (TpChannel *chan, guint id, guint timestamp, guint sender, guint type, guint flags, const gchar *text, gpointer data, GObject *object) { g_print ("%p: Received #%u: time %u, sender %u, type %u, flags %u, " "text '%s'\n", chan, id, timestamp, sender, type, flags, text); received_count++; last_received_id = id; last_received_sender = sender; last_received_type = type; last_received_flags = flags; g_free (last_received_text); last_received_text = g_strdup (text); } static guint message_received_count = 0; static guint last_message_received_sender = 0; static guint last_message_received_type = 0; static guint last_message_received_n_parts = 0; static guint message_sent_count = 0; static guint last_message_sent_type = 0; static gchar *last_message_sent_token = NULL; static guint last_message_sent_n_parts = 0; static guint last_message_sent_sender = 0; static gchar *last_message_sent_sender_id = NULL; static void print_part (gpointer k, gpointer v, gpointer user_data) { const gchar *key = k; gchar *contents = g_strdup_value_contents (v); g_print (" %s: %s\n", key, contents); g_free (contents); } static void print_part_content (gpointer k, gpointer v, gpointer d) { guint part_number = GPOINTER_TO_UINT (k); gchar *contents = g_strdup_value_contents (v); g_print (" %u: %s\n", part_number, contents); g_free (contents); } static void on_message_received (TpChannel *chan, const GPtrArray *parts, gpointer data, GObject *object) { guint i; GHashTable *headers = g_ptr_array_index (parts, 0); guint id; guint received; guint sender; guint type; g_assert (parts->len >= 1); id = tp_asv_get_uint32 (headers, "pending-message-id", NULL); type = tp_asv_get_uint32 (headers, "message-type", NULL); sender = tp_asv_get_uint32 (headers, "message-sender", NULL); received = tp_asv_get_uint32 (headers, "message-received", NULL); g_print ("%p: MessageReceived #%u: received at %u, sender %u, type %u, " "%u parts\n", chan, id, received, sender, type, parts->len); for (i = 0; i < parts->len; i++) { g_print (" Part %u:\n", i); g_hash_table_foreach (g_ptr_array_index (parts, i), print_part, NULL); } message_received_count++; last_message_received_type = type; last_message_received_sender = sender; last_message_received_n_parts = parts->len; } static void on_message_sent (TpChannel *chan, const GPtrArray *parts, guint flags, const gchar *token, gpointer data, GObject *object) { guint i; GHashTable *headers = g_ptr_array_index (parts, 0); guint type; guint sender; const gchar *sender_id; g_assert (parts->len >= 1); type = tp_asv_get_uint32 (headers, "message-type", NULL); sender = tp_asv_get_uint32 (headers, "message-sender", NULL); sender_id = tp_asv_get_string (headers, "message-sender-id"); g_print ("%p: MessageSent with token '%s': type %u, %u parts\n", chan, token, type, parts->len); for (i = 0; i < parts->len; i++) { g_print (" Part %u:\n", i); g_hash_table_foreach (g_ptr_array_index (parts, i), print_part, NULL); } message_sent_count++; last_message_sent_type = type; last_message_sent_n_parts = parts->len; g_free (last_message_sent_token); last_message_sent_token = g_strdup (token); g_free (last_message_sent_sender_id); last_message_sent_sender_id = g_strdup (sender_id); last_message_sent_sender = sender; } static void on_messages_removed (TpChannel *chan, const GArray *ids, gpointer data, GObject *object) { guint i; g_print ("%p: PendingMessagesRemoved: %u messages\n", chan, ids->len); for (i = 0; i < ids->len; i++) { g_print (" %u\n", g_array_index (ids, guint, i)); } } int main (int argc, char **argv) { ExampleEcho2ConnectionManager *service_cm; TpBaseConnectionManager *service_cm_as_base; TpDBusDaemon *dbus; TpConnectionManager *cm; TpConnection *conn; TpChannel *chan; GError *error = NULL; gchar *name; gchar *conn_path; gchar *chan_path; TpHandle handle; gboolean ok; GHashTable *parameters; tp_tests_abort_after (10); tp_debug_set_flags ("all"); dbus = tp_tests_dbus_daemon_dup_or_die (); service_cm = EXAMPLE_ECHO_2_CONNECTION_MANAGER ( tp_tests_object_new_static_class ( EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, NULL)); g_assert (service_cm != NULL); service_cm_as_base = TP_BASE_CONNECTION_MANAGER (service_cm); g_assert (service_cm_as_base != NULL); ok = tp_base_connection_manager_register (service_cm_as_base); g_assert (ok); cm = tp_connection_manager_new (dbus, "example_echo_2", NULL, &error); g_assert (cm != NULL); tp_tests_proxy_run_until_prepared (cm, NULL); parameters = tp_asv_new ( "account", G_TYPE_STRING, "me@example.com", NULL); tp_cli_connection_manager_run_request_connection (cm, -1, "example", parameters, &name, &conn_path, &error, NULL); g_assert_no_error (error); g_hash_table_unref (parameters); conn = tp_connection_new (dbus, name, conn_path, &error); MYASSERT (conn != NULL, ""); g_assert_no_error (error); MYASSERT (tp_connection_run_until_ready (conn, TRUE, &error, NULL), ""); g_assert_no_error (error); { GHashTable *properties = NULL; GPtrArray *arr; /* check that it has the requestable channel class */ tp_cli_dbus_properties_run_get_all (conn, -1, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, &properties, &error, NULL); g_assert_no_error (error); arr = tp_asv_get_boxed (properties, "RequestableChannelClasses", TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST); g_assert_cmpuint (arr->len, ==, 1); g_hash_table_unref (properties); } { GHashTable *request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "them@example.com", NULL); tp_cli_connection_interface_requests_run_create_channel (conn, -1, request, &chan_path, ¶meters, &error, NULL); g_assert_no_error (error); g_hash_table_unref (request); } chan = tp_channel_new_from_properties (conn, chan_path, parameters, &error); g_assert_no_error (error); g_hash_table_unref (parameters); tp_channel_run_until_ready (chan, &error, NULL); g_assert_no_error (error); handle = tp_channel_get_handle (chan, NULL); MYASSERT (tp_cli_channel_type_text_connect_to_received (chan, on_received, NULL, NULL, NULL, NULL) != NULL, ""); MYASSERT (tp_cli_channel_type_text_connect_to_sent (chan, on_sent, NULL, NULL, NULL, NULL) != NULL, ""); MYASSERT ( tp_cli_channel_interface_messages_connect_to_message_received (chan, on_message_received, NULL, NULL, NULL, NULL) != NULL, ""); MYASSERT (tp_cli_channel_interface_messages_connect_to_message_sent ( chan, on_message_sent, NULL, NULL, NULL, NULL) != NULL, ""); MYASSERT ( tp_cli_channel_interface_messages_connect_to_pending_messages_removed ( chan, on_messages_removed, NULL, NULL, NULL, NULL) != NULL, ""); /* Get the initial properties */ { const GValue *value; gchar *contents; GArray *types; GPtrArray *messages; GHashTable *properties = NULL; tp_cli_dbus_properties_run_get_all (chan, -1, TP_IFACE_CHANNEL_INTERFACE_MESSAGES, &properties, &error, NULL); g_assert_no_error (error); g_print ("\n\n==== Examining properties ====\n\n"); g_assert_cmpuint (g_hash_table_size (properties), ==, 5); MYASSERT (tp_asv_get_uint32 (properties, "MessagePartSupportFlags", NULL) == ( TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT | TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS ), ""); MYASSERT ((value = tp_asv_lookup (properties, "SupportedContentTypes")) != NULL, ""); MYASSERT (G_VALUE_HOLDS (value, G_TYPE_STRV), ""); contents = g_strdup_value_contents (value); g_message ("%s", contents); g_free (contents); g_assert ((value = tp_asv_lookup (properties, "MessageTypes")) != NULL); g_assert (G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)); types = g_value_get_boxed (value); g_assert_cmpuint (types->len, ==, 3); g_assert_cmpuint (g_array_index (types, guint, 0), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL); g_assert_cmpuint (g_array_index (types, guint, 1), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION); g_assert_cmpuint (g_array_index (types, guint, 2), ==, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE); MYASSERT ((value = tp_asv_lookup (properties, "PendingMessages")) != NULL, ""); MYASSERT (G_VALUE_HOLDS_BOXED (value), ""); messages = g_value_get_boxed (value); MYASSERT (messages->len == 0, "%u", messages->len); g_assert_cmpuint (tp_asv_get_uint32 (properties, "DeliveryReportingSupport", NULL), ==, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES); g_hash_table_unref (properties); } /* Send three messages using the old Text API: * * (normal) Hello, world! * (action) /me drinks coffee * (notice) Printer on fire * * Verify that for each of them, we get a Sent signal in the old Text * API, and a Received signal for the echo; also a MessageSent signal * in the new Messages API, and a MessageReceived signal for the echo. */ g_print ("\n\n==== Starting test: NORMAL ====\n"); sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "Hello, world!", &error, NULL); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_assert_no_error (error); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "Hello, world!"), ": '%s' != '%s'", last_sent_text, "Hello, world!"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "Hello, world!"), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_sent_type); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_n_parts == 2, ": %u != 2", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 2, ": %u != 2", last_message_received_n_parts); g_print ("\n\n==== Starting test: ACTION ====\n"); sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, "drinks coffee", &error, NULL); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_assert_no_error (error); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "drinks coffee"), ": '%s' != '%s'", last_sent_text, "drinks coffee"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "drinks coffee"), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_message_sent_type); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_n_parts == 2, ": %u != 2", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, ": %u != ACTION", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 2, ": %u != 2", last_message_received_n_parts); g_print ("\n\n==== Starting test: NOTICE ====\n"); sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; tp_cli_channel_type_text_run_send (chan, -1, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, "Printer on fire", &error, NULL); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_assert_no_error (error); MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, "Printer on fire"), ": '%s' != '%s'", last_sent_text, "Printer on fire"); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, "Printer on fire"), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_message_sent_type); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_n_parts == 2, ": %u != 2", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE, ": %u != NOTICE", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 2, ": %u != 2", last_message_received_n_parts); g_print ("\n\n==== Starting test: lolcat ====\n"); /* Send a multi-part message using the Messages API. * * Again, verify that we get a Sent signal in the old Text * API, and a Received signal for the echo; also a MessageSent signal * in the new Messages API, and a MessageReceived signal for the echo. * * Because this message contains an image, we must set the * Channel_Text_Message_Flag_Non_Text_Content. */ sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; #undef EXPECTED_TEXT #define EXPECTED_TEXT ("Here is a photo of a cat:\n"\ "[IMG: lol!]\n"\ "It's in ur regression tests verifying ur designs!") { GPtrArray *send_parts = g_ptr_array_sized_new (3); GHashTable *part; guint i; gchar *token = NULL; /* Empty headers part */ part = tp_asv_new (NULL, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "alternative", G_TYPE_STRING, "main", "content-type", G_TYPE_STRING, "text/html", "content", G_TYPE_STRING, "Here is a photo of a cat:
" "\"lol!\"
" "It's in ur regression tests verifying ur designs!", NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "alternative", G_TYPE_STRING, "main", "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, EXPECTED_TEXT, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "identifier", G_TYPE_STRING, "lolcat", "content-type", G_TYPE_STRING, "image/jpeg", NULL); g_hash_table_insert (part, "content", tp_g_value_slice_new_bytes ( 14, "\xff\xd8\xff\xe0\x00\x10JFIF\x00...")); g_ptr_array_add (send_parts, part); tp_cli_channel_interface_messages_run_send_message (chan, -1, send_parts, 0 /* flags */, &token, &error, NULL); g_assert_no_error (error); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_print ("Sent message, got token '%s'\n", token); g_free (token); for (i = 0; i < send_parts->len; i++) g_hash_table_unref (g_ptr_array_index (send_parts, i)); g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, EXPECTED_TEXT), ": '%s' != '%s'", last_sent_text, EXPECTED_TEXT); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT, ": %u != NON_TEXT_CONTENT", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, EXPECTED_TEXT), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_sent_type); MYASSERT (last_message_sent_n_parts == 4, ": %u != 4", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 4, ": %u != 4", last_message_received_n_parts); g_print ("\n\n==== Starting test: lolcat with PNG alternative ====\n"); /* This time, the non-text content has an alternative. */ sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; #undef EXPECTED_TEXT #define EXPECTED_TEXT ("Here is a photo of a cat:\n"\ "[IMG: lol!]\n"\ "It's in ur regression tests verifying ur designs!") { GPtrArray *send_parts = g_ptr_array_sized_new (3); GHashTable *part; guint i; gchar *token = NULL; /* Empty headers part */ part = tp_asv_new (NULL, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "alternative", G_TYPE_STRING, "main", "identifier", G_TYPE_STRING, "html", "content-type", G_TYPE_STRING, "text/html", "content", G_TYPE_STRING, "Here is a photo of a cat:
" "\"lol!\"
" "It's in ur regression tests verifying ur designs!", NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "alternative", G_TYPE_STRING, "main", "identifier", G_TYPE_STRING, "text", "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, EXPECTED_TEXT, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "identifier", G_TYPE_STRING, "jpeg", "alternative", G_TYPE_STRING, "lolcat", "content-type", G_TYPE_STRING, "image/jpeg", NULL); g_hash_table_insert (part, "content", tp_g_value_slice_new_bytes ( 14, "\xff\xd8\xff\xe0\x00\x10JFIF\x00...")); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "identifier", G_TYPE_STRING, "png", "alternative", G_TYPE_STRING, "lolcat", "content-type", G_TYPE_STRING, "image/png", NULL); g_hash_table_insert (part, "content", tp_g_value_slice_new_bytes ( 12, "\x89PNG\x0d\x0a\x1a\x0a\x00...")); g_ptr_array_add (send_parts, part); tp_cli_channel_interface_messages_run_send_message (chan, -1, send_parts, 0 /* flags */, &token, &error, NULL); g_assert_no_error (error); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_print ("Sent message, got token '%s'\n", token); g_free (token); for (i = 0; i < send_parts->len; i++) g_hash_table_unref (g_ptr_array_index (send_parts, i)); g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, EXPECTED_TEXT), ": '%s' != '%s'", last_sent_text, EXPECTED_TEXT); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT, ": %u != NON_TEXT_CONTENT", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, EXPECTED_TEXT), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_sent_type); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_n_parts == 5, ": %u != 5", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 5, ": %u != 5", last_message_received_n_parts); g_print ("\n\n==== Starting test: defragment ====\n"); /* Send a multi-part message using the Messages API. * This one has multiple text/plain parts, which the Text API needs to * concatenate. */ sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; #undef EXPECTED_TEXT #define EXPECTED_TEXT ("I'm on a roll\n"\ "I'm on a roll this time\n"\ "I feel my luck could change\n") { GPtrArray *send_parts = g_ptr_array_sized_new (3); GHashTable *part; guint i; gchar *token = NULL; /* Empty headers part */ part = tp_asv_new (NULL, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, "I'm on a roll\n", NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, "I'm on a roll this time\n", NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "content", G_TYPE_STRING, "I feel my luck could change\n", NULL); g_ptr_array_add (send_parts, part); tp_cli_channel_interface_messages_run_send_message (chan, -1, send_parts, 0 /* flags */, &token, &error, NULL); g_assert_no_error (error); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_print ("Sent message, got token '%s'\n", token); g_free (token); for (i = 0; i < send_parts->len; i++) g_hash_table_unref (g_ptr_array_index (send_parts, i)); g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, EXPECTED_TEXT), ": '%s' != '%s'", last_sent_text, EXPECTED_TEXT); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, EXPECTED_TEXT), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_sent_type); g_assert_cmpuint (last_message_sent_sender, ==, tp_connection_get_self_handle (conn)); g_assert_cmpstr (last_message_sent_sender_id, ==, "me@example.com"); MYASSERT (last_message_sent_n_parts == 4, ": %u != 4", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 4, ": %u != 4", last_message_received_n_parts); g_print ("\n\n==== Starting test: multilingual ====\n"); /* Send a multi-part message using the Messages API. * This one has multiple text/plain parts, but they're alternatives, * so the old Text API picks the "best" (first) one. */ sent_count = 0; received_count = 0; message_sent_count = 0; message_received_count = 0; #undef EXPECTED_TEXT #define EXPECTED_TEXT "nous badgerez le coleur du stream de la video" { GPtrArray *send_parts = g_ptr_array_sized_new (3); GHashTable *part; guint i; gchar *token = NULL; /* Empty headers part */ part = tp_asv_new (NULL, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "alternative", G_TYPE_STRING, "alt", "lang", G_TYPE_STRING, "fr_CA@collabora", "content", G_TYPE_STRING, EXPECTED_TEXT, NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "alternative", G_TYPE_STRING, "alt", "lang", G_TYPE_STRING, "en_GB", "content", G_TYPE_STRING, "we're fixing the colour of the video stream", NULL); g_ptr_array_add (send_parts, part); part = tp_asv_new ( "content-type", G_TYPE_STRING, "text/plain", "alternative", G_TYPE_STRING, "alt", "lang", G_TYPE_STRING, "en_US", "content", G_TYPE_STRING, "we're fixing the color of the video stream", NULL); g_ptr_array_add (send_parts, part); tp_cli_channel_interface_messages_run_send_message (chan, -1, send_parts, 0 /* flags */, &token, &error, NULL); g_assert_no_error (error); /* wait for pending events to be delivered */ while (received_count < 1 || message_received_count < 1) g_main_context_iteration (NULL, TRUE); g_print ("Sent message, got token '%s'\n", token); g_free (token); for (i = 0; i < send_parts->len; i++) g_hash_table_unref (g_ptr_array_index (send_parts, i)); g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); MYASSERT (received_count == 1, ": %u != 1", received_count); MYASSERT (last_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_sent_type); MYASSERT (!tp_strdiff (last_sent_text, EXPECTED_TEXT), ": '%s' != '%s'", last_sent_text, EXPECTED_TEXT); MYASSERT (last_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_received_type); MYASSERT (last_received_flags == 0, ": %u != 0", last_received_flags); MYASSERT (last_received_sender == handle, ": %u != %u", last_received_sender, handle); MYASSERT (!tp_strdiff (last_received_text, EXPECTED_TEXT), ": '%s'", last_received_text); MYASSERT (message_sent_count == 1, ": %u != 1", message_sent_count); MYASSERT (message_received_count == 1, ": %u != 1", message_received_count); MYASSERT (last_message_sent_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_sent_type); MYASSERT (last_message_sent_n_parts == 4, ": %u != 4", last_message_sent_n_parts); MYASSERT (last_message_received_type == TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, ": %u != NORMAL", last_message_received_type); MYASSERT (last_message_received_sender == handle, ": %u != %u", last_message_received_sender, handle); MYASSERT (last_message_received_n_parts == 4, ": %u != 4", last_message_received_n_parts); g_print ("\n\n==== Getting partial content of last message ====\n"); { GArray *part_numbers = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); GHashTable *ret; guint i; i = 2; g_array_append_val (part_numbers, i); i = 1; g_array_append_val (part_numbers, i); tp_cli_channel_interface_messages_run_get_pending_message_content (chan, -1, last_received_id, part_numbers, &ret, &error, NULL); g_assert_no_error (error); MYASSERT (g_hash_table_size (ret) == 2, ": %u", g_hash_table_size (ret)); g_hash_table_foreach (ret, print_part_content, NULL); g_hash_table_unref (ret); i = 47; g_array_append_val (part_numbers, i); tp_cli_channel_interface_messages_run_get_pending_message_content (chan, -1, last_received_id, part_numbers, &ret, &error, NULL); MYASSERT (error != NULL, ""); g_print ("Testing out-of-range part number: correctly got error %s\n", error->message); g_error_free (error); error = NULL; g_array_unref (part_numbers); } g_print ("\n\n==== Listing messages ====\n"); { GPtrArray *messages; tp_cli_channel_type_text_run_list_pending_messages (chan, -1, FALSE, &messages, &error, NULL); g_assert_no_error (error); g_print ("Freeing\n"); g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages); } g_print ("\n\n==== Acknowledging messages using a wrong ID ====\n"); { GArray *ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); /* we assume this ID won't be valid (implementation detail: message * IDs are increasing integers) */ guint bad_id = 31337; g_array_append_val (ids, last_received_id); g_array_append_val (ids, bad_id); MYASSERT ( !tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1, ids, &error, NULL), ""); MYASSERT (error != NULL, ""); MYASSERT (error->domain == TP_ERROR, "%s", g_quark_to_string (error->domain)); MYASSERT (error->code == TP_ERROR_INVALID_ARGUMENT, "%u", error->code); g_error_free (error); error = NULL; g_array_unref (ids); /* The test "Acknowledging one message", will fail if the * last_received_id was acknowledged despite the error */ } g_print ("\n\n==== Getting properties again ====\n"); { const GValue *value; gchar *contents; GPtrArray *messages; GHashTable *properties = NULL; guint i; tp_cli_dbus_properties_run_get_all (chan, -1, TP_IFACE_CHANNEL_INTERFACE_MESSAGES, &properties, &error, NULL); g_assert_no_error (error); g_print ("\n\n==== Examining properties ====\n\n"); g_assert_cmpuint (g_hash_table_size (properties), ==, 5); MYASSERT (tp_asv_get_uint32 (properties, "MessagePartSupportFlags", NULL) == ( TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT | TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS ), ""); MYASSERT ((value = tp_asv_lookup (properties, "SupportedContentTypes")) != NULL, ""); MYASSERT (G_VALUE_HOLDS (value, G_TYPE_STRV), ""); contents = g_strdup_value_contents (value); g_message ("%s", contents); g_free (contents); g_assert_cmpuint (tp_asv_get_uint32 (properties, "DeliveryReportingSupport", NULL), ==, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES); MYASSERT ((value = tp_asv_lookup (properties, "PendingMessages")) != NULL, ""); MYASSERT (G_VALUE_HOLDS_BOXED (value), ""); messages = g_value_get_boxed (value); MYASSERT (messages->len == 7, ": %u", messages->len); for (i = 0; i < messages->len; i++) { GPtrArray *message = g_ptr_array_index (messages, i); guint j; g_print ("Message %u:\n", i); for (j = 0; j < message->len; j++) { g_print (" Part %u:\n", j); g_hash_table_foreach (g_ptr_array_index (message, j), print_part, NULL); } } g_hash_table_unref (properties); } g_print ("\n\n==== Acknowledging one message ====\n"); { /* As a regression test for * , we include the * ID of the message we want to ack twice. This used to cause a * double-free. */ GArray *msgid = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); g_array_append_val (msgid, last_received_id); g_array_append_val (msgid, last_received_id); tp_cli_channel_type_text_run_acknowledge_pending_messages (chan, -1, msgid, &error, NULL); g_assert_no_error (error); g_array_unref (msgid); } g_print ("\n\n==== Acknowledging all remaining messages using deprecated " "API ====\n"); { GPtrArray *messages; tp_cli_channel_type_text_run_list_pending_messages (chan, -1, TRUE, &messages, &error, NULL); g_assert_no_error (error); g_print ("Freeing\n"); g_boxed_free (TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST, messages); } g_print ("\n\n==== Closing channel ====\n"); { GPtrArray *channels; MYASSERT (tp_cli_channel_run_close (chan, -1, &error, NULL), ""); g_assert_no_error (error); MYASSERT (tp_proxy_get_invalidated (chan) != NULL, ""); /* assert that the channel has really gone */ MYASSERT (tp_cli_connection_run_list_channels (conn, -1, &channels, &error, NULL), ""); g_assert_no_error (error); MYASSERT (channels->len == 0, "%u != 0", channels->len); g_boxed_free (TP_ARRAY_TYPE_CHANNEL_INFO_LIST, channels); } g_print ("\n\n==== End of tests ====\n"); tp_tests_connection_assert_disconnect_succeeds (conn); g_object_unref (chan); g_object_unref (conn); g_object_unref (dbus); g_free (name); g_free (conn_path); g_free (chan_path); g_free (last_sent_text); g_free (last_received_text); g_free (last_message_sent_token); g_free (last_message_sent_sender_id); return 0; } telepathy-glib-0.24.2/tests/all-errors-documented.py0000755000175000017500000000201514004033172017350 00000000000000#!/usr/bin/python # Check if all the errors have been added to # docs/reference/telepathy-glib-sections.txt import os import sys import xml.dom.minidom from libglibcodegen import NS_TP def check_all_errors_documented(abs_top_srcdir): error_path = os.path.join(abs_top_srcdir, 'spec', 'errors.xml') sections_path = os.path.join(abs_top_srcdir, 'docs', 'reference', 'telepathy-glib-sections.txt') sections = open(sections_path).readlines() dom = xml.dom.minidom.parse(error_path) errors = dom.getElementsByTagNameNS(NS_TP, 'errors')[0] for error in errors.getElementsByTagNameNS(NS_TP, 'error'): nick = error.getAttribute('name').replace(' ', '') name = ('TP_ERROR_STR_' + error.getAttribute('name').replace('.', '_').replace(' ', '_').upper()) if '%s\n' % name not in sections: print("'%s' is missing in %s" % (name, sections_path)) sys.exit(1) if __name__ == '__main__': check_all_errors_documented(os.environ['abs_top_srcdir']) telepathy-glib-0.24.2/tests/asv.c0000644000175000017500000002571412652510705013545 00000000000000#include "config.h" #include #include #include #include "tests/lib/myassert.h" #include "telepathy-glib/variant-util-internal.h" #define asv_assert(type, key, expected_value, expected_valid) \ valid = (gboolean) 123; \ g_assert (tp_asv_get_##type (hash, key, NULL) == expected_value); \ g_assert (tp_asv_get_##type (hash, key, &valid) == expected_value); \ g_assert (valid == expected_valid); \ \ valid = (gboolean) 123; \ g_assert (tp_vardict_get_##type (vardict, key, NULL) == expected_value); \ g_assert (tp_vardict_get_##type (vardict, key, &valid) == expected_value); \ g_assert (valid == expected_valid) #define asv_assert_string(key, expected_value) \ g_assert_cmpstr (tp_asv_get_string (hash, key), ==, expected_value); \ g_assert_cmpstr (tp_vardict_get_string (vardict, key), ==, expected_value); \ #define asv_assert_object_path(key, expected_value) \ g_assert_cmpstr (tp_asv_get_object_path (hash, key), ==, expected_value); \ g_assert_cmpstr (tp_vardict_get_object_path (vardict, key), ==, expected_value); \ int main (int argc, char **argv) { GHashTable *hash; GVariant *vardict; gboolean valid; static const char * const strv[] = { "Foo", "Bar", NULL }; /* Setup */ hash = tp_asv_new ( "d:123.2", G_TYPE_DOUBLE, 123.2, "s:test", G_TYPE_STRING, "test", NULL); MYASSERT (tp_asv_size (hash) == 2, "%u != 0", tp_asv_size (hash)); g_hash_table_insert (hash, "d:0", tp_g_value_slice_new_double (0.0)); MYASSERT (tp_asv_size (hash) == 3, "%u != 1", tp_asv_size (hash)); g_hash_table_insert (hash, "d:-123", tp_g_value_slice_new_double (-123.0)); MYASSERT (tp_asv_size (hash) == 4, "%u != 2", tp_asv_size (hash)); g_hash_table_insert (hash, "b:TRUE", tp_g_value_slice_new_boolean (TRUE)); g_hash_table_insert (hash, "b:FALSE", tp_g_value_slice_new_boolean (FALSE)); g_hash_table_insert (hash, "s0", tp_g_value_slice_new_static_string ("")); g_hash_table_insert (hash, "s", tp_g_value_slice_new_string ("hello, world!")); g_hash_table_insert (hash, "o", tp_g_value_slice_new_object_path ("/com/example/Object")); g_hash_table_insert (hash, "i32:-2**16", tp_g_value_slice_new_int (-0x10000)); g_hash_table_insert (hash, "i32:0", tp_g_value_slice_new_int (0)); g_hash_table_insert (hash, "u32:0", tp_g_value_slice_new_uint (0)); g_hash_table_insert (hash, "i64:0", tp_g_value_slice_new_int64 (0)); g_hash_table_insert (hash, "u64:0", tp_g_value_slice_new_uint64 (0)); g_hash_table_insert (hash, "i32:2**16", tp_g_value_slice_new_int (0x10000)); g_hash_table_insert (hash, "u32:2**16", tp_g_value_slice_new_uint (0x10000)); g_hash_table_insert (hash, "i32:-2**31", tp_g_value_slice_new_int (0x10000 * -0x8000)); g_hash_table_insert (hash, "i32:2**31-1", tp_g_value_slice_new_int (0x7FFFffff)); g_hash_table_insert (hash, "u32:2**31-1", tp_g_value_slice_new_uint (0x7FFFffff)); g_hash_table_insert (hash, "u32:2**31", tp_g_value_slice_new_uint (0x80000000U)); g_hash_table_insert (hash, "u32:2**32-1", tp_g_value_slice_new_uint (0xFFFFffffU)); g_hash_table_insert (hash, "u64:2**32-1", tp_g_value_slice_new_uint64 (0xFFFFffffU)); g_hash_table_insert (hash, "u64:2**32", tp_g_value_slice_new_uint64 (G_GUINT64_CONSTANT (0x100000000))); g_hash_table_insert (hash, "i64:-2**63", tp_g_value_slice_new_int64 (G_GINT64_CONSTANT (-0x80000000) * G_GINT64_CONSTANT (0x100000000))); g_hash_table_insert (hash, "i64:2**63-1", tp_g_value_slice_new_int64 (G_GINT64_CONSTANT (0x7FFFffffFFFFffff))); g_hash_table_insert (hash, "u64:2**63-1", tp_g_value_slice_new_uint64 (G_GUINT64_CONSTANT (0x7FFFffffFFFFffff))); g_hash_table_insert (hash, "u64:2**64-1", tp_g_value_slice_new_uint64 (G_GUINT64_CONSTANT (0xFFFFffffFFFFffff))); g_hash_table_insert (hash, "as", tp_g_value_slice_new_boxed (G_TYPE_STRV, strv)); g_hash_table_insert (hash, "as0", tp_g_value_slice_new_boxed (G_TYPE_STRV, strv + 2)); tp_asv_dump (hash); vardict = _tp_asv_to_vardict (hash); /* Tests: tp_asv_get_boolean */ asv_assert (boolean, "b:FALSE", FALSE, TRUE); asv_assert (boolean, "b:TRUE", TRUE, TRUE); asv_assert (boolean, "s", FALSE, FALSE); asv_assert (boolean, "not-there", FALSE, FALSE); asv_assert (boolean, "i32:2**16", FALSE, FALSE); asv_assert (boolean, "d:0", FALSE, FALSE); asv_assert (boolean, "d:-123", FALSE, FALSE); asv_assert (boolean, "d:123.2", FALSE, FALSE); /* Tests: tp_asv_get_double */ asv_assert (double, "s", 0.0, FALSE); asv_assert (double, "b:TRUE", 0.0, FALSE); asv_assert (double, "not-there", 0.0, FALSE); asv_assert (double, "i32:0", 0.0, TRUE); asv_assert (double, "u32:0", 0.0, TRUE); asv_assert (double, "u32:2**16", (double) 0x10000, TRUE); asv_assert (double, "i32:-2**16", (double) -0x10000, TRUE); asv_assert (double, "u64:0", 0.0, TRUE); asv_assert (double, "d:0", 0.0, TRUE); asv_assert (double, "d:-123", -123.0, TRUE); asv_assert (double, "d:123.2", 123.2, TRUE); /* Tests: tp_asv_get_int32 */ asv_assert (int32, "s", 0, FALSE); asv_assert (int32, "b:TRUE", 0, FALSE); asv_assert (int32, "d:0", 0, FALSE); asv_assert (int32, "not-there", 0, FALSE); asv_assert (int32, "i32:0", 0, TRUE); asv_assert (int32, "u32:0", 0, TRUE); asv_assert (int32, "i32:2**16", 0x10000, TRUE); asv_assert (int32, "u32:2**16", 0x10000, TRUE); asv_assert (int32, "i32:-2**16", -0x10000, TRUE); asv_assert (int32, "i32:-2**31", 0x10000 * -0x8000, TRUE); asv_assert (int32, "i32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (int32, "u32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (int32, "u32:2**31", 0, FALSE); asv_assert (int32, "u32:2**32-1", 0, FALSE); asv_assert (int32, "u64:2**32-1", 0, FALSE); asv_assert (int32, "u64:2**32", 0, FALSE); asv_assert (int32, "u64:2**64-1", 0, FALSE); asv_assert (int32, "i64:-2**63", 0, FALSE); asv_assert (int32, "i64:2**63-1", 0, FALSE); asv_assert (int32, "u64:2**63-1", 0, FALSE); /* Tests: tp_asv_get_uint32 */ asv_assert (uint32, "s", 0, FALSE); asv_assert (uint32, "b:TRUE", 0, FALSE); asv_assert (uint32, "d:0", 0, FALSE); asv_assert (uint32, "not-there", 0, FALSE); asv_assert (uint32, "i32:0", 0, TRUE); asv_assert (uint32, "u32:0", 0, TRUE); asv_assert (uint32, "i32:2**16", 0x10000, TRUE); asv_assert (uint32, "u32:2**16", 0x10000, TRUE); asv_assert (uint32, "i32:-2**16", 0, FALSE); asv_assert (uint32, "i32:-2**31", 0, FALSE); asv_assert (uint32, "i32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (uint32, "u32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (uint32, "u32:2**31", 0x80000000U, TRUE); asv_assert (uint32, "u32:2**32-1", 0xFFFFFFFFU, TRUE); asv_assert (uint32, "u64:2**32-1", 0xFFFFFFFFU, TRUE); asv_assert (uint32, "u64:2**32", 0, FALSE); asv_assert (uint32, "u64:2**64-1", 0, FALSE); asv_assert (uint32, "i64:-2**63", 0, FALSE); asv_assert (uint32, "i64:2**63-1", 0, FALSE); asv_assert (uint32, "u64:2**63-1", 0, FALSE); /* Tests: tp_asv_get_int64 */ asv_assert (int64, "s", 0, FALSE); asv_assert (int64, "b:TRUE", 0, FALSE); asv_assert (int64, "d:0", 0, FALSE); asv_assert (int64, "not-there", 0, FALSE); asv_assert (int64, "i32:0", 0, TRUE); asv_assert (int64, "u32:0", 0, TRUE); asv_assert (int64, "i32:2**16", 0x10000, TRUE); asv_assert (int64, "u32:2**16", 0x10000, TRUE); asv_assert (int64, "i32:-2**16", -0x10000, TRUE); asv_assert (int64, "i32:-2**31", 0x10000 * -0x8000, TRUE); asv_assert (int64, "i32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (int64, "u32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (int64, "u32:2**31", G_GINT64_CONSTANT (0x80000000), TRUE); asv_assert (int64, "u32:2**32-1", G_GINT64_CONSTANT (0xFFFFFFFF), TRUE); asv_assert (int64, "u64:2**32-1", G_GINT64_CONSTANT (0xFFFFFFFF), TRUE); asv_assert (int64, "u64:2**32", G_GINT64_CONSTANT (0x100000000), TRUE); asv_assert (int64, "u64:2**64-1", 0, FALSE); asv_assert (int64, "i64:-2**63", G_GINT64_CONSTANT (-0x80000000) * G_GINT64_CONSTANT (0x100000000), TRUE); asv_assert (int64, "i64:2**63-1", G_GINT64_CONSTANT (0x7FFFFFFFFFFFFFFF), TRUE); asv_assert (int64, "u64:2**63-1", G_GINT64_CONSTANT (0x7FFFFFFFFFFFFFFF), TRUE); /* Tests: tp_asv_get_uint64 */ asv_assert (uint64, "s", 0, FALSE); asv_assert (uint64, "b:TRUE", 0, FALSE); asv_assert (uint64, "d:0", 0, FALSE); asv_assert (uint64, "not-there", 0, FALSE); asv_assert (uint64, "i32:0", 0, TRUE); asv_assert (uint64, "u32:0", 0, TRUE); asv_assert (uint64, "i32:2**16", 0x10000, TRUE); asv_assert (uint64, "u32:2**16", 0x10000, TRUE); asv_assert (uint64, "i32:-2**16", 0, FALSE); asv_assert (uint64, "i32:-2**31", 0, FALSE); asv_assert (uint64, "i32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (uint64, "u32:2**31-1", 0x7FFFFFFF, TRUE); asv_assert (uint64, "u32:2**31", 0x80000000U, TRUE); asv_assert (uint64, "u32:2**32-1", 0xFFFFFFFFU, TRUE); asv_assert (uint64, "u64:2**32-1", 0xFFFFFFFFU, TRUE); asv_assert (uint64, "u64:2**32", G_GUINT64_CONSTANT (0x100000000), TRUE); asv_assert (uint64, "u64:2**64-1", G_GUINT64_CONSTANT (0xFFFFffffFFFFffff), TRUE); asv_assert (uint64, "i64:-2**63", 0, FALSE); asv_assert (uint64, "i64:2**63-1", G_GUINT64_CONSTANT (0x7FFFffffFFFFffff), TRUE); asv_assert (uint64, "u64:2**63-1", G_GUINT64_CONSTANT (0x7FFFffffFFFFffff), TRUE); /* Tests: tp_asv_get_string */ asv_assert_string ("s", "hello, world!"); asv_assert_string ("s0", ""); asv_assert_string ("b:TRUE", NULL); asv_assert_string ("b:FALSE", NULL); asv_assert_string ("not-there", NULL); asv_assert_string ("i32:0", NULL); asv_assert_string ("u32:0", NULL); asv_assert_string ("d:0", NULL); /* Tests: tp_asv_get_object_path */ asv_assert_object_path ("o", "/com/example/Object"); asv_assert_object_path ("s", NULL); asv_assert_object_path ("s0", NULL); asv_assert_object_path ("b:TRUE", NULL); asv_assert_object_path ("b:FALSE", NULL); asv_assert_object_path ("not-there", NULL); asv_assert_object_path ("i32:0", NULL); asv_assert_object_path ("u32:0", NULL); asv_assert_object_path ("d:0", NULL); /* Tests: tp_asv_get_strv */ MYASSERT (tp_asv_get_strv (hash, "s") == NULL, ""); MYASSERT (tp_asv_get_strv (hash, "u32:0") == NULL, ""); MYASSERT (tp_asv_get_strv (hash, "as") != NULL, ""); MYASSERT (!tp_strdiff (tp_asv_get_strv (hash, "as")[0], "Foo"), ""); MYASSERT (!tp_strdiff (tp_asv_get_strv (hash, "as")[1], "Bar"), ""); MYASSERT (tp_asv_get_strv (hash, "as")[2] == NULL, ""); MYASSERT (tp_asv_get_strv (hash, "as0") != NULL, ""); MYASSERT (tp_asv_get_strv (hash, "as0")[0] == NULL, ""); /* Tests: tp_asv_lookup */ MYASSERT (G_VALUE_HOLDS_STRING (tp_asv_lookup (hash, "s")), ""); MYASSERT (G_VALUE_HOLDS_UINT (tp_asv_lookup (hash, "u32:0")), ""); MYASSERT (G_VALUE_HOLDS_BOOLEAN (tp_asv_lookup (hash, "b:TRUE")), ""); MYASSERT (G_VALUE_HOLDS_INT (tp_asv_lookup (hash, "i32:0")), ""); MYASSERT (tp_asv_lookup (hash, "not-there") == NULL, ""); /* Teardown */ g_hash_table_unref (hash); g_variant_unref (vardict); return 0; } telepathy-glib-0.24.2/tests/tools/0000755000175000017500000000000014006623343014015 500000000000000telepathy-glib-0.24.2/tests/tools/test-glib-gtypes-generator.sh0000755000175000017500000000063412652510705021470 00000000000000#!/bin/sh set -e ${PYTHON} ${top_srcdir}/tools/glib-gtypes-generator.py \ ${top_srcdir}/tests/tools/glib-gtypes-generator.xml \ actual The_Prefix e=0 # We assume POSIX diff, until someone complains diff -b -c ${srcdir}/expected-gtypes.h actual.h || e=$? diff -b -c ${srcdir}/expected-gtypes-gtk-doc.h actual-gtk-doc.h || e=$? diff -b -c ${srcdir}/expected-gtypes-body.h actual-body.h || e=$? exit $e telepathy-glib-0.24.2/tests/tools/glib-gtypes-generator.xml0000644000175000017500000000254612652510705020702 00000000000000 telepathy-glib-0.24.2/tests/tools/expected-gobject-foo.h0000644000175000017500000000213112652510705020102 00000000000000typedef struct _XyzBadgerMushroomSnake XyzBadgerMushroomSnake; typedef struct _XyzBadgerMushroomSnakeClass XyzBadgerMushroomSnakeClass; typedef struct _XyzBadgerMushroomSnakePrivate XyzBadgerMushroomSnakePrivate; GType xyz_badger_mushroom_snake_get_type (void); #define XYZ_BADGER_TYPE_MUSHROOM_SNAKE \ (xyz_badger_mushroom_snake_get_type ()) #define XYZ_BADGER_MUSHROOM_SNAKE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \ XyzBadgerMushroomSnake)) #define XYZ_BADGER_MUSHROOM_SNAKE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \ XyzBadgerMushroomSnakeClass)) #define XYZ_BADGER_IS_MUSHROOM_SNAKE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE)) #define XYZ_BADGER_IS_MUSHROOM_SNAKE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), XYZ_BADGER_TYPE_MUSHROOM_SNAKE)) #define XYZ_BADGER_MUSHROOM_SNAKE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), XYZ_BADGER_TYPE_MUSHROOM_SNAKE, \ XyzBadgerMushroomSnakeClass)) telepathy-glib-0.24.2/tests/tools/Makefile.am0000644000175000017500000000074312652510705015777 00000000000000dist_noinst_SCRIPTS = \ test-gobject-foo.sh \ test-glib-gtypes-generator.sh EXTRA_DIST = \ expected-gobject-foo.h \ expected-gtypes.h \ expected-gtypes-body.h \ expected-gtypes-gtk-doc.h \ expected-ginterface-foo.h \ glib-gtypes-generator.xml TESTS = $(dist_noinst_SCRIPTS) TESTS_ENVIRONMENT = \ PYTHON=$(PYTHON) \ srcdir=$(srcdir) \ top_srcdir=$(top_srcdir) \ $(NULL) CLEANFILES = \ actual.h \ actual-body.h \ actual-gtk-doc.h telepathy-glib-0.24.2/tests/tools/Makefile.in0000644000175000017500000007041114006601553016004 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests/tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_noinst_SCRIPTS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(dist_noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ dist_noinst_SCRIPTS = \ test-gobject-foo.sh \ test-glib-gtypes-generator.sh EXTRA_DIST = \ expected-gobject-foo.h \ expected-gtypes.h \ expected-gtypes-body.h \ expected-gtypes-gtk-doc.h \ expected-ginterface-foo.h \ glib-gtypes-generator.xml TESTS = $(dist_noinst_SCRIPTS) TESTS_ENVIRONMENT = \ PYTHON=$(PYTHON) \ srcdir=$(srcdir) \ top_srcdir=$(top_srcdir) \ $(NULL) CLEANFILES = \ actual.h \ actual-body.h \ actual-gtk-doc.h all: all-am .SUFFIXES: .SUFFIXES: .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-gobject-foo.sh.log: test-gobject-foo.sh @p='test-gobject-foo.sh'; \ b='test-gobject-foo.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-glib-gtypes-generator.sh.log: test-glib-gtypes-generator.sh @p='test-glib-gtypes-generator.sh'; \ b='test-glib-gtypes-generator.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile $(SCRIPTS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ clean-libtool cscopelist-am ctags-am distclean \ distclean-generic distclean-libtool distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am recheck tags-am \ uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/tests/tools/expected-ginterface-foo.h0000644000175000017500000000125712652510705020604 00000000000000typedef struct _XyzBadgerIrritable XyzBadgerIrritable; typedef struct _XyzBadgerIrritableInterface XyzBadgerIrritableInterface; GType xyz_badger_irritable_get_type (void); #define XYZ_BADGER_TYPE_IRRITABLE \ (xyz_badger_irritable_get_type ()) #define XYZ_BADGER_IRRITABLE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), XYZ_BADGER_TYPE_IRRITABLE, \ XyzBadgerIrritable)) #define XYZ_BADGER_IS_IRRITABLE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), XYZ_BADGER_TYPE_IRRITABLE)) #define XYZ_BADGER_IRRITABLE_GET_IFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), XYZ_BADGER_TYPE_IRRITABLE, \ XyzBadgerIrritableInterface)) telepathy-glib-0.24.2/tests/tools/test-gobject-foo.sh0000755000175000017500000000071312652510705017452 00000000000000#!/bin/sh set -e ${PYTHON} ${top_srcdir}/tools/gobject-foo.py Xyz_Badger Mushroom_Snake \ > gobject-foo.h ${PYTHON} ${top_srcdir}/tools/gobject-foo.py --interface \ Xyz_Badger Irritable > ginterface-foo.h e=0 # We assume POSIX diff, until someone complains diff -b -c ${srcdir}/expected-gobject-foo.h gobject-foo.h || e=$? diff -b -c ${srcdir}/expected-ginterface-foo.h ginterface-foo.h || e=$? rm -f gobject-foo.h rm -f ginterface-foo.h exit $e telepathy-glib-0.24.2/tests/tools/expected-gtypes-body.h0000644000175000017500000000412214004031760020144 00000000000000/* Auto-generated, do not edit. * * This file may be distributed under the same terms * as the specification from which it was generated. */ GType the_prefix_type_dbus_hash_saa_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_collection ("GPtrArray", (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))))); return t; } GType the_prefix_type_dbus_hash_sa_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE))); return t; } GType the_prefix_type_dbus_hash_ss (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING); return t; } GType the_prefix_type_dbus_hash_sv (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE); return t; } GType the_prefix_type_dbus_struct_isu (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INVALID); return t; } GType the_prefix_type_dbus_array_isu (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_struct_isu ()); return t; } GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_saa_7bsv_7d ()); return t; } GType the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sa_7bsv_7d ()); return t; } GType the_prefix_type_dbus_array_of_a_7bsv_7d (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", the_prefix_type_dbus_hash_sv ()); return t; } telepathy-glib-0.24.2/tests/tools/expected-gtypes.h0000644000175000017500000000266414004031760017222 00000000000000/* Auto-generated, do not edit. * * This file may be distributed under the same terms * as the specification from which it was generated. */ #define THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP (the_prefix_type_dbus_hash_sv ()) #define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsv_7d ()) #define THE_PREFIX_HASH_TYPE_STRING_STRING_MAP (the_prefix_type_dbus_hash_ss ()) #define THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_MAP (the_prefix_type_dbus_hash_sa_7bsv_7d ()) #define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d ()) #define THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_LIST_MAP (the_prefix_type_dbus_hash_saa_7bsv_7d ()) #define THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST_MAP_LIST (the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d ()) GType the_prefix_type_dbus_hash_saa_7bsv_7d (void); GType the_prefix_type_dbus_hash_sa_7bsv_7d (void); GType the_prefix_type_dbus_hash_ss (void); GType the_prefix_type_dbus_hash_sv (void); #define THE_PREFIX_STRUCT_TYPE_STRUCT (the_prefix_type_dbus_struct_isu ()) #define THE_PREFIX_ARRAY_TYPE_STRUCT_LIST (the_prefix_type_dbus_array_isu ()) GType the_prefix_type_dbus_struct_isu (void); GType the_prefix_type_dbus_array_isu (void); GType the_prefix_type_dbus_array_of_a_7bsaa_7bsv_7d_7d (void); GType the_prefix_type_dbus_array_of_a_7bsa_7bsv_7d_7d (void); GType the_prefix_type_dbus_array_of_a_7bsv_7d (void); telepathy-glib-0.24.2/tests/tools/expected-gtypes-gtk-doc.h0000644000175000017500000000654513574521454020571 00000000000000/* Auto-generated, do not edit. * * This file may be distributed under the same terms * as the specification from which it was generated. */ /** * THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP: * * (Undocumented) * * This macro expands to a call to a function * that returns the #GType of a #GHashTable * appropriate for representing a D-Bus * dictionary of signature * a{sv}. * * Keys (D-Bus type s, * named Key): * (Undocumented) * * Values (D-Bus type v, * named Value): * (Undocumented) * */ /** * THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST: * Expands to a call to a function * that returns the #GType of a #GPtrArray * of #THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP. */ /** * THE_PREFIX_HASH_TYPE_STRING_STRING_MAP: * * (Undocumented) * * This macro expands to a call to a function * that returns the #GType of a #GHashTable * appropriate for representing a D-Bus * dictionary of signature * a{ss}. * * Keys (D-Bus type s, * named Key): * (Undocumented) * * Values (D-Bus type s, * named Value): * (Undocumented) * */ /** * THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_MAP: * * (Undocumented) * * This macro expands to a call to a function * that returns the #GType of a #GHashTable * appropriate for representing a D-Bus * dictionary of signature * a{sa{sv}}. * * Keys (D-Bus type s, * named Key): * (Undocumented) * * Values (D-Bus type a{sv}, * type String_Variant_Map, * named Value): * (Undocumented) * */ /** * THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_MAP_LIST: * Expands to a call to a function * that returns the #GType of a #GPtrArray * of #THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_MAP. */ /** * THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_LIST_MAP: * * (Undocumented) * * This macro expands to a call to a function * that returns the #GType of a #GHashTable * appropriate for representing a D-Bus * dictionary of signature * a{saa{sv}}. * * Keys (D-Bus type s, * named Key): * (Undocumented) * * Values (D-Bus type aa{sv}, * type String_Variant_Map[], * named Value): * (Undocumented) * */ /** * THE_PREFIX_ARRAY_TYPE_STRING_VARIANT_MAP_LIST_MAP_LIST: * Expands to a call to a function * that returns the #GType of a #GPtrArray * of #THE_PREFIX_HASH_TYPE_STRING_VARIANT_MAP_LIST_MAP. */ /** * THE_PREFIX_STRUCT_TYPE_STRUCT: * (Undocumented) * * This macro expands to a call to a function * that returns the #GType of a #GValueArray * appropriate for representing a D-Bus struct * with signature (isu). * * Member 0 (D-Bus type i, * named Int): * (Undocumented) * * Member 1 (D-Bus type s, * named String): * (Undocumented) * * Member 2 (D-Bus type u, * named UInt): * (Undocumented) * */ /** * THE_PREFIX_ARRAY_TYPE_STRUCT_LIST: * Expands to a call to a function * that returns the #GType of a #GPtrArray * of #THE_PREFIX_STRUCT_TYPE_STRUCT. */ telepathy-glib-0.24.2/tests/README0000644000175000017500000000111712652510705013457 00000000000000Where to put new tests: /tests/ if they're simple regression tests that don't touch the session bus /tests/dbus/ if they touch the session bus (a temporary session bus will be used) /tests/tools/ if they're shell scripts that test the code generation tools To run a single test: make -C tests/dbus check TESTS=test-contacts If you're running a test under a debugger, export TP_TESTS_NO_TIMEOUT=1 to avoid it being killed for taking too long. Generate tests coverage report ============================== make clean ./configure --enable-compiler-coverage make check make lcov-report telepathy-glib-0.24.2/tests/availability-cmp.c0000644000175000017500000000101612652510705016170 00000000000000#include "config.h" #include #include int main (int argc, char **argv) { g_assert (tp_connection_presence_type_cmp_availability ( TP_CONNECTION_PRESENCE_TYPE_AWAY, TP_CONNECTION_PRESENCE_TYPE_UNSET) == 1); g_assert (tp_connection_presence_type_cmp_availability ( TP_CONNECTION_PRESENCE_TYPE_BUSY, TP_CONNECTION_PRESENCE_TYPE_AVAILABLE) == -1); g_assert (tp_connection_presence_type_cmp_availability ( TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, 100) == 0); return 0; } telepathy-glib-0.24.2/tests/tests.supp0000644000175000017500000000024112652510705014647 00000000000000# Valgrind error suppression file { static classes in tests Memcheck:Leak ... fun:g_type_class_ref ... fun:tp_tests_object_new_static_class } telepathy-glib-0.24.2/tests/enums.c0000644000175000017500000000235412652510705014076 00000000000000/* Test enum #defines are up to date * * Copyright (C) 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include #include "tests/lib/debug.h" #include "tests/lib/util.h" static void test_tp_contact_feature (void) { GEnumClass *klass; klass = g_type_class_ref (TP_TYPE_CONTACT_FEATURE); g_assert (klass != NULL); g_assert (G_IS_ENUM_CLASS (klass)); g_assert_cmpint (klass->n_values, ==, TP_NUM_CONTACT_FEATURES); g_type_class_unref (klass); } static void test_tp_dbus_error (void) { GEnumClass *klass; klass = g_type_class_ref (TP_TYPE_DBUS_ERROR); g_assert (klass != NULL); g_assert (G_IS_ENUM_CLASS (klass)); g_assert_cmpint (klass->n_values, ==, TP_NUM_DBUS_ERRORS); } int main (int argc, char **argv) { g_test_init (&argc, &argv, NULL); g_test_add_func ("/enums/tp-contact-feature", test_tp_contact_feature); g_test_add_func ("/enums/tp-dbus-error", test_tp_dbus_error); return g_test_run (); } telepathy-glib-0.24.2/tests/gnio-util.c0000644000175000017500000002152312652510705014655 00000000000000/* tests of the GNIO utility functions */ #include "config.h" #include #include #include #include #ifdef HAVE_GIO_UNIX #include #endif /* HAVE_GIO_UNIX */ #include #include #include #define IPV4_ADDR "127.0.1.1" #define IPV6_ADDR "::1" #define UNIX_ADDR "/tmp/socket/test/123456" #define ABST_ADDR "\000" "123456" "NOT_COPIED" #define ABST_ADDR_LEN 7 #define PORT 41414 static void test_variant_to_sockaddr_ipv4 (void) { GSocketAddress *sockaddr; GInetSocketAddress *inetaddr; GInetAddress *hostaddr; char *host; guint16 port; GError *error = NULL; sockaddr = tp_g_socket_address_from_g_variant (TP_SOCKET_ADDRESS_TYPE_IPV4, g_variant_new_parsed ("(%s, %u)", IPV4_ADDR, (guint32) PORT), &error); /* check the socket address */ g_assert_no_error (error); g_assert (sockaddr != NULL); g_assert (G_IS_INET_SOCKET_ADDRESS (sockaddr)); inetaddr = G_INET_SOCKET_ADDRESS (sockaddr); hostaddr = g_inet_socket_address_get_address (inetaddr); host = g_inet_address_to_string (hostaddr); port = g_inet_socket_address_get_port (inetaddr); g_assert_cmpstr (host, ==, IPV4_ADDR); g_assert_cmpuint (port, ==, PORT); g_free (host); g_object_unref (sockaddr); } static void test_variant_to_sockaddr_ipv6 (void) { GSocketAddress *sockaddr; GInetSocketAddress *inetaddr; GInetAddress *hostaddr; char *host; guint16 port; GError *error = NULL; sockaddr = tp_g_socket_address_from_g_variant (TP_SOCKET_ADDRESS_TYPE_IPV6, g_variant_new_parsed ("(%s, %u)", IPV6_ADDR, (guint32) PORT), &error); /* check the socket address */ g_assert_no_error (error); g_assert (sockaddr != NULL); g_assert (G_IS_INET_SOCKET_ADDRESS (sockaddr)); inetaddr = G_INET_SOCKET_ADDRESS (sockaddr); hostaddr = g_inet_socket_address_get_address (inetaddr); host = g_inet_address_to_string (hostaddr); port = g_inet_socket_address_get_port (inetaddr); g_assert_cmpstr (host, ==, IPV6_ADDR); g_assert_cmpuint (port, ==, PORT); g_free (host); g_object_unref (sockaddr); } static void test_sockaddr_to_variant_ipv4 (void) { GInetAddress *hostaddr = g_inet_address_new_from_string (IPV4_ADDR); GSocketAddress *sockaddr = g_inet_socket_address_new (hostaddr, PORT); GValue *variant, *value; GVariant *gvariant, *other; GValueArray *array; TpSocketAddressType type; GError *error = NULL; g_object_unref (hostaddr); variant = tp_address_variant_from_g_socket_address (sockaddr, &type, &error); g_assert_no_error (error); gvariant = tp_address_g_variant_from_g_socket_address (sockaddr, &type, &error); g_object_unref (sockaddr); g_assert_no_error (error); g_assert_cmpuint (type, ==, TP_SOCKET_ADDRESS_TYPE_IPV4); g_assert (G_VALUE_HOLDS (variant, TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4)); array = g_value_get_boxed (variant); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (array, 0); G_GNUC_END_IGNORE_DEPRECATIONS g_assert (G_VALUE_HOLDS_STRING (value)); g_assert_cmpstr (g_value_get_string (value), ==, IPV4_ADDR); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (array, 1); G_GNUC_END_IGNORE_DEPRECATIONS g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, PORT); tp_g_value_slice_free (variant); g_assert (g_variant_is_floating (gvariant)); other = g_variant_new_parsed ("(%s, %u)", IPV4_ADDR, (guint32) PORT); g_assert (g_variant_equal (gvariant, other)); g_variant_unref (gvariant); g_variant_unref (other); } static void test_sockaddr_to_variant_ipv6 (void) { GInetAddress *hostaddr = g_inet_address_new_from_string (IPV6_ADDR); GSocketAddress *sockaddr = g_inet_socket_address_new (hostaddr, PORT); GValue *variant, *value; GValueArray *array; GVariant *gvariant, *other; TpSocketAddressType type; GError *error = NULL; g_object_unref (hostaddr); variant = tp_address_variant_from_g_socket_address (sockaddr, &type, &error); g_assert_no_error (error); gvariant = tp_address_g_variant_from_g_socket_address (sockaddr, &type, &error); g_object_unref (sockaddr); g_assert_no_error (error); g_assert_cmpuint (type, ==, TP_SOCKET_ADDRESS_TYPE_IPV6); g_assert (G_VALUE_HOLDS (variant, TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6)); array = g_value_get_boxed (variant); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (array, 0); G_GNUC_END_IGNORE_DEPRECATIONS g_assert (G_VALUE_HOLDS_STRING (value)); g_assert_cmpstr (g_value_get_string (value), ==, IPV6_ADDR); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (array, 1); G_GNUC_END_IGNORE_DEPRECATIONS g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, PORT); tp_g_value_slice_free (variant); g_assert (g_variant_is_floating (gvariant)); other = g_variant_new_parsed ("(%s, %u)", IPV6_ADDR, (guint32) PORT); g_assert (g_variant_equal (gvariant, other)); g_variant_unref (gvariant); g_variant_unref (other); } #ifdef HAVE_GIO_UNIX static void test_variant_to_sockaddr_unix (void) { GArray *array; GValue value = { 0, }; GSocketAddress *sockaddr; GUnixSocketAddress *unixaddr; guint pathlen = strlen (UNIX_ADDR); GError *error = NULL; array = g_array_sized_new (TRUE, FALSE, sizeof (char), pathlen); g_array_append_vals (array, UNIX_ADDR, pathlen); g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); g_value_take_boxed (&value, array); sockaddr = tp_g_socket_address_from_variant (TP_SOCKET_ADDRESS_TYPE_UNIX, &value, &error); g_value_unset (&value); g_assert_no_error (error); g_assert (G_IS_UNIX_SOCKET_ADDRESS (sockaddr)); unixaddr = G_UNIX_SOCKET_ADDRESS (sockaddr); g_assert (g_unix_socket_address_get_address_type (unixaddr) != G_UNIX_SOCKET_ADDRESS_ABSTRACT); g_assert_cmpuint (g_unix_socket_address_get_path_len (unixaddr), ==, pathlen); g_assert_cmpstr (g_unix_socket_address_get_path (unixaddr), ==, UNIX_ADDR); g_object_unref (sockaddr); } static void test_variant_to_sockaddr_abstract_unix (void) { GArray *array; GValue value = { 0, }; GSocketAddress *sockaddr; GUnixSocketAddress *unixaddr; GError *error = NULL; array = g_array_sized_new (TRUE, FALSE, sizeof (char), ABST_ADDR_LEN); g_array_append_vals (array, ABST_ADDR, ABST_ADDR_LEN); g_value_init (&value, DBUS_TYPE_G_UCHAR_ARRAY); g_value_take_boxed (&value, array); sockaddr = tp_g_socket_address_from_variant ( TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX, &value, &error); g_value_unset (&value); g_assert_no_error (error); g_assert (G_IS_UNIX_SOCKET_ADDRESS (sockaddr)); unixaddr = G_UNIX_SOCKET_ADDRESS (sockaddr); g_assert (g_unix_socket_address_get_address_type (unixaddr) == G_UNIX_SOCKET_ADDRESS_ABSTRACT); g_assert_cmpuint (g_unix_socket_address_get_path_len (unixaddr), ==, ABST_ADDR_LEN); g_assert (memcmp (g_unix_socket_address_get_path (unixaddr), ABST_ADDR, ABST_ADDR_LEN) == 0); g_object_unref (sockaddr); } static void test_sockaddr_to_variant_unix (void) { GSocketAddress *sockaddr = g_unix_socket_address_new (UNIX_ADDR); GValue *variant; GArray *array; TpSocketAddressType type; GError *error = NULL; variant = tp_address_variant_from_g_socket_address (sockaddr, &type, &error); g_object_unref (sockaddr); g_assert_no_error (error); g_assert_cmpuint (type, ==, TP_SOCKET_ADDRESS_TYPE_UNIX); g_assert (G_VALUE_HOLDS (variant, DBUS_TYPE_G_UCHAR_ARRAY)); array = g_value_get_boxed (variant); g_assert_cmpuint (array->len, ==, strlen (UNIX_ADDR)); g_assert_cmpstr (array->data, ==, UNIX_ADDR); tp_g_value_slice_free (variant); } static void test_sockaddr_to_variant_abstract_unix (void) { GSocketAddress *sockaddr = g_unix_socket_address_new_with_type ( ABST_ADDR, ABST_ADDR_LEN, G_UNIX_SOCKET_ADDRESS_ABSTRACT); GValue *variant; GArray *array; TpSocketAddressType type; GError *error = NULL; variant = tp_address_variant_from_g_socket_address (sockaddr, &type, &error); g_object_unref (sockaddr); g_assert_no_error (error); g_assert_cmpuint (type, ==, TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX); g_assert (G_VALUE_HOLDS (variant, DBUS_TYPE_G_UCHAR_ARRAY)); array = g_value_get_boxed (variant); g_assert_cmpuint (array->len, ==, ABST_ADDR_LEN); g_assert (memcmp (array->data, ABST_ADDR, ABST_ADDR_LEN) == 0); tp_g_value_slice_free (variant); } #endif /* HAVE_GIO_UNIX */ int main (int argc, char **argv) { dbus_g_type_specialized_init (); test_variant_to_sockaddr_ipv4 (); test_variant_to_sockaddr_ipv6 (); test_sockaddr_to_variant_ipv4 (); test_sockaddr_to_variant_ipv6 (); #ifdef HAVE_GIO_UNIX test_variant_to_sockaddr_unix (); test_variant_to_sockaddr_abstract_unix (); test_sockaddr_to_variant_unix (); test_sockaddr_to_variant_abstract_unix (); #endif /* HAVE_GIO_UNIX */ return 0; } telepathy-glib-0.24.2/tests/signal-connect-object.c0000644000175000017500000001162412652510705017117 00000000000000/* Regression test for fd.o#27242 * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include "tests/lib/stub-object.h" #include "tests/lib/util.h" typedef struct { guint caught; GObject *emitter; GObject *observer; } Test; #define DATA_KEY "signal-connect-object Test struct" static void increment_caught (GObject *emitter, GParamSpec *param_spec, gpointer user_data) { GObject *observer = user_data; Test *test = g_object_get_data (observer, DATA_KEY); g_assert (test->emitter != NULL); g_assert (G_IS_OBJECT (test->emitter)); g_assert (emitter != NULL); g_assert (emitter == test->emitter); g_assert (test->observer != NULL); g_assert (G_IS_OBJECT (test->observer)); g_assert (observer != NULL); g_assert (observer == test->observer); g_assert (param_spec != NULL); g_assert_cmpstr (g_param_spec_get_name (param_spec), ==, "name"); test->caught++; } static void increment_caught_swapped (gpointer user_data, GParamSpec *param_spec, GObject *emitter) { increment_caught (emitter, param_spec, user_data); } static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); test->caught = 0; test->observer = tp_tests_object_new_static_class ( tp_tests_stub_object_get_type (), NULL); g_object_set_data (test->observer, DATA_KEY, test); test->emitter = tp_tests_object_new_static_class ( tp_tests_stub_object_get_type (), NULL); } static void teardown (Test *test, gconstpointer data) { tp_clear_object (&test->emitter); tp_clear_object (&test->observer); } static void test_no_unref (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught), test->observer, 0); g_object_notify (test->emitter, "name"); g_assert_cmpuint (test->caught, ==, 1); } static void test_swapped (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught_swapped), test->observer, G_CONNECT_SWAPPED); g_object_notify (test->emitter, "name"); g_assert_cmpuint (test->caught, ==, 1); } static void test_dead_observer (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught), test->observer, 0); g_object_notify (test->emitter, "name"); g_object_notify (test->emitter, "name"); tp_clear_object (&test->observer); g_object_notify (test->emitter, "name"); g_assert_cmpuint (test->caught, ==, 2); } static void test_dead_emitter (Test *test, gconstpointer data G_GNUC_UNUSED) { tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught), test->observer, 0); g_object_notify (test->emitter, "name"); g_object_notify (test->emitter, "name"); tp_clear_object (&test->emitter); g_assert_cmpuint (test->caught, ==, 2); } static void test_disconnected (Test *test, gconstpointer data G_GNUC_UNUSED) { gulong id; id = tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught), test->observer, 0); g_object_notify (test->emitter, "name"); g_object_notify (test->emitter, "name"); g_signal_handler_disconnect (test->emitter, id); g_object_notify (test->emitter, "name"); g_assert_cmpuint (test->caught, ==, 2); } static void test_dead_observer_and_disconnected (Test *test, gconstpointer data G_GNUC_UNUSED) { gulong id; id = tp_g_signal_connect_object (test->emitter, "notify::name", G_CALLBACK (increment_caught), test->observer, 0); g_object_notify (test->emitter, "name"); g_object_notify (test->emitter, "name"); g_signal_handler_disconnect (test->emitter, id); tp_clear_object (&test->observer); g_object_notify (test->emitter, "name"); g_assert_cmpuint (test->caught, ==, 2); } int main (int argc, char **argv) { #define TEST_PREFIX "/signal-connect-object/" g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add (TEST_PREFIX "no_unref", Test, NULL, setup, test_no_unref, teardown); g_test_add (TEST_PREFIX "swapped", Test, NULL, setup, test_swapped, teardown); g_test_add (TEST_PREFIX "dead_observer", Test, NULL, setup, test_dead_observer, teardown); g_test_add (TEST_PREFIX "dead_emitter", Test, NULL, setup, test_dead_emitter, teardown); g_test_add (TEST_PREFIX "disconnected", Test, NULL, setup, test_disconnected, teardown); g_test_add (TEST_PREFIX "dead_observer_and_disconnected", Test, NULL, setup, test_dead_observer_and_disconnected, teardown); return g_test_run (); } telepathy-glib-0.24.2/tests/capabilities.c0000644000175000017500000011222212652510705015374 00000000000000#include "config.h" #include #include #include "telepathy-glib/capabilities-internal.h" #include #include #include #include #include #include #include "tests/lib/util.h" typedef struct { gpointer unused; } Test; static void setup (Test *test, gconstpointer data) { tp_debug_set_flags ("all"); } static void add_text_chat_class (GPtrArray *classes, TpHandleType handle_type) { GHashTable *fixed; const gchar * const allowed[] = { NULL }; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static void add_ft_class (GPtrArray *classes, const gchar * const *allowed) { GHashTable *fixed; const gchar * const default_allowed[] = { TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, NULL }; GValueArray *arr; if (allowed == NULL) allowed = default_allowed; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static void test_basics (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; GValueArray *arr; GHashTable *fixed; GStrv allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; /* TpCapabilities containing the text chats and ft caps */ classes = g_ptr_array_sized_new (2); add_text_chat_class (classes, TP_HANDLE_TYPE_CONTACT); add_ft_class (classes, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_is_specific_to_contact (caps)); classes = tp_capabilities_get_channel_classes (caps); g_assert_cmpuint (classes->len, ==, 2); /* Check text chats class */ arr = g_ptr_array_index (classes, 0); g_assert_cmpuint (arr->n_values, ==, 2); G_GNUC_BEGIN_IGNORE_DEPRECATIONS fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0)); allowed = g_value_get_boxed (g_value_array_get_nth (arr, 1)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_assert_cmpuint (g_hash_table_size (fixed), ==, 2); chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); g_assert_cmpstr (chan_type, ==, TP_IFACE_CHANNEL_TYPE_TEXT); handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); g_assert (valid); g_assert_cmpuint (handle_type, ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (g_strv_length (allowed), ==, 0); /* Check ft class */ arr = g_ptr_array_index (classes, 1); g_assert_cmpuint (arr->n_values, ==, 2); G_GNUC_BEGIN_IGNORE_DEPRECATIONS fixed = g_value_get_boxed (g_value_array_get_nth (arr, 0)); allowed = g_value_get_boxed (g_value_array_get_nth (arr, 1)); G_GNUC_END_IGNORE_DEPRECATIONS g_assert_cmpuint (g_hash_table_size (fixed), ==, 2); chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); g_assert_cmpstr (chan_type, ==, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER); handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); g_assert (valid); g_assert_cmpuint (handle_type, ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (g_strv_length (allowed), ==, 2); g_assert (tp_strv_contains ((const gchar * const * ) allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME)); g_assert (tp_strv_contains ((const gchar * const * ) allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE)); g_object_unref (caps); } static void test_supports (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; /* TpCapabilities containing the text chats caps */ classes = g_ptr_array_sized_new (1); add_text_chat_class (classes, TP_HANDLE_TYPE_CONTACT); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_is_specific_to_contact (caps)); g_assert (tp_capabilities_supports_text_chats (caps)); g_assert (!tp_capabilities_supports_text_chatrooms (caps)); g_assert (!tp_capabilities_supports_sms (caps)); g_object_unref (caps); /* TpCapabilities containing the text chatrooms caps */ classes = g_ptr_array_sized_new (1); add_text_chat_class (classes, TP_HANDLE_TYPE_ROOM); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_is_specific_to_contact (caps)); g_assert (!tp_capabilities_supports_text_chats (caps)); g_assert (tp_capabilities_supports_text_chatrooms (caps)); g_assert (!tp_capabilities_supports_sms (caps)); g_object_unref (caps); /* TpCapabilities containing both caps */ classes = g_ptr_array_sized_new (2); add_text_chat_class (classes, TP_HANDLE_TYPE_CONTACT); add_text_chat_class (classes, TP_HANDLE_TYPE_ROOM); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_is_specific_to_contact (caps)); g_assert (tp_capabilities_supports_text_chats (caps)); g_assert (tp_capabilities_supports_text_chatrooms (caps)); g_assert (!tp_capabilities_supports_sms (caps)); g_object_unref (caps); /* TpCapabilities containing no caps */ caps = _tp_capabilities_new (NULL, TRUE); g_assert (tp_capabilities_is_specific_to_contact (caps)); g_assert (!tp_capabilities_supports_text_chats (caps)); g_assert (!tp_capabilities_supports_text_chatrooms (caps)); g_assert (!tp_capabilities_supports_sms (caps)); classes = tp_capabilities_get_channel_classes (caps); g_assert_cmpuint (classes->len, ==, 0); g_object_unref (caps); } static void add_stream_tube_class (GPtrArray *classes, TpHandleType handle_type, const gchar *service) { GHashTable *fixed; const gchar * const allowed[] = { NULL }; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); if (service != NULL) { tp_asv_set_string (fixed, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, service); } arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static void add_dbus_tube_class (GPtrArray *classes, TpHandleType handle_type, const gchar *service_name, gboolean add_extra_fixed) { GHashTable *fixed; const gchar * const allowed[] = { NULL }; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); if (service_name != NULL) { tp_asv_set_string (fixed, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, service_name); } if (add_extra_fixed) tp_asv_set_boolean (fixed, "ExtraBadgersRequired", TRUE); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static void test_supports_tube (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; /* TpCapabilities containing no caps */ caps = _tp_capabilities_new (NULL, TRUE); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private stream tube caps without service */ classes = g_ptr_array_sized_new (1); add_stream_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private and muc stream tube caps without * service */ classes = g_ptr_array_sized_new (2); add_stream_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL); add_stream_tube_class (classes, TP_HANDLE_TYPE_ROOM, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private and muc stream tube caps and * one with a service */ classes = g_ptr_array_sized_new (4); add_stream_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL); add_stream_tube_class (classes, TP_HANDLE_TYPE_ROOM, NULL); add_stream_tube_class (classes, TP_HANDLE_TYPE_CONTACT, "test-service"); add_stream_tube_class (classes, TP_HANDLE_TYPE_ROOM, "test-service"); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "badger")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "badger")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* Connection capabilities */ classes = g_ptr_array_sized_new (2); add_stream_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); /* the service is meaningless for connection capabilities */ g_assert (tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); /* the service name is meaningless for connection capabilities */ g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private dbus tube caps without service */ classes = g_ptr_array_sized_new (1); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private and muc dbus tube caps without * service */ classes = g_ptr_array_sized_new (2); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL, FALSE); add_dbus_tube_class (classes, TP_HANDLE_TYPE_ROOM, NULL, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_object_unref (caps); /* TpCapabilities containing the private and muc dbus tube caps and * one with a service */ classes = g_ptr_array_sized_new (4); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL, FALSE); add_dbus_tube_class (classes, TP_HANDLE_TYPE_ROOM, NULL, FALSE); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, "com.Test", FALSE); add_dbus_tube_class (classes, TP_HANDLE_TYPE_ROOM, "com.Test", FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_CONTACT, "test-service")); g_assert (!tp_capabilities_supports_stream_tubes (caps, TP_HANDLE_TYPE_ROOM, "test-service")); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, NULL)); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Test")); g_assert (tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Test")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, "com.Badger")); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_ROOM, "com.Badger")); g_object_unref (caps); /* Any extra fixed prop make it unsupported */ classes = g_ptr_array_sized_new (1); add_dbus_tube_class (classes, TP_HANDLE_TYPE_CONTACT, NULL, TRUE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_dbus_tubes (caps, TP_HANDLE_TYPE_CONTACT, NULL)); g_object_unref (caps); } static void add_room_list_class (GPtrArray *classes, gboolean server, gboolean add_extra_fixed) { GHashTable *fixed; const gchar * const allowed[] = { TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, NULL }; const gchar * const no_allowed[] = { NULL }; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE, NULL); if (add_extra_fixed) tp_asv_set_boolean (fixed, "ExtraBadgersRequired", TRUE); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, server ? allowed : no_allowed, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_add (classes, arr); } static void test_supports_room_list (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; gboolean with_server = TRUE; /* Does not support room list */ classes = g_ptr_array_sized_new (4); add_ft_class (classes, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_room_list (caps, &with_server)); g_assert (!with_server); g_object_unref (caps); /* Support room list but no server */ classes = g_ptr_array_sized_new (4); add_ft_class (classes, NULL); add_room_list_class (classes, FALSE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_room_list (caps, &with_server)); g_assert (!with_server); g_object_unref (caps); /* Support room list with server */ classes = g_ptr_array_sized_new (4); add_ft_class (classes, NULL); add_room_list_class (classes, TRUE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_room_list (caps, &with_server)); g_assert (with_server); g_object_unref (caps); /* Any extra fixed prop make it unsupported */ classes = g_ptr_array_sized_new (1); add_room_list_class (classes, FALSE, TRUE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_room_list (caps, NULL)); g_object_unref (caps); } static void add_sms_class (GPtrArray *classes, gboolean add_extra_fixed, gboolean use_allowed) { GHashTable *fixed; GPtrArray *allowed; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL); allowed = g_ptr_array_new (); if (use_allowed) { g_ptr_array_add (allowed, TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL); } else { tp_asv_set_boolean (fixed, TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, TRUE); } g_ptr_array_add (allowed, NULL); if (add_extra_fixed) tp_asv_set_boolean (fixed, "ExtraBadgersRequired", TRUE); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed->pdata, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_unref (allowed); g_ptr_array_add (classes, arr); } static void test_supports_sms (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; classes = g_ptr_array_sized_new (1); add_sms_class (classes, FALSE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_sms (caps)); g_object_unref (caps); /* Reject if more fixed properties are required */ classes = g_ptr_array_sized_new (1); add_sms_class (classes, TRUE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_sms (caps)); g_object_unref (caps); /* Test with SMS as an allowed property */ classes = g_ptr_array_sized_new (1); add_sms_class (classes, FALSE, TRUE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_sms (caps)); g_object_unref (caps); } static void add_call_class (GPtrArray *classes, TpHandleType handle_type, gboolean initial_audio, gboolean initial_video, gboolean use_allowed, gboolean add_extra_fixed) { GHashTable *fixed; GPtrArray *allowed; GValueArray *arr; fixed = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); allowed = g_ptr_array_new (); if (initial_audio) { if (use_allowed) { g_ptr_array_add (allowed, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO); } else { tp_asv_set_boolean (fixed, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, TRUE); } } if (initial_video) { if (use_allowed) { g_ptr_array_add (allowed, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO); } else { tp_asv_set_boolean (fixed, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, TRUE); } } g_ptr_array_add (allowed, NULL); if (add_extra_fixed) tp_asv_set_boolean (fixed, "ExtraBadgersRequired", TRUE); arr = tp_value_array_build (2, TP_HASH_TYPE_STRING_VARIANT_MAP, fixed, G_TYPE_STRV, allowed->pdata, G_TYPE_INVALID); g_hash_table_unref (fixed); g_ptr_array_unref (allowed); g_ptr_array_add (classes, arr); } static void test_supports_call (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; /* A class with no audio/video can't do anything */ classes = g_ptr_array_sized_new (1); add_call_class (classes, TP_HANDLE_TYPE_CONTACT, FALSE, FALSE, FALSE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_audio_call (caps, TP_HANDLE_TYPE_CONTACT)); g_assert (!tp_capabilities_supports_audio_video_call (caps, TP_HANDLE_TYPE_CONTACT)); g_object_unref (caps); /* A class with only audio can't do audio_video */ classes = g_ptr_array_sized_new (1); add_call_class (classes, TP_HANDLE_TYPE_CONTACT, TRUE, FALSE, FALSE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_audio_call (caps, TP_HANDLE_TYPE_CONTACT)); g_assert (!tp_capabilities_supports_audio_video_call (caps, TP_HANDLE_TYPE_CONTACT)); g_object_unref (caps); /* A class with audio and video in fixed can't do audio only */ classes = g_ptr_array_sized_new (1); add_call_class (classes, TP_HANDLE_TYPE_CONTACT, TRUE, TRUE, FALSE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_audio_call (caps, TP_HANDLE_TYPE_CONTACT)); g_assert (tp_capabilities_supports_audio_video_call (caps, TP_HANDLE_TYPE_CONTACT)); g_object_unref (caps); /* A class with audio and video in allowed can do audio only */ classes = g_ptr_array_sized_new (1); add_call_class (classes, TP_HANDLE_TYPE_CONTACT, TRUE, TRUE, TRUE, FALSE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_audio_call (caps, TP_HANDLE_TYPE_CONTACT)); g_assert (tp_capabilities_supports_audio_video_call (caps, TP_HANDLE_TYPE_CONTACT)); g_object_unref (caps); /* A class with unknown extra fixed can't do anything */ classes = g_ptr_array_sized_new (1); add_call_class (classes, TP_HANDLE_TYPE_CONTACT, TRUE, TRUE, TRUE, TRUE); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (!tp_capabilities_supports_audio_call (caps, TP_HANDLE_TYPE_CONTACT)); g_assert (!tp_capabilities_supports_audio_video_call (caps, TP_HANDLE_TYPE_CONTACT)); g_object_unref (caps); } static void test_supports_ft_props (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; const gchar * const allow_uri[] = { TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI, NULL }; const gchar * const allow_desc[] = { TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, NULL }; const gchar * const allow_date[] = { TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, NULL }; const gchar * const allow_initial_offset[] = { TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, NULL }; /* TpCapabilities containing no caps */ caps = _tp_capabilities_new (NULL, TRUE); g_assert (!tp_capabilities_supports_file_transfer (caps)); g_assert (!tp_capabilities_supports_file_transfer_uri (caps)); g_assert (!tp_capabilities_supports_file_transfer_description (caps)); g_assert (!tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (!tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); classes = g_ptr_array_sized_new (1); add_ft_class (classes, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_file_transfer (caps)); g_assert (!tp_capabilities_supports_file_transfer_uri (caps)); g_assert (!tp_capabilities_supports_file_transfer_description (caps)); g_assert (!tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (!tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); classes = g_ptr_array_sized_new (1); add_ft_class (classes, allow_uri); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_file_transfer (caps)); g_assert (tp_capabilities_supports_file_transfer_uri (caps)); g_assert (!tp_capabilities_supports_file_transfer_description (caps)); g_assert (!tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (!tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); classes = g_ptr_array_sized_new (1); add_ft_class (classes, allow_desc); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_file_transfer (caps)); g_assert (!tp_capabilities_supports_file_transfer_uri (caps)); g_assert (tp_capabilities_supports_file_transfer_description (caps)); g_assert (!tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (!tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); classes = g_ptr_array_sized_new (1); add_ft_class (classes, allow_date); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_file_transfer (caps)); g_assert (!tp_capabilities_supports_file_transfer_uri (caps)); g_assert (!tp_capabilities_supports_file_transfer_description (caps)); g_assert (tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (!tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); classes = g_ptr_array_sized_new (1); add_ft_class (classes, allow_initial_offset); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", TRUE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); g_assert (tp_capabilities_supports_file_transfer (caps)); g_assert (!tp_capabilities_supports_file_transfer_uri (caps)); g_assert (!tp_capabilities_supports_file_transfer_description (caps)); g_assert (!tp_capabilities_supports_file_transfer_timestamp (caps)); g_assert (tp_capabilities_supports_file_transfer_initial_offset (caps)); g_object_unref (caps); } static void test_classes_variant (Test *test, gconstpointer data G_GNUC_UNUSED) { TpCapabilities *caps; GPtrArray *classes; GVariant *v, *v2, *class, *fixed, *allowed; const gchar *chan_type; guint32 handle_type; const gchar **strv; /* TpCapabilities containing the text chats and ft caps */ classes = g_ptr_array_sized_new (2); add_text_chat_class (classes, TP_HANDLE_TYPE_CONTACT); add_ft_class (classes, NULL); caps = tp_tests_object_new_static_class (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", FALSE, NULL); g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, classes); v = tp_capabilities_dup_channel_classes_variant (caps); g_assert (v != NULL); g_assert_cmpstr (g_variant_get_type_string (v), ==, "a(a{sv}as)"); g_assert_cmpuint (g_variant_n_children (v), ==, 2); /* Check text chats class */ class = g_variant_get_child_value (v, 0); g_assert_cmpstr (g_variant_get_type_string (class), ==, "(a{sv}as)"); g_assert_cmpuint (g_variant_n_children (class), ==, 2); fixed = g_variant_get_child_value (class, 0); allowed = g_variant_get_child_value (class, 1); g_assert_cmpuint (g_variant_n_children (fixed), ==, 2); g_assert (g_variant_lookup (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE, "&s", &chan_type)); g_assert_cmpstr (chan_type, ==, TP_IFACE_CHANNEL_TYPE_TEXT); g_assert (g_variant_lookup (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, "u", &handle_type)); g_assert_cmpuint (handle_type, ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (g_variant_n_children (allowed), ==, 0); g_variant_unref (class); g_variant_unref (fixed); g_variant_unref (allowed); /* Check ft class */ class = g_variant_get_child_value (v, 1); g_assert_cmpstr (g_variant_get_type_string (class), ==, "(a{sv}as)"); g_assert_cmpuint (g_variant_n_children (class), ==, 2); fixed = g_variant_get_child_value (class, 0); allowed = g_variant_get_child_value (class, 1); g_assert_cmpuint (g_variant_n_children (fixed), ==, 2); g_assert (g_variant_lookup (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE, "&s", &chan_type)); g_assert_cmpstr (chan_type, ==, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER); g_assert (g_variant_lookup (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, "u", &handle_type)); g_assert_cmpuint (handle_type, ==, TP_HANDLE_TYPE_CONTACT); g_assert_cmpuint (g_variant_n_children (allowed), ==, 2); strv = g_variant_get_strv (allowed, NULL); g_assert (tp_strv_contains ((const gchar * const * ) strv, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME)); g_assert (tp_strv_contains ((const gchar * const * ) strv, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE)); g_free (strv); g_variant_unref (class); g_variant_unref (fixed); g_variant_unref (allowed); /* Test GObject getter */ g_object_get (caps, "channel-classes-variant", &v2, NULL); g_assert (g_variant_equal (v, v2)); g_variant_unref (v); g_variant_unref (v2); g_object_unref (caps); } int main (int argc, char **argv) { #define TEST_PREFIX "/capabilities/" g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add (TEST_PREFIX "basics", Test, NULL, setup, test_basics, NULL); g_test_add (TEST_PREFIX "supports", Test, NULL, setup, test_supports, NULL); g_test_add (TEST_PREFIX "supports/ft-props", Test, NULL, setup, test_supports_ft_props, NULL); g_test_add (TEST_PREFIX "supports/tube", Test, NULL, setup, test_supports_tube, NULL); g_test_add (TEST_PREFIX "supports/room-list", Test, NULL, setup, test_supports_room_list, NULL); g_test_add (TEST_PREFIX "supports/sms", Test, NULL, setup, test_supports_sms, NULL); g_test_add (TEST_PREFIX "supports/call", Test, NULL, setup, test_supports_call, NULL); g_test_add (TEST_PREFIX "classes-variant", Test, NULL, setup, test_classes_variant, NULL); return g_test_run (); } telepathy-glib-0.24.2/tests/dtmf-player.c0000644000175000017500000001750412652510705015176 00000000000000#include "config.h" #include "telepathy-glib/dtmf.h" #include #include "tests/lib/util.h" static void test_to_char (void) { g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_0), ==, '0'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_1), ==, '1'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_2), ==, '2'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_3), ==, '3'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_4), ==, '4'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_5), ==, '5'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_6), ==, '6'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_7), ==, '7'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_8), ==, '8'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_DIGIT_9), ==, '9'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_LETTER_A), ==, 'A'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_LETTER_B), ==, 'B'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_LETTER_C), ==, 'C'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_LETTER_D), ==, 'D'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_HASH), ==, '#'); g_assert_cmpint (tp_dtmf_event_to_char (TP_DTMF_EVENT_ASTERISK), ==, '*'); } typedef struct { TpDTMFPlayer *dtmf_player; GString *log; GError *error /* initially NULL */ ; } Fixture; static void fixture_log (Fixture *f, const gchar *format, ...) { va_list ap; va_start (ap, format); g_string_append_vprintf (f->log, format, ap); g_string_append_c (f->log, '\n'); va_end (ap); } static void fixture_assert_log (Fixture *f, const gchar *expected) { g_assert_cmpstr (f->log->str, ==, expected); } static void started_tone_cb (TpDTMFPlayer *dtmf_player G_GNUC_UNUSED, guint event, Fixture *f) { fixture_log (f, "started '%c'", tp_dtmf_event_to_char (event)); } static void stopped_tone_cb (TpDTMFPlayer *dtmf_player G_GNUC_UNUSED, Fixture *f) { fixture_log (f, "stopped"); } static void finished_cb (TpDTMFPlayer *dtmf_player G_GNUC_UNUSED, gboolean cancelled, Fixture *f) { if (cancelled) fixture_log (f, "cancelled"); else fixture_log (f, "finished"); } static void deferred_cb (TpDTMFPlayer *dtmf_player G_GNUC_UNUSED, const gchar *tones, Fixture *f) { fixture_log (f, "deferred '%s'", tones); } static void setup (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { f->dtmf_player = tp_dtmf_player_new (); g_assert (f->dtmf_player != NULL); f->log = g_string_new (""); g_signal_connect (f->dtmf_player, "started-tone", G_CALLBACK (started_tone_cb), f); g_signal_connect (f->dtmf_player, "stopped-tone", G_CALLBACK (stopped_tone_cb), f); g_signal_connect (f->dtmf_player, "finished", G_CALLBACK (finished_cb), f); g_signal_connect (f->dtmf_player, "tones-deferred", G_CALLBACK (deferred_cb), f); } static void teardown (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { g_signal_handlers_disconnect_matched (f->dtmf_player, G_SIGNAL_MATCH_DATA, 0, 0, 0, 0, f); tp_clear_object (&f->dtmf_player); g_string_free (f->log, TRUE); g_clear_error (&f->error); } static void test_noop (Fixture *f G_GNUC_UNUSED, gconstpointer nil G_GNUC_UNUSED) { } static void test_empty (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "", 1, 1, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (!tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "finished\n"); } static void test_cancel (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "#", 10000, 1, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); tp_dtmf_player_cancel (f->dtmf_player); g_assert (!tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '#'\n" "stopped\n" "cancelled\n"); } static void test_cancel_in_gap (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "#*", 1, 10000, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '#'\n"); tp_dtmf_player_cancel (f->dtmf_player); g_assert (!tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '#'\n" "stopped\n" "cancelled\n"); } static void test_cancel_in_pause (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "#p*", 1, 1, 10000, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '#'\n"); /* wait 1ms for it to reach the pause */ while (tp_strdiff (f->log->str, "started '#'\nstopped\n")) g_main_context_iteration (NULL, TRUE); tp_dtmf_player_cancel (f->dtmf_player); g_assert (!tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '#'\n" "stopped\n" "cancelled\n"); } static void test_sequence (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "*12,3#", 1, 1, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '*'\n"); while (tp_dtmf_player_is_active (f->dtmf_player)) g_main_context_iteration (NULL, TRUE); fixture_assert_log (f, "started '*'\n" "stopped\n" "started '1'\n" "stopped\n" "started '2'\n" "stopped\n" /* at this point we'd wait longer than usual - you can't tell here, * because we have 1ms as the gap time and also as the pause time, * and we're not keeping track anyway */ "started '3'\n" "stopped\n" "started '#'\n" "stopped\n" "finished\n"); } static void test_wait (Fixture *f, gconstpointer nil G_GNUC_UNUSED) { gboolean ok; ok = tp_dtmf_player_play (f->dtmf_player, "*w#w", 1, 1, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '*'\n"); while (tp_dtmf_player_is_active (f->dtmf_player)) g_main_context_iteration (NULL, TRUE); fixture_assert_log (f, "started '*'\n" "stopped\n" "deferred '#w'\n" "finished\n"); /* Now the user's ready to continue. */ ok = tp_dtmf_player_play (f->dtmf_player, "#w", 1, 1, 1, &f->error); g_assert_no_error (f->error); g_assert (ok); g_assert (tp_dtmf_player_is_active (f->dtmf_player)); fixture_assert_log (f, "started '*'\n" "stopped\n" "deferred '#w'\n" "finished\n" "started '#'\n"); while (tp_dtmf_player_is_active (f->dtmf_player)) g_main_context_iteration (NULL, TRUE); /* It doesn't really make sense to defer "", so we just stop there */ fixture_assert_log (f, "started '*'\n" "stopped\n" "deferred '#w'\n" "finished\n" "started '#'\n" "stopped\n" "finished\n"); } int main (int argc, char **argv) { #define TEST_PREFIX "/dtmf-player/" #define FIXTURE_TEST(x) \ g_test_add (TEST_PREFIX #x, Fixture, NULL, setup, test_ ## x, teardown) tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add_func (TEST_PREFIX "to_char", test_to_char); FIXTURE_TEST (noop); FIXTURE_TEST (empty); FIXTURE_TEST (cancel); FIXTURE_TEST (cancel_in_gap); FIXTURE_TEST (cancel_in_pause); FIXTURE_TEST (sequence); FIXTURE_TEST (wait); return g_test_run (); } telepathy-glib-0.24.2/tests/debug-domain.c0000644000175000017500000000307412652510705015302 00000000000000#include "config.h" #include #include #include "telepathy-glib/debug-internal.h" /* Only run test if ENABLE_DEBUG is defined, otherwise we won't have * _tp_log and the TpDebugFlags enum. */ #ifdef ENABLE_DEBUG typedef struct { guint flag; const gchar *domain; } TestItem; static TestItem items[] = { { TP_DEBUG_GROUPS, "groups" }, { TP_DEBUG_GROUPS | TP_DEBUG_PROPERTIES, "groups" }, { TP_DEBUG_GROUPS | TP_DEBUG_DISPATCHER, "groups" }, { TP_DEBUG_PROXY | TP_DEBUG_CHANNEL, "channel" }, { 1 << 31, "misc" }, { TP_DEBUG_ACCOUNTS, "accounts" }, { TP_DEBUG_PROXY | TP_DEBUG_HANDLES | TP_DEBUG_PRESENCE, "presence" }, { 0, NULL }, }; static guint item = 0; static void handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { TestItem i = items[item]; gchar **parts; parts = g_strsplit (log_domain, "/", -1); g_assert_cmpuint (log_level, ==, G_LOG_LEVEL_DEBUG); g_assert_cmpuint (g_strv_length (parts), ==, 2); g_assert (!tp_strdiff (parts[0], "tp-glib")); g_assert (!tp_strdiff (parts[1], i.domain)); g_assert (!tp_strdiff (message, "foo")); g_strfreev (parts); } #endif int main (int argc, char **argv) { #ifdef ENABLE_DEBUG TestItem i; tp_debug_set_flags ("all"); g_log_set_default_handler (handler, NULL); for (; items[item].domain != NULL; item++) { i = items[item]; _tp_log (G_LOG_LEVEL_DEBUG, i.flag, "foo"); } #else g_print ("Not running test-debug-domain test as ENABLE_DEBUG is undefined\n"); #endif return 0; } telepathy-glib-0.24.2/tests/heap.c0000644000175000017500000000140212652510705013655 00000000000000#include "config.h" #include #include #include #include #include static gint comparator_fn (gconstpointer a, gconstpointer b) { return (a < b) ? -1 : (a == b) ? 0 : 1; } int main (int argc, char **argv) { TpHeap *heap = tp_heap_new (comparator_fn, NULL); guint prev = 0; guint i; srand (time (NULL)); for (i=0; i<10000; i++) { tp_heap_add (heap, GUINT_TO_POINTER (rand ())); } while (tp_heap_size (heap)) { guint elem = GPOINTER_TO_INT (tp_heap_peek_first (heap)); g_assert (elem == GPOINTER_TO_UINT (tp_heap_extract_first (heap))); g_assert (prev <= elem); prev = elem; } tp_heap_destroy (heap); return 0; } telepathy-glib-0.24.2/tests/Makefile.am0000644000175000017500000000764412652510705014646 00000000000000SUBDIRS = \ lib \ . \ dbus \ tools programs_list = \ test-asv \ test-capabilities \ test-availability-cmp \ test-dtmf-player \ test-enums \ test-gnio-util \ test-heap \ test-internal-debug \ test-intset \ test-message \ test-signal-connect-object \ test-util \ test-debug-domain \ test-contact-search-result \ $(NULL) if HAVE_CXX programs_list += \ test-util-cxx endif if ENABLE_INSTALLED_TESTS testsdir = @tpglibtestsdir@ tests_PROGRAMS = $(programs_list) tests_DATA = tpglib-tests.list else noinst_PROGRAMS = $(programs_list) endif tpglib-tests.list: $(AM_V_GEN)echo $(programs_list) > $@ TESTS = $(programs_list) \ all-errors-documented.py TESTS_ENVIRONMENT = \ abs_top_builddir=@abs_top_builddir@ \ abs_top_srcdir=@abs_top_srcdir@ \ G_SLICE=debug-blocks \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ PYTHONPATH=@abs_top_srcdir@/tools \ $(top_srcdir)/tools/test-wrapper.sh \ $(EXTRA_TESTS_ENVIRONMENT) EXTRA_TESTS_ENVIRONMENT = include $(top_srcdir)/tools/valgrind.mk VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env G_SLICE=always-malloc CHECK_VERBOSE=1 \ $(top_builddir)/libtool --mode=execute \ $(VALGRIND) --suppressions=$(top_srcdir)/tests/tests.supp $(VALGRIND_FLAGS) check-valgrind: $(MAKE) check-TESTS \ maybe_gc_friendly=,gc-friendly \ TESTS='$$(programs_list)' \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" $(MAKE) -C dbus check-valgrind EXTRA_DIST = README \ all-errors-documented.py \ tests.supp # this one uses internal ABI test_asv_SOURCES = \ asv.c test_asv_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) # this one uses internal ABI test_capabilities_SOURCES = \ capabilities.c test_capabilities_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) # this one uses internal ABI test_contact_search_result_SOURCES = \ contact-search-result.c test_contact_search_result_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_dtmf_player_SOURCES = dtmf-player.c test_dtmf_player_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) test_heap_SOURCES = \ heap.c test_gnio_util_SOURCES = \ gnio-util.c test_util_SOURCES = \ util.c test_intset_SOURCES = \ intset.c test_availability_cmp_SOURCES = \ availability-cmp.c test_enums_SOURCES = \ enums.c test_debug_domain_SOURCES = \ debug-domain.c test_internal_debug_SOURCES = \ internal-debug.c test_message_SOURCES = \ message.c test_message_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) test_signal_connect_object_SOURCES = \ signal-connect-object.c test_signal_connect_object_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) # this needs to link against the static convenience library so that # _tp_log is still visible test_debug_domain_LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la test_internal_debug_LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la check_c_sources = *.c include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -D_TP_COMPILATION \ -D_TP_IGNORE_DEPRECATIONS \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_CXXFLAGS = $(ERROR_CXXFLAGS) if HAVE_CXX test_util_cxx_SOURCES = util-cxx.cpp endif telepathy-glib-0.24.2/tests/Makefile.in0000644000175000017500000017671114006601553014656 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_CXX_TRUE@am__append_1 = \ @HAVE_CXX_TRUE@ test-util-cxx @ENABLE_INSTALLED_TESTS_TRUE@tests_PROGRAMS = $(am__EXEEXT_2) @ENABLE_INSTALLED_TESTS_FALSE@noinst_PROGRAMS = $(am__EXEEXT_2) TESTS = $(am__EXEEXT_2) all-errors-documented.py subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = @HAVE_CXX_TRUE@am__EXEEXT_1 = test-util-cxx$(EXEEXT) am__EXEEXT_2 = test-asv$(EXEEXT) test-capabilities$(EXEEXT) \ test-availability-cmp$(EXEEXT) test-dtmf-player$(EXEEXT) \ test-enums$(EXEEXT) test-gnio-util$(EXEEXT) test-heap$(EXEEXT) \ test-internal-debug$(EXEEXT) test-intset$(EXEEXT) \ test-message$(EXEEXT) test-signal-connect-object$(EXEEXT) \ test-util$(EXEEXT) test-debug-domain$(EXEEXT) \ test-contact-search-result$(EXEEXT) $(am__EXEEXT_1) am__installdirs = "$(DESTDIR)$(testsdir)" "$(DESTDIR)$(testsdir)" PROGRAMS = $(noinst_PROGRAMS) $(tests_PROGRAMS) am_test_asv_OBJECTS = asv.$(OBJEXT) test_asv_OBJECTS = $(am_test_asv_OBJECTS) am__DEPENDENCIES_1 = test_asv_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_test_availability_cmp_OBJECTS = availability-cmp.$(OBJEXT) test_availability_cmp_OBJECTS = $(am_test_availability_cmp_OBJECTS) test_availability_cmp_LDADD = $(LDADD) test_availability_cmp_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_capabilities_OBJECTS = capabilities.$(OBJEXT) test_capabilities_OBJECTS = $(am_test_capabilities_OBJECTS) test_capabilities_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(am__DEPENDENCIES_1) am_test_contact_search_result_OBJECTS = \ contact-search-result.$(OBJEXT) test_contact_search_result_OBJECTS = \ $(am_test_contact_search_result_OBJECTS) test_contact_search_result_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(am__DEPENDENCIES_1) am_test_debug_domain_OBJECTS = debug-domain.$(OBJEXT) test_debug_domain_OBJECTS = $(am_test_debug_domain_OBJECTS) test_debug_domain_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la am_test_dtmf_player_OBJECTS = dtmf-player.$(OBJEXT) test_dtmf_player_OBJECTS = $(am_test_dtmf_player_OBJECTS) am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) test_dtmf_player_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(am__DEPENDENCIES_2) am_test_enums_OBJECTS = enums.$(OBJEXT) test_enums_OBJECTS = $(am_test_enums_OBJECTS) test_enums_LDADD = $(LDADD) test_enums_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_gnio_util_OBJECTS = gnio-util.$(OBJEXT) test_gnio_util_OBJECTS = $(am_test_gnio_util_OBJECTS) test_gnio_util_LDADD = $(LDADD) test_gnio_util_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_heap_OBJECTS = heap.$(OBJEXT) test_heap_OBJECTS = $(am_test_heap_OBJECTS) test_heap_LDADD = $(LDADD) test_heap_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_internal_debug_OBJECTS = internal-debug.$(OBJEXT) test_internal_debug_OBJECTS = $(am_test_internal_debug_OBJECTS) test_internal_debug_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la am_test_intset_OBJECTS = intset.$(OBJEXT) test_intset_OBJECTS = $(am_test_intset_OBJECTS) test_intset_LDADD = $(LDADD) test_intset_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_test_message_OBJECTS = message.$(OBJEXT) test_message_OBJECTS = $(am_test_message_OBJECTS) test_message_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(am__DEPENDENCIES_2) am_test_signal_connect_object_OBJECTS = \ signal-connect-object.$(OBJEXT) test_signal_connect_object_OBJECTS = \ $(am_test_signal_connect_object_OBJECTS) test_signal_connect_object_DEPENDENCIES = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(am__DEPENDENCIES_2) am_test_util_OBJECTS = util.$(OBJEXT) test_util_OBJECTS = $(am_test_util_OBJECTS) test_util_LDADD = $(LDADD) test_util_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am__test_util_cxx_SOURCES_DIST = util-cxx.cpp @HAVE_CXX_TRUE@am_test_util_cxx_OBJECTS = util-cxx.$(OBJEXT) test_util_cxx_OBJECTS = $(am_test_util_cxx_OBJECTS) test_util_cxx_LDADD = $(LDADD) test_util_cxx_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/asv.Po \ ./$(DEPDIR)/availability-cmp.Po ./$(DEPDIR)/capabilities.Po \ ./$(DEPDIR)/contact-search-result.Po \ ./$(DEPDIR)/debug-domain.Po ./$(DEPDIR)/dtmf-player.Po \ ./$(DEPDIR)/enums.Po ./$(DEPDIR)/gnio-util.Po \ ./$(DEPDIR)/heap.Po ./$(DEPDIR)/internal-debug.Po \ ./$(DEPDIR)/intset.Po ./$(DEPDIR)/message.Po \ ./$(DEPDIR)/signal-connect-object.Po ./$(DEPDIR)/util-cxx.Po \ ./$(DEPDIR)/util.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(test_asv_SOURCES) $(test_availability_cmp_SOURCES) \ $(test_capabilities_SOURCES) \ $(test_contact_search_result_SOURCES) \ $(test_debug_domain_SOURCES) $(test_dtmf_player_SOURCES) \ $(test_enums_SOURCES) $(test_gnio_util_SOURCES) \ $(test_heap_SOURCES) $(test_internal_debug_SOURCES) \ $(test_intset_SOURCES) $(test_message_SOURCES) \ $(test_signal_connect_object_SOURCES) $(test_util_SOURCES) \ $(test_util_cxx_SOURCES) DIST_SOURCES = $(test_asv_SOURCES) $(test_availability_cmp_SOURCES) \ $(test_capabilities_SOURCES) \ $(test_contact_search_result_SOURCES) \ $(test_debug_domain_SOURCES) $(test_dtmf_player_SOURCES) \ $(test_enums_SOURCES) $(test_gnio_util_SOURCES) \ $(test_heap_SOURCES) $(test_internal_debug_SOURCES) \ $(test_intset_SOURCES) $(test_message_SOURCES) \ $(test_signal_connect_object_SOURCES) $(test_util_SOURCES) \ $(am__test_util_cxx_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(tests_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ check recheck distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/test-driver \ $(top_srcdir)/tools/check-coding-style.mk \ $(top_srcdir)/tools/valgrind.mk README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ SUBDIRS = \ lib \ . \ dbus \ tools programs_list = test-asv test-capabilities test-availability-cmp \ test-dtmf-player test-enums test-gnio-util test-heap \ test-internal-debug test-intset test-message \ test-signal-connect-object test-util test-debug-domain \ test-contact-search-result $(NULL) $(am__append_1) @ENABLE_INSTALLED_TESTS_TRUE@testsdir = @tpglibtestsdir@ @ENABLE_INSTALLED_TESTS_TRUE@tests_DATA = tpglib-tests.list TESTS_ENVIRONMENT = \ abs_top_builddir=@abs_top_builddir@ \ abs_top_srcdir=@abs_top_srcdir@ \ G_SLICE=debug-blocks \ G_DEBUG=fatal_warnings,fatal_criticals$(maybe_gc_friendly) \ G_MESSAGES_DEBUG=all \ PYTHONPATH=@abs_top_srcdir@/tools \ $(top_srcdir)/tools/test-wrapper.sh \ $(EXTRA_TESTS_ENVIRONMENT) EXTRA_TESTS_ENVIRONMENT = VALGRIND = valgrind --tool=memcheck \ --verbose \ --leak-check=full \ --leak-resolution=high \ --suppressions=$(top_srcdir)/tools/telepathy-glib.supp \ --child-silent-after-fork=yes \ --num-callers=20 \ --gen-suppressions=all VALGRIND_TESTS_ENVIRONMENT = \ $(TESTS_ENVIRONMENT) \ env G_SLICE=always-malloc CHECK_VERBOSE=1 \ $(top_builddir)/libtool --mode=execute \ $(VALGRIND) --suppressions=$(top_srcdir)/tests/tests.supp $(VALGRIND_FLAGS) EXTRA_DIST = README \ all-errors-documented.py \ tests.supp # this one uses internal ABI test_asv_SOURCES = \ asv.c test_asv_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) # this one uses internal ABI test_capabilities_SOURCES = \ capabilities.c test_capabilities_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) # this one uses internal ABI test_contact_search_result_SOURCES = \ contact-search-result.c test_contact_search_result_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests-internal.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la \ $(GLIB_LIBS) test_dtmf_player_SOURCES = dtmf-player.c test_dtmf_player_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) test_heap_SOURCES = \ heap.c test_gnio_util_SOURCES = \ gnio-util.c test_util_SOURCES = \ util.c test_intset_SOURCES = \ intset.c test_availability_cmp_SOURCES = \ availability-cmp.c test_enums_SOURCES = \ enums.c test_debug_domain_SOURCES = \ debug-domain.c test_internal_debug_SOURCES = \ internal-debug.c test_message_SOURCES = \ message.c test_message_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) test_signal_connect_object_SOURCES = \ signal-connect-object.c test_signal_connect_object_LDADD = \ $(top_builddir)/tests/lib/libtp-glib-tests.la \ $(LDADD) # this needs to link against the static convenience library so that # _tp_log is still visible test_debug_domain_LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la test_internal_debug_LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib-internal.la check_c_sources = *.c LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -D_TP_COMPILATION \ -D_TP_IGNORE_DEPRECATIONS \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_CXXFLAGS = $(ERROR_CXXFLAGS) @HAVE_CXX_TRUE@test_util_cxx_SOURCES = util-cxx.cpp all: all-recursive .SUFFIXES: .SUFFIXES: .c .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/valgrind.mk $(top_srcdir)/tools/check-coding-style.mk $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/tools/valgrind.mk $(top_srcdir)/tools/check-coding-style.mk $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list install-testsPROGRAMS: $(tests_PROGRAMS) @$(NORMAL_INSTALL) @list='$(tests_PROGRAMS)'; test -n "$(testsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(testsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testsdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(testsdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(testsdir)$$dir" || exit $$?; \ } \ ; done uninstall-testsPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(tests_PROGRAMS)'; test -n "$(testsdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(testsdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(testsdir)" && rm -f $$files clean-testsPROGRAMS: @list='$(tests_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list test-asv$(EXEEXT): $(test_asv_OBJECTS) $(test_asv_DEPENDENCIES) $(EXTRA_test_asv_DEPENDENCIES) @rm -f test-asv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_asv_OBJECTS) $(test_asv_LDADD) $(LIBS) test-availability-cmp$(EXEEXT): $(test_availability_cmp_OBJECTS) $(test_availability_cmp_DEPENDENCIES) $(EXTRA_test_availability_cmp_DEPENDENCIES) @rm -f test-availability-cmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_availability_cmp_OBJECTS) $(test_availability_cmp_LDADD) $(LIBS) test-capabilities$(EXEEXT): $(test_capabilities_OBJECTS) $(test_capabilities_DEPENDENCIES) $(EXTRA_test_capabilities_DEPENDENCIES) @rm -f test-capabilities$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_capabilities_OBJECTS) $(test_capabilities_LDADD) $(LIBS) test-contact-search-result$(EXEEXT): $(test_contact_search_result_OBJECTS) $(test_contact_search_result_DEPENDENCIES) $(EXTRA_test_contact_search_result_DEPENDENCIES) @rm -f test-contact-search-result$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_contact_search_result_OBJECTS) $(test_contact_search_result_LDADD) $(LIBS) test-debug-domain$(EXEEXT): $(test_debug_domain_OBJECTS) $(test_debug_domain_DEPENDENCIES) $(EXTRA_test_debug_domain_DEPENDENCIES) @rm -f test-debug-domain$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_debug_domain_OBJECTS) $(test_debug_domain_LDADD) $(LIBS) test-dtmf-player$(EXEEXT): $(test_dtmf_player_OBJECTS) $(test_dtmf_player_DEPENDENCIES) $(EXTRA_test_dtmf_player_DEPENDENCIES) @rm -f test-dtmf-player$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_dtmf_player_OBJECTS) $(test_dtmf_player_LDADD) $(LIBS) test-enums$(EXEEXT): $(test_enums_OBJECTS) $(test_enums_DEPENDENCIES) $(EXTRA_test_enums_DEPENDENCIES) @rm -f test-enums$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_enums_OBJECTS) $(test_enums_LDADD) $(LIBS) test-gnio-util$(EXEEXT): $(test_gnio_util_OBJECTS) $(test_gnio_util_DEPENDENCIES) $(EXTRA_test_gnio_util_DEPENDENCIES) @rm -f test-gnio-util$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_gnio_util_OBJECTS) $(test_gnio_util_LDADD) $(LIBS) test-heap$(EXEEXT): $(test_heap_OBJECTS) $(test_heap_DEPENDENCIES) $(EXTRA_test_heap_DEPENDENCIES) @rm -f test-heap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_heap_OBJECTS) $(test_heap_LDADD) $(LIBS) test-internal-debug$(EXEEXT): $(test_internal_debug_OBJECTS) $(test_internal_debug_DEPENDENCIES) $(EXTRA_test_internal_debug_DEPENDENCIES) @rm -f test-internal-debug$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_internal_debug_OBJECTS) $(test_internal_debug_LDADD) $(LIBS) test-intset$(EXEEXT): $(test_intset_OBJECTS) $(test_intset_DEPENDENCIES) $(EXTRA_test_intset_DEPENDENCIES) @rm -f test-intset$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_intset_OBJECTS) $(test_intset_LDADD) $(LIBS) test-message$(EXEEXT): $(test_message_OBJECTS) $(test_message_DEPENDENCIES) $(EXTRA_test_message_DEPENDENCIES) @rm -f test-message$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_message_OBJECTS) $(test_message_LDADD) $(LIBS) test-signal-connect-object$(EXEEXT): $(test_signal_connect_object_OBJECTS) $(test_signal_connect_object_DEPENDENCIES) $(EXTRA_test_signal_connect_object_DEPENDENCIES) @rm -f test-signal-connect-object$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_signal_connect_object_OBJECTS) $(test_signal_connect_object_LDADD) $(LIBS) test-util$(EXEEXT): $(test_util_OBJECTS) $(test_util_DEPENDENCIES) $(EXTRA_test_util_DEPENDENCIES) @rm -f test-util$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_util_OBJECTS) $(test_util_LDADD) $(LIBS) test-util-cxx$(EXEEXT): $(test_util_cxx_OBJECTS) $(test_util_cxx_DEPENDENCIES) $(EXTRA_test_util_cxx_DEPENDENCIES) @rm -f test-util-cxx$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(test_util_cxx_OBJECTS) $(test_util_cxx_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/availability-cmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-search-result.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-domain.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtmf-player.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enums.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnio-util.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heap.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/internal-debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intset.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal-connect-object.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util-cxx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-testsDATA: $(tests_DATA) @$(NORMAL_INSTALL) @list='$(tests_DATA)'; test -n "$(testsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(testsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(testsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(testsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(testsdir)" || exit $$?; \ done uninstall-testsDATA: @$(NORMAL_UNINSTALL) @list='$(tests_DATA)'; test -n "$(testsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(testsdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? test-asv.log: test-asv$(EXEEXT) @p='test-asv$(EXEEXT)'; \ b='test-asv'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-capabilities.log: test-capabilities$(EXEEXT) @p='test-capabilities$(EXEEXT)'; \ b='test-capabilities'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-availability-cmp.log: test-availability-cmp$(EXEEXT) @p='test-availability-cmp$(EXEEXT)'; \ b='test-availability-cmp'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-dtmf-player.log: test-dtmf-player$(EXEEXT) @p='test-dtmf-player$(EXEEXT)'; \ b='test-dtmf-player'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-enums.log: test-enums$(EXEEXT) @p='test-enums$(EXEEXT)'; \ b='test-enums'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-gnio-util.log: test-gnio-util$(EXEEXT) @p='test-gnio-util$(EXEEXT)'; \ b='test-gnio-util'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-heap.log: test-heap$(EXEEXT) @p='test-heap$(EXEEXT)'; \ b='test-heap'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-internal-debug.log: test-internal-debug$(EXEEXT) @p='test-internal-debug$(EXEEXT)'; \ b='test-internal-debug'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-intset.log: test-intset$(EXEEXT) @p='test-intset$(EXEEXT)'; \ b='test-intset'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-message.log: test-message$(EXEEXT) @p='test-message$(EXEEXT)'; \ b='test-message'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-signal-connect-object.log: test-signal-connect-object$(EXEEXT) @p='test-signal-connect-object$(EXEEXT)'; \ b='test-signal-connect-object'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-util.log: test-util$(EXEEXT) @p='test-util$(EXEEXT)'; \ b='test-util'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-debug-domain.log: test-debug-domain$(EXEEXT) @p='test-debug-domain$(EXEEXT)'; \ b='test-debug-domain'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-contact-search-result.log: test-contact-search-result$(EXEEXT) @p='test-contact-search-result$(EXEEXT)'; \ b='test-contact-search-result'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) test-util-cxx.log: test-util-cxx$(EXEEXT) @p='test-util-cxx$(EXEEXT)'; \ b='test-util-cxx'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) all-errors-documented.py.log: all-errors-documented.py @p='all-errors-documented.py'; \ b='all-errors-documented.py'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local check: check-recursive all-am: Makefile $(PROGRAMS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(testsdir)" "$(DESTDIR)$(testsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ clean-testsPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/asv.Po -rm -f ./$(DEPDIR)/availability-cmp.Po -rm -f ./$(DEPDIR)/capabilities.Po -rm -f ./$(DEPDIR)/contact-search-result.Po -rm -f ./$(DEPDIR)/debug-domain.Po -rm -f ./$(DEPDIR)/dtmf-player.Po -rm -f ./$(DEPDIR)/enums.Po -rm -f ./$(DEPDIR)/gnio-util.Po -rm -f ./$(DEPDIR)/heap.Po -rm -f ./$(DEPDIR)/internal-debug.Po -rm -f ./$(DEPDIR)/intset.Po -rm -f ./$(DEPDIR)/message.Po -rm -f ./$(DEPDIR)/signal-connect-object.Po -rm -f ./$(DEPDIR)/util-cxx.Po -rm -f ./$(DEPDIR)/util.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-testsDATA install-testsPROGRAMS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/asv.Po -rm -f ./$(DEPDIR)/availability-cmp.Po -rm -f ./$(DEPDIR)/capabilities.Po -rm -f ./$(DEPDIR)/contact-search-result.Po -rm -f ./$(DEPDIR)/debug-domain.Po -rm -f ./$(DEPDIR)/dtmf-player.Po -rm -f ./$(DEPDIR)/enums.Po -rm -f ./$(DEPDIR)/gnio-util.Po -rm -f ./$(DEPDIR)/heap.Po -rm -f ./$(DEPDIR)/internal-debug.Po -rm -f ./$(DEPDIR)/intset.Po -rm -f ./$(DEPDIR)/message.Po -rm -f ./$(DEPDIR)/signal-connect-object.Po -rm -f ./$(DEPDIR)/util-cxx.Po -rm -f ./$(DEPDIR)/util.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-testsDATA uninstall-testsPROGRAMS .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-noinstPROGRAMS \ clean-testsPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-testsDATA install-testsPROGRAMS \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am recheck tags tags-am uninstall \ uninstall-am uninstall-testsDATA uninstall-testsPROGRAMS .PRECIOUS: Makefile tpglib-tests.list: $(AM_V_GEN)echo $(programs_list) > $@ # other potentially interesting options: # --show-reachable=yes reachable objects (many!) # --read-var-info=yes better diagnostics from DWARF3 info # --track-origins=yes better diagnostics for uninit values (slow) check-valgrind: $(MAKE) check-TESTS \ maybe_gc_friendly=,gc-friendly \ TESTS='$$(programs_list)' \ TESTS_ENVIRONMENT="$(VALGRIND_TESTS_ENVIRONMENT)" $(MAKE) -C dbus check-valgrind check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(enable_fatal_warnings)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/tests/util.c0000644000175000017500000003247112652510705013727 00000000000000#include "config.h" #include #include #include void test_strv_contains (void); void test_strv_contains (void) { const gchar * const strv[] = { "Pah", "Pah", "Pah-pah-pah", "Patrick!", NULL }; g_assert (tp_strv_contains (strv, "Patrick!")); g_assert (!tp_strv_contains (strv, "Snakes!")); } static void test_value_array_build (void) { GValueArray *arr; const gchar *host = "badger.snakes"; guint port = 128; gchar *host_out = NULL; guint port_out = 1234; arr = tp_value_array_build (2, G_TYPE_STRING, host, G_TYPE_UINT, port, G_TYPE_INVALID); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_assert_cmpstr (g_value_get_string (g_value_array_get_nth (arr, 0)), ==, host); g_assert_cmpuint (g_value_get_uint (g_value_array_get_nth (arr, 1)), ==, port); G_GNUC_END_IGNORE_DEPRECATIONS tp_value_array_unpack (arr, 2, &host_out, &port_out); g_assert_cmpstr (host_out, ==, host); g_assert_cmpuint (port_out, ==, port); tp_value_array_free (arr); } static void test_utf8_make_valid (void) { gchar *tmp; gint i; struct { const gchar *source; const gchar *target; } test[] = { /* lifted directly from https://bugzilla.gnome.org/show_bug.cgi?id=610969 * examples from http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt */ /* greek 'kosme' */ { "\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5", "\xce\xba\xe1\xbd\xb9\xcf\x83\xce\xbc\xce\xb5" }, /* first sequence of each length */ { "\x00", "\x00" }, { "\xc2\x80", "\xc2\x80" }, { "\xe0\xa0\x80", "\xe0\xa0\x80" }, { "\xf0\x90\x80\x80", "\xf0\x90\x80\x80" }, { "\xf8\x88\x80\x80\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\xfc\x84\x80\x80\x80\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, /* last sequence of each length */ { "\x7f", "\x7f" }, { "\xdf\xbf", "\xdf\xbf" }, #if !GLIB_CHECK_VERSION (2, 36, 0) { "\xef\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, #endif { "\xf7\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\xfb\xbf\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\xfd\xbf\xbf\xbf\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, /* other boundary conditions */ { "\xed\x9f\xbf", "\xed\x9f\xbf" }, { "\xee\x80\x80", "\xee\x80\x80" }, { "\xef\xbf\xbd", "\xef\xbf\xbd" }, #if !GLIB_CHECK_VERSION (2, 36, 0) { "\xf4\x8f\xbf\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, #endif { "\xf4\x90\x80\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, /* malformed sequences */ /* continuation bytes */ { "\x80", "\xef\xbf\xbd" }, { "\xbf", "\xef\xbf\xbd" }, { "\x80\xbf", "\xef\xbf\xbd\xef\xbf\xbd" }, { "\x80\xbf\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x80\xbf\x80\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x80\xbf\x80\xbf\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x80\xbf\x80\xbf\x80\xbf", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x80\xbf\x80\xbf\x80\xbf\x80", "\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, /* all possible continuation byte */ { "\x80", "\xef\xbf\xbd" }, { "\x81", "\xef\xbf\xbd" }, { "\x82", "\xef\xbf\xbd" }, { "\x83", "\xef\xbf\xbd" }, { "\x84", "\xef\xbf\xbd" }, { "\x85", "\xef\xbf\xbd" }, { "\x86", "\xef\xbf\xbd" }, { "\x87", "\xef\xbf\xbd" }, { "\x88", "\xef\xbf\xbd" }, { "\x89", "\xef\xbf\xbd" }, { "\x8a", "\xef\xbf\xbd" }, { "\x8b", "\xef\xbf\xbd" }, { "\x8c", "\xef\xbf\xbd" }, { "\x8d", "\xef\xbf\xbd" }, { "\x8e", "\xef\xbf\xbd" }, { "\x8f", "\xef\xbf\xbd" }, { "\x90", "\xef\xbf\xbd" }, { "\x91", "\xef\xbf\xbd" }, { "\x92", "\xef\xbf\xbd" }, { "\x93", "\xef\xbf\xbd" }, { "\x94", "\xef\xbf\xbd" }, { "\x95", "\xef\xbf\xbd" }, { "\x96", "\xef\xbf\xbd" }, { "\x97", "\xef\xbf\xbd" }, { "\x98", "\xef\xbf\xbd" }, { "\x99", "\xef\xbf\xbd" }, { "\x9a", "\xef\xbf\xbd" }, { "\x9b", "\xef\xbf\xbd" }, { "\x9c", "\xef\xbf\xbd" }, { "\x9d", "\xef\xbf\xbd" }, { "\x9e", "\xef\xbf\xbd" }, { "\x9f", "\xef\xbf\xbd" }, { "\xa0", "\xef\xbf\xbd" }, { "\xa1", "\xef\xbf\xbd" }, { "\xa2", "\xef\xbf\xbd" }, { "\xa3", "\xef\xbf\xbd" }, { "\xa4", "\xef\xbf\xbd" }, { "\xa5", "\xef\xbf\xbd" }, { "\xa6", "\xef\xbf\xbd" }, { "\xa7", "\xef\xbf\xbd" }, { "\xa8", "\xef\xbf\xbd" }, { "\xa9", "\xef\xbf\xbd" }, { "\xaa", "\xef\xbf\xbd" }, { "\xab", "\xef\xbf\xbd" }, { "\xac", "\xef\xbf\xbd" }, { "\xad", "\xef\xbf\xbd" }, { "\xae", "\xef\xbf\xbd" }, { "\xaf", "\xef\xbf\xbd" }, { "\xb0", "\xef\xbf\xbd" }, { "\xb1", "\xef\xbf\xbd" }, { "\xb2", "\xef\xbf\xbd" }, { "\xb3", "\xef\xbf\xbd" }, { "\xb4", "\xef\xbf\xbd" }, { "\xb5", "\xef\xbf\xbd" }, { "\xb6", "\xef\xbf\xbd" }, { "\xb7", "\xef\xbf\xbd" }, { "\xb8", "\xef\xbf\xbd" }, { "\xb9", "\xef\xbf\xbd" }, { "\xba", "\xef\xbf\xbd" }, { "\xbb", "\xef\xbf\xbd" }, { "\xbc", "\xef\xbf\xbd" }, { "\xbd", "\xef\xbf\xbd" }, { "\xbe", "\xef\xbf\xbd" }, { "\xbf", "\xef\xbf\xbd" }, /* lone start characters */ { "\xc0\x20", "\xef\xbf\xbd\x20" }, { "\xc1\x20", "\xef\xbf\xbd\x20" }, { "\xc2\x20", "\xef\xbf\xbd\x20" }, { "\xc3\x20", "\xef\xbf\xbd\x20" }, { "\xc4\x20", "\xef\xbf\xbd\x20" }, { "\xc5\x20", "\xef\xbf\xbd\x20" }, { "\xc6\x20", "\xef\xbf\xbd\x20" }, { "\xc7\x20", "\xef\xbf\xbd\x20" }, { "\xc8\x20", "\xef\xbf\xbd\x20" }, { "\xc9\x20", "\xef\xbf\xbd\x20" }, { "\xca\x20", "\xef\xbf\xbd\x20" }, { "\xcb\x20", "\xef\xbf\xbd\x20" }, { "\xcc\x20", "\xef\xbf\xbd\x20" }, { "\xcd\x20", "\xef\xbf\xbd\x20" }, { "\xce\x20", "\xef\xbf\xbd\x20" }, { "\xcf\x20", "\xef\xbf\xbd\x20" }, { "\xd0\x20", "\xef\xbf\xbd\x20" }, { "\xd1\x20", "\xef\xbf\xbd\x20" }, { "\xd2\x20", "\xef\xbf\xbd\x20" }, { "\xd3\x20", "\xef\xbf\xbd\x20" }, { "\xd4\x20", "\xef\xbf\xbd\x20" }, { "\xd5\x20", "\xef\xbf\xbd\x20" }, { "\xd6\x20", "\xef\xbf\xbd\x20" }, { "\xd7\x20", "\xef\xbf\xbd\x20" }, { "\xd8\x20", "\xef\xbf\xbd\x20" }, { "\xd9\x20", "\xef\xbf\xbd\x20" }, { "\xda\x20", "\xef\xbf\xbd\x20" }, { "\xdb\x20", "\xef\xbf\xbd\x20" }, { "\xdc\x20", "\xef\xbf\xbd\x20" }, { "\xdd\x20", "\xef\xbf\xbd\x20" }, { "\xde\x20", "\xef\xbf\xbd\x20" }, { "\xdf\x20", "\xef\xbf\xbd\x20" }, { "\xe0\x20", "\xef\xbf\xbd\x20" }, { "\xe1\x20", "\xef\xbf\xbd\x20" }, { "\xe2\x20", "\xef\xbf\xbd\x20" }, { "\xe3\x20", "\xef\xbf\xbd\x20" }, { "\xe4\x20", "\xef\xbf\xbd\x20" }, { "\xe5\x20", "\xef\xbf\xbd\x20" }, { "\xe6\x20", "\xef\xbf\xbd\x20" }, { "\xe7\x20", "\xef\xbf\xbd\x20" }, { "\xe8\x20", "\xef\xbf\xbd\x20" }, { "\xe9\x20", "\xef\xbf\xbd\x20" }, { "\xea\x20", "\xef\xbf\xbd\x20" }, { "\xeb\x20", "\xef\xbf\xbd\x20" }, { "\xec\x20", "\xef\xbf\xbd\x20" }, { "\xed\x20", "\xef\xbf\xbd\x20" }, { "\xee\x20", "\xef\xbf\xbd\x20" }, { "\xef\x20", "\xef\xbf\xbd\x20" }, { "\xf0\x20", "\xef\xbf\xbd\x20" }, { "\xf1\x20", "\xef\xbf\xbd\x20" }, { "\xf2\x20", "\xef\xbf\xbd\x20" }, { "\xf3\x20", "\xef\xbf\xbd\x20" }, { "\xf4\x20", "\xef\xbf\xbd\x20" }, { "\xf5\x20", "\xef\xbf\xbd\x20" }, { "\xf6\x20", "\xef\xbf\xbd\x20" }, { "\xf7\x20", "\xef\xbf\xbd\x20" }, { "\xf8\x20", "\xef\xbf\xbd\x20" }, { "\xf9\x20", "\xef\xbf\xbd\x20" }, { "\xfa\x20", "\xef\xbf\xbd\x20" }, { "\xfb\x20", "\xef\xbf\xbd\x20" }, { "\xfc\x20", "\xef\xbf\xbd\x20" }, { "\xfd\x20", "\xef\xbf\xbd\x20" }, /* missing continuation bytes */ { "\x20\xc0", "\x20\xef\xbf\xbd" }, { "\x20\xe0\x80", "\x20\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xf0\x80\x80", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xf8\x80\x80\x80", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xfc\x80\x80\x80\x80", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xdf", "\x20\xef\xbf\xbd" }, { "\x20\xef\xbf", "\x20\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xf7\xbf\xbf", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xfb\xbf\xbf\xbf", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, { "\x20\xfd\xbf\xbf\xbf\xbf", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd" }, /* impossible bytes */ { "\x20\xfe\x20", "\x20\xef\xbf\xbd\x20" }, { "\x20\xff\x20", "\x20\xef\xbf\xbd\x20" }, /* overlong sequences */ { "\x20\xc0\xaf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xe0\x80\xaf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf0\x80\x80\xaf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf8\x80\x80\x80\xaf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xfc\x80\x80\x80\x80\xaf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xc1\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xe0\x9f\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf0\x8f\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf8\x87\xbf\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xfc\x83\xbf\xbf\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xc0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xe0\x80\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf0\x80\x80\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xf8\x80\x80\x80\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xfc\x80\x80\x80\x80\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, /* illegal code positions */ { "\x20\xed\xa0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xad\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xae\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xaf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xbe\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xa0\x80\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xa0\x80\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xad\xbf\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xad\xbf\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xae\x80\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xae\x80\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xaf\xbf\xed\xb0\x80\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xed\xaf\xbf\xed\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, #if !GLIB_CHECK_VERSION (2, 36, 0) { "\x20\xef\xbf\xbe\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, { "\x20\xef\xbf\xbf\x20", "\x20\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\x20" }, #endif { NULL, NULL } }; for (i = 0; test[i].source != NULL; i++) { tmp = tp_utf8_make_valid (test[i].source); g_assert (!tp_strdiff (tmp, test[i].target)); g_free (tmp); } } int main (int argc, char **argv) { GPtrArray *ptrarray; gchar *string; g_assert (!tp_strdiff (NULL, NULL)); g_assert (tp_strdiff ("badger", NULL)); g_assert (tp_strdiff (NULL, "badger")); g_assert (!tp_strdiff ("badger", "badger")); g_assert (tp_strdiff ("badger", "mushroom")); ptrarray = g_ptr_array_new (); g_ptr_array_add (ptrarray, GINT_TO_POINTER (23)); g_ptr_array_add (ptrarray, GINT_TO_POINTER (42)); g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (23))); g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (42))); g_assert (!tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (666))); g_ptr_array_unref (ptrarray); string = tp_escape_as_identifier (""); g_assert (!tp_strdiff (string, "_")); g_free (string); string = tp_escape_as_identifier ("badger"); g_assert (!tp_strdiff (string, "badger")); g_free (string); string = tp_escape_as_identifier ("0123abc_xyz\x01\xff"); g_assert (!tp_strdiff (string, "_30123abc_5fxyz_01_ff")); g_free (string); string = tp_escape_as_identifier ("©"); g_assert (!tp_strdiff (string, "_c2_a9")); g_free (string); test_strv_contains (); test_value_array_build (); test_utf8_make_valid (); return 0; } telepathy-glib-0.24.2/tests/internal-debug.c0000644000175000017500000000304212652510705015642 00000000000000#include "config.h" #include #include #include #include #undef DEBUG_FLAG #define DEBUG_FLAG TP_DEBUG_IM #include "telepathy-glib/debug-internal.h" static void test_debugging (void) { DEBUG ("internal-debug.h should always define DEBUG %s", "(either as a macro or as a no-op static inline function"); #ifndef DEBUGGING #error internal-debug.h should always define DEBUGGING #endif #ifdef ENABLE_DEBUG g_assert (DEBUGGING == 1); #else g_assert (DEBUGGING == 0); #endif } #undef DEBUG_FLAG #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" static void test_not_debugging (void) { DEBUG ("internal-debug.h should always define DEBUG %s", "(either as a macro or as a no-op static inline function"); #ifndef DEBUGGING #error internal-debug.h should always define DEBUGGING #endif g_assert (DEBUGGING == 0); } #undef DEBUG_FLAG #define DEBUG_FLAG TP_DEBUG_IM #include "telepathy-glib/debug-internal.h" static void test_debugging_again (void) { DEBUG ("internal-debug.h should always define DEBUG %s", "(either as a macro or as a no-op static inline function"); #ifndef DEBUGGING #error internal-debug.h should always define DEBUGGING #endif #ifdef ENABLE_DEBUG g_assert (DEBUGGING == 1); #else g_assert (DEBUGGING == 0); #endif } int main (int argc, char **argv) { /* We enable debugging for IM, but not for the connection. */ tp_debug_set_flags ("im"); test_debugging (); test_not_debugging (); test_debugging_again (); return 0; } telepathy-glib-0.24.2/tests/util-cxx.cpp0000644000175000017500000000242012652510705015056 00000000000000/* Test that tp_clear_pointer is syntactically OK in C++ * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include int main (int argc, char **argv) { GObject *o; GHashTable *h; o = (GObject *) g_file_new_for_path ("/"); tp_clear_object (&o); h = g_hash_table_new (NULL, NULL); tp_clear_pointer (&h, (GDestroyNotify) g_hash_table_unref); h = g_hash_table_new (NULL, NULL); tp_clear_boxed (G_TYPE_HASH_TABLE, &h); return 0; } telepathy-glib-0.24.2/tests/contact-search-result.c0000644000175000017500000000374112652510705017162 00000000000000/* Tests of TpContactSearchResult * * Copyright © 2010-2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "telepathy-glib/contact-search-internal.h" #include #include #include #include #include #include #include "tests/lib/util.h" static void test_contact_search_result (void) { TpContactSearchResult *result; TpContactInfoField *field; const gchar *identifier; GList *fields; gchar *field_value[] = { "Joe", NULL }; result = _tp_contact_search_result_new ("id"); g_assert (TP_IS_CONTACT_SEARCH_RESULT (result)); identifier = tp_contact_search_result_get_identifier (result); g_assert_cmpstr (identifier, ==, "id"); fields = tp_contact_search_result_get_fields (result); g_assert (fields == NULL); field = tp_contact_search_result_get_field (result, "fn"); g_assert (field == NULL); field = tp_contact_info_field_new ("fn", NULL, field_value); g_assert (field != NULL); _tp_contact_search_result_insert_field (result, field); fields = tp_contact_search_result_get_fields (result); g_assert (fields != NULL); g_list_free (fields); field = tp_contact_search_result_get_field (result, "fn"); g_assert (field != NULL); g_assert_cmpstr (field->field_value[0], ==, field_value[0]); g_assert_cmpstr (field->field_value[1], ==, field_value[1]); g_object_unref (result); } int main (int argc, char **argv) { tp_debug_set_flags ("all"); g_test_init (&argc, &argv, NULL); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add_func ("/contact-search/contact-search-result", test_contact_search_result); return g_test_run (); } telepathy-glib-0.24.2/tests/message.c0000644000175000017500000000424612652510705014375 00000000000000/* Tests of TpMessage * * Copyright © 2013 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "tests/lib/util.h" static void test_delivery_report_with_body (void) { TpMessage *message = tp_client_message_new (); guint i; gchar *text; TpChannelTextMessageFlags flags; g_test_bug ("61254"); tp_message_set_uint32 (message, 0, "message-type", TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT); tp_message_set_uint32 (message, 0, "delivery-status", TP_DELIVERY_STATUS_PERMANENTLY_FAILED); /* message from server (alternative in English) */ i = tp_message_append_part (message); tp_message_set_string (message, i, "alternative", "404"); tp_message_set_string (message, i, "content-type", "text/plain"); tp_message_set_string (message, i, "lang", "en"); tp_message_set_string (message, i, "content", "I have no contact with that name"); /* message from server (alternative in German) */ i = tp_message_append_part (message); tp_message_set_string (message, i, "alternative", "404"); tp_message_set_string (message, i, "content-type", "text/plain"); tp_message_set_string (message, i, "lang", "de"); tp_message_set_string (message, i, "content", "Ich habe keinen Kontakt mit diesem Namen"); text = tp_message_to_text (message, &flags); g_assert (text != NULL); /* tp_message_to_text should only pick one language, and it's arbitrarily the * first. */ g_assert_cmpstr (text, ==, "I have no contact with that name"); /* This is a delivery report, so old clients should know that there's * something more to the message than just a message. */ g_assert_cmpuint (flags, ==, TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT); g_free (text); g_object_unref (message); } int main (int argc, char **argv) { tp_tests_init (&argc, &argv); g_test_bug_base ("http://bugs.freedesktop.org/show_bug.cgi?id="); g_test_add_func ("/text-channel/delivery-report-with-body", test_delivery_report_with_body); return g_test_run (); } telepathy-glib-0.24.2/tools/0000755000175000017500000000000014006623343012653 500000000000000telepathy-glib-0.24.2/tools/flymake.mk0000644000175000017500000000014412652510705014555 00000000000000check-syntax: $(CC) $(AM_CPPFLAGS) $(AM_CFLAGS) -fsyntax-only $(CHK_SOURCES) .PHONY: check-syntax telepathy-glib-0.24.2/tools/glib-client-gen.py0000644000175000017500000013166514004033172016112 00000000000000#!/usr/bin/python # glib-client-gen.py: "I Can't Believe It's Not dbus-binding-tool" # # Generate GLib client wrappers from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006-2008 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path import xml.dom.minidom from getopt import gnu_getopt from libtpcodegen import file_set_contents, key_by_name, u from libglibcodegen import (Signature, type_to_gtype, get_docstring, xml_escape, get_deprecated, copy_into_gvalue, move_into_gvalue) NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix, basename, opts): self.dom = dom self.__header = [] self.__body = [] self.__docs = [] self.prefix_lc = prefix.lower() self.prefix_uc = prefix.upper() self.prefix_mc = prefix.replace('_', '') self.basename = basename self.group = opts.get('--group', None) self.iface_quark_prefix = opts.get('--iface-quark-prefix', None) self.tp_proxy_api = tuple(map(int, opts.get('--tp-proxy-api', '0').split('.'))) self.proxy_cls = opts.get('--subclass', 'TpProxy') + ' *' self.proxy_arg = opts.get('--subclass', 'void') + ' *' self.proxy_assert = opts.get('--subclass-assert', 'TP_IS_PROXY') self.proxy_doc = ('A #%s or subclass' % opts.get('--subclass', 'TpProxy')) if self.proxy_arg == 'void *': self.proxy_arg = 'gpointer ' self.reentrant_symbols = set() try: filename = opts['--generate-reentrant'] with open(filename, 'r') as f: for line in f.readlines(): self.reentrant_symbols.add(line.strip()) except KeyError: pass self.deprecate_reentrant = opts.get('--deprecate-reentrant', None) self.deprecation_attribute = opts.get('--deprecation-attribute', 'G_GNUC_DEPRECATED') self.guard = opts.get('--guard', None) def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def d(self, s): self.__docs.append(s) def get_iface_quark(self): assert self.iface_dbus is not None assert self.iface_uc is not None if self.iface_quark_prefix is None: return 'g_quark_from_static_string (\"%s\")' % self.iface_dbus else: return '%s_%s' % (self.iface_quark_prefix, self.iface_uc) def do_signal(self, iface, signal): iface_lc = iface.lower() member = signal.getAttribute('name') member_lc = signal.getAttribute('tp:name-for-bindings') if member != member_lc.replace('_', ''): raise AssertionError('Signal %s tp:name-for-bindings (%s) does ' 'not match' % (member, member_lc)) member_lc = member_lc.lower() member_uc = member_lc.upper() arg_count = 0 args = [] out_args = [] for arg in signal.getElementsByTagName('arg'): name = arg.getAttribute('name') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if not name: name = 'arg%u' % arg_count arg_count += 1 else: name = 'arg_%s' % name info = type_to_gtype(type) args.append((name, info, tp_type, arg)) callback_name = ('%s_%s_signal_callback_%s' % (self.prefix_lc, iface_lc, member_lc)) collect_name = ('_%s_%s_collect_args_of_%s' % (self.prefix_lc, iface_lc, member_lc)) invoke_name = ('_%s_%s_invoke_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc)) # Example: # # typedef void (*tp_cli_connection_signal_callback_new_channel) # (TpConnection *proxy, const gchar *arg_object_path, # const gchar *arg_channel_type, guint arg_handle_type, # guint arg_handle, gboolean arg_suppress_handler, # gpointer user_data, GObject *weak_object); self.d('/**') self.d(' * %s:' % callback_name) self.d(' * @proxy: The proxy on which %s_%s_connect_to_%s ()' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * was called') for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = get_docstring(elt) or '(Undocumented)' if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: %s' % (name, xml_escape(docs))) self.d(' * @user_data: User-supplied data') self.d(' * @weak_object: User-supplied weakly referenced object') self.d(' *') self.d(' * Represents the signature of a callback for the signal %s.' % member) self.d(' */') self.d('') self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' gpointer user_data, GObject *weak_object);') if args: self.b('static void') self.b('%s (DBusGProxy *proxy G_GNUC_UNUSED,' % collect_name) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s%s%s,' % (const, ctype, name)) self.b(' TpProxySignalConnection *sc)') self.b('{') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' GValueArray *args = g_value_array_new (%d);' % len(args)) self.b(' GValue blank = { 0 };') self.b(' guint i;') self.b('') self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(args)) self.b(' g_value_array_append (args, &blank);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('') for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) self.b(' ' + copy_into_gvalue('args->values + %d' % i, gtype, marshaller, name)) self.b('') self.b(' tp_proxy_signal_connection_v0_take_results (sc, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *tpproxy,' % invoke_name) self.b(' GError *error G_GNUC_UNUSED,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback =' % callback_name) self.b(' (%s) generic_callback;' % callback_name) self.b('') self.b(' if (callback != NULL)') self.b(' callback (g_object_ref (tpproxy),') # FIXME: factor out into a function for i, arg in enumerate(args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' user_data,') self.b(' weak_object);') self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') if len(args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b('') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b(' g_object_unref (tpproxy);') self.b('}') # Example: # # TpProxySignalConnection * # tp_cli_connection_connect_to_new_channel # (TpConnection *proxy, # tp_cli_connection_signal_callback_new_channel callback, # gpointer user_data, # GDestroyNotify destroy); # # destroy is invoked when the signal becomes disconnected. This # is either because the signal has been disconnected explicitly # by the user, because the TpProxy has become invalid and # emitted the 'invalidated' signal, or because the weakly referenced # object has gone away. self.d('/**') self.d(' * %s_%s_connect_to_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: %s' % self.proxy_doc) self.d(' * @callback: Callback to be called when the signal is') self.d(' * received') self.d(' * @user_data: User-supplied data for the callback') self.d(' * @destroy: Destructor for the user-supplied data, which') self.d(' * will be called when this signal is disconnected, or') self.d(' * before this function returns %NULL') self.d(' * @weak_object: A #GObject which will be weakly referenced; ') self.d(' * if it is destroyed, this callback will automatically be') self.d(' * disconnected') self.d(' * @error: If not %NULL, used to raise an error if %NULL is') self.d(' * returned') self.d(' *') self.d(' * Connect a handler to the signal %s.' % member) self.d(' *') self.d(' * %s' % xml_escape(get_docstring(signal) or '(Undocumented)')) self.d(' *') self.d(' * Returns: a #TpProxySignalConnection containing all of the') self.d(' * above, which can be used to disconnect the signal; or') self.d(' * %NULL if the proxy does not have the desired interface') self.d(' * or has become invalid.') self.d(' */') self.d('') self.h('TpProxySignalConnection *%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object,') self.h(' GError **error);') self.h('') self.b('TpProxySignalConnection *') self.b('%s_%s_connect_to_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object,') self.b(' GError **error)') self.b('{') self.b(' GType expected_types[%d] = {' % (len(args) + 1)) for arg in args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID };') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b(' g_return_val_if_fail (callback != NULL, NULL);') self.b('') self.b(' return tp_proxy_signal_connection_v0_new ((TpProxy *) proxy,') self.b(' %s, \"%s\",' % (self.get_iface_quark(), member)) self.b(' expected_types,') if args: self.b(' G_CALLBACK (%s),' % collect_name) else: self.b(' NULL, /* no args => no collector function */') self.b(' %s,' % invoke_name) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, error);') self.b('}') self.b('') def do_method(self, iface, method): iface_lc = iface.lower() member = method.getAttribute('name') member_lc = method.getAttribute('tp:name-for-bindings') if member != member_lc.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (member, member_lc)) member_lc = member_lc.lower() member_uc = member_lc.upper() in_count = 0 ret_count = 0 in_args = [] out_args = [] for arg in method.getElementsByTagName('arg'): name = arg.getAttribute('name') direction = arg.getAttribute('direction') type = arg.getAttribute('type') tp_type = arg.getAttribute('tp:type') if direction != 'out': if not name: name = 'in%u' % in_count in_count += 1 else: name = 'in_%s' % name else: if not name: name = 'out%u' % ret_count ret_count += 1 else: name = 'out_%s' % name info = type_to_gtype(type) if direction != 'out': in_args.append((name, info, tp_type, arg)) else: out_args.append((name, info, tp_type, arg)) # Async reply callback type # Example: # void (*tp_cli_properties_interface_callback_for_get_properties) # (TpProxy *proxy, # const GPtrArray *out0, # const GError *error, # gpointer user_data, # GObject *weak_object); self.d('/**') self.d(' * %s_%s_callback_for_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: the proxy on which the call was made') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to return an \'out\' argument if @error is ' '%%NULL: %s' % (name, docs)) self.d(' * @error: %NULL on success, or an error on failure') self.d(' * @user_data: user-supplied data') self.d(' * @weak_object: user-supplied object') self.d(' *') self.d(' * Signature of the callback called when a %s method call' % member) self.d(' * succeeds or fails.') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') callback_name = '%s_%s_callback_for_%s' % (self.prefix_lc, iface_lc, member_lc) self.h('typedef void (*%s) (%sproxy,' % (callback_name, self.proxy_cls)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.h(' const GError *error, gpointer user_data,') self.h(' GObject *weak_object);') self.h('') # Async callback implementation invoke_callback = '_%s_%s_invoke_callback_%s' % (self.prefix_lc, iface_lc, member_lc) collect_callback = '_%s_%s_collect_callback_%s' % (self.prefix_lc, iface_lc, member_lc) # The callback called by dbus-glib; this ends the call and collects # the results into a GValueArray. self.b('static void') self.b('%s (DBusGProxy *proxy,' % collect_callback) self.b(' DBusGProxyCall *call,') self.b(' gpointer user_data)') self.b('{') self.b(' GError *error = NULL;') if len(out_args) > 0: self.b(' GValueArray *args;') self.b(' GValue blank = { 0 };') self.b(' guint i;') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info # "We handle variants specially; the caller is expected to # have already allocated storage for them". Thanks, # dbus-glib... if gtype == 'G_TYPE_VALUE': self.b(' GValue *%s = g_new0 (GValue, 1);' % name) else: self.b(' %s%s;' % (ctype, name)) self.b('') self.b(' dbus_g_proxy_end_call (proxy, call, &error,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if gtype == 'G_TYPE_VALUE': self.b(' %s, %s,' % (gtype, name)) else: self.b(' %s, &%s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') if len(out_args) == 0: self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,' 'NULL);') else: self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' tp_proxy_pending_call_v0_take_results (user_data, error,') self.b(' NULL);') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if gtype == 'G_TYPE_VALUE': self.b(' g_free (%s);' % name) self.b(' return;') self.b(' }') self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' args = g_value_array_new (%d);' % len(out_args)) self.b(' g_value_init (&blank, G_TYPE_INT);') self.b('') self.b(' for (i = 0; i < %d; i++)' % len(out_args)) self.b(' g_value_array_append (args, &blank);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b('') self.b(' g_value_unset (args->values + %d);' % i) self.b(' g_value_init (args->values + %d, %s);' % (i, gtype)) self.b(' ' + move_into_gvalue('args->values + %d' % i, gtype, marshaller, name)) self.b(' tp_proxy_pending_call_v0_take_results (user_data, ' 'NULL, args);') self.b('}') self.b('static void') self.b('%s (TpProxy *self,' % invoke_callback) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback generic_callback,') self.b(' gpointer user_data,') self.b(' GObject *weak_object)') self.b('{') self.b(' %s callback = (%s) generic_callback;' % (callback_name, callback_name)) self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' callback ((%s) self,' % self.proxy_cls) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED' or pointer: self.b(' NULL,') elif gtype == 'G_TYPE_DOUBLE': self.b(' 0.0,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b(' g_error_free (error);') self.b(' return;') self.b(' }') self.b(' callback ((%s) self,' % self.proxy_cls) # FIXME: factor out into a function for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if marshaller == 'BOXED': self.b(' g_value_get_boxed (args->values + %d),' % i) elif gtype == 'G_TYPE_STRING': self.b(' g_value_get_string (args->values + %d),' % i) elif gtype == 'G_TYPE_UCHAR': self.b(' g_value_get_uchar (args->values + %d),' % i) elif gtype == 'G_TYPE_BOOLEAN': self.b(' g_value_get_boolean (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT': self.b(' g_value_get_uint (args->values + %d),' % i) elif gtype == 'G_TYPE_INT': self.b(' g_value_get_int (args->values + %d),' % i) elif gtype == 'G_TYPE_UINT64': self.b(' g_value_get_uint64 (args->values + %d),' % i) elif gtype == 'G_TYPE_INT64': self.b(' g_value_get_int64 (args->values + %d),' % i) elif gtype == 'G_TYPE_DOUBLE': self.b(' g_value_get_double (args->values + %d),' % i) else: assert False, "Don't know how to get %s from a GValue" % gtype self.b(' error, user_data, weak_object);') self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') if len(out_args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('}') self.b('') # Async stub # Example: # TpProxyPendingCall * # tp_cli_properties_interface_call_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # tp_cli_properties_interface_callback_for_get_properties callback, # gpointer user_data, # GDestroyNotify *destructor); self.h('TpProxyPendingCall *%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.h(' gint timeout_ms,') self.d('/**') self.d(' * %s_%s_call_%s:' % (self.prefix_lc, iface_lc, member_lc)) self.d(' * @proxy: the #TpProxy') self.d(' * @timeout_ms: the timeout in milliseconds, or -1 to use the') self.d(' * default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to pass an \'in\' argument: %s' % (name, docs)) self.d(' * @callback: called when the method call succeeds or fails;') self.d(' * may be %NULL to make a "fire and forget" call with no ') self.d(' * reply tracking') self.d(' * @user_data: user-supplied data passed to the callback;') self.d(' * must be %NULL if @callback is %NULL') self.d(' * @destroy: called with the user_data as argument, after the') self.d(' * call has succeeded, failed or been cancelled;') self.d(' * must be %NULL if @callback is %NULL') self.d(' * @weak_object: If not %NULL, a #GObject which will be ') self.d(' * weakly referenced; if it is destroyed, this call ') self.d(' * will automatically be cancelled. Must be %NULL if ') self.d(' * @callback is %NULL') self.d(' *') self.d(' * Start a %s method call.' % member) self.d(' *') self.d(' * %s' % xml_escape(get_docstring(method) or '(Undocumented)')) self.d(' *') self.d(' * Returns: a #TpProxyPendingCall representing the call in') self.d(' * progress. It is borrowed from the object, and will become') self.d(' * invalid when the callback is called, the call is') self.d(' * cancelled or the #TpProxy becomes invalid.') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') self.b('TpProxyPendingCall *\n%s_%s_call_%s (%sproxy,' % (self.prefix_lc, iface_lc, member_lc, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) self.h(' %s callback,' % callback_name) self.h(' gpointer user_data,') self.h(' GDestroyNotify destroy,') self.h(' GObject *weak_object);') self.h('') self.b(' %s callback,' % callback_name) self.b(' gpointer user_data,') self.b(' GDestroyNotify destroy,') self.b(' GObject *weak_object)') self.b('{') self.b(' GError *error = NULL;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) self.b(' DBusGProxy *iface;') self.b('') self.b(' g_return_val_if_fail (%s (proxy), NULL);' % self.proxy_assert) self.b(' g_return_val_if_fail (callback != NULL || ' 'user_data == NULL, NULL);') self.b(' g_return_val_if_fail (callback != NULL || ' 'destroy == NULL, NULL);') self.b(' g_return_val_if_fail (callback != NULL || ' 'weak_object == NULL, NULL);') self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' iface = tp_proxy_borrow_interface_by_id (') self.b(' (TpProxy *) proxy,') self.b(' interface, &error);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('') self.b(' if (iface == NULL)') self.b(' {') self.b(' if (callback != NULL)') self.b(' callback (proxy,') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info if pointer: self.b(' NULL,') else: self.b(' 0,') self.b(' error, user_data, weak_object);') self.b('') self.b(' if (destroy != NULL)') self.b(' destroy (user_data);') self.b('') self.b(' g_error_free (error);') self.b(' return NULL;') self.b(' }') self.b('') self.b(' if (callback == NULL)') self.b(' {') self.b(' dbus_g_proxy_call_no_reply (iface, "%s",' % member) for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID);') self.b(' return NULL;') self.b(' }') self.b(' else') self.b(' {') self.b(' TpProxyPendingCall *data;') self.b('') self.b(' data = tp_proxy_pending_call_v0_new ((TpProxy *) proxy,') self.b(' interface, "%s", iface,' % member) self.b(' %s,' % invoke_callback) self.b(' G_CALLBACK (callback), user_data, destroy,') self.b(' weak_object, FALSE);') self.b(' tp_proxy_pending_call_v0_take_pending_call (data,') self.b(' dbus_g_proxy_begin_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' %s,' % collect_callback) self.b(' data,') self.b(' tp_proxy_pending_call_v0_completed,') self.b(' timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID));') self.b('') self.b(' return data;') self.b(' }') self.b('}') self.b('') self.do_method_reentrant(method, iface_lc, member, member_lc, in_args, out_args, collect_callback) # leave a gap for the end of the method self.d('') self.b('') self.h('') def do_method_reentrant(self, method, iface_lc, member, member_lc, in_args, out_args, collect_callback): # Reentrant blocking calls # Example: # gboolean tp_cli_properties_interface_run_get_properties # (gpointer proxy, # gint timeout_ms, # const GArray *in_properties, # GPtrArray **out0, # GError **error, # GMainLoop **loop); run_method_name = '%s_%s_run_%s' % (self.prefix_lc, iface_lc, member_lc) if run_method_name not in self.reentrant_symbols: return self.b('typedef struct {') self.b(' GMainLoop *loop;') self.b(' GError **error;') for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' %s*%s;' % (ctype, name)) self.b(' unsigned success:1;') self.b(' unsigned completed:1;') self.b('} _%s_%s_run_state_%s;' % (self.prefix_lc, iface_lc, member_lc)) reentrant_invoke = '_%s_%s_finish_running_%s' % (self.prefix_lc, iface_lc, member_lc) self.b('static void') self.b('%s (TpProxy *self G_GNUC_UNUSED,' % reentrant_invoke) self.b(' GError *error,') self.b(' GValueArray *args,') self.b(' GCallback unused G_GNUC_UNUSED,') self.b(' gpointer user_data G_GNUC_UNUSED,') self.b(' GObject *unused2 G_GNUC_UNUSED)') self.b('{') self.b(' _%s_%s_run_state_%s *state = user_data;' % (self.prefix_lc, iface_lc, member_lc)) self.b('') self.b(' state->success = (error == NULL);') self.b(' state->completed = TRUE;') self.b(' g_main_loop_quit (state->loop);') self.b('') self.b(' if (error != NULL)') self.b(' {') self.b(' if (state->error != NULL)') self.b(' *state->error = error;') self.b(' else') self.b(' g_error_free (error);') self.b('') self.b(' return;') self.b(' }') self.b('') for i, arg in enumerate(out_args): name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.b(' if (state->%s != NULL)' % name) if marshaller == 'BOXED': self.b(' *state->%s = g_value_dup_boxed (' 'args->values + %d);' % (name, i)) elif marshaller == 'STRING': self.b(' *state->%s = g_value_dup_string ' '(args->values + %d);' % (name, i)) elif marshaller in ('UCHAR', 'BOOLEAN', 'INT', 'UINT', 'INT64', 'UINT64', 'DOUBLE'): self.b(' *state->%s = g_value_get_%s (args->values + %d);' % (name, marshaller.lower(), i)) else: assert False, "Don't know how to copy %s" % gtype self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') if len(out_args) > 0: self.b(' g_value_array_free (args);') else: self.b(' if (args != NULL)') self.b(' g_value_array_free (args);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('}') self.b('') if self.deprecate_reentrant: self.h('#ifndef %s' % self.deprecate_reentrant) self.h('gboolean %s (%sproxy,' % (run_method_name, self.proxy_arg)) self.h(' gint timeout_ms,') self.d('/**') self.d(' * %s:' % run_method_name) self.d(' * @proxy: %s' % self.proxy_doc) self.d(' * @timeout_ms: Timeout in milliseconds, or -1 for default') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info docs = xml_escape(get_docstring(elt) or '(Undocumented)') if ctype == 'guint ' and tp_type != '': docs += ' (#%s)' % ('Tp' + tp_type.replace('_', '')) self.d(' * @%s: Used to pass an \'in\' argument: %s' % (name, docs)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.d(' * @%s: Used to return an \'out\' argument if %%TRUE is ' 'returned: %s' % (name, xml_escape(get_docstring(elt) or '(Undocumented)'))) self.d(' * @error: If not %NULL, used to return errors if %FALSE ') self.d(' * is returned') self.d(' * @loop: If not %NULL, set before re-entering ') self.d(' * the main loop, to point to a #GMainLoop ') self.d(' * which can be used to cancel this call with ') self.d(' * g_main_loop_quit(), causing a return of ') self.d(' * %FALSE with @error set to %TP_DBUS_ERROR_CANCELLED') self.d(' *') self.d(' * Call the method %s and run the main loop' % member) self.d(' * until it returns. Before calling this method, you must') self.d(' * add a reference to any borrowed objects you need to keep,') self.d(' * and generally ensure that everything is in a consistent') self.d(' * state.') self.d(' *') self.d(' * %s' % xml_escape(get_docstring(method) or '(Undocumented)')) self.d(' *') self.d(' * Returns: TRUE on success, FALSE and sets @error on error') deprecated = method.getElementsByTagName('tp:deprecated') if deprecated: d = deprecated[0] self.d(' *') self.d(' * Deprecated: %s' % xml_escape(get_deprecated(d))) self.d(' */') self.d('') self.b('gboolean\n%s (%sproxy,' % (run_method_name, self.proxy_arg)) self.b(' gint timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.h(' %s%s%s,' % (const, ctype, name)) self.b(' %s%s%s,' % (const, ctype, name)) for arg in out_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info self.h(' %s*%s,' % (ctype, name)) self.b(' %s*%s,' % (ctype, name)) self.h(' GError **error,') if self.deprecate_reentrant: self.h(' GMainLoop **loop) %s;' % self.deprecation_attribute) self.h('#endif /* not %s */' % self.deprecate_reentrant) else: self.h(' GMainLoop **loop);') self.h('') self.b(' GError **error,') self.b(' GMainLoop **loop)') self.b('{') self.b(' DBusGProxy *iface;') self.b(' GQuark interface = %s;' % self.get_iface_quark()) self.b(' TpProxyPendingCall *pc;') self.b(' _%s_%s_run_state_%s state = {' % (self.prefix_lc, iface_lc, member_lc)) self.b(' NULL /* loop */, error,') for arg in out_args: name, info, tp_type, elt = arg self.b(' %s,' % name) self.b(' FALSE /* completed */, FALSE /* success */ };') self.b('') self.b(' g_return_val_if_fail (%s (proxy), FALSE);' % self.proxy_assert) self.b('') self.b(' G_GNUC_BEGIN_IGNORE_DEPRECATIONS') self.b(' iface = tp_proxy_borrow_interface_by_id') self.b(' ((TpProxy *) proxy, interface, error);') self.b(' G_GNUC_END_IGNORE_DEPRECATIONS') self.b('') self.b(' if (iface == NULL)') self.b(' return FALSE;') self.b('') self.b(' state.loop = g_main_loop_new (NULL, FALSE);') self.b('') self.b(' pc = tp_proxy_pending_call_v0_new ((TpProxy *) proxy,') self.b(' interface, "%s", iface,' % member) self.b(' %s,' % reentrant_invoke) self.b(' NULL, &state, NULL, NULL, TRUE);') self.b('') self.b(' if (loop != NULL)') self.b(' *loop = state.loop;') self.b('') self.b(' tp_proxy_pending_call_v0_take_pending_call (pc,') self.b(' dbus_g_proxy_begin_call_with_timeout (iface,') self.b(' "%s",' % member) self.b(' %s,' % collect_callback) self.b(' pc,') self.b(' tp_proxy_pending_call_v0_completed,') self.b(' timeout_ms,') for arg in in_args: name, info, tp_type, elt = arg ctype, gtype, marshaller, pointer = info const = pointer and 'const ' or '' self.b(' %s, %s,' % (gtype, name)) self.b(' G_TYPE_INVALID));') self.b('') self.b(' if (!state.completed)') self.b(' g_main_loop_run (state.loop);') self.b('') self.b(' if (!state.completed)') self.b(' tp_proxy_pending_call_cancel (pc);') self.b('') self.b(' if (loop != NULL)') self.b(' *loop = NULL;') self.b('') self.b(' g_main_loop_unref (state.loop);') self.b('') self.b(' return state.success;') self.b('}') self.b('') def do_signal_add(self, signal): marshaller_items = [] gtypes = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') type = i.getAttribute('type') info = type_to_gtype(type) # type, GType, STRING, is a pointer gtypes.append(info[1]) self.b(' dbus_g_proxy_add_signal (proxy, "%s",' % signal.getAttribute('name')) for gtype in gtypes: self.b(' %s,' % gtype) self.b(' G_TYPE_INVALID);') def do_interface(self, node): ifaces = node.getElementsByTagName('interface') assert len(ifaces) == 1 iface = ifaces[0] name = node.getAttribute('name').replace('/', '') self.iface = name self.iface_lc = name.lower() self.iface_uc = name.upper() self.iface_mc = name.replace('_', '') self.iface_dbus = iface.getAttribute('name') signals = node.getElementsByTagName('signal') methods = node.getElementsByTagName('method') if signals: self.b('static inline void') self.b('%s_add_signals_for_%s (DBusGProxy *proxy)' % (self.prefix_lc, name.lower())) self.b('{') if self.tp_proxy_api >= (0, 7, 6): self.b(' if (!tp_proxy_dbus_g_proxy_claim_for_signal_adding ' '(proxy))') self.b(' return;') for signal in signals: self.do_signal_add(signal) self.b('}') self.b('') self.b('') for signal in signals: self.do_signal(name, signal) for method in methods: self.do_method(name, method) self.iface_dbus = None def __call__(self): if self.guard is not None: self.h('#ifndef %s' % self.guard) self.h('#define %s' % self.guard) self.h('') self.h('G_BEGIN_DECLS') self.h('') self.b('/* We don\'t want gtkdoc scanning this file, it\'ll get') self.b(' * confused by seeing function definitions, so mark it as: */') self.b('/**/') self.b('') nodes = self.dom.getElementsByTagName('node') nodes.sort(key=key_by_name) for node in nodes: self.do_interface(node) if self.group is not None: self.b('/*') self.b(' * %s_%s_add_signals:' % (self.prefix_lc, self.group)) self.b(' * @self: the #TpProxy') self.b(' * @quark: a quark whose string value is the interface') self.b(' * name whose signals should be added') self.b(' * @proxy: the D-Bus proxy to which to add the signals') self.b(' * @unused: not used for anything') self.b(' *') self.b(' * Tell dbus-glib that @proxy has the signatures of all') self.b(' * signals on the given interface, if it\'s one we') self.b(' * support.') self.b(' *') self.b(' * This function should be used as a signal handler for') self.b(' * #TpProxy::interface-added.') self.b(' */') self.b('static void') self.b('%s_%s_add_signals (TpProxy *self G_GNUC_UNUSED,' % (self.prefix_lc, self.group)) self.b(' guint quark,') self.b(' DBusGProxy *proxy,') self.b(' gpointer unused G_GNUC_UNUSED)') self.b('{') for node in nodes: iface = node.getElementsByTagName('interface')[0] self.iface_dbus = iface.getAttribute('name') signals = node.getElementsByTagName('signal') if not signals: continue name = node.getAttribute('name').replace('/', '').lower() self.iface_uc = name.upper() self.b(' if (quark == %s)' % self.get_iface_quark()) self.b(' %s_add_signals_for_%s (proxy);' % (self.prefix_lc, name)) self.b('}') self.b('') self.h('G_END_DECLS') self.h('') if self.guard is not None: self.h('#endif /* defined (%s) */' % self.guard) self.h('') file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) file_set_contents(self.basename + '-body.h', u('\n').join(self.__body).encode('utf-8')) file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': options, argv = gnu_getopt(sys.argv[1:], '', ['group=', 'subclass=', 'subclass-assert=', 'iface-quark-prefix=', 'tp-proxy-api=', 'generate-reentrant=', 'deprecate-reentrant=', 'deprecation-attribute=', 'guard=']) opts = {} for option, value in options: opts[option] = value dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1], argv[2], opts)() telepathy-glib-0.24.2/tools/xincludator.py0000644000175000017500000000272214004033172015475 00000000000000#!/usr/bin/python import sys from sys import argv, stdout, stderr import codecs, locale import os import xml.dom.minidom if sys.version_info[0] < 3: stdout = codecs.getwriter('utf-8')(stdout) NS_XI = 'http://www.w3.org/2001/XInclude' def xincludate(dom, base, dropns = []): remove_attrs = [] for i in range(dom.documentElement.attributes.length): attr = dom.documentElement.attributes.item(i) if attr.prefix == 'xmlns': if attr.localName in dropns: remove_attrs.append(attr) else: dropns.append(attr.localName) for attr in remove_attrs: dom.documentElement.removeAttributeNode(attr) for include in dom.getElementsByTagNameNS(NS_XI, 'include'): href = include.getAttribute('href') # FIXME: assumes Unixy paths filename = os.path.join(os.path.dirname(base), href) subdom = xml.dom.minidom.parse(filename) xincludate(subdom, filename, dropns) if './' in href: subdom.documentElement.setAttribute('xml:base', href) include.parentNode.replaceChild(subdom.documentElement, include) if __name__ == '__main__': argv = argv[1:] dom = xml.dom.minidom.parse(argv[0]) xincludate(dom, argv[0]) if sys.version_info[0] >= 3: xml = dom.toxml('utf-8') stdout.buffer.write(xml) stdout.buffer.write(b'\n') else: xml = dom.toxml() stdout.write(xml) stdout.write('\n') telepathy-glib-0.24.2/tools/check-misc.sh0000644000175000017500000000036012652510705015136 00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-whitespace.sh ) || fail=$? if egrep '(Free\s*Software\s*Foundation.*02139|02111-1307)' "$@" then echo "^^^ The above files contain the FSF's old address in GPL headers" fail=1 fi exit $fail telepathy-glib-0.24.2/tools/glib-errors-str-gen.py0000644000175000017500000000445514004033172016752 00000000000000#!/usr/bin/python import sys import xml.dom.minidom from libtpcodegen import file_set_contents, u from libglibcodegen import NS_TP, get_docstring, xml_escape class Generator(object): def __init__(self, dom, basename): self.dom = dom self.errors = self.dom.getElementsByTagNameNS(NS_TP, 'errors')[0] self.basename = basename self.__header = [] self.__body = [] self.__docs = [] def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def d(self, s): self.__docs.append(s) def __call__(self): errors = self.errors.getElementsByTagNameNS(NS_TP, 'error') self.b('#include ') self.b('') self.b('const gchar *') self.b('tp_error_get_dbus_name (TpError error)') self.b('{') self.b(' switch (error)') self.b(' {') for error in errors: ns = error.parentNode.getAttribute('namespace') nick = error.getAttribute('name').replace(' ', '') uc_nick = error.getAttribute('name').replace(' ', '_').replace('.', '_').upper() name = 'TP_ERROR_STR_' + uc_nick error_name = '%s.%s' % (ns, nick) self.d('/**') self.d(' * %s:' % name) self.d(' *') self.d(' * The D-Bus error name %s' % error_name) self.d(' *') self.d(' * %s' % xml_escape(get_docstring(error))) self.d(' */') self.d('') self.h('#define %s "%s"' % (name, error_name)) self.b(' case TP_ERROR_%s:' % uc_nick) self.b(' return %s;' % name) self.b(' default:') self.b(' g_return_val_if_reached (NULL);') self.b(' }') self.b('}') # make both files end with a newline self.h('') self.b('') file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) file_set_contents(self.basename + '.c', u('\n').join(self.__body).encode('utf-8')) file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) if __name__ == '__main__': argv = sys.argv[1:] basename = argv[0] Generator(xml.dom.minidom.parse(argv[1]), basename)() telepathy-glib-0.24.2/tools/lcov.am0000644000175000017500000000150312652510705014056 00000000000000lcov-reset: lcov --directory @top_srcdir@ --zerocounters lcov-report: lcov --directory @top_srcdir@ --capture \ --output-file @top_builddir@/lcov.info.tmp lcov --directory @top_srcdir@ --output-file @top_builddir@/lcov.info \ --remove @top_builddir@/lcov.info.tmp telepathy-glib-scan.c rm @top_builddir@/lcov.info.tmp $(MKDIR_P) @top_builddir@/lcov.html echo "Coming soon!" > @top_builddir@/lcov.html/index.html git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\ genhtml --title "@PACKAGE_STRING@ $$git_commit" \ --output-directory @top_builddir@/lcov.html lcov.info @echo @echo 'lcov report can be found in:' @echo 'file://@abs_top_builddir@/lcov.html/index.html' @echo lcov-check: $(MAKE) lcov-reset $(MAKE) check $(LCOV_CHECK_ARGS) $(MAKE) lcov-report ## vim:set ft=automake: telepathy-glib-0.24.2/tools/glib-client-marshaller-gen.py0000644000175000017500000000301114004033172020221 00000000000000#!/usr/bin/python import sys import xml.dom.minidom from string import ascii_letters, digits from libglibcodegen import signal_to_marshal_name NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" class Generator(object): def __init__(self, dom, prefix): self.dom = dom self.marshallers = {} self.prefix = prefix def do_signal(self, signal): marshaller = signal_to_marshal_name(signal, self.prefix) assert '__' in marshaller rhs = marshaller.split('__', 1)[1].split('_') self.marshallers[marshaller] = rhs def __call__(self): signals = self.dom.getElementsByTagName('signal') for signal in signals: self.do_signal(signal) print('void') print('%s_register_dbus_glib_marshallers (void)' % self.prefix) print('{') all = list(self.marshallers.keys()) all.sort() for marshaller in all: rhs = self.marshallers[marshaller] print(' dbus_g_object_register_marshaller (') print(' g_cclosure_marshal_generic,') print(' G_TYPE_NONE, /* return */') for type in rhs: print(' G_TYPE_%s,' % type.replace('VOID', 'NONE')) print(' G_TYPE_INVALID);') print('}') def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) Generator(dom, argv[1])() telepathy-glib-0.24.2/tools/make-release-mail.py0000644000175000017500000000534614004031760016422 00000000000000#!/usr/bin/env python # vim: set fileencoding=utf-8 : # # Hello. This is make-release-mail.py from the Telepathy project. It's # designed to turn an item from a NEWS file into a mail suitable for sending # to . I hope that you enjoy your stay. import sys import re def looks_like_a_header(line, package, version=None): if version is None: pattern = "^%s .* \(.*\)$" % package else: pattern = "^%s %s \(.*\)$" % (package, version) return re.match(pattern, line) is not None def extract_description(package, version, news_path): release_name = [] details = [] with open(news_path) as f: lines = (line for line in f.readlines()) for line in lines: # Find the 'telepathy-foo 0.1.2' header if looks_like_a_header(line, package, version): break # Skip the ====== line, and the first blank line next(lines) next(lines) got_release_name = False for line in lines: line = line.rstrip() # If we hit the next version header, we're done if looks_like_a_header(line, package): break # Else, if we hit a blank line and we're still reading the release # name, we're done with the release name. elif not got_release_name and line == '': got_release_name = True # Otherwise, append this to the relevant list elif not got_release_name: release_name.append(line) else: details.append(line) assert got_release_name, (release_name, details) # We rstrip details because it picks up a trailing blank line return ('\n'.join(release_name), '\n'.join(details).rstrip()) BASE_URL = 'http://telepathy.freedesktop.org/releases' GIT_URL = 'http://cgit.freedesktop.org/telepathy' def main(package, version, news_path): release_name, details = extract_description(package, version, news_path) print(""" %(release_name)s tarball: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz signature: %(base_url)s/%(package)s/%(package)s-%(version)s.tar.gz.asc git: %(git_url)s/%(package)s %(details)s""".strip().rstrip() % { 'base_url': BASE_URL, 'git_url': GIT_URL, 'package': package, 'version': version, 'release_name': release_name, 'details': details, }) if __name__ == '__main__': try: package, version, news_path = sys.argv[1:] main(package, version, news_path) except ValueError as e: sys.stderr.write( 'Usage: %s package-name package.version.number path/to/NEWS\n' % sys.argv[0]) sys.stderr.flush() sys.exit(1) telepathy-glib-0.24.2/tools/check-whitespace.sh0000644000175000017500000000032312652510705016336 00000000000000#!/bin/sh fail=0 if grep -n ' $' "$@" then echo "^^^ The above files contain unwanted trailing spaces" fail=1 fi if grep -n ' ' "$@" then echo "^^^ The above files contain tabs" fail=1 fi exit $fail telepathy-glib-0.24.2/tools/libtpcodegen.py0000644000175000017500000001661512652510705015617 00000000000000"""Library code for language-independent D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import os import sys from string import ascii_letters, digits NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" _ASCII_ALNUM = ascii_letters + digits if sys.version_info[0] >= 3: def u(s): """Return s, which must be a str literal with no non-ASCII characters. This is like a more restricted form of the Python 2 u'' syntax. """ return s.encode('ascii').decode('ascii') else: def u(s): """Return a Unicode version of s, which must be a str literal (a bytestring) in which each byte is an ASCII character. This is like a more restricted form of the u'' syntax. """ return s.decode('ascii') def file_set_contents(filename, contents): try: os.remove(filename) except OSError: pass try: os.remove(filename + '.tmp') except OSError: pass open(filename + '.tmp', 'wb').write(contents) os.rename(filename + '.tmp', filename) def cmp_by_name(node1, node2): return cmp(node1.getAttributeNode("name").nodeValue, node2.getAttributeNode("name").nodeValue) def key_by_name(node): return node.getAttributeNode("name").nodeValue def escape_as_identifier(identifier): """Escape the given string to be a valid D-Bus object path or service name component, using a reversible encoding to ensure uniqueness. The reversible encoding is as follows: * The empty string becomes '_' * Otherwise, each non-alphanumeric character is replaced by '_' plus two lower-case hex digits; the same replacement is carried out on the first character, if it's a digit """ # '' -> '_' if not identifier: return '_' # A bit of a fast path for strings which are already OK. # We deliberately omit '_' because, for reversibility, that must also # be escaped. if (identifier.strip(_ASCII_ALNUM) == '' and identifier[0] in ascii_letters): return identifier # The first character may not be a digit if identifier[0] not in ascii_letters: ret = ['_%02x' % ord(identifier[0])] else: ret = [identifier[0]] # Subsequent characters may be digits or ASCII letters for c in identifier[1:]: if c in _ASCII_ALNUM: ret.append(c) else: ret.append('_%02x' % ord(c)) return ''.join(ret) def get_by_path(element, path): branches = path.split('/') branch = branches[0] # Is the current branch an attribute, if so, return the attribute value if branch[0] == '@': return element.getAttribute(branch[1:]) # Find matching children for the branch children = [] if branch == '..': children.append(element.parentNode) else: for x in element.childNodes: if x.localName == branch: children.append(x) ret = [] # If this is not the last path element, recursively gather results from # children if len(branches) > 1: for x in children: add = get_by_path(x, '/'.join(branches[1:])) if isinstance(add, list): ret += add else: return add else: ret = children return ret def get_docstring(element): docstring = None for x in element.childNodes: if x.namespaceURI == NS_TP and x.localName == 'docstring': docstring = x if docstring is not None: docstring = docstring.toxml().replace('\n', ' ').strip() if docstring.startswith(''): docstring = docstring[14:].lstrip() if docstring.endswith(''): docstring = docstring[:-15].rstrip() if docstring in ('', ''): docstring = '' return docstring def get_deprecated(element): text = [] for x in element.childNodes: if hasattr(x, 'data'): text.append(x.data.replace('\n', ' ').strip()) else: # This caters for tp:dbus-ref elements, but little else. if x.childNodes and hasattr(x.childNodes[0], 'data'): text.append(x.childNodes[0].data.replace('\n', ' ').strip()) return ' '.join(text) def get_descendant_text(element_or_elements): if not element_or_elements: return '' if isinstance(element_or_elements, list): return ''.join(map(get_descendant_text, element_or_elements)) parts = [] for x in element_or_elements.childNodes: if x.nodeType == x.TEXT_NODE: parts.append(x.nodeValue) elif x.nodeType == x.ELEMENT_NODE: parts.append(get_descendant_text(x)) else: pass return ''.join(parts) class _SignatureIter: """Iterator over a D-Bus signature. Copied from dbus-python 0.71 so we can run genginterface in a limited environment with only Python (like Scratchbox). """ def __init__(self, string): self.remaining = string def next(self): return self.__next__() def __next__(self): if self.remaining == '': raise StopIteration signature = self.remaining block_depth = 0 block_type = None end = len(signature) for marker in range(0, end): cur_sig = signature[marker] if cur_sig == 'a': pass elif cur_sig == '{' or cur_sig == '(': if block_type == None: block_type = cur_sig if block_type == cur_sig: block_depth = block_depth + 1 elif cur_sig == '}': if block_type == '{': block_depth = block_depth - 1 if block_depth == 0: end = marker break elif cur_sig == ')': if block_type == '(': block_depth = block_depth - 1 if block_depth == 0: end = marker break else: if block_depth == 0: end = marker break end = end + 1 self.remaining = signature[end:] return Signature(signature[0:end]) class Signature(str): """A string, iteration over which is by D-Bus single complete types rather than characters. """ def __iter__(self): return _SignatureIter(self) def xml_escape(s): s = s.replace('&', '&').replace("'", ''').replace('"', '"') return s.replace('<', '<').replace('>', '>') telepathy-glib-0.24.2/tools/check-c-style.sh0000644000175000017500000000347012652510705015570 00000000000000#!/bin/sh fail=0 ( . "${tools_dir}"/check-misc.sh ) || fail=$? # The first regex finds function calls like foo() (as opposed to foo ()). # It attempts to ignore string constants (may cause false negatives). # The second and third ignore block comments (gtkdoc uses foo() as markup). # The fourth ignores cpp so you can # #define foo(bar) (_real_foo (__FUNC__, bar)) (cpp insists on foo() style). if grep -n '^[^"]*[[:lower:]](' "$@" \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: */\*' \ | grep -v '^[-[:alnum:]_./]*:[[:digit:]]*: *#' then echo "^^^ Our coding style is to use function calls like foo (), not foo()" fail=1 fi if grep -En '[(][[:alnum:]_]+ ?\*[)][(]?[[:alpha:]_]' "$@"; then echo "^^^ Our coding style is to have a space between a cast and the " echo " thing being cast" fail=1 fi # this only spots casts if grep -En '[(][[:alnum:]_]+\*+[)]' "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 1)" fail=1 fi # ... and this only spots variable declarations and function return types if grep -En '^ *(static |const |)* *[[:alnum:]_]+\*+([[:alnum:]_]|;|$)' \ "$@"; then echo "^^^ Our coding style is to have a space before the * of pointer types" echo " (regex 2)" fail=1 fi if grep -n 'g_hash_table_destroy' "$@"; then echo "^^^ Our coding style is to use g_hash_table_unref" fail=1 fi for p in "" "ptr_" "byte_"; do if grep -En "g_${p}array_free \(([^ ,]+), TRUE\)" "$@"; then echo "^^^ Our coding style is to use g_${p}array_unref in the case " echo " the underlying C array is not used" fail=1 fi done if test -n "$CHECK_FOR_LONG_LINES" then if egrep -n '.{80,}' "$@" then echo "^^^ The above files contain long lines" fail=1 fi fi exit $fail telepathy-glib-0.24.2/tools/telepathy-glib.supp0000644000175000017500000001451312652510705016424 00000000000000# Valgrind error suppression file # ============================= libc ================================== { ld.so initialization + selinux Memcheck:Leak ... fun:_dl_init obj:/lib/ld-*.so } { dlopen initialization, triggered by handle-leak-debug code Memcheck:Leak ... fun:__libc_dlopen_mode fun:init fun:backtrace fun:handle_leak_debug_bt fun:dynamic_ensure_handle fun:tp_handle_ensure } # default.supp has these for 2.10, but they're too specific { Debian libc6 (2.10.x, 2.11.x) stripped dynamic linker Memcheck:Cond fun:index fun:expand_dynamic_string_token fun:_dl_map_object fun:map_doit fun:_dl_catch_error fun:do_preload fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-*.so } { Debian libc6 (2.9.x - 2.11.x) stripped dynamic linker Memcheck:Cond fun:_dl_relocate_object fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-*.so } { ld.so initialization on glibc 2.9 Memcheck:Cond fun:strlen fun:_dl_init_paths fun:dl_main fun:_dl_sysdep_start fun:_dl_start obj:/lib/ld-2.9.so } # ======================= libselinux on Debian amd64 ===================== { I have no idea what SELinux is doing but it's not my problem Memcheck:Cond ... obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 } { I have no idea what SELinux is doing but it's not my problem Memcheck:Value8 ... obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 } { I have no idea what SELinux is doing but it's not my problem Memcheck:Leak ... obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 obj:/lib/libselinux.so.1 } # ============================= GLib ================================== { g_set_prgname copies its argument Memcheck:Leak ... fun:g_set_prgname } { one g_get_charset per child^Wprocess Memcheck:Leak ... fun:g_get_charset } { one g_get_home_dir per process Memcheck:Leak ... fun:g_get_home_dir } { GQuarks can't be freed Memcheck:Leak ... fun:g_quark_from_static_string } { GQuarks can't be freed Memcheck:Leak ... fun:g_quark_from_string } { interned strings can't be freed Memcheck:Leak ... fun:g_intern_string } { interned strings can't be freed Memcheck:Leak ... fun:g_intern_static_string } { shared global default g_main_context Memcheck:Leak ... fun:g_main_context_new fun:g_main_context_default } { GTest initialization Memcheck:Leak ... fun:g_test_init fun:main } { GTest admin Memcheck:Leak ... fun:g_test_add_vtable } { GTest pseudorandomness Memcheck:Leak ... fun:g_rand_new_with_seed_array fun:test_run_seed ... fun:g_test_run } { GSLice initialization Memcheck:Leak ... fun:g_malloc0 fun:g_slice_init_nomessage fun:g_slice_alloc } # ============================= GObject =============================== { g_type_init Memcheck:Leak ... fun:g_type_init } { g_type_init_with_debug_flags Memcheck:Leak ... fun:g_type_init_with_debug_flags } { g_type_register_static Memcheck:Leak ... fun:g_type_register_static } { g_type_add_interface_static Memcheck:Leak ... fun:g_type_add_interface_static } { initialization of interfaces Memcheck:Leak ... fun:type_iface_vtable_base_init_Wm fun:g_type_class_ref } # ============================= GIO =================================== { GIO init Memcheck:Leak ... fun:g_inet_address_class_intern_init } { g_simple_async_result class Memcheck:Leak ... fun:g_type_class_ref ... fun:g_simple_async_result_new } # ============================= dbus-glib ============================= { registering marshallers is permanent Memcheck:Leak ... fun:dbus_g_object_register_marshaller_array fun:dbus_g_object_register_marshaller } { dbus-glib specialized GTypes are permanent Memcheck:Leak ... fun:dbus_g_type_specialized_init } { libdbus shared connection Memcheck:Leak ... fun:dbus_g_bus_get } { dbus-gobject registrations aren't freed unless we fall off the bus Memcheck:Leak ... fun:g_slist_append fun:dbus_g_connection_register_g_object } { DBusGProxy slots aren't freed unless we fall off the bus Memcheck:Leak ... fun:dbus_connection_allocate_data_slot ... fun:dbus_g_proxy_constructor } { error registrations are for life, not just for Christmas Memcheck:Leak ... fun:dbus_g_error_domain_register } { DBusGProxy class init Memcheck:Leak ... fun:dbus_g_proxy_class_init } # ============================= telepathy-glib ======================== { tp_dbus_daemon_constructor @daemons once per DBusConnection Memcheck:Leak ... fun:g_slice_alloc fun:tp_dbus_daemon_constructor } { tp_proxy_subclass_add_error_mapping refs the enum Memcheck:Leak ... fun:g_type_class_ref fun:tp_proxy_subclass_add_error_mapping } { tp_proxy_or_subclass_hook_on_interface_add never frees its list Memcheck:Leak ... fun:tp_proxy_or_subclass_hook_on_interface_add } { tp_dbus_daemon_constructor filter not freed til we fall off the bus Memcheck:Leak ... fun:dbus_connection_add_filter fun:tp_dbus_daemon_constructor } { tp_g_socket_address_from_variant reffing GNIO types Memcheck:Leak ... fun:g_type_class_ref ... fun:tp_g_socket_address_from_variant } { creating classes for DBusGProxy Memcheck:Leak ... fun:g_type_class_ref ... fun:g_object_new ... fun:tp_proxy_borrow_interface_by_id } { creating classes for tp_dbus_daemon_new Memcheck:Leak ... fun:g_type_class_ref ... fun:g_object_new ... fun:tp_dbus_daemon_new } { creating classes for TpCHannel Memcheck:Leak ... fun:g_type_class_ref ... fun:g_object_new ... fun:tp_channel_new } { creating a boxed type to use in TpCapabilities Memcheck:Leak ... fun:g_type_class_ref ... fun:g_param_spec_boxed fun:tp_capabilities_class_intern_init } # ============================= questionable ========================== { creating classes for instances (this is a pretty big hammer) Memcheck:Leak ... fun:g_type_class_ref ... fun:g_type_create_instance ... fun:g_param_spec_string } telepathy-glib-0.24.2/tools/make-version-script.py0000644000175000017500000001412114004033172017037 00000000000000#!/usr/bin/python """Construct a GNU ld or Debian dpkg version-script from a set of RFC822-style symbol lists. Usage: make-version-script.py [--symbols SYMBOLS] [--unreleased-version VER] [--dpkg "LIBRARY.so.0 LIBRARY0 #MINVER#"] [--dpkg-build-depends-package LIBRARY-dev] [FILES...] Each FILE starts with RFC822-style headers "Version:" (the name of the symbol version, e.g. FOO_1.2.3) and "Extends:" (either the previous version, or "-" if this is the first version). Next there is a blank line, then a list of C symbols one per line. Comments (lines starting with whitespace + "#") are allowed and ignored. If --symbols is given, SYMBOLS lists the symbols actually exported by the library (one per line). If --unreleased-version is given, any symbols in SYMBOLS but not in FILES are assigned to that version; otherwise, any such symbols cause an error. If --dpkg is given, produce a Debian dpkg-gensymbols file instead of a GNU ld version-script. The argument to --dpkg is the first line of the resulting symbols file, and --dpkg-build-depends-package can optionally be used to set the Build-Depends-Package field. This script originates in telepathy-glib - please send us any changes that are needed. """ # Copyright (C) 2008-2010 Collabora Ltd. # Copyright (C) 2008 Nokia Corporation # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. import sys from getopt import gnu_getopt def e(format, *args): sys.stderr.write((format + '\n') % args) def main(abifiles, symbols=None, unreleased_version=None, dpkg=False, dpkg_first_line=None, dpkg_build_depends_package=None): gnuld = not dpkg symbol_set = None if symbols is not None: symbol_set = open(symbols, 'r').readlines() symbol_set = map(str.strip, symbol_set) symbol_set = set(symbol_set) versioned_symbols = set() dpkg_symbols = [] dpkg_versions = [] if dpkg: assert dpkg_first_line is not None print(dpkg_first_line) if dpkg_build_depends_package is not None: print("* Build-Depends-Package: %s" % dpkg_build_depends_package) for filename in abifiles: lines = open(filename, 'r').readlines() version = None extends = None release = None for i, line in enumerate(lines): line = line.strip() if line.startswith('#'): continue elif not line: # the transition betwen headers and symbols cut = i + 1 break elif line.lower().startswith('version:'): line = line[8:].strip() version = line continue elif line.lower().startswith('extends:'): line = line[8:].strip() extends = line continue elif line.lower().startswith('release:'): release = line[8:].strip() continue else: e('Could not understand line in %s header: %s', filename, line) raise SystemExit(1) else: e('No symbols in %s', filename) raise SystemExit(1) if version is None: e('No Versions: header in %s', filename) raise SystemExit(1) if extends is None: e('No Extends: header in %s', filename) raise SystemExit(1) if release is None and dpkg: e('No Release: header in %s', filename) raise SystemExit(1) if dpkg: dpkg_versions.append('%s@%s %s' % (version, version, release)) lines = lines[cut:] if gnuld: print("%s {" % version) print(" global:") for symbol in lines: symbol = symbol.strip() if symbol.startswith('#'): continue if gnuld: print(" %s;" % symbol) elif dpkg: dpkg_symbols.append('%s@%s %s' % (symbol, version, release)) if symbol in versioned_symbols: raise AssertionError('Symbol %s is in version %s and an ' 'earlier version' % (symbol, version)) versioned_symbols.add(symbol) if gnuld: if extends == '-': print(" local:") print(" *;") print("};") else: print("} %s;" % extends) print("") if dpkg: dpkg_symbols.sort() dpkg_versions.sort() for x in dpkg_versions: print(" %s" % x) for x in dpkg_symbols: print(" %s" % x) if symbol_set is not None: missing = versioned_symbols - symbol_set if missing: e('These symbols have disappeared:') for symbol in missing: e(' %s', symbol) raise SystemExit(1) unreleased = symbol_set - versioned_symbols if unreleased: if unreleased_version is None: e('Unversioned symbols are not allowed in releases:') for symbol in unreleased: e(' %s', symbol) raise SystemExit(1) if gnuld: print("%s {" % unreleased_version) print(" global:") for symbol in unreleased: print(" %s;" % symbol) print("} %s;" % version) if __name__ == '__main__': options, argv = gnu_getopt (sys.argv[1:], '', ['symbols=', 'unreleased-version=', 'dpkg=', 'dpkg-build-depends-package=']) opts = {'dpkg': False} for option, value in options: if option == '--dpkg': opts['dpkg'] = True opts['dpkg_first_line'] = value else: opts[option.lstrip('-').replace('-', '_')] = value main(argv, **opts) telepathy-glib-0.24.2/tools/git-which-branch.sh0000644000175000017500000000125312652510705016250 00000000000000#!/bin/sh # git-which-branch.sh - output the name of the current git branch # # The canonical location of this program is the telepathy-spec tools/ # directory, please synchronize any changes with that copy. # # Copyright (C) 2008 Collabora Ltd. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. default="$1" if { ref="`git symbolic-ref HEAD 2>/dev/null`"; }; then echo ${ref#refs/heads/} exit 0 fi if test -n "$default"; then echo "$default" >/dev/null exit 0 fi echo "no git branch found" >&2 exit 1 telepathy-glib-0.24.2/tools/Makefile.am0000644000175000017500000000430612652510705014634 00000000000000abs_top_builddir = @abs_top_builddir@ noinst_SCRIPTS = telepathy-glib-env telepathy-glib-env: telepathy-glib-env.in Makefile sed -e 's![@]abs_top_builddir[@]!$(abs_top_builddir)!' $< > $@ chmod +x $@ if ENABLE_INSTALLED_TESTS toolsdir = @tpglibtestsdir@/tools tools_SCRIPTS = \ test-wrapper.sh \ libglibcodegen.py \ libtpcodegen.py \ $(NULL) endif EXTRA_DIST = \ c-constants-gen.py \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ doc-generator.xsl \ flymake.mk \ git-which-branch.sh \ glib-client-gen.py \ glib-client-marshaller-gen.py \ glib-errors-check-gen.py \ glib-errors-str-gen.py \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-interfaces-gen.py \ gobject-foo.py \ lcov.am \ libtpcodegen.py \ libglibcodegen.py \ make-release-mail.py \ make-version-script.py \ manager-file.py \ shave.mk \ telepathy.am \ telepathy-glib.supp \ telepathy-glib-env.in \ test-wrapper.sh \ xincludator.py CLEANFILES = libtpcodegen.pyc libtpcodegen.pyo libglibcodegen.pyc libglibcodegen.pyo $(noinst_SCRIPTS) all: $(EXTRA_DIST) libglibcodegen.py: libtpcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ c-constants-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-client-marshaller-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-errors-enum-body-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-errors-enum-header-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-ginterface-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-gtypes-generator.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-interfaces-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ TELEPATHY_SPEC_SRCDIR = $(top_srcdir)/../telepathy-spec maintainer-update-from-telepathy-spec: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_SPEC_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_SPEC_SRCDIR)/tools/$$x $$x; \ fi; \ done telepathy-glib-0.24.2/tools/Makefile.in0000644000175000017500000004577014006601553014654 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tools ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(toolsdir)" SCRIPTS = $(noinst_SCRIPTS) $(tools_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ noinst_SCRIPTS = telepathy-glib-env @ENABLE_INSTALLED_TESTS_TRUE@toolsdir = @tpglibtestsdir@/tools @ENABLE_INSTALLED_TESTS_TRUE@tools_SCRIPTS = \ @ENABLE_INSTALLED_TESTS_TRUE@ test-wrapper.sh \ @ENABLE_INSTALLED_TESTS_TRUE@ libglibcodegen.py \ @ENABLE_INSTALLED_TESTS_TRUE@ libtpcodegen.py \ @ENABLE_INSTALLED_TESTS_TRUE@ $(NULL) EXTRA_DIST = \ c-constants-gen.py \ check-coding-style.mk \ check-c-style.sh \ check-misc.sh \ check-whitespace.sh \ doc-generator.xsl \ flymake.mk \ git-which-branch.sh \ glib-client-gen.py \ glib-client-marshaller-gen.py \ glib-errors-check-gen.py \ glib-errors-str-gen.py \ glib-ginterface-gen.py \ glib-gtypes-generator.py \ glib-interfaces-gen.py \ gobject-foo.py \ lcov.am \ libtpcodegen.py \ libglibcodegen.py \ make-release-mail.py \ make-version-script.py \ manager-file.py \ shave.mk \ telepathy.am \ telepathy-glib.supp \ telepathy-glib-env.in \ test-wrapper.sh \ xincludator.py CLEANFILES = libtpcodegen.pyc libtpcodegen.pyo libglibcodegen.pyc libglibcodegen.pyo $(noinst_SCRIPTS) TELEPATHY_SPEC_SRCDIR = $(top_srcdir)/../telepathy-spec all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tools/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tools/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-toolsSCRIPTS: $(tools_SCRIPTS) @$(NORMAL_INSTALL) @list='$(tools_SCRIPTS)'; test -n "$(toolsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(toolsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(toolsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(toolsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(toolsdir)$$dir" || exit $$?; \ } \ ; done uninstall-toolsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(tools_SCRIPTS)'; test -n "$(toolsdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(toolsdir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(toolsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-toolsSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-toolsSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip install-toolsSCRIPTS installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-toolsSCRIPTS .PRECIOUS: Makefile telepathy-glib-env: telepathy-glib-env.in Makefile sed -e 's![@]abs_top_builddir[@]!$(abs_top_builddir)!' $< > $@ chmod +x $@ all: $(EXTRA_DIST) libglibcodegen.py: libtpcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ c-constants-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-client-marshaller-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-errors-enum-body-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-errors-enum-header-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-ginterface-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-gtypes-generator.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ glib-interfaces-gen.py: libglibcodegen.py $(AM_V_GEN)test -e ${srcdir}/$@ && touch ${srcdir}/$@ maintainer-update-from-telepathy-spec: set -e && cd $(srcdir) && \ for x in $(EXTRA_DIST); do \ if test -f $(TELEPATHY_SPEC_SRCDIR)/tools/$$x; then \ cp $(TELEPATHY_SPEC_SRCDIR)/tools/$$x $$x; \ fi; \ done # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/tools/c-constants-gen.py0000644000175000017500000001320114004033172016136 00000000000000#!/usr/bin/python from sys import argv, stdout, stderr import xml.dom.minidom from libtpcodegen import file_set_contents, u from libglibcodegen import NS_TP, get_docstring, \ get_descendant_text, get_by_path class Generator(object): def __init__(self, prefix, dom, output_base): self.prefix = prefix + '_' self.spec = get_by_path(dom, "spec")[0] self.output_base = output_base self.__header = [] self.__docs = [] def __call__(self): self.do_header() self.do_body() self.do_footer() file_set_contents(self.output_base + '.h', u('').join(self.__header).encode('utf-8')) file_set_contents(self.output_base + '-gtk-doc.h', u('').join(self.__docs).encode('utf-8')) def write(self, code): self.__header.append(code) def d(self, code): self.__docs.append(code) # Header def do_header(self): self.write('/* Generated from ') self.write(get_descendant_text(get_by_path(self.spec, 'title'))) version = get_by_path(self.spec, "version") if version: self.write(', version ' + get_descendant_text(version)) self.write('\n\n') for copyright in get_by_path(self.spec, 'copyright'): self.write(get_descendant_text(copyright)) self.write('\n') self.write(get_descendant_text(get_by_path(self.spec, 'license'))) self.write('\n') self.write(get_descendant_text(get_by_path(self.spec, 'docstring'))) self.write(""" */ #ifdef __cplusplus extern "C" { #endif \n""") # Body def do_body(self): for elem in self.spec.getElementsByTagNameNS(NS_TP, '*'): if elem.localName == 'flags': self.do_flags(elem) elif elem.localName == 'enum': self.do_enum(elem) def do_flags(self, flags): name = flags.getAttribute('plural') or flags.getAttribute('name') value_prefix = flags.getAttribute('singular') or \ flags.getAttribute('value-prefix') or \ flags.getAttribute('name') self.d("""\ /** * %s: """ % (self.prefix + name).replace('_', '')) for flag in get_by_path(flags, 'flag'): self.do_gtkdoc(flag, value_prefix) self.d(' *\n') docstrings = get_by_path(flags, 'docstring') if docstrings: self.d("""\ * * """ % get_descendant_text(docstrings).replace('\n', ' ')) self.d("""\ * Bitfield/set of flags generated from the Telepathy specification. */ """) self.write("typedef enum /*< flags >*/ {\n") for flag in get_by_path(flags, 'flag'): self.do_val(flag, value_prefix) self.write("""\ } %s; """ % (self.prefix + name).replace('_', '')) def do_enum(self, enum): name = enum.getAttribute('singular') or enum.getAttribute('name') value_prefix = enum.getAttribute('singular') or \ enum.getAttribute('value-prefix') or \ enum.getAttribute('name') name_plural = enum.getAttribute('plural') or \ enum.getAttribute('name') + 's' self.d("""\ /** * %s: """ % (self.prefix + name).replace('_', '')) vals = get_by_path(enum, 'enumvalue') for val in vals: self.do_gtkdoc(val, value_prefix) self.d(' *\n') docstrings = get_by_path(enum, 'docstring') if docstrings: self.d("""\ * * """ % get_descendant_text(docstrings).replace('\n', ' ')) self.d("""\ * Bitfield/set of flags generated from the Telepathy specification. */ """) self.write("typedef enum {\n") for val in vals: self.do_val(val, value_prefix) self.write("} %s;\n" % (self.prefix + name).replace('_', '')) self.d("""\ /** * %(upper-prefix)sNUM_%(upper-plural)s: * * 1 higher than the highest valid value of #%(mixed-name)s. */ /** * NUM_%(upper-prefix)s%(upper-plural)s: (skip) * * 1 higher than the highest valid value of #%(mixed-name)s. * In new code, use %(upper-prefix)sNUM_%(upper-plural)s instead. */ """ % {'mixed-name' : (self.prefix + name).replace('_', ''), 'upper-prefix' : self.prefix.upper(), 'upper-plural' : name_plural.upper(), 'last-val' : vals[-1].getAttribute('value')}) self.write("""\ #define %(upper-prefix)sNUM_%(upper-plural)s (%(last-val)s+1) #define NUM_%(upper-prefix)s%(upper-plural)s %(upper-prefix)sNUM_%(upper-plural)s """ % {'mixed-name' : (self.prefix + name).replace('_', ''), 'upper-prefix' : self.prefix.upper(), 'upper-plural' : name_plural.upper(), 'last-val' : vals[-1].getAttribute('value')}) def do_val(self, val, value_prefix): name = val.getAttribute('name') suffix = val.getAttribute('suffix') use_name = (self.prefix + value_prefix + '_' + \ (suffix or name)).upper() assert not (name and suffix) or name == suffix, \ 'Flag/enumvalue name %s != suffix %s' % (name, suffix) self.write(' %s = %s,\n' % (use_name, val.getAttribute('value'))) def do_gtkdoc(self, node, value_prefix): self.d(' * @') self.d((self.prefix + value_prefix + '_' + node.getAttribute('suffix')).upper()) self.d(': \n') # Footer def do_footer(self): self.write(""" #ifdef __cplusplus } #endif """) if __name__ == '__main__': argv = argv[1:] Generator(argv[0], xml.dom.minidom.parse(argv[1]), argv[2])() telepathy-glib-0.24.2/tools/doc-generator.xsl0000644000175000017500000012056712652510705016071 00000000000000 . ERR: cannot find D-Bus interface, method, signal or property called ' ' ERR: Cannot use tp:member-ref when not in an <interface> ERR: interface has no signal/method/property called

Added in version .

Changed in version :

Changed in version

Deprecated since version .

Errors

Generic types

Simple types

Enumerated types:

Sets of flags:

Structure types

Mapping types

Types defined elsewhere

This interface is and is likely to cause havoc to your API/ABI if bindings are generated. Don't include it in libraries that care about compatibility.

Implementations of this interface must also implement:

Methods:

Interface has no methods.

Signals:

Interface has no signals.

Telepathy Properties:

Accessed using the Telepathy Properties interface.

Interface has no Telepathy properties.

D-Bus core Properties:

Accessed using the org.freedesktop.DBus.Properties interface.

Interface has no D-Bus core properties.

ERR: missing @name on a tp:flags type ERR: missing @type on tp:flags type

=
(Undocumented)
ERR: missing @name on a tp:enum type ERR: missing @type on tp:enum type

=
(Undocumented)
ERR: property does not have an interface as parent ERR: missing @name on a property of ERR: missing @type on property : ' '
, read-only write-only read/write ERR: unknown or missing value for @access on property : ' '

− a{ : }

In bindings that need a separate name, arrays of should be called .

Members

ERR: missing @name on a tp:simple-type ERR: missing @type on tp:simple-type

ERR: missing @name on a tp:external-type ERR: missing @type on tp:external-type
Defined by:
− ( , ) − a{ }

− ( : , )

In bindings that need a separate name, arrays of should be called .

Arrays of don't generally make sense.

Members

ERR: method does not have an interface as parent ERR: missing @name on a method of ERR: an arg of method has no type ERR: an 'in' arg of method has no name ERR: an arg of method has direction neither 'in' nor 'out'

( : , ) → , nothing

Parameters

Returns

Possible errors

( ) a{ } ERR: Unable to find type ' ' ERR: tp:type ' ' has D-Bus type ' ' but has been used with type=' ' ( )
(undocumented)
(generic description) (Undocumented.)
ERR: signal does not have an interface as parent ERR: missing @name on a signal of ERR: an arg of signal has no type ERR: an arg of signal has no name INFO: an arg of signal has unnecessary direction 'in' ERR: an arg of signal has direction other than 'in'

( : , )

Parameters

<xsl:value-of select="tp:title"/> <xsl:if test="tp:version"> <xsl:text> version </xsl:text> <xsl:value-of select="tp:version"/> </xsl:if>

Version

Interfaces

Index

Index of interfaces

Index of types

Stray text: {{{ }}} Unrecognised element: { }
telepathy-glib-0.24.2/tools/libglibcodegen.py0000644000175000017500000002054312652510705016104 00000000000000"""Library code for GLib/D-Bus-related code generation. The master copy of this library is in the telepathy-glib repository - please make any changes there. """ # Copyright (C) 2006-2008 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA from libtpcodegen import NS_TP, \ Signature, \ cmp_by_name, \ escape_as_identifier, \ get_by_path, \ get_descendant_text, \ get_docstring, \ xml_escape, \ get_deprecated def dbus_gutils_wincaps_to_uscore(s): """Bug-for-bug compatible Python port of _dbus_gutils_wincaps_to_uscore which gets sequences of capital letters wrong in the same way. (e.g. in Telepathy, SendDTMF -> send_dt_mf) """ ret = '' for c in s: if c >= 'A' and c <= 'Z': length = len(ret) if length > 0 and (length < 2 or ret[length-2] != '_'): ret += '_' ret += c.lower() else: ret += c return ret def signal_to_marshal_type(signal): """ return a list of strings indicating the marshalling type for this signal. """ mtype=[] for i in signal.getElementsByTagName("arg"): name =i.getAttribute("name") type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) return mtype _glib_marshallers = ['VOID', 'BOOLEAN', 'CHAR', 'UCHAR', 'INT', 'STRING', 'UINT', 'LONG', 'ULONG', 'ENUM', 'FLAGS', 'FLOAT', 'DOUBLE', 'STRING', 'PARAM', 'BOXED', 'POINTER', 'OBJECT', 'UINT_POINTER'] def signal_to_marshal_name(signal, prefix): mtype = signal_to_marshal_type(signal) if len(mtype): name = '_'.join(mtype) else: name = 'VOID' if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name def method_to_glue_marshal_name(method, prefix): mtype = [] for i in method.getElementsByTagName("arg"): if i.getAttribute("direction") != "out": type = i.getAttribute("type") mtype.append(type_to_gtype(type)[2]) mtype.append('POINTER') name = '_'.join(mtype) if name in _glib_marshallers: return 'g_cclosure_marshal_VOID__' + name else: return prefix + '_marshal_VOID__' + name def type_to_gtype(s): if s == 'y': #byte return ("guchar ", "G_TYPE_UCHAR","UCHAR", False) elif s == 'b': #boolean return ("gboolean ", "G_TYPE_BOOLEAN","BOOLEAN", False) elif s == 'n': #int16 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'q': #uint16 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'i': #int32 return ("gint ", "G_TYPE_INT","INT", False) elif s == 'u': #uint32 return ("guint ", "G_TYPE_UINT","UINT", False) elif s == 'x': #int64 return ("gint64 ", "G_TYPE_INT64","INT64", False) elif s == 't': #uint64 return ("guint64 ", "G_TYPE_UINT64","UINT64", False) elif s == 'd': #double return ("gdouble ", "G_TYPE_DOUBLE","DOUBLE", False) elif s == 's': #string return ("gchar *", "G_TYPE_STRING", "STRING", True) elif s == 'g': #signature - FIXME return ("gchar *", "DBUS_TYPE_G_SIGNATURE", "STRING", True) elif s == 'o': #object path return ("gchar *", "DBUS_TYPE_G_OBJECT_PATH", "BOXED", True) elif s == 'v': #variant return ("GValue *", "G_TYPE_VALUE", "BOXED", True) elif s == 'as': #array of strings return ("gchar **", "G_TYPE_STRV", "BOXED", True) elif s == 'ay': #byte array return ("GArray *", "dbus_g_type_get_collection (\"GArray\", G_TYPE_UCHAR)", "BOXED", True) elif s == 'au': #uint array return ("GArray *", "DBUS_TYPE_G_UINT_ARRAY", "BOXED", True) elif s == 'ai': #int array return ("GArray *", "DBUS_TYPE_G_INT_ARRAY", "BOXED", True) elif s == 'ax': #int64 array return ("GArray *", "DBUS_TYPE_G_INT64_ARRAY", "BOXED", True) elif s == 'at': #uint64 array return ("GArray *", "DBUS_TYPE_G_UINT64_ARRAY", "BOXED", True) elif s == 'ad': #double array return ("GArray *", "DBUS_TYPE_G_DOUBLE_ARRAY", "BOXED", True) elif s == 'ab': #boolean array return ("GArray *", "DBUS_TYPE_G_BOOLEAN_ARRAY", "BOXED", True) elif s == 'ao': #object path array return ("GPtrArray *", 'dbus_g_type_get_collection ("GPtrArray",' ' DBUS_TYPE_G_OBJECT_PATH)', "BOXED", True) elif s == 'a{ss}': #hash table of string to string return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) elif s[:2] == 'a{': #some arbitrary hash tables if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): raise Exception("can't index a hashtable off non-basic type " + s) first = type_to_gtype(s[2]) second = type_to_gtype(s[3:-1]) return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) elif s[:2] in ('a(', 'aa'): # array of structs or arrays, recurse gtype = type_to_gtype(s[1:])[1] return ("GPtrArray *", "(dbus_g_type_get_collection (\"GPtrArray\", "+gtype+"))", "BOXED", True) elif s[:1] == '(': #struct gtype = "(dbus_g_type_get_struct (\"GValueArray\", " for subsig in Signature(s[1:-1]): gtype = gtype + type_to_gtype(subsig)[1] + ", " gtype = gtype + "G_TYPE_INVALID))" return ("GValueArray *", gtype, "BOXED", True) # we just don't know .. raise Exception("don't know the GType for " + s) def move_into_gvalue(gvaluep, gtype, marshaller, name): if gtype == 'G_TYPE_STRING': return 'g_value_take_string (%s, %s);' % (gvaluep, name) elif marshaller == 'BOXED': return 'g_value_take_boxed (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UCHAR': return 'g_value_set_uchar (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_BOOLEAN': return 'g_value_set_boolean (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_INT': return 'g_value_set_int (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UINT': return 'g_value_set_uint (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_INT64': return 'g_value_set_int (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UINT64': return 'g_value_set_uint64 (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_DOUBLE': return 'g_value_set_double (%s, %s);' % (gvaluep, name) else: raise AssertionError("Don't know how to put %s in a GValue" % gtype) def copy_into_gvalue(gvaluep, gtype, marshaller, name): if gtype == 'G_TYPE_STRING': return 'g_value_set_string (%s, %s);' % (gvaluep, name) elif marshaller == 'BOXED': return 'g_value_set_boxed (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UCHAR': return 'g_value_set_uchar (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_BOOLEAN': return 'g_value_set_boolean (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_INT': return 'g_value_set_int (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UINT': return 'g_value_set_uint (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_INT64': return 'g_value_set_int (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_UINT64': return 'g_value_set_uint64 (%s, %s);' % (gvaluep, name) elif gtype == 'G_TYPE_DOUBLE': return 'g_value_set_double (%s, %s);' % (gvaluep, name) else: raise AssertionError("Don't know how to put %s in a GValue" % gtype) telepathy-glib-0.24.2/tools/telepathy.am0000644000175000017500000000474212652510705015122 00000000000000## Useful top-level Makefile.am snippets for Telepathy projects. dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ ( cd ${top_srcdir} && git log --date=iso $(CHANGELOG_RANGE) ) > ${distdir}/ChangeLog; \ fi distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ case @VERSION@ in \ *.*.*.*|*+) ;; \ *) \ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \ then \ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \ exit 2; \ fi \ ;; \ esac _is-release-check: @case @VERSION@ in \ (*.*.*.*|*+) \ echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac @cd ${top_srcdir} && \ if ! git diff --no-ext-diff --quiet --exit-code; then \ echo "Hey! Your tree is dirty! No release for you." >&2; \ exit 2; \ fi @cd ${top_srcdir} && \ if ! git diff --cached --no-ext-diff --quiet --exit-code; then \ echo "Hey! You have changes staged! No release for you." >&2; \ exit 2; \ fi if ENABLE_GTK_DOC else @echo "Hey! You need to pass --enable-gtk-doc to configure!" @exit 2; endif %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ @PACKAGE@-@VERSION@.tar.gz: $(MAKE) _is-release-check $(MAKE) check $(MAKE) distcheck maintainer-prepare-release: $(MAKE) _is-release-check $(MAKE) all $(MAKE) distcheck $(MAKE) release-mail cd $(srcdir) && git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz release-mail: NEWS $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ mv $@.tmp $@) maintainer-upload-release: _maintainer-upload-release _maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc maintainer-make-release: $(MAKE) maintainer-prepare-release $(MAKE) maintainer-upload-release @echo "Now:" @echo " • bump the nano-version;" @echo " • push the branch and tags upstream; and" @echo " • send release-mail to ." ## vim:set ft=automake: telepathy-glib-0.24.2/tools/glib-interfaces-gen.py0000644000175000017500000001456714004033172016760 00000000000000#!/usr/bin/python from sys import argv, stdout, stderr import xml.dom.minidom from libtpcodegen import file_set_contents, u from libglibcodegen import NS_TP, get_docstring, \ get_descendant_text, get_by_path class Generator(object): def __init__(self, prefix, implfile, declfile, dom): self.prefix = prefix + '_' assert declfile.endswith('.h') docfile = declfile[:-2] + '-gtk-doc.h' self.implfile = implfile self.declfile = declfile self.docfile = docfile self.impls = [] self.decls = [] self.docs = [] self.spec = get_by_path(dom, "spec")[0] def h(self, code): self.decls.append(code) def c(self, code): self.impls.append(code) def d(self, code): self.docs.append(code) def __call__(self): for f in self.h, self.c: self.do_header(f) self.do_body() file_set_contents(self.implfile, u('').join(self.impls).encode('utf-8')) file_set_contents(self.declfile, u('').join(self.decls).encode('utf-8')) file_set_contents(self.docfile, u('').join(self.docs).encode('utf-8')) # Header def do_header(self, f): f('/* Generated from: ') f(get_descendant_text(get_by_path(self.spec, 'title'))) version = get_by_path(self.spec, "version") if version: f(' version ' + get_descendant_text(version)) f('\n\n') for copyright in get_by_path(self.spec, 'copyright'): f(get_descendant_text(copyright)) f('\n') f('\n') f(get_descendant_text(get_by_path(self.spec, 'license'))) f(get_descendant_text(get_by_path(self.spec, 'docstring'))) f(""" */ #include """) # Body def do_body(self): for iface in self.spec.getElementsByTagName('interface'): self.do_iface(iface) def do_iface(self, iface): parent_name = get_by_path(iface, '../@name') self.d("""\ /** * %(IFACE_DEFINE)s: * * The interface name "%(name)s" */ """ % {'IFACE_DEFINE' : (self.prefix + 'IFACE_' + \ parent_name).upper().replace('/', ''), 'name' : iface.getAttribute('name')}) self.h(""" #define %(IFACE_DEFINE)s \\ "%(name)s" """ % {'IFACE_DEFINE' : (self.prefix + 'IFACE_' + \ parent_name).upper().replace('/', ''), 'name' : iface.getAttribute('name')}) self.d(""" /** * %(IFACE_QUARK_DEFINE)s: * * Expands to a call to a function that returns a quark for the interface \ name "%(name)s" */ """ % {'IFACE_QUARK_DEFINE' : (self.prefix + 'IFACE_QUARK_' + \ parent_name).upper().replace('/', ''), 'iface_quark_func' : (self.prefix + 'iface_quark_' + \ parent_name).lower().replace('/', ''), 'name' : iface.getAttribute('name')}) self.h(""" #define %(IFACE_QUARK_DEFINE)s \\ (%(iface_quark_func)s ()) GQuark %(iface_quark_func)s (void); """ % {'IFACE_QUARK_DEFINE' : (self.prefix + 'IFACE_QUARK_' + \ parent_name).upper().replace('/', ''), 'iface_quark_func' : (self.prefix + 'iface_quark_' + \ parent_name).lower().replace('/', ''), 'name' : iface.getAttribute('name')}) self.c("""\ GQuark %(iface_quark_func)s (void) { static GQuark quark = 0; if (G_UNLIKELY (quark == 0)) { quark = g_quark_from_static_string ("%(name)s"); } return quark; } """ % {'iface_quark_func' : (self.prefix + 'iface_quark_' + \ parent_name).lower().replace('/', ''), 'name' : iface.getAttribute('name')}) for prop in iface.getElementsByTagNameNS(None, 'property'): self.d(""" /** * %(IFACE_PREFIX)s_%(PROP_UC)s: * * The fully-qualified property name "%(name)s.%(prop)s" */ """ % {'IFACE_PREFIX' : (self.prefix + 'PROP_' + \ parent_name).upper().replace('/', ''), 'PROP_UC': prop.getAttributeNS(NS_TP, "name-for-bindings").upper(), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) self.h(""" #define %(IFACE_PREFIX)s_%(PROP_UC)s \\ "%(name)s.%(prop)s" """ % {'IFACE_PREFIX' : (self.prefix + 'PROP_' + \ parent_name).upper().replace('/', ''), 'PROP_UC': prop.getAttributeNS(NS_TP, "name-for-bindings").upper(), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) for prop in iface.getElementsByTagNameNS(NS_TP, 'contact-attribute'): self.d(""" /** * %(TOKEN_PREFIX)s_%(TOKEN_UC)s: * * The fully-qualified contact attribute token name "%(name)s/%(prop)s" */ """ % {'TOKEN_PREFIX' : (self.prefix + 'TOKEN_' + \ parent_name).upper().replace('/', ''), 'TOKEN_UC': prop.getAttributeNS(None, "name").upper().replace("-", "_").replace(".", "_"), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) self.h(""" #define %(TOKEN_PREFIX)s_%(TOKEN_UC)s \\ "%(name)s/%(prop)s" """ % {'TOKEN_PREFIX' : (self.prefix + 'TOKEN_' + \ parent_name).upper().replace('/', ''), 'TOKEN_UC': prop.getAttributeNS(None, "name").upper().replace("-", "_").replace(".", "_"), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) for prop in iface.getElementsByTagNameNS(NS_TP, 'hct'): if (prop.getAttribute('is-family') != "yes"): self.d(""" /** * %(TOKEN_PREFIX)s_%(TOKEN_UC)s: * * The fully-qualified capability token name "%(name)s/%(prop)s" */ """ % {'TOKEN_PREFIX' : (self.prefix + 'TOKEN_' + \ parent_name).upper().replace('/', ''), 'TOKEN_UC': prop.getAttributeNS(None, "name").upper().replace("-", "_").replace(".", "_"), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) self.h(""" #define %(TOKEN_PREFIX)s_%(TOKEN_UC)s \\ "%(name)s/%(prop)s" """ % {'TOKEN_PREFIX' : (self.prefix + 'TOKEN_' + \ parent_name).upper().replace('/', ''), 'TOKEN_UC': prop.getAttributeNS(None, "name").upper().replace("-", "_").replace(".", "_"), 'name' : iface.getAttribute('name'), 'prop' : prop.getAttribute('name'), }) if __name__ == '__main__': argv = argv[1:] Generator(argv[0], argv[1], argv[2], xml.dom.minidom.parse(argv[3]))() telepathy-glib-0.24.2/tools/test-wrapper.sh0000755000175000017500000000144712652510705015577 00000000000000#!/bin/sh # Make tests shut up. On success, if stdout is a tty, we only output messages # about skipped tests; on failure, or if stdout is a file or pipe, we output # the lot. # # Usage: test-wrapper.sh PROGRAM [ARGS...] set -e if test -t 1 && test "z$CHECK_VERBOSE" = z; then : # continue with the output-suppressed code path, below else "$@" || e=$? exit $e fi e=0 "$@" > capture-$$.log 2>&1 || e=$? if test z$e = z0; then grep -i skipped capture-$$.log || true rm -f capture-$$.log else cat capture-$$.log exit $e fi # Copyright © 2010 Collabora Ltd. # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. There is no warranty. telepathy-glib-0.24.2/tools/glib-ginterface-gen.py0000644000175000017500000007367214004033172016746 00000000000000#!/usr/bin/python # glib-ginterface-gen.py: service-side interface generator # # Generate dbus-glib 0.x service GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os.path import xml.dom.minidom from libtpcodegen import file_set_contents, key_by_name, u from libglibcodegen import Signature, type_to_gtype, \ NS_TP, dbus_gutils_wincaps_to_uscore NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" def get_emits_changed(node): try: return [ annotation.getAttribute('value') for annotation in node.getElementsByTagName('annotation') if annotation.getAttribute('name') == 'org.freedesktop.DBus.Property.EmitsChangedSignal' ][0] except IndexError: return None class Generator(object): def __init__(self, dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc): self.dom = dom self.__header = [] self.__body = [] self.__docs = [] assert prefix.endswith('_') assert not signal_marshal_prefix.endswith('_') # The main_prefix, sub_prefix thing is to get: # FOO_ -> (FOO_, _) # FOO_SVC_ -> (FOO_, _SVC_) # but # FOO_BAR/ -> (FOO_BAR_, _) # FOO_BAR/SVC_ -> (FOO_BAR_, _SVC_) if '/' in prefix: main_prefix, sub_prefix = prefix.upper().split('/', 1) prefix = prefix.replace('/', '_') else: main_prefix, sub_prefix = prefix.upper().split('_', 1) self.MAIN_PREFIX_ = main_prefix + '_' self._SUB_PREFIX_ = '_' + sub_prefix self.Prefix_ = prefix self.Prefix = prefix.replace('_', '') self.prefix_ = prefix.lower() self.PREFIX_ = prefix.upper() self.basename = basename self.signal_marshal_prefix = signal_marshal_prefix self.headers = headers self.end_headers = end_headers self.not_implemented_func = not_implemented_func self.allow_havoc = allow_havoc def h(self, s): self.__header.append(s) def b(self, s): self.__body.append(s) def d(self, s): self.__docs.append(s) def do_node(self, node): node_name = node.getAttribute('name').replace('/', '') node_name_mixed = self.node_name_mixed = node_name.replace('_', '') node_name_lc = self.node_name_lc = node_name.lower() node_name_uc = self.node_name_uc = node_name.upper() interfaces = node.getElementsByTagName('interface') assert len(interfaces) == 1, interfaces interface = interfaces[0] self.iface_name = interface.getAttribute('name') tmp = interface.getAttribute('tp:implement-service') if tmp == "no": return tmp = interface.getAttribute('tp:causes-havoc') if tmp and not self.allow_havoc: raise AssertionError('%s is %s' % (self.iface_name, tmp)) iface_emits_changed = get_emits_changed(interface) self.b('static const DBusGObjectInfo _%s%s_object_info;' % (self.prefix_, node_name_lc)) self.b('') methods = interface.getElementsByTagName('method') signals = interface.getElementsByTagName('signal') properties = interface.getElementsByTagName('property') # Don't put properties in dbus-glib glue glue_properties = [] self.b('struct _%s%sClass {' % (self.Prefix, node_name_mixed)) self.b(' GTypeInterface parent_class;') for method in methods: self.b(' %s %s;' % self.get_method_impl_names(method)) self.b('};') self.b('') if signals: self.b('enum {') for signal in signals: self.b(' %s,' % self.get_signal_const_entry(signal)) self.b(' N_%s_SIGNALS' % node_name_uc) self.b('};') self.b('static guint %s_signals[N_%s_SIGNALS] = {0};' % (node_name_lc, node_name_uc)) self.b('') self.b('static void %s%s_base_init (gpointer klass);' % (self.prefix_, node_name_lc)) self.b('') self.b('GType') self.b('%s%s_get_type (void)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static GType type = 0;') self.b('') self.b(' if (G_UNLIKELY (type == 0))') self.b(' {') self.b(' static const GTypeInfo info = {') self.b(' sizeof (%s%sClass),' % (self.Prefix, node_name_mixed)) self.b(' %s%s_base_init, /* base_init */' % (self.prefix_, node_name_lc)) self.b(' NULL, /* base_finalize */') self.b(' NULL, /* class_init */') self.b(' NULL, /* class_finalize */') self.b(' NULL, /* class_data */') self.b(' 0,') self.b(' 0, /* n_preallocs */') self.b(' NULL /* instance_init */') self.b(' };') self.b('') self.b(' type = g_type_register_static (G_TYPE_INTERFACE,') self.b(' "%s%s", &info, 0);' % (self.Prefix, node_name_mixed)) self.b(' }') self.b('') self.b(' return type;') self.b('}') self.b('') self.d('/**') self.d(' * %s%s:' % (self.Prefix, node_name_mixed)) self.d(' *') self.d(' * Dummy typedef representing any implementation of this ' 'interface.') self.d(' */') self.h('typedef struct _%s%s %s%s;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.d('/**') self.d(' * %s%sClass:' % (self.Prefix, node_name_mixed)) self.d(' *') self.d(' * The class of %s%s.' % (self.Prefix, node_name_mixed)) if methods: self.d(' *') self.d(' * In a full implementation of this interface (i.e. all') self.d(' * methods implemented), the interface initialization') self.d(' * function used in G_IMPLEMENT_INTERFACE() would') self.d(' * typically look like this:') self.d(' *') self.d(' * ') self.d(' * static void') self.d(' * implement_%s (gpointer klass,' % self.node_name_lc) self.d(' * gpointer unused G_GNUC_UNUSED)') self.d(' * {') self.d(' * #define IMPLEMENT(x) %s%s_implement_##x (\\' % (self.prefix_, self.node_name_lc)) self.d(' * klass, my_object_##x)') for method in methods: class_member_name = method.getAttribute('tp:name-for-bindings') class_member_name = class_member_name.lower() self.d(' * IMPLEMENT (%s);' % class_member_name) self.d(' * #undef IMPLEMENT') self.d(' * }') self.d(' * ') else: self.d(' * This interface has no D-Bus methods, so an') self.d(' * implementation can typically pass %NULL to') self.d(' * G_IMPLEMENT_INTERFACE() as the interface') self.d(' * initialization function.') self.d(' */') self.d('') self.h('typedef struct _%s%sClass %s%sClass;' % (self.Prefix, node_name_mixed, self.Prefix, node_name_mixed)) self.h('') self.h('GType %s%s_get_type (void);' % (self.prefix_, node_name_lc)) gtype = self.current_gtype = \ self.MAIN_PREFIX_ + 'TYPE' + self._SUB_PREFIX_ + node_name_uc classname = self.Prefix + node_name_mixed self.h('#define %s \\\n (%s%s_get_type ())' % (gtype, self.prefix_, node_name_lc)) self.h('#define %s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_CAST((obj), %s, %s))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('#define %sIS%s%s(obj) \\\n' ' (G_TYPE_CHECK_INSTANCE_TYPE((obj), %s))' % (self.MAIN_PREFIX_, self._SUB_PREFIX_, node_name_uc, gtype)) self.h('#define %s%s_GET_CLASS(obj) \\\n' ' (G_TYPE_INSTANCE_GET_INTERFACE((obj), %s, %sClass))' % (self.PREFIX_, node_name_uc, gtype, classname)) self.h('') self.h('') base_init_code = [] for method in methods: self.do_method(method) for signal in signals: base_init_code.extend(self.do_signal(signal)) self.b('static inline void') self.b('%s%s_base_init_once (gpointer klass G_GNUC_UNUSED)' % (self.prefix_, node_name_lc)) self.b('{') if properties: self.b(' static TpDBusPropertiesMixinPropInfo properties[%d] = {' % (len(properties) + 1)) for m in properties: access = m.getAttribute('access') assert access in ('read', 'write', 'readwrite') if access == 'read': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_READ' elif access == 'write': flags = 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE' else: flags = ('TP_DBUS_PROPERTIES_MIXIN_FLAG_READ | ' 'TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE') prop_emits_changed = get_emits_changed(m) if prop_emits_changed is None: prop_emits_changed = iface_emits_changed if prop_emits_changed == 'true': flags += ' | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED' elif prop_emits_changed == 'invalidates': flags += ' | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED' self.b(' { 0, %s, "%s", 0, NULL, NULL }, /* %s */' % (flags, m.getAttribute('type'), m.getAttribute('name'))) self.b(' { 0, 0, NULL, 0, NULL, NULL }') self.b(' };') self.b(' static TpDBusPropertiesMixinIfaceInfo interface =') self.b(' { 0, properties, NULL, NULL };') self.b('') self.b(' dbus_g_object_type_install_info (%s%s_get_type (),' % (self.prefix_, node_name_lc)) self.b(' &_%s%s_object_info);' % (self.prefix_, node_name_lc)) self.b('') if properties: self.b(' interface.dbus_interface = g_quark_from_static_string ' '("%s");' % self.iface_name) for i, m in enumerate(properties): self.b(' properties[%d].name = g_quark_from_static_string ("%s");' % (i, m.getAttribute('name'))) self.b(' properties[%d].type = %s;' % (i, type_to_gtype(m.getAttribute('type'))[1])) self.b(' tp_svc_interface_set_dbus_properties_info (%s, &interface);' % self.current_gtype) self.b('') for s in base_init_code: self.b(s) self.b('}') self.b('static void') self.b('%s%s_base_init (gpointer klass)' % (self.prefix_, node_name_lc)) self.b('{') self.b(' static gboolean initialized = FALSE;') self.b('') self.b(' if (!initialized)') self.b(' {') self.b(' initialized = TRUE;') self.b(' %s%s_base_init_once (klass);' % (self.prefix_, node_name_lc)) self.b(' }') # insert anything we need to do per implementation here self.b('}') self.h('') self.b('static const DBusGMethodInfo _%s%s_methods[] = {' % (self.prefix_, node_name_lc)) method_blob, offsets = self.get_method_glue(methods) for method, offset in zip(methods, offsets): self.do_method_glue(method, offset) if len(methods) == 0: # empty arrays are a gcc extension, so put in a dummy member self.b(" { NULL, NULL, 0 }") self.b('};') self.b('') self.b('static const DBusGObjectInfo _%s%s_object_info = {' % (self.prefix_, node_name_lc)) self.b(' 0,') # version self.b(' _%s%s_methods,' % (self.prefix_, node_name_lc)) self.b(' %d,' % len(methods)) self.b('"' + method_blob.replace('\0', '\\0') + '",') self.b('"' + self.get_signal_glue(signals).replace('\0', '\\0') + '",') self.b('"' + self.get_property_glue(glue_properties).replace('\0', '\\0') + '",') self.b('};') self.b('') self.node_name_mixed = None self.node_name_lc = None self.node_name_uc = None def get_method_glue(self, methods): info = [] offsets = [] for method in methods: offsets.append(len(''.join(info))) info.append(self.iface_name + '\0') info.append(method.getAttribute('name') + '\0') info.append('A\0') # async counter = 0 for arg in method.getElementsByTagName('arg'): out = arg.getAttribute('direction') == 'out' name = arg.getAttribute('name') if not name: assert out name = 'arg%u' % counter counter += 1 info.append(name + '\0') if out: info.append('O\0') else: info.append('I\0') if out: info.append('F\0') # not const info.append('N\0') # not error or return info.append(arg.getAttribute('type') + '\0') info.append('\0') return ''.join(info) + '\0', offsets def do_method_glue(self, method, offset): lc_name = method.getAttribute('tp:name-for-bindings') if method.getAttribute('name') != lc_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (method.getAttribute('name'), lc_name)) lc_name = lc_name.lower() marshaller = 'g_cclosure_marshal_generic' wrapper = self.prefix_ + self.node_name_lc + '_' + lc_name self.b(" { (GCallback) %s, %s, %d }," % (wrapper, marshaller, offset)) def get_signal_glue(self, signals): info = [] for signal in signals: info.append(self.iface_name) info.append(signal.getAttribute('name')) return '\0'.join(info) + '\0\0' # the implementation can be the same get_property_glue = get_signal_glue def get_method_impl_names(self, method): dbus_method_name = method.getAttribute('name') class_member_name = method.getAttribute('tp:name-for-bindings') if dbus_method_name != class_member_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_method_name, class_member_name)) class_member_name = class_member_name.lower() stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) return (stub_name + '_impl', class_member_name + '_cb') def do_method(self, method): assert self.node_name_mixed is not None in_class = [] # Examples refer to Thing.DoStuff (su) -> ii # DoStuff dbus_method_name = method.getAttribute('name') # do_stuff class_member_name = method.getAttribute('tp:name-for-bindings') if dbus_method_name != class_member_name.replace('_', ''): raise AssertionError('Method %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_method_name, class_member_name)) class_member_name = class_member_name.lower() # void tp_svc_thing_do_stuff (TpSvcThing *, const char *, guint, # DBusGMethodInvocation *); stub_name = (self.prefix_ + self.node_name_lc + '_' + class_member_name) # typedef void (*tp_svc_thing_do_stuff_impl) (TpSvcThing *, # const char *, guint, DBusGMethodInvocation); impl_name = stub_name + '_impl' # void tp_svc_thing_return_from_do_stuff (DBusGMethodInvocation *, # gint, gint); ret_name = (self.prefix_ + self.node_name_lc + '_return_from_' + class_member_name) # Gather arguments in_args = [] out_args = [] for i in method.getElementsByTagName('arg'): name = i.getAttribute('name') direction = i.getAttribute('direction') or 'in' dtype = i.getAttribute('type') assert direction in ('in', 'out') if name: name = direction + '_' + name elif direction == 'in': name = direction + str(len(in_args)) else: name = direction + str(len(out_args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name) if direction == 'in': in_args.append(struct) else: out_args.append(struct) # Implementation type declaration (in header, docs separated) self.d('/**') self.d(' * %s:' % impl_name) self.d(' * @self: The object implementing this interface') for (ctype, name) in in_args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' * @context: Used to return values or throw an error') self.d(' *') self.d(' * The signature of an implementation of the D-Bus method') self.d(' * %s on interface %s.' % (dbus_method_name, self.iface_name)) self.d(' */') self.h('typedef void (*%s) (%s%s *self,' % (impl_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.h(' %s%s,' % (ctype, name)) self.h(' DBusGMethodInvocation *context);') # Class member (in class definition) in_class.append(' %s %s;' % (impl_name, class_member_name)) # Stub definition (in body only - it's static) self.b('static void') self.b('%s (%s%s *self,' % (stub_name, self.Prefix, self.node_name_mixed)) for (ctype, name) in in_args: self.b(' %s%s,' % (ctype, name)) self.b(' DBusGMethodInvocation *context)') self.b('{') self.b(' %s impl = (%s%s_GET_CLASS (self)->%s_cb);' % (impl_name, self.PREFIX_, self.node_name_uc, class_member_name)) self.b('') self.b(' if (impl != NULL)') tmp = ['self'] + [name for (ctype, name) in in_args] + ['context'] self.b(' {') self.b(' (impl) (%s);' % ',\n '.join(tmp)) self.b(' }') self.b(' else') self.b(' {') if self.not_implemented_func: self.b(' %s (context);' % self.not_implemented_func) else: self.b(' GError e = { DBUS_GERROR, ') self.b(' DBUS_GERROR_UNKNOWN_METHOD,') self.b(' "Method not implemented" };') self.b('') self.b(' dbus_g_method_return_error (context, &e);') self.b(' }') self.b('}') self.b('') # Implementation registration (in both header and body) self.h('void %s%s_implement_%s (%s%sClass *klass, %s impl);' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.d('/**') self.d(' * %s%s_implement_%s:' % (self.prefix_, self.node_name_lc, class_member_name)) self.d(' * @klass: A class whose instances implement this interface') self.d(' * @impl: A callback used to implement the %s D-Bus method' % dbus_method_name) self.d(' *') self.d(' * Register an implementation for the %s method in the vtable' % dbus_method_name) self.d(' * of an implementation of this interface. To be called from') self.d(' * the interface init function.') self.d(' */') self.b('void') self.b('%s%s_implement_%s (%s%sClass *klass, %s impl)' % (self.prefix_, self.node_name_lc, class_member_name, self.Prefix, self.node_name_mixed, impl_name)) self.b('{') self.b(' klass->%s_cb = impl;' % class_member_name) self.b('}') self.b('') # Return convenience function (static inline, in header) self.d('/**') self.d(' * %s:' % ret_name) self.d(' * @context: The D-Bus method invocation context') for (ctype, name) in out_args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * Return successfully by calling dbus_g_method_return().') self.d(' * This inline function exists only to provide type-safety.') self.d(' */') self.d('') tmp = (['DBusGMethodInvocation *context'] + [ctype + name for (ctype, name) in out_args]) self.h('static inline') self.h('/* this comment is to stop gtkdoc realising this is static */') self.h(('void %s (' % ret_name) + (',\n '.join(tmp)) + ');') self.h('static inline void') self.h(('%s (' % ret_name) + (',\n '.join(tmp)) + ')') self.h('{') tmp = ['context'] + [name for (ctype, name) in out_args] self.h(' dbus_g_method_return (' + ',\n '.join(tmp) + ');') self.h('}') self.h('') return in_class def get_signal_const_entry(self, signal): assert self.node_name_uc is not None return ('SIGNAL_%s_%s' % (self.node_name_uc, signal.getAttribute('name'))) def do_signal(self, signal): assert self.node_name_mixed is not None in_base_init = [] # for signal: Thing::StuffHappened (s, u) # we want to emit: # void tp_svc_thing_emit_stuff_happened (gpointer instance, # const char *arg0, guint arg1); dbus_name = signal.getAttribute('name') ugly_name = signal.getAttribute('tp:name-for-bindings') if dbus_name != ugly_name.replace('_', ''): raise AssertionError('Signal %s tp:name-for-bindings (%s) does ' 'not match' % (dbus_name, ugly_name)) stub_name = (self.prefix_ + self.node_name_lc + '_emit_' + ugly_name.lower()) const_name = self.get_signal_const_entry(signal) # Gather arguments args = [] for i in signal.getElementsByTagName('arg'): name = i.getAttribute('name') dtype = i.getAttribute('type') tp_type = i.getAttribute('tp:type') if name: name = 'arg_' + name else: name = 'arg' + str(len(args)) ctype, gtype, marshaller, pointer = type_to_gtype(dtype) if pointer: ctype = 'const ' + ctype struct = (ctype, name, gtype) args.append(struct) tmp = (['gpointer instance'] + [ctype + name for (ctype, name, gtype) in args]) self.h(('void %s (' % stub_name) + (',\n '.join(tmp)) + ');') # FIXME: emit docs self.d('/**') self.d(' * %s:' % stub_name) self.d(' * @instance: The object implementing this interface') for (ctype, name, gtype) in args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * Type-safe wrapper around g_signal_emit to emit the') self.d(' * %s signal on interface %s.' % (dbus_name, self.iface_name)) self.d(' */') self.b('void') self.b(('%s (' % stub_name) + (',\n '.join(tmp)) + ')') self.b('{') self.b(' g_assert (instance != NULL);') self.b(' g_assert (G_TYPE_CHECK_INSTANCE_TYPE (instance, %s));' % (self.current_gtype)) tmp = (['instance', '%s_signals[%s]' % (self.node_name_lc, const_name), '0'] + [name for (ctype, name, gtype) in args]) self.b(' g_signal_emit (' + ',\n '.join(tmp) + ');') self.b('}') self.b('') signal_name = dbus_gutils_wincaps_to_uscore(dbus_name).replace('_', '-') self.d('/**') self.d(' * %s%s::%s:' % (self.Prefix, self.node_name_mixed, signal_name)) self.d(' * @self: an object') for (ctype, name, gtype) in args: self.d(' * @%s: %s (FIXME, generate documentation)' % (name, ctype)) self.d(' *') self.d(' * The %s D-Bus signal is emitted whenever ' 'this GObject signal is.' % dbus_name) self.d(' */') self.d('') in_base_init.append(' %s_signals[%s] =' % (self.node_name_lc, const_name)) in_base_init.append(' g_signal_new ("%s",' % signal_name) in_base_init.append(' G_OBJECT_CLASS_TYPE (klass),') in_base_init.append(' G_SIGNAL_RUN_LAST|G_SIGNAL_DETAILED,') in_base_init.append(' 0,') in_base_init.append(' NULL, NULL,') in_base_init.append(' g_cclosure_marshal_generic,') in_base_init.append(' G_TYPE_NONE,') tmp = ['%d' % len(args)] + [gtype for (ctype, name, gtype) in args] in_base_init.append(' %s);' % ',\n '.join(tmp)) in_base_init.append('') return in_base_init def have_properties(self, nodes): for node in nodes: interface = node.getElementsByTagName('interface')[0] if interface.getElementsByTagName('property'): return True return False def __call__(self): nodes = self.dom.getElementsByTagName('node') nodes.sort(key=key_by_name) self.h('#include ') self.h('#include ') for header in self.headers: self.h('#include %s' % header) self.h('') self.h('') self.h('G_BEGIN_DECLS') self.h('') self.b('#include "%s.h"' % self.basename) self.b('') for node in nodes: self.do_node(node) self.h('') self.h('G_END_DECLS') self.b('') for header in self.end_headers: self.b('#include %s' % header) self.h('') self.b('') file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) file_set_contents(self.basename + '.c', u('\n').join(self.__body).encode('utf-8')) file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) def cmdline_error(): print("""\ usage: gen-ginterface [OPTIONS] xmlfile Prefix_ options: --include='' (may be repeated) --include='"header.h"' (ditto) --include-end='"header.h"' (ditto) Include extra headers in the generated .c file --signal-marshal-prefix='prefix' Use the given prefix on generated signal marshallers (default is prefix.lower()). --filename='BASENAME' Set the basename for the output files (default is prefix.lower() + 'ginterfaces') --not-implemented-func='symbol' Set action when methods not implemented in the interface vtable are called. symbol must have signature void symbol (DBusGMethodInvocation *context) and return some sort of "not implemented" error via dbus_g_method_return_error (context, ...) """) sys.exit(1) if __name__ == '__main__': from getopt import gnu_getopt options, argv = gnu_getopt(sys.argv[1:], '', ['filename=', 'signal-marshal-prefix=', 'include=', 'include-end=', 'allow-unstable', 'not-implemented-func=']) try: prefix = argv[1] except IndexError: cmdline_error() basename = prefix.lower() + 'ginterfaces' signal_marshal_prefix = prefix.lower().rstrip('_') headers = [] end_headers = [] not_implemented_func = '' allow_havoc = False for option, value in options: if option == '--filename': basename = value elif option == '--signal-marshal-prefix': signal_marshal_prefix = value elif option == '--include': if value[0] not in '<"': value = '"%s"' % value headers.append(value) elif option == '--include-end': if value[0] not in '<"': value = '"%s"' % value end_headers.append(value) elif option == '--not-implemented-func': not_implemented_func = value elif option == '--allow-unstable': allow_havoc = True try: dom = xml.dom.minidom.parse(argv[0]) except IndexError: cmdline_error() Generator(dom, prefix, basename, signal_marshal_prefix, headers, end_headers, not_implemented_func, allow_havoc)() telepathy-glib-0.24.2/tools/gobject-foo.py0000644000175000017500000000610014004033172015331 00000000000000#!/usr/bin/python # gobject-foo.py: generate standard GObject type macros etc. # # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2007-2010 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA def gobject_header(head, tail, as_interface=False): out = [] o = out.append name = head + '_' + tail MixedCase = name.replace('_', '') lower_case = name.lower() UPPER_CASE = name.upper() gtype = head.upper() + '_TYPE_' + tail.upper() o("typedef struct _%s %s;" % (MixedCase, MixedCase)) if as_interface: o("typedef struct _%sInterface %sInterface;" % (MixedCase, MixedCase)) else: o("typedef struct _%sClass %sClass;" % (MixedCase, MixedCase)) o("typedef struct _%sPrivate %sPrivate;" % (MixedCase, MixedCase)) o("") o("GType %s_get_type (void);" % lower_case) o("") o("#define %s \\" % gtype) o(" (%s_get_type ())" % lower_case) o("#define %s(obj) \\" % UPPER_CASE) o(" (G_TYPE_CHECK_INSTANCE_CAST ((obj), %s, \\" % gtype) o(" %s))" % MixedCase) if not as_interface: o("#define %s_CLASS(klass) \\" % UPPER_CASE) o(" (G_TYPE_CHECK_CLASS_CAST ((klass), %s, \\" % gtype) o(" %sClass))" % MixedCase) o("#define %s_IS_%s(obj) \\" % (head.upper(), tail.upper())) o(" (G_TYPE_CHECK_INSTANCE_TYPE ((obj), %s))" % gtype) if as_interface: o("#define %s_GET_IFACE(obj) \\" % UPPER_CASE) o(" (G_TYPE_INSTANCE_GET_INTERFACE ((obj), %s, \\" % gtype) o(" %sInterface))" % MixedCase) else: o("#define %s_IS_%s_CLASS(klass) \\" % (head.upper(), tail.upper())) o(" (G_TYPE_CHECK_CLASS_TYPE ((klass), %s))" % gtype) o("#define %s_GET_CLASS(obj) \\" % UPPER_CASE) o(" (G_TYPE_INSTANCE_GET_CLASS ((obj), %s, \\" % gtype) o(" %sClass))" % MixedCase) return out if __name__ == '__main__': import sys from getopt import gnu_getopt options, argv = gnu_getopt(sys.argv[1:], '', ['interface']) as_interface = False for opt, val in options: if opt == '--interface': as_interface = True head, tail = argv print('\n'.join(gobject_header(head, tail, as_interface=as_interface))) telepathy-glib-0.24.2/tools/manager-file.py0000644000175000017500000001436014004033172015471 00000000000000#!/usr/bin/python # manager-file.py: generate .manager files and TpCMParamSpec arrays from the # same data (should be suitable for all connection managers that don't have # plugins) # # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (c) Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import re import sys import os _NOT_C_STR = re.compile(r'[^A-Za-z0-9_-]') def c_string(x): # whitelist-based brute force and ignorance - escape nearly all punctuation return '"' + _NOT_C_STR.sub(lambda c: r'\x%02x' % ord(c), x) + '"' def desktop_string(x): return x.replace(' ', r'\s').replace('\n', r'\n').replace('\r', r'\r').replace('\t', r'\t') supported = list('sbuiqn') fdefaultencoders = { 's': desktop_string, 'b': (lambda b: b and '1' or '0'), 'u': (lambda n: '%u' % n), 'i': (lambda n: '%d' % n), 'q': (lambda n: '%u' % n), 'n': (lambda n: '%d' % n), } for x in supported: assert x in fdefaultencoders gtypes = { 's': 'G_TYPE_STRING', 'b': 'G_TYPE_BOOLEAN', 'u': 'G_TYPE_UINT', 'i': 'G_TYPE_INT', 'q': 'G_TYPE_UINT', 'n': 'G_TYPE_INT', } for x in supported: assert x in gtypes gdefaultencoders = { 's': c_string, 'b': (lambda b: b and 'GINT_TO_POINTER (TRUE)' or 'GINT_TO_POINTER (FALSE)'), 'u': (lambda n: 'GUINT_TO_POINTER (%u)' % n), 'i': (lambda n: 'GINT_TO_POINTER (%d)' % n), 'q': (lambda n: 'GUINT_TO_POINTER (%u)' % n), 'n': (lambda n: 'GINT_TO_POINTER (%d)' % n), } for x in supported: assert x in gdefaultencoders gdefaultdefaults = { 's': 'NULL', 'b': 'GINT_TO_POINTER (FALSE)', 'u': 'GUINT_TO_POINTER (0)', 'i': 'GINT_TO_POINTER (0)', 'q': 'GUINT_TO_POINTER (0)', 'n': 'GINT_TO_POINTER (0)', } for x in supported: assert x in gdefaultdefaults gflags = { 'has-default': 'TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT', 'register': 'TP_CONN_MGR_PARAM_FLAG_REGISTER', 'required': 'TP_CONN_MGR_PARAM_FLAG_REQUIRED', 'secret': 'TP_CONN_MGR_PARAM_FLAG_SECRET', 'dbus-property': 'TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY', } def write_manager(f, manager, protos): # pointless backwards compat section print('[ConnectionManager]', file=f) print('BusName=org.freedesktop.Telepathy.ConnectionManager.' + manager, file=f) print('ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/' + manager, file=f) # protocols for proto, params in protos.items(): print(file=f) print('[Protocol %s]' % proto, file=f) defaults = {} for param, info in params.items(): dtype = info['dtype'] flags = info.get('flags', '').split() struct_field = info.get('struct_field', param.replace('-', '_')) filter = info.get('filter', 'NULL') filter_data = info.get('filter_data', 'NULL') setter_data = 'NULL' if 'default' in info: default = fdefaultencoders[dtype](info['default']) defaults[param] = default if flags: flags = ' ' + ' '.join(flags) else: flags = '' print('param-%s=%s%s' % (param, desktop_string(dtype), flags), file=f) for param, default in defaults.items(): print('default-%s=%s' % (param, default), file=f) def write_c_params(f, manager, proto, struct, params): print("static const TpCMParamSpec %s_%s_params[] = {" % (manager, proto), file=f) for param, info in params.items(): dtype = info['dtype'] flags = info.get('flags', '').split() struct_field = info.get('struct_field', param.replace('-', '_')) filter = info.get('filter', 'NULL') filter_data = info.get('filter_data', 'NULL') setter_data = 'NULL' if 'default' in info: default = gdefaultencoders[dtype](info['default']) else: default = gdefaultdefaults[dtype] if flags: flags = ' | '.join([gflags[flag] for flag in flags]) else: flags = '0' if struct is None or struct_field is None: struct_offset = '0' else: struct_offset = 'G_STRUCT_OFFSET (%s, %s)' % (struct, struct_field) print((''' { %s, %s, %s, %s, %s, /* default */ %s, /* struct offset */ %s, /* filter */ %s, /* filter data */ %s /* setter data */ },''' % (c_string(param), c_string(dtype), gtypes[dtype], flags, default, struct_offset, filter, filter_data, setter_data)), file=f) print(" { NULL }", file=f) print("};", file=f) if __name__ == '__main__': environment = {} exec(compile(open(sys.argv[1], "rb").read(), sys.argv[1], 'exec'), environment) filename = '%s/%s.manager' % (sys.argv[2], environment['MANAGER']) try: os.remove(filename) except OSError: pass f = open(filename + '.tmp', 'w') write_manager(f, environment['MANAGER'], environment['PARAMS']) f.close() os.rename(filename + '.tmp', filename) filename = '%s/param-spec-struct.h' % sys.argv[2] try: os.remove(filename) except OSError: pass f = open(filename + '.tmp', 'w') for protocol in environment['PARAMS']: write_c_params(f, environment['MANAGER'], protocol, environment['STRUCTS'][protocol], environment['PARAMS'][protocol]) f.close() os.rename(filename + '.tmp', filename) telepathy-glib-0.24.2/tools/telepathy-glib-env.in0000644000175000017500000000043712652510705016631 00000000000000#!/bin/sh abs_top_builddir="@abs_top_builddir@" export abs_top_builddir LD_LIBRARY_PATH="${abs_top_builddir}/telepathy-glib/.libs${LD_LIBRARY_PATH:+":${LD_LIBRARY_PATH}"}" export LD_LIBRARY_PATH G_DEBUG="fatal_criticals,fatal_warnings${G_DEBUG:+",${G_DEBUG}"}" export G_DEBUG exec "$@" telepathy-glib-0.24.2/tools/check-coding-style.mk0000644000175000017500000000075712652510705016613 00000000000000check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(enable_fatal_warnings)"; then \ exit "$$fail";\ else \ exit 0;\ fi telepathy-glib-0.24.2/tools/glib-gtypes-generator.py0000644000175000017500000003076414004033172017362 00000000000000#!/usr/bin/python # Generate GLib GInterfaces from the Telepathy specification. # The master copy of this program is in the telepathy-glib repository - # please make any changes there. # # Copyright (C) 2006, 2007 Collabora Limited # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import xml.dom.minidom from libtpcodegen import file_set_contents, u from libglibcodegen import escape_as_identifier, \ get_docstring, \ NS_TP, \ Signature, \ type_to_gtype, \ xml_escape def types_to_gtypes(types): return [type_to_gtype(t)[1] for t in types] class GTypesGenerator(object): def __init__(self, dom, output, mixed_case_prefix): self.dom = dom self.Prefix = mixed_case_prefix self.PREFIX_ = self.Prefix.upper() + '_' self.prefix_ = self.Prefix.lower() + '_' self.header = [] self.body = [] self.docs = [] self.output = output for f in (self.header, self.body, self.docs): f.append('/* Auto-generated, do not edit.\n *\n' ' * This file may be distributed under the same terms\n' ' * as the specification from which it was generated.\n' ' */\n\n') # keys are e.g. 'sv', values are the key escaped self.need_mappings = {} # keys are the contents of the struct (e.g. 'sssu'), values are the # key escaped self.need_structs = {} # keys are the contents of the struct (e.g. 'sssu'), values are the # key escaped self.need_struct_arrays = {} # keys are the contents of the array (unlike need_struct_arrays!), # values are the key escaped self.need_other_arrays = {} def h(self, code): self.header.append(code) def c(self, code): self.body.append(code) def d(self, code): self.docs.append(code) def do_mapping_header(self, mapping): members = mapping.getElementsByTagNameNS(NS_TP, 'member') assert len(members) == 2 impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'HASH_TYPE_' + mapping.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_hash_' + esc_impl_sig docstring = get_docstring(mapping) or '(Undocumented)' self.d('/**\n * %s:\n *\n' % name.strip()) self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * This macro expands to a call to a function\n') self.d(' * that returns the #GType of a #GHashTable\n') self.d(' * appropriate for representing a D-Bus\n') self.d(' * dictionary of signature\n') self.d(' * a{%s}.\n' % impl_sig) self.d(' *\n') key, value = members self.d(' * Keys (D-Bus type %s,\n' % key.getAttribute('type')) tp_type = key.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % key.getAttribute('name')) docstring = get_docstring(key) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * Values (D-Bus type %s,\n' % value.getAttribute('type')) tp_type = value.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % value.getAttribute('name')) docstring = get_docstring(value) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' */\n') self.h('#define %s (%s ())\n\n' % (name, impl)) self.need_mappings[impl_sig] = esc_impl_sig array_name = mapping.getAttribute('array-name') if array_name: gtype_name = self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper() contents_sig = 'a{' + impl_sig + '}' esc_contents_sig = escape_as_identifier(contents_sig) impl = self.prefix_ + 'type_dbus_array_of_' + esc_contents_sig self.d('/**\n * %s:\n\n' % gtype_name) self.d(' * Expands to a call to a function\n') self.d(' * that returns the #GType of a #GPtrArray\n') self.d(' * of #%s.\n' % name) self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (gtype_name, impl)) self.need_other_arrays[contents_sig] = esc_contents_sig def do_struct_header(self, struct): members = struct.getElementsByTagNameNS(NS_TP, 'member') impl_sig = ''.join([elt.getAttribute('type') for elt in members]) esc_impl_sig = escape_as_identifier(impl_sig) name = (self.PREFIX_ + 'STRUCT_TYPE_' + struct.getAttribute('name').upper()) impl = self.prefix_ + 'type_dbus_struct_' + esc_impl_sig docstring = struct.getElementsByTagNameNS(NS_TP, 'docstring') if docstring: docstring = docstring[0].toprettyxml() if docstring.startswith(''): docstring = docstring[14:] if docstring.endswith('\n'): docstring = docstring[:-16] if docstring.strip() in ('', ''): docstring = '(Undocumented)' else: docstring = '(Undocumented)' self.d('/**\n * %s:\n\n' % name) self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' * This macro expands to a call to a function\n') self.d(' * that returns the #GType of a #GValueArray\n') self.d(' * appropriate for representing a D-Bus struct\n') self.d(' * with signature (%s).\n' % impl_sig) self.d(' *\n') for i, member in enumerate(members): self.d(' * Member %d (D-Bus type ' '%s,\n' % (i, member.getAttribute('type'))) tp_type = member.getAttributeNS(NS_TP, 'type') if tp_type: self.d(' * type %s,\n' % tp_type) self.d(' * named %s):\n' % member.getAttribute('name')) docstring = get_docstring(member) or '(Undocumented)' self.d(' * %s\n' % xml_escape(docstring)) self.d(' *\n') self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (name, impl)) array_name = struct.getAttribute('array-name') if array_name != '': array_name = (self.PREFIX_ + 'ARRAY_TYPE_' + array_name.upper()) impl = self.prefix_ + 'type_dbus_array_' + esc_impl_sig self.d('/**\n * %s:\n\n' % array_name) self.d(' * Expands to a call to a function\n') self.d(' * that returns the #GType of a #GPtrArray\n') self.d(' * of #%s.\n' % name) self.d(' */\n\n') self.h('#define %s (%s ())\n\n' % (array_name, impl)) self.need_struct_arrays[impl_sig] = esc_impl_sig self.need_structs[impl_sig] = esc_impl_sig def __call__(self): mappings = self.dom.getElementsByTagNameNS(NS_TP, 'mapping') structs = self.dom.getElementsByTagNameNS(NS_TP, 'struct') for mapping in mappings: self.do_mapping_header(mapping) for sig in sorted(self.need_mappings): self.h('GType %stype_dbus_hash_%s (void);\n\n' % (self.prefix_, self.need_mappings[sig])) self.c('GType\n%stype_dbus_hash_%s (void)\n{\n' % (self.prefix_, self.need_mappings[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') # FIXME: translate sig into two GTypes items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) self.c(' t = dbus_g_type_get_map ("GHashTable", ' '%s, %s);\n' % (gtypes[0], gtypes[1])) self.c(' return t;\n') self.c('}\n\n') for struct in structs: self.do_struct_header(struct) for sig in sorted(self.need_structs): self.h('GType %stype_dbus_struct_%s (void);\n\n' % (self.prefix_, self.need_structs[sig])) self.c('GType\n%stype_dbus_struct_%s (void)\n{\n' % (self.prefix_, self.need_structs[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') self.c(' t = dbus_g_type_get_struct ("GValueArray",\n') items = tuple(Signature(sig)) gtypes = types_to_gtypes(items) for gtype in gtypes: self.c(' %s,\n' % gtype) self.c(' G_TYPE_INVALID);\n') self.c(' return t;\n') self.c('}\n\n') for sig in sorted(self.need_struct_arrays): self.h('GType %stype_dbus_array_%s (void);\n\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c('GType\n%stype_dbus_array_%s (void)\n{\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') self.c(' t = dbus_g_type_get_collection ("GPtrArray", ' '%stype_dbus_struct_%s ());\n' % (self.prefix_, self.need_struct_arrays[sig])) self.c(' return t;\n') self.c('}\n\n') for sig in sorted(self.need_other_arrays): self.h('GType %stype_dbus_array_of_%s (void);\n\n' % (self.prefix_, self.need_other_arrays[sig])) self.c('GType\n%stype_dbus_array_of_%s (void)\n{\n' % (self.prefix_, self.need_other_arrays[sig])) self.c(' static GType t = 0;\n\n') self.c(' if (G_UNLIKELY (t == 0))\n') if sig[:2] == 'a{' and sig[-1:] == '}': # array of mappings self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_hash_%s ());\n' % (self.prefix_, escape_as_identifier(sig[2:-1]))) elif sig[:2] == 'a(' and sig[-1:] == ')': # array of arrays of struct self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_array_%s ());\n' % (self.prefix_, escape_as_identifier(sig[2:-1]))) elif sig[:1] == 'a': # array of arrays of non-struct self.c(' t = dbus_g_type_get_collection (' '"GPtrArray", ' '%stype_dbus_array_of_%s ());\n' % (self.prefix_, escape_as_identifier(sig[1:]))) else: raise AssertionError("array of '%s' not supported" % sig) self.c(' return t;\n') self.c('}\n\n') file_set_contents(self.output + '.h', u('').join(self.header).encode('utf-8')) file_set_contents(self.output + '-body.h', u('').join(self.body).encode('utf-8')) file_set_contents(self.output + '-gtk-doc.h', u('').join(self.docs).encode('utf-8')) if __name__ == '__main__': argv = sys.argv[1:] dom = xml.dom.minidom.parse(argv[0]) GTypesGenerator(dom, argv[1], argv[2])() telepathy-glib-0.24.2/tools/valgrind.mk0000644000175000017500000000073512652510705014741 00000000000000VALGRIND = valgrind --tool=memcheck \ --verbose \ --leak-check=full \ --leak-resolution=high \ --suppressions=$(top_srcdir)/tools/telepathy-glib.supp \ --child-silent-after-fork=yes \ --num-callers=20 \ --gen-suppressions=all # other potentially interesting options: # --show-reachable=yes reachable objects (many!) # --read-var-info=yes better diagnostics from DWARF3 info # --track-origins=yes better diagnostics for uninit values (slow) telepathy-glib-0.24.2/tools/shave.mk0000644000175000017500000000004712652510705014235 00000000000000QUIET_GEN = $(Q:@=@echo ' GEN '$@;) telepathy-glib-0.24.2/tools/glib-errors-check-gen.py0000644000175000017500000000423414004033172017212 00000000000000#!/usr/bin/python import sys import xml.dom.minidom from libglibcodegen import NS_TP, get_docstring, get_descendant_text class Generator(object): def __init__(self, dom): self.dom = dom self.errors = self.dom.getElementsByTagNameNS(NS_TP, 'errors')[0] def __call__(self): print('{') print(' GEnumClass *klass;') print(' GEnumValue *value_by_name;') print(' GEnumValue *value_by_nick;') print('') print(' klass = g_type_class_ref (TP_TYPE_ERROR);') for error in self.errors.getElementsByTagNameNS(NS_TP, 'error'): ns = error.parentNode.getAttribute('namespace') nick = error.getAttribute('name').replace(' ', '') enum = ('TP_ERROR_' + error.getAttribute('name').replace(' ', '_').replace('.', '_').upper()) s = ('TP_ERROR_STR_' + error.getAttribute('name').replace(' ', '_').replace('.', '_').upper()) print('') print(' /* %s.%s */' % (ns, nick)) print(' value_by_name = g_enum_get_value_by_name (klass, "%s");' % enum) print(' value_by_nick = g_enum_get_value_by_nick (klass, "%s");' % nick) print(' g_assert (value_by_name != NULL);') print(' g_assert (value_by_nick != NULL);') print(' g_assert_cmpint (value_by_name->value, ==, %s);' % enum) print(' g_assert_cmpint (value_by_nick->value, ==, %s);' % enum) print(' g_assert_cmpstr (value_by_name->value_name, ==, "%s");' % enum) print(' g_assert_cmpstr (value_by_nick->value_name, ==, "%s");' % enum) print(' g_assert_cmpstr (value_by_name->value_nick, ==, "%s");' % nick) print(' g_assert_cmpstr (value_by_nick->value_nick, ==, "%s");' % nick) print(' g_assert_cmpstr (%s, ==, TP_ERROR_PREFIX ".%s");' % (s, nick)) print('}') if __name__ == '__main__': argv = sys.argv[1:] Generator(xml.dom.minidom.parse(argv[0]))() telepathy-glib-0.24.2/README0000644000175000017500000001101212652510705012310 00000000000000============== telepathy-glib ============== This is a library for GLib-based Telepathy components. Telepathy is a D-Bus framework for unifying real time communication, including instant messaging, voice calls and video calls. It abstracts differences between protocols to provide a unified interface for applications. Telepathy specification ======================= The copy of the Telepathy specification in the spec/ directory indicates the specification that this library claims to implement. Requirements ============ Building telepathy-glib requires: GLib, GObject libdbus The D-Bus GLib bindings GNU make pkg-config libxslt, xsltproc Python and can also make use of: GObject-Introspection Vala gtkdoc See configure.ac for full details, including versions required. Of the packages listed above, only GLib, GObject, libdbus and dbus-glib are required at runtime. Building from git also requires the GNU build system (Autoconf, Automake, libtool). Bugs, feature requests and to-do list ===================================== Report all bugs, feature requests and "to-do" items here: Running "make check" will produce FIXME.out, which lists all the mentions of FIXME, TODO or XXX in the source code. Ideally, all of these should be in Bugzilla, but sometimes they're not. API stability policy ==================== We use an "odd/even" versioning scheme where the minor version (the y in x.y.z) determines stability - stable branches have y even, development branches have y odd. In a stable (even) branch, we will not make incompatible API or ABI changes between one release tarball and the next. In a development (odd) branch, we will attempt to avoid incompatible API or ABI changes. If we break ABI relative to the previous stable (even) release, we will increase the library SONAME to avoid breaking existing code. If we break ABI relative to a previous development (odd) release, we will not necessarily increase the library SONAME: in other words, API/ABI added by a development release is not guaranteed until it appears in a stable release. (This is basically the same policy as GLib - in versions 0.22 and earlier, we had a more restrictive policy.) The GObject-Introspection and Vala bindings are more or less stable, but might break compatibility between one development branch and the next. Unreleased builds straight from git identify themselves as version "x.y.z.1". We DO NOT make any API guarantees about unreleased builds. Unreleased builds are compiled with -Werror, so they might stop working if your gcc version issues more warnings than ours. If this is a problem for you, use a release tarball or configure with --disable-fatal-warnings. Contact info ============ This library is maintained by the Telepathy project: Telepathy development is supported by Collabora Ltd. . Hacking ======= The current development version of telepathy-glib is available from the 'master' branch in the git repository: (for committers) (gitweb) Stable branches are available from branches with names like 'telepathy-glib-0.6' in the same repository. Proposed patches awaiting review can usually be found in freedesktop.org bugzilla. Our review procedure is described by: Please follow . GObject Introspection ===================== telepathy-glib's high level API has experimental GObject-Introspection support. You can easily test it from the source directory by defining this environment variable: GI_TYPELIB_PATH=`pwd`/telepathy-glib export GI_TYPELIB_PATH LD_LIBRARY_PATH=`pwd`/telepathy-glib/.libs export LD_LIBRARY_PATH In Python you can access the API using; from gi.repository import TelepathyGLib telepathy-glib-0.24.2/configure0000755000175000017500000240352414006601552013352 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for Telepathy-GLib 0.24.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-glib $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} as_awk_strverscmp=' # Use only awk features that work with 7th edition Unix awk (1978). # My, what an old awk you have, Mr. Solaris! END { while (length(v1) && length(v2)) { # Set d1 to be the next thing to compare from v1, and likewise for d2. # Normally this is a single character, but if v1 and v2 contain digits, # compare them as integers and fractions as strverscmp does. if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { # Split v1 and v2 into their leading digit string components d1 and d2, # and advance v1 and v2 past the leading digit strings. for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) if (d1 ~ /^0/) { if (d2 ~ /^0/) { # Compare two fractions. while (d1 ~ /^0/ && d2 ~ /^0/) { d1 = substr(d1, 2); len1-- d2 = substr(d2, 2); len2-- } if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { # The two components differ in length, and the common prefix # contains only leading zeros. Consider the longer to be less. d1 = -len1 d2 = -len2 } else { # Otherwise, compare as strings. d1 = "x" d1 d2 = "x" d2 } } else { # A fraction is less than an integer. exit 1 } } else { if (d2 ~ /^0/) { # An integer is greater than a fraction. exit 2 } else { # Compare two integers. d1 += 0 d2 += 0 } } } else { # The normal case, without worrying about digits. d1 = substr(v1, 1, 1); v1 = substr(v1, 2) d2 = substr(v2, 1, 1); v2 = substr(v2, 2) } if (d1 < d2) exit 1 if (d1 > d2) exit 2 } # Beware Solaris /usr/xgp4/bin/awk (at least through Solaris 10), # which mishandles some comparisons of empty strings to integers. if (length(v2)) exit 1 if (length(v1)) exit 2 } ' test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Telepathy-GLib' PACKAGE_TARNAME='telepathy-glib' PACKAGE_VERSION='0.24.2' PACKAGE_STRING='Telepathy-GLib 0.24.2' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-glib' PACKAGE_URL='' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_CXX_FALSE HAVE_CXX_TRUE CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX HAVE_LD_VERSION_SCRIPT_FALSE HAVE_LD_VERSION_SCRIPT_TRUE pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON XSLTPROC TP_GLIB_CFLAGS HAVE_VALA HAVE_VALA_FALSE HAVE_VALA_TRUE VAPIGEN VALAFLAGS VALAC DBUS_LIBS DBUS_CFLAGS GLIB_MKENUMS GLIB_GENMARSHAL GIO_UNIX_LIBS GIO_UNIX_CFLAGS GLIB_LIBS GLIB_CFLAGS tpglibtestsdir OUT_OF_TREE_BUILD_FALSE OUT_OF_TREE_BUILD_TRUE INSTALL_EXAMPLES_FALSE INSTALL_EXAMPLES_TRUE ENABLE_INSTALLED_TESTS_FALSE ENABLE_INSTALLED_TESTS_TRUE COVERAGE_CFLAGS OFFICIAL_RELEASE_FALSE OFFICIAL_RELEASE_TRUE ERROR_SCANNERFLAGS ERROR_CFLAGS enable_fatal_warnings HAVE_VERSION_SCRIPT_ARG_FALSE HAVE_VERSION_SCRIPT_ARG_TRUE VERSION_SCRIPT_ARG LT_AGE LT_REVISION LT_CURRENT TP_MICRO_VERSION TP_MINOR_VERSION TP_MAJOR_VERSION HAVE_INTROSPECTION_FALSE HAVE_INTROSPECTION_TRUE INTROSPECTION_MAKEFILE INTROSPECTION_LIBS INTROSPECTION_CFLAGS INTROSPECTION_TYPELIBDIR INTROSPECTION_GIRDIR INTROSPECTION_GENERATE INTROSPECTION_COMPILER INTROSPECTION_SCANNER GTK_DOC_USE_REBASE_FALSE GTK_DOC_USE_REBASE_TRUE GTK_DOC_USE_LIBTOOL_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_BUILD_PDF_FALSE GTK_DOC_BUILD_PDF_TRUE GTK_DOC_BUILD_HTML_FALSE GTK_DOC_BUILD_HTML_TRUE ENABLE_GTK_DOC_FALSE ENABLE_GTK_DOC_TRUE HAVE_GTK_DOC_FALSE HAVE_GTK_DOC_TRUE GTKDOC_DEPS_LIBS GTKDOC_DEPS_CFLAGS HTML_DIR GTKDOC_MKPDF GTKDOC_REBASE GTKDOC_CHECK_PATH GTKDOC_CHECK PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_html_dir enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf enable_introspection enable_compiler_optimisations enable_compiler_coverage enable_linker_optimisations enable_fatal_warnings enable_Werror enable_debug enable_debug_cache enable_backtrace enable_installed_tests enable_installed_examples enable_vala_bindings ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS GLIB_CFLAGS GLIB_LIBS GIO_UNIX_CFLAGS GIO_UNIX_LIBS DBUS_CFLAGS DBUS_LIBS PYTHON CXX CXXFLAGS CCC CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures Telepathy-GLib 0.24.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/telepathy-glib] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of Telepathy-GLib 0.24.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] --enable-introspection=[no/auto/yes] Enable introspection for this build --disable-compiler-optimisations Disable compiler optimisations --enable-compiler-coverage Enable generation of coverage data --disable-linker-optimisations Disable linker optimisations --enable-fatal-warnings make various warnings fatal --disable-Werror compile without -Werror (normally enabled in development builds) --disable-debug compile without debug code (note that this will disable much of the debug code in all GLib connection managers) --enable-debug-cache compile with code to unconditionally cache all debug messages whether or not they are actually emitted --enable-backtrace enable printing out the backtrace in case of crash (in most GLib connection managers) --enable-installed-tests make tests installable --enable-installed-examples install examples as well as the library --enable-vala-bindings build the EXPERIMENTAL Vala bindings Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GTKDOC_DEPS_CFLAGS C compiler flags for GTKDOC_DEPS, overriding pkg-config GTKDOC_DEPS_LIBS linker flags for GTKDOC_DEPS, overriding pkg-config GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config GIO_UNIX_CFLAGS C compiler flags for GIO_UNIX, overriding pkg-config GIO_UNIX_LIBS linker flags for GIO_UNIX, overriding pkg-config DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config DBUS_LIBS linker flags for DBUS, overriding pkg-config PYTHON the Python interpreter CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF Telepathy-GLib configure 0.24.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## --------------------------------------------------------------------------------------------- ## ## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-glib ## ## --------------------------------------------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by Telepathy-GLib $as_me 0.24.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='telepathy-glib' VERSION='0.24.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi case $ac_cv_prog_cc_stdc in #( no) : ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 $as_echo_n "checking for $CC option to accept ISO C99... " >&6; } if ${ac_cv_prog_cc_c99+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include #include // Check varargs macros. These examples are taken from C99 6.10.3.5. #define debug(...) fprintf (stderr, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK your preprocessor is broken; #endif #if BIG_OK #else your preprocessor is broken; #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\0'; ++i) continue; return 0; } // Check varargs and va_copy. static void test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str; int number; float fnumber; while (*format) { switch (*format++) { case 's': // string str = va_arg (args_copy, const char *); break; case 'd': // int number = va_arg (args_copy, int); break; case 'f': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); } int main () { // Check bool. _Bool success = false; // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. test_varargs ("s, d' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' || dynamic_array[ni.number - 1] != 543); ; return 0; } _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c99" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c99" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 $as_echo "$ac_cv_prog_cc_c99" >&6; } ;; esac if test "x$ac_cv_prog_cc_c99" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 else ac_cv_prog_cc_stdc=no fi fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 $as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } if ${ac_cv_prog_cc_stdc+:} false; then : $as_echo_n "(cached) " >&6 fi case $ac_cv_prog_cc_stdc in #( no) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; #( '') : { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 $as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; esac case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.6' macro_revision='2.4.6' ltmain=$ac_aux_dir/ltmain.sh # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 $as_echo "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[012][,.]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else pic_mode=default fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$versuffix$shared_ext $libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen=shl_load else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen=dlopen else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report what library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: # pkg-config 0.21 adds CFLAGS from Requires.private, which we need if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.21 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi gtk_doc_requires="gtk-doc >= 1.17" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 $as_echo_n "checking for gtk-doc... " >&6; } if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then have_gtk_doc=yes else have_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 $as_echo "$have_gtk_doc" >&6; } if test "$have_gtk_doc" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&5 $as_echo "$as_me: WARNING: You will not be able to create source packages with 'make dist' because $gtk_doc_requires is not found." >&2;} fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_GTKDOC_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$GTKDOC_CHECK"; then ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 $as_echo "$GTKDOC_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gtkdoc-check", so it can be a program name with args. set dummy gtkdoc-check; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_CHECK_PATH+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_CHECK_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_CHECK_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH if test -n "$GTKDOC_CHECK_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 $as_echo "$GTKDOC_CHECK_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi for ac_prog in gtkdoc-rebase do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_REBASE+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_REBASE in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_REBASE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE if test -n "$GTKDOC_REBASE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 $as_echo "$GTKDOC_REBASE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$GTKDOC_REBASE" && break done test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. set dummy gtkdoc-mkpdf; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTKDOC_MKPDF+:} false; then : $as_echo_n "(cached) " >&6 else case $GTKDOC_MKPDF in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GTKDOC_MKPDF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF if test -n "$GTKDOC_MKPDF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 $as_echo "$GTKDOC_MKPDF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then : withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then : enableval=$enable_gtk_doc; else enable_gtk_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 $as_echo_n "checking whether to build gtk-doc documentation... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 $as_echo "$enable_gtk_doc" >&6; } if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then as_fn_error $? " You must have $gtk_doc_requires installed to build documentation for $PACKAGE_NAME. Please install gtk-doc or disable building the documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 fi if test "x$PACKAGE_NAME" != "xglib"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" >&5 $as_echo_n "checking for glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0... " >&6; } if test -n "$GTKDOC_DEPS_CFLAGS"; then pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTKDOC_DEPS_LIBS"; then pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` else GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 : elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } : else GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi # Check whether --enable-gtk-doc-html was given. if test "${enable_gtk_doc_html+set}" = set; then : enableval=$enable_gtk_doc_html; else enable_gtk_doc_html=yes fi # Check whether --enable-gtk-doc-pdf was given. if test "${enable_gtk_doc_pdf+set}" = set; then : enableval=$enable_gtk_doc_pdf; else enable_gtk_doc_pdf=no fi if test -z "$GTKDOC_MKPDF"; then enable_gtk_doc_pdf=no fi if test -z "$AM_DEFAULT_VERBOSITY"; then AM_DEFAULT_VERBOSITY=1 fi if test x$have_gtk_doc = xyes; then HAVE_GTK_DOC_TRUE= HAVE_GTK_DOC_FALSE='#' else HAVE_GTK_DOC_TRUE='#' HAVE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test x$enable_gtk_doc_html = xyes; then GTK_DOC_BUILD_HTML_TRUE= GTK_DOC_BUILD_HTML_FALSE='#' else GTK_DOC_BUILD_HTML_TRUE='#' GTK_DOC_BUILD_HTML_FALSE= fi if test x$enable_gtk_doc_pdf = xyes; then GTK_DOC_BUILD_PDF_TRUE= GTK_DOC_BUILD_PDF_FALSE='#' else GTK_DOC_BUILD_PDF_TRUE='#' GTK_DOC_BUILD_PDF_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi if test -n "$GTKDOC_REBASE"; then GTK_DOC_USE_REBASE_TRUE= GTK_DOC_USE_REBASE_FALSE='#' else GTK_DOC_USE_REBASE_TRUE='#' GTK_DOC_USE_REBASE_FALSE= fi # Check whether --enable-introspection was given. if test "${enable_introspection+set}" = set; then : enableval=$enable_introspection; else enable_introspection=auto fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 $as_echo_n "checking for gobject-introspection... " >&6; } case $enable_introspection in #( no) : found_introspection="no (disabled, use --enable-introspection to enable)" ;; #( yes) : if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : else as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 fi if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.30\""; } >&5 ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.30") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then found_introspection=yes else as_fn_error $? "You need to have gobject-introspection >= 1.30 installed to build Telepathy-GLib" "$LINENO" 5 fi ;; #( auto) : if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.30\""; } >&5 ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.30") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then found_introspection=yes else found_introspection=no fi ;; #( *) : as_fn_error $? "invalid argument passed to --enable-introspection, should be one of [no/auto/yes]" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_introspection" >&5 $as_echo "$found_introspection" >&6; } INTROSPECTION_SCANNER= INTROSPECTION_COMPILER= INTROSPECTION_GENERATE= INTROSPECTION_GIRDIR= INTROSPECTION_TYPELIBDIR= if test "x$found_introspection" = "xyes"; then INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0` INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0` INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection fi if test "x$found_introspection" = "xyes"; then HAVE_INTROSPECTION_TRUE= HAVE_INTROSPECTION_FALSE='#' else HAVE_INTROSPECTION_TRUE='#' HAVE_INTROSPECTION_FALSE= fi TP_MAJOR_VERSION=0 TP_MINOR_VERSION=24 TP_MICRO_VERSION=2 LT_CURRENT=84 LT_REVISION=1 LT_AGE=84 # Check whether --enable-compiler-optimisations was given. if test "${enable_compiler_optimisations+set}" = set; then : enableval=$enable_compiler_optimisations; if test "x$enable_compiler_optimisations" = "xno"; then CFLAGS=`echo "$CFLAGS" | sed -e "s/ -O[1-9]*\b/ -O0/g"` fi fi # Check whether --enable-compiler-coverage was given. if test "${enable_compiler_coverage+set}" = set; then : enableval=$enable_compiler_coverage; if test "x$enable_compiler_coverage" = "xyes"; then if test "x$GCC" = "xyes"; then CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker supports -Wl,-O1" >&5 $as_echo_n "checking whether linker supports -Wl,-O1... " >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,-O1" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : can_use_linker_opt=yes else can_use_linker_opt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_use_linker_opt" >&5 $as_echo "$can_use_linker_opt" >&6; } if test "x$can_use_linker_opt" = "xno"; then LDFLAGS="$save_LDFLAGS" fi # Check whether --enable-linker-optimisations was given. if test "${enable_linker_optimisations+set}" = set; then : enableval=$enable_linker_optimisations; if test "x$enable_linker_optimisations" = "xno"; then LDFLAGS=`echo "$LDFLAGS" | sed -e "s/ -Wl,-O[0-9]*\b//g"` fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker version script argument" >&5 $as_echo_n "checking for linker version script argument... " >&6; } for aranha_try_arg in "-Wl,--version-script"; do aranha_old_libs="$LIBS" LIBS="$LIBS $aranha_try_arg=conftest.ver" cat >conftest.ver <conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : rm -f conftest.ver LIBS="$aranha_old_libs" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $aranha_try_arg" >&5 $as_echo "$aranha_try_arg" >&6; } VERSION_SCRIPT_ARG=$aranha_try_arg break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext rm -f conftest.ver LIBS="$aranha_old_libs" done if test -n "$VERSION_SCRIPT_ARG"; then HAVE_VERSION_SCRIPT_ARG_TRUE= HAVE_VERSION_SCRIPT_ARG_FALSE='#' else HAVE_VERSION_SCRIPT_ARG_TRUE='#' HAVE_VERSION_SCRIPT_ARG_FALSE= fi if test -z "$VERSION_SCRIPT_ARG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5 $as_echo "unknown" >&6; } fi # tp-glib is version x.y.z - "official release", # disable extra checks by default official_release=yes # Check whether --enable-fatal-warnings was given. if test "${enable_fatal_warnings+set}" = set; then : enableval=$enable_fatal_warnings; else enable_fatal_warnings=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands " >&5 $as_echo_n "checking to see if compiler understands ... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS " CXXFLAGS="$CXXFLAGS " cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } tp_warnings="" for tp_flag in all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -W$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -W$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -W$tp_flag" CXXFLAGS="$CXXFLAGS -W$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -W$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done tp_error_flags="-Werror" { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Werror" >&5 $as_echo_n "checking to see if compiler understands -Werror... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_werror=yes true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } for tp_flag in missing-field-initializers \ unused-parameter \ deprecated-declarations; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_warnings="$tp_warnings -Wno-$tp_flag" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler understands -Wno-error=$tp_flag" >&5 $as_echo_n "checking to see if compiler understands -Wno-error=$tp_flag... " >&6; } save_CFLAGS="$CFLAGS" save_CXXFLAGS="$CXXFLAGS" CFLAGS="$CFLAGS -Wno-error=$tp_flag" CXXFLAGS="$CXXFLAGS -Wno-error=$tp_flag" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$save_CFLAGS" CXXFLAGS="$save_CXXFLAGS" if test "X$flag_ok" = Xyes ; then tp_error_flags="$tp_error_flags -Wno-error=$tp_flag" true else tp_werror=no true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } done # Check whether --enable-Werror was given. if test "${enable_Werror+set}" = set; then : enableval=$enable_Werror; tp_werror=$enableval else : fi if test "x$tp_werror" = xyes && test "x$enable_fatal_warnings" = xyes; then ERROR_CFLAGS="$tp_error_flags $tp_warnings" else ERROR_CFLAGS="$tp_warnings" fi # these aren't really error flags but they serve a similar purpose for us - # making the toolchain stricter if test "x$enable_fatal_warnings" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler/linker understand -Wl,--no-copy-dt-needed-entries" >&5 $as_echo_n "checking to see if compiler/linker understand -Wl,--no-copy-dt-needed-entries... " >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-copy-dt-needed-entries" if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext LDFLAGS="$save_LDFLAGS" if test "X$flag_ok" = Xyes ; then ERROR_LDFLAGS="$ERROR_LDFLAGS -Wl,--no-copy-dt-needed-entries" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } # --no-copy-dt-needed-entries is the new name for --no-add-needed which # is much more widely supported case "$ERROR_LDFLAGS" in #( *-Wl,--no-copy-dt-needed-entries*) : ;; #( *) : { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if compiler/linker understand -Wl,--no-add-needed" >&5 $as_echo_n "checking to see if compiler/linker understand -Wl,--no-add-needed... " >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-add-needed" if ac_fn_c_try_compile "$LINENO"; then : flag_ok=yes else flag_ok=no fi rm -f core conftest.err conftest.$ac_objext LDFLAGS="$save_LDFLAGS" if test "X$flag_ok" = Xyes ; then ERROR_LDFLAGS="$ERROR_LDFLAGS -Wl,--no-add-needed" true else true fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $flag_ok" >&5 $as_echo "$flag_ok" >&6; } ;; #( *) : ;; esac fi if test "x$enable_fatal_warnings" = xyes; then : ERROR_SCANNERFLAGS=--warn-error else ERROR_SCANNERFLAGS= fi # Only use this where we really do want things to depend on whether it's # a release or not (like ABI-stability enforcement). For fatal warnings, # use ${enable_fatal_warnings} instead. if test "x$official_release" = xyes; then OFFICIAL_RELEASE_TRUE= OFFICIAL_RELEASE_FALSE='#' else OFFICIAL_RELEASE_TRUE='#' OFFICIAL_RELEASE_FALSE= fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=$enableval else enable_debug=yes fi # Check whether --enable-debug-cache was given. if test "${enable_debug_cache+set}" = set; then : enableval=$enable_debug_cache; enable_debug_cache=$enableval else enable_debug_cache=yes fi if test x"$enable_debug_cache" != xno; then : $as_echo "#define ENABLE_DEBUG_CACHE 1" >>confdefs.h fi # Check whether --enable-backtrace was given. if test "${enable_backtrace+set}" = set; then : enableval=$enable_backtrace; enable_backtrace=$enableval else enable_backtrace=no fi if test x$enable_debug = xyes; then : $as_echo "#define ENABLE_DEBUG /**/" >>confdefs.h fi if test x$enable_backtrace = xyes; then : $as_echo "#define ENABLE_BACKTRACE /**/" >>confdefs.h fi # Check whether --enable-installed-tests was given. if test "${enable_installed_tests+set}" = set; then : enableval=$enable_installed_tests; installed_tests=$enableval else installed_tests=no fi if test x$installed_tests = xyes; then : $as_echo "#define ENABLE_INSTALLED_TESTS /**/" >>confdefs.h fi if test "x$installed_tests" = xyes; then ENABLE_INSTALLED_TESTS_TRUE= ENABLE_INSTALLED_TESTS_FALSE='#' else ENABLE_INSTALLED_TESTS_TRUE='#' ENABLE_INSTALLED_TESTS_FALSE= fi # Check whether --enable-installed-examples was given. if test "${enable_installed_examples+set}" = set; then : enableval=$enable_installed_examples; enable_installed_examples="$enableval" else enable_installed_examples=$installed_tests fi if test "$enable_installed_examples" = yes; then INSTALL_EXAMPLES_TRUE= INSTALL_EXAMPLES_FALSE='#' else INSTALL_EXAMPLES_TRUE='#' INSTALL_EXAMPLES_FALSE= fi if test x$installed_tests = xyes && test x$enable_installed_examples != xyes; then : as_fn_error $? "examples must be installed when tests are installed." "$LINENO" 5 fi if test "z$ac_srcdir" != z.; then OUT_OF_TREE_BUILD_TRUE= OUT_OF_TREE_BUILD_FALSE='#' else OUT_OF_TREE_BUILD_TRUE='#' OUT_OF_TREE_BUILD_FALSE= fi tpglibtestsdir=${libdir}/telepathy-glib-tests pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36" >&5 $as_echo_n "checking for glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi $as_echo "#define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_36" >>confdefs.h $as_echo "#define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_36" >>confdefs.h pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-unix-2.0" >&5 $as_echo_n "checking for gio-unix-2.0... " >&6; } if test -n "$GIO_UNIX_CFLAGS"; then pkg_cv_GIO_UNIX_CFLAGS="$GIO_UNIX_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_CFLAGS=`$PKG_CONFIG --cflags "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GIO_UNIX_LIBS"; then pkg_cv_GIO_UNIX_LIBS="$GIO_UNIX_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gio-unix-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gio-unix-2.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GIO_UNIX_LIBS=`$PKG_CONFIG --libs "gio-unix-2.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gio-unix-2.0" 2>&1` else GIO_UNIX_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gio-unix-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GIO_UNIX_PKG_ERRORS" >&5 have_gio_unix=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_gio_unix=no else GIO_UNIX_CFLAGS=$pkg_cv_GIO_UNIX_CFLAGS GIO_UNIX_LIBS=$pkg_cv_GIO_UNIX_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_gio_unix=yes fi if test "x$have_gio_unix" = "xyes"; then : $as_echo "#define HAVE_GIO_UNIX /**/" >>confdefs.h GLIB_CFLAGS="$GLIB_CFLAGS $GIO_UNIX_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GIO_UNIX_LIBS" fi GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus-1 >= 0.95, dbus-glib-1 >= 0.90" >&5 $as_echo_n "checking for dbus-1 >= 0.95, dbus-glib-1 >= 0.90... " >&6; } if test -n "$DBUS_CFLAGS"; then pkg_cv_DBUS_CFLAGS="$DBUS_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.95, dbus-glib-1 >= 0.90\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.95, dbus-glib-1 >= 0.90") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-1 >= 0.95, dbus-glib-1 >= 0.90" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$DBUS_LIBS"; then pkg_cv_DBUS_LIBS="$DBUS_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbus-1 >= 0.95, dbus-glib-1 >= 0.90\""; } >&5 ($PKG_CONFIG --exists --print-errors "dbus-1 >= 0.95, dbus-glib-1 >= 0.90") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_DBUS_LIBS=`$PKG_CONFIG --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.90" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then DBUS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.90" 2>&1` else DBUS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dbus-1 >= 0.95, dbus-glib-1 >= 0.90" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DBUS_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (dbus-1 >= 0.95, dbus-glib-1 >= 0.90) were not met: $DBUS_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables DBUS_CFLAGS and DBUS_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else DBUS_CFLAGS=$pkg_cv_DBUS_CFLAGS DBUS_LIBS=$pkg_cv_DBUS_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-vala-bindings was given. if test "${enable_vala_bindings+set}" = set; then : enableval=$enable_vala_bindings; enable_vala_bindings=$enableval else enable_vala_bindings=no fi if test x$enable_vala_bindings = xyes; then : if test "x$INTROSPECTION_SCANNER" = x; then : as_fn_error $? "GObject-Introspection must be enabled for Vala bindings" "$LINENO" 5 fi # Extract the first word of "valac", so it can be a program name with args. set dummy valac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_VALAC+:} false; then : $as_echo_n "(cached) " >&6 else case $VALAC in [\\/]* | ?:[\\/]*) ac_cv_path_VALAC="$VALAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_VALAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_VALAC" && ac_cv_path_VALAC="valac" ;; esac fi VALAC=$ac_cv_path_VALAC if test -n "$VALAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALAC" >&5 $as_echo "$VALAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$VALAC" != valac && test -n "0.16.0"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $VALAC is at least version 0.16.0" >&5 $as_echo_n "checking whether $VALAC is at least version 0.16.0... " >&6; } am__vala_version=`$VALAC --version | sed 's/Vala *//'` as_arg_v1=0.16.0 as_arg_v2="$am__vala_version" awk "$as_awk_strverscmp" v1="$as_arg_v1" v2="$as_arg_v2" /dev/null case $? in #( 1) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; #( 0) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } ;; #( 2) : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } VALAC=valac ;; #( *) : ;; esac fi if test "$VALAC" = valac; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no proper vala compiler found" >&5 $as_echo "$as_me: WARNING: no proper vala compiler found" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: you will not be able to compile vala source files" >&5 $as_echo "$as_me: WARNING: you will not be able to compile vala source files" >&2;} else : fi have_vala=yes # Extract the first word of "valac", so it can be a program name with args. set dummy valac; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_VALAC+:} false; then : $as_echo_n "(cached) " >&6 else case $VALAC in [\\/]* | ?:[\\/]*) ac_cv_path_VALAC="$VALAC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_VALAC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_VALAC" && ac_cv_path_VALAC="valac" ;; esac fi VALAC=$ac_cv_path_VALAC if test -n "$VALAC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALAC" >&5 $as_echo "$VALAC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "vapigen", so it can be a program name with args. set dummy vapigen; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_VAPIGEN+:} false; then : $as_echo_n "(cached) " >&6 else case $VAPIGEN in [\\/]* | ?:[\\/]*) ac_cv_path_VAPIGEN="$VAPIGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_VAPIGEN="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_VAPIGEN" && ac_cv_path_VAPIGEN="false" ;; esac fi VAPIGEN=$ac_cv_path_VAPIGEN if test -n "$VAPIGEN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VAPIGEN" >&5 $as_echo "$VAPIGEN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$VAPIGEN" = "xfalse"; then : as_fn_error $? "vapigen not found. Was vala compiled with --enable-vapigen?" "$LINENO" 5 fi fi if test "x$have_vala" = "xyes"; then HAVE_VALA_TRUE= HAVE_VALA_FALSE='#' else HAVE_VALA_TRUE='#' HAVE_VALA_FALSE= fi TP_GLIB_CFLAGS='-I${top_builddir} -I${top_srcdir}' XSLTPROC= for ac_prog in xsltproc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XSLTPROC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XSLTPROC" && break done if test -z "$XSLTPROC"; then : as_fn_error $? "xsltproc (from the libxslt source package) is required" "$LINENO" 5 fi if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.5" >&5 $as_echo_n "checking whether $PYTHON version is >= 2.5... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.5'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Python interpreter is too old" "$LINENO" 5 fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.5" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.5... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '2.5'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then as_fn_error $? "no suitable Python interpreter found" "$LINENO" 5 else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform # Just factor out some code duplication. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[:3] == '2.7': can_use_sysconfig = 0 except ImportError: pass" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi for ac_func in backtrace backtrace_symbols_fd do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in execinfo.h do : ac_fn_c_check_header_mongrel "$LINENO" "execinfo.h" "ac_cv_header_execinfo_h" "$ac_includes_default" if test "x$ac_cv_header_execinfo_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EXECINFO_H 1 _ACEOF fi done for ac_func in signal do : ac_fn_c_check_func "$LINENO" "signal" "ac_cv_func_signal" if test "x$ac_cv_func_signal" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL 1 _ACEOF fi done for ac_header in signal.h do : ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" if test "x$ac_cv_header_signal_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SIGNAL_H 1 _ACEOF fi done HAVE_LD_VERSION_SCRIPT=no if test -n "$VERSION_SCRIPT_ARG"; then : HAVE_LD_VERSION_SCRIPT=yes fi for ac_prog in nm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 $as_echo "$NM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$NM" && break done if test -z "$NM"; then : HAVE_LD_VERSION_SCRIPT=no fi if test $HAVE_LD_VERSION_SCRIPT = yes; then HAVE_LD_VERSION_SCRIPT_TRUE= HAVE_LD_VERSION_SCRIPT_FALSE='#' else HAVE_LD_VERSION_SCRIPT_TRUE='#' HAVE_LD_VERSION_SCRIPT_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test no = "$hard_links"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$versuffix$shared_ext $libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu _TP_OLD_LIBS="$LIBS" LIBS="$GLIB_LIBS" _TP_OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$GLIB_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { g_object_unref (g_file_new_for_path ("/")); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : tp_cxx_works=yes else tp_cxx_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$_TP_OLD_LIBS" CXXFLAGS="$_TP_OLD_CXXFLAGS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $tp_cxx_works = yes; then HAVE_CXX_TRUE= HAVE_CXX_FALSE='#' else HAVE_CXX_TRUE='#' HAVE_CXX_FALSE= fi ac_config_files="$ac_config_files Makefile docs/Makefile docs/reference/Makefile docs/reference/version.xml examples/Makefile examples/client/Makefile examples/client/js/Makefile examples/client/python/Makefile examples/client/stream-tubes/Makefile examples/client/dbus-tubes/Makefile examples/cm/Makefile examples/cm/call/Makefile examples/cm/channelspecific/Makefile examples/cm/contactlist/Makefile examples/cm/echo-message-parts/Makefile examples/cm/extended/Makefile examples/cm/no-protocols/Makefile examples/extensions/Makefile spec/Makefile telepathy-glib/Makefile telepathy-glib/telepathy-glib.pc telepathy-glib/telepathy-glib-uninstalled.pc telepathy-glib/version.h tests/Makefile tests/lib/Makefile tests/dbus/Makefile tests/tools/Makefile tools/Makefile m4/Makefile vala/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_INTROSPECTION_TRUE}" && test -z "${HAVE_INTROSPECTION_FALSE}"; then as_fn_error $? "conditional \"HAVE_INTROSPECTION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_VERSION_SCRIPT_ARG_TRUE}" && test -z "${HAVE_VERSION_SCRIPT_ARG_FALSE}"; then as_fn_error $? "conditional \"HAVE_VERSION_SCRIPT_ARG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OFFICIAL_RELEASE_TRUE}" && test -z "${OFFICIAL_RELEASE_FALSE}"; then as_fn_error $? "conditional \"OFFICIAL_RELEASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${ENABLE_INSTALLED_TESTS_TRUE}" && test -z "${ENABLE_INSTALLED_TESTS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_INSTALLED_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_EXAMPLES_TRUE}" && test -z "${INSTALL_EXAMPLES_FALSE}"; then as_fn_error $? "conditional \"INSTALL_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${OUT_OF_TREE_BUILD_TRUE}" && test -z "${OUT_OF_TREE_BUILD_FALSE}"; then as_fn_error $? "conditional \"OUT_OF_TREE_BUILD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_VALA_TRUE}" && test -z "${HAVE_VALA_FALSE}"; then as_fn_error $? "conditional \"HAVE_VALA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CXX_TRUE}" && test -z "${HAVE_CXX_FALSE}"; then as_fn_error $? "conditional \"HAVE_CXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by Telepathy-GLib $as_me 0.24.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ Telepathy-GLib config.status 0.24.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/reference/Makefile") CONFIG_FILES="$CONFIG_FILES docs/reference/Makefile" ;; "docs/reference/version.xml") CONFIG_FILES="$CONFIG_FILES docs/reference/version.xml" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "examples/client/Makefile") CONFIG_FILES="$CONFIG_FILES examples/client/Makefile" ;; "examples/client/js/Makefile") CONFIG_FILES="$CONFIG_FILES examples/client/js/Makefile" ;; "examples/client/python/Makefile") CONFIG_FILES="$CONFIG_FILES examples/client/python/Makefile" ;; "examples/client/stream-tubes/Makefile") CONFIG_FILES="$CONFIG_FILES examples/client/stream-tubes/Makefile" ;; "examples/client/dbus-tubes/Makefile") CONFIG_FILES="$CONFIG_FILES examples/client/dbus-tubes/Makefile" ;; "examples/cm/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/Makefile" ;; "examples/cm/call/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/call/Makefile" ;; "examples/cm/channelspecific/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/channelspecific/Makefile" ;; "examples/cm/contactlist/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/contactlist/Makefile" ;; "examples/cm/echo-message-parts/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/echo-message-parts/Makefile" ;; "examples/cm/extended/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/extended/Makefile" ;; "examples/cm/no-protocols/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cm/no-protocols/Makefile" ;; "examples/extensions/Makefile") CONFIG_FILES="$CONFIG_FILES examples/extensions/Makefile" ;; "spec/Makefile") CONFIG_FILES="$CONFIG_FILES spec/Makefile" ;; "telepathy-glib/Makefile") CONFIG_FILES="$CONFIG_FILES telepathy-glib/Makefile" ;; "telepathy-glib/telepathy-glib.pc") CONFIG_FILES="$CONFIG_FILES telepathy-glib/telepathy-glib.pc" ;; "telepathy-glib/telepathy-glib-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES telepathy-glib/telepathy-glib-uninstalled.pc" ;; "telepathy-glib/version.h") CONFIG_FILES="$CONFIG_FILES telepathy-glib/version.h" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/lib/Makefile") CONFIG_FILES="$CONFIG_FILES tests/lib/Makefile" ;; "tests/dbus/Makefile") CONFIG_FILES="$CONFIG_FILES tests/dbus/Makefile" ;; "tests/tools/Makefile") CONFIG_FILES="$CONFIG_FILES tests/tools/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "vala/Makefile") CONFIG_FILES="$CONFIG_FILES vala/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi telepathy-glib-0.24.2/configure.ac0000644000175000017500000002467514006542652013742 00000000000000AC_PREREQ([2.60]) # Making releases: # set the new version number: # odd minor -> development series # even minor -> stable series # increment micro for each release within a series # set nano_version to 0 # make the release, tag it # set nano_version to 1 m4_define([tp_glib_major_version], [0]) m4_define([tp_glib_minor_version], [24]) m4_define([tp_glib_micro_version], [2]) m4_define([tp_glib_nano_version], [0]) # If library source has changed since last release, increment revision # If interfaces have been added, removed or changed since last release, # increment current and set revision to 0 # If interfaces have been added since last release, increment age # If interfaces have been removed since last release, set age to 0 # # If interfaces have been added, release builds will fail unless you add a new # file like telepathy-glib/versions/0.7.3.abi to add them to the official ABI. # This also forces binaries built against devel versions to be rebuilt # (we don't guarantee that we won't add ABI then remove it again, if it was # never seen in a release). m4_define([tp_glib_lt_current], [84]) m4_define([tp_glib_lt_revision], [1]) m4_define([tp_glib_lt_age], [84]) # Some magic m4_define([tp_glib_base_version], [tp_glib_major_version.tp_glib_minor_version.tp_glib_micro_version]) m4_define([tp_glib_version], [m4_if(tp_glib_nano_version, 0, [tp_glib_base_version], [tp_glib_base_version].[tp_glib_nano_version])]) AC_INIT([Telepathy-GLib], [tp_glib_version], [https://bugs.freedesktop.org/enter_bug.cgi?product=Telepathy&component=tp-glib]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([1.11 -Wno-portability subdir-objects]) AC_CONFIG_HEADERS(config.h) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) dnl check for tools AC_PROG_CC AC_PROG_CC_STDC AC_PROG_INSTALL AC_PROG_LIBTOOL AM_PROG_LIBTOOL AC_PROG_MKDIR_P # pkg-config 0.21 adds CFLAGS from Requires.private, which we need PKG_PROG_PKG_CONFIG([0.21]) GTK_DOC_CHECK([1.17],[--flavour no-tmpl]) GOBJECT_INTROSPECTION_CHECK([1.30]) TP_MAJOR_VERSION=tp_glib_major_version TP_MINOR_VERSION=tp_glib_minor_version TP_MICRO_VERSION=tp_glib_micro_version AC_SUBST([TP_MAJOR_VERSION]) AC_SUBST([TP_MINOR_VERSION]) AC_SUBST([TP_MICRO_VERSION]) LT_CURRENT=tp_glib_lt_current LT_REVISION=tp_glib_lt_revision LT_AGE=tp_glib_lt_age AC_SUBST([LT_CURRENT]) AC_SUBST([LT_REVISION]) AC_SUBST([LT_AGE]) dnl optimizations, etc. COMPILER_OPTIMISATIONS COMPILER_COVERAGE LINKER_OPTIMISATIONS LINKER_VERSION_SCRIPT ifelse(tp_glib_nano_version, 0, [ # tp-glib is version x.y.z - "official release", # disable extra checks by default official_release=yes AC_ARG_ENABLE([fatal-warnings], [AC_HELP_STRING([--enable-fatal-warnings], [make various warnings fatal])], [], [enable_fatal_warnings=no]) ], [ # tp-glib is version x.y.z.1 - development snapshot, # enable extra checks by default official_release=no AC_ARG_ENABLE([fatal-warnings], [AC_HELP_STRING([--disable-fatal-warnings], [make various warnings non-fatal])], [], [enable_fatal_warnings=yes]) ]) AC_SUBST([enable_fatal_warnings]) TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$enable_fatal_warnings" = xyes], [all \ extra \ declaration-after-statement \ shadow \ strict-prototypes \ missing-prototypes \ sign-compare \ nested-externs \ pointer-arith \ format-security \ init-self], [missing-field-initializers \ unused-parameter \ deprecated-declarations]) AC_SUBST([ERROR_CFLAGS]) # these aren't really error flags but they serve a similar purpose for us - # making the toolchain stricter AS_IF([test "x$enable_fatal_warnings" = xyes], [ TP_ADD_LINKER_FLAG([ERROR_LDFLAGS], [-Wl,--no-copy-dt-needed-entries]) # --no-copy-dt-needed-entries is the new name for --no-add-needed which # is much more widely supported AS_CASE(["$ERROR_LDFLAGS"], [*-Wl,--no-copy-dt-needed-entries*], [], [*], [TP_ADD_LINKER_FLAG([ERROR_LDFLAGS], [-Wl,--no-add-needed])]) ]) AS_IF([test "x$enable_fatal_warnings" = xyes], [ERROR_SCANNERFLAGS=--warn-error], [ERROR_SCANNERFLAGS=]) AC_SUBST([ERROR_SCANNERFLAGS]) # Only use this where we really do want things to depend on whether it's # a release or not (like ABI-stability enforcement). For fatal warnings, # use ${enable_fatal_warnings} instead. AM_CONDITIONAL([OFFICIAL_RELEASE], [test "x$official_release" = xyes]) AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile without debug code (note that this will disable much of the debug code in all GLib connection managers)]), enable_debug=$enableval, enable_debug=yes ) AC_ARG_ENABLE(debug-cache, AS_HELP_STRING([--enable-debug-cache], [compile with code to unconditionally cache all debug messages whether or not they are actually emitted]), [enable_debug_cache=$enableval], [enable_debug_cache=yes]) AS_IF([test x"$enable_debug_cache" != xno], [AC_DEFINE([ENABLE_DEBUG_CACHE], [1], [Define to enable debug message cache])]) AC_ARG_ENABLE(backtrace, AC_HELP_STRING([--enable-backtrace],[enable printing out the backtrace in case of crash (in most GLib connection managers)]), enable_backtrace=$enableval, enable_backtrace=no ) AS_IF([test x$enable_debug = xyes], [AC_DEFINE([ENABLE_DEBUG], [], [Enable debug code])]) AS_IF([test x$enable_backtrace = xyes], [AC_DEFINE([ENABLE_BACKTRACE], [], [Enable backtrace output on crashes])]) AC_SUBST(COVERAGE_CFLAGS) AC_ARG_ENABLE([installed-tests], AC_HELP_STRING([--enable-installed-tests], [make tests installable]), [installed_tests=$enableval], [installed_tests=no]) AS_IF([test x$installed_tests = xyes], [AC_DEFINE([ENABLE_INSTALLED_TESTS], [], [Make tests installable])]) AM_CONDITIONAL([ENABLE_INSTALLED_TESTS], [test "x$installed_tests" = xyes]) AC_ARG_ENABLE([installed-examples], AC_HELP_STRING([--enable-installed-examples], [install examples as well as the library]), [enable_installed_examples="$enableval"], [enable_installed_examples=$installed_tests]) AM_CONDITIONAL([INSTALL_EXAMPLES], [test "$enable_installed_examples" = yes]) AS_IF( [test x$installed_tests = xyes && test x$enable_installed_examples != xyes], [AC_MSG_ERROR([examples must be installed when tests are installed.])]) dnl docs/Makefile.am needs to know whether it's an out of tree build dnl (srcdir != builddir) AM_CONDITIONAL([OUT_OF_TREE_BUILD], [test "z$ac_srcdir" != z.]) tpglibtestsdir=${libdir}/telepathy-glib-tests AC_SUBST(tpglibtestsdir) dnl Check for Glib PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36, gobject-2.0 >= 2.36, gio-2.0 >= 2.36]) AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_36], [Ignore post 2.36 deprecations]) AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_36], [Prevent post 2.36 APIs]) dnl Check for GIO-Unix PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=yes, have_gio_unix=no) AS_IF([test "x$have_gio_unix" = "xyes"], [AC_DEFINE(HAVE_GIO_UNIX, [], [Define if GIO-Unix is available]) GLIB_CFLAGS="$GLIB_CFLAGS $GIO_UNIX_CFLAGS" GLIB_LIBS="$GLIB_LIBS $GIO_UNIX_LIBS" ]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) dnl Check for D-Bus PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95, dbus-glib-1 >= 0.90]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) AC_ARG_ENABLE(vala-bindings, AC_HELP_STRING([--enable-vala-bindings], [build the EXPERIMENTAL Vala bindings]), enable_vala_bindings=$enableval, enable_vala_bindings=no ) AS_IF([test x$enable_vala_bindings = xyes], [ AS_IF([test "x$INTROSPECTION_SCANNER" = x], [AC_MSG_ERROR([GObject-Introspection must be enabled for Vala bindings])]) AM_PROG_VALAC([0.16.0]) have_vala=yes AC_PATH_PROG(VALAC, valac, valac) AC_SUBST(VALAC) AC_SUBST(VALAFLAGS) AC_PATH_PROG([VAPIGEN], [vapigen], [false]) AS_IF([test "x$VAPIGEN" = "xfalse"], [AC_MSG_ERROR([vapigen not found. Was vala compiled with --enable-vapigen?])]) AC_SUBST(VAPIGEN) ]) AM_CONDITIONAL([HAVE_VALA], [test "x$have_vala" = "xyes"]) AC_SUBST(HAVE_VALA) dnl We want the examples to be able to use TP_GLIB_CFLAGS as though they were dnl independent programs, but subst'ing TP_GLIB_LIBS interferes with dnl dependency tracking TP_GLIB_CFLAGS='-I${top_builddir} -I${top_srcdir}' AC_SUBST(TP_GLIB_CFLAGS) dnl Check for code generation tools XSLTPROC= AC_CHECK_PROGS([XSLTPROC], [xsltproc]) AS_IF([test -z "$XSLTPROC"], [AC_MSG_ERROR([xsltproc (from the libxslt source package) is required])]) AM_PATH_PYTHON([2.5]) dnl glibc backtrace functions AC_CHECK_FUNCS(backtrace backtrace_symbols_fd) AC_CHECK_HEADERS(execinfo.h) dnl signal functions AC_CHECK_FUNCS(signal) AC_CHECK_HEADERS(signal.h) HAVE_LD_VERSION_SCRIPT=no AS_IF([test -n "$VERSION_SCRIPT_ARG"], [HAVE_LD_VERSION_SCRIPT=yes]) AC_CHECK_PROGS([NM], [nm]) AS_IF([test -z "$NM"], [HAVE_LD_VERSION_SCRIPT=no]) AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT], [test $HAVE_LD_VERSION_SCRIPT = yes]) dnl Check for C++ compiler, for syntax checking AC_PROG_CXX AC_LANG_PUSH([C++]) _TP_OLD_LIBS="$LIBS" LIBS="$GLIB_LIBS" _TP_OLD_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$GLIB_CFLAGS" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[g_object_unref (g_file_new_for_path ("/"));]]) ], [tp_cxx_works=yes], [tp_cxx_works=no]) LIBS="$_TP_OLD_LIBS" CXXFLAGS="$_TP_OLD_CXXFLAGS" AC_LANG_POP([C++]) AM_CONDITIONAL([HAVE_CXX], [test $tp_cxx_works = yes]) AC_OUTPUT( Makefile \ docs/Makefile \ docs/reference/Makefile \ docs/reference/version.xml \ examples/Makefile \ examples/client/Makefile \ examples/client/js/Makefile \ examples/client/python/Makefile \ examples/client/stream-tubes/Makefile \ examples/client/dbus-tubes/Makefile \ examples/cm/Makefile \ examples/cm/call/Makefile \ examples/cm/channelspecific/Makefile \ examples/cm/contactlist/Makefile \ examples/cm/echo-message-parts/Makefile \ examples/cm/extended/Makefile \ examples/cm/no-protocols/Makefile \ examples/extensions/Makefile \ spec/Makefile \ telepathy-glib/Makefile \ telepathy-glib/telepathy-glib.pc \ telepathy-glib/telepathy-glib-uninstalled.pc \ telepathy-glib/version.h \ tests/Makefile \ tests/lib/Makefile \ tests/dbus/Makefile \ tests/tools/Makefile \ tools/Makefile \ m4/Makefile \ vala/Makefile ) telepathy-glib-0.24.2/autogen.sh0000755000175000017500000000177214004031760013435 00000000000000#!/bin/sh set -e test -n "$srcdir" || srcdir=`dirname "$0"` test -n "$srcdir" || srcdir=. if test -n "$AUTOMAKE"; then : # don't override an explicit user request elif automake-1.11 --version >/dev/null 2>/dev/null && \ aclocal-1.11 --version >/dev/null 2>/dev/null; then # If we have automake-1.11, use it. This is the oldest version (=> least # likely to introduce undeclared dependencies) that will give us # --enable-silent-rules support. AUTOMAKE=automake-1.11 export AUTOMAKE ACLOCAL=aclocal-1.11 export ACLOCAL fi ( cd "$srcdir" gtkdocize autoreconf -i -f ) # Honor NOCONFIGURE for compatibility with gnome-autogen.sh if test x"$NOCONFIGURE" = x; then run_configure=true for arg in $*; do case $arg in --no-configure) run_configure=false ;; *) ;; esac done else run_configure=false fi if test $run_configure = true; then "$srcdir/configure" "$@" fi telepathy-glib-0.24.2/Makefile.am0000644000175000017500000000337714004033172013472 00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ m4 \ tools \ spec \ telepathy-glib \ $(NULL) if HAVE_INTROSPECTION if HAVE_VALA SUBDIRS += vala endif endif SUBDIRS += \ examples \ tests \ docs \ $(NULL) DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-debug EXTRA_DIST = \ autogen.sh \ gtk-doc.make CLEANFILES = FIXME.out check-local:: egrep -A 5 '[F]IXME|[T]ODO|[X]XX' $(srcdir)/telepathy-glib/*.[ch] \ > FIXME.out || true check-valgrind: $(MAKE) -C tests check-valgrind 2>&1 | tee valgrind.log maintainer-upload-release: _maintainer-upload-release-local _maintainer-upload-release-local: _maintainer-upload-release-check rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX $(builddir)/docs/reference/html/ \ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/doc/telepathy-glib-0.24.x/ BRANCH = $(shell sh tools/git-which-branch.sh misc | tr -d '\n' | tr -C "[:alnum:]" _) UPLOAD_BRANCH_TO = people.freedesktop.org:public_html/telepathy-glib upload-branch-docs: all rsync -rtzvPp --chmod=a+rX docs/reference/html/ \ $(UPLOAD_BRANCH_TO)-$(BRANCH)/ include tools/lcov.am CHANGELOG_RANGE = telepathy-glib-0.14.0.. CHECK_FOR_UNRELEASED = \ $(srcdir)/NEWS \ $(filter-out %/defs.h,$(wildcard $(srcdir)/telepathy-glib/*.[ch])) \ $(NULL) include tools/telepathy.am # Don't just "make distclean", because that would result in forgetting # the options we used when we ran configure. # # However, we do want to distclean in docs (to get rid of xml, html etc.) # and in telepathy-glib (to get rid of any stray files in _gen which might # not exist on the new branch). clean-for-new-branch: $(MAKE) clean $(MAKE) -C docs distclean $(MAKE) -C telepathy-glib distclean $(SHELL) ./config.status --recheck $(SHELL) ./config.status telepathy-glib-0.24.2/Makefile.in0000644000175000017500000010124114006601553013476 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_INTROSPECTION_TRUE@@HAVE_VALA_TRUE@am__append_1 = vala subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = m4 tools spec telepathy-glib vala examples tests docs am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/ltmain.sh \ $(top_srcdir)/build-aux/missing AUTHORS COPYING ChangeLog \ INSTALL NEWS README build-aux/compile build-aux/config.guess \ build-aux/config.sub build-aux/install-sh build-aux/ltmain.sh \ build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = m4 tools spec telepathy-glib $(NULL) $(am__append_1) \ examples tests docs $(NULL) DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-debug EXTRA_DIST = \ autogen.sh \ gtk-doc.make CLEANFILES = FIXME.out BRANCH = $(shell sh tools/git-which-branch.sh misc | tr -d '\n' | tr -C "[:alnum:]" _) UPLOAD_BRANCH_TO = people.freedesktop.org:public_html/telepathy-glib CHANGELOG_RANGE = telepathy-glib-0.14.0.. CHECK_FOR_UNRELEASED = \ $(srcdir)/NEWS \ $(filter-out %/defs.h,$(wildcard $(srcdir)/telepathy-glib/*.[ch])) \ $(NULL) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(srcdir)/tools/lcov.am $(srcdir)/tools/telepathy.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am check-local clean clean-cscope \ clean-generic clean-libtool cscope cscopelist-am ctags \ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ dist-lzip dist-shar dist-tarZ dist-xz dist-zip dist-zstd \ distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile check-local:: egrep -A 5 '[F]IXME|[T]ODO|[X]XX' $(srcdir)/telepathy-glib/*.[ch] \ > FIXME.out || true check-valgrind: $(MAKE) -C tests check-valgrind 2>&1 | tee valgrind.log maintainer-upload-release: _maintainer-upload-release-local _maintainer-upload-release-local: _maintainer-upload-release-check rsync -rvzPp --chmod=Dg+s,ug+rwX,o=rX $(builddir)/docs/reference/html/ \ telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/doc/telepathy-glib-0.24.x/ upload-branch-docs: all rsync -rtzvPp --chmod=a+rX docs/reference/html/ \ $(UPLOAD_BRANCH_TO)-$(BRANCH)/ lcov-reset: lcov --directory @top_srcdir@ --zerocounters lcov-report: lcov --directory @top_srcdir@ --capture \ --output-file @top_builddir@/lcov.info.tmp lcov --directory @top_srcdir@ --output-file @top_builddir@/lcov.info \ --remove @top_builddir@/lcov.info.tmp telepathy-glib-scan.c rm @top_builddir@/lcov.info.tmp $(MKDIR_P) @top_builddir@/lcov.html echo "Coming soon!" > @top_builddir@/lcov.html/index.html git_commit=`GIT_DIR=@top_srcdir@/.git git log -1 --pretty=format:%h 2>/dev/null`;\ genhtml --title "@PACKAGE_STRING@ $$git_commit" \ --output-directory @top_builddir@/lcov.html lcov.info @echo @echo 'lcov report can be found in:' @echo 'file://@abs_top_builddir@/lcov.html/index.html' @echo lcov-check: $(MAKE) lcov-reset $(MAKE) check $(LCOV_CHECK_ARGS) $(MAKE) lcov-report dist-hook: chmod u+w ${distdir}/ChangeLog if test -d ${top_srcdir}/.git; then \ ( cd ${top_srcdir} && git log --date=iso $(CHANGELOG_RANGE) ) > ${distdir}/ChangeLog; \ fi distcheck-hook: @test "z$(CHECK_FOR_UNRELEASED)" = z || \ case @VERSION@ in \ *.*.*.*|*+) ;; \ *) \ if grep -r UNRELEASED $(CHECK_FOR_UNRELEASED); \ then \ echo "^^^ This is meant to be a release, but some files say UNRELEASED" >&2; \ exit 2; \ fi \ ;; \ esac _is-release-check: @case @VERSION@ in \ (*.*.*.*|*+) \ echo "Hey! @VERSION@ is not a release!" >&2; \ exit 2; \ ;; \ esac @cd ${top_srcdir} && \ if ! git diff --no-ext-diff --quiet --exit-code; then \ echo "Hey! Your tree is dirty! No release for you." >&2; \ exit 2; \ fi @cd ${top_srcdir} && \ if ! git diff --cached --no-ext-diff --quiet --exit-code; then \ echo "Hey! You have changes staged! No release for you." >&2; \ exit 2; \ fi @ENABLE_GTK_DOC_FALSE@ @echo "Hey! You need to pass --enable-gtk-doc to configure!" @ENABLE_GTK_DOC_FALSE@ @exit 2; %.tar.gz.asc: %.tar.gz $(AM_V_GEN)gpg --detach-sign --armor $@ @PACKAGE@-@VERSION@.tar.gz: $(MAKE) _is-release-check $(MAKE) check $(MAKE) distcheck maintainer-prepare-release: $(MAKE) _is-release-check $(MAKE) all $(MAKE) distcheck $(MAKE) release-mail cd $(srcdir) && git tag -s @PACKAGE@-@VERSION@ -m @PACKAGE@' '@VERSION@ gpg --detach-sign --armor @PACKAGE@-@VERSION@.tar.gz release-mail: NEWS $(AM_V_GEN)(python $(top_srcdir)/tools/make-release-mail.py \ @PACKAGE@ @VERSION@ $(top_srcdir)/NEWS > $@.tmp && \ mv $@.tmp $@) maintainer-upload-release: _maintainer-upload-release _maintainer-upload-release-check: _is-release-check test -f @PACKAGE@-@VERSION@.tar.gz test -f @PACKAGE@-@VERSION@.tar.gz.asc gpg --verify @PACKAGE@-@VERSION@.tar.gz.asc _maintainer-upload-release: _maintainer-upload-release-check rsync -vzP @PACKAGE@-@VERSION@.tar.gz telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz rsync -vzP @PACKAGE@-@VERSION@.tar.gz.asc telepathy.freedesktop.org:/srv/telepathy.freedesktop.org/www/releases/@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz.asc maintainer-make-release: $(MAKE) maintainer-prepare-release $(MAKE) maintainer-upload-release @echo "Now:" @echo " • bump the nano-version;" @echo " • push the branch and tags upstream; and" @echo " • send release-mail to ." # Don't just "make distclean", because that would result in forgetting # the options we used when we ran configure. # # However, we do want to distclean in docs (to get rid of xml, html etc.) # and in telepathy-glib (to get rid of any stray files in _gen which might # not exist on the new branch). clean-for-new-branch: $(MAKE) clean $(MAKE) -C docs distclean $(MAKE) -C telepathy-glib distclean $(SHELL) ./config.status --recheck $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/config.h.in0000644000175000017500000000463514006601552013464 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Enable backtrace output on crashes */ #undef ENABLE_BACKTRACE /* Enable debug code */ #undef ENABLE_DEBUG /* Define to enable debug message cache */ #undef ENABLE_DEBUG_CACHE /* Make tests installable */ #undef ENABLE_INSTALLED_TESTS /* Prevent post 2.36 APIs */ #undef GLIB_VERSION_MAX_ALLOWED /* Ignore post 2.36 deprecations */ #undef GLIB_VERSION_MIN_REQUIRED /* Define to 1 if you have the `backtrace' function. */ #undef HAVE_BACKTRACE /* Define to 1 if you have the `backtrace_symbols_fd' function. */ #undef HAVE_BACKTRACE_SYMBOLS_FD /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_EXECINFO_H /* Define if GIO-Unix is available */ #undef HAVE_GIO_UNIX /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `signal' function. */ #undef HAVE_SIGNAL /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION telepathy-glib-0.24.2/telepathy-glib/0000755000175000017500000000000014006623342014424 500000000000000telepathy-glib-0.24.2/telepathy-glib/room-info-internal.h0000644000175000017500000000202212652510705020233 00000000000000/**/ /* * room-info-internal.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #ifndef __TP_ROOM_INFO_INTERNAL_H__ #define __TP_ROOM_INFO_INTERNAL_H__ TpRoomInfo * _tp_room_info_new (GValueArray *dbus_struct); #endif telepathy-glib-0.24.2/telepathy-glib/exportable-channel.c0000644000175000017500000001454012652510705020272 00000000000000/* * exportable-channel.c - A channel usable with the Channel Manager * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:exportable-channel * @title: TpExportableChannel * @short_description: interface representing channels with several standard * properties * @see_also: #TpChannelIface, #TpChannelManager, #TpSvcChannel * * This interface defines a set of channel properties on top of those of * #TpChannelIface. It's mainly used by #TpChannelManager to represent the * returned and managed channel objects. */ /** * TpExportableChannel: * * Opaque typedef representing a channel with several standard properties. */ /** * TpExportableChannelFunc: * @channel: An object implementing the exportable channel interface * @user_data: Arbitrary user-supplied data * * A callback for functions which act on exportable channels. */ /** * TpExportableChannelIface: * @parent: The parent interface * * The interface for #TpExportableChannel objects. */ #include "config.h" #include "exportable-channel.h" #include #include #include static void exportable_channel_base_init (gpointer klass) { static gboolean initialized = FALSE; if (!initialized) { GParamSpec *param_spec; initialized = TRUE; /** * TpExportableChannel:object-path: * * The D-Bus object path used for this object on the bus. Read-only * except during construction. */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); /** * TpExportableChannel:channel-properties: * * The D-Bus properties to be announced in the NewChannels signal * and in the Channels property, as a map from * interface.name.propertyname to GValue. * * A channel's immutable properties are constant for its lifetime on the * bus, so this property should only change when the closed signal is * emitted (so that respawned channels can reappear on the bus with * different properties). All of the D-Bus properties mentioned here * should be exposed through the D-Bus properties interface; additional * (possibly mutable) properties not included here may also be exposed * via the D-Bus properties interface. * * If the channel implementation uses * TpDBusPropertiesMixin, * this property can implemented using * tp_dbus_properties_mixin_make_properties_hash() as follows: * * * case PROP_CHANNEL_PROPERTIES: * g_value_take_boxed (value, * tp_dbus_properties_mixin_make_properties_hash (object, * // The spec says these properties MUST be included: * TP_IFACE_CHANNEL, "TargetHandle", * TP_IFACE_CHANNEL, "TargetHandleType", * TP_IFACE_CHANNEL, "ChannelType", * TP_IFACE_CHANNEL, "TargetID", * TP_IFACE_CHANNEL, "Requested", * // These aren't mandatory as of spec 0.17.17 * // (but they should be): * TP_IFACE_CHANNEL, "InitiatorHandle", * TP_IFACE_CHANNEL, "InitiatorID", * TP_IFACE_CHANNEL, "Interfaces", * // Perhaps your channel has some other immutable properties: * TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", * // etc. * NULL)); * break; * */ param_spec = g_param_spec_boxed ("channel-properties", "Channel properties", "The channel properties", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); /** * TpExportableChannel:channel-destroyed: * * If true, the closed signal on the Channel interface indicates that * the channel can go away. * * If false, the closed signal indicates to the channel manager that the * channel should appear to go away and be re-created, by emitting Closed * followed by NewChannel. (This is to support the "respawning" of Text * channels which are closed with unacknowledged messages.) */ param_spec = g_param_spec_boolean ("channel-destroyed", "Destroyed?", "If true, the channel has *really* closed, rather than just " "appearing to do so", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); } } GType tp_exportable_channel_get_type (void) { static GType type = 0; if (G_UNLIKELY (type == 0)) { static const GTypeInfo info = { sizeof (TpExportableChannelIface), exportable_channel_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, 0, /* n_preallocs */ NULL /* instance_init */ }; type = g_type_register_static (G_TYPE_INTERFACE, "TpExportableChannel", &info, 0); g_type_interface_add_prerequisite (type, TP_TYPE_SVC_CHANNEL); } return type; } telepathy-glib-0.24.2/telepathy-glib/exportable-channel.h0000644000175000017500000000400312652510705020270 00000000000000/* * exportable-channel.h - A channel usable with the Channel Manager * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_EXPORTABLE_CHANNEL_H #define TP_EXPORTABLE_CHANNEL_H #include G_BEGIN_DECLS #define TP_TYPE_EXPORTABLE_CHANNEL (tp_exportable_channel_get_type ()) #define TP_EXPORTABLE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_EXPORTABLE_CHANNEL, TpExportableChannel)) #define TP_IS_EXPORTABLE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_EXPORTABLE_CHANNEL)) #define TP_EXPORTABLE_CHANNEL_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_EXPORTABLE_CHANNEL, TpExportableChannelIface)) typedef struct _TpExportableChannel TpExportableChannel; typedef struct _TpExportableChannelIface TpExportableChannelIface; typedef void (*TpExportableChannelFunc) (TpExportableChannel *channel, gpointer user_data); struct _TpExportableChannelIface { GTypeInterface parent; }; GType tp_exportable_channel_get_type (void); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/intset.c0000644000175000017500000005550712652510705016035 00000000000000/* intset.c - Source for a set of unsigned integers (implemented as a * variable length bitfield) * * Copyright © 2005-2010 Collabora Ltd. * Copyright © 2005-2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ /** * SECTION:intset * @title: TpIntset * @short_description: a set of unsigned integers * @see_also: #TpHandleSet * * A #TpIntset is a set of unsigned integers, implemented as a * dynamically-allocated sparse bitfield. */ #include "config.h" #include #include #include #include /* On platforms with 64-bit pointers we could pack 64 bits into the values, * if count_bits32() is replaced with a 64-bit version. This doesn't work * yet. */ #undef USE_64_BITS #ifdef USE_64_BITS # define BITFIELD_BITS 64 # define BITFIELD_LOG2_BITS 6 #else # define BITFIELD_BITS 32 # define BITFIELD_LOG2_BITS 5 #endif G_STATIC_ASSERT (1 << BITFIELD_LOG2_BITS == BITFIELD_BITS); G_STATIC_ASSERT (sizeof (gpointer) >= sizeof (gsize)); #define LOW_MASK (BITFIELD_BITS - 1) #define HIGH_PART(x) (x & ~LOW_MASK) #define LOW_PART(x) (x & LOW_MASK) /** * TP_TYPE_INTSET: * * The boxed type of a #TpIntset. * * Since: 0.11.3 */ GType tp_intset_get_type (void) { static GType type = 0; if (G_UNLIKELY (type == 0)) { /* The "TpIntSet" type has to be registered for backwards compatibility. * The canonical name of the type is now "TpIntset"; see fdo#30134. */ g_boxed_type_register_static (g_intern_static_string ("TpIntSet"), (GBoxedCopyFunc) tp_intset_copy, (GBoxedFreeFunc) tp_intset_destroy); type = g_boxed_type_register_static (g_intern_static_string ("TpIntset"), (GBoxedCopyFunc) tp_intset_copy, (GBoxedFreeFunc) tp_intset_destroy); } return type; } /** * TpIntFunc: * @i: The relevant integer * @userdata: Opaque user data * * A callback function acting on unsigned integers. */ /* (typedef, see header) */ /** * TpIntSetIter: (skip) * * Before 0.11.16, this was the name for TpIntsetIter, but * it's now just a backwards compatibility typedef. * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ /** * TpIntsetIter: * @set: The set iterated over. * @element: Must be (guint)(-1) before iteration starts. Set to the next * element in the set by tp_intset_iter_next(); undefined after * tp_intset_iter_next() returns %FALSE. * * A structure representing iteration over a set of integers. Must be * initialized with either TP_INTSET_ITER_INIT() or tp_intset_iter_init(). * * Since 0.11.6, consider using #TpIntsetFastIter if iteration in * numerical order is not required. * * Before 0.11.16, this type was called TpIntSetIter, * which is now a backwards compatibility typedef. * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ /* (public, see header) */ /** * TP_INTSET_ITER_INIT: * @set: A set of integers * * A suitable static initializer for a #TpIntsetIter, to be used as follows: * * * void * do_something (const TpIntset *intset) * { * TpIntsetIter iter = TP_INTSET_ITER_INIT (intset); * /* ... do something with iter ... */ * } * * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ /* (macro, see header) */ /** * tp_intset_iter_init: * @iter: An integer set iterator to be initialized. * @set: An integer set to be used by that iterator * * Reset the iterator @iter to the beginning and make it iterate over @set. * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ void tp_intset_iter_init ( TpIntsetIter *iter, const TpIntset *set) { g_return_if_fail (iter != NULL); iter->set = set; iter->element = (guint)(-1); } /** * tp_intset_iter_reset: * @iter: An integer set iterator to be reset. * * Reset the iterator @iter to the beginning. It must already be associated * with a set. * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ void tp_intset_iter_reset (TpIntsetIter *iter) { g_return_if_fail (iter != NULL); g_return_if_fail (iter->set != NULL); iter->element = (guint)(-1); } /** * TpIntset: * * Opaque type representing a set of unsigned integers. * * Before 0.11.16, this type was called TpIntSet, which is * now a backwards compatibility typedef. */ struct _TpIntset { /* HIGH_PART(n) => bitfield where bit LOW_PART(n) is set if n is present. * * For instance, when using 32-bit values, the set { 5, 23 } is represented * by the map { 0 => (1 << 23 | 1 << 5) }, and the set { 1, 32, 42 } is * represented by the map { 0 => (1 << 1), 32 => (1 << 10 | 1 << 0) }. */ GHashTable *table; guint largest_ever; }; /* * Update @set's largest_ever member to be at least as large as everything * that could be encoded in the hash table key @key. * * We could use g_bit_nth_msf (value, BITFIELD_BITS) instead of LOW_MASK if we * wanted to get largest_ever exactly right, but we just need something * reasonable to make TpIntsetIter terminate early, and carrying on for up to * BITFIELD_BITS extra iterations isn't a problem. */ static inline void intset_update_largest_ever (TpIntset *set, gpointer key) { guint upper_bound = GPOINTER_TO_UINT (key) | LOW_MASK; if (set->largest_ever < upper_bound) set->largest_ever = upper_bound; } /** * tp_intset_sized_new: * @size: ignored (it was previously 1 more than the largest integer you * expect to store) * * Allocate a new integer set. * * Returns: a new, empty integer set to be destroyed with tp_intset_destroy() */ TpIntset * tp_intset_sized_new (guint size G_GNUC_UNUSED) { return tp_intset_new (); } /** * tp_intset_new: * * Allocate a new integer set. * * Returns: a new, empty integer set to be destroyed with tp_intset_destroy() */ TpIntset * tp_intset_new () { TpIntset *set = g_slice_new (TpIntset); set->table = g_hash_table_new (NULL, NULL); set->largest_ever = 0; return set; } /** * tp_intset_new_containing: * @element: integer to add to a new set * * Allocate a new integer set containing the given integer. * * Returns: a new integer set containing @element, to be destroyed with * tp_intset_destroy() * * Since: 0.7.26 */ TpIntset * tp_intset_new_containing (guint element) { TpIntset *ret = tp_intset_new (); tp_intset_add (ret, element); return ret; } /** * tp_intset_destroy: * @set: set * * Free all memory used by the set. */ void tp_intset_destroy (TpIntset *set) { g_return_if_fail (set != NULL); g_hash_table_unref (set->table); g_slice_free (TpIntset, set); } /** * tp_intset_clear: * @set: set * * Unset every integer in the set. */ void tp_intset_clear (TpIntset *set) { g_return_if_fail (set != NULL); g_hash_table_remove_all (set->table); } /** * tp_intset_add: * @set: set * @element: integer to add * * Add an integer into a TpIntset. */ void tp_intset_add (TpIntset *set, guint element) { gpointer key = GSIZE_TO_POINTER ((gsize) HIGH_PART (element)); gsize bit = LOW_PART (element); gpointer old_value, new_value; g_return_if_fail (set != NULL); old_value = g_hash_table_lookup (set->table, key); new_value = GSIZE_TO_POINTER (GPOINTER_TO_SIZE (old_value) | (1 << bit)); if (old_value != new_value) g_hash_table_insert (set->table, key, new_value); if (element > set->largest_ever) set->largest_ever = element; } /** * tp_intset_remove: * @set: set * @element: integer to add * * Remove an integer from a TpIntset * * Returns: %TRUE if @element was previously in @set */ gboolean tp_intset_remove (TpIntset *set, guint element) { gpointer key = GSIZE_TO_POINTER ((gsize) HIGH_PART (element)); gsize bit = LOW_PART (element); gpointer old_value, new_value; g_return_val_if_fail (set != NULL, FALSE); old_value = g_hash_table_lookup (set->table, key); new_value = GSIZE_TO_POINTER (GPOINTER_TO_SIZE (old_value) & ~ (1 << bit)); if (old_value != new_value) { if (new_value == NULL) g_hash_table_remove (set->table, key); else g_hash_table_insert (set->table, key, new_value); return TRUE; } return FALSE; } static inline gboolean _tp_intset_is_member (const TpIntset *set, guint element) { gpointer key = GSIZE_TO_POINTER ((gsize) HIGH_PART (element)); gsize bit = LOW_PART (element); gpointer value; value = g_hash_table_lookup (set->table, key); return ((GPOINTER_TO_SIZE (value) & (1 << bit)) != 0); } /** * tp_intset_is_member: * @set: set * @element: integer to test * * Tests if @element is a member of @set * * Returns: %TRUE if @element is in @set */ gboolean tp_intset_is_member (const TpIntset *set, guint element) { g_return_val_if_fail (set != NULL, FALSE); return _tp_intset_is_member (set, element); } /** * tp_intset_foreach: * @set: set * @func: (scope call): @TpIntFunc to use to iterate the set * @userdata: user data to pass to each call of @func * * Call @func(element, @userdata) for each element of @set, in order. */ void tp_intset_foreach (const TpIntset *set, TpIntFunc func, gpointer userdata) { gsize high_part, low_part; g_return_if_fail (set != NULL); g_return_if_fail (func != NULL); for (high_part = 0; high_part <= set->largest_ever; high_part += BITFIELD_BITS) { gsize entry = GPOINTER_TO_SIZE (g_hash_table_lookup (set->table, GSIZE_TO_POINTER (high_part))); if (entry == 0) continue; for (low_part = 0; low_part < BITFIELD_BITS; low_part++) { if (entry & (1 << low_part)) { func (high_part + low_part, userdata); } } } } static void addint (guint i, gpointer data) { GArray *array = (GArray *) data; g_array_append_val (array, i); } /** * tp_intset_to_array: * @set: set to convert * * * * Returns: (element-type uint) (transfer full): a GArray of guint (which must * be freed by the caller) containing the same integers as @set. */ GArray * tp_intset_to_array (const TpIntset *set) { GArray *array; g_return_val_if_fail (set != NULL, NULL); array = g_array_new (FALSE, TRUE, sizeof (guint)); tp_intset_foreach (set, addint, array); return array; } /** * tp_intset_from_array: * @array: (element-type uint): An array of guint * * * * Returns: A set containing the same integers as @array. */ TpIntset * tp_intset_from_array (const GArray *array) { TpIntset *set; guint i; g_return_val_if_fail (array != NULL, NULL); set = tp_intset_new (); for (i = 0; i < array->len; i++) { tp_intset_add (set, g_array_index (array, guint, i)); } return set; } /* these magic numbers would need adjusting for 64-bit storage */ G_STATIC_ASSERT (BITFIELD_BITS == 32); static inline guint count_bits32 (guint32 n) { n = n - ((n >> 1) & 033333333333) - ((n >> 2) & 011111111111); return ((n + (n >> 3)) & 030707070707) % 63; } /** * tp_intset_size: * @set: A set of integers * * * * Returns: The number of integers in @set */ guint tp_intset_size (const TpIntset *set) { guint count = 0; gpointer entry; GHashTableIter iter; g_return_val_if_fail (set != NULL, 0); g_hash_table_iter_init (&iter, (GHashTable *) set->table); while (g_hash_table_iter_next (&iter, NULL, &entry)) { count += count_bits32 (GPOINTER_TO_SIZE (entry)); } return count; } /** * tp_intset_is_empty: * @set: a set of integers * * Return the same thing as (tp_intset_size (set) == 0), * but calculated more efficiently. * * Returns: %TRUE if @set is empty * * Since: 0.11.6 */ gboolean tp_intset_is_empty (const TpIntset *set) { g_return_val_if_fail (set != NULL, TRUE); return (g_hash_table_size (set->table) == 0); } /** * tp_intset_is_equal: * @left: A set of integers * @right: A set of integers * * * * Returns: %TRUE if @left and @right contain the same bits */ gboolean tp_intset_is_equal (const TpIntset *left, const TpIntset *right) { gpointer key, value; GHashTableIter iter; g_return_val_if_fail (left != NULL, FALSE); g_return_val_if_fail (right != NULL, FALSE); if (g_hash_table_size (left->table) != g_hash_table_size (right->table)) return FALSE; g_hash_table_iter_init (&iter, (GHashTable *) left->table); while (g_hash_table_iter_next (&iter, &key, &value)) { if (g_hash_table_lookup (right->table, key) != value) { return FALSE; } } return TRUE; } /** * tp_intset_copy: * @orig: A set of integers * * * * Returns: A set containing the same integers as @orig, to be freed with * tp_intset_destroy() by the caller */ TpIntset * tp_intset_copy (const TpIntset *orig) { gpointer key, value; GHashTableIter iter; TpIntset *ret; g_return_val_if_fail (orig != NULL, NULL); ret = tp_intset_new (); g_hash_table_iter_init (&iter, (GHashTable *) orig->table); while (g_hash_table_iter_next (&iter, &key, &value)) { intset_update_largest_ever (ret, key); g_hash_table_insert (ret->table, key, value); } return ret; } /** * tp_intset_intersection: * @left: The left operand * @right: The right operand * * * * Returns: The set of those integers which are in both @left and @right * (analogous to the bitwise operation left & right), to be freed with * tp_intset_destroy() by the caller */ TpIntset * tp_intset_intersection (const TpIntset *left, const TpIntset *right) { gpointer key, value; GHashTableIter iter; TpIntset *ret; ret = tp_intset_new (); g_hash_table_iter_init (&iter, (GHashTable *) left->table); while (g_hash_table_iter_next (&iter, &key, &value)) { gsize v = GPOINTER_TO_SIZE (value); v &= GPOINTER_TO_SIZE (g_hash_table_lookup (right->table, key)); if (v != 0) { intset_update_largest_ever (ret, key); g_hash_table_insert (ret->table, key, GSIZE_TO_POINTER (v)); } } return ret; } /** * tp_intset_union: * @left: The left operand * @right: The right operand * * * * Returns: The set of those integers which are in either @left or @right * (analogous to the bitwise operation left | right), to be freed with * tp_intset_destroy() by the caller */ TpIntset * tp_intset_union (const TpIntset *left, const TpIntset *right) { TpIntset *ret; ret = tp_intset_copy (left); tp_intset_union_update (ret, right); return ret; } /** * tp_intset_union_update: * @self: the set to change * @other: members to add * * Add each integer in @other to @self, analogous to the bitwise operation * self |= other. * * Since: 0.13.10 */ void tp_intset_union_update (TpIntset *self, const TpIntset *other) { gpointer key, value; GHashTableIter iter; g_hash_table_iter_init (&iter, (GHashTable *) other->table); while (g_hash_table_iter_next (&iter, &key, &value)) { gsize v = GPOINTER_TO_SIZE (value); intset_update_largest_ever (self, key); v |= GPOINTER_TO_SIZE (g_hash_table_lookup (self->table, key)); g_hash_table_insert (self->table, key, GSIZE_TO_POINTER (v)); } } /** * tp_intset_difference: * @left: The left operand * @right: The right operand * * * * Returns: The set of those integers which are in @left and not in @right * (analogous to the bitwise operation left & (~right)), to be freed with * tp_intset_destroy() by the caller */ TpIntset * tp_intset_difference (const TpIntset *left, const TpIntset *right) { TpIntset *ret; g_return_val_if_fail (left != NULL, NULL); g_return_val_if_fail (right != NULL, NULL); ret = tp_intset_copy (left); tp_intset_difference_update (ret, right); return ret; } /** * tp_intset_difference_update: * @self: the set to change * @other: members to remove * * Remove each integer in @other from @self, analogous to the bitwise * operation self &= (~other). * * Since: 0.13.10 */ void tp_intset_difference_update (TpIntset *self, const TpIntset *other) { gpointer key, value; GHashTableIter iter; g_hash_table_iter_init (&iter, (GHashTable *) other->table); while (g_hash_table_iter_next (&iter, &key, &value)) { gsize v = GPOINTER_TO_SIZE (value); v = (GPOINTER_TO_SIZE (g_hash_table_lookup (self->table, key))) & ~v; /* No need to update largest_ever here - we're only deleting members. */ if (v == 0) g_hash_table_remove (self->table, key); else g_hash_table_insert (self->table, key, GSIZE_TO_POINTER (v)); } } /** * tp_intset_symmetric_difference: * @left: The left operand * @right: The right operand * * * * Returns: The set of those integers which are in either @left or @right * but not both (analogous to the bitwise operation left ^ right), to be freed * with tp_intset_destroy() by the caller */ TpIntset * tp_intset_symmetric_difference (const TpIntset *left, const TpIntset *right) { TpIntset *ret; gpointer key, value; GHashTableIter iter; g_return_val_if_fail (left != NULL, NULL); g_return_val_if_fail (right != NULL, NULL); ret = tp_intset_copy (left); g_hash_table_iter_init (&iter, (GHashTable *) right->table); while (g_hash_table_iter_next (&iter, &key, &value)) { gsize v = GPOINTER_TO_SIZE (value); v = v ^ GPOINTER_TO_SIZE (g_hash_table_lookup (ret->table, key)); /* No need to update largest_ever here - we're only deleting members. */ if (v == 0) g_hash_table_remove (ret->table, key); else g_hash_table_insert (ret->table, key, GSIZE_TO_POINTER (v)); } return ret; } static void _dump_foreach (guint i, gpointer data) { GString *tmp = (GString *) data; if (tmp->len == 0) g_string_append_printf (tmp, "%u", i); else g_string_append_printf (tmp, " %u", i); } /** * tp_intset_dump: * @set: An integer set * * * * Returns: a string which the caller must free with g_free, listing the * numbers in @set in a human-readable format */ gchar * tp_intset_dump (const TpIntset *set) { GString *tmp = g_string_new (""); tp_intset_foreach (set, _dump_foreach, tmp); return g_string_free (tmp, FALSE); } /** * tp_intset_iter_next: * @iter: An iterator originally initialized with TP_INTSET_INIT(set) * * If there are integers in (@iter->set) higher than (@iter->element), set * (iter->element) to the next one and return %TRUE. Otherwise return %FALSE. * * Usage: * * * TpIntsetIter iter = TP_INTSET_INIT (intset); * while (tp_intset_iter_next (&iter)) * { * printf ("%u is in the intset\n", iter.element); * } * * * Since 0.11.6, consider using #TpIntsetFastIter if iteration in * numerical order is not required. * * Returns: %TRUE if (@iter->element) has been advanced */ gboolean tp_intset_iter_next (TpIntsetIter *iter) { g_return_val_if_fail (iter != NULL, FALSE); g_return_val_if_fail (iter->set != NULL, FALSE); do { if (iter->element == (guint)(-1)) { /* only just started */ iter->element = 0; } else { ++iter->element; } if (_tp_intset_is_member (iter->set, iter->element)) { return TRUE; } } while (iter->element < iter->set->largest_ever && iter->element != (guint)(-1)); return FALSE; } /** * TpIntSetFastIter: (skip) * * Before 0.11.16, this was the name for TpIntsetFastIter, * but it's now just a backwards compatibility typedef. * * Deprecated: since 0.19.0. Use #TpIntsetFastIter instead */ /** * TpIntsetFastIter: * * An opaque structure representing iteration in undefined order over a set of * integers. Must be initialized with tp_intset_fast_iter_init(). * * Before 0.11.16, this type was called TpIntSetFastIter, * which is now a backwards compatibility typedef. * * Usage is similar to #GHashTableIter: * * * TpIntsetFastIter iter; * guint element; * * tp_intset_fast_iter_init (&iter, intset); * * while (tp_intset_fast_iter_next (&iter, &element)) * { * printf ("%u is in the intset\n", element); * } * * * Since: 0.11.6 */ typedef struct { GHashTableIter hash_iter; gboolean ok; gsize high_part; gsize bitfield; } RealFastIter; G_STATIC_ASSERT (sizeof (TpIntsetFastIter) >= sizeof (RealFastIter)); /** * tp_intset_fast_iter_init: * @iter: an iterator * @set: a set * * Initialize @iter to iterate over @set in arbitrary order. @iter will become * invalid if @set is modified. * * Since: 0.11.6 */ void tp_intset_fast_iter_init (TpIntsetFastIter *iter, const TpIntset *set) { RealFastIter *real = (RealFastIter *) iter; g_return_if_fail (set != NULL); g_return_if_fail (set->table != NULL); g_hash_table_iter_init (&real->hash_iter, (GHashTable *) set->table); real->bitfield = 0; real->high_part = 0; real->ok = TRUE; } /** * tp_intset_fast_iter_next: * @iter: an iterator * @output: a location to store a new integer, in arbitrary order * * Advances @iter and retrieves the integer it now points to. Iteration * is not necessarily in numerical order. * * Returns: %FALSE if the end of the set has been reached * * Since: 0.11.6 */ gboolean tp_intset_fast_iter_next (TpIntsetFastIter *iter, guint *output) { RealFastIter *real = (RealFastIter *) iter; guint low_part; if (!real->ok) return FALSE; if (real->bitfield == 0) { gpointer k, v; real->ok = g_hash_table_iter_next (&real->hash_iter, &k, &v); if (!real->ok) return FALSE; real->high_part = GPOINTER_TO_SIZE (k); real->bitfield = GPOINTER_TO_SIZE (v); g_assert (real->bitfield != 0); } for (low_part = 0; low_part < BITFIELD_BITS; low_part++) { if (real->bitfield & (1 << low_part)) { /* clear the bit so we won't return it again */ real->bitfield -= (1 << low_part); if (output != NULL) *output = real->high_part | low_part; return TRUE; } } g_assert_not_reached (); } telepathy-glib-0.24.2/telepathy-glib/intset.h0000644000175000017500000001040712652510705016030 00000000000000/* tp-intset.h - Headers for a Glib-link set of integers * * Copyright © 2005-2010 Collabora Ltd. * Copyright © 2005-2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_INTSET_H__ #define __TP_INTSET_H__ #include #include G_BEGIN_DECLS #define TP_TYPE_INTSET (tp_intset_get_type ()) GType tp_intset_get_type (void); typedef struct _TpIntset TpIntset; #ifndef TP_DISABLE_DEPRECATED /* See fdo#30134 for the reasoning behind the rename of TpIntSet to TpIntset */ /** * TpIntSet: (skip) * * Before 0.11.16, this was the name for TpIntset, but it's * now just a backwards compatibility typedef. */ typedef TpIntset TpIntSet; #endif typedef void (*TpIntFunc) (guint i, gpointer userdata); TpIntset *tp_intset_new (void) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_sized_new (guint size) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_new_containing (guint element) G_GNUC_WARN_UNUSED_RESULT; void tp_intset_destroy (TpIntset *set); void tp_intset_clear (TpIntset *set); void tp_intset_add (TpIntset *set, guint element); gboolean tp_intset_remove (TpIntset *set, guint element); gboolean tp_intset_is_member (const TpIntset *set, guint element) G_GNUC_WARN_UNUSED_RESULT; void tp_intset_foreach (const TpIntset *set, TpIntFunc func, gpointer userdata); GArray *tp_intset_to_array (const TpIntset *set) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_from_array (const GArray *array) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_intset_is_empty (const TpIntset *set) G_GNUC_WARN_UNUSED_RESULT; guint tp_intset_size (const TpIntset *set) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_intset_is_equal (const TpIntset *left, const TpIntset *right) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_copy (const TpIntset *orig) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_intersection (const TpIntset *left, const TpIntset *right) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_union (const TpIntset *left, const TpIntset *right) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_difference (const TpIntset *left, const TpIntset *right) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_intset_symmetric_difference (const TpIntset *left, const TpIntset *right) G_GNUC_WARN_UNUSED_RESULT; gchar *tp_intset_dump (const TpIntset *set) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED typedef struct { const TpIntset *set; guint element; } TpIntsetIter; typedef TpIntsetIter TpIntSetIter; #define TP_INTSET_ITER_INIT(set) { (set), (guint)(-1) } _TP_DEPRECATED_IN_0_20_FOR (tp_intset_fast_iter_init) void tp_intset_iter_init (TpIntsetIter *iter, const TpIntset *set); _TP_DEPRECATED_IN_0_20_FOR (tp_intset_fast_iter_init) void tp_intset_iter_reset (TpIntsetIter *iter); _TP_DEPRECATED_IN_0_20_FOR (tp_intset_fast_iter_next) gboolean tp_intset_iter_next (TpIntsetIter *iter); #endif typedef struct { /**/ gpointer _dummy[16]; } TpIntsetFastIter; #ifndef TP_DISABLE_DEPRECATED typedef TpIntsetFastIter TpIntSetFastIter; #endif void tp_intset_fast_iter_init (TpIntsetFastIter *iter, const TpIntset *set); gboolean tp_intset_fast_iter_next (TpIntsetFastIter *iter, guint *output); void tp_intset_union_update (TpIntset *self, const TpIntset *other); void tp_intset_difference_update (TpIntset *self, const TpIntset *other); G_END_DECLS #endif /*__TP_INTSET_H__*/ telepathy-glib-0.24.2/telepathy-glib/media-session-handler.xml0000644000175000017500000000036112652510705021244 00000000000000 Media session handler telepathy-glib-0.24.2/telepathy-glib/debug.c0000644000175000017500000003356112652510705015611 00000000000000/* * debug.c - Common debug support * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:debug * @title: Common debug support * @short_description: API to activate debugging messages from telepathy-glib * * telepathy-glib has an internal mechanism for debug messages and filtering. * Connection managers written with telepathy-glib are expected to connect * this to their own debugging mechanisms: when the CM's debugging mechanism * is activated, it should call tp_debug_set_flags() and/or * tp_debug_set_persistent(). * * The supported debug-mode keywords and the debug messages that they enable * are subject to change, but currently include: * * * misc - low-level utility code * manager - * #TpConnectionManager (client) * connection - #TpBaseConnection (service) * and #TpConnection (client) * contacts - #TpContact objects * (client) * channel - #TpChannel (client) * im - (text) instant messaging * (service) * properties - * TpDBusPropertiesMixin and #TpPropertiesMixin (service) * params - connection manager parameters * (service) * handles - handle reference tracking tracking * in #TpBaseConnection (service) and #TpConnection (client) * accounts - the #TpAccountManager and * #TpAccount objects (client) * contact-lists - the #TpBaseContactList * (service) * debugger - #TpDebugClient objects * tls - #TpTLSCertificate objects * (client) * all - all of the above * */ #include "config.h" #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #define DEBUG_FLAG TP_DEBUG_MISC #include "debug-internal.h" static TpDebugFlags flags = 0; static gboolean tp_debug_persistent = FALSE; /** * tp_debug_set_all_flags: (skip) * * Activate all possible debug modes. This also activates persistent mode, * which should have been orthogonal. * * Deprecated: since 0.6.1. Use tp_debug_set_flags ("all") and * tp_debug_set_persistent() instead. */ void tp_debug_set_all_flags (void) { flags = 0xffff; tp_debug_persistent = TRUE; } static GDebugKey keys[] = { { "misc", TP_DEBUG_MISC }, { "groups", TP_DEBUG_GROUPS }, { "properties", TP_DEBUG_PROPERTIES }, { "connection", TP_DEBUG_CONNECTION }, { "im", TP_DEBUG_IM }, { "params", TP_DEBUG_PARAMS }, { "presence", TP_DEBUG_PRESENCE }, { "manager", TP_DEBUG_MANAGER }, { "channel", TP_DEBUG_CHANNEL }, { "proxy", TP_DEBUG_PROXY }, { "handles", TP_DEBUG_HANDLES }, { "contacts", TP_DEBUG_CONTACTS }, { "accounts", TP_DEBUG_ACCOUNTS }, { "dispatcher", TP_DEBUG_DISPATCHER }, { "client", TP_DEBUG_CLIENT }, { "contact-lists", TP_DEBUG_CONTACT_LISTS }, { "sasl", TP_DEBUG_SASL }, { "room-config", TP_DEBUG_ROOM_CONFIG }, { "call", TP_DEBUG_CALL }, { "debugger", TP_DEBUG_DEBUGGER }, { "tls", TP_DEBUG_TLS }, { 0, } }; typedef struct { guint key; const gchar *domain; } DebugKeyToDomain; /* This is an array of debug key flags to log domains. The point of this is so * that once getting the index of the bit set, _tp_log() can simply index * this array. Aditionally, having the domain already in $domain/$category * format means we don't have to call g_strdup_printf() to get the desired * domain for each debug message logged, and then g_free() to free the newly * created string... */ static DebugKeyToDomain key_to_domain[] = { { TP_DEBUG_MISC, G_LOG_DOMAIN "/misc" }, { TP_DEBUG_GROUPS, G_LOG_DOMAIN "/groups" }, { TP_DEBUG_PROPERTIES, G_LOG_DOMAIN "/properties" }, { TP_DEBUG_IM, G_LOG_DOMAIN "/im" }, { TP_DEBUG_CONNECTION, G_LOG_DOMAIN "/connection" }, { TP_DEBUG_PARAMS, G_LOG_DOMAIN "/params" }, { TP_DEBUG_PRESENCE, G_LOG_DOMAIN "/presence" }, { TP_DEBUG_MANAGER, G_LOG_DOMAIN "/manager" }, { TP_DEBUG_CHANNEL, G_LOG_DOMAIN "/channel" }, { TP_DEBUG_PROXY, G_LOG_DOMAIN "/proxy" }, { TP_DEBUG_HANDLES, G_LOG_DOMAIN "/handles" }, { TP_DEBUG_CONTACTS, G_LOG_DOMAIN "/contacts" }, { TP_DEBUG_ACCOUNTS, G_LOG_DOMAIN "/accounts" }, { TP_DEBUG_DISPATCHER, G_LOG_DOMAIN "/dispatcher" }, { TP_DEBUG_CLIENT, G_LOG_DOMAIN "/client" }, { TP_DEBUG_CONTACT_LISTS, G_LOG_DOMAIN "/contact-lists" }, { TP_DEBUG_SASL, G_LOG_DOMAIN "/sasl" }, { TP_DEBUG_ROOM_CONFIG, G_LOG_DOMAIN "/room-config" }, { TP_DEBUG_DEBUGGER, G_LOG_DOMAIN "/debugger" }, { TP_DEBUG_TLS, G_LOG_DOMAIN "/tls" }, { 0, NULL } }; static GDebugKey persist_keys[] = { { "persist", 1 }, { 0, }, }; /** * tp_debug_set_flags: * @flags_string: The flags to set, comma-separated. If %NULL or empty, * no additional flags are set. * * Set the debug flags indicated by @flags_string, in addition to any already * set. * * The parsing matches that of g_parse_debug_string(). * * If telepathy-glib was compiled with --disable-debug (not recommended), * this function has no practical effect, since the debug messages it would * enable were removed at compile time. * * Since: 0.6.1 */ void tp_debug_set_flags (const gchar *flags_string) { guint nkeys; for (nkeys = 0; keys[nkeys].value; nkeys++); if (flags_string != NULL) _tp_debug_set_flags (g_parse_debug_string (flags_string, keys, nkeys)); } /** * tp_debug_set_flags_from_string: (skip) * @flags_string: The flags to set, comma-separated. If %NULL or empty, * no additional flags are set. * * Set the debug flags indicated by @flags_string, in addition to any already * set. Unlike tp_debug_set_flags(), this enables persistence like * tp_debug_set_persistent() if the "persist" flag is present or the string * is "all" - this turns out to be unhelpful, as persistence should be * orthogonal. * * The parsing matches that of g_parse_debug_string(). * * Deprecated: since 0.6.1. Use tp_debug_set_flags() and * tp_debug_set_persistent() instead */ void tp_debug_set_flags_from_string (const gchar *flags_string) { tp_debug_set_flags (flags_string); if (flags_string != NULL && g_parse_debug_string (flags_string, persist_keys, 1) != 0) tp_debug_set_persistent (TRUE); } /** * tp_debug_set_flags_from_env: (skip) * @var: The name of the environment variable to parse * * Equivalent to * tp_debug_set_flags_from_string (g_getenv (var)), * and has the same problem with persistence being included in "all". * * Deprecated: since 0.6.1. Use tp_debug_set_flags(g_getenv(...)) and * tp_debug_set_persistent() instead */ void tp_debug_set_flags_from_env (const gchar *var) { const gchar *val = g_getenv (var); tp_debug_set_flags (val); if (val != NULL && g_parse_debug_string (val, persist_keys, 1) != 0) tp_debug_set_persistent (TRUE); } /** * tp_debug_set_persistent: * @persistent: TRUE prevents the connection manager mainloop from exiting, * FALSE enables exiting if there are no connections * (the default behavior). * * Used to enable persistent operation of the connection manager process for * debugging purposes. */ void tp_debug_set_persistent (gboolean persistent) { tp_debug_persistent = persistent; } /* * _tp_debug_set_flags: * @new_flags More flags to set * * Set extra flags. For internal use only */ void _tp_debug_set_flags (TpDebugFlags new_flags) { flags |= new_flags; } /* * _tp_debug_set_flags: * @flag: Flag to test * * Returns: %TRUE if the flag is set. For use via DEBUGGING() only. */ gboolean _tp_debug_flag_is_set (TpDebugFlags flag) { return (flag & flags) != 0; } static const gchar * debug_flag_to_domain (TpDebugFlags flag) { gint index, max; /* First bit set of @flag. This to make sure we only have one bit (in the * unlikely scenario that multiple debug flags were set). This enables us to * index the #key_to_domain array, instead of having to iterate it looking * for the right key. */ index = g_bit_nth_lsf (flag, -1); /* The maximum valid index of the #key_to_domain array. Decrement it by one * because there is the blank { 0, NULL } item on the end which we want to * ignore. */ max = G_N_ELEMENTS (key_to_domain) - 1; /* If the index we got isn't valid, just return "misc". */ if (index < 0 || index >= max) return G_LOG_DOMAIN "/misc"; else return key_to_domain[index].domain; } /* * _tp_log: * @level: Log level * @flag: Debug flag * @format: Format string for g_logv * * Emit a debug message with the given format and arguments, but only * if the given debug flag is set. For use via * ERROR()/CRITICAL()/.../DEBUG() only. */ void _tp_log (GLogLevelFlags level, TpDebugFlags flag, const gchar *format, ...) { if ((flag & flags) || level > G_LOG_LEVEL_DEBUG) { va_list args; va_start (args, format); g_logv (debug_flag_to_domain (flag), level, format, args); va_end (args); } } /* * _tp_debug_is_persistent: * * Returns: %TRUE if persistent mainloop behavior has been enabled with * tp_debug_set_persistent(). */ gboolean _tp_debug_is_persistent (void) { return tp_debug_persistent; } /** * tp_debug_divert_messages: * @filename: A file to which to divert stdout and stderr, or %NULL to * do nothing * * Open the given file for writing and duplicate its file descriptor to * be used for stdout and stderr. This has the effect of closing the previous * stdout and stderr, and sending all messages that would have gone there * to the given file instead. * * By default the file is truncated and hence overwritten each time the * process is executed. * Since version 0.7.14, if the filename is prefixed with '+' then the * file is not truncated and output is added at the end of the file. * * Passing %NULL to this function is guaranteed to have no effect. This is * so you can call it with the recommended usage * tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE")) * and it won't do anything if the environment variable is not set. * * This function still works if telepathy-glib was compiled without debug * support. * * Since: 0.7.1 */ void tp_debug_divert_messages (const gchar *filename) { int fd; if (filename == NULL) return; if (filename[0] == '+') { /* open in append mode */ fd = g_open (filename + 1, O_WRONLY | O_CREAT | O_APPEND, 0644); } else { /* open in trunc mode */ fd = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC, 0644); } if (fd == -1) { WARNING ("Can't open logfile '%s': %s", filename, g_strerror (errno)); return; } if (dup2 (fd, 1) == -1) /* STDOUT_FILENO is less universal */ { WARNING ("Error duplicating stdout file descriptor: %s", g_strerror (errno)); return; } if (dup2 (fd, 2) == -1) /* STDERR_FILENO is less universal */ { WARNING ("Error duplicating stderr file descriptor: %s", g_strerror (errno)); } /* avoid leaking the fd */ if (close (fd) != 0) { WARNING ("Error closing temporary logfile fd: %s", g_strerror (errno)); } } /** * tp_debug_timestamped_log_handler: * @log_domain: the message's log domain * @log_level: the log level of the message * @message: the message to process * @ignored: not used * * A #GLogFunc that prepends the UTC time (currently in ISO 8601 format, * with microsecond resolution) to the message, then calls * g_log_default_handler. * * Intended usage is: * * if (g_getenv ("MYPROG_TIMING") != NULL) * g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); * * * If telepathy-glib was compiled with --disable-debug (not recommended), * this function is equivalent to g_log_default_handler(). * * Changed in 0.9.0: timestamps are now printed in UTC, in * RFC-3339 format. Previously, they were printed in local time, in a * format similar to RFC-3339. * * Since: 0.7.1 */ void tp_debug_timestamped_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer ignored) { #ifdef ENABLE_DEBUG GTimeVal now; gchar *tmp, *now_str; g_get_current_time (&now); now_str = g_time_val_to_iso8601 (&now); tmp = g_strdup_printf ("%s: %s", now_str, message); g_free (now_str); message = tmp; #endif g_log_default_handler (log_domain, log_level, message, NULL); #ifdef ENABLE_DEBUG g_free (tmp); #endif } telepathy-glib-0.24.2/telepathy-glib/debug.h0000644000175000017500000000160412652510705015607 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DEBUG_H__ #define __TP_DEBUG_H__ #include #include G_BEGIN_DECLS void tp_debug_set_flags (const gchar *flags_string); void tp_debug_set_persistent (gboolean persistent); void tp_debug_divert_messages (const gchar *filename); void tp_debug_timestamped_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer ignored); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED void tp_debug_set_flags_from_string (const gchar *flags_string); _TP_DEPRECATED void tp_debug_set_flags_from_env (const gchar *var); _TP_DEPRECATED void tp_debug_set_all_flags (void); #endif G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/media-stream-handler.xml0000644000175000017500000000035712652510705021061 00000000000000 Media stream handler telepathy-glib-0.24.2/telepathy-glib/svc-client.h0000644000175000017500000000053612652510705016573 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_META_SVC_CLIENT_H__ #define __TP_META_SVC_CLIENT_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/account-channel-request-internal.h0000644000175000017500000000213712652510705023065 00000000000000/**/ /* * object used to request a channel from a TpAccount (internal) * * Copyright © 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_ACCOUNT_CHANNEL_REQUEST_INTERNAL_H__ #define __TP_ACCOUNT_CHANNEL_REQUEST_INTERNAL_H__ #include TpBaseClient * _tp_account_channel_request_get_client ( TpAccountChannelRequest *self); #endif telepathy-glib-0.24.2/telepathy-glib/simple-client-factory.c0000644000175000017500000011636612652510705020742 00000000000000/* * A factory for TpContacts and plain subclasses of TpProxy * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:simple-client-factory * @title: TpSimpleClientFactory * @short_description: a factory for #TpContacts and plain subclasses * of #TpProxy * @see_also: #TpAutomaticClientFactory * * This factory constructs various #TpProxy subclasses as well as #TpContact, * which guarantees that at most one instance of those objects will exist for a * given remote object or contact. It also stores the desired features for * contacts and each type of proxy. * * Note that the factory will not prepare the desired features: it is the * caller's responsibility to do so. By default, only core features are * requested. * * Currently supported classes are #TpAccount, #TpConnection, * #TpChannel and #TpContact. Those objects should always be acquired through a * factory or a "larger" object (e.g. getting the #TpConnection from * a #TpAccount), rather than being constructed directly. * * One can subclass #TpSimpleClientFactory and override some of its virtual * methods to construct more specialized objects. See #TpAutomaticClientFactory * for a subclass which automatically constructs subclasses of #TpChannel for * common channel types. * * An application using its own factory subclass would look like this: * |[ * int main(int argc, char *argv[]) * { * TpSimpleClientFactory *factory; * TpAccountManager *manager; * * factory = my_factory_new (); * manager = tp_account_manager_new_with_factory (factory); * tp_account_manager_set_default (manager); * * ... * tp_proxy_prepare_async (manager, am_features, callback, user_data); * ... * } * ]| * * The call to tp_account_manager_set_default() near the beginning of main() * will ensure that any libraries or plugins which also use Telepathy (and call * tp_account_manager_dup()) will share your #TpAccountManager. * * Since: 0.15.5 */ /** * TpSimpleClientFactory: * * Data structure representing a #TpSimpleClientFactory * * Since: 0.15.5 */ /** * TpSimpleClientFactoryClass: * @parent_class: the parent * @create_account: create a #TpAccount; * see tp_simple_client_factory_ensure_account() * @dup_account_features: implementation of tp_simple_client_factory_dup_account_features() * @create_connection: create a #TpConnection; * see tp_simple_client_factory_ensure_connection() * @dup_connection_features: implementation of * tp_simple_client_factory_dup_connection_features() * @create_channel: create a #TpChannel; * see tp_simple_client_factory_ensure_channel() * @dup_channel_features: implementation of tp_simple_client_factory_dup_channel_features() * @create_contact: create a #TpContact; * see tp_simple_client_factory_ensure_contact() * @dup_contact_features: implementation of tp_simple_client_factory_dup_contact_features() * * The class structure for #TpSimpleClientFactory. * * #TpSimpleClientFactory maintains a cache of previously-constructed proxy * objects, so the implementations of @create_account, * @create_connection, @create_channel, and @create_contact may assume that a * new object should be created when they are called. The default * implementations create unadorned instances of the relevant classes; * subclasses of the factory may choose to create more interesting proxy * subclasses. * * The default implementation of @dup_channel_features returns * #TP_CHANNEL_FEATURE_CORE, plus all features passed to * tp_simple_client_factory_add_channel_features() by the application. * Subclasses may override this method to prepare more interesting features * from subclasses of #TpChannel, for instance. The default implementations of * the other dup_x_features methods behave similarly. * * Since: 0.15.5 */ #include "config.h" #include "telepathy-glib/simple-client-factory.h" #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/contact-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/util-internal.h" struct _TpSimpleClientFactoryPrivate { TpDBusDaemon *dbus; /* Owned object-path -> weakref to TpProxy */ GHashTable *proxy_cache; GArray *desired_account_features; GArray *desired_connection_features; GArray *desired_channel_features; GArray *desired_contact_features; }; enum { PROP_DBUS_DAEMON = 1, N_PROPS }; G_DEFINE_TYPE (TpSimpleClientFactory, tp_simple_client_factory, G_TYPE_OBJECT) static void proxy_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, TpSimpleClientFactory *self) { g_hash_table_remove (self->priv->proxy_cache, tp_proxy_get_object_path (proxy)); } static void insert_proxy (TpSimpleClientFactory *self, gpointer proxy) { if (proxy == NULL) return; g_hash_table_insert (self->priv->proxy_cache, (gpointer) tp_proxy_get_object_path (proxy), proxy); /* This assume that invalidated signal is emitted from TpProxy dispose. May * change in a future API break? */ tp_g_signal_connect_object (proxy, "invalidated", G_CALLBACK (proxy_invalidated_cb), self, 0); } static gpointer lookup_proxy (TpSimpleClientFactory *self, const gchar *object_path) { return g_hash_table_lookup (self->priv->proxy_cache, object_path); } void _tp_simple_client_factory_insert_proxy (TpSimpleClientFactory *self, gpointer proxy) { g_return_if_fail (lookup_proxy (self, tp_proxy_get_object_path (proxy)) == NULL); insert_proxy (self, proxy); } static TpAccount * create_account_impl (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties G_GNUC_UNUSED, GError **error) { return _tp_account_new_with_factory (self, self->priv->dbus, object_path, error); } static GArray * dup_account_features_impl (TpSimpleClientFactory *self, TpAccount *account) { return _tp_quark_array_copy ( (GQuark *) self->priv->desired_account_features->data); } static TpConnection * create_connection_impl (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties G_GNUC_UNUSED, GError **error) { return _tp_connection_new_with_factory (self, self->priv->dbus, NULL, object_path, error); } static GArray * dup_connection_features_impl (TpSimpleClientFactory *self, TpConnection *connection) { return _tp_quark_array_copy ( (GQuark *) self->priv->desired_connection_features->data); } static TpChannel * create_channel_impl (TpSimpleClientFactory *self, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { return _tp_channel_new_with_factory (self, conn, object_path, immutable_properties, error); } static GArray * dup_channel_features_impl (TpSimpleClientFactory *self, TpChannel *channel) { return _tp_quark_array_copy ( (GQuark *) self->priv->desired_channel_features->data); } static TpContact * create_contact_impl (TpSimpleClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier) { return _tp_contact_new (connection, handle, identifier); } static GArray * dup_contact_features_impl (TpSimpleClientFactory *self, TpConnection *connection) { GArray *array; array = g_array_sized_new (FALSE, FALSE, sizeof (TpContactFeature), self->priv->desired_contact_features->len); g_array_append_vals (array, self->priv->desired_contact_features->data, self->priv->desired_contact_features->len); return array; } static void tp_simple_client_factory_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; switch (property_id) { case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_client_factory_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; switch (property_id) { case PROP_DBUS_DAEMON: g_assert (self->priv->dbus == NULL); /* construct only */ self->priv->dbus = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_client_factory_constructed (GObject *object) { TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; if (self->priv->dbus == NULL) self->priv->dbus = tp_dbus_daemon_dup (NULL); G_OBJECT_CLASS (tp_simple_client_factory_parent_class)->constructed (object); } static void tp_simple_client_factory_finalize (GObject *object) { TpSimpleClientFactory *self = (TpSimpleClientFactory *) object; g_clear_object (&self->priv->dbus); tp_clear_pointer (&self->priv->proxy_cache, g_hash_table_unref); tp_clear_pointer (&self->priv->desired_account_features, g_array_unref); tp_clear_pointer (&self->priv->desired_connection_features, g_array_unref); tp_clear_pointer (&self->priv->desired_channel_features, g_array_unref); tp_clear_pointer (&self->priv->desired_contact_features, g_array_unref); G_OBJECT_CLASS (tp_simple_client_factory_parent_class)->finalize (object); } static void tp_simple_client_factory_init (TpSimpleClientFactory *self) { GQuark feature; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_CLIENT_FACTORY, TpSimpleClientFactoryPrivate); self->priv->proxy_cache = g_hash_table_new (g_str_hash, g_str_equal); self->priv->desired_account_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); feature = TP_ACCOUNT_FEATURE_CORE; g_array_append_val (self->priv->desired_account_features, feature); self->priv->desired_connection_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); feature = TP_CONNECTION_FEATURE_CORE; g_array_append_val (self->priv->desired_connection_features, feature); self->priv->desired_channel_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); feature = TP_CHANNEL_FEATURE_CORE; g_array_append_val (self->priv->desired_channel_features, feature); self->priv->desired_contact_features = g_array_new (FALSE, FALSE, sizeof (TpContactFeature)); } static void tp_simple_client_factory_class_init (TpSimpleClientFactoryClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpSimpleClientFactoryPrivate)); object_class->get_property = tp_simple_client_factory_get_property; object_class->set_property = tp_simple_client_factory_set_property; object_class->constructed = tp_simple_client_factory_constructed; object_class->finalize = tp_simple_client_factory_finalize; klass->create_account = create_account_impl; klass->dup_account_features = dup_account_features_impl; klass->create_connection = create_connection_impl; klass->dup_connection_features = dup_connection_features_impl; klass->create_channel = create_channel_impl; klass->dup_channel_features = dup_channel_features_impl; klass->create_contact = create_contact_impl; klass->dup_contact_features = dup_contact_features_impl; /** * TpSimpleClientFactory:dbus-daemon: * * The D-Bus daemon for this object. */ param_spec = g_param_spec_object ("dbus-daemon", "D-Bus daemon", "The D-Bus daemon used by this object", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, param_spec); } /** * tp_simple_client_factory_new: * @dbus: (allow-none): a #TpDBusDaemon, or %NULL * * Creates a new #TpSimpleClientFactory instance. If @dbus is %NULL, * tp_dbus_daemon_dup() will be used. * * Returns: a new #TpSimpleClientFactory * * Since: 0.15.5 */ TpSimpleClientFactory * tp_simple_client_factory_new (TpDBusDaemon *dbus) { return g_object_new (TP_TYPE_SIMPLE_CLIENT_FACTORY, "dbus-daemon", dbus, NULL); } /** * tp_simple_client_factory_get_dbus_daemon: * @self: a #TpSimpleClientFactory object * * * * Returns: (transfer none): the value of the #TpSimpleClientFactory:dbus-daemon * property * * Since: 0.15.5 */ TpDBusDaemon * tp_simple_client_factory_get_dbus_daemon (TpSimpleClientFactory *self) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); return self->priv->dbus; } /** * tp_simple_client_factory_ensure_account: * @self: a #TpSimpleClientFactory object * @object_path: the object path of an account * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the account, or %NULL. * @error: Used to raise an error if @object_path is not valid * * Returns a #TpAccount proxy for the account at @object_path. The returned * #TpAccount is cached; the same #TpAccount object will be returned by this * function repeatedly, as long as at least one reference exists. * * Note that the returned #TpAccount is not guaranteed to be ready; the caller * is responsible for calling tp_proxy_prepare_async() with the desired * features (as given by tp_simple_client_factory_dup_account_features()). * * This function is rather low-level. tp_account_manager_dup_valid_accounts() * and #TpAccountManager::validity-changed are more appropriate for most * applications. * * Returns: (transfer full): a reference to a #TpAccount; * see tp_account_new(). * * Since: 0.15.5 */ TpAccount * tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpAccount *account; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); account = lookup_proxy (self, object_path); if (account != NULL) return g_object_ref (account); account = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_account (self, object_path, immutable_properties, error); insert_proxy (self, account); return account; } /** * tp_simple_client_factory_dup_account_features: * @self: a #TpSimpleClientFactory object * @account: a #TpAccount * * Return a zero-terminated #GArray containing the #TpAccount features that * should be prepared on @account. * * Returns: (transfer full) (element-type GLib.Quark): a newly allocated * #GArray * * Since: 0.15.5 */ GArray * tp_simple_client_factory_dup_account_features (TpSimpleClientFactory *self, TpAccount *account) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (tp_proxy_get_factory (account) == self, NULL); return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_account_features (self, account); } /** * tp_simple_client_factory_add_account_features: * @self: a #TpSimpleClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpAccount * objects. Those features will be added to the features already returned be * tp_simple_client_factory_dup_account_features(). * * It is not necessary to add %TP_ACCOUNT_FEATURE_CORE as it is already * included by default. * * Note that these features will not be added to existing #TpAccount * objects; the user must call tp_proxy_prepare_async() themself. * * Since: 0.15.5 */ void tp_simple_client_factory_add_account_features ( TpSimpleClientFactory *self, const GQuark *features) { g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_account_features, features, -1); } /** * tp_simple_client_factory_add_account_features_varargs: (skip) * @self: a #TpSimpleClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_simple_client_factory_add_account_features(), but with a more * convenient calling convention from C. * * Since: 0.15.5 */ void tp_simple_client_factory_add_account_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...) { va_list var_args; g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_account_features, feature, var_args); va_end (var_args); } /** * tp_simple_client_factory_ensure_connection: * @self: a #TpSimpleClientFactory object * @object_path: the object path of a connection * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the connection. * @error: Used to raise an error if @object_path is not valid * * Returns a #TpConnection proxy for the connection at @object_path. * The returned #TpConnection is cached; the same #TpConnection object * will be returned by this function repeatedly, as long as at least one * reference exists. * * Note that the returned #TpConnection is not guaranteed to be ready; the * caller is responsible for calling tp_proxy_prepare_async() with the desired * features (as given by tp_simple_client_factory_dup_connection_features()). * * This function is rather low-level. #TpAccount:connection is more * appropriate for most applications. * * Returns: (transfer full): a reference to a #TpConnection; * see tp_connection_new(). * * Since: 0.15.5 */ TpConnection * tp_simple_client_factory_ensure_connection (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpConnection *connection; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); connection = lookup_proxy (self, object_path); if (connection != NULL) return g_object_ref (connection); connection = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_connection ( self, object_path, immutable_properties, error); insert_proxy (self, connection); return connection; } /** * tp_simple_client_factory_dup_connection_features: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection * * Return a zero-terminated #GArray containing the #TpConnection features that * should be prepared on @connection. * * Returns: (transfer full) (element-type GLib.Quark): a newly allocated * #GArray * * Since: 0.15.5 */ GArray * tp_simple_client_factory_dup_connection_features (TpSimpleClientFactory *self, TpConnection *connection) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_connection_features ( self, connection); } /** * tp_simple_client_factory_add_connection_features: * @self: a #TpSimpleClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpConnection * objects. Those features will be added to the features already returned be * tp_simple_client_factory_dup_connection_features(). * * It is not necessary to add %TP_CONNECTION_FEATURE_CORE as it is already * included by default. * * Note that these features will not be added to existing #TpConnection * objects; the user must call tp_proxy_prepare_async() themself. * * Since: 0.15.5 */ void tp_simple_client_factory_add_connection_features ( TpSimpleClientFactory *self, const GQuark *features) { g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_connection_features, features, -1); } /** * tp_simple_client_factory_add_connection_features_varargs: (skip) * @self: a #TpSimpleClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_simple_client_factory_add_connection_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void tp_simple_client_factory_add_connection_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...) { va_list var_args; g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_connection_features, feature, var_args); va_end (var_args); } /** * tp_simple_client_factory_ensure_channel: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection whose #TpProxy:factory is this object * @object_path: the object path of a channel on @connection * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel * @error: Used to raise an error if @object_path is not valid * * Returns a #TpChannel proxy for the channel at @object_path on @connection. * The returned #TpChannel is cached; the same #TpChannel object * will be returned by this function repeatedly, as long as at least one * reference exists. * * Note that the returned #TpChannel is not guaranteed to be ready; the * caller is responsible for calling tp_proxy_prepare_async() with the desired * features (as given by tp_simple_client_factory_dup_channel_features()). * * This function is rather low-level. * #TpAccountChannelRequest and #TpBaseClient are more appropriate ways * to obtain channels for most applications. * * Returns: (transfer full): a reference to a #TpChannel; * see tp_channel_new_from_properties(). * * Since: 0.15.5 */ TpChannel * tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, TpConnection *connection, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpChannel *channel; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); channel = lookup_proxy (self, object_path); if (channel != NULL) return g_object_ref (channel); channel = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_channel (self, connection, object_path, immutable_properties, error); insert_proxy (self, channel); return channel; } /** * tp_simple_client_factory_dup_channel_features: * @self: a #TpSimpleClientFactory object * @channel: a #TpChannel * * Return a zero-terminated #GArray containing the #TpChannel features that * should be prepared on @channel. * * Returns: (transfer full) (element-type GLib.Quark): a newly allocated * #GArray * * Since: 0.15.5 */ GArray * tp_simple_client_factory_dup_channel_features (TpSimpleClientFactory *self, TpChannel *channel) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (tp_proxy_get_factory (channel) == self, NULL); return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_channel_features ( self, channel); } /** * tp_simple_client_factory_add_channel_features: * @self: a #TpSimpleClientFactory object * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * * Add @features to the desired features to be prepared on #TpChannel * objects. Those features will be added to the features already returned be * tp_simple_client_factory_dup_channel_features(). * * It is not necessary to add %TP_CHANNEL_FEATURE_CORE as it is already * included by default. * * Note that these features will not be added to existing #TpChannel * objects; the user must call tp_proxy_prepare_async() themself. * * Since: 0.15.5 */ void tp_simple_client_factory_add_channel_features ( TpSimpleClientFactory *self, const GQuark *features) { g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); _tp_quark_array_merge (self->priv->desired_channel_features, features, -1); } /** * tp_simple_client_factory_add_channel_features_varargs: (skip) * @self: a #TpSimpleClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_simple_client_factory_add_channel_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void tp_simple_client_factory_add_channel_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...) { va_list var_args; g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); va_start (var_args, feature); _tp_quark_array_merge_valist (self->priv->desired_channel_features, feature, var_args); va_end (var_args); } /** * tp_simple_client_factory_ensure_contact: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection whose #TpProxy:factory is this object * @handle: a #TpHandle * @identifier: a string representing the contact's identifier * * Returns a #TpContact representing @identifier (and @handle) on @connection. * The returned #TpContact is cached; the same #TpContact object * will be returned by this function repeatedly, as long as at least one * reference exists. * * Note that the returned #TpContact is not guaranteed to be ready; the caller * is responsible for calling tp_connection_upgrade_contacts() with the desired * features (as given by tp_simple_client_factory_dup_contact_features()). * * For this function to work properly, tp_connection_has_immortal_handles() * must return %TRUE for @connection. * * Returns: (transfer full): a reference to a #TpContact. * * Since: 0.15.5 */ TpContact * tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier) { TpContact *contact; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); g_return_val_if_fail (tp_connection_has_immortal_handles (connection), NULL); g_return_val_if_fail (handle != 0, NULL); g_return_val_if_fail (identifier != NULL, NULL); contact = tp_connection_dup_contact_if_possible (connection, handle, identifier); if (contact != NULL) return contact; contact = TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->create_contact (self, connection, handle, identifier); _tp_connection_add_contact (connection, handle, contact); return contact; } static void upgrade_contacts_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpConnection *connection = (TpConnection *) source; GSimpleAsyncResult *my_result = user_data; GPtrArray *contacts; GError *error = NULL; if (!tp_connection_upgrade_contacts_finish (connection, result, &contacts, &error)) { g_simple_async_result_take_error (my_result, error); } else { g_simple_async_result_set_op_res_gpointer (my_result, contacts, (GDestroyNotify) g_ptr_array_unref); } g_simple_async_result_complete (my_result); g_object_unref (my_result); } /** * tp_simple_client_factory_upgrade_contacts_async: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection whose #TpProxy:factory is this object * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects * associated with @self * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Same as tp_connection_upgrade_contacts_async(), but prepare contacts with all * features previously passed to * tp_simple_client_factory_add_contact_features(). * * Since: 0.19.1 */ void tp_simple_client_factory_upgrade_contacts_async ( TpSimpleClientFactory *self, TpConnection *connection, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GArray *features; /* no real reason this shouldn't work, but it's really confusing * and probably indicates an error */ g_warn_if_fail (tp_proxy_get_factory (connection) == self); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_simple_client_factory_upgrade_contacts_async); features = tp_simple_client_factory_dup_contact_features (self, connection); tp_connection_upgrade_contacts_async (connection, n_contacts, contacts, features->len, (TpContactFeature *) features->data, upgrade_contacts_cb, result); g_array_unref (features); } /** * tp_simple_client_factory_upgrade_contacts_finish: * @self: a #TpSimpleClientFactory * @result: a #GAsyncResult * @contacts: (element-type TelepathyGLib.Contact) (transfer container) (out) (allow-none): * a location to set a #GPtrArray of upgraded #TpContact, or %NULL. * @error: a #GError to fill * * Finishes tp_simple_client_factory_upgrade_contacts_async() * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.19.1 */ gboolean tp_simple_client_factory_upgrade_contacts_finish ( TpSimpleClientFactory *self, GAsyncResult *result, GPtrArray **contacts, GError **error) { _tp_implement_finish_copy_pointer (self, tp_simple_client_factory_upgrade_contacts_async, g_ptr_array_ref, contacts); } static void dup_contact_by_id_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpConnection *connection = (TpConnection *) source; GSimpleAsyncResult *my_result = user_data; TpContact *contact; GError *error = NULL; contact = tp_connection_dup_contact_by_id_finish (connection, result, &error); if (contact == NULL) { g_simple_async_result_take_error (my_result, error); } else { g_simple_async_result_set_op_res_gpointer (my_result, contact, g_object_unref); } g_simple_async_result_complete (my_result); g_object_unref (my_result); } /** * tp_simple_client_factory_ensure_contact_by_id_async: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection * @identifier: a string representing the contact's identifier * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Same as tp_connection_dup_contact_by_id_async(), but prepare the * contact with all features previously passed to * tp_simple_client_factory_add_contact_features(). * * Since: 0.19.1 */ void tp_simple_client_factory_ensure_contact_by_id_async ( TpSimpleClientFactory *self, TpConnection *connection, const gchar *identifier, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GArray *features; result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_simple_client_factory_ensure_contact_by_id_async); features = tp_simple_client_factory_dup_contact_features (self, connection); tp_connection_dup_contact_by_id_async (connection, identifier, features->len, (TpContactFeature *) features->data, dup_contact_by_id_cb, result); g_array_unref (features); } /** * tp_simple_client_factory_ensure_contact_by_id_finish: * @self: a #TpSimpleClientFactory * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_simple_client_factory_ensure_contact_by_id_async() * * Returns: (transfer full): a #TpContact or %NULL on error. * Since: 0.19.1 */ TpContact * tp_simple_client_factory_ensure_contact_by_id_finish ( TpSimpleClientFactory *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_simple_client_factory_ensure_contact_by_id_async, g_object_ref); } /** * tp_simple_client_factory_dup_contact_features: * @self: a #TpSimpleClientFactory object * @connection: a #TpConnection * * Return a #GArray containing the #TpContactFeature that should be prepared on * all contacts of @connection. * * Returns: (transfer full) (element-type TelepathyGLib.ContactFeature): a newly * allocated #GArray * * Since: 0.15.5 */ GArray * tp_simple_client_factory_dup_contact_features (TpSimpleClientFactory *self, TpConnection *connection) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (tp_proxy_get_factory (connection) == self, NULL); return TP_SIMPLE_CLIENT_FACTORY_GET_CLASS (self)->dup_contact_features ( self, connection); } /** * tp_simple_client_factory_add_contact_features: * @self: a #TpSimpleClientFactory object * @n_features: The number of features in @features (may be 0) * @features: (array length=n_features) (allow-none): an array of desired * features (may be %NULL if @n_features is 0) * * Add @features to the desired features to be prepared on #TpContact * objects. Those features will be added to the features already returned be * tp_simple_client_factory_dup_contact_features(). * * Note that these features will not be added to existing #TpContact * objects; the user must call tp_connection_upgrade_contacts() themself. * * Since: 0.15.5 */ void tp_simple_client_factory_add_contact_features (TpSimpleClientFactory *self, guint n_features, const TpContactFeature *features) { guint i; g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); /* Add features into desired_contact_features avoiding dups */ for (i = 0; i < n_features; i++) { guint j; gboolean found = FALSE; for (j = 0; j < self->priv->desired_contact_features->len; j++) { if (features[i] == g_array_index ( self->priv->desired_contact_features, TpContactFeature, j)) { found = TRUE; break; } } if (!found) g_array_append_val (self->priv->desired_contact_features, features[i]); } } /** * tp_simple_client_factory_add_contact_features_varargs: (skip) * @self: a #TpSimpleClientFactory * @feature: the first feature * @...: the second and subsequent features, if any, ending with * %TP_CONTACT_FEATURE_INVALID * * The same as tp_simple_client_factory_add_contact_features(), but with a * more convenient calling convention from C. * * Since: 0.15.5 */ void tp_simple_client_factory_add_contact_features_varargs ( TpSimpleClientFactory *self, TpContactFeature feature, ...) { va_list var_args; GArray *features; TpContactFeature f; g_return_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self)); va_start (var_args, feature); features = g_array_new (FALSE, FALSE, sizeof (TpContactFeature)); for (f = feature; f != TP_CONTACT_FEATURE_INVALID; f = va_arg (var_args, TpContactFeature)) g_array_append_val (features, f); tp_simple_client_factory_add_contact_features (self, features->len, (TpContactFeature *) features->data); g_array_unref (features); va_end (var_args); } /* * _tp_simple_client_factory_ensure_channel_request: * @self: a #TpSimpleClientFactory object * @object_path: the object path of a channel request * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel request * @error: Used to raise an error if @object_path is not valid * * Returns a #TpChannelRequest for @object_path. The returned * #TpChannelRequest is cached; the same #TpChannelRequest object will be * returned by this function repeatedly, as long as at least one reference * exists. * * Note that the returned #TpChannelRequest is not guaranteed to be ready; the * caller is responsible for calling tp_proxy_prepare_async(). * * Returns: (transfer full): a reference to a #TpChannelRequest; * see tp_channel_request_new(). * * Since: 0.15.5 */ TpChannelRequest * _tp_simple_client_factory_ensure_channel_request (TpSimpleClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelRequest *request; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); request = lookup_proxy (self, object_path); if (request != NULL) { /* A common usage is request_and_handle, in that case EnsureChannel * returns only the object-path of the ChannelRequest but not properties. * The TpChannelRequest will be created with no properties, then when * handling we get the properties and we reuse the same TpChannelRequest * object, and we can give it the immutable-properties. */ _tp_channel_request_ensure_immutable_properties (request, immutable_properties); return g_object_ref (request); } request = _tp_channel_request_new_with_factory (self, self->priv->dbus, object_path, immutable_properties, error); insert_proxy (self, request); return request; } /* * _tp_simple_client_factory_ensure_channel_dispatch_operation: * @self: a #TpSimpleClientFactory object * @object_path: the object path of a channel dispatch operation * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel dispatch operation * @error: Used to raise an error if @object_path is not valid * * Returns a #TpChannelDispatchOperation for @object_path. * The returned #TpChannelDispatchOperation is cached; the same * #TpChannelDispatchOperation object will be returned by this function * repeatedly, as long as at least one reference exists. * * Note that the returned #TpChannelDispatchOperation is not guaranteed to be * ready; the caller is responsible for calling tp_proxy_prepare_async(). * * Returns: (transfer full): a reference to a * #TpChannelDispatchOperation; see tp_channel_dispatch_operation_new(). * * Since: 0.15.5 */ TpChannelDispatchOperation * _tp_simple_client_factory_ensure_channel_dispatch_operation ( TpSimpleClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelDispatchOperation *dispatch; g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (self), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); dispatch = lookup_proxy (self, object_path); if (dispatch != NULL) return g_object_ref (dispatch); dispatch = _tp_channel_dispatch_operation_new_with_factory (self, self->priv->dbus, object_path, immutable_properties, error); insert_proxy (self, dispatch); return dispatch; } telepathy-glib-0.24.2/telepathy-glib/simple-client-factory.h0000644000175000017500000001705112652510705020736 00000000000000/* * A factory for TpContacts and plain subclasses of TpProxy * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIMPLE_CLIENT_FACTORY_H__ #define __TP_SIMPLE_CLIENT_FACTORY_H__ #include #include #include #include #include #include #include #include G_BEGIN_DECLS /* TpSimpleClientFactory is typedef'd in proxy.h */ typedef struct _TpSimpleClientFactoryPrivate TpSimpleClientFactoryPrivate; typedef struct _TpSimpleClientFactoryClass TpSimpleClientFactoryClass; struct _TpSimpleClientFactoryClass { /**/ GObjectClass parent_class; /* TpAccount */ TpAccount * (*create_account) (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error); GArray * (*dup_account_features) (TpSimpleClientFactory *self, TpAccount *account); /* TpConnection */ TpConnection * (*create_connection) (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error); GArray * (*dup_connection_features) (TpSimpleClientFactory *self, TpConnection *connection); /* TpChannel */ TpChannel * (*create_channel) (TpSimpleClientFactory *self, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); GArray * (*dup_channel_features) (TpSimpleClientFactory *self, TpChannel *channel); /* TpContact */ TpContact * (*create_contact) (TpSimpleClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier); GArray * (*dup_contact_features) (TpSimpleClientFactory *self, TpConnection *connection); /**/ GCallback padding[20]; }; struct _TpSimpleClientFactory { /**/ GObject parent; TpSimpleClientFactoryPrivate *priv; }; _TP_AVAILABLE_IN_0_16 GType tp_simple_client_factory_get_type (void); #define TP_TYPE_SIMPLE_CLIENT_FACTORY \ (tp_simple_client_factory_get_type ()) #define TP_SIMPLE_CLIENT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ TpSimpleClientFactory)) #define TP_SIMPLE_CLIENT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ TpSimpleClientFactoryClass)) #define TP_IS_SIMPLE_CLIENT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY)) #define TP_IS_SIMPLE_CLIENT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_SIMPLE_CLIENT_FACTORY)) #define TP_SIMPLE_CLIENT_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_CLIENT_FACTORY, \ TpSimpleClientFactoryClass)) _TP_AVAILABLE_IN_0_16 TpSimpleClientFactory * tp_simple_client_factory_new (TpDBusDaemon *dbus); _TP_AVAILABLE_IN_0_16 TpDBusDaemon *tp_simple_client_factory_get_dbus_daemon ( TpSimpleClientFactory *self); /* TpAccount */ _TP_AVAILABLE_IN_0_16 TpAccount *tp_simple_client_factory_ensure_account (TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error); _TP_AVAILABLE_IN_0_16 GArray *tp_simple_client_factory_dup_account_features ( TpSimpleClientFactory *self, TpAccount *account); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_account_features (TpSimpleClientFactory *self, const GQuark *features); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_account_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...); /* TpConnection */ _TP_AVAILABLE_IN_0_16 TpConnection *tp_simple_client_factory_ensure_connection ( TpSimpleClientFactory *self, const gchar *object_path, const GHashTable *immutable_properties, GError **error); _TP_AVAILABLE_IN_0_16 GArray *tp_simple_client_factory_dup_connection_features ( TpSimpleClientFactory *self, TpConnection *connection); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_connection_features ( TpSimpleClientFactory *self, const GQuark *features); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_connection_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...); /* TpChannel */ _TP_AVAILABLE_IN_0_16 TpChannel *tp_simple_client_factory_ensure_channel (TpSimpleClientFactory *self, TpConnection *connection, const gchar *object_path, const GHashTable *immutable_properties, GError **error); _TP_AVAILABLE_IN_0_16 GArray *tp_simple_client_factory_dup_channel_features ( TpSimpleClientFactory *self, TpChannel *channel); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_channel_features (TpSimpleClientFactory *self, const GQuark *features); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_channel_features_varargs ( TpSimpleClientFactory *self, GQuark feature, ...); /* TpContact */ _TP_AVAILABLE_IN_0_16 TpContact *tp_simple_client_factory_ensure_contact (TpSimpleClientFactory *self, TpConnection *connection, TpHandle handle, const gchar *identifier); _TP_AVAILABLE_IN_0_20 void tp_simple_client_factory_upgrade_contacts_async ( TpSimpleClientFactory *self, TpConnection *connection, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 gboolean tp_simple_client_factory_upgrade_contacts_finish ( TpSimpleClientFactory *self, GAsyncResult *result, GPtrArray **contacts, GError **error); _TP_AVAILABLE_IN_0_20 void tp_simple_client_factory_ensure_contact_by_id_async ( TpSimpleClientFactory *self, TpConnection *connection, const gchar *identifier, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 TpContact *tp_simple_client_factory_ensure_contact_by_id_finish ( TpSimpleClientFactory *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 GArray *tp_simple_client_factory_dup_contact_features ( TpSimpleClientFactory *self, TpConnection *connection); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_contact_features (TpSimpleClientFactory *self, guint n_features, const TpContactFeature *features); _TP_AVAILABLE_IN_0_16 void tp_simple_client_factory_add_contact_features_varargs ( TpSimpleClientFactory *self, TpContactFeature feature, ...); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/cm-message-internal.h0000644000175000017500000000332512652510705020356 00000000000000/**/ /* * message-internal.h - Header for TpCMMessage (internal * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CM_MESSAGE_INTERNAL_H__ #define __TP_CM_MESSAGE_INTERNAL_H__ #include "cm-message.h" #include #include "message.h" #include "message-internal.h" G_BEGIN_DECLS typedef struct _TpCMMessagePrivate TpCMMessagePrivate; struct _TpCMMessageClass { /**/ TpMessageClass parent_class; }; struct _TpCMMessage { /**/ TpMessage parent; TpCMMessagePrivate *priv; /* from here down is implementation-specific for TpMessageMixin */ /* for receiving */ guint32 incoming_id; /* for sending */ DBusGMethodInvocation *outgoing_context; TpMessageSendingFlags outgoing_flags; gboolean outgoing_text_api; }; TpMessage * _tp_cm_message_new_from_parts (TpBaseConnection *conn, const GPtrArray *parts); G_END_DECLS #endif /* __TP_CM_MESSAGE_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/svc-connection-manager.h0000644000175000017500000000053412652510705021062 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CONNECTION_MANAGER_H__ #define __TP_META_SVC_CONNECTION_MANAGER_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/text-channel.c0000644000175000017500000016156212652510705017120 00000000000000/* * text-channel.h - high level API for Text channels * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:text-channel * @title: TpTextChannel * @short_description: proxy object for a text channel * * #TpTextChannel is a sub-class of #TpChannel providing convenient API * to send and receive #TpMessage. */ /** * TpTextChannel: * * Data structure representing a #TpTextChannel. * * Since: 0.13.10 */ /** * TpTextChannelClass: * * The class of a #TpTextChannel. * * Since: 0.13.10 */ #include "config.h" #include "telepathy-glib/text-channel.h" #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/automatic-client-factory-internal.h" #include "telepathy-glib/channel-internal.h" #include #include G_DEFINE_TYPE (TpTextChannel, tp_text_channel, TP_TYPE_CHANNEL) struct _TpTextChannelPrivate { GStrv supported_content_types; TpMessagePartSupportFlags message_part_support_flags; TpDeliveryReportingSupportFlags delivery_reporting_support; GArray *message_types; GSimpleAsyncResult *pending_messages_result; guint n_preparing_pending_messages; /* queue of owned TpSignalledMessage */ GQueue *pending_messages; gboolean got_initial_messages; gboolean is_sms_channel; gboolean sms_flash; }; enum { PROP_SUPPORTED_CONTENT_TYPES = 1, PROP_MESSAGE_PART_SUPPORT_FLAGS, PROP_DELIVERY_REPORTING_SUPPORT, PROP_MESSAGE_TYPES, PROP_IS_SMS_CHANNEL, PROP_SMS_FLASH, }; enum /* signals */ { SIG_MESSAGE_RECEIVED, SIG_PENDING_MESSAGE_REMOVED, SIG_MESSAGE_SENT, SIG_CONTACT_CHAT_STATE_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0, }; static void tp_text_channel_dispose (GObject *obj) { TpTextChannel *self = (TpTextChannel *) obj; tp_clear_pointer (&self->priv->supported_content_types, g_strfreev); tp_clear_pointer (&self->priv->message_types, g_array_unref); g_queue_foreach (self->priv->pending_messages, (GFunc) g_object_unref, NULL); tp_clear_pointer (&self->priv->pending_messages, g_queue_free); G_OBJECT_CLASS (tp_text_channel_parent_class)->dispose (obj); } static void tp_text_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTextChannel *self = (TpTextChannel *) object; switch (property_id) { case PROP_SUPPORTED_CONTENT_TYPES: g_value_set_boxed (value, tp_text_channel_get_supported_content_types (self)); break; case PROP_MESSAGE_PART_SUPPORT_FLAGS: g_value_set_uint (value, tp_text_channel_get_message_part_support_flags (self)); break; case PROP_DELIVERY_REPORTING_SUPPORT: g_value_set_uint (value, tp_text_channel_get_delivery_reporting_support (self)); break; case PROP_MESSAGE_TYPES: g_value_set_boxed (value, tp_text_channel_get_message_types (self)); break; case PROP_IS_SMS_CHANNEL: g_value_set_boolean (value, tp_text_channel_is_sms_channel (self)); break; case PROP_SMS_FLASH: g_value_set_boolean (value, tp_text_channel_get_sms_flash (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static TpHandle get_sender (TpTextChannel *self, const GPtrArray *message, TpContact **contact, const gchar **out_sender_id) { const GHashTable *header; TpHandle handle; const gchar *sender_id = NULL; TpConnection *conn; g_assert (contact != NULL); header = g_ptr_array_index (message, 0); handle = tp_asv_get_uint32 (header, "message-sender", NULL); if (handle == 0) { DEBUG ("Message received on Channel %s doesn't have message-sender", tp_proxy_get_object_path (self)); *contact = NULL; goto out; } sender_id = tp_asv_get_string (header, "message-sender-id"); conn = tp_channel_get_connection ((TpChannel *) self); *contact = tp_connection_dup_contact_if_possible (conn, handle, sender_id); if (*contact == NULL) { if (!tp_connection_has_immortal_handles (conn)) DEBUG ("Connection %s don't have immortal handles, please fix CM", tp_proxy_get_object_path (conn)); else if (tp_str_empty (sender_id)) DEBUG ("Message received on %s doesn't include message-sender-id, " "please fix CM", tp_proxy_get_object_path (self)); } out: if (out_sender_id != NULL) *out_sender_id = sender_id; return handle; } static void prepare_sender_async (TpTextChannel *self, const GPtrArray *message, gboolean fallback_to_self, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *channel = (TpChannel *) self; TpContact *contact; TpHandle handle; const gchar *id; handle = get_sender (self, message, &contact, &id); if (contact == NULL && fallback_to_self) { TpConnection *conn; conn = tp_channel_get_connection ((TpChannel *) self); DEBUG ("Failed to get our self contact, please fix CM (%s)", tp_proxy_get_object_path (conn)); /* Use the connection self contact as a fallback */ contact = tp_connection_get_self_contact (conn); if (contact != NULL) g_object_ref (contact); } if (contact != NULL) { GPtrArray *contacts = g_ptr_array_new_with_free_func (g_object_unref); /* get_sender() refs the contact, we give that ref to the ptr-array */ g_ptr_array_add (contacts, contact); _tp_channel_contacts_queue_prepare_async (channel, contacts, callback, user_data); g_ptr_array_unref (contacts); } else if (id != NULL) { GPtrArray *ids = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (ids, g_strdup (id)); _tp_channel_contacts_queue_prepare_by_id_async (channel, ids, callback, user_data); g_ptr_array_unref (ids); } else if (handle != 0) { GArray *handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (handles, handle); _tp_channel_contacts_queue_prepare_by_handle_async (channel, handles, callback, user_data); g_array_unref (handles); } else { /* No sender. Still need to go through the queue to prevent reordering */ _tp_channel_contacts_queue_prepare_async (channel, NULL, callback, user_data); } } static TpContact * prepare_sender_finish (TpTextChannel *self, GAsyncResult *result, GError **error) { GPtrArray *contacts; TpContact *sender = NULL; _tp_channel_contacts_queue_prepare_finish ((TpChannel *) self, result, &contacts, error); if (contacts != NULL && contacts->len > 0) sender = g_object_ref (g_ptr_array_index (contacts, 0)); tp_clear_pointer (&contacts, g_ptr_array_unref); return sender; } static GPtrArray * copy_parts (const GPtrArray *parts) { return g_boxed_copy (TP_ARRAY_TYPE_MESSAGE_PART_LIST, parts); } static void free_parts (GPtrArray *parts) { g_boxed_free (TP_ARRAY_TYPE_MESSAGE_PART_LIST, parts); } typedef struct { GPtrArray *parts; guint flags; gchar *token; } MessageSentData; static void message_sent_sender_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpTextChannel *self = (TpTextChannel *) object; MessageSentData *data = user_data; TpContact *sender; TpMessage *msg; sender = prepare_sender_finish (self, result, NULL); msg = _tp_signalled_message_new (data->parts, sender); g_signal_emit (self, signals[SIG_MESSAGE_SENT], 0, msg, data->flags, data->token); g_object_unref (msg); free_parts (data->parts); g_free (data->token); g_slice_free (MessageSentData, data); } static void message_sent_cb (TpChannel *channel, const GPtrArray *parts, guint flags, const gchar *token, gpointer user_data, GObject *weak_object) { TpTextChannel *self = (TpTextChannel *) channel; MessageSentData *data; DEBUG ("New message sent"); data = g_slice_new (MessageSentData); data->parts = copy_parts (parts); data->flags = flags; data->token = tp_str_empty (token) ? NULL : g_strdup (token); prepare_sender_async (self, parts, TRUE, message_sent_sender_ready_cb, data); } static void chat_state_changed_cb (TpTextChannel *self, TpHandle handle, TpChannelChatState state) { TpConnection *conn; TpContact *contact; /* We have only an handle, but since we guarantee "contact-chat-state-changed" * to be emitted only if TP_CHANNEL_FEATURE_GROUP and * TP_CHANNEL_FEATURE_CONTACTS has been prepared, we should already have its * TpContact. If the TpContact does not exist, telling its chat state is * useless anyway. */ conn = tp_channel_get_connection ((TpChannel *) self); contact = tp_connection_dup_contact_if_possible (conn, handle, NULL); if (contact == NULL) return; g_signal_emit (self, signals[SIG_CONTACT_CHAT_STATE_CHANGED], 0, contact, state); g_object_unref (contact); } static void tp_text_channel_prepare_chat_states_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { /* This feature depends on TP_CHANNEL_FEATURE_CHAT_STATES so it's already * prepared. */ tp_simple_async_report_success_in_idle ((GObject *) proxy, callback, user_data, tp_text_channel_prepare_chat_states_async); } static void tp_text_channel_constructed (GObject *obj) { TpTextChannel *self = (TpTextChannel *) obj; void (*chain_up) (GObject *) = ((GObjectClass *) tp_text_channel_parent_class)->constructed; TpChannel *chan = (TpChannel *) obj; GHashTable *props; gboolean valid; GError *err = NULL; if (chain_up != NULL) chain_up (obj); if (tp_channel_get_channel_type_id (chan) != TP_IFACE_QUARK_CHANNEL_TYPE_TEXT) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Channel is not of type Text" }; DEBUG ("Channel %s is not of type Text: %s", tp_proxy_get_object_path (self), tp_channel_get_channel_type (chan)); tp_proxy_invalidate (TP_PROXY (self), &error); return; } if (!tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES)) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Channel does not implement the Messages interface" }; DEBUG ("Channel %s does not implement the Messages interface", tp_proxy_get_object_path (self)); tp_proxy_invalidate (TP_PROXY (self), &error); return; } /* Forward TpChannel::chat-state-changed as * TpTextChannel::contact-chat-state-changed */ g_signal_connect (self, "chat-state-changed", G_CALLBACK (chat_state_changed_cb), NULL); props = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); self->priv->supported_content_types = (GStrv) tp_asv_get_strv (props, TP_PROP_CHANNEL_INTERFACE_MESSAGES_SUPPORTED_CONTENT_TYPES); if (self->priv->supported_content_types == NULL) { const gchar * const plain[] = { "text/plain", NULL }; DEBUG ("Channel %s doesn't have Messages.SupportedContentTypes in its " "immutable properties", tp_proxy_get_object_path (self)); /* spec mandates that plain text is always allowed. */ self->priv->supported_content_types = g_strdupv ((GStrv) plain); } else { self->priv->supported_content_types = g_strdupv ( self->priv->supported_content_types); } self->priv->message_part_support_flags = tp_asv_get_uint32 (props, TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_PART_SUPPORT_FLAGS, &valid); if (!valid) { DEBUG ("Channel %s doesn't have Messages.MessagePartSupportFlags in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->delivery_reporting_support = tp_asv_get_uint32 (props, TP_PROP_CHANNEL_INTERFACE_MESSAGES_DELIVERY_REPORTING_SUPPORT, &valid); if (!valid) { DEBUG ("Channel %s doesn't have Messages.DeliveryReportingSupport in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->message_types = tp_asv_get_boxed (props, TP_PROP_CHANNEL_INTERFACE_MESSAGES_MESSAGE_TYPES, DBUS_TYPE_G_UINT_ARRAY); if (self->priv->message_types != NULL) { self->priv->message_types = g_boxed_copy (DBUS_TYPE_G_UINT_ARRAY, self->priv->message_types); } else { self->priv->message_types = g_array_new (FALSE, FALSE, sizeof (TpChannelTextMessageType)); DEBUG ("Channel %s doesn't have Messages.MessageTypes in its " "immutable properties", tp_proxy_get_object_path (self)); } tp_cli_channel_interface_messages_connect_to_message_sent (chan, message_sent_cb, NULL, NULL, NULL, &err); if (err != NULL) { WARNING ("Failed to connect to MessageSent on %s: %s", tp_proxy_get_object_path (self), err->message); g_error_free (err); } /* SMS */ self->priv->sms_flash = tp_asv_get_boolean (props, TP_PROP_CHANNEL_INTERFACE_SMS_FLASH, NULL); } static void add_message_received (TpTextChannel *self, const GPtrArray *parts, TpContact *sender, gboolean fire_received) { TpMessage *msg; msg = _tp_signalled_message_new (parts, sender); g_queue_push_tail (self->priv->pending_messages, msg); if (fire_received) g_signal_emit (self, signals[SIG_MESSAGE_RECEIVED], 0, msg); } static void message_received_sender_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpTextChannel *self = (TpTextChannel *) object; GPtrArray *parts = user_data; TpContact *sender; sender = prepare_sender_finish (self, result, NULL); add_message_received (self, parts, sender, TRUE); free_parts (parts); } static void message_received_cb (TpChannel *proxy, const GPtrArray *message, gpointer user_data, GObject *weak_object) { TpTextChannel *self = user_data; /* If we are still retrieving pending messages, no need to add the message, * it will be in the initial set of messages retrieved. */ if (!self->priv->got_initial_messages) return; DEBUG ("New message received"); prepare_sender_async (self, message, FALSE, message_received_sender_ready_cb, copy_parts (message)); } static gint find_msg_by_id (gconstpointer a, gconstpointer b) { TpMessage *msg = TP_MESSAGE (a); guint id = GPOINTER_TO_UINT (b); gboolean valid; guint msg_id; msg_id = _tp_signalled_message_get_pending_message_id (msg, &valid); if (!valid) return 1; return msg_id != id; } static void pending_messages_removed_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpTextChannel *self = (TpTextChannel *) object; TpChannel *channel = (TpChannel *) self; GArray *ids = user_data; guint i; _tp_channel_contacts_queue_prepare_finish (channel, result, NULL, NULL); for (i = 0; i < ids->len; i++) { guint id = g_array_index (ids, guint, i); GList *link_; TpMessage *msg; link_ = g_queue_find_custom (self->priv->pending_messages, GUINT_TO_POINTER (id), find_msg_by_id); if (link_ == NULL) { DEBUG ("Unable to find pending message having id %d", id); continue; } msg = link_->data; g_queue_delete_link (self->priv->pending_messages, link_); g_signal_emit (self, signals[SIG_PENDING_MESSAGE_REMOVED], 0, msg); g_object_unref (msg); } g_array_unref (ids); } static void pending_messages_removed_cb (TpChannel *channel, const GArray *ids, gpointer user_data, GObject *weak_object) { TpTextChannel *self = (TpTextChannel *) channel; GArray *ids_dup; if (!self->priv->got_initial_messages) return; /* We have nothing to prepare, but still we have to hook into the queue * to preserve order. Messages removed here could still be in that queue. */ ids_dup = g_array_sized_new (FALSE, FALSE, sizeof (guint), ids->len); g_array_append_vals (ids_dup, ids->data, ids->len); _tp_channel_contacts_queue_prepare_async (channel, NULL, pending_messages_removed_ready_cb, ids_dup); } static void pending_message_sender_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpTextChannel *self = (TpTextChannel *) object; GPtrArray *parts = user_data; TpContact *sender; sender = prepare_sender_finish (self, result, NULL); add_message_received (self, parts, sender, FALSE); self->priv->n_preparing_pending_messages--; if (self->priv->n_preparing_pending_messages == 0) { g_simple_async_result_complete (self->priv->pending_messages_result); g_clear_object (&self->priv->pending_messages_result); } free_parts (parts); } /* There is no TP_ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST_LIST (fdo #32433) */ #define ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST_LIST dbus_g_type_get_collection (\ "GPtrArray", TP_ARRAY_TYPE_MESSAGE_PART_LIST) static void get_pending_messages_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpTextChannel *self = (TpTextChannel *) proxy; GPtrArray *messages; guint i; self->priv->got_initial_messages = TRUE; if (error != NULL) { DEBUG ("Failed to get PendingMessages property: %s", error->message); g_simple_async_result_set_error (self->priv->pending_messages_result, error->domain, error->code, "Failed to get PendingMessages property: %s", error->message); g_simple_async_result_complete_in_idle (self->priv->pending_messages_result); g_clear_object (&self->priv->pending_messages_result); return; } if (!G_VALUE_HOLDS (value, ARRAY_TYPE_PENDING_TEXT_MESSAGE_LIST_LIST)) { DEBUG ("PendingMessages property is of the wrong type"); g_simple_async_result_set_error (self->priv->pending_messages_result, TP_ERROR, TP_ERROR_CONFUSED, "PendingMessages property is of the wrong type"); g_simple_async_result_complete_in_idle (self->priv->pending_messages_result); g_clear_object (&self->priv->pending_messages_result); return; } messages = g_value_get_boxed (value); if (messages->len == 0) { g_simple_async_result_complete_in_idle (self->priv->pending_messages_result); g_clear_object (&self->priv->pending_messages_result); return; } self->priv->n_preparing_pending_messages = messages->len; for (i = 0; i < messages->len; i++) { GPtrArray *parts = g_ptr_array_index (messages, i); prepare_sender_async (self, parts, FALSE, pending_message_sender_ready_cb, copy_parts (parts)); } } static void tp_text_channel_prepare_incoming_messages_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpTextChannel *self = (TpTextChannel *) proxy; TpChannel *channel = (TpChannel *) self; GError *error = NULL; tp_cli_channel_interface_messages_connect_to_message_received (channel, message_received_cb, proxy, NULL, G_OBJECT (proxy), &error); if (error != NULL) { g_simple_async_report_take_gerror_in_idle ((GObject *) self, callback, user_data, error); return; } tp_cli_channel_interface_messages_connect_to_pending_messages_removed ( channel, pending_messages_removed_cb, proxy, NULL, G_OBJECT (proxy), &error); if (error != NULL) { g_simple_async_report_take_gerror_in_idle ((GObject *) self, callback, user_data, error); return; } g_assert (self->priv->pending_messages_result == NULL); self->priv->pending_messages_result = g_simple_async_result_new ( (GObject *) proxy, callback, user_data, tp_text_channel_prepare_incoming_messages_async); tp_cli_dbus_properties_call_get (proxy, -1, TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "PendingMessages", get_pending_messages_cb, NULL, NULL, G_OBJECT (proxy)); } static void get_sms_channel_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpTextChannel *self = (TpTextChannel *) proxy; GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to get SMSChannel property: %s", error->message); g_simple_async_result_set_error (result, error->domain, error->code, "Failed to get SMSChannel property: %s", error->message); goto out; } if (!G_VALUE_HOLDS (value, G_TYPE_BOOLEAN)) { DEBUG ("SMSChannel property is of the wrong type"); g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_CONFUSED, "SMSChannel property is of the wrong type"); goto out; } self->priv->is_sms_channel = g_value_get_boolean (value); /* self->priv->is_sms_channel is set to FALSE by default, so only notify the * property change is it is now set to TRUE. */ if (self->priv->is_sms_channel) g_object_notify (G_OBJECT (self), "is-sms-channel"); out: g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void sms_channel_changed_cb (TpChannel *proxy, gboolean sms, gpointer user_data, GObject *weak_object) { TpTextChannel *self = (TpTextChannel *) proxy; if (self->priv->is_sms_channel == sms) return; self->priv->is_sms_channel = sms; g_object_notify (weak_object, "is-sms-channel"); } static void tp_text_channel_prepare_sms_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GError *error = NULL; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_text_channel_prepare_sms_async); tp_cli_channel_interface_sms_connect_to_sms_channel_changed ( (TpChannel *) proxy, sms_channel_changed_cb, NULL, NULL, G_OBJECT (proxy), &error); if (error != NULL) { WARNING ("Failed to connect to SMS.SMSChannelChanged: %s", error->message); g_error_free (error); } tp_cli_dbus_properties_call_get (proxy, -1, TP_IFACE_CHANNEL_INTERFACE_SMS, "SMSChannel", get_sms_channel_cb, result, NULL, G_OBJECT (proxy)); } enum { FEAT_INCOMING_MESSAGES, FEAT_SMS, FEAT_CHAT_STATES, N_FEAT }; static const TpProxyFeature * tp_text_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; static GQuark need_sms[2] = {0, 0}; static GQuark depends_chat_state[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_INCOMING_MESSAGES].name = TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES; features[FEAT_INCOMING_MESSAGES].prepare_async = tp_text_channel_prepare_incoming_messages_async; features[FEAT_SMS].name = TP_TEXT_CHANNEL_FEATURE_SMS; features[FEAT_SMS].prepare_async = tp_text_channel_prepare_sms_async; need_sms[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS; features[FEAT_SMS].interfaces_needed = need_sms; G_GNUC_BEGIN_IGNORE_DEPRECATIONS features[FEAT_CHAT_STATES].name = TP_TEXT_CHANNEL_FEATURE_CHAT_STATES; features[FEAT_CHAT_STATES].prepare_async = tp_text_channel_prepare_chat_states_async; depends_chat_state[0] = TP_CHANNEL_FEATURE_CHAT_STATES; features[FEAT_CHAT_STATES].depends_on = depends_chat_state; G_GNUC_END_IGNORE_DEPRECATIONS /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_text_channel_class_init (TpTextChannelClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); TpProxyClass *proxy_class = (TpProxyClass *) klass; GParamSpec *param_spec; gobject_class->constructed = tp_text_channel_constructed; gobject_class->get_property = tp_text_channel_get_property; gobject_class->dispose = tp_text_channel_dispose; proxy_class->list_features = tp_text_channel_list_features; /** * TpTextChannel:supported-content-types: * * A #GStrv containing the MIME types supported by this channel, with more * preferred MIME types appearing earlier in the array. * * Since: 0.13.10 */ param_spec = g_param_spec_boxed ("supported-content-types", "SupportedContentTypes", "The Messages.SupportedContentTypes property of the channel", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SUPPORTED_CONTENT_TYPES, param_spec); /** * TpTextChannel:message-part-support-flags: * * A #TpMessagePartSupportFlags indicating the level of support for * message parts on this channel. * * Since: 0.13.10 */ param_spec = g_param_spec_uint ("message-part-support-flags", "MessagePartSupportFlags", "The Messages.MessagePartSupportFlags property of the channel", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_MESSAGE_PART_SUPPORT_FLAGS, param_spec); /** * TpTextChannel:delivery-reporting-support: * * A #TpDeliveryReportingSupportFlags indicating features supported * by this channel. * * Since: 0.13.10 */ param_spec = g_param_spec_uint ("delivery-reporting-support", "DeliveryReportingSupport", "The Messages.DeliveryReportingSupport property of the channel", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_DELIVERY_REPORTING_SUPPORT, param_spec); /** * TpTextChannel:message-types: * * A #GArray containing the #TpChannelTextMessageType which may be sent on * this channel. * * Since: 0.13.16 */ param_spec = g_param_spec_boxed ("message-types", "MessageTypes", "The Messages.MessageTypes property of the channel", DBUS_TYPE_G_UINT_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_MESSAGE_TYPES, param_spec); /** * TpTextChannel:is-sms-channel: * * %TRUE if messages sent and received on this channel are transmitted * via SMS. * * This property is not guaranteed to have a meaningful value until * TP_TEXT_CHANNEL_FEATURE_SMS has been prepared. * * Since: 0.15.1 */ param_spec = g_param_spec_boolean ("is-sms-channel", "is SMS channel", "The SMS.SMSChannel property of the channel", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_IS_SMS_CHANNEL, param_spec); /** * TpTextChannel:sms-flash: * * %TRUE if this channel is exclusively for receiving class 0 SMSes * (and no SMSes can be sent using tp_text_channel_send_message_async() * on this channel). If %FALSE, no incoming class 0 SMSes will appear * on this channel. * * Since: 0.15.1 */ param_spec = g_param_spec_boolean ("sms-flash", "SMS flash", "The SMS.Flash property of the channel", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SMS_FLASH, param_spec); /** * TpTextChannel::message-received: * @self: the #TpTextChannel * @message: a #TpSignalledMessage * * The ::message-received signal is emitted when a new message has been * received on @self. * * The same @message object will be used by the * #TpTextChannel::pending-message-removed signal once @message has been * acked so you can simply compare pointers to identify the message. * * Note that this signal is only fired once the * #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared. * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ signals[SIG_MESSAGE_RECEIVED] = g_signal_new ("message-received", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_SIGNALLED_MESSAGE); /** * TpTextChannel::pending-message-removed: * @self: the #TpTextChannel * @message: a #TpSignalledMessage * * The ::pending-message-removed signal is emitted when @message * has been acked and so removed from the pending messages list. * * Note that this signal is only fired once the * #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared. * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ signals[SIG_PENDING_MESSAGE_REMOVED] = g_signal_new ( "pending-message-removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_SIGNALLED_MESSAGE); /** * TpTextChannel::message-sent: * @self: the #TpTextChannel * @message: a #TpSignalledMessage * @flags: the #TpMessageSendingFlags affecting how the message was sent * @token: an opaque token used to match any incoming delivery or failure * reports against this message, or %NULL if the message is not * readily identifiable. * * The ::message-sent signal is emitted when @message * has been submitted for sending. * * It is guaranteed that @message's #TpSignalledMessage:sender has all of the * features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Since: 0.13.10 */ signals[SIG_MESSAGE_SENT] = g_signal_new ( "message-sent", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, TP_TYPE_SIGNALLED_MESSAGE, G_TYPE_UINT, G_TYPE_STRING); g_type_class_add_private (gobject_class, sizeof (TpTextChannelPrivate)); /** * TpTextChannel::contact-chat-state-changed: * @self: a channel * @contact: a #TpContact for the local user or another contact * @state: the new #TpChannelChatState for the contact * * Emitted when a contact's chat state changes after tp_proxy_prepare_async() * has finished preparing features %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, * %TP_CHANNEL_FEATURE_GROUP and %TP_CHANNEL_FEATURE_CONTACTS. * * Since: 0.19.0 */ signals[SIG_CONTACT_CHAT_STATE_CHANGED] = g_signal_new ( "contact-chat-state-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_TYPE_CONTACT, G_TYPE_UINT); } static void tp_text_channel_init (TpTextChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_TEXT_CHANNEL, TpTextChannelPrivate); self->priv->pending_messages = g_queue_new (); } /** * tp_text_channel_new: * @conn: a #TpConnection; may not be %NULL * @object_path: the object path of the channel; may not be %NULL * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel, * as signalled by the NewChannel D-Bus signal or returned by the * CreateChannel and EnsureChannel D-Bus methods: a mapping from * strings (D-Bus interface name + "." + property name) to #GValue instances * @error: used to indicate the error if %NULL is returned * * Convenient function to create a new #TpTextChannel * * Returns: (transfer full): a newly created #TpTextChannel * * Since: 0.13.10 * Deprecated: Use tp_simple_client_factory_ensure_channel() instead. */ TpTextChannel * tp_text_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { return _tp_text_channel_new_with_factory (NULL, conn, object_path, immutable_properties, error); } TpTextChannel * _tp_text_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; return g_object_new (TP_TYPE_TEXT_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL); } /** * tp_text_channel_get_supported_content_types: * @self: a #TpTextChannel * * Return the #TpTextChannel:supported-content-types property * * Returns: (transfer none) : * the value of #TpTextChannel:supported-content-types * * Since: 0.13.10 */ const gchar * const * tp_text_channel_get_supported_content_types (TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), NULL); return (const gchar * const *) self->priv->supported_content_types; } /** * tp_text_channel_get_message_part_support_flags: * @self: a #TpTextChannel * * Return the #TpTextChannel:message-part-support-flags property * * Returns: the value of #TpTextChannel:message-part-support-flags * * Since: 0.13.10 */ TpMessagePartSupportFlags tp_text_channel_get_message_part_support_flags ( TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), 0); return self->priv->message_part_support_flags; } /** * tp_text_channel_get_delivery_reporting_support: * @self: a #TpTextChannel * * Return the #TpTextChannel:delivery-reporting-support property * * Returns: the value of #TpTextChannel:delivery-reporting-support property * * Since: 0.13.10 */ TpDeliveryReportingSupportFlags tp_text_channel_get_delivery_reporting_support ( TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), 0); return self->priv->delivery_reporting_support; } /** * TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES: * * Expands to a call to a function that returns a quark representing the * incoming messages features of a #TpTextChannel. * * When this feature is prepared, tp_text_channel_dup_pending_messages() will * return a non-empty list if any unacknowledged messages are waiting, and the * #TpTextChannel::message-received and #TpTextChannel::pending-message-removed * signals will be emitted. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.13.10 */ GQuark tp_text_channel_get_feature_quark_incoming_messages (void) { return g_quark_from_static_string ( "tp-text-channel-feature-incoming-messages"); } /** * tp_text_channel_get_pending_messages: * @self: a #TpTextChannel * * Return a newly allocated list of unacknowledged #TpSignalledMessage * objects. * * It is guaranteed that the #TpSignalledMessage:sender of each * #TpSignalledMessage has all of the features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Returns: (transfer container) (element-type TelepathyGLib.SignalledMessage): * a #GList of borrowed #TpSignalledMessage * * Since: 0.13.10 * Deprecated: Since 0.19.9. New code should use * tp_text_channel_dup_pending_messages() instead. */ GList * tp_text_channel_get_pending_messages (TpTextChannel *self) { return g_list_copy (g_queue_peek_head_link (self->priv->pending_messages)); } /** * tp_text_channel_dup_pending_messages: * @self: a #TpTextChannel * * Return a newly allocated list of unacknowledged #TpSignalledMessage * objects. * * It is guaranteed that the #TpSignalledMessage:sender of each * #TpSignalledMessage has all of the features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Returns: (transfer full) (element-type TelepathyGLib.SignalledMessage): * a #GList of reffed #TpSignalledMessage * * Since: 0.19.9 */ GList * tp_text_channel_dup_pending_messages (TpTextChannel *self) { return _tp_g_list_copy_deep ( g_queue_peek_head_link (self->priv->pending_messages), (GCopyFunc) g_object_ref, NULL); } static void send_message_cb (TpChannel *proxy, const gchar *token, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to send message: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_set_op_res_gpointer (result, tp_str_empty (token) ? NULL : g_strdup (token), g_free); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_text_channel_send_message_async: * @self: a #TpTextChannel * @message: a #TpClientMessage * @flags: flags affecting how the message is sent * @callback: a callback to call when the message has been submitted to the * server * @user_data: data to pass to @callback * * Submit a message to the server for sending. Once the message has been * submitted to the sever, @callback will be called. You can then call * tp_text_channel_send_message_finish() to get the result of the operation. * * Since: 0.13.10 */ void tp_text_channel_send_message_async (TpTextChannel *self, TpMessage *message, TpMessageSendingFlags flags, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_TEXT_CHANNEL (self)); g_return_if_fail (TP_IS_CLIENT_MESSAGE (message)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_text_channel_send_message_async); tp_cli_channel_interface_messages_call_send_message (TP_CHANNEL (self), -1, message->parts, flags, send_message_cb, result, NULL, NULL); } /** * tp_text_channel_send_message_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult passed to the callback for tp_text_channel_send_message_async() * @token: (out) (transfer full): if not %NULL, used to return the * token of the sent message * @error: a #GError to fill * * Completes a call to tp_text_channel_send_message_async(). * * @token can be used to match any incoming delivery or failure reports * against the sent message. If this function returns true but the returned * token is %NULL, the message was sent successfully but the protocol does not * provide a way to identify it later. * * Returns: %TRUE if the message has been submitted to the server, %FALSE * otherwise. * * Since: 0.13.10 */ gboolean tp_text_channel_send_message_finish (TpTextChannel *self, GAsyncResult *result, gchar **token, GError **error) { _tp_implement_finish_copy_pointer (self, tp_text_channel_send_message_async, g_strdup, token); } static void acknowledge_pending_messages_ready_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpChannel *channel = (TpChannel *) object; GSimpleAsyncResult *result = user_data; _tp_channel_contacts_queue_prepare_finish (channel, res, NULL, NULL); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static void acknowledge_pending_messages_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to ack messages: %s", error->message); g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } /* We should have already got MessagesRemoved signal, but it could still be * in the queue. So we have to hook into that queue before complete to be * sure messages are removed from pending_messages */ _tp_channel_contacts_queue_prepare_async (channel, NULL, acknowledge_pending_messages_ready_cb, result); } /** * tp_text_channel_ack_messages_async: * @self: a #TpTextChannel * @messages: (element-type TelepathyGLib.SignalledMessage): a #GList of * #TpSignalledMessage * @callback: a callback to call when the message have been acked * @user_data: data to pass to @callback * * Acknowledge all the messages in @messages. * Once the messages have been acked, @callback will be called. * You can then call tp_text_channel_ack_messages_finish() to get the * result of the operation. * * You should use the #TpSignalledMessage received from * tp_text_channel_dup_pending_messages() or the * #TpTextChannel::message-received signal. * * See tp_text_channel_ack_message_async() about acknowledging messages. * * Since: 0.13.10 */ void tp_text_channel_ack_messages_async (TpTextChannel *self, const GList *messages, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *chan = (TpChannel *) self; GArray *ids; GList *l; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_TEXT_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_text_channel_ack_messages_async); if (messages == NULL) { /* Nothing to ack, succeed immediately */ g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), g_list_length ((GList *) messages)); for (l = (GList *) messages; l != NULL; l = g_list_next (l)) { TpMessage *msg = l->data; guint id; gboolean valid; g_return_if_fail (TP_IS_SIGNALLED_MESSAGE (msg)); id = _tp_signalled_message_get_pending_message_id (msg, &valid); if (!valid) { DEBUG ("Message doesn't have pending-message-id ?!"); continue; } g_array_append_val (ids, id); } tp_cli_channel_type_text_call_acknowledge_pending_messages (chan, -1, ids, acknowledge_pending_messages_cb, result, NULL, G_OBJECT (self)); g_array_unref (ids); } /** * tp_text_channel_ack_messages_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult passed to the callback for tp_text_channel_ack_messages_async() * @error: a #GError to fill * * Finishes acknowledging a list of messages. * * Returns: %TRUE if the messages have been acked, %FALSE otherwise. * * Since: 0.13.10 */ gboolean tp_text_channel_ack_messages_finish (TpTextChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_text_channel_ack_messages_async) } /** * tp_text_channel_ack_message_async: * @self: a #TpTextChannel * @message: a #TpSignalledMessage * @callback: a callback to call when the message have been acked * @user_data: data to pass to @callback * * Acknowledge @message. Once the message has been acked, @callback will be * called. You can then call tp_text_channel_ack_message_finish() to get the * result of the operation. * * A message should be acknowledged once it has been shown to the user by the * Handler of the channel. So Observers and Approvers should NOT acknowledge * messages themselves. * Once a message has been acknowledged, it is removed from the * pending-message queue and so the #TpTextChannel::pending-message-removed * signal is fired. * * You should use the #TpSignalledMessage received from * tp_text_channel_dup_pending_messages() or the * #TpTextChannel::message-received signal. * * Since: 0.13.10 */ void tp_text_channel_ack_message_async (TpTextChannel *self, TpMessage *message, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *chan = (TpChannel *) self; GSimpleAsyncResult *result; GArray *ids; guint id; gboolean valid; g_return_if_fail (TP_IS_TEXT_CHANNEL (self)); g_return_if_fail (TP_IS_SIGNALLED_MESSAGE (message)); id = _tp_signalled_message_get_pending_message_id (message, &valid); if (!valid) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Message doesn't have a pending-message-id"); return; } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_text_channel_ack_message_async); ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); g_array_append_val (ids, id); tp_cli_channel_type_text_call_acknowledge_pending_messages (chan, -1, ids, acknowledge_pending_messages_cb, result, NULL, G_OBJECT (self)); g_array_unref (ids); } /** * tp_text_channel_ack_message_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult passed to the callback for tp_text_channel_ack_message_async() * @error: a #GError to fill * * Finishes acknowledging a message. * * Returns: %TRUE if the message has been acked, %FALSE otherwise. * * Since: 0.13.10 */ gboolean tp_text_channel_ack_message_finish (TpTextChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_text_channel_ack_message_async) } /** * TP_TEXT_CHANNEL_FEATURE_CHAT_STATES: * * Expands to a call to a function that returns a quark representing the * chat states feature on a #TpTextChannel. * * When this feature is prepared, tp_text_channel_get_chat_state() and the * #TpTextChannel::contact-chat-state-changed signal become useful. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.19.0 */ GQuark tp_text_channel_get_feature_quark_chat_states (void) { return g_quark_from_static_string ("tp-text-channel-feature-chat-states"); } /** * tp_text_channel_get_chat_state: * @self: a channel * @contact: a #TpContact * * Return the chat state for the given contact. If tp_proxy_is_prepared() * would return %FALSE for the feature %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, * the result will always be %TP_CHANNEL_CHAT_STATE_INACTIVE. * * Returns: the chat state for @contact, or %TP_CHANNEL_CHAT_STATE_INACTIVE * if their chat state is not known * Since: 0.19.0 */ TpChannelChatState tp_text_channel_get_chat_state (TpTextChannel *self, TpContact *contact) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), 0); /* Use the deprecated function internally to avoid duplicated introspection */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS return tp_channel_get_chat_state ((TpChannel *) self, tp_contact_get_handle (contact)); G_GNUC_END_IGNORE_DEPRECATIONS } static void set_chat_state_cb (TpChannel *proxy, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("SetChatState failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_text_channel_set_chat_state_async: * @self: a #TpTextChannel * @state: a #TpChannelChatState to set * @callback: a callback to call when the chat state has been set * @user_data: data to pass to @callback * * Set the local state on channel @self to @state. * Once the state has been set, @callback will be called. * You can then call tp_text_channel_set_chat_state_finish() to get the * result of the operation. * * Since: 0.13.10 */ void tp_text_channel_set_chat_state_async (TpTextChannel *self, TpChannelChatState state, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_text_channel_set_chat_state_async); tp_cli_channel_interface_chat_state_call_set_chat_state (TP_CHANNEL (self), -1, state, set_chat_state_cb, result, NULL, G_OBJECT (self)); } /** * tp_text_channel_set_chat_state_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult passed to the callback for tp_text_channel_set_chat_state_async() * @error: a #GError to fill * * Completes a call to tp_text_channel_set_chat_state_async(). * * Returns: %TRUE if the chat state has been changed, %FALSE otherwise. * * Since: 0.13.10 */ gboolean tp_text_channel_set_chat_state_finish (TpTextChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_text_channel_set_chat_state_async) } /** * tp_text_channel_get_message_types: * @self: a #TpTextChannel * * Return the #TpTextChannel:message-types property * * Returns: (transfer none) (element-type TelepathyGLib.ChannelTextMessageType): * the value of #TpTextChannel:message-types * * Since: 0.13.16 */ GArray * tp_text_channel_get_message_types (TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), NULL); return self->priv->message_types; } /** * tp_text_channel_supports_message_type: * @self: a #TpTextChannel * @message_type: a #TpChannelTextMessageType * * Check if message of type @message_type can be sent on this channel. * * Returns: %TRUE if message of type @message_type can be sent on @self, %FALSE * otherwise * * Since: 0.13.16 */ gboolean tp_text_channel_supports_message_type (TpTextChannel *self, TpChannelTextMessageType message_type) { guint i; for (i = 0; i < self->priv->message_types->len; i++) { TpChannelTextMessageType tmp = g_array_index (self->priv->message_types, TpChannelTextMessageType, i); if (tmp == message_type) return TRUE; } return FALSE; } /** * TP_TEXT_CHANNEL_FEATURE_SMS: * * Expands to a call to a function that returns a quark representing the * SMS feature of a #TpTextChannel. * * When this feature is prepared, the TpTextChannel:is-sms-channel property * will have a meaningful value and will be updated when needed. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.1 */ GQuark tp_text_channel_get_feature_quark_sms (void) { return g_quark_from_static_string ("tp-text-channel-feature-sms"); } /** * tp_text_channel_is_sms_channel: * @self: a #TpTextChannel * * Return the #TpTextChannel:is-sms-channel property * * Returns: the value of #TpTextChannel:is-sms-channel property * * Since: 0.15.1 */ gboolean tp_text_channel_is_sms_channel (TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), FALSE); return self->priv->is_sms_channel; } /** * tp_text_channel_get_sms_flash: * @self: a #TpTextChannel * * Return the #TpTextChannel:sms-flash property * * Returns: the value of #TpTextChannel:sms-flash property * * Since: 0.15.1 */ gboolean tp_text_channel_get_sms_flash (TpTextChannel *self) { g_return_val_if_fail (TP_IS_TEXT_CHANNEL (self), FALSE); return self->priv->sms_flash; } typedef struct { guint chunks_required; gint remaining_characters; gint estimated_cost; } GetSmsLengthReturn; static GetSmsLengthReturn * get_sms_length_return_new (guint chunks_required, gint remaining_characters, gint estimated_cost) { GetSmsLengthReturn *result = g_slice_new (GetSmsLengthReturn); result->chunks_required = chunks_required; result->remaining_characters = remaining_characters; result->estimated_cost = estimated_cost; return result; } static void get_sms_length_return_free (GetSmsLengthReturn *r) { g_slice_free (GetSmsLengthReturn, r); } static void get_sms_length_cb (TpChannel *proxy, guint chunks_required, gint remaining_characters, gint estimated_cost, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; GetSmsLengthReturn *r; if (error != NULL) { DEBUG ("Failed to get SMS length: %s", error->message); g_simple_async_result_set_from_error (result, error); goto out; } r = get_sms_length_return_new (chunks_required, remaining_characters, estimated_cost); g_simple_async_result_set_op_res_gpointer (result, r, (GDestroyNotify) get_sms_length_return_free); out: g_simple_async_result_complete_in_idle (result); } /** * tp_text_channel_get_sms_length_async: * @self: a #TpTextChannel * @message: a #TpClientMessage * @callback: a callback to call when the request has been satisfied * @user_data: data to pass to @callback * * Starts an async call to get the number of 140 octet chunks required to * send a #message via SMS on #self, as well as the number of remaining * characters available in the final chunk and, if possible, * an estimate of the cost. * * Once the request has been satisfied, @callback will be called. * You can then call tp_text_channel_get_sms_length_finish() to get the * result of the operation. * * Since: 0.15.1 */ void tp_text_channel_get_sms_length_async (TpTextChannel *self, TpMessage *message, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_text_channel_get_sms_length_async); tp_cli_channel_interface_sms_call_get_sms_length ((TpChannel *) self, -1, message->parts, get_sms_length_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_text_channel_get_sms_length_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult * @chunks_required: (out): if not %NULL used to return * the number of 140 octet chunks required to send the message. * @remaining_characters: (out): if not %NULL used to return * the number of further characters that can be fit in the final chunk. * A negative value indicates that the message will be truncated by * abs(@remaining_characters). * The value #G_MININT32 indicates the message will be truncated by * an unknown amount. * @estimated_cost: (out): if not %NULL used to return * the estimated cost of sending this message. * The currency and scale of this value are the same as the * values of the #TpConnection:balance-scale and * #TpConnection:balance-currency properties. * A value of -1 indicates the cost could not be estimated. * @error: a #GError to fill * * Finishes an async SMS length request. * * Returns: %TRUE if the number of 140 octet chunks required to send * the message has been retrieved, %FALSE otherwise. * * Since: 0.15.1 */ gboolean tp_text_channel_get_sms_length_finish (TpTextChannel *self, GAsyncResult *result, guint *chunks_required, gint *remaining_characters, gint *estimated_cost, GError **error) { GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; GetSmsLengthReturn *r; if (g_simple_async_result_propagate_error (simple, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), tp_text_channel_get_sms_length_async), FALSE); r = g_simple_async_result_get_op_res_gpointer (simple); if (chunks_required != NULL) *chunks_required = r->chunks_required; if (remaining_characters != NULL) *remaining_characters = r->remaining_characters; if (estimated_cost != NULL) *estimated_cost = r->estimated_cost; return TRUE; } /** * tp_text_channel_ack_all_pending_messages_async: * @self: a #TpTextChannel * @callback: a callback to call when the messages have been acked * @user_data: data to pass to @callback * * Acknowledge all the pending messages. This is equivalent of calling * tp_text_channel_ack_messages_async() with the list of #TpSignalledMessage * returned by tp_text_channel_dup_pending_messages(). * * Once the messages have been acked, @callback will be called. * You can then call tp_text_channel_ack_all_pending_messages_finish() to get * the result of the operation. * * See tp_text_channel_ack_message_async() about acknowledging messages. * * Since: 0.15.3 */ void tp_text_channel_ack_all_pending_messages_async (TpTextChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GList *messages; messages = g_queue_peek_head_link (self->priv->pending_messages); tp_text_channel_ack_messages_async (self, messages, callback, user_data); } /** * tp_text_channel_ack_all_pending_messages_finish: * @self: a #TpTextChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finish an asynchronous acknowledgement operation of all messages. * * Returns: %TRUE if the messages have been acked, %FALSE otherwise. * * Since: 0.15.3 */ gboolean tp_text_channel_ack_all_pending_messages_finish (TpTextChannel *self, GAsyncResult *result, GError **error) { return tp_text_channel_ack_messages_finish (self, result, error); } telepathy-glib-0.24.2/telepathy-glib/text-channel.h0000644000175000017500000001351612652510705017120 00000000000000/* * text-channel.h - high level API for Text channels * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_TEXT_CHANNEL_H__ #define __TP_TEXT_CHANNEL_H__ #include #include #include #include G_BEGIN_DECLS #define TP_TYPE_TEXT_CHANNEL (tp_text_channel_get_type ()) #define TP_TEXT_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_TEXT_CHANNEL, TpTextChannel)) #define TP_TEXT_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_TEXT_CHANNEL, TpTextChannelClass)) #define TP_IS_TEXT_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_TEXT_CHANNEL)) #define TP_IS_TEXT_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_TEXT_CHANNEL)) #define TP_TEXT_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_TEXT_CHANNEL, TpTextChannelClass)) typedef struct _TpTextChannel TpTextChannel; typedef struct _TpTextChannelClass TpTextChannelClass; typedef struct _TpTextChannelPrivate TpTextChannelPrivate; struct _TpTextChannel { /**/ TpChannel parent; TpTextChannelPrivate *priv; }; struct _TpTextChannelClass { /**/ TpChannelClass parent_class; GCallback _padding[7]; }; GType tp_text_channel_get_type (void); _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_channel) TpTextChannel *tp_text_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); const gchar * const * /* gtk-doc sucks */ tp_text_channel_get_supported_content_types (TpTextChannel *self); TpMessagePartSupportFlags tp_text_channel_get_message_part_support_flags ( TpTextChannel *self); TpDeliveryReportingSupportFlags tp_text_channel_get_delivery_reporting_support ( TpTextChannel *self); GArray * tp_text_channel_get_message_types (TpTextChannel *self); gboolean tp_text_channel_supports_message_type (TpTextChannel *self, TpChannelTextMessageType message_type); #define TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES \ tp_text_channel_get_feature_quark_incoming_messages () GQuark tp_text_channel_get_feature_quark_incoming_messages (void) G_GNUC_CONST; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_text_channel_dup_pending_messages) GList * tp_text_channel_get_pending_messages (TpTextChannel *self); #endif _TP_AVAILABLE_IN_0_20 GList * tp_text_channel_dup_pending_messages (TpTextChannel *self); void tp_text_channel_send_message_async (TpTextChannel *self, TpMessage *message, TpMessageSendingFlags flags, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_text_channel_send_message_finish (TpTextChannel *self, GAsyncResult *result, gchar **token, GError **error); void tp_text_channel_ack_messages_async (TpTextChannel *self, const GList *messages, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_text_channel_ack_messages_finish (TpTextChannel *self, GAsyncResult *result, GError **error); void tp_text_channel_ack_message_async (TpTextChannel *self, TpMessage *message, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_text_channel_ack_message_finish (TpTextChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_text_channel_ack_all_pending_messages_async (TpTextChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_text_channel_ack_all_pending_messages_finish (TpTextChannel *self, GAsyncResult *result, GError **error); #define TP_TEXT_CHANNEL_FEATURE_CHAT_STATES \ tp_text_channel_get_feature_quark_chat_states () _TP_AVAILABLE_IN_0_20 GQuark tp_text_channel_get_feature_quark_chat_states (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_20 TpChannelChatState tp_text_channel_get_chat_state (TpTextChannel *self, TpContact *contact); void tp_text_channel_set_chat_state_async (TpTextChannel *self, TpChannelChatState state, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_text_channel_set_chat_state_finish (TpTextChannel *self, GAsyncResult *result, GError **error); #define TP_TEXT_CHANNEL_FEATURE_SMS \ tp_text_channel_get_feature_quark_sms () _TP_AVAILABLE_IN_0_16 GQuark tp_text_channel_get_feature_quark_sms (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 gboolean tp_text_channel_is_sms_channel (TpTextChannel *self); _TP_AVAILABLE_IN_0_16 gboolean tp_text_channel_get_sms_flash (TpTextChannel *self); _TP_AVAILABLE_IN_0_16 void tp_text_channel_get_sms_length_async (TpTextChannel *self, TpMessage *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_text_channel_get_sms_length_finish (TpTextChannel *self, GAsyncResult *result, guint *chunks_required, gint *remaining_characters, gint *estimated_cost, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/contact-operations.c0000644000175000017500000003070412652510705020333 00000000000000/* Async operations for TpContact * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #define DEBUG_FLAG TP_DEBUG_CONTACTS #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" static void generic_callback (TpConnection *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Operation failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } /* tp_cli callbacks can potentially be called in a re-entrant way, * so we can't necessarily complete @result without using an idle. */ g_simple_async_result_complete_in_idle (result); } /* Small macro trick because DBus method is remove_contacts and in this * TpContact helper API we removed the redundant _contacts. */ #define tp_contact_remove_contacts_async tp_contact_remove_async #define contact_list_generic_async(method, ...) \ G_STMT_START { \ GSimpleAsyncResult *result; \ TpHandle handle; \ GArray *handles; \ \ g_return_if_fail (TP_IS_CONTACT (self)); \ \ handle = tp_contact_get_handle (self); \ handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); \ g_array_append_val (handles, handle); \ \ result = g_simple_async_result_new ((GObject *) self, callback, user_data, \ tp_contact_##method##_async); \ \ tp_cli_connection_interface_contact_list_call_##method ( \ tp_contact_get_connection (self), -1, handles, ##__VA_ARGS__, \ generic_callback, result, g_object_unref, NULL); \ g_array_unref (handles); \ } G_STMT_END #define generic_finish(method) \ _tp_implement_finish_void (self, tp_contact_##method##_async); /** * tp_contact_request_subscription_async: * @self: a #TpContact * @message: an optional message * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_request_subscription_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_request_subscription_async (TpContact *self, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (request_subscription, message); } /** * tp_contact_request_subscription_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_request_subscription_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_request_subscription_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (request_subscription); } /** * tp_contact_authorize_publication_async: * @self: a #TpContact * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_authorize_publication_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_authorize_publication_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (authorize_publication); } /** * tp_contact_authorize_publication_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_authorize_publication_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_authorize_publication_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (authorize_publication); } /** * tp_contact_remove_async: * @self: a #TpContact * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_remove_contacts_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_remove_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (remove_contacts); } /** * tp_contact_remove_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_remove_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_remove_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (remove_contacts); } /** * tp_contact_unsubscribe_async: * @self: a #TpContact * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_unsubscribe_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_unsubscribe_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (unsubscribe); } /** * tp_contact_unsubscribe_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_unsubscribe_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_unsubscribe_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (unsubscribe); } /** * tp_contact_unpublish_async: * @self: a #TpContact * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_unpublish_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_unpublish_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (unpublish); } /** * tp_contact_unpublish_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_unpublish_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_unpublish_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (unpublish); } #define contact_groups_generic_async(method) \ G_STMT_START { \ GSimpleAsyncResult *result; \ TpHandle handle; \ GArray *handles; \ \ g_return_if_fail (TP_IS_CONTACT (self)); \ \ handle = tp_contact_get_handle (self); \ handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); \ g_array_append_val (handles, handle); \ \ result = g_simple_async_result_new ((GObject *) self, callback, user_data, \ tp_contact_##method##_async); \ \ tp_cli_connection_interface_contact_groups_call_##method ( \ tp_contact_get_connection (self), -1, group, handles, \ generic_callback, result, g_object_unref, NULL); \ g_array_unref (handles); \ } G_STMT_END /** * tp_contact_add_to_group_async: * @self: a #TpContact * @group: the group to alter. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_add_to_group_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_add_to_group_async (TpContact *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { contact_groups_generic_async (add_to_group); } /** * tp_contact_add_to_group_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_add_to_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_add_to_group_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (add_to_group); } /** * tp_contact_remove_from_group_async: * @self: a #TpContact * @group: the group to alter. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Convenience wrapper for tp_connection_remove_from_group_async() * on a single contact. * * Since: 0.15.5 */ void tp_contact_remove_from_group_async (TpContact *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { contact_groups_generic_async (remove_from_group); } /** * tp_contact_remove_from_group_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_remove_from_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_contact_remove_from_group_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (remove_from_group); } /* ContactBlocking */ /** * tp_contact_block_async: * @self: a #TpContact * @report_abusive: If %TRUE, report this contact as abusive to the * server administrators as well as blocking him. See * #TpConnection:can-report-abusive to discover whether reporting abuse is * supported. If #TpConnection:can-report-abusive is %FALSE, this parameter will * be ignored. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Block communications with a contact, optionally reporting the contact as * abusive to the server administrators. To block more than one contact at once, * see tp_connection_block_contacts_async(). * * Since: 0.17.0 */ void tp_contact_block_async (TpContact *self, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; TpHandle handle; GArray *handles; g_return_if_fail (TP_IS_CONTACT (self)); handle = tp_contact_get_handle (self); handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (handles, handle); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_contact_block_async); tp_cli_connection_interface_contact_blocking_call_block_contacts ( tp_contact_get_connection (self), -1, handles, report_abusive, generic_callback, result, g_object_unref, NULL); g_array_unref (handles); } /** * tp_contact_block_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_block_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.17.0 */ gboolean tp_contact_block_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (block); } /** * tp_contact_unblock_async: * @self: a #TpContact * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Unblock communications with a contact. To unblock more than one contact * at once, see tp_connection_unblock_contacts_async(). * * Since: 0.17.0 */ void tp_contact_unblock_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; TpHandle handle; GArray *handles; g_return_if_fail (TP_IS_CONTACT (self)); handle = tp_contact_get_handle (self); handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (handles, handle); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_contact_unblock_async); tp_cli_connection_interface_contact_blocking_call_unblock_contacts ( tp_contact_get_connection (self), -1, handles, generic_callback, result, g_object_unref, NULL); g_array_unref (handles); } /** * tp_contact_unblock_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_contact_unblock_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.17.0 */ gboolean tp_contact_unblock_finish (TpContact *self, GAsyncResult *result, GError **error) { generic_finish (unblock); } telepathy-glib-0.24.2/telepathy-glib/contact-operations.h0000644000175000017500000000723212652510705020340 00000000000000/* Async operations for TpContact * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONTACT_OPERATIONS_H__ #define __TP_CONTACT_OPERATIONS_H__ #include #include G_BEGIN_DECLS _TP_AVAILABLE_IN_0_16 void tp_contact_request_subscription_async (TpContact *self, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_request_subscription_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_authorize_publication_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_authorize_publication_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_remove_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_remove_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_unsubscribe_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_unsubscribe_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_unpublish_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_unpublish_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_add_to_group_async (TpContact *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_add_to_group_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_contact_remove_from_group_async (TpContact *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_contact_remove_from_group_finish (TpContact *self, GAsyncResult *result, GError **error); /* ContactBlocking */ _TP_AVAILABLE_IN_0_18 void tp_contact_block_async (TpContact *self, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_contact_block_finish (TpContact *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_contact_unblock_async (TpContact *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_contact_unblock_finish (TpContact *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-manager.c0000644000175000017500000006537212652510705017550 00000000000000/* * channel-manager.c - factory and manager for channels relating to a * particular protocol feature * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:channel-manager * @title: TpChannelManager * @short_description: interface for creating and tracking channels * @see_also: #TpSvcConnection * * A channel manager is attached to a connection. It carries out channel * requests from the connection, and responds to channel-related events on the * underlying network connection, for particular classes of channel (for * example, incoming and outgoing calls, respectively). It also tracks * currently-open channels of the relevant kinds. * * The connection has an array of channel managers. In response to a call to * CreateChannel or RequestChannel, the channel request is offered to each * channel manager in turn, until one accepts the request. In a trivial * implementation there might be a single channel manager which handles all * requests and all incoming events, but in general, there will be multiple * channel managers handling different types of channel. * * For example, at the time of writing, Gabble has a roster channel manager * which handles contact lists and groups, an IM channel manager which * handles one-to-one messaging, a MUC channel manager which handles * multi-user chat rooms, the index of chat rooms and MUC tubes, a media * channel manager which handles VoIP calls, and a 1-1 tubes channel manager. * * Since: 0.7.15 */ /** * TpChannelManager: * * Opaque typedef representing any channel manager implementation. */ /** * TpChannelManagerForeachChannelFunc: * @manager: an object implementing #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the second argument of @func * * Signature of an implementation of foreach_channel, which must call * func(channel, user_data) for each channel managed by this channel manager. */ /** * TpChannelManagerChannelClassFunc: * @manager: An object implementing #TpChannelManager * @fixed_properties: A table mapping (const gchar *) property names to * GValues, representing the values those properties must take to request * channels of a particular class. * @allowed_properties: A %NULL-terminated array of property names which may * appear in requests for a particular channel class. * @user_data: Arbitrary user-supplied data. * * Signature of callbacks which act on each channel class supported by @manager. */ /** * TpChannelManagerForeachChannelClassFunc: * @manager: An object implementing #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the final argument of @func * * Signature of an implementation of foreach_channel_class, which must call * func(manager, fixed, allowed, user_data) for each channel class understood * by @manager. */ /** * TpChannelManagerTypeChannelClassFunc: * @type: A type whose instances implement #TpChannelManager * @fixed_properties: A table mapping (const gchar *) property names to * GValues, representing the values those properties must take to request * channels of a particular class. * @allowed_properties: A %NULL-terminated array of property names which may * appear in requests for a particular channel class. * @user_data: Arbitrary user-supplied data. * * Signature of callbacks which act on each channel class potentially supported * by instances of @type. */ /** * TpChannelManagerTypeForeachChannelClassFunc: * @type: A type whose instances implement #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the final argument of @func * * Signature of an implementation of type_foreach_channel_class, which must * call func(type, fixed, allowed, user_data) for each channel class * potentially understood by instances of @type. */ /** * TpChannelManagerRequestFunc: * @manager: An object implementing #TpChannelManager * @request_token: An opaque pointer representing this pending request. * @request_properties: A table mapping (const gchar *) property names to * GValue, representing the desired properties of a channel requested by a * Telepathy client. The hash table will be freed after the function returns; * if the channel manager wants to keep it around, it must copy it. * * Signature of an implementation of #TpChannelManagerIface.create_channel and * #TpChannelManagerIface.request_channel. * * Implementations should inspect the contents of @request_properties to see if * it matches a channel class handled by this manager. If so, they should * return %TRUE to accept responsibility for the request, and ultimately emit * exactly one of the #TpChannelManager::new-channels, * #TpChannelManager::request-already-satisfied and * #TpChannelManager::request-failed signals (including @request_token in * the appropriate argument). * * If the implementation does not want to handle the request, it should return * %FALSE to allow the request to be offered to another channel manager. * * Implementations may assume the following of @request_properties: * * * * the ChannelType property is present, and is a (const gchar *) * * * the TargetHandleType property is a valid #TpHandleType, if present * * * if TargetHandleType is None, TargetHandle is omitted * * * if TargetHandleType is not None, TargetHandle is a valid #TpHandle of * that #TpHandleType * * * * Changed in version 0.15.5: Previously the TargetID * property was guaranteed to be missing from @request_properties. Now * it is always present, whether it was in the original channel * request or not. * * Returns: %TRUE if @manager will handle this request, else %FALSE. */ /** * TpChannelManagerIface: * @parent: Fields shared with GTypeInterface. * @foreach_channel: Call func(channel, user_data) for each channel managed by * this manager. If not implemented, the manager is assumed to manage no * channels. * @foreach_channel_class: Call func(manager, fixed, allowed, user_data) for * each class of channel that this instance can create (a subset of the * channel classes produced by @type_foreach_channel_class). If not * implemented, @type_foreach_channel_class is used. * @create_channel: Respond to a request for a new channel made with the * Connection.Interface.Requests.CreateChannel method. See * #TpChannelManagerRequestFunc for details. * @request_channel: Respond to a request for a (new or existing) channel made * with the Connection.RequestChannel method. See #TpChannelManagerRequestFunc * for details. * @ensure_channel: Respond to a request for a (new or existing) channel made * with the Connection.Interface.Requests.EnsureChannel method. See * #TpChannelManagerRequestFunc for details. * Since: 0.7.16 * @type_foreach_channel_class: Call func(cls, fixed, allowed, user_data) * for each class of channel that instances of this class might be able to * create. * Since: 0.11.11 * * The vtable for a channel manager implementation. * * In addition to the fields documented here there are several GCallback * fields which must currently be %NULL. * * Since: 0.7.15 */ #include "config.h" #include "channel-manager.h" #include #include #include #include enum { S_NEW_CHANNELS, S_REQUEST_ALREADY_SATISFIED, S_REQUEST_FAILED, S_CHANNEL_CLOSED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; static void channel_manager_base_init (gpointer klass) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; /** * TpChannelManager::new-channels: * @self: the channel manager * @channels: a #GHashTable where the keys are * #TpExportableChannel instances (hashed and compared * by g_direct_hash() and g_direct_equal()) and the values are * linked lists (#GSList) of request tokens (opaque pointers) satisfied * by these channels * * Emitted when new channels have been created. The Connection should * generally emit NewChannels (and NewChannel) in response to this * signal, and then return from pending CreateChannel, EnsureChannel * and/or RequestChannel calls if appropriate. * * Since 0.19.1, clients should not emit more than one * channel in this signal at one time as the creation of * multiple channels together in a single signal is strongly * recommended against: it's very complicated, hard to get * right in clients, and not nearly as useful as it originally * sounded. */ signals[S_NEW_CHANNELS] = g_signal_new ("new-channels", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_POINTER); /** * TpChannelManager::request-already-satisfied: * @self: the channel manager * @request_token: opaque pointer supplied by the requester, * representing a request * @channel: the existing #TpExportableChannel that satisfies the * request * * Emitted when a channel request is satisfied by an existing channel. * The Connection should generally respond to this signal by returning * success from EnsureChannel or RequestChannel. */ signals[S_REQUEST_ALREADY_SATISFIED] = g_signal_new ( "request-already-satisfied", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_OBJECT); /** * TpChannelManager::request-failed: * @self: the channel manager * @request_token: opaque pointer supplied by the requester, * representing a request * @domain: the domain of a #GError indicating why the request * failed * @code: the error code of a #GError indicating why the request * failed * @message: the string part of a #GError indicating why the request * failed * * Emitted when a channel request has failed. The Connection should * generally respond to this signal by returning failure from * CreateChannel, EnsureChannel or RequestChannel. */ signals[S_REQUEST_FAILED] = g_signal_new ("request-failed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 4, G_TYPE_POINTER, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); /** * TpChannelManager::channel-closed: * @self: the channel manager * @path: the channel's object-path * * Emitted when a channel has been closed. The Connection should * generally respond to this signal by emitting ChannelClosed. */ signals[S_CHANNEL_CLOSED] = g_signal_new ("channel-closed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); } } GType tp_channel_manager_get_type (void) { static GType type = 0; if (G_UNLIKELY (type == 0)) { static const GTypeInfo info = { sizeof (TpChannelManagerIface), channel_manager_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, 0, /* n_preallocs */ NULL /* instance_init */ }; type = g_type_register_static (G_TYPE_INTERFACE, "TpChannelManager", &info, 0); } return type; } /* Signal emission wrappers */ /** * tp_channel_manager_emit_new_channels: * @instance: An object implementing #TpChannelManager * @channels: a #GHashTable where the keys are * #TpExportableChannel instances (hashed and compared * by g_direct_hash() and g_direct_equal()) and the values are * linked lists (#GSList) of request tokens (opaque pointers) satisfied by * these channels * * If @channels is non-empty, emit the #TpChannelManager::new-channels * signal indicating that those channels have been created. * * Deprecated: in 0.19.1 this function should not be * used. Signalling the creation of multiple channels together in a * single signal is strongly recommended against as it's very * complicated, hard to get right in clients, and not nearly as * useful as it originally sounded. Use * tp_channel_manager_emit_new_channel() instead. * * Since: 0.7.15 */ void tp_channel_manager_emit_new_channels (gpointer instance, GHashTable *channels) { g_return_if_fail (TP_IS_CHANNEL_MANAGER (instance)); if (g_hash_table_size (channels) == 0) return; g_signal_emit (instance, signals[S_NEW_CHANNELS], 0, channels); } /** * tp_channel_manager_emit_new_channel: * @instance: An object implementing #TpChannelManager * @channel: A #TpExportableChannel * @request_tokens: the request tokens (opaque pointers) satisfied by this * channel * * Emit the #TpChannelManager::new-channels signal indicating that the * channel has been created. * * Since: 0.7.15 */ void tp_channel_manager_emit_new_channel (gpointer instance, TpExportableChannel *channel, GSList *request_tokens) { GHashTable *channels; g_return_if_fail (TP_IS_CHANNEL_MANAGER (instance)); g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); g_hash_table_insert (channels, channel, request_tokens); g_signal_emit (instance, signals[S_NEW_CHANNELS], 0, channels); g_hash_table_unref (channels); } /** * tp_channel_manager_emit_channel_closed: * @instance: An object implementing #TpChannelManager * @path: A channel's object-path * * Emit the #TpChannelManager::channel-closed signal indicating that * the channel at the given object path has been closed. * * Since: 0.7.15 */ void tp_channel_manager_emit_channel_closed (gpointer instance, const gchar *path) { g_return_if_fail (TP_IS_CHANNEL_MANAGER (instance)); g_return_if_fail (tp_dbus_check_valid_object_path (path, NULL)); g_signal_emit (instance, signals[S_CHANNEL_CLOSED], 0, path); } /** * tp_channel_manager_emit_channel_closed_for_object: * @instance: An object implementing #TpChannelManager * @channel: A #TpExportableChannel * * Emit the #TpChannelManager::channel-closed signal indicating that * the given channel has been closed. (This is a convenient shortcut for * calling tp_channel_manager_emit_channel_closed() with the * #TpExportableChannel:object-path property of @channel.) * * Since: 0.7.15 */ void tp_channel_manager_emit_channel_closed_for_object (gpointer instance, TpExportableChannel *channel) { gchar *path; g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); g_object_get (channel, "object-path", &path, NULL); tp_channel_manager_emit_channel_closed (instance, path); g_free (path); } /** * tp_channel_manager_emit_request_already_satisfied: * @instance: An object implementing #TpChannelManager * @request_token: An opaque pointer representing the request that * succeeded * @channel: The channel that satisfies the request * * Emit the #TpChannelManager::request-already-satisfied signal indicating * that the pre-existing channel @channel satisfies @request_token. * * Since: 0.7.15 */ void tp_channel_manager_emit_request_already_satisfied (gpointer instance, gpointer request_token, TpExportableChannel *channel) { g_return_if_fail (TP_IS_EXPORTABLE_CHANNEL (channel)); g_return_if_fail (TP_IS_CHANNEL_MANAGER (instance)); g_signal_emit (instance, signals[S_REQUEST_ALREADY_SATISFIED], 0, request_token, channel); } /** * tp_channel_manager_emit_request_failed: * @instance: An object implementing #TpChannelManager * @request_token: An opaque pointer representing the request that failed * @domain: a #GError domain * @code: a #GError code appropriate for @domain * @message: the error message * * Emit the #TpChannelManager::request-failed signal indicating that * the request @request_token failed for the given reason. * * Since: 0.7.15 */ void tp_channel_manager_emit_request_failed (gpointer instance, gpointer request_token, GQuark domain, gint code, const gchar *message) { g_return_if_fail (TP_IS_CHANNEL_MANAGER (instance)); g_signal_emit (instance, signals[S_REQUEST_FAILED], 0, request_token, domain, code, message); } /** * tp_channel_manager_emit_request_failed_printf: * @instance: An object implementing #TpChannelManager * @request_token: An opaque pointer representing the request that failed * @domain: a #GError domain * @code: a #GError code appropriate for @domain * @format: a printf-style format string for the error message * @...: arguments for the format string * * Emit the #TpChannelManager::request-failed signal indicating that * the request @request_token failed for the given reason. * * Since: 0.7.15 */ void tp_channel_manager_emit_request_failed_printf (gpointer instance, gpointer request_token, GQuark domain, gint code, const gchar *format, ...) { va_list ap; gchar *message; va_start (ap, format); message = g_strdup_vprintf (format, ap); va_end (ap); tp_channel_manager_emit_request_failed (instance, request_token, domain, code, message); g_free (message); } /* Virtual-method wrappers */ /** * tp_channel_manager_foreach_channel: * @manager: an object implementing #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the second argument of @func * * Calls func(channel, user_data) for each channel managed by @manager. * * Since: 0.7.15 */ void tp_channel_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc func, gpointer user_data) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( manager); TpChannelManagerForeachChannelFunc method = iface->foreach_channel; if (method != NULL) { method (manager, func, user_data); } /* ... else assume it has no channels, and do nothing */ } typedef struct { TpChannelManager *self; TpChannelManagerChannelClassFunc func; gpointer user_data; } ForeachAdaptor; static void foreach_adaptor (GType type G_GNUC_UNUSED, GHashTable *fixed, const gchar * const *allowed, gpointer user_data) { ForeachAdaptor *adaptor = user_data; adaptor->func (adaptor->self, fixed, allowed, adaptor->user_data); } /** * tp_channel_manager_foreach_channel_class: * @manager: An object implementing #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the final argument of @func * * Calls func(manager, fixed, allowed, user_data) for each channel class * understood by @manager. * * Since: 0.7.15 */ void tp_channel_manager_foreach_channel_class (TpChannelManager *manager, TpChannelManagerChannelClassFunc func, gpointer user_data) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( manager); TpChannelManagerForeachChannelClassFunc method = iface->foreach_channel_class; if (method != NULL) { method (manager, func, user_data); } else { ForeachAdaptor adaptor = { manager, func, user_data }; tp_channel_manager_type_foreach_channel_class ( G_TYPE_FROM_INSTANCE (manager), foreach_adaptor, &adaptor); } } /** * tp_channel_manager_type_foreach_channel_class: * @type: A type whose instances implement #TpChannelManager * @func: A function * @user_data: Arbitrary data to be passed as the final argument of @func * * Calls func(type, fixed, allowed, user_data) for each channel class * potentially understood by instances of @type. * * Since: 0.11.11 */ void tp_channel_manager_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data) { GTypeClass *cls; TpChannelManagerIface *iface; TpChannelManagerTypeForeachChannelClassFunc method; g_return_if_fail (g_type_is_a (type, TP_TYPE_CHANNEL_MANAGER)); cls = g_type_class_ref (type); iface = g_type_interface_peek (cls, TP_TYPE_CHANNEL_MANAGER); method = iface->type_foreach_channel_class; if (method != NULL) { method (type, func, user_data); } /* ... else assume it has no classes of requestable channel */ g_type_class_unref (cls); } /** * tp_channel_manager_create_channel: * @manager: An object implementing #TpChannelManager * @request_token: An opaque pointer representing this pending request. * @request_properties: A table mapping (const gchar *) property names to * GValue, representing the desired properties of a channel requested by a * Telepathy client. * * Offers an incoming CreateChannel call to @manager. * * Returns: %TRUE if this request will be handled by @manager; else %FALSE. * * Since: 0.7.15 */ gboolean tp_channel_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( manager); TpChannelManagerRequestFunc method = iface->create_channel; /* A missing implementation is equivalent to one that always returns FALSE, * meaning "can't do that, ask someone else" */ if (method != NULL) return method (manager, request_token, request_properties); else return FALSE; } /** * tp_channel_manager_request_channel: * @manager: An object implementing #TpChannelManager * @request_token: An opaque pointer representing this pending request. * @request_properties: A table mapping (const gchar *) property names to * GValue, representing the desired properties of a channel requested by a * Telepathy client. * * Offers an incoming RequestChannel call to @manager. * * Returns: %TRUE if this request will be handled by @manager; else %FALSE. * * Since: 0.7.15 */ gboolean tp_channel_manager_request_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( manager); TpChannelManagerRequestFunc method = iface->request_channel; /* A missing implementation is equivalent to one that always returns FALSE, * meaning "can't do that, ask someone else" */ if (method != NULL) return method (manager, request_token, request_properties); else return FALSE; } /** * tp_channel_manager_ensure_channel: * @manager: An object implementing #TpChannelManager * @request_token: An opaque pointer representing this pending request. * @request_properties: A table mapping (const gchar *) property names to * GValue, representing the desired properties of a channel requested by a * Telepathy client. * * Offers an incoming EnsureChannel call to @manager. * * Returns: %TRUE if this request will be handled by @manager; else %FALSE. * * Since: 0.7.16 */ gboolean tp_channel_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { TpChannelManagerIface *iface = TP_CHANNEL_MANAGER_GET_INTERFACE ( manager); TpChannelManagerRequestFunc method = iface->ensure_channel; /* A missing implementation is equivalent to one that always returns FALSE, * meaning "can't do that, ask someone else" */ if (method != NULL) return method (manager, request_token, request_properties); else return FALSE; } /** * tp_channel_manager_asv_has_unknown_properties: * @properties: a table mapping (const gchar *) property names to GValues, * as passed to methods of #TpChannelManager * @fixed: a %NULL-terminated array of property names * @allowed: a %NULL-terminated array of property names * @error: an address at which to store an error suitable for returning from * the D-Bus method when @properties contains unknown properties * * Checks whether the keys of @properties are elements of one of @fixed and * @allowed. This is intended to be used by implementations of * #TpChannelManagerIface.create_channel which have decided to accept a request, * to conform with the specification's requirement that unknown requested * properties must cause a request to fail, not be silently ignored. * * On encountering unknown properties, this function will return %TRUE, and * set @error to a #GError that could be used as a D-Bus method error. * * Returns: %TRUE if @properties contains keys not in either @fixed or * @allowed; else %FALSE. * * Since: 0.7.15 */ gboolean tp_channel_manager_asv_has_unknown_properties (GHashTable *properties, const gchar * const *fixed, const gchar * const *allowed, GError **error) { GHashTableIter iter; gpointer key; const gchar *property_name; g_hash_table_iter_init (&iter, properties); while (g_hash_table_iter_next (&iter, &key, NULL)) { property_name = key; if (!tp_strv_contains (fixed, property_name) && !tp_strv_contains (allowed, property_name)) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Request contained unknown property '%s'", property_name); return TRUE; } } return FALSE; } telepathy-glib-0.24.2/telepathy-glib/channel-manager.h0000644000175000017500000001257012652510705017545 00000000000000/* * channel-manager.h - factory and manager for channels relating to a * particular protocol feature * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_CHANNEL_MANAGER_H #define TP_CHANNEL_MANAGER_H #include #include #include G_BEGIN_DECLS #define TP_TYPE_CHANNEL_MANAGER (tp_channel_manager_get_type ()) #define TP_CHANNEL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_CHANNEL_MANAGER, TpChannelManager)) #define TP_IS_CHANNEL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_CHANNEL_MANAGER)) #define TP_CHANNEL_MANAGER_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_CHANNEL_MANAGER, TpChannelManagerIface)) typedef struct _TpChannelManager TpChannelManager; typedef struct _TpChannelManagerIface TpChannelManagerIface; /* virtual methods */ typedef void (*TpChannelManagerForeachChannelFunc) ( TpChannelManager *manager, TpExportableChannelFunc func, gpointer user_data); void tp_channel_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc func, gpointer user_data); typedef void (*TpChannelManagerChannelClassFunc) ( TpChannelManager *manager, GHashTable *fixed_properties, const gchar * const *allowed_properties, gpointer user_data); typedef void (*TpChannelManagerForeachChannelClassFunc) ( TpChannelManager *manager, TpChannelManagerChannelClassFunc func, gpointer user_data); void tp_channel_manager_foreach_channel_class ( TpChannelManager *manager, TpChannelManagerChannelClassFunc func, gpointer user_data); typedef void (*TpChannelManagerTypeChannelClassFunc) (GType type, GHashTable *fixed_properties, const gchar * const *allowed_properties, gpointer user_data); typedef void (*TpChannelManagerTypeForeachChannelClassFunc) ( GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data); void tp_channel_manager_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data); typedef gboolean (*TpChannelManagerRequestFunc) ( TpChannelManager *manager, gpointer request_token, GHashTable *request_properties); gboolean tp_channel_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties); gboolean tp_channel_manager_request_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties); gboolean tp_channel_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties); struct _TpChannelManagerIface { GTypeInterface parent; TpChannelManagerForeachChannelFunc foreach_channel; TpChannelManagerForeachChannelClassFunc foreach_channel_class; TpChannelManagerRequestFunc create_channel; TpChannelManagerRequestFunc request_channel; TpChannelManagerRequestFunc ensure_channel; TpChannelManagerTypeForeachChannelClassFunc type_foreach_channel_class; /**/ /* We know that these two methods will be added in the near future, so * reserve extra space for them. */ GCallback _reserved_for_foreach_contact_channel_class; GCallback _reserved_for_add_cap; GCallback _future[7]; }; GType tp_channel_manager_get_type (void); /* signal emission */ void tp_channel_manager_emit_new_channel (gpointer instance, TpExportableChannel *channel, GSList *request_tokens); _TP_DEPRECATED_IN_0_20 void tp_channel_manager_emit_new_channels (gpointer instance, GHashTable *channels); void tp_channel_manager_emit_channel_closed (gpointer instance, const gchar *path); void tp_channel_manager_emit_channel_closed_for_object (gpointer instance, TpExportableChannel *channel); void tp_channel_manager_emit_request_already_satisfied ( gpointer instance, gpointer request_token, TpExportableChannel *channel); void tp_channel_manager_emit_request_failed (gpointer instance, gpointer request_token, GQuark domain, gint code, const gchar *message); void tp_channel_manager_emit_request_failed_printf (gpointer instance, gpointer request_token, GQuark domain, gint code, const gchar *format, ...) G_GNUC_PRINTF (5, 6); /* helper functions */ gboolean tp_channel_manager_asv_has_unknown_properties (GHashTable *properties, const gchar * const *fixed, const gchar * const *allowed, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/call-content-media-description.c0000644000175000017500000012325012652510705022477 00000000000000/* * call-content-media-description.c - Source for TpyCallContentMediaDescription * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * @author Olivier Crete * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-content-media-description * @title: TpCallContentMediaDescription * @short_description: implementation of #TpSvcCallContentMediaDescription * @see_also: #TpBaseMediaCallContent * * This class is used to negociate the media description used with a remote * contact. To be used with #TpBaseMediaCallContent implementations. * * Since: 0.17.5 */ /** * TpCallContentMediaDescription: * * A class for media content description * * Since: 0.17.5 */ /** * TpCallContentMediaDescriptionClass: * * The class structure for #TpCallContentMediaDescription * * Since: 0.17.5 */ #include "config.h" #include "call-content-media-description.h" #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/handle.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/util.h" #include "telepathy-glib/util-internal.h" static void call_content_media_description_iface_init (gpointer iface, gpointer data); static void call_content_media_description_extra_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE(TpCallContentMediaDescription, tp_call_content_media_description, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION, call_content_media_description_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS, call_content_media_description_extra_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK, call_content_media_description_extra_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS, call_content_media_description_extra_iface_init); ); /* properties */ enum { PROP_OBJECT_PATH = 1, PROP_DBUS_DAEMON, PROP_INTERFACES, PROP_FURTHER_NEGOTIATION_REQUIRED, PROP_HAS_REMOTE_INFORMATION, PROP_CODECS, PROP_REMOTE_CONTACT, PROP_SSRCS, PROP_HEADER_EXTENSIONS, PROP_FEEDBACK_MESSAGES, PROP_DOES_AVPF, PROP_LOSS_RLE_MAX_SIZE, PROP_DUPLICATE_RLE_MAX_SIZE, PROP_PACKET_RECEIPT_TIMES_MAX_SIZE, PROP_DLRR_MAX_SIZE, PROP_RTT_MODE, PROP_STATISTICS_FLAGS, PROP_ENABLE_METRICS, }; /* private structure */ struct _TpCallContentMediaDescriptionPrivate { TpDBusDaemon *dbus_daemon; gchar *object_path; /* GPtrArray of static strings, NULL-terminated */ GPtrArray *interfaces; gboolean further_negotiation_required; gboolean has_remote_information; /* GPtrArray of owned GValueArray */ GPtrArray *codecs; TpHandle remote_contact; /* TpHandle -> reffed GArray */ GHashTable *ssrcs; /* GPtrArray of owned GValueArray (dbus-struct) */ GPtrArray *header_extensions; GHashTable *feedback_messages; gboolean does_avpf; guint loss_rle_max_size; guint duplicate_rle_max_size; guint packet_receipt_times_max_size; guint dlrr_max_size; TpRCPTXRRTTMode rtt_mode; TpRTCPXRStatisticsFlags statistics_flags; gboolean enable_metrics; GSimpleAsyncResult *result; GCancellable *cancellable; guint handler_id; }; static void tp_call_content_media_description_init (TpCallContentMediaDescription *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION, TpCallContentMediaDescriptionPrivate); self->priv->interfaces = g_ptr_array_new (); g_ptr_array_add (self->priv->interfaces, NULL); self->priv->ssrcs = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_array_unref); self->priv->codecs = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); self->priv->header_extensions = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); self->priv->feedback_messages = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) tp_value_array_free); } static void tp_call_content_media_description_dispose (GObject *object) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) object; g_assert (self->priv->result == NULL); tp_clear_pointer (&self->priv->codecs, g_ptr_array_unref); tp_clear_pointer (&self->priv->ssrcs, g_hash_table_unref); g_clear_object (&self->priv->dbus_daemon); tp_clear_pointer (&self->priv->header_extensions, g_ptr_array_unref); tp_clear_pointer (&self->priv->feedback_messages, g_hash_table_unref); /* release any references held by the object here */ if (G_OBJECT_CLASS (tp_call_content_media_description_parent_class)->dispose) G_OBJECT_CLASS (tp_call_content_media_description_parent_class)->dispose ( object); } static void tp_call_content_media_description_finalize (GObject *object) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) object; g_free (self->priv->object_path); g_ptr_array_unref (self->priv->interfaces); G_OBJECT_CLASS (tp_call_content_media_description_parent_class)->finalize ( object); } static void tp_call_content_media_description_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) object; switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus_daemon); break; case PROP_INTERFACES: g_value_set_boxed (value, self->priv->interfaces->pdata); break; case PROP_FURTHER_NEGOTIATION_REQUIRED: g_value_set_boolean (value, self->priv->further_negotiation_required); break; case PROP_HAS_REMOTE_INFORMATION: g_value_set_boolean (value, self->priv->has_remote_information); break; case PROP_CODECS: g_value_set_boxed (value, self->priv->codecs); break; case PROP_REMOTE_CONTACT: g_value_set_uint (value, self->priv->remote_contact); break; case PROP_SSRCS: g_value_set_boxed (value, self->priv->ssrcs); break; case PROP_HEADER_EXTENSIONS: g_value_set_boxed (value, self->priv->header_extensions); break; case PROP_FEEDBACK_MESSAGES: g_value_set_boxed (value, self->priv->feedback_messages); break; case PROP_DOES_AVPF: g_value_set_boolean (value, self->priv->does_avpf); break; case PROP_LOSS_RLE_MAX_SIZE: g_value_set_uint (value, self->priv->loss_rle_max_size); break; case PROP_DUPLICATE_RLE_MAX_SIZE: g_value_set_uint (value, self->priv->duplicate_rle_max_size); break; case PROP_PACKET_RECEIPT_TIMES_MAX_SIZE: g_value_set_uint (value, self->priv->packet_receipt_times_max_size); break; case PROP_DLRR_MAX_SIZE: g_value_set_uint (value, self->priv->dlrr_max_size); break; case PROP_RTT_MODE: g_value_set_uint (value, self->priv->rtt_mode); break; case PROP_STATISTICS_FLAGS: g_value_set_uint (value, self->priv->statistics_flags); break; case PROP_ENABLE_METRICS: g_value_set_boolean (value, self->priv->enable_metrics); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_content_media_description_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) object; switch (property_id) { case PROP_OBJECT_PATH: g_assert (self->priv->object_path == NULL); /* construct-only */ self->priv->object_path = g_value_dup_string (value); break; case PROP_DBUS_DAEMON: g_assert (self->priv->dbus_daemon == NULL); /* construct-only */ self->priv->dbus_daemon = g_value_dup_object (value); break; case PROP_FURTHER_NEGOTIATION_REQUIRED: self->priv->further_negotiation_required = g_value_get_boolean (value); break; case PROP_HAS_REMOTE_INFORMATION: self->priv->has_remote_information = g_value_get_boolean (value); break; case PROP_REMOTE_CONTACT: self->priv->remote_contact = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_content_media_description_class_init ( TpCallContentMediaDescriptionClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *spec; static TpDBusPropertiesMixinPropImpl media_description_props[] = { { "Interfaces", "interfaces", NULL }, { "FurtherNegotiationRequired", "further-negotiation-required", NULL }, { "HasRemoteInformation", "has-remote-information", NULL}, { "Codecs", "codecs", NULL }, { "RemoteContact", "remote-contact", NULL }, { "SSRCs", "ssrcs", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl rtp_header_extensions_props[] = { { "HeaderExtensions", "header-extensions", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl rtcp_feedback_props[] = { { "FeedbackMessages", "feedback-messages", NULL }, { "DoesAVPF", "does-avpf", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl rtcp_extended_reports_props[] = { { "LossRLEMaxSize", "loss-rle-max-size", NULL }, { "DuplicateRLEMaxSize", "duplicate-rle-max-size", NULL }, { "PacketReceiptTimesMaxSize", "packet-receipt-times-max-size", NULL }, { "DLRRMaxSize", "dlrr-max-size", NULL }, { "RTTMode", "rtt-mode", NULL }, { "StatisticsFlags", "statistics-flags", NULL }, { "EnableMetrics", "enable-metrics", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION, tp_dbus_properties_mixin_getter_gobject_properties, NULL, media_description_props, }, { TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS, tp_dbus_properties_mixin_getter_gobject_properties, NULL, rtp_header_extensions_props, }, { TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK, tp_dbus_properties_mixin_getter_gobject_properties, NULL, rtcp_feedback_props, }, { TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS, tp_dbus_properties_mixin_getter_gobject_properties, NULL, rtcp_extended_reports_props, }, { NULL } }; g_type_class_add_private (klass, sizeof (TpCallContentMediaDescriptionPrivate)); object_class->get_property = tp_call_content_media_description_get_property; object_class->set_property = tp_call_content_media_description_set_property; object_class->dispose = tp_call_content_media_description_dispose; object_class->finalize = tp_call_content_media_description_finalize; /** * TpCallContentMediaDescription:object-path: * * The D-Bus object path used for this object on the bus. * * Since: 0.17.5 */ spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this " "object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBJECT_PATH, spec); /** * TpCallContentMediaDescription:dbus-daemon: * * The connection to the DBus daemon owning the CM. * * Since: 0.17.5 */ spec = g_param_spec_object ("dbus-daemon", "The DBus daemon connection", "The connection to the DBus daemon owning the CM", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, spec); /** * TpCallContentMediaDescription:interfaces: * * Additional interfaces implemented by this object. * * Since: 0.17.5 */ spec = g_param_spec_boxed ("interfaces", "Interfaces", "Extra interfaces provided by this media description", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, spec); /** * TpCallContentMediaDescription:further-negotiation-required: * * %TRUE if more negotiation is required after MediaDescription is processed. * * Since: 0.17.5 */ spec = g_param_spec_boolean ("further-negotiation-required", "FurtherNegotiationRequired", "More negotiation is required after MediaDescription is processed", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FURTHER_NEGOTIATION_REQUIRED, spec); /** * TpCallContentMediaDescription:further-negotiation-required: * * %TRUE if the MediaDescription contains remote information. * * Since: 0.17.5 */ spec = g_param_spec_boolean ("has-remote-information", "HasRemoteInformation", "True if the MediaDescription contains remote information", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HAS_REMOTE_INFORMATION, spec); /** * TpCallContentMediaDescription:codecs: * * #GPtrArray{codecs #GValueArray}. * A list of codecs the remote contact supports. * * Since: 0.17.5 */ spec = g_param_spec_boxed ("codecs", "Codecs", "A list of codecs the remote contact supports", TP_ARRAY_TYPE_CODEC_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CODECS, spec); /** * TpCallContentMediaDescription:remote-contact: * * The contact #TpHandle that this media description applies to. * * Since: 0.17.5 */ spec = g_param_spec_uint ("remote-contact", "RemoteContact", "The contact handle that this media description applies to", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_CONTACT, spec); /** * TpCallContentMediaDescription:ssrcs: * * #GHashTable{contact #TpHandle, #GArray{uint}} * A map of contacts to SSRCs. * * Since: 0.17.5 */ spec = g_param_spec_boxed ("ssrcs", "SSRCs", "A map of handles to SSRCs", TP_HASH_TYPE_CONTACT_SSRCS_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SSRCS, spec); /** * TpCallContentMediaDescription:header-extensions: * * A list of remote header extensions which are supported. * * Since: 0.17.6 */ spec = g_param_spec_boxed ("header-extensions", "Header Extentions", "A list of remote header extensions which are supported.", TP_ARRAY_TYPE_RTP_HEADER_EXTENSIONS_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HEADER_EXTENSIONS, spec); /** * TpCallContentMediaDescription:feedback-messages: * * A map of remote feedback codec properties that are supported. * * Since: 0.17.6 */ spec = g_param_spec_boxed ("feedback-messages", "Feedback Messages", "A map of remote feedback codec properties that are supported.", TP_HASH_TYPE_RTCP_FEEDBACK_MESSAGE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FEEDBACK_MESSAGES, spec); /** * TpCallContentMediaDescription:does-avpf: * * %TRUE if the remote contact supports Audio-Visual Profile Feedback (AVPF), * otherwise %FALSE. * * Since: 0.17.6 */ spec = g_param_spec_boolean ("does-avpf", "Does AVPF", "True if the remote contact supports Audio-Visual Profile Feedback " "(AVPF), otherwise False.", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DOES_AVPF, spec); /** * TpCallContentMediaDescription:loss-rle-max-size: * * If non-zero, enable Loss Run Length Encoded Report Blocks. The value of * this integer represents the max-size of report blocks, as specified in * RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. * * Since: 0.17.6 */ spec = g_param_spec_uint ("loss-rle-max-size", "Loss RLE max size", "If non-zero, enable Loss Run Length Encoded Report Blocks.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOSS_RLE_MAX_SIZE, spec); /** * TpCallContentMediaDescription:duplicate-rle-max-size: * * If non-zero, enable Duplicate Run-Length-Encoded Report Blocks. The value * of this integer represents the max-size of report blocks, as specified in * RFC 3611 section 5.1. MAXUINT32 is used to indicate that there is no limit. * * Since: 0.17.6 */ spec = g_param_spec_uint ("duplicate-rle-max-size", "Duplicate Run-Length-Encoded max size", "If non-zero, enable Duplicate Run-Length-Encoded Report Blocks.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DUPLICATE_RLE_MAX_SIZE, spec); /** * TpCallContentMediaDescription:packet-receipt-times-max-size: * * If non-zero, enable Packet Receipt Times Report Blocks. The value of this * integer represents the max-size of report blocks, as specified in RFC 3611 * section 5.1. MAXUINT32 is used to indicate that there is no limit. * * Since: 0.17.6 */ spec = g_param_spec_uint ("packet-receipt-times-max-size", "Packet Receipt Times max size", "If non-zero, enable Packet Receipt Times Report Blocks.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PACKET_RECEIPT_TIMES_MAX_SIZE, spec); /** * TpCallContentMediaDescription:dlrr-max-size: * * If non-zero, enable Receiver Reference Time and Delay since Last Receiver * Report Blocks (for estimating Round Trip Times between non-senders and * other parties in the call. The value of this integer represents the * max-size of report blocks, as specified in RFC 3611 section 5.1. MAXUINT32 * is used to indicate that there is no limit. * * Since: 0.17.6 */ spec = g_param_spec_uint ("dlrr-max-size", "Receiver Reference Time and Delay since Last Receiver max size", "If non-zero, enable Receiver Reference Time and Delay since Last " "Receiver Report Blocks.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DLRR_MAX_SIZE, spec); /** * TpCallContentMediaDescription:rtt-mode: * * Who is allowed to send Delay since Last Receiver Reports. Value from * #TpRCPTXRRTTMode. * * Since: 0.17.6 */ spec = g_param_spec_uint ("rtt-mode", "RTT Mode", "Who is allowed to send Delay since Last Receiver Reports.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_RTT_MODE, spec); /** * TpCallContentMediaDescription:statistics-flags: * * Which fields SHOULD be included in the statistics summary report blocks * that are sent, and whether to send VoIP Metrics Report Blocks. There can * be zero or more flags set. Value from #TpRTCPXRStatisticsFlags. * * Since: 0.17.6 */ spec = g_param_spec_uint ("statistics-flags", "Statistics Flags", "Which fields SHOULD be included in the statistics summary report blocks " "that are sent, and whether to send VoIP Metrics Report Blocks.", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATISTICS_FLAGS, spec); /** * TpCallContentMediaDescription:enable-metrics: * * Whether to enable VoIP Metrics Report Blocks. These blocks are of a fixed * size. * * Since: 0.17.6 */ spec = g_param_spec_boolean ("enable-metrics", "Enable Metrics", "Whether to enable VoIP Metrics Report Blocks. These blocks are of a " "fixed size.", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ENABLE_METRICS, spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpCallContentMediaDescriptionClass, dbus_props_class)); } /** * tp_call_content_media_description_new: * @dbus_daemon: value of #TpCallContentMediaDescription:dbus-daemon property * @object_path: value of #TpCallContentMediaDescription:object-path property * @remote_contact: value of * #TpCallContentMediaDescription:remote-contact property * @has_remote_information: value of * #TpCallContentMediaDescription:has_remote_information property * @further_negotiation_required: value of * #TpCallContentMediaDescription:further_negotiation_required property * * Create a new #TpCallContentMediaDescription object. More information can be * added after construction using * tp_call_content_media_description_append_codec() and * tp_call_content_media_description_add_ssrc(). * * Once all information has been filled, the media description can be offered * using tp_base_media_call_content_offer_media_description_async(). * * Returns: a new #TpCallContentMediaDescription. * Since: 0.17.5 */ TpCallContentMediaDescription * tp_call_content_media_description_new (TpDBusDaemon *dbus_daemon, const gchar *object_path, TpHandle remote_contact, gboolean has_remote_information, gboolean further_negotiation_required) { g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); return g_object_new (TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION, "dbus-daemon", dbus_daemon, "object-path", object_path, "further-negotiation-required", further_negotiation_required, "has-remote-information", has_remote_information, "remote-contact", remote_contact, NULL); } /** * tp_call_content_media_description_get_object_path: * @self: a #TpCallContentMediaDescription * * * * Returns: the value of #TpCallContentMediaDescription:object-path * Since: 0.17.5 */ const gchar * tp_call_content_media_description_get_object_path ( TpCallContentMediaDescription *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self), NULL); return self->priv->object_path; } /** * tp_call_content_media_description_get_remote_contact: * @self: a #TpCallContentMediaDescription * * * * Returns: the value of #TpCallContentMediaDescription:remote-contact * Since: 0.17.5 */ TpHandle tp_call_content_media_description_get_remote_contact ( TpCallContentMediaDescription *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self), 0); return self->priv->remote_contact; } /** * tp_call_content_media_description_add_ssrc: * @self: a #TpCallContentMediaDescription * @contact: The #TpHandle of a contact that is part of the call * @ssrc: A SSRC that this contact may send from * * Add an SSRC to the list of SSRCs that a contact will send from. A SSRC * is a synchronization source in RTP, it is the identifier for a continuous * stream of packets following the same timeline. * * Since: 0.17.5 */ void tp_call_content_media_description_add_ssrc (TpCallContentMediaDescription *self, TpHandle contact, guint ssrc) { GArray *array; guint i; g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); array = g_hash_table_lookup (self->priv->ssrcs, GUINT_TO_POINTER (contact)); if (array == NULL) { array = g_array_new (FALSE, FALSE, sizeof (guint)); g_hash_table_insert (self->priv->ssrcs, GUINT_TO_POINTER (contact), array); } for (i = 0; i < array->len; i++) { if (g_array_index (array, guint, i) == ssrc) return; } g_array_append_val (array, ssrc); } /** * tp_call_content_media_description_append_codec: * @self: a #TpCallContentMediaDescription * @identifier: Numeric identifier for the codec. This will be used as the PT * in the SDP or content description. * @name: The name of the codec. * @clock_rate: The clock rate of the codec. * @channels: Number of channels of the codec if applicable, otherwise 0. * @updated: %TRUE if this codec was updated since the last Media Description * @parameters: a #GHashTable of string->string containing optional parameters * * Add description for a supported codec. * * Since: 0.17.5 */ void tp_call_content_media_description_append_codec ( TpCallContentMediaDescription *self, guint identifier, const gchar *name, guint clock_rate, guint channels, gboolean updated, GHashTable *parameters) { g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); if (parameters == NULL) parameters = g_hash_table_new (g_str_hash, g_str_equal); g_ptr_array_add (self->priv->codecs, tp_value_array_build (6, G_TYPE_UINT, identifier, G_TYPE_STRING, name, G_TYPE_UINT, clock_rate, G_TYPE_UINT, channels, G_TYPE_BOOLEAN, updated, TP_HASH_TYPE_STRING_STRING_MAP, parameters, G_TYPE_INVALID)); } static void add_interface (TpCallContentMediaDescription *self, const gchar *interface) { if (tp_g_ptr_array_contains (self->priv->interfaces, (gchar *) interface)) return; /* Remove terminating NULL, add interface, then add the NULL back */ g_ptr_array_remove_index_fast (self->priv->interfaces, self->priv->interfaces->len - 1); g_ptr_array_add (self->priv->interfaces, (gchar *) interface); g_ptr_array_add (self->priv->interfaces, NULL); } /** * tp_call_content_media_description_add_rtp_header_extensions_interface: * @self: a #TpCallContentMediaDescription * * Adds the RTPHeaderExtensions interface to the list of supported interfaces * * Since: 0.17.6 */ void tp_call_content_media_description_add_rtp_header_extensions_interface ( TpCallContentMediaDescription *self) { add_interface (self, TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS); } /** * tp_call_content_media_description_add_rtcp_feedback_interface: * @self: a #TpCallContentMediaDescription * * Adds the RTCPFeedback interface to the list of supported interfaces * * Since: 0.17.6 */ void tp_call_content_media_description_add_rtcp_feedback_interface ( TpCallContentMediaDescription *self) { add_interface (self, TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK); } /** * tp_call_content_media_description_add_rtcp_extended_reports_interface: * @self: a #TpCallContentMediaDescription * * Adds the RTCPExtendedReports interface to the list of supported interfaces * * Since: 0.17.6 */ void tp_call_content_media_description_add_rtcp_extended_reports_interface ( TpCallContentMediaDescription *self) { add_interface (self, TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS); } /** * tp_call_content_media_description_add_rtp_header_extension: * @self: a #TpCallContentMediaDescription * @id: identifier to be negotiated. * @direction: a #TpMediaStreamDirection in which the Header Extension is * negotiated. * @uri: URI defining the extension. * @parameters: Feedback parameters as a string. Format is defined in the * relevant RFC. * * Add an element to the #TpCallContentMediaDescription:header-extensions * property. * * Implement * %TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTP_HEADER_EXTENSIONS * interface. * * Since: 0.17.6 */ void tp_call_content_media_description_add_rtp_header_extension ( TpCallContentMediaDescription *self, guint id, TpMediaStreamDirection direction, const gchar *uri, const gchar *parameters) { g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); g_ptr_array_add (self->priv->header_extensions, tp_value_array_build (4, G_TYPE_UINT, id, G_TYPE_UINT, direction, G_TYPE_STRING, uri, G_TYPE_STRING, parameters, G_TYPE_INVALID)); tp_call_content_media_description_add_rtp_header_extensions_interface (self); } static GValueArray * ensure_rtcp_feedback_properties (TpCallContentMediaDescription *self, guint codec_identifier) { GValueArray *properties; GPtrArray *messages_array; properties = g_hash_table_lookup (self->priv->feedback_messages, GUINT_TO_POINTER (codec_identifier)); if (properties == NULL) { messages_array = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); properties = tp_value_array_build (2, G_TYPE_UINT, G_MAXUINT, G_TYPE_PTR_ARRAY, messages_array, G_TYPE_INVALID); g_hash_table_insert (self->priv->feedback_messages, GUINT_TO_POINTER (codec_identifier), properties); g_ptr_array_unref (messages_array); } return properties; } /** * tp_call_content_media_description_add_rtcp_feedback_message: * @self: a #TpCallContentMediaDescription * @codec_identifier: Numeric identifier for the codec. This will be used as the * PT in the SDP or content description. * @type: feedback type, for example "ack", "nack", or "ccm". * @subtype: feedback subtype, according to the Type, can be an empty string * (""), if there is no subtype. For example, generic nack is Type="nack" * Subtype="". * @parameters: feedback parameters as a string. Format is defined in the * relevant RFC. * * Add a message for a given codec. This ensures @codec_identifier is * in the #TpCallContentMediaDescription:feedback-messages map. The * rtcp-minimum-interval is set to %G_MAXUINT and can then be changed using * tp_call_content_media_description_set_rtcp_feedback_minimum_interval(). * * Implement * %TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK * interface. * * Since: 0.17.6 */ void tp_call_content_media_description_add_rtcp_feedback_message ( TpCallContentMediaDescription *self, guint codec_identifier, const gchar *type, const gchar *subtype, const gchar *parameters) { GValueArray *properties; GValue *value; GPtrArray *messages_array; g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); properties = ensure_rtcp_feedback_properties (self, codec_identifier); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (properties, 1); G_GNUC_END_IGNORE_DEPRECATIONS messages_array = g_value_get_boxed (value); g_ptr_array_add (messages_array, tp_value_array_build (3, G_TYPE_STRING, type, G_TYPE_STRING, subtype, G_TYPE_STRING, parameters, G_TYPE_INVALID)); tp_call_content_media_description_add_rtcp_feedback_interface (self); } /** * tp_call_content_media_description_set_rtcp_feedback_minimum_interval: * @self: a #TpCallContentMediaDescription * @codec_identifier: Numeric identifier for the codec. This will be used as the * PT in the SDP or content description. * @rtcp_minimum_interval: The minimum interval between two regular RTCP packets * in milliseconds for this content. If no special value is desired, one should * put MAXUINT (0xFFFFFFFF). Implementors and users of Call's RTCPFeedback * should not use the MAXUINT default. Instead, in RTP/AVP, the default should * be 5000 (5 seconds). If using the RTP/AVPF profile, it can be set to a lower * value, the default being 0. * * Set the minimum interval for a given codec. This ensures @codec_identifier is * in the #TpCallContentMediaDescription:feedback-messages map. The messages * can then be added using * tp_call_content_media_description_add_rtcp_feedback_message(). * * Implement * %TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK * interface. * * Since: 0.17.6 */ void tp_call_content_media_description_set_rtcp_feedback_minimum_interval ( TpCallContentMediaDescription *self, guint codec_identifier, guint rtcp_minimum_interval) { GValueArray *properties; GValue *value; g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); properties = ensure_rtcp_feedback_properties (self, codec_identifier); G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (properties, 0); G_GNUC_END_IGNORE_DEPRECATIONS g_value_set_uint (value, rtcp_minimum_interval); tp_call_content_media_description_add_rtcp_feedback_interface (self); } /** * tp_call_content_media_description_set_does_avpf: * @self: a #TpCallContentMediaDescription * @does_avpf: the value for * #TpCallContentMediaDescription:does-avpf property. * * Implement properties for * %TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_FEEDBACK * interface * * Since: 0.17.6 */ void tp_call_content_media_description_set_does_avpf ( TpCallContentMediaDescription *self, gboolean does_avpf) { g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); self->priv->does_avpf = does_avpf; tp_call_content_media_description_add_rtcp_feedback_interface (self); } /** * tp_call_content_media_description_set_rtcp_extended_reports: * @self: a #TpCallContentMediaDescription * @loss_rle_max_size: the value for * #TpCallContentMediaDescription:loss-rle-max-size property. * @duplicate_rle_max_size: the value for * #TpCallContentMediaDescription:duplicate-rle-max-size property. * @packet_receipt_times_max_size: the value for * #TpCallContentMediaDescription:packet-receipt-times-max-size property. * @dlrr_max_size: the value for * #TpCallContentMediaDescription:dlrr-max-size property. * @rtt_mode: the value for * #TpCallContentMediaDescription:rtt-mode property. * @statistics_flags: the value for * #TpCallContentMediaDescription:statistics-flags property. * @enable_metrics: the value for * #TpCallContentMediaDescription:enable-metrics property. * * Implement * %TP_IFACE_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACE_RTCP_EXTENDED_REPORTS * interface. * * Since: 0.17.6 */ void tp_call_content_media_description_set_rtcp_extended_reports ( TpCallContentMediaDescription *self, guint loss_rle_max_size, guint duplicate_rle_max_size, guint packet_receipt_times_max_size, guint dlrr_max_size, TpRCPTXRRTTMode rtt_mode, TpRTCPXRStatisticsFlags statistics_flags, gboolean enable_metrics) { g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); self->priv->loss_rle_max_size = loss_rle_max_size; self->priv->duplicate_rle_max_size = duplicate_rle_max_size; self->priv->packet_receipt_times_max_size = packet_receipt_times_max_size; self->priv->dlrr_max_size = dlrr_max_size; self->priv->rtt_mode = rtt_mode; self->priv->statistics_flags = statistics_flags; self->priv->enable_metrics = enable_metrics; tp_call_content_media_description_add_rtcp_extended_reports_interface (self); } static void cancelled_cb (GCancellable *cancellable, gpointer user_data) { TpCallContentMediaDescription *self = user_data; tp_dbus_daemon_unregister_object (self->priv->dbus_daemon, G_OBJECT (self)); g_simple_async_result_set_error (self->priv->result, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Media Description cancelled"); g_simple_async_result_complete_in_idle (self->priv->result); g_clear_object (&self->priv->cancellable); g_clear_object (&self->priv->result); self->priv->handler_id = 0; } void _tp_call_content_media_description_offer_async ( TpCallContentMediaDescription *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self)); g_return_if_fail (self->priv->result == NULL); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, _tp_call_content_media_description_offer_async); if (cancellable != NULL) { self->priv->cancellable = g_object_ref (cancellable); self->priv->handler_id = g_cancellable_connect ( cancellable, G_CALLBACK (cancelled_cb), self, NULL); } /* register object on the bus */ DEBUG ("Registering %s", self->priv->object_path); tp_dbus_daemon_register_object (self->priv->dbus_daemon, self->priv->object_path, G_OBJECT (self)); } gboolean _tp_call_content_media_description_offer_finish ( TpCallContentMediaDescription *self, GAsyncResult *result, GHashTable **properties, GError **error) { _tp_implement_finish_copy_pointer (self, _tp_call_content_media_description_offer_async, g_hash_table_ref, properties); } GHashTable * _tp_call_content_media_description_dup_properties ( TpCallContentMediaDescription *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (self), NULL); return tp_asv_new ( TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_INTERFACES, G_TYPE_STRV, self->priv->interfaces->pdata, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_FURTHER_NEGOTIATION_REQUIRED, G_TYPE_BOOLEAN, self->priv->further_negotiation_required, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_HAS_REMOTE_INFORMATION, G_TYPE_BOOLEAN, self->priv->has_remote_information, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS, TP_ARRAY_TYPE_CODEC_LIST, self->priv->codecs, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT, G_TYPE_UINT, self->priv->remote_contact, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_SSRCS, TP_HASH_TYPE_CONTACT_SSRCS_MAP, self->priv->ssrcs, NULL); } static void tp_call_content_media_description_accept (TpSvcCallContentMediaDescription *iface, GHashTable *properties, DBusGMethodInvocation *context) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) iface; GPtrArray *codecs; gboolean valid; TpHandle remote_contact; DEBUG ("%s was accepted", self->priv->object_path); if (self->priv->cancellable != NULL) { g_cancellable_disconnect (self->priv->cancellable, self->priv->handler_id); g_clear_object (&self->priv->cancellable); self->priv->handler_id = 0; } codecs = tp_asv_get_boxed (properties, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS, TP_ARRAY_TYPE_CODEC_LIST); if (!codecs || codecs->len == 0) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Codecs can not be empty" }; dbus_g_method_return_error (context, &error); return; } remote_contact = tp_asv_get_uint32 (properties, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT, &valid); if (valid && remote_contact != self->priv->remote_contact) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Remote contact must the same as in request." }; dbus_g_method_return_error (context, &error); return; } g_simple_async_result_set_op_res_gpointer (self->priv->result, g_hash_table_ref (properties), (GDestroyNotify) g_hash_table_unref); g_simple_async_result_complete (self->priv->result); g_clear_object (&self->priv->result); tp_svc_call_content_media_description_return_from_accept (context); tp_dbus_daemon_unregister_object (self->priv->dbus_daemon, G_OBJECT (self)); } static void tp_call_content_media_description_reject (TpSvcCallContentMediaDescription *iface, const GValueArray *reason_array, DBusGMethodInvocation *context) { TpCallContentMediaDescription *self = (TpCallContentMediaDescription *) iface; DEBUG ("%s was rejected", self->priv->object_path); if (!self->priv->has_remote_information) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can not reject an empty Media Description" }; dbus_g_method_return_error (context, &error); return; } if (self->priv->cancellable != NULL) { g_cancellable_disconnect (self->priv->cancellable, self->priv->handler_id); g_clear_object (&self->priv->cancellable); self->priv->handler_id = 0; } g_simple_async_result_set_error (self->priv->result, TP_ERROR, TP_ERROR_MEDIA_CODECS_INCOMPATIBLE, "Media description was rejected"); g_simple_async_result_complete (self->priv->result); g_clear_object (&self->priv->result); tp_svc_call_content_media_description_return_from_reject (context); tp_dbus_daemon_unregister_object (self->priv->dbus_daemon, G_OBJECT (self)); } static void call_content_media_description_iface_init (gpointer iface, gpointer data) { TpSvcCallContentMediaDescriptionClass *klass = (TpSvcCallContentMediaDescriptionClass *) iface; #define IMPLEMENT(x) tp_svc_call_content_media_description_implement_##x (\ klass, tp_call_content_media_description_##x) IMPLEMENT(accept); IMPLEMENT(reject); #undef IMPLEMENT } static void call_content_media_description_extra_iface_init (gpointer iface, gpointer data) { } telepathy-glib-0.24.2/telepathy-glib/call-content-media-description.h0000644000175000017500000001310312652510705022477 00000000000000/* * call-content-media-description.h - Header for TpyCallContentMediaDescription * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * @author Olivier Crete * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_CONTENT_MEDIA_DESCRIPTION_H__ #define __TP_CALL_CONTENT_MEDIA_DESCRIPTION_H__ #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpCallContentMediaDescription TpCallContentMediaDescription; typedef struct _TpCallContentMediaDescriptionPrivate TpCallContentMediaDescriptionPrivate; typedef struct _TpCallContentMediaDescriptionClass TpCallContentMediaDescriptionClass; struct _TpCallContentMediaDescriptionClass { /**/ GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; gpointer future[4]; }; struct _TpCallContentMediaDescription { /**/ GObject parent; TpCallContentMediaDescriptionPrivate *priv; }; GType tp_call_content_media_description_get_type (void); /* TYPE MACROS */ #define TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION \ (tp_call_content_media_description_get_type ()) #define TP_CALL_CONTENT_MEDIA_DESCRIPTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION, TpCallContentMediaDescription)) #define TP_CALL_CONTENT_MEDIA_DESCRIPTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION, TpCallContentMediaDescriptionClass)) #define TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION)) #define TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION)) #define TP_CALL_CONTENT_MEDIA_DESCRIPTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CALL_CONTENT_MEDIA_DESCRIPTION, \ TpCallContentMediaDescriptionClass)) _TP_AVAILABLE_IN_0_18 TpCallContentMediaDescription *tp_call_content_media_description_new ( TpDBusDaemon *dbus_daemon, const gchar *object_path, TpHandle remote_contact, gboolean has_remote_information, gboolean further_negotiation_required); _TP_AVAILABLE_IN_0_18 const gchar *tp_call_content_media_description_get_object_path ( TpCallContentMediaDescription *self); _TP_AVAILABLE_IN_0_18 TpHandle tp_call_content_media_description_get_remote_contact ( TpCallContentMediaDescription *self); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_ssrc ( TpCallContentMediaDescription *self, TpHandle contact, guint ssrc); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_append_codec ( TpCallContentMediaDescription *self, guint identifier, const gchar *name, guint clock_rate, guint channels, gboolean updated, GHashTable *parameters); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_rtp_header_extension ( TpCallContentMediaDescription *self, guint id, TpMediaStreamDirection direction, const gchar *uri, const gchar *parameters); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_rtcp_feedback_message ( TpCallContentMediaDescription *self, guint codec_identifier, const gchar *type, const gchar *subtype, const gchar *parameters); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_set_rtcp_feedback_minimum_interval ( TpCallContentMediaDescription *self, guint codec_identifier, guint rtcp_minimum_interval); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_set_does_avpf ( TpCallContentMediaDescription *self, gboolean does_avpf); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_set_rtcp_extended_reports ( TpCallContentMediaDescription *self, guint loss_rle_max_size, guint duplicate_rle_max_size, guint packet_receipt_times_max_size, guint dlrr_max_size, TpRCPTXRRTTMode rtt_mode, TpRTCPXRStatisticsFlags statistics_flags, gboolean enable_metrics); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_rtp_header_extensions_interface ( TpCallContentMediaDescription *self); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_rtcp_feedback_interface ( TpCallContentMediaDescription *self); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_add_rtcp_extended_reports_interface ( TpCallContentMediaDescription *self); G_END_DECLS #endif /* #ifndef __TP_CALL_CONTENT_MEDIA_DESCRIPTION_H__*/ telepathy-glib-0.24.2/telepathy-glib/dbus-peer.xml0000644000175000017500000000074412652510705016764 00000000000000 D-Bus peer telepathy-glib-0.24.2/telepathy-glib/proxy-subclass.h0000644000175000017500000000640712652510705017525 00000000000000/* * proxy-subclass.h - Base class for Telepathy client proxies * (API for subclasses only) * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_PROXY_SUBCLASS_H__ #define __TP_PROXY_SUBCLASS_H__ #define _TP_IN_META_HEADER #include G_BEGIN_DECLS typedef void (*TpProxyInvokeFunc) (TpProxy *self, GError *error, GValueArray *args, GCallback callback, gpointer user_data, GObject *weak_object); TpProxyPendingCall *tp_proxy_pending_call_v0_new (TpProxy *self, GQuark iface, const gchar *member, DBusGProxy *iface_proxy, TpProxyInvokeFunc invoke_callback, GCallback callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object, gboolean cancel_must_raise); void tp_proxy_pending_call_v0_take_pending_call (TpProxyPendingCall *pc, DBusGProxyCall *pending_call); void tp_proxy_pending_call_v0_take_results (TpProxyPendingCall *pc, GError *error, GValueArray *args); void tp_proxy_pending_call_v0_completed (gpointer p); TpProxySignalConnection *tp_proxy_signal_connection_v0_new (TpProxy *self, GQuark iface, const gchar *member, const GType *expected_types, GCallback collect_args, TpProxyInvokeFunc invoke_callback, GCallback callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object, GError **error); void tp_proxy_signal_connection_v0_take_results (TpProxySignalConnection *sc, GValueArray *args); typedef void (*TpProxyInterfaceAddedCb) (TpProxy *self, guint quark, DBusGProxy *proxy, gpointer unused); void tp_proxy_or_subclass_hook_on_interface_add (GType proxy_or_subclass, TpProxyInterfaceAddedCb callback); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_proxy_get_interface_by_id) DBusGProxy *tp_proxy_borrow_interface_by_id (TpProxy *self, GQuark iface, GError **error); #endif _TP_AVAILABLE_IN_0_20 DBusGProxy *tp_proxy_get_interface_by_id (TpProxy *self, GQuark iface, GError **error); DBusGProxy *tp_proxy_add_interface_by_id (TpProxy *self, GQuark iface); void tp_proxy_add_interfaces (TpProxy *self, const gchar * const *interfaces); void tp_proxy_invalidate (TpProxy *self, const GError *error); void tp_proxy_subclass_add_error_mapping (GType proxy_subclass, const gchar *static_prefix, GQuark domain, GType code_enum_type); gboolean tp_proxy_dbus_g_proxy_claim_for_signal_adding (DBusGProxy *proxy); void tp_proxy_init_known_interfaces (void); G_END_DECLS #undef _TP_IN_META_HEADER #endif /* #ifndef __TP_PROXY_SUBCLASS_H__*/ telepathy-glib-0.24.2/telepathy-glib/version.h.in0000644000175000017500000000023512652510705016612 00000000000000/* @configure_input@ */ #define TP_MAJOR_VERSION @TP_MAJOR_VERSION@ #define TP_MINOR_VERSION @TP_MINOR_VERSION@ #define TP_MICRO_VERSION @TP_MICRO_VERSION@ telepathy-glib-0.24.2/telepathy-glib/call-channel.c0000644000175000017500000014542414004031760017036 00000000000000/* * call-channel.h - high level API for Call channels * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-channel * @title: TpCallChannel * @short_description: proxy object for a call channel * * #TpCallChannel is a sub-class of #TpChannel providing convenient API * to make calls */ /** * TpCallChannel: * * Data structure representing a #TpCallChannel. * * Since: 0.17.5 */ /** * TpCallChannelClass: * * The class of a #TpCallChannel. * * Since: 0.17.5 */ #include "config.h" #include "telepathy-glib/call-channel.h" #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/automatic-client-factory-internal.h" #include "telepathy-glib/call-internal.h" #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" G_DEFINE_TYPE (TpCallChannel, tp_call_channel, TP_TYPE_CHANNEL) struct _TpCallChannelPrivate { /* Array of TpCallContents */ GPtrArray *contents; TpCallState state; TpCallFlags flags; GHashTable *state_details; TpCallStateReason *state_reason; gboolean hardware_streaming; /* TpContact -> TpCallMemberFlags */ GHashTable *members; gboolean initial_audio; gboolean initial_video; gchar *initial_audio_name; gchar *initial_video_name; gboolean mutable_contents; TpLocalHoldState hold_state; TpLocalHoldStateReason hold_state_reason; GSimpleAsyncResult *core_result; gboolean properties_retrieved; gboolean initial_members_retrieved; gboolean hold_state_retrieved; }; enum /* props */ { PROP_CONTENTS = 1, PROP_STATE, PROP_FLAGS, PROP_STATE_DETAILS, PROP_STATE_REASON, PROP_HARDWARE_STREAMING, PROP_INITIAL_AUDIO, PROP_INITIAL_VIDEO, PROP_INITIAL_AUDIO_NAME, PROP_INITIAL_VIDEO_NAME, PROP_MUTABLE_CONTENTS, PROP_HOLD_STATE, PROP_HOLD_STATE_REASON, }; enum /* signals */ { CONTENT_ADDED, CONTENT_REMOVED, STATE_CHANGED, MEMBERS_CHANGED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; static TpCallContent * _tp_call_content_new (TpCallChannel *self, const gchar *object_path) { return g_object_new (TP_TYPE_CALL_CONTENT, "bus-name", tp_proxy_get_bus_name (self), "dbus-daemon", tp_proxy_get_dbus_daemon (self), "dbus-connection", tp_proxy_get_dbus_connection (self), "object-path", object_path, "connection", tp_channel_get_connection ((TpChannel *) self), "channel", self, "factory", tp_proxy_get_factory (self), NULL); } /** * TpCallStateReason: * @actor: the contact responsible for the change, or 0 if no contact was * responsible * @reason: the reason for the change. If * #TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED then the @actor member will * dictate whether it was the local user or a remote contact responsible * @dbus_reason: A specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace * (for implementation-specific errors), or the empty string to indicate that * the state change was not an error * @message: A developer readable debug message giving the reason for the state * change. * * Data structure representing the reason for a call state change. * * Since: 0.17.5 */ static TpCallStateReason * _tp_call_state_reason_new_full (TpHandle actor, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { TpCallStateReason *r; r = g_slice_new0 (TpCallStateReason); r->actor = actor; r->reason = reason; r->dbus_reason = g_strdup (dbus_reason); r->message = g_strdup (message); r->ref_count = 1; return r; } TpCallStateReason * _tp_call_state_reason_new (const GValueArray *value_array) { TpHandle handle; TpCallStateChangeReason reason; const gchar *dbus_reason; const gchar *message; tp_value_array_unpack ((GValueArray *) value_array, 4, &handle, &reason, &dbus_reason, &message); return _tp_call_state_reason_new_full (handle, reason, dbus_reason, message); } TpCallStateReason * _tp_call_state_reason_ref (TpCallStateReason *r) { g_atomic_int_inc (&r->ref_count); return r; } void _tp_call_state_reason_unref (TpCallStateReason *r) { g_return_if_fail (r != NULL); if (g_atomic_int_dec_and_test (&r->ref_count)) { g_free (r->dbus_reason); g_free (r->message); g_slice_free (TpCallStateReason, r); } } G_DEFINE_BOXED_TYPE (TpCallStateReason, tp_call_state_reason, _tp_call_state_reason_ref, _tp_call_state_reason_unref); /* Convert GHashTable to GHashTable. * Assuming value does not need to be copied */ GHashTable * _tp_call_members_convert_table (TpConnection *connection, GHashTable *table, GHashTable *identifiers) { GHashTable *result; GHashTableIter iter; gpointer key, value; result = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); g_hash_table_iter_init (&iter, table); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); const gchar *id; TpContact *contact; id = g_hash_table_lookup (identifiers, key); if (id == NULL) { DEBUG ("Missing identifier for member %u - broken CM", handle); continue; } contact = tp_connection_dup_contact_if_possible (connection, handle, id); if (contact == NULL) { DEBUG ("Can't create contact for (%u, %s) pair - CM does not have " "immutable handles?", handle, id); continue; } g_hash_table_insert (result, contact, value); } return result; } /* Convert GArray to GPtrArray. * Assuming the TpContact already exists. */ GPtrArray * _tp_call_members_convert_array (TpConnection *connection, const GArray *array) { GPtrArray *result; guint i; result = g_ptr_array_new_full (array->len, g_object_unref); for (i = 0; i < array->len; i++) { TpHandle handle = g_array_index (array, TpHandle, i); TpContact *contact; /* The contact is supposed to already exists */ contact = tp_connection_dup_contact_if_possible (connection, handle, NULL); if (contact == NULL) { DEBUG ("No TpContact found for handle %u", handle); continue; } g_ptr_array_add (result, contact); } return result; } static TpCallContent * ensure_content (TpCallChannel *self, const gchar *object_path) { TpCallContent *content; guint i; for (i = 0; i < self->priv->contents->len; i++) { content = g_ptr_array_index (self->priv->contents, i); if (!tp_strdiff (tp_proxy_get_object_path (content), object_path)) return content; } DEBUG ("Content added: %s", object_path); content = _tp_call_content_new (self, object_path); g_ptr_array_add (self->priv->contents, content); g_signal_emit (self, _signals[CONTENT_ADDED], 0, content); return content; } static void content_added_cb (TpChannel *channel, const gchar *object_path, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) channel; if (!self->priv->properties_retrieved) return; ensure_content (self, object_path); } static void content_removed_cb (TpChannel *channel, const gchar *object_path, const GValueArray *reason, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) channel; guint i; if (!self->priv->properties_retrieved) return; for (i = 0; i < self->priv->contents->len; i++) { TpCallContent *content = g_ptr_array_index (self->priv->contents, i); if (!tp_strdiff (tp_proxy_get_object_path (content), object_path)) { TpCallStateReason *r; DEBUG ("Content removed: %s", object_path); r = _tp_call_state_reason_new (reason); g_object_ref (content); g_ptr_array_remove_index_fast (self->priv->contents, i); g_signal_emit (self, _signals[CONTENT_REMOVED], 0, content, r); g_signal_emit_by_name (content, "removed"); g_object_unref (content); _tp_call_state_reason_unref (r); return; } } DEBUG ("Content '%s' removed but not found", object_path); } static const gchar * call_state_to_string (TpCallState state) { switch (state) { case TP_CALL_STATE_UNKNOWN: return "unknown"; case TP_CALL_STATE_PENDING_INITIATOR: return "pending-initiator"; case TP_CALL_STATE_INITIALISING: return "initialising"; case TP_CALL_STATE_INITIALISED: return "initialised"; case TP_CALL_STATE_ACCEPTED: return "accepted"; case TP_CALL_STATE_ACTIVE: return "active"; case TP_CALL_STATE_ENDED: return "ended"; } return "invalid"; } static void call_state_changed_cb (TpChannel *channel, guint state, guint flags, const GValueArray *reason, GHashTable *details, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) channel; if (!self->priv->properties_retrieved) return; DEBUG ("Call state changed to %s (flags: %u)", call_state_to_string (state), flags); tp_clear_pointer (&self->priv->state_reason, _tp_call_state_reason_unref); tp_clear_pointer (&self->priv->state_details, g_hash_table_unref); self->priv->state = state; self->priv->flags = flags; self->priv->state_reason = _tp_call_state_reason_new (reason); self->priv->state_details = g_hash_table_ref (details); g_object_notify ((GObject *) self, "state"); g_object_notify ((GObject *) self, "flags"); g_object_notify ((GObject *) self, "state-reason"); g_object_notify ((GObject *) self, "state-details"); g_signal_emit (self, _signals[STATE_CHANGED], 0, self->priv->state, self->priv->flags, self->priv->state_reason, self->priv->state_details); } typedef struct { TpCallChannel *self; GHashTable *updates; GPtrArray *removed; TpCallStateReason *reason; } UpdateCallMembersData; static void channel_maybe_core_prepared (TpCallChannel *self) { if (self->priv->core_result == NULL) return; if (self->priv->initial_members_retrieved && self->priv->properties_retrieved && self->priv->hold_state_retrieved) { g_simple_async_result_complete (self->priv->core_result); g_clear_object (&self->priv->core_result); } } static void update_call_members_prepared_cb (GObject *object, GAsyncResult *result, gpointer user_data) { UpdateCallMembersData *data = user_data; TpCallChannel *self = data->self; GError *error = NULL; if (!_tp_channel_contacts_queue_prepare_finish ((TpChannel *) self, result, NULL, &error)) { DEBUG ("Error preparing call members: %s", error->message); g_clear_error (&error); } tp_g_hash_table_update (self->priv->members, data->updates, g_object_ref, NULL); if (data->removed != NULL) { guint i; for (i = 0; i < data->removed->len; i++) { g_hash_table_remove (self->priv->members, g_ptr_array_index (data->removed, i)); } } if (!self->priv->initial_members_retrieved) { self->priv->initial_members_retrieved = TRUE; channel_maybe_core_prepared (self); } else { g_signal_emit (self, _signals[MEMBERS_CHANGED], 0, data->updates, data->removed, data->reason); } tp_clear_pointer (&data->updates, g_hash_table_unref); tp_clear_pointer (&data->removed, g_ptr_array_unref); tp_clear_pointer (&data->reason, _tp_call_state_reason_unref); g_slice_free (UpdateCallMembersData, data); } static void update_call_members (TpCallChannel *self, GHashTable *updates, GPtrArray *removed, TpCallStateReason *reason) { GHashTableIter iter; gpointer key, value; GPtrArray *contacts; UpdateCallMembersData *data; /* We want to expose only prepared contacts. Collect TpContact objects and * prepared them in the channel's queue to make sure it does not reorder * events. * Applications where delay to display the call is critical shouldn't set * contact features on the factory, in which case this becomes no-op. */ contacts = g_ptr_array_new_full (g_hash_table_size (updates), g_object_unref); g_hash_table_iter_init (&iter, updates); while (g_hash_table_iter_next (&iter, &key, &value)) g_ptr_array_add (contacts, g_object_ref (key)); data = g_slice_new0 (UpdateCallMembersData); data->self = self; data->updates = g_hash_table_ref (updates); data->removed = removed != NULL ? g_ptr_array_ref (removed) : NULL; data->reason = reason != NULL ? _tp_call_state_reason_ref (reason) : NULL; _tp_channel_contacts_queue_prepare_async ((TpChannel *) self, contacts, update_call_members_prepared_cb, data); g_ptr_array_unref (contacts); } static void call_members_changed_cb (TpChannel *channel, GHashTable *updates, GHashTable *identifiers, const GArray *removed, const GValueArray *reason, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) channel; TpConnection *connection; GHashTable *updates_contacts; GPtrArray *removed_contacts; TpCallStateReason *r; DEBUG ("Call members: %d changed, %d removed", g_hash_table_size (updates), removed->len); connection = tp_channel_get_connection (channel); updates_contacts = _tp_call_members_convert_table (connection, updates, identifiers); removed_contacts = _tp_call_members_convert_array (connection, removed); r = _tp_call_state_reason_new (reason); update_call_members (self, updates_contacts, removed_contacts, r); g_hash_table_unref (updates_contacts); g_ptr_array_unref (removed_contacts); _tp_call_state_reason_unref (r); } static void got_all_properties_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) proxy; TpConnection *connection; GPtrArray *contents; GHashTable *members; GHashTable *identifiers; GHashTable *contacts; guint i; if (error != NULL) { DEBUG ("Could not get the call channel properties: %s", error->message); g_simple_async_result_set_from_error (self->priv->core_result, error); g_simple_async_result_complete (self->priv->core_result); g_clear_object (&self->priv->core_result); return; } connection = tp_channel_get_connection ((TpChannel *) self); g_assert (tp_connection_has_immortal_handles (connection)); self->priv->properties_retrieved = TRUE; contents = tp_asv_get_boxed (properties, "Contents", TP_ARRAY_TYPE_OBJECT_PATH_LIST); self->priv->state = tp_asv_get_uint32 (properties, "CallState", NULL); self->priv->flags = tp_asv_get_uint32 (properties, "CallFlags", NULL); self->priv->state_details = g_hash_table_ref (tp_asv_get_boxed (properties, "CallStateDetails", TP_HASH_TYPE_STRING_VARIANT_MAP)); self->priv->state_reason = _tp_call_state_reason_new (tp_asv_get_boxed (properties, "CallStateReason", TP_STRUCT_TYPE_CALL_STATE_REASON)); members = tp_asv_get_boxed (properties, "CallMembers", TP_HASH_TYPE_CALL_MEMBER_MAP); identifiers = tp_asv_get_boxed (properties, "MemberIdentifiers", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP); contacts = _tp_call_members_convert_table (connection, members, identifiers); update_call_members (self, contacts, NULL, NULL); g_hash_table_unref (contacts); for (i = 0; i < contents->len; i++) { const gchar *object_path = g_ptr_array_index (contents, i); DEBUG ("Initial content added: %s", object_path); g_ptr_array_add (self->priv->contents, _tp_call_content_new (self, object_path)); } /* core_result will be complete in update_call_members_prepared_cb() when * the initial members are prepared or when the hold state is retrived. */ } static void hold_state_changed_cb (TpChannel *proxy, guint arg_HoldState, guint arg_Reason, gpointer user_data, GObject *weak_object) { TpCallChannel *self = TP_CALL_CHANNEL (proxy); if (!self->priv->hold_state_retrieved) return; self->priv->hold_state = arg_HoldState; self->priv->hold_state_reason = arg_Reason; g_object_notify (G_OBJECT (proxy), "hold-state"); g_object_notify (G_OBJECT (proxy), "hold-state-reason"); } static void got_hold_state_cb (TpChannel *proxy, guint arg_HoldState, guint arg_Reason, const GError *error, gpointer user_data, GObject *weak_object) { TpCallChannel *self = TP_CALL_CHANNEL (proxy); if (error != NULL) { DEBUG ("Could not get the call channel hold state: %s", error->message); g_simple_async_result_set_from_error (self->priv->core_result, error); g_simple_async_result_complete (self->priv->core_result); g_clear_object (&self->priv->core_result); return; } self->priv->hold_state = arg_HoldState; self->priv->hold_state_reason = arg_Reason; self->priv->hold_state_retrieved = TRUE; channel_maybe_core_prepared (self); } static void _tp_call_channel_prepare_core_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpCallChannel *self = (TpCallChannel *) proxy; TpChannel *channel = (TpChannel *) self; tp_cli_channel_type_call_connect_to_content_added (channel, content_added_cb, NULL, NULL, NULL, NULL); tp_cli_channel_type_call_connect_to_content_removed (channel, content_removed_cb, NULL, NULL, NULL, NULL); tp_cli_channel_type_call_connect_to_call_state_changed (channel, call_state_changed_cb, NULL, NULL, NULL, NULL); tp_cli_channel_type_call_connect_to_call_members_changed (channel, call_members_changed_cb, NULL, NULL, NULL, NULL); g_assert (self->priv->core_result == NULL); self->priv->core_result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_call_channel_prepare_core_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CHANNEL_TYPE_CALL, got_all_properties_cb, NULL, NULL, NULL); if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD)) { tp_cli_channel_interface_hold_connect_to_hold_state_changed (channel, hold_state_changed_cb, NULL, NULL, NULL, NULL); tp_cli_channel_interface_hold_call_get_hold_state (channel, -1, got_hold_state_cb, NULL, NULL, NULL); } } static void tp_call_channel_constructed (GObject *obj) { TpCallChannel *self = (TpCallChannel *) obj; GHashTable *properties = _tp_channel_get_immutable_properties ( (TpChannel *) self); G_OBJECT_CLASS (tp_call_channel_parent_class)->constructed (obj); /* We can already set immutable properties */ self->priv->hardware_streaming = tp_asv_get_boolean (properties, TP_PROP_CHANNEL_TYPE_CALL_HARDWARE_STREAMING, NULL); self->priv->initial_audio = tp_asv_get_boolean (properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL); self->priv->initial_video = tp_asv_get_boolean (properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL); self->priv->initial_audio_name = g_strdup (tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO_NAME)); self->priv->initial_video_name = g_strdup (tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO_NAME)); self->priv->mutable_contents = tp_asv_get_boolean (properties, TP_PROP_CHANNEL_TYPE_CALL_MUTABLE_CONTENTS, NULL); if (!self->priv->initial_audio) tp_clear_pointer (&self->priv->initial_audio_name, g_free); if (!self->priv->initial_video) tp_clear_pointer (&self->priv->initial_video_name, g_free); } static void tp_call_channel_dispose (GObject *obj) { TpCallChannel *self = (TpCallChannel *) obj; g_assert (self->priv->core_result == NULL); tp_clear_pointer (&self->priv->contents, g_ptr_array_unref); tp_clear_pointer (&self->priv->state_details, g_hash_table_unref); tp_clear_pointer (&self->priv->state_reason, _tp_call_state_reason_unref); tp_clear_pointer (&self->priv->members, g_hash_table_unref); tp_clear_pointer (&self->priv->initial_audio_name, g_free); tp_clear_pointer (&self->priv->initial_video_name, g_free); G_OBJECT_CLASS (tp_call_channel_parent_class)->dispose (obj); } static void tp_call_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCallChannel *self = (TpCallChannel *) object; switch (property_id) { case PROP_CONTENTS: g_value_set_boxed (value, self->priv->contents); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; case PROP_FLAGS: g_value_set_uint (value, self->priv->flags); break; case PROP_STATE_DETAILS: g_value_set_boxed (value, self->priv->state_details); break; case PROP_STATE_REASON: g_value_set_boxed (value, self->priv->state_reason); break; case PROP_HARDWARE_STREAMING: g_value_set_boolean (value, self->priv->hardware_streaming); break; case PROP_INITIAL_AUDIO: g_value_set_boolean (value, self->priv->initial_audio); break; case PROP_INITIAL_VIDEO: g_value_set_boolean (value, self->priv->initial_video); break; case PROP_INITIAL_AUDIO_NAME: g_value_set_string (value, self->priv->initial_audio_name); break; case PROP_INITIAL_VIDEO_NAME: g_value_set_string (value, self->priv->initial_video_name); break; case PROP_MUTABLE_CONTENTS: g_value_set_boolean (value, self->priv->mutable_contents); break; case PROP_HOLD_STATE: g_value_set_uint (value, self->priv->hold_state); break; case PROP_HOLD_STATE_REASON: g_value_set_uint (value, self->priv->hold_state_reason); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_call_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; /* started from constructed */ features[FEAT_CORE].name = TP_CALL_CHANNEL_FEATURE_CORE; features[FEAT_CORE].prepare_async = _tp_call_channel_prepare_core_async; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_call_channel_class_init (TpCallChannelClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); TpProxyClass *proxy_class = (TpProxyClass *) klass; GParamSpec *param_spec; gobject_class->constructed = tp_call_channel_constructed; gobject_class->get_property = tp_call_channel_get_property; gobject_class->dispose = tp_call_channel_dispose; proxy_class->list_features = tp_call_channel_list_features; g_type_class_add_private (gobject_class, sizeof (TpCallChannelPrivate)); /* FIXME: Should be annoted with * * Type: GLib.PtrArray * Transfer: container * * But it does not work (bgo#663846) and makes gtkdoc fail myserably. */ /** * TpCallChannel:contents: * * #GPtrArray of #TpCallContent objects. The list of content objects that are * part of this call. * * It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on * those objects. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("contents", "Contents", "The content objects of this call", G_TYPE_PTR_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CONTENTS, param_spec); /** * TpCallChannel:state: * * A #TpCallState specifying the state of the call. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("state", "Call state", "The state of the call", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_STATE, param_spec); /** * TpCallChannel:flags: * * A #TpCallFlags specifying the flags of the call state. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("flags", "Call flags", "The flags of the call", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_FLAGS, param_spec); /** * TpCallChannel:state-details: * * Detailed infoermation about #TpCallChannel:state. It is a #GHashTable * mapping gchar*->GValue, it can be accessed using the tp_asv_* functions. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("state-details", "State details", "The details of the call", G_TYPE_HASH_TABLE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_STATE_DETAILS, param_spec); /** * TpCallChannel:state-reason: * * Reason why #TpCallChannel:state last changed. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("state-reason", "State reason", "The reason of the call's state", TP_TYPE_CALL_STATE_REASON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_STATE_REASON, param_spec); /** * TpCallChannel:hardware-streaming: * * Whether or not the streaming is done by dedicated hardware. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("hardware-streaming", "Hardware streaming", "Hardware streaming", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_HARDWARE_STREAMING, param_spec); /** * TpCallChannel:initial-audio: * * Whether or not the Call was started with audio. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("initial-audio", "Initial audio", "Initial audio", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_INITIAL_AUDIO, param_spec); /** * TpCallChannel:initial-video: * * Whether or not the Call was started with video. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("initial-video", "Initial video", "Initial video", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_INITIAL_VIDEO, param_spec); /** * TpCallChannel:initial-audio-name: * * If #TpCallChannel:initial-audio is set to %TRUE, then this property will * is the name of the intial audio content, %NULL otherwise. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("initial-audio-name", "Initial audio name", "Initial audio name", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_INITIAL_AUDIO_NAME, param_spec); /** * TpCallChannel:initial-video-name: * * If #TpCallChannel:initial-video is set to %TRUE, then this property will * is the name of the intial video content, %NULL otherwise. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("initial-video-name", "Initial video name", "Initial video name", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_INITIAL_VIDEO_NAME, param_spec); /** * TpCallChannel:mutable-contents: * * Whether or not call contents can be added or removed. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("mutable-contents", "Mutable contents", "Mutable contents", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_MUTABLE_CONTENTS, param_spec); /** * TpCallChannel:hold-state: * * A #TpLocalHoldState specifying if the Call is currently held * * Since: 0.17.6 */ param_spec = g_param_spec_uint ("hold-state", "Hold State", "The Hold state of the call", 0, G_MAXUINT, TP_LOCAL_HOLD_STATE_UNHELD, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_HOLD_STATE, param_spec); /** * TpCallChannel:hold-state-reason: * * A #TpLocalHoldStateReason specifying why the Call is currently held. * * Since: 0.17.6 */ param_spec = g_param_spec_uint ("hold-state-reason", "Hold State Reason", "The reason for the current hold state", 0, G_MAXUINT, TP_LOCAL_HOLD_STATE_REASON_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_HOLD_STATE_REASON, param_spec); /** * TpCallChannel::content-added: * @self: the #TpCallChannel * @content: the newly added #TpCallContent * * The ::content-added signal is emitted whenever a * #TpCallContent is added to @self. * * It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on * @content. * * Since: 0.17.5 */ _signals[CONTENT_ADDED] = g_signal_new ("content-added", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_OBJECT); /** * TpCallChannel::content-removed: * @self: the #TpCallChannel * @content: the newly removed #TpCallContent * @reason: a #TpCallStateReason * * The ::content-removed signal is emitted whenever a * #TpCallContent is removed from @self. * * It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on * @content. * * Since: 0.17.5 */ _signals[CONTENT_REMOVED] = g_signal_new ("content-removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_OBJECT, TP_TYPE_CALL_STATE_REASON); /** * TpCallChannel::state-changed: * @self: the #TpCallChannel * @state: the new #TpCallState * @flags: the new #TpCallFlags * @reason: the #TpCallStateReason for the change * @details: (element-type utf8 GObject.Value): additional details as a * #GHashTable readable using the tp_asv_* functions. * * The ::state-changed signal is emitted whenever the * call state changes. * * Since: 0.17.5 */ _signals[STATE_CHANGED] = g_signal_new ("state-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, TP_TYPE_CALL_STATE_REASON, G_TYPE_HASH_TABLE); /** * TpCallChannel::members-changed: * @self: the #TpCallChannel * @updates: (type GLib.HashTable) (element-type TelepathyGLib.Contact uint): * #GHashTable mapping #TpContact to its new #TpCallMemberFlags * @removed: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * #GPtrArray of #TpContact removed from the call members * @reason: the #TpCallStateReason for the change * * The ::members-changed signal is emitted whenever the call's members * changes. * * The #TpContact objects are guaranteed to have all of the features * previously passed to tp_simple_client_factory_add_contact_features() * prepared. * * Since: 0.17.5 */ _signals[MEMBERS_CHANGED] = g_signal_new ("members-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_HASH_TABLE, G_TYPE_PTR_ARRAY, TP_TYPE_CALL_STATE_REASON); } static void tp_call_channel_init (TpCallChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_CALL_CHANNEL, TpCallChannelPrivate); self->priv->contents = g_ptr_array_new_with_free_func (g_object_unref); self->priv->members = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); } TpCallChannel * _tp_call_channel_new_with_factory (TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; return g_object_new (TP_TYPE_CALL_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL); } /** * TP_CALL_CHANNEL_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" * feature on a #TpCallChannel. * * One can ask for a feature to be prepared using the tp_proxy_prepare_async() * function, and waiting for it to trigger the callback. */ GQuark tp_call_channel_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-call-channel-feature-core"); } /** * tp_call_channel_get_contents: * @self: a #TpCallChannel * * * * Returns: (transfer none) (type GLib.PtrArray) (element-type TelepathyGLib.CallContent): * the value of #TpCallChannel:contents * Since: 0.17.5 */ GPtrArray * tp_call_channel_get_contents (TpCallChannel *self) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), NULL); return self->priv->contents; } /** * tp_call_channel_get_state: * @self: a #TpCallChannel * @flags: (out) (allow-none) (transfer none): a place to set the value of * #TpCallChannel:flags * @details: (out) (allow-none) (transfer none): a place to set the value of * #TpCallChannel:state-details * @reason: (out) (allow-none) (transfer none): a place to set the value of * #TpCallChannel:state-reason * * * * Returns: the value of #TpCallChannel:state * Since: 0.17.5 */ TpCallState tp_call_channel_get_state (TpCallChannel *self, TpCallFlags *flags, GHashTable **details, TpCallStateReason **reason) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), TP_CALL_STATE_UNKNOWN); if (flags != NULL) *flags = self->priv->flags; if (details != NULL) *details = self->priv->state_details; if (reason != NULL) *reason = self->priv->state_reason; return self->priv->state; } /** * tp_call_channel_has_hardware_streaming: * @self: a #TpCallChannel * * * * Returns: the value of #TpCallChannel:hardware-streaming * Since: 0.17.5 */ gboolean tp_call_channel_has_hardware_streaming (TpCallChannel *self) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); return self->priv->hardware_streaming; } /** * tp_call_channel_has_initial_audio: * @self: a #TpCallChannel * @initial_audio_name: (out) (allow-none) (transfer none): a place to set the * value of #TpCallChannel:initial-audio-name * * * * Returns: the value of #TpCallChannel:initial-audio * Since: 0.17.5 */ gboolean tp_call_channel_has_initial_audio (TpCallChannel *self, const gchar **initial_audio_name) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); if (initial_audio_name != NULL) *initial_audio_name = self->priv->initial_audio_name; return self->priv->initial_audio; } /** * tp_call_channel_has_initial_video: * @self: a #TpCallChannel * @initial_video_name: (out) (allow-none) (transfer none): a place to set the * value of #TpCallChannel:initial-video-name * * * * Returns: the value of #TpCallChannel:initial-video * Since: 0.17.5 */ gboolean tp_call_channel_has_initial_video (TpCallChannel *self, const gchar **initial_video_name) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); if (initial_video_name != NULL) *initial_video_name = self->priv->initial_video_name; return self->priv->initial_video; } /** * tp_call_channel_has_mutable_contents: * @self: a #TpCallChannel * * * * Returns: the value of #TpCallChannel:mutable-contents * Since: 0.17.5 */ gboolean tp_call_channel_has_mutable_contents (TpCallChannel *self) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); return self->priv->mutable_contents; } /** * tp_call_channel_get_members: * @self: a #TpCallChannel * * Get the members of this call. * * The #TpContact objects are guaranteed to have all of the features * previously passed to tp_simple_client_factory_add_contact_features() * prepared. * * Returns: (transfer none) (type GLib.HashTable) (element-type TelepathyGLib.Contact uint): * #GHashTable mapping #TpContact to its new #TpCallMemberFlags * Since: 0.17.5 */ GHashTable * tp_call_channel_get_members (TpCallChannel *self) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), NULL); return self->priv->members; } /** * tp_call_channel_has_dtmf: * @self: a #TpCallChannel * * Whether or not @self can send DTMF tones using * tp_call_channel_send_tones_async(). To be able to send DTMF tones, at least * one of @self's #TpCallChannel:contents must implement * %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. * * Returns: whether or not @self can send DTMF tones. * Since: 0.17.5 */ gboolean tp_call_channel_has_dtmf (TpCallChannel *self) { guint i; g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); for (i = 0; i < self->priv->contents->len; i++) { TpCallContent *content = g_ptr_array_index (self->priv->contents, i); if (tp_proxy_has_interface_by_id (content, TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF)) return TRUE; } return FALSE; } /** * tp_call_channel_has_hold: * @self: a #TpCallChannel * * Whether or not @self has the %TP_IFACE_CHANNEL_INTERFACE_HOLD * interfaces * * Returns: whether or not @self supports Hold * Since: 0.17.6 */ gboolean tp_call_channel_has_hold (TpCallChannel *self) { g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), FALSE); g_return_val_if_fail ( tp_proxy_is_prepared (self, TP_CALL_CHANNEL_FEATURE_CORE), FALSE); return tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_HOLD); } static void generic_async_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Error: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete (result); } /** * tp_call_channel_set_ringing_async: * @self: a #TpCallChannel * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Indicate that the local user has been alerted about the incoming call. * * Since: 0.17.5 */ void tp_call_channel_set_ringing_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_set_ringing_async); tp_cli_channel_type_call_call_set_ringing (TP_CHANNEL (self), -1, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_channel_set_ringing_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_set_ringing_async(). * * Since: 0.17.5 */ gboolean tp_call_channel_set_ringing_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_set_ringing_async); } /** * tp_call_channel_set_queued_async: * @self: a #TpCallChannel * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Notifies the CM that the local user is already in a call, so this call has * been put in a call-waiting style queue. * * Since: 0.17.5 */ void tp_call_channel_set_queued_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_set_queued_async); tp_cli_channel_type_call_call_set_queued (TP_CHANNEL (self), -1, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_channel_set_queued_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_set_queued_async(). * * Since: 0.17.5 */ gboolean tp_call_channel_set_queued_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_set_queued_async); } /** * tp_call_channel_accept_async: * @self: a #TpCallChannel * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * For incoming calls with #TpCallChannel:state set to * %TP_CALL_STATE_INITIALISED, accept the incoming call. This changes * #TpCallChannel:state to %TP_CALL_STATE_ACCEPTED. * * For outgoing calls with #TpCallChannel:state set to * %TP_CALL_STATE_PENDING_INITIATOR, actually call the remote contact; this * changes #TpCallChannel:state to * %TP_CALL_STATE_INITIALISING. * * Since: 0.17.5 */ void tp_call_channel_accept_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_accept_async); tp_cli_channel_type_call_call_accept (TP_CHANNEL (self), -1, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_channel_accept_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_accept_async(). * * Since: 0.17.5 */ gboolean tp_call_channel_accept_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_accept_async); } /** * tp_call_channel_hangup_async: * @self: a #TpCallChannel * @reason: a TpCallStateChangeReason * @detailed_reason: a more specific reason for the call hangup, if one is * available, or an empty or %NULL string otherwise * @message: a human-readable message to be sent to the remote contact(s) * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Request that the call is ended. All contents will be removed from @self so * that the #TpCallChannel:contents property will be the empty list. * * Since: 0.17.5 */ void tp_call_channel_hangup_async (TpCallChannel *self, TpCallStateChangeReason reason, const gchar *detailed_reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_hangup_async); tp_cli_channel_type_call_call_hangup (TP_CHANNEL (self), -1, reason, detailed_reason, message, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_channel_hangup_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_hangup_async(). * * Since: 0.17.5 */ gboolean tp_call_channel_hangup_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_hangup_async); } static void add_content_cb (TpChannel *channel, const gchar *object_path, const GError *error, gpointer user_data, GObject *weak_object) { TpCallChannel *self = (TpCallChannel *) channel; GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Error: %s", error->message); g_simple_async_result_set_from_error (result, error); } else { g_simple_async_result_set_op_res_gpointer (result, g_object_ref (ensure_content (self, object_path)), g_object_unref); } g_simple_async_result_complete (result); } /** * tp_call_channel_add_content_async: * @self: a #TpCallChannel * @name: the suggested name of the content to add * @type: the media stream type of the content to be added to the call, from * #TpMediaStreamType * @initial_direction: The initial direction of the content * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Request that a new Content of type @type is added to @self. Callers should * check the value of the #TpCallChannel:mutable-contents property before trying * to add another content as it might not be allowed. * * Since: 0.17.5 */ void tp_call_channel_add_content_async (TpCallChannel *self, const gchar *name, TpMediaStreamType type, TpMediaStreamDirection initial_direction, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_add_content_async); tp_cli_channel_type_call_call_add_content (TP_CHANNEL (self), -1, name, type, initial_direction, add_content_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_channel_add_content_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_add_content_async(). * * The returned #TpCallContent is NOT guaranteed to have * %TP_CALL_CONTENT_FEATURE_CORE prepared. * * Returns: (transfer full): reference to the new #TpCallContent. * Since: 0.17.5 */ TpCallContent * tp_call_channel_add_content_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_call_channel_add_content_async, g_object_ref); } static void send_tones_cb (GObject *source, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *result = user_data; guint count; GError *error = NULL; if (!tp_call_content_send_tones_finish ((TpCallContent *) source, res, &error)) g_simple_async_result_take_error (result, error); /* Decrement the op count */ count = GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (result)); g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (--count), NULL); if (count == 0) g_simple_async_result_complete (result); g_object_unref (result); } /** * tp_call_channel_send_tones_async: * @self: a #TpCallChannel * @tones: a string representation of one or more DTMF events. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Send @tones on every of @self's contents which have the * %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. * * For more details, see tp_call_content_send_tones_async(). * * Since: 0.17.5 */ void tp_call_channel_send_tones_async (TpCallChannel *self, const gchar *tones, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; guint i; guint count = 0; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); g_return_if_fail (tp_call_channel_has_dtmf (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_send_tones_async); for (i = 0; i < self->priv->contents->len; i++) { TpCallContent *content = g_ptr_array_index (self->priv->contents, i); if (!tp_proxy_has_interface_by_id (content, TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF)) continue; count++; tp_call_content_send_tones_async (content, tones, cancellable, send_tones_cb, g_object_ref (result)); } g_assert (count > 0); g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (count), NULL); g_object_unref (result); } /** * tp_call_channel_send_tones_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_send_tones_async(). * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.17.5 */ gboolean tp_call_channel_send_tones_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_send_tones_async) } /** * tp_call_channel_request_hold_async: * @self: a #TpCallChannel * @hold: Whether to request a hold or a unhold * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Requests that the connection manager holds or unholds the call. Watch * #TpCallChannel:hold-state property to know when the channel goes on * hold or is unheld. Unholding may fail if the streaming implementation * can not obtain all the resources needed to restart the call. * * Since: 0.17.6 */ void tp_call_channel_request_hold_async (TpCallChannel *self, gboolean hold, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_channel_request_hold_async); if (tp_call_channel_has_hold (self)) { tp_cli_channel_interface_hold_call_request_hold (TP_CHANNEL (self), -1, hold, generic_async_cb, g_object_ref (result), g_object_unref, G_OBJECT (self)); } else { g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_NOT_CAPABLE, "Channel does NOT implement the Hold interface"); g_simple_async_result_complete_in_idle (result); } g_object_unref (result); } /** * tp_call_channel_request_hold_finish: * @self: a #TpCallChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_channel_request_hold_async * * Since: 0.17.6 */ gboolean tp_call_channel_request_hold_finish (TpCallChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_channel_request_hold_async); } telepathy-glib-0.24.2/telepathy-glib/call-channel.h0000644000175000017500000001360112652510705017042 00000000000000/* * call-channel.h - high level API for Call channels * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_CHANNEL_H__ #define __TP_CALL_CHANNEL_H__ #include #include G_BEGIN_DECLS #define TP_TYPE_CALL_CHANNEL (tp_call_channel_get_type ()) #define TP_CALL_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CALL_CHANNEL, TpCallChannel)) #define TP_CALL_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_CALL_CHANNEL, TpCallChannelClass)) #define TP_IS_CALL_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CALL_CHANNEL)) #define TP_IS_CALL_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_CALL_CHANNEL)) #define TP_CALL_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CALL_CHANNEL, TpCallChannelClass)) /* forward declaration, see call-content.h for the rest */ typedef struct _TpCallContent TpCallContent; typedef struct _TpCallChannel TpCallChannel; typedef struct _TpCallChannelClass TpCallChannelClass; typedef struct _TpCallChannelPrivate TpCallChannelPrivate; struct _TpCallChannel { /**/ TpChannel parent; TpCallChannelPrivate *priv; }; struct _TpCallChannelClass { /**/ TpChannelClass parent_class; GCallback _padding[7]; }; _TP_AVAILABLE_IN_0_18 GType tp_call_channel_get_type (void); typedef struct _TpCallStateReason TpCallStateReason; struct _TpCallStateReason { TpHandle actor; TpCallStateChangeReason reason; gchar *dbus_reason; gchar *message; /**/ guint ref_count; }; #define TP_TYPE_CALL_STATE_REASON (tp_call_state_reason_get_type ()) _TP_AVAILABLE_IN_0_18 GType tp_call_state_reason_get_type (void); #define TP_CALL_CHANNEL_FEATURE_CORE \ tp_call_channel_get_feature_quark_core () _TP_AVAILABLE_IN_0_18 GQuark tp_call_channel_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 GPtrArray *tp_call_channel_get_contents (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 TpCallState tp_call_channel_get_state (TpCallChannel *self, TpCallFlags *flags, GHashTable **details, TpCallStateReason **reason); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_hardware_streaming (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_initial_audio (TpCallChannel *self, const gchar **initial_audio_name); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_initial_video (TpCallChannel *self, const gchar **initial_video_name); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_mutable_contents (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 GHashTable *tp_call_channel_get_members (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_dtmf (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_has_hold (TpCallChannel *self); _TP_AVAILABLE_IN_0_18 void tp_call_channel_set_ringing_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_set_ringing_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_set_queued_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_set_queued_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_accept_async (TpCallChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_accept_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_hangup_async (TpCallChannel *self, TpCallStateChangeReason reason, const gchar *detailed_reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_hangup_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_add_content_async (TpCallChannel *self, const gchar *name, TpMediaStreamType type, TpMediaStreamDirection initial_direction, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 TpCallContent *tp_call_channel_add_content_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_send_tones_async (TpCallChannel *self, const gchar *tones, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_send_tones_finish (TpCallChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_channel_request_hold_async (TpCallChannel *self, gboolean hold, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_channel_request_hold_finish (TpCallChannel *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/base-protocol-internal.h0000644000175000017500000000213212652510705021101 00000000000000/**/ /* TpBaseProtocol (not public API) * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_BASE_PROTOCOL_INTERNAL_H #define TP_BASE_PROTOCOL_INTERNAL_H #include G_BEGIN_DECLS GValueArray *_tp_cm_param_spec_to_dbus (const TpCMParamSpec *paramspec); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/simple-handler.c0000644000175000017500000003325512652510705017427 00000000000000/* * Simple implementation of an Handler * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: simple-handler * @title: TpSimpleHandler * @short_description: a subclass of #TpBaseClient implementing * a simple Handler * * This class makes it easier to construct a #TpSvcClient implementing the * #TpSvcClientHandler interface. * * A typical simple handler would look liks this: * |[ * static void * my_handle_channels (TpSimpleHandler *handler, * TpAccount *account, * TpConnection *connection, * GList *channels, * GList *requests_satisfied, * gint64 user_action_time, * GList *requests, * TpHandleChannelsContext *context, * gpointer user_data) * { * /* start handling the channels here */ * * tp_handle_channels_context_accept (context); * } * * factory = tp_automatic_client_factory_new (dbus); * client = tp_simple_handler_new_with_factory (factory, FALSE, FALSE, * "MyHandler", FALSE, my_handle_channels, user_data); * g_object_unref (factory); * * tp_base_client_take_handler_filter (client, tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * NULL)); * * tp_base_client_register (client, NULL); * ]| * * See examples/client/text-handler.c for a complete example. * * Since: 0.11.6 */ /** * TpSimpleHandler: * * Data structure representing a simple Handler implementation. * * Since: 0.11.6 */ /** * TpSimpleHandlerClass: * * The class of a #TpSimpleHandler. * * Since: 0.11.6 */ /** * TpSimpleHandlerHandleChannelsImpl: * @handler: a #TpSimpleHandler instance * @account: a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible * @connection: a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared * if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * all having %TP_CHANNEL_FEATURE_CORE prepared if possible * @requests_satisfied: (element-type TelepathyGLib.ChannelRequest): a #GList of * #TpChannelRequest having their object-path defined but are not guaranteed * to be prepared. * @user_action_time: the time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME * (see #TpAccountChannelRequest:user-action-time for details) * @context: a #TpHandleChannelsContext representing the context of this * D-Bus call * @user_data: arbitrary user-supplied data passed to tp_simple_handler_new() * * Signature of the implementation of the HandleChannels method. * * This function must call either tp_handle_channels_context_accept(), * tp_handle_channels_context_delay() or tp_handle_channels_context_fail() * on @context before it returns. * * Since: 0.11.6 */ #include "config.h" #include "telepathy-glib/simple-handler.h" #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" G_DEFINE_TYPE(TpSimpleHandler, tp_simple_handler, TP_TYPE_BASE_CLIENT) enum { PROP_BYPASS_APPROVAL = 1, PROP_REQUESTS, PROP_CALLBACK, PROP_USER_DATA, PROP_DESTROY, N_PROPS }; struct _TpSimpleHandlerPrivate { TpSimpleHandlerHandleChannelsImpl callback; gpointer user_data; GDestroyNotify destroy; }; static void tp_simple_handler_init (TpSimpleHandler *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_HANDLER, TpSimpleHandlerPrivate); } static void tp_simple_handler_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseClient *base = TP_BASE_CLIENT (object); TpSimpleHandler *self = TP_SIMPLE_HANDLER (object); switch (property_id) { case PROP_BYPASS_APPROVAL: tp_base_client_set_handler_bypass_approval (base, g_value_get_boolean (value)); break; case PROP_REQUESTS: if (g_value_get_boolean (value)) tp_base_client_set_handler_request_notification (base); break; case PROP_CALLBACK: self->priv->callback = g_value_get_pointer (value); break; case PROP_USER_DATA: self->priv->user_data = g_value_get_pointer (value); break; case PROP_DESTROY: self->priv->destroy = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_handler_constructed (GObject *object) { TpSimpleHandler *self = TP_SIMPLE_HANDLER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_simple_handler_parent_class)->constructed; g_assert (self->priv->callback != NULL); if (chain_up != NULL) chain_up (object); } static void tp_simple_handler_dispose (GObject *object) { TpSimpleHandler *self = TP_SIMPLE_HANDLER (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_simple_handler_parent_class)->dispose; if (self->priv->destroy != NULL) { self->priv->destroy (self->priv->user_data); self->priv->destroy = NULL; } if (dispose != NULL) dispose (object); } static void handle_channels ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisfied, gint64 user_action_time, TpHandleChannelsContext *context) { TpSimpleHandler *self = TP_SIMPLE_HANDLER (client); self->priv->callback (self, account, connection, channels, requests_satisfied, user_action_time, context, self->priv->user_data); } static void tp_simple_handler_class_init (TpSimpleHandlerClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpSimpleHandlerPrivate)); object_class->set_property = tp_simple_handler_set_property; object_class->constructed = tp_simple_handler_constructed; object_class->dispose = tp_simple_handler_dispose; /** * TpSimpleHandler:bypass-approval: * * The value of the Handler.BypassApproval D-Bus property. * * Since: 0.11.6 */ param_spec = g_param_spec_boolean ("bypass-approval", "bypass approval", "Handler.BypassApproval", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BYPASS_APPROVAL, param_spec); /** * TpSimpleHandler:requests: * * If %TRUE, the Handler will implement the Requests interface * * Since: 0.11.6 */ param_spec = g_param_spec_boolean ("requests", "requests", "Requests", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTS, param_spec); /** * TpSimpleHandler:callback: * * The #TpSimpleHandlerHandleChannelsImpl callback implementing the * HandleChannels D-Bus method. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_pointer ("callback", "Callback", "Function called when HandleChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALLBACK, param_spec); /** * TpSimpleHandler:user-data: * * The user-data pointer passed to #TpSimpleHandler:callback. * * Since: 0.11.6 */ param_spec = g_param_spec_pointer ("user-data", "user data", "pointer passed as user-data when HandleChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_DATA, param_spec); /** * TpSimpleHandler:destroy: * * The #GDestroyNotify function called to free #TpSimpleHandler:user-data * when the #TpSimpleHandler is destroyed. * * Since: 0.11.6 */ param_spec = g_param_spec_pointer ("destroy", "destroy", "function called to destroy the user-data when destroying the handler", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESTROY, param_spec); base_clt_cls->handle_channels = handle_channels; } /** * tp_simple_handler_new: * @dbus: a #TpDBusDaemon object, may not be %NULL * @bypass_approval: the value of the Handler.BypassApproval D-Bus property * (see tp_base_client_set_handler_bypass_approval() for details) * @requests: whether this handler should implement Requests (see * tp_base_client_set_handler_request_notification() for details) * @name: the name of the Handler (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when HandleChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleHandler * is destroyed * * Convenient function to create a new #TpSimpleHandler instance. * * If @dbus is not the result of tp_dbus_daemon_dup(), you should call * tp_simple_handler_new_with_am() instead, so that #TpAccount, * #TpConnection and #TpContact instances can be shared between modules. * * Returns: (type TelepathyGLib.SimpleHandler): a new #TpSimpleHandler * * Since: 0.11.6 * Deprecated: New code should use tp_simple_handler_new_with_am() instead. */ TpBaseClient * tp_simple_handler_new (TpDBusDaemon *dbus, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_HANDLER, "dbus-daemon", dbus, "bypass-approval", bypass_approval, "requests", requests, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_handler_new_with_am: * @account_manager: an account manager, which may not be %NULL * @bypass_approval: the value of the Handler.BypassApproval D-Bus property * (see tp_base_client_set_handler_bypass_approval() for details) * @requests: whether this handler should implement Requests (see * tp_base_client_set_handler_request_notification() for details) * @name: the name of the Handler (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when HandleChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleHandler * is destroyed * * Convenient function to create a new #TpSimpleHandler instance with a * specified #TpAccountManager. * * It is not necessary to prepare any features on @account_manager before * calling this function. * * Returns: (type TelepathyGLib.SimpleHandler): a new #TpSimpleHandler * * Since: 0.11.14 */ TpBaseClient * tp_simple_handler_new_with_am (TpAccountManager *account_manager, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_HANDLER, "account-manager", account_manager, "bypass-approval", bypass_approval, "requests", requests, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_handler_new_with_factory: * @factory: a #TpSimpleClientFactory, which may not be %NULL * @bypass_approval: the value of the Handler.BypassApproval D-Bus property * (see tp_base_client_set_handler_bypass_approval() for details) * @requests: whether this handler should implement Requests (see * tp_base_client_set_handler_request_notification() for details) * @name: the name of the Handler (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when HandleChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleHandler * is destroyed * * Convenient function to create a new #TpSimpleHandler instance with a * specified #TpSimpleClientFactory. * * Returns: (type TelepathyGLib.SimpleHandler): a new #TpSimpleHandler * * Since: 0.15.5 */ TpBaseClient * tp_simple_handler_new_with_factory (TpSimpleClientFactory *factory, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_HANDLER, "factory", factory, "bypass-approval", bypass_approval, "requests", requests, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } telepathy-glib-0.24.2/telepathy-glib/simple-handler.h0000644000175000017500000000714412652510705017432 00000000000000/* * Simple implementation of an Handler * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIMPLE_HANDLER_H__ #define __TP_SIMPLE_HANDLER_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _TpSimpleHandler TpSimpleHandler; typedef struct _TpSimpleHandlerClass TpSimpleHandlerClass; typedef struct _TpSimpleHandlerPrivate TpSimpleHandlerPrivate; struct _TpSimpleHandlerClass { /**/ TpBaseClientClass parent_class; GCallback _padding[7]; }; struct _TpSimpleHandler { /**/ TpBaseClient parent; TpSimpleHandlerPrivate *priv; }; GType tp_simple_handler_get_type (void); #define TP_TYPE_SIMPLE_HANDLER \ (tp_simple_handler_get_type ()) #define TP_SIMPLE_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIMPLE_HANDLER, \ TpSimpleHandler)) #define TP_SIMPLE_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_SIMPLE_HANDLER, \ TpSimpleHandlerClass)) #define TP_IS_SIMPLE_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIMPLE_HANDLER)) #define TP_IS_SIMPLE_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_SIMPLE_HANDLER)) #define TP_SIMPLE_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_HANDLER, \ TpSimpleHandlerClass)) typedef void (*TpSimpleHandlerHandleChannelsImpl) ( TpSimpleHandler *handler, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisfied, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_handler_new_with_factory) TpBaseClient * tp_simple_handler_new (TpDBusDaemon *dbus, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); #endif TpBaseClient *tp_simple_handler_new_with_am (TpAccountManager *account_manager, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); _TP_AVAILABLE_IN_0_16 TpBaseClient *tp_simple_handler_new_with_factory ( TpSimpleClientFactory *factory, gboolean bypass_approval, gboolean requests, const gchar *name, gboolean uniquify, TpSimpleHandlerHandleChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-request.c0000644000175000017500000006276612652510705017632 00000000000000/* * channel-request.c - proxy for a request to the Telepathy channel dispatcher * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-request.h" #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_DISPATCHER #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/variant-util-internal.h" #include "telepathy-glib/_gen/tp-cli-channel-request-body.h" /** * SECTION:channel-request * @title: TpChannelRequest * @short_description: proxy object for a request to the Telepathy channel * dispatcher * @see_also: #TpChannelDispatcher * * Requesting a channel from the channel dispatcher can take some time, so an * object is created in the channel dispatcher to represent each request. * Objects of the #TpChannelRequest class provide access to one of those * objects. */ /** * TpChannelRequest: * * Requesting a channel from the channel dispatcher can take some time, so an * object is created in the channel dispatcher to represent each request. This * proxy represents one of those objects. * * Any client can call tp_cli_channel_request_call_cancel() at any time to * attempt to cancel the request. * * On success, the #TpChannelRequest::succeeded signal will be emitted. * Immediately after that, the #TpProxy::invalidated signal will be emitted, * with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_OBJECT_REMOVED (this is not an error condition, it merely * indicates that the channel request no longer exists). * * On failure, the #TpProxy::invalidated signal will be emitted with some * other suitable error, usually from the %TP_ERROR domain. * * If the channel dispatcher crashes or exits, the #TpProxy::invalidated * signal will be emitted with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_NAME_OWNER_LOST. * * Creating a #TpChannelRequest directly is deprecated: it * should only be created via a #TpAccountChannelRequest * or a #TpBaseClient. * * Since 0.16, #TpChannelRequest always has a non-%NULL #TpProxy:factory, * and its #TpProxy:factory will be propagated to the #TpAccount, * #TpConnection and #TpChannel. * * Since: 0.7.32 */ /** * TpChannelRequestClass: * * The class of a #TpChannelRequest. */ enum { SIGNAL_SUCCEEDED, SIGNAL_SUCCEEDED_WITH_CHANNEL, N_SIGNALS }; enum { PROP_CHANNEL_FACTORY = 1, PROP_IMMUTABLE_PROPERTIES, PROP_IMMUTABLE_PROPERTIES_VARDICT, PROP_ACCOUNT, PROP_USER_ACTION_TIME, PROP_PREFERRED_HANDLER, PROP_HINTS, PROP_HINTS_VARDICT }; static guint signals[N_SIGNALS] = { 0 }; struct _TpChannelRequestPrivate { GHashTable *immutable_properties; TpClientChannelFactory *channel_factory; gboolean succeeded_with_chan_fired; TpAccount *account; }; G_DEFINE_TYPE (TpChannelRequest, tp_channel_request, TP_TYPE_PROXY) static void tp_channel_request_init (TpChannelRequest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CHANNEL_REQUEST, TpChannelRequestPrivate); } static void tp_channel_request_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpChannelRequest *self = TP_CHANNEL_REQUEST (object); switch (property_id) { case PROP_CHANNEL_FACTORY: tp_clear_object (&self->priv->channel_factory); self->priv->channel_factory = g_value_dup_object (value); break; case PROP_IMMUTABLE_PROPERTIES: g_assert (self->priv->immutable_properties == NULL); self->priv->immutable_properties = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_channel_request_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpChannelRequest *self = TP_CHANNEL_REQUEST (object); switch (property_id) { case PROP_CHANNEL_FACTORY: g_value_set_object (value, self->priv->channel_factory); break; case PROP_IMMUTABLE_PROPERTIES: g_value_set_boxed (value, self->priv->immutable_properties); break; case PROP_IMMUTABLE_PROPERTIES_VARDICT: g_value_take_variant (value, tp_channel_request_dup_immutable_properties (self)); break; case PROP_ACCOUNT: g_value_set_object (value, tp_channel_request_get_account (self)); break; case PROP_USER_ACTION_TIME: g_value_set_int64 (value, tp_channel_request_get_user_action_time (self)); break; case PROP_PREFERRED_HANDLER: g_value_set_string (value, tp_channel_request_get_preferred_handler (self)); break; case PROP_HINTS: g_value_set_boxed (value, tp_channel_request_get_hints (self)); break; case PROP_HINTS_VARDICT: g_value_take_variant (value, tp_channel_request_dup_hints (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_channel_request_failed_cb (TpChannelRequest *self, const gchar *error_name, const gchar *message, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { GError *error = NULL; tp_proxy_dbus_error_to_gerror (self, error_name, message, &error); tp_proxy_invalidate ((TpProxy *) self, error); g_error_free (error); } static void tp_channel_request_succeeded_cb (TpChannelRequest *self, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED, "ChannelRequest succeeded and was removed" }; if (!self->priv->succeeded_with_chan_fired) { DEBUG ("MC is too old and didn't fired SucceededWithChannel"); g_signal_emit (self, signals[SIGNAL_SUCCEEDED_WITH_CHANNEL], 0, NULL, NULL); self->priv->succeeded_with_chan_fired = TRUE; } /* Fire the old legacy signal as well */ g_signal_emit (self, signals[SIGNAL_SUCCEEDED], 0); tp_proxy_invalidate ((TpProxy *) self, &e); } static void tp_channel_request_succeeded_with_channel_cb (TpChannelRequest *self, const gchar *conn_path, GHashTable *conn_props, const gchar *chan_path, GHashTable *chan_props, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { TpConnection *connection; TpChannel *channel; GError *error = NULL; connection = tp_simple_client_factory_ensure_connection ( tp_proxy_get_factory (self), conn_path, NULL, &error); if (connection == NULL) { DEBUG ("Failed to create TpConnection: %s", error->message); g_error_free (error); return; } if (self->priv->channel_factory != NULL) channel = tp_client_channel_factory_create_channel ( self->priv->channel_factory, connection, chan_path, chan_props, &error); else channel = tp_simple_client_factory_ensure_channel (tp_proxy_get_factory (self), connection, chan_path, chan_props, &error); if (channel == NULL) { DEBUG ("Failed to create TpChannel: %s", error->message); g_error_free (error); g_object_unref (connection); return; } g_signal_emit (self, signals[SIGNAL_SUCCEEDED_WITH_CHANNEL], 0, connection, channel); self->priv->succeeded_with_chan_fired = TRUE; g_object_unref (connection); g_object_unref (channel); } static void tp_channel_request_constructed (GObject *object) { TpChannelRequest *self = TP_CHANNEL_REQUEST (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_channel_request_parent_class)->constructed; GError *error = NULL; TpProxySignalConnection *sc; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); _tp_proxy_ensure_factory (self, NULL); sc = tp_cli_channel_request_connect_to_failed (self, tp_channel_request_failed_cb, NULL, NULL, NULL, &error); if (sc == NULL) { CRITICAL ("Couldn't connect to Failed: %s", error->message); g_error_free (error); g_assert_not_reached (); return; } sc = tp_cli_channel_request_connect_to_succeeded (self, tp_channel_request_succeeded_cb, NULL, NULL, NULL, &error); if (sc == NULL) { CRITICAL ("Couldn't connect to Succeeded: %s", error->message); g_error_free (error); g_assert_not_reached (); return; } sc = tp_cli_channel_request_connect_to_succeeded_with_channel (self, tp_channel_request_succeeded_with_channel_cb, NULL, NULL, NULL, &error); if (sc == NULL) { DEBUG ("Couldn't connect to SucceededWithChannel: %s", error->message); g_error_free (error); return; } } static void tp_channel_request_dispose (GObject *object) { TpChannelRequest *self = TP_CHANNEL_REQUEST (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_channel_request_parent_class)->dispose; tp_clear_pointer (&self->priv->immutable_properties, g_hash_table_unref); tp_clear_object (&self->priv->channel_factory); tp_clear_object (&self->priv->account); if (dispose != NULL) dispose (object); } static void tp_channel_request_class_init (TpChannelRequestClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpChannelRequestPrivate)); object_class->set_property = tp_channel_request_set_property; object_class->get_property = tp_channel_request_get_property; object_class->constructed = tp_channel_request_constructed; object_class->dispose = tp_channel_request_dispose; proxy_class->interface = TP_IFACE_QUARK_CHANNEL_REQUEST; tp_channel_request_init_known_interfaces (); proxy_class->must_have_unique_name = TRUE; /** * TpChannelRequest:channel-factory: * * The object implementing the #TpClientChannelFactoryInterface interface * that will be used to create channel proxies when the * #TpChannelRequest::succeeded-with-channel signal is fired. * This property can be changed using * tp_channel_request_set_channel_factory(). * * If no channel factory is specified then #TpAutomaticProxyFactory is used. * * Since: 0.13.14 * Deprecated: since 0.15.5. Use #TpProxy:factory instead. */ param_spec = g_param_spec_object ("channel-factory", "Channel factory", "Object implementing TpClientChannelFactoryInterface", G_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_FACTORY, param_spec); /** * TpChannelRequest:immutable-properties: * * The immutable D-Bus properties of this channel request, represented by a * #GHashTable where the keys are D-Bus interface name + "." + property * name, and the values are #GValue instances. * * Note that this property is set only if the immutable properties have been * set during the construction of the #TpChannelRequest. * * Read-only except during construction. * * Since: 0.13.14 */ param_spec = g_param_spec_boxed ("immutable-properties", "Immutable D-Bus properties", "A map D-Bus interface + \".\" + property name => GValue", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IMMUTABLE_PROPERTIES, param_spec); /** * TpChannelRequest:immutable-properties-vardict: * * The immutable D-Bus properties of this channel request, represented by a * %G_VARIANT_TYPE_VARDICT where the keys are * D-Bus interface name + "." + property name. * * Note that this property is set only if the immutable properties have been * set during the construction of the #TpChannelRequest. * * Read-only except during construction. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("immutable-properties-vardict", "Immutable D-Bus properties", "A map D-Bus interface + \".\" + property name => variant", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IMMUTABLE_PROPERTIES_VARDICT, param_spec); /** * TpChannelRequest:account: * * The #TpAccount on which this request was made, not guaranteed * to be prepared. * * Read-only. * * Since: 0.15.3 */ param_spec = g_param_spec_object ("account", "Account", "Account", TP_TYPE_ACCOUNT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpChannelRequest:user-action-time: * * The time at which user action occurred, or * #TP_USER_ACTION_TIME_NOT_USER_ACTION if this channel request is * for some reason not involving user action. * * Read-only. * * Since: 0.15.3 */ param_spec = g_param_spec_int64 ("user-action-time", "UserActionTime", "UserActionTime", 0, G_MAXINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, param_spec); /** * TpChannelRequest:preferred-handler: * * Either the well-known bus name (starting with #TP_CLIENT_BUS_NAME_BASE) * of the preferred handler for this channel request, * or %NULL to indicate that any handler would be acceptable. * * Read-only. * * Since: 0.15.3 */ param_spec = g_param_spec_string ("preferred-handler", "PreferredHandler", "PreferredHandler", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PREFERRED_HANDLER, param_spec); /** * TpChannelRequest:hints: * * A #TP_HASH_TYPE_STRING_VARIANT_MAP of metadata provided by * the channel requester; or %NULL if #TpChannelRequest:immutable-properties * is not defined or if no hints has been defined. * * Read-only. * * Since: 0.13.14 */ param_spec = g_param_spec_boxed ("hints", "Hints", "Hints", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HINTS, param_spec); /** * TpChannelRequest:hints-vardict: * * A %G_VARIANT_TYPE_VARDICT of metadata provided by * the channel requester; or %NULL if #TpChannelRequest:immutable-properties * is not defined or if no hints have been defined. * * Read-only. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("hints-vardict", "Hints", "Hints", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HINTS_VARDICT, param_spec); /** * TpChannelRequest::succeeded: * @self: the channel request proxy * * Emitted when the channel request succeeds. * * Deprecated: since 0.13.14. Use * #TpChannelRequest::succeeded-with-channel, which provides the resulting * channel, instead. */ signals[SIGNAL_SUCCEEDED] = g_signal_new ("succeeded", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpChannelRequest::succeeded-with-channel: * @self: the channel request proxy * @connection: the #TpConnection of @channel, or %NULL * @channel: the #TpChannel created, or %NULL * * Emitted when the channel request succeeds. * * With telepathy-mission-control version 5.7.1 and earlier, @connection and * @channel will be %NULL. When using newer versions, they will be correctly * set to the newly-created channel, and the connection which owns it. * * The #TpChannel is created using #TpChannelRequest:channel-factory or * #TpProxy:factory but the features of the factory are NOT prepared. * It's up to the user to prepare the features returned by * tp_simple_client_factory_dup_channel_features() himself. * * Since: 0.13.14 */ signals[SIGNAL_SUCCEEDED_WITH_CHANNEL] = g_signal_new ( "succeeded-with-channel", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_TYPE_CONNECTION, TP_TYPE_CHANNEL); } /** * tp_channel_request_init_known_interfaces: * * Ensure that the known interfaces for TpChannelRequest have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CHANNEL_REQUEST. * * Since: 0.7.32 */ void tp_channel_request_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CHANNEL_REQUEST; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_channel_request_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_channel_request_new: * @bus_daemon: Proxy for the D-Bus daemon * @object_path: The non-NULL object path of this channel request * @immutable_properties: As many as are known of the immutable D-Bus * properties of this channel request, or %NULL if none are known * @error: Used to raise an error if %NULL is returned * * Convenience function to create a new channel request proxy. * * If the channel request was newly created, the client making the request * is responsible for calling tp_cli_channel_request_call_proceed() when it * is ready for the channel request to proceed. * * Returns: a new reference to an channel request proxy, or %NULL if * @object_path is not syntactically valid or the channel dispatcher is * not running * Deprecated: Since 0.19.9. New code should get #TpChannelRequest objects * from a #TpBaseClient */ TpChannelRequest * tp_channel_request_new (TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) { return _tp_channel_request_new_with_factory (NULL, bus_daemon, object_path, immutable_properties, error); } TpChannelRequest * _tp_channel_request_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelRequest *self; gchar *unique_name; g_return_val_if_fail (bus_daemon != NULL, NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; if (!_tp_dbus_daemon_get_name_owner (bus_daemon, -1, TP_CHANNEL_DISPATCHER_BUS_NAME, &unique_name, error)) return NULL; self = TP_CHANNEL_REQUEST (g_object_new (TP_TYPE_CHANNEL_REQUEST, "dbus-daemon", bus_daemon, "dbus-connection", ((TpProxy *) bus_daemon)->dbus_connection, "bus-name", unique_name, "object-path", object_path, "immutable-properties", immutable_properties, "factory", factory, NULL)); g_free (unique_name); return self; } /** * tp_channel_request_set_channel_factory: * @self: a #TpChannelRequest * @factory: an object implementing the #TpClientChannelFactoryInterface * interface * * Change the value of the #TpChannelRequest:channel-factory property. * * Since: 0.13.14 * Deprecated: since 0.15.5. Use #TpProxy:factory instead. */ void tp_channel_request_set_channel_factory (TpChannelRequest *self, TpClientChannelFactory *factory) { _tp_channel_request_set_channel_factory (self, factory); } void _tp_channel_request_set_channel_factory (TpChannelRequest *self, TpClientChannelFactory *factory) { tp_clear_object (&self->priv->channel_factory); if (factory != NULL) self->priv->channel_factory = g_object_ref (factory); g_object_notify (G_OBJECT (self), "channel-factory"); } /** * tp_channel_request_get_immutable_properties: * @self: a #TpChannelRequest * * Return the #TpChannelRequest:immutable-properties construct-only property * * Returns: (transfer none): the value of * #TpChannelRequest:immutable-properties * * Since: 0.13.14 */ const GHashTable * tp_channel_request_get_immutable_properties (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); return self->priv->immutable_properties; } /** * tp_channel_request_dup_immutable_properties: * @self: a #TpChannelRequest * * Return the #TpChannelRequest:immutable-properties-vardict property. * * Returns: (transfer full): the value of * #TpChannelRequest:immutable-properties-vardict * * Since: 0.19.10 */ GVariant * tp_channel_request_dup_immutable_properties (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); if (self->priv->immutable_properties == NULL) return NULL; return _tp_asv_to_vardict (self->priv->immutable_properties); } void _tp_channel_request_ensure_immutable_properties (TpChannelRequest *self, GHashTable *immutable_properties) { if (self->priv->immutable_properties == NULL && immutable_properties != NULL) { self->priv->immutable_properties = g_hash_table_ref (immutable_properties); g_object_notify ((GObject *) self, "immutable-properties"); } } /** * tp_channel_request_get_account: * @self: a #tpchannelrequest * * Return the value of the #TpChannelRequest:account construct-only property * * returns: (transfer none): the value of #TpChannelRequest:account * * since: 0.15.3 */ TpAccount * tp_channel_request_get_account (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); /* lazily initialize self->priv->account */ if (self->priv->account == NULL) { const gchar *path; if (self->priv->immutable_properties == NULL) return NULL; path = tp_asv_get_object_path (self->priv->immutable_properties, TP_PROP_CHANNEL_REQUEST_ACCOUNT); if (path == NULL) return NULL; self->priv->account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, NULL); } return self->priv->account; } /** * tp_channel_request_get_user_action_time: * @self: a #tpchannelrequest * * return the #TpChannelRequest:user-action-time construct-only property * * returns: the value of #TpChannelRequest:user-action-time * * since: 0.15.3 */ gint64 tp_channel_request_get_user_action_time (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), 0); if (self->priv->immutable_properties == NULL) return 0; return tp_asv_get_int64 (self->priv->immutable_properties, TP_PROP_CHANNEL_REQUEST_USER_ACTION_TIME, NULL); } /** * tp_channel_request_get_preferred_handler: * @self: a #tpchannelrequest * * return the #TpChannelRequest:preferred-handler construct-only property * * returns: the value of #TpChannelRequest:preferred-handler * * since: 0.15.3 */ const gchar * tp_channel_request_get_preferred_handler (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); if (self->priv->immutable_properties == NULL) return NULL; return tp_asv_get_string (self->priv->immutable_properties, TP_PROP_CHANNEL_REQUEST_PREFERRED_HANDLER); } /** * tp_channel_request_get_hints: * @self: a #TpChannelRequest * * Return the #TpChannelRequest:hints property * * Returns: (transfer none): the value of * #TpChannelRequest:hints * * Since: 0.13.14 */ const GHashTable * tp_channel_request_get_hints (TpChannelRequest *self) { g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); if (self->priv->immutable_properties == NULL) return NULL; return tp_asv_get_boxed (self->priv->immutable_properties, TP_PROP_CHANNEL_REQUEST_HINTS, TP_HASH_TYPE_STRING_VARIANT_MAP); } /** * tp_channel_request_dup_hints: * @self: a #TpChannelRequest * * Return the #TpChannelRequest:hints-vardict property * * Returns: (transfer full): the value of #TpChannelRequest:hints-vardict * * Since: 0.19.10 */ GVariant * tp_channel_request_dup_hints (TpChannelRequest *self) { const GHashTable *hints; g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL); hints = tp_channel_request_get_hints (self); if (hints == NULL) return NULL; return _tp_asv_to_vardict (hints); } telepathy-glib-0.24.2/telepathy-glib/channel-request.h0000644000175000017500000000740412652510705017623 00000000000000/* * channel-request.h - proxy for a request to the channel dispatcher * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_CHANNEL_REQUEST_H #define TP_CHANNEL_REQUEST_H #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpChannelRequest TpChannelRequest; typedef struct _TpChannelRequestClass TpChannelRequestClass; typedef struct _TpChannelRequestPrivate TpChannelRequestPrivate; typedef struct _TpChannelRequestClassPrivate TpChannelRequestClassPrivate; struct _TpChannelRequest { /**/ TpProxy parent; TpChannelRequestPrivate *priv; }; struct _TpChannelRequestClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpChannelRequestClassPrivate *priv; }; GType tp_channel_request_get_type (void); #define TP_TYPE_CHANNEL_REQUEST \ (tp_channel_request_get_type ()) #define TP_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CHANNEL_REQUEST, \ TpChannelRequest)) #define TP_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CHANNEL_REQUEST, \ TpChannelRequestClass)) #define TP_IS_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CHANNEL_REQUEST)) #define TP_IS_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CHANNEL_REQUEST)) #define TP_CHANNEL_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL_REQUEST, \ TpChannelRequestClass)) #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 TpChannelRequest *tp_channel_request_new (TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) G_GNUC_WARN_UNUSED_RESULT; #endif void tp_channel_request_init_known_interfaces (void); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16 void tp_channel_request_set_channel_factory (TpChannelRequest *self, TpClientChannelFactory *factory); #endif const GHashTable * tp_channel_request_get_immutable_properties ( TpChannelRequest *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_channel_request_dup_immutable_properties (TpChannelRequest *self); TpAccount * tp_channel_request_get_account (TpChannelRequest *self); gint64 tp_channel_request_get_user_action_time (TpChannelRequest *self); const gchar * tp_channel_request_get_preferred_handler (TpChannelRequest *self); const GHashTable * tp_channel_request_get_hints (TpChannelRequest *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_channel_request_dup_hints (TpChannelRequest *self); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/tls-cert.xml0000644000175000017500000000036312652510705016630 00000000000000 TLSCertificate telepathy-glib-0.24.2/telepathy-glib/debug-sender.c0000644000175000017500000004232614004031760017056 00000000000000/* * debug-sender.c - Telepathy debug interface implementation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "debug-sender.h" #include #include #include #include #include #include /** * SECTION:debug-sender * @title: TpDebugSender * @short_description: object for exposing Telepathy debug interface * * A #TpDebugSender object is an object exposing the Telepathy debug interface. * There should be one object per process as it registers the object path * /org/freedesktop/Telepathy/debug. Once the object exists and has the object * path, messages can be passed to it using tp_debug_sender_add_message and * signals will automatically be fired. * * #TpDebugSender is primarily designed for use in Connection Managers, but can * be used by any other part of the Telepathy stack which wants to expose its * debugging information over the debug interface. * * In a Connection Manager, one would probably keep a ref to the #TpDebugSender * in the connection manager object, and when this said object is finalized, so * is the process's #TpDebugSender. A GLib log handler is also provided: * tp_debug_sender_log_handler(). * * Since: 0.7.36 */ /** * TpDebugSenderClass: * * The class of a #TpDebugSender. * * Since: 0.7.36 */ /** * TpDebugSender: * * An object for exposing the Telepathy debug interface. * * Since: 0.7.36 */ static gpointer debug_sender = NULL; /* On the basis that messages are around 60 bytes on average, and that 50kb is * a reasonable maximum size for a frame buffer. */ #define DEBUG_MESSAGE_LIMIT 800 static void debug_iface_init (gpointer g_iface, gpointer iface_data); struct _TpDebugSenderPrivate { gboolean enabled; gboolean timestamps; GQueue *messages; GMutex messages_lock; }; typedef struct { gdouble timestamp; gchar *domain; TpDebugLevel level; gchar *string; } DebugMessage; G_DEFINE_TYPE_WITH_CODE (TpDebugSender, tp_debug_sender, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DEBUG, debug_iface_init)) /* properties */ enum { PROP_ENABLED = 1, NUM_PROPERTIES }; /* must be thread-safe */ static TpDebugLevel log_level_flags_to_debug_level (GLogLevelFlags level) { if (level & G_LOG_LEVEL_ERROR) return TP_DEBUG_LEVEL_ERROR; else if (level & G_LOG_LEVEL_CRITICAL) return TP_DEBUG_LEVEL_CRITICAL; else if (level & G_LOG_LEVEL_WARNING) return TP_DEBUG_LEVEL_WARNING; else if (level & G_LOG_LEVEL_MESSAGE) return TP_DEBUG_LEVEL_MESSAGE; else if (level & G_LOG_LEVEL_INFO) return TP_DEBUG_LEVEL_INFO; else if (level & G_LOG_LEVEL_DEBUG) return TP_DEBUG_LEVEL_DEBUG; else /* Fall back to DEBUG if all else fails */ return TP_DEBUG_LEVEL_DEBUG; } /* must be thread-safe */ static DebugMessage * debug_message_new (GTimeVal *timestamp, const gchar *domain, GLogLevelFlags level, const gchar *string) { DebugMessage *msg; msg = g_slice_new0 (DebugMessage); msg->timestamp = timestamp->tv_sec + timestamp->tv_usec / 1e6; msg->domain = g_strdup (domain); msg->level = log_level_flags_to_debug_level (level); msg->string = g_strdup (string); return msg; } static void debug_message_free (DebugMessage *msg) { g_free (msg->domain); g_free (msg->string); g_slice_free (DebugMessage, msg); } static void tp_debug_sender_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpDebugSender *self = TP_DEBUG_SENDER (object); switch (property_id) { case PROP_ENABLED: g_value_set_boolean (value, self->priv->enabled); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void tp_debug_sender_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpDebugSender *self = TP_DEBUG_SENDER (object); switch (property_id) { case PROP_ENABLED: self->priv->enabled = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void tp_debug_sender_finalize (GObject *object) { TpDebugSender *self = TP_DEBUG_SENDER (object); g_mutex_lock (&self->priv->messages_lock); g_queue_foreach (self->priv->messages, (GFunc) debug_message_free, NULL); g_mutex_unlock (&self->priv->messages_lock); g_queue_free (self->priv->messages); self->priv->messages = NULL; G_OBJECT_CLASS (tp_debug_sender_parent_class)->finalize (object); } static GObject * tp_debug_sender_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) { GObject *retval; if (debug_sender == NULL) { retval = G_OBJECT_CLASS (tp_debug_sender_parent_class)->constructor ( type, n_construct_params, construct_params); debug_sender = retval; g_object_add_weak_pointer (retval, &debug_sender); } else { retval = g_object_ref (G_OBJECT (debug_sender)); } return retval; } static void tp_debug_sender_constructed (GObject *object) { TpDBusDaemon *dbus_daemon; dbus_daemon = tp_dbus_daemon_dup (NULL); if (dbus_daemon != NULL) { tp_dbus_daemon_register_object (dbus_daemon, TP_DEBUG_OBJECT_PATH, debug_sender); g_object_unref (dbus_daemon); } } static void tp_debug_sender_class_init (TpDebugSenderClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); static TpDBusPropertiesMixinPropImpl debug_props[] = { { "Enabled", "enabled", "enabled" }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_DEBUG, tp_dbus_properties_mixin_getter_gobject_properties, tp_dbus_properties_mixin_setter_gobject_properties, debug_props, }, { NULL } }; g_type_class_add_private (klass, sizeof (TpDebugSenderPrivate)); object_class->get_property = tp_debug_sender_get_property; object_class->set_property = tp_debug_sender_set_property; object_class->finalize = tp_debug_sender_finalize; object_class->constructor = tp_debug_sender_constructor; object_class->constructed = tp_debug_sender_constructed; /** * TpDebugSender:enabled: * * %TRUE if the NewDebugMessage signal should be emitted when a new debug * message is generated. */ g_object_class_install_property (object_class, PROP_ENABLED, g_param_spec_boolean ("enabled", "Enabled?", "True if the new-debug-message signal is enabled.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpDebugSenderClass, dbus_props_class)); } static void get_messages (TpSvcDebug *self, DBusGMethodInvocation *context) { TpDebugSender *dbg = TP_DEBUG_SENDER (self); GPtrArray *messages; GList *i; guint j; g_mutex_lock (&dbg->priv->messages_lock); messages = g_ptr_array_sized_new (g_queue_get_length (dbg->priv->messages)); for (i = dbg->priv->messages->head; i; i = i->next) { GValue gvalue = { 0 }; DebugMessage *message = (DebugMessage *) i->data; g_value_init (&gvalue, TP_STRUCT_TYPE_DEBUG_MESSAGE); g_value_take_boxed (&gvalue, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_DEBUG_MESSAGE)); dbus_g_type_struct_set (&gvalue, 0, message->timestamp, 1, message->domain, 2, message->level, 3, message->string, G_MAXUINT); g_ptr_array_add (messages, g_value_get_boxed (&gvalue)); } g_mutex_unlock (&dbg->priv->messages_lock); tp_svc_debug_return_from_get_messages (context, messages); for (j = 0; j < messages->len; j++) g_boxed_free (TP_STRUCT_TYPE_DEBUG_MESSAGE, messages->pdata[j]); g_ptr_array_unref (messages); } static void debug_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcDebugClass *klass = (TpSvcDebugClass *) g_iface; tp_svc_debug_implement_get_messages (klass, get_messages); } static void tp_debug_sender_init (TpDebugSender *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_DEBUG_SENDER, TpDebugSenderPrivate); self->priv->messages = g_queue_new (); } /** * tp_debug_sender_dup: * * Returns a #TpDebugSender instance on the bus this process was activated by * (if it was launched by D-Bus service activation), or the session bus * (otherwise). * * The returned #TpDebugSender is cached; the same #TpDebugSender object will * be returned by this function repeatedly, as long as at least one reference * exists. * * Returns: a reference to the #TpDebugSender instance for the current starter * bus daemon * * Since: 0.7.36 */ TpDebugSender * tp_debug_sender_dup (void) { return g_object_new (TP_TYPE_DEBUG_SENDER, NULL); } static void _tp_debug_sender_take (TpDebugSender *self, DebugMessage *new_msg) { #ifdef ENABLE_DEBUG_CACHE g_mutex_lock (&self->priv->messages_lock); if (g_queue_get_length (self->priv->messages) >= DEBUG_MESSAGE_LIMIT) { DebugMessage *old_head = (DebugMessage *) g_queue_pop_head (self->priv->messages); debug_message_free (old_head); } g_queue_push_tail (self->priv->messages, new_msg); g_mutex_unlock (&self->priv->messages_lock); #endif if (self->priv->enabled) { tp_svc_debug_emit_new_debug_message (self, new_msg->timestamp, new_msg->domain, new_msg->level, new_msg->string); } #ifndef ENABLE_DEBUG_CACHE /* if there's cache, these are freed when they fall of its end instead */ debug_message_free (new_msg); #endif } /** * tp_debug_sender_add_message: * @self: A #TpDebugSender instance * @timestamp: Time of the message or %NULL for right now * @domain: Message domain * @level: The message level * @string: The message string itself * * Adds a new message to the debug sender message queue. If the * #TpDebugSender:enabled property is set to %TRUE, then a NewDebugMessage * signal will be fired too. * * Since: 0.7.36 */ void tp_debug_sender_add_message (TpDebugSender *self, GTimeVal *timestamp, const gchar *domain, GLogLevelFlags level, const gchar *string) { GTimeVal now = { 0 }; if (timestamp == NULL) { g_get_current_time (&now); timestamp = &now; } _tp_debug_sender_take (self, debug_message_new (timestamp, domain, level, string)); } /** * tp_debug_sender_add_message_vprintf: * @self: A #TpDebugSender instance * @timestamp: Time of the message, or %NULL for right now * @formatted: Place to store the formatted message, or %NULL if not needed * @domain: Message domain * @level: The message level * @format: The printf() format string * @args: the #va_list of parameters to insert into @format * * Formats and adds a new message to the debug sender message queue. If the * #TpDebugSender:enabled property is set to %TRUE, then a NewDebugMessage * signal will be fired too. * * Since: 0.13.13 */ void tp_debug_sender_add_message_vprintf (TpDebugSender *self, GTimeVal *timestamp, gchar **formatted, const gchar *domain, GLogLevelFlags level, const gchar *format, va_list args) { gchar *message = NULL; /* disabled cache? we might have no need to format the message at all */ #ifndef ENABLE_DEBUG_CACHE if (!self->priv->enabled && formatted == NULL) return; #endif message = g_strdup_vprintf (format, args); tp_debug_sender_add_message (self, timestamp, domain, level, message); /* if the caller didn't want a copy, we're done with the message: */ if (formatted != NULL) *formatted = message; else g_free (message); } /** * tp_debug_sender_add_message_printf: * @self: A #TpDebugSender instance * @timestamp: Time of the message, or %NULL for right now * @formatted: Place to store the formatted message, or %NULL if not required * @domain: Message domain * @level: The message level * @format: The printf() format string * @...: The parameters to insert into @format * * Formats and adds a new message to the debug sender message queue. If the * #TpDebugSender:enabled property is set to %TRUE, then a NewDebugMessage * signal will be fired too. * * Since: 0.13.13 */ void tp_debug_sender_add_message_printf (TpDebugSender *self, GTimeVal *timestamp, gchar **formatted, const gchar *domain, GLogLevelFlags level, const gchar *format, ...) { va_list args; va_start (args, format); tp_debug_sender_add_message_vprintf (self, timestamp, formatted, domain, level, format, args); va_end (args); } static gboolean tp_debug_sender_idle (gpointer data) { if (debug_sender == NULL) debug_message_free (data); else _tp_debug_sender_take (debug_sender, data); return FALSE; } /** * tp_debug_sender_log_handler: * @log_domain: domain of the message * @log_level: log leve of the message * @message: the message itself * @exclude: a log domain string to exclude from the #TpDebugSender, or %NULL * * A generic log handler designed to be used by CMs. It initially calls * g_log_default_handler(), and then sends the message on the bus * #TpDebugSender. * * The @exclude parameter is designed to allow filtering one domain, instead of * sending every message to the #TpDebugSender: typical usage is for a * process to filter out messages from its own %G_LOG_DOMAIN, so that it can * append a category to its own messages and pass them directly to * tp_debug_sender_add_message. Note that every message, regardless of * domain, is given to g_log_default_handler(). * * Note that a ref to a #TpDebugSender must be kept at all times otherwise * no messages given to the handler will be sent to the Telepathy debug * interface. * * An example of its usage, taking in mind the notes above, follows: * |[ * /* Create a main loop and debug sender */ * GMainLoop *loop = g_main_loop_new (NULL, FALSE); * TpDebugSender *sender = tp_debug_sender_dup (); * * /* Set the default handler */ * g_log_set_default_handler (tp_debug_sender_log_handler, G_LOG_DOMAIN); * * /* Run the main loop, but keeping a ref on the TpDebugSender from * * the beginning of this code sample. */ * g_main_loop_run (loop); * * /* g_main_loop_quit was called, so only now can we clean up the * * TpDebugSender. */ * g_object_unref (sender); * ]| * * (In a connection manager, replace g_main_loop_run() in the above example * with tp_run_connection_manager().) * * This function is merely for convenience if it meets the requirements. * It can easily be re-implemented in services, and does not need to be * used. * * If timestamps should be prepended to messages (like in * tp_debug_timestamped_log_handler()), tp_debug_sender_set_timestamps() * should also be called. * * Since version 0.11.15, this function can be called from any thread. * * Since: 0.7.36 */ void tp_debug_sender_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer exclude) { GTimeVal now = { 0, 0 }; if (debug_sender != NULL && ((TpDebugSender *) debug_sender)->priv->timestamps) { gchar *now_str, *tmp; g_get_current_time (&now); now_str = g_time_val_to_iso8601 (&now); tmp = g_strdup_printf ("%s: %s", now_str, message); g_log_default_handler (log_domain, log_level, tmp, NULL); g_free (now_str); g_free (tmp); } else { g_log_default_handler (log_domain, log_level, message, NULL); } if (exclude == NULL || tp_strdiff (log_domain, exclude)) { if (now.tv_sec == 0) g_get_current_time (&now); g_idle_add_full (G_PRIORITY_HIGH, tp_debug_sender_idle, debug_message_new (&now, log_domain, log_level, message), NULL); } } /** * tp_debug_sender_set_timestamps: * @self: a #TpDebugSender * @maybe: whether to display message timestamps * * If the log handler is tp_debug_sender_log_handler() then calling * this function with %TRUE on the debug sender will prepend the * message to be printed to stdout with the UTC time (currently in ISO * 8601 format, with microsecond resolution). This is equivalent to * using tp_debug_timestamped_log_handler() as the log handler, but * also logging to the debug sender. * * Since: 0.15.5 */ void tp_debug_sender_set_timestamps (TpDebugSender *self, gboolean maybe) { g_return_if_fail (TP_IS_DEBUG_SENDER (self)); self->priv->timestamps = maybe; } telepathy-glib-0.24.2/telepathy-glib/debug-sender.h0000644000175000017500000000635712652510705017077 00000000000000/* * debug-sender.h - header for Telepathy debug interface implementation * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DEBUG_SENDER_H__ #define __TP_DEBUG_SENDER_H__ #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpDebugSender TpDebugSender; typedef struct _TpDebugSenderClass TpDebugSenderClass; typedef struct _TpDebugSenderPrivate TpDebugSenderPrivate; #define TP_TYPE_DEBUG_SENDER tp_debug_sender_get_type() #define TP_DEBUG_SENDER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_DEBUG_SENDER, TpDebugSender)) #define TP_DEBUG_SENDER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_DEBUG_SENDER, TpDebugSenderClass)) #define TP_IS_DEBUG_SENDER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_DEBUG_SENDER)) #define TP_IS_DEBUG_SENDER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_DEBUG_SENDER)) #define TP_DEBUG_SENDER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DEBUG_SENDER, TpDebugSenderClass)) struct _TpDebugSender { /**/ GObject parent; TpDebugSenderPrivate *priv; }; struct _TpDebugSenderClass { /**/ GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; GCallback _padding[7]; gpointer priv; }; GType tp_debug_sender_get_type (void); TpDebugSender *tp_debug_sender_dup (void) G_GNUC_WARN_UNUSED_RESULT; void tp_debug_sender_add_message (TpDebugSender *self, GTimeVal *timestamp, const gchar *domain, GLogLevelFlags level, const gchar *string); void tp_debug_sender_add_message_vprintf (TpDebugSender *self, GTimeVal *timestamp, gchar **formatted, const gchar *domain, GLogLevelFlags level, const gchar *format, va_list args); void tp_debug_sender_add_message_printf (TpDebugSender *self, GTimeVal *timestamp, gchar **formatted, const gchar *domain, GLogLevelFlags level, const gchar *format, ...); void tp_debug_sender_log_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer exclude); _TP_AVAILABLE_IN_0_16 void tp_debug_sender_set_timestamps (TpDebugSender *self, gboolean maybe); G_END_DECLS #endif /* __TP_DEBUG_SENDER_H__ */ telepathy-glib-0.24.2/telepathy-glib/base-protocol.c0000644000175000017500000016204512652510705017274 00000000000000/* TpBaseProtocol * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PARAMS #include "telepathy-glib/debug-internal.h" /** * TpCMParamSpec: * @name: Name as passed over D-Bus * @dtype: D-Bus type signature. We currently support 16- and 32-bit integers * (@gtype is INT), 16- and 32-bit unsigned integers (gtype is UINT), * strings (gtype is STRING) and booleans (gtype is BOOLEAN). * @gtype: GLib type, derived from @dtype as above * @flags: Some combination of #TpConnMgrParamFlags * @def: Default value, as a (const gchar *) for string parameters, or using #GINT_TO_POINTER or #GUINT_TO_POINTER for integer parameters * @offset: Offset of the parameter in the opaque data structure, if * appropriate. The member at that offset is expected to be a gint, * guint, (gchar *) or gboolean, depending on @gtype. The default * parameter setter, #tp_cm_param_setter_offset, uses this field. * @filter: A callback which is used to validate or normalize the user-provided * value before it is written into the opaque data structure * @filter_data: Arbitrary opaque data intended for use by the filter function * @setter_data: Arbitrary opaque data intended for use by the setter function * instead of or in addition to @offset. * * Structure representing a connection manager parameter, as accepted by * RequestConnection. * * In addition to the fields documented here, there is one gpointer field * which must currently be %NULL. A meaning may be defined for it in a * future version of telepathy-glib. */ /** * TpCMParamFilter: * @paramspec: The parameter specification. The filter is likely to use * name (for the error message if the value is invalid) and filter_data. * @value: The value for that parameter provided by the user. * May be changed to contain a different value of the same type, if * some sort of normalization is required * @error: Used to raise %TP_ERROR_INVALID_ARGUMENT if the given value is * rejected * * Signature of a callback used to validate and/or normalize user-provided * CM parameter values. * * Returns: %TRUE to accept, %FALSE (with @error set) to reject */ /** * TpCMParamSetter: * @paramspec: The parameter specification. The setter is likely to use * some combination of the name, offset and setter_data fields. * @value: The value for that parameter provided by the user. * @params: An opaque data structure, created by * #TpCMProtocolSpec.params_new. * * The signature of a callback used to set a parameter within the opaque * data structure used for a protocol. * * Since: 0.7.0 */ static GValue * param_default_value (const TpCMParamSpec *param) { GValue *value; value = tp_g_value_slice_new (param->gtype); /* If HAS_DEFAULT is false, we don't really care what the value is, so we'll * just use whatever's in the user-supplied param spec. As long as we're * careful to accept NULL, that should be fine. */ switch (param->dtype[0]) { case DBUS_TYPE_STRING: g_assert (param->gtype == G_TYPE_STRING); if (param->def == NULL) g_value_set_static_string (value, ""); else g_value_set_static_string (value, param->def); break; case DBUS_TYPE_INT16: case DBUS_TYPE_INT32: g_assert (param->gtype == G_TYPE_INT); g_value_set_int (value, GPOINTER_TO_INT (param->def)); break; case DBUS_TYPE_UINT16: case DBUS_TYPE_UINT32: g_assert (param->gtype == G_TYPE_UINT); g_value_set_uint (value, GPOINTER_TO_UINT (param->def)); break; case DBUS_TYPE_UINT64: g_assert (param->gtype == G_TYPE_UINT64); g_value_set_uint64 (value, param->def == NULL ? 0 : *(const guint64 *) param->def); break; case DBUS_TYPE_INT64: g_assert (param->gtype == G_TYPE_INT64); g_value_set_int64 (value, param->def == NULL ? 0 : *(const gint64 *) param->def); break; case DBUS_TYPE_DOUBLE: g_assert (param->gtype == G_TYPE_DOUBLE); g_value_set_double (value, param->def == NULL ? 0.0 : *(const double *) param->def); break; case DBUS_TYPE_OBJECT_PATH: g_assert (param->gtype == DBUS_TYPE_G_OBJECT_PATH); g_value_set_static_boxed (value, param->def == NULL ? "/" : param->def); break; case DBUS_TYPE_ARRAY: switch (param->dtype[1]) { case DBUS_TYPE_STRING: g_assert (param->gtype == G_TYPE_STRV); g_value_set_static_boxed (value, param->def); break; case DBUS_TYPE_BYTE: g_assert (param->gtype == DBUS_TYPE_G_UCHAR_ARRAY); if (param->def == NULL) { GArray *array = g_array_new (FALSE, FALSE, sizeof (guint8)); g_value_take_boxed (value, array); } else { g_value_set_static_boxed (value, param->def); } break; default: ERROR ("encountered unknown type %s on argument %s", param->dtype, param->name); } break; case DBUS_TYPE_BOOLEAN: g_assert (param->gtype == G_TYPE_BOOLEAN); g_value_set_boolean (value, GPOINTER_TO_INT (param->def)); break; default: ERROR ("encountered unknown type %s on argument %s", param->dtype, param->name); } return value; } GValueArray * _tp_cm_param_spec_to_dbus (const TpCMParamSpec *paramspec) { GValueArray *susv; GValue *value = param_default_value (paramspec); susv = tp_value_array_build (4, G_TYPE_STRING, paramspec->name, G_TYPE_UINT, paramspec->flags, G_TYPE_STRING, paramspec->dtype, G_TYPE_VALUE, value, G_TYPE_INVALID); tp_g_value_slice_free (value); return susv; } /** * tp_cm_param_filter_uint_nonzero: * @paramspec: The parameter specification for a guint parameter * @value: A GValue containing a guint, which will not be altered * @error: Used to return an error if the guint is 0 * * A #TpCMParamFilter which rejects zero, useful for server port numbers. * * Returns: %TRUE to accept, %FALSE (with @error set) to reject */ gboolean tp_cm_param_filter_uint_nonzero (const TpCMParamSpec *paramspec, GValue *value, GError **error) { if (g_value_get_uint (value) == 0) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account parameter '%s' may not be set to zero", paramspec->name); return FALSE; } return TRUE; } /** * tp_cm_param_filter_string_nonempty: * @paramspec: The parameter specification for a string parameter * @value: A GValue containing a string, which will not be altered * @error: Used to return an error if the string is empty * * A #TpCMParamFilter which rejects empty strings. * * Returns: %TRUE to accept, %FALSE (with @error set) to reject */ gboolean tp_cm_param_filter_string_nonempty (const TpCMParamSpec *paramspec, GValue *value, GError **error) { const gchar *str = g_value_get_string (value); if (str == NULL || str[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account parameter '%s' may not be set to an empty string", paramspec->name); return FALSE; } return TRUE; } /** * SECTION:base-protocol * @title: TpBaseProtocol * @short_description: base class for #TpSvcProtocol implementations * @see_also: #TpBaseConnectionManager, #TpSvcProtocol * * Base class for Telepathy Protocol objects. * * Since: 0.11.11 */ /** * TpBaseProtocol: * * An object providing static details of the implementation of one real-time * communications protocol. * * Since: 0.11.11 */ /** * TpBaseProtocolGetParametersFunc: * @self: a protocol * * Signature of a virtual method to get the allowed parameters for connections * to a protocol. * * Returns the parameters supported by this protocol, as an array of structs * which must remain valid at least as long as @self exists (it will typically * be a global static array). * * Returns: (transfer none) (array zero-terminated=1): a description of the * parameters supported by this protocol * * Since: 0.11.11 */ /** * TpBaseProtocolNewConnectionFunc: * @self: a protocol * @asv: (transfer none) (element-type utf8 GObject.Value): the parameters * provided via D-Bus * @error: used to return an error if %NULL is returned * * Signature of a virtual method to create a new connection to this protocol. * This is used to implement the RequestConnection D-Bus method. * * Implementations of #TpBaseProtocolClass.new_connection may assume that * the parameters in @asv conform to the specifications given by * #TpBaseProtocolClass.get_parameters. * * Returns: (transfer full): a new connection, or %NULL on error * * Since: 0.11.11 */ /** * TpBaseProtocolNormalizeContactFunc: * @self: a protocol * @contact: a contact's identifier * @error: used to return an error if %NULL is returned * * Signature of a virtual method to perform best-effort offline normalization * of a contact's identifier. It must either return a newly allocated string * that is the normalized form of @contact, or raise an error and return %NULL. * * Returns: (transfer full): a normalized identifier, or %NULL on error * * Since: 0.11.11 */ /** * TpBaseProtocolIdentifyAccountFunc: * @self: a protocol * @asv: parameters that might be passed to the RequestConnection D-Bus method * @error: used to return an error if %NULL is returned * * Signature of a virtual method to choose a unique name for an account whose * connection parameters are @asv. This will typically return a copy of * the 'account' parameter from @asv, but may do something more complex (for * instance, on IRC it could combine the nickname and the IRC network). * * Implementations of #TpBaseProtocolClass.identify_account may assume that * the parameters in @asv conform to the specifications given by * #TpBaseProtocolClass.get_parameters. * * Returns: (transfer full): a unique name for the account, or %NULL on error * * Since: 0.11.11 */ /** * TpBaseProtocolGetInterfacesFunc: * @self: a protocol * * Signature of a virtual method to get the D-Bus interfaces implemented by * @self, in addition to the Protocol interface. * * If you implement #TpBaseProtocolClass.get_statuses, you should include * %TP_IFACE_PROTOCOL_INTERFACE_PRESENCE in the returned array. * * Returns: (transfer full): a %NULL-terminated array of D-Bus interface names * * Since: 0.11.11 */ /** * TpBaseProtocolGetConnectionDetailsFunc: * @self: a protocol * @connection_interfaces: (out) (transfer full): used to return a * %NULL-terminated array of interfaces which might be implemented on * connections to this protocol * @channel_manager_types: (out) (transfer full) (array zero-terminated=1): * used to return a %G_TYPE_INVALID-terminated array of types that implement * #TpChannelManager, which must include all channel managers that might be * present on connections to this protocol; the channel managers should * all implement #TpChannelManagerIface.type_foreach_channel_class. The * array will be freed with g_free() by the caller. * @icon_name: (out) (transfer full): used to return the name of an icon * for this protocol, such as "im-icq", or an empty string * @english_name: (out) (transfer full): used to return a human-readable * but non-localized name for this protocol, or an empty string * @vcard_field: (out) (transfer full): used to return the name of the vCard * field typically used with this protocol, or an empty string * * Signature of a virtual method to get the D-Bus interfaces implemented by * @self, in addition to the Protocol interface. * * Since: 0.11.11 */ /** * TpBaseProtocolGetAvatarDetailsFunc: * @self: a protocol * @supported_mime_types: (out) (transfer full): used to return a * %NULL-terminated array of supported avatar mime types * @min_height: (out): used to return the minimum height in pixels of an * avatar on this protocol, which may be 0 * @min_width: (out): used to return the minimum width in pixels of an avatar * on this protocol, which may be 0 * @rec_height: (out): used to return the rec height in pixels * of an avatar on this protocol, or 0 if there is no preferred height * @rec_width: (out): used to return the rec width in pixels * of an avatar on this protocol, or 0 if there is no preferred width * @max_height: (out): used to return the maximum height in pixels of an * avatar on this protocol, or 0 if there is no limit * @max_width: (out): used to return the maximum width in pixels of an avatar * on this protocol, or 0 if there is no limit * @max_bytes: (out): used to return the maximum size in bytes of an avatar on * this protocol, or 0 if there is no limit * * Signature of a virtual method to get the supported avatar details for the * protocol implemented by @self. * * Since: 0.13.7 */ /** * TpBaseProtocolGetInterfacesArrayFunc: * @self: a #TpBaseProtocol * * Signature of an implementation of * #TpBaseProtocolClass.get_interfaces_array virtual function. * * Implementation must first chainup on parent class implementation and then * add extra interfaces into the #GPtrArray. * * |[ * static GPtrArray * * my_protocol_get_interfaces_array (TpBaseProtocol *self) * { * GPtrArray *interfaces; * * interfaces = TP_BASE_PROTOCOL_CLASS ( * my_protocol_parent_class)->get_interfaces_array (self); * * g_ptr_array_add (interfaces, TP_IFACE_BADGERS); * * return interfaces; * } * ]| * * Returns: (transfer container): a #GPtrArray of static strings for D-Bus * interfaces implemented by this client. * * Since: 0.19.4 */ /** * TP_TYPE_PROTOCOL_ADDRESSING: * * Interface representing a #TpBaseProtocol that implements * Protocol.Interface.Addressing. * * Since: 0.17.2 */ /** * TpProtocolAddressingInterface: * @parent: the parent interface * @dup_supported_uri_schemes: provides the supported URI schemes. Must always * be implemented. * @dup_supported_vcard_fields: provides the supported vCard fields. Must * always be implemented. * @normalize_vcard_address: protocol-specific implementation for normalizing * vCard addresses. * @normalize_contact_uri: protocol-specific implementation for normalizing contact URIs. * * The interface vtable for a %TP_TYPE_PROTOCOL_ADDRESSING. * * Since: 0.17.2 */ /** * TpBaseProtocolDupSupportedVCardFieldsFunc: * @self: a protocol * * Signature of a virtual method to get the supported vCard fields supported by * #self. * * Returns: (allow-none) (out) (transfer full): a list of vCard fields in lower * case, e.g. [x-sip, tel] * * Since: 0.17.2 */ /** * TpBaseProtocolDupSupportedURISchemesFunc: * @self: a protocol * * Signature of a virtual method to get the supported URI schemes supported by * #self. * * Returns: (allow-none) (out) (transfer full): a list of uri schemes, e.g. [sip, sips, tel] * * Since: 0.17.2 */ /** * TpBaseProtocolNormalizeVCardAddressFunc: * @self: a protocol * @vcard_field: The vCard field of the address to be normalized. * @vcard_address: The address to normalize. * @error: used to return an error if %NULL is returned * * Signature of a virtual method to perform best-effort offline normalization * of a vCard address. It must either return a newly allocated string * that is the normalized form of @vcard_address, or raise an error and * return %NULL. * * Returns: (transfer full): a normalized identifier, or %NULL on error * * Since: 0.17.2 */ /** * TpBaseProtocolNormalizeURIFunc: * @self: a protocol * @uri: The URI to normalize. * @error: used to return an error if %NULL is returned * * Signature of a virtual method to perform best-effort offline normalization * of a URI. It must either return a newly allocated string * that is the normalized form of @uri, or raise an error and return %NULL. * * Returns: (transfer full): a normalized identifier, or %NULL on error * * Since: 0.13.11 */ /** * TpBaseProtocolClass: * @parent_class: the parent class * @dbus_properties_class: a D-Bus properties mixin * @is_stub: if %TRUE, this protocol will not be advertised on D-Bus (for * internal use by #TpBaseConnection) * @get_parameters: a callback used to implement * tp_base_protocol_get_parameters(), which all subclasses must provide; * see the documentation of that method for details * @new_connection: a callback used to implement * tp_base_protocol_new_connection(), which all subclasses must provide; * see the documentation of that method for details * @normalize_contact: a callback used to implement the NormalizeContact * D-Bus method; it must either return a newly allocated string that is the * normalized version of @contact, or raise an error via @error and * return %NULL. If not implemented, %TP_ERROR_NOT_IMPLEMENTED will be raised * instead. * @identify_account: a callback used to implement the IdentifyAccount * D-Bus method; it takes as input a map from strings to #GValues, * and must either return a newly allocated string that represents the * "identity" of the parameters in @asv (usually the "account" parameter), * or %NULL with an error raised via @error * @get_interfaces_array: a callback used to implement the Interfaces * D-Bus property; The implementation must first chainup to parent * class implementation and then add extra interfaces to the * #GPtrArray. Replaces @get_interfaces * @get_connection_details: a callback used to implement the Protocol D-Bus * properties that represent details of the connections provided by this * protocol * @get_statuses: a callback used to implement the Protocol.Interface.Presence * interface's Statuses property. Since 0.13.5 * @get_avatar_details: a callback used to implement the * Protocol.Interface.Avatars interface's properties. Since 0.13.7 * @dup_authentication_types: a callback used to implement the * AuthenticationTypes D-Bus property; it must return a newly allocated #GStrv * containing D-Bus interface names. Since 0.13.9 * * The class of a #TpBaseProtocol. * * Since: 0.11.11 */ static void protocol_iface_init (TpSvcProtocolClass *cls); static void presence_iface_init (TpSvcProtocolInterfacePresenceClass *cls); static void addressing_iface_init (TpSvcProtocolInterfaceAddressingClass *cls); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseProtocol, tp_base_protocol, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROTOCOL, protocol_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROTOCOL_INTERFACE_PRESENCE, presence_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROTOCOL_INTERFACE_AVATARS, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROTOCOL_INTERFACE_ADDRESSING, addressing_iface_init)) G_DEFINE_INTERFACE (TpProtocolAddressing, tp_protocol_addressing, TP_TYPE_BASE_PROTOCOL) typedef struct { gchar **supported_mime_types; guint min_height; guint min_width; guint rec_height; guint rec_width; guint max_height; guint max_width; guint max_bytes; } AvatarSpecs; struct _TpBaseProtocolPrivate { gchar *name; GStrv interfaces; GStrv connection_interfaces; GStrv authentication_types; GPtrArray *requestable_channel_classes; gchar *icon; gchar *english_name; gchar *vcard_field; AvatarSpecs avatar_specs; }; enum { PROP_NAME = 1, PROP_IMMUTABLE_PROPERTIES, N_PROPS }; static void append_to_ptr_array (GType type G_GNUC_UNUSED, GHashTable *table, const gchar * const *allowed, gpointer user_data) { g_ptr_array_add (user_data, tp_value_array_build (2, TP_HASH_TYPE_CHANNEL_CLASS, table, G_TYPE_STRV, allowed, G_TYPE_INVALID)); } static GPtrArray * tp_base_protocol_build_requestable_channel_classes ( const GType *channel_managers) { GPtrArray *ret = g_ptr_array_new (); gsize i; if (channel_managers != NULL) { for (i = 0; channel_managers[i] != G_TYPE_INVALID; i++) { if (!g_type_is_a (channel_managers[i], TP_TYPE_CHANNEL_MANAGER)) { g_critical ("Channel manager type %s does not actually " "implement TpChannelManager", g_type_name (channel_managers[i])); } else { tp_channel_manager_type_foreach_channel_class ( channel_managers[i], append_to_ptr_array, ret); } } } return ret; } static void tp_base_protocol_constructed (GObject *object) { TpBaseProtocol *self = (TpBaseProtocol *) object; TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); void (*chain_up) (GObject *) = ((GObjectClass *) tp_base_protocol_parent_class)->constructed; GPtrArray *ifaces; if (chain_up != NULL) chain_up (object); /* TODO: when we don't have to deal with * TpBaseProtocolClass.get_interfaces, we won't have to do any of this */ ifaces = (cls->get_interfaces_array) (self); g_ptr_array_add (ifaces, NULL); self->priv->interfaces = g_strdupv ((GStrv) ifaces->pdata); g_ptr_array_unref (ifaces); if (cls->get_connection_details != NULL) { GType *channel_managers = NULL; gchar *vcard_field = NULL; (cls->get_connection_details) (self, &self->priv->connection_interfaces, &channel_managers, &self->priv->icon, &self->priv->english_name, &vcard_field); self->priv->requestable_channel_classes = tp_base_protocol_build_requestable_channel_classes (channel_managers); g_free (channel_managers); /* normalize the case-insensitive vCard field to lower-case, and make * sure the strings are non-NULL */ if (self->priv->icon == NULL) self->priv->icon = g_strdup (""); if (self->priv->english_name == NULL) self->priv->english_name = g_strdup (""); if (vcard_field == NULL) vcard_field = g_strdup (""); self->priv->vcard_field = g_ascii_strdown (vcard_field, -1); g_free (vcard_field); } else { self->priv->requestable_channel_classes = g_ptr_array_sized_new (0); self->priv->icon = g_strdup (""); self->priv->english_name = g_strdup (""); self->priv->vcard_field = g_strdup (""); } if (cls->get_avatar_details != NULL) { (cls->get_avatar_details) (self, &self->priv->avatar_specs.supported_mime_types, &self->priv->avatar_specs.min_height, &self->priv->avatar_specs.min_width, &self->priv->avatar_specs.rec_height, &self->priv->avatar_specs.rec_width, &self->priv->avatar_specs.max_height, &self->priv->avatar_specs.max_width, &self->priv->avatar_specs.max_bytes); } if (self->priv->avatar_specs.supported_mime_types == NULL) self->priv->avatar_specs.supported_mime_types = g_new0 (gchar *, 1); if (cls->dup_authentication_types != NULL) { self->priv->authentication_types = cls->dup_authentication_types (self); } else { const gchar * const tmp[] = { NULL }; self->priv->authentication_types = g_strdupv ((GStrv) tmp); } } /** * tp_base_protocol_get_name: (skip) * @self: a Protocol * * * * Returns: (transfer none): the value of #TpBaseProtocol:name * * Since: 0.11.11 */ const gchar * tp_base_protocol_get_name (TpBaseProtocol *self) { g_return_val_if_fail (TP_IS_BASE_PROTOCOL (self), NULL); return self->priv->name; } /** * tp_base_protocol_get_immutable_properties: * @self: a Protocol * * Return a basic set of immutable properties for this Protocol object, * by using tp_dbus_properties_mixin_make_properties_hash(). * * Additional keys and values can be inserted into the returned hash table; * if this is done, the inserted keys and values will be freed when the * hash table is destroyed. The keys must be allocated with g_strdup() or * equivalent, and the values must be slice-allocated (for instance with * tp_g_value_slice_new_string() or a similar function). * * Note that in particular, tp_asv_set_string() and similar functions should * not be used with this hash table. * * Returns: a hash table mapping (gchar *) fully-qualified property names to * GValues, which must be freed by the caller (at which point its * contents will also be freed). * * Since: 0.11.11 */ GHashTable * tp_base_protocol_get_immutable_properties (TpBaseProtocol *self) { TpBaseProtocolClass *cls; GHashTable *table; g_return_val_if_fail (TP_IS_BASE_PROTOCOL (self), NULL); cls = TP_BASE_PROTOCOL_GET_CLASS (self); table = tp_dbus_properties_mixin_make_properties_hash ((GObject *) self, TP_IFACE_PROTOCOL, "Parameters", NULL); if (cls->is_stub) return table; tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, TP_IFACE_PROTOCOL, "Interfaces", TP_IFACE_PROTOCOL, "ConnectionInterfaces", TP_IFACE_PROTOCOL, "RequestableChannelClasses", TP_IFACE_PROTOCOL, "VCardField", TP_IFACE_PROTOCOL, "EnglishName", TP_IFACE_PROTOCOL, "Icon", TP_IFACE_PROTOCOL, "AuthenticationTypes", NULL); if (cls->get_avatar_details != NULL) { tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "SupportedAvatarMIMETypes", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "MinimumAvatarHeight", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "MinimumAvatarWidth", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "RecommendedAvatarHeight", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "RecommendedAvatarWidth", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "MaximumAvatarHeight", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "MaximumAvatarWidth", TP_IFACE_PROTOCOL_INTERFACE_AVATARS, "MaximumAvatarBytes", NULL); } if (tp_strv_contains ((const gchar * const *) self->priv->interfaces, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING)) tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING, "AddressableVCardFields", TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING, "AddressableURISchemes", NULL); if (tp_strv_contains ((const gchar * const *) self->priv->interfaces, TP_IFACE_PROTOCOL_INTERFACE_PRESENCE)) tp_dbus_properties_mixin_fill_properties_hash ((GObject *) self, table, TP_IFACE_PROTOCOL_INTERFACE_PRESENCE, "Statuses", NULL); return table; } static void tp_base_protocol_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseProtocol *self = (TpBaseProtocol *) object; switch (property_id) { case PROP_NAME: g_value_set_string (value, self->priv->name); break; case PROP_IMMUTABLE_PROPERTIES: g_value_take_boxed (value, tp_base_protocol_get_immutable_properties (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_protocol_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseProtocol *self = (TpBaseProtocol *) object; switch (property_id) { case PROP_NAME: g_assert (self->priv->name == NULL); /* construct-only */ self->priv->name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_protocol_finalize (GObject *object) { TpBaseProtocol *self = (TpBaseProtocol *) object; GObjectFinalizeFunc finalize = ((GObjectClass *) tp_base_protocol_parent_class)->finalize; g_free (self->priv->name); g_strfreev (self->priv->interfaces); g_strfreev (self->priv->connection_interfaces); g_strfreev (self->priv->authentication_types); g_free (self->priv->icon); g_free (self->priv->english_name); g_free (self->priv->vcard_field); g_strfreev (self->priv->avatar_specs.supported_mime_types); if (self->priv->requestable_channel_classes != NULL) g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, self->priv->requestable_channel_classes); if (finalize != NULL) finalize (object); } typedef enum { PP_PARAMETERS, PP_INTERFACES, PP_CONNECTION_INTERFACES, PP_REQUESTABLE_CHANNEL_CLASSES, PP_VCARD_FIELD, PP_ENGLISH_NAME, PP_ICON, PP_AUTHENTICATION_TYPES, N_PP } ProtocolProp; typedef enum { PPP_STATUSES, N_PPP } ProtocolPresenceProp; typedef enum { PAP_SUPPORTED_AVATAR_MIME_TYPES, PAP_MIN_AVATAR_HEIGHT, PAP_MIN_AVATAR_WIDTH, PAP_REC_AVATAR_HEIGHT, PAP_REC_AVATAR_WIDTH, PAP_MAX_AVATAR_HEIGHT, PAP_MAX_AVATAR_WIDTH, PAP_MAX_AVATAR_BYTES, N_PPA } ProtocolAvatarProp; typedef enum { PADP_ADDRESSABLE_VCARD_FIELDS, PADP_ADDRESSABLE_URI_SCHEMES, N_PADP } ProtocolAddressingProp; static void protocol_prop_presence_getter (GObject *object, GQuark iface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer getter_data) { TpBaseProtocol *self = (TpBaseProtocol *) object; switch (GPOINTER_TO_INT (getter_data)) { case PPP_STATUSES: { const TpPresenceStatusSpec *status = tp_base_protocol_get_statuses (self); GHashTable *ret = g_hash_table_new_full ( g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_value_array_free); for (; status->name != NULL; status++) { GValueArray *val = NULL; gchar *key = NULL; gboolean message = FALSE; gboolean settable = status->self; TpConnectionPresenceType type = status->presence_type; key = g_strdup (status->name); /* look for a string argument named 'message' */ if (settable && status->optional_arguments != NULL) { const TpPresenceStatusOptionalArgumentSpec *arg = status->optional_arguments; for (; !message && arg->name != NULL; arg++) { if (tp_strdiff (arg->dtype, "s") || tp_strdiff (arg->name, "message")) continue; message = TRUE; } } val = tp_value_array_build (3, G_TYPE_UINT, type, G_TYPE_BOOLEAN, settable, G_TYPE_BOOLEAN, message, G_TYPE_INVALID); g_hash_table_insert (ret, key, val); } g_value_take_boxed (value, ret); } break; default: g_assert_not_reached (); } } static void protocol_prop_avatar_getter (GObject *object, GQuark iface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer getter_data) { TpBaseProtocol *self = (TpBaseProtocol *) object; switch (GPOINTER_TO_INT (getter_data)) { case PAP_SUPPORTED_AVATAR_MIME_TYPES: g_value_set_boxed (value, self->priv->avatar_specs.supported_mime_types); break; case PAP_MIN_AVATAR_HEIGHT: g_value_set_uint (value, self->priv->avatar_specs.min_height); break; case PAP_MIN_AVATAR_WIDTH: g_value_set_uint (value, self->priv->avatar_specs.min_width); break; case PAP_REC_AVATAR_HEIGHT: g_value_set_uint (value, self->priv->avatar_specs.rec_height); break; case PAP_REC_AVATAR_WIDTH: g_value_set_uint (value, self->priv->avatar_specs.rec_width); break; case PAP_MAX_AVATAR_HEIGHT: g_value_set_uint (value, self->priv->avatar_specs.max_height); break; case PAP_MAX_AVATAR_WIDTH: g_value_set_uint (value, self->priv->avatar_specs.max_width); break; case PAP_MAX_AVATAR_BYTES: g_value_set_uint (value, self->priv->avatar_specs.max_bytes); break; default: g_assert_not_reached (); } } static void protocol_prop_addressing_getter (GObject *object, GQuark iface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer getter_data) { TpBaseProtocol *self = (TpBaseProtocol *) object; TpProtocolAddressingInterface *addr_iface; g_return_if_fail (TP_IS_PROTOCOL_ADDRESSING (self)); addr_iface = TP_PROTOCOL_ADDRESSING_GET_INTERFACE (self); switch (GPOINTER_TO_INT (getter_data)) { case PADP_ADDRESSABLE_VCARD_FIELDS: g_assert (addr_iface->dup_supported_vcard_fields != NULL); g_value_take_boxed (value, addr_iface->dup_supported_vcard_fields (self)); break; case PADP_ADDRESSABLE_URI_SCHEMES: g_assert (addr_iface->dup_supported_uri_schemes != NULL); g_value_take_boxed (value, addr_iface->dup_supported_uri_schemes (self)); break; default: g_assert_not_reached (); } } static void protocol_properties_getter (GObject *object, GQuark iface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer getter_data) { TpBaseProtocol *self = (TpBaseProtocol *) object; switch (GPOINTER_TO_INT (getter_data)) { case PP_PARAMETERS: { GPtrArray *ret = g_ptr_array_new (); const TpCMParamSpec *parameter; for (parameter = tp_base_protocol_get_parameters (self); parameter->name != NULL; parameter++) { g_ptr_array_add (ret, _tp_cm_param_spec_to_dbus (parameter)); } g_value_take_boxed (value, ret); } break; case PP_INTERFACES: g_value_set_boxed (value, self->priv->interfaces); break; case PP_CONNECTION_INTERFACES: g_value_set_boxed (value, self->priv->connection_interfaces); break; case PP_REQUESTABLE_CHANNEL_CLASSES: g_value_set_boxed (value, self->priv->requestable_channel_classes); break; case PP_VCARD_FIELD: g_value_set_string (value, self->priv->vcard_field); break; case PP_ENGLISH_NAME: g_value_set_string (value, self->priv->english_name); break; case PP_ICON: g_value_set_string (value, self->priv->icon); break; case PP_AUTHENTICATION_TYPES: g_value_set_boxed (value, self->priv->authentication_types); break; default: g_assert_not_reached (); } } static GPtrArray * tp_base_protocol_get_interfaces_array (TpBaseProtocol *self) { TpBaseProtocolClass *klass = TP_BASE_PROTOCOL_GET_CLASS (self); GPtrArray *interfaces = g_ptr_array_new (); gchar **old_ifaces = NULL, **ptr; /* copy the klass->get_interfaces property value for backwards * compatibility */ if (klass->get_interfaces != NULL) old_ifaces = klass->get_interfaces (self); for (ptr = old_ifaces; ptr != NULL && *ptr != NULL; ptr++) { g_ptr_array_add (interfaces, (char *) *ptr); } /* TODO: old_ifaces is leaked because get_interfaces returns a new * GStrv, but we want static strings nowadays. leaking is better * than crashing though. this'll be fixed soon */ return interfaces; } static void tp_base_protocol_class_init (TpBaseProtocolClass *klass) { static TpDBusPropertiesMixinPropImpl channel_props[] = { { "Parameters", GINT_TO_POINTER (PP_PARAMETERS), NULL }, { "Interfaces", GINT_TO_POINTER (PP_INTERFACES), NULL }, { "ConnectionInterfaces", GINT_TO_POINTER (PP_CONNECTION_INTERFACES), NULL }, { "RequestableChannelClasses", GINT_TO_POINTER (PP_REQUESTABLE_CHANNEL_CLASSES), NULL }, { "VCardField", GINT_TO_POINTER (PP_VCARD_FIELD), NULL }, { "EnglishName", GINT_TO_POINTER (PP_ENGLISH_NAME), NULL }, { "Icon", GINT_TO_POINTER (PP_ICON), NULL }, { "AuthenticationTypes", GINT_TO_POINTER (PP_AUTHENTICATION_TYPES), NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl presence_props[] = { { "Statuses", GINT_TO_POINTER (PPP_STATUSES), NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl avatar_props[] = { { "SupportedAvatarMIMETypes", GINT_TO_POINTER (PAP_SUPPORTED_AVATAR_MIME_TYPES), NULL }, { "MinimumAvatarHeight", GINT_TO_POINTER (PAP_MIN_AVATAR_HEIGHT), NULL }, { "MinimumAvatarWidth", GINT_TO_POINTER (PAP_MIN_AVATAR_WIDTH), NULL }, { "RecommendedAvatarHeight", GINT_TO_POINTER (PAP_REC_AVATAR_HEIGHT), NULL }, { "RecommendedAvatarWidth", GINT_TO_POINTER (PAP_REC_AVATAR_WIDTH), NULL }, { "MaximumAvatarHeight", GINT_TO_POINTER (PAP_MAX_AVATAR_HEIGHT), NULL }, { "MaximumAvatarWidth", GINT_TO_POINTER (PAP_MAX_AVATAR_WIDTH), NULL }, { "MaximumAvatarBytes", GINT_TO_POINTER (PAP_MAX_AVATAR_BYTES), NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl addressing_props[] = { { "AddressableVCardFields", GINT_TO_POINTER (PADP_ADDRESSABLE_VCARD_FIELDS), NULL }, { "AddressableURISchemes", GINT_TO_POINTER (PADP_ADDRESSABLE_URI_SCHEMES), NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_PROTOCOL, protocol_properties_getter, NULL, channel_props }, { TP_IFACE_PROTOCOL_INTERFACE_PRESENCE, protocol_prop_presence_getter, NULL, presence_props }, { TP_IFACE_PROTOCOL_INTERFACE_AVATARS, protocol_prop_avatar_getter, NULL, avatar_props }, { TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING, protocol_prop_addressing_getter, NULL, addressing_props }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (TpBaseProtocolPrivate)); object_class->constructed = tp_base_protocol_constructed; object_class->get_property = tp_base_protocol_get_property; object_class->set_property = tp_base_protocol_set_property; object_class->finalize = tp_base_protocol_finalize; klass->get_interfaces_array = tp_base_protocol_get_interfaces_array; g_object_class_install_property (object_class, PROP_NAME, g_param_spec_string ("name", "Name of this protocol", "The Protocol from telepathy-spec, such as 'jabber' or 'local-xmpp'", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpBaseProtocol:immutable-properties: * * The D-Bus properties to be announced in the ConnectionManager * interface's Protocols property, as a map from * interface.name.propertyname to GValue. * * A protocol's immutable properties are constant for its lifetime on the * bus, so this property should never change. All of the D-Bus * properties mentioned here should also be exposed through the D-Bus * properties interface. * * The #TpBaseProtocol base class implements this property to be correct * for the basic set of properties. It can be reimplemented by * subclasses to have more immutable properties; if so, the subclass * should use tp_base_protocol_get_immutable_properties(), * then augment the result using * tp_dbus_properties_mixin_fill_properties_hash(). * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_IMMUTABLE_PROPERTIES, g_param_spec_boxed ("immutable-properties", "Immutable properties", "The protocol's immutable properties", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); klass->dbus_properties_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseProtocolClass, dbus_properties_class)); } static void tp_base_protocol_init (TpBaseProtocol *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_PROTOCOL, TpBaseProtocolPrivate); } /** * tp_base_protocol_get_statuses: * @self: a Protocol object * * Get the statuses supported by this object. Subclasses implement this via * the #TpBaseProtocolClass.get_statuses virtual method. * * If the object does not implement the Protocol.Interface.Presences * interface, it need not implement this virtual method. * * Returns: an array of #TpPresenceStatusSpec structs describing the * standard statuses supported by this protocol, with a final element * whose name element is guaranteed to be %NULL. The array must remain * valid at least as long as @self does. * * Since: 0.13.5 */ const TpPresenceStatusSpec * tp_base_protocol_get_statuses (TpBaseProtocol *self) { static const TpPresenceStatusSpec none[] = { { NULL } }; TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); g_return_val_if_fail (cls != NULL, NULL); if (cls->get_statuses != NULL) return cls->get_statuses (self); return none; } /** * tp_base_protocol_get_parameters: * @self: a Protocol object * * Returns the parameters supported by this protocol, as an array of structs * which must remain valid at least as long as @self exists (it will typically * be a global static array). * * Returns: (transfer none) (array zero-terminated=1): a description of the * parameters supported by this protocol * * Since: 0.11.11 */ const TpCMParamSpec * tp_base_protocol_get_parameters (TpBaseProtocol *self) { TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); g_return_val_if_fail (cls != NULL, NULL); g_return_val_if_fail (cls->get_parameters != NULL, NULL); return cls->get_parameters (self); } static gboolean _tp_cm_param_spec_check_all_allowed (const TpCMParamSpec *parameters, GHashTable *asv, GError **error) { GHashTable *tmp = g_hash_table_new (g_str_hash, g_str_equal); const TpCMParamSpec *iter; gboolean ret = TRUE; tp_g_hash_table_update (tmp, asv, NULL, NULL); for (iter = parameters; iter->name != NULL; iter++) { g_hash_table_remove (tmp, iter->name); } if (g_hash_table_size (tmp) != 0) { gchar *error_txt; GString *error_str = g_string_new ("unknown parameters provided:"); GHashTableIter h_iter; gpointer k; g_hash_table_iter_init (&h_iter, tmp); while (g_hash_table_iter_next (&h_iter, &k, NULL)) { g_string_append_c (error_str, ' '); g_string_append (error_str, k); } error_txt = g_string_free (error_str, FALSE); DEBUG ("%s", error_txt); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s", error_txt); g_free (error_txt); ret = FALSE; } g_hash_table_unref (tmp); return ret; } static GValue * _tp_cm_param_spec_coerce (const TpCMParamSpec *param_spec, GHashTable *asv, GError **error) { const gchar *name = param_spec->name; const GValue *value = tp_asv_lookup (asv, name); if (tp_asv_lookup (asv, name) == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s not found in parameters", name); return NULL; } switch (param_spec->dtype[0]) { case DBUS_TYPE_BOOLEAN: case DBUS_TYPE_OBJECT_PATH: case DBUS_TYPE_STRING: case DBUS_TYPE_ARRAY: { /* These types only accept an exactly-matching GType. */ if (G_VALUE_TYPE (value) != param_spec->gtype) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s has type %s, but %s was expected", name, G_VALUE_TYPE_NAME (value), g_type_name (param_spec->gtype)); return NULL; } return tp_g_value_slice_dup (value); } case DBUS_TYPE_INT16: case DBUS_TYPE_INT32: { /* Coerce any sensible integer to G_TYPE_INT */ gboolean valid; gint i; i = tp_asv_get_int32 (asv, name, &valid); if (!valid) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s has a non-integer type or is out of range (type=%s)", name, G_VALUE_TYPE_NAME (value)); return NULL; } if (param_spec->dtype[0] == DBUS_TYPE_INT16 && (i < -0x8000 || i > 0x7fff)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is out of range for a 16-bit signed integer", name); return NULL; } return tp_g_value_slice_new_int (i); } case DBUS_TYPE_BYTE: case DBUS_TYPE_UINT16: case DBUS_TYPE_UINT32: { /* Coerce any sensible integer to G_TYPE_UINT */ gboolean valid; guint i; i = tp_asv_get_uint32 (asv, name, &valid); if (!valid) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s has a non-integer type or is out of range (type=%s)", name, G_VALUE_TYPE_NAME (value)); return NULL; } if (param_spec->dtype[0] == DBUS_TYPE_BYTE && i > 0xff) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is out of range for a byte", name); return NULL; } if (param_spec->dtype[0] == DBUS_TYPE_UINT16 && i > 0xffff) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is out of range for a 16-bit unsigned integer", name); return NULL; } if (param_spec->dtype[0] == DBUS_TYPE_BYTE) return tp_g_value_slice_new_byte (i); else return tp_g_value_slice_new_uint (i); } case DBUS_TYPE_INT64: { /* Coerce any sensible integer to G_TYPE_INT64 */ gboolean valid; gint64 i; i = tp_asv_get_int64 (asv, name, &valid); if (!valid) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is not a valid 64-bit signed integer (type=%s)", name, G_VALUE_TYPE_NAME (value)); return NULL; } return tp_g_value_slice_new_int64 (i); } case DBUS_TYPE_UINT64: { /* Coerce any sensible integer to G_TYPE_UINT64 */ gboolean valid; guint64 i; i = tp_asv_get_uint64 (asv, name, &valid); if (!valid) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is not a valid 64-bit unsigned integer (type=%s)", name, G_VALUE_TYPE_NAME (value)); return NULL; } return tp_g_value_slice_new_uint64 (i); } case DBUS_TYPE_DOUBLE: { /* Coerce any sensible number to G_TYPE_DOUBLE */ gboolean valid; gdouble d; d = tp_asv_get_double (asv, name, &valid); if (!valid) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "%s is not a valid double (type=%s)", name, G_VALUE_TYPE_NAME (value)); return NULL; } return tp_g_value_slice_new_double (d); } default: { g_error ("%s: encountered unhandled D-Bus type %s on argument %s", G_STRFUNC, param_spec->dtype, param_spec->name); } } g_assert_not_reached (); } static GHashTable * tp_base_protocol_sanitize_parameters (TpBaseProtocol *self, GHashTable *asv, GError **error) { GHashTable *combined; const TpCMParamSpec *parameters; guint i; guint mandatory_flag; parameters = tp_base_protocol_get_parameters (self); combined = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); if (!_tp_cm_param_spec_check_all_allowed (parameters, asv, error)) goto except; if (tp_asv_get_boolean (asv, "register", NULL)) { mandatory_flag = TP_CONN_MGR_PARAM_FLAG_REGISTER; } else { mandatory_flag = TP_CONN_MGR_PARAM_FLAG_REQUIRED; } for (i = 0; parameters[i].name != NULL; i++) { const gchar *name = parameters[i].name; if (tp_asv_lookup (asv, name) != NULL) { /* coerce to the expected type */ GValue *coerced = _tp_cm_param_spec_coerce (parameters + i, asv, error); if (coerced == NULL) goto except; if (G_UNLIKELY (G_VALUE_TYPE (coerced) != parameters[i].gtype)) { g_error ("parameter %s should have been coerced to %s, got %s", name, g_type_name (parameters[i].gtype), G_VALUE_TYPE_NAME (coerced)); } if (parameters[i].filter != NULL) { GError *error2 = NULL; if (!(parameters[i].filter (parameters + i, coerced, &error2))) { DEBUG ("parameter %s rejected by filter: %s", name, error2->message); tp_g_value_slice_free (coerced); g_propagate_error (error, error2); goto except; } } if (G_UNLIKELY (G_VALUE_TYPE (coerced) != parameters[i].gtype)) { g_error ("parameter %s filter changed its type from %s to %s", name, g_type_name (parameters[i].gtype), G_VALUE_TYPE_NAME (coerced)); } if (DEBUGGING) { gchar *to_free = NULL; const gchar *contents = ""; if (!(parameters[i].flags & TP_CONN_MGR_PARAM_FLAG_SECRET)) contents = to_free = g_strdup_value_contents (coerced); DEBUG ("using specified value for %s: %s", name, contents); g_free (to_free); } g_hash_table_insert (combined, g_strdup (name), coerced); } else if ((parameters[i].flags & mandatory_flag) != 0) { DEBUG ("missing mandatory account parameter %s", name); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "missing mandatory account parameter %s", name); goto except; } else if ((parameters[i].flags & TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT) != 0) { GValue *value = param_default_value (parameters + i); g_hash_table_insert (combined, g_strdup (name), value); } else { /* no default */ } } return combined; except: g_hash_table_unref (combined); return NULL; } /** * tp_base_protocol_new_connection: * @self: a Protocol object * @asv: (transfer none) (element-type utf8 GObject.Value): the parameters * provided via D-Bus * @error: used to return an error if %NULL is returned * * Create a new connection using the #TpBaseProtocolClass.get_parameters and * #TpBaseProtocolClass.new_connection implementations provided by a subclass. * This is used to implement the RequestConnection() D-Bus method. * * If the parameters in @asv do not fit the result of @get_parameters (unknown * parameters are given, types are inappropriate, required parameters are * not given, or a #TpCMParamSpec.filter fails), then this method raises an * error and @new_connection is not called. * * Otherwise, @new_connection is called. Its @asv argument is a copy of the * @asv given to this method, with default values for missing parameters * filled in where available, and parameters' types converted to the #GType * specified by #TpCMParamSpec.gtype. * * Returns: a new connection, or %NULL on error * * Since: 0.11.11 */ TpBaseConnection * tp_base_protocol_new_connection (TpBaseProtocol *self, GHashTable *asv, GError **error) { TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); GHashTable *combined; TpBaseConnection *conn = NULL; g_return_val_if_fail (cls != NULL, NULL); g_return_val_if_fail (cls->new_connection != NULL, NULL); combined = tp_base_protocol_sanitize_parameters (self, asv, error); if (combined != NULL) { conn = cls->new_connection (self, combined, error); g_hash_table_unref (combined); } return conn; } static void protocol_normalize_contact (TpSvcProtocol *protocol, const gchar *contact, DBusGMethodInvocation *context) { TpBaseProtocol *self = TP_BASE_PROTOCOL (protocol); TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); GError *error = NULL; gchar *ret = NULL; g_return_if_fail (cls != NULL); if (cls->normalize_contact != NULL) { ret = cls->normalize_contact (self, contact, &error); } else { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This Protocol does not implement NormalizeContact"); } if (ret == NULL) { dbus_g_method_return_error (context, error); g_error_free (error); } else { tp_svc_protocol_return_from_normalize_contact (context, ret); g_free (ret); } } static void protocol_identify_account (TpSvcProtocol *protocol, GHashTable *parameters, DBusGMethodInvocation *context) { TpBaseProtocol *self = TP_BASE_PROTOCOL (protocol); TpBaseProtocolClass *cls = TP_BASE_PROTOCOL_GET_CLASS (self); GError *error = NULL; gchar *ret = NULL; g_return_if_fail (cls != NULL); if (cls->identify_account != NULL) { GHashTable *sanitized = tp_base_protocol_sanitize_parameters (self, parameters, &error); if (sanitized != NULL) { ret = cls->identify_account (self, sanitized, &error); g_hash_table_unref (sanitized); } } else { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This Protocol does not implement IdentifyAccount"); } if (ret == NULL) { dbus_g_method_return_error (context, error); g_error_free (error); } else { tp_svc_protocol_return_from_identify_account (context, ret); g_free (ret); } } static void addressing_normalize_contact_uri (TpSvcProtocolInterfaceAddressing *protocol, const gchar *uri, DBusGMethodInvocation *context) { TpBaseProtocol *self = TP_BASE_PROTOCOL (protocol); TpProtocolAddressingInterface *iface; GError *error = NULL; gchar *ret = NULL; if (!TP_IS_PROTOCOL_ADDRESSING (self)) goto notimplemented; iface = TP_PROTOCOL_ADDRESSING_GET_INTERFACE (self); if (iface->normalize_contact_uri == NULL) goto notimplemented; ret = iface->normalize_contact_uri (self, uri, &error); if (ret == NULL) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_protocol_interface_addressing_return_from_normalize_contact_uri (context, ret); g_free (ret); return; notimplemented: tp_dbus_g_method_return_not_implemented (context); } static void addressing_normalize_vcard_address (TpSvcProtocolInterfaceAddressing *protocol, const gchar *vcard_field, const gchar *vcard_address, DBusGMethodInvocation *context) { TpBaseProtocol *self = TP_BASE_PROTOCOL (protocol); TpProtocolAddressingInterface *iface; GError *error = NULL; gchar *ret = NULL; if (!TP_IS_PROTOCOL_ADDRESSING (self)) goto notimplemented; iface = TP_PROTOCOL_ADDRESSING_GET_INTERFACE (self); if (iface->normalize_vcard_address == NULL) goto notimplemented; ret = iface->normalize_vcard_address (self, vcard_field, vcard_address, &error); if (ret == NULL) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_protocol_interface_addressing_return_from_normalize_vcard_address ( context, ret); g_free (ret); return; notimplemented: tp_dbus_g_method_return_not_implemented (context); } static void protocol_iface_init (TpSvcProtocolClass *cls) { #define IMPLEMENT(x) tp_svc_protocol_implement_##x (cls, protocol_##x) IMPLEMENT (normalize_contact); IMPLEMENT (identify_account); #undef IMPLEMENT } static void presence_iface_init (TpSvcProtocolInterfacePresenceClass *cls) { } static void addressing_iface_init (TpSvcProtocolInterfaceAddressingClass *cls) { #define IMPLEMENT(x) tp_svc_protocol_interface_addressing_implement_##x (cls, addressing_##x) IMPLEMENT (normalize_contact_uri); IMPLEMENT (normalize_vcard_address); #undef IMPLEMENT } static void tp_protocol_addressing_default_init (TpProtocolAddressingInterface *iface) { } telepathy-glib-0.24.2/telepathy-glib/base-protocol.h0000644000175000017500000001710112652510705017271 00000000000000/* TpBaseProtocol * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_BASE_PROTOCOL_H #define TP_BASE_PROTOCOL_H #include #include #include #include G_BEGIN_DECLS typedef struct _TpCMParamSpec TpCMParamSpec; typedef void (*TpCMParamSetter) (const TpCMParamSpec *paramspec, const GValue *value, gpointer params); typedef gboolean (*TpCMParamFilter) (const TpCMParamSpec *paramspec, GValue *value, GError **error); gboolean tp_cm_param_filter_string_nonempty (const TpCMParamSpec *paramspec, GValue *value, GError **error); gboolean tp_cm_param_filter_uint_nonzero (const TpCMParamSpec *paramspec, GValue *value, GError **error); /* XXX: This should be driven by GTypes, but the GType is insufficiently * descriptive: if it's UINT we can't tell whether the D-Bus type is * UInt32, UInt16 or possibly even Byte. So we have the D-Bus type too. * * As it stands at the moment it could be driven by the *D-Bus* type, but * in future we may want to have more than one possible GType for a D-Bus * type, e.g. converting arrays of string into either a strv or a GPtrArray. * So, we keep the redundancy for future expansion. */ struct _TpCMParamSpec { const gchar *name; const gchar *dtype; GType gtype; guint flags; gconstpointer def; gsize offset; TpCMParamFilter filter; gconstpointer filter_data; gconstpointer setter_data; /**/ gpointer _future1; }; typedef struct _TpBaseProtocol TpBaseProtocol; typedef struct _TpBaseProtocolClass TpBaseProtocolClass; typedef struct _TpBaseProtocolPrivate TpBaseProtocolPrivate; typedef struct _TpBaseProtocolClassPrivate TpBaseProtocolClassPrivate; GType tp_base_protocol_get_type (void) G_GNUC_CONST; #define TP_TYPE_BASE_PROTOCOL \ (tp_base_protocol_get_type ()) #define TP_BASE_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASE_PROTOCOL, \ TpBaseProtocol)) #define TP_BASE_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASE_PROTOCOL, \ TpBaseProtocolClass)) #define TP_IS_BASE_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASE_PROTOCOL)) #define TP_IS_BASE_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASE_PROTOCOL)) #define TP_BASE_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_PROTOCOL, \ TpBaseProtocolClass)) struct _TpBaseProtocol { /**/ GObject parent; TpBaseProtocolPrivate *priv; }; typedef const TpCMParamSpec *(*TpBaseProtocolGetParametersFunc) ( TpBaseProtocol *self); typedef TpBaseConnection *(*TpBaseProtocolNewConnectionFunc) ( TpBaseProtocol *self, GHashTable *asv, GError **error); typedef gchar *(*TpBaseProtocolNormalizeContactFunc) (TpBaseProtocol *self, const gchar *contact, GError **error); typedef gchar *(*TpBaseProtocolIdentifyAccountFunc) (TpBaseProtocol *self, GHashTable *asv, GError **error); typedef GStrv (*TpBaseProtocolGetInterfacesFunc) (TpBaseProtocol *self); typedef void (*TpBaseProtocolGetConnectionDetailsFunc) (TpBaseProtocol *self, GStrv *connection_interfaces, GType **channel_manager_types, gchar **icon_name, gchar **english_name, gchar **vcard_field); typedef void (*TpBaseProtocolGetAvatarDetailsFunc) (TpBaseProtocol *self, GStrv *supported_mime_types, guint *min_height, guint *min_width, guint *rec_height, guint *rec_width, guint *max_height, guint *max_width, guint *max_bytes); typedef GPtrArray * (*TpBaseProtocolGetInterfacesArrayFunc) (TpBaseProtocol *self); struct _TpBaseProtocolClass { GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_properties_class; gboolean is_stub; const TpCMParamSpec *(*get_parameters) (TpBaseProtocol *self); TpBaseConnection *(*new_connection) (TpBaseProtocol *self, GHashTable *asv, GError **error); gchar *(*normalize_contact) (TpBaseProtocol *self, const gchar *contact, GError **error); gchar *(*identify_account) (TpBaseProtocol *self, GHashTable *asv, GError **error); /**/ GStrv (*_TP_SEAL (get_interfaces)) (TpBaseProtocol *self); /**/ void (*get_connection_details) (TpBaseProtocol *self, GStrv *connection_interfaces, GType **channel_manager_types, gchar **icon_name, gchar **english_name, gchar **vcard_field); const TpPresenceStatusSpec * (*get_statuses) (TpBaseProtocol *self); TpBaseProtocolGetAvatarDetailsFunc get_avatar_details; GStrv (*dup_authentication_types) (TpBaseProtocol *self); TpBaseProtocolGetInterfacesArrayFunc get_interfaces_array; /**/ GCallback padding[4]; TpBaseProtocolClassPrivate *priv; }; const gchar *tp_base_protocol_get_name (TpBaseProtocol *self); GHashTable *tp_base_protocol_get_immutable_properties (TpBaseProtocol *self); const TpCMParamSpec *tp_base_protocol_get_parameters (TpBaseProtocol *self); const TpPresenceStatusSpec *tp_base_protocol_get_statuses (TpBaseProtocol *self); TpBaseConnection *tp_base_protocol_new_connection (TpBaseProtocol *self, GHashTable *asv, GError **error); /* ---- Implemented by subclasses for Addressing support ---- */ #define TP_TYPE_PROTOCOL_ADDRESSING \ (tp_protocol_addressing_get_type ()) #define TP_IS_PROTOCOL_ADDRESSING(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_PROTOCOL_ADDRESSING)) #define TP_PROTOCOL_ADDRESSING_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_PROTOCOL_ADDRESSING, TpProtocolAddressingInterface)) typedef struct _TpProtocolAddressingInterface TpProtocolAddressingInterface; typedef GStrv (*TpBaseProtocolDupSupportedVCardFieldsFunc) (TpBaseProtocol *self); typedef GStrv (*TpBaseProtocolDupSupportedURISchemesFunc) (TpBaseProtocol *self); typedef gchar *(*TpBaseProtocolNormalizeVCardAddressFunc) ( TpBaseProtocol *self, const gchar *vcard_field, const gchar *vcard_address, GError **error); typedef gchar *(*TpBaseProtocolNormalizeURIFunc) ( TpBaseProtocol *self, const gchar *uri, GError **error); struct _TpProtocolAddressingInterface { GTypeInterface parent; TpBaseProtocolDupSupportedVCardFieldsFunc dup_supported_vcard_fields; TpBaseProtocolDupSupportedURISchemesFunc dup_supported_uri_schemes; TpBaseProtocolNormalizeVCardAddressFunc normalize_vcard_address; TpBaseProtocolNormalizeURIFunc normalize_contact_uri; }; _TP_AVAILABLE_IN_0_18 GType tp_protocol_addressing_get_type (void) G_GNUC_CONST; G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/handle-repo-internal.h0000644000175000017500000001011712652510705020530 00000000000000/**/ /* * internal-handle-repo.h - private header for handle repositories * * Copyright (C) 2005,2006,2007 Collabora Ltd. * Copyright (C) 2005,2006,2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __TP_INTERNAL_HANDLE_REPO_H__ #define __TP_INTERNAL_HANDLE_REPO_H__ #include G_BEGIN_DECLS /* G_DEFINE_INTERFACE wants that name */ typedef struct _TpHandleRepoIfaceClass TpHandleRepoIfaceInterface; /* <-- this is no longer a gtkdoc comment because this is not public API * TpHandleRepoIfaceClass: * @parent_class: Fields shared with GTypeInterface * @handle_is_valid: Implementation for tp_handle_is_valid() for this repo * @handles_are_valid: Implementation for tp_handles_are_valid() for this repo * @ref_handle: Implementation for tp_handle_ref() for this repo * @unref_handle: Implementation for tp_handle_unref() for this repo * @client_hold_handle: Implementation for tp_handle_client_hold() for this * repo * @client_release_handle: Implementation for tp_handle_client_release() for * this repo * @inspect_handle: Implementation for tp_handle_inspect() for this repo * @ensure_handle: Implementation for tp_handle_ensure() for this repo * @lookup_handle: Implementation for tp_handle_lookup() for this repo * @get_qdata: Implementation for tp_handle_get_qdata() for this repo * @set_qdata: Implementation for tp_handle_set_qdata() for this repo * * The class of a #TpHandleRepoIface. All implementation callbacks must be * filled in by all implementations, and have the same semantics as the * global function that calls them. */ struct _TpHandleRepoIfaceClass { GTypeInterface parent_class; gboolean (*handle_is_valid) (TpHandleRepoIface *self, TpHandle handle, GError **error); gboolean (*handles_are_valid) (TpHandleRepoIface *self, const GArray *handles, gboolean allow_zero, GError **error); TpHandle (*ref_handle) (TpHandleRepoIface *self, TpHandle handle); void (*unref_handle) (TpHandleRepoIface *self, TpHandle handle); gboolean (*client_hold_handle) (TpHandleRepoIface *self, const gchar *client, TpHandle handle, GError **error); gboolean (*client_release_handle) (TpHandleRepoIface *self, const gchar *client, TpHandle handle, GError **error); const char *(*inspect_handle) (TpHandleRepoIface *self, TpHandle handle); TpHandle (*ensure_handle) (TpHandleRepoIface *self, const char *id, gpointer context, GError **error); TpHandle (*lookup_handle) (TpHandleRepoIface *self, const char *id, gpointer context, GError **error); void (*ensure_handle_async) (TpHandleRepoIface *self, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data); TpHandle (*ensure_handle_finish) (TpHandleRepoIface *self, GAsyncResult *result, GError **error); void (*set_qdata) (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy); gpointer (*get_qdata) (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id); }; gpointer _tp_dynamic_handle_repo_get_normalization_data ( TpHandleRepoIface *irepo); void _tp_dynamic_handle_repo_set_normalization_data (TpHandleRepoIface *irepo, gpointer data, GDestroyNotify destroy); G_END_DECLS #endif /*__TP_INTERNAL_HANDLE_REPO_H__ */ telepathy-glib-0.24.2/telepathy-glib/extra-gtkdoc.h0000644000175000017500000012432712652510705017125 00000000000000/* This file contains no code - it's just here for gtkdoc to pick up * documentation for otherwise undocumented generated files. * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:svc-generic * @title: Generic service-side interfaces * @short_description: GInterfaces for D-Bus objects exporting Telepathy * properties and common D-Bus core interfaces * @see_also: #TpPropertiesMixin * * The D-Bus Properties interface associates named properties with any D-Bus * object. * * The D-Bus Introspectable interface provides introspection information. * * The D-Bus Peer interface is exported by every D-Bus object. * * The Telepathy Properties interface associates a number of named properties * with a channel, connection or other D-Bus object. Signals are emitted * when the properties or their flags (readable/writable) change. */ /** * SECTION:svc-channel * @title: Service-side Channel base interface * @short_description: GInterface for Telepathy Channel objects * @see_also: #TpChannelIface * * This interface (auto-generated from the Telepathy spec) makes it easier * to export objects implementing the Telepathy Channel. */ /** * SECTION:svc-debug * @title: Service-side Debug base interface * @short_description: GInterface for Telepathy Debug objects * * This interface (auto-generated from the Telepathy spec) makes it easier * to export objects implementing the Telepathy Debug interface. * * #TpDebugSender provides a reference implementation of the Debug object. * * Since: 0.7.36 */ /** * SECTION:svc-channel-group * @title: Service-side Channel Group and Conference interfaces * @short_description: Groups of contacts * @see_also: #TpGroupMixin * * Many Telepathy Channel objects can be seen as representing groups or * sets of contacts. The Telepathy specification represents this by a common * interface, Group. This section documents the auto-generated GInterface * used to implement the Group interface. * * Contacts can be in four states: * * * in the group (the "members" set) * * * "local pending" (waiting to be added to the group by the local client * calling AddMembers()) * * * "remote pending" (waiting to be added to the group by some other * action, probably by someone else) * * * no relationship with the group at all * * For instance, chatrooms implement the Group interface. Contacts in the * chatroom are members, and contacts who we've invited to the group, or * contacts who've requested permission to join, are remote pending. If the * local user has been invited by another contact, they will appear in the * local-pending set until they accept or decline the invitation. * * Since 0.11.16, telepathy-glib also includes basic support for the * Conference interface, which represents a Group channel that can be * initiated by merging or upgrading individual 1-1 channels. */ /** * SECTION:svc-channel-room * @title: Service-side room interfaces * @short_description: room-related functionality for channels * * This collection of interfaces is used to expose various aspects of the * configuration of chat rooms. * * #TpSvcChannelInterfaceRoom consists of a pair of requestable, * immutable properties: "RoomName" and * "Server"; and a pair of immutable properties: * "Creator", "CreatorHandle", and * "CreationTimestamp". It has no methods or signals. It * should be implemented on channels representing a chat room (whether * it be a text chat, a multi-user call, or some other media type). * * #TpSvcChannelInterfaceSubject may be implemented by channels which have a * subject (or topic, depending on your protocol's terminology of choice). This * will usually be in addition to #TpSvcChannelInterfaceRoom, though in theory * a 1-1 channel could have a subject. In addition to its single method, it * defines a set of read-only properties, namely "Subject", * "Actor", "ActorHandle", "Timestamp", * and "CanSet". Changes should be signalled using * tp_dbus_properties_mixin_emit_properties_changed(). * * #TpSvcChannelInterfaceRoomConfig provides a vast array of properties for * other aspects of a chat room's configuration (such as the maximum number of * participants, and whether the room is password-protected). Channels with * this interface will typically implement the other two, too. * * Since: 0.15.8 */ /** * SECTION:svc-channel-text * @title: Text channels * @short_description: service-side interfaces for the Text channel type, and * the Chat State, Password and SMS interfaces * @see_also: #TpTextMixin * * A major use for instant messaging is obviously to send messages. * Channels of type Text represent conversations or chat rooms using short * real-time messages, including SMS. * * This section documents the auto-generated GInterfaces used to implement * the Text channel type, and some interfaces used in conjunction with it. */ /** * SECTION:svc-channel-file-transfer * @title: File Transfer channels * @short_description: service-side interface for the File Transfer channel type * * This section documents the auto-generated GInterface used to implement * the File Transfer channel type. */ /** * SECTION:svc-channel-media * @title: Media channels * @short_description: service-side interfaces for the Streamed Media channel * type, and the Call State, DTMF and Media Signalling interfaces * * This section documents the auto-generated C wrappers for the Streamed Media * channel type, and some interfaces which are optionally supported by * channels of this type. * * Streamed Media channels represent real-time audio or video streaming, * including voice over IP, webcams, and telephony. * * Channels of type Streamed Media may support the Media Signalling interface. * If not, the connection manager is assumed to be presenting the media * streams to the user automatically (for instance, in a connection manager * like gnome-phone-manager or telepathy-snom that remotely controls a * telephone, the phone's own speaker and microphone will probably be * used directly). * * If Media Signalling is supported, the Telepathy client is responsible for * actually streaming the media, using the Media Signalling interface to * provide signalling (connection managers might implement this interface in * terms of Jingle or SDP, for instance). * * Channels of type Streamed Media may also support the DTMF and * CallState interfaces. */ /** * SECTION:svc-channel-tubes * @title: Tubes channels * @short_description: service-side interface for the Tubes channel type * * A "tube" is a mechanism for arbitrary data transfer. * This section documents the auto-generated C wrappers for the Tubes * channel type. */ /** * SECTION:svc-channel-tube * @title: Tube channels * @short_description: service-side interface for the Tube channel interface, * StreamTube channel type and DBusTube channel type. * * A "tube" is a mechanism for arbitrary data transfer. * This section documents the auto-generated C wrappers for the Tube * channel interface, StreamTube channel type and DBusTube channel type. */ /** * SECTION:svc-channel-contactlist * @title: Contact List channels * @short_description: service-side interface for the Contact List channel type * * Many instant messaging protocols have the a concept of a contact list, * roster or buddy list. Some protocols also have user-defined groups or tags * which can be represented as subsets of the roster. * * This section documents the auto-generated C wrappers for the Contact List * channel type. */ /** * SECTION:svc-channel-roomlist * @title: Room List channels * @short_description: service-side interface for the Room List channel type * * Many instant messaging protocols allow named chatrooms to be listed. * This section documents the auto-generated C wrappers for the Room List * channel type. */ /** * SECTION:svc-connection * @title: Service-side Connection interfaces * @short_description: GInterfaces for Telepathy Connection objects * @see_also: #TpBaseConnection * * These interfaces (auto-generated from the Telepathy spec) make it easier * to export objects implementing the Telepathy Connection and its * optional interfaces, with the correct method and signal signatures, * and emit signals from those objects in a type-safe way. */ /** * SECTION:svc-connection-manager * @title: Service-side Connection Manager interface * @short_description: GInterface for Telepathy ConnectionManager objects * @see_also: #TpBaseConnection * * The #TpSvcConnectionManager interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * ConnectionManager interface, with the correct method and signal signatures, * and emit signals from that object in a type-safe way. */ /** * SECTION:svc-account * @title: Service-side Account interfaces * @short_description: GInterfaces for Telepathy Account objects * * These interfaces (auto-generated from the Telepathy spec) make it easier * to export objects implementing the Telepathy Account and its * optional interfaces, with the correct method and signal signatures, * and emit signals from those objects in a type-safe way. * * You don't need these interfaces unless you're implementing a * Telepathy AccountManager, such as Mission Control. */ /** * SECTION:svc-account-manager * @title: Service-side Account Manager interface * @short_description: GInterface for Telepathy AccountManager objects * * The #TpSvcAccountManager interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * AccountManager interface, with the correct method and signal signatures, * and emit signals from that object in a type-safe way. * * You don't need these interfaces unless you're implementing a * Telepathy AccountManager, such as Mission Control. */ /** * SECTION:svc-channel-dispatcher * @title: Service-side Channel Dispatcher interface * @short_description: GInterfaces for Telepathy ChannelDispatcher object * * The #TpSvcChannelDispatcher interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * ChannelDispatcher interface, with the correct method and signal signatures, * and emit signals from that object in a type-safe way. * * Similarly, #TpSvcChannelDispatcherInterfaceOperationList helps to * implement the optional OperationList interface. * * You don't need these interfaces unless you're implementing a * Telepathy ChannelDispatcher, such as Mission Control. */ /** * SECTION:svc-channel-dispatch-operation * @title: Service-side Channel Dispatch Operation interface * @short_description: GInterface for Telepathy ChannelDispatchOperation object * * This interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * ChannelDispatchOperation interface, with the correct method and signal * signatures, and emit signals from that object in a type-safe way. * * You don't need these interfaces unless you're implementing a * Telepathy ChannelDispatcher, such as Mission Control. */ /** * SECTION:svc-channel-request * @title: Service-side Channel Request interface * @short_description: GInterface for Telepathy ChannelRequest object * * This interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * ChannelRequest interface, with the correct method and signal * signatures, and emit signals from that object in a type-safe way. * * You don't need these interfaces unless you're implementing a * Telepathy ChannelDispatcher, such as Mission Control. */ /** * SECTION:svc-channel-dispatcher * @title: Service-side Channel Dispatcher interface * @short_description: GInterfaces for Telepathy ChannelDispatcher object * * The #TpSvcChannelDispatcher interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * ChannelDispatcher interface, with the correct method and signal signatures, * and emit signals from that object in a type-safe way. * * Similarly, #TpSvcChannelDispatcherInterfaceOperationList helps to * implement the optional OperationList interface. * * You don't need these interfaces unless you're implementing a * Telepathy ChannelDispatcher, such as Mission Control. */ /** * SECTION:svc-media-interfaces * @title: Service-side media streaming helper interfaces * @short_description: media session and media stream * @see_also: #TpSvcChannelTypeStreamedMedia * * These interfaces (auto-generated from the telepathy spec) make it easier * to export the objects used to implement #TpSvcChannelTypeStreamedMedia, * with the correct method and signal signatures, and emit signals from those * objects. */ /** * SECTION:svc-client * @title: Service-side Client interfaces * @short_description: interfaces used to be an Observer, Approver and Handler * * These interfaces (auto-generated from the telepathy spec) make it easier * to export the objects used to implement a Telepathy client. * * Clients such as loggers, new message notification windows and chat UIs * should implement some or all of the Client types (Observer, Approver and/or * Handler): see telepathy-spec for details. */ /** * SECTION:defs * @title: Miscellaneous definitions * @short_description: Definitions useful for working with the Telepathy * protocol * * This header contains definitions which didn't fit into enums.h, * interfaces.h or errors.h. * * Changed in 0.7.0: in older versions, some of these constants were in * base-connection.h and base-connection-manager.h. * * Since: 0.7.0 */ /** * SECTION:version * @title: Version information * @short_description: Checking the telepathy-glib version * * Since 0.19.0, telepathy-glib provides version information similar * to that used in GLib. * * Typical usage from configure.ac is similar to GLib's: * * |[ * AC_DEFINE([TP_VERSION_MIN_REQUIRED], [TP_VERSION_0_18], * [Ignore deprecations newer than this branch]) * AC_DEFINE([TP_VERSION_MAX_ALLOWED], [TP_VERSION_0_20], * [Prevent use of APIs newer than this branch]) * ]| * * or you can define the macros directly on the compiler command line * if required: * * |[ * cc -o foo foo.c \ * -DTP_VERSION_MIN_REQUIRED=TP_VERSION_0_18 \ * -DTP_VERSION_MAX_ALLOWED=TP_VERSION_0_20 \ * ${TP_CFLAGS} ${TP_LIBS} * ]| * * This functionality was added in telepathy-glib 0.19.0, but it * is safe to define the TP_VERSION_MIN_REQUIRED and TP_VERSION_MAX_ALLOWED * macros even for older versions of telepathy-glib, as long as you do * not try to expand them. */ /** * TP_MAJOR_VERSION: * * The major version of telepathy-glib (e.g. the 0 in 0.18.1) at the time your * code was compiled. */ /** * TP_MINOR_VERSION: * * The minor version of telepathy-glib (e.g. the 18 in 0.18.1) at the time your * code was compiled. * * Odd minor versions indicate a development branch; even minor versions * indicate a stable branch. */ /** * TP_MICRO_VERSION: * * The micro version of telepathy-glib (e.g. the 1 in 0.18.1) at the time your * code was compiled. * * Within a stable branch (even minor version), micro versions fix bugs * but do not add features. * * Within a development branch (odd minor version), micro versions can * fix bugs and/or add features. */ /** * TP_VERSION_0_16: (skip) * * A constant representing the telepathy-glib 0.16 stable branch, * and the 0.15 development branch that led to it. */ /** * TP_VERSION_0_18: (skip) * * A constant representing the telepathy-glib 0.18 stable branch, * and the 0.17 development branch that led to it. */ /** * TP_VERSION_0_20: (skip) * * A constant representing the telepathy-glib 0.20 stable branch, * and the 0.19 development branch that led to it. */ /** * TP_VERSION_0_22: (skip) * * A constant representing the telepathy-glib 0.22 stable branch, * and the 0.21 development branch that led to it. */ /** * TP_VERSION_0_24: (skip) * * A constant representing the telepathy-glib 0.24 stable branch, * and the 0.23 development branch that led to it. */ /** * TP_VERSION_1_0: (skip) * * A constant representing the telepathy-glib 1.0 stable branch, * and the 0.99 development branch that led to it. */ /** * TP_VERSION_MIN_REQUIRED: (skip) * * A version-number constant like %TP_VERSION_0_18. * * This may be defined to a value like %TP_VERSION_0_18 by users of * telepathy-glib, to set the minimum version they wish to * require. Warnings will be issued for functions deprecated in or * before that version. * * If not defined, the default value is the previous stable branch. */ /** * TP_VERSION_MAX_ALLOWED: (skip) * * A version-number constant like %TP_VERSION_0_18. * * This may be defined to a value like %TP_VERSION_0_18 by users of * telepathy-glib, to set the maximum version they wish to * depend on. Warnings will be issued for functions deprecated in or * before that version. * * If not defined, the default value in stable branches is that stable * branch, and the default value in development branches is the next * stable branch. */ /** * SECTION:enums * @title: Telepathy protocol enumerations * @short_description: Enumerated types and bitfields from the Telepathy spec * * This header exposes the constants from the Telepathy specification as * C enums. It is automatically generated from the specification. * * The names used in the specification (e.g. * Connection_Status_Connected) are converted to upper-case and given a * TP_ prefix, e.g. TP_CONNECTION_STATUS_CONNECTED. * * Each enum also has a constant for the number of members, named like * TP_NUM_CONNECTION_STATUSES. The pluralization is currently hard-coded * in the conversion scripts, but should move into the specification * in future. * * Constants LAST_TP_CONNECTION_STATUS, etc. are also provided. These are * deprecated and will be removed in a future release. */ /** * SECTION:interfaces * @title: Telepathy protocol interface and property names * @short_description: D-Bus interface and property names from the * Telepathy spec * * This header exposes the interface names from the Telepathy specification * as cpp defines for strings, such as %TP_IFACE_PROPERTIES_INTERFACE. * It is automatically generated from the specification. * * Since 0.7.0 it also provides cpp defines like * %TP_IFACE_QUARK_PROPERTIES_INTERFACE, which expand to function calls that * return GQuarks for the same strings. * * Since 0.9.2 it also provides cpp defines like * %TP_PROP_CHANNEL_INTERFACE_GROUP_GROUP_FLAGS, which expand to string * constants representing fully-qualified D-Bus property names, like * org.freedesktop.Telepathy.Channel.Interface.Group.GroupFlags. * * Since 0.11.5 it also provides cpp defines like * %TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS for contact attributes like * "org.freedesktop.Telepathy.Connection.Interface.Aliasing/alias", * and defines like * %TP_TOKEN_CHANNEL_INTERFACE_MEDIA_SIGNALLING_ICE_UDP * for handler capability tokens like * "org.freedesktop.Telepathy.Channel.Interface.MediaSignalling/gtalk-p2p". * (These were present in an incorrect form since 0.11.3.) */ /** * SECTION:errors * @title: Telepathy protocol errors * @short_description: The errors from the Telepathy D-Bus spec, as a * GLib error domain * * This header provides the Telepathy D-Bus errors, in the form of a * GLib error domain. For D-Bus methods which fail with one of these errors, * dbus-glib will generate a reply message with the appropriate error. * * It also provides utility functions used by functions which return an error. */ /** * SECTION:handle * @title: TpHandle * @short_description: type representing handles * @see_also: TpHandleRepoIface * * The TpHandle type represents a Telepathy handle. */ /** * SECTION:channel-group * @title: Group and Conference interfaces on Channels * @short_description: client-side wrappers for Group and Conference * @see_also: #TpChannel * * Many Telepathy Channel objects can be seen as representing groups or * sets of contacts. The Telepathy specification represents this by a common * interface, Group. This section documents the auto-generated C wrappers for * the Group interface. * * Contacts can be in four states: * * * in the group (the "members" set) * * * "local pending" (waiting to be added to the group by the local client * calling AddMembers()) * * * "remote pending" (waiting to be added to the group by some other * action, probably by someone else) * * * no relationship with the group at all * * For instance, chatrooms implement the Group interface. Contacts in the * chatroom are members, and contacts who we've invited to the group, or * contacts who've requested permission to join, are remote pending. If the * local user has been invited by another contact, they will appear in the * local-pending set until they accept or decline the invitation. * * Some Group channels also have the Conference interface, representing a * group which can be initiated by upgrading or merging one or more 1-1 * channels. */ /** * SECTION:channel-room * @title: Room-related interfaces on Channels * @short_description: client-side wrappers for Room, RoomConfig and Subject * * This family of interfaces exposes aspects of chat rooms' configuration, and * provides API to modify it (where permitted). Most of the API is in terms of * D-Bus properties; they may be retrieved using * tp_cli_dbus_properties_call_get_all(), and changes monitored using * tp_cli_dbus_properties_connect_to_properties_changed(). * * #TP_IFACE_CHANNEL_INTERFACE_ROOM consists only of a pair of requestable, * immutable properties: #TP_PROP_CHANNEL_INTERFACE_ROOM_ROOM_NAME and * #TP_PROP_CHANNEL_INTERFACE_ROOM_SERVER. * * In addition to #TP_IFACE_CHANNEL_INTERFACE_SUBJECT's single method, it * defines a set of read-only properties: "Subject", * "Actor", "ActorHandle", "Timestamp", * and "CanSet". * * #TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG provides a vast array of properties * for other aspects of a chat room's configuration (such as the maximum number * of participants, and whether the room is password-protected). * * Since: 0.15.8 */ /** * SECTION:channel-text * @title: Text channels * @short_description: client-side wrappers for the Text channel type, and * the Chat State and Password interfaces * @see_also: channel-group, #TpChannel * * A major use for instant messaging is obviously to send messages. * Channels of type Text represent IM conversations or chat rooms. * * This section documents the auto-generated C wrappers for the Text channel * type, and also for the Chat State and Password interfaces, which are * usually used in conjunction with Text channels. */ /** * SECTION:channel-file-transfer * @title: File transfer * @short_description: client-side wrappers for the File Transfer channel type * @see_also: #TpChannel * * This section documents the auto-generated C wrappers for the File Transfer * channel type. */ /** * SECTION:channel-media * @title: Media channels * @short_description: client-side wrappers for the Streamed Media channel * type, and the Call State, DTMF and Media Signalling interfaces * @see_also: channel-group, #TpChannel * * This section documents the auto-generated C wrappers for the Streamed Media * channel type, and the DTMF and Media Signalling interfaces which are * optionally supported by channels of this type. * * Streamed Media channels represent real-time audio or video streaming, * including voice over IP, webcams, and telephony. * * Channels of type Streamed Media may support the Media Signalling interface. * If not, the connection manager is assumed to be presenting the media * streams to the user automatically (for instance, in a connection manager * like gnome-phone-manager or telepathy-snom that remotely controls a * telephone, the phone's own speaker and microphone will probably be * used directly). * * If Media Signalling is supported, the Telepathy client is responsible for * actually streaming the media, using the Media Signalling interface to * provide signalling (connection managers might implement this interface in * terms of Jingle or SDP, for instance). The Telepathy project suggests that * client authors use the Farsight library for this; the glue between Media * Signalling and Farsight is currently done in telepathy-stream-engine, an * additional D-Bus service, but it will be provided as a library in future. * * Channels of type Streamed Media may also support the DTMF and * CallState interfaces. */ /** * SECTION:channel-tubes * @title: Tubes channels * @short_description: client-side wrappers for the Tubes channel type * @see_also: channel-group * * A "tube" is a mechanism for arbitrary data transfer. * This section documents the auto-generated C wrappers for the Tubes * channel type. */ /** * SECTION:channel-tube * @title: Tube channels * @short_description: client-side wrappers for the Tube channel interface, * StreamTube channel type and DBusTube channel type. * @see_also: channel-group * * A "tube" is a mechanism for arbitrary data transfer. * This section documents the auto-generated C wrappers for the Tube * channel interface, StreamTube channel type and DBusTube channel type. */ /** * SECTION:channel-roomlist * @title: Room List channels * @short_description: client-side wrappers for the Room List channel type * @see_also: #TpChannel * * Many instant messaging protocols allow named chatrooms to be listed. * This section documents the auto-generated C wrappers for the Room List * channel type. */ /** * SECTION:connection-avatars * @title: Connection Avatars interface * @short_description: client-side wrappers for the Avatars interface * @see_also: #TpConnection * * Most instant messaging protocols allow users to set an icon or avatar. * This section documents the auto-generated C wrappers for the Avatar * interface, used with #TpConnection objects. */ /** * SECTION:connection-aliasing * @title: Connection Aliasing interface * @short_description: client-side wrappers for the Aliasing interface * @see_also: #TpConnection * * Most instant messaging protocols allow users to set a nickname or * alias. This section documents the auto-generated C wrappers for the * Aliasing interface, used with #TpConnection objects. */ /** * SECTION:connection-caps * @title: Connection ContactCapabilities and Capabilities interfaces * @short_description: client-side wrappers for the capabilities interfaces * @see_also: #TpConnection * * Some instant messaging protocols allow discovery of the capabilities of * a user's client. In Telepathy, this is represented by the * ContactCapabilities interface, which lets applications advertise extra * capabilities for the local user, and query the interfaces supported by * their contacts. * * The Capabilities interface is an older API with similar functionality. * * This section documents the auto-generated C wrappers for the * ContactCapabilities and Capabilities interfaces, used with * #TpConnection objects. */ /** * SECTION:connection-contacts * @title: Connection Contacts interface * @short_description: client-side wrappers for the Contacts interface * @see_also: #TpConnection * * This interface allows a client to get information from various connection * interfaces in one dbus call. * * This section documents the auto-generated C wrappers for the * Contacts interface, used with #TpConnection objects. */ /** * SECTION:connection-contact-list * @title: Connection ContactList, ContactGroups and ContactBlocking interfaces * @short_description: client-side wrappers for the ContactList, * ContactGroups and ContactBlocking interfaces * @see_also: #TpConnection * * This interface allows a client to obtain a server-stored contact list * and contacts' groups. * * This section documents the auto-generated C wrappers for the * ContactList, ContactGroups and ContactBlocking interfaces, used * with #TpConnection objects. */ /** * SECTION:connection-requests * @title: Connection Requests interface * @short_description: client-side wrappers for the Requests interface * @see_also: #TpConnection * * This interface allows a client to request new channels from a connection, * and to listen to signals indicating that channels have been created and * closed. * * This section documents the auto-generated C wrappers for the Requests * interface, used with #TpConnection objects. */ /** * SECTION:connection-simple-presence * @title: Connection SimplePresence interface * @short_description: client-side wrappers for the SimplePresence interface * @see_also: #TpConnection * * Most instant messaging protocols allow users to advertise their presence * status. In Telepathy, this is represented by the SimplePresence * interface, which lets applications advertise the presence status of the * local user, and query the presence status of their contacts. * * This section documents the auto-generated C wrappers for the * SimplePresence interface, used with #TpConnection objects. */ /** * SECTION:connection-presence * @title: Connection Presence interface * @short_description: client-side wrappers for the Presence interface * @see_also: #TpConnection * * Most instant messaging protocols allow users to advertise their presence * status. In Telepathy, this is represented by the Presence * interface, which lets applications advertise the presence status of the * local user, and query the presence status of their contacts. * * This section documents the auto-generated C wrappers for the * Presence interface, used with #TpConnection objects. */ /** * SECTION:connection-location * @title: Connection Location interface * @short_description: client-side wrappers for the Location interface * @see_also: #TpConnection * * Some instant messaging protocols support "rich presence" functionality, * such as geolocation (advertising the user's location to authorized * contacts, and receiving contacts' locations). * * This section documents the auto-generated C wrappers for the * Location interface, used with #TpConnection objects. */ /** * SECTION:connection-balance * @title: Connection Balance interface * @short_description: client-side wrappers for the Balance interface * @see_also: #TpConnection * * In some real-time communication services the user can pay for certain * services, typically calls to the PSTN, in advance. In (at least) Skype, * it's possible to query the current balance in a machine-readable way. * * This section documents the auto-generated C wrappers for the * Balance interface, used with #TpConnection objects. * * Since: 0.11.0 */ /** * SECTION:connection-contact-info * @title: Connection ContactInfo interface * @short_description: client-side wrappers for the ContactInfo interface * @see_also: #TpConnection * * An interface for requesting information about a contact on a given * connection. The information is represented as a list of fields forming a * structured representation of a vCard (as defined by RFC 2426), using field * names and semantics defined therein. * * This section documents the auto-generated C wrappers for the * ContactInfo interface, used with #TpConnection objects. * * Since: 0.11.3 */ /** * SECTION:cli-anonymity * @title: Connection and Channel Anonymity interfaces * @short_description: client-side wrappers for the Anonymity interfaces * @see_also: #TpConnection, #TpChannel * * In some protocols, mainly those that interact with the PSTN, it's possible * to make a call without disclosing the originating identity (e.g. phone * number). The Anonymity interfaces on the Connection and Channel can be used * to control this feature in Telepathy. * * This section documents the auto-generated C wrappers for the * Anonymity interfaces, used with #TpConnection and #TpChannel objects. * * Since: 0.11.7 */ /** * SECTION:svc-anonymity * @title: Service-side Connection and Channel Anonymity interfaces * @short_description: GInterfaces to implement the Anonymity interfaces * * In some protocols, mainly those that interact with the PSTN, it's possible * to make a call without disclosing the originating identity (e.g. phone * number). The Anonymity interfaces on the Connection and Channel can be used * to control this feature in Telepathy. * * This section documents the auto-generated GInterfaces used to implement the * Anonymity interfaces. * * Since: 0.11.7 */ /** * SECTION:cli-service-point * @title: Connection and Channel ServicePoint interfaces * @short_description: client-side wrappers for the ServicePoint interfaces * @see_also: #TpConnection, #TpChannel * * In some protocols, mainly those that interact with the PSTN, it's possible * to contact the emergency services or other public service answering points. * The ServicePoint interfaces on the Connection and Channel can be used * to discover how to contact these service points, and detect whether a call * in progress is communicating with a service point. * * This section documents the auto-generated C wrappers for the * ServicePoint interfaces, used with #TpConnection and #TpChannel objects. * * Since: 0.11.7 */ /** * SECTION:svc-service-point * @title: Service-side Connection and Channel ServicePoint interfaces * @short_description: GInterfaces to implement the ServicePoint interfaces * * In some protocols, mainly those that interact with the PSTN, it's possible * to contact the emergency services or other public service answering points. * The ServicePoint interfaces on the Connection and Channel can be used * to discover how to contact these service points, and detect whether a call * in progress is communicating with a service point. * * This section documents the auto-generated GInterfaces used to implement the * ServicePoint interfaces. * * Since: 0.11.7 */ /** * SECTION:connection-cellular * @title: Connection Cellular interface * @short_description: client-side wrappers for the Cellular interface * @see_also: #TpConnection * * An interface for connections to cellular telephony (GSM, CDMA etc.), which * provides properties and signals that aren't applicable to other protocols. * * Since: 0.11.9 */ /** * SECTION:svc-protocol * @title: Service-side Protocol interface * @short_description: GInterface for Telepathy Protocol objects * @see_also: #TpBaseProtocol * * The #TpSvcProtocol interface (auto-generated from the Telepathy * spec) makes it easier to export an object implementing the Telepathy * Protocol interface. * * Since: 0.11.11 */ /** * SECTION:channel-contactsearch * @title: Contact Search channels * @short_description: client-side wrappers for the Contact Search channel type * @see_also: #TpChannel * * Some instant messaging protocols allow searching for contacts by name or * other details. In Telepathy, each search attempt is represented as a * Channel. * * This section documents the auto-generated C wrappers for the Contact Search * channel type. * * Since: 0.11.11 */ /** * SECTION:svc-channel-contactsearch * @title: Contact Search channels * @short_description: service-side interface for the Contact Search channel * type * * Some instant messaging protocols allow searching for contacts by name or * other details. In Telepathy, each search attempt is represented as a * Channel. * * This section documents the auto-generated C wrappers for the Contact Search * channel type. * * Since: 0.11.11 */ /** * SECTION:svc-tls * @title: Service-side TLS interfaces * @short_description: GInterfaces to implement Chan.T.ServerTLSConnection * * Channel.Type.ServerTLSConnection can be handled by clients to check * servers' TLS certificates interactively. The actual certificates are * represented by a separate TLSCertificate object. * * Since: 0.11.16 */ /** * SECTION:connection-client-types * @title: Connection ClientTypes interface * @short_description: client-side wrappers for the ClientTypes interface * * On some protocols it's possible to determine the type of client another * user is using, ranging from a simple "phone or not?" indicator to a * classification into several types of user interface. Telepathy represents * these using the client types defined by XMPP. * * This section documents the auto-generated C wrappers for the * ClientTypes interface, used with #TpConnection objects. * * Since: 0.13.1 */ /** * SECTION:connection-mail * @title: Connection MailNotification interface * @short_description: client-side wrappers for the MailNotification interface * * Some service providers offer both real-time communications and e-mail, and * integrate them by providing "new mail" notifications over the real-time * communication protocol. * * This section documents the auto-generated C wrappers for the * MailNotification interface, used with #TpConnection objects. * * Since: 0.13.1 */ /** * SECTION:connection-powersaving * @title: Connection PowerSaving interface * @short_description: client-side wrappers for the PowerSaving interface * * Some connection manager implementations can be instructed to try to * save power on mobile devices by suppressing non-essential traffic, such * as presence notifications. This section documents auto-generated C * wrappers for the PowerSaving D-Bus interface. * * Since: 0.13.7 */ /** * SECTION:channel-auth * @title: Channel Authentication interfaces * @short_description: client-side wrappers for authentication channels * * The ServerAuthentication channel type represents a request for client/UI * processes to carry out authentication with a server, including password * authentication (prove that you are who you say you are) and captcha * authentication (prove that you are not a bot). * * Since: 0.13.7 */ /** * SECTION:svc-channel-auth * @title: Service-side Channel Authentication interfaces * @short_description: GInterfaces to implement authentication channels * * The ServerAuthentication channel type represents a request for client/UI * processes to carry out authentication with a server. * * The SASLAuthentication interface allows authentication via SASL, and also * allows providing a simple password to the connection manager for it to * use with SASL or non-SASL mechanisms. * * The CaptchaAuthentication interface (since 0.17.5) allows * interactive captcha-solving so that the user can prove that they are not * a bot, on protocols requiring this. * * Since: 0.13.7 */ /** * SECTION:svc-channel-securable * @title: Service-side Securable interface * @short_description: GInterface to indicate channels' security level * * The Securable channel interface represents a channel that might be * end-to-end encrypted and/or protected from man-in-the-middle attacks. * * Since: 0.13.7 */ /** * SECTION:svc-channel-ft-metadata * @title: File transfer Metadata interface * @short_description: GInterface to implement metadata file transfer interface * * The Metadata file transfer channel interface exists to provide a * mechanism to include arbitrary additional information in file * transfers. For example, one might want to send a document and * include the number of times the character P appeared in the file, * so would add NumberOfPs=42 to the Metadata property. * * Since: 0.17.1 */ /** * SECTION:connection-addressing * @title: Connection Addressing interface * @short_description: client-side wrappers for the Addressing interface * @see_also: #TpConnection * * An interface for connections in protocols where contacts' unique * identifiers can be expressed as vCard fields and/or URIs. * * Since: 0.17.5 */ /** * SECTION:svc-channel-call * @title: Service-side Channel Call interface * @short_description: GInterface to implement call channels * * Call channels represent real-time audio or video streaming, including * voice over IP, webcams, and telephony. * * Since: 0.17.5 */ /** * SECTION:cli-call-channel * @title: Channel Call interfaces * @short_description: client-side wrappers for call channels * * Call channels represent real-time audio or video streaming, including * voice over IP, webcams, and telephony. * * Since: 0.17.5 */ /** * SECTION:cli-call-content * @title: Channel Call content interfaces * @short_description: client-side wrappers for call contents * * Represents the contents of a call. * * Since: 0.17.5 */ /** * SECTION:cli-call-stream * @title: Channel Call stream interfaces * @short_description: client-side wrappers for call streams * * Represents the streams of a call. * * Since: 0.17.5 */ /** * SECTION:cli-call-misc * @title: Channel Call misc interfaces * @short_description: client-side wrappers for misc call interfaces * * Misc interfaces for calls. * * Since: 0.17.5 */ /** * SECTION:connection-renaming * @title: Connection Renaming interface * @short_description: client-side wrappers for the Renaming interface * @see_also: #TpConnection * * In IRC, and perhaps other protocols, users' unique identifiers can change. * The Renaming interface models this. */ /** * SECTION:connection-sidecars * @title: Connection Sidecars interface * @short_description: client-side wrappers for the Sidecars interface * @see_also: #TpConnection * * Some Telepathy connection managers have a plugin API, with plugins * providing plugin-specific channel types and other D-Bus APIs. It is * technically difficult for plugins to add interfaces analogous to Aliasing, * Avatars etc. to a Connection. The Sidecars1 interface provides an * alternative, by attaching plugin-provided interfaces to a secondary object. */ telepathy-glib-0.24.2/telepathy-glib/run.c0000644000175000017500000002026012652510705015317 00000000000000/* * run.c - entry point for telepathy-glib connection managers * Copyright (C) 2005, 2007 Collabora Ltd. * Copyright (C) 2005, 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:run * @title: Connection manager life cycle * @short_description: entry point for telepathy-glib connection managers * * tp_run_connection_manager() provides a convenient entry point for * telepathy-glib connection managers. It initializes most of the * functionality the CM will need, constructs a connection manager object * and lets it run. * * This function also manages the connection manager's lifetime - if there * are no new connections for a while, it times out and exits. */ #include "config.h" #include #include #include #include #include #ifdef HAVE_UNISTD_H #include #endif #define DEBUG_FLAG TP_DEBUG_MANAGER #include "debug-internal.h" #include #include #include #include #include #ifdef HAVE_EXECINFO_H #include #endif /* HAVE_EXECINFO_H */ #ifdef HAVE_SIGNAL_H #include #endif /* HAVE_SIGNAL_H */ static GMainLoop *mainloop = NULL; static TpBaseConnectionManager *manager = NULL; static gboolean connections_exist = FALSE; static guint timeout_id = 0; static void quit_loop (void) { g_object_unref (manager); manager = NULL; g_main_loop_quit (mainloop); } static gboolean kill_connection_manager (gpointer data) { if (!_TP_DEBUG_IS_PERSISTENT && !connections_exist) { g_debug ("no connections, and timed out"); quit_loop (); } timeout_id = 0; return G_SOURCE_REMOVE; } static void new_connection (TpBaseConnectionManager *conn, gchar *bus_name, gchar *object_path, gchar *proto) { connections_exist = TRUE; if (0 != timeout_id) { g_source_remove (timeout_id); timeout_id = 0; } } #define DIE_TIME 5000 static void no_more_connections (TpBaseConnectionManager *conn) { connections_exist = FALSE; if (0 != timeout_id) { g_source_remove (timeout_id); } timeout_id = g_timeout_add (DIE_TIME, kill_connection_manager, NULL); } #ifdef ENABLE_BACKTRACE static void print_backtrace (void) { #if defined (HAVE_BACKTRACE) && defined (HAVE_BACKTRACE_SYMBOLS_FD) void *array[20]; size_t size; #define MSG "\n########## Backtrace (version " VERSION ") ##########\n" write (STDERR_FILENO, MSG, strlen (MSG)); #undef MSG size = backtrace (array, 20); backtrace_symbols_fd (array, size, STDERR_FILENO); #endif /* HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS_FD */ } static void critical_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { g_log_default_handler (log_domain, log_level, message, user_data); print_backtrace (); } #ifdef HAVE_SIGNAL static void segv_handler (int sig) { #define MSG "caught SIGSEGV\n" write (STDERR_FILENO, MSG, strlen (MSG)); #undef MSG print_backtrace (); abort (); } #endif /* HAVE_SIGNAL */ #endif /* ENABLE_BACKTRACE */ static void add_signal_handlers (void) { #if defined (HAVE_SIGNAL) && defined (ENABLE_BACKTRACE) signal (SIGSEGV, segv_handler); #endif /* HAVE_SIGNAL && ENABLE_BACKTRACE */ } static DBusHandlerResult dbus_filter_function (DBusConnection *connection, DBusMessage *message, void *user_data) { if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") && !tp_strdiff (dbus_message_get_path (message), DBUS_PATH_LOCAL)) { g_message ("Got disconnected from the session bus"); quit_loop (); } return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } /** * tp_run_connection_manager: * @prog_name: The program name to be used in debug messages etc. * @version: The program version * @construct_cm: A function which will return the connection manager * object * @argc: The number of arguments passed to the program * @argv: The arguments passed to the program * * Run the connection manager by initializing libraries, constructing * a main loop, instantiating a connection manager and running the main * loop. When this function returns, the program should exit. * * If the connection manager does not create a connection within a * short arbitrary time (currently 5 seconds), either on startup or after * the last open connection is disconnected, and the PERSIST debug * flag is not set, return 0. * * If registering the connection manager on D-Bus fails, return 1. * * Returns: the status code with which the process should exit */ int tp_run_connection_manager (const char *prog_name, const char *version, TpBaseConnectionManager *(*construct_cm) (void), int argc, char **argv) { DBusConnection *connection = NULL; TpDBusDaemon *bus_daemon = NULL; GError *error = NULL; int ret = 1; add_signal_handlers (); g_set_prgname (prog_name); #ifdef ENABLE_BACKTRACE g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, critical_handler, NULL); g_log_set_handler ("GLib", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, critical_handler, NULL); g_log_set_handler ("tp-glib", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, critical_handler, NULL); g_log_set_handler (NULL, G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION, critical_handler, NULL); #endif /* ENABLE_BACKTRACE */ mainloop = g_main_loop_new (NULL, FALSE); bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) { WARNING ("%s", error->message); g_error_free (error); error = NULL; goto out; } manager = construct_cm (); g_signal_connect (manager, "new-connection", (GCallback) new_connection, NULL); g_signal_connect (manager, "no-more-connections", (GCallback) no_more_connections, NULL); /* It appears that dbus-glib registers a filter that wrongly returns * DBUS_HANDLER_RESULT_HANDLED for signals, so for *our* filter to have any * effect, we need to install it before calling * tp_base_connection_manager_register () */ connection = dbus_g_connection_get_connection ( ((TpProxy *) bus_daemon)->dbus_connection); dbus_connection_add_filter (connection, dbus_filter_function, NULL, NULL); dbus_connection_set_exit_on_disconnect (connection, FALSE); if (!tp_base_connection_manager_register (manager)) { g_object_unref (manager); manager = NULL; goto out; } g_debug ("started version %s (telepathy-glib version %s)", version, VERSION); timeout_id = g_timeout_add (DIE_TIME, kill_connection_manager, NULL); g_main_loop_run (mainloop); g_message ("Exiting"); ret = 0; out: /* locals */ if (connection != NULL) dbus_connection_remove_filter (connection, dbus_filter_function, NULL); if (bus_daemon != NULL) g_object_unref (bus_daemon); /* globals */ if (timeout_id != 0) g_source_remove (timeout_id); if (mainloop != NULL) g_main_loop_unref (mainloop); mainloop = NULL; g_assert (manager == NULL); return ret; } telepathy-glib-0.24.2/telepathy-glib/run.h0000644000175000017500000000256712652510705015336 00000000000000/* * run.h - entry point for telepathy-glib connection managers * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_RUN_H__ #define __TP_RUN_H__ #include G_BEGIN_DECLS int tp_run_connection_manager (const char *prog_name, const char *version, TpBaseConnectionManager *(*construct_cm) (void), int argc, char **argv); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/account-manager.c0000644000175000017500000013531112652510705017563 00000000000000/* * account-manager.c - proxy for the Telepathy account manager * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/account-manager-internal.h" #include "telepathy-glib/account-internal.h" #include #include #include #include #include #include #include "telepathy-glib/account-manager.h" #define DEBUG_FLAG TP_DEBUG_ACCOUNTS #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/_gen/tp-cli-account-manager-body.h" /** * SECTION:account-manager * @title: TpAccountManager * @short_description: proxy object for the Telepathy account manager * @see_also: #TpAccount * * The #TpAccountManager object is used to communicate with the Telepathy * AccountManager service. * * A new #TpAccountManager object can be created with * tp_account_manager_dup(). * * To list the existing valid accounts, the client should first * prepare the %TP_ACCOUNT_MANAGER_FEATURE_CORE feature using * tp_proxy_prepare_async(), then call * tp_account_manager_dup_valid_accounts(). * * The #TpAccountManager::account-validity-changed signal is emitted * to notify of the validity of an account changing. New accounts are * also indicated by the emission of this signal on an account that * did not previously exist. (The rationale behind indicating new * accounts by an account validity change signal is that clients * interested in this kind of thing should be connected to this signal * anyway: an account having just become valid is effectively a new * account to a client.) * * The #TpAccountManager::account-removed signal is emitted when * existing accounts are removed. * * Since: 0.7.32 */ /** * TpAccountManager: * * The Telepathy Account Manager stores real-time communication accounts and * their configuration, places accounts online on request, and manipulates * accounts' presence, nicknames and avatars. * * #TpAccountManager is the "top level" object. Since 0.16 it always has a * non-%NULL #TpProxy:factory, and its #TpProxy:factory will be * propagated to all other objects like #TpAccountManager -> #TpAccount -> * #TpConnection -> #TpContact and #TpChannel. This means that desired features * set on that factory will be prepared on all those objects. * If a #TpProxy:factory is not specified when the #TpAccountManager is * constructed, it will use a #TpAutomaticClientFactory. * * TpAccountManager exampleFIXME: MISSING XINCLUDE CONTENT * * Since: 0.7.32 */ /** * TpAccountManagerClass: * * The class of a #TpAccount. */ struct _TpAccountManagerPrivate { /* (owned) object path -> (reffed) TpAccount */ GHashTable *accounts; GHashTable *legacy_accounts; gboolean dispose_run; /* most available presence */ TpAccount *most_available_account; TpConnectionPresenceType most_available_presence; gchar *most_available_status; gchar *most_available_status_message; /* requested presence, could be different * from the actual one. */ TpConnectionPresenceType requested_presence; gchar *requested_status; gchar *requested_status_message; guint n_preparing_accounts; }; typedef struct { GQuark name; gboolean ready; } TpAccountManagerFeature; typedef struct { GSimpleAsyncResult *result; GArray *features; } TpAccountManagerFeatureCallback; #define MC5_BUS_NAME "org.freedesktop.Telepathy.MissionControl5" enum { ACCOUNT_VALIDITY_CHANGED, ACCOUNT_REMOVED, ACCOUNT_ENABLED, ACCOUNT_DISABLED, MOST_AVAILABLE_PRESENCE_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; G_DEFINE_TYPE (TpAccountManager, tp_account_manager, TP_TYPE_PROXY) /** * TP_ACCOUNT_MANAGER_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpAccountManager. * * When this feature is prepared, the list of accounts have been retrieved and * are available for use, and change-notification has been set up. * Additionally, since 0.16 the #TpAccount objects returned by * tp_account_manager_dup_valid_accounts() have their * features prepared as configured by the #TpProxy:factory; in particular, * they will all have %TP_ACCOUNT_FEATURE_CORE. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.9.0 */ /** * tp_account_manager_get_feature_quark_core: * * * * Returns: the quark used for representing the core feature of a * #TpAccountManager * * Since: 0.9.0 */ GQuark tp_account_manager_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-account-manager-feature-core"); } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * _tp_account_manager_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_UNLIKELY (features[0].name == 0)) { features[FEAT_CORE].name = TP_ACCOUNT_MANAGER_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* no need for a prepare_async function - the constructor starts it */ /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); } return features; } static void tp_account_manager_init (TpAccountManager *self) { TpAccountManagerPrivate *priv; priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ACCOUNT_MANAGER, TpAccountManagerPrivate); self->priv = priv; priv->most_available_presence = TP_CONNECTION_PRESENCE_TYPE_UNSET; priv->accounts = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_object_unref); self->priv->legacy_accounts = g_hash_table_new_full ( g_str_hash, g_str_equal, g_free, g_object_unref); } static void _tp_account_manager_start_mc5 (TpDBusDaemon *bus) { TpProxy *mc5_proxy; /* trigger MC5 starting */ mc5_proxy = g_object_new (TP_TYPE_PROXY, "dbus-daemon", bus, "dbus-connection", tp_proxy_get_dbus_connection (TP_PROXY (bus)), "bus-name", MC5_BUS_NAME, "object-path", "/", NULL); tp_cli_dbus_peer_call_ping (mc5_proxy, -1, NULL, NULL, NULL, NULL); g_object_unref (mc5_proxy); } static void _tp_account_manager_name_owner_cb (TpDBusDaemon *proxy, const gchar *name, const gchar *new_owner, gpointer user_data) { DEBUG ("Name owner changed for %s, new name: %s", name, new_owner); if (tp_str_empty (new_owner)) { /* MC5 quit or crashed for some reason, let's start it again */ _tp_account_manager_start_mc5 (proxy); return; } } static void insert_account (TpAccountManager *self, TpAccount *account); static void validity_changed_account_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpAccountManager *self = user_data; TpAccount *account = (TpAccount *) object; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { DEBUG ("Error preparing account: %s", error->message); g_clear_error (&error); goto OUT; } /* Account could have been invalidated while we were preparing it */ if (tp_account_is_valid (account) && tp_proxy_get_invalidated (account) == NULL) { insert_account (self, account); g_signal_emit (self, signals[ACCOUNT_VALIDITY_CHANGED], 0, account, TRUE); } OUT: g_object_unref (self); } static void _tp_account_manager_validity_changed_cb (TpAccountManager *proxy, const gchar *path, gboolean valid, gpointer user_data, GObject *weak_object) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (weak_object); TpAccountManagerPrivate *priv = manager->priv; TpAccount *account; GArray *features; GError *error = NULL; if (!valid) { /* If account became invalid, but we didn't have it anyway, ignore. */ account = g_hash_table_lookup (priv->accounts, path); if (account == NULL) return; g_object_ref (account); g_hash_table_remove (priv->accounts, path); g_signal_emit (manager, signals[ACCOUNT_VALIDITY_CHANGED], 0, account, FALSE); g_object_unref (account); return; } account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (manager), path, NULL, &error); if (account == NULL) { DEBUG ("failed to create TpAccount: %s", error->message); g_clear_error (&error); return; } /* Delay signal emission until until account is prepared */ features = tp_simple_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); tp_proxy_prepare_async (account, (GQuark *) features->data, validity_changed_account_prepared_cb, g_object_ref (manager)); g_array_unref (features); g_object_unref (account); } static void _tp_account_manager_update_most_available_presence (TpAccountManager *manager) { TpAccountManagerPrivate *priv = manager->priv; TpConnectionPresenceType presence = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; TpAccount *account = NULL; GHashTableIter iter; gpointer value; TpAccount *has_unset_presence = NULL; /* this presence is equal to the presence of the account with the * highest availability */ g_hash_table_iter_init (&iter, priv->accounts); while (g_hash_table_iter_next (&iter, NULL, &value)) { TpAccount *a = TP_ACCOUNT (value); TpConnectionPresenceType p; p = tp_account_get_current_presence (a, NULL, NULL); if (p == TP_CONNECTION_PRESENCE_TYPE_UNSET) { has_unset_presence = a; /* There is no point comparing the presence as UNSET is the * 'smallest' presence of all */ continue; } if (tp_connection_presence_type_cmp_availability (p, presence) > 0) { account = a; presence = p; } } if (presence == TP_CONNECTION_PRESENCE_TYPE_OFFLINE && has_unset_presence != NULL) { /* Use an account having UNSET as presence as the 'best' one, * see tp_account_manager_get_most_available_presence() */ account = has_unset_presence; } priv->most_available_account = account; g_free (priv->most_available_status); g_free (priv->most_available_status_message); if (account == NULL) { priv->most_available_presence = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; priv->most_available_status = g_strdup ("offline"); priv->most_available_status_message = g_strdup (""); return; } priv->most_available_presence = tp_account_get_current_presence (account, &(priv->most_available_status), &(priv->most_available_status_message)); DEBUG ("Updated most available presence to: %s (%d) \"%s\"", priv->most_available_status, priv->most_available_presence, priv->most_available_status_message); } static void _tp_account_manager_check_core_ready (TpAccountManager *manager) { TpAccountManagerPrivate *priv = manager->priv; DEBUG ("manager has %d accounts left to prepare", priv->n_preparing_accounts); if (tp_proxy_is_prepared (manager, TP_ACCOUNT_MANAGER_FEATURE_CORE)) return; if (priv->n_preparing_accounts > 0) return; /* Rerequest most available presence on the initial set of accounts for cases * where a most available presence was requested before the manager was ready */ if (priv->requested_presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) { tp_account_manager_set_all_requested_presences (manager, priv->requested_presence, priv->requested_status, priv->requested_status_message); } _tp_account_manager_update_most_available_presence (manager); _tp_proxy_set_feature_prepared ((TpProxy *) manager, TP_ACCOUNT_MANAGER_FEATURE_CORE, TRUE); } static void account_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpAccountManager *self = user_data; TpAccount *account = (TpAccount *) object; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { DEBUG ("Error preparing account: %s", error->message); g_clear_error (&error); goto OUT; } /* Account could have been invalidated while we were preparing it */ if (tp_account_is_valid (account) && tp_proxy_get_invalidated (account) == NULL) { insert_account (self, account); } DEBUG ("Account %s was prepared", tp_proxy_get_object_path (object)); OUT: self->priv->n_preparing_accounts--; _tp_account_manager_check_core_ready (self); g_object_unref (self); } static void _tp_account_manager_got_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (weak_object); GPtrArray *valid_accounts; guint i; if (error != NULL) { DEBUG ("Failed to get account manager properties: %s", error->message); tp_proxy_invalidate (proxy, error); return; } valid_accounts = tp_asv_get_boxed (properties, "ValidAccounts", TP_ARRAY_TYPE_OBJECT_PATH_LIST); for (i = 0; i < valid_accounts->len; i++) { const gchar *path = g_ptr_array_index (valid_accounts, i); TpAccount *account; GArray *features; GError *e = NULL; account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (manager), path, NULL, &e); if (account == NULL) { DEBUG ("failed to create TpAccount: %s", e->message); g_clear_error (&e); continue; } features = tp_simple_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); manager->priv->n_preparing_accounts++; tp_proxy_prepare_async (account, (GQuark *) features->data, account_prepared_cb, g_object_ref (manager)); g_array_unref (features); g_object_unref (account); } _tp_account_manager_check_core_ready (manager); } static void _tp_account_manager_constructed (GObject *object) { TpAccountManager *self = TP_ACCOUNT_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_account_manager_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); _tp_proxy_ensure_factory (self, NULL); tp_cli_account_manager_connect_to_account_validity_changed (self, _tp_account_manager_validity_changed_cb, NULL, NULL, G_OBJECT (self), NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_ACCOUNT_MANAGER, _tp_account_manager_got_all_cb, NULL, NULL, G_OBJECT (self)); } static void _tp_account_manager_finalize (GObject *object) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (object); TpAccountManagerPrivate *priv = manager->priv; g_free (priv->most_available_status); g_free (priv->most_available_status_message); g_free (priv->requested_status); g_free (priv->requested_status_message); G_OBJECT_CLASS (tp_account_manager_parent_class)->finalize (object); } static void legacy_account_invalidated_cb (TpProxy *account, guint domain, gint code, gchar *message, gpointer user_data); static void _tp_account_manager_dispose (GObject *object) { TpAccountManager *self = TP_ACCOUNT_MANAGER (object); TpAccountManagerPrivate *priv = self->priv; GHashTableIter iter; gpointer value; if (priv->dispose_run) return; priv->dispose_run = TRUE; g_hash_table_unref (priv->accounts); g_hash_table_iter_init (&iter, self->priv->legacy_accounts); while (g_hash_table_iter_next (&iter, NULL, &value)) { g_signal_handlers_disconnect_by_func (value, legacy_account_invalidated_cb, self); } tp_clear_pointer (&priv->legacy_accounts, g_hash_table_unref); tp_dbus_daemon_cancel_name_owner_watch (tp_proxy_get_dbus_daemon (self), TP_ACCOUNT_MANAGER_BUS_NAME, _tp_account_manager_name_owner_cb, self); G_OBJECT_CLASS (tp_account_manager_parent_class)->dispose (object); } static void tp_account_manager_class_init (TpAccountManagerClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpAccountManagerPrivate)); object_class->constructed = _tp_account_manager_constructed; object_class->finalize = _tp_account_manager_finalize; object_class->dispose = _tp_account_manager_dispose; proxy_class->interface = TP_IFACE_QUARK_ACCOUNT_MANAGER; proxy_class->list_features = _tp_account_manager_list_features; tp_account_manager_init_known_interfaces (); /** * TpAccountManager::account-validity-changed: * @manager: a #TpAccountManager * @account: a #TpAccount * @valid: %TRUE if the account is now valid * * Emitted when the validity on @account changes. * * This signal is also used to indicate a new account that did not * previously exist has been added (with @valid set to %TRUE). * * If @valid is %TRUE, * @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along * with all the features previously passed to the #TpProxy:factory's * tp_simple_client_factory_add_account_features(). * * Since: 0.9.0 */ signals[ACCOUNT_VALIDITY_CHANGED] = g_signal_new ("account-validity-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_TYPE_ACCOUNT, G_TYPE_BOOLEAN); /** * TpAccountManager::account-removed: * @manager: a #TpAccountManager * @account: a #TpAccount * * Emitted when an account is removed from @manager. * * Since: 0.9.0 */ signals[ACCOUNT_REMOVED] = g_signal_new ("account-removed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_ACCOUNT); /** * TpAccountManager::account-enabled: * @manager: a #TpAccountManager * @account: a #TpAccount * * Emitted when an account from @manager is enabled. * * @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along * with all the features previously passed to the #TpProxy:factory's * tp_simple_client_factory_add_account_features(). * * Since: 0.9.0 */ signals[ACCOUNT_ENABLED] = g_signal_new ("account-enabled", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_ACCOUNT); /** * TpAccountManager::account-disabled: * @manager: a #TpAccountManager * @account: a #TpAccount * * Emitted when an account from @manager is disabled. * * Since: 0.9.0 */ signals[ACCOUNT_DISABLED] = g_signal_new ("account-disabled", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_ACCOUNT); /** * TpAccountManager::most-available-presence-changed: * @manager: a #TpAccountManager * @presence: new presence type * @status: new status * @message: new status message * * Emitted when the most available presence on @manager changes. * * Since: 0.9.0 */ signals[MOST_AVAILABLE_PRESENCE_CHANGED] = g_signal_new ("most-available-presence-changed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, /* Presence type */ G_TYPE_STRING, /* status */ G_TYPE_STRING); /* stauts message*/ } /** * tp_account_manager_init_known_interfaces: * * Ensure that the known interfaces for TpAccountManager have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_ACCOUNT_MANAGER. * * Since: 0.7.32 */ void tp_account_manager_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_ACCOUNT_MANAGER; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_account_manager_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } static TpAccountManager * _tp_account_manager_new_internal (TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon) { return TP_ACCOUNT_MANAGER (g_object_new (TP_TYPE_ACCOUNT_MANAGER, "dbus-daemon", bus_daemon, "dbus-connection", ((TpProxy *) bus_daemon)->dbus_connection, "bus-name", TP_ACCOUNT_MANAGER_BUS_NAME, "object-path", TP_ACCOUNT_MANAGER_OBJECT_PATH, "factory", factory, NULL)); } /** * tp_account_manager_new: * @bus_daemon: Proxy for the D-Bus daemon * * Convenience function to create a new account manager proxy. The returned * #TpAccountManager is not guaranteed to be prepared on return. * Its #TpProxy:factory will be a new #TpAutomaticClientFactory for * @bus_daemon. * * Use tp_account_manager_dup() instead if you want an account manager proxy * on the starter or session bus (which is almost always the right thing for * Telepathy). * * Returns: a new reference to an account manager proxy */ TpAccountManager * tp_account_manager_new (TpDBusDaemon *bus_daemon) { g_return_val_if_fail (TP_IS_DBUS_DAEMON (bus_daemon), NULL); return _tp_account_manager_new_internal (NULL, bus_daemon); } /** * tp_account_manager_new_with_factory: * @factory: a #TpSimpleClientFactory * * Convenience function to create a new account manager proxy. The returned * #TpAccountManager is not guaranteed to be ready on return. * * Should be used only by applications having their own #TpSimpleClientFactory * subclass. Usually this should be done at application startup and followed by * a call to tp_account_manager_set_default() to ensure other libraries/plugins * will use this custom factory as well. * * Returns: a new reference to an account manager proxy */ TpAccountManager * tp_account_manager_new_with_factory (TpSimpleClientFactory *factory) { g_return_val_if_fail (TP_IS_SIMPLE_CLIENT_FACTORY (factory), NULL); return _tp_account_manager_new_internal (factory, tp_simple_client_factory_get_dbus_daemon (factory)); } static gpointer starter_account_manager_proxy = NULL; /** * tp_account_manager_set_default: * @manager: a #TpAccountManager * * Define the #TpAccountManager singleton that will be returned by * tp_account_manager_dup(). * * This function may only be called before the first call to * tp_account_manager_dup(), and may not be called more than once. Applications * which use a custom #TpSimpleClientFactory and want the default * #TpAccountManager to use that factory should call this after calling * tp_account_manager_new_with_factory(). * * Unlike tp_account_manager_dup(), this function will keep an internal * reference to @manager, so it will never be destroyed. * * Note that @manager must use the default #TpDBusDaemon as returned by * tp_dbus_daemon_dup() * * Since: 0.15.5 */ void tp_account_manager_set_default (TpAccountManager *manager) { g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); if (!_tp_dbus_daemon_is_the_shared_one (tp_proxy_get_dbus_daemon (manager))) { CRITICAL ("'manager' must use the TpDBusDaemon returned by" "tp_dbus_daemon_dup()"); g_return_if_reached (); } if (starter_account_manager_proxy != NULL) { CRITICAL ("tp_account_manager_set_default() may only be called once and" "before first call of tp_account_manager_dup()"); g_return_if_reached (); } starter_account_manager_proxy = g_object_ref (manager); } /** * tp_account_manager_can_set_default: * * Check if tp_account_manager_set_default() has already successfully been * called. * * Returns: %TRUE if tp_account_manager_set_default() has already successfully * been called in this process, %FALSE otherwise. * * Since: 0.19.6 */ gboolean tp_account_manager_can_set_default (void) { return starter_account_manager_proxy == NULL; } /** * tp_account_manager_dup: * * Returns an account manager proxy on the D-Bus daemon on which this * process was activated (if it was launched by D-Bus service activation), or * the session bus (otherwise). This account manager will always have * the result of tp_dbus_daemon_dup() as its #TpProxy:dbus-daemon. * * The returned #TpAccountManager is cached; the same #TpAccountManager object * will be returned by this function repeatedly, as long as at least one * reference exists. Note that the returned #TpAccountManager is not guaranteed * to be ready on return. * * If tp_account_manager_set_default() has been called successfully, * that #TpAccountManager will be returned. Otherwise, a new #TpAccountManager * will be created the first time this function is called, using a new * #TpAutomaticClientFactory as its #TpProxy:factory. * * Returns: (transfer full): an account manager proxy on the starter or session * bus, or %NULL if it wasn't possible to get a dbus daemon proxy for * the appropriate bus * * Since: 0.9.0 */ TpAccountManager * tp_account_manager_dup (void) { TpDBusDaemon *dbus; GError *error = NULL; if (starter_account_manager_proxy != NULL) return g_object_ref (starter_account_manager_proxy); dbus = tp_dbus_daemon_dup (&error); if (dbus == NULL) { WARNING ("Error getting default TpDBusDaemon: %s", error->message); g_clear_error (&error); return NULL; } starter_account_manager_proxy = tp_account_manager_new (dbus); g_assert (starter_account_manager_proxy != NULL); g_object_add_weak_pointer (starter_account_manager_proxy, &starter_account_manager_proxy); g_object_unref (dbus); return starter_account_manager_proxy; } static void _tp_account_manager_account_enabled_cb (TpAccount *account, GParamSpec *spec, gpointer manager) { TpAccountManager *self = TP_ACCOUNT_MANAGER (manager); if (tp_account_is_enabled (account)) g_signal_emit (self, signals[ACCOUNT_ENABLED], 0, account); else g_signal_emit (self, signals[ACCOUNT_DISABLED], 0, account); } static void _tp_account_manager_account_presence_changed_cb (TpAccount *account, TpConnectionPresenceType presence, const gchar *status, const gchar *status_message, gpointer user_data) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (user_data); TpAccountManagerPrivate *priv = manager->priv; TpConnectionPresenceType p; gchar *s; gchar *msg; if (tp_connection_presence_type_cmp_availability (presence, priv->most_available_presence) > 0) { priv->most_available_account = account; priv->most_available_presence = presence; g_free (priv->most_available_status); priv->most_available_status = g_strdup (status); g_free (priv->most_available_status_message); priv->most_available_status_message = g_strdup (status_message); goto signal; } else if (priv->most_available_account == account) { _tp_account_manager_update_most_available_presence (manager); goto signal; } return; signal: /* Use tp_account_manager_get_most_available_presence() as the effective * most available presence may differ of the one stored in * priv->most_available_presence. */ p = tp_account_manager_get_most_available_presence (manager, &s, &msg); g_signal_emit (manager, signals[MOST_AVAILABLE_PRESENCE_CHANGED], 0, p, s, msg); g_free (s); g_free (msg); } static void _tp_account_manager_account_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (user_data); TpAccountManagerPrivate *priv = manager->priv; TpAccount *account = TP_ACCOUNT (proxy); /* We only want to deal with accounts being removed here. */ if (domain != TP_DBUS_ERRORS || code != TP_DBUS_ERROR_OBJECT_REMOVED) return; g_object_ref (account); g_hash_table_remove (priv->accounts, tp_proxy_get_object_path (account)); g_signal_emit (manager, signals[ACCOUNT_REMOVED], 0, account); g_object_unref (account); } static void legacy_account_invalidated_cb (TpProxy *account, guint domain, gint code, gchar *message, gpointer user_data) { TpAccountManager *self = user_data; g_hash_table_remove (self->priv->legacy_accounts, tp_proxy_get_object_path (account)); } static void insert_account (TpAccountManager *self, TpAccount *account) { g_hash_table_insert (self->priv->accounts, g_strdup (tp_proxy_get_object_path (account)), g_object_ref (account)); /* If a global presence has been requested, set in on new accounts as well */ if (self->priv->requested_presence != TP_CONNECTION_PRESENCE_TYPE_UNSET) { tp_account_request_presence_async (account, self->priv->requested_presence, self->priv->requested_status, self->priv->requested_status_message, NULL, NULL); } tp_g_signal_connect_object (account, "notify::enabled", G_CALLBACK (_tp_account_manager_account_enabled_cb), G_OBJECT (self), 0); tp_g_signal_connect_object (account, "presence-changed", G_CALLBACK (_tp_account_manager_account_presence_changed_cb), G_OBJECT (self), 0); tp_g_signal_connect_object (account, "invalidated", G_CALLBACK (_tp_account_manager_account_invalidated_cb), G_OBJECT (self), 0); } /** * tp_account_manager_ensure_account: * @manager: a #TpAccountManager * @path: the object path for an account * * Lookup an account in the account manager @manager. If the desired account * has already been ensured then the same object will be returned, otherwise * it will create a new #TpAccount and add it to @manager. As a result, if * @manager thinks that the account doesn't exist, this will still add it to * @manager to avoid races. * * The account will be constructed via this account manager's #TpProxy:factory * (so it will be of an appropriate #TpAccount subclass if the factory * returns one), but does not necessarily have any features prepared yet. * Use tp_proxy_prepare_async() to prepare features, using * the contents of tp_simple_client_factory_dup_account_features() as a * parameter if you want to prepare the same features that would * normally be used. * * The caller must keep a ref to the returned object using g_object_ref() if * it is to be kept. * * Returns: (transfer none): a new #TpAccount at @path, or %NULL if @path is * not a valid account path. * * Since: 0.9.0 * Deprecated: New code should call tp_simple_client_factory_ensure_account() * on this object's #TpProxy:factory instead, which ensures that a new * reference is returned. */ TpAccount * tp_account_manager_ensure_account (TpAccountManager *self, const gchar *path) { TpAccount *account; GError *error = NULL; g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (self), NULL); g_return_val_if_fail (path != NULL, NULL); account = g_hash_table_lookup (self->priv->legacy_accounts, path); if (account != NULL) return account; account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, &error); if (account == NULL) { DEBUG ("failed to create account: %s", error->message); g_clear_error (&error); return NULL; } /* We don't want to insert in self->priv->accounts random accounts we * don't even know if they are valid. For compatibility we can't return a ref, * so keep them into a legacy table */ g_hash_table_insert (self->priv->legacy_accounts, g_strdup (path), account); tp_g_signal_connect_object (account, "invalidated", G_CALLBACK (legacy_account_invalidated_cb), self, 0); tp_proxy_prepare_async (account, NULL, NULL, NULL); return account; } /** * tp_account_manager_get_valid_accounts: * @manager: a #TpAccountManager * * Returns a newly allocated #GList of valid accounts in @manager. The list * must be freed with g_list_free() after used. None of the accounts in the * returned list are guaranteed to be ready. * * Note that the #TpAccounts in the returned #GList are not reffed * before returning from this function. One could ref every item in the list * like the following example: * |[ * GList *accounts; * account = tp_account_manager_get_valid_accounts (manager); * g_list_foreach (accounts, (GFunc) g_object_ref, NULL); * ]| * * The returned #TpAccounts are guaranteed to have * %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed * to tp_simple_client_factory_add_account_features() for the account * manager's #TpProxy:factory. * * The list of valid accounts returned is not guaranteed to have been retrieved * until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared * (tp_proxy_prepare_async() has returned). Until this feature has * been prepared, an empty list (%NULL) will be returned. * * Returns: (element-type TelepathyGLib.Account) (transfer container): a newly allocated #GList of valid accounts in @manager * * Since: 0.9.0 * Deprecated: Since 0.19.9. New code should use * tp_account_manager_dup_valid_accounts() instead. */ GList * tp_account_manager_get_valid_accounts (TpAccountManager *manager) { g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (manager), NULL); return g_hash_table_get_values (manager->priv->accounts); } /** * tp_account_manager_dup_valid_accounts: * @manager: a #TpAccountManager * * Returns a newly allocated #GList of reffed valid accounts in @manager. * The list must be freed with g_list_free_full() and g_object_unref() after * used. * * The returned #TpAccounts are guaranteed to have * %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed * to tp_simple_client_factory_add_account_features() for the account * manager's #TpProxy:factory. * * The list of valid accounts returned is not guaranteed to have been retrieved * until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared * (tp_proxy_prepare_async() has returned). Until this feature has * been prepared, an empty list (%NULL) will be returned. * * Returns: (element-type TelepathyGLib.Account) (transfer full): a newly * allocated #GList of reffed valid accounts in @manager * * Since: 0.19.9 */ GList * tp_account_manager_dup_valid_accounts (TpAccountManager *manager) { GList *ret; g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (manager), NULL); ret = g_hash_table_get_values (manager->priv->accounts); g_list_foreach (ret, (GFunc) g_object_ref, NULL); return ret; } /** * tp_account_manager_set_all_requested_presences: * @manager: a #TpAccountManager * @type: a presence type to request * @status: a status to request * @message: a status message to request * * Iterates through the accounts in @manager and requests the presence * (@type, @status and @message). Note that the presence requested here is * merely a request, and if might not be satisfiable. * * You can find the most available presence across all accounts by calling * tp_account_manager_get_most_available_presence(). * * Setting a requested presence on all accounts will have no effect * until tp_proxy_prepare_async() * (or the older tp_account_manager_prepare_async()) has finished. * * Since: 0.9.0 */ void tp_account_manager_set_all_requested_presences (TpAccountManager *manager, TpConnectionPresenceType type, const gchar *status, const gchar *message) { TpAccountManagerPrivate *priv; GHashTableIter iter; gpointer value; g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); priv = manager->priv; DEBUG ("request most available presence, type: %d, status: %s, message: %s", type, status, message); g_hash_table_iter_init (&iter, priv->accounts); while (g_hash_table_iter_next (&iter, NULL, &value)) { TpAccount *account = TP_ACCOUNT (value); if (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CORE)) tp_account_request_presence_async (account, type, status, message, NULL, NULL); } /* save the requested presence, to use it in case we create new accounts or * some accounts become ready. */ priv->requested_presence = type; if (tp_strdiff (priv->requested_status, status)) { g_free (priv->requested_status); priv->requested_status = g_strdup (status); } if (tp_strdiff (priv->requested_status_message, message)) { g_free (priv->requested_status_message); priv->requested_status_message = g_strdup (message); } } /** * tp_account_manager_get_most_available_presence: * @manager: a #TpAccountManager * @status: (out) (transfer full): a string to fill with the actual status * @message: (out) (transfer full): a string to fill with the actual status * message * * Gets the most available presence over all accounts in @manager. This * function does not average presences across all accounts, but it merely * finds the "most available" presence. As a result, there is a guarantee * that there exists at least one account in @manager with the returned * presence. * * If no accounts are enabled or valid the output will be * (%TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", ""). * * Since 0.17.5, if the only connected accounts does not implement * %TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, the output will be * (%TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", ""). * * The return value of this function is not guaranteed to have been retrieved * until tp_proxy_prepare_async() has finished; until then, the * value will be the same as if no accounts are enabled or valid. * * Returns: the most available presence across all accounts * * Since: 0.9.0 */ TpConnectionPresenceType tp_account_manager_get_most_available_presence (TpAccountManager *manager, gchar **status, gchar **message) { TpAccountManagerPrivate *priv; g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (manager), TP_CONNECTION_PRESENCE_TYPE_UNSET); priv = manager->priv; if (priv->most_available_presence == TP_CONNECTION_PRESENCE_TYPE_UNSET) { /* The best we have is an account having UNSET as its presence, which * means it's connected but does not implement SimplePresence; pretend * we are available. */ if (status != NULL) *status = g_strdup ("available"); if (message != NULL) *message = g_strdup (""); return TP_CONNECTION_PRESENCE_TYPE_AVAILABLE; } if (status != NULL) *status = g_strdup (priv->most_available_status); if (message != NULL) *message = g_strdup (priv->most_available_status_message); return priv->most_available_presence; } static void create_account_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { GSimpleAsyncResult *my_res = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { DEBUG ("Error preparing account: %s", error->message); g_simple_async_result_take_error (my_res, error); } g_simple_async_result_complete (my_res); g_object_unref (my_res); } static void _tp_account_manager_created_cb (TpAccountManager *proxy, const gchar *account_path, const GError *error, gpointer user_data, GObject *weak_object) { TpAccountManager *manager = TP_ACCOUNT_MANAGER (weak_object); GSimpleAsyncResult *my_res = user_data; TpAccount *account; GArray *features; GError *e = NULL; if (error != NULL) { g_simple_async_result_set_from_error (my_res, error); g_simple_async_result_complete_in_idle (my_res); return; } account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (manager), account_path, NULL, &e); if (account == NULL) { g_simple_async_result_take_error (my_res, e); g_simple_async_result_complete_in_idle (my_res); return; } /* Give account's ref to the result */ g_simple_async_result_set_op_res_gpointer (my_res, account, g_object_unref); features = tp_simple_client_factory_dup_account_features ( tp_proxy_get_factory (manager), account); tp_proxy_prepare_async (account, (GQuark *) features->data, create_account_prepared_cb, g_object_ref (my_res)); g_array_unref (features); } /** * tp_account_manager_create_account_async: * @manager: a #TpAccountManager * @connection_manager: the name of a connection manager * @protocol: the name of a protocol * @display_name: the display name for the account * @parameters: (element-type utf8 GObject.Value) (transfer none): parameters * for the new account * @properties: (element-type utf8 GObject.Value) (transfer none): properties * for the new account * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous create of an account on the account manager * @manager. When the operation is finished, @callback will be called. You can * then call tp_account_manager_create_account_finish() to get the result of * the operation. * * The #TpAccount returned by tp_account_manager_create_account_finish() * will already have %TP_ACCOUNT_FEATURE_CORE prepared, along with all * features previously passed to * tp_simple_client_factory_add_account_features() for the account * manager's #TpProxy:factory. * * It is usually better to use #TpAccountRequest instead, particularly when * using high-level language bindings. * * Since: 0.9.0 */ void tp_account_manager_create_account_async (TpAccountManager *manager, const gchar *connection_manager, const gchar *protocol, const gchar *display_name, GHashTable *parameters, GHashTable *properties, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *res; g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); g_return_if_fail (connection_manager != NULL); g_return_if_fail (protocol != NULL); g_return_if_fail (display_name != NULL); g_return_if_fail (parameters != NULL); g_return_if_fail (properties != NULL); g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); res = g_simple_async_result_new (G_OBJECT (manager), callback, user_data, tp_account_manager_create_account_finish); tp_cli_account_manager_call_create_account (manager, -1, connection_manager, protocol, display_name, parameters, properties, _tp_account_manager_created_cb, res, g_object_unref, G_OBJECT (manager)); } /** * tp_account_manager_create_account_finish: * @manager: a #TpAccountManager * @result: a #GAsyncResult * @error: a #GError to be filled * * Finishes an async create account operation, and returns a new #TpAccount * object. It has %TP_ACCOUNT_FEATURE_CORE prepared, along with all * features previously passed to * tp_simple_client_factory_add_account_features() for the account * manager's #TpProxy:factory. * * The caller must keep a ref to the returned object using g_object_ref() if * it is to be kept beyond the lifetime of @result. * * Returns: (transfer none): a new #TpAccount which was just created on * success, otherwise %NULL * * Since: 0.9.0 */ TpAccount * tp_account_manager_create_account_finish (TpAccountManager *manager, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (manager, tp_account_manager_create_account_finish, /* do not copy */); } /** * tp_account_manager_is_prepared: (skip) * @manager: a #TpAccountManager * @feature: a feature which is required * * * * Returns: the same thing as tp_proxy_is_prepared() * * Since: 0.9.0 * Deprecated: since 0.23.0, use tp_proxy_is_prepared() instead. */ gboolean tp_account_manager_is_prepared (TpAccountManager *manager, GQuark feature) { return tp_proxy_is_prepared (manager, feature); } /** * tp_account_manager_prepare_async: (skip) * @manager: a #TpAccountManager * @features: a 0-terminated list of features, or %NULL * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous preparation of @manager with * %TP_ACCOUNT_MANAGER_FEATURE_CORE, plus any features specified * by @features. When the operation is finished, @callback will be called. You * can then call tp_account_manager_prepare_finish() to get the result of the * operation. * * If %NULL is given to @callback, then no callback will be called when the * operation is finished. Instead, it will simply set @features on @manager. * Note that if @callback is %NULL, then @user_data must also be %NULL. * * In version 0.11.3 or later, this is equivalent to calling * tp_proxy_prepare_async() with the same arguments. * * Since: 0.9.0 * Deprecated: since 0.15.6, use tp_proxy_prepare_async() instead. */ void tp_account_manager_prepare_async (TpAccountManager *manager, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data) { tp_proxy_prepare_async (manager, features, callback, user_data); } /** * tp_account_manager_prepare_finish: (skip) * @manager: a #TpAccountManager * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async preparation of the account manager @manager. * * Returns: %TRUE if the preparation was successful, otherwise %FALSE * * Since: 0.9.0 * Deprecated: since 0.15.6, use tp_proxy_prepare_finish() instead. */ gboolean tp_account_manager_prepare_finish (TpAccountManager *manager, GAsyncResult *result, GError **error) { return tp_proxy_prepare_finish (manager, result, error); } /** * tp_account_manager_enable_restart: * @manager: a #TpAccountManager * * Enable autostarting the account manager D-Bus service. This means * that the account manager will be restarted if it disappears from * the bus. */ void tp_account_manager_enable_restart (TpAccountManager *manager) { g_return_if_fail (TP_IS_ACCOUNT_MANAGER (manager)); tp_dbus_daemon_watch_name_owner (tp_proxy_get_dbus_daemon (manager), TP_ACCOUNT_MANAGER_BUS_NAME, _tp_account_manager_name_owner_cb, manager, NULL); _tp_account_manager_start_mc5 (tp_proxy_get_dbus_daemon (manager)); } telepathy-glib-0.24.2/telepathy-glib/account-manager.h0000644000175000017500000001225312652510705017567 00000000000000/* * account-manager.h - proxy for the Telepathy account manager * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_ACCOUNT_MANAGER_H #define TP_ACCOUNT_MANAGER_H #include #include #include #include G_BEGIN_DECLS typedef struct _TpAccountManager TpAccountManager; typedef struct _TpAccountManagerClass TpAccountManagerClass; typedef struct _TpAccountManagerPrivate TpAccountManagerPrivate; typedef struct _TpAccountManagerClassPrivate TpAccountManagerClassPrivate; struct _TpAccountManager { /**/ TpProxy parent; TpAccountManagerPrivate *priv; }; struct _TpAccountManagerClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpAccountManagerClassPrivate *priv; }; GType tp_account_manager_get_type (void); #define TP_TYPE_ACCOUNT_MANAGER \ (tp_account_manager_get_type ()) #define TP_ACCOUNT_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT_MANAGER, \ TpAccountManager)) #define TP_ACCOUNT_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT_MANAGER, \ TpAccountManagerClass)) #define TP_IS_ACCOUNT_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT_MANAGER)) #define TP_IS_ACCOUNT_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT_MANAGER)) #define TP_ACCOUNT_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT_MANAGER, \ TpAccountManagerClass)) #define TP_ACCOUNT_MANAGER_FEATURE_CORE \ tp_account_manager_get_feature_quark_core () GQuark tp_account_manager_get_feature_quark_core (void) G_GNUC_CONST; TpAccountManager *tp_account_manager_new (TpDBusDaemon *bus_daemon) G_GNUC_WARN_UNUSED_RESULT; TpAccountManager *tp_account_manager_new_with_factory ( TpSimpleClientFactory *factory) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_16 void tp_account_manager_set_default (TpAccountManager *manager); _TP_AVAILABLE_IN_0_20 gboolean tp_account_manager_can_set_default (void); TpAccountManager *tp_account_manager_dup (void) G_GNUC_WARN_UNUSED_RESULT; void tp_account_manager_init_known_interfaces (void); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_ensure_account) TpAccount *tp_account_manager_ensure_account (TpAccountManager *manager, const gchar *path); #endif #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_account_manager_dup_valid_accounts) GList *tp_account_manager_get_valid_accounts (TpAccountManager *manager) G_GNUC_WARN_UNUSED_RESULT; #endif _TP_AVAILABLE_IN_0_20 GList *tp_account_manager_dup_valid_accounts (TpAccountManager *manager) G_GNUC_WARN_UNUSED_RESULT; void tp_account_manager_set_all_requested_presences (TpAccountManager *manager, TpConnectionPresenceType type, const gchar *status, const gchar *message); TpConnectionPresenceType tp_account_manager_get_most_available_presence ( TpAccountManager *manager, gchar **status, gchar **message); void tp_account_manager_create_account_async (TpAccountManager *manager, const gchar *connection_manager, const gchar *protocol, const gchar *display_name, GHashTable *parameters, GHashTable *properties, GAsyncReadyCallback callback, gpointer user_data); TpAccount * tp_account_manager_create_account_finish ( TpAccountManager *manager, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_24_FOR(tp_proxy_is_prepared) gboolean tp_account_manager_is_prepared (TpAccountManager *manager, GQuark feature); _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_async) void tp_account_manager_prepare_async (TpAccountManager *manager, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data); _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_finish) gboolean tp_account_manager_prepare_finish (TpAccountManager *manager, GAsyncResult *result, GError **error); #endif void tp_account_manager_enable_restart (TpAccountManager *manager); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/tls-certificate.c0000644000175000017500000006356012652510705017607 00000000000000/* * TpTLSCertificate - a TpProxy for TLS certificates * Copyright © 2010 Collabora Ltd. * * Based on EmpathyTLSCertificate: * @author Cosimo Cecchi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include "telepathy-glib/tls-certificate.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "telepathy-glib/variant-util-internal.h" #define DEBUG_FLAG TP_DEBUG_TLS #include "debug-internal.h" /** * SECTION:tls-certificate * @title: TpTLSCertificate * @short_description: proxy object for a server or peer's TLS certificate * * #TpTLSCertificate is a #TpProxy subclass for TLSCertificate objects, * used in Channel.Type.ServerTLSConnection. * * Since: 0.19.0 */ /** * TpTLSCertificate: * * A #TpProxy subclass representing a server or peer's TLS certificate * being presented for acceptance/rejection. * * Since: 0.19.0 */ /** * TpTLSCertificateClass: * * The class of a #TpTLSCertificate. * * Since: 0.19.0 */ enum { /* proxy properties */ PROP_CERT_TYPE = 1, PROP_CERT_DATA, PROP_STATE, PROP_PARENT, N_PROPS }; struct _TpTLSCertificatePrivate { TpProxy *parent; /* TLSCertificate properties */ gchar *cert_type; GPtrArray *cert_data; TpTLSCertificateState state; /* array of TpTLSCertificateRejection received from the CM */ GPtrArray *rejections; /* GPtrArray of TP_STRUCT_TYPE_TLS_CERTIFICATE_REJECTION to send to CM */ GPtrArray *pending_rejections; }; G_DEFINE_TYPE (TpTLSCertificate, tp_tls_certificate, TP_TYPE_PROXY) /** * TP_TLS_CERTIFICATE_FEATURE_CORE: * * Expands to a call to a function that returns a quark representing the * core functionality of a #TpTLSCertificate. * * When this feature is prepared, the basic properties of the * object have been retrieved and are available for use: * * * #TpTLSCertificate:cert-type * #TpTLSCertificate:cert-data * #TpTLSCertificate:state * * * In addition, #GObject::notify::state will be emitted if the state changes. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.19.0 */ GQuark tp_tls_certificate_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-tls-certificate-feature-core"); } static void tp_tls_certificate_accepted_cb (TpTLSCertificate *self, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { tp_clear_pointer (&self->priv->rejections, g_ptr_array_unref); self->priv->state = TP_TLS_CERTIFICATE_STATE_ACCEPTED; g_object_notify ((GObject *) self, "state"); } static void tp_tls_certificate_rejected_cb (TpTLSCertificate *self, const GPtrArray *rejections, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { self->priv->state = TP_TLS_CERTIFICATE_STATE_REJECTED; tp_clear_pointer (&self->priv->rejections, g_ptr_array_unref); self->priv->rejections = g_ptr_array_new_with_free_func (g_object_unref); if (rejections == NULL || rejections->len == 0) { TpTLSCertificateRejection *rej; GVariantBuilder builder; GError *error = g_error_new_literal (TP_ERROR, TP_ERROR_CERT_INVALID, "Rejected, no reason given"); g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}")); rej = _tp_tls_certificate_rejection_new (error, TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN, TP_ERROR_STR_CERT_INVALID, g_variant_builder_end (&builder)); g_ptr_array_add (self->priv->rejections, rej); g_error_free (error); } else { guint i; for (i = 0; i < rejections->len; i++) { TpTLSCertificateRejection *rej; GValueArray *va = g_ptr_array_index (rejections, i); const gchar *error_name; const GHashTable *details; TpTLSCertificateRejectReason reason; GError *error = NULL; GVariant *vardict; tp_value_array_unpack (va, 3, &reason, &error_name, &details); tp_proxy_dbus_error_to_gerror (self, error_name, tp_asv_get_string (details, "debug-message"), &error); vardict = _tp_asv_to_vardict (details); rej = _tp_tls_certificate_rejection_new (error, reason, error_name, vardict); g_ptr_array_add (self->priv->rejections, rej); g_error_free (error); g_variant_unref (vardict); } } g_object_notify ((GObject *) self, "state"); } static void tls_certificate_got_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { GPtrArray *cert_data; TpTLSCertificate *self = TP_TLS_CERTIFICATE (proxy); guint state; guint i; if (error != NULL) { tp_proxy_invalidate (proxy, error); return; } self->priv->cert_type = g_strdup (tp_asv_get_string (properties, "CertificateType")); state = tp_asv_get_uint32 (properties, "State", NULL); switch (state) { case TP_TLS_CERTIFICATE_STATE_PENDING: break; case TP_TLS_CERTIFICATE_STATE_ACCEPTED: tp_tls_certificate_accepted_cb (self, NULL, NULL); break; case TP_TLS_CERTIFICATE_STATE_REJECTED: tp_tls_certificate_rejected_cb (self, tp_asv_get_boxed (properties, "Rejections", TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST), NULL, NULL); break; default: { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Invalid State" }; DEBUG ("Invalid state '%u' on %s", state, tp_proxy_get_object_path (self)); tp_proxy_invalidate (proxy, &e); } } cert_data = tp_asv_get_boxed (properties, "CertificateChainData", TP_ARRAY_TYPE_UCHAR_ARRAY_LIST); if (cert_data == NULL) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Missing CertificateChainData property" }; DEBUG ("Missing CertificateChainData property on %s", tp_proxy_get_object_path (self)); tp_proxy_invalidate (proxy, &e); return; } self->priv->cert_data = g_ptr_array_new_with_free_func ( (GDestroyNotify) g_bytes_unref); for (i = 0; i < cert_data->len; i++) { GArray *arr = g_ptr_array_index (cert_data, i); GBytes *bytes; bytes = g_bytes_new (arr->data, arr->len); g_ptr_array_add (self->priv->cert_data, bytes); } DEBUG ("Got a certificate chain long %u, of type %s", self->priv->cert_data->len, self->priv->cert_type); _tp_proxy_set_feature_prepared (proxy, TP_TLS_CERTIFICATE_FEATURE_CORE, TRUE); } static void parent_invalidated_cb (TpProxy *parent, guint domain, gint code, gchar *message, TpTLSCertificate *self) { GError e = { domain, code, message }; tp_clear_object (&self->priv->parent); tp_proxy_invalidate ((TpProxy *) self, &e); g_object_notify ((GObject *) self, "parent"); } static void tp_tls_certificate_constructed (GObject *object) { TpTLSCertificate *self = TP_TLS_CERTIFICATE (object); void (*constructed) (GObject *) = G_OBJECT_CLASS (tp_tls_certificate_parent_class)->constructed; if (constructed != NULL) constructed (object); g_return_if_fail (self->priv->parent == NULL || TP_IS_CHANNEL (self->priv->parent) || TP_IS_CONNECTION (self->priv->parent)); if (self->priv->parent != NULL) { if (self->priv->parent->invalidated != NULL) { GError *invalidated = self->priv->parent->invalidated; parent_invalidated_cb (self->priv->parent, invalidated->domain, invalidated->code, invalidated->message, self); } else { tp_g_signal_connect_object (self->priv->parent, "invalidated", G_CALLBACK (parent_invalidated_cb), self, 0); } } tp_cli_authentication_tls_certificate_connect_to_accepted (self, tp_tls_certificate_accepted_cb, NULL, NULL, NULL, NULL); tp_cli_authentication_tls_certificate_connect_to_rejected (self, tp_tls_certificate_rejected_cb, NULL, NULL, NULL, NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_AUTHENTICATION_TLS_CERTIFICATE, tls_certificate_got_all_cb, NULL, NULL, NULL); } static void tp_tls_certificate_finalize (GObject *object) { TpTLSCertificate *self = TP_TLS_CERTIFICATE (object); TpTLSCertificatePrivate *priv = self->priv; DEBUG ("%p", object); tp_clear_pointer (&self->priv->rejections, g_ptr_array_unref); g_free (priv->cert_type); if (priv->cert_data != NULL) g_ptr_array_unref (priv->cert_data); tp_clear_boxed (TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, &self->priv->pending_rejections); G_OBJECT_CLASS (tp_tls_certificate_parent_class)->finalize (object); } static void tp_tls_certificate_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTLSCertificate *self = TP_TLS_CERTIFICATE (object); TpTLSCertificatePrivate *priv = self->priv; switch (property_id) { case PROP_CERT_TYPE: g_value_set_string (value, priv->cert_type); break; case PROP_CERT_DATA: g_value_set_boxed (value, priv->cert_data); break; case PROP_STATE: g_value_set_uint (value, priv->state); break; case PROP_PARENT: g_value_set_object (value, priv->parent); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tls_certificate_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTLSCertificate *self = TP_TLS_CERTIFICATE (object); switch (property_id) { case PROP_PARENT: self->priv->parent = TP_PROXY (g_value_dup_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tls_certificate_init (TpTLSCertificate *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_TLS_CERTIFICATE, TpTLSCertificatePrivate); } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_tls_certificate_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_TLS_CERTIFICATE_FEATURE_CORE; features[FEAT_CORE].core = TRUE; g_assert (features[N_FEAT].name == 0); return features; } static void tp_tls_certificate_class_init (TpTLSCertificateClass *klass) { GParamSpec *pspec; GObjectClass *oclass = G_OBJECT_CLASS (klass); TpProxyClass *pclass = TP_PROXY_CLASS (klass); tp_tls_certificate_init_known_interfaces (); oclass->get_property = tp_tls_certificate_get_property; oclass->set_property = tp_tls_certificate_set_property; oclass->constructed = tp_tls_certificate_constructed; oclass->finalize = tp_tls_certificate_finalize; pclass->interface = TP_IFACE_QUARK_AUTHENTICATION_TLS_CERTIFICATE; pclass->must_have_unique_name = TRUE; pclass->list_features = tp_tls_certificate_list_features; g_type_class_add_private (klass, sizeof (TpTLSCertificatePrivate)); /** * TpTLSCertificate:cert-type: * * The type of the certificate, typically either "x509" or "pgp". * * Since: 0.19.0 */ pspec = g_param_spec_string ("cert-type", "Certificate type", "The type of this certificate.", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_CERT_TYPE, pspec); /** * TpTLSCertificate:cert-data: * * The raw data of the certificate or certificate chain, represented * as a #GPtrArray of #GBytes. It should be interpreted * according to #TpTLSCertificate:cert-type. * * The first certificate in this array is the server's certificate, * followed by its issuer, followed by the issuer's issuer and so on. * * For "x509" certificates, each certificate is an X.509 certificate in * binary (DER) format. * * For "pgp" certificates, each certificate is a binary OpenPGP key. * * Since: 0.19.0 */ pspec = g_param_spec_boxed ("cert-data", "Certificate chain data", "The raw DER-encoded certificate chain data.", G_TYPE_PTR_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_CERT_DATA, pspec); /** * TpTLSCertificate:state: * * The state of this TLS certificate as a #TpTLSCertificateState, * initially %TP_TLS_CERTIFICATE_STATE_PENDING. * * #GObject::notify::state will be emitted when this changes. * * Since: 0.19.0 */ pspec = g_param_spec_uint ("state", "State", "The state of this certificate.", 0, TP_NUM_TLS_CERTIFICATE_STATES - 1, TP_TLS_CERTIFICATE_STATE_PENDING, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_STATE, pspec); /** * TpTLSCertificate:parent: * * A #TpConnection or #TpChannel which owns this TLS certificate. If the * parent object is invalidated, the certificate is also invalidated, and * this property is set to %NULL. * * Since: 0.19.0 */ pspec = g_param_spec_object ("parent", "Parent", "The TpConnection or TpChannel to which this belongs", TP_TYPE_PROXY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_PARENT, pspec); } static void cert_proxy_accept_cb (TpTLSCertificate *self, const GError *error, gpointer user_data, GObject *unused_object G_GNUC_UNUSED) { GSimpleAsyncResult *accept_result = user_data; DEBUG ("Callback for accept(), error %p", error); if (error != NULL) { DEBUG ("Error was %s", error->message); g_simple_async_result_set_from_error (accept_result, error); } g_simple_async_result_complete (accept_result); } static void cert_proxy_reject_cb (TpTLSCertificate *self, const GError *error, gpointer user_data, GObject *unused_object G_GNUC_UNUSED) { GSimpleAsyncResult *reject_result = user_data; DEBUG ("Callback for reject(), error %p", error); if (error != NULL) { DEBUG ("Error was %s", error->message); g_simple_async_result_set_from_error (reject_result, error); } g_simple_async_result_complete (reject_result); } static const gchar * reject_reason_get_dbus_error (TpTLSCertificateRejectReason reason) { const gchar *retval = NULL; switch (reason) { #define EASY_CASE(x) \ case TP_TLS_CERTIFICATE_REJECT_REASON_ ## x: \ retval = tp_error_get_dbus_name (TP_ERROR_CERT_ ## x); \ break EASY_CASE (UNTRUSTED); EASY_CASE (EXPIRED); EASY_CASE (NOT_ACTIVATED); EASY_CASE (FINGERPRINT_MISMATCH); EASY_CASE (HOSTNAME_MISMATCH); EASY_CASE (SELF_SIGNED); EASY_CASE (REVOKED); EASY_CASE (INSECURE); EASY_CASE (LIMIT_EXCEEDED); #undef EASY_CASE case TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN: default: retval = tp_error_get_dbus_name (TP_ERROR_CERT_INVALID); break; } return retval; } /** * tp_tls_certificate_new: * @conn_or_chan: a #TpConnection or #TpChannel parent for this object, whose * invalidation will also result in invalidation of the returned object * @object_path: the object path of this TLS certificate * @error: a #GError used to return an error if %NULL is returned, or %NULL * * * * Returns: (transfer full): a new TLS certificate proxy. Prepare the * feature %TP_TLS_CERTIFICATE_FEATURE_CORE to make it useful. * Since: 0.19.0 */ TpTLSCertificate * tp_tls_certificate_new (TpProxy *conn_or_chan, const gchar *object_path, GError **error) { TpTLSCertificate *retval = NULL; g_return_val_if_fail (TP_IS_CONNECTION (conn_or_chan) || TP_IS_CHANNEL (conn_or_chan), NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; retval = g_object_new (TP_TYPE_TLS_CERTIFICATE, "parent", conn_or_chan, "dbus-daemon", conn_or_chan->dbus_daemon, "bus-name", conn_or_chan->bus_name, "object-path", object_path, NULL); finally: return retval; } /** * tp_tls_certificate_accept_async: * @self: a TLS certificate * @callback: called on success or failure * @user_data: user data for the callback * * Accept this certificate, asynchronously. In or after @callback, * you may call tp_tls_certificate_accept_finish() to check the result. * * #GObject::notify::state will also be emitted when the connection manager * signals that the certificate has been accepted. * Since: 0.19.0 */ void tp_tls_certificate_accept_async (TpTLSCertificate *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *accept_result; g_assert (TP_IS_TLS_CERTIFICATE (self)); DEBUG ("Accepting TLS certificate"); accept_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_tls_certificate_accept_async); tp_cli_authentication_tls_certificate_call_accept (self, -1, cert_proxy_accept_cb, accept_result, g_object_unref, NULL); } /** * tp_tls_certificate_accept_finish: * @self: a TLS certificate * @result: the result passed to the callback by * tp_tls_certificate_accept_async() * @error: used to raise an error if %FALSE is returned * * Check the result of tp_tls_certificate_accept_async(). * * Returns: %TRUE if acceptance was successful * Since: 0.19.0 */ gboolean tp_tls_certificate_accept_finish (TpTLSCertificate *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_tls_certificate_accept_async) } /** * tp_tls_certificate_add_rejection: * @self: a TLS certificate * @reason: the reason for rejection * @dbus_error: a D-Bus error name such as %TP_ERROR_STR_CERT_REVOKED, or * %NULL to derive one from @reason * @details: (transfer none) (allow-none): a variant of type * %G_VARIANT_TYPE_VARDICT containing the details of the rejection, or %NULL * * Add a pending reason for rejection. The first call to this method is * considered "most important". After calling this method as many times * as are required, call tp_tls_certificate_reject_async() to reject the * certificate. * * If @details is a floating reference (see g_variant_ref_sink()), * ownership of @details is taken by this function. This means * you can pass the result of g_variant_new() or g_variant_new_parsed() * directly to this function without additional reference-count management. * * Since: 0.19.0 */ void tp_tls_certificate_add_rejection (TpTLSCertificate *self, TpTLSCertificateRejectReason reason, const gchar *dbus_error, GVariant *details) { GValueArray *rejection; GHashTable *hash; g_return_if_fail (dbus_error == NULL || tp_dbus_check_valid_interface_name (dbus_error, NULL)); g_return_if_fail (details == NULL || g_variant_is_of_type (details, G_VARIANT_TYPE_VARDICT)); if (self->priv->pending_rejections == NULL) self->priv->pending_rejections = g_ptr_array_new (); if (dbus_error == NULL) dbus_error = reject_reason_get_dbus_error (reason); if (details == NULL) { hash = g_hash_table_new (NULL, NULL); } else { hash = _tp_asv_from_vardict (details); g_variant_ref_sink (details); } rejection = tp_value_array_build (3, G_TYPE_UINT, reason, G_TYPE_STRING, dbus_error, TP_HASH_TYPE_STRING_VARIANT_MAP, hash, NULL); g_ptr_array_add (self->priv->pending_rejections, rejection); g_hash_table_unref (hash); if (details != NULL) g_variant_unref (details); } /** * tp_tls_certificate_reject_async: * @self: a TLS certificate * @callback: called on success or failure * @user_data: user data for the callback * * Reject this certificate, asynchronously. * * Before calling this method, you must call * tp_tls_certificate_add_rejection() at least once, to set the reason(s) * for rejection (for instance, a certificate might be both self-signed and * expired). * * In or after @callback, * you may call tp_tls_certificate_reject_finish() to check the result. * * #GObject::notify::state will also be emitted when the connection manager * signals that the certificate has been rejected. * Since: 0.19.0 */ void tp_tls_certificate_reject_async (TpTLSCertificate *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *reject_result; g_return_if_fail (TP_IS_TLS_CERTIFICATE (self)); g_return_if_fail (self->priv->pending_rejections != NULL); g_return_if_fail (self->priv->pending_rejections->len >= 1); reject_result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_tls_certificate_reject_async); tp_cli_authentication_tls_certificate_call_reject (self, -1, self->priv->pending_rejections, cert_proxy_reject_cb, reject_result, g_object_unref, NULL); tp_clear_boxed (TP_ARRAY_TYPE_TLS_CERTIFICATE_REJECTION_LIST, &self->priv->pending_rejections); } /** * tp_tls_certificate_reject_finish: * @self: a TLS certificate * @result: the result passed to the callback by * tp_tls_certificate_reject_async() * @error: used to raise an error if %FALSE is returned * * Check the result of tp_tls_certificate_reject_async(). * * Returns: %TRUE if rejection was successful * Since: 0.19.0 */ gboolean tp_tls_certificate_reject_finish (TpTLSCertificate *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_tls_certificate_reject_async) } #include /** * tp_tls_certificate_init_known_interfaces: * * Ensure that the known interfaces for TpTLSCertificate have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_TLS_CERTIFICATE. * * Since: 0.19.0 */ void tp_tls_certificate_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_TLS_CERTIFICATE; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_tls_cert_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_tls_certificate_get_rejection: * @self: a TLS certificate * * If this certificate has been rejected, return a #TpTLSCertificateRejection * indicating the first rejection reason (by convention, * the most important). * * If you want to list all the things that are wrong with the certificate * (for instance, it might be self-signed and also have expired) * you can call tp_tls_certificate_get_nth_rejection(), increasing @n until * it returns %NULL. * * Returns: (transfer none) (allow-none): a #TpTLSCertificateRejection, or %NULL * Since: 0.19.0 */ TpTLSCertificateRejection * tp_tls_certificate_get_rejection (TpTLSCertificate *self) { return tp_tls_certificate_get_nth_rejection (self, 0); } /** * tp_tls_certificate_get_nth_rejection: * @self: a TLS certificate * @n: the rejection reason to return; if 0, return the same thing as * tp_tls_certificate_get_detailed_rejection() * * If this certificate has been rejected and @n is less than the number of * rejection reasons, return a #TpTLSCertificateRejection representing the * @nth rejection reason (starting from 0). * * With @n == 0 this is equivalent to tp_tls_certificate_get_rejection(). * * Returns: (transfer none) (allow-none): a #TpTLSCertificateRejection, or %NULL * Since: 0.19.0 */ TpTLSCertificateRejection * tp_tls_certificate_get_nth_rejection (TpTLSCertificate *self, guint n) { if (self->priv->rejections == NULL || n >= self->priv->rejections->len) return NULL; return g_ptr_array_index (self->priv->rejections, n); } /** * tp_tls_certificate_get_cert_type: * @self: a #TpTLSCertificate * * Return the #TpTLSCertificate:cert-type property * * Returns: the value of #TpTLSCertificate:cert-type property * * Since: 0.19.0 */ const gchar * tp_tls_certificate_get_cert_type (TpTLSCertificate *self) { return self->priv->cert_type; } /** * tp_tls_certificate_get_cert_data: * @self: a #TpTLSCertificate * * Return the #TpTLSCertificate:cert-data property * * Returns: (transfer none) (type GLib.PtrArray) (element-type GLib.Bytes): the value of #TpTLSCertificate:cert-data property * * Since: 0.19.0 */ GPtrArray * tp_tls_certificate_get_cert_data (TpTLSCertificate *self) { return self->priv->cert_data; } /** * tp_tls_certificate_get_state: * @self: a #TpTLSCertificate * * Return the #TpTLSCertificate:state property * * Returns: the value of #TpTLSCertificate:state property * * Since: 0.19.0 */ TpTLSCertificateState tp_tls_certificate_get_state (TpTLSCertificate *self) { return self->priv->state; } telepathy-glib-0.24.2/telepathy-glib/tls-certificate.h0000644000175000017500000001057712652510705017614 00000000000000/* * TpTLSCertificate - a TpProxy for TLS certificates * Copyright © 2010 Collabora Ltd. * * Based on EmpathyTLSCertificate: * @author Cosimo Cecchi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_TLS_CERTIFICATE_H__ #define __TP_TLS_CERTIFICATE_H__ #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpTLSCertificate TpTLSCertificate; typedef struct _TpTLSCertificateClass TpTLSCertificateClass; typedef struct _TpTLSCertificatePrivate TpTLSCertificatePrivate; typedef struct _TpTLSCertificateClassPrivate TpTLSCertificateClassPrivate; struct _TpTLSCertificateClass { /**/ TpProxyClass parent_class; GCallback _future[3]; TpTLSCertificateClassPrivate *priv; }; struct _TpTLSCertificate { /**/ TpProxy parent; TpTLSCertificatePrivate *priv; }; _TP_AVAILABLE_IN_0_20 GType tp_tls_certificate_get_type (void); #define TP_TYPE_TLS_CERTIFICATE \ (tp_tls_certificate_get_type ()) #define TP_TLS_CERTIFICATE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_TLS_CERTIFICATE, \ TpTLSCertificate)) #define TP_TLS_CERTIFICATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_TLS_CERTIFICATE, \ TpTLSCertificateClass)) #define TP_IS_TLS_CERTIFICATE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_TLS_CERTIFICATE)) #define TP_IS_TLS_CERTIFICATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_TLS_CERTIFICATE)) #define TP_TLS_CERTIFICATE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_TLS_CERTIFICATE, \ TpTLSCertificateClass)) _TP_AVAILABLE_IN_0_20 GQuark tp_tls_certificate_get_feature_quark_core (void); #define TP_TLS_CERTIFICATE_FEATURE_CORE \ (tp_tls_certificate_get_feature_quark_core ()) _TP_AVAILABLE_IN_0_20 TpTLSCertificate *tp_tls_certificate_new (TpProxy *conn_or_chan, const gchar *object_path, GError **error); _TP_AVAILABLE_IN_0_20 TpTLSCertificateRejection *tp_tls_certificate_get_rejection ( TpTLSCertificate *self); _TP_AVAILABLE_IN_0_20 TpTLSCertificateRejection *tp_tls_certificate_get_nth_rejection ( TpTLSCertificate *self, guint n); _TP_AVAILABLE_IN_0_20 void tp_tls_certificate_accept_async (TpTLSCertificate *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 gboolean tp_tls_certificate_accept_finish (TpTLSCertificate *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_20 void tp_tls_certificate_add_rejection (TpTLSCertificate *self, TpTLSCertificateRejectReason reason, const gchar *dbus_error, GVariant *details); _TP_AVAILABLE_IN_0_20 void tp_tls_certificate_reject_async (TpTLSCertificate *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 gboolean tp_tls_certificate_reject_finish (TpTLSCertificate *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_20 void tp_tls_certificate_init_known_interfaces (void); _TP_AVAILABLE_IN_0_20 const gchar * tp_tls_certificate_get_cert_type (TpTLSCertificate *self); _TP_AVAILABLE_IN_0_20 GPtrArray * tp_tls_certificate_get_cert_data (TpTLSCertificate *self); _TP_AVAILABLE_IN_0_20 TpTLSCertificateState tp_tls_certificate_get_state (TpTLSCertificate *self); G_END_DECLS #endif /* multiple-inclusion guard */ telepathy-glib-0.24.2/telepathy-glib/account.xml0000644000175000017500000000062412652510705016527 00000000000000 Account interfaces telepathy-glib-0.24.2/telepathy-glib/observe-channels-context.c0000644000175000017500000004765712652510705021456 00000000000000/* * Context objects for TpBaseClient calls * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:observe-channels-context * @title: TpObserveChannelsContext * @short_description: context of a Observer.ObserveChannels() call * * Object used to represent the context of a Observer.ObserveChannels() * D-Bus call on a #TpBaseClient. */ /** * TpObserveChannelsContext: * * Data structure representing the context of a Observer.ObserveChannels() * call. * * Since: 0.11.5 */ /** * TpObserveChannelsContextClass: * * The class of a #TpObserveChannelsContext. * * Since: 0.11.5 */ #include "config.h" #include "telepathy-glib/observe-channels-context-internal.h" #include "telepathy-glib/observe-channels-context.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" struct _TpObserveChannelsContextClass { /**/ GObjectClass parent_class; }; G_DEFINE_TYPE(TpObserveChannelsContext, tp_observe_channels_context, G_TYPE_OBJECT) enum { PROP_ACCOUNT = 1, PROP_CONNECTION, PROP_CHANNELS, PROP_DISPATCH_OPERATION, PROP_REQUESTS, PROP_OBSERVER_INFO, PROP_DBUS_CONTEXT, N_PROPS }; struct _TpObserveChannelsContextPrivate { TpObserveChannelsContextState state; GSimpleAsyncResult *result; DBusGMethodInvocation *dbus_context; /* Number of calls we are waiting they return. Once they have all returned * the context is considered as prepared */ guint num_pending; }; static void tp_observe_channels_context_init (TpObserveChannelsContext *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_OBSERVE_CHANNELS_CONTEXT, TpObserveChannelsContextPrivate); self->priv->state = TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE; } static void tp_observe_channels_context_dispose (GObject *object) { TpObserveChannelsContext *self = TP_OBSERVE_CHANNELS_CONTEXT (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_observe_channels_context_parent_class)->dispose; if (self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED) { GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Disposing the TpObserveChannelsContext" }; WARNING ("Disposing a context in the %s state", self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE ? "none": "delayed"); tp_observe_channels_context_fail (self, &error); } if (self->account != NULL) { g_object_unref (self->account); self->account = NULL; } if (self->connection != NULL) { g_object_unref (self->connection); self->connection = NULL; } if (self->channels != NULL) { g_ptr_array_unref (self->channels); self->channels = NULL; } if (self->dispatch_operation != NULL) { g_object_unref (self->dispatch_operation); self->dispatch_operation = NULL; } if (self->requests != NULL) { g_ptr_array_foreach (self->requests, (GFunc) g_object_unref, NULL); g_ptr_array_unref (self->requests); self->requests = NULL; } if (self->observer_info != NULL) { g_hash_table_unref (self->observer_info); self->observer_info = NULL; } if (self->priv->result != NULL) { g_object_unref (self->priv->result); self->priv->result = NULL; } if (dispose != NULL) dispose (object); } static void tp_observe_channels_context_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpObserveChannelsContext *self = TP_OBSERVE_CHANNELS_CONTEXT (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_object (value, self->account); break; case PROP_CONNECTION: g_value_set_object (value, self->connection); break; case PROP_CHANNELS: g_value_set_boxed (value, self->channels); break; case PROP_DISPATCH_OPERATION: g_value_set_object (value, self->dispatch_operation); break; case PROP_REQUESTS: g_value_set_boxed (value, self->requests); break; case PROP_OBSERVER_INFO: g_value_set_boxed (value, self->observer_info); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_observe_channels_context_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpObserveChannelsContext *self = TP_OBSERVE_CHANNELS_CONTEXT (object); switch (property_id) { case PROP_ACCOUNT: self->account = g_value_dup_object (value); break; case PROP_CONNECTION: self->connection = g_value_dup_object (value); break; case PROP_CHANNELS: self->channels = g_value_dup_boxed (value); break; case PROP_DISPATCH_OPERATION: self->dispatch_operation = g_value_dup_object (value); break; case PROP_REQUESTS: self->requests = g_value_dup_boxed (value); g_ptr_array_foreach (self->requests, (GFunc) g_object_ref, NULL); break; case PROP_DBUS_CONTEXT: self->priv->dbus_context = g_value_get_pointer (value); break; case PROP_OBSERVER_INFO: self->observer_info = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_observe_channels_context_constructed (GObject *object) { TpObserveChannelsContext *self = TP_OBSERVE_CHANNELS_CONTEXT (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_observe_channels_context_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (self->account != NULL); g_assert (self->connection != NULL); g_assert (self->channels != NULL); g_assert (self->requests != NULL); g_assert (self->observer_info != NULL); g_assert (self->priv->dbus_context != NULL); /* self->dispatch_operation may be NULL (channels were requested) */ } static void tp_observe_channels_context_class_init (TpObserveChannelsContextClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpObserveChannelsContextPrivate)); object_class->get_property = tp_observe_channels_context_get_property; object_class->set_property = tp_observe_channels_context_set_property; object_class->constructed = tp_observe_channels_context_constructed; object_class->dispose = tp_observe_channels_context_dispose; /** * TpObserveChannelsContext:account: * * A #TpAccount object representing the Account that has been passed to * ObserveChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("account", "TpAccount", "The TpAccount that has been passed to ObserveChannels", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpObserveChannelsContext:connection: * * A #TpConnection object representing the Connection that has been passed * to ObserveChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("connection", "TpConnection", "The TpConnection that has been passed to ObserveChannels", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpObserveChannelsContext:channels: * * A #GPtrArray containing #TpChannel objects representing the channels * that have been passed to ObserveChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("channels", "GPtrArray of TpChannel", "The TpChannels that have been passed to ObserveChannels", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNELS, param_spec); /** * TpObserveChannelsContext:dispatch-operation: * * A #TpChannelDispatchOperation object representing the * ChannelDispatchOperation that has been passed to ObserveChannels, * or %NULL if none has been passed. * Read-only except during construction. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("dispatch-operation", "TpChannelDispatchOperation", "The TpChannelDispatchOperation that has been passed to ObserveChannels", TP_TYPE_CHANNEL_DISPATCH_OPERATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISPATCH_OPERATION, param_spec); /** * TpObserveChannelsContext:requests: * * A #GPtrArray containing #TpChannelRequest objects representing the * requests that have been passed to ObserveChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("requests", "GPtrArray of TpChannelRequest", "The TpChannelRequest that have been passed to ObserveChannels", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTS, param_spec); /** * TpObserveChannelsContext:dbus-context: (skip) * * The #DBusGMethodInvocation representing the D-Bus context of the * ObserveChannels call. * Can only be written during construction. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("dbus-context", "D-Bus context", "The DBusGMethodInvocation associated with the ObserveChannels call", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_CONTEXT, param_spec); /** * TpObserveChannelsContext:observer-info: * * A #GHashTable where the keys are string and values are GValue instances. * It represents the Observer_Info hash table that has been passed to * ObserveChannels. * It's recommended to use high-level method such as * tp_observe_channels_context_is_recovering() to access to its content. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("observer-info", "Observer info", "The Observer_Info that has been passed to ObserveChannels", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBSERVER_INFO, param_spec); } TpObserveChannelsContext * _tp_observe_channels_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, TpChannelDispatchOperation *dispatch_operation, GPtrArray *requests, GHashTable *observer_info, DBusGMethodInvocation *dbus_context) { return g_object_new (TP_TYPE_OBSERVE_CHANNELS_CONTEXT, "account", account, "connection", connection, "channels", channels, "dispatch-operation", dispatch_operation, "requests", requests, "observer-info", observer_info, "dbus-context", dbus_context, NULL); } /** * tp_observe_channels_context_accept: * @self: a #TpObserveChannelsContext * * Called by #TpBaseClientClassObserveChannelsImpl when it's done so the D-Bus * method can return. * * Since: 0.11.5 */ void tp_observe_channels_context_accept (TpObserveChannelsContext *self) { g_return_if_fail (self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_OBSERVE_CHANNELS_CONTEXT_STATE_DONE; dbus_g_method_return (self->priv->dbus_context); self->priv->dbus_context = NULL; } /** * tp_observe_channels_context_fail: * @self: a #TpObserveChannelsContext * @error: the error to return from the method * * Called by #TpBaseClientClassObserveChannelsImpl to raise a D-Bus error. * * Since: 0.11.5 */ void tp_observe_channels_context_fail (TpObserveChannelsContext *self, const GError *error) { g_return_if_fail (self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_OBSERVE_CHANNELS_CONTEXT_STATE_FAILED; dbus_g_method_return_error (self->priv->dbus_context, error); self->priv->dbus_context = NULL; } /** * tp_observe_channels_context_delay: * @self: a #TpObserveChannelsContext * * Called by #TpBaseClientClassObserveChannelsImpl to indicate that it * implements the method in an async way. The caller must take a reference * to the #TpObserveChannelsContext before calling this function, and * is responsible for calling either tp_observe_channels_context_accept() or * tp_observe_channels_context_fail() later. * * Since: 0.11.5 */ void tp_observe_channels_context_delay (TpObserveChannelsContext *self) { g_return_if_fail (self->priv->state == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE); self->priv->state = TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED; } /** * tp_observe_channels_context_is_recovering: * @self: a #TpObserveChannelsContext * * If this call to ObserveChannels is for channels that already * existed before this observer started (because the observer used * tp_base_client_set_observer_recover()), return %TRUE. * * In most cases, the result is %FALSE. * * Returns: %TRUE for pre-existing channels, %FALSE for new channels * * Since: 0.11.5 */ gboolean tp_observe_channels_context_is_recovering (TpObserveChannelsContext *self) { /* tp_asv_get_boolean returns FALSE if the key is not set which is what we * want */ return tp_asv_get_boolean (self->observer_info, "recovering", NULL); } TpObserveChannelsContextState _tp_observe_channels_context_get_state ( TpObserveChannelsContext *self) { return self->priv->state; } static gboolean context_is_prepared (TpObserveChannelsContext *self) { return self->priv->num_pending == 0; } static void context_check_prepare (TpObserveChannelsContext *self) { if (!context_is_prepared (self)) return; /* Context is prepared */ g_simple_async_result_complete (self->priv->result); g_object_unref (self->priv->result); self->priv->result = NULL; } static void cdo_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpObserveChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare ChannelDispatchOperation: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void account_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpObserveChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void conn_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpObserveChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare connection: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void occ_channel_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpObserveChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare channel: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void context_prepare (TpObserveChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features) { GQuark cdo_features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; guint i; self->priv->num_pending = 2; tp_proxy_prepare_async (self->account, account_features, account_prepare_cb, g_object_ref (self)); tp_proxy_prepare_async (self->connection, connection_features, conn_prepare_cb, g_object_ref (self)); if (self->dispatch_operation != NULL) { self->priv->num_pending++; tp_proxy_prepare_async (self->dispatch_operation, cdo_features, cdo_prepare_cb, g_object_ref (self)); } for (i = 0; i < self->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->channels, i); self->priv->num_pending++; tp_proxy_prepare_async (channel, channel_features, occ_channel_prepare_cb, g_object_ref (self)); } } void _tp_observe_channels_context_prepare_async (TpObserveChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_OBSERVE_CHANNELS_CONTEXT (self)); /* This is only used once, by TpBaseClient, so for simplicity, we only * allow one asynchronous preparation */ g_return_if_fail (self->priv->result == NULL); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, _tp_observe_channels_context_prepare_async); context_prepare (self, account_features, connection_features, channel_features); } gboolean _tp_observe_channels_context_prepare_finish ( TpObserveChannelsContext *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, _tp_observe_channels_context_prepare_async); } /** * tp_observe_channels_context_get_requests: * @self: a #TpObserveChannelsContext * * Return a list of the #TpChannelRequest which have been satisfied by the * channels associated with #self. * * Returns: (transfer full) (element-type TelepathyGLib.ChannelRequest): * a newly allocated #GList of reffed #TpChannelRequest. * * Since: 0.13.14 */ GList * tp_observe_channels_context_get_requests (TpObserveChannelsContext *self) { GHashTable *request_props; request_props = tp_asv_get_boxed (self->observer_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP); if (request_props == NULL) return NULL; return _tp_create_channel_request_list ( tp_proxy_get_factory (self->account), request_props); } telepathy-glib-0.24.2/telepathy-glib/observe-channels-context.h0000644000175000017500000000537112652510705021446 00000000000000/* * Context objects for TpBaseClient calls * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_OBSERVE_CHANNELS_CONTEXT_H__ #define __TP_OBSERVE_CHANNELS_CONTEXT_H__ #include #include G_BEGIN_DECLS typedef struct _TpObserveChannelsContext TpObserveChannelsContext; typedef struct _TpObserveChannelsContextClass TpObserveChannelsContextClass; typedef struct _TpObserveChannelsContextPrivate TpObserveChannelsContextPrivate; GType tp_observe_channels_context_get_type (void); #define TP_TYPE_OBSERVE_CHANNELS_CONTEXT \ (tp_observe_channels_context_get_type ()) #define TP_OBSERVE_CHANNELS_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_OBSERVE_CHANNELS_CONTEXT, \ TpObserveChannelsContext)) #define TP_OBSERVE_CHANNELS_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_OBSERVE_CHANNELS_CONTEXT, \ TpObserveChannelsContextClass)) #define TP_IS_OBSERVE_CHANNELS_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_OBSERVE_CHANNELS_CONTEXT)) #define TP_IS_OBSERVE_CHANNELS_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_OBSERVE_CHANNELS_CONTEXT)) #define TP_OBSERVE_CHANNELS_CONTEXT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_OBSERVE_CHANNELS_CONTEXT, \ TpObserveChannelsContextClass)) void tp_observe_channels_context_accept (TpObserveChannelsContext *self); void tp_observe_channels_context_fail (TpObserveChannelsContext *self, const GError *error); void tp_observe_channels_context_delay (TpObserveChannelsContext *self); gboolean tp_observe_channels_context_is_recovering ( TpObserveChannelsContext *self); GList * tp_observe_channels_context_get_requests ( TpObserveChannelsContext *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/errors.c0000644000175000017500000003610712652510705016036 00000000000000/* * D-Bus error types used in telepathy * Copyright (C) 2005-2009 Collabora Ltd. * Copyright (C) 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include /** * TP_ERROR_PREFIX: * * The common prefix of Telepathy errors, as a string constant, without * the trailing '.' character. * * Since: 0.7.1 */ /** * TP_ERROR: * * The error domain for the D-Bus errors described in the Telepathy * specification. Error codes in this domain come from the #TpError * enumeration. * * This macro expands to a call to a function returning the Telepathy error * domain. Since 0.7.17, this function automatically registers the domain with * dbus-glib for server-side use (using dbus_g_error_domain_register()) when * called. * * This used to be called %TP_ERRORS. * * Since: 0.11.7 */ /** * TP_TYPE_ERROR: * * The GType of the Telepathy error enumeration. */ /** * TpError: * @TP_ERROR_NETWORK_ERROR: org.freedesktop.Telepathy.Error.NetworkError: * Raised when there is an error reading from or writing to the network. * @TP_ERROR_NOT_IMPLEMENTED: org.freedesktop.Telepathy.Error.NotImplemented: * Raised when the requested method, channel, etc is not available on this * connection. * @TP_ERROR_INVALID_ARGUMENT: org.freedesktop.Telepathy.Error.InvalidArgument: * Raised when one of the provided arguments is invalid. * @TP_ERROR_NOT_AVAILABLE: org.freedesktop.Telepathy.Error.NotAvailable: * Raised when the requested functionality is temporarily unavailable. * @TP_ERROR_PERMISSION_DENIED: org.freedesktop.Telepathy.Error.PermissionDenied: * The user is not permitted to perform the requested operation. * @TP_ERROR_DISCONNECTED: org.freedesktop.Telepathy.Error.Disconnected: * The connection is not currently connected and cannot be used. * This error may also be raised when operations are performed on a * Connection for which StatusChanged has signalled status Disconnected * for reason None. * @TP_ERROR_INVALID_HANDLE: org.freedesktop.Telepathy.Error.InvalidHandle: * An identifier being converted to a handle was syntactically invalid, * or an invalid handle was used. * @TP_ERROR_CHANNEL_BANNED: org.freedesktop.Telepathy.Error.Channel.Banned: * You are banned from the channel. * @TP_ERROR_CHANNEL_FULL: org.freedesktop.Telepathy.Error.Channel.Full: * The channel is full. * @TP_ERROR_CHANNEL_INVITE_ONLY: org.freedesktop.Telepathy.Error.Channel.InviteOnly: * The requested channel is invite-only. * @TP_ERROR_NOT_YOURS: org.freedesktop.Telepathy.Error.NotYours: * The requested channel or other resource already exists, and another * client is responsible for it * @TP_ERROR_CANCELLED: org.freedesktop.Telepathy.Error.Cancelled: * Raised by an ongoing request if it is cancelled by user request before * it has completed, or when operations are performed on an object which * the user has asked to close (for instance, a Connection where the user * has called Disconnect, or a Channel where the user has called Close). * @TP_ERROR_AUTHENTICATION_FAILED: org.freedesktop.Telepathy.Error.AuthenticationFailed: * Raised when authentication with a service was unsuccessful. * @TP_ERROR_ENCRYPTION_NOT_AVAILABLE: org.freedesktop.Telepathy.Error.EncryptionNotAvailable: * Raised if a user request insisted that encryption should be used, * but encryption was not actually available. * @TP_ERROR_ENCRYPTION_ERROR: org.freedesktop.Telepathy.Error.EncryptionError: * Raised if encryption appears to be available, but could not actually be * used (for instance if SSL/TLS negotiation fails). * @TP_ERROR_CERT_NOT_PROVIDED: org.freedesktop.Telepathy.Error.Cert.NotProvided: * Raised if the server did not provide a SSL/TLS certificate. * @TP_ERROR_CERT_UNTRUSTED: org.freedesktop.Telepathy.Error.Cert.Untrusted: * Raised if the server provided a SSL/TLS certificate signed by an * untrusted certifying authority. * @TP_ERROR_CERT_EXPIRED: org.freedesktop.Telepathy.Error.Cert.Expired: * Raised if the server provided an expired SSL/TLS certificate. * @TP_ERROR_CERT_NOT_ACTIVATED: org.freedesktop.Telepathy.Error.Cert.NotActivated: * Raised if the server provided an SSL/TLS certificate that will become * valid at some point in the future. * @TP_ERROR_CERT_FINGERPRINT_MISMATCH: org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch: * Raised if the server provided an SSL/TLS certificate that did not have * the expected fingerprint. * @TP_ERROR_CERT_HOSTNAME_MISMATCH: org.freedesktop.Telepathy.Error.Cert.HostnameMismatch: * Raised if the server provided an SSL/TLS certificate that did not * match its hostname. * @TP_ERROR_CERT_SELF_SIGNED: org.freedesktop.Telepathy.Error.Cert.SelfSigned: * Raised if the server provided an SSL/TLS certificate that is * self-signed and untrusted. * @TP_ERROR_CERT_INVALID: org.freedesktop.Telepathy.Error.Cert.Invalid: * Raised if the server provided an SSL/TLS certificate that is * unacceptable in some way that does not have a more specific error. * @TP_ERROR_NOT_CAPABLE: org.freedesktop.Telepathy.Error.NotCapable: * Raised when requested functionality is unavailable due to a contact * not having the required capabilities. * @TP_ERROR_OFFLINE: org.freedesktop.Telepathy.Error.Offline: * Raised when requested functionality is unavailable because a contact is * offline. * @TP_ERROR_CHANNEL_KICKED: org.freedesktop.Telepathy.Error.Channel.Kicked: * Used to represent a user being ejected from a channel by another user, * for instance being kicked from a chatroom. * @TP_ERROR_BUSY: org.freedesktop.Telepathy.Error.Busy: * Used to represent a user being removed from a channel because of a * "busy" indication. * @TP_ERROR_NO_ANSWER: org.freedesktop.Telepathy.Error.NoAnswer: * Used to represent a user being removed from a channel because they did * not respond, e.g. to a StreamedMedia call. * @TP_ERROR_DOES_NOT_EXIST: org.freedesktop.Telepathy.Error.DoesNotExist: * Raised when the requested user does not, in fact, exist. * @TP_ERROR_TERMINATED: org.freedesktop.Telepathy.Error.Terminated: * Raised when a channel is terminated for an unspecified reason. In * particular, this error SHOULD be used whenever normal termination of a * 1-1 StreamedMedia call by the remote user is represented as a D-Bus * error name. * @TP_ERROR_CONNECTION_REFUSED: org.freedesktop.Telepathy.Error.ConnectionRefused: * Raised when a connection is refused. * @TP_ERROR_CONNECTION_FAILED: org.freedesktop.Telepathy.Error.ConnectionFailed: * Raised when a connection can't be established. * @TP_ERROR_CONNECTION_LOST: org.freedesktop.Telepathy.Error.ConnectionLost: * Raised when a connection is broken. * @TP_ERROR_ALREADY_CONNECTED: org.freedesktop.Telepathy.Error.AlreadyConnected: * Raised on attempts to connect again to an account that is already * connected, if the protocol or server does not allow this. * Since 0.7.34 * @TP_ERROR_CONNECTION_REPLACED: org.freedesktop.Telepathy.Error.ConnectionReplaced: * Used as disconnection reason for an existing connection if it is * disconnected because a second connection to the same account is made. * Since 0.7.34 * @TP_ERROR_REGISTRATION_EXISTS: org.freedesktop.Telepathy.Error.RegistrationExists: * Raised on attempts to register an account on a server when the account * already exists. * Since 0.7.34 * @TP_ERROR_SERVICE_BUSY: org.freedesktop.Telepathy.Error.ServiceBusy: * Raised when a server or other infrastructure rejects a request because * it is too busy. * Since 0.7.34 * @TP_ERROR_RESOURCE_UNAVAILABLE: org.freedesktop.Telepathy.Error.ResourceUnavailable: * Raised when a local process rejects a request because it does not have * enough of a resource, such as memory. * Since 0.7.34 * @TP_ERROR_WOULD_BREAK_ANONYMITY: org.freedesktop.Telepathy.Error.WouldBreakAnonymity: * Raised when a request cannot be satisfied without violating an * earlier request for anonymity, and the earlier request specified * that raising an error is preferable to disclosing the user's * identity * Since 0.11.7 * @TP_ERROR_CERT_REVOKED: org.freedesktop.Telepathy.Error.Cert.Revoked: * Raised if the server provided an SSL/TLS certificate that has been * revoked. * Since 0.11.12 * @TP_ERROR_CERT_INSECURE: org.freedesktop.Telepathy.Error.Cert.Insecure: * Raised if the server provided an SSL/TLS certificate that uses an * insecure cipher algorithm or is cryptographically weak. * Since 0.11.12 * @TP_ERROR_CERT_LIMIT_EXCEEDED: org.freedesktop.Telepathy.Error.Cert.LimitExceeded: * Raised if the length in bytes of the server certificate, or the depth * of the server certificate chain, exceed the limits imposed by the * crypto library. * Since 0.11.12 * @TP_ERROR_NOT_YET: org.freedesktop.Telepathy.Error.NotYet: * Raised when the requested functionality is not yet available, but is * likely to become available after some time has passed. * Since 0.11.15 * @TP_ERROR_REJECTED: org.freedesktop.Telepathy.Error.Rejected: * Raised when an incoming or outgoing call is rejected by the receiving * contact. * Since 0.13.2 * @TP_ERROR_PICKED_UP_ELSEWHERE: org.freedesktop.Telepathy.Error.PickedUpElsewhere: * Raised when a call was terminated as a result of the local user * picking up the call on a different resource. * Since 0.13.3 * @TP_ERROR_CONFUSED: org.freedesktop.Telepathy.Error.Confused: * Raised if a server rejects protocol messages from a connection manager * claiming that they do not make sense, two local processes fail to * understand each other, or an apparently impossible situation is * reached. This has a similar meaning to %TP_DBUS_ERROR_INCONSISTENT but * can be passed between processes via D-Bus. * Since 0.13.7 * @TP_ERROR_SERVICE_CONFUSED: org.freedesktop.Telepathy.Error.ServiceConfused: * Raised when a server or other piece of infrastructure indicates an * internal error, or when a message that makes no sense is received from * a server or other piece of infrastructure. * Since 0.13.7 * @TP_ERROR_EMERGENCY_CALLS_NOT_SUPPORTED: * org.freedesktop.Telepathy.Error.EmergencyCallsNotSupported: * Raised when a client attempts to dial a number that is recognized as an * emergency number (e.g. '911' in the USA), but the Connection * Manager or provider does not support dialling emergency numbers. * @TP_ERROR_SOFTWARE_UPGRADE_REQUIRED: * org.freedesktop.Telepathy.Error.SoftwareUpgradeRequired: * Raised when a Connection cannot be established because either the * Connection Manager or its support library (e.g. wocky, papyon, sofiasip) * requires upgrading to support a newer protocol version. * @TP_ERROR_INSUFFICIENT_BALANCE: * org.freedesktop.Telepathy.Error.InsufficientBalance: * Raised if the user has insufficient balance to place a call. The key * 'balance-required' MAY be included in CallStateDetails on a Call channel * (with the same units and scale as AccountBalance) to indicate how much * credit is required to make this call. * @TP_ERROR_MEDIA_CODECS_INCOMPATIBLE: * org.freedesktop.Telepathy.Error.Media.CodecsIncompatible: * Raised when the local streaming implementation has no codecs in common * with the remote side. * Since 0.15.6 * @TP_ERROR_MEDIA_UNSUPPORTED_TYPE: * org.freedesktop.Telepathy.Error.Media.UnsupportedType: * The media stream type requested is not supported by either the local or * remote side. * Since 0.15.6 * @TP_ERROR_MEDIA_STREAMING_ERROR: * org.freedesktop.Telepathy.Error.Media.StreamingError: * Raised when the call's streaming implementation has some kind of internal * error. * Since 0.15.6 * @TP_ERROR_CAPTCHA_NOT_SUPPORTED: * org.freedesktop.Telepathy.Error.Media.CaptchaNotSupported: * Raised if no UI is available to present captchas, or if one is * available but it is unable to answer any of the captchas given. * * Enumerated type representing the Telepathy D-Bus errors. */ /** * tp_g_set_error_invalid_handle_type: (skip) * @type: An invalid handle type * @error: Either %NULL, or used to return an error (as for g_set_error) * * Set the error NotImplemented for an invalid handle type, * with an appropriate message. * * Changed in version 0.7.23: previously, the error was * InvalidArgument. */ void tp_g_set_error_invalid_handle_type (guint type, GError **error) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "unsupported handle type %u", type); } /** * tp_g_set_error_unsupported_handle_type: (skip) * @type: An unsupported handle type * @error: Either %NULL, or used to return an error (as for g_set_error) * * Set the error NotImplemented for a handle type which is valid but is not * supported by this connection manager, with an appropriate message. * * Changed in version 0.7.23: previously, the error was * InvalidArgument. */ void tp_g_set_error_unsupported_handle_type (guint type, GError **error) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "unsupported handle type %u", type); } /** * tp_error_get_dbus_name: * @error: a member of the #TpError enum. * * * * Returns: the D-Bus error name corresponding to @error. * * Since: 0.7.31 */ /* tp_error_get_dbus_name is implemented in _gen/error-str.c by * tools/glib-errors-str-gen.py. */ /** * tp_errors_quark: (skip) * * * * Deprecated: Use tp_error_quark() instead. */ GQuark tp_errors_quark (void) { return tp_error_quark (); } /** * tp_error_quark: * * Return the error domain quark for #TpError. * * Since: 0.11.13 */ GQuark tp_error_quark (void) { static gsize quark = 0; if (g_once_init_enter (&quark)) { /* FIXME: When we next break API, this should be changed to * "tp-error-quark" */ GQuark domain = g_quark_from_static_string ("tp_errors"); dbus_g_error_domain_register (domain, TP_ERROR_PREFIX, TP_TYPE_ERROR); g_once_init_leave (&quark, domain); } return (GQuark) quark; } /* tp_errors_quark assumes this */ G_STATIC_ASSERT (sizeof (GQuark) <= sizeof (gsize)); telepathy-glib-0.24.2/telepathy-glib/errors.h0000644000175000017500000001210712652510705016035 00000000000000/* * - Header for Telepathy error types * Copyright (C) 2005-2009 Collabora Ltd. * Copyright (C) 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_ERRORS_H__ #define __TP_ERRORS_H__ #include #include #include #include G_BEGIN_DECLS #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_FOR (TP_ERROR) GQuark tp_errors_quark (void); /* this is deliberately the old one, so that it expands to a call to a * deprecated function, so that gcc will warn */ #define TP_ERRORS (tp_errors_quark ()) #endif GQuark tp_error_quark (void); #define TP_ERROR_PREFIX "org.freedesktop.Telepathy.Error" #define TP_ERROR (tp_error_quark ()) void tp_g_set_error_invalid_handle_type (guint type, GError **error); void tp_g_set_error_unsupported_handle_type (guint type, GError **error); typedef enum { TP_ERROR_NETWORK_ERROR, /*< nick=NetworkError >*/ TP_ERROR_NOT_IMPLEMENTED, /*< nick=NotImplemented >*/ TP_ERROR_INVALID_ARGUMENT, /*< nick=InvalidArgument >*/ TP_ERROR_NOT_AVAILABLE, /*< nick=NotAvailable >*/ TP_ERROR_PERMISSION_DENIED, /*< nick=PermissionDenied >*/ TP_ERROR_DISCONNECTED, /*< nick=Disconnected >*/ TP_ERROR_INVALID_HANDLE, /*< nick=InvalidHandle >*/ TP_ERROR_CHANNEL_BANNED, /*< nick=Channel.Banned >*/ TP_ERROR_CHANNEL_FULL, /*< nick=Channel.Full >*/ TP_ERROR_CHANNEL_INVITE_ONLY, /*< nick=Channel.InviteOnly >*/ TP_ERROR_NOT_YOURS, /*< nick=NotYours >*/ TP_ERROR_CANCELLED, /*< nick=Cancelled >*/ TP_ERROR_AUTHENTICATION_FAILED, /*< nick=AuthenticationFailed >*/ TP_ERROR_ENCRYPTION_NOT_AVAILABLE, /*< nick=EncryptionNotAvailable >*/ TP_ERROR_ENCRYPTION_ERROR, /*< nick=EncryptionError >*/ TP_ERROR_CERT_NOT_PROVIDED, /*< nick=Cert.NotProvided >*/ TP_ERROR_CERT_UNTRUSTED, /*< nick=Cert.Untrusted >*/ TP_ERROR_CERT_EXPIRED, /*< nick=Cert.Expired >*/ TP_ERROR_CERT_NOT_ACTIVATED, /*< nick=Cert.NotActivated >*/ TP_ERROR_CERT_FINGERPRINT_MISMATCH, /*< nick=Cert.FingerprintMismatch >*/ TP_ERROR_CERT_HOSTNAME_MISMATCH, /*< nick=Cert.HostnameMismatch >*/ TP_ERROR_CERT_SELF_SIGNED, /*< nick=Cert.SelfSigned >*/ TP_ERROR_CERT_INVALID, /*< nick=Cert.Invalid >*/ TP_ERROR_NOT_CAPABLE, /*< nick=NotCapable >*/ TP_ERROR_OFFLINE, /*< nick=Offline >*/ TP_ERROR_CHANNEL_KICKED, /*< nick=Channel.Kicked >*/ TP_ERROR_BUSY, /*< nick=Busy >*/ TP_ERROR_NO_ANSWER, /*< nick=NoAnswer >*/ TP_ERROR_DOES_NOT_EXIST, /*< nick=DoesNotExist >*/ TP_ERROR_TERMINATED, /*< nick=Terminated >*/ TP_ERROR_CONNECTION_REFUSED, /*< nick=ConnectionRefused >*/ TP_ERROR_CONNECTION_FAILED, /*< nick=ConnectionFailed >*/ TP_ERROR_CONNECTION_LOST, /*< nick=ConnectionLost >*/ TP_ERROR_ALREADY_CONNECTED, /*< nick=AlreadyConnected >*/ TP_ERROR_CONNECTION_REPLACED, /*< nick=ConnectionReplaced >*/ TP_ERROR_REGISTRATION_EXISTS, /*< nick=RegistrationExists >*/ TP_ERROR_SERVICE_BUSY, /*< nick=ServiceBusy >*/ TP_ERROR_RESOURCE_UNAVAILABLE, /*< nick=ResourceUnavailable >*/ TP_ERROR_WOULD_BREAK_ANONYMITY, /*< nick=WouldBreakAnonymity >*/ TP_ERROR_CERT_REVOKED, /*< nick=Cert.Revoked >*/ TP_ERROR_CERT_INSECURE, /*< nick=Cert.Insecure >*/ TP_ERROR_CERT_LIMIT_EXCEEDED, /*< nick=Cert.LimitExceeded >*/ TP_ERROR_NOT_YET, /*< nick=NotYet >*/ TP_ERROR_REJECTED, /*< nick=Rejected >*/ TP_ERROR_PICKED_UP_ELSEWHERE, /*< nick=PickedUpElsewhere >*/ TP_ERROR_CONFUSED, /*< nick=Confused >*/ TP_ERROR_SERVICE_CONFUSED, /*< nick=ServiceConfused >*/ TP_ERROR_EMERGENCY_CALLS_NOT_SUPPORTED, /*< nick=EmergencyCallsNotSupported >*/ TP_ERROR_SOFTWARE_UPGRADE_REQUIRED, /*< nick=SoftwareUpgradeRequired >*/ TP_ERROR_INSUFFICIENT_BALANCE, /*< nick=InsufficientBalance >*/ TP_ERROR_MEDIA_CODECS_INCOMPATIBLE, /*< nick=Media.CodecsIncompatible >*/ TP_ERROR_MEDIA_UNSUPPORTED_TYPE, /*< nick=Media.UnsupportedType >*/ TP_ERROR_MEDIA_STREAMING_ERROR, /*< nick=Media.StreamingError >*/ TP_ERROR_CAPTCHA_NOT_SUPPORTED, /*< nick=CaptchaNotSupported >*/ } TpError; const gchar *tp_error_get_dbus_name (TpError error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-dispatcher.c0000644000175000017500000001676112652510705020262 00000000000000/* * channel-dispatcher.c - proxy for the Telepathy channel dispatcher * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-dispatcher.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_DISPATCHER #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/_gen/tp-cli-channel-dispatcher-body.h" /** * SECTION:channel-dispatcher * @title: TpChannelDispatcher * @short_description: proxy object for the Telepathy channel dispatcher * @see_also: #TpChannelDispatchOperation, #TpChannelRequest * * The #TpChannelDispatcher object can be used to communicate with any * implementation of the Telepathy ChannelDispatcher service to request * new channels. */ /** * TpChannelDispatcher: * * The Channel Dispatcher's main D-Bus API is used to request channels, * which is done by calling tp_cli_channel_dispatcher_call_create_channel() or * tp_cli_channel_dispatcher_call_ensure_channel() as appropriate. * * The Telepathy Channel Dispatcher is also responsible for responding to new * channels and launching client processes to handle them. However, clients * that can work with incoming channels do not have to call methods * on the channel dispatcher: instead, they must register with the channel * dispatcher passively, by taking a bus name starting with * %TP_CLIENT_BUS_NAME_BASE and implementing the #TpSvcClient interface. * See the Telepathy D-Bus Interface Specification for details. * * This proxy is usable but incomplete: convenience methods will be added in * a later version of telepathy-glib, along with a mechanism similar to * tp_connection_call_when_ready(). * * Since: 0.7.32 */ /** * TpChannelDispatcherClass: * * The class of a #TpChannelDispatcher. */ struct _TpChannelDispatcherPrivate { gpointer dummy; }; G_DEFINE_TYPE (TpChannelDispatcher, tp_channel_dispatcher, TP_TYPE_PROXY) static void tp_channel_dispatcher_init (TpChannelDispatcher *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CHANNEL_DISPATCHER, TpChannelDispatcherPrivate); } static void tp_channel_dispatcher_constructed (GObject *object) { TpChannelDispatcher *self = TP_CHANNEL_DISPATCHER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_channel_dispatcher_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); } static void tp_channel_dispatcher_class_init (TpChannelDispatcherClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpChannelDispatcherPrivate)); object_class->constructed = tp_channel_dispatcher_constructed; proxy_class->interface = TP_IFACE_QUARK_CHANNEL_DISPATCHER; tp_channel_dispatcher_init_known_interfaces (); } /** * tp_channel_dispatcher_init_known_interfaces: * * Ensure that the known interfaces for TpChannelDispatcher have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CHANNEL_DISPATCHER. * * Since: 0.7.32 */ void tp_channel_dispatcher_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CHANNEL_DISPATCHER; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_channel_dispatcher_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_channel_dispatcher_new: * @bus_daemon: Proxy for the D-Bus daemon * * Convenience function to create a new channel dispatcher proxy. * * Returns: a new reference to a channel dispatcher proxy */ TpChannelDispatcher * tp_channel_dispatcher_new (TpDBusDaemon *bus_daemon) { TpChannelDispatcher *self; g_return_val_if_fail (bus_daemon != NULL, NULL); self = TP_CHANNEL_DISPATCHER (g_object_new (TP_TYPE_CHANNEL_DISPATCHER, "dbus-daemon", bus_daemon, "dbus-connection", ((TpProxy *) bus_daemon)->dbus_connection, "bus-name", TP_CHANNEL_DISPATCHER_BUS_NAME, "object-path", TP_CHANNEL_DISPATCHER_OBJECT_PATH, NULL)); return self; } static void present_channel_cb (TpChannelDispatcher *cd, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); } /** * tp_channel_dispatcher_present_channel_async: * @self: a #TpChannelDispatcher * @channel: a #TpChannel * @user_action_time: the time at which user action occurred, * or #TP_USER_ACTION_TIME_NOT_USER_ACTION if this presentation request is * for some reason not involving user action. * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls PresentChannel on the ChannelDispatcher to ask * to the handler of @channel to re-present it to the user. * You can then call tp_channel_dispatcher_present_channel_finish() to * get the result of the operation. * * Since: 0.15.0 */ void tp_channel_dispatcher_present_channel_async (TpChannelDispatcher *self, TpChannel *channel, gint64 user_action_time, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCHER (self)); g_return_if_fail (TP_IS_CHANNEL (channel)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatcher_present_channel_async); tp_cli_channel_dispatcher_call_present_channel (self, -1, tp_proxy_get_object_path (channel), user_action_time, present_channel_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_channel_dispatcher_present_channel_finish: * @self: a #TpBaseClient * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async channel presentation request started using * tp_channel_dispatcher_present_channel_async(). * * Returns: %TRUE if the call succeeded, otherwise %FALSE. * * Since: 0.15.0 */ gboolean tp_channel_dispatcher_present_channel_finish (TpChannelDispatcher *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_dispatcher_present_channel_async) } telepathy-glib-0.24.2/telepathy-glib/channel-dispatcher.h0000644000175000017500000000645212652510705020263 00000000000000/* * channel-dispatcher.h - proxy for the Telepathy channel dispatcher * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_CHANNEL_DISPATCHER_H #define TP_CHANNEL_DISPATCHER_H #include #include #include #include G_BEGIN_DECLS typedef struct _TpChannelDispatcher TpChannelDispatcher; typedef struct _TpChannelDispatcherClass TpChannelDispatcherClass; typedef struct _TpChannelDispatcherPrivate TpChannelDispatcherPrivate; typedef struct _TpChannelDispatcherClassPrivate TpChannelDispatcherClassPrivate; struct _TpChannelDispatcher { /**/ TpProxy parent; TpChannelDispatcherPrivate *priv; }; struct _TpChannelDispatcherClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpChannelDispatcherClassPrivate *priv; }; GType tp_channel_dispatcher_get_type (void); #define TP_TYPE_CHANNEL_DISPATCHER \ (tp_channel_dispatcher_get_type ()) #define TP_CHANNEL_DISPATCHER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CHANNEL_DISPATCHER, \ TpChannelDispatcher)) #define TP_CHANNEL_DISPATCHER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CHANNEL_DISPATCHER, \ TpChannelDispatcherClass)) #define TP_IS_CHANNEL_DISPATCHER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CHANNEL_DISPATCHER)) #define TP_IS_CHANNEL_DISPATCHER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CHANNEL_DISPATCHER)) #define TP_CHANNEL_DISPATCHER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL_DISPATCHER, \ TpChannelDispatcherClass)) TpChannelDispatcher *tp_channel_dispatcher_new (TpDBusDaemon *bus_daemon) G_GNUC_WARN_UNUSED_RESULT; void tp_channel_dispatcher_init_known_interfaces (void); _TP_AVAILABLE_IN_0_16 void tp_channel_dispatcher_present_channel_async (TpChannelDispatcher *self, TpChannel *channel, gint64 user_action_time, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_dispatcher_present_channel_finish ( TpChannelDispatcher *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/variant-util.c0000644000175000017500000003603412652510705017140 00000000000000/* * variant-util.c - Source for GVariant utilities * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:variant-util * @title: GVariant utilities * @short_description: some GVariant utility functions * * GVariant utility functions used in telepathy-glib. */ /** * SECTION:vardict * @title: Manipulating a{sv} mappings * @short_description: Functions to manipulate mappings from string to * variant, as represented in GVariant by a %G_VARIANT_TYPE_VARDICT * * These functions provide convenient access to the values in such * a mapping. * * Since: 0.19.10 */ #include "config.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_MISC #include "debug-internal.h" /* * _tp_asv_to_vardict: * * Returns: (transfer full): a #GVariant of type %G_VARIANT_TYPE_VARDICT */ GVariant * _tp_asv_to_vardict (const GHashTable *asv) { return _tp_boxed_to_variant (TP_HASH_TYPE_STRING_VARIANT_MAP, "a{sv}", (gpointer) asv); } GVariant * _tp_boxed_to_variant (GType gtype, const gchar *variant_type, gpointer boxed) { GValue v = G_VALUE_INIT; GVariant *ret; g_return_val_if_fail (boxed != NULL, NULL); g_value_init (&v, gtype); g_value_set_boxed (&v, boxed); ret = dbus_g_value_build_g_variant (&v); g_return_val_if_fail (!tp_strdiff (g_variant_get_type_string (ret), variant_type), NULL); g_value_unset (&v); return g_variant_ref_sink (ret); } /* * _tp_asv_from_vardict: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * * Returns: (transfer full): a newly created #GHashTable of * type #TP_HASH_TYPE_STRING_VARIANT_MAP */ GHashTable * _tp_asv_from_vardict (GVariant *variant) { GValue v = G_VALUE_INIT; GHashTable *result; g_return_val_if_fail (variant != NULL, NULL); g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_VARDICT), NULL); dbus_g_value_parse_g_variant (variant, &v); g_assert (G_VALUE_HOLDS (&v, TP_HASH_TYPE_STRING_VARIANT_MAP)); result = g_value_dup_boxed (&v); g_value_unset (&v); return result; } /** * tp_variant_type_classify: * @type: a #GVariantType * * Classifies @type according to its top-level type. * * Returns: the #GVariantClass of @type * Since: 0.19.10 **/ GVariantClass tp_variant_type_classify (const GVariantType *type) { /* Same as g_variant_classify() but for a GVariantType. This returns the first * letter of the dbus type and cast it to an enum where elements have the * ascii value of the type letters. */ return g_variant_type_peek_string (type)[0]; } static gdouble _tp_variant_convert_double (GVariant *variant, gboolean *valid) { *valid = TRUE; switch (g_variant_classify (variant)) { case G_VARIANT_CLASS_DOUBLE: return g_variant_get_double (variant); case G_VARIANT_CLASS_BYTE: return g_variant_get_byte (variant); case G_VARIANT_CLASS_UINT32: return g_variant_get_uint32 (variant); case G_VARIANT_CLASS_INT32: return g_variant_get_int32 (variant); case G_VARIANT_CLASS_INT64: return g_variant_get_int64 (variant); case G_VARIANT_CLASS_UINT64: return g_variant_get_uint64 (variant); default: break; } *valid = FALSE; return 0.0; } static gint32 _tp_variant_convert_int32 (GVariant *variant, gboolean *valid) { gint64 i; guint64 u; *valid = TRUE; switch (g_variant_classify (variant)) { case G_VARIANT_CLASS_BYTE: return g_variant_get_byte (variant); case G_VARIANT_CLASS_UINT32: u = g_variant_get_uint32 (variant); if (G_LIKELY (u <= G_MAXINT32)) return u; break; case G_VARIANT_CLASS_INT32: return g_variant_get_int32 (variant); case G_VARIANT_CLASS_INT64: i = g_variant_get_int64 (variant); if (G_LIKELY (i >= G_MININT32 && i <= G_MAXINT32)) return i; break; case G_VARIANT_CLASS_UINT64: u = g_variant_get_uint64 (variant); if (G_LIKELY (u <= G_MAXINT32)) return u; break; default: break; } *valid = FALSE; return 0; } static gint64 _tp_variant_convert_int64 (GVariant *variant, gboolean *valid) { guint64 u; *valid = TRUE; switch (g_variant_classify (variant)) { case G_VARIANT_CLASS_BYTE: return g_variant_get_byte (variant); case G_VARIANT_CLASS_UINT32: return g_variant_get_uint32 (variant); case G_VARIANT_CLASS_INT32: return g_variant_get_int32 (variant); case G_VARIANT_CLASS_INT64: return g_variant_get_int64 (variant); case G_VARIANT_CLASS_UINT64: u = g_variant_get_uint64 (variant); if (G_LIKELY (u <= G_MAXINT64)) return u; break; default: break; } *valid = FALSE; return 0; } static guint32 _tp_variant_convert_uint32 (GVariant *variant, gboolean *valid) { gint64 i; guint64 u; *valid = TRUE; switch (g_variant_classify (variant)) { case G_VARIANT_CLASS_BYTE: return g_variant_get_byte (variant); case G_VARIANT_CLASS_UINT32: return g_variant_get_uint32 (variant); case G_VARIANT_CLASS_INT32: i = g_variant_get_int32 (variant); if (G_LIKELY (i >= 0)) return i; break; case G_VARIANT_CLASS_INT64: i = g_variant_get_int64 (variant); if (G_LIKELY (i >= 0 && i <= G_MAXUINT32)) return i; break; case G_VARIANT_CLASS_UINT64: u = g_variant_get_uint64 (variant); if (G_LIKELY (u <= G_MAXUINT32)) return u; break; default: break; } *valid = FALSE; return 0; } static guint64 _tp_variant_convert_uint64 (GVariant *variant, gboolean *valid) { gint64 tmp; *valid = TRUE; switch (g_variant_classify (variant)) { case G_VARIANT_CLASS_BYTE: return g_variant_get_byte (variant); case G_VARIANT_CLASS_UINT32: return g_variant_get_uint32 (variant); case G_VARIANT_CLASS_INT32: tmp = g_variant_get_int32 (variant); if (G_LIKELY (tmp >= 0)) return tmp; break; case G_VARIANT_CLASS_INT64: tmp = g_variant_get_int64 (variant); if (G_LIKELY (tmp >= 0)) return tmp; break; case G_VARIANT_CLASS_UINT64: return g_variant_get_uint64 (variant); default: break; } *valid = FALSE; return 0; } /** * tp_variant_convert: * @variant: (transfer full): a #GVariant to convert * @type: a #GVariantType @variant must be converted to * * Convert the type of @variant to @type if possible. This takes ownership of * @variant. If no conversion is needed, simply return @variant. If conversion * is not possible, %NULL is returned. * * Returns: (transfer full): a new #GVariant owned by the caller. * Since: 0.19.10 **/ GVariant * tp_variant_convert (GVariant *variant, const GVariantType *type) { GVariant *ret = NULL; gboolean valid; if (variant == NULL) return NULL; g_variant_ref_sink (variant); if (g_variant_is_of_type (variant, type)) return variant; switch (tp_variant_type_classify (type)) { #define CASE(type) \ { \ g##type tmp = _tp_variant_convert_##type (variant, &valid); \ if (valid) \ ret = g_variant_new_##type (tmp); \ } case G_VARIANT_CLASS_DOUBLE: CASE (double); break; case G_VARIANT_CLASS_INT32: CASE (int32); break; case G_VARIANT_CLASS_INT64: CASE (int64); break; case G_VARIANT_CLASS_UINT32: CASE (uint32); break; case G_VARIANT_CLASS_UINT64: CASE (uint64); break; default: break; #undef CASE } g_variant_unref (variant); return (ret != NULL) ? g_variant_ref_sink (ret) : NULL; } /** * tp_vardict_get_string: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * * If a value for @key in @variant is present and is a string, return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as @variant is * kept. Copy it with g_strdup() if you need to keep it for longer. * * Returns: (transfer none) (allow-none): the string value of @key, or %NULL * Since: 0.19.10 */ const gchar * tp_vardict_get_string (GVariant *variant, const gchar *key) { const gchar *ret; g_return_val_if_fail (variant != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_VARDICT), NULL); if (!g_variant_lookup (variant, key, "&s", &ret)) return NULL; return ret; } /** * tp_vardict_get_object_path: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * * If a value for @key in @variant is present and is an object path, return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as @variant is * kept. Copy it with g_strdup() if you need to keep it for longer. * * Returns: (transfer none) (allow-none): the object path value of @key, or * %NULL * Since: 0.19.10 */ const gchar * tp_vardict_get_object_path (GVariant *variant, const gchar *key) { const gchar *ret; g_return_val_if_fail (variant != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_VARDICT), NULL); if (!g_variant_lookup (variant, key, "&o", &ret)) return NULL; return ret; } /** * tp_vardict_get_boolean: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location to store %TRUE if the key actually * exists and has a boolean value * * If a value for @key in @variant is present and boolean, return it, * and set *@valid to %TRUE if @valid is not %NULL. * * Otherwise return %FALSE, and set *@valid to %FALSE if @valid is not %NULL. * * Returns: a boolean value for @key * Since: 0.19.10 */ gboolean tp_vardict_get_boolean (GVariant *variant, const gchar *key, gboolean *valid) { gboolean ret; g_return_val_if_fail (variant != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_VARDICT), FALSE); if (!g_variant_lookup (variant, key, "b", &ret)) { if (valid != NULL) *valid = FALSE; return FALSE; } if (valid != NULL) *valid = TRUE; return ret; } #define IMPLEMENT(type) \ g##type \ tp_vardict_get_##type (GVariant *variant, \ const gchar *key, \ gboolean *valid) \ { \ g##type ret = 0; \ gboolean ret_valid = FALSE; \ GVariant *value; \ \ g_return_val_if_fail (variant != NULL, 0); \ g_return_val_if_fail (key != NULL, 0); \ g_return_val_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_VARDICT), 0); \ \ value = g_variant_lookup_value (variant, key, NULL); \ if (value != NULL) \ { \ ret = _tp_variant_convert_##type (value, &ret_valid); \ g_variant_unref (value); \ } \ \ if (valid != NULL) \ *valid = ret_valid; \ \ return ret; \ } /** * tp_vardict_get_double: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @variant is present and has any numeric type used by * GVariant (gint32, guint32, gint64, guint64 or gdouble), * return it as a double, and if @valid is not %NULL, set *@valid to %TRUE. * * Otherwise, return 0.0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the double precision floating-point value of @key, or 0.0 * Since: 0.19.10 */ IMPLEMENT (double) /** * tp_vardict_get_int32: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @variant is present, has an integer type used by * GVariant (gint32, guint32, gint64 or guint64) and fits in the * range of a gint32, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 32-bit signed integer value of @key, or 0 * Since: 0.19.10 */ IMPLEMENT (int32) /** * tp_vardict_get_int64: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @variant is present, has an integer type used by * GVariant (gint32, guint32, gint64 or guint64) and fits in the * range of a gint64, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 64-bit signed integer value of @key, or 0 * Since: 0.19.10 */ IMPLEMENT (int64) /** * tp_vardict_get_uint32: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @variant is present, has an integer type used by * GVariant (gint32, guint32, gint64 or guint64) and fits in the * range of a guint32, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 32-bit unsigned integer value of @key, or 0 * Since: 0.19.10 */ IMPLEMENT (uint32) /** * tp_vardict_get_uint64: * @variant: a #GVariant of type %G_VARIANT_TYPE_VARDICT * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @variant is present, has an integer type used by * GVariant (gint32, guint32, gint64 or guint64) and is non-negative, * return it, and if @valid is not %NULL, set *@valid to %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 64-bit unsigned integer value of @key, or 0 * Since: 0.19.10 */ IMPLEMENT (uint64) #undef IMPLEMENT telepathy-glib-0.24.2/telepathy-glib/variant-util.h0000644000175000017500000000412512652510705017141 00000000000000/* * variant-util.h - Header for GVariant utilities * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_VARIANT_UTIL_H__ #define __TP_VARIANT_UTIL_H__ #include #include G_BEGIN_DECLS GVariantClass tp_variant_type_classify (const GVariantType *type); GVariant *tp_variant_convert (GVariant *variant, const GVariantType *type); const gchar *tp_vardict_get_string (GVariant *variant, const gchar *key); const gchar *tp_vardict_get_object_path (GVariant *variant, const gchar *key); gboolean tp_vardict_get_boolean (GVariant *variant, const gchar *key, gboolean *valid); gdouble tp_vardict_get_double (GVariant *variant, const gchar *key, gboolean *valid); gint32 tp_vardict_get_int32 (GVariant *variant, const gchar *key, gboolean *valid); gint64 tp_vardict_get_int64 (GVariant *variant, const gchar *key, gboolean *valid); guint32 tp_vardict_get_uint32 (GVariant *variant, const gchar *key, gboolean *valid); guint64 tp_vardict_get_uint64 (GVariant *variant, const gchar *key, gboolean *valid); G_END_DECLS #endif /* __TP_VARIANT_UTIL_H__ */ telepathy-glib-0.24.2/telepathy-glib/account-request.c0000644000175000017500000012025514004033172017631 00000000000000/* * account-request.c - object for a currently non-existent account to create * * Copyright © 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/account-request.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_ACCOUNTS #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" /** * SECTION:account-request * @title: TpAccountRequest * @short_description: object for a currently non-existent account in * order to create easily without speaking fluent D-Bus * @see_also: #TpAccountManager * * This is a convenience object to aid in the creation of accounts on * a #TpAccountManager without having to construct #GHashTables with * well-known keys. For example: * * |[ * static void created_cb (GObject *object, GAsyncResult *res, gpointer user_data); * * static void * create_acount (void) * { * TpAccountManager *am = tp_account_manager_dup (); * TpAccountRequest *req; * * req = tp_account_request_new (am, "gabble", "jabber", "Work Jabber account"); * * tp_account_request_set_parameter (req, "account", "walter.white@lospollos.lit"); * * // ... * * tp_account_request_create_account_async (req, created_cb, NULL); * g_object_unref (req); * g_object_unref (am); * } * * static void * created_cb (GObject *object, * GAsyncResult *result, * gpointer user_data) * { * TpAccountRequest *req = TP_ACCOUNT_REQUEST (object); * TpAccount *account; * GError *error = NULL; * * account = tp_account_request_create_account_finish (req, result, &error); * * if (account == NULL) * { * g_error ("Failed to create account: %s\n", error->message); * g_clear_error (&error); * return; * } * * // ... * * g_object_unref (account); * } * ]| * * * Since: 0.19.1 */ /** * TpAccountRequest: * * An object for representing a currently non-existent account which * is to be created on a #TpAccountManager. * * Since: 0.19.1 */ /** * TpAccountRequestClass: * * The class of a #TpAccountRequest. */ struct _TpAccountRequestPrivate { TpAccountManager *account_manager; GSimpleAsyncResult *result; gboolean created; gchar *cm_name; gchar *proto_name; gchar *display_name; GHashTable *parameters; GHashTable *properties; }; G_DEFINE_TYPE (TpAccountRequest, tp_account_request, G_TYPE_OBJECT) /* properties */ enum { PROP_ACCOUNT_MANAGER = 1, PROP_CONNECTION_MANAGER, PROP_PROTOCOL, PROP_DISPLAY_NAME, PROP_PARAMETERS, PROP_PROPERTIES, PROP_ICON_NAME, PROP_NICKNAME, PROP_REQUESTED_PRESENCE_TYPE, PROP_REQUESTED_STATUS, PROP_REQUESTED_STATUS_MESSAGE, PROP_AUTOMATIC_PRESENCE_TYPE, PROP_AUTOMATIC_STATUS, PROP_AUTOMATIC_STATUS_MESSAGE, PROP_ENABLED, PROP_CONNECT_AUTOMATICALLY, PROP_SUPERSEDES, PROP_AVATAR, PROP_AVATAR_MIME_TYPE, PROP_SERVICE, PROP_STORAGE_PROVIDER, N_PROPS }; static void tp_account_request_init (TpAccountRequest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ACCOUNT_REQUEST, TpAccountRequestPrivate); } static void tp_account_request_constructed (GObject *object) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (object); TpAccountRequestPrivate *priv = self->priv; void (*chain_up) (GObject *) = ((GObjectClass *) tp_account_request_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (priv->account_manager != NULL); g_assert (priv->cm_name != NULL); g_assert (priv->proto_name != NULL); g_assert (priv->display_name != NULL); priv->parameters = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); priv->properties = tp_asv_new (NULL, NULL); } #define GET_PRESENCE_VALUE(key, offset, type) \ G_STMT_START { \ GValueArray *_arr = tp_asv_get_boxed (self->priv->properties, \ key, TP_STRUCT_TYPE_SIMPLE_PRESENCE); \ if (_arr != NULL) \ g_value_set_##type (value, g_value_get_##type (_arr->values + offset)); \ } G_STMT_END static void tp_account_request_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (object); switch (prop_id) { case PROP_ACCOUNT_MANAGER: g_value_set_object (value, self->priv->account_manager); break; case PROP_CONNECTION_MANAGER: g_value_set_string (value, self->priv->cm_name); break; case PROP_PROTOCOL: g_value_set_string (value, self->priv->proto_name); break; case PROP_DISPLAY_NAME: g_value_set_string (value, self->priv->display_name); break; case PROP_PARAMETERS: g_value_take_variant (value, _tp_asv_to_vardict (self->priv->parameters)); break; case PROP_PROPERTIES: g_value_take_variant (value, _tp_asv_to_vardict (self->priv->properties)); break; case PROP_ICON_NAME: g_value_set_string (value, tp_asv_get_string (self->priv->properties, TP_PROP_ACCOUNT_ICON)); break; case PROP_NICKNAME: g_value_set_string (value, tp_asv_get_string (self->priv->properties, TP_PROP_ACCOUNT_NICKNAME)); break; case PROP_REQUESTED_PRESENCE_TYPE: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 0, uint); break; case PROP_REQUESTED_STATUS: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 1, string); break; case PROP_REQUESTED_STATUS_MESSAGE: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_REQUESTED_PRESENCE, 2, string); break; case PROP_AUTOMATIC_PRESENCE_TYPE: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 0, uint); break; case PROP_AUTOMATIC_STATUS: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 1, string); break; case PROP_AUTOMATIC_STATUS_MESSAGE: GET_PRESENCE_VALUE (TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, 2, string); break; case PROP_ENABLED: g_value_set_boolean (value, tp_asv_get_boolean (self->priv->properties, TP_PROP_ACCOUNT_ENABLED, NULL)); break; case PROP_CONNECT_AUTOMATICALLY: g_value_set_boolean (value, tp_asv_get_boolean (self->priv->properties, TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY, NULL)); break; case PROP_SUPERSEDES: { GPtrArray *array = tp_asv_get_boxed (self->priv->properties, TP_PROP_ACCOUNT_SUPERSEDES, TP_ARRAY_TYPE_OBJECT_PATH_LIST); if (array != NULL) { /* add the NULL-termination to make it a real GStrv */ g_ptr_array_add (array, NULL); g_value_set_boxed (value, array->pdata); g_ptr_array_remove_index (array, (array->len - 1)); } else { g_value_set_boxed (value, NULL); } } break; case PROP_AVATAR: { GValueArray *array = tp_asv_get_boxed (self->priv->properties, TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR, TP_STRUCT_TYPE_AVATAR); if (array != NULL) g_value_set_boxed (value, g_value_get_boxed (array->values)); } break; case PROP_AVATAR_MIME_TYPE: { GValueArray *array = tp_asv_get_boxed (self->priv->properties, TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR, TP_STRUCT_TYPE_AVATAR); if (array != NULL) g_value_set_string (value, g_value_get_string (array->values + 1)); } break; case PROP_SERVICE: g_value_set_string (value, tp_asv_get_string (self->priv->properties, TP_PROP_ACCOUNT_SERVICE)); break; case PROP_STORAGE_PROVIDER: g_value_set_string (value, tp_asv_get_string (self->priv->properties, TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } #undef GET_PRESENCE_VALUE static void tp_account_request_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (object); TpAccountRequestPrivate *priv = self->priv; switch (property_id) { case PROP_ACCOUNT_MANAGER: g_assert (priv->account_manager == NULL); priv->account_manager = g_value_dup_object (value); break; case PROP_CONNECTION_MANAGER: g_assert (priv->cm_name == NULL); priv->cm_name = g_value_dup_string (value); break; case PROP_PROTOCOL: g_assert (priv->proto_name == NULL); priv->proto_name = g_value_dup_string (value); break; case PROP_DISPLAY_NAME: g_assert (priv->display_name == NULL); priv->display_name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_account_request_dispose (GObject *object) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (object); TpAccountRequestPrivate *priv = self->priv; g_clear_object (&priv->account_manager); tp_clear_pointer (&priv->parameters, g_hash_table_unref); tp_clear_pointer (&priv->properties, g_hash_table_unref); /* release any references held by the object here */ if (G_OBJECT_CLASS (tp_account_request_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_account_request_parent_class)->dispose (object); } static void tp_account_request_finalize (GObject *object) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (object); TpAccountRequestPrivate *priv = self->priv; tp_clear_pointer (&priv->cm_name, g_free); tp_clear_pointer (&priv->proto_name, g_free); tp_clear_pointer (&priv->display_name, g_free); /* free any data held directly by the object here */ if (G_OBJECT_CLASS (tp_account_request_parent_class)->finalize != NULL) G_OBJECT_CLASS (tp_account_request_parent_class)->finalize (object); } static void tp_account_request_class_init (TpAccountRequestClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpAccountRequestPrivate)); object_class->constructed = tp_account_request_constructed; object_class->get_property = tp_account_request_get_property; object_class->set_property = tp_account_request_set_property; object_class->dispose = tp_account_request_dispose; object_class->finalize = tp_account_request_finalize; /** * TpAccountRequest:account-manager: * * The #TpAccountManager to create the account on. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_ACCOUNT_MANAGER, g_param_spec_object ("account-manager", "Account manager", "The account's account manager", TP_TYPE_ACCOUNT_MANAGER, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * TpAccountRequest:connection-manager: * * The account's connection manager name. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_CONNECTION_MANAGER, g_param_spec_string ("connection-manager", "Connection manager", "The account's connection manager name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * TpAccountRequest:protocol: * * The account's machine-readable protocol name, such as "jabber", "msn" or * "local-xmpp". Recommended names for most protocols can be found in the * Telepathy D-Bus Interface Specification. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_PROTOCOL, g_param_spec_string ("protocol", "Protocol", "The account's protocol name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * TpAccountRequest:display-name: * * The account's display name. To change this property use * tp_account_request_set_display_name(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_DISPLAY_NAME, g_param_spec_string ("display-name", "DisplayName", "The account's display name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); /** * TpAccountRequest:parameters: * * The account's connection parameters. To add a parameter, use * tp_account_request_set_parameter() or another convience function. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_PARAMETERS, g_param_spec_variant ("parameters", "Parameters", "Connection parameters of the account", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:properties: * * The account's properties. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_PROPERTIES, g_param_spec_variant ("properties", "Properties", "Account properties", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:icon-name: * * The account's icon name. To change this propery, use * tp_account_request_set_icon_name(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_ICON_NAME, g_param_spec_string ("icon-name", "Icon", "The account's icon name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:nickname: * * The account's nickname. To change this property use * tp_account_request_set_nickname(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_NICKNAME, g_param_spec_string ("nickname", "Nickname", "The account's nickname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:requested-presence-type: * * The account's requested presence type (a * #TpConnectionPresenceType). To change this property use * tp_account_request_set_requested_presence(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_REQUESTED_PRESENCE_TYPE, g_param_spec_uint ("requested-presence-type", "RequestedPresence", "The account's requested presence type", 0, TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:requested-status: * * The requested Status string of the account. To change this * property use tp_account_request_set_requested_presence(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_REQUESTED_STATUS, g_param_spec_string ("requested-status", "RequestedStatus", "The account's requested status string", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:requested-status-message: * * The requested status message message of the account. To change * this property use tp_account_request_set_requested_presence(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_REQUESTED_STATUS_MESSAGE, g_param_spec_string ("requested-status-message", "RequestedStatusMessage", "The requested Status message string of the account", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:automatic-presence-type: * * The account's automatic presence type (a * #TpConnectionPresenceType). To change this property use * tp_account_request_set_automatic_presence(). * * When the account is put online automatically, for instance to * make a channel request or because network connectivity becomes * available, the automatic presence type, status and message will * be copied to their "requested" counterparts. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_PRESENCE_TYPE, g_param_spec_uint ("automatic-presence-type", "AutomaticPresence type", "Presence type used to put the account online automatically", 0, TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:automatic-status: * * The string status name to use in conjunction with the * #TpAccountRequest:automatic-presence-type. To change this property * use tp_account_request_set_automatic_presence(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_STATUS, g_param_spec_string ("automatic-status", "AutomaticPresence status", "Presence status used to put the account online automatically", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:automatic-status-message: * * The user-defined message to use in conjunction with the * #TpAccount:automatic-presence-type. To change this property use * tp_account_request_set_automatic_presence(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_STATUS_MESSAGE, g_param_spec_string ("automatic-status-message", "AutomaticPresence message", "User-defined message used to put the account online automatically", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:enabled: * * Whether the account is enabled or not. To change this property * use tp_account_request_set_enabled(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_ENABLED, g_param_spec_boolean ("enabled", "Enabled", "Whether this account is enabled or not", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:connect-automatically: * * Whether the account should connect automatically or not. To change this * property, use tp_account_request_set_connect_automatically(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_CONNECT_AUTOMATICALLY, g_param_spec_boolean ("connect-automatically", "ConnectAutomatically", "Whether this account should connect automatically or not", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:supersedes: * * The object paths of previously-active accounts superseded by this one. * For instance, this can be used in a logger to read old logs for an * account that has been migrated from one connection manager to another. * * To add to this property use tp_account_request_add_supersedes(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_SUPERSEDES, g_param_spec_boxed ("supersedes", "Supersedes", "Accounts superseded by this one", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:avatar: * * The avatar set on the account. The avatar's mime type can be read * in the #TpAccountRequest:avatar-mime-type property. To change this * property, use tp_account_request_set_avatar(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_AVATAR, g_param_spec_boxed ("avatar", "Avatar", "The account's avatar data", G_TYPE_ARRAY, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:avatar-mime-type: * * The mime type of the #TpAccountRequest:avatar property. To change * this property, use tp_account_request_set_avatar(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_AVATAR_MIME_TYPE, g_param_spec_string ("avatar-mime-type", "Avatar mime type", "The account's avatar's mime type", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:service: * * A string describing the service of the account, which must * consist only of ASCII letters, numbers and hyphen/minus signs, * and start with a letter (matching the requirements for * Protocol). To change this property, use * tp_account_request_set_service(). * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_SERVICE, g_param_spec_string ("service", "Service", "The account's service", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccountRequest:storage-provider: * * The account's storage provider. To change this property use * tp_account_request_set_storage_provider(). * * Since: 0.19.4 */ g_object_class_install_property (object_class, PROP_STORAGE_PROVIDER, g_param_spec_string ("storage-provider", "Storage Provider", "The account's storage provider", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); } /** * tp_account_request_new: * @account_manager: the #TpAccountManager to create the account on * @manager: the name of the connection manager * @protocol: the name of the protocol on @manager * @display_name: the user-visible name of this account * * Convenience function to create a new account request object which * will assist in the creation of a new account on @account_manager, * using connection manager @manager, and protocol @protocol. * * Returns: (transfer full): a new reference to an account request * object, or %NULL if any argument is incorrect * * Since: 0.19.1 */ TpAccountRequest * tp_account_request_new (TpAccountManager *account_manager, const gchar *manager, const gchar *protocol, const gchar *display_name) { g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (account_manager), NULL); g_return_val_if_fail (manager != NULL, NULL); g_return_val_if_fail (protocol != NULL, NULL); return g_object_new (TP_TYPE_ACCOUNT_REQUEST, "account-manager", account_manager, "connection-manager", manager, "protocol", protocol, "display-name", display_name, NULL); } /** * tp_account_request_new_from_protocol: * @account_manager: the #TpAccountManager to create the account on * @protocol: a #TpProtocol * @display_name: the user-visible name of this account * * Convenience function to create a new #TpAccountRequest object using * a #TpProtocol instance, instead of specifying connection manager * and protocol name specifically. See tp_account_request_new() for * more details. * * Returns: (transfer full): a new reference to an account request * object, or %NULL if any argument is incorrect * * Since: 0.19.1 */ TpAccountRequest * tp_account_request_new_from_protocol (TpAccountManager *account_manager, TpProtocol *protocol, const gchar *display_name) { g_return_val_if_fail (TP_IS_ACCOUNT_MANAGER (account_manager), NULL); g_return_val_if_fail (TP_IS_PROTOCOL (protocol), NULL); return g_object_new (TP_TYPE_ACCOUNT_REQUEST, "account-manager", account_manager, "connection-manager", tp_protocol_get_cm_name (protocol), "protocol", tp_protocol_get_name (protocol), "display-name", display_name, NULL); } /** * tp_account_request_set_display_name: * @self: a #TpAccountRequest * @name: a display name for the account * * Set the display name for the new account, @self, to @name. Use the * #TpAccountRequest:display-name property to read the current display * name. * * Since: 0.19.1 */ void tp_account_request_set_display_name (TpAccountRequest *self, const gchar *name) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (name != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); g_free (priv->display_name); priv->display_name = g_strdup (name); } /** * tp_account_request_set_icon_name: * @self: a #TpAccountRequest * @icon: an icon name for the account * * Set the icon name for the new account, @self, to @icon. Use the * #TpAccountRequest:icon-name property to read the current icon name. * * Since: 0.19.1 */ void tp_account_request_set_icon_name (TpAccountRequest *self, const gchar *icon) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (icon != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_ICON, icon); } /** * tp_account_request_set_nickname: * @self: a #TpAccountRequest * @nickname: a nickname for the account * * Set the nickname for the new account, @self, to @nickname. Use the * #TpAccountRequest:nickname property to read the current nickname. * * Since: 0.19.1 */ void tp_account_request_set_nickname (TpAccountRequest *self, const gchar *nickname) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (nickname != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_NICKNAME, nickname); } /** * tp_account_request_set_requested_presence: * @self: a #TpAccountRequest * @presence: the requested presence type * @status: the requested presence status * @message: the requested presence message * * Set the requested presence for the new account, @self, to the type * (@presence, @status), with message @message. Use the * #TpAccountRequest:requested-presence-type, * #TpAccountRequest:requested-status, and * #TpAccountRequest:requested-status-message properties to read the * current requested presence. * * Since: 0.19.1 */ void tp_account_request_set_requested_presence (TpAccountRequest *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { TpAccountRequestPrivate *priv; GValue *value; GValueArray *arr; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); value = tp_g_value_slice_new_take_boxed (TP_STRUCT_TYPE_SIMPLE_PRESENCE, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_SIMPLE_PRESENCE)); arr = (GValueArray *) g_value_get_boxed (value); g_value_set_uint (arr->values, presence); g_value_set_string (arr->values + 1, status); g_value_set_string (arr->values + 2, message); g_hash_table_insert (priv->properties, TP_PROP_ACCOUNT_REQUESTED_PRESENCE, value); } /** * tp_account_request_set_automatic_presence: * @self: a #TpAccountRequest * @presence: the automatic presence type * @status: the automatic presence status * @message: the automatic presence message * * Set the automatic presence for the new account, @self, to the type * (@presence, @status), with message @message. Use the * #TpAccountRequest:automatic-presence-type, * #TpAccountRequest:automatic-status, and * #TpAccountRequest:automatic-status-message properties to read the * current automatic presence. * * Since: 0.19.1 */ void tp_account_request_set_automatic_presence (TpAccountRequest *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message) { TpAccountRequestPrivate *priv; GValue *value; GValueArray *arr; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); value = tp_g_value_slice_new_take_boxed (TP_STRUCT_TYPE_SIMPLE_PRESENCE, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_SIMPLE_PRESENCE)); arr = (GValueArray *) g_value_get_boxed (value); g_value_set_uint (arr->values, presence); g_value_set_string (arr->values + 1, status); g_value_set_string (arr->values + 2, message); g_hash_table_insert (priv->properties, TP_PROP_ACCOUNT_AUTOMATIC_PRESENCE, value); } /** * tp_account_request_set_enabled: * @self: a #TpAccountRequest * @enabled: %TRUE if the account is to be enabled * * Set the enabled property of the account on creation to * @enabled. Use the #TpAccountRequest:enabled property to read the * current enabled value. * * Since: 0.19.1 */ void tp_account_request_set_enabled (TpAccountRequest *self, gboolean enabled) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_boolean (priv->properties, TP_PROP_ACCOUNT_ENABLED, enabled); } /** * tp_account_request_set_connect_automatically: * @self: a #TpAccountRequest * @connect_automatically: %TRUE if the account is to connect automatically * * Set the connect automatically property of the account on creation * to @connect_automatically so that the account is brought online to * the automatic presence. Use the * #TpAccountRequest:connect-automatically property to read the current * connect automatically value. * * Since: 0.19.1 */ void tp_account_request_set_connect_automatically (TpAccountRequest *self, gboolean connect_automatically) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_boolean (priv->properties, TP_PROP_ACCOUNT_CONNECT_AUTOMATICALLY, connect_automatically); } /** * tp_account_request_add_supersedes: * @self: a #TpAccountRequest * @superseded_path: an account object path to add to the supersedes * list * * Add an account object path to the list of superseded accounts which * this new account will supersede. Use the * #TpAccountRequest:supersedes property to read the current list of * superseded accounts. * * Since: 0.19.1 */ void tp_account_request_add_supersedes (TpAccountRequest *self, const gchar *superseded_path) { TpAccountRequestPrivate *priv; GPtrArray *array; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (g_variant_is_object_path (superseded_path)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); array = tp_asv_get_boxed (priv->properties, TP_PROP_ACCOUNT_SUPERSEDES, TP_ARRAY_TYPE_OBJECT_PATH_LIST); if (array == NULL) { array = g_ptr_array_new (); tp_asv_take_boxed (priv->properties, TP_PROP_ACCOUNT_SUPERSEDES, TP_ARRAY_TYPE_OBJECT_PATH_LIST, array); } g_ptr_array_add (array, g_strdup (superseded_path)); } /** * tp_account_request_set_avatar: * @self: a #TpAccountRequest * @avatar: (allow-none) (array length=len): a new avatar to set; can * be %NULL only if %len equals 0 * @len: the length of the new avatar * @mime_type: (allow-none): the MIME type of the new avatar; can be %NULL * only if @len equals 0 * * Set the avatar of the account @self to @avatar. Use the * #TpAccountRequest:avatar and #TpAccountRequest:avatar-mime-type * properties to read the current avatar. * * Since: 0.19.1 */ void tp_account_request_set_avatar (TpAccountRequest *self, const guchar *avatar, gsize len, const gchar *mime_type) { TpAccountRequestPrivate *priv; GArray *tmp; GValueArray *arr; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (avatar != NULL || len == 0); g_return_if_fail (mime_type != NULL || len == 0); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tmp = g_array_new (FALSE, FALSE, sizeof (guchar)); if (len > 0) g_array_append_vals (tmp, avatar, len); arr = tp_value_array_build (2, TP_TYPE_UCHAR_ARRAY, tmp, G_TYPE_STRING, mime_type, G_TYPE_INVALID); g_array_unref (tmp); tp_asv_take_boxed (priv->properties, TP_PROP_ACCOUNT_INTERFACE_AVATAR_AVATAR, TP_STRUCT_TYPE_AVATAR, arr); } /** * tp_account_request_set_service: * @self: a #TpAccountRequest * @service: the service name for * * Set the service property of the account to @service. Use the * #TpAccountRequest:service property to read the current value. * * Since: 0.19.1 */ void tp_account_request_set_service (TpAccountRequest *self, const gchar *service) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (service != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_SERVICE, service); } /** * tp_account_request_set_storage_provider: * @self: a #TpAccountRequest * @provider: the name of an account storage implementation * * Set the account storage to use when creating the account. Use the * #TpAccountRequest:storage-provider property to read the current value. * * Since: 0.19.4 */ void tp_account_request_set_storage_provider (TpAccountRequest *self, const gchar *provider) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); tp_asv_set_string (priv->properties, TP_PROP_ACCOUNT_INTERFACE_STORAGE_STORAGE_PROVIDER, provider); } /** * tp_account_request_set_parameter: * @self: a #TpAccountRequest * @key: the parameter key * @value: (transfer none): a variant containing the parameter value * * Set an account parameter, @key, to @value. Use the * #TpAccountRequest:parameters property to read the current list of * set parameters. * * Parameters can be unset using tp_account_request_unset_parameter(). * * Since: 0.19.1 */ void tp_account_request_set_parameter (TpAccountRequest *self, const gchar *key, GVariant *value) { TpAccountRequestPrivate *priv; GValue one = G_VALUE_INIT, *two; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); dbus_g_value_parse_g_variant (value, &one); two = tp_g_value_slice_dup (&one); g_hash_table_insert (priv->parameters, g_strdup (key), two); g_value_unset (&one); } /** * tp_account_request_unset_parameter: * @self: a #TpAccountRequest * @key: the parameter key * * Unset the account parameter @key which has previously been set * using tp_account_request_set_parameter() or another convenience * function. * * Since: 0.19.1 */ void tp_account_request_unset_parameter (TpAccountRequest *self, const gchar *key) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (key != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); g_hash_table_remove (priv->parameters, key); } /** * tp_account_request_set_parameter_string: (skip) * @self: a #TpAccountRequest * @key: the parameter key * @value: the parameter value * * Convenience function to set an account parameter string value. See * tp_account_request_set_parameter() for more details. * * Since: 0.19.1 */ void tp_account_request_set_parameter_string (TpAccountRequest *self, const gchar *key, const gchar *value) { TpAccountRequestPrivate *priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); priv = self->priv; g_return_if_fail (priv->result == NULL && !priv->created); g_hash_table_insert (priv->parameters, g_strdup (key), tp_g_value_slice_new_string (value)); } static void tp_account_request_account_prepared_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpAccountRequest *self = user_data; TpAccountRequestPrivate *priv = self->priv; GError *error = NULL; if (!tp_proxy_prepare_finish (object, result, &error)) { DEBUG ("Error preparing account: %s", error->message); g_simple_async_result_take_error (priv->result, error); } g_simple_async_result_complete (priv->result); g_clear_object (&priv->result); } static void tp_account_request_create_account_cb (TpAccountManager *proxy, const gchar *account_path, const GError *error, gpointer user_data, GObject *weak_object) { TpAccountRequest *self = TP_ACCOUNT_REQUEST (weak_object); TpAccountRequestPrivate *priv = self->priv; GError *e = NULL; TpAccount *account; GArray *features; if (error != NULL) { DEBUG ("failed to create account: %s", error->message); g_simple_async_result_set_from_error (priv->result, error); g_simple_async_result_complete (priv->result); g_clear_object (&priv->result); return; } priv->created = TRUE; account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (proxy), account_path, NULL, &e); if (account == NULL) { g_simple_async_result_take_error (priv->result, e); g_simple_async_result_complete (priv->result); g_clear_object (&priv->result); return; } /* Give account's ref to the result */ g_simple_async_result_set_op_res_gpointer (priv->result, account, g_object_unref); features = tp_simple_client_factory_dup_account_features ( tp_proxy_get_factory (proxy), account); tp_proxy_prepare_async (account, (GQuark *) features->data, tp_account_request_account_prepared_cb, self); g_array_unref (features); } /** * tp_account_request_create_account_async: * @self: a #TpAccountRequest * @callback: a function to call when the account has been created * @user_data: user data to @callback * * Start an asynchronous operation to create the account @self on the * account manager. * * @callback will only be called when the newly created #TpAccount has * the %TP_ACCOUNT_FEATURE_CORE feature ready on it, so when calling * tp_account_request_create_account_finish(), one can guarantee this * feature. * * Since: 0.19.1 */ void tp_account_request_create_account_async (TpAccountRequest *self, GAsyncReadyCallback callback, gpointer user_data) { TpAccountRequestPrivate *priv = self->priv; g_return_if_fail (TP_IS_ACCOUNT_REQUEST (self)); priv = self->priv; if (priv->result != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_BUSY, "An account creation operation has already been started on this " "account request"); return; } if (priv->created) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "This account has already been created"); return; } priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_request_create_account_async); tp_cli_account_manager_call_create_account (priv->account_manager, -1, priv->cm_name, priv->proto_name, priv->display_name, priv->parameters, priv->properties, tp_account_request_create_account_cb, NULL, NULL, G_OBJECT (self)); } /** * tp_account_request_create_account_finish: * @self: a #TpAccountRequest * @result: a #GAsyncResult * @error: something * * Finishes an asynchronous account creation operation and returns a * new ref to a #TpAccount object. The returned account will have the * features listed in tp_simple_client_factory_dup_account_features() * (with the proxy factory from #TpAccountRequest:account-manager) * prepared on it. * * Returns: (transfer full): a new ref to a #TpAccount, or %NULL * * Since: 0.19.1 */ TpAccount * tp_account_request_create_account_finish (TpAccountRequest *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_account_request_create_account_async, g_object_ref); } telepathy-glib-0.24.2/telepathy-glib/account-request.h0000644000175000017500000001177712652510705017657 00000000000000/* * account-request.h - object for a currently non-existent account to create * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_ACCOUNT_REQUEST_H #define TP_ACCOUNT_REQUEST_H #include #include #include G_BEGIN_DECLS typedef struct _TpAccountRequest TpAccountRequest; typedef struct _TpAccountRequestClass TpAccountRequestClass; typedef struct _TpAccountRequestPrivate TpAccountRequestPrivate; struct _TpAccountRequest { /**/ GObject parent; TpAccountRequestPrivate *priv; }; struct _TpAccountRequestClass { /**/ GObjectClass parent_class; GCallback _padding[7]; }; GType tp_account_request_get_type (void); #define TP_TYPE_ACCOUNT_REQUEST \ (tp_account_request_get_type ()) #define TP_ACCOUNT_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT_REQUEST, \ TpAccountRequest)) #define TP_ACCOUNT_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT_REQUEST, \ TpAccountRequestClass)) #define TP_IS_ACCOUNT_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT_REQUEST)) #define TP_IS_ACCOUNT_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT_REQUEST)) #define TP_ACCOUNT_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT_REQUEST, \ TpAccountRequestClass)) _TP_AVAILABLE_IN_0_20 TpAccountRequest * tp_account_request_new ( TpAccountManager *account_manager, const gchar *manager, const gchar *protocol, const gchar *display_name) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 TpAccountRequest * tp_account_request_new_from_protocol ( TpAccountManager *account_manager, TpProtocol *protocol, const gchar *display_name) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 void tp_account_request_set_display_name (TpAccountRequest *self, const gchar *name); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_icon_name (TpAccountRequest *self, const gchar *icon); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_nickname (TpAccountRequest *self, const gchar *nickname); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_requested_presence (TpAccountRequest *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_automatic_presence (TpAccountRequest *self, TpConnectionPresenceType presence, const gchar *status, const gchar *message); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_enabled (TpAccountRequest *self, gboolean enabled); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_connect_automatically (TpAccountRequest *self, gboolean connect_automatically); _TP_AVAILABLE_IN_0_20 void tp_account_request_add_supersedes (TpAccountRequest *self, const gchar *superseded_path); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_avatar (TpAccountRequest *self, const guchar *avatar, gsize len, const gchar *mime_type); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_service (TpAccountRequest *self, const gchar *service); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_storage_provider (TpAccountRequest *self, const gchar *provider); /* parameters */ _TP_AVAILABLE_IN_0_20 void tp_account_request_set_parameter (TpAccountRequest *self, const gchar *key, GVariant *value); _TP_AVAILABLE_IN_0_20 void tp_account_request_unset_parameter (TpAccountRequest *self, const gchar *key); _TP_AVAILABLE_IN_0_20 void tp_account_request_set_parameter_string (TpAccountRequest *self, const gchar *key, const gchar *value); /* create it */ _TP_AVAILABLE_IN_0_20 void tp_account_request_create_account_async (TpAccountRequest *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 TpAccount * tp_account_request_create_account_finish (TpAccountRequest *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/simple-password-manager.c0000644000175000017500000003711012652510705021256 00000000000000/* * simple-password-manager.c - Source for TpSimplePasswordManager * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:simple-password-manager * @title: TpSimplePasswordManager * @short_description: a simple X-TELEPATHY-PASSWORD channel manager * * This class makes it easy to implement the X-TELEPATHY-PASSWORD SASL * mechanism in a connection manger. It implements the * #TpChannelManager interface and pops up a ServerAuthentication * channel when tp_simple_password_manager_prompt_async() is called to * enable a channel handler to pass in the password using the * appropriate D-Bus methods. * * This channel manager is only useful for connection managers only * wanting to implement the X-TELEPATHY-PASSWORD SASL mechanism in * authentication channels. For connections with more SASL mechanisms, * the channel manager and channel itself should be reimplemented to * support the desired mechanisms. * * A new #TpSimplePasswordManager object should be created in the * #TpBaseConnectionClass->create_channel_managers implementation and * added to the #GPtrArray of channel managers. Then, in the * #TpBaseConnectionClass->start_connecting implementation, once the * connection status has been changed to CONNECTING, the connection * should check whether a password parameter was given when creating * the connection through RequestConnection. If a password is present, * the connection should go ahead and use it. If it is not present, * tp_simple_password_manager_prompt_async() should be called. * * Once a password is retrieved using the server authentication * channel, or an error is occurred, the callback that was passed to * tp_simple_password_manager_prompt_async() is called and the * connection should call tp_simple_password_manager_prompt_finish() * to get the result of the process. If the #GString returned from * said finish function is non-#NULL, the connection can then proceed * with that password, otherwise the connection must deal with the * error reached. * * Since: 0.13.8 */ /** * TpSimplePasswordManager: * * A helper channel manager to manage X-TELEPATHY-PASSWORD * ServerAuthentication channels. * * Since: 0.13.8 */ #include "config.h" #include "telepathy-glib/simple-password-manager.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_SASL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/base-password-channel.h" #include "telepathy-glib/util-internal.h" static void channel_manager_iface_init (gpointer, gpointer); static void tp_simple_password_manager_close_all (TpSimplePasswordManager *self); static void tp_simple_password_manager_constructed (GObject *object); G_DEFINE_TYPE_WITH_CODE (TpSimplePasswordManager, tp_simple_password_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init)); /* properties */ enum { PROP_CONNECTION = 1, LAST_PROPERTY }; struct _TpSimplePasswordManagerPrivate { TpBaseConnection *conn; guint status_changed_id; TpBasePasswordChannel *channel; gboolean dispose_has_run; }; static void tp_simple_password_manager_init (TpSimplePasswordManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_PASSWORD_MANAGER, TpSimplePasswordManagerPrivate); } static void tp_simple_password_manager_dispose (GObject *object) { TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (object); TpSimplePasswordManagerPrivate *priv = self->priv; if (priv->dispose_has_run) return; DEBUG ("dispose called"); priv->dispose_has_run = TRUE; tp_simple_password_manager_close_all (self); if (priv->status_changed_id != 0) { g_signal_handler_disconnect (priv->conn, priv->status_changed_id); priv->status_changed_id = 0; } if (G_OBJECT_CLASS (tp_simple_password_manager_parent_class)->dispose) G_OBJECT_CLASS (tp_simple_password_manager_parent_class)->dispose (object); } static void tp_simple_password_manager_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (object); TpSimplePasswordManagerPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, priv->conn); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_password_manager_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (object); TpSimplePasswordManagerPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: priv->conn = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_password_manager_class_init ( TpSimplePasswordManagerClass *tp_simple_password_manager_class) { GObjectClass *object_class = G_OBJECT_CLASS (tp_simple_password_manager_class); GParamSpec *param_spec; g_type_class_add_private (tp_simple_password_manager_class, sizeof (TpSimplePasswordManagerPrivate)); object_class->constructed = tp_simple_password_manager_constructed; object_class->dispose = tp_simple_password_manager_dispose; object_class->get_property = tp_simple_password_manager_get_property; object_class->set_property = tp_simple_password_manager_set_property; param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "The connection object that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); } static void tp_simple_password_manager_close_all (TpSimplePasswordManager *self) { TpSimplePasswordManagerPrivate *priv = self->priv; if (priv->channel == NULL) return; DEBUG ("closing %p", priv->channel); tp_base_channel_close (TP_BASE_CHANNEL (priv->channel)); /* priv->channel gets unreffed and set to NULL in the closed * callback below. */ } static void connection_status_changed_cb (TpBaseConnection *conn, guint status, guint reason, TpSimplePasswordManager *self) { switch (status) { case TP_CONNECTION_STATUS_DISCONNECTED: tp_simple_password_manager_close_all (self); break; } } static void tp_simple_password_manager_constructed (GObject *object) { void (*chain_up) (GObject *) = G_OBJECT_CLASS (tp_simple_password_manager_parent_class)->constructed; TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (object); TpSimplePasswordManagerPrivate *priv = self->priv; if (chain_up != NULL) chain_up (object); tp_g_signal_connect_object (priv->conn, "status-changed", G_CALLBACK (connection_status_changed_cb), object, 0); } static void tp_simple_password_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc foreach, gpointer user_data) { TpSimplePasswordManager *self = TP_SIMPLE_PASSWORD_MANAGER (manager); TpSimplePasswordManagerPrivate *priv = self->priv; if (priv->channel != NULL && !tp_base_channel_is_destroyed (TP_BASE_CHANNEL (priv->channel))) { foreach (TP_EXPORTABLE_CHANNEL (priv->channel), user_data); } } static void channel_manager_iface_init (gpointer g_iface, gpointer iface_data) { TpChannelManagerIface *iface = g_iface; iface->foreach_channel = tp_simple_password_manager_foreach_channel; /* these channels are not requestable */ iface->foreach_channel_class = NULL; iface->request_channel = NULL; iface->create_channel = NULL; iface->ensure_channel = NULL; } /** * tp_simple_password_manager_new: * @connection: a #TpBaseConnection * * Creates a new simple server authentication channel manager. * * Returns: a new reference to a server authentication channel * manager. */ TpSimplePasswordManager * tp_simple_password_manager_new (TpBaseConnection *connection) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (connection), NULL); return g_object_new (TP_TYPE_SIMPLE_PASSWORD_MANAGER, "connection", connection, NULL); } static void tp_simple_password_manager_channel_closed_cb (GObject *chan, TpSimplePasswordManager *manager) { tp_channel_manager_emit_channel_closed_for_object (manager, TP_EXPORTABLE_CHANNEL (chan)); tp_clear_object (&manager->priv->channel); } static void free_gstring (gpointer p) { g_string_free (p, TRUE); } static void tp_simple_password_manager_channel_finished_cb ( TpBasePasswordChannel *channel, const GString *str, guint domain, gint code, const gchar *message, gpointer user_data) { GSimpleAsyncResult *result = user_data; if (domain > 0) { GError *error = g_error_new (domain, code, "%s", message); DEBUG ("Failed: %s", error->message); g_simple_async_result_set_from_error (result, error); g_error_free (error); } else { g_simple_async_result_set_op_res_gpointer ( result, g_boxed_copy (G_TYPE_GSTRING, str), free_gstring); } g_simple_async_result_complete (result); g_object_unref (result); } static void tp_simple_password_manager_prompt_common_async ( TpSimplePasswordManager *self, TpBasePasswordChannel *channel, GSimpleAsyncResult *result) { TpSimplePasswordManagerPrivate *priv = self->priv; g_return_if_fail (channel != NULL); g_return_if_fail (TP_IS_SIMPLE_PASSWORD_MANAGER (self)); g_return_if_fail (priv->channel == NULL); priv->channel = g_object_ref (channel); tp_g_signal_connect_object (priv->channel, "closed", G_CALLBACK (tp_simple_password_manager_channel_closed_cb), self, 0); tp_g_signal_connect_object (priv->channel, "finished", G_CALLBACK (tp_simple_password_manager_channel_finished_cb), g_object_ref (result), 0); tp_base_channel_register ((TpBaseChannel *) priv->channel); tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (priv->channel), NULL); } /** * tp_simple_password_manager_prompt_for_channel_async: * @self: a #TpSimplePasswordManager * @channel: a #TpBasePasswordChannel * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Pops up a new server authentication channel and handles the * X-TELEPATHY-PASSWORD mechanism to obtain a password for the * connection. * * When the operation is finished, @callback will be called. You must then * call tp_simple_password_manager_prompt_for_channel_finish() to get the * result of the request. * * Most of the time, tp_simple_password_manager_prompt_async() should be used * instead. This function enables applications to provide custom channels * instead of letting the password manager handle all of the channel details * automatically. This may be useful if your SASL channel needs to implement * additional interfaces (such as Channel.Interface.CredentialsStorage) * * Since: 0.13.15 */ void tp_simple_password_manager_prompt_for_channel_async ( TpSimplePasswordManager *self, TpBasePasswordChannel *channel, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result = g_simple_async_result_new ( G_OBJECT (self), callback, user_data, tp_simple_password_manager_prompt_for_channel_async); tp_simple_password_manager_prompt_common_async (self, channel, result); g_object_unref (result); } /** * tp_simple_password_manager_prompt_async: * @self: a #TpSimplePasswordManager * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Pops up a new server authentication channel and handles the * X-TELEPATHY-PASSWORD mechanism to obtain a password for the * connection. * * When the operation is finished, @callback will be called. You must then * call tp_simple_password_manager_prompt_finish() to get the * result of the request. * * Since: 0.13.8 */ void tp_simple_password_manager_prompt_async ( TpSimplePasswordManager *self, GAsyncReadyCallback callback, gpointer user_data) { TpSimplePasswordManagerPrivate *priv = self->priv; gchar *object_path = g_strdup_printf ("%s/BasePasswordChannel", tp_base_connection_get_object_path (priv->conn)); TpBasePasswordChannel *channel; GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_simple_password_manager_prompt_async); channel = g_object_new (TP_TYPE_BASE_PASSWORD_CHANNEL, "connection", priv->conn, "object-path", object_path, "handle", 0, "requested", FALSE, "initiator-handle", tp_base_connection_get_self_handle (priv->conn), NULL); tp_simple_password_manager_prompt_common_async (self, channel, result); g_free (object_path); g_object_unref (channel); g_object_unref (result); } /** * tp_simple_password_manager_prompt_finish: * @self: a #TpSimplePasswordManager * @result: a #GAsyncResult * @error: a #GError to fill * * Retrieve the value of the request begun with * tp_simple_password_manager_prompt_async(). * * Returns: (transfer none): a #GString with the password (or byte-blob) * retrieved by @manager * * Since: 0.13.8 */ const GString * tp_simple_password_manager_prompt_finish ( TpSimplePasswordManager *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_simple_password_manager_prompt_async, /* do not copy */); } /** * tp_simple_password_manager_prompt_for_channel_finish: * @self: a #TpSimplePasswordManager * @result: a #GAsyncResult * @channel: (transfer none): an output location to retrieve the custom * password channel that was passed to * tp_simple_password_manager_prompt_for_channel_async() * @error: a #GError to fill * * Retrieve the value of the request begun with * tp_simple_password_manager_prompt_for_channel_async(). * * Returns: (transfer none): a #GString with the password (or byte-blob) * retrieved by @manager * * Since: 0.13.15 */ const GString * tp_simple_password_manager_prompt_for_channel_finish ( TpSimplePasswordManager *self, GAsyncResult *result, TpBasePasswordChannel **channel, GError **error) { TpSimplePasswordManagerPrivate *priv = self->priv; GSimpleAsyncResult *simple; g_return_val_if_fail (TP_IS_SIMPLE_PASSWORD_MANAGER (self), NULL); g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL); simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) return NULL; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), tp_simple_password_manager_prompt_for_channel_async), NULL); if (channel != NULL) *channel = priv->channel; return g_simple_async_result_get_op_res_gpointer (simple); } telepathy-glib-0.24.2/telepathy-glib/simple-password-manager.h0000644000175000017500000000657512652510705021276 00000000000000/* * simple-password-manager.h - Header for TpSimplePasswordManager * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIMPLE_PASSWORD_MANAGER_H__ #define __TP_SIMPLE_PASSWORD_MANAGER_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpSimplePasswordManager TpSimplePasswordManager; typedef struct _TpSimplePasswordManagerClass TpSimplePasswordManagerClass; typedef struct _TpSimplePasswordManagerPrivate TpSimplePasswordManagerPrivate; struct _TpSimplePasswordManagerClass { GObjectClass parent_class; /**/ }; struct _TpSimplePasswordManager { /**/ GObject parent; TpSimplePasswordManagerPrivate *priv; }; GType tp_simple_password_manager_get_type (void); /* TYPE MACROS */ #define TP_TYPE_SIMPLE_PASSWORD_MANAGER \ (tp_simple_password_manager_get_type ()) #define TP_SIMPLE_PASSWORD_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_SIMPLE_PASSWORD_MANAGER,\ TpSimplePasswordManager)) #define TP_SIMPLE_PASSWORD_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_SIMPLE_PASSWORD_MANAGER,\ TpSimplePasswordManagerClass)) #define TP_IS_SIMPLE_PASSWORD_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_SIMPLE_PASSWORD_MANAGER)) #define TP_IS_SIMPLE_PASSWORD_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_SIMPLE_PASSWORD_MANAGER)) #define TP_SIMPLE_PASSWORD_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_PASSWORD_MANAGER,\ TpSimplePasswordManagerClass)) TpSimplePasswordManager * tp_simple_password_manager_new ( TpBaseConnection *connection); void tp_simple_password_manager_prompt_async ( TpSimplePasswordManager *self, GAsyncReadyCallback callback, gpointer user_data); const GString * tp_simple_password_manager_prompt_finish ( TpSimplePasswordManager *self, GAsyncResult *result, GError **error); void tp_simple_password_manager_prompt_for_channel_async ( TpSimplePasswordManager *self, TpBasePasswordChannel *channel, GAsyncReadyCallback callback, gpointer user_data); const GString * tp_simple_password_manager_prompt_for_channel_finish ( TpSimplePasswordManager *self, GAsyncResult *result, TpBasePasswordChannel **channel, GError **error); G_END_DECLS #endif /* #ifndef __SIMPLE_PASSWORD_MANAGER_H__ */ telepathy-glib-0.24.2/telepathy-glib/svc-channel.h0000644000175000017500000000047312652510705016725 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CHANNEL_H__ #define __TP_META_SVC_CHANNEL_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/call-internal.h0000644000175000017500000000272612652510705017254 00000000000000/**/ /* * Internals for TpCallChannel, TpCallContent and TpCallStream * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_CALL_INTERNAL_H #define TP_CALL_INTERNAL_H #include G_BEGIN_DECLS /* implemented in call-channel.c */ TpCallStateReason *_tp_call_state_reason_new (const GValueArray *value_array); TpCallStateReason *_tp_call_state_reason_ref (TpCallStateReason *r); void _tp_call_state_reason_unref (TpCallStateReason *r); GHashTable *_tp_call_members_convert_table (TpConnection *connection, GHashTable *table, GHashTable *identifiers); GPtrArray *_tp_call_members_convert_array (TpConnection *connection, const GArray *array); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-dispatch-operation.xml0000644000175000017500000000035712652510705022301 00000000000000 CDO interfaces telepathy-glib-0.24.2/telepathy-glib/presence-mixin.c0000644000175000017500000015367712652510705017464 00000000000000/* * presence-mixin.c - Source for TpPresenceMixin * Copyright (C) 2005-2008 Collabora Ltd. * Copyright (C) 2005-2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:presence-mixin * @title: TpPresenceMixin * @short_description: a mixin implementation of the Presence connection * interface * @see_also: #TpSvcConnectionInterfacePresence * * This mixin can be added to a #TpBaseConnection subclass to implement the * SimplePresence and/or Presence interfaces. Implementing both interfaces * (as described below) is recommended. In particular, you must implement the * old-style Presence interface if compatibility with telepathy-glib * versions older than 0.11.13 is required. * * To use the presence mixin, include a #TpPresenceMixinClass somewhere in your * class structure and a #TpPresenceMixin somewhere in your instance structure, * and call tp_presence_mixin_class_init() from your class_init function, * tp_presence_mixin_init() from your init function or constructor, and * tp_presence_mixin_finalize() from your dispose or finalize function. * *
* Implementing SimplePresence * * Since 0.7.13 this mixin supports the entire SimplePresence interface. * You can implement #TpSvcConnectionInterfaceSimplePresence as follows: * * * use the #TpContactsMixin and * TpDBusPropertiesMixin; * * * pass tp_presence_mixin_simple_presence_iface_init() as an * argument to G_IMPLEMENT_INTERFACE(), like so: * * |[ * G_DEFINE_TYPE_WITH_CODE (MyConnection, my_connection, * TP_TYPE_BASE_CONNECTION, * // ... * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE, * tp_presence_mixin_simple_presence_iface_init); * // ... * ) * ]| * * * * call tp_presence_mixin_simple_presence_init_dbus_properties() in the * #GTypeInfo class_init function; * * * * * call tp_presence_mixin_simple_presence_register_with_contacts_mixin() * in the #GObjectClass constructed function. * * * * *
*
* Implementing old-style Presence * * This mixin also supports a large subset of the deprecated Presence * interface. It does not support protocols where it is possible to set * multiple statuses on yourself at once (all presence statuses will have the * exclusive flag set), or last-activity-time information. * * * To use the presence mixin as the implementation of * #TpSvcConnectionInterfacePresence, use tp_presence_mixin_iface_init() as * the function you pass to G_IMPLEMENT_INTERFACE(), as in the following * example. The presence mixin implements all of the D-Bus methods in the * Presence interface. * * |[ * G_DEFINE_TYPE_WITH_CODE (MyConnection, my_connection, * TP_TYPE_BASE_CONNECTION, * // ... * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, * tp_presence_mixin_iface_init); * // ... * ) * ]| * * In telepathy-glib versions older than 0.11.13, every connection * that used the #TpPresenceMixin was required to implement * #TpSvcConnectionInterfacePresence; failing to do so would lead to an * assertion failure. Since 0.11.13, this is no longer required. * *
* * Since: 0.5.13 */ /** * TpPresenceStatusOptionalArgumentSpec: * @name: Name of the argument as passed over D-Bus * @dtype: D-Bus type signature of the argument * * Structure specifying a supported optional argument for a presence status. * * In addition to the fields documented here, there are two gpointer fields * which must currently be %NULL. A meaning may be defined for these in a * future version of telepathy-glib. */ /** * TpPresenceStatusSpec: * @name: String identifier of the presence status * @presence_type: A type value, as specified by #TpConnectionPresenceType * @self: Indicates if this status may be set on yourself * @optional_arguments: An array of #TpPresenceStatusOptionalArgumentSpec * structures representing the optional arguments for this status, terminated * by a NULL name. If there are no optional arguments for a status, this can * be NULL. In modern Telepathy connection managers, the only optional * argument should be a string (type "s") named "message" on statuses * that have an optional human-readable message. All other optional arguments * are deprecated. * * Structure specifying a supported presence status. * * In addition to the fields documented here, there are two gpointer fields * which must currently be %NULL. A meaning may be defined for these in a * future version of telepathy-glib. */ /** * TpPresenceStatus: * @index: Index of the presence status in the provided supported presence * statuses array * @optional_arguments: A GHashTable mapping of string identifiers to GValues * of the optional status arguments, if any. If there are no optional * arguments, this pointer may be NULL. * * Structure representing a presence status. * * In addition to the fields documented here, there are two gpointer fields * which must currently be %NULL. A meaning may be defined for these in a * future version of telepathy-glib. * * In modern Telepathy connection managers, the only optional * argument should be a %G_TYPE_STRING named "message", on statuses * that have an optional human-readable message. All other optional arguments * are deprecated. */ /** * TpPresenceMixinStatusAvailableFunc: * @obj: An instance of a #TpBaseConnection subclass implementing the presence * interface with this mixin * @which: An index into the array of #TpPresenceStatusSpec provided to * tp_presence_mixin_class_init() * * Signature of a callback to be used to determine if a given presence * status can be set on the connection. Most users of this mixin do not need to * supply an implementation of this callback: the value of * #TpPresenceStatusSpec.self is enough to determine whether this is a * user-settable presence, so %NULL should be passed to * tp_presence_mixin_class_init() for this callback. * * One place where this callback may be needed is on XMPP: not all server * implementation support the user becoming invisible. So an XMPP * implementation would implement this function, so that—once connected—the * hidden status is only available if the server supports it. Before the * connection is connected, this callback should return %TRUE for every status * that might possibly be supported: this allows the user to at least try to * sign in as invisible. * * Returns: %TRUE if the status can be set on this connection; %FALSE if not. */ /** * TpPresenceMixinGetContactStatusesFunc: * @obj: An object with this mixin. * @contacts: An array of #TpHandle for the contacts to get presence status for * @error: Used to return a Telepathy D-Bus error if %NULL is returned * * Signature of the callback used to get the stored presence status of * contacts. The returned hash table should have contact handles mapped to * their respective presence statuses in #TpPresenceStatus structs. * * The returned hash table will be freed with g_hash_table_unref. The * callback is responsible for ensuring that this does any cleanup that * may be necessary. * * Returns: (transfer full): The contact presence on success, %NULL with * error set on error */ /** * TpPresenceMixinSetOwnStatusFunc: * @obj: An object with this mixin. * @status: The status to set, or NULL for whatever the protocol defines as a * "default" status * @error: Used to return a Telepathy D-Bus error if %FALSE is returned * * Signature of the callback used to commit changes to the user's own presence * status in SetStatuses. It is also used in ClearStatus and RemoveStatus to * reset the user's own status back to the "default" one with a %NULL status * argument. * * The optional_arguments hash table in @status, if not NULL, will have been * filtered so it only contains recognised parameters, so the callback * need not (and cannot) check for unrecognised parameters. However, the * types of the parameters are not currently checked, so the callback is * responsible for doing so. * * The callback is responsible for emitting PresenceUpdate, if appropriate, * by calling tp_presence_mixin_emit_presence_update(). * * Returns: %TRUE if the operation was successful, %FALSE if not. */ /** * TpPresenceMixinGetMaximumStatusMessageLengthFunc: * @obj: An object with this mixin. * * Signature of a callback used to determine the maximum length of status * messages. If this callback is provided and returns non-zero, the * #TpPresenceMixinSetOwnStatusFunc implementation is responsible for * truncating the message to fit this limit, if necessary. * * Returns: the maximum number of UTF-8 characters which may appear in a status * message, or 0 if there is no limit. * Since: 0.14.5 */ /** * TpPresenceMixinClass: * @status_available: The status-available function that was passed to * tp_presence_mixin_class_init() * @get_contact_statuses: The get-contact-statuses function that was passed to * tp_presence_mixin_class_init() * @set_own_status: The set-own-status function that was passed to * tp_presence_mixin_class_init() * @statuses: The presence statuses array that was passed to * tp_presence_mixin_class_init() * @get_maximum_status_message_length: The callback used to discover the * the limit for status messages length, if any. Since: 0.14.5 * * Structure to be included in the class structure of objects that * use this mixin. Initialize it with tp_presence_mixin_class_init(). * * If the protocol imposes a limit on the length of status messages, one should * implement @get_maximum_status_message_length. If this callback is not * implemented, it is assumed that there is no limit. The callback function * should be set after calling tp_presence_mixin_class_init(), like so: * * |[ * TpPresenceMixinClass *mixin_class; * * tp_presence_mixin_class_init ((GObjectClass *) klass, * G_STRUCT_OFFSET (SomeObjectClass, presence_mixin)); * mixin_class = TP_PRESENCE_MIXIN_CLASS (klass); * mixin_class->get_maximum_status_message_length = * some_object_get_maximum_status_message_length; * ]| * * All other fields should be considered read-only. */ /** * TpPresenceMixin: * * Structure to be included in the instance structure of objects that * use this mixin. Initialize it with tp_presence_mixin_init(). * * There are no public fields. */ #include "config.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PRESENCE #include "debug-internal.h" static GHashTable *construct_simple_presence_hash ( const TpPresenceStatusSpec *supported_statuses, GHashTable *contact_statuses); /* * deep_copy_hashtable * * Make a deep copy of a GHashTable. */ static GHashTable * deep_copy_hashtable (GHashTable *hash_table) { GValue value = {0, }; if (!hash_table) return NULL; g_value_init (&value, TP_HASH_TYPE_STRING_VARIANT_MAP); g_value_take_boxed (&value, hash_table); return g_value_dup_boxed (&value); } /** * tp_presence_status_new: (skip) * @which: Index of the presence status in the provided supported presence * statuses array * @optional_arguments: Optional arguments for the presence statuses. Can be * NULL if there are no optional arguments. The presence status object makes a * copy of the hashtable, so you should free the original. * * Construct a presence status structure. You should free the returned * structure with #tp_presence_status_free. * * In modern Telepathy connection managers, the only optional * argument should be a %G_TYPE_STRING named "message", on statuses * that have an optional human-readable message. All other optional arguments * are deprecated. * * Returns: A pointer to the newly allocated presence status structure. */ TpPresenceStatus * tp_presence_status_new (guint which, GHashTable *optional_arguments) { TpPresenceStatus *status = g_slice_new (TpPresenceStatus); status->index = which; status->optional_arguments = deep_copy_hashtable (optional_arguments); return status; } /** * tp_presence_status_free: (skip) * @status: A pointer to the presence status structure to free. * * Deallocate all resources associated with a presence status structure. */ void tp_presence_status_free (TpPresenceStatus *status) { if (!status) return; if (status->optional_arguments) g_hash_table_unref (status->optional_arguments); g_slice_free (TpPresenceStatus, status); } /** * tp_presence_mixin_class_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObjectClass */ GQuark tp_presence_mixin_class_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ("TpPresenceMixinClassOffsetQuark"); return offset_quark; } /** * tp_presence_mixin_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObject */ GQuark tp_presence_mixin_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ("TpPresenceMixinOffsetQuark"); return offset_quark; } /** * tp_presence_mixin_class_init: (skip) * @obj_cls: The class of the implementation that uses this mixin * @offset: The byte offset of the TpPresenceMixinClass within the class * structure * @status_available: A callback to be used to determine if a given presence * status can be set on a particular connection. Should usually be %NULL, to * consider all statuses with #TpPresenceStatusSpec.self set to %TRUE to be * settable. * @get_contact_statuses: A callback to be used get the current presence status * for contacts. This is used in implementations of various D-Bus methods and * hence must be provided. * @set_own_status: A callback to be used to commit changes to the user's own * presence status to the server. This is used in implementations of various * D-Bus methods and hence must be provided. * @statuses: An array of #TpPresenceStatusSpec structures representing all * presence statuses supported by the protocol, terminated by a NULL name. * * Initialize the presence mixin. Should be called from the implementation's * class_init function like so: * * * tp_presence_mixin_class_init ((GObjectClass *) klass, * G_STRUCT_OFFSET (SomeObjectClass, * presence_mixin)); * */ void tp_presence_mixin_class_init (GObjectClass *obj_cls, glong offset, TpPresenceMixinStatusAvailableFunc status_available, TpPresenceMixinGetContactStatusesFunc get_contact_statuses, TpPresenceMixinSetOwnStatusFunc set_own_status, const TpPresenceStatusSpec *statuses) { TpPresenceMixinClass *mixin_cls; guint i; DEBUG ("called."); g_assert (get_contact_statuses != NULL); g_assert (set_own_status != NULL); g_assert (statuses != NULL); g_assert (G_IS_OBJECT_CLASS (obj_cls)); g_type_set_qdata (G_OBJECT_CLASS_TYPE (obj_cls), TP_PRESENCE_MIXIN_CLASS_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin_cls = TP_PRESENCE_MIXIN_CLASS (obj_cls); mixin_cls->status_available = status_available; mixin_cls->get_contact_statuses = get_contact_statuses; mixin_cls->set_own_status = set_own_status; mixin_cls->statuses = statuses; mixin_cls->get_maximum_status_message_length = NULL; for (i = 0; statuses[i].name != NULL; i++) { if (statuses[i].self) { switch (statuses[i].presence_type) { case TP_CONNECTION_PRESENCE_TYPE_OFFLINE: case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: WARNING ("Status \"%s\" of type %u should not be available " "to set on yourself", statuses[i].name, statuses[i].presence_type); break; default: break; } } } } /** * tp_presence_mixin_init: (skip) * @obj: An instance of the implementation that uses this mixin * @offset: The byte offset of the TpPresenceMixin within the object structure * * Initialize the presence mixin. Should be called from the implementation's * instance init function like so: * * * tp_presence_mixin_init ((GObject *) self, * G_STRUCT_OFFSET (SomeObject, presence_mixin)); * */ void tp_presence_mixin_init (GObject *obj, glong offset) { DEBUG ("called."); g_assert (G_IS_OBJECT (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_PRESENCE_MIXIN_OFFSET_QUARK, GINT_TO_POINTER (offset)); } /** * tp_presence_mixin_finalize: (skip) * @obj: An object with this mixin. * * Free resources held by the presence mixin. */ void tp_presence_mixin_finalize (GObject *obj) { DEBUG ("%p", obj); /* free any data held directly by the object here */ } static void construct_presence_hash_foreach ( GHashTable *presence_hash, const TpPresenceStatusSpec *supported_statuses, TpHandle handle, TpPresenceStatus *status) { GHashTable *parameters; GHashTable *contact_status; GValueArray *vals; contact_status = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) g_hash_table_unref); parameters = deep_copy_hashtable (status->optional_arguments); if (!parameters) parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); g_hash_table_insert (contact_status, (gpointer) supported_statuses[status->index].name, parameters); vals = tp_value_array_build (2, G_TYPE_UINT, 0, TP_HASH_TYPE_MULTIPLE_STATUS_MAP, contact_status, G_TYPE_INVALID); g_hash_table_unref (contact_status); g_hash_table_insert (presence_hash, GUINT_TO_POINTER (handle), vals); } static GHashTable * construct_presence_hash (const TpPresenceStatusSpec *supported_statuses, GHashTable *contact_statuses) { GHashTable *presence_hash = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) tp_value_array_free); GHashTableIter iter; gpointer key, value; DEBUG ("called."); g_hash_table_iter_init (&iter, contact_statuses); while (g_hash_table_iter_next (&iter, &key, &value)) construct_presence_hash_foreach (presence_hash, supported_statuses, GPOINTER_TO_UINT (key), value); return presence_hash; } /** * tp_presence_mixin_emit_presence_update: (skip) * @obj: A connection object with this mixin * @contact_presences: A mapping of contact handles to #TpPresenceStatus * structures with the presence data to emit * * Emit the PresenceUpdate signal for multiple contacts. For emitting * PresenceUpdate for a single contact, there is a convenience wrapper called * #tp_presence_mixin_emit_one_presence_update. */ void tp_presence_mixin_emit_presence_update (GObject *obj, GHashTable *contact_statuses) { TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GHashTable *presence_hash; DEBUG ("called."); if (g_type_interface_peek (G_OBJECT_GET_CLASS (obj), TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE) != NULL) { presence_hash = construct_presence_hash (mixin_cls->statuses, contact_statuses); tp_svc_connection_interface_presence_emit_presence_update (obj, presence_hash); g_hash_table_unref (presence_hash); } if (g_type_interface_peek (G_OBJECT_GET_CLASS (obj), TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE) != NULL) { presence_hash = construct_simple_presence_hash (mixin_cls->statuses, contact_statuses); tp_svc_connection_interface_simple_presence_emit_presences_changed (obj, presence_hash); g_hash_table_unref (presence_hash); } } /** * tp_presence_mixin_emit_one_presence_update: (skip) * @obj: A connection object with this mixin * @handle: The handle of the contact to emit the signal for * @status: The new status to emit * * Emit the PresenceUpdate signal for a single contact. This method is just a * convenience wrapper around #tp_presence_mixin_emit_presence_update. */ void tp_presence_mixin_emit_one_presence_update (GObject *obj, TpHandle handle, const TpPresenceStatus *status) { GHashTable *contact_statuses; DEBUG ("called."); contact_statuses = g_hash_table_new (NULL, NULL); g_hash_table_insert (contact_statuses, GUINT_TO_POINTER (handle), (gpointer) status); tp_presence_mixin_emit_presence_update (obj, contact_statuses); g_hash_table_unref (contact_statuses); } /* * tp_presence_mixin_add_status: * * Implements D-Bus method AddStatus * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_add_status (TpSvcConnectionInterfacePresence *iface, const gchar *status, GHashTable *parms, DBusGMethodInvocation *context) { TpBaseConnection *conn = TP_BASE_CONNECTION (iface); GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Only one status is possible at a time with this protocol!" }; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); dbus_g_method_return_error (context, &error); } /* * tp_presence_mixin_clear_status: * * Implements D-Bus method ClearStatus * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_clear_status (TpSvcConnectionInterfacePresence *iface, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpBaseConnection *conn = TP_BASE_CONNECTION (iface); TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GError *error = NULL; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); if (!mixin_cls->set_own_status (obj, NULL, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_connection_interface_presence_return_from_clear_status (context); } /* * tp_presence_mixin_get_presence: * * Implements D-Bus method GetPresence * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_get_presence (TpSvcConnectionInterfacePresence *iface, const GArray *contacts, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpBaseConnection *conn = TP_BASE_CONNECTION (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GHashTable *contact_statuses; GHashTable *presence_hash; GError *error = NULL; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); if (contacts->len == 0) { presence_hash = g_hash_table_new (g_direct_hash, g_direct_equal); tp_svc_connection_interface_presence_return_from_get_presence (context, presence_hash); g_hash_table_unref (presence_hash); return; } if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, &error); if (!contact_statuses) { dbus_g_method_return_error (context, error); g_error_free (error); return; } presence_hash = construct_presence_hash (mixin_cls->statuses, contact_statuses); tp_svc_connection_interface_presence_return_from_get_presence (context, presence_hash); g_hash_table_unref (presence_hash); g_hash_table_unref (contact_statuses); } static GHashTable * get_statuses_arguments (const TpPresenceStatusOptionalArgumentSpec *specs) { GHashTable *arguments = g_hash_table_new (g_str_hash, g_str_equal); int i; for (i=0; specs != NULL && specs[i].name != NULL; i++) g_hash_table_insert (arguments, (gchar *) specs[i].name, (gchar *) specs[i].dtype); return arguments; } static gboolean check_status_available (GObject *object, TpPresenceMixinClass *mixin_cls, guint i, GError **error, gboolean for_self) { if (for_self) { if (!mixin_cls->statuses[i].self) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "cannot set status '%s' on yourself", mixin_cls->statuses[i].name); return FALSE; } /* never allow OFFLINE, UNKNOWN or ERROR - if the CM says they're * OK to set on yourself, then it's wrong */ switch (mixin_cls->statuses[i].presence_type) { case TP_CONNECTION_PRESENCE_TYPE_OFFLINE: case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: case TP_CONNECTION_PRESENCE_TYPE_ERROR: g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "cannot set offline/unknown/error status '%s' on yourself", mixin_cls->statuses[i].name); return FALSE; default: break; } } if (mixin_cls->status_available && !mixin_cls->status_available (object, i)) { DEBUG ("requested status %s is not available", mixin_cls->statuses[i].name); g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "requested status '%s' is not available on this connection", mixin_cls->statuses[i].name); return FALSE; } return TRUE; } /* * tp_presence_mixin_get_statuses: * * Implements D-Bus method GetStatuses * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_get_statuses (TpSvcConnectionInterfacePresence *iface, DBusGMethodInvocation *context) { TpBaseConnection *conn = TP_BASE_CONNECTION (iface); GObject *obj = (GObject *) conn; TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GHashTable *ret; GValueArray *status; int i; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); ret = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_value_array_free); for (i=0; mixin_cls->statuses[i].name != NULL; i++) { GHashTable *args; /* the spec says we include statuses here even if they're not available * to set on yourself */ if (!check_status_available (obj, mixin_cls, i, NULL, FALSE)) continue; args = get_statuses_arguments (mixin_cls->statuses[i].optional_arguments); status = tp_value_array_build (4, G_TYPE_UINT, (guint) mixin_cls->statuses[i].presence_type, G_TYPE_BOOLEAN, mixin_cls->statuses[i].self, G_TYPE_BOOLEAN, TRUE, /* exclusive */ DBUS_TYPE_G_STRING_STRING_HASHTABLE, args, G_TYPE_INVALID); g_hash_table_unref (args); g_hash_table_insert (ret, (gchar *) mixin_cls->statuses[i].name, status); } tp_svc_connection_interface_presence_return_from_get_statuses (context, ret); g_hash_table_unref (ret); } /* * tp_presence_mixin_set_last_activity_time: * * Implements D-Bus method SetLastActivityTime * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_set_last_activity_time (TpSvcConnectionInterfacePresence *iface, guint timestamp, DBusGMethodInvocation *context) { TpBaseConnection *conn = TP_BASE_CONNECTION (iface); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); tp_svc_connection_interface_presence_return_from_set_last_activity_time ( context); } /* * tp_presence_mixin_remove_status: * * Implements D-Bus method RemoveStatus * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_remove_status (TpSvcConnectionInterfacePresence *iface, const gchar *status, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpBaseConnection *conn = TP_BASE_CONNECTION (iface); TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GArray *self_contacts; GError *error = NULL; GHashTable *self_contact_statuses; TpPresenceStatus *self_status; TpHandle self_handle; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); self_contacts = g_array_sized_new (TRUE, TRUE, sizeof (TpHandle), 1); self_handle = tp_base_connection_get_self_handle (conn); g_array_append_val (self_contacts, self_handle); self_contact_statuses = mixin_cls->get_contact_statuses (obj, self_contacts, &error); if (!self_contact_statuses) { dbus_g_method_return_error (context, error); g_error_free (error); g_array_unref (self_contacts); return; } self_status = (TpPresenceStatus *) g_hash_table_lookup (self_contact_statuses, GUINT_TO_POINTER (tp_base_connection_get_self_handle (conn))); if (!self_status) { DEBUG ("Got no self status, assuming we already have default status"); g_array_unref (self_contacts); g_hash_table_unref (self_contact_statuses); tp_svc_connection_interface_presence_return_from_remove_status (context); return; } if (!tp_strdiff (status, mixin_cls->statuses[self_status->index].name)) { if (mixin_cls->set_own_status (obj, NULL, &error)) { tp_svc_connection_interface_presence_return_from_remove_status (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } else { GError nonexistent = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Attempting to remove non-existent presence." }; dbus_g_method_return_error (context, &nonexistent); } g_array_unref (self_contacts); g_hash_table_unref (self_contact_statuses); } /* * tp_presence_mixin_request_presence: * * Implements D-Bus method RequestPresence * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_request_presence (TpSvcConnectionInterfacePresence *iface, const GArray *contacts, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); TpBaseConnection *conn = TP_BASE_CONNECTION (iface); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); GHashTable *contact_statuses; GError *error = NULL; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); if (contacts->len == 0) { tp_svc_connection_interface_presence_return_from_request_presence (context); return; } if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, &error); if (!contact_statuses) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_presence_mixin_emit_presence_update (obj, contact_statuses); tp_svc_connection_interface_presence_return_from_request_presence (context); g_hash_table_unref (contact_statuses); } static int check_for_status (GObject *object, const gchar *status, GError **error) { TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (object)); int i; for (i = 0; mixin_cls->statuses[i].name != NULL; i++) { if (!tp_strdiff (mixin_cls->statuses[i].name, status)) break; } if (mixin_cls->statuses[i].name != NULL) { DEBUG ("Found status \"%s\", checking if it's available...", (const gchar *) status); if (!check_status_available (object, mixin_cls, i, error, TRUE)) return -1; } else { DEBUG ("got unknown status identifier %s", status); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "unknown status identifier: %s", status); return -1; } return i; } static gboolean set_status ( GObject *obj, const gchar *status_name, GHashTable *provided_arguments, GError **error) { TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); TpPresenceStatus status_to_set = { 0, }; int status; GHashTable *optional_arguments = NULL; gboolean ret = TRUE; DEBUG ("called."); /* This function will actually only be invoked once for one SetStatus request, * since we check that the hash table has size 1 in * tp_presence_mixin_set_status(). Therefore there are no problems with * sharing the foreach data like this. */ status = check_for_status (obj, status_name, error); if (status == -1) return FALSE; DEBUG ("The status is available."); if (provided_arguments != NULL) { int j; const TpPresenceStatusOptionalArgumentSpec *specs = mixin_cls->statuses[status].optional_arguments; for (j=0; specs != NULL && specs[j].name != NULL; j++) { GValue *provided_value = g_hash_table_lookup (provided_arguments, specs[j].name); GValue *new_value; if (!provided_value) continue; new_value = tp_g_value_slice_dup (provided_value); if (!optional_arguments) optional_arguments = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); if (DEBUGGING) { gchar *value_contents = g_strdup_value_contents (new_value); DEBUG ("Got optional argument (\"%s\", %s)", specs[j].name, value_contents); g_free (value_contents); } g_hash_table_insert (optional_arguments, (gpointer) specs[j].name, new_value); } } status_to_set.index = status; status_to_set.optional_arguments = optional_arguments; DEBUG ("About to try setting status \"%s\"", mixin_cls->statuses[status].name); ret = mixin_cls->set_own_status (obj, &status_to_set, error); if (optional_arguments) g_hash_table_unref (optional_arguments); return ret; } /* * tp_presence_mixin_set_status: * * Implements D-Bus method SetStatus * on interface org.freedesktop.Telepathy.Connection.Interface.Presence */ static void tp_presence_mixin_set_status (TpSvcConnectionInterfacePresence *iface, GHashTable *statuses, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpBaseConnection *conn = TP_BASE_CONNECTION (iface); GHashTableIter iter; gpointer key, value; GError *error = NULL; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); g_hash_table_iter_init (&iter, statuses); if (!g_hash_table_iter_next (&iter, &key, &value) || g_hash_table_iter_next (&iter, NULL, NULL)) { GError invalid = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Only one status may be set at a time in this protocol" }; DEBUG ("got more than one status"); dbus_g_method_return_error (context, &invalid); return; } if (set_status (obj, key, value, &error)) { tp_svc_connection_interface_presence_return_from_set_status (context); } else { DEBUG ("failed: %s", error->message); dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_presence_mixin_iface_init: (skip) * @g_iface: A pointer to the #TpSvcConnectionInterfacePresenceClass in an * object class * @iface_data: Ignored * * Fill in the vtable entries needed to implement the presence interface using * this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. */ void tp_presence_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfacePresenceClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_presence_implement_##x (klass,\ tp_presence_mixin_##x) IMPLEMENT(add_status); IMPLEMENT(clear_status); IMPLEMENT(get_presence); IMPLEMENT(get_statuses); IMPLEMENT(remove_status); IMPLEMENT(request_presence); IMPLEMENT(set_last_activity_time); IMPLEMENT(set_status); #undef IMPLEMENT } enum { MIXIN_DP_SIMPLE_STATUSES, MIXIN_DP_SIMPLE_MAX_STATUS_MESSAGE_LENGTH, NUM_MIXIN_SIMPLE_DBUS_PROPERTIES }; static TpDBusPropertiesMixinPropImpl known_simple_presence_props[] = { { "Statuses", NULL, NULL }, { "MaximumStatusMessageLength", NULL, NULL }, { NULL } }; static void tp_presence_mixin_get_simple_presence_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (object)); static GQuark q[NUM_MIXIN_SIMPLE_DBUS_PROPERTIES] = { 0, }; DEBUG ("called."); if (G_UNLIKELY (q[0] == 0)) { q[MIXIN_DP_SIMPLE_STATUSES] = g_quark_from_static_string ("Statuses"); q[MIXIN_DP_SIMPLE_MAX_STATUS_MESSAGE_LENGTH] = g_quark_from_static_string ("MaximumStatusMessageLength"); } g_return_if_fail (object != NULL); if (name == q[MIXIN_DP_SIMPLE_STATUSES]) { GHashTable *ret; GValueArray *status; int i; g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); ret = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_value_array_free); for (i=0; mixin_cls->statuses[i].name != NULL; i++) { gboolean message; /* we include statuses here even if they're not available * to set on yourself */ if (!check_status_available (object, mixin_cls, i, NULL, FALSE)) continue; message = tp_presence_status_spec_has_message ( &mixin_cls->statuses[i]); status = tp_value_array_build (3, G_TYPE_UINT, (guint) mixin_cls->statuses[i].presence_type, G_TYPE_BOOLEAN, mixin_cls->statuses[i].self, G_TYPE_BOOLEAN, message, G_TYPE_INVALID); g_hash_table_insert (ret, (gchar *) mixin_cls->statuses[i].name, status); } g_value_take_boxed (value, ret); } else if (name == q[MIXIN_DP_SIMPLE_MAX_STATUS_MESSAGE_LENGTH]) { guint max_status_message_length = 0; g_assert (G_VALUE_HOLDS (value, G_TYPE_UINT)); if (mixin_cls->get_maximum_status_message_length != NULL) max_status_message_length = mixin_cls->get_maximum_status_message_length (object); g_value_set_uint (value, max_status_message_length); } else { g_return_if_reached (); } } /** * tp_presence_mixin_simple_presence_init_dbus_properties: (skip) * @cls: The class of an object with this mixin * * Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of * the SimplePresence interface's properties. * * This automatically sets up a list of the supported properties for the * SimplePresence interface. * * Since: 0.7.13 */ void tp_presence_mixin_simple_presence_init_dbus_properties (GObjectClass *cls) { tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE, tp_presence_mixin_get_simple_presence_dbus_property, NULL, known_simple_presence_props); } /* * tp_presence_mixin_simple_presence_set_presence: * * Implements D-Bus method SetPresence * on interface org.freedesktop.Telepathy.Connection.Interface.SimplePresence */ static void tp_presence_mixin_simple_presence_set_presence ( TpSvcConnectionInterfaceSimplePresence *iface, const gchar *status, const gchar *message, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); TpPresenceStatus status_to_set = { 0, }; int s; GError *error = NULL; GHashTable *optional_arguments = NULL; DEBUG ("called."); s = check_for_status (obj, status, &error); if (s == -1) goto out; status_to_set.index = s; if (*message != '\0') { optional_arguments = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (optional_arguments, "message", tp_g_value_slice_new_string (message)); status_to_set.optional_arguments = optional_arguments; } mixin_cls->set_own_status (obj, &status_to_set, &error); out: if (error == NULL) { tp_svc_connection_interface_simple_presence_return_from_set_presence ( context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } if (optional_arguments != NULL) g_hash_table_unref (optional_arguments); } static GValueArray * construct_simple_presence_value_array (TpPresenceStatus *status, const TpPresenceStatusSpec *supported_statuses) { TpConnectionPresenceType status_type; const gchar *status_name; const gchar *message = NULL; GValueArray *presence; status_name = supported_statuses[status->index].name; status_type = supported_statuses[status->index].presence_type; if (status->optional_arguments != NULL) { GValue *val; val = g_hash_table_lookup (status->optional_arguments, "message"); if (val != NULL) message = g_value_get_string (val); } if (message == NULL) message = ""; presence = tp_value_array_build (3, G_TYPE_UINT, status_type, G_TYPE_STRING, status_name, G_TYPE_STRING, message, G_TYPE_INVALID); return presence; } static void construct_simple_presence_hash_foreach ( GHashTable *presence_hash, const TpPresenceStatusSpec *supported_statuses, TpHandle handle, TpPresenceStatus *status) { GValueArray *presence; presence = construct_simple_presence_value_array (status, supported_statuses); g_hash_table_insert (presence_hash, GUINT_TO_POINTER (handle), presence); } static GHashTable * construct_simple_presence_hash (const TpPresenceStatusSpec *supported_statuses, GHashTable *contact_statuses) { GHashTable *presence_hash = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) tp_value_array_free); GHashTableIter iter; gpointer key, value; DEBUG ("called."); g_hash_table_iter_init (&iter, contact_statuses); while (g_hash_table_iter_next (&iter, &key, &value)) construct_simple_presence_hash_foreach (presence_hash, supported_statuses, GPOINTER_TO_UINT (key), value); return presence_hash; } /* * tp_presence_mixin_get_simple_presence: * * Implements D-Bus method GetPresence * on interface org.freedesktop.Telepathy.Connection.Interface.SimplePresence */ static void tp_presence_mixin_simple_presence_get_presences ( TpSvcConnectionInterfaceSimplePresence *iface, const GArray *contacts, DBusGMethodInvocation *context) { GObject *obj = (GObject *) iface; TpBaseConnection *conn = TP_BASE_CONNECTION (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GHashTable *contact_statuses; GHashTable *presence_hash; GError *error = NULL; DEBUG ("called."); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); if (contacts->len == 0) { presence_hash = g_hash_table_new (g_direct_hash, g_direct_equal); tp_svc_connection_interface_simple_presence_return_from_get_presences ( context, presence_hash); g_hash_table_unref (presence_hash); return; } if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, &error); if (!contact_statuses) { dbus_g_method_return_error (context, error); g_error_free (error); return; } presence_hash = construct_simple_presence_hash (mixin_cls->statuses, contact_statuses); tp_svc_connection_interface_simple_presence_return_from_get_presences ( context, presence_hash); g_hash_table_unref (presence_hash); g_hash_table_unref (contact_statuses); } /** * tp_presence_mixin_simple_presence_iface_init: (skip) * @g_iface: A pointer to the #TpSvcConnectionInterfaceSimplePresenceClass in * an object class * @iface_data: Ignored * * Fill in the vtable entries needed to implement the simple presence interface * using this mixin. This function should usually be called via * G_IMPLEMENT_INTERFACE. * * Since: 0.7.13 */ void tp_presence_mixin_simple_presence_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceSimplePresenceClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_simple_presence_implement_##x\ (klass, tp_presence_mixin_simple_presence_##x) IMPLEMENT(set_presence); IMPLEMENT(get_presences); #undef IMPLEMENT } static void tp_presence_mixin_simple_presence_fill_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { TpPresenceMixinClass *mixin_cls = TP_PRESENCE_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); GHashTable *contact_statuses; GError *error = NULL; contact_statuses = mixin_cls->get_contact_statuses (obj, contacts, &error); if (contact_statuses == NULL) { DEBUG ("get_contact_statuses failed: %s", error->message); g_error_free (error); } else { GHashTableIter iter; gpointer key, value; G_GNUC_BEGIN_IGNORE_DEPRECATIONS GType type = G_TYPE_VALUE_ARRAY; G_GNUC_END_IGNORE_DEPRECATIONS g_hash_table_iter_init (&iter, contact_statuses); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); TpPresenceStatus *status = value; GValueArray *presence = construct_simple_presence_value_array ( status, mixin_cls->statuses); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE, tp_g_value_slice_new_take_boxed (type, presence)); } g_hash_table_unref (contact_statuses); } } /** * tp_presence_mixin_simple_presence_register_with_contacts_mixin: (skip) * @obj: An instance that of the implementation that uses both the Contacts * mixin and this mixin * * Register the SimplePresence interface with the Contacts interface to make it * inspectable. The Contacts mixin should be initialized before this function * is called */ void tp_presence_mixin_simple_presence_register_with_contacts_mixin (GObject *obj) { tp_contacts_mixin_add_contact_attributes_iface (obj, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, tp_presence_mixin_simple_presence_fill_contact_attributes); } /* For now, self->priv is just self if heap-allocated, NULL if not. */ static gboolean _tp_presence_status_spec_is_heap_allocated (const TpPresenceStatusSpec *self) { return (self->priv == (TpPresenceStatusSpecPrivate *) self); } /** * tp_presence_status_spec_get_presence_type: * @self: a presence status specification * * Return the category into which this presence type falls. For instance, * for XMPP's "" (do not disturb) status, this would return * %TP_CONNECTION_PRESENCE_TYPE_BUSY. * * Returns: a #TpConnectionPresenceType * Since: 0.23.1 */ TpConnectionPresenceType tp_presence_status_spec_get_presence_type (const TpPresenceStatusSpec *self) { g_return_val_if_fail (self != NULL, TP_CONNECTION_PRESENCE_TYPE_UNSET); return self->presence_type; } /** * tp_presence_status_spec_get_name: * @self: a presence status specification * * * * Returns: (transfer none): the name of this presence status, * such as "available" or "out-to-lunch". * Since: 0.23.1 */ const gchar * tp_presence_status_spec_get_name (const TpPresenceStatusSpec *self) { g_return_val_if_fail (self != NULL, NULL); return self->name; } /** * tp_presence_status_spec_can_set_on_self: * @self: a presence status specification * * * * Returns: %TRUE if the user can set this presence status on themselves (most * statuses), or %FALSE if they cannot directly set it on * themselves (typically used for %TP_CONNECTION_PRESENCE_TYPE_OFFLINE * and %TP_CONNECTION_PRESENCE_TYPE_ERROR) * Since: 0.23.1 */ gboolean tp_presence_status_spec_can_set_on_self (const TpPresenceStatusSpec *self) { g_return_val_if_fail (self != NULL, FALSE); return self->self; } /** * tp_presence_status_spec_has_message: * @self: a presence status specification * * * * Returns: %TRUE if this presence status is accompanied by an optional * human-readable message * Since: 0.23.1 */ gboolean tp_presence_status_spec_has_message (const TpPresenceStatusSpec *self) { const TpPresenceStatusOptionalArgumentSpec *arg; g_return_val_if_fail (self != NULL, FALSE); if (self->optional_arguments == NULL) return FALSE; for (arg = self->optional_arguments; arg->name != NULL; arg++) { if (!tp_strdiff (arg->name, "message") && !tp_strdiff (arg->dtype, "s")) return TRUE; } return FALSE; } /** * tp_presence_status_spec_new: * @name: the name of the new presence status * @type: the category into which this presence status falls * @can_set_on_self: %TRUE if the user can set this presence status * on themselves * @has_message: %TRUE if this presence status is accompanied by an * optional human-readable message * * * * Returns: (transfer full): a new #TpPresenceStatusSpec * Since: 0.23.1 */ TpPresenceStatusSpec * tp_presence_status_spec_new (const gchar *name, TpConnectionPresenceType type, gboolean can_set_on_self, gboolean has_message) { TpPresenceStatusSpec *ret; static const TpPresenceStatusOptionalArgumentSpec yes_it_has_a_message[] = { { "message", "s" }, { NULL } }; g_return_val_if_fail (!tp_str_empty (name), NULL); g_return_val_if_fail (type >= 0 && type < TP_NUM_CONNECTION_PRESENCE_TYPES, NULL); ret = g_slice_new0 (TpPresenceStatusSpec); ret->name = g_strdup (name); ret->presence_type = type; ret->self = can_set_on_self; if (has_message) ret->optional_arguments = yes_it_has_a_message; else ret->optional_arguments = NULL; /* dummy marker for "this is on the heap" rather than a real struct */ ret->priv = (TpPresenceStatusSpecPrivate *) ret; return ret; } /** * tp_presence_status_spec_copy: * @self: a presence status specification * * Copy a presence status specification. * * If @self has optional arguments other than a string named "message", * they are not copied. Optional arguments with other names or types * are deprecated. * * Returns: (transfer full): a new #TpPresenceStatusSpec resembling @self * Since: 0.23.1 */ TpPresenceStatusSpec * tp_presence_status_spec_copy (const TpPresenceStatusSpec *self) { g_return_val_if_fail (self != NULL, NULL); return tp_presence_status_spec_new (self->name, self->presence_type, self->self, tp_presence_status_spec_has_message (self)); } /** * tp_presence_status_spec_free: * @self: (transfer full): a presence status specification * * Free a presence status specification produced by * tp_presence_status_spec_new() or tp_presence_status_spec_copy(). * * Since: 0.23.1 */ void tp_presence_status_spec_free (TpPresenceStatusSpec *self) { g_return_if_fail (_tp_presence_status_spec_is_heap_allocated (self)); /* This struct was designed to always be on the stack, so freeing this * needs a non-const-correct cast */ g_free ((gchar *) self->name); g_slice_free (TpPresenceStatusSpec, self); } G_DEFINE_BOXED_TYPE (TpPresenceStatusSpec, tp_presence_status_spec, tp_presence_status_spec_copy, tp_presence_status_spec_free) telepathy-glib-0.24.2/telepathy-glib/presence-mixin.h0000644000175000017500000001421512652510705017451 00000000000000/* * presence-mixin.h - Header for TpPresenceMixin * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_PRESENCE_MIXIN_H__ #define __TP_PRESENCE_MIXIN_H__ #include #include #include #include "util.h" G_BEGIN_DECLS typedef struct _TpPresenceStatusOptionalArgumentSpec TpPresenceStatusOptionalArgumentSpec; typedef struct _TpPresenceStatusSpec TpPresenceStatusSpec; typedef struct _TpPresenceStatusSpecPrivate TpPresenceStatusSpecPrivate; struct _TpPresenceStatusOptionalArgumentSpec { const gchar *name; const gchar *dtype; /**/ gpointer _future1; gpointer _future2; }; struct _TpPresenceStatusSpec { const gchar *name; TpConnectionPresenceType presence_type; gboolean self; const TpPresenceStatusOptionalArgumentSpec *optional_arguments; /**/ gpointer _future1; TpPresenceStatusSpecPrivate *priv; }; _TP_AVAILABLE_IN_0_24 TpConnectionPresenceType tp_presence_status_spec_get_presence_type ( const TpPresenceStatusSpec *self); _TP_AVAILABLE_IN_0_24 const gchar *tp_presence_status_spec_get_name ( const TpPresenceStatusSpec *self); _TP_AVAILABLE_IN_0_24 gboolean tp_presence_status_spec_can_set_on_self ( const TpPresenceStatusSpec *self); _TP_AVAILABLE_IN_0_24 gboolean tp_presence_status_spec_has_message ( const TpPresenceStatusSpec *self); _TP_AVAILABLE_IN_0_24 GType tp_presence_status_spec_get_type (void); _TP_AVAILABLE_IN_0_24 TpPresenceStatusSpec *tp_presence_status_spec_new (const gchar *name, TpConnectionPresenceType type, gboolean can_set_on_self, gboolean has_message); _TP_AVAILABLE_IN_0_24 TpPresenceStatusSpec *tp_presence_status_spec_copy ( const TpPresenceStatusSpec *self); _TP_AVAILABLE_IN_0_24 void tp_presence_status_spec_free (TpPresenceStatusSpec *self); typedef struct _TpPresenceStatus TpPresenceStatus; struct _TpPresenceStatus { guint index; GHashTable *optional_arguments; /**/ gpointer _future1; gpointer _future2; }; TpPresenceStatus *tp_presence_status_new (guint which, GHashTable *optional_arguments) G_GNUC_WARN_UNUSED_RESULT; void tp_presence_status_free (TpPresenceStatus *status); typedef gboolean (*TpPresenceMixinStatusAvailableFunc) (GObject *obj, guint which); typedef GHashTable *(*TpPresenceMixinGetContactStatusesFunc) (GObject *obj, const GArray *contacts, GError **error); typedef gboolean (*TpPresenceMixinSetOwnStatusFunc) (GObject *obj, const TpPresenceStatus *status, GError **error); typedef guint (*TpPresenceMixinGetMaximumStatusMessageLengthFunc) ( GObject *obj); typedef struct _TpPresenceMixinClass TpPresenceMixinClass; typedef struct _TpPresenceMixinClassPrivate TpPresenceMixinClassPrivate; typedef struct _TpPresenceMixin TpPresenceMixin; typedef struct _TpPresenceMixinPrivate TpPresenceMixinPrivate; struct _TpPresenceMixinClass { TpPresenceMixinStatusAvailableFunc status_available; TpPresenceMixinGetContactStatusesFunc get_contact_statuses; TpPresenceMixinSetOwnStatusFunc set_own_status; const TpPresenceStatusSpec *statuses; /**/ TpPresenceMixinClassPrivate *priv; /**/ TpPresenceMixinGetMaximumStatusMessageLengthFunc get_maximum_status_message_length; /**/ gpointer _future1; gpointer _future2; gpointer _future3; }; struct _TpPresenceMixin { /**/ TpPresenceMixinPrivate *priv; }; /* TYPE MACROS */ #define TP_PRESENCE_MIXIN_CLASS_OFFSET_QUARK \ (tp_presence_mixin_class_get_offset_quark ()) #define TP_PRESENCE_MIXIN_CLASS_OFFSET(o) \ tp_mixin_class_get_offset (o, TP_PRESENCE_MIXIN_CLASS_OFFSET_QUARK) #define TP_PRESENCE_MIXIN_CLASS(o) \ ((TpPresenceMixinClass *) tp_mixin_offset_cast (o, \ TP_PRESENCE_MIXIN_CLASS_OFFSET (o))) #define TP_PRESENCE_MIXIN_OFFSET_QUARK (tp_presence_mixin_get_offset_quark ()) #define TP_PRESENCE_MIXIN_OFFSET(o) \ tp_mixin_instance_get_offset (o, TP_PRESENCE_MIXIN_OFFSET_QUARK) #define TP_PRESENCE_MIXIN(o) \ ((TpPresenceMixin *) tp_mixin_offset_cast (o, TP_PRESENCE_MIXIN_OFFSET (o))) GQuark tp_presence_mixin_class_get_offset_quark (void); GQuark tp_presence_mixin_get_offset_quark (void); void tp_presence_mixin_class_init (GObjectClass *obj_cls, glong offset, TpPresenceMixinStatusAvailableFunc status_available, TpPresenceMixinGetContactStatusesFunc get_contact_statuses, TpPresenceMixinSetOwnStatusFunc set_own_status, const TpPresenceStatusSpec *statuses); void tp_presence_mixin_init (GObject *obj, glong offset); void tp_presence_mixin_finalize (GObject *obj); void tp_presence_mixin_emit_presence_update (GObject *obj, GHashTable *contact_presences); void tp_presence_mixin_emit_one_presence_update (GObject *obj, TpHandle handle, const TpPresenceStatus *status); void tp_presence_mixin_iface_init (gpointer g_iface, gpointer iface_data); void tp_presence_mixin_simple_presence_iface_init (gpointer g_iface, gpointer iface_data); void tp_presence_mixin_simple_presence_init_dbus_properties (GObjectClass *cls); void tp_presence_mixin_simple_presence_register_with_contacts_mixin ( GObject *obj); G_END_DECLS #endif /* #ifndef __TP_PRESENCE_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/dbus-daemon.c0000644000175000017500000012224012652510705016712 00000000000000/* * dbus-daemon.c - Source for TpDBusDaemon * * Copyright (C) 2005-2009 Collabora Ltd. * Copyright (C) 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #include "telepathy-glib/_gen/tp-cli-dbus-daemon-body.h" #define DEBUG_FLAG TP_DEBUG_PROXY #include "debug-internal.h" /** * TpDBusDaemonClass: * * The class of #TpDBusDaemon. * * Since: 0.7.1 */ struct _TpDBusDaemonClass { /**/ TpProxyClass parent_class; gpointer priv; }; /** * TpDBusDaemon: * * A subclass of #TpProxy that represents the D-Bus daemon. It mainly provides * functionality to manage well-known names on the bus. * * Since: 0.7.1 */ struct _TpDBusDaemon { /**/ TpProxy parent; TpDBusDaemonPrivate *priv; }; struct _TpDBusDaemonPrivate { /* dup'd name => _NameOwnerWatch */ GHashTable *name_owner_watches; /* reffed */ DBusConnection *libdbus; }; G_DEFINE_TYPE (TpDBusDaemon, tp_dbus_daemon, TP_TYPE_PROXY) static gpointer starter_bus_daemon = NULL; /** * tp_dbus_daemon_dup: * @error: Used to indicate error if %NULL is returned * * Returns a proxy for signals and method calls on the D-Bus daemon on which * this process was activated (if it was launched by D-Bus service * activation), or the session bus (otherwise). * * If it is not possible to connect to the appropriate bus, raise an error * and return %NULL. * * The returned #TpDBusDaemon is cached; the same #TpDBusDaemon object will * be returned by this function repeatedly, as long as at least one reference * exists. * * Returns: (transfer full): a reference to a proxy for signals and method * calls on the bus daemon, or %NULL * * Since: 0.7.26 */ TpDBusDaemon * tp_dbus_daemon_dup (GError **error) { DBusGConnection *conn; if (starter_bus_daemon != NULL) return g_object_ref (starter_bus_daemon); conn = _tp_dbus_starter_bus_conn (error); if (conn == NULL) return NULL; starter_bus_daemon = tp_dbus_daemon_new (conn); g_assert (starter_bus_daemon != NULL); g_object_add_weak_pointer (starter_bus_daemon, &starter_bus_daemon); return starter_bus_daemon; } /** * tp_dbus_daemon_new: (skip) * @connection: a connection to D-Bus * * Returns a proxy for signals and method calls on a particular bus * connection. * * Use tp_dbus_daemon_dup() instead if you just want a connection to the * starter or session bus (which is almost always the right thing for * Telepathy). * * Returns: a new proxy for signals and method calls on the bus daemon * to which @connection is connected * * Since: 0.7.1 */ TpDBusDaemon * tp_dbus_daemon_new (DBusGConnection *connection) { g_return_val_if_fail (connection != NULL, NULL); return TP_DBUS_DAEMON (g_object_new (TP_TYPE_DBUS_DAEMON, "dbus-connection", connection, "bus-name", DBUS_SERVICE_DBUS, "object-path", DBUS_PATH_DBUS, NULL)); } typedef struct { gchar *last_owner; GArray *callbacks; gsize invoking; } _NameOwnerWatch; typedef struct { TpDBusDaemonNameOwnerChangedCb callback; gpointer user_data; GDestroyNotify destroy; } _NameOwnerSubWatch; static void _tp_dbus_daemon_stop_watching (TpDBusDaemon *self, const gchar *name, _NameOwnerWatch *watch); static void tp_dbus_daemon_maybe_free_name_owner_watch (TpDBusDaemon *self, const gchar *name, _NameOwnerWatch *watch) { /* Check to see whether this (callback, user_data) pair is in the watch's * array of callbacks. */ GArray *array = watch->callbacks; /* 1 greater than an index into @array, to avoid it going negative: we * iterate in reverse so we can delete elements without needing to adjust * @i to compensate */ guint i; if (watch->invoking > 0) return; for (i = array->len; i > 0; i--) { _NameOwnerSubWatch *entry = &g_array_index (array, _NameOwnerSubWatch, i - 1); if (entry->callback != NULL) continue; if (entry->destroy != NULL) entry->destroy (entry->user_data); g_array_remove_index (array, i - 1); } if (array->len == 0) { _tp_dbus_daemon_stop_watching (self, name, watch); g_hash_table_remove (self->priv->name_owner_watches, name); } } static void _tp_dbus_daemon_name_owner_changed (TpDBusDaemon *self, const gchar *name, const gchar *new_owner) { _NameOwnerWatch *watch = g_hash_table_lookup (self->priv->name_owner_watches, name); GArray *array; guint i; if (watch == NULL) return; /* This is partly to handle the case where an owner change happens * while GetNameOwner is in flight, partly to be able to optimize by only * calling GetNameOwner if we didn't already know, and partly because of a * dbus-glib bug that means we get every signal twice * (it thinks org.freedesktop.DBus is both a well-known name and a unique * name). */ if (!tp_strdiff (watch->last_owner, new_owner)) return; g_free (watch->last_owner); watch->last_owner = g_strdup (new_owner); /* We're calling out to user code which might end up removing its watch; * tell it to be less destructive. Also hold a ref on self, to avoid it * getting removed that way. */ array = watch->callbacks; g_object_ref (self); watch->invoking++; for (i = 0; i < array->len; i++) { _NameOwnerSubWatch *subwatch = &g_array_index (array, _NameOwnerSubWatch, i); if (subwatch->callback != NULL) subwatch->callback (self, name, new_owner, subwatch->user_data); } watch->invoking--; tp_dbus_daemon_maybe_free_name_owner_watch (self, name, watch); g_object_unref (self); } static dbus_int32_t daemons_slot = -1; typedef struct { DBusConnection *libdbus; DBusMessage *message; } NOCIdleContext; static NOCIdleContext * noc_idle_context_new (DBusConnection *libdbus, DBusMessage *message) { NOCIdleContext *context = g_slice_new (NOCIdleContext); context->libdbus = dbus_connection_ref (libdbus); context->message = dbus_message_ref (message); return context; } static void noc_idle_context_free (gpointer data) { NOCIdleContext *context = data; dbus_connection_unref (context->libdbus); dbus_message_unref (context->message); g_slice_free (NOCIdleContext, context); } static gboolean noc_idle_context_invoke (gpointer data) { NOCIdleContext *context = data; const gchar *name; const gchar *old_owner; const gchar *new_owner; DBusError dbus_error = DBUS_ERROR_INIT; GSList **daemons; if (daemons_slot == -1) return FALSE; if (!dbus_message_get_args (context->message, &dbus_error, DBUS_TYPE_STRING, &name, DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner, DBUS_TYPE_INVALID)) { DEBUG ("Couldn't unpack NameOwnerChanged(s, s, s): %s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return FALSE; } daemons = dbus_connection_get_data (context->libdbus, daemons_slot); DEBUG ("NameOwnerChanged(%s, %s -> %s)", name, old_owner, new_owner); /* should always be non-NULL, barring bugs */ if (G_LIKELY (daemons != NULL)) { GSList *iter; for (iter = *daemons; iter != NULL; iter = iter->next) { _tp_dbus_daemon_name_owner_changed (iter->data, name, new_owner); } } return FALSE; } static DBusHandlerResult _tp_dbus_daemon_name_owner_changed_filter (DBusConnection *libdbus, DBusMessage *message, void *unused G_GNUC_UNUSED) { /* We have to do the real work in an idle, so we don't break re-entrant * calls (the dbus-glib event source isn't re-entrant) */ if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged") && dbus_message_has_sender (message, DBUS_SERVICE_DBUS)) g_idle_add_full (G_PRIORITY_HIGH, noc_idle_context_invoke, noc_idle_context_new (libdbus, message), noc_idle_context_free); return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } typedef struct { TpDBusDaemon *self; gchar *name; DBusMessage *reply; gsize refs; } GetNameOwnerContext; static GetNameOwnerContext * get_name_owner_context_new (TpDBusDaemon *self, const gchar *name) { GetNameOwnerContext *context = g_slice_new (GetNameOwnerContext); context->self = g_object_ref (self); context->name = g_strdup (name); context->reply = NULL; context->refs = 1; return context; } static void get_name_owner_context_unref (gpointer data) { GetNameOwnerContext *context = data; if (--context->refs == 0) { g_object_unref (context->self); g_free (context->name); if (context->reply != NULL) dbus_message_unref (context->reply); g_slice_free (GetNameOwnerContext, context); } } static gboolean _tp_dbus_daemon_get_name_owner_idle (gpointer data) { GetNameOwnerContext *context = data; const gchar *owner = ""; if (context->reply == NULL) { DEBUG ("Connection disconnected or no reply to GetNameOwner(%s)", context->name); } else if (dbus_message_get_type (context->reply) == DBUS_MESSAGE_TYPE_METHOD_RETURN) { if (dbus_message_get_args (context->reply, NULL, DBUS_TYPE_STRING, &owner, DBUS_TYPE_INVALID)) { DEBUG ("GetNameOwner(%s) -> %s", context->name, owner); } else { DEBUG ("Malformed reply from GetNameOwner(%s), assuming no owner", context->name); } } else { if (DEBUGGING) { DBusError error = DBUS_ERROR_INIT; if (dbus_set_error_from_message (&error, context->reply)) { DEBUG ("GetNameOwner(%s) raised %s: %s", context->name, error.name, error.message); dbus_error_free (&error); } else { DEBUG ("Unexpected message type from GetNameOwner(%s)", context->name); } } } _tp_dbus_daemon_name_owner_changed (context->self, context->name, owner); return FALSE; } /** * TpDBusDaemonNameOwnerChangedCb: * @bus_daemon: The D-Bus daemon * @name: The name whose ownership has changed or been discovered * @new_owner: The unique name that now owns @name * @user_data: Arbitrary user-supplied data as passed to * tp_dbus_daemon_watch_name_owner() * * The signature of the callback called by tp_dbus_daemon_watch_name_owner(). * * Since: 0.7.1 */ static inline gchar * _tp_dbus_daemon_get_noc_rule (const gchar *name) { return g_strdup_printf ("type='signal'," "sender='" DBUS_SERVICE_DBUS "'," "path='" DBUS_PATH_DBUS "'," "interface='"DBUS_INTERFACE_DBUS "'," "member='NameOwnerChanged'," "arg0='%s'", name); } static void _tp_dbus_daemon_get_name_owner_notify (DBusPendingCall *pc, gpointer data) { GetNameOwnerContext *context = data; /* we recycle this function for the case where the connection is already * disconnected: in that case we use pc = NULL */ if (pc != NULL) context->reply = dbus_pending_call_steal_reply (pc); /* We have to do the real work in an idle, so we don't break re-entrant * calls (the dbus-glib event source isn't re-entrant) */ context->refs++; g_idle_add_full (G_PRIORITY_HIGH, _tp_dbus_daemon_get_name_owner_idle, context, get_name_owner_context_unref); if (pc != NULL) dbus_pending_call_unref (pc); } /** * tp_dbus_daemon_watch_name_owner: * @self: The D-Bus daemon * @name: The name whose ownership is to be watched * @callback: Callback to call when the ownership is discovered or changes * @user_data: Arbitrary data to pass to @callback * @destroy: Called to destroy @user_data when the name owner watch is * cancelled due to tp_dbus_daemon_cancel_name_owner_watch() * * Arrange for @callback to be called with the owner of @name as soon as * possible (which might even be before this function returns!), then * again every time the ownership of @name changes. * * If multiple watches are registered for the same @name, they will be called * in the order they were registered. * * Since: 0.7.1 */ void tp_dbus_daemon_watch_name_owner (TpDBusDaemon *self, const gchar *name, TpDBusDaemonNameOwnerChangedCb callback, gpointer user_data, GDestroyNotify destroy) { _NameOwnerWatch *watch = g_hash_table_lookup (self->priv->name_owner_watches, name); _NameOwnerSubWatch tmp = { callback, user_data, destroy }; g_return_if_fail (TP_IS_DBUS_DAEMON (self)); g_return_if_fail (tp_dbus_check_valid_bus_name (name, TP_DBUS_NAME_TYPE_ANY, NULL)); g_return_if_fail (callback != NULL); if (watch == NULL) { gchar *match_rule; DBusMessage *message; DBusPendingCall *pc = NULL; GetNameOwnerContext *context = get_name_owner_context_new (self, name); /* Allocate a new watch */ watch = g_slice_new0 (_NameOwnerWatch); watch->last_owner = NULL; watch->callbacks = g_array_new (FALSE, FALSE, sizeof (_NameOwnerSubWatch)); g_hash_table_insert (self->priv->name_owner_watches, g_strdup (name), watch); /* We want to be notified about name owner changes for this one. * Assume the match addition will succeed; there's no good way to cope * with failure here... */ match_rule = _tp_dbus_daemon_get_noc_rule (name); DEBUG ("Adding match rule %s", match_rule); dbus_bus_add_match (self->priv->libdbus, match_rule, NULL); g_free (match_rule); message = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetNameOwner"); if (message == NULL) ERROR ("Out of memory"); /* We already checked that @name was in (a small subset of) UTF-8, * so OOM is the only thing that can go wrong. The use of &name here * is because libdbus is strange. */ if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID)) ERROR ("Out of memory"); if (!dbus_connection_send_with_reply (self->priv->libdbus, message, &pc, -1)) ERROR ("Out of memory"); /* pc is unreffed by _tp_dbus_daemon_get_name_owner_notify */ dbus_message_unref (message); if (pc == NULL || dbus_pending_call_get_completed (pc)) { /* pc can be NULL when the connection is already disconnected */ _tp_dbus_daemon_get_name_owner_notify (pc, context); get_name_owner_context_unref (context); } else if (!dbus_pending_call_set_notify (pc, _tp_dbus_daemon_get_name_owner_notify, context, get_name_owner_context_unref)) { ERROR ("Out of memory"); } } g_array_append_val (watch->callbacks, tmp); if (watch->last_owner != NULL) { /* FIXME: should avoid reentrancy? */ callback (self, name, watch->last_owner, user_data); } } static void _tp_dbus_daemon_stop_watching (TpDBusDaemon *self, const gchar *name, _NameOwnerWatch *watch) { gchar *match_rule; /* Clean up any leftöver callbacks. */ if (watch->callbacks->len > 0) { guint i; for (i = 0; i < watch->callbacks->len; i++) { _NameOwnerSubWatch *entry = &g_array_index (watch->callbacks, _NameOwnerSubWatch, i); if (entry->destroy != NULL) entry->destroy (entry->user_data); } } g_array_unref (watch->callbacks); g_free (watch->last_owner); g_slice_free (_NameOwnerWatch, watch); match_rule = _tp_dbus_daemon_get_noc_rule (name); DEBUG ("Removing match rule %s", match_rule); dbus_bus_remove_match (self->priv->libdbus, match_rule, NULL); g_free (match_rule); } /** * tp_dbus_daemon_cancel_name_owner_watch: (skip) * @self: the D-Bus daemon * @name: the name that was being watched * @callback: the callback that was called * @user_data: the user data that was provided * * If there was a previous call to tp_dbus_daemon_watch_name_owner() * with exactly the given @name, @callback and @user_data, remove it. * * If more than one watch matching the details provided was active, remove * only the most recently added one. * * Returns: %TRUE if there was such a watch, %FALSE otherwise * * Since: 0.7.1 */ gboolean tp_dbus_daemon_cancel_name_owner_watch (TpDBusDaemon *self, const gchar *name, TpDBusDaemonNameOwnerChangedCb callback, gconstpointer user_data) { _NameOwnerWatch *watch = g_hash_table_lookup (self->priv->name_owner_watches, name); g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), FALSE); g_return_val_if_fail (name != NULL, FALSE); g_return_val_if_fail (callback != NULL, FALSE); if (watch != NULL) { /* Check to see whether this (callback, user_data) pair is in the watch's * array of callbacks. */ GArray *array = watch->callbacks; /* 1 greater than an index into @array, to avoid it going negative; * we iterate in reverse to have "last in = first out" as documented. */ guint i; for (i = array->len; i > 0; i--) { _NameOwnerSubWatch *entry = &g_array_index (array, _NameOwnerSubWatch, i - 1); if (entry->callback == callback && entry->user_data == user_data) { entry->callback = NULL; tp_dbus_daemon_maybe_free_name_owner_watch (self, name, watch); return TRUE; } } } /* We haven't found it */ return FALSE; } /* for internal use (TpChannel, TpConnection _new convenience functions) */ gboolean _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, gint timeout_ms, const gchar *well_known_name, gchar **unique_name, GError **error) { DBusGConnection *gconn; DBusConnection *dbc; DBusMessage *message; DBusMessage *reply; DBusError dbus_error; const char *name_in_reply; const GError *invalidated; g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); invalidated = tp_proxy_get_invalidated (self); if (invalidated != NULL) { if (error != NULL) *error = g_error_copy (invalidated); return FALSE; } gconn = tp_proxy_get_dbus_connection (self); dbc = dbus_g_connection_get_connection (gconn); message = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, "GetNameOwner"); if (message == NULL) ERROR ("Out of memory"); if (!dbus_message_append_args (message, DBUS_TYPE_STRING, &well_known_name, DBUS_TYPE_INVALID)) ERROR ("Out of memory"); dbus_error_init (&dbus_error); reply = dbus_connection_send_with_reply_and_block (dbc, message, timeout_ms, &dbus_error); dbus_message_unref (message); if (reply == NULL) { if (!tp_strdiff (dbus_error.name, DBUS_ERROR_NO_MEMORY)) ERROR ("Out of memory"); /* FIXME: ideally we'd use dbus-glib's error mapping for this */ g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return FALSE; } if (!dbus_message_get_args (reply, &dbus_error, DBUS_TYPE_STRING, &name_in_reply, DBUS_TYPE_INVALID)) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); dbus_message_unref (reply); return FALSE; } if (unique_name != NULL) *unique_name = g_strdup (name_in_reply); dbus_message_unref (reply); return TRUE; } /** * tp_dbus_daemon_request_name: * @self: a TpDBusDaemon * @well_known_name: a well-known name to acquire * @idempotent: whether to consider it to be a success if this process * already owns the name * @error: used to raise an error if %FALSE is returned * * Claim the given well-known name without queueing, allowing replacement * or replacing an existing name-owner. This makes a synchronous call to the * bus daemon. * * Returns: %TRUE if @well_known_name was claimed, or %FALSE and sets @error if * an error occurred. * * Since: 0.7.30 */ gboolean tp_dbus_daemon_request_name (TpDBusDaemon *self, const gchar *well_known_name, gboolean idempotent, GError **error) { TpProxy *as_proxy = (TpProxy *) self; DBusGConnection *gconn; DBusConnection *dbc; DBusError dbus_error; int result; const GError *invalidated; g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); invalidated = tp_proxy_get_invalidated (self); if (invalidated != NULL) { if (error != NULL) *error = g_error_copy (invalidated); return FALSE; } gconn = as_proxy->dbus_connection; dbc = dbus_g_connection_get_connection (gconn); dbus_error_init (&dbus_error); result = dbus_bus_request_name (dbc, well_known_name, DBUS_NAME_FLAG_DO_NOT_QUEUE, &dbus_error); switch (result) { case DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER: return TRUE; case DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER: if (idempotent) { return TRUE; } else { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Name '%s' already in use by this process", well_known_name); return FALSE; } case DBUS_REQUEST_NAME_REPLY_EXISTS: case DBUS_REQUEST_NAME_REPLY_IN_QUEUE: /* the latter shouldn't actually happen since we said DO_NOT_QUEUE */ g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Name '%s' already in use by another process", well_known_name); return FALSE; case -1: g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return FALSE; default: g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "RequestName('%s') returned %d and I don't know what that means", well_known_name, result); return FALSE; } } /** * tp_dbus_daemon_release_name: * @self: a TpDBusDaemon * @well_known_name: a well-known name owned by this process to release * @error: used to raise an error if %FALSE is returned * * Release the given well-known name. This makes a synchronous call to the bus * daemon. * * Returns: %TRUE if @well_known_name was released, or %FALSE and sets @error * if an error occurred. * * Since: 0.7.30 */ gboolean tp_dbus_daemon_release_name (TpDBusDaemon *self, const gchar *well_known_name, GError **error) { TpProxy *as_proxy = (TpProxy *) self; DBusGConnection *gconn; DBusConnection *dbc; DBusError dbus_error; int result; const GError *invalidated; g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), FALSE); g_return_val_if_fail (tp_dbus_check_valid_bus_name (well_known_name, TP_DBUS_NAME_TYPE_WELL_KNOWN, error), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); invalidated = tp_proxy_get_invalidated (self); if (invalidated != NULL) { if (error != NULL) *error = g_error_copy (invalidated); return FALSE; } gconn = as_proxy->dbus_connection; dbc = dbus_g_connection_get_connection (gconn); dbus_error_init (&dbus_error); result = dbus_bus_release_name (dbc, well_known_name, &dbus_error); switch (result) { case DBUS_RELEASE_NAME_REPLY_RELEASED: return TRUE; case DBUS_RELEASE_NAME_REPLY_NOT_OWNER: g_set_error (error, TP_ERROR, TP_ERROR_NOT_YOURS, "Name '%s' owned by another process", well_known_name); return FALSE; case DBUS_RELEASE_NAME_REPLY_NON_EXISTENT: g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Name '%s' not owned", well_known_name); return FALSE; case -1: g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); return FALSE; default: g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "ReleaseName('%s') returned %d and I don't know what that means", well_known_name, result); return FALSE; } } /** * tp_dbus_daemon_register_object: * @self: object representing a connection to a bus * @object_path: an object path * @object: (type GObject.Object) (transfer none): an object to export * * Export @object at @object_path. This is a convenience wrapper around * dbus_g_connection_register_g_object(), and behaves similarly. * * Since: 0.11.3 */ void tp_dbus_daemon_register_object (TpDBusDaemon *self, const gchar *object_path, gpointer object) { TpProxy *as_proxy = (TpProxy *) self; g_return_if_fail (TP_IS_DBUS_DAEMON (self)); g_return_if_fail (tp_dbus_check_valid_object_path (object_path, NULL)); g_return_if_fail (G_IS_OBJECT (object)); dbus_g_connection_register_g_object (as_proxy->dbus_connection, object_path, object); } /** * tp_dbus_daemon_unregister_object: * @self: object representing a connection to a bus * @object: (type GObject.Object) (transfer none): an object previously exported * with tp_dbus_daemon_register_object() * * Stop exporting @object on D-Bus. This is a convenience wrapper around * dbus_g_connection_unregister_g_object(), and behaves similarly. * * Since: 0.11.3 */ void tp_dbus_daemon_unregister_object (TpDBusDaemon *self, gpointer object) { TpProxy *as_proxy = (TpProxy *) self; g_return_if_fail (TP_IS_DBUS_DAEMON (self)); g_return_if_fail (G_IS_OBJECT (object)); dbus_g_connection_unregister_g_object (as_proxy->dbus_connection, object); } /** * tp_dbus_daemon_get_unique_name: * @self: object representing a connection to a bus * * * * Returns: the unique name of this connection to the bus, which is valid for * as long as this #TpDBusDaemon is * Since: 0.7.35 */ const gchar * tp_dbus_daemon_get_unique_name (TpDBusDaemon *self) { g_return_val_if_fail (TP_IS_DBUS_DAEMON (self), NULL); return dbus_bus_get_unique_name (self->priv->libdbus); } typedef struct { TpDBusDaemon *self; DBusMessage *reply; TpDBusDaemonListNamesCb callback; gpointer user_data; GDestroyNotify destroy; gpointer weak_object; gsize refs; } ListNamesContext; static ListNamesContext * list_names_context_new (TpDBusDaemon *self, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { ListNamesContext *context = g_slice_new (ListNamesContext); context->self = g_object_ref (self); context->reply = NULL; context->callback = callback; context->user_data = user_data; context->destroy = destroy; context->weak_object = weak_object; if (context->weak_object != NULL) g_object_add_weak_pointer (weak_object, &context->weak_object); context->refs = 1; return context; } static void list_names_context_unref (gpointer data) { ListNamesContext *context = data; if (--context->refs == 0) { g_object_unref (context->self); if (context->reply != NULL) dbus_message_unref (context->reply); if (context->destroy != NULL) context->destroy (context->user_data); context->destroy = NULL; if (context->weak_object != NULL) g_object_remove_weak_pointer (context->weak_object, &context->weak_object); g_slice_free (ListNamesContext, context); } } static gboolean _tp_dbus_daemon_list_names_idle (gpointer data) { ListNamesContext *context = data; char **array = NULL; const gchar * const *result = NULL; GError *error = NULL; if (context->callback == NULL) { DEBUG ("Caller no longer cares (weak object vanished), ignoring"); return FALSE; } if (context->reply == NULL) { g_set_error_literal (&error, DBUS_GERROR, DBUS_GERROR_DISCONNECTED, "DBusConnection disconnected"); } else if (dbus_message_get_type (context->reply) == DBUS_MESSAGE_TYPE_METHOD_RETURN) { int n_elements; if (dbus_message_get_args (context->reply, NULL, DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &array, &n_elements, DBUS_TYPE_INVALID)) { result = (const gchar * const *) array; g_assert (result[n_elements] == NULL); } else { g_set_error_literal (&error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Malformed reply from List*Names()"); } } else { DBusError dbus_error = DBUS_ERROR_INIT; if (dbus_set_error_from_message (&dbus_error, context->reply)) { /* FIXME: ideally we'd use dbus-glib's error mapping here, but we * don't have access to it */ g_set_error (&error, DBUS_GERROR, DBUS_GERROR_FAILED, "List*Names() raised %s: %s", dbus_error.name, dbus_error.message); dbus_error_free (&dbus_error); } else { g_set_error_literal (&error, DBUS_GERROR, DBUS_GERROR_INVALID_ARGS, "Unexpected message type from List*Names()"); } } if (error != NULL) DEBUG ("%s", error->message); context->callback (context->self, result, error, context->user_data, context->weak_object); dbus_free_string_array (array); /* NULL-safe */ return FALSE; } static void _tp_dbus_daemon_list_names_notify (DBusPendingCall *pc, gpointer data) { ListNamesContext *context = data; /* we recycle this function for the case where the connection is already * disconnected: in that case we use pc = NULL */ if (pc != NULL) context->reply = dbus_pending_call_steal_reply (pc); /* We have to do the real work in an idle, so we don't break re-entrant * calls (the dbus-glib event source isn't re-entrant) */ context->refs++; g_idle_add_full (G_PRIORITY_HIGH, _tp_dbus_daemon_list_names_idle, context, list_names_context_unref); if (pc != NULL) dbus_pending_call_unref (pc); } /** * TpDBusDaemonListNamesCb: * @bus_daemon: object representing a connection to a bus * @names: constant %NULL-terminated array of constant strings representing * bus names, or %NULL on error * @error: the error that occurred, or %NULL on success * @user_data: the same user data that was passed to * tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names * @weak_object: the same object that was passed to * tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names * * Signature of a callback for functions that list bus names. * * Since: 0.7.35 */ static void _tp_dbus_daemon_list_names_common (TpDBusDaemon *self, const gchar *method, gint timeout_ms, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { DBusMessage *message; DBusPendingCall *pc = NULL; ListNamesContext *context; g_return_if_fail (TP_IS_DBUS_DAEMON (self)); g_return_if_fail (callback != NULL); g_return_if_fail (weak_object == NULL || G_IS_OBJECT (weak_object)); message = dbus_message_new_method_call (DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS, method); if (message == NULL) ERROR ("Out of memory"); if (!dbus_connection_send_with_reply (self->priv->libdbus, message, &pc, timeout_ms)) ERROR ("Out of memory"); /* pc is unreffed by _tp_dbus_daemon_list_names_notify */ dbus_message_unref (message); context = list_names_context_new (self, callback, user_data, destroy, weak_object); if (pc == NULL || dbus_pending_call_get_completed (pc)) { /* pc can be NULL when the connection is already disconnected */ _tp_dbus_daemon_list_names_notify (pc, context); list_names_context_unref (context); } else if (!dbus_pending_call_set_notify (pc, _tp_dbus_daemon_list_names_notify, context, list_names_context_unref)) { ERROR ("Out of memory"); } } /** * tp_dbus_daemon_list_names: * @self: object representing a connection to a bus * @timeout_ms: timeout for the call * @callback: callback to be called on success or failure; must not be %NULL * @user_data: opaque user-supplied data to pass to the callback * @destroy: if not %NULL, called with @user_data as argument after the call * has succeeded or failed, or after @weak_object has been destroyed * @weak_object: if not %NULL, a GObject which will be weakly referenced; if * it is destroyed, @callback will not be called at all * * Call the ListNames method on the bus daemon, asynchronously. The @callback * will be called from the main loop with a list of all the names (either * unique or well-known) that exist on the bus. * * In versions of telepathy-glib that have it, this should be preferred * instead of calling tp_cli_dbus_daemon_call_list_names(), since that * function will result in wakeups for every NameOwnerChanged signal. * * Since: 0.7.35 */ void tp_dbus_daemon_list_names (TpDBusDaemon *self, gint timeout_ms, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { _tp_dbus_daemon_list_names_common (self, "ListNames", timeout_ms, callback, user_data, destroy, weak_object); } /** * tp_dbus_daemon_list_activatable_names: * @self: object representing a connection to a bus daemon * @timeout_ms: timeout for the call * @callback: callback to be called on success or failure; must not be %NULL * @user_data: opaque user-supplied data to pass to the callback * @destroy: if not %NULL, called with @user_data as argument after the call * has succeeded or failed, or after @weak_object has been destroyed * @weak_object: if not %NULL, a GObject which will be weakly referenced; if * it is destroyed, @callback will not be called at all * * Call the ListActivatableNames method on the bus daemon, asynchronously. * The @callback will be called from the main loop with a list of all the * well-known names that are available for service-activation on the bus. * * In versions of telepathy-glib that have it, this should be preferred * instead of calling tp_cli_dbus_daemon_call_list_activatable_names(), since * that function will result in wakeups for every NameOwnerChanged signal. * * Since: 0.7.35 */ void tp_dbus_daemon_list_activatable_names (TpDBusDaemon *self, gint timeout_ms, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { _tp_dbus_daemon_list_names_common (self, "ListActivatableNames", timeout_ms, callback, user_data, destroy, weak_object); } static void free_daemon_list (gpointer p) { GSList **slistp = p; g_slist_free (*slistp); g_slice_free (GSList *, slistp); } /* If you add more slice-allocation in this function, make the suppression * "tp_dbus_daemon_constructor @daemons once per DBusConnection" in * telepathy-glib.supp more specific. */ static GObject * tp_dbus_daemon_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *) tp_dbus_daemon_parent_class; TpDBusDaemon *self = TP_DBUS_DAEMON (object_class->constructor (type, n_params, params)); TpProxy *as_proxy = (TpProxy *) self; GSList **daemons; g_assert (!tp_strdiff (as_proxy->bus_name, DBUS_SERVICE_DBUS)); g_assert (!tp_strdiff (as_proxy->object_path, DBUS_PATH_DBUS)); self->priv->libdbus = dbus_connection_ref ( dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (self))); /* one ref per TpDBusDaemon, released in finalize */ if (!dbus_connection_allocate_data_slot (&daemons_slot)) ERROR ("Out of memory"); daemons = dbus_connection_get_data (self->priv->libdbus, daemons_slot); if (daemons == NULL) { /* This slice is never freed; it's a one-per-DBusConnection leak. */ daemons = g_slice_new (GSList *); *daemons = NULL; dbus_connection_set_data (self->priv->libdbus, daemons_slot, daemons, free_daemon_list); /* we add this filter at most once per DBusConnection */ if (!dbus_connection_add_filter (self->priv->libdbus, _tp_dbus_daemon_name_owner_changed_filter, NULL, NULL)) ERROR ("Out of memory"); } *daemons = g_slist_prepend (*daemons, self); return (GObject *) self; } static void tp_dbus_daemon_init (TpDBusDaemon *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_DBUS_DAEMON, TpDBusDaemonPrivate); self->priv->name_owner_watches = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } static void tp_dbus_daemon_dispose (GObject *object) { TpDBusDaemon *self = TP_DBUS_DAEMON (object); GSList **daemons; if (self->priv->name_owner_watches != NULL) { GHashTable *tmp = self->priv->name_owner_watches; GHashTableIter iter; gpointer k, v; self->priv->name_owner_watches = NULL; g_hash_table_iter_init (&iter, tmp); while (g_hash_table_iter_next (&iter, &k, &v)) { _NameOwnerWatch *watch = v; /* it refs us while invoking stuff */ g_assert (watch->invoking == 0); _tp_dbus_daemon_stop_watching (self, k, watch); g_hash_table_iter_remove (&iter); } g_hash_table_unref (tmp); } if (self->priv->libdbus != NULL) { /* remove myself from the list to be notified on NoC */ daemons = dbus_connection_get_data (self->priv->libdbus, daemons_slot); /* should always be non-NULL, barring bugs */ if (G_LIKELY (daemons != NULL)) { *daemons = g_slist_remove (*daemons, self); if (*daemons == NULL) { /* this results in a call to free_daemon_list (daemons) */ dbus_connection_set_data (self->priv->libdbus, daemons_slot, NULL, NULL); } } dbus_connection_unref (self->priv->libdbus); self->priv->libdbus = NULL; } G_OBJECT_CLASS (tp_dbus_daemon_parent_class)->dispose (object); } static void tp_dbus_daemon_finalize (GObject *object) { GObjectFinalizeFunc chain_up = G_OBJECT_CLASS (tp_dbus_daemon_parent_class)->finalize; /* one ref per TpDBusDaemon, from constructor */ dbus_connection_free_data_slot (&daemons_slot); if (chain_up != NULL) chain_up (object); } /** * tp_dbus_daemon_init_known_interfaces: * * Ensure that the known interfaces for TpDBusDaemon have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_DBUS_DAEMON. * * Since: 0.7.32 */ void tp_dbus_daemon_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_DBUS_DAEMON, tp_cli_dbus_daemon_add_signals); g_once_init_leave (&once, 1); } } static void tp_dbus_daemon_class_init (TpDBusDaemonClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; tp_dbus_daemon_init_known_interfaces (); g_type_class_add_private (klass, sizeof (TpDBusDaemonPrivate)); object_class->constructor = tp_dbus_daemon_constructor; object_class->dispose = tp_dbus_daemon_dispose; object_class->finalize = tp_dbus_daemon_finalize; proxy_class->interface = TP_IFACE_QUARK_DBUS_DAEMON; } gboolean _tp_dbus_daemon_is_the_shared_one (TpDBusDaemon *self) { return (self != NULL && self == starter_bus_daemon); } /* Auto-generated implementation of _tp_register_dbus_glib_marshallers */ #include "_gen/register-dbus-glib-marshallers-body.h" telepathy-glib-0.24.2/telepathy-glib/dbus-daemon.h0000644000175000017500000000741512652510705016725 00000000000000/* * dbus-daemon.h - Header for TpDBusDaemon * * Copyright (C) 2005-2009 Collabora Ltd. * Copyright (C) 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TELEPATHY_DBUS_DAEMON_H__ #define __TELEPATHY_DBUS_DAEMON_H__ #ifndef __TP_IN_DBUS_H__ #error dbus-daemon.h not to be used directly, #include #endif #include #include G_BEGIN_DECLS /* TpDBusDaemon is typedef'd in proxy.h */ typedef struct _TpDBusDaemonPrivate TpDBusDaemonPrivate; typedef struct _TpDBusDaemonClass TpDBusDaemonClass; GType tp_dbus_daemon_get_type (void); #define TP_TYPE_DBUS_DAEMON \ (tp_dbus_daemon_get_type ()) #define TP_DBUS_DAEMON(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_DBUS_DAEMON, \ TpDBusDaemon)) #define TP_DBUS_DAEMON_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_DBUS_DAEMON, \ TpDBusDaemonClass)) #define TP_IS_DBUS_DAEMON(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_DBUS_DAEMON)) #define TP_IS_DBUS_DAEMON_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_DBUS_DAEMON)) #define TP_DBUS_DAEMON_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DBUS_DAEMON, \ TpDBusDaemonClass)) TpDBusDaemon *tp_dbus_daemon_dup (GError **error) G_GNUC_WARN_UNUSED_RESULT; TpDBusDaemon *tp_dbus_daemon_new (DBusGConnection *connection) G_GNUC_WARN_UNUSED_RESULT; void tp_dbus_daemon_init_known_interfaces (void); typedef void (*TpDBusDaemonNameOwnerChangedCb) (TpDBusDaemon *bus_daemon, const gchar *name, const gchar *new_owner, gpointer user_data); void tp_dbus_daemon_watch_name_owner (TpDBusDaemon *self, const gchar *name, TpDBusDaemonNameOwnerChangedCb callback, gpointer user_data, GDestroyNotify destroy); gboolean tp_dbus_daemon_cancel_name_owner_watch (TpDBusDaemon *self, const gchar *name, TpDBusDaemonNameOwnerChangedCb callback, gconstpointer user_data); gboolean tp_dbus_daemon_request_name (TpDBusDaemon *self, const gchar *well_known_name, gboolean idempotent, GError **error); gboolean tp_dbus_daemon_release_name (TpDBusDaemon *self, const gchar *well_known_name, GError **error); const gchar *tp_dbus_daemon_get_unique_name (TpDBusDaemon *self); typedef void (*TpDBusDaemonListNamesCb) (TpDBusDaemon *bus_daemon, const gchar * const *names, const GError *error, gpointer user_data, GObject *weak_object); void tp_dbus_daemon_list_names (TpDBusDaemon *self, gint timeout_ms, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); void tp_dbus_daemon_list_activatable_names (TpDBusDaemon *self, gint timeout_ms, TpDBusDaemonListNamesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); void tp_dbus_daemon_register_object (TpDBusDaemon *self, const gchar *object_path, gpointer object); void tp_dbus_daemon_unregister_object (TpDBusDaemon *self, gpointer object); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/call-content.c0000644000175000017500000006115312652510705017104 00000000000000/* * call-content.h - high level API for Call contents * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-content * @title: TpCallContent * @short_description: proxy object for a call content * * #TpCallContent is a sub-class of #TpProxy providing convenient API * to represent #TpCallChannel's content. */ /** * TpCallContent: * * Data structure representing a #TpCallContent. * * Since: 0.17.5 */ /** * TpCallContentClass: * * The class of a #TpCallContent. * * Since: 0.17.5 */ #include "config.h" #include "telepathy-glib/call-content.h" #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/call-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" #include "_gen/tp-cli-call-content-body.h" G_DEFINE_TYPE (TpCallContent, tp_call_content, TP_TYPE_PROXY) typedef struct _SendTonesData SendTonesData; struct _TpCallContentPrivate { TpConnection *connection; TpCallChannel *channel; gchar *name; TpMediaStreamType media_type; TpCallContentDisposition disposition; GPtrArray *streams; gboolean properties_retrieved; GQueue *tones_queue; SendTonesData *current_tones; }; enum { PROP_CONNECTION = 1, PROP_NAME, PROP_MEDIA_TYPE, PROP_DISPOSITION, PROP_STREAMS, PROP_CHANNEL }; enum { REMOVED, STREAMS_ADDED, STREAMS_REMOVED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; static TpCallStream * _tp_call_stream_new (TpCallContent *self, const gchar *object_path) { return g_object_new (TP_TYPE_CALL_STREAM, "bus-name", tp_proxy_get_bus_name (self), "dbus-daemon", tp_proxy_get_dbus_daemon (self), "dbus-connection", tp_proxy_get_dbus_connection (self), "object-path", object_path, "connection", self->priv->connection, "content", self, "factory", tp_proxy_get_factory (self), NULL); } static void streams_added_cb (TpCallContent *self, const GPtrArray *streams, gpointer user_data, GObject *weak_object) { guint i; GPtrArray *added_streams; if (!self->priv->properties_retrieved) return; added_streams = g_ptr_array_sized_new (streams->len); for (i = 0; i < streams->len; i++) { const gchar *object_path = g_ptr_array_index (streams, i); TpCallStream *stream ; DEBUG ("Stream added: %s", object_path); stream = _tp_call_stream_new (self, object_path); g_ptr_array_add (self->priv->streams, stream); g_ptr_array_add (added_streams, stream); } g_signal_emit (self, _signals[STREAMS_ADDED], 0, added_streams); g_ptr_array_unref (added_streams); } static void streams_removed_cb (TpCallContent *self, const GPtrArray *streams, const GValueArray *reason, gpointer user_data, GObject *weak_object) { GPtrArray *removed_streams; guint i; if (!self->priv->properties_retrieved) return; removed_streams = g_ptr_array_new_full (streams->len, g_object_unref); for (i = 0; i < streams->len; i++) { const gchar *object_path = g_ptr_array_index (streams, i); gboolean found = FALSE; guint j; for (j = 0; j < self->priv->streams->len; j++) { TpCallStream *stream = g_ptr_array_index (self->priv->streams, j); if (!tp_strdiff (tp_proxy_get_object_path (stream), object_path)) { DEBUG ("Stream removed: %s", object_path); found = TRUE; g_ptr_array_add (removed_streams, g_object_ref (stream)); g_ptr_array_remove_index_fast (self->priv->streams, j); break; } } if (!found) DEBUG ("Stream '%s' removed but not found", object_path); } if (removed_streams->len > 0) { TpCallStateReason *r; r = _tp_call_state_reason_new (reason); g_signal_emit (self, _signals[STREAMS_REMOVED], 0, removed_streams, r); _tp_call_state_reason_unref (r); } g_ptr_array_unref (removed_streams); } static void tones_stopped_cb (TpCallContent *self, gboolean cancelled, gpointer user_data, GObject *weak_object); static void got_all_properties_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpCallContent *self = (TpCallContent *) proxy; const gchar * const *interfaces; GPtrArray *streams; guint i; if (error != NULL) { DEBUG ("Could not get the call content properties: %s", error->message); _tp_proxy_set_feature_prepared (proxy, TP_CALL_CONTENT_FEATURE_CORE, FALSE); return; } self->priv->properties_retrieved = TRUE; interfaces = tp_asv_get_boxed (properties, "Interfaces", G_TYPE_STRV); self->priv->name = g_strdup (tp_asv_get_string (properties, "Name")); self->priv->media_type = tp_asv_get_uint32 (properties, "Type", NULL); self->priv->disposition = tp_asv_get_uint32 (properties, "Disposition", NULL); streams = tp_asv_get_boxed (properties, "Streams", TP_ARRAY_TYPE_OBJECT_PATH_LIST); tp_proxy_add_interfaces ((TpProxy *) self, interfaces); for (i = 0; i < streams->len; i++) { const gchar *object_path = g_ptr_array_index (streams, i); DEBUG ("Initial stream added: %s", object_path); g_ptr_array_add (self->priv->streams, _tp_call_stream_new (self, object_path)); } if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF)) { tp_cli_call_content_interface_dtmf_connect_to_stopped_tones (self, tones_stopped_cb, NULL, NULL, NULL, NULL); } _tp_proxy_set_feature_prepared (proxy, TP_CALL_CONTENT_FEATURE_CORE, TRUE); } struct _SendTonesData { TpCallContent *content; gchar *tones; GSimpleAsyncResult *result; GCancellable *cancellable; guint cancel_id; }; static void maybe_send_tones (TpCallContent *self); static void send_tones_cancelled_cb (GCancellable *cancellable, SendTonesData *data); static SendTonesData * send_tones_data_new (TpCallContent *self, const gchar *tones, GSimpleAsyncResult *result, GCancellable *cancellable) { SendTonesData *data; data = g_slice_new0 (SendTonesData); data->content = g_object_ref (self); data->tones = g_strdup (tones); data->result = g_object_ref (result); if (cancellable != NULL) { data->cancellable = g_object_ref (cancellable); data->cancel_id = g_cancellable_connect (cancellable, G_CALLBACK (send_tones_cancelled_cb), data, NULL); } return data; } static void send_tones_data_free (SendTonesData *data) { g_free (data->tones); g_object_unref (data->result); g_object_unref (data->content); if (data->cancellable != NULL) { if (data->cancel_id != 0) g_cancellable_disconnect (data->cancellable, data->cancel_id); g_object_unref (data->cancellable); } g_slice_free (SendTonesData, data); } static gboolean send_tones_cancelled_idle_cb (gpointer user_data) { SendTonesData *data = user_data; TpCallContent *self = data->content; /* If it is the tone currently being played, stop it. Otherwise wait for its * turn in the queue to preserve order. */ if (self->priv->current_tones == data) { tp_cli_call_content_interface_dtmf_call_stop_tone (self, -1, NULL, NULL, NULL, NULL); } return FALSE; } static void send_tones_cancelled_cb (GCancellable *cancellable, SendTonesData *data) { /* Cancel in idle for thread-safeness */ g_idle_add (send_tones_cancelled_idle_cb, data); } static void complete_sending_tones (TpCallContent *self, const GError *error) { if (self->priv->current_tones == NULL) return; if (error != NULL) { g_simple_async_result_set_from_error (self->priv->current_tones->result, error); } g_simple_async_result_complete (self->priv->current_tones->result); send_tones_data_free (self->priv->current_tones); self->priv->current_tones = NULL; maybe_send_tones (self); } static void tones_stopped_cb (TpCallContent *self, gboolean cancelled, gpointer user_data, GObject *weak_object) { if (cancelled) { GError e = { TP_ERROR, TP_ERROR_CANCELLED, "The DTMF tones were actively cancelled via StopTones" }; complete_sending_tones (self, &e); return; } complete_sending_tones (self, NULL); } static void multiple_tones_cb (TpCallContent *self, const GError *error, gpointer user_data, GObject *weak_object) { if (error != NULL) complete_sending_tones (self, error); } static void maybe_send_tones (TpCallContent *self) { if (self->priv->current_tones != NULL) return; if (g_queue_is_empty (self->priv->tones_queue)) return; self->priv->current_tones = g_queue_pop_head (self->priv->tones_queue); /* Yes this is safe if cancellable is NULL! */ if (g_cancellable_is_cancelled (self->priv->current_tones->cancellable)) { GError e = { TP_ERROR, TP_ERROR_CANCELLED, "The DTMF tones were cancelled before it has started" }; complete_sending_tones (self, &e); return; } DEBUG ("Emitting multiple tones: %s", self->priv->current_tones->tones); tp_cli_call_content_interface_dtmf_call_multiple_tones (self, -1, self->priv->current_tones->tones, multiple_tones_cb, NULL, NULL, NULL); } static void tp_call_content_constructed (GObject *obj) { TpCallContent *self = (TpCallContent *) obj; ((GObjectClass *) tp_call_content_parent_class)->constructed (obj); /* Connect signals for mutable properties */ tp_cli_call_content_connect_to_streams_added (self, streams_added_cb, NULL, NULL, G_OBJECT (self), NULL); tp_cli_call_content_connect_to_streams_removed (self, streams_removed_cb, NULL, NULL, G_OBJECT (self), NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CALL_CONTENT, got_all_properties_cb, NULL, NULL, G_OBJECT (self)); } static void tp_call_content_dispose (GObject *object) { TpCallContent *self = (TpCallContent *) object; g_clear_object (&self->priv->connection); tp_clear_pointer (&self->priv->name, g_free); tp_clear_pointer (&self->priv->streams, g_ptr_array_unref); G_OBJECT_CLASS (tp_call_content_parent_class)->dispose (object); } static void tp_call_content_finalize (GObject *object) { TpCallContent *self = (TpCallContent *) object; /* Results hold a ref on self, finalize can't happen if queue isn't empty */ g_assert (self->priv->current_tones == NULL); g_assert (g_queue_is_empty (self->priv->tones_queue)); g_queue_free (self->priv->tones_queue); G_OBJECT_CLASS (tp_call_content_parent_class)->finalize (object); } static void tp_call_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCallContent *self = (TpCallContent *) object; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; case PROP_NAME: g_value_set_string (value, self->priv->name); break; case PROP_MEDIA_TYPE: g_value_set_uint (value, self->priv->media_type); break; case PROP_DISPOSITION: g_value_set_uint (value, self->priv->disposition); break; case PROP_STREAMS: g_value_set_boxed (value, self->priv->streams); break; case PROP_CHANNEL: g_value_set_object (value, self->priv->channel); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_content_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpCallContent *self = (TpCallContent *) object; switch (property_id) { case PROP_CONNECTION: g_assert (self->priv->connection == NULL); /* construct-only */ self->priv->connection = g_value_dup_object (value); break; case PROP_CHANNEL: g_assert (self->priv->channel == NULL); /* construct-only */ self->priv->channel = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_call_content_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; /* started from constructed */ features[FEAT_CORE].name = TP_CALL_CONTENT_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_call_content_class_init (TpCallContentClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); TpProxyClass *proxy_class = (TpProxyClass *) klass; GParamSpec *param_spec; gobject_class->constructed = tp_call_content_constructed; gobject_class->get_property = tp_call_content_get_property; gobject_class->set_property = tp_call_content_set_property; gobject_class->dispose = tp_call_content_dispose; gobject_class->finalize = tp_call_content_finalize; proxy_class->list_features = tp_call_content_list_features; proxy_class->interface = TP_IFACE_QUARK_CALL_CONTENT; g_type_class_add_private (gobject_class, sizeof (TpCallContentPrivate)); tp_call_content_init_known_interfaces (); /** * TpCallContent:connection: * * The #TpConnection of the call. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("connection", "Connection", "The connection of this content", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CONNECTION, param_spec); /** * TpCallContent:name: * * The name of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("name", "Name", "The name of this content, if any", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_NAME, param_spec); /** * TpCallContent:media-type: * * The media type of this content, from #TpMediaStreamType. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("media-type", "Media type", "The media type of this content", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_MEDIA_TYPE, param_spec); /** * TpCallContent:disposition: * * The disposition of this content, from #TpCallContentDisposition. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("disposition", "Disposition", "The disposition of this content", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_DISPOSITION, param_spec); /* FIXME: Should be annoted with * * Type: GLib.PtrArray * Transfer: container * * But it does not work (bgo#663846) and makes gtkdoc fail myserably. */ /** * TpCallContent:streams: * * #GPtrArray of #TpCallStream objects. The list of stream objects that are * part of this content. * * It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on * those objects. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("streams", "Stream", "The streams of this content", G_TYPE_PTR_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_STREAMS, param_spec); /** * TpCallContent:channel: * * The parent #TpCallChannel of the content. * * Since: 0.17.6 */ param_spec = g_param_spec_object ("channel", "Channel", "The channel of this content", TP_TYPE_CALL_CHANNEL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CHANNEL, param_spec); /** * TpCallContent::removed: * @self: the #TpCallContent * * The ::removed signal is emitted when @self is removed from * a #TpCallChannel. * * Since: 0.17.5 */ _signals[REMOVED] = g_signal_new ("removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpCallContent::streams-added: * @self: the #TpCallContent * @streams: (type GLib.PtrArray) (element-type TelepathyGLib.CallStream): * a #GPtrArray of newly added #TpCallStream * * The ::streams-added signal is emitted whenever * #TpCallStream are added to @self. * * It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on * stream objects. * * Since: 0.17.5 */ _signals[STREAMS_ADDED] = g_signal_new ("streams-added", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_PTR_ARRAY); /** * TpCallContent::streams-removed: * @self: the #TpCallContent * @streams: (type GLib.PtrArray) (element-type TelepathyGLib.CallStream): * a #GPtrArray of newly removed #TpCallStream * @reason: a #TpCallStateReason * * The ::streams-removed signal is emitted whenever * #TpCallStreams are removed from @self. * * It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on * stream objects. * * Since: 0.17.5 */ _signals[STREAMS_REMOVED] = g_signal_new ("streams-removed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_PTR_ARRAY, TP_TYPE_CALL_STATE_REASON); } static void tp_call_content_init (TpCallContent *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_CALL_CONTENT, TpCallContentPrivate); self->priv->streams = g_ptr_array_new_with_free_func (g_object_unref); self->priv->tones_queue = g_queue_new (); } /** * tp_call_content_init_known_interfaces: * * Ensure that the known interfaces for #TpCallContent have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CALL_CONTENT. * * Since: 0.17.5 */ void tp_call_content_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CALL_CONTENT; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_call_content_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * TP_CALL_CONTENT_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" * feature on a #TpCallContent. * * One can ask for a feature to be prepared using the tp_proxy_prepare_async() * function, and waiting for it to trigger the callback. */ GQuark tp_call_content_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-call-content-feature-core"); } /** * tp_call_content_get_name: * @self: a #TpCallContent * * * * Returns: the value of #TpCallContent:name * Since: 0.17.5 */ const gchar * tp_call_content_get_name (TpCallContent *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT (self), NULL); return self->priv->name; } /** * tp_call_content_get_media_type: * @self: a #TpCallContent * * * * Returns: the value of #TpCallContent:name * Since: 0.17.5 */ TpMediaStreamType tp_call_content_get_media_type (TpCallContent *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT (self), 0); return self->priv->media_type; } /** * tp_call_content_get_disposition: * @self: a #TpCallContent * * * * Returns: the value of #TpCallContent:disposition * Since: 0.17.5 */ TpCallContentDisposition tp_call_content_get_disposition (TpCallContent *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT (self), 0); return self->priv->disposition; } /** * tp_call_content_get_streams: * @self: a #TpCallContent * * * * Returns: (transfer none) (type GLib.PtrArray) (element-type TelepathyGLib.CallStream): * the value of #TpCallContent:streams * Since: 0.17.5 */ GPtrArray * tp_call_content_get_streams (TpCallContent *self) { g_return_val_if_fail (TP_IS_CALL_CONTENT (self), NULL); return self->priv->streams; } static void generic_async_cb (TpCallContent *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Error: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete (result); } /** * tp_call_content_remove_async: * @self: a #TpCallContent * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Remove the content from the call. This will cause #TpCallContent::removed * to be emitted. * * Since: 0.17.5 */ void tp_call_content_remove_async (TpCallContent *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_CONTENT (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_content_remove_async); tp_cli_call_content_call_remove (self, -1, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_content_remove_finish: * @self: a #TpCallContent * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_content_remove_async(). * * Since: 0.17.5 */ gboolean tp_call_content_remove_finish (TpCallContent *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_content_remove_async); } /** * tp_call_content_send_tones_async: * @self: a #TpCallContent * @tones: a string representation of one or more DTMF events. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Send @tones DTMF code on @self content. @self must have the * %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. * * If DTMF tones are already being played, this request is queued. * * Since: 0.17.5 */ void tp_call_content_send_tones_async (TpCallContent *self, const gchar *tones, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; SendTonesData *data; g_return_if_fail (TP_IS_CALL_CONTENT (self)); if (!tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_DTMF)) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_NOT_CAPABLE, "Content does not support DTMF"); return; } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_content_send_tones_async); data = send_tones_data_new (self, tones, result, cancellable); g_queue_push_tail (self->priv->tones_queue, data); maybe_send_tones (self); g_object_unref (result); } /** * tp_call_content_send_tones_finish: * @self: a #TpCallContent * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_content_send_tones_async(). * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.17.5 */ gboolean tp_call_content_send_tones_finish (TpCallContent *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_content_send_tones_async); } telepathy-glib-0.24.2/telepathy-glib/call-content.h0000644000175000017500000000676612652510705017122 00000000000000/* * call-content.h - high level API for Call contents * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_CONTENT_H__ #define __TP_CALL_CONTENT_H__ #include #include #include G_BEGIN_DECLS #define TP_TYPE_CALL_CONTENT (tp_call_content_get_type ()) #define TP_CALL_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CALL_CONTENT, TpCallContent)) #define TP_CALL_CONTENT_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_CALL_CONTENT, TpCallContentClass)) #define TP_IS_CALL_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CALL_CONTENT)) #define TP_IS_CALL_CONTENT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_CALL_CONTENT)) #define TP_CALL_CONTENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CALL_CONTENT, TpCallContentClass)) /* TpCallContent is forward-declared in call-channel.h */ typedef struct _TpCallContentClass TpCallContentClass; typedef struct _TpCallContentPrivate TpCallContentPrivate; struct _TpCallContent { /**/ TpProxy parent; TpCallContentPrivate *priv; }; struct _TpCallContentClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; }; _TP_AVAILABLE_IN_0_18 GType tp_call_content_get_type (void); _TP_AVAILABLE_IN_0_18 void tp_call_content_init_known_interfaces (void); #define TP_CALL_CONTENT_FEATURE_CORE \ tp_call_content_get_feature_quark_core () _TP_AVAILABLE_IN_0_18 GQuark tp_call_content_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 const gchar *tp_call_content_get_name (TpCallContent *self); _TP_AVAILABLE_IN_0_18 TpMediaStreamType tp_call_content_get_media_type (TpCallContent *self); _TP_AVAILABLE_IN_0_18 TpCallContentDisposition tp_call_content_get_disposition (TpCallContent *self); _TP_AVAILABLE_IN_0_18 GPtrArray *tp_call_content_get_streams (TpCallContent *self); _TP_AVAILABLE_IN_0_18 void tp_call_content_remove_async (TpCallContent *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_content_remove_finish (TpCallContent *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_content_send_tones_async (TpCallContent *self, const gchar *tones, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_content_send_tones_finish (TpCallContent *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/base-media-call-stream.c0000644000175000017500000013125612652510705020714 00000000000000/* * base-media-call-stream.c - Source for TpBaseMediaCallStream * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * @author Jonny Lamb * @author David Laban * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-media-call-stream * @title: TpBaseMediaCallStream * @short_description: base class for #TpSvcCallStreamInterfaceMedia * implementations * @see_also: #TpSvcCallStreamInterfaceMedia, #TpBaseCallChannel, * #TpBaseCallStream and #TpBaseCallContent * * This base class makes it easier to write #TpSvcCallStreamInterfaceMedia * implementations by implementing some of its properties and methods. * * Subclasses must still implement #TpBaseCallStream's virtual methods plus * #TpBaseMediaCallStreamClass.add_local_candidates and * #TpBaseMediaCallStreamClass.finish_initial_candidates. * * Since: 0.17.5 */ /** * TpBaseMediaCallStream: * * A base class for media call stream implementations * * Since: 0.17.5 */ /** * TpBaseMediaCallStreamClass: * @report_sending_failure: optional; called to indicate a failure in the * outgoing portion of the stream * @report_receiving_failure: optional; called to indicate a failure in the * incoming portion of the stream * @add_local_candidates: mandatory; called when new candidates are added * @finish_initial_candidates: optional; called when the initial batch of * candidates has been added, and should now be processed/sent to the remote * side * @request_receiving: optional (see #TpBaseCallStream:can-request-receiving); * virtual method called when user requested receiving from the given remote * contact. This virtual method should be implemented instead of * #TpBaseCallStreamClass.request_receiving * @set_sending: mandatory; virtual method called when user requested to * start/stop sending to remote contacts. This virtual method should be * implemented instead of #TpBaseCallStreamClass.set_sending * * The class structure for #TpBaseMediaCallStream * * Since: 0.17.5 */ /** * TpBaseMediaCallStreamFinishInitialCandidatesFunc: * @self: a #TpBaseMediaCallStream * @error: a #GError to fill * * Signature of an implementation of * #TpBaseMediaCallStreamClass.finish_initial_candidates. * * Since: 0.17.5 */ /** * TpBaseMediaCallStreamAddCandidatesFunc: * @self: a #TpBaseMediaCallStream * @candidates: a #GPtrArray of #GValueArray containing candidates info * @error: a #GError to fill * * Signature of an implementation of * #TpBaseMediaCallStreamClass.add_local_candidates. * * Implementation should validate the added @candidates and return a subset * (or all) of them that are accepted. Implementation should return a new * #GPtrArray build in a way that g_ptr_array_unref() is enough to free all its * memory. It is fine to just add element pointers from @candidates to the * returned #GPtrArray without deep-copy them. * * Since: 0.17.5 */ /** * TpBaseMediaCallStreamReportFailureFunc: * @self: a #TpBaseMediaCallStream * @old_state: the previous #TpStreamFlowState * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Signature of an implementation of * #TpBaseMediaCallStreamClass.report_sending_failure and * #TpBaseMediaCallStreamClass.report_receiving_failure. * * Since: 0.17.5 */ /** * TpBaseMediaCallStreamSetSendingFunc: * @self: a #TpBaseMediaCallStream * @sending: whether or not user would like to be sending * @error: a #GError to fill * * Signature of an implementation of #TpBaseMediaCallStreamClass.set_sending. * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.17.5 */ /** * TpBaseMediaCallStreamRequestReceivingFunc: * @self: a #TpBaseMediaCallStream * @contact: the contact from who user wants to start or stop receiving * @receive: wheter or not user would like to be receiving * * Signature of an implementation of * #TpBaseMediaCallStreamClass.request_receiving. * * Since: 0.17.5 */ #include "config.h" #include "base-media-call-stream.h" #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-content.h" #include "telepathy-glib/base-call-channel.h" #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-channel.h" #include "telepathy-glib/base-connection.h" #include "telepathy-glib/base-media-call-channel.h" #include "telepathy-glib/call-stream-endpoint.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/enums.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/util.h" #include "telepathy-glib/util-internal.h" static void call_stream_media_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseMediaCallStream, tp_base_media_call_stream, TP_TYPE_BASE_CALL_STREAM, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_STREAM_INTERFACE_MEDIA, call_stream_media_iface_init) ) /* properties */ enum { PROP_SENDING_STATE = 1, PROP_RECEIVING_STATE, PROP_TRANSPORT, PROP_LOCAL_CANDIDATES, PROP_LOCAL_CREDENTIALS, PROP_STUN_SERVERS, PROP_RELAY_INFO, PROP_HAS_SERVER_INFO, PROP_ENDPOINTS, PROP_ICE_RESTART_PENDING }; /* private structure */ struct _TpBaseMediaCallStreamPrivate { TpStreamFlowState sending_state; TpStreamFlowState receiving_state; TpStreamTransportType transport; /* GPtrArray of owned GValueArray (dbus struct) */ GPtrArray *local_candidates; gchar *username; gchar *password; /* GPtrArray of owned GValueArray (dbus struct) */ GPtrArray *stun_servers; /* GPtrArray of reffed GHashTable (asv) */ GPtrArray *relay_info; gboolean has_server_info; /* GList of reffed TpCallStreamEndpoint */ GList *endpoints; gboolean ice_restart_pending; /* Intset of TpHandle that have requested to receive */ TpIntset *receiving_requests; gboolean local_sending; gboolean remotely_held; gboolean sending_stop_requested; gboolean sending_failure; gboolean receiving_failure; }; static GPtrArray *tp_base_media_call_stream_get_interfaces ( TpBaseCallStream *bcs); static gboolean tp_base_media_call_stream_request_receiving ( TpBaseCallStream *bcs, TpHandle contact, gboolean receive, GError **error); static gboolean tp_base_media_call_stream_set_sending (TpBaseCallStream *self, gboolean sending, GError **error); static void tp_base_media_call_stream_init (TpBaseMediaCallStream *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_MEDIA_CALL_STREAM, TpBaseMediaCallStreamPrivate); self->priv->local_candidates = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); self->priv->username = g_strdup (""); self->priv->password = g_strdup (""); self->priv->receiving_requests = tp_intset_new (); self->priv->sending_state = TP_STREAM_FLOW_STATE_STOPPED; self->priv->receiving_state = TP_STREAM_FLOW_STATE_STOPPED; g_signal_connect (self, "notify::remote-members", G_CALLBACK (tp_base_media_call_stream_update_receiving_state), NULL); g_signal_connect (self, "notify::channel", G_CALLBACK (tp_base_media_call_stream_update_receiving_state), NULL); g_signal_connect (self, "notify::channel", G_CALLBACK (tp_base_media_call_stream_update_sending_state), NULL); } static void tp_base_media_call_stream_dispose (GObject *object) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (object); tp_clear_pointer (&self->priv->endpoints, _tp_object_list_free); if (G_OBJECT_CLASS (tp_base_media_call_stream_parent_class)->dispose) G_OBJECT_CLASS (tp_base_media_call_stream_parent_class)->dispose (object); } static void tp_base_media_call_stream_finalize (GObject *object) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (object); tp_clear_pointer (&self->priv->local_candidates, g_ptr_array_unref); tp_clear_pointer (&self->priv->stun_servers, g_ptr_array_unref); tp_clear_pointer (&self->priv->relay_info, g_ptr_array_unref); tp_clear_pointer (&self->priv->username, g_free); tp_clear_pointer (&self->priv->password, g_free); tp_clear_pointer (&self->priv->receiving_requests, tp_intset_destroy); G_OBJECT_CLASS (tp_base_media_call_stream_parent_class)->finalize (object); } static void tp_base_media_call_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (object); switch (property_id) { case PROP_SENDING_STATE: g_value_set_uint (value, self->priv->sending_state); break; case PROP_RECEIVING_STATE: g_value_set_uint (value, self->priv->receiving_state); break; case PROP_TRANSPORT: g_value_set_uint (value, self->priv->transport); break; case PROP_LOCAL_CANDIDATES: g_value_set_boxed (value, self->priv->local_candidates); break; case PROP_LOCAL_CREDENTIALS: { g_value_take_boxed (value, tp_value_array_build (2, G_TYPE_STRING, self->priv->username, G_TYPE_STRING, self->priv->password, G_TYPE_INVALID)); break; } case PROP_STUN_SERVERS: { if (self->priv->stun_servers != NULL) g_value_set_boxed (value, self->priv->stun_servers); else g_value_take_boxed (value, g_ptr_array_new ()); break; } case PROP_RELAY_INFO: { if (self->priv->relay_info != NULL) g_value_set_boxed (value, self->priv->relay_info); else g_value_take_boxed (value, g_ptr_array_new ()); break; } case PROP_HAS_SERVER_INFO: g_value_set_boolean (value, self->priv->has_server_info); break; case PROP_ENDPOINTS: { GPtrArray *arr = g_ptr_array_sized_new (1); GList *l; for (l = self->priv->endpoints; l != NULL; l = g_list_next (l)) { TpCallStreamEndpoint *e = l->data; g_ptr_array_add (arr, g_strdup (tp_call_stream_endpoint_get_object_path (e))); } g_value_take_boxed (value, arr); break; } case PROP_ICE_RESTART_PENDING: g_value_set_boolean (value, self->priv->ice_restart_pending); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_media_call_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (object); switch (property_id) { case PROP_TRANSPORT: self->priv->transport = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_media_call_stream_class_init (TpBaseMediaCallStreamClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; TpBaseCallStreamClass *bcs_class = TP_BASE_CALL_STREAM_CLASS (klass); static TpDBusPropertiesMixinPropImpl stream_media_props[] = { { "SendingState", "sending-state", NULL }, { "ReceivingState", "receiving-state", NULL }, { "Transport", "transport", NULL }, { "LocalCandidates", "local-candidates", NULL }, { "LocalCredentials", "local-credentials", NULL }, { "STUNServers", "stun-servers", NULL }, { "RelayInfo", "relay-info", NULL }, { "HasServerInfo", "has-server-info", NULL }, { "Endpoints", "endpoints", NULL }, { "ICERestartPending", "ice-restart-pending", NULL }, { NULL } }; g_type_class_add_private (klass, sizeof (TpBaseMediaCallStreamPrivate)); object_class->set_property = tp_base_media_call_stream_set_property; object_class->get_property = tp_base_media_call_stream_get_property; object_class->dispose = tp_base_media_call_stream_dispose; object_class->finalize = tp_base_media_call_stream_finalize; bcs_class->get_interfaces = tp_base_media_call_stream_get_interfaces; bcs_class->request_receiving = tp_base_media_call_stream_request_receiving; bcs_class->set_sending = tp_base_media_call_stream_set_sending; /** * TpBaseMediaCallStream:sending-state: * * The sending #TpStreamFlowState. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("sending-state", "SendingState", "The sending state", 0, G_MAXUINT, TP_STREAM_FLOW_STATE_STOPPED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SENDING_STATE, param_spec); /** * TpBaseMediaCallStream:receiving-state: * * The receiving #TpStreamFlowState. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("receiving-state", "ReceivingState", "The receiving state", 0, G_MAXUINT, TP_STREAM_FLOW_STATE_STOPPED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_RECEIVING_STATE, param_spec); /** * TpBaseMediaCallStream:transport: * * The #TpStreamTransportType of this stream. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("transport", "Transport", "The transport type of this stream", 0, G_MAXUINT, TP_STREAM_TRANSPORT_TYPE_UNKNOWN, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TRANSPORT, param_spec); /** * TpBaseMediaCallStream:local-candidates: * * #GPtrArray{candidate #GValueArray} * List of local candidates. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("local-candidates", "LocalCandidates", "List of local candidates", TP_ARRAY_TYPE_CANDIDATE_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_CANDIDATES, param_spec); /** * TpBaseMediaCallStream:local-credentials: * * #GValueArray{username string, password string} * ufrag and pwd as defined by ICE. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("local-credentials", "LocalCredentials", "ufrag and pwd as defined by ICE", TP_STRUCT_TYPE_STREAM_CREDENTIALS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_CREDENTIALS, param_spec); /** * TpBaseMediaCallStream:stun-servers: * * #GPtrArray{stun-server #GValueArray} * List of STUN servers. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("stun-servers", "STUNServers", "List of STUN servers", TP_ARRAY_TYPE_SOCKET_ADDRESS_IP_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STUN_SERVERS, param_spec); /** * TpBaseMediaCallStream:relay-info: * * #GPtrArray{relay-info asv} * List of relay information. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("relay-info", "RelayInfo", "List of relay information", TP_ARRAY_TYPE_STRING_VARIANT_MAP_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_RELAY_INFO, param_spec); /** * TpBaseMediaCallStream:has-server-info: * * %TRUE if #TpBaseMediaCallStream:relay-info and * #TpBaseMediaCallStream:stun-servers have been set. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("has-server-info", "HasServerInfo", "True if the server information about STUN and " "relay servers has been retrieved", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HAS_SERVER_INFO, param_spec); /** * TpBaseMediaCallStream:endpoints: * * #GPtrArray{object-path string} * The endpoints of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("endpoints", "Endpoints", "The endpoints of this content", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ENDPOINTS, param_spec); /** * TpBaseMediaCallStream:ice-restart-pending: * * %TRUE when ICERestartRequested signal is emitted, and %FALSE when * SetCredentials is called. Useful for debugging. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("ice-restart-pending", "ICERestartPending", "True when ICERestartRequested signal is emitted, and False when " "SetCredentials is called. Useful for debugging", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ICE_RESTART_PENDING, param_spec); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CALL_STREAM_INTERFACE_MEDIA, tp_dbus_properties_mixin_getter_gobject_properties, NULL, stream_media_props); } /** * tp_base_media_call_stream_get_username: * @self: a #TpBaseMediaCallStream * * * * Returns: the username part of #TpBaseMediaCallStream:local-credentials * Since: 0.17.5 */ const gchar * tp_base_media_call_stream_get_username (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), NULL); return self->priv->username; } /** * tp_base_media_call_stream_get_password: * @self: a #TpBaseMediaCallStream * * * * Returns: the password part of #TpBaseMediaCallStream:local-credentials * Since: 0.17.5 */ const gchar * tp_base_media_call_stream_get_password (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), NULL); return self->priv->password; } static void maybe_got_server_info (TpBaseMediaCallStream *self) { if (self->priv->has_server_info || self->priv->stun_servers == NULL || self->priv->relay_info == NULL) return; DEBUG ("Got server info for stream %s", tp_base_call_stream_get_object_path ((TpBaseCallStream *) self)); self->priv->has_server_info = TRUE; tp_svc_call_stream_interface_media_emit_server_info_retrieved (self); } /** * tp_base_media_call_stream_set_stun_servers: * @self: a #TpBaseMediaCallStream * @stun_servers: the new stun servers * * Set the STUN servers. The #GPtrArray should have a free_func defined such as * g_ptr_array_ref() is enough to keep the data and g_ptr_array_unref() is * enough to release it later. * * Note that this replaces the previously set STUN servers, it is not an * addition. * * Since: 0.17.5 */ void tp_base_media_call_stream_set_stun_servers (TpBaseMediaCallStream *self, GPtrArray *stun_servers) { g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); g_return_if_fail (stun_servers != NULL); if (self->priv->stun_servers != NULL) { if (stun_servers->len == self->priv->stun_servers->len) { guint i; gboolean equal = TRUE; for (i = 0; i < stun_servers->len; i++) { GValueArray *gva1 = g_ptr_array_index (stun_servers, i); GValueArray *gva2 = g_ptr_array_index (self->priv->stun_servers, i); gchar *ip1, *ip2; guint port1, port2; tp_value_array_unpack (gva1, 2, &ip1, &port1); tp_value_array_unpack (gva2, 2, &ip2, &port2); if (port1 != port2 || strcmp (ip1, ip2)) { equal = FALSE; break; } } if (equal) { g_ptr_array_unref (stun_servers); return; } } g_ptr_array_unref (self->priv->stun_servers); } self->priv->stun_servers = g_ptr_array_ref (stun_servers); tp_svc_call_stream_interface_media_emit_stun_servers_changed (self, self->priv->stun_servers); maybe_got_server_info (self); } /** * tp_base_media_call_stream_set_relay_info: * @self: a #TpBaseMediaCallStream * @relays: the new relays info * * Set the relays info. The #GPtrArray should have a free_func defined such as * g_ptr_array_ref() is enough to keep the data and g_ptr_array_unref() is * enough to release it later. * * Note that this replaces the previously set relays, it is not an addition. * * Since: 0.17.5 */ void tp_base_media_call_stream_set_relay_info (TpBaseMediaCallStream *self, GPtrArray *relays) { g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); g_return_if_fail (relays != NULL); tp_clear_pointer (&self->priv->relay_info, g_ptr_array_unref); self->priv->relay_info = g_ptr_array_ref (relays); tp_svc_call_stream_interface_media_emit_relay_info_changed (self, self->priv->relay_info); maybe_got_server_info (self); } /** * tp_base_media_call_stream_add_endpoint: * @self: a #TpBaseMediaCallStream * @endpoint: a #TpCallStreamEndpoint * * Add @endpoint to #TpBaseMediaCallStream:endpoints list, and emits * EndpointsChanged DBus signal. * * Since: 0.17.5 */ void tp_base_media_call_stream_add_endpoint (TpBaseMediaCallStream *self, TpCallStreamEndpoint *endpoint) { const gchar *object_path; GPtrArray *added; GPtrArray *removed; g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (endpoint)); _tp_call_stream_endpoint_set_stream (endpoint, self); object_path = tp_call_stream_endpoint_get_object_path (endpoint); DEBUG ("Add endpoint %s to stream %s", object_path, tp_base_call_stream_get_object_path ((TpBaseCallStream *) self)); self->priv->endpoints = g_list_append (self->priv->endpoints, g_object_ref (endpoint)); added = g_ptr_array_new (); removed = g_ptr_array_new (); g_ptr_array_add (added, (gpointer) object_path); tp_svc_call_stream_interface_media_emit_endpoints_changed (self, added, removed); g_ptr_array_unref (added); g_ptr_array_unref (removed); } /** * tp_base_media_call_stream_remove_endpoint: * @self: a #TpBaseMediaCallStream * @endpoint: a #TpCallStreamEndpoint * * Remove @endpoint from #TpBaseMediaCallStream:endpoints list, and emits * EndpointsChanged DBus signal. * * Since: 0.17.5 */ void tp_base_media_call_stream_remove_endpoint (TpBaseMediaCallStream *self, TpCallStreamEndpoint *endpoint) { const gchar *object_path; GPtrArray *added; GPtrArray *removed; g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (endpoint)); g_return_if_fail (g_list_find (self->priv->endpoints, endpoint) != NULL); object_path = tp_call_stream_endpoint_get_object_path (endpoint); DEBUG ("Remove endpoint %s from stream %s", object_path, tp_base_call_stream_get_object_path ((TpBaseCallStream *) self)); self->priv->endpoints = g_list_remove (self->priv->endpoints, endpoint); added = g_ptr_array_new (); removed = g_ptr_array_new (); g_ptr_array_add (removed, (gpointer) object_path); tp_svc_call_stream_interface_media_emit_endpoints_changed (self, added, removed); g_ptr_array_unref (added); g_ptr_array_unref (removed); g_object_unref (endpoint); } /** * tp_base_media_call_stream_get_endpoints: * @self: a #TpBaseMediaCallStream * * Same as #TpBaseMediaCallStream:endpoints but as a #GList of * #TpCallStreamEndpoint. * * Returns: Borrowed #GList of #TpCallStreamEndpoint. * Since: 0.17.5 */ GList * tp_base_media_call_stream_get_endpoints (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), NULL); return self->priv->endpoints; } static const char * stream_flow_state_to_string (TpStreamFlowState state) { const char *str = "INVALID"; switch (state) { case TP_STREAM_FLOW_STATE_STOPPED: str = "STOPPED"; break; case TP_STREAM_FLOW_STATE_PENDING_START: str = "PENDING_START"; break; case TP_STREAM_FLOW_STATE_PENDING_STOP: str = "PENDING_STOP"; break; case TP_STREAM_FLOW_STATE_STARTED: str = "STARTED"; break; } return str; } static gboolean ignore_state_change (TpStreamFlowState old_state, TpStreamFlowState new_state) { if ((old_state == new_state) || (new_state == TP_STREAM_FLOW_STATE_PENDING_START && old_state == TP_STREAM_FLOW_STATE_STARTED) || (new_state == TP_STREAM_FLOW_STATE_PENDING_STOP && old_state == TP_STREAM_FLOW_STATE_STOPPED)) return TRUE; return FALSE; } static void set_sending_state (TpBaseMediaCallStream *self, TpStreamFlowState state) { if (ignore_state_change (self->priv->sending_state, state)) return; DEBUG ("%s => %s (path: %s)", stream_flow_state_to_string (self->priv->sending_state), stream_flow_state_to_string (state), tp_base_call_stream_get_object_path (TP_BASE_CALL_STREAM (self))); self->priv->sending_state = state; g_object_notify (G_OBJECT (self), "sending-state"); tp_svc_call_stream_interface_media_emit_sending_state_changed (self, state); } /** * tp_base_media_call_stream_update_sending_state: * @self: a #TpBaseMediaCallStream * * Update the sending state. * * Since: 0.17.5 */ void tp_base_media_call_stream_update_sending_state (TpBaseMediaCallStream *self) { TpBaseCallChannel *channel = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self)); gboolean sending = FALSE; if (channel == NULL) goto done; if (TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) { TpBaseMediaCallChannel *mediachan = TP_BASE_MEDIA_CALL_CHANNEL (channel); if (_tp_base_media_channel_is_held (mediachan)) goto done; } if (!tp_base_call_channel_is_accepted (TP_BASE_CALL_CHANNEL (channel))) goto done; if (self->priv->remotely_held) goto done; if (self->priv->sending_failure) goto done; sending = self->priv->local_sending; done: if (sending) set_sending_state (self, TP_STREAM_FLOW_STATE_PENDING_START); else set_sending_state (self, TP_STREAM_FLOW_STATE_PENDING_STOP); } /** * tp_base_media_call_stream_get_sending_state: * @self: a #TpBaseMediaCallStream * * * * Returns: the value of #TpBaseMediaCallStream:sending-state. * Since: 0.17.5 */ TpStreamFlowState tp_base_media_call_stream_get_sending_state (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), TP_STREAM_FLOW_STATE_STOPPED); return self->priv->sending_state; } /** * tp_base_media_call_stream_set_local_sending: * @self: a #TpBaseMediaCallStream * @sending: whether or not we are sending * * Set local sending state. * * Since: 0.17.5 */ void tp_base_media_call_stream_set_local_sending (TpBaseMediaCallStream *self, gboolean sending) { g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); if (sending == self->priv->local_sending) return; self->priv->local_sending = sending; tp_base_media_call_stream_update_sending_state (self); } /** * tp_base_media_call_stream_get_local_sending: * @self: a #TpBaseMediaCallStream * * Gets the local sending state * * Returns: The local sending state * Since: 0.17.7 */ gboolean tp_base_media_call_stream_get_local_sending (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), FALSE); return self->priv->local_sending; } void _tp_base_media_call_stream_set_remotely_held (TpBaseMediaCallStream *self, gboolean remotely_held) { g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self)); if (remotely_held == self->priv->remotely_held) return; self->priv->remotely_held = remotely_held; tp_base_media_call_stream_update_sending_state (self); } static void set_receiving_state (TpBaseMediaCallStream *self, TpStreamFlowState state) { if (ignore_state_change (self->priv->receiving_state, state)) return; DEBUG ("%s => %s (path: %s)", stream_flow_state_to_string (self->priv->receiving_state), stream_flow_state_to_string (state), tp_base_call_stream_get_object_path (TP_BASE_CALL_STREAM (self))); self->priv->receiving_state = state; g_object_notify (G_OBJECT (self), "receiving-state"); tp_svc_call_stream_interface_media_emit_receiving_state_changed (self, state); } /** * tp_base_media_call_stream_update_receiving_state: * @self: a #TpBaseMediaCallStream * * Update the receiving state. * * Since: 0.17.5 */ void tp_base_media_call_stream_update_receiving_state (TpBaseMediaCallStream *self) { TpBaseCallStream *bcs = TP_BASE_CALL_STREAM (self); GHashTable *remote_members = _tp_base_call_stream_get_remote_members (bcs); GHashTableIter iter; gpointer key, value; gboolean remote_sending = FALSE; TpBaseCallChannel *channel = _tp_base_call_stream_get_channel (bcs); if (channel == NULL || !_tp_base_call_channel_is_locally_accepted (channel)) goto done; if (self->priv->receiving_failure) goto done; if (TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) { TpBaseMediaCallChannel *mediachan = TP_BASE_MEDIA_CALL_CHANNEL (channel); if (_tp_base_media_channel_is_held (mediachan)) goto done; } g_hash_table_iter_init (&iter, remote_members); while (g_hash_table_iter_next (&iter, &key, &value)) { TpSendingState state = GPOINTER_TO_UINT (value); switch (state) { case TP_SENDING_STATE_SENDING: case TP_SENDING_STATE_PENDING_SEND: remote_sending = TRUE; break; case TP_SENDING_STATE_PENDING_STOP_SENDING: case TP_SENDING_STATE_NONE: break; default: g_assert_not_reached (); } if (remote_sending) break; } done: if (remote_sending) set_receiving_state (self, TP_STREAM_FLOW_STATE_PENDING_START); else set_receiving_state (self, TP_STREAM_FLOW_STATE_PENDING_STOP); } /** * tp_base_media_call_stream_get_receiving_state: * @self: a #TpBaseMediaCallStream * * * * Returns: the value of #TpBaseMediaCallStream:receiving-state. * Since: 0.17.5 */ TpStreamFlowState tp_base_media_call_stream_get_receiving_state (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), TP_STREAM_FLOW_STATE_STOPPED); return self->priv->receiving_state; } /** * tp_base_media_call_stream_get_local_candidates: * @self: a #TpBaseMediaCallStream * * * * Returns: the value of #TpBaseMediaCallStream:local-candidates as a #GtrArray * Since: 0.17.5 */ GPtrArray * tp_base_media_call_stream_get_local_candidates (TpBaseMediaCallStream *self) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (self), NULL); return self->priv->local_candidates; } /* TpBaseCallStreamClass virtual methods implementation */ static gboolean tp_base_media_call_stream_set_sending (TpBaseCallStream *bcs, gboolean sending, GError **error) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (bcs); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); if (sending) { if (klass->set_sending != NULL && !klass->set_sending (self, sending, error)) return FALSE; } else { tp_base_media_call_stream_set_local_sending (self, FALSE); /* Already stopped, lets call the callback directly */ if (self->priv->sending_state == TP_STREAM_FLOW_STATE_STOPPED && klass->set_sending != NULL) return klass->set_sending (self, sending, error); else self->priv->sending_stop_requested = TRUE; } return TRUE; } static GPtrArray * tp_base_media_call_stream_get_interfaces (TpBaseCallStream *bcs) { GPtrArray *interfaces; interfaces = TP_BASE_CALL_STREAM_CLASS ( tp_base_media_call_stream_parent_class)->get_interfaces (bcs); g_ptr_array_add (interfaces, TP_IFACE_CALL_STREAM_INTERFACE_MEDIA); return interfaces; } static gboolean tp_base_media_call_stream_request_receiving (TpBaseCallStream *bcs, TpHandle contact, gboolean receive, GError **error) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (bcs); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); TpBaseCallChannel *channel = _tp_base_call_stream_get_channel (bcs); if (receive) { tp_base_call_stream_update_remote_sending_state (bcs, contact, TP_SENDING_STATE_PENDING_SEND, tp_base_channel_get_self_handle (TP_BASE_CHANNEL (channel)), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User asked the remote side to start sending"); if (self->priv->receiving_state == TP_STREAM_FLOW_STATE_STARTED) { if (klass->request_receiving != NULL) { klass->request_receiving (self, contact, TRUE); return TRUE; } } tp_intset_add (self->priv->receiving_requests, contact); tp_base_media_call_stream_update_receiving_state (self); } else { tp_base_call_stream_update_remote_sending_state (bcs, contact, TP_SENDING_STATE_PENDING_STOP_SENDING, tp_base_channel_get_self_handle (TP_BASE_CHANNEL (channel)), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User asked the remote side to stop sending"); tp_intset_remove (self->priv->receiving_requests, contact); if (klass->request_receiving != NULL) klass->request_receiving (self, contact, FALSE); } return TRUE; } /* DBus method implementation */ static gboolean correct_state_transition (TpStreamFlowState old_state, TpStreamFlowState new_state) { switch (new_state) { case TP_STREAM_FLOW_STATE_STARTED: return (old_state == TP_STREAM_FLOW_STATE_PENDING_START); case TP_STREAM_FLOW_STATE_STOPPED: return (old_state == TP_STREAM_FLOW_STATE_PENDING_STOP); default: return FALSE; } } static void tp_base_media_call_stream_complete_sending_state_change ( TpSvcCallStreamInterfaceMedia *iface, TpStreamFlowState state, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); TpBaseCallChannel *channel = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self)); if (!correct_state_transition (self->priv->sending_state, state)) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid sending state transition" }; dbus_g_method_return_error (context, &e); return; } self->priv->sending_state = state; if (channel != NULL && TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) _tp_base_media_call_channel_streams_sending_state_changed ( TP_BASE_MEDIA_CALL_CHANNEL (channel), TRUE); if (state == TP_STREAM_FLOW_STATE_STOPPED && klass->set_sending != NULL && self->priv->sending_stop_requested) klass->set_sending (self, FALSE, NULL); self->priv->sending_stop_requested = FALSE; tp_svc_call_stream_interface_media_emit_sending_state_changed (self, state); tp_svc_call_stream_interface_media_return_from_complete_sending_state_change (context); } static void tp_base_media_call_stream_report_sending_failure ( TpSvcCallStreamInterfaceMedia *iface, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); TpStreamFlowState old_state = self->priv->sending_state; TpBaseCallChannel *channel = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self)); gboolean was_held = FALSE; if (self->priv->sending_state == TP_STREAM_FLOW_STATE_STOPPED) goto done; self->priv->sending_failure = TRUE; self->priv->sending_stop_requested = FALSE; self->priv->sending_state = TP_STREAM_FLOW_STATE_STOPPED; if (channel != NULL && TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) { was_held = _tp_base_media_call_channel_streams_sending_state_changed ( TP_BASE_MEDIA_CALL_CHANNEL (channel), FALSE); } if (!was_held) { self->priv->local_sending = FALSE; if (klass->report_sending_failure != NULL) klass->report_sending_failure (self, old_state, reason, dbus_reason, message); } g_object_notify (G_OBJECT (self), "sending-state"); tp_svc_call_stream_interface_media_emit_sending_state_changed (self, self->priv->sending_state); self->priv->sending_failure = FALSE; done: tp_svc_call_stream_interface_media_return_from_report_sending_failure ( context); } static void tp_base_media_call_stream_complete_receiving_state_change ( TpSvcCallStreamInterfaceMedia *iface, TpStreamFlowState state, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); TpBaseCallChannel *channel = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self)); if (!correct_state_transition (self->priv->receiving_state, state)) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid receiving state transition" }; dbus_g_method_return_error (context, &e); return; } self->priv->receiving_state = state; g_object_notify (G_OBJECT (self), "receiving-state"); if (channel != NULL && TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) _tp_base_media_call_channel_streams_receiving_state_changed ( TP_BASE_MEDIA_CALL_CHANNEL (channel), TRUE); if (state == TP_STREAM_FLOW_STATE_STARTED) { TpIntsetFastIter iter; TpHandle contact; tp_intset_fast_iter_init (&iter, self->priv->receiving_requests); while (tp_intset_fast_iter_next (&iter, &contact)) { if (klass->request_receiving != NULL) klass->request_receiving (self, contact, TRUE); } tp_intset_clear (self->priv->receiving_requests); } tp_svc_call_stream_interface_media_emit_receiving_state_changed (self, state); tp_svc_call_stream_interface_media_return_from_complete_receiving_state_change (context); } static void tp_base_media_call_stream_report_receiving_failure ( TpSvcCallStreamInterfaceMedia *iface, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); TpStreamFlowState old_state = self->priv->receiving_state; TpBaseCallChannel *channel = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self)); gboolean was_held = FALSE; /* Clear all receving requests, we can't receive */ tp_intset_clear (self->priv->receiving_requests); if (self->priv->receiving_state == TP_STREAM_FLOW_STATE_STOPPED) goto done; self->priv->receiving_state = TP_STREAM_FLOW_STATE_STOPPED; self->priv->receiving_failure = TRUE; g_object_notify (G_OBJECT (self), "receiving-state"); if (channel != NULL && TP_IS_BASE_MEDIA_CALL_CHANNEL (channel)) was_held = _tp_base_media_call_channel_streams_receiving_state_changed ( TP_BASE_MEDIA_CALL_CHANNEL (channel), FALSE); if (klass->report_receiving_failure != NULL && !was_held) klass->report_receiving_failure (self, old_state, reason, dbus_reason, message); tp_svc_call_stream_interface_media_emit_receiving_state_changed (self, self->priv->receiving_state); self->priv->receiving_failure = FALSE; done: tp_svc_call_stream_interface_media_return_from_report_receiving_failure ( context); } static void tp_base_media_call_stream_set_credentials (TpSvcCallStreamInterfaceMedia *iface, const gchar *username, const gchar *password, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); g_free (self->priv->username); g_free (self->priv->password); self->priv->username = g_strdup (username); self->priv->password = g_strdup (password); tp_clear_pointer (&self->priv->local_candidates, g_ptr_array_unref); self->priv->local_candidates = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); g_object_notify (G_OBJECT (self), "local-candidates"); g_object_notify (G_OBJECT (self), "local-credentials"); tp_svc_call_stream_interface_media_emit_local_credentials_changed (self, username, password); tp_svc_call_stream_interface_media_return_from_set_credentials (context); } static void tp_base_media_call_stream_add_candidates (TpSvcCallStreamInterfaceMedia *iface, const GPtrArray *candidates, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); GPtrArray *accepted_candidates = NULL; guint i; GError *error = NULL; if (klass->add_local_candidates == NULL) { GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Connection Manager did not implement " "TpBaseMediaCallStream::add_local_candidates vmethod" }; dbus_g_method_return_error (context, &e); return; } DEBUG ("Adding %d candidates to stream %s", candidates->len, tp_base_call_stream_get_object_path ((TpBaseCallStream *) self)); accepted_candidates = klass->add_local_candidates (self, candidates, &error); if (accepted_candidates == NULL) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } for (i = 0; i < accepted_candidates->len; i++) { GValueArray *c = g_ptr_array_index (accepted_candidates, i); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_ptr_array_add (self->priv->local_candidates, g_value_array_copy (c)); G_GNUC_END_IGNORE_DEPRECATIONS } tp_svc_call_stream_interface_media_emit_local_candidates_added (self, accepted_candidates); tp_svc_call_stream_interface_media_return_from_add_candidates (context); g_ptr_array_unref (accepted_candidates); } static void tp_base_media_call_stream_finish_initial_candidates ( TpSvcCallStreamInterfaceMedia *iface, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseMediaCallStreamClass *klass = TP_BASE_MEDIA_CALL_STREAM_GET_CLASS (self); GError *error = NULL; if (klass->finish_initial_candidates != NULL) if (!klass->finish_initial_candidates (self, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } tp_svc_call_stream_interface_media_return_from_finish_initial_candidates ( context); } static void tp_base_media_call_stream_fail (TpSvcCallStreamInterfaceMedia *iface, const GValueArray *reason_array, DBusGMethodInvocation *context) { TpBaseMediaCallStream *self = TP_BASE_MEDIA_CALL_STREAM (iface); TpBaseCallStream *base = TP_BASE_CALL_STREAM (self); TpBaseCallChannel *channel; TpBaseCallContent *content; channel = _tp_base_call_stream_get_channel (base); content = _tp_base_call_stream_get_content (base); _tp_base_call_content_remove_stream_internal (content, base, reason_array); /* If it was the last stream, remove the content */ if (tp_base_call_content_get_streams (content) == NULL) { _tp_base_call_channel_remove_content_internal (channel, content, reason_array); } tp_svc_call_stream_interface_media_return_from_fail (context); } static void call_stream_media_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcCallStreamInterfaceMediaClass *klass = (TpSvcCallStreamInterfaceMediaClass *) g_iface; #define IMPLEMENT(x) tp_svc_call_stream_interface_media_implement_##x (\ klass, tp_base_media_call_stream_##x) IMPLEMENT(complete_sending_state_change); IMPLEMENT(report_sending_failure); IMPLEMENT(complete_receiving_state_change); IMPLEMENT(report_receiving_failure); IMPLEMENT(set_credentials); IMPLEMENT(add_candidates); IMPLEMENT(finish_initial_candidates); IMPLEMENT(fail); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/base-media-call-stream.h0000644000175000017500000001267512652510705020724 00000000000000/* * base-media-call-stream.h - Header for TpBaseMediaCallStream * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_MEDIA_CALL_STREAM_H__ #define __TP_BASE_MEDIA_CALL_STREAM_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpBaseMediaCallStream TpBaseMediaCallStream; typedef struct _TpBaseMediaCallStreamPrivate TpBaseMediaCallStreamPrivate; typedef struct _TpBaseMediaCallStreamClass TpBaseMediaCallStreamClass; typedef gboolean (*TpBaseMediaCallStreamFinishInitialCandidatesFunc) ( TpBaseMediaCallStream *self, GError **error); typedef GPtrArray *(*TpBaseMediaCallStreamAddCandidatesFunc) ( TpBaseMediaCallStream *self, const GPtrArray *candidates, GError **error); typedef void (*TpBaseMediaCallStreamReportFailureFunc) ( TpBaseMediaCallStream *self, TpStreamFlowState old_state, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); typedef void (*TpBaseMediaCallStreamRequestReceivingFunc) ( TpBaseMediaCallStream *self, TpHandle contact, gboolean receive); typedef gboolean (*TpBaseMediaCallStreamSetSendingFunc) ( TpBaseMediaCallStream *self, gboolean sending, GError **error); struct _TpBaseMediaCallStreamClass { /**/ TpBaseCallStreamClass parent_class; /*< public >*/ TpBaseMediaCallStreamReportFailureFunc report_sending_failure; TpBaseMediaCallStreamReportFailureFunc report_receiving_failure; TpBaseMediaCallStreamAddCandidatesFunc add_local_candidates; TpBaseMediaCallStreamFinishInitialCandidatesFunc finish_initial_candidates; TpBaseMediaCallStreamRequestReceivingFunc request_receiving; TpBaseMediaCallStreamSetSendingFunc set_sending; /**/ gpointer future[4]; }; struct _TpBaseMediaCallStream { /**/ TpBaseCallStream parent; TpBaseMediaCallStreamPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_base_media_call_stream_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_MEDIA_CALL_STREAM \ (tp_base_media_call_stream_get_type ()) #define TP_BASE_MEDIA_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_MEDIA_CALL_STREAM, TpBaseMediaCallStream)) #define TP_BASE_MEDIA_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_MEDIA_CALL_STREAM, \ TpBaseMediaCallStreamClass)) #define TP_IS_BASE_MEDIA_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_MEDIA_CALL_STREAM)) #define TP_IS_BASE_MEDIA_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_MEDIA_CALL_STREAM)) #define TP_BASE_MEDIA_CALL_STREAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_MEDIA_CALL_STREAM, \ TpBaseMediaCallStreamClass)) _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_set_relay_info (TpBaseMediaCallStream *self, GPtrArray *relays); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_set_stun_servers (TpBaseMediaCallStream *self, GPtrArray *stun_servers); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_add_endpoint (TpBaseMediaCallStream *self, TpCallStreamEndpoint *endpoint); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_remove_endpoint (TpBaseMediaCallStream *self, TpCallStreamEndpoint *endpoint); _TP_AVAILABLE_IN_0_18 GList *tp_base_media_call_stream_get_endpoints (TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 const gchar *tp_base_media_call_stream_get_username ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 const gchar *tp_base_media_call_stream_get_password ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 TpStreamFlowState tp_base_media_call_stream_get_sending_state ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 TpStreamFlowState tp_base_media_call_stream_get_receiving_state ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_update_receiving_state ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_update_sending_state ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_stream_set_local_sending (TpBaseMediaCallStream *self, gboolean sending); _TP_AVAILABLE_IN_0_18 gboolean tp_base_media_call_stream_get_local_sending ( TpBaseMediaCallStream *self); _TP_AVAILABLE_IN_0_18 GPtrArray *tp_base_media_call_stream_get_local_candidates ( TpBaseMediaCallStream *self); G_END_DECLS #endif /* #ifndef __TP_BASE_MEDIA_CALL_STREAM_H__*/ telepathy-glib-0.24.2/telepathy-glib/signalled-message.c0000644000175000017500000001542212652510705020103 00000000000000/* * signalled-message.c - Source for TpSignalledMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:signalled-message * @title: TpSignalledMessage * @short_description: a message received using the Telepathy message interface * * #TpSignalledMessage is used within Telepathy clients to represent a message * signalled by a connection manager. This can either be a message received from * someone else, confirmation that a message has been sent by the local user, * or a delivery report indicating that delivery of a message has * succeeded or failed. * * Since: 0.13.9 */ #include "config.h" #include "signalled-message.h" #include "signalled-message-internal.h" #include "message-internal.h" #include #include #include /** * TpSignalledMessage: * * Opaque structure representing a received message using the Telepathy * messages interface * * Since: 0.13.9 */ enum { PROP_SENDER = 1 }; G_DEFINE_TYPE (TpSignalledMessage, tp_signalled_message, TP_TYPE_MESSAGE) struct _TpSignalledMessagePrivate { TpContact *sender; }; static void tp_signalled_message_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpSignalledMessage *self = (TpSignalledMessage *) object; switch (property_id) { case PROP_SENDER: g_value_set_object (value, self->priv->sender); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_signalled_message_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpSignalledMessage *self = (TpSignalledMessage *) object; switch (property_id) { case PROP_SENDER: g_assert (self->priv->sender == NULL); /* construct only */ self->priv->sender = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_signalled_message_dispose (GObject *object) { TpSignalledMessage *self = TP_SIGNALLED_MESSAGE (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_signalled_message_parent_class)->dispose; tp_clear_object (&self->priv->sender); if (dispose != NULL) dispose (object); } static void tp_signalled_message_class_init (TpSignalledMessageClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; gobject_class->get_property = tp_signalled_message_get_property; gobject_class->set_property = tp_signalled_message_set_property; gobject_class->dispose = tp_signalled_message_dispose; /** * TpSignalledMessage:sender: * * A #TpContact representing the sender of the message, if known, or %NULL * otherwise. * * Since: 0.13.9 */ param_spec = g_param_spec_object ("sender", "TpContact", "The sender of the message", TP_TYPE_CONTACT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SENDER, param_spec); g_type_class_add_private (gobject_class, sizeof (TpSignalledMessagePrivate)); } static void tp_signalled_message_init (TpSignalledMessage *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_SIGNALLED_MESSAGE, TpSignalledMessagePrivate); self->priv->sender = NULL; } /* * Create a new TpSignalledMessage. * * Any message-sender and message-sender-id in parts[0] will be ignored * completely: the caller is responsible for interpreting those fields * and providing a suitable @sender. * * The message-sender will be removed from the header, and the * message-sender-id will be set to match the #TpContact:identifier of @sender. * * @sender may be %NULL, which means the message wasn't sent by a contact * (this could be used for administrative messages from a chatroom or the * server) or we have no idea who sent it. */ TpMessage * _tp_signalled_message_new (const GPtrArray *parts, TpContact *sender) { TpMessage *self; guint i; g_return_val_if_fail (parts != NULL, NULL); g_return_val_if_fail (parts->len > 0, NULL); g_return_val_if_fail (sender == NULL || TP_IS_CONTACT (sender), NULL); self = g_object_new (TP_TYPE_SIGNALLED_MESSAGE, "sender", sender, NULL); for (i = 0; i < parts->len; i++) { /* First part is automatically created */ if (i != 0) tp_message_append_part (self); tp_g_hash_table_update (g_ptr_array_index (self->parts, i), g_ptr_array_index (parts, i), (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); } /* This handle may not be persistent, user should use the TpContact * directly */ tp_message_delete_key (self, 0, "message-sender"); /* override any message-sender-id that the message might have had */ if (sender == NULL) { tp_message_delete_key (self, 0, "message-sender-id"); } else { tp_message_set_string (self, 0, "message-sender-id", tp_contact_get_identifier (sender)); } _tp_message_set_immutable (self); return self; } /** * tp_signalled_message_get_sender: * @message: a #TpSignalledMessage * * Returns a #TpContact representing the sender of @message if known, %NULL * otherwise. * * Returns: (transfer none): the sender of the message * * Since: 0.13.9 */ TpContact * tp_signalled_message_get_sender (TpMessage *message) { TpSignalledMessage *self; g_return_val_if_fail (TP_IS_SIGNALLED_MESSAGE (message), NULL); self = (TpSignalledMessage *) message; return self->priv->sender; } guint _tp_signalled_message_get_pending_message_id (TpMessage *message, gboolean *valid) { const GHashTable *part0; g_return_val_if_fail (TP_IS_SIGNALLED_MESSAGE (message), 0); g_return_val_if_fail (valid != NULL, 0); part0 = tp_message_peek (message, 0); if (part0 == NULL) { *valid = FALSE; return 0; } return tp_asv_get_uint32 (part0, "pending-message-id", valid); } telepathy-glib-0.24.2/telepathy-glib/signalled-message.h0000644000175000017500000000430012652510705020101 00000000000000/* * signalled-message.h - Header for TpSignalledMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIGNALLED_MESSAGE_H__ #define __TP_SIGNALLED_MESSAGE_H__ #include #include #include G_BEGIN_DECLS #define TP_TYPE_SIGNALLED_MESSAGE (tp_signalled_message_get_type ()) #define TP_SIGNALLED_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIGNALLED_MESSAGE, TpSignalledMessage)) #define TP_SIGNALLED_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_SIGNALLED_MESSAGE, TpSignalledMessageClass)) #define TP_IS_SIGNALLED_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIGNALLED_MESSAGE)) #define TP_IS_SIGNALLED_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_SIGNALLED_MESSAGE)) #define TP_SIGNALLED_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIGNALLED_MESSAGE, TpSignalledMessageClass)) typedef struct _TpSignalledMessage TpSignalledMessage; typedef struct _TpSignalledMessageClass TpSignalledMessageClass; GType tp_signalled_message_get_type (void); TpContact * tp_signalled_message_get_sender (TpMessage *message); G_END_DECLS #endif /* __TP_SIGNALLED_MESSAGE_H__ */ telepathy-glib-0.24.2/telepathy-glib/protocol.c0000644000175000017500000021161514004031760016352 00000000000000/* TpProtocol * * Copyright © 2010-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:protocol * @title: TpProtocol * @short_description: proxy for a Telepathy Protocol object * @see_also: #TpConnectionManager * * #TpProtocol objects represent the protocols implemented by Telepathy * connection managers. In modern connection managers, each protocol is * represented by a D-Bus object; in older connection managers, the protocols * are represented by data structures, and this object merely emulates a D-Bus * object. * * Since: 0.11.11 */ #include "config.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PARAMS #include "telepathy-glib/capabilities-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" #include "telepathy-glib/_gen/tp-cli-protocol-body.h" #include struct _TpProtocolClass { /**/ TpProxyClass parent_class; }; /** * TpProtocol: * * A base class for connection managers' protocols. * * Since: 0.11.11 */ /** * TpProtocolClass: * * The class of a #TpProtocol. * * Since: 0.11.11 */ G_DEFINE_TYPE(TpProtocol, tp_protocol, TP_TYPE_PROXY) /** * TP_PROTOCOL_FEATURE_PARAMETERS: * * Expands to a call to a function that returns a quark for the parameters * feature of a #TpProtocol. * * When this feature is prepared, the possible parameters for connections to * this protocol have been retrieved and are available for use. * * Unlike %TP_PROTOCOL_FEATURE_CORE, this feature can even be available on * connection managers that don't really have Protocol objects * (on these older connection managers, the #TpProtocol uses information from * ConnectionManager methods to provide the list of parameters). * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.11 */ GQuark tp_protocol_get_feature_quark_parameters (void) { return g_quark_from_static_string ("tp-protocol-feature-parameters"); } /** * TP_PROTOCOL_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the core * feature of a #TpProtocol. * * When this feature is prepared, at least the following basic information * about the protocol is available: * * * possible parameters for connections to this protocol * interfaces expected on connections to this protocol * classes of channel that could be requested from connections * to this protocol * * * (This feature implies that %TP_PROTOCOL_FEATURE_PARAMETERS is also * available.) * * Unlike %TP_PROTOCOL_FEATURE_PARAMETERS, this feature can only become * available on connection managers that implement Protocol objects. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.11 */ GQuark tp_protocol_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-protocol-feature-core"); } struct _TpProtocolPrivate { TpConnectionManagerProtocol protocol_struct; GHashTable *protocol_properties; gchar *vcard_field; gchar *english_name; gchar *icon_name; GStrv authentication_types; TpCapabilities *capabilities; TpAvatarRequirements *avatar_req; gchar *cm_name; GStrv addressable_vcard_fields; GStrv addressable_uri_schemes; /* (transfer container) (element-type utf8 Simple_Status_Spec) */ GHashTable *presence_statuses; }; enum { PROP_PROTOCOL_NAME = 1, PROP_PROTOCOL_PROPERTIES, PROP_PROTOCOL_PROPERTIES_VARDICT, PROP_ENGLISH_NAME, PROP_VCARD_FIELD, PROP_ICON_NAME, PROP_CAPABILITIES, PROP_PARAM_NAMES, PROP_AUTHENTICATION_TYPES, PROP_AVATAR_REQUIREMENTS, PROP_CM_NAME, PROP_ADDRESSABLE_VCARD_FIELDS, PROP_ADDRESSABLE_URI_SCHEMES, N_PROPS }; /* this is NULL-safe for @parameters, and callers rely on this */ static TpConnectionManagerParam * tp_protocol_params_from_param_specs (const GPtrArray *parameters, const gchar *cm_debug_name, const gchar *protocol) { GArray *output; guint i; DEBUG ("Protocol name: %s", protocol); if (parameters == NULL) { return g_new0 (TpConnectionManagerParam, 1); } output = g_array_sized_new (TRUE, TRUE, sizeof (TpConnectionManagerParam), parameters->len); for (i = 0; i < parameters->len; i++) { GValue structure = { 0 }; GValue *tmp; TpConnectionManagerParam *param; g_value_init (&structure, TP_STRUCT_TYPE_PARAM_SPEC); g_value_set_static_boxed (&structure, g_ptr_array_index (parameters, i)); g_array_set_size (output, output->len + 1); /* point to the new last item */ param = &g_array_index (output, TpConnectionManagerParam, output->len - 1); if (!dbus_g_type_struct_get (&structure, 0, ¶m->name, 1, ¶m->flags, 2, ¶m->dbus_signature, 3, &tmp, G_MAXUINT)) { DEBUG ("Unparseable parameter #%d for %s, ignoring", i, protocol); /* *shrug* that one didn't work, let's skip it */ g_array_set_size (output, output->len - 1); continue; } if (!g_variant_type_string_is_valid (param->dbus_signature)) { DEBUG ("Parameter #%d for %s has type '%s' which is not a " "single complete type, ignoring", i, protocol, param->dbus_signature); g_array_set_size (output, output->len - 1); continue; } g_value_init (¶m->default_value, G_VALUE_TYPE (tmp)); g_value_copy (tmp, ¶m->default_value); g_value_unset (tmp); g_free (tmp); param->priv = NULL; DEBUG ("\tParam name: %s", param->name); DEBUG ("\tParam flags: 0x%x", param->flags); DEBUG ("\tParam sig: %s", param->dbus_signature); if ((!tp_strdiff (param->name, "password") || g_str_has_suffix (param->name, "-password")) && (param->flags & TP_CONN_MGR_PARAM_FLAG_SECRET) == 0) { DEBUG ("\tTreating as secret due to its name (please fix %s)", cm_debug_name); param->flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; } #ifdef ENABLE_DEBUG { gchar *repr = g_strdup_value_contents (&(param->default_value)); DEBUG ("\tParam default value: %s of type %s", repr, G_VALUE_TYPE_NAME (&(param->default_value))); g_free (repr); } #endif } return (TpConnectionManagerParam *) g_array_free (output, FALSE); } static void tp_protocol_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpProtocol *self = (TpProtocol *) object; switch (property_id) { case PROP_PROTOCOL_NAME: g_value_set_string (value, self->priv->protocol_struct.name); break; case PROP_PROTOCOL_PROPERTIES: g_value_set_boxed (value, self->priv->protocol_properties); break; case PROP_PROTOCOL_PROPERTIES_VARDICT: g_value_take_variant (value, tp_protocol_dup_immutable_properties (self)); break; case PROP_ENGLISH_NAME: g_value_set_string (value, tp_protocol_get_english_name (self)); break; case PROP_VCARD_FIELD: g_value_set_string (value, tp_protocol_get_vcard_field (self)); break; case PROP_ICON_NAME: g_value_set_string (value, tp_protocol_get_icon_name (self)); break; case PROP_CAPABILITIES: g_value_set_object (value, tp_protocol_get_capabilities (self)); break; case PROP_PARAM_NAMES: g_value_take_boxed (value, tp_protocol_dup_param_names (self)); break; case PROP_AUTHENTICATION_TYPES: g_value_set_boxed (value, tp_protocol_get_authentication_types (self)); break; case PROP_AVATAR_REQUIREMENTS: g_value_set_pointer (value, tp_protocol_get_avatar_requirements (self)); break; case PROP_CM_NAME: g_value_set_string (value, tp_protocol_get_cm_name (self)); break; case PROP_ADDRESSABLE_VCARD_FIELDS: g_value_set_boxed (value, tp_protocol_get_addressable_vcard_fields ( self)); break; case PROP_ADDRESSABLE_URI_SCHEMES: g_value_set_boxed (value, tp_protocol_get_addressable_uri_schemes (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_protocol_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpProtocol *self = (TpProtocol *) object; switch (property_id) { case PROP_PROTOCOL_NAME: g_assert (self->priv->protocol_struct.name == NULL); self->priv->protocol_struct.name = g_value_dup_string (value); break; case PROP_PROTOCOL_PROPERTIES: g_assert (self->priv->protocol_properties == NULL); self->priv->protocol_properties = g_value_dup_boxed (value); break; case PROP_CM_NAME: g_assert (self->priv->cm_name == NULL); self->priv->cm_name = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } void _tp_connection_manager_param_free_contents (TpConnectionManagerParam *param) { g_free (param->name); g_free (param->dbus_signature); if (G_IS_VALUE (¶m->default_value)) g_value_unset (¶m->default_value); } void _tp_connection_manager_protocol_free_contents ( TpConnectionManagerProtocol *proto) { g_free (proto->name); if (proto->params != NULL) { TpConnectionManagerParam *param; for (param = proto->params; param->name != NULL; param++) _tp_connection_manager_param_free_contents (param); } g_free (proto->params); } static void tp_protocol_dispose (GObject *object) { TpProtocol *self = TP_PROTOCOL (object); GObjectFinalizeFunc dispose = ((GObjectClass *) tp_protocol_parent_class)->dispose; if (self->priv->capabilities != NULL) { g_object_unref (self->priv->capabilities); self->priv->capabilities = NULL; } if (self->priv->authentication_types) { g_strfreev (self->priv->authentication_types); self->priv->authentication_types = NULL; } tp_clear_pointer (&self->priv->avatar_req, tp_avatar_requirements_destroy); if (dispose != NULL) dispose (object); } static void tp_protocol_finalize (GObject *object) { TpProtocol *self = TP_PROTOCOL (object); GObjectFinalizeFunc finalize = ((GObjectClass *) tp_protocol_parent_class)->finalize; _tp_connection_manager_protocol_free_contents (&self->priv->protocol_struct); g_free (self->priv->vcard_field); g_free (self->priv->english_name); g_free (self->priv->icon_name); g_free (self->priv->cm_name); g_strfreev (self->priv->addressable_vcard_fields); g_strfreev (self->priv->addressable_uri_schemes); if (self->priv->presence_statuses != NULL) g_hash_table_unref (self->priv->presence_statuses); if (self->priv->protocol_properties != NULL) g_hash_table_unref (self->priv->protocol_properties); if (finalize != NULL) finalize (object); } static gboolean tp_protocol_check_for_core (TpProtocol *self) { const GHashTable *props = self->priv->protocol_properties; const GValue *value; /* this one can legitimately be NULL so we need to be more careful */ value = tp_asv_lookup (props, TP_PROP_PROTOCOL_CONNECTION_INTERFACES); if (value == NULL || !G_VALUE_HOLDS (value, G_TYPE_STRV)) { DEBUG ("Interfaces not found"); return FALSE; } if (tp_asv_get_boxed (props, TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST) == NULL) { DEBUG ("Requestable channel classes not found"); return FALSE; } /* Interfaces has a sensible default, the empty list. * VCardField, EnglishName and Icon have a sensible default, "". */ DEBUG ("Core feature ready"); return TRUE; } static gchar * title_case (const gchar *s) { gunichar u; /* 6 bytes are enough for any Unicode character, 7th byte remains '\0' */ gchar buf[7] = { 0 }; /* if s isn't UTF-8, give up and use it as-is */ if (!g_utf8_validate (s, -1, NULL)) return g_strdup (s); u = g_utf8_get_char (s); if (!g_unichar_islower (u)) return g_strdup (s); u = g_unichar_totitle (u); g_unichar_to_utf8 (u, buf); g_assert (buf [sizeof (buf) - 1] == '\0'); return g_strdup_printf ("%s%s", buf, g_utf8_next_char (s)); } static GStrv asv_strdupv_or_empty (const GHashTable *asv, const gchar *key) { const gchar * const *strings = tp_asv_get_boxed (asv, key, G_TYPE_STRV); static const gchar * const no_strings[] = { NULL }; if (strings != NULL) return g_strdupv ((GStrv) strings); else return g_strdupv ((GStrv) no_strings); } static void tp_protocol_constructed (GObject *object) { TpProtocol *self = (TpProtocol *) object; TpProxy *proxy = (TpProxy *) object; void (*chain_up) (GObject *) = ((GObjectClass *) tp_protocol_parent_class)->constructed; const gchar *s; const GPtrArray *rccs; gboolean had_immutables = TRUE; const gchar * const *interfaces; if (chain_up != NULL) chain_up (object); g_assert (self->priv->protocol_struct.name != NULL); DEBUG ("%s/%s: new Protocol", self->priv->cm_name, self->priv->protocol_struct.name); if (self->priv->protocol_properties == NULL) { DEBUG ("immutable properties not supplied"); had_immutables = FALSE; self->priv->protocol_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); } else { GHashTableIter iter; gpointer k, v; DEBUG ("immutable properties already supplied"); g_hash_table_iter_init (&iter, self->priv->protocol_properties); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *printed; printed = g_strdup_value_contents (v); DEBUG ("%s = %s", (const gchar *) k, printed); g_free (printed); } } self->priv->protocol_struct.params = tp_protocol_params_from_param_specs ( tp_asv_get_boxed (self->priv->protocol_properties, TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST), tp_proxy_get_bus_name (self), self->priv->protocol_struct.name); /* force vCard field to lower case, even if the CM is spec-incompliant */ s = tp_asv_get_string (self->priv->protocol_properties, TP_PROP_PROTOCOL_VCARD_FIELD); if (tp_str_empty (s)) self->priv->vcard_field = NULL; else self->priv->vcard_field = g_utf8_strdown (s, -1); s = tp_asv_get_string (self->priv->protocol_properties, TP_PROP_PROTOCOL_ENGLISH_NAME); if (tp_str_empty (s)) self->priv->english_name = title_case (self->priv->protocol_struct.name); else self->priv->english_name = g_strdup (s); s = tp_asv_get_string (self->priv->protocol_properties, TP_PROP_PROTOCOL_ICON); if (tp_str_empty (s)) self->priv->icon_name = g_strdup_printf ("im-%s", self->priv->protocol_struct.name); else self->priv->icon_name = g_strdup (s); rccs = tp_asv_get_boxed (self->priv->protocol_properties, TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST); if (rccs != NULL) self->priv->capabilities = _tp_capabilities_new (rccs, FALSE); self->priv->authentication_types = asv_strdupv_or_empty ( self->priv->protocol_properties, TP_PROP_PROTOCOL_AUTHENTICATION_TYPES); interfaces = tp_asv_get_strv (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACES); tp_proxy_add_interfaces (proxy, interfaces); if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_PROTOCOL_INTERFACE_AVATARS)) { DEBUG ("%s/%s implements Avatars", self->priv->cm_name, self->priv->protocol_struct.name); self->priv->avatar_req = tp_avatar_requirements_new ( (GStrv) tp_asv_get_strv (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT, NULL), tp_asv_get_uint32 (self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES, NULL)); } if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_PROTOCOL_INTERFACE_ADDRESSING)) { DEBUG ("%s/%s implements Addressing", self->priv->cm_name, self->priv->protocol_struct.name); self->priv->addressable_vcard_fields = asv_strdupv_or_empty ( self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_VCARD_FIELDS); self->priv->addressable_uri_schemes = asv_strdupv_or_empty ( self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_ADDRESSING_ADDRESSABLE_URI_SCHEMES); } if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_PROTOCOL_INTERFACE_PRESENCE)) { DEBUG ("%s/%s implements Presence", self->priv->cm_name, self->priv->protocol_struct.name); self->priv->presence_statuses = tp_asv_get_boxed ( self->priv->protocol_properties, TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES, TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP); if (self->priv->presence_statuses != NULL) { GHashTableIter iter; gpointer k, v; g_hash_table_ref (self->priv->presence_statuses); DEBUG ("%s/%s presence statuses:", self->priv->cm_name, self->priv->protocol_struct.name); g_hash_table_iter_init (&iter, self->priv->presence_statuses); while (g_hash_table_iter_next (&iter, &k, &v)) { guint type; gboolean on_self, message; tp_value_array_unpack (v, 3, &type, &on_self, &message); DEBUG ("\tstatus '%s': type %u%s%s", (const gchar *) k, type, on_self ? ", can set on self" : "", message ? ", has message" : ""); } } } /* become ready immediately */ _tp_proxy_set_feature_prepared (proxy, TP_PROTOCOL_FEATURE_PARAMETERS, had_immutables); _tp_proxy_set_feature_prepared (proxy, TP_PROTOCOL_FEATURE_CORE, had_immutables && tp_protocol_check_for_core (self)); } enum { FEAT_PARAMETERS, FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_protocol_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; /* we always try to prepare both of these features, and nothing else is * allowed to complete until they have succeeded or failed */ features[FEAT_PARAMETERS].name = TP_PROTOCOL_FEATURE_PARAMETERS; features[FEAT_PARAMETERS].core = TRUE; features[FEAT_CORE].name = TP_PROTOCOL_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_protocol_class_init (TpProtocolClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpProtocolPrivate)); object_class->constructed = tp_protocol_constructed; object_class->get_property = tp_protocol_get_property; object_class->set_property = tp_protocol_set_property; object_class->dispose = tp_protocol_dispose; object_class->finalize = tp_protocol_finalize; /** * TpProtocol:protocol-name: * * The machine-readable name of the protocol, taken from the Telepathy * D-Bus Interface Specification, such as "jabber" or "local-xmpp". * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_PROTOCOL_NAME, g_param_spec_string ("protocol-name", "Name of this protocol", "The Protocol from telepathy-spec, such as 'jabber' or 'local-xmpp'", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:protocol-properties: * * The immutable properties of this Protocol, as provided at construction * time. This is a map from string to #GValue, which must not be modified. * * If the immutable properties were not provided at construction time, * the %TP_PROTOCOL_FEATURE_PARAMETERS and %TP_PROTOCOL_FEATURE_CORE features * will both be unavailable, and this #TpProtocol object will only be useful * as a way to access lower-level D-Bus calls. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_PROTOCOL_PROPERTIES, g_param_spec_boxed ("protocol-properties", "Protocol properties", "The immutable properties of this Protocol", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:protocol-properties-vardict: * * The immutable properties of this Protocol, as provided at construction * time. This is a #G_VARIANT_TYPE_VARDICT #GVariant, * which must not be modified. * * If the immutable properties were not provided at construction time, * the %TP_PROTOCOL_FEATURE_PARAMETERS and %TP_PROTOCOL_FEATURE_CORE features * will both be unavailable, and this #TpProtocol object will only be useful * as a way to access lower-level D-Bus calls. * * Since: 0.23.3 */ g_object_class_install_property (object_class, PROP_PROTOCOL_PROPERTIES_VARDICT, g_param_spec_variant ("protocol-properties-vardict", "Protocol properties", "The immutable properties of this Protocol", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:english-name: * * The name of the protocol in a form suitable for display to users, * such as "AIM" or "Yahoo!", or a string based on #TpProtocol:protocol-name * (currently constructed by putting the first character in title case, * but this is not guaranteed) if no better name is available or the * %TP_PROTOCOL_FEATURE_CORE feature has not been prepared. * * This is effectively in the C locale (international English); user * interfaces requiring a localized protocol name should look one up in their * own message catalog based on either #TpProtocol:protocol-name or * #TpProtocol:english-name, but should use this English version as a * fallback if no translated version can be found. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_ENGLISH_NAME, g_param_spec_string ("english-name", "English name", "A non-NULL English name for this Protocol", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:vcard-field: * * The most common vCard field used for this protocol's contact * identifiers, normalized to lower case, or %NULL if there is no such field * or the %TP_PROTOCOL_FEATURE_CORE feature has not been prepared. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_VCARD_FIELD, g_param_spec_string ("vcard-field", "vCard field", "A lower-case vCard name for this Protocol, or NULL", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:icon-name: * * The name of an icon in the system's icon theme. If none was supplied * by the Protocol, or the %TP_PROTOCOL_FEATURE_CORE feature has not been * prepared, a default is used; currently, this is "im-" plus * #TpProtocol:protocol-name. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_ICON_NAME, g_param_spec_string ("icon-name", "Icon name", "A non-NULL Icon name for this Protocol", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:capabilities: * * The classes of channel that can be requested from connections to this * protocol, or %NULL if this is unknown or the %TP_PROTOCOL_FEATURE_CORE * feature has not been prepared. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_CAPABILITIES, g_param_spec_object ("capabilities", "Capabilities", "Requestable channel classes for this Protocol", TP_TYPE_CAPABILITIES, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:param-names: * * A list of parameter names supported by this connection manager * for this protocol, or %NULL if %TP_PROTOCOL_FEATURE_PARAMETERS has not * been prepared. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_PARAM_NAMES, g_param_spec_boxed ("param-names", "Parameter names", "A list of parameter names", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:authentication-types: * * A non-%NULL #GStrv of interfaces which provide information as to * what kind of authentication channels can possibly appear before * the connection reaches the CONNECTED state, or %NULL if * %TP_PROTOCOL_FEATURE_CORE has not been prepared. * * Since: 0.13.9 */ g_object_class_install_property (object_class, PROP_AUTHENTICATION_TYPES, g_param_spec_boxed ("authentication-types", "AuthenticationTypes", "A list of authentication types", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:avatar-requirements: * * A #TpAvatarRequirements representing the avatar requirements on this * protocol, or %NULL if %TP_PROTOCOL_FEATURE_CORE has not been prepared or * if the protocol doesn't support avatars. * * Since: 0.15.6 */ g_object_class_install_property (object_class, PROP_AVATAR_REQUIREMENTS, g_param_spec_pointer ("avatar-requirements", "Avatars requirements", "Avatars requirements", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:cm-name: * * The name of the connection manager this protocol is on. * * Since: 0.19.1 */ g_object_class_install_property (object_class, PROP_CM_NAME, g_param_spec_string ("cm-name", "Connection manager name", "Name of the CM this protocol is on", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:addressable-vcard-fields: * * A non-%NULL #GStrv of vCard fields supported by this protocol. * If this protocol does not support addressing contacts by a vCard field, * the list is empty. * * For instance, a SIP connection manager that supports calling contacts * by SIP URI (vCard field SIP) or telephone number (vCard field TEL) * might have { "sip", "tel", NULL }. * * Since: 0.23.1 */ g_object_class_install_property (object_class, PROP_ADDRESSABLE_VCARD_FIELDS, g_param_spec_boxed ("addressable-vcard-fields", "AddressableVCardFields", "A list of vCard fields", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpProtocol:addressable-uri-schemes: * * A non-%NULL #GStrv of URI schemes supported by this protocol. * If this protocol does not support addressing contacts by URI, * the list is empty. * * For instance, a SIP connection manager that supports calling contacts * by SIP URI (sip:alice@example.com, sips:bob@example.com) * or telephone number (tel:+1-555-0123) might have * { "sip", "sips", "tel", NULL }. * * Since: 0.23.1 */ g_object_class_install_property (object_class, PROP_ADDRESSABLE_URI_SCHEMES, g_param_spec_boxed ("addressable-uri-schemes", "AddressableURISchemes", "A list of URI schemes", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); proxy_class->list_features = tp_protocol_list_features; proxy_class->must_have_unique_name = FALSE; proxy_class->interface = TP_IFACE_QUARK_PROTOCOL; tp_protocol_init_known_interfaces (); } static void tp_protocol_init (TpProtocol *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_PROTOCOL, TpProtocolPrivate); } /** * tp_protocol_new: * @dbus: proxy for the D-Bus daemon; may not be %NULL * @cm_name: the connection manager name (such as "gabble") * @protocol_name: the protocol name (such as "jabber") * @immutable_properties: the immutable D-Bus properties for this protocol * @error: used to indicate the error if %NULL is returned * * * * Returns: a new protocol proxy, or %NULL on invalid arguments * * Since: 0.11.11 */ TpProtocol * tp_protocol_new (TpDBusDaemon *dbus, const gchar *cm_name, const gchar *protocol_name, const GHashTable *immutable_properties, GError **error) { TpProtocol *ret = NULL; gchar *bus_name = NULL; gchar *object_path = NULL; g_return_val_if_fail (TP_IS_DBUS_DAEMON (dbus), NULL); if (!tp_connection_manager_check_valid_protocol_name (protocol_name, error)) goto finally; if (!tp_connection_manager_check_valid_name (cm_name, error)) goto finally; bus_name = g_strdup_printf ("%s%s", TP_CM_BUS_NAME_BASE, cm_name); object_path = g_strdup_printf ("%s%s/%s", TP_CM_OBJECT_PATH_BASE, cm_name, protocol_name); /* e.g. local-xmpp -> local_xmpp */ g_strdelimit (object_path, "-", '_'); ret = TP_PROTOCOL (g_object_new (TP_TYPE_PROTOCOL, "dbus-daemon", dbus, "bus-name", bus_name, "object-path", object_path, "protocol-name", protocol_name, "protocol-properties", immutable_properties, "cm-name", cm_name, NULL)); finally: g_free (bus_name); g_free (object_path); return ret; } /** * tp_protocol_new_vardict: * @dbus: proxy for the D-Bus daemon; may not be %NULL * @cm_name: the connection manager name (such as "gabble") * @protocol_name: the protocol name (such as "jabber") * @immutable_properties: the immutable D-Bus properties for this protocol * @error: used to indicate the error if %NULL is returned * * Create a new protocol proxy. * * If @immutable_properties is a floating reference, this function will * take ownership of it, much like g_variant_ref_sink(). See documentation of * that function for details. * * Returns: a new protocol proxy, or %NULL on invalid arguments * * Since: 0.23.3 */ TpProtocol * tp_protocol_new_vardict (TpDBusDaemon *dbus, const gchar *cm_name, const gchar *protocol_name, GVariant *immutable_properties, GError **error) { GHashTable *hash; TpProtocol *ret; g_return_val_if_fail (g_variant_is_of_type (immutable_properties, G_VARIANT_TYPE_VARDICT), NULL); g_variant_ref_sink (immutable_properties); hash = _tp_asv_from_vardict (immutable_properties); ret = tp_protocol_new (dbus, cm_name, protocol_name, hash, error); g_hash_table_unref (hash); g_variant_unref (immutable_properties); return ret; } /** * tp_protocol_init_known_interfaces: * * Ensure that the known interfaces for TpProtocol have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_PROTOCOL. * * Since: 0.11.11 */ void tp_protocol_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType type = TP_TYPE_PROTOCOL; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (type, tp_cli_protocol_add_signals); tp_proxy_subclass_add_error_mapping (type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } TpConnectionManagerProtocol * _tp_protocol_get_struct (TpProtocol *self) { return &self->priv->protocol_struct; } /** * tp_protocol_get_name: * @self: a protocol object * * Return the same thing as the protocol-name property, for convenient use * in C code. The returned string is valid for as long as @self exists. * * Returns: the value of the #TpProtocol:protocol-name property * * Since: 0.11.11 */ const gchar * tp_protocol_get_name (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->protocol_struct.name; } /** * tp_protocol_has_param: * @self: a protocol * @param: a parameter name * * * * Returns: %TRUE if @self supports the parameter @param. * * Since: 0.11.11 */ gboolean tp_protocol_has_param (TpProtocol *self, const gchar *param) { return (tp_protocol_get_param (self, param) != NULL); } /** * tp_protocol_get_param: * @self: a protocol * @param: a parameter name * * * * Returns: a structure representing the parameter @param, or %NULL if not * supported * * Since: 0.11.11 */ const TpConnectionManagerParam * tp_protocol_get_param (TpProtocol *self, const gchar *param) { g_return_val_if_fail (TP_IS_PROTOCOL (self), FALSE); G_GNUC_BEGIN_IGNORE_DEPRECATIONS return tp_connection_manager_protocol_get_param ( &self->priv->protocol_struct, param); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_protocol_dup_param: * @self: a protocol * @param: a parameter name * * * * Returns: (transfer full): a structure representing the parameter @param, * or %NULL if not supported. Free with tp_connection_manager_param_free() * * Since: 0.17.6 */ TpConnectionManagerParam * tp_protocol_dup_param (TpProtocol *self, const gchar *param) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return tp_connection_manager_param_copy (tp_protocol_get_param (self, param)); } /** * tp_protocol_can_register: * @self: a protocol * * Return whether a new account can be registered on this protocol, by setting * the special "register" parameter to %TRUE. * * Returns: %TRUE if @protocol supports the parameter "register" * * Since: 0.11.11 */ gboolean tp_protocol_can_register (TpProtocol *self) { return tp_protocol_has_param (self, "register"); } /** * tp_protocol_dup_param_names: * @self: a protocol * * Returns a list of parameter names supported by this connection manager * for this protocol. * * The result is copied and must be freed by the caller with g_strfreev(). * * Returns: (array zero-terminated=1) (transfer full): a copy of * #TpProtocol:param-names * * Since: 0.11.11 */ GStrv tp_protocol_dup_param_names (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); G_GNUC_BEGIN_IGNORE_DEPRECATIONS return tp_connection_manager_protocol_dup_param_names ( &self->priv->protocol_struct); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_protocol_borrow_params: (skip) * @self: a protocol * * Returns an array of parameters supported by this connection manager, * without additional memory allocations. The returned array is owned by * @self, and must not be used after @self has been freed. * * Returns: (transfer none): an array of #TpConnectionManagerParam structures, * terminated by one whose @name is %NULL * * Since: 0.17.6 * Deprecated: Since 0.19.9. New code should use tp_protocol_dup_params() * instead. */ const TpConnectionManagerParam * tp_protocol_borrow_params (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->protocol_struct.params; } /** * tp_protocol_dup_params: * @self: a protocol * * Returns a list of parameters supported by this connection manager. * * The returned list must be freed by the caller, for instance with * g_list_free_full (l, * (GDestroyNotify) tp_connection_manager_param_free). * * Returns: (transfer full) (element-type TelepathyGLib.ConnectionManagerParam): * a list of #TpConnectionManagerParam structures, owned by the caller * * Since: 0.17.6 */ GList * tp_protocol_dup_params (TpProtocol *self) { guint i; GList *ret = NULL; g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); for (i = 0; self->priv->protocol_struct.params[i].name != NULL; i++) { ret = g_list_prepend (ret, tp_connection_manager_param_copy ( &(self->priv->protocol_struct.params[i]))); } return g_list_reverse (ret); } /** * tp_protocol_get_vcard_field: * @self: a protocol object * * * * Returns: the value of #TpProtocol:vcard-field * * Since: 0.11.11 */ const gchar * tp_protocol_get_vcard_field (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->vcard_field; } /** * tp_protocol_get_english_name: * @self: a protocol object * * * * Returns: the non-%NULL, non-empty value of #TpProtocol:english-name * * Since: 0.11.11 */ const gchar * tp_protocol_get_english_name (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), ""); return self->priv->english_name; } /** * tp_protocol_get_icon_name: * @self: a protocol object * * * * Returns: the non-%NULL, non-empty value of #TpProtocol:icon-name * * Since: 0.11.11 */ const gchar * tp_protocol_get_icon_name (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), "dialog-error"); return self->priv->icon_name; } /** * tp_protocol_get_authentication_types: * @self: a protocol object * * * * Returns: (transfer none): the value of #TpProtocol:authentication-types * * Since: 0.13.9 */ const gchar * const * tp_protocol_get_authentication_types (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return (const gchar * const *) self->priv->authentication_types; } /** * tp_protocol_get_capabilities: * @self: a protocol object * * * * Returns: (transfer none): #TpProtocol:capabilities, which must be referenced * (if non-%NULL) if it will be kept * * Since: 0.11.11 */ TpCapabilities * tp_protocol_get_capabilities (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->capabilities; } static gboolean init_gvalue_from_dbus_sig (const gchar *sig, GValue *value) { g_assert (!G_IS_VALUE (value)); switch (sig[0]) { case 'b': g_value_init (value, G_TYPE_BOOLEAN); return TRUE; case 's': g_value_init (value, G_TYPE_STRING); return TRUE; case 'q': case 'u': g_value_init (value, G_TYPE_UINT); return TRUE; case 'y': g_value_init (value, G_TYPE_UCHAR); return TRUE; case 'n': case 'i': g_value_init (value, G_TYPE_INT); return TRUE; case 'x': g_value_init (value, G_TYPE_INT64); return TRUE; case 't': g_value_init (value, G_TYPE_UINT64); return TRUE; case 'o': g_value_init (value, DBUS_TYPE_G_OBJECT_PATH); g_value_set_static_boxed (value, "/"); return TRUE; case 'd': g_value_init (value, G_TYPE_DOUBLE); return TRUE; case 'v': g_value_init (value, G_TYPE_VALUE); return TRUE; case 'a': switch (sig[1]) { case 's': g_value_init (value, G_TYPE_STRV); return TRUE; case 'o': g_value_init (value, TP_ARRAY_TYPE_OBJECT_PATH_LIST); return TRUE; case 'y': g_value_init (value, DBUS_TYPE_G_UCHAR_ARRAY); return TRUE; } } return FALSE; } static gboolean parse_default_value (GValue *value, const gchar *sig, gchar *raw_value, GKeyFile *file, const gchar *group, const gchar *key) { GError *error = NULL; gchar *s, *p; switch (sig[0]) { case 'b': g_value_set_boolean (value, g_key_file_get_boolean (file, group, key, &error)); if (error == NULL) return TRUE; /* In telepathy-glib < 0.7.26 we accepted true and false in * any case combination, 0, and 1. The desktop file spec specifies * "true" and "false" only, while GKeyFile currently accepts 0 and 1 too. * So, on error, let's fall back to more lenient parsing that explicitly * allows everything we historically allowed. */ g_error_free (error); if (raw_value == NULL) return FALSE; for (p = raw_value; *p != '\0'; p++) { *p = g_ascii_tolower (*p); } if (!tp_strdiff (raw_value, "1") || !tp_strdiff (raw_value, "true")) { g_value_set_boolean (value, TRUE); } else if (!tp_strdiff (raw_value, "0") || !tp_strdiff (raw_value, "false")) { g_value_set_boolean (value, TRUE); } else { return FALSE; } return TRUE; case 's': s = g_key_file_get_string (file, group, key, NULL); g_value_take_string (value, s); return (s != NULL); case 'y': case 'q': case 'u': case 't': { guint64 v = g_key_file_get_uint64 (file, group, key, &error); if (error != NULL) { g_error_free (error); return FALSE; } if (sig[0] == 't') { g_value_set_uint64 (value, v); return TRUE; } if (sig[0] == 'y') { if (v > G_MAXUINT8) { return FALSE; } g_value_set_uchar (value, v); return TRUE; } if (v > G_MAXUINT32 || (sig[0] == 'q' && v > G_MAXUINT16)) return FALSE; g_value_set_uint (value, v); return TRUE; } case 'n': case 'i': case 'x': if (raw_value[0] == '\0') { return FALSE; } else { gint64 v = g_key_file_get_int64 (file, group, key, &error); if (error != NULL) { g_error_free (error); return FALSE; } if (sig[0] == 'x') { g_value_set_int64 (value, v); return TRUE; } if (v > G_MAXINT32 || (sig[0] == 'q' && v > G_MAXINT16)) return FALSE; if (v < G_MININT32 || (sig[0] == 'n' && v < G_MININT16)) return FALSE; g_value_set_int (value, v); return TRUE; } case 'o': s = g_key_file_get_string (file, group, key, NULL); if (s == NULL || !tp_dbus_check_valid_object_path (s, NULL)) { g_free (s); return FALSE; } g_value_take_boxed (value, s); return TRUE; case 'd': g_value_set_double (value, g_key_file_get_double (file, group, key, &error)); if (error != NULL) { g_error_free (error); return FALSE; } return TRUE; case 'a': switch (sig[1]) { case 's': { g_value_take_boxed (value, g_key_file_get_string_list (file, group, key, NULL, &error)); if (error != NULL) { g_error_free (error); return FALSE; } return TRUE; } case 'o': { gsize len = 0; GStrv strv = g_key_file_get_string_list (file, group, key, &len, &error); gchar **iter; GPtrArray *arr; if (error != NULL) { g_error_free (error); return FALSE; } for (iter = strv; iter != NULL && *iter != NULL; iter++) { if (!g_variant_is_object_path (*iter)) { g_strfreev (strv); return FALSE; } } arr = g_ptr_array_sized_new (len); for (iter = strv; iter != NULL && *iter != NULL; iter++) { /* transfer ownership */ g_ptr_array_add (arr, *iter); } g_free (strv); g_value_take_boxed (value, arr); return TRUE; } } } if (G_IS_VALUE (value)) g_value_unset (value); return FALSE; } #define PROTOCOL_PREFIX "Protocol " #define PROTOCOL_PREFIX_LEN 9 tp_verify (sizeof (PROTOCOL_PREFIX) == PROTOCOL_PREFIX_LEN + 1); static gchar * replace_null_with_empty (gchar *in) { return (in == NULL ? g_strdup ("") : in); } static GHashTable * _tp_protocol_parse_channel_class (GKeyFile *file, const gchar *group) { GHashTable *ret; gchar **keys, **key; ret = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); keys = g_key_file_get_keys (file, group, NULL, NULL); for (key = keys; key != NULL && *key != NULL; key++) { gchar *space = strchr (*key, ' '); gchar *value = NULL; gchar *property = NULL; const gchar *dbus_type; GValue *v = g_slice_new0 (GValue); value = g_key_file_get_value (file, group, *key, NULL); /* keys without a space are reserved */ if (space == NULL) { DEBUG ("\t'%s' isn't a fixed property", *key); goto cleanup; } property = g_strndup (*key, space - *key); dbus_type = space + 1; if (!init_gvalue_from_dbus_sig (dbus_type, v)) { DEBUG ("\tunable to parse D-Bus type '%s' for '%s' in a " ".manager file", dbus_type, property); goto cleanup; } if (!parse_default_value (v, dbus_type, value, file, group, *key)) { DEBUG ("\tunable to parse '%s' as a value of type '%s' for '%s'", value, dbus_type, property); goto cleanup; } DEBUG ("\tfixed: '%s' of type '%s' = '%s'", property, dbus_type, value); /* transfer ownership to @ret */ g_hash_table_insert (ret, property, v); property = NULL; v = NULL; cleanup: if (v != NULL) { if (G_IS_VALUE (v)) tp_g_value_slice_free (v); else g_slice_free (GValue, v); } g_free (property); g_free (value); } g_strfreev (keys); return ret; } static GValueArray * _tp_protocol_parse_rcc (const gchar *cm_debug_name, const gchar *protocol_debug_name, GKeyFile *file, const gchar *group) { GHashTable *fixed; GStrv allowed; GValueArray *ret; guint i; DEBUG ("%s/%s: parsing requestable channel class '%s'", cm_debug_name, protocol_debug_name, group); fixed = _tp_protocol_parse_channel_class (file, group); allowed = g_key_file_get_string_list (file, group, "allowed", NULL, NULL); for (i = 0; allowed != NULL && allowed[i] != NULL; i++) { DEBUG ("\tallowed: '%s'", allowed[i]); } ret = tp_value_array_build (2, TP_HASH_TYPE_CHANNEL_CLASS, fixed, G_TYPE_STRV, allowed, NULL); g_hash_table_unref (fixed); g_strfreev (allowed); return ret; } GHashTable * _tp_protocol_parse_manager_file (GKeyFile *file, const gchar *cm_debug_name, const gchar *group, gchar **protocol_name) { GHashTable *immutables; GHashTable *status_specs; GPtrArray *param_specs, *rccs; const gchar *name; gchar **rcc_groups, **rcc_group; gchar **keys, **key; guint i; if (!g_str_has_prefix (group, PROTOCOL_PREFIX)) return NULL; name = group + PROTOCOL_PREFIX_LEN; if (!tp_connection_manager_check_valid_protocol_name (name, NULL)) { DEBUG ("%s: protocol '%s' has an invalid name", cm_debug_name, name); return NULL; } DEBUG ("%s: reading protocol '%s' from manager file", cm_debug_name, name); keys = g_key_file_get_keys (file, group, NULL, NULL); i = 0; for (key = keys; key != NULL && *key != NULL; key++) { if (g_str_has_prefix (*key, "param-")) i++; } param_specs = g_ptr_array_new_full (i, tp_value_array_free); for (key = keys; key != NULL && *key != NULL; key++) { if (g_str_has_prefix (*key, "param-")) { gchar **strv, **iter; gchar *value, *def; TpConnectionManagerParam param = { NULL }; value = g_key_file_get_string (file, group, *key, NULL); if (value == NULL) continue; /* strlen ("param-") == 6 */ param.name = *key + 6; strv = g_strsplit (value, " ", 0); g_free (value); param.dbus_signature = strv[0]; param.flags = 0; for (iter = strv + 1; *iter != NULL; iter++) { if (!tp_strdiff (*iter, "required")) param.flags |= TP_CONN_MGR_PARAM_FLAG_REQUIRED; if (!tp_strdiff (*iter, "register")) param.flags |= TP_CONN_MGR_PARAM_FLAG_REGISTER; if (!tp_strdiff (*iter, "secret")) param.flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; if (!tp_strdiff (*iter, "dbus-property")) param.flags |= TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY; } if ((!tp_strdiff (param.name, "password") || g_str_has_suffix (param.name, "-password")) && (param.flags & TP_CONN_MGR_PARAM_FLAG_SECRET) == 0) { DEBUG ("\tTreating %s as secret due to its name (please " "fix %s.manager)", param.name, cm_debug_name); param.flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; } def = g_strdup_printf ("default-%s", param.name); value = g_key_file_get_value (file, group, def, NULL); init_gvalue_from_dbus_sig (param.dbus_signature, ¶m.default_value); if (value != NULL && parse_default_value (¶m.default_value, param.dbus_signature, value, file, group, def)) param.flags |= TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT; DEBUG ("\tParam name: %s", param.name); DEBUG ("\tParam flags: 0x%x", param.flags); DEBUG ("\tParam sig: %s", param.dbus_signature); #ifdef ENABLE_DEBUG if (G_IS_VALUE (¶m.default_value)) { gchar *repr = g_strdup_value_contents (&(param.default_value)); DEBUG ("\tParam default value: %s of type %s", repr, G_VALUE_TYPE_NAME (&(param.default_value))); g_free (repr); } else { DEBUG ("\tParam default value: not set"); } #endif g_ptr_array_add (param_specs, tp_value_array_build (4, G_TYPE_STRING, param.name, G_TYPE_UINT, param.flags, G_TYPE_STRING, param.dbus_signature, G_TYPE_VALUE, ¶m.default_value, G_TYPE_INVALID)); if (G_IS_VALUE (¶m.default_value)) g_value_unset (¶m.default_value); g_free (value); g_free (def); g_strfreev (strv); } } immutables = tp_asv_new ( TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST, param_specs, NULL); g_ptr_array_unref(param_specs); tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_INTERFACES, G_TYPE_STRV, g_key_file_get_string_list (file, group, "Interfaces", NULL, NULL)); tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_CONNECTION_INTERFACES, G_TYPE_STRV, g_key_file_get_string_list (file, group, "ConnectionInterfaces", NULL, NULL)); tp_asv_take_string (immutables, TP_PROP_PROTOCOL_VCARD_FIELD, replace_null_with_empty ( g_key_file_get_string (file, group, "VCardField", NULL))); tp_asv_take_string (immutables, TP_PROP_PROTOCOL_ENGLISH_NAME, replace_null_with_empty ( g_key_file_get_string (file, group, "EnglishName", NULL))); tp_asv_take_string (immutables, TP_PROP_PROTOCOL_ICON, replace_null_with_empty ( g_key_file_get_string (file, group, "Icon", NULL))); tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_AUTHENTICATION_TYPES, G_TYPE_STRV, g_key_file_get_string_list (file, group, "AuthenticationTypes", NULL, NULL)); /* Avatars */ tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_SUPPORTED_AVATAR_MIME_TYPES, G_TYPE_STRV, g_key_file_get_string_list (file, group, "SupportedAvatarMIMETypes", NULL, NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_HEIGHT, g_key_file_get_uint64 (file, group, "MinimumAvatarHeight", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MINIMUM_AVATAR_WIDTH, g_key_file_get_uint64 (file, group, "MinimumAvatarWidth", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_HEIGHT, g_key_file_get_uint64 (file, group, "RecommendedAvatarHeight", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_RECOMMENDED_AVATAR_WIDTH, g_key_file_get_uint64 (file, group, "RecommendedAvatarWidth", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_HEIGHT, g_key_file_get_uint64 (file, group, "MaximumAvatarHeight", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_WIDTH, g_key_file_get_uint64 (file, group, "MaximumAvatarWidth", NULL)); tp_asv_set_uint32 (immutables, TP_PROP_PROTOCOL_INTERFACE_AVATARS_MAXIMUM_AVATAR_BYTES, g_key_file_get_uint64 (file, group, "MaximumAvatarBytes", NULL)); rccs = g_ptr_array_new (); rcc_groups = g_key_file_get_string_list (file, group, "RequestableChannelClasses", NULL, NULL); if (rcc_groups != NULL) { for (rcc_group = rcc_groups; *rcc_group != NULL; rcc_group++) g_ptr_array_add (rccs, _tp_protocol_parse_rcc (cm_debug_name, name, file, *rcc_group)); } g_strfreev (rcc_groups); /* Statuses */ status_specs = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_value_array_free); for (key = keys; key != NULL && *key != NULL; key++) { if (g_str_has_prefix (*key, "status-")) { GValueArray *ubb; gint64 type; gboolean on_self = FALSE, has_message = FALSE; gchar *value, *endptr; gchar **strv, **iter; if (!tp_strdiff (*key, "status-")) { DEBUG ("'status-' is not a valid status"); continue; } value = g_key_file_get_value (file, group, *key, NULL); strv = g_strsplit (value, " ", 0); g_free (value); type = g_ascii_strtoll (strv[0], &endptr, 10); if (endptr <= strv[0] || *endptr != '\0') { DEBUG ("invalid (non-numeric?) status type %s", strv[0]); goto next_status; } if (type == TP_CONNECTION_PRESENCE_TYPE_UNSET || type < 0 || type >= TP_NUM_CONNECTION_PRESENCE_TYPES) { DEBUG ("presence type out of range: %" G_GINT64_FORMAT, type); goto next_status; } for (iter = strv + 1; *iter != NULL; iter++) { if (!tp_strdiff (*iter, "settable")) on_self = TRUE; else if (!tp_strdiff (*iter, "message")) has_message = TRUE; else DEBUG ("unknown status modifier '%s'", *iter); } ubb = tp_value_array_build (3, G_TYPE_UINT, (guint) type, G_TYPE_BOOLEAN, on_self, G_TYPE_BOOLEAN, has_message, G_TYPE_INVALID); /* strlen ("status-") == 7 */ g_hash_table_insert (status_specs, g_strdup (*key + 7), ubb); DEBUG ("Status '%s': type %u%s%s", *key + 7, (guint) type, on_self ? ", can set on self" : "", has_message ? ", has message" : ""); next_status: g_strfreev (strv); } } if (g_hash_table_size (status_specs) > 0) tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_INTERFACE_PRESENCE_STATUSES, TP_HASH_TYPE_SIMPLE_STATUS_SPEC_MAP, status_specs); else g_hash_table_unref (status_specs); g_strfreev (keys); tp_asv_take_boxed (immutables, TP_PROP_PROTOCOL_REQUESTABLE_CHANNEL_CLASSES, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, rccs); if (protocol_name != NULL) *protocol_name = g_strdup (name); return immutables; } /** * tp_protocol_get_avatar_requirements: * @self: a #TpProtocol * * Return the #TpProtocol:avatar-requirements property * * Returns: (transfer none): the value of #TpProtocol:avatar-requirements * * Since: 0.15.6 */ TpAvatarRequirements * tp_protocol_get_avatar_requirements (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->avatar_req; } /** * tp_protocol_get_cm_name: * @self: a #TpProtocol * * Return the #TpProtocol:cm-name property. * * Returns: the value of #TpProtocol:cm-name * * Since: 0.19.1 */ const gchar * tp_protocol_get_cm_name (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return self->priv->cm_name; } /* * Handle the result from a tp_cli_protocol_* function that * returns one string. user_data is a #GTask. */ static void tp_protocol_async_string_cb (TpProxy *proxy, const gchar *normalized, const GError *error, gpointer user_data, GObject *weak_object G_GNUC_UNUSED) { if (error == NULL) g_task_return_pointer (user_data, g_strdup (normalized), g_free); else g_task_return_error (user_data, g_error_copy (error)); } /** * tp_protocol_normalize_contact_async: * @self: a protocol * @contact: a contact identifier, possibly invalid * @cancellable: (allow-none): may be used to cancel the async request * @callback: (scope async): a callback to call when * the request is satisfied * @user_data: (closure) (allow-none): data to pass to @callback * * Perform best-effort offline contact normalization. This does syntactic * normalization (e.g. transforming case-insensitive text to lower-case), * but does not query servers or anything similar. * * Since: 0.23.1 */ void tp_protocol_normalize_contact_async (TpProtocol *self, const gchar *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask *task; g_return_if_fail (TP_IS_PROTOCOL (self)); g_return_if_fail (contact != NULL); /* this makes no sense to call for its side-effects */ g_return_if_fail (callback != NULL); task = g_task_new (self, cancellable, callback, user_data); g_task_set_source_tag (task, tp_protocol_normalize_contact_async); tp_cli_protocol_call_normalize_contact (self, -1, contact, tp_protocol_async_string_cb, task, g_object_unref, NULL); } /** * tp_protocol_normalize_contact_finish: * @self: a protocol * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_protocol_normalize_contact_async(). * * Returns: (transfer full): the normalized form of @contact, * or %NULL on error * Since: 0.23.1 */ gchar * tp_protocol_normalize_contact_finish (TpProtocol *self, GAsyncResult *result, GError **error) { g_return_val_if_fail (g_task_is_valid (result, self), NULL); g_return_val_if_fail (g_async_result_is_tagged (result, tp_protocol_normalize_contact_async), NULL); return g_task_propagate_pointer (G_TASK (result), error); } /** * tp_protocol_identify_account_async: * @self: a protocol * @vardict: the account parameters as a #GVariant of * type %G_VARIANT_TYPE_VARDICT. If it is floating, ownership will * be taken, as if via g_variant_ref_sink(). * @cancellable: (allow-none): may be used to cancel the async request * @callback: (scope async): a callback to call when * the request is satisfied * @user_data: (closure) (allow-none): data to pass to @callback * * Return a string that could identify the account with the given * parameters. In most protocols that string is a normalized 'account' * parameter, but some protocols have more complex requirements; * for instance, on IRC, the 'account' (nickname) is insufficient, * and must be combined with a server or network name. * * Since: 0.23.1 */ void tp_protocol_identify_account_async (TpProtocol *self, GVariant *vardict, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask *task; GHashTable *asv; g_return_if_fail (TP_IS_PROTOCOL (self)); g_return_if_fail (vardict != NULL); g_return_if_fail (g_variant_is_of_type (vardict, G_VARIANT_TYPE_VARDICT)); /* this makes no sense to call for its side-effects */ g_return_if_fail (callback != NULL); task = g_task_new (self, cancellable, callback, user_data); g_task_set_source_tag (task, tp_protocol_identify_account_async); g_variant_ref_sink (vardict); asv = _tp_asv_from_vardict (vardict); tp_cli_protocol_call_identify_account (self, -1, asv, tp_protocol_async_string_cb, task, g_object_unref, NULL); g_hash_table_unref (asv); g_variant_unref (vardict); } /** * tp_protocol_identify_account_finish: * @self: a protocol * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_protocol_identify_account_async(). * * Returns: (transfer full): a string identifying the account, * or %NULL on error * Since: 0.23.1 */ gchar * tp_protocol_identify_account_finish (TpProtocol *self, GAsyncResult *result, GError **error) { g_return_val_if_fail (g_task_is_valid (result, self), NULL); g_return_val_if_fail (g_async_result_is_tagged (result, tp_protocol_identify_account_async), NULL); return g_task_propagate_pointer (G_TASK (result), error); } /** * tp_protocol_normalize_contact_uri_async: * @self: a protocol * @uri: a contact URI, possibly invalid * @cancellable: (allow-none): may be used to cancel the async request * @callback: (scope async): a callback to call when the request is satisfied * @user_data: (closure) (allow-none): data to pass to @callback * * Perform best-effort offline contact normalization, for a contact in * the form of a URI. This method will fail if the URI is not in a * scheme supported by this protocol or connection manager. * * Since: 0.23.1 */ void tp_protocol_normalize_contact_uri_async (TpProtocol *self, const gchar *uri, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask *task; g_return_if_fail (TP_IS_PROTOCOL (self)); g_return_if_fail (uri != NULL); /* this makes no sense to call for its side-effects */ g_return_if_fail (callback != NULL); task = g_task_new (self, cancellable, callback, user_data); g_task_set_source_tag (task, tp_protocol_normalize_contact_uri_async); tp_cli_protocol_interface_addressing_call_normalize_contact_uri (self, -1, uri, tp_protocol_async_string_cb, task, g_object_unref, NULL); } /** * tp_protocol_normalize_contact_uri_finish: * @self: a protocol * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_protocol_normalize_contact_uri_async(). * * Returns: (transfer full): the normalized form of @uri, * or %NULL on error * Since: 0.23.1 */ gchar * tp_protocol_normalize_contact_uri_finish (TpProtocol *self, GAsyncResult *result, GError **error) { g_return_val_if_fail (g_task_is_valid (result, self), NULL); g_return_val_if_fail (g_async_result_is_tagged (result, tp_protocol_normalize_contact_uri_async), NULL); return g_task_propagate_pointer (G_TASK (result), error); } /** * tp_protocol_normalize_vcard_address_async: * @self: a protocol * @field: a vCard field * @value: an address that is a value of @field * @cancellable: (allow-none): may be used to cancel the async request * @callback: (scope async): a callback to call when the request is satisfied * @user_data: (closure) (allow-none): data to pass to @callback * * Perform best-effort offline contact normalization, for a contact in * the form of a vCard field. This method will fail if the vCard field * is not supported by this protocol or connection manager. * * Since: 0.23.1 */ void tp_protocol_normalize_vcard_address_async (TpProtocol *self, const gchar *field, const gchar *value, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GTask *task; g_return_if_fail (TP_IS_PROTOCOL (self)); g_return_if_fail (!tp_str_empty (field)); g_return_if_fail (value != NULL); /* this makes no sense to call for its side-effects */ g_return_if_fail (callback != NULL); task = g_task_new (self, cancellable, callback, user_data); g_task_set_source_tag (task, tp_protocol_normalize_vcard_address_async); tp_cli_protocol_interface_addressing_call_normalize_vcard_address (self, -1, field, value, tp_protocol_async_string_cb, task, g_object_unref, NULL); } /** * tp_protocol_normalize_vcard_address_finish: * @self: a protocol * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_protocol_normalize_vcard_address_async(). * * Returns: (transfer full): the normalized form of @value, * or %NULL on error * Since: 0.23.1 */ gchar * tp_protocol_normalize_vcard_address_finish (TpProtocol *self, GAsyncResult *result, GError **error) { g_return_val_if_fail (g_task_is_valid (result, self), NULL); g_return_val_if_fail (g_async_result_is_tagged (result, tp_protocol_normalize_vcard_address_async), NULL); return g_task_propagate_pointer (G_TASK (result), error); } /** * tp_protocol_get_addressable_vcard_fields: * @self: a protocol object * * * * Returns: (transfer none): the value of #TpProtocol:addressable-vcard-fields * Since: 0.23.1 */ const gchar * const * tp_protocol_get_addressable_vcard_fields (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return (const gchar * const *) self->priv->addressable_vcard_fields; } /** * tp_protocol_get_addressable_uri_schemes: * @self: a protocol object * * * * Returns: (transfer none): the value of #TpProtocol:addressable-uri-schemes * Since: 0.23.1 */ const gchar * const * tp_protocol_get_addressable_uri_schemes (TpProtocol *self) { g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); return (const gchar * const *) self->priv->addressable_uri_schemes; } /** * tp_protocol_dup_presence_statuses: * @self: a protocol object * * Return the presence statuses that might be supported by connections * to this protocol. * * It is possible that some of these statuses will not actually be supported * by a connection: for instance, an XMPP connection manager would * include "hidden" in this list, even though not all XMPP servers allow * users to be online-but-hidden. * * Returns: (transfer full) (element-type TelepathyGLib.PresenceStatusSpec): a * list of statuses, or %NULL if unknown */ GList * tp_protocol_dup_presence_statuses (TpProtocol *self) { GHashTableIter iter; gpointer k, v; GList *l = NULL; g_return_val_if_fail (TP_IS_PROTOCOL (self), NULL); if (self->priv->presence_statuses == NULL) return NULL; g_hash_table_iter_init (&iter, self->priv->presence_statuses); while (g_hash_table_iter_next (&iter, &k, &v)) { guint type; gboolean on_self, message; tp_value_array_unpack (v, 3, &type, &on_self, &message); l = g_list_prepend (l, tp_presence_status_spec_new (k, type, on_self, message)); } return g_list_reverse (l); } /** * tp_protocol_dup_immutable_properties: * @self: a #TpProtocol object * * Return the #TpProtocol:protocol-properties-vardict property. * * Returns: (transfer full): the value of * #TpProtocol:protocol-properties-vardict * Since: 0.23.3 */ GVariant * tp_protocol_dup_immutable_properties (TpProtocol *self) { return _tp_asv_to_vardict (self->priv->protocol_properties); } telepathy-glib-0.24.2/telepathy-glib/protocol.h0000644000175000017500000001442012652510705016362 00000000000000/* TpProtocol * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_PROTOCOL_H #define TP_PROTOCOL_H #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpConnectionManagerParam TpConnectionManagerParam; struct _TpConnectionManagerParam { /**/ gchar *_TP_SEAL (name); gchar *_TP_SEAL (dbus_signature); GValue _TP_SEAL (default_value); guint _TP_SEAL (flags); gpointer _TP_SEAL (priv); }; typedef struct _TpProtocol TpProtocol; typedef struct _TpProtocolClass TpProtocolClass; typedef struct _TpProtocolPrivate TpProtocolPrivate; typedef struct _TpProtocolClassPrivate TpProtocolClassPrivate; GType tp_protocol_get_type (void) G_GNUC_CONST; #define TP_TYPE_PROTOCOL \ (tp_protocol_get_type ()) #define TP_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_PROTOCOL, \ TpProtocol)) #define TP_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_PROTOCOL, \ TpProtocolClass)) #define TP_IS_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_PROTOCOL)) #define TP_IS_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_PROTOCOL)) #define TP_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_PROTOCOL, \ TpProtocolClass)) struct _TpProtocol { /**/ TpProxy parent; TpProtocolPrivate *priv; }; void tp_protocol_init_known_interfaces (void); TpProtocol *tp_protocol_new (TpDBusDaemon *dbus, const gchar *cm_name, const gchar *protocol_name, const GHashTable *immutable_properties, GError **error); _TP_AVAILABLE_IN_0_24 TpProtocol * tp_protocol_new_vardict (TpDBusDaemon *dbus, const gchar *cm_name, const gchar *protocol_name, GVariant *immutable_properties, GError **error); const gchar *tp_protocol_get_name (TpProtocol *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_protocol_get_cm_name (TpProtocol *self); #define TP_PROTOCOL_FEATURE_PARAMETERS \ (tp_protocol_get_feature_quark_parameters ()) GQuark tp_protocol_get_feature_quark_parameters (void) G_GNUC_CONST; const TpConnectionManagerParam *tp_protocol_get_param (TpProtocol *self, const gchar *param); _TP_AVAILABLE_IN_0_18 TpConnectionManagerParam *tp_protocol_dup_param (TpProtocol *self, const gchar *param); gboolean tp_protocol_has_param (TpProtocol *self, const gchar *param); gboolean tp_protocol_can_register (TpProtocol *self); GStrv tp_protocol_dup_param_names (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_18 GList *tp_protocol_dup_params (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_24 GVariant * tp_protocol_dup_immutable_properties (TpProtocol *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_protocol_dup_params) _TP_AVAILABLE_IN_0_18 const TpConnectionManagerParam *tp_protocol_borrow_params (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; #endif const gchar * const * /* gtk-doc sucks */ tp_protocol_get_authentication_types (TpProtocol *self); _TP_AVAILABLE_IN_0_24 const gchar * const * /* ... */ tp_protocol_get_addressable_vcard_fields (TpProtocol *self); _TP_AVAILABLE_IN_0_24 const gchar * const * /* ... */ tp_protocol_get_addressable_uri_schemes (TpProtocol *self); _TP_AVAILABLE_IN_0_24 GList *tp_protocol_dup_presence_statuses (TpProtocol *self) G_GNUC_WARN_UNUSED_RESULT; #define TP_PROTOCOL_FEATURE_CORE \ (tp_protocol_get_feature_quark_core ()) GQuark tp_protocol_get_feature_quark_core (void) G_GNUC_CONST; const gchar *tp_protocol_get_vcard_field (TpProtocol *self); const gchar *tp_protocol_get_english_name (TpProtocol *self); const gchar *tp_protocol_get_icon_name (TpProtocol *self); TpCapabilities *tp_protocol_get_capabilities (TpProtocol *self); _TP_AVAILABLE_IN_0_16 TpAvatarRequirements * tp_protocol_get_avatar_requirements (TpProtocol *self); _TP_AVAILABLE_IN_0_24 void tp_protocol_normalize_contact_async (TpProtocol *self, const gchar *contact, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_24 gchar *tp_protocol_normalize_contact_finish (TpProtocol *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_24 void tp_protocol_identify_account_async (TpProtocol *self, GVariant *vardict, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_24 gchar *tp_protocol_identify_account_finish (TpProtocol *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_24 void tp_protocol_normalize_contact_uri_async (TpProtocol *self, const gchar *uri, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_24 gchar *tp_protocol_normalize_contact_uri_finish (TpProtocol *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_24 void tp_protocol_normalize_vcard_address_async (TpProtocol *self, const gchar *field, const gchar *value, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_24 gchar *tp_protocol_normalize_vcard_address_finish (TpProtocol *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/svc-channel-dispatch-operation.h0000644000175000017500000000056412652510705022521 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CHANNEL_DISPATCH_OPERATION_H__ #define __TP_META_SVC_CHANNEL_DISPATCH_OPERATION_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/account-manager-internal.h0000644000175000017500000000212412652510705021375 00000000000000/**/ /* * TpAccountManager - proxy for a Telepathy account manager (internals) * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_ACCOUNT_MANAGER_INTERNAL_H #define TP_ACCOUNT_MANAGER_INTERNAL_H #include G_BEGIN_DECLS G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel.c0000644000175000017500000026630412652510705016136 00000000000000/* * channel.c - proxy for a Telepathy channel * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-internal.h" #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/variant-util-internal.h" #include "_gen/tp-cli-channel-body.h" /** * SECTION:channel * @title: TpChannel * @short_description: proxy object for a Telepathy channel * @see_also: #TpConnection, channel-group, channel-text, channel-media * * #TpChannel objects provide convenient access to Telepathy channels. * * Compared with a simple proxy for method calls, they add the following * features: * * * calling GetChannelType(), GetInterfaces(), GetHandles() automatically * * This section also documents the auto-generated C wrappers for the * Channel D-Bus interface. Of these, in general, only * tp_cli_channel_call_close() and tp_cli_channel_run_close() are useful (the * #TpChannel object provides a more convenient API for the rest). * * Since: 0.7.1 */ /** * TpChannelClass: * @parent_class: parent class * * The class of a #TpChannel. In addition to @parent_class there are four * pointers reserved for possible future use. * * (Changed in 0.7.12: the layout of the structure is visible, allowing * subclassing.) * * Since: 0.7.1 */ /** * TpChannel: * * A proxy object for a Telepathy channel. * A proxy object for a Telepathy channel. There are no interesting * public struct fields. * * (Changed in 0.7.12: the layout of the structure is visible, allowing * subclassing.) * * Since: 0.7.1 */ enum { PROP_CONNECTION = 1, PROP_CHANNEL_TYPE, PROP_HANDLE_TYPE, PROP_HANDLE, PROP_IDENTIFIER, PROP_CHANNEL_READY, PROP_CHANNEL_PROPERTIES, PROP_GROUP_SELF_HANDLE, PROP_GROUP_FLAGS, PROP_REQUESTED, PROP_INITIATOR_HANDLE, PROP_INITIATOR_IDENTIFIER, PROP_PASSWORD_NEEDED, PROP_TARGET_CONTACT, PROP_INITIATOR_CONTACT, PROP_GROUP_SELF_CONTACT, N_PROPS }; enum { SIGNAL_GROUP_FLAGS_CHANGED, SIGNAL_GROUP_MEMBERS_CHANGED, SIGNAL_GROUP_MEMBERS_CHANGED_DETAILED, SIGNAL_GROUP_CONTACTS_CHANGED, SIGNAL_CHAT_STATE_CHANGED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; G_DEFINE_TYPE_WITH_CODE (TpChannel, tp_channel, TP_TYPE_PROXY, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL)) /** * TP_CHANNEL_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpChannel. * * When this feature is prepared, the basic Channel properties of the * Channel have been retrieved and are available for use. * * Specifically, this implies that: * * - #TpChannelIface:channel-type is set * - #TpChannelIface:handle-type and #TpChannelIface:handle are set * - any extra interfaces will have been set up in TpProxy (i.e. * #TpProxy:interfaces contains at least all extra Channel interfaces) * * (These are a subset of the guarantees offered by the older * #TpChannel:channel-ready * and tp_channel_call_when_ready() mechanisms, which are now equivalent to * (%TP_CHANNEL_FEATURE_CORE, %TP_CHANNEL_FEATURE_GROUP) if the channel is * a group, or just %TP_CHANNEL_FEATURE_CORE otherwise.) * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_channel_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-channel-feature-core"); } /** * TP_CHANNEL_FEATURE_GROUP: * * Expands to a call to a function that returns a quark representing the Group * features of a TpChannel. * * When this feature is prepared, the Group properties of the * Channel have been retrieved and are available for use, and * change-notification has been set up for those that can change: * * - the initial value of the #TpChannel:group-self-handle property will * have been fetched and change notification will have been set up * - the initial value of the #TpChannel:group-flags property will * have been fetched and change notification will have been set up * * (These are the same guarantees offered for Group channels by the older * #TpChannel:channel-ready and tp_channel_call_when_ready() mechanisms.) * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_channel_get_feature_quark_group (void) { return g_quark_from_static_string ("tp-channel-feature-group"); } /** * TP_CHANNEL_FEATURE_CONTACTS: * * Expands to a call to a function that returns a quark representing the * Contacts features of a TpChannel. * * When this feature is prepared, the #TpContact objects of this channel are * guaranteed to have all of the features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * On older connection managers, this feature may fail to prepare. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.6 */ GQuark tp_channel_get_feature_quark_contacts (void) { return g_quark_from_static_string ("tp-channel-feature-contacts"); } /** * TP_CHANNEL_FEATURE_CHAT_STATES: * * Expands to a call to a function that returns a quark representing the * chat states feature on a #TpChannel. * * When this feature is prepared, tp_channel_get_chat_state() and the * #TpChannel::chat-state-changed signal become useful. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 * Deprecated: Use TP_TEXT_CHANNEL_FEATURE_CHAT_STATES instead. */ GQuark tp_channel_get_feature_quark_chat_states (void) { return g_quark_from_static_string ("tp-channel-feature-chat-states"); } /* Convenient property accessors for C (these duplicate the properties) */ /** * tp_channel_get_channel_type: * @self: a channel * * Get the D-Bus interface name representing this channel's type, * if it has been discovered. * * This is the same as the #TpChannelIface:channel-type property; it isn't * guaranteed to be non-%NULL until the %TP_CHANNEL_FEATURE_CORE feature has * been prepared. * * Returns: the channel type, if the channel is ready; either the channel * type or %NULL, if the channel is not yet ready. * Since: 0.7.12 */ const gchar * tp_channel_get_channel_type (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return g_quark_to_string (self->priv->channel_type); } /** * tp_channel_get_channel_type_id: * @self: a channel * * Get the D-Bus interface name representing this channel's type, as a GQuark, * if it has been discovered. * * This is the same as the #TpChannelIface:channel-type property, except that it * is a GQuark rather than a string. It isn't guaranteed to be nonzero until * the %TP_CHANNEL_FEATURE_CORE property is ready. * * Returns: the channel type, if the channel is ready; either the channel * type or 0, if the channel is not yet ready. * Since: 0.7.12 */ GQuark tp_channel_get_channel_type_id (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), 0); return self->priv->channel_type; } /** * tp_channel_get_handle: * @self: a channel * @handle_type: (out): if not %NULL, used to return the type of this handle * * Get the handle representing the contact, chatroom, etc. with which this * channel communicates for its whole lifetime, or 0 if there is no such * handle or it has not yet been discovered. * * This is the same as the #TpChannelIface:handle property. It isn't * guaranteed to have its final value until the %TP_CHANNEL_FEATURE_CORE * feature is ready. * * If @handle_type is not %NULL, the type of handle is written into it. * This will be %TP_UNKNOWN_HANDLE_TYPE if the handle has not yet been * discovered, or %TP_HANDLE_TYPE_NONE if there is no handle with which this * channel will always communicate. This is the same as the * #TpChannelIface:handle-type property. * * Returns: the handle * Since: 0.7.12 */ TpHandle tp_channel_get_handle (TpChannel *self, TpHandleType *handle_type) { g_return_val_if_fail (TP_IS_CHANNEL (self), 0); if (handle_type != NULL) { *handle_type = self->priv->handle_type; } return self->priv->handle; } /** * tp_channel_get_identifier: * @self: a channel * * This channel's associated identifier, or the empty string if no identifier * or unknown. * * This is the same as the #TpChannel:identifier property, and isn't guaranteed * to be set until the %TP_CHANNEL_FEATURE_CORE property is ready. * * Changed in 0.11.4: as with #TpChannel:identifier, this could * previously either be %NULL or the empty string if there was no suitable * value. It is now non-%NULL in all cases. * * Returns: the identifier * Since: 0.7.21 */ const gchar * tp_channel_get_identifier (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); if (self->priv->identifier == NULL) return ""; return self->priv->identifier; } /** * tp_channel_is_ready: (skip) * @self: a channel * * Returns the same thing as the #TpChannel:channel-ready property. * * New code should use tp_proxy_is_prepared(), which is a more general form of * this method. * * For group channels, this method is equivalent to checking for the * combination of %TP_CHANNEL_FEATURE_CORE and %TP_CHANNEL_FEATURE_GROUP; for * non-group channels, it's equivalent to checking for * %TP_CHANNEL_FEATURE_CORE. * * One important difference is that after #TpProxy::invalidated is * signalled, #TpChannel:channel-ready keeps its current value - which might * be %TRUE, if the channel was successfully prepared before it became * invalidated - but tp_proxy_is_prepared() returns %FALSE for all features. * * Returns: %TRUE if introspection has completed * Since: 0.7.12 * Deprecated: 0.17.6: use tp_proxy_is_prepared() with * %TP_CHANNEL_FEATURE_CORE */ gboolean tp_channel_is_ready (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), FALSE); return self->priv->ready; } /** * tp_channel_borrow_connection: * @self: a channel * * Returns the connection for this channel. The returned pointer is only valid * while this channel is valid - reference it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannel:connection * Since: 0.7.12 * Deprecated: Since 0.19.9. New code should use * tp_channel_get_connection() instead. */ TpConnection * tp_channel_borrow_connection (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->connection; } /** * tp_channel_get_connection: * @self: a channel * * Returns the connection for this channel. The returned pointer is only valid * while this channel is valid - reference it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannel:connection * Since: 0.19.9 */ TpConnection * tp_channel_get_connection (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->connection; } /** * tp_channel_borrow_immutable_properties: * @self: a channel * * Returns the immutable D-Bus properties of this channel, the same as * #TpChannel:channel-properties. * * The returned hash table should not be altered, and is not necessarily * valid after the main loop is next re-entered. Copy it with * g_boxed_copy() (its type is %TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP) * if a copy that remains valid must be kept. * * If the #TpChannel:channel-properties property was not set during * construction (e.g. by calling tp_channel_new_from_properties()), a * reasonable but possibly incomplete version will be made up from the values * of individual properties; reading this property repeatedly may yield * progressively more complete values until the %TP_CHANNEL_FEATURE_CORE * feature is prepared. * * Returns: (transfer none) (element-type utf8 GObject.Value): a #GHashTable * where the keys are strings, * D-Bus interface name + "." + property name, and the values are #GValue * instances * Deprecated: Since 0.19.9. New code should use * tp_channel_dup_immutable_properties() instead. */ GHashTable * tp_channel_borrow_immutable_properties (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->channel_properties; } GHashTable * _tp_channel_get_immutable_properties (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->channel_properties; } /** * tp_channel_dup_immutable_properties: * @self: a channel * * Returns the immutable D-Bus properties of this channel, in a variant of type * %G_VARIANT_TYPE_VARDICT where the keys are strings, * D-Bus interface name + "." + property name. Use g_variant_lookup() or * g_variant_lookup_value() for convenient access to the values. * * If the #TpChannel:channel-properties property was not set during * construction (e.g. by calling tp_channel_new_from_properties()), a * reasonable but possibly incomplete version will be made up from the values * of individual properties; reading this property repeatedly may yield * progressively more complete values until the %TP_CHANNEL_FEATURE_CORE * feature is prepared. * * This function should be used only by #TpChannel subclasses, otherwise it is * recommended to use individual property getters instead. * * Returns: (transfer full): a dictionary where the keys are strings, * D-Bus interface name + "." + property name. * Since: 0.19.9 */ GVariant * tp_channel_dup_immutable_properties (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return _tp_asv_to_vardict (self->priv->channel_properties); } static void tp_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpChannel *self = TP_CHANNEL (object); /* We still need to use deprecated getters funcs */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; case PROP_CHANNEL_READY: g_value_set_boolean (value, self->priv->ready); break; case PROP_CHANNEL_TYPE: g_value_set_static_string (value, g_quark_to_string (self->priv->channel_type)); break; case PROP_HANDLE_TYPE: g_value_set_uint (value, self->priv->handle_type); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; case PROP_IDENTIFIER: g_value_set_string (value, tp_channel_get_identifier (self)); break; case PROP_CHANNEL_PROPERTIES: g_value_set_boxed (value, self->priv->channel_properties); break; case PROP_GROUP_SELF_HANDLE: g_value_set_uint (value, self->priv->group_self_handle); break; case PROP_GROUP_FLAGS: g_value_set_uint (value, self->priv->group_flags); break; case PROP_REQUESTED: g_value_set_boolean (value, tp_channel_get_requested (self)); break; case PROP_INITIATOR_HANDLE: g_value_set_uint (value, tp_channel_get_initiator_handle (self)); break; case PROP_INITIATOR_IDENTIFIER: g_value_set_string (value, tp_channel_get_initiator_identifier (self)); break; case PROP_PASSWORD_NEEDED: g_value_set_boolean (value, tp_channel_password_needed (self)); break; case PROP_TARGET_CONTACT: g_value_set_object (value, tp_channel_get_target_contact (self)); break; case PROP_INITIATOR_CONTACT: g_value_set_object (value, tp_channel_get_initiator_contact (self)); break; case PROP_GROUP_SELF_CONTACT: g_value_set_object (value, tp_channel_group_get_self_contact (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_channel_get_chat_state: * @self: a channel * @contact: a contact handle * * Return the chat state for the given contact. If tp_proxy_is_prepared() * would return %FALSE for the feature %TP_CHANNEL_FEATURE_CHAT_STATES, * the result will always be %TP_CHANNEL_CHAT_STATE_INACTIVE. * * Returns: the chat state for @contact, or %TP_CHANNEL_CHAT_STATE_INACTIVE * if their chat state is not known * Since: 0.11.3 * Deprecated: Use tp_text_channel_get_chat_state() instead. */ TpChannelChatState tp_channel_get_chat_state (TpChannel *self, TpHandle contact) { gpointer value; g_return_val_if_fail (TP_IS_CHANNEL (self), 0); if (self->priv->chat_states != NULL && g_hash_table_lookup_extended (self->priv->chat_states, GUINT_TO_POINTER (contact), NULL, &value)) { return GPOINTER_TO_UINT (value); } return TP_CHANNEL_CHAT_STATE_INACTIVE; } /* These functions, maybe_set_whatever, ignore attempts to set a null value. * This means we can indiscriminately set everything from every source * (channel-properties, other construct-time properties, GetAll fast path, * 0.16.x slow path), and if only one of the sources supplied a value, it'll * still all be fine. */ static void _tp_channel_maybe_set_channel_type (TpChannel *self, const gchar *type) { GQuark q = g_quark_from_string (type); if (type == NULL) return; self->priv->channel_type = q; g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_CHANNEL_TYPE), tp_g_value_slice_new_static_string (g_quark_to_string (q))); tp_proxy_add_interface_by_id ((TpProxy *) self, self->priv->channel_type); } static void _tp_channel_maybe_set_handle (TpChannel *self, TpHandle handle, gboolean valid) { if (valid) { self->priv->handle = handle; g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE), tp_g_value_slice_new_uint (handle)); } } static void _tp_channel_maybe_set_handle_type (TpChannel *self, TpHandleType handle_type, gboolean valid) { if (valid) { self->priv->handle_type = handle_type; g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE_TYPE), tp_g_value_slice_new_uint (handle_type)); } } static void _tp_channel_maybe_set_identifier (TpChannel *self, const gchar *identifier) { if (identifier != NULL && self->priv->identifier == NULL) { self->priv->identifier = g_strdup (identifier); g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_TARGET_ID), tp_g_value_slice_new_string (identifier)); } } static void _tp_channel_maybe_set_interfaces (TpChannel *self, const gchar **interfaces) { if (interfaces == NULL) return; tp_proxy_add_interfaces ((TpProxy *) self, interfaces); g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_INTERFACES), tp_g_value_slice_new_boxed (G_TYPE_STRV, interfaces)); } static void tp_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpChannel *self = TP_CHANNEL (object); switch (property_id) { case PROP_CONNECTION: self->priv->connection = TP_CONNECTION (g_value_dup_object (value)); break; case PROP_CHANNEL_TYPE: _tp_channel_maybe_set_channel_type (self, g_value_get_string (value)); break; case PROP_HANDLE_TYPE: _tp_channel_maybe_set_handle_type (self, g_value_get_uint (value), (g_value_get_uint (value) != TP_UNKNOWN_HANDLE_TYPE)); break; case PROP_HANDLE: _tp_channel_maybe_set_handle (self, g_value_get_uint (value), (g_value_get_uint (value) != 0)); break; case PROP_CHANNEL_PROPERTIES: { GHashTable *asv = g_value_get_boxed (value); gboolean valid; /* default value at construct time is NULL, we need to ignore that */ if (asv != NULL) { guint u; /* no need to emit GObject::notify for any of these since this * can only happen at construct time, before anyone has * connected to it */ tp_g_hash_table_update (self->priv->channel_properties, asv, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); u = tp_asv_get_uint32 (self->priv->channel_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); _tp_channel_maybe_set_handle_type (self, u, valid); u = tp_asv_get_uint32 (self->priv->channel_properties, TP_PROP_CHANNEL_TARGET_HANDLE, &valid); _tp_channel_maybe_set_handle (self, u, valid); _tp_channel_maybe_set_identifier (self, tp_asv_get_string (self->priv->channel_properties, TP_PROP_CHANNEL_TARGET_ID)); _tp_channel_maybe_set_channel_type (self, tp_asv_get_string (self->priv->channel_properties, TP_PROP_CHANNEL_CHANNEL_TYPE)); _tp_channel_maybe_set_interfaces (self, tp_asv_get_boxed (self->priv->channel_properties, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV)); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /* Introspection etc. */ void _tp_channel_abort_introspection (TpChannel *self, const gchar *debug, const GError *error) { DEBUG ("%p: Introspection failed: %s: %s", self, debug, error->message); g_assert (self->priv->introspect_needed != NULL); g_queue_free (self->priv->introspect_needed); self->priv->introspect_needed = NULL; tp_proxy_invalidate ((TpProxy *) self, error); } static void tp_channel_chat_state_changed_cb (TpChannel *self, guint contact, guint state, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { g_hash_table_insert (self->priv->chat_states, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (state)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* Don't emit the signal until we've had the initial state */ if (!tp_proxy_is_prepared (self, TP_CHANNEL_FEATURE_CHAT_STATES)) return; G_GNUC_END_IGNORE_DEPRECATIONS g_signal_emit (self, signals[SIGNAL_CHAT_STATE_CHANGED], 0, contact, state); } static void tp_channel_get_initial_chat_states_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpChannel *self = TP_CHANNEL (proxy); GSimpleAsyncResult *result = user_data; if (error == NULL && G_VALUE_HOLDS (value, TP_HASH_TYPE_CHAT_STATE_MAP)) { tp_g_hash_table_update (self->priv->chat_states, g_value_get_boxed (value), NULL, NULL); } /* else just ignore it and assume everyone was initially in the default * Inactive state, unless we already saw a signal for them */ g_simple_async_result_complete_in_idle (result); } static void tp_channel_prepare_chat_states_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *self = (TpChannel *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_channel_prepare_chat_states_async); g_assert (self->priv->chat_states == NULL); /* chat states? yes please! */ self->priv->chat_states = g_hash_table_new (NULL, NULL); tp_cli_channel_interface_chat_state_connect_to_chat_state_changed ( self, tp_channel_chat_state_changed_cb, NULL, NULL, NULL, NULL); tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE, "ChatStates", tp_channel_get_initial_chat_states_cb, result, g_object_unref, NULL); } void _tp_channel_continue_introspection (TpChannel *self) { DEBUG ("%p", self); g_assert (self->priv->introspect_needed != NULL); if (tp_proxy_get_invalidated (self)) { DEBUG ("invalidated; giving up"); g_queue_free (self->priv->introspect_needed); self->priv->introspect_needed = NULL; } else if (g_queue_peek_head (self->priv->introspect_needed) == NULL) { g_queue_free (self->priv->introspect_needed); self->priv->introspect_needed = NULL; DEBUG ("%p: channel ready", self); self->priv->ready = TRUE; g_object_notify ((GObject *) self, "channel-ready"); /* for now, we only have one introspection queue, so CORE and * (if supported) GROUP turn up simultaneously */ _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CHANNEL_FEATURE_CORE, TRUE); _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CHANNEL_FEATURE_GROUP, tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)); } else { TpChannelProc next = g_queue_pop_head (self->priv->introspect_needed); next (self); } } static void tp_channel_got_interfaces_cb (TpChannel *self, const gchar **interfaces, const GError *error, gpointer unused, GObject *unused2) { if (error != NULL) { _tp_channel_abort_introspection (self, "GetInterfaces() failed", error); return; } self->priv->exists = TRUE; _tp_channel_maybe_set_interfaces (self, interfaces); /* FIXME: give subclasses a chance to influence the definition of "ready" * now that we have our interfaces? */ _tp_channel_continue_introspection (self); } static void _tp_channel_get_interfaces (TpChannel *self) { DEBUG ("%p", self); if (tp_asv_lookup (self->priv->channel_properties, TP_PROP_CHANNEL_INTERFACES) != NULL && (self->priv->exists || tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP))) { /* If we already know the channel's interfaces, and either have already * successfully called a method on the channel (so know it's alive) or * are going to call one on it when we introspect the Group properties, * then we don't need to do anything here. */ _tp_channel_continue_introspection (self); } else { /* either we don't know the Interfaces, or we just want to verify the * channel's existence */ tp_cli_channel_call_get_interfaces (self, -1, tp_channel_got_interfaces_cb, NULL, NULL, NULL); } } static void tp_channel_got_channel_type_cb (TpChannel *self, const gchar *channel_type, const GError *error, gpointer unused, GObject *unused2) { GError *err2 = NULL; if (error != NULL) { _tp_channel_abort_introspection (self, "GetChannelType failed", error); } else if (tp_dbus_check_valid_interface_name (channel_type, &err2)) { self->priv->exists = TRUE; DEBUG ("%p: Introspected channel type %s", self, channel_type); _tp_channel_maybe_set_channel_type (self, channel_type); g_object_notify ((GObject *) self, "channel-type"); _tp_channel_continue_introspection (self); } else { _tp_channel_abort_introspection (self, "GetChannelType returned invalid type", err2); g_error_free (err2); } } static void _tp_channel_get_channel_type (TpChannel *self) { if (self->priv->channel_type == 0) { DEBUG ("%p: calling GetChannelType", self); tp_cli_channel_call_get_channel_type (self, -1, tp_channel_got_channel_type_cb, NULL, NULL, NULL); } else { DEBUG ("%p: channel type %s already determined", self, g_quark_to_string (self->priv->channel_type)); _tp_channel_continue_introspection (self); } } static void tp_channel_got_handle_cb (TpChannel *self, guint handle_type, guint handle, const GError *error, gpointer unused, GObject *unused2) { if (error == NULL) { self->priv->exists = TRUE; DEBUG ("%p: Introspected handle #%d of type %d", self, handle, handle_type); self->priv->handle_type = handle_type; self->priv->handle = handle; g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE_TYPE), tp_g_value_slice_new_uint (handle_type)); g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE), tp_g_value_slice_new_uint (handle)); g_object_notify ((GObject *) self, "handle-type"); g_object_notify ((GObject *) self, "handle"); _tp_channel_continue_introspection (self); } else { _tp_channel_abort_introspection (self, "GetHandle failed", error); } } static void _tp_channel_get_handle (TpChannel *self) { if (self->priv->handle_type == TP_UNKNOWN_HANDLE_TYPE || (self->priv->handle == 0 && self->priv->handle_type != TP_HANDLE_TYPE_NONE)) { DEBUG ("%p: calling GetHandle", self); tp_cli_channel_call_get_handle (self, -1, tp_channel_got_handle_cb, NULL, NULL, NULL); } else { DEBUG ("%p: handle already known to be %u of type %u", self, self->priv->handle, self->priv->handle_type); _tp_channel_continue_introspection (self); } } static void tp_channel_got_identifier_cb (TpConnection *connection, const gchar **identifier, const GError *error, gpointer user_data, GObject *unused2) { TpChannel *self = user_data; if (error != NULL) { _tp_channel_abort_introspection (self, "InspectHandles failed", error); goto finally; } if (identifier == NULL || identifier[0] == NULL || identifier[1] != NULL) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "CM is broken: InspectHandles(CONTACT, [TargetHandle]) returned " "non-1 length" }; _tp_channel_abort_introspection (self, "InspectHandles inconsistent", &e); goto finally; } DEBUG ("%p: Introspected identifier %s", self, identifier[0]); _tp_channel_maybe_set_identifier (self, identifier[0]); g_object_notify ((GObject *) self, "identifier"); _tp_channel_continue_introspection (self); finally: g_object_unref (self); } static void _tp_channel_get_identifier (TpChannel *self) { if (self->priv->identifier == NULL && (self->priv->handle == 0 || self->priv->handle_type == TP_HANDLE_TYPE_NONE)) { /* no need to emit GObject::notify here since the initial value was "" */ _tp_channel_maybe_set_identifier (self, ""); } if (self->priv->identifier == NULL) { GArray handles = {(gchar *) &self->priv->handle, 1}; DEBUG ("%p: calling InspectHandles", self); tp_cli_connection_call_inspect_handles (self->priv->connection, -1, self->priv->handle_type, &handles, tp_channel_got_identifier_cb, g_object_ref (self), NULL, NULL); } else { DEBUG ("%p: identifier already known to be %s", self, self->priv->identifier); _tp_channel_continue_introspection (self); } } static void _tp_channel_got_properties (TpProxy *proxy, GHashTable *asv, const GError *error, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { TpChannel *self = TP_CHANNEL (proxy); if (error == NULL) { gboolean valid; guint u; const gchar *s; gboolean b; DEBUG ("Received %u channel properties", g_hash_table_size (asv)); self->priv->exists = TRUE; _tp_channel_maybe_set_channel_type (self, tp_asv_get_string (asv, "ChannelType")); _tp_channel_maybe_set_interfaces (self, tp_asv_get_boxed (asv, "Interfaces", G_TYPE_STRV)); u = tp_asv_get_uint32 (asv, "TargetHandleType", &valid); _tp_channel_maybe_set_handle_type (self, u, valid); u = tp_asv_get_uint32 (asv, "TargetHandle", &valid); _tp_channel_maybe_set_handle (self, u, valid); _tp_channel_maybe_set_identifier (self, tp_asv_get_string (asv, "TargetID")); u = tp_asv_get_uint32 (asv, "InitiatorHandle", &valid); if (valid) { g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_INITIATOR_HANDLE), tp_g_value_slice_new_uint (u)); } s = tp_asv_get_string (asv, "InitiatorID"); if (s != NULL) { g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_INITIATOR_ID), tp_g_value_slice_new_string (s)); } b = tp_asv_get_boolean (asv, "Requested", &valid); if (valid) { g_hash_table_insert (self->priv->channel_properties, g_strdup (TP_PROP_CHANNEL_REQUESTED), tp_g_value_slice_new_boolean (b)); } g_object_notify ((GObject *) self, "channel-type"); g_object_notify ((GObject *) self, "interfaces"); g_object_notify ((GObject *) self, "handle-type"); g_object_notify ((GObject *) self, "handle"); g_object_notify ((GObject *) self, "identifier"); } else { /* GetAll failed; it's not mandatory, so continue with the separate * (spec 0.16.x-style) method calls */ DEBUG ("GetAll failed, falling back to 0.16 API:" " %s", error->message); } /* Either way, we'll fill in any other gaps in the properties, then * continue with any other introspection */ _tp_channel_continue_introspection (self); } static void _tp_channel_get_properties (TpChannel *self) { /* skip it if we already have all the details we want */ if (self->priv->handle_type != TP_UNKNOWN_HANDLE_TYPE && (self->priv->handle != 0 || self->priv->handle_type == TP_HANDLE_TYPE_NONE) && self->priv->channel_type != 0 /* currently we always re-fetch the interfaces later, so don't check: && tp_asv_get_boxed (self->priv->channel_properties, TP_PROP_CHANNEL_INTERFACES, G_TYPE_STRV) != NULL */ && tp_asv_get_string (self->priv->channel_properties, TP_PROP_CHANNEL_TARGET_ID) != NULL && tp_asv_get_string (self->priv->channel_properties, TP_PROP_CHANNEL_INITIATOR_ID) != NULL ) { gboolean valid; tp_asv_get_uint32 (self->priv->channel_properties, TP_PROP_CHANNEL_INITIATOR_HANDLE, &valid); if (!valid) goto missing; tp_asv_get_boolean (self->priv->channel_properties, TP_PROP_CHANNEL_REQUESTED, &valid); if (!valid) goto missing; _tp_channel_continue_introspection (self); return; } missing: tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CHANNEL, _tp_channel_got_properties, NULL, NULL, NULL); } static void connection_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpChannel *self = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { _tp_channel_abort_introspection (self, "Preparing connection failed", error); g_clear_error (&error); } else { _tp_channel_continue_introspection (self); } g_object_unref (self); } static void _tp_channel_prepare_connection (TpChannel *self) { /* Skip if connection is already prepared */ if (tp_proxy_is_prepared (self->priv->connection, TP_CONNECTION_FEATURE_CORE)) { _tp_channel_continue_introspection (self); return; } tp_proxy_prepare_async (self->priv->connection, NULL, connection_prepared_cb, g_object_ref (self)); } static void _tp_channel_create_contacts (TpChannel *self) { _tp_channel_contacts_init (self); _tp_channel_continue_introspection (self); } static void tp_channel_closed_cb (TpChannel *self, gpointer user_data, GObject *weak_object) { if (self->priv->group_remove_error != NULL) { /* use the error provided by the Group code */ tp_proxy_invalidate ((TpProxy *) self, self->priv->group_remove_error); g_clear_error (&self->priv->group_remove_error); } else { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED, "Channel was closed" }; tp_proxy_invalidate ((TpProxy *) self, &e); } } static void tp_channel_connection_invalidated_cb (TpConnection *conn, guint domain, guint code, gchar *message, TpChannel *self) { const GError e = { domain, code, message }; g_signal_handler_disconnect (conn, self->priv->conn_invalidated_id); self->priv->conn_invalidated_id = 0; /* tp_proxy_invalidate and g_object_notify call out to user code - add a * temporary ref to ensure that we don't become finalized while doing so */ g_object_ref (self); tp_proxy_invalidate ((TpProxy *) self, &e); /* this channel's handle is now meaningless */ if (self->priv->handle != 0) { self->priv->handle = 0; g_object_notify ((GObject *) self, "handle"); } g_object_unref (self); } static GObject * tp_channel_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *) tp_channel_parent_class; TpChannel *self = TP_CHANNEL (object_class->constructor (type, n_params, params)); GError *error = NULL; TpProxySignalConnection *sc; /* If our TpConnection dies, so do we. */ self->priv->conn_invalidated_id = g_signal_connect (self->priv->connection, "invalidated", G_CALLBACK (tp_channel_connection_invalidated_cb), self); /* Connect to my own Closed signal and self-destruct when it arrives. * The channel hasn't had a chance to become invalid yet (it was just * constructed!), so we assert that this signal connection will work */ sc = tp_cli_channel_connect_to_closed (self, tp_channel_closed_cb, NULL, NULL, NULL, &error); if (sc == NULL) { CRITICAL ("Couldn't connect to Closed: %s", error->message); g_assert_not_reached (); g_error_free (error); return NULL; } DEBUG ("%p: constructed with channel type \"%s\", handle #%d of type %d", self, (self->priv->channel_type != 0) ? g_quark_to_string (self->priv->channel_type) : "(null)", self->priv->handle, self->priv->handle_type); self->priv->introspect_needed = g_queue_new (); /* this does nothing if connection already has CORE prepared */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_prepare_connection); /* this does nothing if we already know all the Channel properties this * code is aware of */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_properties); /* this does nothing if we already know the handle */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_handle); /* this does nothing if we already know the identifier */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_identifier); /* this does nothing if we already know the channel type */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_channel_type); g_queue_push_tail (self->priv->introspect_needed, _tp_channel_create_contacts); /* This makes a call unless (a) we already know the Interfaces by now, and * (b) priv->exists is TRUE (i.e. either GetAll, GetHandle or GetChannelType * has succeeded). * * This means the channel never becomes ready until we re-enter the * main loop, and we always verify that the channel does actually exist. */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_interfaces); /* this needs doing *after* GetInterfaces so we know whether we're a group */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_group_properties); _tp_channel_continue_introspection (self); return (GObject *) self; } static void tp_channel_init (TpChannel *self) { DEBUG ("%p", self); self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CHANNEL, TpChannelPrivate); self->priv->channel_type = 0; self->priv->handle_type = TP_UNKNOWN_HANDLE_TYPE; self->priv->handle = 0; self->priv->channel_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); self->priv->contacts_queue = g_queue_new (); } static void tp_channel_dispose (GObject *object) { TpChannel *self = (TpChannel *) object; DEBUG ("%p", self); if (self->priv->connection == NULL) goto finally; if (self->priv->conn_invalidated_id != 0) g_signal_handler_disconnect (self->priv->connection, self->priv->conn_invalidated_id); self->priv->conn_invalidated_id = 0; g_clear_object (&self->priv->connection); g_clear_object (&self->priv->target_contact); g_clear_object (&self->priv->initiator_contact); g_clear_object (&self->priv->group_self_contact); tp_clear_pointer (&self->priv->group_members_contacts, g_hash_table_unref); tp_clear_pointer (&self->priv->group_local_pending_contacts, g_hash_table_unref); tp_clear_pointer (&self->priv->group_remote_pending_contacts, g_hash_table_unref); tp_clear_pointer (&self->priv->group_contact_owners, g_hash_table_unref); finally: ((GObjectClass *) tp_channel_parent_class)->dispose (object); } static void tp_channel_finalize (GObject *object) { TpChannel *self = (TpChannel *) object; DEBUG ("%p", self); g_clear_error (&self->priv->group_remove_error); tp_clear_pointer (&self->priv->group_local_pending_info, g_hash_table_unref); tp_clear_pointer (&self->priv->group_members, tp_intset_destroy); tp_clear_pointer (&self->priv->group_local_pending, tp_intset_destroy); tp_clear_pointer (&self->priv->group_remote_pending, tp_intset_destroy); tp_clear_pointer (&self->priv->group_handle_owners, g_hash_table_unref); tp_clear_pointer (&self->priv->introspect_needed, g_queue_free); tp_clear_pointer (&self->priv->chat_states, g_hash_table_unref); tp_clear_pointer (&self->priv->channel_properties, g_hash_table_unref); tp_clear_pointer (&self->priv->contacts_queue, g_queue_free); g_free (self->priv->identifier); ((GObjectClass *) tp_channel_parent_class)->finalize (object); } static void got_password_flags_cb (TpChannel *self, guint password_flags, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to get password flags: %s", error->message); } else { self->priv->password_flags = password_flags; if (tp_channel_password_needed (self)) { /* password-needed is FALSE by default */ g_object_notify (G_OBJECT (self), "password-needed"); } } g_simple_async_result_complete_in_idle (result); } static void password_flags_changed_cb (TpChannel *self, guint added, guint removed, gpointer user_data, GObject *weak_object) { gboolean was_needed, needed; was_needed = tp_channel_password_needed (self); self->priv->password_flags |= added; self->priv->password_flags ^= removed; needed = tp_channel_password_needed (self); if (was_needed != needed) g_object_notify (G_OBJECT (self), "password-needed"); } static void tp_channel_prepare_password_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *self = (TpChannel *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_channel_prepare_password_async); tp_cli_channel_interface_password_connect_to_password_flags_changed (self, password_flags_changed_cb, self, NULL, G_OBJECT (self), NULL); tp_cli_channel_interface_password_call_get_password_flags (self, -1, got_password_flags_cb, result, g_object_unref, G_OBJECT (self)); } enum { FEAT_CORE, FEAT_GROUP, FEAT_CONTACTS, FEAT_CHAT_STATES, FEAT_PASSWORD, N_FEAT }; static const TpProxyFeature * tp_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; static GQuark need_chat_states[2] = {0, 0}; static GQuark need_password[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_CHANNEL_FEATURE_CORE; features[FEAT_CORE].core = TRUE; features[FEAT_GROUP].name = TP_CHANNEL_FEATURE_GROUP; features[FEAT_CONTACTS].name = TP_CHANNEL_FEATURE_CONTACTS; features[FEAT_CONTACTS].prepare_async = _tp_channel_contacts_prepare_async; G_GNUC_BEGIN_IGNORE_DEPRECATIONS features[FEAT_CHAT_STATES].name = TP_CHANNEL_FEATURE_CHAT_STATES; features[FEAT_CHAT_STATES].prepare_async = tp_channel_prepare_chat_states_async; need_chat_states[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE; features[FEAT_CHAT_STATES].interfaces_needed = need_chat_states; G_GNUC_END_IGNORE_DEPRECATIONS features[FEAT_PASSWORD].name = TP_CHANNEL_FEATURE_PASSWORD; features[FEAT_PASSWORD].prepare_async = tp_channel_prepare_password_async; need_password[0] = TP_IFACE_QUARK_CHANNEL_INTERFACE_PASSWORD; features[FEAT_PASSWORD].interfaces_needed = need_password; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_channel_class_init (TpChannelClass *klass) { GParamSpec *param_spec; TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GType au_type = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); tp_channel_init_known_interfaces (); g_type_class_add_private (klass, sizeof (TpChannelPrivate)); object_class->constructor = tp_channel_constructor; object_class->get_property = tp_channel_get_property; object_class->set_property = tp_channel_set_property; object_class->dispose = tp_channel_dispose; object_class->finalize = tp_channel_finalize; proxy_class->interface = TP_IFACE_QUARK_CHANNEL; proxy_class->must_have_unique_name = TRUE; proxy_class->list_features = tp_channel_list_features; g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); /** * TpChannel:identifier: * * This channel's associated identifier, or the empty string if it has * handle type %TP_HANDLE_TYPE_NONE. * * For channels where #TpChannelIface:handle is non-zero, this is the result * of inspecting #TpChannelIface:handle. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be * the empty string. * * Changed in 0.11.4: this property is never %NULL. Previously, * it was %NULL before an identifier was known, or when a channel * with no TargetID D-Bus property had TargetHandleType %TP_HANDLE_TYPE_NONE. */ param_spec = g_param_spec_string ("identifier", "The identifier", "The identifier of the channel", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IDENTIFIER, param_spec); /** * TpChannel:channel-properties: * * The immutable D-Bus properties of this channel, represented by a * #GHashTable where the keys are D-Bus interface name + "." + property * name, and the values are #GValue instances. * * Read-only except during construction. If this is not provided * during construction, a reasonable (but possibly incomplete) version * will be made up from the values of individual properties; reading this * property repeatedly may yield progressively more complete values until * tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE. */ param_spec = g_param_spec_boxed ("channel-properties", "Immutable D-Bus properties", "A map D-Bus interface + \".\" + property name => GValue", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_PROPERTIES, param_spec); /** * TpChannel:channel-ready: * * Initially %FALSE; changes to %TRUE when tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CORE, and if the channel is a * group, %TP_CHANNEL_FEATURE_GROUP. * * This is a less general form of tp_proxy_is_prepared(), which should be * used in new code. * * One important difference is that after #TpProxy::invalidated is * signalled, #TpChannel:channel-ready keeps its current value - which might * be %TRUE, if the channel was successfully prepared before it became * invalidated - but tp_proxy_is_prepared() returns %FALSE for all features. * * Change notification is via notify::channel-ready. * * Deprecated: 0.17.6: use tp_proxy_is_prepared() with * %TP_CHANNEL_FEATURE_CORE for checks, or tp_proxy_prepare_async() for * notification */ param_spec = g_param_spec_boolean ("channel-ready", "Channel ready?", "Initially FALSE; changes to TRUE when introspection finishes", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED); g_object_class_install_property (object_class, PROP_CHANNEL_READY, param_spec); /** * TpChannel:connection: * * The #TpConnection to which this #TpChannel belongs. Used for e.g. * handle manipulation. */ param_spec = g_param_spec_object ("connection", "TpConnection", "The connection to which this object belongs.", TP_TYPE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpChannel:group-self-handle: * * If this channel is a group and %TP_CHANNEL_FEATURE_GROUP has been * prepared, and the user is a member of the group, the #TpHandle * representing them in this group. * * Otherwise, the result may be either a handle representing the user, or 0. * * Change notification is via notify::group-self-handle. * * Since: 0.7.12 * Deprecated: Use #TpChannel:group-self-contact instead. */ param_spec = g_param_spec_uint ("group-self-handle", "Group.SelfHandle", "Undefined if not a group", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUP_SELF_HANDLE, param_spec); /** * TpChannel:group-flags: * * If the %TP_CHANNEL_FEATURE_GROUP feature has been prepared successfully, * #TpChannelGroupFlags indicating the capabilities and behaviour of that * group. * * Otherwise, this may be 0. * * Change notification is via notify::group-flags or * TpChannel::group-flags-changed. * * Since: 0.7.12 */ param_spec = g_param_spec_uint ("group-flags", "Group.GroupFlags", "0 if not a group", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUP_FLAGS, param_spec); /** * TpChannel:requested: * * %TRUE if this channel was created in response to a local request, such * as a call to tp_account_channel_request_create_channel_async(). %FALSE * if this channel was initiated by a remote contact * (the #TpChannel:initiator-handle), or if it appeared as a side-effect * of some other action. * * For instance, this is %FALSE on incoming calls and file transfers, * remotely-initiated 1-1 text conversations, and invitations to chatrooms, * and %TRUE on outgoing calls and file transfers, locally-initiated 1-1 * text conversations, and chatrooms joined by local user action. * * This is not guaranteed to be meaningful until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may return * %FALSE even if the channel was actually requested. * * Since: 0.11.15 */ param_spec = g_param_spec_boolean ("requested", "Requested", "TRUE if the channel has been requested", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTED, param_spec); /** * TpChannel:initiator-handle: * * The %TP_HANDLE_TYPE_CONTACT #TpHandle of the initiator of this * channel, or 0 if there is no particular initiator. * * If the channel was initiated by a remote contact, this handle represents * that contact, and #TpChannel:requested will be %FALSE. For instance, * for an incoming call this property indicates the caller, and for a * chatroom invitation this property indicates who sent the invitation. * * If the channel was requested by the local user, #TpChannel:requested * will be %TRUE, and this property may be the #TpChannel:group-self-handle * or #TpConnection:self-handle. * * If the channel appeared for some other reason (for instance as a * side-effect of connecting to the server), this property may be 0. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be 0. * * Since: 0.11.15 * Deprecated: Use #TpChannel:initiator-contact instead. */ param_spec = g_param_spec_uint ("initiator-handle", "TpHandle", "The handle of the initiator of the channel", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE, param_spec); /** * TpChannel:initiator-identifier: * * If #TpChannel:initiator-handle is 0, this will always be "". * Otherwise, this will be the #TpContact:identifier of the contact * with that handle. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be * the empty string. * * Since: 0.11.15 * Deprecated: Use #TpChannel:initiator-contact instead. */ param_spec = g_param_spec_string ("initiator-identifier", "Initiator identifier", "The identifier of the initiator of the channel", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_IDENTIFIER, param_spec); /** * TpChannel:password-needed: * * If %TRUE, tp_channel_provide_password_async() has to be called * to be able to join the channel. * * This is not guaranteed to be meaningful until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_PASSWORD; until then, it may return * %FALSE even if the channel is actually protected by a password. * Preparing %TP_CHANNEL_FEATURE_PASSWORD also ensures that the * notify::password-needed signal will be fired when this property changes. * * Since: 0.15.2 */ param_spec = g_param_spec_boolean ("password-needed", "Password needed", "Password neede to join the channel", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PASSWORD_NEEDED, param_spec); /** * TpChannel::group-flags-changed: * @self: a channel * @added: #TpChannelGroupFlags which are newly set * @removed: #TpChannelGroupFlags which are no longer set * * Emitted when the #TpChannel:group-flags property changes while the * channel is ready. * * Since: 0.7.12 */ signals[SIGNAL_GROUP_FLAGS_CHANGED] = g_signal_new ("group-flags-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); /** * TpChannel::group-members-changed: (skip) * @self: a channel * @message: an optional textual message * @added: a #GArray of #guint containing the full members added * @removed: a #GArray of #guint containing the members (full, * local-pending or remote-pending) removed * @local_pending: a #GArray of #guint containing the local-pending * members added * @remote_pending: a #GArray of #guint containing the remote-pending * members added * @actor: the #TpHandle of the contact causing the change, or 0 * @reason: the reason for the change as a #TpChannelGroupChangeReason * * Emitted when the group members change in a Group channel that is ready. * * Since: 0.7.12 * Deprecated: Use #TpChannel::group-contacts-changed instead. */ signals[SIGNAL_GROUP_MEMBERS_CHANGED] = g_signal_new ( "group-members-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 7, G_TYPE_STRING, au_type, au_type, au_type, au_type, G_TYPE_UINT, G_TYPE_UINT); /** * TpChannel::group-members-changed-detailed: * @self: a channel * @added: (type GLib.Array) (element-type uint): a #GArray of #guint * containing the full members added * @removed: (type GLib.Array) (element-type uint): a #GArray of #guint * containing the members (full, local-pending or remote-pending) removed * @local_pending: (type GLib.Array) (element-type uint): a #GArray of * #guint containing the local-pending members added * @remote_pending: (type GLib.Array) (element-type uint): a #GArray of * #guint containing the remote-pending members added * @details: (type GLib.HashTable) (element-type utf8 GObject.Value): * a #GHashTable mapping (gchar *) to #GValue containing details * about the change, as described in the specification of the * MembersChangedDetailed signal. * * Emitted when the group members change in a Group channel that is ready. * Contains a superset of the information in the * TpChannel::group-members-changed signal, and is emitted at the same time; * applications can connect to this signal and ignore the other. * * Since: 0.7.21 * Deprecated: Use #TpChannel::group-contacts-changed instead. */ signals[SIGNAL_GROUP_MEMBERS_CHANGED_DETAILED] = g_signal_new ( "group-members-changed-detailed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 5, au_type, au_type, au_type, au_type, TP_HASH_TYPE_STRING_VARIANT_MAP); /** * TpChannel::chat-state-changed: * @self: a channel * @contact: a contact handle for the local user or another contact * @state: the new #TpChannelChatState for the contact * * Emitted when a contact's chat state changes after tp_proxy_prepare_async() * has finished preparing the feature %TP_CHANNEL_FEATURE_CHAT_STATES. * * Since: 0.11.3 * Deprecated: Use #TpTextChannel::contact-chat-state-changed instead */ signals[SIGNAL_CHAT_STATE_CHANGED] = g_signal_new ("chat-state-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); /** * TpChannel:target-contact: * * If this channel is for communication with a single contact (that is, * #TpChannelIface:handle-type is %TP_HANDLE_TYPE_CONTACT), then a #TpContact * representing the remote contact. For chat rooms, contact search channels and * other channels without a single remote contact, %NULL. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be * %NULL. * * Since: 0.15.6 */ param_spec = g_param_spec_object ("target-contact", "Target Contact", "The channel's target contact", TP_TYPE_CONTACT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TARGET_CONTACT, param_spec); /** * TpChannel:initiator-contact: * * The #TpContact of the initiator of this channel, or %NULL if there is no * particular initiator. * * If the channel was initiated by a remote contact, this represents * that contact, and #TpChannel:requested will be %FALSE. For instance, * for an incoming call this property indicates the caller, and for a * chatroom invitation this property indicates who sent the invitation. * * If the channel was requested by the local user, #TpChannel:requested * will be %TRUE, and this property may be the #TpChannel:group-self-contact * or #TpConnection:self-contact. * * If the channel appeared for some other reason (for instance as a * side-effect of connecting to the server), this property may be %NULL. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be * %NULL. * * Since: 0.15.6 */ param_spec = g_param_spec_object ("initiator-contact", "Initiator Contact", "Undefined if not a group", TP_TYPE_CONTACT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_CONTACT, param_spec); /** * TpChannel:group-self-contact: * * If this channel is a group and %TP_CHANNEL_FEATURE_CONTACTS has been * prepared, and the user is a member of the group, the #TpContact * representing them in this group. * * Otherwise, the result may be either a contact representing the user, * or %NULL. * * Change notification is via notify::group-self-contact. * * Since: 0.15.6 */ param_spec = g_param_spec_object ("group-self-contact", "Group.SelfHandle", "Undefined if not a group", TP_TYPE_CONTACT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUP_SELF_CONTACT, param_spec); /** * TpChannel::group-contacts-changed: * @self: a channel * @added: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact containing the full members added * @removed: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact containing the members (full, local-pending or * remote-pending) removed * @local_pending: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact containing the local-pending members added * @remote_pending: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact containing the remote-pending members added * @actor: a #TpContact for the "actor" handle in @details * @details: (type GLib.HashTable) (element-type utf8 GObject.Value): * a #GHashTable mapping (gchar *) to #GValue containing details * about the change, as described in the specification of the * MembersChangedDetailed signal. * * Emitted when the group members change in a Group channel. * * This is not guaranteed to be emitted until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be * omitted. * * Since: 0.15.6 */ signals[SIGNAL_GROUP_CONTACTS_CHANGED] = g_signal_new ( "group-contacts-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 6, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY, TP_TYPE_CONTACT, TP_HASH_TYPE_STRING_VARIANT_MAP); } /** * tp_channel_new_from_properties: * @conn: a connection; may not be %NULL * @object_path: the object path of the channel; may not be %NULL * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel, * as signalled by the NewChannel D-Bus signal or returned by the * CreateChannel and EnsureChannel D-Bus methods: a mapping from * strings (D-Bus interface name + "." + property name) to #GValue instances * @error: used to indicate the error if %NULL is returned * * * * Returns: a new channel proxy, or %NULL on invalid arguments * * Since: 0.7.19 * Deprecated: Use tp_simple_client_factory_ensure_channel() instead. */ TpChannel * tp_channel_new_from_properties (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { return _tp_channel_new_with_factory (NULL, conn, object_path, immutable_properties, error); } TpChannel * _tp_channel_new_with_factory (TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; TpChannel *ret = NULL; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; /* An unfortunate collision between the default value in * TpChannelIface (0), and the default we want (-1), means that * we have to pass TP_UNKNOWN_HANDLE_TYPE to the constructor * explicitly, even if providing channel-properties. */ ret = TP_CHANNEL (g_object_new (TP_TYPE_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL)); finally: return ret; } /** * tp_channel_new: * @conn: a connection; may not be %NULL * @object_path: the object path of the channel; may not be %NULL * @optional_channel_type: the channel type if already known, or %NULL if not * @optional_handle_type: the handle type if already known, or * %TP_UNKNOWN_HANDLE_TYPE if not * @optional_handle: the handle if already known, or 0 if not * (if @optional_handle_type is %TP_UNKNOWN_HANDLE_TYPE or * %TP_HANDLE_TYPE_NONE, this must be 0) * @error: used to indicate the error if %NULL is returned * * * * Returns: a new channel proxy, or %NULL on invalid arguments. * * Since: 0.7.1 * Deprecated: Use tp_simple_client_factory_ensure_channel() instead. */ TpChannel * tp_channel_new (TpConnection *conn, const gchar *object_path, const gchar *optional_channel_type, TpHandleType optional_handle_type, TpHandle optional_handle, GError **error) { TpChannel *ret = NULL; TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); /* TpConnection always has a unique name, so we can assert this */ g_assert (tp_dbus_check_valid_bus_name (conn_proxy->bus_name, TP_DBUS_NAME_TYPE_UNIQUE, NULL)); if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; if (optional_channel_type != NULL && !tp_dbus_check_valid_interface_name (optional_channel_type, error)) goto finally; if (optional_handle_type == TP_UNKNOWN_HANDLE_TYPE || optional_handle_type == TP_HANDLE_TYPE_NONE) { if (optional_handle != 0) { /* in the properties, we do actually allow the user to give us an * assumed-valid handle of unknown type - but that'd be silly */ g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Nonzero handle of type NONE or unknown makes no sense"); goto finally; } } else if (!tp_handle_type_is_valid (optional_handle_type, error)) { goto finally; } ret = TP_CHANNEL (g_object_new (TP_TYPE_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "channel-type", optional_channel_type, "handle-type", optional_handle_type, "handle", optional_handle, NULL)); finally: return ret; } /** * tp_channel_run_until_ready: (skip) * @self: a channel * @error: if not %NULL and %FALSE is returned, used to raise an error * @loop: if not %NULL, a #GMainLoop is placed here while it is being run * (so calling code can call g_main_loop_quit() to abort), and %NULL is * placed here after the loop has been run * * If @self is ready for use (introspection has finished, etc.), return * immediately. Otherwise, re-enter the main loop until the channel either * becomes invalid or becomes ready for use, or until the main loop stored * via @loop is cancelled. * * Returns: %TRUE if the channel has been introspected and is ready for use, * %FALSE if the channel has become invalid. * * Since: 0.7.1 * Deprecated: 0.11.0: Use tp_proxy_prepare_async() and re-enter the main * loop yourself, or restructure your program in such a way as to avoid * re-entering the main loop. */ gboolean tp_channel_run_until_ready (TpChannel *self, GError **error, GMainLoop **loop) { TpProxy *as_proxy = (TpProxy *) self; GMainLoop *my_loop; gulong invalidated_id, ready_id; g_return_val_if_fail (TP_IS_CHANNEL (self), FALSE); if (as_proxy->invalidated) goto raise_invalidated; if (self->priv->ready) return TRUE; my_loop = g_main_loop_new (NULL, FALSE); invalidated_id = g_signal_connect_swapped (self, "invalidated", G_CALLBACK (g_main_loop_quit), my_loop); ready_id = g_signal_connect_swapped (self, "notify::channel-ready", G_CALLBACK (g_main_loop_quit), my_loop); if (loop != NULL) *loop = my_loop; g_main_loop_run (my_loop); if (loop != NULL) *loop = NULL; g_signal_handler_disconnect (self, invalidated_id); g_signal_handler_disconnect (self, ready_id); g_main_loop_unref (my_loop); if (as_proxy->invalidated) goto raise_invalidated; g_assert (self->priv->ready); return TRUE; raise_invalidated: if (error != NULL) { g_return_val_if_fail (*error == NULL, FALSE); *error = g_error_copy (as_proxy->invalidated); } return FALSE; } typedef struct { TpChannelWhenReadyCb callback; gpointer user_data; gulong invalidated_id; gulong ready_id; } CallWhenReadyContext; static void cwr_invalidated (TpChannel *self, guint domain, gint code, gchar *message, gpointer user_data) { CallWhenReadyContext *ctx = user_data; GError e = { domain, code, message }; DEBUG ("enter"); g_assert (ctx->callback != NULL); ctx->callback (self, &e, ctx->user_data); g_signal_handler_disconnect (self, ctx->invalidated_id); g_signal_handler_disconnect (self, ctx->ready_id); ctx->callback = NULL; /* poison it to detect errors */ g_slice_free (CallWhenReadyContext, ctx); } static void cwr_ready (TpChannel *self, GParamSpec *unused G_GNUC_UNUSED, gpointer user_data) { CallWhenReadyContext *ctx = user_data; DEBUG ("enter"); g_assert (ctx->callback != NULL); ctx->callback (self, NULL, ctx->user_data); g_signal_handler_disconnect (self, ctx->invalidated_id); g_signal_handler_disconnect (self, ctx->ready_id); ctx->callback = NULL; /* poison it to detect errors */ g_slice_free (CallWhenReadyContext, ctx); } /** * TpChannelWhenReadyCb: * @channel: the channel (which may be in the middle of being disposed, * if error is non-%NULL, error->domain is TP_DBUS_ERRORS and error->code is * TP_DBUS_ERROR_PROXY_UNREFERENCED) * @error: %NULL if the channel is ready for use, or the error with which * it was invalidated if it is now invalid * @user_data: whatever was passed to tp_channel_call_when_ready() * * Signature of a callback passed to tp_channel_call_when_ready(), which * will be called exactly once, when the channel becomes ready or * invalid (whichever happens first) * * Deprecated: 0.17.6 */ /** * tp_channel_call_when_ready: (skip) * @self: a channel * @callback: called when the channel becomes ready or invalidated, whichever * happens first * @user_data: arbitrary user-supplied data passed to the callback * * If @self is ready for use or has been invalidated, call @callback * immediately, then return. Otherwise, arrange * for @callback to be called when @self either becomes ready for use * or becomes invalid. * * This is a less general form of tp_proxy_prepare_async(), which should be * used in new code. (One important difference is that this function can call * @callback before it has returned, whereas tp_proxy_prepare_async() always * calls @callback from the main loop.) * * Since: 0.7.7 * Deprecated: 0.17.6: Use tp_proxy_prepare_async() */ void tp_channel_call_when_ready (TpChannel *self, TpChannelWhenReadyCb callback, gpointer user_data) { TpProxy *as_proxy = (TpProxy *) self; g_return_if_fail (TP_IS_CHANNEL (self)); g_return_if_fail (callback != NULL); if (self->priv->ready || as_proxy->invalidated != NULL) { DEBUG ("already ready or invalidated"); callback (self, as_proxy->invalidated, user_data); } else { CallWhenReadyContext *ctx = g_slice_new (CallWhenReadyContext); DEBUG ("arranging callback later"); ctx->callback = callback; ctx->user_data = user_data; ctx->invalidated_id = g_signal_connect (self, "invalidated", G_CALLBACK (cwr_invalidated), ctx); ctx->ready_id = g_signal_connect (self, "notify::channel-ready", G_CALLBACK (cwr_ready), ctx); } } static gpointer tp_channel_once (gpointer data G_GNUC_UNUSED) { GType type = TP_TYPE_CHANNEL; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (type, tp_cli_channel_add_signals); tp_proxy_subclass_add_error_mapping (type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); return NULL; } /** * tp_channel_init_known_interfaces: * * Ensure that the known interfaces for TpChannel have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CHANNEL. * * Since: 0.7.6 */ void tp_channel_init_known_interfaces (void) { static GOnce once = G_ONCE_INIT; g_once (&once, tp_channel_once, NULL); } /** * tp_channel_get_requested: * @self: a #TpChannel * * Return the #TpChannel:requested property * * Returns: the value of #TpChannel:requested * * Since: 0.11.15 */ gboolean tp_channel_get_requested (TpChannel *self) { return tp_asv_get_boolean (self->priv->channel_properties, TP_PROP_CHANNEL_REQUESTED, NULL); } /** * tp_channel_get_initiator_handle: (skip) * @self: a #TpChannel * * Return the #TpChannel:initiator-handle property * * Returns: the value of #TpChannel:initiator-handle * * Since: 0.11.15 * Deprecated: New code should use tp_channel_get_initiator_contact() instead. */ TpHandle tp_channel_get_initiator_handle (TpChannel *self) { return tp_asv_get_uint32 (self->priv->channel_properties, TP_PROP_CHANNEL_INITIATOR_HANDLE, NULL); } /** * tp_channel_get_initiator_identifier: (skip) * @self: a #TpChannel * * Return the #TpChannel:initiator-identifier property * * Returns: the value of #TpChannel:initiator-identifier * * Since: 0.11.15 * Deprecated: New code should use tp_channel_get_initiator_contact() instead. */ const gchar * tp_channel_get_initiator_identifier (TpChannel *self) { const gchar *id; id = tp_asv_get_string (self->priv->channel_properties, TP_PROP_CHANNEL_INITIATOR_ID); return id != NULL ? id : ""; } /* tp_cli callbacks can potentially be called in a re-entrant way, * so we can't necessarily complete @result without using an idle. */ static void channel_join_cb (TpChannel *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("join failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); } /** * tp_channel_join_async: * @self: a #TpChannel * @message: the join message * @callback: a callback to call when we joined the channel * @user_data: data to pass to @callback * * Join channel @self with @message as join message. * * When we joined the channel, @callback will be called. * You can then call tp_channel_join_finish() to get the result of * the operation. * * Note that unlike tp_channel_leave_async(), %TP_CHANNEL_FEATURE_GROUP feature * must be prepared before calling this function. * * Since: 0.15.5 */ void tp_channel_join_async (TpChannel *self, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GArray *array; g_return_if_fail (TP_IS_CHANNEL (self)); g_return_if_fail (tp_proxy_is_prepared (self, TP_CHANNEL_FEATURE_GROUP)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_join_async); array = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1); g_array_append_val (array, self->priv->group_self_handle); tp_cli_channel_interface_group_call_add_members (self, -1, array, message, channel_join_cb, result, g_object_unref, NULL); g_array_unref (array); } /** * tp_channel_join_finish: * @self: a #TpChannel * @result: a #GAsyncResult passed to the callback for tp_channel_join_async(). * @error: a #GError to fill * * Completes a call to tp_channel_join_async(). * * Returns: %TRUE if the channel was successfully joined; %FALSE otherwise * * Since: 0.15.5 */ gboolean tp_channel_join_finish (TpChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_join_async); } /* tp_cli callbacks can potentially be called in a re-entrant way, * so we can't necessarily complete @result without using an idle. */ static void channel_close_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Close() failed: %s", error->message); if (tp_proxy_get_invalidated (channel) == NULL) { g_simple_async_result_set_from_error (result, error); } else { DEBUG ("... but channel was already invalidated, so never mind"); } } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /* This is only called from the main loop, as a result of group_prepared_cb * having the same property, so it can complete LeaveCtx.result without * an idle. */ static void channel_remove_self_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (tp_proxy_get_invalidated (channel) == NULL && error != NULL) { DEBUG ("RemoveMembersWithDetails() with self handle failed; call Close()" " %s", error->message); tp_cli_channel_call_close (channel, -1, channel_close_cb, result, NULL, NULL); return; } g_simple_async_result_complete (result); g_object_unref (result); } typedef struct { GSimpleAsyncResult *result; gchar *message; TpChannelGroupChangeReason reason; } LeaveCtx; /* Takes the reference on @result */ static LeaveCtx * leave_ctx_new (GSimpleAsyncResult *result, const gchar *message, TpChannelGroupChangeReason reason) { LeaveCtx *ctx = g_slice_new (LeaveCtx); ctx->result = result; ctx->message = message != NULL ? g_strdup (message) : g_strdup (""); ctx->reason = reason; return ctx; } static void leave_ctx_free (LeaveCtx *ctx) { g_object_unref (ctx->result); g_free (ctx->message); g_slice_free (LeaveCtx, ctx); } /* This is only called from the main loop, so it can safely complete * LeaveCtx.result without an idle. */ static void group_prepared_cb (GObject *source, GAsyncResult *res, gpointer user_data) { LeaveCtx *ctx = user_data; TpChannel *self = (TpChannel *) source; GError *error = NULL; GArray *handles; if (!tp_proxy_prepare_finish (source, res, &error)) { DEBUG ("Failed to prepare Group feature; fallback to Close(): %s", error->message); g_error_free (error); goto call_close; } if (self->priv->group_self_handle == 0) { DEBUG ("We are not in the channel, fallback to Close()"); goto call_close; } handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 1); g_array_append_val (handles, self->priv->group_self_handle); tp_cli_channel_interface_group_call_remove_members_with_reason ( self, -1, handles, ctx->message, ctx->reason, channel_remove_self_cb, g_object_ref (ctx->result), NULL, NULL); g_array_unref (handles); leave_ctx_free (ctx); return; call_close: tp_cli_channel_call_close (self, -1, channel_close_cb, g_object_ref (ctx->result), NULL, NULL); leave_ctx_free (ctx); } /** * tp_channel_leave_async: * @self: a #TpChannel * @reason: the leave reason * @message: the leave message * @callback: a callback to call when we left the channel * @user_data: data to pass to @callback * * Leave channel @self with @reason as reason and @message as leave message. * If @self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP or if * for any reason we can't properly leave the channel, we close it. * * When we left the channel, @callback will be called. * You can then call tp_channel_leave_finish() to get the result of * the operation. * * Note that unlike tp_channel_join_async(), %TP_CHANNEL_FEATURE_GROUP feature * does not have to be prepared and will be prepared for you. But this is a * deprecated behaviour. * * Since: 0.13.10 */ void tp_channel_leave_async (TpChannel *self, TpChannelGroupChangeReason reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GQuark features[] = { TP_CHANNEL_FEATURE_GROUP, 0 }; LeaveCtx *ctx; g_return_if_fail (TP_IS_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_leave_async); if (tp_proxy_is_prepared (self, TP_CHANNEL_FEATURE_CORE) && !tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)) { DEBUG ("Channel doesn't implement Group; fallback to Close()"); tp_cli_channel_call_close (self, -1, channel_close_cb, result, NULL, NULL); return; } /* We need to prepare TP_CHANNEL_FEATURE_GROUP to get * tp_channel_group_get_self_handle() working */ ctx = leave_ctx_new (result, message, reason); tp_proxy_prepare_async (self, features, group_prepared_cb, ctx); } /** * tp_channel_leave_finish: * @self: a #TpChannel * @result: a #GAsyncResult passed to the callback for tp_channel_leave_async(). * @error: a #GError to fill * * Completes a call to tp_channel_leave_async(). * * Returns: %TRUE if the channel has been left; %FALSE otherwise * * Since: 0.13.10 */ gboolean tp_channel_leave_finish (TpChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_leave_async) } /** * tp_channel_close_async: * @self: a #TpChannel * @callback: a callback to call when we closed the channel, or %NULL * to ignore any reply * @user_data: data to pass to @callback * * Close channel @self. In most cases, it's generally cleaner to use * tp_channel_leave_async() instead to properly leave and close the channel. * * When the channel has been closed, @callback will be called. * You can then call tp_channel_close_finish() to get the result of * the operation. * * Since: 0.13.10 */ void tp_channel_close_async (TpChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL (self)); if (callback == NULL) { tp_cli_channel_call_close (self, -1, NULL, NULL, NULL, NULL); return; } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_close_async); tp_cli_channel_call_close (self, -1, channel_close_cb, result, NULL, NULL); } /** * tp_channel_close_finish: * @self: a #TpChannel * @result: a #GAsyncResult passed to the callback for tp_channel_close_async(). * @error: a #GError to fill * * Finishes a call to tp_channel_leave_async(). * * Returns: %TRUE if the channel has been closed; %FALSE otherwise * * Since: 0.13.10 */ gboolean tp_channel_close_finish (TpChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_close_async) } static void channel_destroy_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (tp_proxy_get_invalidated (channel) == NULL && error != NULL) { DEBUG ("Destroy() failed; call Close(): %s", error->message); tp_cli_channel_call_close (channel, -1, channel_close_cb, result, NULL, NULL); return; } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_destroy_async: * @self: a #TpChannel * @callback: a callback to call when we left the channel * @user_data: data to pass to @callback * * Destroy channel @self. * If @self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE * or if for any reason we can't destroy the channel, we close it. * * When the channel has been destroyed or closed, @callback will be called. * You can then call tp_channel_destroy_finish() to get the result of * the operation. * * Since: 0.15.2 */ void tp_channel_destroy_async (TpChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_destroy_async); if (tp_proxy_is_prepared (self, TP_CHANNEL_FEATURE_CORE) && !tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE)) { DEBUG ("Channel doesn't implement Destroy; fallback to Close()"); tp_cli_channel_call_close (self, -1, channel_close_cb, result, NULL, NULL); return; } tp_cli_channel_interface_destroyable_call_destroy (self, -1, channel_destroy_cb, result, NULL, NULL); } /** * tp_channel_destroy_finish: * @self: a #TpChannel * @result: a #GAsyncResult passed to the callback for tp_channel_destroy_async(). * @error: a #GError to fill * * Completes a call to tp_channel_destroy_async(). * * Returns: %TRUE if the channel has been destroyed or closed; %FALSE otherwise * * Since: 0.15.2 */ gboolean tp_channel_destroy_finish (TpChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_destroy_async) } /** * TP_CHANNEL_FEATURE_PASSWORD: * * Expands to a call to a function that returns a quark representing the * password feature on a #TpChannel. * * When this feature is prepared, tp_channel_password_needed() and the * #TpChannel:password-needed property become useful. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.2 */ GQuark tp_channel_get_feature_quark_password (void) { return g_quark_from_static_string ("tp-channel-feature-password"); } /** * tp_channel_password_needed: * @self: a #TpChannel * * Return the #TpChannel:password-needed property * * Returns: the value of #TpChannel:password-needed * * Since: 0.15.2 */ gboolean tp_channel_password_needed (TpChannel *self) { return self->priv->password_flags & TP_CHANNEL_PASSWORD_FLAG_PROVIDE; } static void provide_password_cb (TpChannel *self, gboolean correct, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { g_simple_async_result_set_from_error (result, error); } else if (!correct) { DEBUG ("Wrong password provided for %s", tp_proxy_get_object_path (self)); g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_AUTHENTICATION_FAILED, "Password was not correct"); } g_simple_async_result_complete_in_idle (result); } /** * tp_channel_provide_password_async: * @self: a #TpChannel * @password: the password * @callback: a callback to call when @password has been provided * @user_data: data to pass to @callback * * Provide @password so that @self can be joined. * This function must be called with the correct password in order for * channel joining to proceed if the TpChannel:password-needed property * is set. * * Once the password has been provided, @callback will be * called. You can then call tp_channel_provide_password_finish() * to get the result of the operation. * * Since: 0.15.2 */ void tp_channel_provide_password_async (TpChannel *self, const gchar *password, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_provide_password_async); tp_cli_channel_interface_password_call_provide_password (self, -1, password, provide_password_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_channel_provide_password_finish: * @self: a #TpChannel * @result: a #GAsyncResult passed to the callback for * tp_channel_provide_password_async(). * @error: a #GError to fill * * Completes a call to tp_channel_provide_password_async(). * If the password was rejected, the operation * fails with #TP_ERROR_AUTHENTICATION_FAILED. * * Returns: %TRUE if the password has been provided and accepted, * %FALSE otherwise. * * Since: 0.15.2 */ gboolean tp_channel_provide_password_finish (TpChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_provide_password_async); } telepathy-glib-0.24.2/telepathy-glib/channel.h0000644000175000017500000002166112652510705016136 00000000000000/* * channel.h - proxy for a Telepathy channel * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CHANNEL_H__ #define __TP_CHANNEL_H__ #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpChannel TpChannel; typedef struct _TpChannelPrivate TpChannelPrivate; typedef struct _TpChannelClass TpChannelClass; struct _TpChannelClass { TpProxyClass parent_class; /**/ GCallback _1; GCallback _2; GCallback _3; GCallback _4; }; struct _TpChannel { /**/ TpProxy parent; TpChannelPrivate *priv; }; GType tp_channel_get_type (void); #define TP_ERRORS_REMOVED_FROM_GROUP (tp_errors_removed_from_group_quark ()) GQuark tp_errors_removed_from_group_quark (void); /* TYPE MACROS */ #define TP_TYPE_CHANNEL \ (tp_channel_get_type ()) #define TP_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_CHANNEL, \ TpChannel)) #define TP_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_CHANNEL, \ TpChannelClass)) #define TP_IS_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_CHANNEL)) #define TP_IS_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_CHANNEL)) #define TP_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL, \ TpChannelClass)) _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_channel) TpChannel *tp_channel_new (TpConnection *conn, const gchar *object_path, const gchar *optional_channel_type, TpHandleType optional_handle_type, TpHandle optional_handle, GError **error) G_GNUC_WARN_UNUSED_RESULT; _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_channel) TpChannel *tp_channel_new_from_properties (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_18 gboolean tp_channel_run_until_ready (TpChannel *self, GError **error, GMainLoop **loop); typedef void (*TpChannelWhenReadyCb) (TpChannel *channel, const GError *error, gpointer user_data); _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_prepare_async) void tp_channel_call_when_ready (TpChannel *self, TpChannelWhenReadyCb callback, gpointer user_data); _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_is_prepared) gboolean tp_channel_is_ready (TpChannel *self); #endif void tp_channel_init_known_interfaces (void); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_channel_get_connection) TpConnection *tp_channel_borrow_connection (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dup_immutable_properties) GHashTable *tp_channel_borrow_immutable_properties (TpChannel *self); #endif _TP_AVAILABLE_IN_0_20 TpConnection *tp_channel_get_connection (TpChannel *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_channel_dup_immutable_properties (TpChannel *self); void tp_channel_leave_async (TpChannel *self, TpChannelGroupChangeReason reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_leave_finish (TpChannel *self, GAsyncResult *result, GError **error); void tp_channel_close_async (TpChannel *self, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_close_finish (TpChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_channel_destroy_async (TpChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_destroy_finish (TpChannel *self, GAsyncResult *result, GError **error); gboolean tp_channel_get_requested (TpChannel *self); #define TP_CHANNEL_FEATURE_CORE \ tp_channel_get_feature_quark_core () GQuark tp_channel_get_feature_quark_core (void) G_GNUC_CONST; const gchar *tp_channel_get_channel_type (TpChannel *self); GQuark tp_channel_get_channel_type_id (TpChannel *self); TpHandle tp_channel_get_handle (TpChannel *self, TpHandleType *handle_type); const gchar *tp_channel_get_identifier (TpChannel *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_channel_get_initiator_contact) TpHandle tp_channel_get_initiator_handle (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_get_initiator_contact) const gchar * tp_channel_get_initiator_identifier (TpChannel *self); #endif #define TP_CHANNEL_FEATURE_GROUP \ tp_channel_get_feature_quark_group () GQuark tp_channel_get_feature_quark_group (void) G_GNUC_CONST; TpChannelGroupFlags tp_channel_group_get_flags (TpChannel *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_get_self_contact) TpHandle tp_channel_group_get_self_handle (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_dup_members_contacts) const TpIntset *tp_channel_group_get_members (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_dup_local_pending_contacts) const TpIntset *tp_channel_group_get_local_pending (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_dup_remote_pending_contacts) const TpIntset *tp_channel_group_get_remote_pending (TpChannel *self); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_get_local_pending_contact_info) gboolean tp_channel_group_get_local_pending_info (TpChannel *self, TpHandle local_pending, TpHandle *actor, TpChannelGroupChangeReason *reason, const gchar **message); _TP_DEPRECATED_IN_0_20_FOR (tp_channel_group_get_contact_owner) TpHandle tp_channel_group_get_handle_owner (TpChannel *self, TpHandle handle); #endif _TP_AVAILABLE_IN_0_16 void tp_channel_join_async (TpChannel *self, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_join_finish (TpChannel *self, GAsyncResult *result, GError **error); #define TP_CHANNEL_FEATURE_CONTACTS \ tp_channel_get_feature_quark_contacts () _TP_AVAILABLE_IN_0_16 GQuark tp_channel_get_feature_quark_contacts (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 TpContact *tp_channel_get_target_contact (TpChannel *self); _TP_AVAILABLE_IN_0_16 TpContact *tp_channel_get_initiator_contact (TpChannel *self); _TP_AVAILABLE_IN_0_16 TpContact *tp_channel_group_get_self_contact (TpChannel *self); _TP_AVAILABLE_IN_0_16 GPtrArray *tp_channel_group_dup_members_contacts (TpChannel *self); _TP_AVAILABLE_IN_0_16 GPtrArray *tp_channel_group_dup_local_pending_contacts (TpChannel *self); _TP_AVAILABLE_IN_0_16 GPtrArray *tp_channel_group_dup_remote_pending_contacts (TpChannel *self); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_group_get_local_pending_contact_info (TpChannel *self, TpContact *local_pending, TpContact **actor, TpChannelGroupChangeReason *reason, const gchar **message); _TP_AVAILABLE_IN_0_16 TpContact *tp_channel_group_get_contact_owner (TpChannel *self, TpContact *contact); #define TP_CHANNEL_FEATURE_CHAT_STATES \ tp_channel_get_feature_quark_chat_states () _TP_DEPRECATED_IN_0_20_FOR(tp_text_channel_get_feature_quark_chat_states) GQuark tp_channel_get_feature_quark_chat_states (void) G_GNUC_CONST; _TP_DEPRECATED_IN_0_20_FOR(tp_text_channel_get_chat_state) TpChannelChatState tp_channel_get_chat_state (TpChannel *self, TpHandle contact); /* Channel.Interface.Password */ #define TP_CHANNEL_FEATURE_PASSWORD \ tp_channel_get_feature_quark_password () _TP_AVAILABLE_IN_0_16 GQuark tp_channel_get_feature_quark_password (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 gboolean tp_channel_password_needed (TpChannel *self); _TP_AVAILABLE_IN_0_16 void tp_channel_provide_password_async (TpChannel *self, const gchar *password, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_provide_password_finish (TpChannel *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/debug.xml0000644000175000017500000000033412652510705016157 00000000000000 Debug interfaces telepathy-glib-0.24.2/telepathy-glib/codegen.am0000644000175000017500000002335012652510705016275 00000000000000# To be included by Makefile.am. codegen_extra_dist = \ account.xml \ account-manager.xml \ call-content.xml \ call-content-media-description.xml \ call-stream.xml \ call-stream-endpoint.xml \ channel.xml \ channel-dispatcher.xml \ channel-dispatch-operation.xml \ channel-request.xml \ client.xml \ debug.xml \ connection.xml \ connection-manager.xml \ dbus-daemon.xml \ dbus-introspectable.xml \ dbus-peer.xml \ dbus-properties.xml \ generic.xml \ genums.c.template \ genums.h.template \ media-session-handler.xml \ media-stream-handler.xml \ protocol.xml \ stable-interfaces.xml \ tls-cert.xml codegen_sources = \ $(nodist_libtelepathy_glib_internal_la_SOURCES) \ $(nodist_geninclude_HEADERS) \ _gen/stable-spec.xml \ _gen/spec-stamp \ _gen/stable-stamp \ _gen/reentrant-methods.list nodist_geninclude_HEADERS = \ _gen/error-str.h \ _gen/telepathy-enums.h \ _gen/telepathy-interfaces.h \ _gen/genums.h \ _gen/gtypes.h \ _gen/tp-cli-account.h \ _gen/tp-cli-account-manager.h \ _gen/tp-cli-call-content.h \ _gen/tp-cli-call-content-media-description.h \ _gen/tp-cli-call-stream.h \ _gen/tp-cli-call-stream-endpoint.h \ _gen/tp-cli-channel.h \ _gen/tp-cli-channel-dispatcher.h \ _gen/tp-cli-channel-dispatch-operation.h \ _gen/tp-cli-channel-request.h \ _gen/tp-cli-client.h \ _gen/tp-cli-connection.h \ _gen/tp-cli-connection-manager.h \ _gen/tp-cli-dbus-daemon.h \ _gen/tp-cli-debug.h \ _gen/tp-cli-generic.h \ _gen/tp-cli-media-session-handler.h \ _gen/tp-cli-media-stream-handler.h \ _gen/tp-cli-protocol.h \ _gen/tp-cli-tls-cert.h \ _gen/tp-svc-account.h \ _gen/tp-svc-account-manager.h \ _gen/tp-svc-call-content.h \ _gen/tp-svc-call-content-media-description.h \ _gen/tp-svc-call-stream.h \ _gen/tp-svc-call-stream-endpoint.h \ _gen/tp-svc-channel.h \ _gen/tp-svc-channel-dispatcher.h \ _gen/tp-svc-channel-dispatch-operation.h \ _gen/tp-svc-channel-request.h \ _gen/tp-svc-client.h \ _gen/tp-svc-connection.h \ _gen/tp-svc-connection-manager.h \ _gen/tp-svc-debug.h \ _gen/tp-svc-generic.h \ _gen/tp-svc-media-session-handler.h \ _gen/tp-svc-media-stream-handler.h \ _gen/tp-svc-protocol.h \ _gen/tp-svc-tls-cert.h nodist_libtelepathy_glib_internal_la_SOURCES = \ _gen/error-str.c \ _gen/interfaces-body.h \ _gen/genums.c \ _gen/gtypes-body.h \ _gen/register-dbus-glib-marshallers-body.h \ _gen/tp-cli-account-body.h \ _gen/tp-cli-account-manager-body.h \ _gen/tp-cli-call-content-body.h \ _gen/tp-cli-call-content-media-description-body.h \ _gen/tp-cli-call-stream-body.h \ _gen/tp-cli-call-stream-endpoint-body.h \ _gen/tp-cli-channel-body.h \ _gen/tp-cli-channel-dispatcher-body.h \ _gen/tp-cli-channel-dispatch-operation-body.h \ _gen/tp-cli-channel-request-body.h \ _gen/tp-cli-client-body.h \ _gen/tp-cli-connection-body.h \ _gen/tp-cli-connection-manager-body.h \ _gen/tp-cli-dbus-daemon-body.h \ _gen/tp-cli-debug-body.h \ _gen/tp-cli-generic-body.h \ _gen/tp-cli-media-session-handler-body.h \ _gen/tp-cli-media-stream-handler-body.h \ _gen/tp-cli-protocol-body.h \ _gen/tp-cli-tls-cert-body.h \ _gen/tp-svc-account.c \ _gen/tp-svc-account-manager.c \ _gen/tp-svc-call-content.c \ _gen/tp-svc-call-content-media-description.c \ _gen/tp-svc-call-stream.c \ _gen/tp-svc-call-stream-endpoint.c \ _gen/tp-svc-channel.c \ _gen/tp-svc-channel-dispatcher.c \ _gen/tp-svc-channel-dispatch-operation.c \ _gen/tp-svc-channel-request.c \ _gen/tp-svc-client.c \ _gen/tp-svc-connection.c \ _gen/tp-svc-connection-manager.c \ _gen/tp-svc-debug.c \ _gen/tp-svc-generic.c \ _gen/tp-svc-media-session-handler.c \ _gen/tp-svc-media-stream-handler.c \ _gen/tp-svc-protocol.c \ _gen/tp-svc-tls-cert.c # Generated stuff DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g' tools_dir = $(top_srcdir)/tools # Bootstrapping _gen/spec-stamp: $(wildcard $(top_srcdir)/spec/*.xml) $(MKDIR_P) _gen touch $@ _gen/stable-stamp: $(wildcard $(abs_srcdir)/*.xml) _gen/spec-stamp touch $@ _gen/stable-spec.xml: stable-interfaces.xml _gen/stable-stamp $(tools_dir)/xincludator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@.tmp @mv $@.tmp $@ # Grab a list of re-entrant tp_cli_*_run_* methods we are committed to # generating for backwards compatibility. # grep --no-filename is not portable :-( _gen/reentrant-methods.list: _gen/spec-stamp $(ABI_LISTS) codegen.am $(AM_V_GEN)( cd $(srcdir) && cat $(ABI_LISTS) ) | \ $(GREP) '^tp_cli_.*_run_.*' > $@.tmp @mv $@.tmp $@ # Things generated from the whole spec at once # do nothing, output as a side-effect _gen/gtypes.h: _gen/gtypes-body.h @: _gen/gtypes-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \ _gen/stable-spec.xml \ _gen/gtypes Tp _gen/telepathy-enums.h: _gen/stable-spec.xml \ $(tools_dir)/c-constants-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Tp $< _gen/telepathy-enums # do nothing, output as a side-effect _gen/interfaces-body.h: _gen/telepathy-interfaces.h @: _gen/telepathy-interfaces.h: _gen/stable-spec.xml \ $(tools_dir)/glib-interfaces-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Tp _gen/interfaces-body.h _gen/telepathy-interfaces.h $< _gen/register-dbus-glib-marshallers-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-client-marshaller-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< _tp > $@ _gen/genums.c: _gen/spec-stamp genums.c.template $(our_headers) codegen.am $(AM_V_GEN)( cd $(srcdir) && \ $(GLIB_MKENUMS) --template genums.c.template $(our_headers) \ ) > $@ _gen/genums.h: _gen/spec-stamp genums.h.template $(our_headers) codegen.am $(AM_V_GEN)( cd $(srcdir) && \ $(GLIB_MKENUMS) --template genums.h.template $(our_headers) \ ) > $@ _gen/error-str.h: _gen/error-str.c @: # do nothing, output as a side-effect _gen/error-str.c: _gen/stable-spec.xml \ $(tools_dir)/glib-errors-str-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-errors-str-gen.py \ _gen/error-str $< # Things generated per interface _gen/tp-spec-%.xml: %.xml _gen/spec-stamp $(tools_dir)/xincludator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@.tmp @mv $@.tmp $@ # do nothing, output as a side-effect _gen/tp-svc-%.h: _gen/tp-svc-%.c @: _gen/tp-svc-%.c: _gen/tp-spec-%.xml \ $(tools_dir)/glib-ginterface-gen.py \ codegen.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/tp-svc-$* \ --signal-marshal-prefix=_tp \ --include='' \ --include='' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ $< Tp_Svc_ # do nothing, output as a side-effect _gen/tp-cli-%.h: _gen/tp-cli-%-body.h @: _gen/tp-cli-%-body.h: _gen/tp-spec-%.xml \ _gen/reentrant-methods.list \ $(tools_dir)/glib-client-gen.py \ codegen.am $(AM_V_GEN)set -e; \ subclass= ; \ subclass_assert= ; \ case $* in \ generic) \ ;; \ account-manager) \ subclass=--subclass=TpAccountManager; \ subclass_assert=--subclass-assert=TP_IS_ACCOUNT_MANAGER; \ ;; \ account) \ subclass=--subclass=TpAccount; \ subclass_assert=--subclass-assert=TP_IS_ACCOUNT; \ ;; \ call-content) \ subclass=--subclass=TpCallContent; \ subclass_assert=--subclass-assert=TP_IS_CALL_CONTENT; \ ;; \ call-stream) \ subclass=--subclass=TpCallStream; \ subclass_assert=--subclass-assert=TP_IS_CALL_STREAM; \ ;; \ channel) \ subclass=--subclass=TpChannel; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL; \ ;; \ channel-dispatcher) \ subclass=--subclass=TpChannelDispatcher; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_DISPATCHER; \ ;; \ channel-dispatch-operation) \ subclass=--subclass=TpChannelDispatchOperation; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_DISPATCH_OPERATION; \ ;; \ channel-request) \ subclass=--subclass=TpChannelRequest; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_REQUEST; \ ;; \ client) \ subclass=--subclass=TpClient; \ subclass_assert=--subclass-assert=TP_IS_CLIENT; \ ;; \ connection-manager) \ subclass=--subclass=TpConnectionManager; \ subclass_assert=--subclass-assert=TP_IS_CONNECTION_MANAGER \ ;; \ connection) \ subclass=--subclass=TpConnection; \ subclass_assert=--subclass-assert=TP_IS_CONNECTION; \ ;; \ media-session-handler) \ subclass=--subclass=TpMediaSessionHandler; \ subclass_assert=--subclass-assert=TP_IS_MEDIA_SESSION_HANDLER; \ ;; \ media-stream-handler) \ subclass=--subclass=TpMediaStreamHandler; \ subclass_assert=--subclass-assert=TP_IS_MEDIA_STREAM_HANDLER; \ ;; \ dbus-daemon) \ subclass=--subclass=TpDBusDaemon; \ subclass_assert=--subclass-assert=TP_IS_DBUS_DAEMON; \ ;; \ debug) \ subclass=--subclass=TpDebugClient; \ subclass_assert=--subclass-assert=TP_IS_DEBUG_CLIENT; \ ;; \ tls-cert) \ subclass=--subclass=TpTLSCertificate; \ subclass_assert=--subclass-assert=TP_IS_TLS_CERTIFICATE; \ ;; \ esac; \ $(PYTHON) $(tools_dir)/glib-client-gen.py \ $$subclass $$subclass_assert \ --group `echo $* | tr - _` \ --guard "TP_GEN_TP_CLI_`echo $* | tr a-z- A-Z_`_H_INCLUDED" \ --iface-quark-prefix=TP_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ --deprecation-attribute=_TP_GNUC_DEPRECATED \ --deprecate-reentrant=TP_DISABLE_DEPRECATED \ --generate-reentrant=_gen/reentrant-methods.list \ $< Tp_Cli _gen/tp-cli-$* # vim:set ft=automake: telepathy-glib-0.24.2/telepathy-glib/connection-manager.c0000644000175000017500000023713212652510705020272 00000000000000/* * connection-manager.c - proxy for a Telepathy connection manager * * Copyright (C) 2007-2009 Collabora Ltd. * Copyright (C) 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection-manager.h" #include #include "telepathy-glib/defs.h" #include "telepathy-glib/enums.h" #include "telepathy-glib/errors.h" #include "telepathy-glib/gtypes.h" #include #include #include #include "telepathy-glib/util.h" #define DEBUG_FLAG TP_DEBUG_MANAGER #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/protocol-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/_gen/tp-cli-connection-manager-body.h" /** * SECTION:connection-manager * @title: TpConnectionManager * @short_description: proxy object for a Telepathy connection manager * @see_also: #TpConnection * * #TpConnectionManager objects represent Telepathy connection managers. They * can be used to open connections. * * Since: 0.7.1 */ /** * TpConnectionManagerListCb: * @cms: (array zero-terminated=1): %NULL-terminated array of * #TpConnectionManager (the objects will * be unreferenced and the array will be freed after the callback returns, * so the callback must reference any CMs it stores a pointer to), * or %NULL on error * @n_cms: number of connection managers in @cms (not including the final * %NULL) * @error: %NULL on success, or an error that occurred * @user_data: user-supplied data * @weak_object: user-supplied weakly referenced object * * Signature of the callback supplied to tp_list_connection_managers(). * * Since 0.11.3, tp_list_connection_managers() will * wait for %TP_CONNECTION_MANAGER_FEATURE_CORE to be prepared on each * connection manager passed to @callback, unless an error occurred while * launching that connection manager. * * Since: 0.7.1 */ /** * TP_CONNECTION_MANAGER_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpConnectionManager. * * After this feature is prepared, basic information about the connection * manager's protocols (tp_connection_manager_dup_protocols()), and their * available parameters, will have been retrieved, either by activating the * connection manager over D-Bus or by reading the .manager file in which * that information is cached. * * Since 0.11.11, this feature also finds any extra interfaces that * this connection manager has, and adds them to #TpProxy:interfaces (where * they can be queried with tp_proxy_has_interface()). * * (These are the same guarantees offered by the older * tp_connection_manager_call_when_ready() mechanism.) * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_connection_manager_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-connection-manager-feature-core"); } /** * TpCMInfoSource: * @TP_CM_INFO_SOURCE_NONE: no information available * @TP_CM_INFO_SOURCE_FILE: information came from a .manager file * @TP_CM_INFO_SOURCE_LIVE: information came from the connection manager * * Describes possible sources of information on connection managers' * supported protocols. * * Since 0.11.5, there is a corresponding #GEnumClass type, * %TP_TYPE_CM_INFO_SOURCE. * * Since: 0.7.1 */ /** * TP_TYPE_CM_INFO_SOURCE: * * The #GEnumClass type of a #TpCMInfoSource. * * Since: 0.11.5 */ /** * TpConnectionManagerClass: * * The class of a #TpConnectionManager. * * Since: 0.7.1 */ enum { SIGNAL_ACTIVATED, SIGNAL_GOT_INFO, SIGNAL_EXITED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; enum { PROP_INFO_SOURCE = 1, PROP_MANAGER_FILE, PROP_ALWAYS_INTROSPECT, PROP_CONNECTION_MANAGER, PROP_CM_NAME, N_PROPS }; /** * TpConnectionManager: * * A proxy object for a Telepathy connection manager. * * This might represent a connection manager which is currently running * (in which case it can be introspected) or not (in which case its * capabilities can be read from .manager files in the filesystem). * Accordingly, this object never emits #TpProxy::invalidated unless all * references to it are discarded. * * Various fields and methods on this object do not work until * %TP_CONNECTION_MANAGER_FEATURE_CORE is prepared. Use * tp_proxy_prepare_async() to wait for this to happen. * * Since 0.19.1, accessing the fields of this struct is deprecated, * and they are no longer documented here. * Use the accessors tp_connection_manager_get_name(), * tp_connection_manager_is_running(), * tp_connection_manager_dup_protocols(), * tp_connection_manager_get_info_source() * and the #TpConnectionManager:always-introspect property instead. * * Since: 0.7.1 */ /** * TpConnectionManagerParam: * * Structure representing a connection manager parameter. * * Since 0.19.1, accessing the fields of this struct is deprecated, * and they are no longer documented here. * Use the accessors tp_connection_manager_param_get_name(), * tp_connection_manager_param_get_dbus_signature(), * tp_connection_manager_param_is_required(), * tp_connection_manager_param_is_required_for_registration(), * tp_connection_manager_param_is_secret(), * tp_connection_manager_param_is_dbus_property(), * tp_connection_manager_param_get_default(), * tp_connection_manager_param_dup_default_variant() instead. * * Since: 0.7.1 */ /** * TpConnectionManagerProtocol: * @name: The name of this connection manager * @params: Array of #TpConnectionManagerParam structures, terminated by * a structure whose @name is %NULL * * Structure representing a protocol supported by a connection manager. * Note that the size of this structure may change, so its size must not be * relied on. * * Since: 0.7.1 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ typedef enum { INTROSPECT_IDLE, INTROSPECT_GETTING_PROPERTIES, INTROSPECT_LISTING_PROTOCOLS, INTROSPECT_GETTING_PARAMETERS } IntrospectionStep; struct _TpConnectionManagerPrivate { /* absolute path to .manager file */ gchar *manager_file; /* source ID for reading the manager file later */ guint manager_file_read_idle_id; /* source ID for introspecting later */ guint introspect_idle_id; /* TRUE if dispose() has run already */ unsigned disposed:1; /* dup'd name => referenced TpProtocol, corresponding exactly to * @protocol_structs */ GHashTable *protocol_objects; /* GPtrArray of TpConnectionManagerProtocol *. This is the implementation * for self->protocols. Each item is borrowed from the corresponding * object in protocol_objects. * * NULL if file_info and live_info are both FALSE * Protocols from file, if file_info is TRUE but live_info is FALSE * Protocols from last time introspecting the CM succeeded, if live_info * is TRUE */ GPtrArray *protocol_structs; /* If we're waiting for a GetParameters, then GPtrArray of g_strdup'd * gchar * representing protocols we haven't yet introspected. * Otherwise NULL */ GPtrArray *pending_protocols; /* dup'd name => referenced TpProtocol * * If we're waiting for a GetParameters, protocols we found so far for * the introspection that is in progress (will replace protocol_objects * when finished). Otherwise NULL */ GHashTable *found_protocols; /* list of WhenReadyContext */ GList *waiting_for_ready; /* things we introspected so far */ IntrospectionStep introspection_step; /* the method call currently pending, or NULL if none. */ TpProxyPendingCall *introspection_call; /* FALSE if initial name-owner (if any) hasn't been found yet */ gboolean name_known; /* TRUE if someone asked us to activate but we're putting it off until * name_known */ gboolean want_activation; /* TRUE if the CM exited (crashed?) during introspection. * We'll retry, but only once. */ gboolean retried_introspection; }; G_DEFINE_TYPE (TpConnectionManager, tp_connection_manager, TP_TYPE_PROXY) static void _tp_connection_manager_param_copy_contents ( const TpConnectionManagerParam *in, TpConnectionManagerParam *out) { out->name = g_strdup (in->name); out->dbus_signature = g_strdup (in->dbus_signature); out->flags = in->flags; if (G_IS_VALUE (&in->default_value)) { g_value_init (&out->default_value, G_VALUE_TYPE (&in->default_value)); g_value_copy (&in->default_value, &out->default_value); } } /** * tp_connection_manager_param_copy: * @in: the #TpConnectionManagerParam to copy * * * * Returns: a newly (slice) allocated #TpConnectionManagerParam, free with * tp_connection_manager_param_free() * * Since: 0.11.3 */ TpConnectionManagerParam * tp_connection_manager_param_copy (const TpConnectionManagerParam *in) { TpConnectionManagerParam *out = g_slice_new0 (TpConnectionManagerParam); _tp_connection_manager_param_copy_contents (in, out); return out; } /** * tp_connection_manager_param_free: * @param: the #TpConnectionManagerParam to free * * Frees @param, which was copied with tp_connection_manager_param_copy(). * * Since: 0.11.3 */ void tp_connection_manager_param_free (TpConnectionManagerParam *param) { _tp_connection_manager_param_free_contents (param); g_slice_free (TpConnectionManagerParam, param); } /** * tp_connection_manager_protocol_copy: * @in: the #TpConnectionManagerProtocol to copy * * * * Returns: a newly (slice) allocated #TpConnectionManagerProtocol, free with * tp_connection_manager_protocol_free() * * Since: 0.11.3 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ TpConnectionManagerProtocol * tp_connection_manager_protocol_copy (const TpConnectionManagerProtocol *in) { TpConnectionManagerProtocol *out = g_slice_new0 (TpConnectionManagerProtocol); TpConnectionManagerParam *param; GArray *params = g_array_new (TRUE, TRUE, sizeof (TpConnectionManagerParam)); out->name = g_strdup (in->name); for (param = in->params; param->name != NULL; param++) { TpConnectionManagerParam copy = { 0, }; _tp_connection_manager_param_copy_contents (param, ©); g_array_append_val (params, copy); } out->params = (TpConnectionManagerParam *) g_array_free (params, FALSE); return out; } /** * tp_connection_manager_protocol_free: * @proto: the #TpConnectionManagerProtocol to free * * Frees @proto, which was copied with tp_connection_manager_protocol_copy(). * * Since: 0.11.3 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ void tp_connection_manager_protocol_free (TpConnectionManagerProtocol *proto) { _tp_connection_manager_protocol_free_contents (proto); g_slice_free (TpConnectionManagerProtocol, proto); } /** * TP_TYPE_CONNECTION_MANAGER_PARAM: * * The boxed type of a #TpConnectionManagerParam. * * Since: 0.11.3 */ G_DEFINE_BOXED_TYPE (TpConnectionManagerParam, tp_connection_manager_param, tp_connection_manager_param_copy, tp_connection_manager_param_free) /** * TP_TYPE_CONNECTION_MANAGER_PROTOCOL: * * The boxed type of a #TpConnectionManagerProtocol. * * Since: 0.11.3 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS G_DEFINE_BOXED_TYPE (TpConnectionManagerProtocol, tp_connection_manager_protocol, tp_connection_manager_protocol_copy, tp_connection_manager_protocol_free) G_GNUC_END_IGNORE_DEPRECATIONS typedef struct { TpConnectionManager *cm; TpConnectionManagerWhenReadyCb callback; gpointer user_data; GDestroyNotify destroy; TpWeakRef *weak_ref; } WhenReadyContext; static void when_ready_context_free (gpointer d) { WhenReadyContext *c = d; if (c->weak_ref != NULL) { tp_weak_ref_destroy (c->weak_ref); c->weak_ref = NULL; } if (c->cm != NULL) { g_object_unref (c->cm); c->cm = NULL; } if (c->destroy != NULL) c->destroy (c->user_data); g_slice_free (WhenReadyContext, c); } static void tp_connection_manager_ready_or_failed (TpConnectionManager *self, const GError *error) { if (self->info_source > TP_CM_INFO_SOURCE_NONE) { /* we have info already, so suppress any error and return the old info */ error = NULL; } else { g_assert (error != NULL); } if (error == NULL) { _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CONNECTION_MANAGER_FEATURE_CORE, TRUE); } else { _tp_proxy_set_features_failed ((TpProxy *) self, error); } } static void tp_connection_manager_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { WhenReadyContext *c = user_data; GError *error = NULL; GObject *weak_object = NULL; g_return_if_fail (source_object == (GObject *) c->cm); if (c->weak_ref != NULL) { weak_object = tp_weak_ref_dup_object (c->weak_ref); if (weak_object == NULL) goto finally; } if (tp_proxy_prepare_finish (source_object, res, &error)) { c->callback (c->cm, NULL, c->user_data, weak_object); } else { g_assert (error != NULL); c->callback (c->cm, error, c->user_data, weak_object); g_error_free (error); } finally: if (weak_object != NULL) g_object_unref (weak_object); when_ready_context_free (c); } /** * TpConnectionManagerWhenReadyCb: * @cm: a connection manager * @error: %NULL on success, or the reason why tp_connection_manager_is_ready() * would return %FALSE * @user_data: the @user_data passed to tp_connection_manager_call_when_ready() * @weak_object: the @weak_object passed to * tp_connection_manager_call_when_ready() * * Called as the result of tp_connection_manager_call_when_ready(). If the * connection manager's protocol and parameter information could be retrieved, * @error is %NULL and @cm is considered to be ready. Otherwise, @error is * non-%NULL and @cm is not ready. * * Deprecated: since 0.17.6, use tp_proxy_prepare_async() instead */ /** * tp_connection_manager_call_when_ready: (skip) * @self: a connection manager * @callback: callback to call when information has been retrieved or on * error * @user_data: arbitrary data to pass to the callback * @destroy: called to destroy @user_data * @weak_object: object to reference weakly; if it is destroyed, @callback * will not be called, but @destroy will still be called * * Call the @callback from the main loop when information about @cm's * supported protocols and parameters has been retrieved. * * Since: 0.7.26 * Deprecated: since 0.17.6, use tp_proxy_prepare_async() instead */ void tp_connection_manager_call_when_ready (TpConnectionManager *self, TpConnectionManagerWhenReadyCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { WhenReadyContext *c; g_return_if_fail (TP_IS_CONNECTION_MANAGER (self)); g_return_if_fail (callback != NULL); c = g_slice_new0 (WhenReadyContext); c->cm = g_object_ref (self); c->callback = callback; c->user_data = user_data; c->destroy = destroy; if (weak_object != NULL) { c->weak_ref = tp_weak_ref_new (weak_object, NULL, NULL); } tp_proxy_prepare_async (self, NULL, tp_connection_manager_ready_cb, c); } static void tp_connection_manager_continue_introspection (TpConnectionManager *self); static void tp_connection_manager_got_parameters (TpConnectionManager *self, const GPtrArray *parameters, const GError *error, gpointer user_data, GObject *user_object) { gchar *protocol = user_data; TpProtocol *proto_object; GHashTable *immutables; g_assert (self->priv->introspection_step == INTROSPECT_GETTING_PARAMETERS); g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error != NULL) { DEBUG ("%s/%s: error from legacy GetParameters, skipping protocol: " "%s #%d: %s", self->name, protocol, g_quark_to_string (error->domain), error->code, error->message); goto out; } DEBUG ("%s/%s: legacy GetParameters() returned %d parameters", self->name, protocol, parameters->len); immutables = tp_asv_new ( TP_PROP_PROTOCOL_PARAMETERS, TP_ARRAY_TYPE_PARAM_SPEC_LIST, parameters, NULL); proto_object = tp_protocol_new (tp_proxy_get_dbus_daemon (self), self->name, protocol, immutables, NULL); g_hash_table_unref (immutables); /* tp_protocol_new can currently only fail because of malformed names, * and we already checked those */ g_assert (proto_object != NULL); g_hash_table_insert (self->priv->found_protocols, g_strdup (protocol), proto_object); out: tp_connection_manager_continue_introspection (self); } static void tp_connection_manager_ready_or_failed (TpConnectionManager *self, const GError *error); static void tp_connection_manager_reset_introspection (TpConnectionManager *self) { guint i; self->priv->introspection_step = INTROSPECT_IDLE; if (self->priv->introspection_call != NULL) { tp_proxy_pending_call_cancel (self->priv->introspection_call); self->priv->introspection_call = NULL; } if (self->priv->found_protocols != NULL) { g_hash_table_unref (self->priv->found_protocols); self->priv->found_protocols = NULL; } if (self->priv->pending_protocols != NULL) { for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); g_ptr_array_unref (self->priv->pending_protocols); self->priv->pending_protocols = NULL; } } static void tp_connection_manager_end_introspection (TpConnectionManager *self, const GError *error) { tp_connection_manager_reset_introspection (self); DEBUG ("%s: end of introspection, info source %s (%d)", self->name, _tp_enum_to_nick_nonnull (TP_TYPE_CM_INFO_SOURCE, self->info_source), self->info_source); g_signal_emit (self, signals[SIGNAL_GOT_INFO], 0, self->info_source); tp_connection_manager_ready_or_failed (self, error); } static void tp_connection_manager_update_protocol_structs (TpConnectionManager *self) { GHashTableIter iter; gpointer protocol_object; g_assert (self->priv->protocol_objects != NULL); if (self->priv->protocol_structs != NULL) g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = g_ptr_array_sized_new ( g_hash_table_size (self->priv->protocol_objects) + 1); g_hash_table_iter_init (&iter, self->priv->protocol_objects); while (g_hash_table_iter_next (&iter, NULL, &protocol_object)) { g_ptr_array_add (self->priv->protocol_structs, _tp_protocol_get_struct (protocol_object)); } g_ptr_array_add (self->priv->protocol_structs, NULL); self->protocols = (const TpConnectionManagerProtocol * const *) self->priv->protocol_structs->pdata; } static void tp_connection_manager_get_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer nil G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { TpConnectionManager *self = (TpConnectionManager *) proxy; g_assert (TP_IS_CONNECTION_MANAGER (self)); g_assert (self->priv->introspection_step == INTROSPECT_GETTING_PROPERTIES); g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error == NULL) { GHashTable *protocols; tp_proxy_add_interfaces (proxy, tp_asv_get_strv (properties, "Interfaces")); protocols = tp_asv_get_boxed (properties, "Protocols", TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP); if (protocols != NULL) { GHashTableIter iter; gpointer k, v; DEBUG ("%s: %u Protocols from GetAll()", self->name, g_hash_table_size (protocols)); g_assert (self->priv->found_protocols == NULL); self->priv->found_protocols = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); g_hash_table_iter_init (&iter, protocols); while (g_hash_table_iter_next (&iter, &k, &v)) { const gchar *name = k; GHashTable *protocol_properties = v; if (tp_connection_manager_check_valid_protocol_name (name, NULL)) { TpProtocol *proto_object = tp_protocol_new ( tp_proxy_get_dbus_daemon (self), self->name, name, protocol_properties, NULL); /* tp_protocol_new can currently only fail because of * malformed names, and we already checked for that */ g_assert (proto_object != NULL); g_hash_table_insert (self->priv->found_protocols, g_strdup (name), proto_object); } else { INFO ("ignoring invalid Protocol name %s from %s", name, tp_proxy_get_object_path (self)); } } } else { DEBUG ("%s: no Protocols property in GetAll() (old CM?)", self->name); } } else { DEBUG ("%s: ignoring error getting CM properties (old CM?): " "%s %d: %s", self->name, g_quark_to_string (error->domain), error->code, error->message); } tp_connection_manager_continue_introspection (self); } static void tp_connection_manager_got_protocols (TpConnectionManager *self, const gchar **protocols, const GError *error, gpointer user_data, GObject *user_object); static void tp_connection_manager_continue_introspection (TpConnectionManager *self) { gchar *next_protocol; DEBUG ("%s", self->name); if (self->priv->introspection_step == INTROSPECT_IDLE) { DEBUG ("%s: calling GetAll on CM", self->name); self->priv->introspection_step = INTROSPECT_GETTING_PROPERTIES; self->priv->introspection_call = tp_cli_dbus_properties_call_get_all ( self, -1, TP_IFACE_CONNECTION_MANAGER, tp_connection_manager_get_all_cb, NULL, NULL, NULL); return; } if (self->priv->introspection_step == INTROSPECT_GETTING_PROPERTIES) { g_assert (self->priv->pending_protocols == NULL); if (self->priv->found_protocols == NULL) { DEBUG ("%s: calling legacy ListProtocols on CM", self->name); self->priv->introspection_step = INTROSPECT_LISTING_PROTOCOLS; self->priv->introspection_call = tp_cli_connection_manager_call_list_protocols (self, -1, tp_connection_manager_got_protocols, NULL, NULL, NULL); return; } /* else we already found the protocols and their parameters, so behave * as though we'd already called GetParameters n times */ } if (self->priv->pending_protocols == NULL || self->priv->pending_protocols->len == 0) { GHashTable *tmp; guint old; /* swap found_protocols and protocol_objects, so we'll free the old * protocol_objects as part of end_introspection */ tmp = self->priv->protocol_objects; self->priv->protocol_objects = self->priv->found_protocols; self->priv->found_protocols = tmp; tp_connection_manager_update_protocol_structs (self); old = self->info_source; self->info_source = TP_CM_INFO_SOURCE_LIVE; if (old != TP_CM_INFO_SOURCE_LIVE) g_object_notify ((GObject *) self, "info-source"); tp_connection_manager_end_introspection (self, NULL); g_assert (self->priv->introspection_step == INTROSPECT_IDLE); } else { next_protocol = g_ptr_array_remove_index_fast ( self->priv->pending_protocols, 0); self->priv->introspection_step = INTROSPECT_GETTING_PARAMETERS; DEBUG ("%s/%s: calling legacy ListProtocols", self->name, next_protocol); self->priv->introspection_call = tp_cli_connection_manager_call_get_parameters (self, -1, next_protocol, tp_connection_manager_got_parameters, next_protocol, g_free, NULL); } } static void tp_connection_manager_got_protocols (TpConnectionManager *self, const gchar **protocols, const GError *error, gpointer user_data, GObject *user_object) { guint i = 0; const gchar **iter; g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error != NULL) { DEBUG ("%s: legacy GetProtocols() failed: %s #%d: %s", self->name, g_quark_to_string (error->domain), error->code, error->message); if (!self->running) { /* ListProtocols failed to start it - we assume this is because * activation failed */ DEBUG ("%s: ListProtocols didn't start it: activation failure?", self->name); g_signal_emit (self, signals[SIGNAL_EXITED], 0); } tp_connection_manager_end_introspection (self, error); return; } for (iter = protocols; *iter != NULL; iter++) i++; DEBUG ("%s: legacy GetProtocols() returned %u protocols", self->name, i); g_assert (self->priv->found_protocols == NULL); self->priv->found_protocols = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); g_assert (self->priv->pending_protocols == NULL); self->priv->pending_protocols = g_ptr_array_sized_new (i); for (iter = protocols; *iter != NULL; iter++) { if (!tp_connection_manager_check_valid_protocol_name (*iter, NULL)) { DEBUG ("%s: protocol %s has an invalid name", self->name, *iter); continue; } g_ptr_array_add (self->priv->pending_protocols, g_strdup (*iter)); } tp_connection_manager_continue_introspection (self); } static gboolean introspection_in_progress (TpConnectionManager *self) { return (self->priv->introspection_call != NULL || self->priv->found_protocols != NULL); } static gboolean tp_connection_manager_idle_introspect (gpointer data) { TpConnectionManager *self = data; /* Start introspecting if we want to and we're not already */ if (!introspection_in_progress (self) && (self->always_introspect || self->info_source == TP_CM_INFO_SOURCE_NONE)) { tp_connection_manager_continue_introspection (self); } self->priv->introspect_idle_id = 0; return FALSE; } static gboolean tp_connection_manager_idle_read_manager_file (gpointer data); static void tp_connection_manager_name_owner_changed_cb (TpDBusDaemon *bus, const gchar *name, const gchar *new_owner, gpointer user_data) { TpConnectionManager *self = user_data; /* make sure self exists for the duration of this callback */ g_object_ref (self); if (new_owner[0] == '\0') { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "Connection manager process exited during introspection" }; self->running = FALSE; /* cancel pending introspection, if any */ if (introspection_in_progress (self)) { if (self->priv->retried_introspection) { DEBUG ("%s: %s, twice: assuming fatal and not retrying", self->name, e.message); tp_connection_manager_end_introspection (self, &e); } else { self->priv->retried_introspection = TRUE; DEBUG ("%s: %s: retrying", self->name, e.message); tp_connection_manager_reset_introspection (self); tp_connection_manager_continue_introspection (self); } } /* If our name wasn't known already, a change to "" is just the initial * state, so we didn't *exit* as such. */ if (self->priv->name_known) { DEBUG ("%s: exited", self->name); g_signal_emit (self, signals[SIGNAL_EXITED], 0); } } else { /* represent an atomic change of ownership as if it was an exit and * restart */ if (self->running) { DEBUG ("%s: atomic name owner change, behaving as if it exited", self->name); tp_connection_manager_name_owner_changed_cb (bus, name, "", self); DEBUG ("%s: back to normal handling", self->name); } DEBUG ("%s: is now running", self->name); self->running = TRUE; g_signal_emit (self, signals[SIGNAL_ACTIVATED], 0); if (self->priv->introspect_idle_id == 0) self->priv->introspect_idle_id = g_idle_add ( tp_connection_manager_idle_introspect, self); } /* if we haven't started introspecting yet, now would be a good time */ if (!self->priv->name_known) { DEBUG ("%s: starting introspection now we know the name owner", self->name); g_assert (self->priv->manager_file_read_idle_id == 0); /* now we know whether we're running or not, we can try reading the * .manager file... */ self->priv->manager_file_read_idle_id = g_idle_add ( tp_connection_manager_idle_read_manager_file, self); if (self->priv->want_activation && self->priv->introspect_idle_id == 0) { DEBUG ("%s: forcing introspection for its side-effect of " "activation", self->name); /* ... but if activation was requested, we should also do that */ self->priv->introspect_idle_id = g_idle_add ( tp_connection_manager_idle_introspect, self); } /* Unfreeze automatic reading of .manager file if manager-file changes */ self->priv->name_known = TRUE; } g_object_unref (self); } static gboolean tp_connection_manager_read_file (TpDBusDaemon *dbus_daemon, const gchar *cm_name, const gchar *filename, GHashTable **protocols_out, GStrv *interfaces_out, GError **error) { GKeyFile *file; gchar **groups = NULL; gchar **group; TpProtocol *proto_object; GHashTable *protocols = NULL; GStrv interfaces = NULL; file = g_key_file_new (); if (!g_key_file_load_from_file (file, filename, G_KEY_FILE_NONE, error)) return FALSE; /* if missing, it's not an error, so ignore @error */ interfaces = g_key_file_get_string_list (file, "ConnectionManager", "Interfaces", NULL, NULL); protocols = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); groups = g_key_file_get_groups (file, NULL); if (groups == NULL) goto success; for (group = groups; *group != NULL; group++) { gchar *name; GHashTable *immutables; immutables = _tp_protocol_parse_manager_file (file, cm_name, *group, &name); if (immutables == NULL) continue; proto_object = tp_protocol_new (dbus_daemon, cm_name, name, immutables, NULL); g_assert (proto_object != NULL); /* steals @name */ g_hash_table_insert (protocols, name, proto_object); g_hash_table_unref (immutables); } success: g_strfreev (groups); g_key_file_free (file); if (protocols_out != NULL) *protocols_out = protocols; else g_hash_table_unref (protocols); if (interfaces_out != NULL) *interfaces_out = interfaces; else g_strfreev (interfaces); return TRUE; } static gboolean tp_connection_manager_idle_read_manager_file (gpointer data) { TpConnectionManager *self = TP_CONNECTION_MANAGER (data); self->priv->manager_file_read_idle_id = 0; if (self->priv->protocol_objects == NULL) { if (self->priv->manager_file != NULL && self->priv->manager_file[0] != '\0') { GError *error = NULL; GHashTable *protocols; GStrv interfaces = NULL; DEBUG ("%s: reading %s", self->name, self->priv->manager_file); if (!tp_connection_manager_read_file ( tp_proxy_get_dbus_daemon (self), self->name, self->priv->manager_file, &protocols, &interfaces, &error)) { DEBUG ("%s: failed to load %s: %s #%d: %s", self->name, self->priv->manager_file, g_quark_to_string (error->domain), error->code, error->message); g_error_free (error); error = NULL; } else { tp_proxy_add_interfaces ((TpProxy *) self, (const gchar * const *) interfaces); g_strfreev (interfaces); self->priv->protocol_objects = protocols; tp_connection_manager_update_protocol_structs (self); DEBUG ("%s: got info from file", self->name); /* previously it must have been NONE */ self->info_source = TP_CM_INFO_SOURCE_FILE; g_object_ref (self); g_object_notify ((GObject *) self, "info-source"); g_signal_emit (self, signals[SIGNAL_GOT_INFO], 0, self->info_source); tp_connection_manager_ready_or_failed (self, NULL); g_object_unref (self); goto out; } } if (self->priv->introspect_idle_id == 0) { DEBUG ("%s: no .manager file or failed to parse it, trying to " "activate CM instead", self->name); tp_connection_manager_idle_introspect (self); } else { DEBUG ("%s: no .manager file, but will activate CM soon anyway", self->name); } } else { DEBUG ("%s: not reading manager file, %u protocols already discovered", self->name, g_hash_table_size (self->priv->protocol_objects)); } out: return FALSE; } static gchar * tp_connection_manager_find_manager_file (const gchar *name) { gchar *filename; const gchar * const * data_dirs; g_assert (name != NULL); filename = g_strdup_printf ("%s/telepathy/managers/%s.manager", g_get_user_data_dir (), name); DEBUG ("in XDG_DATA_HOME: trying %s", filename); if (g_file_test (filename, G_FILE_TEST_EXISTS)) return filename; g_free (filename); for (data_dirs = g_get_system_data_dirs (); *data_dirs != NULL; data_dirs++) { filename = g_strdup_printf ("%s/telepathy/managers/%s.manager", *data_dirs, name); DEBUG ("in XDG_DATA_DIRS: trying %s", filename); if (g_file_test (filename, G_FILE_TEST_EXISTS)) return filename; g_free (filename); } return NULL; } static GObject * tp_connection_manager_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *) tp_connection_manager_parent_class; TpConnectionManager *self = TP_CONNECTION_MANAGER (object_class->constructor (type, n_params, params)); TpProxy *as_proxy = (TpProxy *) self; const gchar *object_path = as_proxy->object_path; const gchar *bus_name = as_proxy->bus_name; g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (bus_name != NULL, NULL); /* Watch my D-Bus name */ tp_dbus_daemon_watch_name_owner (as_proxy->dbus_daemon, as_proxy->bus_name, tp_connection_manager_name_owner_changed_cb, self, NULL); self->name = strrchr (object_path, '/') + 1; g_assert (self->name != NULL); if (self->priv->manager_file == NULL) { self->priv->manager_file = tp_connection_manager_find_manager_file (self->name); } return (GObject *) self; } static void tp_connection_manager_init (TpConnectionManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CONNECTION_MANAGER, TpConnectionManagerPrivate); } static void tp_connection_manager_dispose (GObject *object) { TpConnectionManager *self = TP_CONNECTION_MANAGER (object); TpProxy *as_proxy = (TpProxy *) self; if (self->priv->disposed) goto finally; self->priv->disposed = TRUE; tp_dbus_daemon_cancel_name_owner_watch (as_proxy->dbus_daemon, as_proxy->bus_name, tp_connection_manager_name_owner_changed_cb, object); if (self->priv->protocol_structs != NULL) { g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = NULL; } if (self->priv->protocol_objects != NULL) { g_hash_table_unref (self->priv->protocol_objects); self->priv->protocol_objects = NULL; } if (self->priv->found_protocols != NULL) { g_hash_table_unref (self->priv->found_protocols); self->priv->found_protocols = NULL; } finally: G_OBJECT_CLASS (tp_connection_manager_parent_class)->dispose (object); } static void tp_connection_manager_finalize (GObject *object) { TpConnectionManager *self = TP_CONNECTION_MANAGER (object); guint i; g_free (self->priv->manager_file); if (self->priv->manager_file_read_idle_id != 0) g_source_remove (self->priv->manager_file_read_idle_id); if (self->priv->introspect_idle_id != 0) g_source_remove (self->priv->introspect_idle_id); if (self->priv->pending_protocols != NULL) { for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); g_ptr_array_unref (self->priv->pending_protocols); } G_OBJECT_CLASS (tp_connection_manager_parent_class)->finalize (object); } static void tp_connection_manager_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpConnectionManager *self = TP_CONNECTION_MANAGER (object); switch (property_id) { case PROP_CONNECTION_MANAGER: g_value_set_string (value, self->name); break; case PROP_CM_NAME: g_value_set_string (value, self->name); break; case PROP_INFO_SOURCE: g_value_set_uint (value, self->info_source); break; case PROP_MANAGER_FILE: g_value_set_string (value, self->priv->manager_file); break; case PROP_ALWAYS_INTROSPECT: g_value_set_boolean (value, self->always_introspect); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_connection_manager_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpConnectionManager *self = TP_CONNECTION_MANAGER (object); switch (property_id) { case PROP_MANAGER_FILE: g_free (self->priv->manager_file); /* If initial code has already run, change the definition of where * we expect to find the .manager file and trigger re-introspection. * Otherwise, just take the value - when name_known becomes TRUE we * queue the first-time manager file lookup anyway. */ if (self->priv->name_known) { const gchar *tmp = g_value_get_string (value); if (tmp == NULL) { self->priv->manager_file = tp_connection_manager_find_manager_file (self->name); } else { self->priv->manager_file = g_strdup (tmp); } if (self->priv->manager_file_read_idle_id == 0) self->priv->manager_file_read_idle_id = g_idle_add ( tp_connection_manager_idle_read_manager_file, self); } else { self->priv->manager_file = g_value_dup_string (value); } break; case PROP_ALWAYS_INTROSPECT: { gboolean old = self->always_introspect; self->always_introspect = g_value_get_boolean (value); if (self->running && !old && self->always_introspect) { /* It's running, we weren't previously auto-introspecting, * but we are now. Try it when idle */ if (self->priv->introspect_idle_id == 0) self->priv->introspect_idle_id = g_idle_add ( tp_connection_manager_idle_introspect, self); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } /** * tp_connection_manager_init_known_interfaces: * * Ensure that the known interfaces for TpConnectionManager have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CONNECTION_MANAGER. * * Since: 0.7.32 */ void tp_connection_manager_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CONNECTION_MANAGER; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_connection_manager_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_connection_manager_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_CONNECTION_MANAGER_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_connection_manager_class_init (TpConnectionManagerClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; tp_connection_manager_init_known_interfaces (); g_type_class_add_private (klass, sizeof (TpConnectionManagerPrivate)); object_class->constructor = tp_connection_manager_constructor; object_class->get_property = tp_connection_manager_get_property; object_class->set_property = tp_connection_manager_set_property; object_class->dispose = tp_connection_manager_dispose; object_class->finalize = tp_connection_manager_finalize; proxy_class->interface = TP_IFACE_QUARK_CONNECTION_MANAGER; proxy_class->list_features = tp_connection_manager_list_features; /** * TpConnectionManager:info-source: * * Where we got the current information on supported protocols * (a #TpCMInfoSource). * * Since 0.7.26, the #GObject::notify signal is emitted for this * property. * * (Note that this is of type %G_TYPE_UINT, not %TP_TYPE_CM_INFO_SOURCE, * for historical reasons.) */ param_spec = g_param_spec_uint ("info-source", "CM info source", "Where we got the current information on supported protocols", TP_CM_INFO_SOURCE_NONE, TP_CM_INFO_SOURCE_LIVE, TP_CM_INFO_SOURCE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INFO_SOURCE, param_spec); /** * TpConnectionManager:connection-manager: * * The name of the connection manager, e.g. "gabble" (read-only). * * Deprecated: Use #TpConnectionManager:cm-name instead. */ param_spec = g_param_spec_string ("connection-manager", "CM name", "The name of the connection manager, e.g. \"gabble\" (read-only)", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION_MANAGER, param_spec); /** * TpConnectionManager:cm-name: * * The name of the connection manager, e.g. "gabble" (read-only). * * Since: 0.19.3 */ param_spec = g_param_spec_string ("cm-name", "CM name", "The name of the connection manager, e.g. \"gabble\" (read-only)", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CM_NAME, param_spec); /** * TpConnectionManager:manager-file: * * The absolute path of the .manager file. If set to %NULL (the default), * the XDG data directories will be searched for a .manager file of the * correct name. * * If set to the empty string, no .manager file will be read. */ param_spec = g_param_spec_string ("manager-file", ".manager filename", "The .manager filename", NULL, G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MANAGER_FILE, param_spec); /** * TpConnectionManager:always-introspect: * * If %TRUE, always introspect the connection manager as it comes online, * even if we already have its info from a .manager file. Default %FALSE. */ param_spec = g_param_spec_boolean ("always-introspect", "Always introspect?", "Opportunistically introspect the CM when it's run", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ALWAYS_INTROSPECT, param_spec); /** * TpConnectionManager::activated: * @self: the connection manager proxy * * Emitted when the connection manager's well-known name appears on the bus. */ signals[SIGNAL_ACTIVATED] = g_signal_new ("activated", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpConnectionManager::exited: * @self: the connection manager proxy * * Emitted when the connection manager's well-known name disappears from * the bus or when activation fails. */ signals[SIGNAL_EXITED] = g_signal_new ("exited", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpConnectionManager::got-info: * @self: the connection manager proxy * @source: a #TpCMInfoSource * * Emitted when the connection manager's capabilities have been discovered. * * This signal is not very helpful. Using * tp_proxy_prepare_async() instead is recommended. */ signals[SIGNAL_GOT_INFO] = g_signal_new ("got-info", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT); } /** * tp_connection_manager_new: * @dbus: Proxy for the D-Bus daemon * @name: The connection manager name (such as "gabble") * @manager_filename: (allow-none): The #TpConnectionManager:manager-file * property, which may (and generally should) be %NULL. * @error: used to return an error if %NULL is returned * * Convenience function to create a new connection manager proxy. If * its protocol and parameter information are required, you should call * tp_proxy_prepare_async() on the result. * * Returns: a new reference to a connection manager proxy, or %NULL if @error * is set. */ TpConnectionManager * tp_connection_manager_new (TpDBusDaemon *dbus, const gchar *name, const gchar *manager_filename, GError **error) { TpConnectionManager *cm; gchar *object_path, *bus_name; g_return_val_if_fail (dbus != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); if (!tp_connection_manager_check_valid_name (name, error)) return NULL; object_path = g_strdup_printf ("%s%s", TP_CM_OBJECT_PATH_BASE, name); bus_name = g_strdup_printf ("%s%s", TP_CM_BUS_NAME_BASE, name); cm = TP_CONNECTION_MANAGER (g_object_new (TP_TYPE_CONNECTION_MANAGER, "dbus-daemon", dbus, "dbus-connection", ((TpProxy *) dbus)->dbus_connection, "bus-name", bus_name, "object-path", object_path, "manager-file", manager_filename, NULL)); g_free (object_path); g_free (bus_name); return cm; } /** * tp_connection_manager_activate: (skip) * @self: a connection manager proxy * * Attempt to run and introspect the connection manager, asynchronously. * Since 0.7.26 this function is not generally very useful, since * the connection manager will now be activated automatically if necessary. * * If the CM was already running, do nothing and return %FALSE. * * On success, emit #TpConnectionManager::activated when the CM appears * on the bus, and #TpConnectionManager::got-info when its capabilities * have been (re-)discovered. * * On failure, emit #TpConnectionManager::exited without first emitting * activated. * * Returns: %TRUE if activation was needed and is now in progress, %FALSE * if the connection manager was already running and no additional signals * will be emitted. * * Since: 0.7.1 */ gboolean tp_connection_manager_activate (TpConnectionManager *self) { if (self->priv->name_known) { if (self->running) { DEBUG ("%s: already running", self->name); return FALSE; } if (self->priv->introspect_idle_id == 0) { DEBUG ("%s: adding idle introspection", self->name); self->priv->introspect_idle_id = g_idle_add ( tp_connection_manager_idle_introspect, self); } else { DEBUG ("%s: idle introspection already added", self->name); } } else { /* we'll activate later, when we know properly whether we're running */ DEBUG ("%s: queueing activation for when we know what's going on", self->name); self->priv->want_activation = TRUE; } return TRUE; } static gboolean steal_into_ptr_array (gpointer key, gpointer value, gpointer user_data) { if (value != NULL) g_ptr_array_add (user_data, value); g_free (key); return TRUE; } typedef struct { GHashTable *table; GPtrArray *arr; GSimpleAsyncResult *result; TpConnectionManagerListCb callback; gpointer user_data; GDestroyNotify destroy; gpointer weak_object; TpProxyPendingCall *pending_call; size_t base_len; gsize refcount; gsize cms_to_ready; unsigned getting_names:1; unsigned had_weak_object:1; } _ListContext; static void list_context_unref (_ListContext *list_context) { guint i; if (--list_context->refcount > 0) return; if (list_context->weak_object != NULL) g_object_remove_weak_pointer (list_context->weak_object, &list_context->weak_object); if (list_context->destroy != NULL) list_context->destroy (list_context->user_data); if (list_context->arr != NULL) { for (i = 0; i < list_context->arr->len; i++) { TpConnectionManager *cm = g_ptr_array_index (list_context->arr, i); if (cm != NULL) g_object_unref (cm); } g_ptr_array_unref (list_context->arr); } g_hash_table_unref (list_context->table); g_slice_free (_ListContext, list_context); } static void all_cms_prepared (_ListContext *list_context) { TpConnectionManager **cms; guint n_cms = list_context->arr->len; DEBUG ("We've prepared as many as possible of %u CMs", n_cms); g_assert (list_context->callback != NULL); g_ptr_array_add (list_context->arr, NULL); cms = (TpConnectionManager **) list_context->arr->pdata; /* If we never had a weak object anyway, call the callback. * If we had a weak object when we started, only call the callback * if it hasn't died yet. */ if (!list_context->had_weak_object || list_context->weak_object != NULL) { list_context->callback (cms, n_cms, NULL, list_context->user_data, list_context->weak_object); } list_context->callback = NULL; } static void tp_list_connection_managers_cm_prepared (GObject *source, GAsyncResult *result, gpointer user_data) { _ListContext *list_context = user_data; GError *error = NULL; TpConnectionManager *cm = TP_CONNECTION_MANAGER (source); if (tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("%s: prepared", cm->name); } else { DEBUG ("%s: failed to prepare, continuing: %s #%d: %s", cm->name, g_quark_to_string (error->domain), error->code, error->message); g_clear_error (&error); /* other than that, ignore it - all we guarantee is that * the CM is ready *if possible* */ } list_context->cms_to_ready--; if (list_context->cms_to_ready == 0) { all_cms_prepared (list_context); } else { DEBUG ("We still need to prepare %" G_GSIZE_FORMAT " CM(s)", list_context->cms_to_ready); } list_context_unref (list_context); } static void tp_list_connection_managers_got_names (TpDBusDaemon *bus_daemon, const gchar * const *names, const GError *error, gpointer user_data, GObject *weak_object) { _ListContext *list_context = user_data; const gchar * const *name_iter; const gchar *method; if (list_context->getting_names) method = "ListNames"; else method = "ListActivatableNames"; /* The TpProxy APIs we use guarantee this */ g_assert (weak_object != NULL || !list_context->had_weak_object); if (error != NULL) { DEBUG ("%s failed: %s #%d: %s", method, g_quark_to_string (error->domain), error->code, error->message); list_context->callback (NULL, 0, error, list_context->user_data, weak_object); return; } DEBUG ("%s succeeded", method); for (name_iter = names; name_iter != NULL && *name_iter != NULL; name_iter++) { const gchar *name; TpConnectionManager *cm; if (strncmp (TP_CM_BUS_NAME_BASE, *name_iter, list_context->base_len) != 0) continue; name = *name_iter + list_context->base_len; DEBUG (" found CM: %s", name); if (g_hash_table_lookup (list_context->table, name) == NULL) { /* just ignore connection managers with bad names */ cm = tp_connection_manager_new (bus_daemon, name, NULL, NULL); if (cm != NULL) g_hash_table_insert (list_context->table, g_strdup (name), cm); } } if (list_context->getting_names) { /* now that we have all the CMs, wait for them all to be ready */ guint i; list_context->arr = g_ptr_array_sized_new (g_hash_table_size (list_context->table)); g_hash_table_foreach_steal (list_context->table, steal_into_ptr_array, list_context->arr); list_context->cms_to_ready = list_context->arr->len; list_context->refcount += list_context->cms_to_ready; DEBUG ("Total of %" G_GSIZE_FORMAT " CMs to be prepared", list_context->cms_to_ready); if (list_context->cms_to_ready == 0) { all_cms_prepared (list_context); return; } for (i = 0; i < list_context->cms_to_ready; i++) { TpConnectionManager *cm = g_ptr_array_index (list_context->arr, i); DEBUG (" preparing %s", cm->name); tp_proxy_prepare_async (cm, NULL, tp_list_connection_managers_cm_prepared, list_context); } } else { DEBUG ("Calling ListNames"); list_context->getting_names = TRUE; list_context->refcount++; tp_dbus_daemon_list_names (bus_daemon, 2000, tp_list_connection_managers_got_names, list_context, (GDestroyNotify) list_context_unref, weak_object); } } /** * tp_list_connection_managers: * @bus_daemon: proxy for the D-Bus daemon * @callback: callback to be called when listing the CMs * succeeds or fails; not called if the @weak_object goes away * @user_data: user-supplied data for the callback * @destroy: callback to destroy the user-supplied data, called after * @callback, but also if the @weak_object goes away * @weak_object: (allow-none): if not %NULL, will be weakly * referenced; the callback will not be called, and the call will be * cancelled, if the object has vanished * * List the available (running or installed) connection managers. Call the * callback when done. * * Since 0.7.26, this function will wait for each #TpConnectionManager * to be ready, so all connection managers passed to @callback will have * their %TP_CONNECTION_MANAGER_FEATURE_CORE feature prepared, unless an error * occurred while launching that connection manager. * * Since: 0.7.1 * * Deprecated: since 0.19.1, use tp_list_connection_managers_async() */ void tp_list_connection_managers (TpDBusDaemon *bus_daemon, TpConnectionManagerListCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { _ListContext *list_context = g_slice_new0 (_ListContext); list_context->base_len = strlen (TP_CM_BUS_NAME_BASE); list_context->callback = callback; list_context->user_data = user_data; list_context->destroy = destroy; list_context->getting_names = FALSE; list_context->refcount = 1; list_context->table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); list_context->arr = NULL; list_context->cms_to_ready = 0; if (weak_object != NULL) { list_context->weak_object = weak_object; list_context->had_weak_object = TRUE; g_object_add_weak_pointer (weak_object, &list_context->weak_object); } DEBUG ("Calling ListActivatableNames"); tp_dbus_daemon_list_activatable_names (bus_daemon, 2000, tp_list_connection_managers_got_names, list_context, (GDestroyNotify) list_context_unref, weak_object); } static void list_connection_managers_async_cb (TpConnectionManager * const *cms, gsize n_cms, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { g_simple_async_result_set_from_error (result, error); } else { GList *l = NULL; gsize i; for (i = 0; i < n_cms; i++) l = g_list_prepend (l, g_object_ref (cms[i])); l = g_list_reverse (l); g_simple_async_result_set_op_res_gpointer (result, l, (GDestroyNotify) _tp_object_list_free); } g_simple_async_result_complete_in_idle (result); /* result is unreffed by GDestroyNotify */ } /** * tp_list_connection_managers_async: * @dbus_daemon: (allow-none): a #TpDBusDaemon, or %NULL to use * tp_dbus_daemon_dup() * @callback: a callback to call with a list of CMs * @user_data: data to pass to @callback * * List the available (running or installed) connection managers, * asynchronously, and wait for their %TP_CONNECTION_MANAGER_FEATURE_CORE * feature to be ready. * * Since: 0.17.6 */ void tp_list_connection_managers_async (TpDBusDaemon *dbus_daemon, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GError *error = NULL; if (dbus_daemon == NULL) dbus_daemon = tp_dbus_daemon_dup (&error); else g_object_ref (dbus_daemon); result = g_simple_async_result_new (NULL, callback, user_data, tp_list_connection_managers_async); if (dbus_daemon == NULL) { g_simple_async_result_take_error (result, error); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } else { G_GNUC_BEGIN_IGNORE_DEPRECATIONS tp_list_connection_managers (dbus_daemon, list_connection_managers_async_cb, result, g_object_unref, NULL); G_GNUC_END_IGNORE_DEPRECATIONS g_object_unref (dbus_daemon); } } /** * tp_list_connection_managers_finish: * @result: the result of tp_list_connection_managers_async() * @error: used to raise an error if the operation failed * * Finish listing the available connection managers. * * Free the list after use, for instance with * g_list_free_full (list, g_object_unref). * * Returns: (transfer full) (element-type TelepathyGLib.ConnectionManager): a * newly allocated list of references to #TpConnectionManager objects * Since: 0.17.6 */ GList * tp_list_connection_managers_finish (GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (NULL, tp_list_connection_managers_async, _tp_object_list_copy); } /** * tp_connection_manager_check_valid_name: * @name: a possible connection manager name * @error: used to raise %TP_ERROR_INVALID_ARGUMENT if %FALSE is returned * * Check that the given string is a valid connection manager name, i.e. that * it consists entirely of ASCII letters, digits and underscores, and starts * with a letter. * * Returns: %TRUE if @name is valid * * Since: 0.7.1 */ gboolean tp_connection_manager_check_valid_name (const gchar *name, GError **error) { const gchar *name_char; if (tp_str_empty (name)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The empty string is not a valid connection manager name"); return FALSE; } if (!g_ascii_isalpha (name[0])) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a valid connection manager name because first character " "is not an ASCII letter: %s", name); return FALSE; } for (name_char = name; *name_char != '\0'; name_char++) { if (!g_ascii_isalnum (*name_char) && *name_char != '_') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a valid connection manager name because character '%c' " "is not an ASCII letter, digit or underscore: %s", *name_char, name); return FALSE; } } return TRUE; } /** * tp_connection_manager_check_valid_protocol_name: * @name: a possible protocol name * @error: used to raise %TP_ERROR_INVALID_ARGUMENT if %FALSE is returned * * Check that the given string is a valid protocol name, i.e. that * it consists entirely of ASCII letters, digits and hyphen/minus, and starts * with a letter. * * Returns: %TRUE if @name is valid * * Since: 0.7.1 */ gboolean tp_connection_manager_check_valid_protocol_name (const gchar *name, GError **error) { const gchar *name_char; if (name == NULL || name[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The empty string is not a valid protocol name"); return FALSE; } if (!g_ascii_isalpha (name[0])) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a valid protocol name because first character " "is not an ASCII letter: %s", name); return FALSE; } for (name_char = name; *name_char != '\0'; name_char++) { if (!g_ascii_isalnum (*name_char) && *name_char != '-') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a valid protocol name because character '%c' " "is not an ASCII letter, digit or hyphen/minus: %s", *name_char, name); return FALSE; } } return TRUE; } /** * tp_connection_manager_get_name: * @self: a connection manager * * Return the internal name of this connection manager in the Telepathy * D-Bus API, e.g. "gabble" or "haze". This is often the name of the binary * without the "telepathy-" prefix. * * The returned string is valid as long as @self is. Copy it with g_strdup() * if a longer lifetime is required. * * Returns: the #TpConnectionManager:cm-name property * Since: 0.7.26 */ const gchar * tp_connection_manager_get_name (TpConnectionManager *self) { g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), NULL); return self->name; } /** * tp_connection_manager_is_ready: (skip) * @self: a connection manager * * If protocol and parameter information has been obtained from the connection * manager or the cache in the .manager file, return %TRUE. Otherwise, * return %FALSE. * * This may change from %FALSE to %TRUE at any time that the main loop is * running; the #GObject::notify signal is emitted for the * #TpConnectionManager:info-source property. * * Returns: %TRUE, unless the #TpConnectionManager:info-source property is * %TP_CM_INFO_SOURCE_NONE * Since: 0.7.26 * Deprecated: since 0.17.6, use tp_proxy_is_prepared() * with %TP_CONNECTION_MANAGER_FEATURE_CORE instead */ gboolean tp_connection_manager_is_ready (TpConnectionManager *self) { g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), FALSE); return self->info_source != TP_CM_INFO_SOURCE_NONE; } /** * tp_connection_manager_is_running: * @self: a connection manager * * Return %TRUE if this connection manager currently appears to be running. * This may change at any time that the main loop is running; the * #TpConnectionManager::activated and #TpConnectionManager::exited signals * are emitted. * * Returns: whether the connection manager is currently running * Since: 0.7.26 */ gboolean tp_connection_manager_is_running (TpConnectionManager *self) { g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), FALSE); return self->running; } /** * tp_connection_manager_get_info_source: * @self: a connection manager * * If protocol and parameter information has been obtained from the connection * manager, return %TP_CM_INFO_SOURCE_LIVE; if it has been obtained from the * cache in the .manager file, return %TP_CM_INFO_SOURCE_FILE. If this * information has not yet been obtained, or obtaining it failed, return * %TP_CM_INFO_SOURCE_NONE. * * This may increase at any time that the main loop is running; the * #GObject::notify signal is emitted. * * Returns: the value of the #TpConnectionManager:info-source property * Since: 0.7.26 */ TpCMInfoSource tp_connection_manager_get_info_source (TpConnectionManager *self) { g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), TP_CM_INFO_SOURCE_NONE); return self->info_source; } /** * tp_connection_manager_dup_protocol_names: * @self: a connection manager * * Returns a list of protocol names supported by this connection manager. * These are the internal protocol names used by the Telepathy specification * (e.g. "jabber" and "msn"), rather than user-visible names in any particular * locale. * * If this function is called before the connection manager information has * been obtained, the result is always %NULL. Use * tp_proxy_prepare_async() to wait for this. * * The result is copied and must be freed by the caller, but it is not * necessarily still true after the main loop is re-entered. * * Returns: (array zero-terminated=1) (transfer full): a #GStrv of protocol names * Since: 0.7.26 */ gchar ** tp_connection_manager_dup_protocol_names (TpConnectionManager *self) { GPtrArray *ret; guint i; g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), NULL); if (self->info_source == TP_CM_INFO_SOURCE_NONE) return NULL; g_assert (self->priv->protocol_structs != NULL); ret = g_ptr_array_sized_new (self->priv->protocol_structs->len); for (i = 0; i < self->priv->protocol_structs->len; i++) { TpConnectionManagerProtocol *proto = g_ptr_array_index ( self->priv->protocol_structs, i); if (proto != NULL) g_ptr_array_add (ret, g_strdup (proto->name)); } g_ptr_array_add (ret, NULL); return (gchar **) g_ptr_array_free (ret, FALSE); } /** * tp_connection_manager_get_protocol: * @self: a connection manager * @protocol: the name of a protocol as defined in the Telepathy D-Bus API, * e.g. "jabber" or "msn" * * Returns a structure representing a protocol, or %NULL if this connection * manager does not support the specified protocol. * * Since 0.11.11, you can get a #GObject version with more * functionality by calling tp_connection_manager_get_protocol_object(). * * If this function is called before the connection manager information has * been obtained, the result is always %NULL. Use * tp_proxy_prepare_async() to wait for this. * * The result is not necessarily valid after the main loop is re-entered. * Since 0.11.3, it can be copied with tp_connection_manager_protocol_copy() * if a permanently-valid copy is needed. * * Returns: (transfer none): a structure representing the protocol * Since: 0.7.26 * * Deprecated: 0.19.1, use tp_connection_manager_get_protocol_object() */ const TpConnectionManagerProtocol * tp_connection_manager_get_protocol (TpConnectionManager *self, const gchar *protocol) { TpProtocol *object; object = tp_connection_manager_get_protocol_object (self, protocol); if (object == NULL) return NULL; return _tp_protocol_get_struct (object); } /** * tp_connection_manager_get_protocol_object: * @self: a connection manager * @protocol: the name of a protocol as defined in the Telepathy D-Bus API, * e.g. "jabber" or "msn" * * Returns an object representing a protocol, or %NULL if this connection * manager does not support the specified protocol. * * If this function is called before the connection manager information has * been obtained, the result is always %NULL. Use tp_proxy_prepare_async() * to wait for this. * * The result should be referenced with g_object_ref() if it will be kept. * * Returns: (transfer none): an object representing the protocol, or %NULL * * Since: 0.11.11 */ TpProtocol * tp_connection_manager_get_protocol_object (TpConnectionManager *self, const gchar *protocol) { g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), NULL); g_return_val_if_fail (protocol != NULL, NULL); if (self->priv->protocol_objects == NULL) return NULL; return g_hash_table_lookup (self->priv->protocol_objects, protocol); } /* FIXME: in Telepathy 1.0, rename to get_protocols */ /** * tp_connection_manager_dup_protocols: * @self: a connection manager * * Return objects representing all protocols supported by this connection * manager. * * If this function is called before the connection manager information has * been obtained, the result is always %NULL. Use tp_proxy_prepare_async() * to wait for this. * * The caller must free the list, for instance with * g_list_free_full (l, g_object_unref). * * Returns: (transfer full) (element-type TelepathyGLib.Protocol): a list * of #TpProtocol objects representing the protocols supported by @self, * owned by the caller * * Since: 0.17.6 */ GList * tp_connection_manager_dup_protocols (TpConnectionManager *self) { GList *l; g_return_val_if_fail (TP_IS_CONNECTION_MANAGER (self), NULL); if (self->priv->protocol_objects == NULL) return NULL; l = g_hash_table_get_values (self->priv->protocol_objects); g_list_foreach (l, (GFunc) g_object_ref, NULL); return l; } /** * tp_connection_manager_has_protocol: * @self: a connection manager * @protocol: the name of a protocol as defined in the Telepathy D-Bus API, * e.g. "jabber" or "msn" * * Return whether @protocol is supported by this connection manager. * * If this function is called before the connection manager information has * been obtained, the result is always %FALSE. Use tp_proxy_prepare_async() * to wait for this. * * Returns: %TRUE if this connection manager supports @protocol * Since: 0.7.26 */ gboolean tp_connection_manager_has_protocol (TpConnectionManager *self, const gchar *protocol) { return (tp_connection_manager_get_protocol_object (self, protocol) != NULL); } /** * tp_connection_manager_protocol_has_param: * @protocol: structure representing a supported protocol * @param: a parameter name * * * * Returns: %TRUE if @protocol supports the parameter @param. * Since: 0.7.26 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ gboolean tp_connection_manager_protocol_has_param ( const TpConnectionManagerProtocol *protocol, const gchar *param) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return (tp_connection_manager_protocol_get_param (protocol, param) != NULL); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_connection_manager_protocol_get_param: * @protocol: structure representing a supported protocol * @param: a parameter name * * * * Returns: a structure representing the parameter @param, or %NULL if not * supported * Since: 0.7.26 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ const TpConnectionManagerParam * tp_connection_manager_protocol_get_param ( const TpConnectionManagerProtocol *protocol, const gchar *param) { const TpConnectionManagerParam *ret = NULL; guint i; g_return_val_if_fail (protocol != NULL, NULL); for (i = 0; protocol->params[i].name != NULL; i++) { if (!tp_strdiff (param, protocol->params[i].name)) { ret = &protocol->params[i]; break; } } return ret; } /** * tp_connection_manager_protocol_can_register: * @protocol: structure representing a supported protocol * * Return whether a new account can be registered on this protocol, by setting * the special "register" parameter to %TRUE. * * Returns: %TRUE if @protocol supports the parameter "register" * Since: 0.7.26 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ gboolean tp_connection_manager_protocol_can_register ( const TpConnectionManagerProtocol *protocol) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS return tp_connection_manager_protocol_has_param (protocol, "register"); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_connection_manager_protocol_dup_param_names: * @protocol: a protocol supported by a #TpConnectionManager * * Returns a list of parameter names supported by this connection manager * for this protocol. * * The result is copied and must be freed by the caller with g_strfreev(). * * Returns: (array zero-terminated=1) (transfer full): a #GStrv of protocol names * Since: 0.7.26 * * Deprecated: 0.19.1, use #TpProtocol objects instead */ gchar ** tp_connection_manager_protocol_dup_param_names ( const TpConnectionManagerProtocol *protocol) { GPtrArray *ret; guint i; g_return_val_if_fail (protocol != NULL, NULL); ret = g_ptr_array_new (); for (i = 0; protocol->params[i].name != NULL; i++) g_ptr_array_add (ret, g_strdup (protocol->params[i].name)); g_ptr_array_add (ret, NULL); return (gchar **) g_ptr_array_free (ret, FALSE); } /** * tp_connection_manager_param_get_name: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: the name of the parameter * Since: 0.7.26 */ const gchar * tp_connection_manager_param_get_name (const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, NULL); return param->name; } /** * tp_connection_manager_param_get_dbus_signature: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: the D-Bus signature of the parameter * Since: 0.7.26 */ const gchar * tp_connection_manager_param_get_dbus_signature ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, NULL); return param->dbus_signature; } /** * tp_connection_manager_param_dup_variant_type: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: (transfer full): the #GVariantType of the parameter * Since: 0.23.1 */ GVariantType * tp_connection_manager_param_dup_variant_type ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, NULL); /* this should have been checked when we created it */ g_return_val_if_fail (g_variant_type_string_is_valid (param->dbus_signature), NULL); return g_variant_type_new (param->dbus_signature); } /** * tp_connection_manager_param_is_required: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: %TRUE if the parameter is normally required * Since: 0.7.26 */ gboolean tp_connection_manager_param_is_required ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, FALSE); return (param->flags & TP_CONN_MGR_PARAM_FLAG_REQUIRED) != 0; } /** * tp_connection_manager_param_is_required_for_registration: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: %TRUE if the parameter is required when registering a new account * (by setting the special "register" parameter to %TRUE) * Since: 0.7.26 */ gboolean tp_connection_manager_param_is_required_for_registration ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, FALSE); return (param->flags & TP_CONN_MGR_PARAM_FLAG_REGISTER) != 0; } /** * tp_connection_manager_param_is_secret: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: %TRUE if the parameter's value is a password or other secret * Since: 0.7.26 */ gboolean tp_connection_manager_param_is_secret ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, FALSE); return (param->flags & TP_CONN_MGR_PARAM_FLAG_SECRET) != 0; } /** * tp_connection_manager_param_is_dbus_property: * @param: a parameter supported by a #TpConnectionManager * * * * Returns: %TRUE if the parameter represents a D-Bus property of the same name * Since: 0.7.26 */ gboolean tp_connection_manager_param_is_dbus_property ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, FALSE); return (param->flags & TP_CONN_MGR_PARAM_FLAG_DBUS_PROPERTY) != 0; } /** * tp_connection_manager_param_get_default: * @param: a parameter supported by a #TpConnectionManager * @value: pointer to an unset (all zeroes) #GValue into which the default's * type and value are written * * Get the default value for this parameter, if there is one. If %FALSE is * returned, @value is left uninitialized. * * Returns: %TRUE if there is a default value * Since: 0.7.26 */ gboolean tp_connection_manager_param_get_default ( const TpConnectionManagerParam *param, GValue *value) { g_return_val_if_fail (param != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); g_return_val_if_fail (!G_IS_VALUE (value), FALSE); if ((param->flags & TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT) == 0 || !G_IS_VALUE (¶m->default_value)) return FALSE; g_value_init (value, G_VALUE_TYPE (¶m->default_value)); g_value_copy (¶m->default_value, value); return TRUE; } /** * tp_connection_manager_param_dup_default_variant: * @param: a parameter supported by a #TpConnectionManager * * Get the default value for this parameter. * * Use g_variant_get_type() to check that the type is what you expect. * For instance, a string parameter should have type * %G_VARIANT_TYPE_STRING. * * Returns: the default value, or %NULL if there is no default * Since: 0.19.0 */ GVariant * tp_connection_manager_param_dup_default_variant ( const TpConnectionManagerParam *param) { g_return_val_if_fail (param != NULL, NULL); if ((param->flags & TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT) == 0 || !G_IS_VALUE (¶m->default_value)) return NULL; return g_variant_ref_sink (dbus_g_value_build_g_variant ( ¶m->default_value)); } telepathy-glib-0.24.2/telepathy-glib/connection-manager.h0000644000175000017500000002105012652510705020265 00000000000000/* * connection-manager.h - proxy for a Telepathy connection manager * * Copyright (C) 2007-2009 Collabora Ltd. * Copyright (C) 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONNECTION_MANAGER_H__ #define __TP_CONNECTION_MANAGER_H__ #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpConnectionManager TpConnectionManager; typedef struct _TpConnectionManagerClass TpConnectionManagerClass; typedef struct _TpConnectionManagerPrivate TpConnectionManagerPrivate; GType tp_connection_manager_get_type (void); GType tp_connection_manager_param_get_type (void); GType tp_connection_manager_protocol_get_type (void); /* TYPE MACROS */ #define TP_TYPE_CONNECTION_MANAGER \ (tp_connection_manager_get_type ()) #define TP_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_CONNECTION_MANAGER, \ TpConnectionManager)) #define TP_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_CONNECTION_MANAGER, \ TpConnectionManagerClass)) #define TP_IS_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_CONNECTION_MANAGER)) #define TP_IS_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_CONNECTION_MANAGER)) #define TP_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONNECTION_MANAGER, \ TpConnectionManagerClass)) #define TP_TYPE_CONNECTION_MANAGER_PARAM \ (tp_connection_manager_param_get_type ()) #define TP_TYPE_CONNECTION_MANAGER_PROTOCOL \ (tp_connection_manager_protocol_get_type ()) typedef struct _TpConnectionManagerProtocol TpConnectionManagerProtocol; struct _TpConnectionManagerProtocol { /**/ gchar *name; TpConnectionManagerParam *params; /**/ gpointer priv; }; typedef enum { TP_CM_INFO_SOURCE_NONE, TP_CM_INFO_SOURCE_FILE, TP_CM_INFO_SOURCE_LIVE } TpCMInfoSource; struct _TpConnectionManager { /**/ TpProxy parent; const gchar *_TP_SEAL (name); const TpConnectionManagerProtocol * const *_TP_SEAL (protocols); /* These are really booleans, but gboolean is signed. Thanks, GLib */ unsigned int _TP_SEAL (running):1; unsigned int _TP_SEAL (always_introspect):1; /* TpCMInfoSource, but can't rely on enums being unsigned */ unsigned int _TP_SEAL (info_source):2; guint _TP_SEAL (reserved_flags):28; TpConnectionManagerPrivate *priv; }; struct _TpConnectionManagerClass { /**/ TpProxyClass parent_class; gpointer *priv; }; TpConnectionManager *tp_connection_manager_new (TpDBusDaemon *dbus, const gchar *name, const gchar *manager_filename, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_connection_manager_activate (TpConnectionManager *self); typedef void (*TpConnectionManagerListCb) (TpConnectionManager * const *cms, gsize n_cms, const GError *error, gpointer user_data, GObject *weak_object); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_list_connection_managers_async) void tp_list_connection_managers (TpDBusDaemon *bus_daemon, TpConnectionManagerListCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); #endif _TP_AVAILABLE_IN_0_18 void tp_list_connection_managers_async (TpDBusDaemon *dbus_daemon, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 GList *tp_list_connection_managers_finish (GAsyncResult *result, GError **error); #ifndef TP_DISABLE_DEPRECATED typedef void (*TpConnectionManagerWhenReadyCb) (TpConnectionManager *cm, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_prepare_async) void tp_connection_manager_call_when_ready (TpConnectionManager *self, TpConnectionManagerWhenReadyCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_is_prepared) gboolean tp_connection_manager_is_ready (TpConnectionManager *self); #endif const gchar *tp_connection_manager_get_name (TpConnectionManager *self); gboolean tp_connection_manager_is_running (TpConnectionManager *self); TpCMInfoSource tp_connection_manager_get_info_source ( TpConnectionManager *self); gboolean tp_connection_manager_check_valid_name (const gchar *name, GError **error); gboolean tp_connection_manager_check_valid_protocol_name (const gchar *name, GError **error); gchar **tp_connection_manager_dup_protocol_names (TpConnectionManager *self) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_connection_manager_has_protocol (TpConnectionManager *self, const gchar *protocol); TpProtocol *tp_connection_manager_get_protocol_object ( TpConnectionManager *self, const gchar *protocol); _TP_AVAILABLE_IN_0_18 GList *tp_connection_manager_dup_protocols (TpConnectionManager *self) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_connection_manager_get_protocol_object) const TpConnectionManagerProtocol *tp_connection_manager_get_protocol ( TpConnectionManager *self, const gchar *protocol); _TP_DEPRECATED_IN_0_20_FOR (tp_protocol_dup_param_names) gchar **tp_connection_manager_protocol_dup_param_names ( const TpConnectionManagerProtocol *protocol) G_GNUC_WARN_UNUSED_RESULT; _TP_DEPRECATED_IN_0_20_FOR (tp_protocol_has_param) gboolean tp_connection_manager_protocol_has_param ( const TpConnectionManagerProtocol *protocol, const gchar *param); _TP_DEPRECATED_IN_0_20_FOR (tp_protocol_dup_param) const TpConnectionManagerParam *tp_connection_manager_protocol_get_param ( const TpConnectionManagerProtocol *protocol, const gchar *param); _TP_DEPRECATED_IN_0_20_FOR (tp_protocol_can_register) gboolean tp_connection_manager_protocol_can_register ( const TpConnectionManagerProtocol *protocol); #endif const gchar *tp_connection_manager_param_get_name ( const TpConnectionManagerParam *param); const gchar *tp_connection_manager_param_get_dbus_signature ( const TpConnectionManagerParam *param); gboolean tp_connection_manager_param_is_required ( const TpConnectionManagerParam *param); gboolean tp_connection_manager_param_is_required_for_registration ( const TpConnectionManagerParam *param); gboolean tp_connection_manager_param_is_secret ( const TpConnectionManagerParam *param); gboolean tp_connection_manager_param_is_dbus_property ( const TpConnectionManagerParam *param); gboolean tp_connection_manager_param_get_default ( const TpConnectionManagerParam *param, GValue *value); _TP_AVAILABLE_IN_0_20 GVariant *tp_connection_manager_param_dup_default_variant ( const TpConnectionManagerParam *param); _TP_AVAILABLE_IN_0_24 GVariantType *tp_connection_manager_param_dup_variant_type ( const TpConnectionManagerParam *param); void tp_connection_manager_init_known_interfaces (void); #define TP_CONNECTION_MANAGER_FEATURE_CORE \ (tp_connection_manager_get_feature_quark_core ()) GQuark tp_connection_manager_get_feature_quark_core (void) G_GNUC_CONST; TpConnectionManagerParam *tp_connection_manager_param_copy ( const TpConnectionManagerParam *in); void tp_connection_manager_param_free (TpConnectionManagerParam *param); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 TpConnectionManagerProtocol *tp_connection_manager_protocol_copy ( const TpConnectionManagerProtocol *in); _TP_DEPRECATED_IN_0_20 void tp_connection_manager_protocol_free (TpConnectionManagerProtocol *proto); #endif G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/stream-tube-connection-internal.h0000644000175000017500000000302612652510705022720 00000000000000/**/ /* * Object representing a connection on a Stream Tube (internal) * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_STREAM_TUBE_CONNECTION_INTERNAL_H__ #define __TP_STREAM_TUBE_CONNECTION_INTERNAL_H__ #include #include #include "stream-tube-connection.h" G_BEGIN_DECLS struct _TpStreamTubeConnection { /**/ GObject parent; TpStreamTubeConnectionPrivate *priv; }; TpStreamTubeConnection * _tp_stream_tube_connection_new ( GSocketConnection *socket_connection, TpStreamTubeChannel *channel); void _tp_stream_tube_connection_set_contact (TpStreamTubeConnection *self, TpContact *contact); void _tp_stream_tube_connection_fire_closed (TpStreamTubeConnection *self, GError *error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/contact-search.c0000644000175000017500000005067212652510705017423 00000000000000/* * contact-search.c - a representation for an ongoing search for contacts * * Copyright (C) 2010-2011 Collabora Ltd. * * The code contained in this file is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this code; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/contact-search.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/debug-internal.h" #include "_gen/telepathy-interfaces.h" /** * SECTION:contact-search * @title: TpContactSearch * @short_description: object for a Telepathy contact search channel * @see_also: #TpChannel * * #TpContactSearch objects represent ongoing searches for contacts. They * implement the #GAsyncInitable interface, so the initialization may fail. * * In normal circumstances, after creating a #TpContactSearch object, you * would connect to the #TpContactSearch::search-results-received signal * to get search results when a search happens. You would then call * tp_contact_search_get_search_keys() to get the search keys, and then * do a search using tp_contact_search_start(). When results are found, * the #TpContactSearch::search-results-received callback will be called. * * You can check the search state by looking at the * #TpContactSearch:state property. If you want to be notified about * changes, connect to the notify::state signal, see * #GObject::notify for details. * * You can search as many times as you want on a #TpContactSearch object, * but you need to call tp_contact_search_reset_async() between searches. * * Since: 0.13.11 */ /** * TpContactSearchClass: * * The class of a #TpContactSearch. * * Since: 0.13.11 */ /** * TpContactSearch: * * An object for Telepathy contact searches. * There are no interesting public struct fields. * * Since: 0.13.11 */ static void async_initable_iface_init (GAsyncInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (TpContactSearch, tp_contact_search, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)) struct _TpContactSearchPrivate { TpAccount *account; TpChannel *channel; TpChannelContactSearchState state; gchar *server; guint limit; const gchar * const *keys; GCancellable *cancellable; GSimpleAsyncResult *async_res; }; enum /* properties */ { PROP_0, PROP_ACCOUNT, PROP_SERVER, PROP_LIMIT, PROP_STATE, }; enum /* signals */ { SEARCH_RESULTS_RECEIVED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; static void close_search_channel (TpContactSearch *self) { if (self->priv->channel != NULL) { DEBUG ("Closing existing search channel"); tp_cli_channel_call_close (self->priv->channel, -1, NULL, NULL, NULL, NULL); tp_clear_object (&self->priv->channel); } } static void _search_state_changed (TpChannel *channel, guint state, const gchar *error, GHashTable *details, gpointer user_data, GObject *weak_object) { TpContactSearch *self = TP_CONTACT_SEARCH (weak_object); if (self->priv->state != state) { DEBUG ("SearchStateChanged: %u", state); self->priv->state = state; g_object_notify (weak_object, "state"); } } static void _search_results_received (TpChannel *channel, GHashTable *result, gpointer user_data, GObject *object) { GHashTableIter iter; gchar *contact; GPtrArray *info; GList *results = NULL; g_hash_table_iter_init (&iter, result); while (g_hash_table_iter_next (&iter, (gpointer) &contact, (gpointer) &info)) { TpContactSearchResult *search_result; char *field; char **parameters; char **values; gint i; search_result = _tp_contact_search_result_new (contact); for (i = info->len - 1; i >= 0; i--) { TpContactInfoField *contact_field; tp_value_array_unpack (g_ptr_array_index (info, i), 3, &field, ¶meters, &values); contact_field = tp_contact_info_field_new (field, parameters, values); _tp_contact_search_result_insert_field (search_result, contact_field); } results = g_list_prepend (results, search_result); } DEBUG ("SearchResultsReceived (%i results)", g_hash_table_size (result)); g_signal_emit (object, _signals[SEARCH_RESULTS_RECEIVED], 0, results); g_list_free_full (results, g_object_unref); } static void _create_search_channel_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpAccountChannelRequest *channel_request; TpContactSearch *self = TP_CONTACT_SEARCH (user_data); GHashTable *properties; GError *error = NULL; const gchar *server; guint limit; gboolean valid; channel_request = TP_ACCOUNT_CHANNEL_REQUEST (source_object); self->priv->channel = tp_account_channel_request_create_and_handle_channel_finish ( channel_request, result, NULL, &error); if (self->priv->channel == NULL) { DEBUG ("Failed to create search channel: %s", error->message); goto out; } DEBUG ("Got channel: %s", tp_proxy_get_object_path (self->priv->channel)); if (tp_cli_channel_type_contact_search_connect_to_search_result_received ( self->priv->channel, _search_results_received, NULL, NULL, G_OBJECT (self), &error) == NULL || tp_cli_channel_type_contact_search_connect_to_search_state_changed ( self->priv->channel, _search_state_changed, NULL, NULL, G_OBJECT (self), &error) == NULL) { DEBUG ("Failed to connect to signals: %s", error->message); goto out; } properties = _tp_channel_get_immutable_properties (self->priv->channel); self->priv->keys = tp_asv_get_strv (properties, TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_AVAILABLE_SEARCH_KEYS); server = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER); if (g_strcmp0 (server, self->priv->server) != 0) { g_free (self->priv->server); self->priv->server = g_strdup (server); g_object_notify (G_OBJECT (self), "server"); } limit = tp_asv_get_uint32 (properties, TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT, &valid); if (valid && limit != self->priv->limit) { self->priv->limit = limit; g_object_notify (G_OBJECT (self), "limit"); } self->priv->state = TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED; g_object_notify (G_OBJECT (self), "state"); out: if (error != NULL) { g_simple_async_result_set_from_error (self->priv->async_res, error); g_error_free (error); /* This function is safe if self->priv->channel is NULL. */ close_search_channel (self); } g_simple_async_result_complete (self->priv->async_res); tp_clear_object (&self->priv->async_res); } static void tp_contact_search_open_new_channel (TpContactSearch *self) { GHashTable *request; TpAccountChannelRequest *channel_request; close_search_channel (self); DEBUG ("Requesting new search channel"); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, NULL); if (self->priv->server != NULL) tp_asv_set_string (request, TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER, self->priv->server); if (self->priv->limit != 0) tp_asv_set_uint32 (request, TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT, self->priv->limit); channel_request = tp_account_channel_request_new (self->priv->account, request, TP_USER_ACTION_TIME_NOT_USER_ACTION); tp_account_channel_request_create_and_handle_channel_async ( channel_request, self->priv->cancellable, _create_search_channel_cb, G_OBJECT (self)); g_object_unref (channel_request); g_hash_table_unref (request); } static void tp_contact_search_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TpContactSearch *self = TP_CONTACT_SEARCH (object); switch (prop_id) { case PROP_ACCOUNT: g_assert (self->priv->account == NULL); /* construct-only */ self->priv->account = g_value_dup_object (value); break; case PROP_SERVER: g_assert (self->priv->server == NULL); /* construct-only */ self->priv->server = g_value_dup_string (value); break; case PROP_LIMIT: self->priv->limit = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); break; } } static void tp_contact_search_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TpContactSearch *self = TP_CONTACT_SEARCH (object); switch (prop_id) { case PROP_ACCOUNT: g_value_set_object (value, self->priv->account); break; case PROP_SERVER: g_value_set_string (value, self->priv->server); break; case PROP_LIMIT: g_value_set_uint (value, self->priv->limit); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void tp_contact_search_dispose (GObject *object) { TpContactSearch *self = TP_CONTACT_SEARCH (object); close_search_channel (self); g_object_unref (self->priv->account); g_object_unref (self->priv->cancellable); G_OBJECT_CLASS (tp_contact_search_parent_class)->dispose (object); } static void tp_contact_search_class_init (TpContactSearchClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = tp_contact_search_set_property; gobject_class->get_property = tp_contact_search_get_property; gobject_class->dispose = tp_contact_search_dispose; /** * TpContactSearch:account: * * This search's account. * * Since: 0.13.11 */ g_object_class_install_property (gobject_class, PROP_ACCOUNT, g_param_spec_object ("account", "Account", "A #TpAccount used to create search channels", TP_TYPE_ACCOUNT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpContactSearch:server: * * The search server. This is only supported by some protocols; * use tp_capabilities_supports_contact_search() to check if it's * supported. * * To change the server after the object has been constructed, * use tp_contact_search_reset_async(). * * Since: 0.13.11 */ g_object_class_install_property (gobject_class, PROP_SERVER, g_param_spec_string ("server", "Server", "The server on which to search for contacts", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpContactSearch:limit: * * The maximum number of results that the server should return. * This is only supported by some protocols; use * tp_capabilities_supports_contact_search() to check if it's * supported. * * To change the limit after the object has been constructed, * use tp_contact_search_reset_async(). * * Since: 0.13.11 */ g_object_class_install_property (gobject_class, PROP_LIMIT, g_param_spec_uint ("limit", "Limit", "The maximum number of results to be returned by the server", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpContactSearch:state: * * This search's state, as a %TpChannelContactSearchState. * * Since: 0.13.11 */ g_object_class_install_property (gobject_class, PROP_STATE, g_param_spec_uint ("state", "State", "The search's state", 0, G_MAXUINT32, TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpContactSearch::search-results-received: * @self: a contact search * @results: (type GLib.List) (element-type TelepathyGLib.ContactSearchResult): * a #GList with the search results * * Emitted when search results are received. Note that this signal may * be emitted multiple times for the same search. * * Since: 0.13.11 */ _signals[SEARCH_RESULTS_RECEIVED] = g_signal_new ("search-results-received", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_POINTER); g_type_class_add_private (gobject_class, sizeof (TpContactSearchPrivate)); } static void tp_contact_search_init (TpContactSearch *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CONTACT_SEARCH, TpContactSearchPrivate); self->priv->cancellable = g_cancellable_new (); } /** * tp_contact_search_new_async: * @account: an account for the contact search * @server: the server on which to search for contacts, or %NULL * @limit: The maximum number of results the server should return, * or 0 for the server default. * @callback: a #GAsyncReadyCallback to call when the initialization * is finished * @user_data: data to pass to the callback function * * * * Since: 0.13.11 */ void tp_contact_search_new_async (TpAccount *account, const gchar *server, guint limit, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_ACCOUNT (account)); g_async_initable_new_async (TP_TYPE_CONTACT_SEARCH, G_PRIORITY_DEFAULT, NULL, callback, user_data, "account", account, "server", server, "limit", limit, NULL); } /** * tp_contact_search_new_finish: * @result: the #GAsyncResult from the callback * @error: a #GError location to store an error, or %NULL * * * * Returns: (transfer full): a new contact search object, or %NULL * in case of error. * * Since: 0.13.11 */ TpContactSearch * tp_contact_search_new_finish (GAsyncResult *result, GError **error) { GObject *object, *source_object; source_object = g_async_result_get_source_object (result); object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), result, error); g_object_unref (source_object); if (object != NULL) return TP_CONTACT_SEARCH (object); else return NULL; } /** * tp_contact_search_reset_async: * @self: the #TpContactSearch to reset * @server: the server on which to search for contacts, or %NULL * @limit: The maximum number of results the server should return, * or 0 for the server default. * @callback: a #GAsyncReadyCallback to call when the initialization * is finished * @user_data: data to pass to the callback function * * Resets the contact search object so a new search can be performed. * If another tp_contact_search_reset_async() call is in progress, * it will be cancelled and tp_contact_search_reset_finish() will * return an appropriate error. * * Since: 0.13.11 */ void tp_contact_search_reset_async (TpContactSearch *self, const gchar *server, guint limit, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_CONTACT_SEARCH (self)); if (self->priv->async_res != NULL) { g_cancellable_cancel (self->priv->cancellable); g_object_unref (self->priv->cancellable); self->priv->cancellable = g_cancellable_new (); } g_return_if_fail (self->priv->async_res == NULL); g_free (self->priv->server); self->priv->server = g_strdup (server); self->priv->limit = limit; self->priv->async_res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_contact_search_reset_async); tp_contact_search_open_new_channel (self); } /** * tp_contact_search_reset_finish: * @self: the #TpContactSearch that is being reset * @result: the #GAsyncResult from the callback * @error: a #GError location to store an error, or %NULL * * * * Returns: (transfer none): the new search keys, or %NULL * in case of error. * * Since: 0.13.11 */ const gchar * const * tp_contact_search_reset_finish (TpContactSearch *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), tp_contact_search_reset_async), FALSE); simple = (GSimpleAsyncResult *) result; if (g_simple_async_result_propagate_error (simple, error)) return NULL; return self->priv->keys; } /** * tp_contact_search_start: * @self: a #TpContactSearch * @criteria: (transfer none) (element-type utf8 utf8): a map * from keys returned by tp_contact_search_get_search_keys() * to values to search for * * Starts a search for the keys specified in @criteria. Connect * to the #TpContactSearch::search-results-received signal * before calling this function. * * Before searching again on the same #TpContactSearch, you must * call tp_contact_search_reset_async(). * * Since: 0.13.11 */ void tp_contact_search_start (TpContactSearch *self, GHashTable *criteria) { g_return_if_fail (TP_IS_CONTACT_SEARCH (self)); g_return_if_fail (TP_IS_CHANNEL (self->priv->channel)); g_return_if_fail (self->priv->state == TP_CHANNEL_CONTACT_SEARCH_STATE_NOT_STARTED); tp_cli_channel_type_contact_search_call_search (self->priv->channel, -1, criteria, NULL, NULL, NULL, NULL); } /** * tp_contact_search_get_search_keys: * @self: the contact search object to get the keys from * * Get the search keys for a contact search. * The keys are vCard field names in lower case, except when * they're one of the special cases from telepathy-spec like * "tel;cell" or "x-n-given". See the * * Channel.Type.ContactSearch interface * for a list of the special cases. * * Returns: (transfer none): the new search keys, or %NULL. * * Since: 0.13.11 */ const gchar * const * tp_contact_search_get_search_keys (TpContactSearch *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH (self), NULL); return self->priv->keys; } /** * tp_contact_search_get_account: * @self: a contact search object * * * * Returns: (transfer none): The TpContactSearch:account property * * Since: 0.13.11 */ TpAccount * tp_contact_search_get_account (TpContactSearch *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH (self), NULL); return self->priv->account; } /** * tp_contact_search_get_server: * @self: a contact search object * * * * Returns: The TpContactSearch:server property * * Since: 0.13.11 */ const gchar * tp_contact_search_get_server (TpContactSearch *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH (self), NULL); return self->priv->server; } /** * tp_contact_search_get_limit: * @self: a contact search object * * * * Returns: The TpContactSearch:limit property * * Since: 0.13.11 */ guint tp_contact_search_get_limit (TpContactSearch *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH (self), 0); return self->priv->limit; } static void contact_search_init_async (GAsyncInitable *initable, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { TpContactSearch *self = TP_CONTACT_SEARCH (initable); self->priv->async_res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_contact_search_new_async); tp_contact_search_open_new_channel (self); } static gboolean contact_search_init_finish (GAsyncInitable *initable, GAsyncResult *res, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) return FALSE; return TRUE; } static void async_initable_iface_init (GAsyncInitableIface *iface) { iface->init_async = contact_search_init_async; iface->init_finish = contact_search_init_finish; } telepathy-glib-0.24.2/telepathy-glib/contact-search.h0000644000175000017500000000700512652510705017420 00000000000000/* * contact-search.h - a representation for an ongoing search for contacts * * Copyright (C) 2010-2011 Collabora Ltd. * * The code contained in this file is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this code; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONTACT_SEARCH_H__ #define __TP_CONTACT_SEARCH_H__ #include #include #include #include #include G_BEGIN_DECLS #define TP_TYPE_CONTACT_SEARCH \ (tp_contact_search_get_type ()) #define TP_CONTACT_SEARCH(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT_SEARCH, \ TpContactSearch)) #define TP_CONTACT_SEARCH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CONTACT_SEARCH, \ TpContactSearchClass)) #define TP_IS_CONTACT_SEARCH(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CONTACT_SEARCH)) #define TP_IS_CONTACT_SEARCH_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CONTACT_SEARCH)) #define TP_CONTACT_SEARCH_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONTACT_SEARCH, \ TpContactSearchClass)) typedef struct _TpContactSearch TpContactSearch; typedef struct _TpContactSearchPrivate TpContactSearchPrivate; typedef struct _TpContactSearchClass TpContactSearchClass; struct _TpContactSearch { /**/ GObject parent; TpContactSearchPrivate *priv; }; struct _TpContactSearchClass { /**/ GObjectClass parent_class; GCallback _padding[7]; }; GType tp_contact_search_get_type (void); void tp_contact_search_new_async (TpAccount *account, const gchar *server, guint limit, GAsyncReadyCallback callback, gpointer user_data); TpContactSearch *tp_contact_search_new_finish (GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; void tp_contact_search_reset_async (TpContactSearch *self, const gchar *server, guint limit, GAsyncReadyCallback callback, gpointer user_data); const gchar * const * /* this comment stops gtkdoc denying that this function exists */ tp_contact_search_reset_finish (TpContactSearch *self, GAsyncResult *result, GError **error); void tp_contact_search_start (TpContactSearch *self, GHashTable *criteria); const gchar * const * /* this comment stops gtkdoc denying that this function exists */ tp_contact_search_get_search_keys (TpContactSearch *self); TpAccount * tp_contact_search_get_account (TpContactSearch *self); const gchar * tp_contact_search_get_server (TpContactSearch *self); guint tp_contact_search_get_limit (TpContactSearch *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/observe-channels-context-internal.h0000644000175000017500000000511212652510705023251 00000000000000/**/ /* * Context objects for TpBaseClient calls (internal) * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_OBSERVE_CHANNELS_CONTEXT_INTERNAL_H__ #define __TP_OBSERVE_CHANNELS_CONTEXT_INTERNAL_H__ #include #include #include #include G_BEGIN_DECLS typedef enum { TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE, TP_OBSERVE_CHANNELS_CONTEXT_STATE_DONE, TP_OBSERVE_CHANNELS_CONTEXT_STATE_FAILED, TP_OBSERVE_CHANNELS_CONTEXT_STATE_DELAYED, } TpObserveChannelsContextState; struct _TpObserveChannelsContext { /**/ GObject parent; TpObserveChannelsContextPrivate *priv; TpAccount *account; TpConnection *connection; /* array of reffed TpChannel */ GPtrArray *channels; /* Reffed TpChannelDispatchOperation, or NULL */ TpChannelDispatchOperation *dispatch_operation; /* Array of reffed TpChannelRequest */ GPtrArray *requests; GHashTable *observer_info; }; TpObserveChannelsContext * _tp_observe_channels_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, TpChannelDispatchOperation *dispatch_operation, GPtrArray *requests, GHashTable *observer_info, DBusGMethodInvocation *dbus_context); TpObserveChannelsContextState _tp_observe_channels_context_get_state ( TpObserveChannelsContext *self); void _tp_observe_channels_context_prepare_async (TpObserveChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_observe_channels_context_prepare_finish ( TpObserveChannelsContext *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/stable-interfaces.xml0000644000175000017500000000205412652510705020465 00000000000000 telepathy-glib telepathy-glib-0.24.2/telepathy-glib/message-internal.h0000644000175000017500000000304112652510705017754 00000000000000/**/ /* * message-internal.h - Header for TpMessage (internal * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_MESSAGE_INTERNAL_H__ #define __TP_MESSAGE_INTERNAL_H__ #include "message.h" #include #include #include #include G_BEGIN_DECLS typedef struct _TpMessagePrivate TpMessagePrivate; struct _TpMessageClass { /**/ GObjectClass parent_class; }; struct _TpMessage { /**/ GObject parent; TpMessagePrivate *priv; /* array of hash tables, allocated string => sliced GValue */ GPtrArray *parts; }; void _tp_message_set_immutable (TpMessage *self); G_END_DECLS #endif /* __TP_MESSAGE_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/base-call-stream.c0000644000175000017500000006740612652510705017644 00000000000000/* * base-call-stream.c - Source for TpBaseCallStream * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Will Thompson * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-call-stream * @title: TpBaseCallStream * @short_description: base class for #TpSvcCallStream implementations * @see_also: #TpSvcCallStream, #TpBaseCallChannel and #TpBaseCallContent * * This base class makes it easier to write #TpSvcCallStream * implementations by implementing its properties, and some of its methods. * * Subclasses should fill in #TpBaseCallStreamClass.get_interfaces, * #TpBaseCallStreamClass.request_receiving and * #TpBaseCallStreamClass.set_sending virtual function. * * Since: 0.17.5 */ /** * TpBaseCallStream: * * A base class for call stream implementations * * Since: 0.17.5 */ /** * TpBaseCallStreamClass: * @get_interfaces: extra interfaces provided by this stream (this SHOULD NOT * include %TP_IFACE_CALL_STREAM itself). Implementation must first chainup on * parent class implementation then add extra interfaces into the #GPtrArray. * @request_receiving: optional (see #TpBaseCallStream:can-request-receiving); * virtual method called when user requested receiving from the given remote * contact. * @set_sending: mandatory; virtual method called when user requested to * start/stop sending to remote contacts. * * The class structure for #TpBaseCallStream * * Since: 0.17.5 */ /** * TpBaseCallStreamGetInterfacesFunc: * @self: a #TpBaseCallStream * * Signature of an implementation of #TpBaseCallStreamClass.get_interfaces. * * Returns: a #GPtrArray containing static strings. * Since: 0.17.5 */ /** * TpBaseCallStreamSetSendingFunc: * @self: a #TpBaseCallStream * @sending: whether or not user would like to be sending * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallStreamClass.set_sending. * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.17.5 */ /** * TpBaseCallStreamRequestReceivingFunc: * @self: a #TpBaseCallStream * @contact: the contact from who user wants to start or stop receiving * @receive: wheter or not user would like to be receiving * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallStreamClass.request_receiving. * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.17.5 */ #include "config.h" #include "base-call-stream.h" #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-channel.h" #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-generic.h" #include "telepathy-glib/util.h" static void call_stream_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseCallStream, tp_base_call_stream, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_STREAM, call_stream_iface_init) ) enum { PROP_OBJECT_PATH = 1, PROP_CONNECTION, PROP_CONTENT, PROP_CHANNEL, /* Call interface properties */ PROP_INTERFACES, PROP_REMOTE_MEMBERS, PROP_REMOTE_MEMBER_IDENTIFIERS, PROP_LOCAL_SENDING_STATE, PROP_CAN_REQUEST_RECEIVING, }; struct _TpBaseCallStreamPrivate { gchar *object_path; TpBaseConnection *conn; /* TpHandle -> TpSendingState */ GHashTable *remote_members; TpSendingState local_sending_state; /* Borrowed */ TpBaseCallChannel *channel; TpBaseCallContent *content; }; static void tp_base_call_stream_init (TpBaseCallStream *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CALL_STREAM, TpBaseCallStreamPrivate); self->priv->remote_members = g_hash_table_new (g_direct_hash, g_direct_equal); } static void tp_base_call_stream_constructed (GObject *obj) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (obj); TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon ( (TpBaseConnection *) self->priv->conn); if (G_OBJECT_CLASS (tp_base_call_stream_parent_class)->constructed != NULL) G_OBJECT_CLASS (tp_base_call_stream_parent_class)->constructed (obj); /* register object on the bus */ DEBUG ("Registering %s", self->priv->object_path); tp_dbus_daemon_register_object (bus, self->priv->object_path, obj); } static GPtrArray * tp_base_call_stream_get_interfaces (TpBaseCallStream *self) { return g_ptr_array_new (); } static void tp_base_call_stream_dispose (GObject *object) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (object); TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon ( (TpBaseConnection *) self->priv->conn); tp_dbus_daemon_unregister_object (bus, G_OBJECT (self)); tp_clear_object (&self->priv->conn); if (G_OBJECT_CLASS (tp_base_call_stream_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_base_call_stream_parent_class)->dispose (object); } static void tp_base_call_stream_finalize (GObject *object) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (object); /* free any data held directly by the object here */ g_free (self->priv->object_path); g_hash_table_unref (self->priv->remote_members); if (G_OBJECT_CLASS (tp_base_call_stream_parent_class)->finalize != NULL) G_OBJECT_CLASS (tp_base_call_stream_parent_class)->finalize (object); } static void tp_base_call_stream_get_property ( GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (object); TpBaseCallStreamClass *klass = TP_BASE_CALL_STREAM_GET_CLASS (self); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_CONTENT: g_value_set_object (value, self->priv->content); break; case PROP_CHANNEL: g_value_set_object (value, self->priv->channel); break; case PROP_REMOTE_MEMBERS: g_value_set_boxed (value, self->priv->remote_members); break; case PROP_REMOTE_MEMBER_IDENTIFIERS: { GHashTable *identifiers; identifiers = _tp_base_call_dup_member_identifiers (self->priv->conn, self->priv->remote_members); g_value_set_boxed (value, identifiers); g_hash_table_unref (identifiers); break; } case PROP_LOCAL_SENDING_STATE: g_value_set_uint (value, self->priv->local_sending_state); break; case PROP_CAN_REQUEST_RECEIVING: { g_value_set_boolean (value, klass->request_receiving != NULL); break; } case PROP_INTERFACES: { GPtrArray *interfaces = klass->get_interfaces (self); g_ptr_array_add (interfaces, NULL); g_value_set_boxed (value, interfaces->pdata); g_ptr_array_unref (interfaces); break; } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_stream_set_property ( GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (object); switch (property_id) { case PROP_CONNECTION: self->priv->conn = g_value_dup_object (value); g_assert (self->priv->conn != NULL); break; case PROP_CONTENT: { TpBaseCallContent *content = g_value_get_object (value); if (content) _tp_base_call_stream_set_content (self, content); } break; case PROP_OBJECT_PATH: g_free (self->priv->object_path); self->priv->object_path = g_value_dup_string (value); break; case PROP_LOCAL_SENDING_STATE: self->priv->local_sending_state = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_stream_class_init (TpBaseCallStreamClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl stream_props[] = { { "Interfaces", "interfaces", NULL }, { "RemoteMembers", "remote-members", NULL }, { "RemoteMemberIdentifiers", "remote-member-identifiers", NULL }, { "LocalSendingState", "local-sending-state", NULL }, { "CanRequestReceiving", "can-request-receiving", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CALL_STREAM, tp_dbus_properties_mixin_getter_gobject_properties, NULL, stream_props, }, { NULL } }; g_type_class_add_private (klass, sizeof (TpBaseCallStreamPrivate)); object_class->constructed = tp_base_call_stream_constructed; object_class->dispose = tp_base_call_stream_dispose; object_class->finalize = tp_base_call_stream_finalize; object_class->set_property = tp_base_call_stream_set_property; object_class->get_property = tp_base_call_stream_get_property; klass->get_interfaces = tp_base_call_stream_get_interfaces; /** * TpBaseCallStream:connection: * * #TpBaseConnection object that owns this call stream. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "Tp connection object that owns this call stream", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpBaseCallStream:object-path: * * The D-Bus object path used for this object on the bus. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec); /** * TpBaseCallStream:content: * * #TpBaseCallContent object that owns this call stream. * * Since: 0.17.6 */ param_spec = g_param_spec_object ("content", "TpBaseCallContent object", "Tp Content object that owns this call stream", TP_TYPE_BASE_CALL_CONTENT, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTENT, param_spec); /** * TpBaseCallStream:channel: * * #TpBaseChannel object that owns this call stream. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("channel", "TpBaseCallChannel object", "Tp base call channel object that owns this call stream", TP_TYPE_BASE_CALL_CHANNEL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL, param_spec); /** * TpBaseCallStream:interfaces: * * Additional interfaces implemented by this stream. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("interfaces", "Interfaces", "Stream interfaces", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); /** * TpBaseCallStream:remote-members: * * #GHashTable mapping contact #TpHandle to their #TpSendingState. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("remote-members", "Remote members", "Remote member map", TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_MEMBERS, param_spec); /** * TpBaseCallStream:remote-member-identifiers: * * #GHashTable mapping contact #TpHandle to their identifies. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("remote-member-identifiers", "RemoteMemberIdentifiers", "The remote members identifiers", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_MEMBER_IDENTIFIERS, param_spec); /** * TpBaseCallStream:local-sending-state: * * The local #TpSendingState. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("local-sending-state", "LocalSendingState", "Local sending state", TP_SENDING_STATE_NONE, TP_NUM_SENDING_STATES, TP_SENDING_STATE_NONE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_SENDING_STATE, param_spec); /** * TpBaseCallStream:can-request-receiving: * * Whether or not user can request receiving from remote contact using the * RequestSending DBus method call. The value is determined by whether or not * #TpBaseCallStreamClass.request_receiving is implemented. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("can-request-receiving", "CanRequestReceiving", "If true, the user can request that a remote contact starts sending on" "this stream.", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAN_REQUEST_RECEIVING, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseCallStreamClass, dbus_props_class)); } /** * tp_base_call_stream_get_connection: * @self: a #TpBaseCallStream * * * * Returns: the value of #TpBaseCallStream:connection * Since: 0.17.5 */ TpBaseConnection * tp_base_call_stream_get_connection (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), NULL); return self->priv->conn; } /** * tp_base_call_stream_get_object_path: * @self: a #TpBaseCallStream * * * * Returns: the value of #TpBaseCallStream:object-path * Since: 0.17.5 */ const gchar * tp_base_call_stream_get_object_path (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), NULL); return self->priv->object_path; } /** * tp_base_call_stream_get_local_sending_state: * @self: a #TpBaseCallStream * * * * Returns: the value of #TpBaseCallStream:local-sending-state * Since: 0.17.5 */ TpSendingState tp_base_call_stream_get_local_sending_state (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), TP_SENDING_STATE_NONE); return self->priv->local_sending_state; } /** * tp_base_call_stream_update_local_sending_state: * @self: a #TpBaseCallStream * @new_state: the new local #TpSendingState * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Update the local sending state, emitting LocalSendingStateChanged * DBus signal if needed. * * Returns: %TRUE if state was updated, %FALSE if it was already set to * @new_state. * Since: 0.17.5 */ gboolean tp_base_call_stream_update_local_sending_state (TpBaseCallStream *self, TpSendingState new_state, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GValueArray *reason_array; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE); if (new_state == TP_SENDING_STATE_SENDING && self->priv->channel != NULL && !tp_base_call_channel_is_accepted (self->priv->channel) && !tp_base_channel_is_requested (TP_BASE_CHANNEL (self->priv->channel))) new_state = TP_SENDING_STATE_PENDING_SEND; if (self->priv->local_sending_state == new_state) return FALSE; DEBUG ("Updating local sending state: %d => %d for stream %s", self->priv->local_sending_state, new_state, self->priv->object_path); self->priv->local_sending_state = new_state; g_object_notify (G_OBJECT (self), "local-sending-state"); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_call_stream_emit_local_sending_state_changed ( TP_SVC_CALL_STREAM (self), new_state, reason_array); tp_value_array_free (reason_array); return TRUE; } /** * tp_base_call_stream_get_remote_sending_state: * @self: a #TpBaseCallStream * @contact: the #TpHandle of a member contact * * * * Returns: the #TpSendingState of @contact. * Since: 0.17.5 */ TpSendingState tp_base_call_stream_get_remote_sending_state (TpBaseCallStream *self, TpHandle contact) { gpointer state_p; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), TP_SENDING_STATE_NONE); state_p = g_hash_table_lookup (self->priv->remote_members, GUINT_TO_POINTER (contact)); return GPOINTER_TO_UINT (state_p); } /** * tp_base_call_stream_update_remote_sending_state: * @self: a #TpBaseCallStream * @contact: the #TpHandle to update or add to members * @new_state: the new sending state of @contact * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * If @contact is not member, add it. Otherwise update its sending state. Emits * RemoteMemberChanged DBus signal if needed. * * Returns: %TRUE if state was updated, %FALSE if it was already set to * @new_state. * Since: 0.17.5 */ gboolean tp_base_call_stream_update_remote_sending_state (TpBaseCallStream *self, TpHandle contact, TpSendingState new_state, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { gpointer old_state_p = NULL; TpSendingState old_state; gboolean exists; GHashTable *updates; GHashTable *identifiers; GArray *removed_empty; GValueArray *reason_array; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE); if (new_state == TP_SENDING_STATE_SENDING && self->priv->channel != NULL && tp_base_channel_is_requested (TP_BASE_CHANNEL (self->priv->channel)) && !tp_base_call_channel_is_accepted (self->priv->channel)) new_state = TP_SENDING_STATE_PENDING_SEND; exists = g_hash_table_lookup_extended (self->priv->remote_members, GUINT_TO_POINTER (contact), NULL, &old_state_p); old_state = GPOINTER_TO_UINT (old_state_p); if (exists && old_state == new_state) return FALSE; DEBUG ("Updating remote member %d state: %d => %d for stream %s", contact, old_state, new_state, self->priv->object_path); g_hash_table_insert (self->priv->remote_members, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_state)); g_object_notify (G_OBJECT (self), "remote-members"); updates = g_hash_table_new (g_direct_hash, g_direct_equal); g_hash_table_insert (updates, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_state)); identifiers = _tp_base_call_dup_member_identifiers (self->priv->conn, updates); removed_empty = g_array_new (FALSE, FALSE, sizeof (TpHandle)); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_call_stream_emit_remote_members_changed (self, updates, identifiers, removed_empty, reason_array); g_array_unref (removed_empty); tp_value_array_free (reason_array); g_hash_table_unref (updates); g_hash_table_unref (identifiers); return TRUE; } /** * tp_base_call_stream_remove_member: * @self: a #TpBaseCallStream * @contact: the #TpHandle to remove from members * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Remove @contact from stream members, emitting RemoteMembersChanged DBus * signal if needed. Do nothing if @contact is not member. * * Returns: %TRUE if @contact was removed, %FALSE if it was not member. * Since: 0.17.5 */ gboolean tp_base_call_stream_remove_member (TpBaseCallStream *self, TpHandle contact, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GHashTable *empty_table; GArray *removed_array; GValueArray *reason_array; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE); if (!g_hash_table_remove (self->priv->remote_members, GUINT_TO_POINTER (contact))) return FALSE; g_object_notify (G_OBJECT (self), "remote-members"); empty_table = g_hash_table_new (g_direct_hash, g_direct_equal); removed_array = g_array_sized_new (FALSE, TRUE, sizeof (TpHandle), 1); g_array_append_val (removed_array, contact); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_call_stream_emit_remote_members_changed (self, empty_table, empty_table, removed_array, reason_array); tp_value_array_free (reason_array); g_hash_table_unref (empty_table); g_array_unref (removed_array); return TRUE; } static void tp_base_call_stream_set_sending_dbus (TpSvcCallStream *iface, gboolean sending, DBusGMethodInvocation *context) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (iface); GError *error = NULL; if (_tp_base_call_stream_set_sending (TP_BASE_CALL_STREAM (iface), sending, tp_base_channel_get_self_handle ((TpBaseChannel *) self->priv->channel), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User changed the sending state", &error)) { tp_svc_call_stream_return_from_set_sending (context); } else { dbus_g_method_return_error (context, error); } g_clear_error (&error); } static void tp_base_call_stream_request_receiving (TpSvcCallStream *iface, TpHandle contact, gboolean receiving, DBusGMethodInvocation *context) { TpBaseCallStream *self = TP_BASE_CALL_STREAM (iface); TpBaseCallStreamClass *klass = TP_BASE_CALL_STREAM_GET_CLASS (self); GError *error = NULL; TpSendingState remote_sending_state; gboolean can_request_receiving; g_object_get (self, "can-request-receiving", &can_request_receiving, NULL); if (!can_request_receiving) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "The contact does not support requesting to receive"); goto error; } if (!g_hash_table_lookup_extended (self->priv->remote_members, GUINT_TO_POINTER (contact), NULL, (gpointer *) &remote_sending_state)) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Contact %u is not member of this stream", contact); goto error; } if (klass->request_receiving == NULL) { g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This CM does not implement request_receiving"); goto error; } /* Determine if there is a state change for our receiving side * aka remote sending */ switch (remote_sending_state) { case TP_SENDING_STATE_NONE: case TP_SENDING_STATE_PENDING_STOP_SENDING: if (!receiving) goto out; break; case TP_SENDING_STATE_SENDING: case TP_SENDING_STATE_PENDING_SEND: if (receiving) goto out; break; default: g_assert_not_reached (); } if (!klass->request_receiving (self, contact, receiving, &error)) goto error; out: tp_svc_call_stream_return_from_request_receiving (context); return; error: dbus_g_method_return_error (context, error); g_clear_error (&error); } static void call_stream_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcCallStreamClass *klass = (TpSvcCallStreamClass *) g_iface; #define IMPLEMENT(x, suffix) tp_svc_call_stream_implement_##x (\ klass, tp_base_call_stream_##x##suffix) IMPLEMENT(set_sending, _dbus); IMPLEMENT(request_receiving,); #undef IMPLEMENT } /* These functions are used only internally */ void _tp_base_call_stream_set_content (TpBaseCallStream *self, TpBaseCallContent *content) { g_return_if_fail (TP_IS_BASE_CALL_STREAM (self)); g_return_if_fail (TP_IS_BASE_CALL_CONTENT (content)); g_return_if_fail (self->priv->content == NULL || self->priv->content == content); self->priv->content = content; self->priv->channel = _tp_base_call_content_get_channel (content); g_object_notify (G_OBJECT (self), "content"); g_object_notify (G_OBJECT (self), "channel"); } TpBaseCallContent * _tp_base_call_stream_get_content (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), NULL); g_return_val_if_fail (self->priv->content != NULL, NULL); return self->priv->content; } TpBaseCallChannel * _tp_base_call_stream_get_channel (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), NULL); return self->priv->channel; } gboolean _tp_base_call_stream_set_sending (TpBaseCallStream *self, gboolean send, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message, GError **error) { TpBaseCallStreamClass *klass = TP_BASE_CALL_STREAM_GET_CLASS (self); /* Determine if there is a state change for our sending side */ switch (self->priv->local_sending_state) { case TP_SENDING_STATE_NONE: case TP_SENDING_STATE_PENDING_SEND: if (!send) goto out; break; case TP_SENDING_STATE_SENDING: case TP_SENDING_STATE_PENDING_STOP_SENDING: if (send) goto out; break; default: g_assert_not_reached (); } if (klass->set_sending == NULL) { g_set_error_literal (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This CM does not implement SetSending"); return FALSE; } if (!klass->set_sending (self, send, error)) return FALSE; out: tp_base_call_stream_update_local_sending_state (self, send ? TP_SENDING_STATE_SENDING : TP_SENDING_STATE_NONE, actor_handle, reason, dbus_reason, message); return TRUE; } GHashTable * _tp_base_call_stream_get_remote_members (TpBaseCallStream *self) { g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), NULL); return self->priv->remote_members; } telepathy-glib-0.24.2/telepathy-glib/base-call-stream.h0000644000175000017500000001055712652510705017644 00000000000000/* * base-call-stream.h - Header for TpBaseCallStream * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Will Thompson * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_BASE_CALL_STREAM_H #define TP_BASE_CALL_STREAM_H #include #include #include #include G_BEGIN_DECLS typedef struct _TpBaseCallStream TpBaseCallStream; typedef struct _TpBaseCallStreamPrivate TpBaseCallStreamPrivate; typedef struct _TpBaseCallStreamClass TpBaseCallStreamClass; typedef GPtrArray * (*TpBaseCallStreamGetInterfacesFunc) ( TpBaseCallStream *self); typedef gboolean (*TpBaseCallStreamSetSendingFunc) (TpBaseCallStream *self, gboolean sending, GError **error); typedef gboolean (*TpBaseCallStreamRequestReceivingFunc) (TpBaseCallStream *self, TpHandle contact, gboolean receive, GError **error); struct _TpBaseCallStreamClass { /**/ GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; /*< public >*/ TpBaseCallStreamRequestReceivingFunc request_receiving; TpBaseCallStreamSetSendingFunc set_sending; TpBaseCallStreamGetInterfacesFunc get_interfaces; /**/ gpointer future[4]; }; struct _TpBaseCallStream { /**/ GObject parent; TpBaseCallStreamPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_base_call_stream_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_CALL_STREAM \ (tp_base_call_stream_get_type ()) #define TP_BASE_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_CALL_STREAM, TpBaseCallStream)) #define TP_BASE_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_CALL_STREAM, \ TpBaseCallStreamClass)) #define TP_IS_BASE_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CALL_STREAM)) #define TP_IS_BASE_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CALL_STREAM)) #define TP_BASE_CALL_STREAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CALL_STREAM, \ TpBaseCallStreamClass)) _TP_AVAILABLE_IN_0_18 TpBaseConnection *tp_base_call_stream_get_connection ( TpBaseCallStream *self); _TP_AVAILABLE_IN_0_18 const gchar *tp_base_call_stream_get_object_path ( TpBaseCallStream *self); _TP_AVAILABLE_IN_0_18 TpSendingState tp_base_call_stream_get_local_sending_state ( TpBaseCallStream *self); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_stream_update_local_sending_state ( TpBaseCallStream *self, TpSendingState new_state, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 TpSendingState tp_base_call_stream_get_remote_sending_state ( TpBaseCallStream *self, TpHandle contact); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_stream_update_remote_sending_state ( TpBaseCallStream *self, TpHandle contact, TpSendingState new_state, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_stream_remove_member ( TpBaseCallStream *self, TpHandle contact, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/TelepathyGLib-0.12.gir0000644000175000017500001237044214006601706020137 00000000000000 Type representing Telepathy handles within telepathy-glib. This is guint despite the wire protocol having 32-bit integers, because dbus-glib expects GArrays of guint and so on. If the dbus-glib ABI changes in future, telepathy-glib is likely to have a matching ABI change. Before 0.11.16, this was the name for <type>TpIntset</type>, but it's now just a backwards compatibility typedef. Before 0.11.16, this was the name for <type>TpIntsetFastIter</type>, but it's now just a backwards compatibility typedef. since 0.19.0. Use #TpIntsetFastIter instead Before 0.11.16, this was the name for <type>TpIntsetIter</type>, but it's now just a backwards compatibility typedef. since 0.19.0. Use #TpIntsetFastIter instead The account manager's well-known bus name The account manager's standard object path The common prefix of the object path for all Account objects. <![CDATA[ A type for communication access control. These control policies are used in CommunicationPolicy.DRAFT as well as most rich presence interfaces. New interfaces should use this type, and NOT Rich_Presence_Access_Control_Type. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Only allow contacts that are in a certain whitelist. The associated variant in Access_Control is a list of Contact_Handle representing the whitelist, with signature au. ]]> <![CDATA[ Allow contacts in the user's 'publish' list. The associated variant in Access_Control is ignored. ]]> <![CDATA[ Only allow contacts that are in a certain group. The associated variant in Access_Control is a Group_Handle representing the permitted group. ]]> <![CDATA[ Allow all contacts. The associated variant in Access_Control is ignored. ]]> <![CDATA[ Allow all contacts in the user's 'subscribe' or 'publish' list. The associated variant in Access_Control is ignored. ]]> <![CDATA[ Forbid all contacts. The associated variant in Access_Control is ignored. ]]> <![CDATA[ The access control rule is too complex to be represented in the current Telepathy API. The associated variant is meaningless. Setting this mode is never valid; the connection manager MUST raise an error if this is attempted. XEP-0016 Privacy Lists can easily produce access control mechanisms that can't be expressed in a simpler API. We need to be able to at least indicate that fact. The associated variant in Access_Control is ignored. ]]> The Telepathy Account Manager stores the user's configured real-time communication accounts. This object represents a stored account. If this account is deleted from the account manager, the #TpProxy::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_OBJECT_REMOVED. One can connect to the #GObject::notify signal to get change notifications for many of the properties on this object. Refer to each property's documentation for whether it can be used in this way. #TpAccount objects should normally be obtained from the #TpAccountManager. Since 0.16, #TpAccount always has a non-%NULL #TpProxy:factory, and its #TpProxy:factory will be propagated to its #TpConnection (if any). If a #TpAccount is created without going via the #TpAccountManager or specifying a #TpProxy:factory, the default is to use a new #TpAutomaticClientFactory. Convenience function to create a new account proxy. The returned #TpAccount is not guaranteed to be ready at the point of return. Use tp_simple_client_factory_ensure_account() instead. a new reference to an account proxy, or %NULL if @object_path is not valid Proxy for the D-Bus daemon The non-NULL object path of this account <!-- --> the quark used for representing the connection feature of a #TpAccount <!-- --> the quark used for representing the core feature of a #TpAccount <!-- --> the quark used for representing the storage interface of a #TpAccount Ensure that the known interfaces for TpAccount have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_ACCOUNT. Validates and parses a Telepathy Account's object path, extracting the connection manager's name, the protocol, and the account's unique identifier from the path. This includes replacing underscores with hyphens in the protocol name, as defined in the Account specification. Any of the out parameters may be %NULL if not needed. If %TRUE is returned, the caller is responsible for freeing the strings stored in any non-%NULL out parameters, using g_free(). Use tp_account_get_protocol() and tp_account_get_connection_manager() instead. %TRUE if @object_path was successfully parsed; %FALSE and sets @error otherwise. a Telepathy Account's object path location at which to store the account's connection manager's name location at which to store the account's protocol location at which to store the account's unique identifier <!-- --> %TRUE if the result of tp_account_get_uri_schemes() would include @scheme a #TpAccount a URI scheme such as "tel", "sip" or "xmpp" Binds the :connection-status of @self to the boolean property of another object using a #GBinding such that the @target_property will be set to %TRUE when @self is connected (and @invert is %FALSE). @target_property will be synchronised immediately (%G_BINDING_SYNC_CREATE). @invert can be interpreted as analogous to %G_BINDING_INVERT_BOOLEAN. For instance, this function can be used to bind the GtkWidget:sensitive property to only make a widget sensitive when the account is connected. See g_object_bind_property() for more information. the #GBinding instance representing the binding between the @self and the @target. The binding is released whenever the #GBinding reference count reaches zero. a #TpAccount the target #GObject the property on @target to bind (must be %G_TYPE_BOOLEAN) %TRUE if you wish to invert the value of @target_property (i.e. %FALSE if connected) If the account's connection is not connected, return the D-Bus error name with which it last disconnected or failed to connect (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). This is the same as #TpAccount:connection-error. If @details is not %NULL, it will be used to return additional details about the error (the same as #TpAccount:connection-error-details). Otherwise, return %NULL, without altering @details. The returned string and @details may become invalid when the main loop is re-entered or the account is destroyed. a D-Bus error name, or %NULL. an account optionally used to return a variant of type %G_VARIANT_TYPE_VARDICT, which must be unreffed by the caller with g_variant_unref() Returns the parameters of the account, in a variant of type %G_VARIANT_TYPE_VARDICT where the keys are parameter names (account, password, require-encryption etc.). Use g_variant_lookup() or g_variant_lookup_value() for convenient access to the values. The allowed parameters depend on the connection manager, and can be found via tp_connection_manager_get_protocol() and tp_connection_manager_protocol_get_param(). Well-known parameters are listed <ulink url="http://telepathy.freedesktop.org/spec/org.freedesktop.Telepathy.ConnectionManager.html#org.freedesktop.Telepathy.ConnectionManager.RequestConnection">in the Telepathy D-Bus Interface Specification</ulink>. the dictionary of parameters on @account, of type %G_VARIANT_TYPE_VARDICT a #TpAccount Return provider-specific information used to identify this account. Use g_variant_get_type() to check that the type is what you expect; for instance, if the #TpAccount:storage-provider has string-based user identifiers, this variant should have type %G_VARIANT_TYPE_STRING. the same as the #TpAccount:storage-identifier-variant property a #TpAccount Makes an asynchronous request of @self's StorageSpecificInformation property (part of the Account.Interface.Storage interface). When the operation is finished, @callback will be called. You must then call tp_account_dup_storage_specific_information_vardict_finish() to get the result of the request. a #TpAccount a callback to call when the request is satisfied data to pass to @callback Retrieve the value of the request begun with tp_account_dup_storage_specific_information_vardict_async(). a map from strings to variants, of type %G_VARIANT_TYPE_VARDICT a #TpAccount a #GAsyncResult Set the connection of the account by specifying the connection object path. This function does not return a new ref and it is not guaranteed that the returned #TpConnection object is ready. The use-case for this function is in a HandleChannels callback and you already know the object path for the connection, so you can let @account create its #TpConnection and return it for use. New code should use tp_simple_client_factory_ensure_connection() instead. the connection of the account, or %NULL if either the object path @path is invalid or it is the null-value "/" a #TpAccount the path to connection object for #TpAccount Gets the automatic presence, status and status message of @account. These values are the same as the #TpAccount:automatic-presence-type, #TpAccount:automatic-status and #TpAccount:automatic-status-message properties, and are the values that will be used if the account should be put online automatically. the same as the #TpAccount:automatic-presence-type property an account return location for the presence status return location for the user-defined message Requests an asynchronous get of @account's avatar. When the operation is finished, @callback will be called. You can then call tp_account_get_avatar_finish() to get the result of the operation. a #TpAccount a callback to call when the request is satisfied data to pass to @callback Finishes an async get operation of @account's avatar. Beware that the returned value is only valid until @result is freed. Copy it with g_array_ref() if you need to keep it for longer. a #GArray of #guchar containing the bytes of the account's avatar, or %NULL on failure a #TpAccount a #GAsyncResult <!-- --> the same as the #TpAccount:changing-presence property an account <!-- --> the same as the #TpAccount:cm-name property a #TpAccount <!-- --> the same as the #TpAccount:connect-automatically property a #TpAccount <!-- --> the same as the #TpAccount:connection property a #TpAccount <!-- --> Use tp_account_get_cm_name() instead. the same as the #TpAccount:connection-manager property a #TpAccount Gets the connection status and reason from @account. The two values are the same as the #TpAccount:connection-status and #TpAccount:connection-status-reason properties. the same as the #TpAccount:connection-status property a #TpAccount a #TpConnectionStatusReason to fill, or %NULL Gets the current presence, status and status message of @account. These values are the same as the #TpAccount:current-presence-type, #TpAccount:current-status and #TpAccount:current-status-message properties. the same as the #TpAccount:current-presence-type property a #TpAccount return location for the current status return location for the current status message If the account's connection is not connected, return the D-Bus error name with which it last disconnected or failed to connect (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). This is the same as #TpAccount:connection-error. If @details is not %NULL, it will be used to return additional details about the error (the same as #TpAccount:connection-error-details). Otherwise, return %NULL, without altering @details. The returned string and @details may become invalid when the main loop is re-entered or the account is destroyed. a D-Bus error name, or %NULL. an account optionally used to return a map from string to #GValue, which must not be modified, destroyed or unreffed by the caller <!-- --> the same as the #TpAccount:display-name property a #TpAccount <!-- --> the same as the #TpAccount:has-been-online property a #TpAccount <!-- --> the same as the #TpAccount:icon-name property a #TpAccount <!-- --> the same as the #TpAccount:nickname property a #TpAccount <!-- --> the same as the #TpAccount:normalized-name property a #TpAccount Returns the parameters of the account, in a hash table where each string is the parameter name (account, password, require-encryption etc.), and each value is a #GValue. Using the tp_asv_get family of functions (tp_asv_get_uint32(), tp_asv_get_string() etc.) to access the parameters is recommended. The allowed parameters depend on the connection manager, and can be found via tp_connection_manager_get_protocol() and tp_connection_manager_protocol_get_param(). Well-known parameters are listed <ulink url="http://telepathy.freedesktop.org/spec/org.freedesktop.Telepathy.ConnectionManager.html#org.freedesktop.Telepathy.ConnectionManager.RequestConnection">in the Telepathy D-Bus Interface Specification</ulink>. the hash table of parameters on @account a #TpAccount Returns the portion of @account's object path after the standard #TP_ACCOUNT_OBJECT_PATH_BASE prefix, of the form "cm/protocol/acct". This string uniquely identifies the account. This function is only intended to be used when printing debug messages or in tools for developer. For a string suitable for displaying to the user, see tp_account_get_display_name(). To retrieve the connection manager and protocol name parts of the object path, see tp_account_get_connection_manager() and tp_account_get_protocol(). For persistent identification of the account, use tp_proxy_get_object_path(). a suffix of @account's object path, for debugging purposes. a #TpAccount <!-- --> Use tp_account_get_cm_name() instead. the same as the #TpAccount:protocol property a #TpAccount <!-- --> the same as the #TpAccount:protocol-name property a #TpAccount Gets the requested presence, status and status message of @account. These values are the same as the #TpAccount:requested-presence-type, #TpAccount:requested-status and #TpAccount:requested-status-message properties. the same as the #TpAccount:requested-presence-type property a #TpAccount return location for the requested status return location for the requested status message <!-- --> the same as the #TpAccount:service property an account <!-- --> the same as the #TpAccount:storage-identifier property a #TpAccount <!-- --> the same as the #TpAccount:storage-provider property a #TpAccount <!-- --> the same as the #TpAccount:storage-restrictions property a #TpAccount Makes an asynchronous request of @self's StorageSpecificInformation property (part of the Account.Interface.Storage interface). When the operation is finished, @callback will be called. You must then call tp_account_get_storage_specific_information_finish() to get the result of the request. a #TpAccount a callback to call when the request is satisfied data to pass to @callback Retrieve the value of the request begun with tp_account_get_storage_specific_information_async(). Beware that the returned value is only valid until @result is freed. Copy it with g_hash_table_ref() if you need to keep it for longer. a #GHashTable of strings to GValues representing the D-Bus type a{sv}. a #TpAccount a #GAsyncResult Return the same thing as the #TpAccount:supersedes property, in a way that may be more convenient for C code. The returned pointers are not guaranteed to remain valid after the main loop has been re-entered. the same as the #TpAccount:supersedes property a #TpAccount Return the #TpAccount:uri-schemes property the value of #TpAccount:uri_schemes property a #TpAccount <!-- --> the same as the #TpAccount:enabled property a #TpAccount <!-- --> since 0.23.0, use tp_proxy_is_prepared() instead. the same thing as tp_proxy_is_prepared() a #TpAccount a feature which is required <!-- --> the same as the #TpAccount:valid property a #TpAccount Requests an asynchronous preparation of @account with the features specified by @features. When the operation is finished, @callback will be called. You can then call tp_account_prepare_finish() to get the result of the operation. If @features is %NULL, then @callback will be called when the implied %TP_ACCOUNT_FEATURE_CORE feature is ready. If %NULL is given to @callback, then no callback will be called when the operation is finished. Instead, it will simply set @features on @manager. Note that if @callback is %NULL, then @user_data must also be %NULL. Since 0.11.3, this is equivalent to calling the new function tp_proxy_prepare_async() with the same arguments. since 0.15.6, use tp_proxy_prepare_async() instead. a #TpAccount a 0-terminated list of features, or %NULL a callback to call when the request is satisfied data to pass to @callback Finishes an async preparation of the account @account. since 0.15.6, use tp_proxy_prepare_finish() instead. %TRUE if the preparation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous reconnect of @account. When the operation is finished, @callback will be called. You can then call tp_account_reconnect_finish() to get the result of the operation. a #TpAccount a callback to call when the request is satisfied data to pass to @callback Finishes an async reconnect of @account. %TRUE if the reconnect call was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous removal of @account. When the operation is finished, @callback will be called. You can then call tp_account_remove_finish() to get the result of the operation. a #TpAccount a callback to call when the request is satisfied data to pass to @callback Finishes an async removal of @account. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous change of presence on @account. When the operation is finished, @callback will be called. You can then call tp_account_request_presence_finish() to get the result of the operation. a #TpAccount the requested presence a status message to set, or %NULL a message for the change, or %NULL a callback to call when the request is satisfied data to pass to @callback Finishes an async presence change request on @account. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous change of @account's automatic presence. When the operation is finished, @callback will be called. You can then call tp_account_set_automatic_presence_finish() to get the result of the operation. a #TpAccount the requested presence a status message to set, or %NULL a message for the change, or %NULL a callback to call when the request is satisfied data to pass to @callback Finishes an asynchronous request to change the automatic presence of @account. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous change of the Avatar parameter on @self. When the operation is finished, @callback will be called. You can then call tp_account_set_avatar_finish() to get the result of the operation. If @len equals 0, the avatar is cleared. a #TpAccount a new avatar to set; can be %NULL only if @len equals 0 the length of the new avatar the MIME type of the new avatar; can be %NULL only if @len equals 0 a callback to call when the request is satisfied data to pass to @callback Finishes an async avatar change request on @account. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous set of the ConnectAutomatically property of @account. When the operation is finished, @callback will be called. You can then call tp_account_set_display_name_finish() to get the result of the operation. a #TpAccount new value for the parameter a callback to call when the request is satisfied data to pass to @callback Finishes an async set of the ConnectAutomatically property. %TRUE if the call was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous set of the DisplayName property of @account. When the operation is finished, @callback will be called. You can then call tp_account_set_display_name_finish() to get the result of the operation. a #TpAccount a new display name, or %NULL to unset the display name a callback to call when the request is satisfied data to pass to @callback Finishes an async set of the DisplayName property. %TRUE if the call was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous set of the Enabled property of @account. When the operation is finished, @callback will be called. You can then call tp_account_set_enabled_finish() to get the result of the operation. a #TpAccount the new enabled value of @account a callback to call when the request is satisfied data to pass to @callback Finishes an async set of the Enabled property. %TRUE if the set was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous set of the Icon property of @account. When the operation is finished, @callback will be called. You can then call tp_account_set_icon_name_finish() to get the result of the operation. a #TpAccount a new icon name, or %NULL to unset the icon name a callback to call when the request is satisfied data to pass to @callback Finishes an async set of the Icon parameter. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous change of the Nickname parameter on @account. When the operation is finished, @callback will be called. You can then call tp_account_set_nickname_finish() to get the result of the operation. a #TpAccount a new nickname to set a callback to call when the request is satisfied data to pass to @callback Finishes an async nickname change request on @account. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous set of the Service property on @self. When the operation is finished, @callback will be called. You can then call tp_account_set_service_finish() to get the result of the operation. a #TpAccount a new service name, or %NULL or the empty string to unset the service name (which will result in the #TpAccount:service property becoming the same as #TpAccount:protocol) a callback to call when the request is satisfied data to pass to @callback Finishes an async set of the Service parameter. %TRUE if the operation was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Add @scheme to the list of additional URI schemes that would be returned by tp_account_get_uri_schemes(), or remove it from that list. @scheme should not be the primary URI scheme for the account's protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), since the account should be assumed to be useful for those schemes regardless of the contents of the list. Calling this method does not require the %TP_ACCOUNT_FEATURE_ADDRESSING feature to be enabled, but the change will not be reflected in the result of tp_account_get_uri_schemes() or tp_account_associated_with_uri_scheme() unless that feature has been enabled. a #TpAccount a non-%NULL URI scheme such as "tel" %TRUE to use this account for @scheme, or %FALSE to not use it a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_account_set_uri_scheme_association_async(). %TRUE if the call was successful, otherwise %FALSE a #TpAccount a #GAsyncResult Requests an asynchronous update of parameters of @account. When the operation is finished, @callback will be called. You can then call tp_account_update_parameters_finish() to get the result of the operation. a #TpAccount new parameters to set on @account list of parameters to unset on @account a callback to call when the request is satisfied data to pass to @callback Finishes an async update of the parameters on @account. %TRUE if the request succeeded, otherwise %FALSE a #TpAccount a #GAsyncResult a #GStrv to fill with properties that need a reconnect to take effect Requests an asynchronous update of parameters of @account. When the operation is finished, @callback will be called. You can then call tp_account_update_parameters_finish() to get the result of the operation. If @parameters is a floating reference (see g_variant_ref_sink()), ownership of @parameters is taken by this function. This means you can pass the result of g_variant_new() or g_variant_new_parsed() directly to this function without additional reference-count management. a #TpAccount a variant of type %G_VARIANT_TYPE_VARDICT containing new parameters to set on @account list of parameters to unset on @account a callback to call when the request is satisfied data to pass to @callback Finishes an async update of the parameters on @account. %TRUE if the request succeeded, otherwise %FALSE a #TpAccount a #GAsyncResult a #GStrv to fill with properties that need a reconnect to take effect The account's automatic presence type (a #TpConnectionPresenceType). When the account is put online automatically, for instance to make a channel request or because network connectivity becomes available, the automatic presence type, status and message will be copied to their "requested" counterparts. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %TP_CONNECTION_PRESENCE_TYPE_UNSET. The string status name to use in conjunction with the #TpAccount:automatic-presence-type. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The user-defined message to use in conjunction with the #TpAccount:automatic-presence-type. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for automatic-presence-type, automatic-status and automatic-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. %TRUE if an attempt is currently being made to change the account's presence (#TpAccount:current-presence-type, #TpAccount:current-status and #TpAccount:current-status-message) to match its requested presence (#TpAccount:requested-presence-type, #TpAccount:requested-status and #TpAccount:requested-status-message). One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %FALSE. The account's connection manager name. Whether the account should connect automatically or not. To change this property, use tp_account_set_connect_automatically_async(). One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %FALSE. The connection of the account, or %NULL if account is offline. Note that the returned #TpConnection is not guaranteed to have any features pre-prepared (not even %TP_CONNECTION_FEATURE_CORE) unless %TP_ACCOUNT_FEATURE_CONNECTION has been prepared on the account One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. If %TP_ACCOUNT_FEATURE_CONNECTION has been prepared, this signal will be delayed until the connection is ready. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The D-Bus error name for the last disconnection or connection failure, (in particular, %TP_ERROR_STR_CANCELLED if it was disconnected by user request), or %NULL if the account is connected. One can receive change notifications on this property by connecting to the #TpAccount::status-changed signal, or by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. A map from string to #GValue containing extensible error details related to #TpAccount:connection-error. Functions like tp_asv_get_string() can be used to read from this map. The keys for this map are defined by <ulink url="http://telepathy.freedesktop.org/spec/">the Telepathy D-Bus Interface Specification</ulink>. They will typically include <literal>debug-message</literal>, which is a debugging message in the C locale, analogous to #GError<!-- -->.message. One can receive change notifications on this property by connecting to the #TpAccount::status-changed signal, or by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is an empty map. The account's connection manager name. Use #TpAccount:cm-name instead. The account's connection status type (a %TpConnectionStatus). One can receive change notifications on this property by connecting to the #TpAccount::status-changed signal, or by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %TP_CONNECTION_STATUS_DISCONNECTED. The account's connection status reason (a %TpConnectionStatusReason). One can receive change notifications on this property by connecting to the #TpAccount::status-changed signal, or by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED. The account connection's current presence type (a %TpConnectionPresenceType). One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %TP_CONNECTION_PRESENCE_TYPE_UNSET. The current Status string of the account. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The current status message message of the account. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for current-presence-type, current-status and current-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The account's display name, from the DisplayName property. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. Whether this account is enabled or not. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is FALSE. Whether this account has been online or not. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %FALSE. The account's icon name. To change this propery, use tp_account_set_icon_name_async(). One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The nickname that should be set for the user on this account. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The normalized form of the user's own unique identifier on this protocol. For example, on XMPP accounts this is the user's JID; on ICQ this is the user's UIN; and so on. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification. Use #TpAccount:protocol-name instead. The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification. The account's requested presence type (a #TpConnectionPresenceType). Since 0.13.8, one can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The requested Status string of the account. Since 0.13.8, one can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. The requested status message message of the account. Since 0.13.8, one can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. Change notifications for requested-presence-type, requested-status and requested-status-message are always emitted together, so it is sufficient to connect to one of the notification signals. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %NULL. A machine-readable name identifying a specific service to which this account connects, or a copy of #TpAccount:protocol if there is no more specific service. Well-known names for various services can be found in the Telepathy D-Bus Interface Specification. For instance, accounts for the "jabber" protocol should have the service names "google-talk", "ovi-chat", "facebook" and "lj-talk" for accounts that connect to Google Talk, Ovi Chat, Facebook and Livejournal, respectively, and this property will be "jabber" for accounts that connect to a generic Jabber server. To change this property, use tp_account_set_service_async(). The storage identifier for this account. A provider-specific variant type used to identify this account with the provider. This value will be %NULL if #TpAccount:storage-provider is an empty string. This property cannot change once an Account has been created. This is not guaranteed to have been retrieved until the %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is %NULL. Provider-specific information used to identify this account. Use g_variant_get_type() to check that the type is what you expect. For instance, if you use a #TpAccount:storage-provider with numeric identifiers for accounts, this variant might have type %G_VARIANT_TYPE_UINT32; if the storage provider has string-based identifiers, it should have type %G_VARIANT_TYPE_STRING. This property cannot change once an Account has been created. This is not guaranteed to have been retrieved until the %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is %NULL. The storage provider for this account. The name of the account storage implementation. When this is the empty string the account is internally stored. This property cannot change once an Account has been created. This is not guaranteed to have been retrieved until the %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is %NULL. The storage restrictions for this account. A bitfield of #TpStorageRestrictionFlags that give the limitations of this account imposed by the storage provider. This value will be 0 if #TpAccount:storage-provider is an empty string. This property cannot change once an Account has been created. This is not guaranteed to have been retrieved until the %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, the value is 0. The object paths of previously-active accounts superseded by this one. For instance, this can be used in a logger to read old logs for an account that has been migrated from one connection manager to another. This is not guaranteed to have been retrieved until the %TP_ACCOUNT_FEATURE_CORE feature has been prepared; until then, the value is NULL. If the %TP_ACCOUNT_FEATURE_ADDRESSING feature has been prepared successfully, a list of additional URI schemes for which this account should be used if possible. Otherwise %NULL. For instance, a SIP or Skype account might have "tel" in this list if the user would like to use that account to call phone numbers. This list should not contain the primary URI scheme(s) for the account's protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), since it should be assumed to be useful for those schemes in any case. The notify::uri-schemes signal cannot be relied on if the Account Manager is Mission Control version 5.14.0 or older. Whether this account is valid. One can receive change notifications on this property by connecting to the #GObject::notify signal and using this property as the signal detail. This is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value is %FALSE. Emitted when the avatar changes. Call tp_account_get_avatar_async() to get the new avatar data. Emitted when the presence of the account changes. the new presence the new presence status the new presence status message Emitted when the connection status on the account changes. The @dbus_error_name and @details parameters were present, but non-functional (always %NULL), in older versions. They have been available with their current behaviour since version 0.11.7. old #TpAccount:connection-status new #TpAccount:connection-status the #TpAccount:connection-status-reason the #TpAccount:connection-error the #TpAccount:connection-error-details Data structure representing a #TpAccountChannelRequest object. Convenience function to create a new #TpAccountChannelRequest object. a new #TpAccountChannelRequest object a #TpAccount the requested properties of the channel (see #TpAccountChannelRequest:request) the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object which will yield a Call channel, initially carrying audio only. After creating the request, you will usually also need to set the "target" of the channel by calling one of the following functions: - tp_account_channel_request_set_target_contact() - tp_account_channel_request_set_target_id() To call a contact, either use tp_account_channel_request_set_target_contact() or one of the generic methods that takes a handle type argument. To check whether this is possible, use tp_capabilities_supports_audio_call() with @handle_type set to %TP_HANDLE_TYPE_CONTACT. <!-- reinstate this when we have CMs that actually allow it: In some protocols it is possible to create a conference call which takes place in a named chatroom, by calling tp_account_channel_request_set_target_id() with @handle_type set to %TP_HANDLE_TYPE_ROOM. To test whether this is possible, use tp_capabilities_supports_audio_call() with @handle_type set to %TP_HANDLE_TYPE_ROOM. --> In some protocols, it is possible to create a Call channel without setting a target at all, which will result in a new, empty conference call. To test whether this is possible, use tp_capabilities_supports_audio_call() with @handle_type set to %TP_HANDLE_TYPE_NONE. a new #TpAccountChannelRequest object a #TpAccount the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object which will yield a Call channel, initially carrying both audio and video. This is the same as tp_account_channel_request_new_audio_call(), except that the channel will initially carry video as well as audio, and instead of using tp_capabilities_supports_audio_call() you should test capabilities with tp_capabilities_supports_audio_video_call(). See the documentation of tp_account_channel_request_new_audio_call() for details of how to set the target (contact, chatroom etc.) for the call. a new #TpAccountChannelRequest object a #TpAccount the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object, which will yield a DBusTube channel. After creating the request, you will also need to set the "target" of the channel by calling one of the following functions: - tp_account_channel_request_set_target_contact() - tp_account_channel_request_set_target_id() a new #TpAccountChannelRequest object a #TpAccount the service name that will be used over the tube. It should be the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object, which will yield a FileTransfer channel to send a file to a contact. After creating the request, you will also need to set the "target" of the channel by calling one of the following functions: - tp_account_channel_request_set_target_contact() - tp_account_channel_request_set_target_id() a new #TpAccountChannelRequest object a #TpAccount a suggested name for the file, which should not contain directories or directory separators (for example, if you are sending a file called /home/user/monkey.pdf, set this to monkey.pdf) the MIME type (content-type) of the file; a %NULL value is allowed, and is treated as "application/octet-stream" the file's size in bytes the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object, which will yield a StreamTube channel. After creating the request, you will also need to set the "target" of the channel by calling one of the following functions: - tp_account_channel_request_set_target_contact() - tp_account_channel_request_set_target_id() a new #TpAccountChannelRequest object a #TpAccount the service name that will be used over the tube. It should be a well-known TCP service name as defined by http://www.iana.org/assignments/port-numbers or http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap". the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object which will yield a Text channel. After creating the request, you will also need to set the "target" of the channel by calling one of the following functions: - tp_account_channel_request_set_target_contact() - tp_account_channel_request_set_target_id() a new #TpAccountChannelRequest object a #TpAccount the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Convenience function to create a new #TpAccountChannelRequest object. If @request is a floating reference, this function will take ownership of it, much like g_variant_ref_sink(). See documentation of that function for details. a new #TpAccountChannelRequest object a #TpAccount the requested properties of the channel (see #TpAccountChannelRequest:request) as a %G_VARIANT_TYPE_VARDICT the time of the user action that caused this request, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time) Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request that you are going to handle yourself. When the operation is finished, @callback will be called. You can then call tp_account_channel_request_create_and_handle_channel_finish() to get the result of the operation. (Behind the scenes, this works by creating a temporary #TpBaseClient, then acting like tp_account_channel_request_create_channel_async() with the temporary #TpBaseClient as the @preferred_handler.) The caller is responsible for closing the channel with tp_cli_channel_call_close() when it has finished handling it. a #TpAccountChannelRequest optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_create_and_handle_channel_async(). See tp_account_channel_request_ensure_and_handle_channel_finish() for details of how @context can be used. The caller is responsible for closing the channel with tp_cli_channel_call_close() when it has finished handling it. a new reference on a #TpChannel if the channel was successfully created and you are handling it, otherwise %NULL. a #TpAccountChannelRequest a #GAsyncResult pointer used to return a reference to the context of the HandleChannels() call, or %NULL Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request and let the ChannelDispatcher dispatch it to an handler. @callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation and a #TpChannel representing the channel which has been created. Note that you are <emphasis>not</emphasis> handling this channel and so should interact with the channel as an Observer. See <ulink url="http://telepathy.freedesktop.org/doc/book/sect.channel-dispatcher.clients.html"> the Telepathy book</ulink> for details about how clients should interact with channels. a #TpAccountChannelRequest Either the well-known bus name (starting with %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or %NULL to indicate that any handler would be acceptable. optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_create_and_observe_channel_async(). a newly created #TpChannel if the channel was successfully created and dispatched, otherwise %NULL. a #TpAccountChannelRequest a #GAsyncResult Asynchronously calls CreateChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request and let the ChannelDispatcher dispatch it to an handler. @callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation. a #TpAccountChannelRequest Either the well-known bus name (starting with %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or %NULL to indicate that any handler would be acceptable. optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_create_channel_async(). %TRUE if the channel was successfully created and dispatched, otherwise %FALSE. a #TpAccountChannelRequest a #GAsyncResult Return the #TpAccountChannelRequest:request-vardict construct-only property. the value of #TpAccountChannelRequest:request-vardict a #TpAccountChannelRequest Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request that you are going to handle yourself. When the operation is finished, @callback will be called. You can then call tp_account_channel_request_ensure_and_handle_channel_finish() to get the result of the operation. If the channel already exists and is already being handled, or if a newly created channel is sent to a different handler, this operation will fail with the error %TP_ERROR_NOT_YOURS. The other handler will be notified that the channel was requested again (for instance with #TpAccountChannelRequest::re-handled, #TpBaseClientClassHandleChannelsImpl or #TpSimpleHandler:callback), and can move its window to the foreground, if applicable. (Behind the scenes, this works by creating a temporary #TpBaseClient, then acting like tp_account_channel_request_ensure_channel_async() with the temporary #TpBaseClient as the @preferred_handler.) a #TpAccountChannelRequest optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_ensure_and_handle_channel_async(). If the channel already exists and is already being handled, or if a newly created channel is sent to a different handler, this operation will fail with the error %TP_ERROR_NOT_YOURS. @context can be used to obtain extensible information about the channel via tp_handle_channels_context_get_handler_info(), and any similar methods that are added in future. It is not valid for the caller of this method to call tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail(). a new reference on a #TpChannel if the channel was successfully created and you are handling it, otherwise %NULL. a #TpAccountChannelRequest a #GAsyncResult pointer used to return a reference to the context of the HandleChannels() call, or %NULL Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request and let the ChannelDispatcher dispatch it to an handler. @callback will be called when the channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_create_channel_finish() to get the result of the operation and a #TpChannel representing the channel which has been created. Note that you are <emphasis>not</emphasis> handling this channel and so should interact with the channel as an Observer. See <ulink url="http://telepathy.freedesktop.org/doc/book/sect.channel-dispatcher.clients.html"> the Telepathy book</ulink> for details about how clients should interact with channels. If a suitable channel already existed, its handler will be notified that the channel was requested again (for instance with #TpAccountChannelRequest::re-handled, #TpBaseClientClassHandleChannelsImpl or #TpSimpleHandler:callback, if it is implemented using Telepathy-GLib), so that it can re-present the window to the user, for example. Otherwise, a new channel will be created and dispatched to a handler. a #TpAccountChannelRequest Either the well-known bus name (starting with %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or %NULL to indicate that any handler would be acceptable. optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_create_and_observe_channel_async(). a newly created #TpChannel if the channel was successfully ensure and (re-)dispatched, otherwise %NULL. a #TpAccountChannelRequest a #GAsyncResult Asynchronously calls EnsureChannel on the ChannelDispatcher to create a channel with the properties defined in #TpAccountChannelRequest:request and let the ChannelDispatcher dispatch it to an handler. If a suitable channel already existed, its handler will be notified that the channel was requested again (for instance with #TpAccountChannelRequest::re-handled, #TpBaseClientClassHandleChannelsImpl or #TpSimpleHandler:callback, if it is implemented using Telepathy-GLib), so that it can re-present the window to the user, for example. Otherwise, a new channel will be created and dispatched to a handler. @callback will be called when an existing channel's handler has been notified, a new channel has been created and dispatched, or the request has failed. You can then call tp_account_channel_request_ensure_channel_finish() to get the result of the operation. a #TpAccountChannelRequest Either the well-known bus name (starting with %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, or %NULL to indicate that any handler would be acceptable. optional #GCancellable object, %NULL to ignore a callback to call when the request is satisfied data to pass to @callback Finishes an async channel creation started using tp_account_channel_request_ensure_channel_async(). %TRUE if the channel was successfully ensured and (re-)dispatched, otherwise %FALSE. a #TpAccountChannelRequest a #GAsyncResult Return the #TpAccountChannelRequest:account construct-only property the value of #TpAccountChannelRequest:account a #TpAccountChannelRequest Return the #TpAccountChannelRequest:channel-request property the value of #TpAccountChannelRequest:channel-request a #TpAccountChannelRequest Return the #TpAccountChannelRequest:request construct-only property the value of #TpAccountChannelRequest:request a #TpAccountChannelRequest Return the #TpAccountChannelRequest:user-action-time construct-only property the value of #TpAccountChannelRequest:user-action-time a #TpAccountChannelRequest Set @factory as the #TpClientChannelFactory that will be used to create the channel requested by @self. By default #TpAutomaticProxyFactory is used. This function can't be called once @self has been used to request a channel. since 0.15.5. The factory is taken from #TpAccountChannelRequest:account. a #TpAccountChannelRequest a #TpClientChannelFactory Indicate that the channel which is going to be requested using @self is an upgrade of the channels whose object paths is listed in @channels. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a #NULL-terminated array of channel paths If @delegate is %TRUE, asks to the client currently handling the channels to delegate them to the preferred handler (passed when calling tp_account_channel_request_ensure_channel_async() for example). This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest %TRUE to request to delegate channels Turn on support for the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler hint. When receiving a request containing this hint, @self will automatically delegate the channel to the preferred handler of the request and then call @callback to inform the client that it is no longer handling this channel. @callback may be called any time after (and only after) requesting and handling the channel (i.e. you have called create_and_handle or ensure_and_handle). This function can't be called once @self has been used to request a channel. See also: tp_base_client_set_delegated_channels_callback() a #TpAccountChannelRequest function called the channel requested using @self is delegated, may not be %NULL arbitrary user-supplied data passed to @callback called with the @user_data as argument, when @self is destroyed Configure this channel request to provide the recipient of the file with the given description. If file descriptions are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_description() to determine whether outgoing file transfers can have a description. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a description of the file Configure this channel request to accompany the file transfer with the hash of the file. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a type of @hash hash of the contents of the file transfer Configure this channel request to inform the recipient of the file that this channel will not send the first @offset bytes of the file. In some protocols, this can be used to resume an interrupted transfer. If this method is not called, the default is to start from the beginning of the file (equivalent to @offset = 0). If offsets greater than 0 are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_initial_offset() to determine whether offsets greater than 0 are available. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the offset into the file at which the transfer will start Configure this channel request to accompany the file transfer with the given modification timestamp for the file. If file timestamps are not supported by the protocol, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_date() to determine whether outgoing file transfers can have a timestamp. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the modification timestamp of the file, in seconds since the Unix epoch (the beginning of 1970 in the UTC time zone), as returned by g_date_time_to_unix() Configure this channel request to provide other local Telepathy components with the URI of the file being sent. Unlike most properties on a file transfer channel, this information is not sent to the recipient of the file; instead, it is signalled on D-Bus for use by other Telepathy components. The URI should usually be a <code>file</code> URI as defined by <ulink url="http://www.apps.ietf.org/rfc/rfc1738.html#sec-3.10">RFC 1738 §3.10</ulink> (for instance, <code>file:///path/to/file</code> or <code>file://localhost/path/to/file</code>). If a remote resource is being transferred to a contact, it may have a different scheme, such as <code>http</code>. Even if this method is used, the connection manager will not read the file from disk: the handler for the channel is still responsible for streaming the file. However, providing the URI allows a local logger to log which file was transferred, for instance. If this functionality is not supported by the connection manager, or if this method is used on a request that is not actually a file transfer, the channel request will fail. Use tp_capabilities_supports_file_transfer_uri() to determine whether outgoing file transfers can have a URI. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the source URI for the file Set additional information about the channel request, which will be used in the resulting request's #TpChannelRequest:hints property. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the key used for the hint a variant containting the hint value Set additional information about the channel request, which will be used as the value for the resulting request's #TpChannelRequest:hints property. This function can't be called once @self has been used to request a channel. In high-level language bindings, use tp_account_channel_request_set_hint() instead. a #TpAccountChannelRequest a #TP_HASH_TYPE_STRING_VARIANT_MAP Indicate that the contacts listed in @ids have to be invited to the conference represented by the channel which is going to be requested using @self. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a #NULL-terminated array of contact ids Indicate that the contacts listed in @contacts have to be invited to the conference represented by the channel which is going to be requested using @self. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a #GPtrArray of #TpContact Configure this channel request to include the given property, as documented in the Telepathy D-Bus API Specification or an implementation-specific extension. Using this method is not recommended, but it can be necessary for experimental or implementation-specific interfaces. If the property is not supported by the protocol or channel type, the channel request will fail. Use #TpCapabilities and the Telepathy D-Bus API Specification to determine which properties are available. If @value is a floating reference, this method takes ownership of it by using g_variant_ref_sink(). This allows convenient inline use of #GVariant constructors: |[ tp_account_channel_request_set_request_property (acr, "com.example.Int", g_variant_new_int32 (17)); tp_account_channel_request_set_request_property (acr, "com.example.String", g_variant_new_string ("ferret")); ]| It is an error to provide a @value which contains types not supported by D-Bus. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest a D-Bus property name an arbitrary value for the property If @is_sms_channel is set to #TRUE, messages sent and received on the requested channel will be transmitted via SMS. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest #TRUE if the channel should use SMS Configure this request to create a peer-to-peer channel with @contact as the other peer. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the contact to be contacted Configure this request to create a channel with @identifier, an identifier of type @handle_type. This function can't be called once @self has been used to request a channel. a #TpAccountChannelRequest the type of @identifier, typically %TP_HANDLE_TYPE_CONTACT or %TP_HANDLE_TYPE_ROOM the unique identifier of the contact, room etc. to be contacted The #TpAccount used to request the channel. Read-only except during construction. This property can't be %NULL. The #TpChannelRequest used to request the channel, or %NULL if the channel has not be requested yet. This can be useful for example to compare with the #TpChannelRequest objects received from the requests_satisfied argument of #TpSimpleHandlerHandleChannelsImpl to check if the client is asked to handle the channel it just requested. Note that the #TpChannelRequest objects may be different while still representing the same ChannelRequest on D-Bus. You have to compare them using their object paths (tp_proxy_get_object_path()). Since 0.13.13 The desired D-Bus properties for the channel, represented as a #GHashTable where the keys are strings and the values are #GValue. When constructing a new object, one of #TpAccountChannelRequest:request or #TpAccountChannelRequest:request-vardict must be set to a non-%NULL value, and the other must remain unspecified. The desired D-Bus properties for the channel. When constructing a new object, one of #TpAccountChannelRequest:request or #TpAccountChannelRequest:request-vardict must be set to a non-%NULL value, and the other must remain unspecified. The user action time that will be passed to the channel dispatcher when requesting the channel. This may be the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME. If %TP_USER_ACTION_TIME_NOT_USER_ACTION, the action doesn't involve any user action. Clients should avoid stealing focus when presenting the channel. If %TP_USER_ACTION_TIME_CURRENT_TIME, clients SHOULD behave as though the user action happened at the current time, e.g. a client may request that its window gains focus. On X11-based systems, GDK 2, GDK 3, Clutter 1.0 etc., tp_user_action_time_from_x11() can be used to convert an X11 timestamp to a Telepathy user action time. If the channel request succeeds, this user action time will be passed on to the channel's handler. If the handler is a GUI, it may use tp_user_action_time_should_present() to decide whether to bring its window to the foreground. Emitted when the channel created using @self has been "re-handled". This means that a Telepathy client has made another request for a matching channel using an "ensure" API like tp_account_channel_request_ensure_channel_async(), while the channel still exists. Instead of creating a new channel, the channel dispatcher notifies the existing handler of @channel, resulting in this signal. Most GUI handlers should respond to this signal by checking @user_action_time, and if appropriate, moving to the foreground. @context can be used to obtain extensible information about the channel via tp_handle_channels_context_get_handler_info(), and any similar methods that are added in future. It is not valid for the receiver of this signal to call tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail(). the #TpChannel being re-handled the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME; see #TpAccountChannelRequest:user-action-time a #TpHandleChannelsContext representing the context of the HandleChannels() call. The class of a #TpAccountChannelRequest. Called when a client asked us to delegate @channel to another Handler. When this function is called you are no longer handling @channel. a #TpAccountChannelRequest instance a #TpChannel arbitrary user-supplied data passed to tp_account_channel_request_set_delegated_channel_callback() The class of a #TpAccount. The Telepathy Account Manager stores real-time communication accounts and their configuration, places accounts online on request, and manipulates accounts' presence, nicknames and avatars. #TpAccountManager is the "top level" object. Since 0.16 it always has a non-%NULL #TpProxy:factory, and its #TpProxy:factory will be propagated to all other objects like #TpAccountManager -> #TpAccount -> #TpConnection -> #TpContact and #TpChannel. This means that desired features set on that factory will be prepared on all those objects. If a #TpProxy:factory is not specified when the #TpAccountManager is constructed, it will use a #TpAutomaticClientFactory. <example id="account-manager"><title>TpAccountManager example</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../examples/client/contact-list.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example> Convenience function to create a new account manager proxy. The returned #TpAccountManager is not guaranteed to be prepared on return. Its #TpProxy:factory will be a new #TpAutomaticClientFactory for @bus_daemon. Use tp_account_manager_dup() instead if you want an account manager proxy on the starter or session bus (which is almost always the right thing for Telepathy). a new reference to an account manager proxy Proxy for the D-Bus daemon Convenience function to create a new account manager proxy. The returned #TpAccountManager is not guaranteed to be ready on return. Should be used only by applications having their own #TpSimpleClientFactory subclass. Usually this should be done at application startup and followed by a call to tp_account_manager_set_default() to ensure other libraries/plugins will use this custom factory as well. a new reference to an account manager proxy a #TpSimpleClientFactory Check if tp_account_manager_set_default() has already successfully been called. %TRUE if tp_account_manager_set_default() has already successfully been called in this process, %FALSE otherwise. Returns an account manager proxy on the D-Bus daemon on which this process was activated (if it was launched by D-Bus service activation), or the session bus (otherwise). This account manager will always have the result of tp_dbus_daemon_dup() as its #TpProxy:dbus-daemon. The returned #TpAccountManager is cached; the same #TpAccountManager object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned #TpAccountManager is not guaranteed to be ready on return. If tp_account_manager_set_default() has been called successfully, that #TpAccountManager will be returned. Otherwise, a new #TpAccountManager will be created the first time this function is called, using a new #TpAutomaticClientFactory as its #TpProxy:factory. an account manager proxy on the starter or session bus, or %NULL if it wasn't possible to get a dbus daemon proxy for the appropriate bus <!-- --> the quark used for representing the core feature of a #TpAccountManager Ensure that the known interfaces for TpAccountManager have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_ACCOUNT_MANAGER. Requests an asynchronous create of an account on the account manager @manager. When the operation is finished, @callback will be called. You can then call tp_account_manager_create_account_finish() to get the result of the operation. The #TpAccount returned by tp_account_manager_create_account_finish() will already have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's #TpProxy:factory. It is usually better to use #TpAccountRequest instead, particularly when using high-level language bindings. a #TpAccountManager the name of a connection manager the name of a protocol the display name for the account parameters for the new account properties for the new account a callback to call when the request is satisfied data to pass to @callback Finishes an async create account operation, and returns a new #TpAccount object. It has %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's #TpProxy:factory. The caller must keep a ref to the returned object using g_object_ref() if it is to be kept beyond the lifetime of @result. a new #TpAccount which was just created on success, otherwise %NULL a #TpAccountManager a #GAsyncResult Returns a newly allocated #GList of reffed valid accounts in @manager. The list must be freed with g_list_free_full() and g_object_unref() after used. The returned #TpAccount<!-- -->s are guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's #TpProxy:factory. The list of valid accounts returned is not guaranteed to have been retrieved until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (tp_proxy_prepare_async() has returned). Until this feature has been prepared, an empty list (%NULL) will be returned. a newly allocated #GList of reffed valid accounts in @manager a #TpAccountManager Enable autostarting the account manager D-Bus service. This means that the account manager will be restarted if it disappears from the bus. a #TpAccountManager Lookup an account in the account manager @manager. If the desired account has already been ensured then the same object will be returned, otherwise it will create a new #TpAccount and add it to @manager. As a result, if @manager thinks that the account doesn't exist, this will still add it to @manager to avoid races. The account will be constructed via this account manager's #TpProxy:factory (so it will be of an appropriate #TpAccount subclass if the factory returns one), but does not necessarily have any features prepared yet. Use tp_proxy_prepare_async() to prepare features, using the contents of tp_simple_client_factory_dup_account_features() as a parameter if you want to prepare the same features that would normally be used. The caller must keep a ref to the returned object using g_object_ref() if it is to be kept. New code should call tp_simple_client_factory_ensure_account() on this object's #TpProxy:factory instead, which ensures that a new reference is returned. a new #TpAccount at @path, or %NULL if @path is not a valid account path. a #TpAccountManager the object path for an account Gets the most available presence over all accounts in @manager. This function does not average presences across all accounts, but it merely finds the "most available" presence. As a result, there is a guarantee that there exists at least one account in @manager with the returned presence. If no accounts are enabled or valid the output will be (%TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", ""). Since 0.17.5, if the only connected accounts does not implement %TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, the output will be (%TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, "available", ""). The return value of this function is not guaranteed to have been retrieved until tp_proxy_prepare_async() has finished; until then, the value will be the same as if no accounts are enabled or valid. the most available presence across all accounts a #TpAccountManager a string to fill with the actual status a string to fill with the actual status message Returns a newly allocated #GList of valid accounts in @manager. The list must be freed with g_list_free() after used. None of the accounts in the returned list are guaranteed to be ready. Note that the #TpAccount<!-- -->s in the returned #GList are not reffed before returning from this function. One could ref every item in the list like the following example: |[ GList *accounts; account = tp_account_manager_get_valid_accounts (manager); g_list_foreach (accounts, (GFunc) g_object_ref, NULL); ]| The returned #TpAccount<!-- -->s are guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all features previously passed to tp_simple_client_factory_add_account_features() for the account manager's #TpProxy:factory. The list of valid accounts returned is not guaranteed to have been retrieved until %TP_ACCOUNT_MANAGER_FEATURE_CORE is prepared (tp_proxy_prepare_async() has returned). Until this feature has been prepared, an empty list (%NULL) will be returned. Since 0.19.9. New code should use tp_account_manager_dup_valid_accounts() instead. a newly allocated #GList of valid accounts in @manager a #TpAccountManager <!-- --> since 0.23.0, use tp_proxy_is_prepared() instead. the same thing as tp_proxy_is_prepared() a #TpAccountManager a feature which is required Requests an asynchronous preparation of @manager with %TP_ACCOUNT_MANAGER_FEATURE_CORE, plus any features specified by @features. When the operation is finished, @callback will be called. You can then call tp_account_manager_prepare_finish() to get the result of the operation. If %NULL is given to @callback, then no callback will be called when the operation is finished. Instead, it will simply set @features on @manager. Note that if @callback is %NULL, then @user_data must also be %NULL. In version 0.11.3 or later, this is equivalent to calling tp_proxy_prepare_async() with the same arguments. since 0.15.6, use tp_proxy_prepare_async() instead. a #TpAccountManager a 0-terminated list of features, or %NULL a callback to call when the request is satisfied data to pass to @callback Finishes an async preparation of the account manager @manager. since 0.15.6, use tp_proxy_prepare_finish() instead. %TRUE if the preparation was successful, otherwise %FALSE a #TpAccountManager a #GAsyncResult Iterates through the accounts in @manager and requests the presence (@type, @status and @message). Note that the presence requested here is merely a request, and if might not be satisfiable. You can find the most available presence across all accounts by calling tp_account_manager_get_most_available_presence(). Setting a requested presence on all accounts will have no effect until tp_proxy_prepare_async() (or the older tp_account_manager_prepare_async()) has finished. a #TpAccountManager a presence type to request a status to request a status message to request Define the #TpAccountManager singleton that will be returned by tp_account_manager_dup(). This function may only be called before the first call to tp_account_manager_dup(), and may not be called more than once. Applications which use a custom #TpSimpleClientFactory and want the default #TpAccountManager to use that factory should call this after calling tp_account_manager_new_with_factory(). Unlike tp_account_manager_dup(), this function will keep an internal reference to @manager, so it will never be destroyed. Note that @manager must use the default #TpDBusDaemon as returned by tp_dbus_daemon_dup() a #TpAccountManager Emitted when an account from @manager is disabled. a #TpAccount Emitted when an account from @manager is enabled. @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to the #TpProxy:factory<!-- -->'s tp_simple_client_factory_add_account_features(). a #TpAccount Emitted when an account is removed from @manager. a #TpAccount Emitted when the validity on @account changes. This signal is also used to indicate a new account that did not previously exist has been added (with @valid set to %TRUE). If @valid is %TRUE, @account is guaranteed to have %TP_ACCOUNT_FEATURE_CORE prepared, along with all the features previously passed to the #TpProxy:factory<!-- -->'s tp_simple_client_factory_add_account_features(). a #TpAccount %TRUE if the account is now valid Emitted when the most available presence on @manager changes. new presence type new status new status message The class of a #TpAccount. An object for representing a currently non-existent account which is to be created on a #TpAccountManager. Convenience function to create a new account request object which will assist in the creation of a new account on @account_manager, using connection manager @manager, and protocol @protocol. a new reference to an account request object, or %NULL if any argument is incorrect the #TpAccountManager to create the account on the name of the connection manager the name of the protocol on @manager the user-visible name of this account Convenience function to create a new #TpAccountRequest object using a #TpProtocol instance, instead of specifying connection manager and protocol name specifically. See tp_account_request_new() for more details. a new reference to an account request object, or %NULL if any argument is incorrect the #TpAccountManager to create the account on a #TpProtocol the user-visible name of this account Add an account object path to the list of superseded accounts which this new account will supersede. Use the #TpAccountRequest:supersedes property to read the current list of superseded accounts. a #TpAccountRequest an account object path to add to the supersedes list Start an asynchronous operation to create the account @self on the account manager. @callback will only be called when the newly created #TpAccount has the %TP_ACCOUNT_FEATURE_CORE feature ready on it, so when calling tp_account_request_create_account_finish(), one can guarantee this feature. a #TpAccountRequest a function to call when the account has been created user data to @callback Finishes an asynchronous account creation operation and returns a new ref to a #TpAccount object. The returned account will have the features listed in tp_simple_client_factory_dup_account_features() (with the proxy factory from #TpAccountRequest:account-manager) prepared on it. a new ref to a #TpAccount, or %NULL a #TpAccountRequest a #GAsyncResult Set the automatic presence for the new account, @self, to the type (@presence, @status), with message @message. Use the #TpAccountRequest:automatic-presence-type, #TpAccountRequest:automatic-status, and #TpAccountRequest:automatic-status-message properties to read the current automatic presence. a #TpAccountRequest the automatic presence type the automatic presence status the automatic presence message Set the avatar of the account @self to @avatar. Use the #TpAccountRequest:avatar and #TpAccountRequest:avatar-mime-type properties to read the current avatar. a #TpAccountRequest a new avatar to set; can be %NULL only if %len equals 0 the length of the new avatar the MIME type of the new avatar; can be %NULL only if @len equals 0 Set the connect automatically property of the account on creation to @connect_automatically so that the account is brought online to the automatic presence. Use the #TpAccountRequest:connect-automatically property to read the current connect automatically value. a #TpAccountRequest %TRUE if the account is to connect automatically Set the display name for the new account, @self, to @name. Use the #TpAccountRequest:display-name property to read the current display name. a #TpAccountRequest a display name for the account Set the enabled property of the account on creation to @enabled. Use the #TpAccountRequest:enabled property to read the current enabled value. a #TpAccountRequest %TRUE if the account is to be enabled Set the icon name for the new account, @self, to @icon. Use the #TpAccountRequest:icon-name property to read the current icon name. a #TpAccountRequest an icon name for the account Set the nickname for the new account, @self, to @nickname. Use the #TpAccountRequest:nickname property to read the current nickname. a #TpAccountRequest a nickname for the account Set an account parameter, @key, to @value. Use the #TpAccountRequest:parameters property to read the current list of set parameters. Parameters can be unset using tp_account_request_unset_parameter(). a #TpAccountRequest the parameter key a variant containing the parameter value Convenience function to set an account parameter string value. See tp_account_request_set_parameter() for more details. a #TpAccountRequest the parameter key the parameter value Set the requested presence for the new account, @self, to the type (@presence, @status), with message @message. Use the #TpAccountRequest:requested-presence-type, #TpAccountRequest:requested-status, and #TpAccountRequest:requested-status-message properties to read the current requested presence. a #TpAccountRequest the requested presence type the requested presence status the requested presence message Set the service property of the account to @service. Use the #TpAccountRequest:service property to read the current value. a #TpAccountRequest the service name for Set the account storage to use when creating the account. Use the #TpAccountRequest:storage-provider property to read the current value. a #TpAccountRequest the name of an account storage implementation Unset the account parameter @key which has previously been set using tp_account_request_set_parameter() or another convenience function. a #TpAccountRequest the parameter key The #TpAccountManager to create the account on. The account's automatic presence type (a #TpConnectionPresenceType). To change this property use tp_account_request_set_automatic_presence(). When the account is put online automatically, for instance to make a channel request or because network connectivity becomes available, the automatic presence type, status and message will be copied to their "requested" counterparts. The string status name to use in conjunction with the #TpAccountRequest:automatic-presence-type. To change this property use tp_account_request_set_automatic_presence(). The user-defined message to use in conjunction with the #TpAccount:automatic-presence-type. To change this property use tp_account_request_set_automatic_presence(). The avatar set on the account. The avatar's mime type can be read in the #TpAccountRequest:avatar-mime-type property. To change this property, use tp_account_request_set_avatar(). The mime type of the #TpAccountRequest:avatar property. To change this property, use tp_account_request_set_avatar(). Whether the account should connect automatically or not. To change this property, use tp_account_request_set_connect_automatically(). The account's connection manager name. The account's display name. To change this property use tp_account_request_set_display_name(). Whether the account is enabled or not. To change this property use tp_account_request_set_enabled(). The account's icon name. To change this propery, use tp_account_request_set_icon_name(). The account's nickname. To change this property use tp_account_request_set_nickname(). The account's connection parameters. To add a parameter, use tp_account_request_set_parameter() or another convience function. The account's properties. The account's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification. The account's requested presence type (a #TpConnectionPresenceType). To change this property use tp_account_request_set_requested_presence(). The requested Status string of the account. To change this property use tp_account_request_set_requested_presence(). The requested status message message of the account. To change this property use tp_account_request_set_requested_presence(). A string describing the service of the account, which must consist only of ASCII letters, numbers and hyphen/minus signs, and start with a letter (matching the requirements for Protocol). To change this property, use tp_account_request_set_service(). The account's storage provider. To change this property use tp_account_request_set_storage_provider(). The object paths of previously-active accounts superseded by this one. For instance, this can be used in a logger to read old logs for an account that has been migrated from one connection manager to another. To add to this property use tp_account_request_add_supersedes(). The class of a #TpAccountRequest. Data structure representing the context of a Approver.AddDispatchOperation() call. Called by #TpBaseClientClassAddDispatchOperationImpl when it's done so the D-Bus method can return. a #TpAddDispatchOperationContext Called by #TpBaseClientClassAddDispatchOperationImpl to indicate that it implements the method in an async way. The caller must take a reference to the #TpAddDispatchOperationContext before calling this function, and is responsible for calling either tp_add_dispatch_operation_context_accept() or tp_add_dispatch_operation_context_fail() later. a #TpAddDispatchOperationContext Called by #TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error. a #TpAddDispatchOperationContext the error to return from the method A #TpAccount object representing the Account of the DispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction. This property can't be %NULL. A #GPtrArray containing #TpChannel objects representing the channels that have been passed to AddDispatchOperation. Read-only except during construction. This property can't be %NULL. A #TpConnection object representing the Connection of the DispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction. This property can't be %NULL. The #DBusGMethodInvocation representing the D-Bus context of the AddDispatchOperation call. Can only be written during construction. A #TpChannelDispatchOperation object representing the ChannelDispatchOperation that has been passed to AddDispatchOperation. Read-only except during construction. This property can't be %NULL. The class of a #TpAddDispatchOperationContext. <![CDATA[ Flags for the various types of anonymity modes. These modes are solely to inform the CM of the desired anonymous settings. It is up to the CM to determine whether the anonymity modes should be handled within the CM itself, or whether the network that a CM might be talking to should be enforcing anonymity. CMs MAY support only a subset of these modes, and specific connections MAY support none at all. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Obscure any information that provides user identification, user-agent identification or personal details. Examples of this information might be GSM CallerID, SIP from address, various informational email headers, etc. The CM should scrub/replace any of this information before passing messages or data onto the network. Note that a CM which has the option of obscuring the information at the CM or privacy service level would choose both (anonymity services are opaque to clients of this interface). Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info. ]]> <![CDATA[ Explicitly request showing of client information. In connection context, this can be used to override service default. In channel context, this overrides connection anonymity modes. In GSM, it's possible to have CLIR enabled by default, and explicitly suppress CLIR for a single phone call. Clients SHOULD NOT set both Client_Info and Show_Client_Info modes. If they are set, the CM MUST respect Client_Info and ignore Show_Client_Info. The CM MAY set both Client_Info and Show_Client_Info in SupportedAnonymityModes to indicate its support for explicitly hiding and publicising client information. ]]> <![CDATA[ Obscure any originating IP address information, contact URIs, and anonymize all traffic involved with sending/receiving any media streams or call content. Examples of this include the "headers" portions of RFC 3323 as well as the History-Info (described in RFC 4244) for a SIP CM. This SHOULD have the effect of hiding address information from the remote contact (ie, the contact cannot know what IP address the session is originated from). Obviously the network still needs to be able to route information between contacts, so this provides no guarantees of what can be seen by intermediaries. ]]> Data structure representing a #TpAutomaticClientFactory Returns a new #TpAutomaticClientFactory instance. If @dbus is %NULL, tp_dbus_daemon_dup() will be used. a new #TpAutomaticClientFactory a #TpDBusDaemon, or %NULL The class of a #TpAutomaticClientFactory. the parent class Data structure representing a #TpAutomaticProxyFactory Convenient function to create a new #TpAutomaticProxyFactory instance. New code should use #TpAutomaticClientFactory instead a new #TpAutomaticProxyFactory Returns a cached #TpAutomaticProxyFactory; the same #TpAutomaticProxyFactory object will be returned by this function repeatedly, as long as at least one reference exists. New code should use #TpAutomaticClientFactory instead a #TpAutomaticProxyFactory The class of a #TpAutomaticProxyFactory. the parent class The requirements for setting an avatar on a particular protocol. An array of supported MIME types (e.g. "image/jpeg") Clients MAY assume that the first type in this array is preferred The minimum width in pixels of an avatar, which MAY be 0 The minimum height in pixels of an avatar, which MAY be 0 The recommended width in pixels of an avatar, or 0 if there is no preferred width. The recommended height in pixels of an avatar, or 0 if there is no preferred height The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit. The maximum height in pixels of an avatar, or 0 if there is no limit. he maximum size in bytes of an avatar, or 0 if there is no limit. <!--Returns: says it all--> a newly allocated #TpAvatarRequirements, free it with tp_avatar_requirements_destroy() An array of supported MIME types (e.g. "image/jpeg") Clients MAY assume that the first type in this array is preferred The minimum width in pixels of an avatar, which MAY be 0 The minimum height in pixels of an avatar, which MAY be 0 The recommended width in pixels of an avatar, or 0 if there is no preferred width. The recommended height in pixels of an avatar, or 0 if there is no preferred height The maximum width in pixels of an avatar on this protocol, or 0 if there is no limit. The maximum height in pixels of an avatar, or 0 if there is no limit. he maximum size in bytes of an avatar, or 0 if there is no limit. <!--Returns: says it all--> a newly allocated #TpAvatarRequirements, free it with tp_avatar_requirements_destroy() a #TpAvatarRequirements Free all memory used by the #TpAvatarRequirements. a #TpAvatarRequirements If @conn is not in state #TP_CONNECTION_STATUS_CONNECTED, complete the D-Bus method invocation @context by raising the Telepathy error #TP_ERROR_DISCONNECTED, and return from the current function (which must be void). For use in D-Bus method implementations. A TpBaseConnection A DBusGMethodInvocation Data structure representing a generic #TpSvcClient implementation. Called by subclasses to define the actual implementation of the AddDispatchOperation() D-Bus method. Since 0.11.13 this is exactly equivalent to setting the #TpBaseClientClass.add_dispatch_operation function pointer. the #TpBaseClientClass of the object the #TpBaseClientClassAddDispatchOperationImpl function implementing AddDispatchOperation() Called by subclasses to define the actual implementation of the HandleChannels() D-Bus method. Since 0.11.13 this is exactly equivalent to setting the #TpBaseClientClass.handle_channels function pointer. the #TpBaseClientClass of the object the #TpBaseClientClassHandleChannelsImpl function implementing HandleCHannels() Called by subclasses to define the actual implementation of the ObserveChannels() D-Bus method. Since 0.11.13 this is exactly equivalent to setting the #TpBaseClientClass.observe_channels function pointer. the #TpBaseClientClass of the object the #TpBaseClientClassObserveChannelsImpl function implementing ObserveChannels() a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #TpChannelDispatchOperation having %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible a #TpObserveChannelsContext representing the context of this D-Bus call a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #GList of #TpChannelRequest having their object-path defined but are not guaranteed to be prepared. the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time for details) a #TpHandleChannelsContext representing the context of this D-Bus call a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #TpChannelDispatchOperation or %NULL; the dispatch_operation is not guaranteed to be prepared a #GList of #TpChannelRequest having their object-path defined but are not guaranteed to be prepared. a #TpObserveChannelsContext representing the context of this D-Bus call Request that the given features are prepared on each #TpAccount (in addition to %TP_ACCOUNT_FEATURE_CORE) before calling #TpBaseClientClass.observe_channels, #TpBaseClientClass.add_dispatch_operation or #TpBaseClientClass.handle_channels, or emitting #TpBaseClient::request-added. New code should use tp_simple_client_factory_add_account_features() instead. a client the features the number of features, or -1 if @features is 0-terminated The same as tp_base_client_add_account_features(), but with a more convenient calling convention from C. New code should use tp_simple_client_factory_add_account_features_varargs() instead. a client the first feature the second and subsequent features, if any, ending with 0 Register a new channel class as Approver.ApproverChannelFilter. The #TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.add_dispatch_operation. a #TpBaseClient a %TP_HASH_TYPE_CHANNEL_CLASS Register a new channel class as Approver.ApproverChannelFilter. The #TpBaseClientClass.add_dispatch_operation virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.add_dispatch_operation. If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_vardict() for more details. a client a variant of type %G_VARIANT_TYPE_VARDICT Request that the given features are prepared on each #TpChannel (in addition to %TP_CHANNEL_FEATURE_CORE) before calling #TpBaseClientClass.observe_channels, #TpBaseClientClass.add_dispatch_operation or #TpBaseClientClass.handle_channels. New code should use tp_simple_client_factory_add_channel_features() instead. a client the features the number of features, or -1 if @features is 0-terminated The same as tp_base_client_add_channel_features(), but with a more convenient calling convention from C. New code should use tp_simple_client_factory_add_channel_features_varargs() instead. a client the first feature the second and subsequent features, if any, ending with 0 Request that the given features are prepared on each #TpConnection (in addition to %TP_CONNECTION_FEATURE_CORE) before calling #TpBaseClientClass.observe_channels, #TpBaseClientClass.add_dispatch_operation or #TpBaseClientClass.handle_channels. New code should use tp_simple_client_factory_add_connection_features() instead. a client the features the number of features, or -1 if @features is 0-terminated The same as tp_base_client_add_connection_features(), but with a more convenient calling convention from C. New code should use tp_simple_client_factory_add_connection_features_varargs() instead. a client the first feature the second and subsequent features, if any, ending with 0 Add several capability tokens to this client. These are used to signal that Telepathy connection managers should advertise certain capabilities to other contacts, such as the ability to receive audio/video calls using particular streaming protocols and codecs. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a client, which must not have been registered with tp_base_client_register() yet capability tokens as defined by the Telepathy D-Bus API Specification Convenience C API equivalent to calling tp_base_client_add_handler_capability() for each capability token. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a client, which must not have been registered with tp_base_client_register() yet a capability token from the Telepathy D-Bus API Specification more tokens, ending with %NULL Add one capability token to this client, as if via tp_base_client_add_handler_capabilities(). This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a client, which must not have been registered with tp_base_client_register() yet a capability token as defined by the Telepathy D-Bus API Specification Register a new channel class as Handler.HandlerChannelFilter. The #TpBaseClientClass.handle_channels virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a #TpBaseClient a %TP_HASH_TYPE_CHANNEL_CLASS Register a new channel class as Handler.HandlerChannelFilter. The #TpBaseClientClass.handle_channels virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. If the variant is floating (see g_variant_ref_sink()), ownership will be taken. See tp_base_client_add_observer_filter_vardict() for more details. a client a variant of type %G_VARIANT_TYPE_VARDICT Register a new channel class as Observer.ObserverChannelFilter. The #TpBaseClientClass.observe_channels virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.observe_channels. a #TpBaseClient a %TP_HASH_TYPE_CHANNEL_CLASS Register a new channel class as Observer.ObserverChannelFilter. The #TpBaseClientClass.observe_channels virtual method will be called whenever a new channel's properties match the ones in @filter. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.observe_channels. If the variant is floating (see g_variant_ref_sink()), ownership will be taken, allowing for uses like this: |[ tp_base_client_add_observer_filter_vardict (client, g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, ... }", TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT, ...)); ]| a client a variant of type %G_VARIANT_TYPE_VARDICT Register @self as a Client.Handler with an empty list of filters. This is useful if you want to create a client that only handle channels for which it's the PreferredHandler. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a #TpBaseClient Asynchronously calls DelegateChannels on the ChannelDispatcher to try stopping handling @channels and pass them to another Handler. You can then call tp_base_client_delegate_channels_finish() to get the result of the operation. a #TpBaseClient a #GList of #TpChannel handled by @self the time at which user action occurred, or #TP_USER_ACTION_TIME_NOT_USER_ACTION if this delegation request is for some reason not involving user action. Either the well-known bus name (starting with %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channels, or %NULL to indicate that any handler but @self would be acceptable. a callback to call when the request is satisfied data to pass to @callback Finishes an async channels delegation request started using tp_base_client_delegate_channels_async(). %TRUE if the operation succeed, @delegated and @not_delegated can be used to know the channels that @self is not handling any more, otherwise %FALSE. a #TpBaseClient a #GAsyncResult if not %NULL, used to return a #GPtrArray containing the #TpChannel<!-- -->s which have been properly delegated if not not %NULL, used to return a #GHashTable mapping #TpChannel<!-- -->s which have not been delegated to a #GError explaining the reason of the failure Returns the set of channels currently handled by this base client or by any other #TpBaseClient with which it shares a unique name. the handled channels a #TpBaseClient Only works if tp_base_client_set_handler_request_notification() has been called. Returns the list of requests @self is likely be asked to handle. a #GList of #TpChannelRequest a #TpBaseClient Return the #TpBaseClient:account-manager construct-only property, which is the account manager used to look up or create #TpAccount objects. The returned object's reference count is not incremented, so it is not necessarily valid after @self is destroyed. It is not guaranteed that any particular features are prepared on this object; enable and wait for features with tp_proxy_prepare_async(). New code should not use this function, it may return %NULL in the case @self was constructed with a #TpSimpleClientFactory. the value of #TpBaseClient:account-manager a #TpBaseClient Return the bus name of @self. Note that doesn't mean the client is actually owning this name; for example if tp_base_client_register() has not been called yet or failed. the bus name of the client a #TpBaseClient Return the #TpBaseClient:channel-factory property. since 0.15.5. The factory is taken from #TpBaseClient:account-manager. the value of #TpBaseClient:channel-factory a #TpBaseClient Return the #TpBaseClient:dbus-daemon construct-only property, which represents the D-Bus connection used to export this client object. The returned object's reference count is not incremented, so it is not necessarily valid after @self is destroyed. the value of #TpBaseClient:dbus-daemon a #TpBaseClient Returns the set of channels currently handled by this base client or by any other #TpBaseClient with which it shares a unique name. Since 0.19.9. New code should use tp_base_client_dup_handled_channels() instead. the handled channels a #TpBaseClient Return the #TpBaseClient:name construct-only property, which is used as part of the bus name and object path. the value of #TpBaseClient:name a #TpBaseClient Return the object path of @self. Note that doesn't mean the client is actually registered on this path; for example if tp_base_client_register() has not been called yet or failed. the object path of the client a #TpBaseClient Only works if tp_base_client_set_handler_request_notification() has been called. Returns the list of requests @self is likely be asked to handle. Since 0.19.9. New code should use tp_base_client_dup_pending_requests() instead. a #GList of #TpChannelRequest a #TpBaseClient Return the #TpBaseClient:uniquify-name construct-only property; if this is true, the bus name and object path will be made unique by appending a suffix that includes the D-Bus unique name and a per-process counter. the value of #TpBaseClient:uniquify-name a #TpBaseClient Check if @self is currently handling @channel. %TRUE if @self is handling @channel, %FALSE otherwise a #TpBaseClient a #TpChannel Publish @self as an available client. After this method is called, as long as it continues to exist, it will receive and process whatever events were requested via the various filters. Methods that set the filters and other immutable state, such as tp_base_client_add_observer_filter(), cannot be called after this one. %TRUE if the client was registered successfully a #TpBaseClient, which must not have been registered with tp_base_client_register() yet Change the value of the #TpBaseClient:channel-factory property. It can't be changed once @self has been registered. since 0.15.5. The factory is taken from #TpBaseClient:account-manager. a #TpBaseClient an object implementing the #TpClientChannelFactoryInterface interface Turn on support for the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler hint. When receiving a request containing this hint, @self will automatically delegate the channels to the preferred handler of the request and then call @callback to inform the client that it is no longer handling those channels. a #TpBaseClient implementing Handler function called when channels currently handled by @self are delegated, may not be %NULL arbitrary user-supplied data passed to @callback called with the @user_data as argument, when @self is destroyed Set whether the channels destined for this handler are automatically handled, without invoking approvers. (This is implemented by setting the value of its BypassApproval D-Bus property.) This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a #TpBaseClient the value of the Handler.BypassApproval property Indicate that @self is a Handler willing to be notified about requests for channels that it is likely to be asked to handle. This means that the #TpBaseClient::request-added and #TpBaseClient::request-removed signals will be fired and tp_base_client_get_pending_requests() will return the list of pending requests. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.handle_channels. a #TpBaseClient Set whether the channel dispatcher should wait for tp_observe_channels_context_accept() or tp_observe_channels_context_fail() to be called before calling #TpBaseClientClass.add_dispatch_operation on appropriate Approvers. This is implemented by setting the value of the DelayApprovers D-Bus property. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.observe_channels. a #TpBaseClient the value of the Observer.DelayApprovers property Set whether the channel dispatcher should attempt to recover this Observer if it crashes. (This is implemented by setting the value of its Recover D-Bus property.) Normally, Observers are only notified when new channels appear. If an Observer is set to recover, when it registers with tp_base_client_register(), it will also be told about any channels that already existed before it started. For Observers that are activatable as a D-Bus service, if the Observer exits or crashes while there are any channels that match its filter, it will automatically be restarted by service-activation. This method may only be called before tp_base_client_register() is called, and may only be called on objects whose class implements #TpBaseClientClass.observe_channels. a #TpBaseClient the value of the Observer.Recover property The same as tp_base_client_add_approver_filter(), but ownership of @filter is taken by @self. This makes it convenient to call using tp_asv_new(): |[ tp_base_client_take_approver_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, ...)); ]| a client a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self The same as tp_base_client_add_handler_filter(), but ownership of @filter is taken by @self. This makes it convenient to call using tp_asv_new(): |[ tp_base_client_take_handler_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, ...)); ]| a #TpBaseClient a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self The same as tp_base_client_add_observer_filter(), but ownership of @filter is taken by @self. This makes it convenient to call using tp_asv_new(): |[ tp_base_client_take_observer_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, ...)); ]| a client a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self Remove this client object from D-Bus, if tp_base_client_register() has already been called. If the object is not registered, this method may be called, but has no effect. Releasing the last reference to the object also has the same effect as calling this method, but this method should be preferred, as it has more deterministic behaviour. If the object still exists, tp_base_client_register() may be used to attempt to register it again. a client, which may already have been registered with tp_base_client_register(), or not Account manager for this base client, used to look up or create #TpAccount objects. This may be specified in the constructor in order to get existing #TpAccount objects. It is not guaranteed that any of its features have been prepared, and it is not necessary to wait for any features before specifying this property in the constructor. Clients that interact with the #TpAccount should usually set this property instead of #TpBaseClient:dbus-daemon. Doing this will ensure that each account, connection or contact is represented by a single #TpAccount, #TpConnection or #TpContact object, shared between all the cooperating modules that have the same #TpAccountManager. If the #TpBaseClient:dbus-daemon is set to the result of tp_dbus_daemon_dup(), then this property defaults to the result of tp_account_manager_dup(). This property may be %NULL initially, but will always be non-%NULL after the #TpBaseClient has been constructed. It is an error to specify both a non-%NULL account manager, and a non-%NULL #TpBaseClient:dbus-daemon that is not the same as the account manager's #TpProxy:dbus-daemon. New code should not use this property, it may be %NULL in the case @self was constructed with a #TpSimpleClientFactory. The object implementing the #TpClientChannelFactoryInterface interface that will be used to create channel proxies. While tp_base_client_register() has not yet been called, this property can be changed using tp_base_client_set_channel_factory(). If no channel factory is specified then #TpAutomaticProxyFactory is used. since 0.15.5. The factory is taken from #TpBaseClient:account-manager. #TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction. This property can't be %NULL after construction. Since 0.11.14 this property may be %NULL or unspecified in g_object_new(), but only if #TpBaseClient:account-manager is provided instead, in which case its #TpProxy:dbus-daemon property will be used. Factory for this base client, used to look up or create #TpAccount objects. The name of the client. This is used to register the D-Bus service name and object path of the service. This property can't be %NULL. If %TRUE, tp_base_client_register() will append an unique token to the service bus name and object path to ensure they are unique. Emitted when a channels have been requested, and that if the request is successful, they will probably be handled by this Handler. This signal is only fired if tp_base_client_set_handler_request_notification() has been called on @self previously. the #TpAccount on which the request was made, with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpChannelRequest having its object-path defined but is not guaranteed to be prepared. Emitted when a request has failed and should be disregarded. This signal is only fired if tp_base_client_set_handler_request_notification() has been called on @self previously. the #TpChannelRequest being removed the name of the D-Bus error with which the request failed. any message supplied with the D-Bus error. The class of a #TpBaseClient. The virtual methods @observe_channels, @add_dispatch_operation and @handle_channels can be also implemented by calling tp_base_client_implement_observe_channels(), tp_base_client_implement_add_dispatch_operation() and tp_base_client_implement_handle_channels(). This is compatible with telepathy-glib versions older than 0.11.13. the parent class the function called to observe newly-created channels matching this client's observer filter (since 0.11.13) the function called to request user approval of unrequested (incoming) channels matching this client's approver filter (since 0.11.13) the function called to handle channels matching this client's handler filter (since 0.11.13) Signature of the implementation of the AddDispatchOperation method. This function must call either tp_add_dispatch_operation_context_accept(), tp_add_dispatch_operation_context_delay() or tp_add_dispatch_operation_context_fail() on @context before it returns. The implementation can then use tp_channel_dispatch_operation_handle_with_async() to approve handling of the channels, or tp_channel_dispatch_operation_claim_async() to take responsibility for handling or closing them". a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #TpChannelDispatchOperation having %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible a #TpObserveChannelsContext representing the context of this D-Bus call Signature of the implementation of the HandleChannels method. This function must call either tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail() on @context before it returns. a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #GList of #TpChannelRequest having their object-path defined but are not guaranteed to be prepared. the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time for details) a #TpHandleChannelsContext representing the context of this D-Bus call Signature of the implementation of the ObserveChannels method. This function must call either tp_observe_channels_context_accept(), tp_observe_channels_context_delay() or tp_observe_channels_context_fail() on @context before it returns. a #TpBaseClient instance a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other features added via tp_base_client_add_account_features() or tp_simple_client_factory_add_account_features(), prepared if possible a #TpConnection with %TP_CONNECTION_FEATURE_CORE, and any other features added via tp_base_client_add_connection_features(), or tp_simple_client_factory_add_connection_features(), prepared if possible a #GList of #TpChannel, each with %TP_CHANNEL_FEATURE_CORE, and any other features added via tp_base_client_add_channel_features() or tp_simple_client_factory_add_channel_features(), prepared if possible a #TpChannelDispatchOperation or %NULL; the dispatch_operation is not guaranteed to be prepared a #GList of #TpChannelRequest having their object-path defined but are not guaranteed to be prepared. a #TpObserveChannelsContext representing the context of this D-Bus call Called when a client asked us to delegate @channels to another Handler. When this function is called @client is not longer handling @channels. a #TpBaseClient instance a #GPtrArray of #TpChannel arbitrary user-supplied data passed to tp_base_client_set_delegated_channels_callback() Data structure representing a generic #TpSvcConnection implementation. Since 0.19.1, accessing the fields of this structure is deprecated. Use tp_base_connection_get_bus_name(), tp_base_connection_get_object_path(), tp_base_connection_get_status(), tp_base_connection_get_self_handle() instead. Initializes an iterator over the #TpChannelManager objects known to @self. It is intended to be used as followed: <informalexample><programlisting> TpChannelManagerIter iter; TpChannelManager *manager; tp_base_connection_channel_manager_iter_init (&amp;iter, base_conn); while (tp_base_connection_channel_manager_iter_next (&amp;iter, &amp;manager)) { ...do something with manager... } </programlisting></informalexample> an uninitialized #TpChannelManagerIter a connection Advances @iter, and retrieves the #TpChannelManager it now points to. If there are no more channel managers, @manager_out is not set and %FALSE is returned. %FALSE if there are no more channel managers; else %TRUE. an initialized #TpChannelManagerIter a location to store the channel manager, or %NULL. Implements D-Bus method RequestHandles on interface org.freedesktop.Telepathy.Connection. This was exported so subclasses could use it as a basis for their reimplementations, but reimplementing the method is now deprecated. A pointer to #TpBaseConnection, cast to a pointer to #TpSvcConnection The handle type (#TpHandleType) as a guint A strv of handle names The dbus-glib method invocation context The connection object The connection object a GPtrArray of objects implementing #TpChannelFactoryIface which, between them, implement all channel types this Connection supports. The implementation, a subclass of TpBaseConnection a GPtrArray of objects implementing #TpChannelManager which, between them, implement all channel types this Connection supports. The implementation, a subclass of TpBaseConnection The connection object a #GPtrArray of static strings for D-Bus interfaces implemented by this client. a #TpBaseConnection a name for this connection which will be unique within this connection manager process, as a string which the caller must free with #g_free. The implementation, a subclass of TpBaseConnection The connection object %FALSE if failure has already occurred, else %TRUE. The connection object Add a "client interest" for @token on behalf of the given client. This emits #TpBaseConnection::clients-interested if this was the first time a client expressed an interest in this token. a #TpBaseConnection the unique bus name of a D-Bus client a D-Bus interface or a token representing part of an interface, added with tp_base_connection_add_possible_client_interest() only add to the interest count if the client is not already interested (appropriate for APIs that implicitly subscribe on first use if this has not been done already, like Location) Add some interfaces to the list supported by this Connection. If you're going to call this function at all, you must do so before moving to state CONNECTED (or DISCONNECTED); if you don't call it, only the set of interfaces always present (@get_interfaces_always_present in #TpBaseConnectionClass) will be supported. A TpBaseConnection in state #TP_INTERNAL_CONNECTION_STATUS_NEW or #TP_CONNECTION_STATUS_CONNECTING A %NULL-terminated array of D-Bus interface names, which must remain valid at least until the connection enters state #TP_CONNECTION_STATUS_DISCONNECTED (in practice, you should either use static strings, or use strdup'd strings and free them in the dispose callback). Add @token to the set of tokens for which this connection will emit #TpBaseConnection::clients-interested and #TpBaseConnection::clients-uninterested. This method must be called from the #GObjectClass<!-- -->.constructed or #GObjectClass<!-- -->.constructor callback (otherwise, it will run too late to be useful). a connection a quark corresponding to a D-Bus interface, or a token representing part of a D-Bus interface, for which this connection wishes to be notified when clients register an interest Change the status of the connection. The allowed state transitions are: <itemizedlist> <listitem>#TP_INTERNAL_CONNECTION_STATUS_NEW → #TP_CONNECTION_STATUS_CONNECTING</listitem> <listitem>#TP_CONNECTION_STATUS_CONNECTING → #TP_CONNECTION_STATUS_CONNECTED</listitem> <listitem>#TP_INTERNAL_CONNECTION_STATUS_NEW → #TP_CONNECTION_STATUS_CONNECTED (exactly equivalent to both of the above one after the other; see below)</listitem> <listitem>anything except #TP_CONNECTION_STATUS_DISCONNECTED → #TP_CONNECTION_STATUS_DISCONNECTED</listitem> </itemizedlist> Before the transition to #TP_CONNECTION_STATUS_CONNECTED, the implementation must have discovered the handle for the local user and passed it to tp_base_connection_set_self_handle(). Changing from NEW to CONNECTED is implemented by doing the transition from NEW to CONNECTING, followed by the transition from CONNECTING to CONNECTED; it's exactly equivalent to calling tp_base_connection_change_status for those two transitions one after the other. Any other valid transition does the following, in this order: <itemizedlist> <listitem>Update #TpBaseConnection<!-- -->.status;</listitem> <listitem>If the new state is #TP_CONNECTION_STATUS_DISCONNECTED, call tp_channel_factory_iface_close_all() on all channel factories</listitem> <listitem>Emit the D-Bus StatusChanged signal;</listitem> <listitem>Call #TpBaseConnectionClass.connecting, #TpBaseConnectionClass.connected or #TpBaseConnectionClass.disconnected as appropriate;</listitem> <listitem>Call the channel factories' status change callbacks;</listitem> <listitem>If the new state is #TP_CONNECTION_STATUS_DISCONNECTED, call the subclass' #TpBaseConnectionClass.shut_down callback.</listitem> </itemizedlist> To provide more details about what happened when moving to @status #TP_CONNECTION_STATUS_DISCONNECTED due to an error, consider calling tp_base_connection_disconnect_with_dbus_error() instead of this function. Changed in 0.7.35: the @self_handle member of #TpBaseConnection was previously set to 0 at this stage. It now remains non-zero until the object is disposed. The connection The new status The reason for the status change Return whether this connection is fully active and connected. If it is not, raise %TP_ERROR_DISCONNECTED. This is equivalent to checking whether tp_base_connection_get_status() returns %TP_CONNECTION_STATUS_CONNECTED; it is provided because methods on the connection often need to make this check, and return a #GError if it fails. %TRUE if this connection is connected the connection Changes the #TpBaseConnection<!-- -->.status of @self to %TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to tp_base_connection_change_status(), but additionally emits the <code>ConnectionError</code> D-Bus signal to provide more details about the error. Well-known keys for @details are documented in the Telepathy specification's <ulink url='http://telepathy.freedesktop.org/spec/Connection.html#Signal:ConnectionError'>definition of the ConnectionError signal</ulink>, and include: <itemizedlist> <listitem><code>"debug-message"</code>, whose value should have type #G_TYPE_STRING, for debugging information about the disconnection which should not be shown to the user</listitem> <listitem><code>"server-message"</code>, whose value should also have type #G_TYPE_STRING, for a human-readable error message from the server (in an unspecified language) explaining why the user was disconnected.</listitem> </itemizedlist> The connection The D-Bus error with which the connection changed status to Disconnected Further details of the error, as a hash table where the keys are strings as defined in the Telepathy specification, and the values are #GValue<!-- -->s. %NULL is allowed, and treated as an empty hash table. The reason code to use in the StatusChanged signal (a less specific, non-extensible version of @error_name) Changes the #TpBaseConnection<!-- -->.status of @self to %TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to tp_base_connection_change_status(), but additionally emits the <code>ConnectionError</code> D-Bus signal to provide more details about the error. Well-known keys for @details are documented in the Telepathy specification's <ulink url='http://telepathy.freedesktop.org/spec/Connection.html#Signal:ConnectionError'>definition of the ConnectionError signal</ulink>, and include: <itemizedlist> <listitem><code>"debug-message"</code>, whose value should have type #G_TYPE_STRING, for debugging information about the disconnection which should not be shown to the user</listitem> <listitem><code>"server-message"</code>, whose value should also have type #G_TYPE_STRING, for a human-readable error message from the server (in an unspecified language) explaining why the user was disconnected.</listitem> </itemizedlist> The connection The D-Bus error with which the connection changed status to Disconnected Further details of the error, as a variant of type %G_VARIANT_TYPE_VARDICT. The keys are strings as defined in the Telepathy specification, and the values are of type %G_VARIANT_TYPE_VARIANT. %NULL is allowed, and treated as an empty dictionary. The reason code to use in the StatusChanged signal (a less specific, non-extensible version of @error_name) Tell the connection manager that this Connection has been disconnected, has emitted StatusChanged and is ready to be removed from D-Bus. The connection <!-- --> the same value has the #TpBaseConnection:account-path-suffix property. the connection Return the bus name starting with %TP_CONN_BUS_NAME_BASE that represents this connection on D-Bus. The returned string belongs to the #TpBaseConnection and must be copied by the caller if it will be kept. If this connection has never been present on D-Bus (tp_base_connection_register() has never been called), return %NULL instead. the bus name of this connection, or %NULL the connection <!-- --> the value of the #TpBaseConnectionManager:dbus-daemon property. The caller must reference the returned object with g_object_ref() if it will be kept. the connection manager <!----> the handle repository corresponding to the given handle type, or #NULL if it's unsupported or invalid. A connection The handle type Return the object path starting with %TP_CONN_OBJECT_PATH_BASE that represents this connection on D-Bus. The returned string belongs to the #TpBaseConnection and must be copied by the caller if it will be kept. If this connection has never been present on D-Bus (tp_base_connection_register() has never been called), return %NULL instead. the object path of this connection, or %NULL the connection Returns the #TpBaseConnection:self-handle property, which is guaranteed not to be 0 once the connection has moved to the CONNECTED state. the current self handle of the connection. A connection Return the status of this connection, as set by tp_base_connection_change_status() or similar functions like tp_base_connection_disconnect_with_dbus_error(). Like the corresponding D-Bus property, this method returns %TP_CONNECTION_STATUS_DISCONNECTED in two situations: either the connection is newly-created (and has never emitted #TpSvcConnection::status-changed), or D-Bus clients have already been told that it has been destroyed (by the Disconnect D-Bus method, a failed attempt to connect, or loss of an established connection). Use tp_base_connection_is_destroyed() to distinguish between the two. the value of #TpBaseConnection:dbus-status the connection Return whether this connection has already emitted the D-Bus signal indicating that it has been destroyed. In particular, this can be used to distinguish between the two reasons why tp_base_connection_get_status() would return %TP_CONNECTION_STATUS_DISCONNECTED: it will return %FALSE if the connection is newly-created, and %TRUE if the Disconnect D-Bus method has been called, an attempt to connect has failed, or an established connection has encountered an error. %TRUE if this connection is disappearing from D-Bus the connection Make the connection object appear on the bus, returning the bus name and object path used. If %TRUE is returned, the connection owns the bus name, and will release it when destroyed. Since 0.11.11, @bus_name and @object_path may be %NULL if the strings are not needed. %TRUE on success, %FALSE on error. A connection The name of the connection manager in the Telepathy protocol Used to return the bus name corresponding to the connection if %TRUE is returned. To be freed by the caller. Used to return the object path of the connection if %TRUE is returned. To be freed by the caller. Register the Connection interface with the Contacts interface to make it inspectable. The Contacts mixin should be initialized before this function is called An instance of the #TpBaseConnections that uses the Contacts mixin Sets the #TpBaseConnection:self-handle property. self_handle may not be 0 once the connection has moved to the CONNECTED state. A connection The new self handle for the connection. The suffix of the account object path such as "gabble/jabber/chris_40example_2ecom0" for the account whose object path is %TP_ACCOUNT_OBJECT_PATH_BASE + "gabble/jabber/chris_40example_2ecom0". The same as returned by tp_account_get_path_suffix(). It is given by the AccountManager in the connection parameters. Or %NULL if the ConnectionManager or the AccountManager are too old. #TpDBusDaemon object encapsulating this object's connection to D-Bus. Read-only except during construction. If this property is %NULL or omitted during construction, the object will automatically attempt to connect to the starter or session bus with tp_dbus_daemon_dup() just after it is constructed; if this fails, this property will remain %NULL, and tp_base_connection_register() will fail. The Connection.Status as visible on D-Bus, which is the same as #TpBaseConnection<!-- -->.status except that %TP_INTERNAL_CONNECTION_STATUS_NEW is replaced by %TP_CONNECTION_STATUS_DISCONNECTED. The #GObject::notify signal is not currently emitted for this property. This property is not useful to use directly. Its value is %TRUE, to indicate that this version of telepathy-glib never unreferences handles until the connection becomes disconnected. The set of D-Bus interfaces available on this Connection, other than Connection itself. Identifier used in the Telepathy protocol when this connection's protocol name is required. The handle of type %TP_HANDLE_TYPE_CONTACT representing the local user. Must be set nonzero by the subclass before moving to state CONNECTED. The identifier representing the local user. This is the result of inspecting #TpBaseConnection:self-handle. Emitted when a client becomes interested in any token that was added with tp_base_connection_add_possible_client_interest(). The "signal detail" is a GQuark representing @token. Modules implementing an interface (Location, say) should typically connect to a detailed signal like "clients-interested::org.freedesktop.Telepathy.Connection.Interface.Location" rather than receiving all emissions of this signal. the interface or part of an interface in which clients are newly interested Emitted when no more clients are interested in an interface added with tp_base_connection_add_possible_client_interest(), for which #TpBaseConnection::clients-interested was previously emitted. As with #TpBaseConnection::clients-interested, the "signal detail" is a GQuark representing @token. Modules implementing an interface (Location, say) should typically connect to a detailed signal like "clients-uninterested::org.freedesktop.Telepathy.Connection.Interface.Location" rather than receiving all emissions of this signal. the interface or part of an interface in which clients are no longer interested Emitted by tp_base_connection_finish_shutdown() when the underlying network connection has been closed; #TpBaseConnectionManager listens for this signal and removes connections from its table of active connections when it is received. The class of a #TpBaseConnection. Many members are virtual methods etc. to be filled in in the subclass' class_init function. The superclass' structure Create an array of channel factories for this Connection. At least one of this or @create_channel_managers must be set by subclasses to a non-%NULL value; in new code, setting this to %NULL and using channel managers exclusively is recommended. Construct a unique name for this connection (for example using the protocol's format for usernames). If %NULL (the default), a unique name will be generated. Subclasses should usually override this to get more obvious names, to aid debugging and prevent multiple connections to the same account. If set by subclasses, will be called just after the state changes to CONNECTING. May be %NULL if nothing special needs to happen. If set by subclasses, will be called just after the state changes to CONNECTED. May be %NULL if nothing special needs to happen. If set by subclasses, will be called just after the state changes to DISCONNECTED. May be %NULL if nothing special needs to happen. Called after disconnected() is called, to clean up the connection. Must start the shutdown process for the underlying network connection, and arrange for tp_base_connection_finish_shutdown() to be called after the underlying connection has been closed. May not be left as %NULL. Asynchronously start connecting - called to implement the Connect D-Bus method. See #TpBaseConnectionStartConnectingImpl for details. May not be left as %NULL. Create an array of channel managers for this Connection. At least one of this or @create_channel_factories must be set by subclasses to a non-%NULL value. Since: 0.7.15 Returns a #GPtrArray of extra D-Bus interfaces which are always implemented by instances of this class, which may be filled in by subclasses. The default is to list no additional interfaces. Individual instances may detect which additional interfaces they support and signal them before going to state CONNECTED by calling tp_base_connection_add_interfaces(). Signature of an implementation of the create_channel_factories method of #TpBaseConnection. a GPtrArray of objects implementing #TpChannelFactoryIface which, between them, implement all channel types this Connection supports. The implementation, a subclass of TpBaseConnection Signature of an implementation of the create_channel_managers method of #TpBaseConnection. a GPtrArray of objects implementing #TpChannelManager which, between them, implement all channel types this Connection supports. The implementation, a subclass of TpBaseConnection Signature of an implementation of the create_handle_repos method of #TpBaseConnection. The connection object An array of pointers to be filled in; the implementation may assume all are initially NULL. Signature of an implementation of #TpBaseConnectionClass.get_interfaces_always_present virtual function. Implementation must first chainup on parent class implementation and then add extra interfaces into the #GPtrArray. |[ static GPtrArray * my_connection_get_interfaces_always_present (TpBaseConnection *self) { GPtrArray *interfaces; interfaces = TP_BASE_CONNECTION_CLASS ( my_connection_parent_class)->get_interfaces_always_present (self); g_ptr_array_add (interfaces, TP_IFACE_BADGERS); return interfaces; } ]| a #GPtrArray of static strings for D-Bus interfaces implemented by this client. a #TpBaseConnection Signature of the @get_unique_connection_name virtual method on #TpBaseConnection. a name for this connection which will be unique within this connection manager process, as a string which the caller must free with #g_free. The implementation, a subclass of TpBaseConnection Signature of a virtual method on #TpBaseConnection that takes no additional parameters and returns nothing. The connection object Signature of an implementation of the start_connecting method of #TpBaseConnection. On entry, the implementation may assume that it is in state NEW. If %TRUE is returned, the Connect D-Bus method succeeds; the implementation must either have already set the status to CONNECTED by calling tp_base_connection_change_status(), or have arranged for a status change to either state DISCONNECTED or CONNECTED to be signalled by calling tp_base_connection_change_status() at some later time. If the status is still NEW after returning %TRUE, #TpBaseConnection will automatically change it to CONNECTING for reason REQUESTED. If %FALSE is returned, the error will be raised from Connect as an exception. If the status is not DISCONNECTED after %FALSE is returned, #TpBaseConnection will automatically change it to DISCONNECTED with a reason appropriate to the error; NetworkError results in NETWORK_ERROR, PermissionDenied results in AUTHENTICATION_FAILED, and all other errors currently result in NONE_SPECIFIED. All except the simplest connection managers are expected to implement this asynchronously, returning %TRUE in most cases and changing the status to CONNECTED or DISCONNECTED later. %FALSE if failure has already occurred, else %TRUE. The connection object Data structure representing a #TpBasicProxyFactory Convenient function to create a new #TpBasicProxyFactory instance. New code should use #TpSimpleClientFactory instead a new #TpBasicProxyFactory Returns a cached #TpBasicProxyFactory; the same #TpBasicProxyFactory object will be returned by this function repeatedly, as long as at least one reference exists. New code should use #TpSimpleClientFactory instead a #TpBasicProxyFactory The class of a #TpBasicProxyFactory. the parent class The channel dispatcher's well-known bus name The channel dispatcher's standard object path The common prefix of the well-known bus name for any Telepathy Client. The common prefix of the well-known object path for any Telepathy Client. Describes possible sources of information on connection managers' supported protocols. Since 0.11.5, there is a corresponding #GEnumClass type, %TP_TYPE_CM_INFO_SOURCE. no information available information came from a .manager file information came from the connection manager The prefix for a connection manager's bus name, to which the CM's name (e.g. "gabble") should be appended. The prefix for a connection manager's object path, to which the CM's name (e.g. "gabble") should be appended. The prefix for a connection's bus name, to which the CM's name (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence of elements representing the account should be appended. The prefix for a connection's object path, to which the CM's name (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence of elements representing the account should be appended. An invalid TpContactFeature. Used as list termination. See for example tp_simple_client_factory_add_contact_features_varargs(). Data structure representing a #TpCallChannel. For incoming calls with #TpCallChannel:state set to %TP_CALL_STATE_INITIALISED, accept the incoming call. This changes #TpCallChannel:state to %TP_CALL_STATE_ACCEPTED. For outgoing calls with #TpCallChannel:state set to %TP_CALL_STATE_PENDING_INITIATOR, actually call the remote contact; this changes #TpCallChannel:state to %TP_CALL_STATE_INITIALISING. a #TpCallChannel a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_accept_async(). a #TpCallChannel a #GAsyncResult Request that a new Content of type @type is added to @self. Callers should check the value of the #TpCallChannel:mutable-contents property before trying to add another content as it might not be allowed. a #TpCallChannel the suggested name of the content to add the media stream type of the content to be added to the call, from #TpMediaStreamType The initial direction of the content a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_add_content_async(). The returned #TpCallContent is NOT guaranteed to have %TP_CALL_CONTENT_FEATURE_CORE prepared. reference to the new #TpCallContent. a #TpCallChannel a #GAsyncResult <!-- --> the value of #TpCallChannel:contents a #TpCallChannel Get the members of this call. The #TpContact objects are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. #GHashTable mapping #TpContact to its new #TpCallMemberFlags a #TpCallChannel <!-- --> the value of #TpCallChannel:state a #TpCallChannel a place to set the value of #TpCallChannel:flags a place to set the value of #TpCallChannel:state-details a place to set the value of #TpCallChannel:state-reason Request that the call is ended. All contents will be removed from @self so that the #TpCallChannel:contents property will be the empty list. a #TpCallChannel a TpCallStateChangeReason a more specific reason for the call hangup, if one is available, or an empty or %NULL string otherwise a human-readable message to be sent to the remote contact(s) a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_hangup_async(). a #TpCallChannel a #GAsyncResult Whether or not @self can send DTMF tones using tp_call_channel_send_tones_async(). To be able to send DTMF tones, at least one of @self's #TpCallChannel:contents must implement %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. whether or not @self can send DTMF tones. a #TpCallChannel <!-- --> the value of #TpCallChannel:hardware-streaming a #TpCallChannel Whether or not @self has the %TP_IFACE_CHANNEL_INTERFACE_HOLD interfaces whether or not @self supports Hold a #TpCallChannel <!-- --> the value of #TpCallChannel:initial-audio a #TpCallChannel a place to set the value of #TpCallChannel:initial-audio-name <!-- --> the value of #TpCallChannel:initial-video a #TpCallChannel a place to set the value of #TpCallChannel:initial-video-name <!-- --> the value of #TpCallChannel:mutable-contents a #TpCallChannel Requests that the connection manager holds or unholds the call. Watch #TpCallChannel:hold-state property to know when the channel goes on hold or is unheld. Unholding may fail if the streaming implementation can not obtain all the resources needed to restart the call. a #TpCallChannel Whether to request a hold or a unhold a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_request_hold_async a #TpCallChannel a #GAsyncResult Send @tones on every of @self's contents which have the %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. For more details, see tp_call_content_send_tones_async(). a #TpCallChannel a string representation of one or more DTMF events. optional #GCancellable object, %NULL to ignore a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_send_tones_async(). %TRUE on success, %FALSE otherwise. a #TpCallChannel a #GAsyncResult Notifies the CM that the local user is already in a call, so this call has been put in a call-waiting style queue. a #TpCallChannel a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_set_queued_async(). a #TpCallChannel a #GAsyncResult Indicate that the local user has been alerted about the incoming call. a #TpCallChannel a callback to call when the operation finishes data to pass to @callback Finishes tp_call_channel_set_ringing_async(). a #TpCallChannel a #GAsyncResult #GPtrArray of #TpCallContent objects. The list of content objects that are part of this call. It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on those objects. A #TpCallFlags specifying the flags of the call state. Whether or not the streaming is done by dedicated hardware. A #TpLocalHoldState specifying if the Call is currently held A #TpLocalHoldStateReason specifying why the Call is currently held. Whether or not the Call was started with audio. If #TpCallChannel:initial-audio is set to %TRUE, then this property will is the name of the intial audio content, %NULL otherwise. Whether or not the Call was started with video. If #TpCallChannel:initial-video is set to %TRUE, then this property will is the name of the intial video content, %NULL otherwise. Whether or not call contents can be added or removed. A #TpCallState specifying the state of the call. Detailed infoermation about #TpCallChannel:state. It is a #GHashTable mapping gchar*->GValue, it can be accessed using the tp_asv_* functions. Reason why #TpCallChannel:state last changed. The ::content-added signal is emitted whenever a #TpCallContent is added to @self. It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on @content. the newly added #TpCallContent The ::content-removed signal is emitted whenever a #TpCallContent is removed from @self. It is NOT guaranteed that %TP_CALL_CONTENT_FEATURE_CORE is prepared on @content. the newly removed #TpCallContent a #TpCallStateReason The ::members-changed signal is emitted whenever the call's members changes. The #TpContact objects are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. #GHashTable mapping #TpContact to its new #TpCallMemberFlags #GPtrArray of #TpContact removed from the call members the #TpCallStateReason for the change The ::state-changed signal is emitted whenever the call state changes. the new #TpCallState the new #TpCallFlags the #TpCallStateReason for the change additional details as a #GHashTable readable using the tp_asv_* functions. The class of a #TpCallChannel. Data structure representing a #TpCallContent. Ensure that the known interfaces for #TpCallContent have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CALL_CONTENT. <!-- --> the value of #TpCallContent:disposition a #TpCallContent <!-- --> the value of #TpCallContent:name a #TpCallContent <!-- --> the value of #TpCallContent:name a #TpCallContent <!-- --> the value of #TpCallContent:streams a #TpCallContent Remove the content from the call. This will cause #TpCallContent::removed to be emitted. a #TpCallContent a callback to call when the operation finishes data to pass to @callback Finishes tp_call_content_remove_async(). a #TpCallContent a #GAsyncResult Send @tones DTMF code on @self content. @self must have the %TP_IFACE_CALL_CONTENT_INTERFACE_DTMF interface. If DTMF tones are already being played, this request is queued. a #TpCallContent a string representation of one or more DTMF events. optional #GCancellable object, %NULL to ignore a callback to call when the operation finishes data to pass to @callback Finishes tp_call_content_send_tones_async(). %TRUE on success, %FALSE otherwise. a #TpCallContent a #GAsyncResult The parent #TpCallChannel of the content. The #TpConnection of the call. The disposition of this content, from #TpCallContentDisposition. The media type of this content, from #TpMediaStreamType. The name of this content. #GPtrArray of #TpCallStream objects. The list of stream objects that are part of this content. It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on those objects. The ::removed signal is emitted when @self is removed from a #TpCallChannel. The ::streams-added signal is emitted whenever #TpCallStream are added to @self. It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on stream objects. a #GPtrArray of newly added #TpCallStream The ::streams-removed signal is emitted whenever #TpCallStreams are removed from @self. It is NOT guaranteed that %TP_CALL_STREAM_FEATURE_CORE is prepared on stream objects. a #GPtrArray of newly removed #TpCallStream a #TpCallStateReason The class of a #TpCallContent. <![CDATA[ The disposition of this content, which defines whether to automatically start sending data on the streams when Accept is called on the channel. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The content has no specific disposition. ]]> <![CDATA[ The content was initially part of the call. When Accept is called on the channel, all streams of this content with LocalSendingState set to Pending_Send will be moved to Sending as if SetSending (True) had been called. ]]> <![CDATA[ A packetization method that can be used for a content. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Real-time Transport Protocol, as documented by RFC 3550. ]]> <![CDATA[ Raw media. ]]> <![CDATA[ MSN webcam. This is the video-only one-way type which was used in earlier versions of WLM. Although no longer used, modern WLM clients still support the MSN webcam protocol. ]]> <![CDATA[ A set of flags representing additional information than is available in CallState. Many of these flags only make sense in a particular (or may explain why a call is in a specific state). ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The call has been put on hold by the local user, e.g. using the Hold interface. This flag SHOULD only be set if there is at least one Content, and all Contents are locally held. Otherwise, in transient situations where some but not all contents are on hold, UIs would falsely indicate that the call as a whole is on hold, which could lead to the user saying something they'll regret, while under the impression that the other contacts can't hear them! This flag exists as a simplified proxy for HoldStateChanged, to reduce the number of signals that need to be listened to by a simple UI. ]]> <![CDATA[ This flag exists for observability of the SetRinging method (e.g. so that loggers can tell whether the call got as far as alerting the user, or whether something went wrong before then). It should be set when the SetRinging is called, and unset when the call leaves Initialised. ]]> <![CDATA[ This flag exists for observability of the SetQueued method. It should be set when the SetQueued is called, and unset when the call leaves Initialising or Initialised. ]]> <![CDATA[ The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted. This flag only makes sense on outgoing calls. It SHOULD be set or unset according to informational messages from other contacts. ]]> <![CDATA[ This flag only occurs when the CallState is Ended. The call with this flag set has ended, but not all resources corresponding to the call have been freed yet. Depending on the protocol there might be some audible feedback while the clearing flag is set. In calls following the ITU-T Q.931 standard there is a period of time between the call ending and the underlying channel being completely free for re-use. ]]> <![CDATA[ A set of flags representing the status of a remote contact in a call. It is protocol- and client-specific whether a particular contact will ever have a particular flag set on them, and Telepathy clients SHOULD NOT assume that a flag will ever be set. 180 Ringing in SIP, and its equivalent in XMPP, are optional informational messages, and implementations are not required to send them. The same applies to the messages used to indicate hold state. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The remote contact's client has told us that the contact has been alerted about the call but has not responded. This is a flag per member, not a flag for the call as a whole, because in Muji conference calls, you could invite someone and have their state be "ringing" for a while. ]]> <![CDATA[ The call member has put this call on hold. This is a flag per member, not a flag for the call as a whole, because in conference calls, any member could put the conference on hold. ]]> <![CDATA[ This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact. ]]> <![CDATA[ The state of a call, as a whole. The allowed transitions are: Pending_Initiator → Initialising (for outgoing calls, when Accept is called) Initialising → Initialised (for outgoing calls, when the remote client indicates that the user has been notified about the call. If the network is known not to provide feedback about whether the remote side is ringing, then the call should immediately be set to Initialised. Initialising → Initialised (for incoming calls, when e.g. the implementation has been initialised far enough that it is sensible to notify the user about the call (to reduce the probability that the user will pick up the call and have it immediately fail). The UI should then alert the user about the call, and call SetRinging) Initialised → Accepted (for outgoing calls to a contact, when the remote contact accepts the call; for incoming calls, when Accept is called.) Accepted → Active (when the local user successfully joins the call/conference, and media is known to be flowing successfully; also, when temporary connection problems are resolved (See below)). If the network is known not to provide feedback about when the call is properly connected, the call should immediately be set to Active. Active → Accepted (when there are temporary connection problems that the CM is aware of and able to recover from) any state → Ended (when the call is terminated normally, or when an error occurs that the CM is unable to recover from) Clients MAY consider unknown values from this enum to be an error - additional values will not be defined after the Call specification is declared to be stable. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The call state is not known. This call state MUST NOT appear as a value of the CallState property, but MAY be used by client code to represent calls whose state is as yet unknown. ]]> <![CDATA[ The initiator of the call hasn't accepted the call yet. This state only makes sense for outgoing calls, where it means that the local user has not yet sent any signalling messages to the remote user(s), and will not do so until Accept is called. ]]> <![CDATA[ Progress has been made in placing the call, but the contact has not been made aware of the call yet. This corresponds to SIP's status code 183 Session Progress, and should be used for the period where the CM is waiting for the streaming implementation to initialise (before sending the initial INVITE or equivalent) and when the outgoing call has reached a gateway or ICE negotiation is pending. UIs should not produce a dialtone or start ringing if the call is in this state. ]]> <![CDATA[ In the outgoing case: at least one called user has been alerted about the call (a SIP 180 (Ringing) packet or equivalent has been received) but none have answered, so the call cannot go to Accepted (use Ringing to determine which members have been informed and which haven't, if you care). UIs SHOULD produce a dialtone for outgoing calls in this state. In the incoming case, the local user should be informed of the call as soon as the call reaches this state (and SetRinging should be called to inform the CM that this has happened, so that it can relay this fact to the caller using a SIP 180 (Ringing) packet or equivalent). ]]> <![CDATA[ The contact being called has accepted the call, but the call is not in the Active state (The most common reason for this is that the streaming implementation hasn't connected yet). ]]> <![CDATA[ The contact being called has accepted the call, and discourse between at least two parties should now be possible. ]]> <![CDATA[ The call has ended, either via normal termination or an error. ]]> <![CDATA[ A simple representation of the reason for a change in the call's state, which may be used by simple clients, or used as a fallback when the DBus_Reason member of a Call_State_Reason struct is not understood. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ We just don't know. Unknown values of this enum SHOULD also be treated like this. ]]> <![CDATA[ Situation normal. Progress has been made in the setup/teardown of the call (and it didn't require any user interaction). ]]> <![CDATA[ The change was requested by the contact indicated by the Actor member of a Call_State_Reason struct. The DBus_Reason SHOULD be the empty string if the call was terminated normally, but MAY be a non-empty error name to indicate error-like call termination reasons (kicked from a conference by a moderator, etc.). ]]> <![CDATA[ The call was forwarded. If known, the handle of the contact the call was forwarded to will be indicated by the "forwarded-to" member of a CallStateDetails dictionnary in the CallStateChanged signal. ]]> <![CDATA[ The CallState changed from Initialised or Ended (or a content's direction changed) because it was rejected by the remote user. Corresponds to Rejected ]]> <![CDATA[ The CallState changed from Initialised or Ended because the initiator ended the call before the receiver accepted it. With an incoming call this state change reason signifies a missed call, or one that was picked up elsewhere before it was picked up here. Corresponds to NoAnswer or PickedUpElsewhere ]]> <![CDATA[ The CallState changed because one of the addresses does not exist on the network. Corresponds to DoesNotExist ]]> <![CDATA[ The CallState changed because the local user is not authorised. Corresponds to PermissionDenied or InsufficientBalance ]]> <![CDATA[ The CallState changed from Initialised Ended because the receiver is busy (e.g. is already engaged in another call, and has not placed the initiator in a call-waiting queue). Corresponds to Busy ]]> <![CDATA[ There has been an unexpected error in either the CM or some other local component. Corresponds to Confused or Media.StreamingError ]]> <![CDATA[ There has been an unexpected error in the server or some other remote component. Corresponds to ServiceConfused ]]> <![CDATA[ There has been a network error related to the CM or the signalling part of the call (compare and contrast: Streaming_Error). Corresponds to NetworkError ]]> <![CDATA[ Some aspect of the content is unsupported so has to be removed from the call. Corresponds to Media.UnsupportedType or Media.CodecsIncompatible ]]> <![CDATA[ It was not possible for the streaming implementation to connect to any of the users participating in this call or content. Corresponds to ConnectionFailed or ConnectionLost ]]> Data structure representing the reason for a call state change. the contact responsible for the change, or 0 if no contact was responsible the reason for the change. If #TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED then the @actor member will dictate whether it was the local user or a remote contact responsible A specific reason for the change, which may be a D-Bus error in the Telepathy namespace, a D-Bus error in any other namespace (for implementation-specific errors), or the empty string to indicate that the state change was not an error A developer readable debug message giving the reason for the state change. Data structure representing a #TpCallStream. Ensure that the known interfaces for #TpCallStream have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CALL_STREAM. <!-- --> the value of #TpCallStream:can-request-receiving a #TpCallStream <!-- --> the value of #TpCallStream:local-sending-state a #TpCallStream Get the remote contacts to who this stream is connected, mapped to their sending state. It is NOT guaranteed that #TpContact objects have any feature prepared. #GHashTable mapping #TpContact to its new #TpSendingState a #TpCallStream Request that a remote contact stops or starts sending on this stream. The #TpCallStream:can-request-receiving property defines whether the protocol allows the local user to request the other side start sending on this stream. If @receive is %TRUE, request that the given contact starts to send media. If @receive is %FALSE, request that the given contact stops sending media. a #TpCallStream contact from which sending is requested the requested receiving state a callback to call when the operation finishes data to pass to @callback Finishes tp_call_stream_request_receiving_async(). a #TpCallStream a #GAsyncResult Set the stream to start or stop sending media from the local user to other contacts. If @send is %TRUE, #TpCallStream:local-sending-state should change to %TP_SENDING_STATE_SENDING, if it isn't already. If @send is %FALSE, #TpCallStream:local-sending-state should change to %TP_SENDING_STATE_NONE, if it isn't already. a #TpCallStream the requested sending state a callback to call when the operation finishes data to pass to @callback Finishes tp_call_stream_set_sending_async(). a #TpCallStream a #GAsyncResult If %TRUE, the user can request that a remote contact starts sending on this stream. The #TpConnection of the call. The Content that this streams belongs to The local user's sending state, from #TpSendingState. The ::local-sending-state-changed signal is emitted whenever the stream sending state changes. the new #TpSendingState the #TpCallStateReason for the change The ::remote-members-changed signal is emitted whenever the stream's remote members changes. It is NOT guaranteed that #TpContact objects have any feature prepared. #GHashTable mapping #TpContact to its new #TpSendingState #GPtrArray of #TpContact removed from remote contacts the #TpCallStateReason for the change <![CDATA[ The network topology that an IP candidate represents. This can sometimes be used to infer what kind of performance characteristics (latency, bandwith, etc) can be expected of connections made to this candidate. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ This is not an IP candidate. This is a reserved value, and should not be seen on the bus. ]]> <![CDATA[ This candidate represents a direct connection to the host, as its address is taken directly the host's IP stack. ]]> <![CDATA[ This candidate probably represents a connection to the host through a NAT device, as its address was discovered by sending a binding request to a STUN server or similar. ]]> <![CDATA[ This candidate probably represents a good route between the host and its peer, as its address was discovered by sending a STUN binding request to one of the candidates advertised by the peer. ]]> <![CDATA[ This candidate represents the address of a relay server (usually somewhere on the public internet). This candidate is the most likely to work, but all media will go via a relay server, so latency is likely to be higher than other types of candidate. ]]> <![CDATA[ This candidate represents a Multicast group. This value should only appear if the Stream's Transport is set to Multicast. ]]> The class of a #TpCallStream. An object representing capabilities a #TpConnection or #TpContact supports. Return the #TpCapabilities:channel-classes-variant property the value of the #TpCapabilities:channel-classes-variant property a #TpCapabilities <!-- --> the same #GPtrArray as the #TpCapabilities:channel-classes property a #TpCapabilities object <!-- --> the same #gboolean as the #TpCapabilities:contact-specific property a #TpCapabilities object Return whether audio calls can be established, for instance by calling tp_account_channel_request_new_audio_call(), followed by tp_account_channel_request_set_target_id() with @handle_type. To check whether requests using tp_account_channel_request_set_target_contact() would work, set @handle_type to %TP_HANDLE_TYPE_CONTACT. %TRUE if a channel request containing Call as ChannelType, @handle_type as TargetHandleType, a True value for InitialAudio and an identifier of the appropriate type can be expected to work, %FALSE otherwise. a #TpCapabilities object the handle type of the call; #TP_HANDLE_TYPE_CONTACT for private, #TP_HANDLE_TYPE_ROOM or #TP_HANDLE_TYPE_NONE for conference (depending on the protocol) Return whether audio/video calls can be established, for instance by calling tp_account_channel_request_new_audio_video_call(), followed by tp_account_channel_request_set_target_id() with @handle_type. To check whether requests using tp_account_channel_request_set_target_contact() would work, set @handle_type to %TP_HANDLE_TYPE_CONTACT. %TRUE if a channel request containing Call as ChannelType, @handle_type as TargetHandleType, a True value for InitialAudio/InitialVideo and an identifier of the appropriate type can be expected to work, %FALSE otherwise. a #TpCapabilities object the handle type of the call; #TP_HANDLE_TYPE_CONTACT for private, #TP_HANDLE_TYPE_ROOM or #TP_HANDLE_TYPE_NONE for conference (depending on the protocol) Return whether this protocol or connection can perform contact searches. Optionally, also return whether a limited number of results can be specified, and whether alternative servers can be searched. %TRUE if #TpContactSearch can be used. a #TpCapabilities object if not %NULL, used to return %TRUE if the limit parameter to tp_contact_search_new_async() and tp_contact_search_reset_async() can be nonzero if not %NULL, used to return %TRUE if the server parameter to tp_contact_search_new_async() and tp_contact_search_reset_async() can be non-%NULL If the #TpCapabilities:contact-specific property is %TRUE, this function checks if the contact associated with this #TpCapabilities supports D-Bus tubes with @handle_type as TargetHandleType. If @service_name is not %NULL, it also checks if it supports stream tubes with @service as #TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME. If the #TpCapabilities:contact-specific property is %FALSE, this function checks if the connection supports requesting D-Bus tube channels with @handle_type as ChannelType. The @service_name argument is unused in this case. %TRUE if the contact or connection supports this type of D-Bus tubes. a #TpCapabilities object the handle type of the tube (either #TP_HANDLE_TYPE_CONTACT or #TP_HANDLE_TYPE_ROOM) the service name of the tube, or %NULL Return whether private file transfer can be established by providing a contact identifier. %TRUE if a channel request containing FileTransfer as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, %FALSE otherwise. a #TpCapabilities object <!-- --> %TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's description a #TpCapabilities object Return whether an initial offset other than 0 can be specified on outgoing file transfers. This can be used to resume partial transfers, by omitting the part that has already been sent. %TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify an initial offset greater than 0 a #TpCapabilities object <!-- --> %TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's timestamp a #TpCapabilities object <!-- --> %TRUE if requests as described for tp_capabilities_supports_file_transfer() can also specify the outgoing file's URI a #TpCapabilities object Discovers whether this protocol or connection supports listing rooms. Specifically, if this function returns %TRUE, a room list channel can be requested as follows: |[ GHashTable *request; TpAccountChannelRequest *req; request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE, NULL); req = tp_account_channel_request_new (account, request, TP_USER_ACTION_TIME_CURRENT_TIME); tp_account_channel_request_create_and_handle_channel_async (req, NULL, create_channel_cb, NULL); g_object_unref (req); g_hash_table_unref (request); ]| If @with_server is set to %TRUE, a list of rooms on a particular server can be requested as follows: |[ /\* Same code as above but with request defined using: *\/ request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE, TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, G_TYPE_STRING, "characters.shakespeare.lit", NULL); ]| %TRUE if a channel request containing RoomList as ChannelType, HandleTypeNone as TargetHandleType can be expected to work, %FALSE otherwise. a #TpCapabilities object if not %NULL, used to return %TRUE if the #TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER property can be defined when requesting a RoomList channel. If the #TpCapabilities:contact-specific property is %FALSE, this function checks if SMS text channels can be requested with the connection associated with this #TpCapabilities. If the #TpCapabilities:contact-specific property is %TRUE, this function checks if the contact associated with this #TpCapabilities supports SMS text channels. %TRUE if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType, a channel identifier and #TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL set to %TRUE can be expected to work, %FALSE otherwise. a #TpCapabilities object If the #TpCapabilities:contact-specific property is %TRUE, this function checks if the contact associated with this #TpCapabilities supports stream tubes with @handle_type as TargetHandleType. If @service is not %NULL, it also checks if it supports stream tubes with @service as #TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE. If the #TpCapabilities:contact-specific property is %FALSE, this function checks if the connection supports requesting stream tube channels with @handle_type as ChannelType. The @service argument is unused in this case. %TRUE if the contact or connection supports this type of stream tubes. a #TpCapabilities object the handle type of the tube (either #TP_HANDLE_TYPE_CONTACT or #TP_HANDLE_TYPE_ROOM) the service of the tube, or %NULL If the #TpCapabilities:contact-specific property is %FALSE, this function checks if named text chatrooms can be joined by providing a chatroom identifier, for instance by calling tp_account_channel_request_new_text() followed by tp_account_channel_request_set_target_id() with %TP_HANDLE_TYPE_ROOM. If the #TpCapabilities:contact-specific property is %TRUE, this function checks if the contact associated with this #TpCapabilities can be invited to named text chatrooms. If the protocol is such that chatrooms can be joined or contacts can be invited, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return %FALSE. %TRUE if a channel request containing Text as ChannelType, HandleTypeRoom as TargetHandleType and a channel identifier can be expected to work, %FALSE otherwise. a #TpCapabilities object Return whether private text channels can be established by providing a contact identifier, for instance by calling tp_account_channel_request_new_text() followed by tp_account_channel_request_set_target_contact(). If the protocol is such that text chats can be established, but only via a more elaborate D-Bus API than normal (because more information is needed), then this method will return %FALSE. %TRUE if a channel request containing Text as ChannelType, HandleTypeContact as TargetHandleType and a contact identifier can be expected to work, %FALSE otherwise. a #TpCapabilities object The underlying data structure used by Telepathy to represent the requests that can succeed. This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned #GPtrArray of #TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS. The higher-level methods like tp_capabilities_supports_text_chats() are likely to be more useful to the majority of clients. The underlying data structure used by Telepathy to represent the requests that can succeed. This can be used by advanced clients to determine whether an unusually complex request would succeed. See the Telepathy D-Bus API Specification for details of how to interpret the returned #GVariant of type a(a{sv}as). The higher-level methods like tp_capabilities_supports_text_chats() are likely to be more useful to the majority of clients. Whether this object accurately describes the capabilities of a particular contact, or if it's only a guess based on the capabilities of the underlying connection. <![CDATA[ A reason why captcha authentication was aborted by the client. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The user aborted the authentication. If this is used, the CaptchaError SHOULD be set to Cancelled ]]> <![CDATA[ The Handler doesn't support the given/required captcha types. If this is used, the CaptchaError SHOULD be set to CaptchaNotSupported. This SHOULD also be used if Close is called before CancelCaptcha. If no Handler supports captcha channels, the ChannelDispatcher will just call Close, because it has no knowledge of specific channel types. ]]> <![CDATA[ The Handler doesn't understand the captcha data received. The challenger may be sending gibberish. If this is used, the CaptchaError SHOULD be set to ServiceConfused. ]]> <![CDATA[ Extra flags to include with Captcha information ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ This captcha mechanism is required to be successfully answered in order to pass this captcha challenge. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The challenge/response exchange is in progress and waiting for a local action. Call AnswerCaptchas to go to the Remote_Pending state, or call CancelCaptcha followed by Close to give up. ]]> <![CDATA[ The challenge/response exchange is in progress and waiting for a response from the server. Wait for a reply from the server, which will result in the Succeeded, Try_Again, or Failed state, or call CancelCaptcha followed by Close to give up. ]]> <![CDATA[ Everyone is happy. Connection to the server will proceed as soon as this state is reached. There is nothing useful to do in this state except to call Close to close the channel. ]]> <![CDATA[ The server has indicated an authentication failure. Call GetCaptchas again to get a new captcha, or CancelCaptcha followed by Close to give up. ]]> <![CDATA[ Authentication has failed in some way. There is nothing useful to do in this state except to close the channel with Close. ]]> A proxy object for a Telepathy channel. A proxy object for a Telepathy channel. There are no interesting public struct fields. (Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.) <!-- --> Use tp_simple_client_factory_ensure_channel() instead. a new channel proxy, or %NULL on invalid arguments. a connection; may not be %NULL the object path of the channel; may not be %NULL the channel type if already known, or %NULL if not the handle type if already known, or %TP_UNKNOWN_HANDLE_TYPE if not the handle if already known, or 0 if not (if @optional_handle_type is %TP_UNKNOWN_HANDLE_TYPE or %TP_HANDLE_TYPE_NONE, this must be 0) <!-- --> Use tp_simple_client_factory_ensure_channel() instead. a new channel proxy, or %NULL on invalid arguments a connection; may not be %NULL the object path of the channel; may not be %NULL the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances Ensure that the known interfaces for TpChannel have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CHANNEL. Returns the connection for this channel. The returned pointer is only valid while this channel is valid - reference it with g_object_ref() if needed. Since 0.19.9. New code should use tp_channel_get_connection() instead. the value of #TpChannel:connection a channel Returns the immutable D-Bus properties of this channel, the same as #TpChannel:channel-properties. The returned hash table should not be altered, and is not necessarily valid after the main loop is next re-entered. Copy it with g_boxed_copy() (its type is %TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP) if a copy that remains valid must be kept. If the #TpChannel:channel-properties property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the %TP_CHANNEL_FEATURE_CORE feature is prepared. Since 0.19.9. New code should use tp_channel_dup_immutable_properties() instead. a #GHashTable where the keys are strings, D-Bus interface name + "." + property name, and the values are #GValue instances a channel If @self is ready for use or has been invalidated, call @callback immediately, then return. Otherwise, arrange for @callback to be called when @self either becomes ready for use or becomes invalid. This is a less general form of tp_proxy_prepare_async(), which should be used in new code. (One important difference is that this function can call @callback before it has returned, whereas tp_proxy_prepare_async() always calls @callback from the main loop.) Use tp_proxy_prepare_async() a channel called when the channel becomes ready or invalidated, whichever happens first arbitrary user-supplied data passed to the callback Close channel @self. In most cases, it's generally cleaner to use tp_channel_leave_async() instead to properly leave and close the channel. When the channel has been closed, @callback will be called. You can then call tp_channel_close_finish() to get the result of the operation. a #TpChannel a callback to call when we closed the channel, or %NULL to ignore any reply data to pass to @callback Finishes a call to tp_channel_leave_async(). %TRUE if the channel has been closed; %FALSE otherwise a #TpChannel a #GAsyncResult passed to the callback for tp_channel_close_async(). Destroy channel @self. If @self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_DESTROYABLE or if for any reason we can't destroy the channel, we close it. When the channel has been destroyed or closed, @callback will be called. You can then call tp_channel_destroy_finish() to get the result of the operation. a #TpChannel a callback to call when we left the channel data to pass to @callback Completes a call to tp_channel_destroy_async(). %TRUE if the channel has been destroyed or closed; %FALSE otherwise a #TpChannel a #GAsyncResult passed to the callback for tp_channel_destroy_async(). Returns the immutable D-Bus properties of this channel, in a variant of type %G_VARIANT_TYPE_VARDICT where the keys are strings, D-Bus interface name + "." + property name. Use g_variant_lookup() or g_variant_lookup_value() for convenient access to the values. If the #TpChannel:channel-properties property was not set during construction (e.g. by calling tp_channel_new_from_properties()), a reasonable but possibly incomplete version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until the %TP_CHANNEL_FEATURE_CORE feature is prepared. This function should be used only by #TpChannel subclasses, otherwise it is recommended to use individual property getters instead. a dictionary where the keys are strings, D-Bus interface name + "." + property name. a channel Get the D-Bus interface name representing this channel's type, if it has been discovered. This is the same as the #TpChannelIface:channel-type property; it isn't guaranteed to be non-%NULL until the %TP_CHANNEL_FEATURE_CORE feature has been prepared. the channel type, if the channel is ready; either the channel type or %NULL, if the channel is not yet ready. a channel Get the D-Bus interface name representing this channel's type, as a GQuark, if it has been discovered. This is the same as the #TpChannelIface:channel-type property, except that it is a GQuark rather than a string. It isn't guaranteed to be nonzero until the %TP_CHANNEL_FEATURE_CORE property is ready. the channel type, if the channel is ready; either the channel type or 0, if the channel is not yet ready. a channel Return the chat state for the given contact. If tp_proxy_is_prepared() would return %FALSE for the feature %TP_CHANNEL_FEATURE_CHAT_STATES, the result will always be %TP_CHANNEL_CHAT_STATE_INACTIVE. Use tp_text_channel_get_chat_state() instead. the chat state for @contact, or %TP_CHANNEL_CHAT_STATE_INACTIVE if their chat state is not known a channel a contact handle Returns the connection for this channel. The returned pointer is only valid while this channel is valid - reference it with g_object_ref() if needed. the value of #TpChannel:connection a channel Get the handle representing the contact, chatroom, etc. with which this channel communicates for its whole lifetime, or 0 if there is no such handle or it has not yet been discovered. This is the same as the #TpChannelIface:handle property. It isn't guaranteed to have its final value until the %TP_CHANNEL_FEATURE_CORE feature is ready. If @handle_type is not %NULL, the type of handle is written into it. This will be %TP_UNKNOWN_HANDLE_TYPE if the handle has not yet been discovered, or %TP_HANDLE_TYPE_NONE if there is no handle with which this channel will always communicate. This is the same as the #TpChannelIface:handle-type property. the handle a channel if not %NULL, used to return the type of this handle This channel's associated identifier, or the empty string if no identifier or unknown. This is the same as the #TpChannel:identifier property, and isn't guaranteed to be set until the %TP_CHANNEL_FEATURE_CORE property is ready. Changed in 0.11.4: as with #TpChannel:identifier, this could previously either be %NULL or the empty string if there was no suitable value. It is now non-%NULL in all cases. the identifier a channel <!-- --> the value of #TpChannel:initiator-contact a channel Return the #TpChannel:initiator-handle property New code should use tp_channel_get_initiator_contact() instead. the value of #TpChannel:initiator-handle a #TpChannel Return the #TpChannel:initiator-identifier property New code should use tp_channel_get_initiator_contact() instead. the value of #TpChannel:initiator-identifier a #TpChannel Return the #TpChannel:requested property the value of #TpChannel:requested a #TpChannel <!-- --> the value of #TpChannel:target-contact a channel If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a #GPtrArray containing its local-pending members. If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of local-pending members, or %NULL. If @self is not a group, return %NULL. a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. a channel If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a #GPtrArray containing its members. If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of members, or %NULL. If @self is not a group, return %NULL. a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. a channel If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been prepared, return a #GPtrArray containing its remote-pending members. If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, the result may either be a set of remote-pending members, or %NULL. If @self is not a group, return %NULL. a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. a channel Synopsis (see below for further explanation): - if @self is not a group or @contact is not a member of this channel, result is undefined; - if %TP_CHANNEL_FEATURE_CONTACTS has not yet been prepared, result is undefined; - if @self does not have flags that include %TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined; - if @contact is channel-specific and its globally valid "owner" is known, return that owner; - if @contact is channel-specific and its globally valid "owner" is unknown, return %NULL; - if @contact is globally valid, return @contact itself Some channels (those with flags that include %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific contacts". These are contacts that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname. Depending on the protocol and configuration, it might be possible to find out what globally valid contact (i.e. a contact that you could add to your contact list) "owns" a channel-specific contact. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can. This is further complicated by the fact that channels with channel-specific contacts can sometimes have members with globally valid contacts (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the contact representing that JID in the Group's remote-pending set). the global contact that owns the given contact, or %NULL. a channel a contact which is a member of this channel Return the #TpChannel:group-flags property (see the description of that property for notes on validity). the group flags, or 0 a channel Synopsis (see below for further explanation): - if @self is not a group or @handle is not a member of this channel, result is undefined; - if %TP_CHANNEL_FEATURE_GROUP has not yet been prepared, result is undefined; - if @self does not have flags that include %TP_CHANNEL_GROUP_FLAG_PROPERTIES, result is undefined; - if @handle is channel-specific and its globally valid "owner" is known, return that owner; - if @handle is channel-specific and its globally valid "owner" is unknown, return zero; - if @handle is globally valid, return @handle itself Some channels (those with flags that include %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of "channel-specific handles". These are handles that only have meaning within the context of the channel - for instance, in XMPP Multi-User Chat, participants in a chatroom are identified by an in-room JID consisting of the JID of the chatroom plus a local nickname. Depending on the protocol and configuration, it might be possible to find out what globally valid handle (i.e. an identifier that you could add to your contact list) "owns" a channel-specific handle. For instance, in most XMPP MUC chatrooms, normal users cannot see what global JID corresponds to an in-room JID, but moderators can. This is further complicated by the fact that channels with channel-specific handles can sometimes have members with globally valid handles (for instance, if you invite someone to an XMPP MUC using their globally valid JID, you would expect to see the handle representing that JID in the Group's remote-pending set). This function's result is undefined unless the channel is ready and its flags include %TP_CHANNEL_GROUP_FLAG_PROPERTIES (an implementation without extra D-Bus round trips is not possible using the older API). New code should use tp_channel_group_get_contact_owner() instead. the global handle that owns the given handle, or 0 a channel a handle which is a member of this channel If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its local-pending members. If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of local-pending members, or %NULL. If @self is not a group, return %NULL. New code should use tp_channel_group_dup_local_pending_contacts() instead. the local-pending members, or %NULL a channel If @local_pending is actually a local-pending contact, write additional information into @actor, @reason and @message and return %TRUE. The contact and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered. If @local_pending is not the handle of a local-pending contact, write %NULL into @actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into @reason and "" into @message, and return %FALSE. %TRUE if the contact is in fact local-pending a channel the #TpContact of a local-pending contact about whom more information is needed either %NULL or a location to return the contact who requested the change either %NULL or a location to return the reason for the change either %NULL or a location to return the user-supplied message If @local_pending is actually the handle of a local-pending contact, write additional information into @actor, @reason and @message and return %TRUE. The handle and message are not referenced or copied, and can only be assumed to remain valid until the main loop is re-entered. If @local_pending is not the handle of a local-pending contact, write 0 into @actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into @reason and "" into @message, and return %FALSE. New code should use tp_channel_group_get_local_pending_contact_info() instead. %TRUE if the contact is in fact local-pending a channel the handle of a local-pending contact about whom more information is needed either %NULL or a location to return the contact who requested the change either %NULL or a location to return the reason for the change either %NULL or a location to return the user-supplied message If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its members. If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of members, or %NULL. If @self is not a group, return %NULL. New code should use tp_channel_group_dup_members_contacts() instead. the members, or %NULL a channel If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been prepared, return a #TpIntset containing its remote-pending members. If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, the result may either be a set of remote-pending members, or %NULL. If @self is not a group, return %NULL. New code should use tp_channel_group_dup_remote_pending_contacts() instead. the remote-pending members, or %NULL a channel <!-- --> the value of #TpChannel:group-self-contact a channel Return the #TpChannel:group-self-handle property (see the description of that property for notes on validity). New code should use tp_channel_group_get_self_contact() instead. the handle representing the user, or 0 a channel Returns the same thing as the #TpChannel:channel-ready property. New code should use tp_proxy_is_prepared(), which is a more general form of this method. For group channels, this method is equivalent to checking for the combination of %TP_CHANNEL_FEATURE_CORE and %TP_CHANNEL_FEATURE_GROUP; for non-group channels, it's equivalent to checking for %TP_CHANNEL_FEATURE_CORE. One important difference is that after #TpProxy::invalidated is signalled, #TpChannel:channel-ready keeps its current value - which might be %TRUE, if the channel was successfully prepared before it became invalidated - but tp_proxy_is_prepared() returns %FALSE for all features. use tp_proxy_is_prepared() with %TP_CHANNEL_FEATURE_CORE %TRUE if introspection has completed a channel Join channel @self with @message as join message. When we joined the channel, @callback will be called. You can then call tp_channel_join_finish() to get the result of the operation. Note that unlike tp_channel_leave_async(), %TP_CHANNEL_FEATURE_GROUP feature must be prepared before calling this function. a #TpChannel the join message a callback to call when we joined the channel data to pass to @callback Completes a call to tp_channel_join_async(). %TRUE if the channel was successfully joined; %FALSE otherwise a #TpChannel a #GAsyncResult passed to the callback for tp_channel_join_async(). Leave channel @self with @reason as reason and @message as leave message. If @self doesn't implement #TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP or if for any reason we can't properly leave the channel, we close it. When we left the channel, @callback will be called. You can then call tp_channel_leave_finish() to get the result of the operation. Note that unlike tp_channel_join_async(), %TP_CHANNEL_FEATURE_GROUP feature does not have to be prepared and will be prepared for you. But this is a deprecated behaviour. a #TpChannel the leave reason the leave message a callback to call when we left the channel data to pass to @callback Completes a call to tp_channel_leave_async(). %TRUE if the channel has been left; %FALSE otherwise a #TpChannel a #GAsyncResult passed to the callback for tp_channel_leave_async(). Return the #TpChannel:password-needed property the value of #TpChannel:password-needed a #TpChannel Provide @password so that @self can be joined. This function must be called with the correct password in order for channel joining to proceed if the TpChannel:password-needed property is set. Once the password has been provided, @callback will be called. You can then call tp_channel_provide_password_finish() to get the result of the operation. a #TpChannel the password a callback to call when @password has been provided data to pass to @callback Completes a call to tp_channel_provide_password_async(). If the password was rejected, the operation fails with #TP_ERROR_AUTHENTICATION_FAILED. %TRUE if the password has been provided and accepted, %FALSE otherwise. a #TpChannel a #GAsyncResult passed to the callback for tp_channel_provide_password_async(). If @self is ready for use (introspection has finished, etc.), return immediately. Otherwise, re-enter the main loop until the channel either becomes invalid or becomes ready for use, or until the main loop stored via @loop is cancelled. Use tp_proxy_prepare_async() and re-enter the main loop yourself, or restructure your program in such a way as to avoid re-entering the main loop. %TRUE if the channel has been introspected and is ready for use, %FALSE if the channel has become invalid. a channel if not %NULL and %FALSE is returned, used to raise an error if not %NULL, a #GMainLoop is placed here while it is being run (so calling code can call g_main_loop_quit() to abort), and %NULL is placed here after the loop has been run The immutable D-Bus properties of this channel, represented by a #GHashTable where the keys are D-Bus interface name + "." + property name, and the values are #GValue instances. Read-only except during construction. If this is not provided during construction, a reasonable (but possibly incomplete) version will be made up from the values of individual properties; reading this property repeatedly may yield progressively more complete values until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE. Initially %FALSE; changes to %TRUE when tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE, and if the channel is a group, %TP_CHANNEL_FEATURE_GROUP. This is a less general form of tp_proxy_is_prepared(), which should be used in new code. One important difference is that after #TpProxy::invalidated is signalled, #TpChannel:channel-ready keeps its current value - which might be %TRUE, if the channel was successfully prepared before it became invalidated - but tp_proxy_is_prepared() returns %FALSE for all features. Change notification is via notify::channel-ready. use tp_proxy_is_prepared() with %TP_CHANNEL_FEATURE_CORE for checks, or tp_proxy_prepare_async() for notification The #TpConnection to which this #TpChannel belongs. Used for e.g. handle manipulation. If the %TP_CHANNEL_FEATURE_GROUP feature has been prepared successfully, #TpChannelGroupFlags indicating the capabilities and behaviour of that group. Otherwise, this may be 0. Change notification is via notify::group-flags or TpChannel::group-flags-changed. If this channel is a group and %TP_CHANNEL_FEATURE_CONTACTS has been prepared, and the user is a member of the group, the #TpContact representing them in this group. Otherwise, the result may be either a contact representing the user, or %NULL. Change notification is via notify::group-self-contact. If this channel is a group and %TP_CHANNEL_FEATURE_GROUP has been prepared, and the user is a member of the group, the #TpHandle representing them in this group. Otherwise, the result may be either a handle representing the user, or 0. Change notification is via notify::group-self-handle. Use #TpChannel:group-self-contact instead. This channel's associated identifier, or the empty string if it has handle type %TP_HANDLE_TYPE_NONE. For channels where #TpChannelIface:handle is non-zero, this is the result of inspecting #TpChannelIface:handle. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string. Changed in 0.11.4: this property is never %NULL. Previously, it was %NULL before an identifier was known, or when a channel with no TargetID D-Bus property had TargetHandleType %TP_HANDLE_TYPE_NONE. The #TpContact of the initiator of this channel, or %NULL if there is no particular initiator. If the channel was initiated by a remote contact, this represents that contact, and #TpChannel:requested will be %FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation. If the channel was requested by the local user, #TpChannel:requested will be %TRUE, and this property may be the #TpChannel:group-self-contact or #TpConnection:self-contact. If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be %NULL. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be %NULL. The %TP_HANDLE_TYPE_CONTACT #TpHandle of the initiator of this channel, or 0 if there is no particular initiator. If the channel was initiated by a remote contact, this handle represents that contact, and #TpChannel:requested will be %FALSE. For instance, for an incoming call this property indicates the caller, and for a chatroom invitation this property indicates who sent the invitation. If the channel was requested by the local user, #TpChannel:requested will be %TRUE, and this property may be the #TpChannel:group-self-handle or #TpConnection:self-handle. If the channel appeared for some other reason (for instance as a side-effect of connecting to the server), this property may be 0. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be 0. Use #TpChannel:initiator-contact instead. If #TpChannel:initiator-handle is 0, this will always be "". Otherwise, this will be the #TpContact:identifier of the contact with that handle. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may be the empty string. Use #TpChannel:initiator-contact instead. If %TRUE, tp_channel_provide_password_async() has to be called to be able to join the channel. This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_PASSWORD; until then, it may return %FALSE even if the channel is actually protected by a password. Preparing %TP_CHANNEL_FEATURE_PASSWORD also ensures that the notify::password-needed signal will be fired when this property changes. %TRUE if this channel was created in response to a local request, such as a call to tp_account_channel_request_create_channel_async(). %FALSE if this channel was initiated by a remote contact (the #TpChannel:initiator-handle), or if it appeared as a side-effect of some other action. For instance, this is %FALSE on incoming calls and file transfers, remotely-initiated 1-1 text conversations, and invitations to chatrooms, and %TRUE on outgoing calls and file transfers, locally-initiated 1-1 text conversations, and chatrooms joined by local user action. This is not guaranteed to be meaningful until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CORE; until then, it may return %FALSE even if the channel was actually requested. If this channel is for communication with a single contact (that is, #TpChannelIface:handle-type is %TP_HANDLE_TYPE_CONTACT), then a #TpContact representing the remote contact. For chat rooms, contact search channels and other channels without a single remote contact, %NULL. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be %NULL. Emitted when a contact's chat state changes after tp_proxy_prepare_async() has finished preparing the feature %TP_CHANNEL_FEATURE_CHAT_STATES. Use #TpTextChannel::contact-chat-state-changed instead a contact handle for the local user or another contact the new #TpChannelChatState for the contact Emitted when the group members change in a Group channel. This is not guaranteed to be emitted until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_FEATURE_CONTACTS; until then, it may be omitted. a #GPtrArray of #TpContact containing the full members added a #GPtrArray of #TpContact containing the members (full, local-pending or remote-pending) removed a #GPtrArray of #TpContact containing the local-pending members added a #GPtrArray of #TpContact containing the remote-pending members added a #TpContact for the "actor" handle in @details a #GHashTable mapping (gchar *) to #GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal. Emitted when the #TpChannel:group-flags property changes while the channel is ready. #TpChannelGroupFlags which are newly set #TpChannelGroupFlags which are no longer set Emitted when the group members change in a Group channel that is ready. Use #TpChannel::group-contacts-changed instead. an optional textual message a #GArray of #guint containing the full members added a #GArray of #guint containing the members (full, local-pending or remote-pending) removed a #GArray of #guint containing the local-pending members added a #GArray of #guint containing the remote-pending members added the #TpHandle of the contact causing the change, or 0 the reason for the change as a #TpChannelGroupChangeReason Emitted when the group members change in a Group channel that is ready. Contains a superset of the information in the TpChannel::group-members-changed signal, and is emitted at the same time; applications can connect to this signal and ignore the other. Use #TpChannel::group-contacts-changed instead. a #GArray of #guint containing the full members added a #GArray of #guint containing the members (full, local-pending or remote-pending) removed a #GArray of #guint containing the local-pending members added a #GArray of #guint containing the remote-pending members added a #GHashTable mapping (gchar *) to #GValue containing details about the change, as described in the specification of the MembersChangedDetailed signal. <![CDATA[ A set of flags representing call states. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The contact has been alerted about the call but has not responded (e.g. 180 Ringing in SIP). ]]> <![CDATA[ The contact is temporarily unavailable, and the call has been placed in a queue (e.g. 182 Queued in SIP, or call-waiting in telephony). ]]> <![CDATA[ The contact has placed the call on hold, and will not receive media from the local user or any other participants until they unhold the call again. ]]> <![CDATA[ The initiator of the call originally called a contact other than the current recipient of the call, but the call was then forwarded or diverted. ]]> <![CDATA[ Progress has been made in placing the outgoing call, but the destination contact may not have been made aware of the call yet (so the Ringing state is not appropriate). This corresponds to SIP's status code 183 Session Progress, and could be used when the outgoing call has reached a gateway, for instance. ]]> <![CDATA[ This contact has merged this call into a conference. Note that GSM provides a notification when the remote party merges a call into a conference, but not when it is split out again; thus, this flag can only indicate that the call has been part of a conference at some point. If a GSM connection manager receives a notification that a call has been merged into a conference a second time, it SHOULD represent this by clearing and immediately re-setting this flag on the remote contact. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The contact has effectively ceased participating in the chat. ]]> <![CDATA[ The contact has not been active for some time. ]]> <![CDATA[ The contact is actively participating in the chat. ]]> <![CDATA[ The contact has paused composing a message. ]]> <![CDATA[ The contact is composing a message to be sent to the chat. ]]> The class of a #TpChannel. In addition to @parent_class there are four pointers reserved for possible future use. (Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.) parent class Bitfield/set of flags generated from the Telepathy specification. <![CDATA[The search has not started]]> <![CDATA[The search is in progress]]> <![CDATA[The search has paused, but more results can be retrieved by calling More.]]> <![CDATA[The search has been completed]]> <![CDATA[The search has failed]]> One of the channel dispatcher's functions is to offer incoming channels to Approver clients for approval. An approver should generally ask the user whether they want to participate in the requested communication channels (join the chat or chatroom, answer the call, accept the file transfer, or whatever is appropriate). A collection of channels offered in this way is represented by a ChannelDispatchOperation object. If the user wishes to accept the communication channels, the approver should call tp_cli_channel_dispatch_operation_call_handle_with() to indicate the user's or approver's preferred handler for the channels (the empty string indicates no particular preference, and will cause any suitable handler to be used). If the user wishes to reject the communication channels, or if the user accepts the channels and the approver will handle them itself, the approver should call tp_cli_channel_dispatch_operation_call_claim(). If this method succeeds, the approver immediately has control over the channels as their primary handler, and may do anything with them (in particular, it may close them in whatever way seems most appropriate). There are various situations in which the channel dispatch operation will be closed, causing the #TpProxy::invalidated signal to be emitted. If this happens, the approver should stop prompting the user. Because all approvers are launched simultaneously, the user might respond to another approver; if this happens, the #TpProxy::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_OBJECT_REMOVED. If a channel closes, the #TpChannelDispatchOperation::channel-lost signal is emitted. If all channels close, there is nothing more to dispatch, so the #TpProxy::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_OBJECT_REMOVED. If the channel dispatcher crashes or exits, the #TpProxy::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_NAME_OWNER_LOST. In a high-quality implementation, the dispatcher should be restarted, at which point it will create new channel dispatch operations for any undispatched channels, and the approver will be notified again. Creating a #TpChannelDispatchOperation directly is deprecated: it should only be created via a #TpBaseClient. Since 0.16, #TpChannelDispatchOperation always has a non-%NULL #TpProxy:factory, which will be propagated to the #TpAccount, #TpConnection and #TpChannel. Convenience function to create a new channel dispatch operation proxy. The @immutable_properties argument is not yet used. Since 0.19.9. New code should get #TpChannelDispatchOperation objects from a #TpBaseClient a new reference to an channel dispatch operation proxy, or %NULL if @object_path is not syntactically valid or the channel dispatcher is not running Proxy for the D-Bus daemon The non-NULL object path of this channel dispatch operation As many as are known of the immutable D-Bus properties of this channel dispatch operation, or %NULL if none are known Ensure that the known interfaces for TpChannelDispatchOperation have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CHANNEL_DISPATCH_OPERATION. Returns the #TpAccount of this ChannelDispatchOperation. The returned pointer is only valid while @self is valid - reference it with g_object_ref() if needed. Since 0.19.9. New code should use tp_channel_dispatch_operation_get_account() instead. the value of #TpChannelDispatchOperation:account a #TpChannelDispatchOperation Returns a #GPtrArray containing the #TpChannel of this ChannelDispatchOperation. The returned array and its #TpChannel are only valid while @self is valid - copy array and reference channels with g_object_ref() if needed. Since 0.19.9. New code should use tp_channel_dispatch_operation_get_channels() instead. the value of #TpChannelDispatchOperation:channels a #TpChannelDispatchOperation Returns the #TpConnection of this ChannelDispatchOperation. The returned pointer is only valid while @self is valid - reference it with g_object_ref() if needed. Since 0.19.9. New code should use tp_channel_dispatch_operation_get_connection() instead. the value of #TpChannelDispatchOperation:connection a #TpChannelDispatchOperation Returns the immutable D-Bus properties of this channel. The returned hash table is only valid while @self is valid - reference it with g_hash_table_ref() if needed. Since 0.19.9. New code should use individual property getters like tp_channel_dispatch_operation_get_connection(), tp_channel_dispatch_operation_get_account(), tp_channel_dispatch_operation_get_channels(), or tp_channel_dispatch_operation_get_possible_handlers() instead. the value of #TpChannelDispatchOperation:cdo-properties a #TpChannelDispatchOperation Returns a #GStrv containing the possible handlers of this ChannelDispatchOperation. The returned array and its strings are only valid while @self is valid - copy it with g_strdupv if needed. Since 0.19.9. New code should use tp_channel_dispatch_operation_get_possible_handlers() instead. the value of #TpChannelDispatchOperation:possible-handlers a #TpChannelDispatchOperation Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel. If successful, this method will cause the #TpProxy::invalidated signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async(). This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case. since 0.15.0. Use tp_channel_dispatch_operation_claim_with_async() a #TpChannelDispatchOperation a callback to call when the call returns data to pass to @callback Finishes an async call to Claim(). since 0.15.0. Use tp_channel_dispatch_operation_claim_with_finish() %TRUE if the Claim() call was successful, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult Called by an approver to claim channels for handling internally. If this method is called successfully, the process calling this method becomes the handler for the channel. If successful, this method will cause the #TpProxy::invalidated signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async(). This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. The approver MUST NOT attempt to interact with the channels further in this case. This is an improved version of tp_channel_dispatch_operation_claim_async() as it tells @client about the new channels being handled. %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function. a #TpChannelDispatchOperation the #TpBaseClient claiming @self a callback to call when the call returns data to pass to @callback Finishes an async call to Claim() initiated using tp_channel_dispatch_operation_claim_with_async(). %TRUE if the Claim() call was successful, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult Called by an approver to claim channels and close them all right away. If this method is called successfully, @self has been claimed and tp_channel_close_async() has been called on all of its channels. If successful, this method will cause the #TpProxy::invalidated signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async(). This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function. a #TpChannelDispatchOperation a callback to call when the request has been satisfied data to pass to @callback Finishes an async operation initiated using tp_channel_dispatch_operation_close_channels_async(). %TRUE if the Claim() call was successful and Close() has at least been attempted on all the channels, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult Called by an approver to claim channels and destroy them all right away. If this method is called successfully, @self has been claimed and tp_channel_destroy_async() has been called on all of its channels. If successful, this method will cause the #TpProxy::invalidated signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async(). This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function. a #TpChannelDispatchOperation a callback to call when the request has been satisfied data to pass to @callback Finishes an async operation initiated using tp_channel_dispatch_operation_destroy_channels_async(). %TRUE if the Claim() call was successful and tp_channel_destroy_async() has at least been attempted on all the channels, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult Returns the #TpAccount of this ChannelDispatchOperation. The returned pointer is only valid while @self is valid - reference it with g_object_ref() if needed. the value of #TpChannelDispatchOperation:account a #TpChannelDispatchOperation Returns a #GPtrArray containing the #TpChannel of this ChannelDispatchOperation. The returned array and its #TpChannel are only valid while @self is valid - copy array and reference channels with g_object_ref() if needed. the value of #TpChannelDispatchOperation:channels a #TpChannelDispatchOperation Returns the #TpConnection of this ChannelDispatchOperation. The returned pointer is only valid while @self is valid - reference it with g_object_ref() if needed. the value of #TpChannelDispatchOperation:connection a #TpChannelDispatchOperation Returns a #GStrv containing the possible handlers of this ChannelDispatchOperation. The returned array and its strings are only valid while @self is valid - copy it with g_strdupv if needed. the value of #TpChannelDispatchOperation:possible-handlers a #TpChannelDispatchOperation Called by an approver to accept a channel bundle and request that the given handler be used to handle it. If successful, this method will cause the #TpProxy::invalidated signal to be emitted with the TP_DBUS_ERROR_OBJECT_REMOVED error code. However, this method may fail because the dispatch has already been completed and the object has already gone. If this occurs, it indicates that another approver has asked for the bundle to be handled by a particular handler. The approver MUST NOT attempt to interact with the channels further in this case, unless it is separately invoked as the handler. Approvers which are also channel handlers SHOULD use tp_channel_dispatch_operation_claim_async() instead of tp_channel_dispatch_operation_handle_with_async() to request that they can handle a channel bundle themselves. a #TpChannelDispatchOperation The well-known bus name (starting with #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the channel, or %NULL if the client has no preferred channel handler a callback to call when the call returns data to pass to @callback Finishes an async call to HandleWith(). %TRUE if the HandleWith() call was successful, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult A variant of tp_channel_dispatch_operation_handle_with_async() allowing the approver to pass an user action time. This timestamp will be passed to the Handler when HandleChannels is called. If an X server timestamp for the user action causing this method call is available, @user_action_time should be this timestamp (for instance, the result of gdk_event_get_time() if it is not %GDK_CURRENT_TIME). Otherwise, it may be %TP_USER_ACTION_TIME_NOT_USER_ACTION to behave as if there was no user action or it happened a long time ago, or %TP_USER_ACTION_TIME_CURRENT_TIME to have the Handler behave as though the user action had just happened (resembling, but not numerically equal to, %GDK_CURRENT_TIME). This method has been introduced in telepathy-mission-control 5.5.0. a #TpChannelDispatchOperation The well-known bus name (starting with #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the channel, or %NULL if the client has no preferred channel handler the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME a callback to call when the call returns data to pass to @callback Finishes an async call to HandleWithTime(). %TRUE if the HandleWithTime() call was successful, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult Called by an approver to claim channels and leave them all right away. If this method is called successfully, @self has been claimed and tp_channel_leave_async() has been called on all of its channels. If successful, this method will cause the #TpProxy::invalidated signal to be emitted, in the same way as for tp_channel_dispatch_operation_handle_with_async(). This method may fail because the dispatch operation has already been completed. Again, see tp_channel_dispatch_operation_handle_with_async() for more details. %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before calling this function. a #TpChannelDispatchOperation the leave reason the leave message a callback to call when the request has been satisfied data to pass to @callback Finishes an async operation initiated using tp_channel_dispatch_operation_leave_channels_async(). %TRUE if the Claim() call was successful and tp_channel_leave_async() has at least been attempted on all the channels, otherwise %FALSE a #TpChannelDispatchOperation a #GAsyncResult The #TpAccount with which the connection and channels are associated. Read-only except during construction. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. The immutable D-Bus properties of this ChannelDispatchOperation, represented by a #GHashTable where the keys are D-Bus interface name + "." + property name, and the values are #GValue instances. Read-only except during construction. If this is not provided during construction, it is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. A #GPtrArray containing the #TpChannel to be dispatched. Read-only. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. The #TpConnection with which the channels are associated. Read-only except during construction. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. A #GStrv containing the well known bus names (starting with TP_CLIENT_BUS_NAME_BASE) of the possible Handlers for the channels Read-only except during construction. This is not guaranteed to be set until tp_proxy_prepare_async() has finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. Emitted when a channel has closed before it could be claimed or handled. the #TpChannel that closed domain of a #GError indicating why the channel has been closed error code of a #GError indicating why the channel has been closed a message associated with the error The class of a #TpChannelDispatchOperation. The Channel Dispatcher's main D-Bus API is used to request channels, which is done by calling tp_cli_channel_dispatcher_call_create_channel() or tp_cli_channel_dispatcher_call_ensure_channel() as appropriate. The Telepathy Channel Dispatcher is also responsible for responding to new channels and launching client processes to handle them. However, clients that can work with incoming channels do not have to call methods on the channel dispatcher: instead, they must register with the channel dispatcher passively, by taking a bus name starting with %TP_CLIENT_BUS_NAME_BASE and implementing the #TpSvcClient interface. See the Telepathy D-Bus Interface Specification for details. This proxy is usable but incomplete: convenience methods will be added in a later version of telepathy-glib, along with a mechanism similar to tp_connection_call_when_ready(). Convenience function to create a new channel dispatcher proxy. a new reference to a channel dispatcher proxy Proxy for the D-Bus daemon Ensure that the known interfaces for TpChannelDispatcher have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CHANNEL_DISPATCHER. Asynchronously calls PresentChannel on the ChannelDispatcher to ask to the handler of @channel to re-present it to the user. You can then call tp_channel_dispatcher_present_channel_finish() to get the result of the operation. a #TpChannelDispatcher a #TpChannel the time at which user action occurred, or #TP_USER_ACTION_TIME_NOT_USER_ACTION if this presentation request is for some reason not involving user action. a callback to call when the request is satisfied data to pass to @callback Finishes an async channel presentation request started using tp_channel_dispatcher_present_channel_async(). %TRUE if the call succeeded, otherwise %FALSE. a #TpBaseClient a #GAsyncResult The class of a #TpChannelDispatcher. <![CDATA[ The reason for a set of handles to move to one of Members, LocalPendingMembers or RemotePendingMembers, or to be removed from the group. A client may supply a reason when attempting to remove members from a group with RemoveMembersWithReason, and reasons are supplied by the CM when emitting MembersChanged and MembersChangedDetailed. Some reason codes have different meanings depending on the Actor in a MembersChanged signal. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ No reason was provided for this change. In particular, this reason SHOULD be used when representing users joining a named chatroom in the usual way, users leaving a chatroom by their own request, and normal termination of a StreamedMedia call by the remote user. If the SelfHandle is removed from a group for this reason and the actor is not the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Terminated. If the SelfHandle is removed from a group for this reason and the actor is also the SelfHandle, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled. ]]> <![CDATA[ The change is due to a user going offline. Also used when user is already offline, but this wasn't known previously. If a one-to-one StreamedMedia call fails because the contact being called is offline, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Offline. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If a handle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Offline. ]]> <![CDATA[ The change is due to a kick operation. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Kicked. ]]> <![CDATA[ The change is due to a busy indication. If a one-to-one StreamedMedia call fails because the contact being called is busy, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason Busy. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Busy. ]]> <![CDATA[ The change is due to an invitation. This reason SHOULD only be used when contacts are added to the remote-pending set (to indicate that the contact has been invited) or to the members (to indicate that the contact has accepted the invitation). Otherwise, what would it mean? ]]> <![CDATA[ The change is due to a kick+ban operation. If the SelfHandle is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Channel.Banned. ]]> <![CDATA[ The change is due to an error occurring. ]]> <![CDATA[ The change is because the requested contact does not exist. For instance, if the user invites a nonexistent contact to a chatroom or attempts to call a nonexistent contact, this could be indicated by the CM adding that contact's handle to remote-pending for reason None or Invited, then removing it for reason Invalid_Contact. In the case of a 1-1 StreamedMedia call, the CM SHOULD remove the self handle from the Group in the same signal. For 1-1 calls, the call terminates as a result of removing the remote contact, so the SelfHandle should be removed at the same time as the remote contact and for the same reason. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.DoesNotExist. ]]> <![CDATA[ The change is because the requested contact did not respond. If a one-to-one StreamedMedia call fails because the contact being called did not respond, or the local user did not respond to an incoming call, the connection manager SHOULD indicate this by removing both the SelfHandle and the other contact's handle from the Group interface with reason No_Answer. Documenting existing practice. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.NoAnswer. ]]> <![CDATA[ The change is because a contact's unique identifier changed. There must be exactly one handle in the removed set and exactly one handle in one of the added sets. The Renamed signal on the Renaming interface will have been emitted for the same handles, shortly before this MembersChanged signal is emitted. ]]> <![CDATA[ The change is because there was no permission to contact the requested handle. If a contact is removed from a group for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.PermissionDenied. ]]> <![CDATA[ If members are removed with this reason code, the change is because the group has split into unconnected parts which can only communicate within themselves (e.g. netsplits on IRC use this reason code). If members are added with this reason code, the change is because unconnected parts of the group have rejoined. If this channel carries messages (e.g. Text or Tubes channels) applications must assume that the contacts being added are likely to have missed some messages as a result of the separation, and that the contacts in the group are likely to have missed some messages from the contacts being added. Note that from the added contacts' perspective, they have been in the group all along, and the contacts we indicate to be in the group (including the local user) have just rejoined the group with reason Separated. Application protocols in Tubes should be prepared to cope with this situation. The SelfHandle SHOULD NOT be removed from channels with this reason. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The AddMembers method can be used to add or invite members who are not already in the local pending list (which is always valid). ]]> <![CDATA[ The RemoveMembers method can be used to remove channel members (removing those on the pending local list is always valid). ]]> <![CDATA[ The RemoveMembers method can be used on people on the remote pending list. ]]> <![CDATA[ A message may be sent to the server when calling AddMembers on contacts who are not currently pending members. ]]> <![CDATA[ A message may be sent to the server when calling RemoveMembers on contacts who are currently channel members. ]]> <![CDATA[ A message may be sent to the server when calling AddMembers on contacts who are locally pending. ]]> <![CDATA[ A message may be sent to the server when calling RemoveMembers on contacts who are locally pending. ]]> <![CDATA[ A message may be sent to the server when calling RemoveMembers on contacts who are remote pending. ]]> <![CDATA[ The members of this group have handles which are specific to this channel, and are not valid as general-purpose handles on the connection. Depending on the channel, it may be possible to check the HandleOwners property or call GetHandleOwners to find the owners of these handles, which should be done if you wish to (e.g.) subscribe to the contact's presence. Connection managers must ensure that any given handle is not simultaneously a general-purpose handle and a channel-specific handle. ]]> <![CDATA[ Placing a contact in multiple groups of this type is not allowed and will raise NotAvailable (on services where contacts may only be in one user-defined group, user-defined groups will have this flag). ]]> <![CDATA[ In rooms with channel specific handles (ie Channel_Specific_Handles flag is set), this flag indicates that no handle owners are available, apart from the owner of the SelfHandle. This used to be an important optimization to avoid repeated GetHandleOwners calls, before we introduced the HandleOwners property and HandleOwnersChanged signal. ]]> <![CDATA[ This flag indicates that all the properties introduced in specification 0.17.6 are fully supported. ]]> <![CDATA[ Indicates that MembersChangedDetailed will be emitted for changes to this group's members in addition to MembersChanged. Clients can then connect to the former and ignore emission of the latter. This flag's state MUST NOT change over the lifetime of a channel. If it were allowed to change, client bindings would have to always connect to MembersChanged just in case the flag ever went away (and generally be unnecessarily complicated), which would mostly negate the point of having this flag in the first place. ]]> <![CDATA[ A message may be sent to the server when calling RemoveMembers on the SelfHandle. This would be set for XMPP Multi-User Chat or IRC channels, but not for a typical implementation of streamed media calls. ]]> An iterator over the #TpChannelManager objects known to a #TpBaseConnection. It has no public fields. Use tp_base_connection_channel_manager_iter_init() to start iteration and tp_base_connection_channel_manager_iter_next() to continue. <![CDATA[ The channel-type-specific capability flags used for Channel.Type.StreamedMedia in the Connection.Interface.Capabilities interface. See the InitialAudio property for details of the mechanisms that will replace this. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The handle is capable of using audio streams within a media channel. ]]> <![CDATA[ The handle is capable of using video streams within a media channel. ]]> <![CDATA[ The handle is capable of performing STUN to traverse NATs. ]]> <![CDATA[ The handle is capable of establishing Google Talk peer-to-peer connections (as implemented in libjingle 0.3) to traverse NATs. ]]> <![CDATA[ The handle is capable of establishing ICE UDP peer-to-peer connections (as defined by the IETF MMUSIC working group) to traverse NATs. ]]> <![CDATA[ Channels whose target handle is this contact will have ImmutableStreams = True. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The ProvidePassword method must be called now for the user to join the channel ]]> <![CDATA[ The RoomConfig1.PasswordHint contains a hint for the password. ]]> Requesting a channel from the channel dispatcher can take some time, so an object is created in the channel dispatcher to represent each request. This proxy represents one of those objects. Any client can call tp_cli_channel_request_call_cancel() at any time to attempt to cancel the request. On success, the #TpChannelRequest::succeeded signal will be emitted. Immediately after that, the #TpProxy::invalidated signal will be emitted, with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_OBJECT_REMOVED (this is not an error condition, it merely indicates that the channel request no longer exists). On failure, the #TpProxy::invalidated signal will be emitted with some other suitable error, usually from the %TP_ERROR domain. If the channel dispatcher crashes or exits, the #TpProxy::invalidated signal will be emitted with the domain %TP_DBUS_ERRORS and the error code %TP_DBUS_ERROR_NAME_OWNER_LOST. Creating a #TpChannelRequest directly is deprecated: it should only be created via a #TpAccountChannelRequest or a #TpBaseClient. Since 0.16, #TpChannelRequest always has a non-%NULL #TpProxy:factory, and its #TpProxy:factory will be propagated to the #TpAccount, #TpConnection and #TpChannel. Convenience function to create a new channel request proxy. If the channel request was newly created, the client making the request is responsible for calling tp_cli_channel_request_call_proceed() when it is ready for the channel request to proceed. Since 0.19.9. New code should get #TpChannelRequest objects from a #TpBaseClient a new reference to an channel request proxy, or %NULL if @object_path is not syntactically valid or the channel dispatcher is not running Proxy for the D-Bus daemon The non-NULL object path of this channel request As many as are known of the immutable D-Bus properties of this channel request, or %NULL if none are known Ensure that the known interfaces for TpChannelRequest have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CHANNEL_REQUEST. Return the #TpChannelRequest:hints-vardict property the value of #TpChannelRequest:hints-vardict a #TpChannelRequest Return the #TpChannelRequest:immutable-properties-vardict property. the value of #TpChannelRequest:immutable-properties-vardict a #TpChannelRequest Return the value of the #TpChannelRequest:account construct-only property the value of #TpChannelRequest:account a #tpchannelrequest Return the #TpChannelRequest:hints property the value of #TpChannelRequest:hints a #TpChannelRequest Return the #TpChannelRequest:immutable-properties construct-only property the value of #TpChannelRequest:immutable-properties a #TpChannelRequest return the #TpChannelRequest:preferred-handler construct-only property the value of #TpChannelRequest:preferred-handler a #tpchannelrequest return the #TpChannelRequest:user-action-time construct-only property the value of #TpChannelRequest:user-action-time a #tpchannelrequest Change the value of the #TpChannelRequest:channel-factory property. since 0.15.5. Use #TpProxy:factory instead. a #TpChannelRequest an object implementing the #TpClientChannelFactoryInterface interface The #TpAccount on which this request was made, not guaranteed to be prepared. Read-only. The object implementing the #TpClientChannelFactoryInterface interface that will be used to create channel proxies when the #TpChannelRequest::succeeded-with-channel signal is fired. This property can be changed using tp_channel_request_set_channel_factory(). If no channel factory is specified then #TpAutomaticProxyFactory is used. since 0.15.5. Use #TpProxy:factory instead. A #TP_HASH_TYPE_STRING_VARIANT_MAP of metadata provided by the channel requester; or %NULL if #TpChannelRequest:immutable-properties is not defined or if no hints has been defined. Read-only. A %G_VARIANT_TYPE_VARDICT of metadata provided by the channel requester; or %NULL if #TpChannelRequest:immutable-properties is not defined or if no hints have been defined. Read-only. The immutable D-Bus properties of this channel request, represented by a #GHashTable where the keys are D-Bus interface name + "." + property name, and the values are #GValue instances. Note that this property is set only if the immutable properties have been set during the construction of the #TpChannelRequest. Read-only except during construction. The immutable D-Bus properties of this channel request, represented by a %G_VARIANT_TYPE_VARDICT where the keys are D-Bus interface name + "." + property name. Note that this property is set only if the immutable properties have been set during the construction of the #TpChannelRequest. Read-only except during construction. Either the well-known bus name (starting with #TP_CLIENT_BUS_NAME_BASE) of the preferred handler for this channel request, or %NULL to indicate that any handler would be acceptable. Read-only. The time at which user action occurred, or #TP_USER_ACTION_TIME_NOT_USER_ACTION if this channel request is for some reason not involving user action. Read-only. Emitted when the channel request succeeds. since 0.13.14. Use #TpChannelRequest::succeeded-with-channel, which provides the resulting channel, instead. Emitted when the channel request succeeds. With telepathy-mission-control version 5.7.1 and earlier, @connection and @channel will be %NULL. When using newer versions, they will be correctly set to the newly-created channel, and the connection which owns it. The #TpChannel is created using #TpChannelRequest:channel-factory or #TpProxy:factory but the features of the factory are NOT prepared. It's up to the user to prepare the features returned by tp_simple_client_factory_dup_channel_features() himself. the #TpConnection of @channel, or %NULL the #TpChannel created, or %NULL The class of a #TpChannelRequest. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The incoming message was truncated to a shorter length by the server or the connection manager. ]]> <![CDATA[ The incoming message contained non-text content which cannot be represented by this interface, but has been signalled in the Messages interface. Connection managers SHOULD only set this flag if the non-text content appears to be relatively significant (exactly how significant is up to the implementor). The intention is that if this flag is set, clients using this interface SHOULD inform the user that part of the message was not understood. ]]> <![CDATA[ The incoming message was part of a replay of message history. In XMPP multi-user chat, a few past messages are replayed when you join a chatroom. A sufficiently capable IRC connection manager could also set this flag on historical messages when connected to a proxy like bip or irssi-proxy. The existence of this flag allows loggers and UIs to use better heuristics when eliminating duplicates (a simple implementation made possible by this flag would be to avoid logging scrollback at all). ]]> <![CDATA[ The incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (the channel in which the message now appears) to open. This means that a logger (which should already have seen the message in the previous channel) is able to recognise and ignore these replayed messages. ]]> <![CDATA[ The type of message. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ An ordinary chat message. Unknown types SHOULD be treated like this. ]]> <![CDATA[ An action which might be presented to the user as "* <sender> <action>", such as an IRC CTCP ACTION (typically selected by the "/me" command). For example, the text of the message might be "drinks more coffee". ]]> <![CDATA[ A one-off or automated message not necessarily expecting a reply ]]> <![CDATA[ An automatically-generated reply message. ]]> <![CDATA[ A delivery report. This message type MUST NOT appear unless the channel supports the Messages interface; see Message_Part for the format that delivery reports must take. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ An unknown error occurred ]]> <![CDATA[ The requested contact was offline ]]> <![CDATA[ The requested contact is not valid ]]> <![CDATA[ The user does not have permission to speak on this channel ]]> <![CDATA[ The outgoing message was too long and was rejected by the server ]]> <![CDATA[ The channel doesn't support sending text messages to the requested contact ]]> Signature of a callback passed to tp_channel_call_when_ready(), which will be called exactly once, when the channel becomes ready or invalid (whichever happens first) the channel (which may be in the middle of being disposed, if error is non-%NULL, error->domain is TP_DBUS_ERRORS and error->code is TP_DBUS_ERROR_PROXY_UNREFERENCED) %NULL if the channel is ready for use, or the error with which it was invalidated if it is now invalid whatever was passed to tp_channel_call_when_ready() Opaque typedef representing a #GObject that implements the %TP_TYPE_CLIENT_CHANNEL_FACTORY interface. Function called when a channel need to be created. Implementation can return a subclass of #TpChannel if they need to. Changed in 0.13.6: the function's signature was previously wrong; it expected an object instance as its first parameter, but the type of the parameter was the type of the interface vtable. a new channel proxy, or %NULL on invalid arguments a client channel factory a #TpConnection the object path of the channel the immutable properties of the channel Return a zero terminated #GArray containing the #TpChannel features that should be prepared on @channel. Changed in 0.13.6: the function's signature was previously wrong; it expected an object instance as its first parameter, but the type of the parameter was the type of the interface vtable. a newly allocated #GArray a client channel factory a #TpChannel Interface for a channel factory the parent Opaque structure representing a message in the Telepathy messages interface (client side). A convenient function to create a new #TpClientMessage a newly allocated #TpClientMessage having only the header part. A convenient function to create a new #TpClientMessage having 'text/plain' as 'content-type', @type as 'message-type' and @text as 'content'. a newly allocated #TpClientMessage the type of message content of the messsage Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ This parameter is required for connecting to the server. ]]> <![CDATA[ This parameter is required for registering an account on the server. ]]> <![CDATA[ This parameter has a default value, which is returned in GetParameters; not providing this parameter is equivalent to providing the default. ]]> <![CDATA[ This parameter should be considered private or secret; for instance, clients should store it in a "password safe" like gnome-keyring or kwallet, omit it from debug logs, and use a text input widget that hides the value of the parameter. (Clients that support older connection managers may also treat any parameter whose name contains "password" as though it had this flag.) ]]> <![CDATA[ This parameter is also a D-Bus property on the resulting Connection; a parameter named com.example.Duck.Macaroni with this flag corresponds to the Macaroni property on the com.example.Duck interface. Its value can be queried and possibly changed on an existing Connection using methods on the org.freedesktop.DBus.Properties interface. When a new value for a parameter with this flag is passed to Account.UpdateParameters, the account manager will attempt to update its value on any running connections. Similarly, if the parameter also has the Has_Default flag, and is passed in the second argument to UpdateParameters, the default value will be applied to any running connections. Thus, clients generally do not need to directly access or update the connection property; instead, they SHOULD manipulate Account.Parameters. This allows runtime-configurable options to be stored and maintained by the AccountManager, without needing to invent a separate account preference for “properties that should be set on the connection as soon as it is created”. It was originally invented to manage Cellular preferences. ]]> A proxy object for a Telepathy connection. There are no interesting public struct fields. (Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.) <!-- --> Use tp_simple_client_factory_ensure_connection() instead. a new connection proxy, or %NULL if unique-name resolution fails or on invalid arguments a D-Bus daemon; may not be %NULL the well-known or unique name of the connection process; if well-known, this function will make a blocking call to the bus daemon to resolve the unique name. May be %NULL if @object_path is not, in which case a well-known name will be derived from @object_path. the object path of the connection process. May be %NULL if @bus_name is a well-known name, in which case the object path will be derived from @bus_name. Ensure that the known interfaces for TpConnection have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CONNECTION. Compares @p1 and @p2 like strcmp(). @p1 > @p2 means @p1 is more available than @p2. The order used is: available > busy > away > xa > hidden > offline > error > unknown > unset -1, 0 or 1, if @p1 is <, == or > than @p2. a #TpConnectionPresenceType a #TpConnectionPresenceType Subscribe to any opt-in change notifications for @interested_in. For contact information, use #TpContact instead, which will call this automatically. a connection a string identifying an interface or part of an interface to which this connection will subscribe Subscribe to any opt-in change notifications for @interested_in. Equivalent to, but a little more efficient than, calling tp_connection_add_client_interest() for the string value of @interested_in. a connection a quark identifying an interface or part of an interface to which this connection will subscribe Add the given @contacts to the given @group, creating it if necessary. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. a #TpConnection the group to alter. The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to include in the group. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_add_to_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult For each of the given @contacts, request that the local user's presence is sent to that contact, i.e. that their #TpContact:publish-state property becomes %TP_SUBSCRIPTION_STATE_YES. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to authorize a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_authorize_publication_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Binds the :status of @self to the boolean property of another object using a #GBinding such that the @target_property will be set to %TRUE when @self is connected (and @invert is %FALSE). @target_property will be synchronised immediately (%G_BINDING_SYNC_CREATE). @invert can be interpreted as analogous to %G_BINDING_INVERT_BOOLEAN. For instance, this function can be used to bind the GtkWidget:sensitive property to only make a widget sensitive when the account is connected. See g_object_bind_property() for more information. the #GBinding instance representing the binding between the @self and the @target. The binding is released whenever the #GBinding reference count reaches zero. a #TpConnection the target #GObject the property on @target to bind (must be %G_TYPE_BOOLEAN) %TRUE if you wish to invert the value of @target_property (i.e. %FALSE if connected) Direct the server to block @contacts. a #TpConnection the number of contacts in @contacts (must be at least 1) An array of #TpContact objects to block If %TRUE, report these contacts as abusive to the server administrators as well as blocking them. See #TpConnection:can-report-abusive to discover whether reporting abuse is supported. If #TpConnection:can-report-abusive is %FALSE, this parameter will be ignored. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_block_contacts_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult If @self is ready for use or has been invalidated, call @callback immediately, then return. Otherwise, arrange for @callback to be called when @self either becomes ready for use or becomes invalid. Note that if the connection is not in state CONNECTED, the callback will not be called until the connection either goes to state CONNECTED or is invalidated (e.g. by going to state DISCONNECTED or by becoming unreferenced). In particular, this method does not call Connect(). Call tp_cli_connection_call_connect() too, if you want to do that. Use tp_proxy_prepare_async() a connection called when the connection becomes ready or invalidated, whichever happens first arbitrary user-supplied data passed to the callback <!-- --> the value of #TpConnection:can-report-abusive a #TpConnection Disconnect the connection. This method is intended for use by AccountManager implementations, such as Mission Control. To disconnect a connection managed by an AccountManager, either use tp_account_request_presence_async() or tp_account_set_enabled_async(), depending whether the intention is to put the account offline temporarily, or disable it longer-term. a #TpConnection a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_connection_disconnect_async(). %TRUE if the call was successful, otherwise %FALSE a #TpConnection a #GAsyncResult Create a #TpContact object and make any asynchronous method calls necessary to ensure that all the features specified in @features are ready for use (if they are supported at all). It is not an error to put features in @features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers. A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED feature prepared A strings representing the desired contact by its identifier in the IM protocol (an XMPP JID, SIP URI, MSN Passport, AOL screen-name etc.) The number of features in @features (may be 0) An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if @n_features is 0) A user callback to call when the contact is ready Data to pass to the callback Finishes tp_connection_dup_contact_by_id_async(). a #TpContact or %NULL on error. a #TpConnection a #GAsyncResult Try to return an existing contact object or create a new contact object immediately. If tp_connection_has_immortal_handles() would return %TRUE and @identifier is non-%NULL, this function always succeeds. On connections without immortal handles, it is not possible to guarantee that @handle remains valid without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a #TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_id(). Similarly, if @identifier is %NULL, it might not be possible to find the identifier for @handle without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a #TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_handle(). a contact or %NULL a connection a handle of type %TP_HANDLE_TYPE_CONTACT the normalized identifier (XMPP JID, etc.) corresponding to @handle, or %NULL if not known Returns a newly allocated #GList of supported contact info fields for this connection. The list must be freed with tp_contact_info_spec_list_free(). To wait for valid supported fields, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO. This property cannot change after @self goes to the Connected state. a #GList of #TpContactInfoFieldSpec struct, or %NULL if the feature is not yet prepared or the connection doesn't have the necessary properties. a connection Retrieves the user's contact list. In general, blocked contacts are not included in this list. The #TpContact objects returned are guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. Before calling this method, you must first call tp_proxy_prepare_async() with the %TP_CONNECTION_FEATURE_CONTACT_LIST feature, and verify that #TpConnection:contact-list-state is set to %TP_CONTACT_LIST_STATE_SUCCESS. a new #GPtrArray of #TpContact. Use g_ptr_array_unref() when done. a #TpConnection If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). Otherwise, return %NULL, without altering @details. a D-Bus error name, or %NULL. a connection optionally used to return a %G_VARIANT_TYPE_VARDICT with details of the error Return the the #TpAccount associated with this connection. Will return %NULL if @self was not acquired from a #TpAccount via tp_account_get_connection(), or if the account object got finalized in the meantime (#TpConnection does not keep a strong ref on its #TpAccount). the account associated with this connection, or %NULL. a connection To wait for valid avatar requirements, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS. This property cannot change after @self goes to the Connected state. a #TpAvatarRequirements struct, or %NULL if the feature is not yet prepared or the connection doesn't have the necessary properties. a connection If @self has a valid account balance, returns %TRUE and sets the variables pointed to by @balance, @scale and @currency to the appropriate fields of the Balance.AccountBalance property. The monetary value of the balance is expressed as a fixed-point number, @balance, with a decimal scale defined by @scale; for instance a @balance of 1234 with @scale of 2 represents a value of "12.34" in the currency represented by @currency. Requires %TP_CONNECTION_FEATURE_BALANCE to be prepared. %TRUE if the balance is valid (and the values set), %FALSE if the balance is invalid. a #TpConnection a pointer to store the account balance (or %NULL) a pointer to store the balance scale (or %NULL) a pointer to store the balance currency (or %NULL) The value of Balance.ManageCreditURI. Requires %TP_CONNECTION_FEATURE_BALANCE to be prepared. the #TpConnection:balance-uri property. a #TpConnection <!-- --> the value of #TpConnection:blocked-contacts a #TpConnection <!-- --> the value of #TpConnection:can-change-contact-list property a #TpConnection <!-- --> the same #TpCapabilities as the #TpConnection:capabilities property a connection <!-- --> the same as the #TpConnection:cm-name property a #TpConnection <!-- --> Use tp_connection_get_cm_name() instead. the same as the #TpConnection:connection-manager-name property a #TpConnection Return (via a callback) any number of attributes of the given handles. Since telepathy-glib version 0.13.8, the handles will remain valid until @connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, if @hold was %TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles(). This is a thin wrapper around the GetContactAttributes D-Bus method, and should be used in preference to tp_cli_connection_interface_contacts_call_get_contact_attributes(); mixing this function, tp_connection_hold_handles(), tp_connection_unref_handles(), and #TpContact with direct use of the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods is unwise, as #TpConnection and #TpContact perform client-side reference counting of handles. The #TpContact API provides a higher-level abstraction which should usually be used instead. @callback will later be called with the attributes of those of the given handles that were valid. Invalid handles are simply omitted from the parameter to the callback. If @hold is %TRUE, the @callback is given one reference to each handle that appears as a key in the callback's @attributes parameter. Use tp_simple_client_factory_ensure_contact() instead. a connection the timeout in milliseconds, or -1 to use the default the number of handles in @handles (must be at least 1) an array of handles a #GStrv of interfaces if %TRUE, the callback will hold one reference to each valid handle called on success or failure (unless @weak_object has become unreferenced) arbitrary user-supplied data called to destroy @user_data after calling @callback, or when @weak_object becomes unreferenced (whichever occurs sooner) if not %NULL, an object to be weakly referenced: if it is destroyed, @callback will not be called <!-- --> the value of #TpConnection:contact-groups a #TpConnection Returns the flags describing how contact info (vCards) behaves on this connection To wait for valid contact info flags, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO. This property cannot change after @self goes to the Connected state. a set of #TpContactInfoFlags a connection Returns a newly allocated #GList of supported contact info fields for this connection. The list must be freed with g_list_free() after used. Note that the #TpContactInfoFieldSpec<!-- -->s in the returned #GList are not dupped before returning from this function. One could copy every item in the list using tp_contact_info_field_spec_copy(). To wait for valid supported fields, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO. This property cannot change after @self goes to the Connected state. Since 0.19.9. New code should use tp_connection_dup_contact_info_supported_fields() instead. a #GList of #TpContactInfoFieldSpec struct, or %NULL if the feature is not yet prepared or the connection doesn't have the necessary properties. a connection Return (via a callback) the contacts on the contact list and any number of their attributes. Since telepathy-glib version 0.13.8, the handles will remain valid until @connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, if @hold was %TRUE, the callback would hold a reference to them which could be released with tp_connection_unref_handles(). This is a thin wrapper around the RequestContactList D-Bus method, and should be used in preference to lower-level functions; it is similar to tp_connection_get_contact_attributes(). The #TpContact API provides a higher-level abstraction which should usually be used instead. If @hold is %TRUE, the @callback is given a reference to each handle that appears as a key in the callback's @attributes parameter. Use tp_connection_dup_contact_list() instead. a connection the timeout in milliseconds (using a large timeout is recommended) a #GStrv of interfaces if %TRUE, the callback will hold one reference to each handle it receives called on success or failure (unless @weak_object has become unreferenced) arbitrary user-supplied data called to destroy @user_data after calling @callback, or when @weak_object becomes unreferenced (whichever occurs sooner) if not %NULL, an object to be weakly referenced: if it is destroyed, @callback will not be called <!-- --> the value of #TpConnection:contact-list-persists property a #TpConnection <!-- --> the value of #TpConnection:contact-list-state property a #TpConnection Create a number of #TpContact objects and make asynchronous method calls to hold their handles and ensure that all the features specified in @features are ready for use (if they are supported at all). It is not an error to put features in @features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers. Use tp_simple_client_factory_ensure_contact() instead. A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED feature prepared The number of handles in @handles (must be at least 1) An array of handles of type %TP_HANDLE_TYPE_CONTACT representing the desired contacts The number of features in @features (may be 0) An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if @n_features is 0) A user callback to call when the contacts are ready Data to pass to the callback Called to destroy @user_data either after @callback has been called, or if the operation is cancelled An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled Create a number of #TpContact objects and make asynchronous method calls to obtain their handles and ensure that all the features specified in @features are ready for use (if they are supported at all). It is not an error to put features in @features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers. Use tp_connection_dup_contact_by_id_async() instead. A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED feature prepared The number of IDs in @ids (must be at least 1) An array of strings representing the desired contacts by their identifiers in the IM protocol (XMPP JIDs, SIP URIs, MSN Passports, AOL screen-names etc.) The number of features in @features (may be 0) An array of features that must be ready for use (if supported) before the callback is called (may be %NULL if @n_features is 0) A user callback to call when the contacts are ready Data to pass to the callback Called to destroy @user_data either after @callback has been called, or if the operation is cancelled An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled If the connection has disconnected, return the D-Bus error name with which it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). Otherwise, return %NULL, without altering @details. a D-Bus error name, or %NULL. a connection optionally used to return a map from string to #GValue, which must not be modified or destroyed by the caller <!-- --> the value of #TpConnection:disjoint-groups a #TpConnection <!-- --> the value of #TpConnection:group-storage a #TpConnection <!-- --> the same as the #TpConnection:protocol-name property a #TpConnection <!-- --> the value of #TpConnection:request-uses-message property a #TpConnection Return a #TpContact representing the local user on this connection. The returned object is not necessarily valid after the main loop is re-entered; ref it with g_object_ref() if you want to keep it. the value of the TpConnection:self-contact property, which may be %NULL a connection Return the %TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if the self-handle is not known yet or the connection has become invalid (the TpProxy::invalidated signal). The returned handle is not necessarily valid forever (the notify::self-handle signal will be emitted if it changes, which can happen on protocols such as IRC). Construct a #TpContact object if you want to track the local user's identifier in the protocol, or other information like their presence status, over time. Use tp_connection_get_self_contact() instead. the value of the TpConnection:self-handle property a connection If @reason is not %NULL it is set to the reason why "status" changed to its current value, or %TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. This connection's status, or %TP_UNKNOWN_CONNECTION_STATUS if we don't know yet. a connection a TpConnectionStatusReason, or %NULL Return %TRUE if this connection is known to not destroy handles (#TpHandle) until it disconnects. On such connections, if you know that a handle maps to a particular identifier now, then you can rely on that handle mapping to that identifier for the whole lifetime of the connection. %TRUE if handles last as long as the connection itself a connection Hold (ensure a reference to) the given handles, if they are valid. If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error. This function, along with tp_connection_unref_handles(), tp_connection_get_contact_attributes() and #TpContact, keeps a client-side reference count of handles; you should not use the RequestHandles, HoldHandles and GetContactAttributes D-Bus methods directly as well as these functions. Holding handles is not needed with Connection Managers having immortal handles (any Connection Manager using telepathy-glib >= 0.13.8). Other Connection Managers are considered deprecated, clients wanting to still support them should continue using this deprecated function. a connection the timeout in milliseconds, or -1 to use the default the handle type the number of handles in @handles (must be at least 1) an array of handles called on success or failure (unless @weak_object has become unreferenced) arbitrary user-supplied data called to destroy @user_data after calling @callback, or when @weak_object becomes unreferenced (whichever occurs sooner) if not %NULL, an object to be weakly referenced: if it is destroyed, @callback will not be called Returns the same thing as the #TpConnection:connection-ready property. use tp_proxy_is_prepared() with %TP_CONNECTION_FEATURE_CONNECTED %TRUE if introspection has completed a connection If the object path of @connection is in the correct form, set @protocol and @cm_name, return TRUE. Otherwise leave them unchanged and return FALSE. Use tp_connection_get_protocol_name() and tp_connection_get_connection_manager_name() instead. TRUE if the object path was correctly parsed, FALSE otherwise. a connection If not NULL, used to return the protocol of the connection If not NULL, used to return the connection manager name of the connection Requests to refresh the #TpContact:contact-info property on each contact from @contacts, requesting it from the network if an up-to-date version is not cached locally. "notify::contact-info" will be emitted when the contact's information are updated. If %TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on a contact, it will be set before its property gets updated. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects associated with @self Remove the given @contacts from the contact list entirely. It is protocol-dependent whether this works, and under which circumstances. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to remove a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_remove_contacts_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Remove the given @contacts from the given @group. If there are no members left in the group afterwards, the group MAY itself be removed. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. a #TpConnection the group to alter. The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to remove from the group. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_remove_from_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Remove all members from the given group, then remove the group itself. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. a #TpConnection the group to remove. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_remove_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Rename the given @old_name. On protocols where groups behave like tags, this is an API short-cut for adding all of the group's members to a group with the new name, then removing the old group. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. a #TpConnection the group to rename the new name for the group a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_rename_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Request the handles corresponding to the given identifiers, and if they are valid, hold (ensure a reference to) the corresponding handles. If they are valid, the callback will later be called with the given handles; if not all of them are valid, the callback will be called with an error. If @handle_type is TP_HANDLE_TYPE_CONTACT, use tp_connection_dup_contact_by_id_async() instead. For channel requests, use tp_account_channel_request_set_target_id() instead. a connection the timeout in milliseconds, or -1 to use the default the handle type an array of string identifiers for which handles are required, terminated by %NULL (must not be %NULL or empty) called on success or failure (unless @weak_object has become unreferenced) arbitrary user-supplied data called to destroy @user_data after calling @callback, or when @weak_object becomes unreferenced (whichever occurs sooner) if not %NULL, an object to be weakly referenced: if it is destroyed, @callback will not be called Request that the given @contacts allow the local user to subscribe to their presence, i.e. that their #TpContact:subscribe-state property becomes %TP_SUBSCRIPTION_STATE_YES. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to whom requests are to be sent. an optional plain-text message from the user, to send to those @contacts with the subscription request. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_request_subscription_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult If @self is connected and ready for use, return immediately. Otherwise, call Connect() (unless @connect is %FALSE) and re-enter the main loop until the connection becomes invalid, the connection connects successfully and is introspected, or the main loop stored via @loop is cancelled. Use tp_proxy_prepare_async() and re-enter the main loop yourself, or restructure your program in such a way as to avoid re-entering the main loop. %TRUE if the connection is now connected and ready for use, %FALSE if the connection has become invalid. a connection if %TRUE, call Connect() if it appears to be necessary; if %FALSE, rely on Connect() to be called by another client if not %NULL and %FALSE is returned, used to raise an error if not %NULL, a #GMainLoop is placed here while it is being run (so calling code can call g_main_loop_quit() to abort), and %NULL is placed here after the loop has been run Requests an asynchronous set of the contact info of @self. When the operation is finished, @callback will be called. You can then call tp_connection_set_contact_info_finish() to get the result of the operation. This method should not be expected to succeed if the result of tp_connection_get_contact_info_flags() does not include %TP_CONTACT_INFO_FLAG_CAN_SET. a #TpConnection a #GList of #TpContactInfoField a callback to call when the request is satisfied data to pass to @callback Finishes an async set of @self info. %TRUE if the request call was successful, otherwise %FALSE a #TpConnection a #GAsyncResult Add the given @contacts to the given @group (creating it if necessary), and remove all other members. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. a #TpConnection the group to alter. The number of contacts in @contacts (must be at least 1) An array of #TpContact objects members for the group. If this set is empty, this method MAY remove the group. a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_set_group_members_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Direct the server to unblock @contacts. a #TpConnection the number of contacts in @contacts (must be at least 1) An array of #TpContact objects to block a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_unblock_contacts_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Attempt to set the given @contacts' #TpContact:publish-state property to %TP_SUBSCRIPTION_STATE_NO, i.e. stop sending presence to them. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to remove a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_unpublish_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Do nothing. In versions of telepathy-glib prior to 0.13.8, this released a reference to the handles in @handles. This is no-op so can be safely removed. a connection a handle type the number of handles in @handles an array of @n_handles handles Attempt to set the given @contacts' #TpContact:subscribe-state property to %TP_SUBSCRIPTION_STATE_NO, i.e. stop receiving their presence. For this to work properly @self must have interface %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. a #TpConnection The number of contacts in @contacts (must be at least 1) An array of #TpContact objects to remove a callback to call when the operation finishes data to pass to @callback Finishes tp_connection_unsubscribe_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpConnection a #GAsyncResult Given several #TpContact objects, make asynchronous method calls ensure that all the features specified in @features are ready for use (if they are supported at all). It is not an error to put features in @features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers. Use tp_connection_upgrade_contacts_async() instead. A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED feature prepared The number of contacts in @contacts (must be at least 1) An array of #TpContact objects associated with @self The number of features in @features (must be at least 1) An array of features that must be ready for use (if supported) before the callback is called A user callback to call when the contacts are ready Data to pass to the callback Called to destroy @user_data either after @callback has been called, or if the operation is cancelled An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled Given several #TpContact objects, make asynchronous method calls ensure that all the features specified in @features are ready for use (if they are supported at all). It is not an error to put features in @features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers. A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED feature prepared The number of contacts in @contacts (must be at least 1) An array of #TpContact objects associated with @self The number of features in @features (must be at least 1) An array of features that must be ready for use (if supported) before the callback is called A user callback to call when the contacts are ready Data to pass to the callback Finishes tp_connection_upgrade_contacts_async(). %TRUE on success, %FALSE otherwise. a #TpConnection a #GAsyncResult a location to set a #GPtrArray of upgraded #TpContact, or %NULL. The Amount field of the Balance.AccountBalance property. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. See Also: tp_connection_get_balance() The Currency field of the Balance.AccountBalance property. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. See Also: tp_connection_get_balance() The Scale field of the Balance.AccountBalance property. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. See Also: tp_connection_get_balance() The Balance.ManageCreditURI property. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. A #GPtrArray of blocked #TpContact. Changes are notified using the #TpConnection::blocked-contacts-changed signal. These TpContact objects have been prepared with the desired features. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared on them. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. If true, presence subscription and publication can be changed using the RequestSubscription, AuthorizePublication and RemoveContacts methods. Rational: link-local XMPP, presence is implicitly published to everyone in the local subnet, so the user cannot control their presence publication. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST. If this property is %TRUE, contacts may be reported as abusive to the server administrators by setting report_abusive to %TRUE when calling tp_connection_block_contacts_async(). For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. The %TpCapabilities object representing the capabilities of this connection, or NULL if we don't know yet. To wait for valid capability information, call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CAPABILITIES. This connection's connection manager name. This connection's connection manager name. Use #TpConnection:cm-name instead. Initially %FALSE; changes to %TRUE when the connection has gone to CONNECTED status, introspection has finished and it's ready for use. By the time this property becomes %TRUE, any extra interfaces will have been set up and the #TpProxy:interfaces property will have been populated. This is similar to %TP_CONNECTION_FEATURE_CONNECTED, except that once it has changed to %TRUE, it remains %TRUE even if the connection has been invalidated. use tp_proxy_is_prepared() with %TP_CHANNEL_FEATURE_CONNECTED for checks, or tp_proxy_prepare_async() for notification The names of all groups that currently exist. This may be a larger set than the union of all #TpContact:contact-groups properties, if the connection allows groups to be empty. This property's value is not meaningful until the #TpConnection:contact-list-state property has become %TP_CONTACT_LIST_STATE_SUCCESS. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. If true, presence subscriptions (in both directions) on this connection are stored by the server or other infrastructure. If false, presence subscriptions on this connection are not stored. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST. The progress made in retrieving the contact list. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST. True if each contact can be in at most one group; false if each contact can be in many groups. This property cannot change after the connection has moved to the %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. Indicates the extent to which contacts' groups can be set and stored. This property cannot change after the connection has moved to the %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, and it may change at any time, without notification. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. The connection's machine-readable protocol name, such as "jabber", "msn" or "local-xmpp". Recommended names for most protocols can be found in the Telepathy D-Bus Interface Specification. If true, the Message parameter to RequestSubscription is likely to be significant, and user interfaces SHOULD prompt the user for a message to send with the request; a message such as "I would like to add you to my contact list", translated into the local user's language, might make a suitable default. For this property to be valid, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or %TP_CONNECTION_FEATURE_CONTACT_LIST. A #TpContact representing the local user on this connection, or %NULL if not yet available. If the local user's unique identifier changes (for instance by using /nick on IRC), this property will change to a different #TpContact object representing the new identifier, and #GObject::notify will be emitted. The #TpContact object is guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. To wait for a non-%NULL self-contact (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONNECTED. The %TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, or 0 if we don't know yet or if the connection has become invalid. This may change if the local user's unique identifier changes (for instance by using /nick on IRC), in which case #GObject::notify will be emitted. To wait for a valid self-handle (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONNECTED. Use #TpConnection:self-contact instead. This connection's status, or %TP_UNKNOWN_CONNECTION_STATUS if we don't know yet. To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE. Since version 0.11.3, the change to status %TP_CONNECTION_STATUS_CONNECTED is delayed slightly, until introspection of the connection has finished. To wait for a valid status (and other properties), call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE. The reason why #TpConnection:status changed to its current value, or TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. know yet. Emitted when at least one of the #TpConnection:balance, #TpConnection:balance-scale or #TpConnection:balance-currency property is changed. For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. the value of the #TpConnection:balance property the value of the #TpConnection:balance-scale property the value of the #TpConnection:balance-currency property Notify of changes in #TpConnection:blocked-contacts. It is guaranteed that all contacts have desired features prepared. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared. This signal is also emitted for the initial set of blocked contacts once retrieved. For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. a #GPtrArray of #TpContact which have been blocked a #GPtrArray of #TpContact which are no longer blocked Notify of changes in the list of contacts as returned by tp_connection_dup_contact_list(). It is guaranteed that all contacts have desired features prepared. See tp_simple_client_factory_add_contact_features() to define which features needs to be prepared. This signal is also emitted for the initial set of contacts once retrieved. For this signal to be emitted, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_LIST. a #GPtrArray of #TpContact added to contacts list a #GPtrArray of #TpContact removed from contacts list Emitted when a group is renamed, in protocols where this can be distinguished from group creation, removal and membership changes. Immediately after this signal is emitted, #TpConnection::groups-created signal the creation of a group with the new name, and #TpConnection::groups-removed signal the removal of a group with the old name. If the group was not empty, immediately after those signals are emitted, #TpContact::contact-groups-changed signal that the members of that group were removed from the old name and added to the new name. When this signal is emitted, #TpConnection:contact-groups property is already updated. For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. the old name of the group. the new name of the group. Emitted when new, empty groups are created. This will often be followed by #TpContact::contact-groups-changed signals that add some members. When this signal is emitted, #TpConnection:contact-groups property is already updated. For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. a #GStrv with the names of the new groups. Emitted when one or more groups are removed. If they had members at the time that they were removed, then immediately after this signal is emitted, #TpContact::contact-groups-changed signals that their members were removed. When this signal is emitted, #TpConnection:contact-groups property is already updated. For this signal to be emited, you must first call tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CONTACT_GROUPS. A #GStrv with the names of the groups. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The aliases of contacts on this connection may be changed by the user of the service, not just by the contacts themselves. This is the case on Jabber, for instance. It is possible that aliases can be changed by the contacts too - which alias takes precedence is not defined by this specification, and depends on the server and/or connection manager implementation. This flag only applies to the aliases of "globally valid" contact handles. At this time, clients should not expect to be able to change the aliases corresponding to any channel-specific handles. If this becomes possible in future, a new flag will be defined. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The given channel type and handle can be given to RequestChannel to create a new channel of this type. ]]> <![CDATA[ The given contact can be invited to an existing channel of this type. ]]> The class of a #TpConnection. In addition to @parent_class there are four pointers reserved for possible future use. (Changed in 0.7.12: the layout of the structure is visible, allowing subclassing.) the parent class Signature of a callback used to receive the result of tp_connection_get_contacts_by_handle(). If an unrecoverable error occurs (for instance, if @connection becomes disconnected) the whole operation fails, and no contacts or invalid handles are returned. If some or even all of the @handles passed to tp_connection_get_contacts_by_handle() were not valid, this is not considered to be a failure. @error will be %NULL in this situation, @contacts will contain contact objects for those handles that were valid (possibly none of them), and @invalid will contain the handles that were not valid. The connection The number of TpContact objects successfully created (one per valid handle), or 0 on unrecoverable errors An array of @n_contacts TpContact objects (this callback is not given a reference to any of these objects, and must call g_object_ref() on any that it will keep), or %NULL on unrecoverable errors The number of invalid handles that were passed to tp_connection_get_contacts_by_handle() (or on unrecoverable errors, the total number of handles that were given) An array of @n_failed handles that were passed to tp_connection_get_contacts_by_handle() but turned out to be invalid (or on unrecoverable errors, all the handles that were given) %NULL on success, or an unrecoverable error that caused everything to fail the @user_data that was passed to tp_connection_get_contacts_by_handle() the @weak_object that was passed to tp_connection_get_contacts_by_handle() Signature of a callback used to receive the result of tp_connection_get_contacts_by_id(). @requested_ids contains the IDs that were converted to handles successfully. The normalized form of requested_ids[i] is tp_contact_get_identifier (contacts[i]). If some or even all of the @ids passed to tp_connection_get_contacts_by_id() were not valid, this is not considered to be a fatal error. @error will be %NULL in this situation, @contacts will contain contact objects for those IDs that were valid (it may be empty), and @failed_id_errors will map the IDs that were not valid to a corresponding #GError (if the connection manager complies with the Telepathy spec, it will have domain %TP_ERROR and code %TP_ERROR_INVALID_HANDLE). If an unrecoverable error occurs (for instance, if @connection becomes disconnected) the whole operation fails, and no contacts or requested IDs are returned. @failed_id_errors will contain all the IDs that were requested, mapped to a corresponding #GError (either one indicating that the ID was invalid, if that was determined before the fatal error occurred, or a copy of @error). The connection The number of TpContact objects successfully created (one per valid ID), or 0 on unrecoverable errors An array of @n_contacts TpContact objects (this callback is not given a reference to any of these objects, and must call g_object_ref() on any that it will keep), or %NULL on unrecoverable errors An array of @n_contacts valid IDs (JIDs, SIP URIs etc.) that were passed to tp_connection_get_contacts_by_id(), in an order corresponding to @contacts, or %NULL on unrecoverable errors A hash table in which the keys are IDs and the values are errors (#GError) %NULL on success, or an unrecoverable error that caused everything to fail the @user_data that was passed to tp_connection_get_contacts_by_id() the @weak_object that was passed to tp_connection_get_contacts_by_id() Signature of the callback called when tp_connection_hold_handles() succeeds or fails. On success, the caller has a reference to each handle in @handles. Since telepathy-glib version 0.13.8, the handles will remain valid until @connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, they could be released with tp_connection_unref_handles(). For convenience, the handle type and handles requested by the caller are passed through to this callback on success, so the caller does not have to include them in @user_data. See tp_connection_hold_handles(). the connection the handle type that was passed to tp_connection_hold_handles() the number of handles that were passed to tp_connection_hold_handles() on success, or 0 on failure a copy of the array of @n_handles handles that was passed to tp_connection_hold_handles() on success, or %NULL on failure %NULL on success, or an error on failure the same arbitrary pointer that was passed to tp_connection_hold_handles() the same object that was passed to tp_connection_hold_handles() A proxy object for a Telepathy connection manager. This might represent a connection manager which is currently running (in which case it can be introspected) or not (in which case its capabilities can be read from .manager files in the filesystem). Accordingly, this object never emits #TpProxy::invalidated unless all references to it are discarded. Various fields and methods on this object do not work until %TP_CONNECTION_MANAGER_FEATURE_CORE is prepared. Use tp_proxy_prepare_async() to wait for this to happen. Since 0.19.1, accessing the fields of this struct is deprecated, and they are no longer documented here. Use the accessors tp_connection_manager_get_name(), tp_connection_manager_is_running(), tp_connection_manager_dup_protocols(), tp_connection_manager_get_info_source() and the #TpConnectionManager:always-introspect property instead. Convenience function to create a new connection manager proxy. If its protocol and parameter information are required, you should call tp_proxy_prepare_async() on the result. a new reference to a connection manager proxy, or %NULL if @error is set. Proxy for the D-Bus daemon The connection manager name (such as "gabble") The #TpConnectionManager:manager-file property, which may (and generally should) be %NULL. Check that the given string is a valid connection manager name, i.e. that it consists entirely of ASCII letters, digits and underscores, and starts with a letter. %TRUE if @name is valid a possible connection manager name Check that the given string is a valid protocol name, i.e. that it consists entirely of ASCII letters, digits and hyphen/minus, and starts with a letter. %TRUE if @name is valid a possible protocol name Ensure that the known interfaces for TpConnectionManager have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_CONNECTION_MANAGER. Attempt to run and introspect the connection manager, asynchronously. Since 0.7.26 this function is not generally very useful, since the connection manager will now be activated automatically if necessary. If the CM was already running, do nothing and return %FALSE. On success, emit #TpConnectionManager::activated when the CM appears on the bus, and #TpConnectionManager::got-info when its capabilities have been (re-)discovered. On failure, emit #TpConnectionManager::exited without first emitting activated. %TRUE if activation was needed and is now in progress, %FALSE if the connection manager was already running and no additional signals will be emitted. a connection manager proxy Call the @callback from the main loop when information about @cm's supported protocols and parameters has been retrieved. since 0.17.6, use tp_proxy_prepare_async() instead a connection manager callback to call when information has been retrieved or on error arbitrary data to pass to the callback called to destroy @user_data object to reference weakly; if it is destroyed, @callback will not be called, but @destroy will still be called Returns a list of protocol names supported by this connection manager. These are the internal protocol names used by the Telepathy specification (e.g. "jabber" and "msn"), rather than user-visible names in any particular locale. If this function is called before the connection manager information has been obtained, the result is always %NULL. Use tp_proxy_prepare_async() to wait for this. The result is copied and must be freed by the caller, but it is not necessarily still true after the main loop is re-entered. a #GStrv of protocol names a connection manager Return objects representing all protocols supported by this connection manager. If this function is called before the connection manager information has been obtained, the result is always %NULL. Use tp_proxy_prepare_async() to wait for this. The caller must free the list, for instance with <literal>g_list_free_full (l, g_object_unref)</literal>. a list of #TpProtocol objects representing the protocols supported by @self, owned by the caller a connection manager If protocol and parameter information has been obtained from the connection manager, return %TP_CM_INFO_SOURCE_LIVE; if it has been obtained from the cache in the .manager file, return %TP_CM_INFO_SOURCE_FILE. If this information has not yet been obtained, or obtaining it failed, return %TP_CM_INFO_SOURCE_NONE. This may increase at any time that the main loop is running; the #GObject::notify signal is emitted. the value of the #TpConnectionManager:info-source property a connection manager Return the internal name of this connection manager in the Telepathy D-Bus API, e.g. "gabble" or "haze". This is often the name of the binary without the "telepathy-" prefix. The returned string is valid as long as @self is. Copy it with g_strdup() if a longer lifetime is required. the #TpConnectionManager:cm-name property a connection manager Returns a structure representing a protocol, or %NULL if this connection manager does not support the specified protocol. Since 0.11.11, you can get a #GObject version with more functionality by calling tp_connection_manager_get_protocol_object(). If this function is called before the connection manager information has been obtained, the result is always %NULL. Use tp_proxy_prepare_async() to wait for this. The result is not necessarily valid after the main loop is re-entered. Since 0.11.3, it can be copied with tp_connection_manager_protocol_copy() if a permanently-valid copy is needed. , use tp_connection_manager_get_protocol_object() a structure representing the protocol a connection manager the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn" Returns an object representing a protocol, or %NULL if this connection manager does not support the specified protocol. If this function is called before the connection manager information has been obtained, the result is always %NULL. Use tp_proxy_prepare_async() to wait for this. The result should be referenced with g_object_ref() if it will be kept. an object representing the protocol, or %NULL a connection manager the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn" Return whether @protocol is supported by this connection manager. If this function is called before the connection manager information has been obtained, the result is always %FALSE. Use tp_proxy_prepare_async() to wait for this. %TRUE if this connection manager supports @protocol a connection manager the name of a protocol as defined in the Telepathy D-Bus API, e.g. "jabber" or "msn" If protocol and parameter information has been obtained from the connection manager or the cache in the .manager file, return %TRUE. Otherwise, return %FALSE. This may change from %FALSE to %TRUE at any time that the main loop is running; the #GObject::notify signal is emitted for the #TpConnectionManager:info-source property. since 0.17.6, use tp_proxy_is_prepared() with %TP_CONNECTION_MANAGER_FEATURE_CORE instead %TRUE, unless the #TpConnectionManager:info-source property is %TP_CM_INFO_SOURCE_NONE a connection manager Return %TRUE if this connection manager currently appears to be running. This may change at any time that the main loop is running; the #TpConnectionManager::activated and #TpConnectionManager::exited signals are emitted. whether the connection manager is currently running a connection manager If %TRUE, always introspect the connection manager as it comes online, even if we already have its info from a .manager file. Default %FALSE. The name of the connection manager, e.g. "gabble" (read-only). The name of the connection manager, e.g. "gabble" (read-only). Use #TpConnectionManager:cm-name instead. Where we got the current information on supported protocols (a #TpCMInfoSource). Since 0.7.26, the #GObject::notify signal is emitted for this property. (Note that this is of type %G_TYPE_UINT, not %TP_TYPE_CM_INFO_SOURCE, for historical reasons.) The absolute path of the .manager file. If set to %NULL (the default), the XDG data directories will be searched for a .manager file of the correct name. If set to the empty string, no .manager file will be read. Emitted when the connection manager's well-known name appears on the bus. Emitted when the connection manager's well-known name disappears from the bus or when activation fails. Emitted when the connection manager's capabilities have been discovered. This signal is not very helpful. Using tp_proxy_prepare_async() instead is recommended. a #TpCMInfoSource The class of a #TpConnectionManager. Signature of the callback supplied to tp_list_connection_managers(). Since 0.11.3, tp_list_connection_managers() will wait for %TP_CONNECTION_MANAGER_FEATURE_CORE to be prepared on each connection manager passed to @callback, unless an error occurred while launching that connection manager. %NULL-terminated array of #TpConnectionManager (the objects will be unreferenced and the array will be freed after the callback returns, so the callback must reference any CMs it stores a pointer to), or %NULL on error number of connection managers in @cms (not including the final %NULL) %NULL on success, or an error that occurred user-supplied data user-supplied weakly referenced object Structure representing a connection manager parameter. Since 0.19.1, accessing the fields of this struct is deprecated, and they are no longer documented here. Use the accessors tp_connection_manager_param_get_name(), tp_connection_manager_param_get_dbus_signature(), tp_connection_manager_param_is_required(), tp_connection_manager_param_is_required_for_registration(), tp_connection_manager_param_is_secret(), tp_connection_manager_param_is_dbus_property(), tp_connection_manager_param_get_default(), tp_connection_manager_param_dup_default_variant() instead. <!-- Returns: says it all --> a newly (slice) allocated #TpConnectionManagerParam, free with tp_connection_manager_param_free() the #TpConnectionManagerParam to copy Get the default value for this parameter. Use g_variant_get_type() to check that the type is what you expect. For instance, a string parameter should have type %G_VARIANT_TYPE_STRING. the default value, or %NULL if there is no default a parameter supported by a #TpConnectionManager <!-- --> the #GVariantType of the parameter a parameter supported by a #TpConnectionManager Frees @param, which was copied with tp_connection_manager_param_copy(). the #TpConnectionManagerParam to free <!-- --> the D-Bus signature of the parameter a parameter supported by a #TpConnectionManager Get the default value for this parameter, if there is one. If %FALSE is returned, @value is left uninitialized. %TRUE if there is a default value a parameter supported by a #TpConnectionManager pointer to an unset (all zeroes) #GValue into which the default's type and value are written <!-- --> the name of the parameter a parameter supported by a #TpConnectionManager <!-- --> %TRUE if the parameter represents a D-Bus property of the same name a parameter supported by a #TpConnectionManager <!-- --> %TRUE if the parameter is normally required a parameter supported by a #TpConnectionManager <!-- --> %TRUE if the parameter is required when registering a new account (by setting the special "register" parameter to %TRUE) a parameter supported by a #TpConnectionManager <!-- --> %TRUE if the parameter's value is a password or other secret a parameter supported by a #TpConnectionManager Structure representing a protocol supported by a connection manager. Note that the size of this structure may change, so its size must not be relied on. , use #TpProtocol objects instead The name of this connection manager Array of #TpConnectionManagerParam structures, terminated by a structure whose @name is %NULL Return whether a new account can be registered on this protocol, by setting the special "register" parameter to %TRUE. , use #TpProtocol objects instead %TRUE if @protocol supports the parameter "register" structure representing a supported protocol <!-- Returns: says it all --> , use #TpProtocol objects instead a newly (slice) allocated #TpConnectionManagerProtocol, free with tp_connection_manager_protocol_free() the #TpConnectionManagerProtocol to copy Returns a list of parameter names supported by this connection manager for this protocol. The result is copied and must be freed by the caller with g_strfreev(). , use #TpProtocol objects instead a #GStrv of protocol names a protocol supported by a #TpConnectionManager Frees @proto, which was copied with tp_connection_manager_protocol_copy(). , use #TpProtocol objects instead the #TpConnectionManagerProtocol to free <!-- no more to say --> , use #TpProtocol objects instead a structure representing the parameter @param, or %NULL if not supported structure representing a supported protocol a parameter name <!-- no more to say --> , use #TpProtocol objects instead %TRUE if @protocol supports the parameter @param. structure representing a supported protocol a parameter name Called as the result of tp_connection_manager_call_when_ready(). If the connection manager's protocol and parameter information could be retrieved, @error is %NULL and @cm is considered to be ready. Otherwise, @error is non-%NULL and @cm is not ready. since 0.17.6, use tp_proxy_prepare_async() instead a connection manager %NULL on success, or the reason why tp_connection_manager_is_ready() would return %FALSE the @user_data passed to tp_connection_manager_call_when_ready() the @weak_object passed to tp_connection_manager_call_when_ready() Signature of the callback supplied to tp_list_connection_names(). %NULL-terminated array of @n connection bus names, or %NULL on error number of names (not including the final %NULL), or 0 on error %NULL-terminated array of @n connection manager names (e.g. "gabble") in the same order as @names, or %NULL on error %NULL-terminated array of @n protocol names as defined in the Telepathy spec (e.g. "jabber") in the same order as @names, or %NULL on error %NULL on success, or an error that occurred user-supplied data user-supplied weakly referenced object Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ An invalid presence type used as a null value. This value MUST NOT appear in the Statuses property, or in the result of GetStatuses on the deprecated Presence interface. ]]> <![CDATA[ Offline ]]> <![CDATA[ Available ]]> <![CDATA[ Away ]]> <![CDATA[ Away for an extended time ]]> <![CDATA[ Hidden (invisible) ]]> <![CDATA[ Busy, Do Not Disturb. ]]> <![CDATA[ Unknown, unable to determine presence for this contact, for example if the protocol only allows presence of subscribed contacts. ]]> <![CDATA[ Error, an error occurred while trying to determine presence. The message, if set, is an error from the server. ]]> Signature of the callback called when tp_connection_request_handles() succeeds or fails. On success, the caller has a reference to each handle in @handles. Since telepathy-glib version 0.13.8, the handles will remain valid until @connection becomes invalid (signalled by #TpProxy::invalidated). In earlier versions, they could be released with tp_connection_unref_handles(). For convenience, the handle type and IDs requested by the caller are passed through to this callback, so the caller does not have to include them in @user_data. See tp_connection_request_handles(). the connection the handle type that was passed to tp_connection_request_handles() the number of IDs that were passed to tp_connection_request_handles() on success, or 0 on failure the @n_handles handles corresponding to @ids, in the same order, or %NULL on failure a copy of the array of @n_handles IDs that was passed to tp_connection_request_handles() on success, or %NULL on failure %NULL on success, or an error on failure the same arbitrary pointer that was passed to tp_connection_request_handles() the same object that was passed to tp_connection_request_handles() Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The connection is fully connected and all methods are available. ]]> <![CDATA[ Connect has been called but the connection has not yet been established. Some methods may fail until the connection has been established. ]]> <![CDATA[ If this is retrieved from GetStatus or Status, it indicates that connection has not yet been attempted. If seen in a StatusChanged signal, it indicates that the connection has failed; the Connection object SHOULD be removed from D-Bus immediately, and all subsequent method calls SHOULD fail. ]]> <![CDATA[ A reason why the status of the connection changed. Apart from Requested, the values of this enumeration only make sense as reasons why the status changed to Disconnected. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ There is no reason set for this state change. Unknown status reasons SHOULD be treated like this reason. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Disconnected. ]]> <![CDATA[ The change is in response to a user request. Changes to the Connecting or Connected status SHOULD always indicate this reason; changes to the Disconnected status SHOULD indicate this reason if and only if the disconnection was requested by the user. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cancelled. ]]> <![CDATA[ There was an error sending or receiving on the network socket. When the status changes from Connecting to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionRefused, org.freedesktop.Telepathy.Error.ConnectionFailed or some more specific error. When the status changes from Connected to Disconnected for this reason, the equivalent D-Bus error is either org.freedesktop.Telepathy.Error.NetworkError, org.freedesktop.Telepathy.Error.ConnectionLost or some more specific error. ]]> <![CDATA[ The username or password was invalid. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.AuthenticationFailed. ]]> <![CDATA[ There was an error negotiating SSL on this connection, or encryption was unavailable and require-encryption was set when the connection was created. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.EncryptionNotAvailable if encryption was not available at all, or org.freedesktop.Telepathy.Error.EncryptionError if encryption failed. ]]> <![CDATA[ In general, this reason indicates that the requested account name or other identification could not be used due to conflict with another connection. It can be divided into three cases: If the status change is from Connecting to Disconnected and the 'register' parameter to RequestConnection was present and true, the requested account could not be created on the server because it already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.RegistrationExists. If the status change is from Connecting to Disconnected but the 'register' parameter is absent or false, the connection manager could not connect to the specified account because a connection to that account already exists. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.AlreadyConnected. In some protocols, like XMPP (when connecting with the same JID and resource as an existing connection), the existing connection "wins" and the new one fails to connect. If the status change is from Connected to Disconnected, the existing connection was automatically disconnected because a new connection to the same account (perhaps from a different client or location) was established. The equivalent D-Bus error is org.freedesktop.Telepathy.Error.ConnectionReplaced. In some protocols, like MSNP (when connecting twice with the same Passport), the new connection "wins" and the existing one is automatically disconnected. ]]> <![CDATA[ The server did not provide a SSL certificate. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotProvided. ]]> <![CDATA[ The server's SSL certificate is signed by an untrusted certifying authority. This error SHOULD NOT be used to represent a self-signed certificate: use the more specific Cert_Self_Signed reason for that. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Untrusted. ]]> <![CDATA[ The server's SSL certificate has expired. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Expired. ]]> <![CDATA[ The server's SSL certificate is not yet valid. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.NotActivated. ]]> <![CDATA[ The server's SSL certificate did not match its hostname. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.HostnameMismatch. ]]> <![CDATA[ The server's SSL certificate does not have the expected fingerprint. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch. ]]> <![CDATA[ The server's SSL certificate is self-signed. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.SelfSigned. ]]> <![CDATA[ There was some other error validating the server's SSL certificate. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Invalid. ]]> <![CDATA[ The server's SSL certificate has been revoked. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Revoked. ]]> <![CDATA[ The server's SSL certificate uses an insecure algorithm, or is cryptographically weak. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.Insecure. ]]> <![CDATA[ The length in bytes of the server certificate, or the depth of the sever certificate chain exceed the limits imposed by the crypto library. When disconnected for this reason, the equivalent D-Bus error is org.freedesktop.Telepathy.Error.Cert.LimitExceeded ]]> Signature of a callback used to receive the result of tp_connection_upgrade_contacts(). If an unrecoverable error occurs (for instance, if @connection becomes disconnected) it is indicated by @error, but the contacts in @contacts are still provided. The connection The number of TpContact objects for which an upgrade was requested An array of @n_contacts TpContact objects (this callback is not given an extra reference to any of these objects, and must call g_object_ref() on any that it will keep) An unrecoverable error, or %NULL if the connection remains valid the @user_data that was passed to tp_connection_upgrade_contacts() the @weak_object that was passed to tp_connection_upgrade_contacts() Signature of a callback passed to tp_connection_call_when_ready(), which will be called exactly once, when the connection becomes ready or invalid (whichever happens first) the connection (which may be in the middle of being disposed, if error is non-%NULL, error->domain is TP_DBUS_ERRORS and error->code is TP_DBUS_ERROR_PROXY_UNREFERENCED) %NULL if the connection is ready for use, or the error with which it was invalidated if it is now invalid whatever was passed to tp_connection_call_when_ready() An object representing a contact on a #TpConnection. Contact objects support tracking a number of attributes of contacts, as described by the #TpContactFeature flags. Features can be specified when instantiating contact objects (with tp_connection_get_contacts_by_id() or tp_connection_get_contacts_by_handle()), or added to an existing contact object with tp_connection_upgrade_contacts(). For example, a client wishing to keep track of a contact's alias would set #TP_CONTACT_FEATURE_ALIAS, and then listen for the "notify::alias" signal, emitted whenever the #TpContact:alias property changes. Note that releasing a #TpContact object might release handle references held by calling tp_cli_connection_call_request_handles(), tp_cli_connection_run_request_handles(), tp_cli_connection_call_hold_handles(), tp_cli_connection_run_hold_handles(), tp_cli_connection_interface_contacts_call_get_contact_attributes() or tp_cli_connection_interface_contacts_run_get_contact_attributes() directly. Those functions should be avoided in favour of using #TpContact, tp_connection_hold_handles(), tp_connection_request_handles() and tp_connection_get_contact_attributes(). Convenience wrapper for tp_connection_add_to_group_async() on a single contact. a #TpContact the group to alter. a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_add_to_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Convenience wrapper for tp_connection_authorize_publication_async() on a single contact. a #TpContact a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_authorize_publication_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Block communications with a contact, optionally reporting the contact as abusive to the server administrators. To block more than one contact at once, see tp_connection_block_contacts_async(). a #TpContact If %TRUE, report this contact as abusive to the server administrators as well as blocking him. See #TpConnection:can-report-abusive to discover whether reporting abuse is supported. If #TpConnection:can-report-abusive is %FALSE, this parameter will be ignored. a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_block_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Returns a newly allocated #GList of contact's vCard fields. The list must be freed with tp_contact_info_list_free() after used. Same as the #TpContact:contact-info property. a #GList of #TpContactInfoField, or %NULL if the feature is not yet prepared. a #TpContact Return the contact's user-defined location, or %NULL if the location is unspecified. This function returns the same information as tp_contact_get_location(), but in a different format. a variant of type %G_VARIANT_TYPE_VARDICT, the same as the #TpContact:location-vardict property a contact Return the #TpAccount of @self's #TpContact:connection. See tp_connection_get_account() for details. a borrowed reference to @self's account (it must be referenced with g_object_ref if it must remain valid longer than the contact) a contact Return the contact's alias. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same non-%NULL alias as the #TpContact:alias a contact Return the contact's avatar file. This remains valid until the main loop is re-entered; if the caller requires a #GFile that will persist for longer than that, it must be reffed with g_object_ref(). the same #GFile as the #TpContact:avatar-file property (possibly %NULL) a contact Return the contact's avatar MIME type. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same MIME type as the #TpContact:avatar-mime-type property (possibly %NULL) a contact Return the contact's avatar token. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same token as the #TpContact:avatar-token property (possibly %NULL) a contact <!-- --> the same #TpCapabilities (or %NULL) as the #TpContact:capabilities property a contact Return the contact's client types or %NULL if the client types are unspecified. the same #GStrv as the #TpContact:client-types property a contact <!-- nothing more to say --> a borrowed reference to the #TpContact:connection (it must be referenced with g_object_ref if it must remain valid longer than the contact) a contact Return names of groups of which a contact is a member. It is incorrect to call this method before %TP_CONTACT_FEATURE_CONTACT_GROUPS has been prepared. This remains valid until the main loop is re-entered; if the caller requires a #GStrv that will persist for longer than that, it must be copied with g_strdupv(). the same #GStrv as the #TpContact:contact-groups property a #TpContact Returns a newly allocated #GList of contact's vCard fields. The list must be freed with g_list_free() after used. Note that the #TpContactInfoField<!-- -->s in the returned #GList are not dupped before returning from this function. One could copy every item in the list using tp_contact_info_field_copy(). Same as the #TpContact:contact-info property. Since 0.19.9. New code should use tp_contact_dup_contact_info() instead. a #GList of #TpContactInfoField, or %NULL if the feature is not yet prepared. a #TpContact Return the contact's handle, which is of type %TP_HANDLE_TYPE_CONTACT, or 0 if the #TpContact:connection has become invalid. This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as @self exists and the #TpContact:connection remains valid. However, the caller of this function does not gain an additional reference to the handle. the same handle as the #TpContact:handle property a contact Return the contact's identifier. This remains valid for as long as @self exists; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same non-%NULL identifier as the #TpContact:identifier property a contact Return the contact's user-defined location or %NULL if the location is unspecified. This remains valid until the main loop is re-entered; if the caller requires a hash table that will persist for longer than that, it must be reffed with g_hash_table_ref(). the same #GHashTable (or %NULL) as the #TpContact:location property a contact Return the contact's user-defined status message, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same non-%NULL message as the #TpContact:presence-message property a contact Return the name of the contact's presence status, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). the same non-%NULL status name as the #TpContact:presence-status property a contact If this object has been set up to track %TP_CONTACT_FEATURE_PRESENCE and the underlying connection supports either the Presence or SimplePresence interfaces, return the type of the contact's presence. Otherwise, return %TP_CONNECTION_PRESENCE_TYPE_UNSET. the same presence type as the #TpContact:presence-type property a contact If #TpContact:publish-state is set to %TP_SUBSCRIPTION_STATE_ASK, return the message that this remote contact sent when they requested permission to see the local user's presence, an empty string ("") otherwise. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup(). This is set to %NULL until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-%NULL afterward. the value of #TpContact:publish-request. a #TpContact Return the state of this remote contact's subscription to the local user's presence. This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared the value of #TpContact:publish-state. a #TpContact Return the state of the local user's subscription to this remote contact's presence. This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared the value of #TpContact:subscribe-state. a #TpContact <!-- --> %TRUE if @self has been set up to track the feature @feature a contact a desired feature <!-- --> the value of #TpContact:is-blocked. a #TpContact Convenience wrapper for tp_connection_remove_contacts_async() on a single contact. a #TpContact a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_remove_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Convenience wrapper for tp_connection_remove_from_group_async() on a single contact. a #TpContact the group to alter. a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_remove_from_group_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Requests an asynchronous request of the contact info of @self. When the operation is finished, @callback will be called. You can then call tp_contact_request_contact_info_finish() to get the result of the operation. If the operation is successful, the #TpContact:contact-info property will be updated (emitting "notify::contact-info" signal) before @callback is called. That means you can call tp_contact_get_contact_info() to get the new vCard inside @callback. Note that requesting the vCard from the network can take significant time, so a bigger timeout is set on the underlying D-Bus call. @cancellable can be cancelled to free resources used in the D-Bus call if the caller is no longer interested in the vCard. If %TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on @self, it will be set before its property gets updated and @callback is called. a #TpContact optional #GCancellable object, %NULL to ignore. a callback to call when the request is satisfied data to pass to @callback Finishes an async request of @self info. If the operation was successful, the contact's vCard can be accessed using tp_contact_get_contact_info(). %TRUE if the request call was successful, otherwise %FALSE a #TpContact a #GAsyncResult Convenience wrapper for tp_connection_request_subscription_async() on a single contact. a #TpContact an optional message a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_request_subscription_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Add @self to the given groups (creating new groups if necessary), and remove it from all other groups. If the user is removed from a group of which they were the only member, the group MAY be removed automatically. You can then call tp_contact_set_contact_groups_finish() to get the result of the operation. If the operation is successful and %TP_CONTACT_FEATURE_CONTACT_GROUPS is prepared, the #TpContact:contact-groups property will be updated (emitting "notify::contact-groups" signal) and #TpContact::contact-groups-changed signal will be emitted before @callback is called. That means you can call tp_contact_get_contact_groups() to get the new contact groups inside @callback. a #TpContact the number of groups, or -1 if @groups is %NULL-terminated the set of groups which the contact should be in (may be %NULL if @n_groups is 0) a callback to call when the request is satisfied data to pass to @callback Finishes an async set of @self contact groups. %TRUE if the request call was successful, otherwise %FALSE a #TpContact a #GAsyncResult Unblock communications with a contact. To unblock more than one contact at once, see tp_connection_unblock_contacts_async(). a #TpContact a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_unblock_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Convenience wrapper for tp_connection_unpublish_async() on a single contact. a #TpContact a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_unpublish_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult Convenience wrapper for tp_connection_unsubscribe_async() on a single contact. a #TpContact a callback to call when the operation finishes data to pass to @callback Finishes tp_contact_unsubscribe_async() %TRUE if the operation was successful, otherwise %FALSE. a #TpContact a #GAsyncResult The contact's alias if available, falling back to their #TpContact:identifier if no alias is available or if the #TpContact has not been set up to track %TP_CONTACT_FEATURE_ALIAS. This alias may have been supplied by the contact themselves, or by the local user, so it does not necessarily unambiguously identify the contact. However, it is suitable for use as a main "display name" for the contact. This is never %NULL for contact objects that are visible to library-user code. #GFile to the latest cached avatar image, or %NULL if this contact has no avatar, or if the avatar data is not yet retrieved. When #TpContact:avatar-token changes, this property is not updated immediately, but will be updated when the new avatar data is retrieved and stored in cache. Until then, the file will keep its old value of the latest cached avatar image. This is set to %NULL if %TP_CONTACT_FEATURE_AVATAR_DATA is not set on this contact. Note that setting %TP_CONTACT_FEATURE_AVATAR_DATA will also implicitly set %TP_CONTACT_FEATURE_AVATAR_TOKEN. MIME type of the latest cached avatar image, or %NULL if this contact has no avatar, or if the avatar data is not yet retrieved. This is always the MIME type of the image given by #TpContact:avatar-file. An opaque string representing state of the contact's avatar (depending on the protocol, this might be a hash, a timestamp or something else), or an empty string if there is no avatar. This may be %NULL if it is not known whether this contact has an avatar or not (either for network protocol reasons, or because this #TpContact has not been set up to track %TP_CONTACT_FEATURE_AVATAR_TOKEN). The capabilities supported by this contact. If the underlying Connection doesn't support the ContactCapabilities interface, this property will contain the capabilities supported by the connection. Use tp_capabilities_is_specific_to_contact() to check if the capabilities are specific to this #TpContact or not. This may be %NULL if this #TpContact object has not been set up to track %TP_CONTACT_FEATURE_CAPABILITIES. A #GStrv containing the client types of this contact. This is set to %NULL if %TP_CONTACT_FEATURE_CLIENT_TYPES is not set on this contact; it may also be %NULL if that feature is prepared, but the contact's client types are unknown. The #TpConnection to which this contact belongs. a #GStrv with names of groups of which a contact is a member. This is set to %NULL if %TP_CONTACT_FEATURE_CONTACT_GROUPS is not prepared on this contact, or if the connection does not implement ContactGroups interface. A #GList of #TpContactInfoField representing the vCard of this contact. This is set to %NULL if %TP_CONTACT_FEATURE_CONTACT_INFO is not set on this contact. The contact's handle in the Telepathy D-Bus API, a handle of type %TP_HANDLE_TYPE_CONTACT representing the string given by #TpContact:identifier. This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as the #TpContact exists and the #TpContact:connection remains valid. However, getting this property does not cause an additional reference to the handle to be held. If the #TpContact:connection becomes invalid, this property is no longer meaningful and will be set to 0. The contact's identifier in the instant messaging protocol (e.g. XMPP JID, SIP URI, AOL screenname or IRC nick - whatever the underlying protocol uses to identify a user). This is never %NULL for contact objects that are visible to library-user code. %TRUE if the contact has been blocked. This is set to %FALSE if %TP_CONTACT_FEATURE_CONTACT_BLOCKING is not prepared on this contact, or if the connection does not implement ContactBlocking interface. If this contact has set a user-defined location, a string to #GValue * hash table containing his location. If not, %NULL. tp_asv_get_string() and similar functions can be used to access the contents. This may be %NULL even if the contact has set a location, if this #TpContact object has not been set up to track %TP_CONTACT_FEATURE_LOCATION. If this contact has set a user-defined location, a string to variant map containing his location. If not, %NULL. tp_vardict_get_string() and similar functions can be used to access the contents. This may be %NULL even if the contact has set a location, if this #TpContact object has not been set up to track %TP_CONTACT_FEATURE_LOCATION. This property contains the same information as #TpContact:location, in a different format. If this contact has set a user-defined status message, that message; if not, an empty string (which user interfaces may replace with a localized form of the #TpContact:presence-status or #TpContact:presence-type). This may be an empty string even if the contact has set a message, if this #TpContact object has not been set up to track %TP_CONTACT_FEATURE_PRESENCE. It is never %NULL. A string representing the presence status of this contact. This may be a well-known string from the Telepathy specification, like "available", or a connection-manager-specific string, like "out-to-lunch". This may be an empty string if this #TpContact object has not been set up to track %TP_CONTACT_FEATURE_PRESENCE. It is never %NULL. The #TpConnectionPresenceType representing the type of presence status for this contact. This is provided so even unknown values for #TpContact:presence-status can be classified into their fundamental types. This may be %TP_CONNECTION_PRESENCE_TYPE_UNSET if this #TpContact has not been set up to track %TP_CONTACT_FEATURE_PRESENCE. The message that contact sent when they requested permission to see the local user's presence, if #TpContact:publish-state is %TP_SUBSCRIPTION_STATE_ASK, an empty string ("") otherwise. This is set to %NULL until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-%NULL afterward. A #TpSubscriptionState indicating the state of this contact's subscription to the local user's presence. This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared A #TpSubscriptionState indicating the state of the local user's subscription to this contact's presence. This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared Emitted when this contact's groups changes. When this signal is emitted, #TpContact:contact-groups property is already updated. A #GStrv with added contact groups A #GStrv with removed contact groups Emitted when this contact's presence changes. The new value of #TpContact:presence-type The new value of #TpContact:presence-status The new value of #TpContact:presence-message Emitted when this contact's subscription states changes. the new value of #TpContact:subscribe-state the new value of #TpContact:publish-state the new value of #TpContact:publish-request Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ When calling BlockContacts, the contacts may be reporting as abusive to the server administrators by setting Report_Abusive to True. ]]> Enumeration representing the features a #TpContact can optionally support. When requesting a #TpContact, library users specify the desired features; the #TpContact code will only initialize state for those features, to avoid unwanted D-Bus round-trips and signal connections. Since 0.11.5, there is a corresponding #GEnumClass type, %TP_TYPE_CONTACT_FEATURE. #TpContact:alias #TpContact:avatar-token #TpContact:presence-type, #TpContact:presence-status and #TpContact:presence-message #TpContact:location (available since 0.11.1) and #TpContact:location-vardict (since 0.19.10) #TpContact:capabilities (available since 0.11.3) #TpContact:avatar-file and #TpContact:avatar-mime-type. Implies %TP_CONTACT_FEATURE_AVATAR_TOKEN (available since 0.11.6) #TpContact:contact-info (available since 0.11.7) #TpContact:client-types (available since 0.13.1) #TpContact:subscribe-state, #TpContact:publish-state and #TpContact:publish-request. Require a Connection implementing the %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST interface. (available since 0.13.12) #TpContact:contact-groups (available since 0.13.14) #TpContact:is-blocked. Require Connection implementing the %TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING interface. (available since 0.17.0) A structure representing an information about a contact. Similar to a vCard field. The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr". A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'. For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value. For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements). <!--Returns: says it all--> a newly allocated #TpContactInfoField, free it with tp_contact_info_field_free() The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr". A list of vCard type parameters applicable to this field, with their values. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'. For unstructured vCard fields (such as 'fn', a formatted name field), a single-element array containing the field's value. For structured fields (such as 'adr', an address field), an array corresponding to the semicolon-separated elements of the field (with empty strings for empty elements). <!--Returns: says it all--> a newly allocated #TpContactInfoField, free it with tp_contact_info_field_free() a #TpContactInfoField Free all memory used by the #TpContactInfoField. a #TpContactInfoField <![CDATA[ Flags describing the behaviour of a vCard field. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ If present, exactly the parameters indicated must be set on this field; in the case of an empty list of parameters, this implies that parameters may not be used. If absent, and the list of allowed parameters is non-empty, any (possibly empty) subset of that list may be used. If absent, and the list of allowed parameters is empty, any parameters may be used. ]]> <![CDATA[ Indicates that this field will be overwritten when the user's alias is changed with SetAliases or when the Account's Nickname is updated. Clients that allow the editing of the Alias and the ContactInfo in the same location should hide fields with this flag. If a client allowed the user to edit both the nickname and the ContactInfo field at the same time, the user could set them to two different values even though they map to the same property. This would result in surprising behavior where the second value would win over the first. In addition to hiding this field when editing ContactInfo together with the user's nickname, it is recommended that clients call SetContactInfo before setting the user's nickname. This ensures that if the user changes the nickname, the correct value will get set even if the stale nickname is mistakenly sent along with SetContactInfo. If used, this flag typically appears on either the 'nickname' or 'fn' field. ]]> A struct describing a vCard field. The name of the field; this is the lowercased name of a vCard field. For example, a field representing a contact's address would be named "adr". The set of vCard type parameters which may be set on this field. If this list is empty and the #TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT flag is not set, any vCard type parameters may be used. The type parameter names, and any values that are case-insensitive in vCard, MUST be in lower case. For example, a contact's preferred home address would have parameters 'type=home' and 'type=pref'. Flags describing the behaviour of this field. Maximum number of instances of this field which may be set. #G_MAXUINT32 is used to indicate that there is no limit. <!--Returns: says it all--> a newly allocated #TpContactInfoFieldSpec, free it with tp_contact_info_field_spec_free() a #TpContactInfoFieldSpec Free all memory used by the #TpContactInfoFieldSpec. a #TpContactInfoFieldSpec <![CDATA[ Flags defining the behaviour of contact information on this protocol. Some protocols provide no information on contacts without an explicit request; others always push information to the connection manager as and when it changes. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Indicates that SetContactInfo is supported on this connection. ]]> <![CDATA[ Indicates that the protocol pushes all contacts' information to the connection manager without prompting. If set, ContactInfoChanged will be emitted whenever contacts' information changes. ]]> <!--Returns: says it all--> a new #GList of newly allocated #TpContactInfoField, free it with tp_contact_info_list_free() a #GList of #TpContactInfoField Free all memory used by the #GList and its elements. a #GList of #TpContactInfoField <!--Returns: says it all--> a new #GList of newly allocated #TpContactInfoFieldSpec, free it with tp_contact_info_spec_list_free() a #GList of #TpContactInfoFieldSpec Free all memory used by the #GList and its elements. a #GList of #TpContactInfoFieldSpec <![CDATA[ The progress made in retrieving the contact list. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[The connection has not started to retrieve the contact list. If GetContactListAttributes is called in this state, it will raise NotYet.]]> <![CDATA[The connection has started to retrieve the contact list, but has not yet succeeded or failed. If GetContactListAttributes is called in this state, it will raise NotYet.]]> <![CDATA[ The connection has tried and failed to retrieve the contact list. If GetContactListAttributes is called in this state, it will immediately raise an error indicating the reason for failure. The connection manager SHOULD try again to obtain the contact list, if appropriate for the protocol. If it succeeds later, the ContactListState MUST advance to Success. ]]> <![CDATA[The connection has successfully retrieved the contact list. If GetContactListAttributes is called in this state, it will return successfully.]]> <![CDATA[ Values of this enumeration indicate the extent to which metadata such as aliases and group memberships can be stored for the contacts on a particular connection. On some protocols, certain metadata (for instance, contact aliases) can only be stored for contacts on the contact list, or contacts with a particular contact list state. To make it easier to deal with such protocols, if clients set metadata on a contact who is not in the required state, the Connection MUST cache the metadata for the duration of the session. If clients request the attributes of that contact after the appropriate "set" method has returned successfully, the Connection MUST return the new (cached) value. If the contact is later placed in the required state to store metadata (for instance, if subscription to the contact's presence is requested, on a protocol like MSN where the alias has storage type Subscribed_Or_Pending), the connection MUST store the cached metadata at that time. If the Connection didn't cache changes in this way, a client intending to change the alias on MSN would have to wait until the server acknowledged the subscription request; in the meantime, other clients would still display the old alias. The only exception to that general rule is that if the Connection cannot store particular metadata at all (i.e. the storage type is None), it MUST reject attempts to set it. If the implementation knows that metadata can't be stored at all, it's useful to report that, which can be done synchronously. In general, user interfaces should detect storage type None and not display editing controls at all. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ This connection cannot store this type of metadata at all, and attempting to do so will fail with NotImplemented. Link-local XMPP can't store aliases or group memberships at all, and subscription and presence states are implicit (all contacts on the local network have subscribe = publish = Yes and no other contacts exist). As of April 2010, the XMPP server for Facebook Chat provides a read-only view of the user's Facebook contacts, so it could also usefully have this storage type. ]]> <![CDATA[ This type of metadata can only be stored permanently for contacts whose subscribe attribute is Ask or Yes. Contact aliases and groups on MSN have this behaviour. ]]> <![CDATA[ This type of metadata can only be stored permanently for contacts whose subscribe attribute is Yes. No service with this behaviour is currently known, but it's a stricter form of Subscribed_Or_Pending. ]]> <![CDATA[ The user can set this metadata for any valid contact identifier, whether or not they have any presence subscription relationship to it, and it will be stored on their contact list. Contact aliases and groups on XMPP have this behaviour; it is possible to put a contact in a group, or assign an alias to them, without requesting that presence be shared. ]]> An object for Telepathy contact searches. There are no interesting public struct fields. <!-- --> a new contact search object, or %NULL in case of error. the #GAsyncResult from the callback <!-- --> an account for the contact search the server on which to search for contacts, or %NULL The maximum number of results the server should return, or 0 for the server default. a #GAsyncReadyCallback to call when the initialization is finished data to pass to the callback function <!-- --> The TpContactSearch:account property a contact search object <!-- --> The TpContactSearch:limit property a contact search object Get the search keys for a contact search. The keys are vCard field names in lower case, except when they're one of the special cases from telepathy-spec like "tel;cell" or "x-n-given". See the <ulink url="http://telepathy.freedesktop.org/spec/Channel_Type_Contact_Search.html"> Channel.Type.ContactSearch interface</ulink> for a list of the special cases. the new search keys, or %NULL. the contact search object to get the keys from <!-- --> The TpContactSearch:server property a contact search object Resets the contact search object so a new search can be performed. If another tp_contact_search_reset_async() call is in progress, it will be cancelled and tp_contact_search_reset_finish() will return an appropriate error. the #TpContactSearch to reset the server on which to search for contacts, or %NULL The maximum number of results the server should return, or 0 for the server default. a #GAsyncReadyCallback to call when the initialization is finished data to pass to the callback function <!-- --> the new search keys, or %NULL in case of error. the #TpContactSearch that is being reset the #GAsyncResult from the callback Starts a search for the keys specified in @criteria. Connect to the #TpContactSearch::search-results-received signal before calling this function. Before searching again on the same #TpContactSearch, you must call tp_contact_search_reset_async(). a #TpContactSearch a map from keys returned by tp_contact_search_get_search_keys() to values to search for This search's account. The maximum number of results that the server should return. This is only supported by some protocols; use tp_capabilities_supports_contact_search() to check if it's supported. To change the limit after the object has been constructed, use tp_contact_search_reset_async(). The search server. This is only supported by some protocols; use tp_capabilities_supports_contact_search() to check if it's supported. To change the server after the object has been constructed, use tp_contact_search_reset_async(). This search's state, as a %TpChannelContactSearchState. Emitted when search results are received. Note that this signal may be emitted multiple times for the same search. a #GList with the search results The class of a #TpContactSearch. An object representing the results of a Telepathy contact search channel. There are no interesting public struct fields. <!-- --> a #GList of #TpContactInfoField for the specified contact. You should free it when you're done with tp_contact_info_list_free(). a search result <!-- --> the specified field, or %NULL if the result doesn't have it. a #TpContactSearchResult the name of the field <!-- --> Since 0.19.9. New code should use tp_contact_search_result_dup_fields() instead. a #GList of #TpContactInfoField for the specified contact. You should free it when you're done with g_list_free(). a search result <!-- --> the contact identifier. a #TpContactSearchResult The class of a #TpContactSearchResult. Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_contacts_mixin_init(). There are no public fields. Declare that the given interface has contact attributes which can be added to the attributes hash using the filler function. All the handles in the handle array passed to the filler function are guaranteed to be valid and referenced. An instance of the implementation that uses this mixin Name of the interface that has ContactAttributes Contact attribute filler function Free resources held by the contacts mixin. An object with this mixin. Get contact attributes for the given contacts. Provide attributes for all requested interfaces. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value. A dictionary mapping the contact handles to contact attributes. A connection instance that uses this mixin. The connection must be connected. List of handles to retrieve contacts for. Any invalid handles will be dropped from the returned mapping. A list of interfaces to retrieve attributes from. A list of additional interfaces to retrieve attributes from. This can be used for interfaces documented as automatically included, like %TP_IFACE_CONNECTION for GetContactAttributes, or %TP_IFACE_CONNECTION and %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST for GetContactListAttributes. The DBus client's unique name. If this is not NULL, the requested handles will be held on behalf of this client. <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObject Fill in the vtable entries needed to implement the contacts interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfaceContacts in an object class Ignored Initialize the contacts mixin. Should be called from the implementation's instance init function like so: <informalexample><programlisting> tp_contacts_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, contacts_mixin)); </programlisting></informalexample> An instance of the implementation that uses this mixin The byte offset of the TpContactsMixin within the object structure Utility function to set attribute for handle to value in the attributes hash as passed to a TpContactsMixinFillContactAttributesFunc. contacts attribute hash as passed to TpContactsMixinFillContactAttributesFunc Handle to set the attribute on attribute name slice allocated GValue containing the value of the attribute, for instance with tp_g_value_slice_new. Ownership of the GValue is taken over by the mixin Structure to be included in the class structure of objects that use this mixin. Initialize it with tp_contacts_mixin_class_init(). There are no public fields. <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObjectClass Initialize the contacts mixin. Should be called from the implementation's class_init function like so: <informalexample><programlisting> tp_contacts_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, contacts_mixin)); </programlisting></informalexample> The class of the implementation that uses this mixin The byte offset of the TpContactsMixinClass within the class structure This function is called to supply contact attributes pertaining to a particular interface, for a list of contacts. All the handles in @contacts are guaranteed to be valid and referenced. An object implementing the Contacts interface with this mixin The contact handles for which attributes are requested hash of handle => hash of attributes, containing all the contacts in the contacts array A subclass of #TpProxy that represents the D-Bus daemon. It mainly provides functionality to manage well-known names on the bus. Returns a proxy for signals and method calls on a particular bus connection. Use tp_dbus_daemon_dup() instead if you just want a connection to the starter or session bus (which is almost always the right thing for Telepathy). a new proxy for signals and method calls on the bus daemon to which @connection is connected a connection to D-Bus Returns a proxy for signals and method calls on the D-Bus daemon on which this process was activated (if it was launched by D-Bus service activation), or the session bus (otherwise). If it is not possible to connect to the appropriate bus, raise an error and return %NULL. The returned #TpDBusDaemon is cached; the same #TpDBusDaemon object will be returned by this function repeatedly, as long as at least one reference exists. a reference to a proxy for signals and method calls on the bus daemon, or %NULL Ensure that the known interfaces for TpDBusDaemon have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_DBUS_DAEMON. If there was a previous call to tp_dbus_daemon_watch_name_owner() with exactly the given @name, @callback and @user_data, remove it. If more than one watch matching the details provided was active, remove only the most recently added one. %TRUE if there was such a watch, %FALSE otherwise the D-Bus daemon the name that was being watched the callback that was called the user data that was provided <!-- Returns: is enough --> the unique name of this connection to the bus, which is valid for as long as this #TpDBusDaemon is object representing a connection to a bus Call the ListActivatableNames method on the bus daemon, asynchronously. The @callback will be called from the main loop with a list of all the well-known names that are available for service-activation on the bus. In versions of telepathy-glib that have it, this should be preferred instead of calling tp_cli_dbus_daemon_call_list_activatable_names(), since that function will result in wakeups for every NameOwnerChanged signal. object representing a connection to a bus daemon timeout for the call callback to be called on success or failure; must not be %NULL opaque user-supplied data to pass to the callback if not %NULL, called with @user_data as argument after the call has succeeded or failed, or after @weak_object has been destroyed if not %NULL, a GObject which will be weakly referenced; if it is destroyed, @callback will not be called at all Call the ListNames method on the bus daemon, asynchronously. The @callback will be called from the main loop with a list of all the names (either unique or well-known) that exist on the bus. In versions of telepathy-glib that have it, this should be preferred instead of calling tp_cli_dbus_daemon_call_list_names(), since that function will result in wakeups for every NameOwnerChanged signal. object representing a connection to a bus timeout for the call callback to be called on success or failure; must not be %NULL opaque user-supplied data to pass to the callback if not %NULL, called with @user_data as argument after the call has succeeded or failed, or after @weak_object has been destroyed if not %NULL, a GObject which will be weakly referenced; if it is destroyed, @callback will not be called at all Export @object at @object_path. This is a convenience wrapper around dbus_g_connection_register_g_object(), and behaves similarly. object representing a connection to a bus an object path an object to export Release the given well-known name. This makes a synchronous call to the bus daemon. %TRUE if @well_known_name was released, or %FALSE and sets @error if an error occurred. a TpDBusDaemon a well-known name owned by this process to release Claim the given well-known name without queueing, allowing replacement or replacing an existing name-owner. This makes a synchronous call to the bus daemon. %TRUE if @well_known_name was claimed, or %FALSE and sets @error if an error occurred. a TpDBusDaemon a well-known name to acquire whether to consider it to be a success if this process already owns the name Stop exporting @object on D-Bus. This is a convenience wrapper around dbus_g_connection_unregister_g_object(), and behaves similarly. object representing a connection to a bus an object previously exported with tp_dbus_daemon_register_object() Arrange for @callback to be called with the owner of @name as soon as possible (which might even be before this function returns!), then again every time the ownership of @name changes. If multiple watches are registered for the same @name, they will be called in the order they were registered. The D-Bus daemon The name whose ownership is to be watched Callback to call when the ownership is discovered or changes Arbitrary data to pass to @callback Called to destroy @user_data when the name owner watch is cancelled due to tp_dbus_daemon_cancel_name_owner_watch() The class of #TpDBusDaemon. Signature of a callback for functions that list bus names. object representing a connection to a bus constant %NULL-terminated array of constant strings representing bus names, or %NULL on error the error that occurred, or %NULL on success the same user data that was passed to tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names the same object that was passed to tp_dbus_daemon_list_names or tp_dbus_daemon_list_activatable_names The signature of the callback called by tp_dbus_daemon_watch_name_owner(). The D-Bus daemon The name whose ownership has changed or been discovered The unique name that now owns @name Arbitrary user-supplied data as passed to tp_dbus_daemon_watch_name_owner() #GError codes for use with the %TP_DBUS_ERRORS domain. Since 0.11.5, there is a corresponding #GEnumClass type, %TP_TYPE_DBUS_ERROR. Raised if the error raised by a remote D-Bus object is not recognised Emitted in #TpProxy::invalidated when the #TpProxy has lost its last reference Raised by #TpProxy methods if the remote object does not appear to have the required interface Emitted in #TpProxy::invalidated if the remote process loses ownership of its bus name, and raised by any #TpProxy methods that have not had a reply at that time or are called after the proxy becomes invalid in this way (usually meaning it crashed) Raised if a D-Bus bus name given is not valid, or is of an unacceptable type (e.g. well-known vs. unique) Raised if a D-Bus interface or error name given is not valid Raised if a D-Bus object path given is not valid Raised if a D-Bus method or signal name given is not valid A generic error which can be used with #TpProxy::invalidated to indicate an application-specific indication that the remote object no longer exists, if no more specific error is available. Raised from calls that re-enter the main loop (*_run_*) if they are cancelled Raised if information received from a remote object is inconsistent or otherwise obviously wrong (added in 0.7.17). See also %TP_ERROR_CONFUSED. A set of flags indicating which D-Bus bus names are acceptable. They can be combined with the bitwise-or operator to accept multiple types. %TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON and %TP_DBUS_NAME_TYPE_ANY are the bitwise-or of other appropriate types, for convenience. Since 0.11.5, there is a corresponding #GFlagsClass type, %TP_TYPE_DBUS_NAME_TYPE. accept unique names like :1.123 (not including the name of the bus daemon itself) accept well-known names like com.example.Service (not including the name of the bus daemon itself) accept the name of the bus daemon itself, which has the syntax of a well-known name, but behaves like a unique name accept either unique or well-known names, but not the bus daemon accept any of the above Structure representing all of a class's property implementations. One of these structures may be placed in the layout of an object class structure. In addition to the documented fields, there are 7 pointers reserved for future use, which must be initialized to %NULL. An array of interface implementations, terminated by one with @name equal to %NULL Initialize the class @cls to use the D-Bus Properties mixin. The given struct member, of size sizeof(TpDBusPropertiesMixinClass), will be used to store property implementation information. Each property and each interface must have been declared as a member of a GInterface implemented by @cls, using tp_svc_interface_set_dbus_properties_info(). Before calling this function, the array @interfaces must have been placed in the #TpDBusPropertiesMixinClass structure; if it would be empty, it may instead be %NULL. This function should be called from the class_init callback in such a way that it will only be called once, even if the class is subclassed. Changed in 0.7.9: TpDBusPropertiesMixinClass::interfaces may now be %NULL, which means that only interfaces whose properties are set up using tp_dbus_properties_mixin_implement_interface() will be used. Changed in 0.7.15: @offset may now be 0, in which case the #TpDBusPropertiesMixinClass can be omitted from @cls. It is treated as if it were present, but with all fields (including TpDBusPropertiesMixinClass::interfaces) being %NULL, so only interfaces whose properties are set using tp_dbus_properties_mixin_implement_interface() will be used. a subclass of #GObjectClass the offset within @cls of a TpDBusPropertiesMixinClass structure Bitfield representing allowed access to a property. At most one of %TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED and %TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED may be specified for a property. Since 0.11.5, there is a corresponding #GFlagsClass type, %TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS. The property can be read using Get and GetAll The property can be written using Set The property's new value is included in emissions of PropertiesChanged The property is announced as invalidated, without its value, in emissions of PropertiesChanged Signature of a callback used to get the value of a property. For simplicity, in this mixin we don't allow getting a property to fail; implementations must always be prepared to return *something*. The exported object with the properties A quark representing the D-Bus interface name A quark representing the D-Bus property name A GValue pre-initialized to the right type, into which to put the value The getter_data from the #TpDBusPropertiesMixinPropImpl Structure representing an implementation of an interface's properties. In addition to the documented fields, there are four pointers which must be initialized to %NULL. This structure must either be statically allocated, or duplicated and never freed, so it always remains valid. The name of the interface A callback to get the current value of the property, to which the @getter_data from each property implementation will be passed A callback to set a new value for the property, to which the @setter_data from each property implementation will be passed An array of property implementations, terminated by one with @name equal to %NULL Semi-abstract description of an interface. Each service GInterface that has properties must have one of these attached to it via tp_svc_interface_set_dbus_properties_info() in its base_init function; service GInterfaces that do not have properties may have one of these with no properties. This structure must either be statically allocated, or duplicated and never freed, so it always remains valid. In addition to the documented members, there are two private pointers for future expansion, which must always be initialized to %NULL. Quark representing the interface's name Array of property descriptions, terminated by one with @name == %NULL Structure representing an implementation of a property. In addition to the documented fields, there are three pointers which must be initialized to %NULL. This structure must either be statically allocated, or duplicated and never freed, so it always remains valid. The name of the property as it appears on D-Bus Arbitrary user-supplied data for the getter function Arbitrary user-supplied data for the setter function Semi-abstract description of a property, as attached to a service GInterface. This structure must either be statically allocated, or duplicated and never freed, so it always remains valid. In addition to the documented members, there are two private pointers for future expansion, which must always be initialized to %NULL. Quark representing the property's name Flags representing read/write access to the property The D-Bus signature of the property The GType used in a GValue to implement the property Signature of a callback used to get the value of a property. %TRUE on success, %FALSE (setting @error) on failure The exported object with the properties A quark representing the D-Bus interface name A quark representing the D-Bus property name The new value for the property The setter_data from the #TpDBusPropertiesMixinPropImpl Data structure representing a #TpDBusTubeChannel. Accept an incoming D-Bus tube. When the tube has been accepted @callback will be called. You can then call tp_dbus_tube_channel_accept_finish() to get the #GDBusConnection that will be used to communicate through the tube. an incoming #TpDBusTubeChannel a callback to call when the tube has been offered data to pass to @callback Finishes to accept an incoming D-Bus tube. The returned #GDBusConnection is ready to be used to exchange data through the tube. a reference on a #GDBusConnection if the tube has been successfully accepted and opened; %NULL otherwise. a #TpDBusTubeChannel a #GAsyncResult Return the parameters of the dbus-tube channel in a variant of type %G_VARIANT_TYPE_VARDICT whose keys are strings representing parameter names and values are variants representing corresponding parameter values set by the offerer when offering this channel. The GVariant returned is %NULL if this is an outgoing tube that has not yet been offered or the parameters property has not been set. Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() and similar functions for convenient access to the values. a new reference to a #GVariant a #TpDBusTubeChannel Return the #TpDBusTubeChannel:parameters property the value of #TpDBusTubeChannel:parameters a #TpDBusTubeChannel Return the #TpDBusTubeChannel:service-name property the value of #TpDBusTubeChannel:service-name a #TpDBusTubeChannel Offer an outgoing D-Bus tube. When the tube has been offered and accepted @callback will be called. You can then call tp_dbus_tube_channel_offer_finish() to get the #GDBusConnection that will be used to communicate through the tube. an outgoing #TpDBusTubeChannel parameters of the tube, or %NULL a callback to call when the tube has been offered data to pass to @callback Finishes offering an outgoing D-Bus tube. The returned #GDBusConnection is ready to be used to exchange data through the tube. a reference on a #GDBusConnection if the tube has been successfully offered and opened; %NULL otherwise. a #TpDBusTubeChannel a #GAsyncResult A string to #GValue #GHashTable representing the parameters of the tube. Will be %NULL for outgoing tubes until the tube has been offered. In high-level language bindings, use tp_dbus_tube_channel_dup_parameters_vardict() to get the same information in a more convenient format. A %G_VARIANT_TYPE_VARDICT representing the parameters of the tube. Will be %NULL for outgoing tubes until the tube has been offered. A string representing the service name that will be used over the tube. The class of a #TpDBusTubeChannel. The standard path for objects implementing the Telepathy Debug interface (#TpSvcDebug). Bitfield/set of flags generated from the Telepathy specification. <![CDATA[0]]> <![CDATA[1]]> <![CDATA[2]]> <![CDATA[3]]> <![CDATA[4]]> <![CDATA[5]]> <![CDATA[6]]> <![CDATA[7]]> <![CDATA[8]]> <![CDATA[9]]> <![CDATA[*]]> <![CDATA[#]]> <![CDATA[A]]> <![CDATA[B]]> <![CDATA[C]]> <![CDATA[D]]> A proxy object for the debug interface of a Telepathy component. <!-- --> a new debug client proxy, or %NULL on invalid arguments a D-Bus daemon; may not be %NULL the unique name of the process to be debugged; may not be %NULL or a well-known name Ensure that the known interfaces for TpDebugClient have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_DEBUG_CLIENT. Retrieve buffered messages from @self. Once @callback is called, use tp_debug_client_get_messages_finish() to retrieve the #TpDebugMessage objects. a #TpDebugClient callback to call when the messages have been retrieved data to pass to @callback Finishes tp_debug_client_set_enabled_async(). a #GPtrArray of #TpDebugMessage, free with g_ptr_array_unref() a #TpDebugClient a #GAsyncResult Return the #TpDebugClient:enabled property the value of #TpDebugClient:enabled property a #TpDebugClient Enable or disable publishing of debug messages on the bus by the component owning @self's bus name. a #TpDebugClient %TRUE if debug messages should be published on the bus, %FALSE otherwise a callback to call when the request is satisfied data to pass to @callback Finishes tp_debug_client_set_enabled_async(). %TRUE, if the operation suceeded, %FALSE otherwise a #TpDebugClient a #GAsyncResult %TRUE if debug messages are published on the bus. This property is meaningless until the %TP_DEBUG_CLIENT_FEATURE_CORE feature has been prepared. Emitted when a #TpDebugMessage is generated if the TpDebugMessage:enabled property is set to %TRUE. a #TpDebugMessage The class of a #TpDebugClient. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Log level for errors. Error messages are always fatal, resulting in the service terminating after something completely unexpected occurred. ]]> <![CDATA[ Log level for critical messages. Critical messages are messages that the service might predict and it is up to the service itself to decide whether to terminate following a critical message. ]]> <![CDATA[ Log level for warnings. ]]> <![CDATA[ Log level for messages. ]]> <![CDATA[ Log level for information messages. ]]> <![CDATA[ Log level for debug messages. ]]> Data structure representing a #TpDebugMessage. Return the #TpDebugMessage:category property the value of #TpDebugMessage:category property a #TpDebugMessage Return the #TpDebugMessage:domain property the value of #TpDebugMessage:domain property a #TpDebugMessage Return the #TpDebugMessage:level property the value of #TpDebugMessage:level property a #TpDebugMessage Return the #TpDebugMessage:message property the value of #TpDebugMessage:message property a #TpDebugMessage Return the #TpDebugMessage:time property the value of #TpDebugMessage:time property a #TpDebugMessage Category of the debug message, or %NULL if none was specified. Domain of the debug message. A #GLogLevelFlags representing the level of the debug message. Text of the debug message, stripped from its trailing whitespaces. Timestamp of the debug message. The class of a #TpDebugMessage. <![CDATA[ Flags indicating the level of support for delivery reporting on this channel, as found on the DeliveryReportingSupport property. Any future flags added to this set will conform to the convention that the presence of an extra flag implies that more operations will succeed. Note that CMs may always provide more reports than are requested in the Message_Sending_Flags passed to SendMessage. If senders want delivery reports, they should ask for them. If they don't want delivery reports, they can just ignore them, so there's no need to have capability discovery for what will happen if a delivery report isn't requested. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Clients MAY expect to receive negative delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending. ]]> <![CDATA[ Clients MAY expect to receive positive delivery reports if Message_Sending_Flag_Report_Delivery is specified when sending. ]]> <![CDATA[ Clients MAY expect to receive Delivery_Status Read reports if Message_Sending_Flag_Report_Read is specified when sending. ]]> <![CDATA[ Clients MAY expect to receive Delivery_Status Deleted reports if Message_Sending_Flag_Report_Deleted is specified when sending. ]]> <![CDATA[ The status of a message as indicated by a delivery report. If this enum is extended in future specifications, this should only be to add new, non-overlapping conditions (i.e. all failures should still be signalled as either Temporarily_Failed or Permanently_Failed). If additional detail is required (e.g. distinguishing between the various types of permanent failure) this will be done using additional Delivery_Report_Header_Keys. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The message's disposition is unknown. Clients SHOULD consider all messages to have status Delivery_Status_Unknown unless otherwise specified; connection managers SHOULD NOT signal this delivery status explicitly. ]]> <![CDATA[ The message has been delivered to the intended recipient. ]]> <![CDATA[ Delivery of the message has failed. Clients SHOULD notify the user, but MAY automatically try sending another copy of the message. Similar to errors with type="wait" in XMPP; analogous to 4xx errors in SMTP. ]]> <![CDATA[ Delivery of the message has failed. Clients SHOULD NOT try again unless by specific user action. If the user does not modify the message or alter configuration before re-sending, this error is likely to happen again. Similar to errors with type="cancel", type="modify" or type="auth" in XMPP; analogous to 5xx errors in SMTP. ]]> <![CDATA[ An intermediate server has accepted the message but the message has not been yet delivered to the ultimate recipient. The connection manager might send a Failed report or Delivered report later. Similar to "202 Accepted" success code in SIP; analogous to 251 and 252 responses in SMTP. ]]> <![CDATA[ The message has been read by the intended recipient. ]]> <![CDATA[ The message has been deleted by the intended recipient. This MAY be signalled on its own if the message is deleted without being read, or after Read if the message was read before being deleted. ]]> The common prefix of Telepathy errors, as a string constant, without the trailing '.' character. Enumerated type representing the Telepathy D-Bus errors. org.freedesktop.Telepathy.Error.NetworkError: Raised when there is an error reading from or writing to the network. org.freedesktop.Telepathy.Error.NotImplemented: Raised when the requested method, channel, etc is not available on this connection. org.freedesktop.Telepathy.Error.InvalidArgument: Raised when one of the provided arguments is invalid. org.freedesktop.Telepathy.Error.NotAvailable: Raised when the requested functionality is temporarily unavailable. org.freedesktop.Telepathy.Error.PermissionDenied: The user is not permitted to perform the requested operation. org.freedesktop.Telepathy.Error.Disconnected: The connection is not currently connected and cannot be used. This error may also be raised when operations are performed on a Connection for which StatusChanged has signalled status Disconnected for reason None. org.freedesktop.Telepathy.Error.InvalidHandle: An identifier being converted to a handle was syntactically invalid, or an invalid handle was used. org.freedesktop.Telepathy.Error.Channel.Banned: You are banned from the channel. org.freedesktop.Telepathy.Error.Channel.Full: The channel is full. org.freedesktop.Telepathy.Error.Channel.InviteOnly: The requested channel is invite-only. org.freedesktop.Telepathy.Error.NotYours: The requested channel or other resource already exists, and another client is responsible for it org.freedesktop.Telepathy.Error.Cancelled: Raised by an ongoing request if it is cancelled by user request before it has completed, or when operations are performed on an object which the user has asked to close (for instance, a Connection where the user has called Disconnect, or a Channel where the user has called Close). org.freedesktop.Telepathy.Error.AuthenticationFailed: Raised when authentication with a service was unsuccessful. org.freedesktop.Telepathy.Error.EncryptionNotAvailable: Raised if a user request insisted that encryption should be used, but encryption was not actually available. org.freedesktop.Telepathy.Error.EncryptionError: Raised if encryption appears to be available, but could not actually be used (for instance if SSL/TLS negotiation fails). org.freedesktop.Telepathy.Error.Cert.NotProvided: Raised if the server did not provide a SSL/TLS certificate. org.freedesktop.Telepathy.Error.Cert.Untrusted: Raised if the server provided a SSL/TLS certificate signed by an untrusted certifying authority. org.freedesktop.Telepathy.Error.Cert.Expired: Raised if the server provided an expired SSL/TLS certificate. org.freedesktop.Telepathy.Error.Cert.NotActivated: Raised if the server provided an SSL/TLS certificate that will become valid at some point in the future. org.freedesktop.Telepathy.Error.Cert.FingerprintMismatch: Raised if the server provided an SSL/TLS certificate that did not have the expected fingerprint. org.freedesktop.Telepathy.Error.Cert.HostnameMismatch: Raised if the server provided an SSL/TLS certificate that did not match its hostname. org.freedesktop.Telepathy.Error.Cert.SelfSigned: Raised if the server provided an SSL/TLS certificate that is self-signed and untrusted. org.freedesktop.Telepathy.Error.Cert.Invalid: Raised if the server provided an SSL/TLS certificate that is unacceptable in some way that does not have a more specific error. org.freedesktop.Telepathy.Error.NotCapable: Raised when requested functionality is unavailable due to a contact not having the required capabilities. org.freedesktop.Telepathy.Error.Offline: Raised when requested functionality is unavailable because a contact is offline. org.freedesktop.Telepathy.Error.Channel.Kicked: Used to represent a user being ejected from a channel by another user, for instance being kicked from a chatroom. org.freedesktop.Telepathy.Error.Busy: Used to represent a user being removed from a channel because of a "busy" indication. org.freedesktop.Telepathy.Error.NoAnswer: Used to represent a user being removed from a channel because they did not respond, e.g. to a StreamedMedia call. org.freedesktop.Telepathy.Error.DoesNotExist: Raised when the requested user does not, in fact, exist. org.freedesktop.Telepathy.Error.Terminated: Raised when a channel is terminated for an unspecified reason. In particular, this error SHOULD be used whenever normal termination of a 1-1 StreamedMedia call by the remote user is represented as a D-Bus error name. org.freedesktop.Telepathy.Error.ConnectionRefused: Raised when a connection is refused. org.freedesktop.Telepathy.Error.ConnectionFailed: Raised when a connection can't be established. org.freedesktop.Telepathy.Error.ConnectionLost: Raised when a connection is broken. org.freedesktop.Telepathy.Error.AlreadyConnected: Raised on attempts to connect again to an account that is already connected, if the protocol or server does not allow this. Since 0.7.34 org.freedesktop.Telepathy.Error.ConnectionReplaced: Used as disconnection reason for an existing connection if it is disconnected because a second connection to the same account is made. Since 0.7.34 org.freedesktop.Telepathy.Error.RegistrationExists: Raised on attempts to register an account on a server when the account already exists. Since 0.7.34 org.freedesktop.Telepathy.Error.ServiceBusy: Raised when a server or other infrastructure rejects a request because it is too busy. Since 0.7.34 org.freedesktop.Telepathy.Error.ResourceUnavailable: Raised when a local process rejects a request because it does not have enough of a resource, such as memory. Since 0.7.34 org.freedesktop.Telepathy.Error.WouldBreakAnonymity: Raised when a request cannot be satisfied without violating an earlier request for anonymity, and the earlier request specified that raising an error is preferable to disclosing the user's identity Since 0.11.7 org.freedesktop.Telepathy.Error.Cert.Revoked: Raised if the server provided an SSL/TLS certificate that has been revoked. Since 0.11.12 org.freedesktop.Telepathy.Error.Cert.Insecure: Raised if the server provided an SSL/TLS certificate that uses an insecure cipher algorithm or is cryptographically weak. Since 0.11.12 org.freedesktop.Telepathy.Error.Cert.LimitExceeded: Raised if the length in bytes of the server certificate, or the depth of the server certificate chain, exceed the limits imposed by the crypto library. Since 0.11.12 org.freedesktop.Telepathy.Error.NotYet: Raised when the requested functionality is not yet available, but is likely to become available after some time has passed. Since 0.11.15 org.freedesktop.Telepathy.Error.Rejected: Raised when an incoming or outgoing call is rejected by the receiving contact. Since 0.13.2 org.freedesktop.Telepathy.Error.PickedUpElsewhere: Raised when a call was terminated as a result of the local user picking up the call on a different resource. Since 0.13.3 org.freedesktop.Telepathy.Error.Confused: Raised if a server rejects protocol messages from a connection manager claiming that they do not make sense, two local processes fail to understand each other, or an apparently impossible situation is reached. This has a similar meaning to %TP_DBUS_ERROR_INCONSISTENT but can be passed between processes via D-Bus. Since 0.13.7 org.freedesktop.Telepathy.Error.ServiceConfused: Raised when a server or other piece of infrastructure indicates an internal error, or when a message that makes no sense is received from a server or other piece of infrastructure. Since 0.13.7 org.freedesktop.Telepathy.Error.EmergencyCallsNotSupported: Raised when a client attempts to dial a number that is recognized as an emergency number (e.g. '911' in the USA), but the Connection Manager or provider does not support dialling emergency numbers. org.freedesktop.Telepathy.Error.SoftwareUpgradeRequired: Raised when a Connection cannot be established because either the Connection Manager or its support library (e.g. wocky, papyon, sofiasip) requires upgrading to support a newer protocol version. <code>org.freedesktop.Telepathy.Error.InsufficientBalance</code>: Raised if the user has insufficient balance to place a call. The key 'balance-required' MAY be included in CallStateDetails on a Call channel (with the same units and scale as AccountBalance) to indicate how much credit is required to make this call. <code>org.freedesktop.Telepathy.Error.Media.CodecsIncompatible</code>: Raised when the local streaming implementation has no codecs in common with the remote side. Since 0.15.6 <code>org.freedesktop.Telepathy.Error.Media.UnsupportedType</code>: The media stream type requested is not supported by either the local or remote side. Since 0.15.6 <code>org.freedesktop.Telepathy.Error.Media.StreamingError</code>: Raised when the call's streaming implementation has some kind of internal error. Since 0.15.6 <code>org.freedesktop.Telepathy.Error.Media.CaptchaNotSupported</code>: Raised if no UI is available to present captchas, or if one is available but it is unable to answer any of the captchas given. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ No hash. ]]> <![CDATA[ MD5 digest as a string of 32 ASCII hex digits. ]]> <![CDATA[ SHA1 digest as a string of ASCII hex digits. ]]> <![CDATA[ SHA256 digest as a string of ASCII hex digits. ]]> Data structure representing a #TpFileTransferChannel. Convenient function to create a new #TpFileTransferChannel Use tp_simple_client_factory_ensure_channel() instead. a newly created #TpFileTransferChannel a #TpConnection; may not be %NULL the object path of the channel; may not be %NULL the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances Accept an incoming file transfer in the %TP_FILE_TRANSFER_STATE_PENDING state. Once the accept has been processed, @callback will be called. You can then call tp_file_transfer_channel_accept_file_finish() to get the result of the operation. a #TpFileTransferChannel a #GFile where the file should be saved Offset from the start of @file where transfer begins a callback to call when the transfer has been accepted data to pass to @callback Finishes a call to tp_file_transfer_channel_accept_file_async(). %TRUE if the accept operation was a success, or %FALSE a #TpFileTransferChannel a #GAsyncResult Return the #TpFileTransferChannel:date property the value of the #TpFileTransferChannel:date property a #TpFileTransferChannel Return the #TpFileTransferChannel:description property the value of the #TpFileTransferChannel:description property a #TpFileTransferChannel Return the #TpFileTransferChannel:filename property the value of the #TpFileTransferChannel:filename property a #TpFileTransferChannel Return the #TpFileTransferChannel:metadata property the value of the #TpFileTransferChannel:metadata property a #TpFileTransferChannel Return the #TpFileTransferChannel:mime-type property the value of the #TpFileTransferChannel:mime-type property a #TpFileTransferChannel Return the #TpFileTransferChannel:service-name property the value of the #TpFileTransferChannel:service-name property a #TpFileTransferChannel Return the #TpFileTransferChannel:size property the value of the #TpFileTransferChannel:size property a #TpFileTransferChannel Returns the #TpFileTransferChannel:state property. If @reason is not %NULL it is set to the reason why #TpFileTransferChannel:state changed to its current value. the value of the #TpFileTransferChannel:state property a #TpFileTransferChannel a #TpFileTransferStateChangeReason, or %NULL Return the #TpFileTransferChannel:transferred-bytes property the value of the #TpFileTransferChannel:transferred-bytes property a #TpFileTransferChannel Provide a file transfer. This should be called when the file transfer state changes (tp_file_transfer_channel_get_state() and the "notify::state" signal) to %TP_FILE_TRANSFER_STATE_ACCEPTED or %TP_FILE_TRANSFER_STATE_PENDING. Once the file has been provided, the channel #TpFileTransferChannel:state will change to %TP_FILE_TRANSFER_STATE_OPEN. Once the file has been provided, @callback will be called. You should then call tp_file_transfer_channel_provide_file_finish() to get the result of the operation. a #TpFileTransferChannel a #GFile to send to the remote contact a callback to call when the transfer has been accepted data to pass to @callback Finishes a call to tp_file_transfer_channel_provide_file_async(). Successful return from this function does not mean that the file transfer has completed or has even started at all. The state of the file transfer should be monitored with the "notify::state" signal. %TRUE if the file has been successfully provided, or %FALSE. a #TpFileTransferChannel a #GAsyncResult A #GDateTime representing the last modification time of the file to be transferred. Since 0.15.5 The description of the file transfer, defined by the sender when sending the file transfer offer. Since 0.15.5 For incoming file transfers, this property will be set to a #GFile for the location where the file will be saved (given by tp_file_transfer_channel_accept_file_async()) when the transfer starts. The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE must already be prepared for this property to have a meaningful value, and to receive change notification. Once the initial value is set, this property will not be changed. For outgoing file transfers, this property is a #GFile for the location of the file being sent (given by tp_file_transfer_channel_provide_file_async()). The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE does not have to be prepared and there is no change notification. The name of the file on the sender's side. This is therefore given as a suggested filename for the receiver. Since 0.15.5 The offset in bytes from where the file should be sent. The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date. Additional information about the file transfer set by the channel initiator, or an empty #GHashTable if the initiator did not provide any additional information. To provide metadata along with a file offer, include %TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA in the channel request. For example: |[ GHashTable *request; GHashTable *metadata = g_hash_table_new (g_str_hash, g_str_equal); const gchar * const values[] = { "Jason Derulo", "Tinie Tempah", NULL }; g_hash_table_insert (metadata, "best buds", values); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "foo@bar.com", TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, "text/plain", TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, G_TYPE_INT64, 1320925992, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, G_TYPE_STRING, "", TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, "test.pdf", TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, G_TYPE_UINT64, 0, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, 165710, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA, TP_TYPE_METADATA, metadata, NULL); ... ]| The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful. The MIME type of the file to be transferred. A string representing the name of the service suggested to handle this file transfer channel, or %NULL if the initiator did not provide one. This is a useful way of requesting file transfer channels with a hint of what handler they should be handled by on the remote side. If a channel request is made with this property set (to a contact who also supports the metadata extension; see the requestable channel classes for said contact), this property will be set to the same value on the remote incoming channel and handlers can match on this in their handler filter. For example, a remote handler could call the following: |[ tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, G_TYPE_STRING, "service.name", NULL)); ]| The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful. The size of the file to be transferred, or %G_MAXUINT64 if not known. Since 0.15.5 A TpFileTransferState holding the state of the file transfer. The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date. Since 0.17.1 The number of bytes transferred so far in this file transfer. The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be prepared for this property to be meaningful and kept up to date. The class of a #TpFileTransferChannel. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ An invalid state type used as a null value. This value MUST NOT appear in the State property. ]]> <![CDATA[ The file transfer is waiting to be accepted/closed by the receiver. The receiver has to call AcceptFile, then wait for the state to change to Open and check the offset value. ]]> <![CDATA[ The receiver has accepted the transfer. The sender now has to call ProvideFile to actually start the transfer. The receiver should now wait for the state to change to Open and check the offset value. ]]> <![CDATA[ The file transfer is open for traffic. ]]> <![CDATA[ The file transfer has been completed successfully. ]]> <![CDATA[ The file transfer has been cancelled. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ No reason was specified. ]]> <![CDATA[ The change in state was requested. ]]> <![CDATA[ The file transfer was cancelled by the local user. ]]> <![CDATA[ The file transfer was cancelled by the remote user. ]]> <![CDATA[ The file transfer was cancelled because of a local error. ]]> <![CDATA[ The file transfer was cancelled because of a remote error. ]]> Structure representing the group mixin as used in a particular class. To be placed in the implementation's instance structure. All fields should be considered read-only. The connection's contact handle repository The local user's handle within this group, or 0 if none. Set using tp_group_mixin_init() and tp_group_mixin_change_self_handle(). This group's flags. Set using tp_group_mixin_change_flags(); defaults to 0. The members of the group. Alter using tp_group_mixin_change_members(). Members awaiting the local user's approval to join the group. Alter using tp_group_mixin_change_members(). Members awaiting remote (e.g. remote user or server) approval to join the group. Alter using tp_group_mixin_change_members(). Pointer to opaque private data Note that the given local handle is an alias within this group for the given globally-valid handle. It will be returned from subsequent GetHandleOwner queries where appropriate. Changed in 0.7.10: The @owner_handle may be 0. To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owners(). A GObject implementing the group interface with this mixin A contact handle valid within this group (may not be 0) A contact handle valid globally, or 0 if the owner of the @local_handle is unknown Note that the given local handles are aliases within this group for the given globally-valid handles. To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owner(). A GObject implementing the group interface with this mixin A map from contact handles valid within this group (which may not be 0) to either contact handles valid globally, or 0 if the owner of the corresponding key is unknown; all handles are stored using GUINT_TO_POINTER Request that the given contacts be added to the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. Otherwise attempt to add the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message associated with the addition request, if supported Request a change to be made to the flags. If any flags were actually set or cleared, emits the GroupFlagsChanged signal with the changes. It is an error to set any of the same bits in both @add and @del. Changed in 0.7.7: the signal is not emitted if adding @add and removing @del had no effect on the existing group flags. An object implementing the groups interface using this mixin Flags to be added Flags to be removed Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op. This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly. If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that. Each of the TpIntset arguments may be %NULL, which is treated as equivalent to an empty set. %TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; %FALSE if nothing actually changed and the signals were suppressed. An object implementing the group interface using this mixin A message to be sent to the affected contacts if possible; %NULL is allowed, and is mapped to an empty string A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present) A set of contact handles to be removed from members, local pending or remote pending, wherever they are present A set of contact handles to be added to local pending, and removed from members and remote pending A set of contact handles to be added to remote pending, and removed from members and local pending The handle of the contact responsible for this change The reason for this change Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op. This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly. If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that. Each of the TpIntset arguments may be %NULL, which is treated as equivalent to an empty set. details may contain, among other entries, the well-known keys (and corresponding type, wrapped in a GValue) defined by the Group.MembersChangedDetailed signal's specification; these include "actor" (a handle as G_TYPE_UINT), "change-reason" (an element of #TpChannelGroupChangeReason as G_TYPE_UINT), "message" (G_TYPE_STRING), "error" (G_TYPE_STRING), "debug-message" (G_TYPE_STRING). If all of the information in details could be passed to tp_group_mixin_change_members() then calling this function instead provides no benefit. Calling this function without setting #TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED with tp_group_mixin_change_members() first is not very useful, as clients will not know to listen for MembersChangedDetailed and thus will miss the details. %TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; %FALSE if nothing actually changed and the signals were suppressed. An object implementing the group interface using this mixin A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present) A set of contact handles to be removed from members, local pending or remote pending, wherever they are present A set of contact handles to be added to local pending, and removed from members and remote pending A set of contact handles to be added to remote pending, and removed from members and local pending a map from strings to GValues detailing the change Change the self-handle for this group to the given value. An object implementing the group interface using this mixin The new self-handle for this group Unreference handles and free resources used by this mixin. An object implementing the group interface using this mixin Get the group's current and pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint representing the handles of the group's members Used to return a newly-allocated GArray of guint representing the handles of the group's local pending members Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members An implementation of #TpDBusPropertiesMixinGetter which assumes that the @object has the group mixin. It can only be used for the Group interface. An object with this mixin Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP A quark representing the D-Bus property name, either "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", "RemotePendingMembers" or "SelfHandle" A GValue pre-initialized to the right type, into which to put the value Ignored Set the guint pointed to by ret to this group's flags, to be interpreted according to TpChannelGroupFlags. %TRUE An object implementing the group mixin using this interface Used to return the flags If the mixin has the flag %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, return the global owners of the given local handles, or 0 where unavailable. %TRUE (setting @ret) on success, %FALSE (setting @error) on failure An object implementing the group interface with this mixin An array of guint representing locally valid handles Used to return an array of guint representing globally valid handles, or 0 where unavailable, if %TRUE is returned Get the group's local-pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint contact handles Get the group's local-pending members and information about their requests to join the channel. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GPtrArray of D-Bus structures each containing the handle of a local-pending contact, the handle of a contact responsible for adding them to the group (or 0), the reason code and a related message (e.g. their request to join the group) Get the group's current members %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint contact handles <!--Returns: says it all--> the quark used for storing mixin offset on a GObject Get the group's remote-pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members Set the guint pointed to by ret to the local user's handle in this group, or to 0 if the local user is not present in this group. %TRUE. An object implementing the group mixin using this interface Used to return the local user's handle in this group Fill in the vtable entries needed to implement the group interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A #TpSvcChannelInterfaceGroupClass Unused Initialize the mixin. An object implementing the group interface using this mixin The offset of the TpGroupMixin structure within the instance structure The connection's handle repository for contacts The handle of the local user in this group, if any Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of the Group interface's properties. This uses tp_group_mixin_get_dbus_property() as the property getter and sets up a list of the supported properties for it. Having called this, you should add #TP_CHANNEL_GROUP_FLAG_PROPERTIES to any channels of this class with tp_group_mixin_change_flags() to indicate that the DBus properties are available. The class of an object with this mixin Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message to be sent to those contacts, if supported Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message to be sent to those contacts, if supported A #TpChannelGroupChangeReason Signature of the callback used to add a member to the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be added. %TRUE on success, %FALSE with @error set on error An object implementing the group interface with this mixin The handle of the contact to be added A message to be sent if the protocol supports it Structure representing the group mixin as used in a particular class. To be placed in the implementation's class structure. Initialize this with tp_group_mixin_class_init(). All fields should be considered read-only. The add-member function that was passed to tp_group_mixin_class_init() The remove-member function that was passed to tp_group_mixin_class_init() Pointer to opaque private data Configure the mixin to allow attempts to remove the SelfHandle from this Group, even if the group flags would otherwise disallow this. The channel's #TpGroupMixinRemMemberFunc or #TpGroupMixinRemMemberWithReasonFunc will be called as usual for such attempts, and may make them fail with %TP_ERROR_PERMISSION_DENIED if required. This function should be called from the GObject @class_init callback, after calling tp_group_mixin_class_init(). (Recent telepathy-spec changes make it valid to try to remove the self-handle at all times, regardless of group flags. However, if this was implemented automatically in TpGroupMixin, this would risk crashing connection manager implementations that assume that TpGroupMixin will enforce the group flags strictly. As a result, connection managers should call this function to indicate to the TpGroupMixin that it may call their removal callback with the self-handle regardless of flag settings.) The class of an object implementing the group interface using this mixin <!--Returns: says it all--> the quark used for storing mixin offset on a GObjectClass Configure the mixin for use with the given class. The class of an object implementing the group interface using this mixin The offset of the TpGroupMixinClass structure within the class structure A callback to be used to add contacts to this group A callback to be used to remove contacts from this group. This must be %NULL if you will subsequently call tp_group_mixin_class_set_remove_with_reason_func(). Set a callback to be used to implement RemoveMembers() and RemoveMembersWithReason(). If this function is called during class initialization, the given callback will be used instead of the remove callback passed to tp_group_mixin_class_init() (which must be %NULL in this case). The class of an object implementing the group interface using this mixin A callback to be used to remove contacts from this group with a specified reason. Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed. %TRUE on success, %FALSE with @error set on error An object implementing the group interface with this mixin The handle of the contact to be removed A message to be sent if the protocol supports it Signature of the callback used to remove a member from the group. This should perform the necessary operations in the underlying IM protocol to cause the member to be removed. Set this with tp_group_mixin_class_set_remove_with_reason_func(), . %TRUE on success, %FALSE with @error set on error An object implementing the group interface with this mixin The handle of the contact to be removed A message to be sent if the protocol supports it A #TpChannelGroupChangeReason indicating the reason <!-- --> a #GObject instance <!-- --> a #GObjectClass structure <![CDATA[ The HTTP Method with which to request a URL. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Use the GET method when opening the URL. ]]> <![CDATA[ Use the POST method when opening the URL. Refer to HTTP_Post_Data for more details. ]]> Data structure representing the context of a Handler.HandleChannels() call. Called by #TpBaseClientClassAddDispatchOperationImpl when it's done so the D-Bus method can return. The caller is responsible for closing channels with tp_cli_channel_call_close() when it has finished handling them. a #TpHandleChannelsContext Called by #TpBaseClientClassAddDispatchOperationImpl to indicate that it implements the method in an async way. The caller must take a reference to the #TpHandleChannelsContext before calling this function, and is responsible for calling either tp_handle_channels_context_accept() or tp_handle_channels_context_fail() later. a #TpHandleChannelsContext Called by #TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error. a #TpHandleChannelsContext the error to return from the method Return any extra information that accompanied this request to handle channels (the Handler_Info argument from the HandleChannels D-Bus method). Well-known keys for this map will be defined by the Telepathy D-Bus Interface Specification; at the time of writing, none have been defined. The returned hash table is only valid for as long as @self is. extensible extra handler information, in a form suitable for use with tp_asv_get_string() etc. a channel-handling context Return a list of the #TpChannelRequest which have been satisfied by the channels associated with #self. a newly allocated #GList of reffed #TpChannelRequest. a channel-handling context A #TpAccount object representing the Account of the DispatchOperation that has been passed to HandleChannels. Read-only except during construction. This property can't be %NULL. A #GPtrArray containing #TpChannel objects representing the channels that have been passed to HandleChannels. Read-only except during construction. This property can't be %NULL. A #TpConnection object representing the Connection of the DispatchOperation that has been passed to HandleChannels. Read-only except during construction. This property can't be %NULL. The #DBusGMethodInvocation representing the D-Bus context of the HandleChannels call. Can only be written during construction. A #GHashTable where the keys are string and values are GValue instances. It represents the Handler_info hash table that has been passed to HandleChannels. This property can't be %NULL. A #GPtrArray containing #TpChannelRequest objects representing the requests that have been passed to HandleChannels. Read-only except during construction. This property can't be %NULL. The time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time for details) Read-only except during construction. Emitted when tp_handle_channels_context_accept has been called on @self. The class of a #TpHandleChannelsContext. Dummy typedef representing any implementation of this interface. The class of a handle repository interface. The structure layout is only available within telepathy-glib, for the handle repository implementations' benefit. A set of handles. This is similar to a #TpIntset (and implemented using one), but adding a handle to the set also references it. Creates a new #TpHandleSet A new #TpHandleSet #TpHandleRepoIface that holds the handles to be reffed by this set Creates a new #TpHandleSet from a specified handle repository and single handle. A new #TpHandleSet #TpHandleRepoIface that holds the handles to be reffed by this set a valid handle Creates a new #TpHandleSet A new #TpHandleSet #TpHandleRepoIface that holds the handles to be reffed by this set array of handles to be referenced by this set Creates a new #TpHandleSet from a specified handle repository and set of handles. A new #TpHandleSet #TpHandleRepoIface that holds the handles to be reffed by this set a set of handles, which must all be valid Add a handle to a #TpHandleSet, and reference it in the attached #TpHandleRepoIface #TpHandleSet to add this handle to handle to add Remove every handle from @set, releasing the references it holds. #TpHandleSet to clear Creates a new #TpHandleSet with the same contents as @other. a new set another handle set Delete a #TpHandleSet and unreference any handles that it holds #TpHandleSet to destroy Remove a set of handles from a handle set, dereferencing those which are members. The TpIntset returned must be freed with tp_intset_destroy. If you want to be able to inspect the handles in the set returned, you must ensure that this function does not cause their refcount to drop to zero, for instance by temporarily taking a reference to all the handles in @remove, calling this function, doing something with the result and discarding the temporary references. the handles which were dereferenced and removed (some subset of @remove). a #TpHandleSet to update a #TpIntset of handles to remove Format a #TpHandleSet for debug output. a string representation of the handle set suitable for debug output a handle set Call @func(@set, @handle, @userdata) for each handle in @set. A set of handles A callback Arbitrary data to pass to @func Return the same thing as <code>(tp_handle_set_size (set) == 0)</code>, but calculated more efficiently. %TRUE if the set has no members #TpHandleSet to check Check if the handle is in this set TRUE if the handle is in this set A #TpHandleSet handle to check <!--Returns: says it all, this comment is just to keep gtkdoc happy--> the underlying #TpIntset used by this #TpHandleSet #TpHandleSet to peek at Remove a handle from a #TpHandleSet, and unreference it in the attached #TpHandleRepoIface FALSE if the handle was invalid, or was not in this set #TpHandleSet to remove this handle from handle to remove <!--no further documentation needed--> the number of handles in this set A set of handles <!--Returns: says it all, this comment is just to keep gtkdoc happy--> a newly-allocated GArray of guint representing the handles in the set A handle set Returns a dictionary mapping each handle in @self to the corresponding identifier, as if retrieved by calling tp_handle_inspect() on each handle. The type of the returned value is described as <code>Handle_Identifier_Map</code> in the Telepathy specification. a map from the handles in @self to the corresponding identifier. a handle set Add a set of handles to a handle set, referencing those which are not already members. The TpIntset returned must be freed with tp_intset_destroy. the handles which were added (some subset of @add) a #TpHandleSet to update a #TpIntset of handles to add Associates a blob of data with a given handle and a given key If @destroy is set, then the data is freed when the handle is freed. Since version 0.13.8, handles always last as long as the connection, so @destroy will not be called until the connection disconnects. Since 0.19.9. It is not recommended to use this function because the associated data won't be freed until the connection disconnects. A handle repository implementation A handle to set data on Key id to associate data with data to associate with handle A #GDestroyNotify to call to destroy the data, or NULL if not needed. Signature of the callback used to iterate over the handle set in tp_handle_set_foreach(). The set of handles on which tp_handle_set_foreach() was called A handle in the set Arbitrary user data as supplied to tp_handle_set_foreach() Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ A "null" handle type used to indicate the absence of a handle. When a handle type and a handle appear as a pair, if the handle type is zero, the handle must also be zero. ]]> <![CDATA[ A contact ]]> <![CDATA[ A chat room ]]> <![CDATA[ A server-generated contact list (see Channel.Interface.Group) ]]> <![CDATA[ A user-defined contact list (see Channel.Interface.Group) ]]> A special value for #TpConnectionStatus, used within GLib connection managers to indicate that the connection is disconnected because connection has never been attempted (as distinct from disconnected after connection has started, either by user request or an error). Must never be visible on the D-Bus - %TP_CONNECTION_STATUS_DISCONNECTED is sent instead. A suitable static initializer for a #TpIntsetIter, to be used as follows: <informalexample><programlisting> void do_something (const TpIntset *intset) { TpIntsetIter iter = TP_INTSET_ITER_INIT (intset); /<!-- -->* ... do something with iter ... *<!-- -->/ } </programlisting></informalexample> since 0.19.0. Use #TpIntsetFastIter instead A set of integers A callback function acting on unsigned integers. The relevant integer Opaque user data Opaque type representing a set of unsigned integers. Before 0.11.16, this type was called <type>TpIntSet</type>, which is now a backwards compatibility typedef. Allocate a new integer set. a new, empty integer set to be destroyed with tp_intset_destroy() Allocate a new integer set containing the given integer. a new integer set containing @element, to be destroyed with tp_intset_destroy() integer to add to a new set Allocate a new integer set. a new, empty integer set to be destroyed with tp_intset_destroy() ignored (it was previously 1 more than the largest integer you expect to store) Add an integer into a TpIntset. set integer to add Unset every integer in the set. set <!--Returns: says it all--> A set containing the same integers as @orig, to be freed with tp_intset_destroy() by the caller A set of integers Free all memory used by the set. set <!--Returns: says it all--> The set of those integers which are in @left and not in @right (analogous to the bitwise operation left & (~right)), to be freed with tp_intset_destroy() by the caller The left operand The right operand Remove each integer in @other from @self, analogous to the bitwise operation self &= (~other). the set to change members to remove <!--Returns: says it all--> a string which the caller must free with g_free, listing the numbers in @set in a human-readable format An integer set Call @func(element, @userdata) for each element of @set, in order. set @TpIntFunc to use to iterate the set user data to pass to each call of @func <!--Returns: says it all--> The set of those integers which are in both @left and @right (analogous to the bitwise operation left & right), to be freed with tp_intset_destroy() by the caller The left operand The right operand Return the same thing as <code>(tp_intset_size (set) == 0)</code>, but calculated more efficiently. %TRUE if @set is empty a set of integers <!--Returns: says it all--> %TRUE if @left and @right contain the same bits A set of integers A set of integers Tests if @element is a member of @set %TRUE if @element is in @set set integer to test Remove an integer from a TpIntset %TRUE if @element was previously in @set set integer to add <!--Returns: says it all--> The number of integers in @set A set of integers <!--Returns: says it all--> The set of those integers which are in either @left or @right but not both (analogous to the bitwise operation left ^ right), to be freed with tp_intset_destroy() by the caller The left operand The right operand <!--Returns: says it all--> a GArray of guint (which must be freed by the caller) containing the same integers as @set. set to convert <!--Returns: says it all--> The set of those integers which are in either @left or @right (analogous to the bitwise operation left | right), to be freed with tp_intset_destroy() by the caller The left operand The right operand Add each integer in @other to @self, analogous to the bitwise operation self |= other. the set to change members to add <!--Returns: says it all--> A set containing the same integers as @array. An array of guint An opaque structure representing iteration in undefined order over a set of integers. Must be initialized with tp_intset_fast_iter_init(). Before 0.11.16, this type was called <type>TpIntSetFastIter</type>, which is now a backwards compatibility typedef. Usage is similar to #GHashTableIter: <informalexample><programlisting> TpIntsetFastIter iter; guint element; tp_intset_fast_iter_init (&amp;iter, intset); while (tp_intset_fast_iter_next (&amp;iter, &amp;element)) { printf ("%u is in the intset\n", element); } </programlisting></informalexample> Initialize @iter to iterate over @set in arbitrary order. @iter will become invalid if @set is modified. an iterator a set Advances @iter and retrieves the integer it now points to. Iteration is not necessarily in numerical order. %FALSE if the end of the set has been reached an iterator a location to store a new integer, in arbitrary order A structure representing iteration over a set of integers. Must be initialized with either TP_INTSET_ITER_INIT() or tp_intset_iter_init(). Since 0.11.6, consider using #TpIntsetFastIter if iteration in numerical order is not required. Before 0.11.16, this type was called <type>TpIntSetIter</type>, which is now a backwards compatibility typedef. since 0.19.0. Use #TpIntsetFastIter instead The set iterated over. Must be (guint)(-1) before iteration starts. Set to the next element in the set by tp_intset_iter_next(); undefined after tp_intset_iter_next() returns %FALSE. Reset the iterator @iter to the beginning and make it iterate over @set. since 0.19.0. Use #TpIntsetFastIter instead An integer set iterator to be initialized. An integer set to be used by that iterator If there are integers in (@iter->set) higher than (@iter->element), set (iter->element) to the next one and return %TRUE. Otherwise return %FALSE. Usage: <informalexample><programlisting> TpIntsetIter iter = TP_INTSET_INIT (intset); while (tp_intset_iter_next (&amp;iter)) { printf ("%u is in the intset\n", iter.element); } </programlisting></informalexample> Since 0.11.6, consider using #TpIntsetFastIter if iteration in numerical order is not required. %TRUE if (@iter->element) has been advanced An iterator originally initialized with TP_INTSET_INIT(set) Reset the iterator @iter to the beginning. It must already be associated with a set. since 0.19.0. Use #TpIntsetFastIter instead An integer set iterator to be reset. <![CDATA[ The hold state of a channel. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ All streams are unheld (the call is active). New channels SHOULD have this hold state. ]]> <![CDATA[ All streams are held (the call is on hold) ]]> <![CDATA[ The connection manager is attempting to move to state Held, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information. ]]> <![CDATA[ The connection manager is attempting to move to state Unheld, but has not yet completed that operation. It is unspecified whether any, all or none of the streams making up the channel are on hold. Examining the Hold state of Call Contents (if applicable) may provide more useful information. ]]> <![CDATA[ The reason for a change to the Local_Hold_State. Clients MUST treat unknown values as equivalent to Local_Hold_State_Reason_None. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The reason cannot be described by any of the predefined values (connection managers SHOULD avoid this reason, but clients MUST handle it gracefully) ]]> <![CDATA[ The change is in response to a user request ]]> <![CDATA[ The change is because some resource was not available ]]> <![CDATA[ Flags describing the Location features which may be supported on any given connection. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Indicates that setting your own location with SetLocation is supported on this connection. ]]> <![CDATA[ Flags representing capabilities provided by a connection manager. Those values can be used as bitfield. Some flags depend on, or conflict with, each other. Connections SHOULD implement as many of these features as the underlying protocol allows, preferring to implement Supports_Unread_Mails instead of Emits_Mails_Received if both are possible. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ This Connection provides the number of unread e-mails (or e-mail threads) in the main folder of your e-mail account, as the UnreadMailCount property. The connection manager will update this value by emitting the UnreadMailsChanged signal. ]]> <![CDATA[ This Connection provides a detailed list of unread e-mails, as the UnreadMails property. If this flag is set, Supports_Unread_Mail_Count MUST be set, and Emits_Mails_Received MUST NOT be set. The Connection will update the list by emitting the UnreadMailsChanged signals. ]]> <![CDATA[ This Connection emits the MailsReceived signal, which provides details about newly arrived e-mails but does not maintain their read/unread status afterwards. This flag MUST NOT be combined with Supports_Unread_Mails. ]]> <![CDATA[ This Connection can provide a URL (with optional POST data) to open the the inbox of the e-mail account in a web-based client, via the RequestInboxURL method. ]]> <![CDATA[ This Connection can provide a URL (with optional POST data) to open a specific mail in a web-based client, via the RequestMailURL method. This feature is not useful unless either Emits_Mails_Received or Supports_Unread_Mails is set. If this flag is not set, clients SHOULD fall back to using RequestInboxURL if available. ]]> <![CDATA[ Each Mail represents a thread of e-mails, which MAY have more than one sender. Google Talk notifies users about new mail in terms of unread threads, rather than unread e-mails. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[UDP (User Datagram Protocol)]]> <![CDATA[TCP (Transmission Control Protocol)]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[Media are not being sent or received]]> <![CDATA[Media are being sent, but not received]]> <![CDATA[Media are being received, but not sent]]> <![CDATA[Media are being sent and received]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ An unknown error occured. ]]> <![CDATA[ The end of the stream was reached. ]]> <![CDATA[ There are no common codecs between the local side and the other particpants in the call. The possible codecs are not signalled here: the streaming implementation is assumed to report them in an implementation-dependent way, e.g. Farsight should use GstMissingElement. ]]> <![CDATA[ A network connection for the Media could not be established or was lost. ]]> <![CDATA[ There was an error in the networking stack (other than the connection failure). ]]> <![CDATA[ There are no installed codecs for this media type. ]]> <![CDATA[ The CM is doing something wrong. ]]> <![CDATA[ There was an error in the media processing stack. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The local user has been asked to send media by the remote user. Call RequestStreamDirection to indicate whether or not this is acceptable. ]]> <![CDATA[ The remote user has been asked to send media by the local user. The StreamDirectionChanged signal will be emitted when the remote user accepts or rejects this change. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[The stream is disconnected.]]> <![CDATA[The stream is trying to connect.]]> <![CDATA[The stream is connected.]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ A local address ]]> <![CDATA[ An external address derived by a method such as STUN ]]> <![CDATA[ An external stream relay ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[An audio stream]]> <![CDATA[A video stream]]> Opaque structure representing a message in the Telepathy messages interface (an array of at least one mapping from string to variant, where the first mapping contains message headers and subsequent mappings contain the message body). This base class provides convenience API for most of the common keys that can appear in the header. One notable exception is the sender of the message. Inside a connection manager, messages are represented by the #TpCMMessage subclass, and you should use tp_cm_message_get_sender(). When composing a message in a client using #TpClientMessage, messages do not have an explicit sender (the sender is automatically the local user). When a client sees a sent or received message signalled by the connection manager (represented by #TpSignalledMessage), the message's sender (if any) can be accessed with tp_signalled_message_get_sender(). Append a body part to the message. the part number a message <!-- nothing more to say --> the number of parts in the message, including the headers in part 0 a message Remove the given key and its value from the given part. %TRUE if the key previously existed a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part Delete the given body part from the message. a message a part number, which must be strictly greater than 0, and strictly less than the number returned by tp_message_count_parts() Since 0.13.9 this function is a simple wrapper around g_object_unref() a message <!-- nothing more to say --> the current contents of the given part, or %NULL if the part number is out of range a message a part number <!-- --> the type of this message a message Return the incoming message ID of @self. Only incoming messages have such ID, for outgoing ones this function returns 0 and set @valid to %FALSE. the incoming message ID. a message either %NULL, or a location in which to store %TRUE if @self contains a pending message ID. Return when this message was received locally, as a number of seconds since the beginning of 1970 in the UTC timezone (the same representation used by g_date_time_new_from_unix_utc(), for instance), or 0 if not known. a Unix timestamp, or 0 a message Return when this message was sent, as a number of seconds since the beginning of 1970 in the UTC timezone (the same representation used by g_date_time_new_from_unix_utc(), for instance), or 0 if not known. If this protocol does not track the time at which the message was initially sent, this timestamp might be approximated by using the time at which it arrived at a central server. a Unix timestamp, or 0 a message If this message is specific to a particular D-Bus interface and should be ignored by clients without knowledge of that interface, return the name of the interface. If this message is an ordinary message or delivery report, return %NULL. a D-Bus interface name, or %NULL for ordinary messages and delivery reports a message If this message replaces a previous message, return the value of tp_message_get_token() for that previous message. Otherwise, return %NULL. For instance, a user interface could replace the superseded message with this message, or grey out the superseded message. a non-empty opaque identifier, or %NULL if none a message Return this message's identifier in the underlying protocol. This is <emphasis>not</emphasis> guaranteed to be unique, even within the scope of a single channel or contact: the only guarantee made is that two messages with different non-empty tokens are different messages. If there is no suitable token, return %NULL. a non-empty opaque identifier, or %NULL if none a message If this message is a delivery report indicating success or failure of delivering a message, return %TRUE. %TRUE if this is a delivery report a message Check if @self is mutable. Only mutable messages can be modified using functions such as tp_message_set_string(). %TRUE if the message is mutable. a #TpMessage Returns %TRUE if this incoming message has been seen in a previous channel during the lifetime of the Connection, but had not been acknowledged when that channel closed, causing an identical channel (in which the message now appears) to open. Loggers should check this flag to avoid duplicating messages, for instance. %TRUE if this message was seen in a previous Channel on this Connection a message <!-- no more to say --> %TRUE if this message is part of a replay of message history, for instance in an XMPP chatroom. a message <!-- nothing more to say --> the #GHashTable used to implement the given part, or %NULL if the part number is out of range. The hash table is only valid as long as the message is valid and the part is not deleted. a message a part number Reference the given handle until this message is destroyed. since 0.13.9. Handles are now immortal so there is no point to ref them. Furthermore, the only handle that should be stored in a TpMessage is message-sender which should be set using tp_cm_message_set_sender(). a message a handle type, greater than %TP_HANDLE_TYPE_NONE and less than %TP_NUM_HANDLE_TYPES a handle of the given type Set @key in part @part of @self to have a copy of @source as its value. If @source represents a data structure containing handles, they should all be referenced with tp_message_ref_handle() first. In high-level language bindings, use tp_message_set_variant() instead. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a value, encoded as dbus-glib would Set @key in part @part of @self to have @b as a boolean value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a boolean value Set @key in part @part of @self to have @bytes as a byte-array value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a number of bytes an array of @len bytes If @handle_or_0 is not zero, reference it with tp_message_ref_handle(). Set @key in part @part of @self to have @handle_or_0 as an unsigned integer value. Since 0.13.9 this function has been deprecated in favor or tp_cm_message_set_sender() as 'message-sender' is the only handle you can put in a #TpCMMessage. since 0.13.9. Use tp_cm_message_set_sender() a #TpCMMessage a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a handle type a handle of that type, or 0 Set @key in part @part of @self to have @i as a signed integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an integer value Set @key in part @part of @self to have @i as a signed integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an integer value Set @key in part @part of @self to have @s as a string value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a string value Set @key in part @part of @self to have a string value constructed from a printf-style format string. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a printf-style format string for the string value arguments for the format string Set @key in part @part of @self to have @u as an unsigned integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an unsigned integer value Set @key in part @part of @self to have @u as an unsigned integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an unsigned integer value Set @key in part @part of @self to have @value as its value. If @value is a floating reference (see g_variant_ref_sink()), then this function will take ownership of it. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part a value Set @key in part @part of @self to have @message as an aa{sv} value (that is, an array of Message_Part), and take ownership of @message. The caller should not use @message after passing it to this function. All handle references owned by @message will subsequently belong to and be released with @self. since 0.13.9. Use tp_cm_message_take_message() a #TpCMMessage a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part another (distinct) message created for the same #TpBaseConnection Concatene all the text parts contained in @message. a newly allocated string containing the text content of #message a #TpMessage if not %NULL, the #TpChannelTextMessageFlags of @message <![CDATA[ Flags indicating the level of support for message parts on this channel. They are designed such that setting more flags always implies that the channel has more capabilities. If no flags are set, this indicates that messages may contain a single message part whose content-type is any of the types from SupportedContentTypes, possibly with some alternatives. There is no flag indicating support for alternatives. This is because the SendMessage implementation can always accept messages containing alternatives, even if the underlying protocol does not, by deleting all alternatives except the first (most preferred) that is supported. Each of the flags so far implies the previous flag, so we could have used a simple enumeration here; however, we've defined the message-part support indicator as a flag set for future expansion. See SupportedContentTypes for some examples. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ SendMessage will accept messages containing a textual message body, plus a single attachment of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_Data_Only is not also set (because the connection manager can trivially provide an empty text part if necessary). ]]> <![CDATA[ SendMessage will accept messages containing a textual message body, plus an arbitrary number of attachments of any type listed in the SupportedContentTypes property. It does not make sense for this flag to be set if Message_Part_Support_Flag_One_Attachment is not also set. ]]> <![CDATA[ Flags altering the way a message is sent. The "most usual" action should always be to have these flags unset. Some indication of which flags are supported is provided by the DeliveryReportingSupport property. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Provide a successful delivery report if possible, even if this is not the default for this protocol. Ignored if delivery reports are not possible on this protocol. In some protocols, like XMPP, it is not conventional to request or send positive delivery notifications. Delivery failure reports SHOULD always be sent, but if this flag is present, the connection manager MAY also try harder to obtain failed delivery reports or allow them to be matched to outgoing messages. ]]> <![CDATA[ Provide a delivery report when the message is read by the recipient, even if this is not the default for this protocol. Ignored if read reports are not possible on this protocol. ]]> <![CDATA[ Provide a delivery report when the message is deleted by the recipient, even if this is not the default for this protocol. Ignored if such reports are not possible on this protocol. ]]> 1 higher than the highest valid value of #TpAccessControlType. 1 higher than the highest valid value of #TpCallContentDisposition. 1 higher than the highest valid value of #TpCallContentPacketizationType. 1 higher than the highest valid value of #TpCallState. 1 higher than the highest valid value of #TpCallStateChangeReason. 1 higher than the highest valid value of #TpCallStreamCandidateType. 1 higher than the highest valid value of #TpCaptchaCancelReason. 1 higher than the highest valid value of #TpCaptchaStatus. 1 higher than the highest valid value of #TpChannelChatState. 1 higher than the highest valid value of #TpChannelContactSearchState. 1 higher than the highest valid value of #TpChannelGroupChangeReason. 1 higher than the highest valid value of #TpChannelTextMessageType. 1 higher than the highest valid value of #TpChannelTextSendError. 1 higher than the highest valid value of #TpConnectionPresenceType. 1 higher than the highest valid value of #TpConnectionStatus. 1 higher than the highest valid value of #TpConnectionStatusReason. 1 higher than the highest #TpContactFeature supported by this version of telepathy-glib. 1 higher than the highest valid value of #TpContactListState. 1 higher than the highest valid value of #TpContactMetadataStorageType. 1 more than the highest valid #TpDBusError at the time of compilation 1 higher than the highest valid value of #TpDebugLevel. 1 higher than the highest valid value of #TpDeliveryStatus. 1 higher than the highest valid value of #TpDTMFEvent. 1 higher than the highest valid value of #TpFileHashType. 1 higher than the highest valid value of #TpFileTransferState. 1 higher than the highest valid value of #TpFileTransferStateChangeReason. 1 higher than the highest valid value of #TpHandleType. 1 higher than the highest valid value of #TpHTTPMethod. 1 higher than the highest valid value of #TpLocalHoldState. 1 higher than the highest valid value of #TpLocalHoldStateReason. 1 higher than the highest valid value of #TpMediaStreamBaseProto. 1 higher than the highest valid value of #TpMediaStreamDirection. 1 higher than the highest valid value of #TpMediaStreamError. 1 higher than the highest valid value of #TpMediaStreamState. 1 higher than the highest valid value of #TpMediaStreamTransportType. 1 higher than the highest valid value of #TpMediaStreamType. 1 higher than the highest valid value of #TpRCPTXRRTTMode. 1 higher than the highest valid value of #TpRichPresenceAccessControlType. 1 higher than the highest valid value of #TpSASLAbortReason. 1 higher than the highest valid value of #TpSASLStatus. 1 higher than the highest valid value of #TpSendingState. 1 higher than the highest valid value of #TpServicePointType. 1 higher than the highest valid value of #TpSocketAccessControl. 1 higher than the highest valid value of #TpSocketAddressType. 1 higher than the highest valid value of #TpStreamComponent. 1 higher than the highest valid value of #TpStreamEndpointState. 1 higher than the highest valid value of #TpStreamFlowState. 1 higher than the highest valid value of #TpStreamTransportType. 1 higher than the highest valid value of #TpSubscriptionState. 1 higher than the highest valid value of #TpTLSCertificateRejectReason. 1 higher than the highest valid value of #TpTLSCertificateState. 1 higher than the highest valid value of #TpTubeChannelState. 1 higher than the highest valid value of #TpTubeState. 1 higher than the highest valid value of #TpTubeType. Data structure representing the context of a Observer.ObserveChannels() call. Called by #TpBaseClientClassObserveChannelsImpl when it's done so the D-Bus method can return. a #TpObserveChannelsContext Called by #TpBaseClientClassObserveChannelsImpl to indicate that it implements the method in an async way. The caller must take a reference to the #TpObserveChannelsContext before calling this function, and is responsible for calling either tp_observe_channels_context_accept() or tp_observe_channels_context_fail() later. a #TpObserveChannelsContext Called by #TpBaseClientClassObserveChannelsImpl to raise a D-Bus error. a #TpObserveChannelsContext the error to return from the method Return a list of the #TpChannelRequest which have been satisfied by the channels associated with #self. a newly allocated #GList of reffed #TpChannelRequest. a #TpObserveChannelsContext If this call to ObserveChannels is for channels that already existed before this observer started (because the observer used tp_base_client_set_observer_recover()), return %TRUE. In most cases, the result is %FALSE. %TRUE for pre-existing channels, %FALSE for new channels a #TpObserveChannelsContext A #TpAccount object representing the Account that has been passed to ObserveChannels. Read-only except during construction. This property can't be %NULL. A #GPtrArray containing #TpChannel objects representing the channels that have been passed to ObserveChannels. Read-only except during construction. This property can't be %NULL. A #TpConnection object representing the Connection that has been passed to ObserveChannels. Read-only except during construction. This property can't be %NULL. The #DBusGMethodInvocation representing the D-Bus context of the ObserveChannels call. Can only be written during construction. A #TpChannelDispatchOperation object representing the ChannelDispatchOperation that has been passed to ObserveChannels, or %NULL if none has been passed. Read-only except during construction. A #GHashTable where the keys are string and values are GValue instances. It represents the Observer_Info hash table that has been passed to ObserveChannels. It's recommended to use high-level method such as tp_observe_channels_context_is_recovering() to access to its content. This property can't be %NULL. A #GPtrArray containing #TpChannelRequest objects representing the requests that have been passed to ObserveChannels. Read-only except during construction. This property can't be %NULL. The class of a #TpObserveChannelsContext. Structure to be included in the instance structure of objects that use this mixin. Initialize it with tp_presence_mixin_init(). There are no public fields. Emit the PresenceUpdate signal for a single contact. This method is just a convenience wrapper around #tp_presence_mixin_emit_presence_update. A connection object with this mixin The handle of the contact to emit the signal for The new status to emit Emit the PresenceUpdate signal for multiple contacts. For emitting PresenceUpdate for a single contact, there is a convenience wrapper called #tp_presence_mixin_emit_one_presence_update. A connection object with this mixin A mapping of contact handles to #TpPresenceStatus structures with the presence data to emit Free resources held by the presence mixin. An object with this mixin. <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObject Fill in the vtable entries needed to implement the presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfacePresenceClass in an object class Ignored Initialize the presence mixin. Should be called from the implementation's instance init function like so: <informalexample><programlisting> tp_presence_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, presence_mixin)); </programlisting></informalexample> An instance of the implementation that uses this mixin The byte offset of the TpPresenceMixin within the object structure Fill in the vtable entries needed to implement the simple presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfaceSimplePresenceClass in an object class Ignored Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of the SimplePresence interface's properties. This automatically sets up a list of the supported properties for the SimplePresence interface. The class of an object with this mixin Register the SimplePresence interface with the Contacts interface to make it inspectable. The Contacts mixin should be initialized before this function is called An instance that of the implementation that uses both the Contacts mixin and this mixin Structure to be included in the class structure of objects that use this mixin. Initialize it with tp_presence_mixin_class_init(). If the protocol imposes a limit on the length of status messages, one should implement @get_maximum_status_message_length. If this callback is not implemented, it is assumed that there is no limit. The callback function should be set after calling tp_presence_mixin_class_init(), like so: |[ TpPresenceMixinClass *mixin_class; tp_presence_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, presence_mixin)); mixin_class = TP_PRESENCE_MIXIN_CLASS (klass); mixin_class->get_maximum_status_message_length = some_object_get_maximum_status_message_length; ]| All other fields should be considered read-only. The status-available function that was passed to tp_presence_mixin_class_init() The get-contact-statuses function that was passed to tp_presence_mixin_class_init() The set-own-status function that was passed to tp_presence_mixin_class_init() The presence statuses array that was passed to tp_presence_mixin_class_init() The callback used to discover the the limit for status messages length, if any. Since: 0.14.5 <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObjectClass Initialize the presence mixin. Should be called from the implementation's class_init function like so: <informalexample><programlisting> tp_presence_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, presence_mixin)); </programlisting></informalexample> The class of the implementation that uses this mixin The byte offset of the TpPresenceMixinClass within the class structure A callback to be used to determine if a given presence status can be set on a particular connection. Should usually be %NULL, to consider all statuses with #TpPresenceStatusSpec.self set to %TRUE to be settable. A callback to be used get the current presence status for contacts. This is used in implementations of various D-Bus methods and hence must be provided. A callback to be used to commit changes to the user's own presence status to the server. This is used in implementations of various D-Bus methods and hence must be provided. An array of #TpPresenceStatusSpec structures representing all presence statuses supported by the protocol, terminated by a NULL name. Signature of the callback used to get the stored presence status of contacts. The returned hash table should have contact handles mapped to their respective presence statuses in #TpPresenceStatus structs. The returned hash table will be freed with g_hash_table_unref. The callback is responsible for ensuring that this does any cleanup that may be necessary. The contact presence on success, %NULL with error set on error An object with this mixin. An array of #TpHandle for the contacts to get presence status for Signature of a callback used to determine the maximum length of status messages. If this callback is provided and returns non-zero, the #TpPresenceMixinSetOwnStatusFunc implementation is responsible for truncating the message to fit this limit, if necessary. the maximum number of UTF-8 characters which may appear in a status message, or 0 if there is no limit. An object with this mixin. Signature of the callback used to commit changes to the user's own presence status in SetStatuses. It is also used in ClearStatus and RemoveStatus to reset the user's own status back to the "default" one with a %NULL status argument. The optional_arguments hash table in @status, if not NULL, will have been filtered so it only contains recognised parameters, so the callback need not (and cannot) check for unrecognised parameters. However, the types of the parameters are not currently checked, so the callback is responsible for doing so. The callback is responsible for emitting PresenceUpdate, if appropriate, by calling tp_presence_mixin_emit_presence_update(). %TRUE if the operation was successful, %FALSE if not. An object with this mixin. The status to set, or NULL for whatever the protocol defines as a "default" status Signature of a callback to be used to determine if a given presence status can be set on the connection. Most users of this mixin do not need to supply an implementation of this callback: the value of #TpPresenceStatusSpec.self is enough to determine whether this is a user-settable presence, so %NULL should be passed to tp_presence_mixin_class_init() for this callback. One place where this callback may be needed is on XMPP: not all server implementation support the user becoming invisible. So an XMPP implementation would implement this function, so that—once connected—the hidden status is only available if the server supports it. Before the connection is connected, this callback should return %TRUE for every status that might possibly be supported: this allows the user to at least try to sign in as invisible. %TRUE if the status can be set on this connection; %FALSE if not. An instance of a #TpBaseConnection subclass implementing the presence interface with this mixin An index into the array of #TpPresenceStatusSpec provided to tp_presence_mixin_class_init() Structure representing a presence status. In addition to the fields documented here, there are two gpointer fields which must currently be %NULL. A meaning may be defined for these in a future version of telepathy-glib. In modern Telepathy connection managers, the only optional argument should be a %G_TYPE_STRING named "message", on statuses that have an optional human-readable message. All other optional arguments are deprecated. Index of the presence status in the provided supported presence statuses array A GHashTable mapping of string identifiers to GValues of the optional status arguments, if any. If there are no optional arguments, this pointer may be NULL. Deallocate all resources associated with a presence status structure. A pointer to the presence status structure to free. Construct a presence status structure. You should free the returned structure with #tp_presence_status_free. In modern Telepathy connection managers, the only optional argument should be a %G_TYPE_STRING named "message", on statuses that have an optional human-readable message. All other optional arguments are deprecated. A pointer to the newly allocated presence status structure. Index of the presence status in the provided supported presence statuses array Optional arguments for the presence statuses. Can be NULL if there are no optional arguments. The presence status object makes a copy of the hashtable, so you should free the original. Structure specifying a supported optional argument for a presence status. In addition to the fields documented here, there are two gpointer fields which must currently be %NULL. A meaning may be defined for these in a future version of telepathy-glib. Name of the argument as passed over D-Bus D-Bus type signature of the argument Structure specifying a supported presence status. In addition to the fields documented here, there are two gpointer fields which must currently be %NULL. A meaning may be defined for these in a future version of telepathy-glib. String identifier of the presence status A type value, as specified by #TpConnectionPresenceType Indicates if this status may be set on yourself An array of #TpPresenceStatusOptionalArgumentSpec structures representing the optional arguments for this status, terminated by a NULL name. If there are no optional arguments for a status, this can be NULL. In modern Telepathy connection managers, the only optional argument should be a string (type "s") named "message" on statuses that have an optional human-readable message. All other optional arguments are deprecated. <!-- --> a new #TpPresenceStatusSpec the name of the new presence status the category into which this presence status falls %TRUE if the user can set this presence status on themselves %TRUE if this presence status is accompanied by an optional human-readable message <!-- --> %TRUE if the user can set this presence status on themselves (most statuses), or %FALSE if they cannot directly set it on themselves (typically used for %TP_CONNECTION_PRESENCE_TYPE_OFFLINE and %TP_CONNECTION_PRESENCE_TYPE_ERROR) a presence status specification Copy a presence status specification. If @self has optional arguments other than a string named "message", they are not copied. Optional arguments with other names or types are deprecated. a new #TpPresenceStatusSpec resembling @self a presence status specification Free a presence status specification produced by tp_presence_status_spec_new() or tp_presence_status_spec_copy(). a presence status specification <!-- --> the name of this presence status, such as "available" or "out-to-lunch". a presence status specification Return the category into which this presence type falls. For instance, for XMPP's "" (do not disturb) status, this would return %TP_CONNECTION_PRESENCE_TYPE_BUSY. a #TpConnectionPresenceType a presence status specification <!-- --> %TRUE if this presence status is accompanied by an optional human-readable message a presence status specification Bitfield/set of flags generated from the Telepathy specification. <![CDATA[The property can be read]]> <![CDATA[The property can be written]]> A base class for connection managers' protocols. <!-- --> a new protocol proxy, or %NULL on invalid arguments proxy for the D-Bus daemon; may not be %NULL the connection manager name (such as "gabble") the protocol name (such as "jabber") the immutable D-Bus properties for this protocol Create a new protocol proxy. If @immutable_properties is a floating reference, this function will take ownership of it, much like g_variant_ref_sink(). See documentation of that function for details. a new protocol proxy, or %NULL on invalid arguments proxy for the D-Bus daemon; may not be %NULL the connection manager name (such as "gabble") the protocol name (such as "jabber") the immutable D-Bus properties for this protocol Ensure that the known interfaces for TpProtocol have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_PROTOCOL. Returns an array of parameters supported by this connection manager, without additional memory allocations. The returned array is owned by @self, and must not be used after @self has been freed. Since 0.19.9. New code should use tp_protocol_dup_params() instead. an array of #TpConnectionManagerParam structures, terminated by one whose @name is %NULL a protocol Return whether a new account can be registered on this protocol, by setting the special "register" parameter to %TRUE. %TRUE if @protocol supports the parameter "register" a protocol Return the #TpProtocol:protocol-properties-vardict property. the value of #TpProtocol:protocol-properties-vardict a #TpProtocol object <!-- no more to say --> a structure representing the parameter @param, or %NULL if not supported. Free with tp_connection_manager_param_free() a protocol a parameter name Returns a list of parameter names supported by this connection manager for this protocol. The result is copied and must be freed by the caller with g_strfreev(). a copy of #TpProtocol:param-names a protocol Returns a list of parameters supported by this connection manager. The returned list must be freed by the caller, for instance with <literal>g_list_free_full (l, (GDestroyNotify) tp_connection_manager_param_free)</literal>. a list of #TpConnectionManagerParam structures, owned by the caller a protocol Return the presence statuses that might be supported by connections to this protocol. It is possible that some of these statuses will not actually be supported by a connection: for instance, an XMPP connection manager would include "hidden" in this list, even though not all XMPP servers allow users to be online-but-hidden. a list of statuses, or %NULL if unknown a protocol object <!-- --> the value of #TpProtocol:addressable-uri-schemes a protocol object <!-- --> the value of #TpProtocol:addressable-vcard-fields a protocol object <!-- --> the value of #TpProtocol:authentication-types a protocol object Return the #TpProtocol:avatar-requirements property the value of #TpProtocol:avatar-requirements a #TpProtocol <!-- --> #TpProtocol:capabilities, which must be referenced (if non-%NULL) if it will be kept a protocol object Return the #TpProtocol:cm-name property. the value of #TpProtocol:cm-name a #TpProtocol <!-- --> the non-%NULL, non-empty value of #TpProtocol:english-name a protocol object <!-- --> the non-%NULL, non-empty value of #TpProtocol:icon-name a protocol object Return the same thing as the protocol-name property, for convenient use in C code. The returned string is valid for as long as @self exists. the value of the #TpProtocol:protocol-name property a protocol object <!-- no more to say --> a structure representing the parameter @param, or %NULL if not supported a protocol a parameter name <!-- --> the value of #TpProtocol:vcard-field a protocol object <!-- no more to say --> %TRUE if @self supports the parameter @param. a protocol a parameter name Return a string that could identify the account with the given parameters. In most protocols that string is a normalized 'account' parameter, but some protocols have more complex requirements; for instance, on IRC, the 'account' (nickname) is insufficient, and must be combined with a server or network name. a protocol the account parameters as a #GVariant of type %G_VARIANT_TYPE_VARDICT. If it is floating, ownership will be taken, as if via g_variant_ref_sink(). may be used to cancel the async request a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_protocol_identify_account_async(). a string identifying the account, or %NULL on error a protocol a #GAsyncResult Perform best-effort offline contact normalization. This does syntactic normalization (e.g. transforming case-insensitive text to lower-case), but does not query servers or anything similar. a protocol a contact identifier, possibly invalid may be used to cancel the async request a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_protocol_normalize_contact_async(). the normalized form of @contact, or %NULL on error a protocol a #GAsyncResult Perform best-effort offline contact normalization, for a contact in the form of a URI. This method will fail if the URI is not in a scheme supported by this protocol or connection manager. a protocol a contact URI, possibly invalid may be used to cancel the async request a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_protocol_normalize_contact_uri_async(). the normalized form of @uri, or %NULL on error a protocol a #GAsyncResult Perform best-effort offline contact normalization, for a contact in the form of a vCard field. This method will fail if the vCard field is not supported by this protocol or connection manager. a protocol a vCard field an address that is a value of @field may be used to cancel the async request a callback to call when the request is satisfied data to pass to @callback Interpret the result of tp_protocol_normalize_vcard_address_async(). the normalized form of @value, or %NULL on error a protocol a #GAsyncResult A non-%NULL #GStrv of URI schemes supported by this protocol. If this protocol does not support addressing contacts by URI, the list is empty. For instance, a SIP connection manager that supports calling contacts by SIP URI (sip:alice&commat;example.com, sips:bob&commat;example.com) or telephone number (tel:+1-555-0123) might have { "sip", "sips", "tel", NULL }. A non-%NULL #GStrv of vCard fields supported by this protocol. If this protocol does not support addressing contacts by a vCard field, the list is empty. For instance, a SIP connection manager that supports calling contacts by SIP URI (vCard field SIP) or telephone number (vCard field TEL) might have { "sip", "tel", NULL }. A non-%NULL #GStrv of interfaces which provide information as to what kind of authentication channels can possibly appear before the connection reaches the CONNECTED state, or %NULL if %TP_PROTOCOL_FEATURE_CORE has not been prepared. A #TpAvatarRequirements representing the avatar requirements on this protocol, or %NULL if %TP_PROTOCOL_FEATURE_CORE has not been prepared or if the protocol doesn't support avatars. The classes of channel that can be requested from connections to this protocol, or %NULL if this is unknown or the %TP_PROTOCOL_FEATURE_CORE feature has not been prepared. The name of the connection manager this protocol is on. The name of the protocol in a form suitable for display to users, such as "AIM" or "Yahoo!", or a string based on #TpProtocol:protocol-name (currently constructed by putting the first character in title case, but this is not guaranteed) if no better name is available or the %TP_PROTOCOL_FEATURE_CORE feature has not been prepared. This is effectively in the C locale (international English); user interfaces requiring a localized protocol name should look one up in their own message catalog based on either #TpProtocol:protocol-name or #TpProtocol:english-name, but should use this English version as a fallback if no translated version can be found. The name of an icon in the system's icon theme. If none was supplied by the Protocol, or the %TP_PROTOCOL_FEATURE_CORE feature has not been prepared, a default is used; currently, this is "im-" plus #TpProtocol:protocol-name. A list of parameter names supported by this connection manager for this protocol, or %NULL if %TP_PROTOCOL_FEATURE_PARAMETERS has not been prepared. The machine-readable name of the protocol, taken from the Telepathy D-Bus Interface Specification, such as "jabber" or "local-xmpp". The immutable properties of this Protocol, as provided at construction time. This is a map from string to #GValue, which must not be modified. If the immutable properties were not provided at construction time, the %TP_PROTOCOL_FEATURE_PARAMETERS and %TP_PROTOCOL_FEATURE_CORE features will both be unavailable, and this #TpProtocol object will only be useful as a way to access lower-level D-Bus calls. The immutable properties of this Protocol, as provided at construction time. This is a #G_VARIANT_TYPE_VARDICT #GVariant, which must not be modified. If the immutable properties were not provided at construction time, the %TP_PROTOCOL_FEATURE_PARAMETERS and %TP_PROTOCOL_FEATURE_CORE features will both be unavailable, and this #TpProtocol object will only be useful as a way to access lower-level D-Bus calls. The most common vCard field used for this protocol's contact identifiers, normalized to lower case, or %NULL if there is no such field or the %TP_PROTOCOL_FEATURE_CORE feature has not been prepared. The class of a #TpProtocol. Structure representing a Telepathy client-side proxy. Convert a D-Bus error name into a GError as if it was returned by a method on this proxy. This method is useful when D-Bus error names are emitted in signals, such as Connection.ConnectionError and Group.MembersChangedDetailed. a #TpProxy or subclass a D-Bus error name, for instance from the callback for tp_cli_connection_connect_to_connection_error() a debug message that accompanied the error name, or %NULL <!-- --> the bus name of the application exporting the object. The caller must copy the string with g_strdup() if it will be kept. a #TpProxy or subclass <!-- --> a borrowed reference to the D-Bus connection used by this object. The caller must reference the returned pointer with dbus_g_connection_ref() if it will be kept. a #TpProxy or subclass <!-- --> a borrowed reference to the #TpDBusDaemon for this object, if any; always %NULL if this object is itself a #TpDBusDaemon. The caller must reference the returned object with g_object_ref() if it will be kept. a #TpProxy or subclass <!-- --> the same value as #TpProxy:factory property a #TpProxy or subclass <!-- --> the reason this proxy was invalidated, or %NULL if has not been invalidated. The caller must copy the error, for instance with g_error_copy(), if it will be kept. a #TpProxy or subclass <!-- --> the object path of the remote object. The caller must copy the string with g_strdup() if it will be kept. a #TpProxy or subclass Return whether this proxy is known to have a particular interface. In versions older than 0.11.11, this was a macro wrapper around tp_proxy_has_interface_by_id(). For objects that discover their interfaces at runtime, this method will indicate that interfaces are missing until they are known to be present. In subclasses that define features for use with tp_proxy_prepare_async(), successfully preparing the "core" feature for that subclass (such as %TP_CHANNEL_FEATURE_CORE or %TP_CONNECTION_FEATURE_CORE) implies that the interfaces are known. %TRUE if this proxy implements the given interface. the #TpProxy (or subclass) the D-Bus interface required, as a string Return whether this proxy is known to have a particular interface, by its quark ID. This is equivalent to using g_quark_to_string() followed by tp_proxy_has_interface(), but more efficient. %TRUE if this proxy implements the given interface. the #TpProxy (or subclass) quark representing the D-Bus interface required Return %TRUE if @feature has been prepared successfully, or %FALSE if @feature has not been requested, has not been prepared yet, or is not available on this object at all. (For instance, if @feature is %TP_CHANNEL_FEATURE_CHAT_STATES and @self is a #TpChannel in a protocol that doesn't actually implement chat states, or is not a #TpChannel at all, then this method will return %FALSE.) To prepare features, call tp_proxy_prepare_async(). %TRUE if @feature has been prepared successfully an instance of a #TpProxy subclass a feature that is supported by @self's class #TpProxy itself does not support any features, but subclasses like #TpChannel can support features, which can either be core functionality like %TP_CHANNEL_FEATURE_CORE, or extended functionality like %TP_CHANNEL_FEATURE_CHAT_STATES. Proxy instances start with no features prepared. When features are requested via tp_proxy_prepare_async(), the proxy starts to do the necessary setup to use those features. tp_proxy_prepare_async() always waits for core functionality of the proxy's class to be prepared, even if it is not specifically requested: for instance, because %TP_CHANNEL_FEATURE_CORE is core functionality of a #TpChannel, |[ TpChannel *channel = ...; tp_proxy_prepare_async (channel, NULL, callback, user_data); ]| is equivalent to |[ TpChannel *channel = ...; GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; tp_proxy_prepare_async (channel, features, callback, user_data); ]| If a feature represents core functionality (like %TP_CHANNEL_FEATURE_CORE), failure to prepare it will result in tp_proxy_prepare_async() finishing unsuccessfully: if failure to prepare the feature indicates that the proxy is no longer useful, it will also emit #TpProxy::invalidated. If a feature represents non-essential functionality (like %TP_CHANNEL_FEATURE_CHAT_STATES), or is not supported by the object at all, then failure to prepare it is not fatal: tp_proxy_prepare_async() will complete successfully, but tp_proxy_is_prepared() will still return %FALSE for the feature, and accessor methods for the feature will typically return a dummy value. Some #TpProxy subclasses automatically start to prepare their core features when instantiated, and features will sometimes become prepared as a side-effect of other actions, but to ensure that a feature is present you must generally call tp_proxy_prepare_async() and wait for the result. an instance of a #TpProxy subclass an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0 if not %NULL, called exactly once, when the features have all been prepared or failed to prepare, or after the proxy is invalidated user data for @callback Check for error in a call to tp_proxy_prepare_async(). An error here generally indicates that either the asynchronous call was cancelled, or @self has emitted #TpProxy::invalidated. %FALSE (setting @error) if tp_proxy_prepare_async() failed or was cancelled an instance of a #TpProxy subclass the result passed to the callback of tp_proxy_prepare_async() The D-Bus bus name for this object. Read-only except during construction. The D-Bus connection for this object. Read-only except during construction. The D-Bus daemon for this object (this object itself, if it is a TpDBusDaemon). Read-only except during construction. The #TpSimpleClientFactory used to create this proxy, or %NULL if this proxy was not created through a factory. Known D-Bus interface names for this object. The D-Bus object path for this object. Read-only except during construction. Emitted when this proxy has gained an interface. It is not guaranteed to be emitted immediately, but will be emitted before the interface is first used (at the latest: before it's returned from tp_proxy_get_interface_by_id(), any signal is connected, or any method is called). The intended use is to call dbus_g_proxy_add_signals(). This signal should only be used by TpProy implementations the GQuark representing the interface the dbus-glib proxy representing the interface Emitted when this proxy has been become invalid for whatever reason. Any more specific signal should be emitted first. An invalidated proxy is one which can make no more method calls and will emit no more D-Bus signals. This is typically because the D-Bus object represented by the proxy ceased to exist, or there was some error obtaining the initial state. Any pending or future method calls made on this proxy will fail gracefully with the same error as returned by tp_proxy_get_invalidated(). domain of a GError indicating why this proxy was invalidated error code of a GError indicating why this proxy was invalidated a message associated with the error The class of a #TpProxy. The struct fields not documented here are reserved. The parent class structure If set non-zero by a subclass, #TpProxy will automatically add this interface in its constructor If set %TRUE by a subclass, the #TpProxy constructor will fail if a well-known bus name is given Structure representing a feature. a #GQuark representing the name of the feature if %TRUE, every non-core feature of the class depends on this one, and every feature (core or not) in subclasses depends on this one called when the feature has to be prepared only relevant for TpConnection sub-classes; same as @prepare_async but for features wanting to have a chance to prepare themself before the TpConnection object announce its %TP_CONNECTION_STATUS_CONNECTED status an array of #GQuark representing interfaces which have to be implemented on the object in order to be able to prepare the feature an array of #GQuark representing other features which have to be prepared before trying to prepare this feature If %TRUE, allow retrying preparation of this feature even if it failed once already; if %FALSE any attempt of preparing the feature after the preparation already failed once will immediately fail with re-calling @prepare_async Function called when @feature has to be prepared for @proxy. the object on which @feature has to be prepared a #GQuark representing the feature to prepare called when the feature has been prepared, or the preparation failed data to pass to @callback Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Both RTP data senders and data receivers MAY send DLRR blocks. ]]> <![CDATA[ Only active RTP senders MAY send DLRR blocks, i.e., non RTP senders SHALL NOT send DLRR blocks. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Loss report flag, as defined in RFC3611 section 4.6. ]]> <![CDATA[ Duplicate report flag, as defined in RFC3611 section 4.6. ]]> <![CDATA[ Jitter flag, as defined in RFC3611 section 4.6. ]]> <![CDATA[ First bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6. ]]> <![CDATA[ Second bit of TTL or Hop Limit flag, as defined in RFC3611 section 4.6. ]]> <![CDATA[ A type of access control for Rich_Presence_Access_Control. For most types, the exact access control is given by an associated variant. These are the access control types from XMPP publish/subscribe (XEP-0060). Location uses this for historical reasons, new interfaces will use Access_Control_Type. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The associated variant is a list of contacts (signature 'au', Contact_Handle[]) who can see the extended presence information. ]]> <![CDATA[ All contacts in the user's 'publish' contact list can see the extended presence information. The associated variant is ignored. ]]> <![CDATA[ The associated variant is a handle of type Group (signature 'u', Group_Handle) representing a group of contacts who can see the extended presence information. ]]> <![CDATA[ Anyone with access to the service can see the extended presence information. ]]> Data structure representing a #TpRoomInfo. <!-- --> a string representing the D-Bus interface name of the channel type of the room a #TpRoomInfo <!-- --> a description of the room's overall purpose a #TpRoomInfo <!-- --> the #TpHandle of the room a #TpRoomInfo <!-- --> the identifier of the room (as would be returned by inspecting the #TpHandle returned by tp_room_info_get_handle()) a #TpRoomInfo <!-- --> %TRUE if you cannot join the room, but must be invited a #TpRoomInfo either %NULL, or a location in which to store %TRUE if the returned value is meaningful <!-- --> the number of members in the room a #TpRoomInfo either %NULL, or a location in which to store %TRUE if the returned value is meaningful <!-- --> the human-readable name of the room if different from the handle a #TpRoomInfo <!-- --> %TRUE if the room requires a password to enter a #TpRoomInfo either %NULL, or a location in which to store %TRUE if the returned value is meaningful <!-- --> the human-readable identifier of the room a #TpRoomInfo <!-- --> the DNS name of the server hosting the room a #TpRoomInfo <!-- --> the current subject of conversation in the room a #TpRoomInfo The class of a #TpRoomInfo. Data structure representing a #TpRoomList. <!-- --> a new #TpRoomList object, or %NULL in case of error. the #GAsyncResult from the callback <!-- --> a #TpAccount for the room listing the DNS name of the server whose rooms should listed a #GAsyncReadyCallback to call when the initialization is finished data to pass to the callback function Return the #TpRoomList:account property the value of #TpRoomList:account property a #TpRoomList Return the #TpRoomList:server property the value of #TpRoomList:server property a #TpRoomList Return the #TpRoomList:listing property the value of #TpRoomList:listing property a #TpRoomList Start listing rooms using @self. Use the TpRoomList::got-rooms signal to get the rooms found. Errors will be reported using the TpRoomList::failed signal. a #TpRoomList The #TpAccount to use for the room listing. %TRUE if the channel is currently listing rooms. This property is meaningless until the %TP_ROOM_LIST_FEATURE_LISTING feature has been prepared. The DNS name of the server whose rooms are listed by this channel, or %NULL. Fired when something goes wrong while listing the channels; see @error for details. a #GError indicating the reason of the error Fired each time a room is found during the listing process. User should take his own reference on @room if he plans to continue using it once the signal callback has returned. a #TpRoomInfo The class of a #TpRoomList. <![CDATA[ A reason why SASL authentication was aborted by the client. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The server sent an invalid challenge or data. ]]> <![CDATA[ The user aborted the authentication. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The initial state. The Handler SHOULD either call AbortSASL, or connect to the NewChallenge signal then call StartMechanism or StartMechanismWithData. ]]> <![CDATA[ The challenge/response exchange is in progress. The Handler SHOULD call either Respond or AcceptSASL exactly once per emission of NewChallenge, or call AbortSASL at any time. ]]> <![CDATA[ The server has indicated successful authentication, and the connection manager is waiting for confirmation from the Handler. The Handler must call either AcceptSASL or AbortSASL to indicate whether it considers authentication to have been successful. ]]> <![CDATA[ The Handler has indicated successful authentication, and the connection manager is waiting for confirmation from the server. The state will progress to either Succeeded or Server_Failed when confirmation is received. ]]> <![CDATA[ Everyone is happy (the server sent success, and the client has called AcceptSASL). Connection to the server will proceed as soon as this state is reached. The Handler SHOULD call Close to close the channel. ]]> <![CDATA[ The server has indicated an authentication failure. If CanTryAgain is true, the client may try to authenticate again, by calling StartMechanism or StartMechanismWithData again. Otherwise, it should give up completely, by calling Close on the channel. ]]> <![CDATA[ The client has indicated an authentication failure. The possible actions are the same as for Server_Failed. ]]> <![CDATA[ Enum indicating whether a contact is sending media. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The contact is not sending media and has not been asked to do so. ]]> <![CDATA[ The contact has been asked to start sending media. ]]> <![CDATA[ The contact is sending media. ]]> <![CDATA[ The contact has been asked to stop sending media. ]]> <![CDATA[ The various types of service points a channel might connect to. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The channel is not communicating with a service point, or it is not known whether it is communicating with a service point (e.g. an ordinary call). ]]> <![CDATA[ The service point is a generic emergency point. ]]> <![CDATA[ The service point is some kind of counseling service (ie, mental health or child-services counseling). ]]> Opaque structure representing a received message using the Telepathy messages interface Returns a #TpContact representing the sender of @message if known, %NULL otherwise. the sender of the message a #TpSignalledMessage A #TpContact representing the sender of the message, if known, or %NULL otherwise. Data structure representing a simple Approver implementation. Convenient function to create a new #TpSimpleApprover instance. If @dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_approver_new_with_am() instead, so that #TpAccount, #TpConnection and #TpContact instances can be shared between modules. New code should use tp_simple_approver_new_with_am() instead. a new #TpSimpleApprover a #TpDBusDaemon object, may not be %NULL the name of the Approver (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when AddDispatchOperation is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleApprover is destroyed Convenient function to create a new #TpSimpleApprover instance with a specified #TpAccountManager. It is not necessary to prepare any features on @account_manager before calling this function. a new #TpSimpleApprover an account manager, which may not be %NULL the name of the Approver (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when AddDispatchOperation is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleApprover is destroyed Convenient function to create a new #TpSimpleApprover instance with a specified #TpSimpleClientFactory. a new #TpSimpleApprover an #TpSimpleClientFactory, which may not be %NULL the name of the Approver (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when AddDispatchOperation is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleApprover is destroyed The #TpSimpleApproverAddDispatchOperationImpl callback implementing the AddDispatchOperation D-Bus method. This property can't be %NULL. The #GDestroyNotify function called to free #TpSimpleApprover:user-data when the #TpSimpleApprover is destroyed. The user-data pointer passed to #TpSimpleApprover:callback. Signature of the implementation of the AddDispatchOperation method. This function must call either tp_add_dispatch_operation_context_accept(), tp_add_dispatch_operation_context_delay() or tp_add_dispatch_operation_context_fail() on @context before it returns. a #TpSimpleApprover instance a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared if possible a #GList of #TpChannel, all having %TP_CHANNEL_FEATURE_CORE prepared a #TpChannelDispatchOperation or %NULL; the dispatch_operation is not guaranteed to be prepared a #TpAddDispatchOperationContext representing the context of this D-Bus call arbitrary user-supplied data passed to tp_simple_approver_new() The class of a #TpSimpleApprover. Data structure representing a #TpSimpleClientFactory Creates a new #TpSimpleClientFactory instance. If @dbus is %NULL, tp_dbus_daemon_dup() will be used. a new #TpSimpleClientFactory a #TpDBusDaemon, or %NULL Return a zero-terminated #GArray containing the #TpAccount features that should be prepared on @account. a newly allocated #GArray a #TpSimpleClientFactory object a #TpAccount Return a zero-terminated #GArray containing the #TpChannel features that should be prepared on @channel. a newly allocated #GArray a #TpSimpleClientFactory object a #TpChannel Return a zero-terminated #GArray containing the #TpConnection features that should be prepared on @connection. a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection Return a #GArray containing the #TpContactFeature that should be prepared on all contacts of @connection. a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection Add @features to the desired features to be prepared on #TpAccount objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_account_features(). It is not necessary to add %TP_ACCOUNT_FEATURE_CORE as it is already included by default. Note that these features will not be added to existing #TpAccount objects; the user must call tp_proxy_prepare_async() themself. a #TpSimpleClientFactory object an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0 The same as tp_simple_client_factory_add_account_features(), but with a more convenient calling convention from C. a #TpSimpleClientFactory the first feature the second and subsequent features, if any, ending with 0 Add @features to the desired features to be prepared on #TpChannel objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_channel_features(). It is not necessary to add %TP_CHANNEL_FEATURE_CORE as it is already included by default. Note that these features will not be added to existing #TpChannel objects; the user must call tp_proxy_prepare_async() themself. a #TpSimpleClientFactory object an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0 The same as tp_simple_client_factory_add_channel_features(), but with a more convenient calling convention from C. a #TpSimpleClientFactory the first feature the second and subsequent features, if any, ending with 0 Add @features to the desired features to be prepared on #TpConnection objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_connection_features(). It is not necessary to add %TP_CONNECTION_FEATURE_CORE as it is already included by default. Note that these features will not be added to existing #TpConnection objects; the user must call tp_proxy_prepare_async() themself. a #TpSimpleClientFactory object an array of desired features, ending with 0; %NULL is equivalent to an array containing only 0 The same as tp_simple_client_factory_add_connection_features(), but with a more convenient calling convention from C. a #TpSimpleClientFactory the first feature the second and subsequent features, if any, ending with 0 Add @features to the desired features to be prepared on #TpContact objects. Those features will be added to the features already returned be tp_simple_client_factory_dup_contact_features(). Note that these features will not be added to existing #TpContact objects; the user must call tp_connection_upgrade_contacts() themself. a #TpSimpleClientFactory object The number of features in @features (may be 0) an array of desired features (may be %NULL if @n_features is 0) The same as tp_simple_client_factory_add_contact_features(), but with a more convenient calling convention from C. a #TpSimpleClientFactory the first feature the second and subsequent features, if any, ending with %TP_CONTACT_FEATURE_INVALID Return a zero-terminated #GArray containing the #TpAccount features that should be prepared on @account. a newly allocated #GArray a #TpSimpleClientFactory object a #TpAccount Return a zero-terminated #GArray containing the #TpChannel features that should be prepared on @channel. a newly allocated #GArray a #TpSimpleClientFactory object a #TpChannel Return a zero-terminated #GArray containing the #TpConnection features that should be prepared on @connection. a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection Return a #GArray containing the #TpContactFeature that should be prepared on all contacts of @connection. a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection Returns a #TpAccount proxy for the account at @object_path. The returned #TpAccount is cached; the same #TpAccount object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned #TpAccount is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_account_features()). This function is rather low-level. tp_account_manager_dup_valid_accounts() and #TpAccountManager::validity-changed are more appropriate for most applications. a reference to a #TpAccount; see tp_account_new(). a #TpSimpleClientFactory object the object path of an account the immutable properties of the account, or %NULL. Returns a #TpChannel proxy for the channel at @object_path on @connection. The returned #TpChannel is cached; the same #TpChannel object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned #TpChannel is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_channel_features()). This function is rather low-level. #TpAccountChannelRequest and #TpBaseClient are more appropriate ways to obtain channels for most applications. a reference to a #TpChannel; see tp_channel_new_from_properties(). a #TpSimpleClientFactory object a #TpConnection whose #TpProxy:factory is this object the object path of a channel on @connection the immutable properties of the channel Returns a #TpConnection proxy for the connection at @object_path. The returned #TpConnection is cached; the same #TpConnection object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned #TpConnection is not guaranteed to be ready; the caller is responsible for calling tp_proxy_prepare_async() with the desired features (as given by tp_simple_client_factory_dup_connection_features()). This function is rather low-level. #TpAccount:connection is more appropriate for most applications. a reference to a #TpConnection; see tp_connection_new(). a #TpSimpleClientFactory object the object path of a connection the immutable properties of the connection. Returns a #TpContact representing @identifier (and @handle) on @connection. The returned #TpContact is cached; the same #TpContact object will be returned by this function repeatedly, as long as at least one reference exists. Note that the returned #TpContact is not guaranteed to be ready; the caller is responsible for calling tp_connection_upgrade_contacts() with the desired features (as given by tp_simple_client_factory_dup_contact_features()). For this function to work properly, tp_connection_has_immortal_handles() must return %TRUE for @connection. a reference to a #TpContact. a #TpSimpleClientFactory object a #TpConnection whose #TpProxy:factory is this object a #TpHandle a string representing the contact's identifier Same as tp_connection_dup_contact_by_id_async(), but prepare the contact with all features previously passed to tp_simple_client_factory_add_contact_features(). a #TpSimpleClientFactory object a #TpConnection a string representing the contact's identifier a callback to call when the operation finishes data to pass to @callback Finishes tp_simple_client_factory_ensure_contact_by_id_async() a #TpContact or %NULL on error. a #TpSimpleClientFactory a #GAsyncResult <!-- --> the value of the #TpSimpleClientFactory:dbus-daemon property a #TpSimpleClientFactory object Same as tp_connection_upgrade_contacts_async(), but prepare contacts with all features previously passed to tp_simple_client_factory_add_contact_features(). a #TpSimpleClientFactory object a #TpConnection whose #TpProxy:factory is this object The number of contacts in @contacts (must be at least 1) An array of #TpContact objects associated with @self a callback to call when the operation finishes data to pass to @callback Finishes tp_simple_client_factory_upgrade_contacts_async() %TRUE on success, %FALSE otherwise. a #TpSimpleClientFactory a #GAsyncResult a location to set a #GPtrArray of upgraded #TpContact, or %NULL. The D-Bus daemon for this object. The class structure for #TpSimpleClientFactory. #TpSimpleClientFactory maintains a cache of previously-constructed proxy objects, so the implementations of @create_account, @create_connection, @create_channel, and @create_contact may assume that a new object should be created when they are called. The default implementations create unadorned instances of the relevant classes; subclasses of the factory may choose to create more interesting proxy subclasses. The default implementation of @dup_channel_features returns #TP_CHANNEL_FEATURE_CORE, plus all features passed to tp_simple_client_factory_add_channel_features() by the application. Subclasses may override this method to prepare more interesting features from subclasses of #TpChannel, for instance. The default implementations of the other <function>dup_x_features</function> methods behave similarly. the parent a newly allocated #GArray a #TpSimpleClientFactory object a #TpAccount a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection a newly allocated #GArray a #TpSimpleClientFactory object a #TpChannel a newly allocated #GArray a #TpSimpleClientFactory object a #TpConnection Data structure representing a simple Handler implementation. Convenient function to create a new #TpSimpleHandler instance. If @dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_handler_new_with_am() instead, so that #TpAccount, #TpConnection and #TpContact instances can be shared between modules. New code should use tp_simple_handler_new_with_am() instead. a new #TpSimpleHandler a #TpDBusDaemon object, may not be %NULL the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details) whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details) the name of the Handler (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when HandleChannels is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleHandler is destroyed Convenient function to create a new #TpSimpleHandler instance with a specified #TpAccountManager. It is not necessary to prepare any features on @account_manager before calling this function. a new #TpSimpleHandler an account manager, which may not be %NULL the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details) whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details) the name of the Handler (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when HandleChannels is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleHandler is destroyed Convenient function to create a new #TpSimpleHandler instance with a specified #TpSimpleClientFactory. a new #TpSimpleHandler a #TpSimpleClientFactory, which may not be %NULL the value of the Handler.BypassApproval D-Bus property (see tp_base_client_set_handler_bypass_approval() for details) whether this handler should implement Requests (see tp_base_client_set_handler_request_notification() for details) the name of the Handler (see #TpBaseClient:name for details) the value of the #TpBaseClient:uniquify-name property the function called when HandleChannels is called arbitrary user-supplied data passed to @callback called with @user_data as its argument when the #TpSimpleHandler is destroyed The value of the Handler.BypassApproval D-Bus property. The #TpSimpleHandlerHandleChannelsImpl callback implementing the HandleChannels D-Bus method. This property can't be %NULL. The #GDestroyNotify function called to free #TpSimpleHandler:user-data when the #TpSimpleHandler is destroyed. If %TRUE, the Handler will implement the Requests interface The user-data pointer passed to #TpSimpleHandler:callback. The class of a #TpSimpleHandler. Signature of the implementation of the HandleChannels method. This function must call either tp_handle_channels_context_accept(), tp_handle_channels_context_delay() or tp_handle_channels_context_fail() on @context before it returns. a #TpSimpleHandler instance a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared if possible a #GList of #TpChannel, all having %TP_CHANNEL_FEATURE_CORE prepared if possible a #GList of #TpChannelRequest having their object-path defined but are not guaranteed to be prepared. the time at which user action occurred, or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or %TP_USER_ACTION_TIME_CURRENT_TIME (see #TpAccountChannelRequest:user-action-time for details) a #TpHandleChannelsContext representing the context of this D-Bus call arbitrary user-supplied data passed to tp_simple_handler_new() Data structure representing a simple Observer implementation. Convenient function to create a new #TpSimpleObserver instance. If @dbus is not the result of tp_dbus_daemon_dup(), you should call tp_simple_observer_new_with_am() instead, so that #TpAccount, #TpConnection and #TpContact instances can be shared between modules. New code should use tp_simple_observer_new_with_am() instead. a new #TpSimpleObserver a #TpDBusDaemon object, may not be %NULL the value of the Observer.Recover D-Bus property the name of the Observer (see #TpBaseClient:name: for details) the value of the #TpBaseClient:uniquify-name: property the function called when ObserveChannels is called arbitrary user-supplied data passed to @callback called with the user_data as argument, when the #TpSimpleObserver is destroyed Convenient function to create a new #TpSimpleObserver instance with a specified #TpAccountManager. It is not necessary to prepare any features on @account_manager before calling this function. a new #TpSimpleObserver an account manager, which may not be %NULL the value of the Observer.Recover D-Bus property the name of the Observer (see #TpBaseClient:name: for details) the value of the #TpBaseClient:uniquify-name: property the function called when ObserveChannels is called arbitrary user-supplied data passed to @callback called with the user_data as argument, when the #TpSimpleObserver is destroyed Convenient function to create a new #TpSimpleObserver instance with a specified #TpSimpleClientFactory. a new #TpSimpleObserver a #TpSimpleClientFactory, which may not be %NULL the value of the Observer.Recover D-Bus property the name of the Observer (see #TpBaseClient:name: for details) the value of the #TpBaseClient:uniquify-name: property the function called when ObserveChannels is called arbitrary user-supplied data passed to @callback called with the user_data as argument, when the #TpSimpleObserver is destroyed The TpSimpleObserverObserveChannelsImpl callback implementing the ObserveChannels D-Bus method. This property can't be %NULL. The #GDestroyNotify function called to free the user-data pointer when the #TpSimpleObserver is destroyed. The value of the Observer.Recover D-Bus property. The user-data pointer passed to the callback implementing the ObserveChannels D-Bus method. The class of a #TpSimpleObserver. Signature of the implementation of the ObserveChannels method. This function must call either tp_observe_channels_context_accept(), tp_observe_channels_context_delay() or tp_observe_channels_context_fail() on @context before it returns. a #TpSimpleObserver instance a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared if possible a #GList of #TpChannel, all having %TP_CHANNEL_FEATURE_CORE prepared if possible a #TpChannelDispatchOperation or %NULL; the dispatch_operation is not guaranteed to be prepared a #GList of #TpChannelRequest, all having their object-path defined but are not guaranteed to be prepared. a #TpObserveChannelsContext representing the context of this D-Bus call arbitrary user-supplied data passed to tp_simple_observer_new() Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The IP or Unix socket can be accessed by any local user (e.g. a Unix socket that accepts all local connections, or an IP socket listening on 127.0.0.1 (or ::1) or rejecting connections not from that address). The associated variant must be ignored. For a D-Bus tube, this means that the "same user" access control typically provided by default in D-Bus implementations SHOULD be disabled. If the socket is only available to local users (e.g. a Unix socket, an IPv4 socket bound to 127.0.0.1, or an IPv6 socket bound to ::1), the ANONYMOUS authentication mechanism MAY be enabled. ]]> <![CDATA[ May only be used on IP sockets, and only for Stream tubes. The associated variant must contain a struct Socket_Address_IPv4 (or Socket_Address_IPv6) containing the string form of an IP address of the appropriate version, and a port number. The socket can only be accessed if the connecting process has that address and port number; all other connections will be rejected. ]]> <![CDATA[ May only be used on IP sockets. The associated variant must contain a struct Socket_Netmask_IPv4 (or Socket_Netmask_IPv6) with signature (sy), containing the string form of an IP address of the appropriate version, and a prefix length "n". The socket can only be accessed if the first n bits of the connecting address match the first n bits of the given address. ]]> <![CDATA[ The high-level meaning of this access control type is that only the same user (e.g. same numeric Unix uid) is allowed to interact with the tube. Exactly how this is achieved varies by channel type. For StreamTube channels, this access control type may only be used on UNIX sockets. The connecting process must send a byte when it first connects, which is not considered to be part of the data stream. If the operating system uses sendmsg() with SCM_CREDS or SCM_CREDENTIALS to pass credentials over sockets, the connecting process must do so if possible; if not, it must still send the byte, without any attached credentials. (This mechanism is very similar to the first byte of a D-Bus connection, except that in D-Bus the byte is always zero, whereas in Tubes it can be nonzero.) For DBusTube channels, this access control type may be used on any type of socket, and there is no extra byte added by Telepathy at the beginning of the stream: all bytes in the stream are part of the D-Bus tube connection. The connecting process should prove its identity via any of the SASL authentication mechanisms usually used for D-Bus (in typical D-Bus implementations this involves either sending and receiving credentials as above, or demonstrating the ability to write to a file in the user's home directory). In either case, the listening process will disconnect the connection unless it can determine by OS-specific means that the connecting process has the same user ID as the listening process. In either tube type, the associated variant must be ignored. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ A Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket. ]]> <![CDATA[ An abstract Unix socket. The address variant contains a byte-array, signature 'ay', containing the path of the socket including the leading null byte. ]]> <![CDATA[ An IPv4 socket. The address variant contains a Socket_Address_IPv4, i.e. a structure with signature (sq) in which the string is an IPv4 dotted-quad address literal (and must not be a DNS name), while the 16-bit unsigned integer is the port number. ]]> <![CDATA[ An IPv6 socket. The address variant contains a Socket_Address_IPv6, i.e. a structure with signature (sq) in which the string is an IPv6 address literal as specified in RFC2373 (and must not be a DNS name), while the 16-bit unsigned integer is the port number. ]]> <![CDATA[ Flags indicating restrictions imposed on an Account by its storage method. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The account's Parameters property can't be changed by calling UpdateParameters. ]]> <![CDATA[ The account can't be enabled/disabled by setting the Enabled property. ]]> <![CDATA[ The account's presence can't be changed by setting the RequestedPresence and AutomaticPresence properties. ]]> <![CDATA[ The account's Service property cannot be changed. ]]> <![CDATA[ Media streams can use more than one UDP socket: one for RTP (data) and one for RTCP (control). Most of the time, they are adjacent to each other, but some protocols (xmpp) signal each port separately. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The stream transport type is unknown or not applicable (should not appear over dbus). ]]> <![CDATA[ This is the high-traffic data socket, containing the audio/video data for the stream. ]]> <![CDATA[ This is the low-traffic control socket, usually containing feedback about packet loss etc. ]]> <![CDATA[ Represents the state of ICE negotiation for a single component of a stream to an endpoint. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ Candidate gathering and connectivity checks are in progress. ]]> <![CDATA[ The streaming implementation has found at least one working candidate pair. It is possible to send media at this point, but the controlling side has yet to negotiate the final candidates for use in this call. ]]> <![CDATA[ This component of the stream is connected, and an updated offer has been sent and accepted (finalising the candidates to be used for the call). This should be set by the CM in response to AcceptSelectedCandidatePair. ]]> <![CDATA[ The streaming implementation has tried connecting to all of the available candidates and none of them have connected. This is distinct from Failed, because the CM might be able to provide more candidates later (more likely in XMPP than SIP). ]]> <![CDATA[ The CM and streaming implementation are in agreement that it is impossible to connect to this endpoint. This value should only be set by the CM. ]]> <![CDATA[ The type of SendingState and ReceivingState. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ No data is flowing (or expected to be flowing) at this time. ]]> <![CDATA[ The streaming implementation has been told to start or receiving, but has not yet indicated that it is doing so. ]]> <![CDATA[ The streaming implementation has been told to stop sending or receiving data, but it has not yet indicated that it has done so. ]]> <![CDATA[ The streaming implementation is successfully sending or receiving data, and everything is going swimmingly. ]]> <![CDATA[ A transport that can be used for streaming. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The stream transport type is unknown or not applicable (for streams that do not have a configurable transport). ]]> <![CDATA[ Raw UDP, with or without STUN. All streaming clients are assumed to support this transport, so there is no handler capability token for it in the Call1 interface. [This corresponds to "none" or "stun" in the old Media.StreamHandler interface.] ]]> <![CDATA[ Interactive Connectivity Establishment, as defined by RFC 5245. Note that this value covers ICE-UDP only. [This corresponds to "ice-udp" in the old Media.StreamHandler interface.] ]]> <![CDATA[ Google Talk peer-to-peer connectivity establishment, as implemented by libjingle 0.3. [This corresponds to "gtalk-p2p" in the old Media.StreamHandler interface.] ]]> <![CDATA[ The transport used by Windows Live Messenger 2009 or later, which resembles ICE draft 19. [This corresponds to "wlm-2009" in the old Media.StreamHandler interface.] ]]> <![CDATA[ Shared memory transport, as implemented by the GStreamer shmsrc and shmsink plugins. ]]> <![CDATA[ Multicast transport. ]]> Data structure representing a #TpStreamTubeChannel. Creates a new #TpStreamTubeChannel proxy object from the provided path and properties. Most developers will not need to use this function; use #TpAutomaticProxyFactory to automatically create #TpStreamTubeChannel proxy objects. Use tp_simple_client_factory_ensure_channel() instead. a newly-created #TpStreamTubeChannel proxy a #TpConnection; may not be %NULL the object path of the channel; may not be %NULL the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances Accept an incoming stream tube. When the tube has been accepted, @callback will be called. You can then call tp_stream_tube_channel_accept_finish() to get a #TpStreamTubeConnection connected to the tube. an incoming #TpStreamTubeChannel a callback to call when the tube has been accepted data to pass to @callback Finishes accepting an incoming stream tube. The returned #TpStreamTubeConnection can then be used to exchange data through the tube. a newly created #TpStreamTubeConnection a #TpStreamTubeChannel a #GAsyncResult Return the parameters of the dbus-tube channel in a variant of type %G_VARIANT_TYPE_VARDICT whose keys are strings representing parameter names and values are variants representing corresponding parameter values set by the offerer when offering this channel. The GVariant returned is %NULL if this is an outgoing tube that has not yet been offered or the parameters property has not been set. Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() and similar functions for convenient access to the values. a new reference to a #GVariant a #TpStreamTubeChannel Return the #TpStreamTubeChannel:parameters property the value of #TpStreamTubeChannel:parameters a #TpStreamTubeChannel Return the #TpStreamTubeChannel:service property the value of #TpStreamTubeChannel:service a #TpStreamTubeChannel Offer an outgoing stream tube. When the tube has been offered, @callback will be called. You can then call tp_stream_tube_channel_offer_finish() to get the result of the operation. You have to connect to the #TpStreamTubeChannel::incoming signal to get a #TpStreamTubeConnection each time a contact establishes a connection to the tube. an outgoing #TpStreamTubeChannel parameters of the tube, or %NULL a callback to call when the tube has been offered data to pass to @callback Finishes offering an outgoing stream tube. %TRUE when a Tube has been successfully offered; %FALSE otherwise a #TpStreamTubeChannel a #GAsyncResult A string to #GValue #GHashTable representing the parameters of the tube. Will be %NULL for outgoing tubes until the tube has been offered. In high-level language bindings, use #TpStreamTubeChannel:parameters-vardict or tp_stream_tube_channel_dup_parameters_vardict() to get the same information in a more convenient format. A %G_VARIANT_TYPE_VARDICT representing the parameters of the tube. Will be %NULL for outgoing tubes until the tube has been offered. A string representing the service name that will be used over the tube. The ::incoming signal is emitted on offered Tubes when a new incoming connection is made from a remote user (one accepting the Tube). Consumers of this signal must take their own references to @tube_connection the #TpStreamTubeConnection for the connection The class of a #TpStreamTubeChannel. Data structure representing a connection on a #TpStreamTubeChannel. Return the #TpStreamTubeConnection:channel property the value of #TpStreamTubeConnection:channel a #TpStreamTubeConnection Return the #TpStreamTubeConnection:contact property the value of #TpStreamTubeConnection:contact a #TpStreamTubeConnection Return the #TpStreamTubeConnection:socket-connection property the value of #TpStreamTubeConnection:socket-connection a #TpStreamTubeConnection The #TpStreamTubeChannel channel associated with this connection This property can't be %NULL. The #TpContact with who we are exchanging data through this tube, or %NULL if we can't safely identify the contact. If not %NULL, the #TpContact objects is guaranteed to have all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. The #GSocketConnection used to transfer data through this connection. Read-only except during construction. This property can't be %NULL. The ::closed signal is emitted when the connection manager reports that a tube connection has been closed. a #GError representing the error reported by the connection manager The class of a #TpStreamTubeConnection. <![CDATA[ An enumeration indicating whether presence subscription is denied, denied but pending permission, or allowed. The exact semantics vary according to where this type is used: see the subscribe and publish contact attributes for details. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[The presence subscription state is unknown.]]> <![CDATA[Presence information cannot be seen, and either the subscription state Removed_Remotely does not apply, or it is not known whether that state applies. ]]> <![CDATA[Presence information cannot be seen because the remote contact took action: either the local user's request to see the remote contact's presence was denied, or the remote contact requested to see the local user's presence but then cancelled their request.]]> <![CDATA[Presence information cannot be seen. Permission to see presence information has been requested, and the request has not yet been declined or accepted.]]> <![CDATA[Presence information can be seen.]]> A #TpProxy subclass representing a server or peer's TLS certificate being presented for acceptance/rejection. <!-- --> a new TLS certificate proxy. Prepare the feature %TP_TLS_CERTIFICATE_FEATURE_CORE to make it useful. a #TpConnection or #TpChannel parent for this object, whose invalidation will also result in invalidation of the returned object the object path of this TLS certificate Ensure that the known interfaces for TpTLSCertificate have been set up. This is done automatically when necessary, but for correct overriding of library interfaces by local extensions, you should call this function before calling tp_proxy_or_subclass_hook_on_interface_add() with first argument %TP_TYPE_TLS_CERTIFICATE. Accept this certificate, asynchronously. In or after @callback, you may call tp_tls_certificate_accept_finish() to check the result. #GObject::notify::state will also be emitted when the connection manager signals that the certificate has been accepted. a TLS certificate called on success or failure user data for the callback Check the result of tp_tls_certificate_accept_async(). %TRUE if acceptance was successful a TLS certificate the result passed to the callback by tp_tls_certificate_accept_async() Add a pending reason for rejection. The first call to this method is considered "most important". After calling this method as many times as are required, call tp_tls_certificate_reject_async() to reject the certificate. If @details is a floating reference (see g_variant_ref_sink()), ownership of @details is taken by this function. This means you can pass the result of g_variant_new() or g_variant_new_parsed() directly to this function without additional reference-count management. a TLS certificate the reason for rejection a D-Bus error name such as %TP_ERROR_STR_CERT_REVOKED, or %NULL to derive one from @reason a variant of type %G_VARIANT_TYPE_VARDICT containing the details of the rejection, or %NULL Return the #TpTLSCertificate:cert-data property the value of #TpTLSCertificate:cert-data property a #TpTLSCertificate Return the #TpTLSCertificate:cert-type property the value of #TpTLSCertificate:cert-type property a #TpTLSCertificate If this certificate has been rejected and @n is less than the number of rejection reasons, return a #TpTLSCertificateRejection representing the @n<!---->th rejection reason (starting from 0). With @n == 0 this is equivalent to tp_tls_certificate_get_rejection(). a #TpTLSCertificateRejection, or %NULL a TLS certificate the rejection reason to return; if 0, return the same thing as tp_tls_certificate_get_detailed_rejection() If this certificate has been rejected, return a #TpTLSCertificateRejection indicating the first rejection reason (by convention, the most important). If you want to list all the things that are wrong with the certificate (for instance, it might be self-signed and also have expired) you can call tp_tls_certificate_get_nth_rejection(), increasing @n until it returns %NULL. a #TpTLSCertificateRejection, or %NULL a TLS certificate Return the #TpTLSCertificate:state property the value of #TpTLSCertificate:state property a #TpTLSCertificate Reject this certificate, asynchronously. Before calling this method, you must call tp_tls_certificate_add_rejection() at least once, to set the reason(s) for rejection (for instance, a certificate might be both self-signed and expired). In or after @callback, you may call tp_tls_certificate_reject_finish() to check the result. #GObject::notify::state will also be emitted when the connection manager signals that the certificate has been rejected. a TLS certificate called on success or failure user data for the callback Check the result of tp_tls_certificate_reject_async(). %TRUE if rejection was successful a TLS certificate the result passed to the callback by tp_tls_certificate_reject_async() The raw data of the certificate or certificate chain, represented as a #GPtrArray of #GBytes. It should be interpreted according to #TpTLSCertificate:cert-type. The first certificate in this array is the server's certificate, followed by its issuer, followed by the issuer's issuer and so on. For "x509" certificates, each certificate is an X.509 certificate in binary (DER) format. For "pgp" certificates, each certificate is a binary OpenPGP key. The type of the certificate, typically either "x509" or "pgp". A #TpConnection or #TpChannel which owns this TLS certificate. If the parent object is invalidated, the certificate is also invalidated, and this property is set to %NULL. The state of this TLS certificate as a #TpTLSCertificateState, initially %TP_TLS_CERTIFICATE_STATE_PENDING. #GObject::notify::state will be emitted when this changes. The class of a #TpTLSCertificate. <![CDATA[ Possible reasons to reject a TLS certificate. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The certificate has been rejected for another reason not listed in this enumeration. ]]> <![CDATA[ The certificate is not trusted. ]]> <![CDATA[ The certificate is expired. ]]> <![CDATA[ The certificate is not active yet. ]]> <![CDATA[ The certificate provided does not have the expected fingerprint. ]]> <![CDATA[ The hostname certified does not match the provided one. ]]> <![CDATA[ The certificate is self-signed. ]]> <![CDATA[ The certificate has been revoked. ]]> <![CDATA[ The certificate uses an insecure cipher algorithm, or is cryptographically weak. ]]> <![CDATA[ The length in bytes of the certificate, or the depth of the certificate chain exceed the limits imposed by the crypto library. ]]> Data structure representing a #TpTLSCertificateRejection. Return the #TpTLSCertificateRejection:dbus-error property the value of #TpTLSCertificateRejection:dbus-error property a #TpTLSCertificateRejection Return the #TpTLSCertificateRejection:details property the value of #TpTLSCertificateRejection:details property a #TpTLSCertificateRejection Return the #TpTLSCertificateRejection:error property the value of #TpTLSCertificateRejection:error property a #TpTLSCertificateRejection Return the #TpTLSCertificateRejection:reason property the value of #TpTLSCertificateRejection:reason property a #TpTLSCertificateRejection Convenient function to raise the #TpTLSCertificateRejection:error property in language binding supporting this feature. %FALSE a #TpTLSCertificateRejection The D-Bus error name of the rejection A #G_VARIANT_TYPE_VARDICT containing the details of the rejection a #GError (likely to be in the %TP_ERROR domain) indicating the reason of the rejection #TpTLSCertificateRejectReason representing the reason of the rejection The class of a #TpTLSCertificateRejection. <![CDATA[ The possible states for a TLSCertificate object. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The certificate is currently waiting to be accepted or rejected. ]]> <![CDATA[ The certificate has been verified. ]]> <![CDATA[ The certificate has been rejected. ]]> Data structure representing a #TpTextChannel. Convenient function to create a new #TpTextChannel Use tp_simple_client_factory_ensure_channel() instead. a newly created #TpTextChannel a #TpConnection; may not be %NULL the object path of the channel; may not be %NULL the immutable properties of the channel, as signalled by the NewChannel D-Bus signal or returned by the CreateChannel and EnsureChannel D-Bus methods: a mapping from strings (D-Bus interface name + "." + property name) to #GValue instances Acknowledge all the pending messages. This is equivalent of calling tp_text_channel_ack_messages_async() with the list of #TpSignalledMessage returned by tp_text_channel_dup_pending_messages(). Once the messages have been acked, @callback will be called. You can then call tp_text_channel_ack_all_pending_messages_finish() to get the result of the operation. See tp_text_channel_ack_message_async() about acknowledging messages. a #TpTextChannel a callback to call when the messages have been acked data to pass to @callback Finish an asynchronous acknowledgement operation of all messages. %TRUE if the messages have been acked, %FALSE otherwise. a #TpTextChannel a #GAsyncResult Acknowledge @message. Once the message has been acked, @callback will be called. You can then call tp_text_channel_ack_message_finish() to get the result of the operation. A message should be acknowledged once it has been shown to the user by the Handler of the channel. So Observers and Approvers should NOT acknowledge messages themselves. Once a message has been acknowledged, it is removed from the pending-message queue and so the #TpTextChannel::pending-message-removed signal is fired. You should use the #TpSignalledMessage received from tp_text_channel_dup_pending_messages() or the #TpTextChannel::message-received signal. a #TpTextChannel a #TpSignalledMessage a callback to call when the message have been acked data to pass to @callback Finishes acknowledging a message. %TRUE if the message has been acked, %FALSE otherwise. a #TpTextChannel a #GAsyncResult passed to the callback for tp_text_channel_ack_message_async() Acknowledge all the messages in @messages. Once the messages have been acked, @callback will be called. You can then call tp_text_channel_ack_messages_finish() to get the result of the operation. You should use the #TpSignalledMessage received from tp_text_channel_dup_pending_messages() or the #TpTextChannel::message-received signal. See tp_text_channel_ack_message_async() about acknowledging messages. a #TpTextChannel a #GList of #TpSignalledMessage a callback to call when the message have been acked data to pass to @callback Finishes acknowledging a list of messages. %TRUE if the messages have been acked, %FALSE otherwise. a #TpTextChannel a #GAsyncResult passed to the callback for tp_text_channel_ack_messages_async() Return a newly allocated list of unacknowledged #TpSignalledMessage objects. It is guaranteed that the #TpSignalledMessage:sender of each #TpSignalledMessage has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. a #GList of reffed #TpSignalledMessage a #TpTextChannel Return the chat state for the given contact. If tp_proxy_is_prepared() would return %FALSE for the feature %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, the result will always be %TP_CHANNEL_CHAT_STATE_INACTIVE. the chat state for @contact, or %TP_CHANNEL_CHAT_STATE_INACTIVE if their chat state is not known a channel a #TpContact Return the #TpTextChannel:delivery-reporting-support property the value of #TpTextChannel:delivery-reporting-support property a #TpTextChannel Return the #TpTextChannel:message-part-support-flags property the value of #TpTextChannel:message-part-support-flags a #TpTextChannel Return the #TpTextChannel:message-types property the value of #TpTextChannel:message-types a #TpTextChannel Return a newly allocated list of unacknowledged #TpSignalledMessage objects. It is guaranteed that the #TpSignalledMessage:sender of each #TpSignalledMessage has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. Since 0.19.9. New code should use tp_text_channel_dup_pending_messages() instead. a #GList of borrowed #TpSignalledMessage a #TpTextChannel Return the #TpTextChannel:sms-flash property the value of #TpTextChannel:sms-flash property a #TpTextChannel Starts an async call to get the number of 140 octet chunks required to send a #message via SMS on #self, as well as the number of remaining characters available in the final chunk and, if possible, an estimate of the cost. Once the request has been satisfied, @callback will be called. You can then call tp_text_channel_get_sms_length_finish() to get the result of the operation. a #TpTextChannel a #TpClientMessage a callback to call when the request has been satisfied data to pass to @callback Finishes an async SMS length request. %TRUE if the number of 140 octet chunks required to send the message has been retrieved, %FALSE otherwise. a #TpTextChannel a #GAsyncResult if not %NULL used to return the number of 140 octet chunks required to send the message. if not %NULL used to return the number of further characters that can be fit in the final chunk. A negative value indicates that the message will be truncated by abs(@remaining_characters). The value #G_MININT32 indicates the message will be truncated by an unknown amount. if not %NULL used to return the estimated cost of sending this message. The currency and scale of this value are the same as the values of the #TpConnection:balance-scale and #TpConnection:balance-currency properties. A value of -1 indicates the cost could not be estimated. Return the #TpTextChannel:supported-content-types property the value of #TpTextChannel:supported-content-types a #TpTextChannel Return the #TpTextChannel:is-sms-channel property the value of #TpTextChannel:is-sms-channel property a #TpTextChannel Submit a message to the server for sending. Once the message has been submitted to the sever, @callback will be called. You can then call tp_text_channel_send_message_finish() to get the result of the operation. a #TpTextChannel a #TpClientMessage flags affecting how the message is sent a callback to call when the message has been submitted to the server data to pass to @callback Completes a call to tp_text_channel_send_message_async(). @token can be used to match any incoming delivery or failure reports against the sent message. If this function returns true but the returned token is %NULL, the message was sent successfully but the protocol does not provide a way to identify it later. %TRUE if the message has been submitted to the server, %FALSE otherwise. a #TpTextChannel a #GAsyncResult passed to the callback for tp_text_channel_send_message_async() if not %NULL, used to return the token of the sent message Set the local state on channel @self to @state. Once the state has been set, @callback will be called. You can then call tp_text_channel_set_chat_state_finish() to get the result of the operation. a #TpTextChannel a #TpChannelChatState to set a callback to call when the chat state has been set data to pass to @callback Completes a call to tp_text_channel_set_chat_state_async(). %TRUE if the chat state has been changed, %FALSE otherwise. a #TpTextChannel a #GAsyncResult passed to the callback for tp_text_channel_set_chat_state_async() Check if message of type @message_type can be sent on this channel. %TRUE if message of type @message_type can be sent on @self, %FALSE otherwise a #TpTextChannel a #TpChannelTextMessageType A #TpDeliveryReportingSupportFlags indicating features supported by this channel. %TRUE if messages sent and received on this channel are transmitted via SMS. This property is not guaranteed to have a meaningful value until TP_TEXT_CHANNEL_FEATURE_SMS has been prepared. A #TpMessagePartSupportFlags indicating the level of support for message parts on this channel. A #GArray containing the #TpChannelTextMessageType which may be sent on this channel. %TRUE if this channel is exclusively for receiving class 0 SMSes (and no SMSes can be sent using tp_text_channel_send_message_async() on this channel). If %FALSE, no incoming class 0 SMSes will appear on this channel. A #GStrv containing the MIME types supported by this channel, with more preferred MIME types appearing earlier in the array. Emitted when a contact's chat state changes after tp_proxy_prepare_async() has finished preparing features %TP_TEXT_CHANNEL_FEATURE_CHAT_STATES, %TP_CHANNEL_FEATURE_GROUP and %TP_CHANNEL_FEATURE_CONTACTS. a #TpContact for the local user or another contact the new #TpChannelChatState for the contact The ::message-received signal is emitted when a new message has been received on @self. The same @message object will be used by the #TpTextChannel::pending-message-removed signal once @message has been acked so you can simply compare pointers to identify the message. Note that this signal is only fired once the #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared. It is guaranteed that @message's #TpSignalledMessage:sender has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. a #TpSignalledMessage The ::message-sent signal is emitted when @message has been submitted for sending. It is guaranteed that @message's #TpSignalledMessage:sender has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. a #TpSignalledMessage the #TpMessageSendingFlags affecting how the message was sent an opaque token used to match any incoming delivery or failure reports against this message, or %NULL if the message is not readily identifiable. The ::pending-message-removed signal is emitted when @message has been acked and so removed from the pending messages list. Note that this signal is only fired once the #TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES has been prepared. It is guaranteed that @message's #TpSignalledMessage:sender has all of the features previously passed to tp_simple_client_factory_add_contact_features() prepared. a #TpSignalledMessage The class of a #TpTextChannel. Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The initiator offered the tube. The tube is waiting to be accepted/closed locally. If the client accepts the tube, the tube's state will be Open. ]]> <![CDATA[ The tube is waiting to be accepted/closed remotely. If the recipient accepts the tube, the tube's state will be Open. ]]> <![CDATA[ The initiator offered the tube and the recipient accepted it. The tube is open for traffic. The tube's state stays in this state until it is closed. ]]> <![CDATA[ The tube channel has been requested but the tube is not yet offered. The client should offer the tube to the recipient and the tube's state will be Remote_Pending. The method used to offer the tube depends on the tube type. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The tube is waiting to be accepted/closed locally. ]]> <![CDATA[ The tube is waiting to be accepted/closed remotely. ]]> <![CDATA[ The tube is open for traffic. ]]> Bitfield/set of flags generated from the Telepathy specification. <![CDATA[ The tube is D-Bus tube as described by the org.freedesktop.Telepathy.Channel.Type.DBusTube interface. ]]> <![CDATA[ The tube is stream tube as described by the org.freedesktop.Telepathy.Channel.Type.StreamTube interface. ]]> An invalid connection status used in #TpConnection to indicate that the status has not yet been discovered. An invalid handle type (-1 cast to TpHandleType) used to represent an unknown handle type. The "user action time" used by methods like tp_account_channel_request_new() to represent channel requests that are not a result of user action. See also #TpAccountChannelRequest:user-action-time, tp_user_action_time_from_x11(), tp_user_action_time_should_present() and %TP_USER_ACTION_TIME_CURRENT_TIME. A simple wrapper for a weak reference to a #GObject, suitable for use in asynchronous calls which should only affect the object if it hasn't already been freed. As well as wrapping a weak reference to an object, this structure can contain an extra pointer to arbitrary data. This is useful for asynchronous calls which act on an object and some second piece of data, which are quite common in practice. If more than one piece of auxiliary data is required, the @user_data argument to the constructor can be a struct or a #GValueArray. Free a weak reference wrapper. This drops the weak reference to the object (if it still exists), and frees the user data with the user-supplied destructor function if one was provided. a weak reference If the weakly referenced object still exists, return a new reference to it. Otherwise, return %NULL. a new reference, or %NULL a weak reference Return the additional data that was passed to tp_weak_ref_new(). the additional data supplied in tp_weak_ref_new(), which may be %NULL a weak reference Return a new weak reference wrapper for @object. a new weak-reference wrapper Free-function: tp_weak_ref_destroy() an object to which to take a weak reference optional additional data to store alongside the weak ref destructor for @user_data, called when the weak ref is freed Dumps the a{sv} map to the debugging console. The purpose of this function is give the programmer the ability to easily inspect the contents of an a{sv} map for debugging purposes. a #GHashTable created with tp_asv_new() If a value for @key in @asv is present and boolean, return it, and set *@valid to %TRUE if @valid is not %NULL. Otherwise return %FALSE, and set *@valid to %FALSE if @valid is not %NULL. a boolean value for @key A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location to store %TRUE if the key actually exists and has a boolean value If a value for @key in @asv is present and is of the desired type, return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it, for instance with g_boxed_copy(), if you need to keep it for longer. the value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up The type that the key's value should have, which must be derived from %G_TYPE_BOXED If a value for @key in @asv is present and is an array of bytes (its GType is %DBUS_TYPE_G_UCHAR_ARRAY), return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it with g_boxed_copy (DBUS_TYPE_G_UCHAR_ARRAY, ...) if you need to keep it for longer. the string value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up If a value for @key in @asv is present and has any numeric type used by dbus-glib (guchar, gint, guint, gint64, guint64 or gdouble), return it as a double, and if @valid is not %NULL, set *@valid to %TRUE. Otherwise, return 0.0, and if @valid is not %NULL, set *@valid to %FALSE. the double precision floating-point value of @key, or 0.0 A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location in which to store %TRUE on success or %FALSE on failure If a value for @key in @asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a gint32, return it, and if @valid is not %NULL, set *@valid to %TRUE. Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. the 32-bit signed integer value of @key, or 0 A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location in which to store %TRUE on success or %FALSE on failure If a value for @key in @asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a gint64, return it, and if @valid is not %NULL, set *@valid to %TRUE. Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. the 64-bit signed integer value of @key, or 0 A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location in which to store %TRUE on success or %FALSE on failure If a value for @key in @asv is present and is an object path, return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it with g_strdup() if you need to keep it for longer. the object-path value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up If a value for @key in @asv is present and is a string, return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it with g_strdup() if you need to keep it for longer. the string value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up If a value for @key in @asv is present and is an array of strings (strv), return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it with g_strdupv() if you need to keep it for longer. the %NULL-terminated string-array value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up If a value for @key in @asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the range of a guint32, return it, and if @valid is not %NULL, set *@valid to %TRUE. Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. the 32-bit unsigned integer value of @key, or 0 A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location in which to store %TRUE on success or %FALSE on failure If a value for @key in @asv is present, has an integer type used by dbus-glib (guchar, gint, guint, gint64 or guint64) and is non-negative, return it, and if @valid is not %NULL, set *@valid to %TRUE. Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. the 64-bit unsigned integer value of @key, or 0 A GHashTable where the keys are strings and the values are GValues The key to look up Either %NULL, or a location in which to store %TRUE on success or %FALSE on failure If a value for @key in @asv is present, return it. Otherwise return %NULL. The returned value is not copied, and is only valid as long as the value for @key in @asv is not removed or altered. Copy it with (for instance) g_value_copy() if you need to keep it for longer. the value of @key, or %NULL A GHashTable where the keys are strings and the values are GValues The key to look up Creates a new #GHashTable for use with a{sv} maps, containing the values passed in as parameters. The #GHashTable is synonymous with: <informalexample><programlisting> GHashTable *asv = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); </programlisting></informalexample> Followed by manual insertion of each of the parameters. Parameters are stored in slice-allocated GValues and should be set using tp_asv_set_*() and retrieved using tp_asv_get_*(). tp_g_value_slice_new() and tp_g_value_slice_dup() may also be used to insert into the map if required. <informalexample><programlisting> g_hash_table_insert (parameters, "account", tp_g_value_slice_new_string ("bob@mcbadgers.com")); </programlisting></informalexample> <example> <title>Using tp_asv_new()</title> <programlisting> GHashTable *parameters = tp_asv_new ( "answer", G_TYPE_INT, 42, "question", G_TYPE_STRING, "We just don't know", NULL);</programlisting> </example> Allocated values will be automatically free'd when overwritten, removed or the hash table destroyed with g_hash_table_unref(). a newly created #GHashTable for storing a{sv} maps, free with g_hash_table_unref(). the name of the first key (or NULL) type and value for the first key, followed by a NULL-terminated list of (key, type, value) tuples Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_boolean(), tp_g_value_slice_new_boolean() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_boxed() a #GHashTable created with tp_asv_new() string key the type of the key's value, which must be derived from %G_TYPE_BOXED value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_bytes() a #GHashTable created with tp_asv_new() string key the number of bytes to copy location of an array of bytes to be copied (this may be %NULL if and only if length is 0) Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_double(), tp_g_value_slice_new_double() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_int32(), tp_g_value_slice_new_int() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_int64(), tp_g_value_slice_new_int64() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_object_path() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_static_boxed() a #GHashTable created with tp_asv_new() string key the type of the key's value, which must be derived from %G_TYPE_BOXED value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_static_object_path() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_static_string() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_string() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_strv() a #GHashTable created with tp_asv_new() string key a %NULL-terminated string array Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_uint32(), tp_g_value_slice_new_uint() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_uint64(), tp_g_value_slice_new_uint64() a #GHashTable created with tp_asv_new() string key value Return the size of @asv as if via g_hash_table_size(). The only difference is that this version takes a const #GHashTable and casts it. a GHashTable Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_take_boxed() a #GHashTable created with tp_asv_new() string key the type of the key's value, which must be derived from %G_TYPE_BOXED value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_take_bytes() a #GHashTable created with tp_asv_new() string key a non-NULL #GArray of %guchar, ownership of which will be taken by the #GValue Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_object_path(), tp_g_value_slice_new_take_object_path() a #GHashTable created with tp_asv_new() string key value Stores the value in the map. The value is stored as a slice-allocated GValue. See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_take_string() a #GHashTable created with tp_asv_new() string key value Set a variable holding a boxed object to %NULL. If it was not already %NULL, destroy the boxed object it previously pointed to, as appropriate for @gtype. More precisely, if *@pp is non-%NULL, set *@pp to %NULL, then call g_boxed_free() on the object that *@pp previously pointed to. This is similar to tp_clear_pointer(); see that function's documentation for typical usage. the #GType of *@pp, e.g. %G_TYPE_HASH_TABLE a pointer to a variable, struct member etc. holding a boxed object Set a variable holding a #GObject to %NULL. If it was not already %NULL, unref the object it previously pointed to. This is exactly equivalent to calling tp_clear_pointer() on @op, with @destroy = g_object_unref(). See tp_clear_pointer() for example usage. a pointer to a variable, struct member etc. holding a #GObject Set a variable holding a pointer to %NULL. If it was not already %NULL, unref or destroy the object it previously pointed to with @destroy. More precisely, if *@pp is non-%NULL, set *@pp to %NULL, then call @destroy on the object that *@pp previously pointed to. This is analogous to g_clear_error() for non-error objects, but also ensures that @pp is already %NULL before the destructor is run. Typical usage is something like this: |[ typedef struct { TpConnection *conn; GError *error; GHashTable *table; MyStruct *misc; } Foo; Foo *foo; ... tp_clear_object (&amp;foo->conn); g_clear_error (&amp;foo->error); tp_clear_boxed (G_TYPE_HASH_TABLE, &amp;foo->table); tp_clear_pointer (&amp;foo->misc, my_struct_destroy); ]| a pointer to a variable, struct member etc. holding a pointer a function to which a gpointer can be passed, to destroy *@pp (if calling this macro from C++, explicitly casting the function to #GDestroyNotify may be necessary) <!--Returns: says it all--> a new #GList of newly allocated #TpContactInfoField, free it with tp_contact_info_list_free() a #GList of #TpContactInfoField Free all memory used by the #GList and its elements. a #GList of #TpContactInfoField <!--Returns: says it all--> a new #GList of newly allocated #TpContactInfoFieldSpec, free it with tp_contact_info_spec_list_free() a #GList of #TpContactInfoFieldSpec Free all memory used by the #GList and its elements. a #GList of #TpContactInfoFieldSpec Declare that the given interface has contact attributes which can be added to the attributes hash using the filler function. All the handles in the handle array passed to the filler function are guaranteed to be valid and referenced. An instance of the implementation that uses this mixin Name of the interface that has ContactAttributes Contact attribute filler function <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObjectClass Initialize the contacts mixin. Should be called from the implementation's class_init function like so: <informalexample><programlisting> tp_contacts_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, contacts_mixin)); </programlisting></informalexample> The class of the implementation that uses this mixin The byte offset of the TpContactsMixinClass within the class structure Free resources held by the contacts mixin. An object with this mixin. Get contact attributes for the given contacts. Provide attributes for all requested interfaces. If contact attributes are not immediately known, the behaviour is defined by the interface; the attribute should either be omitted from the result or replaced with a default value. A dictionary mapping the contact handles to contact attributes. A connection instance that uses this mixin. The connection must be connected. List of handles to retrieve contacts for. Any invalid handles will be dropped from the returned mapping. A list of interfaces to retrieve attributes from. A list of additional interfaces to retrieve attributes from. This can be used for interfaces documented as automatically included, like %TP_IFACE_CONNECTION for GetContactAttributes, or %TP_IFACE_CONNECTION and %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST for GetContactListAttributes. The DBus client's unique name. If this is not NULL, the requested handles will be held on behalf of this client. <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObject Fill in the vtable entries needed to implement the contacts interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfaceContacts in an object class Ignored Initialize the contacts mixin. Should be called from the implementation's instance init function like so: <informalexample><programlisting> tp_contacts_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, contacts_mixin)); </programlisting></informalexample> An instance of the implementation that uses this mixin The byte offset of the TpContactsMixin within the object structure Utility function to set attribute for handle to value in the attributes hash as passed to a TpContactsMixinFillContactAttributesFunc. contacts attribute hash as passed to TpContactsMixinFillContactAttributesFunc Handle to set the attribute on attribute name slice allocated GValue containing the value of the attribute, for instance with tp_g_value_slice_new. Ownership of the GValue is taken over by the mixin Check that the given string is a valid D-Bus bus name of an appropriate type. %TRUE if @name is valid a possible bus name some combination of %TP_DBUS_NAME_TYPE_UNIQUE, %TP_DBUS_NAME_TYPE_WELL_KNOWN or %TP_DBUS_NAME_TYPE_BUS_DAEMON (often this will be %TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON or %TP_DBUS_NAME_TYPE_ANY) Check that the given string is a valid D-Bus interface name. This is also appropriate to use to check for valid error names. Since GIO 2.26, g_dbus_is_interface_name() should always return the same thing, although the GLib function does not raise an error explaining why the interface name is incorrect. %TRUE if @name is valid a possible interface name Check that the given string is a valid D-Bus member (method or signal) name. Since GIO 2.26, g_dbus_is_member_name() should always return the same thing, although the GLib function does not raise an error explaining why the interface name is incorrect. %TRUE if @name is valid a possible member name Check that the given string is a valid D-Bus object path. Since GLib 2.24, g_variant_is_object_path() should always return the same thing as this function, although it doesn't provide an error explaining why the object path is invalid. %TRUE if @path is valid a possible object path Return the Telepathy error NotImplemented from the method invocation given by @context. The D-Bus method invocation context Initialize the class @cls to use the D-Bus Properties mixin. The given struct member, of size sizeof(TpDBusPropertiesMixinClass), will be used to store property implementation information. Each property and each interface must have been declared as a member of a GInterface implemented by @cls, using tp_svc_interface_set_dbus_properties_info(). Before calling this function, the array @interfaces must have been placed in the #TpDBusPropertiesMixinClass structure; if it would be empty, it may instead be %NULL. This function should be called from the class_init callback in such a way that it will only be called once, even if the class is subclassed. Changed in 0.7.9: TpDBusPropertiesMixinClass::interfaces may now be %NULL, which means that only interfaces whose properties are set up using tp_dbus_properties_mixin_implement_interface() will be used. Changed in 0.7.15: @offset may now be 0, in which case the #TpDBusPropertiesMixinClass can be omitted from @cls. It is treated as if it were present, but with all fields (including TpDBusPropertiesMixinClass::interfaces) being %NULL, so only interfaces whose properties are set using tp_dbus_properties_mixin_implement_interface() will be used. a subclass of #GObjectClass the offset within @cls of a TpDBusPropertiesMixinClass structure Get all the properties of a particular interface. This implementation never returns an error: it will return an empty map if the interface is unknown. a map from property name (without the interface name) to value an object with this mixin a D-Bus interface name Emits the PropertiesChanged signal for the provided properties. Depending on the EmitsChangedSignal annotations in the introspection XML, either the new value of the property will be included in the signal, or merely the fact that the property has changed. For example, the MPRIS specification defines a TrackList interface with two properties, one of which is annotated with EmitsChangedSignal=true and one annotated with EmitsChangedSignal=invalidates. The following call would include the new value of CanEditTracks and list Tracks as invalidated: |[ const gchar *properties[] = { "CanEditTracks", "Tracks", NULL }; tp_dbus_properties_mixin_emit_properties_changed (G_OBJECT (self), "org.mpris.MediaPlayer2.TrackList", properties); ]| It is an error to pass a property to this function if the property is annotated with EmitsChangedSignal=false, or is unannotated. an object which uses the D-Bus properties mixin the interface on which properties have changed a %NULL-terminated array of (unqualified) property names whose values have changed. A shortcut for calling tp_dbus_properties_mixin_emit_properties_changed(). an object which uses the D-Bus properties mixin the interface on which properties have changed property names (unqualified) whose values have changed, terminated by %NULL. Retrieves the values of several D-Bus properties from an object, and adds them to a hash mapping the fully-qualified name of the property to its value. This is equivalent to calling tp_dbus_properties_mixin_get() for each property and adding it to the table yourself, with the proviso that this function will g_assert() if retrieving a property fails (for instance, because it does not exist). Note that in particular, @table does not have the same memory-allocation model as the hash tables required by tp_asv_set_string() and similar functions. an object which uses the D-Bus properties mixin a hash table where the keys are strings copied with g_strdup() and the values are slice-allocated #GValue<!-- -->s the interface of the first property to be retrieved the name of the first property to be retrieved more (interface name, property name) pairs, terminated by %NULL. Initialize @value with the type of the property @property_name on @interface_name, and write the value of that property into it as if by calling the D-Bus method org.freedesktop.DBus.Properties.Get. If Get would return a D-Bus error, @value remains unset and @error is filled in instead. %TRUE (filling @value) on success, %FALSE (setting @error) on failure an object with this mixin a D-Bus interface name a D-Bus property name an unset GValue (initialized to all zeroes) An implementation of #TpDBusPropertiesMixinGetter which assumes that the @getter_data is the name of a readable #GObject property of an appropriate type, and uses it for the value of the D-Bus property. The exported object with the properties A quark representing the D-Bus interface name A quark representing the D-Bus property name A GValue pre-initialized to the right type, into which to put the value The getter_data from the #TpDBusPropertiesMixinPropImpl, which must be a string containing the GObject property's name Declare that the DBus.Properties interface represented by @g_iface is implemented using this mixin. a pointer to a #TpSvcDBusPropertiesClass structure ignored Declare that, in addition to any interfaces set in tp_dbus_properties_mixin_class_init(), the given class (and its subclasses) will implement the properties of the interface @iface using the callbacks @getter and @setter and the properties given by @props. This function should be called from the class_init callback in such a way that it will only be called once, even if the class is subclassed. Typically, the static array @interfaces in the #TpDBusPropertiesMixinClass should be used for interfaces whose properties are implemented directly by the class @cls, and this function should be used for interfaces whose properties are implemented by mixins. It is an error for the same interface to appear in the array @interfaces in the #TpDBusPropertiesMixinClass, and also be set up by this function. If a class C and a subclass S both implement the properties of the same interface, only the implementations from the subclass S will be used, regardless of whether the implementations in C and/or S were set up by this function or via the array @interfaces in the #TpDBusPropertiesMixinClass. a subclass of #GObjectClass a quark representing the the name of the interface to implement a callback to get properties on this interface, or %NULL if they are all write-only a callback to set properties on this interface, or %NULL if they are all read-only an array of #TpDBusPropertiesMixinPropImpl representing individual properties, terminated by one with @name == %NULL Retrieves the values of several D-Bus properties from an object, and builds a hash mapping the fully-qualified name of the property to its value. This is equivalent to calling tp_dbus_properties_mixin_get() for each property and building the table yourself, with the proviso that this function will g_assert() if retrieving a property fails (for instance, because it does not exist). Additional keys and values can be inserted into the returned hash table; if this is done, the inserted keys and values will be freed when the hash table is destroyed. The keys must be allocated with g_strdup() or equivalent, and the values must be slice-allocated (for instance with tp_g_value_slice_new_string() or a similar function). Note that in particular, tp_asv_set_string() and similar functions should not be used with this hash table. a hash table mapping (gchar *) fully-qualified property names to GValues, which must be freed by the caller (at which point its contents will also be freed). an object which uses the D-Bus properties mixin the interface of the first property to be retrieved the name of the first property to be retrieved more (interface name, property name) pairs, terminated by %NULL. Sets a property to the value specified by @value, as if by calling the D-Bus method org.freedesktop.DBus.Properties.Set. If Set would return a D-Bus error, sets @error and returns %FALSE %TRUE on success; %FALSE (setting @error) on failure an object with this mixin a D-Bus interface name a D-Bus property name a GValue containing the new value for this property. An implementation of #TpDBusPropertiesMixinSetter which assumes that the @setter_data is the name of a writable #GObject property of an appropriate type, and sets that property to the given value. %TRUE The exported object with the properties A quark representing the D-Bus interface name A quark representing the D-Bus property name The new value for the property The setter_data from the #TpDBusPropertiesMixinPropImpl, which must be a string containing the GObject property's name Open the given file for writing and duplicate its file descriptor to be used for stdout and stderr. This has the effect of closing the previous stdout and stderr, and sending all messages that would have gone there to the given file instead. By default the file is truncated and hence overwritten each time the process is executed. Since version 0.7.14, if the filename is prefixed with '+' then the file is not truncated and output is added at the end of the file. Passing %NULL to this function is guaranteed to have no effect. This is so you can call it with the recommended usage <literal>tp_debug_divert_messages (g_getenv ("MYAPP_LOGFILE"))</literal> and it won't do anything if the environment variable is not set. This function still works if telepathy-glib was compiled without debug support. A file to which to divert stdout and stderr, or %NULL to do nothing Activate all possible debug modes. This also activates persistent mode, which should have been orthogonal. since 0.6.1. Use tp_debug_set_flags ("all") and tp_debug_set_persistent() instead. Set the debug flags indicated by @flags_string, in addition to any already set. The parsing matches that of g_parse_debug_string(). If telepathy-glib was compiled with --disable-debug (not recommended), this function has no practical effect, since the debug messages it would enable were removed at compile time. The flags to set, comma-separated. If %NULL or empty, no additional flags are set. Equivalent to <literal>tp_debug_set_flags_from_string (g_getenv (var))</literal>, and has the same problem with persistence being included in "all". since 0.6.1. Use tp_debug_set_flags(g_getenv(...)) and tp_debug_set_persistent() instead The name of the environment variable to parse Set the debug flags indicated by @flags_string, in addition to any already set. Unlike tp_debug_set_flags(), this enables persistence like tp_debug_set_persistent() if the "persist" flag is present or the string is "all" - this turns out to be unhelpful, as persistence should be orthogonal. The parsing matches that of g_parse_debug_string(). since 0.6.1. Use tp_debug_set_flags() and tp_debug_set_persistent() instead The flags to set, comma-separated. If %NULL or empty, no additional flags are set. Used to enable persistent operation of the connection manager process for debugging purposes. TRUE prevents the connection manager mainloop from exiting, FALSE enables exiting if there are no connections (the default behavior). A #GLogFunc that prepends the UTC time (currently in ISO 8601 format, with microsecond resolution) to the message, then calls g_log_default_handler. Intended usage is: <informalexample><programlisting>if (g_getenv ("MYPROG_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); </programlisting></informalexample> If telepathy-glib was compiled with --disable-debug (not recommended), this function is equivalent to g_log_default_handler(). Changed in 0.9.0: timestamps are now printed in UTC, in RFC-3339 format. Previously, they were printed in local time, in a format similar to RFC-3339. the message's log domain the log level of the message the message to process not used <!-- --> the D-Bus error name corresponding to @error. a member of the #TpError enum. Return the error domain quark for #TpError. <!-- --> Use tp_error_quark() instead. Escape an arbitrary string so it follows the rules for a C identifier, and hence an object path component, interface element component, bus name component or member name in D-Bus. Unlike g_strcanon this is a reversible encoding, so it preserves distinctness. The escaping consists of replacing all non-alphanumerics, and the first character if it's a digit, with an underscore and two lower-case hex digits: "0123abc_xyz\x01\xff" -> _30123abc_5fxyz_01_ff i.e. similar to URI encoding, but with _ taking the role of %, and a smaller allowed set. As a special case, "" is escaped to "_" (just for completeness, really). the escaped string, which must be freed by the caller with #g_free The string to be escaped Remove the external group mixin. This function should usually be called in the dispose or finalize function. An object implementing the groups interface using an external group mixin An implementation of #TpDBusPropertiesMixinGetter which assumes that the @object has the external group mixin. It can only be used for the Group interface. An object with this mixin Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP A quark representing the D-Bus property name, either "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", "RemotePendingMembers" or "SelfHandle" A GValue pre-initialized to the right type, into which to put the value Ignored Fill in the vtable entries needed to implement the group interface using the group mixin of another object. This function should usually be called via G_IMPLEMENT_INTERFACE. A #TpSvcChannelInterfaceGroupClass Unused Fill in the qdata needed to implement the group interface using the group mixin of another object. This function should usually be called in the instance constructor. An object implementing the groups interface using an external group mixin A GObject with the group mixin Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of the Group interface's properties. This uses tp_group_mixin_get_dbus_property() as the property getter and sets up a list of the supported properties for it. Having called this, you should add #TP_CHANNEL_GROUP_FLAG_PROPERTIES to channels containing the mixin used by this class with tp_group_mixin_change_flags() to indicate that the DBus properties are available. The class of an object with this mixin Add each item in @source to @target, replacing any existing item with the same key. @key_dup and @value_dup are used to duplicate the items; in principle they could also be used to convert between types. The hash table to be updated The hash table to update it with (read-only) function to duplicate a key from @source so it can be be stored in @target. If NULL, the key is not copied, but is used as-is function to duplicate a value from @source so it can be stored in @target. If NULL, the value is not copied, but is used as-is Returns the value associated with @key under @group_name as a signed 64-bit integer. This is similar to g_key_file_get_integer() but can return 64-bit results without truncation. Since 0.21.0. Use g_key_file_get_int64() instead. the value associated with the key as a signed 64-bit integer, or 0 if the key was not found or could not be parsed. a non-%NULL #GKeyFile a non-%NULL group name a non-%NULL key Returns the value associated with @key under @group_name as an unsigned 64-bit integer. This is similar to g_key_file_get_integer() but can return large positive results without truncation. Since 0.21.0. Use g_key_file_get_uint64() instead. the value associated with the key as an unsigned 64-bit integer, or 0 if the key was not found or could not be parsed. a non-%NULL #GKeyFile a non-%NULL group name a non-%NULL key <!--no further documentation needed--> %TRUE if @needle is one of the elements of @haystack The pointer array to be searched The pointer to look for Appends all elements of @source to @target. Note that this only copies the pointers from @source; any duplication or reference-incrementing must be performed by the caller. After this function has been called, it is safe to call g_ptr_array_free() on @source and also free the actual pointer array, as long as doing so does not free the data pointed to by the new items in @target. a #GPtrArray to copy items to a #GPtrArray to copy items from Set the error NotImplemented for an invalid handle type, with an appropriate message. Changed in version 0.7.23: previously, the error was InvalidArgument. An invalid handle type Set the error NotImplemented for a handle type which is valid but is not supported by this connection manager, with an appropriate message. Changed in version 0.7.23: previously, the error was InvalidArgument. An unsupported handle type Connects a #GCallback function to a signal for a particular object, as if with g_signal_connect(). Additionally, arranges for the signal handler to be disconnected if @gobject is destroyed. This is similar to g_signal_connect_data(), but uses a closure which ensures that the @gobject stays alive during the call to @c_handler by temporarily adding a reference count to @gobject. This is similar to g_signal_connect_object(), but doesn't have the documented bug that everyone is too scared to fix. Also, it does not allow you to pass in NULL as @gobject This is intended to be a convenient way for objects to use themselves as user_data for callbacks without having to explicitly disconnect all the handlers in their finalizers. Changed in 0.10.4 and 0.11.3: %G_CONNECT_AFTER is now respected. the handler id the instance to connect to. a string of the form "signal-name::detail". the #GCallback to connect. the object to pass as data to @c_handler. a combination of #GConnectFlags. Only %G_CONNECT_AFTER and %G_CONNECT_SWAPPED are supported by this function. <!-- 'Returns' says it all --> a newly allocated copy of @value, to be freed with tp_g_value_slice_free() or g_slice_free(). A GValue Unset and free a slice-allocated GValue. <literal>(GDestroyNotify) tp_g_value_slice_free</literal> can be used as a destructor for values in a #GHashTable, for example. A GValue which was allocated with the g_slice API Returns a connection to the D-Bus daemon on which this process was activated if it was launched by D-Bus service activation, or the session bus otherwise. If dbus_g_bus_get() fails, exit with error code 1. Note that this function is not suitable for use in applications which can be useful even in the absence of D-Bus - it is designed for use in connection managers, which are not at all useful without a D-Bus connection. See &lt;https://bugs.freedesktop.org/show_bug.cgi?id=18832&gt;. Most processes should use tp_dbus_daemon_dup() instead. a connection to the starter or session D-Bus daemon. Return a #DBusGProxy for the bus daemon object. The same caveats as for tp_get_bus() apply. Use tp_dbus_daemon_dup() in new code. a proxy for the bus daemon object on the starter or session bus. Note that the given local handle is an alias within this group for the given globally-valid handle. It will be returned from subsequent GetHandleOwner queries where appropriate. Changed in 0.7.10: The @owner_handle may be 0. To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owners(). A GObject implementing the group interface with this mixin A contact handle valid within this group (may not be 0) A contact handle valid globally, or 0 if the owner of the @local_handle is unknown Note that the given local handles are aliases within this group for the given globally-valid handles. To comply with telepathy-spec 0.17.6, before adding any channel-specific handle to the members, local-pending members or remote-pending members, you must call either this function or tp_group_mixin_add_handle_owner(). A GObject implementing the group interface with this mixin A map from contact handles valid within this group (which may not be 0) to either contact handles valid globally, or 0 if the owner of the corresponding key is unknown; all handles are stored using GUINT_TO_POINTER Request that the given contacts be added to the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. Otherwise attempt to add the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message associated with the addition request, if supported Request a change to be made to the flags. If any flags were actually set or cleared, emits the GroupFlagsChanged signal with the changes. It is an error to set any of the same bits in both @add and @del. Changed in 0.7.7: the signal is not emitted if adding @add and removing @del had no effect on the existing group flags. An object implementing the groups interface using this mixin Flags to be added Flags to be removed Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op. This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly. If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that. Each of the TpIntset arguments may be %NULL, which is treated as equivalent to an empty set. %TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; %FALSE if nothing actually changed and the signals were suppressed. An object implementing the group interface using this mixin A message to be sent to the affected contacts if possible; %NULL is allowed, and is mapped to an empty string A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present) A set of contact handles to be removed from members, local pending or remote pending, wherever they are present A set of contact handles to be added to local pending, and removed from members and remote pending A set of contact handles to be added to remote pending, and removed from members and local pending The handle of the contact responsible for this change The reason for this change Change the sets of members as given by the arguments, and emit the MembersChanged and MembersChangedDetailed signals if the changes were not a no-op. This function must be called in response to events on the underlying IM protocol, and must not be called in direct response to user input; it does not respect the permissions flags, but changes the group directly. If any two of add, del, add_local_pending and add_remote_pending have a non-empty intersection, the result is undefined. Don't do that. Each of the TpIntset arguments may be %NULL, which is treated as equivalent to an empty set. details may contain, among other entries, the well-known keys (and corresponding type, wrapped in a GValue) defined by the Group.MembersChangedDetailed signal's specification; these include "actor" (a handle as G_TYPE_UINT), "change-reason" (an element of #TpChannelGroupChangeReason as G_TYPE_UINT), "message" (G_TYPE_STRING), "error" (G_TYPE_STRING), "debug-message" (G_TYPE_STRING). If all of the information in details could be passed to tp_group_mixin_change_members() then calling this function instead provides no benefit. Calling this function without setting #TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED with tp_group_mixin_change_members() first is not very useful, as clients will not know to listen for MembersChangedDetailed and thus will miss the details. %TRUE if the group was changed and the MembersChanged(Detailed) signals were emitted; %FALSE if nothing actually changed and the signals were suppressed. An object implementing the group interface using this mixin A set of contact handles to be added to the members (if not already present) and removed from local pending and remote pending (if present) A set of contact handles to be removed from members, local pending or remote pending, wherever they are present A set of contact handles to be added to local pending, and removed from members and remote pending A set of contact handles to be added to remote pending, and removed from members and local pending a map from strings to GValues detailing the change Change the self-handle for this group to the given value. An object implementing the group interface using this mixin The new self-handle for this group Configure the mixin to allow attempts to remove the SelfHandle from this Group, even if the group flags would otherwise disallow this. The channel's #TpGroupMixinRemMemberFunc or #TpGroupMixinRemMemberWithReasonFunc will be called as usual for such attempts, and may make them fail with %TP_ERROR_PERMISSION_DENIED if required. This function should be called from the GObject @class_init callback, after calling tp_group_mixin_class_init(). (Recent telepathy-spec changes make it valid to try to remove the self-handle at all times, regardless of group flags. However, if this was implemented automatically in TpGroupMixin, this would risk crashing connection manager implementations that assume that TpGroupMixin will enforce the group flags strictly. As a result, connection managers should call this function to indicate to the TpGroupMixin that it may call their removal callback with the self-handle regardless of flag settings.) The class of an object implementing the group interface using this mixin <!--Returns: says it all--> the quark used for storing mixin offset on a GObjectClass Configure the mixin for use with the given class. The class of an object implementing the group interface using this mixin The offset of the TpGroupMixinClass structure within the class structure A callback to be used to add contacts to this group A callback to be used to remove contacts from this group. This must be %NULL if you will subsequently call tp_group_mixin_class_set_remove_with_reason_func(). Set a callback to be used to implement RemoveMembers() and RemoveMembersWithReason(). If this function is called during class initialization, the given callback will be used instead of the remove callback passed to tp_group_mixin_class_init() (which must be %NULL in this case). The class of an object implementing the group interface using this mixin A callback to be used to remove contacts from this group with a specified reason. Unreference handles and free resources used by this mixin. An object implementing the group interface using this mixin Get the group's current and pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint representing the handles of the group's members Used to return a newly-allocated GArray of guint representing the handles of the group's local pending members Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members An implementation of #TpDBusPropertiesMixinGetter which assumes that the @object has the group mixin. It can only be used for the Group interface. An object with this mixin Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP A quark representing the D-Bus property name, either "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", "RemotePendingMembers" or "SelfHandle" A GValue pre-initialized to the right type, into which to put the value Ignored Set the guint pointed to by ret to this group's flags, to be interpreted according to TpChannelGroupFlags. %TRUE An object implementing the group mixin using this interface Used to return the flags If the mixin has the flag %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, return the global owners of the given local handles, or 0 where unavailable. %TRUE (setting @ret) on success, %FALSE (setting @error) on failure An object implementing the group interface with this mixin An array of guint representing locally valid handles Used to return an array of guint representing globally valid handles, or 0 where unavailable, if %TRUE is returned Get the group's local-pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint contact handles Get the group's local-pending members and information about their requests to join the channel. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GPtrArray of D-Bus structures each containing the handle of a local-pending contact, the handle of a contact responsible for adding them to the group (or 0), the reason code and a related message (e.g. their request to join the group) Get the group's current members %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint contact handles <!--Returns: says it all--> the quark used for storing mixin offset on a GObject Get the group's remote-pending members. %TRUE An object implementing the group interface using this mixin Used to return a newly-allocated GArray of guint representing the handles of the group's remote pending members Set the guint pointed to by ret to the local user's handle in this group, or to 0 if the local user is not present in this group. %TRUE. An object implementing the group mixin using this interface Used to return the local user's handle in this group Fill in the vtable entries needed to implement the group interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A #TpSvcChannelInterfaceGroupClass Unused Initialize the mixin. An object implementing the group interface using this mixin The offset of the TpGroupMixin structure within the instance structure The connection's handle repository for contacts The handle of the local user in this group, if any Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of the Group interface's properties. This uses tp_group_mixin_get_dbus_property() as the property getter and sets up a list of the supported properties for it. Having called this, you should add #TP_CHANNEL_GROUP_FLAG_PROPERTIES to any channels of this class with tp_group_mixin_change_flags() to indicate that the DBus properties are available. The class of an object with this mixin Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message to be sent to those contacts, if supported Request that the given contacts be removed from the group as if in response to user action. If the group's flags prohibit this, raise PermissionDenied. If any of the handles is invalid, raise InvalidHandle. If any of the handles is absent from the group, raise NotAvailable. Otherwise attempt to remove the contacts by calling the callbacks provided by the channel implementation. %TRUE on success An object implementing the group interface using this mixin A GArray of guint representing contacts A message to be sent to those contacts, if supported A #TpChannelGroupChangeReason Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. %TRUE not used not used not used Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. %TRUE ignored ignored ignored Return a handle for the given string, creating one if necessary. The string is normalized, if possible. the handle corresponding to the given string, or 0 if it is invalid. A handle repository implementation A string whose handle is required User data to be passed to the normalization callback Asyncronously normalize an identifier and create an handle for it. This could involve a server round-trip. This should be used instead of tp_handle_ensure() for user provided contact identifiers, but it is not necessary for identifiers from the server. A handle repository implementation the #TpBaseConnection using this handle repo A string whose handle is required User data to be passed to the normalization callback a callback to call when the operation finishes data to pass to @callback Finishes tp_handle_ensure_async() non-0 #TpHandle if the operation was successful, otherwise 0. A handle repository implementation a #GAsyncResult <!--Returns: says it all--> Since 0.19.9. It is not recommended to use this function because the associated data won't be freed until the connection disconnects. the data associated with a given key on a given handle; %NULL if there is no associated data. A handle repository implementation A handle to get data from Key id of data to fetch <!--Returns: says it all--> the string represented by the given handle, or NULL if the handle is absent from the repository. The string is owned by the handle repository and will remain valid as long as a reference to the handle exists. A handle repository implementation A handle of the type stored in the repository <!--Returns: says it all--> %TRUE if the handle is nonzero and is present in the repository, else %FALSE A handle repository implementation A handle of the type stored in the repository @self Return the handle for the given string. The string is normalized if possible. If no handle already exists for the string, none is created. the handle corresponding to the given string, or 0 if it does not exist or is invalid A handle repository implementation A string whose handle is required User data to be passed to the normalization callback Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. Changed in 0.13.6: @handle is now returned; previously, this function didn't return anything. This is no-op so can be safely removed. the same @handle not used not used Associates a blob of data with a given handle and a given key If @destroy is set, then the data is freed when the handle is freed. Since version 0.13.8, handles always last as long as the connection, so @destroy will not be called until the connection disconnects. Since 0.19.9. It is not recommended to use this function because the associated data won't be freed until the connection disconnects. A handle repository implementation A handle to set data on Key id to associate data with data to associate with handle A #GDestroyNotify to call to destroy the data, or NULL if not needed. If the given handle type is valid, return %TRUE. If not, set @error and return %FALSE. %TRUE if the handle type is valid. A handle type, valid or not, to be checked <!----> a human-readable string describing the handle type, e.g. "contact". For invalid handle types, returns "(no handle)" for 0 or "(invalid handle type)" for others. A handle type, which need not be valid Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. A handle repository implementation A handle of the type stored in the repository <!--Returns: says it all--> %TRUE if the handle is present in the repository, else %FALSE A handle repository implementation Array of TpHandle representing handles of the type stored in the repository @self If %TRUE, zero is treated like a valid handle Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. %TRUE ignored ignored ignored Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. %TRUE ignored ignored ignored Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. not used not used Return %TRUE if the given handle type is supported (i.e. repos[handle_type] is not %NULL) and the given handles are all valid in that repository. If not, set @error and return %FALSE. %TRUE if the handle type is supported and the handles are all valid. An array of possibly null pointers to handle repositories, indexed by handle type, where a null pointer means an unsupported handle type The handle type A GArray of guint representing handles of the given type If %TRUE, zero is treated like a valid handle Do nothing. Since version 0.13.8, handles always last as long as the connection; previously, this function provided refcounting for handles. This is no-op so can be safely removed. not used not used <!--Returns: says it all--> A set containing the same integers as @array. An array of guint List the available (running or installed) connection managers. Call the callback when done. Since 0.7.26, this function will wait for each #TpConnectionManager to be ready, so all connection managers passed to @callback will have their %TP_CONNECTION_MANAGER_FEATURE_CORE feature prepared, unless an error occurred while launching that connection manager. since 0.19.1, use tp_list_connection_managers_async() proxy for the D-Bus daemon callback to be called when listing the CMs succeeds or fails; not called if the @weak_object goes away user-supplied data for the callback callback to destroy the user-supplied data, called after @callback, but also if the @weak_object goes away if not %NULL, will be weakly referenced; the callback will not be called, and the call will be cancelled, if the object has vanished List the available (running or installed) connection managers, asynchronously, and wait for their %TP_CONNECTION_MANAGER_FEATURE_CORE feature to be ready. a #TpDBusDaemon, or %NULL to use tp_dbus_daemon_dup() a callback to call with a list of CMs data to pass to @callback Finish listing the available connection managers. Free the list after use, for instance with <literal>g_list_free_full (list, g_object_unref)</literal>. a newly allocated list of references to #TpConnectionManager objects the result of tp_list_connection_managers_async() List the bus names of all the connections that currently exist, together with the connection manager name and the protocol name for each connection. Call the callback when done. The bus names passed to the callback can be used to construct #TpConnection objects for any connections that are of interest. proxy for the D-Bus daemon callback to be called when listing the connections succeeds or fails; not called if the D-Bus connection fails completely or if the @weak_object goes away user-supplied data for the callback callback to destroy the user-supplied data, called after @callback, but also if the D-Bus connection fails or if the @weak_object goes away if not %NULL, will be weakly referenced; the callback will not be called if the object has vanished Set @key in part @part of @self to have @i as a signed integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an integer value Set @key in part @part of @self to have @u as an unsigned integer value. a message a part number, which must be strictly less than the number returned by tp_message_count_parts() a key in the mapping representing the part an unsigned integer value If the type of @klass, or any of its ancestor types, has had an offset attached using qdata with the given @quark, return that offset; if not, return 0. In older telepathy-glib versions, calling this function on an instance that did not have the mixin was considered to be a programming error. Since version 0.13.9, 0 is returned, without error. This is used to implement the telepathy-glib mixin classes. the offset of the mixin class A pointer to a GObjectClass-derived class structure A quark that was used to store the offset with g_type_set_qdata() If the type of @instance, or any of its ancestor types, has had an offset attached using qdata with the given @quark, return that offset. If not, return 0. In older telepathy-glib versions, calling this function on an instance that did not have the mixin was considered to be a programming error. Since version 0.13.9, 0 is returned, without error. This is used to implement the telepathy-glib mixin classes. the offset of the mixin A pointer to a GObject-derived instance structure A quark that was used to store the offset with g_type_set_qdata() Extend a pointer by an offset, provided the offset is not 0. This is used to cast from an object instance to one of the telepathy-glib mixin classes. a pointer @offset bytes beyond @instance A pointer to a structure The offset of a structure member in bytes, which must not be 0 <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObjectClass Initialize the presence mixin. Should be called from the implementation's class_init function like so: <informalexample><programlisting> tp_presence_mixin_class_init ((GObjectClass *) klass, G_STRUCT_OFFSET (SomeObjectClass, presence_mixin)); </programlisting></informalexample> The class of the implementation that uses this mixin The byte offset of the TpPresenceMixinClass within the class structure A callback to be used to determine if a given presence status can be set on a particular connection. Should usually be %NULL, to consider all statuses with #TpPresenceStatusSpec.self set to %TRUE to be settable. A callback to be used get the current presence status for contacts. This is used in implementations of various D-Bus methods and hence must be provided. A callback to be used to commit changes to the user's own presence status to the server. This is used in implementations of various D-Bus methods and hence must be provided. An array of #TpPresenceStatusSpec structures representing all presence statuses supported by the protocol, terminated by a NULL name. Emit the PresenceUpdate signal for a single contact. This method is just a convenience wrapper around #tp_presence_mixin_emit_presence_update. A connection object with this mixin The handle of the contact to emit the signal for The new status to emit Emit the PresenceUpdate signal for multiple contacts. For emitting PresenceUpdate for a single contact, there is a convenience wrapper called #tp_presence_mixin_emit_one_presence_update. A connection object with this mixin A mapping of contact handles to #TpPresenceStatus structures with the presence data to emit Free resources held by the presence mixin. An object with this mixin. <!--no documentation beyond Returns: needed--> the quark used for storing mixin offset on a GObject Fill in the vtable entries needed to implement the presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfacePresenceClass in an object class Ignored Initialize the presence mixin. Should be called from the implementation's instance init function like so: <informalexample><programlisting> tp_presence_mixin_init ((GObject *) self, G_STRUCT_OFFSET (SomeObject, presence_mixin)); </programlisting></informalexample> An instance of the implementation that uses this mixin The byte offset of the TpPresenceMixin within the object structure Fill in the vtable entries needed to implement the simple presence interface using this mixin. This function should usually be called via G_IMPLEMENT_INTERFACE. A pointer to the #TpSvcConnectionInterfaceSimplePresenceClass in an object class Ignored Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of the SimplePresence interface's properties. This automatically sets up a list of the supported properties for the SimplePresence interface. The class of an object with this mixin Register the SimplePresence interface with the Contacts interface to make it inspectable. The Contacts mixin should be initialized before this function is called An instance that of the implementation that uses both the Contacts mixin and this mixin Construct a presence status structure. You should free the returned structure with #tp_presence_status_free. In modern Telepathy connection managers, the only optional argument should be a %G_TYPE_STRING named "message", on statuses that have an optional human-readable message. All other optional arguments are deprecated. A pointer to the newly allocated presence status structure. Index of the presence status in the provided supported presence statuses array Optional arguments for the presence statuses. Can be NULL if there are no optional arguments. The presence status object makes a copy of the hashtable, so you should free the original. Create a new #GSimpleAsyncResult with no operation result, and call g_simple_async_result_complete_in_idle() on it. This is like a successful version of g_simple_async_report_error_in_idle(), suitable for asynchronous functions that (conceptually) either succeed and return nothing, or raise an error, such as tp_proxy_prepare_async(). The corresponding finish function should not call a function that attempts to get a result, such as g_simple_async_result_get_op_res_gpointer(). the source object the callback user data for @callback the source tag for the #GSimpleAsyncResult Return %TRUE if the given strings are different. Unlike #strcmp this function will handle null pointers, treating them as distinct from any string. %FALSE if @left and @right are both %NULL, or if neither is %NULL and both have the same contents; %TRUE otherwise The first string to compare (may be NULL) The second string to compare (may be NULL) <!-- --> TRUE if @str is an element of @strv, according to strcmp(). a NULL-terminated array of strings, or %NULL (which is treated as an empty strv) a non-NULL string Retrieves the D-Bus property metadata for the given interface, if any. This function is typically not useful outside telepathy-glib itself, but may be useful for domain-specific variations on the theme of SetProperty. If in doubt, you probably don't need this function. D-Bus property metadata for @g_interface, or %NULL if it has none. The #GType of a service interface Declare that @g_interface implements the given D-Bus interface, with the given properties. This may only be called once per GInterface, usually from a section of its base_init function that only runs once. This is typically only used within generated code; there is normally no reason to call it manually. The #GType of a service interface an interface description Convert an X11 timestamp into a user action time as used in Telepathy. This also works for the timestamps used by GDK 2, GDK 3 and Clutter 1.0; it may or may not work with other toolkits or versions. a nonzero Telepathy user action time, or %TP_USER_ACTION_TIME_CURRENT_TIME an X11 timestamp, or 0 to indicate the current time Interpret a Telepathy user action time to decide whether a Handler should attempt to gain focus. If %TRUE is returned, it would be appropriate to call gtk_window_present_with_time() using @x11_time as input, for instance. @x11_time is used to return a timestamp in the right format for X11, GDK 2, GDK 3 and Clutter 1.0; it may or may not work with other toolkits or versions. %TRUE if it would be appropriate to present a window the Telepathy user action time a pointer to guint32 used to return an X11 timestamp, or 0 to indicate the current time; if %FALSE is returned, the value placed here is not meaningful Validate that the provided string is valid UTF8. If not, replace all invalid bytes with unicode replacement character (U+FFFD). This method is a verbatim copy of glib's internal _g_utf8_make_valid<!-- -->() function, and will be deprecated as soon as the glib one becomes public. a new valid UTF8 string string to coerce into UTF8 Creates a new #GValueArray for use with structs, containing the values passed in as parameters. The values are copied or reffed as appropriate for their type. <example> <title> using tp_value_array_build</title> <programlisting> GValueArray *array = tp_value_array_build (2, G_TYPE_STRING, host, G_TYPE_UINT, port, G_TYPE_INVALID); </programlisting> </example> a newly created #GValueArray, free with tp_value_array_free() The number of elements that should be in the array The type of the first argument. The value of the first item in the struct followed by a list of type, value pairs terminated by G_TYPE_INVALID. Free @va. This is exactly the same as g_value_array_free(), but does not provoke deprecation warnings from GLib when used in conjunction with tp_value_array_build() and tp_value_array_unpack(). a #GValueArray Unpacks a #GValueArray into separate variables. The contents of the values aren't copied into the variables, and so become invalid when @array is freed. <example> <title>using tp_value_array_unpack</title> <programlisting> const gchar *host; guint port; tp_value_array_unpack (array, 2, &host, &port); </programlisting> </example> the array to unpack The number of elements that should be in the array a list of correctly typed pointers to store the values in Make an assertion at compile time, like C++0x's proposed static_assert keyword. If @R is determined to be true, there is no overhead at runtime; if @R is determined to be false, compilation will fail. This macro can be used at file scope (it expands to a dummy extern declaration). (This is gnulib's verify macro, written by Paul Eggert, Bruno Haible and Jim Meyering.) This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code. a requirement (constant expression) to be checked at compile-time Make an assertion at compile time, like C++0x's proposed static_assert keyword. If @R is determined to be true, there is no overhead at runtime; if @R is determined to be false, compilation will fail. This macro can be used anywhere that a statement would be allowed; it is equivalent to ((void) tp_verify_true (R)). This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code. a requirement (constant expression) to be checked at compile-time Make an assertion at compile time, like C++0x's proposed static_assert keyword. If @R is determined to be true, there is no overhead at runtime, and the macro evaluates to 1 as an integer constant expression; if @R is determined to be false, compilation will fail. This macro can be used anywhere that an integer constant expression would be allowed. (This is gnulib's verify_true macro, written by Paul Eggert, Bruno Haible and Jim Meyering.) This macro will be deprecated in a future telepathy-glib release. Please use GLib 2.20's G_STATIC_ASSERT() macro in new code. a requirement (constant expression) to be checked at compile-time Return a new weak reference wrapper for @object. a new weak-reference wrapper Free-function: tp_weak_ref_destroy() an object to which to take a weak reference optional additional data to store alongside the weak ref destructor for @user_data, called when the weak ref is freed telepathy-glib-0.24.2/telepathy-glib/interfaces.c0000644000175000017500000000016412652510705016637 00000000000000#include /* auto-generated implementation stubs */ #include "_gen/interfaces-body.h" telepathy-glib-0.24.2/telepathy-glib/interfaces.h0000644000175000017500000000061212652510705016642 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_INTERFACES_H__ #define __TP_INTERFACES_H__ #include G_BEGIN_DECLS #include G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/dbus-properties.xml0000644000175000017500000000227112652510705020222 00000000000000 D-Bus Properties telepathy-glib-0.24.2/telepathy-glib/protocol-internal.h0000644000175000017500000000261112652510705020173 00000000000000/**/ /* TpProtocol - internal header * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_PROTOCOL_INTERNAL_H #define TP_PROTOCOL_INTERNAL_H #include #include G_BEGIN_DECLS void _tp_connection_manager_param_free_contents ( TpConnectionManagerParam *param); void _tp_connection_manager_protocol_free_contents ( TpConnectionManagerProtocol *proto); TpConnectionManagerProtocol *_tp_protocol_get_struct (TpProtocol *self); GHashTable *_tp_protocol_parse_manager_file (GKeyFile *file, const gchar *cm_name, const gchar *group, gchar **protocol_name); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/enums.h0000644000175000017500000000056412652510705015654 00000000000000#ifndef __TP_ENUMS_H__ #define __TP_ENUMS_H__ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #include #include #endif telepathy-glib-0.24.2/telepathy-glib/gnio-util.c0000644000175000017500000006160012652510705016425 00000000000000/* * gnio-util.c - Source for telepathy-glib GNIO utility functions * Copyright (C) 2009 Collabora Ltd. * @author Danielle Madeley * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:gnio-util * @title: GNIO Utilities * @short_description: Telepathy/GNIO utility functions * * Utility functions for interacting between Telepathy and GNIO. * * Telepathy uses address variants stored in #GValue boxes for communicating * network socket addresses over D-Bus to and from the Connection Manager * (for instance when using the file transfer and stream tube APIs). * * This API provides translation between #GSocketAddress subtypes and a #GValue * that can be used by telepathy-glib. * #GInetSocketAddress is used for IPv4/IPv6 and #GUnixSocketAddress * for UNIX sockets (only available on platforms with gio-unix). */ #include "config.h" #include #include #include #include #include #include #include #ifdef __linux__ /* for getsockopt() and setsockopt() */ #include /* See NOTES */ #include #include #endif #include #ifdef HAVE_GIO_UNIX #include #include #include #endif /* HAVE_GIO_UNIX */ /** * tp_g_socket_address_from_variant: * @type: a Telepathy socket address type * @variant: an initialised #GValue containing an address variant, * as encoded by dbus-glib * @error: return location for a #GError (or NULL) * * Converts an address variant stored in a #GValue into a #GSocketAddress that * can be used to make a socket connection with GIO. * * Returns: a newly allocated #GSocketAddress for the given variant, or NULL * on error */ GSocketAddress * tp_g_socket_address_from_variant (TpSocketAddressType type, const GValue *variant, GError **error) { GSocketAddress *addr; switch (type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: if (!G_VALUE_HOLDS (variant, DBUS_TYPE_G_UCHAR_ARRAY)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "variant is %s not DBUS_TYPE_G_UCHAR_ARRAY", G_VALUE_TYPE_NAME (variant)); return NULL; } else { GArray *address = g_value_get_boxed (variant); char path[address->len + 1]; strncpy (path, address->data, address->len); path[address->len] = '\0'; addr = g_unix_socket_address_new (path); } break; case TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX: if (!G_VALUE_HOLDS (variant, DBUS_TYPE_G_UCHAR_ARRAY)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "variant is %s not DBUS_TYPE_G_UCHAR_ARRAY", G_VALUE_TYPE_NAME (variant)); return NULL; } else { GArray *address = g_value_get_boxed (variant); addr = g_unix_socket_address_new_with_type ( address->data, address->len, G_UNIX_SOCKET_ADDRESS_ABSTRACT); } break; #endif /* HAVE_GIO_UNIX */ case TP_SOCKET_ADDRESS_TYPE_IPV4: case TP_SOCKET_ADDRESS_TYPE_IPV6: if (type == TP_SOCKET_ADDRESS_TYPE_IPV4 && !G_VALUE_HOLDS (variant, TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "variant is %s not TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4", G_VALUE_TYPE_NAME (variant)); return NULL; } else if (type == TP_SOCKET_ADDRESS_TYPE_IPV6 && !G_VALUE_HOLDS (variant, TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "variant is %s not TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6", G_VALUE_TYPE_NAME (variant)); return NULL; } else { GValueArray *array = g_value_get_boxed (variant); G_GNUC_BEGIN_IGNORE_DEPRECATIONS GValue *hostv = g_value_array_get_nth (array, 0); GValue *portv = g_value_array_get_nth (array, 1); G_GNUC_END_IGNORE_DEPRECATIONS GInetAddress *address; const char *host; guint16 port; g_return_val_if_fail (G_VALUE_HOLDS_STRING (hostv), NULL); g_return_val_if_fail (G_VALUE_HOLDS_UINT (portv), NULL); host = g_value_get_string (hostv); port = g_value_get_uint (portv); address = g_inet_address_new_from_string (host); addr = g_inet_socket_address_new (address, port); g_object_unref (address); } break; default: g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown TpSocketAddressType (%i)", type); return NULL; } return addr; } /** * tp_address_variant_from_g_socket_address: * @address: a #GSocketAddress to convert * @type: optional return of the Telepathy socket type (or NULL) * @error: return location for a #GError (or NULL) * * Converts a #GSocketAddress to a #GValue address variant that can be used * with Telepathy and dbus-glib. * * Returns: a newly allocated #GValue, free with tp_g_value_slice_free() */ GValue * tp_address_variant_from_g_socket_address (GSocketAddress *address, TpSocketAddressType *ret_type, GError **error) { GValue *variant; TpSocketAddressType type; g_return_val_if_fail (G_IS_SOCKET_ADDRESS (address), NULL); switch (g_socket_address_get_family (address)) { #ifdef HAVE_GIO_UNIX case G_SOCKET_FAMILY_UNIX: { GUnixSocketAddress *unixaddr = G_UNIX_SOCKET_ADDRESS (address); GArray *array; const char *path = g_unix_socket_address_get_path (unixaddr); gsize len = g_unix_socket_address_get_path_len (unixaddr); if (g_unix_socket_address_get_address_type (unixaddr) == G_UNIX_SOCKET_ADDRESS_ABSTRACT) { type = TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX; } else { type = TP_SOCKET_ADDRESS_TYPE_UNIX; } array = g_array_sized_new (TRUE, FALSE, sizeof (char), len); array = g_array_append_vals (array, path, len); variant = tp_g_value_slice_new (DBUS_TYPE_G_UCHAR_ARRAY); g_value_take_boxed (variant, array); } break; #endif /* HAVE_GIO_UNIX */ case G_SOCKET_FAMILY_IPV4: case G_SOCKET_FAMILY_IPV6: { GInetAddress *addr = g_inet_socket_address_get_address ( G_INET_SOCKET_ADDRESS (address)); GValueArray *array; char *address_str; guint port; switch (g_inet_address_get_family (addr)) { case G_SOCKET_FAMILY_IPV4: type = TP_SOCKET_ADDRESS_TYPE_IPV4; variant = tp_g_value_slice_new (TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV4); break; case G_SOCKET_FAMILY_IPV6: type = TP_SOCKET_ADDRESS_TYPE_IPV6; variant = tp_g_value_slice_new (TP_STRUCT_TYPE_SOCKET_ADDRESS_IPV6); break; default: g_assert_not_reached (); } address_str = g_inet_address_to_string (addr); port = g_inet_socket_address_get_port ( G_INET_SOCKET_ADDRESS (address)); array = tp_value_array_build (2, G_TYPE_STRING, address_str, G_TYPE_UINT, port, G_TYPE_INVALID); g_free (address_str); g_value_take_boxed (variant, array); } break; default: g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Unknown GSocketAddressFamily %i", g_socket_address_get_family (address)); return NULL; } if (ret_type != NULL) *ret_type = type; return variant; } /** * tp_g_socket_address_from_g_variant: * @type: a Telepathy socket address type * @variant: a socket address as encoded by Telepathy according to @type * @error: return location for a #GError (or %NULL) * * Converts an address variant stored in a #GVariant into a #GSocketAddress * that can be used to make a socket connection with GIO. * * If @variant is a floating reference, this function takes ownership * of it. * * Returns: a newly allocated #GSocketAddress for the given variant, or %NULL * on error * * Since: 0.19.10 */ GSocketAddress * tp_g_socket_address_from_g_variant (TpSocketAddressType type, GVariant *variant, GError **error) { GValue value = G_VALUE_INIT; GSocketAddress *ret; g_variant_ref_sink (variant); dbus_g_value_parse_g_variant (variant, &value); g_variant_unref (variant); ret = tp_g_socket_address_from_variant (type, &value, error); g_value_unset (&value); return ret; } /** * tp_address_g_variant_from_g_socket_address: * @address: a #GSocketAddress to convert * @type: optional return of the Telepathy socket type (or NULL) * @error: return location for a #GError (or NULL) * * Converts a #GSocketAddress to a #GVariant address variant that can be used * with Telepathy. * * Returns: (transfer none): a new variant with a floating reference, or %NULL * * Since: 0.19.10 */ GVariant * tp_address_g_variant_from_g_socket_address (GSocketAddress *address, TpSocketAddressType *type, GError **error) { GValue *value = tp_address_variant_from_g_socket_address (address, type, error); GVariant *ret; if (value == NULL) return NULL; ret = dbus_g_value_build_g_variant (value); tp_g_value_slice_free (value); return ret; } #ifdef HAVE_GIO_UNIX static gboolean _tp_unix_connection_send_credentials_with_byte (GUnixConnection *connection, guchar byte, GCancellable *cancellable, GError **error) { /* There is not variant of g_unix_connection_send_credentials allowing us to * choose the byte sent :( See bgo #629267 * * This code has been copied from glib/gunixconnection.c * * Copyright © 2009 Codethink Limited */ GCredentials *credentials; GSocketControlMessage *scm; GSocket *_socket; gboolean ret; GOutputVector vector; g_return_val_if_fail (G_IS_UNIX_CONNECTION (connection), FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE); ret = FALSE; credentials = g_credentials_new (); vector.buffer = &byte; vector.size = 1; scm = g_unix_credentials_message_new_with_credentials (credentials); g_object_get (connection, "socket", &_socket, NULL); if (g_socket_send_message (_socket, NULL, /* address */ &vector, 1, &scm, 1, G_SOCKET_MSG_NONE, cancellable, error) != 1) { g_prefix_error (error, "Error sending credentials: "); goto out; } ret = TRUE; out: g_object_unref (_socket); g_object_unref (scm); g_object_unref (credentials); return ret; } #endif /** * tp_unix_connection_send_credentials_with_byte: * @connection: a #GUnixConnection * @byte: the byte to send with the credentials * @cancellable: (allow-none): a #GCancellable, or %NULL * @error: a #GError to fill * * A variant of g_unix_connection_send_credentials() allowing you to choose * the byte which is send with the credentials * * Returns: %TRUE on success, %FALSE if error is set. * * Since: 0.13.2 */ gboolean tp_unix_connection_send_credentials_with_byte (GSocketConnection *connection, guchar byte, GCancellable *cancellable, GError **error) { #ifdef HAVE_GIO_UNIX return _tp_unix_connection_send_credentials_with_byte ( G_UNIX_CONNECTION (connection), byte, cancellable, error); #else g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Unix sockets not supported"); return FALSE; #endif } static void send_credentials_with_byte_async_thread (GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { guchar byte; GError *error = NULL; byte = GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (res)); if (!tp_unix_connection_send_credentials_with_byte ( (GSocketConnection *) object, byte, cancellable, &error)) { g_simple_async_result_take_error (res, error); } } /** * tp_unix_connection_send_credentials_with_byte_async: * @connection: A #GUnixConnection. * @byte: the byte to send with the credentials * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied * @user_data: (closure): the data to pass to callback function * * Asynchronously send credentials. * * For more details, see tp_unix_connection_send_credentials_with_byte() which * is the synchronous version of this call. * * When the operation is finished, @callback will be called. You can then call * tp_unix_connection_send_credentials_with_byte_finish() to get the result of * the operation. * * Since: 0.17.5 **/ void tp_unix_connection_send_credentials_with_byte_async ( GSocketConnection *connection, guchar byte, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *res; res = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, tp_unix_connection_send_credentials_with_byte_async); /* Extra casting to guint to work around GNOME#661546 for GLib < 2.32 */ g_simple_async_result_set_op_res_gpointer (res, GUINT_TO_POINTER ((guint) byte), NULL); g_simple_async_result_run_in_thread (res, send_credentials_with_byte_async_thread, G_PRIORITY_DEFAULT, cancellable); g_object_unref (res); } /** * tp_unix_connection_send_credentials_with_byte_finish: * @connection: A #GUnixConnection. * @result: a #GAsyncResult. * @error: a #GError, or %NULL * * Finishes an asynchronous send credentials operation started with * tp_unix_connection_send_credentials_with_byte_async(). * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.17.5 **/ gboolean tp_unix_connection_send_credentials_with_byte_finish ( GSocketConnection *connection, GAsyncResult *result, GError **error) { _tp_implement_finish_void (connection, tp_unix_connection_send_credentials_with_byte_async); } #ifdef HAVE_GIO_UNIX static GCredentials * _tp_unix_connection_receive_credentials_with_byte (GUnixConnection *connection, guchar *byte, GCancellable *cancellable, GError **error) { /* There is not variant of g_unix_connection_receive_credentials allowing us * to choose the byte sent :( See bgo #629267 * * This code has been copied from glib/gunixconnection.c * * Copyright © 2009 Codethink Limited */ GCredentials *ret; GSocketControlMessage **scms; gint nscm; GSocket *_socket; gint n; gssize num_bytes_read; #ifdef __linux__ gboolean turn_off_so_passcreds; #endif GInputVector vector; guchar buffer[1]; g_return_val_if_fail (G_IS_UNIX_CONNECTION (connection), NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); ret = NULL; scms = NULL; g_object_get (connection, "socket", &_socket, NULL); /* On Linux, we need to turn on SO_PASSCRED if it isn't enabled * already. We also need to turn it off when we're done. See * #617483 for more discussion. */ #ifdef __linux__ { gint opt_val; socklen_t opt_len; turn_off_so_passcreds = FALSE; opt_val = 0; opt_len = sizeof (gint); if (getsockopt (g_socket_get_fd (_socket), SOL_SOCKET, SO_PASSCRED, &opt_val, &opt_len) != 0) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Error checking if SO_PASSCRED is enabled for socket: %s", strerror (errno)); goto out; } if (opt_len != sizeof (gint)) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Unexpected option length while checking if SO_PASSCRED is enabled for socket. " "Expected %d bytes, got %d", (gint) sizeof (gint), (gint) opt_len); goto out; } if (opt_val == 0) { opt_val = 1; if (setsockopt (g_socket_get_fd (_socket), SOL_SOCKET, SO_PASSCRED, &opt_val, sizeof opt_val) != 0) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Error enabling SO_PASSCRED: %s", strerror (errno)); goto out; } turn_off_so_passcreds = TRUE; } } #endif vector.buffer = buffer; vector.size = 1; /* ensure the type of GUnixCredentialsMessage has been registered with the type system */ (void) (G_TYPE_UNIX_CREDENTIALS_MESSAGE); num_bytes_read = g_socket_receive_message (_socket, NULL, /* GSocketAddress **address */ &vector, 1, &scms, &nscm, NULL, cancellable, error); if (num_bytes_read != 1) { /* Handle situation where g_socket_receive_message() returns * 0 bytes and not setting @error */ if (num_bytes_read == 0 && error != NULL && *error == NULL) { g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Expecting to read a single byte for receiving credentials but read zero bytes"); } goto out; } if (nscm != 1) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Expecting 1 control message, got %d", nscm); goto out; } if (!G_IS_UNIX_CREDENTIALS_MESSAGE (scms[0])) { g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED, "Unexpected type of ancillary data"); goto out; } if (byte != NULL) { *byte = buffer[0]; } ret = g_unix_credentials_message_get_credentials (G_UNIX_CREDENTIALS_MESSAGE (scms[0])); g_object_ref (ret); out: #ifdef __linux__ if (turn_off_so_passcreds) { gint opt_val; opt_val = 0; if (setsockopt (g_socket_get_fd (_socket), SOL_SOCKET, SO_PASSCRED, &opt_val, sizeof opt_val) != 0) { g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno), "Error while disabling SO_PASSCRED: %s", strerror (errno)); goto out; } } #endif if (scms != NULL) { for (n = 0; n < nscm; n++) g_object_unref (scms[n]); g_free (scms); } g_object_unref (_socket); return ret; } #endif /** * tp_unix_connection_receive_credentials_with_byte * @connection: a #GUnixConnection * @byte: (out): if not %NULL, used to return the byte * @cancellable: (allow-none): a #GCancellable, or %NULL * @error: a #GError to fill * * A variant of g_unix_connection_receive_credentials() allowing you to get * the byte which has been received with the credentials. * * Returns: (transfer full): Received credentials on success (free with * g_object_unref()), %NULL if error is set. * * Since: 0.13.2 */ GCredentials * tp_unix_connection_receive_credentials_with_byte (GSocketConnection *connection, guchar *byte, GCancellable *cancellable, GError **error) { #ifdef HAVE_GIO_UNIX return _tp_unix_connection_receive_credentials_with_byte ( G_UNIX_CONNECTION (connection), byte, cancellable, error); #else g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "Unix sockets not supported"); return FALSE; #endif } typedef struct { GCredentials *creds; guchar byte; } ReceiveCredentialsWithByteData; static ReceiveCredentialsWithByteData * receive_credentials_with_byte_data_new (GCredentials *creds, guchar byte) { ReceiveCredentialsWithByteData *data; data = g_slice_new0 (ReceiveCredentialsWithByteData); data->creds = g_object_ref (creds); data->byte = byte; return data; } static void receive_credentials_with_byte_data_free (ReceiveCredentialsWithByteData *data) { g_object_unref (data->creds); g_slice_free (ReceiveCredentialsWithByteData, data); } static void receive_credentials_with_byte_async_thread (GSimpleAsyncResult *res, GObject *object, GCancellable *cancellable) { guchar byte; GCredentials *creds; GError *error = NULL; creds = tp_unix_connection_receive_credentials_with_byte ( (GSocketConnection *) object, &byte, cancellable, &error); if (creds == NULL) { g_simple_async_result_take_error (res, error); return; } g_simple_async_result_set_op_res_gpointer (res, receive_credentials_with_byte_data_new (creds, byte), (GDestroyNotify) receive_credentials_with_byte_data_free); g_object_unref (creds); } /** * tp_unix_connection_receive_credentials_with_byte_async: * @connection: A #GUnixConnection. * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore. * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied * @user_data: (closure): the data to pass to callback function * * Asynchronously receive credentials. * * For more details, see tp_unix_connection_receive_credentials_with_byte() * which is the synchronous version of this call. * * When the operation is finished, @callback will be called. You can then call * tp_unix_connection_receive_credentials_with_byte_finish() to get the result * of the operation. * * Since: 0.17.5 **/ void tp_unix_connection_receive_credentials_with_byte_async ( GSocketConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *res; res = g_simple_async_result_new (G_OBJECT (connection), callback, user_data, tp_unix_connection_receive_credentials_with_byte_async); g_simple_async_result_run_in_thread (res, receive_credentials_with_byte_async_thread, G_PRIORITY_DEFAULT, cancellable); g_object_unref (res); } /** * tp_unix_connection_receive_credentials_with_byte_finish: * @connection: A #GUnixConnection. * @result: a #GAsyncResult. * @byte: (out): if not %NULL, used to return the byte * @error: a #GError, or %NULL * * Finishes an asynchronous receive credentials operation started with * tp_unix_connection_receive_credentials_with_byte_async(). * * Returns: (transfer full): a #GCredentials, or %NULL on error. * Free the returned object with g_object_unref(). * * Since: 0.17.5 **/ GCredentials * tp_unix_connection_receive_credentials_with_byte_finish ( GSocketConnection *connection, GAsyncResult *result, guchar *byte, GError **error) { GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; ReceiveCredentialsWithByteData *data; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (connection), tp_unix_connection_receive_credentials_with_byte_async), NULL); if (g_simple_async_result_propagate_error (simple, error)) return NULL; data = g_simple_async_result_get_op_res_gpointer (simple); if (byte != NULL) *byte = data->byte; return g_object_ref (data->creds); } telepathy-glib-0.24.2/telepathy-glib/gnio-util.h0000644000175000017500000000616612652510705016440 00000000000000/* * gnio-util.h - Headers for telepathy-glib GNIO utility functions * * Copyright (C) 2009 Collabora Ltd. * @author Danielle Madeley * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #include #include #include #include #ifndef __TP_GNIO_UTIL_H__ #define __TP_GNIO_UTIL_H__ G_BEGIN_DECLS GSocketAddress *tp_g_socket_address_from_variant (TpSocketAddressType type, const GValue *variant, GError **error) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_address_variant_from_g_socket_address (GSocketAddress *address, TpSocketAddressType *type, GError **error) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 GSocketAddress *tp_g_socket_address_from_g_variant (TpSocketAddressType type, GVariant *variant, GError **error) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 GVariant *tp_address_g_variant_from_g_socket_address (GSocketAddress *address, TpSocketAddressType *type, GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean tp_unix_connection_send_credentials_with_byte ( GSocketConnection *connection, guchar byte, GCancellable *cancellable, GError **error); _TP_AVAILABLE_IN_0_18 void tp_unix_connection_send_credentials_with_byte_async ( GSocketConnection *connection, guchar byte, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_unix_connection_send_credentials_with_byte_finish ( GSocketConnection *connection, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 GCredentials * tp_unix_connection_receive_credentials_with_byte ( GSocketConnection *connection, guchar *byte, GCancellable *cancellable, GError **error); _TP_AVAILABLE_IN_0_18 void tp_unix_connection_receive_credentials_with_byte_async ( GSocketConnection *connection, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); GCredentials *tp_unix_connection_receive_credentials_with_byte_finish ( GSocketConnection *connection, GAsyncResult *result, guchar *byte, GError **error); G_END_DECLS #endif /* __TP_GNIO_UTIL_H__ */ telepathy-glib-0.24.2/telepathy-glib/handle-repo-static.c0000644000175000017500000002173312652510705020204 00000000000000/* * handle-repo-static.c - mechanism to store and retrieve handles on a * connection (implementation for handle types with a fixed list of possible * handles) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:handle-repo-static * @title: TpStaticHandleRepo * @short_description: handle repository implementation with a fixed, static * set of handle names * @see_also: TpHandleRepoIface, TpDynamicHandleRepo * * A static handle repository has a fixed, static set of allowed names; * these handles can never be destroyed, and no more can be created, so * no reference counting is performed. * * The #TpHandleRepoIface:handle-type property must be set at construction * time. * * Most connection managers will use this for handles of type * %TP_HANDLE_TYPE_LIST. */ #include "config.h" #include #include #include #include enum { PROP_HANDLE_TYPE = 1, PROP_HANDLE_NAMES, }; struct _TpStaticHandleRepoClass { GObjectClass parent_class; }; struct _TpStaticHandleRepo { GObject parent; TpHandleType handle_type; TpHandle last_handle; gchar **handle_names; GData **datalists; }; static void static_repo_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpStaticHandleRepo, tp_static_handle_repo, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_HANDLE_REPO_IFACE, static_repo_iface_init)) static void tp_static_handle_repo_init (TpStaticHandleRepo *self) { self->handle_type = 0; self->last_handle = 0; self->handle_names = NULL; self->datalists = NULL; } static void static_finalize (GObject *object) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (object); guint i; if (self->datalists) { for (i = 0; i < self->last_handle; i++) { g_datalist_clear (self->datalists + i); } } g_strfreev (self->handle_names); G_OBJECT_CLASS (tp_static_handle_repo_parent_class)->finalize (object); } static void static_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (object); switch (property_id) { case PROP_HANDLE_TYPE: g_value_set_uint (value, self->handle_type); break; case PROP_HANDLE_NAMES: g_value_set_boxed (value, g_strdupv (self->handle_names)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void static_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (object); TpHandle i; switch (property_id) { case PROP_HANDLE_TYPE: self->handle_type = g_value_get_uint (value); break; case PROP_HANDLE_NAMES: if (self->datalists) { for (i = 0; i < self->last_handle; i++) { g_datalist_clear (self->datalists + i); } } g_strfreev (self->handle_names); self->handle_names = g_strdupv (g_value_get_boxed (value)); i = 0; while (self->handle_names[i] != NULL) { i++; } self->last_handle = i; g_free (self->datalists); self->datalists = NULL; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_static_handle_repo_class_init (TpStaticHandleRepoClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; object_class->get_property = static_get_property; object_class->set_property = static_set_property; object_class->finalize = static_finalize; g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); param_spec = g_param_spec_boxed ("handle-names", "Handle names", "The static set of handle names supported by this repo.", G_TYPE_STRV, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HANDLE_NAMES, param_spec); } static gboolean static_handle_is_valid (TpHandleRepoIface *irepo, TpHandle handle, GError **error) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (irepo); if (handle <= 0 || handle > self->last_handle) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "handle %u is not a valid %s handle (type %u)", handle, tp_handle_type_to_string (self->handle_type), self->handle_type); return FALSE; } else { return TRUE; } } static gboolean static_handles_are_valid (TpHandleRepoIface *irepo, const GArray *handles, gboolean allow_zero, GError **error) { guint i; g_return_val_if_fail (handles != NULL, FALSE); for (i = 0; i < handles->len; i++) { TpHandle handle = g_array_index (handles, TpHandle, i); if (handle == 0 && allow_zero) continue; if (!static_handle_is_valid (irepo, handle, error)) return FALSE; } return TRUE; } static TpHandle static_ref_handle (TpHandleRepoIface *self, TpHandle handle) { /* nothing to do, handles in this repo are permanent */ return handle; } static void static_unref_handle (TpHandleRepoIface *self, TpHandle handle) { /* nothing to do, handles in this repo are permanent */ } static gboolean static_client_hold_or_release_handle (TpHandleRepoIface *self, const gchar *client_name, TpHandle handle, GError **error) { /* nothing to do, handles in this repo are permanent */ return TRUE; } static const char * static_inspect_handle (TpHandleRepoIface *irepo, TpHandle handle) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (irepo); if (handle <= 0 || handle > self->last_handle) return NULL; return self->handle_names[handle-1]; } static TpHandle static_lookup_handle (TpHandleRepoIface *irepo, const char *id, gpointer context, GError **error) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (irepo); guint i; for (i = 0; i < self->last_handle; i++) { if (!tp_strdiff (self->handle_names[i], id)) return (TpHandle) i + 1; } g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "'%s' is not one of the valid handles", id); return 0; } static void static_set_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (repo); guint i; g_return_if_fail (handle > 0); g_return_if_fail (handle <= self->last_handle); if (!self->datalists) { self->datalists = g_new (GData *, self->last_handle); for (i = 0; i < self->last_handle; i++) { g_datalist_init (self->datalists + i); } } g_datalist_id_set_data_full (self->datalists + handle - 1, key_id, data, destroy); } static gpointer static_get_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id) { TpStaticHandleRepo *self = TP_STATIC_HANDLE_REPO (repo); g_return_val_if_fail (handle > 0, NULL); g_return_val_if_fail (handle <= self->last_handle, NULL); /* if we have no datalists that's not a bug - it means nobody has called * static_set_qdata yet */ if (!self->datalists) return NULL; return g_datalist_id_get_data (self->datalists + handle - 1, key_id); } static void static_repo_iface_init (gpointer g_iface, gpointer iface_data) { TpHandleRepoIfaceClass *klass = (TpHandleRepoIfaceClass *) g_iface; klass->handle_is_valid = static_handle_is_valid; klass->handles_are_valid = static_handles_are_valid; klass->ref_handle = static_ref_handle; klass->unref_handle = static_unref_handle; klass->client_hold_handle = static_client_hold_or_release_handle; klass->client_release_handle = static_client_hold_or_release_handle; klass->inspect_handle = static_inspect_handle; /* this repo is static, so lookup and ensure are identical */ klass->lookup_handle = static_lookup_handle; klass->ensure_handle = static_lookup_handle; klass->set_qdata = static_set_qdata; klass->get_qdata = static_get_qdata; } telepathy-glib-0.24.2/telepathy-glib/handle-repo-static.h0000644000175000017500000000776612652510705020223 00000000000000/* * tp-handle-repo-static.h - mechanism to store and retrieve handles on * a connection - implementation for static list of supported handle * types (currently used for LIST handles) * * Copyright (C) 2005, 2007 Collabora Ltd. * Copyright (C) 2005, 2007 Nokia Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HANDLE_REPO_STATIC_H__ #define __TP_HANDLE_REPO_STATIC_H__ #include G_BEGIN_DECLS /** * TpStaticHandleRepo: * * A static handle repository contains a fixed set of handles. * * As well as setting the #TpHandleRepoIface:handle-type property, code * which creates a static handle repository must set the * #TpStaticHandleRepo:handle-names construction property to a strv of * valid handle names. All of these are preallocated; no more may be * created, and attempts to do so will fail. * * Handles in this repository are 1 more than the index in the string * vector of the handle's name, so the first name in the vector has * handle 1 and so on. Connection managers which use a static repository * may assume this to be true, and use an enumeration starting at 1, in the * same order as the string vector, to avoid having to look up handles * internally. * * This is intended for handles of type %TP_HANDLE_TYPE_LIST, * for which the connection manager should only accept a static list of * supported handle names. * * All structure fields are private. */ typedef struct _TpStaticHandleRepo TpStaticHandleRepo; /** * TpStaticHandleRepoClass: * * The class of a TpStaticHandleRepo. All fields are private. */ typedef struct _TpStaticHandleRepoClass TpStaticHandleRepoClass; GType tp_static_handle_repo_get_type (void); #define TP_TYPE_STATIC_HANDLE_REPO \ (tp_static_handle_repo_get_type ()) #define TP_STATIC_HANDLE_REPO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_STATIC_HANDLE_REPO,\ TpStaticHandleRepo)) #define TP_STATIC_HANDLE_REPO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_STATIC_HANDLE_REPO,\ TpStaticHandleRepo)) #define TP_IS_STATIC_HANDLE_REPO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_STATIC_HANDLE_REPO)) #define TP_IS_STATIC_HANDLE_REPO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_STATIC_HANDLE_REPO)) #define TP_STATIC_HANDLE_REPO_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_STATIC_HANDLE_REPO,\ TpStaticHandleRepoClass)) /** * tp_static_handle_repo_new: * @handle_type: The type of handle to store in the * new repository * @handle_names: Same as #TpStaticHandleRepo:handle-names * * * * Returns: a new static handle repository */ static inline /* spacer so gtkdoc documents this function as though not static */ TpHandleRepoIface *tp_static_handle_repo_new (TpHandleType handle_type, const gchar **handle_names); static inline TpHandleRepoIface * tp_static_handle_repo_new (TpHandleType handle_type, const gchar **handle_names) { return (TpHandleRepoIface *) g_object_new (TP_TYPE_STATIC_HANDLE_REPO, "handle-type", (guint)handle_type, "handle-names", handle_names, NULL); } G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-tls.h0000644000175000017500000000046412652510705016117 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_TLS_H__ #define __TP_META_SVC_TLS_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/call-stream-endpoint.xml0000644000175000017500000000037312652510705021116 00000000000000 Call misc interfaces, version 1 telepathy-glib-0.24.2/telepathy-glib/automatic-proxy-factory.c0000644000175000017500000002115712652510705021333 00000000000000/* * Factory creating higher level proxy objects * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:automatic-proxy-factory * @title: TpAutomaticProxyFactory * @short_description: factory creating higher level proxy objects * @see_also: #TpBasicProxyFactory * * This factory implements the #TpClientChannelFactoryInterface interface to * create specialized #TpChannel subclasses. * * #TpAutomaticProxyFactory will currently create #TpChannel objects * as follows: * * * * a #TpStreamTubeChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_STREAM_TUBE; * * * a #TpTextChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_TEXT and implements * %TP_IFACE_CHANNEL_INTERFACE_MESSAGES; * * * a #TpFileTransferChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER; * * * a plain #TpChannel, otherwise * * * * It is guaranteed that the objects returned by future versions * will be either the class that is currently used, or a more specific * subclass of that class. * * This factory asks to prepare the following properties: * * * * %TP_CHANNEL_FEATURE_CORE, %TP_CHANNEL_FEATURE_GROUP * and %TP_CHANNEL_FEATURE_PASSWORD for all * type of channels. * * * %TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES and * TP_TEXT_CHANNEL_FEATURE_SMS for #TpTextChannel * * * %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE * for #TpFileTransferChannel * * * * TpProxy subclasses other than TpChannel are not currently supported. * * Since: 0.13.2 */ /** * TpAutomaticProxyFactory: * * Data structure representing a #TpAutomaticProxyFactory * * Since: 0.13.2 */ /** * TpAutomaticProxyFactoryClass: * @parent_class: the parent class * * The class of a #TpAutomaticProxyFactory. * * Since: 0.13.2 */ #include "config.h" #include "telepathy-glib/automatic-proxy-factory.h" #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" static void client_proxy_factory_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE(TpAutomaticProxyFactory, tp_automatic_proxy_factory, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CLIENT_CHANNEL_FACTORY, client_proxy_factory_iface_init)) /* Deprecated module can use deprecated APIs */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void tp_automatic_proxy_factory_init (TpAutomaticProxyFactory *self) { } static void tp_automatic_proxy_factory_class_init (TpAutomaticProxyFactoryClass *cls) { } static TpChannel * tp_automatic_proxy_factory_create_channel_impl ( TpConnection *conn, const gchar *path, GHashTable *properties, GError **error) { const gchar *chan_type; chan_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE); if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE)) { return TP_CHANNEL (tp_stream_tube_channel_new (conn, path, properties, error)); } else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT)) { /* Create a TpTextChannel only if the channel supports Messages */ const gchar * const * interfaces; interfaces = tp_asv_get_strv (properties, TP_PROP_CHANNEL_INTERFACES); if (tp_strv_contains (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES)) return TP_CHANNEL (tp_text_channel_new (conn, path, properties, error)); DEBUG ("channel %s doesn't implement Messages so we can't create " "a TpTextChannel", path); } else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) { return TP_CHANNEL (tp_file_transfer_channel_new (conn, path, properties, error)); } return tp_channel_new_from_properties (conn, path, properties, error); } static TpChannel * tp_automatic_proxy_factory_create_channel ( TpClientChannelFactoryInterface *iface G_GNUC_UNUSED, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error) { return tp_automatic_proxy_factory_create_channel_impl (conn, path, properties, error); } static TpChannel * tp_automatic_proxy_factory_obj_create_channel ( TpClientChannelFactory *self G_GNUC_UNUSED, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error) { return tp_automatic_proxy_factory_create_channel_impl (conn, path, properties, error); } static GArray * tp_automatic_proxy_factory_dup_channel_features_impl (TpChannel *channel) { GArray *features; GQuark feature; features = g_array_sized_new (TRUE, FALSE, sizeof (GQuark), 2); feature = TP_CHANNEL_FEATURE_CORE; g_array_append_val (features, feature); feature = TP_CHANNEL_FEATURE_GROUP; g_array_append_val (features, feature); feature = TP_CHANNEL_FEATURE_PASSWORD; g_array_append_val (features, feature); if (TP_IS_TEXT_CHANNEL (channel)) { feature = TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES; g_array_append_val (features, feature); feature = TP_TEXT_CHANNEL_FEATURE_SMS; g_array_append_val (features, feature); } else if (TP_IS_FILE_TRANSFER_CHANNEL (channel)) { feature = TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE; g_array_append_val (features, feature); } return features; } static GArray * tp_automatic_proxy_factory_obj_dup_channel_features ( TpClientChannelFactory *self G_GNUC_UNUSED, TpChannel *channel) { return tp_automatic_proxy_factory_dup_channel_features_impl (channel); } static GArray * tp_automatic_proxy_factory_dup_channel_features ( TpClientChannelFactoryInterface *iface G_GNUC_UNUSED, TpChannel *channel) { return tp_automatic_proxy_factory_dup_channel_features_impl (channel); } static void client_proxy_factory_iface_init (gpointer g_iface, gpointer unused G_GNUC_UNUSED) { TpClientChannelFactoryInterface *iface = g_iface; iface->create_channel = tp_automatic_proxy_factory_create_channel; iface->dup_channel_features = tp_automatic_proxy_factory_dup_channel_features; iface->obj_create_channel = tp_automatic_proxy_factory_obj_create_channel; iface->obj_dup_channel_features = tp_automatic_proxy_factory_obj_dup_channel_features; } /** * tp_automatic_proxy_factory_new: * * Convenient function to create a new #TpAutomaticProxyFactory instance. * * Returns: a new #TpAutomaticProxyFactory * * Since: 0.13.2 * Deprecated: New code should use #TpAutomaticClientFactory instead */ static TpAutomaticProxyFactory * _tp_automatic_proxy_factory_new (void) { return g_object_new (TP_TYPE_AUTOMATIC_PROXY_FACTORY, NULL); } TpAutomaticProxyFactory * tp_automatic_proxy_factory_new (void) { return _tp_automatic_proxy_factory_new (); } /** * tp_automatic_proxy_factory_dup: * * Returns a cached #TpAutomaticProxyFactory; the same * #TpAutomaticProxyFactory object will be returned by this function repeatedly, * as long as at least one reference exists. * * Returns: (transfer full): a #TpAutomaticProxyFactory * * Since: 0.13.2 * Deprecated: New code should use #TpAutomaticClientFactory instead */ TpAutomaticProxyFactory * tp_automatic_proxy_factory_dup (void) { static TpAutomaticProxyFactory *singleton = NULL; if (singleton != NULL) return g_object_ref (singleton); singleton = _tp_automatic_proxy_factory_new (); g_object_add_weak_pointer (G_OBJECT (singleton), (gpointer) &singleton); return singleton; } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/telepathy-glib/automatic-proxy-factory.h0000644000175000017500000000530312652510705021333 00000000000000/* * Factory creating higher level proxy objects * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_AUTOMATIC_PROXY_FACTORY_H__ #define __TP_AUTOMATIC_PROXY_FACTORY_H__ #include #include G_BEGIN_DECLS typedef struct _TpAutomaticProxyFactory TpAutomaticProxyFactory; typedef struct _TpAutomaticProxyFactoryClass TpAutomaticProxyFactoryClass; struct _TpAutomaticProxyFactoryClass { /**/ GObjectClass parent_class; }; struct _TpAutomaticProxyFactory { /**/ GObject parent; }; GType tp_automatic_proxy_factory_get_type (void); #define TP_TYPE_AUTOMATIC_PROXY_FACTORY \ (tp_automatic_proxy_factory_get_type ()) #define TP_AUTOMATIC_PROXY_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_AUTOMATIC_PROXY_FACTORY, \ TpAutomaticProxyFactory)) #define TP_AUTOMATIC_PROXY_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_AUTOMATIC_PROXY_FACTORY, \ TpAutomaticProxyFactoryClass)) #define TP_IS_AUTOMATIC_PROXY_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_AUTOMATIC_PROXY_FACTORY)) #define TP_IS_AUTOMATIC_PROXY_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_AUTOMATIC_PROXY_FACTORY)) #define TP_AUTOMATIC_PROXY_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_AUTOMATIC_PROXY_FACTORY, \ TpAutomaticProxyFactoryClass)) #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_automatic_client_factory_new) TpAutomaticProxyFactory * tp_automatic_proxy_factory_new (void); _TP_DEPRECATED_IN_0_16_FOR (tp_automatic_client_factory_new) TpAutomaticProxyFactory * tp_automatic_proxy_factory_dup (void); #endif G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/variant-util-internal.h0000644000175000017500000000241312652510705020751 00000000000000/**/ /* * variant-util-internal.h - Headers for non-public GVariant utility functions * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_VARIANT_UTIL_INTERNAL_H__ #define __TP_VARIANT_UTIL_INTERNAL_H__ #include #include GVariant *_tp_asv_to_vardict (const GHashTable *asv); GVariant * _tp_boxed_to_variant (GType gtype, const gchar *variant_type, gpointer boxed); GHashTable * _tp_asv_from_vardict (GVariant *variant); #endif /* __TP_VARIANT_UTIL_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/contact.c0000644000175000017500000046724012652510705016163 00000000000000/* Object representing a Telepathy contact * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONTACTS #include "telepathy-glib/base-contact-list-internal.h" #include "telepathy-glib/connection-contact-list.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/contact-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" static const gchar * nonnull (const gchar *s) { if (s == NULL) return "(null)"; return s; } /** * SECTION:contact * @title: TpContact * @short_description: object representing a contact * @see_also: #TpConnection * * #TpContact objects represent the contacts on a particular #TpConnection. * * Since: 0.7.18 */ /** * TpContact: * * An object representing a contact on a #TpConnection. * * Contact objects support tracking a number of attributes of contacts, as * described by the #TpContactFeature flags. Features can be specified when * instantiating contact objects (with tp_connection_get_contacts_by_id() or * tp_connection_get_contacts_by_handle()), or added to an existing contact * object with tp_connection_upgrade_contacts(). For example, a client wishing * to keep track of a contact's alias would set #TP_CONTACT_FEATURE_ALIAS, and * then listen for the "notify::alias" signal, emitted whenever the * #TpContact:alias property changes. * * Note that releasing a #TpContact object might release handle references * held by calling tp_cli_connection_call_request_handles(), * tp_cli_connection_run_request_handles(), * tp_cli_connection_call_hold_handles(), * tp_cli_connection_run_hold_handles(), * tp_cli_connection_interface_contacts_call_get_contact_attributes() or * tp_cli_connection_interface_contacts_run_get_contact_attributes() directly. * Those functions should be avoided in favour of using #TpContact, * tp_connection_hold_handles(), tp_connection_request_handles() and * tp_connection_get_contact_attributes(). * * Since: 0.7.18 */ struct _TpContactClass { /**/ GObjectClass parent_class; }; struct _TpContact { /**/ GObject parent; TpContactPrivate *priv; }; /** * TpContactFeature: * @TP_CONTACT_FEATURE_ALIAS: #TpContact:alias * @TP_CONTACT_FEATURE_AVATAR_TOKEN: #TpContact:avatar-token * @TP_CONTACT_FEATURE_PRESENCE: #TpContact:presence-type, * #TpContact:presence-status and #TpContact:presence-message * @TP_CONTACT_FEATURE_LOCATION: #TpContact:location (available since 0.11.1) * and #TpContact:location-vardict (since 0.19.10) * @TP_CONTACT_FEATURE_CAPABILITIES: #TpContact:capabilities * (available since 0.11.3) * @TP_CONTACT_FEATURE_AVATAR_DATA: #TpContact:avatar-file and * #TpContact:avatar-mime-type. Implies %TP_CONTACT_FEATURE_AVATAR_TOKEN * (available since 0.11.6) * @TP_CONTACT_FEATURE_CONTACT_INFO: #TpContact:contact-info * (available since 0.11.7) * @TP_CONTACT_FEATURE_CLIENT_TYPES: #TpContact:client-types * (available since 0.13.1) * @TP_CONTACT_FEATURE_SUBSCRIPTION_STATES: #TpContact:subscribe-state, * #TpContact:publish-state and #TpContact:publish-request. Require a * Connection implementing the %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST * interface. (available since 0.13.12) * @TP_CONTACT_FEATURE_CONTACT_GROUPS: #TpContact:contact-groups * (available since 0.13.14) * @TP_CONTACT_FEATURE_CONTACT_BLOCKING: #TpContact:is-blocked. Require * Connection implementing the %TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING * interface. (available since 0.17.0) * * Enumeration representing the features a #TpContact can optionally support. * When requesting a #TpContact, library users specify the desired features; * the #TpContact code will only initialize state for those features, to * avoid unwanted D-Bus round-trips and signal connections. * * Since 0.11.5, there is a corresponding #GEnumClass type, * %TP_TYPE_CONTACT_FEATURE. * * Since: 0.7.18 */ /** * TP_NUM_CONTACT_FEATURES: * * 1 higher than the highest #TpContactFeature supported by this version of * telepathy-glib. * * Since: 0.19.0 */ /** * NUM_TP_CONTACT_FEATURES: (skip) * * 1 higher than the highest #TpContactFeature supported by this version of * telepathy-glib. Use %TP_NUM_CONTACT_FEATURES in new code. * * Since: 0.7.18 */ /** * TP_CONTACT_FEATURE_INVALID: (skip) * * An invalid TpContactFeature. Used as list termination. See for example * tp_simple_client_factory_add_contact_features_varargs(). * * Since: 0.15.5 */ /** * TP_TYPE_CONTACT_FEATURE: * * The #GEnumClass type of a #TpContactFeature. * * Since: 0.11.5 */ G_DEFINE_TYPE (TpContact, tp_contact, G_TYPE_OBJECT) enum { PROP_CONNECTION = 1, PROP_HANDLE, PROP_IDENTIFIER, PROP_ALIAS, PROP_AVATAR_TOKEN, PROP_AVATAR_FILE, PROP_AVATAR_MIME_TYPE, PROP_PRESENCE_TYPE, PROP_PRESENCE_STATUS, PROP_PRESENCE_MESSAGE, PROP_LOCATION, PROP_LOCATION_VARDICT, PROP_CAPABILITIES, PROP_CONTACT_INFO, PROP_CLIENT_TYPES, PROP_SUBSCRIBE_STATE, PROP_PUBLISH_STATE, PROP_PUBLISH_REQUEST, PROP_CONTACT_GROUPS, PROP_IS_BLOCKED, N_PROPS }; enum { SIGNAL_PRESENCE_CHANGED, SIGNAL_SUBSCRIPTION_STATES_CHANGED, SIGNAL_CONTACT_GROUPS_CHANGED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; /* The API allows for more than 32 features, but this implementation does * not. We can easily expand this later. */ typedef enum { CONTACT_FEATURE_FLAG_ALIAS = 1 << TP_CONTACT_FEATURE_ALIAS, CONTACT_FEATURE_FLAG_AVATAR_TOKEN = 1 << TP_CONTACT_FEATURE_AVATAR_TOKEN, CONTACT_FEATURE_FLAG_PRESENCE = 1 << TP_CONTACT_FEATURE_PRESENCE, CONTACT_FEATURE_FLAG_LOCATION = 1 << TP_CONTACT_FEATURE_LOCATION, CONTACT_FEATURE_FLAG_CAPABILITIES = 1 << TP_CONTACT_FEATURE_CAPABILITIES, CONTACT_FEATURE_FLAG_AVATAR_DATA = 1 << TP_CONTACT_FEATURE_AVATAR_DATA, CONTACT_FEATURE_FLAG_CONTACT_INFO = 1 << TP_CONTACT_FEATURE_CONTACT_INFO, CONTACT_FEATURE_FLAG_CLIENT_TYPES = 1 << TP_CONTACT_FEATURE_CLIENT_TYPES, CONTACT_FEATURE_FLAG_STATES = 1 << TP_CONTACT_FEATURE_SUBSCRIPTION_STATES, CONTACT_FEATURE_FLAG_CONTACT_GROUPS = 1 << TP_CONTACT_FEATURE_CONTACT_GROUPS, CONTACT_FEATURE_FLAG_CONTACT_BLOCKING = 1 << TP_CONTACT_FEATURE_CONTACT_BLOCKING, } ContactFeatureFlags; struct _TpContactPrivate { /* basics */ TpConnection *connection; TpHandle handle; gchar *identifier; ContactFeatureFlags has_features; /* aliasing */ gchar *alias; /* avatars */ gchar *avatar_token; GFile *avatar_file; gchar *avatar_mime_type; /* presence */ TpConnectionPresenceType presence_type; gchar *presence_status; gchar *presence_message; /* location */ GHashTable *location; /* client types */ gchar **client_types; /* capabilities */ TpCapabilities *capabilities; /* a list of TpContactInfoField */ GList *contact_info; /* Subscribe/Publish states */ TpSubscriptionState subscribe; TpSubscriptionState publish; gchar *publish_request; /* ContactGroups */ /* array of dupped strings */ GPtrArray *contact_groups; /* ContactBlocking */ gboolean is_blocked; }; /** * tp_contact_get_account: * @self: a contact * * Return the #TpAccount of @self's #TpContact:connection. * See tp_connection_get_account() for details. * * Returns: (transfer none): a borrowed reference to @self's account * (it must be referenced with g_object_ref if it must remain valid * longer than the contact) * * Since: 0.19.0 */ TpAccount * tp_contact_get_account (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), NULL); return tp_connection_get_account (self->priv->connection); } /** * tp_contact_get_connection: * @self: a contact * * * * Returns: (transfer none): a borrowed reference to the #TpContact:connection * (it must be referenced with g_object_ref if it must remain valid * longer than the contact) * * Since: 0.7.18 */ TpConnection * tp_contact_get_connection (TpContact *self) { g_return_val_if_fail (self != NULL, 0); return self->priv->connection; } /** * tp_contact_get_handle: * @self: a contact * * Return the contact's handle, which is of type %TP_HANDLE_TYPE_CONTACT, * or 0 if the #TpContact:connection has become invalid. * * This handle is referenced using the Telepathy D-Bus API and remains * referenced for as long as @self exists and the * #TpContact:connection remains valid. * * However, the caller of this function does not gain an additional reference * to the handle. * * Returns: the same handle as the #TpContact:handle property * * Since: 0.7.18 */ TpHandle tp_contact_get_handle (TpContact *self) { g_return_val_if_fail (self != NULL, 0); return self->priv->handle; } /** * tp_contact_get_identifier: * @self: a contact * * Return the contact's identifier. This remains valid for as long as @self * exists; if the caller requires a string that will persist for longer than * that, it must be copied with g_strdup(). * * Returns: the same non-%NULL identifier as the #TpContact:identifier property * * Since: 0.7.18 */ const gchar * tp_contact_get_identifier (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); /* identifier must be non-NULL by the time we're visible to library-user * code */ g_return_val_if_fail (self->priv->identifier != NULL, NULL); return self->priv->identifier; } /** * tp_contact_has_feature: * @self: a contact * @feature: a desired feature * * * * Returns: %TRUE if @self has been set up to track the feature @feature * * Since: 0.7.18 */ gboolean tp_contact_has_feature (TpContact *self, TpContactFeature feature) { g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (feature < TP_NUM_CONTACT_FEATURES, FALSE); return ((self->priv->has_features & (1 << feature)) != 0); } /** * tp_contact_get_alias: * @self: a contact * * Return the contact's alias. This remains valid until the main loop * is re-entered; if the caller requires a string that will persist for * longer than that, it must be copied with g_strdup(). * * Returns: the same non-%NULL alias as the #TpContact:alias * * Since: 0.7.18 */ const gchar * tp_contact_get_alias (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); /* identifier must be non-NULL by the time we're visible to library-user * code */ g_return_val_if_fail (self->priv->identifier != NULL, NULL); if (self->priv->alias != NULL) return self->priv->alias; return self->priv->identifier; } /** * tp_contact_get_avatar_token: * @self: a contact * * Return the contact's avatar token. This remains valid until the main loop * is re-entered; if the caller requires a string that will persist for * longer than that, it must be copied with g_strdup(). * * Returns: the same token as the #TpContact:avatar-token property * (possibly %NULL) * * Since: 0.7.18 */ const gchar * tp_contact_get_avatar_token (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->avatar_token; } /** * tp_contact_get_avatar_file: * @self: a contact * * Return the contact's avatar file. This remains valid until the main loop * is re-entered; if the caller requires a #GFile that will persist for * longer than that, it must be reffed with g_object_ref(). * * Returns: (transfer none): the same #GFile as the #TpContact:avatar-file property * (possibly %NULL) * * Since: 0.11.6 */ GFile * tp_contact_get_avatar_file (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->avatar_file; } /** * tp_contact_get_avatar_mime_type: * @self: a contact * * Return the contact's avatar MIME type. This remains valid until the main loop * is re-entered; if the caller requires a string that will persist for * longer than that, it must be copied with g_strdup(). * * Returns: the same MIME type as the #TpContact:avatar-mime-type property * (possibly %NULL) * * Since: 0.11.6 */ const gchar * tp_contact_get_avatar_mime_type (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->avatar_mime_type; } /** * tp_contact_get_presence_type: * @self: a contact * * If this object has been set up to track %TP_CONTACT_FEATURE_PRESENCE * and the underlying connection supports either the Presence or * SimplePresence interfaces, return the type of the contact's presence. * * Otherwise, return %TP_CONNECTION_PRESENCE_TYPE_UNSET. * * Returns: the same presence type as the #TpContact:presence-type property * * Since: 0.7.18 */ TpConnectionPresenceType tp_contact_get_presence_type (TpContact *self) { g_return_val_if_fail (self != NULL, TP_CONNECTION_PRESENCE_TYPE_UNSET); return self->priv->presence_type; } /** * tp_contact_get_presence_status: * @self: a contact * * Return the name of the contact's presence status, or an empty string. * This remains valid until the main loop is re-entered; if the caller * requires a string that will persist for longer than that, it must be * copied with g_strdup(). * * Returns: the same non-%NULL status name as the #TpContact:presence-status * property * * Since: 0.7.18 */ const gchar * tp_contact_get_presence_status (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return (self->priv->presence_status == NULL ? "" : self->priv->presence_status); } /** * tp_contact_get_presence_message: * @self: a contact * * Return the contact's user-defined status message, or an empty string. * This remains valid until the main loop is re-entered; if the caller * requires a string that will persist for longer than that, it must be * copied with g_strdup(). * * Returns: the same non-%NULL message as the #TpContact:presence-message * property * * Since: 0.7.18 */ const gchar * tp_contact_get_presence_message (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return (self->priv->presence_message == NULL ? "" : self->priv->presence_message); } /** * tp_contact_get_location: * @self: a contact * * Return the contact's user-defined location or %NULL if the location is * unspecified. * This remains valid until the main loop is re-entered; if the caller * requires a hash table that will persist for longer than that, it must be * reffed with g_hash_table_ref(). * * Returns: (element-type utf8 GObject.Value) (transfer none): the same * #GHashTable (or %NULL) as the #TpContact:location property * * Since: 0.11.1 */ GHashTable * tp_contact_get_location (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->location; } /** * tp_contact_dup_location: * @self: a contact * * Return the contact's user-defined location, or %NULL if the location is * unspecified. * * This function returns the same information as tp_contact_get_location(), * but in a different format. * * Returns: a variant of type %G_VARIANT_TYPE_VARDICT, the same as * the #TpContact:location-vardict property * * Since: 0.19.10 */ GVariant * tp_contact_dup_location (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); if (self->priv->location == NULL) return NULL; return _tp_asv_to_vardict (self->priv->location); } /** * tp_contact_get_client_types: * @self: a contact * * Return the contact's client types or %NULL if the client types are * unspecified. * * Returns: (array zero-terminated=1) (transfer none): the same * #GStrv as the #TpContact:client-types property * * Since: 0.13.1 */ const gchar * const * tp_contact_get_client_types (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return (const gchar * const *) self->priv->client_types; } /** * tp_contact_get_capabilities: * @self: a contact * * * * Returns: (transfer none): the same #TpCapabilities (or %NULL) as the * #TpContact:capabilities property * * Since: 0.11.3 */ TpCapabilities * tp_contact_get_capabilities (TpContact *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->capabilities; } /** * tp_contact_get_contact_info: * @self: a #TpContact * * Returns a newly allocated #GList of contact's vCard fields. The list must be * freed with g_list_free() after used. * * Note that the #TpContactInfoFields in the returned #GList are not * dupped before returning from this function. One could copy every item in the * list using tp_contact_info_field_copy(). * * Same as the #TpContact:contact-info property. * * Returns: (element-type TelepathyGLib.ContactInfoField) (transfer container): * a #GList of #TpContactInfoField, or %NULL if the feature is not yet * prepared. * Since: 0.11.7 * Deprecated: Since 0.19.9. New code should use * tp_contact_dup_contact_info() instead. */ GList * tp_contact_get_contact_info (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), NULL); return g_list_copy (self->priv->contact_info); } /** * tp_contact_dup_contact_info: * @self: a #TpContact * * Returns a newly allocated #GList of contact's vCard fields. The list must be * freed with tp_contact_info_list_free() after used. * * Same as the #TpContact:contact-info property. * * Returns: (element-type TelepathyGLib.ContactInfoField) (transfer full): * a #GList of #TpContactInfoField, or %NULL if the feature is not yet * prepared. * Since: 0.19.9 */ GList * tp_contact_dup_contact_info (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), NULL); return _tp_g_list_copy_deep (self->priv->contact_info, (GCopyFunc) tp_contact_info_field_copy, NULL); } /** * tp_contact_get_subscribe_state: * @self: a #TpContact * * Return the state of the local user's subscription to this remote contact's * presence. * * This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until * %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared * * Returns: the value of #TpContact:subscribe-state. * * Since: 0.13.12 */ TpSubscriptionState tp_contact_get_subscribe_state (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), TP_SUBSCRIPTION_STATE_UNKNOWN); return self->priv->subscribe; } /** * tp_contact_get_publish_state: * @self: a #TpContact * * Return the state of this remote contact's subscription to the local user's * presence. * * This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until * %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared * * Returns: the value of #TpContact:publish-state. * * Since: 0.13.12 */ TpSubscriptionState tp_contact_get_publish_state (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), TP_SUBSCRIPTION_STATE_UNKNOWN); return self->priv->publish; } /** * tp_contact_get_publish_request: * @self: a #TpContact * * If #TpContact:publish-state is set to %TP_SUBSCRIPTION_STATE_ASK, return the * message that this remote contact sent when they requested permission to see * the local user's presence, an empty string ("") otherwise. This remains valid * until the main loop is re-entered; if the caller requires a string that will * persist for longer than that, it must be copied with g_strdup(). * * This is set to %NULL until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been * prepared, and it is guaranteed to be non-%NULL afterward. * Returns: the value of #TpContact:publish-request. * * Since: 0.13.12 */ const gchar * tp_contact_get_publish_request (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), NULL); return self->priv->publish_request; } /** * tp_contact_get_contact_groups: * @self: a #TpContact * * Return names of groups of which a contact is a member. It is incorrect to * call this method before %TP_CONTACT_FEATURE_CONTACT_GROUPS has been * prepared. This remains valid until the main loop is re-entered; if the caller * requires a #GStrv that will persist for longer than that, it must be copied * with g_strdupv(). * * Returns: (array zero-terminated=1) (transfer none): the same * #GStrv as the #TpContact:contact-groups property * * Since: 0.13.14 */ const gchar * const * tp_contact_get_contact_groups (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), NULL); if (self->priv->contact_groups == NULL) return NULL; return (const gchar * const *) self->priv->contact_groups->pdata; } static void set_contact_groups_cb (TpConnection *connection, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to set contact groups: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_contact_set_contact_groups_async: * @self: a #TpContact * @n_groups: the number of groups, or -1 if @groups is %NULL-terminated * @groups: (array length=n_groups) (element-type utf8) (allow-none): the set of * groups which the contact should be in (may be %NULL if @n_groups is 0) * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Add @self to the given groups (creating new groups if necessary), and remove * it from all other groups. If the user is removed from a group of which they * were the only member, the group MAY be removed automatically. You can then * call tp_contact_set_contact_groups_finish() to get the result of the * operation. * * If the operation is successful and %TP_CONTACT_FEATURE_CONTACT_GROUPS is * prepared, the #TpContact:contact-groups property will be * updated (emitting "notify::contact-groups" signal) and * #TpContact::contact-groups-changed signal will be emitted before @callback * is called. That means you can call tp_contact_get_contact_groups() to get the * new contact groups inside @callback. * * Since: 0.13.14 */ void tp_contact_set_contact_groups_async (TpContact *self, gint n_groups, const gchar * const *groups, GAsyncReadyCallback callback, gpointer user_data) { static const gchar *empty_groups[] = { NULL }; GSimpleAsyncResult *result; gchar **new_groups = NULL; g_return_if_fail (TP_IS_CONTACT (self)); g_return_if_fail (n_groups >= -1); g_return_if_fail (n_groups <= 0 || groups != NULL); if (groups == NULL) { groups = empty_groups; } else if (n_groups > 0) { /* Create NULL-terminated array */ new_groups = g_new0 (gchar *, n_groups + 1); g_memmove (new_groups, groups, n_groups * sizeof (gchar *)); groups = (const gchar * const *) new_groups; } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_contact_set_contact_groups_finish); tp_cli_connection_interface_contact_groups_call_set_contact_groups ( self->priv->connection, -1, self->priv->handle, (const gchar **) groups, set_contact_groups_cb, result, NULL, G_OBJECT (self)); g_free (new_groups); } /** * tp_contact_set_contact_groups_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to be filled * * Finishes an async set of @self contact groups. * * Returns: %TRUE if the request call was successful, otherwise %FALSE * * Since: 0.13.14 */ gboolean tp_contact_set_contact_groups_finish (TpContact *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_contact_set_contact_groups_finish); } void _tp_contact_connection_disposed (TpContact *contact) { /* The connection has gone away, so we no longer have a meaningful handle, * and will never have one again. */ g_assert (contact->priv->handle != 0); contact->priv->handle = 0; g_object_notify ((GObject *) contact, "handle"); } static void tp_contact_dispose (GObject *object) { TpContact *self = TP_CONTACT (object); if (self->priv->handle != 0) { g_assert (self->priv->connection != NULL); _tp_connection_remove_contact (self->priv->connection, self->priv->handle, self); self->priv->handle = 0; } tp_clear_object (&self->priv->connection); tp_clear_pointer (&self->priv->location, g_hash_table_unref); tp_clear_object (&self->priv->capabilities); tp_clear_object (&self->priv->avatar_file); tp_clear_pointer (&self->priv->contact_groups, g_ptr_array_unref); ((GObjectClass *) tp_contact_parent_class)->dispose (object); } static void tp_contact_finalize (GObject *object) { TpContact *self = TP_CONTACT (object); g_free (self->priv->identifier); g_free (self->priv->alias); g_free (self->priv->avatar_token); g_free (self->priv->avatar_mime_type); g_free (self->priv->presence_status); g_free (self->priv->presence_message); g_strfreev (self->priv->client_types); tp_contact_info_list_free (self->priv->contact_info); g_free (self->priv->publish_request); ((GObjectClass *) tp_contact_parent_class)->finalize (object); } static void tp_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpContact *self = TP_CONTACT (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; case PROP_IDENTIFIER: g_assert (self->priv->identifier != NULL); g_value_set_string (value, self->priv->identifier); break; case PROP_ALIAS: /* tp_contact_get_alias actually has some logic, so avoid * duplicating it */ g_value_set_string (value, tp_contact_get_alias (self)); break; case PROP_AVATAR_TOKEN: g_value_set_string (value, self->priv->avatar_token); break; case PROP_AVATAR_FILE: g_value_set_object (value, self->priv->avatar_file); break; case PROP_AVATAR_MIME_TYPE: g_value_set_string (value, self->priv->avatar_mime_type); break; case PROP_PRESENCE_TYPE: g_value_set_uint (value, self->priv->presence_type); break; case PROP_PRESENCE_STATUS: g_value_set_string (value, tp_contact_get_presence_status (self)); break; case PROP_PRESENCE_MESSAGE: g_value_set_string (value, tp_contact_get_presence_message (self)); break; case PROP_LOCATION: g_value_set_boxed (value, tp_contact_get_location (self)); break; case PROP_LOCATION_VARDICT: g_value_take_variant (value, tp_contact_dup_location (self)); break; case PROP_CAPABILITIES: g_value_set_object (value, tp_contact_get_capabilities (self)); break; case PROP_CONTACT_INFO: g_value_set_boxed (value, self->priv->contact_info); break; case PROP_CLIENT_TYPES: g_value_set_boxed (value, tp_contact_get_client_types (self)); break; case PROP_SUBSCRIBE_STATE: g_value_set_uint (value, tp_contact_get_subscribe_state (self)); break; case PROP_PUBLISH_STATE: g_value_set_uint (value, tp_contact_get_publish_state (self)); break; case PROP_PUBLISH_REQUEST: g_value_set_string (value, tp_contact_get_publish_request (self)); break; case PROP_CONTACT_GROUPS: g_value_set_boxed (value, tp_contact_get_contact_groups (self)); break; case PROP_IS_BLOCKED: g_value_set_boolean (value, tp_contact_is_blocked (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_contact_class_init (TpContactClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpContactPrivate)); object_class->get_property = tp_contact_get_property; object_class->dispose = tp_contact_dispose; object_class->finalize = tp_contact_finalize; /** * TpContact:connection: * * The #TpConnection to which this contact belongs. */ param_spec = g_param_spec_object ("connection", "TpConnection object", "Connection object that owns this channel", TP_TYPE_CONNECTION, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpContact:handle: * * The contact's handle in the Telepathy D-Bus API, a handle of type * %TP_HANDLE_TYPE_CONTACT representing the string * given by #TpContact:identifier. * * This handle is referenced using the Telepathy D-Bus API and remains * referenced for as long as the #TpContact exists and the * #TpContact:connection remains valid. * * However, getting this property does not cause an additional reference * to the handle to be held. * * If the #TpContact:connection becomes invalid, this property is no longer * meaningful and will be set to 0. */ param_spec = g_param_spec_uint ("handle", "Handle", "The TP_HANDLE_TYPE_CONTACT handle for this contact", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HANDLE, param_spec); /** * TpContact:identifier: * * The contact's identifier in the instant messaging protocol (e.g. * XMPP JID, SIP URI, AOL screenname or IRC nick - whatever the underlying * protocol uses to identify a user). * * This is never %NULL for contact objects that are visible to library-user * code. */ param_spec = g_param_spec_string ("identifier", "IM protocol identifier", "The contact's identifier in the instant messaging protocol (e.g. " "XMPP JID, SIP URI, AOL screenname or IRC nick)", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IDENTIFIER, param_spec); /** * TpContact:alias: * * The contact's alias if available, falling back to their * #TpContact:identifier if no alias is available or if the #TpContact has * not been set up to track %TP_CONTACT_FEATURE_ALIAS. * * This alias may have been supplied by the contact themselves, or by the * local user, so it does not necessarily unambiguously identify the contact. * However, it is suitable for use as a main "display name" for the contact. * * This is never %NULL for contact objects that are visible to library-user * code. */ param_spec = g_param_spec_string ("alias", "Alias", "The contact's alias (display name)", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ALIAS, param_spec); /** * TpContact:avatar-token: * * An opaque string representing state of the contact's avatar (depending on * the protocol, this might be a hash, a timestamp or something else), or * an empty string if there is no avatar. * * This may be %NULL if it is not known whether this contact has an avatar * or not (either for network protocol reasons, or because this #TpContact * has not been set up to track %TP_CONTACT_FEATURE_AVATAR_TOKEN). */ param_spec = g_param_spec_string ("avatar-token", "Avatar token", "Opaque string representing the contact's avatar, or \"\", or NULL", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVATAR_TOKEN, param_spec); /** * TpContact:avatar-file: * * #GFile to the latest cached avatar image, or %NULL if this contact has * no avatar, or if the avatar data is not yet retrieved. * * When #TpContact:avatar-token changes, this property is not updated * immediately, but will be updated when the new avatar data is retrieved and * stored in cache. Until then, the file will keep its old value of the latest * cached avatar image. * * This is set to %NULL if %TP_CONTACT_FEATURE_AVATAR_DATA is not set on this * contact. Note that setting %TP_CONTACT_FEATURE_AVATAR_DATA will also * implicitly set %TP_CONTACT_FEATURE_AVATAR_TOKEN. * * Since: 0.11.6 */ param_spec = g_param_spec_object ("avatar-file", "Avatar file", "File to the latest cached avatar image, or %NULL", G_TYPE_FILE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVATAR_FILE, param_spec); /** * TpContact:avatar-mime-type: * * MIME type of the latest cached avatar image, or %NULL if this contact has * no avatar, or if the avatar data is not yet retrieved. * * This is always the MIME type of the image given by #TpContact:avatar-file. * * Since: 0.11.6 */ param_spec = g_param_spec_string ("avatar-mime-type", "Avatar MIME type", "MIME type of the latest cached avatar image, or %NULL", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVATAR_MIME_TYPE, param_spec); /** * TpContact:presence-type: * * The #TpConnectionPresenceType representing the type of presence status * for this contact. * * This is provided so even unknown values for #TpContact:presence-status * can be classified into their fundamental types. * * This may be %TP_CONNECTION_PRESENCE_TYPE_UNSET if this #TpContact * has not been set up to track %TP_CONTACT_FEATURE_PRESENCE. */ param_spec = g_param_spec_uint ("presence-type", "Presence type", "The TpConnectionPresenceType for this contact", 0, G_MAXUINT32, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PRESENCE_TYPE, param_spec); /** * TpContact:presence-status: * * A string representing the presence status of this contact. This may be * a well-known string from the Telepathy specification, like "available", * or a connection-manager-specific string, like "out-to-lunch". * * This may be an empty string if this #TpContact object has not been set up * to track %TP_CONTACT_FEATURE_PRESENCE. It is never %NULL. */ param_spec = g_param_spec_string ("presence-status", "Presence status", "Possibly connection-manager-specific string representing the " "contact's presence status", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PRESENCE_STATUS, param_spec); /** * TpContact:presence-message: * * If this contact has set a user-defined status message, that message; * if not, an empty string (which user interfaces may replace with a * localized form of the #TpContact:presence-status or * #TpContact:presence-type). * * This may be an empty string even if the contact has set a message, * if this #TpContact object has not been set up to track * %TP_CONTACT_FEATURE_PRESENCE. It is never %NULL. */ param_spec = g_param_spec_string ("presence-message", "Presence message", "User-defined status message, or an empty string", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PRESENCE_MESSAGE, param_spec); /** * TpContact:location: * * If this contact has set a user-defined location, a string to * #GValue * hash table containing his location. If not, %NULL. * tp_asv_get_string() and similar functions can be used to access * the contents. * * This may be %NULL even if the contact has set a location, * if this #TpContact object has not been set up to track * %TP_CONTACT_FEATURE_LOCATION. * * Since: 0.11.1 */ param_spec = g_param_spec_boxed ("location", "Location", "User-defined location, or NULL", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCATION, param_spec); /** * TpContact:location-vardict: * * If this contact has set a user-defined location, a string to * variant map containing his location. If not, %NULL. * tp_vardict_get_string() and similar functions can be used to access * the contents. * * This may be %NULL even if the contact has set a location, * if this #TpContact object has not been set up to track * %TP_CONTACT_FEATURE_LOCATION. * * This property contains the same information as #TpContact:location, * in a different format. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("location-vardict", "Location", "User-defined location, or NULL", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCATION_VARDICT, param_spec); /** * TpContact:capabilities: * * The capabilities supported by this contact. If the underlying Connection * doesn't support the ContactCapabilities interface, this property will * contain the capabilities supported by the connection. * Use tp_capabilities_is_specific_to_contact() to check if the capabilities * are specific to this #TpContact or not. * * This may be %NULL if this #TpContact object has not been set up to track * %TP_CONTACT_FEATURE_CAPABILITIES. * * Since: 0.11.3 */ param_spec = g_param_spec_object ("capabilities", "Capabilities", "Capabilities of the contact, or NULL", TP_TYPE_CAPABILITIES, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAPABILITIES, param_spec); /** * TpContact:contact-info: * * A #GList of #TpContactInfoField representing the vCard of this contact. * * This is set to %NULL if %TP_CONTACT_FEATURE_CONTACT_INFO is not set on this * contact. * * Since: 0.11.7 */ param_spec = g_param_spec_boxed ("contact-info", "Contact Info", "Information of the contact, or NULL", TP_TYPE_CONTACT_INFO_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_INFO, param_spec); /** * TpContact:client-types: * * A #GStrv containing the client types of this contact. * * This is set to %NULL if %TP_CONTACT_FEATURE_CLIENT_TYPES is not * set on this contact; it may also be %NULL if that feature is prepared, but * the contact's client types are unknown. * * Since: 0.13.1 */ param_spec = g_param_spec_boxed ("client-types", "Client types", "Client types of the contact, or NULL", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CLIENT_TYPES, param_spec); /** * TpContact:subscribe-state: * * A #TpSubscriptionState indicating the state of the local user's * subscription to this contact's presence. * * This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until * %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared * * Since: 0.13.12 */ param_spec = g_param_spec_uint ("subscribe-state", "Subscribe State", "Subscribe state of the contact", 0, G_MAXUINT, TP_SUBSCRIPTION_STATE_UNKNOWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SUBSCRIBE_STATE, param_spec); /** * TpContact:publish-state: * * A #TpSubscriptionState indicating the state of this contact's subscription * to the local user's presence. * * This is set to %TP_SUBSCRIPTION_STATE_UNKNOWN until * %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared * * Since: 0.13.12 */ param_spec = g_param_spec_uint ("publish-state", "Publish State", "Publish state of the contact", 0, G_MAXUINT, TP_SUBSCRIPTION_STATE_UNKNOWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PUBLISH_STATE, param_spec); /** * TpContact:publish-request: * * The message that contact sent when they requested permission to see the * local user's presence, if #TpContact:publish-state is * %TP_SUBSCRIPTION_STATE_ASK, an empty string ("") otherwise. * * This is set to %NULL until %TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been * prepared, and it is guaranteed to be non-%NULL afterward. * * Since: 0.13.12 */ param_spec = g_param_spec_string ("publish-request", "Publish Request", "Publish request message of the contact", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PUBLISH_REQUEST, param_spec); /** * TpContact:contact-groups: * * a #GStrv with names of groups of which a contact is a member. * * This is set to %NULL if %TP_CONTACT_FEATURE_CONTACT_GROUPS is not prepared * on this contact, or if the connection does not implement ContactGroups * interface. * * Since: 0.13.14 */ param_spec = g_param_spec_boxed ("contact-groups", "Contact Groups", "Groups of the contact", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_GROUPS, param_spec); /** * TpContact:is-blocked: * * %TRUE if the contact has been blocked. * * This is set to %FALSE if %TP_CONTACT_FEATURE_CONTACT_BLOCKING is not * prepared on this contact, or if the connection does not implement * ContactBlocking interface. * * Since: 0.17.0 */ param_spec = g_param_spec_boolean ("is-blocked", "is blocked", "TRUE if contact is blocked", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IS_BLOCKED, param_spec); /** * TpContact::contact-groups-changed: * @contact: A #TpContact * @added: A #GStrv with added contact groups * @removed: A #GStrv with removed contact groups * * Emitted when this contact's groups changes. When this signal is emitted, * #TpContact:contact-groups property is already updated. * * Since: 0.13.14 */ signals[SIGNAL_CONTACT_GROUPS_CHANGED] = g_signal_new ( "contact-groups-changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRV, G_TYPE_STRV); /** * TpContact::subscription-states-changed: * @contact: a #TpContact * @subscribe: the new value of #TpContact:subscribe-state * @publish: the new value of #TpContact:publish-state * @publish_request: the new value of #TpContact:publish-request * * Emitted when this contact's subscription states changes. * * Since: 0.13.12 */ signals[SIGNAL_SUBSCRIPTION_STATES_CHANGED] = g_signal_new ( "subscription-states-changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING); /** * TpContact::presence-changed: * @contact: a #TpContact * @type: The new value of #TpContact:presence-type * @status: The new value of #TpContact:presence-status * @message: The new value of #TpContact:presence-message * * Emitted when this contact's presence changes. * * Since: 0.11.7 */ signals[SIGNAL_PRESENCE_CHANGED] = g_signal_new ("presence-changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); } TpContact * _tp_contact_new (TpConnection *connection, TpHandle handle, const gchar *identifier) { TpContact *self = TP_CONTACT (g_object_new (TP_TYPE_CONTACT, NULL)); self->priv->connection = g_object_ref (connection); self->priv->handle = handle; self->priv->identifier = g_strdup (identifier); return self; } /* FIXME: Ideally this should be replaced with * * tp_simple_client_factory_ensure_contact (tp_proxy_get_factory (connection), * handle, identifier); * * but we cannot assert CM has immortal handles (yet). That means we cannot * guarantee that all TpContact objects are created through the factory and so * let it make TpContact subclasses. */ static TpContact * tp_contact_ensure (TpConnection *connection, TpHandle handle) { TpContact *self = _tp_connection_lookup_contact (connection, handle); if (self != NULL) { g_assert (self->priv->handle == handle); return g_object_ref (self); } self = _tp_contact_new (connection, handle, NULL); _tp_connection_add_contact (connection, handle, self); return self; } /** * tp_connection_dup_contact_if_possible: * @connection: a connection * @handle: a handle of type %TP_HANDLE_TYPE_CONTACT * @identifier: (transfer none): the normalized identifier (XMPP JID, etc.) * corresponding to @handle, or %NULL if not known * * Try to return an existing contact object or create a new contact object * immediately. * * If tp_connection_has_immortal_handles() would return %TRUE and * @identifier is non-%NULL, this function always succeeds. * * On connections without immortal handles, it is not possible to guarantee * that @handle remains valid without making asynchronous D-Bus calls, so * it might be necessary to delay processing of messages or other events * until a #TpContact can be constructed asynchronously, for instance by using * tp_connection_get_contacts_by_id(). * * Similarly, if @identifier is %NULL, it might not be possible to find the * identifier for @handle without making asynchronous D-Bus calls, so * it might be necessary to delay processing of messages or other events * until a #TpContact can be constructed asynchronously, for instance by using * tp_connection_get_contacts_by_handle(). * * Returns: (transfer full): a contact or %NULL * * Since: 0.13.9 */ TpContact * tp_connection_dup_contact_if_possible (TpConnection *connection, TpHandle handle, const gchar *identifier) { TpContact *ret; g_return_val_if_fail (TP_IS_CONNECTION (connection), NULL); g_return_val_if_fail (handle != 0, NULL); ret = _tp_connection_lookup_contact (connection, handle); if (ret != NULL && ret->priv->identifier != NULL) { g_object_ref (ret); } else if (tp_connection_has_immortal_handles (connection) && identifier != NULL) { ret = tp_contact_ensure (connection, handle); if (ret->priv->identifier == NULL) { /* new object, I suppose we'll have to believe the caller */ ret->priv->identifier = g_strdup (identifier); } } else { /* we don't already have a contact, and we can't make one without * D-Bus calls (either because we can't rely on the handle staying * static, or we don't know the identifier) */ return NULL; } g_assert (ret->priv->handle == handle); if (G_UNLIKELY (identifier != NULL && tp_strdiff (ret->priv->identifier, identifier))) { WARNING ("Either this client, or connection manager %s, is broken: " "handle %u is thought to be '%s', but we already have " "a TpContact that thinks the identifier is '%s'", tp_proxy_get_bus_name (connection), handle, identifier, ret->priv->identifier); g_object_unref (ret); return NULL; } return ret; } static void tp_contact_init (TpContact *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CONTACT, TpContactPrivate); self->priv->client_types = NULL; } typedef struct _ContactsContext ContactsContext; typedef void (*ContactsProc) (ContactsContext *self); typedef enum { CB_BY_HANDLE, CB_BY_ID, CB_UPGRADE } ContactsSignature; static const gchar * contacts_signature_to_string (ContactsSignature sig) { switch (sig) { case CB_BY_HANDLE: return "by handle"; case CB_BY_ID: return "by ID"; case CB_UPGRADE: return "upgrade"; default: return "???"; } } struct _ContactsContext { gsize refcount; /* owned */ TpConnection *connection; /* array of owned TpContact; preallocated but empty until handles have * been held or requested */ GPtrArray *contacts; /* array of handles; empty until RequestHandles has returned, if we * started from IDs */ GArray *handles; /* array of handles; empty until RequestHandles has returned, if we * started from IDs */ GArray *invalid; /* strv of IDs; NULL unless we started from IDs */ GPtrArray *request_ids; /* ID => GError, NULL unless we started from IDs */ GHashTable *request_errors; /* features we need to get, if possible, before this request can finish */ ContactFeatureFlags wanted; /* features we can expect to get from GetContactAttributes * (subset of wanted) */ ContactFeatureFlags getting; /* callback for when we've finished, plus the usual misc */ ContactsSignature signature; union { TpConnectionContactsByHandleCb by_handle; TpConnectionContactsByIdCb by_id; TpConnectionUpgradeContactsCb upgrade; } callback; gpointer user_data; GDestroyNotify destroy; GObject *weak_object; /* Whether or not our weak object died*/ gboolean no_purpose_in_life; /* queue of ContactsProc */ GQueue todo; /* index into handles or ids, only used when the first HoldHandles call * failed with InvalidHandle, or the RequestHandles call failed with * NotAvailable */ guint next_index; /* TRUE if all contacts already have IDs */ gboolean contacts_have_ids; }; /* This code (and lots of telepathy-glib, really) won't work if this * assertion fails, because we put function pointers in a GQueue. If anyone * cares about platforms where this fails, fixing this would involve * slice-allocating sizeof (GCallback) bytes repeatedly, and putting *those* * in the queue. */ G_STATIC_ASSERT (sizeof (GCallback) == sizeof (gpointer)); static void contacts_context_weak_notify (gpointer data, GObject *dead) { ContactsContext *c = data; g_assert (c->weak_object == dead); c->no_purpose_in_life = TRUE; c->weak_object = NULL; } static ContactsContext * contacts_context_new (TpConnection *connection, guint n_contacts, ContactFeatureFlags want_features, ContactsSignature signature, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { ContactsContext *c = g_slice_new0 (ContactsContext); DEBUG ("%p, for %u contacts, %s", c, n_contacts, contacts_signature_to_string (signature)); DEBUG ("want alias: %s", (want_features & CONTACT_FEATURE_FLAG_ALIAS) ? "yes" : "no"); DEBUG ("want avatar token: %s", (want_features & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) ? "yes" : "no"); DEBUG ("want presence: %s", (want_features & CONTACT_FEATURE_FLAG_PRESENCE) ? "yes" : "no"); DEBUG ("want location: %s", (want_features & CONTACT_FEATURE_FLAG_LOCATION) ? "yes" : "no"); DEBUG ("want caps: %s", (want_features & CONTACT_FEATURE_FLAG_CAPABILITIES) ? "yes" : "no"); DEBUG ("want avatar data: %s", (want_features & CONTACT_FEATURE_FLAG_AVATAR_DATA) ? "yes" : "no"); DEBUG ("want contact info: %s", (want_features & CONTACT_FEATURE_FLAG_CONTACT_INFO) ? "yes" : "no"); DEBUG ("want client types: %s", (want_features & CONTACT_FEATURE_FLAG_CLIENT_TYPES) ? "yes" : "no"); DEBUG ("want states: %s", (want_features & CONTACT_FEATURE_FLAG_STATES) ? "yes" : "no"); DEBUG ("want contact groups: %s", (want_features & CONTACT_FEATURE_FLAG_CONTACT_GROUPS) ? "yes" : "no"); DEBUG ("want contact blocking: %s", (want_features & CONTACT_FEATURE_FLAG_CONTACT_BLOCKING) ? "yes" : "no"); c->refcount = 1; c->connection = g_object_ref (connection); c->contacts = g_ptr_array_sized_new (n_contacts); c->handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_contacts); c->invalid = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_contacts); c->wanted = want_features; c->signature = signature; c->user_data = user_data; c->destroy = destroy; c->weak_object = weak_object; if (c->weak_object != NULL) g_object_weak_ref (c->weak_object, contacts_context_weak_notify, c); g_queue_init (&c->todo); return c; } static void contacts_context_unref (gpointer p) { ContactsContext *c = p; if ((--c->refcount) > 0) return; DEBUG ("last-unref (%p)", c); g_assert (c->connection != NULL); tp_clear_object (&c->connection); g_queue_clear (&c->todo); g_assert (c->contacts != NULL); g_ptr_array_foreach (c->contacts, (GFunc) g_object_unref, NULL); g_ptr_array_unref (c->contacts); c->contacts = NULL; g_assert (c->handles != NULL); g_array_unref (c->handles); c->handles = NULL; g_assert (c->invalid != NULL); g_array_unref (c->invalid); c->invalid = NULL; if (c->request_ids != NULL) g_strfreev ((gchar **) g_ptr_array_free (c->request_ids, FALSE)); c->request_ids = NULL; tp_clear_pointer (&c->request_errors, g_hash_table_unref); if (c->destroy != NULL) c->destroy (c->user_data); c->destroy = NULL; c->user_data = NULL; if (c->weak_object != NULL) g_object_weak_unref (c->weak_object, contacts_context_weak_notify, c); c->weak_object = NULL; g_slice_free (ContactsContext, c); } static void contacts_context_fail (ContactsContext *c, const GError *error) { guint i; switch (c->signature) { case CB_BY_HANDLE: g_array_append_vals (c->invalid, c->handles->data, c->handles->len); c->callback.by_handle (c->connection, 0, NULL, c->invalid->len, (const TpHandle *) c->invalid->data, error, c->user_data, c->weak_object); return; case CB_BY_ID: /* -1 because NULL terminator is explicit */ for (i = 0; i < c->request_ids->len - 1; i++) { const gchar *id = g_ptr_array_index (c->request_ids, i); if (!g_hash_table_lookup (c->request_errors, id)) { g_hash_table_insert (c->request_errors, g_strdup (id), g_error_copy (error)); } } c->callback.by_id (c->connection, 0, NULL, NULL, c->request_errors, error, c->user_data, c->weak_object); return; case CB_UPGRADE: c->callback.upgrade (c->connection, c->contacts->len, (TpContact * const *) c->contacts->pdata, error, c->user_data, c->weak_object); return; default: g_assert_not_reached (); } } /** * TpConnectionContactsByHandleCb: * @connection: The connection * @n_contacts: The number of TpContact objects successfully created * (one per valid handle), or 0 on unrecoverable errors * @contacts: (array length=n_contacts): An array of @n_contacts TpContact * objects (this callback is not given a reference to any of these objects, * and must call g_object_ref() on any that it will keep), or %NULL on * unrecoverable errors * @n_failed: The number of invalid handles that were passed to * tp_connection_get_contacts_by_handle() (or on unrecoverable errors, * the total number of handles that were given) * @failed: (array length=n_failed): An array of @n_failed handles that were * passed to tp_connection_get_contacts_by_handle() but turned out to be * invalid (or on unrecoverable errors, all the handles that were given) * @error: %NULL on success, or an unrecoverable error that caused everything * to fail * @user_data: the @user_data that was passed to * tp_connection_get_contacts_by_handle() * @weak_object: the @weak_object that was passed to * tp_connection_get_contacts_by_handle() * * Signature of a callback used to receive the result of * tp_connection_get_contacts_by_handle(). * * If an unrecoverable error occurs (for instance, if @connection * becomes disconnected) the whole operation fails, and no contacts or * invalid handles are returned. * * If some or even all of the @handles passed to * tp_connection_get_contacts_by_handle() were not valid, this is not * considered to be a failure. @error will be %NULL in this situation, * @contacts will contain contact objects for those handles that were * valid (possibly none of them), and @invalid will contain the handles * that were not valid. * * Since: 0.7.18 */ /** * TpConnectionContactsByIdCb: * @connection: The connection * @n_contacts: The number of TpContact objects successfully created * (one per valid ID), or 0 on unrecoverable errors * @contacts: (array length=n_contacts): An array of @n_contacts TpContact * objects (this callback is * not given a reference to any of these objects, and must call * g_object_ref() on any that it will keep), or %NULL on unrecoverable errors * @requested_ids: (array length=n_contacts): An array of @n_contacts valid IDs * (JIDs, SIP URIs etc.) * that were passed to tp_connection_get_contacts_by_id(), in an order * corresponding to @contacts, or %NULL on unrecoverable errors * @failed_id_errors: (element-type utf8 GLib.Error): A hash table in which * the keys are IDs and the values are errors (#GError) * @error: %NULL on success, or an unrecoverable error that caused everything * to fail * @user_data: the @user_data that was passed to * tp_connection_get_contacts_by_id() * @weak_object: the @weak_object that was passed to * tp_connection_get_contacts_by_id() * * Signature of a callback used to receive the result of * tp_connection_get_contacts_by_id(). * * @requested_ids contains the IDs that were converted to handles successfully. * The normalized form of requested_ids[i] is * tp_contact_get_identifier (contacts[i]). * * If some or even all of the @ids passed to * tp_connection_get_contacts_by_id() were not valid, this is not * considered to be a fatal error. @error will be %NULL in this situation, * @contacts will contain contact objects for those IDs that were * valid (it may be empty), and @failed_id_errors will map the IDs * that were not valid to a corresponding #GError (if the connection manager * complies with the Telepathy spec, it will have domain %TP_ERROR and code * %TP_ERROR_INVALID_HANDLE). * * If an unrecoverable error occurs (for instance, if @connection * becomes disconnected) the whole operation fails, and no contacts * or requested IDs are returned. @failed_id_errors will contain all the IDs * that were requested, mapped to a corresponding #GError (either one * indicating that the ID was invalid, if that was determined before the * fatal error occurred, or a copy of @error). * * Since: 0.7.18 */ /** * TpConnectionUpgradeContactsCb: * @connection: The connection * @n_contacts: The number of TpContact objects for which an upgrade was * requested * @contacts: (array length=n_contacts): An array of @n_contacts TpContact * objects (this callback is * not given an extra reference to any of these objects, and must call * g_object_ref() on any that it will keep) * @error: An unrecoverable error, or %NULL if the connection remains valid * @user_data: the @user_data that was passed to * tp_connection_upgrade_contacts() * @weak_object: the @weak_object that was passed to * tp_connection_upgrade_contacts() * * Signature of a callback used to receive the result of * tp_connection_upgrade_contacts(). * * If an unrecoverable error occurs (for instance, if @connection becomes * disconnected) it is indicated by @error, but the contacts in @contacts * are still provided. * * Since: 0.7.18 */ static void contacts_context_continue (ContactsContext *c) { if (c->no_purpose_in_life) { DEBUG ("%p: no purpose in life", c); return; } if (g_queue_is_empty (&c->todo)) { /* do some final sanity checking then hand over the contacts to the * library user */ guint i; DEBUG ("%p: nothing more to do", c); g_assert (c->contacts != NULL); g_assert (c->invalid != NULL); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = TP_CONTACT (g_ptr_array_index (c->contacts, i)); g_assert (contact->priv->identifier != NULL); g_assert (contact->priv->handle != 0); } switch (c->signature) { case CB_BY_HANDLE: c->callback.by_handle (c->connection, c->contacts->len, (TpContact * const *) c->contacts->pdata, c->invalid->len, (const TpHandle *) c->invalid->data, NULL, c->user_data, c->weak_object); break; case CB_BY_ID: c->callback.by_id (c->connection, c->contacts->len, (TpContact * const *) c->contacts->pdata, (const gchar * const *) c->request_ids->pdata, c->request_errors, NULL, c->user_data, c->weak_object); break; case CB_UPGRADE: c->callback.upgrade (c->connection, c->contacts->len, (TpContact * const *) c->contacts->pdata, NULL, c->user_data, c->weak_object); break; default: g_assert_not_reached (); } } else { /* bah! */ ContactsProc next = g_queue_pop_head (&c->todo); if (G_UNLIKELY (tp_proxy_get_invalidated (c->connection) != NULL)) { DEBUG ("%p: failing due to connection having been invalidated: %s", c, tp_proxy_get_invalidated (c->connection)->message); contacts_context_fail (c, tp_proxy_get_invalidated (c->connection)); } else { DEBUG ("%p: on to the next thing", c); next (c); } } } static gboolean contacts_context_idle_continue (gpointer data) { contacts_context_continue (data); return FALSE; } static void contacts_held_one (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; g_assert (handle_type == TP_HANDLE_TYPE_CONTACT); g_assert (c->next_index < c->handles->len); if (error == NULL) { /* I have a handle of my very own. Just what I always wanted! */ TpContact *contact; g_assert (n_handles == 1); g_assert (handles[0] != 0); g_debug ("%u vs %u", g_array_index (c->handles, TpHandle, c->next_index), handles[0]); g_assert (g_array_index (c->handles, TpHandle, c->next_index) == handles[0]); contact = tp_contact_ensure (connection, handles[0]); g_ptr_array_add (c->contacts, contact); c->next_index++; } else if (error->domain == TP_ERROR && error->code == TP_ERROR_INVALID_HANDLE) { g_array_append_val (c->invalid, g_array_index (c->handles, TpHandle, c->next_index)); /* ignore the bad handle - we just won't return a TpContact for it */ g_array_remove_index_fast (c->handles, c->next_index); /* do not increment next_index - another handle has been moved into that * position */ } else { /* the connection fell down a well or something */ contacts_context_fail (c, error); return; } /* Either continue to hold handles, or proceed along the slow path. */ contacts_context_continue (c); } static void contacts_hold_one (ContactsContext *c) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS c->refcount++; tp_connection_hold_handles (c->connection, -1, TP_HANDLE_TYPE_CONTACT, 1, &g_array_index (c->handles, TpHandle, c->next_index), contacts_held_one, c, contacts_context_unref, c->weak_object); G_GNUC_END_IGNORE_DEPRECATIONS } static void contacts_held_handles (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; g_assert (handle_type == TP_HANDLE_TYPE_CONTACT); g_assert (weak_object == c->weak_object); if (error == NULL) { /* I now own all n handles. It's like Christmas morning! */ guint i; g_assert (n_handles == c->handles->len); g_assert (c->contacts->len == 0); for (i = 0; i < c->handles->len; i++) { g_ptr_array_add (c->contacts, tp_contact_ensure (connection, g_array_index (c->handles, TpHandle, i))); } } else if (error->domain == TP_ERROR && error->code == TP_ERROR_INVALID_HANDLE) { /* One of the handles is bad. We don't know which one :-( so split * the batch into a chain of calls. */ guint i; for (i = 0; i < c->handles->len; i++) { g_queue_push_head (&c->todo, contacts_hold_one); } g_assert (c->next_index == 0); } else { /* the connection fell down a well or something */ contacts_context_fail (c, error); return; } /* Either hold the handles individually, or proceed along the slow path. */ contacts_context_continue (c); } static void contacts_inspected (TpConnection *connection, const gchar **ids, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; g_assert (weak_object == c->weak_object); g_assert (c->handles->len == c->contacts->len); if (error != NULL) { /* the connection fell down a well or something */ contacts_context_fail (c, error); return; } else if (G_UNLIKELY (g_strv_length ((GStrv) ids) != c->handles->len)) { GError *e = g_error_new (TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Connection manager %s is broken: we inspected %u " "handles but InspectHandles returned %u strings", tp_proxy_get_bus_name (connection), c->handles->len, g_strv_length ((GStrv) ids)); WARNING ("%s", e->message); contacts_context_fail (c, e); g_error_free (e); return; } else { guint i; DEBUG ("%p: inspected %u handles", c, c->contacts->len); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); g_assert (ids[i] != NULL); DEBUG ("- #%u: \"%s\"", contact->priv->handle, ids[i]); if (contact->priv->identifier == NULL) { contact->priv->identifier = g_strdup (ids[i]); } else if (tp_strdiff (contact->priv->identifier, ids[i])) { GError *e = g_error_new (TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Connection manager %s is broken: contact handle %u " "identifier changed from %s to %s", tp_proxy_get_bus_name (connection), contact->priv->handle, contact->priv->identifier, ids[i]); WARNING ("%s", e->message); contacts_context_fail (c, e); g_error_free (e); return; } } } contacts_context_continue (c); } static void contacts_inspect (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); if (contact->priv->identifier == NULL) { c->refcount++; tp_cli_connection_call_inspect_handles (c->connection, -1, TP_HANDLE_TYPE_CONTACT, c->handles, contacts_inspected, c, contacts_context_unref, c->weak_object); return; } } /* else there's no need to inspect the contacts' handles, because we already * know all their identifiers */ contacts_context_continue (c); } static void contacts_requested_aliases (TpConnection *connection, const gchar **aliases, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; g_assert (c->handles->len == c->contacts->len); if (error == NULL) { guint i; if (G_UNLIKELY (g_strv_length ((GStrv) aliases) != c->contacts->len)) { WARNING ("Connection manager %s is broken: we requested %u " "handles' aliases but got %u strings back", tp_proxy_get_bus_name (connection), c->contacts->len, g_strv_length ((GStrv) aliases)); /* give up on the possibility of getting aliases, and just * move on */ contacts_context_continue (c); return; } for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); const gchar *alias = aliases[i]; contact->priv->has_features |= CONTACT_FEATURE_FLAG_ALIAS; g_free (contact->priv->alias); contact->priv->alias = g_strdup (alias); g_object_notify ((GObject *) contact, "alias"); } } else { /* never mind, we can live without aliases */ DEBUG ("GetAliases failed with %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); } contacts_context_continue (c); } static void contacts_got_aliases (TpConnection *connection, GHashTable *handle_to_alias, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; if (error == NULL) { guint i; for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); const gchar *alias = g_hash_table_lookup (handle_to_alias, GUINT_TO_POINTER (contact->priv->handle)); contact->priv->has_features |= CONTACT_FEATURE_FLAG_ALIAS; g_free (contact->priv->alias); contact->priv->alias = NULL; if (alias != NULL) { contact->priv->alias = g_strdup (alias); } else { WARNING ("No alias returned for %u, will use ID instead", contact->priv->handle); } g_object_notify ((GObject *) contact, "alias"); } } else if ((error->domain == TP_ERROR && error->code == TP_ERROR_NOT_IMPLEMENTED) || (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_UNKNOWN_METHOD)) { /* GetAliases not implemented, fall back to (slow?) RequestAliases */ c->refcount++; tp_cli_connection_interface_aliasing_call_request_aliases (connection, -1, c->handles, contacts_requested_aliases, c, contacts_context_unref, weak_object); return; } else { /* never mind, we can live without aliases */ DEBUG ("GetAliases failed with %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); } contacts_context_continue (c); } static void contacts_aliases_changed (TpConnection *connection, const GPtrArray *alias_structs, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { guint i; for (i = 0; i < alias_structs->len; i++) { GValueArray *pair = g_ptr_array_index (alias_structs, i); TpHandle handle = g_value_get_uint (pair->values + 0); const gchar *alias = g_value_get_string (pair->values + 1); TpContact *contact = _tp_connection_lookup_contact (connection, handle); if (contact != NULL) { contact->priv->has_features |= CONTACT_FEATURE_FLAG_ALIAS; DEBUG ("Contact \"%s\" alias changed from \"%s\" to \"%s\"", contact->priv->identifier, contact->priv->alias, alias); g_free (contact->priv->alias); contact->priv->alias = g_strdup (alias); g_object_notify ((GObject *) contact, "alias"); } } } static void contacts_bind_to_aliases_changed (TpConnection *connection) { if (!connection->priv->tracking_aliases_changed) { connection->priv->tracking_aliases_changed = TRUE; tp_cli_connection_interface_aliasing_connect_to_aliases_changed ( connection, contacts_aliases_changed, NULL, NULL, NULL, NULL); } } static void contacts_get_aliases (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); contacts_bind_to_aliases_changed (c->connection); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); if ((contact->priv->has_features & CONTACT_FEATURE_FLAG_ALIAS) == 0) { c->refcount++; tp_cli_connection_interface_aliasing_call_get_aliases (c->connection, -1, c->handles, contacts_got_aliases, c, contacts_context_unref, c->weak_object); return; } } /* else there's no need to get the contacts' aliases, because we already * know them all */ contacts_context_continue (c); } static void contact_maybe_set_simple_presence (TpContact *contact, GValueArray *presence) { guint type; const gchar *status; const gchar *message; if (contact == NULL) return; g_return_if_fail (presence != NULL); contact->priv->has_features |= CONTACT_FEATURE_FLAG_PRESENCE; tp_value_array_unpack (presence, 3, &type, &status, &message); contact->priv->presence_type = type; g_free (contact->priv->presence_status); contact->priv->presence_status = g_strdup (status); g_free (contact->priv->presence_message); contact->priv->presence_message = g_strdup (message); g_object_notify ((GObject *) contact, "presence-type"); g_object_notify ((GObject *) contact, "presence-status"); g_object_notify ((GObject *) contact, "presence-message"); g_signal_emit (contact, signals[SIGNAL_PRESENCE_CHANGED], 0, contact->priv->presence_type, contact->priv->presence_status, contact->priv->presence_message); } static void contact_maybe_set_location (TpContact *self, GHashTable *location) { if (self == NULL) return; if (self->priv->location != NULL) g_hash_table_unref (self->priv->location); /* We guarantee that, if we've fetched a location for a contact, the * :location property is non-NULL. This is mainly because Empathy assumed * this and would crash if not. */ if (location == NULL) location = tp_asv_new (NULL, NULL); else g_hash_table_ref (location); self->priv->has_features |= CONTACT_FEATURE_FLAG_LOCATION; self->priv->location = location; g_object_notify ((GObject *) self, "location"); g_object_notify ((GObject *) self, "location-vardict"); } static void contact_set_capabilities (TpContact *self, TpCapabilities *capabilities) { tp_clear_object (&self->priv->capabilities); self->priv->has_features |= CONTACT_FEATURE_FLAG_CAPABILITIES; self->priv->capabilities = g_object_ref (capabilities); g_object_notify ((GObject *) self, "capabilities"); } static void contact_maybe_set_capabilities (TpContact *self, GPtrArray *arr) { TpCapabilities *capabilities; if (self == NULL || arr == NULL) return; capabilities = _tp_capabilities_new (arr, TRUE); contact_set_capabilities (self, capabilities); g_object_unref (capabilities); } static void contacts_presences_changed (TpConnection *connection, GHashTable *presences, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, presences); while (g_hash_table_iter_next (&iter, &key, &value)) { TpContact *contact = _tp_connection_lookup_contact (connection, GPOINTER_TO_UINT (key)); contact_maybe_set_simple_presence (contact, value); } } static void contacts_got_simple_presence (TpConnection *connection, GHashTable *presences, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; if (error == NULL) { contacts_presences_changed (connection, presences, NULL, NULL); } else { /* never mind, we can live without presences */ DEBUG ("GetPresences failed with %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); } contacts_context_continue (c); } static void contacts_bind_to_presences_changed (TpConnection *connection) { if (!connection->priv->tracking_presences_changed) { connection->priv->tracking_presences_changed = TRUE; tp_cli_connection_interface_simple_presence_connect_to_presences_changed (connection, contacts_presences_changed, NULL, NULL, NULL, NULL); } } static void contacts_get_simple_presence (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); contacts_bind_to_presences_changed (c->connection); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); if ((contact->priv->has_features & CONTACT_FEATURE_FLAG_PRESENCE) == 0) { c->refcount++; tp_cli_connection_interface_simple_presence_call_get_presences ( c->connection, -1, c->handles, contacts_got_simple_presence, c, contacts_context_unref, c->weak_object); return; } } contacts_context_continue (c); } static void contacts_location_updated (TpConnection *connection, guint handle, GHashTable *location, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpContact *contact = _tp_connection_lookup_contact (connection, GPOINTER_TO_UINT (handle)); contact_maybe_set_location (contact, location); } static void contacts_bind_to_location_updated (TpConnection *connection) { if (!connection->priv->tracking_location_changed) { connection->priv->tracking_location_changed = TRUE; tp_cli_connection_interface_location_connect_to_location_updated (connection, contacts_location_updated, NULL, NULL, NULL, NULL); tp_connection_add_client_interest (connection, TP_IFACE_CONNECTION_INTERFACE_LOCATION); } } static void contact_maybe_set_client_types (TpContact *self, const gchar * const *types) { if (self == NULL) return; if (self->priv->client_types != NULL) g_strfreev (self->priv->client_types); self->priv->has_features |= CONTACT_FEATURE_FLAG_CLIENT_TYPES; self->priv->client_types = g_strdupv ((gchar **) types); g_object_notify ((GObject *) self, "client-types"); } static void contacts_client_types_updated (TpConnection *connection, guint handle, const gchar **types, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpContact *contact = _tp_connection_lookup_contact (connection, GPOINTER_TO_UINT (handle)); contact_maybe_set_client_types (contact, types); } static void contacts_bind_to_client_types_updated (TpConnection *connection) { if (!connection->priv->tracking_client_types_updated) { connection->priv->tracking_client_types_updated = TRUE; tp_cli_connection_interface_client_types_connect_to_client_types_updated (connection, contacts_client_types_updated, NULL, NULL, NULL, NULL); } } static void set_conn_capabilities_on_contacts (GPtrArray *contacts, TpConnection *connection) { guint i; TpCapabilities *conn_caps = tp_connection_get_capabilities (connection); GPtrArray *rcc; /* If the connection has no capabilities then don't bother setting them on * the contact and pretend we just don't know.. In practise this will only * happen if there was an error in getting the connections capabilities so * claiming ignorance seems the most sensible thing to do */ if (conn_caps == NULL) return; rcc = tp_capabilities_get_channel_classes (conn_caps); if (rcc == NULL || rcc->len == 0) return; for (i = 0; i < contacts->len; i++) { TpContact *contact = g_ptr_array_index (contacts, i); contact_set_capabilities (contact, conn_caps); } } static void connection_capabilities_fetched_cb (GObject *object, GAsyncResult *res, gpointer user_data) { ContactsContext *c = user_data; DEBUG ("Connection capabilities prepared"); set_conn_capabilities_on_contacts (c->contacts, c->connection); contacts_context_continue (c); contacts_context_unref (c); } static void contacts_get_conn_capabilities (ContactsContext *c) { g_assert (c->handles->len == c->contacts->len); DEBUG ("Getting connection capabilities"); c->refcount++; _tp_connection_get_capabilities_async (c->connection, connection_capabilities_fetched_cb, c); } static void contacts_capabilities_updated (TpConnection *connection, GHashTable *capabilities, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { GHashTableIter iter; gpointer handle, value; g_hash_table_iter_init (&iter, capabilities); while (g_hash_table_iter_next (&iter, &handle, &value)) { TpContact *contact = _tp_connection_lookup_contact (connection, GPOINTER_TO_UINT (handle)); contact_maybe_set_capabilities (contact, value); } } static void contacts_bind_to_capabilities_updated (TpConnection *connection) { if (!connection->priv->tracking_contact_caps_changed) { connection->priv->tracking_contact_caps_changed = TRUE; tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed (connection, contacts_capabilities_updated, NULL, NULL, NULL, NULL); } } static gboolean build_avatar_filename (TpConnection *connection, const gchar *avatar_token, gboolean create_dir, gchar **ret_filename, gchar **ret_mime_filename) { gchar *dir; gchar *token_escaped; gboolean success = TRUE; token_escaped = tp_escape_as_identifier (avatar_token); dir = g_build_filename (g_get_user_cache_dir (), "telepathy", "avatars", tp_connection_get_cm_name (connection), tp_connection_get_protocol_name (connection), NULL); if (create_dir) { if (g_mkdir_with_parents (dir, 0700) == -1) { DEBUG ("Error creating avatar cache dir: %s", g_strerror (errno)); success = FALSE; goto out; } } if (ret_filename != NULL) *ret_filename = g_strconcat (dir, G_DIR_SEPARATOR_S, token_escaped, NULL); if (ret_mime_filename != NULL) *ret_mime_filename = g_strconcat (dir, G_DIR_SEPARATOR_S, token_escaped, ".mime", NULL); out: g_free (dir); g_free (token_escaped); return success; } static void contact_set_avatar_token (TpContact *self, const gchar *new_token, gboolean request); typedef struct { GWeakRef contact; TpConnection *connection; gchar *token; GFile *file; GBytes *data; GFile *mime_file; gchar *mime_type; } WriteAvatarData; static void write_avatar_data_free (WriteAvatarData *avatar_data) { g_weak_ref_clear (&avatar_data->contact); g_clear_object (&avatar_data->connection); tp_clear_pointer (&avatar_data->token, g_free); g_clear_object (&avatar_data->file); tp_clear_pointer (&avatar_data->data, g_bytes_unref); g_clear_object (&avatar_data->mime_file); tp_clear_pointer (&avatar_data->mime_type, g_free); g_slice_free (WriteAvatarData, avatar_data); } static void mime_file_written (GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = NULL; WriteAvatarData *avatar_data = user_data; GFile *file = G_FILE (source_object); TpContact *self; gchar *path = g_file_get_path (file); g_assert (file == avatar_data->mime_file); if (!g_file_replace_contents_finish (file, res, NULL, &error)) { DEBUG ("Failed to store MIME type in cache (%s): %s", path, error->message); g_clear_error (&error); } else { DEBUG ("Contact avatar MIME type stored in cache: %s", path); } g_free (path); self = g_weak_ref_get (&avatar_data->contact); if (self == NULL) { DEBUG ("No relevant TpContact"); } else if (tp_strdiff (avatar_data->token, self->priv->avatar_token)) { DEBUG ("Contact's avatar token has changed from %s to %s, " "this avatar is no longer relevant", avatar_data->token, nonnull (self->priv->avatar_token)); } else { gchar *data_path = g_file_get_path (avatar_data->file); DEBUG ("Saved avatar '%s' of MIME type '%s' still used by '%s' to '%s'", avatar_data->token, avatar_data->mime_type, self->priv->identifier, data_path); g_clear_object (&self->priv->avatar_file); self->priv->avatar_file = g_object_ref (avatar_data->file); g_free (self->priv->avatar_mime_type); self->priv->avatar_mime_type = g_strdup (avatar_data->mime_type); /* Notify both property changes together once both files have been * written */ g_object_notify ((GObject *) self, "avatar-mime-type"); g_object_notify ((GObject *) self, "avatar-file"); g_object_unref (self); g_free (data_path); } write_avatar_data_free (avatar_data); } static void avatar_file_written (GObject *source_object, GAsyncResult *res, gpointer user_data) { GError *error = NULL; WriteAvatarData *avatar_data = user_data; GFile *file = G_FILE (source_object); gchar *path = g_file_get_path (file); g_assert (file == avatar_data->file); if (!g_file_replace_contents_finish (file, res, NULL, &error)) { DEBUG ("Failed to store avatar in cache (%s): %s", path, error->message); DEBUG ("Storing the MIME type anyway"); g_clear_error (&error); } else { DEBUG ("Contact avatar stored in cache: %s", path); } g_file_replace_contents_async (avatar_data->mime_file, avatar_data->mime_type, strlen (avatar_data->mime_type), NULL, FALSE, G_FILE_CREATE_PRIVATE|G_FILE_CREATE_REPLACE_DESTINATION, NULL, mime_file_written, avatar_data); g_free (path); } static void contact_avatar_retrieved (TpConnection *connection, guint handle, const gchar *token, const GArray *avatar, const gchar *mime_type, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpContact *self = _tp_connection_lookup_contact (connection, handle); gchar *filename; gchar *mime_filename; WriteAvatarData *avatar_data; DEBUG ("token '%s', %u bytes, MIME type '%s'", token, avatar->len, mime_type); if (self == NULL) DEBUG ("handle #%u is not associated with any TpContact", handle); else DEBUG ("used by contact #%u '%s'", handle, tp_contact_get_identifier (self)); if (self != NULL) { /* Update the avatar token if a newer one is given * (this emits notify::avatar-token if needed) */ contact_set_avatar_token (self, token, FALSE); } if (!build_avatar_filename (connection, token, TRUE, &filename, &mime_filename)) { DEBUG ("failed to set up cache"); return; } /* Save avatar in cache, even if the contact is unknown, to avoid as much as * possible future avatar requests */ avatar_data = g_slice_new0 (WriteAvatarData); avatar_data->connection = g_object_ref (connection); g_weak_ref_set (&avatar_data->contact, self); avatar_data->token = g_strdup (token); avatar_data->file = g_file_new_for_path (filename); /* g_file_replace_contents_async() doesn't copy its argument, see * , so we have * to keep a copy around */ avatar_data->data = g_bytes_new (avatar->data, avatar->len); avatar_data->mime_file = g_file_new_for_path (mime_filename); avatar_data->mime_type = g_strdup (mime_type); g_file_replace_contents_async (avatar_data->file, g_bytes_get_data (avatar_data->data, NULL), avatar->len, NULL, FALSE, G_FILE_CREATE_PRIVATE|G_FILE_CREATE_REPLACE_DESTINATION, NULL, avatar_file_written, avatar_data); g_free (filename); g_free (mime_filename); } static gboolean connection_avatar_request_idle_cb (gpointer user_data) { TpConnection *connection = user_data; DEBUG ("Request %d avatars", connection->priv->avatar_request_queue->len); tp_cli_connection_interface_avatars_call_request_avatars (connection, -1, connection->priv->avatar_request_queue, NULL, NULL, NULL, NULL); g_array_unref (connection->priv->avatar_request_queue); connection->priv->avatar_request_queue = NULL; connection->priv->avatar_request_idle_id = 0; return FALSE; } static void contact_update_avatar_data (TpContact *self) { TpConnection *connection; gchar *filename = NULL; gchar *mime_filename = NULL; /* If token is NULL, it means that CM doesn't know the token. In that case we * have to request the avatar data to get the token. This happens with XMPP * for offline contacts. We don't want to bypass the avatar cache, so we won't * update avatar. */ if (self->priv->avatar_token == NULL) return; /* If token is empty (""), it means the contact has no avatar. */ if (tp_str_empty (self->priv->avatar_token)) { tp_clear_object (&self->priv->avatar_file); g_free (self->priv->avatar_mime_type); self->priv->avatar_mime_type = NULL; DEBUG ("contact#%u has no avatar", self->priv->handle); g_object_notify ((GObject *) self, "avatar-file"); g_object_notify ((GObject *) self, "avatar-mime-type"); return; } /* We have a token, search in cache... */ if (build_avatar_filename (self->priv->connection, self->priv->avatar_token, FALSE, &filename, &mime_filename)) { if (g_file_test (filename, G_FILE_TEST_EXISTS)) { GError *error = NULL; tp_clear_object (&self->priv->avatar_file); self->priv->avatar_file = g_file_new_for_path (filename); g_free (self->priv->avatar_mime_type); if (!g_file_get_contents (mime_filename, &self->priv->avatar_mime_type, NULL, &error)) { DEBUG ("Error reading avatar MIME type (%s): %s", mime_filename, error ? error->message : "No error message"); self->priv->avatar_mime_type = NULL; g_clear_error (&error); } DEBUG ("contact#%u avatar found in cache: %s, %s", self->priv->handle, filename, self->priv->avatar_mime_type); g_object_notify ((GObject *) self, "avatar-file"); g_object_notify ((GObject *) self, "avatar-mime_type"); goto out; } } /* Not found in cache, queue this contact. We do this to group contacts * for the AvatarRequest call */ connection = self->priv->connection; if (connection->priv->avatar_request_queue == NULL) connection->priv->avatar_request_queue = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (connection->priv->avatar_request_queue, self->priv->handle); if (connection->priv->avatar_request_idle_id == 0) connection->priv->avatar_request_idle_id = g_idle_add ( connection_avatar_request_idle_cb, connection); out: g_free (filename); g_free (mime_filename); } static void contact_maybe_update_avatar_data (TpContact *self) { if ((self->priv->has_features & CONTACT_FEATURE_FLAG_AVATAR_DATA) == 0 && (self->priv->has_features & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) != 0) { self->priv->has_features |= CONTACT_FEATURE_FLAG_AVATAR_DATA; contact_update_avatar_data (self); } } static void contacts_bind_to_avatar_retrieved (TpConnection *connection) { if (!connection->priv->tracking_avatar_retrieved) { connection->priv->tracking_avatar_retrieved = TRUE; tp_cli_connection_interface_avatars_connect_to_avatar_retrieved (connection, contact_avatar_retrieved, NULL, NULL, NULL, NULL); } } static void contacts_get_avatar_data (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); contacts_bind_to_avatar_retrieved (c->connection); for (i = 0; i < c->contacts->len; i++) contact_maybe_update_avatar_data (g_ptr_array_index (c->contacts, i)); contacts_context_continue (c); } static void contact_set_avatar_token (TpContact *self, const gchar *new_token, gboolean request) { /* A no-op change (specifically from NULL to NULL) is still interesting if we * don't have the AVATAR_TOKEN feature yet: it indicates that we've * discovered it. */ if ((self->priv->has_features & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) && !tp_strdiff (self->priv->avatar_token, new_token)) return; DEBUG ("contact#%u token is %s", self->priv->handle, new_token); self->priv->has_features |= CONTACT_FEATURE_FLAG_AVATAR_TOKEN; g_free (self->priv->avatar_token); self->priv->avatar_token = g_strdup (new_token); g_object_notify ((GObject *) self, "avatar-token"); if (request && tp_contact_has_feature (self, TP_CONTACT_FEATURE_AVATAR_DATA)) contact_update_avatar_data (self); } static void contacts_avatar_updated (TpConnection *connection, TpHandle handle, const gchar *new_token, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpContact *contact = _tp_connection_lookup_contact (connection, handle); if (contact != NULL) contact_set_avatar_token (contact, new_token, TRUE); } static void contacts_got_known_avatar_tokens (TpConnection *connection, GHashTable *handle_to_token, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; GHashTableIter iter; gpointer key, value; if (error == NULL) { g_hash_table_iter_init (&iter, handle_to_token); while (g_hash_table_iter_next (&iter, &key, &value)) { contacts_avatar_updated (connection, GPOINTER_TO_UINT (key), value, NULL, NULL); } } /* FIXME: perhaps we could fall back to GetAvatarTokens (which should have * been called RequestAvatarTokens, because it blocks on network traffic) * if GetKnownAvatarTokens doesn't work? */ else { /* never mind, we can live without avatar tokens */ DEBUG ("GetKnownAvatarTokens failed with %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); } contacts_context_continue (c); } static void contacts_bind_to_avatar_updated (TpConnection *connection) { if (!connection->priv->tracking_avatar_updated) { connection->priv->tracking_avatar_updated = TRUE; tp_cli_connection_interface_avatars_connect_to_avatar_updated (connection, contacts_avatar_updated, NULL, NULL, NULL, NULL); } } static void contacts_get_avatar_tokens (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); contacts_bind_to_avatar_updated (c->connection); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); if ((contact->priv->has_features & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) == 0) { c->refcount++; tp_cli_connection_interface_avatars_call_get_known_avatar_tokens ( c->connection, -1, c->handles, contacts_got_known_avatar_tokens, c, contacts_context_unref, c->weak_object); return; } } contacts_context_continue (c); } static void contact_maybe_set_info (TpContact *self, const GPtrArray *contact_info) { guint i; if (self == NULL) return; tp_contact_info_list_free (self->priv->contact_info); self->priv->contact_info = NULL; self->priv->has_features |= CONTACT_FEATURE_FLAG_CONTACT_INFO; if (contact_info != NULL) { for (i = contact_info->len; i > 0; i--) { GValueArray *va = g_ptr_array_index (contact_info, i - 1); const gchar *field_name; GStrv parameters; GStrv field_value; tp_value_array_unpack (va, 3, &field_name, ¶meters, &field_value); self->priv->contact_info = g_list_prepend (self->priv->contact_info, tp_contact_info_field_new (field_name, parameters, field_value)); } } /* else we don't know, but an empty list is perfectly valid. */ g_object_notify ((GObject *) self, "contact-info"); } static void contact_info_changed (TpConnection *connection, guint handle, const GPtrArray *contact_info, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpContact *self = _tp_connection_lookup_contact (connection, handle); contact_maybe_set_info (self, contact_info); } static void contacts_got_contact_info (TpConnection *connection, GHashTable *info, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; if (error != NULL) { DEBUG ("GetContactInfo failed with %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); } else { GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, info); while (g_hash_table_iter_next (&iter, &key, &value)) { contact_info_changed (connection, GPOINTER_TO_UINT (key), value, NULL, NULL); } } contacts_context_continue (c); } static void contacts_bind_to_contact_info_changed (TpConnection *connection) { if (!connection->priv->tracking_contact_info_changed) { connection->priv->tracking_contact_info_changed = TRUE; tp_cli_connection_interface_contact_info_connect_to_contact_info_changed ( connection, contact_info_changed, NULL, NULL, NULL, NULL); } } static void contacts_get_contact_info (ContactsContext *c) { guint i; g_assert (c->handles->len == c->contacts->len); contacts_bind_to_contact_info_changed (c->connection); for (i = 0; i < c->contacts->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); if ((contact->priv->has_features & CONTACT_FEATURE_FLAG_CONTACT_INFO) == 0) { c->refcount++; tp_cli_connection_interface_contact_info_call_get_contact_info ( c->connection, -1, c->handles, contacts_got_contact_info, c, contacts_context_unref, c->weak_object); return; } } contacts_context_continue (c); } typedef struct { TpContact *contact; GSimpleAsyncResult *result; TpProxyPendingCall *call; GCancellable *cancellable; gulong cancelled_id; } ContactInfoRequestData; static void contact_info_request_data_free (ContactInfoRequestData *data) { if (data != NULL) { g_object_unref (data->result); if (data->cancellable != NULL) g_object_unref (data->cancellable); g_slice_free (ContactInfoRequestData, data); } } static void contact_info_request_cb (TpConnection *connection, const GPtrArray *contact_info, const GError *error, gpointer user_data, GObject *weak_object) { ContactInfoRequestData *data = user_data; TpContact *self = data->contact; if (data->cancellable != NULL) { /* At this point it's too late to cancel the operation. This will block * until the signal handler has finished if it's already running, so * we're guaranteed to never be in a partially-cancelled state after * this call. */ g_cancellable_disconnect (data->cancellable, data->cancelled_id); /* If this is true, the cancelled callback has already run and completed the * async result, so just bail. */ if (data->cancelled_id == 0) return; data->cancelled_id = 0; } if (error != NULL) { DEBUG ("Failed to request ContactInfo: %s", error->message); g_simple_async_result_set_from_error (data->result, error); } else { contact_maybe_set_info (self, contact_info); } g_simple_async_result_complete_in_idle (data->result); data->call = NULL; } static void contact_info_request_cancelled_cb (GCancellable *cancellable, ContactInfoRequestData *data) { GError *error = NULL; gboolean was_cancelled; /* We disconnect from the signal manually; since we're in the cancelled * callback, we hold the cancellable's lock so calling this instead of * g_cancellable_disconnect() is fine. We do this here so that * g_cancellable_disconnect() isn't called by contact_info_request_data_free() * which is called by tp_proxy_pending_call_cancel(). * cancelled_id might already be 0 if the cancellable was cancelled before * we connected to it. */ if (data->cancelled_id != 0) g_signal_handler_disconnect (data->cancellable, data->cancelled_id); data->cancelled_id = 0; was_cancelled = g_cancellable_set_error_if_cancelled (data->cancellable, &error); g_assert (was_cancelled); DEBUG ("Request ContactInfo cancelled"); g_simple_async_result_set_from_error (data->result, error); g_simple_async_result_complete_in_idle (data->result); g_clear_error (&error); if (data->call != NULL) tp_proxy_pending_call_cancel (data->call); } /** * tp_contact_request_contact_info_async: * @self: a #TpContact * @cancellable: optional #GCancellable object, %NULL to ignore. * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous request of the contact info of @self. When * the operation is finished, @callback will be called. You can then call * tp_contact_request_contact_info_finish() to get the result of the operation. * * If the operation is successful, the #TpContact:contact-info property will be * updated (emitting "notify::contact-info" signal) before @callback is called. * That means you can call tp_contact_get_contact_info() to get the new vCard * inside @callback. * * Note that requesting the vCard from the network can take significant time, so * a bigger timeout is set on the underlying D-Bus call. @cancellable can be * cancelled to free resources used in the D-Bus call if the caller is no longer * interested in the vCard. * * If %TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on @self, it will be * set before its property gets updated and @callback is called. * * Since: 0.11.7 */ void tp_contact_request_contact_info_async (TpContact *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { ContactInfoRequestData *data; g_return_if_fail (TP_IS_CONTACT (self)); contacts_bind_to_contact_info_changed (self->priv->connection); data = g_slice_new0 (ContactInfoRequestData); data->contact = self; data->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_contact_request_contact_info_finish); if (cancellable != NULL) { data->cancellable = g_object_ref (cancellable); data->cancelled_id = g_cancellable_connect (data->cancellable, G_CALLBACK (contact_info_request_cancelled_cb), data, NULL); /* Return early if the cancellable has already been cancelled */ if (data->cancelled_id == 0) return; } data->call = tp_cli_connection_interface_contact_info_call_request_contact_info ( self->priv->connection, 60*60*1000, self->priv->handle, contact_info_request_cb, data, (GDestroyNotify) contact_info_request_data_free, NULL); } /** * tp_contact_request_contact_info_finish: * @self: a #TpContact * @result: a #GAsyncResult * @error: a #GError to be filled * * Finishes an async request of @self info. If the operation was successful, * the contact's vCard can be accessed using tp_contact_get_contact_info(). * * Returns: %TRUE if the request call was successful, otherwise %FALSE * * Since: 0.11.7 */ gboolean tp_contact_request_contact_info_finish (TpContact *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_contact_request_contact_info_finish); } /** * tp_connection_refresh_contact_info: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects * associated with @self * * Requests to refresh the #TpContact:contact-info property on each contact from * @contacts, requesting it from the network if an up-to-date version is not * cached locally. "notify::contact-info" will be emitted when the contact's * information are updated. * * If %TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on a contact, it will be * set before its property gets updated. * * Since: 0.11.7 */ void tp_connection_refresh_contact_info (TpConnection *self, guint n_contacts, TpContact * const *contacts) { GArray *handles; guint i; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (n_contacts >= 1); g_return_if_fail (contacts != NULL); for (i = 0; i < n_contacts; i++) { g_return_if_fail (TP_IS_CONTACT (contacts[i])); g_return_if_fail (contacts[i]->priv->connection == self); } contacts_bind_to_contact_info_changed (self); handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_contacts); for (i = 0; i < n_contacts; i++) g_array_append_val (handles, contacts[i]->priv->handle); tp_cli_connection_interface_contact_info_call_refresh_contact_info (self, -1, handles, NULL, NULL, NULL, NULL); g_array_unref (handles); } static void contact_set_subscription_states (TpContact *self, TpSubscriptionState subscribe, TpSubscriptionState publish, const gchar *publish_request) { if (publish_request == NULL) publish_request = ""; DEBUG ("contact#%u state changed: subscribe=%c publish=%c '%s'", self->priv->handle, _tp_base_contact_list_presence_state_to_letter (subscribe), _tp_base_contact_list_presence_state_to_letter (publish), publish_request); self->priv->has_features |= CONTACT_FEATURE_FLAG_STATES; g_free (self->priv->publish_request); self->priv->subscribe = subscribe; self->priv->publish = publish; self->priv->publish_request = g_strdup (publish_request); g_object_notify ((GObject *) self, "subscribe-state"); g_object_notify ((GObject *) self, "publish-state"); g_object_notify ((GObject *) self, "publish-request"); g_signal_emit (self, signals[SIGNAL_SUBSCRIPTION_STATES_CHANGED], 0, self->priv->subscribe, self->priv->publish, self->priv->publish_request); } void _tp_contact_set_subscription_states (TpContact *self, GValueArray *value_array) { TpSubscriptionState subscribe; TpSubscriptionState publish; const gchar *publish_request; tp_value_array_unpack (value_array, 3, &subscribe, &publish, &publish_request); contact_set_subscription_states (self, subscribe, publish, publish_request); } static void contacts_changed_cb (TpConnection *connection, GHashTable *changes, const GArray *removals, gpointer user_data, GObject *weak_object) { GHashTableIter iter; gpointer key, value; guint i; g_hash_table_iter_init (&iter, changes); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); TpContact *contact = _tp_connection_lookup_contact (connection, handle); if (contact != NULL) _tp_contact_set_subscription_states (contact, value); } for (i = 0; i < removals->len; i++) { TpHandle handle = g_array_index (removals, TpHandle, i); TpContact *contact = _tp_connection_lookup_contact (connection, handle); if (contact == NULL) continue; contact_set_subscription_states (contact, TP_SUBSCRIPTION_STATE_NO, TP_SUBSCRIPTION_STATE_NO, NULL); } } static void contacts_bind_to_contacts_changed (TpConnection *connection) { if (!connection->priv->tracking_contacts_changed) { connection->priv->tracking_contacts_changed = TRUE; tp_cli_connection_interface_contact_list_connect_to_contacts_changed (connection, contacts_changed_cb, NULL, NULL, NULL, NULL); } } static void contact_maybe_set_contact_groups (TpContact *self, GStrv contact_groups) { gchar **iter; if (self == NULL || contact_groups == NULL) return; self->priv->has_features |= CONTACT_FEATURE_FLAG_CONTACT_GROUPS; tp_clear_pointer (&self->priv->contact_groups, g_ptr_array_unref); self->priv->contact_groups = g_ptr_array_new_full ( g_strv_length (contact_groups) + 1, g_free); for (iter = contact_groups; *iter != NULL; iter++) g_ptr_array_add (self->priv->contact_groups, g_strdup (*iter)); g_ptr_array_add (self->priv->contact_groups, NULL); g_object_notify ((GObject *) self, "contact-groups"); } static void contact_groups_changed_cb (TpConnection *connection, const GArray *contacts, const gchar **added, const gchar **removed, gpointer user_data, GObject *weak_object) { guint i; for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, TpHandle, i); TpContact *contact = _tp_connection_lookup_contact (connection, handle); const gchar **iter; guint j; if (contact == NULL || contact->priv->contact_groups == NULL) continue; /* Remove the ending NULL */ g_ptr_array_remove_index_fast (contact->priv->contact_groups, contact->priv->contact_groups->len - 1); /* Remove old groups */ for (iter = removed; *iter != NULL; iter++) { for (j = 0; j < contact->priv->contact_groups->len; j++) { const gchar *str; str = g_ptr_array_index (contact->priv->contact_groups, j); if (!tp_strdiff (str, *iter)) { g_ptr_array_remove_index_fast (contact->priv->contact_groups, j); break; } } } /* Add new groups */ for (iter = added; *iter != NULL; iter++) g_ptr_array_add (contact->priv->contact_groups, g_strdup (*iter)); /* Add back the ending NULL */ g_ptr_array_add (contact->priv->contact_groups, NULL); g_object_notify ((GObject *) contact, "contact-groups"); g_signal_emit (contact, signals[SIGNAL_CONTACT_GROUPS_CHANGED], 0, added, removed); } } static void contacts_bind_to_contact_groups_changed (TpConnection *connection) { if (!connection->priv->tracking_contact_groups_changed) { connection->priv->tracking_contact_groups_changed = TRUE; tp_cli_connection_interface_contact_groups_connect_to_groups_changed (connection, contact_groups_changed_cb, NULL, NULL, NULL, NULL); } } static gboolean contacts_context_supports_iface (ContactsContext *context, GQuark iface) { GArray *contact_attribute_interfaces = context->connection->priv->contact_attribute_interfaces; guint i; if (!tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) return FALSE; if (contact_attribute_interfaces == NULL) return FALSE; for (i = 0; i < contact_attribute_interfaces->len; i++) { GQuark q = g_array_index (contact_attribute_interfaces, GQuark, i); if (q == iface) return TRUE; } return FALSE; } static void contacts_context_queue_features (ContactsContext *context) { ContactFeatureFlags feature_flags = context->wanted; /* Start slow path for requested features that are not in * ContactAttributeInterfaces */ if ((feature_flags & CONTACT_FEATURE_FLAG_ALIAS) != 0 && !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING) && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING)) { g_queue_push_tail (&context->todo, contacts_get_aliases); } if ((feature_flags & CONTACT_FEATURE_FLAG_PRESENCE) != 0 && !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE)) { if (tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE)) { g_queue_push_tail (&context->todo, contacts_get_simple_presence); } #if 0 /* FIXME: Before doing this for the first time, we'd need to download * from the CM the definition of what each status actually *means* */ else if (tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_PRESENCE)) { g_queue_push_tail (&context->todo, contacts_get_complex_presence); } #endif } if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) != 0 && !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS) && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { g_queue_push_tail (&context->todo, contacts_get_avatar_tokens); } /* There is no contact attribute for avatar data, always use slow path */ if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_DATA) != 0 && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS)) { g_queue_push_tail (&context->todo, contacts_get_avatar_data); } if ((feature_flags & CONTACT_FEATURE_FLAG_LOCATION) != 0 && !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION) && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION)) { WARNING ("%s supports Location but not Contacts! Where did you find " "this CM? TP_CONTACT_FEATURE_LOCATION is not gonna work", tp_proxy_get_object_path (context->connection)); } /* Don't implement slow path for ContactCapabilities as Contacts is now * mandatory so any CM supporting ContactCapabilities will implement * Contacts as well. * * But if ContactCapabilities is NOT supported, we fallback to connection * capabilities. * */ if ((feature_flags & CONTACT_FEATURE_FLAG_CAPABILITIES) != 0 && !tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES)) { DEBUG ("Connection doesn't support ContactCapabilities; fallback to " "connection capabilities"); g_queue_push_tail (&context->todo, contacts_get_conn_capabilities); } if ((feature_flags & CONTACT_FEATURE_FLAG_CONTACT_INFO) != 0 && !contacts_context_supports_iface (context, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO) && tp_proxy_has_interface_by_id (context->connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO)) { g_queue_push_tail (&context->todo, contacts_get_contact_info); } } static gboolean tp_contact_set_attributes (TpContact *contact, GHashTable *asv, ContactFeatureFlags wanted, ContactFeatureFlags getting, GError **error) { TpConnection *connection = tp_contact_get_connection (contact); const gchar *s; gpointer boxed; /* Identifier */ s = tp_asv_get_string (asv, TP_TOKEN_CONNECTION_CONTACT_ID); if (s == NULL) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Connection manager %s is broken: contact #%u in the " "GetContactAttributes result has no contact-id", tp_proxy_get_bus_name (connection), contact->priv->handle); return FALSE; } DEBUG ("#%u: \"%s\"", contact->priv->handle, s); { GHashTableIter iter; gpointer k, v; g_hash_table_iter_init (&iter, asv); while (g_hash_table_iter_next (&iter, &k, &v)) { gchar *str = g_strdup_value_contents (v); DEBUG ("- %s => %s", (const gchar *) k, str); g_free (str); } } if (contact->priv->identifier == NULL) { contact->priv->identifier = g_strdup (s); } else if (tp_strdiff (contact->priv->identifier, s)) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Connection manager %s is broken: contact #%u identifier " "changed from %s to %s", tp_proxy_get_bus_name (connection), contact->priv->handle, contact->priv->identifier, s); return FALSE; } /* Alias */ if (wanted & CONTACT_FEATURE_FLAG_ALIAS) { s = tp_asv_get_string (asv, TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS); if (s == NULL) { if (getting & CONTACT_FEATURE_FLAG_ALIAS) { WARNING ("%s supposedly implements Contacts and Aliasing, but " "omitted " TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS, tp_proxy_get_object_path (connection)); } } else { contact->priv->has_features |= CONTACT_FEATURE_FLAG_ALIAS; g_free (contact->priv->alias); contact->priv->alias = g_strdup (s); g_object_notify ((GObject *) contact, "alias"); } } /* Avatar */ if (wanted & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) { s = tp_asv_get_string (asv, TP_TOKEN_CONNECTION_INTERFACE_AVATARS_TOKEN); contact_set_avatar_token (contact, s, TRUE); } if (wanted & CONTACT_FEATURE_FLAG_AVATAR_DATA) { /* There is no attribute for the avatar data, this will set the avatar * from cache or start the avatar request if its missing from cache. */ contact_maybe_update_avatar_data (contact); } /* Presence */ if (wanted & CONTACT_FEATURE_FLAG_PRESENCE) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE, TP_STRUCT_TYPE_SIMPLE_PRESENCE); if (boxed == NULL) { if (getting & CONTACT_FEATURE_FLAG_PRESENCE) { WARNING ("%s supposedly implements Contacts and SimplePresence, " "but omitted the mandatory " TP_TOKEN_CONNECTION_INTERFACE_SIMPLE_PRESENCE_PRESENCE " attribute", tp_proxy_get_object_path (connection)); } } else { contact_maybe_set_simple_presence (contact, boxed); } } /* Location */ if (wanted & CONTACT_FEATURE_FLAG_LOCATION) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_LOCATION_LOCATION, TP_HASH_TYPE_LOCATION); contact_maybe_set_location (contact, boxed); } /* Capabilities */ if (wanted & CONTACT_FEATURE_FLAG_CAPABILITIES) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST); contact_maybe_set_capabilities (contact, boxed); } /* ContactInfo */ if (wanted & CONTACT_FEATURE_FLAG_CONTACT_INFO) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_INFO_INFO, TP_ARRAY_TYPE_CONTACT_INFO_FIELD_LIST); contact_maybe_set_info (contact, boxed); } /* ClientTypes */ if (wanted & CONTACT_FEATURE_FLAG_CLIENT_TYPES) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_CLIENT_TYPES_CLIENT_TYPES, G_TYPE_STRV); contact_maybe_set_client_types (contact, boxed); } /* ContactList subscription states */ if (wanted & CONTACT_FEATURE_FLAG_STATES) { TpSubscriptionState subscribe; TpSubscriptionState publish; const gchar *publish_request; gboolean subscribe_valid = FALSE; gboolean publish_valid = FALSE; subscribe = tp_asv_get_uint32 (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE, &subscribe_valid); publish = tp_asv_get_uint32 (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH, &publish_valid); publish_request = tp_asv_get_string (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST); if (subscribe_valid && publish_valid) { contact_set_subscription_states (contact, subscribe, publish, publish_request); } } /* ContactGroups */ if (wanted & CONTACT_FEATURE_FLAG_CONTACT_GROUPS) { boxed = tp_asv_get_boxed (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS, G_TYPE_STRV); contact_maybe_set_contact_groups (contact, boxed); } /* ContactBlocking */ if (wanted & CONTACT_FEATURE_FLAG_CONTACT_BLOCKING) { gboolean is_blocked, valid; is_blocked = tp_asv_get_boolean (asv, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED, &valid); if (valid) _tp_contact_set_is_blocked (contact, is_blocked); } return TRUE; } static gboolean get_feature_flags (guint n_features, const TpContactFeature *features, ContactFeatureFlags *flags); gboolean _tp_contact_set_attributes (TpContact *contact, GHashTable *asv, guint n_features, const TpContactFeature *features, GError **error) { ContactFeatureFlags feature_flags = 0; if (!get_feature_flags (n_features, features, &feature_flags)) return FALSE; return tp_contact_set_attributes (contact, asv, feature_flags, 0 /* can't know what we expected to get */, error); } static void contacts_got_attributes (TpConnection *connection, GHashTable *attributes, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; guint i; DEBUG ("%p: reply from GetContactAttributes: %s", c, (error == NULL ? "OK" : error->message)); if (error != NULL) { contacts_context_fail (c, error); return; } i = 0; if (c->signature == CB_BY_HANDLE && c->contacts->len == 0) { while (i < c->handles->len) { TpHandle handle = g_array_index (c->handles, guint, i); GHashTable *asv = g_hash_table_lookup (attributes, GUINT_TO_POINTER (handle)); if (asv == NULL) { /* not in the hash table => not valid */ g_array_append_val (c->invalid, handle); g_array_remove_index_fast (c->handles, i); } else { TpContact *contact = tp_contact_ensure (connection, handle); g_ptr_array_add (c->contacts, contact); i++; } } } g_assert (c->contacts->len == c->handles->len); for (i = 0; i < c->handles->len; i++) { TpContact *contact = g_ptr_array_index (c->contacts, i); GHashTable *asv = g_hash_table_lookup (attributes, GUINT_TO_POINTER (contact->priv->handle)); GError *e = NULL; if (asv == NULL) { g_set_error (&e, TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "We hold a ref to handle #%u but it appears to be invalid", contact->priv->handle); } else { /* set up the contact with its attributes */ tp_contact_set_attributes (contact, asv, c->wanted, c->getting, &e); } if (e != NULL) { contacts_context_fail (c, e); g_error_free (e); return; } } contacts_context_continue (c); } static const gchar ** contacts_bind_to_signals (TpConnection *connection, ContactFeatureFlags wanted, ContactFeatureFlags *getting) { GArray *contact_attribute_interfaces = connection->priv->contact_attribute_interfaces; GPtrArray *array; guint i; guint len = 0; if (getting != NULL) *getting = 0; if (contact_attribute_interfaces != NULL) len = contact_attribute_interfaces->len; g_assert (tp_proxy_has_interface_by_id (connection, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)); array = g_ptr_array_sized_new (len); for (i = 0; i < len; i++) { GQuark q = g_array_index (contact_attribute_interfaces, GQuark, i); if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING) { if ((wanted & CONTACT_FEATURE_FLAG_ALIAS) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_ALIASING); contacts_bind_to_aliases_changed (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_ALIAS; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS) { if ((wanted & CONTACT_FEATURE_FLAG_AVATAR_TOKEN) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_AVATARS); contacts_bind_to_avatar_updated (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_AVATAR_TOKEN; } if ((wanted & CONTACT_FEATURE_FLAG_AVATAR_DATA) != 0) { contacts_bind_to_avatar_retrieved (connection); } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_SIMPLE_PRESENCE) { if ((wanted & CONTACT_FEATURE_FLAG_PRESENCE) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE); contacts_bind_to_presences_changed (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_PRESENCE; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION) { if ((wanted & CONTACT_FEATURE_FLAG_LOCATION) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_LOCATION); contacts_bind_to_location_updated (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_LOCATION; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_CAPABILITIES) { if ((wanted & CONTACT_FEATURE_FLAG_CAPABILITIES) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CONTACT_CAPABILITIES); contacts_bind_to_capabilities_updated (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_CAPABILITIES; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO) { if ((wanted & CONTACT_FEATURE_FLAG_CONTACT_INFO) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO); contacts_bind_to_contact_info_changed (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_CONTACT_INFO; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CLIENT_TYPES) { if ((wanted & CONTACT_FEATURE_FLAG_CLIENT_TYPES) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CLIENT_TYPES); contacts_bind_to_client_types_updated (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_CLIENT_TYPES; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST) { if ((wanted & CONTACT_FEATURE_FLAG_STATES) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST); contacts_bind_to_contacts_changed (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_STATES; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS) { if ((wanted & CONTACT_FEATURE_FLAG_CONTACT_GROUPS) != 0) { g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS); contacts_bind_to_contact_groups_changed (connection); if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_CONTACT_GROUPS; } } else if (q == TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING) { if ((wanted & CONTACT_FEATURE_FLAG_CONTACT_BLOCKING) != 0) { GQuark features[] = { TP_CONNECTION_FEATURE_CONTACT_BLOCKING, 0 }; g_ptr_array_add (array, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING); /* The BlockedContactsChanged signal is already handled by * connection-contact-list.c so we just have to prepare * TP_CONNECTION_FEATURE_CONTACT_BLOCKING to make sure it's * connected. */ if (!tp_proxy_is_prepared (connection, TP_CONNECTION_FEATURE_CONTACT_BLOCKING)) { tp_proxy_prepare_async (connection, features, NULL, NULL); } if (getting != NULL) *getting |= CONTACT_FEATURE_FLAG_CONTACT_BLOCKING; } } } g_ptr_array_add (array, NULL); return (const gchar **) g_ptr_array_free (array, FALSE); } /* * The connection must implement Contacts. */ const gchar ** _tp_contacts_bind_to_signals (TpConnection *connection, guint n_features, const TpContactFeature *features) { ContactFeatureFlags feature_flags = 0; if (!get_feature_flags (n_features, features, &feature_flags)) return NULL; return contacts_bind_to_signals (connection, feature_flags, NULL); } static void contacts_get_attributes (ContactsContext *context) { const gchar **supported_interfaces; guint i; /* tp_connection_get_contact_attributes insists that you have at least one * handle; skip it if we don't (can only happen if we started from IDs) */ if (context->handles->len == 0) { contacts_context_continue (context); return; } supported_interfaces = contacts_bind_to_signals (context->connection, context->wanted, &context->getting); if (supported_interfaces[0] == NULL && !(context->signature == CB_BY_HANDLE && context->contacts->len == 0) && context->contacts_have_ids) { /* We're not going to do anything useful: we're not holding/inspecting * the handles, and we're not inspecting any extended interfaces * either. Skip it. */ g_free (supported_interfaces); contacts_context_continue (context); return; } /* The Hold parameter is only true if we started from handles, and we don't * already have all the contacts we need. */ context->refcount++; DEBUG ("calling GetContactAttributes"); for (i = 0; supported_interfaces[i] != NULL; i++) DEBUG ("- %s", supported_interfaces[i]); tp_cli_connection_interface_contacts_call_get_contact_attributes ( context->connection, -1, context->handles, supported_interfaces, (context->signature == CB_BY_HANDLE && context->contacts->len == 0), contacts_got_attributes, context, contacts_context_unref, context->weak_object); g_free (supported_interfaces); } /* * Returns a new GPtrArray of borrowed references to TpContacts, * or NULL if any contacts could not be found. */ static GPtrArray * lookup_all_contacts (ContactsContext *context) { GPtrArray *contacts = g_ptr_array_new (); guint i; for (i = 0; i < context->handles->len; i++) { TpContact *contact = _tp_connection_lookup_contact (context->connection, g_array_index (context->handles, TpHandle, i)); if (contact != NULL) { g_ptr_array_add (contacts, contact); } else { g_ptr_array_unref (contacts); contacts = NULL; break; } } return contacts; } static gboolean get_feature_flags (guint n_features, const TpContactFeature *features, ContactFeatureFlags *flags) { ContactFeatureFlags feature_flags = 0; guint i; for (i = 0; i < n_features; i++) { g_return_val_if_fail (features[i] < TP_NUM_CONTACT_FEATURES, FALSE); feature_flags |= (1 << features[i]); } /* Force AVATAR_TOKEN if we have AVATAR_DATA */ if ((feature_flags & CONTACT_FEATURE_FLAG_AVATAR_DATA) != 0) feature_flags |= CONTACT_FEATURE_FLAG_AVATAR_TOKEN; *flags = feature_flags; return TRUE; } static void contacts_context_remove_common_features (ContactsContext *context) { ContactFeatureFlags minimal_feature_flags = 0xFFFFFFFF; guint i; context->contacts_have_ids = TRUE; for (i = 0; i < context->contacts->len; i++) { TpContact *contact = g_ptr_array_index (context->contacts, i); minimal_feature_flags &= contact->priv->has_features; if (contact->priv->identifier == NULL) context->contacts_have_ids = FALSE; } context->wanted &= (~minimal_feature_flags); } /** * tp_connection_get_contacts_by_handle: * @self: A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED * feature prepared * @n_handles: The number of handles in @handles (must be at least 1) * @handles: (array length=n_handles) (element-type uint): An array of handles * of type %TP_HANDLE_TYPE_CONTACT representing the desired contacts * @n_features: The number of features in @features (may be 0) * @features: (array length=n_features) (allow-none) (element-type uint): An array of features that * must be ready for use (if supported) before the callback is called (may * be %NULL if @n_features is 0) * @callback: A user callback to call when the contacts are ready * @user_data: Data to pass to the callback * @destroy: Called to destroy @user_data either after @callback has been * called, or if the operation is cancelled * @weak_object: (allow-none): An object to pass to the callback, which will be * weakly referenced; if this object is destroyed, the operation will be * cancelled * * Create a number of #TpContact objects and make asynchronous method calls * to hold their handles and ensure that all the features specified in * @features are ready for use (if they are supported at all). * * It is not an error to put features in @features even if the connection * manager doesn't support them - users of this method should have a static * list of features they would like to use if possible, and use it for all * connection managers. * * Since: 0.7.18 * Deprecated: Use tp_simple_client_factory_ensure_contact() instead. */ void tp_connection_get_contacts_by_handle (TpConnection *self, guint n_handles, const TpHandle *handles, guint n_features, const TpContactFeature *features, TpConnectionContactsByHandleCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { ContactFeatureFlags feature_flags = 0; ContactsContext *context; GPtrArray *contacts; /* As an implementation detail, this method actually starts working slightly * before we're officially ready. We use this to get the TpContact for the * Connection. */ g_return_if_fail (self->priv->ready_enough_for_contacts); g_return_if_fail (tp_proxy_get_invalidated (self) == NULL); g_return_if_fail (n_handles >= 1); g_return_if_fail (handles != NULL); g_return_if_fail (n_features == 0 || features != NULL); g_return_if_fail (callback != NULL); if (!get_feature_flags (n_features, features, &feature_flags)) return; context = contacts_context_new (self, n_handles, feature_flags, CB_BY_HANDLE, user_data, destroy, weak_object); context->callback.by_handle = callback; g_array_append_vals (context->handles, handles, n_handles); contacts = lookup_all_contacts (context); if (contacts != NULL) { /* We have already held (and possibly inspected) handles, so we can * skip that. */ g_ptr_array_foreach (contacts, (GFunc) g_object_ref, NULL); tp_g_ptr_array_extend (context->contacts, contacts); contacts_context_remove_common_features (context); /* We do need to retrieve any features that aren't there yet, though. */ if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) { g_queue_push_head (&context->todo, contacts_get_attributes); } contacts_context_queue_features (context); g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, contacts_context_idle_continue, context, contacts_context_unref); g_ptr_array_unref (contacts); return; } if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) { /* we support the Contacts interface, so we can hold the handles and * simultaneously inspect them. After that, we'll fill in any * features that are necessary (this becomes a no-op if Contacts * will give us everything). */ g_queue_push_head (&context->todo, contacts_get_attributes); contacts_context_queue_features (context); g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, contacts_context_idle_continue, context, contacts_context_unref); return; } /* if we haven't already returned, we're on the slow path */ DEBUG ("slow path"); /* Before we return anything we'll want to inspect the handles */ g_queue_push_head (&context->todo, contacts_inspect); /* After that we'll get the features */ contacts_context_queue_features (context); G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* but first, we need to hold onto them */ tp_connection_hold_handles (self, -1, TP_HANDLE_TYPE_CONTACT, n_handles, handles, contacts_held_handles, context, contacts_context_unref, weak_object); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_connection_upgrade_contacts: * @self: A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED * feature prepared * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects * associated with @self * @n_features: The number of features in @features (must be at least 1) * @features: (array length=n_features): An array of features that must be * ready for use (if supported) before the callback is called * @callback: A user callback to call when the contacts are ready * @user_data: Data to pass to the callback * @destroy: Called to destroy @user_data either after @callback has been * called, or if the operation is cancelled * @weak_object: (allow-none): An object to pass to the callback, which will be * weakly referenced; if this object is destroyed, the operation will be * cancelled * * Given several #TpContact objects, make asynchronous method calls * ensure that all the features specified in @features are ready for use * (if they are supported at all). * * It is not an error to put features in @features even if the connection * manager doesn't support them - users of this method should have a static * list of features they would like to use if possible, and use it for all * connection managers. * * Since: 0.7.18 * Deprecated: Use tp_connection_upgrade_contacts_async() instead. */ void tp_connection_upgrade_contacts (TpConnection *self, guint n_contacts, TpContact * const *contacts, guint n_features, const TpContactFeature *features, TpConnectionUpgradeContactsCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { ContactFeatureFlags feature_flags = 0; ContactsContext *context; guint i; /* As an implementation detail, this method actually starts working slightly * before we're officially ready. We use this to get the TpContact for the * Connection. */ g_return_if_fail (self->priv->ready_enough_for_contacts); g_return_if_fail (n_contacts >= 1); g_return_if_fail (contacts != NULL); g_return_if_fail (n_features == 0 || features != NULL); g_return_if_fail (callback != NULL); for (i = 0; i < n_contacts; i++) { g_return_if_fail (contacts[i]->priv->connection == self); g_return_if_fail (contacts[i]->priv->identifier != NULL); } if (!get_feature_flags (n_features, features, &feature_flags)) return; context = contacts_context_new (self, n_contacts, feature_flags, CB_UPGRADE, user_data, destroy, weak_object); context->callback.upgrade = callback; for (i = 0; i < n_contacts; i++) { g_ptr_array_add (context->contacts, g_object_ref (contacts[i])); g_array_append_val (context->handles, contacts[i]->priv->handle); } g_assert (context->handles->len == n_contacts); contacts_context_remove_common_features (context); if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) { g_queue_push_head (&context->todo, contacts_get_attributes); } contacts_context_queue_features (context); /* use an idle to make sure the callback is called after we return, * even if all the contacts actually have all the features, just to be * consistent */ g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, contacts_context_idle_continue, context, contacts_context_unref); } static void contacts_requested_one_handle (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const gchar * const *ids, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; if (error == NULL) { TpContact *contact; g_assert (handle_type == TP_HANDLE_TYPE_CONTACT); /* -1 because NULL terminator is explicit */ g_assert (c->next_index < c->request_ids->len - 1); g_assert (n_handles == 1); g_assert (handles[0] != 0); contact = tp_contact_ensure (connection, handles[0]); g_array_append_val (c->handles, handles[0]); g_ptr_array_add (c->contacts, contact); c->next_index++; } else if (error->domain == TP_ERROR && (error->code == TP_ERROR_INVALID_HANDLE || error->code == TP_ERROR_NOT_AVAILABLE || error->code == TP_ERROR_INVALID_ARGUMENT)) { g_hash_table_insert (c->request_errors, g_ptr_array_index (c->request_ids, c->next_index), g_error_copy (error)); /* shift the rest of the IDs down one and do not increment next_index */ g_ptr_array_remove_index (c->request_ids, c->next_index); } else { contacts_context_fail (c, error); return; } contacts_context_continue (c); } static void contacts_request_one_handle (ContactsContext *c) { const gchar *ids[] = { NULL, NULL }; ids[0] = g_ptr_array_index (c->request_ids, c->next_index); g_assert (ids[0] != NULL); G_GNUC_BEGIN_IGNORE_DEPRECATIONS c->refcount++; tp_connection_request_handles (c->connection, -1, TP_HANDLE_TYPE_CONTACT, ids, contacts_requested_one_handle, c, contacts_context_unref, c->weak_object); G_GNUC_END_IGNORE_DEPRECATIONS } static void contacts_requested_handles (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const gchar * const *ids, const GError *error, gpointer user_data, GObject *weak_object) { ContactsContext *c = user_data; g_assert (handle_type == TP_HANDLE_TYPE_CONTACT); g_assert (weak_object == c->weak_object); if (error == NULL) { guint i; for (i = 0; i < n_handles; i++) { TpContact *contact = tp_contact_ensure (connection, handles[i]); g_array_append_val (c->handles, handles[i]); g_ptr_array_add (c->contacts, contact); } } else if (error->domain == TP_ERROR && (error->code == TP_ERROR_INVALID_HANDLE || error->code == TP_ERROR_NOT_AVAILABLE || error->code == TP_ERROR_INVALID_ARGUMENT)) { /* One of the strings is bad. We don't know which, so split them. */ guint i; DEBUG ("A handle was bad, trying to recover: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); /* -1 because NULL terminator is explicit */ for (i = 0; i < c->request_ids->len - 1; i++) { g_queue_push_head (&c->todo, contacts_request_one_handle); } g_assert (c->next_index == 0); } else { DEBUG ("RequestHandles failed: %s %u: %s", g_quark_to_string (error->domain), error->code, error->message); contacts_context_fail (c, error); return; } contacts_context_continue (c); } /** * tp_connection_get_contacts_by_id: * @self: A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED * feature prepared * @n_ids: The number of IDs in @ids (must be at least 1) * @ids: (array length=n_ids) (transfer none): An array of strings representing * the desired contacts by their * identifiers in the IM protocol (XMPP JIDs, SIP URIs, MSN Passports, * AOL screen-names etc.) * @n_features: The number of features in @features (may be 0) * @features: (array length=n_features) (allow-none): An array of features * that must be ready for use (if supported) * before the callback is called (may be %NULL if @n_features is 0) * @callback: A user callback to call when the contacts are ready * @user_data: Data to pass to the callback * @destroy: Called to destroy @user_data either after @callback has been * called, or if the operation is cancelled * @weak_object: (allow-none): An object to pass to the callback, which will * be weakly referenced; if this object is destroyed, the operation will be * cancelled * * Create a number of #TpContact objects and make asynchronous method calls * to obtain their handles and ensure that all the features specified in * @features are ready for use (if they are supported at all). * * It is not an error to put features in @features even if the connection * manager doesn't support them - users of this method should have a static * list of features they would like to use if possible, and use it for all * connection managers. * * Since: 0.7.18 * Deprecated: Use tp_connection_dup_contact_by_id_async() instead. */ void tp_connection_get_contacts_by_id (TpConnection *self, guint n_ids, const gchar * const *ids, guint n_features, const TpContactFeature *features, TpConnectionContactsByIdCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { ContactFeatureFlags feature_flags = 0; ContactsContext *context; guint i; g_return_if_fail (tp_proxy_is_prepared (self, TP_CONNECTION_FEATURE_CONNECTED)); g_return_if_fail (n_ids >= 1); g_return_if_fail (ids != NULL); g_return_if_fail (ids[0] != NULL); g_return_if_fail (n_features == 0 || features != NULL); g_return_if_fail (callback != NULL); if (!get_feature_flags (n_features, features, &feature_flags)) return; context = contacts_context_new (self, n_ids, feature_flags, CB_BY_ID, user_data, destroy, weak_object); context->callback.by_id = callback; context->request_errors = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_error_free); context->request_ids = g_ptr_array_sized_new (n_ids); for (i = 0; i < n_ids; i++) { g_return_if_fail (ids[i] != NULL); g_ptr_array_add (context->request_ids, g_strdup (ids[i])); } g_ptr_array_add (context->request_ids, NULL); /* set up the queue of feature introspection */ if (tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) { g_queue_push_head (&context->todo, contacts_get_attributes); } else { g_queue_push_head (&context->todo, contacts_inspect); } contacts_context_queue_features (context); G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* but first, we need to get the handles in the first place */ tp_connection_request_handles (self, -1, TP_HANDLE_TYPE_CONTACT, (const gchar * const *) context->request_ids->pdata, contacts_requested_handles, context, contacts_context_unref, weak_object); G_GNUC_END_IGNORE_DEPRECATIONS } static void got_contact_by_id_fallback_cb (TpConnection *self, guint n_contacts, TpContact * const *contacts, const gchar * const *requested_ids, GHashTable *failed_id_errors, const GError *error, gpointer user_data, GObject *weak_object) { const gchar *id = user_data; GSimpleAsyncResult *result = (GSimpleAsyncResult *) weak_object; GError *e = NULL; if (error != NULL) { g_simple_async_result_set_from_error (result, error); } else if (g_hash_table_size (failed_id_errors) > 0) { e = g_hash_table_lookup (failed_id_errors, id); if (e == NULL) { g_set_error (&e, TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "We requested 1 id, and got an error for another id - Broken CM"); g_simple_async_result_take_error (result, e); } else { g_simple_async_result_set_from_error (result, e); } } else if (n_contacts != 1 || contacts[0] == NULL) { g_set_error (&e, TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "We requested 1 id, but no contacts and no error - Broken CM"); g_simple_async_result_take_error (result, e); } else { g_simple_async_result_set_op_res_gpointer (result, g_object_ref (contacts[0]), g_object_unref); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_connection_dup_contact_by_id_async: * @self: A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED * feature prepared * @id: A strings representing the desired contact by its * identifier in the IM protocol (an XMPP JID, SIP URI, MSN Passport, * AOL screen-name etc.) * @n_features: The number of features in @features (may be 0) * @features: (array length=n_features) (allow-none): An array of features * that must be ready for use (if supported) * before the callback is called (may be %NULL if @n_features is 0) * @callback: A user callback to call when the contact is ready * @user_data: Data to pass to the callback * * Create a #TpContact object and make any asynchronous method calls necessary * to ensure that all the features specified in @features are ready for use * (if they are supported at all). * * It is not an error to put features in @features even if the connection * manager doesn't support them - users of this method should have a static * list of features they would like to use if possible, and use it for all * connection managers. * * Since: 0.19.0 */ void tp_connection_dup_contact_by_id_async (TpConnection *self, const gchar *id, guint n_features, const TpContactFeature *features, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_dup_contact_by_id_async); G_GNUC_BEGIN_IGNORE_DEPRECATIONS tp_connection_get_contacts_by_id (self, 1, &id, n_features, features, got_contact_by_id_fallback_cb, g_strdup (id), g_free, G_OBJECT (result)); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_connection_dup_contact_by_id_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_dup_contact_by_id_async(). * * Returns: (transfer full): a #TpContact or %NULL on error. * Since: 0.19.0 */ TpContact * tp_connection_dup_contact_by_id_finish (TpConnection *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_connection_dup_contact_by_id_async, g_object_ref); } static void upgrade_contacts_fallback_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; GPtrArray *contacts_array; guint i; contacts_array = g_ptr_array_new_full (n_contacts, g_object_unref); for (i = 0; i < n_contacts; i++) g_ptr_array_add (contacts_array, g_object_ref (contacts[i])); g_simple_async_result_set_op_res_gpointer (result, contacts_array, (GDestroyNotify) g_ptr_array_unref); if (error != NULL) g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete_in_idle (result); } /** * tp_connection_upgrade_contacts_async: * @self: A connection, which must have the %TP_CONNECTION_FEATURE_CONNECTED * feature prepared * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects * associated with @self * @n_features: The number of features in @features (must be at least 1) * @features: (array length=n_features): An array of features that must be * ready for use (if supported) before the callback is called * @callback: A user callback to call when the contacts are ready * @user_data: Data to pass to the callback * * Given several #TpContact objects, make asynchronous method calls * ensure that all the features specified in @features are ready for use * (if they are supported at all). * * It is not an error to put features in @features even if the connection * manager doesn't support them - users of this method should have a static * list of features they would like to use if possible, and use it for all * connection managers. * * Since: 0.19.0 */ void tp_connection_upgrade_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, guint n_features, const TpContactFeature *features, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_upgrade_contacts_async); G_GNUC_BEGIN_IGNORE_DEPRECATIONS tp_connection_upgrade_contacts (self, n_contacts, contacts, n_features, features, upgrade_contacts_fallback_cb, result, g_object_unref, NULL); G_GNUC_END_IGNORE_DEPRECATIONS } /** * tp_connection_upgrade_contacts_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @contacts: (element-type TelepathyGLib.Contact) (transfer container) (out) (allow-none): * a location to set a #GPtrArray of upgraded #TpContact, or %NULL. * @error: a #GError to fill * * Finishes tp_connection_upgrade_contacts_async(). * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.19.0 */ gboolean tp_connection_upgrade_contacts_finish (TpConnection *self, GAsyncResult *result, GPtrArray **contacts, GError **error) { _tp_implement_finish_copy_pointer (self, tp_connection_upgrade_contacts_async, g_ptr_array_ref, contacts); } void _tp_contact_set_is_blocked (TpContact *self, gboolean is_blocked) { if (self == NULL) return; self->priv->has_features |= CONTACT_FEATURE_FLAG_CONTACT_BLOCKING; if (self->priv->is_blocked == is_blocked) return; self->priv->is_blocked = is_blocked; g_object_notify ((GObject *) self, "is-blocked"); } /** * tp_contact_is_blocked: * @self: a #TpContact * * * Returns: the value of #TpContact:is-blocked. * * Since: 0.17.0 */ gboolean tp_contact_is_blocked (TpContact *self) { g_return_val_if_fail (TP_IS_CONTACT (self), FALSE); return self->priv->is_blocked; } telepathy-glib-0.24.2/telepathy-glib/contact.h0000644000175000017500000002024212652510705016153 00000000000000/* Object representing a Telepathy contact * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONTACT_H__ #define __TP_CONTACT_H__ #include #include #include #include #include #include #include G_BEGIN_DECLS /* TpContact is forward-declared in connection.h */ typedef struct _TpContactClass TpContactClass; typedef struct _TpContactPrivate TpContactPrivate; GType tp_contact_get_type (void) G_GNUC_CONST; #define TP_TYPE_CONTACT \ (tp_contact_get_type ()) #define TP_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT, \ TpContact)) #define TP_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CONTACT, \ TpContactClass)) #define TP_IS_CONTACT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CONTACT)) #define TP_IS_CONTACT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CONTACT)) #define TP_CONTACT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONTACT, \ TpContactClass)) typedef enum { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE, TP_CONTACT_FEATURE_LOCATION, TP_CONTACT_FEATURE_CAPABILITIES, TP_CONTACT_FEATURE_AVATAR_DATA, TP_CONTACT_FEATURE_CONTACT_INFO, TP_CONTACT_FEATURE_CLIENT_TYPES, TP_CONTACT_FEATURE_SUBSCRIPTION_STATES, TP_CONTACT_FEATURE_CONTACT_GROUPS, TP_CONTACT_FEATURE_CONTACT_BLOCKING, } TpContactFeature; #define TP_NUM_CONTACT_FEATURES (TP_CONTACT_FEATURE_CONTACT_BLOCKING + 1) #define NUM_TP_CONTACT_FEATURES TP_NUM_CONTACT_FEATURES #define TP_CONTACT_FEATURE_INVALID ((TpContactFeature) -1) /* Basic functionality, always available */ _TP_AVAILABLE_IN_0_20 TpAccount *tp_contact_get_account (TpContact *self); TpConnection *tp_contact_get_connection (TpContact *self); TpHandle tp_contact_get_handle (TpContact *self); const gchar *tp_contact_get_identifier (TpContact *self); gboolean tp_contact_has_feature (TpContact *self, TpContactFeature feature); /* TP_CONTACT_FEATURE_ALIAS */ const gchar *tp_contact_get_alias (TpContact *self); /* TP_CONTACT_FEATURE_AVATAR_TOKEN */ const gchar *tp_contact_get_avatar_token (TpContact *self); /* TP_CONTACT_FEATURE_PRESENCE */ TpConnectionPresenceType tp_contact_get_presence_type (TpContact *self); const gchar *tp_contact_get_presence_status (TpContact *self); const gchar *tp_contact_get_presence_message (TpContact *self); /* TP_CONTACT_FEATURE_LOCATION */ GHashTable *tp_contact_get_location (TpContact *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_contact_dup_location (TpContact *self); /* TP_CONTACT_FEATURE_CAPABILITIES */ TpCapabilities *tp_contact_get_capabilities (TpContact *self); /* TP_CONTACT_FEATURE_AVATAR_DATA */ GFile *tp_contact_get_avatar_file (TpContact *self); const gchar *tp_contact_get_avatar_mime_type (TpContact *self); /* TP_CONTACT_FEATURE_INFO */ #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_contact_dup_contact_info) GList *tp_contact_get_contact_info (TpContact *self); #endif _TP_AVAILABLE_IN_0_20 GList *tp_contact_dup_contact_info (TpContact *self); void tp_contact_request_contact_info_async (TpContact *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_contact_request_contact_info_finish (TpContact *self, GAsyncResult *result, GError **error); void tp_connection_refresh_contact_info (TpConnection *self, guint n_contacts, TpContact * const *contacts); /* TP_CONTACT_FEATURE_CLIENT_TYPES */ const gchar * const * /* this comment stops gtkdoc denying that this function exists */ tp_contact_get_client_types (TpContact *self); /* TP_CONTACT_FEATURE_SUBSCRIPTION_STATES */ TpSubscriptionState tp_contact_get_subscribe_state (TpContact *self); TpSubscriptionState tp_contact_get_publish_state (TpContact *self); const gchar *tp_contact_get_publish_request (TpContact *self); /* TP_CONTACT_FEATURE_CONTACT_GROUPS */ const gchar * const * /* this comment stops gtkdoc denying that this function exists */ tp_contact_get_contact_groups (TpContact *self); void tp_contact_set_contact_groups_async (TpContact *self, gint n_groups, const gchar * const *groups, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_contact_set_contact_groups_finish (TpContact *self, GAsyncResult *result, GError **error); #ifndef TP_DISABLE_DEPRECATED typedef void (*TpConnectionContactsByHandleCb) (TpConnection *connection, guint n_contacts, TpContact * const *contacts, guint n_failed, const TpHandle *failed, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_20 void tp_connection_get_contacts_by_handle (TpConnection *self, guint n_handles, const TpHandle *handles, guint n_features, const TpContactFeature *features, TpConnectionContactsByHandleCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); typedef void (*TpConnectionUpgradeContactsCb) (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_20_FOR(tp_connection_upgrade_contacts_async) void tp_connection_upgrade_contacts (TpConnection *self, guint n_contacts, TpContact * const *contacts, guint n_features, const TpContactFeature *features, TpConnectionUpgradeContactsCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); typedef void (*TpConnectionContactsByIdCb) (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *requested_ids, GHashTable *failed_id_errors, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_20_FOR(tp_connection_dup_contact_by_id_async) void tp_connection_get_contacts_by_id (TpConnection *self, guint n_ids, const gchar * const *ids, guint n_features, const TpContactFeature *features, TpConnectionContactsByIdCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); #endif TpContact *tp_connection_dup_contact_if_possible (TpConnection *connection, TpHandle handle, const gchar *identifier); _TP_AVAILABLE_IN_0_20 void tp_connection_dup_contact_by_id_async (TpConnection *self, const gchar *id, guint n_features, const TpContactFeature *features, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 TpContact *tp_connection_dup_contact_by_id_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_20 void tp_connection_upgrade_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, guint n_features, const TpContactFeature *features, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 gboolean tp_connection_upgrade_contacts_finish (TpConnection *self, GAsyncResult *result, GPtrArray **contacts, GError **error); /* TP_CONTACT_FEATURE_CONTACT_BLOCKING */ _TP_AVAILABLE_IN_0_18 gboolean tp_contact_is_blocked (TpContact *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-account.h0000644000175000017500000000047312652510705016751 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_ACCOUNT_H__ #define __TP_META_SVC_ACCOUNT_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/channel-dispatcher.xml0000644000175000017500000000061312652510705020625 00000000000000 Channel Dispatcher interfaces telepathy-glib-0.24.2/telepathy-glib/deprecated-internal.h0000644000175000017500000000301412652510705020430 00000000000000/**/ /* Deprecated functions still used internally * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_DEPRECATED_INTERNAL_H__ #define __TP_DEPRECATED_INTERNAL_H__ #include #include #include #include #include G_BEGIN_DECLS void _tp_base_client_set_channel_factory (TpBaseClient *self, TpClientChannelFactory *factory); void _tp_account_channel_request_set_channel_factory ( TpAccountChannelRequest *self, TpClientChannelFactory *factory); void _tp_channel_request_set_channel_factory (TpChannelRequest *self, TpClientChannelFactory *factory); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-channel-request.h0000644000175000017500000000052312652510705020407 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CHANNEL_REQUEST_H__ #define __TP_META_SVC_CHANNEL_REQUEST_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/dbus-tube-channel.c0000644000175000017500000005674512652510705020034 00000000000000/* * dbus-tube-channel.h - high level API for DBusTube channels * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:dbus-tube-channel * @title: TpDBusTubeChannel * @short_description: proxy object for D-Bus tube channels * * #TpDBusTubeChannel provides API for working with D-Bus tube channels, which * allow applications to open D-Bus connections to a contact or chat room. * * To create a new outgoing D-Bus tube channel, do something like: * * |[ * GHashTable *request_properties = tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, tp_contact_get_identifier (contact), * TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, "com.example.walrus", * NULL); * TpAccountChannelRequest *req = tp_account_channel_request_new (account, * request_properties, TP_USER_ACTION_TIME_NOT_USER_ACTION); * tp_account_channel_request_create_and_handle_channel_async (req, NULL, callback, NULL); * * // ... * * static void * callback ( * GObject *source, * GAsyncResult *result, * gpointer user_data) * { * TpAccountChannelRequest *req = TP_ACCOUNT_CHANNEL_REQUEST (source); * TpChannel *channel; * GError *error = NULL; * * channel = tp_account_channel_request_create_and_handle_channel_finish (req, result, &error); * tp_dbus_tube_channel_offer_async (TP_DBUS_TUBE_CHANNEL (channel), NULL, offer_callback, NULL); * } * ]| * * You can find a fuller example in the examples/client/dbus-tubes * directory. * * Since: 0.18.0 */ /** * TpDBusTubeChannel: * * Data structure representing a #TpDBusTubeChannel. * * Since: 0.18.0 */ /** * TpDBusTubeChannelClass: * * The class of a #TpDBusTubeChannel. * * Since: 0.18.0 */ #include "config.h" #include "telepathy-glib/dbus-tube-channel.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/automatic-client-factory-internal.h" #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/variant-util-internal.h" #include #include G_DEFINE_TYPE (TpDBusTubeChannel, tp_dbus_tube_channel, TP_TYPE_CHANNEL) struct _TpDBusTubeChannelPrivate { GHashTable *parameters; TpTubeChannelState state; GSimpleAsyncResult *result; gchar *address; }; enum { PROP_SERVICE_NAME = 1, PROP_PARAMETERS, PROP_PARAMETERS_VARDICT }; static void tp_dbus_tube_channel_dispose (GObject *obj) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) obj; tp_clear_pointer (&self->priv->parameters, g_hash_table_unref); /* If priv->result isn't NULL, it owns a ref to self. */ g_warn_if_fail (self->priv->result == NULL); tp_clear_pointer (&self->priv->address, g_free); G_OBJECT_CLASS (tp_dbus_tube_channel_parent_class)->dispose (obj); } static void tp_dbus_tube_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) object; switch (property_id) { case PROP_SERVICE_NAME: g_value_set_string (value, tp_dbus_tube_channel_get_service_name (self)); break; case PROP_PARAMETERS: g_value_set_boxed (value, self->priv->parameters); break; case PROP_PARAMETERS_VARDICT: g_value_take_variant (value, tp_dbus_tube_channel_dup_parameters_vardict (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void complete_operation (TpDBusTubeChannel *self) { TpDBusTubeChannelPrivate *priv = self->priv; GSimpleAsyncResult *result = priv->result; /* This dance is to ensure that we don't accidentally manipulate priv->result * while calling out to user code. For instance, someone might call * tp_proxy_invalidate() on us, which winds up landing us in here via our * handler for that signal. */ g_assert (priv->result != NULL); result = priv->result; priv->result = NULL; g_simple_async_result_complete (result); g_object_unref (result); } static void dbus_connection_new_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpDBusTubeChannel *self = user_data; GDBusConnection *conn; GError *error = NULL; conn = g_dbus_connection_new_for_address_finish (result, &error); if (conn == NULL) { DEBUG ("Failed to create GDBusConnection: %s", error->message); g_simple_async_result_take_error (self->priv->result, error); } else { g_simple_async_result_set_op_res_gpointer (self->priv->result, conn, g_object_unref); } complete_operation (self); } static void check_tube_open (TpDBusTubeChannel *self) { if (self->priv->result == NULL) return; if (self->priv->address == NULL) return; if (self->priv->state != TP_TUBE_CHANNEL_STATE_OPEN) return; DEBUG ("Tube %s opened: %s", tp_proxy_get_object_path (self), self->priv->address); g_dbus_connection_new_for_address (self->priv->address, G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, NULL, NULL, dbus_connection_new_cb, self); } static void dbus_tube_invalidated_cb ( TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { TpDBusTubeChannel *self = TP_DBUS_TUBE_CHANNEL (proxy); TpDBusTubeChannelPrivate *priv = self->priv; GError error = { domain, code, message }; if (priv->result != NULL) { DEBUG ("Tube invalidated: '%s'; failing pending offer/accept method call", message); g_simple_async_result_set_from_error (priv->result, &error); complete_operation (self); } } static void tube_state_changed_cb (TpChannel *channel, TpTubeChannelState state, gpointer user_data, GObject *weak_object) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) channel; self->priv->state = state; check_tube_open (self); } static void tp_dbus_tube_channel_constructed (GObject *obj) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) obj; void (*chain_up) (GObject *) = ((GObjectClass *) tp_dbus_tube_channel_parent_class)->constructed; TpChannel *chan = (TpChannel *) obj; GHashTable *props; if (chain_up != NULL) chain_up (obj); if (tp_channel_get_channel_type_id (chan) != TP_IFACE_QUARK_CHANNEL_TYPE_DBUS_TUBE) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Channel is not a D-Bus tube" }; DEBUG ("Channel is not a D-Bus tube: %s", tp_channel_get_channel_type ( chan)); tp_proxy_invalidate (TP_PROXY (self), &error); return; } props = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); if (tp_asv_get_string (props, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME) == NULL) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Tube doesn't have DBusTube.ServiceName property" }; DEBUG ("%s", error.message); tp_proxy_invalidate (TP_PROXY (self), &error); return; } /* Tube.Parameters is immutable for incoming tubes. For outgoing ones, * it's defined when offering the tube. */ if (!tp_channel_get_requested (TP_CHANNEL (self))) { GHashTable *params; params = tp_asv_get_boxed (props, TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS, TP_HASH_TYPE_STRING_VARIANT_MAP); if (params == NULL) { DEBUG ("Incoming tube doesn't have Tube.Parameters property"); self->priv->parameters = tp_asv_new (NULL, NULL); } else { self->priv->parameters = g_boxed_copy ( TP_HASH_TYPE_STRING_VARIANT_MAP, params); } } g_signal_connect (self, "invalidated", G_CALLBACK (dbus_tube_invalidated_cb), NULL); } static void get_state_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) proxy; GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to get Tube.State property: %s", error->message); g_simple_async_result_set_error (result, error->domain, error->code, "Failed to get Tube.State property: %s", error->message); } else { self->priv->state = g_value_get_uint (value); } g_simple_async_result_complete (result); } static void tp_dbus_tube_channel_prepare_core_feature_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GError *error = NULL; TpChannel *chan = (TpChannel *) proxy; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_dbus_tube_channel_prepare_core_feature_async); if (tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed (chan, tube_state_changed_cb, proxy, NULL, NULL, &error) == NULL) { WARNING ("Failed to connect to TubeChannelStateChanged on %s: %s", tp_proxy_get_object_path (proxy), error->message); g_error_free (error); } tp_cli_dbus_properties_call_get (proxy, -1, TP_IFACE_CHANNEL_INTERFACE_TUBE, "State", get_state_cb, result, g_object_unref, G_OBJECT (proxy)); } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_dbus_tube_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_DBUS_TUBE_CHANNEL_FEATURE_CORE; features[FEAT_CORE].prepare_async = tp_dbus_tube_channel_prepare_core_feature_async; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_dbus_tube_channel_class_init (TpDBusTubeChannelClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; TpProxyClass *proxy_class = (TpProxyClass *) klass; gobject_class->constructed = tp_dbus_tube_channel_constructed; gobject_class->get_property = tp_dbus_tube_channel_get_property; gobject_class->dispose = tp_dbus_tube_channel_dispose; proxy_class->list_features = tp_dbus_tube_channel_list_features; /** * TpDBusTubeChannel:service-name: * * A string representing the service name that will be used over the tube. * * Since: 0.18.0 */ param_spec = g_param_spec_string ("service-name", "Service Name", "The service name of the dbus tube", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SERVICE_NAME, param_spec); /** * TpDBusTubeChannel:parameters: * * A string to #GValue #GHashTable representing the parameters of the tube. * * Will be %NULL for outgoing tubes until the tube has been offered. * * In high-level language bindings, use * tp_dbus_tube_channel_dup_parameters_vardict() to get the same information * in a more convenient format. * * Since: 0.18.0 */ param_spec = g_param_spec_boxed ("parameters", "Parameters", "The parameters of the dbus tube", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_PARAMETERS, param_spec); /** * TpDBusTubeChannel:parameters-vardict: * * A %G_VARIANT_TYPE_VARDICT representing the parameters of the tube. * * Will be %NULL for outgoing tubes until the tube has been offered. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("parameters-vardict", "Parameters", "The parameters of the D-Bus tube", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_PARAMETERS_VARDICT, param_spec); g_type_class_add_private (gobject_class, sizeof (TpDBusTubeChannelPrivate)); } static void tp_dbus_tube_channel_init (TpDBusTubeChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_DBUS_TUBE_CHANNEL, TpDBusTubeChannelPrivate); } TpDBusTubeChannel * _tp_dbus_tube_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; return g_object_new (TP_TYPE_DBUS_TUBE_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL); } /** * tp_dbus_tube_channel_get_service_name: * @self: a #TpDBusTubeChannel * * Return the #TpDBusTubeChannel:service-name property * * Returns: (transfer none): the value of #TpDBusTubeChannel:service-name * * Since: 0.18.0 */ const gchar * tp_dbus_tube_channel_get_service_name (TpDBusTubeChannel *self) { GHashTable *props; props = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); return tp_asv_get_string (props, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME); } /** * tp_dbus_tube_channel_get_parameters: (skip) * @self: a #TpDBusTubeChannel * * Return the #TpDBusTubeChannel:parameters property * * Returns: (transfer none) (element-type utf8 GObject.Value): * the value of #TpDBusTubeChannel:parameters * * Since: 0.18.0 */ GHashTable * tp_dbus_tube_channel_get_parameters (TpDBusTubeChannel *self) { return self->priv->parameters; } /** * tp_dbus_tube_channel_dup_parameters_vardict: * @self: a #TpDBusTubeChannel * * Return the parameters of the dbus-tube channel in a variant of * type %G_VARIANT_TYPE_VARDICT whose keys are strings representing * parameter names and values are variants representing corresponding * parameter values set by the offerer when offering this channel. * * The GVariant returned is %NULL if this is an outgoing tube that has not * yet been offered or the parameters property has not been set. * * Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() * and similar functions for convenient access to the values. * * Returns: (transfer full): a new reference to a #GVariant * * Since: 0.19.10 */ GVariant * tp_dbus_tube_channel_dup_parameters_vardict (TpDBusTubeChannel *self) { g_return_val_if_fail (TP_IS_DBUS_TUBE_CHANNEL (self), NULL); if (self->priv->parameters == NULL) return NULL; return _tp_asv_to_vardict (self->priv->parameters); } /** * TP_DBUS_TUBE_CHANNEL_FEATURE_CORE: * * Expands to a call to a function that returns a quark representing the * core feature of a #TpDBusTubeChannel. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.18.0 */ GQuark tp_dbus_tube_channel_feature_quark_core (void) { return g_quark_from_static_string ("tp-dbus-tube-channel-feature-core"); } static void dbus_tube_offer_cb (TpChannel *channel, const gchar *address, const GError *error, gpointer user_data, GObject *weak_object) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) channel; if (error != NULL) { DEBUG ("Offer() failed: %s", error->message); g_simple_async_result_set_from_error (self->priv->result, error); complete_operation (self); return; } self->priv->address = g_strdup (address); /* We have to wait that the tube is opened before being allowed to use it */ check_tube_open (self); } static void proxy_prepare_offer_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) source; GHashTable *params = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (source, result, &error)) { g_simple_async_result_take_error (self->priv->result, error); complete_operation (self); goto out; } if (self->priv->state != TP_TUBE_CHANNEL_STATE_NOT_OFFERED) { g_simple_async_result_set_error (self->priv->result, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the NotOffered state"); complete_operation (self); goto out; } g_assert (self->priv->parameters == NULL); if (params != NULL) self->priv->parameters = g_hash_table_ref (params); else self->priv->parameters = tp_asv_new (NULL, NULL); g_object_notify (G_OBJECT (self), "parameters"); g_object_notify (G_OBJECT (self), "parameters-vardict"); /* TODO: provide a way to use TP_SOCKET_ACCESS_CONTROL_LOCALHOST if you're in * an environment where you need to disable authentication. tp-glib can't * guess this for you. */ tp_cli_channel_type_dbus_tube_call_offer (TP_CHANNEL (self), -1, self->priv->parameters, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS, dbus_tube_offer_cb, NULL, NULL, G_OBJECT (self)); out: tp_clear_pointer (¶ms, g_hash_table_unref); } /** * tp_dbus_tube_channel_offer_async: * @self: an outgoing #TpDBusTubeChannel * @params: (allow-none) (transfer none): parameters of the tube, or %NULL * @callback: a callback to call when the tube has been offered * @user_data: data to pass to @callback * * Offer an outgoing D-Bus tube. When the tube has been offered and accepted * @callback will be called. You can then call * tp_dbus_tube_channel_offer_finish() to get the #GDBusConnection that will * be used to communicate through the tube. * * Since: 0.18.0 */ void tp_dbus_tube_channel_offer_async (TpDBusTubeChannel *self, GHashTable *params, GAsyncReadyCallback callback, gpointer user_data) { GQuark features[] = { TP_DBUS_TUBE_CHANNEL_FEATURE_CORE, 0 }; g_return_if_fail (TP_IS_DBUS_TUBE_CHANNEL (self)); g_return_if_fail (self->priv->result == NULL); g_return_if_fail (tp_channel_get_requested (TP_CHANNEL (self))); g_return_if_fail (self->priv->parameters == NULL); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_dbus_tube_channel_offer_async); /* We need CORE to be prepared as we rely on State changes */ tp_proxy_prepare_async (self, features, proxy_prepare_offer_cb, params != NULL ? g_hash_table_ref (params) : params); } /** * tp_dbus_tube_channel_offer_finish: * @self: a #TpDBusTubeChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes offering an outgoing D-Bus tube. The returned #GDBusConnection * is ready to be used to exchange data through the tube. * * Returns: (transfer full): a reference on a #GDBusConnection if the tube * has been successfully offered and opened; %NULL otherwise. * * Since: 0.18.0 */ GDBusConnection * tp_dbus_tube_channel_offer_finish (TpDBusTubeChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_dbus_tube_channel_offer_async, g_object_ref) } static void dbus_tube_accept_cb (TpChannel *channel, const gchar *address, const GError *error, gpointer user_data, GObject *weak_object) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) channel; if (error != NULL) { DEBUG ("Accept() failed: %s", error->message); g_simple_async_result_set_from_error (self->priv->result, error); complete_operation (self); return; } self->priv->address = g_strdup (address); /* We have to wait that the tube is opened before being allowed to use it */ check_tube_open (self); } static void proxy_prepare_accept_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpDBusTubeChannel *self = (TpDBusTubeChannel *) source; GError *error = NULL; if (!tp_proxy_prepare_finish (source, result, &error)) { g_simple_async_result_take_error (self->priv->result, error); complete_operation (self); return; } if (self->priv->state != TP_TUBE_CHANNEL_STATE_LOCAL_PENDING) { g_simple_async_result_set_error (self->priv->result, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube is not in the LocalPending state"); complete_operation (self); return; } /* TODO: provide a way to use TP_SOCKET_ACCESS_CONTROL_LOCALHOST if you're in * an environment where you need to disable authentication. tp-glib can't * guess this for you. */ tp_cli_channel_type_dbus_tube_call_accept (TP_CHANNEL (self), -1, TP_SOCKET_ACCESS_CONTROL_CREDENTIALS, dbus_tube_accept_cb, NULL, NULL, G_OBJECT (self)); } /** * tp_dbus_tube_channel_accept_async: * @self: an incoming #TpDBusTubeChannel * @callback: a callback to call when the tube has been offered * @user_data: data to pass to @callback * * Accept an incoming D-Bus tube. When the tube has been accepted * @callback will be called. You can then call * tp_dbus_tube_channel_accept_finish() to get the #GDBusConnection that will * be used to communicate through the tube. * * Since: 0.18.0 */ void tp_dbus_tube_channel_accept_async (TpDBusTubeChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GQuark features[] = { TP_DBUS_TUBE_CHANNEL_FEATURE_CORE, 0 }; g_return_if_fail (TP_IS_DBUS_TUBE_CHANNEL (self)); g_return_if_fail (self->priv->result == NULL); g_return_if_fail (!tp_channel_get_requested (TP_CHANNEL (self))); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_dbus_tube_channel_accept_async); /* We need CORE to be prepared as we rely on State changes */ tp_proxy_prepare_async (self, features, proxy_prepare_accept_cb, NULL); } /** * tp_dbus_tube_channel_accept_finish: * @self: a #TpDBusTubeChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes to accept an incoming D-Bus tube. The returned #GDBusConnection * is ready to be used to exchange data through the tube. * * Returns: (transfer full): a reference on a #GDBusConnection if the tube * has been successfully accepted and opened; %NULL otherwise. * * Since: 0.18.0 */ GDBusConnection * tp_dbus_tube_channel_accept_finish (TpDBusTubeChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_dbus_tube_channel_accept_async, g_object_ref) } telepathy-glib-0.24.2/telepathy-glib/dbus-tube-channel.h0000644000175000017500000000702412652510705020023 00000000000000/* * dbus-tube-channel.h - high level API for DBusTube channels * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DBUS_TUBE_CHANNEL_H__ #define __TP_DBUS_TUBE_CHANNEL_H__ #include #include G_BEGIN_DECLS #define TP_TYPE_DBUS_TUBE_CHANNEL (tp_dbus_tube_channel_get_type ()) #define TP_DBUS_TUBE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_DBUS_TUBE_CHANNEL, TpDBusTubeChannel)) #define TP_DBUS_TUBE_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_DBUS_TUBE_CHANNEL, TpDBusTubeChannelClass)) #define TP_IS_DBUS_TUBE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_DBUS_TUBE_CHANNEL)) #define TP_IS_DBUS_TUBE_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_DBUS_TUBE_CHANNEL)) #define TP_DBUS_TUBE_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DBUS_TUBE_CHANNEL, TpDBusTubeChannelClass)) typedef struct _TpDBusTubeChannel TpDBusTubeChannel; typedef struct _TpDBusTubeChannelClass TpDBusTubeChannelClass; typedef struct _TpDBusTubeChannelPrivate TpDBusTubeChannelPrivate; struct _TpDBusTubeChannel { /**/ TpChannel parent; TpDBusTubeChannelPrivate *priv; }; struct _TpDBusTubeChannelClass { /**/ TpChannelClass parent_class; GCallback _padding[7]; }; #define TP_DBUS_TUBE_CHANNEL_FEATURE_CORE \ tp_dbus_tube_channel_feature_quark_core () _TP_AVAILABLE_IN_0_18 GQuark tp_dbus_tube_channel_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 GType tp_dbus_tube_channel_get_type (void); _TP_AVAILABLE_IN_0_18 const gchar * tp_dbus_tube_channel_get_service_name (TpDBusTubeChannel *self); _TP_AVAILABLE_IN_0_18 GHashTable * tp_dbus_tube_channel_get_parameters (TpDBusTubeChannel *self); _TP_AVAILABLE_IN_0_20 GVariant * tp_dbus_tube_channel_dup_parameters_vardict (TpDBusTubeChannel *self); /* Outgoing tube methods */ _TP_AVAILABLE_IN_0_18 void tp_dbus_tube_channel_offer_async (TpDBusTubeChannel *self, GHashTable *params, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 GDBusConnection * tp_dbus_tube_channel_offer_finish (TpDBusTubeChannel *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; /* Incoming tube methods */ _TP_AVAILABLE_IN_0_18 void tp_dbus_tube_channel_accept_async (TpDBusTubeChannel *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 GDBusConnection * tp_dbus_tube_channel_accept_finish (TpDBusTubeChannel *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/debug-client.c0000644000175000017500000003363112652510705017063 00000000000000/* * debug-client.c - proxy for Telepathy debug objects * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_DEBUGGER #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/_gen/tp-cli-debug-body.h" /** * SECTION:debug-client * @title: TpDebugClient * @short_description: proxy objects for Telepathy debug information * @see_also: #TpProxy * * This module provides access to the auxiliary objects used to * implement #TpSvcDebug. * * Since: 0.19.0 */ /** * TpDebugClientClass: * * The class of a #TpDebugClient. * * Since: 0.19.0 */ struct _TpDebugClientClass { TpProxyClass parent_class; /**/ gpointer priv; }; /** * TpDebugClient: * * A proxy object for the debug interface of a Telepathy component. * * Since: 0.19.0 */ struct _TpDebugClient { TpProxy parent; /**/ TpDebugClientPrivate *priv; }; struct _TpDebugClientPrivate { gboolean enabled; }; static const TpProxyFeature *tp_debug_client_list_features ( TpProxyClass *klass); static void tp_debug_client_prepare_core (TpDebugClient *self); static void name_owner_changed_cb (TpDBusDaemon *bus, const gchar *name, const gchar *new_owner, gpointer user_data); G_DEFINE_TYPE (TpDebugClient, tp_debug_client, TP_TYPE_PROXY) enum { PROP_ENABLED = 1 }; enum { SIG_NEW_DEBUG_MESSAGE, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; static void tp_debug_client_init (TpDebugClient *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_DEBUG_CLIENT, TpDebugClientPrivate); } static void tp_debug_client_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpDebugClient *self = TP_DEBUG_CLIENT (object); switch (property_id) { case PROP_ENABLED: g_value_set_boolean (value, self->priv->enabled); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void new_debug_message_cb (TpDebugClient *self, gdouble timestamp, const gchar *domain, TpDebugLevel level, const gchar *message, gpointer user_data, GObject *weak_object) { TpDebugMessage *msg; msg = _tp_debug_message_new (timestamp, domain, level, message); g_signal_emit (self, signals[SIG_NEW_DEBUG_MESSAGE], 0, msg); g_object_unref (msg); } static void tp_debug_client_constructed (GObject *object) { TpDebugClient *self = TP_DEBUG_CLIENT (object); TpProxy *proxy = TP_PROXY (object); GObjectClass *parent_class = G_OBJECT_CLASS (tp_debug_client_parent_class); GError *error = NULL; if (parent_class->constructed != NULL) parent_class->constructed (object); tp_dbus_daemon_watch_name_owner ( tp_proxy_get_dbus_daemon (proxy), tp_proxy_get_bus_name (proxy), name_owner_changed_cb, object, NULL); tp_debug_client_prepare_core (self); if (!tp_cli_debug_connect_to_new_debug_message (self, new_debug_message_cb, NULL, NULL, NULL, &error)) { WARNING ("Failed to connect to NewDebugMessage: %s", error->message); g_error_free (error); } } static void tp_debug_client_dispose (GObject *object) { TpProxy *proxy = TP_PROXY (object); GObjectClass *parent_class = G_OBJECT_CLASS (tp_debug_client_parent_class); tp_dbus_daemon_cancel_name_owner_watch ( tp_proxy_get_dbus_daemon (proxy), tp_proxy_get_bus_name (proxy), name_owner_changed_cb, object); if (parent_class->dispose != NULL) parent_class->dispose (object); } static void tp_debug_client_class_init (TpDebugClientClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpProxyClass *proxy_class = (TpProxyClass *) klass; GParamSpec *spec; object_class->get_property = tp_debug_client_get_property; object_class->constructed = tp_debug_client_constructed; object_class->dispose = tp_debug_client_dispose; proxy_class->must_have_unique_name = TRUE; proxy_class->interface = TP_IFACE_QUARK_DEBUG; proxy_class->list_features = tp_debug_client_list_features; /** * TpDebugClient:enabled: * * %TRUE if debug messages are published on the bus. * * This property is meaningless until the * %TP_DEBUG_CLIENT_FEATURE_CORE feature has been prepared. * * Since: 0.19.0 */ spec = g_param_spec_boolean ("enabled", "enabled", "Enabled", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ENABLED, spec); /** * TpDebugClient::new-debug-message: * @self: a #TpDebugClient * @message: a #TpDebugMessage * * Emitted when a #TpDebugMessage is generated if the TpDebugMessage:enabled * property is set to %TRUE. * * Since: 0.19.0 */ signals[SIG_NEW_DEBUG_MESSAGE] = g_signal_new ("new-debug-message", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_DEBUG_MESSAGE); g_type_class_add_private (klass, sizeof (TpDebugClientPrivate)); tp_debug_client_init_known_interfaces (); } GQuark tp_debug_client_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-debug-client-feature-core"); } static void name_owner_changed_cb ( TpDBusDaemon *bus, const gchar *name, const gchar *new_owner, gpointer user_data) { TpDebugClient *self = TP_DEBUG_CLIENT (user_data); if (tp_str_empty (new_owner)) { GError *error = g_error_new (TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "%s fell off the bus", name); DEBUG ("%s fell off the bus", name); tp_proxy_invalidate (TP_PROXY (self), error); g_error_free (error); } } static void got_enabled_cb ( TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpDebugClient *self = TP_DEBUG_CLIENT (proxy); if (error != NULL) { tp_proxy_invalidate (proxy, error); } else if (!G_VALUE_HOLDS_BOOLEAN (value)) { GError *e = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "this service doesn't implement the Debug interface correctly " "(the Enabled property is not a boolean, but a %s)", G_VALUE_TYPE_NAME (value)); tp_proxy_invalidate (proxy, e); g_error_free (e); } else { self->priv->enabled = g_value_get_boolean (value); /* FIXME: we have no change notification for Enabled. */ _tp_proxy_set_feature_prepared (proxy, TP_DEBUG_CLIENT_FEATURE_CORE, TRUE); } } static void tp_debug_client_prepare_core (TpDebugClient *self) { tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_DEBUG, "Enabled", got_enabled_cb, NULL, NULL, NULL); } static const TpProxyFeature * tp_debug_client_list_features (TpProxyClass *klass) { static gsize once = 0; static TpProxyFeature features[] = { { 0, TRUE }, { 0 } }; if (g_once_init_enter (&once)) { features[0].name = TP_DEBUG_CLIENT_FEATURE_CORE; g_once_init_leave (&once, 1); } return features; } /** * tp_debug_client_init_known_interfaces: * * Ensure that the known interfaces for TpDebugClient have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_DEBUG_CLIENT. * * Since: 0.19.0 */ void tp_debug_client_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_DEBUG_CLIENT; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_debug_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_debug_client_new: * @dbus: a D-Bus daemon; may not be %NULL * @unique_name: the unique name of the process to be debugged; may not be * %NULL or a well-known name * @error: used to raise an error if @unique_name is not valid * * * * Returns: a new debug client proxy, or %NULL on invalid arguments * * Since: 0.19.0 */ TpDebugClient * tp_debug_client_new ( TpDBusDaemon *dbus, const gchar *unique_name, GError **error) { if (!tp_dbus_check_valid_bus_name (unique_name, TP_DBUS_NAME_TYPE_UNIQUE, error)) return NULL; return TP_DEBUG_CLIENT (g_object_new (TP_TYPE_DEBUG_CLIENT, "dbus-daemon", dbus, "bus-name", unique_name, "object-path", TP_DEBUG_OBJECT_PATH, NULL)); } static void set_enabled_cb ( TpProxy *proxy, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); if (error != NULL) g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete (result); } /** * tp_debug_client_set_enabled_async: * @self: a #TpDebugClient * @enabled: %TRUE if debug messages should be published on the bus, %FALSE * otherwise * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Enable or disable publishing of debug messages on the bus by the component * owning @self's bus name. * * Since: 0.19.0 */ void tp_debug_client_set_enabled_async ( TpDebugClient *self, gboolean enabled, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_debug_client_set_enabled_async); GValue v = { 0, }; g_value_init (&v, G_TYPE_BOOLEAN); g_value_set_boolean (&v, enabled); tp_cli_dbus_properties_call_set (self, -1, TP_IFACE_DEBUG, "Enabled", &v, set_enabled_cb, result, g_object_unref, NULL); g_value_unset (&v); } /** * tp_debug_client_set_enabled_finish: * @self: a #TpDebugClient * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_debug_client_set_enabled_async(). * * Returns: %TRUE, if the operation suceeded, %FALSE otherwise * Since: 0.19.0 */ gboolean tp_debug_client_set_enabled_finish ( TpDebugClient *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_debug_client_set_enabled_async) } /** * tp_debug_client_is_enabled: * @self: a #TpDebugClient * * Return the #TpDebugClient:enabled property * * Returns: the value of #TpDebugClient:enabled property * * Since: 0.19.0 */ gboolean tp_debug_client_is_enabled (TpDebugClient *self) { return self->priv->enabled; } static void get_messages_cb (TpDebugClient *self, const GPtrArray *messages, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; guint i; GPtrArray *messages_arr; if (error != NULL) { DEBUG ("GetMessages() failed: %s", error->message); g_simple_async_result_set_from_error (result, error); goto out; } messages_arr = g_ptr_array_new_with_free_func (g_object_unref); for (i = 0; i < messages->len; i++) { TpDebugMessage *msg; gdouble timestamp; const gchar *domain, *message; TpDebugLevel level; tp_value_array_unpack (g_ptr_array_index (messages, i), 4, ×tamp, &domain, &level, &message); msg = _tp_debug_message_new (timestamp, domain, level, message); g_ptr_array_add (messages_arr, msg); } g_simple_async_result_set_op_res_gpointer (result, messages_arr, (GDestroyNotify) g_ptr_array_unref); out: g_simple_async_result_complete (result); } /** * tp_debug_client_get_messages_async: * @self: a #TpDebugClient * @callback: callback to call when the messages have been retrieved * @user_data: data to pass to @callback * * Retrieve buffered messages from @self. Once @callback is called, * use tp_debug_client_get_messages_finish() to retrieve the #TpDebugMessage * objects. * * Since: 0.19.0 */ void tp_debug_client_get_messages_async ( TpDebugClient *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_debug_client_set_enabled_async); tp_cli_debug_call_get_messages (self, -1, get_messages_cb, result, g_object_unref, NULL); } /** * tp_debug_client_get_messages_finish: * @self: a #TpDebugClient * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_debug_client_set_enabled_async(). * * Returns: (transfer container) (type GLib.PtrArray) (element-type TelepathyGLib.DebugMessage): * a #GPtrArray of #TpDebugMessage, free with g_ptr_array_unref() * * Since: 0.19.0 */ GPtrArray * tp_debug_client_get_messages_finish (TpDebugClient *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_debug_client_set_enabled_async, g_ptr_array_ref) } telepathy-glib-0.24.2/telepathy-glib/debug-client.h0000644000175000017500000000650012652510705017063 00000000000000/* * debug-client.h - proxy for Telepathy debug objects * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_DEBUG_CLIENT_H #define TP_DEBUG_CLIENT_H #include #include #include G_BEGIN_DECLS typedef struct _TpDebugClient TpDebugClient; typedef struct _TpDebugClientPrivate TpDebugClientPrivate; typedef struct _TpDebugClientClass TpDebugClientClass; _TP_AVAILABLE_IN_0_20 TpDebugClient *tp_debug_client_new ( TpDBusDaemon *dbus, const gchar *unique_name, GError **error); #define TP_DEBUG_CLIENT_FEATURE_CORE \ (tp_debug_client_get_feature_quark_core ()) _TP_AVAILABLE_IN_0_20 GQuark tp_debug_client_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_20 void tp_debug_client_set_enabled_async ( TpDebugClient *self, gboolean enabled, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 gboolean tp_debug_client_set_enabled_finish ( TpDebugClient *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_20 gboolean tp_debug_client_is_enabled (TpDebugClient *self); /* Tedious GObject boilerplate */ _TP_AVAILABLE_IN_0_20 GType tp_debug_client_get_type (void); #define TP_TYPE_DEBUG_CLIENT \ (tp_debug_client_get_type ()) #define TP_DEBUG_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_DEBUG_CLIENT, \ TpDebugClient)) #define TP_DEBUG_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_DEBUG_CLIENT, \ TpDebugClientClass)) #define TP_IS_DEBUG_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_DEBUG_CLIENT)) #define TP_IS_DEBUG_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_DEBUG_CLIENT)) #define TP_DEBUG_CLIENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DEBUG_CLIENT, \ TpDebugClientClass)) _TP_AVAILABLE_IN_0_20 void tp_debug_client_init_known_interfaces (void); _TP_AVAILABLE_IN_0_20 void tp_debug_client_get_messages_async ( TpDebugClient *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 GPtrArray * tp_debug_client_get_messages_finish (TpDebugClient *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/abi.am0000644000175000017500000001157214006543533015427 00000000000000# To be included by Makefile.am. ABI_LISTS = \ versions/0.7.0.abi \ versions/0.7.1.abi \ versions/0.7.2.abi \ versions/0.7.3.abi \ versions/0.7.5.abi \ versions/0.7.6.abi \ versions/0.7.7.abi \ versions/0.7.8.abi \ versions/0.7.9.abi \ versions/0.7.10.abi \ versions/0.7.12.abi \ versions/0.7.13.abi \ versions/0.7.14.abi \ versions/0.7.15.abi \ versions/0.7.16.abi \ versions/0.7.17.abi \ versions/0.7.18.abi \ versions/0.7.19.abi \ versions/0.7.20.abi \ versions/0.7.21.abi \ versions/0.7.23.abi \ versions/0.7.24.abi \ versions/0.7.26.abi \ versions/0.7.27.abi \ versions/0.7.28.abi \ versions/0.7.29.abi \ versions/0.7.30.abi \ versions/0.7.31.abi \ versions/0.7.32.abi \ versions/0.7.34.abi \ versions/0.7.35.abi \ versions/0.7.36.abi \ versions/0.7.37.abi \ versions/0.9.0.abi \ versions/0.9.2.abi \ versions/0.11.0.abi \ versions/0.11.1.abi \ versions/0.11.3.abi \ versions/0.11.4.abi \ versions/0.11.5.abi \ versions/0.11.6.abi \ versions/0.11.7.abi \ versions/0.11.9.abi \ versions/0.11.11.abi \ versions/0.11.12.abi \ versions/0.11.13.abi \ versions/0.11.14.abi \ versions/0.11.15.abi \ versions/0.11.16.abi \ versions/0.13.0.abi \ versions/0.13.1.abi \ versions/0.13.2.abi \ versions/0.13.3.abi \ versions/0.13.4.abi \ versions/0.13.5.abi \ versions/0.13.7.abi \ versions/0.13.8.abi \ versions/0.13.9.abi \ versions/0.13.10.abi \ versions/0.13.11.abi \ versions/0.13.12.abi \ versions/0.13.13.abi \ versions/0.13.14.abi \ versions/0.13.15.abi \ versions/0.13.16.abi \ versions/0.14.1.abi \ versions/0.14.3.abi \ versions/0.14.4.abi \ versions/0.14.5.abi \ versions/0.15.0.abi \ versions/0.15.1.abi \ versions/0.15.2.abi \ versions/0.15.3.abi \ versions/0.15.5.abi \ versions/0.15.6.abi \ versions/0.15.8.abi \ versions/0.17.0.abi \ versions/0.17.1.abi \ versions/0.17.2.abi \ versions/0.17.3.abi \ versions/0.17.5.abi \ versions/0.17.6.abi \ versions/0.17.7.abi \ versions/0.18.0.abi \ versions/0.19.0.abi \ versions/0.19.1.abi \ versions/0.19.2.abi \ versions/0.19.3.abi \ versions/0.19.4.abi \ versions/0.19.6.abi \ versions/0.19.7.abi \ versions/0.19.8.abi \ versions/0.19.9.abi \ versions/0.19.10.abi \ versions/0.21.2.abi \ versions/0.23.0.abi \ versions/0.23.1.abi \ versions/0.23.2.abi \ versions/0.23.3.abi \ $(NULL) # The quoting here is unnecessary but harmless, and has the useful side-effect # that vim quickfix mode (:make) doesn't interpret the libtool --mode=link # command as an error message in a bizarrely named file libtelepathy_glib_la_LDFLAGS = \ $(AM_LDFLAGS) \ -no-undefined \ -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" libtelepathy_glib_la_LIBADD = libtelepathy-glib-internal.la nodist_libtelepathy_glib_la_SOURCES = libtelepathy_glib_la_DEPENDENCIES = libtelepathy-glib-internal.la abi.am if HAVE_LD_VERSION_SCRIPT nodist_libtelepathy_glib_la_SOURCES += _gen/version-script.txt libtelepathy_glib_la_DEPENDENCIES += _gen/version-script.txt _gen/abi.txt if OFFICIAL_RELEASE # don't allow undocumented ABI MAKE_VERSION_SCRIPT_FLAGS = else # allow new ABI, and silently put it in a dummy version (which can be used to # check whether binaries have been linked against unguaranteed ABI) MAKE_VERSION_SCRIPT_FLAGS = \ --unreleased-version=TELEPATHY_GLIB_@VERSION@_UNRELEASED endif _gen/version-script.txt: $(ABI_LISTS) _gen/abi.txt abi.am \ $(top_srcdir)/tools/make-version-script.py $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/make-version-script.py \ --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ $(ABI_LISTS:%=$(srcdir)/%) > $@ $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ --dpkg "libtelepathy-glib.so.0 libtelepathy-glib0 #MINVER#" \ --dpkg-build-depends-package "libtelepathy-glib-dev" \ $(ABI_LISTS:%=$(srcdir)/%) > _gen/libtelepathy-glib0.symbols sed -n -e "s/^[ ]*\\(tp_.*\\);/\\1/p" < $@ > _gen/versioned-abi.tmp sort -u < _gen/versioned-abi.tmp > _gen/versioned-abi.txt : # the versioned API should always match the ^tp API diff -c _gen/versioned-abi.txt _gen/abi.txt _gen/abi.txt: libtelepathy-glib-internal.la abi.am $(NM) .libs/libtelepathy-glib-internal.a > _gen/abi.nm grep " [DT] " < _gen/abi.nm > _gen/abi.funcs cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames $(AM_V_GEN)sort -u < _gen/abi.tpfuncnames > $@ libtelepathy_glib_la_LDFLAGS += \ $(VERSION_SCRIPT_ARG)=_gen/version-script.txt else # !HAVE_LD_VERSION_SCRIPT libtelepathy_glib_la_LDFLAGS += -export-symbols-regex '^tp' endif # !HAVE_LD_VERSION_SCRIPT # vim:set ft=automake: telepathy-glib-0.24.2/telepathy-glib/tls-certificate-rejection-internal.h0000644000175000017500000000217412652510705023400 00000000000000/* * tls-certificate-rejection-internal.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_TLS_CERTIFICATE_REJECTION_INTERNAL_H__ #define __TP_TLS_CERTIFICATE_REJECTION_INTERNAL_H__ TpTLSCertificateRejection * _tp_tls_certificate_rejection_new ( GError *error, TpTLSCertificateRejectReason reason, const gchar *dbus_error, GVariant *details); #endif telepathy-glib-0.24.2/telepathy-glib/capabilities.c0000644000175000017500000007706112652510705017157 00000000000000/* Object representing the capabilities a Connection or a Contact supports. * * Copyright (C) 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/capabilities.h" #include "telepathy-glib/capabilities-internal.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/variant-util-internal.h" /** * SECTION:capabilities * @title: TpCapabilities * @short_description: object representing capabilities * * #TpCapabilities objects represent the capabilities a #TpConnection * or a #TpContact supports. * * Since: 0.11.3 */ /** * TpCapabilities: * * An object representing capabilities a #TpConnection or #TpContact supports. * * Since: 0.11.3 */ struct _TpCapabilitiesClass { /**/ GObjectClass parent_class; }; struct _TpCapabilities { /**/ GObject parent; TpCapabilitiesPrivate *priv; }; G_DEFINE_TYPE (TpCapabilities, tp_capabilities, G_TYPE_OBJECT) enum { PROP_CHANNEL_CLASSES = 1, PROP_CONTACT_SPECIFIC, PROP_CHANNEL_CLASSES_VARIANT, N_PROPS }; struct _TpCapabilitiesPrivate { GPtrArray *classes; gboolean contact_specific; GVariant *classes_variant; }; /** * tp_capabilities_get_channel_classes: * @self: a #TpCapabilities object * * * * Returns: (transfer none) (element-type GHashTable): the same #GPtrArray as * the #TpCapabilities:channel-classes property * * Since: 0.11.3 */ GPtrArray * tp_capabilities_get_channel_classes (TpCapabilities *self) { g_return_val_if_fail (self != NULL, NULL); return self->priv->classes; } /** * tp_capabilities_is_specific_to_contact: * @self: a #TpCapabilities object * * * * Returns: the same #gboolean as the #TpCapabilities:contact-specific property * * Since: 0.11.3 */ gboolean tp_capabilities_is_specific_to_contact (TpCapabilities *self) { g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); return self->priv->contact_specific; } static void tp_capabilities_constructed (GObject *object) { void (*chain_up) (GObject *) = ((GObjectClass *) tp_capabilities_parent_class)->constructed; TpCapabilities *self = TP_CAPABILITIES (object); g_assert (self->priv->classes != NULL); if (chain_up != NULL) chain_up (object); } static void tp_capabilities_dispose (GObject *object) { TpCapabilities *self = TP_CAPABILITIES (object); if (self->priv->classes != NULL) { g_boxed_free (TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, self->priv->classes); self->priv->classes = NULL; } tp_clear_pointer (&self->priv->classes_variant, g_variant_unref); ((GObjectClass *) tp_capabilities_parent_class)->dispose (object); } static void tp_capabilities_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCapabilities *self = TP_CAPABILITIES (object); switch (property_id) { case PROP_CHANNEL_CLASSES: g_value_set_boxed (value, self->priv->classes); break; case PROP_CONTACT_SPECIFIC: g_value_set_boolean (value, self->priv->contact_specific); break; case PROP_CHANNEL_CLASSES_VARIANT: g_value_set_variant (value, self->priv->classes_variant); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_capabilities_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpCapabilities *self = TP_CAPABILITIES (object); switch (property_id) { case PROP_CHANNEL_CLASSES: self->priv->classes = g_value_dup_boxed (value); self->priv->classes_variant = _tp_boxed_to_variant ( TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, "a(a{sv}as)", self->priv->classes); break; case PROP_CONTACT_SPECIFIC: self->priv->contact_specific = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_capabilities_class_init (TpCapabilitiesClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpCapabilitiesPrivate)); object_class->get_property = tp_capabilities_get_property; object_class->set_property = tp_capabilities_set_property; object_class->constructed = tp_capabilities_constructed; object_class->dispose = tp_capabilities_dispose; /** * TpCapabilities:channel-classes: * * The underlying data structure used by Telepathy to represent the * requests that can succeed. * * This can be used by advanced clients to determine whether an unusually * complex request would succeed. See the Telepathy D-Bus API Specification * for details of how to interpret the returned #GPtrArray of * #TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS. * * The higher-level methods like * tp_capabilities_supports_text_chats() are likely to be more useful to * the majority of clients. */ param_spec = g_param_spec_boxed ("channel-classes", "GPtrArray of TP_STRUCT_TYPE_REQUESTABLE_CHANNEL_CLASS", "The channel classes supported", TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_CLASSES, param_spec); /** * TpCapabilities:contact-specific: * * Whether this object accurately describes the capabilities of a particular * contact, or if it's only a guess based on the capabilities of the * underlying connection. */ param_spec = g_param_spec_boolean ("contact-specific", "contact specific", "TRUE if this object describes the capabilities of a particular contact", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_SPECIFIC, param_spec); /** * TpCapabilities:channel-classes-variant: * * The underlying data structure used by Telepathy to represent the * requests that can succeed. * * This can be used by advanced clients to determine whether an unusually * complex request would succeed. See the Telepathy D-Bus API Specification * for details of how to interpret the returned #GVariant of type * a(a{sv}as). * * The higher-level methods like * tp_capabilities_supports_text_chats() are likely to be more useful to * the majority of clients. * * Since: 0.19.0 */ param_spec = g_param_spec_variant ("channel-classes-variant", "GVariant of type a(a{sv}as)", "The channel classes supported", G_VARIANT_TYPE ("a(a{sv}as)"), NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_CLASSES_VARIANT, param_spec); } static void tp_capabilities_init (TpCapabilities *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CAPABILITIES, TpCapabilitiesPrivate); } /* NULL-safe for @classes */ TpCapabilities * _tp_capabilities_new (const GPtrArray *classes, gboolean contact_specific) { GPtrArray *empty = NULL; TpCapabilities *self; if (classes == NULL) { empty = g_ptr_array_sized_new (0); classes = empty; } self = g_object_new (TP_TYPE_CAPABILITIES, "channel-classes", classes, "contact-specific", contact_specific, NULL); if (empty != NULL) g_ptr_array_unref (empty); return self; } static gboolean supports_simple_channel (TpCapabilities *self, const gchar *expected_chan_type, TpHandleType expected_handle_type) { guint i; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar * const *allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; tp_value_array_unpack (arr, 2, &fixed, &allowed); if (g_hash_table_size (fixed) != 2) continue; chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid) continue; if (!tp_strdiff (chan_type, expected_chan_type) && handle_type == expected_handle_type) return TRUE; } return FALSE; } /** * tp_capabilities_supports_text_chats: * @self: a #TpCapabilities object * * Return whether private text channels can be established by providing * a contact identifier, for instance by calling * tp_account_channel_request_new_text() followed by * tp_account_channel_request_set_target_contact(). * * If the protocol is such that text chats can be established, but only via a * more elaborate D-Bus API than normal (because more information is needed), * then this method will return %FALSE. * * Returns: %TRUE if a channel request containing Text as ChannelType, * HandleTypeContact as TargetHandleType and a contact identifier can be * expected to work, %FALSE otherwise. * * Since: 0.11.3 */ gboolean tp_capabilities_supports_text_chats (TpCapabilities *self) { return supports_simple_channel (self, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_CONTACT); } /** * tp_capabilities_supports_text_chatrooms: * @self: a #TpCapabilities object * * If the #TpCapabilities:contact-specific property is %FALSE, this function * checks if named text chatrooms can be joined by providing a chatroom * identifier, for instance by calling * tp_account_channel_request_new_text() followed by * tp_account_channel_request_set_target_id() with %TP_HANDLE_TYPE_ROOM. * * If the #TpCapabilities:contact-specific property is %TRUE, this function * checks if the contact associated with this #TpCapabilities can be invited * to named text chatrooms. * * If the protocol is such that chatrooms can be joined or contacts can be * invited, but only via a more elaborate D-Bus API than normal * (because more information is needed), then this method will return %FALSE. * * Returns: %TRUE if a channel request containing Text as ChannelType, * HandleTypeRoom as TargetHandleType and a channel identifier can be * expected to work, %FALSE otherwise. * * Since: 0.11.3 */ gboolean tp_capabilities_supports_text_chatrooms (TpCapabilities *self) { return supports_simple_channel (self, TP_IFACE_CHANNEL_TYPE_TEXT, TP_HANDLE_TYPE_ROOM); } /** * tp_capabilities_supports_sms: * @self: a #TpCapabilities object * * If the #TpCapabilities:contact-specific property is %FALSE, this function * checks if SMS text channels can be requested with the connection associated * with this #TpCapabilities. * * If the #TpCapabilities:contact-specific property is %TRUE, this function * checks if the contact associated with this #TpCapabilities supports * SMS text channels. * * Returns: %TRUE if a channel request containing Text as ChannelType, * HandleTypeContact as TargetHandleType, a channel identifier and * #TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL set to %TRUE can be * expected to work, %FALSE otherwise. * * Since: 0.19.0 */ gboolean tp_capabilities_supports_sms (TpCapabilities *self) { guint i; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar * const *allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; guint nb_fixed_props; tp_value_array_unpack (arr, 2, &fixed, &allowed); handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid) continue; if (handle_type != TP_HANDLE_TYPE_CONTACT) continue; chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_TEXT)) continue; /* SMSChannel be either in fixed or allowed properties */ if (tp_asv_get_boolean (fixed, TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL)) { /* In fixed, succeed if there is no more fixed properties required */ nb_fixed_props = 3; } else { /* Not in fixed; check allowed */ if (!tp_strv_contains (allowed, TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL)) continue; nb_fixed_props = 2; } if (g_hash_table_size (fixed) == nb_fixed_props) return TRUE; } return FALSE; } static gboolean supports_call_full (TpCapabilities *self, TpHandleType expected_handle_type, gboolean expected_initial_audio, gboolean expected_initial_video) { guint i; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed_prop; const gchar * const *allowed_prop; const gchar *chan_type; TpHandleType handle_type; gboolean valid; guint nb_fixed_props = 2; tp_value_array_unpack (arr, 2, &fixed_prop, &allowed_prop); chan_type = tp_asv_get_string (fixed_prop, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_CALL)) continue; handle_type = tp_asv_get_uint32 (fixed_prop, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid || handle_type != expected_handle_type) continue; if (expected_initial_audio) { /* We want audio, INITIAL_AUDIO must be in either fixed or allowed */ if (tp_asv_get_boolean (fixed_prop, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL)) { nb_fixed_props++; } else if (!tp_strv_contains (allowed_prop, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO)) { continue; } } if (expected_initial_video) { /* We want video, INITIAL_VIDEO must be in either fixed or allowed */ if (tp_asv_get_boolean (fixed_prop, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL)) { nb_fixed_props++; } else if (!tp_strv_contains (allowed_prop, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO)) { continue; } } /* We found the right class */ if (g_hash_table_size (fixed_prop) == nb_fixed_props) return TRUE; } return FALSE; } /** * tp_capabilities_supports_audio_call: * @self: a #TpCapabilities object * @handle_type: the handle type of the call; #TP_HANDLE_TYPE_CONTACT for * private, #TP_HANDLE_TYPE_ROOM or #TP_HANDLE_TYPE_NONE for conference * (depending on the protocol) * * Return whether audio calls can be established, for instance by calling * tp_account_channel_request_new_audio_call(), followed by * tp_account_channel_request_set_target_id() with @handle_type. * * To check whether requests using * tp_account_channel_request_set_target_contact() would work, set * @handle_type to %TP_HANDLE_TYPE_CONTACT. * * Returns: %TRUE if a channel request containing Call as ChannelType, * @handle_type as TargetHandleType, a True value for InitialAudio and an * identifier of the appropriate type can be expected to work, %FALSE otherwise. * * Since: 0.17.6 */ gboolean tp_capabilities_supports_audio_call (TpCapabilities *self, TpHandleType handle_type) { return supports_call_full (self, handle_type, TRUE, FALSE); } /** * tp_capabilities_supports_audio_video_call: * @self: a #TpCapabilities object * @handle_type: the handle type of the call; #TP_HANDLE_TYPE_CONTACT for * private, #TP_HANDLE_TYPE_ROOM or #TP_HANDLE_TYPE_NONE for conference * (depending on the protocol) * * Return whether audio/video calls can be established, for instance by calling * tp_account_channel_request_new_audio_video_call(), followed by * tp_account_channel_request_set_target_id() with @handle_type. * * To check whether requests using * tp_account_channel_request_set_target_contact() would work, set * @handle_type to %TP_HANDLE_TYPE_CONTACT. * * Returns: %TRUE if a channel request containing Call as ChannelType, * @handle_type as TargetHandleType, a True value for * InitialAudio/InitialVideo and an identifier of the appropriate type can be * expected to work, * %FALSE otherwise. * * Since: 0.17.6 */ gboolean tp_capabilities_supports_audio_video_call (TpCapabilities *self, TpHandleType handle_type) { return supports_call_full (self, handle_type, TRUE, TRUE); } typedef enum { FT_CAP_FLAGS_NONE = 0, FT_CAP_FLAG_URI = (1<<0), FT_CAP_FLAG_OFFSET = (1<<1), FT_CAP_FLAG_DATE = (1<<2), FT_CAP_FLAG_DESCRIPTION = (1<<3) } FTCapFlags; static gboolean supports_file_transfer (TpCapabilities *self, FTCapFlags flags) { guint i; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; guint n_fixed = 2; const gchar * const *allowed; tp_value_array_unpack (arr, 2, &fixed, &allowed); chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) continue; handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid) continue; if (handle_type != TP_HANDLE_TYPE_CONTACT) continue; /* ContentType, Filename, Size are mandatory. In principle we could check * that the CM allows them, but not allowing them would be ridiculous, * so we don't. */ if ((flags & FT_CAP_FLAG_DESCRIPTION) != 0) { /* Description makes no sense as a fixed property so we assume * the CM won't be ridiculous */ if (!tp_strv_contains (allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION)) continue; } if ((flags & FT_CAP_FLAG_DATE) != 0) { /* makes no sense as a fixed property */ if (!tp_strv_contains (allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE)) continue; } if ((flags & FT_CAP_FLAG_URI) != 0) { /* makes no sense as a fixed property */ if (!tp_strv_contains (allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI)) continue; } if ((flags & FT_CAP_FLAG_OFFSET) != 0) { /* makes no sense as a fixed property */ if (!tp_strv_contains (allowed, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET)) continue; } if (n_fixed != tp_asv_size (fixed)) continue; return TRUE; } return FALSE; } /** * tp_capabilities_supports_file_transfer: * @self: a #TpCapabilities object * * Return whether private file transfer can be established by providing * a contact identifier. * * Returns: %TRUE if a channel request containing FileTransfer as ChannelType, * HandleTypeContact as TargetHandleType and a contact identifier can be * expected to work, %FALSE otherwise. * * Since: 0.17.6 */ gboolean tp_capabilities_supports_file_transfer (TpCapabilities *self) { return supports_file_transfer (self, FT_CAP_FLAGS_NONE); } /** * tp_capabilities_supports_file_transfer_uri: * @self: a #TpCapabilities object * * * * Returns: %TRUE if requests as described for * tp_capabilities_supports_file_transfer() can also specify the outgoing * file's URI * * Since: 0.19.0 */ gboolean tp_capabilities_supports_file_transfer_uri (TpCapabilities *self) { return supports_file_transfer (self, FT_CAP_FLAG_URI); } /** * tp_capabilities_supports_file_transfer_description: * @self: a #TpCapabilities object * * * * Returns: %TRUE if requests as described for * tp_capabilities_supports_file_transfer() can also specify the outgoing * file's description * * Since: 0.19.0 */ gboolean tp_capabilities_supports_file_transfer_description (TpCapabilities *self) { return supports_file_transfer (self, FT_CAP_FLAG_DESCRIPTION); } /** * tp_capabilities_supports_file_transfer_initial_offset: * @self: a #TpCapabilities object * * Return whether an initial offset other than 0 can be specified on * outgoing file transfers. This can be used to resume partial transfers, * by omitting the part that has already been sent. * * Returns: %TRUE if requests as described for * tp_capabilities_supports_file_transfer() can also specify an * initial offset greater than 0 * * Since: 0.19.0 */ gboolean tp_capabilities_supports_file_transfer_initial_offset (TpCapabilities *self) { return supports_file_transfer (self, FT_CAP_FLAG_OFFSET); } /** * tp_capabilities_supports_file_transfer_timestamp: * @self: a #TpCapabilities object * * * * Returns: %TRUE if requests as described for * tp_capabilities_supports_file_transfer() can also specify the outgoing * file's timestamp * * Since: 0.19.0 */ gboolean tp_capabilities_supports_file_transfer_timestamp (TpCapabilities *self) { return supports_file_transfer (self, FT_CAP_FLAG_DATE); } static gboolean tp_capabilities_supports_tubes_common (TpCapabilities *self, const gchar *expected_channel_type, TpHandleType expected_handle_type, const gchar *service_prop, const gchar *expected_service) { guint i; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); g_return_val_if_fail (expected_handle_type == TP_HANDLE_TYPE_CONTACT || expected_handle_type == TP_HANDLE_TYPE_ROOM, FALSE); for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar * const *allowed; const gchar *chan_type; TpHandleType handle_type; gboolean valid; guint nb_fixed_props = 2; tp_value_array_unpack (arr, 2, &fixed, &allowed); chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, expected_channel_type)) continue; handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid || handle_type != expected_handle_type) continue; if (expected_service != NULL && self->priv->contact_specific) { const gchar *service; nb_fixed_props++; service = tp_asv_get_string (fixed, service_prop); if (tp_strdiff (service, expected_service)) continue; } if (g_hash_table_size (fixed) == nb_fixed_props) return TRUE; } return FALSE; } /** * tp_capabilities_supports_stream_tubes: * @self: a #TpCapabilities object * @handle_type: the handle type of the tube (either #TP_HANDLE_TYPE_CONTACT * or #TP_HANDLE_TYPE_ROOM) * @service: the service of the tube, or %NULL * * If the #TpCapabilities:contact-specific property is %TRUE, this function * checks if the contact associated with this #TpCapabilities supports * stream tubes with @handle_type as TargetHandleType. * If @service is not %NULL, it also checks if it supports stream tubes * with @service as #TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE. * * If the #TpCapabilities:contact-specific property is %FALSE, this function * checks if the connection supports requesting stream tube channels with * @handle_type as ChannelType. The @service argument is unused in this case. * * Returns: %TRUE if the contact or connection supports this type of stream * tubes. * * Since: 0.13.0 */ gboolean tp_capabilities_supports_stream_tubes (TpCapabilities *self, TpHandleType handle_type, const gchar *service) { return tp_capabilities_supports_tubes_common (self, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, handle_type, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, service); } /** * tp_capabilities_supports_dbus_tubes: * @self: a #TpCapabilities object * @handle_type: the handle type of the tube (either #TP_HANDLE_TYPE_CONTACT * or #TP_HANDLE_TYPE_ROOM) * @service_name: the service name of the tube, or %NULL * * If the #TpCapabilities:contact-specific property is %TRUE, this function * checks if the contact associated with this #TpCapabilities supports * D-Bus tubes with @handle_type as TargetHandleType. * If @service_name is not %NULL, it also checks if it supports stream tubes * with @service as #TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME. * * If the #TpCapabilities:contact-specific property is %FALSE, this function * checks if the connection supports requesting D-Bus tube channels with * @handle_type as ChannelType. The @service_name argument is unused in * this case. * * Returns: %TRUE if the contact or connection supports this type of D-Bus * tubes. * * Since: 0.13.0 */ gboolean tp_capabilities_supports_dbus_tubes (TpCapabilities *self, TpHandleType handle_type, const gchar *service_name) { return tp_capabilities_supports_tubes_common (self, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, handle_type, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, service_name); } /** * tp_capabilities_supports_contact_search: * @self: a #TpCapabilities object * @with_limit: (out): if not %NULL, used to return %TRUE if the limit * parameter to tp_contact_search_new_async() and * tp_contact_search_reset_async() can be nonzero * @with_server: (out): if not %NULL, used to return %TRUE if the server * parameter to tp_contact_search_new_async() and * tp_contact_search_reset_async() can be non-%NULL * * Return whether this protocol or connection can perform contact * searches. Optionally, also return whether a limited number of * results can be specified, and whether alternative servers can be * searched. * * Returns: %TRUE if #TpContactSearch can be used. * * Since: 0.13.11 */ gboolean tp_capabilities_supports_contact_search (TpCapabilities *self, gboolean *with_limit, gboolean *with_server) { gboolean ret = FALSE; guint i, j; g_return_val_if_fail (TP_IS_CAPABILITIES (self), FALSE); if (with_limit) *with_limit = FALSE; if (with_server) *with_server = FALSE; for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar *chan_type; const gchar **allowed_properties; tp_value_array_unpack (arr, 2, &fixed, &allowed_properties); /* ContactSearch channel should have ChannelType and TargetHandleType=NONE * but CM implementations are wrong and omitted TargetHandleType, * so it's set in stone now. */ if (g_hash_table_size (fixed) != 1) continue; chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH)) continue; ret = TRUE; for (j = 0; allowed_properties[j] != NULL; j++) { if (with_limit) { if (!tp_strdiff (allowed_properties[j], TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_LIMIT)) *with_limit = TRUE; } if (with_server) { if (!tp_strdiff (allowed_properties[j], TP_PROP_CHANNEL_TYPE_CONTACT_SEARCH_SERVER)) *with_server = TRUE; } } } return ret; } /** * tp_capabilities_supports_room_list: * @self: a #TpCapabilities object * @with_server: (out): if not %NULL, used to return %TRUE if the * #TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER property can be defined when * requesting a RoomList channel. * * Discovers whether this protocol or connection supports listing rooms. * Specifically, if this function returns %TRUE, a room list channel can be * requested as follows: * |[ * GHashTable *request; * TpAccountChannelRequest *req; * * request = tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, * TP_IFACE_CHANNEL_TYPE_ROOM_LIST, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE, * NULL); * * req = tp_account_channel_request_new (account, request, * TP_USER_ACTION_TIME_CURRENT_TIME); * * tp_account_channel_request_create_and_handle_channel_async (req, NULL, * create_channel_cb, NULL); * * g_object_unref (req); * g_hash_table_unref (request); * ]| * * If @with_server is set to %TRUE, a list of rooms on a particular server can * be requested as follows: * |[ * /\* Same code as above but with request defined using: *\/ * request = tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, * TP_IFACE_CHANNEL_TYPE_ROOM_LIST, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_NONE, * TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, G_TYPE_STRING, * "characters.shakespeare.lit", * NULL); * ]| * * Returns: %TRUE if a channel request containing RoomList as ChannelType, * HandleTypeNone as TargetHandleType can be expected to work, * %FALSE otherwise. * * Since: 0.13.14 */ gboolean tp_capabilities_supports_room_list (TpCapabilities *self, gboolean *with_server) { gboolean result = FALSE; gboolean server = FALSE; guint i; for (i = 0; i < self->priv->classes->len; i++) { GValueArray *arr = g_ptr_array_index (self->priv->classes, i); GHashTable *fixed; const gchar *chan_type; const gchar **allowed_properties; TpHandleType handle_type; gboolean valid; tp_value_array_unpack (arr, 2, &fixed, &allowed_properties); if (g_hash_table_size (fixed) != 2) continue; chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE); if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_ROOM_LIST)) continue; handle_type = tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); if (!valid || handle_type != TP_HANDLE_TYPE_NONE) continue; result = TRUE; server = tp_strv_contains (allowed_properties, TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER); break; } if (with_server != NULL) *with_server = server; return result; } /** * tp_capabilities_dup_channel_classes_variant: * @self: a #TpCapabilities * * Return the #TpCapabilities:channel-classes-variant property * * Returns: (transfer full): the value of the * #TpCapabilities:channel-classes-variant property * * Since: 0.19.0 */ GVariant * tp_capabilities_dup_channel_classes_variant (TpCapabilities *self) { return g_variant_ref (self->priv->classes_variant); } telepathy-glib-0.24.2/telepathy-glib/capabilities.h0000644000175000017500000000762412652510705017162 00000000000000/* Object representing the capabilities a Connection or a Contact supports. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CAPABILITIES_H__ #define __TP_CAPABILITIES_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpCapabilities TpCapabilities; typedef struct _TpCapabilitiesClass TpCapabilitiesClass; typedef struct _TpCapabilitiesPrivate TpCapabilitiesPrivate; _TP_AVAILABLE_IN_0_18 GType tp_capabilities_get_type (void) G_GNUC_CONST; #define TP_TYPE_CAPABILITIES \ (tp_capabilities_get_type ()) #define TP_CAPABILITIES(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CAPABILITIES, \ TpCapabilities)) #define TP_CAPABILITIES_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CAPABILITIES, \ TpCapabilitiesClass)) #define TP_IS_CAPABILITIES(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CAPABILITIES)) #define TP_IS_CAPABILITIES_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CAPABILITIES)) #define TP_CAPABILITIES_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CAPABILITIES, \ TpCapabilitiesClass)) GPtrArray * tp_capabilities_get_channel_classes (TpCapabilities *self); _TP_AVAILABLE_IN_0_20 GVariant * tp_capabilities_dup_channel_classes_variant (TpCapabilities *self); gboolean tp_capabilities_is_specific_to_contact (TpCapabilities *self); gboolean tp_capabilities_supports_text_chats (TpCapabilities *self); gboolean tp_capabilities_supports_text_chatrooms (TpCapabilities *self); _TP_AVAILABLE_IN_0_20 gboolean tp_capabilities_supports_sms (TpCapabilities *self); _TP_AVAILABLE_IN_0_18 gboolean tp_capabilities_supports_audio_call (TpCapabilities *self, TpHandleType handle_type); _TP_AVAILABLE_IN_0_18 gboolean tp_capabilities_supports_audio_video_call (TpCapabilities *self, TpHandleType handle_type); _TP_AVAILABLE_IN_0_18 gboolean tp_capabilities_supports_file_transfer (TpCapabilities *self); _TP_AVAILABLE_IN_0_20 gboolean tp_capabilities_supports_file_transfer_uri (TpCapabilities *self); _TP_AVAILABLE_IN_0_20 gboolean tp_capabilities_supports_file_transfer_description ( TpCapabilities *self); _TP_AVAILABLE_IN_0_20 gboolean tp_capabilities_supports_file_transfer_timestamp ( TpCapabilities *self); _TP_AVAILABLE_IN_0_20 gboolean tp_capabilities_supports_file_transfer_initial_offset ( TpCapabilities *self); gboolean tp_capabilities_supports_stream_tubes (TpCapabilities *self, TpHandleType handle_type, const gchar *service); gboolean tp_capabilities_supports_dbus_tubes (TpCapabilities *self, TpHandleType handle_type, const gchar *service_name); gboolean tp_capabilities_supports_contact_search (TpCapabilities *self, gboolean *with_limit, gboolean *with_server); gboolean tp_capabilities_supports_room_list (TpCapabilities *self, gboolean *with_server); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/handle.c0000644000175000017500000000313512652510705015750 00000000000000/* * handle.c - basic Telepathy-GLib handle functionality * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include /** * tp_handle_type_to_string: * @type: A handle type, which need not be valid * * * * Returns: a human-readable string describing the handle type, e.g. "contact". * For invalid handle types, returns "(no handle)" for 0 or * "(invalid handle type)" for others. */ const gchar * tp_handle_type_to_string (TpHandleType type) { switch (type) { case TP_HANDLE_TYPE_NONE: return "(no handle)"; case TP_HANDLE_TYPE_CONTACT: return "contact"; case TP_HANDLE_TYPE_ROOM: return "room"; case TP_HANDLE_TYPE_LIST: return "contact list"; case TP_HANDLE_TYPE_GROUP: return "group"; } return "(invalid handle type)"; } telepathy-glib-0.24.2/telepathy-glib/handle.h0000644000175000017500000000575412652510705015766 00000000000000/* * handle.h - Header for basic Telepathy-GLib handle functionality * * Copyright (C) 2005, 2007 Collabora Ltd. * Copyright (C) 2005, 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HANDLE_H__ #define __TP_HANDLE_H__ #include #include #include G_BEGIN_DECLS /** * TpHandle: * * Type representing Telepathy handles within telepathy-glib. * * This is guint despite the wire protocol having 32-bit integers, because * dbus-glib expects GArrays of guint and so on. If the dbus-glib ABI changes * in future, telepathy-glib is likely to have a matching ABI change. */ typedef guint TpHandle; /** * TP_TYPE_HANDLE: * * The GType of a TpHandle, currently G_TYPE_UINT. * * This won't change unless in an ABI-incompatible version of telepathy-glib. */ #define TP_TYPE_HANDLE G_TYPE_UINT /** * TP_UNKNOWN_HANDLE_TYPE: * * An invalid handle type (-1 cast to TpHandleType) used to represent an * unknown handle type. * * Since: 0.7.0 */ #define TP_UNKNOWN_HANDLE_TYPE ((TpHandleType) -1) /** * tp_handle_type_is_valid: * @type: A handle type, valid or not, to be checked * @error: Set if the handle type is invalid * * If the given handle type is valid, return %TRUE. If not, set @error * and return %FALSE. * * Returns: %TRUE if the handle type is valid. */ static inline /* spacer so gtkdoc documents this function as though not static */ gboolean tp_handle_type_is_valid (TpHandleType type, GError **error); /* Must be static inline because it references TP_NUM_HANDLE_TYPES - * if it wasn't inlined, a newer libtelepathy-glib with a larger number * of handle types might accept handle types that won't fit in the * connection manager's array of length TP_NUM_HANDLE_TYPES */ static inline gboolean tp_handle_type_is_valid (TpHandleType type, GError **error) { if (type > TP_HANDLE_TYPE_NONE && type < TP_NUM_HANDLE_TYPES) return TRUE; tp_g_set_error_invalid_handle_type (type, error); return FALSE; } const gchar *tp_handle_type_to_string (TpHandleType type); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/text-mixin.c0000644000175000017500000004647712652510705016643 00000000000000/* * text-mixin.c - Source for TpTextMixin * Copyright (C) 2006, 2007 Collabora Ltd. * Copyright (C) 2006, 2007 Nokia Corporation * @author Ole Andre Vadla Ravnaas * @author Robert McQueen * @author Senko Rasic * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:text-mixin * @title: TpTextMixin * @short_description: a mixin implementation of the text channel type * @see_also: #TpSvcChannelTypeText * * This mixin can be added to a channel GObject class to implement the * text channel type in a general way. It implements the pending message * queue and GetMessageTypes, so the implementation should only need to * implement Send. * * To use the text mixin, include a #TpTextMixinClass somewhere in your * class structure and a #TpTextMixin somewhere in your instance structure, * and call tp_text_mixin_class_init() from your class_init function, * tp_text_mixin_init() from your init function or constructor, and * tp_text_mixin_finalize() from your dispose or finalize function. * * To use the text mixin as the implementation of * #TpSvcChannelTypeText, in the function you pass to G_IMPLEMENT_INTERFACE, * you should first call tp_text_mixin_iface_init(), then call * tp_svc_channel_type_text_implement_send() to register your implementation * of the Send method. * * Deprecated: Use #TpMessageMixin instead. */ #include "config.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_IM #include "debug-internal.h" /* Deprecated module can use deprecated APIs */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS struct _TpTextMixinPrivate { TpHandleRepoIface *contacts_repo; guint recv_id; gboolean message_lost; GQueue *pending; GArray *msg_types; }; /* pending message */ /* * _PendingMessage: * @id: The message ID * @timestamp: The Unix time at which the message was received * @sender: The contact handle of the sender * @type: The message type * @text: The message itself * @flags: The message's flags * * Represents a message in the pending messages queue. */ typedef struct { guint id; guint timestamp; TpHandle sender; TpChannelTextMessageType type; char *text; guint flags; } _PendingMessage; /** * tp_text_mixin_class_get_offset_quark: * * * * Returns: the quark used for storing mixin offset on a GObjectClass * Deprecated: Use #TpMessageMixin instead. */ GQuark tp_text_mixin_class_get_offset_quark () { static GQuark offset_quark = 0; if (G_UNLIKELY (offset_quark == 0)) offset_quark = g_quark_from_static_string ("TpTextMixinClassOffsetQuark"); return offset_quark; } /** * tp_text_mixin_get_offset_quark: * * * * Returns: the quark used for storing mixin offset on a GObject * Deprecated: Use #TpMessageMixin instead. */ GQuark tp_text_mixin_get_offset_quark () { static GQuark offset_quark = 0; if (G_UNLIKELY (offset_quark == 0)) offset_quark = g_quark_from_static_string ("TpTextMixinOffsetQuark"); return offset_quark; } /** * tp_text_mixin_class_init: * @obj_cls: The class of the implementation that uses this mixin * @offset: The byte offset of the TpTextMixinClass within the class structure * * Initialize the text mixin. Should be called from the implementation's * class_init function like so: * * * tp_text_mixin_class_init ((GObjectClass *) klass, * G_STRUCT_OFFSET (SomeObjectClass, text_mixin)); * * * Deprecated: Use #TpMessageMixin instead. */ void tp_text_mixin_class_init (GObjectClass *obj_cls, glong offset) { TpTextMixinClass *mixin_cls; g_assert (G_IS_OBJECT_CLASS (obj_cls)); g_type_set_qdata (G_OBJECT_CLASS_TYPE (obj_cls), TP_TEXT_MIXIN_CLASS_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin_cls = TP_TEXT_MIXIN_CLASS (obj_cls); g_return_if_fail (mixin_cls != NULL); } /** * tp_text_mixin_init: * @obj: An instance of the implementation that uses this mixin * @offset: The byte offset of the TpTextMixin within the object structure * @contacts_repo: The connection's %TP_HANDLE_TYPE_CONTACT repository * * Initialize the text mixin. Should be called from the implementation's * instance init function like so: * * * tp_text_mixin_init ((GObject *) self, * G_STRUCT_OFFSET (SomeObject, text_mixin), * self->contact_repo); * * * Deprecated: Use tp_message_mixin_init() instead. */ void tp_text_mixin_init (GObject *obj, glong offset, TpHandleRepoIface *contacts_repo) { TpTextMixin *mixin; g_assert (G_IS_OBJECT (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_TEXT_MIXIN_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin = TP_TEXT_MIXIN (obj); mixin->priv = g_slice_new0 (TpTextMixinPrivate); mixin->priv->pending = g_queue_new (); mixin->priv->contacts_repo = contacts_repo; mixin->priv->recv_id = 0; mixin->priv->msg_types = g_array_sized_new (FALSE, FALSE, sizeof (guint), 4); mixin->priv->message_lost = FALSE; } /** * tp_text_mixin_set_message_types: * @obj: An object with this mixin * @...: guints representing members of #TpChannelTextMessageType, terminated * by G_MAXUINT * * Set the supported message types. * * Deprecated: Use #TpMessageMixin instead. */ void tp_text_mixin_set_message_types (GObject *obj, ...) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); va_list args; guint type; va_start (args, obj); while ((type = va_arg (args, guint)) != G_MAXUINT) g_array_append_val (mixin->priv->msg_types, type); va_end (args); } static inline _PendingMessage * _pending_new0 (void) { return g_slice_new0 (_PendingMessage); } /** * _pending_free * * Free up a _PendingMessage struct. */ static void _pending_free (_PendingMessage *msg, TpHandleRepoIface *contacts_repo) { g_free (msg->text); tp_handle_unref (contacts_repo, msg->sender); g_slice_free (_PendingMessage, msg); } /** * tp_text_mixin_finalize: * @obj: An object with this mixin. * * Free resources held by the text mixin. * * Deprecated: Use tp_message_mixin_finalize() instead. */ void tp_text_mixin_finalize (GObject *obj) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); DEBUG ("%p", obj); /* free any data held directly by the object here */ tp_text_mixin_clear (obj); g_queue_free (mixin->priv->pending); g_array_unref (mixin->priv->msg_types); g_slice_free (TpTextMixinPrivate, mixin->priv); } /** * tp_text_mixin_receive_with_flags: * @obj: An object with the text mixin * @type: The type of message received from the underlying protocol * @sender: The handle of the message sender * @timestamp: The time the message was received * @text: The text of the message * @flags: the message's flags * * Add a message to the pending queue and emit Received. * * Returns: %TRUE on success; %FALSE if the message was lost due to the memory * limit. * * Deprecated: Use tp_message_mixin_take_received() instead. */ gboolean tp_text_mixin_receive_with_flags (GObject *obj, TpChannelTextMessageType type, TpHandle sender, time_t timestamp, const char *text, TpChannelTextMessageFlags flags) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); _PendingMessage *msg; size_t len; msg = _pending_new0 (); msg->sender = tp_handle_ref (mixin->priv->contacts_repo, sender); /* FIXME: we don't check for overflow, so in highly pathological cases we * might end up with multiple messages with the same ID */ msg->id = mixin->priv->recv_id++; msg->timestamp = timestamp; msg->type = type; msg->flags = flags; len = strlen (text); msg->text = g_try_malloc (len + 1); if (msg->text == NULL) { DEBUG ("unable to copy message, giving up"); if (!mixin->priv->message_lost) { tp_svc_channel_type_text_emit_lost_message (obj); mixin->priv->message_lost = TRUE; } _pending_free (msg, mixin->priv->contacts_repo); return FALSE; } g_strlcpy (msg->text, text, len + 1); g_queue_push_tail (mixin->priv->pending, msg); tp_svc_channel_type_text_emit_received (obj, msg->id, msg->timestamp, msg->sender, msg->type, msg->flags, msg->text); DEBUG ("queued message %u", msg->id); mixin->priv->message_lost = FALSE; return TRUE; } /** * tp_text_mixin_receive: * @obj: An object with the text mixin * @type: The type of message received from the underlying protocol * @sender: The handle of the message sender * @timestamp: The time the message was received * @text: The text of the message * * Add a message to the pending queue and emit Received. Exactly equivalent * to tp_text_mixin_receive_with_flags() with @flags == 0. * * Returns: %TRUE on success; %FALSE if the message was lost due to the memory * limit. * * Deprecated: Use tp_message_mixin_take_received() instead. */ gboolean tp_text_mixin_receive (GObject *obj, TpChannelTextMessageType type, TpHandle sender, time_t timestamp, const char *text) { return tp_text_mixin_receive_with_flags (obj, type, sender, timestamp, text, 0); } static gint compare_pending_message (gconstpointer haystack, gconstpointer needle) { _PendingMessage *msg = (_PendingMessage *) haystack; guint id = GPOINTER_TO_INT (needle); return (msg->id != id); } /** * tp_text_mixin_acknowledge_pending_messages: * @obj: An object with this mixin * @ids: An array of guint representing message IDs * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this * function returns false. * * Implements D-Bus method AcknowledgePendingMessages * on interface org.freedesktop.Telepathy.Channel.Type.Text * * Returns: TRUE if successful, FALSE if an error was thrown. * * Deprecated: Use #TpMessageMixin instead. */ gboolean tp_text_mixin_acknowledge_pending_messages (GObject *obj, const GArray *ids, GError **error) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); GList **nodes; _PendingMessage *msg; guint i; nodes = g_new (GList *, ids->len); for (i = 0; i < ids->len; i++) { guint id = g_array_index (ids, guint, i); nodes[i] = g_queue_find_custom (mixin->priv->pending, GINT_TO_POINTER (id), compare_pending_message); if (nodes[i] == NULL) { DEBUG ("invalid message id %u", id); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid message id %u", id); g_free (nodes); return FALSE; } } for (i = 0; i < ids->len; i++) { msg = (_PendingMessage *) nodes[i]->data; DEBUG ("acknowleding message id %u", msg->id); g_queue_remove (mixin->priv->pending, msg); _pending_free (msg, mixin->priv->contacts_repo); } g_free (nodes); return TRUE; } static void tp_text_mixin_acknowledge_pending_messages_async (TpSvcChannelTypeText *iface, const GArray *ids, DBusGMethodInvocation *context) { GError *error = NULL; if (tp_text_mixin_acknowledge_pending_messages (G_OBJECT (iface), ids, &error)) { tp_svc_channel_type_text_return_from_acknowledge_pending_messages ( context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_text_mixin_list_pending_messages: * @obj: An object with this mixin * @clear: If %TRUE, delete the pending messages from the queue * @ret: Used to return a pointer to a new GPtrArray of D-Bus structures * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this * function returns false. * * Implements D-Bus method ListPendingMessages * on interface org.freedesktop.Telepathy.Channel.Type.Text * * Returns: TRUE if successful, FALSE if an error was thrown. * * Deprecated: Use #TpMessageMixin instead. */ gboolean tp_text_mixin_list_pending_messages (GObject *obj, gboolean clear, GPtrArray **ret, GError **error) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); GType pending_type = TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE; guint count; GPtrArray *messages; GList *cur; count = g_queue_get_length (mixin->priv->pending); messages = g_ptr_array_sized_new (count); for (cur = g_queue_peek_head_link (mixin->priv->pending); cur != NULL; cur = cur->next) { _PendingMessage *msg = cur->data; GValue val = { 0, }; g_value_init (&val, pending_type); g_value_take_boxed (&val, dbus_g_type_specialized_construct (pending_type)); dbus_g_type_struct_set (&val, 0, msg->id, 1, msg->timestamp, 2, msg->sender, 3, msg->type, 4, msg->flags, 5, msg->text, G_MAXUINT); g_ptr_array_add (messages, g_value_get_boxed (&val)); } if (clear) { DEBUG ("WARNING: ListPendingMessages(clear=TRUE) is deprecated"); tp_text_mixin_clear (obj); } *ret = messages; return TRUE; } static void tp_text_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, gboolean clear, DBusGMethodInvocation *context) { GPtrArray *ret; GError *error = NULL; if (tp_text_mixin_list_pending_messages (G_OBJECT (iface), clear, &ret, &error)) { guint i; tp_svc_channel_type_text_return_from_list_pending_messages ( context, ret); for (i = 0; i < ret->len; i++) tp_value_array_free (g_ptr_array_index (ret, i)); g_ptr_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_text_mixin_get_message_types: * @obj: An object with this mixin * @ret: A pointer to where a GArray of guint will be placed on success * @error: A pointer to where an error will be placed on failure * * Return a newly allocated GArray of guint, representing message types * taken from #TpChannelTextMessageType, through @ret. * * Returns: %TRUE on success * * Deprecated: Use #TpMessageMixin instead. */ gboolean tp_text_mixin_get_message_types (GObject *obj, GArray **ret, GError **error) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); guint i; *ret = g_array_sized_new (FALSE, FALSE, sizeof (guint), mixin->priv->msg_types->len); for (i = 0; i < mixin->priv->msg_types->len; i++) { g_array_append_val (*ret, g_array_index (mixin->priv->msg_types, guint, i)); } return TRUE; } static void tp_text_mixin_get_message_types_async (TpSvcChannelTypeText *iface, DBusGMethodInvocation *context) { TpTextMixin *mixin = TP_TEXT_MIXIN (iface); tp_svc_channel_type_text_return_from_get_message_types (context, mixin->priv->msg_types); } /** * tp_text_mixin_clear: * @obj: An object with this mixin * * Clear the pending message queue, deleting all messages. * * Deprecated: Use tp_message_mixin_clear() instead. */ void tp_text_mixin_clear (GObject *obj) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); _PendingMessage *msg; while ((msg = g_queue_pop_head (mixin->priv->pending)) != NULL) { _pending_free (msg, mixin->priv->contacts_repo); } } /** * tp_text_mixin_has_pending_messages: * @obj: An object with this mixin * @first_sender: If not %NULL, used to store the sender of the oldest pending * message * * Return whether the channel @obj has unacknowledged messages. If so, and * @first_sender is not %NULL, the handle of the sender of the first message * is placed in it, without incrementing the handle's reference count. * * Returns: %TRUE if there are pending messages * * Deprecated: Use tp_message_mixin_has_pending_messages() instead. */ gboolean tp_text_mixin_has_pending_messages (GObject *obj, TpHandle *first_sender) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); _PendingMessage *msg = g_queue_peek_head (mixin->priv->pending); if (msg != NULL && first_sender != NULL) { *first_sender = msg->sender; } return (msg != NULL); } /** * tp_text_mixin_set_rescued: * @obj: An object with this mixin * * Mark all pending messages as having been "rescued" from a channel that * previously closed. * * Deprecated: Use tp_message_mixin_set_rescued() instead. */ void tp_text_mixin_set_rescued (GObject *obj) { TpTextMixin *mixin = TP_TEXT_MIXIN (obj); GList *cur; for (cur = g_queue_peek_head_link (mixin->priv->pending); cur != NULL; cur = cur->next) { _PendingMessage *msg = cur->data; msg->flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_RESCUED; } } /** * tp_text_mixin_iface_init: * @g_iface: A pointer to the #TpSvcChannelTypeTextClass in an object class * @iface_data: Ignored * * Fill in this mixin's AcknowledgePendingMessages, GetMessageTypes and * ListPendingMessages implementations in the given interface vtable. * In addition to calling this function during interface initialization, the * implementor is expected to call tp_svc_channel_type_text_implement_send(), * providing a Send implementation. * * Deprecated: Use tp_message_mixin_text_iface_init() instead. */ void tp_text_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelTypeTextClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (klass,\ tp_text_mixin_##x##_async) IMPLEMENT(acknowledge_pending_messages); IMPLEMENT(get_message_types); IMPLEMENT(list_pending_messages); /* send not implemented here */ #undef IMPLEMENT } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/telepathy-glib/text-mixin.h0000644000175000017500000001047712652510705016637 00000000000000/* * text-mixin.h - Header for GabbleTextMixin * Copyright (C) 2006 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_TEXT_MIXIN_H__ #define __TP_TEXT_MIXIN_H__ #include #include #include #include #include "util.h" G_BEGIN_DECLS #ifndef TP_DISABLE_DEPRECATED typedef struct _TpTextMixinClass TpTextMixinClass; typedef struct _TpTextMixinClassPrivate TpTextMixinClassPrivate; typedef struct _TpTextMixin TpTextMixin; typedef struct _TpTextMixinPrivate TpTextMixinPrivate; /** * TpTextMixinClass: * * Structure to be included in the class structure of objects that * use this mixin. Initialize it with tp_text_mixin_class_init(). * * There are no public fields. */ struct _TpTextMixinClass { /**/ TpTextMixinClassPrivate *priv; }; /** * TpTextMixin: * * Structure to be included in the instance structure of objects that * use this mixin. Initialize it with tp_text_mixin_init(). * * There are no public fields. */ struct _TpTextMixin { /**/ TpTextMixinPrivate *priv; }; /* TYPE MACROS */ #define TP_TEXT_MIXIN_CLASS_OFFSET_QUARK \ (tp_text_mixin_class_get_offset_quark ()) #define TP_TEXT_MIXIN_CLASS_OFFSET(o) \ tp_mixin_class_get_offset (o, TP_TEXT_MIXIN_CLASS_OFFSET_QUARK) #define TP_TEXT_MIXIN_CLASS(o) \ ((TpTextMixinClass *) tp_mixin_offset_cast (o, \ TP_TEXT_MIXIN_CLASS_OFFSET (o))) #define TP_TEXT_MIXIN_OFFSET_QUARK (tp_text_mixin_get_offset_quark ()) #define TP_TEXT_MIXIN_OFFSET(o) \ tp_mixin_instance_get_offset (o, TP_TEXT_MIXIN_OFFSET_QUARK) #define TP_TEXT_MIXIN(o) \ ((TpTextMixin *) tp_mixin_offset_cast (o, TP_TEXT_MIXIN_OFFSET (o))) _TP_DEPRECATED_IN_0_20 GQuark tp_text_mixin_class_get_offset_quark (void); _TP_DEPRECATED_IN_0_20 GQuark tp_text_mixin_get_offset_quark (void); _TP_DEPRECATED_IN_0_20 void tp_text_mixin_class_init (GObjectClass *obj_cls, glong offset); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_init) void tp_text_mixin_init (GObject *obj, glong offset, TpHandleRepoIface *contacts_repo); _TP_DEPRECATED_IN_0_20 void tp_text_mixin_set_message_types (GObject *obj, ...); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_finalize) void tp_text_mixin_finalize (GObject *obj); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_take_received) gboolean tp_text_mixin_receive_with_flags (GObject *obj, TpChannelTextMessageType type, TpHandle sender, time_t timestamp, const char *text, TpChannelTextMessageFlags flags); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_take_received) gboolean tp_text_mixin_receive (GObject *obj, TpChannelTextMessageType type, TpHandle sender, time_t timestamp, const char *text); _TP_DEPRECATED_IN_0_20 gboolean tp_text_mixin_acknowledge_pending_messages (GObject *obj, const GArray * ids, GError **error); _TP_DEPRECATED_IN_0_20 gboolean tp_text_mixin_list_pending_messages (GObject *obj, gboolean clear, GPtrArray ** ret, GError **error); _TP_DEPRECATED_IN_0_20 gboolean tp_text_mixin_get_message_types (GObject *obj, GArray **ret, GError **error); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_clear) void tp_text_mixin_clear (GObject *obj); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_has_pending_messages) gboolean tp_text_mixin_has_pending_messages (GObject *obj, TpHandle *first_sender); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_set_rescued) void tp_text_mixin_set_rescued (GObject *obj); _TP_DEPRECATED_IN_0_20_FOR (tp_message_mixin_text_iface_init) void tp_text_mixin_iface_init (gpointer g_iface, gpointer iface_data); #endif G_END_DECLS #endif /* #ifndef __TP_TEXT_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/TelepathyGLib-0.12.metadata0000644000175000017500000000004312652510705021121 00000000000000TelepathyGLib name="TelepathyGLib" telepathy-glib-0.24.2/telepathy-glib/base-channel.c0000644000175000017500000010271312652510705017037 00000000000000/* * base-channel.c - base class for Channel implementations * * Copyright © 2009-2010 Collabora Ltd. * Copyright © 2009-2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-channel * @title: TpBaseChannel * @short_description: base class for #TpExportableChannel implementations * @see_also: #TpSvcChannel * * This base class makes it easier to write #TpExportableChannel * implementations by implementing some of its properties, and defining other * relevant properties. * * Subclasses should fill in #TpBaseChannelClass.channel_type and * #TpBaseChannelClass.target_handle_type; and implement the * #TpBaseChannelClass.get_interfaces and * #TpBaseChannelClass.close virtual functions. * * If the channel type and/or interfaces being implemented define immutable * D-Bus properties besides those on the Channel interface, the subclass should * implement the #TpBaseChannelClass.fill_immutable_properties virtual function. * * If the #TpExportableChannel:object-path property is not set at construct * time, the #TpBaseChannelClass.get_object_path_suffix virtual function will * be called to determine the channel's path, whose default implementation * simply generates a unique path based on the object's address in memory. * * #TpBaseChannel also has the ability to remove the channel from the * bus, but keep the object around. To close the channel and remove it * from the bus, subclasses should call * tp_base_channel_disappear(). To bring the channel back, subclasses * use tp_base_channel_reopened_with_requested() and the channel * should be re-announced with * tp_channel_manager_emit_new_channel(). Note that channels which can * disappear but can also reopen due to pending messages need special * casing by the channel manager: * * |[ * static void * channel_closed_cb (TpBaseChannel *chan, * TpChannelManager *manager) * { * MyChannelManager *self = MY_CHANNEL_MANAGER (manager); * TpHandle handle = tp_base_channel_get_target_handle (chan); * * // first, emit ChannelClosed if the channel is registered (it * // won't be registered if it is appearing from being hidden, so * // let's not emit the signal in this case) * if (tp_base_channel_is_registered (chan)) * { * tp_channel_manager_emit_channel_closed (manager, * TP_EXPORTABLE_CHANNEL (chan)); * } * * if (tp_base_channel_is_destroyed (chan)) * { * // destroyed() must have been called; forget this channel * g_hash_table_remove (self->priv->channels, handle); * } * else if (tp_base_channel_is_respawning (chan)) * { * // reopened_with_requested() must have been called; re-announce the channel * tp_channel_manager_emit_new_channel (manager, TP_EXPORTABLE_CHANNEL (chan)); * } * else * { * // disappear() must have been called, do nothing special * } * } * ]| * * and the #TpChannelManagerIface.foreach_channel virtual function * should be updated to only include registered channels: * * |[ * static void * foreach_channel (TpChannelManager *manager, * TpChannelManagerChannelClassFunc func, * gpointer user_data) * { * MyChannelManager *self = MY_CHANNEL_MANAGER (manager); * GHashTableIter iter; * gpointer chan; * * g_hash_table_iter_init (&iter, self->priv->channels); * while (g_hash_table_iter_next (&iter, NULL, &chan)) * { * if (tp_base_channel_is_registered (TP_BASE_CHANNEL (chan))) * func (TP_EXPORTABLE_CHANNEL (chan), user_data); * } * } * ]| * * Since: 0.11.14 */ /** * TpBaseChannel: * * A base class for channel implementations * * Since: 0.11.14 */ /** * TpBaseChannelClass: * @dbus_props_class: The class structure for the DBus properties mixin * @channel_type: The type of channel that instances of this class represent * (e.g. #TP_IFACE_CHANNEL_TYPE_TEXT) * @target_handle_type: The type of handle that is the target of channels of * this type * @close: A virtual function called to close the channel, which will be called * by tp_base_channel_close() and by the implementation of the Closed D-Bus * method. * @fill_immutable_properties: A virtual function called to add custom * properties to the DBus properties hash. Implementations must chain up to the * parent class implementation and call * tp_dbus_properties_mixin_fill_properties_hash() on the supplied hash table * @get_object_path_suffix: Returns a string that will be appended to the * Connection objects's object path to get the Channel's object path. This * function will only be called as a fallback if the * #TpExportableChannel:object-path property is not set. The default * implementation simply generates a unique path based on the object's address * in memory. The returned string will be freed automatically. * @get_interfaces: Extra interfaces provided by this channel (this SHOULD NOT * include the channel type and interface itself). Implementation must first * chainup on parent class implementation and then add extra interfaces into * the #GPtrArray. Replaces @interfaces. * * The class structure for #TpBaseChannel * * Since: 0.11.14 */ /** * TpBaseChannelCloseFunc: * @chan: a channel * * Signature of an implementation of the #TpBaseChannelClass.close virtual * function. Implementations should eventually call either * tp_base_channel_destroyed() if the channel is really closed as a result, or * tp_base_channel_reopened() if the channel will be re-spawned (for instance, * due to unacknowledged messages on a text channel), but need not do so before * returning. Note that channels that support re-spawning must also implement * #TpSvcChannelInterfaceDestroyable. * * Implementations may assume that tp_base_channel_is_destroyed() is FALSE for * @chan when called. Note that if this function is implemented * asynchronously, it may be called more than once. A subclass which needs to * perform some asynchronous clean-up in order to close might implement this * function as follows: * * |[ * static void * my_channel_close (TpBaseChannel *chan) * { * MyChannel *self = MY_CHANNEL (chan); * * if (self->priv->closing) * return; * * self->priv->closing = TRUE; * * // some hypothetical channel-specific clean-up function: * clean_up (self, cleaned_up_cb); * } * * static void * cleaned_up_cb (MyChannel *self) * { * // all done, we can finish closing now * tp_base_channel_destroyed (TP_BASE_CHANNEL (self)); * } * static void * my_channel_class_init (MyChannelClass *klass) * { * TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass); * * klass->close = my_channel_close; * // ... * } * ]| * * If a subclass does not need to do anything to clean itself up, it may * implement #TpBaseChannelClass.close using tp_base_channel_destroyed() * directly: * * |[ * static void * my_channel_class_init (MyChannelClass *klass) * { * TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass); * * klass->close = tp_base_channel_destroyed; * // ... * } * ]| * * Since: 0.11.14 */ /** * TpBaseChannelFillPropertiesFunc: * @chan: a channel * @properties: a dictionary of @chan's immutable properties, which the * implementation may add to using * tp_dbus_properties_mixin_fill_properties_hash() * * Signature of an implementation of the * #TpBaseChannelClass.fill_immutable_properties * virtual function. A typical implementation, for a channel implementing * #TpSvcChannelTypeContactSearch, would be: * * |[ * static void * my_search_channel_fill_properties ( * TpBaseChannel *chan, * GHashTable *properties) * { * TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS (my_search_channel_parent_class); * * klass->fill_immutable_properties (chan, properties); * * tp_dbus_properties_mixin_fill_properties_hash ( * G_OBJECT (chan), properties, * TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "Limit", * TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "AvailableSearchKeys", * TP_IFACE_CHANNEL_TYPE_CONTACT_SEARCH, "Server", * NULL); * } * ]| * * Note that the SearchState property is not added to * @properties, since only immutable properties (whose value cannot change over * the lifetime of @chan) should be included. * * Since: 0.11.14 */ /** * TpBaseChannelGetPathFunc: * @chan: a channel * * Signature of an implementation of the * #TpBaseChannelClass.get_object_path_suffix virtual function. * * Returns: (transfer full): a string that will be appended to the Connection * objects's object path to get the Channel's object path. * * Since: 0.11.14 */ /** * TpBaseChannelGetInterfacesFunc: * @chan: a channel * * Signature of an implementation of #TpBaseChannelClass.get_interfaces virtual * function. * * Implementation must first chainup on parent class implementation and then * add extra interfaces into the #GPtrArray. * * |[ * static GPtrArray * * my_channel_get_interfaces (TpBaseChannel *self) * { * GPtrArray *interfaces; * * interfaces = TP_BASE_CHANNEL_CLASS (my_channel_parent_class)->get_interfaces (self); * * g_ptr_array_add (interfaces, TP_IFACE_BADGERS); * * return interfaces; * } * ]| * * Returns: (transfer container): a #GPtrArray of static strings for D-Bus * interfaces implemented by this client. * * Since: 0.17.5 */ #include "config.h" #include "base-channel.h" #include #include #include #include #include "telepathy-glib/group-mixin.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "debug-internal.h" enum { PROP_OBJECT_PATH = 1, PROP_CHANNEL_TYPE, PROP_HANDLE_TYPE, PROP_HANDLE, PROP_INITIATOR_HANDLE, PROP_INITIATOR_ID, PROP_TARGET_ID, PROP_REQUESTED, PROP_CONNECTION, PROP_INTERFACES, PROP_CHANNEL_DESTROYED, PROP_CHANNEL_PROPERTIES, LAST_PROPERTY }; struct _TpBaseChannelPrivate { TpBaseConnection *conn; char *object_path; TpHandle target; TpHandle initiator; gboolean requested; gboolean destroyed; gboolean registered; gboolean respawning; gboolean dispose_has_run; }; static void channel_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpBaseChannel, tp_base_channel, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL); ) /** * tp_base_channel_register: * @chan: a channel * * Make the channel appear on the bus. #TpExportableChannel:object-path must have been set * to a valid path, which must not already be in use as another object's path. * * Since: 0.11.14 */ void tp_base_channel_register (TpBaseChannel *chan) { TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon (chan->priv->conn); g_assert (chan->priv->object_path != NULL); g_return_if_fail (!chan->priv->registered); tp_dbus_daemon_register_object (bus, chan->priv->object_path, chan); chan->priv->registered = TRUE; } /** * tp_base_channel_destroyed: * @chan: a channel * * Called by subclasses to indicate that this channel was destroyed and can be * removed from the bus. The "Closed" signal will be emitted and the * #TpExportableChannel:channel-destroyed property will be set. * * Since: 0.11.14 */ void tp_base_channel_destroyed (TpBaseChannel *chan) { TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon (chan->priv->conn); /* Take a ref to ourself: the 'closed' handler might drop its reference on us. */ g_object_ref (chan); chan->priv->destroyed = TRUE; chan->priv->respawning = FALSE; tp_svc_channel_emit_closed (chan); if (chan->priv->registered) { tp_dbus_daemon_unregister_object (bus, chan); chan->priv->registered = FALSE; } g_object_unref (chan); } /** * tp_base_channel_reopened: * @chan: a channel * @initiator: the handle of the contact that re-opened the channel * * Called by subclasses to indicate that this channel was closed but was * re-opened due to pending messages. * * Calling this method is the same as calling * tp_base_channel_reopened_with_requested() with a requested value of * %FALSE. * * Since: 0.11.14 */ void tp_base_channel_reopened (TpBaseChannel *chan, TpHandle initiator) { tp_base_channel_reopened_with_requested (chan, FALSE, initiator); } /** * tp_base_channel_disappear: * @chan: a channel * * Called by subclasses to indicate that this channel is closing and * should be unregistered from the bus, but the actual object * shouldn't be destroyed. The "Closed" signal will be emitted, * the #TpExportableChannel:channel-destroyed property will not be * set, and the channel will be unregistered from the bus. * * Since: 0.19.7 */ void tp_base_channel_disappear (TpBaseChannel *chan) { TpBaseChannelPrivate *priv = chan->priv; TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon (priv->conn); /* Take a ref to ourself: the 'closed' handler might drop its reference on us. */ g_object_ref (chan); priv->destroyed = FALSE; priv->respawning = FALSE; tp_svc_channel_emit_closed (chan); if (priv->registered) { tp_dbus_daemon_unregister_object (bus, chan); priv->registered = FALSE; } g_object_unref (chan); } /** * tp_base_channel_reopened_with_requested: * @chan: a channel * @requested: %TRUE if the channel is requested, otherwise %FALSE * @initiator: the handle of the contact that re-opened the channel * * Called by subclasses to indicate that this channel was closed but * was re-opened, either due to pending messages or from having * disappeared (with tp_base_channel_disappear()). The "Closed" signal * will be emitted, but the #TpExportableChannel:channel-destroyed * property will not be set. The channel's * #TpBaseChannel:initiator-handle property will be set to @initiator, * and the #TpBaseChannel:requested property will be set to * @requested. * * Since: 0.19.7 */ void tp_base_channel_reopened_with_requested (TpBaseChannel *chan, gboolean requested, TpHandle initiator) { TpBaseChannelPrivate *priv = chan->priv; /* Take a ref to ourself: the 'closed' handler might drop its reference on us. */ g_object_ref (chan); if (priv->initiator != initiator) priv->initiator = initiator; priv->requested = requested; priv->respawning = TRUE; tp_svc_channel_emit_closed (chan); if (!priv->registered) tp_base_channel_register (chan); g_object_unref (chan); } /** * tp_base_channel_close: * @chan: a channel * * Asks @chan to close, just as if the Close D-Bus method had been called. If * #TpExportableChannel:channel-destroyed is TRUE, this is a no-op. * * Note that, depending on the subclass's implementation of * #TpBaseChannelClass.close and internal behaviour, this may or may not be a * suitable method to use during connection teardown. For instance, if the * channel may respawn when Close is called, an equivalent of the Destroy D-Bus * method would be more appropriate during teardown, since the intention is to * forcibly terminate all channels. * * Since: 0.11.14 */ void tp_base_channel_close (TpBaseChannel *chan) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (chan); g_return_if_fail (klass->close != NULL); if (!tp_base_channel_is_destroyed (chan)) klass->close (chan); } /** * tp_base_channel_get_object_path: * @chan: a channel * * Returns @chan's object path, as a shortcut for retrieving the * #TpChannelIface:object-path property. * * Returns: (transfer none): @chan's object path * * Since: 0.11.14 */ const gchar * tp_base_channel_get_object_path (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), NULL); return chan->priv->object_path; } /** * tp_base_channel_get_connection: * @chan: a channel * * Returns the connection to which @chan is attached, as a shortcut for * retrieving the #TpBaseChannel:connection property. * * Returns: (transfer none): the connection to which @chan is attached. * * Since: 0.11.14 */ TpBaseConnection * tp_base_channel_get_connection (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), NULL); return chan->priv->conn; } /** * tp_base_channel_get_self_handle: * @chan: a channel * * If @chan has a #TpGroupMixin, returns the value of group's self handle. * Otherwise return the value of #TpBaseConnection:self-handle. * * Returns: the self handle of @chan * * Since: 0.17.5 */ TpHandle tp_base_channel_get_self_handle (TpBaseChannel *chan) { if (TP_HAS_GROUP_MIXIN (chan)) { guint ret = 0; tp_group_mixin_get_self_handle (G_OBJECT (chan), &ret, NULL); if (ret != 0) return ret; } return tp_base_connection_get_self_handle (chan->priv->conn); } /** * tp_base_channel_get_target_handle: * @chan: a channel * * Returns the target handle of @chan (without a reference), which will be 0 * if #TpBaseChannelClass.target_handle_type is #TP_HANDLE_TYPE_NONE for this * class, and non-zero otherwise. This is a shortcut for retrieving the * #TpChannelIface:handle property. * * Returns: the target handle of @chan * * Since: 0.11.14 */ TpHandle tp_base_channel_get_target_handle (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), 0); return chan->priv->target; } /** * tp_base_channel_get_initiator: * @chan: a channel * * Returns the initiator handle of @chan, as a shortcut for retrieving the * #TpBaseChannel:initiator-handle property. * * Returns: the initiator handle of @chan * * Since: 0.11.14 */ TpHandle tp_base_channel_get_initiator (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), 0); return chan->priv->initiator; } /** * tp_base_channel_is_requested: * @chan: a channel * * Returns whether or not @chan was requested, as a shortcut for retrieving the * #TpBaseChannel:requested property. * * Returns: whether or not @chan was requested. * * Since: 0.11.14 */ gboolean tp_base_channel_is_requested (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), FALSE); return chan->priv->requested; } /** * tp_base_channel_is_registered: * @chan: a channel * * Returns whether or not @chan is visible on the bus; that is, whether * tp_base_channel_register() has been called and tp_base_channel_destroyed() * has not been called. * * Returns: TRUE if @chan is visible on the bus * * Since: 0.11.14 */ gboolean tp_base_channel_is_registered (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), FALSE); return chan->priv->registered; } /** * tp_base_channel_is_destroyed: * @chan: a channel * * Returns the value of the #TpExportableChannel:channel-destroyed property, * which is TRUE if tp_base_channel_destroyed() has been called (and thus the * channel has been removed from the bus). * * Returns: TRUE if tp_base_channel_destroyed() has been called. * * Since: 0.11.14 */ gboolean tp_base_channel_is_destroyed (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), FALSE); return chan->priv->destroyed; } /** * tp_base_channel_is_respawning: * @chan: a channel * * Returns %TRUE if the channel has been reopened, either by a * subclass calling tp_base_channel_reopened() or * tp_base_channel_reopened_with_requested(). This is useful for * "closed" handlers to distinguish between channels really closing * and channels that have been reopened due to pending messages. * * Returns: %TRUE if tp_base_channel_reopened() or * tp_base_channel_reopened_with_requested() have been called. * * Since: 0.19.7 */ gboolean tp_base_channel_is_respawning (TpBaseChannel *chan) { g_return_val_if_fail (TP_IS_BASE_CHANNEL (chan), FALSE); return chan->priv->respawning; } /* * tp_base_channel_fill_basic_immutable_properties: * * Specifies the immutable properties supported for this Channel object, by * using tp_dbus_properties_mixin_fill_properties_hash(). */ static void tp_base_channel_fill_basic_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { tp_dbus_properties_mixin_fill_properties_hash (G_OBJECT (chan), properties, TP_IFACE_CHANNEL, "ChannelType", TP_IFACE_CHANNEL, "TargetHandleType", TP_IFACE_CHANNEL, "TargetHandle", TP_IFACE_CHANNEL, "TargetID", TP_IFACE_CHANNEL, "InitiatorHandle", TP_IFACE_CHANNEL, "InitiatorID", TP_IFACE_CHANNEL, "Requested", TP_IFACE_CHANNEL, "Interfaces", NULL); } static gchar * tp_base_channel_get_basic_object_path_suffix (TpBaseChannel *self) { gchar *obj_path = g_strdup_printf ("channel%p", self); gchar *escaped = tp_escape_as_identifier (obj_path); g_free (obj_path); return escaped; } static GPtrArray * tp_base_channel_get_basic_interfaces (TpBaseChannel *self) { GPtrArray *interfaces = g_ptr_array_new (); const char **ptr; /* copy the klass->interfaces property for backwards compatibility */ for (ptr = TP_BASE_CHANNEL_GET_CLASS (self)->interfaces; ptr != NULL && *ptr != NULL; ptr++) { g_ptr_array_add (interfaces, (char *) *ptr); } return interfaces; } static void tp_base_channel_init (TpBaseChannel *self) { TpBaseChannelPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CHANNEL, TpBaseChannelPrivate); self->priv = priv; } static void tp_base_channel_constructed (GObject *object) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (object); GObjectClass *parent_class = tp_base_channel_parent_class; TpBaseChannel *chan = TP_BASE_CHANNEL (object); TpBaseConnection *conn = chan->priv->conn; if (parent_class->constructed != NULL) parent_class->constructed (object); g_return_if_fail (conn != NULL); g_return_if_fail (TP_IS_BASE_CONNECTION (conn)); if (chan->priv->object_path == NULL) { gchar *base_path = klass->get_object_path_suffix (chan); g_assert (base_path != NULL); g_assert (*base_path != '\0'); chan->priv->object_path = g_strdup_printf ("%s/%s", tp_base_connection_get_object_path (conn), base_path); g_free (base_path); } } static void tp_base_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseChannel *chan = TP_BASE_CHANNEL (object); TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (chan); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, chan->priv->object_path); break; case PROP_CHANNEL_TYPE: g_value_set_static_string (value, klass->channel_type); break; case PROP_HANDLE_TYPE: g_value_set_uint (value, klass->target_handle_type); break; case PROP_HANDLE: g_value_set_uint (value, chan->priv->target); break; case PROP_TARGET_ID: if (chan->priv->target != 0) { TpHandleRepoIface *repo = tp_base_connection_get_handles ( chan->priv->conn, klass->target_handle_type); g_assert (klass->target_handle_type != TP_HANDLE_TYPE_NONE); g_assert (repo != NULL); g_value_set_string (value, tp_handle_inspect (repo, chan->priv->target)); } else { g_value_set_static_string (value, ""); } break; case PROP_INITIATOR_HANDLE: g_value_set_uint (value, chan->priv->initiator); break; case PROP_INITIATOR_ID: if (chan->priv->initiator != 0) { TpHandleRepoIface *repo = tp_base_connection_get_handles ( chan->priv->conn, TP_HANDLE_TYPE_CONTACT); g_assert (repo != NULL); g_assert (chan->priv->initiator != 0); g_value_set_string (value, tp_handle_inspect (repo, chan->priv->initiator)); } else { g_value_set_static_string (value, ""); } break; case PROP_REQUESTED: g_value_set_boolean (value, (chan->priv->requested)); break; case PROP_CONNECTION: g_value_set_object (value, chan->priv->conn); break; case PROP_INTERFACES: { GPtrArray *interfaces = klass->get_interfaces (chan); g_ptr_array_add (interfaces, NULL); g_value_set_boxed (value, interfaces->pdata); g_ptr_array_unref (interfaces); break; } case PROP_CHANNEL_DESTROYED: g_value_set_boolean (value, chan->priv->destroyed); break; case PROP_CHANNEL_PROPERTIES: { /* create an empty properties hash for subclasses to fill */ GHashTable *properties = tp_dbus_properties_mixin_make_properties_hash (G_OBJECT (chan), NULL, NULL, NULL); if (klass->fill_immutable_properties) klass->fill_immutable_properties (chan, properties); g_value_take_boxed (value, properties); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseChannel *chan = TP_BASE_CHANNEL (object); switch (property_id) { case PROP_OBJECT_PATH: g_assert (chan->priv->object_path == NULL); chan->priv->object_path = g_value_dup_string (value); break; case PROP_HANDLE: /* we don't ref it here because we don't necessarily have access to the * contact repo yet - instead we ref it in constructed. */ chan->priv->target = g_value_get_uint (value); break; case PROP_INITIATOR_HANDLE: /* similarly we can't ref this yet */ chan->priv->initiator = g_value_get_uint (value); break; case PROP_HANDLE_TYPE: case PROP_CHANNEL_TYPE: /* these properties are writable in the interface, but not actually * meaningfully changeable on this channel, so we do nothing */ break; case PROP_CONNECTION: chan->priv->conn = g_value_dup_object (value); break; case PROP_REQUESTED: chan->priv->requested = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_channel_dispose (GObject *object) { TpBaseChannel *chan = TP_BASE_CHANNEL (object); TpBaseChannelPrivate *priv = chan->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (!priv->destroyed) { tp_base_channel_destroyed (chan); } tp_clear_object (&priv->conn); if (G_OBJECT_CLASS (tp_base_channel_parent_class)->dispose) G_OBJECT_CLASS (tp_base_channel_parent_class)->dispose (object); } static void tp_base_channel_finalize (GObject *object) { TpBaseChannel *chan = TP_BASE_CHANNEL (object); g_free (chan->priv->object_path); G_OBJECT_CLASS (tp_base_channel_parent_class)->finalize (object); } static void tp_base_channel_class_init (TpBaseChannelClass *tp_base_channel_class) { static TpDBusPropertiesMixinPropImpl channel_props[] = { { "TargetHandleType", "handle-type", NULL }, { "TargetHandle", "handle", NULL }, { "TargetID", "target-id", NULL }, { "ChannelType", "channel-type", NULL }, { "Interfaces", "interfaces", NULL }, { "Requested", "requested", NULL }, { "InitiatorHandle", "initiator-handle", NULL }, { "InitiatorID", "initiator-id", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL, tp_dbus_properties_mixin_getter_gobject_properties, NULL, channel_props, }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (tp_base_channel_class); GParamSpec *param_spec; g_type_class_add_private (tp_base_channel_class, sizeof (TpBaseChannelPrivate)); object_class->constructed = tp_base_channel_constructed; object_class->get_property = tp_base_channel_get_property; object_class->set_property = tp_base_channel_set_property; object_class->dispose = tp_base_channel_dispose; object_class->finalize = tp_base_channel_finalize; g_object_class_override_property (object_class, PROP_OBJECT_PATH, "object-path"); g_object_class_override_property (object_class, PROP_CHANNEL_TYPE, "channel-type"); g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); g_object_class_override_property (object_class, PROP_HANDLE, "handle"); g_object_class_override_property (object_class, PROP_CHANNEL_DESTROYED, "channel-destroyed"); g_object_class_override_property (object_class, PROP_CHANNEL_PROPERTIES, "channel-properties"); param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "Connection object that owns this channel.", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "Additional Channel.Interface.* interfaces", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); param_spec = g_param_spec_string ("target-id", "Target's identifier", "The string obtained by inspecting the target handle", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TARGET_ID, param_spec); param_spec = g_param_spec_boolean ("requested", "Requested?", "True if this channel was requested by the local user", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTED, param_spec); param_spec = g_param_spec_uint ("initiator-handle", "Initiator's handle", "The contact who initiated the channel", 0, G_MAXUINT32, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_HANDLE, param_spec); param_spec = g_param_spec_string ("initiator-id", "Initiator's bare JID", "The string obtained by inspecting the initiator-handle", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIATOR_ID, param_spec); tp_base_channel_class->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseChannelClass, dbus_props_class)); tp_base_channel_class->fill_immutable_properties = tp_base_channel_fill_basic_immutable_properties; tp_base_channel_class->get_object_path_suffix = tp_base_channel_get_basic_object_path_suffix; tp_base_channel_class->get_interfaces = tp_base_channel_get_basic_interfaces; } static void tp_base_channel_get_channel_type (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (iface); tp_svc_channel_return_from_get_channel_type (context, klass->channel_type); } static void tp_base_channel_get_handle (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (iface); TpBaseChannel *chan = TP_BASE_CHANNEL (iface); tp_svc_channel_return_from_get_handle (context, klass->target_handle_type, chan->priv->target); } static void tp_base_channel_get_interfaces (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpBaseChannel *chan = TP_BASE_CHANNEL (iface); TpBaseChannelClass *klass = TP_BASE_CHANNEL_GET_CLASS (chan); GPtrArray *interfaces = klass->get_interfaces (chan); g_ptr_array_add (interfaces, NULL); tp_svc_channel_return_from_get_interfaces (context, (const char **) interfaces->pdata); g_ptr_array_unref (interfaces); } static void tp_base_channel_close_dbus ( TpSvcChannel *iface, DBusGMethodInvocation *context) { TpBaseChannel *chan = TP_BASE_CHANNEL (iface); if (DEBUGGING) { gchar *caller = dbus_g_method_get_sender (context); DEBUG ("called by %s", caller); g_free (caller); } tp_base_channel_close (chan); tp_svc_channel_return_from_close (context); } static void channel_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelClass *klass = (TpSvcChannelClass *) g_iface; #define IMPLEMENT(x) tp_svc_channel_implement_##x (\ klass, tp_base_channel_##x) IMPLEMENT(get_channel_type); IMPLEMENT(get_handle); IMPLEMENT(get_interfaces); #undef IMPLEMENT tp_svc_channel_implement_close (klass, tp_base_channel_close_dbus); } telepathy-glib-0.24.2/telepathy-glib/base-channel.h0000644000175000017500000001034012652510705017036 00000000000000/* * base-channel.h - Header for TpBaseChannel * * Copyright © 2009-2010 Collabora Ltd. * Copyright © 2009-2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CHANNEL_H__ #define __TP_BASE_CHANNEL_H__ #include #include #include #include #include "connection.h" G_BEGIN_DECLS typedef struct _TpBaseChannel TpBaseChannel; typedef struct _TpBaseChannelClass TpBaseChannelClass; typedef struct _TpBaseChannelPrivate TpBaseChannelPrivate; typedef void (*TpBaseChannelCloseFunc) (TpBaseChannel *chan); typedef void (*TpBaseChannelFillPropertiesFunc) (TpBaseChannel *chan, GHashTable *properties); typedef gchar *(*TpBaseChannelGetPathFunc) (TpBaseChannel *chan); typedef GPtrArray *(*TpBaseChannelGetInterfacesFunc) (TpBaseChannel *chan); struct _TpBaseChannelClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ TpDBusPropertiesMixinClass dbus_props_class; const gchar *channel_type; TpHandleType target_handle_type; /*< private >*/ const gchar **_TP_SEAL (interfaces); /*< public >*/ TpBaseChannelCloseFunc close; TpBaseChannelFillPropertiesFunc fill_immutable_properties; TpBaseChannelGetPathFunc get_object_path_suffix; TpBaseChannelGetInterfacesFunc get_interfaces; /*< private >*/ GCallback _reserved[9]; }; struct _TpBaseChannel { /*< private >*/ GObject parent; TpBaseChannelPrivate *priv; }; void tp_base_channel_register (TpBaseChannel *chan); void tp_base_channel_close (TpBaseChannel *chan); void tp_base_channel_destroyed (TpBaseChannel *chan); void tp_base_channel_reopened (TpBaseChannel *chan, TpHandle initiator); _TP_AVAILABLE_IN_0_20 void tp_base_channel_disappear (TpBaseChannel *chan); _TP_AVAILABLE_IN_0_20 void tp_base_channel_reopened_with_requested (TpBaseChannel *chan, gboolean requested, TpHandle initiator); const gchar *tp_base_channel_get_object_path (TpBaseChannel *chan); TpBaseConnection *tp_base_channel_get_connection (TpBaseChannel *chan); _TP_AVAILABLE_IN_0_18 TpHandle tp_base_channel_get_self_handle (TpBaseChannel *chan); TpHandle tp_base_channel_get_target_handle (TpBaseChannel *chan); TpHandle tp_base_channel_get_initiator (TpBaseChannel *chan); gboolean tp_base_channel_is_requested (TpBaseChannel *chan); gboolean tp_base_channel_is_registered (TpBaseChannel *chan); gboolean tp_base_channel_is_destroyed (TpBaseChannel *chan); _TP_AVAILABLE_IN_0_20 gboolean tp_base_channel_is_respawning (TpBaseChannel *chan); GType tp_base_channel_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_CHANNEL \ (tp_base_channel_get_type ()) #define TP_BASE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_CHANNEL, \ TpBaseChannel)) #define TP_BASE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_CHANNEL, \ TpBaseChannelClass)) #define TP_IS_BASE_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CHANNEL)) #define TP_IS_BASE_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CHANNEL)) #define TP_BASE_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CHANNEL, \ TpBaseChannelClass)) G_END_DECLS #endif /* #ifndef __TP_BASE_CHANNEL_H__*/ telepathy-glib-0.24.2/telepathy-glib/simple-approver.c0000644000175000017500000002637512652510705017655 00000000000000/* * Simple implementation of an Approver * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: simple-approver * @title: TpSimpleApprover * @short_description: a subclass of #TpBaseClient implementing * a simple Approver * * This class makes it easier to construct a #TpSvcClient implementing the * #TpSvcClientApprover interface. * * A typical simple approver would look liks this: * |[ * static void * my_add_dispatch_operation (TpSimpleApprover *approver, * TpAccount *account, * TpConnection *connection, * GList *channels, * TpChannelDispatchOperation *dispatch_operation, * TpAddDispatchOperationContext *context, * gpointer user_data) * { * /* call tp_channel_dispatch_operation_handle_with_async() * if wanting to approve the channels */ * * tp_add_dispatch_operation_context_accept (context); * } * * factory = tp_automatic_client_factory_new (dbus); * client = tp_simple_approver_new_with_factory (factory, "MyApprover", FALSE, * my_add_dispatch_operation, user_data); * g_object_unref (factory); * * tp_base_client_take_approver_filter (client, tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * NULL)); * * tp_base_client_register (client, NULL); * ]| * * See examples/client/text-approver.c for a complete example. */ /** * TpSimpleApprover: * * Data structure representing a simple Approver implementation. * * Since: 0.11.5 */ /** * TpSimpleApproverClass: * * The class of a #TpSimpleApprover. * * Since: 0.11.5 */ /** * TpSimpleApproverAddDispatchOperationImpl: * @approver: a #TpSimpleApprover instance * @account: a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible * @connection: a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared * if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * all having %TP_CHANNEL_FEATURE_CORE prepared * @dispatch_operation: (allow-none): a #TpChannelDispatchOperation or %NULL; * the dispatch_operation is not guaranteed to be prepared * @context: a #TpAddDispatchOperationContext representing the context of this * D-Bus call * @user_data: arbitrary user-supplied data passed to tp_simple_approver_new() * * Signature of the implementation of the AddDispatchOperation method. * * This function must call either tp_add_dispatch_operation_context_accept(), * tp_add_dispatch_operation_context_delay() or * tp_add_dispatch_operation_context_fail() on @context before it returns. * * Since: 0.11.5 */ #include "config.h" #include "telepathy-glib/simple-approver.h" #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" G_DEFINE_TYPE(TpSimpleApprover, tp_simple_approver, TP_TYPE_BASE_CLIENT) enum { PROP_CALLBACK = 1, PROP_USER_DATA, PROP_DESTROY, N_PROPS }; struct _TpSimpleApproverPrivate { TpSimpleApproverAddDispatchOperationImpl callback; gpointer user_data; GDestroyNotify destroy; }; static void tp_simple_approver_init (TpSimpleApprover *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_APPROVER, TpSimpleApproverPrivate); } static void tp_simple_approver_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpSimpleApprover *self = TP_SIMPLE_APPROVER (object); switch (property_id) { case PROP_CALLBACK: self->priv->callback = g_value_get_pointer (value); break; case PROP_USER_DATA: self->priv->user_data = g_value_get_pointer (value); break; case PROP_DESTROY: self->priv->destroy = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_approver_constructed (GObject *object) { TpSimpleApprover *self = TP_SIMPLE_APPROVER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_simple_approver_parent_class)->constructed; g_assert (self->priv->callback != NULL); if (chain_up != NULL) chain_up (object); } static void tp_simple_approver_dispose (GObject *object) { TpSimpleApprover *self = TP_SIMPLE_APPROVER (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_simple_approver_parent_class)->dispose; if (self->priv->destroy != NULL) { self->priv->destroy (self->priv->user_data); self->priv->destroy = NULL; } if (dispose != NULL) dispose (object); } static void add_dispatch_operation ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context) { TpSimpleApprover *self = TP_SIMPLE_APPROVER (client); self->priv->callback (self, account, connection, channels, dispatch_operation, context, self->priv->user_data); } static void tp_simple_approver_class_init (TpSimpleApproverClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpSimpleApproverPrivate)); object_class->set_property = tp_simple_approver_set_property; object_class->constructed = tp_simple_approver_constructed; object_class->dispose = tp_simple_approver_dispose; /** * TpSimpleApprover:callback: * * The #TpSimpleApproverAddDispatchOperationImpl callback implementing the * AddDispatchOperation D-Bus method. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("callback", "Callback", "Function called when ApproverChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALLBACK, param_spec); /** * TpSimpleApprover:user-data: * * The user-data pointer passed to #TpSimpleApprover:callback. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("user-data", "user data", "pointer passed as user-data when ApproverChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_DATA, param_spec); /** * TpSimpleApprover:destroy: * * The #GDestroyNotify function called to free #TpSimpleApprover:user-data * when the #TpSimpleApprover is destroyed. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("destroy", "destroy", "function called to destroy the user-data when destroying the approver", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESTROY, param_spec); base_clt_cls->add_dispatch_operation = add_dispatch_operation; } /** * tp_simple_approver_new: * @dbus: a #TpDBusDaemon object, may not be %NULL * @name: the name of the Approver (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when AddDispatchOperation is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleApprover * is destroyed * * Convenient function to create a new #TpSimpleApprover instance. * * If @dbus is not the result of tp_dbus_daemon_dup(), you should call * tp_simple_approver_new_with_am() instead, so that #TpAccount, * #TpConnection and #TpContact instances can be shared between modules. * * Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover * * Since: 0.11.5 * Deprecated: New code should use tp_simple_approver_new_with_am() instead. */ TpBaseClient * tp_simple_approver_new (TpDBusDaemon *dbus, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_APPROVER, "dbus-daemon", dbus, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_approver_new_with_am: * @account_manager: an account manager, which may not be %NULL * @name: the name of the Approver (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when AddDispatchOperation is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleApprover * is destroyed * * Convenient function to create a new #TpSimpleApprover instance with a * specified #TpAccountManager. * * It is not necessary to prepare any features on @account_manager before * calling this function. * * Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover * * Since: 0.11.14 */ TpBaseClient * tp_simple_approver_new_with_am (TpAccountManager *account_manager, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_APPROVER, "account-manager", account_manager, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_approver_new_with_factory: * @factory: an #TpSimpleClientFactory, which may not be %NULL * @name: the name of the Approver (see #TpBaseClient:name for details) * @uniquify: the value of the #TpBaseClient:uniquify-name property * @callback: the function called when AddDispatchOperation is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with @user_data as its argument when the #TpSimpleApprover * is destroyed * * Convenient function to create a new #TpSimpleApprover instance with a * specified #TpSimpleClientFactory. * * Returns: (type TelepathyGLib.SimpleApprover): a new #TpSimpleApprover * * Since: 0.15.5 */ TpBaseClient * tp_simple_approver_new_with_factory (TpSimpleClientFactory *factory, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_APPROVER, "factory", factory, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } telepathy-glib-0.24.2/telepathy-glib/simple-approver.h0000644000175000017500000000700612652510705017650 00000000000000/* * Simple implementation of an Approver * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIMPLE_APPROVER_H__ #define __TP_SIMPLE_APPROVER_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _TpSimpleApprover TpSimpleApprover; typedef struct _TpSimpleApproverClass TpSimpleApproverClass; typedef struct _TpSimpleApproverPrivate TpSimpleApproverPrivate; struct _TpSimpleApproverClass { /**/ TpBaseClientClass parent_class; GCallback _padding[7]; }; struct _TpSimpleApprover { /**/ TpBaseClient parent; TpSimpleApproverPrivate *priv; }; GType tp_simple_approver_get_type (void); #define TP_TYPE_SIMPLE_APPROVER \ (tp_simple_approver_get_type ()) #define TP_SIMPLE_APPROVER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIMPLE_APPROVER, \ TpSimpleApprover)) #define TP_SIMPLE_APPROVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_SIMPLE_APPROVER, \ TpSimpleApproverClass)) #define TP_IS_SIMPLE_APPROVER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIMPLE_APPROVER)) #define TP_IS_SIMPLE_APPROVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_SIMPLE_APPROVER)) #define TP_SIMPLE_APPROVER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_APPROVER, \ TpSimpleApproverClass)) typedef void (*TpSimpleApproverAddDispatchOperationImpl) ( TpSimpleApprover *approver, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context, gpointer user_data); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_approver_new_with_factory) TpBaseClient * tp_simple_approver_new (TpDBusDaemon *dbus, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy); #endif TpBaseClient *tp_simple_approver_new_with_am ( TpAccountManager *account_manager, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy); _TP_AVAILABLE_IN_0_16 TpBaseClient *tp_simple_approver_new_with_factory ( TpSimpleClientFactory *factory, const gchar *name, gboolean uniquify, TpSimpleApproverAddDispatchOperationImpl callback, gpointer user_data, GDestroyNotify destroy); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-account-manager.h0000644000175000017500000000052312652510705020355 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_ACCOUNT_MANAGER_H__ #define __TP_META_SVC_ACCOUNT_MANAGER_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/account.c0000644000175000017500000040774612652510705016171 00000000000000/* * account.c - proxy for an account in the Telepathy account manager * * Copyright © 2009–2012 Collabora Ltd. * Copyright © 2009–2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include "telepathy-glib/account-internal.h" #include "telepathy-glib/account.h" #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_ACCOUNTS #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" #include "telepathy-glib/_gen/tp-cli-account-body.h" /** * SECTION:account * @title: TpAccount * @short_description: proxy object for an account in the Telepathy account * manager * @see_also: #TpAccountManager * * The Telepathy Account Manager stores the user's configured real-time * communication accounts. The #TpAccount object represents a stored account. * * Since: 0.7.32 */ /** * TpAccount: * * The Telepathy Account Manager stores the user's configured real-time * communication accounts. This object represents a stored account. * * If this account is deleted from the account manager, the * #TpProxy::invalidated signal will be emitted * with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_OBJECT_REMOVED. * * One can connect to the #GObject::notify signal to get change notifications * for many of the properties on this object. Refer to each property's * documentation for whether it can be used in this way. * * #TpAccount objects should normally be obtained from the #TpAccountManager. * * Since 0.16, #TpAccount always has a non-%NULL #TpProxy:factory, and its * #TpProxy:factory will be propagated to its #TpConnection * (if any). If a #TpAccount is created without going via the * #TpAccountManager or specifying a #TpProxy:factory, the default * is to use a new #TpAutomaticClientFactory. * * Since: 0.7.32 */ /** * TpAccountClass: * * The class of a #TpAccount. */ struct _TpAccountPrivate { gboolean dispose_has_run; TpConnection *connection; gchar *connection_object_path; TpConnectionStatus connection_status; TpConnectionStatusReason reason; gchar *error; GHashTable *error_details; TpConnectionPresenceType cur_presence; gchar *cur_status; gchar *cur_message; TpConnectionPresenceType requested_presence; gchar *requested_status; gchar *requested_message; TpConnectionPresenceType auto_presence; gchar *auto_status; gchar *auto_message; gboolean changing_presence; gboolean connect_automatically; gboolean has_been_online; gchar *normalized_name; gchar *nickname; gboolean enabled; gboolean valid; gboolean removed; gchar *cm_name; gchar *proto_name; gchar *icon_name; gchar *service; gchar *display_name; GStrv supersedes; GHashTable *parameters; gchar *storage_provider; GValue *storage_identifier; TpStorageRestrictionFlags storage_restrictions; GStrv uri_schemes; gboolean connection_prepared; }; G_DEFINE_TYPE (TpAccount, tp_account, TP_TYPE_PROXY) /* signals */ enum { STATUS_CHANGED, PRESENCE_CHANGED, AVATAR_CHANGED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; /* properties */ enum { PROP_ENABLED = 1, PROP_CHANGING_PRESENCE, PROP_CURRENT_PRESENCE_TYPE, PROP_CURRENT_STATUS, PROP_CURRENT_STATUS_MESSAGE, PROP_CONNECTION_STATUS, PROP_CONNECTION_STATUS_REASON, PROP_CONNECTION_ERROR, PROP_CONNECTION_ERROR_DETAILS, PROP_CONNECTION, PROP_DISPLAY_NAME, PROP_CONNECTION_MANAGER, PROP_CM_NAME, PROP_PROTOCOL, PROP_PROTOCOL_NAME, PROP_ICON_NAME, PROP_CONNECT_AUTOMATICALLY, PROP_HAS_BEEN_ONLINE, PROP_SERVICE, PROP_VALID, PROP_REQUESTED_PRESENCE_TYPE, PROP_REQUESTED_STATUS, PROP_REQUESTED_STATUS_MESSAGE, PROP_NICKNAME, PROP_AUTOMATIC_PRESENCE_TYPE, PROP_AUTOMATIC_STATUS, PROP_AUTOMATIC_STATUS_MESSAGE, PROP_NORMALIZED_NAME, PROP_STORAGE_PROVIDER, PROP_STORAGE_IDENTIFIER, PROP_STORAGE_IDENTIFIER_VARIANT, PROP_STORAGE_RESTRICTIONS, PROP_SUPERSEDES, PROP_URI_SCHEMES, N_PROPS }; static void tp_account_prepare_connection_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); static void tp_account_prepare_addressing_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); static void tp_account_prepare_storage_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); static gboolean connection_is_internal (TpAccount *self) { if (!tp_proxy_is_prepared (self, TP_ACCOUNT_FEATURE_CONNECTION)) return FALSE; return !self->priv->connection_prepared; } /** * TP_ACCOUNT_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpAccount. * * When this feature is prepared, the basic properties of the Account have * been retrieved and are available for use, and change-notification has been * set up. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.9.0 */ /** * TP_ACCOUNT_FEATURE_CONNECTION: * * Expands to a call to a function that returns a quark for the "connection" * feature on a #TpAccount. * * When this feature is prepared, it is guaranteed that #TpAccount:connection * will always be either %NULL or prepared. The account's #TpProxy:factory * will be used to create the #TpConnection object and to determine its * desired connection features. Change notification of the * #TpAccount:connection property will be delayed until all features (at least * %TP_CONNECTION_FEATURE_CORE) are prepared. See * tp_simple_client_factory_add_account_features() to define which features * needs to be prepared. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.5 */ /** * TP_ACCOUNT_FEATURE_STORAGE: * * Expands to a call to a function that returns a quark for the "storage" * feature on a #TpAccount. * * When this feature is prepared, the Account.Interface.Storage properties have * been retrieved and are available for use. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.13.2 */ /** * TP_ACCOUNT_FEATURE_ADDRESSING: * * Expands to a call to a function that returns a quark for the "addressing" * feature on a #TpAccount. * * When this feature is prepared, the list of URI schemes from * Account.Interface.Addressing has been retrieved and is available for use. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.13.8 */ /** * tp_account_get_feature_quark_core: * * * * Returns: the quark used for representing the core feature of a * #TpAccount * * Since: 0.9.0 */ GQuark tp_account_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-account-feature-core"); } /** * tp_account_get_feature_quark_connection: * * * * Returns: the quark used for representing the connection feature of a * #TpAccount * * Since: 0.15.5 */ GQuark tp_account_get_feature_quark_connection (void) { return g_quark_from_static_string ("tp-account-feature-connection"); } /** * tp_account_get_feature_quark_storage: * * * * Returns: the quark used for representing the storage interface of a * #TpAccount * * Since: 0.13.2 */ GQuark tp_account_get_feature_quark_storage (void) { return g_quark_from_static_string ("tp-account-feature-storage"); } GQuark tp_account_get_feature_quark_addressing (void) { return g_quark_from_static_string ("tp-account-feature-addressing"); } enum { FEAT_CORE, FEAT_CONNECTION, FEAT_ADDRESSING, FEAT_STORAGE, N_FEAT }; static const TpProxyFeature * _tp_account_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_UNLIKELY (features[0].name == 0)) { features[FEAT_CORE].name = TP_ACCOUNT_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* no need for a prepare_async function - the constructor starts it */ features[FEAT_CONNECTION].name = TP_ACCOUNT_FEATURE_CONNECTION; features[FEAT_CONNECTION].prepare_async = tp_account_prepare_connection_async; features[FEAT_ADDRESSING].name = TP_ACCOUNT_FEATURE_ADDRESSING; features[FEAT_ADDRESSING].prepare_async = tp_account_prepare_addressing_async; features[FEAT_STORAGE].name = TP_ACCOUNT_FEATURE_STORAGE; features[FEAT_STORAGE].prepare_async = tp_account_prepare_storage_async; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); } return features; } static void tp_account_init (TpAccount *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ACCOUNT, TpAccountPrivate); self->priv->connection_status = TP_CONNECTION_STATUS_DISCONNECTED; self->priv->error = g_strdup (TP_ERROR_STR_DISCONNECTED); self->priv->error_details = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); self->priv->supersedes = g_new0 (gchar *, 1); } static void _tp_account_invalidated_cb (TpAccount *self, guint domain, guint code, gchar *message) { TpAccountPrivate *priv = self->priv; /* The connection will get disconnected as a result of account deletion, * but by then we will no longer be telling the API user about changes - * so claim the disconnection already happened (see fd.o#25149) */ if (priv->connection_status != TP_CONNECTION_STATUS_DISCONNECTED) { priv->connection_status = TP_CONNECTION_STATUS_DISCONNECTED; tp_clear_pointer (&priv->error, g_free); g_hash_table_remove_all (priv->error_details); if (domain == TP_DBUS_ERRORS && code == TP_DBUS_ERROR_OBJECT_REMOVED) { /* presumably the user asked for it to be deleted... */ priv->reason = TP_CONNECTION_STATUS_REASON_REQUESTED; priv->error = g_strdup (TP_ERROR_STR_CANCELLED); g_hash_table_insert (priv->error_details, g_strdup ("debug-message"), tp_g_value_slice_new_static_string ("TpAccount was removed")); } else { gchar *s; priv->reason = TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED; priv->error = g_strdup (TP_ERROR_STR_DISCONNECTED); s = g_strdup_printf ("TpAccount was invalidated: %s #%u: %s", g_quark_to_string (domain), code, message); g_hash_table_insert (priv->error_details, g_strdup ("debug-message"), tp_g_value_slice_new_take_string (s)); } g_object_notify ((GObject *) self, "connection-status"); g_object_notify ((GObject *) self, "connection-status-reason"); g_object_notify ((GObject *) self, "connection-error"); g_object_notify ((GObject *) self, "connection-error-details"); } } static void _tp_account_removed_cb (TpAccount *self, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED, "Account removed" }; if (self->priv->removed) return; self->priv->removed = TRUE; tp_proxy_invalidate ((TpProxy *) self, &e); } static void set_connection_prepare_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpConnection *connection = (TpConnection *) object; TpAccount *self = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { DEBUG ("Error preparing connection: %s", error->message); g_clear_error (&error); goto OUT; } /* Connection could have changed again while we were preparing it */ if (self->priv->connection == connection) { self->priv->connection_prepared = TRUE; g_object_notify ((GObject *) self, "connection"); } OUT: g_object_unref (self); } static void _tp_account_set_connection (TpAccount *account, const gchar *path); static void connection_invalidated_cb (TpConnection *connection, guint domain, gint code, gchar *message, TpAccount *account) { _tp_account_set_connection (account, "/"); } static void _tp_account_set_connection (TpAccount *account, const gchar *path) { TpAccountPrivate *priv = account->priv; gboolean had_public_connection; gboolean have_public_connection; GError *error = NULL; if (priv->connection != NULL) { const gchar *current; /* Do nothing if we already have a connection for the same path */ current = tp_proxy_get_object_path (priv->connection); if (!tp_strdiff (current, path)) return; g_signal_handlers_disconnect_by_func (priv->connection, connection_invalidated_cb, account); } had_public_connection = (priv->connection != NULL && !connection_is_internal (account)); tp_clear_object (&account->priv->connection); g_free (priv->connection_object_path); priv->connection_object_path = g_strdup (path); priv->connection_prepared = FALSE; /* The account has no connection */ if (!tp_strdiff ("/", path)) { /* Do not emit change notifications if the connection was not yet made * public */ if (had_public_connection) g_object_notify (G_OBJECT (account), "connection"); return; } priv->connection = tp_simple_client_factory_ensure_connection ( tp_proxy_get_factory (account), path, NULL, &error); if (priv->connection == NULL) { DEBUG ("Failed to create a new TpConnection: %s", error->message); g_error_free (error); } else { tp_g_signal_connect_object (priv->connection, "invalidated", G_CALLBACK (connection_invalidated_cb), account, 0); _tp_connection_set_account (priv->connection, account); if (tp_proxy_is_prepared (account, TP_ACCOUNT_FEATURE_CONNECTION)) { GArray *features; features = tp_simple_client_factory_dup_connection_features ( tp_proxy_get_factory (account), priv->connection); tp_proxy_prepare_async (priv->connection, (GQuark *) features->data, set_connection_prepare_cb, g_object_ref (account)); g_array_unref (features); } } have_public_connection = (priv->connection != NULL && !connection_is_internal (account)); /* Do not emit signal if connection wasn't public and still isn't */ if (had_public_connection || have_public_connection) g_object_notify (G_OBJECT (account), "connection"); } static void _tp_account_got_all_storage_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *object) { TpAccount *self = TP_ACCOUNT (proxy); GSimpleAsyncResult *result = user_data; if (error != NULL) DEBUG ("Error getting Storage properties: %s", error->message); if (properties == NULL) self->priv->storage_provider = NULL; else self->priv->storage_provider = g_strdup (tp_asv_get_string (properties, "StorageProvider")); if (!tp_str_empty (self->priv->storage_provider)) { self->priv->storage_identifier = tp_g_value_slice_dup ( tp_asv_get_boxed (properties, "StorageIdentifier", G_TYPE_VALUE)); self->priv->storage_restrictions = tp_asv_get_uint32 (properties, "StorageRestrictions", NULL); } /* if the StorageProvider isn't known, set it to the empty string */ if (self->priv->storage_provider == NULL) self->priv->storage_provider = g_strdup (""); g_simple_async_result_complete_in_idle (result); } static void tp_account_prepare_storage_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpAccount *self = TP_ACCOUNT (proxy); GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_account_prepare_storage_async); g_assert (self->priv->storage_provider == NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_ACCOUNT_INTERFACE_STORAGE, _tp_account_got_all_storage_cb, result, g_object_unref, G_OBJECT (self)); } static void _tp_account_update (TpAccount *account, GHashTable *properties) { TpProxy *proxy = TP_PROXY (account); TpAccountPrivate *priv = account->priv; GValueArray *arr; TpConnectionStatus old_s = priv->connection_status; gboolean status_changed = FALSE; gboolean presence_changed = FALSE; const gchar *status; const gchar *message; tp_proxy_add_interfaces (proxy, tp_asv_get_strv (properties, "Interfaces")); if (g_hash_table_lookup (properties, "ConnectionStatus") != NULL) { priv->connection_status = tp_asv_get_uint32 (properties, "ConnectionStatus", NULL); if (old_s != priv->connection_status) status_changed = TRUE; } if (g_hash_table_lookup (properties, "ConnectionStatusReason") != NULL) { TpConnectionStatusReason old = priv->reason; priv->reason = tp_asv_get_uint32 (properties, "ConnectionStatusReason", NULL); if (old != priv->reason) status_changed = TRUE; } if (g_hash_table_lookup (properties, "ConnectionError") != NULL) { const gchar *new_error = tp_asv_get_string (properties, "ConnectionError"); if (tp_str_empty (new_error)) new_error = NULL; if (tp_strdiff (new_error, priv->error)) { tp_clear_pointer (&priv->error, g_free); priv->error = g_strdup (new_error); status_changed = TRUE; } } if (g_hash_table_lookup (properties, "ConnectionErrorDetails") != NULL) { const GHashTable *details = tp_asv_get_boxed (properties, "ConnectionErrorDetails", TP_HASH_TYPE_STRING_VARIANT_MAP); if ((details != NULL && tp_asv_size (details) > 0) || tp_asv_size (priv->error_details) > 0) { g_hash_table_remove_all (priv->error_details); if (details != NULL) tp_g_hash_table_update (priv->error_details, (GHashTable *) details, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); status_changed = TRUE; } } if (status_changed) { if (priv->connection_status == TP_CONNECTION_STATUS_CONNECTED) { /* our connection status is CONNECTED - clear any error we may * have recorded previously */ g_hash_table_remove_all (priv->error_details); tp_clear_pointer (&priv->error, g_free); } else if (priv->error == NULL) { /* our connection status is worse than CONNECTED but the * AccountManager didn't tell us why, so attempt to guess * a detailed error from the status reason */ const gchar *guessed = NULL; _tp_connection_status_reason_to_gerror (priv->reason, old_s, &guessed, NULL); if (guessed == NULL) guessed = TP_ERROR_STR_DISCONNECTED; priv->error = g_strdup (guessed); } } if (g_hash_table_lookup (properties, "CurrentPresence") != NULL) { presence_changed = TRUE; arr = tp_asv_get_boxed (properties, "CurrentPresence", TP_STRUCT_TYPE_SIMPLE_PRESENCE); tp_value_array_unpack (arr, 3, &priv->cur_presence, &status, &message); g_free (priv->cur_status); priv->cur_status = g_strdup (status); g_free (priv->cur_message); priv->cur_message = g_strdup (message); } if (g_hash_table_lookup (properties, "RequestedPresence") != NULL) { arr = tp_asv_get_boxed (properties, "RequestedPresence", TP_STRUCT_TYPE_SIMPLE_PRESENCE); tp_value_array_unpack (arr, 3, &priv->requested_presence, &status, &message); g_free (priv->requested_status); priv->requested_status = g_strdup (status); g_free (priv->requested_message); priv->requested_message = g_strdup (message); g_object_notify (G_OBJECT (account), "requested-presence-type"); g_object_notify (G_OBJECT (account), "requested-status"); g_object_notify (G_OBJECT (account), "requested-status-message"); } if (g_hash_table_lookup (properties, "AutomaticPresence") != NULL) { arr = tp_asv_get_boxed (properties, "AutomaticPresence", TP_STRUCT_TYPE_SIMPLE_PRESENCE); tp_value_array_unpack (arr, 3, &priv->auto_presence, &status, &message); g_free (priv->auto_status); priv->auto_status = g_strdup (status); g_free (priv->auto_message); priv->auto_message = g_strdup (message); g_object_notify (G_OBJECT (account), "automatic-presence-type"); g_object_notify (G_OBJECT (account), "automatic-status"); g_object_notify (G_OBJECT (account), "automatic-status-message"); } if (g_hash_table_lookup (properties, "DisplayName") != NULL) { gchar *old = priv->display_name; priv->display_name = g_strdup (tp_asv_get_string (properties, "DisplayName")); if (tp_strdiff (old, priv->display_name)) g_object_notify (G_OBJECT (account), "display-name"); g_free (old); } if (g_hash_table_lookup (properties, "Nickname") != NULL) { gchar *old = priv->nickname; priv->nickname = g_strdup (tp_asv_get_string (properties, "Nickname")); if (tp_strdiff (old, priv->nickname)) g_object_notify (G_OBJECT (account), "nickname"); g_free (old); } if (g_hash_table_lookup (properties, "Supersedes") != NULL) { GStrv old = priv->supersedes; GPtrArray *new_arr = tp_asv_get_boxed (properties, "Supersedes", TP_ARRAY_TYPE_OBJECT_PATH_LIST); gboolean changed = FALSE; guint i; if (new_arr == NULL) { priv->supersedes = g_new0 (gchar *, 1); } else { priv->supersedes = g_new0 (gchar *, new_arr->len + 1); for (i = 0; i < new_arr->len; i++) priv->supersedes[i] = g_strdup (g_ptr_array_index (new_arr, i)); } if (new_arr == NULL || new_arr->len == 0) { changed = (old != NULL && *old != NULL); } else if (old == NULL || *old == NULL || g_strv_length (old) != new_arr->len) { changed = TRUE; } else { for (i = 0; i < new_arr->len; i++) { if (tp_strdiff (old[i], priv->supersedes[i])) { changed = TRUE; break; } } } if (changed) g_object_notify (G_OBJECT (account), "supersedes"); g_strfreev (old); } if (g_hash_table_lookup (properties, "NormalizedName") != NULL) { gchar *old = priv->normalized_name; priv->normalized_name = g_strdup (tp_asv_get_string (properties, "NormalizedName")); if (tp_strdiff (old, priv->normalized_name)) g_object_notify (G_OBJECT (account), "normalized-name"); g_free (old); } if (g_hash_table_lookup (properties, "Icon") != NULL) { const gchar *icon_name; gchar *old = priv->icon_name; icon_name = tp_asv_get_string (properties, "Icon"); if (tp_str_empty (icon_name)) priv->icon_name = g_strdup_printf ("im-%s", priv->proto_name); else priv->icon_name = g_strdup (icon_name); if (tp_strdiff (old, priv->icon_name)) g_object_notify (G_OBJECT (account), "icon-name"); g_free (old); } if (g_hash_table_lookup (properties, "Enabled") != NULL) { gboolean enabled = tp_asv_get_boolean (properties, "Enabled", NULL); if (priv->enabled != enabled) { priv->enabled = enabled; g_object_notify (G_OBJECT (account), "enabled"); } } if (g_hash_table_lookup (properties, "Service") != NULL) { const gchar *service; gchar *old = priv->service; service = tp_asv_get_string (properties, "Service"); if (tp_str_empty (service)) priv->service = g_strdup (priv->proto_name); else priv->service = g_strdup (service); if (tp_strdiff (old, priv->service)) g_object_notify (G_OBJECT (account), "service"); g_free (old); } if (g_hash_table_lookup (properties, "Valid") != NULL) { gboolean old = priv->valid; priv->valid = tp_asv_get_boolean (properties, "Valid", NULL); if (old != priv->valid) g_object_notify (G_OBJECT (account), "valid"); } if (g_hash_table_lookup (properties, "Parameters") != NULL) { GHashTable *parameters; parameters = tp_asv_get_boxed (properties, "Parameters", TP_HASH_TYPE_STRING_VARIANT_MAP); if (priv->parameters != NULL) g_hash_table_unref (priv->parameters); priv->parameters = g_boxed_copy (TP_HASH_TYPE_STRING_VARIANT_MAP, parameters); /* this isn't a property, so we don't notify */ } if (status_changed) { g_signal_emit (account, signals[STATUS_CHANGED], 0, old_s, priv->connection_status, priv->reason, priv->error, priv->error_details); g_object_notify (G_OBJECT (account), "connection-status"); g_object_notify (G_OBJECT (account), "connection-status-reason"); g_object_notify (G_OBJECT (account), "connection-error"); g_object_notify (G_OBJECT (account), "connection-error-details"); } if (presence_changed) { g_signal_emit (account, signals[PRESENCE_CHANGED], 0, priv->cur_presence, priv->cur_status, priv->cur_message); g_object_notify (G_OBJECT (account), "current-presence-type"); g_object_notify (G_OBJECT (account), "current-status"); g_object_notify (G_OBJECT (account), "current-status-message"); } if (g_hash_table_lookup (properties, "Connection") != NULL) { const gchar *path = tp_asv_get_object_path (properties, "Connection"); _tp_account_set_connection (account, path); } if (g_hash_table_lookup (properties, "ChangingPresence") != NULL) { gboolean old = priv->changing_presence; priv->changing_presence = tp_asv_get_boolean (properties, "ChangingPresence", NULL); if (old != priv->changing_presence) g_object_notify (G_OBJECT (account), "changing-presence"); } if (g_hash_table_lookup (properties, "ConnectAutomatically") != NULL) { gboolean old = priv->connect_automatically; priv->connect_automatically = tp_asv_get_boolean (properties, "ConnectAutomatically", NULL); if (old != priv->connect_automatically) g_object_notify (G_OBJECT (account), "connect-automatically"); } if (g_hash_table_lookup (properties, "HasBeenOnline") != NULL) { gboolean old = priv->has_been_online; priv->has_been_online = tp_asv_get_boolean (properties, "HasBeenOnline", NULL); if (old != priv->has_been_online) g_object_notify (G_OBJECT (account), "has-been-online"); } _tp_proxy_set_feature_prepared (proxy, TP_ACCOUNT_FEATURE_CORE, TRUE); } static void _tp_account_properties_changed (TpAccount *proxy, GHashTable *properties, gpointer user_data, GObject *weak_object) { TpAccount *self = TP_ACCOUNT (weak_object); if (!tp_proxy_is_prepared (self, TP_ACCOUNT_FEATURE_CORE)) return; _tp_account_update (self, properties); } static void avatar_changed_cb (TpAccount *self, gpointer user_data, GObject *weak_object) { g_signal_emit (self, signals[AVATAR_CHANGED], 0); } static void _tp_account_got_all_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpAccount *self = TP_ACCOUNT (weak_object); DEBUG ("Got whole set of properties for %s", tp_proxy_get_object_path (self)); if (error != NULL) { DEBUG ("Failed to get the initial set of account properties: %s", error->message); tp_proxy_invalidate ((TpProxy *) self, error); return; } _tp_account_update (self, properties); /* We can't try connecting this signal earlier as tp_proxy_add_interfaces() * has to be called first if we support the Avatar interface. */ tp_cli_account_interface_avatar_connect_to_avatar_changed (self, avatar_changed_cb, NULL, NULL, G_OBJECT (self), NULL); } static void addressing_props_changed (TpAccount *self, GHashTable *changed_properties) { const gchar * const * v; if (self->priv->uri_schemes == NULL) /* We did not fetch the initial value yet, ignoring */ return; v = tp_asv_get_strv (changed_properties, "URISchemes"); if (v == NULL) return; g_strfreev (self->priv->uri_schemes); self->priv->uri_schemes = g_strdupv ((GStrv) v); g_object_notify (G_OBJECT (self), "uri-schemes"); } static void dbus_properties_changed_cb (TpProxy *proxy, const gchar *interface_name, GHashTable *changed_properties, const gchar **invalidated_properties, gpointer user_data, GObject *weak_object) { TpAccount *self = TP_ACCOUNT (weak_object); if (!tp_strdiff (interface_name, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING)) { addressing_props_changed (self, changed_properties); } } static void _tp_account_constructed (GObject *object) { TpAccount *self = TP_ACCOUNT (object); TpAccountPrivate *priv = self->priv; void (*chain_up) (GObject *) = ((GObjectClass *) tp_account_parent_class)->constructed; GError *error = NULL; TpProxySignalConnection *sc; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); _tp_proxy_ensure_factory (self, NULL); sc = tp_cli_account_connect_to_removed (self, _tp_account_removed_cb, NULL, NULL, NULL, &error); if (sc == NULL) { CRITICAL ("Couldn't connect to Removed: %s", error->message); g_error_free (error); } G_GNUC_BEGIN_IGNORE_DEPRECATIONS tp_account_parse_object_path (tp_proxy_get_object_path (self), &(priv->cm_name), &(priv->proto_name), NULL, NULL); G_GNUC_END_IGNORE_DEPRECATIONS priv->icon_name = g_strdup_printf ("im-%s", priv->proto_name); priv->service = g_strdup (priv->proto_name); g_signal_connect (self, "invalidated", G_CALLBACK (_tp_account_invalidated_cb), NULL); tp_cli_account_connect_to_account_property_changed (self, _tp_account_properties_changed, NULL, NULL, object, NULL); tp_cli_dbus_properties_connect_to_properties_changed (self, dbus_properties_changed_cb, NULL, NULL, object, NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_ACCOUNT, _tp_account_got_all_cb, NULL, NULL, G_OBJECT (self)); } static void _tp_account_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TpAccount *self = TP_ACCOUNT (object); switch (prop_id) { case PROP_ENABLED: g_value_set_boolean (value, self->priv->enabled); break; case PROP_CURRENT_PRESENCE_TYPE: g_value_set_uint (value, self->priv->cur_presence); break; case PROP_CURRENT_STATUS: g_value_set_string (value, self->priv->cur_status); break; case PROP_CURRENT_STATUS_MESSAGE: g_value_set_string (value, self->priv->cur_message); break; case PROP_CONNECTION_STATUS: g_value_set_uint (value, self->priv->connection_status); break; case PROP_CONNECTION_STATUS_REASON: g_value_set_uint (value, self->priv->reason); break; case PROP_CONNECTION_ERROR: g_value_set_string (value, self->priv->error); break; case PROP_CONNECTION_ERROR_DETAILS: g_value_set_boxed (value, self->priv->error_details); break; case PROP_CONNECTION: g_value_set_object (value, tp_account_get_connection (self)); break; case PROP_DISPLAY_NAME: g_value_set_string (value, tp_account_get_display_name (self)); break; case PROP_CONNECTION_MANAGER: g_value_set_string (value, self->priv->cm_name); break; case PROP_CM_NAME: g_value_set_string (value, self->priv->cm_name); break; case PROP_PROTOCOL: g_value_set_string (value, self->priv->proto_name); break; case PROP_PROTOCOL_NAME: g_value_set_string (value, self->priv->proto_name); break; case PROP_ICON_NAME: g_value_set_string (value, self->priv->icon_name); break; case PROP_CHANGING_PRESENCE: g_value_set_boolean (value, self->priv->changing_presence); break; case PROP_CONNECT_AUTOMATICALLY: g_value_set_boolean (value, self->priv->connect_automatically); break; case PROP_HAS_BEEN_ONLINE: g_value_set_boolean (value, self->priv->has_been_online); break; case PROP_SERVICE: g_value_set_string (value, self->priv->service); break; case PROP_VALID: g_value_set_boolean (value, self->priv->valid); break; case PROP_REQUESTED_PRESENCE_TYPE: g_value_set_uint (value, self->priv->requested_presence); break; case PROP_REQUESTED_STATUS: g_value_set_string (value, self->priv->requested_status); break; case PROP_REQUESTED_STATUS_MESSAGE: g_value_set_string (value, self->priv->requested_message); break; case PROP_NICKNAME: g_value_set_string (value, self->priv->nickname); break; case PROP_SUPERSEDES: g_value_set_boxed (value, self->priv->supersedes); break; case PROP_URI_SCHEMES: g_value_set_boxed (value, self->priv->uri_schemes); break; case PROP_AUTOMATIC_PRESENCE_TYPE: g_value_set_uint (value, self->priv->auto_presence); break; case PROP_AUTOMATIC_STATUS: g_value_set_string (value, self->priv->auto_status); break; case PROP_AUTOMATIC_STATUS_MESSAGE: g_value_set_string (value, self->priv->auto_message); break; case PROP_NORMALIZED_NAME: g_value_set_string (value, tp_account_get_normalized_name (self)); break; case PROP_STORAGE_PROVIDER: g_value_set_string (value, self->priv->storage_provider); break; case PROP_STORAGE_IDENTIFIER: g_value_set_boxed (value, self->priv->storage_identifier); break; case PROP_STORAGE_IDENTIFIER_VARIANT: g_value_take_variant (value, tp_account_dup_storage_identifier_variant (self)); break; case PROP_STORAGE_RESTRICTIONS: g_value_set_uint (value, self->priv->storage_restrictions); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void _tp_account_dispose (GObject *object) { TpAccount *self = TP_ACCOUNT (object); TpAccountPrivate *priv = self->priv; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; _tp_account_set_connection (self, "/"); /* release any references held by the object here */ if (G_OBJECT_CLASS (tp_account_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_account_parent_class)->dispose (object); } static void _tp_account_finalize (GObject *object) { TpAccount *self = TP_ACCOUNT (object); TpAccountPrivate *priv = self->priv; g_free (priv->connection_object_path); g_free (priv->cur_status); g_free (priv->cur_message); g_free (priv->requested_status); g_free (priv->requested_message); g_free (priv->error); g_free (priv->auto_status); g_free (priv->auto_message); g_free (priv->normalized_name); g_free (priv->nickname); g_strfreev (priv->supersedes); g_free (priv->cm_name); g_free (priv->proto_name); g_free (priv->icon_name); g_free (priv->display_name); g_free (priv->service); tp_clear_pointer (&priv->parameters, g_hash_table_unref); tp_clear_pointer (&priv->error_details, g_hash_table_unref); g_free (priv->storage_provider); tp_clear_pointer (&priv->storage_identifier, tp_g_value_slice_free); g_strfreev (priv->uri_schemes); /* free any data held directly by the object here */ if (G_OBJECT_CLASS (tp_account_parent_class)->finalize != NULL) G_OBJECT_CLASS (tp_account_parent_class)->finalize (object); } static void tp_account_class_init (TpAccountClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpAccountPrivate)); object_class->constructed = _tp_account_constructed; object_class->get_property = _tp_account_get_property; object_class->dispose = _tp_account_dispose; object_class->finalize = _tp_account_finalize; /** * TpAccount:enabled: * * Whether this account is enabled or not. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is FALSE. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_ENABLED, g_param_spec_boolean ("enabled", "Enabled", "Whether this account is enabled or not", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:current-presence-type: * * The account connection's current presence type * (a %TpConnectionPresenceType). * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for current-presence-type, * current-status and current-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %TP_CONNECTION_PRESENCE_TYPE_UNSET. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CURRENT_PRESENCE_TYPE, g_param_spec_uint ("current-presence-type", "Presence", "The account connection's current presence type", 0, TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:current-status: * * The current Status string of the account. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for current-presence-type, * current-status and current-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CURRENT_STATUS, g_param_spec_string ("current-status", "Current Status", "The Status string of the account", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:current-status-message: * * The current status message message of the account. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for current-presence-type, * current-status and current-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CURRENT_STATUS_MESSAGE, g_param_spec_string ("current-status-message", "current-status-message", "The Status message string of the account", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:changing-presence: * * %TRUE if an attempt is currently being made to change the account's * presence (#TpAccount:current-presence-type, #TpAccount:current-status * and #TpAccount:current-status-message) to match its requested presence * (#TpAccount:requested-presence-type, #TpAccount:requested-status * and #TpAccount:requested-status-message). * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %FALSE. * * Since: 0.11.6 */ g_object_class_install_property (object_class, PROP_CHANGING_PRESENCE, g_param_spec_boolean ("changing-presence", "Changing Presence", "TRUE if presence is changing", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection-status: * * The account's connection status type (a %TpConnectionStatus). * * One can receive change notifications on this property by connecting * to the #TpAccount::status-changed signal, or by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %TP_CONNECTION_STATUS_DISCONNECTED. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CONNECTION_STATUS, g_param_spec_uint ("connection-status", "ConnectionStatus", "The account's connection status type", 0, TP_NUM_CONNECTION_STATUSES, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection-status-reason: * * The account's connection status reason (a %TpConnectionStatusReason). * * One can receive change notifications on this property by connecting * to the #TpAccount::status-changed signal, or by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CONNECTION_STATUS_REASON, g_param_spec_uint ("connection-status-reason", "ConnectionStatusReason", "The account's connection status reason", 0, TP_NUM_CONNECTION_STATUS_REASONS, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection-error: * * The D-Bus error name for the last disconnection or connection failure, * (in particular, %TP_ERROR_STR_CANCELLED if it was disconnected by user * request), or %NULL if the account is connected. * * One can receive change notifications on this property by connecting * to the #TpAccount::status-changed signal, or by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.11.7 */ g_object_class_install_property (object_class, PROP_CONNECTION_ERROR, g_param_spec_string ("connection-error", "ConnectionError", "The account's last connection error", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection-error-details: * * A map from string to #GValue containing extensible error details * related to #TpAccount:connection-error. Functions like tp_asv_get_string() * can be used to read from this map. * * The keys for this map are defined by * the Telepathy D-Bus * Interface Specification. They will typically include * debug-message, which is a debugging message in the C * locale, analogous to #GError.message. * * One can receive change notifications on this property by connecting * to the #TpAccount::status-changed signal, or by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * an empty map. * * Since: 0.11.7 */ g_object_class_install_property (object_class, PROP_CONNECTION_ERROR_DETAILS, g_param_spec_boxed ("connection-error-details", "ConnectionErrorDetails", "Extensible details of the account's last connection error", G_TYPE_HASH_TABLE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection: * * The connection of the account, or %NULL if account is offline. * Note that the returned #TpConnection is not guaranteed to have any * features pre-prepared (not even %TP_CONNECTION_FEATURE_CORE) unless * %TP_ACCOUNT_FEATURE_CONNECTION has been prepared on the account * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. If %TP_ACCOUNT_FEATURE_CONNECTION has been prepared, this signal * will be delayed until the connection is ready. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CONNECTION, g_param_spec_object ("connection", "Connection", "The account's connection", TP_TYPE_CONNECTION, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:display-name: * * The account's display name, from the DisplayName property. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_DISPLAY_NAME, g_param_spec_string ("display-name", "DisplayName", "The account's display name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connection-manager: * * The account's connection manager name. * * Since: 0.9.0 * Deprecated: Use #TpAccount:cm-name instead. */ g_object_class_install_property (object_class, PROP_CONNECTION_MANAGER, g_param_spec_string ("connection-manager", "Connection manager", "The account's connection manager name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:protocol: * * The account's machine-readable protocol name, such as "jabber", "msn" or * "local-xmpp". Recommended names for most protocols can be found in the * Telepathy D-Bus Interface Specification. * * Since: 0.9.0 * Deprecated: Use #TpAccount:protocol-name instead. */ g_object_class_install_property (object_class, PROP_PROTOCOL, g_param_spec_string ("protocol", "Protocol", "The account's protocol name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:cm-name: * * The account's connection manager name. * * Since: 0.19.3 */ g_object_class_install_property (object_class, PROP_CM_NAME, g_param_spec_string ("cm-name", "Connection manager", "The account's connection manager name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:protocol-name: * * The account's machine-readable protocol name, such as "jabber", "msn" or * "local-xmpp". Recommended names for most protocols can be found in the * Telepathy D-Bus Interface Specification. * * Since: 0.19.3 */ g_object_class_install_property (object_class, PROP_PROTOCOL_NAME, g_param_spec_string ("protocol-name", "Protocol", "The account's protocol name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:service: * * A machine-readable name identifying a specific service to which this * account connects, or a copy of #TpAccount:protocol if there is no more * specific service. * * Well-known names for various services can be found in the Telepathy D-Bus * Interface Specification. * * For instance, accounts for the "jabber" protocol should have the service * names "google-talk", "ovi-chat", "facebook" and "lj-talk" for accounts * that connect to Google Talk, Ovi Chat, Facebook and Livejournal, * respectively, and this property will be "jabber" for accounts that * connect to a generic Jabber server. * * To change this property, use * tp_account_set_service_async(). * * Since: 0.11.9 */ g_object_class_install_property (object_class, PROP_SERVICE, g_param_spec_string ("service", "Service", "The account's service name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:icon-name: * * The account's icon name. To change this propery, use * tp_account_set_icon_name_async(). * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_ICON_NAME, g_param_spec_string ("icon-name", "Icon", "The account's icon name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:connect-automatically: * * Whether the account should connect automatically or not. To change this * property, use tp_account_set_connect_automatically_async(). * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %FALSE. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_CONNECT_AUTOMATICALLY, g_param_spec_boolean ("connect-automatically", "ConnectAutomatically", "Whether this account should connect automatically or not", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:has-been-online: * * Whether this account has been online or not. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %FALSE. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_HAS_BEEN_ONLINE, g_param_spec_boolean ("has-been-online", "HasBeenOnline", "Whether this account has been online or not", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:valid: * * Whether this account is valid. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %FALSE. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_VALID, g_param_spec_boolean ("valid", "Valid", "Whether this account is valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:requested-presence-type: * * The account's requested presence type (a #TpConnectionPresenceType). * * Since 0.13.8, * one can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for requested-presence-type, * requested-status and requested-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_REQUESTED_PRESENCE_TYPE, g_param_spec_uint ("requested-presence-type", "RequestedPresence", "The account's requested presence type", 0, TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:requested-status: * * The requested Status string of the account. * * Since 0.13.8, * one can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for requested-presence-type, * requested-status and requested-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_REQUESTED_STATUS, g_param_spec_string ("requested-status", "RequestedStatus", "The account's requested status string", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:requested-status-message: * * The requested status message message of the account. * * Since 0.13.8, * one can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for requested-presence-type, * requested-status and requested-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_REQUESTED_STATUS_MESSAGE, g_param_spec_string ("requested-status-message", "RequestedStatusMessage", "The requested Status message string of the account", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:nickname: * * The nickname that should be set for the user on this account. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.9.0 */ g_object_class_install_property (object_class, PROP_NICKNAME, g_param_spec_string ("nickname", "Nickname", "The account's nickname", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:automatic-presence-type: * * The account's automatic presence type (a #TpConnectionPresenceType). * * When the account is put online automatically, for instance to make a * channel request or because network connectivity becomes available, * the automatic presence type, status and message will be copied to * their "requested" counterparts. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for automatic-presence-type, * automatic-status and automatic-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %TP_CONNECTION_PRESENCE_TYPE_UNSET. * * Since: 0.13.8 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_PRESENCE_TYPE, g_param_spec_uint ("automatic-presence-type", "AutomaticPresence type", "Presence type used to put the account online automatically", 0, TP_NUM_CONNECTION_PRESENCE_TYPES, TP_CONNECTION_PRESENCE_TYPE_UNSET, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:automatic-status: * * The string status name to use in conjunction with the * #TpAccount:automatic-presence-type. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for automatic-presence-type, * automatic-status and automatic-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.13.8 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_STATUS, g_param_spec_string ("automatic-status", "AutomaticPresence status", "Presence status used to put the account online automatically", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:automatic-status-message: * * The user-defined message to use in conjunction with the * #TpAccount:automatic-presence-type. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. Change notifications for automatic-presence-type, * automatic-status and automatic-status-message are always emitted together, * so it is sufficient to connect to one of the notification signals. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.13.8 */ g_object_class_install_property (object_class, PROP_AUTOMATIC_STATUS_MESSAGE, g_param_spec_string ("automatic-status-message", "AutomaticPresence message", "User-defined message used to put the account online automatically", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:normalized-name: * * The normalized form of the user's own unique identifier on this * protocol. For example, on XMPP accounts this is the user's JID; on * ICQ this is the user's UIN; and so on. * * One can receive change notifications on this property by connecting * to the #GObject::notify signal and using this property as the signal * detail. * * This is not guaranteed to have been retrieved until * tp_proxy_prepare_async() has finished; until then, the value is * %NULL. * * Since: 0.13.8 */ g_object_class_install_property (object_class, PROP_NORMALIZED_NAME, g_param_spec_string ("normalized-name", "NormalizedName", "The normalized identifier of the user", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:storage-provider: * * The storage provider for this account. * * The name of the account storage implementation. When this * is the empty string the account is internally stored. * * This property cannot change once an Account has been created. * * This is not guaranteed to have been retrieved until the * %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, * the value is %NULL. * * Since: 0.13.2 */ g_object_class_install_property (object_class, PROP_STORAGE_PROVIDER, g_param_spec_string ("storage-provider", "StorageProvider", "The storage provider for this account", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:storage-identifier: * * The storage identifier for this account. * * A provider-specific variant type used to identify this account with the * provider. This value will be %NULL if #TpAccount:storage-provider is * an empty string. * * This property cannot change once an Account has been created. * * This is not guaranteed to have been retrieved until the * %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, * the value is %NULL. * * Since: 0.13.2 */ g_object_class_install_property (object_class, PROP_STORAGE_IDENTIFIER, g_param_spec_boxed ("storage-identifier", "StorageIdentifier", "The storage identifier for this account", G_TYPE_VALUE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:storage-identifier-variant: * * Provider-specific information used to identify this * account. Use g_variant_get_type() to check that the type * is what you expect. For instance, if you use a * #TpAccount:storage-provider with numeric identifiers for accounts, * this variant might have type %G_VARIANT_TYPE_UINT32; * if the storage provider has string-based identifiers, it should * have type %G_VARIANT_TYPE_STRING. * * This property cannot change once an Account has been created. * * This is not guaranteed to have been retrieved until the * %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, * the value is %NULL. * * Since: 0.13.2 */ g_object_class_install_property (object_class, PROP_STORAGE_IDENTIFIER_VARIANT, g_param_spec_variant ("storage-identifier-variant", "StorageIdentifier as variant", "The storage identifier for this account", G_VARIANT_TYPE_ANY, NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:storage-restrictions: * * The storage restrictions for this account. * * A bitfield of #TpStorageRestrictionFlags that give the limitations of * this account imposed by the storage provider. This value will be 0 * if #TpAccount:storage-provider is an empty string. * * This property cannot change once an Account has been created. * * This is not guaranteed to have been retrieved until the * %TP_ACCOUNT_FEATURE_STORAGE feature has been prepared; until then, * the value is 0. * * Since: 0.13.2 */ g_object_class_install_property (object_class, PROP_STORAGE_RESTRICTIONS, g_param_spec_uint ("storage-restrictions", "StorageRestrictions", "The storage restrictions for this account", 0, G_MAXUINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:supersedes: * * The object paths of previously-active accounts superseded by this one. * For instance, this can be used in a logger to read old logs for an * account that has been migrated from one connection manager to another. * * This is not guaranteed to have been retrieved until the * %TP_ACCOUNT_FEATURE_CORE feature has been prepared; until then, * the value is NULL. * * Since: 0.17.5 */ g_object_class_install_property (object_class, PROP_SUPERSEDES, g_param_spec_boxed ("supersedes", "Supersedes", "Accounts superseded by this one", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount:uri-schemes: * * If the %TP_ACCOUNT_FEATURE_ADDRESSING feature has been prepared * successfully, a list of additional URI schemes for which this * account should be used if possible. Otherwise %NULL. * * For instance, a SIP or Skype account might have "tel" in this list if the * user would like to use that account to call phone numbers. * * This list should not contain the primary URI scheme(s) for the account's * protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), * since it should be assumed to be useful for those schemes in any case. * * The notify::uri-schemes signal cannot be relied on if the Account Manager * is Mission Control version 5.14.0 or older. * * Since: 0.21.0 */ g_object_class_install_property (object_class, PROP_URI_SCHEMES, g_param_spec_boxed ("uri-schemes", "URISchemes", "URISchemes", G_TYPE_STRV, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpAccount::status-changed: * @account: the #TpAccount * @old_status: old #TpAccount:connection-status * @new_status: new #TpAccount:connection-status * @reason: the #TpAccount:connection-status-reason * @dbus_error_name: (allow-none): the #TpAccount:connection-error * @details: (element-type utf8 GObject.Value): the * #TpAccount:connection-error-details * * Emitted when the connection status on the account changes. * * The @dbus_error_name and @details parameters were present, but * non-functional (always %NULL), in older versions. They have been * available with their current behaviour since version 0.11.7. * * Since: 0.9.0 */ signals[STATUS_CHANGED] = g_signal_new ("status-changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 5, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_HASH_TABLE); /** * TpAccount::presence-changed: * @account: the #TpAccount * @presence: the new presence * @status: the new presence status * @status_message: the new presence status message * * Emitted when the presence of the account changes. * * Since: 0.9.0 */ signals[PRESENCE_CHANGED] = g_signal_new ("presence-changed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); /** * TpAccount::avatar-changed: * @self: a #TpAccount * * Emitted when the avatar changes. Call tp_account_get_avatar_async() * to get the new avatar data. * * Since: 0.23.0 */ signals[AVATAR_CHANGED] = g_signal_new ("avatar-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); proxy_class->interface = TP_IFACE_QUARK_ACCOUNT; proxy_class->list_features = _tp_account_list_features; tp_account_init_known_interfaces (); } /** * tp_account_init_known_interfaces: * * Ensure that the known interfaces for TpAccount have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_ACCOUNT. * * Since: 0.7.32 */ void tp_account_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_ACCOUNT; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_account_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_account_new: * @bus_daemon: Proxy for the D-Bus daemon * @object_path: The non-NULL object path of this account * @error: Used to raise an error if @object_path is not valid * * Convenience function to create a new account proxy. The returned #TpAccount * is not guaranteed to be ready at the point of return. * * Returns: a new reference to an account proxy, or %NULL if @object_path is * not valid * Deprecated: Use tp_simple_client_factory_ensure_account() instead. */ TpAccount * tp_account_new (TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error) { return _tp_account_new_with_factory (NULL, bus_daemon, object_path, error); } TpAccount * _tp_account_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error) { TpAccount *self; g_return_val_if_fail (TP_IS_DBUS_DAEMON (bus_daemon), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (!tp_account_parse_object_path (object_path, NULL, NULL, NULL, error)) return NULL; G_GNUC_END_IGNORE_DEPRECATIONS self = TP_ACCOUNT (g_object_new (TP_TYPE_ACCOUNT, "dbus-daemon", bus_daemon, "dbus-connection", ((TpProxy *) bus_daemon)->dbus_connection, "bus-name", TP_ACCOUNT_MANAGER_BUS_NAME, "object-path", object_path, "factory", factory, NULL)); return self; } static gchar * unescape_protocol (gchar *protocol) { if (strstr (protocol, "_2d") != NULL) { /* Work around MC5 bug where it escapes with tp_escape_as_identifier * rather than doing it properly. MC5 saves the object path in your * config, so if you've ever used a buggy MC5, the path will be wrong * forever. */ gchar **chunks = g_strsplit (protocol, "_2d", 0); gchar *new = g_strjoinv ("-", chunks); g_strfreev (chunks); g_free (protocol); protocol = new; } g_strdelimit (protocol, "_", '-'); return protocol; } /** * tp_account_get_connection: * @account: a #TpAccount * * * * Returns: (transfer none): the same as the #TpAccount:connection property * * Since: 0.9.0 **/ TpConnection * tp_account_get_connection (TpAccount *account) { TpAccountPrivate *priv; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); priv = account->priv; /* If we want to expose only prepared connection */ if (connection_is_internal (account)) return NULL; return priv->connection; } /** * tp_account_ensure_connection: * @account: a #TpAccount * @path: the path to connection object for #TpAccount * * Set the connection of the account by specifying the connection object path. * This function does not return a new ref and it is not guaranteed that the * returned #TpConnection object is ready. * * The use-case for this function is in a HandleChannels callback and you * already know the object path for the connection, so you can let @account * create its #TpConnection and return it for use. * * Returns: (transfer none): the connection of the account, or %NULL if either * the object path @path is invalid or it is the null-value "/" * * Since: 0.9.0 * Deprecated: New code should use tp_simple_client_factory_ensure_connection() * instead. **/ TpConnection * tp_account_ensure_connection (TpAccount *account, const gchar *path) { TpAccountPrivate *priv; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); priv = account->priv; /* double-check that the object path is valid */ if (!tp_dbus_check_valid_object_path (path, NULL)) return NULL; /* Should be a full object path, not the special "/" value */ if (!tp_strdiff (path, "/")) return NULL; _tp_account_set_connection (account, path); return priv->connection; } /** * tp_account_get_path_suffix: * @account: a #TpAccount * * Returns the portion of @account's object path after the standard * #TP_ACCOUNT_OBJECT_PATH_BASE prefix, of the form "cm/protocol/acct". This * string uniquely identifies the account. * * This function is only intended to be used when printing debug messages or in * tools for developer. For a string suitable for displaying to the user, see * tp_account_get_display_name(). To retrieve the connection manager and * protocol name parts of the object path, see * tp_account_get_connection_manager() and tp_account_get_protocol(). For * persistent identification of the account, use tp_proxy_get_object_path(). * * Returns: a suffix of @account's object path, for debugging purposes. * Since: 0.13.9 */ const gchar * tp_account_get_path_suffix (TpAccount *account) { const gchar *path; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); path = tp_proxy_get_object_path (account); g_return_val_if_fail (g_str_has_prefix (path, TP_ACCOUNT_OBJECT_PATH_BASE), path); return path + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); } /** * tp_account_get_display_name: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:display-name property * * Since: 0.9.0 **/ const gchar * tp_account_get_display_name (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->display_name; } /** * tp_account_is_valid: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:valid property * * Since: 0.9.0 */ gboolean tp_account_is_valid (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); return account->priv->valid; } /** * tp_account_get_connection_manager: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:connection-manager property * * Since: 0.9.0 * Deprecated: Use tp_account_get_cm_name() instead. */ const gchar * tp_account_get_connection_manager (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->cm_name; } /** * tp_account_get_protocol: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:protocol property * * Since: 0.9.0 * Deprecated: Use tp_account_get_cm_name() instead. */ const gchar * tp_account_get_protocol (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->proto_name; } /** * tp_account_get_cm_name: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:cm-name property * * Since: 0.19.3 */ const gchar * tp_account_get_cm_name (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->cm_name; } /** * tp_account_get_protocol_name: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:protocol-name property * * Since: 0.19.3 */ const gchar * tp_account_get_protocol_name (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->proto_name; } /** * tp_account_get_service: * @self: an account * * * * Returns: the same as the #TpAccount:service property * * Since: 0.11.9 */ const gchar * tp_account_get_service (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return self->priv->service; } /** * tp_account_get_icon_name: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:icon-name property * * Since: 0.9.0 */ const gchar * tp_account_get_icon_name (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->icon_name; } /** * tp_account_get_parameters: * @account: a #TpAccount * * Returns the parameters of the account, in a hash table where each string * is the parameter name (account, password, require-encryption etc.), and * each value is a #GValue. Using the tp_asv_get family of functions * (tp_asv_get_uint32(), tp_asv_get_string() etc.) to access the parameters is * recommended. * * The allowed parameters depend on the connection manager, and can be found * via tp_connection_manager_get_protocol() and * tp_connection_manager_protocol_get_param(). Well-known parameters are * listed * in * the Telepathy D-Bus Interface Specification. * * Returns: (transfer none) (element-type utf8 GObject.Value): the hash table of * parameters on @account * * Since: 0.9.0 */ const GHashTable * tp_account_get_parameters (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->parameters; } /** * tp_account_dup_parameters_vardict: * @account: a #TpAccount * * Returns the parameters of the account, in a variant of type * %G_VARIANT_TYPE_VARDICT where the keys * are parameter names (account, password, require-encryption etc.). * Use g_variant_lookup() or g_variant_lookup_value() for convenient * access to the values. * * The allowed parameters depend on the connection manager, and can be found * via tp_connection_manager_get_protocol() and * tp_connection_manager_protocol_get_param(). Well-known parameters are * listed * in * the Telepathy D-Bus Interface Specification. * * Returns: (transfer full): the dictionary of * parameters on @account, of type %G_VARIANT_TYPE_VARDICT * * Since: 0.17.6 */ GVariant * tp_account_dup_parameters_vardict (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return _tp_asv_to_vardict (account->priv->parameters); } /** * tp_account_is_enabled: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:enabled property * * Since: 0.9.0 */ gboolean tp_account_is_enabled (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); return account->priv->enabled; } static void _tp_account_property_set_cb (TpProxy *proxy, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to set property: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_account_set_enabled_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async set of the Enabled property. * * Returns: %TRUE if the set was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_set_enabled_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_enabled_finish); } /** * tp_account_set_enabled_async: * @account: a #TpAccount * @enabled: the new enabled value of @account * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the Enabled property of @account. When the * operation is finished, @callback will be called. You can then call * tp_account_set_enabled_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_set_enabled_async (TpAccount *account, gboolean enabled, GAsyncReadyCallback callback, gpointer user_data) { GValue value = {0, }; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_enabled_finish); g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, enabled); tp_cli_dbus_properties_call_set (TP_PROXY (account), -1, TP_IFACE_ACCOUNT, "Enabled", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_reset (&value); } static void _tp_account_void_cb (TpAccount *proxy, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_account_reconnect_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to be filled * * Finishes an async reconnect of @account. * * Returns: %TRUE if the reconnect call was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_reconnect_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_reconnect_finish); } /** * tp_account_reconnect_async: * @account: a #TpAccount * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous reconnect of @account. When the operation is * finished, @callback will be called. You can then call * tp_account_reconnect_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_reconnect_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_reconnect_finish); tp_cli_account_call_reconnect (account, -1, _tp_account_void_cb, result, NULL, G_OBJECT (account)); } /** * tp_account_set_automatic_presence_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an asynchronous request to change the automatic presence of * @account. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.13.8 */ gboolean tp_account_set_automatic_presence_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_automatic_presence_async) } /** * tp_account_set_automatic_presence_async: * @account: a #TpAccount * @type: the requested presence * @status: a status message to set, or %NULL * @message: a message for the change, or %NULL * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous change of @account's automatic presence. When the * operation is finished, @callback will be called. You can then call * tp_account_set_automatic_presence_finish() to get the result of the * operation. * * Since: 0.13.8 */ void tp_account_set_automatic_presence_async (TpAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GValue value = {0, }; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_automatic_presence_async); g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_value_take_boxed (&value, tp_value_array_build (3, G_TYPE_UINT, type, G_TYPE_STRING, status, G_TYPE_STRING, message, G_TYPE_INVALID)); tp_cli_dbus_properties_call_set (TP_PROXY (account), -1, TP_IFACE_ACCOUNT, "AutomaticPresence", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } /** * tp_account_request_presence_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async presence change request on @account. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_request_presence_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_request_presence_finish); } /** * tp_account_request_presence_async: * @account: a #TpAccount * @type: the requested presence * @status: a status message to set, or %NULL * @message: a message for the change, or %NULL * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous change of presence on @account. When the * operation is finished, @callback will be called. You can then call * tp_account_request_presence_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_request_presence_async (TpAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GValue value = {0, }; GValueArray *arr; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_request_presence_finish); g_value_init (&value, TP_STRUCT_TYPE_SIMPLE_PRESENCE); g_value_take_boxed (&value, dbus_g_type_specialized_construct ( TP_STRUCT_TYPE_SIMPLE_PRESENCE)); arr = (GValueArray *) g_value_get_boxed (&value); g_value_set_uint (arr->values, type); g_value_set_static_string (arr->values + 1, status); g_value_set_static_string (arr->values + 2, message); tp_cli_dbus_properties_call_set (TP_PROXY (account), -1, TP_IFACE_ACCOUNT, "RequestedPresence", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } static void _tp_account_updated_cb (TpAccount *proxy, const gchar **reconnect_required, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); if (error != NULL) g_simple_async_result_set_from_error (result, error); else g_simple_async_result_set_op_res_gpointer (result, g_strdupv ((GStrv) reconnect_required), (GDestroyNotify) g_strfreev); g_simple_async_result_complete_in_idle (result); g_object_unref (G_OBJECT (result)); } /** * tp_account_update_parameters_async: * @account: a #TpAccount * @parameters: (element-type utf8 GObject.Value) (transfer none): new * parameters to set on @account * @unset_parameters: list of parameters to unset on @account * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous update of parameters of @account. When the * operation is finished, @callback will be called. You can then call * tp_account_update_parameters_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_update_parameters_async (TpAccount *account, GHashTable *parameters, const gchar **unset_parameters, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_update_parameters_finish); tp_cli_account_call_update_parameters (account, -1, parameters, unset_parameters, _tp_account_updated_cb, result, NULL, G_OBJECT (account)); } /** * tp_account_update_parameters_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @reconnect_required: (out) (array zero-terminated=1) (transfer full): a #GStrv to * fill with properties that need a reconnect to take effect * @error: a #GError to fill * * Finishes an async update of the parameters on @account. * * Returns: %TRUE if the request succeeded, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_update_parameters_finish (TpAccount *account, GAsyncResult *result, gchar ***reconnect_required, GError **error) { _tp_implement_finish_copy_pointer (account, tp_account_update_parameters_finish, g_strdupv, reconnect_required); } /** * tp_account_update_parameters_vardict_async: * @account: a #TpAccount * @parameters: (transfer none): a variant of type %G_VARIANT_TYPE_VARDICT * containing new parameters to set on @account * @unset_parameters: (array zero-terminated=1): list of parameters to unset on @account * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous update of parameters of @account. When the * operation is finished, @callback will be called. You can then call * tp_account_update_parameters_finish() to get the result of the operation. * * If @parameters is a floating reference (see g_variant_ref_sink()), * ownership of @parameters is taken by this function. This means * you can pass the result of g_variant_new() or g_variant_new_parsed() * directly to this function without additional reference-count management. * * Since: 0.17.6 */ void tp_account_update_parameters_vardict_async (TpAccount *account, GVariant *parameters, const gchar **unset_parameters, GAsyncReadyCallback callback, gpointer user_data) { GHashTable *hash; hash = _tp_asv_from_vardict (parameters); g_variant_ref_sink (parameters); tp_account_update_parameters_async (account, hash, unset_parameters, callback, user_data); g_variant_unref (parameters); g_hash_table_unref (hash); } /** * tp_account_update_parameters_vardict_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @reconnect_required: (out) (type GStrv) (transfer full): a #GStrv to * fill with properties that need a reconnect to take effect * @error: a #GError to fill * * Finishes an async update of the parameters on @account. * * Returns: %TRUE if the request succeeded, otherwise %FALSE * * Since: 0.17.6 */ gboolean tp_account_update_parameters_vardict_finish (TpAccount *account, GAsyncResult *result, gchar ***reconnect_required, GError **error) { /* share an implementation with the non-vardict version */ return tp_account_update_parameters_finish (account, result, reconnect_required, error); } /** * tp_account_set_display_name_async: * @account: a #TpAccount * @display_name: a new display name, or %NULL to unset the display name * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the DisplayName property of @account. When * the operation is finished, @callback will be called. You can then call * tp_account_set_display_name_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_set_display_name_async (TpAccount *account, const char *display_name, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GValue value = {0, }; const gchar *display_name_set; g_return_if_fail (TP_IS_ACCOUNT (account)); if (display_name == NULL) display_name_set = ""; else display_name_set = display_name; result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_display_name_finish); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, display_name_set); tp_cli_dbus_properties_call_set (account, -1, TP_IFACE_ACCOUNT, "DisplayName", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } /** * tp_account_set_display_name_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async set of the DisplayName property. * * Returns: %TRUE if the call was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_set_display_name_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_display_name_finish); } /** * tp_account_set_service_async: * @self: a #TpAccount * @service: a new service name, or %NULL or the empty string to unset the * service name (which will result in the #TpAccount:service property * becoming the same as #TpAccount:protocol) * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the Service property on @self. When * the operation is finished, @callback will be called. You can then call * tp_account_set_service_finish() to get the result of the operation. * * Since: 0.11.9 */ void tp_account_set_service_async (TpAccount *self, const char *service, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GValue value = {0, }; g_return_if_fail (TP_IS_ACCOUNT (self)); if (service == NULL) service = ""; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_set_service_async); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, service); tp_cli_dbus_properties_call_set (self, -1, TP_IFACE_ACCOUNT, "Service", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (self)); g_value_unset (&value); } /** * tp_account_set_service_finish: * @self: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async set of the Service parameter. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.11.9 */ gboolean tp_account_set_service_finish (TpAccount *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_account_set_service_async); } /** * tp_account_set_icon_name_async: * @account: a #TpAccount * @icon_name: a new icon name, or %NULL to unset the icon name * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the Icon property of @account. When * the operation is finished, @callback will be called. You can then call * tp_account_set_icon_name_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_set_icon_name_async (TpAccount *account, const char *icon_name, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GValue value = {0, }; const char *icon_name_set; g_return_if_fail (TP_IS_ACCOUNT (account)); if (icon_name == NULL) /* settings an empty icon name is allowed */ icon_name_set = ""; else icon_name_set = icon_name; result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_icon_name_finish); g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, icon_name_set); tp_cli_dbus_properties_call_set (account, -1, TP_IFACE_ACCOUNT, "Icon", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } /** * tp_account_set_icon_name_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async set of the Icon parameter. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_set_icon_name_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_icon_name_finish); } /** * tp_account_remove_async: * @account: a #TpAccount * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous removal of @account. When the operation is * finished, @callback will be called. You can then call * tp_account_remove_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_remove_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_remove_finish); tp_cli_account_call_remove (account, -1, _tp_account_void_cb, result, NULL, G_OBJECT (account)); } /** * tp_account_remove_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async removal of @account. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_remove_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_remove_finish); } /** * tp_account_get_changing_presence: * @self: an account * * * * Returns: the same as the #TpAccount:changing-presence property * * Since: 0.11.6 */ gboolean tp_account_get_changing_presence (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), FALSE); return self->priv->changing_presence; } /** * tp_account_get_connect_automatically: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:connect-automatically property * * Since: 0.9.0 */ gboolean tp_account_get_connect_automatically (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); return account->priv->connect_automatically; } /** * tp_account_set_connect_automatically_async: * @account: a #TpAccount * @connect_automatically: new value for the parameter * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the ConnectAutomatically property of * @account. When the operation is finished, @callback will be called. You can * then call tp_account_set_display_name_finish() to get the result of the * operation. * * Since: 0.9.0 */ void tp_account_set_connect_automatically_async (TpAccount *account, gboolean connect_automatically, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GValue value = {0, }; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_connect_automatically_finish); g_value_init (&value, G_TYPE_BOOLEAN); g_value_set_boolean (&value, connect_automatically); tp_cli_dbus_properties_call_set (account, -1, TP_IFACE_ACCOUNT, "ConnectAutomatically", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } /** * tp_account_set_connect_automatically_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async set of the ConnectAutomatically property. * * Returns: %TRUE if the call was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_set_connect_automatically_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_connect_automatically_finish); } /** * tp_account_get_has_been_online: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:has-been-online property * * Since: 0.9.0 */ gboolean tp_account_get_has_been_online (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), FALSE); return account->priv->has_been_online; } /** * tp_account_get_connection_status: * @account: a #TpAccount * @reason: (out): a #TpConnectionStatusReason to fill, or %NULL * * Gets the connection status and reason from @account. The two values * are the same as the #TpAccount:connection-status and * #TpAccount:connection-status-reason properties. * * Returns: the same as the #TpAccount:connection-status property * * Since: 0.9.0 */ TpConnectionStatus tp_account_get_connection_status (TpAccount *account, TpConnectionStatusReason *reason) { g_return_val_if_fail (TP_IS_ACCOUNT (account), TP_CONNECTION_STATUS_DISCONNECTED); /* there's no _UNSET */ if (reason != NULL) *reason = account->priv->reason; return account->priv->connection_status; } /** * tp_account_get_current_presence: * @account: a #TpAccount * @status: (out) (transfer full): return location for the current status * @status_message: (out) (transfer full): return location for the current * status message * * Gets the current presence, status and status message of @account. These * values are the same as the #TpAccount:current-presence-type, * #TpAccount:current-status and #TpAccount:current-status-message properties. * * Returns: the same as the #TpAccount:current-presence-type property * * Since: 0.9.0 */ TpConnectionPresenceType tp_account_get_current_presence (TpAccount *account, gchar **status, gchar **status_message) { g_return_val_if_fail (TP_IS_ACCOUNT (account), TP_CONNECTION_PRESENCE_TYPE_UNSET); if (status != NULL) *status = g_strdup (account->priv->cur_status); if (status_message != NULL) *status_message = g_strdup (account->priv->cur_message); return account->priv->cur_presence; } /** * tp_account_get_requested_presence: * @account: a #TpAccount * @status: (out) (transfer none): return location for the requested status * @status_message: (out) (transfer full): return location for the requested * status message * * Gets the requested presence, status and status message of @account. These * values are the same as the #TpAccount:requested-presence-type, * #TpAccount:requested-status and #TpAccount:requested-status-message * properties. * * Returns: the same as the #TpAccount:requested-presence-type property * * Since: 0.9.0 */ TpConnectionPresenceType tp_account_get_requested_presence (TpAccount *account, gchar **status, gchar **status_message) { g_return_val_if_fail (TP_IS_ACCOUNT (account), TP_CONNECTION_PRESENCE_TYPE_UNSET); if (status != NULL) *status = g_strdup (account->priv->requested_status); if (status_message != NULL) *status_message = g_strdup (account->priv->requested_message); return account->priv->requested_presence; } /** * tp_account_get_nickname: * @account: a #TpAccount * * * * Returns: the same as the #TpAccount:nickname property * * Since: 0.9.0 */ const gchar * tp_account_get_nickname (TpAccount *account) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); return account->priv->nickname; } /** * tp_account_set_nickname_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async nickname change request on @account. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.9.0 */ gboolean tp_account_set_nickname_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_void (account, tp_account_set_nickname_finish); } /** * tp_account_set_nickname_async: * @account: a #TpAccount * @nickname: a new nickname to set * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous change of the Nickname parameter on @account. When * the operation is finished, @callback will be called. You can then call * tp_account_set_nickname_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_set_nickname_async (TpAccount *account, const gchar *nickname, GAsyncReadyCallback callback, gpointer user_data) { GValue value = {0, }; GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); g_return_if_fail (nickname != NULL); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_set_nickname_finish); if (nickname == NULL) { g_simple_async_report_error_in_idle (G_OBJECT (account), callback, user_data, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT, "Can't set an empty nickname"); return; } g_value_init (&value, G_TYPE_STRING); g_value_set_string (&value, nickname); tp_cli_dbus_properties_call_set (TP_PROXY (account), -1, TP_IFACE_ACCOUNT, "Nickname", &value, _tp_account_property_set_cb, result, NULL, G_OBJECT (account)); g_value_unset (&value); } /** * tp_account_get_supersedes: * @self: a #TpAccount * * Return the same thing as the #TpAccount:supersedes property, in a way * that may be more convenient for C code. * * The returned pointers are not guaranteed to remain valid after the * main loop has been re-entered. * * Returns: (transfer none): the same as the #TpAccount:supersedes property * * Since: 0.17.5 */ const gchar * const * tp_account_get_supersedes (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return (const gchar * const *) self->priv->supersedes; } static void _tp_account_got_avatar_cb (TpProxy *proxy, const GValue *out_Value, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); if (error != NULL) { DEBUG ("Failed to get avatar: %s", error->message); g_simple_async_result_set_from_error (result, error); } else if (!G_VALUE_HOLDS (out_Value, TP_STRUCT_TYPE_AVATAR)) { DEBUG ("Avatar had wrong type: %s", G_VALUE_TYPE_NAME (out_Value)); g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_CONFUSED, "Incorrect type for Avatar property"); } else { GValueArray *avatar; GArray *res; const GArray *tmp; const gchar *mime_type; avatar = g_value_get_boxed (out_Value); tp_value_array_unpack (avatar, 2, &tmp, &mime_type); res = g_array_sized_new (FALSE, FALSE, 1, tmp->len); g_array_append_vals (res, tmp->data, tmp->len); g_simple_async_result_set_op_res_gpointer (result, res, (GDestroyNotify) g_array_unref); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_account_get_avatar_async: * @account: a #TpAccount * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous get of @account's avatar. When * the operation is finished, @callback will be called. You can then call * tp_account_get_avatar_finish() to get the result of the operation. * * Since: 0.9.0 */ void tp_account_get_avatar_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (account)); result = g_simple_async_result_new (G_OBJECT (account), callback, user_data, tp_account_get_avatar_finish); tp_cli_dbus_properties_call_get (account, -1, TP_IFACE_ACCOUNT_INTERFACE_AVATAR, "Avatar", _tp_account_got_avatar_cb, result, NULL, G_OBJECT (account)); } /** * tp_account_get_avatar_finish: * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async get operation of @account's avatar. * * Beware that the returned value is only valid until @result is freed. * Copy it with g_array_ref() if you need to keep it for longer. * * Returns: (element-type guchar) (transfer none): a #GArray of #guchar * containing the bytes of the account's avatar, or %NULL on failure * * Since: 0.9.0 */ const GArray * tp_account_get_avatar_finish (TpAccount *account, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (account, tp_account_get_avatar_finish, /* do not copy */); } /** * tp_account_is_prepared: (skip) * @account: a #TpAccount * @feature: a feature which is required * * * * Returns: the same thing as tp_proxy_is_prepared() * * Since: 0.9.0 * Deprecated: since 0.23.0, use tp_proxy_is_prepared() instead. */ gboolean tp_account_is_prepared (TpAccount *account, GQuark feature) { return tp_proxy_is_prepared (account, feature); } /** * tp_account_prepare_async: (skip) * @account: a #TpAccount * @features: a 0-terminated list of features, or %NULL * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous preparation of @account with the features specified * by @features. When the operation is finished, @callback will be called. You * can then call tp_account_prepare_finish() to get the result of the * operation. * * If @features is %NULL, then @callback will be called when the implied * %TP_ACCOUNT_FEATURE_CORE feature is ready. * * If %NULL is given to @callback, then no callback will be called when the * operation is finished. Instead, it will simply set @features on @manager. * Note that if @callback is %NULL, then @user_data must also be %NULL. * * Since 0.11.3, this is equivalent to calling the new function * tp_proxy_prepare_async() with the same arguments. * * Since: 0.9.0 * Deprecated: since 0.15.6, use tp_proxy_prepare_async() instead. */ void tp_account_prepare_async (TpAccount *account, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data) { tp_proxy_prepare_async (account, features, callback, user_data); } /** * tp_account_prepare_finish: (skip) * @account: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async preparation of the account @account. * * Returns: %TRUE if the preparation was successful, otherwise %FALSE * * Since: 0.9.0 * Deprecated: since 0.15.6, use tp_proxy_prepare_finish() instead. */ gboolean tp_account_prepare_finish (TpAccount *account, GAsyncResult *result, GError **error) { return tp_proxy_prepare_finish (account, result, error); } static void set_or_free (gchar **target, gchar *source) { if (target != NULL) *target = source; else g_free (source); } /** * tp_account_parse_object_path: * @object_path: a Telepathy Account's object path * @cm: (out) (transfer full): location at which to store the account's * connection manager's name * @protocol: (out) (transfer full): location at which to store the account's * protocol * @account_id: (out) (transfer full): location at which to store the account's * unique identifier * @error: location at which to return an error * * Validates and parses a Telepathy Account's object path, extracting the * connection manager's name, the protocol, and the account's unique identifier * from the path. This includes replacing underscores with hyphens in the * protocol name, as defined in the Account specification. * * Any of the out parameters may be %NULL if not needed. If %TRUE is returned, * the caller is responsible for freeing the strings stored in any non-%NULL * out parameters, using g_free(). * * Returns: %TRUE if @object_path was successfully parsed; %FALSE and sets * @error otherwise. * * Since: 0.9.0 * Deprecated: Use tp_account_get_protocol() and * tp_account_get_connection_manager() instead. */ gboolean tp_account_parse_object_path (const gchar *object_path, gchar **cm, gchar **protocol, gchar **account_id, GError **error) { const gchar *suffix; gchar **segments; if (!tp_dbus_check_valid_object_path (object_path, error)) return FALSE; if (!g_str_has_prefix (object_path, TP_ACCOUNT_OBJECT_PATH_BASE)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path does not start with the right prefix: %s", object_path); return FALSE; } suffix = object_path + strlen (TP_ACCOUNT_OBJECT_PATH_BASE); segments = g_strsplit (suffix, "/", 0); if (g_strv_length (segments) != 3) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path '%s' is malformed: should have 3 trailing components, " "not %u", object_path, g_strv_length (segments)); goto free_segments_and_fail; } if (!g_ascii_isalpha (segments[0][0])) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path '%s' is malformed: CM name should start with a letter", object_path); goto free_segments_and_fail; } if (!g_ascii_isalpha (segments[1][0])) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path '%s' is malformed: " "protocol name should start with a letter", object_path); goto free_segments_and_fail; } if (!g_ascii_isalpha (segments[2][0]) && segments[2][0] != '_') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Account path '%s' is malformed: " "account ID should start with a letter or underscore", object_path); goto free_segments_and_fail; } set_or_free (cm, segments[0]); set_or_free (protocol, unescape_protocol (segments[1])); set_or_free (account_id, segments[2]); /* Not g_strfreev because we stole or freed the individual strings */ g_free (segments); return TRUE; free_segments_and_fail: g_strfreev (segments); return FALSE; } /** * _tp_account_refresh_properties: * @account: a #TpAccount * * Refreshes @account's hashtable of properties with what actually exists on * the account manager. * * Since: 0.9.0 */ void _tp_account_refresh_properties (TpAccount *account) { g_return_if_fail (TP_IS_ACCOUNT (account)); tp_cli_dbus_properties_call_get_all (account, -1, TP_IFACE_ACCOUNT, _tp_account_got_all_cb, NULL, NULL, G_OBJECT (account)); } /** * tp_account_set_avatar_finish: * @self: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async avatar change request on @account. * * Returns: %TRUE if the operation was successful, otherwise %FALSE * * Since: 0.11.1 */ gboolean tp_account_set_avatar_finish (TpAccount *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_account_set_avatar_async); } /** * tp_account_set_avatar_async: * @self: a #TpAccount * @avatar: (allow-none) (array length=len): a new avatar to set; can be %NULL * only if @len equals 0 * @len: the length of the new avatar * @mime_type: (allow-none): the MIME type of the new avatar; can be %NULL * only if @len equals 0 * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous change of the Avatar parameter on @self. When * the operation is finished, @callback will be called. You can then call * tp_account_set_avatar_finish() to get the result of the operation. * * If @len equals 0, the avatar is cleared. * * Since: 0.11.1 */ void tp_account_set_avatar_async (TpAccount *self, const guchar *avatar, gsize len, const gchar *mime_type, GAsyncReadyCallback callback, gpointer user_data) { GValue value = {0, }; GSimpleAsyncResult *result; GValueArray *arr; GArray *tmp; g_return_if_fail (TP_IS_ACCOUNT (self)); g_return_if_fail (avatar != NULL || len == 0); g_return_if_fail (mime_type != NULL || len == 0); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_set_avatar_async); tmp = g_array_new (FALSE, FALSE, sizeof (guchar)); if (len > 0) g_array_append_vals (tmp, avatar, len); arr = tp_value_array_build (2, TP_TYPE_UCHAR_ARRAY, tmp, G_TYPE_STRING, mime_type, G_TYPE_INVALID); g_value_init (&value, TP_STRUCT_TYPE_AVATAR); g_value_take_boxed (&value, arr); tp_cli_dbus_properties_call_set (self, -1, TP_IFACE_ACCOUNT_INTERFACE_AVATAR, "Avatar", &value, _tp_account_property_set_cb, result, NULL, NULL); g_value_unset (&value); } /** * tp_account_get_detailed_error: (skip) * @self: an account * @details: (out) (allow-none) (element-type utf8 GObject.Value) (transfer none): * optionally used to return a map from string to #GValue, which must not be * modified, destroyed or unreffed by the caller * * If the account's connection is not connected, return the D-Bus error name * with which it last disconnected or failed to connect (in particular, this * is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). * This is the same as #TpAccount:connection-error. * * If @details is not %NULL, it will be used to return additional details about * the error (the same as #TpAccount:connection-error-details). * * Otherwise, return %NULL, without altering @details. * * The returned string and @details may become invalid when the main loop is * re-entered or the account is destroyed. * * Returns: (transfer none) (allow-none): a D-Bus error name, or %NULL. * * Since: 0.11.7 */ const gchar * tp_account_get_detailed_error (TpAccount *self, const GHashTable **details) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); if (self->priv->connection_status == TP_CONNECTION_STATUS_CONNECTED) return NULL; if (details != NULL) *details = self->priv->error_details; return self->priv->error; } /** * tp_account_dup_detailed_error_vardict: * @self: an account * @details: (out) (allow-none) (transfer full): * optionally used to return a variant of type %G_VARIANT_TYPE_VARDICT, * which must be unreffed by the caller with g_variant_unref() * * If the account's connection is not connected, return the D-Bus error name * with which it last disconnected or failed to connect (in particular, this * is %TP_ERROR_STR_CANCELLED if it was disconnected by a user request). * This is the same as #TpAccount:connection-error. * * If @details is not %NULL, it will be used to return additional details about * the error (the same as #TpAccount:connection-error-details). * * Otherwise, return %NULL, without altering @details. * * The returned string and @details may become invalid when the main loop is * re-entered or the account is destroyed. * * Returns: (transfer full) (allow-none): a D-Bus error name, or %NULL. * * Since: 0.17.6 */ gchar * tp_account_dup_detailed_error_vardict (TpAccount *self, GVariant **details) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); if (self->priv->connection_status == TP_CONNECTION_STATUS_CONNECTED) return NULL; if (details != NULL) *details = _tp_asv_to_vardict (self->priv->error_details); return g_strdup (self->priv->error); } /** * tp_account_get_storage_provider: * @self: a #TpAccount * * * * Returns: the same as the #TpAccount:storage-provider property * * Since: 0.13.2 */ const gchar * tp_account_get_storage_provider (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return self->priv->storage_provider; } /* FIXME: in 1.0, remove */ /** * tp_account_get_storage_identifier: * @self: a #TpAccount * * * * Returns: the same as the #TpAccount:storage-identifier property * * Since: 0.13.2 */ const GValue * tp_account_get_storage_identifier (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return self->priv->storage_identifier; } /* FIXME: in 1.0, rename to tp_account_get_storage_identifier */ /** * tp_account_dup_storage_identifier_variant: * @self: a #TpAccount * * Return provider-specific information used to identify this * account. Use g_variant_get_type() to check that the type * is what you expect; for instance, if the * #TpAccount:storage-provider has string-based user identifiers, * this variant should have type %G_VARIANT_TYPE_STRING. * * Returns: (transfer full): the same as the * #TpAccount:storage-identifier-variant property * * Since: 0.13.2 */ GVariant * tp_account_dup_storage_identifier_variant (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); if (self->priv->storage_identifier == NULL) return NULL; return g_variant_ref_sink (dbus_g_value_build_g_variant ( self->priv->storage_identifier)); } /** * tp_account_get_storage_restrictions: * @self: a #TpAccount * * * * Returns: the same as the #TpAccount:storage-restrictions property * * Since: 0.13.2 */ TpStorageRestrictionFlags tp_account_get_storage_restrictions (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), 0); return self->priv->storage_restrictions; } static void _tp_account_get_storage_specific_information_cb (TpProxy *self, const GValue *value, const GError *error, gpointer user_data, GObject *weak_obj) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to retrieve StorageSpecificInformation: %s", error->message); g_simple_async_result_set_from_error (result, error); } else { g_simple_async_result_set_op_res_gpointer (result, g_value_dup_boxed (value), (GDestroyNotify) g_hash_table_unref); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /* FIXME: in Telepathy 1.0, remove this */ /** * tp_account_get_storage_specific_information_async: * @self: a #TpAccount * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Makes an asynchronous request of @self's StorageSpecificInformation * property (part of the Account.Interface.Storage interface). * * When the operation is finished, @callback will be called. You must then * call tp_account_get_storage_specific_information_finish() to get the * result of the request. * * Since: 0.13.2 */ void tp_account_get_storage_specific_information_async (TpAccount *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_get_storage_specific_information_async); tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_ACCOUNT_INTERFACE_STORAGE, "StorageSpecificInformation", _tp_account_get_storage_specific_information_cb, result, NULL, NULL); } /* FIXME: in Telepathy 1.0, rename to ...get_storage_specific_information... */ /** * tp_account_dup_storage_specific_information_vardict_async: * @self: a #TpAccount * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Makes an asynchronous request of @self's StorageSpecificInformation * property (part of the Account.Interface.Storage interface). * * When the operation is finished, @callback will be called. You must then * call tp_account_dup_storage_specific_information_vardict_finish() to get the * result of the request. * * Since: 0.17.6 */ void tp_account_dup_storage_specific_information_vardict_async (TpAccount *self, GAsyncReadyCallback callback, gpointer user_data) { /* we share an implementation */ tp_account_get_storage_specific_information_async (self, callback, user_data); } /* FIXME: in Telepathy 1.0, remove this */ /** * tp_account_get_storage_specific_information_finish: * @self: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Retrieve the value of the request begun with * tp_account_get_storage_specific_information_async(). * * Beware that the returned value is only valid until @result is freed. * Copy it with g_hash_table_ref() if you need to keep it for longer. * * Returns: (element-type utf8 GObject.Value) (transfer none): a #GHashTable * of strings to GValues representing the D-Bus type a{sv}. * * Since: 0.13.2 */ GHashTable * tp_account_get_storage_specific_information_finish (TpAccount *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_account_get_storage_specific_information_async, /* do not copy */); } /* FIXME: in Telepathy 1.0, rename to ...get_storage_specific_information... */ /** * tp_account_dup_storage_specific_information_vardict_finish: * @self: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Retrieve the value of the request begun with * tp_account_dup_storage_specific_information_vardict_async(). * * Returns: (transfer full): a map from strings to variants, * of type %G_VARIANT_TYPE_VARDICT * * Since: 0.17.6 */ GVariant * tp_account_dup_storage_specific_information_vardict_finish (TpAccount *self, GAsyncResult *result, GError **error) { /* we share the source tag with the non-vardict version */ _tp_implement_finish_return_copy_pointer (self, tp_account_get_storage_specific_information_async, _tp_asv_to_vardict); } static void _tp_account_got_all_addressing_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *object) { TpAccount *self = TP_ACCOUNT (proxy); GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Error getting Addressing properties: %s", error->message); } else { self->priv->uri_schemes = g_strdupv (tp_asv_get_boxed (properties, "URISchemes", G_TYPE_STRV)); } if (self->priv->uri_schemes == NULL) self->priv->uri_schemes = g_new0 (gchar *, 1); g_simple_async_result_complete_in_idle (result); } static void connection_prepare_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpConnection *connection = (TpConnection *) object; TpAccount *self = tp_connection_get_account (connection); GSimpleAsyncResult *result = user_data; GError *error = NULL; self->priv->connection_prepared = TRUE; if (!tp_proxy_prepare_finish (object, res, &error)) { DEBUG ("Error preparing connection: %s", error->message); g_simple_async_result_take_error (result, error); } g_simple_async_result_complete (result); g_object_unref (result); } static void tp_account_prepare_connection_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpAccount *self = TP_ACCOUNT (proxy); GSimpleAsyncResult *result; GArray *features; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_account_prepare_connection_async); if (self->priv->connection == NULL) { g_simple_async_result_complete_in_idle (result); g_object_unref (result); return; } features = tp_simple_client_factory_dup_connection_features ( tp_proxy_get_factory (self), self->priv->connection); tp_proxy_prepare_async (self->priv->connection, (GQuark *) features->data, connection_prepare_cb, result); g_array_unref (features); } static void tp_account_prepare_addressing_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpAccount *self = TP_ACCOUNT (proxy); GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_account_prepare_addressing_async); g_assert (self->priv->uri_schemes == NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_ACCOUNT_INTERFACE_ADDRESSING, _tp_account_got_all_addressing_cb, result, g_object_unref, NULL); } /** * tp_account_get_uri_schemes: * @self: a #TpAccount * * Return the #TpAccount:uri-schemes property * * Returns: (transfer none): the value of #TpAccount:uri_schemes property * * Since: 0.13.8 */ const gchar * const * tp_account_get_uri_schemes (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return (const gchar * const *) self->priv->uri_schemes; } /** * tp_account_associated_with_uri_scheme: * @self: a #TpAccount * @scheme: (transfer none): a URI scheme such as "tel", "sip" or "xmpp" * * * * Returns: %TRUE if the result of tp_account_get_uri_schemes() would include * @scheme * * Since: 0.13.8 */ gboolean tp_account_associated_with_uri_scheme (TpAccount *self, const gchar *scheme) { return tp_strv_contains (tp_account_get_uri_schemes (self), scheme); } /** * tp_account_set_uri_scheme_association_async: * @self: a #TpAccount * @scheme: a non-%NULL URI scheme such as "tel" * @associate: %TRUE to use this account for @scheme, or %FALSE to not use it * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Add @scheme to the list of additional URI schemes that would be returned * by tp_account_get_uri_schemes(), or remove it from that list. * * @scheme should not be the primary URI scheme for the account's * protocol (for instance, "xmpp" for XMPP, or "sip" or "sips" for SIP), * since the account should be assumed to be useful for those schemes * regardless of the contents of the list. * * Calling this method does not require the %TP_ACCOUNT_FEATURE_ADDRESSING * feature to be enabled, but the change will not be reflected in the result * of tp_account_get_uri_schemes() or tp_account_associated_with_uri_scheme() * unless that feature has been enabled. * * Since: 0.13.8 */ void tp_account_set_uri_scheme_association_async (TpAccount *self, const gchar *scheme, gboolean associate, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_ACCOUNT (self)); g_return_if_fail (scheme != NULL); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_set_uri_scheme_association_async); tp_cli_account_interface_addressing_call_set_uri_scheme_association ( self, -1, scheme, associate, _tp_account_void_cb, result, NULL, NULL); } /** * tp_account_set_uri_scheme_association_finish: * @self: a #TpAccount * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_account_set_uri_scheme_association_async(). * * Returns: %TRUE if the call was successful, otherwise %FALSE * * Since: 0.13.8 */ gboolean tp_account_set_uri_scheme_association_finish (TpAccount *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_account_set_uri_scheme_association_async); } /** * tp_account_get_automatic_presence: * @self: an account * @status: (out) (transfer none): return location for the presence status * @status_message: (out) (transfer full): return location for the * user-defined message * * Gets the automatic presence, status and status message of @account. These * values are the same as the #TpAccount:automatic-presence-type, * #TpAccount:automatic-status and #TpAccount:automatic-status-message * properties, and are the values that will be used if the account should * be put online automatically. * * Returns: the same as the #TpAccount:automatic-presence-type property * * Since: 0.13.8 */ TpConnectionPresenceType tp_account_get_automatic_presence (TpAccount *self, gchar **status, gchar **status_message) { g_return_val_if_fail (TP_IS_ACCOUNT (self), TP_CONNECTION_PRESENCE_TYPE_UNSET); if (status != NULL) *status = g_strdup (self->priv->auto_status); if (status_message != NULL) *status_message = g_strdup (self->priv->auto_message); return self->priv->auto_presence; } /** * tp_account_get_normalized_name: * @self: a #TpAccount * * * * Returns: (transfer none): the same as the #TpAccount:normalized-name * property * * Since: 0.13.8 **/ const gchar * tp_account_get_normalized_name (TpAccount *self) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return self->priv->normalized_name; } /** * tp_account_bind_connection_status_to_property: * @self: a #TpAccount * @target: the target #GObject * @target_property: the property on @target to bind (must be %G_TYPE_BOOLEAN) * @invert: %TRUE if you wish to invert the value of @target_property * (i.e. %FALSE if connected) * * Binds the :connection-status of @self to the boolean property of another * object using a #GBinding such that the @target_property will be set to * %TRUE when @self is connected (and @invert is %FALSE). * * @target_property will be synchronised immediately (%G_BINDING_SYNC_CREATE). * @invert can be interpreted as analogous to %G_BINDING_INVERT_BOOLEAN. * * For instance, this function can be used to bind the GtkWidget:sensitive * property to only make a widget sensitive when the account is connected. * * See g_object_bind_property() for more information. * * Returns: (transfer none): the #GBinding instance representing the binding * between the @self and the @target. The binding is released whenever the * #GBinding reference count reaches zero. * Since: 0.13.16 */ GBinding * tp_account_bind_connection_status_to_property (TpAccount *self, gpointer target, const char *target_property, gboolean invert) { g_return_val_if_fail (TP_IS_ACCOUNT (self), NULL); return g_object_bind_property_full (self, "connection-status", target, target_property, G_BINDING_SYNC_CREATE, _tp_bind_connection_status_to_boolean, NULL, GUINT_TO_POINTER (invert), NULL); } telepathy-glib-0.24.2/telepathy-glib/account.h0000644000175000017500000002665112652510705016166 00000000000000/* * account-manager.h - proxy for an account in the Telepathy account manager * * Copyright (C) 2009-2012 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_ACCOUNT_H #define TP_ACCOUNT_H #include #include #include #include #include G_BEGIN_DECLS /* TpAccount is forward-declared in connection.h */ typedef struct _TpAccountClass TpAccountClass; typedef struct _TpAccountPrivate TpAccountPrivate; typedef struct _TpAccountClassPrivate TpAccountClassPrivate; struct _TpAccount { /**/ TpProxy parent; TpAccountPrivate *priv; }; struct _TpAccountClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpAccountClassPrivate *priv; }; GType tp_account_get_type (void); #define TP_TYPE_ACCOUNT \ (tp_account_get_type ()) #define TP_ACCOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT, \ TpAccount)) #define TP_ACCOUNT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT, \ TpAccountClass)) #define TP_IS_ACCOUNT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT)) #define TP_IS_ACCOUNT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT)) #define TP_ACCOUNT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT, \ TpAccountClass)) #define TP_ACCOUNT_FEATURE_CORE \ tp_account_get_feature_quark_core () #define TP_ACCOUNT_FEATURE_CONNECTION \ tp_account_get_feature_quark_connection () #define TP_ACCOUNT_FEATURE_STORAGE \ tp_account_get_feature_quark_storage () #define TP_ACCOUNT_FEATURE_ADDRESSING \ tp_account_get_feature_quark_addressing () GQuark tp_account_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 GQuark tp_account_get_feature_quark_connection (void) G_GNUC_CONST; GQuark tp_account_get_feature_quark_storage (void) G_GNUC_CONST; GQuark tp_account_get_feature_quark_addressing (void) G_GNUC_CONST; _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_account) TpAccount *tp_account_new (TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_account_get_protocol) gboolean tp_account_parse_object_path (const gchar *object_path, gchar **cm, gchar **protocol, gchar **account_id, GError **error); #endif const gchar *tp_account_get_path_suffix (TpAccount *account); void tp_account_init_known_interfaces (void); TpConnection *tp_account_get_connection (TpAccount *account); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_connection) TpConnection *tp_account_ensure_connection (TpAccount *account, const gchar *path); #endif const gchar *tp_account_get_display_name (TpAccount *account); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_account_get_cm_name) const gchar *tp_account_get_connection_manager (TpAccount *account); _TP_DEPRECATED_IN_0_20_FOR(tp_account_get_protocol_name) const gchar *tp_account_get_protocol (TpAccount *account); #endif _TP_AVAILABLE_IN_0_20 const gchar *tp_account_get_cm_name (TpAccount *account); _TP_AVAILABLE_IN_0_20 const gchar *tp_account_get_protocol_name (TpAccount *account); const gchar *tp_account_get_service (TpAccount *self); const gchar *tp_account_get_icon_name (TpAccount *account); const gchar *tp_account_get_normalized_name (TpAccount *self); void tp_account_set_enabled_async (TpAccount *account, gboolean enabled, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_enabled_finish (TpAccount *account, GAsyncResult *result, GError **error); void tp_account_reconnect_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_reconnect_finish (TpAccount *account, GAsyncResult *result, GError **error); gboolean tp_account_is_enabled (TpAccount *account); gboolean tp_account_is_valid (TpAccount *account); void tp_account_update_parameters_async (TpAccount *account, GHashTable *parameters, const gchar **unset_parameters, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_update_parameters_finish (TpAccount *account, GAsyncResult *result, gchar ***reconnect_required, GError **error); _TP_AVAILABLE_IN_0_18 void tp_account_update_parameters_vardict_async (TpAccount *account, GVariant *parameters, const gchar **unset_parameters, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_account_update_parameters_vardict_finish (TpAccount *account, GAsyncResult *result, gchar ***reconnect_required, GError **error); void tp_account_remove_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_remove_finish (TpAccount *account, GAsyncResult *result, GError **error); void tp_account_set_display_name_async (TpAccount *account, const gchar *display_name, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_display_name_finish (TpAccount *account, GAsyncResult *result, GError **error); void tp_account_set_icon_name_async (TpAccount *account, const gchar *icon_name, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_icon_name_finish (TpAccount *account, GAsyncResult *result, GError **error); void tp_account_set_service_async (TpAccount *self, const gchar *service, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_service_finish (TpAccount *self, GAsyncResult *result, GError **error); void tp_account_request_presence_async (TpAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_request_presence_finish (TpAccount *account, GAsyncResult *result, GError **error); void tp_account_set_automatic_presence_async (TpAccount *account, TpConnectionPresenceType type, const gchar *status, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_automatic_presence_finish (TpAccount *account, GAsyncResult *result, GError **error); gboolean tp_account_get_connect_automatically (TpAccount *account); void tp_account_set_connect_automatically_async (TpAccount *account, gboolean connect_automatically, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_connect_automatically_finish (TpAccount *account, GAsyncResult *result, GError **error); gboolean tp_account_get_has_been_online (TpAccount *account); TpConnectionStatus tp_account_get_connection_status (TpAccount *account, TpConnectionStatusReason *reason); const gchar *tp_account_get_detailed_error (TpAccount *self, const GHashTable **details); _TP_AVAILABLE_IN_0_18 gchar *tp_account_dup_detailed_error_vardict (TpAccount *self, GVariant **details); TpConnectionPresenceType tp_account_get_current_presence (TpAccount *account, gchar **status, gchar **status_message); TpConnectionPresenceType tp_account_get_requested_presence ( TpAccount *account, gchar **status, gchar **status_message); TpConnectionPresenceType tp_account_get_automatic_presence ( TpAccount *self, gchar **status, gchar **status_message); const GHashTable *tp_account_get_parameters (TpAccount *account); _TP_AVAILABLE_IN_0_18 GVariant *tp_account_dup_parameters_vardict (TpAccount *account); const gchar *tp_account_get_nickname (TpAccount *account); void tp_account_set_nickname_async (TpAccount *account, const gchar *nickname, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_nickname_finish (TpAccount *account, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 const gchar * const * /* ugh, gtk-doc */ tp_account_get_supersedes (TpAccount *self); void tp_account_get_avatar_async (TpAccount *account, GAsyncReadyCallback callback, gpointer user_data); const GArray *tp_account_get_avatar_finish (TpAccount *account, GAsyncResult *result, GError **error); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_24_FOR(tp_proxy_is_prepared) gboolean tp_account_is_prepared (TpAccount *account, GQuark feature); #endif #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_async) void tp_account_prepare_async (TpAccount *account, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data); _TP_DEPRECATED_IN_0_16_FOR (tp_proxy_prepare_finish) gboolean tp_account_prepare_finish (TpAccount *account, GAsyncResult *result, GError **error); #endif void tp_account_set_avatar_async (TpAccount *self, const guchar *avatar, gsize len, const gchar *mime_type, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_avatar_finish (TpAccount *self, GAsyncResult *result, GError **error); gboolean tp_account_get_changing_presence (TpAccount *self); const gchar *tp_account_get_storage_provider (TpAccount *self); const GValue *tp_account_get_storage_identifier (TpAccount *self); GVariant *tp_account_dup_storage_identifier_variant (TpAccount *self); TpStorageRestrictionFlags tp_account_get_storage_restrictions (TpAccount *self); void tp_account_get_storage_specific_information_async (TpAccount *self, GAsyncReadyCallback callback, gpointer user_data); GHashTable *tp_account_get_storage_specific_information_finish (TpAccount *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_account_dup_storage_specific_information_vardict_async ( TpAccount *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 GVariant *tp_account_dup_storage_specific_information_vardict_finish ( TpAccount *self, GAsyncResult *result, GError **error); const gchar * const * /* ugh, gtk-doc */ tp_account_get_uri_schemes (TpAccount *self); gboolean tp_account_associated_with_uri_scheme (TpAccount *self, const gchar *scheme); void tp_account_set_uri_scheme_association_async (TpAccount *self, const gchar *scheme, gboolean associate, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_set_uri_scheme_association_finish (TpAccount *self, GAsyncResult *result, GError **error); GBinding *tp_account_bind_connection_status_to_property (TpAccount *self, gpointer target, const char *target_property, gboolean invert); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/dbus.c0000644000175000017500000014476712652510705015473 00000000000000/* * dbus.c - Source for D-Bus utilities * * Copyright (C) 2005-2008 Collabora Ltd. * Copyright (C) 2005-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:dbus * @title: D-Bus utilities * @short_description: some D-Bus utility functions * * D-Bus utility functions used in telepathy-glib. */ /** * SECTION:asv * @title: Manipulating a{sv} mappings * @short_description: Functions to manipulate mappings from string to * variant, as represented in dbus-glib by a #GHashTable from string * to #GValue * * Mappings from string to variant (D-Bus signature a{sv}) are commonly used * to provide extensibility, but in dbus-glib they're somewhat awkward to deal * with. * * These functions provide convenient access to the values in such * a mapping. * * They also work around the fact that none of the #GHashTable public API * takes a const pointer to a #GHashTable, even the read-only methods that * logically ought to. * * Parts of telepathy-glib return const pointers to #GHashTable, to encourage * the use of this API. * * Since: 0.7.9 */ #include "config.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_MISC #include "debug-internal.h" /** * tp_asv_size: (skip) * @asv: a GHashTable * * Return the size of @asv as if via g_hash_table_size(). * * The only difference is that this version takes a const #GHashTable and * casts it. * * Since: 0.7.12 */ /* (#define + static inline in dbus.h) */ /** * tp_dbus_g_method_return_not_implemented: (skip) * @context: The D-Bus method invocation context * * Return the Telepathy error NotImplemented from the method invocation * given by @context. */ void tp_dbus_g_method_return_not_implemented (DBusGMethodInvocation *context) { GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Not implemented" }; dbus_g_method_return_error (context, &e); } DBusGConnection * _tp_dbus_starter_bus_conn (GError **error) { static DBusGConnection *starter_bus = NULL; if (starter_bus == NULL) { starter_bus = dbus_g_bus_get (DBUS_BUS_STARTER, error); } return starter_bus; } /** * tp_get_bus: (skip) * * Returns a connection to the D-Bus daemon on which this process was * activated if it was launched by D-Bus service activation, or the session * bus otherwise. * * If dbus_g_bus_get() fails, exit with error code 1. * * Note that this function is not suitable for use in applications which can * be useful even in the absence of D-Bus - it is designed for use in * connection managers, which are not at all useful without a D-Bus * connection. See <https://bugs.freedesktop.org/show_bug.cgi?id=18832>. * Most processes should use tp_dbus_daemon_dup() instead. * * Returns: a connection to the starter or session D-Bus daemon. */ DBusGConnection * tp_get_bus (void) { GError *error = NULL; DBusGConnection *bus = _tp_dbus_starter_bus_conn (&error); if (bus == NULL) { WARNING ("Failed to connect to starter bus: %s", error->message); exit (1); } return bus; } /** * tp_get_bus_proxy: (skip) * * Return a #DBusGProxy for the bus daemon object. The same caveats as for * tp_get_bus() apply. * * Returns: a proxy for the bus daemon object on the starter or session bus. * * Deprecated: 0.7.26: Use tp_dbus_daemon_dup() in new code. */ DBusGProxy * tp_get_bus_proxy (void) { static DBusGProxy *bus_proxy = NULL; if (bus_proxy == NULL) { GError *error = NULL; DBusGConnection *bus = _tp_dbus_starter_bus_conn (&error); if (bus == NULL) { WARNING ("Failed to connect to starter bus: %s", error->message); exit (1); } bus_proxy = dbus_g_proxy_new_for_name (bus, "org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus"); if (bus_proxy == NULL) ERROR ("Failed to get proxy object for bus."); } return bus_proxy; } /** * TpDBusNameType: * @TP_DBUS_NAME_TYPE_UNIQUE: accept unique names like :1.123 * (not including the name of the bus daemon itself) * @TP_DBUS_NAME_TYPE_WELL_KNOWN: accept well-known names like * com.example.Service (not including the name of the bus daemon itself) * @TP_DBUS_NAME_TYPE_BUS_DAEMON: accept the name of the bus daemon * itself, which has the syntax of a well-known name, but behaves like a * unique name * @TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON: accept either unique or well-known * names, but not the bus daemon * @TP_DBUS_NAME_TYPE_ANY: accept any of the above * * A set of flags indicating which D-Bus bus names are acceptable. * They can be combined with the bitwise-or operator to accept multiple * types. %TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON and %TP_DBUS_NAME_TYPE_ANY are * the bitwise-or of other appropriate types, for convenience. * * Since 0.11.5, there is a corresponding #GFlagsClass type, * %TP_TYPE_DBUS_NAME_TYPE. * * Since: 0.7.1 */ /** * TP_TYPE_DBUS_NAME_TYPE: * * The #GFlagsClass type of a #TpDBusNameType or a set of name types. * * Since: 0.11.5 */ /** * tp_dbus_check_valid_bus_name: * @name: a possible bus name * @allow_types: some combination of %TP_DBUS_NAME_TYPE_UNIQUE, * %TP_DBUS_NAME_TYPE_WELL_KNOWN or %TP_DBUS_NAME_TYPE_BUS_DAEMON * (often this will be %TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON or * %TP_DBUS_NAME_TYPE_ANY) * @error: used to raise %TP_DBUS_ERROR_INVALID_BUS_NAME if %FALSE is returned * * Check that the given string is a valid D-Bus bus name of an appropriate * type. * * Returns: %TRUE if @name is valid * * Since: 0.7.1 */ gboolean tp_dbus_check_valid_bus_name (const gchar *name, TpDBusNameType allow_types, GError **error) { gboolean dot = FALSE; gboolean unique; gchar last; const gchar *ptr; g_return_val_if_fail (name != NULL, FALSE); if (name[0] == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "The empty string is not a valid bus name"); return FALSE; } if (!tp_strdiff (name, DBUS_SERVICE_DBUS)) { if (allow_types & TP_DBUS_NAME_TYPE_BUS_DAEMON) return TRUE; g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "The D-Bus daemon's bus name is not acceptable here"); return FALSE; } unique = (name[0] == ':'); if (unique && (allow_types & TP_DBUS_NAME_TYPE_UNIQUE) == 0) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "A well-known bus name not starting with ':'%s is required", allow_types & TP_DBUS_NAME_TYPE_BUS_DAEMON ? " (or the bus daemon itself)" : ""); return FALSE; } if (!unique && (allow_types & TP_DBUS_NAME_TYPE_WELL_KNOWN) == 0) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "A unique bus name starting with ':'%s is required", allow_types & TP_DBUS_NAME_TYPE_BUS_DAEMON ? " (or the bus daemon itself)" : ""); return FALSE; } if (strlen (name) > 255) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name: too long (> 255 characters)"); return FALSE; } last = '\0'; for (ptr = name + (unique ? 1 : 0); *ptr != '\0'; ptr++) { if (*ptr == '.') { dot = TRUE; if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': contains '..'", name); return FALSE; } else if (last == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': must not start with '.'", name); return FALSE; } } else if (g_ascii_isdigit (*ptr)) { if (!unique) { if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': a digit may not follow '.' " "except in a unique name starting with ':'", name); return FALSE; } else if (last == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': must not start with a digit", name); return FALSE; } } } else if (!g_ascii_isalpha (*ptr) && *ptr != '_' && *ptr != '-') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': contains invalid character '%c'", name, *ptr); return FALSE; } last = *ptr; } if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': must not end with '.'", name); return FALSE; } if (!dot) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_BUS_NAME, "Invalid bus name '%s': must contain '.'", name); return FALSE; } return TRUE; } /** * tp_dbus_check_valid_interface_name: * @name: a possible interface name * @error: used to raise %TP_DBUS_ERROR_INVALID_INTERFACE_NAME if %FALSE is * returned * * Check that the given string is a valid D-Bus interface name. This is * also appropriate to use to check for valid error names. * * Since GIO 2.26, g_dbus_is_interface_name() should always return the same * thing, although the GLib function does not raise an error explaining why * the interface name is incorrect. * * Returns: %TRUE if @name is valid * * Since: 0.7.1 */ gboolean tp_dbus_check_valid_interface_name (const gchar *name, GError **error) { gboolean dot = FALSE; gchar last; const gchar *ptr; g_return_val_if_fail (name != NULL, FALSE); if (name[0] == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "The empty string is not a valid interface name"); return FALSE; } if (strlen (name) > 255) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name: too long (> 255 characters)"); return FALSE; } last = '\0'; for (ptr = name; *ptr != '\0'; ptr++) { if (*ptr == '.') { dot = TRUE; if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': contains '..'", name); return FALSE; } else if (last == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': must not start with '.'", name); return FALSE; } } else if (g_ascii_isdigit (*ptr)) { if (last == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': must not start with a digit", name); return FALSE; } else if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': a digit must not follow '.'", name); return FALSE; } } else if (!g_ascii_isalpha (*ptr) && *ptr != '_') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': contains invalid character '%c'", name, *ptr); return FALSE; } last = *ptr; } if (last == '.') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': must not end with '.'", name); return FALSE; } if (!dot) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_INTERFACE_NAME, "Invalid interface name '%s': must contain '.'", name); return FALSE; } return TRUE; } /** * tp_dbus_check_valid_member_name: * @name: a possible member name * @error: used to raise %TP_DBUS_ERROR_INVALID_MEMBER_NAME if %FALSE is * returned * * Check that the given string is a valid D-Bus member (method or signal) name. * * Since GIO 2.26, g_dbus_is_member_name() should always return the same * thing, although the GLib function does not raise an error explaining why * the interface name is incorrect. * * Returns: %TRUE if @name is valid * * Since: 0.7.1 */ gboolean tp_dbus_check_valid_member_name (const gchar *name, GError **error) { const gchar *ptr; g_return_val_if_fail (name != NULL, FALSE); if (name[0] == '\0') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_MEMBER_NAME, "The empty string is not a valid method or signal name"); return FALSE; } if (strlen (name) > 255) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_MEMBER_NAME, "Invalid method or signal name: too long (> 255 characters)"); return FALSE; } for (ptr = name; *ptr != '\0'; ptr++) { if (g_ascii_isdigit (*ptr)) { if (ptr == name) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_MEMBER_NAME, "Invalid method or signal name '%s': must not start with " "a digit", name); return FALSE; } } else if (!g_ascii_isalpha (*ptr) && *ptr != '_') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_MEMBER_NAME, "Invalid method or signal name '%s': contains invalid " "character '%c'", name, *ptr); return FALSE; } } return TRUE; } /** * tp_dbus_check_valid_object_path: * @path: a possible object path * @error: used to raise %TP_DBUS_ERROR_INVALID_OBJECT_PATH if %FALSE is * returned * * Check that the given string is a valid D-Bus object path. Since GLib 2.24, * g_variant_is_object_path() should always return the same thing as this * function, although it doesn't provide an error explaining why the object * path is invalid. * * Returns: %TRUE if @path is valid * * Since: 0.7.1 */ gboolean tp_dbus_check_valid_object_path (const gchar *path, GError **error) { const gchar *ptr; g_return_val_if_fail (path != NULL, FALSE); if (path[0] != '/') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH, "Invalid object path '%s': must start with '/'", path); return FALSE; } if (path[1] == '\0') return TRUE; for (ptr = path + 1; *ptr != '\0'; ptr++) { if (*ptr == '/') { if (ptr[-1] == '/') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH, "Invalid object path '%s': contains '//'", path); return FALSE; } } else if (!g_ascii_isalnum (*ptr) && *ptr != '_') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH, "Invalid object path '%s': contains invalid character '%c'", path, *ptr); return FALSE; } } if (ptr[-1] == '/') { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH, "Invalid object path '%s': is not '/' but does end with '/'", path); return FALSE; } return TRUE; } /** * tp_g_value_slice_new_bytes: (skip) * @length: number of bytes to copy * @bytes: location of an array of bytes to be copied (this may be %NULL * if and only if length is 0) * * Slice-allocate a #GValue containing a byte-array, using * tp_g_value_slice_new_boxed(). This function is convenient to use when * constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %DBUS_TYPE_G_UCHAR_ARRAY whose value is a copy * of @length bytes from @bytes, to be freed with tp_g_value_slice_free() or * g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_bytes (guint length, gconstpointer bytes) { GArray *arr; g_return_val_if_fail (length == 0 || bytes != NULL, NULL); arr = g_array_sized_new (FALSE, FALSE, 1, length); if (length > 0) g_array_append_vals (arr, bytes, length); return tp_g_value_slice_new_take_boxed (DBUS_TYPE_G_UCHAR_ARRAY, arr); } /** * tp_g_value_slice_new_take_bytes: (skip) * @bytes: a non-NULL #GArray of guchar, ownership of which will be taken by * the #GValue * * Slice-allocate a #GValue containing @bytes, using * tp_g_value_slice_new_boxed(). This function is convenient to use when * constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %DBUS_TYPE_G_UCHAR_ARRAY whose value is * @bytes, to be freed with tp_g_value_slice_free() or * g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_take_bytes (GArray *bytes) { g_return_val_if_fail (bytes != NULL, NULL); return tp_g_value_slice_new_take_boxed (DBUS_TYPE_G_UCHAR_ARRAY, bytes); } /** * tp_g_value_slice_new_object_path: (skip) * @path: a valid D-Bus object path which will be copied * * Slice-allocate a #GValue containing an object path, using * tp_g_value_slice_new_boxed(). This function is convenient to use when * constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %DBUS_TYPE_G_OBJECT_PATH whose value is a copy * of @path, to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_object_path (const gchar *path) { g_return_val_if_fail (tp_dbus_check_valid_object_path (path, NULL), NULL); return tp_g_value_slice_new_boxed (DBUS_TYPE_G_OBJECT_PATH, path); } /** * tp_g_value_slice_new_static_object_path: (skip) * @path: a valid D-Bus object path which must remain valid forever * * Slice-allocate a #GValue containing an object path, using * tp_g_value_slice_new_static_boxed(). This function is convenient to use when * constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %DBUS_TYPE_G_OBJECT_PATH whose value is @path, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_static_object_path (const gchar *path) { g_return_val_if_fail (tp_dbus_check_valid_object_path (path, NULL), NULL); return tp_g_value_slice_new_static_boxed (DBUS_TYPE_G_OBJECT_PATH, path); } /** * tp_g_value_slice_new_take_object_path: (skip) * @path: a valid D-Bus object path which will be freed with g_free() by the * returned #GValue (the caller must own it before calling this function, but * no longer owns it after this function returns) * * Slice-allocate a #GValue containing an object path, using * tp_g_value_slice_new_take_boxed(). This function is convenient to use when * constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %DBUS_TYPE_G_OBJECT_PATH whose value is @path, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_take_object_path (gchar *path) { g_return_val_if_fail (tp_dbus_check_valid_object_path (path, NULL), NULL); return tp_g_value_slice_new_take_boxed (DBUS_TYPE_G_OBJECT_PATH, path); } /** * tp_asv_new: (skip) * @first_key: the name of the first key (or NULL) * @...: type and value for the first key, followed by a NULL-terminated list * of (key, type, value) tuples * * Creates a new #GHashTable for use with a{sv} maps, containing the values * passed in as parameters. * * The #GHashTable is synonymous with: * * GHashTable *asv = g_hash_table_new_full (g_str_hash, g_str_equal, * NULL, (GDestroyNotify) tp_g_value_slice_free); * * Followed by manual insertion of each of the parameters. * * Parameters are stored in slice-allocated GValues and should be set using * tp_asv_set_*() and retrieved using tp_asv_get_*(). * * tp_g_value_slice_new() and tp_g_value_slice_dup() may also be used to insert * into the map if required. * * g_hash_table_insert (parameters, "account", * tp_g_value_slice_new_string ("bob@mcbadgers.com")); * * * * Using tp_asv_new() * * GHashTable *parameters = tp_asv_new ( * "answer", G_TYPE_INT, 42, * "question", G_TYPE_STRING, "We just don't know", * NULL); * * * Allocated values will be automatically free'd when overwritten, removed or * the hash table destroyed with g_hash_table_unref(). * * Returns: a newly created #GHashTable for storing a{sv} maps, free with * g_hash_table_unref(). * Since: 0.7.29 */ GHashTable * tp_asv_new (const gchar *first_key, ...) { va_list var_args; char *key; GType type; GValue *value; char *error = NULL; /* NB: not a GError! */ /* create a GHashTable */ GHashTable *asv = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); va_start (var_args, first_key); for (key = (char *) first_key; key != NULL; key = va_arg (var_args, char *)) { type = va_arg (var_args, GType); value = tp_g_value_slice_new (type); G_VALUE_COLLECT (value, var_args, 0, &error); if (error != NULL) { CRITICAL ("key %s: %s", key, error); g_free (error); error = NULL; tp_g_value_slice_free (value); continue; } g_hash_table_insert (asv, key, value); } va_end (var_args); return asv; } /** * tp_asv_get_boolean: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location to store %TRUE if the key actually * exists and has a boolean value * * If a value for @key in @asv is present and boolean, return it, * and set *@valid to %TRUE if @valid is not %NULL. * * Otherwise return %FALSE, and set *@valid to %FALSE if @valid is not %NULL. * * Returns: a boolean value for @key * Since: 0.7.9 */ gboolean tp_asv_get_boolean (const GHashTable *asv, const gchar *key, gboolean *valid) { GValue *value; g_return_val_if_fail (asv != NULL, FALSE); g_return_val_if_fail (key != NULL, FALSE); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS_BOOLEAN (value)) { if (valid != NULL) *valid = FALSE; return FALSE; } if (valid != NULL) *valid = TRUE; return g_value_get_boolean (value); } /** * tp_asv_set_boolean: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_boolean(), tp_g_value_slice_new_boolean() * Since: 0.7.29 */ void tp_asv_set_boolean (GHashTable *asv, const gchar *key, gboolean value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_boolean (value)); } /** * tp_asv_get_bytes: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * * If a value for @key in @asv is present and is an array of bytes * (its GType is %DBUS_TYPE_G_UCHAR_ARRAY), return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it with * g_boxed_copy (DBUS_TYPE_G_UCHAR_ARRAY, ...) if you need to keep * it for longer. * * Returns: (transfer none) (allow-none) (element-type guint8): the string value * of @key, or %NULL * Since: 0.7.9 */ const GArray * tp_asv_get_bytes (const GHashTable *asv, const gchar *key) { GValue *value; g_return_val_if_fail (asv != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS (value, DBUS_TYPE_G_UCHAR_ARRAY)) return NULL; return g_value_get_boxed (value); } /** * tp_asv_set_bytes: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @length: the number of bytes to copy * @bytes: location of an array of bytes to be copied (this may be %NULL * if and only if length is 0) * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_bytes() * Since: 0.7.29 */ void tp_asv_set_bytes (GHashTable *asv, const gchar *key, guint length, gconstpointer bytes) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_return_if_fail (!(length > 0 && bytes == NULL)); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_bytes (length, bytes)); } /** * tp_asv_take_bytes: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: a non-NULL #GArray of %guchar, ownership of which will be taken by * the #GValue * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_bytes(), tp_g_value_slice_new_take_bytes() * Since: 0.7.29 */ void tp_asv_take_bytes (GHashTable *asv, const gchar *key, GArray *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_take_bytes (value)); } /** * tp_asv_get_string: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * * If a value for @key in @asv is present and is a string, return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it with g_strdup() if you * need to keep it for longer. * * Returns: (transfer none) (allow-none): the string value of @key, or %NULL * Since: 0.7.9 */ const gchar * tp_asv_get_string (const GHashTable *asv, const gchar *key) { GValue *value; g_return_val_if_fail (asv != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS_STRING (value)) return NULL; return g_value_get_string (value); } /** * tp_asv_set_string: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_string(), tp_g_value_slice_new_string() * Since: 0.7.29 */ void tp_asv_set_string (GHashTable *asv, const gchar *key, const gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_string (value)); } /** * tp_asv_take_string: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_string(), * tp_g_value_slice_new_take_string() * Since: 0.7.29 */ void tp_asv_take_string (GHashTable *asv, const gchar *key, gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_take_string (value)); } /** * tp_asv_set_static_string: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_string(), * tp_g_value_slice_new_static_string() * Since: 0.7.29 */ void tp_asv_set_static_string (GHashTable *asv, const gchar *key, const gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_static_string (value)); } /** * tp_asv_get_int32: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @asv is present, has an integer type used by * dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the * range of a gint32, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 32-bit signed integer value of @key, or 0 * Since: 0.7.9 */ gint32 tp_asv_get_int32 (const GHashTable *asv, const gchar *key, gboolean *valid) { gint64 i; guint64 u; gint32 ret; GValue *value; g_return_val_if_fail (asv != NULL, 0); g_return_val_if_fail (key != NULL, 0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL) goto return_invalid; switch (G_VALUE_TYPE (value)) { case G_TYPE_UCHAR: ret = g_value_get_uchar (value); break; case G_TYPE_UINT: u = g_value_get_uint (value); if (G_UNLIKELY (u > G_MAXINT32)) goto return_invalid; ret = u; break; case G_TYPE_INT: ret = g_value_get_int (value); break; case G_TYPE_INT64: i = g_value_get_int64 (value); if (G_UNLIKELY (i < G_MININT32 || i > G_MAXINT32)) goto return_invalid; ret = i; break; case G_TYPE_UINT64: u = g_value_get_uint64 (value); if (G_UNLIKELY (u > G_MAXINT32)) goto return_invalid; ret = u; break; default: goto return_invalid; } if (valid != NULL) *valid = TRUE; return ret; return_invalid: if (valid != NULL) *valid = FALSE; return 0; } /** * tp_asv_set_int32: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_int32(), tp_g_value_slice_new_int() * Since: 0.7.29 */ void tp_asv_set_int32 (GHashTable *asv, const gchar *key, gint32 value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_int (value)); } /** * tp_asv_get_uint32: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @asv is present, has an integer type used by * dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the * range of a guint32, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 32-bit unsigned integer value of @key, or 0 * Since: 0.7.9 */ guint32 tp_asv_get_uint32 (const GHashTable *asv, const gchar *key, gboolean *valid) { gint64 i; guint64 u; guint32 ret; GValue *value; g_return_val_if_fail (asv != NULL, 0); g_return_val_if_fail (key != NULL, 0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL) goto return_invalid; switch (G_VALUE_TYPE (value)) { case G_TYPE_UCHAR: ret = g_value_get_uchar (value); break; case G_TYPE_UINT: ret = g_value_get_uint (value); break; case G_TYPE_INT: i = g_value_get_int (value); if (G_UNLIKELY (i < 0)) goto return_invalid; ret = i; break; case G_TYPE_INT64: i = g_value_get_int64 (value); if (G_UNLIKELY (i < 0 || i > G_MAXUINT32)) goto return_invalid; ret = i; break; case G_TYPE_UINT64: u = g_value_get_uint64 (value); if (G_UNLIKELY (u > G_MAXUINT32)) goto return_invalid; ret = u; break; default: goto return_invalid; } if (valid != NULL) *valid = TRUE; return ret; return_invalid: if (valid != NULL) *valid = FALSE; return 0; } /** * tp_asv_set_uint32: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_uint32(), tp_g_value_slice_new_uint() * Since: 0.7.29 */ void tp_asv_set_uint32 (GHashTable *asv, const gchar *key, guint32 value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_uint (value)); } /** * tp_asv_get_int64: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @asv is present, has an integer type used by * dbus-glib (guchar, gint, guint, gint64 or guint64) and fits in the * range of a gint64, return it, and if @valid is not %NULL, set *@valid to * %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 64-bit signed integer value of @key, or 0 * Since: 0.7.9 */ gint64 tp_asv_get_int64 (const GHashTable *asv, const gchar *key, gboolean *valid) { gint64 ret; guint64 u; GValue *value; g_return_val_if_fail (asv != NULL, 0); g_return_val_if_fail (key != NULL, 0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL) goto return_invalid; switch (G_VALUE_TYPE (value)) { case G_TYPE_UCHAR: ret = g_value_get_uchar (value); break; case G_TYPE_UINT: ret = g_value_get_uint (value); break; case G_TYPE_INT: ret = g_value_get_int (value); break; case G_TYPE_INT64: ret = g_value_get_int64 (value); break; case G_TYPE_UINT64: u = g_value_get_uint64 (value); if (G_UNLIKELY (u > G_MAXINT64)) goto return_invalid; ret = u; break; default: goto return_invalid; } if (valid != NULL) *valid = TRUE; return ret; return_invalid: if (valid != NULL) *valid = FALSE; return 0; } /** * tp_asv_set_int64: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_int64(), tp_g_value_slice_new_int64() * Since: 0.7.29 */ void tp_asv_set_int64 (GHashTable *asv, const gchar *key, gint64 value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_int64 (value)); } /** * tp_asv_get_uint64: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @asv is present, has an integer type used by * dbus-glib (guchar, gint, guint, gint64 or guint64) and is non-negative, * return it, and if @valid is not %NULL, set *@valid to %TRUE. * * Otherwise, return 0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the 64-bit unsigned integer value of @key, or 0 * Since: 0.7.9 */ guint64 tp_asv_get_uint64 (const GHashTable *asv, const gchar *key, gboolean *valid) { gint64 tmp; guint64 ret; GValue *value; g_return_val_if_fail (asv != NULL, 0); g_return_val_if_fail (key != NULL, 0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL) goto return_invalid; switch (G_VALUE_TYPE (value)) { case G_TYPE_UCHAR: ret = g_value_get_uchar (value); break; case G_TYPE_UINT: ret = g_value_get_uint (value); break; case G_TYPE_INT: tmp = g_value_get_int (value); if (G_UNLIKELY (tmp < 0)) goto return_invalid; ret = tmp; break; case G_TYPE_INT64: tmp = g_value_get_int64 (value); if (G_UNLIKELY (tmp < 0)) goto return_invalid; ret = tmp; break; case G_TYPE_UINT64: ret = g_value_get_uint64 (value); break; default: goto return_invalid; } if (valid != NULL) *valid = TRUE; return ret; return_invalid: if (valid != NULL) *valid = FALSE; return 0; } /** * tp_asv_set_uint64: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_uint64(), tp_g_value_slice_new_uint64() * Since: 0.7.29 */ void tp_asv_set_uint64 (GHashTable *asv, const gchar *key, guint64 value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_uint64 (value)); } /** * tp_asv_get_double: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @valid: (out): Either %NULL, or a location in which to store %TRUE on success * or %FALSE on failure * * If a value for @key in @asv is present and has any numeric type used by * dbus-glib (guchar, gint, guint, gint64, guint64 or gdouble), * return it as a double, and if @valid is not %NULL, set *@valid to %TRUE. * * Otherwise, return 0.0, and if @valid is not %NULL, set *@valid to %FALSE. * * Returns: the double precision floating-point value of @key, or 0.0 * Since: 0.7.9 */ gdouble tp_asv_get_double (const GHashTable *asv, const gchar *key, gboolean *valid) { gdouble ret; GValue *value; g_return_val_if_fail (asv != NULL, 0.0); g_return_val_if_fail (key != NULL, 0.0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL) goto return_invalid; switch (G_VALUE_TYPE (value)) { case G_TYPE_DOUBLE: ret = g_value_get_double (value); break; case G_TYPE_UCHAR: ret = g_value_get_uchar (value); break; case G_TYPE_UINT: ret = g_value_get_uint (value); break; case G_TYPE_INT: ret = g_value_get_int (value); break; case G_TYPE_INT64: ret = g_value_get_int64 (value); break; case G_TYPE_UINT64: ret = g_value_get_uint64 (value); break; default: goto return_invalid; } if (valid != NULL) *valid = TRUE; return ret; return_invalid: if (valid != NULL) *valid = FALSE; return 0; } /** * tp_asv_set_double: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_double(), tp_g_value_slice_new_double() * Since: 0.7.29 */ void tp_asv_set_double (GHashTable *asv, const gchar *key, gdouble value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_double (value)); } /** * tp_asv_get_object_path: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * * If a value for @key in @asv is present and is an object path, return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it with g_strdup() if you * need to keep it for longer. * * Returns: (transfer none) (allow-none): the object-path value of @key, or * %NULL * Since: 0.7.9 */ const gchar * tp_asv_get_object_path (const GHashTable *asv, const gchar *key) { GValue *value; g_return_val_if_fail (asv != NULL, 0); g_return_val_if_fail (key != NULL, 0); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS (value, DBUS_TYPE_G_OBJECT_PATH)) return NULL; return g_value_get_boxed (value); } /** * tp_asv_set_object_path: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_object_path(), * tp_g_value_slice_new_object_path() * Since: 0.7.29 */ void tp_asv_set_object_path (GHashTable *asv, const gchar *key, const gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_object_path (value)); } /** * tp_asv_take_object_path: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_object_path(), * tp_g_value_slice_new_take_object_path() * Since: 0.7.29 */ void tp_asv_take_object_path (GHashTable *asv, const gchar *key, gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_take_object_path (value)); } /** * tp_asv_set_static_object_path: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_object_path(), * tp_g_value_slice_new_static_object_path() * Since: 0.7.29 */ void tp_asv_set_static_object_path (GHashTable *asv, const gchar *key, const gchar *value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_static_object_path (value)); } /** * tp_asv_get_boxed: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * @type: The type that the key's value should have, which must be derived * from %G_TYPE_BOXED * * If a value for @key in @asv is present and is of the desired type, * return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it, for instance with * g_boxed_copy(), if you need to keep it for longer. * * Returns: (transfer none) (allow-none): the value of @key, or %NULL * Since: 0.7.9 */ gpointer tp_asv_get_boxed (const GHashTable *asv, const gchar *key, GType type) { GValue *value; g_return_val_if_fail (asv != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS (value, type)) return NULL; return g_value_get_boxed (value); } /** * tp_asv_set_boxed: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @type: the type of the key's value, which must be derived from %G_TYPE_BOXED * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_boxed() * Since: 0.7.29 */ void tp_asv_set_boxed (GHashTable *asv, const gchar *key, GType type, gconstpointer value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_return_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_boxed (type, value)); } /** * tp_asv_take_boxed: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @type: the type of the key's value, which must be derived from %G_TYPE_BOXED * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_boxed(), tp_g_value_slice_new_take_boxed() * Since: 0.7.29 */ void tp_asv_take_boxed (GHashTable *asv, const gchar *key, GType type, gpointer value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_return_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_take_boxed (type, value)); } /** * tp_asv_set_static_boxed: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @type: the type of the key's value, which must be derived from %G_TYPE_BOXED * @value: value * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_boxed(), * tp_g_value_slice_new_static_boxed() * Since: 0.7.29 */ void tp_asv_set_static_boxed (GHashTable *asv, const gchar *key, GType type, gconstpointer value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_return_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_static_boxed (type, value)); } /** * tp_asv_get_strv: * @asv: (element-type utf8 GObject.Value): A GHashTable where the keys are * strings and the values are GValues * @key: The key to look up * * If a value for @key in @asv is present and is an array of strings (strv), * return it. * * Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it with g_strdupv() if you * need to keep it for longer. * * Returns: (transfer none) (allow-none): the %NULL-terminated string-array * value of @key, or %NULL * Since: 0.7.9 */ const gchar * const * tp_asv_get_strv (const GHashTable *asv, const gchar *key) { GValue *value; g_return_val_if_fail (asv != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); value = g_hash_table_lookup ((GHashTable *) asv, key); if (value == NULL || !G_VALUE_HOLDS (value, G_TYPE_STRV)) return NULL; return g_value_get_boxed (value); } /** * tp_asv_set_strv: (skip) * @asv: a #GHashTable created with tp_asv_new() * @key: string key * @value: a %NULL-terminated string array * * Stores the value in the map. * * The value is stored as a slice-allocated GValue. * * See Also: tp_asv_new(), tp_asv_get_strv() * Since: 0.7.29 */ void tp_asv_set_strv (GHashTable *asv, const gchar *key, gchar **value) { g_return_if_fail (asv != NULL); g_return_if_fail (key != NULL); g_hash_table_insert (asv, (char *) key, tp_g_value_slice_new_boxed (G_TYPE_STRV, value)); } /** * tp_asv_lookup: (skip) * @asv: A GHashTable where the keys are strings and the values are GValues * @key: The key to look up * * If a value for @key in @asv is present, return it. Otherwise return %NULL. * * The returned value is not copied, and is only valid as long as the value * for @key in @asv is not removed or altered. Copy it with (for instance) * g_value_copy() if you need to keep it for longer. * * Returns: the value of @key, or %NULL * Since: 0.7.9 */ const GValue * tp_asv_lookup (const GHashTable *asv, const gchar *key) { g_return_val_if_fail (asv != NULL, NULL); g_return_val_if_fail (key != NULL, NULL); return g_hash_table_lookup ((GHashTable *) asv, key); } /** * tp_asv_dump: (skip) * @asv: a #GHashTable created with tp_asv_new() * * Dumps the a{sv} map to the debugging console. * * The purpose of this function is give the programmer the ability to easily * inspect the contents of an a{sv} map for debugging purposes. */ void tp_asv_dump (GHashTable *asv) { GHashTableIter iter; char *key; GValue *value; g_return_if_fail (asv != NULL); g_debug ("{"); g_hash_table_iter_init (&iter, asv); while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &value)) { char *str = g_strdup_value_contents (value); g_debug (" '%s' : %s", key, str); g_free (str); } g_debug ("}"); } telepathy-glib-0.24.2/telepathy-glib/dbus.h0000644000175000017500000001345012652510705015460 00000000000000/* * dbus.h - Header for D-Bus utilities * * Copyright (C) 2005-2009 Collabora Ltd. * Copyright (C) 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TELEPATHY_DBUS_H__ #define __TELEPATHY_DBUS_H__ #define __TP_IN_DBUS_H__ #include #include #include G_BEGIN_DECLS void tp_dbus_g_method_return_not_implemented (DBusGMethodInvocation *context); typedef enum /*< flags >*/ { TP_DBUS_NAME_TYPE_UNIQUE = 1, TP_DBUS_NAME_TYPE_WELL_KNOWN = 2, TP_DBUS_NAME_TYPE_BUS_DAEMON = 4, TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON = TP_DBUS_NAME_TYPE_UNIQUE | TP_DBUS_NAME_TYPE_WELL_KNOWN, TP_DBUS_NAME_TYPE_ANY = TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON | TP_DBUS_NAME_TYPE_BUS_DAEMON } TpDBusNameType; gboolean tp_dbus_check_valid_bus_name (const gchar *name, TpDBusNameType allow_types, GError **error); gboolean tp_dbus_check_valid_interface_name (const gchar *name, GError **error); gboolean tp_dbus_check_valid_member_name (const gchar *name, GError **error); gboolean tp_dbus_check_valid_object_path (const gchar *path, GError **error); /* The scanner warns about these, but they're skipped anyway. * See GNOME bug#656743 */ #ifndef __GI_SCANNER__ GValue *tp_g_value_slice_new_bytes (guint length, gconstpointer bytes) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_take_bytes (GArray *bytes) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_object_path (const gchar *path) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_static_object_path (const gchar *path) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_take_object_path (gchar *path) G_GNUC_WARN_UNUSED_RESULT; #endif /* __GI_SCANNER__ */ #define tp_asv_size(asv) _tp_asv_size_inline (asv) static inline guint _tp_asv_size_inline (const GHashTable *asv) { /* The empty comment here is to stop gtkdoc thinking g_hash_table_size is * a declaration. */ return g_hash_table_size /* */ ((GHashTable *) asv); } GHashTable *tp_asv_new (const gchar *first_key, ...) G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; gboolean tp_asv_get_boolean (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_boolean (GHashTable *asv, const gchar *key, gboolean value); gpointer tp_asv_get_boxed (const GHashTable *asv, const gchar *key, GType type); void tp_asv_set_boxed (GHashTable *asv, const gchar *key, GType type, gconstpointer value); void tp_asv_take_boxed (GHashTable *asv, const gchar *key, GType type, gpointer value); void tp_asv_set_static_boxed (GHashTable *asv, const gchar *key, GType type, gconstpointer value); const GArray *tp_asv_get_bytes (const GHashTable *asv, const gchar *key); void tp_asv_set_bytes (GHashTable *asv, const gchar *key, guint length, gconstpointer bytes); void tp_asv_take_bytes (GHashTable *asv, const gchar *key, GArray *value); gdouble tp_asv_get_double (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_double (GHashTable *asv, const gchar *key, gdouble value); gint32 tp_asv_get_int32 (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_int32 (GHashTable *asv, const gchar *key, gint32 value); gint64 tp_asv_get_int64 (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_int64 (GHashTable *asv, const gchar *key, gint64 value); const gchar *tp_asv_get_object_path (const GHashTable *asv, const gchar *key); void tp_asv_set_object_path (GHashTable *asv, const gchar *key, const gchar *value); void tp_asv_take_object_path (GHashTable *asv, const gchar *key, gchar *value); void tp_asv_set_static_object_path (GHashTable *asv, const gchar *key, const gchar *value); const gchar *tp_asv_get_string (const GHashTable *asv, const gchar *key); void tp_asv_set_string (GHashTable *asv, const gchar *key, const gchar *value); void tp_asv_take_string (GHashTable *asv, const gchar *key, gchar *value); void tp_asv_set_static_string (GHashTable *asv, const gchar *key, const gchar *value); guint32 tp_asv_get_uint32 (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_uint32 (GHashTable *asv, const gchar *key, guint32 value); guint64 tp_asv_get_uint64 (const GHashTable *asv, const gchar *key, gboolean *valid); void tp_asv_set_uint64 (GHashTable *asv, const gchar *key, guint64 value); const GValue *tp_asv_lookup (const GHashTable *asv, const gchar *key); const gchar * const * /* this comment stops gtkdoc denying that this function exists */ tp_asv_get_strv (const GHashTable *asv, const gchar *key); void tp_asv_set_strv (GHashTable *asv, const gchar *key, gchar **value); void tp_asv_dump (GHashTable *asv); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED DBusGConnection * tp_get_bus (void); _TP_DEPRECATED DBusGProxy * tp_get_bus_proxy (void); #endif G_END_DECLS #undef __TP_IN_DBUS_H__ #endif /* __TELEPATHY_DBUS_H__ */ telepathy-glib-0.24.2/telepathy-glib/connection-avatars.c0000644000175000017500000002051312652510705020312 00000000000000/* * Proxy for a Telepathy connection - avatar support * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2010 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection.h" #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/proxy-internal.h" /** * TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS: * * Expands to a call to a function that returns a #GQuark representing the * "avatar-requirements" feature. * * When this feature is prepared, the avatar requirements of the Connection has * been retrieved. Use tp_connection_get_avatar_requirements() to get them once * prepared. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.4 */ GQuark tp_connection_get_feature_quark_avatar_requirements (void) { return g_quark_from_static_string ("tp-connection-feature-avatar-requirements"); } static void tp_connection_get_avatar_requirements_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to get avatar requirements properties: %s", error->message); g_simple_async_result_set_from_error (result, error); goto finally; } g_assert (self->priv->avatar_requirements == NULL); DEBUG ("AVATAR REQUIREMENTS ready"); self->priv->avatar_requirements = tp_avatar_requirements_new ( (GStrv) tp_asv_get_strv (properties, "SupportedAvatarMIMETypes"), tp_asv_get_uint32 (properties, "MinimumAvatarWidth", NULL), tp_asv_get_uint32 (properties, "MinimumAvatarHeight", NULL), tp_asv_get_uint32 (properties, "RecommendedAvatarWidth", NULL), tp_asv_get_uint32 (properties, "RecommendedAvatarHeight", NULL), tp_asv_get_uint32 (properties, "MaximumAvatarWidth", NULL), tp_asv_get_uint32 (properties, "MaximumAvatarHeight", NULL), tp_asv_get_uint32 (properties, "MaximumAvatarBytes", NULL)); finally: g_simple_async_result_complete_in_idle (result); } void _tp_connection_prepare_avatar_requirements_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; g_assert (self->priv->avatar_requirements == NULL); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, _tp_connection_prepare_avatar_requirements_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_AVATARS, tp_connection_get_avatar_requirements_cb, result, g_object_unref, NULL); } /** * tp_connection_get_avatar_requirements: * @self: a connection * * To wait for valid avatar requirements, call tp_proxy_prepare_async() * with the feature %TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS. * * This property cannot change after @self goes to the Connected state. * * Returns: (transfer none): a #TpAvatarRequirements struct, or %NULL if the * feature is not yet prepared or the connection doesn't have the necessary * properties. * Since: 0.11.4 */ TpAvatarRequirements * tp_connection_get_avatar_requirements (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->avatar_requirements; } /** * TpAvatarRequirements: * @supported_mime_types: An array of supported MIME types (e.g. "image/jpeg") * Clients MAY assume that the first type in this array is preferred * @minimum_width: The minimum width in pixels of an avatar, which MAY be 0 * @minimum_height: The minimum height in pixels of an avatar, which MAY be 0 * @recommended_width: The recommended width in pixels of an avatar, or 0 if * there is no preferred width. * @recommended_height: The recommended height in pixels of an avatar, or 0 if * there is no preferred height * @maximum_width: The maximum width in pixels of an avatar on this protocol, * or 0 if there is no limit. * @maximum_height: The maximum height in pixels of an avatar, or 0 if there is * no limit. * @maximum_bytes: he maximum size in bytes of an avatar, or 0 if there is no * limit. * * The requirements for setting an avatar on a particular protocol. * * Since: 0.11.4 */ /** * TP_TYPE_AVATAR_REQUIREMENTS: * * The boxed type of a #TpAvatarRequirements. * * Since: 0.11.4 */ G_DEFINE_BOXED_TYPE (TpAvatarRequirements, tp_avatar_requirements, tp_avatar_requirements_copy, tp_avatar_requirements_destroy) /** * tp_avatar_requirements_new: * @supported_mime_types: An array of supported MIME types (e.g. "image/jpeg") * Clients MAY assume that the first type in this array is preferred * @minimum_width: The minimum width in pixels of an avatar, which MAY be 0 * @minimum_height: The minimum height in pixels of an avatar, which MAY be 0 * @recommended_width: The recommended width in pixels of an avatar, or 0 if * there is no preferred width. * @recommended_height: The recommended height in pixels of an avatar, or 0 if * there is no preferred height * @maximum_width: The maximum width in pixels of an avatar on this protocol, * or 0 if there is no limit. * @maximum_height: The maximum height in pixels of an avatar, or 0 if there is * no limit. * @maximum_bytes: he maximum size in bytes of an avatar, or 0 if there is no * limit. * * * * Returns: a newly allocated #TpAvatarRequirements, free it with * tp_avatar_requirements_destroy() * Since: 0.11.4 */ TpAvatarRequirements * tp_avatar_requirements_new (GStrv supported_mime_types, guint minimum_width, guint minimum_height, guint recommended_width, guint recommended_height, guint maximum_width, guint maximum_height, guint maximum_bytes) { TpAvatarRequirements *self; gchar *empty[] = { NULL }; self = g_slice_new (TpAvatarRequirements); self->supported_mime_types = g_strdupv (supported_mime_types ? supported_mime_types : empty); self->minimum_width = minimum_width; self->minimum_height = minimum_height; self->recommended_width = recommended_width; self->recommended_height = recommended_height; self->maximum_width = maximum_width; self->maximum_height = maximum_height; self->maximum_bytes = maximum_bytes; return self; } /** * tp_avatar_requirements_copy: (skip) * @self: a #TpAvatarRequirements * * * * Returns: a newly allocated #TpAvatarRequirements, free it with * tp_avatar_requirements_destroy() * Since: 0.11.4 */ TpAvatarRequirements * tp_avatar_requirements_copy (const TpAvatarRequirements *self) { g_return_val_if_fail (self != NULL, NULL); return tp_avatar_requirements_new (self->supported_mime_types, self->minimum_width, self->minimum_height, self->recommended_width, self->recommended_height, self->maximum_width, self->maximum_height, self->maximum_bytes); } /** * tp_avatar_requirements_destroy: (skip) * @self: a #TpAvatarRequirements * * Free all memory used by the #TpAvatarRequirements. * * Since: 0.11.4 */ void tp_avatar_requirements_destroy (TpAvatarRequirements *self) { g_return_if_fail (self != NULL); g_strfreev (self->supported_mime_types); g_slice_free (TpAvatarRequirements, self); } telepathy-glib-0.24.2/telepathy-glib/stream-tube-connection.c0000644000175000017500000002203512652510705021102 00000000000000/* * Object representing a connection on a Stream Tube * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:stream-tube-connection * @title: TpStreamTubeConnection * @short_description: a connection on a Stream Tube * * Object used to represent a connection on a #TpStreamTubeChannel. * * Since: 0.13.2 */ /** * TpStreamTubeConnection: * * Data structure representing a connection on a #TpStreamTubeChannel. * * Since: 0.13.2 */ /** * TpStreamTubeConnectionClass: * * The class of a #TpStreamTubeConnection. * * Since: 0.13.2 */ #include "config.h" #include "telepathy-glib/stream-tube-connection-internal.h" #include "telepathy-glib/stream-tube-connection.h" #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/debug-internal.h" struct _TpStreamTubeConnectionClass { /**/ GObjectClass parent_class; }; G_DEFINE_TYPE(TpStreamTubeConnection, tp_stream_tube_connection, G_TYPE_OBJECT) enum { PROP_SOCKET_CONNECTION = 1, PROP_CHANNEL, PROP_CONTACT, N_PROPS }; enum /* signals */ { CLOSED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; struct _TpStreamTubeConnectionPrivate { GSocketConnection *socket_connection; /* We don't introduce a circular reference as the channel keeps a weak ref * on us */ TpStreamTubeChannel *channel; TpContact *contact; }; static void tp_stream_tube_connection_init (TpStreamTubeConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_STREAM_TUBE_CONNECTION, TpStreamTubeConnectionPrivate); } static void tp_stream_tube_connection_dispose (GObject *object) { TpStreamTubeConnection *self = TP_STREAM_TUBE_CONNECTION (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_stream_tube_connection_parent_class)->dispose; tp_clear_object (&self->priv->socket_connection); tp_clear_object (&self->priv->channel); tp_clear_object (&self->priv->contact); if (dispose != NULL) dispose (object); } static void tp_stream_tube_connection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpStreamTubeConnection *self = TP_STREAM_TUBE_CONNECTION (object); switch (property_id) { case PROP_SOCKET_CONNECTION: g_value_set_object (value, self->priv->socket_connection); break; case PROP_CHANNEL: g_value_set_object (value, self->priv->channel); break; case PROP_CONTACT: g_value_set_object (value, self->priv->contact); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_stream_tube_connection_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpStreamTubeConnection *self = TP_STREAM_TUBE_CONNECTION (object); switch (property_id) { case PROP_SOCKET_CONNECTION: g_assert (self->priv->socket_connection == NULL); /* construct only */ self->priv->socket_connection = g_value_dup_object (value); break; case PROP_CHANNEL: g_assert (self->priv->channel == NULL); /* construct only */ self->priv->channel = g_value_dup_object (value); break; case PROP_CONTACT: g_assert (self->priv->contact == NULL); /* construct only */ self->priv->contact = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_stream_tube_connection_constructed (GObject *object) { TpStreamTubeConnection *self = TP_STREAM_TUBE_CONNECTION (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_stream_tube_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (G_IS_SOCKET_CONNECTION (self->priv->socket_connection)); } static void tp_stream_tube_connection_class_init (TpStreamTubeConnectionClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpStreamTubeConnectionPrivate)); object_class->get_property = tp_stream_tube_connection_get_property; object_class->set_property = tp_stream_tube_connection_set_property; object_class->constructed = tp_stream_tube_connection_constructed; object_class->dispose = tp_stream_tube_connection_dispose; /** * TpStreamTubeConnection:socket-connection: * * The #GSocketConnection used to transfer data through this connection. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.13.2 */ param_spec = g_param_spec_object ("socket-connection", "GSocketConnection", "GSocketConnection used to transfer data", G_TYPE_SOCKET_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SOCKET_CONNECTION, param_spec); /** * TpStreamTubeConnection:channel: * * The #TpStreamTubeChannel channel associated with this connection * * This property can't be %NULL. * * Since: 0.13.2 */ param_spec = g_param_spec_object ("channel", "TpStreamTubeChannel", "The channel associated with this connection", TP_TYPE_STREAM_TUBE_CHANNEL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL, param_spec); /** * TpStreamTubeConnection:contact: * * The #TpContact with who we are exchanging data through this tube, or * %NULL if we can't safely identify the contact. * * If not %NULL, the #TpContact objects is guaranteed to have all of the * features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Since: 0.13.2 */ param_spec = g_param_spec_object ("contact", "TpContact", "The TpContact of the connection", TP_TYPE_CONTACT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT, param_spec); /** * TpStreamTubeConnection::closed: * @self: the #TpStreamTubeConnection * @error: (transfer none): a #GError representing the error reported by the * connection manager * * The ::closed signal is emitted when the connection manager reports that * a tube connection has been closed. * * Since: 0.13.2 */ _signals[CLOSED] = g_signal_new ("closed", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_ERROR); } TpStreamTubeConnection * _tp_stream_tube_connection_new ( GSocketConnection *socket_connection, TpStreamTubeChannel *channel) { return g_object_new (TP_TYPE_STREAM_TUBE_CONNECTION, "socket-connection", socket_connection, "channel", channel, NULL); } /** * tp_stream_tube_connection_get_socket_connection: * @self: a #TpStreamTubeConnection * * Return the #TpStreamTubeConnection:socket-connection property * * Returns: (transfer none): the value of #TpStreamTubeConnection:socket-connection * * Since: 0.13.2 */ GSocketConnection * tp_stream_tube_connection_get_socket_connection (TpStreamTubeConnection *self) { return self->priv->socket_connection; } /** * tp_stream_tube_connection_get_channel: * @self: a #TpStreamTubeConnection * * Return the #TpStreamTubeConnection:channel property * * Returns: (transfer none): the value of #TpStreamTubeConnection:channel * * Since: 0.13.2 */ TpStreamTubeChannel * tp_stream_tube_connection_get_channel ( TpStreamTubeConnection *self) { return self->priv->channel; } /** * tp_stream_tube_connection_get_contact: * @self: a #TpStreamTubeConnection * * Return the #TpStreamTubeConnection:contact property * * Returns: (transfer none): the value of #TpStreamTubeConnection:contact * * Since: 0.13.2 */ TpContact * tp_stream_tube_connection_get_contact (TpStreamTubeConnection *self) { return self->priv->contact; } void _tp_stream_tube_connection_set_contact (TpStreamTubeConnection *self, TpContact *contact) { g_assert (self->priv->contact == NULL); self->priv->contact = g_object_ref (contact); g_object_notify (G_OBJECT (self), "contact"); } void _tp_stream_tube_connection_fire_closed (TpStreamTubeConnection *self, GError *error) { g_signal_emit (self, _signals[CLOSED], 0, error); } telepathy-glib-0.24.2/telepathy-glib/stream-tube-connection.h0000644000175000017500000000530212652510705021105 00000000000000/* * Object representing a connection on a Stream Tube * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_STREAM_TUBE_CONNECTION_H__ #define __TP_STREAM_TUBE_CONNECTION_H__ #include #include #include #include G_BEGIN_DECLS /* TpStreamTubeConnection is defined in stream-tube-channel.h to break * circular includes */ typedef struct _TpStreamTubeConnectionClass TpStreamTubeConnectionClass; typedef struct _TpStreamTubeConnectionPrivate TpStreamTubeConnectionPrivate; GType tp_stream_tube_connection_get_type (void); #define TP_TYPE_STREAM_TUBE_CONNECTION \ (tp_stream_tube_connection_get_type ()) #define TP_STREAM_TUBE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_STREAM_TUBE_CONNECTION, \ TpStreamTubeConnection)) #define TP_STREAM_TUBE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_STREAM_TUBE_CONNECTION, \ TpStreamTubeConnectionClass)) #define TP_IS_STREAM_TUBE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_STREAM_TUBE_CONNECTION)) #define TP_IS_STREAM_TUBE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_STREAM_TUBE_CONNECTION)) #define TP_STREAM_TUBE_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_STREAM_TUBE_CONNECTION, \ TpStreamTubeConnectionClass)) GSocketConnection * tp_stream_tube_connection_get_socket_connection ( TpStreamTubeConnection *self); TpStreamTubeChannel * tp_stream_tube_connection_get_channel ( TpStreamTubeConnection *self); TpContact * tp_stream_tube_connection_get_contact ( TpStreamTubeConnection *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/defs.h0000644000175000017500000002447312652510705015453 00000000000000/* * defs.h - miscellaneous definitions * * Copyright (C) 2007-2009 Collabora Ltd. * Copyright (C) 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DEFS_H__ #define __TP_DEFS_H__ #include #include G_BEGIN_DECLS /** * TP_CM_BUS_NAME_BASE: * * The prefix for a connection manager's bus name, to which the CM's name * (e.g. "gabble") should be appended. */ #define TP_CM_BUS_NAME_BASE "org.freedesktop.Telepathy.ConnectionManager." /** * TP_CM_OBJECT_PATH_BASE: * * The prefix for a connection manager's object path, to which the CM's name * (e.g. "gabble") should be appended. */ #define TP_CM_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/ConnectionManager/" /** * TP_CONN_BUS_NAME_BASE: * * The prefix for a connection's bus name, to which the CM's name * (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence * of elements representing the account should be appended. */ #define TP_CONN_BUS_NAME_BASE "org.freedesktop.Telepathy.Connection." /** * TP_CONN_OBJECT_PATH_BASE: * * The prefix for a connection's object path, to which the CM's name * (e.g. "gabble"), the protocol (e.g. "jabber") and an element or sequence * of elements representing the account should be appended. */ #define TP_CONN_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Connection/" /** * TP_ACCOUNT_MANAGER_BUS_NAME: * * The account manager's well-known bus name */ #define TP_ACCOUNT_MANAGER_BUS_NAME "org.freedesktop.Telepathy.AccountManager" /** * TP_ACCOUNT_MANAGER_OBJECT_PATH: * * The account manager's standard object path */ #define TP_ACCOUNT_MANAGER_OBJECT_PATH "/org/freedesktop/Telepathy/AccountManager" /** * TP_ACCOUNT_OBJECT_PATH_BASE: * * The common prefix of the object path for all Account objects. */ #define TP_ACCOUNT_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Account/" /** * TP_CHANNEL_DISPATCHER_BUS_NAME: * * The channel dispatcher's well-known bus name */ #define TP_CHANNEL_DISPATCHER_BUS_NAME "org.freedesktop.Telepathy.ChannelDispatcher" /** * TP_CHANNEL_DISPATCHER_OBJECT_PATH: * * The channel dispatcher's standard object path */ #define TP_CHANNEL_DISPATCHER_OBJECT_PATH "/org/freedesktop/Telepathy/ChannelDispatcher" /** * TP_CLIENT_BUS_NAME_BASE: * * The common prefix of the well-known bus name for any Telepathy Client. */ #define TP_CLIENT_BUS_NAME_BASE "org.freedesktop.Telepathy.Client." /** * TP_CLIENT_OBJECT_PATH_BASE: * * The common prefix of the well-known object path for any Telepathy Client. */ #define TP_CLIENT_OBJECT_PATH_BASE "/org/freedesktop/Telepathy/Client/" /** * TP_DEBUG_OBJECT_PATH: * * The standard path for objects implementing the Telepathy Debug interface * (#TpSvcDebug). */ #define TP_DEBUG_OBJECT_PATH "/org/freedesktop/Telepathy/debug" /** * TP_USER_ACTION_TIME_NOT_USER_ACTION: * * The "user action time" used by methods like * tp_account_channel_request_new() to represent channel requests that are * not a result of user action. * * See also #TpAccountChannelRequest:user-action-time, * tp_user_action_time_from_x11(), tp_user_action_time_should_present() and * %TP_USER_ACTION_TIME_CURRENT_TIME. * * Since: 0.11.13 */ #define TP_USER_ACTION_TIME_NOT_USER_ACTION (G_GINT64_CONSTANT (0)) /** * TP_USER_ACTION_TIME_CURRENT_TIME: * * The "user action time" used by methods like * tp_account_channel_request_new() to represent channel requests that should * be treated as though they happened at the current time. This is the same * concept as %GDK_CURRENT_TIME in GDK (but note that the numerical value used * in Telepathy is not the same). * * See also #TpAccountChannelRequest:user-action-time, * tp_user_action_time_from_x11(), tp_user_action_time_should_present() and * %TP_USER_ACTION_TIME_NOT_USER_ACTION. * * Since: 0.11.13 */ #define TP_USER_ACTION_TIME_CURRENT_TIME (G_MAXINT64) #define _TP_ENCODE_VERSION(major, minor) (((major) << 16) | ((minor) << 8)) #define TP_VERSION_0_16 (_TP_ENCODE_VERSION (0, 16)) #define TP_VERSION_0_18 (_TP_ENCODE_VERSION (0, 18)) #define TP_VERSION_0_20 (_TP_ENCODE_VERSION (0, 20)) #define TP_VERSION_0_22 (_TP_ENCODE_VERSION (0, 22)) #define TP_VERSION_0_24 (_TP_ENCODE_VERSION (0, 24)) #define TP_VERSION_1_0 (_TP_ENCODE_VERSION (1, 0)) #if (TP_MINOR_VERSION == 99) /* special case for telepathy-glib 1.0 prereleases */ # define _TP_VERSION_CUR_STABLE (_TP_ENCODE_VERSION (TP_MAJOR_VERSION + 1, 0)) #elif (TP_MINOR_VERSION == 0) /* special case for telepathy-glib 1.0 itself */ # define _TP_VERSION_CUR_STABLE (_TP_ENCODE_VERSION (TP_MAJOR_VERSION, 0)) #elif (TP_MICRO_VERSION >= 99 && (TP_MINOR_VERSION % 2) == 0) /* development branch about to start (0.18.999.1) */ # define _TP_VERSION_CUR_STABLE \ (_TP_ENCODE_VERSION (TP_MAJOR_VERSION, TP_MINOR_VERSION + 2)) #elif (TP_MINOR_VERSION % 2) /* development branch */ # define _TP_VERSION_CUR_STABLE \ (_TP_ENCODE_VERSION (TP_MAJOR_VERSION, TP_MINOR_VERSION + 1)) #else /* stable branch */ # define _TP_VERSION_CUR_STABLE \ (_TP_ENCODE_VERSION (TP_MAJOR_VERSION, TP_MINOR_VERSION)) #endif #ifndef TP_VERSION_MIN_REQUIRED # define TP_VERSION_MIN_REQUIRED (_TP_VERSION_CUR_STABLE) #endif #ifndef TP_VERSION_MAX_ALLOWED # define TP_VERSION_MAX_ALLOWED (_TP_VERSION_CUR_STABLE) #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_MIN_REQUIRED # error "TP_VERSION_MAX_ALLOWED must be >= TP_VERSION_MIN_REQUIRED" #endif #if TP_VERSION_MIN_REQUIRED < TP_VERSION_0_16 # error "TP_VERSION_MIN_REQUIRED must be >= TP_VERSION_0_16" #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_0_16 # define _TP_DEPRECATED_IN_0_16 _TP_DEPRECATED # define _TP_DEPRECATED_IN_0_16_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_0_16 /* nothing */ # define _TP_DEPRECATED_IN_0_16_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_0_18 # define _TP_DEPRECATED_IN_0_18 _TP_DEPRECATED # define _TP_DEPRECATED_IN_0_18_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_0_18 /* nothing */ # define _TP_DEPRECATED_IN_0_18_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_0_20 # define _TP_DEPRECATED_IN_0_20 _TP_DEPRECATED # define _TP_DEPRECATED_IN_0_20_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_0_20 /* nothing */ # define _TP_DEPRECATED_IN_0_20_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_0_22 # define _TP_DEPRECATED_IN_0_22 _TP_DEPRECATED # define _TP_DEPRECATED_IN_0_22_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_0_22 /* nothing */ # define _TP_DEPRECATED_IN_0_22_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_0_24 # define _TP_DEPRECATED_IN_0_24 _TP_DEPRECATED # define _TP_DEPRECATED_IN_0_24_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_0_24 /* nothing */ # define _TP_DEPRECATED_IN_0_24_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= TP_VERSION_1_0 # define _TP_DEPRECATED_IN_1_0 _TP_DEPRECATED # define _TP_DEPRECATED_IN_1_0_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_1_0 /* nothing */ # define _TP_DEPRECATED_IN_1_0_FOR(f) /* nothing */ #endif #if TP_VERSION_MIN_REQUIRED >= _TP_VERSION_CUR_STABLE # define _TP_DEPRECATED_IN_UNRELEASED _TP_DEPRECATED # define _TP_DEPRECATED_IN_UNRELEASED_FOR(f) _TP_DEPRECATED_FOR(f) #else # define _TP_DEPRECATED_IN_UNRELEASED /* nothing */ # define _TP_DEPRECATED_IN_UNRELEASED_FOR(f) /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_0_16 # define _TP_AVAILABLE_IN_0_16 _TP_UNAVAILABLE(0, 16) #else # define _TP_AVAILABLE_IN_0_16 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_0_18 # define _TP_AVAILABLE_IN_0_18 _TP_UNAVAILABLE(0, 18) #else # define _TP_AVAILABLE_IN_0_18 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_0_20 # define _TP_AVAILABLE_IN_0_20 _TP_UNAVAILABLE(0, 20) #else # define _TP_AVAILABLE_IN_0_20 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_0_22 # define _TP_AVAILABLE_IN_0_22 _TP_UNAVAILABLE(0, 22) #else # define _TP_AVAILABLE_IN_0_22 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_0_24 # define _TP_AVAILABLE_IN_0_24 _TP_UNAVAILABLE(0, 24) #else # define _TP_AVAILABLE_IN_0_24 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < TP_VERSION_1_0 # define _TP_AVAILABLE_IN_1_0 _TP_UNAVAILABLE(1, 0) #else # define _TP_AVAILABLE_IN_1_0 /* nothing */ #endif #if TP_VERSION_MAX_ALLOWED < _TP_VERSION_CUR_STABLE # define _TP_AVAILABLE_IN_UNRELEASED \ _TP_UNAVAILABLE (TP_MAJOR_VERSION, TP_MINOR_VERSION) #else # define _TP_AVAILABLE_IN_UNRELEASED /* nothing */ #endif /* telepathy-glib-specific macros so our regression * tests can continue to test deprecated functionality, while avoiding * deprecated bits of other libraries */ #ifdef _TP_IGNORE_DEPRECATIONS #define _TP_DEPRECATED /* nothing */ #define _TP_DEPRECATED_FOR(f) /* nothing */ #define _TP_UNAVAILABLE(major, minor) /* nothing */ #define _TP_GNUC_DEPRECATED /* nothing */ #define _TP_GNUC_DEPRECATED_FOR(f) /* nothing */ #else #define _TP_DEPRECATED G_DEPRECATED #define _TP_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) #define _TP_UNAVAILABLE(major, minor) G_UNAVAILABLE(major, minor) /* Available for typedefs etc., not just functions, but gcc-specific */ #define _TP_GNUC_DEPRECATED G_GNUC_DEPRECATED #define _TP_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED_FOR(f) #endif /* like G_SEAL */ #if (defined (TP_SEAL_ENABLE) || defined (TP_DISABLE_DEPRECATED)) \ && !defined (_TP_COMPILATION) # define _TP_SEAL(ident) _tp_sealed__ ## ident #else # define _TP_SEAL(ident) ident #endif G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-generic.h0000644000175000017500000000052712652510705016731 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SVC_GENERIC_H__ #define __TP_SVC_GENERIC_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/handle-channels-context.c0000644000175000017500000004750312652510705021232 00000000000000/* * object for HandleChannels calls context * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: handle-channels-context * @title: TpHandleChannelsContext * @short_description: context of a Handler.HandleChannels() call * * Object used to represent the context of a Handler.HandleChannels() * D-Bus call on a #TpBaseClient. * * Since: 0.11.6 */ /** * TpHandleChannelsContext: * * Data structure representing the context of a Handler.HandleChannels() * call. * * Since: 0.11.6 */ /** * TpHandleChannelsContextClass: * * The class of a #TpHandleChannelsContext. * * Since: 0.11.6 */ #include "config.h" #include "telepathy-glib/handle-channels-context.h" #include "telepathy-glib/handle-channels-context-internal.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" struct _TpHandleChannelsContextClass { /**/ GObjectClass parent_class; }; G_DEFINE_TYPE(TpHandleChannelsContext, tp_handle_channels_context, G_TYPE_OBJECT) enum { PROP_ACCOUNT = 1, PROP_CONNECTION, PROP_CHANNELS, PROP_REQUESTS_SATISFIED, PROP_USER_ACTION_TIME, PROP_HANDLER_INFO, PROP_DBUS_CONTEXT, N_PROPS }; enum { SIGNAL_DONE, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; struct _TpHandleChannelsContextPrivate { TpHandleChannelsContextState state; GSimpleAsyncResult *result; DBusGMethodInvocation *dbus_context; /* Number of calls we are waiting they return. Once they have all returned * the context is considered as prepared */ guint num_pending; }; static void tp_handle_channels_context_init (TpHandleChannelsContext *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_HANDLE_CHANNELS_CONTEXT, TpHandleChannelsContextPrivate); self->priv->state = TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE; } static void tp_handle_channels_context_dispose (GObject *object) { TpHandleChannelsContext *self = TP_HANDLE_CHANNELS_CONTEXT ( object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_handle_channels_context_parent_class)->dispose; if (self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_DELAYED) { GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Disposing the TpHandleChannelsContext" }; WARNING ("Disposing a context in the %s state", self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE ? "none": "delayed"); tp_handle_channels_context_fail (self, &error); } if (self->account != NULL) { g_object_unref (self->account); self->account = NULL; } if (self->connection != NULL) { g_object_unref (self->connection); self->connection = NULL; } if (self->channels != NULL) { g_ptr_array_unref (self->channels); self->channels = NULL; } if (self->requests_satisfied != NULL) { g_ptr_array_foreach (self->requests_satisfied, (GFunc) g_object_unref, NULL); g_ptr_array_unref (self->requests_satisfied); self->requests_satisfied = NULL; } if (self->handler_info != NULL) { g_hash_table_unref (self->handler_info); self->handler_info = NULL; } if (self->priv->result != NULL) { g_object_unref (self->priv->result); self->priv->result = NULL; } if (dispose != NULL) dispose (object); } static void tp_handle_channels_context_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpHandleChannelsContext *self = TP_HANDLE_CHANNELS_CONTEXT ( object); switch (property_id) { case PROP_ACCOUNT: g_value_set_object (value, self->account); break; case PROP_CONNECTION: g_value_set_object (value, self->connection); break; case PROP_CHANNELS: g_value_set_boxed (value, self->channels); break; case PROP_REQUESTS_SATISFIED: g_value_set_boxed (value, self->requests_satisfied); break; case PROP_USER_ACTION_TIME: g_value_set_int64 (value, self->user_action_time); break; case PROP_HANDLER_INFO: g_value_set_boxed (value, self->handler_info); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_handle_channels_context_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpHandleChannelsContext *self = TP_HANDLE_CHANNELS_CONTEXT ( object); switch (property_id) { case PROP_ACCOUNT: self->account = g_value_dup_object (value); break; case PROP_CONNECTION: self->connection = g_value_dup_object (value); break; case PROP_CHANNELS: self->channels = g_value_dup_boxed (value); break; case PROP_REQUESTS_SATISFIED: self->requests_satisfied = g_value_dup_boxed (value); g_ptr_array_foreach (self->requests_satisfied, (GFunc) g_object_ref, NULL); break; case PROP_USER_ACTION_TIME: self->user_action_time = g_value_get_int64 (value); break; case PROP_HANDLER_INFO: self->handler_info = g_value_dup_boxed (value); break; case PROP_DBUS_CONTEXT: self->priv->dbus_context = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_handle_channels_context_constructed (GObject *object) { TpHandleChannelsContext *self = TP_HANDLE_CHANNELS_CONTEXT ( object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_handle_channels_context_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (self->account != NULL); g_assert (self->connection != NULL); g_assert (self->channels != NULL); g_assert (self->requests_satisfied != NULL); g_assert (self->handler_info != NULL); g_assert (self->priv->dbus_context != NULL); } static void tp_handle_channels_context_class_init ( TpHandleChannelsContextClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpHandleChannelsContextPrivate)); object_class->get_property = tp_handle_channels_context_get_property; object_class->set_property = tp_handle_channels_context_set_property; object_class->constructed = tp_handle_channels_context_constructed; object_class->dispose = tp_handle_channels_context_dispose; /** * TpHandleChannelsContext:account: * * A #TpAccount object representing the Account of the DispatchOperation * that has been passed to HandleChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_object ("account", "TpAccount", "The TpAccount of the context", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpHandleChannelsContext:connection: * * A #TpConnection object representing the Connection of the DispatchOperation * that has been passed to HandleChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_object ("connection", "TpConnection", "The TpConnection of the context", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpHandleChannelsContext:channels: * * A #GPtrArray containing #TpChannel objects representing the channels * that have been passed to HandleChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_boxed ("channels", "GPtrArray of TpChannel", "The TpChannels that have been passed to HandleChannels", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNELS, param_spec); /** * TpHandleChannelsContext:requests-satisfied: * * A #GPtrArray containing #TpChannelRequest objects representing the * requests that have been passed to HandleChannels. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_boxed ("requests-satisfied", "GPtrArray of TpChannelRequest", "The TpChannelRequest that has been passed to " "HandleChannels", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUESTS_SATISFIED, param_spec); /** * TpHandleChannelsContext:user-action-time: * * The time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME * (see #TpAccountChannelRequest:user-action-time for details) * * Read-only except during construction. * * Since: 0.11.6 */ param_spec = g_param_spec_int64 ("user-action-time", "User action time", "The User_Action_Time that has been passed to HandleChannels", 0, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, param_spec); /** * TpHandleChannelsContext:handler-info: * * A #GHashTable where the keys are string and values are GValue instances. * It represents the Handler_info hash table that has been passed to * HandleChannels. * * This property can't be %NULL. * * Since: 0.11.6 */ param_spec = g_param_spec_boxed ("handler-info", "Handler info", "The Handler that has been passed to ObserveChannels", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HANDLER_INFO, param_spec); /** * TpHandleChannelsContext:dbus-context: (skip) * * The #DBusGMethodInvocation representing the D-Bus context of the * HandleChannels call. * Can only be written during construction. * * Since: 0.11.6 */ param_spec = g_param_spec_pointer ("dbus-context", "D-Bus context", "The DBusGMethodInvocation associated with the HandleChannels call", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_CONTEXT, param_spec); /** * TpHandleChannelsContext::done: * @self: a #TpHandleChannelsContext * * Emitted when tp_handle_channels_context_accept has been called on @self. * * Since: 0.11.6 */ signals[SIGNAL_DONE] = g_signal_new ( "done", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); } TpHandleChannelsContext * _tp_handle_channels_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, GPtrArray *requests_satisfied, guint64 user_action_time, GHashTable *handler_info, DBusGMethodInvocation *dbus_context) { return g_object_new (TP_TYPE_HANDLE_CHANNELS_CONTEXT, "account", account, "connection", connection, "channels", channels, "requests-satisfied", requests_satisfied, "user-action-time", user_action_time, "handler-info", handler_info, "dbus-context", dbus_context, NULL); } /** * tp_handle_channels_context_accept: * @self: a #TpHandleChannelsContext * * Called by #TpBaseClientClassAddDispatchOperationImpl when it's done so * the D-Bus method can return. * * The caller is responsible for closing channels with * tp_cli_channel_call_close() when it has finished handling them. * * Since: 0.11.6 */ void tp_handle_channels_context_accept (TpHandleChannelsContext *self) { g_return_if_fail (self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_HANDLE_CHANNELS_CONTEXT_STATE_DONE; dbus_g_method_return (self->priv->dbus_context); self->priv->dbus_context = NULL; g_signal_emit (self, signals[SIGNAL_DONE], 0); } /** * tp_handle_channels_context_fail: * @self: a #TpHandleChannelsContext * @error: the error to return from the method * * Called by #TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error. * * Since: 0.11.6 */ void tp_handle_channels_context_fail (TpHandleChannelsContext *self, const GError *error) { g_return_if_fail (self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE || self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_HANDLE_CHANNELS_CONTEXT_STATE_FAILED; dbus_g_method_return_error (self->priv->dbus_context, error); self->priv->dbus_context = NULL; } /** * tp_handle_channels_context_delay: * @self: a #TpHandleChannelsContext * * Called by #TpBaseClientClassAddDispatchOperationImpl to indicate that it * implements the method in an async way. The caller must take a reference * to the #TpHandleChannelsContext before calling this function, and * is responsible for calling either * tp_handle_channels_context_accept() or * tp_handle_channels_context_fail() later. * * Since: 0.11.6 */ void tp_handle_channels_context_delay (TpHandleChannelsContext *self) { g_return_if_fail (self->priv->state == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE); self->priv->state = TP_HANDLE_CHANNELS_CONTEXT_STATE_DELAYED; } TpHandleChannelsContextState _tp_handle_channels_context_get_state ( TpHandleChannelsContext *self) { return self->priv->state; } static gboolean context_is_prepared (TpHandleChannelsContext *self) { return self->priv->num_pending == 0; } static void context_check_prepare (TpHandleChannelsContext *self) { if (!context_is_prepared (self)) return; /* is prepared */ g_simple_async_result_complete (self->priv->result); g_object_unref (self->priv->result); self->priv->result = NULL; } static void account_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpHandleChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void conn_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpHandleChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare connection: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void hcc_channel_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpHandleChannelsContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare channel: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void context_prepare (TpHandleChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features) { guint i; self->priv->num_pending = 2; tp_proxy_prepare_async (self->account, account_features, account_prepare_cb, g_object_ref (self)); tp_proxy_prepare_async (self->connection, connection_features, conn_prepare_cb, g_object_ref (self)); for (i = 0; i < self->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->channels, i); self->priv->num_pending++; tp_proxy_prepare_async (channel, channel_features, hcc_channel_prepare_cb, g_object_ref (self)); } } void _tp_handle_channels_context_prepare_async ( TpHandleChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self)); /* This is only used once, by TpBaseClient, so for simplicity, we only * allow one asynchronous preparation */ g_return_if_fail (self->priv->result == NULL); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, _tp_handle_channels_context_prepare_async); context_prepare (self, account_features, connection_features, channel_features); } gboolean _tp_handle_channels_context_prepare_finish ( TpHandleChannelsContext *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, _tp_handle_channels_context_prepare_async); } /** * tp_handle_channels_context_get_handler_info: * @self: a channel-handling context * * Return any extra information that accompanied this request to handle * channels (the Handler_Info argument from the HandleChannels D-Bus method). * Well-known keys for this map will be defined by the Telepathy D-Bus * Interface Specification; at the time of writing, none have been defined. * * The returned hash table is only valid for as long as @self is. * * Returns: (transfer none) (element-type utf8 GObject.Value): extensible * extra handler information, in a form suitable for use with * tp_asv_get_string() etc. * * Since: 0.11.14 */ const GHashTable * tp_handle_channels_context_get_handler_info (TpHandleChannelsContext *self) { g_return_val_if_fail (TP_IS_HANDLE_CHANNELS_CONTEXT (self), NULL); return self->handler_info; } /** * tp_handle_channels_context_get_requests: * @self: a channel-handling context * * Return a list of the #TpChannelRequest which have been satisfied by the * channels associated with #self. * * Returns: (transfer full) (element-type TelepathyGLib.ChannelRequest): * a newly allocated #GList of reffed #TpChannelRequest. * * Since: 0.13.14 */ GList * tp_handle_channels_context_get_requests ( TpHandleChannelsContext *self) { GHashTable *request_props; request_props = tp_asv_get_boxed (self->handler_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP); if (request_props == NULL) return NULL; return _tp_create_channel_request_list ( tp_proxy_get_factory (self->account), request_props); } telepathy-glib-0.24.2/telepathy-glib/handle-channels-context.h0000644000175000017500000000541312652510705021231 00000000000000/* * object for HandleChannels calls context * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HANDLE_CHANNELS_CONTEXT_H__ #define __TP_HANDLE_CHANNELS_CONTEXT_H__ #include #include G_BEGIN_DECLS typedef struct _TpHandleChannelsContext TpHandleChannelsContext; typedef struct _TpHandleChannelsContextClass \ TpHandleChannelsContextClass; typedef struct _TpHandleChannelsContextPrivate \ TpHandleChannelsContextPrivate; GType tp_handle_channels_context_get_type (void); #define TP_TYPE_HANDLE_CHANNELS_CONTEXT \ (tp_handle_channels_context_get_type ()) #define TP_HANDLE_CHANNELS_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_HANDLE_CHANNELS_CONTEXT, \ TpHandleChannelsContext)) #define TP_HANDLE_CHANNELS_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_HANDLE_CHANNELS_CONTEXT, \ TpHandleChannelsContextClass)) #define TP_IS_HANDLE_CHANNELS_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_HANDLE_CHANNELS_CONTEXT)) #define TP_IS_HANDLE_CHANNELS_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_HANDLE_CHANNELS_CONTEXT)) #define TP_HANDLE_CHANNELS_CONTEXT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_HANDLE_CHANNELS_CONTEXT, \ TpHandleChannelsContextClass)) void tp_handle_channels_context_accept ( TpHandleChannelsContext *self); void tp_handle_channels_context_fail ( TpHandleChannelsContext *self, const GError *error); void tp_handle_channels_context_delay ( TpHandleChannelsContext *self); const GHashTable *tp_handle_channels_context_get_handler_info ( TpHandleChannelsContext *self); GList * tp_handle_channels_context_get_requests ( TpHandleChannelsContext *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/account-manager.xml0000644000175000017500000000036012652510705020134 00000000000000 Account Manager interfaces telepathy-glib-0.24.2/telepathy-glib/dtmf.c0000644000175000017500000003457712652510705015465 00000000000000/* DTMF utility functions * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/dtmf.h" #include #include #include /** * SECTION:dtmf * @title: DTMF dialstring interpreter * @short_description: Converts a dialstring into a timed sequence of events * * Telepathy offers two APIs for DTMF events: user interfaces can either * call the StartTone and StopTone methods (appropriate if the user is * pressing hardware or on-screen buttons in real time), or call * MultipleTones or set InitialTones (appropriate if a stored dialstring * is in use). * * #TpDTMFPlayer provides common code for connection managers that need to * turn MultipleTones or InitialTones received from a UI into a sequence of * start and stop events for the underlying protocol. * * Since: 0.13.3 */ /** * tp_dtmf_event_to_char: * @event: a TpDTMFEvent * * Return a printable ASCII character representing @event, or '?' if @event * was not understood. * * Returns: a printable ASCII character * * Since: 0.13.3 */ gchar tp_dtmf_event_to_char (TpDTMFEvent event) { switch (event) { case TP_DTMF_EVENT_DIGIT_0: case TP_DTMF_EVENT_DIGIT_1: case TP_DTMF_EVENT_DIGIT_2: case TP_DTMF_EVENT_DIGIT_3: case TP_DTMF_EVENT_DIGIT_4: case TP_DTMF_EVENT_DIGIT_5: case TP_DTMF_EVENT_DIGIT_6: case TP_DTMF_EVENT_DIGIT_7: case TP_DTMF_EVENT_DIGIT_8: case TP_DTMF_EVENT_DIGIT_9: return '0' + (event - TP_DTMF_EVENT_DIGIT_0); case TP_DTMF_EVENT_ASTERISK: return '*'; case TP_DTMF_EVENT_HASH: return '#'; case TP_DTMF_EVENT_LETTER_A: case TP_DTMF_EVENT_LETTER_B: case TP_DTMF_EVENT_LETTER_C: case TP_DTMF_EVENT_LETTER_D: return 'A' + (event - TP_DTMF_EVENT_LETTER_A); default: return '?'; } } #define INVALID_DTMF_EVENT ((TpDTMFEvent) 0xFF) TpDTMFEvent _tp_dtmf_char_to_event (gchar c) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return TP_DTMF_EVENT_DIGIT_0 + (c - '0'); case 'A': case 'B': case 'C': case 'D': return TP_DTMF_EVENT_LETTER_A + (c - 'A'); /* not strictly valid but let's be nice to people */ case 'a': case 'b': case 'c': case 'd': return TP_DTMF_EVENT_LETTER_A + (c - 'a'); case '*': return TP_DTMF_EVENT_ASTERISK; case '#': return TP_DTMF_EVENT_HASH; default: return INVALID_DTMF_EVENT; } } DTMFCharClass _tp_dtmf_char_classify (gchar c) { switch (c) { case 'w': case 'W': return DTMF_CHAR_CLASS_WAIT_FOR_USER; case 'p': case 'P': case 'x': case 'X': case ',': return DTMF_CHAR_CLASS_PAUSE; default: if (_tp_dtmf_char_to_event (c) != INVALID_DTMF_EVENT) return DTMF_CHAR_CLASS_EVENT; else return DTMF_CHAR_CLASS_MEANINGLESS; } } /** * TpDTMFPlayer: * * An object to convert a string of characters representing DTMF tones * into timed start and stop events. * * Typically, a connection manager should instantiate one #TpDTMFPlayer * for each StreamedMedia or Call channel that supports DTMF. * * The #TpDTMFPlayer::started-tone and #TpDTMFPlayer::stopped-tone * signals should be connected to some way to play a tone, either directly * or by emitting signals from the StreamHandler interface. * * The #TpDTMFPlayer::tones-deferred signal should trigger emission of * TonesDeferred. * * The #TpDTMFPlayer::finished signal indicates that the current sequence * of tones has finished. * * Since: 0.13.3 */ G_DEFINE_TYPE (TpDTMFPlayer, tp_dtmf_player, G_TYPE_OBJECT) struct _TpDTMFPlayerPrivate { /* owned, or NULL */ gchar *dialstring; /* a pointer into dialstring, or NULL */ const gchar *dialstring_remaining; guint timer_id; guint tone_ms; guint gap_ms; guint pause_ms; gboolean playing_tone; gboolean paused; }; static guint sig_id_started_tone; static guint sig_id_stopped_tone; static guint sig_id_finished; static guint sig_id_tones_deferred; static void tp_dtmf_player_emit_started_tone (TpDTMFPlayer *self, TpDTMFEvent tone) { self->priv->playing_tone = TRUE; g_signal_emit (self, sig_id_started_tone, 0, tone); } static void tp_dtmf_player_maybe_emit_stopped_tone (TpDTMFPlayer *self) { self->priv->paused = FALSE; if (!self->priv->playing_tone) return; self->priv->playing_tone = FALSE; g_signal_emit (self, sig_id_stopped_tone, 0); } static void tp_dtmf_player_emit_finished (TpDTMFPlayer *self, gboolean cancelled) { g_signal_emit (self, sig_id_finished, 0, cancelled); } static void tp_dtmf_player_emit_tones_deferred (TpDTMFPlayer *self, const gchar *remaining_tones) { g_signal_emit (self, sig_id_tones_deferred, 0, remaining_tones); } /** * tp_dtmf_player_cancel: * @self: a DTMF interpreter * * If tones were being played, stop the current tone (if any), * stop playing subsequent tones, and emit #TpDTMFPlayer::finished. * * Otherwise, do nothing. * * Since: 0.13.3 */ void tp_dtmf_player_cancel (TpDTMFPlayer *self) { g_return_if_fail (TP_IS_DTMF_PLAYER (self)); if (self->priv->timer_id != 0) { tp_dtmf_player_maybe_emit_stopped_tone (self); tp_dtmf_player_emit_finished (self, TRUE); g_source_remove (self->priv->timer_id); self->priv->timer_id = 0; } tp_clear_pointer (&self->priv->dialstring, g_free); } static gboolean tp_dtmf_player_timer_cb (gpointer data) { TpDTMFPlayer *self = data; gboolean was_playing = self->priv->playing_tone; gboolean was_paused = self->priv->paused; self->priv->timer_id = 0; tp_dtmf_player_maybe_emit_stopped_tone (self); if ((was_playing || was_paused) && !tp_str_empty (self->priv->dialstring_remaining)) { /* We're at the end of a tone. Advance to the next tone. */ self->priv->dialstring_remaining++; } if (tp_str_empty (self->priv->dialstring_remaining)) { /* die of natural causes */ tp_dtmf_player_emit_finished (self, FALSE); tp_dtmf_player_cancel (self); return FALSE; } switch (_tp_dtmf_char_classify (*self->priv->dialstring_remaining)) { case DTMF_CHAR_CLASS_EVENT: if (was_playing) { /* Play a gap (short silence) before the next tone */ self->priv->timer_id = g_timeout_add (self->priv->gap_ms, tp_dtmf_player_timer_cb, self); } else { /* We're at the end of a gap or pause, or in our initial state. * Play the tone straight away. */ tp_dtmf_player_emit_started_tone (self, _tp_dtmf_char_to_event (*self->priv->dialstring_remaining)); self->priv->timer_id = g_timeout_add (self->priv->tone_ms, tp_dtmf_player_timer_cb, self); } break; case DTMF_CHAR_CLASS_PAUSE: /* Pause, typically for 3 seconds. We don't need to have a gap * first. */ self->priv->paused = TRUE; self->priv->timer_id = g_timeout_add (self->priv->pause_ms, tp_dtmf_player_timer_cb, self); break; case DTMF_CHAR_CLASS_WAIT_FOR_USER: /* Just tell the UI "I can't play these tones yet" and go back to * sleep (the UI is responsible for feeding them back to us whenever * appropriate), unless we're at the end of the string. Again, we * don't need a gap. */ if (self->priv->dialstring_remaining[1] != '\0') tp_dtmf_player_emit_tones_deferred (self, self->priv->dialstring_remaining + 1); tp_dtmf_player_emit_finished (self, FALSE); tp_dtmf_player_cancel (self); break; default: g_assert_not_reached (); } return FALSE; } /** * tp_dtmf_player_play: * @self: a DTMF interpreter * @tones: a sequence of tones or other events * @tone_ms: length of a tone (0-9, A-D, # or *) in milliseconds, * which must be positive; typically 250 * @gap_ms: length of the gap between two tones, which must be positive; * typically 100 * @pause_ms: length of the pause produced by P, X or comma, which must be * positive; typically 3000 * @error: used to raise an error * * Start to play a sequence of tones, by emitting the * #TpDTMFPlayer::started-tone and #TpDTMFPlayer::stopped-tone signals. * * If tp_dtmf_player_is_active() would return %TRUE, this method raises * %TP_ERROR_SERVICE_BUSY and does not play anything, and the previous * sequence continues to play. * * The recognised characters are 0-9, A-D, * # and * (which play the corresponding DTMF event), P, X and comma (which * each pause for @pause_ms milliseconds), and W * (which stops interpretation of the string and emits * #TpDTMFPlayer::tones-deferred with the rest of the string). The * corresponding lower-case letters are also allowed. * If @tones contains any other characters, this method raises * %TP_ERROR_INVALID_ARGUMENT and does not play anything. * * Returns: %TRUE on success, %FALSE (setting @error) on failure * * Since: 0.13.3 */ gboolean tp_dtmf_player_play (TpDTMFPlayer *self, const gchar *tones, guint tone_ms, guint gap_ms, guint pause_ms, GError **error) { guint i; g_return_val_if_fail (TP_IS_DTMF_PLAYER (self), FALSE); g_return_val_if_fail (tones != NULL, FALSE); g_return_val_if_fail (tone_ms > 0, FALSE); g_return_val_if_fail (gap_ms > 0, FALSE); g_return_val_if_fail (pause_ms > 0, FALSE); if (self->priv->dialstring != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_SERVICE_BUSY, "DTMF tones are already being played"); return FALSE; } g_assert (self->priv->timer_id == 0); for (i = 0; tones[i] != '\0'; i++) { if (_tp_dtmf_char_classify (tones[i]) == DTMF_CHAR_CLASS_MEANINGLESS) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid character in DTMF string starting at %s", tones + i); return FALSE; } } self->priv->dialstring = g_strdup (tones); self->priv->dialstring_remaining = self->priv->dialstring; self->priv->tone_ms = tone_ms; self->priv->gap_ms = gap_ms; self->priv->pause_ms = pause_ms; /* start off the process: conceptually, this is the end of the zero-length * gap before the first tone */ self->priv->playing_tone = FALSE; tp_dtmf_player_timer_cb (self); return TRUE; } /** * tp_dtmf_player_is_active: * @self: a DTMF interpreter * * * * Returns: %TRUE if a sequence of tones is currently playing * * Since: 0.13.3 */ gboolean tp_dtmf_player_is_active (TpDTMFPlayer *self) { g_return_val_if_fail (TP_IS_DTMF_PLAYER (self), FALSE); return (self->priv->dialstring != NULL); } #define MY_PARENT_CLASS (tp_dtmf_player_parent_class) static void tp_dtmf_player_init (TpDTMFPlayer *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_DTMF_PLAYER, TpDTMFPlayerPrivate); self->priv->dialstring = NULL; self->priv->dialstring_remaining = NULL; self->priv->playing_tone = FALSE; self->priv->timer_id = 0; } static void tp_dtmf_player_dispose (GObject *object) { TpDTMFPlayer *self = (TpDTMFPlayer *) object; void (*dispose) (GObject *) = G_OBJECT_CLASS (MY_PARENT_CLASS)->dispose; tp_dtmf_player_cancel (self); if (dispose != NULL) dispose (object); } static void tp_dtmf_player_class_init (TpDTMFPlayerClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; g_type_class_add_private (cls, sizeof (TpDTMFPlayerPrivate)); object_class->dispose = tp_dtmf_player_dispose; /** * TpDTMFPlayer::started-tone: * @self: the #TpDTMFPlayer * @event: a %G_TYPE_UINT representing the tone being played * * Emitted at the beginning of each tone. */ sig_id_started_tone = g_signal_new ("started-tone", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT); /** * TpDTMFPlayer::stopped-tone: * @self: the #TpDTMFPlayer * * Emitted at the end of each tone. * * Since: 0.13.3 */ sig_id_stopped_tone = g_signal_new ("stopped-tone", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpDTMFPlayer::finished: * @self: the #TpDTMFPlayer * @cancelled: %TRUE if playback was cancelled with tp_dtmf_player_cancel() * * Emitted when playback stops, either because the end of the * sequence was reached, tp_dtmf_player_cancel() was called, or a 'W' * or 'w' character was encountered. * * Since: 0.13.3 */ sig_id_finished = g_signal_new ("finished", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * TpDTMFPlayer::tones-deferred: * @self: the #TpDTMFPlayer * @tones: the remaining tones, starting from just after the 'W' or 'w' * * Emitted just before #TpDTMFPlayer::finished if a 'W' or 'w' character * is encountered before the end of a dial string. The connection * manager is expected to wait for the user to confirm, then call * tp_dtmf_player_play() again, using this signal's argument as the new * dial string. * * Since: 0.13.3 */ sig_id_tones_deferred = g_signal_new ("tones-deferred", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); } /** * tp_dtmf_player_new: * * * * Returns: (transfer full): a new DTMF interpreter * * Since: 0.13.3 */ TpDTMFPlayer * tp_dtmf_player_new (void) { return g_object_new (TP_TYPE_DTMF_PLAYER, NULL); } telepathy-glib-0.24.2/telepathy-glib/dtmf.h0000644000175000017500000000473312652510705015461 00000000000000/* DTMF utility functions * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DTMF_H__ #define __TP_DTMF_H__ #include #include gchar tp_dtmf_event_to_char (TpDTMFEvent event); typedef struct _TpDTMFPlayer TpDTMFPlayer; typedef struct _TpDTMFPlayerClass TpDTMFPlayerClass; typedef struct _TpDTMFPlayerPrivate TpDTMFPlayerPrivate; GType tp_dtmf_player_get_type (void); #define TP_TYPE_DTMF_PLAYER \ (tp_dtmf_player_get_type ()) #define TP_DTMF_PLAYER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_DTMF_PLAYER, \ TpDTMFPlayer)) #define TP_DTMF_PLAYER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_DTMF_PLAYER, \ TpDTMFPlayerClass)) #define TP_IS_DTMF_PLAYER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_DTMF_PLAYER)) #define TP_IS_DTMF_PLAYER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_DTMF_PLAYER)) #define TP_DTMF_PLAYER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DTMF_PLAYER, \ TpDTMFPlayerClass)) struct _TpDTMFPlayer { GObject parent; TpDTMFPlayerPrivate *priv; }; struct _TpDTMFPlayerClass { GObjectClass parent_class; gpointer priv; }; TpDTMFPlayer *tp_dtmf_player_new (void); gboolean tp_dtmf_player_play (TpDTMFPlayer *self, const gchar *tones, guint tone_ms, guint gap_ms, guint pause_ms, GError **error); gboolean tp_dtmf_player_is_active (TpDTMFPlayer *self); void tp_dtmf_player_cancel (TpDTMFPlayer *self); #endif telepathy-glib-0.24.2/telepathy-glib/dbus-internal.h0000644000175000017500000000264012652510705017271 00000000000000/**/ /* * internal-dbus-glib.h - private header for dbus-glib glue * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #ifndef __TP_INTERNAL_DBUS_GLIB_H__ #define __TP_INTERNAL_DBUS_GLIB_H__ G_BEGIN_DECLS gboolean _tp_dbus_daemon_get_name_owner (TpDBusDaemon *self, gint timeout_ms, const gchar *well_known_name, gchar **unique_name, GError **error); void _tp_register_dbus_glib_marshallers (void); DBusGConnection *_tp_dbus_starter_bus_conn (GError **error) G_GNUC_WARN_UNUSED_RESULT; gboolean _tp_dbus_daemon_is_the_shared_one (TpDBusDaemon *self); G_END_DECLS #endif /* __TP_INTERNAL_DBUS_GLIB_H__ */ telepathy-glib-0.24.2/telepathy-glib/media-interfaces.c0000644000175000017500000001645712652510705017730 00000000000000/* * media-interfaces.c - proxies for Telepathy media session/stream handlers * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/media-interfaces.h" #include #include #include #include #include "telepathy-glib/_gen/tp-cli-media-session-handler-body.h" #include "telepathy-glib/_gen/tp-cli-media-stream-handler-body.h" /** * SECTION:media-interfaces * @title: TpMediaSessionHandler, TpMediaStreamHandler * @short_description: proxy objects for Telepathy media streaming * @see_also: #TpChannel, #TpProxy * * This module provides access to the auxiliary objects used to * implement #TpSvcChannelTypeStreamedMedia. * * Since: 0.7.1 */ /** * TpMediaStreamHandlerClass: * * The class of a #TpMediaStreamHandler. * * Since: 0.7.1 */ struct _TpMediaStreamHandlerClass { TpProxyClass parent_class; /**/ gpointer priv; }; /** * TpMediaStreamHandler: * * A proxy object for a Telepathy connection manager. * * Since: 0.7.1 */ struct _TpMediaStreamHandler { TpProxy parent; /**/ TpMediaStreamHandlerPrivate *priv; }; G_DEFINE_TYPE (TpMediaStreamHandler, tp_media_stream_handler, TP_TYPE_PROXY) static void tp_media_stream_handler_init (TpMediaStreamHandler *self) { } static void tp_media_stream_handler_class_init (TpMediaStreamHandlerClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; proxy_class->must_have_unique_name = TRUE; proxy_class->interface = TP_IFACE_QUARK_MEDIA_STREAM_HANDLER; tp_media_stream_handler_init_known_interfaces (); } /** * tp_media_stream_handler_new: * @dbus: a D-Bus daemon; may not be %NULL * @unique_name: the unique name of the connection process; may not be %NULL * or a well-known name * @object_path: the object path of the media stream handler; may not be %NULL * @error: used to indicate the error if %NULL is returned * * * * Returns: a new media stream handler proxy, or %NULL on invalid arguments * * Since: 0.7.1 */ TpMediaStreamHandler * tp_media_stream_handler_new (TpDBusDaemon *dbus, const gchar *unique_name, const gchar *object_path, GError **error) { TpMediaStreamHandler *ret = NULL; if (!tp_dbus_check_valid_bus_name (unique_name, TP_DBUS_NAME_TYPE_UNIQUE, error)) goto finally; if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; ret = TP_MEDIA_STREAM_HANDLER (g_object_new (TP_TYPE_MEDIA_STREAM_HANDLER, "dbus-daemon", dbus, "bus-name", unique_name, "object-path", object_path, NULL)); finally: return ret; } /** * TpMediaSessionHandlerClass: * * The class of a #TpMediaSessionHandler. * * Since: 0.7.1 */ struct _TpMediaSessionHandlerClass { TpProxyClass parent_class; /**/ gpointer priv; }; /** * TpMediaSessionHandler: * * A proxy object for a Telepathy connection manager. * * Since: 0.7.1 */ struct _TpMediaSessionHandler { TpProxy parent; /**/ TpMediaSessionHandlerPrivate *priv; }; G_DEFINE_TYPE (TpMediaSessionHandler, tp_media_session_handler, TP_TYPE_PROXY) static void tp_media_session_handler_init (TpMediaSessionHandler *self) { } static void tp_media_session_handler_class_init (TpMediaSessionHandlerClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; proxy_class->must_have_unique_name = TRUE; proxy_class->interface = TP_IFACE_QUARK_MEDIA_SESSION_HANDLER; tp_media_session_handler_init_known_interfaces (); } /** * tp_media_session_handler_new: * @dbus: a D-Bus daemon; may not be %NULL * @unique_name: the unique name of the connection process; may not be %NULL * or a well-known name * @object_path: the object path of the media session handler; may not be %NULL * @error: used to indicate the error if %NULL is returned * * * * Returns: a new media session handler proxy, or %NULL on invalid arguments * * Since: 0.7.1 */ TpMediaSessionHandler * tp_media_session_handler_new (TpDBusDaemon *dbus, const gchar *unique_name, const gchar *object_path, GError **error) { TpMediaSessionHandler *ret = NULL; if (!tp_dbus_check_valid_bus_name (unique_name, TP_DBUS_NAME_TYPE_UNIQUE, error)) goto finally; if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; ret = TP_MEDIA_SESSION_HANDLER (g_object_new (TP_TYPE_MEDIA_SESSION_HANDLER, "dbus-daemon", dbus, "bus-name", unique_name, "object-path", object_path, NULL)); finally: return ret; } /** * tp_media_stream_handler_init_known_interfaces: * * Ensure that the known interfaces for TpMediaStreamHandler have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_MEDIA_STREAM_HANDLER. * * Since: 0.7.32 */ void tp_media_stream_handler_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_MEDIA_STREAM_HANDLER; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_media_stream_handler_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_media_session_handler_init_known_interfaces: * * Ensure that the known interfaces for TpMediaSessionHandler have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_MEDIA_SESSION_HANDLER. * * Since: 0.7.32 */ void tp_media_session_handler_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_MEDIA_SESSION_HANDLER; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_media_session_handler_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } telepathy-glib-0.24.2/telepathy-glib/media-interfaces.h0000644000175000017500000000777612652510705017741 00000000000000/* * media-interfaces.h - proxies for Telepathy media session/stream handlers * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_MEDIA_INTERFACES_H__ #define __TP_MEDIA_INTERFACES_H__ #include #include G_BEGIN_DECLS typedef struct _TpMediaStreamHandler TpMediaStreamHandler; typedef struct _TpMediaStreamHandlerPrivate TpMediaStreamHandlerPrivate; typedef struct _TpMediaStreamHandlerClass TpMediaStreamHandlerClass; GType tp_media_stream_handler_get_type (void); typedef struct _TpMediaSessionHandler TpMediaSessionHandler; typedef struct _TpMediaSessionHandlerPrivate TpMediaSessionHandlerPrivate; typedef struct _TpMediaSessionHandlerClass TpMediaSessionHandlerClass; GType tp_media_session_handler_get_type (void); /* TYPE MACROS */ #define TP_TYPE_MEDIA_STREAM_HANDLER \ (tp_media_stream_handler_get_type ()) #define TP_MEDIA_STREAM_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_MEDIA_STREAM_HANDLER, \ TpMediaStreamHandler)) #define TP_MEDIA_STREAM_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_MEDIA_STREAM_HANDLER, \ TpMediaStreamHandlerClass)) #define TP_IS_MEDIA_STREAM_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_MEDIA_STREAM_HANDLER)) #define TP_IS_MEDIA_STREAM_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_MEDIA_STREAM_HANDLER)) #define TP_MEDIA_STREAM_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_MEDIA_STREAM_HANDLER, \ TpMediaStreamHandlerClass)) #define TP_TYPE_MEDIA_SESSION_HANDLER \ (tp_media_session_handler_get_type ()) #define TP_MEDIA_SESSION_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_MEDIA_SESSION_HANDLER, \ TpMediaSessionHandler)) #define TP_MEDIA_SESSION_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_MEDIA_SESSION_HANDLER, \ TpMediaSessionHandlerClass)) #define TP_IS_MEDIA_SESSION_HANDLER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_MEDIA_SESSION_HANDLER)) #define TP_IS_MEDIA_SESSION_HANDLER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_MEDIA_SESSION_HANDLER)) #define TP_MEDIA_SESSION_HANDLER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_MEDIA_SESSION_HANDLER, \ TpMediaSessionHandlerClass)) TpMediaSessionHandler *tp_media_session_handler_new (TpDBusDaemon *dbus, const gchar *unique_name, const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT; TpMediaStreamHandler *tp_media_stream_handler_new (TpDBusDaemon *dbus, const gchar *unique_name, const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT; void tp_media_session_handler_init_known_interfaces (void); void tp_media_stream_handler_init_known_interfaces (void); G_END_DECLS #include #include #endif telepathy-glib-0.24.2/telepathy-glib/connection-handles.c0000644000175000017500000004477512652510705020307 00000000000000/* Helper to hold Telepathy handles. * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection-internal.h" #include #include #define DEBUG_FLAG TP_DEBUG_HANDLES #include "telepathy-glib/debug-internal.h" /** * tp_connection_unref_handles: * @self: a connection * @handle_type: a handle type * @n_handles: the number of handles in @handles * @handles: (array length=n_handles): an array of @n_handles handles * * Do nothing. In versions of telepathy-glib prior to 0.13.8, * this released a reference to the handles in @handles. * * Deprecated: This is no-op so can be safely removed. */ void tp_connection_unref_handles (TpConnection *self G_GNUC_UNUSED, TpHandleType handle_type G_GNUC_UNUSED, guint n_handles G_GNUC_UNUSED, const TpHandle *handles G_GNUC_UNUSED) { } typedef struct { TpHandleType handle_type; GArray *handles; gpointer user_data; GDestroyNotify destroy; TpConnectionHoldHandlesCb callback; } HoldHandlesContext; static void hold_handles_context_free (gpointer p) { HoldHandlesContext *context = p; if (context->destroy != NULL) context->destroy (context->user_data); g_array_unref (context->handles); g_slice_free (HoldHandlesContext, context); } /** * TpConnectionHoldHandlesCb: * @connection: the connection * @handle_type: the handle type that was passed to * tp_connection_hold_handles() * @n_handles: the number of handles that were passed to * tp_connection_hold_handles() on success, or 0 on failure * @handles: a copy of the array of @n_handles handles that was passed to * tp_connection_hold_handles() on success, or %NULL on failure * @error: %NULL on success, or an error on failure * @user_data: the same arbitrary pointer that was passed to * tp_connection_hold_handles() * @weak_object: the same object that was passed to * tp_connection_hold_handles() * * Signature of the callback called when tp_connection_hold_handles() succeeds * or fails. * * On success, the caller has a reference to each handle in @handles. * * Since telepathy-glib version 0.13.8, * the handles will remain valid until @connection becomes invalid * (signalled by #TpProxy::invalidated). In earlier versions, they could be * released with tp_connection_unref_handles(). * * For convenience, the handle type and handles requested by the caller are * passed through to this callback on success, so the caller does not have to * include them in @user_data. * * Deprecated: See tp_connection_hold_handles(). */ static void connection_held_handles (TpConnection *self, const GError *error, gpointer user_data, GObject *weak_object) { HoldHandlesContext *context = user_data; g_object_ref (self); if (error == NULL) { DEBUG ("%u handles of type %u", context->handles->len, context->handle_type); /* On the Telepathy side, we have held these handles (at least once). * That's all we need. */ context->callback (self, context->handle_type, context->handles->len, (const TpHandle *) context->handles->data, NULL, context->user_data, weak_object); } else { DEBUG ("%u handles of type %u failed: %s %u: %s", context->handles->len, context->handle_type, g_quark_to_string (error->domain), error->code, error->message); context->callback (self, context->handle_type, 0, NULL, error, context->user_data, weak_object); } g_object_unref (self); } /** * tp_connection_hold_handles: * @self: a connection * @timeout_ms: the timeout in milliseconds, or -1 to use the default * @handle_type: the handle type * @n_handles: the number of handles in @handles (must be at least 1) * @handles: (array length=n_handles): an array of handles * @callback: called on success or failure (unless @weak_object has become * unreferenced) * @user_data: arbitrary user-supplied data * @destroy: called to destroy @user_data after calling @callback, or when * @weak_object becomes unreferenced (whichever occurs sooner) * @weak_object: if not %NULL, an object to be weakly referenced: if it is * destroyed, @callback will not be called * * Hold (ensure a reference to) the given handles, if they are valid. * * If they are valid, the callback will later be called with the given * handles; if not all of them are valid, the callback will be called with * an error. * * This function, along with tp_connection_unref_handles(), * tp_connection_get_contact_attributes() and #TpContact, keeps a client-side * reference count of handles; you should not use the RequestHandles, * HoldHandles and GetContactAttributes D-Bus methods directly as well as these * functions. * * Deprecated: Holding handles is not needed with Connection Managers having * immortal handles (any Connection Manager using telepathy-glib >= 0.13.8). * Other Connection Managers are considered deprecated, clients wanting to * still support them should continue using this deprecated function. */ void tp_connection_hold_handles (TpConnection *self, gint timeout_ms, TpHandleType handle_type, guint n_handles, const TpHandle *handles, TpConnectionHoldHandlesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { HoldHandlesContext *context; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (handle_type > TP_HANDLE_TYPE_NONE); g_return_if_fail (handle_type < TP_NUM_HANDLE_TYPES); g_return_if_fail (n_handles >= 1); g_return_if_fail (callback != NULL); context = g_slice_new0 (HoldHandlesContext); context->handle_type = handle_type; context->user_data = user_data; context->destroy = destroy; context->handles = g_array_sized_new (FALSE, FALSE, sizeof (guint), n_handles); g_array_append_vals (context->handles, handles, n_handles); context->callback = callback; tp_cli_connection_call_hold_handles (self, timeout_ms, handle_type, context->handles, connection_held_handles, context, hold_handles_context_free, weak_object); } typedef struct { TpHandleType handle_type; guint n_ids; gchar **ids; gpointer user_data; GDestroyNotify destroy; TpConnectionRequestHandlesCb callback; } RequestHandlesContext; static void request_handles_context_free (gpointer p) { RequestHandlesContext *context = p; g_strfreev (context->ids); if (context->destroy != NULL) context->destroy (context->user_data); g_slice_free (RequestHandlesContext, context); } /** * TpConnectionRequestHandlesCb: * @connection: the connection * @handle_type: the handle type that was passed to * tp_connection_request_handles() * @n_handles: the number of IDs that were passed to * tp_connection_request_handles() on success, or 0 on failure * @handles: (element-type uint) (array length=n_handles): the @n_handles * handles corresponding to @ids, in the same order, or %NULL on failure * @ids: (element-type utf8) (array length=n_handles): a copy of the array of * @n_handles IDs that was passed to tp_connection_request_handles() on * success, or %NULL on failure * @error: %NULL on success, or an error on failure * @user_data: the same arbitrary pointer that was passed to * tp_connection_request_handles() * @weak_object: the same object that was passed to * tp_connection_request_handles() * * Signature of the callback called when tp_connection_request_handles() * succeeds or fails. * * On success, the caller has a reference to each handle in @handles. * * Since telepathy-glib version 0.13.8, * the handles will remain valid until @connection becomes invalid * (signalled by #TpProxy::invalidated). In earlier versions, they could be * released with tp_connection_unref_handles(). * * For convenience, the handle type and IDs requested by the caller are * passed through to this callback, so the caller does not have to include * them in @user_data. * * Deprecated: See tp_connection_request_handles(). */ static void connection_requested_handles (TpConnection *self, const GArray *handles, const GError *error, gpointer user_data, GObject *weak_object) { RequestHandlesContext *context = user_data; g_object_ref (self); if (error == NULL) { if (G_UNLIKELY (g_strv_length (context->ids) != handles->len)) { const gchar *cm = tp_proxy_get_bus_name ((TpProxy *) self); GError *e = g_error_new (TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Connection manager %s is broken: we asked for %u " "handles but RequestHandles returned %u", cm, g_strv_length (context->ids), handles->len); /* This CM is bad and wrong. We can't trust it to get anything * right. */ WARNING ("%s", e->message); context->callback (self, context->handle_type, 0, NULL, NULL, e, context->user_data, weak_object); g_error_free (e); return; } DEBUG ("%u handles of type %u", handles->len, context->handle_type); /* On the Telepathy side, we have held these handles (at least once). * That's all we need. */ context->callback (self, context->handle_type, handles->len, (const TpHandle *) handles->data, (const gchar * const *) context->ids, NULL, context->user_data, weak_object); } else { DEBUG ("%u handles of type %u failed: %s %u: %s", g_strv_length (context->ids), context->handle_type, g_quark_to_string (error->domain), error->code, error->message); context->callback (self, context->handle_type, 0, NULL, NULL, error, context->user_data, weak_object); } g_object_unref (self); } /** * tp_connection_request_handles: * @self: a connection * @timeout_ms: the timeout in milliseconds, or -1 to use the default * @handle_type: the handle type * @ids: (array zero-terminated=1): an array of string identifiers for which * handles are required, terminated by %NULL (must not be %NULL or empty) * @callback: called on success or failure (unless @weak_object has become * unreferenced) * @user_data: arbitrary user-supplied data * @destroy: called to destroy @user_data after calling @callback, or when * @weak_object becomes unreferenced (whichever occurs sooner) * @weak_object: if not %NULL, an object to be weakly referenced: if it is * destroyed, @callback will not be called * * Request the handles corresponding to the given identifiers, and if they * are valid, hold (ensure a reference to) the corresponding handles. * * If they are valid, the callback will later be called with the given * handles; if not all of them are valid, the callback will be called with * an error. * * Deprecated: If @handle_type is TP_HANDLE_TYPE_CONTACT, use * tp_connection_dup_contact_by_id_async() instead. For channel requests, * use tp_account_channel_request_set_target_id() instead. */ void tp_connection_request_handles (TpConnection *self, gint timeout_ms, TpHandleType handle_type, const gchar * const *ids, TpConnectionRequestHandlesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { RequestHandlesContext *context; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (handle_type > TP_HANDLE_TYPE_NONE); g_return_if_fail (handle_type < TP_NUM_HANDLE_TYPES); g_return_if_fail (ids != NULL); g_return_if_fail (ids[0] != NULL); g_return_if_fail (callback != NULL); context = g_slice_new0 (RequestHandlesContext); context->handle_type = handle_type; context->ids = g_strdupv ((GStrv) ids); context->user_data = user_data; context->destroy = destroy; context->callback = callback; tp_cli_connection_call_request_handles (self, timeout_ms, handle_type, (const gchar **) context->ids, connection_requested_handles, context, request_handles_context_free, weak_object); } /** * tp_connection_get_contact_attributes: * @self: a connection * @timeout_ms: the timeout in milliseconds, or -1 to use the default * @n_handles: the number of handles in @handles (must be at least 1) * @handles: (array length=n_handles): an array of handles * @interfaces: a #GStrv of interfaces * @hold: if %TRUE, the callback will hold one reference to each valid handle * @callback: (type GObject.Callback): called on success or * failure (unless @weak_object has become unreferenced) * @user_data: arbitrary user-supplied data * @destroy: called to destroy @user_data after calling @callback, or when * @weak_object becomes unreferenced (whichever occurs sooner) * @weak_object: if not %NULL, an object to be weakly referenced: if it is * destroyed, @callback will not be called * * Return (via a callback) any number of attributes of the given handles. * * Since telepathy-glib version 0.13.8, * the handles will remain valid until @connection becomes invalid * (signalled by #TpProxy::invalidated). In earlier versions, if @hold * was %TRUE, the callback would hold a reference to them which could be * released with tp_connection_unref_handles(). * * This is a thin wrapper around the GetContactAttributes D-Bus method, and * should be used in preference to * tp_cli_connection_interface_contacts_call_get_contact_attributes(); mixing this * function, tp_connection_hold_handles(), tp_connection_unref_handles(), and * #TpContact with direct use of the RequestHandles, HoldHandles and * GetContactAttributes D-Bus methods is unwise, as #TpConnection and * #TpContact perform client-side reference counting of handles. * The #TpContact API provides a higher-level abstraction which should * usually be used instead. * * @callback will later be called with the attributes of those of the given * handles that were valid. Invalid handles are simply omitted from the * parameter to the callback. * * If @hold is %TRUE, the @callback is given one reference to each handle * that appears as a key in the callback's @attributes parameter. * * Deprecated: Use tp_simple_client_factory_ensure_contact() instead. */ void tp_connection_get_contact_attributes (TpConnection *self, gint timeout_ms, guint n_handles, const TpHandle *handles, const gchar * const *interfaces, gboolean hold, tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { GArray *a; guint i; DEBUG ("%u handles", n_handles); for (i = 0; i < n_handles; i++) DEBUG ("- %u", handles[i]); g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (n_handles >= 1); g_return_if_fail (handles != NULL); g_return_if_fail (callback != NULL); a = g_array_sized_new (FALSE, FALSE, sizeof (guint), n_handles); g_array_append_vals (a, handles, n_handles); /* We ignore @hold, and always hold the handles anyway */ tp_cli_connection_interface_contacts_call_get_contact_attributes (self, -1, a, (const gchar **) interfaces, TRUE, callback, user_data, destroy, weak_object); g_array_unref (a); } /** * tp_connection_get_contact_list_attributes: * @self: a connection * @timeout_ms: the timeout in milliseconds (using a large timeout is * recommended) * @interfaces: a #GStrv of interfaces * @hold: if %TRUE, the callback will hold one reference to each handle it * receives * @callback: (type GObject.Callback): called on success or * failure (unless @weak_object has become unreferenced) * @user_data: arbitrary user-supplied data * @destroy: called to destroy @user_data after calling @callback, or when * @weak_object becomes unreferenced (whichever occurs sooner) * @weak_object: if not %NULL, an object to be weakly referenced: if it is * destroyed, @callback will not be called * * Return (via a callback) the contacts on the contact list and any number of * their attributes. * * Since telepathy-glib version 0.13.8, * the handles will remain valid until @connection becomes invalid * (signalled by #TpProxy::invalidated). In earlier versions, if @hold * was %TRUE, the callback would hold a reference to them which could be * released with tp_connection_unref_handles(). * * This is a thin wrapper around the RequestContactList D-Bus method, * and should be used in preference to lower-level functions; it is similar * to tp_connection_get_contact_attributes(). * * The #TpContact API provides a higher-level abstraction which should * usually be used instead. * * If @hold is %TRUE, the @callback is given a reference to each handle * that appears as a key in the callback's @attributes parameter. * * Deprecated: Use tp_connection_dup_contact_list() instead. */ void tp_connection_get_contact_list_attributes (TpConnection *self, gint timeout_ms, const gchar * const *interfaces, gboolean hold, tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (callback != NULL); /* We ignore @hold, and always hold the handles anyway */ tp_cli_connection_interface_contact_list_call_get_contact_list_attributes ( self, -1, (const gchar **) interfaces, TRUE, callback, user_data, destroy, weak_object); } telepathy-glib-0.24.2/telepathy-glib/account-internal.h0000644000175000017500000000247612652510705017777 00000000000000/**/ /* * TpAccount - proxy for a Telepathy account (internals) * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_ACCOUNT_INTERNAL_H #define TP_ACCOUNT_INTERNAL_H #include G_BEGIN_DECLS const GQuark * _tp_account_get_requested_features (TpAccount *account); const GQuark * _tp_account_get_actual_features (TpAccount *account); const GQuark * _tp_account_get_missing_features (TpAccount *account); void _tp_account_refresh_properties (TpAccount *account); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-dispatch-operation.c0000644000175000017500000015667412652510705021741 00000000000000/* * channel-dispatch-operation.c - proxy for incoming channels seeking approval * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-dispatch-operation.h" #include "telepathy-glib/channel-dispatch-operation-internal.h" #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_DISPATCHER #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/_gen/tp-cli-channel-dispatch-operation-body.h" /** * SECTION:channel-dispatch-operation * @title: TpChannelDispatchOperation * @short_description: proxy object for a to the Telepathy channel * dispatcher * @see_also: #TpChannelDispatcher * * One of the channel dispatcher's functions is to offer incoming channels to * Approver clients for approval. Approvers respond to the channel dispatcher * via a #TpChannelDispatchOperation object. */ /** * TpChannelDispatchOperation: * * One of the channel dispatcher's functions is to offer incoming channels to * Approver clients for approval. An approver should generally ask the user * whether they want to participate in the requested communication channels * (join the chat or chatroom, answer the call, accept the file transfer, or * whatever is appropriate). A collection of channels offered in this way * is represented by a ChannelDispatchOperation object. * * If the user wishes to accept the communication channels, the approver * should call tp_cli_channel_dispatch_operation_call_handle_with() to * indicate the user's or approver's preferred handler for the channels (the * empty string indicates no particular preference, and will cause any * suitable handler to be used). * * If the user wishes to reject the communication channels, or if the user * accepts the channels and the approver will handle them itself, the approver * should call tp_cli_channel_dispatch_operation_call_claim(). If this method * succeeds, the approver immediately has control over the channels as their * primary handler, and may do anything with them (in particular, it may close * them in whatever way seems most appropriate). * * There are various situations in which the channel dispatch operation will * be closed, causing the #TpProxy::invalidated signal to be emitted. If this * happens, the approver should stop prompting the user. * * Because all approvers are launched simultaneously, the user might respond * to another approver; if this happens, the #TpProxy::invalidated signal * will be emitted with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_OBJECT_REMOVED. * * If a channel closes, the #TpChannelDispatchOperation::channel-lost signal * is emitted. If all channels * close, there is nothing more to dispatch, so the #TpProxy::invalidated * signal will be emitted with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_OBJECT_REMOVED. * * If the channel dispatcher crashes or exits, the #TpProxy::invalidated * signal will be emitted with the domain %TP_DBUS_ERRORS and the error code * %TP_DBUS_ERROR_NAME_OWNER_LOST. In a high-quality implementation, the * dispatcher should be restarted, at which point it will create new * channel dispatch operations for any undispatched channels, and the approver * will be notified again. * * Creating a #TpChannelDispatchOperation directly is deprecated: it * should only be created via a #TpBaseClient. * * Since 0.16, #TpChannelDispatchOperation always has a non-%NULL * #TpProxy:factory, which will be propagated to the #TpAccount, * #TpConnection and #TpChannel. * * Since: 0.7.32 */ /** * TpChannelDispatchOperationClass: * * The class of a #TpChannelDispatchOperation. */ struct _TpChannelDispatchOperationPrivate { TpConnection *connection; TpAccount *account; GPtrArray *channels; GStrv possible_handlers; GHashTable *immutable_properties; }; enum { PROP_CONNECTION = 1, PROP_ACCOUNT, PROP_CHANNELS, PROP_POSSIBLE_HANDLERS, PROP_CDO_PROPERTIES, N_PROPS }; enum { SIGNAL_CHANNEL_LOST, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; G_DEFINE_TYPE (TpChannelDispatchOperation, tp_channel_dispatch_operation, TP_TYPE_PROXY) static void tp_channel_dispatch_operation_init (TpChannelDispatchOperation *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CHANNEL_DISPATCH_OPERATION, TpChannelDispatchOperationPrivate); self->priv->immutable_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); } static void tp_channel_dispatch_operation_finished_cb (TpChannelDispatchOperation *self, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED, "ChannelDispatchOperation finished and was removed" }; tp_proxy_invalidate ((TpProxy *) self, &e); } static void tp_channel_dispatch_operation_channel_lost_cb (TpChannelDispatchOperation *self, const gchar *path, const gchar *dbus_error, const gchar *message, gpointer unused G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { guint i; if (self->priv->channels == NULL) /* We didn't fetch channels yet */ return; for (i = 0; i < self->priv->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->priv->channels, i); if (!tp_strdiff (tp_proxy_get_object_path (channel), path)) { GError *error = NULL; /* Removing the channel from the array will unref it, add an extra * ref as we'll need it to fire the signal */ g_object_ref (channel); g_ptr_array_remove (self->priv->channels, channel); tp_proxy_dbus_error_to_gerror (self, dbus_error, message, &error); g_signal_emit (self, signals[SIGNAL_CHANNEL_LOST], 0, channel, error->domain, error->code, error->message); g_object_notify ((GObject *) self, "channels"); g_object_unref (channel); g_error_free (error); return; } } DEBUG ("Don't know this channel: %s", path); } static void tp_channel_dispatch_operation_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpChannelDispatchOperation *self = TP_CHANNEL_DISPATCH_OPERATION (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; case PROP_ACCOUNT: g_value_set_object (value, self->priv->account); break; case PROP_CHANNELS: g_value_set_boxed (value, self->priv->channels); break; case PROP_POSSIBLE_HANDLERS: g_value_set_boxed (value, self->priv->possible_handlers); break; case PROP_CDO_PROPERTIES: g_value_set_boxed (value, self->priv->immutable_properties); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void maybe_set_connection (TpChannelDispatchOperation *self, const gchar *path) { GError *error = NULL; if (self->priv->connection != NULL) return; if (path == NULL) return; self->priv->connection = tp_simple_client_factory_ensure_connection ( tp_proxy_get_factory (self), path, NULL, &error); if (self->priv->connection == NULL) { DEBUG ("Failed to create connection %s: %s", path, error->message); g_error_free (error); return; } g_object_notify ((GObject *) self, "connection"); if (g_hash_table_lookup (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION) != NULL) return; g_hash_table_insert (self->priv->immutable_properties, g_strdup (TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION), tp_g_value_slice_new_boxed (DBUS_TYPE_G_OBJECT_PATH, path)); } static void maybe_set_account (TpChannelDispatchOperation *self, const gchar *path) { GError *error = NULL; if (self->priv->account != NULL) return; if (path == NULL) return; self->priv->account = tp_simple_client_factory_ensure_account ( tp_proxy_get_factory (self), path, NULL, &error); if (self->priv->account == NULL) { DEBUG ("Failed to create account %s: %s", path, error->message); g_error_free (error); return; } g_object_notify ((GObject *) self, "account"); if (g_hash_table_lookup (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT) != NULL) return; g_hash_table_insert (self->priv->immutable_properties, g_strdup (TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT), tp_g_value_slice_new_boxed (DBUS_TYPE_G_OBJECT_PATH, path)); } static void maybe_set_possible_handlers (TpChannelDispatchOperation *self, GStrv handlers) { if (self->priv->possible_handlers != NULL) return; if (handlers == NULL) return; self->priv->possible_handlers = g_strdupv (handlers); g_object_notify ((GObject *) self, "possible-handlers"); if (g_hash_table_lookup (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS) != NULL) return; g_hash_table_insert (self->priv->immutable_properties, g_strdup (TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS), tp_g_value_slice_new_boxed (G_TYPE_STRV, handlers)); } static void maybe_set_interfaces (TpChannelDispatchOperation *self, const gchar **interfaces) { if (interfaces == NULL) return; tp_proxy_add_interfaces ((TpProxy *) self, interfaces); g_hash_table_insert (self->priv->immutable_properties, g_strdup (TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES), tp_g_value_slice_new_boxed (G_TYPE_STRV, interfaces)); } static void tp_channel_dispatch_operation_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpChannelDispatchOperation *self = TP_CHANNEL_DISPATCH_OPERATION (object); switch (property_id) { case PROP_ACCOUNT: g_assert (self->priv->account == NULL); /* construct-only */ self->priv->account = g_value_dup_object (value); break; case PROP_CONNECTION: g_assert (self->priv->connection == NULL); /* construct-only */ self->priv->connection = g_value_dup_object (value); break; case PROP_CHANNELS: g_assert (self->priv->channels == NULL); /* construct-only */ _tp_channel_dispatch_operation_ensure_channels (self, g_value_get_boxed (value)); break; case PROP_CDO_PROPERTIES: { GHashTable *asv = g_value_get_boxed (value); if (asv == NULL) return; tp_g_hash_table_update (self->priv->immutable_properties, asv, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_channel_dispatch_operation_constructed (GObject *object) { TpChannelDispatchOperation *self = TP_CHANNEL_DISPATCH_OPERATION (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_channel_dispatch_operation_parent_class)->constructed; GError *error = NULL; TpProxySignalConnection *sc; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); _tp_proxy_ensure_factory (self, NULL); maybe_set_connection (self, tp_asv_get_boxed (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION, DBUS_TYPE_G_OBJECT_PATH)); maybe_set_account (self, tp_asv_get_boxed (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT, DBUS_TYPE_G_OBJECT_PATH)); maybe_set_possible_handlers (self, tp_asv_get_boxed (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_POSSIBLE_HANDLERS, G_TYPE_STRV)); maybe_set_interfaces (self, tp_asv_get_boxed (self->priv->immutable_properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_INTERFACES, G_TYPE_STRV)); sc = tp_cli_channel_dispatch_operation_connect_to_finished (self, tp_channel_dispatch_operation_finished_cb, NULL, NULL, NULL, &error); if (sc == NULL) { CRITICAL ("Couldn't connect to Finished: %s", error->message); g_error_free (error); g_assert_not_reached (); return; } sc = tp_cli_channel_dispatch_operation_connect_to_channel_lost (self, tp_channel_dispatch_operation_channel_lost_cb, NULL, NULL, NULL, &error); if (sc == NULL) { g_critical ("Couldn't connect to ChannelLost: %s", error->message); g_error_free (error); g_assert_not_reached (); return; } } static void tp_channel_dispatch_operation_dispose (GObject *object) { TpChannelDispatchOperation *self = TP_CHANNEL_DISPATCH_OPERATION (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_channel_dispatch_operation_parent_class)->dispose; if (self->priv->connection != NULL) { g_object_unref (self->priv->connection); self->priv->connection = NULL; } if (self->priv->account != NULL) { g_object_unref (self->priv->account); self->priv->account = NULL; } if (self->priv->channels != NULL) { /* channels array has 'g_object_unref' has free_func */ g_ptr_array_unref (self->priv->channels); self->priv->channels = NULL; } g_strfreev (self->priv->possible_handlers); self->priv->possible_handlers = NULL; if (self->priv->immutable_properties != NULL) { g_hash_table_unref (self->priv->immutable_properties); self->priv->immutable_properties = NULL; } if (dispose != NULL) dispose (object); } static TpChannel * look_for_channel_having_path (GPtrArray *array, const gchar *path) { guint i; for (i = 0; i < array->len; i++) { TpChannel *channel = g_ptr_array_index (array, i); if (!tp_strdiff (tp_proxy_get_object_path (channel), path)) return channel; } return NULL; } static void update_channels_array (TpChannelDispatchOperation *self, GPtrArray *channels) { guint i; GPtrArray *old = NULL; if (self->priv->channels != NULL) { /* We received an initial list of channels during creation. Remove those * which are not in the Channels property any more. */ old = self->priv->channels; } self->priv->channels = g_ptr_array_new_full (channels->len, g_object_unref); for (i = 0; i < channels->len; i++) { const gchar *path; GHashTable *chan_props; TpChannel *channel = NULL; GError *err = NULL; tp_value_array_unpack (g_ptr_array_index (channels, i), 2, &path, &chan_props); if (old != NULL) channel = look_for_channel_having_path (old, path); if (channel != NULL) { g_object_ref (channel); } else { channel = tp_simple_client_factory_ensure_channel ( tp_proxy_get_factory (self), self->priv->connection, path, chan_props, &err); if (channel == NULL) { DEBUG ("Failed to create channel %s: %s", path, err->message); g_error_free (err); continue; } } g_ptr_array_add (self->priv->channels, channel); } if (old != NULL) { g_ptr_array_unref (old); } } static void get_dispatch_operation_prop_cb (TpProxy *proxy, GHashTable *props, const GError *error, gpointer user_data, GObject *weak_object) { TpChannelDispatchOperation *self = (TpChannelDispatchOperation *) proxy; GSimpleAsyncResult *result = user_data; gboolean prepared = TRUE; GPtrArray *channels; GError *e = NULL; if (error != NULL) { DEBUG ("Failed to fetch ChannelDispatchOperation properties: %s", error->message); prepared = FALSE; e = g_error_copy (error); goto out; } /* Connection */ maybe_set_connection (self, tp_asv_get_boxed (props, "Connection", DBUS_TYPE_G_OBJECT_PATH)); if (self->priv->connection == NULL) { e = g_error_new_literal (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Mandatory 'Connection' property is missing"); DEBUG ("%s", e->message); prepared = FALSE; goto out; } /* Account */ maybe_set_account (self, tp_asv_get_boxed (props, "Account", DBUS_TYPE_G_OBJECT_PATH)); if (self->priv->account == NULL) { e = g_error_new_literal (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Mandatory 'Account' property is missing"); DEBUG ("%s", e->message); prepared = FALSE; goto out; } /* PossibleHandlers */ maybe_set_possible_handlers (self, tp_asv_get_boxed (props, "PossibleHandlers", G_TYPE_STRV)); if (self->priv->possible_handlers == NULL) { e = g_error_new_literal (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Mandatory 'PossibleHandlers' property is missing"); DEBUG ("%s", e->message); prepared = FALSE; goto out; } maybe_set_interfaces (self, tp_asv_get_boxed (props, "Interfaces", G_TYPE_STRV)); /* set channels (not an immutable property) */ channels = tp_asv_get_boxed (props, "Channels", TP_ARRAY_TYPE_CHANNEL_DETAILS_LIST); if (channels == NULL) { e = g_error_new_literal (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Mandatory 'Channels' property is missing"); DEBUG ("%s", e->message); prepared = FALSE; goto out; } update_channels_array (self, channels); g_object_notify ((GObject *) self, "channels"); g_object_notify ((GObject *) self, "cdo-properties"); out: if (e != NULL) g_simple_async_result_set_from_error (result, e); g_simple_async_result_complete_in_idle (result); if (!prepared) { tp_proxy_invalidate ((TpProxy *) self, e); g_error_free (e); } } static void prepare_core_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpChannelDispatchOperation *self = (TpChannelDispatchOperation *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, prepare_core_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CHANNEL_DISPATCH_OPERATION, get_dispatch_operation_prop_cb, result, g_object_unref, NULL); } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_channel_dispatch_operation_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE; features[FEAT_CORE].core = TRUE; features[FEAT_CORE].prepare_async = prepare_core_async; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_channel_dispatch_operation_class_init (TpChannelDispatchOperationClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (TpChannelDispatchOperationPrivate)); object_class->get_property = tp_channel_dispatch_operation_get_property; object_class->set_property = tp_channel_dispatch_operation_set_property; object_class->constructed = tp_channel_dispatch_operation_constructed; object_class->dispose = tp_channel_dispatch_operation_dispose; /** * TpChannelDispatchOperation:connection: * * The #TpConnection with which the channels are associated. * * Read-only except during construction. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("connection", "TpConnection", "The TpConnection of this channel dispatch operation", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpChannelDispatchOperation:account: * * The #TpAccount with which the connection and channels are associated. * * Read-only except during construction. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("account", "TpAccount", "The TpAccount of this channel dispatch operation", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpChannelDispatchOperation:channels: * * A #GPtrArray containing the #TpChannel to be dispatched. * * Read-only. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("channels", "GPtrArray of TpChannel", "The TpChannel to be dispatched", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNELS, param_spec); /** * TpChannelDispatchOperation:possible-handlers: * * A #GStrv containing the well known bus names (starting * with TP_CLIENT_BUS_NAME_BASE) of the possible Handlers for * the channels * * Read-only except during construction. * * This is not guaranteed to be set until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("possible-handlers", "Possible handlers", "Possible handlers for the channels", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_POSSIBLE_HANDLERS, param_spec); /** * TpChannelDispatchOperation:cdo-properties: * * The immutable D-Bus properties of this ChannelDispatchOperation, * represented by a #GHashTable where the keys are D-Bus * interface name + "." + property name, and the values are #GValue instances. * * Read-only except during construction. If this is not provided * during construction, it is not guaranteed to be set until * tp_proxy_prepare_async() has finished preparing * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("cdo-properties", "Immutable D-Bus properties", "A map D-Bus interface + \".\" + property name => GValue", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CDO_PROPERTIES, param_spec); /** * TpChannelDispatchOperation::channel-lost: * @self: a #TpChannelDispatchOperation * @channel: the #TpChannel that closed * @domain: domain of a #GError indicating why the channel has been closed * @code: error code of a #GError indicating why the channel has been closed * @message: a message associated with the error * * Emitted when a channel has closed before it could be claimed or handled. * * Since: 0.11.5 */ signals[SIGNAL_CHANNEL_LOST] = g_signal_new ( "channel-lost", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 4, TP_TYPE_CHANNEL, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); proxy_class->interface = TP_IFACE_QUARK_CHANNEL_DISPATCH_OPERATION; proxy_class->must_have_unique_name = TRUE; proxy_class->list_features = tp_channel_dispatch_operation_list_features; tp_channel_dispatch_operation_init_known_interfaces (); } /** * tp_channel_dispatch_operation_init_known_interfaces: * * Ensure that the known interfaces for TpChannelDispatchOperation have been * set up. This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CHANNEL_DISPATCH_OPERATION. * * Since: 0.7.32 */ void tp_channel_dispatch_operation_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CHANNEL_DISPATCH_OPERATION; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_channel_dispatch_operation_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * tp_channel_dispatch_operation_new: * @bus_daemon: Proxy for the D-Bus daemon * @object_path: The non-NULL object path of this channel dispatch operation * @immutable_properties: As many as are known of the immutable D-Bus * properties of this channel dispatch operation, or %NULL if none are known * @error: Used to raise an error if %NULL is returned * * Convenience function to create a new channel dispatch operation proxy. * * The @immutable_properties argument is not yet used. * * Returns: a new reference to an channel dispatch operation proxy, or %NULL if * @object_path is not syntactically valid or the channel dispatcher is not * running * Deprecated: Since 0.19.9. New code should get * #TpChannelDispatchOperation objects from a #TpBaseClient */ TpChannelDispatchOperation * tp_channel_dispatch_operation_new (TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) { return _tp_channel_dispatch_operation_new_with_factory (NULL, bus_daemon, object_path, immutable_properties, error); } TpChannelDispatchOperation * _tp_channel_dispatch_operation_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) { TpChannelDispatchOperation *self; gchar *unique_name; g_return_val_if_fail (bus_daemon != NULL, NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; if (!_tp_dbus_daemon_get_name_owner (bus_daemon, -1, TP_CHANNEL_DISPATCHER_BUS_NAME, &unique_name, error)) return NULL; self = TP_CHANNEL_DISPATCH_OPERATION (g_object_new ( TP_TYPE_CHANNEL_DISPATCH_OPERATION, "dbus-daemon", bus_daemon, "bus-name", unique_name, "object-path", object_path, "cdo-properties", immutable_properties, "factory", factory, NULL)); g_free (unique_name); return self; } /** * TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpChannelDispatchOperation. * * When this feature is prepared, the basic properties of the * ChannelDispatchOperation have been retrieved and are available for use. * * Specifically, this implies that: * * - #TpChannelDispatchOperation:connection is set (but * TP_CONNECTION_FEATURE_CORE is not necessarily prepared) * - #TpChannelDispatchOperation:account is set (but * TP_ACCOUNT_FEATURE_CORE is not necessarily prepared) * - #TpChannelDispatchOperation:channels is set (but * TP_CHANNEL_FEATURE_CORE is not necessarily prepared) * - #TpChannelDispatchOperation:possible-handlers is set * - any extra interfaces will have been set up in TpProxy (i.e. * #TpProxy:interfaces contains at least all extra ChannelDispatchOperation * interfaces) * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.5 */ GQuark tp_channel_dispatch_operation_get_feature_quark_core (void) { return g_quark_from_static_string ( "tp-channel-dispatch-operation-feature-core"); } /** * tp_channel_dispatch_operation_borrow_connection: (skip) * @self: a #TpChannelDispatchOperation * * Returns the #TpConnection of this ChannelDispatchOperation. * The returned pointer is only valid while @self is valid - reference * it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannelDispatchOperation:connection * * Since: 0.11.5 * Deprecated: Since 0.19.9. New code should use * tp_channel_dispatch_operation_get_connection() instead. */ TpConnection * tp_channel_dispatch_operation_borrow_connection ( TpChannelDispatchOperation *self) { return self->priv->connection; } /** * tp_channel_dispatch_operation_borrow_account: (skip) * @self: a #TpChannelDispatchOperation * * Returns the #TpAccount of this ChannelDispatchOperation. * The returned pointer is only valid while @self is valid - reference * it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannelDispatchOperation:account * * Since: 0.11.5 * Deprecated: Since 0.19.9. New code should use * tp_channel_dispatch_operation_get_account() instead. */ TpAccount * tp_channel_dispatch_operation_borrow_account ( TpChannelDispatchOperation *self) { return self->priv->account; } /** * tp_channel_dispatch_operation_borrow_channels: (skip) * @self: a #TpChannelDispatchOperation * * Returns a #GPtrArray containing the #TpChannel of this * ChannelDispatchOperation. * The returned array and its #TpChannel are only valid while @self is * valid - copy array and reference channels with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannelDispatchOperation:channels * * Since: 0.11.5 * Deprecated: Since 0.19.9. New code should use * tp_channel_dispatch_operation_get_channels() instead. */ GPtrArray * tp_channel_dispatch_operation_borrow_channels ( TpChannelDispatchOperation *self) { return self->priv->channels; } /** * tp_channel_dispatch_operation_borrow_possible_handlers: (skip) * @self: a #TpChannelDispatchOperation * * Returns a #GStrv containing the possible handlers of this * ChannelDispatchOperation. * The returned array and its strings are only valid while @self is * valid - copy it with g_strdupv if needed. * * Returns: (transfer none): the value of * #TpChannelDispatchOperation:possible-handlers * * Since: 0.11.5 * Deprecated: Since 0.19.9. New code should use * tp_channel_dispatch_operation_get_possible_handlers() instead. */ GStrv tp_channel_dispatch_operation_borrow_possible_handlers ( TpChannelDispatchOperation *self) { return self->priv->possible_handlers; } /** * tp_channel_dispatch_operation_borrow_immutable_properties: (skip) * @self: a #TpChannelDispatchOperation * * Returns the immutable D-Bus properties of this channel. * The returned hash table is only valid while @self is valid - reference * it with g_hash_table_ref() if needed. * * Returns: (transfer none) (element-type utf8 GObject.Value): the value of * #TpChannelDispatchOperation:cdo-properties * * Since: 0.11.5 * Deprecated: Since 0.19.9. New code should use individual property * getters like tp_channel_dispatch_operation_get_connection(), * tp_channel_dispatch_operation_get_account(), * tp_channel_dispatch_operation_get_channels(), or * tp_channel_dispatch_operation_get_possible_handlers() instead. */ GHashTable * tp_channel_dispatch_operation_borrow_immutable_properties ( TpChannelDispatchOperation *self) { return self->priv->immutable_properties; } /** * tp_channel_dispatch_operation_get_connection: (skip) * @self: a #TpChannelDispatchOperation * * Returns the #TpConnection of this ChannelDispatchOperation. * The returned pointer is only valid while @self is valid - reference * it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannelDispatchOperation:connection * * Since: 0.19.9 */ TpConnection * tp_channel_dispatch_operation_get_connection ( TpChannelDispatchOperation *self) { return self->priv->connection; } /** * tp_channel_dispatch_operation_get_account: (skip) * @self: a #TpChannelDispatchOperation * * Returns the #TpAccount of this ChannelDispatchOperation. * The returned pointer is only valid while @self is valid - reference * it with g_object_ref() if needed. * * Returns: (transfer none): the value of #TpChannelDispatchOperation:account * * Since: 0.19.9 */ TpAccount * tp_channel_dispatch_operation_get_account ( TpChannelDispatchOperation *self) { return self->priv->account; } /** * tp_channel_dispatch_operation_get_channels: * @self: a #TpChannelDispatchOperation * * Returns a #GPtrArray containing the #TpChannel of this * ChannelDispatchOperation. * The returned array and its #TpChannel are only valid while @self is * valid - copy array and reference channels with g_object_ref() if needed. * * Returns: (transfer none) (element-type TelepathyGLib.Channel): the value * of #TpChannelDispatchOperation:channels * * Since: 0.19.9 */ GPtrArray * tp_channel_dispatch_operation_get_channels ( TpChannelDispatchOperation *self) { return self->priv->channels; } /** * tp_channel_dispatch_operation_get_possible_handlers: (skip) * @self: a #TpChannelDispatchOperation * * Returns a #GStrv containing the possible handlers of this * ChannelDispatchOperation. * The returned array and its strings are only valid while @self is * valid - copy it with g_strdupv if needed. * * Returns: (transfer none): the value of * #TpChannelDispatchOperation:possible-handlers * * Since: 0.19.9 */ GStrv tp_channel_dispatch_operation_get_possible_handlers ( TpChannelDispatchOperation *self) { return self->priv->possible_handlers; } static void handle_with_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("HandleWith failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_handle_with_async: * @self: a #TpChannelDispatchOperation * @handler: (allow-none): The well-known bus name (starting with * #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the * channel, or %NULL if the client has no preferred channel handler * @callback: a callback to call when the call returns * @user_data: data to pass to @callback * * Called by an approver to accept a channel bundle and request that the * given handler be used to handle it. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted with the TP_DBUS_ERROR_OBJECT_REMOVED error code. * * However, this method may fail because the dispatch has already been * completed and the object has already gone. If this occurs, it indicates * that another approver has asked for the bundle to be handled by a * particular handler. The approver MUST NOT attempt to interact with * the channels further in this case, unless it is separately * invoked as the handler. * * Approvers which are also channel handlers SHOULD use * tp_channel_dispatch_operation_claim_async() instead * of tp_channel_dispatch_operation_handle_with_async() to request * that they can handle a channel bundle themselves. * * Since: 0.11.5 */ void tp_channel_dispatch_operation_handle_with_async ( TpChannelDispatchOperation *self, const gchar *handler, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_handle_with_async); tp_cli_channel_dispatch_operation_call_handle_with (self, -1, handler != NULL ? handler: "", handle_with_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_handle_with_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async call to HandleWith(). * * Returns: %TRUE if the HandleWith() call was successful, otherwise %FALSE * * Since: 0.11.5 */ gboolean tp_channel_dispatch_operation_handle_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_dispatch_operation_handle_with_async); } static void claim_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Claim failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_claim_async: * @self: a #TpChannelDispatchOperation * @callback: a callback to call when the call returns * @user_data: data to pass to @callback * * Called by an approver to claim channels for handling internally. * If this method is called successfully, the process calling this * method becomes the handler for the channel. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted, in the same way as for * tp_channel_dispatch_operation_handle_with_async(). * * This method may fail because the dispatch operation has already * been completed. Again, see tp_channel_dispatch_operation_handle_with_async() * for more details. The approver MUST NOT attempt to interact with * the channels further in this case. * * Since: 0.11.5 * Deprecated: since 0.15.0. Use * tp_channel_dispatch_operation_claim_with_async() */ void tp_channel_dispatch_operation_claim_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_claim_async); tp_cli_channel_dispatch_operation_call_claim (self, -1, claim_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_claim_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async call to Claim(). * * Returns: %TRUE if the Claim() call was successful, otherwise %FALSE * * Since: 0.11.5 * Deprecated: since 0.15.0. Use * tp_channel_dispatch_operation_claim_with_finish() */ gboolean tp_channel_dispatch_operation_claim_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_dispatch_operation_claim_async); } /* FIXME: This is temporary solution to share TpChannel objects until * TpSimpleClientFactory can be used for that */ void _tp_channel_dispatch_operation_ensure_channels (TpChannelDispatchOperation *self, GPtrArray *channels) { guint i; if (self->priv->channels != NULL || channels == NULL) return; /* Do not just ref the GPtrArray because we'll modify its content */ self->priv->channels = g_ptr_array_new_full (channels->len, g_object_unref); for (i = 0; i < channels->len; i++) g_ptr_array_add (self->priv->channels, g_object_ref (g_ptr_array_index (channels, i))); } /** * tp_channel_dispatch_operation_handle_with_time_async: * @self: a #TpChannelDispatchOperation * @handler: (allow-none): The well-known bus name (starting with * #TP_CLIENT_BUS_NAME_BASE) of the channel handler that should handle the * channel, or %NULL if the client has no preferred channel handler * @user_action_time: the time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME * @callback: a callback to call when the call returns * @user_data: data to pass to @callback * * A variant of tp_channel_dispatch_operation_handle_with_async() * allowing the approver to pass an user action time. * This timestamp will be passed to the Handler when HandleChannels is called. * * If an X server timestamp for the user action causing this method call is * available, @user_action_time should be this timestamp (for instance, the * result of gdk_event_get_time() if it is not %GDK_CURRENT_TIME). Otherwise, it * may be %TP_USER_ACTION_TIME_NOT_USER_ACTION to behave as if there was no * user action or it happened a long time ago, or * %TP_USER_ACTION_TIME_CURRENT_TIME to have the Handler behave as though the * user action had just happened (resembling, but not numerically equal to, * %GDK_CURRENT_TIME). * * This method has been introduced in telepathy-mission-control 5.5.0. * * Since: 0.11.7 */ void tp_channel_dispatch_operation_handle_with_time_async ( TpChannelDispatchOperation *self, const gchar *handler, gint64 user_action_time, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_handle_with_time_async); tp_cli_channel_dispatch_operation_call_handle_with_time (self, -1, handler != NULL ? handler: "", user_action_time, handle_with_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_handle_with_time_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async call to HandleWithTime(). * * Returns: %TRUE if the HandleWithTime() call was successful, otherwise %FALSE * * Since: 0.11.7 */ gboolean tp_channel_dispatch_operation_handle_with_time_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_channel_dispatch_operation_handle_with_time_async); } static void claim_with_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; TpBaseClient *client; client = g_simple_async_result_get_op_res_gpointer (result); _tp_base_client_now_handling_channels (client, self->priv->channels); g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_claim_with_async: * @self: a #TpChannelDispatchOperation * @client: the #TpBaseClient claiming @self * @callback: a callback to call when the call returns * @user_data: data to pass to @callback * * Called by an approver to claim channels for handling internally. * If this method is called successfully, the process calling this * method becomes the handler for the channel. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted, in the same way as for * tp_channel_dispatch_operation_handle_with_async(). * * This method may fail because the dispatch operation has already * been completed. Again, see tp_channel_dispatch_operation_handle_with_async() * for more details. The approver MUST NOT attempt to interact with * the channels further in this case. * * This is an improved version of tp_channel_dispatch_operation_claim_async() * as it tells @client about the new channels being handled. * * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before * calling this function. * * Since: 0.15.0 */ void tp_channel_dispatch_operation_claim_with_async ( TpChannelDispatchOperation *self, TpBaseClient *client, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); g_return_if_fail (tp_proxy_is_prepared (self, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_claim_with_async); g_simple_async_result_set_op_res_gpointer (result, g_object_ref (client), g_object_unref); tp_cli_channel_dispatch_operation_call_claim (self, -1, claim_with_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_claim_with_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async call to Claim() initiated using * tp_channel_dispatch_operation_claim_with_async(). * * Returns: %TRUE if the Claim() call was successful, otherwise %FALSE * * Since: 0.15.0 */ gboolean tp_channel_dispatch_operation_claim_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, \ tp_channel_dispatch_operation_claim_with_async) } static void channel_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GError *error = NULL; if (!tp_channel_close_finish (TP_CHANNEL (source), result, &error)) { DEBUG ("Failed to close %s: %s", tp_proxy_get_object_path (source), error->message); g_error_free (error); } } static void claim_close_channels_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; guint i; for (i = 0; i < self->priv->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->priv->channels, i); tp_channel_close_async (channel, channel_close_cb, NULL); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_close_channels_async: * @self: a #TpChannelDispatchOperation * @callback: a callback to call when the request has been satisfied * @user_data: data to pass to @callback * * Called by an approver to claim channels and close them all right away. * If this method is called successfully, @self has been claimed and * tp_channel_close_async() has been called on all of its channels. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted, in the same way as for * tp_channel_dispatch_operation_handle_with_async(). * * This method may fail because the dispatch operation has already * been completed. Again, see tp_channel_dispatch_operation_handle_with_async() * for more details. * * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before * calling this function. * * Since: 0.15.1 */ void tp_channel_dispatch_operation_close_channels_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); g_return_if_fail (tp_proxy_is_prepared (self, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_close_channels_async); tp_cli_channel_dispatch_operation_call_claim (self, -1, claim_close_channels_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_close_channels_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async operation initiated using * tp_channel_dispatch_operation_close_channels_async(). * * Returns: %TRUE if the Claim() call was successful and * Close() has at least been attempted on all the channels, otherwise %FALSE * * Since: 0.15.1 */ gboolean tp_channel_dispatch_operation_close_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, \ tp_channel_dispatch_operation_close_channels_async) } typedef struct { TpChannelGroupChangeReason reason; gchar *message; } LeaveChannelsCtx; static LeaveChannelsCtx * leave_channels_ctx_new (TpChannelGroupChangeReason reason, const gchar *message) { LeaveChannelsCtx *ctx = g_slice_new (LeaveChannelsCtx); ctx->reason = reason; ctx->message = g_strdup (message); return ctx; } static void leave_channels_ctx_free (LeaveChannelsCtx *ctx) { g_free (ctx->message); g_slice_free (LeaveChannelsCtx, ctx); } static void channel_leave_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GError *error = NULL; if (!tp_channel_leave_finish (TP_CHANNEL (source), result, &error)) { DEBUG ("Failed to leave %s: %s", tp_proxy_get_object_path (source), error->message); g_error_free (error); } } static void claim_leave_channels_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; guint i; LeaveChannelsCtx *ctx; ctx = g_simple_async_result_get_op_res_gpointer (result); for (i = 0; i < self->priv->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->priv->channels, i); tp_channel_leave_async (channel, ctx->reason, ctx->message, channel_leave_cb, NULL); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_leave_channels_async: * @self: a #TpChannelDispatchOperation * @reason: the leave reason * @message: the leave message * @callback: a callback to call when the request has been satisfied * @user_data: data to pass to @callback * * Called by an approver to claim channels and leave them all right away. * If this method is called successfully, @self has been claimed and * tp_channel_leave_async() has been called on all of its channels. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted, in the same way as for * tp_channel_dispatch_operation_handle_with_async(). * * This method may fail because the dispatch operation has already * been completed. Again, see tp_channel_dispatch_operation_handle_with_async() * for more details. * * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before * calling this function. * * Since: 0.15.2 */ void tp_channel_dispatch_operation_leave_channels_async ( TpChannelDispatchOperation *self, TpChannelGroupChangeReason reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); g_return_if_fail (tp_proxy_is_prepared (self, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_leave_channels_async); g_simple_async_result_set_op_res_gpointer (result, leave_channels_ctx_new (reason, message), (GDestroyNotify) leave_channels_ctx_free); tp_cli_channel_dispatch_operation_call_claim (self, -1, claim_leave_channels_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_leave_channels_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async operation initiated using * tp_channel_dispatch_operation_leave_channels_async(). * * Returns: %TRUE if the Claim() call was successful and * tp_channel_leave_async() has at least been attempted on all the * channels, otherwise %FALSE * * Since: 0.15.2 */ gboolean tp_channel_dispatch_operation_leave_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, \ tp_channel_dispatch_operation_leave_channels_async) } static void channel_destroy_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GError *error = NULL; if (!tp_channel_destroy_finish (TP_CHANNEL (source), result, &error)) { DEBUG ("Failed to destroy %s: %s", tp_proxy_get_object_path (source), error->message); g_error_free (error); } } static void claim_destroy_channels_cb (TpChannelDispatchOperation *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; guint i; for (i = 0; i < self->priv->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->priv->channels, i); tp_channel_destroy_async (channel, channel_destroy_cb, NULL); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } /** * tp_channel_dispatch_operation_destroy_channels_async: * @self: a #TpChannelDispatchOperation * @callback: a callback to call when the request has been satisfied * @user_data: data to pass to @callback * * Called by an approver to claim channels and destroy them all right away. * If this method is called successfully, @self has been claimed and * tp_channel_destroy_async() has been called on all of its channels. * * If successful, this method will cause the #TpProxy::invalidated signal * to be emitted, in the same way as for * tp_channel_dispatch_operation_handle_with_async(). * * This method may fail because the dispatch operation has already * been completed. Again, see tp_channel_dispatch_operation_handle_with_async() * for more details. * * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE feature must be prepared before * calling this function. * * Since: 0.15.2 */ void tp_channel_dispatch_operation_destroy_channels_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CHANNEL_DISPATCH_OPERATION (self)); g_return_if_fail (tp_proxy_is_prepared (self, TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_channel_dispatch_operation_destroy_channels_async); tp_cli_channel_dispatch_operation_call_claim (self, -1, claim_destroy_channels_cb, result, NULL, G_OBJECT (self)); } /** * tp_channel_dispatch_operation_destroy_channels_finish: * @self: a #TpChannelDispatchOperation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async operation initiated using * tp_channel_dispatch_operation_destroy_channels_async(). * * Returns: %TRUE if the Claim() call was successful and * tp_channel_destroy_async() has at least been attempted on all the * channels, otherwise %FALSE * * Since: 0.15.2 */ gboolean tp_channel_dispatch_operation_destroy_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, \ tp_channel_dispatch_operation_destroy_channels_async) } telepathy-glib-0.24.2/telepathy-glib/channel-dispatch-operation.h0000644000175000017500000001652712652510705021736 00000000000000/* * channel-dispatch-operation.h - proxy for channels awaiting approval * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_CHANNEL_DISPATCH_OPERATION_H #define TP_CHANNEL_DISPATCH_OPERATION_H #include #include #include #include #include #include G_BEGIN_DECLS /* TpChannelDispatchOperation is defined in base-client.h */ typedef struct _TpChannelDispatchOperationClass TpChannelDispatchOperationClass; typedef struct _TpChannelDispatchOperationPrivate TpChannelDispatchOperationPrivate; typedef struct _TpChannelDispatchOperationClassPrivate TpChannelDispatchOperationClassPrivate; struct _TpChannelDispatchOperation { /**/ TpProxy parent; TpChannelDispatchOperationPrivate *priv; }; struct _TpChannelDispatchOperationClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpChannelDispatchOperationClassPrivate *priv; }; GType tp_channel_dispatch_operation_get_type (void); #define TP_TYPE_CHANNEL_DISPATCH_OPERATION \ (tp_channel_dispatch_operation_get_type ()) #define TP_CHANNEL_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \ TpChannelDispatchOperation)) #define TP_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \ TpChannelDispatchOperationClass)) #define TP_IS_CHANNEL_DISPATCH_OPERATION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION)) #define TP_IS_CHANNEL_DISPATCH_OPERATION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CHANNEL_DISPATCH_OPERATION)) #define TP_CHANNEL_DISPATCH_OPERATION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CHANNEL_DISPATCH_OPERATION, \ TpChannelDispatchOperationClass)) #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 TpChannelDispatchOperation *tp_channel_dispatch_operation_new ( TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error) G_GNUC_WARN_UNUSED_RESULT; #endif void tp_channel_dispatch_operation_init_known_interfaces (void); #define TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE \ tp_channel_dispatch_operation_get_feature_quark_core () GQuark tp_channel_dispatch_operation_get_feature_quark_core (void) G_GNUC_CONST; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_connection) TpConnection * tp_channel_dispatch_operation_borrow_connection ( TpChannelDispatchOperation *self); _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_account) TpAccount * tp_channel_dispatch_operation_borrow_account ( TpChannelDispatchOperation *self); _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_channels) GPtrArray * tp_channel_dispatch_operation_borrow_channels ( TpChannelDispatchOperation *self); _TP_DEPRECATED_IN_0_20_FOR(tp_channel_dispatch_operation_get_possible_handlers) GStrv tp_channel_dispatch_operation_borrow_possible_handlers ( TpChannelDispatchOperation *self); _TP_DEPRECATED_IN_0_20 GHashTable * tp_channel_dispatch_operation_borrow_immutable_properties ( TpChannelDispatchOperation *self); #endif _TP_AVAILABLE_IN_0_20 TpConnection * tp_channel_dispatch_operation_get_connection ( TpChannelDispatchOperation *self); _TP_AVAILABLE_IN_0_20 TpAccount * tp_channel_dispatch_operation_get_account ( TpChannelDispatchOperation *self); _TP_AVAILABLE_IN_0_20 GPtrArray * tp_channel_dispatch_operation_get_channels ( TpChannelDispatchOperation *self); _TP_AVAILABLE_IN_0_20 GStrv tp_channel_dispatch_operation_get_possible_handlers ( TpChannelDispatchOperation *self); void tp_channel_dispatch_operation_handle_with_async ( TpChannelDispatchOperation *self, const gchar *handler, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_dispatch_operation_handle_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); void tp_channel_dispatch_operation_claim_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_dispatch_operation_claim_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); void tp_channel_dispatch_operation_handle_with_time_async ( TpChannelDispatchOperation *self, const gchar *handler, gint64 user_action_time, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_dispatch_operation_handle_with_time_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_channel_dispatch_operation_claim_with_async ( TpChannelDispatchOperation *self, TpBaseClient *client, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_dispatch_operation_claim_with_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); /* Reject API */ _TP_AVAILABLE_IN_0_16 void tp_channel_dispatch_operation_close_channels_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_dispatch_operation_close_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_channel_dispatch_operation_leave_channels_async ( TpChannelDispatchOperation *self, TpChannelGroupChangeReason reason, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_dispatch_operation_leave_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_channel_dispatch_operation_destroy_channels_async ( TpChannelDispatchOperation *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_channel_dispatch_operation_destroy_channels_finish ( TpChannelDispatchOperation *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/connection-aliasing.c0000644000175000017500000000642012652510705020441 00000000000000/* * Proxy for a Telepathy connection - aliasing support * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection.h" #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/proxy-internal.h" /** * TP_CONNECTION_FEATURE_ALIASING: * * Expands to a call to a function that returns a #GQuark representing the * "aliasing" feature. * * This feature needs to be prepared in order to use * tp_connection_can_set_contact_alias(). * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.17.3 */ GQuark tp_connection_get_feature_quark_aliasing (void) { return g_quark_from_static_string ("tp-connection-feature-aliasing"); } /** * tp_connection_can_set_contact_alias: * @self: a #TpConnection * * Check if the user can set aliases on his contacts. * TP_CONNECTION_FEATURE_ALIASING needs to be prepared for this function to * return a meaningful value. * * Returns: %TRUE if the aliases of contacts on @self * may be changed by the user of the service, not just by the * contacts themselves; %FALSE otherwise. * Since: 0.17.3 */ gboolean tp_connection_can_set_contact_alias (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return (self->priv->alias_flags & TP_CONNECTION_ALIAS_FLAG_USER_SET) != 0; } static void get_alias_flag_cb (TpConnection *self, TpConnectionAliasFlags flags, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to get AliasFlag : %s", error->message); g_simple_async_result_set_from_error (result, error); goto finally; } self->priv->alias_flags = flags; finally: g_simple_async_result_complete_in_idle (result); } void _tp_connection_prepare_aliasing_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; g_assert (self->priv->alias_flags == 0); result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, _tp_connection_prepare_aliasing_async); tp_cli_connection_interface_aliasing_call_get_alias_flags (self, -1, get_alias_flag_cb, result, g_object_unref, G_OBJECT (self)); } telepathy-glib-0.24.2/telepathy-glib/introspection.am0000644000175000017500000001237112652510705017572 00000000000000# To be included by Makefile.am. introspection_extra_dist = \ TelepathyGLib-0.12.metadata \ $(NULL) if HAVE_INTROSPECTION include $(INTROSPECTION_MAKEFILE) INTROSPECTION_GIRS = TelepathyGLib-0.12.gir TelepathyGLib-0.12.gir: libtelepathy-glib.la # /!\ Order matters, see https://bugzilla.gnome.org/show_bug.cgi?id=660629 TelepathyGLib_0_12_gir_FILES = \ $(srcdir)/proxy.c _gen/proxy-introspectable.h \ $(srcdir)/account.c $(srcdir)/account.h \ $(srcdir)/account-channel-request.c $(srcdir)/account-channel-request.h \ $(srcdir)/account-manager.c $(srcdir)/account-manager.h \ $(srcdir)/automatic-client-factory.c $(srcdir)/automatic-client-factory.h \ $(srcdir)/automatic-proxy-factory.c $(srcdir)/automatic-proxy-factory.h \ $(srcdir)/basic-proxy-factory.c $(srcdir)/basic-proxy-factory.h \ $(srcdir)/client-channel-factory.c $(srcdir)/client-channel-factory.h \ $(srcdir)/connection.c $(srcdir)/connection.h \ $(srcdir)/connection-contact-list.c $(srcdir)/connection-contact-list.h \ $(srcdir)/connection-handles.c $(srcdir)/connection-contact-info.c \ $(srcdir)/connection-avatars.c \ $(srcdir)/protocol.c $(srcdir)/protocol.h \ $(srcdir)/connection-manager.c $(srcdir)/connection-manager.h \ $(srcdir)/channel.c $(srcdir)/channel.h \ $(srcdir)/channel-group.c \ $(srcdir)/channel-contacts.c \ $(srcdir)/handle.c $(srcdir)/handle.h \ $(srcdir)/handle-channels-context.c $(srcdir)/handle-channels-context.h \ $(srcdir)/dbus-daemon.c $(srcdir)/dbus-daemon.h \ $(srcdir)/interfaces.c \ $(srcdir)/intset.c $(srcdir)/intset.h \ $(srcdir)/dbus.c $(srcdir)/dbus.h \ $(srcdir)/capabilities.c $(srcdir)/capabilities.h \ $(srcdir)/contact.c $(srcdir)/contact.h \ $(srcdir)/contact-operations.c $(srcdir)/contact-operations.h \ $(srcdir)/contact-search.c $(srcdir)/contact-search.h \ $(srcdir)/contact-search-result.c $(srcdir)/contact-search-result.h \ $(srcdir)/defs.h \ $(srcdir)/debug.c $(srcdir)/debug.h \ $(srcdir)/base-client.c $(srcdir)/base-client.h \ $(srcdir)/simple-approver.c $(srcdir)/simple-approver.h \ $(srcdir)/simple-client-factory.c $(srcdir)/simple-client-factory.h \ $(srcdir)/simple-handler.c $(srcdir)/simple-handler.h \ $(srcdir)/simple-observer.c $(srcdir)/simple-observer.h \ $(srcdir)/dbus-properties-mixin.c $(srcdir)/dbus-properties-mixin.h \ $(srcdir)/contacts-mixin.c $(srcdir)/contacts-mixin.h \ $(srcdir)/group-mixin.c $(srcdir)/group-mixin.h \ $(srcdir)/presence-mixin.c $(srcdir)/presence-mixin.h \ $(srcdir)/channel-dispatch-operation.c $(srcdir)/channel-dispatch-operation.h \ $(srcdir)/channel-request.c $(srcdir)/channel-request.h \ $(srcdir)/observe-channels-context.c $(srcdir)/observe-channels-context.h \ $(srcdir)/add-dispatch-operation-context.c $(srcdir)/add-dispatch-operation-context.h \ $(srcdir)/protocol.c $(srcdir)/protocol.h \ $(srcdir)/base-connection.c $(srcdir)/base-connection.h \ $(srcdir)/handle-repo.c $(srcdir)/handle-repo.h $(srcdir)/handle-set.c \ $(srcdir)/stream-tube-channel.c $(srcdir)/stream-tube-channel.h \ $(srcdir)/dbus-tube-channel.c $(srcdir)/dbus-tube-channel.h \ $(srcdir)/stream-tube-connection.c $(srcdir)/stream-tube-connection.h \ $(srcdir)/text-channel.c $(srcdir)/text-channel.h \ $(srcdir)/file-transfer-channel.c $(srcdir)/file-transfer-channel.h \ $(srcdir)/call-channel.c $(srcdir)/call-channel.h \ $(srcdir)/call-content.c $(srcdir)/call-content.h \ $(srcdir)/call-stream.c $(srcdir)/call-stream.h \ $(srcdir)/client-message.c $(srcdir)/client-message.h \ $(srcdir)/message.c $(srcdir)/message.h \ $(srcdir)/signalled-message.c $(srcdir)/signalled-message.h \ $(srcdir)/channel-dispatcher.c $(srcdir)/channel-dispatcher.h \ $(srcdir)/debug-client.c $(srcdir)/debug-client.h \ $(srcdir)/debug-message.c $(srcdir)/debug-message.h \ $(srcdir)/tls-certificate.c $(srcdir)/tls-certificate.h \ $(srcdir)/tls-certificate-rejection.c $(srcdir)/tls-certificate-rejection.h \ $(srcdir)/errors.c $(srcdir)/errors.h \ $(srcdir)/room-list.c $(srcdir)/room-list.h \ $(srcdir)/room-info.c $(srcdir)/room-info.h \ $(srcdir)/account-request.c $(srcdir)/account-request.h \ $(srcdir)/util.c $(srcdir)/util.h \ _gen/telepathy-enums.h _gen/telepathy-enums-gtk-doc.h \ _gen/telepathy-interfaces.h \ $(NULL) TelepathyGLib_0_12_gir_NAMESPACE = TelepathyGLib TelepathyGLib_0_12_gir_VERSION = 0.12 TelepathyGLib_0_12_gir_LIBS = libtelepathy-glib.la # g-ir-scanner picks up CFLAGS from the environment, but not CPPFLAGS. # We don't want to give it our AM_CFLAGS, which include extra warnings. TelepathyGLib_0_12_gir_CFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) TelepathyGLib_0_12_gir_EXPORT_PACKAGES = telepathy-glib TelepathyGLib_0_12_gir_SCANNERFLAGS = \ --identifier-prefix=Tp \ -I$(top_builddir) \ -I$(top_srcdir) \ --c-include="telepathy-glib/telepathy-glib.h" \ --warn-all \ $(ERROR_SCANNERFLAGS) \ $(NULL) TelepathyGLib_0_12_gir_INCLUDES = \ GLib-2.0 \ Gio-2.0 \ $(NULL) TelepathyGLib_0_12_gir_PACKAGES = \ gio-2.0 \ dbus-glib-1 \ $(NULL) _gen/proxy-introspectable.h: proxy.h introspection.am @$(MKDIR_P) _gen $(AM_V_GEN)sed -e 's/gpointer self/TpProxy *self/' < $< > $@ girdir = $(datadir)/gir-1.0 dist_gir_DATA = TelepathyGLib-0.12.gir typelibsdir = $(libdir)/girepository-1.0/ typelibs_DATA = $(dist_gir_DATA:.gir=.typelib) CLEANFILES += \ $(dist_gir_DATA) \ $(typelibs_DATA) endif # vim:set ft=automake: telepathy-glib-0.24.2/telepathy-glib/contact-internal.h0000644000175000017500000000317012652510705017766 00000000000000/**/ /* Object representing a Telepathy contact (internal) * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CONTACT_INTERNAL_H__ #define __TP_CONTACT_INTERNAL_H__ #include G_BEGIN_DECLS TpContact *_tp_contact_new (TpConnection *connection, TpHandle handle, const gchar *identifier); gboolean _tp_contact_set_attributes (TpContact *contact, GHashTable *asv, guint n_features, const TpContactFeature *features, GError **error); const gchar **_tp_contacts_bind_to_signals (TpConnection *connection, guint n_features, const TpContactFeature *features); void _tp_contact_set_subscription_states (TpContact *self, GValueArray *value_array); void _tp_contact_set_is_blocked (TpContact *self, gboolean is_blocked); void _tp_contact_connection_disposed (TpContact *contact); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/heap.c0000644000175000017500000001421412652510705015432 00000000000000/* * TpHeap - a heap queue * * Copyright (C) 2006, 2007 Nokia Corporation. All rights reserved. * Copyright (C) 2007 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:heap * @title: TpHeap * @short_description: a heap queue of pointers * * A heap queue of pointers. */ #include "config.h" #include #include #define DEFAULT_SIZE 64 /** * TpHeap: * * Structure representing the heap queue. All fields are private. */ struct _TpHeap { GPtrArray *data; GCompareFunc comparator; GDestroyNotify destructor; }; /** * tp_heap_new: * @comparator: Comparator by which to order the pointers in the heap * @destructor: Function to call on the pointers when the heap is destroyed * or cleared, or %NULL if this is not needed * * * * Returns: A new, empty heap queue. */ TpHeap * tp_heap_new (GCompareFunc comparator, GDestroyNotify destructor) { TpHeap *ret = g_slice_new (TpHeap); g_assert (comparator != NULL); ret->data = g_ptr_array_sized_new (DEFAULT_SIZE); ret->comparator = comparator; ret->destructor = destructor; return ret; } /** * tp_heap_destroy: * @heap: The heap queue * * Destroy a #TpHeap. The destructor, if any, is called on all items. */ void tp_heap_destroy (TpHeap * heap) { g_return_if_fail (heap != NULL); if (heap->destructor) { guint i; for (i = 0; i < heap->data->len; i++) { (heap->destructor) (g_ptr_array_index (heap->data, i)); } } g_ptr_array_unref (heap->data); g_slice_free (TpHeap, heap); } /** * tp_heap_clear: * @heap: The heap queue * * Remove all items from a #TpHeap. The destructor, if any, is called on all * items. */ void tp_heap_clear (TpHeap *heap) { g_return_if_fail (heap != NULL); if (heap->destructor) { guint i; for (i = 0; i < heap->data->len; i++) { (heap->destructor) (g_ptr_array_index (heap->data, i)); } } g_ptr_array_unref (heap->data); heap->data = g_ptr_array_sized_new (DEFAULT_SIZE); } #define HEAP_INDEX(heap, index) (g_ptr_array_index ((heap)->data, (index)-1)) /** * tp_heap_add: * @heap: The heap queue * @element: An element * * Add element to the heap queue, maintaining correct order. */ void tp_heap_add (TpHeap *heap, gpointer element) { guint m; g_return_if_fail (heap != NULL); g_ptr_array_add (heap->data, element); m = heap->data->len; while (m != 1) { gpointer parent = HEAP_INDEX (heap, m / 2); if (heap->comparator (element, parent) < 0) { HEAP_INDEX (heap, m / 2) = element; HEAP_INDEX (heap, m) = parent; m /= 2; } else break; } } /** * tp_heap_peek_first: * @heap: The heap queue * * * * Returns: The first item in the queue, or %NULL if the queue is empty */ gpointer tp_heap_peek_first (TpHeap *heap) { g_return_val_if_fail (heap != NULL, NULL); if (heap->data->len > 0) return HEAP_INDEX (heap, 1); else return NULL; } /* * extract_element: * @heap: The heap queue * @index: The index into the queue * * Remove the element at 1-based index @index from the queue and return it. * The destructor, if any, is not called. * * Returns: The element with 1-based index @index */ static gpointer extract_element (TpHeap * heap, int index) { gpointer ret; g_return_val_if_fail (heap != NULL, NULL); if (heap->data->len > 0) { guint m = heap->data->len; guint i = 1, j; ret = HEAP_INDEX (heap, index); HEAP_INDEX (heap, index) = HEAP_INDEX (heap, m); while (i * 2 <= m) { /* select the child which is supposed to come FIRST */ if ((i * 2 + 1 <= m) && (heap-> comparator (HEAP_INDEX (heap, i * 2), HEAP_INDEX (heap, i * 2 + 1)) > 0)) j = i * 2 + 1; else j = i * 2; if (heap->comparator (HEAP_INDEX (heap, i), HEAP_INDEX (heap, j)) > 0) { gpointer tmp = HEAP_INDEX (heap, i); HEAP_INDEX (heap, i) = HEAP_INDEX (heap, j); HEAP_INDEX (heap, j) = tmp; i = j; } else break; } g_ptr_array_remove_index (heap->data, m - 1); } else ret = NULL; return ret; } /** * tp_heap_remove: * @heap: The heap queue * @element: An element in the heap * * Remove @element from @heap, if it's present. The destructor, if any, * is not called. */ void tp_heap_remove (TpHeap *heap, gpointer element) { guint i; g_return_if_fail (heap != NULL); for (i = 1; i <= heap->data->len; i++) { if (element == HEAP_INDEX (heap, i)) { extract_element (heap, i); break; } } } /** * tp_heap_extract_first: * @heap: The heap queue * * Remove and return the first element in the queue. The destructor, if any, * is not called. * * Returns: the removed element */ gpointer tp_heap_extract_first (TpHeap * heap) { g_return_val_if_fail (heap != NULL, NULL); if (heap->data->len == 0) return NULL; return extract_element (heap, 1); } /** * tp_heap_size: * @heap: The heap queue * * * * Returns: The number of items in @heap */ guint tp_heap_size (TpHeap *heap) { g_return_val_if_fail (heap != NULL, 0); return heap->data->len; } telepathy-glib-0.24.2/telepathy-glib/heap.h0000644000175000017500000000323112652510705015434 00000000000000/* * Header file for TpHeap - a heap queue * * Copyright (C) 2006 Nokia Corporation. All rights reserved. * * Contact: Olli Salli (Nokia-M/Helsinki) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HEAP_H__ #define __TP_HEAP_H__ #include G_BEGIN_DECLS typedef struct _TpHeap TpHeap; TpHeap *tp_heap_new (GCompareFunc comparator, GDestroyNotify destructor) G_GNUC_WARN_UNUSED_RESULT; void tp_heap_destroy (TpHeap *heap); void tp_heap_clear (TpHeap *heap); void tp_heap_add (TpHeap *heap, gpointer element); void tp_heap_remove (TpHeap *heap, gpointer element); gpointer tp_heap_peek_first (TpHeap *heap); gpointer tp_heap_extract_first (TpHeap *heap); guint tp_heap_size (TpHeap *heap); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/Makefile.am0000644000175000017500000002071014004031760016373 00000000000000include $(top_srcdir)/tools/flymake.mk tpgincludedir=$(includedir)/telepathy-1.0/telepathy-glib genincludedir=$(tpgincludedir)/_gen pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = telepathy-glib.pc EXTRA_DIST = \ $(ABI_LISTS) \ $(codegen_extra_dist) \ $(introspection_extra_dist) \ extra-gtkdoc.h # libtelepathy-glib is just a shared version of libtelepathy-glib-internal, # produced by abi.am. # # The static version is necessary because one of the tests wants to use # internal symbols (_tp_log) which are made invisible by GNU ld. lib_LTLIBRARIES = libtelepathy-glib.la noinst_LTLIBRARIES = libtelepathy-glib-internal.la # headers that are subject to coding-style checks our_headers = \ account.h \ account-channel-request.h \ account-manager.h \ account-request.h \ automatic-client-factory.h \ automatic-proxy-factory.h \ add-dispatch-operation-context.h \ base-call-channel.h \ base-call-content.h \ base-call-stream.h \ base-client.h \ base-channel.h \ base-connection.h \ base-connection-manager.h \ base-media-call-channel.h \ base-media-call-content.h \ base-media-call-stream.h \ base-password-channel.h \ base-protocol.h \ base-room-config.h \ basic-proxy-factory.h \ call-channel.h \ call-content.h \ call-content-media-description.h \ call-misc.h \ call-stream.h \ call-stream-endpoint.h \ channel.h \ channel-iface.h \ channel-dispatcher.h \ channel-dispatch-operation.h \ channel-factory-iface.h \ channel-manager.h \ channel-request.h \ client.h \ client-channel-factory.h \ client-message.h \ cm-message.h \ connection.h \ connection-contact-list.h \ connection-manager.h \ contact-search.h \ contact-search-result.h \ capabilities.h \ contact.h \ contact-operations.h \ base-contact-list.h \ contacts-mixin.h \ dbus.h \ dbus-daemon.h \ dbus-properties-mixin.h \ dbus-tube-channel.h \ defs.h \ debug.h \ debug-sender.h \ debug-client.h \ debug-ansi.h \ debug-message.h \ dtmf.h \ enums.h \ errors.h \ exportable-channel.h \ file-transfer-channel.h \ gnio-util.h \ group-mixin.h \ gtypes.h \ handle.h \ handle-channels-context.h \ handle-repo.h \ handle-repo-static.h \ handle-repo-dynamic.h \ heap.h \ interfaces.h \ intset.h \ media-interfaces.h \ message.h \ message-mixin.h \ observe-channels-context.h \ presence-mixin.h \ properties-mixin.h \ protocol.h \ proxy.h \ proxy-subclass.h \ room-info.h \ room-list.h \ run.h \ signalled-message.h \ simple-approver.h \ simple-client-factory.h \ simple-handler.h \ simple-observer.h \ simple-password-manager.h \ stream-tube-channel.h \ stream-tube-connection.h \ svc-account.h \ svc-account-manager.h \ svc-call.h \ svc-channel-dispatcher.h \ svc-channel-dispatch-operation.h \ svc-channel.h \ svc-channel-request.h \ svc-client.h \ svc-connection.h \ svc-connection-manager.h \ svc-debug.h \ svc-generic.h \ svc-media-interfaces.h \ svc-properties-interface.h \ svc-protocol.h \ svc-tls.h \ telepathy-glib.h \ telepathy-glib-dbus.h \ text-channel.h \ text-mixin.h \ tls-certificate.h \ tls-certificate-rejection.h \ util.h \ variant-util.h tpginclude_HEADERS = \ $(our_headers) \ $(NULL) BUILT_SOURCES = $(codegen_sources) CLEANFILES = \ $(BUILT_SOURCES) nodist_tpginclude_HEADERS = \ version.h \ $(NULL) distclean-local: rm -rf _gen clean-local: rm -rf tmp-introspect* check_c_sources = \ $(our_headers) \ $(libtelepathy_glib_internal_la_SOURCES) include $(top_srcdir)/tools/check-coding-style.mk check-local: check-coding-style libtelepathy_glib_internal_la_LIBADD = $(ALL_LIBS) libtelepathy_glib_internal_la_SOURCES = \ account.c \ account-channel-request.c \ account-channel-request-internal.h \ account-internal.h \ account-manager.c \ account-manager-internal.h \ account-request.c \ automatic-client-factory-internal.h \ automatic-client-factory.c \ automatic-proxy-factory.c \ add-dispatch-operation-context-internal.h \ add-dispatch-operation-context.c \ base-call-channel.c \ base-call-content.c \ base-call-stream.c \ base-call-internal.h \ base-channel.c \ base-client.c \ base-client-internal.h \ base-connection.c \ base-connection-internal.h \ base-connection-manager.c \ base-media-call-channel.c \ base-media-call-content.c \ base-media-call-stream.c \ base-password-channel.c \ base-protocol-internal.h \ base-protocol.c \ base-room-config.c \ basic-proxy-factory.c \ capabilities.c \ capabilities-internal.h \ call-channel.c \ call-content.c \ call-content-media-description.c \ call-internal.h \ call-misc.c \ call-stream.c \ call-stream-endpoint.c \ channel.c \ channel-contacts.c \ channel-group.c \ channel-internal.h \ channel-dispatcher.c \ channel-dispatch-operation.c \ channel-dispatch-operation-internal.h \ channel-manager.c \ channel-request.c \ client.c \ client-channel-factory.c \ client-message.c \ client-message-internal.h \ connection.c \ connection-aliasing.c \ connection-avatars.c \ connection-contact-info.c \ connection-contact-list.c \ connection-internal.h \ connection-handles.c \ connection-manager.c \ contact.c \ contact-internal.h \ contact-list-channel-internal.h \ contact-list-channel.c \ contact-operations.c \ contact-search.c \ contact-search-internal.h \ contact-search-result.c \ base-contact-list.c \ base-contact-list-internal.h \ cm-message.c \ cm-message-internal.h \ contacts-mixin.c \ dbus.c \ dbus-daemon.c \ dbus-internal.h \ dbus-properties-mixin.c \ dbus-tube-channel.c \ debug.c \ debug-client.c \ debug-sender.c \ debug-message.c \ debug-message-internal.h \ deprecated-internal.h \ dtmf.c \ interfaces.c \ debug-internal.h \ errors.c \ exportable-channel.c \ file-transfer-channel.c \ gnio-util.c \ group-mixin.c \ gtypes.c \ handle.c \ handle-channels-context-internal.h \ handle-channels-context.c \ handle-repo.c \ handle-repo-dynamic.c \ handle-repo-internal.h \ handle-repo-static.c \ handle-set.c \ heap.c \ intset.c \ channel-iface.c \ channel-factory-iface.c \ media-interfaces.c \ message.c \ message-internal.h \ message-mixin.c \ observe-channels-context-internal.h \ observe-channels-context.c \ presence-mixin.c \ properties-mixin.c \ protocol.c \ protocol-internal.h \ proxy.c \ proxy-internal.h \ proxy-methods.c \ proxy-signals.c \ room-info.c \ room-info-internal.h \ room-list.c \ run.c \ signalled-message.c \ signalled-message-internal.h \ simple-approver.c \ simple-client-factory.c \ simple-client-factory-internal.h \ simple-handler.c \ simple-observer.c \ simple-password-manager.c \ stream-tube-channel.c \ stream-tube-connection-internal.h \ stream-tube-connection.c \ text-channel.c \ text-mixin.c \ tls-certificate.c \ tls-certificate-rejection.c \ tls-certificate-rejection-internal.h \ util.c \ util-internal.h \ variant-util.c \ variant-util-internal.h AM_CPPFLAGS = \ -DG_LOG_DOMAIN=\"tp-glib\" \ -D_TP_COMPILATION \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ -I$(top_builddir) \ -I$(top_srcdir) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) ALL_LIBS = \ @DBUS_LIBS@ \ @GLIB_LIBS@ include abi.am include codegen.am include introspection.am Android.mk: Makefile.am $(codegen_sources) androgenizer -:PROJECT telepathy-glib -:SHARED libtelepathy-glib -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libtelepathy_glib_internal_la_SOURCES) \ $(nodist_libtelepathy_glib_internal_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(GIO_UNIX_CFLAGS) $(DBUS_CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -:LDFLAGS $(libtelepathy_glib_internal_la_LIBADD) \ $(libtelepathy_glib_internal_la_LDFLAGS) \ > $@ telepathy-glib-0.24.2/telepathy-glib/Makefile.in0000644000175000017500000027524014006601553016423 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # To be included by Makefile.am. # To be included by Makefile.am. # To be included by Makefile.am. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = _gen/version-script.txt @HAVE_LD_VERSION_SCRIPT_TRUE@am__append_2 = _gen/version-script.txt _gen/abi.txt @HAVE_LD_VERSION_SCRIPT_TRUE@am__append_3 = \ @HAVE_LD_VERSION_SCRIPT_TRUE@ $(VERSION_SCRIPT_ARG)=_gen/version-script.txt @HAVE_LD_VERSION_SCRIPT_FALSE@am__append_4 = -export-symbols-regex '^tp' @HAVE_INTROSPECTION_TRUE@am__append_5 = \ @HAVE_INTROSPECTION_TRUE@ $(dist_gir_DATA) \ @HAVE_INTROSPECTION_TRUE@ $(typelibs_DATA) subdir = telepathy-glib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_gir_DATA_DIST) \ $(tpginclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = telepathy-glib.pc telepathy-glib-uninstalled.pc \ version.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibsdir)" \ "$(DESTDIR)$(genincludedir)" "$(DESTDIR)$(tpgincludedir)" \ "$(DESTDIR)$(tpgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libtelepathy_glib_internal_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libtelepathy_glib_internal_la_OBJECTS = account.lo \ account-channel-request.lo account-manager.lo \ account-request.lo automatic-client-factory.lo \ automatic-proxy-factory.lo add-dispatch-operation-context.lo \ base-call-channel.lo base-call-content.lo base-call-stream.lo \ base-channel.lo base-client.lo base-connection.lo \ base-connection-manager.lo base-media-call-channel.lo \ base-media-call-content.lo base-media-call-stream.lo \ base-password-channel.lo base-protocol.lo base-room-config.lo \ basic-proxy-factory.lo capabilities.lo call-channel.lo \ call-content.lo call-content-media-description.lo call-misc.lo \ call-stream.lo call-stream-endpoint.lo channel.lo \ channel-contacts.lo channel-group.lo channel-dispatcher.lo \ channel-dispatch-operation.lo channel-manager.lo \ channel-request.lo client.lo client-channel-factory.lo \ client-message.lo connection.lo connection-aliasing.lo \ connection-avatars.lo connection-contact-info.lo \ connection-contact-list.lo connection-handles.lo \ connection-manager.lo contact.lo contact-list-channel.lo \ contact-operations.lo contact-search.lo \ contact-search-result.lo base-contact-list.lo cm-message.lo \ contacts-mixin.lo dbus.lo dbus-daemon.lo \ dbus-properties-mixin.lo dbus-tube-channel.lo debug.lo \ debug-client.lo debug-sender.lo debug-message.lo dtmf.lo \ interfaces.lo errors.lo exportable-channel.lo \ file-transfer-channel.lo gnio-util.lo group-mixin.lo gtypes.lo \ handle.lo handle-channels-context.lo handle-repo.lo \ handle-repo-dynamic.lo handle-repo-static.lo handle-set.lo \ heap.lo intset.lo channel-iface.lo channel-factory-iface.lo \ media-interfaces.lo message.lo message-mixin.lo \ observe-channels-context.lo presence-mixin.lo \ properties-mixin.lo protocol.lo proxy.lo proxy-methods.lo \ proxy-signals.lo room-info.lo room-list.lo run.lo \ signalled-message.lo simple-approver.lo \ simple-client-factory.lo simple-handler.lo simple-observer.lo \ simple-password-manager.lo stream-tube-channel.lo \ stream-tube-connection.lo text-channel.lo text-mixin.lo \ tls-certificate.lo tls-certificate-rejection.lo util.lo \ variant-util.lo am__dirstamp = $(am__leading_dot)dirstamp nodist_libtelepathy_glib_internal_la_OBJECTS = _gen/error-str.lo \ _gen/genums.lo _gen/tp-svc-account.lo \ _gen/tp-svc-account-manager.lo _gen/tp-svc-call-content.lo \ _gen/tp-svc-call-content-media-description.lo \ _gen/tp-svc-call-stream.lo _gen/tp-svc-call-stream-endpoint.lo \ _gen/tp-svc-channel.lo _gen/tp-svc-channel-dispatcher.lo \ _gen/tp-svc-channel-dispatch-operation.lo \ _gen/tp-svc-channel-request.lo _gen/tp-svc-client.lo \ _gen/tp-svc-connection.lo _gen/tp-svc-connection-manager.lo \ _gen/tp-svc-debug.lo _gen/tp-svc-generic.lo \ _gen/tp-svc-media-session-handler.lo \ _gen/tp-svc-media-stream-handler.lo _gen/tp-svc-protocol.lo \ _gen/tp-svc-tls-cert.lo libtelepathy_glib_internal_la_OBJECTS = \ $(am_libtelepathy_glib_internal_la_OBJECTS) \ $(nodist_libtelepathy_glib_internal_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__objects_1 = nodist_libtelepathy_glib_la_OBJECTS = $(am__objects_1) libtelepathy_glib_la_OBJECTS = $(nodist_libtelepathy_glib_la_OBJECTS) libtelepathy_glib_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libtelepathy_glib_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/account-channel-request.Plo \ ./$(DEPDIR)/account-manager.Plo \ ./$(DEPDIR)/account-request.Plo ./$(DEPDIR)/account.Plo \ ./$(DEPDIR)/add-dispatch-operation-context.Plo \ ./$(DEPDIR)/automatic-client-factory.Plo \ ./$(DEPDIR)/automatic-proxy-factory.Plo \ ./$(DEPDIR)/base-call-channel.Plo \ ./$(DEPDIR)/base-call-content.Plo \ ./$(DEPDIR)/base-call-stream.Plo ./$(DEPDIR)/base-channel.Plo \ ./$(DEPDIR)/base-client.Plo \ ./$(DEPDIR)/base-connection-manager.Plo \ ./$(DEPDIR)/base-connection.Plo \ ./$(DEPDIR)/base-contact-list.Plo \ ./$(DEPDIR)/base-media-call-channel.Plo \ ./$(DEPDIR)/base-media-call-content.Plo \ ./$(DEPDIR)/base-media-call-stream.Plo \ ./$(DEPDIR)/base-password-channel.Plo \ ./$(DEPDIR)/base-protocol.Plo ./$(DEPDIR)/base-room-config.Plo \ ./$(DEPDIR)/basic-proxy-factory.Plo \ ./$(DEPDIR)/call-channel.Plo \ ./$(DEPDIR)/call-content-media-description.Plo \ ./$(DEPDIR)/call-content.Plo ./$(DEPDIR)/call-misc.Plo \ ./$(DEPDIR)/call-stream-endpoint.Plo \ ./$(DEPDIR)/call-stream.Plo ./$(DEPDIR)/capabilities.Plo \ ./$(DEPDIR)/channel-contacts.Plo \ ./$(DEPDIR)/channel-dispatch-operation.Plo \ ./$(DEPDIR)/channel-dispatcher.Plo \ ./$(DEPDIR)/channel-factory-iface.Plo \ ./$(DEPDIR)/channel-group.Plo ./$(DEPDIR)/channel-iface.Plo \ ./$(DEPDIR)/channel-manager.Plo \ ./$(DEPDIR)/channel-request.Plo ./$(DEPDIR)/channel.Plo \ ./$(DEPDIR)/client-channel-factory.Plo \ ./$(DEPDIR)/client-message.Plo ./$(DEPDIR)/client.Plo \ ./$(DEPDIR)/cm-message.Plo ./$(DEPDIR)/connection-aliasing.Plo \ ./$(DEPDIR)/connection-avatars.Plo \ ./$(DEPDIR)/connection-contact-info.Plo \ ./$(DEPDIR)/connection-contact-list.Plo \ ./$(DEPDIR)/connection-handles.Plo \ ./$(DEPDIR)/connection-manager.Plo ./$(DEPDIR)/connection.Plo \ ./$(DEPDIR)/contact-list-channel.Plo \ ./$(DEPDIR)/contact-operations.Plo \ ./$(DEPDIR)/contact-search-result.Plo \ ./$(DEPDIR)/contact-search.Plo ./$(DEPDIR)/contact.Plo \ ./$(DEPDIR)/contacts-mixin.Plo ./$(DEPDIR)/dbus-daemon.Plo \ ./$(DEPDIR)/dbus-properties-mixin.Plo \ ./$(DEPDIR)/dbus-tube-channel.Plo ./$(DEPDIR)/dbus.Plo \ ./$(DEPDIR)/debug-client.Plo ./$(DEPDIR)/debug-message.Plo \ ./$(DEPDIR)/debug-sender.Plo ./$(DEPDIR)/debug.Plo \ ./$(DEPDIR)/dtmf.Plo ./$(DEPDIR)/errors.Plo \ ./$(DEPDIR)/exportable-channel.Plo \ ./$(DEPDIR)/file-transfer-channel.Plo \ ./$(DEPDIR)/gnio-util.Plo ./$(DEPDIR)/group-mixin.Plo \ ./$(DEPDIR)/gtypes.Plo ./$(DEPDIR)/handle-channels-context.Plo \ ./$(DEPDIR)/handle-repo-dynamic.Plo \ ./$(DEPDIR)/handle-repo-static.Plo ./$(DEPDIR)/handle-repo.Plo \ ./$(DEPDIR)/handle-set.Plo ./$(DEPDIR)/handle.Plo \ ./$(DEPDIR)/heap.Plo ./$(DEPDIR)/interfaces.Plo \ ./$(DEPDIR)/intset.Plo ./$(DEPDIR)/media-interfaces.Plo \ ./$(DEPDIR)/message-mixin.Plo ./$(DEPDIR)/message.Plo \ ./$(DEPDIR)/observe-channels-context.Plo \ ./$(DEPDIR)/presence-mixin.Plo \ ./$(DEPDIR)/properties-mixin.Plo ./$(DEPDIR)/protocol.Plo \ ./$(DEPDIR)/proxy-methods.Plo ./$(DEPDIR)/proxy-signals.Plo \ ./$(DEPDIR)/proxy.Plo ./$(DEPDIR)/room-info.Plo \ ./$(DEPDIR)/room-list.Plo ./$(DEPDIR)/run.Plo \ ./$(DEPDIR)/signalled-message.Plo \ ./$(DEPDIR)/simple-approver.Plo \ ./$(DEPDIR)/simple-client-factory.Plo \ ./$(DEPDIR)/simple-handler.Plo ./$(DEPDIR)/simple-observer.Plo \ ./$(DEPDIR)/simple-password-manager.Plo \ ./$(DEPDIR)/stream-tube-channel.Plo \ ./$(DEPDIR)/stream-tube-connection.Plo \ ./$(DEPDIR)/text-channel.Plo ./$(DEPDIR)/text-mixin.Plo \ ./$(DEPDIR)/tls-certificate-rejection.Plo \ ./$(DEPDIR)/tls-certificate.Plo ./$(DEPDIR)/util.Plo \ ./$(DEPDIR)/variant-util.Plo _gen/$(DEPDIR)/error-str.Plo \ _gen/$(DEPDIR)/genums.Plo \ _gen/$(DEPDIR)/tp-svc-account-manager.Plo \ _gen/$(DEPDIR)/tp-svc-account.Plo \ _gen/$(DEPDIR)/tp-svc-call-content-media-description.Plo \ _gen/$(DEPDIR)/tp-svc-call-content.Plo \ _gen/$(DEPDIR)/tp-svc-call-stream-endpoint.Plo \ _gen/$(DEPDIR)/tp-svc-call-stream.Plo \ _gen/$(DEPDIR)/tp-svc-channel-dispatch-operation.Plo \ _gen/$(DEPDIR)/tp-svc-channel-dispatcher.Plo \ _gen/$(DEPDIR)/tp-svc-channel-request.Plo \ _gen/$(DEPDIR)/tp-svc-channel.Plo \ _gen/$(DEPDIR)/tp-svc-client.Plo \ _gen/$(DEPDIR)/tp-svc-connection-manager.Plo \ _gen/$(DEPDIR)/tp-svc-connection.Plo \ _gen/$(DEPDIR)/tp-svc-debug.Plo \ _gen/$(DEPDIR)/tp-svc-generic.Plo \ _gen/$(DEPDIR)/tp-svc-media-session-handler.Plo \ _gen/$(DEPDIR)/tp-svc-media-stream-handler.Plo \ _gen/$(DEPDIR)/tp-svc-protocol.Plo \ _gen/$(DEPDIR)/tp-svc-tls-cert.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libtelepathy_glib_internal_la_SOURCES) \ $(nodist_libtelepathy_glib_internal_la_SOURCES) \ $(nodist_libtelepathy_glib_la_SOURCES) DIST_SOURCES = $(libtelepathy_glib_internal_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_gir_DATA_DIST = TelepathyGLib-0.12.gir DATA = $(dist_gir_DATA) $(pkgconfig_DATA) $(typelibs_DATA) HEADERS = $(nodist_geninclude_HEADERS) $(nodist_tpginclude_HEADERS) \ $(tpginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/abi.am \ $(srcdir)/codegen.am $(srcdir)/introspection.am \ $(srcdir)/telepathy-glib-uninstalled.pc.in \ $(srcdir)/telepathy-glib.pc.in $(srcdir)/version.h.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/tools/check-coding-style.mk \ $(top_srcdir)/tools/flymake.mk DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ tpgincludedir = $(includedir)/telepathy-1.0/telepathy-glib genincludedir = $(tpgincludedir)/_gen pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = telepathy-glib.pc EXTRA_DIST = \ $(ABI_LISTS) \ $(codegen_extra_dist) \ $(introspection_extra_dist) \ extra-gtkdoc.h # libtelepathy-glib is just a shared version of libtelepathy-glib-internal, # produced by abi.am. # # The static version is necessary because one of the tests wants to use # internal symbols (_tp_log) which are made invisible by GNU ld. lib_LTLIBRARIES = libtelepathy-glib.la noinst_LTLIBRARIES = libtelepathy-glib-internal.la # headers that are subject to coding-style checks our_headers = \ account.h \ account-channel-request.h \ account-manager.h \ account-request.h \ automatic-client-factory.h \ automatic-proxy-factory.h \ add-dispatch-operation-context.h \ base-call-channel.h \ base-call-content.h \ base-call-stream.h \ base-client.h \ base-channel.h \ base-connection.h \ base-connection-manager.h \ base-media-call-channel.h \ base-media-call-content.h \ base-media-call-stream.h \ base-password-channel.h \ base-protocol.h \ base-room-config.h \ basic-proxy-factory.h \ call-channel.h \ call-content.h \ call-content-media-description.h \ call-misc.h \ call-stream.h \ call-stream-endpoint.h \ channel.h \ channel-iface.h \ channel-dispatcher.h \ channel-dispatch-operation.h \ channel-factory-iface.h \ channel-manager.h \ channel-request.h \ client.h \ client-channel-factory.h \ client-message.h \ cm-message.h \ connection.h \ connection-contact-list.h \ connection-manager.h \ contact-search.h \ contact-search-result.h \ capabilities.h \ contact.h \ contact-operations.h \ base-contact-list.h \ contacts-mixin.h \ dbus.h \ dbus-daemon.h \ dbus-properties-mixin.h \ dbus-tube-channel.h \ defs.h \ debug.h \ debug-sender.h \ debug-client.h \ debug-ansi.h \ debug-message.h \ dtmf.h \ enums.h \ errors.h \ exportable-channel.h \ file-transfer-channel.h \ gnio-util.h \ group-mixin.h \ gtypes.h \ handle.h \ handle-channels-context.h \ handle-repo.h \ handle-repo-static.h \ handle-repo-dynamic.h \ heap.h \ interfaces.h \ intset.h \ media-interfaces.h \ message.h \ message-mixin.h \ observe-channels-context.h \ presence-mixin.h \ properties-mixin.h \ protocol.h \ proxy.h \ proxy-subclass.h \ room-info.h \ room-list.h \ run.h \ signalled-message.h \ simple-approver.h \ simple-client-factory.h \ simple-handler.h \ simple-observer.h \ simple-password-manager.h \ stream-tube-channel.h \ stream-tube-connection.h \ svc-account.h \ svc-account-manager.h \ svc-call.h \ svc-channel-dispatcher.h \ svc-channel-dispatch-operation.h \ svc-channel.h \ svc-channel-request.h \ svc-client.h \ svc-connection.h \ svc-connection-manager.h \ svc-debug.h \ svc-generic.h \ svc-media-interfaces.h \ svc-properties-interface.h \ svc-protocol.h \ svc-tls.h \ telepathy-glib.h \ telepathy-glib-dbus.h \ text-channel.h \ text-mixin.h \ tls-certificate.h \ tls-certificate-rejection.h \ util.h \ variant-util.h tpginclude_HEADERS = \ $(our_headers) \ $(NULL) BUILT_SOURCES = $(codegen_sources) CLEANFILES = $(BUILT_SOURCES) $(am__append_5) nodist_tpginclude_HEADERS = \ version.h \ $(NULL) check_c_sources = \ $(our_headers) \ $(libtelepathy_glib_internal_la_SOURCES) libtelepathy_glib_internal_la_LIBADD = $(ALL_LIBS) libtelepathy_glib_internal_la_SOURCES = \ account.c \ account-channel-request.c \ account-channel-request-internal.h \ account-internal.h \ account-manager.c \ account-manager-internal.h \ account-request.c \ automatic-client-factory-internal.h \ automatic-client-factory.c \ automatic-proxy-factory.c \ add-dispatch-operation-context-internal.h \ add-dispatch-operation-context.c \ base-call-channel.c \ base-call-content.c \ base-call-stream.c \ base-call-internal.h \ base-channel.c \ base-client.c \ base-client-internal.h \ base-connection.c \ base-connection-internal.h \ base-connection-manager.c \ base-media-call-channel.c \ base-media-call-content.c \ base-media-call-stream.c \ base-password-channel.c \ base-protocol-internal.h \ base-protocol.c \ base-room-config.c \ basic-proxy-factory.c \ capabilities.c \ capabilities-internal.h \ call-channel.c \ call-content.c \ call-content-media-description.c \ call-internal.h \ call-misc.c \ call-stream.c \ call-stream-endpoint.c \ channel.c \ channel-contacts.c \ channel-group.c \ channel-internal.h \ channel-dispatcher.c \ channel-dispatch-operation.c \ channel-dispatch-operation-internal.h \ channel-manager.c \ channel-request.c \ client.c \ client-channel-factory.c \ client-message.c \ client-message-internal.h \ connection.c \ connection-aliasing.c \ connection-avatars.c \ connection-contact-info.c \ connection-contact-list.c \ connection-internal.h \ connection-handles.c \ connection-manager.c \ contact.c \ contact-internal.h \ contact-list-channel-internal.h \ contact-list-channel.c \ contact-operations.c \ contact-search.c \ contact-search-internal.h \ contact-search-result.c \ base-contact-list.c \ base-contact-list-internal.h \ cm-message.c \ cm-message-internal.h \ contacts-mixin.c \ dbus.c \ dbus-daemon.c \ dbus-internal.h \ dbus-properties-mixin.c \ dbus-tube-channel.c \ debug.c \ debug-client.c \ debug-sender.c \ debug-message.c \ debug-message-internal.h \ deprecated-internal.h \ dtmf.c \ interfaces.c \ debug-internal.h \ errors.c \ exportable-channel.c \ file-transfer-channel.c \ gnio-util.c \ group-mixin.c \ gtypes.c \ handle.c \ handle-channels-context-internal.h \ handle-channels-context.c \ handle-repo.c \ handle-repo-dynamic.c \ handle-repo-internal.h \ handle-repo-static.c \ handle-set.c \ heap.c \ intset.c \ channel-iface.c \ channel-factory-iface.c \ media-interfaces.c \ message.c \ message-internal.h \ message-mixin.c \ observe-channels-context-internal.h \ observe-channels-context.c \ presence-mixin.c \ properties-mixin.c \ protocol.c \ protocol-internal.h \ proxy.c \ proxy-internal.h \ proxy-methods.c \ proxy-signals.c \ room-info.c \ room-info-internal.h \ room-list.c \ run.c \ signalled-message.c \ signalled-message-internal.h \ simple-approver.c \ simple-client-factory.c \ simple-client-factory-internal.h \ simple-handler.c \ simple-observer.c \ simple-password-manager.c \ stream-tube-channel.c \ stream-tube-connection-internal.h \ stream-tube-connection.c \ text-channel.c \ text-mixin.c \ tls-certificate.c \ tls-certificate-rejection.c \ tls-certificate-rejection-internal.h \ util.c \ util-internal.h \ variant-util.c \ variant-util-internal.h AM_CPPFLAGS = \ -DG_LOG_DOMAIN=\"tp-glib\" \ -D_TP_COMPILATION \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ -I$(top_builddir) \ -I$(top_srcdir) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) ALL_LIBS = \ @DBUS_LIBS@ \ @GLIB_LIBS@ ABI_LISTS = \ versions/0.7.0.abi \ versions/0.7.1.abi \ versions/0.7.2.abi \ versions/0.7.3.abi \ versions/0.7.5.abi \ versions/0.7.6.abi \ versions/0.7.7.abi \ versions/0.7.8.abi \ versions/0.7.9.abi \ versions/0.7.10.abi \ versions/0.7.12.abi \ versions/0.7.13.abi \ versions/0.7.14.abi \ versions/0.7.15.abi \ versions/0.7.16.abi \ versions/0.7.17.abi \ versions/0.7.18.abi \ versions/0.7.19.abi \ versions/0.7.20.abi \ versions/0.7.21.abi \ versions/0.7.23.abi \ versions/0.7.24.abi \ versions/0.7.26.abi \ versions/0.7.27.abi \ versions/0.7.28.abi \ versions/0.7.29.abi \ versions/0.7.30.abi \ versions/0.7.31.abi \ versions/0.7.32.abi \ versions/0.7.34.abi \ versions/0.7.35.abi \ versions/0.7.36.abi \ versions/0.7.37.abi \ versions/0.9.0.abi \ versions/0.9.2.abi \ versions/0.11.0.abi \ versions/0.11.1.abi \ versions/0.11.3.abi \ versions/0.11.4.abi \ versions/0.11.5.abi \ versions/0.11.6.abi \ versions/0.11.7.abi \ versions/0.11.9.abi \ versions/0.11.11.abi \ versions/0.11.12.abi \ versions/0.11.13.abi \ versions/0.11.14.abi \ versions/0.11.15.abi \ versions/0.11.16.abi \ versions/0.13.0.abi \ versions/0.13.1.abi \ versions/0.13.2.abi \ versions/0.13.3.abi \ versions/0.13.4.abi \ versions/0.13.5.abi \ versions/0.13.7.abi \ versions/0.13.8.abi \ versions/0.13.9.abi \ versions/0.13.10.abi \ versions/0.13.11.abi \ versions/0.13.12.abi \ versions/0.13.13.abi \ versions/0.13.14.abi \ versions/0.13.15.abi \ versions/0.13.16.abi \ versions/0.14.1.abi \ versions/0.14.3.abi \ versions/0.14.4.abi \ versions/0.14.5.abi \ versions/0.15.0.abi \ versions/0.15.1.abi \ versions/0.15.2.abi \ versions/0.15.3.abi \ versions/0.15.5.abi \ versions/0.15.6.abi \ versions/0.15.8.abi \ versions/0.17.0.abi \ versions/0.17.1.abi \ versions/0.17.2.abi \ versions/0.17.3.abi \ versions/0.17.5.abi \ versions/0.17.6.abi \ versions/0.17.7.abi \ versions/0.18.0.abi \ versions/0.19.0.abi \ versions/0.19.1.abi \ versions/0.19.2.abi \ versions/0.19.3.abi \ versions/0.19.4.abi \ versions/0.19.6.abi \ versions/0.19.7.abi \ versions/0.19.8.abi \ versions/0.19.9.abi \ versions/0.19.10.abi \ versions/0.21.2.abi \ versions/0.23.0.abi \ versions/0.23.1.abi \ versions/0.23.2.abi \ versions/0.23.3.abi \ $(NULL) # The quoting here is unnecessary but harmless, and has the useful side-effect # that vim quickfix mode (:make) doesn't interpret the libtool --mode=link # command as an error message in a bizarrely named file libtelepathy_glib_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \ -version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)" \ $(am__append_3) $(am__append_4) libtelepathy_glib_la_LIBADD = libtelepathy-glib-internal.la nodist_libtelepathy_glib_la_SOURCES = $(am__append_1) libtelepathy_glib_la_DEPENDENCIES = libtelepathy-glib-internal.la \ abi.am $(am__append_2) # allow new ABI, and silently put it in a dummy version (which can be used to # check whether binaries have been linked against unguaranteed ABI) @HAVE_LD_VERSION_SCRIPT_TRUE@@OFFICIAL_RELEASE_FALSE@MAKE_VERSION_SCRIPT_FLAGS = \ @HAVE_LD_VERSION_SCRIPT_TRUE@@OFFICIAL_RELEASE_FALSE@ --unreleased-version=TELEPATHY_GLIB_@VERSION@_UNRELEASED # don't allow undocumented ABI @HAVE_LD_VERSION_SCRIPT_TRUE@@OFFICIAL_RELEASE_TRUE@MAKE_VERSION_SCRIPT_FLAGS = codegen_extra_dist = \ account.xml \ account-manager.xml \ call-content.xml \ call-content-media-description.xml \ call-stream.xml \ call-stream-endpoint.xml \ channel.xml \ channel-dispatcher.xml \ channel-dispatch-operation.xml \ channel-request.xml \ client.xml \ debug.xml \ connection.xml \ connection-manager.xml \ dbus-daemon.xml \ dbus-introspectable.xml \ dbus-peer.xml \ dbus-properties.xml \ generic.xml \ genums.c.template \ genums.h.template \ media-session-handler.xml \ media-stream-handler.xml \ protocol.xml \ stable-interfaces.xml \ tls-cert.xml codegen_sources = \ $(nodist_libtelepathy_glib_internal_la_SOURCES) \ $(nodist_geninclude_HEADERS) \ _gen/stable-spec.xml \ _gen/spec-stamp \ _gen/stable-stamp \ _gen/reentrant-methods.list nodist_geninclude_HEADERS = \ _gen/error-str.h \ _gen/telepathy-enums.h \ _gen/telepathy-interfaces.h \ _gen/genums.h \ _gen/gtypes.h \ _gen/tp-cli-account.h \ _gen/tp-cli-account-manager.h \ _gen/tp-cli-call-content.h \ _gen/tp-cli-call-content-media-description.h \ _gen/tp-cli-call-stream.h \ _gen/tp-cli-call-stream-endpoint.h \ _gen/tp-cli-channel.h \ _gen/tp-cli-channel-dispatcher.h \ _gen/tp-cli-channel-dispatch-operation.h \ _gen/tp-cli-channel-request.h \ _gen/tp-cli-client.h \ _gen/tp-cli-connection.h \ _gen/tp-cli-connection-manager.h \ _gen/tp-cli-dbus-daemon.h \ _gen/tp-cli-debug.h \ _gen/tp-cli-generic.h \ _gen/tp-cli-media-session-handler.h \ _gen/tp-cli-media-stream-handler.h \ _gen/tp-cli-protocol.h \ _gen/tp-cli-tls-cert.h \ _gen/tp-svc-account.h \ _gen/tp-svc-account-manager.h \ _gen/tp-svc-call-content.h \ _gen/tp-svc-call-content-media-description.h \ _gen/tp-svc-call-stream.h \ _gen/tp-svc-call-stream-endpoint.h \ _gen/tp-svc-channel.h \ _gen/tp-svc-channel-dispatcher.h \ _gen/tp-svc-channel-dispatch-operation.h \ _gen/tp-svc-channel-request.h \ _gen/tp-svc-client.h \ _gen/tp-svc-connection.h \ _gen/tp-svc-connection-manager.h \ _gen/tp-svc-debug.h \ _gen/tp-svc-generic.h \ _gen/tp-svc-media-session-handler.h \ _gen/tp-svc-media-stream-handler.h \ _gen/tp-svc-protocol.h \ _gen/tp-svc-tls-cert.h nodist_libtelepathy_glib_internal_la_SOURCES = \ _gen/error-str.c \ _gen/interfaces-body.h \ _gen/genums.c \ _gen/gtypes-body.h \ _gen/register-dbus-glib-marshallers-body.h \ _gen/tp-cli-account-body.h \ _gen/tp-cli-account-manager-body.h \ _gen/tp-cli-call-content-body.h \ _gen/tp-cli-call-content-media-description-body.h \ _gen/tp-cli-call-stream-body.h \ _gen/tp-cli-call-stream-endpoint-body.h \ _gen/tp-cli-channel-body.h \ _gen/tp-cli-channel-dispatcher-body.h \ _gen/tp-cli-channel-dispatch-operation-body.h \ _gen/tp-cli-channel-request-body.h \ _gen/tp-cli-client-body.h \ _gen/tp-cli-connection-body.h \ _gen/tp-cli-connection-manager-body.h \ _gen/tp-cli-dbus-daemon-body.h \ _gen/tp-cli-debug-body.h \ _gen/tp-cli-generic-body.h \ _gen/tp-cli-media-session-handler-body.h \ _gen/tp-cli-media-stream-handler-body.h \ _gen/tp-cli-protocol-body.h \ _gen/tp-cli-tls-cert-body.h \ _gen/tp-svc-account.c \ _gen/tp-svc-account-manager.c \ _gen/tp-svc-call-content.c \ _gen/tp-svc-call-content-media-description.c \ _gen/tp-svc-call-stream.c \ _gen/tp-svc-call-stream-endpoint.c \ _gen/tp-svc-channel.c \ _gen/tp-svc-channel-dispatcher.c \ _gen/tp-svc-channel-dispatch-operation.c \ _gen/tp-svc-channel-request.c \ _gen/tp-svc-client.c \ _gen/tp-svc-connection.c \ _gen/tp-svc-connection-manager.c \ _gen/tp-svc-debug.c \ _gen/tp-svc-generic.c \ _gen/tp-svc-media-session-handler.c \ _gen/tp-svc-media-stream-handler.c \ _gen/tp-svc-protocol.c \ _gen/tp-svc-tls-cert.c # Generated stuff DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g' tools_dir = $(top_srcdir)/tools introspection_extra_dist = \ TelepathyGLib-0.12.metadata \ $(NULL) @HAVE_INTROSPECTION_TRUE@INTROSPECTION_GIRS = TelepathyGLib-0.12.gir # /!\ Order matters, see https://bugzilla.gnome.org/show_bug.cgi?id=660629 @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_FILES = \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/proxy.c _gen/proxy-introspectable.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/account.c $(srcdir)/account.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/account-channel-request.c $(srcdir)/account-channel-request.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/account-manager.c $(srcdir)/account-manager.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/automatic-client-factory.c $(srcdir)/automatic-client-factory.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/automatic-proxy-factory.c $(srcdir)/automatic-proxy-factory.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/basic-proxy-factory.c $(srcdir)/basic-proxy-factory.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/client-channel-factory.c $(srcdir)/client-channel-factory.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/connection.c $(srcdir)/connection.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/connection-contact-list.c $(srcdir)/connection-contact-list.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/connection-handles.c $(srcdir)/connection-contact-info.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/connection-avatars.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/protocol.c $(srcdir)/protocol.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/connection-manager.c $(srcdir)/connection-manager.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel.c $(srcdir)/channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel-group.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel-contacts.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/handle.c $(srcdir)/handle.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/handle-channels-context.c $(srcdir)/handle-channels-context.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/dbus-daemon.c $(srcdir)/dbus-daemon.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/interfaces.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/intset.c $(srcdir)/intset.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/dbus.c $(srcdir)/dbus.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/capabilities.c $(srcdir)/capabilities.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/contact.c $(srcdir)/contact.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/contact-operations.c $(srcdir)/contact-operations.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/contact-search.c $(srcdir)/contact-search.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/contact-search-result.c $(srcdir)/contact-search-result.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/defs.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/debug.c $(srcdir)/debug.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/base-client.c $(srcdir)/base-client.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/simple-approver.c $(srcdir)/simple-approver.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/simple-client-factory.c $(srcdir)/simple-client-factory.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/simple-handler.c $(srcdir)/simple-handler.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/simple-observer.c $(srcdir)/simple-observer.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/dbus-properties-mixin.c $(srcdir)/dbus-properties-mixin.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/contacts-mixin.c $(srcdir)/contacts-mixin.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/group-mixin.c $(srcdir)/group-mixin.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/presence-mixin.c $(srcdir)/presence-mixin.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel-dispatch-operation.c $(srcdir)/channel-dispatch-operation.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel-request.c $(srcdir)/channel-request.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/observe-channels-context.c $(srcdir)/observe-channels-context.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/add-dispatch-operation-context.c $(srcdir)/add-dispatch-operation-context.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/protocol.c $(srcdir)/protocol.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/base-connection.c $(srcdir)/base-connection.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/handle-repo.c $(srcdir)/handle-repo.h $(srcdir)/handle-set.c \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/stream-tube-channel.c $(srcdir)/stream-tube-channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/dbus-tube-channel.c $(srcdir)/dbus-tube-channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/stream-tube-connection.c $(srcdir)/stream-tube-connection.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/text-channel.c $(srcdir)/text-channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/file-transfer-channel.c $(srcdir)/file-transfer-channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/call-channel.c $(srcdir)/call-channel.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/call-content.c $(srcdir)/call-content.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/call-stream.c $(srcdir)/call-stream.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/client-message.c $(srcdir)/client-message.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/message.c $(srcdir)/message.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/signalled-message.c $(srcdir)/signalled-message.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/channel-dispatcher.c $(srcdir)/channel-dispatcher.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/debug-client.c $(srcdir)/debug-client.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/debug-message.c $(srcdir)/debug-message.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/tls-certificate.c $(srcdir)/tls-certificate.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/tls-certificate-rejection.c $(srcdir)/tls-certificate-rejection.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/errors.c $(srcdir)/errors.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/room-list.c $(srcdir)/room-list.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/room-info.c $(srcdir)/room-info.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/account-request.c $(srcdir)/account-request.h \ @HAVE_INTROSPECTION_TRUE@ $(srcdir)/util.c $(srcdir)/util.h \ @HAVE_INTROSPECTION_TRUE@ _gen/telepathy-enums.h _gen/telepathy-enums-gtk-doc.h \ @HAVE_INTROSPECTION_TRUE@ _gen/telepathy-interfaces.h \ @HAVE_INTROSPECTION_TRUE@ $(NULL) @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_NAMESPACE = TelepathyGLib @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_VERSION = 0.12 @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_LIBS = libtelepathy-glib.la # g-ir-scanner picks up CFLAGS from the environment, but not CPPFLAGS. # We don't want to give it our AM_CFLAGS, which include extra warnings. @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_CFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS) @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_EXPORT_PACKAGES = telepathy-glib @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_SCANNERFLAGS = \ @HAVE_INTROSPECTION_TRUE@ --identifier-prefix=Tp \ @HAVE_INTROSPECTION_TRUE@ -I$(top_builddir) \ @HAVE_INTROSPECTION_TRUE@ -I$(top_srcdir) \ @HAVE_INTROSPECTION_TRUE@ --c-include="telepathy-glib/telepathy-glib.h" \ @HAVE_INTROSPECTION_TRUE@ --warn-all \ @HAVE_INTROSPECTION_TRUE@ $(ERROR_SCANNERFLAGS) \ @HAVE_INTROSPECTION_TRUE@ $(NULL) @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_INCLUDES = \ @HAVE_INTROSPECTION_TRUE@ GLib-2.0 \ @HAVE_INTROSPECTION_TRUE@ Gio-2.0 \ @HAVE_INTROSPECTION_TRUE@ $(NULL) @HAVE_INTROSPECTION_TRUE@TelepathyGLib_0_12_gir_PACKAGES = \ @HAVE_INTROSPECTION_TRUE@ gio-2.0 \ @HAVE_INTROSPECTION_TRUE@ dbus-glib-1 \ @HAVE_INTROSPECTION_TRUE@ $(NULL) @HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0 @HAVE_INTROSPECTION_TRUE@dist_gir_DATA = TelepathyGLib-0.12.gir @HAVE_INTROSPECTION_TRUE@typelibsdir = $(libdir)/girepository-1.0/ @HAVE_INTROSPECTION_TRUE@typelibs_DATA = $(dist_gir_DATA:.gir=.typelib) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/tools/flymake.mk $(top_srcdir)/tools/check-coding-style.mk $(srcdir)/abi.am $(srcdir)/codegen.am $(srcdir)/introspection.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu telepathy-glib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu telepathy-glib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_srcdir)/tools/flymake.mk $(top_srcdir)/tools/check-coding-style.mk $(srcdir)/abi.am $(srcdir)/codegen.am $(srcdir)/introspection.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): telepathy-glib.pc: $(top_builddir)/config.status $(srcdir)/telepathy-glib.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ telepathy-glib-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/telepathy-glib-uninstalled.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ version.h: $(top_builddir)/config.status $(srcdir)/version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } _gen/$(am__dirstamp): @$(MKDIR_P) _gen @: > _gen/$(am__dirstamp) _gen/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) _gen/$(DEPDIR) @: > _gen/$(DEPDIR)/$(am__dirstamp) _gen/error-str.lo: _gen/$(am__dirstamp) _gen/$(DEPDIR)/$(am__dirstamp) _gen/genums.lo: _gen/$(am__dirstamp) _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-account.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-account-manager.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-call-content.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-call-content-media-description.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-call-stream.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-call-stream-endpoint.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-channel.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-channel-dispatcher.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-channel-dispatch-operation.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-channel-request.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-client.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-connection.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-connection-manager.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-debug.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-generic.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-media-session-handler.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-media-stream-handler.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-protocol.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) _gen/tp-svc-tls-cert.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) libtelepathy-glib-internal.la: $(libtelepathy_glib_internal_la_OBJECTS) $(libtelepathy_glib_internal_la_DEPENDENCIES) $(EXTRA_libtelepathy_glib_internal_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtelepathy_glib_internal_la_OBJECTS) $(libtelepathy_glib_internal_la_LIBADD) $(LIBS) libtelepathy-glib.la: $(libtelepathy_glib_la_OBJECTS) $(libtelepathy_glib_la_DEPENDENCIES) $(EXTRA_libtelepathy_glib_la_DEPENDENCIES) $(AM_V_CCLD)$(libtelepathy_glib_la_LINK) -rpath $(libdir) $(libtelepathy_glib_la_OBJECTS) $(libtelepathy_glib_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f _gen/*.$(OBJEXT) -rm -f _gen/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-channel-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/account.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add-dispatch-operation-context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/automatic-client-factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/automatic-proxy-factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-call-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-call-content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-call-stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-contact-list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-media-call-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-media-call-content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-media-call-stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-password-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-protocol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base-room-config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basic-proxy-factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-content-media-description.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-misc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-stream-endpoint.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-contacts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-dispatch-operation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-dispatcher.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-factory-iface.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-group.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-iface.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-channel-factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client-message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cm-message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-aliasing.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-avatars.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-contact-info.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-contact-list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-handles.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-list-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-operations.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-search-result.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-search.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contacts-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-daemon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-properties-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus-tube-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug-sender.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtmf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exportable-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-transfer-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnio-util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtypes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-channels-context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-repo-dynamic.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-repo-static.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-repo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle-set.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/handle.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heap.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/interfaces.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/media-interfaces.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/observe-channels-context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/presence-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/properties-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-methods.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-signals.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room-info.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room-list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalled-message.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-approver.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-client-factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-handler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-observer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-password-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream-tube-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream-tube-connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-mixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls-certificate-rejection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tls-certificate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variant-util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/error-str.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/genums.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-account-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-account.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-call-content-media-description.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-call-content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-call-stream-endpoint.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-call-stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-channel-dispatch-operation.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-channel-dispatcher.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-channel-request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-client.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-generic.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-media-session-handler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-media-stream-handler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-protocol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/tp-svc-tls-cert.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf _gen/.libs _gen/_libs install-dist_girDATA: $(dist_gir_DATA) @$(NORMAL_INSTALL) @list='$(dist_gir_DATA)'; test -n "$(girdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(girdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(girdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(girdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(girdir)" || exit $$?; \ done uninstall-dist_girDATA: @$(NORMAL_UNINSTALL) @list='$(dist_gir_DATA)'; test -n "$(girdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(girdir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-typelibsDATA: $(typelibs_DATA) @$(NORMAL_INSTALL) @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(typelibsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(typelibsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(typelibsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(typelibsdir)" || exit $$?; \ done uninstall-typelibsDATA: @$(NORMAL_UNINSTALL) @list='$(typelibs_DATA)'; test -n "$(typelibsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(typelibsdir)'; $(am__uninstall_files_from_dir) install-nodist_genincludeHEADERS: $(nodist_geninclude_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_geninclude_HEADERS)'; test -n "$(genincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(genincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(genincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(genincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(genincludedir)" || exit $$?; \ done uninstall-nodist_genincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_geninclude_HEADERS)'; test -n "$(genincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(genincludedir)'; $(am__uninstall_files_from_dir) install-nodist_tpgincludeHEADERS: $(nodist_tpginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_tpginclude_HEADERS)'; test -n "$(tpgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tpgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tpgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(tpgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(tpgincludedir)" || exit $$?; \ done uninstall-nodist_tpgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_tpginclude_HEADERS)'; test -n "$(tpgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tpgincludedir)'; $(am__uninstall_files_from_dir) install-tpgincludeHEADERS: $(tpginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(tpginclude_HEADERS)'; test -n "$(tpgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tpgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tpgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(tpgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(tpgincludedir)" || exit $$?; \ done uninstall-tpgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(tpginclude_HEADERS)'; test -n "$(tpgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(tpgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(genincludedir)" "$(DESTDIR)$(tpgincludedir)" "$(DESTDIR)$(tpgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f _gen/$(DEPDIR)/$(am__dirstamp) -rm -f _gen/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/account-channel-request.Plo -rm -f ./$(DEPDIR)/account-manager.Plo -rm -f ./$(DEPDIR)/account-request.Plo -rm -f ./$(DEPDIR)/account.Plo -rm -f ./$(DEPDIR)/add-dispatch-operation-context.Plo -rm -f ./$(DEPDIR)/automatic-client-factory.Plo -rm -f ./$(DEPDIR)/automatic-proxy-factory.Plo -rm -f ./$(DEPDIR)/base-call-channel.Plo -rm -f ./$(DEPDIR)/base-call-content.Plo -rm -f ./$(DEPDIR)/base-call-stream.Plo -rm -f ./$(DEPDIR)/base-channel.Plo -rm -f ./$(DEPDIR)/base-client.Plo -rm -f ./$(DEPDIR)/base-connection-manager.Plo -rm -f ./$(DEPDIR)/base-connection.Plo -rm -f ./$(DEPDIR)/base-contact-list.Plo -rm -f ./$(DEPDIR)/base-media-call-channel.Plo -rm -f ./$(DEPDIR)/base-media-call-content.Plo -rm -f ./$(DEPDIR)/base-media-call-stream.Plo -rm -f ./$(DEPDIR)/base-password-channel.Plo -rm -f ./$(DEPDIR)/base-protocol.Plo -rm -f ./$(DEPDIR)/base-room-config.Plo -rm -f ./$(DEPDIR)/basic-proxy-factory.Plo -rm -f ./$(DEPDIR)/call-channel.Plo -rm -f ./$(DEPDIR)/call-content-media-description.Plo -rm -f ./$(DEPDIR)/call-content.Plo -rm -f ./$(DEPDIR)/call-misc.Plo -rm -f ./$(DEPDIR)/call-stream-endpoint.Plo -rm -f ./$(DEPDIR)/call-stream.Plo -rm -f ./$(DEPDIR)/capabilities.Plo -rm -f ./$(DEPDIR)/channel-contacts.Plo -rm -f ./$(DEPDIR)/channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/channel-dispatcher.Plo -rm -f ./$(DEPDIR)/channel-factory-iface.Plo -rm -f ./$(DEPDIR)/channel-group.Plo -rm -f ./$(DEPDIR)/channel-iface.Plo -rm -f ./$(DEPDIR)/channel-manager.Plo -rm -f ./$(DEPDIR)/channel-request.Plo -rm -f ./$(DEPDIR)/channel.Plo -rm -f ./$(DEPDIR)/client-channel-factory.Plo -rm -f ./$(DEPDIR)/client-message.Plo -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/cm-message.Plo -rm -f ./$(DEPDIR)/connection-aliasing.Plo -rm -f ./$(DEPDIR)/connection-avatars.Plo -rm -f ./$(DEPDIR)/connection-contact-info.Plo -rm -f ./$(DEPDIR)/connection-contact-list.Plo -rm -f ./$(DEPDIR)/connection-handles.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/connection.Plo -rm -f ./$(DEPDIR)/contact-list-channel.Plo -rm -f ./$(DEPDIR)/contact-operations.Plo -rm -f ./$(DEPDIR)/contact-search-result.Plo -rm -f ./$(DEPDIR)/contact-search.Plo -rm -f ./$(DEPDIR)/contact.Plo -rm -f ./$(DEPDIR)/contacts-mixin.Plo -rm -f ./$(DEPDIR)/dbus-daemon.Plo -rm -f ./$(DEPDIR)/dbus-properties-mixin.Plo -rm -f ./$(DEPDIR)/dbus-tube-channel.Plo -rm -f ./$(DEPDIR)/dbus.Plo -rm -f ./$(DEPDIR)/debug-client.Plo -rm -f ./$(DEPDIR)/debug-message.Plo -rm -f ./$(DEPDIR)/debug-sender.Plo -rm -f ./$(DEPDIR)/debug.Plo -rm -f ./$(DEPDIR)/dtmf.Plo -rm -f ./$(DEPDIR)/errors.Plo -rm -f ./$(DEPDIR)/exportable-channel.Plo -rm -f ./$(DEPDIR)/file-transfer-channel.Plo -rm -f ./$(DEPDIR)/gnio-util.Plo -rm -f ./$(DEPDIR)/group-mixin.Plo -rm -f ./$(DEPDIR)/gtypes.Plo -rm -f ./$(DEPDIR)/handle-channels-context.Plo -rm -f ./$(DEPDIR)/handle-repo-dynamic.Plo -rm -f ./$(DEPDIR)/handle-repo-static.Plo -rm -f ./$(DEPDIR)/handle-repo.Plo -rm -f ./$(DEPDIR)/handle-set.Plo -rm -f ./$(DEPDIR)/handle.Plo -rm -f ./$(DEPDIR)/heap.Plo -rm -f ./$(DEPDIR)/interfaces.Plo -rm -f ./$(DEPDIR)/intset.Plo -rm -f ./$(DEPDIR)/media-interfaces.Plo -rm -f ./$(DEPDIR)/message-mixin.Plo -rm -f ./$(DEPDIR)/message.Plo -rm -f ./$(DEPDIR)/observe-channels-context.Plo -rm -f ./$(DEPDIR)/presence-mixin.Plo -rm -f ./$(DEPDIR)/properties-mixin.Plo -rm -f ./$(DEPDIR)/protocol.Plo -rm -f ./$(DEPDIR)/proxy-methods.Plo -rm -f ./$(DEPDIR)/proxy-signals.Plo -rm -f ./$(DEPDIR)/proxy.Plo -rm -f ./$(DEPDIR)/room-info.Plo -rm -f ./$(DEPDIR)/room-list.Plo -rm -f ./$(DEPDIR)/run.Plo -rm -f ./$(DEPDIR)/signalled-message.Plo -rm -f ./$(DEPDIR)/simple-approver.Plo -rm -f ./$(DEPDIR)/simple-client-factory.Plo -rm -f ./$(DEPDIR)/simple-handler.Plo -rm -f ./$(DEPDIR)/simple-observer.Plo -rm -f ./$(DEPDIR)/simple-password-manager.Plo -rm -f ./$(DEPDIR)/stream-tube-channel.Plo -rm -f ./$(DEPDIR)/stream-tube-connection.Plo -rm -f ./$(DEPDIR)/text-channel.Plo -rm -f ./$(DEPDIR)/text-mixin.Plo -rm -f ./$(DEPDIR)/tls-certificate-rejection.Plo -rm -f ./$(DEPDIR)/tls-certificate.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f ./$(DEPDIR)/variant-util.Plo -rm -f _gen/$(DEPDIR)/error-str.Plo -rm -f _gen/$(DEPDIR)/genums.Plo -rm -f _gen/$(DEPDIR)/tp-svc-account-manager.Plo -rm -f _gen/$(DEPDIR)/tp-svc-account.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-content-media-description.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-content.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-stream-endpoint.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-stream.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-dispatch-operation.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-dispatcher.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-request.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel.Plo -rm -f _gen/$(DEPDIR)/tp-svc-client.Plo -rm -f _gen/$(DEPDIR)/tp-svc-connection-manager.Plo -rm -f _gen/$(DEPDIR)/tp-svc-connection.Plo -rm -f _gen/$(DEPDIR)/tp-svc-debug.Plo -rm -f _gen/$(DEPDIR)/tp-svc-generic.Plo -rm -f _gen/$(DEPDIR)/tp-svc-media-session-handler.Plo -rm -f _gen/$(DEPDIR)/tp-svc-media-stream-handler.Plo -rm -f _gen/$(DEPDIR)/tp-svc-protocol.Plo -rm -f _gen/$(DEPDIR)/tp-svc-tls-cert.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_girDATA install-nodist_genincludeHEADERS \ install-nodist_tpgincludeHEADERS install-pkgconfigDATA \ install-tpgincludeHEADERS install-typelibsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/account-channel-request.Plo -rm -f ./$(DEPDIR)/account-manager.Plo -rm -f ./$(DEPDIR)/account-request.Plo -rm -f ./$(DEPDIR)/account.Plo -rm -f ./$(DEPDIR)/add-dispatch-operation-context.Plo -rm -f ./$(DEPDIR)/automatic-client-factory.Plo -rm -f ./$(DEPDIR)/automatic-proxy-factory.Plo -rm -f ./$(DEPDIR)/base-call-channel.Plo -rm -f ./$(DEPDIR)/base-call-content.Plo -rm -f ./$(DEPDIR)/base-call-stream.Plo -rm -f ./$(DEPDIR)/base-channel.Plo -rm -f ./$(DEPDIR)/base-client.Plo -rm -f ./$(DEPDIR)/base-connection-manager.Plo -rm -f ./$(DEPDIR)/base-connection.Plo -rm -f ./$(DEPDIR)/base-contact-list.Plo -rm -f ./$(DEPDIR)/base-media-call-channel.Plo -rm -f ./$(DEPDIR)/base-media-call-content.Plo -rm -f ./$(DEPDIR)/base-media-call-stream.Plo -rm -f ./$(DEPDIR)/base-password-channel.Plo -rm -f ./$(DEPDIR)/base-protocol.Plo -rm -f ./$(DEPDIR)/base-room-config.Plo -rm -f ./$(DEPDIR)/basic-proxy-factory.Plo -rm -f ./$(DEPDIR)/call-channel.Plo -rm -f ./$(DEPDIR)/call-content-media-description.Plo -rm -f ./$(DEPDIR)/call-content.Plo -rm -f ./$(DEPDIR)/call-misc.Plo -rm -f ./$(DEPDIR)/call-stream-endpoint.Plo -rm -f ./$(DEPDIR)/call-stream.Plo -rm -f ./$(DEPDIR)/capabilities.Plo -rm -f ./$(DEPDIR)/channel-contacts.Plo -rm -f ./$(DEPDIR)/channel-dispatch-operation.Plo -rm -f ./$(DEPDIR)/channel-dispatcher.Plo -rm -f ./$(DEPDIR)/channel-factory-iface.Plo -rm -f ./$(DEPDIR)/channel-group.Plo -rm -f ./$(DEPDIR)/channel-iface.Plo -rm -f ./$(DEPDIR)/channel-manager.Plo -rm -f ./$(DEPDIR)/channel-request.Plo -rm -f ./$(DEPDIR)/channel.Plo -rm -f ./$(DEPDIR)/client-channel-factory.Plo -rm -f ./$(DEPDIR)/client-message.Plo -rm -f ./$(DEPDIR)/client.Plo -rm -f ./$(DEPDIR)/cm-message.Plo -rm -f ./$(DEPDIR)/connection-aliasing.Plo -rm -f ./$(DEPDIR)/connection-avatars.Plo -rm -f ./$(DEPDIR)/connection-contact-info.Plo -rm -f ./$(DEPDIR)/connection-contact-list.Plo -rm -f ./$(DEPDIR)/connection-handles.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/connection.Plo -rm -f ./$(DEPDIR)/contact-list-channel.Plo -rm -f ./$(DEPDIR)/contact-operations.Plo -rm -f ./$(DEPDIR)/contact-search-result.Plo -rm -f ./$(DEPDIR)/contact-search.Plo -rm -f ./$(DEPDIR)/contact.Plo -rm -f ./$(DEPDIR)/contacts-mixin.Plo -rm -f ./$(DEPDIR)/dbus-daemon.Plo -rm -f ./$(DEPDIR)/dbus-properties-mixin.Plo -rm -f ./$(DEPDIR)/dbus-tube-channel.Plo -rm -f ./$(DEPDIR)/dbus.Plo -rm -f ./$(DEPDIR)/debug-client.Plo -rm -f ./$(DEPDIR)/debug-message.Plo -rm -f ./$(DEPDIR)/debug-sender.Plo -rm -f ./$(DEPDIR)/debug.Plo -rm -f ./$(DEPDIR)/dtmf.Plo -rm -f ./$(DEPDIR)/errors.Plo -rm -f ./$(DEPDIR)/exportable-channel.Plo -rm -f ./$(DEPDIR)/file-transfer-channel.Plo -rm -f ./$(DEPDIR)/gnio-util.Plo -rm -f ./$(DEPDIR)/group-mixin.Plo -rm -f ./$(DEPDIR)/gtypes.Plo -rm -f ./$(DEPDIR)/handle-channels-context.Plo -rm -f ./$(DEPDIR)/handle-repo-dynamic.Plo -rm -f ./$(DEPDIR)/handle-repo-static.Plo -rm -f ./$(DEPDIR)/handle-repo.Plo -rm -f ./$(DEPDIR)/handle-set.Plo -rm -f ./$(DEPDIR)/handle.Plo -rm -f ./$(DEPDIR)/heap.Plo -rm -f ./$(DEPDIR)/interfaces.Plo -rm -f ./$(DEPDIR)/intset.Plo -rm -f ./$(DEPDIR)/media-interfaces.Plo -rm -f ./$(DEPDIR)/message-mixin.Plo -rm -f ./$(DEPDIR)/message.Plo -rm -f ./$(DEPDIR)/observe-channels-context.Plo -rm -f ./$(DEPDIR)/presence-mixin.Plo -rm -f ./$(DEPDIR)/properties-mixin.Plo -rm -f ./$(DEPDIR)/protocol.Plo -rm -f ./$(DEPDIR)/proxy-methods.Plo -rm -f ./$(DEPDIR)/proxy-signals.Plo -rm -f ./$(DEPDIR)/proxy.Plo -rm -f ./$(DEPDIR)/room-info.Plo -rm -f ./$(DEPDIR)/room-list.Plo -rm -f ./$(DEPDIR)/run.Plo -rm -f ./$(DEPDIR)/signalled-message.Plo -rm -f ./$(DEPDIR)/simple-approver.Plo -rm -f ./$(DEPDIR)/simple-client-factory.Plo -rm -f ./$(DEPDIR)/simple-handler.Plo -rm -f ./$(DEPDIR)/simple-observer.Plo -rm -f ./$(DEPDIR)/simple-password-manager.Plo -rm -f ./$(DEPDIR)/stream-tube-channel.Plo -rm -f ./$(DEPDIR)/stream-tube-connection.Plo -rm -f ./$(DEPDIR)/text-channel.Plo -rm -f ./$(DEPDIR)/text-mixin.Plo -rm -f ./$(DEPDIR)/tls-certificate-rejection.Plo -rm -f ./$(DEPDIR)/tls-certificate.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f ./$(DEPDIR)/variant-util.Plo -rm -f _gen/$(DEPDIR)/error-str.Plo -rm -f _gen/$(DEPDIR)/genums.Plo -rm -f _gen/$(DEPDIR)/tp-svc-account-manager.Plo -rm -f _gen/$(DEPDIR)/tp-svc-account.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-content-media-description.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-content.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-stream-endpoint.Plo -rm -f _gen/$(DEPDIR)/tp-svc-call-stream.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-dispatch-operation.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-dispatcher.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel-request.Plo -rm -f _gen/$(DEPDIR)/tp-svc-channel.Plo -rm -f _gen/$(DEPDIR)/tp-svc-client.Plo -rm -f _gen/$(DEPDIR)/tp-svc-connection-manager.Plo -rm -f _gen/$(DEPDIR)/tp-svc-connection.Plo -rm -f _gen/$(DEPDIR)/tp-svc-debug.Plo -rm -f _gen/$(DEPDIR)/tp-svc-generic.Plo -rm -f _gen/$(DEPDIR)/tp-svc-media-session-handler.Plo -rm -f _gen/$(DEPDIR)/tp-svc-media-stream-handler.Plo -rm -f _gen/$(DEPDIR)/tp-svc-protocol.Plo -rm -f _gen/$(DEPDIR)/tp-svc-tls-cert.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_girDATA uninstall-libLTLIBRARIES \ uninstall-nodist_genincludeHEADERS \ uninstall-nodist_tpgincludeHEADERS uninstall-pkgconfigDATA \ uninstall-tpgincludeHEADERS uninstall-typelibsDATA .MAKE: all check check-am install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am \ check-local clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-local \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_girDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man \ install-nodist_genincludeHEADERS \ install-nodist_tpgincludeHEADERS install-pdf install-pdf-am \ install-pkgconfigDATA install-ps install-ps-am install-strip \ install-tpgincludeHEADERS install-typelibsDATA installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_girDATA \ uninstall-libLTLIBRARIES uninstall-nodist_genincludeHEADERS \ uninstall-nodist_tpgincludeHEADERS uninstall-pkgconfigDATA \ uninstall-tpgincludeHEADERS uninstall-typelibsDATA .PRECIOUS: Makefile check-syntax: $(CC) $(AM_CPPFLAGS) $(AM_CFLAGS) -fsyntax-only $(CHK_SOURCES) .PHONY: check-syntax distclean-local: rm -rf _gen clean-local: rm -rf tmp-introspect* check-coding-style: @fail=0; \ if test -n "$(check_misc_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-misc.sh \ $(addprefix $(srcdir)/,$(check_misc_sources)) || fail=1; \ fi; \ if test -n "$(check_c_sources)"; then \ tools_dir=$(top_srcdir)/tools \ sh $(top_srcdir)/tools/check-c-style.sh \ $(addprefix $(srcdir)/,$(check_c_sources)) || fail=1; \ fi;\ if test yes = "$(enable_fatal_warnings)"; then \ exit "$$fail";\ else \ exit 0;\ fi check-local: check-coding-style @HAVE_LD_VERSION_SCRIPT_TRUE@_gen/version-script.txt: $(ABI_LISTS) _gen/abi.txt abi.am \ @HAVE_LD_VERSION_SCRIPT_TRUE@ $(top_srcdir)/tools/make-version-script.py @HAVE_LD_VERSION_SCRIPT_TRUE@ $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/make-version-script.py \ @HAVE_LD_VERSION_SCRIPT_TRUE@ --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ @HAVE_LD_VERSION_SCRIPT_TRUE@ $(ABI_LISTS:%=$(srcdir)/%) > $@ @HAVE_LD_VERSION_SCRIPT_TRUE@ $(PYTHON) $(top_srcdir)/tools/make-version-script.py \ @HAVE_LD_VERSION_SCRIPT_TRUE@ --symbols=_gen/abi.txt $(MAKE_VERSION_SCRIPT_FLAGS) \ @HAVE_LD_VERSION_SCRIPT_TRUE@ --dpkg "libtelepathy-glib.so.0 libtelepathy-glib0 #MINVER#" \ @HAVE_LD_VERSION_SCRIPT_TRUE@ --dpkg-build-depends-package "libtelepathy-glib-dev" \ @HAVE_LD_VERSION_SCRIPT_TRUE@ $(ABI_LISTS:%=$(srcdir)/%) > _gen/libtelepathy-glib0.symbols @HAVE_LD_VERSION_SCRIPT_TRUE@ sed -n -e "s/^[ ]*\\(tp_.*\\);/\\1/p" < $@ > _gen/versioned-abi.tmp @HAVE_LD_VERSION_SCRIPT_TRUE@ sort -u < _gen/versioned-abi.tmp > _gen/versioned-abi.txt @HAVE_LD_VERSION_SCRIPT_TRUE@ : # the versioned API should always match the ^tp API @HAVE_LD_VERSION_SCRIPT_TRUE@ diff -c _gen/versioned-abi.txt _gen/abi.txt @HAVE_LD_VERSION_SCRIPT_TRUE@_gen/abi.txt: libtelepathy-glib-internal.la abi.am @HAVE_LD_VERSION_SCRIPT_TRUE@ $(NM) .libs/libtelepathy-glib-internal.a > _gen/abi.nm @HAVE_LD_VERSION_SCRIPT_TRUE@ grep " [DT] " < _gen/abi.nm > _gen/abi.funcs @HAVE_LD_VERSION_SCRIPT_TRUE@ cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames @HAVE_LD_VERSION_SCRIPT_TRUE@ grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames @HAVE_LD_VERSION_SCRIPT_TRUE@ $(AM_V_GEN)sort -u < _gen/abi.tpfuncnames > $@ # vim:set ft=automake: # Bootstrapping _gen/spec-stamp: $(wildcard $(top_srcdir)/spec/*.xml) $(MKDIR_P) _gen touch $@ _gen/stable-stamp: $(wildcard $(abs_srcdir)/*.xml) _gen/spec-stamp touch $@ _gen/stable-spec.xml: stable-interfaces.xml _gen/stable-stamp $(tools_dir)/xincludator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@.tmp @mv $@.tmp $@ # Grab a list of re-entrant tp_cli_*_run_* methods we are committed to # generating for backwards compatibility. # grep --no-filename is not portable :-( _gen/reentrant-methods.list: _gen/spec-stamp $(ABI_LISTS) codegen.am $(AM_V_GEN)( cd $(srcdir) && cat $(ABI_LISTS) ) | \ $(GREP) '^tp_cli_.*_run_.*' > $@.tmp @mv $@.tmp $@ # Things generated from the whole spec at once # do nothing, output as a side-effect _gen/gtypes.h: _gen/gtypes-body.h @: _gen/gtypes-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-gtypes-generator.py \ _gen/stable-spec.xml \ _gen/gtypes Tp _gen/telepathy-enums.h: _gen/stable-spec.xml \ $(tools_dir)/c-constants-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Tp $< _gen/telepathy-enums # do nothing, output as a side-effect _gen/interfaces-body.h: _gen/telepathy-interfaces.h @: _gen/telepathy-interfaces.h: _gen/stable-spec.xml \ $(tools_dir)/glib-interfaces-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Tp _gen/interfaces-body.h _gen/telepathy-interfaces.h $< _gen/register-dbus-glib-marshallers-body.h: _gen/stable-spec.xml \ $(tools_dir)/glib-client-marshaller-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< _tp > $@ _gen/genums.c: _gen/spec-stamp genums.c.template $(our_headers) codegen.am $(AM_V_GEN)( cd $(srcdir) && \ $(GLIB_MKENUMS) --template genums.c.template $(our_headers) \ ) > $@ _gen/genums.h: _gen/spec-stamp genums.h.template $(our_headers) codegen.am $(AM_V_GEN)( cd $(srcdir) && \ $(GLIB_MKENUMS) --template genums.h.template $(our_headers) \ ) > $@ _gen/error-str.h: _gen/error-str.c @: # do nothing, output as a side-effect _gen/error-str.c: _gen/stable-spec.xml \ $(tools_dir)/glib-errors-str-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-errors-str-gen.py \ _gen/error-str $< # Things generated per interface _gen/tp-spec-%.xml: %.xml _gen/spec-stamp $(tools_dir)/xincludator.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@.tmp @mv $@.tmp $@ # do nothing, output as a side-effect _gen/tp-svc-%.h: _gen/tp-svc-%.c @: _gen/tp-svc-%.c: _gen/tp-spec-%.xml \ $(tools_dir)/glib-ginterface-gen.py \ codegen.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/tp-svc-$* \ --signal-marshal-prefix=_tp \ --include='' \ --include='' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ $< Tp_Svc_ # do nothing, output as a side-effect _gen/tp-cli-%.h: _gen/tp-cli-%-body.h @: _gen/tp-cli-%-body.h: _gen/tp-spec-%.xml \ _gen/reentrant-methods.list \ $(tools_dir)/glib-client-gen.py \ codegen.am $(AM_V_GEN)set -e; \ subclass= ; \ subclass_assert= ; \ case $* in \ generic) \ ;; \ account-manager) \ subclass=--subclass=TpAccountManager; \ subclass_assert=--subclass-assert=TP_IS_ACCOUNT_MANAGER; \ ;; \ account) \ subclass=--subclass=TpAccount; \ subclass_assert=--subclass-assert=TP_IS_ACCOUNT; \ ;; \ call-content) \ subclass=--subclass=TpCallContent; \ subclass_assert=--subclass-assert=TP_IS_CALL_CONTENT; \ ;; \ call-stream) \ subclass=--subclass=TpCallStream; \ subclass_assert=--subclass-assert=TP_IS_CALL_STREAM; \ ;; \ channel) \ subclass=--subclass=TpChannel; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL; \ ;; \ channel-dispatcher) \ subclass=--subclass=TpChannelDispatcher; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_DISPATCHER; \ ;; \ channel-dispatch-operation) \ subclass=--subclass=TpChannelDispatchOperation; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_DISPATCH_OPERATION; \ ;; \ channel-request) \ subclass=--subclass=TpChannelRequest; \ subclass_assert=--subclass-assert=TP_IS_CHANNEL_REQUEST; \ ;; \ client) \ subclass=--subclass=TpClient; \ subclass_assert=--subclass-assert=TP_IS_CLIENT; \ ;; \ connection-manager) \ subclass=--subclass=TpConnectionManager; \ subclass_assert=--subclass-assert=TP_IS_CONNECTION_MANAGER \ ;; \ connection) \ subclass=--subclass=TpConnection; \ subclass_assert=--subclass-assert=TP_IS_CONNECTION; \ ;; \ media-session-handler) \ subclass=--subclass=TpMediaSessionHandler; \ subclass_assert=--subclass-assert=TP_IS_MEDIA_SESSION_HANDLER; \ ;; \ media-stream-handler) \ subclass=--subclass=TpMediaStreamHandler; \ subclass_assert=--subclass-assert=TP_IS_MEDIA_STREAM_HANDLER; \ ;; \ dbus-daemon) \ subclass=--subclass=TpDBusDaemon; \ subclass_assert=--subclass-assert=TP_IS_DBUS_DAEMON; \ ;; \ debug) \ subclass=--subclass=TpDebugClient; \ subclass_assert=--subclass-assert=TP_IS_DEBUG_CLIENT; \ ;; \ tls-cert) \ subclass=--subclass=TpTLSCertificate; \ subclass_assert=--subclass-assert=TP_IS_TLS_CERTIFICATE; \ ;; \ esac; \ $(PYTHON) $(tools_dir)/glib-client-gen.py \ $$subclass $$subclass_assert \ --group `echo $* | tr - _` \ --guard "TP_GEN_TP_CLI_`echo $* | tr a-z- A-Z_`_H_INCLUDED" \ --iface-quark-prefix=TP_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ --deprecation-attribute=_TP_GNUC_DEPRECATED \ --deprecate-reentrant=TP_DISABLE_DEPRECATED \ --generate-reentrant=_gen/reentrant-methods.list \ $< Tp_Cli _gen/tp-cli-$* # vim:set ft=automake: @HAVE_INTROSPECTION_TRUE@include $(INTROSPECTION_MAKEFILE) @HAVE_INTROSPECTION_TRUE@TelepathyGLib-0.12.gir: libtelepathy-glib.la @HAVE_INTROSPECTION_TRUE@_gen/proxy-introspectable.h: proxy.h introspection.am @HAVE_INTROSPECTION_TRUE@ @$(MKDIR_P) _gen @HAVE_INTROSPECTION_TRUE@ $(AM_V_GEN)sed -e 's/gpointer self/TpProxy *self/' < $< > $@ # vim:set ft=automake: Android.mk: Makefile.am $(codegen_sources) androgenizer -:PROJECT telepathy-glib -:SHARED libtelepathy-glib -:TAGS eng debug \ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \ -:SOURCES $(libtelepathy_glib_internal_la_SOURCES) \ $(nodist_libtelepathy_glib_internal_la_SOURCES) \ -:CFLAGS $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(GIO_UNIX_CFLAGS) $(DBUS_CFLAGS) $(AM_CFLAGS) \ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(INCLUDES) \ -:LDFLAGS $(libtelepathy_glib_internal_la_LIBADD) \ $(libtelepathy_glib_internal_la_LDFLAGS) \ > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/telepathy-glib/client-message-internal.h0000644000175000017500000000257712652510705021245 00000000000000/**/ /* * client-message-internal.h - Header for TpClientMessage (internal) * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CLIENT_MESSAGE_INTERNAL_H__ #define __TP_CLIENT_MESSAGE_INTERNAL_H__ #include #include "message.h" #include "message-internal.h" G_BEGIN_DECLS typedef struct _TpClientMessagePrivate TpClientMessagePrivate; struct _TpClientMessageClass { /**/ TpMessageClass parent_class; }; struct _TpClientMessage { /**/ TpMessage parent; TpClientMessagePrivate *priv; }; G_END_DECLS #endif /* __TP_Client_MESSAGE_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/protocol.xml0000644000175000017500000000063212652510705016733 00000000000000 Protocol interfaces telepathy-glib-0.24.2/telepathy-glib/contacts-mixin.c0000644000175000017500000003754312652510705017467 00000000000000/* * contacts-mixin.c - Source for TpContactsMixin * Copyright © 2008-2010 Collabora Ltd. * Copyright © 2008 Nokia Corporation * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:contacts-mixin * @title: TpContactsMixin * @short_description: a mixin implementation of the contacts connection * interface * @see_also: #TpSvcConnectionInterfaceContacts * * This mixin can be added to a #TpBaseConnection subclass to implement the * Contacts interface in a generic way. * * To use the contacts mixin, include a #TpContactsMixinClass somewhere in * your class structure and a #TpContactsMixin somewhere in your instance * structure, and call tp_contacts_mixin_class_init() from your class_init * function, tp_contacts_mixin_init() from your init function or constructor, * and tp_contacts_mixin_finalize() from your dispose or finalize function. * * To use the contacts mixin as the implementation of * #TpSvcConnectionInterfaceContacts, in the function you pass to * G_IMPLEMENT_INTERFACE, you should call tp_contacts_mixin_iface_init. * TpContactsMixin implements all of the D-Bus methods and properties in the * Contacts interface. * * To add interfaces with contact attributes to this interface use * tp_contacts_mixin_add_contact_attributes_iface: * * Since: 0.7.14 * */ #include "config.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "debug-internal.h" struct _TpContactsMixinPrivate { /* String interface name -> FillContactAttributes func */ GHashTable *interfaces; }; enum { MIXIN_DP_CONTACT_ATTRIBUTE_INTERFACES, NUM_MIXIN_CONTACTS_DBUS_PROPERTIES }; static TpDBusPropertiesMixinPropImpl known_contacts_props[] = { { "ContactAttributeInterfaces", NULL, NULL }, { NULL } }; static const gchar *always_included_interfaces[] = { TP_IFACE_CONNECTION, NULL }; static void tp_presence_mixin_get_contacts_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { static GQuark q[NUM_MIXIN_CONTACTS_DBUS_PROPERTIES] = { 0, }; TpContactsMixin *self = TP_CONTACTS_MIXIN (object); DEBUG ("called."); if (G_UNLIKELY (q[0] == 0)) { q[MIXIN_DP_CONTACT_ATTRIBUTE_INTERFACES] = g_quark_from_static_string ("ContactAttributeInterfaces"); } g_return_if_fail (object != NULL); if (name == q[MIXIN_DP_CONTACT_ATTRIBUTE_INTERFACES]) { gchar **interfaces; GHashTableIter iter; gpointer key; int i = 0; g_assert (G_VALUE_HOLDS(value, G_TYPE_STRV)); /* FIXME, cache this when connected ? */ interfaces = g_malloc0( (g_hash_table_size (self->priv->interfaces) + 1) * sizeof (gchar *)); g_hash_table_iter_init (&iter, self->priv->interfaces); while (g_hash_table_iter_next (&iter, &key, NULL)) { interfaces[i] = g_strdup ((gchar *) key); i++; } g_value_take_boxed (value, interfaces); } else { g_assert_not_reached (); } } /** * tp_contacts_mixin_class_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObjectClass * * Since: 0.7.14 * */ GQuark tp_contacts_mixin_class_get_offset_quark () { static GQuark offset_quark = 0; if (G_UNLIKELY (offset_quark == 0)) offset_quark = g_quark_from_static_string ( "TpContactsMixinClassOffsetQuark"); return offset_quark; } /** * tp_contacts_mixin_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObject * * Since: 0.7.14 * */ GQuark tp_contacts_mixin_get_offset_quark () { static GQuark offset_quark = 0; if (G_UNLIKELY (offset_quark == 0)) offset_quark = g_quark_from_static_string ("TpContactsMixinOffsetQuark"); return offset_quark; } /** * tp_contacts_mixin_class_init: (skip) * @obj_cls: The class of the implementation that uses this mixin * @offset: The byte offset of the TpContactsMixinClass within the class * structure * * Initialize the contacts mixin. Should be called from the implementation's * class_init function like so: * * * tp_contacts_mixin_class_init ((GObjectClass *) klass, * G_STRUCT_OFFSET (SomeObjectClass, contacts_mixin)); * * * Since: 0.7.14 * */ void tp_contacts_mixin_class_init (GObjectClass *obj_cls, glong offset) { g_assert (G_IS_OBJECT_CLASS (obj_cls)); g_type_set_qdata (G_OBJECT_CLASS_TYPE (obj_cls), TP_CONTACTS_MIXIN_CLASS_OFFSET_QUARK, GINT_TO_POINTER (offset)); tp_dbus_properties_mixin_implement_interface (obj_cls, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS, tp_presence_mixin_get_contacts_dbus_property, NULL, known_contacts_props); } /** * tp_contacts_mixin_init: (skip) * @obj: An instance of the implementation that uses this mixin * @offset: The byte offset of the TpContactsMixin within the object structure * * Initialize the contacts mixin. Should be called from the implementation's * instance init function like so: * * * tp_contacts_mixin_init ((GObject *) self, * G_STRUCT_OFFSET (SomeObject, contacts_mixin)); * * * Since: 0.7.14 * */ void tp_contacts_mixin_init (GObject *obj, gsize offset) { TpContactsMixin *mixin; g_assert (G_IS_OBJECT (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_CONTACTS_MIXIN_OFFSET_QUARK, GSIZE_TO_POINTER (offset)); mixin = TP_CONTACTS_MIXIN (obj); mixin->priv = g_slice_new0 (TpContactsMixinPrivate); mixin->priv->interfaces = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } /** * tp_contacts_mixin_finalize: (skip) * @obj: An object with this mixin. * * Free resources held by the contacts mixin. * * Since: 0.7.14 * */ void tp_contacts_mixin_finalize (GObject *obj) { TpContactsMixin *mixin = TP_CONTACTS_MIXIN (obj); DEBUG ("%p", obj); /* free any data held directly by the object here */ g_hash_table_unref (mixin->priv->interfaces); g_slice_free (TpContactsMixinPrivate, mixin->priv); } /** * tp_contacts_mixin_get_contact_attributes: (skip) * @obj: A connection instance that uses this mixin. The connection must be connected. * @handles: List of handles to retrieve contacts for. Any invalid handles will be * dropped from the returned mapping. * @interfaces: A list of interfaces to retrieve attributes from. * @assumed_interfaces: A list of additional interfaces to retrieve attributes * from. This can be used for interfaces documented as automatically included, * like %TP_IFACE_CONNECTION for GetContactAttributes, * or %TP_IFACE_CONNECTION and %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST for * GetContactListAttributes. * @sender: The DBus client's unique name. If this is not NULL, the requested handles * will be held on behalf of this client. * * Get contact attributes for the given contacts. Provide attributes for all requested * interfaces. If contact attributes are not immediately known, the behaviour is defined * by the interface; the attribute should either be omitted from the result or replaced * with a default value. * * Returns: A dictionary mapping the contact handles to contact attributes. * */ GHashTable * tp_contacts_mixin_get_contact_attributes (GObject *obj, const GArray *handles, const gchar **interfaces, const gchar **assumed_interfaces, const gchar *sender) { GHashTable *result; guint i; TpBaseConnection *conn = TP_BASE_CONNECTION (obj); TpContactsMixin *self = TP_CONTACTS_MIXIN (obj); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); GArray *valid_handles; TpContactsMixinFillContactAttributesFunc func; g_return_val_if_fail (TP_IS_BASE_CONNECTION (obj), NULL); g_return_val_if_fail (TP_CONTACTS_MIXIN_OFFSET (obj) != 0, NULL); g_return_val_if_fail (tp_base_connection_check_connected (conn, NULL), NULL); /* Setup handle array and hash with valid handles, optionally holding them */ valid_handles = g_array_sized_new (TRUE, TRUE, sizeof (TpHandle), handles->len); result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) g_hash_table_unref); for (i = 0 ; i < handles->len ; i++) { TpHandle h; h = g_array_index (handles, TpHandle, i); if (tp_handle_is_valid (contact_repo, h, NULL)) { GHashTable *attr_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); g_array_append_val (valid_handles, h); g_hash_table_insert (result, GUINT_TO_POINTER(h), attr_hash); } } for (i = 0; assumed_interfaces != NULL && assumed_interfaces[i] != NULL; i++) { func = g_hash_table_lookup (self->priv->interfaces, assumed_interfaces[i]); if (func == NULL) DEBUG ("non-inspectable assumed interface %s given; ignoring", assumed_interfaces[i]); else func (obj, valid_handles, result); } for (i = 0; interfaces != NULL && interfaces[i] != NULL; i++) { func = g_hash_table_lookup (self->priv->interfaces, interfaces[i]); if (func == NULL) DEBUG ("non-inspectable interface %s given; ignoring", interfaces[i]); else func (obj, valid_handles, result); } g_array_unref (valid_handles); return result; } static void tp_contacts_mixin_get_contact_attributes_impl ( TpSvcConnectionInterfaceContacts *iface, const GArray *handles, const char **interfaces, gboolean hold, DBusGMethodInvocation *context) { TpBaseConnection *conn = TP_BASE_CONNECTION (iface); GHashTable *result; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); result = tp_contacts_mixin_get_contact_attributes (G_OBJECT (conn), handles, interfaces, always_included_interfaces, NULL); tp_svc_connection_interface_contacts_return_from_get_contact_attributes ( context, result); g_hash_table_unref (result); } typedef struct { TpBaseConnection *conn; GStrv interfaces; DBusGMethodInvocation *context; } GetContactByIdData; static void ensure_handle_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpHandleRepoIface *contact_repo = (TpHandleRepoIface *) source; GetContactByIdData *data = user_data; TpHandle handle; GArray *handles; GHashTable *attributes; GHashTable *ret; GError *error = NULL; handle = tp_handle_ensure_finish (contact_repo, result, &error); if (handle == 0) { dbus_g_method_return_error (data->context, error); g_clear_error (&error); goto out; } handles = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (handles, handle); attributes = tp_contacts_mixin_get_contact_attributes (G_OBJECT (data->conn), handles, (const gchar **) data->interfaces, always_included_interfaces, NULL); ret = g_hash_table_lookup (attributes, GUINT_TO_POINTER (handle)); g_assert (ret != NULL); tp_svc_connection_interface_contacts_return_from_get_contact_by_id ( data->context, handle, ret); g_array_unref (handles); g_hash_table_unref (attributes); out: g_object_unref (data->conn); g_strfreev (data->interfaces); g_slice_free (GetContactByIdData, data); } static void tp_contacts_mixin_get_contact_by_id_impl ( TpSvcConnectionInterfaceContacts *iface, const gchar *id, const gchar **interfaces, DBusGMethodInvocation *context) { TpBaseConnection *conn = TP_BASE_CONNECTION (iface); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); GetContactByIdData *data; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (conn, context); data = g_slice_new0 (GetContactByIdData); data->conn = g_object_ref (conn); data->interfaces = g_strdupv ((gchar **) interfaces); data->context = context; tp_handle_ensure_async (contact_repo, conn, id, NULL, ensure_handle_cb, data); } /** * tp_contacts_mixin_iface_init: (skip) * @g_iface: A pointer to the #TpSvcConnectionInterfaceContacts in an object * class * @iface_data: Ignored * * Fill in the vtable entries needed to implement the contacts interface * using this mixin. This function should usually be called via * G_IMPLEMENT_INTERFACE. * * Since: 0.7.14 * */ void tp_contacts_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionInterfaceContactsClass *klass = (TpSvcConnectionInterfaceContactsClass *) g_iface; #define IMPLEMENT(x) tp_svc_connection_interface_contacts_implement_##x ( \ klass, tp_contacts_mixin_##x##_impl) IMPLEMENT(get_contact_attributes); IMPLEMENT(get_contact_by_id); #undef IMPLEMENT } /** * tp_contacts_mixin_add_contact_attributes_iface: (skip) * @obj: An instance of the implementation that uses this mixin * @interface: Name of the interface that has ContactAttributes * @fill_contact_attributes: Contact attribute filler function * * Declare that the given interface has contact attributes which can be added * to the attributes hash using the filler function. All the handles in the * handle array passed to the filler function are guaranteed to be valid and * referenced. * * Since: 0.7.14 * */ void tp_contacts_mixin_add_contact_attributes_iface (GObject *obj, const gchar *interface, TpContactsMixinFillContactAttributesFunc fill_contact_attributes) { TpContactsMixin *self = TP_CONTACTS_MIXIN (obj); g_assert (g_hash_table_lookup (self->priv->interfaces, interface) == NULL); g_assert (fill_contact_attributes != NULL); g_hash_table_insert (self->priv->interfaces, g_strdup (interface), fill_contact_attributes); } /** * tp_contacts_mixin_set_contact_attribute: (skip) * @contact_attributes: contacts attribute hash as passed to * TpContactsMixinFillContactAttributesFunc * @handle: Handle to set the attribute on * @attribute: attribute name * @value: slice allocated GValue containing the value of the attribute, for * instance with tp_g_value_slice_new. Ownership of the GValue is taken over by * the mixin * * Utility function to set attribute for handle to value in the attributes hash * as passed to a TpContactsMixinFillContactAttributesFunc. * * Since: 0.7.14 * */ void tp_contacts_mixin_set_contact_attribute (GHashTable *contact_attributes, TpHandle handle, const gchar *attribute, GValue *value) { GHashTable *attributes; attributes = g_hash_table_lookup (contact_attributes, GUINT_TO_POINTER (handle)); g_assert (attributes != NULL); g_assert (G_IS_VALUE (value)); g_hash_table_insert (attributes, g_strdup (attribute), value); } telepathy-glib-0.24.2/telepathy-glib/contacts-mixin.h0000644000175000017500000001032512652510705017461 00000000000000/* * contacts-mixin.h - Header for TpContactsMixin * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONTACTS_MIXIN_H__ #define __TP_CONTACTS_MIXIN_H__ #include #include #include "util.h" G_BEGIN_DECLS typedef struct _TpContactsMixinClass TpContactsMixinClass; typedef struct _TpContactsMixinClassPrivate TpContactsMixinClassPrivate; typedef struct _TpContactsMixin TpContactsMixin; typedef struct _TpContactsMixinPrivate TpContactsMixinPrivate; /** * TpContactsMixinFillContactAttributesFunc: * @obj: An object implementing the Contacts interface with this mixin * @contacts: The contact handles for which attributes are requested * @attributes_hash: hash of handle => hash of attributes, containing all the * contacts in the contacts array * * This function is called to supply contact attributes pertaining to * a particular interface, for a list of contacts. * All the handles in @contacts are guaranteed to be valid and * referenced. */ typedef void (*TpContactsMixinFillContactAttributesFunc) (GObject *obj, const GArray *contacts, GHashTable *attributes_hash); /** * TpContactsMixinClass: * * Structure to be included in the class structure of objects that * use this mixin. Initialize it with tp_contacts_mixin_class_init(). * * There are no public fields. */ struct _TpContactsMixinClass { /**/ TpContactsMixinClassPrivate *priv; }; /** * TpContactsMixin: * * Structure to be included in the instance structure of objects that * use this mixin. Initialize it with tp_contacts_mixin_init(). * * There are no public fields. */ struct _TpContactsMixin { /**/ TpContactsMixinPrivate *priv; }; /* TYPE MACROS */ #define TP_CONTACTS_MIXIN_CLASS_OFFSET_QUARK \ (tp_contacts_mixin_class_get_offset_quark ()) #define TP_CONTACTS_MIXIN_CLASS_OFFSET(o) \ tp_mixin_class_get_offset (o, TP_CONTACTS_MIXIN_CLASS_OFFSET_QUARK) #define TP_CONTACTS_MIXIN_CLASS(o) \ ((TpContactsMixinClass *) tp_mixin_offset_cast (o, \ TP_CONTACTS_MIXIN_CLASS_OFFSET (o))) #define TP_CONTACTS_MIXIN_OFFSET_QUARK (tp_contacts_mixin_get_offset_quark ()) #define TP_CONTACTS_MIXIN_OFFSET(o) \ tp_mixin_instance_get_offset (o, TP_CONTACTS_MIXIN_OFFSET_QUARK) #define TP_CONTACTS_MIXIN(o) \ ((TpContactsMixin *) tp_mixin_offset_cast (o, TP_CONTACTS_MIXIN_OFFSET (o))) GQuark tp_contacts_mixin_class_get_offset_quark (void); GQuark tp_contacts_mixin_get_offset_quark (void); void tp_contacts_mixin_class_init (GObjectClass *obj_cls, glong offset); void tp_contacts_mixin_init (GObject *obj, gsize offset); void tp_contacts_mixin_finalize (GObject *obj); void tp_contacts_mixin_iface_init (gpointer g_iface, gpointer iface_data); void tp_contacts_mixin_add_contact_attributes_iface (GObject *obj, const gchar *interface, TpContactsMixinFillContactAttributesFunc fill_contact_attributes); void tp_contacts_mixin_set_contact_attribute (GHashTable *contact_attributes, TpHandle handle, const gchar *attribute, GValue *value); GHashTable *tp_contacts_mixin_get_contact_attributes (GObject *obj, const GArray *handles, const gchar **interfaces, const gchar **assumed_interfaces, const gchar *sender); G_END_DECLS #endif /* #ifndef __TP_CONTACTS_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/channel-group.c0000644000175000017500000012765714006542652017300 00000000000000/* * channel.c - proxy for a Telepathy channel (Group interface) * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-internal.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_GROUPS #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" /* channel-group.c is ~all deprecated APIs, modern APIs are in * channel-contacts.c. So we allow this module to use deprecated functions. */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS /** * TP_ERRORS_REMOVED_FROM_GROUP: * * #GError domain representing the local user being removed from a channel * with the Group interface. The @code in a #GError with this domain must * be a member of #TpChannelGroupChangeReason. * * This error may be raised on non-Group channels with certain reason codes * if there's no better error code to use (mainly * %TP_CHANNEL_GROUP_CHANGE_REASON_NONE). * * This macro expands to a function call returning a #GQuark. * * Since: 0.7.1 */ GQuark tp_errors_removed_from_group_quark (void) { static GQuark q = 0; if (q == 0) q = g_quark_from_static_string ("tp_errors_removed_from_group_quark"); return q; } static void local_pending_info_free (LocalPendingInfo *info) { g_free (info->message); g_clear_object (&info->actor_contact); g_slice_free (LocalPendingInfo, info); } /** * tp_channel_group_get_self_handle: * @self: a channel * * Return the #TpChannel:group-self-handle property (see the description * of that property for notes on validity). * * Returns: the handle representing the user, or 0 * Since: 0.7.12 * Deprecated: New code should use tp_channel_group_get_self_contact() instead. */ TpHandle tp_channel_group_get_self_handle (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), 0); return self->priv->group_self_handle; } /** * tp_channel_group_get_flags: * @self: a channel * * Return the #TpChannel:group-flags property (see the description * of that property for notes on validity). * * Returns: the group flags, or 0 * Since: 0.7.12 */ TpChannelGroupFlags tp_channel_group_get_flags (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), 0); return self->priv->group_flags; } /** * tp_channel_group_get_members: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been * prepared, return a #TpIntset containing its members. * * If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, * the result may either be a set of members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer none): the members, or %NULL * Since: 0.7.12 * Deprecated: New code should use tp_channel_group_dup_members_contacts() * instead. */ const TpIntset * tp_channel_group_get_members (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->group_members; } /** * tp_channel_group_get_local_pending: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been * prepared, return a #TpIntset containing its local-pending members. * * If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, * the result may either be a set of local-pending members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer none): the local-pending members, or %NULL * Since: 0.7.12 * Deprecated: New code should use tp_channel_group_dup_local_pending_contacts() * instead. */ const TpIntset * tp_channel_group_get_local_pending (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->group_local_pending; } /** * tp_channel_group_get_remote_pending: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_GROUP feature has been * prepared, return a #TpIntset containing its remote-pending members. * * If @self is a group but %TP_CHANNEL_FEATURE_GROUP has not been prepared, * the result may either be a set of remote-pending members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer none): the remote-pending members, or %NULL * Since: 0.7.12 * Deprecated: New code should use * tp_channel_group_dup_remote_pending_contacts() instead. */ const TpIntset * tp_channel_group_get_remote_pending (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->group_remote_pending; } /** * tp_channel_group_get_local_pending_info: * @self: a channel * @local_pending: the handle of a local-pending contact about whom more * information is needed * @actor: (out) (allow-none): either %NULL or a location to return the contact * who requested the change * @reason: (out) (allow-none): either %NULL or a location to return the reason * for the change * @message: (out) (transfer none) (allow-none): either %NULL or a location to * return the user-supplied message * * If @local_pending is actually the handle of a local-pending contact, * write additional information into @actor, @reason and @message and return * %TRUE. The handle and message are not referenced or copied, and can only be * assumed to remain valid until the main loop is re-entered. * * If @local_pending is not the handle of a local-pending contact, * write 0 into @actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into @reason * and "" into @message, and return %FALSE. * * Returns: %TRUE if the contact is in fact local-pending * Since: 0.7.12 * Deprecated: New code should use * tp_channel_group_get_local_pending_contact_info() instead. */ gboolean tp_channel_group_get_local_pending_info (TpChannel *self, TpHandle local_pending, TpHandle *actor, TpChannelGroupChangeReason *reason, const gchar **message) { gboolean ret = FALSE; TpHandle a = 0; TpChannelGroupChangeReason r = TP_CHANNEL_GROUP_CHANGE_REASON_NONE; const gchar *m = ""; g_return_val_if_fail (TP_IS_CHANNEL (self), FALSE); if (self->priv->group_local_pending != NULL) { /* it could conceivably be someone who is local-pending */ ret = tp_intset_is_member (self->priv->group_local_pending, local_pending); if (ret && self->priv->group_local_pending_info != NULL) { /* we might even have information about them */ LocalPendingInfo *info = g_hash_table_lookup ( self->priv->group_local_pending_info, GUINT_TO_POINTER (local_pending)); if (info != NULL) { a = info->actor; r = info->reason; if (info->message != NULL) m = info->message; } /* else we have no info, which means (0, NONE, NULL) */ } } if (actor != NULL) *actor = a; if (message != NULL) *message = m; if (reason != NULL) *reason = r; return ret; } /** * tp_channel_group_get_handle_owner: * @self: a channel * @handle: a handle which is a member of this channel * * Synopsis (see below for further explanation): * * - if @self is not a group or @handle is not a member of this channel, * result is undefined; * - if %TP_CHANNEL_FEATURE_GROUP has not yet been prepared, result is * undefined; * - if @self does not have flags that include * %TP_CHANNEL_GROUP_FLAG_PROPERTIES, * result is undefined; * - if @handle is channel-specific and its globally valid "owner" is known, * return that owner; * - if @handle is channel-specific and its globally valid "owner" is unknown, * return zero; * - if @handle is globally valid, return @handle itself * * Some channels (those with flags that include * %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of * "channel-specific handles". These are handles that only have meaning within * the context of the channel - for instance, in XMPP Multi-User Chat, * participants in a chatroom are identified by an in-room JID consisting * of the JID of the chatroom plus a local nickname. * * Depending on the protocol and configuration, it might be possible to find * out what globally valid handle (i.e. an identifier that you could add to * your contact list) "owns" a channel-specific handle. For instance, in * most XMPP MUC chatrooms, normal users cannot see what global JID * corresponds to an in-room JID, but moderators can. * * This is further complicated by the fact that channels with channel-specific * handles can sometimes have members with globally valid handles (for * instance, if you invite someone to an XMPP MUC using their globally valid * JID, you would expect to see the handle representing that JID in the * Group's remote-pending set). * * This function's result is undefined unless the channel is ready * and its flags include %TP_CHANNEL_GROUP_FLAG_PROPERTIES (an implementation * without extra D-Bus round trips is not possible using the older API). * * Returns: the global handle that owns the given handle, or 0 * Since: 0.7.12 * Deprecated: New code should use tp_channel_group_get_contact_owner() instead. */ TpHandle tp_channel_group_get_handle_owner (TpChannel *self, TpHandle handle) { gpointer key, value; g_return_val_if_fail (TP_IS_CHANNEL (self), 0); if (self->priv->group_handle_owners == NULL) { /* undefined result - pretending it's global is probably as good as * any other behaviour, since we can't know either way */ return handle; } if (g_hash_table_lookup_extended (self->priv->group_handle_owners, GUINT_TO_POINTER (handle), &key, &value)) { /* channel-specific, value is either owner or 0 if unknown */ return GPOINTER_TO_UINT (value); } else { /* either already globally valid, or not a member */ return handle; } } /* This must be called before the local group members lists are created. Until * this is called, the proxy is listening to both MembersChanged and * MembersChangedDetailed, but they are ignored until priv->group_members * exists. If that list is created before one signal is disconnected, the * proxy will react to state changes twice and madness will ensue. */ static void _got_initial_group_flags (TpChannel *self, TpChannelGroupFlags flags) { TpChannelPrivate *priv = self->priv; g_assert (priv->group_flags == 0); g_assert (self->priv->group_members == NULL); priv->group_flags = flags; DEBUG ("Initial GroupFlags: %u", flags); priv->have_group_flags = TRUE; if (flags != 0) g_object_notify ((GObject *) self, "group-flags"); if (tp_proxy_get_invalidated (self) != NULL) { /* Because the proxy has been invalidated, it is not safe to call * tp_proxy_signal_connection_disconnect (below), so just return early */ return; } /* If the channel claims to support MembersChangedDetailed, disconnect from * MembersChanged. Otherwise, disconnect from MembersChangedDetailed in case * it secretly emits it anyway, so we're only listening to one change * notification. */ if (flags & TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED) tp_proxy_signal_connection_disconnect (priv->members_changed_sig); else tp_proxy_signal_connection_disconnect (priv->members_changed_detailed_sig); priv->members_changed_sig = NULL; priv->members_changed_detailed_sig = NULL; } static void tp_channel_got_group_flags_0_16_cb (TpChannel *self, guint flags, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { g_assert (self->priv->group_flags == 0); if (error != NULL) { /* GetGroupFlags() has existed with its current signature since November * 2005. I think it's reasonable to say that if it doesn't work, the * channel is broken. */ _tp_channel_abort_introspection (self, "GetGroupFlags() failed", error); return; } /* If we reach this point, GetAll has already failed... */ if (flags & TP_CHANNEL_GROUP_FLAG_PROPERTIES) { DEBUG ("Treason uncloaked! The channel claims to support Group " "properties, but GetAll didn't work"); flags &= ~TP_CHANNEL_GROUP_FLAG_PROPERTIES; } _got_initial_group_flags (self, flags); _tp_channel_continue_introspection (self); } static void tp_channel_group_self_handle_changed_cb (TpChannel *self, guint self_handle, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { if (self_handle == self->priv->group_self_handle) return; DEBUG ("%p SelfHandle changed to %u", self, self_handle); self->priv->group_self_handle = self_handle; g_object_notify ((GObject *) self, "group-self-handle"); } static void tp_channel_group_self_contact_changed_cb (TpChannel *self, guint self_handle, const gchar *identifier, gpointer user_data, GObject *weak_object) { tp_channel_group_self_handle_changed_cb (self, self_handle, user_data, weak_object); _tp_channel_contacts_self_contact_changed (self, self_handle, identifier); } static void tp_channel_got_self_handle_0_16_cb (TpChannel *self, guint self_handle, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { if (error != NULL) { DEBUG ("%p Group.GetSelfHandle() failed, assuming 0: %s", self, error->message); tp_channel_group_self_handle_changed_cb (self, 0, NULL, NULL); } else { DEBUG ("Initial Group.SelfHandle: %u", self_handle); tp_channel_group_self_handle_changed_cb (self, self_handle, NULL, NULL); } _tp_channel_continue_introspection (self); } static void _tp_channel_get_self_handle_0_16 (TpChannel *self) { tp_cli_channel_interface_group_call_get_self_handle (self, -1, tp_channel_got_self_handle_0_16_cb, NULL, NULL, NULL); } static void _tp_channel_get_group_flags_0_16 (TpChannel *self) { tp_cli_channel_interface_group_call_get_group_flags (self, -1, tp_channel_got_group_flags_0_16_cb, NULL, NULL, NULL); } static void _tp_channel_group_set_one_lp (TpChannel *self, TpHandle handle, TpHandle actor, TpChannelGroupChangeReason reason, const gchar *message) { LocalPendingInfo *info = NULL; g_assert (self->priv->group_local_pending != NULL); tp_intset_add (self->priv->group_local_pending, handle); tp_intset_remove (self->priv->group_members, handle); tp_intset_remove (self->priv->group_remote_pending, handle); if (actor == 0 && reason == TP_CHANNEL_GROUP_CHANGE_REASON_NONE && tp_str_empty (message)) { /* we just don't bother storing informationless local-pending */ if (self->priv->group_local_pending_info != NULL) { g_hash_table_remove (self->priv->group_local_pending_info, GUINT_TO_POINTER (handle)); } return; } if (self->priv->group_local_pending_info == NULL) { self->priv->group_local_pending_info = g_hash_table_new_full ( g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) local_pending_info_free); } else { info = g_hash_table_lookup (self->priv->group_local_pending_info, GUINT_TO_POINTER (handle)); } if (info == NULL) { info = g_slice_new0 (LocalPendingInfo); } else { g_hash_table_steal (self->priv->group_local_pending_info, GUINT_TO_POINTER (handle)); } info->actor = actor; info->reason = reason; g_free (info->message); if (tp_str_empty (message)) info->message = NULL; else info->message = g_strdup (message); g_hash_table_insert (self->priv->group_local_pending_info, GUINT_TO_POINTER (handle), info); } static void _tp_channel_group_set_lp (TpChannel *self, const GPtrArray *info) { guint i; /* should only be called during initialization */ g_assert (self->priv->group_local_pending != NULL); g_assert (self->priv->group_local_pending_info == NULL); tp_intset_clear (self->priv->group_local_pending); /* NULL-safe for ease of use with tp_asv_get_boxed */ if (info == NULL) { return; } for (i = 0; i < info->len; i++) { GValueArray *item = g_ptr_array_index (info, i); TpHandle handle = g_value_get_uint (item->values + 0); TpHandle actor = g_value_get_uint (item->values + 1); TpChannelGroupChangeReason reason = g_value_get_uint ( item->values + 2); const gchar *message = g_value_get_string (item->values + 3); if (handle == 0) { DEBUG ("Ignoring handle 0, claimed to be in local-pending"); continue; } DEBUG ("+L %u, actor=%u, reason=%u, message=%s", handle, actor, reason, message); _tp_channel_group_set_one_lp (self, handle, actor, reason, message); } } static void tp_channel_got_all_members_0_16_cb (TpChannel *self, const GArray *members, const GArray *local_pending, const GArray *remote_pending, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { g_assert (self->priv->group_local_pending == NULL); g_assert (self->priv->group_local_pending_info == NULL); g_assert (self->priv->group_members == NULL); g_assert (self->priv->group_remote_pending == NULL); if (error == NULL) { DEBUG ("%p GetAllMembers returned %u members + %u LP + %u RP", self, members->len, local_pending->len, remote_pending->len); self->priv->group_local_pending = tp_intset_from_array (local_pending); self->priv->group_members = tp_intset_from_array (members); self->priv->group_remote_pending = tp_intset_from_array (remote_pending); if (tp_intset_remove (self->priv->group_members, 0)) { DEBUG ("Ignoring handle 0, claimed to be in group"); } if (tp_intset_remove (self->priv->group_local_pending, 0)) { DEBUG ("Ignoring handle 0, claimed to be in local-pending"); } if (tp_intset_remove (self->priv->group_remote_pending, 0)) { DEBUG ("Ignoring handle 0, claimed to be in remote-pending"); } /* the local-pending info will be filled in with the result of * GetLocalPendingMembersWithInfo, if it succeeds */ } else { DEBUG ("%p GetAllMembers failed, assuming empty: %s", self, error->message); self->priv->group_local_pending = tp_intset_new (); self->priv->group_members = tp_intset_new (); self->priv->group_remote_pending = tp_intset_new (); } g_assert (self->priv->group_local_pending != NULL); g_assert (self->priv->group_members != NULL); g_assert (self->priv->group_remote_pending != NULL); _tp_channel_continue_introspection (self); } static void _tp_channel_get_all_members_0_16 (TpChannel *self) { tp_cli_channel_interface_group_call_get_all_members (self, -1, tp_channel_got_all_members_0_16_cb, NULL, NULL, NULL); } static void tp_channel_glpmwi_0_16_cb (TpChannel *self, const GPtrArray *info, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *object G_GNUC_UNUSED) { /* this should always run after tp_channel_got_all_members_0_16 */ g_assert (self->priv->group_local_pending != NULL); g_assert (self->priv->group_local_pending_info == NULL); if (error == NULL) { DEBUG ("%p GetLocalPendingMembersWithInfo returned %u records", self, info->len); _tp_channel_group_set_lp (self, info); } else { DEBUG ("%p GetLocalPendingMembersWithInfo failed, keeping result of " "GetAllMembers instead: %s", self, error->message); } _tp_channel_continue_introspection (self); } static void _tp_channel_glpmwi_0_16 (TpChannel *self) { tp_cli_channel_interface_group_call_get_local_pending_members_with_info ( self, -1, tp_channel_glpmwi_0_16_cb, NULL, NULL, NULL); } static void _tp_channel_emit_initial_sets (TpChannel *self) { GArray *added, *remote_pending; GArray empty_array = { NULL, 0 }; TpIntsetFastIter iter; TpHandle handle; tp_intset_fast_iter_init (&iter, self->priv->group_local_pending); added = tp_intset_to_array (self->priv->group_members); remote_pending = tp_intset_to_array (self->priv->group_remote_pending); g_signal_emit_by_name (self, "group-members-changed", "", added, &empty_array, &empty_array, remote_pending, 0, 0); while (tp_intset_fast_iter_next (&iter, &handle)) { GArray local_pending = { (gchar *) &handle, 1 }; TpHandle actor; TpChannelGroupChangeReason reason; const gchar *message; tp_channel_group_get_local_pending_info (self, handle, &actor, &reason, &message); g_signal_emit_by_name (self, "group-members-changed", message, &empty_array, &empty_array, &local_pending, &empty_array, actor, reason); } g_array_unref (added); g_array_unref (remote_pending); _tp_channel_continue_introspection (self); } static void tp_channel_got_group_properties_cb (TpProxy *proxy, GHashTable *asv, const GError *error, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { TpChannel *self = TP_CHANNEL (proxy); static GType au_type = 0; if (G_UNLIKELY (au_type == 0)) { au_type = dbus_g_type_get_collection ("GArray", G_TYPE_UINT); } if (error != NULL) { DEBUG ("Error getting group properties, falling back to 0.16 API: %s", error->message); } else if ((tp_asv_get_uint32 (asv, "GroupFlags", NULL) & TP_CHANNEL_GROUP_FLAG_PROPERTIES) == 0) { DEBUG ("Got group properties, but no Properties flag: assuming a " "broken implementation and falling back to 0.16 API"); } else { GHashTable *table; GArray *arr; DEBUG ("Received %u group properties", g_hash_table_size (asv)); _got_initial_group_flags (self, tp_asv_get_uint32 (asv, "GroupFlags", NULL)); tp_channel_group_self_handle_changed_cb (self, tp_asv_get_uint32 (asv, "SelfHandle", NULL), NULL, NULL); g_assert (self->priv->group_members == NULL); g_assert (self->priv->group_remote_pending == NULL); arr = tp_asv_get_boxed (asv, "Members", au_type); if (arr == NULL) self->priv->group_members = tp_intset_new (); else self->priv->group_members = tp_intset_from_array (arr); if (tp_intset_remove (self->priv->group_members, 0)) { DEBUG ("Ignoring handle 0, claimed to be in group"); } arr = tp_asv_get_boxed (asv, "RemotePendingMembers", au_type); if (arr == NULL) self->priv->group_remote_pending = tp_intset_new (); else self->priv->group_remote_pending = tp_intset_from_array (arr); if (tp_intset_remove (self->priv->group_remote_pending, 0)) { DEBUG ("Ignoring handle 0, claimed to be in remote-pending"); } g_assert (self->priv->group_local_pending == NULL); g_assert (self->priv->group_local_pending_info == NULL); self->priv->group_local_pending = tp_intset_new (); /* this is NULL-safe with respect to the array */ _tp_channel_group_set_lp (self, tp_asv_get_boxed (asv, "LocalPendingMembers", TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST)); table = tp_asv_get_boxed (asv, "HandleOwners", TP_HASH_TYPE_HANDLE_OWNER_MAP); self->priv->group_handle_owners = g_hash_table_new (g_direct_hash, g_direct_equal); if (table != NULL) tp_g_hash_table_update (self->priv->group_handle_owners, table, NULL, NULL); table = tp_asv_get_boxed (asv, "MemberIdentifiers", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP); /* If CM implements MemberIdentifiers property, assume it also emits * SelfContactChanged and HandleOwnersChangedDetailed */ if (table != NULL) { tp_proxy_signal_connection_disconnect ( self->priv->self_handle_changed_sig); tp_proxy_signal_connection_disconnect ( self->priv->handle_owners_changed_sig); } else { tp_proxy_signal_connection_disconnect ( self->priv->self_contact_changed_sig); tp_proxy_signal_connection_disconnect ( self->priv->handle_owners_changed_detailed_sig); } self->priv->self_handle_changed_sig = NULL; self->priv->self_contact_changed_sig = NULL; self->priv->handle_owners_changed_sig = NULL; self->priv->handle_owners_changed_detailed_sig = NULL; _tp_channel_contacts_group_init (self, table); goto OUT; } /* Failure case: fall back. This is quite annoying, as we need to combine: * * - GetGroupFlags * - GetAllMembers * - GetLocalPendingMembersWithInfo * * Channel-specific handles can't really have a sane client API (without * lots of silly round-trips) unless the CM implements the HandleOwners * property, so I intend to ignore this in the fallback case. */ g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_group_flags_0_16); g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_self_handle_0_16); g_queue_push_tail (self->priv->introspect_needed, _tp_channel_get_all_members_0_16); g_queue_push_tail (self->priv->introspect_needed, _tp_channel_glpmwi_0_16); self->priv->cm_too_old_for_contacts = TRUE; OUT: g_queue_push_tail (self->priv->introspect_needed, _tp_channel_emit_initial_sets); _tp_channel_continue_introspection (self); } /* * If the @group_remove_error is derived from a TpChannelGroupChangeReason, * attempt to rewrite it into a TpError. */ static void _tp_channel_group_improve_remove_error (TpChannel *self, TpHandle actor) { GError *error = self->priv->group_remove_error; if (error == NULL || error->domain != TP_ERRORS_REMOVED_FROM_GROUP) return; switch (error->code) { case TP_CHANNEL_GROUP_CHANGE_REASON_NONE: if (actor == self->priv->group_self_handle || actor == tp_connection_get_self_handle (self->priv->connection)) { error->code = TP_ERROR_CANCELLED; } else { error->code = TP_ERROR_TERMINATED; } break; case TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE: error->code = TP_ERROR_OFFLINE; break; case TP_CHANNEL_GROUP_CHANGE_REASON_KICKED: error->code = TP_ERROR_CHANNEL_KICKED; break; case TP_CHANNEL_GROUP_CHANGE_REASON_BUSY: error->code = TP_ERROR_BUSY; break; case TP_CHANNEL_GROUP_CHANGE_REASON_INVITED: DEBUG ("%s: Channel_Group_Change_Reason_Invited makes no sense as a " "removal reason!", tp_proxy_get_object_path (self)); error->domain = TP_DBUS_ERRORS; error->code = TP_DBUS_ERROR_INCONSISTENT; return; case TP_CHANNEL_GROUP_CHANGE_REASON_BANNED: error->code = TP_ERROR_CHANNEL_BANNED; break; case TP_CHANNEL_GROUP_CHANGE_REASON_ERROR: /* hopefully all CMs that use this will also give us an error detail, * but if they didn't, or gave us one we didn't understand... */ error->code = TP_ERROR_NOT_AVAILABLE; break; case TP_CHANNEL_GROUP_CHANGE_REASON_INVALID_CONTACT: error->code = TP_ERROR_DOES_NOT_EXIST; break; case TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER: error->code = TP_ERROR_NO_ANSWER; break; /* TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED shouldn't be the last error * seen in the channel - we'll get removed again with a real reason, * later, so there's no point in doing anything special with this one */ case TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED: error->code = TP_ERROR_PERMISSION_DENIED; break; case TP_CHANNEL_GROUP_CHANGE_REASON_SEPARATED: DEBUG ("%s: Channel_Group_Change_Reason_Separated makes no sense as a " "removal reason!", tp_proxy_get_object_path (self)); error->domain = TP_DBUS_ERRORS; error->code = TP_DBUS_ERROR_INCONSISTENT; return; /* all values up to and including Separated have been checked */ default: /* We don't understand this reason code, so keeping the domain and code * the same (i.e. using TP_ERRORS_REMOVED_FROM_GROUP) is no worse than * anything else we could do. */ return; } /* If we changed the code we also need to change the domain; if not, we did * an early return, so we'll never reach this */ error->domain = TP_ERROR; } static void handle_members_changed (TpChannel *self, const gchar *message, const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, guint actor, guint reason, GHashTable *details) { guint i; if (self->priv->group_members == NULL) return; g_assert (self->priv->group_local_pending != NULL); g_assert (self->priv->group_remote_pending != NULL); for (i = 0; i < added->len; i++) { TpHandle handle = g_array_index (added, guint, i); DEBUG ("+++ contact#%u", handle); if (handle == 0) { DEBUG ("handle 0 shouldn't be in MembersChanged, ignoring"); continue; } tp_intset_add (self->priv->group_members, handle); tp_intset_remove (self->priv->group_local_pending, handle); tp_intset_remove (self->priv->group_remote_pending, handle); } for (i = 0; i < local_pending->len; i++) { TpHandle handle = g_array_index (local_pending, guint, i); DEBUG ("+LP contact#%u", handle); if (handle == 0) { DEBUG ("handle 0 shouldn't be in MembersChanged, ignoring"); continue; } /* Special-case renaming a local-pending contact, if the * signal is spec-compliant. Keep the old actor/reason/message in * this case */ if (reason == TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED && added->len == 0 && local_pending->len == 1 && remote_pending->len == 0 && removed->len == 1 && self->priv->group_local_pending_info != NULL) { TpHandle old = g_array_index (removed, guint, 0); LocalPendingInfo *info = g_hash_table_lookup ( self->priv->group_local_pending_info, GUINT_TO_POINTER (old)); if (info != NULL) { _tp_channel_group_set_one_lp (self, handle, info->actor, info->reason, info->message); continue; } } /* not reached if the Renamed special case occurred */ _tp_channel_group_set_one_lp (self, handle, actor, reason, message); } for (i = 0; i < remote_pending->len; i++) { TpHandle handle = g_array_index (remote_pending, guint, i); DEBUG ("+RP contact#%u", handle); if (handle == 0) { DEBUG ("handle 0 shouldn't be in MembersChanged, ignoring"); continue; } tp_intset_add (self->priv->group_remote_pending, handle); tp_intset_remove (self->priv->group_members, handle); tp_intset_remove (self->priv->group_local_pending, handle); } for (i = 0; i < removed->len; i++) { TpHandle handle = g_array_index (removed, guint, i); DEBUG ("--- contact#%u", handle); if (handle == 0) { DEBUG ("handle 0 shouldn't be in MembersChanged, ignoring"); continue; } if (self->priv->group_local_pending_info != NULL) g_hash_table_remove (self->priv->group_local_pending_info, GUINT_TO_POINTER (handle)); tp_intset_remove (self->priv->group_members, handle); tp_intset_remove (self->priv->group_local_pending, handle); tp_intset_remove (self->priv->group_remote_pending, handle); if (handle == self->priv->group_self_handle || handle == tp_connection_get_self_handle (self->priv->connection)) { const gchar *error_detail = tp_asv_get_string (details, "error"); const gchar *debug_message = tp_asv_get_string (details, "debug-message"); if (debug_message == NULL && !tp_str_empty (message)) debug_message = message; if (debug_message == NULL && error_detail != NULL) debug_message = error_detail; if (debug_message == NULL) debug_message = "(no message provided)"; if (self->priv->group_remove_error != NULL) g_clear_error (&self->priv->group_remove_error); if (error_detail != NULL) { /* CM specified a D-Bus error name */ tp_proxy_dbus_error_to_gerror (self, error_detail, debug_message == NULL || debug_message[0] == '\0' ? error_detail : debug_message, &self->priv->group_remove_error); /* ... but if we don't know anything about that D-Bus error * name, we can still do better by using RemovedFromGroup */ if (g_error_matches (self->priv->group_remove_error, TP_DBUS_ERRORS, TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR)) { self->priv->group_remove_error->domain = TP_ERRORS_REMOVED_FROM_GROUP; self->priv->group_remove_error->code = reason; _tp_channel_group_improve_remove_error (self, actor); } } else { /* Use our separate error domain */ g_set_error_literal (&self->priv->group_remove_error, TP_ERRORS_REMOVED_FROM_GROUP, reason, debug_message); _tp_channel_group_improve_remove_error (self, actor); } } } g_signal_emit_by_name (self, "group-members-changed", message, added, removed, local_pending, remote_pending, actor, reason); g_signal_emit_by_name (self, "group-members-changed-detailed", added, removed, local_pending, remote_pending, details); _tp_channel_contacts_members_changed (self, added, removed, local_pending, remote_pending, actor, details); } static void tp_channel_group_members_changed_cb (TpChannel *self, const gchar *message, const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, guint actor, guint reason, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); DEBUG ("%p MembersChanged: added %u, removed %u, " "moved %u to LP and %u to RP, actor %u, reason %u, message %s", self, added->len, removed->len, local_pending->len, remote_pending->len, actor, reason, message); if (actor != 0) { g_hash_table_insert (details, "actor", tp_g_value_slice_new_uint (actor)); } if (reason != TP_CHANNEL_GROUP_CHANGE_REASON_NONE) { g_hash_table_insert (details, "change-reason", tp_g_value_slice_new_uint (reason)); } if (*message != '\0') { g_hash_table_insert (details, "message", tp_g_value_slice_new_string (message)); } handle_members_changed (self, message, added, removed, local_pending, remote_pending, actor, reason, details); g_hash_table_unref (details); } static void tp_channel_group_members_changed_detailed_cb (TpChannel *self, const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, GHashTable *details, gpointer unused G_GNUC_UNUSED, GObject *weak_obj G_GNUC_UNUSED) { const gchar *message; guint actor; guint reason; DEBUG ("%p MembersChangedDetailed: added %u, removed %u, " "moved %u to LP and %u to RP", self, added->len, removed->len, local_pending->len, remote_pending->len); actor = tp_asv_get_uint32 (details, "actor", NULL); reason = tp_asv_get_uint32 (details, "change-reason", NULL); message = tp_asv_get_string (details, "message"); if (message == NULL) message = ""; handle_members_changed (self, message, added, removed, local_pending, remote_pending, actor, reason, details); } static void tp_channel_handle_owners_changed_cb (TpChannel *self, GHashTable *added, const GArray *removed, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { guint i; /* ignore the signal if we don't have the initial set yet */ if (self->priv->group_handle_owners == NULL) return; tp_g_hash_table_update (self->priv->group_handle_owners, added, NULL, NULL); for (i = 0; i < removed->len; i++) { g_hash_table_remove (self->priv->group_handle_owners, GUINT_TO_POINTER (g_array_index (removed, guint, i))); } } static void tp_channel_handle_owners_changed_detailed_cb (TpChannel *self, GHashTable *added, const GArray *removed, GHashTable *identifiers, gpointer user_data, GObject *weak_object) { tp_channel_handle_owners_changed_cb (self, added, removed, user_data, weak_object); _tp_channel_contacts_handle_owners_changed (self, added, removed, identifiers); } #define IMMUTABLE_FLAGS \ (TP_CHANNEL_GROUP_FLAG_PROPERTIES | \ TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED) static void tp_channel_group_flags_changed_cb (TpChannel *self, guint added, guint removed, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { if (self->priv->have_group_flags) { DEBUG ("%p GroupFlagsChanged: +%u -%u", self, added, removed); added &= ~(self->priv->group_flags); removed &= self->priv->group_flags; DEBUG ("%p GroupFlagsChanged (after filtering): +%u -%u", self, added, removed); if ((added & IMMUTABLE_FLAGS) || (removed & IMMUTABLE_FLAGS)) { GError *e = g_error_new (TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "CM is broken: it changed the Properties/" "Members_Changed_Detailed flags on an existing group channel " "(offending changes: added=%u, removed=%u)", added & IMMUTABLE_FLAGS, removed & IMMUTABLE_FLAGS); tp_proxy_invalidate ((TpProxy *) self, e); g_error_free (e); return; } self->priv->group_flags |= added; self->priv->group_flags &= ~removed; if (added != 0 || removed != 0) { g_object_notify ((GObject *) self, "group-flags"); g_signal_emit_by_name (self, "group-flags-changed", added, removed); } } } #undef IMMUTABLE_FLAGS void _tp_channel_get_group_properties (TpChannel *self) { TpChannelPrivate *priv = self->priv; TpProxySignalConnection *sc; GError *error = NULL; if (!tp_proxy_has_interface_by_id (self, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)) { _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CHANNEL_FEATURE_GROUP, FALSE); DEBUG ("%p: not a Group, continuing", self); _tp_channel_continue_introspection (self); return; } DEBUG ("%p", self); /* If this callback has been called, 'self' has not been invalidated. And we * just checked above that the proxy has the Group interface. So, connecting * to these signals must succeed. */ #define DIE(sig) \ { \ CRITICAL ("couldn't connect to " sig ": %s", error->message); \ g_assert_not_reached (); \ g_error_free (error); \ return; \ } priv->members_changed_sig = tp_cli_channel_interface_group_connect_to_members_changed (self, tp_channel_group_members_changed_cb, NULL, NULL, NULL, &error); if (priv->members_changed_sig == NULL) DIE ("MembersChanged"); priv->members_changed_detailed_sig = tp_cli_channel_interface_group_connect_to_members_changed_detailed (self, tp_channel_group_members_changed_detailed_cb, NULL, NULL, NULL, &error); if (priv->members_changed_detailed_sig == NULL) DIE ("MembersChangedDetailed"); sc = tp_cli_channel_interface_group_connect_to_group_flags_changed (self, tp_channel_group_flags_changed_cb, NULL, NULL, NULL, &error); if (sc == NULL) DIE ("GroupFlagsChanged"); priv->self_handle_changed_sig = tp_cli_channel_interface_group_connect_to_self_handle_changed (self, tp_channel_group_self_handle_changed_cb, NULL, NULL, NULL, &error); if (priv->self_handle_changed_sig == NULL) DIE ("SelfHandleChanged"); priv->self_contact_changed_sig = tp_cli_channel_interface_group_connect_to_self_contact_changed (self, tp_channel_group_self_contact_changed_cb, NULL, NULL, NULL, &error); if (priv->self_contact_changed_sig == NULL) DIE ("SelfContactChanged"); priv->handle_owners_changed_sig = tp_cli_channel_interface_group_connect_to_handle_owners_changed (self, tp_channel_handle_owners_changed_cb, NULL, NULL, NULL, &error); if (priv->handle_owners_changed_sig == NULL) DIE ("HandleOwnersChanged"); /* First try the 0.17 API (properties). If this fails we'll fall back */ tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CHANNEL_INTERFACE_GROUP, tp_channel_got_group_properties_cb, NULL, NULL, NULL); priv->handle_owners_changed_detailed_sig = tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed ( self, tp_channel_handle_owners_changed_detailed_cb, NULL, NULL, NULL, &error); if (priv->handle_owners_changed_detailed_sig == NULL) DIE ("HandleOwnersChangedDetailed"); } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/telepathy-glib/base-call-channel.c0000644000175000017500000013614012652510705017751 00000000000000/* * base-call-channel.c - Source for TpBaseCallChannel * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-call-channel * @title: TpBaseCallChannel * @short_description: base class for #TpSvcChannelTypeCall implementations * @see_also: #TpSvcChannelTypeCall, #TpBaseCallContent and #TpBaseCallStream * * This base class makes it easier to write #TpSvcChannelTypeCall * implementations by implementing its properties, and some of its methods. * * Subclasses should fill in #TpBaseCallChannelClass.accept, * #TpBaseCallChannelClass.add_content and #TpBaseCallChannelClass.hangup * virtual function. * * Since: 0.17.5 */ /** * TpBaseCallChannel: * * A base class for call channel implementations * * Since: 0.17.5 */ /** * TpBaseCallChannelClass: * @set_ringing: Notify members that client is ringing. * @set_queued: Notify members that call is queued. * @accept: accept the call. Note that #TpBaseMediaCallChannel subclasses should * not override this virtual method, but #TpBaseMediaCallChannelClass.accept * instead. * @add_content: add content to the call. Implementation must call * tp_base_call_channel_add_content(). Can be %NULL if * #TpBaseCallChannel:mutable-contents is %FALSE. * @hangup: hangup the call. * * The class structure for #TpBaseCallChannel * * Since: 0.17.5 */ /** * TpBaseCallChannelVoidFunc: * @self: a #TpBaseCallChannel * * Signature of an implementation of #TpBaseCallChannelClass.set_ringing, * #TpBaseCallChannelClass.set_queued and #TpBaseCallChannelClass.accept. * * Since: 0.17.5 */ /** * TpBaseCallChannelAddContentFunc: * @self: a #TpBaseCallChannel * @name: the name for the new content * @media: a #TpMediaStreamType * @initial_direction: the desired initial direction of streams in the new * content * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallChannelClass.add_content. * * Returns: a borrowed #TpBaseCallContent. * Since: 0.17.5 */ /** * TpBaseCallChannelHangupFunc: * @self: a #TpBaseCallChannel * @reason: the #TpCallStateChangeReason of the change * @detailed_reason: a more specific reason for the call hangup, if one is * available, or an empty string otherwise. * @message: a human-readable message to be sent to the remote contact(s). * * Signature of an implementation of #TpBaseCallChannelClass.hangup. * * Since: 0.17.5 */ #include "config.h" #include "base-call-channel.h" #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-content.h" #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/base-connection.h" #include "telepathy-glib/channel-iface.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/enums.h" #include "telepathy-glib/exportable-channel.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-channel.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/util.h" static void call_iface_init (gpointer, gpointer); static void dtmf_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseCallChannel, tp_base_call_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_CALL, call_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DTMF, dtmf_iface_init) ) /* properties */ enum { PROP_INITIAL_AUDIO = 1, PROP_INITIAL_VIDEO, PROP_INITIAL_AUDIO_NAME, PROP_INITIAL_VIDEO_NAME, PROP_INITIAL_TRANSPORT, PROP_MUTABLE_CONTENTS, PROP_HARDWARE_STREAMING, PROP_CONTENTS, PROP_CALL_STATE, PROP_CALL_FLAGS, PROP_CALL_STATE_DETAILS, PROP_CALL_STATE_REASON, PROP_CALL_MEMBERS, PROP_MEMBER_IDENTIFIERS, PROP_INITIAL_TONES, LAST_PROPERTY }; /* private structure */ struct _TpBaseCallChannelPrivate { /* GList of reffed TpBaseCallContent */ GList *contents; gboolean mutable_contents; TpStreamTransportType initial_transport; gboolean initial_audio; gboolean initial_video; gchar *initial_audio_name; gchar *initial_video_name; gchar *initial_tones; gboolean locally_accepted; gboolean accepted; TpCallState state; TpCallFlags flags; GHashTable *details; GValueArray *reason; /* TpHandle => TpCallMemberFlags */ GHashTable *call_members; }; static void tp_base_call_channel_accept_real (TpBaseCallChannel *self); GHashTable * _tp_base_call_dup_member_identifiers (TpBaseConnection *conn, GHashTable *source) { GHashTable *identifiers; TpHandleRepoIface *contact_repo; GHashTableIter iter; gpointer key; identifiers = g_hash_table_new (NULL, NULL); contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); g_hash_table_iter_init (&iter, source); while (g_hash_table_iter_next (&iter, &key, NULL)) { TpHandle handle = GPOINTER_TO_UINT (key); const gchar *id = tp_handle_inspect (contact_repo, handle); g_hash_table_insert (identifiers, key, (gpointer) id); } return identifiers; } GValueArray * _tp_base_call_state_reason_new (TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { return tp_value_array_build (4, G_TYPE_UINT, actor_handle, G_TYPE_UINT, reason, G_TYPE_STRING, dbus_reason != NULL ? dbus_reason : "", G_TYPE_STRING, message != NULL ? message : "", G_TYPE_INVALID); } static void tp_base_call_channel_init (TpBaseCallChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CALL_CHANNEL, TpBaseCallChannelPrivate); self->priv->reason = _tp_base_call_state_reason_new (0, 0, "", ""); self->priv->details = tp_asv_new (NULL, NULL); self->priv->call_members = g_hash_table_new (g_direct_hash, g_direct_equal); } static void tp_base_call_channel_constructed (GObject *obj) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (obj); TpBaseChannel *base = TP_BASE_CHANNEL (self); if (G_OBJECT_CLASS (tp_base_call_channel_parent_class)->constructed != NULL) G_OBJECT_CLASS (tp_base_call_channel_parent_class)->constructed (obj); if (tp_base_channel_is_requested (base)) { tp_base_call_channel_set_state (self, TP_CALL_STATE_PENDING_INITIATOR, tp_base_channel_get_initiator (base), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User requested channel"); } else { tp_base_call_channel_set_state (self, TP_CALL_STATE_INITIALISING, tp_base_channel_get_initiator (base), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "Incoming call"); } } static void content_list_destroy (GList *contents) { g_list_foreach (contents, (GFunc) _tp_base_call_content_deinit, NULL); g_list_free_full (contents, g_object_unref); } static void tp_base_call_channel_dispose (GObject *object) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object); tp_clear_pointer (&self->priv->contents, content_list_destroy); tp_clear_pointer (&self->priv->call_members, g_hash_table_unref); if (G_OBJECT_CLASS (tp_base_call_channel_parent_class)->dispose) G_OBJECT_CLASS (tp_base_call_channel_parent_class)->dispose (object); } static void tp_base_call_channel_finalize (GObject *object) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object); g_hash_table_unref (self->priv->details); tp_value_array_free (self->priv->reason); g_free (self->priv->initial_audio_name); g_free (self->priv->initial_video_name); g_free (self->priv->initial_tones); G_OBJECT_CLASS (tp_base_call_channel_parent_class)->finalize (object); } static void tp_base_call_channel_close (TpBaseChannel *base) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (base); DEBUG ("Closing call channel %s", tp_base_channel_get_object_path (base)); /* shutdown all our contents */ tp_clear_pointer (&self->priv->contents, content_list_destroy); tp_base_channel_destroyed (base); } static void tp_base_call_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object); switch (property_id) { case PROP_INITIAL_AUDIO: g_value_set_boolean (value, self->priv->initial_audio); break; case PROP_INITIAL_VIDEO: g_value_set_boolean (value, self->priv->initial_video); break; case PROP_INITIAL_AUDIO_NAME: g_value_set_string (value, self->priv->initial_audio_name); break; case PROP_INITIAL_VIDEO_NAME: g_value_set_string (value, self->priv->initial_video_name); break; case PROP_INITIAL_TRANSPORT: g_value_set_uint (value, self->priv->initial_transport); break; case PROP_MUTABLE_CONTENTS: g_value_set_boolean (value, self->priv->mutable_contents); break; case PROP_CONTENTS: { GPtrArray *arr = g_ptr_array_sized_new (2); GList *l; for (l = self->priv->contents; l != NULL; l = g_list_next (l)) { TpBaseCallContent *c = TP_BASE_CALL_CONTENT (l->data); g_ptr_array_add (arr, g_strdup (tp_base_call_content_get_object_path (c))); } g_value_take_boxed (value, arr); break; } case PROP_HARDWARE_STREAMING: g_value_set_boolean (value, FALSE); break; case PROP_CALL_STATE: g_value_set_uint (value, self->priv->state); break; case PROP_CALL_FLAGS: g_value_set_uint (value, self->priv->flags); break; case PROP_CALL_STATE_DETAILS: g_value_set_boxed (value, self->priv->details); break; case PROP_CALL_STATE_REASON: g_value_set_boxed (value, self->priv->reason); break; case PROP_CALL_MEMBERS: g_value_set_boxed (value, self->priv->call_members); break; case PROP_MEMBER_IDENTIFIERS: { GHashTable *identifiers; identifiers = _tp_base_call_dup_member_identifiers ( tp_base_channel_get_connection ((TpBaseChannel *) self), self->priv->call_members); g_value_take_boxed (value, identifiers); break; } case PROP_INITIAL_TONES: g_value_set_string (value, self->priv->initial_tones); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object); switch (property_id) { case PROP_INITIAL_AUDIO: self->priv->initial_audio = g_value_get_boolean (value); break; case PROP_INITIAL_VIDEO: self->priv->initial_video = g_value_get_boolean (value); break; case PROP_INITIAL_AUDIO_NAME: self->priv->initial_audio_name = g_value_dup_string (value); break; case PROP_INITIAL_VIDEO_NAME: self->priv->initial_video_name = g_value_dup_string (value); break; case PROP_INITIAL_TRANSPORT: self->priv->initial_transport = g_value_get_uint (value); break; case PROP_MUTABLE_CONTENTS: self->priv->mutable_contents = g_value_get_boolean (value); break; case PROP_INITIAL_TONES: self->priv->initial_tones = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_channel_fill_immutable_properties ( TpBaseChannel *chan, GHashTable *properties) { TP_BASE_CHANNEL_CLASS (tp_base_call_channel_parent_class) ->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_CALL, "InitialTransport", TP_IFACE_CHANNEL_TYPE_CALL, "InitialAudio", TP_IFACE_CHANNEL_TYPE_CALL, "InitialVideo", TP_IFACE_CHANNEL_TYPE_CALL, "InitialAudioName", TP_IFACE_CHANNEL_TYPE_CALL, "InitialVideoName", TP_IFACE_CHANNEL_TYPE_CALL, "MutableContents", TP_IFACE_CHANNEL_TYPE_CALL, "HardwareStreaming", TP_IFACE_CHANNEL_INTERFACE_DTMF, "InitialTones", NULL); } static void tp_base_call_channel_class_init (TpBaseCallChannelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl call_props[] = { { "Contents", "contents", NULL }, { "CallStateDetails", "call-state-details", NULL }, { "CallState", "call-state", NULL }, { "CallFlags", "call-flags", NULL }, { "CallStateReason", "call-state-reason", NULL }, { "HardwareStreaming", "hardware-streaming", NULL }, { "CallMembers", "call-members", NULL }, { "MemberIdentifiers", "member-identifiers", NULL }, { "InitialTransport", "initial-transport", NULL }, { "InitialAudio", "initial-audio", NULL }, { "InitialVideo", "initial-video", NULL }, { "InitialAudioName", "initial-audio-name", NULL }, { "InitialVideoName", "initial-video-name", NULL }, { "MutableContents", "mutable-contents", NULL }, { NULL }, }; static TpDBusPropertiesMixinPropImpl dtmf_props[] = { { "InitialTones", "initial-tones", NULL }, { NULL }, }; g_type_class_add_private (klass, sizeof (TpBaseCallChannelPrivate)); object_class->constructed = tp_base_call_channel_constructed; object_class->get_property = tp_base_call_channel_get_property; object_class->set_property = tp_base_call_channel_set_property; object_class->dispose = tp_base_call_channel_dispose; object_class->finalize = tp_base_call_channel_finalize; base_channel_class->channel_type = TP_IFACE_CHANNEL_TYPE_CALL; base_channel_class->fill_immutable_properties = tp_base_call_channel_fill_immutable_properties; base_channel_class->close = tp_base_call_channel_close; klass->accept = tp_base_call_channel_accept_real; /** * TpBaseCallChannel:initial-audio: * * If set to %TRUE on a requested channel, subclass should immediately attempt * to establish an audio stream to the remote contact. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("initial-audio", "InitialAudio", "Whether the channel initially contained an audio stream", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_AUDIO, param_spec); /** * TpBaseCallChannel:initial-video: * * If set to %TRUE on a requested channel, subclass should immediately attempt * to establish a video stream to the remote contact. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("initial-video", "InitialVideo", "Whether the channel initially contained an video stream", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_VIDEO, param_spec); /** * TpBaseCallChannel:initial-audio-name: * * Name to use to create the audio #TpBaseCallContent if * #TpBaseCallChannel:initial-audio is set to %TRUE. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("initial-audio-name", "InitialAudioName", "Name for the initial audio content", "audio", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_AUDIO_NAME, param_spec); /** * TpBaseCallChannel:initial-video-name: * * Name to use to create the video #TpBaseCallContent if * #TpBaseCallChannel:initial-video is set to %TRUE. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("initial-video-name", "InitialVideoName", "Name for the initial video content", "video", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_VIDEO_NAME, param_spec); /** * TpBaseCallChannel:initial-transport: * * If set to %TRUE on a requested channel, this indicates the transport that * should be used for this call. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("initial-transport", "InitialTransport", "The transport that should be used for this call", 0, G_MAXUINT, TP_STREAM_TRANSPORT_TYPE_UNKNOWN, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_TRANSPORT, param_spec); /** * TpBaseCallChannel:mutable-contents: * * Indicate to clients whether or not they can add/remove contents. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("mutable-contents", "MutableContents", "Whether the set of streams on this channel are mutable once requested", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MUTABLE_CONTENTS, param_spec); /** * TpBaseCallChannel:contents: * * #GPtrArray of object-paths of the #TpBaseCallContent objects. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("contents", "Contents", "The contents of the channel", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTENTS, param_spec); /** * TpBaseCallChannel:hardware-streaming: * * Indicate to clients whether or not this Connection Manager has hardware * streaming. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("hardware-streaming", "HardwareStreaming", "True if all the streaming is done by hardware", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HARDWARE_STREAMING, param_spec); /** * TpBaseCallChannel:call-state: * * The state of this call. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("call-state", "CallState", "The status of the call", 0, G_MAXUINT, TP_CALL_STATE_UNKNOWN, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_STATE, param_spec); /** * TpBaseCallChannel:call-flags: * * The flags of this call. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("call-flags", "CallFlags", "Flags representing the status of the call", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_FLAGS, param_spec); /** * TpBaseCallChannel:call-state-reason: * * The reason for last call state change. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("call-state-reason", "CallStateReason", "The reason why the call is in the current state", TP_STRUCT_TYPE_CALL_STATE_REASON, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_STATE_REASON, param_spec); /** * TpBaseCallChannel:call-state-details: * * Details on the call state. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("call-state-details", "CallStateDetails", "The reason why the call is in the current state", TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_STATE_DETAILS, param_spec); /** * TpBaseCallChannel:call-members: * * #GHashTable mapping #TpHandle of each call member to their * #TpCallMemberFlags. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("call-members", "CallMembers", "The members", TP_HASH_TYPE_CALL_MEMBER_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_MEMBERS, param_spec); /** * TpBaseCallChannel:member-identifiers: * * #GHashTable mapping #TpHandle of each call member to their identifiers. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("member-identifiers", "MemberIdentifiers", "The members identifiers", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MEMBER_IDENTIFIERS, param_spec); /** * TpBaseCallChannel:initial-tones: * * DTMF Tones to be played on the channel created. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("initial-tones", "InitialTones", "DTMF Tones to be played on the channel created" " by InitialAudio", "", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_TONES, param_spec); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_TYPE_CALL, tp_dbus_properties_mixin_getter_gobject_properties, NULL, call_props); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_DTMF, tp_dbus_properties_mixin_getter_gobject_properties, NULL, dtmf_props); } static const char * call_state_to_string (TpCallState state) { const char *state_str = "INEXISTANT"; switch (state) { case TP_CALL_STATE_UNKNOWN: state_str = "UNKNOWN"; break; case TP_CALL_STATE_PENDING_INITIATOR: state_str = "PENDING_INITIATOR"; break; case TP_CALL_STATE_INITIALISING: state_str = "INITIALISING"; break; case TP_CALL_STATE_INITIALISED: state_str = "INITIALISED"; break; case TP_CALL_STATE_ACCEPTED: state_str = "ACCEPTED"; break; case TP_CALL_STATE_ACTIVE: state_str = "ACTIVE"; break; case TP_CALL_STATE_ENDED: state_str = "ENDED"; break; } return state_str; } static void tp_base_call_channel_flags_changed (TpBaseCallChannel *self, guint actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { tp_value_array_free (self->priv->reason); self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) { tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state, self->priv->flags, self->priv->reason, self->priv->details); } } /** * tp_base_call_channel_set_state: * @self: a #TpBaseCallChannel * @state: the new #TpCallState * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Changes the call state and emit StateChanged signal with the new state. * * Since: 0.17.5 */ void tp_base_call_channel_set_state (TpBaseCallChannel *self, TpCallState state, guint actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { TpCallState old_state; g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); old_state = self->priv->state; self->priv->state = state; tp_value_array_free (self->priv->reason); self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); if (old_state == state) return; if (self->priv->state != TP_CALL_STATE_INITIALISED) self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_RINGING; if (self->priv->state != TP_CALL_STATE_INITIALISING && self->priv->state != TP_CALL_STATE_INITIALISED) self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_QUEUED; if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) { tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state, self->priv->flags, self->priv->reason, self->priv->details); } DEBUG ("state changed from %s => %s", call_state_to_string (old_state), call_state_to_string (self->priv->state)); /* Move from INITIALISING to INITIALISED if we are already connected */ if (self->priv->state == TP_CALL_STATE_INITIALISING && _tp_base_call_channel_is_connected (self)) { self->priv->state = TP_CALL_STATE_INITIALISED; if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) { tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state, self->priv->flags, self->priv->reason, self->priv->details); } DEBUG ("state changed from %s => %s (bumped)", call_state_to_string (TP_CALL_STATE_INITIALISING), call_state_to_string (self->priv->state)); } /* Move from ACCEPTED to ACTIVE if we are already connected */ if (self->priv->state == TP_CALL_STATE_ACCEPTED && _tp_base_call_channel_is_connected (self)) { self->priv->state = TP_CALL_STATE_ACTIVE; if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) { tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state, self->priv->flags, self->priv->reason, self->priv->details); } DEBUG ("state changed from %s => %s (bumped)", call_state_to_string (TP_CALL_STATE_ACCEPTED), call_state_to_string (self->priv->state)); } } /** * tp_base_call_channel_get_state: * @self: a #TpBaseCallChannel * * * * Returns: the value of #TpBaseCallChannel:call-state * Since: 0.17.5 */ TpCallState tp_base_call_channel_get_state (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), TP_CALL_STATE_UNKNOWN); return self->priv->state; } /** * tp_base_call_channel_has_initial_audio: * @self: a #TpBaseCallChannel * @initial_audio_name: (out) (allow-none) (transfer none): a place to set the * value of #TpBaseCallChannel:initial-audio-name * * * * Returns: the value of #TpBaseCallChannel:initial-audio * Since: 0.17.5 */ gboolean tp_base_call_channel_has_initial_audio (TpBaseCallChannel *self, const gchar **initial_audio_name) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE); if (initial_audio_name != NULL) *initial_audio_name = self->priv->initial_audio_name; return self->priv->initial_audio; } /** * tp_base_call_channel_has_initial_video: * @self: a #TpBaseCallChannel * @initial_video_name: (out) (allow-none) (transfer none): a place to set the * value of #TpBaseCallChannel:initial-video-name * * * * Returns: the value of #TpBaseCallChannel:initial-video * Since: 0.17.5 */ gboolean tp_base_call_channel_has_initial_video (TpBaseCallChannel *self, const gchar **initial_video_name) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE); if (initial_video_name != NULL) *initial_video_name = self->priv->initial_video_name; return self->priv->initial_video; } /** * tp_base_call_channel_has_mutable_contents: * @self: a #TpBaseCallChannel * * * * Returns: the value of #TpBaseCallChannel:mutable-contents * Since: 0.17.5 */ gboolean tp_base_call_channel_has_mutable_contents (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE); return self->priv->mutable_contents; } /** * tp_base_call_channel_get_contents: * @self: a #TpBaseCallChannel * * Get the contents of this call. The #GList and its elements must not be freed * and should be copied before doing any modification. * * Returns: a #GList of #TpBaseCallContent * Since: 0.17.5 */ GList * tp_base_call_channel_get_contents (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), NULL); return self->priv->contents; } void _tp_base_call_channel_remove_content_internal (TpBaseCallChannel *self, TpBaseCallContent *content, const GValueArray *reason_array) { GList *l; const gchar *path; l = g_list_find (self->priv->contents, content); g_return_if_fail (l != NULL); self->priv->contents = g_list_delete_link (self->priv->contents, l); g_object_notify (G_OBJECT (self), "contents"); path = tp_base_call_content_get_object_path ( TP_BASE_CALL_CONTENT (content)); tp_svc_channel_type_call_emit_content_removed (self, path, reason_array); _tp_base_call_content_deinit (TP_BASE_CALL_CONTENT (content)); g_object_unref (content); } /** * tp_base_call_channel_remove_content: * @self: a #TpBaseCallChannel * @content: a #TpBaseCallContent to remove * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Remove @content from @self. * * Since: 0.17.5 */ void tp_base_call_channel_remove_content (TpBaseCallChannel *self, TpBaseCallContent *content, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GValueArray *reason_array; g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); g_return_if_fail (TP_IS_BASE_CALL_CONTENT (content)); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); _tp_base_call_channel_remove_content_internal (self, content, reason_array); tp_value_array_free (reason_array); } /** * tp_base_call_channel_add_content: * @self: a #TpBaseCallChannel * @content: a #TpBaseCallContent to add * * Add @content to @self. If @content's #TpBaseCallContent:disposition is * %TP_CALL_CONTENT_DISPOSITION_INITIAL, also set * #TpBaseCallChannel:initial-audio and #TpBaseCallChannel:initial-audio-name * properties (or #TpBaseCallChannel:initial-video and * #TpBaseCallChannel:initial-video-name). * Note that it is not allowed to add INITIAL contents after having registered * @self on the bus. * * Since: 0.17.5 */ void tp_base_call_channel_add_content (TpBaseCallChannel *self, TpBaseCallContent *content) { g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); g_return_if_fail (TP_IS_BASE_CALL_CONTENT (content)); g_return_if_fail (tp_base_call_content_get_connection (content) == tp_base_channel_get_connection ((TpBaseChannel *) self)); g_return_if_fail (g_list_find (self->priv->contents, content) == NULL); self->priv->contents = g_list_prepend (self->priv->contents, g_object_ref (content)); _tp_base_call_content_set_channel (content, self); g_object_notify (G_OBJECT (self), "contents"); if (tp_base_call_content_get_disposition (content) == TP_CALL_CONTENT_DISPOSITION_INITIAL) { if (tp_base_channel_is_registered ((TpBaseChannel *) self)) { WARNING ("Adding a content with TP_CALL_CONTENT_DISPOSITION_INITIAL " "after channel has been registered on the bus is not allowed." "Initial contents are supposed immutable"); } else if (tp_base_call_content_get_media_type (content) == TP_MEDIA_STREAM_TYPE_AUDIO) { self->priv->initial_audio = TRUE; g_free (self->priv->initial_audio_name); self->priv->initial_audio_name = g_strdup ( tp_base_call_content_get_name (content)); } else if (tp_base_call_content_get_media_type (content) == TP_MEDIA_STREAM_TYPE_VIDEO) { self->priv->initial_video = TRUE; g_free (self->priv->initial_video_name); self->priv->initial_video_name = g_strdup ( tp_base_call_content_get_name (content)); } } tp_svc_channel_type_call_emit_content_added (self, tp_base_call_content_get_object_path (content)); } /** * tp_base_call_channel_update_member_flags: * @self: a #TpBaseCallChannel * @contact: the contact to update * @new_flags: the new #TpCallMemberFlags of @contact * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Add or update @contact call member with @flags flags. * * Since: 0.17.5 */ void tp_base_call_channel_update_member_flags (TpBaseCallChannel *self, TpHandle contact, TpCallMemberFlags new_flags, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { gpointer flags_p; gboolean exists; GHashTable *updates; GHashTable *identifiers; GArray *empty_array; GValueArray *reason_array; g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); exists = g_hash_table_lookup_extended (self->priv->call_members, GUINT_TO_POINTER (contact), NULL, &flags_p); if (exists && GPOINTER_TO_UINT (flags_p) == new_flags) return; DEBUG ("Member %d (flags: %d) updated", contact, new_flags); g_hash_table_insert (self->priv->call_members, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_flags)); updates = g_hash_table_new (NULL, NULL); g_hash_table_insert (updates, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_flags)); identifiers = _tp_base_call_dup_member_identifiers ( tp_base_channel_get_connection ((TpBaseChannel *) self), updates); empty_array = g_array_new (FALSE, FALSE, sizeof (TpHandle)); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_channel_type_call_emit_call_members_changed (self, updates, identifiers, empty_array, reason_array); g_hash_table_unref (updates); g_hash_table_unref (identifiers); g_array_unref (empty_array); tp_value_array_free (reason_array); } /** * tp_base_call_channel_remove_member: * @self: a #TpBaseCallChannel * @contact: the contact to remove * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Remove @contact from call members. * * Since: 0.17.5 */ void tp_base_call_channel_remove_member (TpBaseCallChannel *self, TpHandle contact, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GHashTable *empty_table; GArray *removed; GValueArray *reason_array; g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); if (!g_hash_table_remove (self->priv->call_members, GUINT_TO_POINTER (contact))) return; DEBUG ("Member %d removed", contact); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); empty_table = g_hash_table_new (NULL, NULL); removed = g_array_new (FALSE, FALSE, sizeof (TpHandle)); g_array_append_val (removed, contact); tp_svc_channel_type_call_emit_call_members_changed (self, empty_table, empty_table, removed, reason_array); g_hash_table_unref (empty_table); g_array_unref (removed); tp_value_array_free (reason_array); } /** * tp_base_call_channel_get_call_members: * @self: a #TpBaseCallChannel * * * * Returns: the value of #TpBaseCallChannel:call-members. * Since: 0.17.5 */ GHashTable * tp_base_call_channel_get_call_members (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), NULL); return self->priv->call_members; } /** * tp_base_call_channel_remote_accept: * @self: a #TpBaseCallChannel * * Must be called when the remote contact accepted the call. * #TpBaseCallChannel:call-state must be either %TP_CALL_STATE_INITIALISED or * %TP_CALL_STATE_INITIALISING and will then change to %TP_CALL_STATE_ACCEPTED. * * Must be used only for outgoing calls. * * Since: 0.17.5 */ void tp_base_call_channel_remote_accept (TpBaseCallChannel *self) { TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); g_return_if_fail (tp_base_channel_is_requested (TP_BASE_CHANNEL (self))); if (self->priv->accepted) return; g_return_if_fail (self->priv->state == TP_CALL_STATE_INITIALISED || self->priv->state == TP_CALL_STATE_INITIALISING); self->priv->accepted = TRUE; tp_base_call_channel_set_state (self, TP_CALL_STATE_ACCEPTED, tp_base_channel_get_target_handle (TP_BASE_CHANNEL (self)), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", ""); if (klass->remote_accept) klass->remote_accept (self); } /** * tp_base_call_channel_is_accepted: * @self: a #TpBaseCallChannel * * * * Returns: Whether or not the call has been remotely accepted. * Since: 0.17.5 */ gboolean tp_base_call_channel_is_accepted (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE); return self->priv->accepted; } /* DBus method implementation */ static void tp_base_call_channel_set_ringing (TpSvcChannelTypeCall *iface, DBusGMethodInvocation *context) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (iface); TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); TpBaseChannel *tp_base = TP_BASE_CHANNEL (self); if (tp_base_channel_is_requested (tp_base)) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Call was requested. Ringing doesn't make sense." }; dbus_g_method_return_error (context, &e); } else if (self->priv->state != TP_CALL_STATE_INITIALISED) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Call is not in the right state for Ringing." }; dbus_g_method_return_error (context, &e); } else { if ((self->priv->flags & TP_CALL_FLAG_LOCALLY_RINGING) == 0) { DEBUG ("Client is ringing"); if (klass->set_ringing != NULL) klass->set_ringing (self); self->priv->flags |= TP_CALL_FLAG_LOCALLY_RINGING; self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_QUEUED; tp_base_call_channel_flags_changed (self, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "Local client has started ringing"); } tp_svc_channel_type_call_return_from_set_ringing (context); } } static void tp_base_call_channel_set_queued (TpSvcChannelTypeCall *iface, DBusGMethodInvocation *context) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (iface); TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); TpBaseChannel *tp_base = TP_BASE_CHANNEL (self); if (tp_base_channel_is_requested (tp_base)) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Call was requested. Queued doesn't make sense." }; dbus_g_method_return_error (context, &e); } else if (self->priv->state != TP_CALL_STATE_INITIALISING && self->priv->state != TP_CALL_STATE_INITIALISED) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Call is not in the right state for Queuing." }; dbus_g_method_return_error (context, &e); } else { if ((self->priv->flags & TP_CALL_FLAG_LOCALLY_QUEUED) == 0) { DEBUG ("Call is queued"); if (klass->set_queued != NULL) klass->set_queued (self); self->priv->flags |= TP_CALL_FLAG_LOCALLY_QUEUED; tp_base_call_channel_flags_changed (self, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "Local client has queued the call"); } tp_svc_channel_type_call_return_from_set_queued (context); } } static void raise_accept_state_error (TpBaseCallChannel *self, TpCallState expected, DBusGMethodInvocation *context) { GError *e = NULL; e = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Invalid state for Accept (expected: %s, current: %s)", call_state_to_string (expected), call_state_to_string (self->priv->state)); dbus_g_method_return_error (context, e); g_error_free (e); } static void tp_base_call_channel_accept (TpSvcChannelTypeCall *iface, DBusGMethodInvocation *context) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (iface); TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); TpBaseChannel *tp_base = TP_BASE_CHANNEL (self); DEBUG ("Client accepted the call"); self->priv->locally_accepted = TRUE; if (tp_base_channel_is_requested (tp_base)) { if (self->priv->state == TP_CALL_STATE_PENDING_INITIATOR) { tp_base_call_channel_set_state (self, TP_CALL_STATE_INITIALISING, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User has accepted to start the call"); } else { raise_accept_state_error (self, TP_CALL_STATE_PENDING_INITIATOR, context); return; } } else { if (self->priv->state == TP_CALL_STATE_INITIALISED) { tp_base_call_channel_set_state (self, TP_CALL_STATE_ACCEPTED, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User has accepted call"); } else { raise_accept_state_error (self, TP_CALL_STATE_INITIALISED, context); return; } self->priv->accepted = TRUE; } klass->accept (self); tp_svc_channel_type_call_return_from_accept (context); } static void tp_base_call_channel_accept_real (TpBaseCallChannel *self) { g_list_foreach (self->priv->contents, (GFunc) _tp_base_call_content_accepted, NULL); } static void tp_base_call_channel_hangup (TpSvcChannelTypeCall *iface, guint reason, const gchar *detailed_reason, const gchar *message, DBusGMethodInvocation *context) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (iface); TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); TpBaseChannel *tp_base = TP_BASE_CHANNEL (self); if (self->priv->state == TP_CALL_STATE_ENDED) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "This call has already ended" }; dbus_g_method_return_error (context, &e); return; } if (klass->hangup != NULL) klass->hangup (self, reason, detailed_reason, message); tp_base_call_channel_set_state (self, TP_CALL_STATE_ENDED, tp_base_channel_get_self_handle (tp_base), reason, detailed_reason, message); tp_svc_channel_type_call_return_from_hangup (context); } static void tp_base_call_channel_add_content_dbus (TpSvcChannelTypeCall *iface, const gchar *name, TpMediaStreamType mtype, TpMediaStreamDirection initial_direction, DBusGMethodInvocation *context) { TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (iface); TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); TpBaseCallContent *content; GError *error = NULL; if (self->priv->state == TP_CALL_STATE_ENDED) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No contents can be added. The call has already ended."); goto error; } if (mtype >= TP_NUM_MEDIA_STREAM_TYPES) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Unknown content type"); goto error; } if (initial_direction >= TP_NUM_MEDIA_STREAM_DIRECTIONS) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid initial direction"); goto error; } if (!self->priv->mutable_contents || klass->add_content == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_CAPABLE, "Contents are not mutable"); goto error; } content = klass->add_content (self, name, mtype, initial_direction, &error); if (content == NULL) goto error; if (g_list_find (self->priv->contents, content) == NULL) { WARNING ("TpBaseCallChannel::add_content() virtual method implementation " "should have called tp_base_call_channel_add_content()"); } tp_svc_channel_type_call_return_from_add_content (context, tp_base_call_content_get_object_path (content)); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } static void call_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelTypeCallClass *klass = (TpSvcChannelTypeCallClass *) g_iface; #define IMPLEMENT(x, suffix) tp_svc_channel_type_call_implement_##x (\ klass, tp_base_call_channel_##x##suffix) IMPLEMENT(set_ringing,); IMPLEMENT(set_queued,); IMPLEMENT(accept,); IMPLEMENT(hangup,); IMPLEMENT(add_content, _dbus); #undef IMPLEMENT } /* Interface has no methods, only has a requestable property */ static void dtmf_iface_init (gpointer g_iface, gpointer iface_data) { } /* Internal functions */ gboolean _tp_base_call_channel_is_locally_accepted (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), FALSE); return self->priv->locally_accepted; } gboolean _tp_base_call_channel_is_connected (TpBaseCallChannel *self) { TpBaseCallChannelClass *klass = TP_BASE_CALL_CHANNEL_GET_CLASS (self); if (klass->is_connected) return klass->is_connected (self); else return TRUE; } const gchar * _tp_base_call_channel_get_initial_tones (TpBaseCallChannel *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CHANNEL (self), ""); return self->priv->initial_tones; } telepathy-glib-0.24.2/telepathy-glib/base-call-channel.h0000644000175000017500000001240512652510705017753 00000000000000/* * base-call-channel.h - Header for TpBaseCallChannel * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CALL_CHANNEL_H__ #define __TP_BASE_CALL_CHANNEL_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpBaseCallChannel TpBaseCallChannel; typedef struct _TpBaseCallChannelPrivate TpBaseCallChannelPrivate; typedef struct _TpBaseCallChannelClass TpBaseCallChannelClass; typedef void (*TpBaseCallChannelVoidFunc) (TpBaseCallChannel *self); typedef TpBaseCallContent * (*TpBaseCallChannelAddContentFunc) ( TpBaseCallChannel *self, const gchar *name, TpMediaStreamType media, TpMediaStreamDirection initial_direction, GError **error); typedef void (*TpBaseCallChannelHangupFunc) (TpBaseCallChannel *self, TpCallStateChangeReason reason, const gchar *detailed_reason, const gchar *message); struct _TpBaseCallChannelClass { /**/ TpBaseChannelClass parent_class; /*< public >*/ TpBaseCallChannelVoidFunc set_ringing; TpBaseCallChannelVoidFunc set_queued; TpBaseCallChannelVoidFunc accept; TpBaseCallChannelAddContentFunc add_content; TpBaseCallChannelHangupFunc hangup; /**/ /* For media subclasses */ gboolean (*is_connected) (TpBaseCallChannel *self); void (*remote_accept) (TpBaseCallChannel *self); gpointer future[4]; }; struct _TpBaseCallChannel { /**/ TpBaseChannel parent; TpBaseCallChannelPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_base_call_channel_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_CALL_CHANNEL \ (tp_base_call_channel_get_type ()) #define TP_BASE_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_BASE_CALL_CHANNEL, TpBaseCallChannel)) #define TP_BASE_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_BASE_CALL_CHANNEL, TpBaseCallChannelClass)) #define TP_IS_BASE_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CALL_CHANNEL)) #define TP_IS_BASE_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CALL_CHANNEL)) #define TP_BASE_CALL_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_BASE_CALL_CHANNEL, TpBaseCallChannelClass)) _TP_AVAILABLE_IN_0_18 TpCallState tp_base_call_channel_get_state (TpBaseCallChannel *self); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_set_state (TpBaseCallChannel *self, TpCallState state, guint actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_channel_has_initial_audio (TpBaseCallChannel *self, const gchar **initial_audio_name); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_channel_has_initial_video (TpBaseCallChannel *self, const gchar **initial_video_name); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_channel_has_mutable_contents (TpBaseCallChannel *self); _TP_AVAILABLE_IN_0_18 GList * tp_base_call_channel_get_contents (TpBaseCallChannel *self); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_add_content (TpBaseCallChannel *self, TpBaseCallContent *content); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_remove_content (TpBaseCallChannel *self, TpBaseCallContent *content, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_update_member_flags (TpBaseCallChannel *self, TpHandle contact, TpCallMemberFlags new_flags, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_remove_member (TpBaseCallChannel *self, TpHandle contact, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); _TP_AVAILABLE_IN_0_18 GHashTable *tp_base_call_channel_get_call_members (TpBaseCallChannel *self); _TP_AVAILABLE_IN_0_18 void tp_base_call_channel_remote_accept (TpBaseCallChannel *self); _TP_AVAILABLE_IN_0_18 gboolean tp_base_call_channel_is_accepted (TpBaseCallChannel *self); G_END_DECLS #endif /* #ifndef __TP_BASE_CALL_CHANNEL_H__*/ telepathy-glib-0.24.2/telepathy-glib/debug-internal.h0000644000175000017500000000622312652510705017423 00000000000000/**/ #ifndef __DEBUG_H__ #define __DEBUG_H__ #include "config.h" #include #include G_BEGIN_DECLS /* Please keep this enum in sync with #keys, the section gtkdoc, * and #key_to_domain, in debug.c */ typedef enum { TP_DEBUG_MISC = 1 << 0, TP_DEBUG_GROUPS = 1 << 1, TP_DEBUG_PROPERTIES = 1 << 2, TP_DEBUG_IM = 1 << 3, TP_DEBUG_CONNECTION = 1 << 4, TP_DEBUG_PARAMS = 1 << 5, TP_DEBUG_PRESENCE = 1 << 6, TP_DEBUG_MANAGER = 1 << 7, TP_DEBUG_CHANNEL = 1 << 8, TP_DEBUG_PROXY = 1 << 9, TP_DEBUG_HANDLES = 1 << 10, TP_DEBUG_CONTACTS = 1 << 11, TP_DEBUG_ACCOUNTS = 1 << 12, TP_DEBUG_DISPATCHER = 1 << 13, TP_DEBUG_CLIENT = 1 << 14, TP_DEBUG_CONTACT_LISTS = 1 << 15, TP_DEBUG_SASL = 1 << 16, TP_DEBUG_ROOM_CONFIG = 1 << 17, TP_DEBUG_CALL = 1 << 18, /* Quis custodiet ipsos custodes? */ TP_DEBUG_DEBUGGER = 1 << 19, TP_DEBUG_TLS = 1 << 20 } TpDebugFlags; gboolean _tp_debug_flag_is_set (TpDebugFlags flag); void _tp_debug_set_flags (TpDebugFlags flags); void _tp_log (GLogLevelFlags level, TpDebugFlags flag, const gchar *format, ...) G_GNUC_PRINTF (3, 4); gboolean _tp_debug_is_persistent (void); #define _TP_DEBUG_IS_PERSISTENT (_tp_debug_is_persistent ()) G_END_DECLS #endif /* __DEBUG_H__ */ /* ------------------------------------ */ /* Below this point is outside the __DEBUG_H__ guard - so it can take effect * more than once. So you can do: * * #define DEBUG_FLAG TP_DEBUG_ONE_THING * #include "telepathy-glib/debug-internal.h" * ... * DEBUG ("if we're debugging one thing"); * ... * #undef DEBUG_FLAG * #define DEBUG_FLAG TP_DEBUG_OTHER_THING * #include "telepathy-glib/debug-internal.h" * ... * DEBUG ("if we're debugging the other thing"); * ... */ #ifdef DEBUG_FLAG #undef ERROR #define ERROR(format, ...) \ do \ { \ _tp_log (G_LOG_LEVEL_ERROR, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__); \ g_assert_not_reached (); \ } \ while (0) #undef CRITICAL #define CRITICAL(format, ...) \ _tp_log (G_LOG_LEVEL_CRITICAL, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) #undef WARNING #define WARNING(format, ...) \ _tp_log (G_LOG_LEVEL_WARNING, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) #undef MESSAGE #define MESSAGE(format, ...) \ _tp_log (G_LOG_LEVEL_MESSAGE, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) #undef INFO #define INFO(format, ...) \ _tp_log (G_LOG_LEVEL_INFO, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) #undef DEBUG #undef DEBUGGING #ifdef ENABLE_DEBUG # define DEBUG(format, ...) \ _tp_log (G_LOG_LEVEL_DEBUG, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) # define DEBUGGING _tp_debug_flag_is_set (DEBUG_FLAG) #else /* !defined (ENABLE_DEBUG) */ # ifndef DEBUG_STUB_DEFINED static inline void DEBUG ( const gchar *format, ...) { } # define DEBUG_STUB_DEFINED 1 # endif // ifndef DEBUG_STUB_DEFINED # define DEBUGGING 0 #endif /* !defined (ENABLE_DEBUG) */ #endif /* defined (DEBUG_FLAG) */ telepathy-glib-0.24.2/telepathy-glib/call-stream.c0000644000175000017500000004520512652510705016725 00000000000000/* * call-stream.h - high level API for Call streams * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-stream * @title: TpCallStream * @short_description: proxy object for a call stream * * #TpCallStream is a sub-class of #TpProxy providing convenient API * to represent #TpCallChannel's stream. */ /** * TpCallStream: * * Data structure representing a #TpCallStream. * * Since: 0.17.5 */ /** * TpCallStreamClass: * * The class of a #TpCallStream. * * Since: 0.17.5 */ #include "config.h" #include "telepathy-glib/call-stream.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/call-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" #include "_gen/tp-cli-call-stream-body.h" G_DEFINE_TYPE (TpCallStream, tp_call_stream, TP_TYPE_PROXY) struct _TpCallStreamPrivate { TpConnection *connection; TpCallContent *content; /* TpContact -> TpSendingState */ GHashTable *remote_members; TpSendingState local_sending_state; gboolean can_request_receiving; gboolean properties_retrieved; }; enum { PROP_CONNECTION = 1, PROP_LOCAL_SENDING_STATE, PROP_CAN_REQUEST_RECEIVING, PROP_CONTENT }; enum /* signals */ { LOCAL_SENDING_STATE_CHANGED, REMOTE_MEMBERS_CHANGED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; static void update_remote_members (TpCallStream *self, GHashTable *updates, GPtrArray *removed) { if (updates != NULL) { tp_g_hash_table_update (self->priv->remote_members, updates, g_object_ref, NULL); } if (removed != NULL) { guint i; for (i = 0; i < removed->len; i++) { g_hash_table_remove (self->priv->remote_members, g_ptr_array_index (removed, i)); } } } static void remote_members_changed_cb (TpCallStream *self, GHashTable *updates, GHashTable *identifiers, const GArray *removed, const GValueArray *reason, gpointer user_data, GObject *weak_object) { GHashTable *updates_contacts; GPtrArray *removed_contacts; TpCallStateReason *r; if (!self->priv->properties_retrieved) return; DEBUG ("Remote members: %d updated, %d removed", g_hash_table_size (updates), removed->len); updates_contacts = _tp_call_members_convert_table (self->priv->connection, updates, identifiers); removed_contacts = _tp_call_members_convert_array (self->priv->connection, removed); r = _tp_call_state_reason_new (reason); update_remote_members (self, updates_contacts, removed_contacts); g_signal_emit (self, _signals[REMOTE_MEMBERS_CHANGED], 0, updates_contacts, removed_contacts, r); g_hash_table_unref (updates_contacts); g_ptr_array_unref (removed_contacts); _tp_call_state_reason_unref (r); } static void local_sending_state_changed_cb (TpCallStream *self, guint state, const GValueArray *reason, gpointer user_data, GObject *weak_object) { TpCallStateReason *r; if (!self->priv->properties_retrieved) return; self->priv->local_sending_state = state; g_object_notify (G_OBJECT (self), "local-sending-state"); r = _tp_call_state_reason_new (reason); g_signal_emit (self, _signals[LOCAL_SENDING_STATE_CHANGED], 0, self->priv->local_sending_state, r); _tp_call_state_reason_unref (r); } static void got_all_properties_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpCallStream *self = (TpCallStream *) proxy; const gchar * const *interfaces; GHashTable *remote_members; GHashTable *identifiers; GHashTable *contacts; if (error != NULL) { DEBUG ("Could not get the call stream properties: %s", error->message); _tp_proxy_set_feature_prepared (proxy, TP_CALL_STREAM_FEATURE_CORE, FALSE); return; } self->priv->properties_retrieved = TRUE; interfaces = tp_asv_get_boxed (properties, "Interfaces", G_TYPE_STRV); remote_members = tp_asv_get_boxed (properties, "RemoteMembers", TP_HASH_TYPE_CONTACT_SENDING_STATE_MAP), identifiers = tp_asv_get_boxed (properties, "RemoteMemberIdentifiers", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP); self->priv->local_sending_state = tp_asv_get_uint32 (properties, "LocalSendingState", NULL); self->priv->can_request_receiving = tp_asv_get_boolean (properties, "CanRequestReceiving", NULL); tp_proxy_add_interfaces ((TpProxy *) self, interfaces); contacts = _tp_call_members_convert_table (self->priv->connection, remote_members, identifiers); update_remote_members (self, contacts, NULL); g_hash_table_unref (contacts); _tp_proxy_set_feature_prepared (proxy, TP_CALL_STREAM_FEATURE_CORE, TRUE); } static void tp_call_stream_constructed (GObject *obj) { TpCallStream *self = (TpCallStream *) obj; ((GObjectClass *) tp_call_stream_parent_class)->constructed (obj); /* Connect signals for mutable properties */ tp_cli_call_stream_connect_to_remote_members_changed (self, remote_members_changed_cb, NULL, NULL, G_OBJECT (self), NULL); tp_cli_call_stream_connect_to_local_sending_state_changed (self, local_sending_state_changed_cb, NULL, NULL, G_OBJECT (self), NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CALL_STREAM, got_all_properties_cb, NULL, NULL, G_OBJECT (self)); } static void tp_call_stream_dispose (GObject *object) { TpCallStream *self = (TpCallStream *) object; g_clear_object (&self->priv->content); g_clear_object (&self->priv->connection); tp_clear_pointer (&self->priv->remote_members, g_hash_table_unref); G_OBJECT_CLASS (tp_call_stream_parent_class)->dispose (object); } static void tp_call_stream_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCallStream *self = (TpCallStream *) object; TpCallStreamPrivate *priv = self->priv; switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->connection); break; case PROP_LOCAL_SENDING_STATE: g_value_set_uint (value, priv->local_sending_state); break; case PROP_CAN_REQUEST_RECEIVING: g_value_set_boolean (value, priv->can_request_receiving); break; case PROP_CONTENT: g_value_set_object (value, self->priv->content); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_stream_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpCallStream *self = (TpCallStream *) object; switch (property_id) { case PROP_CONNECTION: g_assert (self->priv->connection == NULL); /* construct-only */ self->priv->connection = g_value_dup_object (value); break; case PROP_CONTENT: g_assert (self->priv->content == NULL); /* construct-only */ self->priv->content = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } enum { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_call_stream_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; /* started from constructed */ features[FEAT_CORE].name = TP_CALL_STREAM_FEATURE_CORE; features[FEAT_CORE].core = TRUE; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_call_stream_class_init (TpCallStreamClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); TpProxyClass *proxy_class = (TpProxyClass *) klass; GParamSpec *param_spec; gobject_class->constructed = tp_call_stream_constructed; gobject_class->get_property = tp_call_stream_get_property; gobject_class->set_property = tp_call_stream_set_property; gobject_class->dispose = tp_call_stream_dispose; proxy_class->list_features = tp_call_stream_list_features; proxy_class->interface = TP_IFACE_QUARK_CALL_STREAM; g_type_class_add_private (gobject_class, sizeof (TpCallStreamPrivate)); tp_call_stream_init_known_interfaces (); /** * TpCallStream:connection: * * The #TpConnection of the call. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("connection", "Connection", "The connection of this stream", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CONNECTION, param_spec); /** * TpCallStream:local-sending-state: * * The local user's sending state, from #TpSendingState. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("local-sending-state", "LocalSendingState", "Local sending state", 0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_LOCAL_SENDING_STATE, param_spec); /** * TpCallStream:can-request-receiving: * * If %TRUE, the user can request that a remote contact starts sending on this * stream. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("can-request-receiving", "CanRequestReceiving", "If true, the user can request that a remote contact starts sending on" "this stream.", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CAN_REQUEST_RECEIVING, param_spec); /** * TpCallStream:content: * * The Content that this streams belongs to * * Since: 0.17.6 */ param_spec = g_param_spec_object ("content", "Content", "The content that this Stream belongs to", TP_TYPE_CALL_CONTENT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_CONTENT, param_spec); /** * TpCallStream::local-sending-state-changed: * @self: the #TpCallStream * @state: the new #TpSendingState * @reason: the #TpCallStateReason for the change * * The ::local-sending-state-changed signal is emitted whenever the * stream sending state changes. * * Since: 0.17.5 */ _signals[LOCAL_SENDING_STATE_CHANGED] = g_signal_new ("local-sending-state-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, TP_TYPE_CALL_STATE_REASON); /** * TpCallStream::remote-members-changed: * @self: the #TpCallStream * @updates: (type GLib.HashTable) (element-type TelepathyGLib.Contact uint): * #GHashTable mapping #TpContact to its new #TpSendingState * @removed: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * #GPtrArray of #TpContact removed from remote contacts * @reason: the #TpCallStateReason for the change * * The ::remote-members-changed signal is emitted whenever the * stream's remote members changes. * * It is NOT guaranteed that #TpContact objects have any feature prepared. * * Since: 0.17.5 */ _signals[REMOTE_MEMBERS_CHANGED] = g_signal_new ("remote-members-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_HASH_TABLE, G_TYPE_PTR_ARRAY, TP_TYPE_CALL_STATE_REASON); } static void tp_call_stream_init (TpCallStream *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_CALL_STREAM, TpCallStreamPrivate); self->priv->remote_members = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); } /** * tp_call_stream_init_known_interfaces: * * Ensure that the known interfaces for #TpCallStream have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CALL_STREAM. * * Since: 0.17.5 */ void tp_call_stream_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CALL_STREAM; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_call_stream_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } /** * TP_CALL_STREAM_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" * feature on a #TpCallStream. * * One can ask for a feature to be prepared using the tp_proxy_prepare_async() * function, and waiting for it to trigger the callback. */ GQuark tp_call_stream_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-call-stream-feature-core"); } /** * tp_call_stream_get_local_sending_state: * @self: a #TpCallStream * * * * Returns: the value of #TpCallStream:local-sending-state * Since: 0.17.5 */ TpSendingState tp_call_stream_get_local_sending_state (TpCallStream *self) { g_return_val_if_fail (TP_IS_CALL_STREAM (self), TP_SENDING_STATE_NONE); return self->priv->local_sending_state; } /** * tp_call_stream_can_request_receiving: * @self: a #TpCallStream * * * * Returns: the value of #TpCallStream:can-request-receiving * Since: 0.17.5 */ gboolean tp_call_stream_can_request_receiving (TpCallStream *self) { g_return_val_if_fail (TP_IS_CALL_STREAM (self), FALSE); return self->priv->can_request_receiving; } /** * tp_call_stream_get_remote_members: * @self: a #TpCallStream * * Get the remote contacts to who this stream is connected, mapped to their * sending state. * * It is NOT guaranteed that #TpContact objects have any feature prepared. * * Returns: (transfer none) (type GLib.HashTable) (element-type TelepathyGLib.Contact uint): * #GHashTable mapping #TpContact to its new #TpSendingState * Since: 0.17.5 */ GHashTable * tp_call_stream_get_remote_members (TpCallStream *self) { g_return_val_if_fail (TP_IS_CALL_STREAM (self), NULL); return self->priv->remote_members; } static void generic_async_cb (TpCallStream *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Error: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete (result); } /** * tp_call_stream_set_sending_async: * @self: a #TpCallStream * @send: the requested sending state * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Set the stream to start or stop sending media from the local user to other * contacts. * * If @send is %TRUE, #TpCallStream:local-sending-state should change to * %TP_SENDING_STATE_SENDING, if it isn't already. * If @send is %FALSE, #TpCallStream:local-sending-state should change to * %TP_SENDING_STATE_NONE, if it isn't already. * * Since: 0.17.5 */ void tp_call_stream_set_sending_async (TpCallStream *self, gboolean send, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_STREAM (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_stream_set_sending_async); tp_cli_call_stream_call_set_sending (self, -1, send, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_stream_set_sending_finish: * @self: a #TpCallStream * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_stream_set_sending_async(). * * Since: 0.17.5 */ gboolean tp_call_stream_set_sending_finish (TpCallStream *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_stream_set_sending_async); } /** * tp_call_stream_request_receiving_async: * @self: a #TpCallStream * @contact: contact from which sending is requested * @receive: the requested receiving state * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Request that a remote contact stops or starts sending on this stream. * * The #TpCallStream:can-request-receiving property defines whether the protocol * allows the local user to request the other side start sending on this stream. * * If @receive is %TRUE, request that the given contact starts to send media. * If @receive is %FALSE, request that the given contact stops sending media. * * Since: 0.17.5 */ void tp_call_stream_request_receiving_async (TpCallStream *self, TpContact *contact, gboolean receive, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CALL_STREAM (self)); g_return_if_fail (TP_IS_CONTACT (contact)); g_return_if_fail (tp_contact_get_connection (contact) == self->priv->connection); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_call_stream_set_sending_async); tp_cli_call_stream_call_request_receiving (self, -1, tp_contact_get_handle (contact), receive, generic_async_cb, result, g_object_unref, G_OBJECT (self)); } /** * tp_call_stream_request_receiving_finish: * @self: a #TpCallStream * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_call_stream_request_receiving_async(). * * Since: 0.17.5 */ gboolean tp_call_stream_request_receiving_finish (TpCallStream *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_call_stream_request_receiving_async); } telepathy-glib-0.24.2/telepathy-glib/call-stream.h0000644000175000017500000000661412652510705016733 00000000000000/* * call-stream.h - high level API for Call streams * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_STREAM_H__ #define __TP_CALL_STREAM_H__ #include #include #include G_BEGIN_DECLS #define TP_TYPE_CALL_STREAM (tp_call_stream_get_type ()) #define TP_CALL_STREAM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CALL_STREAM, TpCallStream)) #define TP_CALL_STREAM_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_CALL_STREAM, TpCallStreamClass)) #define TP_IS_CALL_STREAM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CALL_STREAM)) #define TP_IS_CALL_STREAM_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_CALL_STREAM)) #define TP_CALL_STREAM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CALL_STREAM, TpCallStreamClass)) typedef struct _TpCallStream TpCallStream; typedef struct _TpCallStreamClass TpCallStreamClass; typedef struct _TpCallStreamPrivate TpCallStreamPrivate; struct _TpCallStream { /**/ TpProxy parent; TpCallStreamPrivate *priv; }; struct _TpCallStreamClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; }; _TP_AVAILABLE_IN_0_18 GType tp_call_stream_get_type (void); _TP_AVAILABLE_IN_0_18 void tp_call_stream_init_known_interfaces (void); #define TP_CALL_STREAM_FEATURE_CORE \ tp_call_stream_get_feature_quark_core () _TP_AVAILABLE_IN_0_18 GQuark tp_call_stream_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 TpSendingState tp_call_stream_get_local_sending_state (TpCallStream *self); _TP_AVAILABLE_IN_0_18 gboolean tp_call_stream_can_request_receiving (TpCallStream *self); _TP_AVAILABLE_IN_0_18 GHashTable *tp_call_stream_get_remote_members (TpCallStream *self); _TP_AVAILABLE_IN_0_18 void tp_call_stream_set_sending_async (TpCallStream *self, gboolean send, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_stream_set_sending_finish (TpCallStream *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_call_stream_request_receiving_async (TpCallStream *self, TpContact *contact, gboolean receive, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_call_stream_request_receiving_finish (TpCallStream *self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/versions/0000755000175000017500000000000014006623342016274 500000000000000telepathy-glib-0.24.2/telepathy-glib/versions/0.19.0.abi0000644000175000017500000000663112652510705017427 00000000000000Version: TELEPATHY_GLIB_0.19.0 Extends: TELEPATHY_GLIB_0.18.0 Release: 0.19.0 tp_room_info_get_subject tp_debug_message_get_category tp_room_info_get_requires_password tp_account_channel_request_new_audio_video_call tp_debug_client_init_known_interfaces tp_room_info_get_handle tp_account_channel_request_set_request_property tp_room_info_get_server tp_cli_authentication_tls_certificate_call_reject tp_tls_certificate_get_rejection tp_capabilities_supports_file_transfer_uri tp_room_list_start tp_tls_certificate_add_rejection tp_svc_connection_interface_contacts_implement_get_contact_by_id tp_tls_certificate_rejection_get_error tp_debug_client_get_type tp_capabilities_supports_file_transfer_initial_offset tp_room_info_get_description tp_tls_certificate_rejection_raise_error tp_cli_debug_connect_to_new_debug_message tp_tls_certificate_rejection_get_type tp_capabilities_supports_sms tp_debug_client_set_enabled_finish tp_room_info_get_type tp_connection_manager_param_dup_default_variant tp_room_info_get_invite_only tp_tls_certificate_rejection_get_details tp_connection_dup_contact_by_id_async tp_tls_certificate_init_known_interfaces tp_account_channel_request_set_target_id tp_debug_client_new tp_tls_certificate_new tp_connection_upgrade_contacts_finish tp_tls_certificate_get_feature_quark_core tp_tls_certificate_get_cert_data tp_room_info_get_handle_name tp_tls_certificate_rejection_get_reason tp_tls_certificate_get_type tp_room_list_get_account tp_tls_certificate_reject_finish tp_cli_connection_interface_contacts_call_get_contact_by_id tp_capabilities_supports_file_transfer_timestamp tp_room_info_get_channel_type tp_tls_certificate_get_nth_rejection tp_debug_client_set_enabled_async tp_capabilities_dup_channel_classes_variant tp_connection_dup_contact_by_id_finish tp_debug_client_get_feature_quark_core tp_room_info_get_name tp_account_channel_request_set_target_contact tp_connection_dup_detailed_error_vardict tp_tls_certificate_get_cert_type tp_cli_authentication_tls_certificate_call_accept tp_tls_certificate_rejection_get_dbus_error tp_tls_certificate_accept_async tp_debug_client_is_enabled tp_account_channel_request_new_audio_call tp_debug_message_get_domain tp_debug_client_get_messages_finish tp_room_info_get_members_count tp_account_channel_request_set_file_transfer_timestamp tp_debug_message_get_type tp_tls_certificate_get_state tp_debug_message_get_time tp_debug_client_get_messages_async tp_cli_authentication_tls_certificate_connect_to_accepted tp_contact_get_account tp_connection_upgrade_contacts_async tp_account_channel_request_set_file_transfer_initial_offset tp_debug_message_get_message tp_tls_certificate_accept_finish tp_debug_message_get_level tp_room_list_get_server tp_account_channel_request_new_text tp_cli_debug_call_get_messages tp_account_channel_request_set_file_transfer_description tp_room_list_get_type tp_room_list_new_async tp_room_list_is_listing tp_room_list_new_finish tp_room_info_get_room_id tp_base_connection_disconnect_with_dbus_error_vardict tp_account_channel_request_new_file_transfer tp_cli_authentication_tls_certificate_connect_to_rejected tp_account_channel_request_set_file_transfer_uri tp_capabilities_supports_file_transfer_description tp_tls_certificate_reject_async tp_text_channel_get_feature_quark_chat_states tp_text_channel_get_chat_state tp_message_mixin_chat_state_iface_init tp_message_mixin_maybe_send_gone tp_message_mixin_change_chat_state tp_message_mixin_implement_send_chat_state telepathy-glib-0.24.2/telepathy-glib/versions/0.19.1.abi0000644000175000017500000000211612652510705017422 00000000000000Version: TELEPATHY_GLIB_0.19.1 Extends: TELEPATHY_GLIB_0.19.0 Release: 0.19.1 tp_account_request_add_supersedes tp_account_request_create_account_async tp_account_request_create_account_finish tp_account_request_get_type tp_account_request_new tp_account_request_new_from_protocol tp_account_request_set_automatic_presence tp_account_request_set_avatar tp_account_request_set_connect_automatically tp_account_request_set_display_name tp_account_request_set_enabled tp_account_request_set_icon_name tp_account_request_set_nickname tp_account_request_set_parameter tp_account_request_set_parameter_string tp_account_request_set_requested_presence tp_account_request_set_service tp_account_request_unset_parameter tp_base_connection_check_connected tp_base_connection_get_bus_name tp_base_connection_get_object_path tp_base_connection_get_status tp_base_connection_is_destroyed tp_protocol_get_cm_name tp_simple_client_factory_ensure_contact_by_id_async tp_simple_client_factory_ensure_contact_by_id_finish tp_simple_client_factory_upgrade_contacts_async tp_simple_client_factory_upgrade_contacts_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.19.2.abi0000644000175000017500000000025112652510705017421 00000000000000Version: TELEPATHY_GLIB_0.19.2 Extends: TELEPATHY_GLIB_0.19.1 Release: 0.19.2 tp_dynamic_handle_repo_set_normalize_async tp_handle_ensure_async tp_handle_ensure_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.19.3.abi0000644000175000017500000000023512652510705017424 00000000000000Version: TELEPATHY_GLIB_0.19.3 Extends: TELEPATHY_GLIB_0.19.2 Release: 0.19.3 tp_account_get_cm_name tp_account_get_protocol_name tp_connection_get_cm_name telepathy-glib-0.24.2/telepathy-glib/versions/0.19.4.abi0000644000175000017500000000016712652510705017431 00000000000000Version: TELEPATHY_GLIB_0.19.4 Extends: TELEPATHY_GLIB_0.19.3 Release: 0.19.4 tp_account_request_set_storage_provider telepathy-glib-0.24.2/telepathy-glib/versions/0.19.6.abi0000644000175000017500000000016212652510705017426 00000000000000Version: TELEPATHY_GLIB_0.19.6 Extends: TELEPATHY_GLIB_0.19.4 Release: 0.19.6 tp_account_manager_can_set_default telepathy-glib-0.24.2/telepathy-glib/versions/0.19.7.abi0000644000175000017500000000025712652510705017434 00000000000000Version: TELEPATHY_GLIB_0.19.7 Extends: TELEPATHY_GLIB_0.19.6 Release: 0.19.7 tp_base_channel_disappear tp_base_channel_reopened_with_requested tp_base_channel_is_respawning telepathy-glib-0.24.2/telepathy-glib/versions/0.19.8.abi0000644000175000017500000000016312652510705017431 00000000000000Version: TELEPATHY_GLIB_0.19.8 Extends: TELEPATHY_GLIB_0.19.7 Release: 0.19.8 tp_account_channel_request_set_hint telepathy-glib-0.24.2/telepathy-glib/versions/0.19.9.abi0000644000175000017500000000114312652510705017431 00000000000000Version: TELEPATHY_GLIB_0.19.9 Extends: TELEPATHY_GLIB_0.19.8 Release: 0.19.9 tp_base_client_dup_handled_channels tp_channel_dispatch_operation_get_channels tp_channel_dup_immutable_properties tp_channel_dispatch_operation_get_possible_handlers tp_proxy_get_interface_by_id tp_contact_search_result_dup_fields tp_connection_dup_contact_info_supported_fields tp_channel_dispatch_operation_get_connection tp_contact_dup_contact_info tp_account_manager_dup_valid_accounts tp_text_channel_dup_pending_messages tp_channel_dispatch_operation_get_account tp_channel_get_connection tp_base_client_dup_pending_requests telepathy-glib-0.24.2/telepathy-glib/versions/0.7.10.abi0000644000175000017500000000045512652510705017423 00000000000000Version: TELEPATHY_GLIB_0.7.10 Extends: TELEPATHY_GLIB_0.7.9 Release: 0.7.10 tp_external_group_mixin_get_dbus_property tp_external_group_mixin_init_dbus_properties tp_group_mixin_add_handle_owners tp_group_mixin_change_self_handle tp_group_mixin_get_dbus_property tp_group_mixin_init_dbus_properties telepathy-glib-0.24.2/telepathy-glib/versions/0.7.12.abi0000644000175000017500000000067312652510705017427 00000000000000Version: TELEPATHY_GLIB_0.7.12 Extends: TELEPATHY_GLIB_0.7.10 Release: 0.7.12 tp_channel_borrow_connection tp_channel_get_channel_type tp_channel_get_channel_type_id tp_channel_get_handle tp_channel_group_get_flags tp_channel_group_get_handle_owner tp_channel_group_get_local_pending tp_channel_group_get_local_pending_info tp_channel_group_get_members tp_channel_group_get_remote_pending tp_channel_group_get_self_handle tp_channel_is_ready telepathy-glib-0.24.2/telepathy-glib/versions/0.7.13.abi0000644000175000017500000000172112652510705017423 00000000000000Version: TELEPATHY_GLIB_0.7.13 Extends: TELEPATHY_GLIB_0.7.12 Release: 0.7.13 tp_cli_connection_interface_simple_presence_call_get_presences tp_cli_connection_interface_simple_presence_call_set_presence tp_cli_connection_interface_simple_presence_connect_to_presences_changed tp_cli_connection_interface_simple_presence_run_get_presences tp_cli_connection_interface_simple_presence_run_set_presence tp_dbus_properties_mixin_get tp_iface_quark_connection_interface_simple_presence tp_presence_mixin_simple_presence_iface_init tp_presence_mixin_simple_presence_init_dbus_properties tp_svc_connection_interface_simple_presence_emit_presences_changed tp_svc_connection_interface_simple_presence_get_type tp_svc_connection_interface_simple_presence_implement_get_presences tp_svc_connection_interface_simple_presence_implement_set_presence tp_text_mixin_has_pending_messages tp_type_dbus_hash_s_28ubb_29 tp_type_dbus_hash_u_28uss_29 tp_type_dbus_struct_ubb tp_type_dbus_struct_uss telepathy-glib-0.24.2/telepathy-glib/versions/0.7.14.abi0000644000175000017500000000171312652510705017425 00000000000000Version: TELEPATHY_GLIB_0.7.14 Extends: TELEPATHY_GLIB_0.7.13 Release: 0.7.14 tp_base_connection_register_with_contacts_mixin tp_cli_connection_interface_aliasing_call_get_aliases tp_cli_connection_interface_aliasing_run_get_aliases tp_cli_connection_interface_contacts_call_get_contact_attributes tp_cli_connection_interface_contacts_run_get_contact_attributes tp_connection_get_status tp_contacts_mixin_add_contact_attributes_iface tp_contacts_mixin_class_get_offset_quark tp_contacts_mixin_class_init tp_contacts_mixin_finalize tp_contacts_mixin_get_offset_quark tp_contacts_mixin_iface_init tp_contacts_mixin_init tp_contacts_mixin_set_contact_attribute tp_iface_quark_connection_interface_contacts tp_presence_mixin_simple_presence_register_with_contacts_mixin tp_svc_connection_interface_aliasing_implement_get_aliases tp_svc_connection_interface_contacts_get_type tp_svc_connection_interface_contacts_implement_get_contact_attributes tp_type_dbus_hash_ua_7bsv_7d telepathy-glib-0.24.2/telepathy-glib/versions/0.7.15.abi0000644000175000017500000000303712652510705017427 00000000000000Version: TELEPATHY_GLIB_0.7.15 Extends: TELEPATHY_GLIB_0.7.14 Release: 0.7.15 tp_base_connection_channel_manager_iter_init tp_base_connection_channel_manager_iter_next tp_base_connection_get_self_handle tp_base_connection_set_self_handle tp_channel_manager_asv_has_unknown_properties tp_channel_manager_create_channel tp_channel_manager_emit_channel_closed tp_channel_manager_emit_channel_closed_for_object tp_channel_manager_emit_new_channel tp_channel_manager_emit_new_channels tp_channel_manager_emit_request_already_satisfied tp_channel_manager_emit_request_failed tp_channel_manager_emit_request_failed_printf tp_channel_manager_foreach_channel tp_channel_manager_foreach_channel_class tp_channel_manager_get_type tp_channel_manager_request_channel tp_cli_connection_connect_to_self_handle_changed tp_cli_connection_interface_requests_call_create_channel tp_cli_connection_interface_requests_connect_to_channel_closed tp_cli_connection_interface_requests_connect_to_new_channels tp_cli_connection_interface_requests_run_create_channel tp_dbus_properties_mixin_make_properties_hash tp_exportable_channel_get_type tp_iface_quark_connection_interface_requests tp_strv_contains tp_svc_connection_emit_self_handle_changed tp_svc_connection_interface_requests_emit_channel_closed tp_svc_connection_interface_requests_emit_new_channels tp_svc_connection_interface_requests_get_type tp_svc_connection_interface_requests_implement_create_channel tp_type_dbus_array_a_7bsv_7das tp_type_dbus_array_oa_7bsv_7d tp_type_dbus_struct_a_7bsv_7das tp_type_dbus_struct_oa_7bsv_7d telepathy-glib-0.24.2/telepathy-glib/versions/0.7.16.abi0000644000175000017500000000051512652510705017426 00000000000000Version: TELEPATHY_GLIB_0.7.16 Extends: TELEPATHY_GLIB_0.7.15 Release: 0.7.16 tp_channel_manager_ensure_channel tp_cli_connection_interface_requests_call_ensure_channel tp_cli_connection_interface_requests_run_ensure_channel tp_connection_presence_type_cmp_availability tp_svc_connection_interface_requests_implement_ensure_channel telepathy-glib-0.24.2/telepathy-glib/versions/0.7.17.abi0000644000175000017500000000047112652510705017430 00000000000000Version: TELEPATHY_GLIB_0.7.17 Extends: TELEPATHY_GLIB_0.7.16 Release: 0.7.17 tp_connection_hold_handles tp_connection_is_ready tp_connection_request_handles tp_connection_unref_handles tp_proxy_get_bus_name tp_proxy_get_dbus_connection tp_proxy_get_dbus_daemon tp_proxy_get_invalidated tp_proxy_get_object_path telepathy-glib-0.24.2/telepathy-glib/versions/0.7.18.abi0000644000175000017500000000134612652510705017433 00000000000000Version: TELEPATHY_GLIB_0.7.18 Extends: TELEPATHY_GLIB_0.7.17 Release: 0.7.18 tp_cli_channel_interface_destroyable_call_destroy tp_cli_channel_interface_destroyable_run_destroy tp_connection_get_contacts_by_handle tp_connection_get_contacts_by_id tp_connection_upgrade_contacts tp_contact_get_alias tp_contact_get_avatar_token tp_contact_get_connection tp_contact_get_handle tp_contact_get_identifier tp_contact_get_presence_message tp_contact_get_presence_status tp_contact_get_presence_type tp_contact_get_type tp_contact_has_feature tp_iface_quark_channel_interface_destroyable tp_svc_channel_interface_destroyable_get_type tp_svc_channel_interface_destroyable_implement_destroy tp_text_mixin_receive_with_flags tp_text_mixin_set_rescued telepathy-glib-0.24.2/telepathy-glib/versions/0.7.19.abi0000644000175000017500000000036112652510705017430 00000000000000Version: TELEPATHY_GLIB_0.7.19 Extends: TELEPATHY_GLIB_0.7.18 Release: 0.7.19 tp_channel_borrow_immutable_properties tp_channel_new_from_properties tp_connection_get_contact_attributes tp_mixin_class_get_offset tp_mixin_instance_get_offset telepathy-glib-0.24.2/telepathy-glib/versions/0.7.20.abi0000644000175000017500000000177312652510705017430 00000000000000Version: TELEPATHY_GLIB_0.7.20 Extends: TELEPATHY_GLIB_0.7.19 Release: 0.7.20 tp_cli_channel_interface_group_connect_to_members_changed_detailed tp_cli_channel_interface_messages_call_get_pending_message_content tp_cli_channel_interface_messages_call_send_message tp_cli_channel_interface_messages_connect_to_message_received tp_cli_channel_interface_messages_connect_to_message_sent tp_cli_channel_interface_messages_connect_to_pending_messages_removed tp_cli_channel_interface_messages_run_get_pending_message_content tp_cli_channel_interface_messages_run_send_message tp_iface_quark_channel_interface_messages tp_svc_channel_interface_group_emit_members_changed_detailed tp_svc_channel_interface_messages_emit_message_received tp_svc_channel_interface_messages_emit_message_sent tp_svc_channel_interface_messages_emit_pending_messages_removed tp_svc_channel_interface_messages_get_type tp_svc_channel_interface_messages_implement_get_pending_message_content tp_svc_channel_interface_messages_implement_send_message telepathy-glib-0.24.2/telepathy-glib/versions/0.7.21.abi0000644000175000017500000000165312652510705017426 00000000000000Version: TELEPATHY_GLIB_0.7.21 Extends: TELEPATHY_GLIB_0.7.20 Release: 0.7.21 tp_type_dbus_hash_uv tp_group_mixin_change_members_detailed tp_message_append_part tp_message_count_parts tp_message_delete_key tp_message_delete_part tp_message_destroy tp_message_new tp_message_peek tp_message_ref_handle tp_message_set tp_message_set_boolean tp_message_set_bytes tp_message_set_handle tp_message_set_int32 tp_message_set_int64 tp_message_set_string tp_message_set_string_printf tp_message_set_uint32 tp_message_set_uint64 tp_message_take_message tp_message_mixin_finalize tp_message_mixin_implement_sending tp_message_mixin_init tp_message_mixin_init_dbus_properties tp_message_mixin_messages_iface_init tp_message_mixin_get_dbus_property tp_message_mixin_sent tp_message_mixin_set_rescued tp_message_mixin_take_received tp_message_mixin_has_pending_messages tp_message_mixin_clear tp_message_mixin_text_iface_init tp_channel_get_identifier telepathy-glib-0.24.2/telepathy-glib/versions/0.7.23.abi0000644000175000017500000000201312652510705017417 00000000000000Version: TELEPATHY_GLIB_0.7.23 Extends: TELEPATHY_GLIB_0.7.21 Release: 0.7.23 tp_cli_channel_type_file_transfer_call_accept_file tp_cli_channel_type_file_transfer_call_provide_file tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed tp_cli_channel_type_file_transfer_run_accept_file tp_cli_channel_type_file_transfer_run_provide_file tp_cli_media_stream_handler_call_codecs_updated tp_cli_media_stream_handler_run_codecs_updated tp_iface_quark_channel_type_file_transfer tp_svc_channel_type_file_transfer_emit_file_transfer_state_changed tp_svc_channel_type_file_transfer_emit_initial_offset_defined tp_svc_channel_type_file_transfer_emit_transferred_bytes_changed tp_svc_channel_type_file_transfer_get_type tp_svc_channel_type_file_transfer_implement_accept_file tp_svc_channel_type_file_transfer_implement_provide_file tp_svc_media_stream_handler_implement_codecs_updated telepathy-glib-0.24.2/telepathy-glib/versions/0.7.24.abi0000644000175000017500000000036112652510705017424 00000000000000Version: TELEPATHY_GLIB_0.7.24 Extends: TELEPATHY_GLIB_0.7.23 Release: 0.7.24 tp_base_connection_disconnect_with_dbus_error tp_cli_connection_connect_to_connection_error tp_proxy_dbus_error_to_gerror tp_svc_connection_emit_connection_error telepathy-glib-0.24.2/telepathy-glib/versions/0.7.26.abi0000644000175000017500000000166012652510705017431 00000000000000Version: TELEPATHY_GLIB_0.7.26 Extends: TELEPATHY_GLIB_0.7.24 Release: 0.7.26 tp_connection_get_self_handle tp_connection_manager_call_when_ready tp_connection_manager_dup_protocol_names tp_connection_manager_get_info_source tp_connection_manager_get_name tp_connection_manager_get_protocol tp_connection_manager_has_protocol tp_connection_manager_is_ready tp_connection_manager_is_running tp_connection_manager_param_get_dbus_signature tp_connection_manager_param_get_default tp_connection_manager_param_get_name tp_connection_manager_param_is_dbus_property tp_connection_manager_param_is_required tp_connection_manager_param_is_required_for_registration tp_connection_manager_param_is_secret tp_connection_manager_protocol_can_register tp_connection_manager_protocol_dup_param_names tp_connection_manager_protocol_get_param tp_connection_manager_protocol_has_param tp_dbus_daemon_dup tp_intset_new_containing tp_type_dbus_array_of_a_7bsv_7d telepathy-glib-0.24.2/telepathy-glib/versions/0.7.27.abi0000644000175000017500000000124112652510705017425 00000000000000Version: TELEPATHY_GLIB_0.7.27 Extends: TELEPATHY_GLIB_0.7.26 Release: 0.7.27 tp_connection_parse_object_path tp_group_mixin_class_allow_self_removal tp_g_value_slice_new_boolean tp_g_value_slice_new_boxed tp_g_value_slice_new_bytes tp_g_value_slice_new_double tp_g_value_slice_new_int tp_g_value_slice_new_int64 tp_g_value_slice_new_object_path tp_g_value_slice_new_static_boxed tp_g_value_slice_new_static_object_path tp_g_value_slice_new_static_string tp_g_value_slice_new_string tp_g_value_slice_new_take_boxed tp_g_value_slice_new_take_bytes tp_g_value_slice_new_take_object_path tp_g_value_slice_new_take_string tp_g_value_slice_new_uint tp_g_value_slice_new_uint64 telepathy-glib-0.24.2/telepathy-glib/versions/0.7.28.abi0000644000175000017500000000020512652510705017425 00000000000000Version: TELEPATHY_GLIB_0.7.28 Extends: TELEPATHY_GLIB_0.7.27 Release: 0.7.28 tp_type_dbus_array_of_a_7bss_7d tp_type_dbus_array_sq telepathy-glib-0.24.2/telepathy-glib/versions/0.7.29.abi0000644000175000017500000000071212652510705017431 00000000000000Version: TELEPATHY_GLIB_0.7.29 Extends: TELEPATHY_GLIB_0.7.28 Release: 0.7.29 tp_asv_dump tp_asv_new tp_asv_set_boolean tp_asv_set_boxed tp_asv_set_bytes tp_asv_set_double tp_asv_set_int32 tp_asv_set_int64 tp_asv_set_object_path tp_asv_set_static_boxed tp_asv_set_static_object_path tp_asv_set_static_string tp_asv_set_string tp_asv_set_strv tp_asv_set_uint32 tp_asv_set_uint64 tp_asv_take_boxed tp_asv_take_bytes tp_asv_take_object_path tp_asv_take_string telepathy-glib-0.24.2/telepathy-glib/versions/0.7.30.abi0000644000175000017500000000020712652510705017420 00000000000000Version: TELEPATHY_GLIB_0.7.30 Extends: TELEPATHY_GLIB_0.7.29 Release: 0.7.30 tp_dbus_daemon_release_name tp_dbus_daemon_request_name telepathy-glib-0.24.2/telepathy-glib/versions/0.7.31.abi0000644000175000017500000000275612652510705017434 00000000000000Version: TELEPATHY_GLIB_0.7.31 Extends: TELEPATHY_GLIB_0.7.30 Release: 0.7.31 tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed tp_cli_channel_type_dbus_tube_call_accept tp_cli_channel_type_dbus_tube_call_offer tp_cli_channel_type_dbus_tube_connect_to_dbus_names_changed tp_cli_channel_type_dbus_tube_run_accept tp_cli_channel_type_dbus_tube_run_offer tp_cli_channel_type_stream_tube_call_accept tp_cli_channel_type_stream_tube_call_offer tp_cli_channel_type_stream_tube_connect_to_connection_closed tp_cli_channel_type_stream_tube_connect_to_new_local_connection tp_cli_channel_type_stream_tube_connect_to_new_remote_connection tp_cli_channel_type_stream_tube_run_accept tp_cli_channel_type_stream_tube_run_offer tp_error_get_dbus_name tp_g_key_file_get_int64 tp_g_key_file_get_uint64 tp_iface_quark_channel_interface_tube tp_iface_quark_channel_type_dbus_tube tp_iface_quark_channel_type_stream_tube tp_svc_channel_interface_tube_emit_tube_channel_state_changed tp_svc_channel_interface_tube_get_type tp_svc_channel_type_dbus_tube_emit_dbus_names_changed tp_svc_channel_type_dbus_tube_get_type tp_svc_channel_type_dbus_tube_implement_accept tp_svc_channel_type_dbus_tube_implement_offer tp_svc_channel_type_stream_tube_emit_connection_closed tp_svc_channel_type_stream_tube_emit_new_local_connection tp_svc_channel_type_stream_tube_emit_new_remote_connection tp_svc_channel_type_stream_tube_get_type tp_svc_channel_type_stream_tube_implement_accept tp_svc_channel_type_stream_tube_implement_offer telepathy-glib-0.24.2/telepathy-glib/versions/0.7.32.abi0000644000175000017500000001012712652510705017424 00000000000000Version: TELEPATHY_GLIB_0.7.32 Extends: TELEPATHY_GLIB_0.7.31 Release: 0.7.32 tp_account_get_type tp_account_init_known_interfaces tp_account_manager_get_type tp_account_manager_init_known_interfaces tp_account_manager_new tp_account_new tp_channel_dispatch_operation_get_type tp_channel_dispatch_operation_init_known_interfaces tp_channel_dispatch_operation_new tp_channel_dispatcher_get_type tp_channel_dispatcher_init_known_interfaces tp_channel_dispatcher_new tp_channel_request_get_type tp_channel_request_init_known_interfaces tp_channel_request_new tp_cli_account_call_reconnect tp_cli_account_call_remove tp_cli_account_call_update_parameters tp_cli_account_connect_to_account_property_changed tp_cli_account_connect_to_removed tp_cli_account_interface_avatar_connect_to_avatar_changed tp_cli_account_manager_call_create_account tp_cli_account_manager_connect_to_account_removed tp_cli_account_manager_connect_to_account_validity_changed tp_cli_channel_dispatch_operation_call_claim tp_cli_channel_dispatch_operation_call_handle_with tp_cli_channel_dispatch_operation_connect_to_channel_lost tp_cli_channel_dispatch_operation_connect_to_finished tp_cli_channel_dispatcher_call_create_channel tp_cli_channel_dispatcher_call_ensure_channel tp_cli_channel_dispatcher_interface_operation_list_connect_to_dispatch_operation_finished tp_cli_channel_dispatcher_interface_operation_list_connect_to_new_dispatch_operation tp_cli_channel_request_call_cancel tp_cli_channel_request_call_proceed tp_cli_channel_request_connect_to_failed tp_cli_channel_request_connect_to_succeeded tp_cli_client_approver_call_add_dispatch_operation tp_cli_client_handler_call_handle_channels tp_cli_client_interface_requests_call_add_request tp_cli_client_interface_requests_call_remove_request tp_cli_client_observer_call_observe_channels tp_client_get_type tp_client_init_known_interfaces tp_connection_manager_init_known_interfaces tp_dbus_daemon_init_known_interfaces tp_iface_quark_account tp_iface_quark_account_interface_avatar tp_iface_quark_account_manager tp_iface_quark_channel_dispatch_operation tp_iface_quark_channel_dispatcher tp_iface_quark_channel_dispatcher_interface_operation_list tp_iface_quark_channel_request tp_iface_quark_client tp_iface_quark_client_approver tp_iface_quark_client_handler tp_iface_quark_client_interface_requests tp_iface_quark_client_observer tp_media_session_handler_init_known_interfaces tp_media_stream_handler_init_known_interfaces tp_svc_account_emit_account_property_changed tp_svc_account_emit_removed tp_svc_account_get_type tp_svc_account_implement_reconnect tp_svc_account_implement_remove tp_svc_account_implement_update_parameters tp_svc_account_interface_avatar_emit_avatar_changed tp_svc_account_interface_avatar_get_type tp_svc_account_manager_emit_account_removed tp_svc_account_manager_emit_account_validity_changed tp_svc_account_manager_get_type tp_svc_account_manager_implement_create_account tp_svc_channel_dispatch_operation_emit_channel_lost tp_svc_channel_dispatch_operation_emit_finished tp_svc_channel_dispatch_operation_get_type tp_svc_channel_dispatch_operation_implement_claim tp_svc_channel_dispatch_operation_implement_handle_with tp_svc_channel_dispatcher_get_type tp_svc_channel_dispatcher_implement_create_channel tp_svc_channel_dispatcher_implement_ensure_channel tp_svc_channel_dispatcher_interface_operation_list_emit_dispatch_operation_finished tp_svc_channel_dispatcher_interface_operation_list_emit_new_dispatch_operation tp_svc_channel_dispatcher_interface_operation_list_get_type tp_svc_channel_request_emit_failed tp_svc_channel_request_emit_succeeded tp_svc_channel_request_get_type tp_svc_channel_request_implement_cancel tp_svc_channel_request_implement_proceed tp_svc_client_approver_get_type tp_svc_client_approver_implement_add_dispatch_operation tp_svc_client_get_type tp_svc_client_handler_get_type tp_svc_client_handler_implement_handle_channels tp_svc_client_interface_requests_get_type tp_svc_client_interface_requests_implement_add_request tp_svc_client_interface_requests_implement_remove_request tp_svc_client_observer_get_type tp_svc_client_observer_implement_observe_channels tp_type_dbus_struct_ays telepathy-glib-0.24.2/telepathy-glib/versions/0.7.34.abi0000644000175000017500000000151012652510705017422 00000000000000Version: TELEPATHY_GLIB_0.7.34 Extends: TELEPATHY_GLIB_0.7.32 Release: 0.7.34 tp_cli_connection_interface_location_call_get_locations tp_cli_connection_interface_location_call_request_location tp_cli_connection_interface_location_call_set_location tp_cli_connection_interface_location_connect_to_location_updated tp_cli_connection_interface_location_run_get_locations tp_cli_connection_interface_location_run_request_location tp_cli_connection_interface_location_run_set_location tp_iface_quark_connection_interface_location tp_svc_connection_interface_location_emit_location_updated tp_svc_connection_interface_location_get_type tp_svc_connection_interface_location_implement_get_locations tp_svc_connection_interface_location_implement_request_location tp_svc_connection_interface_location_implement_set_location tp_type_dbus_array_of_o telepathy-glib-0.24.2/telepathy-glib/versions/0.7.35.abi0000644000175000017500000000025612652510705017431 00000000000000Version: TELEPATHY_GLIB_0.7.35 Extends: TELEPATHY_GLIB_0.7.34 Release: 0.7.35 tp_dbus_daemon_get_unique_name tp_dbus_daemon_list_activatable_names tp_dbus_daemon_list_names telepathy-glib-0.24.2/telepathy-glib/versions/0.7.36.abi0000644000175000017500000000053012652510705017425 00000000000000Version: TELEPATHY_GLIB_0.7.36 Extends: TELEPATHY_GLIB_0.7.35 Release: 0.7.36 tp_debug_sender_add_message tp_debug_sender_dup tp_debug_sender_get_type tp_debug_sender_log_handler tp_iface_quark_debug tp_svc_debug_emit_new_debug_message tp_svc_debug_get_type tp_svc_debug_implement_get_messages tp_type_dbus_array_dsus tp_type_dbus_struct_dsus telepathy-glib-0.24.2/telepathy-glib/versions/0.7.37.abi0000644000175000017500000000173312652510705017434 00000000000000Version: TELEPATHY_GLIB_0.7.37 Extends: TELEPATHY_GLIB_0.7.36 Release: 0.7.37 tp_cli_connection_interface_contact_capabilities_call_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_call_update_capabilities tp_cli_connection_interface_contact_capabilities_connect_to_contact_capabilities_changed tp_cli_connection_interface_contact_capabilities_run_get_contact_capabilities tp_cli_connection_interface_contact_capabilities_run_update_capabilities tp_iface_quark_connection_interface_contact_capabilities tp_svc_connection_interface_contact_capabilities_emit_contact_capabilities_changed tp_svc_connection_interface_contact_capabilities_get_type tp_svc_connection_interface_contact_capabilities_implement_get_contact_capabilities tp_svc_connection_interface_contact_capabilities_implement_update_capabilities tp_type_dbus_array_of_a_7bua_28a_7bsv_7das_29_7d tp_type_dbus_array_saa_7bsv_7das tp_type_dbus_hash_ua_28a_7bsv_7das_29 tp_type_dbus_struct_saa_7bsv_7das telepathy-glib-0.24.2/telepathy-glib/versions/0.13.0.abi0000644000175000017500000001437712652510705017427 00000000000000Version: TELEPATHY_GLIB_0.13.0 Extends: TELEPATHY_GLIB_0.11.16 Release: 0.13.0 tp_base_contact_list_add_to_group_async tp_base_contact_list_add_to_group_finish tp_base_contact_list_authorize_publication_async tp_base_contact_list_authorize_publication_finish tp_base_contact_list_block_contacts_async tp_base_contact_list_block_contacts_finish tp_base_contact_list_can_block tp_base_contact_list_can_change_contact_list tp_base_contact_list_contact_blocking_changed tp_base_contact_list_contacts_changed tp_base_contact_list_dup_blocked_contacts tp_base_contact_list_dup_contact_groups tp_base_contact_list_dup_contacts tp_base_contact_list_dup_group_members tp_base_contact_list_dup_groups tp_base_contact_list_dup_states tp_base_contact_list_false_func tp_base_contact_list_get_connection tp_base_contact_list_get_contact_list_persists tp_base_contact_list_get_group_storage tp_base_contact_list_get_request_uses_message tp_base_contact_list_get_state tp_base_contact_list_get_type tp_base_contact_list_group_renamed tp_base_contact_list_groups_changed tp_base_contact_list_groups_created tp_base_contact_list_groups_removed tp_base_contact_list_has_disjoint_groups tp_base_contact_list_mixin_class_init tp_base_contact_list_mixin_groups_iface_init tp_base_contact_list_mixin_list_iface_init tp_base_contact_list_mixin_register_with_contacts_mixin tp_base_contact_list_normalize_group tp_base_contact_list_one_contact_changed tp_base_contact_list_one_contact_groups_changed tp_base_contact_list_one_contact_removed tp_base_contact_list_remove_contacts_async tp_base_contact_list_remove_contacts_finish tp_base_contact_list_remove_from_group_async tp_base_contact_list_remove_from_group_finish tp_base_contact_list_remove_group_async tp_base_contact_list_remove_group_finish tp_base_contact_list_rename_group_async tp_base_contact_list_rename_group_finish tp_base_contact_list_request_subscription_async tp_base_contact_list_request_subscription_finish tp_base_contact_list_set_contact_groups_async tp_base_contact_list_set_contact_groups_finish tp_base_contact_list_set_group_members_async tp_base_contact_list_set_group_members_finish tp_base_contact_list_set_list_failed tp_base_contact_list_set_list_pending tp_base_contact_list_set_list_received tp_base_contact_list_store_contacts_async tp_base_contact_list_store_contacts_finish tp_base_contact_list_true_func tp_base_contact_list_unblock_contacts_async tp_base_contact_list_unblock_contacts_finish tp_base_contact_list_unpublish_async tp_base_contact_list_unpublish_finish tp_base_contact_list_unsubscribe_async tp_base_contact_list_unsubscribe_finish tp_blockable_contact_list_get_type tp_capabilities_supports_dbus_tubes tp_capabilities_supports_stream_tubes tp_cli_connection_interface_contact_groups_call_add_to_group tp_cli_connection_interface_contact_groups_call_remove_from_group tp_cli_connection_interface_contact_groups_call_remove_group tp_cli_connection_interface_contact_groups_call_rename_group tp_cli_connection_interface_contact_groups_call_set_contact_groups tp_cli_connection_interface_contact_groups_call_set_group_members tp_cli_connection_interface_contact_groups_connect_to_group_renamed tp_cli_connection_interface_contact_groups_connect_to_groups_changed tp_cli_connection_interface_contact_groups_connect_to_groups_created tp_cli_connection_interface_contact_groups_connect_to_groups_removed tp_cli_connection_interface_contact_groups_run_add_to_group tp_cli_connection_interface_contact_groups_run_remove_from_group tp_cli_connection_interface_contact_groups_run_remove_group tp_cli_connection_interface_contact_groups_run_rename_group tp_cli_connection_interface_contact_groups_run_set_contact_groups tp_cli_connection_interface_contact_groups_run_set_group_members tp_cli_connection_interface_contact_list_call_authorize_publication tp_cli_connection_interface_contact_list_call_get_contact_list_attributes tp_cli_connection_interface_contact_list_call_remove_contacts tp_cli_connection_interface_contact_list_call_request_subscription tp_cli_connection_interface_contact_list_call_unpublish tp_cli_connection_interface_contact_list_call_unsubscribe tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed tp_cli_connection_interface_contact_list_connect_to_contacts_changed tp_cli_connection_interface_contact_list_run_authorize_publication tp_cli_connection_interface_contact_list_run_get_contact_list_attributes tp_cli_connection_interface_contact_list_run_remove_contacts tp_cli_connection_interface_contact_list_run_request_subscription tp_cli_connection_interface_contact_list_run_unpublish tp_cli_connection_interface_contact_list_run_unsubscribe tp_connection_get_contact_list_attributes tp_contact_group_list_get_type tp_contacts_mixin_get_contact_attributes tp_handle_set_dump tp_handle_set_new_containing tp_handle_set_new_from_intset tp_iface_quark_connection_interface_contact_groups tp_iface_quark_connection_interface_contact_list tp_mutable_contact_group_list_get_type tp_mutable_contact_list_get_type tp_svc_connection_interface_contact_groups_emit_group_renamed tp_svc_connection_interface_contact_groups_emit_groups_changed tp_svc_connection_interface_contact_groups_emit_groups_created tp_svc_connection_interface_contact_groups_emit_groups_removed tp_svc_connection_interface_contact_groups_get_type tp_svc_connection_interface_contact_groups_implement_add_to_group tp_svc_connection_interface_contact_groups_implement_remove_from_group tp_svc_connection_interface_contact_groups_implement_remove_group tp_svc_connection_interface_contact_groups_implement_rename_group tp_svc_connection_interface_contact_groups_implement_set_contact_groups tp_svc_connection_interface_contact_groups_implement_set_group_members tp_svc_connection_interface_contact_list_emit_contact_list_state_changed tp_svc_connection_interface_contact_list_emit_contacts_changed tp_svc_connection_interface_contact_list_get_type tp_svc_connection_interface_contact_list_implement_authorize_publication tp_svc_connection_interface_contact_list_implement_get_contact_list_attributes tp_svc_connection_interface_contact_list_implement_remove_contacts tp_svc_connection_interface_contact_list_implement_request_subscription tp_svc_connection_interface_contact_list_implement_unpublish tp_svc_connection_interface_contact_list_implement_unsubscribe tp_type_dbus_hash_u_28uus_29 tp_type_dbus_struct_uus telepathy-glib-0.24.2/telepathy-glib/versions/0.13.1.abi0000644000175000017500000000137612652510705017423 00000000000000Version: TELEPATHY_GLIB_0.13.1 Extends: TELEPATHY_GLIB_0.13.0 Release: 0.13.1 tp_cli_connection_interface_client_types_call_get_client_types tp_cli_connection_interface_client_types_call_request_client_types tp_cli_connection_interface_client_types_connect_to_client_types_updated tp_cli_connection_interface_client_types_run_get_client_types tp_cli_connection_interface_client_types_run_request_client_types tp_contact_get_client_types tp_iface_quark_connection_interface_client_types tp_svc_connection_interface_client_types_emit_client_types_updated tp_svc_connection_interface_client_types_get_type tp_svc_connection_interface_client_types_implement_get_client_types tp_svc_connection_interface_client_types_implement_request_client_types tp_type_dbus_hash_uas telepathy-glib-0.24.2/telepathy-glib/versions/0.13.2.abi0000644000175000017500000000271212652510705017417 00000000000000Version: TELEPATHY_GLIB_0.13.2 Extends: TELEPATHY_GLIB_0.13.1 Release: 0.13.2 tp_account_channel_request_set_channel_factory tp_account_get_feature_quark_storage tp_account_get_storage_identifier tp_account_get_storage_provider tp_account_get_storage_restrictions tp_account_get_storage_specific_information_async tp_account_get_storage_specific_information_finish tp_automatic_proxy_factory_dup tp_automatic_proxy_factory_get_type tp_automatic_proxy_factory_new tp_base_client_get_channel_factory tp_base_client_set_channel_factory tp_basic_proxy_factory_dup tp_basic_proxy_factory_get_type tp_basic_proxy_factory_new tp_cli_media_stream_handler_connect_to_start_named_telephony_event tp_cli_media_stream_handler_connect_to_start_sound_telephony_event tp_client_channel_factory_create_channel tp_client_channel_factory_get_type tp_stream_tube_channel_accept_async tp_stream_tube_channel_accept_finish tp_stream_tube_channel_get_parameters tp_stream_tube_channel_get_service tp_stream_tube_channel_get_type tp_stream_tube_channel_new tp_stream_tube_channel_offer_async tp_stream_tube_channel_offer_finish tp_stream_tube_connection_get_channel tp_stream_tube_connection_get_contact tp_stream_tube_connection_get_socket_connection tp_stream_tube_connection_get_type tp_svc_media_stream_handler_emit_start_named_telephony_event tp_svc_media_stream_handler_emit_start_sound_telephony_event tp_unix_connection_receive_credentials_with_byte tp_unix_connection_send_credentials_with_byte telepathy-glib-0.24.2/telepathy-glib/versions/0.13.3.abi0000644000175000017500000000336412652510705017424 00000000000000Version: TELEPATHY_GLIB_0.13.3 Extends: TELEPATHY_GLIB_0.13.2 Release: 0.13.3 tp_base_connection_add_client_interest tp_base_connection_add_possible_client_interest tp_cli_channel_interface_dtmf_connect_to_tones_deferred tp_cli_connection_call_add_client_interest tp_cli_connection_call_remove_client_interest tp_cli_connection_interface_mail_notification_call_request_inbox_url tp_cli_connection_interface_mail_notification_call_request_mail_url tp_cli_connection_interface_mail_notification_connect_to_mails_received tp_cli_connection_interface_mail_notification_connect_to_unread_mails_changed tp_cli_connection_interface_mail_notification_run_request_inbox_url tp_cli_connection_interface_mail_notification_run_request_mail_url tp_cli_connection_run_add_client_interest tp_cli_connection_run_remove_client_interest tp_client_channel_factory_dup_channel_features tp_connection_add_client_interest tp_connection_add_client_interest_by_id tp_dtmf_event_to_char tp_dtmf_player_cancel tp_dtmf_player_get_type tp_dtmf_player_is_active tp_dtmf_player_new tp_dtmf_player_play tp_iface_quark_connection_interface_mail_notification tp_iface_quark_protocol_interface_presence tp_svc_channel_interface_dtmf_emit_tones_deferred tp_svc_connection_implement_add_client_interest tp_svc_connection_implement_remove_client_interest tp_svc_connection_interface_mail_notification_emit_mails_received tp_svc_connection_interface_mail_notification_emit_unread_mails_changed tp_svc_connection_interface_mail_notification_get_type tp_svc_connection_interface_mail_notification_implement_request_inbox_url tp_svc_connection_interface_mail_notification_implement_request_mail_url tp_svc_protocol_interface_presence_get_type tp_type_dbus_array_ss tp_type_dbus_struct_ss tp_type_dbus_struct_sua_28ss_29 telepathy-glib-0.24.2/telepathy-glib/versions/0.13.4.abi0000644000175000017500000000040412652510705017415 00000000000000Version: TELEPATHY_GLIB_0.13.4 Extends: TELEPATHY_GLIB_0.13.3 Release: 0.13.4 tp_cli_media_stream_handler_call_new_active_transport_pair tp_cli_media_stream_handler_run_new_active_transport_pair tp_svc_media_stream_handler_implement_new_active_transport_pair telepathy-glib-0.24.2/telepathy-glib/versions/0.13.5.abi0000644000175000017500000000015512652510705017421 00000000000000Version: TELEPATHY_GLIB_0.13.5 Extends: TELEPATHY_GLIB_0.13.4 Release: 0.13.5 tp_base_protocol_get_statuses telepathy-glib-0.24.2/telepathy-glib/versions/0.13.7.abi0000644000175000017500000000526012652510705017425 00000000000000Version: TELEPATHY_GLIB_0.13.7 Extends: TELEPATHY_GLIB_0.13.5 Release: 0.13.7 tp_cli_account_interface_addressing_call_set_uri_scheme_association tp_cli_channel_dispatcher_call_create_channel_with_hints tp_cli_channel_dispatcher_call_ensure_channel_with_hints tp_cli_channel_interface_sasl_authentication_call_abort_sasl tp_cli_channel_interface_sasl_authentication_call_accept_sasl tp_cli_channel_interface_sasl_authentication_call_respond tp_cli_channel_interface_sasl_authentication_call_start_mechanism tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data tp_cli_channel_interface_sasl_authentication_connect_to_new_challenge tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed tp_cli_channel_interface_sasl_authentication_run_abort_sasl tp_cli_channel_interface_sasl_authentication_run_accept_sasl tp_cli_channel_interface_sasl_authentication_run_respond tp_cli_channel_interface_sasl_authentication_run_start_mechanism tp_cli_channel_interface_sasl_authentication_run_start_mechanism_with_data tp_cli_channel_request_connect_to_succeeded_with_channel tp_cli_connection_interface_power_saving_call_set_power_saving tp_cli_connection_interface_power_saving_connect_to_power_saving_changed tp_cli_connection_interface_power_saving_run_set_power_saving tp_iface_quark_account_interface_addressing tp_iface_quark_channel_interface_sasl_authentication tp_iface_quark_channel_interface_securable tp_iface_quark_channel_type_server_authentication tp_iface_quark_connection_interface_power_saving tp_iface_quark_protocol_interface_avatars tp_svc_account_interface_addressing_get_type tp_svc_account_interface_addressing_implement_set_uri_scheme_association tp_svc_channel_dispatcher_implement_create_channel_with_hints tp_svc_channel_dispatcher_implement_ensure_channel_with_hints tp_svc_channel_interface_sasl_authentication_emit_new_challenge tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed tp_svc_channel_interface_sasl_authentication_get_type tp_svc_channel_interface_sasl_authentication_implement_abort_sasl tp_svc_channel_interface_sasl_authentication_implement_accept_sasl tp_svc_channel_interface_sasl_authentication_implement_respond tp_svc_channel_interface_sasl_authentication_implement_start_mechanism tp_svc_channel_interface_sasl_authentication_implement_start_mechanism_with_data tp_svc_channel_interface_securable_get_type tp_svc_channel_request_emit_succeeded_with_channel tp_svc_channel_type_server_authentication_get_type tp_svc_connection_interface_power_saving_emit_power_saving_changed tp_svc_connection_interface_power_saving_get_type tp_svc_connection_interface_power_saving_implement_set_power_saving tp_svc_protocol_interface_avatars_get_type telepathy-glib-0.24.2/telepathy-glib/versions/0.13.8.abi0000644000175000017500000000113212652510705017420 00000000000000Version: TELEPATHY_GLIB_0.13.8 Extends: TELEPATHY_GLIB_0.13.7 Release: 0.13.8 tp_account_associated_with_uri_scheme tp_account_get_automatic_presence tp_account_get_feature_quark_addressing tp_account_get_normalized_name tp_account_get_uri_schemes tp_account_set_automatic_presence_async tp_account_set_automatic_presence_finish tp_account_set_uri_scheme_association_async tp_account_set_uri_scheme_association_finish tp_connection_has_immortal_handles tp_simple_password_manager_get_type tp_simple_password_manager_new tp_simple_password_manager_prompt_async tp_simple_password_manager_prompt_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.13.9.abi0000644000175000017500000000154412652510705017430 00000000000000Version: TELEPATHY_GLIB_0.13.9 Extends: TELEPATHY_GLIB_0.13.8 Release: 0.13.9 tp_account_get_path_suffix tp_cli_channel_interface_sms_connect_to_sms_channel_changed tp_client_message_get_type tp_client_message_new tp_client_message_new_text tp_cm_message_get_sender tp_cm_message_get_type tp_cm_message_new tp_cm_message_set_sender tp_cm_message_take_message tp_connection_dup_contact_if_possible tp_connection_get_self_contact tp_message_get_received_timestamp tp_message_get_sent_timestamp tp_message_get_specific_to_interface tp_message_get_supersedes tp_message_get_token tp_message_get_type tp_message_is_delivery_report tp_message_is_mutable tp_message_is_rescued tp_message_is_scrollback tp_message_to_text tp_protocol_get_authentication_types tp_signalled_message_get_sender tp_signalled_message_get_type tp_svc_channel_interface_sms_emit_sms_channel_changed telepathy-glib-0.24.2/telepathy-glib/versions/0.9.0.abi0000644000175000017500000000327312652510705017345 00000000000000Version: TELEPATHY_GLIB_0.9.0 Extends: TELEPATHY_GLIB_0.7.37 Release: 0.9.0 tp_account_ensure_connection tp_account_get_avatar_async tp_account_get_avatar_finish tp_account_get_connect_automatically tp_account_get_connection tp_account_get_connection_manager tp_account_get_connection_status tp_account_get_current_presence tp_account_get_display_name tp_account_get_feature_quark_core tp_account_get_has_been_online tp_account_get_icon_name tp_account_get_nickname tp_account_get_parameters tp_account_get_protocol tp_account_get_requested_presence tp_account_is_enabled tp_account_is_prepared tp_account_is_valid tp_account_manager_create_account_async tp_account_manager_create_account_finish tp_account_manager_dup tp_account_manager_enable_restart tp_account_manager_ensure_account tp_account_manager_get_feature_quark_core tp_account_manager_get_most_available_presence tp_account_manager_get_valid_accounts tp_account_manager_is_prepared tp_account_manager_prepare_async tp_account_manager_prepare_finish tp_account_manager_set_all_requested_presences tp_account_parse_object_path tp_account_prepare_async tp_account_prepare_finish tp_account_reconnect_async tp_account_reconnect_finish tp_account_remove_async tp_account_remove_finish tp_account_request_presence_async tp_account_request_presence_finish tp_account_set_connect_automatically_async tp_account_set_connect_automatically_finish tp_account_set_display_name_async tp_account_set_display_name_finish tp_account_set_enabled_async tp_account_set_enabled_finish tp_account_set_icon_name_async tp_account_set_icon_name_finish tp_account_set_nickname_async tp_account_set_nickname_finish tp_account_update_parameters_async tp_account_update_parameters_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.9.2.abi0000644000175000017500000000017412652510705017344 00000000000000Version: TELEPATHY_GLIB_0.9.2 Extends: TELEPATHY_GLIB_0.9.0 Release: 0.9.2 tp_g_signal_connect_object tp_value_array_build telepathy-glib-0.24.2/telepathy-glib/versions/0.14.1.abi0000644000175000017500000000172012652510705017415 00000000000000Version: TELEPATHY_GLIB_0.14.2 Extends: TELEPATHY_GLIB_0.13.16 Release: 0.14.2 tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed tp_svc_connection_interface_contact_blocking_implement_block_contacts tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts tp_cli_connection_interface_contact_blocking_run_block_contacts tp_iface_quark_connection_interface_contact_blocking tp_cli_connection_interface_contact_blocking_call_unblock_contacts tp_svc_connection_interface_contact_blocking_get_type tp_svc_connection_interface_contact_blocking_implement_request_blocked_contacts tp_cli_connection_interface_contact_blocking_call_block_contacts tp_cli_connection_interface_contact_blocking_run_request_blocked_contacts tp_cli_connection_interface_contact_blocking_run_unblock_contacts tp_svc_connection_interface_contact_blocking_implement_unblock_contacts telepathy-glib-0.24.2/telepathy-glib/versions/0.14.3.abi0000644000175000017500000000160412652510705017420 00000000000000Version: TELEPATHY_GLIB_0.14.3 Extends: TELEPATHY_GLIB_0.14.2 Release: 0.14.3 tp_cli_media_stream_handler_call_supported_feedback_messages tp_cli_media_stream_handler_call_supported_header_extensions tp_cli_media_stream_handler_connect_to_set_remote_feedback_messages tp_cli_media_stream_handler_connect_to_set_remote_header_extensions tp_cli_media_stream_handler_run_supported_feedback_messages tp_cli_media_stream_handler_run_supported_header_extensions tp_g_ptr_array_extend tp_svc_media_stream_handler_emit_set_remote_feedback_messages tp_svc_media_stream_handler_emit_set_remote_header_extensions tp_svc_media_stream_handler_implement_supported_feedback_messages tp_svc_media_stream_handler_implement_supported_header_extensions tp_type_dbus_array_sss tp_type_dbus_array_uuss tp_type_dbus_hash_u_28ua_28sss_29_29 tp_type_dbus_struct_sss tp_type_dbus_struct_ua_28sss_29 tp_type_dbus_struct_uuss telepathy-glib-0.24.2/telepathy-glib/versions/0.14.4.abi0000644000175000017500000000014712652510705017422 00000000000000Version: TELEPATHY_GLIB_0.14.4 Extends: TELEPATHY_GLIB_0.14.3 Release: 0.14.4 tp_proxy_add_interfaces telepathy-glib-0.24.2/telepathy-glib/versions/0.14.5.abi0000644000175000017500000000023312652510705017417 00000000000000Version: TELEPATHY_GLIB_0.14.5 Extends: TELEPATHY_GLIB_0.14.4 Release: 0.14.5 tp_base_client_is_handling_channel tp_intset_iter_init tp_intset_iter_reset telepathy-glib-0.24.2/telepathy-glib/versions/0.19.10.abi0000644000175000017500000000146312652510705017506 00000000000000Version: TELEPATHY_GLIB_0.19.10 Extends: TELEPATHY_GLIB_0.19.9 Release: 0.19.10 tp_account_channel_request_dup_request tp_account_channel_request_new_vardict tp_address_g_variant_from_g_socket_address tp_base_client_add_approver_filter_vardict tp_base_client_add_handler_filter_vardict tp_base_client_add_observer_filter_vardict tp_channel_request_dup_hints tp_channel_request_dup_immutable_properties tp_contact_dup_location tp_dbus_tube_channel_dup_parameters_vardict tp_g_socket_address_from_g_variant tp_message_dup_part tp_message_set_variant tp_stream_tube_channel_dup_parameters_vardict tp_vardict_get_boolean tp_vardict_get_double tp_vardict_get_int32 tp_vardict_get_int64 tp_vardict_get_object_path tp_vardict_get_string tp_vardict_get_uint32 tp_vardict_get_uint64 tp_variant_convert tp_variant_type_classify telepathy-glib-0.24.2/telepathy-glib/versions/0.15.0.abi0000644000175000017500000000132312652510705017414 00000000000000Version: TELEPATHY_GLIB_0.15.0 Extends: TELEPATHY_GLIB_0.14.5 Release: 0.15.0 tp_base_client_delegate_channels_async tp_base_client_delegate_channels_finish tp_channel_dispatch_operation_claim_with_async tp_channel_dispatch_operation_claim_with_finish tp_channel_dispatcher_present_channel_async tp_channel_dispatcher_present_channel_finish tp_cli_channel_dispatcher_call_delegate_channels tp_cli_channel_dispatcher_call_present_channel tp_cli_channel_interface_sms_call_get_sms_length tp_cli_channel_interface_sms_run_get_sms_length tp_svc_channel_dispatcher_implement_delegate_channels tp_svc_channel_dispatcher_implement_present_channel tp_svc_channel_interface_sms_implement_get_sms_length tp_type_dbus_hash_o_28ss_29 telepathy-glib-0.24.2/telepathy-glib/versions/0.15.1.abi0000644000175000017500000000117612652510705017423 00000000000000Version: TELEPATHY_GLIB_0.15.1 Extends: TELEPATHY_GLIB_0.15.0 Release: 0.15.1 tp_base_contact_list_block_contacts_with_abuse_async tp_base_contact_list_block_contacts_with_abuse_finish tp_base_contact_list_mixin_blocking_iface_init tp_channel_dispatch_operation_close_channels_async tp_channel_dispatch_operation_close_channels_finish tp_connection_get_balance tp_connection_get_balance_uri tp_connection_get_feature_quark_balance tp_handle_set_to_identifier_map tp_text_channel_get_feature_quark_sms tp_text_channel_get_sms_flash tp_text_channel_get_sms_length_async tp_text_channel_get_sms_length_finish tp_text_channel_is_sms_channel telepathy-glib-0.24.2/telepathy-glib/versions/0.15.2.abi0000644000175000017500000000073212652510705017421 00000000000000Version: TELEPATHY_GLIB_0.15.2 Extends: TELEPATHY_GLIB_0.15.1 Release: 0.15.2 tp_channel_destroy_async tp_channel_destroy_finish tp_channel_dispatch_operation_destroy_channels_async tp_channel_dispatch_operation_destroy_channels_finish tp_channel_dispatch_operation_leave_channels_async tp_channel_dispatch_operation_leave_channels_finish tp_channel_get_feature_quark_password tp_channel_password_needed tp_channel_provide_password_async tp_channel_provide_password_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.15.3.abi0000644000175000017500000000074612652510705017427 00000000000000Version: TELEPATHY_GLIB_0.15.3 Extends: TELEPATHY_GLIB_0.15.2 Release: 0.15.3 tp_account_channel_request_set_delegate_to_preferred_handler tp_account_channel_request_set_delegated_channel_callback tp_base_client_set_delegated_channels_callback tp_channel_request_get_account tp_channel_request_get_preferred_handler tp_channel_request_get_user_action_time tp_message_get_pending_message_id tp_text_channel_ack_all_pending_messages_async tp_text_channel_ack_all_pending_messages_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.15.5.abi0000644000175000017500000000630412652510705017425 00000000000000Version: TELEPATHY_GLIB_0.15.5 Extends: TELEPATHY_GLIB_0.15.3 Release: 0.15.5 tp_account_get_feature_quark_connection tp_account_manager_new_with_factory tp_account_manager_set_default tp_automatic_client_factory_get_type tp_automatic_client_factory_new tp_channel_join_async tp_channel_join_finish tp_cm_message_set_message tp_connection_add_to_group_async tp_connection_add_to_group_finish tp_connection_authorize_publication_async tp_connection_authorize_publication_finish tp_connection_dup_contact_list tp_connection_get_account tp_connection_get_can_change_contact_list tp_connection_get_contact_groups tp_connection_get_contact_list_persists tp_connection_get_contact_list_state tp_connection_get_disjoint_groups tp_connection_get_feature_quark_contact_groups tp_connection_get_feature_quark_contact_list tp_connection_get_group_storage tp_connection_get_request_uses_message tp_connection_remove_contacts_async tp_connection_remove_contacts_finish tp_connection_remove_from_group_async tp_connection_remove_from_group_finish tp_connection_remove_group_async tp_connection_remove_group_finish tp_connection_rename_group_async tp_connection_rename_group_finish tp_connection_request_subscription_async tp_connection_request_subscription_finish tp_connection_set_group_members_async tp_connection_set_group_members_finish tp_connection_unpublish_async tp_connection_unpublish_finish tp_connection_unsubscribe_async tp_connection_unsubscribe_finish tp_contact_add_to_group_async tp_contact_add_to_group_finish tp_contact_authorize_publication_async tp_contact_authorize_publication_finish tp_contact_remove_async tp_contact_remove_finish tp_contact_remove_from_group_async tp_contact_remove_from_group_finish tp_contact_request_subscription_async tp_contact_request_subscription_finish tp_contact_unpublish_async tp_contact_unpublish_finish tp_contact_unsubscribe_async tp_contact_unsubscribe_finish tp_debug_sender_set_timestamps tp_file_transfer_channel_get_date tp_file_transfer_channel_get_description tp_file_transfer_channel_get_feature_quark_core tp_file_transfer_channel_get_filename tp_file_transfer_channel_get_mime_type tp_file_transfer_channel_get_size tp_file_transfer_channel_get_transferred_bytes tp_file_transfer_channel_get_type tp_file_transfer_channel_new tp_proxy_get_factory tp_simple_approver_new_with_factory tp_simple_client_factory_add_account_features tp_simple_client_factory_add_account_features_varargs tp_simple_client_factory_add_channel_features tp_simple_client_factory_add_channel_features_varargs tp_simple_client_factory_add_connection_features tp_simple_client_factory_add_connection_features_varargs tp_simple_client_factory_add_contact_features tp_simple_client_factory_add_contact_features_varargs tp_simple_client_factory_dup_account_features tp_simple_client_factory_dup_channel_features tp_simple_client_factory_dup_connection_features tp_simple_client_factory_dup_contact_features tp_simple_client_factory_ensure_account tp_simple_client_factory_ensure_channel tp_simple_client_factory_ensure_connection tp_simple_client_factory_ensure_contact tp_simple_client_factory_get_dbus_daemon tp_simple_client_factory_get_type tp_simple_client_factory_new tp_simple_handler_new_with_factory tp_simple_observer_new_with_factory telepathy-glib-0.24.2/telepathy-glib/versions/0.15.6.abi0000644000175000017500000000164212652510705017426 00000000000000Version: TELEPATHY_GLIB_0.15.6 Extends: TELEPATHY_GLIB_0.15.5 Release: 0.15.6 tp_dbus_properties_mixin_emit_properties_changed tp_dbus_properties_mixin_emit_properties_changed_varargs tp_channel_get_target_contact tp_channel_get_initiator_contact tp_channel_get_feature_quark_contacts tp_channel_group_get_contact_owner tp_channel_group_get_self_contact tp_channel_group_dup_members_contacts tp_channel_group_dup_local_pending_contacts tp_channel_group_dup_remote_pending_contacts tp_channel_group_get_local_pending_contact_info tp_cli_channel_interface_group_connect_to_handle_owners_changed_detailed tp_cli_channel_interface_group_connect_to_self_contact_changed tp_svc_channel_interface_group_emit_handle_owners_changed_detailed tp_svc_channel_interface_group_emit_self_contact_changed tp_protocol_get_avatar_requirements tp_dbus_tube_channel_get_parameters tp_dbus_tube_channel_get_service_name tp_dbus_tube_channel_get_type telepathy-glib-0.24.2/telepathy-glib/versions/0.15.8.abi0000644000175000017500000000171212652510705017426 00000000000000Version: TELEPATHY_GLIB_0.15.8 Extends: TELEPATHY_GLIB_0.15.6 Release: 0.15.8 tp_base_room_config_dup_channel tp_base_room_config_emit_properties_changed tp_base_room_config_get_type tp_base_room_config_iface_init tp_base_room_config_property_get_type tp_base_room_config_register_class tp_base_room_config_set_can_update_configuration tp_base_room_config_set_property_mutable tp_base_room_config_set_retrieved tp_cli_channel_interface_room_config_call_update_configuration tp_cli_channel_interface_subject_call_set_subject tp_dbus_properties_mixin_set tp_iface_quark_channel_interface_room tp_iface_quark_channel_interface_room_config tp_iface_quark_channel_interface_subject tp_svc_channel_interface_room_config_get_type tp_svc_channel_interface_room_config_implement_update_configuration tp_svc_channel_interface_room_get_type tp_svc_channel_interface_subject_get_type tp_svc_channel_interface_subject_implement_set_subject tp_svc_interface_get_dbus_properties_info telepathy-glib-0.24.2/telepathy-glib/versions/0.21.2.abi0000644000175000017500000000031712652510705017415 00000000000000Version: TELEPATHY_GLIB_0.21.2 Extends: TELEPATHY_GLIB_0.19.10 Release: 0.21.2 tp_cli_connection_connect_to_self_contact_changed tp_dbus_properties_mixin_dup_all tp_svc_connection_emit_self_contact_changed telepathy-glib-0.24.2/telepathy-glib/versions/0.11.11.abi0000644000175000017500000000357412652510705017504 00000000000000Version: TELEPATHY_GLIB_0.11.11 Extends: TELEPATHY_GLIB_0.11.9 Release: 0.11.11 tp_base_client_get_dbus_daemon tp_base_client_get_name tp_base_client_get_uniquify_name tp_base_connection_manager_add_protocol tp_base_protocol_get_immutable_properties tp_base_protocol_get_name tp_base_protocol_get_parameters tp_base_protocol_get_type tp_base_protocol_new_connection tp_channel_manager_type_foreach_channel_class tp_cli_channel_type_contact_search_call_more tp_cli_channel_type_contact_search_call_search tp_cli_channel_type_contact_search_call_stop tp_cli_channel_type_contact_search_connect_to_search_result_received tp_cli_channel_type_contact_search_connect_to_search_state_changed tp_cli_channel_type_contact_search_run_more tp_cli_channel_type_contact_search_run_search tp_cli_channel_type_contact_search_run_stop tp_cli_protocol_call_identify_account tp_cli_protocol_call_normalize_contact tp_connection_manager_get_protocol_object tp_dbus_properties_mixin_fill_properties_hash tp_iface_quark_channel_type_contact_search tp_iface_quark_protocol tp_protocol_can_register tp_protocol_dup_param_names tp_protocol_get_capabilities tp_protocol_get_english_name tp_protocol_get_feature_quark_core tp_protocol_get_feature_quark_parameters tp_protocol_get_icon_name tp_protocol_get_name tp_protocol_get_param tp_protocol_get_type tp_protocol_get_vcard_field tp_protocol_has_param tp_protocol_init_known_interfaces tp_protocol_new tp_proxy_has_interface tp_svc_channel_type_contact_search_emit_search_result_received tp_svc_channel_type_contact_search_emit_search_state_changed tp_svc_channel_type_contact_search_get_type tp_svc_channel_type_contact_search_implement_more tp_svc_channel_type_contact_search_implement_search tp_svc_channel_type_contact_search_implement_stop tp_svc_protocol_get_type tp_svc_protocol_implement_identify_account tp_svc_protocol_implement_normalize_contact tp_type_dbus_hash_sa_28sasas_29 telepathy-glib-0.24.2/telepathy-glib/versions/0.11.12.abi0000644000175000017500000000130312652510705017471 00000000000000Version: TELEPATHY_GLIB_0.11.12 Extends: TELEPATHY_GLIB_0.11.11 Release: 0.11.12 tp_account_channel_request_create_and_handle_channel_async tp_account_channel_request_create_and_handle_channel_finish tp_account_channel_request_create_channel_async tp_account_channel_request_create_channel_finish tp_account_channel_request_ensure_and_handle_channel_async tp_account_channel_request_ensure_and_handle_channel_finish tp_account_channel_request_ensure_channel_async tp_account_channel_request_ensure_channel_finish tp_account_channel_request_get_account tp_account_channel_request_get_request tp_account_channel_request_get_type tp_account_channel_request_get_user_action_time tp_account_channel_request_new telepathy-glib-0.24.2/telepathy-glib/versions/0.11.13.abi0000644000175000017500000000024112652510705017472 00000000000000Version: TELEPATHY_GLIB_0.11.13 Extends: TELEPATHY_GLIB_0.11.12 Release: 0.11.13 tp_error_quark tp_user_action_time_from_x11 tp_user_action_time_should_present telepathy-glib-0.24.2/telepathy-glib/versions/0.11.14.abi0000644000175000017500000000153612652510705017503 00000000000000Version: TELEPATHY_GLIB_0.11.14 Extends: TELEPATHY_GLIB_0.11.13 Release: 0.11.14 tp_base_channel_close tp_base_channel_destroyed tp_base_channel_get_connection tp_base_channel_get_initiator tp_base_channel_get_object_path tp_base_channel_get_target_handle tp_base_channel_get_type tp_base_channel_is_destroyed tp_base_channel_is_registered tp_base_channel_is_requested tp_base_channel_register tp_base_channel_reopened tp_base_client_add_account_features tp_base_client_add_account_features_varargs tp_base_client_add_channel_features tp_base_client_add_channel_features_varargs tp_base_client_add_connection_features tp_base_client_add_connection_features_varargs tp_base_client_get_account_manager tp_handle_channels_context_get_handler_info tp_simple_approver_new_with_am tp_simple_handler_new_with_am tp_simple_observer_new_with_am tp_type_dbus_array_of_ay telepathy-glib-0.24.2/telepathy-glib/versions/0.11.15.abi0000644000175000017500000000047712652510705017507 00000000000000Version: TELEPATHY_GLIB_0.11.15 Extends: TELEPATHY_GLIB_0.11.14 Release: 0.11.15 tp_channel_get_initiator_handle tp_channel_get_initiator_identifier tp_channel_get_requested tp_iface_quark_channel_interface_sms tp_svc_channel_interface_sms_get_type tp_type_dbus_array_of_a_7boa_7bsv_7d_7d tp_type_dbus_hash_oa_7bsv_7d telepathy-glib-0.24.2/telepathy-glib/versions/0.11.16.abi0000644000175000017500000000150612652510705017502 00000000000000Version: TELEPATHY_GLIB_0.11.16 Extends: TELEPATHY_GLIB_0.11.15 Release: 0.11.16 tp_svc_channel_interface_conference_emit_channel_removed tp_type_dbus_hash_uo tp_cli_channel_interface_conference_connect_to_channel_removed tp_cli_channel_interface_conference_connect_to_channel_merged tp_svc_channel_interface_conference_emit_channel_merged tp_iface_quark_channel_interface_conference tp_svc_channel_interface_conference_get_type tp_iface_quark_authentication_tls_certificate tp_iface_quark_channel_type_server_tls_connection tp_svc_authentication_tls_certificate_emit_accepted tp_svc_authentication_tls_certificate_emit_rejected tp_svc_authentication_tls_certificate_get_type tp_svc_authentication_tls_certificate_implement_accept tp_svc_authentication_tls_certificate_implement_reject tp_svc_channel_type_server_tls_connection_get_type telepathy-glib-0.24.2/telepathy-glib/versions/0.17.0.abi0000644000175000017500000000100612652510705017414 00000000000000Version: TELEPATHY_GLIB_0.17.0 Extends: TELEPATHY_GLIB_0.15.8 Release: 0.17.0 tp_connection_block_contacts_async tp_connection_block_contacts_finish tp_connection_can_report_abusive tp_connection_get_blocked_contacts tp_connection_get_feature_quark_contact_blocking tp_connection_get_feature_quark_contact_list_properties tp_connection_unblock_contacts_async tp_connection_unblock_contacts_finish tp_contact_block_async tp_contact_block_finish tp_contact_is_blocked tp_contact_unblock_async tp_contact_unblock_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.17.1.abi0000644000175000017500000000077112652510705017425 00000000000000Version: TELEPATHY_GLIB_0.17.1 Extends: TELEPATHY_GLIB_0.17.0 Release: 0.17.1 tp_svc_channel_interface_file_transfer_metadata_get_type tp_file_transfer_channel_provide_file_async tp_file_transfer_channel_get_service_name tp_type_dbus_hash_sas tp_file_transfer_channel_provide_file_finish tp_iface_quark_channel_interface_file_transfer_metadata tp_file_transfer_channel_get_metadata tp_file_transfer_channel_accept_file_async tp_file_transfer_channel_accept_file_finish tp_file_transfer_channel_get_state telepathy-glib-0.24.2/telepathy-glib/versions/0.17.2.abi0000644000175000017500000000073012652510705017421 00000000000000Version: TELEPATHY_GLIB_0.17.2 Extends: TELEPATHY_GLIB_0.17.1 Release: 0.17.2 tp_cli_protocol_interface_addressing_call_normalize_contact_uri tp_cli_protocol_interface_addressing_call_normalize_vcard_address tp_iface_quark_protocol_interface_addressing tp_protocol_addressing_get_type tp_svc_protocol_interface_addressing_get_type tp_svc_protocol_interface_addressing_implement_normalize_contact_uri tp_svc_protocol_interface_addressing_implement_normalize_vcard_address telepathy-glib-0.24.2/telepathy-glib/versions/0.17.3.abi0000644000175000017500000000023412652510705017421 00000000000000Version: TELEPATHY_GLIB_0.17.3 Extends: TELEPATHY_GLIB_0.17.2 Release: 0.17.3 tp_connection_can_set_contact_alias tp_connection_get_feature_quark_aliasing telepathy-glib-0.24.2/telepathy-glib/versions/0.17.5.abi0000644000175000017500000003561312652510705017434 00000000000000Version: TELEPATHY_GLIB_0.17.5 Extends: TELEPATHY_GLIB_0.17.3 Release: 0.17.5 tp_account_get_supersedes tp_base_call_channel_add_content tp_base_call_channel_get_call_members tp_base_call_channel_get_contents tp_base_call_channel_get_state tp_base_call_channel_get_type tp_base_call_channel_has_initial_audio tp_base_call_channel_has_initial_video tp_base_call_channel_has_mutable_contents tp_base_call_channel_is_accepted tp_base_call_channel_remote_accept tp_base_call_channel_remove_content tp_base_call_channel_remove_member tp_base_call_channel_set_state tp_base_call_channel_update_member_flags tp_base_call_content_add_stream tp_base_call_content_get_connection tp_base_call_content_get_disposition tp_base_call_content_get_media_type tp_base_call_content_get_name tp_base_call_content_get_object_path tp_base_call_content_get_streams tp_base_call_content_get_type tp_base_call_content_remove_stream tp_base_call_stream_get_connection tp_base_call_stream_get_local_sending_state tp_base_call_stream_get_object_path tp_base_call_stream_get_remote_sending_state tp_base_call_stream_get_type tp_base_call_stream_remove_member tp_base_call_stream_update_local_sending_state tp_base_call_stream_update_remote_sending_state tp_base_channel_get_self_handle tp_base_media_call_channel_get_type tp_base_media_call_content_get_local_media_description tp_base_media_call_content_get_type tp_base_media_call_content_offer_media_description_async tp_base_media_call_content_offer_media_description_finish tp_base_media_call_stream_add_endpoint tp_base_media_call_stream_get_endpoints tp_base_media_call_stream_get_local_candidates tp_base_media_call_stream_get_password tp_base_media_call_stream_get_receiving_state tp_base_media_call_stream_get_sending_state tp_base_media_call_stream_get_type tp_base_media_call_stream_get_username tp_base_media_call_stream_remove_endpoint tp_base_media_call_stream_set_local_sending tp_base_media_call_stream_set_relay_info tp_base_media_call_stream_set_stun_servers tp_base_media_call_stream_update_receiving_state tp_base_media_call_stream_update_sending_state tp_call_channel_accept_async tp_call_channel_accept_finish tp_call_channel_add_content_async tp_call_channel_add_content_finish tp_call_channel_get_contents tp_call_channel_get_feature_quark_core tp_call_channel_get_members tp_call_channel_get_state tp_call_channel_get_type tp_call_channel_hangup_async tp_call_channel_hangup_finish tp_call_channel_has_dtmf tp_call_channel_has_hardware_streaming tp_call_channel_has_initial_audio tp_call_channel_has_initial_video tp_call_channel_has_mutable_contents tp_call_channel_send_tones_async tp_call_channel_send_tones_finish tp_call_channel_set_queued_async tp_call_channel_set_queued_finish tp_call_channel_set_ringing_async tp_call_channel_set_ringing_finish tp_call_content_get_disposition tp_call_content_get_feature_quark_core tp_call_content_get_media_type tp_call_content_get_name tp_call_content_get_streams tp_call_content_get_type tp_call_content_init_known_interfaces tp_call_content_media_description_add_ssrc tp_call_content_media_description_append_codec tp_call_content_media_description_get_object_path tp_call_content_media_description_get_remote_contact tp_call_content_media_description_get_type tp_call_content_media_description_init_known_interfaces tp_call_content_media_description_new tp_call_content_remove_async tp_call_content_remove_finish tp_call_content_send_tones_async tp_call_content_send_tones_finish tp_call_state_reason_get_type tp_call_stream_can_request_receiving tp_call_stream_endpoint_add_new_candidate tp_call_stream_endpoint_add_new_candidates tp_call_stream_endpoint_get_object_path tp_call_stream_endpoint_get_state tp_call_stream_endpoint_get_type tp_call_stream_endpoint_init_known_interfaces tp_call_stream_endpoint_new tp_call_stream_endpoint_set_remote_credentials tp_call_stream_get_feature_quark_core tp_call_stream_get_local_sending_state tp_call_stream_get_remote_members tp_call_stream_get_type tp_call_stream_init_known_interfaces tp_call_stream_request_receiving_async tp_call_stream_request_receiving_finish tp_call_stream_set_sending_async tp_call_stream_set_sending_finish tp_cli_call_content_call_remove tp_cli_call_content_connect_to_streams_added tp_cli_call_content_connect_to_streams_removed tp_cli_call_content_interface_audio_control_call_report_input_volume tp_cli_call_content_interface_audio_control_call_report_output_volume tp_cli_call_content_interface_dtmf_call_multiple_tones tp_cli_call_content_interface_dtmf_call_start_tone tp_cli_call_content_interface_dtmf_call_stop_tone tp_cli_call_content_interface_dtmf_connect_to_sending_tones tp_cli_call_content_interface_dtmf_connect_to_stopped_tones tp_cli_call_content_interface_dtmf_connect_to_tones_deferred tp_cli_call_content_interface_media_call_acknowledge_dtmf_change tp_cli_call_content_interface_media_call_fail tp_cli_call_content_interface_media_call_update_local_media_description tp_cli_call_content_interface_media_connect_to_dtmf_change_requested tp_cli_call_content_interface_media_connect_to_local_media_description_changed tp_cli_call_content_interface_media_connect_to_media_description_offer_done tp_cli_call_content_interface_media_connect_to_media_descriptions_removed tp_cli_call_content_interface_media_connect_to_new_media_description_offer tp_cli_call_content_interface_media_connect_to_remote_media_descriptions_changed tp_cli_call_content_interface_video_control_connect_to_bitrate_changed tp_cli_call_content_interface_video_control_connect_to_framerate_changed tp_cli_call_content_interface_video_control_connect_to_key_frame_requested tp_cli_call_content_interface_video_control_connect_to_mtu_changed tp_cli_call_content_interface_video_control_connect_to_video_resolution_changed tp_cli_call_content_media_description_call_accept tp_cli_call_content_media_description_call_reject tp_cli_call_stream_call_request_receiving tp_cli_call_stream_call_set_sending tp_cli_call_stream_connect_to_local_sending_state_changed tp_cli_call_stream_connect_to_remote_members_changed tp_cli_call_stream_endpoint_call_accept_selected_candidate_pair tp_cli_call_stream_endpoint_call_reject_selected_candidate_pair tp_cli_call_stream_endpoint_call_set_controlling tp_cli_call_stream_endpoint_call_set_endpoint_state tp_cli_call_stream_endpoint_call_set_selected_candidate_pair tp_cli_call_stream_endpoint_connect_to_candidate_pair_selected tp_cli_call_stream_endpoint_connect_to_controlling_changed tp_cli_call_stream_endpoint_connect_to_endpoint_state_changed tp_cli_call_stream_endpoint_connect_to_remote_candidates_added tp_cli_call_stream_endpoint_connect_to_remote_credentials_set tp_cli_call_stream_interface_media_call_add_candidates tp_cli_call_stream_interface_media_call_complete_receiving_state_change tp_cli_call_stream_interface_media_call_complete_sending_state_change tp_cli_call_stream_interface_media_call_fail tp_cli_call_stream_interface_media_call_finish_initial_candidates tp_cli_call_stream_interface_media_call_report_receiving_failure tp_cli_call_stream_interface_media_call_report_sending_failure tp_cli_call_stream_interface_media_call_set_credentials tp_cli_call_stream_interface_media_connect_to_endpoints_changed tp_cli_call_stream_interface_media_connect_to_ice_restart_requested tp_cli_call_stream_interface_media_connect_to_local_candidates_added tp_cli_call_stream_interface_media_connect_to_local_credentials_changed tp_cli_call_stream_interface_media_connect_to_receiving_state_changed tp_cli_call_stream_interface_media_connect_to_relay_info_changed tp_cli_call_stream_interface_media_connect_to_sending_state_changed tp_cli_call_stream_interface_media_connect_to_server_info_retrieved tp_cli_call_stream_interface_media_connect_to_stun_servers_changed tp_cli_channel_interface_captcha_authentication_call_answer_captchas tp_cli_channel_interface_captcha_authentication_call_cancel_captcha tp_cli_channel_interface_captcha_authentication_call_get_captcha_data tp_cli_channel_interface_captcha_authentication_call_get_captchas tp_cli_channel_type_call_call_accept tp_cli_channel_type_call_call_add_content tp_cli_channel_type_call_call_hangup tp_cli_channel_type_call_call_set_queued tp_cli_channel_type_call_call_set_ringing tp_cli_channel_type_call_connect_to_call_members_changed tp_cli_channel_type_call_connect_to_call_state_changed tp_cli_channel_type_call_connect_to_content_added tp_cli_channel_type_call_connect_to_content_removed tp_cli_connection_interface_addressing_call_get_contacts_by_uri tp_cli_connection_interface_addressing_call_get_contacts_by_vcard_field tp_cli_connection_interface_contact_list_call_download tp_connection_disconnect_async tp_connection_disconnect_finish tp_iface_quark_call_content tp_iface_quark_call_content_interface_audio_control tp_iface_quark_call_content_interface_dtmf tp_iface_quark_call_content_interface_media tp_iface_quark_call_content_interface_video_control tp_iface_quark_call_content_media_description tp_iface_quark_call_content_media_description_interface_rtcp_extended_reports tp_iface_quark_call_content_media_description_interface_rtcp_feedback tp_iface_quark_call_content_media_description_interface_rtp_header_extensions tp_iface_quark_call_stream tp_iface_quark_call_stream_endpoint tp_iface_quark_call_stream_interface_media tp_iface_quark_channel_interface_captcha_authentication tp_iface_quark_channel_type_call tp_iface_quark_connection_interface_addressing tp_svc_call_content_emit_streams_added tp_svc_call_content_emit_streams_removed tp_svc_call_content_get_type tp_svc_call_content_implement_remove tp_svc_call_content_interface_audio_control_get_type tp_svc_call_content_interface_audio_control_implement_report_input_volume tp_svc_call_content_interface_audio_control_implement_report_output_volume tp_svc_call_content_interface_dtmf_emit_sending_tones tp_svc_call_content_interface_dtmf_emit_stopped_tones tp_svc_call_content_interface_dtmf_emit_tones_deferred tp_svc_call_content_interface_dtmf_get_type tp_svc_call_content_interface_dtmf_implement_multiple_tones tp_svc_call_content_interface_dtmf_implement_start_tone tp_svc_call_content_interface_dtmf_implement_stop_tone tp_svc_call_content_interface_media_emit_dtmf_change_requested tp_svc_call_content_interface_media_emit_local_media_description_changed tp_svc_call_content_interface_media_emit_media_description_offer_done tp_svc_call_content_interface_media_emit_media_descriptions_removed tp_svc_call_content_interface_media_emit_new_media_description_offer tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed tp_svc_call_content_interface_media_get_type tp_svc_call_content_interface_media_implement_acknowledge_dtmf_change tp_svc_call_content_interface_media_implement_fail tp_svc_call_content_interface_media_implement_update_local_media_description tp_svc_call_content_interface_video_control_emit_bitrate_changed tp_svc_call_content_interface_video_control_emit_framerate_changed tp_svc_call_content_interface_video_control_emit_key_frame_requested tp_svc_call_content_interface_video_control_emit_mtu_changed tp_svc_call_content_interface_video_control_emit_video_resolution_changed tp_svc_call_content_interface_video_control_get_type tp_svc_call_content_media_description_get_type tp_svc_call_content_media_description_implement_accept tp_svc_call_content_media_description_implement_reject tp_svc_call_content_media_description_interface_rtcp_extended_reports_get_type tp_svc_call_content_media_description_interface_rtcp_feedback_get_type tp_svc_call_content_media_description_interface_rtp_header_extensions_get_type tp_svc_call_stream_emit_local_sending_state_changed tp_svc_call_stream_emit_remote_members_changed tp_svc_call_stream_endpoint_emit_candidate_pair_selected tp_svc_call_stream_endpoint_emit_controlling_changed tp_svc_call_stream_endpoint_emit_endpoint_state_changed tp_svc_call_stream_endpoint_emit_remote_candidates_added tp_svc_call_stream_endpoint_emit_remote_credentials_set tp_svc_call_stream_endpoint_get_type tp_svc_call_stream_endpoint_implement_accept_selected_candidate_pair tp_svc_call_stream_endpoint_implement_reject_selected_candidate_pair tp_svc_call_stream_endpoint_implement_set_controlling tp_svc_call_stream_endpoint_implement_set_endpoint_state tp_svc_call_stream_endpoint_implement_set_selected_candidate_pair tp_svc_call_stream_get_type tp_svc_call_stream_implement_request_receiving tp_svc_call_stream_implement_set_sending tp_svc_call_stream_interface_media_emit_endpoints_changed tp_svc_call_stream_interface_media_emit_ice_restart_requested tp_svc_call_stream_interface_media_emit_local_candidates_added tp_svc_call_stream_interface_media_emit_local_credentials_changed tp_svc_call_stream_interface_media_emit_receiving_state_changed tp_svc_call_stream_interface_media_emit_relay_info_changed tp_svc_call_stream_interface_media_emit_sending_state_changed tp_svc_call_stream_interface_media_emit_server_info_retrieved tp_svc_call_stream_interface_media_emit_stun_servers_changed tp_svc_call_stream_interface_media_get_type tp_svc_call_stream_interface_media_implement_add_candidates tp_svc_call_stream_interface_media_implement_complete_receiving_state_change tp_svc_call_stream_interface_media_implement_complete_sending_state_change tp_svc_call_stream_interface_media_implement_fail tp_svc_call_stream_interface_media_implement_finish_initial_candidates tp_svc_call_stream_interface_media_implement_report_receiving_failure tp_svc_call_stream_interface_media_implement_report_sending_failure tp_svc_call_stream_interface_media_implement_set_credentials tp_svc_channel_interface_captcha_authentication_get_type tp_svc_channel_interface_captcha_authentication_implement_answer_captchas tp_svc_channel_interface_captcha_authentication_implement_cancel_captcha tp_svc_channel_interface_captcha_authentication_implement_get_captcha_data tp_svc_channel_interface_captcha_authentication_implement_get_captchas tp_svc_channel_type_call_emit_call_members_changed tp_svc_channel_type_call_emit_call_state_changed tp_svc_channel_type_call_emit_content_added tp_svc_channel_type_call_emit_content_removed tp_svc_channel_type_call_get_type tp_svc_channel_type_call_implement_accept tp_svc_channel_type_call_implement_add_content tp_svc_channel_type_call_implement_hangup tp_svc_channel_type_call_implement_set_queued tp_svc_channel_type_call_implement_set_ringing tp_svc_connection_interface_addressing_get_type tp_svc_connection_interface_addressing_implement_get_contacts_by_uri tp_svc_connection_interface_addressing_implement_get_contacts_by_vcard_field tp_svc_connection_interface_contact_list_implement_download tp_type_dbus_array__28usua_7bsv_7d_29_28usua_7bsv_7d_29 tp_type_dbus_array_of_a_7buu_7d tp_type_dbus_array_ussuas tp_type_dbus_array_usua_7bsv_7d tp_type_dbus_array_usuuba_7bss_7d tp_type_dbus_hash_su tp_type_dbus_hash_ua_28usuuba_7bss_7d_29 tp_type_dbus_struct__28usua_7bsv_7d_29_28usua_7bsv_7d_29 tp_type_dbus_struct_ussuas tp_type_dbus_struct_usua_7bsv_7d tp_type_dbus_struct_usuuba_7bss_7d tp_unix_connection_receive_credentials_with_byte_async tp_unix_connection_receive_credentials_with_byte_finish tp_unix_connection_send_credentials_with_byte_async tp_unix_connection_send_credentials_with_byte_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.17.6.abi0000644000175000017500000000246412652510705017433 00000000000000Version: TELEPATHY_GLIB_0.17.6 Extends: TELEPATHY_GLIB_0.17.5 Release: 0.17.6 tp_account_dup_detailed_error_vardict tp_account_dup_parameters_vardict tp_account_dup_storage_identifier_variant tp_account_dup_storage_specific_information_vardict_async tp_account_dup_storage_specific_information_vardict_finish tp_account_update_parameters_vardict_async tp_account_update_parameters_vardict_finish tp_base_media_call_channel_get_local_hold_state tp_call_channel_has_hold tp_call_channel_request_hold_async tp_call_channel_request_hold_finish tp_call_content_media_description_add_rtcp_extended_reports_interface tp_call_content_media_description_add_rtcp_feedback_interface tp_call_content_media_description_add_rtcp_feedback_message tp_call_content_media_description_add_rtp_header_extension tp_call_content_media_description_add_rtp_header_extensions_interface tp_call_content_media_description_set_does_avpf tp_call_content_media_description_set_rtcp_extended_reports tp_call_content_media_description_set_rtcp_feedback_minimum_interval tp_capabilities_supports_audio_call tp_capabilities_supports_audio_video_call tp_capabilities_supports_file_transfer tp_connection_manager_dup_protocols tp_list_connection_managers_async tp_list_connection_managers_finish tp_protocol_borrow_params tp_protocol_dup_param tp_protocol_dup_params telepathy-glib-0.24.2/telepathy-glib/versions/0.17.7.abi0000644000175000017500000000017312652510705017427 00000000000000Version: TELEPATHY_GLIB_0.17.7 Extends: TELEPATHY_GLIB_0.17.6 Release: 0.17.7 tp_base_media_call_stream_get_local_sending telepathy-glib-0.24.2/telepathy-glib/versions/0.23.0.abi0000644000175000017500000000154712652510705017423 00000000000000Version: TELEPATHY_GLIB_0.23.0 Extends: TELEPATHY_GLIB_0.21.2 Release: 0.23.0 tp_cli_channel_dispatcher_interface_messages1_call_send_message tp_cli_connection_interface_renaming_call_request_rename tp_cli_connection_interface_renaming_connect_to_renamed tp_cli_connection_interface_sidecars1_call_ensure_sidecar tp_iface_quark_channel_dispatcher_interface_messages1 tp_iface_quark_connection_interface_renaming tp_iface_quark_connection_interface_sidecars1 tp_svc_channel_dispatcher_interface_messages1_get_type tp_svc_channel_dispatcher_interface_messages1_implement_send_message tp_svc_connection_interface_renaming_emit_renamed tp_svc_connection_interface_renaming_get_type tp_svc_connection_interface_renaming_implement_request_rename tp_svc_connection_interface_sidecars1_get_type tp_svc_connection_interface_sidecars1_implement_ensure_sidecar tp_value_array_free telepathy-glib-0.24.2/telepathy-glib/versions/0.23.1.abi0000644000175000017500000000146312652510705017421 00000000000000Version: TELEPATHY_GLIB_0.23.1 Extends: TELEPATHY_GLIB_0.23.0 Release: 0.23.1 tp_connection_manager_param_dup_variant_type tp_presence_status_spec_can_set_on_self tp_presence_status_spec_copy tp_presence_status_spec_free tp_presence_status_spec_get_name tp_presence_status_spec_get_presence_type tp_presence_status_spec_get_type tp_presence_status_spec_has_message tp_presence_status_spec_new tp_protocol_dup_presence_statuses tp_protocol_get_addressable_uri_schemes tp_protocol_get_addressable_vcard_fields tp_protocol_identify_account_async tp_protocol_identify_account_finish tp_protocol_normalize_contact_async tp_protocol_normalize_contact_finish tp_protocol_normalize_contact_uri_async tp_protocol_normalize_contact_uri_finish tp_protocol_normalize_vcard_address_async tp_protocol_normalize_vcard_address_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.23.2.abi0000644000175000017500000000071112652510705017415 00000000000000Version: TELEPATHY_GLIB_0.23.2 Extends: TELEPATHY_GLIB_0.23.1 Release: 0.23.2 tp_account_channel_request_new_dbus_tube tp_account_channel_request_new_stream_tube tp_account_channel_request_set_conference_initial_channels tp_account_channel_request_set_file_transfer_hash tp_account_channel_request_set_initial_invitee_ids tp_account_channel_request_set_initial_invitees tp_account_channel_request_set_sms_channel tp_base_connection_get_account_path_suffix telepathy-glib-0.24.2/telepathy-glib/versions/0.23.3.abi0000644000175000017500000000021412652510705017414 00000000000000Version: TELEPATHY_GLIB_0.23.3 Extends: TELEPATHY_GLIB_0.23.2 Release: 0.23.3 tp_protocol_dup_immutable_properties tp_protocol_new_vardict telepathy-glib-0.24.2/telepathy-glib/versions/0.13.10.abi0000644000175000017500000000172712652510705017503 00000000000000Version: TELEPATHY_GLIB_0.13.10 Extends: TELEPATHY_GLIB_0.13.9 Release: 0.13.10 tp_channel_close_async tp_channel_close_finish tp_channel_leave_async tp_channel_leave_finish tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id tp_cm_message_new_text tp_intset_difference_update tp_intset_union_update tp_message_get_message_type tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id tp_text_channel_ack_message_async tp_text_channel_ack_message_finish tp_text_channel_ack_messages_async tp_text_channel_ack_messages_finish tp_text_channel_get_delivery_reporting_support tp_text_channel_get_feature_quark_incoming_messages tp_text_channel_get_message_part_support_flags tp_text_channel_get_pending_messages tp_text_channel_get_supported_content_types tp_text_channel_get_type tp_text_channel_new tp_text_channel_send_message_async tp_text_channel_send_message_finish tp_text_channel_set_chat_state_async tp_text_channel_set_chat_state_finish telepathy-glib-0.24.2/telepathy-glib/versions/0.13.11.abi0000644000175000017500000000105512652510705017476 00000000000000Version: TELEPATHY_GLIB_0.13.11 Extends: TELEPATHY_GLIB_0.13.10 Release: 0.13.11 tp_contact_search_get_account tp_contact_search_result_get_identifier tp_contact_search_start tp_contact_search_new_finish tp_contact_search_reset_finish tp_contact_search_reset_async tp_contact_search_get_type tp_capabilities_supports_contact_search tp_contact_search_get_server tp_contact_search_new_async tp_contact_search_result_get_field tp_contact_search_result_get_type tp_contact_search_result_get_fields tp_contact_search_get_limit tp_contact_search_get_search_keys telepathy-glib-0.24.2/telepathy-glib/versions/0.13.12.abi0000644000175000017500000000043112652510705017474 00000000000000Version: TELEPATHY_GLIB_0.13.12 Extends: TELEPATHY_GLIB_0.13.11 Release: 0.13.12 tp_cli_channel_type_file_transfer_connect_to_uri_defined tp_contact_get_publish_request tp_contact_get_publish_state tp_contact_get_subscribe_state tp_svc_channel_type_file_transfer_emit_uri_defined telepathy-glib-0.24.2/telepathy-glib/versions/0.11.0.abi0000644000175000017500000000066112652510705017414 00000000000000Version: TELEPATHY_GLIB_0.11.0 Extends: TELEPATHY_GLIB_0.9.2 Release: 0.11.0 tp_address_variant_from_g_socket_address tp_cli_connection_interface_balance_connect_to_balance_changed tp_g_socket_address_from_variant tp_g_value_slice_new_byte tp_iface_quark_connection_interface_balance tp_svc_connection_interface_balance_emit_balance_changed tp_svc_connection_interface_balance_get_type tp_type_dbus_struct_ius tp_value_array_unpack telepathy-glib-0.24.2/telepathy-glib/versions/0.13.13.abi0000644000175000017500000000031012652510705017471 00000000000000Version: TELEPATHY_GLIB_0.13.13 Extends: TELEPATHY_GLIB_0.13.12 Release: 0.13.13 tp_debug_sender_add_message_vprintf tp_debug_sender_add_message_printf tp_account_channel_request_get_channel_request telepathy-glib-0.24.2/telepathy-glib/versions/0.11.1.abi0000644000175000017500000000027012652510705017411 00000000000000Version: TELEPATHY_GLIB_0.11.1 Extends: TELEPATHY_GLIB_0.11.0 Release: 0.11.1 tp_contact_get_location tp_account_set_avatar_finish tp_account_set_avatar_async tp_type_dbus_array_of_y telepathy-glib-0.24.2/telepathy-glib/versions/0.13.14.abi0000644000175000017500000000143012652510705017476 00000000000000Version: TELEPATHY_GLIB_0.13.14 Extends: TELEPATHY_GLIB_0.13.13 Release: 0.13.14 tp_account_channel_request_create_and_observe_channel_async tp_account_channel_request_create_and_observe_channel_finish tp_account_channel_request_ensure_and_observe_channel_async tp_account_channel_request_ensure_and_observe_channel_finish tp_account_channel_request_set_hints tp_capabilities_supports_room_list tp_channel_request_get_hints tp_channel_request_get_immutable_properties tp_channel_request_set_channel_factory tp_cli_dbus_properties_connect_to_properties_changed tp_contact_get_contact_groups tp_contact_set_contact_groups_async tp_contact_set_contact_groups_finish tp_handle_channels_context_get_requests tp_observe_channels_context_get_requests tp_svc_dbus_properties_emit_properties_changed telepathy-glib-0.24.2/telepathy-glib/versions/0.13.15.abi0000644000175000017500000000036012652510705017500 00000000000000Version: TELEPATHY_GLIB_0.13.15 Extends: TELEPATHY_GLIB_0.13.14 Release: 0.13.15 tp_base_password_channel_get_type tp_simple_password_manager_prompt_for_channel_finish tp_simple_password_manager_prompt_for_channel_async tp_utf8_make_valid telepathy-glib-0.24.2/telepathy-glib/versions/0.11.3.abi0000644000175000017500000000441512652510705017420 00000000000000Version: TELEPATHY_GLIB_0.11.3 Extends: TELEPATHY_GLIB_0.11.1 Release: 0.11.3 tp_base_connection_get_dbus_daemon tp_base_connection_manager_get_dbus_daemon tp_capabilities_get_channel_classes tp_capabilities_get_type tp_capabilities_is_specific_to_contact tp_capabilities_supports_text_chatrooms tp_capabilities_supports_text_chats tp_channel_get_chat_state tp_channel_get_feature_quark_chat_states tp_channel_get_feature_quark_core tp_channel_get_feature_quark_group tp_cli_connection_interface_contact_info_call_get_contact_info tp_cli_connection_interface_contact_info_call_refresh_contact_info tp_cli_connection_interface_contact_info_call_request_contact_info tp_cli_connection_interface_contact_info_call_set_contact_info tp_cli_connection_interface_contact_info_connect_to_contact_info_changed tp_cli_connection_interface_contact_info_run_get_contact_info tp_cli_connection_interface_contact_info_run_refresh_contact_info tp_cli_connection_interface_contact_info_run_request_contact_info tp_cli_connection_interface_contact_info_run_set_contact_info tp_connection_get_capabilities tp_connection_get_feature_quark_capabilities tp_connection_get_feature_quark_connected tp_connection_get_feature_quark_core tp_connection_manager_get_feature_quark_core tp_connection_manager_param_copy tp_connection_manager_param_free tp_connection_manager_param_get_type tp_connection_manager_protocol_copy tp_connection_manager_protocol_free tp_connection_manager_protocol_get_type tp_contact_get_capabilities tp_dbus_daemon_register_object tp_dbus_daemon_unregister_object tp_iface_quark_connection_interface_contact_info tp_intset_get_type tp_proxy_is_prepared tp_proxy_prepare_async tp_proxy_prepare_finish tp_svc_connection_interface_contact_info_emit_contact_info_changed tp_svc_connection_interface_contact_info_get_type tp_svc_connection_interface_contact_info_implement_get_contact_info tp_svc_connection_interface_contact_info_implement_refresh_contact_info tp_svc_connection_interface_contact_info_implement_request_contact_info tp_svc_connection_interface_contact_info_implement_set_contact_info tp_type_dbus_array_sasas tp_type_dbus_array_sasuu tp_type_dbus_hash_ua_28sasas_29 tp_type_dbus_struct_sasas tp_type_dbus_struct_sasuu tp_weak_ref_destroy tp_weak_ref_dup_object tp_weak_ref_get_user_data tp_weak_ref_new telepathy-glib-0.24.2/telepathy-glib/versions/0.13.16.abi0000644000175000017500000000055712652510705017511 00000000000000Version: TELEPATHY_GLIB_0.13.16 Extends: TELEPATHY_GLIB_0.13.15 Release: 0.13.16 tp_base_client_set_observer_delay_approvers tp_connection_get_protocol_name tp_connection_bind_connection_status_to_property tp_text_channel_get_message_types tp_text_channel_supports_message_type tp_connection_get_connection_manager_name tp_account_bind_connection_status_to_property telepathy-glib-0.24.2/telepathy-glib/versions/0.11.4.abi0000644000175000017500000000050012652510705017410 00000000000000Version: TELEPATHY_GLIB_0.11.4 Extends: TELEPATHY_GLIB_0.11.3 Release: 0.11.4 tp_avatar_requirements_copy tp_avatar_requirements_destroy tp_avatar_requirements_get_type tp_avatar_requirements_new tp_connection_get_avatar_requirements tp_connection_get_detailed_error tp_connection_get_feature_quark_avatar_requirements telepathy-glib-0.24.2/telepathy-glib/versions/0.11.5.abi0000644000175000017500000000277412652510705017430 00000000000000Version: TELEPATHY_GLIB_0.11.5 Extends: TELEPATHY_GLIB_0.11.4 Release: 0.11.5 tp_add_dispatch_operation_context_accept tp_add_dispatch_operation_context_delay tp_add_dispatch_operation_context_fail tp_add_dispatch_operation_context_get_type tp_base_client_add_approver_filter tp_base_client_add_observer_filter tp_base_client_get_bus_name tp_base_client_get_object_path tp_base_client_get_type tp_base_client_implement_add_dispatch_operation tp_base_client_implement_observe_channels tp_base_client_register tp_base_client_set_observer_recover tp_base_client_take_approver_filter tp_base_client_take_observer_filter tp_channel_dispatch_operation_borrow_account tp_channel_dispatch_operation_borrow_channels tp_channel_dispatch_operation_borrow_connection tp_channel_dispatch_operation_borrow_immutable_properties tp_channel_dispatch_operation_borrow_possible_handlers tp_channel_dispatch_operation_claim_async tp_channel_dispatch_operation_claim_finish tp_channel_dispatch_operation_get_feature_quark_core tp_channel_dispatch_operation_handle_with_async tp_channel_dispatch_operation_handle_with_finish tp_cm_info_source_get_type tp_contact_feature_get_type tp_dbus_error_get_type tp_dbus_name_type_get_type tp_dbus_properties_mixin_flags_get_type tp_observe_channels_context_accept tp_observe_channels_context_delay tp_observe_channels_context_fail tp_observe_channels_context_get_type tp_observe_channels_context_is_recovering tp_simple_approver_get_type tp_simple_approver_new tp_simple_observer_get_type tp_simple_observer_new telepathy-glib-0.24.2/telepathy-glib/versions/0.11.6.abi0000644000175000017500000000264112652510705017422 00000000000000Version: TELEPATHY_GLIB_0.11.6 Extends: TELEPATHY_GLIB_0.11.5 Release: 0.11.6 tp_account_get_changing_presence tp_base_client_add_handler_capabilities tp_base_client_add_handler_capabilities_varargs tp_base_client_add_handler_capability tp_base_client_add_handler_filter tp_base_client_be_a_handler tp_base_client_get_handled_channels tp_base_client_get_pending_requests tp_base_client_implement_handle_channels tp_base_client_set_handler_bypass_approval tp_base_client_set_handler_request_notification tp_base_client_take_handler_filter tp_base_client_unregister tp_cli_channel_dispatch_operation_call_handle_with_time tp_cli_channel_interface_dtmf_call_multiple_tones tp_cli_channel_interface_dtmf_connect_to_sending_tones tp_cli_channel_interface_dtmf_connect_to_stopped_tones tp_cli_channel_interface_dtmf_run_multiple_tones tp_contact_get_avatar_file tp_contact_get_avatar_mime_type tp_handle_channels_context_accept tp_handle_channels_context_delay tp_handle_channels_context_fail tp_handle_channels_context_get_type tp_handle_set_clear tp_handle_set_copy tp_handle_set_get_type tp_handle_set_is_empty tp_intset_fast_iter_init tp_intset_fast_iter_next tp_intset_is_empty tp_simple_handler_get_type tp_simple_handler_new tp_svc_channel_dispatch_operation_implement_handle_with_time tp_svc_channel_interface_dtmf_emit_sending_tones tp_svc_channel_interface_dtmf_emit_stopped_tones tp_svc_channel_interface_dtmf_implement_multiple_tones telepathy-glib-0.24.2/telepathy-glib/versions/0.11.7.abi0000644000175000017500000000346112652510705017424 00000000000000Version: TELEPATHY_GLIB_0.11.7 Extends: TELEPATHY_GLIB_0.11.6 Release: 0.11.7 tp_account_get_detailed_error tp_channel_dispatch_operation_handle_with_time_async tp_channel_dispatch_operation_handle_with_time_finish tp_cli_channel_interface_service_point_connect_to_service_point_changed tp_cli_connection_interface_anonymity_connect_to_anonymity_modes_changed tp_cli_connection_interface_service_point_connect_to_service_points_changed tp_connection_get_contact_info_flags tp_connection_get_contact_info_supported_fields tp_connection_get_feature_quark_contact_info tp_connection_refresh_contact_info tp_connection_set_contact_info_async tp_connection_set_contact_info_finish tp_contact_get_contact_info tp_contact_info_field_copy tp_contact_info_field_free tp_contact_info_field_get_type tp_contact_info_field_new tp_contact_info_field_spec_copy tp_contact_info_field_spec_free tp_contact_info_field_spec_get_type tp_contact_info_list_copy tp_contact_info_list_free tp_contact_info_list_get_type tp_contact_info_spec_list_copy tp_contact_info_spec_list_free tp_contact_info_spec_list_get_type tp_contact_request_contact_info_async tp_contact_request_contact_info_finish tp_handle_set_new_from_array tp_iface_quark_channel_interface_anonymity tp_iface_quark_channel_interface_service_point tp_iface_quark_connection_interface_anonymity tp_iface_quark_connection_interface_service_point tp_svc_channel_interface_anonymity_get_type tp_svc_channel_interface_service_point_emit_service_point_changed tp_svc_channel_interface_service_point_get_type tp_svc_connection_interface_anonymity_emit_anonymity_modes_changed tp_svc_connection_interface_anonymity_get_type tp_svc_connection_interface_service_point_emit_service_points_changed tp_svc_connection_interface_service_point_get_type tp_type_dbus_array__28us_29as tp_type_dbus_struct__28us_29as telepathy-glib-0.24.2/telepathy-glib/versions/0.11.9.abi0000644000175000017500000000075212652510705017426 00000000000000Version: TELEPATHY_GLIB_0.11.9 Extends: TELEPATHY_GLIB_0.11.7 Release: 0.11.9 tp_account_get_service tp_account_set_service_async tp_account_set_service_finish tp_cli_connection_interface_cellular_connect_to_imsi_changed tp_iface_quark_account_interface_storage tp_iface_quark_connection_interface_cellular tp_simple_async_report_success_in_idle tp_svc_account_interface_storage_get_type tp_svc_connection_interface_cellular_emit_imsi_changed tp_svc_connection_interface_cellular_get_type telepathy-glib-0.24.2/telepathy-glib/versions/0.18.0.abi0000644000175000017500000000056712652510705017430 00000000000000Version: TELEPATHY_GLIB_0.18.0 Extends: TELEPATHY_GLIB_0.17.7 Release: 0.18.0 tp_dbus_tube_channel_accept_async tp_dbus_tube_channel_accept_finish tp_dbus_tube_channel_offer_async tp_dbus_tube_channel_offer_finish tp_dbus_tube_channel_feature_quark_core tp_base_contact_list_get_download_at_connection tp_base_contact_list_download_async tp_base_contact_list_download_finishtelepathy-glib-0.24.2/telepathy-glib/versions/0.7.0.abi0000644000175000017500000003501112652510705017336 00000000000000Version: TELEPATHY_GLIB_0.7.0 Extends: - # not a typo - we only introduced versioned symbols in 0.7.1 Release: 0.7.1 tp_base_connection_add_interfaces tp_base_connection_change_status tp_base_connection_dbus_request_handles tp_base_connection_finish_shutdown tp_base_connection_get_handles tp_base_connection_get_type tp_base_connection_manager_get_type tp_base_connection_manager_register tp_base_connection_register tp_channel_factory_iface_close_all tp_channel_factory_iface_connected tp_channel_factory_iface_connecting tp_channel_factory_iface_disconnected tp_channel_factory_iface_emit_channel_error tp_channel_factory_iface_emit_new_channel tp_channel_factory_iface_foreach tp_channel_factory_iface_get_type tp_channel_factory_iface_request tp_channel_iface_get_type tp_cm_param_filter_string_nonempty tp_cm_param_filter_uint_nonzero tp_cm_param_setter_offset tp_dbus_g_method_return_not_implemented tp_dbus_specialized_value_slice_new tp_debug_set_all_flags tp_debug_set_flags tp_debug_set_flags_from_env tp_debug_set_flags_from_string tp_debug_set_persistent tp_dynamic_handle_repo_get_type tp_dynamic_handle_repo_lookup_exact tp_error_get_type tp_errors_quark tp_escape_as_identifier tp_external_group_mixin_finalize tp_external_group_mixin_iface_init tp_external_group_mixin_init tp_g_hash_table_update tp_g_ptr_array_contains tp_g_set_error_invalid_handle_type tp_g_set_error_unsupported_handle_type tp_g_value_slice_dup tp_g_value_slice_free tp_g_value_slice_new tp_get_bus tp_get_bus_proxy tp_group_mixin_add_handle_owner tp_group_mixin_add_members tp_group_mixin_change_flags tp_group_mixin_change_members tp_group_mixin_class_get_offset_quark tp_group_mixin_class_init tp_group_mixin_class_set_remove_with_reason_func tp_group_mixin_finalize tp_group_mixin_get_all_members tp_group_mixin_get_group_flags tp_group_mixin_get_handle_owners tp_group_mixin_get_local_pending_members tp_group_mixin_get_local_pending_members_with_info tp_group_mixin_get_members tp_group_mixin_get_offset_quark tp_group_mixin_get_remote_pending_members tp_group_mixin_get_self_handle tp_group_mixin_iface_init tp_group_mixin_init tp_group_mixin_remove_members tp_group_mixin_remove_members_with_reason tp_handle_client_hold tp_handle_client_release tp_handle_ensure tp_handle_get_qdata tp_handle_inspect tp_handle_is_valid tp_handle_lookup tp_handle_ref tp_handle_repo_iface_get_type tp_handle_set_add tp_handle_set_destroy tp_handle_set_difference_update tp_handle_set_foreach tp_handle_set_is_member tp_handle_set_new tp_handle_set_peek tp_handle_set_qdata tp_handle_set_remove tp_handle_set_size tp_handle_set_to_array tp_handle_set_update tp_handle_type_to_string tp_handle_unref tp_handles_are_valid tp_handles_client_hold tp_handles_client_release tp_handles_ref tp_handles_unref tp_heap_add tp_heap_clear tp_heap_destroy tp_heap_extract_first tp_heap_new tp_heap_peek_first tp_heap_remove tp_heap_size tp_iface_quark_channel tp_iface_quark_channel_interface_chat_state tp_iface_quark_channel_interface_dtmf tp_iface_quark_channel_interface_group tp_iface_quark_channel_interface_media_signalling tp_iface_quark_channel_interface_password tp_iface_quark_channel_type_contact_list tp_iface_quark_channel_type_room_list tp_iface_quark_channel_type_streamed_media tp_iface_quark_channel_type_text tp_iface_quark_channel_type_tubes tp_iface_quark_connection tp_iface_quark_connection_interface_aliasing tp_iface_quark_connection_interface_avatars tp_iface_quark_connection_interface_capabilities tp_iface_quark_connection_interface_presence tp_iface_quark_connection_manager tp_iface_quark_media_session_handler tp_iface_quark_media_stream_handler tp_iface_quark_properties_interface tp_intset_add tp_intset_clear tp_intset_copy tp_intset_destroy tp_intset_difference tp_intset_dump tp_intset_foreach tp_intset_from_array tp_intset_intersection tp_intset_is_equal tp_intset_is_member tp_intset_iter_next tp_intset_new tp_intset_remove tp_intset_size tp_intset_sized_new tp_intset_symmetric_difference tp_intset_to_array tp_intset_union tp_mixin_offset_cast tp_presence_mixin_class_get_offset_quark tp_presence_mixin_class_init tp_presence_mixin_emit_one_presence_update tp_presence_mixin_emit_presence_update tp_presence_mixin_finalize tp_presence_mixin_get_offset_quark tp_presence_mixin_iface_init tp_presence_mixin_init tp_presence_status_free tp_presence_status_new tp_properties_context_get tp_properties_context_get_value_count tp_properties_context_has tp_properties_context_has_other_than tp_properties_context_remove tp_properties_context_return tp_properties_context_return_if_done tp_properties_mixin_change_flags tp_properties_mixin_change_value tp_properties_mixin_class_get_offset_quark tp_properties_mixin_class_init tp_properties_mixin_emit_changed tp_properties_mixin_emit_flags tp_properties_mixin_finalize tp_properties_mixin_get_offset_quark tp_properties_mixin_get_properties tp_properties_mixin_has_property tp_properties_mixin_iface_init tp_properties_mixin_init tp_properties_mixin_is_readable tp_properties_mixin_is_writable tp_properties_mixin_list_properties tp_properties_mixin_set_properties tp_run_connection_manager tp_static_handle_repo_get_type tp_strdiff tp_svc_channel_emit_closed tp_svc_channel_get_type tp_svc_channel_implement_close tp_svc_channel_implement_get_channel_type tp_svc_channel_implement_get_handle tp_svc_channel_implement_get_interfaces tp_svc_channel_interface_chat_state_emit_chat_state_changed tp_svc_channel_interface_chat_state_get_type tp_svc_channel_interface_chat_state_implement_set_chat_state tp_svc_channel_interface_dtmf_get_type tp_svc_channel_interface_dtmf_implement_start_tone tp_svc_channel_interface_dtmf_implement_stop_tone tp_svc_channel_interface_group_emit_group_flags_changed tp_svc_channel_interface_group_emit_members_changed tp_svc_channel_interface_group_get_type tp_svc_channel_interface_group_implement_add_members tp_svc_channel_interface_group_implement_get_all_members tp_svc_channel_interface_group_implement_get_group_flags tp_svc_channel_interface_group_implement_get_handle_owners tp_svc_channel_interface_group_implement_get_local_pending_members tp_svc_channel_interface_group_implement_get_local_pending_members_with_info tp_svc_channel_interface_group_implement_get_members tp_svc_channel_interface_group_implement_get_remote_pending_members tp_svc_channel_interface_group_implement_get_self_handle tp_svc_channel_interface_group_implement_remove_members tp_svc_channel_interface_group_implement_remove_members_with_reason tp_svc_channel_interface_media_signalling_emit_new_session_handler tp_svc_channel_interface_media_signalling_get_type tp_svc_channel_interface_media_signalling_implement_get_session_handlers tp_svc_channel_interface_password_emit_password_flags_changed tp_svc_channel_interface_password_get_type tp_svc_channel_interface_password_implement_get_password_flags tp_svc_channel_interface_password_implement_provide_password tp_svc_channel_type_contact_list_get_type tp_svc_channel_type_room_list_emit_got_rooms tp_svc_channel_type_room_list_emit_listing_rooms tp_svc_channel_type_room_list_get_type tp_svc_channel_type_room_list_implement_get_listing_rooms tp_svc_channel_type_room_list_implement_list_rooms tp_svc_channel_type_room_list_implement_stop_listing tp_svc_channel_type_streamed_media_emit_stream_added tp_svc_channel_type_streamed_media_emit_stream_direction_changed tp_svc_channel_type_streamed_media_emit_stream_error tp_svc_channel_type_streamed_media_emit_stream_removed tp_svc_channel_type_streamed_media_emit_stream_state_changed tp_svc_channel_type_streamed_media_get_type tp_svc_channel_type_streamed_media_implement_list_streams tp_svc_channel_type_streamed_media_implement_remove_streams tp_svc_channel_type_streamed_media_implement_request_stream_direction tp_svc_channel_type_streamed_media_implement_request_streams tp_svc_channel_type_text_emit_lost_message tp_svc_channel_type_text_emit_received tp_svc_channel_type_text_emit_send_error tp_svc_channel_type_text_emit_sent tp_svc_channel_type_text_get_type tp_svc_channel_type_text_implement_acknowledge_pending_messages tp_svc_channel_type_text_implement_get_message_types tp_svc_channel_type_text_implement_list_pending_messages tp_svc_channel_type_text_implement_send tp_svc_channel_type_tubes_emit_d_bus_names_changed tp_svc_channel_type_tubes_emit_new_tube tp_svc_channel_type_tubes_emit_stream_tube_new_connection tp_svc_channel_type_tubes_emit_tube_closed tp_svc_channel_type_tubes_emit_tube_state_changed tp_svc_channel_type_tubes_get_type tp_svc_channel_type_tubes_implement_accept_d_bus_tube tp_svc_channel_type_tubes_implement_accept_stream_tube tp_svc_channel_type_tubes_implement_close_tube tp_svc_channel_type_tubes_implement_get_available_stream_tube_types tp_svc_channel_type_tubes_implement_get_available_tube_types tp_svc_channel_type_tubes_implement_get_d_bus_names tp_svc_channel_type_tubes_implement_get_d_bus_tube_address tp_svc_channel_type_tubes_implement_get_stream_tube_socket_address tp_svc_channel_type_tubes_implement_list_tubes tp_svc_channel_type_tubes_implement_offer_d_bus_tube tp_svc_channel_type_tubes_implement_offer_stream_tube tp_svc_connection_emit_new_channel tp_svc_connection_emit_status_changed tp_svc_connection_get_type tp_svc_connection_implement_connect tp_svc_connection_implement_disconnect tp_svc_connection_implement_get_interfaces tp_svc_connection_implement_get_protocol tp_svc_connection_implement_get_self_handle tp_svc_connection_implement_get_status tp_svc_connection_implement_hold_handles tp_svc_connection_implement_inspect_handles tp_svc_connection_implement_list_channels tp_svc_connection_implement_release_handles tp_svc_connection_implement_request_channel tp_svc_connection_implement_request_handles tp_svc_connection_interface_aliasing_emit_aliases_changed tp_svc_connection_interface_aliasing_get_type tp_svc_connection_interface_aliasing_implement_get_alias_flags tp_svc_connection_interface_aliasing_implement_request_aliases tp_svc_connection_interface_aliasing_implement_set_aliases tp_svc_connection_interface_avatars_emit_avatar_retrieved tp_svc_connection_interface_avatars_emit_avatar_updated tp_svc_connection_interface_avatars_get_type tp_svc_connection_interface_avatars_implement_clear_avatar tp_svc_connection_interface_avatars_implement_get_avatar_requirements tp_svc_connection_interface_avatars_implement_get_avatar_tokens tp_svc_connection_interface_avatars_implement_get_known_avatar_tokens tp_svc_connection_interface_avatars_implement_request_avatar tp_svc_connection_interface_avatars_implement_request_avatars tp_svc_connection_interface_avatars_implement_set_avatar tp_svc_connection_interface_capabilities_emit_capabilities_changed tp_svc_connection_interface_capabilities_get_type tp_svc_connection_interface_capabilities_implement_advertise_capabilities tp_svc_connection_interface_capabilities_implement_get_capabilities tp_svc_connection_interface_presence_emit_presence_update tp_svc_connection_interface_presence_get_type tp_svc_connection_interface_presence_implement_add_status tp_svc_connection_interface_presence_implement_clear_status tp_svc_connection_interface_presence_implement_get_presence tp_svc_connection_interface_presence_implement_get_statuses tp_svc_connection_interface_presence_implement_remove_status tp_svc_connection_interface_presence_implement_request_presence tp_svc_connection_interface_presence_implement_set_last_activity_time tp_svc_connection_interface_presence_implement_set_status tp_svc_connection_manager_emit_new_connection tp_svc_connection_manager_get_type tp_svc_connection_manager_implement_get_parameters tp_svc_connection_manager_implement_list_protocols tp_svc_connection_manager_implement_request_connection tp_svc_media_session_handler_emit_new_stream_handler tp_svc_media_session_handler_get_type tp_svc_media_session_handler_implement_error tp_svc_media_session_handler_implement_ready tp_svc_media_stream_handler_emit_add_remote_candidate tp_svc_media_stream_handler_emit_close tp_svc_media_stream_handler_emit_remove_remote_candidate tp_svc_media_stream_handler_emit_set_active_candidate_pair tp_svc_media_stream_handler_emit_set_remote_candidate_list tp_svc_media_stream_handler_emit_set_remote_codecs tp_svc_media_stream_handler_emit_set_stream_playing tp_svc_media_stream_handler_emit_set_stream_sending tp_svc_media_stream_handler_emit_start_telephony_event tp_svc_media_stream_handler_emit_stop_telephony_event tp_svc_media_stream_handler_get_type tp_svc_media_stream_handler_implement_codec_choice tp_svc_media_stream_handler_implement_error tp_svc_media_stream_handler_implement_native_candidates_prepared tp_svc_media_stream_handler_implement_new_active_candidate_pair tp_svc_media_stream_handler_implement_new_native_candidate tp_svc_media_stream_handler_implement_ready tp_svc_media_stream_handler_implement_set_local_codecs tp_svc_media_stream_handler_implement_stream_state tp_svc_media_stream_handler_implement_supported_codecs tp_svc_properties_interface_emit_properties_changed tp_svc_properties_interface_emit_property_flags_changed tp_svc_properties_interface_get_type tp_svc_properties_interface_implement_get_properties tp_svc_properties_interface_implement_list_properties tp_svc_properties_interface_implement_set_properties tp_text_mixin_acknowledge_pending_messages tp_text_mixin_class_get_offset_quark tp_text_mixin_class_init tp_text_mixin_clear tp_text_mixin_finalize tp_text_mixin_get_message_types tp_text_mixin_get_offset_quark tp_text_mixin_iface_init tp_text_mixin_init tp_text_mixin_list_pending_messages tp_text_mixin_receive tp_text_mixin_set_message_types tp_type_dbus_array_osuu tp_type_dbus_array_sa_28usuussduss_29 tp_type_dbus_array_su tp_type_dbus_array_susv tp_type_dbus_array_us tp_type_dbus_array_usa_7bsv_7d tp_type_dbus_array_ussu tp_type_dbus_array_usuu tp_type_dbus_array_usuussduss tp_type_dbus_array_usuuua_7bss_7d tp_type_dbus_array_usuuuu tp_type_dbus_array_uu tp_type_dbus_array_uuus tp_type_dbus_array_uuusa_7bsv_7du tp_type_dbus_array_uuuuus tp_type_dbus_array_uuuuuu tp_type_dbus_array_uv tp_type_dbus_hash_s_28ubba_7bss_7d_29 tp_type_dbus_hash_sa_7bsv_7d tp_type_dbus_hash_ss tp_type_dbus_hash_sv tp_type_dbus_hash_u_28ua_7bsa_7bsv_7d_7d_29 tp_type_dbus_hash_uau tp_type_dbus_hash_us tp_type_dbus_struct_osuu tp_type_dbus_struct_sa_28usuussduss_29 tp_type_dbus_struct_sq tp_type_dbus_struct_su tp_type_dbus_struct_susv tp_type_dbus_struct_sy tp_type_dbus_struct_ua_7bsa_7bsv_7d_7d tp_type_dbus_struct_ubba_7bss_7d tp_type_dbus_struct_us tp_type_dbus_struct_usa_7bsv_7d tp_type_dbus_struct_ussu tp_type_dbus_struct_usuu tp_type_dbus_struct_usuussduss tp_type_dbus_struct_usuuua_7bss_7d tp_type_dbus_struct_usuuuu tp_type_dbus_struct_uu tp_type_dbus_struct_uuus tp_type_dbus_struct_uuusa_7bsv_7du tp_type_dbus_struct_uuuuus tp_type_dbus_struct_uuuuuu tp_type_dbus_struct_uv telepathy-glib-0.24.2/telepathy-glib/versions/0.7.1.abi0000644000175000017500000003430012652510705017337 00000000000000Version: TELEPATHY_GLIB_0.7.1 Extends: TELEPATHY_GLIB_0.7.0 Release: 0.7.1 tp_channel_get_type tp_channel_new tp_channel_run_until_ready tp_cli_channel_call_close tp_cli_channel_call_get_channel_type tp_cli_channel_call_get_handle tp_cli_channel_call_get_interfaces tp_cli_channel_connect_to_closed tp_cli_channel_interface_chat_state_call_set_chat_state tp_cli_channel_interface_chat_state_connect_to_chat_state_changed tp_cli_channel_interface_chat_state_run_set_chat_state tp_cli_channel_interface_dtmf_call_start_tone tp_cli_channel_interface_dtmf_call_stop_tone tp_cli_channel_interface_dtmf_run_start_tone tp_cli_channel_interface_dtmf_run_stop_tone tp_cli_channel_interface_group_call_add_members tp_cli_channel_interface_group_call_get_all_members tp_cli_channel_interface_group_call_get_group_flags tp_cli_channel_interface_group_call_get_handle_owners tp_cli_channel_interface_group_call_get_local_pending_members tp_cli_channel_interface_group_call_get_local_pending_members_with_info tp_cli_channel_interface_group_call_get_members tp_cli_channel_interface_group_call_get_remote_pending_members tp_cli_channel_interface_group_call_get_self_handle tp_cli_channel_interface_group_call_remove_members tp_cli_channel_interface_group_call_remove_members_with_reason tp_cli_channel_interface_group_connect_to_group_flags_changed tp_cli_channel_interface_group_connect_to_members_changed tp_cli_channel_interface_group_run_add_members tp_cli_channel_interface_group_run_get_all_members tp_cli_channel_interface_group_run_get_group_flags tp_cli_channel_interface_group_run_get_handle_owners tp_cli_channel_interface_group_run_get_local_pending_members tp_cli_channel_interface_group_run_get_local_pending_members_with_info tp_cli_channel_interface_group_run_get_members tp_cli_channel_interface_group_run_get_remote_pending_members tp_cli_channel_interface_group_run_get_self_handle tp_cli_channel_interface_group_run_remove_members tp_cli_channel_interface_group_run_remove_members_with_reason tp_cli_channel_interface_media_signalling_call_get_session_handlers tp_cli_channel_interface_media_signalling_connect_to_new_session_handler tp_cli_channel_interface_media_signalling_run_get_session_handlers tp_cli_channel_interface_password_call_get_password_flags tp_cli_channel_interface_password_call_provide_password tp_cli_channel_interface_password_connect_to_password_flags_changed tp_cli_channel_interface_password_run_get_password_flags tp_cli_channel_interface_password_run_provide_password tp_cli_channel_run_close tp_cli_channel_run_get_channel_type tp_cli_channel_run_get_handle tp_cli_channel_run_get_interfaces tp_cli_channel_type_room_list_call_get_listing_rooms tp_cli_channel_type_room_list_call_list_rooms tp_cli_channel_type_room_list_call_stop_listing tp_cli_channel_type_room_list_connect_to_got_rooms tp_cli_channel_type_room_list_connect_to_listing_rooms tp_cli_channel_type_room_list_run_get_listing_rooms tp_cli_channel_type_room_list_run_list_rooms tp_cli_channel_type_room_list_run_stop_listing tp_cli_channel_type_streamed_media_call_list_streams tp_cli_channel_type_streamed_media_call_remove_streams tp_cli_channel_type_streamed_media_call_request_stream_direction tp_cli_channel_type_streamed_media_call_request_streams tp_cli_channel_type_streamed_media_connect_to_stream_added tp_cli_channel_type_streamed_media_connect_to_stream_direction_changed tp_cli_channel_type_streamed_media_connect_to_stream_error tp_cli_channel_type_streamed_media_connect_to_stream_removed tp_cli_channel_type_streamed_media_connect_to_stream_state_changed tp_cli_channel_type_streamed_media_run_list_streams tp_cli_channel_type_streamed_media_run_remove_streams tp_cli_channel_type_streamed_media_run_request_stream_direction tp_cli_channel_type_streamed_media_run_request_streams tp_cli_channel_type_text_call_acknowledge_pending_messages tp_cli_channel_type_text_call_get_message_types tp_cli_channel_type_text_call_list_pending_messages tp_cli_channel_type_text_call_send tp_cli_channel_type_text_connect_to_lost_message tp_cli_channel_type_text_connect_to_received tp_cli_channel_type_text_connect_to_send_error tp_cli_channel_type_text_connect_to_sent tp_cli_channel_type_text_run_acknowledge_pending_messages tp_cli_channel_type_text_run_get_message_types tp_cli_channel_type_text_run_list_pending_messages tp_cli_channel_type_text_run_send tp_cli_channel_type_tubes_call_accept_d_bus_tube tp_cli_channel_type_tubes_call_accept_stream_tube tp_cli_channel_type_tubes_call_close_tube tp_cli_channel_type_tubes_call_get_available_stream_tube_types tp_cli_channel_type_tubes_call_get_available_tube_types tp_cli_channel_type_tubes_call_get_d_bus_names tp_cli_channel_type_tubes_call_get_d_bus_tube_address tp_cli_channel_type_tubes_call_get_stream_tube_socket_address tp_cli_channel_type_tubes_call_list_tubes tp_cli_channel_type_tubes_call_offer_d_bus_tube tp_cli_channel_type_tubes_call_offer_stream_tube tp_cli_channel_type_tubes_connect_to_d_bus_names_changed tp_cli_channel_type_tubes_connect_to_new_tube tp_cli_channel_type_tubes_connect_to_stream_tube_new_connection tp_cli_channel_type_tubes_connect_to_tube_closed tp_cli_channel_type_tubes_connect_to_tube_state_changed tp_cli_channel_type_tubes_run_accept_d_bus_tube tp_cli_channel_type_tubes_run_accept_stream_tube tp_cli_channel_type_tubes_run_close_tube tp_cli_channel_type_tubes_run_get_available_stream_tube_types tp_cli_channel_type_tubes_run_get_available_tube_types tp_cli_channel_type_tubes_run_get_d_bus_names tp_cli_channel_type_tubes_run_get_d_bus_tube_address tp_cli_channel_type_tubes_run_get_stream_tube_socket_address tp_cli_channel_type_tubes_run_list_tubes tp_cli_channel_type_tubes_run_offer_d_bus_tube tp_cli_channel_type_tubes_run_offer_stream_tube tp_cli_connection_call_connect tp_cli_connection_call_disconnect tp_cli_connection_call_get_interfaces tp_cli_connection_call_get_protocol tp_cli_connection_call_get_self_handle tp_cli_connection_call_get_status tp_cli_connection_call_hold_handles tp_cli_connection_call_inspect_handles tp_cli_connection_call_list_channels tp_cli_connection_call_release_handles tp_cli_connection_call_request_channel tp_cli_connection_call_request_handles tp_cli_connection_connect_to_new_channel tp_cli_connection_connect_to_status_changed tp_cli_connection_interface_aliasing_call_get_alias_flags tp_cli_connection_interface_aliasing_call_request_aliases tp_cli_connection_interface_aliasing_call_set_aliases tp_cli_connection_interface_aliasing_connect_to_aliases_changed tp_cli_connection_interface_aliasing_run_get_alias_flags tp_cli_connection_interface_aliasing_run_request_aliases tp_cli_connection_interface_aliasing_run_set_aliases tp_cli_connection_interface_avatars_call_clear_avatar tp_cli_connection_interface_avatars_call_get_avatar_requirements tp_cli_connection_interface_avatars_call_get_avatar_tokens tp_cli_connection_interface_avatars_call_get_known_avatar_tokens tp_cli_connection_interface_avatars_call_request_avatar tp_cli_connection_interface_avatars_call_request_avatars tp_cli_connection_interface_avatars_call_set_avatar tp_cli_connection_interface_avatars_connect_to_avatar_retrieved tp_cli_connection_interface_avatars_connect_to_avatar_updated tp_cli_connection_interface_avatars_run_clear_avatar tp_cli_connection_interface_avatars_run_get_avatar_requirements tp_cli_connection_interface_avatars_run_get_avatar_tokens tp_cli_connection_interface_avatars_run_get_known_avatar_tokens tp_cli_connection_interface_avatars_run_request_avatar tp_cli_connection_interface_avatars_run_request_avatars tp_cli_connection_interface_avatars_run_set_avatar tp_cli_connection_interface_capabilities_call_advertise_capabilities tp_cli_connection_interface_capabilities_call_get_capabilities tp_cli_connection_interface_capabilities_connect_to_capabilities_changed tp_cli_connection_interface_capabilities_run_advertise_capabilities tp_cli_connection_interface_capabilities_run_get_capabilities tp_cli_connection_interface_presence_call_add_status tp_cli_connection_interface_presence_call_clear_status tp_cli_connection_interface_presence_call_get_presence tp_cli_connection_interface_presence_call_get_statuses tp_cli_connection_interface_presence_call_remove_status tp_cli_connection_interface_presence_call_request_presence tp_cli_connection_interface_presence_call_set_last_activity_time tp_cli_connection_interface_presence_call_set_status tp_cli_connection_interface_presence_connect_to_presence_update tp_cli_connection_interface_presence_run_add_status tp_cli_connection_interface_presence_run_clear_status tp_cli_connection_interface_presence_run_get_presence tp_cli_connection_interface_presence_run_get_statuses tp_cli_connection_interface_presence_run_remove_status tp_cli_connection_interface_presence_run_request_presence tp_cli_connection_interface_presence_run_set_last_activity_time tp_cli_connection_interface_presence_run_set_status tp_cli_connection_manager_call_get_parameters tp_cli_connection_manager_call_list_protocols tp_cli_connection_manager_call_request_connection tp_cli_connection_manager_connect_to_new_connection tp_cli_connection_manager_run_get_parameters tp_cli_connection_manager_run_list_protocols tp_cli_connection_manager_run_request_connection tp_cli_connection_run_connect tp_cli_connection_run_disconnect tp_cli_connection_run_get_interfaces tp_cli_connection_run_get_protocol tp_cli_connection_run_get_self_handle tp_cli_connection_run_get_status tp_cli_connection_run_hold_handles tp_cli_connection_run_inspect_handles tp_cli_connection_run_list_channels tp_cli_connection_run_release_handles tp_cli_connection_run_request_channel tp_cli_connection_run_request_handles tp_cli_dbus_daemon_call_add_match tp_cli_dbus_daemon_call_get_connection_se_linux_security_context tp_cli_dbus_daemon_call_get_connection_unix_process_id tp_cli_dbus_daemon_call_get_connection_unix_user tp_cli_dbus_daemon_call_get_id tp_cli_dbus_daemon_call_get_name_owner tp_cli_dbus_daemon_call_hello tp_cli_dbus_daemon_call_list_activatable_names tp_cli_dbus_daemon_call_list_names tp_cli_dbus_daemon_call_list_queued_owners tp_cli_dbus_daemon_call_name_has_owner tp_cli_dbus_daemon_call_release_name tp_cli_dbus_daemon_call_reload_config tp_cli_dbus_daemon_call_remove_match tp_cli_dbus_daemon_call_request_name tp_cli_dbus_daemon_call_start_service_by_name tp_cli_dbus_daemon_connect_to_name_acquired tp_cli_dbus_daemon_connect_to_name_lost tp_cli_dbus_daemon_connect_to_name_owner_changed tp_cli_dbus_daemon_run_add_match tp_cli_dbus_daemon_run_get_connection_se_linux_security_context tp_cli_dbus_daemon_run_get_connection_unix_process_id tp_cli_dbus_daemon_run_get_connection_unix_user tp_cli_dbus_daemon_run_get_id tp_cli_dbus_daemon_run_get_name_owner tp_cli_dbus_daemon_run_hello tp_cli_dbus_daemon_run_list_activatable_names tp_cli_dbus_daemon_run_list_names tp_cli_dbus_daemon_run_list_queued_owners tp_cli_dbus_daemon_run_name_has_owner tp_cli_dbus_daemon_run_release_name tp_cli_dbus_daemon_run_reload_config tp_cli_dbus_daemon_run_remove_match tp_cli_dbus_daemon_run_request_name tp_cli_dbus_daemon_run_start_service_by_name tp_cli_media_session_handler_call_error tp_cli_media_session_handler_call_ready tp_cli_media_session_handler_connect_to_new_stream_handler tp_cli_media_session_handler_run_error tp_cli_media_session_handler_run_ready tp_cli_media_stream_handler_call_codec_choice tp_cli_media_stream_handler_call_error tp_cli_media_stream_handler_call_native_candidates_prepared tp_cli_media_stream_handler_call_new_active_candidate_pair tp_cli_media_stream_handler_call_new_native_candidate tp_cli_media_stream_handler_call_ready tp_cli_media_stream_handler_call_set_local_codecs tp_cli_media_stream_handler_call_stream_state tp_cli_media_stream_handler_call_supported_codecs tp_cli_media_stream_handler_connect_to_add_remote_candidate tp_cli_media_stream_handler_connect_to_close tp_cli_media_stream_handler_connect_to_remove_remote_candidate tp_cli_media_stream_handler_connect_to_set_active_candidate_pair tp_cli_media_stream_handler_connect_to_set_remote_candidate_list tp_cli_media_stream_handler_connect_to_set_remote_codecs tp_cli_media_stream_handler_connect_to_set_stream_playing tp_cli_media_stream_handler_connect_to_set_stream_sending tp_cli_media_stream_handler_connect_to_start_telephony_event tp_cli_media_stream_handler_connect_to_stop_telephony_event tp_cli_media_stream_handler_run_codec_choice tp_cli_media_stream_handler_run_error tp_cli_media_stream_handler_run_native_candidates_prepared tp_cli_media_stream_handler_run_new_active_candidate_pair tp_cli_media_stream_handler_run_new_native_candidate tp_cli_media_stream_handler_run_ready tp_cli_media_stream_handler_run_set_local_codecs tp_cli_media_stream_handler_run_stream_state tp_cli_media_stream_handler_run_supported_codecs tp_cli_properties_interface_call_get_properties tp_cli_properties_interface_call_list_properties tp_cli_properties_interface_call_set_properties tp_cli_properties_interface_connect_to_properties_changed tp_cli_properties_interface_connect_to_property_flags_changed tp_cli_properties_interface_run_get_properties tp_cli_properties_interface_run_list_properties tp_cli_properties_interface_run_set_properties tp_connection_get_type tp_connection_manager_activate tp_connection_manager_check_valid_name tp_connection_manager_check_valid_protocol_name tp_connection_manager_get_type tp_connection_manager_new tp_connection_new tp_connection_run_until_ready tp_dbus_check_valid_bus_name tp_dbus_check_valid_interface_name tp_dbus_check_valid_member_name tp_dbus_check_valid_object_path tp_dbus_daemon_cancel_name_owner_watch tp_dbus_daemon_get_type tp_dbus_daemon_new tp_dbus_daemon_watch_name_owner tp_dbus_errors_quark tp_debug_divert_messages tp_debug_timestamped_log_handler tp_errors_disconnected_quark tp_errors_removed_from_group_quark tp_iface_quark_dbus_daemon tp_list_connection_managers tp_list_connection_names tp_media_session_handler_get_type tp_media_session_handler_new tp_media_stream_handler_get_type tp_media_stream_handler_new tp_proxy_add_interface_by_id tp_proxy_borrow_interface_by_id tp_proxy_get_type tp_proxy_has_interface_by_id tp_proxy_invalidate tp_proxy_or_subclass_hook_on_interface_add tp_proxy_pending_call_cancel tp_proxy_pending_call_v0_completed tp_proxy_pending_call_v0_new tp_proxy_pending_call_v0_take_pending_call tp_proxy_pending_call_v0_take_results tp_proxy_signal_connection_disconnect tp_proxy_signal_connection_v0_new tp_proxy_signal_connection_v0_take_results tp_proxy_subclass_add_error_mapping telepathy-glib-0.24.2/telepathy-glib/versions/0.7.2.abi0000644000175000017500000000144612652510705017345 00000000000000Version: TELEPATHY_GLIB_0.7.2 Extends: TELEPATHY_GLIB_0.7.1 Release: 0.7.2 tp_cli_dbus_introspectable_call_introspect tp_cli_dbus_introspectable_run_introspect tp_cli_dbus_peer_call_get_machine_id tp_cli_dbus_peer_call_ping tp_cli_dbus_peer_run_get_machine_id tp_cli_dbus_peer_run_ping tp_cli_dbus_properties_call_get tp_cli_dbus_properties_call_get_all tp_cli_dbus_properties_call_set tp_cli_dbus_properties_run_get tp_cli_dbus_properties_run_get_all tp_cli_dbus_properties_run_set tp_iface_quark_dbus_introspectable tp_iface_quark_dbus_peer tp_iface_quark_dbus_properties tp_svc_dbus_introspectable_get_type tp_svc_dbus_introspectable_implement_introspect tp_svc_dbus_properties_get_type tp_svc_dbus_properties_implement_get tp_svc_dbus_properties_implement_get_all tp_svc_dbus_properties_implement_set telepathy-glib-0.24.2/telepathy-glib/versions/0.7.3.abi0000644000175000017500000000044412652510705017343 00000000000000Version: TELEPATHY_GLIB_0.7.3 Extends: TELEPATHY_GLIB_0.7.2 Release: 0.7.3 tp_dbus_properties_mixin_class_init tp_dbus_properties_mixin_getter_gobject_properties tp_dbus_properties_mixin_iface_init tp_dbus_properties_mixin_setter_gobject_properties tp_svc_interface_set_dbus_properties_info telepathy-glib-0.24.2/telepathy-glib/versions/0.7.5.abi0000644000175000017500000000017112652510705017342 00000000000000Version: TELEPATHY_GLIB_0.7.5 Extends: TELEPATHY_GLIB_0.7.3 Release: 0.7.5 tp_type_dbus_array_os tp_type_dbus_struct_os telepathy-glib-0.24.2/telepathy-glib/versions/0.7.6.abi0000644000175000017500000000177512652510705017356 00000000000000Version: TELEPATHY_GLIB_0.7.6 Extends: TELEPATHY_GLIB_0.7.5 Release: 0.7.6 tp_channel_init_known_interfaces tp_cli_channel_interface_call_state_call_get_call_states tp_cli_channel_interface_call_state_connect_to_call_state_changed tp_cli_channel_interface_call_state_run_get_call_states tp_cli_media_stream_handler_call_hold_state tp_cli_media_stream_handler_call_unhold_failure tp_cli_media_stream_handler_connect_to_set_stream_held tp_cli_media_stream_handler_run_hold_state tp_cli_media_stream_handler_run_unhold_failure tp_connection_init_known_interfaces tp_iface_quark_channel_interface_call_state tp_proxy_dbus_g_proxy_claim_for_signal_adding tp_proxy_init_known_interfaces tp_svc_channel_interface_call_state_implement_get_call_states tp_svc_channel_interface_call_state_emit_call_state_changed tp_svc_channel_interface_call_state_get_type tp_svc_media_stream_handler_emit_set_stream_held tp_svc_media_stream_handler_implement_hold_state tp_svc_media_stream_handler_implement_unhold_failure tp_type_dbus_hash_uu telepathy-glib-0.24.2/telepathy-glib/versions/0.7.7.abi0000644000175000017500000000020512652510705017342 00000000000000Version: TELEPATHY_GLIB_0.7.7 Extends: TELEPATHY_GLIB_0.7.6 Release: 0.7.7 tp_channel_call_when_ready tp_connection_call_when_ready telepathy-glib-0.24.2/telepathy-glib/versions/0.7.8.abi0000644000175000017500000000107112652510705017345 00000000000000Version: TELEPATHY_GLIB_0.7.8 Extends: TELEPATHY_GLIB_0.7.7 Release: 0.7.8 tp_cli_channel_interface_hold_call_get_hold_state tp_cli_channel_interface_hold_call_request_hold tp_cli_channel_interface_hold_connect_to_hold_state_changed tp_cli_channel_interface_hold_run_get_hold_state tp_cli_channel_interface_hold_run_request_hold tp_iface_quark_channel_interface_hold tp_svc_channel_interface_hold_emit_hold_state_changed tp_svc_channel_interface_hold_get_type tp_svc_channel_interface_hold_implement_get_hold_state tp_svc_channel_interface_hold_implement_request_hold telepathy-glib-0.24.2/telepathy-glib/versions/0.7.9.abi0000644000175000017500000000107512652510705017352 00000000000000Version: TELEPATHY_GLIB_0.7.9 Extends: TELEPATHY_GLIB_0.7.8 Release: 0.7.9 tp_asv_get_boolean tp_asv_get_boxed tp_asv_get_bytes tp_asv_get_double tp_asv_get_int32 tp_asv_get_int64 tp_asv_get_object_path tp_asv_get_string tp_asv_get_strv tp_asv_get_uint32 tp_asv_get_uint64 tp_asv_lookup tp_cli_channel_interface_group_connect_to_handle_owners_changed tp_cli_channel_interface_group_connect_to_self_handle_changed tp_dbus_properties_mixin_implement_interface tp_svc_channel_interface_group_emit_handle_owners_changed tp_svc_channel_interface_group_emit_self_handle_changed telepathy-glib-0.24.2/telepathy-glib/proxy-methods.c0000644000175000017500000004052012652510705017336 00000000000000/* * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/proxy-subclass.h" #include "telepathy-glib/proxy-internal.h" #define DEBUG_FLAG TP_DEBUG_PROXY #include "telepathy-glib/debug-internal.h" #include #if 0 #define MORE_DEBUG DEBUG #else #define MORE_DEBUG(...) G_STMT_START {} G_STMT_END #endif /** * TpProxyPendingCall: * * Opaque structure representing a pending D-Bus call. * * Since: 0.7.1 */ struct _TpProxyPendingCall { /* This structure's "reference count" is implicit: * - 1 if D-Bus has us (from creation until _completed) * - 1 if results have come in but we haven't run the callback yet * (idle_source is nonzero) * * In normal use, its life cycle should go like this: * - Created by tp_proxy_pending_call_v0_new * - Given to dbus-glib by generated code (actual call starts here) * - tp_proxy_pending_call_v0_take_pending_call * - (Phase 1) * - tp_proxy_pending_call_v0_take_results * - Idle handler queued * - (Phase 2) * - tp_proxy_pending_call_v0_completed * - (Phase 3) * - tp_proxy_pending_call_idle_invoke * - tp_proxy_pending_call_free * * although we can't guarantee that idle_invoke won't go off before * completed does, if the dbus-glib implementation changes. * * Exceptional conditions that can occur: * - Weak object dies * - Reference cleared, otherwise equivalent to explicit cancellation * - Explicitly cancelled * - All phases: callback invoked if cancel_must_raise, otherwise * not * - DBusGProxy destroy signal (or _completed before _take_results) * - Phase 1: error callback queued * - Phase 2: ignored, we use the results we've already got * - Phase 3: ignored, we use the results we've already got */ /* Always non-NULL */ TpProxy *proxy; /* Set to NULL after it's been invoked once, or if cancellation means * it should never be called. Supplied by the generated code */ TpProxyInvokeFunc invoke_callback; /* arguments for invoke_callback supplied by _take_results, by * cancellation or by the destroy signal */ GError *error /* implicitly initialized */; GValueArray *args; /* user-supplied arguments for invoke_callback */ GCallback callback; gpointer user_data; GDestroyNotify destroy; GObject *weak_object; /* Non-NULL until either _completed or destroy, whichever comes first */ DBusGProxy *iface_proxy; DBusGProxyCall *pending_call; /* Nonzero if _idle_invoke has been queued (even if it has already * happened), i.e. if results have been taken or the DBusGProxy * was destroyed */ guint idle_source; /* If TRUE, invoke the callback even on cancellation */ unsigned cancel_must_raise:1; /* If TRUE, the idle_invoke callback has either run or been cancelled */ unsigned idle_completed:1; /* If TRUE, dbus-glib no longer holds a reference to us */ unsigned dbus_completed:1; /* Marker to indicate that this is, in fact, a valid TpProxyPendingCall */ gconstpointer priv; }; static const gchar * const pending_call_magic = "TpProxyPendingCall"; static void tp_proxy_pending_call_lost_weak_ref (gpointer data, GObject *dead) { TpProxyPendingCall *pc = data; DEBUG ("%p lost weak ref to %p", pc, dead); g_assert (pc->priv == pending_call_magic); g_assert (dead == pc->weak_object); pc->weak_object = NULL; if (!pc->idle_completed) tp_proxy_pending_call_cancel (pc); } static gboolean tp_proxy_pending_call_idle_invoke (gpointer p) { TpProxyPendingCall *pc = p; TpProxyInvokeFunc invoke = pc->invoke_callback; MORE_DEBUG ("%p", pc); if (invoke == NULL) { /* either already invoked (bug?), or cancelled */ return FALSE; } MORE_DEBUG ("%p: invoking user callback", pc); g_assert (pc->proxy != NULL); g_assert (pc->error == NULL || pc->args == NULL); g_assert (!pc->idle_completed); pc->invoke_callback = NULL; invoke (pc->proxy, pc->error, pc->args, pc->callback, pc->user_data, pc->weak_object); pc->error = NULL; pc->args = NULL; /* don't clear pc->idle_source here! tp_proxy_pending_call_v0_completed * compares it to 0 to determine whether to free the object */ return FALSE; } static void _tp_proxy_pending_call_idle_completed (gpointer p); static void _tp_proxy_pending_call_dgproxy_destroy (DBusGProxy *iface_proxy, TpProxyPendingCall *pc) { g_assert (iface_proxy != NULL); g_assert (pc != NULL); g_assert (pc->iface_proxy == iface_proxy); g_assert (pc->proxy != NULL); DEBUG ("%p: DBusGProxy %p invalidated", pc, iface_proxy); if (pc->idle_source == 0) { /* we haven't already received and queued a reply, so synthesize * one */ g_assert (pc->args == NULL); g_assert (pc->error == NULL); pc->error = g_error_new_literal (TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "Name owner lost (service crashed?)"); pc->idle_source = g_idle_add_full (G_PRIORITY_HIGH, tp_proxy_pending_call_idle_invoke, pc, _tp_proxy_pending_call_idle_completed); } g_signal_handlers_disconnect_by_func (pc->iface_proxy, _tp_proxy_pending_call_dgproxy_destroy, pc); g_object_unref (pc->iface_proxy); pc->iface_proxy = NULL; } /** * tp_proxy_pending_call_v0_new: * @self: a proxy * @iface: a quark whose string value is the D-Bus interface * @member: the name of the method being called * @iface_proxy: the interface-specific #DBusGProxy for @iface * @invoke_callback: an implementation of #TpProxyInvokeFunc which will * invoke @callback with appropriate arguments * @callback: a callback to be called when the call completes * @user_data: user-supplied data for the callback * @destroy: user-supplied destructor for the data * @weak_object: if not %NULL, a #GObject which will be weakly referenced by * the signal connection - if it is destroyed, the pending call will * automatically be cancelled * @cancel_must_raise: if %TRUE, the @invoke_callback will be run with * error %TP_DBUS_ERROR_CANCELLED if the call is cancelled by a call to * tp_proxy_pending_call_cancel() or by destruction of the @weak_object; * if %FALSE, the @invoke_callback will not be run at all in these cases * * Allocate a new pending call structure. After calling this function, the * caller must start an asynchronous D-Bus call and give the resulting * DBusGProxyCall to the pending call object using * tp_proxy_pending_call_v0_take_pending_call(). * * If dbus-glib gets a reply to the call before it's cancelled, the caller * must arrange for tp_proxy_pending_call_v0_take_results() to be called * with the results (the intention is for this to be done immediately * after dbus_g_proxy_end_call in the callback supplied to dbus-glib). * * When dbus-glib discards its reference to the user_data supplied in the * asynchronous D-Bus call (i.e. after the call is cancelled or a reply * arrives), tp_proxy_pending_call_v0_completed must be called (the intention * is for the #TpProxyPendingCall to be the @user_data in the async call, * and for tp_proxy_pending_call_v0_completed to be the #GDestroyNotify * passed to the same async call). * * This function is for use by #TpProxy subclass implementations only, and * should usually only be called from code generated by * tools/glib-client-gen.py. * * Returns: a new pending call structure * * Since: 0.7.1 */ TpProxyPendingCall * tp_proxy_pending_call_v0_new (TpProxy *self, GQuark iface, const gchar *member, DBusGProxy *iface_proxy, TpProxyInvokeFunc invoke_callback, GCallback callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object, gboolean cancel_must_raise) { TpProxyPendingCall *pc; g_return_val_if_fail (invoke_callback != NULL, NULL); g_return_val_if_fail ((gpointer) iface_proxy != (gpointer) self, NULL); pc = g_slice_new0 (TpProxyPendingCall); MORE_DEBUG ("(proxy=%p, if=%s, meth=%s, ic=%p; cb=%p, ud=%p, dn=%p, wo=%p)" " -> %p", self, g_quark_to_string (iface), member, invoke_callback, callback, user_data, destroy, weak_object, pc); pc->proxy = g_object_ref (self); pc->invoke_callback = invoke_callback; pc->callback = callback; pc->user_data = user_data; pc->destroy = destroy; pc->weak_object = weak_object; pc->iface_proxy = g_object_ref (iface_proxy); pc->pending_call = NULL; pc->priv = pending_call_magic; pc->cancel_must_raise = cancel_must_raise; if (weak_object != NULL) g_object_weak_ref (weak_object, tp_proxy_pending_call_lost_weak_ref, pc); g_signal_connect (iface_proxy, "destroy", G_CALLBACK (_tp_proxy_pending_call_dgproxy_destroy), pc); return pc; } /** * tp_proxy_pending_call_cancel: * @pc: a pending call * * Cancel the given pending call. After this function returns, you * must not assume that the pending call remains valid, but you must not * explicitly free it either. * * Since: 0.7.1 */ void tp_proxy_pending_call_cancel (TpProxyPendingCall *pc) { DEBUG ("%p", pc); g_return_if_fail (pc->priv == pending_call_magic); g_return_if_fail (pc->proxy != NULL); /* If the callback has already run, it's too late to cancel */ g_return_if_fail (!pc->idle_completed); if (pc->cancel_must_raise) { if (pc->error != NULL) g_error_free (pc->error); pc->error = g_error_new_literal (TP_DBUS_ERRORS, TP_DBUS_ERROR_CANCELLED, "Re-entrant D-Bus call cancelled"); if (pc->args != NULL) { tp_value_array_free (pc->args); pc->args = NULL; } } else { pc->invoke_callback = NULL; } /* If we're calling the callback due to cancellation, we must free the * pending call object afterwards. Otherwise, we must free the pending * call object later anyway, in case this function was called due to * weak refs (like fd.o #14750). */ if (pc->idle_source == 0) { pc->idle_source = g_idle_add_full (G_PRIORITY_HIGH, tp_proxy_pending_call_idle_invoke, pc, _tp_proxy_pending_call_idle_completed); } if (!pc->dbus_completed && pc->pending_call != NULL) { /* Implicitly asserts that iface_proxy is non-NULL */ DBusGProxy *iface_proxy = g_object_ref (pc->iface_proxy); dbus_g_proxy_cancel_call (iface_proxy, pc->pending_call); g_object_unref (iface_proxy); } } static void tp_proxy_pending_call_free (TpProxyPendingCall *pc) { MORE_DEBUG ("%p", pc); g_assert (pc->priv == pending_call_magic); if (pc->destroy != NULL) pc->destroy (pc->user_data); pc->destroy = NULL; pc->user_data = NULL; if (pc->error != NULL) g_error_free (pc->error); pc->error = NULL; if (pc->args != NULL) tp_value_array_free (pc->args); pc->args = NULL; if (pc->weak_object != NULL) g_object_weak_unref (pc->weak_object, tp_proxy_pending_call_lost_weak_ref, pc); if (pc->iface_proxy != NULL) { g_signal_handlers_disconnect_by_func (pc->iface_proxy, _tp_proxy_pending_call_dgproxy_destroy, pc); g_object_unref (pc->iface_proxy); pc->iface_proxy = NULL; } g_assert (pc->proxy != NULL); g_object_unref (pc->proxy); pc->proxy = NULL; g_slice_free (TpProxyPendingCall, pc); } /** * tp_proxy_pending_call_v0_completed: * @p: a #TpProxyPendingCall allocated with tp_proxy_pending_call_v0_new() * * Indicate that dbus-glib has finished with this pending call, and therefore * either tp_proxy_pending_call_v0_take_results() has already been called, * or it will never be called. See tp_proxy_pending_call_v0_new(). * * The signature is chosen to match #GDestroyNotify. * * This function is for use by #TpProxy subclass implementations only, and * should usually only be called from code generated by * tools/glib-client-gen.py. * * Since: 0.7.1 */ void tp_proxy_pending_call_v0_completed (gpointer p) { TpProxyPendingCall *pc = p; MORE_DEBUG ("%p", pc); g_return_if_fail (pc->priv == pending_call_magic); g_return_if_fail (!pc->dbus_completed); g_return_if_fail (pc->proxy != NULL); /* dbus-glib frees its user_data *before* it emits destroy; if we * haven't yet queued the callback, assume that's what's going on. */ if (pc->idle_source == 0 && pc->iface_proxy != NULL) { MORE_DEBUG ("Looks like this pending call hasn't finished, assuming " "the DBusGProxy is about to die"); /* this causes the pending call to be freed */ _tp_proxy_pending_call_dgproxy_destroy (pc->iface_proxy, pc); g_assert (pc->iface_proxy == NULL); } pc->dbus_completed = TRUE; /* If the idle callback has been run already, we can go away */ if (pc->idle_completed) tp_proxy_pending_call_free (pc); } /** * tp_proxy_pending_call_v0_take_pending_call: * @pc: A pending call on which this function has not yet been called * @pending_call: The underlying dbus-glib pending call * * Set the underlying pending call to be used by this object. * See also tp_proxy_pending_call_v0_new(). * * This function is for use by #TpProxy subclass implementations only, and * should usually only be called from code generated by * tools/glib-client-gen.py. * * Since: 0.7.1 */ void tp_proxy_pending_call_v0_take_pending_call (TpProxyPendingCall *pc, DBusGProxyCall *pending_call) { g_return_if_fail (pc->priv == pending_call_magic); g_return_if_fail (pc->pending_call == NULL); g_return_if_fail (pc->proxy != NULL); pc->pending_call = pending_call; } static void _tp_proxy_pending_call_idle_completed (gpointer p) { TpProxyPendingCall *pc = p; MORE_DEBUG ("%p", pc); pc->idle_completed = TRUE; if (pc->dbus_completed) tp_proxy_pending_call_free (pc); } /** * tp_proxy_pending_call_v0_take_results: * @pc: A pending call on which this function has not yet been called * @error: %NULL if the call was successful, or an error (whose ownership * is taken over by the pending call object). Because of dbus-glib * idiosyncrasies, this must be the error produced by dbus-glib, not a copy. * @args: %NULL if the call failed or had no "out" arguments, or an array * of "out" arguments (whose ownership is taken over by the pending call * object) * * Set the "out" arguments (return values) from this pending call. * See also tp_proxy_pending_call_v0_new(). * * This function is for use by #TpProxy subclass implementations only, and * should usually only be called from code generated by * tools/glib-client-gen.py. * * Since: 0.7.1 */ void tp_proxy_pending_call_v0_take_results (TpProxyPendingCall *pc, GError *error, GValueArray *args) { g_return_if_fail (pc->proxy != NULL); g_return_if_fail (pc->priv == pending_call_magic); g_return_if_fail (pc->args == NULL); g_return_if_fail (pc->error == NULL); g_return_if_fail (pc->idle_source == 0); g_return_if_fail (error == NULL || args == NULL); MORE_DEBUG ("%p (error: %s)", pc, error == NULL ? "(none)" : error->message); pc->args = args; pc->error = _tp_proxy_take_and_remap_error (pc->proxy, error); /* queue up the actual callback to run after we go back to the event loop */ pc->idle_source = g_idle_add_full (G_PRIORITY_HIGH, tp_proxy_pending_call_idle_invoke, pc, _tp_proxy_pending_call_idle_completed); } telepathy-glib-0.24.2/telepathy-glib/base-room-config.c0000644000175000017500000011654212652510705017653 00000000000000/* * base-room-config.c - Channel.Interface.RoomConfig1 implementation * Copyright ©2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_ROOM_CONFIG #include "debug-internal.h" #include "util-internal.h" /** * SECTION:base-room-config * @title: TpBaseRoomConfig * @short_description: implements the RoomConfig interface for chat rooms. * * This class implements the #TpSvcChannelInterfaceRoomConfig interface on * multi-user chat room channels. CMs are expected to subclass this base class * to implement the protocol-specific details of changing room configuration. * Then, in the connection manager's subclass of #TpBaseChannel for multi-user * chats: * * * * in #G_DEFINE_TYPE_WITH_CODE, implement * #TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG using * tp_base_room_config_iface_init(): * |[ * G_DEFINE_TYPE_WITH_CODE (MyMucChannel, my_muc_channel, * TP_TYPE_BASE_CHANNEL, * // ... * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG, * tp_base_room_config_iface_init) * // ... * ) * ]| * * * in the class_init method, call * tp_base_room_config_register_class(): * |[ * static void * my_muc_channel_class_init (MyMucChannelClass *klass) * { * // ... * tp_base_room_config_register_class (TP_BASE_CHANNEL_CLASS (klass)); * // ... * } * ]| * * * include %TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG in the return of * #TpBaseChannelClass.get_interfaces. * * * * If this protocol supports modifying some aspects of the room's * configuration, the subclass should call * tp_base_room_config_set_property_mutable() to mark appropriate properties as * potentially-modifiable, call * tp_base_room_config_set_can_update_configuration() to indicate whether the * local user has permission to modify those properties at present, and * implement #TpBaseRoomConfigClass.update_async. When updates to properties * are received from the network, they should be updated on this object using * g_object_set(): * * |[ * g_object_self (room_config, * "description", "A place to bury strangers", * "private", TRUE, * NULL); * tp_base_room_config_emit_properties_changed (room_config); * ]| * * On joining the room, once the entire room configuration has been retrieved * from the network, the CM should call tp_base_room_config_set_retrieved(). * * Since: 0.15.8 */ /** * TpBaseRoomConfigClass: * @update_async: begins a request to modify the room's configuration. * @update_finish: completes a call to @update_async; the default * implementation may be used if @update_async uses #GSimpleAsyncResult * * Class structure for #TpBaseRoomConfig. By default, @update_async is %NULL, * indicating that updating room configuration is not implemented; subclasses * should override it if they wish to support updating room configuration. */ /** * TpBaseRoomConfig: * * An object representing the configuration of a multi-user chat room. * * There are no public fields. */ /** * TpBaseRoomConfigUpdateAsync: * @self: a #TpBaseRoomConfig * @validated_properties: a mapping from #TpBaseRoomConfigProperty to #GValue, * whose types have already been validated. The function should not modify * this hash table. * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature for a function to begin a network request to update the room * configuration. It is guaranteed that @validated_properties will only contain * properties which were marked as mutable when the D-Bus method invocation * arrived. * * Note that #TpBaseRoomConfig will take care of applying the property updates * to itself if the operation succeeds. */ /** * TpBaseRoomConfigUpdateFinish: * @self: a #TpBaseRoomConfig * @result: the result passed to the callback * @error: used to return an error if %FALSE is returned. * * Signature for a function to complete a call to a corresponding * implementation of #TpBaseRoomConfigUpdateAsync. * * Returns: %TRUE if the room configuration update was accepted by the server; * %FALSE, with @error set, otherwise. */ /** * TpBaseRoomConfigProperty: * @TP_BASE_ROOM_CONFIG_ANONYMOUS: corresponds to #TpBaseRoomConfig:anonymous * @TP_BASE_ROOM_CONFIG_INVITE_ONLY: corresponds to #TpBaseRoomConfig:invite-only * @TP_BASE_ROOM_CONFIG_LIMIT: corresponds to #TpBaseRoomConfig:limit * @TP_BASE_ROOM_CONFIG_MODERATED: corresponds to #TpBaseRoomConfig:moderated * @TP_BASE_ROOM_CONFIG_TITLE: corresponds to #TpBaseRoomConfig:title * @TP_BASE_ROOM_CONFIG_DESCRIPTION: corresponds to #TpBaseRoomConfig:description * @TP_BASE_ROOM_CONFIG_PERSISTENT: corresponds to #TpBaseRoomConfig:persistent * @TP_BASE_ROOM_CONFIG_PRIVATE: corresponds to #TpBaseRoomConfig:private * @TP_BASE_ROOM_CONFIG_PASSWORD_PROTECTED: corresponds to #TpBaseRoomConfig:password-protected * @TP_BASE_ROOM_CONFIG_PASSWORD: corresponds to #TpBaseRoomConfig:password * @TP_BASE_ROOM_CONFIG_PASSWORD_HINT: corresponds to #TpBaseRoomConfig:password-hint * @TP_NUM_BASE_ROOM_CONFIG_PROPERTIES: the number of configuration properties * currently defined. * * An enumeration of room configuration fields, corresponding to GObject * properties and, in turn, to D-Bus properties. */ /** * TP_TYPE_BASE_ROOM_CONFIG_PROPERTY: * * The #GEnumClass type of #TpBaseRoomConfigProperty. (The nicknames are chosen * to correspond to unqualified D-Bus property names.) */ struct _TpBaseRoomConfigPrivate { TpBaseChannel *channel; gboolean anonymous; gboolean invite_only; guint32 limit; gboolean moderated; gchar *title; gchar *description; gboolean persistent; gboolean private; gboolean password_protected; gchar *password; gchar *password_hint; gboolean can_update_configuration; TpIntset *mutable_properties; gboolean configuration_retrieved; /* Contains elements of TpBaseRoomConfigProperty which are known to have * changed since we last emitted PropertiesChanged. */ TpIntset *changed_properties; /* These two properties are not elements of TpBaseRoomConfigProperty; we * track 'em separately. */ gboolean can_update_configuration_changed; gboolean mutable_properties_changed; /* Details of a pending update, or both NULL if no call to * UpdateConfiguration is in progress. */ DBusGMethodInvocation *update_configuration_ctx; GHashTable *validated_properties; }; enum { PROP_CHANNEL = 42, /* D-Bus properties */ PROP_ANONYMOUS, PROP_INVITE_ONLY, PROP_LIMIT, PROP_MODERATED, PROP_TITLE, PROP_DESCRIPTION, PROP_PERSISTENT, PROP_PRIVATE, PROP_PASSWORD_PROTECTED, PROP_PASSWORD, PROP_PASSWORD_HINT, PROP_CAN_UPDATE_CONFIGURATION, PROP_MUTABLE_PROPERTIES, PROP_CONFIGURATION_RETRIEVED, }; G_DEFINE_TYPE (TpBaseRoomConfig, tp_base_room_config, G_TYPE_OBJECT) static gboolean tp_base_room_config_update_finish ( TpBaseRoomConfig *self, GAsyncResult *result, GError **error); static void tp_base_room_config_init (TpBaseRoomConfig *self) { TpBaseRoomConfigPrivate *priv; self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_ROOM_CONFIG, TpBaseRoomConfigPrivate); priv = self->priv; priv->mutable_properties = tp_intset_new (); priv->changed_properties = tp_intset_new (); } static void add_properties_from_intset ( GPtrArray *property_names, TpIntset *properties) { TpIntsetFastIter iter; guint i; tp_intset_fast_iter_init (&iter, properties); while (tp_intset_fast_iter_next (&iter, &i)) { const gchar *property_name = _tp_enum_to_nick ( TP_TYPE_BASE_ROOM_CONFIG_PROPERTY, i); g_assert (property_name != NULL); g_ptr_array_add (property_names, (gchar *) property_name); } } static void tp_base_room_config_get_property ( GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (object); TpBaseRoomConfigPrivate *priv = self->priv; switch (property_id) { case PROP_CHANNEL: g_value_set_object (value, priv->channel); break; case PROP_ANONYMOUS: g_value_set_boolean (value, priv->anonymous); break; case PROP_INVITE_ONLY: g_value_set_boolean (value, priv->invite_only); break; case PROP_LIMIT: g_value_set_uint (value, priv->limit); break; case PROP_MODERATED: g_value_set_boolean (value, priv->moderated); break; case PROP_TITLE: g_value_set_string (value, priv->title); break; case PROP_DESCRIPTION: g_value_set_string (value, priv->description); break; case PROP_PERSISTENT: g_value_set_boolean (value, priv->persistent); break; case PROP_PRIVATE: g_value_set_boolean (value, priv->private); break; case PROP_PASSWORD_PROTECTED: g_value_set_boolean (value, priv->password_protected); break; case PROP_PASSWORD: g_value_set_string (value, priv->password); break; case PROP_PASSWORD_HINT: g_value_set_string (value, priv->password_hint); break; case PROP_CAN_UPDATE_CONFIGURATION: g_value_set_boolean (value, priv->can_update_configuration); break; case PROP_MUTABLE_PROPERTIES: { GPtrArray *property_names = g_ptr_array_new (); add_properties_from_intset (property_names, priv->mutable_properties); g_ptr_array_add (property_names, NULL); g_value_take_boxed (value, g_strdupv ((gchar **) property_names->pdata)); g_ptr_array_unref (property_names); break; } case PROP_CONFIGURATION_RETRIEVED: g_value_set_boolean (value, priv->configuration_retrieved); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void channel_died_cb ( gpointer data, GObject *deceased_channel) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (data); TpBaseRoomConfigPrivate *priv = self->priv; DEBUG ("(TpBaseChannel *)%p associated with (TpBaseRoomConfig *)%p died", deceased_channel, self); priv->channel = NULL; } static void tp_base_room_config_set_property ( GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (object); TpBaseRoomConfigPrivate *priv = self->priv; switch (property_id) { case PROP_CHANNEL: g_assert (priv->channel == NULL); priv->channel = g_value_get_object (value); g_assert (priv->channel != NULL); g_object_weak_ref (G_OBJECT (priv->channel), channel_died_cb, self); DEBUG ("associated (TpBaseChannel *)%p with (TpBaseRoomConfig *)%p", priv->channel, self); break; /* We track changed-ness of all the configuration field-flavoured properties in * priv->changed_properties. The setters can be mechanically generated: we need * the property name in uppercase to build PROP_FOO and TP_BASE_ROOM_CONFIG_FOO, * and in lowercase to assign to priv->foo. */ #define CASE_BOOL(uppercase, lowercase) \ case PROP_ ## uppercase: \ { \ gboolean lowercase = g_value_get_boolean (value); \ if (!priv->lowercase != !lowercase) \ tp_intset_add (priv->changed_properties, \ TP_BASE_ROOM_CONFIG_ ## uppercase); \ priv->lowercase = lowercase; \ break; \ } #define CASE_STRING(uppercase, lowercase) \ case PROP_ ## uppercase: \ { \ gchar *lowercase = g_value_dup_string (value); \ if (tp_strdiff (priv->lowercase, lowercase)) \ tp_intset_add (priv->changed_properties, \ TP_BASE_ROOM_CONFIG_ ## uppercase); \ g_free (priv->lowercase); \ priv->lowercase = lowercase; \ break; \ } CASE_BOOL (ANONYMOUS, anonymous) CASE_BOOL (INVITE_ONLY, invite_only) /* LIMIT is the only non-string or -boolean property, so there's no macro for * it. It's interspersed with the others because they're in the same order as * in the spec. */ case PROP_LIMIT: { guint limit = g_value_get_uint (value); if (limit != priv->limit) tp_intset_add (priv->changed_properties, TP_BASE_ROOM_CONFIG_LIMIT); priv->limit = limit; break; } CASE_BOOL (MODERATED, moderated) CASE_STRING (TITLE, title); CASE_STRING (DESCRIPTION, description) CASE_BOOL (PERSISTENT, persistent) CASE_BOOL (PRIVATE, private) CASE_BOOL (PASSWORD_PROTECTED, password_protected) CASE_STRING (PASSWORD, password) CASE_STRING (PASSWORD_HINT, password_hint) #undef CASE_BOOL #undef CASE_STRING /* This is not a member of TpBaseRoomConfigProperty, so we track its * changed-ness separately. */ case PROP_CAN_UPDATE_CONFIGURATION: { gboolean can_update_configuration = g_value_get_boolean (value); if (!priv->can_update_configuration != !can_update_configuration) priv->can_update_configuration_changed = TRUE; priv->can_update_configuration = can_update_configuration; break; } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } /* This quark is used to attach a pointer to this object to its parent * TpBaseChannel, so we can recover ourself in D-Bus method invocations * and property lookups. */ static GQuark find_myself_q = 0; static TpBaseRoomConfig * find_myself (GObject *parent) { TpBaseRoomConfig *self = g_object_get_qdata (parent, find_myself_q); DEBUG ("retrieved %p from channel %p", self, parent); g_return_val_if_fail (TP_IS_BASE_CHANNEL (parent), NULL); g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (TP_IS_BASE_ROOM_CONFIG (self), NULL); return self; } static void tp_base_room_config_constructed (GObject *object) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (object); TpBaseRoomConfigPrivate *priv = self->priv; GObjectClass *parent_class = tp_base_room_config_parent_class; if (parent_class->constructed != NULL) parent_class->constructed (object); g_assert (priv->channel != NULL); g_assert (find_myself_q != 0); g_object_set_qdata (G_OBJECT (priv->channel), find_myself_q, self); } static void tp_base_room_config_dispose (GObject *object) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (object); GObjectClass *parent_class = tp_base_room_config_parent_class; TpBaseRoomConfigPrivate *priv = self->priv; if (priv->channel != NULL) { g_object_set_qdata (G_OBJECT (priv->channel), find_myself_q, NULL); g_object_weak_unref (G_OBJECT (priv->channel), channel_died_cb, self); priv->channel = NULL; } if (parent_class->dispose != NULL) parent_class->dispose (object); } static void tp_base_room_config_finalize (GObject *object) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (object); GObjectClass *parent_class = tp_base_room_config_parent_class; TpBaseRoomConfigPrivate *priv = self->priv; g_free (priv->title); g_free (priv->description); g_free (priv->password); g_free (priv->password_hint); tp_intset_destroy (priv->mutable_properties); tp_intset_destroy (priv->changed_properties); if (priv->update_configuration_ctx != NULL) { CRITICAL ("finalizing (TpBaseRoomConfig *) %p with a pending " "UpdateConfiguration() call; this should not be possible", object); } g_warn_if_fail (priv->validated_properties == NULL); if (parent_class->finalize != NULL) parent_class->finalize (object); } static void tp_base_room_config_class_init (TpBaseRoomConfigClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; object_class->get_property = tp_base_room_config_get_property; object_class->set_property = tp_base_room_config_set_property; object_class->constructed = tp_base_room_config_constructed; object_class->dispose = tp_base_room_config_dispose; object_class->finalize = tp_base_room_config_finalize; g_type_class_add_private (klass, sizeof (TpBaseRoomConfigPrivate)); find_myself_q = g_quark_from_static_string ("TpBaseRoomConfig pointer"); klass->update_finish = tp_base_room_config_update_finish; param_spec = g_param_spec_object ("channel", "Channel", "Parent TpBaseChannel", TP_TYPE_BASE_CHANNEL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL, param_spec); /* D-Bus properties. */ param_spec = g_param_spec_boolean ("anonymous", "Anonymous", "True if people may join the channel without other members being made " "aware of their identity.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ANONYMOUS, param_spec); param_spec = g_param_spec_boolean ("invite-only", "InviteOnly", "True if people may not join the channel until they have been invited.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INVITE_ONLY, param_spec); param_spec = g_param_spec_uint ("limit", "Limit", "The limit to the number of members; or 0 if there is no limit.", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LIMIT, param_spec); param_spec = g_param_spec_boolean ("moderated", "Moderated", "True if channel membership is not sufficient to allow participation.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MODERATED, param_spec); param_spec = g_param_spec_string ("title", "Title", "A human-visible name for the channel, if it differs from " "Room.DRAFT.RoomName; the empty string, otherwise.", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TITLE, param_spec); param_spec = g_param_spec_string ("description", "Description", "A human-readable description of the channel's overall purpose; if any.", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec); param_spec = g_param_spec_boolean ("persistent", "Persistent", "True if the channel will remain in existence on the server after all " "members have left it.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PERSISTENT, param_spec); param_spec = g_param_spec_boolean ("private", "Private", "True if the channel is not visible to non-members.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PRIVATE, param_spec); param_spec = g_param_spec_boolean ("password-protected", "PasswordProtected", "True if contacts joining this channel must provide a password to be " "granted entry.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PASSWORD_PROTECTED, param_spec); param_spec = g_param_spec_string ("password", "Password", "If PasswordProtected is True, the password required to enter the " "channel, if known. If the password is unknown, or PasswordProtected " "is False, the empty string.", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PASSWORD, param_spec); param_spec = g_param_spec_string ("password-hint", "PasswordHint", "If PasswordProtected is True, a hint for the password. If the password" "password is unknown, or PasswordProtected is False, the empty string.", "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PASSWORD_HINT, param_spec); param_spec = g_param_spec_boolean ("can-update-configuration", "CanUpdateConfiguration", "If True, the user may call UpdateConfiguration to change the values of " "the properties listed in MutableProperties.", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAN_UPDATE_CONFIGURATION, param_spec); param_spec = g_param_spec_boxed ("mutable-properties", "MutableProperties", "A list of (unqualified) property names on this interface which may be " "modified using UpdateConfiguration (if CanUpdateConfiguration is " "True). Properties not listed here cannot be modified.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MUTABLE_PROPERTIES, param_spec); param_spec = g_param_spec_boolean ("configuration-retrieved", "ConfigurationRetrieved", "Becomes True once the room config has been fetched from the network", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONFIGURATION_RETRIEVED, param_spec); } /* room_config_getter: * * This is basically an indirected version of * tp_dbus_properties_mixin_getter_gobject_properties to cope with this GObject * not actually being the exported D-Bus object. */ static void room_config_getter ( GObject *object, GQuark iface, GQuark name, GValue *value, gpointer getter_data) { TpBaseRoomConfig *self = find_myself (object); g_return_if_fail (self != NULL); g_object_get_property ((GObject *) self, getter_data, value); } /* The TpBaseRoomConfigProperty enum is used to index into this array: be * careful! */ static TpDBusPropertiesMixinPropImpl room_config_properties[] = { /* Configuration */ { "Anonymous", "anonymous", NULL, }, { "InviteOnly", "invite-only", NULL }, { "Limit", "limit", NULL }, { "Moderated", "moderated", NULL }, { "Title", "title", NULL }, { "Description", "description", NULL }, { "Persistent", "persistent", NULL }, { "Private", "private", NULL }, { "PasswordProtected", "password-protected", NULL }, { "Password", "password", NULL }, { "PasswordHint", "password-hint", NULL }, /* Meta-data */ { "CanUpdateConfiguration", "can-update-configuration", NULL }, { "MutableProperties", "mutable-properties", NULL }, { "ConfigurationRetrieved", "configuration-retrieved", NULL }, { NULL } }; /** * tp_base_room_config_register_class: * @base_channel_class: the class structure for a subclass of #TpBaseChannel * which uses this object to implement #TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG * * Registers that D-Bus properties for the RoomConfig1 interface should be * handled by a #TpBaseRoomConfig object associated with instances of * @base_channel_class. * * @base_channel_class must implement #TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG * using tp_base_room_config_iface_init(), and instances of @base_channel_class * must construct an instance of #TpBaseRoomConfig, passing themself as * #TpBaseRoomConfig:channel. */ void tp_base_room_config_register_class ( TpBaseChannelClass *base_channel_class) { GObjectClass *cls = G_OBJECT_CLASS (base_channel_class); tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CHANNEL_INTERFACE_ROOM_CONFIG, room_config_getter, NULL, room_config_properties); } /* This is almost copy-pasta from _tp_dbus_properties_mixin_find_prop_impl, * except this operates on the IfaceInfo structure… */ static TpDBusPropertiesMixinPropInfo * find_prop_info ( TpDBusPropertiesMixinIfaceInfo *iface_info, const gchar *property_name) { GQuark prop_quark = g_quark_try_string (property_name); TpDBusPropertiesMixinPropInfo *prop_info; if (prop_quark == 0) return NULL; for (prop_info = iface_info->props; prop_info->name != 0; prop_info++) { if (prop_info->name == prop_quark) return prop_info; } return NULL; } static gboolean validate_property_type ( const gchar *property_name, const GValue *value, GError **error) { static TpDBusPropertiesMixinIfaceInfo *iface_info = NULL; TpDBusPropertiesMixinPropInfo *prop_info; if (G_UNLIKELY (iface_info == NULL)) iface_info = tp_svc_interface_get_dbus_properties_info ( TP_TYPE_SVC_CHANNEL_INTERFACE_ROOM_CONFIG); g_return_val_if_fail (iface_info != NULL, FALSE); /* If we recognise the property name, but it's not registered with * TpDBusPropertiesMixin, then something is really screw-y. */ prop_info = find_prop_info (iface_info, property_name); g_return_val_if_fail (prop_info != NULL, FALSE); /* TODO: transform types just like TpDBusPropertiesMixin does. We only * have one property that isn't a boolean or a string, so this is not a * pressing concern, and it would be nice to be able to reuse more of * TpDBusPropertiesMixin's validation code. */ if (!G_VALUE_HOLDS (value, prop_info->type)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' has type '%s', not '%s'", property_name, prop_info->dbus_signature, G_VALUE_TYPE_NAME (value)); return FALSE; } return TRUE; } static gboolean validate_property ( TpBaseRoomConfig *self, GHashTable *validated_properties, const gchar *property_name, GValue *value, GError **error) { TpBaseRoomConfigPrivate *priv = self->priv; gint property_id; if (!_tp_enum_from_nick (TP_TYPE_BASE_ROOM_CONFIG_PROPERTY, property_name, &property_id)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'%s' is not a known RoomConfig property.", property_name); return FALSE; } if (!tp_intset_is_member (priv->mutable_properties, property_id)) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "'%s' cannot be changed on this protocol", property_name); return FALSE; } if (!validate_property_type (property_name, value, error)) return FALSE; g_hash_table_insert (validated_properties, GUINT_TO_POINTER (property_id), tp_g_value_slice_dup (value)); return TRUE; } /* * validate_properties: * @self: it's me! * @properties: a mapping from unqualified property names (gchar *) to * corresponding new values (GValue *). * @error: set to a TP_ERROR if validation fails. * * Validates the names and types and mutability of @properties. * * Returns: a mapping from TpBaseRoomConfigProperty elements to corresponding * new values (GValue *). */ static GHashTable * validate_properties ( TpBaseRoomConfig *self, GHashTable *properties, GError **error) { GHashTable *validated_properties = g_hash_table_new_full ( NULL, NULL, NULL, (GDestroyNotify) tp_g_value_slice_free); GHashTableIter iter; gpointer k, v; g_hash_table_iter_init (&iter, properties); while (g_hash_table_iter_next (&iter, &k, &v)) { if (!validate_property (self, validated_properties, k, v, error)) { g_hash_table_unref (validated_properties); return NULL; } } return validated_properties; } static void update_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseRoomConfig *self = TP_BASE_ROOM_CONFIG (source); TpBaseRoomConfigPrivate *priv = self->priv; GError *error = NULL; g_return_if_fail (priv->update_configuration_ctx != NULL); g_return_if_fail (priv->validated_properties != NULL); /* We took a ref to the channel before calling out to application code; it * shouldn't have died in the meantime. */ g_return_if_fail (priv->channel != NULL); if (TP_BASE_ROOM_CONFIG_GET_CLASS (self)->update_finish ( self, result, &error)) { GHashTableIter iter; gpointer k, v; g_hash_table_iter_init (&iter, priv->validated_properties); while (g_hash_table_iter_next (&iter, &k, &v)) { TpBaseRoomConfigProperty property_id = GPOINTER_TO_UINT (k); GValue *value = v; const gchar *g_property_name; g_assert_cmpuint (property_id, <, TP_NUM_BASE_ROOM_CONFIG_PROPERTIES); g_property_name = room_config_properties[property_id].getter_data; g_assert_cmpstr (NULL, !=, g_property_name); g_object_set_property ((GObject *) self, g_property_name, value); } tp_base_room_config_emit_properties_changed (self); tp_svc_channel_interface_room_config_return_from_update_configuration ( priv->update_configuration_ctx); } else { dbus_g_method_return_error (priv->update_configuration_ctx, error); g_clear_error (&error); } priv->update_configuration_ctx = NULL; tp_clear_pointer (&priv->validated_properties, g_hash_table_unref); g_object_unref (priv->channel); } static gboolean tp_base_room_config_update_finish ( TpBaseRoomConfig *self, GAsyncResult *result, GError **error) { gpointer source_tag = TP_BASE_ROOM_CONFIG_GET_CLASS (self)->update_async; _tp_implement_finish_void (self, source_tag); } static void tp_base_room_config_update_configuration ( TpSvcChannelInterfaceRoomConfig *iface, GHashTable *properties, DBusGMethodInvocation *context) { TpBaseRoomConfig *self = find_myself ((GObject *) iface); TpBaseChannel *channel = TP_BASE_CHANNEL (iface); TpBaseRoomConfigPrivate *priv; TpBaseRoomConfigUpdateAsync update_async; GError *error = NULL; if (self == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_CONFUSED, "Internal error: couldn't find TpBaseRoomConfig object " "attached to (TpBaseChannel *) %p at %s", iface, tp_base_channel_get_object_path (channel)); CRITICAL ("%s", error->message); goto err; } priv = self->priv; update_async = TP_BASE_ROOM_CONFIG_GET_CLASS (self)->update_async; if (update_async == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This protocol does not implement updating the room configuration"); goto err; } if (priv->update_configuration_ctx != NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Another UpdateConfiguration() call is still in progress"); goto err; } /* If update_configuration_ctx == NULL, then validated_properties should be, * too. */ g_warn_if_fail (priv->validated_properties == NULL); if (!priv->can_update_configuration) { g_set_error (&error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "The user doesn't have permission to modify this room's " "configuration (maybe they're not an op/admin/owner?)"); goto err; } if (g_hash_table_size (properties) == 0) { tp_svc_channel_interface_room_config_return_from_update_configuration ( context); return; } priv->validated_properties = validate_properties (self, properties, &error); if (priv->validated_properties == NULL) goto err; priv->update_configuration_ctx = context; /* We ensure our channel stays alive for the duration of the call. This is * mainly as a convenience to the subclass, which would probably like * tp_base_room_config_get_channel() to work reliably. * * If the DBusGMethodInvocation kept the object alive, we wouldn't need this. */ g_object_ref (priv->channel); /* This means the CM could modify validated_properties if it wanted. This is * good in some ways: it means it can further sanitize the values if it * wants, for instance. But I guess it's also possible for the CM to mess up. */ update_async (self, priv->validated_properties, update_cb, NULL); return; err: dbus_g_method_return_error (context, error); g_clear_error (&error); } /** * tp_base_room_config_iface_init: * @g_iface: a pointer to a #TpSvcChannelInterfaceRoomConfigClass structure * @iface_data: ignored * * Pass this as the second argument to G_IMPLEMENT_INTERFACE() when defining a * #TpBaseChannel subclass to declare that TP_SVC_CHANNEL_INTERFACE_ROOM_CONFIG * is implemented using this class. The #TpBaseChannel subclass must also call * tp_base_room_config_register_class() in its class_init function, and * construct a #TpBaseRoomConfig object for each instance. */ void tp_base_room_config_iface_init ( gpointer g_iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_channel_interface_room_config_implement_##x (\ g_iface, tp_base_room_config_##x) IMPLEMENT (update_configuration); #undef IMPLEMENT } /** * tp_base_room_config_dup_channel: * @self: a #TpBaseChannel * * Returns the channel to which @self is attached. * * Returns: (transfer full): the #TpBaseRoomConfig:channel property. */ TpBaseChannel * tp_base_room_config_dup_channel ( TpBaseRoomConfig *self) { g_return_val_if_fail (TP_IS_BASE_ROOM_CONFIG (self), NULL); g_return_val_if_fail (self->priv->channel != NULL, NULL); return g_object_ref (self->priv->channel); } /** * tp_base_room_config_set_can_update_configuration: * @self: a #TpBaseRoomConfig object. * @can_update_configuration: %TRUE if the local user has permission to modify * properties marked as mutable. * * Specify whether or not the local user currently has permission to modify the * room configuration. * * Changes made by calling this function are not signalled over D-Bus until * tp_base_room_config_emit_properties_changed() is next called. */ void tp_base_room_config_set_can_update_configuration ( TpBaseRoomConfig *self, gboolean can_update_configuration) { g_return_if_fail (TP_IS_BASE_ROOM_CONFIG (self)); g_object_set (self, "can-update-configuration", can_update_configuration, NULL); } /** * tp_base_room_config_set_property_mutable: * @self: a #TpBaseRoomConfig object. * @property_id: a property identifier (not including * %TP_NUM_BASE_ROOM_CONFIG_PROPERTIES) * @is_mutable: %TRUE if it is possible for Telepathy clients to modify * @property_id when #TpBaseRoomConfig:can-update-configuration is %TRUE. * * Specify whether it is possible for room members to modify the value of * @property_id (possibly dependent on them having channel-operator powers), or * whether @property_id's value is an intrinsic fact about the protocol. * * For example, on IRC it is impossible to configure a channel to hide the * identities of participants from others, so %TP_BASE_ROOM_CONFIG_ANONYMOUS * should be marked as immutable on IRC; whereas channel operators can mark * rooms as invite-only, so %TP_BASE_ROOM_CONFIG_INVITE_ONLY should be marked as * mutable on IRC. * * By default, all properties are considered immutable. * * Call tp_base_room_config_set_can_update_configuration() to specify whether or * not it is currently possible for the local user to alter properties marked * as mutable. * * Changes made by calling this function are not signalled over D-Bus until * tp_base_room_config_emit_properties_changed() is next called. */ void tp_base_room_config_set_property_mutable ( TpBaseRoomConfig *self, TpBaseRoomConfigProperty property_id, gboolean is_mutable) { TpBaseRoomConfigPrivate *priv = self->priv; gboolean changed = FALSE; g_return_if_fail (TP_IS_BASE_ROOM_CONFIG (self)); g_return_if_fail (property_id < TP_NUM_BASE_ROOM_CONFIG_PROPERTIES); /* Grr. Damn _add and _remove functions for being asymmetrical. */ if (!is_mutable) { changed = tp_intset_remove (priv->mutable_properties, property_id); } else if (!tp_intset_is_member (priv->mutable_properties, property_id)) { tp_intset_add (priv->mutable_properties, property_id); changed = TRUE; } if (changed) { g_object_notify ((GObject *) self, "mutable-properties"); priv->mutable_properties_changed = TRUE; } } /** * tp_base_room_config_emit_properties_changed: * @self: a #TpBaseRoomConfig object. * * Signal the new values of properties which have been modified since the last * call to this method, if any. This includes changes made by calling * tp_base_room_config_set_can_update_configuration() and * tp_base_room_config_set_property_mutable(), as well as changes to any of the * (writeable) GObject properties on this object. */ void tp_base_room_config_emit_properties_changed ( TpBaseRoomConfig *self) { TpBaseRoomConfigPrivate *priv; g_return_if_fail (TP_IS_BASE_ROOM_CONFIG (self)); priv = self->priv; if (priv->channel == NULL) { CRITICAL ("the channel associated with (TpBaseRoomConfig *)%p has died", self); g_return_if_reached (); } else { GPtrArray *changed = g_ptr_array_new (); add_properties_from_intset (changed, priv->changed_properties); tp_intset_clear (priv->changed_properties); if (priv->mutable_properties_changed) { g_ptr_array_add (changed, "MutableProperties"); priv->mutable_properties_changed = FALSE; } if (priv->can_update_configuration_changed) { g_ptr_array_add (changed, "CanUpdateConfiguration"); priv->can_update_configuration_changed = FALSE; } if (changed->len > 0) { g_ptr_array_add (changed, NULL); DEBUG ("emitting PropertiesChanged for %s", g_strjoinv (", ", (gchar **) changed->pdata)); tp_dbus_properties_mixin_emit_properties_changed ( G_OBJECT (priv->channel), TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG, (const gchar * const *) changed->pdata); } g_ptr_array_unref (changed); } } /** * tp_base_room_config_set_retrieved: * @self: a #TpBaseRoomConfig object * * Signal that the room's configuration has been retrieved, as well as * signalling any queued property changes. This function should be called once * all properties have been set to meaningful values. * * It is safe to call this function more than once; second and subsequent calls * are equivalent to calling tp_base_room_config_emit_properties_changed(). */ void tp_base_room_config_set_retrieved ( TpBaseRoomConfig *self) { TpBaseRoomConfigPrivate *priv; g_return_if_fail (TP_IS_BASE_ROOM_CONFIG (self)); priv = self->priv; if (priv->channel == NULL) { CRITICAL ("the channel associated with (TpBaseRoomConfig *)%p has died", self); g_return_if_reached (); } /* Flush any pending property changes */ tp_base_room_config_emit_properties_changed (self); if (!priv->configuration_retrieved) { priv->configuration_retrieved = TRUE; tp_dbus_properties_mixin_emit_properties_changed_varargs ( G_OBJECT (priv->channel), TP_IFACE_CHANNEL_INTERFACE_ROOM_CONFIG, "ConfigurationRetrieved", NULL); } } telepathy-glib-0.24.2/telepathy-glib/base-room-config.h0000644000175000017500000001077312652510705017657 00000000000000/* * base-room-config.h - header for Channel.I.RoomConfig1 implementation * Copyright ©2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_BASE_ROOM_CONFIG_H #define TP_BASE_ROOM_CONFIG_H #include #include #include #include typedef struct _TpBaseRoomConfig TpBaseRoomConfig; typedef struct _TpBaseRoomConfigClass TpBaseRoomConfigClass; typedef struct _TpBaseRoomConfigPrivate TpBaseRoomConfigPrivate; typedef void (*TpBaseRoomConfigUpdateAsync) ( TpBaseRoomConfig *self, GHashTable *validated_properties, GAsyncReadyCallback callback, gpointer user_data); typedef gboolean (*TpBaseRoomConfigUpdateFinish) ( TpBaseRoomConfig *self, GAsyncResult *result, GError **error); struct _TpBaseRoomConfigClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ TpBaseRoomConfigUpdateAsync update_async; TpBaseRoomConfigUpdateFinish update_finish; }; struct _TpBaseRoomConfig { /*< private >*/ GObject parent; TpBaseRoomConfigPrivate *priv; }; /* By an astonishing coincidence, the nicknames for this enum are the names of * corresponding D-Bus properties. */ typedef enum { TP_BASE_ROOM_CONFIG_ANONYMOUS = 0, /*< nick=Anonymous >*/ TP_BASE_ROOM_CONFIG_INVITE_ONLY, /*< nick=InviteOnly >*/ TP_BASE_ROOM_CONFIG_LIMIT, /*< nick=Limit >*/ TP_BASE_ROOM_CONFIG_MODERATED, /*< nick=Moderated >*/ TP_BASE_ROOM_CONFIG_TITLE, /*< nick=Title >*/ TP_BASE_ROOM_CONFIG_DESCRIPTION, /*< nick=Description >*/ TP_BASE_ROOM_CONFIG_PERSISTENT, /*< nick=Persistent >*/ TP_BASE_ROOM_CONFIG_PRIVATE, /*< nick=Private >*/ TP_BASE_ROOM_CONFIG_PASSWORD_PROTECTED, /*< nick=PasswordProtected >*/ TP_BASE_ROOM_CONFIG_PASSWORD, /*< nick=Password >*/ TP_BASE_ROOM_CONFIG_PASSWORD_HINT, /*< nick=PasswordHint >*/ TP_NUM_BASE_ROOM_CONFIG_PROPERTIES /*< skip >*/ } TpBaseRoomConfigProperty; _TP_AVAILABLE_IN_0_16 GType tp_base_room_config_get_type (void); #define TP_TYPE_BASE_ROOM_CONFIG \ (tp_base_room_config_get_type ()) #define TP_BASE_ROOM_CONFIG(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_ROOM_CONFIG, TpBaseRoomConfig)) #define TP_BASE_ROOM_CONFIG_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_ROOM_CONFIG,\ TpBaseRoomConfigClass)) #define TP_IS_BASE_ROOM_CONFIG(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_ROOM_CONFIG)) #define TP_IS_BASE_ROOM_CONFIG_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_ROOM_CONFIG)) #define TP_BASE_ROOM_CONFIG_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_ROOM_CONFIG, \ TpBaseRoomConfigClass)) _TP_AVAILABLE_IN_0_16 void tp_base_room_config_register_class ( TpBaseChannelClass *base_channel_class); _TP_AVAILABLE_IN_0_16 void tp_base_room_config_iface_init ( gpointer g_iface, gpointer iface_data); _TP_AVAILABLE_IN_0_16 TpBaseChannel *tp_base_room_config_dup_channel ( TpBaseRoomConfig *self); _TP_AVAILABLE_IN_0_16 void tp_base_room_config_set_can_update_configuration ( TpBaseRoomConfig *self, gboolean can_update_configuration); _TP_AVAILABLE_IN_0_16 void tp_base_room_config_set_property_mutable ( TpBaseRoomConfig *self, TpBaseRoomConfigProperty property_id, gboolean is_mutable); _TP_AVAILABLE_IN_0_16 void tp_base_room_config_emit_properties_changed ( TpBaseRoomConfig *self); _TP_AVAILABLE_IN_0_16 void tp_base_room_config_set_retrieved ( TpBaseRoomConfig *self); /* TYPE MACROS */ #endif /* TP_BASE_ROOM_CONFIG_H */ telepathy-glib-0.24.2/telepathy-glib/add-dispatch-operation-context-internal.h0000644000175000017500000000504112652510705024337 00000000000000/**/ /* * Context objects for AddDispatchOperation calls (internal) * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_ADD_DISPATCH_OPERATION_CONTEXT_INTERNAL_H__ #define __TP_ADD_DISPATCH_OPERATION_CONTEXT_INTERNAL_H__ #include #include #include #include G_BEGIN_DECLS typedef enum { TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE, TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DONE, TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_FAILED, TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DELAYED, } TpAddDispatchOperationContextState; struct _TpAddDispatchOperationContext { /**/ GObject parent; TpAddDispatchOperationContextPrivate *priv; TpAccount *account; TpConnection *connection; /* array of reffed TpChannel */ GPtrArray *channels; /* Reffed TpChannelDispatchOperation */ TpChannelDispatchOperation *dispatch_operation; }; TpAddDispatchOperationContext * _tp_add_dispatch_operation_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, TpChannelDispatchOperation *dispatch_operation, DBusGMethodInvocation *dbus_context); TpAddDispatchOperationContextState _tp_add_dispatch_operation_context_get_state (TpAddDispatchOperationContext *self); void _tp_add_dispatch_operation_context_prepare_async ( TpAddDispatchOperationContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_add_dispatch_operation_context_prepare_finish ( TpAddDispatchOperationContext *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/contact-search-internal.h0000644000175000017500000000245112652510705021232 00000000000000/**/ /* * contact-search-internal.h - private functions for contact searches * * Copyright (C) 2010-2011 Collabora Ltd. * * The code contained in this file is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this code; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CONTACT_SEARCH_INTERNAL_H__ #define __TP_CONTACT_SEARCH_INTERNAL_H__ #include #include #include G_BEGIN_DECLS TpContactSearchResult *_tp_contact_search_result_new (const gchar *identifier); void _tp_contact_search_result_insert_field (TpContactSearchResult *self, TpContactInfoField *field); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/base-contact-list-internal.h0000644000175000017500000000504212652510705021647 00000000000000/**/ /* ContactList channel manager - internals (for use by our channels) * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_BASE_CONTACT_LIST_INTERNAL_H__ #define __TP_BASE_CONTACT_LIST_INTERNAL_H__ #include #include #include G_BEGIN_DECLS /* elements 1, 2... of this enum must be kept in sync with elements 0, 1... * of the array in the .c */ typedef enum { INVALID_TP_LIST_HANDLE = 0, TP_LIST_HANDLE_SUBSCRIBE, TP_LIST_HANDLE_PUBLISH, TP_LIST_HANDLE_STORED, TP_LIST_HANDLE_DENY, TP_NUM_LIST_HANDLES } TpListHandle; TpChannelGroupFlags _tp_base_contact_list_get_list_flags ( TpBaseContactList *self, TpHandle list); TpChannelGroupFlags _tp_base_contact_list_get_group_flags ( TpBaseContactList *self); void _tp_base_contact_list_add_to_list (TpBaseContactList *self, TpHandle list, const GArray *contacts_arr, const gchar *message, DBusGMethodInvocation *context); void _tp_base_contact_list_remove_from_list (TpBaseContactList *self, TpHandle list, const GArray *contacts_arr, const gchar *message, guint reason, DBusGMethodInvocation *context); void _tp_base_contact_list_add_to_group (TpBaseContactList *self, TpHandle group, const GArray *contacts_arr, const gchar *message, DBusGMethodInvocation *context); void _tp_base_contact_list_remove_from_group (TpBaseContactList *self, TpHandle group, const GArray *contacts_arr, const gchar *message, guint reason, DBusGMethodInvocation *context); gboolean _tp_base_contact_list_delete_group_by_handle ( TpBaseContactList *self, TpHandle group, GError **error); char _tp_base_contact_list_presence_state_to_letter (TpSubscriptionState ps); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/group-mixin.c0000644000175000017500000023212512652510705016776 00000000000000/* * group-mixin.c - Source for TpGroupMixin * * Copyright (C) 2006-2007 Collabora Ltd. * Copyright (C) 2006-2007 Nokia Corporation * @author Ole Andre Vadla Ravnaas * @author Robert McQueen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:group-mixin * @title: TpGroupMixin * @short_description: a mixin implementation of the groups interface * @see_also: #TpSvcChannelInterfaceGroup * * This mixin can be added to a channel GObject class to implement the * groups interface in a general way. * * To use the group mixin, include a #TpGroupMixinClass somewhere in your * class structure and a #TpGroupMixin somewhere in your instance structure, * and call tp_group_mixin_class_init() from your class_init function, * tp_group_mixin_init() from your init function or constructor, and * tp_group_mixin_finalize() from your dispose or finalize function. * * To use the group mixin as the implementation of * #TpSvcChannelInterfaceGroup, call * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, * tp_group_mixin_iface_init) in the fourth argument to * G_DEFINE_TYPE_WITH_CODE. * * Since 0.5.13 you can also implement the group interface by forwarding all * group operations to the group mixin of an associated object (mainly useful * for Tubes channels). To do this, call tp_external_group_mixin_init() * in the constructor after the associated object has been set, * tp_external_group_mixin_finalize() in the dispose or finalize function, and * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, * tp_external_group_mixin_iface_init) in the fourth argument to * G_DEFINE_TYPE_WITH_CODE. * * Since 0.7.10 you can also implement the properties of Group channels, * by calling tp_group_mixin_init_dbus_properties() or * tp_external_group_mixin_init_dbus_properties() (as appropriate). */ #include "config.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_GROUPS #include "debug-internal.h" static const char * group_change_reason_str (guint reason) { switch (reason) { case TP_CHANNEL_GROUP_CHANGE_REASON_NONE: return "unspecified reason"; case TP_CHANNEL_GROUP_CHANGE_REASON_OFFLINE: return "offline"; case TP_CHANNEL_GROUP_CHANGE_REASON_KICKED: return "kicked"; case TP_CHANNEL_GROUP_CHANGE_REASON_BUSY: return "busy"; case TP_CHANNEL_GROUP_CHANGE_REASON_INVITED: return "invited"; case TP_CHANNEL_GROUP_CHANGE_REASON_BANNED: return "banned"; case TP_CHANNEL_GROUP_CHANGE_REASON_ERROR: return "error"; case TP_CHANNEL_GROUP_CHANGE_REASON_INVALID_CONTACT: return "invalid contact"; case TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER: return "no answer"; case TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED: return "renamed"; case TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED: return "permission denied"; case TP_CHANNEL_GROUP_CHANGE_REASON_SEPARATED: return "separated"; default: return "(unknown reason code)"; } } typedef struct { TpHandle actor; guint reason; const gchar *message; TpHandleRepoIface *repo; } LocalPendingInfo; static LocalPendingInfo * local_pending_info_new (TpHandleRepoIface *repo, TpHandle actor, guint reason, const gchar *message) { LocalPendingInfo *info = g_slice_new0 (LocalPendingInfo); info->reason = reason; info->message = g_strdup (message); info->repo = repo; if (actor != 0) info->actor = actor; return info; } static void local_pending_info_free (LocalPendingInfo *info) { g_free ((gchar *) info->message); g_slice_free (LocalPendingInfo, info); } struct _TpGroupMixinClassPrivate { TpGroupMixinRemMemberWithReasonFunc remove_with_reason; unsigned allow_self_removal : 1; }; struct _TpGroupMixinPrivate { TpHandleSet *actors; GHashTable *handle_owners; GHashTable *local_pending_info; GPtrArray *externals; }; /** * TP_HAS_GROUP_MIXIN: * @o: a #GObject instance * * * * Returns: %TRUE if @o (or one of its parent classes) has the group mixin. * * Since: 0.13.9 */ /** * TP_HAS_GROUP_MIXIN_CLASS: * @cls: a #GObjectClass structure * * * * Returns: %TRUE if @cls (or one of its parent classes) has the group mixin. * * Since: 0.13.9 */ /** * tp_group_mixin_class_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObjectClass */ GQuark tp_group_mixin_class_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ("TpGroupMixinClassOffsetQuark"); return offset_quark; } /** * tp_group_mixin_get_offset_quark: (skip) * * * * Returns: the quark used for storing mixin offset on a GObject */ GQuark tp_group_mixin_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ("TpGroupMixinOffsetQuark"); return offset_quark; } /** * tp_group_mixin_class_set_remove_with_reason_func: (skip) * @cls: The class of an object implementing the group interface using this * mixin * @func: A callback to be used to remove contacts from this group with a * specified reason. * * Set a callback to be used to implement RemoveMembers() and * RemoveMembersWithReason(). If this function is called during class * initialization, the given callback will be used instead of the remove * callback passed to tp_group_mixin_class_init() (which must be %NULL * in this case). * * Since: 0.5.13 */ void tp_group_mixin_class_set_remove_with_reason_func (GObjectClass *cls, TpGroupMixinRemMemberWithReasonFunc func) { TpGroupMixinClass *mixin_cls = TP_GROUP_MIXIN_CLASS (cls); g_return_if_fail (mixin_cls->remove_member == NULL); g_return_if_fail (mixin_cls->priv->remove_with_reason == NULL); mixin_cls->priv->remove_with_reason = func; } /** * tp_group_mixin_class_init: (skip) * @obj_cls: The class of an object implementing the group interface using this * mixin * @offset: The offset of the TpGroupMixinClass structure within the class * structure * @add_func: A callback to be used to add contacts to this group * @rem_func: A callback to be used to remove contacts from this group. * This must be %NULL if you will subsequently call * tp_group_mixin_class_set_remove_with_reason_func(). * * Configure the mixin for use with the given class. */ void tp_group_mixin_class_init (GObjectClass *obj_cls, glong offset, TpGroupMixinAddMemberFunc add_func, TpGroupMixinRemMemberFunc rem_func) { TpGroupMixinClass *mixin_cls; g_assert (G_IS_OBJECT_CLASS (obj_cls)); g_type_set_qdata (G_OBJECT_CLASS_TYPE (obj_cls), TP_GROUP_MIXIN_CLASS_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin_cls = TP_GROUP_MIXIN_CLASS (obj_cls); mixin_cls->add_member = add_func; mixin_cls->remove_member = rem_func; mixin_cls->priv = g_slice_new0 (TpGroupMixinClassPrivate); } /** * tp_group_mixin_class_allow_self_removal: (skip) * @obj_cls: The class of an object implementing the group interface using this * mixin * * Configure the mixin to allow attempts to remove the SelfHandle from this * Group, even if the group flags would otherwise disallow this. The * channel's #TpGroupMixinRemMemberFunc or * #TpGroupMixinRemMemberWithReasonFunc will be called as usual for such * attempts, and may make them fail with %TP_ERROR_PERMISSION_DENIED if * required. * * This function should be called from the GObject @class_init callback, * after calling tp_group_mixin_class_init(). * * (Recent telepathy-spec changes make it valid to try to remove the * self-handle at all times, regardless of group flags. However, if this was * implemented automatically in TpGroupMixin, this would risk crashing * connection manager implementations that assume that TpGroupMixin will * enforce the group flags strictly. As a result, connection managers should * call this function to indicate to the TpGroupMixin that it may call their * removal callback with the self-handle regardless of flag settings.) * * Since: 0.7.27 */ void tp_group_mixin_class_allow_self_removal (GObjectClass *obj_cls) { TpGroupMixinClass *mixin_cls = TP_GROUP_MIXIN_CLASS (obj_cls); mixin_cls->priv->allow_self_removal = TRUE; } /** * tp_group_mixin_init: (skip) * @obj: An object implementing the group interface using this mixin * @offset: The offset of the TpGroupMixin structure within the instance * structure * @handle_repo: The connection's handle repository for contacts * @self_handle: The handle of the local user in this group, if any * * Initialize the mixin. */ void tp_group_mixin_init (GObject *obj, glong offset, TpHandleRepoIface *handle_repo, TpHandle self_handle) { TpGroupMixin *mixin; g_assert (G_IS_OBJECT (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_GROUP_MIXIN_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin = TP_GROUP_MIXIN (obj); mixin->handle_repo = handle_repo; if (self_handle != 0) mixin->self_handle = self_handle; mixin->group_flags = TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED; mixin->members = tp_handle_set_new (handle_repo); mixin->local_pending = tp_handle_set_new (handle_repo); mixin->remote_pending = tp_handle_set_new (handle_repo); mixin->priv = g_slice_new0 (TpGroupMixinPrivate); mixin->priv->handle_owners = g_hash_table_new (NULL, NULL); mixin->priv->local_pending_info = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify)local_pending_info_free); mixin->priv->actors = tp_handle_set_new (handle_repo); mixin->priv->externals = NULL; } static void tp_group_mixin_add_external (GObject *obj, GObject *external) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); if (mixin->priv->externals == NULL) mixin->priv->externals = g_ptr_array_new (); g_ptr_array_add (mixin->priv->externals, external); } static void tp_group_mixin_remove_external (GObject *obj, GObject *external) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); /* we can't have added it if we have no array to add it to... */ g_return_if_fail (mixin->priv->externals != NULL); g_ptr_array_remove_fast (mixin->priv->externals, external); } /** * tp_group_mixin_finalize: (skip) * @obj: An object implementing the group interface using this mixin * * Unreference handles and free resources used by this mixin. */ void tp_group_mixin_finalize (GObject *obj) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); tp_handle_set_destroy (mixin->priv->actors); g_hash_table_unref (mixin->priv->handle_owners); g_hash_table_unref (mixin->priv->local_pending_info); if (mixin->priv->externals) g_ptr_array_unref (mixin->priv->externals); g_slice_free (TpGroupMixinPrivate, mixin->priv); tp_handle_set_destroy (mixin->members); tp_handle_set_destroy (mixin->local_pending); tp_handle_set_destroy (mixin->remote_pending); } /** * tp_group_mixin_get_self_handle: (skip) * @obj: An object implementing the group mixin using this interface * @ret: Used to return the local user's handle in this group * @error: Unused * * Set the guint pointed to by ret to the local user's handle in this * group, or to 0 if the local user is not present in this group. * * Returns: %TRUE. */ gboolean tp_group_mixin_get_self_handle (GObject *obj, guint *ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); if (tp_handle_set_is_member (mixin->members, mixin->self_handle) || tp_handle_set_is_member (mixin->local_pending, mixin->self_handle) || tp_handle_set_is_member (mixin->remote_pending, mixin->self_handle)) { *ret = mixin->self_handle; } else { *ret = 0; } return TRUE; } /** * tp_group_mixin_change_self_handle: (skip) * @obj: An object implementing the group interface using this mixin * @new_self_handle: The new self-handle for this group * * Change the self-handle for this group to the given value. */ void tp_group_mixin_change_self_handle (GObject *obj, TpHandle new_self_handle) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); const gchar *new_self_id = tp_handle_inspect (mixin->handle_repo, new_self_handle); DEBUG ("%u '%s'", new_self_handle, new_self_id); mixin->self_handle = new_self_handle; tp_svc_channel_interface_group_emit_self_handle_changed (obj, new_self_handle); tp_svc_channel_interface_group_emit_self_contact_changed (obj, new_self_handle, new_self_id); } static void tp_group_mixin_get_self_handle_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { guint ret; GError *error = NULL; if (tp_group_mixin_get_self_handle ((GObject *) obj, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_self_handle ( context, ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_group_flags: (skip) * @obj: An object implementing the group mixin using this interface * @ret: Used to return the flags * @error: Unused * * Set the guint pointed to by ret to this group's flags, to be * interpreted according to TpChannelGroupFlags. * * Returns: %TRUE */ gboolean tp_group_mixin_get_group_flags (GObject *obj, guint *ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); *ret = mixin->group_flags; return TRUE; } static void tp_group_mixin_get_group_flags_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { guint ret; GError *error = NULL; if (tp_group_mixin_get_group_flags ((GObject *) obj, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_group_flags ( context, ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_add_members: (skip) * @obj: An object implementing the group interface using this mixin * @contacts: A GArray of guint representing contacts * @message: A message associated with the addition request, if supported * @error: Used to return an error if %FALSE is returned * * Request that the given contacts be added to the group as if in response * to user action. If the group's flags prohibit this, raise * PermissionDenied. If any of the handles is invalid, raise InvalidHandle. * Otherwise attempt to add the contacts by calling the callbacks provided * by the channel implementation. * * Returns: %TRUE on success */ gboolean tp_group_mixin_add_members (GObject *obj, const GArray *contacts, const gchar *message, GError **error) { TpGroupMixinClass *mixin_cls = TP_GROUP_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); guint i; TpHandle handle; /* reject invalid handles */ if (!tp_handles_are_valid (mixin->handle_repo, contacts, FALSE, error)) return FALSE; /* check that adding is allowed by flags */ for (i = 0; i < contacts->len; i++) { handle = g_array_index (contacts, TpHandle, i); if ((mixin->group_flags & TP_CHANNEL_GROUP_FLAG_CAN_ADD) == 0 && !tp_handle_set_is_member (mixin->members, handle) && !tp_handle_set_is_member (mixin->local_pending, handle)) { DEBUG ("handle %u cannot be added to members without " "GROUP_FLAG_CAN_ADD", handle); g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "handle %u cannot be added to members without " "GROUP_FLAG_CAN_ADD", handle); return FALSE; } } /* add handle by handle */ for (i = 0; i < contacts->len; i++) { handle = g_array_index (contacts, TpHandle, i); if (tp_handle_set_is_member (mixin->members, handle)) { DEBUG ("handle %u is already a member, skipping", handle); continue; } if (mixin_cls->add_member == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Adding members to this Group channel is not possible"); return FALSE; } if (!mixin_cls->add_member (obj, handle, message, error)) { return FALSE; } } return TRUE; } static void tp_group_mixin_add_members_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { GError *error = NULL; if (tp_group_mixin_add_members ((GObject *) obj, contacts, message, &error)) { tp_svc_channel_interface_group_return_from_add_members (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_remove_members: (skip) * @obj: An object implementing the group interface using this mixin * @contacts: A GArray of guint representing contacts * @message: A message to be sent to those contacts, if supported * @error: Used to return an error if %FALSE is returned * * Request that the given contacts be removed from the group as if in response * to user action. If the group's flags prohibit this, raise * PermissionDenied. If any of the handles is invalid, raise InvalidHandle. * If any of the handles is absent from the group, raise NotAvailable. * Otherwise attempt to remove the contacts by calling the callbacks provided * by the channel implementation. * * Returns: %TRUE on success */ gboolean tp_group_mixin_remove_members (GObject *obj, const GArray *contacts, const gchar *message, GError **error) { return tp_group_mixin_remove_members_with_reason (obj, contacts, message, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, error); } /** * tp_group_mixin_remove_members_with_reason: (skip) * @obj: An object implementing the group interface using this mixin * @contacts: A GArray of guint representing contacts * @message: A message to be sent to those contacts, if supported * @reason: A #TpChannelGroupChangeReason * @error: Used to return an error if %FALSE is returned * * Request that the given contacts be removed from the group as if in response * to user action. If the group's flags prohibit this, raise * PermissionDenied. If any of the handles is invalid, raise InvalidHandle. * If any of the handles is absent from the group, raise NotAvailable. * Otherwise attempt to remove the contacts by calling the callbacks provided * by the channel implementation. * * Returns: %TRUE on success */ gboolean tp_group_mixin_remove_members_with_reason (GObject *obj, const GArray *contacts, const gchar *message, guint reason, GError **error) { TpGroupMixinClass *mixin_cls = TP_GROUP_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); guint i; TpHandle handle; /* reject invalid handles */ if (!tp_handles_are_valid (mixin->handle_repo, contacts, FALSE, error)) return FALSE; /* check removing is allowed by flags */ for (i = 0; i < contacts->len; i++) { handle = g_array_index (contacts, TpHandle, i); if (mixin_cls->priv->allow_self_removal && handle == mixin->self_handle && (tp_handle_set_is_member (mixin->members, handle) || tp_handle_set_is_member (mixin->remote_pending, handle) || tp_handle_set_is_member (mixin->local_pending, handle))) { /* don't check the flags - attempting to remove the self-handle * is explicitly always allowed by this channel */ } else if (tp_handle_set_is_member (mixin->members, handle)) { if ((mixin->group_flags & TP_CHANNEL_GROUP_FLAG_CAN_REMOVE) == 0) { DEBUG ("handle %u cannot be removed from members without " "GROUP_FLAG_CAN_REMOVE", handle); g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "handle %u cannot be removed from members without " "GROUP_FLAG_CAN_REMOVE", handle); return FALSE; } } else if (tp_handle_set_is_member (mixin->remote_pending, handle)) { if ((mixin->group_flags & TP_CHANNEL_GROUP_FLAG_CAN_RESCIND) == 0) { DEBUG ("handle %u cannot be removed from remote pending " "without GROUP_FLAG_CAN_RESCIND", handle); g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "handle %u cannot be removed from remote pending without " "GROUP_FLAG_CAN_RESCIND", handle); return FALSE; } } else if (!tp_handle_set_is_member (mixin->local_pending, handle)) { DEBUG ("handle %u is not a current or pending member", handle); /* we'll skip this handle during the second pass */ } } /* remove handle by handle */ for (i = 0; i < contacts->len; i++) { handle = g_array_index (contacts, TpHandle, i); if (!tp_handle_set_is_member (mixin->members, handle) && !tp_handle_set_is_member (mixin->remote_pending, handle) && !tp_handle_set_is_member (mixin->local_pending, handle)) continue; if (mixin_cls->priv->remove_with_reason != NULL) { if (!mixin_cls->priv->remove_with_reason (obj, handle, message, reason, error)) { return FALSE; } } else if (mixin_cls->remove_member != NULL) { if (!mixin_cls->remove_member (obj, handle, message, error)) { return FALSE; } } else { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Removing contacts from this Group channel is not possible"); return FALSE; } } return TRUE; } static void tp_group_mixin_remove_members_with_reason_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, guint reason, DBusGMethodInvocation *context) { GError *error = NULL; if (tp_group_mixin_remove_members_with_reason ((GObject *) obj, contacts, message, reason, &error)) { tp_svc_channel_interface_group_return_from_remove_members_with_reason (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } static void tp_group_mixin_remove_members_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { GError *error = NULL; if (tp_group_mixin_remove_members_with_reason ((GObject *) obj, contacts, message, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, &error)) { tp_svc_channel_interface_group_return_from_remove_members (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_members: (skip) * @obj: An object implementing the group interface using this mixin * @ret: Used to return a newly-allocated GArray of guint contact handles * @error: Unused * * Get the group's current members * * Returns: %TRUE */ gboolean tp_group_mixin_get_members (GObject *obj, GArray **ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); *ret = tp_handle_set_to_array (mixin->members); return TRUE; } static void tp_group_mixin_get_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { GArray *ret; GError *error = NULL; if (tp_group_mixin_get_members ((GObject *) obj, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_members ( context, ret); g_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_local_pending_members: (skip) * @obj: An object implementing the group interface using this mixin * @ret: Used to return a newly-allocated GArray of guint contact handles * @error: Unused * * Get the group's local-pending members. * * Returns: %TRUE */ gboolean tp_group_mixin_get_local_pending_members (GObject *obj, GArray **ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); *ret = tp_handle_set_to_array (mixin->local_pending); return TRUE; } static void tp_group_mixin_get_local_pending_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { GArray *ret; GError *error = NULL; if (tp_group_mixin_get_local_pending_members ((GObject *) obj, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_local_pending_members ( context, ret); g_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } typedef struct { TpGroupMixin *mixin; GPtrArray *array; } _mixin_and_array_of_info; static void local_pending_members_with_info_foreach (TpHandleSet *set, TpHandle i, gpointer userdata) { _mixin_and_array_of_info *data = userdata; TpGroupMixinPrivate *priv = data->mixin->priv; GType info_type = TP_STRUCT_TYPE_LOCAL_PENDING_INFO; GValue entry = { 0, }; LocalPendingInfo *info = g_hash_table_lookup (priv->local_pending_info, GUINT_TO_POINTER(i)); g_assert (info != NULL); g_value_init (&entry, info_type); g_value_take_boxed (&entry, dbus_g_type_specialized_construct (info_type)); dbus_g_type_struct_set (&entry, 0, i, 1, info->actor, 2, info->reason, 3, info->message, G_MAXUINT); g_ptr_array_add (data->array, g_value_get_boxed (&entry)); } /** * tp_group_mixin_get_local_pending_members_with_info: (skip) * @obj: An object implementing the group interface using this mixin * @ret: Used to return a newly-allocated GPtrArray of D-Bus structures each * containing the handle of a local-pending contact, the handle of a contact * responsible for adding them to the group (or 0), the reason code * and a related message (e.g. their request to join the group) * @error: Unused * * Get the group's local-pending members and information about their * requests to join the channel. * * Returns: %TRUE */ gboolean tp_group_mixin_get_local_pending_members_with_info ( GObject *obj, GPtrArray **ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); _mixin_and_array_of_info data = { mixin, NULL }; *ret = g_ptr_array_new (); data.array = *ret; tp_handle_set_foreach (mixin->local_pending, local_pending_members_with_info_foreach, &data); return TRUE; } static void tp_group_mixin_get_local_pending_members_with_info_async ( TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { GPtrArray *ret; GError *error = NULL; if (tp_group_mixin_get_local_pending_members_with_info ((GObject *) obj, &ret, &error)) { guint i; tp_svc_channel_interface_group_return_from_get_local_pending_members_with_info ( context, ret); for (i = 0 ; i < ret->len; i++) { tp_value_array_free (g_ptr_array_index (ret,i)); } g_ptr_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_remote_pending_members: (skip) * @obj: An object implementing the group interface using this mixin * @ret: Used to return a newly-allocated GArray of guint representing the * handles of the group's remote pending members * @error: Unused * * Get the group's remote-pending members. * * Returns: %TRUE */ gboolean tp_group_mixin_get_remote_pending_members (GObject *obj, GArray **ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); *ret = tp_handle_set_to_array (mixin->remote_pending); return TRUE; } static void tp_group_mixin_get_remote_pending_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { GArray *ret; GError *error = NULL; if (tp_group_mixin_get_remote_pending_members ((GObject *) obj, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_remote_pending_members ( context, ret); g_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_all_members: (skip) * @obj: An object implementing the group interface using this mixin * @members: Used to return a newly-allocated GArray of guint representing * the handles of the group's members * @local_pending: Used to return a newly-allocated GArray of guint * representing the handles of the group's local pending members * @remote_pending: Used to return a newly-allocated GArray of guint * representing the handles of the group's remote pending members * @error: Unused * * Get the group's current and pending members. * * Returns: %TRUE */ gboolean tp_group_mixin_get_all_members (GObject *obj, GArray **members, GArray **local_pending, GArray **remote_pending, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); *members = tp_handle_set_to_array (mixin->members); *local_pending = tp_handle_set_to_array (mixin->local_pending); *remote_pending = tp_handle_set_to_array (mixin->remote_pending); return TRUE; } static void tp_group_mixin_get_all_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { GArray *mem, *local, *remote; GError *error = NULL; if (tp_group_mixin_get_all_members ((GObject *) obj, &mem, &local, &remote, &error)) { tp_svc_channel_interface_group_return_from_get_all_members ( context, mem, local, remote); g_array_unref (mem); g_array_unref (local); g_array_unref (remote); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_group_mixin_get_handle_owners: (skip) * @obj: An object implementing the group interface with this mixin * @handles: An array of guint representing locally valid handles * @ret: Used to return an array of guint representing globally valid * handles, or 0 where unavailable, if %TRUE is returned * @error: Used to return an error if %FALSE is returned * * If the mixin has the flag %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES, * return the global owners of the given local handles, or 0 where * unavailable. * * Returns: %TRUE (setting @ret) on success, %FALSE (setting @error) on * failure */ gboolean tp_group_mixin_get_handle_owners (GObject *obj, const GArray *handles, GArray **ret, GError **error) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); TpGroupMixinPrivate *priv = mixin->priv; guint i; if ((mixin->group_flags & TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) == 0) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "channel doesn't have channel specific handles"); return FALSE; } if (!tp_handles_are_valid (mixin->handle_repo, handles, FALSE, error)) { return FALSE; } *ret = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), handles->len); for (i = 0; i < handles->len; i++) { TpHandle local_handle = g_array_index (handles, TpHandle, i); TpHandle owner_handle; if (!tp_handle_set_is_member (mixin->members, local_handle)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "handle %u is not a member", local_handle); g_array_unref (*ret); *ret = NULL; return FALSE; } owner_handle = GPOINTER_TO_UINT ( g_hash_table_lookup (priv->handle_owners, GUINT_TO_POINTER (local_handle))); g_array_append_val (*ret, owner_handle); } return TRUE; } static void tp_group_mixin_get_handle_owners_async (TpSvcChannelInterfaceGroup *obj, const GArray *handles, DBusGMethodInvocation *context) { GArray *ret; GError *error = NULL; if (tp_group_mixin_get_handle_owners ((GObject *) obj, handles, &ret, &error)) { tp_svc_channel_interface_group_return_from_get_handle_owners ( context, ret); g_array_unref (ret); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } #define GFTS_APPEND_FLAG_IF_SET(flag) \ if (flags & flag) \ { \ if (i++ > 0) \ g_string_append (str, "|"); \ g_string_append (str, #flag + 22); \ flags &= ~flag; \ } static gchar * group_flags_to_string (TpChannelGroupFlags flags) { gint i = 0; GString *str; str = g_string_new ("["); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_CAN_ADD); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_CAN_REMOVE); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_CAN_RESCIND); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_ADD); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_REMOVE); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_REJECT); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_RESCIND); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_ONLY_ONE_GROUP); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_HANDLE_OWNERS_NOT_AVAILABLE); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_PROPERTIES); GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED); /* Print out any remaining flags that weren't removed in the above cases * numerically. */ if (flags != 0) { if (i > 0) g_string_append (str, "|"); g_string_append_printf (str, "%u", flags); } g_string_append (str, "]"); return g_string_free (str, FALSE); } /** * tp_group_mixin_change_flags: (skip) * @obj: An object implementing the groups interface using this mixin * @add: Flags to be added * @del: Flags to be removed * * Request a change to be made to the flags. If any flags were actually * set or cleared, emits the GroupFlagsChanged signal with the changes. * * It is an error to set any of the same bits in both @add and @del. * * Changed in 0.7.7: the signal is not emitted if adding @add and * removing @del had no effect on the existing group flags. */ void tp_group_mixin_change_flags (GObject *obj, TpChannelGroupFlags add, TpChannelGroupFlags del) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); TpChannelGroupFlags added, removed; /* It's meaningless to want to add and remove the same capability */ g_return_if_fail ((add & del) == 0); added = add & ~mixin->group_flags; mixin->group_flags |= added; removed = del & mixin->group_flags; mixin->group_flags &= ~removed; if (added == 0 && removed == 0) { DEBUG ("No change: %u includes all the bits of %u and none of %u", mixin->group_flags, add, del); } else { gchar *str_added, *str_removed, *str_flags; if (DEBUGGING) { str_added = group_flags_to_string (added); str_removed = group_flags_to_string (removed); str_flags = group_flags_to_string (mixin->group_flags); DEBUG ("emitting group flags changed\n" " added : %s\n" " removed : %s\n" " flags now: %s\n", str_added, str_removed, str_flags); g_free (str_added); g_free (str_removed); g_free (str_flags); } tp_svc_channel_interface_group_emit_group_flags_changed (obj, added, removed); if (mixin->priv->externals != NULL) { guint i; for (i = 0; i < mixin->priv->externals->len; i++) { tp_svc_channel_interface_group_emit_group_flags_changed ((GObject *) g_ptr_array_index (mixin->priv->externals, i), added, removed); } } } } static gchar * member_array_to_string (TpHandleRepoIface *repo, const GArray *array) { GString *str; guint i; str = g_string_new ("["); for (i = 0; i < array->len; i++) { TpHandle handle; const gchar *handle_str; handle = g_array_index (array, guint, i); handle_str = tp_handle_inspect (repo, handle); g_string_append_printf (str, "%s%u (%s)", /* indent to: " remote_pending: [" */ (i > 0) ? "\n " : "", handle, handle_str); } g_string_append (str, "]"); return g_string_free (str, FALSE); } static GArray *remove_handle_owners_if_exist (GObject *obj, GArray *array) G_GNUC_WARN_UNUSED_RESULT; typedef struct { TpGroupMixin *mixin; LocalPendingInfo *info; } _mixin_and_info; static void local_pending_added_foreach (guint i, gpointer userdata) { _mixin_and_info *data = userdata; TpGroupMixinPrivate *priv = data->mixin->priv; g_hash_table_insert (priv->local_pending_info, GUINT_TO_POINTER (i), local_pending_info_new (data->mixin->handle_repo, data->info->actor, data->info->reason, data->info->message)); } static void local_pending_added (TpGroupMixin *mixin, const TpIntset *added, TpHandle actor, guint reason, const gchar *message) { LocalPendingInfo info; _mixin_and_info data = { mixin, &info }; info.actor = actor; info.reason = reason; info.message = message; tp_intset_foreach (added, local_pending_added_foreach, &data); } static void local_pending_remove_foreach (guint i, gpointer userdata) { TpGroupMixin *mixin = (TpGroupMixin *) userdata; TpGroupMixinPrivate *priv = mixin->priv; g_hash_table_remove (priv->local_pending_info, GUINT_TO_POINTER(i)); } static void local_pending_remove (TpGroupMixin *mixin, TpIntset *removed) { tp_intset_foreach (removed, local_pending_remove_foreach, mixin); } static void add_members_in_array (GHashTable *contact_ids, TpHandleRepoIface *repo, const GArray *handles) { guint i; for (i = 0; i < handles->len; i++) { TpHandle handle = g_array_index (handles, TpHandle, i); const gchar *id = tp_handle_inspect (repo, handle); g_hash_table_insert (contact_ids, GUINT_TO_POINTER (handle), (gchar *) id); } } static gboolean maybe_add_contact_ids (TpGroupMixin *mixin, const GArray *add, const GArray *local_pending, const GArray *remote_pending, TpHandle actor, GHashTable *details) { GHashTable *contact_ids; /* If the library user had its own ideas about which members' IDs to include * in the change details, we'll leave that intact. */ if (tp_asv_lookup (details, "contact-ids") != NULL) return FALSE; /* The library user didn't include the new members' IDs in details; let's add * the IDs of the handles being added to the group (but not removed, as per * the spec) and of the actor. */ contact_ids = g_hash_table_new (NULL, NULL); add_members_in_array (contact_ids, mixin->handle_repo, add); add_members_in_array (contact_ids, mixin->handle_repo, local_pending); add_members_in_array (contact_ids, mixin->handle_repo, remote_pending); if (actor != 0) { const gchar *id = tp_handle_inspect (mixin->handle_repo, actor); g_hash_table_insert (contact_ids, GUINT_TO_POINTER (actor), (gchar *) id); } g_hash_table_insert (details, "contact-ids", tp_g_value_slice_new_take_boxed (TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP, contact_ids)); return TRUE; } static void remove_contact_ids (GHashTable *details) { GValue *contact_ids_v = g_hash_table_lookup (details, "contact-ids"); g_assert (contact_ids_v != NULL); g_hash_table_steal (details, "contact-ids"); tp_g_value_slice_free (contact_ids_v); } static void emit_members_changed_signals (GObject *channel, const gchar *message, const GArray *add, const GArray *del, const GArray *local_pending, const GArray *remote_pending, TpHandle actor, TpChannelGroupChangeReason reason, const GHashTable *details) { TpGroupMixin *mixin = TP_GROUP_MIXIN (channel); GHashTable *details_ = (GHashTable *) details; /* Cast the pain away! */ gboolean added_contact_ids; if (DEBUGGING) { gchar *add_str, *rem_str, *local_str, *remote_str; add_str = member_array_to_string (mixin->handle_repo, add); rem_str = member_array_to_string (mixin->handle_repo, del); local_str = member_array_to_string (mixin->handle_repo, local_pending); remote_str = member_array_to_string (mixin->handle_repo, remote_pending); DEBUG ("emitting members changed\n" " message : \"%s\"\n" " added : %s\n" " removed : %s\n" " local_pending : %s\n" " remote_pending: %s\n" " actor : %u\n" " reason : %u: %s\n", message, add_str, rem_str, local_str, remote_str, actor, reason, group_change_reason_str (reason)); g_free (add_str); g_free (rem_str); g_free (local_str); g_free (remote_str); } added_contact_ids = maybe_add_contact_ids (mixin, add, local_pending, remote_pending, actor, details_); tp_svc_channel_interface_group_emit_members_changed (channel, message, add, del, local_pending, remote_pending, actor, reason); tp_svc_channel_interface_group_emit_members_changed_detailed (channel, add, del, local_pending, remote_pending, details_); if (mixin->priv->externals != NULL) { guint i; for (i = 0; i < mixin->priv->externals->len; i++) { GObject *external = g_ptr_array_index (mixin->priv->externals, i); tp_svc_channel_interface_group_emit_members_changed (external, message, add, del, local_pending, remote_pending, actor, reason); tp_svc_channel_interface_group_emit_members_changed_detailed ( external, add, del, local_pending, remote_pending, details_); } } if (added_contact_ids) remove_contact_ids (details_); } static gboolean change_members (GObject *obj, const gchar *message, const TpIntset *add, const TpIntset *del, const TpIntset *add_local_pending, const TpIntset *add_remote_pending, TpHandle actor, TpChannelGroupChangeReason reason, const GHashTable *details) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); TpIntset *new_add, *new_remove, *new_local_pending, *new_remote_pending, *tmp, *tmp2, *empty; gboolean ret; empty = tp_intset_new (); if (message == NULL) message = ""; if (add == NULL) add = empty; if (del == NULL) del = empty; if (add_local_pending == NULL) add_local_pending = empty; if (add_remote_pending == NULL) add_remote_pending = empty; /* remember the actor handle before any handle unreffing happens */ if (actor) { tp_handle_set_add (mixin->priv->actors, actor); } /* members + add */ new_add = tp_handle_set_update (mixin->members, add); /* members - del */ new_remove = tp_handle_set_difference_update (mixin->members, del); /* members - add_local_pending */ tmp = tp_handle_set_difference_update (mixin->members, add_local_pending); tp_intset_destroy (tmp); /* members - add_remote_pending */ tmp = tp_handle_set_difference_update (mixin->members, add_remote_pending); tp_intset_destroy (tmp); /* local pending + add_local_pending */ new_local_pending = tp_handle_set_update (mixin->local_pending, add_local_pending); local_pending_added (mixin, add_local_pending, actor, reason, message); /* local pending - add */ tmp = tp_handle_set_difference_update (mixin->local_pending, add); local_pending_remove (mixin, tmp); tp_intset_destroy (tmp); /* local pending - del */ tmp = tp_handle_set_difference_update (mixin->local_pending, del); local_pending_remove (mixin, tmp); tmp2 = tp_intset_union (new_remove, tmp); tp_intset_destroy (new_remove); tp_intset_destroy (tmp); new_remove = tmp2; /* local pending - add_remote_pending */ tmp = tp_handle_set_difference_update (mixin->local_pending, add_remote_pending); local_pending_remove (mixin, tmp); tp_intset_destroy (tmp); /* remote pending + add_remote_pending */ new_remote_pending = tp_handle_set_update (mixin->remote_pending, add_remote_pending); /* remote pending - add */ tmp = tp_handle_set_difference_update (mixin->remote_pending, add); tp_intset_destroy (tmp); /* remote pending - del */ tmp = tp_handle_set_difference_update (mixin->remote_pending, del); tmp2 = tp_intset_union (new_remove, tmp); tp_intset_destroy (new_remove); tp_intset_destroy (tmp); new_remove = tmp2; /* remote pending - local_pending */ tmp = tp_handle_set_difference_update (mixin->remote_pending, add_local_pending); tp_intset_destroy (tmp); if (tp_intset_size (new_add) > 0 || tp_intset_size (new_remove) > 0 || tp_intset_size (new_local_pending) > 0 || tp_intset_size (new_remote_pending) > 0) { GArray *arr_add, *arr_remove, *arr_local, *arr_remote; GArray *arr_owners_removed; /* translate intsets to arrays */ arr_add = tp_intset_to_array (new_add); arr_remove = tp_intset_to_array (new_remove); arr_local = tp_intset_to_array (new_local_pending); arr_remote = tp_intset_to_array (new_remote_pending); /* remove any handle owner mappings */ arr_owners_removed = remove_handle_owners_if_exist (obj, arr_remove); /* emit signals */ emit_members_changed_signals (obj, message, arr_add, arr_remove, arr_local, arr_remote, actor, reason, details); if (arr_owners_removed->len > 0) { GHashTable *empty_hash_table = g_hash_table_new (NULL, NULL); tp_svc_channel_interface_group_emit_handle_owners_changed (obj, empty_hash_table, arr_owners_removed); tp_svc_channel_interface_group_emit_handle_owners_changed_detailed ( obj, empty_hash_table, arr_owners_removed, empty_hash_table); if (mixin->priv->externals != NULL) { guint i; for (i = 0; i < mixin->priv->externals->len; i++) { tp_svc_channel_interface_group_emit_handle_owners_changed ( g_ptr_array_index (mixin->priv->externals, i), empty_hash_table, arr_owners_removed); tp_svc_channel_interface_group_emit_handle_owners_changed_detailed ( g_ptr_array_index (mixin->priv->externals, i), empty_hash_table, arr_owners_removed, empty_hash_table); } } g_hash_table_unref (empty_hash_table); } /* free arrays */ g_array_unref (arr_add); g_array_unref (arr_remove); g_array_unref (arr_local); g_array_unref (arr_remote); g_array_unref (arr_owners_removed); ret = TRUE; } else { DEBUG ("not emitting signal, nothing changed"); ret = FALSE; } /* free intsets */ tp_intset_destroy (new_add); tp_intset_destroy (new_remove); tp_intset_destroy (new_local_pending); tp_intset_destroy (new_remote_pending); tp_intset_destroy (empty); return ret; } /** * tp_group_mixin_change_members: (skip) * @obj: An object implementing the group interface using this mixin * @message: A message to be sent to the affected contacts if possible; * %NULL is allowed, and is mapped to an empty string * @add: A set of contact handles to be added to the members (if not * already present) and removed from local pending and remote pending * (if present) * @del: A set of contact handles to be removed from members, * local pending or remote pending, wherever they are present * @add_local_pending: A set of contact handles to be added to local pending, * and removed from members and remote pending * @add_remote_pending: A set of contact handles to be added to remote pending, * and removed from members and local pending * @actor: The handle of the contact responsible for this change * @reason: The reason for this change * * Change the sets of members as given by the arguments, and emit the * MembersChanged and MembersChangedDetailed signals if the changes were not a * no-op. * * This function must be called in response to events on the underlying * IM protocol, and must not be called in direct response to user input; * it does not respect the permissions flags, but changes the group directly. * * If any two of add, del, add_local_pending and add_remote_pending have * a non-empty intersection, the result is undefined. Don't do that. * * Each of the TpIntset arguments may be %NULL, which is treated as * equivalent to an empty set. * * Returns: %TRUE if the group was changed and the MembersChanged(Detailed) * signals were emitted; %FALSE if nothing actually changed and the signals * were suppressed. */ gboolean tp_group_mixin_change_members (GObject *obj, const gchar *message, const TpIntset *add, const TpIntset *del, const TpIntset *add_local_pending, const TpIntset *add_remote_pending, TpHandle actor, TpChannelGroupChangeReason reason) { GHashTable *details = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); gboolean ret; if (actor != 0) { g_hash_table_insert (details, "actor", tp_g_value_slice_new_uint (actor)); } if (reason != TP_CHANNEL_GROUP_CHANGE_REASON_NONE) { g_hash_table_insert (details, "change-reason", tp_g_value_slice_new_uint (reason)); } if (message != NULL && message[0] != '\0') { g_hash_table_insert (details, "message", tp_g_value_slice_new_string (message)); } ret = change_members (obj, message, add, del, add_local_pending, add_remote_pending, actor, reason, details); g_hash_table_unref (details); return ret; } /** * tp_group_mixin_change_members_detailed: (skip) * @obj: An object implementing the group interface using this mixin * @add: A set of contact handles to be added to the members (if not * already present) and removed from local pending and remote pending * (if present) * @del: A set of contact handles to be removed from members, * local pending or remote pending, wherever they are present * @add_local_pending: A set of contact handles to be added to local pending, * and removed from members and remote pending * @add_remote_pending: A set of contact handles to be added to remote pending, * and removed from members and local pending * @details: a map from strings to GValues detailing the change * * Change the sets of members as given by the arguments, and emit the * MembersChanged and MembersChangedDetailed signals if the changes were not a * no-op. * * This function must be called in response to events on the underlying * IM protocol, and must not be called in direct response to user input; * it does not respect the permissions flags, but changes the group directly. * * If any two of add, del, add_local_pending and add_remote_pending have * a non-empty intersection, the result is undefined. Don't do that. * * Each of the TpIntset arguments may be %NULL, which is treated as * equivalent to an empty set. * * details may contain, among other entries, the well-known * keys (and corresponding type, wrapped in a GValue) defined by the * Group.MembersChangedDetailed signal's specification; these include "actor" * (a handle as G_TYPE_UINT), "change-reason" (an element of * #TpChannelGroupChangeReason as G_TYPE_UINT), "message" (G_TYPE_STRING), * "error" (G_TYPE_STRING), "debug-message" (G_TYPE_STRING). * * If all of the information in details could be passed to * tp_group_mixin_change_members() then calling this function instead provides * no benefit. Calling this function without setting * #TP_CHANNEL_GROUP_FLAG_MEMBERS_CHANGED_DETAILED with * tp_group_mixin_change_members() first is not very useful, as clients will * not know to listen for MembersChangedDetailed and thus will miss the * details. * * Returns: %TRUE if the group was changed and the MembersChanged(Detailed) * signals were emitted; %FALSE if nothing actually changed and the signals * were suppressed. * * Since: 0.7.21 */ gboolean tp_group_mixin_change_members_detailed (GObject *obj, const TpIntset *add, const TpIntset *del, const TpIntset *add_local_pending, const TpIntset *add_remote_pending, const GHashTable *details) { const gchar *message; TpHandle actor; TpChannelGroupChangeReason reason; gboolean valid; g_return_val_if_fail (details != NULL, FALSE); /* For each detail we're extracting for the benefit of old-school * MembersChanged, warn if it's present but badly typed. */ message = tp_asv_get_string (details, "message"); g_warn_if_fail (message != NULL || tp_asv_lookup (details, "message") == NULL); /* change_members will cry (via tp_handle_set_add) if actor is non-zero and * invalid. */ actor = tp_asv_get_uint32 (details, "actor", &valid); g_warn_if_fail (valid || tp_asv_lookup (details, "actor") == NULL); reason = tp_asv_get_uint32 (details, "change-reason", &valid); g_warn_if_fail (valid || tp_asv_lookup (details, "change-reason") == NULL); return change_members (obj, message, add, del, add_local_pending, add_remote_pending, actor, reason, details); } /** * tp_group_mixin_add_handle_owner: (skip) * @obj: A GObject implementing the group interface with this mixin * @local_handle: A contact handle valid within this group (may not be 0) * @owner_handle: A contact handle valid globally, or 0 if the owner of the * @local_handle is unknown * * Note that the given local handle is an alias within this group * for the given globally-valid handle. It will be returned from subsequent * GetHandleOwner queries where appropriate. * * Changed in 0.7.10: The @owner_handle may be 0. To comply with telepathy-spec * 0.17.6, before adding any channel-specific handle to the members, * local-pending members or remote-pending members, you must call either * this function or tp_group_mixin_add_handle_owners(). */ void tp_group_mixin_add_handle_owner (GObject *obj, TpHandle local_handle, TpHandle owner_handle) { GHashTable *tmp; g_return_if_fail (local_handle != 0); tmp = g_hash_table_new (g_direct_hash, g_direct_equal); g_hash_table_insert (tmp, GUINT_TO_POINTER (local_handle), GUINT_TO_POINTER (owner_handle)); tp_group_mixin_add_handle_owners (obj, tmp); g_hash_table_unref (tmp); } static void add_us_mapping_for_handleset (GHashTable *map, TpHandleRepoIface *repo, TpHandleSet *handles) { TpIntset *set; TpIntsetFastIter iter; TpHandle handle; set = tp_handle_set_peek (handles); tp_intset_fast_iter_init (&iter, set); while (tp_intset_fast_iter_next (&iter, &handle)) g_hash_table_insert (map, GUINT_TO_POINTER (handle), (gchar *) tp_handle_inspect (repo, handle)); } static void add_us_mapping_for_owners_map (GHashTable *map, TpHandleRepoIface *repo, GHashTable *owners) { GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, owners); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle local_handle = GPOINTER_TO_UINT (key); TpHandle owner_handle = GPOINTER_TO_UINT (value); g_hash_table_insert (map, key, (gchar *) tp_handle_inspect (repo, local_handle)); if (owner_handle != 0) g_hash_table_insert (map, value, (gchar *) tp_handle_inspect (repo, owner_handle)); } } static void add_handle_owners_helper (gpointer key, gpointer value, gpointer user_data) { TpHandle local_handle = GPOINTER_TO_UINT (key); TpGroupMixin *mixin = user_data; g_return_if_fail (local_handle != 0); g_hash_table_insert (mixin->priv->handle_owners, key, value); } /** * tp_group_mixin_add_handle_owners: (skip) * @obj: A GObject implementing the group interface with this mixin * @local_to_owner_handle: A map from contact handles valid within this group * (which may not be 0) to either contact handles valid globally, or 0 if the * owner of the corresponding key is unknown; all handles are stored using * GUINT_TO_POINTER * * Note that the given local handles are aliases within this group * for the given globally-valid handles. * * To comply with telepathy-spec 0.17.6, before adding any channel-specific * handle to the members, local-pending members or remote-pending members, you * must call either this function or tp_group_mixin_add_handle_owner(). * * Since: 0.7.10 */ void tp_group_mixin_add_handle_owners (GObject *obj, GHashTable *local_to_owner_handle) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); GArray *empty_array; GHashTable *ids = g_hash_table_new (NULL, NULL); if (g_hash_table_size (local_to_owner_handle) == 0) return; empty_array = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0); g_hash_table_foreach (local_to_owner_handle, add_handle_owners_helper, mixin); tp_svc_channel_interface_group_emit_handle_owners_changed (obj, local_to_owner_handle, empty_array); add_us_mapping_for_owners_map (ids, mixin->handle_repo, local_to_owner_handle); tp_svc_channel_interface_group_emit_handle_owners_changed_detailed (obj, local_to_owner_handle, empty_array, ids); g_array_unref (empty_array); g_hash_table_unref (ids); } static GArray * remove_handle_owners_if_exist (GObject *obj, GArray *array) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); TpGroupMixinPrivate *priv = mixin->priv; guint i; GArray *ret; ret = g_array_sized_new (FALSE, FALSE, sizeof (guint), array->len); for (i = 0; i < array->len; i++) { TpHandle handle = g_array_index (array, guint, i); gpointer local_handle, owner_handle; g_assert (handle != 0); if (g_hash_table_lookup_extended (priv->handle_owners, GUINT_TO_POINTER (handle), &local_handle, &owner_handle)) { g_assert (GPOINTER_TO_UINT (local_handle) == handle); g_array_append_val (ret, handle); g_hash_table_remove (priv->handle_owners, GUINT_TO_POINTER (handle)); } } return ret; } static GHashTable * dup_member_identifiers (GObject *obj) { TpGroupMixin *mixin = TP_GROUP_MIXIN (obj); GHashTable *ret = g_hash_table_new (NULL, NULL); g_hash_table_insert (ret, GUINT_TO_POINTER (mixin->self_handle), (gchar *) tp_handle_inspect (mixin->handle_repo, mixin->self_handle)); add_us_mapping_for_handleset (ret, mixin->handle_repo, mixin->priv->actors); add_us_mapping_for_handleset (ret, mixin->handle_repo, mixin->members); add_us_mapping_for_handleset (ret, mixin->handle_repo, mixin->local_pending); add_us_mapping_for_handleset (ret, mixin->handle_repo, mixin->remote_pending); add_us_mapping_for_owners_map (ret, mixin->handle_repo, mixin->priv->handle_owners); return ret; } /** * tp_group_mixin_iface_init: (skip) * @g_iface: A #TpSvcChannelInterfaceGroupClass * @iface_data: Unused * * Fill in the vtable entries needed to implement the group interface using * this mixin. This function should usually be called via * G_IMPLEMENT_INTERFACE. */ void tp_group_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelInterfaceGroupClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_group_implement_##x (klass,\ tp_group_mixin_##x##_async) IMPLEMENT(add_members); IMPLEMENT(get_all_members); IMPLEMENT(get_group_flags); IMPLEMENT(get_handle_owners); IMPLEMENT(get_local_pending_members); IMPLEMENT(get_local_pending_members_with_info); IMPLEMENT(get_members); IMPLEMENT(get_remote_pending_members); IMPLEMENT(get_self_handle); IMPLEMENT(remove_members); IMPLEMENT(remove_members_with_reason); #undef IMPLEMENT } enum { MIXIN_DP_GROUP_FLAGS, MIXIN_DP_HANDLE_OWNERS, MIXIN_DP_LOCAL_PENDING_MEMBERS, MIXIN_DP_MEMBERS, MIXIN_DP_REMOTE_PENDING_MEMBERS, MIXIN_DP_SELF_HANDLE, MIXIN_DP_MEMBER_IDENTIFIERS, NUM_MIXIN_DBUS_PROPERTIES }; /** * tp_group_mixin_get_dbus_property: (skip) * @object: An object with this mixin * @interface: Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP * @name: A quark representing the D-Bus property name, either * "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", * "RemotePendingMembers" or "SelfHandle" * @value: A GValue pre-initialized to the right type, into which to put the * value * @unused: Ignored * * An implementation of #TpDBusPropertiesMixinGetter which assumes that the * @object has the group mixin. It can only be used for the Group interface. * * Since: 0.7.10 */ void tp_group_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { TpGroupMixin *mixin; static GQuark q[NUM_MIXIN_DBUS_PROPERTIES] = { 0 }; if (G_UNLIKELY (q[0] == 0)) { q[MIXIN_DP_GROUP_FLAGS] = g_quark_from_static_string ("GroupFlags"); q[MIXIN_DP_HANDLE_OWNERS] = g_quark_from_static_string ("HandleOwners"); q[MIXIN_DP_LOCAL_PENDING_MEMBERS] = g_quark_from_static_string ( "LocalPendingMembers"); q[MIXIN_DP_MEMBERS] = g_quark_from_static_string ("Members"); q[MIXIN_DP_REMOTE_PENDING_MEMBERS] = g_quark_from_static_string ( "RemotePendingMembers"); q[MIXIN_DP_SELF_HANDLE] = g_quark_from_static_string ("SelfHandle"); q[MIXIN_DP_MEMBER_IDENTIFIERS] = g_quark_from_static_string ("MemberIdentifiers"); } g_return_if_fail (object != NULL); mixin = TP_GROUP_MIXIN (object); g_return_if_fail (mixin != NULL); g_return_if_fail (interface == TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP); g_return_if_fail (name != 0); g_return_if_fail (value != NULL); if (name == q[MIXIN_DP_GROUP_FLAGS]) { g_return_if_fail (G_VALUE_HOLDS_UINT (value)); g_value_set_uint (value, mixin->group_flags); } else if (name == q[MIXIN_DP_HANDLE_OWNERS]) { g_return_if_fail (G_VALUE_HOLDS (value, TP_HASH_TYPE_HANDLE_OWNER_MAP)); g_value_set_boxed (value, mixin->priv->handle_owners); } else if (name == q[MIXIN_DP_LOCAL_PENDING_MEMBERS]) { GPtrArray *ret = NULL; gboolean success; g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); success = tp_group_mixin_get_local_pending_members_with_info (object, &ret, NULL); g_assert (success); /* as of 0.7.8, cannot fail */ g_value_take_boxed (value, ret); } else if (name == q[MIXIN_DP_MEMBERS]) { GArray *ret = NULL; gboolean success; g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); success = tp_group_mixin_get_members (object, &ret, NULL); g_assert (success); /* as of 0.7.8, cannot fail */ g_value_take_boxed (value, ret); } else if (name == q[MIXIN_DP_REMOTE_PENDING_MEMBERS]) { GArray *ret = NULL; gboolean success; g_return_if_fail (G_VALUE_HOLDS_BOXED (value)); success = tp_group_mixin_get_remote_pending_members (object, &ret, NULL); g_assert (success); /* as of 0.7.8, cannot fail */ g_value_take_boxed (value, ret); } else if (name == q[MIXIN_DP_SELF_HANDLE]) { g_return_if_fail (G_VALUE_HOLDS_UINT (value)); g_value_set_uint (value, mixin->self_handle); } else if (name == q[MIXIN_DP_MEMBER_IDENTIFIERS]) { g_return_if_fail (G_VALUE_HOLDS (value, TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP)); g_value_take_boxed (value, dup_member_identifiers (object)); } else { g_return_if_reached (); } } static TpDBusPropertiesMixinPropImpl known_group_props[] = { { "GroupFlags", NULL, NULL }, { "HandleOwners", NULL, NULL }, { "LocalPendingMembers", NULL, NULL }, { "Members", NULL, NULL }, { "RemotePendingMembers", NULL, NULL }, { "SelfHandle", NULL, NULL }, { "MemberIdentifiers", NULL, NULL }, { NULL } }; /** * tp_group_mixin_init_dbus_properties: (skip) * @cls: The class of an object with this mixin * * Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of * the Group interface's properties. * * This uses tp_group_mixin_get_dbus_property() as the property getter and * sets up a list of the supported properties for it. Having called this, you * should add #TP_CHANNEL_GROUP_FLAG_PROPERTIES to any channels of this class * with tp_group_mixin_change_flags() to indicate that the DBus properties are * available. * * Since: 0.7.10 */ void tp_group_mixin_init_dbus_properties (GObjectClass *cls) { tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP, tp_group_mixin_get_dbus_property, NULL, known_group_props); } #define TP_EXTERNAL_GROUP_MIXIN_OBJ(o) \ ((GObject *) g_object_get_qdata (o, \ _external_group_mixin_get_obj_quark ())) static GQuark _external_group_mixin_get_obj_quark (void) { static GQuark quark = 0; if (!quark) quark = g_quark_from_static_string ("TpExternalGroupMixinQuark"); return quark; } /** * tp_external_group_mixin_init: (skip) * @obj: An object implementing the groups interface using an external group * mixin * @obj_with_mixin: A GObject with the group mixin * * Fill in the qdata needed to implement the group interface using * the group mixin of another object. This function should usually be called * in the instance constructor. * * Since: 0.5.13 */ void tp_external_group_mixin_init (GObject *obj, GObject *obj_with_mixin) { g_object_ref (obj_with_mixin); g_object_set_qdata (obj, _external_group_mixin_get_obj_quark (), obj_with_mixin); tp_group_mixin_add_external (obj_with_mixin, obj); } /** * tp_external_group_mixin_finalize: (skip) * @obj: An object implementing the groups interface using an external group * mixin * * Remove the external group mixin. This function should usually be called * in the dispose or finalize function. * * Since: 0.5.13 */ void tp_external_group_mixin_finalize (GObject *obj) { GObject *obj_with_mixin = g_object_steal_qdata (obj, _external_group_mixin_get_obj_quark ()); tp_group_mixin_remove_external (obj_with_mixin, obj); g_object_unref (obj_with_mixin); } /** * tp_external_group_mixin_init_dbus_properties: (skip) * @cls: The class of an object with this mixin * * Set up #TpDBusPropertiesMixinClass to use this mixin's implementation of * the Group interface's properties. * * This uses tp_group_mixin_get_dbus_property() as the property getter and * sets up a list of the supported properties for it. Having called this, you * should add #TP_CHANNEL_GROUP_FLAG_PROPERTIES to channels containing the * mixin used by this class with tp_group_mixin_change_flags() to indicate that * the DBus properties are available. * * Since: 0.7.10 */ void tp_external_group_mixin_init_dbus_properties (GObjectClass *cls) { tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP, tp_external_group_mixin_get_dbus_property, NULL, known_group_props); } /** * tp_external_group_mixin_get_dbus_property: (skip) * @object: An object with this mixin * @interface: Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP * @name: A quark representing the D-Bus property name, either * "GroupFlags", "HandleOwners", "LocalPendingMembers", "Members", * "RemotePendingMembers" or "SelfHandle" * @value: A GValue pre-initialized to the right type, into which to put the * value * @unused: Ignored * * An implementation of #TpDBusPropertiesMixinGetter which assumes that the * @object has the external group mixin. It can only be used for the Group * interface. * * Since: 0.7.10 */ void tp_external_group_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { GObject *group = TP_EXTERNAL_GROUP_MIXIN_OBJ (object); if (group != NULL) { tp_group_mixin_get_dbus_property (group, interface, name, value, NULL); } else if (G_VALUE_HOLDS_BOXED (value)) { /* for certain boxed types we need to supply an empty value */ if (G_VALUE_HOLDS (value, TP_HASH_TYPE_HANDLE_OWNER_MAP)) g_value_take_boxed (value, g_hash_table_new (NULL, NULL)); else if (G_VALUE_HOLDS (value, TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP)) g_value_take_boxed (value, g_hash_table_new (NULL, NULL)); else if (G_VALUE_HOLDS (value, DBUS_TYPE_G_UINT_ARRAY)) g_value_take_boxed (value, g_array_sized_new (FALSE, FALSE, sizeof (guint), 0)); else if (G_VALUE_HOLDS (value, TP_ARRAY_TYPE_LOCAL_PENDING_INFO_LIST)) g_value_take_boxed (value, g_ptr_array_sized_new (0)); } } #define EXTERNAL_OR_DIE(var) \ GObject *var = TP_EXTERNAL_GROUP_MIXIN_OBJ ((GObject *) obj); \ \ if (var == NULL) \ { \ GError na = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "I'm sure I " \ "had a group object around here somewhere?" };\ \ dbus_g_method_return_error (context, &na); \ return; \ } \ static void tp_external_group_mixin_add_members_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_add_members_async ((TpSvcChannelInterfaceGroup *) group, contacts, message, context); } static void tp_external_group_mixin_get_self_handle_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_self_handle_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_group_flags_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_group_flags_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_members_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_local_pending_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_local_pending_members_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_local_pending_members_with_info_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_local_pending_members_with_info_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_remote_pending_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_remote_pending_members_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_all_members_async (TpSvcChannelInterfaceGroup *obj, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_all_members_async ((TpSvcChannelInterfaceGroup *) group, context); } static void tp_external_group_mixin_get_handle_owners_async (TpSvcChannelInterfaceGroup *obj, const GArray *handles, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_get_handle_owners_async ((TpSvcChannelInterfaceGroup *) group, handles, context); } static void tp_external_group_mixin_remove_members_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_remove_members_with_reason_async ((TpSvcChannelInterfaceGroup *) group, contacts, message, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, context); } static void tp_external_group_mixin_remove_members_with_reason_async (TpSvcChannelInterfaceGroup *obj, const GArray *contacts, const gchar *message, guint reason, DBusGMethodInvocation *context) { EXTERNAL_OR_DIE (group) tp_group_mixin_remove_members_with_reason_async ((TpSvcChannelInterfaceGroup *) group, contacts, message, reason, context); } /** * tp_external_group_mixin_iface_init: (skip) * @g_iface: A #TpSvcChannelInterfaceGroupClass * @iface_data: Unused * * Fill in the vtable entries needed to implement the group interface using * the group mixin of another object. This function should usually be called * via G_IMPLEMENT_INTERFACE. * * Since: 0.5.13 */ void tp_external_group_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelInterfaceGroupClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_group_implement_##x (klass,\ tp_external_group_mixin_##x##_async) IMPLEMENT(add_members); IMPLEMENT(get_all_members); IMPLEMENT(get_group_flags); IMPLEMENT(get_handle_owners); IMPLEMENT(get_local_pending_members); IMPLEMENT(get_local_pending_members_with_info); IMPLEMENT(get_members); IMPLEMENT(get_remote_pending_members); IMPLEMENT(get_self_handle); IMPLEMENT(remove_members); IMPLEMENT(remove_members_with_reason); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/group-mixin.h0000644000175000017500000002324012652510705016777 00000000000000/* * group-mixin.h - Header for TpGroupMixin * Copyright (C) 2006-2007 Collabora Ltd. * Copyright (C) 2006-2007 Nokia Corporation * @author Ole Andre Vadla Ravnaas * @author Robert McQueen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_GROUP_MIXIN_H__ #define __TP_GROUP_MIXIN_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _TpGroupMixinClass TpGroupMixinClass; typedef struct _TpGroupMixinClassPrivate TpGroupMixinClassPrivate; typedef struct _TpGroupMixin TpGroupMixin; typedef struct _TpGroupMixinPrivate TpGroupMixinPrivate; /** * TpGroupMixinAddMemberFunc: * @obj: An object implementing the group interface with this mixin * @handle: The handle of the contact to be added * @message: A message to be sent if the protocol supports it * @error: Used to return a Telepathy D-Bus error if %FALSE is returned * * Signature of the callback used to add a member to the group. * This should perform the necessary operations in the underlying IM protocol * to cause the member to be added. * * Returns: %TRUE on success, %FALSE with @error set on error */ typedef gboolean (*TpGroupMixinAddMemberFunc) (GObject *obj, TpHandle handle, const gchar *message, GError **error); /** * TpGroupMixinRemMemberFunc: * @obj: An object implementing the group interface with this mixin * @handle: The handle of the contact to be removed * @message: A message to be sent if the protocol supports it * @error: Used to return a Telepathy D-Bus error if %FALSE is returned * * Signature of the callback used to remove a member from the group. * This should perform the necessary operations in the underlying IM protocol * to cause the member to be removed. * * Returns: %TRUE on success, %FALSE with @error set on error */ typedef gboolean (*TpGroupMixinRemMemberFunc) (GObject *obj, TpHandle handle, const gchar *message, GError **error); /** * TpGroupMixinRemMemberWithReasonFunc: * @obj: An object implementing the group interface with this mixin * @handle: The handle of the contact to be removed * @message: A message to be sent if the protocol supports it * @reason: A #TpChannelGroupChangeReason indicating the reason * @error: Used to return a Telepathy D-Bus error if %FALSE is returned * * Signature of the callback used to remove a member from the group. * This should perform the necessary operations in the underlying IM protocol * to cause the member to be removed. * * Set this with tp_group_mixin_class_set_remove_with_reason_func(), . * * Returns: %TRUE on success, %FALSE with @error set on error */ typedef gboolean (*TpGroupMixinRemMemberWithReasonFunc) (GObject *obj, TpHandle handle, const gchar *message, guint reason, GError **error); void tp_group_mixin_class_set_remove_with_reason_func (GObjectClass *cls, TpGroupMixinRemMemberWithReasonFunc func); /** * TpGroupMixin: * @handle_repo: The connection's contact handle repository * @self_handle: The local user's handle within this group, or 0 if none. * Set using tp_group_mixin_init() and tp_group_mixin_change_self_handle(). * @group_flags: This group's flags. Set using tp_group_mixin_change_flags(); * defaults to 0. * @members: The members of the group. Alter using * tp_group_mixin_change_members(). * @local_pending: Members awaiting the local user's approval to join the * group. Alter using tp_group_mixin_change_members(). * @remote_pending: Members awaiting remote (e.g. remote user or server) * approval to join the group. Alter using tp_group_mixin_change_members(). * @priv: Pointer to opaque private data * * Structure representing the group mixin as used in a particular class. * To be placed in the implementation's instance structure. * * All fields should be considered read-only. */ struct _TpGroupMixin { TpHandleRepoIface *handle_repo; TpHandle self_handle; TpChannelGroupFlags group_flags; TpHandleSet *members; TpHandleSet *local_pending; TpHandleSet *remote_pending; TpGroupMixinPrivate *priv; }; /** * TpGroupMixinClass: * @add_member: The add-member function that was passed to * tp_group_mixin_class_init() * @remove_member: The remove-member function that was passed to * tp_group_mixin_class_init() * @priv: Pointer to opaque private data * * Structure representing the group mixin as used in a particular class. * To be placed in the implementation's class structure. * * Initialize this with tp_group_mixin_class_init(). * * All fields should be considered read-only. */ struct _TpGroupMixinClass { TpGroupMixinAddMemberFunc add_member; TpGroupMixinRemMemberFunc remove_member; TpGroupMixinClassPrivate *priv; }; /* TYPE MACROS */ #define TP_GROUP_MIXIN_CLASS_OFFSET_QUARK \ (tp_group_mixin_class_get_offset_quark ()) #define TP_GROUP_MIXIN_CLASS_OFFSET(o) \ tp_mixin_class_get_offset (o, TP_GROUP_MIXIN_CLASS_OFFSET_QUARK) #define TP_GROUP_MIXIN_CLASS(o) \ ((TpGroupMixinClass *) tp_mixin_offset_cast (o, \ TP_GROUP_MIXIN_CLASS_OFFSET (o))) #define TP_HAS_GROUP_MIXIN_CLASS(cls) (TP_GROUP_MIXIN_CLASS_OFFSET (cls) != 0) #define TP_GROUP_MIXIN_OFFSET_QUARK (tp_group_mixin_get_offset_quark ()) #define TP_GROUP_MIXIN_OFFSET(o) \ tp_mixin_instance_get_offset (o, TP_GROUP_MIXIN_OFFSET_QUARK) #define TP_GROUP_MIXIN(o) ((TpGroupMixin *) tp_mixin_offset_cast (o, \ TP_GROUP_MIXIN_OFFSET(o))) #define TP_HAS_GROUP_MIXIN(o) (TP_GROUP_MIXIN_OFFSET (o) != 0) GQuark tp_group_mixin_class_get_offset_quark (void); GQuark tp_group_mixin_get_offset_quark (void); void tp_group_mixin_class_init (GObjectClass *obj_cls, glong offset, TpGroupMixinAddMemberFunc add_func, TpGroupMixinRemMemberFunc rem_func); void tp_group_mixin_class_allow_self_removal (GObjectClass *obj_cls); void tp_group_mixin_init (GObject *obj, glong offset, TpHandleRepoIface *handle_repo, TpHandle self_handle); void tp_group_mixin_finalize (GObject *obj); gboolean tp_group_mixin_get_self_handle (GObject *obj, guint *ret, GError **error); gboolean tp_group_mixin_get_group_flags (GObject *obj, guint *ret, GError **error); gboolean tp_group_mixin_add_members (GObject *obj, const GArray *contacts, const gchar *message, GError **error); gboolean tp_group_mixin_remove_members (GObject *obj, const GArray *contacts, const gchar *message, GError **error); gboolean tp_group_mixin_remove_members_with_reason (GObject *obj, const GArray *contacts, const gchar *message, guint reason, GError **error); gboolean tp_group_mixin_get_members (GObject *obj, GArray **ret, GError **error); gboolean tp_group_mixin_get_local_pending_members (GObject *obj, GArray **ret, GError **error); gboolean tp_group_mixin_get_local_pending_members_with_info (GObject *obj, GPtrArray **ret, GError **error); gboolean tp_group_mixin_get_remote_pending_members (GObject *obj, GArray **ret, GError **error); gboolean tp_group_mixin_get_all_members (GObject *obj, GArray **members, GArray **local_pending, GArray **remote_pending, GError **error); gboolean tp_group_mixin_get_handle_owners (GObject *obj, const GArray *handles, GArray **ret, GError **error); void tp_group_mixin_change_flags (GObject *obj, TpChannelGroupFlags add, TpChannelGroupFlags del); gboolean tp_group_mixin_change_members (GObject *obj, const gchar *message, const TpIntset *add, const TpIntset *del, const TpIntset *add_local_pending, const TpIntset *add_remote_pending, TpHandle actor, TpChannelGroupChangeReason reason); gboolean tp_group_mixin_change_members_detailed (GObject *obj, const TpIntset *add, const TpIntset *del, const TpIntset *add_local_pending, const TpIntset *add_remote_pending, const GHashTable *details); void tp_group_mixin_change_self_handle (GObject *obj, TpHandle new_self_handle); void tp_group_mixin_add_handle_owner (GObject *obj, TpHandle local_handle, TpHandle owner_handle); void tp_group_mixin_add_handle_owners (GObject *obj, GHashTable *local_to_owner_handle); void tp_group_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused); void tp_group_mixin_init_dbus_properties (GObjectClass *cls); void tp_group_mixin_iface_init (gpointer g_iface, gpointer iface_data); void tp_external_group_mixin_init (GObject *obj, GObject *obj_with_mixin); void tp_external_group_mixin_finalize (GObject *obj); void tp_external_group_mixin_iface_init (gpointer g_iface, gpointer iface_data); void tp_external_group_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused); void tp_external_group_mixin_init_dbus_properties (GObjectClass *cls); G_END_DECLS #endif /* #ifndef __TP_GROUP_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/telepathy-glib-uninstalled.pc.in0000644000175000017500000000066112652510705022535 00000000000000prefix= exec_prefix= abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ Name: Telepathy-GLib (uninstalled copy) Description: GLib utility library for the Telepathy framework Version: @VERSION@ Requires.private: dbus-1 >= 0.95, dbus-glib-1 >= 0.90, glib-2.0 >= 2.30, gobject-2.0 >= 2.30, gio-2.0 >= 2.30 Libs: ${abs_top_builddir}/telepathy-glib/libtelepathy-glib.la Cflags: -I${abs_top_srcdir} -I${abs_top_builddir} telepathy-glib-0.24.2/telepathy-glib/svc-call.h0000644000175000017500000000077012652510705016230 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_ACCOUNT_H__ #define __TP_META_SVC_ACCOUNT_H__ #include #include #include #include #endif telepathy-glib-0.24.2/telepathy-glib/channel-internal.h0000644000175000017500000001271012652510705017743 00000000000000/**/ /* * TpChannel - proxy for a Telepathy channel (internals) * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_CHANNEL_INTERNAL_H #define TP_CHANNEL_INTERNAL_H #include G_BEGIN_DECLS typedef void (*TpChannelProc) (TpChannel *self); typedef struct { TpContact *actor_contact; TpHandle actor; TpChannelGroupChangeReason reason; gchar *message; } LocalPendingInfo; typedef struct _ContactsQueueItem ContactsQueueItem; struct _TpChannelPrivate { gulong conn_invalidated_id; TpConnection *connection; /* GQueue of TpChannelProc */ GQueue *introspect_needed; GQuark channel_type; TpHandleType handle_type; TpHandle handle; gchar *identifier; /* owned string (iface + "." + prop) => slice-allocated GValue */ GHashTable *channel_properties; /* Set until introspection discovers which to use; both NULL after one has * been disconnected. */ TpProxySignalConnection *members_changed_sig; TpProxySignalConnection *members_changed_detailed_sig; TpProxySignalConnection *self_handle_changed_sig; TpProxySignalConnection *self_contact_changed_sig; TpProxySignalConnection *handle_owners_changed_sig; TpProxySignalConnection *handle_owners_changed_detailed_sig; TpHandle group_self_handle; TpChannelGroupFlags group_flags; /* NULL if members not discovered yet */ TpIntset *group_members; TpIntset *group_local_pending; TpIntset *group_remote_pending; /* (TpHandle => LocalPendingInfo), or NULL if members not discovered yet */ GHashTable *group_local_pending_info; /* reason the self-handle left */ GError *group_remove_error /* implicitly zero-initialized */ ; /* guint => guint, NULL if not discovered yet */ GHashTable *group_handle_owners; /* reffed TpContact */ TpContact *target_contact; TpContact *initiator_contact; TpContact *group_self_contact; /* TpHandle -> reffed TpContact */ GHashTable *group_members_contacts; GHashTable *group_local_pending_contacts; GHashTable *group_remote_pending_contacts; /* the TpContact can be NULL if the owner is unknown */ GHashTable *group_contact_owners; gboolean cm_too_old_for_contacts; /* Queue of GSimpleAsyncResult with ContactsQueueItem payload */ GQueue *contacts_queue; /* Item currently being prepared, not part of contacts_queue anymore */ GSimpleAsyncResult *current_contacts_queue_result; /* NULL, or TpHandle => TpChannelChatState; * if non-NULL, we're watching for ChatStateChanged */ GHashTable *chat_states; /* These are really booleans, but gboolean is signed. Thanks, GLib */ /* channel-ready */ unsigned ready:1; /* Enough method calls have succeeded that we believe that the channel * exists (implied by ready) */ unsigned exists:1; /* GetGroupFlags has returned */ unsigned have_group_flags:1; TpChannelPasswordFlags password_flags; }; /* channel.c internals */ void _tp_channel_continue_introspection (TpChannel *self); void _tp_channel_abort_introspection (TpChannel *self, const gchar *debug, const GError *error); GHashTable *_tp_channel_get_immutable_properties (TpChannel *self); /* channel-group.c internals */ void _tp_channel_get_group_properties (TpChannel *self); /* channel-contacts.c internals */ void _tp_channel_contacts_init (TpChannel *self); void _tp_channel_contacts_group_init (TpChannel *self, GHashTable *identifiers); void _tp_channel_contacts_members_changed (TpChannel *self, const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, guint actor, GHashTable *details); void _tp_channel_contacts_handle_owners_changed (TpChannel *self, GHashTable *added, const GArray *removed, GHashTable *identifiers); void _tp_channel_contacts_self_contact_changed (TpChannel *self, guint self_handle, const gchar *identifier); void _tp_channel_contacts_prepare_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); void _tp_channel_contacts_queue_prepare_async (TpChannel *self, GPtrArray *contacts, GAsyncReadyCallback callback, gpointer user_data); void _tp_channel_contacts_queue_prepare_by_id_async (TpChannel *self, GPtrArray *ids, GAsyncReadyCallback callback, gpointer user_data); void _tp_channel_contacts_queue_prepare_by_handle_async (TpChannel *self, GArray *handles, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_channel_contacts_queue_prepare_finish (TpChannel *self, GAsyncResult *result, GPtrArray **contacts, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/file-transfer-channel.c0000644000175000017500000014214712652510705020673 00000000000000/* * file-transfer-channel.h - high level API for Chan.I.FileTransfer * * Copyright (C) 2010-2011 Morten Mjelva * Copyright (C) 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:file-transfer-channel * @title: TpFileTransferChannel * @short_description: proxy object for a file transfer channel * * #TpFileTransferChannel is a sub-class of #TpChannel providing convenient * API to send and receive files. * * The channel properties are available in * #TpFileTransferChannel:date, #TpFileTransferChannel:description, * #TpFileTransferChannel:filename, * #TpFileTransferChannel:initial-offset, * #TpFileTransferChannel:mime-type, #TpFileTransferChannel:size, * #TpFileTransferChannel:state, and * #TpFileTransferChannel:transferred-bytes GObject properties, with * accessor functions too. * * To send a file to a contact, one should create a File Transfer * channel with the appropriate D-Bus properties set by specifying * their values in the channel creation method call. The file transfer * invitation will be sent to the remote contact when the channel is * created. For example: * * |[ * GHashTable *request = tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "foo@bar.com", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, "text/plain", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, G_TYPE_INT64, 1320925992, * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, G_TYPE_STRING, "", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, "test.pdf", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, G_TYPE_UINT64, 0, * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, 165710, * NULL); * * TpAccountChannelRequest *channel_request = tp_account_channel_request_new ( * account, request, * TP_USER_ACTION_TIME_CURRENT_TIME); * * tp_account_channel_request_create_and_handle_channel_async (channel_request, NULL, * create_and_handle_cb, NULL); * * g_hash_table_unref (request); * ]| * * Once a #TpFileTransferChannel is created as a proxy to the channel * on D-Bus. The "notify::state" GObject signals on the resulting * channel should be monitored; when the channel moves to state * %TP_FILE_TRANSFER_STATE_ACCEPTED, * tp_file_transfer_channel_provide_file_async() should be called. * * When an incoming File Transfer channel appears, one should call * tp_file_transfer_channel_accept_file_async(). * * To cancel or reject a pending or ongoing file transfer, one should * close the channel using tp_channel_close_async(). */ /** * TpFileTransferChannel: * * Data structure representing a #TpFileTransferChannel. * * Since: 0.15.5 */ /** * TpFileTransferChannelClass: * * The class of a #TpFileTransferChannel. * * Since: 0.15.5 */ #include "config.h" #include "telepathy-glib/file-transfer-channel.h" #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/automatic-client-factory-internal.h" #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/debug-internal.h" #include #include #include #ifdef HAVE_GIO_UNIX #include #include #endif /* HAVE_GIO_UNIX */ G_DEFINE_TYPE (TpFileTransferChannel, tp_file_transfer_channel, TP_TYPE_CHANNEL) struct _TpFileTransferChannelPrivate { /* Exposed properties */ const gchar *mime_type; GDateTime *date; const gchar *description; const gchar *filename; guint64 size; guint64 transferred_bytes; TpFileTransferState state; TpFileTransferStateChangeReason state_reason; GFile *file; /* Hidden properties */ /* borrowed from the immutable properties GHashTable */ GHashTable *available_socket_types; const gchar *content_hash; TpFileHashType content_hash_type; goffset initial_offset; /* Metadata */ const gchar *service_name; GHashTable *metadata; /* const gchar* => const gchar* const* */ /* Streams and sockets for sending and receiving the actual file */ GSocket *client_socket; GIOStream *stream; GInputStream *in_stream; GOutputStream *out_stream; GSocketAddress *remote_address; /* The value passed to Accept; this shouldn't be stored in * initial_offset as they can easily be different. */ guint requested_offset; TpSocketAddressType socket_type; TpSocketAccessControl access_control; GValue *access_control_param; GSimpleAsyncResult *result; GCancellable *cancellable; }; enum /* properties */ { PROP_MIME_TYPE = 1, PROP_DATE, PROP_DESCRIPTION, PROP_FILENAME, PROP_SIZE, PROP_STATE, PROP_TRANSFERRED_BYTES, PROP_FILE, PROP_INITIAL_OFFSET, PROP_SERVICE_NAME, PROP_METADATA, N_PROPS }; static void operation_failed (TpFileTransferChannel *self, GError *error) { g_assert (self->priv->result != NULL); g_simple_async_result_take_error (self->priv->result, error); g_simple_async_result_complete_in_idle (self->priv->result); tp_clear_object (&self->priv->result); } static void stream_close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GIOStream *stream = G_IO_STREAM (source); TpFileTransferChannel *self = user_data; GError *error = NULL; if (!g_io_stream_close_finish (stream, result, &error)) { DEBUG ("Failed to close stream: %s\n", error->message); g_clear_error (&error); } /* Now that this is closed in both ways, let's just remove it. */ g_clear_object (&self->priv->stream); g_object_unref (self); } static void splice_stream_ready_cb (GObject *output, GAsyncResult *result, gpointer user_data) { TpFileTransferChannel *self = user_data; GError *error = NULL; g_output_stream_splice_finish (G_OUTPUT_STREAM (output), result, &error); if (error != NULL && !g_cancellable_is_cancelled (self->priv->cancellable)) DEBUG ("splice operation failed: %s", error->message); g_clear_error (&error); g_io_stream_close_async (self->priv->stream, G_PRIORITY_DEFAULT, NULL, stream_close_cb, g_object_ref (self)); g_object_unref (self); } static void client_socket_connected (TpFileTransferChannel *self) { GSocketConnection *conn; GError *error = NULL; conn = g_socket_connection_factory_create_connection ( self->priv->client_socket); if (conn == NULL) { DEBUG ("Failed to create client connection"); return; } DEBUG ("File transfer socket connected"); #ifdef HAVE_GIO_UNIX if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { guchar byte; byte = g_value_get_uchar (self->priv->access_control_param); /* FIXME: we should an async version of this API (bgo #629503) */ if (!tp_unix_connection_send_credentials_with_byte ( conn, byte, NULL, &error)) { DEBUG ("Failed to send credentials: %s", error->message); g_object_unref (conn); g_clear_error (&error); return; } } #endif self->priv->stream = G_IO_STREAM (conn); if (tp_channel_get_requested (TP_CHANNEL (self))) { GOutputStream *stream; stream = g_io_stream_get_output_stream (G_IO_STREAM (conn)); g_output_stream_splice_async (stream, self->priv->in_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, G_PRIORITY_DEFAULT, self->priv->cancellable, splice_stream_ready_cb, g_object_ref (self)); } else { GInputStream *stream; stream = g_io_stream_get_input_stream (G_IO_STREAM (conn)); g_output_stream_splice_async (self->priv->out_stream, stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, G_PRIORITY_DEFAULT, self->priv->cancellable, splice_stream_ready_cb, g_object_ref (self)); } } static gboolean client_socket_cb (GSocket *socket, GIOCondition condition, TpFileTransferChannel *self) { GError *error = NULL; if (!g_socket_check_connect_result (socket, &error)) { DEBUG ("Failed to connect to socket: %s", error->message); g_clear_error (&error); return FALSE; } DEBUG ("Client socket connected after pending"); client_socket_connected (self); return FALSE; } /* Callbacks */ static void start_transfer (TpFileTransferChannel *self); static void tp_file_transfer_channel_state_changed_cb (TpChannel *proxy, guint state, guint reason, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; if (state == self->priv->state) return; DEBUG ("File transfer state changed: " "old state = %u, state = %u, reason = %u, " "requested = %s, in_stream = %s, out_stream = %s", self->priv->state, state, reason, tp_channel_get_requested (proxy) ? "yes" : "no", self->priv->in_stream ? "present" : "not present", self->priv->out_stream ? "present" : "not present"); self->priv->state = state; self->priv->state_reason = reason; /* If the channel is open AND we have the socket path, we can start the * transfer. The socket path could be NULL if we are not doing the actual * data transfer but are just an observer for the channel. */ if (state == TP_FILE_TRANSFER_STATE_OPEN && self->priv->remote_address != NULL) { start_transfer (self); } g_object_notify (G_OBJECT (self), "state"); } static void tp_file_transfer_channel_initial_offset_defined_cb (TpChannel *proxy, guint64 initial_offset, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; self->priv->initial_offset = initial_offset; g_object_notify (G_OBJECT (self), "initial-offset"); } static void tp_file_transfer_channel_transferred_bytes_changed_cb (TpChannel *proxy, guint64 count, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; self->priv->transferred_bytes = count; g_object_notify (G_OBJECT (self), "transferred-bytes"); } static void tp_file_transfer_channel_uri_defined_cb (TpChannel *proxy, const gchar *uri, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; g_clear_object (&self->priv->file); self->priv->file = g_file_new_for_uri (uri); g_object_notify (G_OBJECT (self), "file"); } static void tp_file_transfer_channel_prepare_core_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; GSimpleAsyncResult *result = user_data; gboolean valid; const gchar *uri; if (error != NULL) { g_simple_async_result_set_from_error (result, error); goto out; } self->priv->state = tp_asv_get_uint32 (properties, "State", &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.State property", tp_proxy_get_object_path (self)); } self->priv->transferred_bytes = tp_asv_get_uint64 (properties, "TransferredBytes", &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.TransferredBytes property", tp_proxy_get_object_path (self)); } self->priv->initial_offset = tp_asv_get_uint64 (properties, "InitialOffset", &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.InitialOffset property", tp_proxy_get_object_path (self)); } /* URI might already be set from immutable properties */ uri = tp_asv_get_string (properties, "URI"); if (self->priv->file == NULL && uri != NULL) self->priv->file = g_file_new_for_uri (uri); out: g_simple_async_result_complete_in_idle (result); } static void invalidated_cb (TpFileTransferChannel *self, guint domain, gint code, gchar *message, gpointer user_data) { /* stop splicing */ if (self->priv->cancellable != NULL) g_cancellable_cancel (self->priv->cancellable); } /* Private methods */ static void tp_file_transfer_channel_prepare_core_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpFileTransferChannel *self = (TpFileTransferChannel *) proxy; TpChannel *channel = (TpChannel *) proxy; GSimpleAsyncResult *result; GError *error = NULL; tp_cli_channel_type_file_transfer_connect_to_file_transfer_state_changed ( channel, tp_file_transfer_channel_state_changed_cb, NULL, NULL, NULL, &error); if (error != NULL) { WARNING ("Failed to connect to StateChanged on %s: %s", tp_proxy_get_object_path (self), error->message); g_error_free (error); } tp_cli_channel_type_file_transfer_connect_to_initial_offset_defined ( channel, tp_file_transfer_channel_initial_offset_defined_cb, NULL, NULL, NULL, &error); if (error != NULL) { WARNING ("Failed to connect to InitialOffsetDefined on %s: %s", tp_proxy_get_object_path (self), error->message); g_error_free (error); } tp_cli_channel_type_file_transfer_connect_to_transferred_bytes_changed ( channel, tp_file_transfer_channel_transferred_bytes_changed_cb, NULL, NULL, NULL, &error); if (error != NULL) { WARNING ("Failed to connect to TransferredBytesChanged on %s: %s", tp_proxy_get_object_path (self), error->message); g_error_free (error); } tp_cli_channel_type_file_transfer_connect_to_uri_defined ( channel, tp_file_transfer_channel_uri_defined_cb, NULL, NULL, NULL, &error); if (error != NULL) { WARNING ("Failed to connect to UriDefined on %s: %s", tp_proxy_get_object_path (self), error->message); g_error_free (error); } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_file_transfer_channel_prepare_core_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, tp_file_transfer_channel_prepare_core_cb, result, g_object_unref, NULL); } static void tp_file_transfer_channel_constructed (GObject *obj) { TpFileTransferChannel *self = (TpFileTransferChannel *) obj; GHashTable *properties; gboolean valid; gint64 date; const gchar *uri; G_OBJECT_CLASS (tp_file_transfer_channel_parent_class)->constructed (obj); properties = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); self->priv->mime_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE); if (self->priv->mime_type == NULL) { DEBUG ("Channel %s doesn't have FileTransfer.ContentType in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->filename = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME); if (self->priv->filename == NULL) { DEBUG ("Channel %s doesn't have FileTransfer.Filename in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->size = tp_asv_get_uint64 (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.Size in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->content_hash_type = tp_asv_get_uint32 (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE, &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.ContentHashType in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->content_hash = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH); if (self->priv->content_hash == NULL) { DEBUG ("Channel %s doesn't have FileTransfer.ContentHash in its " "immutable properties", tp_proxy_get_object_path (self)); } self->priv->description = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION); if (self->priv->description == NULL) { DEBUG ("Channel %s doesn't have FileTransfer.Description in its " "immutable properties", tp_proxy_get_object_path (self)); } date = tp_asv_get_int64 (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, &valid); if (!valid) { DEBUG ("Channel %s doesn't have FileTransfer.Date in its " "immutable properties", tp_proxy_get_object_path (self)); } else { self->priv->date = g_date_time_new_from_unix_utc (date); } self->priv->available_socket_types = tp_asv_get_boxed (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_AVAILABLE_SOCKET_TYPES, TP_HASH_TYPE_SUPPORTED_SOCKET_MAP); if (self->priv->available_socket_types == NULL) { DEBUG ("Channel %s doesn't have FileTransfer.AvailableSocketTypes in its " "immutable properties", tp_proxy_get_object_path (self)); } /* URI might be immutable */ uri = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI); if (uri != NULL) self->priv->file = g_file_new_for_uri (uri); self->priv->service_name = tp_asv_get_string (properties, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME); self->priv->metadata = tp_asv_get_boxed (properties, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA, TP_HASH_TYPE_METADATA); if (self->priv->metadata == NULL) self->priv->metadata = g_hash_table_new (g_str_hash, g_str_equal); else g_hash_table_ref (self->priv->metadata); self->priv->cancellable = g_cancellable_new (); g_signal_connect (self, "invalidated", G_CALLBACK (invalidated_cb), NULL); } static void tp_file_transfer_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpFileTransferChannel *self = (TpFileTransferChannel *) object; switch (property_id) { case PROP_MIME_TYPE: g_value_set_string (value, self->priv->mime_type); break; case PROP_DATE: g_value_set_boxed (value, self->priv->date); break; case PROP_DESCRIPTION: g_value_set_string (value, self->priv->description); break; case PROP_FILENAME: g_value_set_string (value, self->priv->filename); break; case PROP_SIZE: g_value_set_uint64 (value, self->priv->size); break; case PROP_STATE: g_value_set_uint (value, self->priv->state); break; case PROP_TRANSFERRED_BYTES: g_value_set_uint64 (value, self->priv->transferred_bytes); break; case PROP_FILE: g_value_set_object (value, self->priv->file); break; case PROP_INITIAL_OFFSET: g_value_set_uint64 (value, self->priv->initial_offset); break; case PROP_SERVICE_NAME: g_value_set_string (value, self->priv->service_name); break; case PROP_METADATA: g_value_set_boxed (value, self->priv->metadata); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } enum /* features */ { FEAT_CORE, N_FEAT }; static const TpProxyFeature * tp_file_transfer_channel_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE; features[FEAT_CORE].core = TRUE; features[FEAT_CORE].prepare_async = tp_file_transfer_channel_prepare_core_async; /* Assert that the terminator at the end is present */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_file_transfer_channel_dispose (GObject *obj) { TpFileTransferChannel *self = (TpFileTransferChannel *) obj; tp_clear_pointer (&self->priv->date, g_date_time_unref); g_clear_object (&self->priv->file); tp_clear_pointer (&self->priv->metadata, g_hash_table_unref); g_clear_object (&self->priv->stream); if (self->priv->cancellable != NULL) g_cancellable_cancel (self->priv->cancellable); g_clear_object (&self->priv->cancellable); if (self->priv->remote_address != NULL) { #ifdef HAVE_GIO_UNIX /* Check if we need to remove our temp file */ if (G_IS_UNIX_SOCKET_ADDRESS (self->priv->remote_address)) { const gchar *path; path = g_unix_socket_address_get_path ( G_UNIX_SOCKET_ADDRESS (self->priv->remote_address)); g_unlink (path); } #endif /* HAVE_GIO_UNIX */ g_object_unref (self->priv->remote_address); self->priv->remote_address = NULL; } tp_clear_pointer (&self->priv->access_control_param, tp_g_value_slice_free); tp_clear_object (&self->priv->client_socket); G_OBJECT_CLASS (tp_file_transfer_channel_parent_class)->dispose (obj); } static void tp_file_transfer_channel_class_init (TpFileTransferChannelClass *klass) { GParamSpec *param_spec; TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = tp_file_transfer_channel_constructed; object_class->get_property = tp_file_transfer_channel_get_property; object_class->dispose = tp_file_transfer_channel_dispose; proxy_class->list_features = tp_file_transfer_channel_list_features; /* Properties */ /** * TpFileTransferChannel:mime-type: * * The MIME type of the file to be transferred. * * Since: 0.15.5 */ param_spec = g_param_spec_string ("mime-type", "ContentType", "The ContentType property of this channel", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MIME_TYPE, param_spec); /** * TpFileTransferChannel:date: * * A #GDateTime representing the last modification time of the file to be * transferred. * * Since 0.15.5 */ param_spec = g_param_spec_boxed ("date", "Date", "The Date property of this channel", G_TYPE_DATE_TIME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DATE, param_spec); /** * TpFileTransferChannel:description: * * The description of the file transfer, defined by the sender when * sending the file transfer offer. * * Since 0.15.5 */ param_spec = g_param_spec_string ("description", "Description", "The Description property of this channel", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESCRIPTION, param_spec); /** * TpFileTransferChannel:file: * * For incoming file transfers, this property will be set to a * #GFile for the location where the file will be saved (given by * tp_file_transfer_channel_accept_file_async()) when the transfer * starts. The feature %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE must * already be prepared for this property to have a meaningful * value, and to receive change notification. Once the initial * value is set, this property will not be changed. * * For outgoing file transfers, this property is a #GFile for the * location of the file being sent (given by * tp_file_transfer_channel_provide_file_async()). The feature * %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE does not have to be * prepared and there is no change notification. * * Since: 0.17.1 */ param_spec = g_param_spec_object ("file", "File", "A GFile corresponding to the URI property of this channel", G_TYPE_FILE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FILE, param_spec); /** * TpFileTransferChannel:filename: * * The name of the file on the sender's side. This is therefore given as a * suggested filename for the receiver. * * Since 0.15.5 */ param_spec = g_param_spec_string ("filename", "Filename", "The Filename property of this channel", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FILENAME, param_spec); /** * TpFileTransferChannel:size: * * The size of the file to be transferred, * or %G_MAXUINT64 if not known. * * Since 0.15.5 */ param_spec = g_param_spec_uint64 ("size", "Size", "The Size property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIZE, param_spec); /** * TpFileTransferChannel:state: * * A TpFileTransferState holding the state of the file transfer. * * The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be * prepared for this property to be meaningful and kept up to date. * * Since 0.17.1 */ param_spec = g_param_spec_uint ("state", "State", "The TpFileTransferState of the channel", 0, TP_NUM_FILE_TRANSFER_STATES, TP_FILE_TRANSFER_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATE, param_spec); /** * TpFileTransferChannel:transferred-bytes: * * The number of bytes transferred so far in this * file transfer. * * The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be * prepared for this property to be meaningful and kept up to date. * * Since: 0.15.5 */ param_spec = g_param_spec_uint64 ("transferred-bytes", "TransferredBytes", "The TransferredBytes property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TRANSFERRED_BYTES, param_spec); /** * TpFileTransferChannel:initial-offset: * * The offset in bytes from where the file should be sent. * * The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be * prepared for this property to be meaningful and kept up to date. * * Since: 0.17.1 */ param_spec = g_param_spec_uint64 ("initial-offset", "InitialOffset", "The InitialOffset property of this channel", 0, G_MAXUINT64, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INITIAL_OFFSET, param_spec); /** * TpFileTransferChannel:service-name: * * A string representing the name of the service suggested to handle * this file transfer channel, or %NULL if the initiator did not * provide one. * * This is a useful way of requesting file transfer channels with a * hint of what handler they should be handled by on the remote * side. If a channel request is made with this property set (to a * contact who also supports the metadata extension; see the * requestable channel classes for said contact), this property will * be set to the same value on the remote incoming channel and * handlers can match on this in their handler filter. For example, * a remote handler could call the following: * * |[ * tp_base_client_take_handler_filter (handler, tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, * TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_SERVICE_NAME, G_TYPE_STRING, "service.name", * NULL)); * ]| * * The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be * prepared for this property to be meaningful. * * Since: 0.17.1 */ param_spec = g_param_spec_string ("service-name", "ServiceName", "The Metadata.ServiceName property of this channel", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SERVICE_NAME, param_spec); /** * TpFileTransferChannel:metadata: * * Additional information about the file transfer set by the channel * initiator, or an empty #GHashTable if the initiator did not * provide any additional information. * * To provide metadata along with a file offer, include * %TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA in the * channel request. For example: * * |[ * GHashTable *request; * GHashTable *metadata = g_hash_table_new (g_str_hash, g_str_equal); * const gchar * const values[] = { "Jason Derulo", "Tinie Tempah", NULL }; * * g_hash_table_insert (metadata, "best buds", values); * * request = tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, "foo@bar.com", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, "text/plain", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE, G_TYPE_INT64, 1320925992, * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION, G_TYPE_STRING, "", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, "test.pdf", * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET, G_TYPE_UINT64, 0, * TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, 165710, * TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA, TP_TYPE_METADATA, metadata, * NULL); * * ... * ]| * * The %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE feature has to be * prepared for this property to be meaningful. * * Since: 0.17.1 */ param_spec = g_param_spec_boxed ("metadata", "Metadata", "The Metadata.Metadata property of this channel", TP_HASH_TYPE_METADATA, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_METADATA, param_spec); g_type_class_add_private (object_class, sizeof (TpFileTransferChannelPrivate)); } static void tp_file_transfer_channel_init (TpFileTransferChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_FILE_TRANSFER_CHANNEL, TpFileTransferChannelPrivate); } /** * TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" * feature on a #TpFileTransferChannel. * * When this feature is prepared, the #TpFileTransferChannel:transferred-bytes * property has been retrieved and will be updated. * * One can ask for a feature to be prepared using the tp_proxy_prepare_async() * function, and waiting for it to trigger the callback. * * Since: 0.15.5 */ GQuark tp_file_transfer_channel_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-file-transfer-channel-feature-core"); } /* Public methods */ /** * tp_file_transfer_channel_new: * @conn: a #TpConnection; may not be %NULL * @object_path: the object path of the channel; may not be %NULL * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel, * as signalled by the NewChannel D-Bus signal or returned by the * CreateChannel and EnsureChannel D-Bus methods: a mapping from * strings (D-Bus interface name + "." + property name) to #GValue instances * @error: used to indicate the error if %NULL is returned * * Convenient function to create a new #TpFileTransferChannel * * Returns: (transfer full): a newly created #TpFileTransferChannel * * Since: 0.15.5 * Deprecated: Use tp_simple_client_factory_ensure_channel() instead. */ TpFileTransferChannel * tp_file_transfer_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { return _tp_file_transfer_channel_new_with_factory (NULL, conn, object_path, immutable_properties, error); } TpFileTransferChannel * _tp_file_transfer_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; return g_object_new (TP_TYPE_FILE_TRANSFER_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL); } static void start_transfer (TpFileTransferChannel *self) { GError *error = NULL; g_socket_set_blocking (self->priv->client_socket, FALSE); /* g_socket_connect returns true on successful connection */ if (g_socket_connect (self->priv->client_socket, self->priv->remote_address, NULL, &error)) { DEBUG ("Client socket connected immediately"); client_socket_connected (self); } else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PENDING)) { /* The connection is pending */ GSource *source; source = g_socket_create_source (self->priv->client_socket, G_IO_OUT, NULL); g_source_attach (source, g_main_context_get_thread_default ()); g_source_set_callback (source, (GSourceFunc) client_socket_cb, g_object_ref (self), g_object_unref); g_error_free (error); g_source_unref (source); } else { DEBUG ("Failed to connect to socket: %s:", error->message); g_clear_error (&error); } } static void accept_or_provide_file_cb (TpChannel *proxy, const GValue *address, const GError *dbus_error, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = TP_FILE_TRANSFER_CHANNEL (weak_object); GError *error = NULL; if (dbus_error != NULL) { DEBUG ("Error: %s", dbus_error->message); operation_failed (self, g_error_copy (dbus_error)); return; } self->priv->remote_address = tp_g_socket_address_from_variant (self->priv->socket_type, address, &error); if (self->priv->remote_address == NULL) { DEBUG ("Failed to convert address: %s", error->message); operation_failed (self, error); return; } /* If the channel state is already Open, start the transfer * now. Otherwise, wait for the state change signal. */ if (tp_file_transfer_channel_get_state (self, NULL) == TP_FILE_TRANSFER_STATE_OPEN) { start_transfer (self); } g_simple_async_result_complete_in_idle (self->priv->result); g_clear_object (&self->priv->result); } static gboolean set_address_and_access_control (TpFileTransferChannel *self) { GError *error = NULL; if (!_tp_set_socket_address_type_and_access_control_type ( self->priv->available_socket_types, &self->priv->socket_type, &self->priv->access_control, &error)) { operation_failed (self, error); return FALSE; } DEBUG ("Using socket type %u with access control %u", self->priv->socket_type, self->priv->access_control); self->priv->client_socket = _tp_create_client_socket (self->priv->socket_type, &error); if (self->priv->client_socket == NULL) { DEBUG ("Failed to create socket: %s", error->message); operation_failed (self, error); return FALSE; } switch (self->priv->access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: /* Dummy value */ self->priv->access_control_param = tp_g_value_slice_new_uint (0); break; case TP_SOCKET_ACCESS_CONTROL_PORT: { GSocketAddress *addr; addr = g_socket_get_local_address (self->priv->client_socket, &error); if (addr == NULL) { DEBUG ("Failed to get address of local socket: %s", error->message); operation_failed (self, error); return FALSE; } self->priv->access_control_param = tp_address_variant_from_g_socket_address (addr, NULL, NULL); g_object_unref (addr); } break; default: g_assert_not_reached (); } return TRUE; } static void file_transfer_set_uri_cb (TpProxy *proxy, const GError *uri_error, gpointer user_data, GObject *weak_object) { TpFileTransferChannel *self = TP_FILE_TRANSFER_CHANNEL (weak_object); if (uri_error != NULL) { DEBUG ("Failed to set FileTransfer.URI: %s", uri_error->message); /* oh well */ } if (!set_address_and_access_control (self)) return; /* Call accept */ tp_cli_channel_type_file_transfer_call_accept_file (TP_CHANNEL (self), -1, self->priv->socket_type, self->priv->access_control, self->priv->access_control_param, self->priv->requested_offset, accept_or_provide_file_cb, NULL, NULL, G_OBJECT (self)); } static void file_replace_async_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpFileTransferChannel *self = user_data; GFile *file = G_FILE (source); GFileOutputStream *out_stream; gchar *uri; GError *error = NULL; GValue *value; out_stream = g_file_replace_finish (file, result, &error); if (error != NULL) { DEBUG ("Failed to replace file: %s", error->message); operation_failed (self, error); return; } self->priv->out_stream = G_OUTPUT_STREAM (out_stream); g_clear_object (&self->priv->file); self->priv->file = g_object_ref (file); /* Try setting FileTransfer.URI before accepting the file */ uri = g_file_get_uri (file); value = tp_g_value_slice_new_take_string (uri); tp_cli_dbus_properties_call_set (self, -1, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "URI", value, file_transfer_set_uri_cb, NULL, NULL, G_OBJECT (self)); tp_g_value_slice_free (value); } /** * tp_file_transfer_channel_accept_file_async: * @self: a #TpFileTransferChannel * @file: a #GFile where the file should be saved * @offset: Offset from the start of @file where transfer begins * @callback: a callback to call when the transfer has been accepted * @user_data: data to pass to @callback * * Accept an incoming file transfer in the * %TP_FILE_TRANSFER_STATE_PENDING state. Once the accept has been * processed, @callback will be called. You can then call * tp_file_transfer_channel_accept_file_finish() to get the result of * the operation. * * Since: 0.17.1 */ void tp_file_transfer_channel_accept_file_async (TpFileTransferChannel *self, GFile *file, guint64 offset, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self)); g_return_if_fail (G_IS_FILE (file)); if (self->priv->access_control_param != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't accept already accepted transfer"); return; } if (self->priv->state != TP_FILE_TRANSFER_STATE_PENDING) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't accept a transfer that isn't pending"); return; } if (tp_channel_get_requested (TP_CHANNEL (self))) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't accept outgoing transfer"); return; } self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_file_transfer_channel_accept_file_async); self->priv->requested_offset = offset; g_file_replace_async (file, NULL, FALSE, G_FILE_CREATE_NONE, G_PRIORITY_DEFAULT, NULL, file_replace_async_cb, self); } /** * tp_file_transfer_channel_accept_file_finish: * @self: a #TpFileTransferChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes a call to tp_file_transfer_channel_accept_file_async(). * * Returns: %TRUE if the accept operation was a success, or %FALSE * * Since: 0.17.1 */ gboolean tp_file_transfer_channel_accept_file_finish (TpFileTransferChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_file_transfer_channel_accept_file_async) } static void file_read_async_cb (GObject *source, GAsyncResult *res, gpointer user_data) { TpFileTransferChannel *self = user_data; GFileInputStream *in_stream; GError *error = NULL; GFile *file = G_FILE (source); in_stream = g_file_read_finish (file, res, &error); if (error != NULL) { operation_failed (self, error); return; } self->priv->in_stream = G_INPUT_STREAM (in_stream); g_clear_object (&self->priv->file); self->priv->file = g_object_ref (file); if (!set_address_and_access_control (self)) return; /* Call Provide */ tp_cli_channel_type_file_transfer_call_provide_file (TP_CHANNEL (self), -1, self->priv->socket_type, self->priv->access_control, self->priv->access_control_param, accept_or_provide_file_cb, NULL, NULL, G_OBJECT (self)); } /** * tp_file_transfer_channel_provide_file_async: * @self: a #TpFileTransferChannel * @file: a #GFile to send to the remote contact * @callback: a callback to call when the transfer has been accepted * @user_data: data to pass to @callback * * Provide a file transfer. This should be called when the file * transfer state changes (tp_file_transfer_channel_get_state() and * the "notify::state" signal) to * %TP_FILE_TRANSFER_STATE_ACCEPTED or * %TP_FILE_TRANSFER_STATE_PENDING. Once the file has been provided, * the channel #TpFileTransferChannel:state will change to * %TP_FILE_TRANSFER_STATE_OPEN. * * Once the file has been provided, @callback will be called. You * should then call tp_file_transfer_channel_provide_file_finish() to * get the result of the operation. * * Since: 0.17.1 */ void tp_file_transfer_channel_provide_file_async (TpFileTransferChannel *self, GFile *file, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self)); g_return_if_fail (G_IS_FILE (file)); if (self->priv->access_control_param != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't provide already provided transfer"); return; } if (self->priv->state != TP_FILE_TRANSFER_STATE_ACCEPTED && self->priv->state != TP_FILE_TRANSFER_STATE_PENDING) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't provide a transfer that isn't pending or accepted"); return; } if (!tp_channel_get_requested (TP_CHANNEL (self))) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Can't provide incoming transfer"); return; } self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_file_transfer_channel_provide_file_async); g_file_read_async (file, G_PRIORITY_DEFAULT, NULL, file_read_async_cb, self); } /** * tp_file_transfer_channel_provide_file_finish: * @self: a #TpFileTransferChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes a call to tp_file_transfer_channel_provide_file_async(). * * * Successful return from this function does not mean that the file * transfer has completed or has even started at all. The state of the * file transfer should be monitored with the "notify::state" signal. * * Returns: %TRUE if the file has been successfully provided, or * %FALSE. * * Since: 0.17.1 */ gboolean tp_file_transfer_channel_provide_file_finish (TpFileTransferChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_file_transfer_channel_provide_file_async) } /* Property accessors */ /** * tp_file_transfer_channel_get_mime_type: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:mime-type property * * Returns: (transfer none): the value of the * #TpFileTransferChannel:mime-type property * * Since: 0.15.5 */ const char * tp_file_transfer_channel_get_mime_type (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->mime_type; } /** * tp_file_transfer_channel_get_date: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:date property * * Returns: (transfer none): the value of the #TpFileTransferChannel:date * property * * Since: 0.15.5 */ GDateTime * tp_file_transfer_channel_get_date (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->date; } /** * tp_file_transfer_channel_get_description: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:description property * * Returns: (transfer none): the value of the * #TpFileTransferChannel:description property * * Since: 0.15.5 */ const gchar * tp_file_transfer_channel_get_description (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->description; } /** * tp_file_transfer_channel_get_filename: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:filename property * * Returns: (transfer none): the value of the * #TpFileTransferChannel:filename property * * Since: 0.15.5 */ const gchar * tp_file_transfer_channel_get_filename (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->filename; } /** * tp_file_transfer_channel_get_size: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:size property * * Returns: the value of the #TpFileTransferChannel:size property * * Since: 0.15.5 */ guint64 tp_file_transfer_channel_get_size (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), 0); return self->priv->size; } /** * tp_file_transfer_channel_get_state: * @self: a #TpFileTransferChannel * @reason: (out): a #TpFileTransferStateChangeReason, or %NULL * * Returns the #TpFileTransferChannel:state property. * * If @reason is not %NULL it is set to the reason why * #TpFileTransferChannel:state changed to its current value. * * Returns: the value of the #TpFileTransferChannel:state property * * Since: 0.17.1 */ TpFileTransferState tp_file_transfer_channel_get_state (TpFileTransferChannel *self, TpFileTransferStateChangeReason *reason) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), TP_FILE_TRANSFER_STATE_NONE); if (reason != NULL) *reason = self->priv->state_reason; return self->priv->state; } /** * tp_file_transfer_channel_get_transferred_bytes: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:transferred-bytes property * * Returns: the value of the #TpFileTransferChannel:transferred-bytes property * * Since: 0.15.5 */ guint64 tp_file_transfer_channel_get_transferred_bytes (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), 0); return self->priv->transferred_bytes; } /** * tp_file_transfer_channel_get_service_name: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:service-name property * * Returns: the value of the #TpFileTransferChannel:service-name property * * Since: 0.17.1 */ const gchar * tp_file_transfer_channel_get_service_name (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->service_name; } /** * tp_file_transfer_channel_get_metadata: * @self: a #TpFileTransferChannel * * Return the #TpFileTransferChannel:metadata property * * Returns: (transfer none) (element-type utf8 GStrv): the * value of the #TpFileTransferChannel:metadata property * * Since: 0.17.1 */ const GHashTable * tp_file_transfer_channel_get_metadata (TpFileTransferChannel *self) { g_return_val_if_fail (TP_IS_FILE_TRANSFER_CHANNEL (self), NULL); return self->priv->metadata; } telepathy-glib-0.24.2/telepathy-glib/file-transfer-channel.h0000644000175000017500000001133512652510705020672 00000000000000/* * file-transfer-channel.h - high level API for File Transfer channels * * Copyright (C) 2010-2011 Morten Mjelva * Copyright (C) 2010-2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_FILE_TRANSFER_CHANNEL_H__ #define __TP_FILE_TRANSFER_CHANNEL_H__ #include #include G_BEGIN_DECLS #define TP_TYPE_FILE_TRANSFER_CHANNEL (tp_file_transfer_channel_get_type ()) #define TP_FILE_TRANSFER_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_FILE_TRANSFER_CHANNEL, TpFileTransferChannel)) #define TP_FILE_TRANSFER_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_FILE_TRANSFER_CHANNEL, TpFileTransferChannelClass)) #define TP_IS_FILE_TRANSFER_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_FILE_TRANSFER_CHANNEL)) #define TP_IS_FILE_TRANSFER_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_FILE_TRANSFER_CHANNEL)) #define TP_FILE_TRANSFER_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_FILE_TRANSFER_CHANNEL, TpFileTransferChannelClass)) typedef struct _TpFileTransferChannel TpFileTransferChannel; typedef struct _TpFileTransferChannelClass TpFileTransferChannelClass; typedef struct _TpFileTransferChannelPrivate TpFileTransferChannelPrivate; struct _TpFileTransferChannel { /**/ TpChannel parent; TpFileTransferChannelPrivate *priv; }; struct _TpFileTransferChannelClass { /**/ TpChannelClass parent_class; GCallback _padding[8]; }; #define TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE \ tp_file_transfer_channel_get_feature_quark_core () _TP_AVAILABLE_IN_0_16 GQuark tp_file_transfer_channel_get_feature_quark_core (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 GType tp_file_transfer_channel_get_type (void); /* Methods */ _TP_AVAILABLE_IN_0_16 _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_channel) TpFileTransferChannel * tp_file_transfer_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); _TP_AVAILABLE_IN_0_18 void tp_file_transfer_channel_accept_file_async (TpFileTransferChannel *self, GFile *file, guint64 offset, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_file_transfer_channel_accept_file_finish ( TpFileTransferChannel *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_file_transfer_channel_provide_file_async (TpFileTransferChannel *self, GFile *file, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_file_transfer_channel_provide_file_finish ( TpFileTransferChannel *self, GAsyncResult *result, GError **error); /* Property accessors */ _TP_AVAILABLE_IN_0_16 const char * tp_file_transfer_channel_get_mime_type ( TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_16 GDateTime * tp_file_transfer_channel_get_date (TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_18 TpFileTransferState tp_file_transfer_channel_get_state ( TpFileTransferChannel *self, TpFileTransferStateChangeReason *reason); _TP_AVAILABLE_IN_0_16 const gchar * tp_file_transfer_channel_get_description ( TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_16 const gchar * tp_file_transfer_channel_get_filename ( TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_16 guint64 tp_file_transfer_channel_get_size (TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_16 guint64 tp_file_transfer_channel_get_transferred_bytes ( TpFileTransferChannel *self); /* Metadata */ _TP_AVAILABLE_IN_0_18 const gchar * tp_file_transfer_channel_get_service_name ( TpFileTransferChannel *self); _TP_AVAILABLE_IN_0_18 const GHashTable * tp_file_transfer_channel_get_metadata ( TpFileTransferChannel *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/svc-protocol.h0000644000175000017500000000047612652510705017161 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_PROTOCOL_H__ #define __TP_META_SVC_PROTOCOL_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/client-channel-factory.c0000644000175000017500000001277312652510705021056 00000000000000/* * Interface for channel factories * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:client-channel-factory * @title: TpClientChannelFactoryInterface * @short_description: an interface for client channel factories * * Client channel factories are used to create channel proxies. An application * wanting to use its own #TpChannel subclass has to implement an object * implementing the #TpClientChannelFactoryInterface interface. * * Once a channel has been created by a factory using * tp_client_channel_factory_create_channel(), the caller should then prepare * on it the channel features returned by * tp_client_channel_factory_dup_channel_features() using * tp_proxy_prepare_async(). * * Since: 0.13.2 */ /** * TpClientChannelFactory: * * Opaque typedef representing a #GObject that implements * the %TP_TYPE_CLIENT_CHANNEL_FACTORY interface. * * Since: 0.13.6 */ /** * TpClientChannelFactoryInterface: * @parent: the parent * @create_channel: obsolete version of @obj_create_channel which does not * receive the object instance as an argument * @dup_channel_features: obsolete version of @obj_dup_channel_features which * does not receive the object instance as an argument * @obj_create_channel: virtual method used to create channels; * see tp_client_channel_factory_create_channel() * @obj_dup_channel_features: virtual method returning channel features that * have to be prepared on newly created channels; * see tp_client_channel_factory_dup_channel_features() * * Interface for a channel factory * * Since: 0.13.2 */ #include "config.h" #include "telepathy-glib/client-channel-factory.h" #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" G_DEFINE_INTERFACE(TpClientChannelFactory, tp_client_channel_factory, G_TYPE_OBJECT) /* Deprecated module can use deprecated APIs */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS static void tp_client_channel_factory_default_init (TpClientChannelFactoryInterface *iface) { } /** * tp_client_channel_factory_create_channel: * @self: a client channel factory * @conn: a #TpConnection * @path: the object path of the channel * @properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel * @error: used to indicate the error if %NULL is returned * * Function called when a channel need to be created. * Implementation can return a subclass of #TpChannel if they need to. * * Changed in 0.13.6: the function's signature was previously wrong; * it expected an object instance as its first parameter, but the type of the * parameter was the type of the interface vtable. * * Returns: (transfer full): a new channel proxy, or %NULL on invalid arguments * * Since: 0.13.2 */ TpChannel * tp_client_channel_factory_create_channel (TpClientChannelFactory *self, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error) { TpClientChannelFactoryInterface *iface = TP_CLIENT_CHANNEL_FACTORY_GET_IFACE ( self); g_return_val_if_fail (TP_IS_CLIENT_CHANNEL_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (path != NULL, NULL); g_return_val_if_fail (properties != NULL, NULL); if (iface->obj_create_channel != NULL) return iface->obj_create_channel (self, conn, path, properties, error); if (iface->create_channel != NULL) return iface->create_channel (iface, conn, path, properties, error); return tp_channel_new_from_properties (conn, path, properties, error); } /** * tp_client_channel_factory_dup_channel_features: * @self: a client channel factory * @channel: a #TpChannel * * Return a zero terminated #GArray containing the #TpChannel features that * should be prepared on @channel. * * Changed in 0.13.6: the function's signature was previously wrong; * it expected an object instance as its first parameter, but the type of the * parameter was the type of the interface vtable. * * Returns: (transfer full) (element-type GQuark): a newly allocated #GArray * * Since: 0.13.3 */ GArray * tp_client_channel_factory_dup_channel_features ( TpClientChannelFactory *self, TpChannel *channel) { TpClientChannelFactoryInterface *iface = TP_CLIENT_CHANNEL_FACTORY_GET_IFACE ( self); GArray *arr; GQuark feature = TP_CHANNEL_FEATURE_CORE; g_return_val_if_fail (TP_IS_CLIENT_CHANNEL_FACTORY (self), NULL); g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); if (iface->obj_dup_channel_features != NULL) return iface->obj_dup_channel_features (self, channel); if (iface->dup_channel_features != NULL) return iface->dup_channel_features (iface, channel); arr = g_array_sized_new (TRUE, FALSE, sizeof (GQuark), 1); g_array_append_val (arr, feature); return arr; } G_GNUC_END_IGNORE_DEPRECATIONS telepathy-glib-0.24.2/telepathy-glib/client-channel-factory.h0000644000175000017500000000556712652510705021066 00000000000000/* * Interface for channel factories * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CLIENT_CHANNEL_FACTORY_H__ #define __TP_CLIENT_CHANNEL_FACTORY_H__ #include #include G_BEGIN_DECLS typedef struct _TpClientChannelFactory TpClientChannelFactory; typedef struct _TpClientChannelFactoryInterface TpClientChannelFactoryInterface; struct _TpClientChannelFactoryInterface { GTypeInterface parent; TpChannel * (* create_channel) (TpClientChannelFactoryInterface *self, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error); GArray * (* dup_channel_features) (TpClientChannelFactoryInterface *self, TpChannel *channel); TpChannel *(*obj_create_channel) (TpClientChannelFactory *self, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error); GArray *(*obj_dup_channel_features) (TpClientChannelFactory *self, TpChannel *channel); }; GType tp_client_channel_factory_get_type (void); #define TP_TYPE_CLIENT_CHANNEL_FACTORY \ (tp_client_channel_factory_get_type ()) #define TP_CLIENT_CHANNEL_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CLIENT_CHANNEL_FACTORY, \ TpClientChannelFactory)) #define TP_IS_CLIENT_CHANNEL_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CLIENT_CHANNEL_FACTORY)) #define TP_CLIENT_CHANNEL_FACTORY_GET_IFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TP_TYPE_CLIENT_CHANNEL_FACTORY, \ TpClientChannelFactoryInterface)) TpChannel *tp_client_channel_factory_create_channel ( TpClientChannelFactory *self, TpConnection *conn, const gchar *path, GHashTable *properties, GError **error); GArray *tp_client_channel_factory_dup_channel_features ( TpClientChannelFactory *self, TpChannel *channel); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/base-connection-internal.h0000644000175000017500000000241312652510705021401 00000000000000/**/ /* Base class for Connection implementations * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_BASE_CONNECTION_INTERNAL_H__ #define __TP_BASE_CONNECTION_INTERNAL_H__ #include G_BEGIN_DECLS void _tp_base_connection_set_handle_repo (TpBaseConnection *self, TpHandleType handle_type, TpHandleRepoIface *handle_repo); gpointer _tp_base_connection_find_channel_manager (TpBaseConnection *self, GType type); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/proxy-signals.c0000644000175000017500000003457312652510705017346 00000000000000/* * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/proxy-subclass.h" #define DEBUG_FLAG TP_DEBUG_PROXY #include "telepathy-glib/debug-internal.h" #include #if 0 #define MORE_DEBUG DEBUG #else #define MORE_DEBUG(...) G_STMT_START {} G_STMT_END #endif /** * TpProxySignalConnection: * * Opaque structure representing a D-Bus signal connection. * * Since: 0.7.1 */ typedef struct _TpProxySignalInvocation TpProxySignalInvocation; struct _TpProxySignalInvocation { TpProxySignalConnection *sc; TpProxy *proxy; GValueArray *args; guint idle_source; }; struct _TpProxySignalConnection { /* 1 if D-Bus has us * 1 per member of @invocations * 1 per callback being invoked right now */ gsize refcount; /* borrowed ref (discarded when we see invalidated signal) * + 1 per member of @invocations * + 1 per callback being invoked (possibly nested!) right now */ TpProxy *proxy; DBusGProxy *iface_proxy; gchar *member; GCallback collect_args; TpProxyInvokeFunc invoke_callback; GCallback callback; gpointer user_data; GDestroyNotify destroy; GObject *weak_object; /* queue of _TpProxySignalInvocation, not including any that are * being invoked right now */ GQueue invocations; }; static void _tp_proxy_signal_connection_dgproxy_destroy (DBusGProxy *, TpProxySignalConnection *); static void tp_proxy_signal_connection_disconnect_dbus_glib (TpProxySignalConnection *sc) { DBusGProxy *iface_proxy = sc->iface_proxy; /* ignore if already done */ if (iface_proxy == NULL) return; sc->iface_proxy = NULL; g_signal_handlers_disconnect_by_func (iface_proxy, _tp_proxy_signal_connection_dgproxy_destroy, sc); dbus_g_proxy_disconnect_signal (iface_proxy, sc->member, sc->collect_args, (gpointer) sc); g_object_unref (iface_proxy); } static void tp_proxy_signal_connection_proxy_invalidated (TpProxy *proxy, guint domain, gint code, const gchar *message, TpProxySignalConnection *sc) { g_assert (sc != NULL); g_assert (domain != 0); g_assert (message != NULL); DEBUG ("%p: TpProxy %p invalidated (I have %p): %s", sc, proxy, sc->proxy, message); g_assert (proxy == sc->proxy); g_signal_handlers_disconnect_by_func (sc->proxy, tp_proxy_signal_connection_proxy_invalidated, sc); sc->proxy = NULL; tp_proxy_signal_connection_disconnect_dbus_glib (sc); } static void tp_proxy_signal_connection_lost_weak_ref (gpointer data, GObject *dead) { TpProxySignalConnection *sc = data; DEBUG ("%p: lost weak ref to %p", sc, dead); g_assert (dead == sc->weak_object); sc->weak_object = NULL; tp_proxy_signal_connection_disconnect (sc); } static gboolean _tp_proxy_signal_connection_finish_free (gpointer p) { TpProxySignalConnection *sc = p; if (sc->weak_object != NULL) { g_object_weak_unref (sc->weak_object, tp_proxy_signal_connection_lost_weak_ref, sc); sc->weak_object = NULL; } g_slice_free (TpProxySignalConnection, sc); return FALSE; } /* Return TRUE if it dies. */ static gboolean tp_proxy_signal_connection_unref (TpProxySignalConnection *sc) { if (--(sc->refcount) > 0) { MORE_DEBUG ("%p: %" G_GSIZE_FORMAT " refs left", sc, sc->refcount); return FALSE; } MORE_DEBUG ("removed last ref to %p", sc); if (sc->proxy != NULL) { g_signal_handlers_disconnect_by_func (sc->proxy, tp_proxy_signal_connection_proxy_invalidated, sc); sc->proxy = NULL; } g_assert (sc->invocations.length == 0); if (sc->destroy != NULL) sc->destroy (sc->user_data); sc->destroy = NULL; sc->user_data = NULL; g_free (sc->member); /* We can't inline this here, because of fd.o #14750. If our signal * connection gets destroyed by side-effects of something else losing a * weak reference to the same object (e.g. a pending call whose weak * object is the same as ours has the last ref to the TpProxy, causing * invalidation when the weak object goes away) then we need to avoid dying * til *our* weak-reference callback has run. So, don't actually free the * signal connection until we've re-entered the main loop. */ g_idle_add_full (G_PRIORITY_HIGH, _tp_proxy_signal_connection_finish_free, sc, NULL); return TRUE; } /** * tp_proxy_signal_connection_disconnect: * @sc: a signal connection * * Disconnect the given signal connection. After this function returns, you * must not assume that the signal connection remains valid, but you must not * explicitly free it either. * * It is not safe to call this function if @sc has been disconnected already, * which happens in each of these situations: * * * the @weak_object used when @sc was created has been * destroyed * tp_proxy_signal_connection_disconnect has already been * used * the proxy has been invalidated * * * Since: 0.7.1 */ void tp_proxy_signal_connection_disconnect (TpProxySignalConnection *sc) { TpProxySignalInvocation *invocation; while ((invocation = g_queue_pop_head (&sc->invocations)) != NULL) { g_assert (invocation->sc == sc); g_object_unref (invocation->proxy); invocation->proxy = NULL; invocation->sc = NULL; g_source_remove (invocation->idle_source); if (tp_proxy_signal_connection_unref (sc)) return; } tp_proxy_signal_connection_disconnect_dbus_glib (sc); } static void tp_proxy_signal_invocation_free (gpointer p) { TpProxySignalInvocation *invocation = p; if (invocation->sc != NULL) { /* this shouldn't really happen - it'll get run if the idle source * is removed by something other than t_p_s_c_disconnect or * t_p_s_i_run */ WARNING ("idle source removed by someone else"); g_queue_remove (&invocation->sc->invocations, invocation); g_object_unref (invocation->proxy); tp_proxy_signal_connection_unref (invocation->sc); } g_assert (invocation->proxy == NULL); if (invocation->args != NULL) tp_value_array_free (invocation->args); g_slice_free (TpProxySignalInvocation, invocation); } static gboolean tp_proxy_signal_invocation_run (gpointer p) { TpProxySignalInvocation *invocation = p; TpProxySignalInvocation *popped = g_queue_pop_head (&invocation->sc->invocations); /* if GLib is running idle handlers in the wrong order, then we've lost */ MORE_DEBUG ("%p: popped %p", invocation->sc, popped); g_assert (popped == invocation); invocation->sc->invoke_callback (invocation->proxy, NULL, invocation->args, invocation->sc->callback, invocation->sc->user_data, invocation->sc->weak_object); /* the invoke callback steals args */ invocation->args = NULL; /* there's one ref to the proxy per queued invocation, to keep it * alive */ MORE_DEBUG ("%p refcount-- due to %p run, sc=%p", invocation->proxy, invocation, invocation->sc); g_object_unref (invocation->proxy); invocation->proxy = NULL; tp_proxy_signal_connection_unref (invocation->sc); invocation->sc = NULL; return FALSE; } static void tp_proxy_signal_connection_dropped (gpointer p, GClosure *unused) { TpProxySignalConnection *sc = p; MORE_DEBUG ("%p (%u invocations queued)", sc, sc->invocations.length); tp_proxy_signal_connection_unref (sc); } static void _tp_proxy_signal_connection_dgproxy_destroy (DBusGProxy *iface_proxy, TpProxySignalConnection *sc) { g_assert (iface_proxy != NULL); g_assert (sc != NULL); g_assert (sc->iface_proxy == iface_proxy); DEBUG ("%p: DBusGProxy %p invalidated", sc, iface_proxy); sc->iface_proxy = NULL; g_signal_handlers_disconnect_by_func (iface_proxy, _tp_proxy_signal_connection_dgproxy_destroy, sc); g_object_unref (iface_proxy); } static void collect_none (DBusGProxy *dgproxy, TpProxySignalConnection *sc) { tp_proxy_signal_connection_v0_take_results (sc, NULL); } /** * tp_proxy_signal_connection_v0_new: * @self: a proxy * @iface: a quark whose string value is the D-Bus interface * @member: the name of the signal to which we're connecting * @expected_types: an array of expected GTypes for the arguments, terminated * by %G_TYPE_INVALID * @collect_args: a callback to be given to dbus_g_proxy_connect_signal(), * which must marshal the arguments into a #GValueArray and use them to call * tp_proxy_signal_connection_v0_take_results(); this callback is not * guaranteed to be called by future versions of telepathy-glib, which might * be able to implement its functionality internally. If no arguments are * expected at all (expected_types = { G_TYPE_INVALID }) then this callback * should instead be %NULL * @invoke_callback: a function which will be called with @error = %NULL, * which should invoke @callback with @user_data, @weak_object and other * appropriate arguments taken from @args * @callback: user callback to be invoked by @invoke_callback * @user_data: user-supplied data for the callback * @destroy: user-supplied destructor for the data, which will be called * when the signal connection is disconnected for any reason, * or will be called before this function returns if an error occurs * @weak_object: if not %NULL, a #GObject which will be weakly referenced by * the signal connection - if it is destroyed, the signal connection will * automatically be disconnected * @error: If not %NULL, used to raise an error if %NULL is returned * * Allocate a new structure representing a signal connection, and connect to * the signal, arranging for @invoke_callback to be called when it arrives. * * This function is for use by #TpProxy subclass implementations only, and * should usually only be called from code generated by * tools/glib-client-gen.py. * * Returns: a signal connection structure, or %NULL if the proxy does not * have the desired interface or has become invalid * * Since: 0.7.1 */ TpProxySignalConnection * tp_proxy_signal_connection_v0_new (TpProxy *self, GQuark iface, const gchar *member, const GType *expected_types, GCallback collect_args, TpProxyInvokeFunc invoke_callback, GCallback callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object, GError **error) { TpProxySignalConnection *sc; DBusGProxy *iface_proxy = tp_proxy_get_interface_by_id (self, iface, error); if (iface_proxy == NULL) { if (destroy != NULL) destroy (user_data); return NULL; } if (expected_types[0] == G_TYPE_INVALID) { collect_args = G_CALLBACK (collect_none); } else { g_return_val_if_fail (collect_args != NULL, NULL); } sc = g_slice_new0 (TpProxySignalConnection); MORE_DEBUG ("(proxy=%p, if=%s, sig=%s, collect=%p, invoke=%p, " "cb=%p, ud=%p, dn=%p, wo=%p) -> %p", self, g_quark_to_string (iface), member, collect_args, invoke_callback, callback, user_data, destroy, weak_object, sc); sc->refcount = 1; sc->proxy = self; sc->iface_proxy = g_object_ref (iface_proxy); sc->member = g_strdup (member); sc->collect_args = collect_args; sc->invoke_callback = invoke_callback; sc->callback = callback; sc->user_data = user_data; sc->destroy = destroy; sc->weak_object = weak_object; if (weak_object != NULL) g_object_weak_ref (weak_object, tp_proxy_signal_connection_lost_weak_ref, sc); g_signal_connect (self, "invalidated", G_CALLBACK (tp_proxy_signal_connection_proxy_invalidated), sc); g_signal_connect (iface_proxy, "destroy", G_CALLBACK (_tp_proxy_signal_connection_dgproxy_destroy), sc); dbus_g_proxy_connect_signal (iface_proxy, member, collect_args, sc, tp_proxy_signal_connection_dropped); return sc; } /** * tp_proxy_signal_connection_v0_take_results: * @sc: The signal connection * @args: The arguments of the signal * * Feed the results of a signal invocation back into the signal connection * machinery. * * This method should only be called from #TpProxy subclass implementations, * in the callback that implements @collect_args. * * Since: 0.7.1 */ void tp_proxy_signal_connection_v0_take_results (TpProxySignalConnection *sc, GValueArray *args) { TpProxySignalInvocation *invocation = g_slice_new0 (TpProxySignalInvocation); /* FIXME: assert that the GValueArray is the right length, or * even that it contains the right types? */ /* as long as there are queued invocations, we keep one ref to the TpProxy * and one ref to the TpProxySignalConnection per invocation */ MORE_DEBUG ("%p refcount++ due to %p, sc=%p", sc->proxy, invocation, sc); invocation->proxy = g_object_ref (sc->proxy); sc->refcount++; invocation->sc = sc; invocation->args = args; g_queue_push_tail (&sc->invocations, invocation); MORE_DEBUG ("invocations: head=%p tail=%p count=%u", sc->invocations.head, sc->invocations.tail, sc->invocations.length); invocation->idle_source = g_idle_add_full (G_PRIORITY_HIGH, tp_proxy_signal_invocation_run, invocation, tp_proxy_signal_invocation_free); } telepathy-glib-0.24.2/telepathy-glib/room-info.c0000644000175000017500000001472712652510705016433 00000000000000/* * room-info.c * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "room-info.h" #include "room-info-internal.h" #include #include #include /** * SECTION: room-info * @title: TpRoomInfo * @short_description: a room found by #TpRoomList * * #TpRoomInfo represents a room found during a room listing using * #TpRoomList. * * See also: #TpRoomList */ /** * TpRoomInfo: * * Data structure representing a #TpRoomInfo. * * Since: 0.19.0 */ /** * TpRoomInfoClass: * * The class of a #TpRoomInfo. * * Since: 0.19.0 */ G_DEFINE_TYPE (TpRoomInfo, tp_room_info, G_TYPE_OBJECT) struct _TpRoomInfoPriv { TpHandle handle; gchar *channel_type; GHashTable *info; }; static void tp_room_info_finalize (GObject *object) { TpRoomInfo *self = TP_ROOM_INFO (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_room_info_parent_class)->finalize; g_free (self->priv->channel_type); g_hash_table_unref (self->priv->info); if (chain_up != NULL) chain_up (object); } static void tp_room_info_class_init ( TpRoomInfoClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); oclass->finalize = tp_room_info_finalize; g_type_class_add_private (klass, sizeof (TpRoomInfoPriv)); } static void tp_room_info_init (TpRoomInfo *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ROOM_INFO, TpRoomInfoPriv); } TpRoomInfo * _tp_room_info_new (GValueArray *dbus_struct) { TpRoomInfo *room; const gchar *channel_type; GHashTable *info; g_return_val_if_fail (dbus_struct != NULL, NULL); g_return_val_if_fail (dbus_struct->n_values == 3, NULL); /* We don't want to expose the GValueArray in the API so it's not * a GObject property. */ room = g_object_new (TP_TYPE_ROOM_INFO, NULL); tp_value_array_unpack (dbus_struct, 3, &room->priv->handle, &channel_type, &info); room->priv->channel_type = g_strdup (channel_type); room->priv->info = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (room->priv->info, info, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); return room; } /** * tp_room_info_get_handle: * @self: a #TpRoomInfo * * * * Returns: the #TpHandle of the room * * Since: 0.19.0 */ TpHandle tp_room_info_get_handle (TpRoomInfo *self) { return self->priv->handle; } /** * tp_room_info_get_channel_type: * @self: a #TpRoomInfo * * * * Returns: a string representing the D-Bus interface name of * the channel type of the room * * Since: 0.19.0 */ const gchar * tp_room_info_get_channel_type (TpRoomInfo *self) { return self->priv->channel_type; } /** * tp_room_info_get_handle_name: * @self: a #TpRoomInfo * * * * Returns: the identifier of the room (as would be returned * by inspecting the #TpHandle returned by tp_room_info_get_handle()) * * Since: 0.19.0 */ const gchar * tp_room_info_get_handle_name (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "handle-name"); } /** * tp_room_info_get_name: * @self: a #TpRoomInfo * * * * Returns: the human-readable name of the room if different * from the handle * * Since: 0.19.0 */ const gchar * tp_room_info_get_name (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "name"); } /** * tp_room_info_get_description: * @self: a #TpRoomInfo * * * * Returns: a description of the room's overall purpose * * Since: 0.19.0 */ const gchar * tp_room_info_get_description (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "description"); } /** * tp_room_info_get_subject: * @self: a #TpRoomInfo * * * * Returns: the current subject of conversation in the room * * Since: 0.19.0 */ const gchar * tp_room_info_get_subject (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "subject"); } /** * tp_room_info_get_members_count: * @self: a #TpRoomInfo * @known: either %NULL, or a location in which to store %TRUE if the * returned value is meaningful * * * * Returns: the number of members in the room * * Since: 0.19.0 */ guint tp_room_info_get_members_count (TpRoomInfo *self, gboolean *known) { return tp_asv_get_uint32 (self->priv->info, "members", known); } /** * tp_room_info_get_requires_password: * @self: a #TpRoomInfo * @known: either %NULL, or a location in which to store %TRUE if the * returned value is meaningful * * * * Returns: %TRUE if the room requires a password to enter * * Since: 0.19.0 */ gboolean tp_room_info_get_requires_password (TpRoomInfo *self, gboolean *known) { return tp_asv_get_boolean (self->priv->info, "password", known); } /** * tp_room_info_get_invite_only: * @self: a #TpRoomInfo * @known: either %NULL, or a location in which to store %TRUE if the * returned value is meaningful * * * * Returns: %TRUE if you cannot join the room, but must be invited * * Since: 0.19.0 */ gboolean tp_room_info_get_invite_only (TpRoomInfo *self, gboolean *known) { return tp_asv_get_boolean (self->priv->info, "invite-only", known); } /** * tp_room_info_get_room_id: * @self: a #TpRoomInfo * * * * Returns: the human-readable identifier of the room * * Since: 0.19.0 */ const gchar * tp_room_info_get_room_id (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "room-id"); } /** * tp_room_info_get_server: * @self: a #TpRoomInfo * * * * Returns: the DNS name of the server hosting the room * * Since: 0.19.0 */ const gchar * tp_room_info_get_server (TpRoomInfo *self) { return tp_asv_get_string (self->priv->info, "server"); } telepathy-glib-0.24.2/telepathy-glib/room-info.h0000644000175000017500000000621212652510705016426 00000000000000/* * room-info.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_ROOM_INFO_H__ #define __TP_ROOM_INFO_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpRoomInfo TpRoomInfo; typedef struct _TpRoomInfoClass TpRoomInfoClass; typedef struct _TpRoomInfoPriv TpRoomInfoPriv; struct _TpRoomInfoClass { /**/ GObjectClass parent_class; }; struct _TpRoomInfo { /**/ GObject parent; TpRoomInfoPriv *priv; }; _TP_AVAILABLE_IN_0_20 GType tp_room_info_get_type (void); /* TYPE MACROS */ #define TP_TYPE_ROOM_INFO \ (tp_room_info_get_type ()) #define TP_ROOM_INFO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_ROOM_INFO, \ TpRoomInfo)) #define TP_ROOM_INFO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_ROOM_INFO, \ TpRoomInfoClass)) #define TP_IS_ROOM_INFO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ TP_TYPE_ROOM_INFO)) #define TP_IS_ROOM_INFO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ TP_TYPE_ROOM_INFO)) #define TP_ROOM_INFO_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_ROOM_INFO, \ TpRoomInfoClass)) _TP_AVAILABLE_IN_0_20 TpHandle tp_room_info_get_handle (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar * tp_room_info_get_channel_type (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_handle_name (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_name (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_description (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_subject (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 guint tp_room_info_get_members_count (TpRoomInfo *self, gboolean *known); _TP_AVAILABLE_IN_0_20 gboolean tp_room_info_get_requires_password (TpRoomInfo *self, gboolean *known); _TP_AVAILABLE_IN_0_20 gboolean tp_room_info_get_invite_only (TpRoomInfo *self, gboolean *known); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_room_id (TpRoomInfo *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_room_info_get_server (TpRoomInfo *self); G_END_DECLS #endif /* #ifndef __TP_ROOM_INFO_H__*/ telepathy-glib-0.24.2/telepathy-glib/channel-factory-iface.c0000644000175000017500000002646312652510705020650 00000000000000/* * tp-channel-factory-iface.c - Stubs for Telepathy Channel Factory interface * * Copyright (C) 2006-2008 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:channel-factory-iface * @title: TpChannelFactoryIface * @short_description: interface for channel allocation/tracking * @see_also: #TpSvcConnection, #TpChannelManager * * A channel factory is attached to a connection. It carries out channel * requests from the connection, and responds to channel-related events * on the underlying network connection (e.g. incoming calls). * * Deprecated since version 0.11.7. Use #TpChannelManager, a newer * interface which can be used to implement modern D-Bus APIs, instead. * * Deprecated: 0.11.7 */ #include "config.h" #include #include #include enum { NEW_CHANNEL, CHANNEL_ERROR, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; static void tp_channel_factory_iface_base_init (gpointer klass) { static gboolean initialized = FALSE; if (!initialized) { initialized = TRUE; /** * TpChannelFactoryIface::new-channel: * @self: an object implementing #TpChannelFactoryIface * @channel: a new channel (an object implementing #TpChannelIface) * @request_context: a request context as passed to * tp_channel_factory_iface_request(), or %NULL * * Emitted when a new channel has been created. * * If the @channel was created in response to a channel request, the * request was for a nonzero handle type, and the channel has zero handle * type, @request_context will be the request context passed to * tp_channel_factory_iface_request(). * * Otherwise, request may either be %NULL or a request that led to * @channel's creation; callers are expected to determine which channels * satisfy which requests based on the handle and handle-type. */ signals[NEW_CHANNEL] = g_signal_new ("new-channel", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_OBJECT, G_TYPE_POINTER); /** * TpChannelFactoryIface::channel-error: * @self: an object implementing #TpChannelFactoryIface * @channel: an object implementing #TpChannelIface * @error: the #GError that made the channel request fail * @request_context: a request context as passed to * tp_channel_factory_iface_request(), or %NULL * * Emitted when a new channel has been created, but an error occurred * before it could become useful. * * @request is the same as for #TpChannelFactoryIface::new-channel. */ signals[CHANNEL_ERROR] = g_signal_new ("channel-error", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_OBJECT, G_TYPE_POINTER, G_TYPE_POINTER); } } GType tp_channel_factory_iface_get_type (void) { static GType type = 0; if (type == 0) { static const GTypeInfo info = { sizeof (TpChannelFactoryIfaceClass), tp_channel_factory_iface_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, 0, /* n_preallocs */ NULL /* instance_init */ }; type = g_type_register_static (G_TYPE_INTERFACE, "TpChannelFactoryIface", &info, 0); } return type; } /** * tp_channel_factory_iface_close_all: * @self: An object implementing #TpChannelFactoryIface * * Close all channels and shut down the channel factory. It is not expected * to be usable afterwards. This is called when the connection goes to * disconnected state, before either emitting the StatusChanged signal or * calling disconnected(). * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_close_all (TpChannelFactoryIface *self) { void (*virtual_method)(TpChannelFactoryIface *) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->close_all; g_assert (virtual_method != NULL); virtual_method (self); } /** * tp_channel_factory_iface_connecting: * @self: An implementation of the channel factory interface * * Indicate that the connection has gone from disconnected to connecting * state. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_connecting (TpChannelFactoryIface *self) { void (*virtual_method)(TpChannelFactoryIface *) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->connecting; if (virtual_method) virtual_method (self); } /** * tp_channel_factory_iface_connected: * @self: An implementation of the channel factory interface * * Indicate that the connection has gone from connecting to connected state. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_connected (TpChannelFactoryIface *self) { void (*virtual_method)(TpChannelFactoryIface *) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->connected; if (virtual_method) virtual_method (self); } /** * tp_channel_factory_iface_disconnected: * @self: An implementation of the channel factory interface * * Indicate that the connection has become disconnected. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_disconnected (TpChannelFactoryIface *self) { void (*virtual_method)(TpChannelFactoryIface *) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->disconnected; if (virtual_method) virtual_method (self); } /** * tp_channel_factory_iface_foreach: * @self: An implementation of the channel factory interface * @func: A callback to be called once per channel * @data: Extra data to be passed to @func * * Call func(channel, data) for each channel managed by this factory. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_foreach (TpChannelFactoryIface *self, TpChannelFunc func, gpointer data) { void (*virtual_method)(TpChannelFactoryIface *, TpChannelFunc, gpointer) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->foreach; g_assert (virtual_method != NULL); virtual_method (self, func, data); } /** * tp_channel_factory_iface_request: * @self: An object implementing #TpChannelFactoryIface * @chan_type: The channel type, e.g. %TP_IFACE_CHANNEL_TYPE_TEXT * @handle_type: The handle type of the channel's associated handle, * or 0 if the channel has no associated handle * @handle: The channel's associated handle, of type @handle_type, * or 0 if the channel has no associated handle * @request: An opaque data structure representing the channel request; * if this request is satisfied by a newly created channel, * this structure MUST be included in the new-channel signal * if the newly created channel has handle 0, and MAY be * included in the signal if the newly created channel has * nonzero handle. * @ret: Set to the new channel if it is available immediately, as * documented in the description of #TpChannelFactoryRequestStatus * @error: Set to the error if the return is * %TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, unset otherwise * * Request a channel. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 * * Returns: one of the values of #TpChannelFactoryRequestStatus, and * behaves as documented for that return value */ TpChannelFactoryRequestStatus tp_channel_factory_iface_request (TpChannelFactoryIface *self, const gchar *chan_type, TpHandleType handle_type, TpHandle handle, gpointer request, TpChannelIface **ret, GError **error) { TpChannelFactoryRequestStatus (*virtual_method) (TpChannelFactoryIface *, const gchar *, TpHandleType, guint, gpointer, TpChannelIface **, GError **) = TP_CHANNEL_FACTORY_IFACE_GET_CLASS (self)->request; g_assert (virtual_method != NULL); return virtual_method (self, chan_type, handle_type, handle, request, ret, error); } /** * tp_channel_factory_iface_emit_new_channel: * @instance: An object implementing #TpChannelFactoryIface * @channel: The new channel * @request: A request context as passed to tp_channel_factory_iface_request(), * or %NULL * * Signal that a new channel has been created (new-channel signal). * * If the channel was created in response to a channel request, the request * was for a nonzero handle type, and the channel has zero handle type, * request will be the request context passed to * tp_channel_factory_iface_request(). * * Otherwise, request may either be * %NULL or a request that led to the channel's creation; callers are expected * to determine which channels satisfy which requests based on the handle * and handle-type. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_emit_new_channel (gpointer instance, TpChannelIface *channel, gpointer context) { g_signal_emit (instance, signals[NEW_CHANNEL], 0, channel, context); } /** * tp_channel_factory_iface_emit_channel_error: * @instance: An object implementing #TpChannelFactoryIface * @channel: The new channel * @error: The error that made the channel request fail * @request: A request context as passed to tp_channel_factory_iface_request(), * or %NULL * * Signal that a new channel was created, but an error occurred before it * could become useful. * * request is as for tp_channel_factory_iface_emit_new_channel(). * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ void tp_channel_factory_iface_emit_channel_error (gpointer instance, TpChannelIface *channel, GError *error, gpointer context) { g_signal_emit (instance, signals[CHANNEL_ERROR], 0, channel, error, context); } telepathy-glib-0.24.2/telepathy-glib/channel-factory-iface.h0000644000175000017500000002160612652510705020647 00000000000000/* * tp-channel-factory-iface.h - Headers for Telepathy Channel Factory interface * * Copyright (C) 2006 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CHANNEL_FACTORY_IFACE_H__ #define __TP_CHANNEL_FACTORY_IFACE_H__ #include #include #include #include #include G_BEGIN_DECLS #ifndef TP_DISABLE_DEPRECATED #define TP_TYPE_CHANNEL_FACTORY_IFACE (tp_channel_factory_iface_get_type ()) #define TP_CHANNEL_FACTORY_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_CHANNEL_FACTORY_IFACE, TpChannelFactoryIface)) #define TP_IS_CHANNEL_FACTORY_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_CHANNEL_FACTORY_IFACE)) #define TP_CHANNEL_FACTORY_IFACE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_CHANNEL_FACTORY_IFACE, TpChannelFactoryIfaceClass)) /** * TpChannelFactoryIface: * * Opaque typedef representing any channel factory implementation. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ typedef struct _TpChannelFactoryIface TpChannelFactoryIface; /* documented below */ typedef struct _TpChannelFactoryIfaceClass TpChannelFactoryIfaceClass; /** * TpChannelFactoryRequestStatus: * @TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED: Same as the Telepathy * error NotImplemented. The connection will try the next factory in its * list; if all return this, the overall result of the request will be * NotImplemented. *@ret and *@error are not set * @TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE: Same as the Telepathy * error NotAvailable. *@ret and *@error are not set * @TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE: Same as the Telepathy * error InvalidHandle. *@ret and *@error are not set * @TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR: An error other than the above. * *@ret is not set, *@error is set * @TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED: A new channel was created * (possibly in response to more than one request). new-channel has already * been emitted and *@ret is set to the new channel. * @TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED: A new channel will be created, * or was created but is not ready yet. Either new-channel or channel-error * will be emitted later. *@ret and *@error are not set. * @TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING: An existing channel * satisfies the request: new-channel was not emitted. *@ret is set to the * existing channel. * * Indicates the result of a channel request. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ typedef enum { /*< skip >*/ TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED = 0, TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE, TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE, TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED, TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED, TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING } TpChannelFactoryRequestStatus; /** * TpChannelFactoryIfaceProc: * @self: An object implementing #TpChannelFactoryIface * * A virtual method on a channel factory that takes no extra parameters * and returns nothing. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ typedef void (*TpChannelFactoryIfaceProc) (TpChannelFactoryIface *self); /** * TpChannelFactoryIfaceRequestImpl: * @self: An object implementing #TpChannelFactoryIface * @chan_type: The channel type, e.g. %TP_IFACE_CHANNEL_TYPE_TEXT * @handle_type: The handle type of the channel's associated handle, * or 0 if the channel has no associated handle * @handle: The channel's associated handle, of type @handle_type, * or 0 if the channel has no associated handle * @request: An opaque data structure representing the channel request; * if this request is satisfied by a newly created channel, * this structure MUST be included in the new-channel signal * if the newly created channel has handle 0, and MAY be * included in the signal if the newly created channel has * nonzero handle. * @ret: Set to the new channel if it is available immediately, as * documented in the description of #TpChannelFactoryRequestStatus * @error: Set to the error if the return is * %TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR, unset otherwise * * Signature of an implementation of RequestChannel. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 * * Returns: one of the values of #TpChannelFactoryRequestStatus, and * behaves as documented for that return value */ typedef TpChannelFactoryRequestStatus (*TpChannelFactoryIfaceRequestImpl) ( TpChannelFactoryIface *self, const gchar *chan_type, TpHandleType handle_type, guint handle, gpointer request, TpChannelIface **ret, GError **error); /** * TpChannelFactoryIfaceForeachImpl: * @self: An object implementing #TpChannelFactoryIface * @func: A function * @data: Arbitrary data to pass to @func as the second argument * * Signature of an implementation of foreach, which must call * func(channel, data) for each channel managed by this factory. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ typedef void (*TpChannelFactoryIfaceForeachImpl) (TpChannelFactoryIface *self, TpChannelFunc func, gpointer data); /** * TpChannelFactoryIfaceClass: * @parent_class: Fields shared with GTypeInterface * @close_all: Close all channels and shut down the channel factory. It is not * expected to be usable afterwards. This is called when the connection goes * to disconnected state, before emitting the StatusChanged signal or calling * disconnected(). Must be filled in by implementations. * @connecting: Called just after the connection goes from disconnected to * connecting state. May be NULL if nothing special needs to happen. * @connected: Called just after the connection goes from connecting to * connected state. May be NULL if nothing special needs to happen. * @disconnected: Called just after the connection goes to disconnected state. * This is always called after @close_all. May be NULL if nothing special * needs to happen. * @foreach: Call func(channel, data) for each channel managed by this * factory. Must be filled in by implementations. * @request: Respond to a request for a channel. Must be filled in by * implementations. See #TpChannelFactoryIfaceRequestImpl for details. * * The class structure and vtable for a channel factory implementation. * * Deprecated since version 0.11.7. Use #TpChannelManager instead. * * Deprecated: 0.11.7 */ struct _TpChannelFactoryIfaceClass { GTypeInterface parent_class; TpChannelFactoryIfaceProc close_all; TpChannelFactoryIfaceProc connecting; TpChannelFactoryIfaceProc connected; TpChannelFactoryIfaceProc disconnected; TpChannelFactoryIfaceForeachImpl foreach; TpChannelFactoryIfaceRequestImpl request; } _TP_GNUC_DEPRECATED; GType tp_channel_factory_iface_get_type (void); _TP_DEPRECATED void tp_channel_factory_iface_close_all (TpChannelFactoryIface *self); _TP_DEPRECATED void tp_channel_factory_iface_connecting (TpChannelFactoryIface *self); _TP_DEPRECATED void tp_channel_factory_iface_connected (TpChannelFactoryIface *self); _TP_DEPRECATED void tp_channel_factory_iface_disconnected (TpChannelFactoryIface *self); _TP_DEPRECATED void tp_channel_factory_iface_foreach (TpChannelFactoryIface *self, TpChannelFunc func, gpointer data); _TP_DEPRECATED TpChannelFactoryRequestStatus tp_channel_factory_iface_request ( TpChannelFactoryIface *self, const gchar *chan_type, TpHandleType handle_type, guint handle, gpointer request, TpChannelIface **ret, GError **error); _TP_DEPRECATED void tp_channel_factory_iface_emit_new_channel (gpointer instance, TpChannelIface *channel, gpointer request); _TP_DEPRECATED void tp_channel_factory_iface_emit_channel_error (gpointer instance, TpChannelIface *channel, GError *error, gpointer request); #endif /* not TP_DISABLE_DEPRECATED */ G_END_DECLS #endif /* __TP_CHANNEL_FACTORY_IFACE_H__ */ telepathy-glib-0.24.2/telepathy-glib/genums.c.template0000644000175000017500000000142712652510705017627 00000000000000/*** BEGIN file-header ***/ #include "_gen/genums.h" /*** END file-header ***/ /*** BEGIN file-production ***/ /* enumerations from "@filename@" */ #include "@filename@" /*** END file-production ***/ /*** BEGIN value-header ***/ GType @enum_name@_get_type (void) { static GType etype = 0; if (G_UNLIKELY(etype == 0)) { static const G@Type@Value values[] = { /*** END value-header ***/ /*** BEGIN value-production ***/ { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, /*** END value-production ***/ /*** BEGIN value-tail ***/ { 0, NULL, NULL } }; etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); } return etype; } /*** END value-tail ***/ /*** BEGIN file-tail ***/ /*** END file-tail ***/ telepathy-glib-0.24.2/telepathy-glib/base-password-channel.c0000644000175000017500000005032214004031760020665 00000000000000/* * base-password-channel.c - Source for TpBasePasswordChannel * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-password-channel * @title: TpBasePasswordChannel * @short_description: a simple X-TELEPATHY-PASSWORD channel * * This class implements a SASL Authentication channel with the * X-TELEPATHY-PASSWORD SASL mechanism. Most of the time, you should * not use or instantiate this class directly. It is used by * #TpSimplePasswordManager behind the scenes. In some special * circumstances (e.g. when the authentication channel needs to * implement additional interfaces), it may be necessary to create * your own custom authentication channels instead of letting * #TpSimplePasswordManager create them automatically. In this case, * you should derive your channel from this class and then pass the * channel as an argument to * tp_simple_password_manager_prompt_for_channel_async(). * * Since: 0.13.15 */ /** * TpBasePasswordChannel: * * Data structure representing a channel implementing a SASL Authentication * channel with the X-TELEPATHY-PASSWORD SASL mechanism. * * Since: 0.13.15 */ /** * TpBasePasswordChannelClass: * * The class of a #TpBasePasswordChannel. */ #include "config.h" #include "telepathy-glib/base-password-channel.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_SASL #include "telepathy-glib/debug-internal.h" static void sasl_auth_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpBasePasswordChannel, tp_base_password_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_SERVER_AUTHENTICATION, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_SASL_AUTHENTICATION, sasl_auth_iface_init)); static const gchar *tp_base_password_channel_available_mechanisms[] = { "X-TELEPATHY-PASSWORD", NULL }; /* properties */ enum { PROP_AUTHENTICATION_METHOD = 1, PROP_AVAILABLE_MECHANISMS, PROP_HAS_INITIAL_DATA, PROP_CAN_TRY_AGAIN, PROP_SASL_STATUS, PROP_SASL_ERROR, PROP_SASL_ERROR_DETAILS, PROP_AUTHORIZATION_IDENTITY, PROP_DEFAULT_USERNAME, PROP_DEFAULT_REALM, PROP_MAY_SAVE_RESPONSE, LAST_PROPERTY, }; /* signals */ enum { FINISHED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL] = { 0 }; struct _TpBasePasswordChannelPrivate { TpSASLStatus sasl_status; gchar *sasl_error; /* a{sv} */ GHashTable *sasl_error_details; gchar *authorization_identity; gchar *default_username; gchar *default_realm; GString *password; gboolean may_save_response; }; static GPtrArray * tp_base_password_channel_get_interfaces (TpBaseChannel *base) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( tp_base_password_channel_parent_class)->get_interfaces (base); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION); return interfaces; } static void tp_base_password_channel_init (TpBasePasswordChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_PASSWORD_CHANNEL, TpBasePasswordChannelPrivate); } static void tp_base_password_channel_constructed (GObject *obj) { TpBasePasswordChannel *chan = TP_BASE_PASSWORD_CHANNEL (obj); TpBasePasswordChannelPrivate *priv = chan->priv; TpBaseConnection *base_conn = tp_base_channel_get_connection ( TP_BASE_CHANNEL (obj)); TpHandleRepoIface *contact_handles = tp_base_connection_get_handles ( base_conn, TP_HANDLE_TYPE_CONTACT); if (((GObjectClass *) tp_base_password_channel_parent_class)->constructed != NULL) ((GObjectClass *) tp_base_password_channel_parent_class)->constructed (obj); priv->sasl_error = g_strdup (""); priv->sasl_error_details = tp_asv_new (NULL, NULL); priv->authorization_identity = g_strdup ( tp_handle_inspect (contact_handles, tp_base_connection_get_self_handle (base_conn))); priv->default_username = g_strdup (priv->authorization_identity); priv->default_realm = g_strdup (""); } static void tp_base_password_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBasePasswordChannel *chan = TP_BASE_PASSWORD_CHANNEL (object); TpBasePasswordChannelPrivate *priv = chan->priv; switch (property_id) { case PROP_MAY_SAVE_RESPONSE: priv->may_save_response = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_password_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBasePasswordChannel *chan = TP_BASE_PASSWORD_CHANNEL (object); TpBasePasswordChannelPrivate *priv = chan->priv; switch (property_id) { case PROP_AUTHENTICATION_METHOD: g_value_set_static_string (value, TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION); break; case PROP_AVAILABLE_MECHANISMS: g_value_set_boxed (value, tp_base_password_channel_available_mechanisms); break; case PROP_HAS_INITIAL_DATA: g_value_set_boolean (value, TRUE); break; case PROP_CAN_TRY_AGAIN: g_value_set_boolean (value, FALSE); break; case PROP_SASL_STATUS: g_value_set_uint (value, priv->sasl_status); break; case PROP_SASL_ERROR: g_value_set_string (value, priv->sasl_error); break; case PROP_SASL_ERROR_DETAILS: g_value_set_boxed (value, priv->sasl_error_details); break; case PROP_AUTHORIZATION_IDENTITY: g_value_set_string (value, priv->authorization_identity); break; case PROP_DEFAULT_USERNAME: g_value_set_string (value, priv->default_username); break; case PROP_DEFAULT_REALM: g_value_set_string (value, priv->default_realm); break; case PROP_MAY_SAVE_RESPONSE: g_value_set_boolean (value, priv->may_save_response); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_password_channel_finalize (GObject *object); static void tp_base_password_channel_close (TpBaseChannel *base); static void tp_base_password_channel_fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties); static void tp_base_password_channel_class_init (TpBasePasswordChannelClass *tp_base_password_channel_class) { TpBaseChannelClass *chan_class = TP_BASE_CHANNEL_CLASS ( tp_base_password_channel_class); static TpDBusPropertiesMixinPropImpl server_base_password_props[] = { { "AuthenticationMethod", "authentication-method", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl sasl_auth_props[] = { { "AvailableMechanisms", "available-mechanisms", NULL }, { "HasInitialData", "has-initial-data", NULL }, { "CanTryAgain", "can-try-again", NULL }, { "SASLStatus", "sasl-status", NULL }, { "SASLError", "sasl-error", NULL }, { "SASLErrorDetails", "sasl-error-details", NULL }, { "AuthorizationIdentity", "authorization-identity", NULL }, { "DefaultUsername", "default-username", NULL }, { "DefaultRealm", "default-realm", NULL }, { "MaySaveResponse", "may-save-response", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION, tp_dbus_properties_mixin_getter_gobject_properties, NULL, server_base_password_props, }, { TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, tp_dbus_properties_mixin_getter_gobject_properties, NULL, sasl_auth_props, }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (tp_base_password_channel_class); GParamSpec *param_spec; g_type_class_add_private (tp_base_password_channel_class, sizeof (TpBasePasswordChannelPrivate)); object_class->constructed = tp_base_password_channel_constructed; object_class->set_property = tp_base_password_channel_set_property; object_class->get_property = tp_base_password_channel_get_property; object_class->finalize = tp_base_password_channel_finalize; chan_class->channel_type = TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION; chan_class->target_handle_type = TP_HANDLE_TYPE_NONE; chan_class->get_interfaces = tp_base_password_channel_get_interfaces; chan_class->close = tp_base_password_channel_close; chan_class->fill_immutable_properties = tp_base_password_channel_fill_immutable_properties; param_spec = g_param_spec_string ("authentication-method", "Authentication method", "Interface of authentication method", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AUTHENTICATION_METHOD, param_spec); param_spec = g_param_spec_boxed ("available-mechanisms", "Available authentication mechanisms", "The set of mechanisms the server advertised.", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AVAILABLE_MECHANISMS, param_spec); param_spec = g_param_spec_boolean ("has-initial-data", "Whether the StartMechanismWithData can be called", "Whether the StartMechanismWithData can be called", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HAS_INITIAL_DATA, param_spec); param_spec = g_param_spec_boolean ("can-try-again", "Whether StartMechanism will work in failed state", "Whether StartMechanism will work in failed states", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAN_TRY_AGAIN, param_spec); param_spec = g_param_spec_uint ("sasl-status", "Current status", "The status of the current SASL authentication.", 0, TP_NUM_SASL_STATUSES, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SASL_STATUS, param_spec); param_spec = g_param_spec_string ("sasl-error", "SASL error", "SASL error", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SASL_ERROR, param_spec); param_spec = g_param_spec_boxed ("sasl-error-details", "SASL error details", "SASL error details", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SASL_ERROR_DETAILS, param_spec); param_spec = g_param_spec_string ("authorization-identity", "base_password identity", "Authorization identity", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_AUTHORIZATION_IDENTITY, param_spec); param_spec = g_param_spec_string ("default-username", "default username", "DefaultUsername", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DEFAULT_USERNAME, param_spec); param_spec = g_param_spec_string ("default-realm", "default realm", "DefaultRealm", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DEFAULT_REALM, param_spec); param_spec = g_param_spec_boolean ("may-save-response", "Whether the client may save the authentication response", "Whether the client may save the authentication response", TRUE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MAY_SAVE_RESPONSE, param_spec); /** * TpBasePasswordChannel::finished: * @self: the #TpBasePasswordChannel * @password: the password provided by the user, or %NULL if the * authentication has been aborted * @domain: domain of a #GError indicating why the authentication has been * aborted, or 0 * @code: error code of a #GError indicating why the authentication has been * aborted, or 0 * @message: a message associated with the error, or %NULL * * Emitted when either the password has been provided by the user or the * authentication has been aborted. * * Since: 0.13.15 */ signals[FINISHED] = g_signal_new ("finished", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 4, G_TYPE_GSTRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); tp_base_password_channel_class->properties_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBasePasswordChannelClass, properties_class)); } static void tp_base_password_channel_finalize (GObject *object) { TpBasePasswordChannel *self = TP_BASE_PASSWORD_CHANNEL (object); TpBasePasswordChannelPrivate *priv = self->priv; tp_clear_pointer (&priv->sasl_error_details, g_hash_table_unref); tp_clear_pointer (&priv->sasl_error, g_free); tp_clear_pointer (&priv->authorization_identity, g_free); tp_clear_pointer (&priv->default_username, g_free); tp_clear_pointer (&priv->default_realm, g_free); if (priv->password != NULL) { g_string_free (priv->password, TRUE); priv->password = NULL; } if (G_OBJECT_CLASS (tp_base_password_channel_parent_class)->finalize != NULL) G_OBJECT_CLASS (tp_base_password_channel_parent_class)->finalize (object); } static void tp_base_password_channel_change_status (TpBasePasswordChannel *channel, TpSASLStatus new_status, const gchar *new_sasl_error) { TpBasePasswordChannelPrivate *priv = channel->priv; priv->sasl_status = new_status; g_free (priv->sasl_error); priv->sasl_error = g_strdup (new_sasl_error); tp_svc_channel_interface_sasl_authentication_emit_sasl_status_changed ( channel, priv->sasl_status, priv->sasl_error, priv->sasl_error_details); } static void tp_base_password_channel_close (TpBaseChannel *base) { TpBasePasswordChannel *self = TP_BASE_PASSWORD_CHANNEL (base); TpBasePasswordChannelPrivate *priv = self->priv; DEBUG ("Called on %p", base); if (tp_base_channel_is_destroyed (base)) return; if (priv->sasl_status != TP_SASL_STATUS_SUCCEEDED && priv->sasl_status != TP_SASL_STATUS_SERVER_FAILED && priv->sasl_status != TP_SASL_STATUS_CLIENT_FAILED) { tp_base_password_channel_change_status (self, TP_SASL_STATUS_CLIENT_FAILED, TP_ERROR_STR_CANCELLED); g_signal_emit (self, signals[FINISHED], 0, NULL, TP_ERROR, TP_ERROR_CANCELLED, "BasePassword channel was closed"); } DEBUG ("Closing channel"); tp_base_channel_destroyed (base); } static void tp_base_password_channel_fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( tp_base_password_channel_parent_class); klass->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_TYPE_SERVER_AUTHENTICATION, "AuthenticationMethod", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "AvailableMechanisms", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "HasInitialData", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "CanTryAgain", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "AuthorizationIdentity", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "DefaultUsername", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "DefaultRealm", TP_IFACE_CHANNEL_INTERFACE_SASL_AUTHENTICATION, "MaySaveResponse", NULL); } static void tp_base_password_channel_start_mechanism_with_data ( TpSvcChannelInterfaceSASLAuthentication *self, const gchar *mechanism, const GArray *initial_data, DBusGMethodInvocation *context) { TpBasePasswordChannel *channel = TP_BASE_PASSWORD_CHANNEL (self); TpBasePasswordChannelPrivate *priv = channel->priv; GError *error = NULL; if (!tp_strv_contains ( tp_base_password_channel_available_mechanisms, mechanism)) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "The mechanism %s is not implemented", mechanism); goto error; } if (priv->sasl_status != TP_SASL_STATUS_NOT_STARTED) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "StartMechanismWithData cannot be called in state %u", priv->sasl_status); goto error; } if (initial_data->len == 0) { error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No initial data given"); goto error; } tp_base_password_channel_change_status (channel, TP_SASL_STATUS_IN_PROGRESS, ""); priv->password = g_string_new_len ( initial_data->data, initial_data->len); tp_base_password_channel_change_status (channel, TP_SASL_STATUS_SERVER_SUCCEEDED, ""); tp_svc_channel_interface_sasl_authentication_return_from_start_mechanism_with_data ( context); return; error: DEBUG ("%s", error->message); dbus_g_method_return_error (context, error); g_error_free (error); } static void tp_base_password_channel_accept_sasl ( TpSvcChannelInterfaceSASLAuthentication *self, DBusGMethodInvocation *context) { TpBasePasswordChannel *channel = TP_BASE_PASSWORD_CHANNEL (self); TpBasePasswordChannelPrivate *priv = channel->priv; if (priv->sasl_status != TP_SASL_STATUS_SERVER_SUCCEEDED) { GError *error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "AcceptSASL cannot be called in state %u", priv->sasl_status); dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_base_password_channel_change_status (channel, TP_SASL_STATUS_SUCCEEDED, ""); g_signal_emit (channel, signals[FINISHED], 0, priv->password, 0, 0, NULL); tp_svc_channel_interface_sasl_authentication_return_from_accept_sasl ( context); } static void tp_base_password_channel_abort_sasl ( TpSvcChannelInterfaceSASLAuthentication *self, TpSASLAbortReason reason, const gchar *debug_message, DBusGMethodInvocation *context) { TpBasePasswordChannel *channel = TP_BASE_PASSWORD_CHANNEL (self); TpBasePasswordChannelPrivate *priv = channel->priv; if (priv->sasl_status == TP_SASL_STATUS_SERVER_SUCCEEDED || priv->sasl_status == TP_SASL_STATUS_CLIENT_ACCEPTED) { GError *error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "AbortSASL cannot be called in state %u", priv->sasl_status); dbus_g_method_return_error (context, error); g_error_free (error); return; } if (priv->sasl_status != TP_SASL_STATUS_CLIENT_FAILED && priv->sasl_status != TP_SASL_STATUS_SERVER_FAILED) { DEBUG ("Aborting SASL because: %s", debug_message); /* we don't care about the reason; it'll always be User_Abort * anyway */ tp_asv_set_string (priv->sasl_error_details, "debug-message", debug_message); tp_base_password_channel_change_status (channel, TP_SASL_STATUS_CLIENT_FAILED, TP_ERROR_STR_CANCELLED); g_signal_emit (channel, signals[FINISHED], 0, NULL, TP_ERROR, TP_ERROR_CANCELLED, "AbortSASL was called"); } tp_svc_channel_interface_sasl_authentication_return_from_abort_sasl ( context); } static void sasl_auth_iface_init (gpointer g_iface, gpointer iface_data) { #define IMPLEMENT(x) tp_svc_channel_interface_sasl_authentication_implement_##x (\ g_iface, tp_base_password_channel_##x) IMPLEMENT(start_mechanism_with_data); IMPLEMENT(accept_sasl); IMPLEMENT(abort_sasl); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/base-password-channel.h0000644000175000017500000000516412652510705020706 00000000000000/* * base-password-channel.h - Header for TpBasePasswordChannel * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_PASSWORD_CHANNEL_H__ #define __TP_BASE_PASSWORD_CHANNEL_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpBasePasswordChannel TpBasePasswordChannel; typedef struct _TpBasePasswordChannelPrivate TpBasePasswordChannelPrivate; typedef struct _TpBasePasswordChannelClass TpBasePasswordChannelClass; struct _TpBasePasswordChannelClass { TpBaseChannelClass parent_class; TpDBusPropertiesMixinClass properties_class; }; struct _TpBasePasswordChannel { TpBaseChannel parent; TpBasePasswordChannelPrivate *priv; }; GType tp_base_password_channel_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_PASSWORD_CHANNEL \ (tp_base_password_channel_get_type ()) #define TP_BASE_PASSWORD_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_PASSWORD_CHANNEL,\ TpBasePasswordChannel)) #define TP_BASE_PASSWORD_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_PASSWORD_CHANNEL,\ TpBasePasswordChannelClass)) #define TP_IS_BASE_PASSWORD_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_PASSWORD_CHANNEL)) #define TP_IS_BASE_PASSWORD_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_PASSWORD_CHANNEL)) #define TP_BASE_PASSWORD_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_PASSWORD_CHANNEL, \ TpBasePasswordChannelClass)) G_END_DECLS #endif /* #ifndef __TP_BASE_PASSWORD_CHANNEL_H__*/ telepathy-glib-0.24.2/telepathy-glib/svc-connection.h0000644000175000017500000000050412652510705017447 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CONNECTION_H__ #define __TP_META_SVC_CONNECTION_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/contact-list-channel.c0000644000175000017500000003510212652510705020526 00000000000000/* A ContactList channel with handle type LIST or GROUP. * * Copyright © 2009-2010 Collabora Ltd. * Copyright © 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #include #include #include #include #include static void list_channel_iface_init (TpSvcChannelClass *iface); static void group_channel_iface_init (TpSvcChannelClass *iface); static void list_group_iface_init (TpSvcChannelInterfaceGroupClass *iface); static void group_group_iface_init (TpSvcChannelInterfaceGroupClass *iface); /* Abstract base class */ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseContactListChannel, _tp_base_contact_list_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_CONTACT_LIST, NULL); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, NULL)) /* Subclass for handle type LIST */ G_DEFINE_TYPE_WITH_CODE (TpContactListChannel, _tp_contact_list_channel, TP_TYPE_BASE_CONTACT_LIST_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, list_group_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, list_channel_iface_init)) /* Subclass for handle type GROUP */ G_DEFINE_TYPE_WITH_CODE (TpContactGroupChannel, _tp_contact_group_channel, TP_TYPE_BASE_CONTACT_LIST_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, group_group_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, group_channel_iface_init)) static GPtrArray * base_contact_list_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( _tp_base_contact_list_channel_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP); return interfaces; }; enum { PROP_MANAGER = 1, N_PROPS }; static void _tp_base_contact_list_channel_init (TpBaseContactListChannel *self) { } static void _tp_contact_list_channel_init (TpContactListChannel *self) { } static void _tp_contact_group_channel_init (TpContactGroupChannel *self) { } static void tp_base_contact_list_channel_constructed (GObject *object) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); TpBaseChannel *base = (TpBaseChannel *) self; TpBaseConnection *conn = tp_base_channel_get_connection (base); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); void (*chain_up) (GObject *) = ((GObjectClass *) _tp_base_contact_list_channel_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (TP_IS_BASE_CONTACT_LIST (self->manager)); tp_base_channel_register (base); tp_group_mixin_init (object, G_STRUCT_OFFSET (TpBaseContactListChannel, group), contact_repo, tp_base_connection_get_self_handle (conn)); /* Both the subclasses have full support for telepathy-spec 0.17.6. */ tp_group_mixin_change_flags (object, TP_CHANNEL_GROUP_FLAG_PROPERTIES, 0); } static void tp_contact_list_channel_constructed (GObject *object) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); void (*chain_up) (GObject *) = ((GObjectClass *) _tp_contact_list_channel_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_group_mixin_change_flags (object, _tp_base_contact_list_get_list_flags (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self)), 0); } static void tp_contact_group_channel_constructed (GObject *object) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); void (*chain_up) (GObject *) = ((GObjectClass *) _tp_contact_group_channel_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_group_mixin_change_flags (object, _tp_base_contact_list_get_group_flags (self->manager), 0); } static void tp_base_contact_list_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); switch (property_id) { case PROP_MANAGER: g_value_set_object (value, self->manager); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_contact_list_channel_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); switch (property_id) { case PROP_MANAGER: g_assert (self->manager == NULL); /* construct-only */ self->manager = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } void _tp_base_contact_list_channel_close (TpBaseContactListChannel *self) { if (self->manager == NULL) return; tp_clear_object (&self->manager); tp_group_mixin_finalize ((GObject *) self); tp_base_channel_destroyed ((TpBaseChannel *) self); } static void tp_base_contact_list_channel_dispose (GObject *object) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (_tp_base_contact_list_channel_parent_class)->dispose; _tp_base_contact_list_channel_close (self); if (dispose != NULL) dispose (object); } static gboolean tp_base_contact_list_channel_check_still_usable ( TpBaseContactListChannel *self, DBusGMethodInvocation *context) { if (self->manager == NULL) { GError e = { TP_ERROR, TP_ERROR_TERMINATED, "Channel already closed" }; dbus_g_method_return_error (context, &e); return FALSE; } return TRUE; } static gboolean group_add_member (GObject *object, TpHandle handle, const gchar *message, GError **error) { /* We don't use this: it's synchronous */ g_return_val_if_reached (FALSE); } static gboolean group_remove_member (GObject *object, TpHandle handle, const gchar *message, GError **error) { /* We don't use this: it's synchronous */ g_return_val_if_reached (FALSE); } static gboolean list_add_member (GObject *object, TpHandle handle, const gchar *message, GError **error) { /* We don't use this: it's synchronous */ g_return_val_if_reached (FALSE); } static gboolean list_remove_member (GObject *object, TpHandle handle, const gchar *message, GError **error) { /* We don't use this: it's synchronous */ g_return_val_if_reached (FALSE); } /* We don't use this: #TpBaseChannelClass.close doesn't allow us to fail to * close, which is a quirk of the old ContactList design, so subclasses must * IMPLEMENT (close) manually. */ static void stub_close (TpBaseChannel *channel G_GNUC_UNUSED) { g_return_if_reached (); } static void _tp_base_contact_list_channel_class_init (TpBaseContactListChannelClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; TpBaseChannelClass *base_class = (TpBaseChannelClass *) cls; object_class->constructed = tp_base_contact_list_channel_constructed; object_class->set_property = tp_base_contact_list_channel_set_property; object_class->get_property = tp_base_contact_list_channel_get_property; object_class->dispose = tp_base_contact_list_channel_dispose; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_CONTACT_LIST; base_class->target_handle_type = 0; /* placeholder, set in subclass */ base_class->get_interfaces = base_contact_list_get_interfaces; base_class->close = stub_close; /* placeholder, not called */ g_object_class_install_property (object_class, PROP_MANAGER, g_param_spec_object ("manager", "TpBaseContactList", "TpBaseContactList object that owns this channel", TP_TYPE_BASE_CONTACT_LIST, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* Group mixin is initialized separately for each subclass - they have * different callbacks */ } static void _tp_contact_list_channel_class_init (TpContactListChannelClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; TpBaseChannelClass *base_class = (TpBaseChannelClass *) cls; object_class->constructed = tp_contact_list_channel_constructed; base_class->target_handle_type = TP_HANDLE_TYPE_LIST; tp_group_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseContactListChannelClass, group_class), list_add_member, list_remove_member); tp_group_mixin_init_dbus_properties (object_class); } static void _tp_contact_group_channel_class_init (TpContactGroupChannelClass *cls) { GObjectClass *object_class = (GObjectClass *) cls; TpBaseChannelClass *base_class = (TpBaseChannelClass *) cls; object_class->constructed = tp_contact_group_channel_constructed; base_class->target_handle_type = TP_HANDLE_TYPE_GROUP; tp_group_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseContactListChannelClass, group_class), group_add_member, group_remove_member); tp_group_mixin_init_dbus_properties (object_class); } static void list_channel_close (TpSvcChannel *iface G_GNUC_UNUSED, DBusGMethodInvocation *context) { GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "ContactList channels with handle type LIST may not be closed" }; dbus_g_method_return_error (context, &e); } static void group_channel_close (TpSvcChannel *iface, DBusGMethodInvocation *context) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (iface); GError *error = NULL; if (!tp_base_contact_list_channel_check_still_usable (self, context)) return; if (tp_handle_set_size (self->group.members) > 0) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Non-empty groups may not be deleted (closed)"); goto error; } if (!_tp_base_contact_list_delete_group_by_handle (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self), &error)) goto error; tp_svc_channel_return_from_close (context); return; error: dbus_g_method_return_error (context, error); g_clear_error (&error); } static void list_channel_iface_init (TpSvcChannelClass *iface) { #define IMPLEMENT(x) tp_svc_channel_implement_##x (iface, list_channel_##x) IMPLEMENT (close); #undef IMPLEMENT } static void group_channel_iface_init (TpSvcChannelClass *iface) { #define IMPLEMENT(x) tp_svc_channel_implement_##x (iface, group_channel_##x) IMPLEMENT (close); #undef IMPLEMENT } static void list_group_add_members (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (iface); if (tp_base_contact_list_channel_check_still_usable (self, context)) _tp_base_contact_list_add_to_list (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self), contacts, message, context); } static void list_group_remove_members_with_reason (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, guint reason, DBusGMethodInvocation *context) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (iface); if (tp_base_contact_list_channel_check_still_usable (self, context)) _tp_base_contact_list_remove_from_list (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self), contacts, message, reason, context); } static void list_group_remove_members (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { /* also returns void, so this is OK */ list_group_remove_members_with_reason (iface, contacts, message, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, context); } static void list_group_iface_init (TpSvcChannelInterfaceGroupClass *iface) { tp_group_mixin_iface_init (iface, NULL); #define IMPLEMENT(x) tp_svc_channel_interface_group_implement_##x (iface, \ list_group_##x) IMPLEMENT (add_members); IMPLEMENT (remove_members); IMPLEMENT (remove_members_with_reason); #undef IMPLEMENT } static void group_group_add_members (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (iface); if (tp_base_contact_list_channel_check_still_usable (self, context)) _tp_base_contact_list_add_to_group (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self), contacts, message, context); } static void group_group_remove_members_with_reason (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, guint reason, DBusGMethodInvocation *context) { TpBaseContactListChannel *self = TP_BASE_CONTACT_LIST_CHANNEL (iface); if (tp_base_contact_list_channel_check_still_usable (self, context)) _tp_base_contact_list_remove_from_group (self->manager, tp_base_channel_get_target_handle ((TpBaseChannel *) self), contacts, message, reason, context); } static void group_group_remove_members (TpSvcChannelInterfaceGroup *iface, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { /* also returns void, so this is OK */ group_group_remove_members_with_reason (iface, contacts, message, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, context); } static void group_group_iface_init (TpSvcChannelInterfaceGroupClass *iface) { tp_group_mixin_iface_init (iface, NULL); #define IMPLEMENT(x) tp_svc_channel_interface_group_implement_##x (iface, \ group_group_##x) IMPLEMENT (add_members); IMPLEMENT (remove_members); IMPLEMENT (remove_members_with_reason); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/base-client.c0000644000175000017500000032066112652510705016711 00000000000000/* * Base class for Client implementations * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-client * @title: TpBaseClient * @short_description: base class for Telepathy clients on D-Bus * * This base class makes it easier to write #TpSvcClient * implementations. Subclasses should usually pass the filters they * want and override the D-Bus methods they implement. * * For many applications, the provided #TpSimpleObserver, #TpSimpleApprover * and #TpSimpleHandler subclasses can be used instead of deriving from this * class. */ /** * TpBaseClient: * * Data structure representing a generic #TpSvcClient implementation. * * Since: 0.11.5 */ /** * TpBaseClientClass: * @parent_class: the parent class * @observe_channels: the function called to observe newly-created channels * matching this client's observer filter (since 0.11.13) * @add_dispatch_operation: the function called to request user approval of * unrequested (incoming) channels matching this client's approver filter * (since 0.11.13) * @handle_channels: the function called to handle channels matching this * client's handler filter (since 0.11.13) * * The class of a #TpBaseClient. * * The virtual methods @observe_channels, @add_dispatch_operation and * @handle_channels can be also implemented by calling * tp_base_client_implement_observe_channels(), * tp_base_client_implement_add_dispatch_operation() and * tp_base_client_implement_handle_channels(). This is compatible with * telepathy-glib versions older than 0.11.13. * * Since: 0.11.5 */ /** * TpBaseClientClassObserveChannelsImpl: * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or * tp_simple_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), * or tp_simple_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or * tp_simple_client_factory_add_channel_features(), prepared if possible * @dispatch_operation: (allow-none): a #TpChannelDispatchOperation or %NULL; * the dispatch_operation is not guaranteed to be prepared * @requests: (element-type TelepathyGLib.ChannelRequest): a #GList of * #TpChannelRequest having their object-path defined but are not guaranteed * to be prepared. * @context: a #TpObserveChannelsContext representing the context of this * D-Bus call * * Signature of the implementation of the ObserveChannels method. * * This function must call either tp_observe_channels_context_accept(), * tp_observe_channels_context_delay() or tp_observe_channels_context_fail() * on @context before it returns. * * Since: 0.11.5 */ /** * TpBaseClientClassAddDispatchOperationImpl: * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or * tp_simple_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), * or tp_simple_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or * tp_simple_client_factory_add_channel_features(), prepared if possible * @dispatch_operation: a #TpChannelDispatchOperation having * %TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE prepared if possible * @context: a #TpObserveChannelsContext representing the context of this * D-Bus call * * Signature of the implementation of the AddDispatchOperation method. * * This function must call either tp_add_dispatch_operation_context_accept(), * tp_add_dispatch_operation_context_delay() or * tp_add_dispatch_operation_context_fail() on @context before it returns. * * The implementation can then use * tp_channel_dispatch_operation_handle_with_async() to approve handling of the * channels, or tp_channel_dispatch_operation_claim_async() to take * responsibility for handling or closing them". * * Since: 0.11.5 */ /** * TpBaseClientClassHandleChannelsImpl: * @client: a #TpBaseClient instance * @account: a #TpAccount with %TP_ACCOUNT_FEATURE_CORE, and any other * features added via tp_base_client_add_account_features() or * tp_simple_client_factory_add_account_features(), prepared if * possible * @connection: a #TpConnection with %TP_CONNECTION_FEATURE_CORE, * and any other features added via tp_base_client_add_connection_features(), * or tp_simple_client_factory_add_connection_features(), prepared if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * each with %TP_CHANNEL_FEATURE_CORE, and any other features added via * tp_base_client_add_channel_features() or * tp_simple_client_factory_add_channel_features(), prepared if possible * @requests_satisfied: (element-type TelepathyGLib.ChannelRequest): a #GList of * #TpChannelRequest having their object-path defined but are not guaranteed * to be prepared. * @user_action_time: the time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME * (see #TpAccountChannelRequest:user-action-time for details) * @context: a #TpHandleChannelsContext representing the context of this * D-Bus call * * Signature of the implementation of the HandleChannels method. * * This function must call either tp_handle_channels_context_accept(), * tp_handle_channels_context_delay() or tp_handle_channels_context_fail() * on @context before it returns. * * Since: 0.11.6 */ /** * TpBaseClientDelegatedChannelsCb: * @client: a #TpBaseClient instance * @channels: (element-type TelepathyGLib.Channel): a #GPtrArray of #TpChannel * @user_data: arbitrary user-supplied data passed to * tp_base_client_set_delegated_channels_callback() * * Called when a client asked us to delegate @channels to another Handler. * When this function is called @client is not longer handling @channels. * * Since: 0.15.3 */ #include "config.h" #include "telepathy-glib/base-client.h" #include "telepathy-glib/base-client-internal.h" #include #include /* for G_VA_COPY */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" static void observer_iface_init (gpointer, gpointer); static void approver_iface_init (gpointer, gpointer); static void handler_iface_init (gpointer, gpointer); static void requests_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TpBaseClient, tp_base_client, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CLIENT, NULL); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CLIENT_OBSERVER, observer_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CLIENT_APPROVER, approver_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CLIENT_HANDLER, handler_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CLIENT_INTERFACE_REQUESTS, requests_iface_init)) enum { PROP_DBUS_DAEMON = 1, PROP_ACCOUNT_MANAGER, PROP_FACTORY, PROP_NAME, PROP_UNIQUIFY_NAME, PROP_CHANNEL_FACTORY, N_PROPS }; enum { SIGNAL_REQUEST_ADDED, SIGNAL_REQUEST_REMOVED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; static dbus_int32_t clients_slot = -1; typedef enum { CLIENT_IS_OBSERVER = 1 << 0, CLIENT_IS_APPROVER = 1 << 1, CLIENT_IS_HANDLER = 1 << 2, CLIENT_HANDLER_WANTS_REQUESTS = 1 << 3, CLIENT_HANDLER_BYPASSES_APPROVAL = 1 << 4, CLIENT_OBSERVER_RECOVER = 1 << 5, CLIENT_OBSERVER_DELAYS_APPROVERS = 1 << 6, } ClientFlags; struct _TpBaseClientPrivate { TpSimpleClientFactory *factory; TpDBusDaemon *dbus; gchar *name; gboolean uniquify_name; /* reffed */ DBusConnection *libdbus; gboolean registered; ClientFlags flags; /* array of TP_HASH_TYPE_CHANNEL_CLASS */ GPtrArray *observer_filters; /* array of TP_HASH_TYPE_CHANNEL_CLASS */ GPtrArray *approver_filters; /* array of TP_HASH_TYPE_CHANNEL_CLASS */ GPtrArray *handler_filters; /* array of g_strdup(token), plus NULL included in length */ GPtrArray *handler_caps; GList *pending_requests; /* Channels actually handled by THIS observer. * borrowed path (gchar *) => reffed TpChannel */ GHashTable *my_chans; gchar *bus_name; gchar *object_path; TpAccountManager *account_mgr; TpAccount *only_for_account; TpClientChannelFactory *channel_factory; /* array of GQuark or NULL */ GArray *account_features; GArray *connection_features; GArray *channel_features; TpBaseClientDelegatedChannelsCb delegated_channels_cb; gpointer delegated_channels_data; GDestroyNotify delegated_channels_destroy; }; /* * _tp_base_client_set_only_for_account: * * Set the account to be used for this TpBaseClient. Channels from any other * account will be rejected. * * This is for internal use by TpAccountChannelRequest, which sets up a * temporary Handler solely to be the preferred handler for that request. * See https://bugs.freedesktop.org/show_bug.cgi?id=29614 */ void _tp_base_client_set_only_for_account (TpBaseClient *self, TpAccount *account) { g_return_if_fail (self->priv->only_for_account == NULL); g_return_if_fail (tp_proxy_get_factory (account) == self->priv->factory); self->priv->only_for_account = g_object_ref (account); } static TpAccount * tp_base_client_dup_account (TpBaseClient *self, const gchar *path, GError **error) { if (self->priv->only_for_account != NULL) { if (G_UNLIKELY (tp_strdiff (tp_proxy_get_object_path ( self->priv->only_for_account), path))) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "This client only deals with channels from account %s", tp_proxy_get_object_path (self->priv->only_for_account)); return NULL; } return g_object_ref (self->priv->only_for_account); } return tp_simple_client_factory_ensure_account (self->priv->factory, path, NULL, error); } static GHashTable * _tp_base_client_copy_filter (GHashTable *filter) { GHashTable *copy; copy = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (copy, filter, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); return copy; } /** * tp_base_client_add_observer_filter: * @self: a #TpBaseClient * @filter: (transfer none) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS * * Register a new channel class as Observer.ObserverChannelFilter. * The #TpBaseClientClass.observe_channels virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.observe_channels. * * Since: 0.11.5 */ void tp_base_client_add_observer_filter (TpBaseClient *self, GHashTable *filter) { g_return_if_fail (filter != NULL); tp_base_client_take_observer_filter (self, _tp_base_client_copy_filter (filter)); } /** * tp_base_client_take_observer_filter: (skip) * @self: a client * @filter: (transfer full) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self * * The same as tp_base_client_add_observer_filter(), but ownership of @filter * is taken by @self. This makes it convenient to call using tp_asv_new(): * * |[ * tp_base_client_take_observer_filter (client, * tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, * TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, * TP_HANDLE_TYPE_CONTACT, * ...)); * ]| * * Since: 0.11.5 */ void tp_base_client_take_observer_filter (TpBaseClient *self, GHashTable *filter) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channels != NULL); self->priv->flags |= CLIENT_IS_OBSERVER; g_ptr_array_add (self->priv->observer_filters, filter); } /** * tp_base_client_add_observer_filter_vardict: * @self: a client * @filter: (transfer none): a variant of type %G_VARIANT_TYPE_VARDICT * * Register a new channel class as Observer.ObserverChannelFilter. * The #TpBaseClientClass.observe_channels virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.observe_channels. * * If the variant is floating (see g_variant_ref_sink()), ownership * will be taken, allowing for uses like this: * * |[ * tp_base_client_add_observer_filter_vardict (client, * g_variant_new_parsed ("{ %s: <%s>, %s: <%u>, ... }", * TP_PROP_CHANNEL_CHANNEL_TYPE, TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, (guint32) TP_HANDLE_TYPE_CONTACT, * ...)); * ]| * * Since: 0.19.10 */ void tp_base_client_add_observer_filter_vardict (TpBaseClient *self, GVariant *filter) { g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); g_variant_ref_sink (filter); tp_base_client_take_observer_filter (self, _tp_asv_from_vardict (filter)); g_variant_unref (filter); } /** * tp_base_client_set_observer_recover: * @self: a #TpBaseClient * @recover: the value of the Observer.Recover property * * Set whether the channel dispatcher should attempt to recover * this Observer if it crashes. (This is implemented by setting * the value of its Recover D-Bus property.) * * Normally, Observers are only notified when new channels * appear. If an Observer is set to recover, when it registers with * tp_base_client_register(), it will also be told about any channels * that already existed before it started. * * For Observers that are activatable as a D-Bus service, if the * Observer exits or crashes while there are any channels that match * its filter, it will automatically be restarted by service-activation. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.observe_channels. * * Since: 0.11.5 */ void tp_base_client_set_observer_recover (TpBaseClient *self, gboolean recover) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channels != NULL); if (recover) { self->priv->flags |= (CLIENT_IS_OBSERVER | CLIENT_OBSERVER_RECOVER); } else { self->priv->flags |= CLIENT_IS_OBSERVER; self->priv->flags &= ~CLIENT_OBSERVER_RECOVER; } } /** * tp_base_client_set_observer_delay_approvers: * @self: a #TpBaseClient * @delay: the value of the Observer.DelayApprovers property * * Set whether the channel dispatcher should wait for * tp_observe_channels_context_accept() or tp_observe_channels_context_fail() * to be called before calling * #TpBaseClientClass.add_dispatch_operation on appropriate Approvers. * * This is implemented by setting the value of the DelayApprovers * D-Bus property. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.observe_channels. * * Since: 0.13.16 */ void tp_base_client_set_observer_delay_approvers (TpBaseClient *self, gboolean delay) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->observe_channels != NULL); if (delay) { self->priv->flags |= (CLIENT_IS_OBSERVER | CLIENT_OBSERVER_DELAYS_APPROVERS); } else { self->priv->flags |= CLIENT_IS_OBSERVER; self->priv->flags &= ~CLIENT_OBSERVER_DELAYS_APPROVERS; } } /** * tp_base_client_add_approver_filter: * @self: a #TpBaseClient * @filter: (transfer none) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS * * Register a new channel class as Approver.ApproverChannelFilter. * The #TpBaseClientClass.add_dispatch_operation virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.add_dispatch_operation. * * Since: 0.11.5 */ void tp_base_client_add_approver_filter (TpBaseClient *self, GHashTable *filter) { g_return_if_fail (filter != NULL); tp_base_client_take_approver_filter (self, _tp_base_client_copy_filter (filter)); } /** * tp_base_client_take_approver_filter: (skip) * @self: a client * @filter: (transfer full) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self * * The same as tp_base_client_add_approver_filter(), but ownership of @filter * is taken by @self. This makes it convenient to call using tp_asv_new(): * * |[ * tp_base_client_take_approver_filter (client, * tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, * TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, * TP_HANDLE_TYPE_CONTACT, * ...)); * ]| * * Since: 0.11.5 */ void tp_base_client_take_approver_filter (TpBaseClient *self, GHashTable *filter) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->add_dispatch_operation != NULL); self->priv->flags |= CLIENT_IS_APPROVER; g_ptr_array_add (self->priv->approver_filters, filter); } /** * tp_base_client_add_approver_filter_vardict: * @self: a client * @filter: (transfer none): a variant of type %G_VARIANT_TYPE_VARDICT * * Register a new channel class as Approver.ApproverChannelFilter. * The #TpBaseClientClass.add_dispatch_operation virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.add_dispatch_operation. * * If the variant is floating (see g_variant_ref_sink()), ownership * will be taken. See tp_base_client_add_observer_filter_vardict() for * more details. * * Since: 0.19.10 */ void tp_base_client_add_approver_filter_vardict (TpBaseClient *self, GVariant *filter) { g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); g_variant_ref_sink (filter); tp_base_client_take_approver_filter (self, _tp_asv_from_vardict (filter)); g_variant_unref (filter); } /** * tp_base_client_be_a_handler: * @self: a #TpBaseClient * * Register @self as a Client.Handler with an empty list of filters. * This is useful if you want to create a client that only handle channels * for which it's the PreferredHandler. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_be_a_handler (TpBaseClient *self) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channels != NULL); self->priv->flags |= CLIENT_IS_HANDLER; } /** * tp_base_client_add_handler_filter: * @self: a #TpBaseClient * @filter: (transfer none) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS * * Register a new channel class as Handler.HandlerChannelFilter. * The #TpBaseClientClass.handle_channels virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_add_handler_filter (TpBaseClient *self, GHashTable *filter) { g_return_if_fail (filter != NULL); tp_base_client_take_handler_filter (self, _tp_base_client_copy_filter (filter)); } /** * tp_base_client_take_handler_filter: (skip) * @self: a #TpBaseClient * @filter: (transfer full) (element-type utf8 GObject.Value): * a %TP_HASH_TYPE_CHANNEL_CLASS, ownership of which is taken by @self * * The same as tp_base_client_add_handler_filter(), but ownership of @filter * is taken by @self. This makes it convenient to call using tp_asv_new(): * * |[ * tp_base_client_take_handler_filter (client, * tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, * TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, * TP_HANDLE_TYPE_CONTACT, * ...)); * ]| * * Since: 0.11.6 */ void tp_base_client_take_handler_filter (TpBaseClient *self, GHashTable *filter) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channels != NULL); self->priv->flags |= CLIENT_IS_HANDLER; g_ptr_array_add (self->priv->handler_filters, filter); } /** * tp_base_client_add_handler_filter_vardict: * @self: a client * @filter: (transfer none): a variant of type %G_VARIANT_TYPE_VARDICT * * Register a new channel class as Handler.HandlerChannelFilter. * The #TpBaseClientClass.handle_channels virtual method will be called * whenever a new channel's properties match the ones in @filter. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * If the variant is floating (see g_variant_ref_sink()), ownership * will be taken. See tp_base_client_add_observer_filter_vardict() for * more details. * * Since: 0.19.10 */ void tp_base_client_add_handler_filter_vardict (TpBaseClient *self, GVariant *filter) { g_return_if_fail (g_variant_is_of_type (filter, G_VARIANT_TYPE_VARDICT)); g_variant_ref_sink (filter); tp_base_client_take_handler_filter (self, _tp_asv_from_vardict (filter)); g_variant_unref (filter); } /** * tp_base_client_set_handler_bypass_approval: * @self: a #TpBaseClient * @bypass_approval: the value of the Handler.BypassApproval property * * Set whether the channels destined for this handler are automatically * handled, without invoking approvers. * (This is implemented by setting the value of its BypassApproval * D-Bus property.) * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_set_handler_bypass_approval (TpBaseClient *self, gboolean bypass_approval) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channels != NULL); if (bypass_approval) { self->priv->flags |= (CLIENT_IS_HANDLER | CLIENT_HANDLER_BYPASSES_APPROVAL); } else { self->priv->flags |= CLIENT_IS_HANDLER; self->priv->flags &= ~CLIENT_HANDLER_BYPASSES_APPROVAL; } } /** * tp_base_client_set_handler_request_notification: * @self: a #TpBaseClient * * Indicate that @self is a Handler willing to be notified about requests for * channels that it is likely to be asked to handle. This means that the * #TpBaseClient::request-added and #TpBaseClient::request-removed signals will * be fired and tp_base_client_get_pending_requests() will return the list of * pending requests. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_set_handler_request_notification (TpBaseClient *self) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channels != NULL); self->priv->flags |= (CLIENT_IS_HANDLER | CLIENT_HANDLER_WANTS_REQUESTS); } static void _tp_base_client_add_handler_capability (TpBaseClient *self, const gchar *token) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (cls->handle_channels != NULL); self->priv->flags |= CLIENT_IS_HANDLER; g_assert (g_ptr_array_index (self->priv->handler_caps, self->priv->handler_caps->len - 1) == NULL); g_ptr_array_index (self->priv->handler_caps, self->priv->handler_caps->len - 1) = g_strdup (token); g_ptr_array_add (self->priv->handler_caps, NULL); } /** * tp_base_client_add_handler_capability: * @self: a client, which must not have been registered with * tp_base_client_register() yet * @token: a capability token as defined by the Telepathy D-Bus API * Specification * * Add one capability token to this client, as if via * tp_base_client_add_handler_capabilities(). * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_add_handler_capability (TpBaseClient *self, const gchar *token) { TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (cls->handle_channels != NULL); _tp_base_client_add_handler_capability (self, token); } /** * tp_base_client_add_handler_capabilities: * @self: a client, which must not have been registered with * tp_base_client_register() yet * @tokens: (array zero-terminated=1) (element-type utf8): capability * tokens as defined by the Telepathy D-Bus API Specification * * Add several capability tokens to this client. These are used to signal * that Telepathy connection managers should advertise certain capabilities * to other contacts, such as the ability to receive audio/video calls using * particular streaming protocols and codecs. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_add_handler_capabilities (TpBaseClient *self, const gchar * const *tokens) { const gchar * const *iter; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); if (tokens == NULL) return; for (iter = tokens; *iter != NULL; iter++) _tp_base_client_add_handler_capability (self, *iter); } /** * tp_base_client_add_handler_capabilities_varargs: (skip) * @self: a client, which must not have been registered with * tp_base_client_register() yet * @first_token: a capability token from the Telepathy D-Bus API Specification * @...: more tokens, ending with %NULL * * Convenience C API equivalent to calling * tp_base_client_add_handler_capability() for each capability token. * * This method may only be called before tp_base_client_register() is * called, and may only be called on objects whose class implements * #TpBaseClientClass.handle_channels. * * Since: 0.11.6 */ void tp_base_client_add_handler_capabilities_varargs (TpBaseClient *self, const gchar *first_token, ...) { va_list ap; const gchar *token; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); va_start (ap, first_token); for (token = first_token; token != NULL; token = va_arg (ap, gchar *)) _tp_base_client_add_handler_capability (self, token); va_end (ap); } /** * tp_base_client_register: * @self: a #TpBaseClient, which must not have been registered with * tp_base_client_register() yet * @error: used to indicate the error if %FALSE is returned * * Publish @self as an available client. After this method is called, as long * as it continues to exist, it will receive and process whatever events were * requested via the various filters. * * Methods that set the filters and other immutable state, such as * tp_base_client_add_observer_filter(), cannot be called after this one. * * Returns: %TRUE if the client was registered successfully * * Since: 0.11.5 */ gboolean tp_base_client_register (TpBaseClient *self, GError **error) { GHashTable *clients; g_return_val_if_fail (TP_IS_BASE_CLIENT (self), FALSE); g_return_val_if_fail (!self->priv->registered, FALSE); /* Client should at least be an Observer, Approver or Handler */ g_return_val_if_fail (self->priv->flags != 0, FALSE); DEBUG ("request name %s", self->priv->bus_name); if (!tp_dbus_daemon_request_name (self->priv->dbus, self->priv->bus_name, TRUE, error)) { DEBUG ("Failed to register bus name %s", self->priv->bus_name); return FALSE; } tp_dbus_daemon_register_object (self->priv->dbus, self->priv->object_path, G_OBJECT (self)); self->priv->registered = TRUE; if (!(self->priv->flags & CLIENT_IS_HANDLER)) return TRUE; /* Client is an handler */ self->priv->libdbus = dbus_connection_ref ( dbus_g_connection_get_connection ( tp_proxy_get_dbus_connection (self->priv->dbus))); /* one ref per TpBaseClient with CLIENT_IS_HANDLER, released * in tp_base_client_unregister() */ if (!dbus_connection_allocate_data_slot (&clients_slot)) ERROR ("Out of memory"); clients = dbus_connection_get_data (self->priv->libdbus, clients_slot); if (clients == NULL) { /* Map DBusConnection to the self->priv->my_chans hash table owned by * the client using this DBusConnection. * borrowed client path => borrowed (GHashTable *) */ clients = g_hash_table_new (g_str_hash, g_str_equal); dbus_connection_set_data (self->priv->libdbus, clients_slot, clients, (DBusFreeFunction) g_hash_table_unref); } g_hash_table_insert (clients, self->priv->object_path, self->priv->my_chans); return TRUE; } /** * tp_base_client_get_pending_requests: * @self: a #TpBaseClient * * Only works if tp_base_client_set_handler_request_notification() has been * called. * Returns the list of requests @self is likely be asked to handle. * * Returns: (transfer container) (element-type TelepathyGLib.ChannelRequest): a * #GList of #TpChannelRequest * * Since: 0.11.6 * Deprecated: Since 0.19.9. New code should use * tp_base_client_dup_pending_requests() instead. */ GList * tp_base_client_get_pending_requests (TpBaseClient *self) { g_return_val_if_fail (self->priv->flags & CLIENT_IS_HANDLER, NULL); return g_list_copy (self->priv->pending_requests); } /** * tp_base_client_get_handled_channels: * @self: a #TpBaseClient * * Returns the set of channels currently handled by this base client or by any * other #TpBaseClient with which it shares a unique name. * * Returns: (transfer container) (element-type TelepathyGLib.Channel): the * handled channels * * Since: 0.11.6 * Deprecated: Since 0.19.9. New code should use * tp_base_client_dup_handled_channels() instead. */ GList * tp_base_client_get_handled_channels (TpBaseClient *self) { GList *result = NULL; GHashTable *clients; GHashTableIter iter; gpointer value; GHashTable *set; g_return_val_if_fail (self->priv->flags & CLIENT_IS_HANDLER, NULL); if (clients_slot == -1) return NULL; set = g_hash_table_new (g_str_hash, g_str_equal); clients = dbus_connection_get_data (self->priv->libdbus, clients_slot); g_hash_table_iter_init (&iter, clients); while (g_hash_table_iter_next (&iter, NULL, &value)) { GHashTable *chans = value; tp_g_hash_table_update (set, chans, NULL, NULL); } result = g_hash_table_get_values (set); g_hash_table_unref (set); return result; } /** * tp_base_client_dup_pending_requests: * @self: a #TpBaseClient * * Only works if tp_base_client_set_handler_request_notification() has been * called. * Returns the list of requests @self is likely be asked to handle. * * Returns: (transfer full) (element-type TelepathyGLib.ChannelRequest): a * #GList of #TpChannelRequest * * Since: 0.19.9 */ GList * tp_base_client_dup_pending_requests (TpBaseClient *self) { g_return_val_if_fail (self->priv->flags & CLIENT_IS_HANDLER, NULL); return _tp_g_list_copy_deep (self->priv->pending_requests, (GCopyFunc) g_object_ref, NULL); } /** * tp_base_client_dup_handled_channels: * @self: a #TpBaseClient * * Returns the set of channels currently handled by this base client or by any * other #TpBaseClient with which it shares a unique name. * * Returns: (transfer full) (element-type TelepathyGLib.Channel): the * handled channels * * Since: 0.19.9 */ GList * tp_base_client_dup_handled_channels (TpBaseClient *self) { GList *ret; G_GNUC_BEGIN_IGNORE_DEPRECATIONS ret = tp_base_client_get_handled_channels (self); G_GNUC_END_IGNORE_DEPRECATIONS g_list_foreach (ret, (GFunc) g_object_ref, NULL); return ret; } static void tp_base_client_init (TpBaseClient *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CLIENT, TpBaseClientPrivate); /* wild guess: most clients won't need more than one of each filter */ self->priv->observer_filters = g_ptr_array_new_with_free_func ( (GDestroyNotify) g_hash_table_unref); self->priv->approver_filters = g_ptr_array_new_with_free_func ( (GDestroyNotify) g_hash_table_unref); self->priv->handler_filters = g_ptr_array_new_with_free_func ( (GDestroyNotify) g_hash_table_unref); self->priv->handler_caps = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (self->priv->handler_caps, NULL); self->priv->my_chans = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); self->priv->account_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); self->priv->connection_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); self->priv->channel_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); } static void tp_base_client_dispose (GObject *object) { TpBaseClient *self = TP_BASE_CLIENT (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_base_client_parent_class)->dispose; tp_base_client_unregister (self); tp_clear_object (&self->priv->dbus); tp_clear_object (&self->priv->account_mgr); tp_clear_object (&self->priv->factory); tp_clear_object (&self->priv->only_for_account); tp_clear_object (&self->priv->channel_factory); g_list_free_full (self->priv->pending_requests, g_object_unref); self->priv->pending_requests = NULL; if (self->priv->my_chans != NULL && g_hash_table_size (self->priv->my_chans) > 0) WARNING ("TpBaseClient is still handling %d channels at dispose", g_hash_table_size (self->priv->my_chans)); tp_clear_pointer (&self->priv->my_chans, g_hash_table_unref); if (self->priv->delegated_channels_destroy != NULL) { self->priv->delegated_channels_destroy ( self->priv->delegated_channels_data); self->priv->delegated_channels_destroy = NULL; } if (dispose != NULL) dispose (object); } static void tp_base_client_finalize (GObject *object) { TpBaseClient *self = TP_BASE_CLIENT (object); void (*finalize) (GObject *) = G_OBJECT_CLASS (tp_base_client_parent_class)->finalize; g_free (self->priv->name); g_ptr_array_unref (self->priv->observer_filters); g_ptr_array_unref (self->priv->approver_filters); g_ptr_array_unref (self->priv->handler_filters); g_ptr_array_unref (self->priv->handler_caps); g_free (self->priv->bus_name); g_free (self->priv->object_path); tp_clear_pointer (&self->priv->account_features, g_array_unref); tp_clear_pointer (&self->priv->connection_features, g_array_unref); tp_clear_pointer (&self->priv->channel_features, g_array_unref); if (finalize != NULL) finalize (object); } static void tp_base_client_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseClient *self = TP_BASE_CLIENT (object); switch (property_id) { case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus); break; case PROP_ACCOUNT_MANAGER: g_value_set_object (value, self->priv->account_mgr); break; case PROP_FACTORY: g_value_set_object (value, self->priv->factory); break; case PROP_NAME: g_value_set_string (value, self->priv->name); break; case PROP_UNIQUIFY_NAME: g_value_set_boolean (value, self->priv->uniquify_name); break; case PROP_CHANNEL_FACTORY: g_value_set_object (value, self->priv->channel_factory); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_client_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseClient *self = TP_BASE_CLIENT (object); switch (property_id) { case PROP_DBUS_DAEMON: g_assert (self->priv->dbus == NULL); /* construct-only */ self->priv->dbus = g_value_dup_object (value); break; case PROP_ACCOUNT_MANAGER: g_assert (self->priv->account_mgr == NULL); /* construct-only */ self->priv->account_mgr = g_value_dup_object (value); break; case PROP_FACTORY: g_assert (self->priv->factory == NULL); /* construct-only */ self->priv->factory = g_value_dup_object (value); break; case PROP_NAME: g_assert (self->priv->name == NULL); /* construct-only */ self->priv->name = g_value_dup_string (value); break; case PROP_UNIQUIFY_NAME: self->priv->uniquify_name = g_value_get_boolean (value); break; case PROP_CHANNEL_FACTORY: g_assert (self->priv->channel_factory == NULL); /* construct-only */ self->priv->channel_factory = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_client_constructed (GObject *object) { TpBaseClient *self = TP_BASE_CLIENT (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_base_client_parent_class)->constructed; GString *string; static guint unique_counter = 0; if (chain_up != NULL) chain_up (object); /* What we really need is a factory. For historical reasons, * constructor could get a TpDBusDaemon or a TpAccountManager. * We need to do some fallbacks for compatibility... */ if (self->priv->account_mgr == NULL && self->priv->factory == NULL) { /* This case happens only from deprecated API, for compatibility we still * need to create a TpAccountManager even if a factory would be enough */ g_assert (self->priv->dbus != NULL); if (_tp_dbus_daemon_is_the_shared_one (self->priv->dbus)) { /* The AM is guaranteed to be the one from * tp_account_manager_dup() */ self->priv->account_mgr = tp_account_manager_dup (); } else { /* No guarantee, create a new AM */ self->priv->account_mgr = tp_account_manager_new (self->priv->dbus); } } if (self->priv->factory == NULL) { g_assert (self->priv->account_mgr != NULL); self->priv->factory = tp_proxy_get_factory (self->priv->account_mgr); g_object_ref (self->priv->factory); } if (self->priv->dbus == NULL) { g_assert (self->priv->factory != NULL); self->priv->dbus = tp_simple_client_factory_get_dbus_daemon ( self->priv->factory); g_object_ref (self->priv->dbus); } g_assert (tp_simple_client_factory_get_dbus_daemon (self->priv->factory) == self->priv->dbus); /* Bus name */ g_assert (self->priv->name != NULL); string = g_string_new (TP_CLIENT_BUS_NAME_BASE); g_string_append (string, self->priv->name); if (self->priv->uniquify_name) { gchar *unique; unique = tp_escape_as_identifier (tp_dbus_daemon_get_unique_name ( self->priv->dbus)); g_string_append_printf (string, ".%s.n%u", unique, unique_counter++); g_free (unique); } /* Object path */ self->priv->object_path = g_strdup_printf ("/%s", string->str); g_strdelimit (self->priv->object_path, ".", '/'); self->priv->bus_name = g_string_free (string, FALSE); } typedef enum { DP_INTERFACES, DP_APPROVER_CHANNEL_FILTER, DP_HANDLER_CHANNEL_FILTER, DP_BYPASS_APPROVAL, DP_CAPABILITIES, DP_HANDLED_CHANNELS, DP_OBSERVER_CHANNEL_FILTER, DP_OBSERVER_RECOVER, DP_OBSERVER_DELAY_APPROVERS, } ClientDBusProp; static void tp_base_client_get_dbus_properties (GObject *object, GQuark iface, GQuark name, GValue *value, gpointer getter_data) { TpBaseClient *self = TP_BASE_CLIENT (object); ClientDBusProp which = GPOINTER_TO_INT (getter_data); switch (which) { case DP_INTERFACES: { GPtrArray *arr = g_ptr_array_sized_new (5); if (self->priv->flags & CLIENT_IS_OBSERVER) g_ptr_array_add (arr, g_strdup (TP_IFACE_CLIENT_OBSERVER)); if (self->priv->flags & CLIENT_IS_APPROVER) g_ptr_array_add (arr, g_strdup (TP_IFACE_CLIENT_APPROVER)); if (self->priv->flags & CLIENT_IS_HANDLER) g_ptr_array_add (arr, g_strdup (TP_IFACE_CLIENT_HANDLER)); if (self->priv->flags & CLIENT_HANDLER_WANTS_REQUESTS) g_ptr_array_add (arr, g_strdup ( TP_IFACE_CLIENT_INTERFACE_REQUESTS)); g_ptr_array_add (arr, NULL); g_value_take_boxed (value, g_ptr_array_free (arr, FALSE)); } break; case DP_OBSERVER_CHANNEL_FILTER: g_value_set_boxed (value, self->priv->observer_filters); break; case DP_APPROVER_CHANNEL_FILTER: g_value_set_boxed (value, self->priv->approver_filters); break; case DP_HANDLER_CHANNEL_FILTER: g_value_set_boxed (value, self->priv->handler_filters); break; case DP_BYPASS_APPROVAL: g_value_set_boolean (value, (self->priv->flags & CLIENT_HANDLER_BYPASSES_APPROVAL) != 0); break; case DP_CAPABILITIES: /* this is already NULL-terminated */ g_value_set_boxed (value, (GStrv) self->priv->handler_caps->pdata); break; case DP_HANDLED_CHANNELS: { GList *channels = tp_base_client_dup_handled_channels (self); GList *iter; GPtrArray *arr = g_ptr_array_sized_new (g_list_length (channels)); for (iter = channels; iter != NULL; iter = iter->next) g_ptr_array_add (arr, g_strdup (tp_proxy_get_object_path (iter->data))); g_value_take_boxed (value, arr); g_list_free_full (channels, g_object_unref); } break; case DP_OBSERVER_RECOVER: g_value_set_boolean (value, (self->priv->flags & CLIENT_OBSERVER_RECOVER) != 0); break; case DP_OBSERVER_DELAY_APPROVERS: g_value_set_boolean (value, (self->priv->flags & CLIENT_OBSERVER_DELAYS_APPROVERS) != 0); break; default: g_assert_not_reached (); } } static void tp_base_client_class_init (TpBaseClientClass *cls) { GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl client_properties[] = { { "Interfaces", GINT_TO_POINTER (DP_INTERFACES) }, { NULL } }; static TpDBusPropertiesMixinPropImpl handler_properties[] = { { "HandlerChannelFilter", GINT_TO_POINTER (DP_HANDLER_CHANNEL_FILTER) }, { "BypassApproval", GINT_TO_POINTER (DP_BYPASS_APPROVAL) }, { "Capabilities", GINT_TO_POINTER (DP_CAPABILITIES) }, { "HandledChannels", GINT_TO_POINTER (DP_HANDLED_CHANNELS) }, { NULL } }; static TpDBusPropertiesMixinPropImpl approver_properties[] = { { "ApproverChannelFilter", GINT_TO_POINTER (DP_APPROVER_CHANNEL_FILTER) }, { NULL } }; static TpDBusPropertiesMixinPropImpl observer_properties[] = { { "ObserverChannelFilter", GINT_TO_POINTER (DP_OBSERVER_CHANNEL_FILTER) }, { "Recover", GINT_TO_POINTER (DP_OBSERVER_RECOVER) }, { "DelayApprovers", GINT_TO_POINTER (DP_OBSERVER_DELAY_APPROVERS) }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_ifaces[] = { { TP_IFACE_CLIENT, tp_base_client_get_dbus_properties, NULL, client_properties }, { TP_IFACE_CLIENT_OBSERVER, tp_base_client_get_dbus_properties, NULL, observer_properties }, { TP_IFACE_CLIENT_APPROVER, tp_base_client_get_dbus_properties, NULL, approver_properties }, { TP_IFACE_CLIENT_HANDLER, tp_base_client_get_dbus_properties, NULL, handler_properties }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (cls); g_type_class_add_private (cls, sizeof (TpBaseClientPrivate)); object_class->get_property = tp_base_client_get_property; object_class->set_property = tp_base_client_set_property; object_class->constructed = tp_base_client_constructed; object_class->dispose = tp_base_client_dispose; object_class->finalize = tp_base_client_finalize; /** * TpBaseClient:dbus-daemon: * * #TpDBusDaemon object encapsulating this object's connection to D-Bus. * Read-only except during construction. * * This property can't be %NULL after construction. * * Since 0.11.14 this property may be %NULL or unspecified in * g_object_new(), but only if #TpBaseClient:account-manager is provided * instead, in which case its #TpProxy:dbus-daemon property will be * used. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("dbus-daemon", "TpDBusDaemon object", "The dbus daemon associated with this client", TP_TYPE_DBUS_DAEMON, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, param_spec); /** * TpBaseClient:account-manager: * * Account manager for this base client, used to look up or create * #TpAccount objects. This may be specified in the constructor in order * to get existing #TpAccount objects. * * It is not guaranteed that any of its features have been prepared, and * it is not necessary to wait for any features before specifying this * property in the constructor. * * Clients that interact with the #TpAccount should usually * set this property instead of #TpBaseClient:dbus-daemon. Doing this * will ensure that each account, connection or contact is represented by * a single #TpAccount, #TpConnection or #TpContact object, shared between * all the cooperating modules that have the same #TpAccountManager. * * If the #TpBaseClient:dbus-daemon is set to the result of * tp_dbus_daemon_dup(), then this property defaults to * the result of tp_account_manager_dup(). * * This property may be %NULL initially, but will always be non-%NULL * after the #TpBaseClient has been constructed. * * It is an error to specify both a non-%NULL account manager, and a * non-%NULL #TpBaseClient:dbus-daemon that is not the same as the * account manager's #TpProxy:dbus-daemon. * * Since: 0.11.14 * Deprecated: New code should not use this property, it may be %NULL in * the case @self was constructed with a #TpSimpleClientFactory. */ param_spec = g_param_spec_object ("account-manager", "TpAccountManager", "The TpAccountManager used look up or create TpAccount objects", TP_TYPE_ACCOUNT_MANAGER, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT_MANAGER, param_spec); /** * TpBaseClient:factory: * * Factory for this base client, used to look up or create * #TpAccount objects. * * Since: 0.15.5 */ param_spec = g_param_spec_object ("factory", "TpSimpleClientFactory", "The TpSimpleClientFactory used look up or create TpAccount objects", TP_TYPE_SIMPLE_CLIENT_FACTORY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FACTORY, param_spec); /** * TpBaseClient:name: * * The name of the client. This is used to register the D-Bus service name * and object path of the service. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_string ("name", "name", "The name of the client", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, param_spec); /** * TpBaseClient:uniquify-name: * * If %TRUE, tp_base_client_register() will append an unique token to the * service bus name and object path to ensure they are unique. * * Since: 0.11.5 */ param_spec = g_param_spec_boolean ("uniquify-name", "Uniquify name", "if TRUE, append a unique token to the name", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_UNIQUIFY_NAME, param_spec); /** * TpBaseClient:channel-factory: * * The object implementing the #TpClientChannelFactoryInterface interface * that will be used to create channel proxies. While * tp_base_client_register() has not yet been called, this property can be * changed using tp_base_client_set_channel_factory(). * * If no channel factory is specified then #TpAutomaticProxyFactory is used. * * Since: 0.13.2 * Deprecated: since 0.15.5. The factory is taken from * #TpBaseClient:account-manager. */ param_spec = g_param_spec_object ("channel-factory", "Channel factory", "Object implementing TpClientChannelFactoryInterface", G_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_FACTORY, param_spec); /** * TpBaseClient::request-added: * @self: a #TpBaseClient * @account: the #TpAccount on which the request was made, * with %TP_ACCOUNT_FEATURE_CORE, and any other features added via * tp_base_client_add_account_features() or * tp_simple_client_factory_add_account_features(), prepared if possible * @request: a #TpChannelRequest having its object-path defined but * is not guaranteed to be prepared. * * Emitted when a channels have been requested, and that if the * request is successful, they will probably be handled by this Handler. * * This signal is only fired if * tp_base_client_set_handler_request_notification() has been called * on @self previously. * * Since: 0.11.6 */ signals[SIGNAL_REQUEST_ADDED] = g_signal_new ( "request-added", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_TYPE_ACCOUNT, TP_TYPE_CHANNEL_REQUEST); /** * TpBaseClient::request-removed: * @self: a #TpBaseClient * @request: the #TpChannelRequest being removed * @error: the name of the D-Bus error with which the request failed. * @message: any message supplied with the D-Bus error. * * Emitted when a request has failed and should be disregarded. * * This signal is only fired if * tp_base_client_set_handler_request_notification() has been called * on @self previously. * * Since: 0.11.6 */ signals[SIGNAL_REQUEST_REMOVED] = g_signal_new ( "request-removed", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, TP_TYPE_CHANNEL_REQUEST, G_TYPE_STRING, G_TYPE_STRING); cls->dbus_properties_class.interfaces = prop_ifaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseClientClass, dbus_properties_class)); } static GList * ptr_array_to_list (GPtrArray *arr) { guint i; GList *result = NULL; for (i = 0; i < arr->len; i++) result = g_list_prepend (result, g_ptr_array_index (arr, i)); return g_list_reverse (result); } static void context_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseClient *self = user_data; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); TpObserveChannelsContext *ctx = TP_OBSERVE_CHANNELS_CONTEXT (source); GError *error = NULL; GList *channels_list, *requests_list; if (!_tp_observe_channels_context_prepare_finish (ctx, result, &error)) { DEBUG ("Failed to prepare TpObserveChannelsContext: %s", error->message); tp_observe_channels_context_fail (ctx, error); g_error_free (error); return; } channels_list = ptr_array_to_list (ctx->channels); requests_list = ptr_array_to_list (ctx->requests); cls->observe_channels (self, ctx->account, ctx->connection, channels_list, ctx->dispatch_operation, requests_list, ctx); g_list_free (channels_list); g_list_free (requests_list); if (_tp_observe_channels_context_get_state (ctx) == TP_OBSERVE_CHANNELS_CONTEXT_STATE_NONE) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Implementation of ObserveChannels in %s didn't call " "tp_observe_channels_context_{accept,fail,delay}", G_OBJECT_TYPE_NAME (self)); CRITICAL ("%s", error->message); tp_observe_channels_context_fail (ctx, error); g_error_free (error); } } static GArray * dup_features_for_account (TpBaseClient *self, TpAccount *account) { GArray *features; features = tp_simple_client_factory_dup_account_features (self->priv->factory, account); g_assert (features != NULL); /* Deprecated - Merge features set on self instead of factory */ _tp_quark_array_merge (features, (GQuark *) self->priv->account_features->data, self->priv->account_features->len); return features; } static GArray * dup_features_for_connection (TpBaseClient *self, TpConnection *connection) { GArray *features; features = tp_simple_client_factory_dup_connection_features ( self->priv->factory, connection); g_assert (features != NULL); /* Deprecated - Merge features set on self instead of factory */ _tp_quark_array_merge (features, (GQuark *) self->priv->connection_features->data, self->priv->connection_features->len); return features; } static GArray * dup_features_for_channel (TpBaseClient *self, TpChannel *channel) { GArray *features; /* Use legacy channel factory if one is set */ if (self->priv->channel_factory != NULL) features = tp_client_channel_factory_dup_channel_features ( self->priv->channel_factory, channel); else features = tp_simple_client_factory_dup_channel_features ( self->priv->factory, channel); g_assert (features != NULL); /* Deprecated - Merge features set on self instead of factory */ _tp_quark_array_merge (features, (GQuark *) self->priv->channel_features->data, self->priv->channel_features->len); return features; } static TpChannel * ensure_account_connection_channels (TpBaseClient *self, const gchar *account_path, const gchar *connection_path, const GPtrArray *channels_arr, TpAccount **account, TpConnection **connection, GPtrArray **channels, GError **error) { TpChannel *channel = NULL; guint i; g_assert (account != NULL); g_assert (connection != NULL); g_assert (channels != NULL); *account = NULL; *connection = NULL; *channels = NULL; *account = tp_base_client_dup_account (self, account_path, error); if (*account == NULL) goto error; *connection = tp_simple_client_factory_ensure_connection (self->priv->factory, connection_path, NULL, error); if (*connection == NULL) goto error; /* fdo#51444: Custom TpChannel subclasses constructors may assume that the * Connection already knows its Account. If we don't do it here, it will be * done only when TP_ACCOUNT_FEATURE_CORE gets prepared on the Account. */ _tp_connection_set_account (*connection, *account); if (channels_arr->len == 0) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Channels should contain at least one channel"); goto error; } *channels = g_ptr_array_new_full (channels_arr->len, g_object_unref); for (i = 0; i < channels_arr->len; i++) { const gchar *chan_path; GHashTable *chan_props; tp_value_array_unpack (g_ptr_array_index (channels_arr, i), 2, &chan_path, &chan_props); /* Use legacy channel factory if one is set */ if (self->priv->channel_factory != NULL) { channel = tp_client_channel_factory_create_channel ( self->priv->channel_factory, *connection, chan_path, chan_props, error); } else { channel = tp_simple_client_factory_ensure_channel ( self->priv->factory, *connection, chan_path, chan_props, error); } if (channel == NULL) goto error; g_ptr_array_add (*channels, channel); } /* FIXME: We will consider features set only for the last channel. This is * wrong in the case we receive multiple channels of different types. * It has always been like that, and multiple channel dispatch is being * deprecated. So let's just live with it. */ return channel; error: g_clear_object (account); g_clear_object (connection); tp_clear_pointer (channels, g_ptr_array_unref); return NULL; } static void _tp_base_client_observe_channels (TpSvcClientObserver *iface, const gchar *account_path, const gchar *connection_path, const GPtrArray *channels_arr, const gchar *dispatch_operation_path, const GPtrArray *requests_arr, GHashTable *observer_info, DBusGMethodInvocation *context) { TpBaseClient *self = TP_BASE_CLIENT (iface); TpObserveChannelsContext *ctx; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); GError *error = NULL; TpAccount *account = NULL; TpConnection *connection = NULL; GPtrArray *channels = NULL, *requests = NULL; TpChannelDispatchOperation *dispatch_operation = NULL; guint i; TpChannel *channel = NULL; GArray *account_features; GArray *connection_features; GArray *channel_features; GHashTable *request_props; if (!(self->priv->flags & CLIENT_IS_OBSERVER)) { /* Pretend that the method is not implemented if we are not supposed to * be an Observer. */ tp_dbus_g_method_return_not_implemented (context); return; } if (cls->observe_channels == NULL) { WARNING ("class %s does not implement ObserveChannels", G_OBJECT_TYPE_NAME (self)); tp_dbus_g_method_return_not_implemented (context); return; } channel = ensure_account_connection_channels (self, account_path, connection_path, channels_arr, &account, &connection, &channels, &error); if (channel == NULL) goto out; if (!tp_strdiff (dispatch_operation_path, "/")) { dispatch_operation = NULL; } else { dispatch_operation = _tp_simple_client_factory_ensure_channel_dispatch_operation ( self->priv->factory, dispatch_operation_path, NULL, &error); if (dispatch_operation == NULL) { DEBUG ("Failed to create TpChannelDispatchOperation: %s", error->message); goto out; } } requests = g_ptr_array_new_full (requests_arr->len, g_object_unref); request_props = tp_asv_get_boxed (observer_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP); for (i = 0; i < requests_arr->len; i++) { const gchar *req_path = g_ptr_array_index (requests_arr, i); TpChannelRequest *request; GHashTable *props = NULL; if (request_props != NULL) props = g_hash_table_lookup (request_props, req_path); request = _tp_simple_client_factory_ensure_channel_request ( self->priv->factory, req_path, props, &error); if (request == NULL) { DEBUG ("Failed to create TpChannelRequest: %s", error->message); goto out; } g_ptr_array_add (requests, request); } ctx = _tp_observe_channels_context_new (account, connection, channels, dispatch_operation, requests, observer_info, context); account_features = dup_features_for_account (self, account); connection_features = dup_features_for_connection (self, connection); channel_features = dup_features_for_channel (self, channel); _tp_observe_channels_context_prepare_async (ctx, (GQuark *) account_features->data, (GQuark *) connection_features->data, (GQuark *) channel_features->data, context_prepare_cb, self); g_object_unref (ctx); g_array_unref (account_features); g_array_unref (connection_features); g_array_unref (channel_features); out: g_clear_object (&account); g_clear_object (&connection); if (channels != NULL) g_ptr_array_unref (channels); if (dispatch_operation != NULL) g_object_unref (dispatch_operation); if (requests != NULL) g_ptr_array_unref (requests); if (error == NULL) return; dbus_g_method_return_error (context, error); g_error_free (error); } static void observer_iface_init (gpointer g_iface, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_client_observer_implement_##x (\ g_iface, _tp_base_client_##x) IMPLEMENT (observe_channels); #undef IMPLEMENT } static void add_dispatch_context_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseClient *self = user_data; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); TpAddDispatchOperationContext *ctx = TP_ADD_DISPATCH_OPERATION_CONTEXT ( source); GError *error = NULL; GList *channels_list; if (!_tp_add_dispatch_operation_context_prepare_finish (ctx, result, &error)) { DEBUG ("Failed to prepare TpAddDispatchOperationContext: %s", error->message); tp_add_dispatch_operation_context_fail (ctx, error); g_error_free (error); return; } channels_list = ptr_array_to_list (ctx->channels); cls->add_dispatch_operation (self, ctx->account, ctx->connection, channels_list, ctx->dispatch_operation, ctx); g_list_free (channels_list); if (_tp_add_dispatch_operation_context_get_state (ctx) == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Implementation of AddDispatchOperation in %s didn't call " "tp_add_dispatch_operation_context_{accept,fail,delay}", G_OBJECT_TYPE_NAME (self)); g_critical ("%s", error->message); tp_add_dispatch_operation_context_fail (ctx, error); g_error_free (error); } } static void _tp_base_client_add_dispatch_operation (TpSvcClientApprover *iface, const GPtrArray *channels_arr, const gchar *dispatch_operation_path, GHashTable *properties, DBusGMethodInvocation *context) { TpBaseClient *self = TP_BASE_CLIENT (iface); TpAddDispatchOperationContext *ctx; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); const gchar *account_path; const gchar *connection_path; GError *error = NULL; TpAccount *account = NULL; TpConnection *connection = NULL; GPtrArray *channels = NULL; TpChannelDispatchOperation *dispatch_operation = NULL; TpChannel *channel = NULL; GArray *account_features; GArray *connection_features; GArray *channel_features; if (!(self->priv->flags & CLIENT_IS_APPROVER)) { /* Pretend that the method is not implemented if we are not supposed to * be an Approver. */ tp_dbus_g_method_return_not_implemented (context); return; } if (cls->add_dispatch_operation == NULL) { WARNING ("class %s does not implement AddDispatchOperation", G_OBJECT_TYPE_NAME (self)); tp_dbus_g_method_return_not_implemented (context); return; } account_path = tp_asv_get_object_path (properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_ACCOUNT); if (account_path == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Properties doesn't contain 'Account'"); DEBUG ("%s", error->message); goto out; } connection_path = tp_asv_get_object_path (properties, TP_PROP_CHANNEL_DISPATCH_OPERATION_CONNECTION); if (connection_path == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Properties doesn't contain 'Connection'"); DEBUG ("%s", error->message); goto out; } channel = ensure_account_connection_channels (self, account_path, connection_path, channels_arr, &account, &connection, &channels, &error); if (channel == NULL) goto out; /* FIXME: We will consider features set only for the first channel. This is * wrong in the case we receive multiple channels of different types. * It has always been like that, and multiple channel dispatch is being * deprecated. So let's just live with it. */ channel = g_ptr_array_index (channels, 0); dispatch_operation = _tp_simple_client_factory_ensure_channel_dispatch_operation ( self->priv->factory, dispatch_operation_path, properties, &error); if (dispatch_operation == NULL) { DEBUG ("Failed to create TpChannelDispatchOperation: %s", error->message); goto out; } _tp_channel_dispatch_operation_ensure_channels (dispatch_operation, channels); ctx = _tp_add_dispatch_operation_context_new (account, connection, channels, dispatch_operation, context); account_features = dup_features_for_account (self, account); connection_features = dup_features_for_connection (self, connection); channel_features = dup_features_for_channel (self, channel); _tp_add_dispatch_operation_context_prepare_async (ctx, (GQuark *) account_features->data, (GQuark *) connection_features->data, (GQuark *) channel_features->data, add_dispatch_context_prepare_cb, self); g_object_unref (ctx); g_array_unref (account_features); g_array_unref (connection_features); g_array_unref (channel_features); out: g_clear_object (&account); g_clear_object (&connection); if (channels != NULL) g_ptr_array_unref (channels); if (dispatch_operation != NULL) g_object_unref (dispatch_operation); if (error == NULL) return; dbus_g_method_return_error (context, error); g_error_free (error); } static void approver_iface_init (gpointer g_iface, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_client_approver_implement_##x (\ g_iface, _tp_base_client_##x) IMPLEMENT (add_dispatch_operation); #undef IMPLEMENT } static void chan_invalidated_cb (TpChannel *channel, guint domain, gint code, gchar *message, TpBaseClient *self) { DEBUG ("Channel (%p) %s has been invalidated (%s)", channel, tp_proxy_get_object_path (channel), message); if (!(domain == TP_DBUS_ERRORS && code == TP_DBUS_ERROR_PROXY_UNREFERENCED)) { g_hash_table_remove (self->priv->my_chans, tp_proxy_get_object_path ( channel)); } } static void add_handled_channels (TpBaseClient *self, GPtrArray *channels) { guint i; for (i = 0; i < channels->len; i++) { TpChannel *channel = g_ptr_array_index (channels, i); if (tp_proxy_get_invalidated (channel) == NULL) { DEBUG ("Inserting Channel (%p) %s", channel, tp_proxy_get_object_path (channel)); g_hash_table_replace (self->priv->my_chans, (gchar *) tp_proxy_get_object_path (channel), g_object_ref (channel)); tp_g_signal_connect_object (channel, "invalidated", G_CALLBACK (chan_invalidated_cb), self, 0); } } } static void ctx_done_cb (TpHandleChannelsContext *context, TpBaseClient *self) { add_handled_channels (self, context->channels); } static void delegate_to_preferred_handler_delegate_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseClient *self = (TpBaseClient *) source; GError *error = NULL; GPtrArray *delegated; if (!tp_base_client_delegate_channels_finish (self, result, &delegated, NULL, &error)) { DEBUG ("DelegateChannels failed; we are still handling channels: %s", error->message); g_error_free (error); return; } self->priv->delegated_channels_cb (self, delegated, self->priv->delegated_channels_data); g_ptr_array_unref (delegated); } static gboolean delegate_channels_if_needed (TpBaseClient *self, TpHandleChannelsContext *ctx) { GList *requests, *l; const gchar *handler_to_delegate = NULL; gint64 user_action_time = 0; guint i; GList *chans = NULL; gboolean delegate = FALSE; /* User has to explicitely enable this feature */ if (self->priv->delegated_channels_cb == NULL) return FALSE; requests = tp_handle_channels_context_get_requests (ctx); for (l = requests; l != NULL; l = g_list_next (l)) { TpChannelRequest *cr = l->data; const GHashTable *hints; gboolean should_delegate; hints = tp_channel_request_get_hints (cr); if (hints == NULL) continue; should_delegate = tp_asv_get_boolean (hints, "org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler", NULL); if (!should_delegate) continue; /* As stated in the spec, we should use the first CR having the * DelegateToPreferredHandler hint */ handler_to_delegate = tp_channel_request_get_preferred_handler (cr); user_action_time = tp_channel_request_get_user_action_time (cr); } if (handler_to_delegate == NULL) /* No need to delegate */ goto out; if (!tp_strdiff (handler_to_delegate, self->priv->name)) /* We are already the one handling the channels */ goto out; /* We are supposed to delegate the channels; check if we are handling * them */ for (i = 0; i < ctx->channels->len; i++) { TpChannel *channel = g_ptr_array_index (ctx->channels, i); if (!tp_base_client_is_handling_channel (self, channel)) { /* Don't delegate as there is at least one channel we are not * handling */ DEBUG ("We have been asked to delegate channels but we are " "not handling %s", tp_proxy_get_object_path (channel)); goto out; } chans = g_list_prepend (chans, channel); } DEBUG ("Delegate channels as requested"); delegate = TRUE; tp_base_client_delegate_channels_async (self, chans, user_action_time, handler_to_delegate, delegate_to_preferred_handler_delegate_cb, self); g_list_free (chans); tp_handle_channels_context_accept (ctx); out: g_list_free_full (requests, g_object_unref); return delegate; } static void handle_channels_context_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseClient *self = user_data; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); TpHandleChannelsContext *ctx = TP_HANDLE_CHANNELS_CONTEXT (source); GError *error = NULL; GList *channels_list, *requests_list; if (!_tp_handle_channels_context_prepare_finish (ctx, result, &error)) { DEBUG ("Failed to prepare TpHandleChannelsContext: %s", error->message); tp_handle_channels_context_fail (ctx, error); g_error_free (error); return; } if (delegate_channels_if_needed (self, ctx)) return; channels_list = ptr_array_to_list (ctx->channels); requests_list = ptr_array_to_list (ctx->requests_satisfied); tp_g_signal_connect_object (ctx, "done", G_CALLBACK (ctx_done_cb), self, 0); cls->handle_channels (self, ctx->account, ctx->connection, channels_list, requests_list, ctx->user_action_time, ctx); g_list_free (channels_list); g_list_free (requests_list); if (_tp_handle_channels_context_get_state (ctx) == TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Implementation of HandledChannels in %s didn't call " "tp_handle_channels_context_{accept,fail,delay}", G_OBJECT_TYPE_NAME (self)); CRITICAL ("%s", error->message); tp_handle_channels_context_fail (ctx, error); g_error_free (error); } } static TpChannelRequest * find_request_by_path (TpBaseClient *self, const gchar *path) { GList *l; for (l = self->priv->pending_requests; l != NULL; l = g_list_next (l)) { TpChannelRequest *request = l->data; if (!tp_strdiff (tp_proxy_get_object_path (request), path)) return request; } return NULL; } static void _tp_base_client_handle_channels (TpSvcClientHandler *iface, const gchar *account_path, const gchar *connection_path, const GPtrArray *channels_arr, const GPtrArray *requests_arr, guint64 user_action_time, GHashTable *handler_info, DBusGMethodInvocation *context) { TpBaseClient *self = TP_BASE_CLIENT (iface); TpHandleChannelsContext *ctx; TpBaseClientClass *cls = TP_BASE_CLIENT_GET_CLASS (self); GError *error = NULL; TpAccount *account = NULL; TpConnection *connection = NULL; GPtrArray *channels = NULL, *requests = NULL; guint i; TpChannel *channel = NULL; GArray *account_features; GArray *connection_features; GArray *channel_features; GHashTable *request_props; if (!(self->priv->flags & CLIENT_IS_HANDLER)) { /* Pretend that the method is not implemented if we are not supposed to * be an Handler. */ tp_dbus_g_method_return_not_implemented (context); return; } if (cls->handle_channels == NULL) { DEBUG ("class %s does not implement HandleChannels", G_OBJECT_TYPE_NAME (self)); tp_dbus_g_method_return_not_implemented (context); return; } channel = ensure_account_connection_channels (self, account_path, connection_path, channels_arr, &account, &connection, &channels, &error); if (channel == NULL) goto out; /* FIXME: We will consider features set only for the first channel. This is * wrong in the case we receive multiple channels of different types. * It has always been like that, and multiple channel dispatch is being * deprecated. So let's just live with it. */ channel = g_ptr_array_index (channels, 0); requests = g_ptr_array_new_full (requests_arr->len, g_object_unref); request_props = tp_asv_get_boxed (handler_info, "request-properties", TP_HASH_TYPE_OBJECT_IMMUTABLE_PROPERTIES_MAP); for (i = 0; i < requests_arr->len; i++) { const gchar *req_path = g_ptr_array_index (requests_arr, i); TpChannelRequest *request; GHashTable *props = NULL; if (request_props != NULL) props = g_hash_table_lookup (request_props, req_path); request = find_request_by_path (self, req_path); if (request != NULL) { g_object_ref (request); _tp_channel_request_ensure_immutable_properties (request, props); } else { request = _tp_simple_client_factory_ensure_channel_request ( self->priv->factory, req_path, props, &error); if (request == NULL) { DEBUG ("Failed to create TpChannelRequest: %s", error->message); goto out; } } g_ptr_array_add (requests, request); } ctx = _tp_handle_channels_context_new (account, connection, channels, requests, user_action_time, handler_info, context); account_features = dup_features_for_account (self, account); connection_features = dup_features_for_connection (self, connection); channel_features = dup_features_for_channel (self, channel); _tp_handle_channels_context_prepare_async (ctx, (GQuark *) account_features->data, (GQuark *) connection_features->data, (GQuark *) channel_features->data, handle_channels_context_prepare_cb, self); g_object_unref (ctx); g_array_unref (account_features); g_array_unref (connection_features); g_array_unref (channel_features); out: g_clear_object (&account); g_clear_object (&connection); if (channels != NULL) g_ptr_array_unref (channels); if (requests != NULL) g_ptr_array_unref (requests); if (error == NULL) return; dbus_g_method_return_error (context, error); g_error_free (error); } static void handler_iface_init (gpointer g_iface, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_client_handler_implement_##x (\ g_iface, _tp_base_client_##x) IMPLEMENT (handle_channels); #undef IMPLEMENT } typedef struct { TpBaseClient *self; TpChannelRequest *request; } channel_request_prepare_account_ctx; static channel_request_prepare_account_ctx * channel_request_prepare_account_ctx_new (TpBaseClient *self, TpChannelRequest *request) { channel_request_prepare_account_ctx *ctx = g_slice_new ( channel_request_prepare_account_ctx); ctx->self = g_object_ref (self); ctx->request = g_object_ref (request); return ctx; } static void channel_request_prepare_account_ctx_free ( channel_request_prepare_account_ctx *ctx) { g_object_unref (ctx->self); g_object_unref (ctx->request); g_slice_free (channel_request_prepare_account_ctx, ctx); } static void channel_request_account_prepare_cb (GObject *account, GAsyncResult *result, gpointer user_data) { channel_request_prepare_account_ctx *ctx = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (account, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); } g_signal_emit (ctx->self, signals[SIGNAL_REQUEST_ADDED], 0, account, ctx->request); channel_request_prepare_account_ctx_free (ctx); } static void _tp_base_client_add_request (TpSvcClientInterfaceRequests *iface, const gchar *path, GHashTable *properties, DBusGMethodInvocation *context) { TpBaseClient *self = TP_BASE_CLIENT (iface); TpChannelRequest *request; TpAccount *account = NULL; GError *error = NULL; channel_request_prepare_account_ctx *ctx; GArray *account_features; request = _tp_simple_client_factory_ensure_channel_request ( self->priv->factory, path, properties, &error); if (request == NULL) { DEBUG ("Failed to create TpChannelRequest: %s", error->message); goto err; } path = tp_asv_get_object_path (properties, TP_PROP_CHANNEL_REQUEST_ACCOUNT); if (path == NULL) { error = g_error_new_literal (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Mandatory 'Account' property is missing"); DEBUG ("%s", error->message); goto err; } account = tp_base_client_dup_account (self, path, &error); if (account == NULL) goto err; self->priv->pending_requests = g_list_append (self->priv->pending_requests, request); ctx = channel_request_prepare_account_ctx_new (self, request); account_features = dup_features_for_account (self, account); tp_proxy_prepare_async (account, (GQuark *) account_features->data, channel_request_account_prepare_cb, ctx); g_array_unref (account_features); tp_svc_client_interface_requests_return_from_add_request (context); return; err: g_clear_object (&account); dbus_g_method_return_error (context, error); g_error_free (error); } static void _tp_base_client_remove_request (TpSvcClientInterfaceRequests *iface, const gchar *path, const gchar *error, const gchar *reason, DBusGMethodInvocation *context) { TpBaseClient *self = TP_BASE_CLIENT (iface); TpChannelRequest *request; request = find_request_by_path (self, path); if (request == NULL) { GError err = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Uknown ChannelRequest" }; dbus_g_method_return_error (context, &err); return; } self->priv->pending_requests = g_list_remove (self->priv->pending_requests, request); g_signal_emit (self, signals[SIGNAL_REQUEST_REMOVED], 0, request, error, reason); tp_svc_client_interface_requests_return_from_remove_request (context); } static void requests_iface_init (gpointer g_iface, gpointer unused G_GNUC_UNUSED) { #define IMPLEMENT(x) tp_svc_client_interface_requests_implement_##x (\ g_iface, _tp_base_client_##x) IMPLEMENT (add_request); IMPLEMENT (remove_request); #undef IMPLEMENT } /** * tp_base_client_implement_observe_channels: (skip) * @klass: the #TpBaseClientClass of the object * @impl: the #TpBaseClientClassObserveChannelsImpl function implementing * ObserveChannels() * * Called by subclasses to define the actual implementation of the * ObserveChannels() D-Bus method. * * Since 0.11.13 this is exactly equivalent to setting the * #TpBaseClientClass.observe_channels function pointer. * * Since: 0.11.5 */ void tp_base_client_implement_observe_channels (TpBaseClientClass *cls, TpBaseClientClassObserveChannelsImpl impl) { cls->observe_channels = impl; } /** * tp_base_client_get_bus_name: * @self: a #TpBaseClient * * Return the bus name of @self. Note that doesn't mean the client is * actually owning this name; for example if tp_base_client_register() * has not been called yet or failed. * * Returns: the bus name of the client * * Since: 0.11.5 */ const gchar * tp_base_client_get_bus_name (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->bus_name; } /** * tp_base_client_get_object_path: * @self: a #TpBaseClient * * Return the object path of @self. Note that doesn't mean the client is * actually registered on this path; for example if tp_base_client_register() * has not been called yet or failed. * * Returns: the object path of the client * * Since: 0.11.5 */ const gchar * tp_base_client_get_object_path (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->object_path; } /** * tp_base_client_get_name: * @self: a #TpBaseClient * * Return the #TpBaseClient:name construct-only property, which is used as * part of the bus name and object path. * * Returns: the value of #TpBaseClient:name * Since: 0.11.11 */ const gchar * tp_base_client_get_name (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->name; } /** * tp_base_client_get_uniquify_name: * @self: a #TpBaseClient * * Return the #TpBaseClient:uniquify-name construct-only property; if this * is true, the bus name and object path will be made unique by appending * a suffix that includes the D-Bus unique name and a per-process counter. * * Returns: the value of #TpBaseClient:uniquify-name * Since: 0.11.11 */ gboolean tp_base_client_get_uniquify_name (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), FALSE); return self->priv->uniquify_name; } /** * tp_base_client_get_dbus_daemon: * @self: a #TpBaseClient * * Return the #TpBaseClient:dbus-daemon construct-only property, which * represents the D-Bus connection used to export this client object. * * The returned object's reference count is not incremented, so it is not * necessarily valid after @self is destroyed. * * Returns: (transfer none): the value of #TpBaseClient:dbus-daemon * Since: 0.11.11 */ TpDBusDaemon * tp_base_client_get_dbus_daemon (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->dbus; } /** * tp_base_client_get_account_manager: (skip) * @self: a #TpBaseClient * * Return the #TpBaseClient:account-manager construct-only property, which * is the account manager used to look up or create #TpAccount objects. * * The returned object's reference count is not incremented, so it is not * necessarily valid after @self is destroyed. * * It is not guaranteed that any particular features are prepared on this * object; enable and wait for features with tp_proxy_prepare_async(). * * Returns: (transfer none): the value of #TpBaseClient:account-manager * Since: 0.11.14 * Deprecated: New code should not use this function, it may return %NULL in * the case @self was constructed with a #TpSimpleClientFactory. */ TpAccountManager * tp_base_client_get_account_manager (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->account_mgr; } /** * tp_base_client_implement_add_dispatch_operation: (skip) * @klass: the #TpBaseClientClass of the object * @impl: the #TpBaseClientClassAddDispatchOperationImpl function implementing * AddDispatchOperation() * * Called by subclasses to define the actual implementation of the * AddDispatchOperation() D-Bus method. * * Since 0.11.13 this is exactly equivalent to setting the * #TpBaseClientClass.add_dispatch_operation function pointer. * * Since: 0.11.5 */ void tp_base_client_implement_add_dispatch_operation (TpBaseClientClass *cls, TpBaseClientClassAddDispatchOperationImpl impl) { cls->add_dispatch_operation = impl; } /** * tp_base_client_implement_handle_channels: (skip) * @klass: the #TpBaseClientClass of the object * @impl: the #TpBaseClientClassHandleChannelsImpl function implementing * HandleCHannels() * * Called by subclasses to define the actual implementation of the * HandleChannels() D-Bus method. * * Since 0.11.13 this is exactly equivalent to setting the * #TpBaseClientClass.handle_channels function pointer. * * Since: 0.11.6 */ void tp_base_client_implement_handle_channels (TpBaseClientClass *cls, TpBaseClientClassHandleChannelsImpl impl) { cls->handle_channels = impl; } /** * tp_base_client_unregister: * @self: a client, which may already have been registered with * tp_base_client_register(), or not * * Remove this client object from D-Bus, if tp_base_client_register() * has already been called. * * If the object is not registered, this method may be called, but has * no effect. * * Releasing the last reference to the object also has the same effect * as calling this method, but this method should be preferred, as it * has more deterministic behaviour. * * If the object still exists, tp_base_client_register() may be used to * attempt to register it again. * * Since: 0.11.6 */ void tp_base_client_unregister (TpBaseClient *self) { GError *error = NULL; g_return_if_fail (TP_IS_BASE_CLIENT (self)); if (!self->priv->registered) return; if (!tp_dbus_daemon_release_name (self->priv->dbus, self->priv->bus_name, &error)) { WARNING ("Failed to release bus name (%s): %s", self->priv->bus_name, error->message); g_error_free (error); } tp_dbus_daemon_unregister_object (self->priv->dbus, self); if (self->priv->flags & CLIENT_IS_HANDLER) { GHashTable *clients; clients = dbus_connection_get_data (self->priv->libdbus, clients_slot); if (clients != NULL) g_hash_table_remove (clients, self->priv->object_path); dbus_connection_unref (self->priv->libdbus); self->priv->libdbus = NULL; dbus_connection_free_data_slot (&clients_slot); } self->priv->registered = FALSE; } /** * tp_base_client_add_account_features_varargs: (skip) * @self: a client * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_base_client_add_account_features(), but with a more * convenient calling convention from C. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_account_features_varargs() instead. */ void tp_base_client_add_account_features_varargs (TpBaseClient *self, GQuark feature, ...) { va_list ap; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); va_start (ap, feature); _tp_quark_array_merge_valist (self->priv->account_features, feature, ap); va_end (ap); } /** * tp_base_client_add_connection_features_varargs: (skip) * @self: a client * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_base_client_add_connection_features(), but with a more * convenient calling convention from C. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_connection_features_varargs() instead. */ void tp_base_client_add_connection_features_varargs (TpBaseClient *self, GQuark feature, ...) { va_list ap; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); va_start (ap, feature); _tp_quark_array_merge_valist (self->priv->connection_features, feature, ap); va_end (ap); } /** * tp_base_client_add_channel_features_varargs: (skip) * @self: a client * @feature: the first feature * @...: the second and subsequent features, if any, ending with 0 * * The same as tp_base_client_add_channel_features(), but with a more * convenient calling convention from C. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_channel_features_varargs() instead. */ void tp_base_client_add_channel_features_varargs (TpBaseClient *self, GQuark feature, ...) { va_list ap; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); va_start (ap, feature); _tp_quark_array_merge_valist (self->priv->channel_features, feature, ap); va_end (ap); } /** * tp_base_client_add_account_features: * @self: a client * @features: (array length=n): the features * @n: the number of features, or -1 if @features is 0-terminated * * Request that the given features are prepared on each #TpAccount (in * addition to %TP_ACCOUNT_FEATURE_CORE) before calling * #TpBaseClientClass.observe_channels, * #TpBaseClientClass.add_dispatch_operation or * #TpBaseClientClass.handle_channels, or emitting * #TpBaseClient::request-added. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_account_features() instead. */ void tp_base_client_add_account_features (TpBaseClient *self, const GQuark *features, gssize n) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); _tp_quark_array_merge (self->priv->account_features, features, n); } /** * tp_base_client_add_channel_features: * @self: a client * @features: (array length=n): the features * @n: the number of features, or -1 if @features is 0-terminated * * Request that the given features are prepared on each #TpChannel (in * addition to %TP_CHANNEL_FEATURE_CORE) before calling * #TpBaseClientClass.observe_channels, * #TpBaseClientClass.add_dispatch_operation or * #TpBaseClientClass.handle_channels. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_channel_features() instead. */ void tp_base_client_add_channel_features (TpBaseClient *self, const GQuark *features, gssize n) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); _tp_quark_array_merge (self->priv->channel_features, features, n); } /** * tp_base_client_add_connection_features: * @self: a client * @features: (array length=n): the features * @n: the number of features, or -1 if @features is 0-terminated * * Request that the given features are prepared on each #TpConnection (in * addition to %TP_CONNECTION_FEATURE_CORE) before calling * #TpBaseClientClass.observe_channels, * #TpBaseClientClass.add_dispatch_operation or * #TpBaseClientClass.handle_channels. * * Since: 0.11.14 * Deprecated: New code should use * tp_simple_client_factory_add_connection_features() instead. */ void tp_base_client_add_connection_features (TpBaseClient *self, const GQuark *features, gssize n) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); _tp_quark_array_merge (self->priv->connection_features, features, n); } /** * tp_base_client_set_channel_factory: * @self: a #TpBaseClient * @factory: an object implementing the #TpClientChannelFactoryInterface * interface * * Change the value of the #TpBaseClient:channel-factory property. * It can't be changed once @self has been registered. * * Since: 0.13.2 * Deprecated: since 0.15.5. The factory is taken from * #TpBaseClient:account-manager. */ void tp_base_client_set_channel_factory (TpBaseClient *self, TpClientChannelFactory *factory) { _tp_base_client_set_channel_factory (self, factory); } void _tp_base_client_set_channel_factory (TpBaseClient *self, TpClientChannelFactory *factory) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (factory == NULL || TP_IS_CLIENT_CHANNEL_FACTORY (factory)); tp_clear_object (&self->priv->channel_factory); if (factory != NULL) self->priv->channel_factory = g_object_ref (factory); g_object_notify (G_OBJECT (self), "channel-factory"); } /** * tp_base_client_get_channel_factory: (skip) * @self: a #TpBaseClient * * Return the #TpBaseClient:channel-factory property. * * Returns: the value of #TpBaseClient:channel-factory * Since: 0.13.2 * Deprecated: since 0.15.5. The factory is taken from * #TpBaseClient:account-manager. */ TpClientChannelFactory * tp_base_client_get_channel_factory (TpBaseClient *self) { g_return_val_if_fail (TP_IS_BASE_CLIENT (self), NULL); return self->priv->channel_factory; } /** * tp_base_client_is_handling_channel: * @self: a #TpBaseClient * @channel: a #TpChannel * * Check if @self is currently handling @channel. * * Returns: %TRUE if @self is handling @channel, %FALSE otherwise * Since: 0.14.5 */ gboolean tp_base_client_is_handling_channel (TpBaseClient *self, TpChannel *channel) { GList *channels, *l; gboolean found = FALSE; g_return_val_if_fail (TP_IS_BASE_CLIENT (self), FALSE); g_return_val_if_fail (self->priv->flags & CLIENT_IS_HANDLER, FALSE); channels = tp_base_client_dup_handled_channels (self); for (l = channels; l != NULL && !found; l = g_list_next (l)) { TpChannel *chan = l->data; if (!tp_strdiff (tp_proxy_get_object_path (channel), tp_proxy_get_object_path (chan))) found = TRUE; } g_list_free_full (channels, g_object_unref); return found; } void _tp_base_client_now_handling_channels (TpBaseClient *self, GPtrArray *channels) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (channels != NULL); /* It only makes sense to update HandledChannels if the client is * a Handler */ if (self->priv->flags & CLIENT_IS_HANDLER) add_handled_channels (self, channels); } typedef struct { /* Array of reffed TpChannel */ GPtrArray *channels; /* Array of reffed TpChannel */ GPtrArray *delegated; /* reffed TpChannel => owned GError */ GHashTable *not_delegated; } DelegateChannelsCtx; static DelegateChannelsCtx * delegate_channels_ctx_new (GList *channels) { DelegateChannelsCtx *ctx = g_slice_new0 (DelegateChannelsCtx); GList *l; ctx->channels = g_ptr_array_new_full (g_list_length (channels), g_object_unref); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); g_ptr_array_add (ctx->channels, g_object_ref (channel)); } ctx->delegated = g_ptr_array_new_with_free_func (g_object_unref); ctx->not_delegated = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, (GDestroyNotify) g_error_free); return ctx; } static void delegate_channels_ctx_free (DelegateChannelsCtx *ctx) { g_ptr_array_unref (ctx->channels); g_ptr_array_unref (ctx->delegated); g_hash_table_unref (ctx->not_delegated); g_slice_free (DelegateChannelsCtx, ctx); } static gboolean path_is_in_array (const GPtrArray *array, const gchar *path) { guint i; for (i = 0; array->len; i++) { if (!tp_strdiff (g_ptr_array_index (array, i), path)) return TRUE; } return FALSE; } static void delegate_channels_cb (TpChannelDispatcher *cd, const GPtrArray *delegated, GHashTable *not_delegated, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; TpBaseClient *self = (TpBaseClient *) weak_object; if (error != NULL) { g_simple_async_result_set_from_error (result, error); } else { DelegateChannelsCtx *ctx; guint i; ctx = g_simple_async_result_get_op_res_gpointer (result); for (i = 0; i < ctx->channels->len; i++) { TpChannel *channel = g_ptr_array_index (ctx->channels, i); const gchar *path; GValueArray *v; const gchar *dbus_error, *msg; GError *err = NULL; path = tp_proxy_get_object_path (channel); if (path_is_in_array (delegated, path)) { /* We are no longer handling this channel */ g_hash_table_remove (self->priv->my_chans, path); g_ptr_array_add (ctx->delegated, g_object_ref (channel)); continue; } v = g_hash_table_lookup (not_delegated, path); if (v == NULL) { DEBUG ("MC didn't tell us if we are still handling or not %s", path); continue; } tp_value_array_unpack (v, 2, &dbus_error, &msg); tp_proxy_dbus_error_to_gerror (cd, dbus_error, msg, &err); /* Pass ownership of the error to the hash table */ g_hash_table_insert (ctx->not_delegated, g_object_ref (channel), err); } } g_simple_async_result_complete_in_idle (result); } /** * tp_base_client_delegate_channels_async: * @self: a #TpBaseClient * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel * handled by @self * @user_action_time: the time at which user action occurred, * or #TP_USER_ACTION_TIME_NOT_USER_ACTION if this delegation request is * for some reason not involving user action. * @preferred_handler: Either the well-known bus name (starting with * %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channels, * or %NULL to indicate that any handler but @self would be acceptable. * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls DelegateChannels on the ChannelDispatcher to try * stopping handling @channels and pass them to another Handler. * You can then call tp_base_client_delegate_channels_finish() to * get the result of the operation. * * Since: 0.15.0 */ void tp_base_client_delegate_channels_async (TpBaseClient *self, GList *channels, gint64 user_action_time, const gchar *preferred_handler, GAsyncReadyCallback callback, gpointer user_data) { TpChannelDispatcher *cd; GSimpleAsyncResult *result; DelegateChannelsCtx *ctx; GPtrArray *chans; GList *l; g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (self->priv->flags & CLIENT_IS_HANDLER); cd = tp_channel_dispatcher_new (self->priv->dbus); chans = g_ptr_array_new_full (g_list_length (channels), g_free); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_return_if_fail (TP_IS_CHANNEL (channel)); g_ptr_array_add (chans, g_strdup (tp_proxy_get_object_path (channel))); } result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_base_client_delegate_channels_async); ctx = delegate_channels_ctx_new (channels); g_simple_async_result_set_op_res_gpointer (result, ctx, (GDestroyNotify) delegate_channels_ctx_free); /* DelegateChannels() can takes a while if, for example, some clients are * crashing and so MC has to wait for them to time out before calling the * next handler. Set a timeout of 2 minutes. */ tp_cli_channel_dispatcher_call_delegate_channels (cd, 1000 * 60 * 2, chans, user_action_time, preferred_handler == NULL ? "" : preferred_handler, delegate_channels_cb, result, g_object_unref, G_OBJECT (self)); g_object_unref (cd); g_ptr_array_unref (chans); } /** * tp_base_client_delegate_channels_finish: * @self: a #TpBaseClient * @result: a #GAsyncResult * @delegated: (out) (element-type TelepathyGLib.Channel) (transfer container): * if not %NULL, used to return a #GPtrArray containing the #TpChannels * which have been properly delegated * @not_delegated: (out) (element-type TelepathyGLib.Channel GLib.Error) (transfer container): * if not not %NULL, used to return a #GHashTable mapping #TpChannels * which have not been delegated to a #GError explaining the reason of * the failure * @error: a #GError to fill * * Finishes an async channels delegation request started using * tp_base_client_delegate_channels_async(). * * Returns: %TRUE if the operation succeed, @delegated and @not_delegated * can be used to know the channels that @self is not handling any more, * otherwise %FALSE. * * Since: 0.15.0 */ gboolean tp_base_client_delegate_channels_finish (TpBaseClient *self, GAsyncResult *result, GPtrArray **delegated, GHashTable **not_delegated, GError **error) { DelegateChannelsCtx *ctx; GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); ctx = g_simple_async_result_get_op_res_gpointer (simple); if (g_simple_async_result_propagate_error (simple, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), tp_base_client_delegate_channels_async), FALSE); if (delegated != NULL) *delegated = g_ptr_array_ref (ctx->delegated); if (not_delegated != NULL) *not_delegated = g_hash_table_ref (ctx->not_delegated); return TRUE; } /** * tp_base_client_set_delegated_channels_callback: * @self: a #TpBaseClient implementing Handler * @callback: function called when channels currently handled by @self are * delegated, may not be %NULL * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with the @user_data as argument, when @self is destroyed * * Turn on support for * the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler * hint. * * When receiving a request containing this hint, @self will automatically * delegate the channels to the preferred handler of the request and then call * @callback to inform the client that it is no longer handling those * channels. * * Since: 0.15.3 */ void tp_base_client_set_delegated_channels_callback (TpBaseClient *self, TpBaseClientDelegatedChannelsCb callback, gpointer user_data, GDestroyNotify destroy) { g_return_if_fail (TP_IS_BASE_CLIENT (self)); g_return_if_fail (self->priv->flags & CLIENT_IS_HANDLER); g_return_if_fail (!self->priv->registered); g_return_if_fail (self->priv->delegated_channels_cb == NULL); self->priv->delegated_channels_cb = callback; self->priv->delegated_channels_data = user_data; self->priv->delegated_channels_destroy = destroy; } telepathy-glib-0.24.2/telepathy-glib/base-client.h0000644000175000017500000002262612652510705016716 00000000000000/* * Base class for Client implementations * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CLIENT_H__ #define __TP_BASE_CLIENT_H__ #include #include #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS /* forward declaration, see channel-dispatch-operation.h for the rest */ typedef struct _TpChannelDispatchOperation TpChannelDispatchOperation; typedef struct _TpBaseClient TpBaseClient; typedef struct _TpBaseClientClass TpBaseClientClass; typedef struct _TpBaseClientPrivate TpBaseClientPrivate; typedef struct _TpBaseClientClassPrivate TpBaseClientClassPrivate; typedef void (*TpBaseClientClassObserveChannelsImpl) ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context); typedef void (*TpBaseClientClassAddDispatchOperationImpl) ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context); typedef void (*TpBaseClientClassHandleChannelsImpl) ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisfied, gint64 user_action_time, TpHandleChannelsContext *context); struct _TpBaseClientClass { /**/ GObjectClass parent_class; TpBaseClientClassObserveChannelsImpl observe_channels; TpBaseClientClassAddDispatchOperationImpl add_dispatch_operation; TpBaseClientClassHandleChannelsImpl handle_channels; /**/ GCallback _padding[4]; TpDBusPropertiesMixinClass dbus_properties_class; TpBaseClientClassPrivate *priv; }; struct _TpBaseClient { /**/ GObject parent; TpBaseClientPrivate *priv; }; GType tp_base_client_get_type (void); /* Protected methods; should be called only by subclasses */ void tp_base_client_implement_observe_channels (TpBaseClientClass *klass, TpBaseClientClassObserveChannelsImpl impl); void tp_base_client_implement_add_dispatch_operation (TpBaseClientClass *klass, TpBaseClientClassAddDispatchOperationImpl impl); void tp_base_client_implement_handle_channels (TpBaseClientClass *klass, TpBaseClientClassHandleChannelsImpl impl); /* setup functions which can only be called before register() */ void tp_base_client_add_observer_filter (TpBaseClient *self, GHashTable *filter); _TP_AVAILABLE_IN_0_20 void tp_base_client_add_observer_filter_vardict (TpBaseClient *self, GVariant *filter); void tp_base_client_take_observer_filter (TpBaseClient *self, GHashTable *filter); void tp_base_client_set_observer_recover (TpBaseClient *self, gboolean recover); void tp_base_client_set_observer_delay_approvers (TpBaseClient *self, gboolean delay); void tp_base_client_add_approver_filter (TpBaseClient *self, GHashTable *filter); void tp_base_client_take_approver_filter (TpBaseClient *self, GHashTable *filter); _TP_AVAILABLE_IN_0_20 void tp_base_client_add_approver_filter_vardict (TpBaseClient *self, GVariant *filter); void tp_base_client_be_a_handler (TpBaseClient *self); void tp_base_client_add_handler_filter (TpBaseClient *self, GHashTable *filter); void tp_base_client_take_handler_filter (TpBaseClient *self, GHashTable *filter); _TP_AVAILABLE_IN_0_20 void tp_base_client_add_handler_filter_vardict (TpBaseClient *self, GVariant *filter); void tp_base_client_set_handler_bypass_approval (TpBaseClient *self, gboolean bypass_approval); void tp_base_client_set_handler_request_notification (TpBaseClient *self); void tp_base_client_add_handler_capability (TpBaseClient *self, const gchar *token); void tp_base_client_add_handler_capabilities (TpBaseClient *self, const gchar * const *tokens); void tp_base_client_add_handler_capabilities_varargs (TpBaseClient *self, const gchar *first_token, ...) G_GNUC_NULL_TERMINATED; #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_account_features) void tp_base_client_add_account_features (TpBaseClient *self, const GQuark *features, gssize n); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_account_features_varargs) void tp_base_client_add_account_features_varargs (TpBaseClient *self, GQuark feature, ...); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_channel_features) void tp_base_client_add_channel_features (TpBaseClient *self, const GQuark *features, gssize n); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_channel_features_varargs) void tp_base_client_add_channel_features_varargs (TpBaseClient *self, GQuark feature, ...); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_connection_features) void tp_base_client_add_connection_features (TpBaseClient *self, const GQuark *features, gssize n); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_add_connection_features_varargs) void tp_base_client_add_connection_features_varargs (TpBaseClient *self, GQuark feature, ...); _TP_DEPRECATED_IN_0_16 void tp_base_client_set_channel_factory (TpBaseClient *self, TpClientChannelFactory *factory); _TP_DEPRECATED_IN_0_16 TpClientChannelFactory *tp_base_client_get_channel_factory ( TpBaseClient *self); #endif typedef void (*TpBaseClientDelegatedChannelsCb) ( TpBaseClient *client, GPtrArray *channels, gpointer user_data); _TP_AVAILABLE_IN_0_16 void tp_base_client_set_delegated_channels_callback (TpBaseClient *self, TpBaseClientDelegatedChannelsCb callback, gpointer user_data, GDestroyNotify destroy); /* future, potentially (currently in spec as a draft): void tp_base_client_set_handler_related_conferences_bypass_approval ( TpBaseClient *self, gboolean bypass_approval); */ gboolean tp_base_client_register (TpBaseClient *self, GError **error); /* Normal methods, can be called at any time */ #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_base_client_dup_pending_requests) GList *tp_base_client_get_pending_requests (TpBaseClient *self); _TP_DEPRECATED_IN_0_20_FOR (tp_base_client_dup_handled_channels) GList *tp_base_client_get_handled_channels (TpBaseClient *self); #endif _TP_AVAILABLE_IN_0_20 GList *tp_base_client_dup_pending_requests (TpBaseClient *self); _TP_AVAILABLE_IN_0_20 GList *tp_base_client_dup_handled_channels (TpBaseClient *self); gboolean tp_base_client_is_handling_channel (TpBaseClient *self, TpChannel *channel); _TP_AVAILABLE_IN_0_16 void tp_base_client_delegate_channels_async (TpBaseClient *self, GList *channels, gint64 user_action_time, const gchar *preferred_handler, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_base_client_delegate_channels_finish (TpBaseClient *self, GAsyncResult *result, GPtrArray **delegated, GHashTable **not_delegated, GError **error); const gchar *tp_base_client_get_name (TpBaseClient *self); gboolean tp_base_client_get_uniquify_name (TpBaseClient *self); const gchar *tp_base_client_get_bus_name (TpBaseClient *self); const gchar *tp_base_client_get_object_path (TpBaseClient *self); TpDBusDaemon *tp_base_client_get_dbus_daemon (TpBaseClient *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16 TpAccountManager *tp_base_client_get_account_manager (TpBaseClient *self); #endif void tp_base_client_unregister (TpBaseClient *self); #define TP_TYPE_BASE_CLIENT \ (tp_base_client_get_type ()) #define TP_BASE_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASE_CLIENT, \ TpBaseClient)) #define TP_BASE_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASE_CLIENT, \ TpBaseClientClass)) #define TP_IS_BASE_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASE_CLIENT)) #define TP_IS_BASE_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASE_CLIENT)) #define TP_BASE_CLIENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CLIENT, \ TpBaseClientClass)) G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/connection-manager.xml0000644000175000017500000000036612652510705020645 00000000000000 Connection Manager interfaces telepathy-glib-0.24.2/telepathy-glib/signalled-message-internal.h0000644000175000017500000000316512652510705021723 00000000000000/**/ /* * signalled-message-internal.h - Header for TpSignalledMessage (internal) * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_SIGNALLED_MESSAGE_INTERNAL_H__ #define __TP_SIGNALLED_MESSAGE_INTERNAL_H__ #include #include "signalled-message.h" #include "message.h" #include "message-internal.h" G_BEGIN_DECLS typedef struct _TpSignalledMessagePrivate TpSignalledMessagePrivate; struct _TpSignalledMessageClass { /**/ TpMessageClass parent_class; }; struct _TpSignalledMessage { /**/ TpMessage parent; TpSignalledMessagePrivate *priv; }; TpMessage * _tp_signalled_message_new (const GPtrArray *parts, TpContact *sender); guint _tp_signalled_message_get_pending_message_id (TpMessage *message, gboolean *valid); G_END_DECLS #endif /* __TP_Signalled_MESSAGE_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/handle-repo.c0000644000175000017500000003273212652510705016720 00000000000000/* * handle-repo.c - mechanism to store and retrieve handles on a connection * (abstract interface) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:handle-repo * @title: TpHandleRepoIface * @short_description: abstract interface for handle allocation * @see_also: TpDynamicHandleRepo, TpStaticHandleRepo * * Abstract interface of a repository for handles, supporting operations * which include checking for validity, lookup by * string value and lookup by numeric value. See #TpDynamicHandleRepo * and #TpStaticHandleRepo for concrete implementations. */ #include "config.h" #include #include #include G_DEFINE_INTERFACE (TpHandleRepoIface, tp_handle_repo_iface, G_TYPE_OBJECT); /** * tp_handle_is_valid: (skip) * @self: A handle repository implementation * @handle: A handle of the type stored in the repository @self * @error: Set to InvalidHandle if %FALSE is returned * * * * Returns: %TRUE if the handle is nonzero and is present in the repository, * else %FALSE */ gboolean tp_handle_is_valid (TpHandleRepoIface *self, TpHandle handle, GError **error) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->handle_is_valid (self, handle, error); } /** * tp_handles_are_valid: (skip) * @self: A handle repository implementation * @handles: Array of TpHandle representing handles of the type stored in * the repository @self * @allow_zero: If %TRUE, zero is treated like a valid handle * @error: Set to InvalidHandle if %FALSE is returned * * * * Returns: %TRUE if the handle is present in the repository, else %FALSE */ gboolean tp_handles_are_valid (TpHandleRepoIface *self, const GArray *handles, gboolean allow_zero, GError **error) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->handles_are_valid (self, handles, allow_zero, error); } /** * tp_handle_ref: (skip) * @self: not used * @handle: not used * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Changed in 0.13.6: @handle is now returned; previously, * this function didn't return anything. * * Returns: the same @handle * Deprecated: This is no-op so can be safely removed. */ TpHandle tp_handle_ref (TpHandleRepoIface *self G_GNUC_UNUSED, TpHandle handle) { return handle; } /** * tp_handles_ref: (skip) * @self: not used * @handles: not used * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Deprecated: This is no-op so can be safely removed. */ void tp_handles_ref (TpHandleRepoIface *self G_GNUC_UNUSED, const GArray *handles G_GNUC_UNUSED) { } /** * tp_handle_unref: (skip) * @self: A handle repository implementation * @handle: A handle of the type stored in the repository * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Deprecated: This is no-op so can be safely removed. */ void tp_handle_unref (TpHandleRepoIface *self G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED) { } /** * tp_handles_unref: (skip) * @self: not used * @handles: not used * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Deprecated: This is no-op so can be safely removed. */ void tp_handles_unref (TpHandleRepoIface *self G_GNUC_UNUSED, const GArray *handles G_GNUC_UNUSED) { } /** * tp_handle_client_hold: (skip) * @self: not used * @client: not used * @handle: not used * @error: not set * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Returns: %TRUE * Deprecated: This is no-op so can be safely removed. */ gboolean tp_handle_client_hold (TpHandleRepoIface *self G_GNUC_UNUSED, const gchar *client G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } typedef gboolean (*HoldReleaseFunc) (TpHandleRepoIface *, const gchar *, TpHandle, GError **); /** * tp_handles_client_hold: (skip) * @self: ignored * @client: ignored * @handles: ignored * @error: ignored * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Returns: %TRUE * Deprecated: This is no-op so can be safely removed. */ gboolean tp_handles_client_hold (TpHandleRepoIface *self G_GNUC_UNUSED, const gchar *client G_GNUC_UNUSED, const GArray *handles G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } /** * tp_handle_client_release: (skip) * @self: ignored * @client: ignored * @handle: ignored * @error: ignored * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Returns: %TRUE * Deprecated: This is no-op so can be safely removed. */ gboolean tp_handle_client_release (TpHandleRepoIface *self G_GNUC_UNUSED, const gchar *client G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } /** * tp_handles_client_release: (skip) * @self: ignored * @client: ignored * @handles: ignored * @error: ignored * * Do nothing. Since version 0.13.8, handles always last as long as * the connection; previously, this function provided refcounting for handles. * * Returns: %TRUE * Deprecated: This is no-op so can be safely removed. */ gboolean tp_handles_client_release (TpHandleRepoIface *self G_GNUC_UNUSED, const gchar *client G_GNUC_UNUSED, const GArray *handles G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } /** * tp_handle_inspect: (skip) * @self: A handle repository implementation * @handle: A handle of the type stored in the repository * * * * Returns: the string represented by the given handle, or NULL if the * handle is absent from the repository. The string is owned by the * handle repository and will remain valid as long as a reference to * the handle exists. */ const char * tp_handle_inspect (TpHandleRepoIface *self, TpHandle handle) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->inspect_handle (self, handle); } /** * tp_handle_ensure: * @self: A handle repository implementation * @id: A string whose handle is required * @context: User data to be passed to the normalization callback * @error: Used to return an error if 0 is returned * * Return a handle for the given string, creating one if necessary. The string * is normalized, if possible. * * Returns: the handle corresponding to the given string, or 0 if it * is invalid. */ TpHandle tp_handle_ensure (TpHandleRepoIface *self, const gchar *id, gpointer context, GError **error) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->ensure_handle (self, id, context, error); } /** * tp_handle_ensure_async: (skip) * @self: A handle repository implementation * @connection: the #TpBaseConnection using this handle repo * @id: A string whose handle is required * @context: User data to be passed to the normalization callback * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Asyncronously normalize an identifier and create an handle for it. This could * involve a server round-trip. This should be used instead of * tp_handle_ensure() for user provided contact identifiers, but it is not * necessary for identifiers from the server. * * Since: 0.19.2 */ void tp_handle_ensure_async (TpHandleRepoIface *self, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->ensure_handle_async (self, connection, id, context, callback, user_data); } /** * tp_handle_ensure_finish: (skip) * @self: A handle repository implementation * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_handle_ensure_async() * * Returns: non-0 #TpHandle if the operation was successful, otherwise 0. * * Since: 0.19.2 */ TpHandle tp_handle_ensure_finish (TpHandleRepoIface *self, GAsyncResult *result, GError **error) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->ensure_handle_finish (self, result, error); } /** * tp_handle_lookup: (skip) * @self: A handle repository implementation * @id: A string whose handle is required * @context: User data to be passed to the normalization callback * @error: Used to raise an error if the handle does not exist or is * invalid * * Return the handle for the given string. The string is normalized if * possible. If no handle already exists for the string, none is created. * * Returns: the handle corresponding to the given string, or 0 if it * does not exist or is invalid */ TpHandle tp_handle_lookup (TpHandleRepoIface *self, const gchar *id, gpointer context, GError **error) { return TP_HANDLE_REPO_IFACE_GET_CLASS (self)->lookup_handle (self, id, context, error); } /** * tp_handle_set_qdata: (skip) * @repo: A handle repository implementation * @handle: A handle to set data on * @key_id: Key id to associate data with * @data: data to associate with handle * @destroy: A #GDestroyNotify to call to destroy the data, * or NULL if not needed. * * Associates a blob of data with a given handle and a given key * * If @destroy is set, then the data is freed when the handle is freed. * * Since version 0.13.8, handles always last as long as the * connection, so @destroy will not be called until the connection * disconnects. * * Deprecated: Since 0.19.9. It is not recommended to use this function * because the associated data won't be freed until the connection disconnects. */ void tp_handle_set_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy) { TP_HANDLE_REPO_IFACE_GET_CLASS (repo)->set_qdata (repo, handle, key_id, data, destroy); } /** * tp_handle_get_qdata: (skip) * @repo: A handle repository implementation * @handle: A handle to get data from * @key_id: Key id of data to fetch * * * * Returns: the data associated with a given key on a given handle; %NULL * if there is no associated data. * Deprecated: Since 0.19.9. It is not recommended to use this function * because the associated data won't be freed until the connection disconnects. */ gpointer tp_handle_get_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id) { return TP_HANDLE_REPO_IFACE_GET_CLASS (repo)->get_qdata (repo, handle, key_id); } static void default_ensure_handle_async (TpHandleRepoIface *self, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; TpHandle handle; GError *error = NULL; result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, default_ensure_handle_async); handle = tp_handle_ensure (self, id, context, &error); if (handle == 0) { g_simple_async_result_take_error (result, error); } else { g_simple_async_result_set_op_res_gpointer (result, GUINT_TO_POINTER (handle), NULL); } g_simple_async_result_complete_in_idle (result); g_object_unref (result); } static TpHandle default_ensure_handle_finish (TpHandleRepoIface *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), NULL), 0); if (g_simple_async_result_propagate_error (simple, error)) return 0; return GPOINTER_TO_UINT (g_simple_async_result_get_op_res_gpointer (simple)); } static void tp_handle_repo_iface_default_init (TpHandleRepoIfaceInterface *iface) { GParamSpec *param_spec; iface->ensure_handle_async = default_ensure_handle_async; iface->ensure_handle_finish = default_ensure_handle_finish; param_spec = g_param_spec_uint ("handle-type", "Handle type", "The TpHandleType held in this handle repository.", 0, G_MAXUINT32, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (iface, param_spec); } telepathy-glib-0.24.2/telepathy-glib/handle-repo.h0000644000175000017500000002003612652510705016717 00000000000000/* * tp-handle-repo.h - handle reference-counting for connection managers * * Copyright (C) 2005,2006,2007 Collabora Ltd. * Copyright (C) 2005,2006,2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HANDLE_REPO_H__ #define __TP_HANDLE_REPO_H__ #include #include #include #include G_BEGIN_DECLS /* Forward declaration to avoid circular includes */ typedef struct _TpBaseConnection TpBaseConnection; /* Forward declaration because it's in the HandleRepo API */ #define TP_TYPE_HANDLE_SET (tp_handle_set_get_type ()) GType tp_handle_set_get_type (void); typedef struct _TpHandleSet TpHandleSet; /* Handle repository abstract interface */ #define TP_TYPE_HANDLE_REPO_IFACE (tp_handle_repo_iface_get_type ()) #define TP_HANDLE_REPO_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_HANDLE_REPO_IFACE, TpHandleRepoIface)) #define TP_IS_HANDLE_REPO_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_HANDLE_REPO_IFACE)) #define TP_HANDLE_REPO_IFACE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_HANDLE_REPO_IFACE, TpHandleRepoIfaceClass)) /** * TpHandleRepoIface: * * Dummy typedef representing any implementation of this interface. */ typedef struct _TpHandleRepoIface TpHandleRepoIface; /** * TpHandleRepoIfaceClass: * * The class of a handle repository interface. The structure layout is * only available within telepathy-glib, for the handle repository * implementations' benefit. */ typedef struct _TpHandleRepoIfaceClass TpHandleRepoIfaceClass; GType tp_handle_repo_iface_get_type (void); /* Public API for handle repositories */ gboolean tp_handle_is_valid (TpHandleRepoIface *self, TpHandle handle, GError **error); gboolean tp_handles_are_valid (TpHandleRepoIface *self, const GArray *handles, gboolean allow_zero, GError **error); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 TpHandle tp_handle_ref (TpHandleRepoIface *self, TpHandle handle); _TP_DEPRECATED_IN_0_20 void tp_handles_ref (TpHandleRepoIface *self, const GArray *handles); _TP_DEPRECATED_IN_0_20 void tp_handle_unref (TpHandleRepoIface *self, TpHandle handle); _TP_DEPRECATED_IN_0_20 void tp_handles_unref (TpHandleRepoIface *self, const GArray *handles); _TP_DEPRECATED_IN_0_20 gboolean tp_handle_client_hold (TpHandleRepoIface *self, const gchar *client, TpHandle handle, GError **error); _TP_DEPRECATED_IN_0_20 gboolean tp_handles_client_hold (TpHandleRepoIface *self, const gchar *client, const GArray *handles, GError **error); _TP_DEPRECATED_IN_0_20 gboolean tp_handle_client_release (TpHandleRepoIface *self, const gchar *client, TpHandle handle, GError **error); _TP_DEPRECATED_IN_0_20 gboolean tp_handles_client_release (TpHandleRepoIface *self, const gchar *client, const GArray *handles, GError **error); #endif const char *tp_handle_inspect (TpHandleRepoIface *self, TpHandle handle) G_GNUC_WARN_UNUSED_RESULT; TpHandle tp_handle_lookup (TpHandleRepoIface *self, const gchar *id, gpointer context, GError **error); TpHandle tp_handle_ensure (TpHandleRepoIface *self, const gchar *id, gpointer context, GError **error) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 void tp_handle_ensure_async (TpHandleRepoIface *self, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_20 TpHandle tp_handle_ensure_finish (TpHandleRepoIface *self, GAsyncResult *result, GError **error); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 void tp_handle_set_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy); _TP_DEPRECATED_IN_0_20 gpointer tp_handle_get_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id); #endif /* Handle set helper class */ typedef void (*TpHandleSetMemberFunc)(TpHandleSet *set, TpHandle handle, gpointer userdata); TpHandleSet * tp_handle_set_new (TpHandleRepoIface *repo) G_GNUC_WARN_UNUSED_RESULT; TpHandleSet *tp_handle_set_copy (const TpHandleSet *other) G_GNUC_WARN_UNUSED_RESULT; TpHandleSet *tp_handle_set_new_from_intset (TpHandleRepoIface *repo, const TpIntset *intset); TpHandleSet *tp_handle_set_new_containing (TpHandleRepoIface *repo, TpHandle handle); void tp_handle_set_clear (TpHandleSet *set); void tp_handle_set_destroy (TpHandleSet *set); TpIntset *tp_handle_set_peek (TpHandleSet *set) G_GNUC_WARN_UNUSED_RESULT; void tp_handle_set_add (TpHandleSet *set, TpHandle handle); gboolean tp_handle_set_remove (TpHandleSet *set, TpHandle handle); gboolean tp_handle_set_is_member (const TpHandleSet *set, TpHandle handle); void tp_handle_set_foreach (TpHandleSet *set, TpHandleSetMemberFunc func, gpointer user_data); gboolean tp_handle_set_is_empty (const TpHandleSet *set); int tp_handle_set_size (const TpHandleSet *set); GArray *tp_handle_set_to_array (const TpHandleSet *set) G_GNUC_WARN_UNUSED_RESULT; GHashTable *tp_handle_set_to_identifier_map (TpHandleSet *self) G_GNUC_WARN_UNUSED_RESULT; TpHandleSet *tp_handle_set_new_from_array (TpHandleRepoIface *repo, const GArray *array) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_handle_set_update (TpHandleSet *set, const TpIntset *add) G_GNUC_WARN_UNUSED_RESULT; TpIntset *tp_handle_set_difference_update (TpHandleSet *set, const TpIntset *remove) G_GNUC_WARN_UNUSED_RESULT; gchar *tp_handle_set_dump (const TpHandleSet *self) G_GNUC_WARN_UNUSED_RESULT; /* static inline because it relies on TP_NUM_HANDLE_TYPES */ /** * tp_handles_supported_and_valid: (skip) * @repos: An array of possibly null pointers to handle repositories, indexed * by handle type, where a null pointer means an unsupported handle * type * @handle_type: The handle type * @handles: A GArray of guint representing handles of the given type * @allow_zero: If %TRUE, zero is treated like a valid handle * @error: Used to return an error if %FALSE is returned * * Return %TRUE if the given handle type is supported (i.e. repos[handle_type] * is not %NULL) and the given handles are all valid in that repository. * If not, set @error and return %FALSE. * * Returns: %TRUE if the handle type is supported and the handles are all * valid. */ static inline /* spacer so gtkdoc documents this function as though not static */ gboolean tp_handles_supported_and_valid ( TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES], TpHandleType handle_type, const GArray *handles, gboolean allow_zero, GError **error); static inline gboolean tp_handles_supported_and_valid (TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES], TpHandleType handle_type, const GArray *handles, gboolean allow_zero, GError **error) { if (!tp_handle_type_is_valid (handle_type, error)) return FALSE; if (!repos[handle_type]) { tp_g_set_error_unsupported_handle_type (handle_type, error); return FALSE; } return tp_handles_are_valid (repos[handle_type], handles, allow_zero, error); } G_END_DECLS #endif /*__HANDLE_SET_H__*/ telepathy-glib-0.24.2/telepathy-glib/room-list.c0000644000175000017500000003463012652510705016446 00000000000000/* * room-list.c - High level API for listing room channels * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:room-list * @title: TpRoomList * @short_description: proxy object for a room list channel * * #TpRoomList provides convenient API to list rooms. */ /** * TpRoomList: * * Data structure representing a #TpRoomList. * * Since: 0.19.0 */ /** * TpRoomListClass: * * The class of a #TpRoomList. * * Since: 0.19.0 */ #include #include "telepathy-glib/room-list.h" #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/debug-internal.h" #include #include static void async_initable_iface_init (GAsyncInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (TpRoomList, tp_room_list, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)) struct _TpRoomListPrivate { TpAccount *account; gchar *server; gboolean listing; TpChannel *channel; GSimpleAsyncResult *async_res; gulong invalidated_id; }; enum { PROP_ACCOUNT = 1, PROP_SERVER, PROP_LISTING, }; enum { SIG_GOT_ROOM, SIG_FAILED, LAST_SIGNAL }; static guint signals[LAST_SIGNAL]; static void tp_room_list_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpRoomList *self = (TpRoomList *) object; switch (property_id) { case PROP_ACCOUNT: g_value_set_object (value, tp_room_list_get_account (self)); break; case PROP_SERVER: g_value_set_string (value, tp_room_list_get_server (self)); break; case PROP_LISTING: g_value_set_boolean (value, self->priv->listing); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_room_list_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpRoomList *self = (TpRoomList *) object; switch (property_id) { case PROP_ACCOUNT: g_assert (self->priv->account == NULL); /* construct only */ self->priv->account = g_value_dup_object (value); break; case PROP_SERVER: g_assert (self->priv->server == NULL); /* construct only */ self->priv->server = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void got_rooms_cb (TpChannel *channel, const GPtrArray *rooms, gpointer user_data, GObject *weak_object) { TpRoomList *self = TP_ROOM_LIST (weak_object); guint i; for (i = 0; i < rooms->len; i++) { TpRoomInfo *room; room = _tp_room_info_new (g_ptr_array_index (rooms, i)); g_signal_emit (self, signals[SIG_GOT_ROOM], 0, room); g_object_unref (room); } } static void listing_rooms_cb (TpChannel *proxy, gboolean listing, gpointer user_data, GObject *weak_object) { TpRoomList *self = TP_ROOM_LIST (weak_object); if (self->priv->listing == listing) return; self->priv->listing = listing; g_object_notify (G_OBJECT (self), "listing"); } static void destroy_channel (TpRoomList *self) { if (self->priv->channel == NULL) return; DEBUG ("Destroying existing RoomList channel"); tp_channel_destroy_async (self->priv->channel, NULL, NULL); tp_clear_object (&self->priv->channel); } static void tp_room_list_dispose (GObject *object) { TpRoomList *self = TP_ROOM_LIST (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_room_list_parent_class)->dispose; if (self->priv->channel != NULL) g_signal_handler_disconnect (self->priv->channel, self->priv->invalidated_id); destroy_channel (self); g_clear_object (&self->priv->account); if (chain_up != NULL) chain_up (object); } static void tp_room_list_finalize (GObject *object) { TpRoomList *self = TP_ROOM_LIST (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_room_list_parent_class)->finalize; g_free (self->priv->server); if (chain_up != NULL) chain_up (object); } static void tp_room_list_class_init (TpRoomListClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; gobject_class->get_property = tp_room_list_get_property; gobject_class->set_property = tp_room_list_set_property; gobject_class->dispose = tp_room_list_dispose; gobject_class->finalize = tp_room_list_finalize; /** * TpRoomList:account: * * The #TpAccount to use for the room listing. * * Since: 0.19.0 */ param_spec = g_param_spec_object ("account", "account", "TpAccount", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_ACCOUNT, param_spec); /** * TpRoomList:server: * * The DNS name of the server whose rooms are listed by this channel, or * %NULL. * * Since: 0.19.0 */ param_spec = g_param_spec_string ("server", "Server", "The server associated with the channel", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SERVER, param_spec); /** * TpRoomList:listing: * * %TRUE if the channel is currently listing rooms. * * This property is meaningless until the * %TP_ROOM_LIST_FEATURE_LISTING feature has been prepared. * * Since: 0.19.0 */ param_spec = g_param_spec_boolean ("listing", "Listing", "TRUE if the channel is listing rooms", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_LISTING, param_spec); /** * TpRoomList::got-room: * @self: a #TpRoomList * @room: a #TpRoomInfo * * Fired each time a room is found during the listing process. * User should take his own reference on @room if he plans to * continue using it once the signal callback has returned. * * Since: 0.19.0 */ signals[SIG_GOT_ROOM] = g_signal_new ("got-room", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_ROOM_INFO); /** * TpRoomList::failed: * @self: a #TpRoomList * @error: a #GError indicating the reason of the error * * Fired when something goes wrong while listing the channels; see @error * for details. * * Since: 0.19.0 */ signals[SIG_FAILED] = g_signal_new ("failed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_ERROR); g_type_class_add_private (gobject_class, sizeof (TpRoomListPrivate)); } static void tp_room_list_init (TpRoomList *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_ROOM_LIST, TpRoomListPrivate); } /** * tp_room_list_get_account: * @self: a #TpRoomList * * Return the #TpRoomList:account property * * Returns: (transfer none): the value of #TpRoomList:account property * * Since: 0.19.0 */ TpAccount * tp_room_list_get_account (TpRoomList *self) { return self->priv->account; } /** * tp_room_list_get_server: * @self: a #TpRoomList * * Return the #TpRoomList:server property * * Returns: the value of #TpRoomList:server property * * Since: 0.19.0 */ const gchar * tp_room_list_get_server (TpRoomList *self) { return self->priv->server; } /** * tp_room_list_is_listing: * @self: a #TpRoomList * * Return the #TpRoomList:listing property * * Returns: the value of #TpRoomList:listing property * * Since: 0.19.0 */ gboolean tp_room_list_is_listing (TpRoomList *self) { return self->priv->listing; } static void list_rooms_cb (TpChannel *channel, const GError *error, gpointer user_data, GObject *weak_object) { TpRoomList *self = TP_ROOM_LIST (weak_object); if (error != NULL) { g_signal_emit (self, signals[SIG_FAILED], 0, error); } } /** * tp_room_list_start: * @self: a #TpRoomList * * Start listing rooms using @self. Use the TpRoomList::got-rooms * signal to get the rooms found. * Errors will be reported using the TpRoomList::failed signal. * * Since: 0.19.0 */ void tp_room_list_start (TpRoomList *self) { g_return_if_fail (self->priv->channel != NULL); tp_cli_channel_type_room_list_call_list_rooms (self->priv->channel, -1, list_rooms_cb, NULL, NULL, G_OBJECT (self)); } static void chan_invalidated_cb (TpChannel *channel, guint domain, gint code, gchar *message, TpRoomList *self) { GError *error = g_error_new_literal (domain, code, message); DEBUG ("RoomList channel invalidated: %s", message); g_signal_emit (self, signals[SIG_FAILED], 0, error); g_error_free (error); } static void create_channel_cb (GObject *source_object, GAsyncResult *result, gpointer user_data) { TpAccountChannelRequest *channel_request = TP_ACCOUNT_CHANNEL_REQUEST ( source_object); TpRoomList *self = user_data; GHashTable *properties; GError *error = NULL; const gchar *server; self->priv->channel = tp_account_channel_request_create_and_handle_channel_finish ( channel_request, result, NULL, &error); if (self->priv->channel == NULL) { DEBUG ("Failed to create RoomList channel: %s", error->message); goto out; } DEBUG ("Got channel: %s", tp_proxy_get_object_path (self->priv->channel)); self->priv->invalidated_id = tp_g_signal_connect_object (self->priv->channel, "invalidated", G_CALLBACK (chan_invalidated_cb), self, 0); if (tp_cli_channel_type_room_list_connect_to_got_rooms (self->priv->channel, got_rooms_cb, NULL, NULL, G_OBJECT (self), &error) == NULL) { DEBUG ("Failed to connect GotRooms signal: %s", error->message); goto out; } tp_cli_channel_type_room_list_connect_to_listing_rooms (self->priv->channel, listing_rooms_cb, NULL, NULL, G_OBJECT (self), &error); if (error != NULL) { DEBUG ("Failed to connect ListingRooms signal: %s", error->message); goto out; } properties = _tp_channel_get_immutable_properties (self->priv->channel); server = tp_asv_get_string (properties, TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER); if (tp_strdiff (server, self->priv->server)) { if (tp_str_empty (server) && self->priv->server != NULL) { g_free (self->priv->server); self->priv->server = g_strdup (server); g_object_notify (G_OBJECT (self), "server"); } } out: if (error != NULL) { g_simple_async_result_set_from_error (self->priv->async_res, error); g_error_free (error); /* This function is safe if self->priv->channel is NULL. */ destroy_channel (self); } g_simple_async_result_complete (self->priv->async_res); tp_clear_object (&self->priv->async_res); } static void open_new_channel (TpRoomList *self) { GHashTable *request; TpAccountChannelRequest *channel_request; DEBUG ("Requesting new RoomList channel"); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_ROOM_LIST, NULL); if (self->priv->server != NULL) tp_asv_set_string (request, TP_PROP_CHANNEL_TYPE_ROOM_LIST_SERVER, self->priv->server); channel_request = tp_account_channel_request_new (self->priv->account, request, TP_USER_ACTION_TIME_NOT_USER_ACTION); tp_account_channel_request_create_and_handle_channel_async (channel_request, NULL, create_channel_cb, G_OBJECT (self)); g_object_unref (channel_request); g_hash_table_unref (request); } static void room_list_init_async (GAsyncInitable *initable, gint io_priority, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { TpRoomList *self = TP_ROOM_LIST (initable); self->priv->async_res = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_room_list_new_async); open_new_channel (self); } static gboolean room_list_init_finish (GAsyncInitable *initable, GAsyncResult *res, GError **error) { if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error)) return FALSE; return TRUE; } static void async_initable_iface_init (GAsyncInitableIface *iface) { iface->init_async = room_list_init_async; iface->init_finish = room_list_init_finish; } /** * tp_room_list_new_async: * @account: a #TpAccount for the room listing * @server: the DNS name of the server whose rooms should listed * @callback: a #GAsyncReadyCallback to call when the initialization * is finished * @user_data: data to pass to the callback function * * * * Since: 0.19.0 */ void tp_room_list_new_async (TpAccount *account, const gchar *server, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_ACCOUNT (account)); g_async_initable_new_async (TP_TYPE_ROOM_LIST, G_PRIORITY_DEFAULT, NULL, callback, user_data, "account", account, "server", server, NULL); } /** * tp_room_list_new_finish: * @result: the #GAsyncResult from the callback * @error: a #GError location to store an error, or %NULL * * * * Returns: (transfer full): a new #TpRoomList object, or %NULL * in case of error. * * Since: 0.19.0 */ TpRoomList * tp_room_list_new_finish (GAsyncResult *result, GError **error) { GObject *object, *source_object; source_object = g_async_result_get_source_object (result); object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), result, error); g_object_unref (source_object); if (object != NULL) return TP_ROOM_LIST (object); else return NULL; } telepathy-glib-0.24.2/telepathy-glib/room-list.h0000644000175000017500000000505112652510705016446 00000000000000/* * room-list-channel.h - High level API for RoomList channels * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_ROOM_LIST_H__ #define __TP_ROOM_LIST_H__ #include #include G_BEGIN_DECLS #define TP_TYPE_ROOM_LIST (tp_room_list_get_type ()) #define TP_ROOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ROOM_LIST, TpRoomList)) #define TP_ROOM_LIST_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_ROOM_LIST, TpRoomListClass)) #define TP_IS_ROOM_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ROOM_LIST)) #define TP_IS_ROOM_LIST_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_ROOM_LIST)) #define TP_ROOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ROOM_LIST, TpRoomListClass)) typedef struct _TpRoomList TpRoomList; typedef struct _TpRoomListClass TpRoomListClass; typedef struct _TpRoomListPrivate TpRoomListPrivate; struct _TpRoomList { /**/ GObject parent; TpRoomListPrivate *priv; }; struct _TpRoomListClass { /**/ GObjectClass parent_class; GCallback _padding[7]; }; GType tp_room_list_get_type (void); void tp_room_list_new_async (TpAccount *account, const gchar *server, GAsyncReadyCallback callback, gpointer user_data); TpRoomList * tp_room_list_new_finish (GAsyncResult *result, GError **error); TpAccount * tp_room_list_get_account (TpRoomList *self); const gchar * tp_room_list_get_server (TpRoomList *self); gboolean tp_room_list_is_listing (TpRoomList *self); void tp_room_list_start (TpRoomList *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/cm-message.c0000644000175000017500000002234712652510705016544 00000000000000/* * cm-message.c - Source for TpCMMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:cm-message * @title: TpCMMessage * @short_description: a message in the Telepathy message interface, CM side * * #TpCMMessage is used within connection managers to represent a * message sent or received using the Messages interface. * * Since: 0.13.9 */ #include "config.h" #include "cm-message.h" #include "cm-message-internal.h" #include "message-internal.h" #include #include #include G_DEFINE_TYPE (TpCMMessage, tp_cm_message, TP_TYPE_MESSAGE) /** * TpCMMessage: * * Opaque structure representing a message in the Telepathy messages interface * (an array of at least one mapping from string to variant, where the first * mapping contains message headers and subsequent mappings contain the * message body). * * Since: 0.13.9 */ struct _TpCMMessagePrivate { TpBaseConnection *connection; }; static void tp_cm_message_dispose (GObject *object) { TpCMMessage *self = TP_CM_MESSAGE (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_cm_message_parent_class)->dispose; tp_clear_object (&self->priv->connection); if (dispose != NULL) dispose (object); } static void tp_cm_message_class_init (TpCMMessageClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = tp_cm_message_dispose; g_type_class_add_private (gobject_class, sizeof (TpCMMessagePrivate)); } static void tp_cm_message_init (TpCMMessage *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_CM_MESSAGE, TpCMMessagePrivate); } /** * tp_cm_message_new: * @connection: a connection on which to reference handles * @initial_parts: number of parts to create (at least 1) * * * * Returns: a newly allocated message suitable to be passed to * tp_cm_message_mixin_take_received() * * Since: 0.13.9 */ TpMessage * tp_cm_message_new (TpBaseConnection *connection, guint initial_parts) { TpCMMessage *self; TpMessage *msg; guint i; g_return_val_if_fail (connection != NULL, NULL); self = g_object_new (TP_TYPE_CM_MESSAGE, NULL); msg = (TpMessage *) self; /* The first part has already be created */ for (i = 1; i < initial_parts; i++) tp_message_append_part (msg); self->priv->connection = g_object_ref (connection); self->incoming_id = G_MAXUINT32; self->outgoing_context = NULL; return msg; } /** * tp_cm_message_set_message: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @message: another (distinct) message created for the same #TpBaseConnection * * Set @key in part @part of @self to have @message as an aa{sv} value (that * is, an array of Message_Part). * * Since: 0.15.5 */ void tp_cm_message_set_message (TpMessage *self, guint part, const gchar *key, TpMessage *message) { GPtrArray *parts; guint i; g_return_if_fail (self != NULL); g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (message != NULL); g_return_if_fail (self != message); g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (TP_IS_CM_MESSAGE (message)); g_return_if_fail (TP_CM_MESSAGE (self)->priv->connection == TP_CM_MESSAGE (message)->priv->connection); parts = g_ptr_array_sized_new (message->parts->len); for (i = 0; i < message->parts->len; i++) { GHashTable *src, *dest; src = g_ptr_array_index (message->parts, i); dest = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (dest, src, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); g_ptr_array_add (parts, dest); } g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_take_boxed (TP_ARRAY_TYPE_MESSAGE_PART_LIST, parts)); } /** * tp_cm_message_take_message: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @message: another (distinct) message created for the same #TpBaseConnection * * Set @key in part @part of @self to have @message as an aa{sv} value (that * is, an array of Message_Part), and take ownership of @message. The caller * should not use @message after passing it to this function. All handle * references owned by @message will subsequently belong to and be released * with @self. * * Since: 0.13.9 */ void tp_cm_message_take_message (TpMessage *self, guint part, const gchar *key, TpMessage *message) { g_return_if_fail (self != NULL); g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (message != NULL); g_return_if_fail (self != message); g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (TP_IS_CM_MESSAGE (message)); g_return_if_fail (TP_CM_MESSAGE (self)->priv->connection == TP_CM_MESSAGE (message)->priv->connection); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_take_boxed (TP_ARRAY_TYPE_MESSAGE_PART_LIST, message->parts)); /* Now that @self has stolen @message's parts, replace them with a stub to * keep tp_message_destroy happy. */ message->parts = g_ptr_array_sized_new (1); tp_message_append_part (message); tp_message_destroy (message); } /** * tp_cm_message_set_sender: * @self: a #TpCMMessage * @handle: the #TpHandle of the sender of the message * * Set the sender of @self, i.e. the "message-sender" and * "message-sender-id" keys in the header. * * Since: 0.13.9 */ void tp_cm_message_set_sender (TpMessage *self, TpHandle handle) { TpCMMessage *cm_msg; TpHandleRepoIface *contact_repo; const gchar *id; g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (handle != 0); tp_message_set_uint32 (self, 0, "message-sender", handle); cm_msg = (TpCMMessage *) self; contact_repo = tp_base_connection_get_handles (cm_msg->priv->connection, TP_HANDLE_TYPE_CONTACT); id = tp_handle_inspect (contact_repo, handle); if (id != NULL) tp_message_set_string (self, 0, "message-sender-id", id); } TpMessage * _tp_cm_message_new_from_parts (TpBaseConnection *conn, const GPtrArray *parts) { TpMessage *self; guint i; const GHashTable *header; TpHandle sender; g_return_val_if_fail (parts != NULL, NULL); g_return_val_if_fail (parts->len > 0, NULL); self = tp_cm_message_new (conn, parts->len); for (i = 0; i < parts->len; i++) { tp_g_hash_table_update (g_ptr_array_index (self->parts, i), g_ptr_array_index (parts, i), (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); } header = tp_message_peek (self, 0); sender = tp_asv_get_uint32 (header, "message-sender", NULL); if (sender != 0) tp_cm_message_set_sender (self, sender); return self; } /** * tp_cm_message_get_sender: * @self: a #TpCMMessage * * Return the sender of @self, i.e. the "message-sender" key of the header, * or 0 if there is no sender. * * Returns: a %TP_HANDLE_TYPE_CONTACT handle, or 0 * * Since: 0.13.9 */ TpHandle tp_cm_message_get_sender (TpMessage *self) { g_return_val_if_fail (TP_IS_CM_MESSAGE (self), 0); return tp_asv_get_uint32 (tp_message_peek (self, 0), "message-sender", NULL); } /** * tp_cm_message_new_text: * @conn: a connection * @sender: the #TpHandle of the sender of the message * @type: the type of message * @text: content of the messsage * * A convenient function to create a new #TpCMMessage having * 'text/plain' as 'content-type', @type as 'message-type', * @text as 'content' and @sender as its sender. * * Returns: (transfer full): a newly allocated #TpCMMessage * * Since: 0.13.10 */ TpMessage * tp_cm_message_new_text (TpBaseConnection *conn, TpHandle sender, TpChannelTextMessageType type, const gchar *text) { TpMessage *msg; msg = tp_cm_message_new (conn, 2); if (sender != 0) tp_cm_message_set_sender (msg, sender); if (type != TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL) tp_message_set_uint32 (msg, 0, "message-type", type); tp_message_set_string (msg, 1, "content-type", "text/plain"); tp_message_set_string (msg, 1, "content", text); return msg; } telepathy-glib-0.24.2/telepathy-glib/cm-message.h0000644000175000017500000000540012652510705016540 00000000000000/* * cm-message.h - Header for TpCMMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CM_MESSAGE_H__ #define __TP_CM_MESSAGE_H__ #include #include #include #include G_BEGIN_DECLS #define TP_TYPE_CM_MESSAGE (tp_cm_message_get_type ()) #define TP_CM_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CM_MESSAGE, TpCMMessage)) #define TP_CM_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_CM_MESSAGE, TpCMMessageClass)) #define TP_IS_CM_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CM_MESSAGE)) #define TP_IS_CM_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_CM_MESSAGE)) #define TP_CM_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CM_MESSAGE, TpCMMessageClass)) typedef struct _TpCMMessage TpCMMessage; typedef struct _TpCMMessageClass TpCMMessageClass; GType tp_cm_message_get_type (void); TpMessage * tp_cm_message_new (TpBaseConnection *connection, guint initial_parts); TpMessage *tp_cm_message_new_text (TpBaseConnection *conn, TpHandle sender, TpChannelTextMessageType type, const gchar *text); _TP_AVAILABLE_IN_0_16 void tp_cm_message_set_message (TpMessage *self, guint part, const gchar *key, TpMessage *message); void tp_cm_message_take_message (TpMessage *self, guint part, const gchar *key, TpMessage *message); TpHandle tp_cm_message_get_sender (TpMessage *self); void tp_cm_message_set_sender (TpMessage *self, TpHandle handle); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED TpMessage *tp_message_new (TpBaseConnection *connection, guint initial_parts, guint size_hint) G_GNUC_WARN_UNUSED_RESULT; #endif G_END_DECLS #endif /* __TP_CM_MESSAGE_H__ */ telepathy-glib-0.24.2/telepathy-glib/channel-iface.c0000644000175000017500000001304212652510705017170 00000000000000/* * tp-channel-iface.c - Stubs for Telepathy Channel interface * * Copyright (C) 2006 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:channel-iface * @title: TpChannelIface * @short_description: interface representing basic channel properties * @see_also: #TpSvcChannel, #TpChannelFactoryIface * * This interface defines a basic set of channel properties. It's mainly * used in #TpChannelFactoryIface to represent the returned channel objects. */ #include "config.h" #include #include static void tp_channel_iface_base_init (gpointer klass) { static gboolean initialized = FALSE; if (!initialized) { GParamSpec *param_spec; initialized = TRUE; /** * TpChannelIface:object-path: * * The D-Bus object path used for this object on the bus. Read-only * except during construction. */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); /** * TpChannelIface:channel-type: * * The D-Bus interface representing the type of this channel. Read-only * except during construction. * * In #TpChannel this property is read-only except during construction; * if %NULL during construction (the default), we ask the remote D-Bus * object what its channel type is, and reading this property will yield * %NULL until a reply is received. This is not guaranteed to have happened * until tp_proxy_prepare_async() has finished preparing * %TP_CHANNEL_FEATURE_CORE. * * In connection manager implementations, attempts to set this property * during construction will usually be ignored or treated as an * error. */ param_spec = g_param_spec_string ("channel-type", "Telepathy channel type", "The D-Bus interface representing the type of this channel.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); /** * TpChannelIface:handle-type: * * The #TpHandleType of this channel's associated handle, or * %TP_HANDLE_TYPE_NONE (which is numerically 0) if no handle. * * In #TpChannel, if this is TP_UNKNOWN_HANDLE_TYPE * during construction, we ask the remote D-Bus object what its * handle type is; reading this property will yield TP_UNKNOWN_HANDLE_TYPE * until we get the reply. This is not guaranteed to be have happened * until tp_proxy_prepare_async() has finished preparing * %TP_CHANNEL_FEATURE_CORE. * * In connection manager implementations, attempts to set this during * construction might also be ignored. */ param_spec = g_param_spec_uint ("handle-type", "Handle type", "The TpHandleType of this channel's associated handle.", 0, G_MAXUINT32, TP_UNKNOWN_HANDLE_TYPE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); /** * TpChannelIface:handle: * * This channel's associated handle, or 0 if no handle or unknown. * Read-only except during construction. * * In #TpChannel, if this is 0 * during construction, and handle-type is not TP_HANDLE_TYPE_NONE (== 0), * we ask the remote D-Bus object what its handle type is; reading this * property will yield 0 until we get the reply, or if GetHandle() * fails. This is not guaranteed to be set until tp_proxy_prepare_async() * has finished preparing %TP_CHANNEL_FEATURE_CORE. * * In connection manager implementations, attempts to set this during * construction might be ignored, depending on the channel type. */ param_spec = g_param_spec_uint ("handle", "Handle", "The TpHandle representing the contact, group, etc. with which " "this channel communicates, whose type is given by the handle-type " "property.", 0, G_MAXUINT32, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_interface_install_property (klass, param_spec); } } GType tp_channel_iface_get_type (void) { static GType type = 0; if (type == 0) { static const GTypeInfo info = { sizeof (TpChannelIfaceClass), tp_channel_iface_base_init, /* base_init */ NULL, /* base_finalize */ NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ 0, 0, /* n_preallocs */ NULL /* instance_init */ }; type = g_type_register_static (G_TYPE_INTERFACE, "TpChannelIface", &info, 0); } return type; } telepathy-glib-0.24.2/telepathy-glib/channel-iface.h0000644000175000017500000000444712652510705017206 00000000000000/* * tp-channel-iface.h - Headers for Telepathy Channel interface * * Copyright (C) 2006 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CHANNEL_IFACE_H__ #define __TP_CHANNEL_IFACE_H__ #include G_BEGIN_DECLS #define TP_TYPE_CHANNEL_IFACE (tp_channel_iface_get_type ()) #define TP_CHANNEL_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_CHANNEL_IFACE, TpChannelIface)) #define TP_IS_CHANNEL_IFACE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_CHANNEL_IFACE)) #define TP_CHANNEL_IFACE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_CHANNEL_IFACE, TpChannelIfaceClass)) /** * TpChannelIface: * * Opaque typedef representing a channel. */ typedef struct _TpChannelIface TpChannelIface; typedef struct _TpChannelIfaceClass TpChannelIfaceClass; /** * TpChannelFunc: * @self: An object implementing the channel interface * @userdata: Arbitrary user-supplied data * * A callback for functions which act on channels. */ typedef void (* TpChannelFunc) (TpChannelIface *self, gpointer userdata); /** * TpChannelIfaceClass: * @parent_class: The parent interface * * The class of the #TpChannelIface interface. */ struct _TpChannelIfaceClass { GTypeInterface parent_class; }; GType tp_channel_iface_get_type (void); G_END_DECLS #endif /* __TP_CHANNEL_IFACE_H__ */ telepathy-glib-0.24.2/telepathy-glib/automatic-client-factory.c0000644000175000017500000002077012652510705021430 00000000000000/* * Factory for specialized TpChannel subclasses. * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:automatic-client-factory * @title: TpAutomaticClientFactory * @short_description: Factory for specialized #TpChannel subclasses. * @see_also: #TpSimpleClientFactory * * This factory overrides some #TpSimpleClientFactory virtual methods to * create specialized #TpChannel subclasses. * * #TpAutomaticClientFactory will currently create #TpChannel objects * as follows: * * * * a #TpStreamTubeChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_STREAM_TUBE; * * * a #TpDBusTubeChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_DBUS_TUBE; * * * a #TpTextChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_TEXT and implements * %TP_IFACE_CHANNEL_INTERFACE_MESSAGES; * * * a #TpFileTransferChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER; * * * a #TpCallChannel, if the channel is of type * %TP_IFACE_CHANNEL_TYPE_CALL; * * * a plain #TpChannel, otherwise * * * * It is guaranteed that the objects returned by future versions * will be either the class that is currently used, or a more specific * subclass of that class. * * This factory asks to prepare the following features: * * * * %TP_CHANNEL_FEATURE_CORE, %TP_CHANNEL_FEATURE_GROUP * and %TP_CHANNEL_FEATURE_PASSWORD for all * type of channels. * * * %TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES and * %TP_TEXT_CHANNEL_FEATURE_SMS for #TpTextChannel * * * %TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE * for #TpFileTransferChannel * * * %TP_CALL_CHANNEL_FEATURE_CORE * for #TpCallChannel * * * %TP_DBUS_TUBE_CHANNEL_FEATURE_CORE * for #TpDBusTubeChannel * * * * Since: 0.15.5 */ /** * TpAutomaticClientFactory: * * Data structure representing a #TpAutomaticClientFactory * * Since: 0.15.5 */ /** * TpAutomaticClientFactoryClass: * @parent_class: the parent class * * The class of a #TpAutomaticClientFactory. * * Since: 0.15.5 */ #include "config.h" #include "telepathy-glib/automatic-client-factory.h" #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/automatic-client-factory-internal.h" G_DEFINE_TYPE (TpAutomaticClientFactory, tp_automatic_client_factory, TP_TYPE_SIMPLE_CLIENT_FACTORY) #define chainup ((TpSimpleClientFactoryClass *) \ tp_automatic_client_factory_parent_class) typedef gboolean (*CheckPropertiesFunc) ( const gchar *object_path, const GHashTable *properties); typedef TpChannel *(*NewFunc) ( TpSimpleClientFactory *client, TpConnection *conn, const gchar *object_path, const GHashTable *properties, GError **error); typedef struct { const gchar *channel_type; GType gtype; CheckPropertiesFunc check_properties; NewFunc new_func; /* 0-terminated. All of a sudden, 3 is not such a scary number. */ GQuark features[3]; } ChannelTypeMapping; static ChannelTypeMapping *channel_type_mapping = NULL; static gboolean check_for_messages ( const gchar *object_path, const GHashTable *properties) { /* Create a TpTextChannel only if the channel supports Messages */ const gchar * const * interfaces; interfaces = tp_asv_get_strv (properties, TP_PROP_CHANNEL_INTERFACES); if (!tp_strv_contains (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES)) { DEBUG ("channel %s doesn't implement Messages so we can't create " "a TpTextChannel", object_path); return FALSE; } return TRUE; } static void build_channel_type_mapping (void) { ChannelTypeMapping i_hate_c[] = { { TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_TYPE_STREAM_TUBE_CHANNEL, NULL, (NewFunc) _tp_stream_tube_channel_new_with_factory, { 0 }, }, { TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_TYPE_DBUS_TUBE_CHANNEL, NULL, (NewFunc) _tp_dbus_tube_channel_new_with_factory, { TP_DBUS_TUBE_CHANNEL_FEATURE_CORE, 0 }, }, { TP_IFACE_CHANNEL_TYPE_TEXT, TP_TYPE_TEXT_CHANNEL, check_for_messages, (NewFunc) _tp_text_channel_new_with_factory, { TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, TP_TEXT_CHANNEL_FEATURE_SMS, 0 }, }, { TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_TYPE_FILE_TRANSFER_CHANNEL, NULL, (NewFunc) _tp_file_transfer_channel_new_with_factory, { TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE, 0 }, }, { TP_IFACE_CHANNEL_TYPE_CALL, TP_TYPE_CALL_CHANNEL, NULL, (NewFunc) _tp_call_channel_new_with_factory, { TP_CALL_CHANNEL_FEATURE_CORE, 0 }, }, { NULL } }; g_return_if_fail (channel_type_mapping == NULL); channel_type_mapping = g_memdup (i_hate_c, sizeof i_hate_c); } static TpChannel * create_channel_impl (TpSimpleClientFactory *self, TpConnection *conn, const gchar *object_path, const GHashTable *properties, GError **error) { const gchar *chan_type; ChannelTypeMapping *m; chan_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE); for (m = channel_type_mapping; m->channel_type != NULL; m++) { if (tp_strdiff (chan_type, m->channel_type)) continue; if (m->check_properties != NULL && !m->check_properties (object_path, properties)) break; return m->new_func (self, conn, object_path, properties, error); } /* Chainup on parent implementation as fallback */ return chainup->create_channel (self, conn, object_path, properties, error); } static GArray * dup_channel_features_impl (TpSimpleClientFactory *self, TpChannel *channel) { GArray *features; GQuark standard_features[] = { TP_CHANNEL_FEATURE_GROUP, TP_CHANNEL_FEATURE_PASSWORD, }; ChannelTypeMapping *m; /* Chainup to get desired features for all channel types */ features = chainup->dup_channel_features (self, channel); g_array_append_vals (features, standard_features, G_N_ELEMENTS (standard_features)); for (m = channel_type_mapping; m->channel_type != NULL; m++) { if (G_TYPE_CHECK_INSTANCE_TYPE (channel, m->gtype)) { guint j; for (j = 0; m->features[j] != 0; j++) g_array_append_val (features, m->features[j]); break; } } return features; } static void tp_automatic_client_factory_init (TpAutomaticClientFactory *self) { } static void tp_automatic_client_factory_class_init (TpAutomaticClientFactoryClass *cls) { TpSimpleClientFactoryClass *simple_class = (TpSimpleClientFactoryClass *) cls; simple_class->create_channel = create_channel_impl; simple_class->dup_channel_features = dup_channel_features_impl; build_channel_type_mapping (); } /** * tp_automatic_client_factory_new: * @dbus: (allow-none): a #TpDBusDaemon, or %NULL * * Returns a new #TpAutomaticClientFactory instance. If @dbus is %NULL, * tp_dbus_daemon_dup() will be used. * * Returns: a new #TpAutomaticClientFactory * * Since: 0.15.5 */ TpAutomaticClientFactory * tp_automatic_client_factory_new (TpDBusDaemon *dbus) { return g_object_new (TP_TYPE_AUTOMATIC_CLIENT_FACTORY, "dbus-daemon", dbus, NULL); } telepathy-glib-0.24.2/telepathy-glib/automatic-client-factory.h0000644000175000017500000000551512652510705021435 00000000000000/* * Factory for specialized TpChannel subclasses. * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_AUTOMATIC_CLIENT_FACTORY_H__ #define __TP_AUTOMATIC_CLIENT_FACTORY_H__ #include #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpAutomaticClientFactory TpAutomaticClientFactory; typedef struct _TpAutomaticClientFactoryClass TpAutomaticClientFactoryClass; struct _TpAutomaticClientFactoryClass { /**/ TpSimpleClientFactoryClass parent_class; }; struct _TpAutomaticClientFactory { /**/ TpSimpleClientFactory parent; }; _TP_AVAILABLE_IN_0_16 GType tp_automatic_client_factory_get_type (void); #define TP_TYPE_AUTOMATIC_CLIENT_FACTORY \ (tp_automatic_client_factory_get_type ()) #define TP_AUTOMATIC_CLIENT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_AUTOMATIC_CLIENT_FACTORY, \ TpAutomaticClientFactory)) #define TP_AUTOMATIC_CLIENT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_AUTOMATIC_CLIENT_FACTORY, \ TpAutomaticClientFactoryClass)) #define TP_IS_AUTOMATIC_CLIENT_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_AUTOMATIC_CLIENT_FACTORY)) #define TP_IS_AUTOMATIC_CLIENT_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_AUTOMATIC_CLIENT_FACTORY)) #define TP_AUTOMATIC_CLIENT_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_AUTOMATIC_CLIENT_FACTORY, \ TpAutomaticClientFactoryClass)) _TP_AVAILABLE_IN_0_16 TpAutomaticClientFactory *tp_automatic_client_factory_new (TpDBusDaemon *dbus); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/debug-message-internal.h0000644000175000017500000000215712652510705021047 00000000000000/**/ /* * debug-message-internal.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_DEBUG_MESSAGE_INTERNAL_H__ #define __TP_DEBUG_MESSAGE_INTERNAL_H__ #include TpDebugMessage * _tp_debug_message_new (gdouble timestamp, const gchar *domain, TpDebugLevel level, const gchar *message); #endif telepathy-glib-0.24.2/telepathy-glib/capabilities-internal.h0000644000175000017500000000227212652510705020766 00000000000000/**/ /* Object representing the capabilities a Connection or a Contact * supports (internals). * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CAPABILITIES_INTERNAL_H__ #define __TP_CAPABILITIES_INTERNAL_H__ #include G_BEGIN_DECLS /* NULL-safe for @classes */ TpCapabilities * _tp_capabilities_new (const GPtrArray *classes, gboolean contact_specific); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/account-channel-request.c0000644000175000017500000024702112652510705021251 00000000000000/* * object used to request a channel from a TpAccount * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: account-channel-request * @title: TpAccountChannelRequest * @short_description: Object used to request a channel from a #TpAccount * * A #TpAccountChannelRequest object is used to request a channel using the * ChannelDispatcher. Once created, use one of the create or ensure async * method to actually request the channel. * * Note that each #TpAccountChannelRequest object can only be used to create * one channel. You can't call a create or ensure method more than once on the * same #TpAccountChannelRequest. * * Once the channel has been created you can use the * TpAccountChannelRequest::re-handled: signal to be notified when the channel * has to be re-handled. This can be useful for example to move its window * to the foreground, if applicable. * * Using this object is appropriate for most channel types. * For a contact search channel, use tp_contact_search_new_async() instead. * * Since: 0.11.12 */ /** * TpAccountChannelRequest: * * Data structure representing a #TpAccountChannelRequest object. * * Since: 0.11.12 */ /** * TpAccountChannelRequestClass: * * The class of a #TpAccountChannelRequest. * * Since: 0.11.12 */ /** * TpAccountChannelRequestDelegatedChannelCb: * @request: a #TpAccountChannelRequest instance * @channel: a #TpChannel * @user_data: arbitrary user-supplied data passed to * tp_account_channel_request_set_delegated_channel_callback() * * Called when a client asked us to delegate @channel to another Handler. * When this function is called you are no longer handling @channel. * * Since: 0.15.3 */ #include "config.h" #include "telepathy-glib/account-channel-request.h" #include "telepathy-glib/account-channel-request-internal.h" #include #include "telepathy-glib/base-client-internal.h" #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/deprecated-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" struct _TpAccountChannelRequestClass { /**/ GObjectClass parent_class; }; struct _TpAccountChannelRequest { /**/ GObject parent; TpAccountChannelRequestPrivate *priv; }; G_DEFINE_TYPE(TpAccountChannelRequest, tp_account_channel_request, G_TYPE_OBJECT) enum { PROP_ACCOUNT = 1, PROP_REQUEST, PROP_REQUEST_VARDICT, PROP_USER_ACTION_TIME, PROP_CHANNEL_REQUEST, N_PROPS }; enum { SIGNAL_RE_HANDLED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; typedef enum { ACTION_TYPE_FORGET, ACTION_TYPE_HANDLE, ACTION_TYPE_OBSERVE } ActionType; struct _TpAccountChannelRequestPrivate { TpAccount *account; /* dup'd string => slice-allocated GValue * * Do not use tp_asv_new() and friends, because they expect static * string keys. */ GHashTable *request; gint64 user_action_time; TpBaseClient *handler; gboolean ensure; GCancellable *cancellable; GSimpleAsyncResult *result; TpChannelRequest *chan_request; gulong invalidated_sig; gulong succeeded_chan_sig; gulong cancel_id; TpChannel *channel; TpHandleChannelsContext *handle_context; TpDBusDaemon *dbus; TpClientChannelFactory *factory; GHashTable *hints; /* TRUE if the channel has been requested (an _async function has been called * on the TpAccountChannelRequest) */ gboolean requested; ActionType action_type; TpAccountChannelRequestDelegatedChannelCb delegated_channel_cb; gpointer delegated_channel_data; GDestroyNotify delegated_channel_destroy; }; static void tp_account_channel_request_init (TpAccountChannelRequest *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ACCOUNT_CHANNEL_REQUEST, TpAccountChannelRequestPrivate); } static void request_disconnect (TpAccountChannelRequest *self) { if (self->priv->invalidated_sig == 0) return; g_assert (self->priv->chan_request != NULL); g_signal_handler_disconnect (self->priv->chan_request, self->priv->invalidated_sig); self->priv->invalidated_sig = 0; g_signal_handler_disconnect (self->priv->chan_request, self->priv->succeeded_chan_sig); self->priv->succeeded_chan_sig = 0; } static void tp_account_channel_request_dispose (GObject *object) { TpAccountChannelRequest *self = TP_ACCOUNT_CHANNEL_REQUEST ( object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_account_channel_request_parent_class)->dispose; request_disconnect (self); if (self->priv->cancel_id != 0) g_cancellable_disconnect (self->priv->cancellable, self->priv->cancel_id); tp_clear_object (&self->priv->account); tp_clear_pointer (&self->priv->request, g_hash_table_unref); tp_clear_object (&self->priv->handler); tp_clear_object (&self->priv->cancellable); tp_clear_object (&self->priv->result); tp_clear_object (&self->priv->chan_request); tp_clear_object (&self->priv->channel); tp_clear_object (&self->priv->handle_context); tp_clear_object (&self->priv->dbus); tp_clear_object (&self->priv->factory); tp_clear_pointer (&self->priv->hints, g_hash_table_unref); if (self->priv->delegated_channel_destroy != NULL) { self->priv->delegated_channel_destroy ( self->priv->delegated_channel_data); self->priv->delegated_channel_destroy = NULL; } if (dispose != NULL) dispose (object); } static void tp_account_channel_request_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpAccountChannelRequest *self = TP_ACCOUNT_CHANNEL_REQUEST ( object); switch (property_id) { case PROP_ACCOUNT: g_value_set_object (value, self->priv->account); break; case PROP_REQUEST: g_value_set_boxed (value, self->priv->request); break; case PROP_REQUEST_VARDICT: g_value_take_variant (value, tp_account_channel_request_dup_request (self)); break; case PROP_USER_ACTION_TIME: g_value_set_int64 (value, self->priv->user_action_time); break; case PROP_CHANNEL_REQUEST: g_value_set_object (value, self->priv->chan_request); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_account_channel_request_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpAccountChannelRequest *self = TP_ACCOUNT_CHANNEL_REQUEST ( object); switch (property_id) { case PROP_ACCOUNT: self->priv->account = g_value_dup_object (value); break; case PROP_REQUEST: /* If this property remains unset, GObject will set it to a NULL * value. Ignore that, so request-vardict can be set instead. */ if (g_value_get_boxed (value) == NULL) return; /* Construct-only and mutually exclusive with request-vardict */ g_return_if_fail (self->priv->request == NULL); /* We do not use tp_asv_new() and friends, because in principle, * the request can contain user-defined keys. */ self->priv->request = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (self->priv->request, g_value_get_boxed (value), (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); break; case PROP_REQUEST_VARDICT: { GHashTable *hash; /* If this property remains unset, GObject will set it to a NULL * value. Ignore that, so request can be set instead. */ if (g_value_get_variant (value) == NULL) return; /* Construct-only and mutually exclusive with request */ g_return_if_fail (self->priv->request == NULL); hash = _tp_asv_from_vardict (g_value_get_variant (value)); self->priv->request = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); tp_g_hash_table_update (self->priv->request, hash, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); g_hash_table_unref (hash); } break; case PROP_USER_ACTION_TIME: self->priv->user_action_time = g_value_get_int64 (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_account_channel_request_constructed (GObject *object) { TpAccountChannelRequest *self = TP_ACCOUNT_CHANNEL_REQUEST ( object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_account_channel_request_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (self->priv->account != NULL); g_assert (self->priv->request != NULL); self->priv->dbus = g_object_ref (tp_proxy_get_dbus_daemon ( self->priv->account)); } static void tp_account_channel_request_class_init ( TpAccountChannelRequestClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpAccountChannelRequestPrivate)); object_class->get_property = tp_account_channel_request_get_property; object_class->set_property = tp_account_channel_request_set_property; object_class->constructed = tp_account_channel_request_constructed; object_class->dispose = tp_account_channel_request_dispose; /** * TpAccountChannelRequest:account: * * The #TpAccount used to request the channel. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.12 */ param_spec = g_param_spec_object ("account", "TpAccount", "The TpAccount used to request the channel", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpAccountChannelRequest:request: * * The desired D-Bus properties for the channel, represented as a * #GHashTable where the keys are strings and the values are #GValue. * * When constructing a new object, one of * #TpAccountChannelRequest:request or * #TpAccountChannelRequest:request-vardict must be set to a non-%NULL * value, and the other must remain unspecified. * * Since: 0.11.12 */ param_spec = g_param_spec_boxed ("request", "GHashTable", "A dictionary containing desirable properties for the channel", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUEST, param_spec); /** * TpAccountChannelRequest:request-vardict: * * The desired D-Bus properties for the channel. * * When constructing a new object, one of * #TpAccountChannelRequest:request or * #TpAccountChannelRequest:request-vardict must be set to a non-%NULL * value, and the other must remain unspecified. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("request-vardict", "Request", "A dictionary containing desirable properties for the channel", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUEST_VARDICT, param_spec); /** * TpAccountChannelRequest:user-action-time: * * The user action time that will be passed to the channel dispatcher when * requesting the channel. * * This may be the time at which user action occurred, or one of the special * values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME. * * If %TP_USER_ACTION_TIME_NOT_USER_ACTION, the action doesn't involve any * user action. Clients should avoid stealing focus when presenting the * channel. * * If %TP_USER_ACTION_TIME_CURRENT_TIME, clients SHOULD behave as though the * user action happened at the current time, e.g. a client may * request that its window gains focus. * * On X11-based systems, GDK 2, GDK 3, Clutter 1.0 etc., * tp_user_action_time_from_x11() can be used to convert an X11 timestamp to * a Telepathy user action time. * * If the channel request succeeds, this user action time will be passed on * to the channel's handler. If the handler is a GUI, it may use * tp_user_action_time_should_present() to decide whether to bring its * window to the foreground. * * Since: 0.11.12 */ param_spec = g_param_spec_int64 ("user-action-time", "user action time", "UserActionTime", G_MININT64, G_MAXINT64, 0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_ACTION_TIME, param_spec); /** * TpAccountChannelRequest:channel-request: * * The #TpChannelRequest used to request the channel, or %NULL if the * channel has not be requested yet. * * This can be useful for example to compare with the #TpChannelRequest * objects received from the requests_satisfied argument of * #TpSimpleHandlerHandleChannelsImpl to check if the client is asked to * handle the channel it just requested. * * Note that the #TpChannelRequest objects may be different while still * representing the same ChannelRequest on D-Bus. You have to compare * them using their object paths (tp_proxy_get_object_path()). * * Since 0.13.13 */ param_spec = g_param_spec_object ("channel-request", "channel request", "TpChannelRequest", TP_TYPE_CHANNEL_REQUEST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNEL_REQUEST, param_spec); /** * TpAccountChannelRequest::re-handled: * @self: a #TpAccountChannelRequest * @channel: the #TpChannel being re-handled * @user_action_time: the time at which user action occurred, or one of the * special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME; see * #TpAccountChannelRequest:user-action-time * @context: a #TpHandleChannelsContext representing the context of * the HandleChannels() call. * * Emitted when the channel created using @self has been "re-handled". * * This means that a Telepathy client has made another request for a * matching channel using an "ensure" API like * tp_account_channel_request_ensure_channel_async(), while the channel * still exists. Instead of creating a new channel, the channel dispatcher * notifies the existing handler of @channel, resulting in this signal. * * Most GUI handlers should respond to this signal by checking * @user_action_time, and if appropriate, moving to the foreground. * * @context can be used to obtain extensible information about the channel * via tp_handle_channels_context_get_handler_info(), and any similar methods * that are added in future. It is not valid for the receiver of this signal * to call tp_handle_channels_context_accept(), * tp_handle_channels_context_delay() or tp_handle_channels_context_fail(). * * Since: 0.11.12 */ signals[SIGNAL_RE_HANDLED] = g_signal_new ( "re-handled", G_OBJECT_CLASS_TYPE (cls), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, TP_TYPE_CHANNEL, G_TYPE_INT64, TP_TYPE_HANDLE_CHANNELS_CONTEXT); } /** * tp_account_channel_request_new: * @account: a #TpAccount * @request: (transfer none) (element-type utf8 GObject.Value): the requested * properties of the channel (see #TpAccountChannelRequest:request) * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object. * * Returns: a new #TpAccountChannelRequest object * * Since: 0.11.12 */ TpAccountChannelRequest * tp_account_channel_request_new ( TpAccount *account, GHashTable *request, gint64 user_action_time) { g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (request != NULL, NULL); return g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); } /** * tp_account_channel_request_new_vardict: * @account: a #TpAccount * @request: the requested * properties of the channel (see #TpAccountChannelRequest:request) * as a %G_VARIANT_TYPE_VARDICT * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object. * * If @request is a floating reference, this function will * take ownership of it, much like g_variant_ref_sink(). See documentation of * that function for details. * * Returns: a new #TpAccountChannelRequest object * * Since: 0.19.10 */ TpAccountChannelRequest * tp_account_channel_request_new_vardict ( TpAccount *account, GVariant *request, gint64 user_action_time) { TpAccountChannelRequest *ret; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (request != NULL, NULL); g_return_val_if_fail (g_variant_is_of_type (request, G_VARIANT_TYPE_VARDICT), NULL); g_variant_ref_sink (request); ret = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request-vardict", request, "user-action-time", user_action_time, NULL); g_variant_unref (request); return ret; } /** * tp_account_channel_request_get_account: * @self: a #TpAccountChannelRequest * * Return the #TpAccountChannelRequest:account construct-only property * * Returns: (transfer none): the value of #TpAccountChannelRequest:account * * Since: 0.11.12 */ TpAccount * tp_account_channel_request_get_account ( TpAccountChannelRequest *self) { return self->priv->account; } /** * tp_account_channel_request_get_request: * @self: a #TpAccountChannelRequest * * Return the #TpAccountChannelRequest:request construct-only property * * Returns: (transfer none): the value of #TpAccountChannelRequest:request * * Since: 0.11.12 */ GHashTable * tp_account_channel_request_get_request ( TpAccountChannelRequest *self) { return self->priv->request; } /** * tp_account_channel_request_dup_request: * @self: a #TpAccountChannelRequest * * Return the #TpAccountChannelRequest:request-vardict construct-only * property. * * Returns: (transfer full): the value of * #TpAccountChannelRequest:request-vardict * * Since: 0.19.10 */ GVariant * tp_account_channel_request_dup_request ( TpAccountChannelRequest *self) { g_return_val_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self), NULL); return _tp_asv_to_vardict (self->priv->request); } /** * tp_account_channel_request_get_user_action_time: * @self: a #TpAccountChannelRequest * * Return the #TpAccountChannelRequest:user-action-time construct-only property * * Returns: the value of #TpAccountChannelRequest:user-action-time * * Since: 0.11.12 */ gint64 tp_account_channel_request_get_user_action_time ( TpAccountChannelRequest *self) { return self->priv->user_action_time; } static void complete_result (TpAccountChannelRequest *self) { g_assert (self->priv->result != NULL); request_disconnect (self); g_simple_async_result_complete_in_idle (self->priv->result); tp_clear_object (&self->priv->result); } static void request_fail (TpAccountChannelRequest *self, const GError *error) { g_simple_async_result_set_from_error (self->priv->result, error); complete_result (self); } static void handle_request_complete (TpAccountChannelRequest *self, TpChannel *channel, TpHandleChannelsContext *handle_context) { self->priv->channel = g_object_ref (channel); self->priv->handle_context = g_object_ref (handle_context); complete_result (self); } static void acr_channel_invalidated_cb (TpProxy *chan, guint domain, gint code, gchar *message, TpAccountChannelRequest *self) { /* Channel has been destroyed, we can remove the Handler */ DEBUG ("Channel has been invalidated (%s), unref ourself", message); g_object_unref (self); } static void handle_channels (TpSimpleHandler *handler, TpAccount *account, TpConnection *connection, GList *channels, GList *requests_satisfied, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data) { TpAccountChannelRequest *self = user_data; TpChannel *channel; if (G_UNLIKELY (g_list_length (channels) != 1)) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "We are supposed to handle only one channel" }; tp_handle_channels_context_fail (context, &error); request_fail (self, &error); return; } tp_handle_channels_context_accept (context); if (self->priv->result == NULL) { /* We are re-handling the channel, no async request to complete */ g_signal_emit (self, signals[SIGNAL_RE_HANDLED], 0, self->priv->channel, user_action_time, context); return; } /* Request succeeded */ channel = channels->data; if (tp_proxy_get_invalidated (channel) == NULL) { /* Keep the handler alive while the channel is valid so keep a ref on * ourself until the channel is invalidated */ g_object_ref (self); g_signal_connect (channel, "invalidated", G_CALLBACK (acr_channel_invalidated_cb), self); } handle_request_complete (self, channel, context); } static void channel_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpAccountChannelRequest *self = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare channel: %s", error->message); g_error_free (error); } g_simple_async_result_set_op_res_gpointer (self->priv->result, g_object_ref (source), g_object_unref); complete_result (self); } static void acr_channel_request_proceed_cb (TpChannelRequest *request, const GError *error, gpointer user_data, GObject *weak_object) { TpAccountChannelRequest *self = user_data; if (error != NULL) { DEBUG ("Proceed failed: %s", error->message); request_fail (self, error); return; } if (self->priv->action_type == ACTION_TYPE_HANDLE) DEBUG ("Proceed succeeded; waiting for the channel to be handled"); else DEBUG ("Proceed succeeded; waiting for the Succeeded signal"); } static void acr_channel_request_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, TpAccountChannelRequest *self) { GError error = { domain, code, message }; if (g_error_matches (&error, TP_DBUS_ERRORS, TP_DBUS_ERROR_OBJECT_REMOVED)) { /* Object has been removed without error, so ChannelRequest succeeded */ return; } DEBUG ("ChannelRequest has been invalidated: %s", message); request_fail (self, &error); } static void acr_channel_request_succeeded_with_channel (TpChannelRequest *chan_req, TpConnection *connection, TpChannel *channel, TpAccountChannelRequest *self) { if (channel != NULL) self->priv->channel = g_object_ref (channel); /* ChannelRequest succeeded */ if (self->priv->action_type == ACTION_TYPE_HANDLE) { GError err = { TP_ERROR, TP_ERROR_NOT_YOURS, "Another Handler is handling this channel" }; if (self->priv->result == NULL) /* Our handler has been called, all good */ return; /* Our handler hasn't be called but the channel request is complete. * That means another handler handled the channels so we don't own it. */ request_fail (self, &err); } else if (self->priv->action_type == ACTION_TYPE_OBSERVE) { GArray *features; if (self->priv->channel == NULL) { GError err = { TP_ERROR, TP_ERROR_CONFUSED, "Channel has been created but MC didn't give it back to us" }; DEBUG ("%s", err.message); request_fail (self, &err); return; } /* Operation will be complete once the channel have been prepared */ if (self->priv->factory != NULL) features = tp_client_channel_factory_dup_channel_features ( self->priv->factory, self->priv->channel); else features = tp_simple_client_factory_dup_channel_features ( tp_proxy_get_factory (self->priv->account), self->priv->channel); g_assert (features != NULL); tp_proxy_prepare_async (self->priv->channel, (GQuark *) features->data, channel_prepare_cb, self); g_array_unref (features); } else { /* We don't have to handle the channel so we're done */ complete_result (self); } } static void acr_channel_request_cancel_cb (TpChannelRequest *request, const GError *error, gpointer user_data, GObject *weak_object) { /* Don't do anything, we rely on the invalidation of the channel request to * complete the operation */ if (error != NULL) { DEBUG ("ChannelRequest.Cancel() failed: %s", error->message); return; } DEBUG ("ChannelRequest.Cancel() succeeded"); } static void acr_operation_cancelled_cb (GCancellable *cancellable, TpAccountChannelRequest *self) { if (self->priv->chan_request == NULL) { DEBUG ("ChannelRequest has been invalidated, we can't cancel any more"); return; } DEBUG ("Operation has been cancelled, cancel the channel request"); tp_cli_channel_request_call_cancel (self->priv->chan_request, -1, acr_channel_request_cancel_cb, self, NULL, G_OBJECT (self)); } static void acr_request_cb (TpChannelDispatcher *cd, const gchar *channel_request_path, const GError *error, gpointer user_data, GObject *weak_object) { TpAccountChannelRequest *self = user_data; GError *err = NULL; if (error != NULL) { DEBUG ("%s failed: %s", self->priv->ensure ? "EnsureChannel" : "CreateChannel", error->message); request_fail (self, error); return; } DEBUG ("Got ChannelRequest: %s", channel_request_path); self->priv->chan_request = _tp_simple_client_factory_ensure_channel_request ( tp_proxy_get_factory (self->priv->account), channel_request_path, NULL, &err); if (self->priv->chan_request == NULL) { DEBUG ("Failed to create ChannelRequest: %s", err->message); goto fail; } _tp_channel_request_set_channel_factory (self->priv->chan_request, self->priv->factory); self->priv->invalidated_sig = g_signal_connect (self->priv->chan_request, "invalidated", G_CALLBACK (acr_channel_request_invalidated_cb), self); self->priv->succeeded_chan_sig = g_signal_connect (self->priv->chan_request, "succeeded-with-channel", G_CALLBACK (acr_channel_request_succeeded_with_channel), self); if (self->priv->cancellable != NULL) { self->priv->cancel_id = g_cancellable_connect (self->priv->cancellable, G_CALLBACK (acr_operation_cancelled_cb), self, NULL); /* We just aborted the operation so we're done */ if (g_cancellable_is_cancelled (self->priv->cancellable)) return; } DEBUG ("Calling ChannelRequest.Proceed()"); tp_cli_channel_request_call_proceed (self->priv->chan_request, -1, acr_channel_request_proceed_cb, self, NULL, G_OBJECT (self)); return; fail: request_fail (self, err); g_error_free (err); } static void delegated_channels_cb (TpBaseClient *client, GPtrArray *channels, gpointer user_data) { TpAccountChannelRequest *self = user_data; TpChannel *channel; g_return_if_fail (channels->len == 1); /* TpBaseClient is supposed to check we are actually handling the channel * before calling this callback so we can assert that's the right one. */ channel = g_ptr_array_index (channels, 0); g_return_if_fail (TP_IS_CHANNEL (channel)); g_return_if_fail (!tp_strdiff (tp_proxy_get_object_path (channel), tp_proxy_get_object_path (self->priv->channel))); self->priv->delegated_channel_cb (self, channel, self->priv->delegated_channel_data); } static gboolean going_to_request (TpAccountChannelRequest *self, ActionType action_type, gboolean ensure, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_return_val_if_fail (!self->priv->requested, FALSE); self->priv->requested = TRUE; self->priv->action_type = action_type; if (g_cancellable_is_cancelled (cancellable)) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Operation has been cancelled"); return FALSE; } if (cancellable != NULL) self->priv->cancellable = g_object_ref (cancellable); self->priv->ensure = ensure; /* Set TargetHandleType: TP_HANDLE_TYPE_NONE if no TargetHandleType has been * defined. */ if (g_hash_table_lookup (self->priv->request, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE) == NULL) { g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE_TYPE), tp_g_value_slice_new_uint (TP_HANDLE_TYPE_NONE)); } return TRUE; } static void request_and_handle_channel_async (TpAccountChannelRequest *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data, gboolean ensure) { GError *error = NULL; TpChannelDispatcher *cd; if (!going_to_request (self, ACTION_TYPE_HANDLE, ensure, cancellable, callback, user_data)) return; /* Create a temp handler */ self->priv->handler = tp_simple_handler_new_with_factory ( tp_proxy_get_factory (self->priv->account), TRUE, FALSE, "TpGLibRequestAndHandle", TRUE, handle_channels, self, NULL); _tp_base_client_set_only_for_account (self->priv->handler, self->priv->account); _tp_base_client_set_channel_factory (self->priv->handler, self->priv->factory); if (self->priv->delegated_channel_cb != NULL) { tp_base_client_set_delegated_channels_callback (self->priv->handler, delegated_channels_cb, self, NULL); } if (!tp_base_client_register (self->priv->handler, &error)) { DEBUG ("Failed to register temp handler: %s", error->message); g_simple_async_report_gerror_in_idle (G_OBJECT (self), callback, user_data, error); g_error_free (error); return; } cd = tp_channel_dispatcher_new (self->priv->dbus); if (ensure) { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_ensure_and_handle_channel_async); if (self->priv->hints == NULL) { tp_cli_channel_dispatcher_call_ensure_channel (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, tp_base_client_get_bus_name (self->priv->handler), acr_request_cb, self, NULL, G_OBJECT (self)); } else { tp_cli_channel_dispatcher_call_ensure_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, tp_base_client_get_bus_name (self->priv->handler), self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } } else { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_create_and_handle_channel_async); if (self->priv->hints == NULL) { tp_cli_channel_dispatcher_call_create_channel (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, tp_base_client_get_bus_name (self->priv->handler), acr_request_cb, self, NULL, G_OBJECT (self)); } else { tp_cli_channel_dispatcher_call_create_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, tp_base_client_get_bus_name (self->priv->handler), self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } } g_object_unref (cd); } static TpChannel * request_and_handle_channel_finish (TpAccountChannelRequest *self, GAsyncResult *result, TpHandleChannelsContext **context, gpointer source_tag, GError **error) { GSimpleAsyncResult *simple; g_return_val_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self), NULL); g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), NULL); simple = G_SIMPLE_ASYNC_RESULT (result); if (g_simple_async_result_propagate_error (simple, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), source_tag), NULL); if (context != NULL) *context = g_object_ref (self->priv->handle_context); return g_object_ref (self->priv->channel); } /** * tp_account_channel_request_create_and_handle_channel_async: * @self: a #TpAccountChannelRequest * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls CreateChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * that you are going to handle yourself. * When the operation is finished, @callback will be called. You can then call * tp_account_channel_request_create_and_handle_channel_finish() to get the * result of the operation. * * (Behind the scenes, this works by creating a temporary #TpBaseClient, then * acting like tp_account_channel_request_create_channel_async() with the * temporary #TpBaseClient as the @preferred_handler.) * * The caller is responsible for closing the channel with * tp_cli_channel_call_close() when it has finished handling it. * * Since: 0.11.12 */ void tp_account_channel_request_create_and_handle_channel_async ( TpAccountChannelRequest *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_and_handle_channel_async (self, cancellable, callback, user_data, FALSE); } /** * tp_account_channel_request_create_and_handle_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @context: (out) (allow-none) (transfer full): pointer used to return a * reference to the context of the HandleChannels() call, or %NULL * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_create_and_handle_channel_async(). * * See tp_account_channel_request_ensure_and_handle_channel_finish() * for details of how @context can be used. * * The caller is responsible for closing the channel with * tp_cli_channel_call_close() when it has finished handling it. * * Returns: (transfer full) (allow-none): a new reference on a #TpChannel if the * channel was successfully created and you are handling it, otherwise %NULL. * * Since: 0.11.12 */ TpChannel * tp_account_channel_request_create_and_handle_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, TpHandleChannelsContext **context, GError **error) { return request_and_handle_channel_finish (self, result, context, tp_account_channel_request_create_and_handle_channel_async, error); } /** * tp_account_channel_request_ensure_and_handle_channel_async: * @self: a #TpAccountChannelRequest * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls EnsureChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * that you are going to handle yourself. * When the operation is finished, @callback will be called. You can then call * tp_account_channel_request_ensure_and_handle_channel_finish() to get the * result of the operation. * * If the channel already exists and is already being handled, or if a * newly created channel is sent to a different handler, this operation * will fail with the error %TP_ERROR_NOT_YOURS. The other handler * will be notified that the channel was requested again (for instance * with #TpAccountChannelRequest::re-handled, * #TpBaseClientClassHandleChannelsImpl or #TpSimpleHandler:callback), * and can move its window to the foreground, if applicable. * * (Behind the scenes, this works by creating a temporary #TpBaseClient, then * acting like tp_account_channel_request_ensure_channel_async() with the * temporary #TpBaseClient as the @preferred_handler.) * * Since: 0.11.12 */ void tp_account_channel_request_ensure_and_handle_channel_async ( TpAccountChannelRequest *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_and_handle_channel_async (self, cancellable, callback, user_data, TRUE); } /** * tp_account_channel_request_ensure_and_handle_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @context: (out) (allow-none) (transfer full): pointer used to return a * reference to the context of the HandleChannels() call, or %NULL * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_ensure_and_handle_channel_async(). * * If the channel already exists and is already being handled, or if a * newly created channel is sent to a different handler, this operation * will fail with the error %TP_ERROR_NOT_YOURS. * * @context can be used to obtain extensible information about the channel * via tp_handle_channels_context_get_handler_info(), and any similar methods * that are added in future. It is not valid for the caller of this method * to call tp_handle_channels_context_accept(), * tp_handle_channels_context_delay() or tp_handle_channels_context_fail(). * * Returns: (transfer full) (allow-none): a new reference on a #TpChannel if the * channel was successfully created and you are handling it, otherwise %NULL. * * Since: 0.11.12 */ TpChannel * tp_account_channel_request_ensure_and_handle_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, TpHandleChannelsContext **context, GError **error) { return request_and_handle_channel_finish (self, result, context, tp_account_channel_request_ensure_and_handle_channel_async, error); } /* Request and forget API */ static void request_channel_async (TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data, gboolean ensure) { TpChannelDispatcher *cd; if (!going_to_request (self, ACTION_TYPE_FORGET, ensure, cancellable, callback, user_data)) return; cd = tp_channel_dispatcher_new (self->priv->dbus); if (ensure) { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_ensure_channel_async); if (self->priv->hints == NULL) { tp_cli_channel_dispatcher_call_ensure_channel (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, acr_request_cb, self, NULL, G_OBJECT (self)); } else { tp_cli_channel_dispatcher_call_ensure_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } } else { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_create_channel_async); if (self->priv->hints == NULL) { tp_cli_channel_dispatcher_call_create_channel (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, acr_request_cb, self, NULL, G_OBJECT (self)); } else { tp_cli_channel_dispatcher_call_create_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } } g_object_unref (cd); } /** * tp_account_channel_request_create_channel_async: * @self: a #TpAccountChannelRequest * @preferred_handler: Either the well-known bus name (starting with * %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, * or %NULL to indicate that any handler would be acceptable. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls CreateChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * and let the ChannelDispatcher dispatch it to an handler. * @callback will be called when the channel has been created and dispatched, * or the request has failed. * You can then call tp_account_channel_request_create_channel_finish() to * get the result of the operation. * * Since: 0.11.12 */ void tp_account_channel_request_create_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_channel_async (self, preferred_handler, cancellable, callback, user_data, FALSE); } static gboolean request_channel_finish (TpAccountChannelRequest *self, GAsyncResult *result, gpointer source_tag, GError **error) { _tp_implement_finish_void (self, source_tag); } /** * tp_account_channel_request_create_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_create_channel_async(). * * Returns: %TRUE if the channel was successfully created and dispatched, * otherwise %FALSE. * * Since: 0.11.12 */ gboolean tp_account_channel_request_create_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) { return request_channel_finish (self, result, tp_account_channel_request_create_channel_async, error); } /** * tp_account_channel_request_ensure_channel_async: * @self: a #TpAccountChannelRequest * @preferred_handler: Either the well-known bus name (starting with * %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, * or %NULL to indicate that any handler would be acceptable. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls EnsureChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * and let the ChannelDispatcher dispatch it to an handler. * * If a suitable channel already existed, its handler will be notified that * the channel was requested again (for instance with * #TpAccountChannelRequest::re-handled, #TpBaseClientClassHandleChannelsImpl * or #TpSimpleHandler:callback, if it is implemented using Telepathy-GLib), * so that it can re-present the window to the user, for example. * Otherwise, a new channel will be created and dispatched to a handler. * * @callback will be called when an existing channel's handler has been * notified, a new channel has been created and dispatched, or the request * has failed. * You can then call tp_account_channel_request_ensure_channel_finish() to * get the result of the operation. * * Since: 0.11.12 */ void tp_account_channel_request_ensure_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_channel_async (self, preferred_handler, cancellable, callback, user_data, TRUE); } /** * tp_account_channel_request_ensure_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_ensure_channel_async(). * * Returns: %TRUE if the channel was successfully ensured and (re-)dispatched, * otherwise %FALSE. * * Since: 0.11.12 */ gboolean tp_account_channel_request_ensure_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) { return request_channel_finish (self, result, tp_account_channel_request_ensure_channel_async, error); } /** * tp_account_channel_request_set_channel_factory: * @self: a #TpAccountChannelRequest * @factory: a #TpClientChannelFactory * * Set @factory as the #TpClientChannelFactory that will be used to * create the channel requested by @self. * By default #TpAutomaticProxyFactory is used. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.13.2 * Deprecated: since 0.15.5. The factory is taken from * #TpAccountChannelRequest:account. */ void tp_account_channel_request_set_channel_factory (TpAccountChannelRequest *self, TpClientChannelFactory *factory) { _tp_account_channel_request_set_channel_factory (self, factory); } void _tp_account_channel_request_set_channel_factory (TpAccountChannelRequest *self, TpClientChannelFactory *factory) { g_return_if_fail (!self->priv->requested); tp_clear_object (&self->priv->factory); if (factory != NULL) self->priv->factory = g_object_ref (factory); } /** * tp_account_channel_request_get_channel_request: * @self: a #TpAccountChannelRequest * * Return the #TpAccountChannelRequest:channel-request property * * Returns: (transfer none): the value of * #TpAccountChannelRequest:channel-request * * Since: 0.13.13 */ TpChannelRequest * tp_account_channel_request_get_channel_request (TpAccountChannelRequest *self) { return self->priv->chan_request; } static void request_and_observe_channel_async (TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data, gboolean ensure) { TpChannelDispatcher *cd; if (!going_to_request (self, ACTION_TYPE_OBSERVE, ensure, cancellable, callback, user_data)) return; cd = tp_channel_dispatcher_new (self->priv->dbus); if (self->priv->hints == NULL) self->priv->hints = g_hash_table_new (NULL, NULL); if (ensure) { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_ensure_and_observe_channel_async); tp_cli_channel_dispatcher_call_ensure_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } else { self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_account_channel_request_create_and_observe_channel_async); tp_cli_channel_dispatcher_call_create_channel_with_hints (cd, -1, tp_proxy_get_object_path (self->priv->account), self->priv->request, self->priv->user_action_time, preferred_handler == NULL ? "" : preferred_handler, self->priv->hints, acr_request_cb, self, NULL, G_OBJECT (self)); } g_object_unref (cd); } /** * tp_account_channel_request_create_and_observe_channel_async: * @self: a #TpAccountChannelRequest * @preferred_handler: Either the well-known bus name (starting with * %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, * or %NULL to indicate that any handler would be acceptable. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls CreateChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * and let the ChannelDispatcher dispatch it to an handler. * @callback will be called when the channel has been created and dispatched, * or the request has failed. * You can then call tp_account_channel_request_create_channel_finish() to * get the result of the operation and a #TpChannel representing the channel * which has been created. Note that you are not handling * this channel and so should interact with the channel as an Observer. * See * the Telepathy book for details about how clients should interact * with channels. * * Since: 0.13.14 */ void tp_account_channel_request_create_and_observe_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_and_observe_channel_async (self, preferred_handler, cancellable, callback, user_data, FALSE); } /** * tp_account_channel_request_create_and_observe_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_create_and_observe_channel_async(). * * Returns: (transfer full): a newly created #TpChannel if the channel was * successfully created and dispatched, otherwise %NULL. * * Since: 0.13.14 */ TpChannel * tp_account_channel_request_create_and_observe_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_account_channel_request_create_and_observe_channel_async, g_object_ref); } /** * tp_account_channel_request_ensure_and_observe_channel_async: * @self: a #TpAccountChannelRequest * @preferred_handler: Either the well-known bus name (starting with * %TP_CLIENT_BUS_NAME_BASE) of the preferred handler for the channel, * or %NULL to indicate that any handler would be acceptable. * @cancellable: optional #GCancellable object, %NULL to ignore * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Asynchronously calls EnsureChannel on the ChannelDispatcher to create a * channel with the properties defined in #TpAccountChannelRequest:request * and let the ChannelDispatcher dispatch it to an handler. * @callback will be called when the channel has been created and dispatched, * or the request has failed. * You can then call tp_account_channel_request_create_channel_finish() to * get the result of the operation and a #TpChannel representing the channel * which has been created. Note that you are not handling * this channel and so should interact with the channel as an Observer. * See * the Telepathy book for details about how clients should interact * with channels. * * If a suitable channel already existed, its handler will be notified that * the channel was requested again (for instance with * #TpAccountChannelRequest::re-handled, #TpBaseClientClassHandleChannelsImpl * or #TpSimpleHandler:callback, if it is implemented using Telepathy-GLib), * so that it can re-present the window to the user, for example. * Otherwise, a new channel will be created and dispatched to a handler. * * Since: 0.13.14 */ void tp_account_channel_request_ensure_and_observe_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { request_and_observe_channel_async (self, preferred_handler, cancellable, callback, user_data, TRUE); } /** * tp_account_channel_request_ensure_and_observe_channel_finish: * @self: a #TpAccountChannelRequest * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes an async channel creation started using * tp_account_channel_request_create_and_observe_channel_async(). * * Returns: (transfer full): a newly created #TpChannel if the channel was * successfully ensure and (re-)dispatched, otherwise %NULL. * * Since: 0.13.14 */ TpChannel * tp_account_channel_request_ensure_and_observe_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_account_channel_request_ensure_and_observe_channel_async, g_object_ref); } /** * tp_account_channel_request_set_hint: * @self: a #TpAccountChannelRequest * @key: the key used for the hint * @value: (transfer none): a variant containting the hint value * * Set additional information about the channel request, which will be used * in the resulting request's #TpChannelRequest:hints property. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.8 */ void tp_account_channel_request_set_hint (TpAccountChannelRequest *self, const gchar *key, GVariant *value) { GValue one = G_VALUE_INIT, *two; g_return_if_fail (!self->priv->requested); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); if (self->priv->hints == NULL) self->priv->hints = tp_asv_new (NULL, NULL); dbus_g_value_parse_g_variant (value, &one); two = tp_g_value_slice_dup (&one); g_hash_table_insert (self->priv->hints, g_strdup (key), two); g_value_unset (&one); } /** * tp_account_channel_request_set_hints: * @self: a #TpAccountChannelRequest * @hints: a #TP_HASH_TYPE_STRING_VARIANT_MAP * * Set additional information about the channel request, which will be used * as the value for the resulting request's #TpChannelRequest:hints property. * * This function can't be called once @self has been used to request a * channel. * * In high-level language bindings, use tp_account_channel_request_set_hint() * instead. * * Since: 0.13.14 */ void tp_account_channel_request_set_hints (TpAccountChannelRequest *self, GHashTable *hints) { g_return_if_fail (!self->priv->requested); g_return_if_fail (hints != NULL); tp_clear_pointer (&self->priv->hints, g_hash_table_unref); self->priv->hints = g_hash_table_ref (hints); } /** * tp_account_channel_request_set_delegate_to_preferred_handler: * @self: a #TpAccountChannelRequest * @delegate: %TRUE to request to delegate channels * * If @delegate is %TRUE, asks to the client currently handling the channels to * delegate them to the preferred handler (passed when calling * tp_account_channel_request_ensure_channel_async() for example). * * This function can't be called once @self has been used to request a * channel. * * Since: 0.15.3 */ void tp_account_channel_request_set_delegate_to_preferred_handler ( TpAccountChannelRequest *self, gboolean delegate) { g_return_if_fail (!self->priv->requested); if (self->priv->hints == NULL) self->priv->hints = tp_asv_new (NULL, NULL); tp_asv_set_boolean (self->priv->hints, "org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler", delegate); } /** * tp_account_channel_request_set_delegated_channel_callback: * @self: a #TpAccountChannelRequest * @callback: function called the channel requested using @self is * delegated, may not be %NULL * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with the @user_data as argument, when @self is destroyed * * Turn on support for * the org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler * hint. * * When receiving a request containing this hint, @self will automatically * delegate the channel to the preferred handler of the request and then call * @callback to inform the client that it is no longer handling this channel. * * @callback may be called any time after (and only after) requesting and * handling the channel (i.e. you have called create_and_handle or * ensure_and_handle). * * This function can't be called once @self has been used to request a * channel. * * See also: tp_base_client_set_delegated_channels_callback() * * Since: 0.15.3 */ void tp_account_channel_request_set_delegated_channel_callback ( TpAccountChannelRequest *self, TpAccountChannelRequestDelegatedChannelCb callback, gpointer user_data, GDestroyNotify destroy) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_return_if_fail (self->priv->delegated_channel_cb == NULL); self->priv->delegated_channel_cb = callback; self->priv->delegated_channel_data = user_data; self->priv->delegated_channel_destroy = destroy; } TpBaseClient * _tp_account_channel_request_get_client (TpAccountChannelRequest *self) { g_return_val_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self), NULL); return self->priv->handler; } /** * tp_account_channel_request_set_target_contact: * @self: a #TpAccountChannelRequest * @contact: the contact to be contacted * * Configure this request to create a peer-to-peer channel with @contact as * the other peer. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_target_contact ( TpAccountChannelRequest *self, TpContact *contact) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (TP_IS_CONTACT (contact)); g_return_if_fail (!self->priv->requested); /* Do not use tp_asv_set_uint32 or similar - the key is dup'd */ g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE_TYPE), tp_g_value_slice_new_uint (TP_HANDLE_TYPE_CONTACT)); /* We use the ID because it persists across a disconnect/reconnect */ g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TARGET_ID), tp_g_value_slice_new_string (tp_contact_get_identifier (contact))); } /** * tp_account_channel_request_set_target_id: * @self: a #TpAccountChannelRequest * @handle_type: the type of @identifier, typically %TP_HANDLE_TYPE_CONTACT * or %TP_HANDLE_TYPE_ROOM * @identifier: the unique identifier of the contact, room etc. to be * contacted * * Configure this request to create a channel with @identifier, * an identifier of type @handle_type. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_target_id ( TpAccountChannelRequest *self, TpHandleType handle_type, const gchar *identifier) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (identifier != NULL); g_return_if_fail (handle_type != TP_HANDLE_TYPE_NONE); g_return_if_fail (!self->priv->requested); /* Do not use tp_asv_set_uint32 or similar - the key is dup'd */ g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TARGET_HANDLE_TYPE), tp_g_value_slice_new_uint (handle_type)); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TARGET_ID), tp_g_value_slice_new_string (identifier)); } /** * tp_account_channel_request_new_text: * @account: a #TpAccount * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object * which will yield a Text channel. * * After creating the request, you will also need to set the "target" * of the channel by calling one of the following functions: * * - tp_account_channel_request_set_target_contact() * - tp_account_channel_request_set_target_id() * * Returns: a new #TpAccountChannelRequest object * * Since: 0.19.0 */ TpAccountChannelRequest * tp_account_channel_request_new_text ( TpAccount *account, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_set_request_property: * @self: a #TpAccountChannelRequest * @name: a D-Bus property name * @value: an arbitrary value for the property * * Configure this channel request to include the given property, as * documented in the Telepathy D-Bus API Specification or an * implementation-specific extension. * * Using this method is not recommended, but it can be necessary for * experimental or implementation-specific interfaces. * * If the property is not supported by the protocol or channel type, the * channel request will fail. Use #TpCapabilities and the Telepathy * D-Bus API Specification to determine which properties are available. * * If @value is a floating reference, this method takes ownership of it * by using g_variant_ref_sink(). This allows convenient inline use of * #GVariant constructors: * * |[ * tp_account_channel_request_set_request_property (acr, "com.example.Int", * g_variant_new_int32 (17)); * tp_account_channel_request_set_request_property (acr, "com.example.String", * g_variant_new_string ("ferret")); * ]| * * It is an error to provide a @value which contains types not supported by * D-Bus. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_request_property ( TpAccountChannelRequest *self, const gchar *name, GVariant *value) { GValue *v; g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); v = g_slice_new0 (GValue); dbus_g_value_parse_g_variant (value, v); g_hash_table_insert (self->priv->request, g_strdup (name), v); } /** * tp_account_channel_request_new_audio_call: * @account: a #TpAccount * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object * which will yield a Call channel, initially carrying audio only. * * After creating the request, you will usually also need to set the "target" * of the channel by calling one of the following functions: * * - tp_account_channel_request_set_target_contact() * - tp_account_channel_request_set_target_id() * * To call a contact, either use * tp_account_channel_request_set_target_contact() or one of the generic * methods that takes a handle type argument. To check whether this * is possible, use tp_capabilities_supports_audio_call() with * @handle_type set to %TP_HANDLE_TYPE_CONTACT. * * * * In some protocols, it is possible to create a Call channel without * setting a target at all, which will result in a new, empty * conference call. To test whether this is possible, use * tp_capabilities_supports_audio_call() with @handle_type set to * %TP_HANDLE_TYPE_NONE. * * Returns: a new #TpAccountChannelRequest object * * Since: 0.19.0 */ TpAccountChannelRequest * tp_account_channel_request_new_audio_call ( TpAccount *account, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_new_audio_video_call: * @account: a #TpAccount * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object * which will yield a Call channel, initially carrying both audio * and video. * * This is the same as tp_account_channel_request_new_audio_call(), * except that the channel will initially carry video as well as audio, * and instead of using tp_capabilities_supports_audio_call() * you should test capabilities with * tp_capabilities_supports_audio_video_call(). * * See the documentation of tp_account_channel_request_new_audio_call() * for details of how to set the target (contact, chatroom etc.) for the call. * * Returns: a new #TpAccountChannelRequest object * * Since: 0.19.0 */ TpAccountChannelRequest * tp_account_channel_request_new_audio_video_call ( TpAccount *account, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_new_file_transfer: * @account: a #TpAccount * @filename: a suggested name for the file, which should not contain * directories or directory separators (for example, if you are sending * a file called /home/user/monkey.pdf, set this to monkey.pdf) * @mime_type: (allow-none): the MIME type (content-type) of the file; * a %NULL value is allowed, and is treated as * "application/octet-stream" * @size: the file's size in bytes * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object, * which will yield a FileTransfer channel to send a file to a contact. * * After creating the request, you will also need to set the "target" * of the channel by calling one of the following functions: * * - tp_account_channel_request_set_target_contact() * - tp_account_channel_request_set_target_id() * * Returns: a new #TpAccountChannelRequest object * * Since: 0.19.0 */ TpAccountChannelRequest * tp_account_channel_request_new_file_transfer ( TpAccount *account, const gchar *filename, const gchar *mime_type, guint64 size, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (!tp_str_empty (filename), NULL); g_return_val_if_fail (mime_type == NULL || mime_type[0] != '\0', NULL); if (mime_type == NULL) mime_type = "application/octet-stream"; request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME, G_TYPE_STRING, filename, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE, G_TYPE_STRING, mime_type, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE, G_TYPE_UINT64, size, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_set_file_transfer_description: * @self: a #TpAccountChannelRequest * @description: a description of the file * * Configure this channel request to provide the recipient of the file * with the given description. * * If file descriptions are not supported by the protocol, or if this * method is used on a request that is not actually a file transfer, the * channel request will fail. Use * tp_capabilities_supports_file_transfer_description() to determine * whether outgoing file transfers can have a description. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_file_transfer_description ( TpAccountChannelRequest *self, const gchar *description) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_return_if_fail (description != NULL); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION), tp_g_value_slice_new_string (description)); } /** * tp_account_channel_request_set_file_transfer_uri: * @self: a #TpAccountChannelRequest * @uri: the source URI for the file * * Configure this channel request to provide other local Telepathy * components with the URI of the file being sent. Unlike most * properties on a file transfer channel, this information is not * sent to the recipient of the file; instead, it is signalled on * D-Bus for use by other Telepathy components. * * The URI should usually be a file URI as defined by * RFC 1738 * §3.10 (for instance, file:///path/to/file or * file://localhost/path/to/file). If a remote resource * is being transferred to a contact, it may have a different scheme, * such as http. * * Even if this method is used, the connection manager will not read * the file from disk: the handler for the channel is still * responsible for streaming the file. However, providing the URI * allows a local logger to log which file was transferred, for instance. * * If this functionality is not supported by the connection manager, or * if this method is used on a request that is not actually a file transfer, * the channel request will fail. Use * tp_capabilities_supports_file_transfer_uri() to determine * whether outgoing file transfers can have a URI. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_file_transfer_uri ( TpAccountChannelRequest *self, const gchar *uri) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_return_if_fail (uri != NULL); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_URI), tp_g_value_slice_new_string (uri)); } /** * tp_account_channel_request_set_file_transfer_timestamp: * @self: a #TpAccountChannelRequest * @timestamp: the modification timestamp of the file, in seconds since the * Unix epoch (the beginning of 1970 in the UTC time zone), as returned * by g_date_time_to_unix() * * Configure this channel request to accompany the file transfer with * the given modification timestamp for the file. * * If file timestamps are not supported by the protocol, or if this * method is used on a request that is not actually a file transfer, the * channel request will fail. Use * tp_capabilities_supports_file_transfer_date() to determine * whether outgoing file transfers can have a timestamp. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_file_transfer_timestamp ( TpAccountChannelRequest *self, guint64 timestamp) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE), tp_g_value_slice_new_uint64 (timestamp)); } /** * tp_account_channel_request_set_file_transfer_initial_offset: * @self: a #TpAccountChannelRequest * @offset: the offset into the file at which the transfer will start * * Configure this channel request to inform the recipient of the file * that this channel will not send the first @offset bytes of the file. * In some protocols, this can be used to resume an interrupted transfer. * * If this method is not called, the default is to start from the * beginning of the file (equivalent to @offset = 0). * * If offsets greater than 0 are not supported by the protocol, or if this * method is used on a request that is not actually a file transfer, the * channel request will fail. Use * tp_capabilities_supports_file_transfer_initial_offset() to determine * whether offsets greater than 0 are available. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.19.0 */ void tp_account_channel_request_set_file_transfer_initial_offset ( TpAccountChannelRequest *self, guint64 offset) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); if (offset == 0) { g_hash_table_remove (self->priv->request, TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET); } else { g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET), tp_g_value_slice_new_uint64 (offset)); } } /** * tp_account_channel_request_set_file_transfer_hash: * @self: a #TpAccountChannelRequest * @hash_type: a type of @hash * @hash: hash of the contents of the file transfer * * Configure this channel request to accompany the file transfer with * the hash of the file. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.23.2 */ void tp_account_channel_request_set_file_transfer_hash ( TpAccountChannelRequest *self, TpFileHashType hash_type, const gchar *hash) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_return_if_fail (hash_type < TP_NUM_FILE_HASH_TYPES); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE), tp_g_value_slice_new_uint (hash_type)); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH), tp_g_value_slice_new_string (hash)); } /** * tp_account_channel_request_new_stream_tube: * @account: a #TpAccount * @service: the service name that will be used over the tube. It should be a * well-known TCP service name as defined by * http://www.iana.org/assignments/port-numbers or * http://www.dns-sd.org/ServiceTypes.html, for instance "rsync" or "daap". * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object, * which will yield a StreamTube channel. * * After creating the request, you will also need to set the "target" * of the channel by calling one of the following functions: * * - tp_account_channel_request_set_target_contact() * - tp_account_channel_request_set_target_id() * * Returns: a new #TpAccountChannelRequest object * * Since: 0.23.2 */ TpAccountChannelRequest * tp_account_channel_request_new_stream_tube (TpAccount *account, const gchar *service, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (!tp_str_empty (service), NULL); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, G_TYPE_STRING, service, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_new_dbus_tube: * @account: a #TpAccount * @service_name: the service name that will be used over the tube. It should be * @user_action_time: the time of the user action that caused this request, * or one of the special values %TP_USER_ACTION_TIME_NOT_USER_ACTION or * %TP_USER_ACTION_TIME_CURRENT_TIME (see * #TpAccountChannelRequest:user-action-time) * * Convenience function to create a new #TpAccountChannelRequest object, * which will yield a DBusTube channel. * * After creating the request, you will also need to set the "target" * of the channel by calling one of the following functions: * * - tp_account_channel_request_set_target_contact() * - tp_account_channel_request_set_target_id() * * Returns: a new #TpAccountChannelRequest object * * Since: 0.23.2 */ TpAccountChannelRequest * tp_account_channel_request_new_dbus_tube (TpAccount *account, const gchar *service_name, gint64 user_action_time) { TpAccountChannelRequest *self; GHashTable *request; g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL); g_return_val_if_fail (!tp_str_empty (service_name), NULL); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, service_name, NULL); self = g_object_new (TP_TYPE_ACCOUNT_CHANNEL_REQUEST, "account", account, "request", request, "user-action-time", user_action_time, NULL); g_hash_table_unref (request); return self; } /** * tp_account_channel_request_set_sms_channel: * @self: a #TpAccountChannelRequest * @is_sms_channel: #TRUE if the channel should use SMS * * If @is_sms_channel is set to #TRUE, messages sent and received on the * requested channel will be transmitted via SMS. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.23.2 */ void tp_account_channel_request_set_sms_channel (TpAccountChannelRequest *self, gboolean is_sms_channel) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL), tp_g_value_slice_new_boolean (is_sms_channel)); } /** * tp_account_channel_request_set_conference_initial_channels: * @self: a #TpAccountChannelRequest * @channels: a #NULL-terminated array of channel paths * * Indicate that the channel which is going to be requested using @self * is an upgrade of the channels whose object paths is listed in @channels. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.23.2 */ void tp_account_channel_request_set_conference_initial_channels ( TpAccountChannelRequest *self, const gchar * const * channels) { GPtrArray *chans; guint i; g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); chans = g_ptr_array_new (); for (i = 0; channels != NULL && channels[i] != NULL; i++) g_ptr_array_add (chans, (gpointer) channels[i]); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_CHANNELS), tp_g_value_slice_new_boxed (TP_ARRAY_TYPE_OBJECT_PATH_LIST, chans)); g_ptr_array_unref (chans); } /** * tp_account_channel_request_set_initial_invitee_ids: * @self: a #TpAccountChannelRequest * @ids: a #NULL-terminated array of contact ids * * Indicate that the contacts listed in @ids have to be invited to the * conference represented by the channel which is going to be requested * using @self. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.23.2 */ void tp_account_channel_request_set_initial_invitee_ids ( TpAccountChannelRequest *self, const gchar * const * ids) { g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); g_return_if_fail (!self->priv->requested); g_hash_table_insert (self->priv->request, g_strdup (TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS), tp_g_value_slice_new_boxed (G_TYPE_STRV, ids)); } /** * tp_account_channel_request_set_initial_invitees: * @self: a #TpAccountChannelRequest * @contacts: (element-type TelepathyGLib.Contact): a #GPtrArray of #TpContact * * Indicate that the contacts listed in @contacts have to be invited to the * conference represented by the channel which is going to be requested * using @self. * * This function can't be called once @self has been used to request a * channel. * * Since: 0.23.2 */ void tp_account_channel_request_set_initial_invitees ( TpAccountChannelRequest *self, GPtrArray *contacts) { guint i; GPtrArray *ids; g_return_if_fail (contacts != NULL); ids = g_ptr_array_new (); for (i = 0; i < contacts->len; i++) { TpContact *contact = g_ptr_array_index (contacts, i); g_ptr_array_add (ids, (gchar *) tp_contact_get_identifier (contact)); } g_ptr_array_add (ids, NULL); tp_account_channel_request_set_initial_invitee_ids (self, (const gchar * const *) ids->pdata); g_ptr_array_unref (ids); } telepathy-glib-0.24.2/telepathy-glib/account-channel-request.h0000644000175000017500000002346312652510705021260 00000000000000/* * object used to request a channel from a TpAccount * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_ACCOUNT_CHANNEL_REQUEST_H__ #define __TP_ACCOUNT_CHANNEL_REQUEST_H__ #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpAccountChannelRequest TpAccountChannelRequest; typedef struct _TpAccountChannelRequestClass \ TpAccountChannelRequestClass; typedef struct _TpAccountChannelRequestPrivate \ TpAccountChannelRequestPrivate; GType tp_account_channel_request_get_type (void); #define TP_TYPE_ACCOUNT_CHANNEL_REQUEST \ (tp_account_channel_request_get_type ()) #define TP_ACCOUNT_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ACCOUNT_CHANNEL_REQUEST, \ TpAccountChannelRequest)) #define TP_ACCOUNT_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ACCOUNT_CHANNEL_REQUEST, \ TpAccountChannelRequestClass)) #define TP_IS_ACCOUNT_CHANNEL_REQUEST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ACCOUNT_CHANNEL_REQUEST)) #define TP_IS_ACCOUNT_CHANNEL_REQUEST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ACCOUNT_CHANNEL_REQUEST)) #define TP_ACCOUNT_CHANNEL_REQUEST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ACCOUNT_CHANNEL_REQUEST, \ TpAccountChannelRequestClass)) TpAccountChannelRequest * tp_account_channel_request_new ( TpAccount *account, GHashTable *request, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 TpAccountChannelRequest * tp_account_channel_request_new_vardict ( TpAccount *account, GVariant *request, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; TpAccount * tp_account_channel_request_get_account ( TpAccountChannelRequest *self); GHashTable * tp_account_channel_request_get_request ( TpAccountChannelRequest *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_account_channel_request_dup_request ( TpAccountChannelRequest *self); gint64 tp_account_channel_request_get_user_action_time ( TpAccountChannelRequest *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16 void tp_account_channel_request_set_channel_factory ( TpAccountChannelRequest *self, TpClientChannelFactory *factory); #endif TpChannelRequest * tp_account_channel_request_get_channel_request ( TpAccountChannelRequest *self); _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_hint (TpAccountChannelRequest *self, const gchar *key, GVariant *value); void tp_account_channel_request_set_hints (TpAccountChannelRequest *self, GHashTable *hints); _TP_AVAILABLE_IN_0_16 void tp_account_channel_request_set_delegate_to_preferred_handler ( TpAccountChannelRequest *self, gboolean delegate); /* Text */ _TP_AVAILABLE_IN_0_20 TpAccountChannelRequest *tp_account_channel_request_new_text ( TpAccount *account, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_24 void tp_account_channel_request_set_sms_channel (TpAccountChannelRequest *self, gboolean is_sms_channel); /* Calls */ _TP_AVAILABLE_IN_0_20 TpAccountChannelRequest *tp_account_channel_request_new_audio_call ( TpAccount *account, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 TpAccountChannelRequest *tp_account_channel_request_new_audio_video_call ( TpAccount *account, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; /* File transfer */ _TP_AVAILABLE_IN_0_20 TpAccountChannelRequest *tp_account_channel_request_new_file_transfer ( TpAccount *account, const gchar *filename, const gchar *mime_type, guint64 size, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_file_transfer_description ( TpAccountChannelRequest *self, const gchar *description); _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_file_transfer_uri ( TpAccountChannelRequest *self, const gchar *uri); _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_file_transfer_timestamp ( TpAccountChannelRequest *self, guint64 timestamp); _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_file_transfer_initial_offset ( TpAccountChannelRequest *self, guint64 offset); _TP_AVAILABLE_IN_0_24 void tp_account_channel_request_set_file_transfer_hash ( TpAccountChannelRequest *self, TpFileHashType hash_type, const gchar *hash); /* Tube */ _TP_AVAILABLE_IN_0_24 TpAccountChannelRequest *tp_account_channel_request_new_stream_tube ( TpAccount *account, const gchar *service, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_24 TpAccountChannelRequest *tp_account_channel_request_new_dbus_tube ( TpAccount *account, const gchar *service_name, gint64 user_action_time) G_GNUC_WARN_UNUSED_RESULT; /* Conference */ _TP_AVAILABLE_IN_0_24 void tp_account_channel_request_set_conference_initial_channels ( TpAccountChannelRequest *self, const gchar * const * channels); _TP_AVAILABLE_IN_0_24 void tp_account_channel_request_set_initial_invitee_ids ( TpAccountChannelRequest *self, const gchar * const * ids); _TP_AVAILABLE_IN_0_24 void tp_account_channel_request_set_initial_invitees ( TpAccountChannelRequest *self, GPtrArray *contacts); /* Channel target (shared between all channel types) */ _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_target_contact ( TpAccountChannelRequest *self, TpContact *contact); _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_target_id (TpAccountChannelRequest *self, TpHandleType handle_type, const gchar *identifier); /* Generic low-level */ _TP_AVAILABLE_IN_0_20 void tp_account_channel_request_set_request_property ( TpAccountChannelRequest *self, const gchar *name, GVariant *value); /* Request and handle API */ void tp_account_channel_request_create_and_handle_channel_async ( TpAccountChannelRequest *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); TpChannel * tp_account_channel_request_create_and_handle_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, TpHandleChannelsContext **context, GError **error) G_GNUC_WARN_UNUSED_RESULT; void tp_account_channel_request_ensure_and_handle_channel_async ( TpAccountChannelRequest *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); TpChannel * tp_account_channel_request_ensure_and_handle_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, TpHandleChannelsContext **context, GError **error) G_GNUC_WARN_UNUSED_RESULT; typedef void (*TpAccountChannelRequestDelegatedChannelCb) ( TpAccountChannelRequest *request, TpChannel *channel, gpointer user_data); _TP_AVAILABLE_IN_0_16 void tp_account_channel_request_set_delegated_channel_callback ( TpAccountChannelRequest *self, TpAccountChannelRequestDelegatedChannelCb callback, gpointer user_data, GDestroyNotify destroy); /* Request and forget API */ void tp_account_channel_request_create_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_channel_request_create_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error); void tp_account_channel_request_ensure_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_account_channel_request_ensure_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error); /* Request and observe API */ void tp_account_channel_request_create_and_observe_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); TpChannel * tp_account_channel_request_create_and_observe_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; void tp_account_channel_request_ensure_and_observe_channel_async ( TpAccountChannelRequest *self, const gchar *preferred_handler, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); TpChannel * tp_account_channel_request_ensure_and_observe_channel_finish ( TpAccountChannelRequest *self, GAsyncResult *result, GError **error) G_GNUC_WARN_UNUSED_RESULT; G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/client.xml0000644000175000017500000000065312652510705016353 00000000000000 Client interfaces telepathy-glib-0.24.2/telepathy-glib/svc-properties-interface.h0000644000175000017500000000044312652510705021444 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif /* svc-properties-interface is now officially svc-generic */ #include telepathy-glib-0.24.2/telepathy-glib/base-call-content.c0000644000175000017500000006541312652510705020017 00000000000000/* * base-call-content.c - Source for TpBaseCallContent * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Will Thompson * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-call-content * @title: TpBaseCallContent * @short_description: base class for #TpSvcCallContent implementations * @see_also: #TpSvcCallContent, #TpBaseCallChannel and #TpBaseCallStream * * This base class makes it easier to write #TpSvcCallContent * implementations by implementing its properties, and some of its methods. * * Subclasses should fill in #TpBaseCallContentClass.get_interfaces, * and #TpBaseCallContentClass.deinit virtual function. * * Since: 0.17.5 */ /** * TpBaseCallContent: * * A base class for call content implementations * * Since: 0.17.5 */ /** * TpBaseCallContentClass: * @get_interfaces: extra interfaces provided by this content (this SHOULD NOT * include %TP_IFACE_CALL_CONTENT itself). Implementation must first chainup on * parent class implementation then add extra interfaces into the #GPtrArray. * @deinit: optional; virtual method called by #TpBaseCallChannel when removing * the content * @start_tone: optional; virtual method called when user requested to send * a DTMF tone. Note that this method is already implemented by * #TpBaseMediaCallContent and so does not have to be overriden when using that * subclass * @stop_tone: optional; virtual method called when user requested to stop * sending currently being played DTMF tones. Note that this method is already * implemented by #TpBaseMediaCallContent and so does not have to be overriden * when using that subclass * @multiple_tones: optional; virtual method called when user requested to send * multiple DTMF tones. Note that this method is already implemented by * #TpBaseMediaCallContent and so does not have to be overriden when using that * subclass * * The class structure for #TpBaseCallContent * * Since: 0.17.5 */ /** * TpBaseCallContentGetInterfacesFunc: * @self: a #TpBaseCallContent * * Signature of an implementation of #TpBaseCallContentClass.get_interfaces. * * Returns: a #GPtrArray containing static strings. * Since: 0.17.5 */ /** * TpBaseCallContentDeinitFunc: * @self: a #TpBaseCallContent * * Signature of an implementation of #TpBaseCallContentClass.deinit. * * Since: 0.17.5 */ /** * TpBaseCallContentStartToneFunc: * @self: a #TpBaseCallContent * @event: a #TpDTMFEvent * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallContentClass.start_tone. * * Returns: %TRUE on success, otherwise %FALSE and set @error * Since: 0.17.5 */ /** * TpBaseCallContentStopToneFunc: * @self: a #TpBaseCallContent * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallContentClass.stop_tone. * * Returns: %TRUE on success, otherwise %FALSE and set @error * Since: 0.17.5 */ /** * TpBaseCallContentMultipleTonesFunc: * @self: a #TpBaseCallContent * @tones: a string representation of one or more DTMF events * @error: a #GError to fill * * Signature of an implementation of #TpBaseCallContentClass.multiple_tones. * * Returns: %TRUE on success, otherwise %FALSE and set @error * Since: 0.17.5 */ #include "config.h" #include "telepathy-glib/base-call-content.h" #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-channel.h" #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-connection.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/dbus-properties-mixin.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-generic.h" #include "telepathy-glib/util.h" #include "telepathy-glib/util-internal.h" static void call_content_iface_init (gpointer g_iface, gpointer iface_data); static void call_content_dtmf_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseCallContent, tp_base_call_content, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT, call_content_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_INTERFACE_DTMF, call_content_dtmf_iface_init) ) struct _TpBaseCallContentPrivate { TpBaseConnection *conn; gchar *object_path; gchar *name; TpMediaStreamType media_type; TpHandle creator; TpCallContentDisposition disposition; /* GList or reffed TpBaseCallStream */ GList *streams; /* Borrowed */ TpBaseCallChannel *channel; gboolean deinit_has_run; }; enum { PROP_OBJECT_PATH = 1, PROP_CONNECTION, /* Call.Content Properties */ PROP_INTERFACES, PROP_NAME, PROP_MEDIA_TYPE, PROP_CREATOR, PROP_DISPOSITION, PROP_STREAMS, /* Call.Content.Interface.DTMF properties */ PROP_CURRENTLY_SENDING_TONES, PROP_DEFERRED_TONES, }; static void tp_base_call_content_init (TpBaseCallContent *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CALL_CONTENT, TpBaseCallContentPrivate); } static void tp_base_call_content_constructed (GObject *obj) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (obj); TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon ( (TpBaseConnection *) self->priv->conn); if (G_OBJECT_CLASS (tp_base_call_content_parent_class)->constructed != NULL) G_OBJECT_CLASS (tp_base_call_content_parent_class)->constructed (obj); DEBUG ("Registering %s", self->priv->object_path); tp_dbus_daemon_register_object (bus, self->priv->object_path, obj); } static void tp_base_call_content_deinit_real (TpBaseCallContent *self) { TpDBusDaemon *bus = tp_base_connection_get_dbus_daemon ( (TpBaseConnection *) self->priv->conn); tp_dbus_daemon_unregister_object (bus, G_OBJECT (self)); tp_clear_pointer (&self->priv->streams, _tp_object_list_free); } static GPtrArray * tp_base_call_content_get_interfaces (TpBaseCallContent *self) { return g_ptr_array_new (); } static void tp_base_call_content_dispose (GObject *object) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (object); if (!self->priv->deinit_has_run) _tp_base_call_content_deinit (self); g_assert (self->priv->deinit_has_run); tp_clear_pointer (&self->priv->streams, _tp_object_list_free); g_object_notify (G_OBJECT (self), "streams"); tp_clear_object (&self->priv->conn); if (G_OBJECT_CLASS (tp_base_call_content_parent_class)->dispose != NULL) G_OBJECT_CLASS (tp_base_call_content_parent_class)->dispose (object); } static void tp_base_call_content_finalize (GObject *object) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (object); /* free any data held directly by the object here */ g_free (self->priv->object_path); g_free (self->priv->name); G_OBJECT_CLASS (tp_base_call_content_parent_class)->finalize (object); } static void tp_base_call_content_get_property ( GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (object); TpBaseCallContentClass *klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_INTERFACES: { GPtrArray *interfaces = klass->get_interfaces (self); g_ptr_array_add (interfaces, NULL); g_value_set_boxed (value, interfaces->pdata); g_ptr_array_unref (interfaces); break; } case PROP_NAME: g_value_set_string (value, self->priv->name); break; case PROP_MEDIA_TYPE: g_value_set_uint (value, self->priv->media_type); break; case PROP_CREATOR: g_value_set_uint (value, self->priv->creator); break; case PROP_DISPOSITION: g_value_set_uint (value, self->priv->disposition); break; case PROP_STREAMS: { GPtrArray *arr = g_ptr_array_sized_new (2); GList *l; for (l = self->priv->streams; l != NULL; l = g_list_next (l)) { TpBaseCallStream *s = TP_BASE_CALL_STREAM (l->data); g_ptr_array_add (arr, g_strdup (tp_base_call_stream_get_object_path (s))); } g_value_take_boxed (value, arr); break; } case PROP_CURRENTLY_SENDING_TONES: g_value_set_boolean (value, FALSE); break; case PROP_DEFERRED_TONES: g_value_set_static_string (value, ""); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_content_set_property ( GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (object); switch (property_id) { case PROP_OBJECT_PATH: self->priv->object_path = g_value_dup_string (value); g_assert (self->priv->object_path != NULL); break; case PROP_CONNECTION: self->priv->conn = g_value_dup_object (value); break; case PROP_NAME: self->priv->name = g_value_dup_string (value); break; case PROP_MEDIA_TYPE: self->priv->media_type = g_value_get_uint (value); break; case PROP_CREATOR: self->priv->creator = g_value_get_uint (value); break; case PROP_DISPOSITION: self->priv->disposition = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_call_content_class_init (TpBaseCallContentClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl content_props[] = { { "Interfaces", "interfaces", NULL }, { "Name", "name", NULL }, { "Type", "media-type", NULL }, { "Disposition", "disposition", NULL }, { "Streams", "streams", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl content_dtmf_props[] = { { "CurrentlySendingTones", "currently-sending-tones", NULL }, { "DeferredTones", "deferred-tones", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CALL_CONTENT, tp_dbus_properties_mixin_getter_gobject_properties, NULL, content_props, }, { TP_IFACE_CALL_CONTENT_INTERFACE_DTMF, tp_dbus_properties_mixin_getter_gobject_properties, NULL, content_dtmf_props, }, { NULL } }; g_type_class_add_private (klass, sizeof (TpBaseCallContentPrivate)); object_class->constructed = tp_base_call_content_constructed; object_class->dispose = tp_base_call_content_dispose; object_class->finalize = tp_base_call_content_finalize; object_class->get_property = tp_base_call_content_get_property; object_class->set_property = tp_base_call_content_set_property; klass->deinit = tp_base_call_content_deinit_real; klass->get_interfaces = tp_base_call_content_get_interfaces; /** * TpBaseCallContent:object-path: * * The D-Bus object path used for this object on the bus. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec); /** * TpBaseCallContent:connection: * * #TpBaseConnection object that owns this call content. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("connection", "TpBaseConnection object", "Tp base connection object that owns this call content", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpBaseCallContent:interfaces: * * Additional interfaces implemented by this content. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces", "Additional interfaces implemented by this content", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); /** * TpBaseCallContent:name: * * The name of this content, if any. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("name", "Name", "The name of this content, if any", "", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NAME, param_spec); /** * TpBaseCallContent:media-type: * * The #TpMediaStreamType of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("media-type", "Media Type", "The media type of this content", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MEDIA_TYPE, param_spec); /** * TpBaseCallContent:creator: * * The contact #TpHandle of the creator of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("creator", "Creator", "The creator of this content", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CREATOR, param_spec); /** * TpBaseCallContent:disposition: * * The #TpCallContentDisposition of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("disposition", "Disposition", "The disposition of this content", 0, G_MAXUINT, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISPOSITION, param_spec); /** * TpBaseCallContent:streams: * * A #GPtrArray of this content streams' #TpBaseCallStream:object-path. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("streams", "Stream", "The streams of this content", TP_ARRAY_TYPE_OBJECT_PATH_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STREAMS, param_spec); /** * TpBaseCallContent:currently-sending-tones: * * If this content is currently sending tones or not * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("currently-sending-tones", "CurrentlySendingTones", "If the Content is currently sending tones or not", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENTLY_SENDING_TONES, param_spec); /** * TpBaseCallContent:deferred-tones: * * Tones that are waiting for the user action to play. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("deferred-tones", "DeferredTones", "The tones requested in the initial channel request", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DEFERRED_TONES, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpBaseCallContentClass, dbus_props_class)); } /** * tp_base_call_content_get_connection: * @self: a #TpBaseCallContent * * * * Returns: the value of #TpBaseCallContent:connection * Since: 0.17.5 */ TpBaseConnection * tp_base_call_content_get_connection (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), NULL); return self->priv->conn; } /** * tp_base_call_content_get_object_path: * @self: a #TpBaseCallContent * * * * Returns: the value of #TpBaseCallContent:object-path * Since: 0.17.5 */ const gchar * tp_base_call_content_get_object_path (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), NULL); return self->priv->object_path; } /** * tp_base_call_content_get_name: * @self: a #TpBaseCallContent * * * * Returns: the value of #TpBaseCallContent:name * Since: 0.17.5 */ const gchar * tp_base_call_content_get_name (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), NULL); return self->priv->name; } /** * tp_base_call_content_get_media_type: * @self: a #TpBaseCallContent * * * * Returns: the value of #TpBaseCallContent:media-type * Since: 0.17.5 */ TpMediaStreamType tp_base_call_content_get_media_type (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), TP_MEDIA_STREAM_TYPE_AUDIO); return self->priv->media_type; } /** * tp_base_call_content_get_disposition: * @self: a #TpBaseCallContent * * * * Returns: the value of #TpBaseCallContent:disposition * Since: 0.17.5 */ TpCallContentDisposition tp_base_call_content_get_disposition (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), TP_CALL_CONTENT_DISPOSITION_NONE); return self->priv->disposition; } /** * tp_base_call_content_get_streams: * @self: a #TpBaseCallContent * * * * Returns: a #GList of #TpBaseCallStream of this content. * Since: 0.17.5 */ GList * tp_base_call_content_get_streams (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), NULL); return self->priv->streams; } /** * tp_base_call_content_add_stream: * @self: a #TpBaseCallContent * @stream: a #TpBaseCallStream * * Add @stream to @self's #TpBaseCallContent:streams. Emitting StreamsAdded * DBus signal. * * Since: 0.17.5 */ void tp_base_call_content_add_stream (TpBaseCallContent *self, TpBaseCallStream *stream) { GPtrArray *paths; g_return_if_fail (TP_IS_BASE_CALL_CONTENT (self)); g_return_if_fail (TP_IS_BASE_CALL_STREAM (stream)); g_return_if_fail (tp_base_call_stream_get_connection (stream) == self->priv->conn); g_return_if_fail (self->priv->channel != NULL); g_return_if_fail (g_list_find (self->priv->streams, stream) == NULL); _tp_base_call_stream_set_content (stream, self); self->priv->streams = g_list_prepend (self->priv->streams, g_object_ref (stream)); g_object_notify (G_OBJECT (self), "streams"); paths = g_ptr_array_new_with_free_func ((GDestroyNotify) g_free); g_ptr_array_add (paths, g_strdup ( tp_base_call_stream_get_object_path ( TP_BASE_CALL_STREAM (stream)))); tp_svc_call_content_emit_streams_added (self, paths); g_ptr_array_unref (paths); } void _tp_base_call_content_remove_stream_internal (TpBaseCallContent *self, TpBaseCallStream *stream, const GValueArray *reason_array) { GList *l; GPtrArray *paths; l = g_list_find (self->priv->streams, stream); g_return_if_fail (l != NULL); self->priv->streams = g_list_delete_link (self->priv->streams, l); g_object_notify (G_OBJECT (self), "streams"); paths = g_ptr_array_new (); g_ptr_array_add (paths, (gpointer) tp_base_call_stream_get_object_path (stream)); tp_svc_call_content_emit_streams_removed (self, paths, reason_array); g_ptr_array_unref (paths); g_object_unref (stream); } /** * tp_base_call_content_remove_stream: * @self: a #TpBaseCallContent * @stream: a #TpBaseCallStream * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Remove @stream from @self's #TpBaseCallContent:streams. Emitting * StreamsRemoved DBus signal. * * Since: 0.17.5 */ void tp_base_call_content_remove_stream (TpBaseCallContent *self, TpBaseCallStream *stream, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GValueArray *reason_array; g_return_if_fail (TP_IS_BASE_CALL_CONTENT (self)); g_return_if_fail (TP_IS_BASE_CALL_STREAM (stream)); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); _tp_base_call_content_remove_stream_internal (self, stream, reason_array); tp_value_array_free (reason_array); } static void tp_call_content_remove (TpSvcCallContent *content, DBusGMethodInvocation *context) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (content); if (!tp_base_call_channel_has_mutable_contents (self->priv->channel)) { GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Contents are not mutable" }; dbus_g_method_return_error (context, &error); return; } tp_base_call_channel_remove_content (self->priv->channel, self, tp_base_channel_get_self_handle ((TpBaseChannel *) self->priv->channel), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User has removed the content"); tp_svc_call_content_return_from_remove (context); } static void call_content_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcCallContentClass *klass = (TpSvcCallContentClass *) g_iface; #define IMPLEMENT(x) tp_svc_call_content_implement_##x (\ klass, tp_call_content_##x) IMPLEMENT(remove); #undef IMPLEMENT } /* These functions are used only internally */ void _tp_base_call_content_set_channel (TpBaseCallContent *self, TpBaseCallChannel *channel) { g_return_if_fail (TP_IS_BASE_CALL_CONTENT (self)); g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (channel)); g_return_if_fail (self->priv->channel == NULL); self->priv->channel = channel; if (self->priv->disposition == TP_CALL_CONTENT_DISPOSITION_INITIAL) { TpBaseCallContentClass *klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); const gchar *tones; tones =_tp_base_call_channel_get_initial_tones (channel); if (tones && tones[0] && klass->multiple_tones != NULL) { klass->multiple_tones (self, tones, NULL); } } } TpBaseCallChannel * _tp_base_call_content_get_channel (TpBaseCallContent *self) { g_return_val_if_fail (TP_IS_BASE_CALL_CONTENT (self), NULL); g_return_val_if_fail (self->priv->channel != NULL, NULL); return self->priv->channel; } void _tp_base_call_content_deinit (TpBaseCallContent *self) { TpBaseCallContentClass *klass; g_return_if_fail (TP_IS_BASE_CALL_CONTENT (self)); g_assert (!self->priv->deinit_has_run); self->priv->deinit_has_run = TRUE; klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); klass->deinit (self); } void _tp_base_call_content_accepted (TpBaseCallContent *self, TpHandle actor_handle) { GList *l; g_return_if_fail (TP_IS_BASE_CALL_CONTENT (self)); if (self->priv->disposition != TP_CALL_CONTENT_DISPOSITION_INITIAL) return; for (l = self->priv->streams ; l != NULL; l = g_list_next (l)) { TpBaseCallStream *s = TP_BASE_CALL_STREAM (l->data); if (tp_base_call_stream_get_local_sending_state (s) == TP_SENDING_STATE_PENDING_SEND) tp_base_call_stream_update_local_sending_state (s, TP_SENDING_STATE_SENDING, actor_handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "User accepted the Call"); } } static void tp_call_content_start_tone (TpSvcCallContentInterfaceDTMF *dtmf, guchar event, DBusGMethodInvocation *context) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (dtmf); TpBaseCallContentClass *klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); GError *error = NULL; if (klass->start_tone == NULL) { GError err = {G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"}; dbus_g_method_return_error (context, &err); return; } if (!klass->start_tone (self, event, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } tp_svc_call_content_interface_dtmf_return_from_start_tone (context); } static void tp_call_content_stop_tone (TpSvcCallContentInterfaceDTMF *dtmf, DBusGMethodInvocation *context) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (dtmf); TpBaseCallContentClass *klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); GError *error = NULL; if (klass->stop_tone == NULL) { GError err = {G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"}; dbus_g_method_return_error (context, &err); return; } if (!klass->stop_tone (self, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } tp_svc_call_content_interface_dtmf_return_from_stop_tone (context); } static void tp_call_content_multiple_tones (TpSvcCallContentInterfaceDTMF *dtmf, const gchar *tones, DBusGMethodInvocation *context) { TpBaseCallContent *self = TP_BASE_CALL_CONTENT (dtmf); TpBaseCallContentClass *klass = TP_BASE_CALL_CONTENT_GET_CLASS (self); GError *error = NULL; if (klass->multiple_tones == NULL) { GError err = {G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"}; dbus_g_method_return_error (context, &err); return; } if (!klass->multiple_tones (self, tones, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } tp_svc_call_content_interface_dtmf_return_from_multiple_tones (context); } static void call_content_dtmf_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcCallContentInterfaceDTMFClass *klass = (TpSvcCallContentInterfaceDTMFClass *) g_iface; #define IMPLEMENT(x) tp_svc_call_content_interface_dtmf_implement_##x (\ klass, tp_call_content_##x) IMPLEMENT(start_tone); IMPLEMENT(stop_tone); IMPLEMENT(multiple_tones); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/base-call-content.h0000644000175000017500000001067612652510705020025 00000000000000/* * base-call-content.h - Header for TpBaseBaseCallContent * Copyright © 2009–2011 Collabora Ltd. * @author Sjoerd Simons * @author Will Thompson * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_BASE_CALL_CONTENT_H #define TP_BASE_CALL_CONTENT_H #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpBaseCallContent TpBaseCallContent; typedef struct _TpBaseCallContentPrivate TpBaseCallContentPrivate; typedef struct _TpBaseCallContentClass TpBaseCallContentClass; typedef GPtrArray * (*TpBaseCallContentGetInterfacesFunc) ( TpBaseCallContent *self); typedef void (*TpBaseCallContentDeinitFunc) (TpBaseCallContent *self); typedef gboolean (*TpBaseCallContentStartToneFunc) (TpBaseCallContent *self, TpDTMFEvent event, GError **error); typedef gboolean (*TpBaseCallContentStopToneFunc) (TpBaseCallContent *self, GError **error); typedef gboolean (*TpBaseCallContentMultipleTonesFunc) (TpBaseCallContent *self, const gchar *tones, GError **error); struct _TpBaseCallContentClass { /**/ GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; /*< public >*/ TpBaseCallContentDeinitFunc deinit; TpBaseCallContentGetInterfacesFunc get_interfaces; TpBaseCallContentStartToneFunc start_tone; TpBaseCallContentStopToneFunc stop_tone; TpBaseCallContentMultipleTonesFunc multiple_tones; /**/ gpointer future[4]; }; struct _TpBaseCallContent { /**/ GObject parent; TpBaseCallContentPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_base_call_content_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_CALL_CONTENT \ (tp_base_call_content_get_type ()) #define TP_BASE_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_BASE_CALL_CONTENT, TpBaseCallContent)) #define TP_BASE_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_BASE_CALL_CONTENT, TpBaseCallContentClass)) #define TP_IS_BASE_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CALL_CONTENT)) #define TP_IS_BASE_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CALL_CONTENT)) #define TP_BASE_CALL_CONTENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_BASE_CALL_CONTENT, TpBaseCallContentClass)) _TP_AVAILABLE_IN_0_18 TpBaseConnection *tp_base_call_content_get_connection (TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 const gchar *tp_base_call_content_get_object_path (TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 const gchar *tp_base_call_content_get_name (TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 TpMediaStreamType tp_base_call_content_get_media_type (TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 TpCallContentDisposition tp_base_call_content_get_disposition ( TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 GList *tp_base_call_content_get_streams (TpBaseCallContent *self); _TP_AVAILABLE_IN_0_18 void tp_base_call_content_add_stream (TpBaseCallContent *self, TpBaseCallStream *stream); _TP_AVAILABLE_IN_0_18 void tp_base_call_content_remove_stream (TpBaseCallContent *self, TpBaseCallStream *stream, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); G_END_DECLS #endif /* #ifndef __TP_BASE_CALL_CONTENT_H__*/ telepathy-glib-0.24.2/telepathy-glib/proxy-internal.h0000644000175000017500000000324212652510705017514 00000000000000/**/ /* * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_PROXY_INTERNAL_H__ #define __TP_PROXY_INTERNAL_H__ #include GError *_tp_proxy_take_and_remap_error (TpProxy *self, GError *error) G_GNUC_WARN_UNUSED_RESULT; typedef void (*TpProxyProc) (TpProxy *); gboolean _tp_proxy_is_preparing (gpointer self, GQuark feature); void _tp_proxy_set_feature_prepared (TpProxy *self, GQuark feature, gboolean succeeded); void _tp_proxy_set_features_failed (TpProxy *self, const GError *error); void _tp_proxy_will_announce_connected_async (TpProxy *self, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_proxy_will_announce_connected_finish (TpProxy *self, GAsyncResult *result, GError **error); void _tp_proxy_ensure_factory (gpointer self, TpSimpleClientFactory *factory); #endif telepathy-glib-0.24.2/telepathy-glib/svc-debug.h0000644000175000017500000000045312652510705016401 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_SVC_DEBUG_H__ #define __TP_SVC_DEBUG_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/debug-message.c0000644000175000017500000001752212652510705017232 00000000000000/* * debug-message.c * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "debug-message.h" #include "debug-message-internal.h" #include /** * SECTION: debug-message * @title: TpDebugMessage * @short_description: a debug message * * #TpDebugMessage is a small object used to represent a debug message receive * from a Telepathy component using #TpDebugClient. * * See also: #TpDebugClient */ /** * TpDebugMessage: * * Data structure representing a #TpDebugMessage. * * Since: 0.19.0 */ /** * TpDebugMessageClass: * * The class of a #TpDebugMessage. * * Since: 0.19.0 */ G_DEFINE_TYPE (TpDebugMessage, tp_debug_message, G_TYPE_OBJECT) enum { PROP_TIME = 1, PROP_DOMAIN, PROP_CATEGORY, PROP_LEVEL, PROP_MESSAGE, LAST_PROPERTY, }; struct _TpDebugMessagePriv { GDateTime *time; gchar *domain; gchar *category; GLogLevelFlags level; gchar *message; }; static void tp_debug_message_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpDebugMessage *self = TP_DEBUG_MESSAGE (object); switch (property_id) { default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; case PROP_TIME: g_value_set_boxed (value, self->priv->time); break; case PROP_DOMAIN: g_value_set_string (value, self->priv->domain); break; case PROP_CATEGORY: g_value_set_string (value, self->priv->category); break; case PROP_LEVEL: g_value_set_uint (value, self->priv->level); break; case PROP_MESSAGE: g_value_set_string (value, self->priv->message); break; } } static void tp_debug_message_finalize (GObject *object) { TpDebugMessage *self = TP_DEBUG_MESSAGE (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_debug_message_parent_class)->finalize; g_free (self->priv->domain); g_free (self->priv->category); g_free (self->priv->message); if (chain_up != NULL) chain_up (object); } static void tp_debug_message_class_init ( TpDebugMessageClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *spec; oclass->get_property = tp_debug_message_get_property; oclass->finalize = tp_debug_message_finalize; /** * TpDebugMessage:time: * * Timestamp of the debug message. * * Since: 0.19.0 */ spec = g_param_spec_boxed ("time", "time", "Time", G_TYPE_DATE_TIME, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_TIME, spec); /** * TpDebugMessage:domain: * * Domain of the debug message. * * Since: 0.19.0 */ spec = g_param_spec_string ("domain", "domain", "Domain", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_DOMAIN, spec); /** * TpDebugMessage:category: * * Category of the debug message, or %NULL if none was specified. * * Since: 0.19.0 */ spec = g_param_spec_string ("category", "category", "Category", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_CATEGORY, spec); /** * TpDebugMessage:level: * * A #GLogLevelFlags representing the level of the debug message. * * Since: 0.19.0 */ spec = g_param_spec_uint ("level", "level", "Level", 0, G_LOG_LEVEL_MASK, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_LEVEL, spec); /** * TpDebugMessage:message: * * Text of the debug message, stripped from its trailing whitespaces. * * Since: 0.19.0 */ spec = g_param_spec_string ("message", "message", "Message", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_MESSAGE, spec); g_type_class_add_private (klass, sizeof (TpDebugMessagePriv)); } static void tp_debug_message_init (TpDebugMessage *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_DEBUG_MESSAGE, TpDebugMessagePriv); } static GLogLevelFlags debug_level_to_log_level_flags (TpDebugLevel level) { if (level == TP_DEBUG_LEVEL_ERROR) return G_LOG_LEVEL_ERROR; else if (level == TP_DEBUG_LEVEL_CRITICAL) return G_LOG_LEVEL_CRITICAL; else if (level == TP_DEBUG_LEVEL_WARNING) return G_LOG_LEVEL_WARNING; else if (level == TP_DEBUG_LEVEL_MESSAGE) return G_LOG_LEVEL_MESSAGE; else if (level == TP_DEBUG_LEVEL_INFO) return G_LOG_LEVEL_INFO; else if (level == TP_DEBUG_LEVEL_DEBUG) return G_LOG_LEVEL_DEBUG; /* Fall back to DEBUG if all else fails */ return TP_DEBUG_LEVEL_DEBUG; } TpDebugMessage * _tp_debug_message_new (gdouble timestamp, const gchar *domain, TpDebugLevel level, const gchar *message) { TpDebugMessage *self; GTimeVal tv; g_return_val_if_fail (domain != NULL, NULL); g_return_val_if_fail (message != NULL, NULL); self = g_object_new (TP_TYPE_DEBUG_MESSAGE, NULL); tv.tv_sec = (glong) timestamp; tv.tv_usec = ((timestamp - (int) timestamp) * 1e6); if (g_strrstr (domain, "/")) { gchar **parts = g_strsplit (domain, "/", 2); self->priv->domain = g_strdup (parts[0]); self->priv->category = g_strdup (parts[1]); g_strfreev (parts); } else { self->priv->domain = g_strdup (domain); self->priv->category = NULL; } self->priv->time = g_date_time_new_from_timeval_utc (&tv); self->priv->level = debug_level_to_log_level_flags (level); self->priv->message = g_strdup (message); g_strchomp (self->priv->message); return self; } /** * tp_debug_message_get_time: * @self: a #TpDebugMessage * * Return the #TpDebugMessage:time property * * Returns: (transfer none): the value of #TpDebugMessage:time property * * Since: 0.19.0 */ GDateTime * tp_debug_message_get_time (TpDebugMessage *self) { return self->priv->time; } /** * tp_debug_message_get_domain: * @self: a #TpDebugMessage * * Return the #TpDebugMessage:domain property * * Returns: the value of #TpDebugMessage:domain property * * Since: 0.19.0 */ const gchar * tp_debug_message_get_domain (TpDebugMessage *self) { return self->priv->domain; } /** * tp_debug_message_get_category: * @self: a #TpDebugMessage * * Return the #TpDebugMessage:category property * * Returns: the value of #TpDebugMessage:category property * * Since: 0.19.0 */ const char * tp_debug_message_get_category (TpDebugMessage *self) { return self->priv->category; } /** * tp_debug_message_get_level: * @self: a #TpDebugMessage * * Return the #TpDebugMessage:level property * * Returns: the value of #TpDebugMessage:level property * * Since: 0.19.0 */ GLogLevelFlags tp_debug_message_get_level (TpDebugMessage *self) { return self->priv->level; } /** * tp_debug_message_get_message: * @self: a #TpDebugMessage * * Return the #TpDebugMessage:message property * * Returns: the value of #TpDebugMessage:message property * * Since: 0.19.0 */ const gchar * tp_debug_message_get_message (TpDebugMessage *self) { return self->priv->message; } telepathy-glib-0.24.2/telepathy-glib/debug-message.h0000644000175000017500000000533012652510705017231 00000000000000/* * debug-message.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DEBUG_MESSAGE_H__ #define __TP_DEBUG_MESSAGE_H__ #include #include G_BEGIN_DECLS typedef struct _TpDebugMessage TpDebugMessage; typedef struct _TpDebugMessageClass TpDebugMessageClass; typedef struct _TpDebugMessagePriv TpDebugMessagePriv; struct _TpDebugMessageClass { /**/ GObjectClass parent_class; }; struct _TpDebugMessage { /**/ GObject parent; TpDebugMessagePriv *priv; }; _TP_AVAILABLE_IN_0_20 GType tp_debug_message_get_type (void); /* TYPE MACROS */ #define TP_TYPE_DEBUG_MESSAGE \ (tp_debug_message_get_type ()) #define TP_DEBUG_MESSAGE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_DEBUG_MESSAGE, \ TpDebugMessage)) #define TP_DEBUG_MESSAGE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_DEBUG_MESSAGE, \ TpDebugMessageClass)) #define TP_IS_DEBUG_MESSAGE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ TP_TYPE_DEBUG_MESSAGE)) #define TP_IS_DEBUG_MESSAGE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ TP_TYPE_DEBUG_MESSAGE)) #define TP_DEBUG_MESSAGE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_DEBUG_MESSAGE, \ TpDebugMessageClass)) _TP_AVAILABLE_IN_0_20 GDateTime * tp_debug_message_get_time (TpDebugMessage *self); _TP_AVAILABLE_IN_0_20 const gchar * tp_debug_message_get_domain (TpDebugMessage *self); _TP_AVAILABLE_IN_0_20 const gchar * tp_debug_message_get_category (TpDebugMessage *self); _TP_AVAILABLE_IN_0_20 GLogLevelFlags tp_debug_message_get_level (TpDebugMessage *self); _TP_AVAILABLE_IN_0_20 const gchar * tp_debug_message_get_message (TpDebugMessage *self); G_END_DECLS #endif /* #ifndef __TP_DEBUG_MESSAGE_H__*/ telepathy-glib-0.24.2/telepathy-glib/util.c0000644000175000017500000015520312652510705015476 00000000000000/* * util.c - Source for telepathy-glib utility functions * Copyright © 2006-2010 Collabora Ltd. * Copyright © 2006-2008 Nokia Corporation * Copyright © 1999 Tom Tromey * Copyright © 2000 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:util * @title: Utilities * @short_description: Non-Telepathy utility functions * * Some utility functions used in telepathy-glib which could have been in * GLib, but aren't. */ #include "config.h" #include #include #ifdef HAVE_GIO_UNIX #include #include #endif /* HAVE_GIO_UNIX */ #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_MISC #include "debug-internal.h" #include "simple-client-factory-internal.h" /** * tp_verify: * @R: a requirement (constant expression) to be checked at compile-time * * Make an assertion at compile time, like C++0x's proposed static_assert * keyword. If @R is determined to be true, there is no overhead at runtime; * if @R is determined to be false, compilation will fail. * * This macro can be used at file scope (it expands to a dummy extern * declaration). * * (This is gnulib's verify macro, written by Paul Eggert, Bruno Haible and * Jim Meyering.) * * This macro will be deprecated in a future telepathy-glib release. Please * use GLib 2.20's G_STATIC_ASSERT() macro in new code. * * Since: 0.7.34 */ /** * tp_verify_true: * @R: a requirement (constant expression) to be checked at compile-time * * Make an assertion at compile time, like C++0x's proposed static_assert * keyword. If @R is determined to be true, there is no overhead at runtime, * and the macro evaluates to 1 as an integer constant expression; * if @R is determined to be false, compilation will fail. * * This macro can be used anywhere that an integer constant expression would * be allowed. * * (This is gnulib's verify_true macro, written by Paul Eggert, Bruno Haible * and Jim Meyering.) * * This macro will be deprecated in a future telepathy-glib release. Please * use GLib 2.20's G_STATIC_ASSERT() macro in new code. * * Returns: 1 * * Since: 0.7.34 */ /** * tp_verify_statement: * @R: a requirement (constant expression) to be checked at compile-time * * Make an assertion at compile time, like C++0x's proposed static_assert * keyword. If @R is determined to be true, there is no overhead at runtime; * if @R is determined to be false, compilation will fail. * * This macro can be used anywhere that a statement would be allowed; it * is equivalent to ((void) tp_verify_true (R)). * * This macro will be deprecated in a future telepathy-glib release. Please * use GLib 2.20's G_STATIC_ASSERT() macro in new code. * * Since: 0.7.34 */ /** * tp_g_ptr_array_contains: (skip) * @haystack: The pointer array to be searched * @needle: The pointer to look for * * * * Returns: %TRUE if @needle is one of the elements of @haystack */ gboolean tp_g_ptr_array_contains (GPtrArray *haystack, gpointer needle) { guint i; g_return_val_if_fail (haystack != NULL, FALSE); for (i = 0; i < haystack->len; i++) { if (g_ptr_array_index (haystack, i) == needle) return TRUE; } return FALSE; } static void add_to_array (gpointer data, gpointer user_data) { g_ptr_array_add (user_data, data); } /** * tp_g_ptr_array_extend: (skip) * @target: a #GPtrArray to copy items to * @source: a #GPtrArray to copy items from * * Appends all elements of @source to @target. Note that this only copies the * pointers from @source; any duplication or reference-incrementing must be * performed by the caller. * * After this function has been called, it is safe to call * g_ptr_array_free() on @source and also free the actual pointer array, * as long as doing so does not free the data pointed to by the new * items in @target. * * Since: 0.14.3 */ void tp_g_ptr_array_extend (GPtrArray *target, GPtrArray *source) { g_return_if_fail (source != NULL); g_return_if_fail (target != NULL); g_ptr_array_foreach (source, add_to_array, target); } /** * tp_g_value_slice_new: (skip) * @type: The type desired for the new GValue * * Slice-allocate an empty #GValue. tp_g_value_slice_new_boolean() and similar * functions are likely to be more convenient to use for the types supported. * * Returns: a newly allocated, newly initialized #GValue, to be freed with * tp_g_value_slice_free() or g_slice_free(). * Since: 0.5.14 */ GValue * tp_g_value_slice_new (GType type) { GValue *ret = g_slice_new0 (GValue); g_value_init (ret, type); return ret; } /** * tp_g_value_slice_new_boolean: (skip) * @b: a boolean value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_BOOLEAN with value @b, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_boolean (gboolean b) { GValue *v = tp_g_value_slice_new (G_TYPE_BOOLEAN); g_value_set_boolean (v, b); return v; } /** * tp_g_value_slice_new_int: (skip) * @n: an integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_INT with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_int (gint n) { GValue *v = tp_g_value_slice_new (G_TYPE_INT); g_value_set_int (v, n); return v; } /** * tp_g_value_slice_new_int64: (skip) * @n: a 64-bit integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_INT64 with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_int64 (gint64 n) { GValue *v = tp_g_value_slice_new (G_TYPE_INT64); g_value_set_int64 (v, n); return v; } /** * tp_g_value_slice_new_byte: (skip) * @n: an unsigned integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_UCHAR with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.11.0 */ GValue * tp_g_value_slice_new_byte (guchar n) { GValue *v = tp_g_value_slice_new (G_TYPE_UCHAR); g_value_set_uchar (v, n); return v; } /** * tp_g_value_slice_new_uint: (skip) * @n: an unsigned integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_UINT with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_uint (guint n) { GValue *v = tp_g_value_slice_new (G_TYPE_UINT); g_value_set_uint (v, n); return v; } /** * tp_g_value_slice_new_uint64: (skip) * @n: a 64-bit unsigned integer * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_UINT64 with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_uint64 (guint64 n) { GValue *v = tp_g_value_slice_new (G_TYPE_UINT64); g_value_set_uint64 (v, n); return v; } /** * tp_g_value_slice_new_double: (skip) * @d: a number * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_DOUBLE with value @n, to be freed with * tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_double (double n) { GValue *v = tp_g_value_slice_new (G_TYPE_DOUBLE); g_value_set_double (v, n); return v; } /** * tp_g_value_slice_new_string: (skip) * @string: a string to be copied into the value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is a copy of @string, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_string (const gchar *string) { GValue *v = tp_g_value_slice_new (G_TYPE_STRING); g_value_set_string (v, string); return v; } /** * tp_g_value_slice_new_static_string: (skip) * @string: a static string which must remain valid forever, to be pointed to * by the value * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is @string, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_static_string (const gchar *string) { GValue *v = tp_g_value_slice_new (G_TYPE_STRING); g_value_set_static_string (v, string); return v; } /** * tp_g_value_slice_new_take_string: (skip) * @string: a string which will be freed with g_free() by the returned #GValue * (the caller must own it before calling this function, but no longer owns * it after this function returns) * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type %G_TYPE_STRING whose value is @string, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_take_string (gchar *string) { GValue *v = tp_g_value_slice_new (G_TYPE_STRING); g_value_take_string (v, string); return v; } /** * tp_g_value_slice_new_boxed: (skip) * @type: a boxed type * @p: a pointer of type @type, which will be copied * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is a copy of @p, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_boxed (GType type, gconstpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = tp_g_value_slice_new (type); g_value_set_boxed (v, p); return v; } /** * tp_g_value_slice_new_static_boxed: (skip) * @type: a boxed type * @p: a pointer of type @type, which must remain valid forever * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is @p, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_static_boxed (GType type, gconstpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = tp_g_value_slice_new (type); g_value_set_static_boxed (v, p); return v; } /** * tp_g_value_slice_new_take_boxed: (skip) * @type: a boxed type * @p: a pointer of type @type which will be freed with g_boxed_free() by the * returned #GValue (the caller must own it before calling this function, but * no longer owns it after this function returns) * * Slice-allocate and initialize a #GValue. This function is convenient to * use when constructing hash tables from string to #GValue, for example. * * Returns: a #GValue of type @type whose value is @p, * to be freed with tp_g_value_slice_free() or g_slice_free() * * Since: 0.7.27 */ GValue * tp_g_value_slice_new_take_boxed (GType type, gpointer p) { GValue *v; g_return_val_if_fail (G_TYPE_FUNDAMENTAL (type) == G_TYPE_BOXED, NULL); v = tp_g_value_slice_new (type); g_value_take_boxed (v, p); return v; } /** * tp_g_value_slice_free: (skip) * @value: A GValue which was allocated with the g_slice API * * Unset and free a slice-allocated GValue. * * (GDestroyNotify) tp_g_value_slice_free can be used * as a destructor for values in a #GHashTable, for example. */ void tp_g_value_slice_free (GValue *value) { g_value_unset (value); g_slice_free (GValue, value); } /** * tp_g_value_slice_dup: (skip) * @value: A GValue * * * * Returns: a newly allocated copy of @value, to be freed with * tp_g_value_slice_free() or g_slice_free(). * Since: 0.5.14 */ GValue * tp_g_value_slice_dup (const GValue *value) { GValue *ret = tp_g_value_slice_new (G_VALUE_TYPE (value)); g_value_copy (value, ret); return ret; } struct _tp_g_hash_table_update { GHashTable *target; GBoxedCopyFunc key_dup, value_dup; }; static void _tp_g_hash_table_update_helper (gpointer key, gpointer value, gpointer user_data) { struct _tp_g_hash_table_update *data = user_data; gpointer new_key = (data->key_dup != NULL) ? (data->key_dup) (key) : key; gpointer new_value = (data->value_dup != NULL) ? (data->value_dup) (value) : value; g_hash_table_replace (data->target, new_key, new_value); } /** * tp_g_hash_table_update: (skip) * @target: The hash table to be updated * @source: The hash table to update it with (read-only) * @key_dup: function to duplicate a key from @source so it can be be stored * in @target. If NULL, the key is not copied, but is used as-is * @value_dup: function to duplicate a value from @source so it can be stored * in @target. If NULL, the value is not copied, but is used as-is * * Add each item in @source to @target, replacing any existing item with the * same key. @key_dup and @value_dup are used to duplicate the items; in * principle they could also be used to convert between types. * * Since: 0.7.0 */ void tp_g_hash_table_update (GHashTable *target, GHashTable *source, GBoxedCopyFunc key_dup, GBoxedCopyFunc value_dup) { struct _tp_g_hash_table_update data = { target, key_dup, value_dup }; g_return_if_fail (target != NULL); g_return_if_fail (source != NULL); g_return_if_fail (target != source); g_hash_table_foreach (source, _tp_g_hash_table_update_helper, &data); } /** * tp_str_empty: (skip) * @s: (type utf8) (transfer none): a string * * Return %TRUE if @s is empty, counting %NULL as empty. * * Returns: (type boolean): %TRUE if @s is either %NULL or "" * * Since: 0.11.1 */ /* no definition here - it's inlined */ /** * tp_strdiff: (skip) * @left: The first string to compare (may be NULL) * @right: The second string to compare (may be NULL) * * Return %TRUE if the given strings are different. Unlike #strcmp this * function will handle null pointers, treating them as distinct from any * string. * * Returns: %FALSE if @left and @right are both %NULL, or if * neither is %NULL and both have the same contents; %TRUE otherwise */ gboolean tp_strdiff (const gchar *left, const gchar *right) { return g_strcmp0 (left, right) != 0; } /** * tp_mixin_offset_cast: (skip) * @instance: A pointer to a structure * @offset: The offset of a structure member in bytes, which must not be 0 * * Extend a pointer by an offset, provided the offset is not 0. * This is used to cast from an object instance to one of the telepathy-glib * mixin classes. * * Returns: a pointer @offset bytes beyond @instance */ gpointer tp_mixin_offset_cast (gpointer instance, guint offset) { g_return_val_if_fail (offset != 0, NULL); return ((guchar *) instance + offset); } /** * tp_mixin_instance_get_offset: (skip) * @instance: A pointer to a GObject-derived instance structure * @quark: A quark that was used to store the offset with g_type_set_qdata() * * If the type of @instance, or any of its ancestor types, has had an offset * attached using qdata with the given @quark, return that offset. If not, * return 0. * * In older telepathy-glib versions, calling this function on an instance that * did not have the mixin was considered to be a programming error. Since * version 0.13.9, 0 is returned, without error. * * This is used to implement the telepathy-glib mixin classes. * * Returns: the offset of the mixin */ guint tp_mixin_instance_get_offset (gpointer instance, GQuark quark) { GType t; for (t = G_OBJECT_TYPE (instance); t != 0; t = g_type_parent (t)) { gpointer qdata = g_type_get_qdata (t, quark); if (qdata != NULL) return GPOINTER_TO_UINT (qdata); } return 0; } /** * tp_mixin_class_get_offset: (skip) * @klass: A pointer to a GObjectClass-derived class structure * @quark: A quark that was used to store the offset with g_type_set_qdata() * * If the type of @klass, or any of its ancestor types, has had an offset * attached using qdata with the given @quark, return that offset; if not, * return 0. * * In older telepathy-glib versions, calling this function on an instance that * did not have the mixin was considered to be a programming error. Since * version 0.13.9, 0 is returned, without error. * * This is used to implement the telepathy-glib mixin classes. * * Returns: the offset of the mixin class */ guint tp_mixin_class_get_offset (gpointer klass, GQuark quark) { GType t; for (t = G_OBJECT_CLASS_TYPE (klass); t != 0; t = g_type_parent (t)) { gpointer qdata = g_type_get_qdata (t, quark); if (qdata != NULL) return GPOINTER_TO_UINT (qdata); } return 0; } static inline gboolean _esc_ident_bad (gchar c, gboolean is_first) { return ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && (c < '0' || c > '9' || is_first)); } /** * tp_escape_as_identifier: * @name: The string to be escaped * * Escape an arbitrary string so it follows the rules for a C identifier, * and hence an object path component, interface element component, * bus name component or member name in D-Bus. * * Unlike g_strcanon this is a reversible encoding, so it preserves * distinctness. * * The escaping consists of replacing all non-alphanumerics, and the first * character if it's a digit, with an underscore and two lower-case hex * digits: * * "0123abc_xyz\x01\xff" -> _30123abc_5fxyz_01_ff * * i.e. similar to URI encoding, but with _ taking the role of %, and a * smaller allowed set. As a special case, "" is escaped to "_" (just for * completeness, really). * * Returns: (transfer full): the escaped string, which must be freed by * the caller with #g_free */ gchar * tp_escape_as_identifier (const gchar *name) { gboolean bad = FALSE; size_t len = 0; GString *op; const gchar *ptr, *first_ok; g_return_val_if_fail (name != NULL, NULL); /* fast path for empty name */ if (name[0] == '\0') return g_strdup ("_"); for (ptr = name; *ptr; ptr++) { if (_esc_ident_bad (*ptr, ptr == name)) { bad = TRUE; len += 3; } else len++; } /* fast path if it's clean */ if (!bad) return g_strdup (name); /* If strictly less than ptr, first_ok is the first uncopied safe character. */ first_ok = name; op = g_string_sized_new (len); for (ptr = name; *ptr; ptr++) { if (_esc_ident_bad (*ptr, ptr == name)) { /* copy preceding safe characters if any */ if (first_ok < ptr) { g_string_append_len (op, first_ok, ptr - first_ok); } /* escape the unsafe character */ g_string_append_printf (op, "_%02x", (unsigned char)(*ptr)); /* restart after it */ first_ok = ptr + 1; } } /* copy trailing safe characters if any */ if (first_ok < ptr) { g_string_append_len (op, first_ok, ptr - first_ok); } return g_string_free (op, FALSE); } /** * tp_strv_contains: (skip) * @strv: a NULL-terminated array of strings, or %NULL (which is treated as an * empty strv) * @str: a non-NULL string * * * Returns: TRUE if @str is an element of @strv, according to strcmp(). * * Since: 0.7.15 */ gboolean tp_strv_contains (const gchar * const *strv, const gchar *str) { g_return_val_if_fail (str != NULL, FALSE); if (strv == NULL) return FALSE; while (*strv != NULL) { if (!tp_strdiff (str, *strv)) return TRUE; strv++; } return FALSE; } /** * tp_g_key_file_get_int64: (skip) * @key_file: a non-%NULL #GKeyFile * @group_name: a non-%NULL group name * @key: a non-%NULL key * @error: return location for a #GError * * Returns the value associated with @key under @group_name as a signed * 64-bit integer. This is similar to g_key_file_get_integer() but can return * 64-bit results without truncation. * * Returns: the value associated with the key as a signed 64-bit integer, or * 0 if the key was not found or could not be parsed. * * Since: 0.7.31 * Deprecated: Since 0.21.0. Use g_key_file_get_int64() instead. */ gint64 tp_g_key_file_get_int64 (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error) { gchar *s, *end; gint64 v; g_return_val_if_fail (key_file != NULL, -1); g_return_val_if_fail (group_name != NULL, -1); g_return_val_if_fail (key != NULL, -1); s = g_key_file_get_value (key_file, group_name, key, error); if (s == NULL) return 0; v = g_ascii_strtoll (s, &end, 10); if (*s == '\0' || *end != '\0') { g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, "Key '%s' in group '%s' has value '%s' where int64 was expected", key, group_name, s); return 0; } g_free (s); return v; } /** * tp_g_key_file_get_uint64: (skip) * @key_file: a non-%NULL #GKeyFile * @group_name: a non-%NULL group name * @key: a non-%NULL key * @error: return location for a #GError * * Returns the value associated with @key under @group_name as an unsigned * 64-bit integer. This is similar to g_key_file_get_integer() but can return * large positive results without truncation. * * Returns: the value associated with the key as an unsigned 64-bit integer, * or 0 if the key was not found or could not be parsed. * * Since: 0.7.31 * Deprecated: Since 0.21.0. Use g_key_file_get_uint64() instead. */ guint64 tp_g_key_file_get_uint64 (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error) { gchar *s, *end; guint64 v; g_return_val_if_fail (key_file != NULL, -1); g_return_val_if_fail (group_name != NULL, -1); g_return_val_if_fail (key != NULL, -1); s = g_key_file_get_value (key_file, group_name, key, error); if (s == NULL) return 0; v = g_ascii_strtoull (s, &end, 10); if (*s == '\0' || *end != '\0') { g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, "Key '%s' in group '%s' has value '%s' where uint64 was expected", key, group_name, s); return 0; } g_free (s); return v; } typedef struct { GObject *instance; GObject *observer; GClosure *closure; gulong handler_id; } WeakHandlerCtx; static WeakHandlerCtx * whc_new (GObject *instance, GObject *observer) { WeakHandlerCtx *ctx = g_slice_new0 (WeakHandlerCtx); ctx->instance = instance; ctx->observer = observer; return ctx; } static void whc_free (WeakHandlerCtx *ctx) { g_slice_free (WeakHandlerCtx, ctx); } static void observer_destroyed_cb (gpointer, GObject *); static void closure_invalidated_cb (gpointer, GClosure *); /* * If signal handlers are removed before the object is destroyed, this * callback will never get triggered. */ static void instance_destroyed_cb (gpointer ctx_, GObject *where_the_instance_was) { WeakHandlerCtx *ctx = ctx_; /* No need to disconnect the signal here, the instance has gone away. */ g_object_weak_unref (ctx->observer, observer_destroyed_cb, ctx); g_closure_remove_invalidate_notifier (ctx->closure, ctx, closure_invalidated_cb); whc_free (ctx); } /* Triggered when the observer is destroyed. */ static void observer_destroyed_cb (gpointer ctx_, GObject *where_the_observer_was) { WeakHandlerCtx *ctx = ctx_; g_closure_remove_invalidate_notifier (ctx->closure, ctx, closure_invalidated_cb); g_signal_handler_disconnect (ctx->instance, ctx->handler_id); g_object_weak_unref (ctx->instance, instance_destroyed_cb, ctx); whc_free (ctx); } /* Triggered when either object is destroyed or the handler is disconnected. */ static void closure_invalidated_cb (gpointer ctx_, GClosure *where_the_closure_was) { WeakHandlerCtx *ctx = ctx_; g_object_weak_unref (ctx->instance, instance_destroyed_cb, ctx); g_object_weak_unref (ctx->observer, observer_destroyed_cb, ctx); whc_free (ctx); } /** * tp_g_signal_connect_object: (skip) * @instance: the instance to connect to. * @detailed_signal: a string of the form "signal-name::detail". * @c_handler: the #GCallback to connect. * @gobject: the object to pass as data to @c_handler. * @connect_flags: a combination of #GConnectFlags. Only * %G_CONNECT_AFTER and %G_CONNECT_SWAPPED are supported by this function. * * Connects a #GCallback function to a signal for a particular object, as if * with g_signal_connect(). Additionally, arranges for the signal handler to be * disconnected if @gobject is destroyed. * * This is similar to g_signal_connect_data(), but uses a closure which * ensures that the @gobject stays alive during the call to @c_handler * by temporarily adding a reference count to @gobject. * * This is similar to g_signal_connect_object(), but doesn't have the * documented bug that everyone is too scared to fix. Also, it does not allow * you to pass in NULL as @gobject * * This is intended to be a convenient way for objects to use themselves as * user_data for callbacks without having to explicitly disconnect all the * handlers in their finalizers. * * Changed in 0.10.4 and 0.11.3: %G_CONNECT_AFTER is now respected. * * Returns: the handler id * * Since: 0.9.2 */ gulong tp_g_signal_connect_object (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer gobject, GConnectFlags connect_flags) { GObject *instance_obj = G_OBJECT (instance); WeakHandlerCtx *ctx = whc_new (instance_obj, gobject); g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), 0); g_return_val_if_fail (detailed_signal != NULL, 0); g_return_val_if_fail (c_handler != NULL, 0); g_return_val_if_fail (G_IS_OBJECT (gobject), 0); g_return_val_if_fail ( (connect_flags & ~(G_CONNECT_AFTER|G_CONNECT_SWAPPED)) == 0, 0); if (connect_flags & G_CONNECT_SWAPPED) ctx->closure = g_cclosure_new_object_swap (c_handler, gobject); else ctx->closure = g_cclosure_new_object (c_handler, gobject); ctx->handler_id = g_signal_connect_closure (instance, detailed_signal, ctx->closure, (connect_flags & G_CONNECT_AFTER) ? TRUE : FALSE); g_object_weak_ref (instance_obj, instance_destroyed_cb, ctx); g_object_weak_ref (gobject, observer_destroyed_cb, ctx); g_closure_add_invalidate_notifier (ctx->closure, ctx, closure_invalidated_cb); return ctx->handler_id; } /* * _tp_quark_array_copy: * @quarks: A 0-terminated list of quarks to copy * * Copy a zero-terminated array into a GArray. The trailing * 0 is not counted in the @len member of the returned * array, but the @data member is guaranteed to be * zero-terminated. * * Returns: A new GArray containing a copy of @quarks. */ GArray * _tp_quark_array_copy (const GQuark *quarks) { GArray *array; const GQuark *q; array = g_array_new (TRUE, TRUE, sizeof (GQuark)); for (q = quarks; q != NULL && *q != 0; q++) { g_array_append_val (array, *q); } return array; } /** * tp_value_array_build: (skip) * @length: The number of elements that should be in the array * @type: The type of the first argument. * @...: The value of the first item in the struct followed by a list of type, * value pairs terminated by G_TYPE_INVALID. * * Creates a new #GValueArray for use with structs, containing the values * passed in as parameters. The values are copied or reffed as appropriate for * their type. * * * using tp_value_array_build * * GValueArray *array = tp_value_array_build (2, * G_TYPE_STRING, host, * G_TYPE_UINT, port, * G_TYPE_INVALID); * * * * Returns: a newly created #GValueArray, free with tp_value_array_free() * * Since: 0.9.2 */ GValueArray * tp_value_array_build (gsize length, GType type, ...) { GValueArray *arr; GType t; va_list var_args; char *error = NULL; G_GNUC_BEGIN_IGNORE_DEPRECATIONS arr = g_value_array_new (length); G_GNUC_END_IGNORE_DEPRECATIONS va_start (var_args, type); for (t = type; t != G_TYPE_INVALID; t = va_arg (var_args, GType)) { GValue *v = arr->values + arr->n_values; G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_append (arr, NULL); G_GNUC_END_IGNORE_DEPRECATIONS g_value_init (v, t); G_VALUE_COLLECT (v, var_args, 0, &error); if (error != NULL) { CRITICAL ("%s", error); g_free (error); tp_value_array_free (arr); va_end (var_args); return NULL; } } g_warn_if_fail (arr->n_values == length); va_end (var_args); return arr; } /** * tp_value_array_unpack: (skip) * @array: the array to unpack * @len: The number of elements that should be in the array * @...: a list of correctly typed pointers to store the values in * * Unpacks a #GValueArray into separate variables. * * The contents of the values aren't copied into the variables, and so become * invalid when @array is freed. * * * using tp_value_array_unpack * * const gchar *host; * guint port; * * tp_value_array_unpack (array, 2, * &host, * &port); * * * * Since: 0.11.0 */ void tp_value_array_unpack (GValueArray *array, gsize len, ...) { va_list var_args; guint i; va_start (var_args, len); for (i = 0; i < len; i++) { GValue *value; char *error = NULL; if (G_UNLIKELY (i > array->n_values)) { WARNING ("More parameters than entries in the struct!"); break; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth (array, i); G_GNUC_END_IGNORE_DEPRECATIONS G_VALUE_LCOPY (value, var_args, G_VALUE_NOCOPY_CONTENTS, &error); if (error != NULL) { WARNING ("%s", error); g_free (error); break; } } va_end (var_args); } /** * TpWeakRef: * * A simple wrapper for a weak reference to a #GObject, suitable for use in * asynchronous calls which should only affect the object if it hasn't already * been freed. * * As well as wrapping a weak reference to an object, this structure can * contain an extra pointer to arbitrary data. This is useful for asynchronous * calls which act on an object and some second piece of data, which are quite * common in practice. * * If more than one piece of auxiliary data is required, the @user_data * argument to the constructor can be a struct or a #GValueArray. * * Since: 0.11.3 */ struct _TpWeakRef { /**/ gpointer object; gpointer user_data; GDestroyNotify destroy; }; /** * tp_weak_ref_new: (skip) * @object: (type GObject.Object): an object to which to take a weak reference * @user_data: optional additional data to store alongside the weak ref * @destroy: destructor for @user_data, called when the weak ref * is freed * * Return a new weak reference wrapper for @object. * * Returns: (transfer full): a new weak-reference wrapper * * Free-function: tp_weak_ref_destroy() * * Since: 0.11.3 */ TpWeakRef * tp_weak_ref_new (gpointer object, gpointer user_data, GDestroyNotify destroy) { TpWeakRef *self; g_return_val_if_fail (G_IS_OBJECT (object), NULL); self = g_slice_new (TpWeakRef); self->object = object; g_object_add_weak_pointer (self->object, &self->object); self->user_data = user_data; self->destroy = destroy; return self; } /** * tp_weak_ref_get_user_data: (skip) * @self: a weak reference * * Return the additional data that was passed to tp_weak_ref_new(). * * Returns: the additional data supplied in tp_weak_ref_new(), which may be * %NULL * * Since: 0.11.3 */ gpointer tp_weak_ref_get_user_data (TpWeakRef *self) { return self->user_data; } /** * tp_weak_ref_dup_object: (skip) * @self: a weak reference * * If the weakly referenced object still exists, return a new reference to * it. Otherwise, return %NULL. * * Returns: (type GObject.Object) (transfer full): a new reference, or %NULL * * Since: 0.11.3 */ gpointer tp_weak_ref_dup_object (TpWeakRef *self) { if (self->object != NULL) return g_object_ref (self->object); return NULL; } /** * tp_weak_ref_destroy: (skip) * @self: (transfer full): a weak reference * * Free a weak reference wrapper. This drops the weak reference to the * object (if it still exists), and frees the user data with the user-supplied * destructor function if one was provided. * * Since: 0.11.3 */ void tp_weak_ref_destroy (TpWeakRef *self) { if (self->object != NULL) g_object_remove_weak_pointer (self->object, &self->object); if (self->destroy != NULL) (self->destroy) (self->user_data); g_slice_free (TpWeakRef, self); } /** * tp_clear_object: (skip) * @op: a pointer to a variable, struct member etc. holding a #GObject * * Set a variable holding a #GObject to %NULL. If it was not already %NULL, * unref the object it previously pointed to. * * This is exactly equivalent to calling tp_clear_pointer() on @op, * with @destroy = g_object_unref(). See tp_clear_pointer() for example usage. * * Since: 0.11.7 */ /** * tp_clear_pointer: (skip) * @pp: a pointer to a variable, struct member etc. holding a pointer * @destroy: a function to which a gpointer can be passed, to destroy *@pp * (if calling this macro from C++, explicitly casting the function to * #GDestroyNotify may be necessary) * * Set a variable holding a pointer to %NULL. If it was not already %NULL, * unref or destroy the object it previously pointed to with @destroy. * * More precisely, if *@pp is non-%NULL, set *@pp to %NULL, then * call @destroy on the object that *@pp previously pointed to. * * This is analogous to g_clear_error() for non-error objects, but also * ensures that @pp is already %NULL before the destructor is run. * * Typical usage is something like this: * * |[ * typedef struct { * TpConnection *conn; * GError *error; * GHashTable *table; * MyStruct *misc; * } Foo; * Foo *foo; * * ... * * tp_clear_object (&foo->conn); * g_clear_error (&foo->error); * tp_clear_boxed (G_TYPE_HASH_TABLE, &foo->table); * tp_clear_pointer (&foo->misc, my_struct_destroy); * ]| * * Since: 0.11.7 */ /** * tp_clear_boxed: (skip) * @gtype: (type GObject.Type): the #GType of *@pp, e.g. %G_TYPE_HASH_TABLE * @pp: a pointer to a variable, struct member etc. holding a boxed object * * Set a variable holding a boxed object to %NULL. If it was not already %NULL, * destroy the boxed object it previously pointed to, as appropriate for * @gtype. * * More precisely, if *@pp is non-%NULL, set *@pp to %NULL, then * call g_boxed_free() on the object that *@pp previously pointed to. * * This is similar to tp_clear_pointer(); see that function's documentation * for typical usage. * * Since: 0.11.7 */ /** * tp_simple_async_report_success_in_idle: * @source: (allow-none): the source object * @callback: (scope async): the callback * @user_data: (closure): user data for @callback * @source_tag: the source tag for the #GSimpleAsyncResult * * Create a new #GSimpleAsyncResult with no operation result, and call * g_simple_async_result_complete_in_idle() on it. * * This is like a successful version of g_simple_async_report_error_in_idle(), * suitable for asynchronous functions that (conceptually) either succeed and * return nothing, or raise an error, such as tp_proxy_prepare_async(). * * The corresponding finish function should not call a function that attempts * to get a result, such as g_simple_async_result_get_op_res_gpointer(). * * Since: 0.11.9 */ void tp_simple_async_report_success_in_idle (GObject *source, GAsyncReadyCallback callback, gpointer user_data, gpointer source_tag) { GSimpleAsyncResult *simple; simple = g_simple_async_result_new (source, callback, user_data, source_tag); g_simple_async_result_complete_in_idle (simple); g_object_unref (simple); } /** * tp_user_action_time_from_x11: * @x11_time: an X11 timestamp, or 0 to indicate the current time * * Convert an X11 timestamp into a user action time as used in Telepathy. * * This also works for the timestamps used by GDK 2, GDK 3 and Clutter 1.0; * it may or may not work with other toolkits or versions. * * Returns: a nonzero Telepathy user action time, or * %TP_USER_ACTION_TIME_CURRENT_TIME * * Since: 0.11.13 */ gint64 tp_user_action_time_from_x11 (guint32 x11_time) { if (x11_time == 0) { return TP_USER_ACTION_TIME_CURRENT_TIME; } return x11_time; } /** * tp_user_action_time_should_present: * @user_action_time: (type gint64): the Telepathy user action time * @x11_time: (out) (allow-none): a pointer to guint32 used to * return an X11 timestamp, or 0 to indicate the current time; if * %FALSE is returned, the value placed here is not meaningful * * Interpret a Telepathy user action time to decide whether a Handler should * attempt to gain focus. If %TRUE is returned, it would be appropriate to * call gtk_window_present_with_time() using @x11_time as input, for instance. * * @x11_time is used to return a timestamp in the right format for X11, * GDK 2, GDK 3 and Clutter 1.0; it may or may not work with other * toolkits or versions. * * Returns: %TRUE if it would be appropriate to present a window * * Since: 0.11.13 */ gboolean tp_user_action_time_should_present (gint64 user_action_time, guint32 *x11_time) { guint32 when = 0; gboolean ret; if (user_action_time > 0 && user_action_time <= G_MAXUINT32) { when = (guint32) user_action_time; ret = TRUE; } else if (user_action_time == TP_USER_ACTION_TIME_CURRENT_TIME) { ret = TRUE; } else { ret = FALSE; } if (ret && x11_time != NULL) *x11_time = when; return ret; } /* Add each of @quarks to @array if it isn't already present. * * There are @n quarks, or if @n == -1, the array is 0-terminated. */ void _tp_quark_array_merge (GArray *array, const GQuark *quarks, gssize n) { gssize i; guint j; g_return_if_fail (array != NULL); g_return_if_fail (g_array_get_element_size (array) == sizeof (GQuark)); g_return_if_fail (n >= -1); g_return_if_fail (n <= 0 || quarks != NULL); if (quarks == NULL || n == 0) return; if (n < 0) { n = 0; for (i = 0; quarks[i] != 0; i++) n++; } else { for (i = 0; i < n; i++) g_return_if_fail (quarks[i] != 0); } if (array->len == 0) { /* fast-path for the common case: there's nothing to merge with */ g_array_append_vals (array, quarks, n); return; } for (i = 0; i < n; i++) { for (j = 0; j < array->len; j++) { if (g_array_index (array, GQuark, j) == quarks[i]) goto next_i; } g_array_append_val (array, quarks[i]); next_i: continue; } } /* Helper to implement functions with 0-terminated list of features in args */ void _tp_quark_array_merge_valist (GArray *array, GQuark feature, va_list var_args) { GArray *features; GQuark f; features = g_array_new (FALSE, FALSE, sizeof (GQuark)); for (f = feature; f != 0; f = va_arg (var_args, GQuark)) g_array_append_val (features, f); _tp_quark_array_merge (array, (GQuark *) features->data, features->len); g_array_unref (features); } #ifdef HAVE_GIO_UNIX GSocketAddress * _tp_create_temp_unix_socket (GSocketService *service, gchar **tmpdir, GError **error) { GSocketAddress *address; gchar *dir = g_dir_make_tmp ("tp-glib-socket.XXXXXX", error); gchar *name; if (dir == NULL) return NULL; if (g_chmod (dir, 0700) != 0) { int e = errno; g_set_error (error, G_IO_ERROR, g_io_error_from_errno (e), "unable to set permissions of %s to 0700: %s", dir, g_strerror (e)); g_free (dir); return NULL; } name = g_build_filename (dir, "s", NULL); address = g_unix_socket_address_new (name); g_free (name); if (!g_socket_listener_add_address (G_SOCKET_LISTENER (service), address, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, NULL, NULL, error)) { g_object_unref (address); g_free (dir); return NULL; } if (tmpdir != NULL) *tmpdir = dir; else g_free (dir); return address; } #endif /* HAVE_GIO_UNIX */ GList * _tp_create_channel_request_list (TpSimpleClientFactory *factory, GHashTable *request_props) { GHashTableIter iter; GList *result = NULL; gpointer key, value; g_hash_table_iter_init (&iter, request_props); while (g_hash_table_iter_next (&iter, &key, &value)) { TpChannelRequest *req; const gchar *path = key; GHashTable *props = value; GError *error = NULL; req = _tp_simple_client_factory_ensure_channel_request (factory, path, props, &error); if (req == NULL) { DEBUG ("Failed to create TpChannelRequest: %s", error->message); g_error_free (error); continue; } result = g_list_prepend (result, req); } return result; } /** * tp_utf8_make_valid: * @name: string to coerce into UTF8 * * Validate that the provided string is valid UTF8. If not, * replace all invalid bytes with unicode replacement * character (U+FFFD). * * This method is a verbatim copy of glib's internal * _g_utf8_make_valid() function, and will be deprecated as * soon as the glib one becomes public. * * Returns: (transfer full): a new valid UTF8 string * * Since: 0.13.15 */ gchar * tp_utf8_make_valid (const gchar *name) { GString *string; const gchar *remainder, *invalid; gint remaining_bytes, valid_bytes; g_return_val_if_fail (name != NULL, NULL); string = NULL; remainder = name; remaining_bytes = strlen (name); while (remaining_bytes != 0) { if (g_utf8_validate (remainder, remaining_bytes, &invalid)) break; valid_bytes = invalid - remainder; if (string == NULL) string = g_string_sized_new (remaining_bytes); g_string_append_len (string, remainder, valid_bytes); /* append U+FFFD REPLACEMENT CHARACTER */ g_string_append (string, "\357\277\275"); remaining_bytes -= valid_bytes + 1; remainder = invalid + 1; } if (string == NULL) return g_strdup (name); g_string_append (string, remainder); g_assert (g_utf8_validate (string->str, -1, NULL)); return g_string_free (string, FALSE); } /* * _tp_enum_from_nick: * @enum_type: the GType of a subtype of GEnum * @nick: a non-%NULL string purporting to be the nickname of a value of * @enum_type * @value: the address at which to store the value of @enum_type corresponding * to @nick if this functions returns %TRUE; if this function returns * %FALSE, this variable will be left untouched. * * * * Returns: %TRUE if @nick is a member of @enum_type, or %FALSE otherwise */ gboolean _tp_enum_from_nick ( GType enum_type, const gchar *nick, gint *value) { GEnumClass *klass = g_type_class_ref (enum_type); GEnumValue *enum_value; g_return_val_if_fail (klass != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); enum_value = g_enum_get_value_by_nick (klass, nick); g_type_class_unref (klass); if (enum_value != NULL) { *value = enum_value->value; return TRUE; } else { return FALSE; } } /* * _tp_enum_to_nick: * @enum_type: the GType of a subtype of GEnum * @value: a value of @enum_type * * * * Returns: the nickname of @value, or %NULL if it is not, in fact, a value of * @enum_type */ const gchar * _tp_enum_to_nick ( GType enum_type, gint value) { GEnumClass *klass = g_type_class_ref (enum_type); GEnumValue *enum_value; g_return_val_if_fail (klass != NULL, NULL); enum_value = g_enum_get_value (klass, value); g_type_class_unref (klass); if (enum_value != NULL) return enum_value->value_nick; else return NULL; } /* * _tp_enum_to_nick_nonnull: * * The same as _tp_enum_to_nick, but always returns non-NULL. */ const gchar * _tp_enum_to_nick_nonnull ( GType enum_type, gint value) { GEnumClass *klass = g_type_class_ref (enum_type); GEnumValue *enum_value; g_return_val_if_fail (klass != NULL, "(incorrect class)"); enum_value = g_enum_get_value (klass, value); g_type_class_unref (klass); if (enum_value == NULL) return "(out-of-range value)"; else if (enum_value->value_nick == NULL) return "(value with no nickname)"; else return enum_value->value_nick; } gboolean _tp_bind_connection_status_to_boolean (GBinding *binding, const GValue *src_value, GValue *dest_value, gpointer user_data) { gboolean invert = GPOINTER_TO_UINT (user_data); gboolean value; g_return_val_if_fail (G_VALUE_HOLDS_UINT (src_value), FALSE); g_return_val_if_fail (G_VALUE_HOLDS_BOOLEAN (dest_value), FALSE); value = (g_value_get_uint (src_value) == TP_CONNECTION_STATUS_CONNECTED); if (invert) value = !value; g_value_set_boolean (dest_value, value); return TRUE; } /* * _tp_determine_socket_address_type: * * Determines the best available socket address type. * */ static gboolean _tp_determine_socket_address_type (GHashTable *supported_sockets, TpSocketAddressType *address_type, GError **error) { guint i; TpSocketAddressType types[] = { #ifdef HAVE_GIO_UNIX TP_SOCKET_ADDRESS_TYPE_UNIX, #endif /* HAVE_GIO_UNIX */ TP_SOCKET_ADDRESS_TYPE_IPV4, TP_SOCKET_ADDRESS_TYPE_IPV6 }; for (i = 0; i < G_N_ELEMENTS (types); i++) { GArray *arr = g_hash_table_lookup (supported_sockets, GUINT_TO_POINTER (types[i])); if (arr != NULL) { *address_type = types[i]; return TRUE; } } /* This should never happen */ g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No supported socket types"); return FALSE; } /* * _tp_determine_access_control_type: * * Determines the best available socket access control type, falling back to * TP_SOCKET_ACCESS_CONTROL_LOCALHOST if needed. * */ static gboolean _tp_determine_access_control_type (GHashTable *supported_sockets, TpSocketAddressType address_type, TpSocketAccessControl *access_control, GError **error) { gboolean support_localhost = FALSE; GArray *arr; guint i; arr = g_hash_table_lookup (supported_sockets, GUINT_TO_POINTER (address_type)); switch (address_type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: case TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX: { /* Preferred order: credentials, localhost */ for (i = 0; i < arr->len; i++) { TpSocketAccessControl _access = g_array_index (arr, TpSocketAccessControl, i); if (_access == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { *access_control = _access; return TRUE; } else if (_access == TP_SOCKET_ACCESS_CONTROL_LOCALHOST) { support_localhost = TRUE; } } } break; #else case TP_SOCKET_ADDRESS_TYPE_UNIX: case TP_SOCKET_ADDRESS_TYPE_ABSTRACT_UNIX: break; #endif case TP_SOCKET_ADDRESS_TYPE_IPV6: case TP_SOCKET_ADDRESS_TYPE_IPV4: { /* Preferred order: port, localhost */ for (i = 0; i < arr->len; i++) { TpSocketAccessControl _access = g_array_index (arr, TpSocketAccessControl, i); if (_access == TP_SOCKET_ACCESS_CONTROL_PORT) { *access_control = _access; return TRUE; } else if (_access == TP_SOCKET_ACCESS_CONTROL_LOCALHOST) { support_localhost = TRUE; } } } break; } /* This should never happen */ if (!support_localhost) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No supported access control"); return FALSE; } *access_control = TP_SOCKET_ACCESS_CONTROL_LOCALHOST; return TRUE; } gboolean _tp_set_socket_address_type_and_access_control_type ( GHashTable *supported_sockets, TpSocketAddressType *address_type, TpSocketAccessControl *access_control, GError **error) { g_return_val_if_fail (address_type != NULL, FALSE); g_return_val_if_fail (access_control != NULL, FALSE); if (!_tp_determine_socket_address_type (supported_sockets, address_type, error)) return FALSE; return _tp_determine_access_control_type (supported_sockets, *address_type, access_control, error); } GSocket * _tp_create_client_socket (TpSocketAddressType socket_type, GError **error) { GSocket *client_socket; GSocketFamily family; switch (socket_type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: family = G_SOCKET_FAMILY_UNIX; break; #endif case TP_SOCKET_ADDRESS_TYPE_IPV4: family = G_SOCKET_FAMILY_IPV4; break; case TP_SOCKET_ADDRESS_TYPE_IPV6: family = G_SOCKET_FAMILY_IPV6; break; default: g_assert_not_reached (); } /* Create socket to connect to the CM. We use a GSocket and not a * GSocketClient because it creates the underlying socket when trying to * connect and we need to be able to get the local port (needed for * TP_SOCKET_ACCESS_CONTROL_PORT) of the socket before actually connecting. */ client_socket = g_socket_new (family, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, error); if (client_socket == NULL) return NULL; if (socket_type == TP_SOCKET_ADDRESS_TYPE_IPV4 || socket_type == TP_SOCKET_ADDRESS_TYPE_IPV6) { /* Bind local address. This is needed to be able to get the local port * of the socket and pass it to the CM when using * TP_SOCKET_ACCESS_CONTROL_PORT. */ GSocketAddress *local_address; GInetAddress *tmp; gboolean success; tmp = g_inet_address_new_any (family); local_address = g_inet_socket_address_new (tmp, 0); success = g_socket_bind (client_socket, local_address, TRUE, error); g_object_unref (tmp); g_object_unref (local_address); if (!success) return NULL; } return client_socket; } gboolean _tp_contacts_to_handles (TpConnection *connection, guint n_contacts, TpContact * const *contacts, GArray **handles) { guint i; g_return_val_if_fail (handles != NULL, FALSE); g_return_val_if_fail (n_contacts > 0, FALSE); *handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), n_contacts); for (i = 0; i < n_contacts; i++) { TpHandle handle; if (!TP_IS_CONTACT (contacts[i]) || tp_contact_get_connection (contacts[i]) != connection) { tp_clear_pointer (handles, g_array_unref); return FALSE; } handle = tp_contact_get_handle (contacts[i]); g_array_append_val (*handles, handle); } return TRUE; } /* table's key can be anything (usually TpHandle) but value must be a * TpContact */ GPtrArray * _tp_contacts_from_values (GHashTable *table) { GPtrArray *contacts; GHashTableIter iter; gpointer value; if (table == NULL) return NULL; contacts = g_ptr_array_new_full (g_hash_table_size (table), g_object_unref); g_hash_table_iter_init (&iter, table); while (g_hash_table_iter_next (&iter, NULL, &value)) { if (value == NULL) continue; g_assert (TP_IS_CONTACT (value)); g_ptr_array_add (contacts, g_object_ref (value)); } return contacts; } /* * @l: (transfer none) (element-type GLib.Object): a list of #GObject or * any subclass * * Returns: (transfer full): a copy of @l */ GList * _tp_object_list_copy (GList *l) { return _tp_g_list_copy_deep (l, (GCopyFunc) g_object_ref, NULL); } /* * @l: (transfer full) (element-type GLib.Object): a list of #GObject or * any subclass * * Unref each item of @l and free the list. * * This function can be cast to #GDestroyNotify. */ void _tp_object_list_free (GList *l) { g_list_free_full (l, g_object_unref); } GList * _tp_g_list_copy_deep (GList *list, GCopyFunc func, gpointer user_data) { GList *ret = NULL; GList *l; ret = g_list_copy (list); if (func != NULL) { for (l = ret; l != NULL; l = l->next) l->data = func (l->data, user_data); } return ret; } /** * tp_value_array_free: * @va: a #GValueArray * * Free @va. This is exactly the same as g_value_array_free(), but does not * provoke deprecation warnings from GLib when used in conjunction with * tp_value_array_build() and tp_value_array_unpack(). * * Since: 0.23.0 */ void (tp_value_array_free) (GValueArray *va) { _tp_value_array_free_inline (va); } telepathy-glib-0.24.2/telepathy-glib/util.h0000644000175000017500000001517714004031760015500 00000000000000/* * util.h - Headers for telepathy-glib utility functions * * Copyright © 2006-2010 Collabora Ltd. * Copyright © 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_UTIL_H__ #define __TP_UTIL_H__ #define __TP_IN_UTIL_H__ #include #include #define tp_verify_statement(R) ((void) G_STATIC_ASSERT_EXPR (R)) #define tp_verify_true(R) (((void) G_STATIC_ASSERT_EXPR (R)), 1) #define tp_verify(R) G_STATIC_ASSERT (R) G_BEGIN_DECLS gboolean tp_g_ptr_array_contains (GPtrArray *haystack, gpointer needle); void tp_g_ptr_array_extend (GPtrArray *target, GPtrArray *source); #ifndef __GI_SCANNER__ /* Functions with _new in their names confuse the g-i scanner, but these * are all (skip)'d anyway. */ GValue *tp_g_value_slice_new (GType type) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_boolean (gboolean b) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_int (gint n) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_int64 (gint64 n) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_byte (guchar n) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_uint (guint n) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_uint64 (guint64 n) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_double (double d) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_string (const gchar *string) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_static_string (const gchar *string) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_take_string (gchar *string) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_boxed (GType type, gconstpointer p) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_static_boxed (GType type, gconstpointer p) G_GNUC_WARN_UNUSED_RESULT; GValue *tp_g_value_slice_new_take_boxed (GType type, gpointer p) G_GNUC_WARN_UNUSED_RESULT; #endif void tp_g_value_slice_free (GValue *value); GValue *tp_g_value_slice_dup (const GValue *value) G_GNUC_WARN_UNUSED_RESULT; void tp_g_hash_table_update (GHashTable *target, GHashTable *source, GBoxedCopyFunc key_dup, GBoxedCopyFunc value_dup); /* See https://bugzilla.gnome.org/show_bug.cgi?id=399880 for glib inclusion */ static inline gboolean tp_str_empty (const gchar *s) { return (s == NULL || s[0] == '\0'); } /* See https://bugzilla.gnome.org/show_bug.cgi?id=685878 for glib inclusion */ gboolean tp_strdiff (const gchar *left, const gchar *right); gpointer tp_mixin_offset_cast (gpointer instance, guint offset); guint tp_mixin_instance_get_offset (gpointer instance, GQuark quark); guint tp_mixin_class_get_offset (gpointer klass, GQuark quark); gchar *tp_escape_as_identifier (const gchar *name) G_GNUC_WARN_UNUSED_RESULT; /* See https://bugzilla.gnome.org/show_bug.cgi?id=685880 for glib inclusion */ gboolean tp_strv_contains (const gchar * const *strv, const gchar *str); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_22_FOR(g_key_file_get_int64) gint64 tp_g_key_file_get_int64 (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error); _TP_DEPRECATED_IN_0_22_FOR(g_key_file_get_uint64) guint64 tp_g_key_file_get_uint64 (GKeyFile *key_file, const gchar *group_name, const gchar *key, GError **error); #endif /* g_signal_connect_object() has been fixed in GLib 2.36, we can deprecate this * once we depend on that version. */ gulong tp_g_signal_connect_object (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer gobject, GConnectFlags connect_flags); GValueArray *tp_value_array_build (gsize length, GType type, ...) G_GNUC_WARN_UNUSED_RESULT; void tp_value_array_unpack (GValueArray *array, gsize len, ...); /* Work around GLib having deprecated something that is part of our API. */ _TP_AVAILABLE_IN_0_24 void tp_value_array_free (GValueArray *va); #if TP_VERSION_MAX_ALLOWED >= TP_VERSION_0_24 #define tp_value_array_free(va) _tp_value_array_free_inline (va) #ifndef __GTK_DOC_IGNORE__ /* gtk-doc can't parse this */ static inline void _tp_value_array_free_inline (GValueArray *va) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_value_array_free (va); G_GNUC_END_IGNORE_DEPRECATIONS } #endif #endif /* See https://bugzilla.gnome.org/show_bug.cgi?id=680813 for glib inclusion */ typedef struct _TpWeakRef TpWeakRef; TpWeakRef *tp_weak_ref_new (gpointer object, gpointer user_data, GDestroyNotify destroy) G_GNUC_WARN_UNUSED_RESULT; gpointer tp_weak_ref_get_user_data (TpWeakRef *self) G_GNUC_WARN_UNUSED_RESULT; gpointer tp_weak_ref_dup_object (TpWeakRef *self) G_GNUC_WARN_UNUSED_RESULT; void tp_weak_ref_destroy (TpWeakRef *self); #define tp_clear_pointer(pp, destroy) \ G_STMT_START \ { \ gpointer _tp_clear_pointer_tmp; \ \ _tp_clear_pointer_tmp = *(pp); \ *(pp) = NULL; \ \ if (_tp_clear_pointer_tmp != NULL) \ (destroy) (_tp_clear_pointer_tmp); \ } \ G_STMT_END #define tp_clear_object(op) tp_clear_pointer ((op), g_object_unref) #define tp_clear_boxed(gtype, pp) \ G_STMT_START \ { \ gpointer _tp_clear_boxed_tmp; \ \ _tp_clear_boxed_tmp = *(pp); \ *(pp) = NULL; \ \ if (_tp_clear_boxed_tmp != NULL) \ g_boxed_free (gtype, _tp_clear_boxed_tmp); \ } \ G_STMT_END void tp_simple_async_report_success_in_idle (GObject *source, GAsyncReadyCallback callback, gpointer user_data, gpointer source_tag); gint64 tp_user_action_time_from_x11 (guint32 x11_time); gboolean tp_user_action_time_should_present (gint64 user_action_time, guint32 *x11_time); /* See https://bugzilla.gnome.org/show_bug.cgi?id=610969 for glib inclusion */ gchar *tp_utf8_make_valid (const gchar *name); G_END_DECLS #undef __TP_IN_UTIL_H__ #endif /* __TP_UTIL_H__ */ telepathy-glib-0.24.2/telepathy-glib/properties-mixin.c0000644000175000017500000007666412652510705020054 00000000000000/* * properties-mixin.c - Source for TpPropertiesMixin * Copyright (C) 2006-2007 Collabora Ltd. * Copyright (C) 2006-2007 Nokia Corporation * @author Ole Andre Vadla Ravnaas * @author Robert McQueen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:properties-mixin * @title: TpPropertiesMixin * @short_description: a mixin implementation of the Telepathy.Properties * interface * @see_also: #TpSvcPropertiesInterface * * This mixin can be added to any GObject class to implement the properties * interface in a general way. * * To use the properties mixin, include a #TpPropertiesMixinClass somewhere * in your class structure and a #TpPropertiesMixin somewhere in your * instance structure, and call tp_properties_mixin_class_init() from your * class_init function, tp_properties_mixin_init() from your init function * or constructor, and tp_properties_mixin_finalize() from your dispose * or finalize function. * * To use the properties mixin as the implementation of * #TpSvcPropertiesInterface, call * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_PROPERTIES_INTERFACE, * tp_properties_mixin_iface_init) in the fourth argument to * G_DEFINE_TYPE_WITH_CODE. */ #include "config.h" #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PROPERTIES #include "debug-internal.h" struct _TpPropertiesContext { TpPropertiesMixinClass *mixin_cls; TpPropertiesMixin *mixin; DBusGMethodInvocation *dbus_ctx; TpIntset *remaining; GValue **values; }; struct _TpPropertiesMixinPrivate { GObject *object; TpPropertiesContext context; }; /* * tp_properties_mixin_class_get_offset_quark: * * Returns: the quark used for storing mixin offset on a GObjectClass */ GQuark tp_properties_mixin_class_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ( "TpPropertiesMixinClassOffsetQuark"); return offset_quark; } /* * tp_properties_mixin_get_offset_quark: * * Returns: the quark used for storing mixin offset on a GObject */ GQuark tp_properties_mixin_get_offset_quark () { static GQuark offset_quark = 0; if (!offset_quark) offset_quark = g_quark_from_static_string ( "TpPropertiesMixinOffsetQuark"); return offset_quark; } /** * tp_properties_mixin_class_init: * @obj_cls: The class of an object that has this mixin * @offset: The offset of the TpPropertiesMixinClass structure in the class * structure * @signatures: An array of property signatures * @num_properties: The number of entries in @signatures * @set_func: Callback used to set the properties * * Initialize the mixin. Should be called from the implementation's * class_init function like so: * * * tp_properties_mixin_class_init ((GObjectClass *) klass, * G_STRUCT_OFFSET (SomeObjectClass, * properties_mixin)); * */ void tp_properties_mixin_class_init (GObjectClass *obj_cls, glong offset, const TpPropertySignature *signatures, guint num_properties, TpPropertiesSetFunc set_func) { TpPropertiesMixinClass *mixin_cls; g_assert (G_IS_OBJECT_CLASS (obj_cls)); g_type_set_qdata (G_OBJECT_CLASS_TYPE (obj_cls), TP_PROPERTIES_MIXIN_CLASS_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin_cls = TP_PROPERTIES_MIXIN_CLASS (obj_cls); mixin_cls->signatures = signatures; mixin_cls->num_props = num_properties; mixin_cls->set_properties = set_func; } /** * tp_properties_mixin_init: * @obj: An object that has this mixin * @offset: The offset of the TpPropertiesMixin structure in the object * structure * * Initialize the mixin. Should be called from the implementation's * instance init function like so: * * * tp_properties_mixin_init ((GObject *) self, * G_STRUCT_OFFSET (SomeObject, properties_mixin), * self->contact_repo); * */ void tp_properties_mixin_init (GObject *obj, glong offset) { TpPropertiesMixinClass *mixin_cls; TpPropertiesMixin *mixin; TpPropertiesContext *ctx; g_assert (G_IS_OBJECT (obj)); g_assert (TP_IS_SVC_PROPERTIES_INTERFACE (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_PROPERTIES_MIXIN_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin = TP_PROPERTIES_MIXIN (obj); mixin_cls = TP_PROPERTIES_MIXIN_CLASS (G_OBJECT_GET_CLASS (obj)); mixin->properties = g_new0 (TpProperty, mixin_cls->num_props); mixin->priv = g_slice_new0 (TpPropertiesMixinPrivate); mixin->priv->object = obj; ctx = &mixin->priv->context; ctx->mixin_cls = mixin_cls; ctx->mixin = mixin; ctx->values = g_new0 (GValue *, mixin_cls->num_props); } /** * tp_properties_mixin_finalize: * @obj: An object that has this mixin * * Free memory used by the TpPropertiesMixin. */ void tp_properties_mixin_finalize (GObject *obj) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); TpPropertiesContext *ctx = &mixin->priv->context; guint i; for (i = 0; i < mixin_cls->num_props; i++) { TpProperty *prop = &mixin->properties[i]; if (prop->value) { g_value_unset (prop->value); g_slice_free (GValue, prop->value); } if (ctx->values[i]) { g_value_unset (ctx->values[i]); } } g_free (ctx->values); g_slice_free (TpPropertiesMixinPrivate, mixin->priv); g_free (mixin->properties); } /** * tp_properties_mixin_list_properties: * @obj: An object with this mixin * @ret: Output parameter which will be set to a GPtrArray of D-Bus structures * if %TRUE is returned * @error: Set to the error if %FALSE is returned * * List all available properties and their flags, as in the ListProperties * D-Bus method. * * Returns: %TRUE on success */ gboolean tp_properties_mixin_list_properties (GObject *obj, GPtrArray **ret, GError **error) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); GType spec_type = TP_STRUCT_TYPE_PROPERTY_SPEC; guint i; *ret = g_ptr_array_sized_new (mixin_cls->num_props); for (i = 0; i < mixin_cls->num_props; i++) { const TpPropertySignature *sig = &mixin_cls->signatures[i]; TpProperty *prop = &mixin->properties[i]; const gchar *dbus_sig; GValue val = { 0, }; switch (sig->type) { case G_TYPE_BOOLEAN: dbus_sig = "b"; break; case G_TYPE_INT: dbus_sig = "i"; break; case G_TYPE_UINT: dbus_sig = "u"; break; case G_TYPE_STRING: dbus_sig = "s"; break; default: g_assert_not_reached (); continue; }; g_value_init (&val, spec_type); g_value_take_boxed (&val, dbus_g_type_specialized_construct (spec_type)); dbus_g_type_struct_set (&val, 0, i, 1, sig->name, 2, dbus_sig, 3, prop->flags, G_MAXUINT); g_ptr_array_add (*ret, g_value_get_boxed (&val)); } return TRUE; } /** * tp_properties_mixin_get_properties: * @obj: An object with this mixin * @properties: an array of integer property IDs * @ret: set to an array of D-Bus structures if %TRUE is returned * @error: Set to the error if %FALSE is returned * * Retrieve the values of the given properties, as in the GetProperties * D-Bus method. * * Returns: %TRUE on success */ gboolean tp_properties_mixin_get_properties (GObject *obj, const GArray *properties, GPtrArray **ret, GError **error) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); GType value_type = TP_STRUCT_TYPE_PROPERTY_VALUE; guint i; /* Check input property identifiers */ for (i = 0; i < properties->len; i++) { guint prop_id = g_array_index (properties, guint, i); /* Valid? */ if (prop_id >= mixin_cls->num_props) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid property identifier %d", prop_id); return FALSE; } /* Permitted? */ if (!tp_properties_mixin_is_readable (obj, prop_id)) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "permission denied for property identifier %d", prop_id); return FALSE; } } /* If we got this far, return the actual values */ *ret = g_ptr_array_sized_new (properties->len); for (i = 0; i < properties->len; i++) { guint prop_id = g_array_index (properties, guint, i); GValue val_struct = { 0, }; /* id/value struct */ g_value_init (&val_struct, value_type); g_value_take_boxed (&val_struct, dbus_g_type_specialized_construct (value_type)); dbus_g_type_struct_set (&val_struct, 0, prop_id, 1, mixin->properties[prop_id].value, G_MAXUINT); g_ptr_array_add (*ret, g_value_get_boxed (&val_struct)); } return TRUE; } /** * tp_properties_mixin_set_properties: * @obj: An object with this mixin * @properties: An array of D-Bus structures containing property ID and value * @context: A D-Bus method invocation context for the SetProperties method * * Start to change properties in response to user request via D-Bus. */ void tp_properties_mixin_set_properties (GObject *obj, const GPtrArray *properties, DBusGMethodInvocation *context) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); TpPropertiesContext *ctx = &mixin->priv->context; GError *error = NULL; GType value_type = TP_STRUCT_TYPE_PROPERTY_VALUE; guint i; /* Is another SetProperties request already in progress? */ if (ctx->dbus_ctx) { error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "A SetProperties request is already in progress"); dbus_g_method_return_error (context, error); g_error_free (error); return; } ctx->dbus_ctx = context; ctx->remaining = tp_intset_new (); error = NULL; if (properties->len == 0) { DEBUG ("immediately returning from SetProperties with 0 properties"); tp_properties_context_return (ctx, NULL); return; } /* Check input property identifiers */ for (i = 0; i < properties->len; i++) { GValue val_struct = { 0, }; guint prop_id; GValue *prop_val; g_value_init (&val_struct, value_type); g_value_set_static_boxed (&val_struct, g_ptr_array_index (properties, i)); dbus_g_type_struct_get (&val_struct, 0, &prop_id, 1, &prop_val, G_MAXUINT); /* Valid? */ if (prop_id >= mixin_cls->num_props) { g_boxed_free (G_TYPE_VALUE, prop_val); error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid property identifier %d", prop_id); goto ERROR; } /* Permitted? */ if (!tp_properties_mixin_is_writable (obj, prop_id)) { g_boxed_free (G_TYPE_VALUE, prop_val); error = g_error_new (TP_ERROR, TP_ERROR_PERMISSION_DENIED, "permission denied for property identifier %d", prop_id); goto ERROR; } /* Compatible type? */ if (!g_value_type_compatible (G_VALUE_TYPE (prop_val), mixin_cls->signatures[prop_id].type)) { g_boxed_free (G_TYPE_VALUE, prop_val); error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "incompatible value type for property " "identifier %d", prop_id); goto ERROR; } /* Store the value in the context */ tp_intset_add (ctx->remaining, prop_id); ctx->values[prop_id] = prop_val; } if (mixin_cls->set_properties) { if (mixin_cls->set_properties (obj, ctx, &error)) return; } else { tp_properties_context_return (ctx, NULL); return; } ERROR: tp_properties_context_return (ctx, error); } /** * tp_properties_mixin_has_property: * @obj: an object with a properties mixin * @name: the string name of the property * @property: either %NULL, or a pointer to a location to receive the property * index * * * * Returns: %TRUE, setting @property, if @obj has a property of that name */ gboolean tp_properties_mixin_has_property (GObject *obj, const gchar *name, guint *property) { TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); guint i; for (i = 0; i < mixin_cls->num_props; i++) { if (!tp_strdiff (mixin_cls->signatures[i].name, name)) { if (property) *property = i; return TRUE; } } return FALSE; } /** * tp_properties_context_has: * @ctx: the properties context representing a SetProperties call * @property: the property ID * * * * Returns: %TRUE if @ctx indicates that @property still needs to be set on * the server. */ gboolean tp_properties_context_has (TpPropertiesContext *ctx, guint property) { g_assert (property < ctx->mixin_cls->num_props); return (tp_intset_is_member (ctx->remaining, property)); } /** * tp_properties_context_has_other_than: * @ctx: the properties context representing a SetProperties call * @property: the property ID * * * * Returns: %TRUE if @ctx has properties other than @property that still * need to be set on the server */ gboolean tp_properties_context_has_other_than (TpPropertiesContext *ctx, guint property) { gboolean has = tp_intset_is_member (ctx->remaining, property); g_assert (property < ctx->mixin_cls->num_props); return (tp_intset_size (ctx->remaining) > (has ? 1 : 0)); } /** * tp_properties_context_get: * @ctx: the properties context representing a SetProperties call * @property: a property ID * * * * Returns: the value to be set on the server for the property @property * in @ctx (whether it has been set already or not) */ const GValue * tp_properties_context_get (TpPropertiesContext *ctx, guint property) { g_assert (property < ctx->mixin_cls->num_props); return ctx->values[property]; } /** * tp_properties_context_get_value_count: * @ctx: the properties context representing a SetProperties call * * * * Returns: the number of properties in @ctx which still need to be set on * the server, or have already been set */ guint tp_properties_context_get_value_count (TpPropertiesContext *ctx) { guint i, n; n = 0; for (i = 0; i < ctx->mixin_cls->num_props; i++) { if (ctx->values[i]) n++; } return n; } /** * tp_properties_context_remove: * @ctx: the properties context representing a SetProperties call * @property: a property ID * * Mark the given property as having been set successfully. */ void tp_properties_context_remove (TpPropertiesContext *ctx, guint property) { g_assert (property < ctx->mixin_cls->num_props); tp_intset_remove (ctx->remaining, property); } /** * tp_properties_context_return: * @ctx: the properties context representing a SetProperties call * @error: If %NULL, return successfully; otherwise return this error * * Commit the property changes and return from the pending D-Bus call. */ void tp_properties_context_return (TpPropertiesContext *ctx, GError *error) { GObject *obj = ctx->mixin->priv->object; TpIntset *changed_props_val, *changed_props_flags; guint i; DEBUG ("%s", (error) ? "failure" : "success"); changed_props_val = tp_intset_sized_new (ctx->mixin_cls->num_props); changed_props_flags = tp_intset_sized_new (ctx->mixin_cls->num_props); for (i = 0; i < ctx->mixin_cls->num_props; i++) { if (ctx->values[i]) { if (!error) { tp_properties_mixin_change_value (obj, i, ctx->values[i], changed_props_val); tp_properties_mixin_change_flags (obj, i, TP_PROPERTY_FLAG_READ, 0, changed_props_flags); } g_value_unset (ctx->values[i]); ctx->values[i] = NULL; } } if (!error) { tp_properties_mixin_emit_changed (obj, changed_props_val); tp_properties_mixin_emit_flags (obj, changed_props_flags); tp_intset_destroy (changed_props_val); tp_intset_destroy (changed_props_flags); dbus_g_method_return (ctx->dbus_ctx); } else { dbus_g_method_return_error (ctx->dbus_ctx, error); g_error_free (error); } ctx->dbus_ctx = NULL; tp_intset_destroy (ctx->remaining); ctx->remaining = NULL; /* The context itself is not freed - it's a static part of the mixin */ } /** * tp_properties_context_return_if_done: * @ctx: the properties context representing a SetProperties call * * Return from the pending D-Bus call if there are no more properties to be * dealt with. * * Returns: %TRUE if we returned from the D-Bus call. */ gboolean tp_properties_context_return_if_done (TpPropertiesContext *ctx) { if (tp_intset_size (ctx->remaining) == 0) { tp_properties_context_return (ctx, NULL); return TRUE; } return FALSE; } #define RPTS_APPEND_FLAG_IF_SET(flag) \ if (flags & flag) \ { \ if (i++ > 0) \ g_string_append (str, "|"); \ g_string_append (str, #flag + 17); \ } static gchar * property_flags_to_string (TpPropertyFlags flags) { gint i = 0; GString *str; str = g_string_new ("["); RPTS_APPEND_FLAG_IF_SET (TP_PROPERTY_FLAG_READ); RPTS_APPEND_FLAG_IF_SET (TP_PROPERTY_FLAG_WRITE); g_string_append (str, "]"); return g_string_free (str, FALSE); } static gboolean values_are_equal (const GValue *v1, const GValue *v2) { GType type = G_VALUE_TYPE (v1); switch (type) { case G_TYPE_BOOLEAN: return (g_value_get_boolean (v1) == g_value_get_boolean (v2)); case G_TYPE_STRING: return !tp_strdiff (g_value_get_string (v1), g_value_get_string (v2)); case G_TYPE_UINT: return (g_value_get_uint (v1) == g_value_get_uint (v2)); case G_TYPE_INT: return (g_value_get_int (v1) == g_value_get_int (v2)); } return FALSE; } /** * tp_properties_mixin_change_value: * @obj: An object with the properties mixin * @prop_id: A property ID on which to act * @new_value: Property value * @props: either %NULL, or a pointer to a TpIntset * * Change the value of the given property ID in response to a server state * change. * * If the old and new values match, nothing happens; no signal is emitted and * @props is ignored. Otherwise, the following applies: * * If @props is %NULL the PropertiesChanged signal is emitted for this one * property. * * Otherwise, the property ID is added to the set; the caller is responsible * for passing the set to tp_properties_mixin_emit_changed() once a batch of * properties have been changed. */ void tp_properties_mixin_change_value (GObject *obj, guint prop_id, const GValue *new_value, TpIntset *props) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); TpProperty *prop; g_assert (prop_id < mixin_cls->num_props); prop = &mixin->properties[prop_id]; if (prop->value) { if (values_are_equal (prop->value, new_value)) return; } else { prop->value = tp_g_value_slice_new (mixin_cls->signatures[prop_id].type); } g_value_copy (new_value, prop->value); if (props) { tp_intset_add (props, prop_id); } else { TpIntset *changed_props = tp_intset_sized_new (prop_id + 1); tp_intset_add (changed_props, prop_id); tp_properties_mixin_emit_changed (obj, changed_props); tp_intset_destroy (changed_props); } } /** * tp_properties_mixin_change_flags: * @obj: An object with the properties mixin * @prop_id: A property ID on which to act * @add: Property flags to be added via bitwise OR * @del: Property flags to be removed via bitwise AND * @props: either %NULL, or a pointer to a TpIntset * * Change the flags for the given property ID in response to a server state * change. * * Flags removed by @del override flags added by @add. This should not be * relied upon. * * If @props is %NULL the PropertyFlagsChanged signal is emitted for this * single property. * * Otherwise, the property ID is added to the set; the caller is responsible * for passing the set to tp_properties_mixin_emit_flags() once a batch of * properties have been changed. */ void tp_properties_mixin_change_flags (GObject *obj, guint prop_id, TpPropertyFlags add, TpPropertyFlags del, TpIntset *props) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); TpProperty *prop; guint prev_flags; g_assert (prop_id < mixin_cls->num_props); prop = &mixin->properties[prop_id]; prev_flags = prop->flags; prop->flags |= add; prop->flags &= ~del; if (prop->flags == prev_flags) return; if (props) { tp_intset_add (props, prop_id); } else { TpIntset *changed_props = tp_intset_sized_new (prop_id + 1); tp_intset_add (changed_props, prop_id); tp_properties_mixin_emit_flags (obj, changed_props); tp_intset_destroy (changed_props); } } /** * tp_properties_mixin_emit_changed: * @obj: an object with the properties mixin * @props: a set of property IDs * * Emit the PropertiesChanged signal to indicate that the values of the * given property IDs have changed; the actual values are automatically * added using their stored values. */ void tp_properties_mixin_emit_changed (GObject *obj, const TpIntset *props) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); GPtrArray *prop_arr; GValue prop_list = { 0, }; TpIntsetFastIter iter; guint len = tp_intset_size (props); guint prop_id; if (len == 0) { return; } prop_arr = g_ptr_array_sized_new (len); DEBUG ("emitting properties changed for propert%s:\n", (len > 1) ? "ies" : "y"); tp_intset_fast_iter_init (&iter, props); while (tp_intset_fast_iter_next (&iter, &prop_id)) { GValue prop_val = { 0, }; g_value_init (&prop_val, TP_STRUCT_TYPE_PROPERTY_VALUE); g_value_take_boxed (&prop_val, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_PROPERTY_VALUE)); dbus_g_type_struct_set (&prop_val, 0, prop_id, 1, mixin->properties[prop_id].value, G_MAXUINT); g_ptr_array_add (prop_arr, g_value_get_boxed (&prop_val)); DEBUG (" %s\n", mixin_cls->signatures[prop_id].name); } tp_svc_properties_interface_emit_properties_changed ( (TpSvcPropertiesInterface *) obj, prop_arr); g_value_init (&prop_list, TP_ARRAY_TYPE_PROPERTY_VALUE_LIST); g_value_take_boxed (&prop_list, prop_arr); g_value_unset (&prop_list); } /** * tp_properties_mixin_emit_flags: * @obj: an object with the properties mixin * @props: a set of property IDs * * Emit the PropertyFlagsChanged signal to indicate that the flags of the * given property IDs have changed; the actual flags are automatically * added using their stored values. */ void tp_properties_mixin_emit_flags (GObject *obj, const TpIntset *props) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); GPtrArray *prop_arr; GValue prop_list = { 0, }; TpIntsetFastIter iter; guint len = tp_intset_size (props); guint prop_id; if (len == 0) { return; } prop_arr = g_ptr_array_sized_new (len); DEBUG ("emitting properties flags changed for propert%s:\n", (len > 1) ? "ies" : "y"); tp_intset_fast_iter_init (&iter, props); while (tp_intset_fast_iter_next (&iter, &prop_id)) { GValue prop_val = { 0, }; guint prop_flags; prop_flags = mixin->properties[prop_id].flags; g_value_init (&prop_val, TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE); g_value_take_boxed (&prop_val, dbus_g_type_specialized_construct (TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE)); dbus_g_type_struct_set (&prop_val, 0, prop_id, 1, prop_flags, G_MAXUINT); g_ptr_array_add (prop_arr, g_value_get_boxed (&prop_val)); if (DEBUGGING) { gchar *str_flags = property_flags_to_string (prop_flags); DEBUG (" %s's flags now: %s\n", mixin_cls->signatures[prop_id].name, str_flags); g_free (str_flags); } } tp_svc_properties_interface_emit_property_flags_changed ( (TpSvcPropertiesInterface *) obj, prop_arr); g_value_init (&prop_list, TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST); g_value_take_boxed (&prop_list, prop_arr); g_value_unset (&prop_list); } /** * tp_properties_mixin_is_readable: * @obj: an object with this mixin * @prop_id: an integer property ID * * * * Returns: %TRUE if the given property has the READ flag */ gboolean tp_properties_mixin_is_readable (GObject *obj, guint prop_id) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); if (prop_id >= mixin_cls->num_props) return FALSE; return ((mixin->properties[prop_id].flags & TP_PROPERTY_FLAG_READ) != 0); } /** * tp_properties_mixin_is_writable: * @obj: an object with this mixin * @prop_id: an integer property ID * * * * Returns: %TRUE if the given property has the WRITE flag */ gboolean tp_properties_mixin_is_writable (GObject *obj, guint prop_id) { TpPropertiesMixin *mixin = TP_PROPERTIES_MIXIN (obj); TpPropertiesMixinClass *mixin_cls = TP_PROPERTIES_MIXIN_CLASS ( G_OBJECT_GET_CLASS (obj)); if (prop_id >= mixin_cls->num_props) return FALSE; return ((mixin->properties[prop_id].flags & TP_PROPERTY_FLAG_WRITE) != 0); } /* * get_properties * * Implements D-Bus method GetProperties * on interface org.freedesktop.Telepathy.Properties * * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this * function returns FALSE. * * Returns: TRUE if successful, FALSE if an error was thrown. */ static void get_properties (TpSvcPropertiesInterface *iface, const GArray *properties, DBusGMethodInvocation *context) { GPtrArray *ret; GError *error = NULL; gboolean ok = tp_properties_mixin_get_properties (G_OBJECT (iface), properties, &ret, &error); if (!ok) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_properties_interface_return_from_get_properties ( context, ret); g_ptr_array_unref (ret); } /* * list_properties * * Implements D-Bus method ListProperties * on interface org.freedesktop.Telepathy.Properties * * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this * function returns false. * * Returns: TRUE if successful, FALSE if an error was thrown. */ static void list_properties (TpSvcPropertiesInterface *iface, DBusGMethodInvocation *context) { GPtrArray *ret; GError *error = NULL; gboolean ok = tp_properties_mixin_list_properties (G_OBJECT (iface), &ret, &error); guint i; if (!ok) { dbus_g_method_return_error (context, error); g_error_free (error); } tp_svc_properties_interface_return_from_list_properties ( context, ret); for (i = 0; i < ret->len; i++) g_boxed_free (TP_STRUCT_TYPE_PROPERTY_SPEC, ret->pdata[i]); g_ptr_array_unref (ret); } /* * set_properties * * Implements D-Bus method SetProperties * on interface org.freedesktop.Telepathy.Properties * * @context: The D-Bus invocation context to use to return values * or throw an error. */ static void set_properties (TpSvcPropertiesInterface *iface, const GPtrArray *properties, DBusGMethodInvocation *context) { tp_properties_mixin_set_properties (G_OBJECT (iface), properties, context); } /** * tp_properties_mixin_iface_init: * @g_iface: A pointer to the #TpSvcPropertiesInterfaceClass in an object class * @iface_data: Ignored * * Fill in this mixin's method implementations in the given interface vtable. * This function should usually be called via G_IMPLEMENT_INTERFACE * inside the G_DEFINE_TYPE_WITH_CODE macro. */ void tp_properties_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcPropertiesInterfaceClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_properties_interface_implement_##x (klass, x) IMPLEMENT(get_properties); IMPLEMENT(list_properties); IMPLEMENT(set_properties); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/properties-mixin.h0000644000175000017500000002255712652510705020051 00000000000000/* * properties-mixin.h - Header for TpPropertiesMixin * Copyright (C) 2006 Collabora Ltd. * Copyright (C) 2006 Nokia Corporation * @author Ole Andre Vadla Ravnaas * @author Robert McQueen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_PROPERTIES_MIXIN_H__ #define __TP_PROPERTIES_MIXIN_H__ #include #include #define _TP_IN_META_HEADER #include #include #include #include #include G_BEGIN_DECLS /** * TpPropertySignature: * @name: Name of the property as seen in the Telepathy D-Bus protocol * @type: GType which the variant value must have. We currently support * only %G_TYPE_UINT, %G_TYPE_INT, %G_TYPE_STRING, %G_TYPE_BOOLEAN, * corresponding to D-Bus signatures 'u', 'i', 's', 'b'. * * Signature of a property in the Telepathy properties interface. */ struct _TpPropertySignature { gchar *name; GType type; }; typedef struct _TpPropertySignature TpPropertySignature; /** * TpProperty: * @value: The value of the property * @flags: #TpPropertyFlags indicating the property's permissions * * Structure representing the current state of a property. */ struct _TpProperty { /* FIXME: if we ever break ABI, make this a (GValue) rather than a * (GValue *) */ GValue *value; guint flags; }; typedef struct _TpProperty TpProperty; /** * TpPropertiesContext: * * Opaque pointer representing an incomplete property-setting operation, used * in the implementation of SetProperties. */ typedef struct _TpPropertiesContext TpPropertiesContext; /** * TpPropertiesSetFunc: * @obj: An object with the properties mixin * @ctx: A properties context * @error: Set to the error if %FALSE is returned * * A callback used to implement the SetProperties D-Bus method by setting * properties in the underlying IM protocol. * * The callback must either: * * * return %FALSE to indicate immediate failure * * call tp_properties_context_return() with an error to indicate failure * * call tp_properties_context_remove() to remove each property from the set * of pending properties, then call tp_properties_context_return_if_done() * or tp_properties_context_return() when all were set * * Returns: %FALSE on immediate failure, %TRUE otherwise */ typedef gboolean (*TpPropertiesSetFunc) (GObject *obj, TpPropertiesContext *ctx, GError **error); typedef struct _TpPropertiesMixinClass TpPropertiesMixinClass; typedef struct _TpPropertiesMixinPrivate TpPropertiesMixinPrivate; typedef struct _TpPropertiesMixin TpPropertiesMixin; /* Doesn't yet exist. For future expansion. */ typedef struct _TpPropertiesMixinClassPrivate TpPropertiesMixinClassPrivate; /** * TpPropertiesMixin: * @properties: Array of property values, of length klass->num_props. * Should be considered read-only. * @priv: Pointer to opaque private data. * * Structure to be placed in a GObject-derived structure containing * instance data for the properties mixin (i.e. the properties). Initialize * it using tp_properties_mixin_init(). */ struct _TpPropertiesMixin { TpProperty *properties; TpPropertiesMixinPrivate *priv; }; /** * TpPropertiesMixinClass: * @signatures: Array of property signatures, as provided via * tp_properties_mixin_class_init(), of length @num_props. * @num_props: Number of properties supported. * @set_properties: Properties setting function, as supplied to * tp_properties_mixin_class_init(). * @priv: Pointer to opaque private data. * * Structure to be placed in a GObjectClass-derived structure containing * settings for the properties mixin. Initialize it using * tp_properties_mixin_class_init(). * * All fields should be considered read-only. */ struct _TpPropertiesMixinClass { const TpPropertySignature *signatures; guint num_props; TpPropertiesSetFunc set_properties; TpPropertiesMixinClassPrivate *priv; }; /* TYPE MACROS */ #define TP_PROPERTIES_MIXIN_CLASS_OFFSET_QUARK \ (tp_properties_mixin_class_get_offset_quark ()) #define TP_PROPERTIES_MIXIN_CLASS_OFFSET(o) \ tp_mixin_class_get_offset (o, TP_PROPERTIES_MIXIN_CLASS_OFFSET_QUARK) #define TP_PROPERTIES_MIXIN_CLASS(o) \ ((TpPropertiesMixinClass *) tp_mixin_offset_cast (o,\ TP_PROPERTIES_MIXIN_CLASS_OFFSET (o))) #define TP_PROPERTIES_MIXIN_OFFSET_QUARK \ (tp_properties_mixin_get_offset_quark ()) #define TP_PROPERTIES_MIXIN_OFFSET(o) \ tp_mixin_instance_get_offset (o, TP_PROPERTIES_MIXIN_OFFSET_QUARK) #define TP_PROPERTIES_MIXIN(o) \ ((TpPropertiesMixin *) tp_mixin_offset_cast (o, \ TP_PROPERTIES_MIXIN_OFFSET (o))) /** * TP_TYPE_PROPERTY_INFO_STRUCT: * * The GType of the structures with D-Bus signature '(ussu)' returned by * ListProperties. * * @Deprecated: Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_SPEC instead. */ #define TP_TYPE_PROPERTY_INFO_STRUCT TP_STRUCT_TYPE_PROPERTY_SPEC /** * TP_TYPE_PROPERTY_INFO_LIST: * * The GType of the return from ListProperties (i.e. a GPtrArray * of structures of type TP_TYPE_PROPERTY_INFO_STRUCT), corresponding to * D-Bus signature 'a(ussu)'. * * @Deprecated: Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_SPEC_LIST instead. */ #define TP_TYPE_PROPERTY_INFO_LIST TP_ARRAY_TYPE_PROPERTY_SPEC_LIST /** * TP_TYPE_PROPERTY_VALUE_STRUCT: * * The GType of the structures with signature '(uv)' returned by * GetProperties and emitted in PropertiesChanged. * * @Deprecated: Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_VALUE instead. */ #define TP_TYPE_PROPERTY_VALUE_STRUCT TP_STRUCT_TYPE_PROPERTY_VALUE /** * TP_TYPE_PROPERTY_VALUE_LIST * * The GType of the return from GetProperties and the parameter to * PropertiesChanged (i.e. a GPtrArray of structures of type * TP_TYPE_PROPERTY_VALUE_STRUCT), corresponding to D-Bus signature 'a(uv)'. * * @Deprecated: Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_VALUE_LIST instead. */ #define TP_TYPE_PROPERTY_VALUE_LIST TP_ARRAY_TYPE_PROPERTY_VALUE_LIST /** * TP_TYPE_PROPERTY_FLAGS_STRUCT: * * The GType of the structures with D-Bus signature '(uu)' emitted in * PropertyFlagsChanged. * * @Deprecated: Since 0.7.0. Use TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE instead. */ #define TP_TYPE_PROPERTY_FLAGS_STRUCT TP_STRUCT_TYPE_PROPERTY_FLAGS_CHANGE /** * TP_TYPE_PROPERTY_FLAGS_LIST * * The GType of the parameter to PropertyFlagsChanged (i.e. a GPtrArray of * structures of type TP_TYPE_PROPERTY_FLAGS_STRUCT), corresponding to * D-Bus signature 'a(uu)'. * * @Deprecated: Since 0.7.0. Use TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST * instead. */ #define TP_TYPE_PROPERTY_FLAGS_LIST TP_ARRAY_TYPE_PROPERTY_FLAGS_CHANGE_LIST GQuark tp_properties_mixin_class_get_offset_quark (void); GQuark tp_properties_mixin_get_offset_quark (void); void tp_properties_mixin_class_init (GObjectClass *obj_cls, glong offset, const TpPropertySignature *signatures, guint num_properties, TpPropertiesSetFunc set_func); void tp_properties_mixin_init (GObject *obj, glong offset); void tp_properties_mixin_finalize (GObject *obj); gboolean tp_properties_mixin_list_properties (GObject *obj, GPtrArray **ret, GError **error); gboolean tp_properties_mixin_get_properties (GObject *obj, const GArray *properties, GPtrArray **ret, GError **error); void tp_properties_mixin_set_properties (GObject *obj, const GPtrArray *properties, DBusGMethodInvocation *context); gboolean tp_properties_mixin_has_property (GObject *obj, const gchar *name, guint *property); gboolean tp_properties_context_has (TpPropertiesContext *ctx, guint property); gboolean tp_properties_context_has_other_than (TpPropertiesContext *ctx, guint property); const GValue *tp_properties_context_get (TpPropertiesContext *ctx, guint property); guint tp_properties_context_get_value_count (TpPropertiesContext *ctx); void tp_properties_context_remove (TpPropertiesContext *ctx, guint property); void tp_properties_context_return (TpPropertiesContext *ctx, GError *error); gboolean tp_properties_context_return_if_done (TpPropertiesContext *ctx); void tp_properties_mixin_change_value (GObject *obj, guint prop_id, const GValue *new_value, TpIntset *props); void tp_properties_mixin_change_flags (GObject *obj, guint prop_id, TpPropertyFlags add, TpPropertyFlags del, TpIntset *props); void tp_properties_mixin_emit_changed (GObject *obj, const TpIntset *props); void tp_properties_mixin_emit_flags (GObject *obj, const TpIntset *props); gboolean tp_properties_mixin_is_readable (GObject *obj, guint prop_id); gboolean tp_properties_mixin_is_writable (GObject *obj, guint prop_id); void tp_properties_mixin_iface_init (gpointer g_iface, gpointer iface_data); G_END_DECLS #endif /* #ifndef __TP_PROPERTIES_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/stream-tube-channel.c0000644000175000017500000012652612652510705020365 00000000000000/* * stream-tube-channel.h - high level API for StreamTube channels * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:stream-tube-channel * @title: TpStreamTubeChannel * @short_description: proxy object for a stream tube channel * * #TpStreamTubeChannel is a sub-class of #TpChannel providing convenient API * to offer and accept a stream tube. * * Since: 0.13.2 */ /** * TpStreamTubeChannel: * * Data structure representing a #TpStreamTubeChannel. * * Since: 0.13.2 */ /** * TpStreamTubeChannelClass: * * The class of a #TpStreamTubeChannel. * * Since: 0.13.2 */ #include "config.h" #include "telepathy-glib/stream-tube-channel.h" #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/channel-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/automatic-client-factory-internal.h" #include #include #ifdef HAVE_GIO_UNIX #include #include #endif /* HAVE_GIO_UNIX */ G_DEFINE_TYPE (TpStreamTubeChannel, tp_stream_tube_channel, TP_TYPE_CHANNEL) /* Used to store the data of a NewRemoteConnection signal while we are waiting * for the TCP connection identified by this signal */ typedef struct { TpHandle handle; GValue *param; guint connection_id; gboolean rejected; } SigWaitingConn; static SigWaitingConn * sig_waiting_conn_new (TpHandle handle, const GValue *param, guint connection_id, gboolean rejected) { SigWaitingConn *ret = g_slice_new0 (SigWaitingConn); ret->handle = handle; ret->param = tp_g_value_slice_dup (param); ret->connection_id = connection_id; ret->rejected = rejected; return ret; } static void sig_waiting_conn_free (SigWaitingConn *sig) { g_assert (sig != NULL); tp_g_value_slice_free (sig->param); g_slice_free (SigWaitingConn, sig); } typedef struct { GSocketConnection *conn; /* Used only with TP_SOCKET_ACCESS_CONTROL_CREDENTIALS to store the byte * read with the credentials. */ guchar byte; } ConnWaitingSig; static ConnWaitingSig * conn_waiting_sig_new (GSocketConnection *conn, guchar byte) { ConnWaitingSig *ret = g_slice_new0 (ConnWaitingSig); ret->conn = g_object_ref (conn); ret->byte = byte; return ret; } static void conn_waiting_sig_free (ConnWaitingSig *c) { g_assert (c != NULL); g_object_unref (c->conn); g_slice_free (ConnWaitingSig, c); } struct _TpStreamTubeChannelPrivate { GHashTable *parameters; /* Offering side */ GSocketService *service; GSocketAddress *address; gchar *unix_tmpdir; /* GSocketConnection we have accepted but are still waiting a * NewRemoteConnection to identify them. Owned ConnWaitingSig. */ GSList *conn_waiting_sig; /* NewRemoteConnection signals we have received but didn't accept their TCP * connection yet. Owned SigWaitingConn. */ GSList *sig_waiting_conn; /* Accepting side */ GSocket *client_socket; /* The access_control_param we passed to Accept */ GValue *access_control_param; /* Connection to the CM while we are waiting for its * ID (NewLocalConnection) */ GSocketConnection *local_conn_waiting_id; /* ID received from NewLocalConnection stored while the connection has not * be connected yet. */ guint local_conn_id; /* TRUE if local_conn_id is meaningfull (0 can be a valid ID so we can't use * it to check if NewLocalConnection has been received :\ ) */ gboolean local_conn_id_set; TpSocketAddressType socket_type; TpSocketAccessControl access_control; GSimpleAsyncResult *result; /* (guint) connection ID => weakly reffed TpStreamTubeConnection */ GHashTable *tube_connections; }; enum { PROP_SERVICE = 1, PROP_PARAMETERS, PROP_PARAMETERS_VARDICT }; enum /* signals */ { INCOMING, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; static void remote_connection_destroyed_cb (gpointer user_data, GObject *conn) { /* The GSocketConnection has been destroyed, removing it from the hash */ TpStreamTubeChannel *self = user_data; GHashTableIter iter; gpointer value; g_hash_table_iter_init (&iter, self->priv->tube_connections); while (g_hash_table_iter_next (&iter, NULL, &value)) { if (value == conn) { g_hash_table_iter_remove (&iter); break; } } } static void tp_stream_tube_channel_dispose (GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; if (self->priv->service != NULL) { g_socket_service_stop (self->priv->service); tp_clear_object (&self->priv->service); } tp_clear_object (&self->priv->result); tp_clear_pointer (&self->priv->parameters, g_hash_table_unref); g_slist_foreach (self->priv->conn_waiting_sig, (GFunc) conn_waiting_sig_free, NULL); tp_clear_pointer (&self->priv->conn_waiting_sig, g_slist_free); g_slist_foreach (self->priv->sig_waiting_conn, (GFunc) sig_waiting_conn_free, NULL); tp_clear_pointer (&self->priv->sig_waiting_conn, g_slist_free); if (self->priv->tube_connections != NULL) { GHashTableIter iter; gpointer conn; g_hash_table_iter_init (&iter, self->priv->tube_connections); while (g_hash_table_iter_next (&iter, NULL, &conn)) { g_object_weak_unref (conn, remote_connection_destroyed_cb, self); } g_hash_table_unref (self->priv->tube_connections); self->priv->tube_connections = NULL; } if (self->priv->address != NULL) { #ifdef HAVE_GIO_UNIX /* check if we need to remove the temporary file we created */ if (G_IS_UNIX_SOCKET_ADDRESS (self->priv->address)) { const gchar *path; path = g_unix_socket_address_get_path ( G_UNIX_SOCKET_ADDRESS (self->priv->address)); g_unlink (path); } #endif /* HAVE_GIO_UNIX */ g_object_unref (self->priv->address); self->priv->address = NULL; } if (self->priv->unix_tmpdir != NULL) { g_rmdir (self->priv->unix_tmpdir); g_free (self->priv->unix_tmpdir); self->priv->unix_tmpdir = NULL; } tp_clear_pointer (&self->priv->access_control_param, tp_g_value_slice_free); tp_clear_object (&self->priv->local_conn_waiting_id); tp_clear_object (&self->priv->client_socket); G_OBJECT_CLASS (tp_stream_tube_channel_parent_class)->dispose (obj); } static void tp_stream_tube_channel_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) object; switch (property_id) { case PROP_SERVICE: g_value_set_string (value, tp_stream_tube_channel_get_service (self)); break; case PROP_PARAMETERS: g_value_set_boxed (value, self->priv->parameters); break; case PROP_PARAMETERS_VARDICT: g_value_take_variant (value, tp_stream_tube_channel_dup_parameters_vardict (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void connection_closed_cb (TpChannel *channel, guint connection_id, const gchar *err, const gchar *message, gpointer user_data, GObject *weak_object) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) weak_object; TpStreamTubeConnection *tube_conn; GError *error = NULL; DEBUG ("Got ConnectionClosed signal on connection %u: %s (%s)", connection_id, err, message); tube_conn = g_hash_table_lookup (self->priv->tube_connections, GUINT_TO_POINTER (connection_id)); if (tube_conn == NULL) { DEBUG ("No connection with ID %u; ignoring", connection_id); return; } tp_proxy_dbus_error_to_gerror (self, err, message, &error); _tp_stream_tube_connection_fire_closed (tube_conn, error); g_error_free (error); } static void tp_stream_tube_channel_constructed (GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; void (*chain_up) (GObject *) = ((GObjectClass *) tp_stream_tube_channel_parent_class)->constructed; TpChannel *chan = (TpChannel *) obj; GHashTable *props; GError *err = NULL; if (chain_up != NULL) chain_up (obj); if (tp_channel_get_channel_type_id (chan) != TP_IFACE_QUARK_CHANNEL_TYPE_STREAM_TUBE) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Channel is not a stream tube" }; DEBUG ("Channel is not a stream tube: %s", tp_channel_get_channel_type ( chan)); tp_proxy_invalidate (TP_PROXY (self), &error); return; } props = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); if (tp_asv_get_string (props, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE) == NULL) { GError error = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "Tube doesn't have StreamTube.Service property" }; DEBUG ("%s", error.message); tp_proxy_invalidate (TP_PROXY (self), &error); return; } /* Tube.Parameters is immutable for incoming tubes. For outgoing ones, * it's defined when offering the tube. */ if (!tp_channel_get_requested (TP_CHANNEL (self))) { GHashTable *params; params = tp_asv_get_boxed (props, TP_PROP_CHANNEL_INTERFACE_TUBE_PARAMETERS, TP_HASH_TYPE_STRING_VARIANT_MAP); if (params == NULL) { DEBUG ("Incoming tube doesn't have Tube.Parameters property"); self->priv->parameters = tp_asv_new (NULL, NULL); } else { self->priv->parameters = g_boxed_copy ( TP_HASH_TYPE_STRING_VARIANT_MAP, params); } } tp_cli_channel_type_stream_tube_connect_to_connection_closed ( TP_CHANNEL (self), connection_closed_cb, NULL, NULL, G_OBJECT (self), &err); if (err != NULL) { DEBUG ("Failed to connect to ConnectionClosed signal: %s", err->message); g_error_free (err); } } static void tp_stream_tube_channel_class_init (TpStreamTubeChannelClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; gobject_class->constructed = tp_stream_tube_channel_constructed; gobject_class->get_property = tp_stream_tube_channel_get_property; gobject_class->dispose = tp_stream_tube_channel_dispose; /** * TpStreamTubeChannel:service: * * A string representing the service name that will be used over the tube. * * Since: 0.13.2 */ param_spec = g_param_spec_string ("service", "Service", "The service of the stream tube", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_SERVICE, param_spec); /** * TpStreamTubeChannel:parameters: * * A string to #GValue #GHashTable representing the parameters of the tube. * * Will be %NULL for outgoing tubes until the tube has been offered. * * In high-level language bindings, use * #TpStreamTubeChannel:parameters-vardict or * tp_stream_tube_channel_dup_parameters_vardict() to get the same * information in a more convenient format. * * Since: 0.13.2 */ param_spec = g_param_spec_boxed ("parameters", "Parameters", "The parameters of the stream tube", TP_HASH_TYPE_STRING_VARIANT_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_PARAMETERS, param_spec); /** * TpStreamTubeChannel:parameters-vardict: * * A %G_VARIANT_TYPE_VARDICT representing the parameters of the tube. * * Will be %NULL for outgoing tubes until the tube has been offered. * * Since: 0.19.10 */ param_spec = g_param_spec_variant ("parameters-vardict", "Parameters", "The parameters of the stream tube", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (gobject_class, PROP_PARAMETERS_VARDICT, param_spec); /** * TpStreamTubeChannel::incoming: * @self: the #TpStreamTubeChannel * @tube_connection: the #TpStreamTubeConnection for the connection * * The ::incoming signal is emitted on offered Tubes when a new incoming * connection is made from a remote user (one accepting the Tube). * * Consumers of this signal must take their own references to * @tube_connection */ _signals[INCOMING] = g_signal_new ("incoming", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, TP_TYPE_STREAM_TUBE_CONNECTION); g_type_class_add_private (gobject_class, sizeof (TpStreamTubeChannelPrivate)); } static void tp_stream_tube_channel_init (TpStreamTubeChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_STREAM_TUBE_CHANNEL, TpStreamTubeChannelPrivate); self->priv->tube_connections = g_hash_table_new (NULL, NULL); } /** * tp_stream_tube_channel_new: * @conn: a #TpConnection; may not be %NULL * @object_path: the object path of the channel; may not be %NULL * @immutable_properties: (transfer none) (element-type utf8 GObject.Value): * the immutable properties of the channel, * as signalled by the NewChannel D-Bus signal or returned by the * CreateChannel and EnsureChannel D-Bus methods: a mapping from * strings (D-Bus interface name + "." + property name) to #GValue instances * @error: used to indicate the error if %NULL is returned * * Creates a new #TpStreamTubeChannel proxy object from the provided path and * properties. Most developers will not need to use this function; use * #TpAutomaticProxyFactory to automatically create #TpStreamTubeChannel proxy * objects. * * Returns: (transfer full): a newly-created #TpStreamTubeChannel proxy * * Since: 0.13.2 * Deprecated: Use tp_simple_client_factory_ensure_channel() instead. */ TpStreamTubeChannel * tp_stream_tube_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { return _tp_stream_tube_channel_new_with_factory (NULL, conn, object_path, immutable_properties, error); } TpStreamTubeChannel * _tp_stream_tube_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error) { TpProxy *conn_proxy = (TpProxy *) conn; g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); g_return_val_if_fail (object_path != NULL, NULL); g_return_val_if_fail (immutable_properties != NULL, NULL); if (!tp_dbus_check_valid_object_path (object_path, error)) return NULL; return g_object_new (TP_TYPE_STREAM_TUBE_CHANNEL, "connection", conn, "dbus-daemon", conn_proxy->dbus_daemon, "bus-name", conn_proxy->bus_name, "object-path", object_path, "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, "channel-properties", immutable_properties, "factory", factory, NULL); } static void operation_failed (TpStreamTubeChannel *self, const GError *error) { g_simple_async_result_set_from_error (self->priv->result, error); g_simple_async_result_complete_in_idle (self->priv->result); tp_clear_object (&self->priv->result); } static void complete_accept_operation (TpStreamTubeChannel *self, TpStreamTubeConnection *tube_conn) { g_simple_async_result_set_op_res_gpointer (self->priv->result, g_object_ref (tube_conn), g_object_unref); g_simple_async_result_complete (self->priv->result); tp_clear_object (&self->priv->result); } static void new_local_connection_with_contact (TpConnection *conn, guint n_contacts, TpContact * const *contacts, guint n_failed, const TpHandle *failed, const GError *in_error, gpointer user_data, GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; TpContact *contact; TpStreamTubeConnection *tube_conn = user_data; if (in_error != NULL) { DEBUG ("Failed to prepare TpContact: %s", in_error->message); return; } if (n_failed > 0) { DEBUG ("Failed to prepare TpContact (InvalidHandle)"); return; } contact = contacts[0]; _tp_stream_tube_connection_set_contact (tube_conn, contact); complete_accept_operation (self, tube_conn); } static void new_local_connection_identified (TpStreamTubeChannel *self, GSocketConnection *conn, guint connection_id) { TpHandle initiator_handle; TpStreamTubeConnection *tube_conn; TpConnection *connection; GArray *features; tube_conn = _tp_stream_tube_connection_new (conn, self); g_hash_table_insert (self->priv->tube_connections, GUINT_TO_POINTER (connection_id), tube_conn); g_object_weak_ref (G_OBJECT (tube_conn), remote_connection_destroyed_cb, self); /* We are accepting a tube so the contact of the connection is the * initiator of the tube */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS initiator_handle = tp_channel_get_initiator_handle (TP_CHANNEL (self)); connection = tp_channel_get_connection (TP_CHANNEL (self)); features = tp_simple_client_factory_dup_contact_features ( tp_proxy_get_factory (connection), connection); /* Pass ownership of tube_conn to the function */ tp_connection_get_contacts_by_handle (connection, 1, &initiator_handle, features->len, (TpContactFeature *) features->data, new_local_connection_with_contact, tube_conn, g_object_unref, G_OBJECT (self)); G_GNUC_END_IGNORE_DEPRECATIONS g_array_unref (features); } #ifdef HAVE_GIO_UNIX static void send_credentials_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpStreamTubeChannel *self = user_data; GError *error = NULL; if (!tp_unix_connection_send_credentials_with_byte_finish ( (GSocketConnection *) source, result, &error)) { DEBUG ("Failed to send credentials: %s", error->message); operation_failed (self, error); g_clear_error (&error); } } #endif static void client_socket_connected (TpStreamTubeChannel *self) { GSocketConnection *conn; conn = g_socket_connection_factory_create_connection ( self->priv->client_socket); g_assert (conn); DEBUG ("Stream Tube socket connected"); #ifdef HAVE_GIO_UNIX if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { guchar byte; byte = g_value_get_uchar (self->priv->access_control_param); tp_unix_connection_send_credentials_with_byte_async (conn, byte, NULL, send_credentials_cb, self); } #endif if (self->priv->local_conn_id_set) { new_local_connection_identified (self, conn, self->priv->local_conn_id); self->priv->local_conn_id_set = FALSE; } else { /* Wait for NewLocalConnection signal */ /* This assume that we never connect more than once. Or at least that we * wait to have identify a connection before making a new connection. */ g_assert (self->priv->local_conn_waiting_id == NULL); self->priv->local_conn_waiting_id = g_object_ref (conn); } g_object_unref (conn); } static gboolean client_socket_cb (GSocket *socket, GIOCondition condition, TpStreamTubeChannel *self) { GError *error = NULL; if (!g_socket_check_connect_result (socket, &error)) { DEBUG ("Failed to connect to socket: %s", error->message); operation_failed (self, error); g_error_free (error); return FALSE; } client_socket_connected (self); return FALSE; } static void new_local_connection_cb (TpChannel *proxy, guint connection_id, gpointer user_data, GObject *weak_object) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) weak_object; if (self->priv->local_conn_waiting_id != NULL) { /* We got the ID of the connection */ new_local_connection_identified (self, self->priv->local_conn_waiting_id, connection_id); tp_clear_object (&self->priv->local_conn_waiting_id); return; } /* Wait that the connection is connected */ self->priv->local_conn_id = connection_id; self->priv->local_conn_id_set = TRUE; } static void _channel_accepted (TpChannel *channel, const GValue *addressv, const GError *in_error, gpointer user_data, GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; GSocketAddress *remote_address; GError *error = NULL; if (in_error != NULL) { DEBUG ("Failed to Accept Stream Tube: %s", in_error->message); operation_failed (self, in_error); return; } tp_cli_channel_type_stream_tube_connect_to_new_local_connection ( TP_CHANNEL (self), new_local_connection_cb, NULL, NULL, G_OBJECT (self), &error); if (error != NULL) { DEBUG ("Failed to connect to NewLocalConnection signal"); operation_failed (self, error); g_error_free (error); return; } remote_address = tp_g_socket_address_from_variant (self->priv->socket_type, addressv, &error); if (error != NULL) { DEBUG ("Failed to convert address: %s", error->message); operation_failed (self, error); g_error_free (error); return; } /* Connect to CM */ g_socket_set_blocking (self->priv->client_socket, FALSE); g_socket_connect (self->priv->client_socket, remote_address, NULL, &error); if (error == NULL) { /* Socket is connected */ client_socket_connected (self); goto out; } else if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PENDING)) { /* We have to wait that the socket is connected */ GSource *source; source = g_socket_create_source (self->priv->client_socket, G_IO_OUT, NULL); g_source_attach (source, g_main_context_get_thread_default ()); g_source_set_callback (source, (GSourceFunc) client_socket_cb, self, NULL); g_error_free (error); g_source_unref (source); } else { DEBUG ("Failed to connect to CM: %s", error->message); operation_failed (self, error); g_error_free (error); } out: g_object_unref (remote_address); } /** * tp_stream_tube_channel_accept_async: * @self: an incoming #TpStreamTubeChannel * @callback: a callback to call when the tube has been accepted * @user_data: data to pass to @callback * * Accept an incoming stream tube. When the tube has been accepted, @callback * will be called. You can then call tp_stream_tube_channel_accept_finish() * to get a #TpStreamTubeConnection connected to the tube. * * Since: 0.13.2 */ void tp_stream_tube_channel_accept_async (TpStreamTubeChannel *self, GAsyncReadyCallback callback, gpointer user_data) { GHashTable *properties; GHashTable *supported_sockets; GError *error = NULL; g_return_if_fail (TP_IS_STREAM_TUBE_CHANNEL (self)); g_return_if_fail (self->priv->result == NULL); if (self->priv->access_control_param != NULL) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Tube has already be accepted"); return; } self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_stream_tube_channel_accept_async); properties = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); supported_sockets = tp_asv_get_boxed (properties, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES, TP_HASH_TYPE_SUPPORTED_SOCKET_MAP); if (!_tp_set_socket_address_type_and_access_control_type (supported_sockets, &self->priv->socket_type, &self->priv->access_control, &error)) { operation_failed (self, error); g_clear_error (&error); return; } DEBUG ("Using socket type %u with access control %u", self->priv->socket_type, self->priv->access_control); self->priv->client_socket = _tp_create_client_socket (self->priv->socket_type, &error); if (error != NULL) { DEBUG ("Failed to create socket: %s", error->message); operation_failed (self, error); g_clear_error (&error); return; } switch (self->priv->access_control) { case TP_SOCKET_ACCESS_CONTROL_LOCALHOST: /* Put a dummy value */ self->priv->access_control_param = tp_g_value_slice_new_uint (0); break; case TP_SOCKET_ACCESS_CONTROL_PORT: { GSocketAddress *addr; guint16 port; addr = g_socket_get_local_address (self->priv->client_socket, &error); if (addr == NULL) { DEBUG ("Failed to get local address of client socket: %s", error->message); operation_failed (self, error); g_error_free (error); return; } port = g_inet_socket_address_get_port (G_INET_SOCKET_ADDRESS (addr)); self->priv->access_control_param = tp_g_value_slice_new_uint (port); g_object_unref (addr); } break; case TP_SOCKET_ACCESS_CONTROL_CREDENTIALS: self->priv->access_control_param = tp_g_value_slice_new_byte ( g_random_int_range (0, G_MAXUINT8)); break; default: g_assert_not_reached (); } /* Call Accept */ tp_cli_channel_type_stream_tube_call_accept (TP_CHANNEL (self), -1, self->priv->socket_type, self->priv->access_control, self->priv->access_control_param, _channel_accepted, NULL, NULL, G_OBJECT (self)); } /** * tp_stream_tube_channel_accept_finish: * @self: a #TpStreamTubeChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes accepting an incoming stream tube. The returned * #TpStreamTubeConnection can then be used to exchange data through the tube. * * Returns: (transfer full): a newly created #TpStreamTubeConnection * * Since: 0.13.2 */ TpStreamTubeConnection * tp_stream_tube_channel_accept_finish (TpStreamTubeChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_return_copy_pointer (self, tp_stream_tube_channel_accept_async, g_object_ref) } static void _new_remote_connection_with_contact (TpConnection *conn, guint n_contacts, TpContact * const *contacts, guint n_failed, const TpHandle *failed, const GError *in_error, gpointer user_data, GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; TpContact *contact; TpStreamTubeConnection *tube_conn = user_data; if (in_error != NULL) { DEBUG ("Failed to prepare TpContact: %s", in_error->message); return; } if (n_failed > 0) { DEBUG ("Failed to prepare TpContact (InvalidHandle)"); return; } contact = contacts[0]; _tp_stream_tube_connection_set_contact (tube_conn, contact); DEBUG ("Accepting incoming GIOStream from %s", tp_contact_get_identifier (contact)); g_signal_emit (self, _signals[INCOMING], 0, tube_conn); /* anyone receiving the signal is required to hold their own reference */ } static gboolean sig_match_conn (TpStreamTubeChannel *self, SigWaitingConn *sig, ConnWaitingSig *c) { if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_PORT) { /* Use the port to identify the connection */ guint port; GSocketAddress *address; GError *error = NULL; address = g_socket_connection_get_remote_address (c->conn, &error); if (address == NULL) { DEBUG ("Failed to get connection address: %s", error->message); g_error_free (error); return FALSE; } dbus_g_type_struct_get (sig->param, 1, &port, G_MAXINT); if (port == g_inet_socket_address_get_port ( G_INET_SOCKET_ADDRESS (address))) { DEBUG ("Identified connection %u using port %u", port, sig->connection_id); g_object_unref (address); return TRUE; } g_object_unref (address); } else if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { guchar byte; byte = g_value_get_uchar (sig->param); return byte == c->byte; } else { DEBUG ("Can't properly identify connection as we are using " "access control %u. Assume it's the head of the list", self->priv->access_control); return TRUE; } return FALSE; } static gboolean can_identify_contact (TpStreamTubeChannel *self) { TpHandleType handle_type; tp_channel_get_handle (TP_CHANNEL (self), &handle_type); /* With contact stream tube, it's always the same contact connecting to the * tube */ if (handle_type == TP_HANDLE_TYPE_CONTACT) return TRUE; /* Room stream tube, we need either the Credentials or Port access control * to properly identify connections. */ if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS || self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_PORT) return TRUE; return FALSE; } static void connection_identified (TpStreamTubeChannel *self, GSocketConnection *conn, TpHandle handle, guint connection_id) { TpStreamTubeConnection *tube_conn; tube_conn = _tp_stream_tube_connection_new (conn, self); g_hash_table_insert (self->priv->tube_connections, GUINT_TO_POINTER (connection_id), tube_conn); g_object_weak_ref (G_OBJECT (tube_conn), remote_connection_destroyed_cb, self); if (can_identify_contact (self)) { TpConnection *connection; GArray *features; connection = tp_channel_get_connection (TP_CHANNEL (self)); features = tp_simple_client_factory_dup_contact_features ( tp_proxy_get_factory (connection), connection); /* Spec does not give the id with the handle */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* Pass the ref on tube_conn to the function */ tp_connection_get_contacts_by_handle (connection, 1, &handle, features->len, (TpContactFeature *) features->data, _new_remote_connection_with_contact, tube_conn, g_object_unref, G_OBJECT (self)); G_GNUC_END_IGNORE_DEPRECATIONS g_array_unref (features); } else { g_signal_emit (self, _signals[INCOMING], 0, tube_conn); g_object_unref (tube_conn); } } static void stream_tube_connection_closed_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GError *error = NULL; if (!g_io_stream_close_finish (G_IO_STREAM (source), result, &error)) { DEBUG ("Failed to close connection: %s", error->message); g_error_free (error); return; } } static void connection_rejected (TpStreamTubeChannel *self, GSocketConnection *conn, TpHandle handle, guint connection_id) { DEBUG ("Reject connection %u with contact %u", connection_id, handle); g_io_stream_close_async (G_IO_STREAM (conn), G_PRIORITY_DEFAULT, NULL, stream_tube_connection_closed_cb, self); } static void _new_remote_connection (TpChannel *channel, guint handle, const GValue *param, guint connection_id, gpointer user_data, GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; GSList *l; ConnWaitingSig *found_conn = NULL; SigWaitingConn *sig; TpHandle chan_handle; TpHandleType handle_type; gboolean rejected = FALSE; chan_handle = tp_channel_get_handle (channel, &handle_type); if (handle_type == TP_HANDLE_TYPE_CONTACT && handle != chan_handle) { DEBUG ("CM claimed that handle %u connected to the stream tube, " "but as a contact stream tube we should only get connection from " "handle %u", handle, chan_handle); rejected = TRUE; } sig = sig_waiting_conn_new (handle, param, connection_id, rejected); for (l = self->priv->conn_waiting_sig; l != NULL && found_conn == NULL; l = g_slist_next (l)) { ConnWaitingSig *conn = l->data; if (sig_match_conn (self, sig, conn)) found_conn = conn; } if (found_conn == NULL) { DEBUG ("Didn't find any connection for %u. Waiting for more", connection_id); /* Pass ownership of sig to the list */ self->priv->sig_waiting_conn = g_slist_append ( self->priv->sig_waiting_conn, sig); return; } /* We found a connection */ self->priv->conn_waiting_sig = g_slist_remove ( self->priv->conn_waiting_sig, found_conn); if (rejected) connection_rejected (self, found_conn->conn, handle, connection_id); else connection_identified (self, found_conn->conn, handle, connection_id); sig_waiting_conn_free (sig); conn_waiting_sig_free (found_conn); } static void _channel_offered (TpChannel *channel, const GError *in_error, gpointer user_data, GObject *obj) { TpStreamTubeChannel *self = (TpStreamTubeChannel *) obj; if (in_error != NULL) { DEBUG ("Failed to Offer Stream Tube: %s", in_error->message); operation_failed (self, in_error); return; } DEBUG ("Stream Tube offered"); g_simple_async_result_complete_in_idle (self->priv->result); tp_clear_object (&self->priv->result); } static void _offer_with_address (TpStreamTubeChannel *self, GHashTable *params) { GValue *addressv = NULL; GError *error = NULL; addressv = tp_address_variant_from_g_socket_address (self->priv->address, &self->priv->socket_type, &error); if (error != NULL) { operation_failed (self, error); g_clear_error (&error); goto finally; } /* Connect the NewRemoteConnection signal */ tp_cli_channel_type_stream_tube_connect_to_new_remote_connection ( TP_CHANNEL (self), _new_remote_connection, NULL, NULL, G_OBJECT (self), &error); if (error != NULL) { operation_failed (self, error); g_clear_error (&error); goto finally; } g_assert (self->priv->parameters == NULL); if (params != NULL) self->priv->parameters = g_hash_table_ref (params); else self->priv->parameters = tp_asv_new (NULL, NULL); g_object_notify (G_OBJECT (self), "parameters"); g_object_notify (G_OBJECT (self), "parameters-vardict"); /* Call Offer */ tp_cli_channel_type_stream_tube_call_offer (TP_CHANNEL (self), -1, self->priv->socket_type, addressv, self->priv->access_control, self->priv->parameters, _channel_offered, NULL, NULL, G_OBJECT (self)); finally: if (addressv != NULL) tp_g_value_slice_free (addressv); } static SigWaitingConn * find_sig_for_conn (TpStreamTubeChannel *self, ConnWaitingSig *c) { GSList *l; for (l = self->priv->sig_waiting_conn; l != NULL; l = g_slist_next (l)) { SigWaitingConn *sig = l->data; if (sig_match_conn (self, sig, c)) return sig; } return NULL; } static void credentials_received (TpStreamTubeChannel *self, GSocketConnection *conn, guchar byte) { SigWaitingConn *sig; ConnWaitingSig *c; c = conn_waiting_sig_new (conn, byte); sig = find_sig_for_conn (self, c); if (sig == NULL) { DEBUG ("Can't identify the connection, wait for NewRemoteConnection sig"); /* Pass ownership to the list */ self->priv->conn_waiting_sig = g_slist_append ( self->priv->conn_waiting_sig, c); return; } /* Connection has been identified */ self->priv->sig_waiting_conn = g_slist_remove (self->priv->sig_waiting_conn, sig); if (sig->rejected) connection_rejected (self, conn, sig->handle, sig->connection_id); else connection_identified (self, conn, sig->handle, sig->connection_id); sig_waiting_conn_free (sig); conn_waiting_sig_free (c); } #ifdef HAVE_GIO_UNIX static void receive_credentials_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpStreamTubeChannel *self = user_data; GSocketConnection *conn = (GSocketConnection *) source; GCredentials *creds; guchar byte; uid_t uid; GError *error = NULL; creds = tp_unix_connection_receive_credentials_with_byte_finish (conn, result, &byte, &error); if (creds == NULL) { DEBUG ("Failed to receive credentials: %s", error->message); g_error_free (error); return; } uid = g_credentials_get_unix_user (creds, &error); if (uid != geteuid ()) { DEBUG ("Wrong credentials received (user: %u)", uid); return; } credentials_received (self, conn, byte); g_object_unref (creds); } #endif static void service_incoming_cb (GSocketService *service, GSocketConnection *conn, GObject *source_object, gpointer user_data) { TpStreamTubeChannel *self = user_data; DEBUG ("New incoming connection"); #ifdef HAVE_GIO_UNIX /* Check the credentials if needed */ if (self->priv->access_control == TP_SOCKET_ACCESS_CONTROL_CREDENTIALS) { tp_unix_connection_receive_credentials_with_byte_async (conn, NULL, receive_credentials_cb, self); return; } #endif credentials_received (self, conn, 0); } /** * tp_stream_tube_channel_offer_async: * @self: an outgoing #TpStreamTubeChannel * @params: (allow-none) (transfer none): parameters of the tube, or %NULL * @callback: a callback to call when the tube has been offered * @user_data: data to pass to @callback * * Offer an outgoing stream tube. When the tube has been offered, @callback * will be called. You can then call tp_stream_tube_channel_offer_finish() * to get the result of the operation. * * You have to connect to the #TpStreamTubeChannel::incoming signal to get a * #TpStreamTubeConnection each time a contact establishes a connection to * the tube. * * Since: 0.13.2 */ void tp_stream_tube_channel_offer_async (TpStreamTubeChannel *self, GHashTable *params, GAsyncReadyCallback callback, gpointer user_data) { GHashTable *properties; GHashTable *supported_sockets; GError *error = NULL; g_return_if_fail (TP_IS_STREAM_TUBE_CHANNEL (self)); g_return_if_fail (self->priv->result == NULL); g_return_if_fail (tp_channel_get_requested (TP_CHANNEL (self))); if (self->priv->service != NULL) { g_critical ("Can't reoffer Tube!"); return; } self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_stream_tube_channel_offer_async); properties = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); supported_sockets = tp_asv_get_boxed (properties, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SUPPORTED_SOCKET_TYPES, TP_HASH_TYPE_SUPPORTED_SOCKET_MAP); if (!_tp_set_socket_address_type_and_access_control_type (supported_sockets, &self->priv->socket_type, &self->priv->access_control, &error)) { operation_failed (self, error); g_clear_error (&error); return; } DEBUG ("Using socket type %u with access control %u", self->priv->socket_type, self->priv->access_control); self->priv->service = g_socket_service_new (); switch (self->priv->socket_type) { #ifdef HAVE_GIO_UNIX case TP_SOCKET_ADDRESS_TYPE_UNIX: { self->priv->address = _tp_create_temp_unix_socket ( self->priv->service, &self->priv->unix_tmpdir, &error); /* check there wasn't an error on the final attempt */ if (self->priv->address == NULL) { operation_failed (self, error); g_clear_error (&error); return; } } break; #endif /* HAVE_GIO_UNIX */ case TP_SOCKET_ADDRESS_TYPE_IPV4: case TP_SOCKET_ADDRESS_TYPE_IPV6: { GInetAddress *localhost; GSocketAddress *in_address; localhost = g_inet_address_new_loopback ( self->priv->socket_type == TP_SOCKET_ADDRESS_TYPE_IPV4 ? G_SOCKET_FAMILY_IPV4 : G_SOCKET_FAMILY_IPV6); in_address = g_inet_socket_address_new (localhost, 0); g_socket_listener_add_address ( G_SOCKET_LISTENER (self->priv->service), in_address, G_SOCKET_TYPE_STREAM, G_SOCKET_PROTOCOL_DEFAULT, NULL, &self->priv->address, &error); g_object_unref (localhost); g_object_unref (in_address); if (error != NULL) { operation_failed (self, error); g_clear_error (&error); return; } break; } default: /* should have already errored */ g_assert_not_reached (); break; } tp_g_signal_connect_object (self->priv->service, "incoming", G_CALLBACK (service_incoming_cb), self, 0); g_socket_service_start (self->priv->service); _offer_with_address (self, params); } /** * tp_stream_tube_channel_offer_finish: * @self: a #TpStreamTubeChannel * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes offering an outgoing stream tube. * * Returns: %TRUE when a Tube has been successfully offered; %FALSE otherwise * * Since: 0.13.2 */ gboolean tp_stream_tube_channel_offer_finish (TpStreamTubeChannel *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_stream_tube_channel_offer_async) } /** * tp_stream_tube_channel_get_service: * @self: a #TpStreamTubeChannel * * Return the #TpStreamTubeChannel:service property * * Returns: (transfer none): the value of #TpStreamTubeChannel:service * * Since: 0.13.2 */ const gchar * tp_stream_tube_channel_get_service (TpStreamTubeChannel *self) { GHashTable *props; props = _tp_channel_get_immutable_properties (TP_CHANNEL (self)); return tp_asv_get_string (props, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE); } /** * tp_stream_tube_channel_get_parameters: (skip) * @self: a #TpStreamTubeChannel * * Return the #TpStreamTubeChannel:parameters property * * Returns: (transfer none) (element-type utf8 GObject.Value): * the value of #TpStreamTubeChannel:parameters * * Since: 0.13.2 */ GHashTable * tp_stream_tube_channel_get_parameters (TpStreamTubeChannel *self) { return self->priv->parameters; } /** * tp_stream_tube_channel_dup_parameters_vardict: * @self: a #TpStreamTubeChannel * * Return the parameters of the dbus-tube channel in a variant of * type %G_VARIANT_TYPE_VARDICT whose keys are strings representing * parameter names and values are variants representing corresponding * parameter values set by the offerer when offering this channel. * * The GVariant returned is %NULL if this is an outgoing tube that has not * yet been offered or the parameters property has not been set. * * Use g_variant_lookup(), g_variant_lookup_value(), or tp_vardict_get_uint32() * and similar functions for convenient access to the values. * * Returns: (transfer full): a new reference to a #GVariant * * Since: 0.19.10 */ GVariant * tp_stream_tube_channel_dup_parameters_vardict (TpStreamTubeChannel *self) { g_return_val_if_fail (TP_IS_STREAM_TUBE_CHANNEL (self), NULL); if (self->priv->parameters == NULL) return NULL; return _tp_asv_to_vardict (self->priv->parameters); } telepathy-glib-0.24.2/telepathy-glib/stream-tube-channel.h0000644000175000017500000000707212652510705020364 00000000000000/* * stream-tube-channel.h - high level API for StreamTube channels * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_STREAM_TUBE_CHANNEL_H__ #define __TP_STREAM_TUBE_CHANNEL_H__ #include G_BEGIN_DECLS /* Forward declaration of a subclass - from stream-tube-connection.h */ typedef struct _TpStreamTubeConnection TpStreamTubeConnection; #define TP_TYPE_STREAM_TUBE_CHANNEL (tp_stream_tube_channel_get_type ()) #define TP_STREAM_TUBE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_STREAM_TUBE_CHANNEL, TpStreamTubeChannel)) #define TP_STREAM_TUBE_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_STREAM_TUBE_CHANNEL, TpStreamTubeChannelClass)) #define TP_IS_STREAM_TUBE_CHANNEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_STREAM_TUBE_CHANNEL)) #define TP_IS_STREAM_TUBE_CHANNEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_STREAM_TUBE_CHANNEL)) #define TP_STREAM_TUBE_CHANNEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_STREAM_TUBE_CHANNEL, TpStreamTubeChannelClass)) typedef struct _TpStreamTubeChannel TpStreamTubeChannel; typedef struct _TpStreamTubeChannelClass TpStreamTubeChannelClass; typedef struct _TpStreamTubeChannelPrivate TpStreamTubeChannelPrivate; struct _TpStreamTubeChannel { /**/ TpChannel parent; TpStreamTubeChannelPrivate *priv; }; struct _TpStreamTubeChannelClass { /**/ TpChannelClass parent_class; GCallback _padding[7]; }; GType tp_stream_tube_channel_get_type (void); _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_channel) TpStreamTubeChannel *tp_stream_tube_channel_new (TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); const gchar * tp_stream_tube_channel_get_service (TpStreamTubeChannel *self); GHashTable * tp_stream_tube_channel_get_parameters (TpStreamTubeChannel *self); _TP_AVAILABLE_IN_0_20 GVariant *tp_stream_tube_channel_dup_parameters_vardict ( TpStreamTubeChannel *self); /* Incoming tube methods */ void tp_stream_tube_channel_accept_async (TpStreamTubeChannel *self, GAsyncReadyCallback callback, gpointer user_data); TpStreamTubeConnection * tp_stream_tube_channel_accept_finish ( TpStreamTubeChannel *self, GAsyncResult *result, GError **error); /* Outgoing tube methods */ void tp_stream_tube_channel_offer_async (TpStreamTubeChannel *self, GHashTable *params, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_stream_tube_channel_offer_finish (TpStreamTubeChannel *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/telepathy-glib.pc.in0000644000175000017500000000056012652510705020213 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: Telepathy-GLib Description: GLib utility library for the Telepathy framework Version: @VERSION@ Requires.private: dbus-1 >= 0.95, dbus-glib-1 >= 0.90, glib-2.0 >= 2.30, gobject-2.0 >= 2.30, gio-2.0 >= 2.30 Libs: -L${libdir} -ltelepathy-glib Cflags: -I${includedir}/telepathy-1.0 telepathy-glib-0.24.2/telepathy-glib/svc-media-interfaces.h0000644000175000017500000000061612652510705020514 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_SVC_MEDIA_INTERFACES_H__ #define __TP_SVC_MEDIA_INTERFACES_H__ #include #include #endif telepathy-glib-0.24.2/telepathy-glib/telepathy-glib-dbus.h0000644000175000017500000000561412652510705020373 00000000000000/* * telepathy-glib-dbus.h - meta-header for all generated code * * Copyright © 2009-2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_GLIB_DBUS_H__ #define __TP_GLIB_DBUS_H__ #include #define _TP_IN_META_HEADER /* common */ #include #include /* client-side */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* service-side */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #undef _TP_IN_META_HEADER #endif /* __TP_GLIB_DBUS_H__ */ telepathy-glib-0.24.2/telepathy-glib/base-connection.c0000644000175000017500000040033012652510705017562 00000000000000/* * base-connection.c - Source for TpBaseConnection * * Copyright © 2005-2010 Collabora Ltd. * Copyright © 2005-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-connection * @title: TpBaseConnection * @short_description: base class for #TpSvcConnection implementations * @see_also: #TpBaseConnectionManager, #TpSvcConnection * * This base class makes it easier to write #TpSvcConnection implementations * by managing connection status, channel factories and handle tracking. * A subclass should often not need to implement any of the Connection * methods itself. * * However, methods may be reimplemented if needed: for instance, Gabble * overrides RequestHandles so it can validate MUC rooms, which must be done * asynchronously. */ /** * TpBaseConnectionProc: * @self: The connection object * * Signature of a virtual method on #TpBaseConnection that takes no * additional parameters and returns nothing. */ /** * TpBaseConnectionStartConnectingImpl: * @self: The connection object * @error: Set to the error if %FALSE is returned * * Signature of an implementation of the start_connecting method * of #TpBaseConnection. * * On entry, the implementation may assume that it is in state NEW. * * If %TRUE is returned, the Connect D-Bus method succeeds; the * implementation must either have already set the status to CONNECTED by * calling tp_base_connection_change_status(), or have arranged for a * status change to either state DISCONNECTED or CONNECTED to be signalled by * calling tp_base_connection_change_status() at some later time. * If the status is still NEW after returning %TRUE, #TpBaseConnection will * automatically change it to CONNECTING for reason REQUESTED. * * If %FALSE is returned, the error will be raised from Connect as an * exception. If the status is not DISCONNECTED after %FALSE is returned, * #TpBaseConnection will automatically change it to DISCONNECTED * with a reason appropriate to the error; NetworkError results in * NETWORK_ERROR, PermissionDenied results in AUTHENTICATION_FAILED, and all * other errors currently result in NONE_SPECIFIED. * * All except the simplest connection managers are expected to implement this * asynchronously, returning %TRUE in most cases and changing the status * to CONNECTED or DISCONNECTED later. * * Returns: %FALSE if failure has already occurred, else %TRUE. */ /** * TpBaseConnectionCreateHandleReposImpl: (skip) * @self: The connection object * @repos: An array of pointers to be filled in; the implementation * may assume all are initially NULL. * * Signature of an implementation of the create_handle_repos method * of #TpBaseConnection. */ /** * TpBaseConnectionCreateChannelFactoriesImpl: * @self: The implementation, a subclass of TpBaseConnection * * Signature of an implementation of the create_channel_factories method * of #TpBaseConnection. * * Returns: (transfer full): a GPtrArray of objects implementing * #TpChannelFactoryIface which, between them, implement all channel types * this Connection supports. */ /** * TpBaseConnectionCreateChannelManagersImpl: * @self: The implementation, a subclass of TpBaseConnection * * Signature of an implementation of the create_channel_managers method * of #TpBaseConnection. * * Returns: (transfer full): a GPtrArray of objects implementing * #TpChannelManager which, between them, implement all channel types this * Connection supports. */ /** * TpBaseConnectionGetUniqueConnectionNameImpl: * @self: The implementation, a subclass of TpBaseConnection * * Signature of the @get_unique_connection_name virtual method * on #TpBaseConnection. * * Returns: (transfer full): a name for this connection which will be unique * within this connection manager process, as a string which the caller must * free with #g_free. */ /** * TpBaseConnectionGetInterfacesImpl: * @self: a #TpBaseConnection * * Signature of an implementation of * #TpBaseConnectionClass.get_interfaces_always_present virtual * function. * * Implementation must first chainup on parent class implementation and then * add extra interfaces into the #GPtrArray. * * |[ * static GPtrArray * * my_connection_get_interfaces_always_present (TpBaseConnection *self) * { * GPtrArray *interfaces; * * interfaces = TP_BASE_CONNECTION_CLASS ( * my_connection_parent_class)->get_interfaces_always_present (self); * * g_ptr_array_add (interfaces, TP_IFACE_BADGERS); * * return interfaces; * } * ]| * * Returns: (transfer container): a #GPtrArray of static strings for D-Bus * interfaces implemented by this client. * * Since: 0.19.4 */ /** * TpBaseConnectionClass: * @parent_class: The superclass' structure * @create_handle_repos: Fill in suitable handle repositories in the * given array for all those handle types this Connection supports. * Must be set by subclasses to a non-%NULL value; the function must create * at least a CONTACT handle repository (failing to do so will cause a crash). * @create_channel_factories: Create an array of channel factories for this * Connection. At least one of this or @create_channel_managers must be set by * subclasses to a non-%NULL value; in new code, setting this to %NULL and * using channel managers exclusively is recommended. * @get_unique_connection_name: Construct a unique name for this connection * (for example using the protocol's format for usernames). If %NULL (the * default), a unique name will be generated. Subclasses should usually * override this to get more obvious names, to aid debugging and prevent * multiple connections to the same account. * @connecting: If set by subclasses, will be called just after the state * changes to CONNECTING. May be %NULL if nothing special needs to happen. * @connected: If set by subclasses, will be called just after the state * changes to CONNECTED. May be %NULL if nothing special needs to happen. * @disconnected: If set by subclasses, will be called just after the state * changes to DISCONNECTED. May be %NULL if nothing special needs to happen. * @shut_down: Called after disconnected() is called, to clean up the * connection. Must start the shutdown process for the underlying * network connection, and arrange for tp_base_connection_finish_shutdown() * to be called after the underlying connection has been closed. May not * be left as %NULL. * @start_connecting: Asynchronously start connecting - called to implement * the Connect D-Bus method. See #TpBaseConnectionStartConnectingImpl for * details. May not be left as %NULL. * @get_interfaces_always_present: Returns a #GPtrArray of extra D-Bus * interfaces which are always implemented by instances of this class, * which may be filled in by subclasses. The default is to list no * additional interfaces. Individual instances may detect which * additional interfaces they support and signal them before going * to state CONNECTED by calling tp_base_connection_add_interfaces(). * @create_channel_managers: Create an array of channel managers for this * Connection. At least one of this or @create_channel_factories must be set * by subclasses to a non-%NULL value. Since: 0.7.15 * * The class of a #TpBaseConnection. Many members are virtual methods etc. * to be filled in in the subclass' class_init function. */ /** * TP_INTERNAL_CONNECTION_STATUS_NEW: (skip) * * A special value for #TpConnectionStatus, used within GLib connection * managers to indicate that the connection is disconnected because * connection has never been attempted (as distinct from disconnected * after connection has started, either by user request or an error). * * Must never be visible on the D-Bus - %TP_CONNECTION_STATUS_DISCONNECTED * is sent instead. */ /** * TpBaseConnection: * * Data structure representing a generic #TpSvcConnection implementation. * * Since 0.19.1, accessing the fields of this structure is deprecated. * Use tp_base_connection_get_bus_name(), tp_base_connection_get_object_path(), * tp_base_connection_get_status(), tp_base_connection_get_self_handle() * instead. */ /** * TpChannelManagerIter: (skip) * * An iterator over the #TpChannelManager objects known to a #TpBaseConnection. * It has no public fields. * * Use tp_base_connection_channel_manager_iter_init() to start iteration and * tp_base_connection_channel_manager_iter_next() to continue. * * Since: 0.7.15 */ /** * TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED: (skip) * @conn: A TpBaseConnection * @context: A DBusGMethodInvocation * * If @conn is not in state #TP_CONNECTION_STATUS_CONNECTED, complete the * D-Bus method invocation @context by raising the Telepathy error * #TP_ERROR_DISCONNECTED, and return from the current function (which * must be void). For use in D-Bus method implementations. */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/variant-util-internal.h" static void conn_iface_init (gpointer, gpointer); static void requests_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TpBaseConnection, tp_base_connection, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION, conn_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_REQUESTS, requests_iface_init)) enum { PROP_PROTOCOL = 1, PROP_SELF_HANDLE, PROP_SELF_ID, PROP_INTERFACES, PROP_DBUS_STATUS, PROP_DBUS_DAEMON, PROP_HAS_IMMORTAL_HANDLES, PROP_ACCOUNT_PATH_SUFFIX, N_PROPS }; /* signal enum */ enum { INVALID_SIGNAL, SHUTDOWN_FINISHED, CLIENTS_INTERESTED, CLIENTS_UNINTERESTED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; typedef struct _ChannelRequest ChannelRequest; typedef enum { METHOD_REQUEST_CHANNEL, METHOD_CREATE_CHANNEL, METHOD_ENSURE_CHANNEL, NUM_METHODS } ChannelRequestMethod; struct _ChannelRequest { DBusGMethodInvocation *context; ChannelRequestMethod method; gchar *channel_type; guint handle_type; guint handle; /* always TRUE for CREATE; always FALSE for ENSURE */ unsigned suppress_handler : 1; /* only meaningful for METHOD_ENSURE_CHANNEL; only true if this is the first * request to be satisfied with a particular channel, and no other request * satisfied by that channel has a different method. */ unsigned yours : 1; }; static ChannelRequest * channel_request_new (DBusGMethodInvocation *context, ChannelRequestMethod method, const char *channel_type, guint handle_type, guint handle, gboolean suppress_handler) { ChannelRequest *ret; g_assert (NULL != context); g_assert (NULL != channel_type); g_assert (method < NUM_METHODS); ret = g_slice_new0 (ChannelRequest); ret->context = context; ret->method = method; ret->channel_type = g_strdup (channel_type); ret->handle_type = handle_type; ret->handle = handle; ret->suppress_handler = suppress_handler; ret->yours = FALSE; DEBUG("New channel request at %p: ctype=%s htype=%d handle=%d suppress=%d", ret, channel_type, handle_type, handle, suppress_handler); return ret; } static void channel_request_free (ChannelRequest *request) { g_assert (NULL == request->context); DEBUG("Freeing channel request at %p: ctype=%s htype=%d handle=%d " "suppress=%d", request, request->channel_type, request->handle_type, request->handle, request->suppress_handler); g_free (request->channel_type); g_slice_free (ChannelRequest, request); } static void channel_request_cancel (gpointer data, gpointer user_data) { ChannelRequest *request = (ChannelRequest *) data; GError error = { TP_ERROR, TP_ERROR_DISCONNECTED, "unable to service this channel request, we're disconnecting!" }; DEBUG ("cancelling request at %p for %s/%u/%u", request, request->channel_type, request->handle_type, request->handle); dbus_g_method_return_error (request->context, &error); request->context = NULL; channel_request_free (request); } struct _TpBaseConnectionPrivate { const gchar *self_id; /* Telepathy properties */ gchar *protocol; /* if TRUE, the object has gone away */ gboolean dispose_has_run; /* array of (TpChannelFactoryIface *) */ GPtrArray *channel_factories; /* array of (TpChannelManager *) */ GPtrArray *channel_managers; /* array of (ChannelRequest *) */ GPtrArray *channel_requests; TpHandleRepoIface *handles[TP_NUM_HANDLE_TYPES]; /* Created in constructed, this is an array of static strings which * represent the interfaces on this connection. * * Note that this is a GArray of gchar*, not a GPtrArray, * so that we can use GArray's convenient auto-null-termination. */ GArray *interfaces; /* Array of DBusGMethodInvocation * representing Disconnect calls. * If NULL and we are in a state != DISCONNECTED, then we have not started * shutting down yet. * If NULL and we are in state DISCONNECTED, then we have finished shutting * down. * If not NULL, we are trying to shut down (and must be in state * DISCONNECTED). */ GPtrArray *disconnect_requests; TpDBusDaemon *bus_proxy; /* TRUE after constructor() returns */ gboolean been_constructed; /* TRUE if on D-Bus */ gboolean been_registered; /* g_strdup (unique name) => gsize total count * * This is derivable from @client_interests: e.g. if * client_interests = { LOCATION => { ":1.23" => 5, ":1.42" => 2 }, * MAIL_NOTIFICATION => { ":1.23" => 1 } } * then it implies * interested_clients = { ":1.23" => 6, ":1.42" => 2 } */ GHashTable *interested_clients; /* GQuark iface => GHashTable { * unique name borrowed from interested_clients => gsize count } */ GHashTable *client_interests; gchar *account_path_suffix; }; static const gchar * const *tp_base_connection_get_interfaces ( TpBaseConnection *self); static gboolean tp_base_connection_ensure_dbus (TpBaseConnection *self, GError **error) { if (self->priv->bus_proxy == NULL) { self->priv->bus_proxy = tp_dbus_daemon_dup (error); if (self->priv->bus_proxy == NULL) return FALSE; } return TRUE; } static void tp_base_connection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseConnection *self = (TpBaseConnection *) object; TpBaseConnectionPrivate *priv = self->priv; switch (property_id) { case PROP_PROTOCOL: g_value_set_string (value, priv->protocol); break; case PROP_SELF_HANDLE: g_value_set_uint (value, self->self_handle); break; case PROP_SELF_ID: g_value_set_string (value, self->priv->self_id); break; case PROP_INTERFACES: g_value_set_boxed (value, tp_base_connection_get_interfaces (self)); break; case PROP_DBUS_STATUS: g_value_set_uint (value, tp_base_connection_get_status (self)); break; case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->bus_proxy); break; case PROP_HAS_IMMORTAL_HANDLES: g_value_set_boolean (value, TRUE); break; case PROP_ACCOUNT_PATH_SUFFIX: g_value_set_string (value, self->priv->account_path_suffix); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_connection_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseConnection *self = (TpBaseConnection *) object; TpBaseConnectionPrivate *priv = self->priv; switch (property_id) { case PROP_PROTOCOL: g_free (priv->protocol); priv->protocol = g_value_dup_string (value); g_assert (priv->protocol != NULL); break; case PROP_SELF_HANDLE: tp_base_connection_set_self_handle (self, g_value_get_uint (value)); break; case PROP_DBUS_DAEMON: { TpDBusDaemon *dbus_daemon = g_value_get_object (value); g_assert (self->priv->bus_proxy == NULL); /* construct-only */ if (dbus_daemon != NULL) self->priv->bus_proxy = g_object_ref (dbus_daemon); } break; case PROP_ACCOUNT_PATH_SUFFIX: g_assert (self->priv->account_path_suffix == NULL); /* construct-only */ self->priv->account_path_suffix = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_connection_interested_name_owner_changed_cb ( TpDBusDaemon *it, const gchar *unique_name, const gchar *new_owner, gpointer user_data); static void tp_base_connection_unregister (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = self->priv; if (priv->bus_proxy != NULL) { GHashTableIter iter; gpointer k; if (priv->been_registered) { tp_dbus_daemon_unregister_object (priv->bus_proxy, self); if (self->bus_name != NULL) tp_dbus_daemon_release_name (priv->bus_proxy, self->bus_name, NULL); priv->been_registered = FALSE; } g_hash_table_iter_init (&iter, self->priv->interested_clients); while (g_hash_table_iter_next (&iter, &k, NULL)) { tp_dbus_daemon_cancel_name_owner_watch (priv->bus_proxy, k, tp_base_connection_interested_name_owner_changed_cb, self); g_hash_table_iter_remove (&iter); } } } static void tp_base_connection_dispose (GObject *object) { TpBaseConnection *self = TP_BASE_CONNECTION (object); TpBaseConnectionPrivate *priv = self->priv; guint i; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; g_assert ((self->status == TP_CONNECTION_STATUS_DISCONNECTED) || (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW)); tp_base_connection_unregister (self); tp_clear_object (&priv->bus_proxy); g_ptr_array_foreach (priv->channel_factories, (GFunc) g_object_unref, NULL); g_ptr_array_unref (priv->channel_factories); priv->channel_factories = NULL; g_ptr_array_foreach (priv->channel_managers, (GFunc) g_object_unref, NULL); g_ptr_array_unref (priv->channel_managers); priv->channel_managers = NULL; if (priv->channel_requests) { g_assert (priv->channel_requests->len == 0); g_ptr_array_unref (priv->channel_requests); priv->channel_requests = NULL; } for (i = 0; i < TP_NUM_HANDLE_TYPES; i++) tp_clear_object (priv->handles + i); if (priv->interfaces) { g_array_unref (priv->interfaces); } if (G_OBJECT_CLASS (tp_base_connection_parent_class)->dispose) G_OBJECT_CLASS (tp_base_connection_parent_class)->dispose (object); } static void tp_base_connection_finalize (GObject *object) { TpBaseConnection *self = TP_BASE_CONNECTION (object); TpBaseConnectionPrivate *priv = self->priv; g_free (priv->protocol); g_free (self->bus_name); g_free (self->object_path); g_hash_table_unref (priv->client_interests); g_hash_table_unref (priv->interested_clients); g_free (priv->account_path_suffix); G_OBJECT_CLASS (tp_base_connection_parent_class)->finalize (object); } /** * exportable_channel_get_old_info: * @channel: a channel * @object_path_out: address at which to store the channel's object path, * which the caller should g_free() * @channel_type_out: address at which to store the channel's type, which the * caller should g_free() * @handle_type_out: address at which to store the channel's associated handle * type * @handle_out: address at which to store the channel's associated * handle, if any. This is a borrowed reference; the caller * does not need to tp_handle_unref() it. * * Given a new-style exportable channel, as used by the Requests interface's * API, fetches the information needed for the old-style ListChannels method * on Connections. */ static void exportable_channel_get_old_info (TpExportableChannel *channel, gchar **object_path_out, gchar **channel_type_out, guint *handle_type_out, guint *handle_out) { gchar *object_path; GHashTable *channel_properties; gboolean valid; g_object_get (channel, "object-path", &object_path, "channel-properties", &channel_properties, NULL); g_assert (object_path != NULL); g_assert (tp_dbus_check_valid_object_path (object_path, NULL)); if (object_path_out != NULL) *object_path_out = object_path; else g_free (object_path); if (channel_type_out != NULL) { *channel_type_out = g_strdup (tp_asv_get_string (channel_properties, TP_PROP_CHANNEL_CHANNEL_TYPE)); g_assert (*channel_type_out != NULL); g_assert (tp_dbus_check_valid_interface_name (*channel_type_out, NULL)); } if (handle_type_out != NULL) { *handle_type_out = tp_asv_get_uint32 (channel_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); g_assert (valid); } if (handle_out != NULL) { *handle_out = tp_asv_get_uint32 (channel_properties, TP_PROP_CHANNEL_TARGET_HANDLE, &valid); g_assert (valid); if (handle_type_out != NULL) { if (*handle_type_out == TP_HANDLE_TYPE_NONE) g_assert (*handle_out == 0); else g_assert (*handle_out != 0); } } g_hash_table_unref (channel_properties); } /* * get_channel_details: * @obj: a channel, which must implement one of #TpExportableChannel and * #TpChannelIface * * Returns: (oa{sv}: o.fd.T.Conn.Iface.Requests.Channel_Details), suitable for * inclusion in the NewChannels signal. */ static GValueArray * get_channel_details (GObject *obj) { GValueArray *structure; GHashTable *table; GValue *value; gchar *object_path; g_object_get (obj, "object-path", &object_path, NULL); g_assert (TP_IS_EXPORTABLE_CHANNEL (obj) || TP_IS_CHANNEL_IFACE (obj)); if (TP_IS_EXPORTABLE_CHANNEL (obj)) { g_object_get (obj, "channel-properties", &table, NULL); } else { table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); value = tp_g_value_slice_new (G_TYPE_UINT); g_object_get_property (obj, "handle", value); g_hash_table_insert (table, TP_PROP_CHANNEL_TARGET_HANDLE, value); value = tp_g_value_slice_new (G_TYPE_UINT); g_object_get_property (obj, "handle-type", value); g_hash_table_insert (table, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, value); value = tp_g_value_slice_new (G_TYPE_STRING); g_object_get_property (obj, "channel-type", value); g_hash_table_insert (table, TP_PROP_CHANNEL_CHANNEL_TYPE, value); } structure = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, object_path, TP_HASH_TYPE_QUALIFIED_PROPERTY_VALUE_MAP, table, G_TYPE_INVALID); g_free (object_path); g_hash_table_unref (table); return structure; } static GPtrArray * find_matching_channel_requests (TpBaseConnection *conn, const gchar *channel_type, guint handle_type, guint handle, ChannelRequest *channel_request, gboolean *suppress_handler) { TpBaseConnectionPrivate *priv = conn->priv; GPtrArray *requests; guint i; requests = g_ptr_array_sized_new (1); if (handle_type == 0) { /* It's an anonymous channel, which can only satisfy the request for * which it was created (or if it's returned as EXISTING, it can only * satisfy the request for which it was returned as EXISTING). */ g_assert (handle == 0); g_assert (channel_request == NULL || tp_g_ptr_array_contains (priv->channel_requests, channel_request)); if (channel_request) { g_ptr_array_add (requests, channel_request); if (suppress_handler && channel_request->suppress_handler) *suppress_handler = TRUE; } /* whether we've put any matches in requests or not */ return requests; } /* for identifiable channels (those which are to a particular handle), * satisfy any queued requests. */ for (i = 0; i < priv->channel_requests->len; i++) { ChannelRequest *request = g_ptr_array_index (priv->channel_requests, i); if (tp_strdiff (request->channel_type, channel_type)) continue; if (handle_type != request->handle_type) continue; if (handle != request->handle) continue; if (request->suppress_handler && suppress_handler) *suppress_handler = TRUE; g_ptr_array_add (requests, request); } /* if this channel was created or returned as a result of a particular * request, that request had better be among the matching ones in the queue */ g_assert (channel_request == NULL || tp_g_ptr_array_contains (requests, channel_request)); return requests; } static void satisfy_request (TpBaseConnection *conn, ChannelRequest *request, GObject *channel, const gchar *object_path) { TpBaseConnectionPrivate *priv = conn->priv; DEBUG ("completing queued request %p with success, " "channel_type=%s, handle_type=%u, " "handle=%u, suppress_handler=%u", request, request->channel_type, request->handle_type, request->handle, request->suppress_handler); switch (request->method) { case METHOD_REQUEST_CHANNEL: tp_svc_connection_return_from_request_channel (request->context, object_path); break; case METHOD_CREATE_CHANNEL: { GHashTable *properties; g_assert (TP_IS_EXPORTABLE_CHANNEL (channel)); g_object_get (channel, "channel-properties", &properties, NULL); tp_svc_connection_interface_requests_return_from_create_channel ( request->context, object_path, properties); g_hash_table_unref (properties); } break; case METHOD_ENSURE_CHANNEL: { GHashTable *properties; g_assert (TP_IS_EXPORTABLE_CHANNEL (channel)); g_object_get (channel, "channel-properties", &properties, NULL); tp_svc_connection_interface_requests_return_from_ensure_channel ( request->context, request->yours, object_path, properties); g_hash_table_unref (properties); } break; default: g_assert_not_reached (); } request->context = NULL; g_ptr_array_remove (priv->channel_requests, request); channel_request_free (request); } static void factory_satisfy_requests (TpBaseConnection *conn, TpChannelFactoryIface *factory, TpChannelIface *chan, ChannelRequest *channel_request, gboolean is_new) { gchar *object_path = NULL, *channel_type = NULL; guint handle_type = 0, handle = 0; gboolean suppress_handler = FALSE; GPtrArray *tmp; guint i; g_object_get (chan, "object-path", &object_path, "channel-type", &channel_type, "handle-type", &handle_type, "handle", &handle, NULL); DEBUG ("called for %s", object_path); tmp = find_matching_channel_requests (conn, channel_type, handle_type, handle, channel_request, &suppress_handler); for (i = 0; i < tmp->len; i++) satisfy_request (conn, g_ptr_array_index (tmp, i), G_OBJECT (chan), object_path); if (is_new) { GPtrArray *array = g_ptr_array_sized_new (1); g_ptr_array_add (array, get_channel_details (G_OBJECT (chan))); tp_svc_connection_interface_requests_emit_new_channels (conn, array); tp_value_array_free (g_ptr_array_index (array, 0)); g_ptr_array_unref (array); tp_svc_connection_emit_new_channel (conn, object_path, channel_type, handle_type, handle, suppress_handler); } g_ptr_array_unref (tmp); g_free (object_path); g_free (channel_type); } static void fail_channel_request (TpBaseConnection *conn, ChannelRequest *request, GError *error) { TpBaseConnectionPrivate *priv = conn->priv; DEBUG ("completing queued request %p with error, channel_type=%s, " "handle_type=%u, handle=%u, suppress_handler=%u", request, request->channel_type, request->handle_type, request->handle, request->suppress_handler); dbus_g_method_return_error (request->context, error); request->context = NULL; g_ptr_array_remove (priv->channel_requests, request); channel_request_free (request); } /* Channel factory signal handlers */ static void factory_channel_closed_cb (GObject *channel, TpBaseConnection *conn) { gchar *object_path; g_object_get (channel, "object-path", &object_path, NULL); tp_svc_connection_interface_requests_emit_channel_closed (conn, object_path); g_free (object_path); } static void factory_new_channel_cb (TpChannelFactoryIface *factory, GObject *chan, ChannelRequest *channel_request, gpointer data) { factory_satisfy_requests (TP_BASE_CONNECTION (data), factory, TP_CHANNEL_IFACE (chan), channel_request, TRUE); g_signal_connect (chan, "closed", (GCallback) factory_channel_closed_cb, data); } static void factory_channel_error_cb (TpChannelFactoryIface *factory, GObject *chan, GError *error, ChannelRequest *channel_request, gpointer data) { TpBaseConnection *conn = TP_BASE_CONNECTION (data); gchar *channel_type = NULL; guint handle_type = 0, handle = 0; GPtrArray *tmp; guint i; DEBUG ("channel_type=%s, handle_type=%u, handle=%u, error_code=%u, " "error_message=\"%s\"", channel_type, handle_type, handle, error->code, error->message); g_object_get (chan, "channel-type", &channel_type, "handle-type", &handle_type, "handle", &handle, NULL); tmp = find_matching_channel_requests (conn, channel_type, handle_type, handle, channel_request, NULL); for (i = 0; i < tmp->len; i++) fail_channel_request (conn, g_ptr_array_index (tmp, i), error); g_ptr_array_unref (tmp); g_free (channel_type); } /* Channel manager signal handlers */ typedef struct { TpBaseConnection *self; /* borrowed TpExportableChannel => itself if suppress_handler, * omitted otherwise */ GHashTable *suppress_handler; } ManagerNewChannelContext; static void manager_new_channel (gpointer key, gpointer value, gpointer data) { TpExportableChannel *channel = TP_EXPORTABLE_CHANNEL (key); GSList *request_tokens = value; ManagerNewChannelContext *context = data; TpBaseConnection *self = TP_BASE_CONNECTION (context->self); gchar *object_path; GSList *iter; gboolean suppress_handler = FALSE; gboolean satisfies_create_channel = FALSE; gboolean satisfies_request_channel = FALSE; ChannelRequest *first_ensure = NULL; g_object_get (channel, "object-path", &object_path, NULL); /* suppress_handler on Connection.NewChannel should be TRUE if: * - any satisfied requests were calls to CreateChannel; or * - at least one satisfied RequestChannel call had suppress_handler=TRUE; * or * - any EnsureChannel call will receive Yours=TRUE (that is, if the * channel satisfies no CreateChannel or RequestChannel calls). * * So, it should be FALSE if: * - all the requests were RequestChannel(..., suppress_handler=FALSE) or * EnsureChannel and there was at least one RequestChannel; or * - no requests were satisfied by the channel. */ for (iter = request_tokens; iter != NULL; iter = iter->next) { ChannelRequest *request = iter->data; switch (request->method) { case METHOD_REQUEST_CHANNEL: satisfies_request_channel = TRUE; if (request->suppress_handler) { suppress_handler = TRUE; goto break_loop_early; } break; case METHOD_CREATE_CHANNEL: satisfies_create_channel = TRUE; goto break_loop_early; break; case METHOD_ENSURE_CHANNEL: if (first_ensure == NULL) first_ensure = request; break; case NUM_METHODS: g_assert_not_reached (); } } break_loop_early: /* put the channel in the suppress_handler hash table if it needs * suppress_handler set when signalling NewChannel */ if (request_tokens != NULL && (satisfies_create_channel || !satisfies_request_channel)) suppress_handler = TRUE; if (suppress_handler) g_hash_table_insert (context->suppress_handler, channel, channel); /* If the only type of request satisfied by this new channel is * EnsureChannel, give exactly one request Yours=True. * If other kinds of requests are involved, don't give anyone Yours=True. */ if (!satisfies_request_channel && !satisfies_create_channel && first_ensure != NULL) { first_ensure->yours = TRUE; } for (iter = request_tokens; iter != NULL; iter = iter->next) { satisfy_request (self, iter->data, G_OBJECT (channel), object_path); } g_free (object_path); } static void manager_new_channels_cb (TpChannelManager *manager, GHashTable *channels, TpBaseConnection *self) { GPtrArray *array; ManagerNewChannelContext context = { self, g_hash_table_new (NULL, NULL) }; GHashTableIter iter; gpointer key, value; g_assert (TP_IS_CHANNEL_MANAGER (manager)); g_assert (TP_IS_BASE_CONNECTION (self)); /* satisfy the RequestChannel/CreateChannel/EnsureChannel calls; as * a side-effect, fill in context.suppress_handler with those channels * that will have to be signalled with suppress_handler = TRUE */ g_hash_table_foreach (channels, manager_new_channel, &context); /* Emit NewChannels */ array = g_ptr_array_sized_new (g_hash_table_size (channels)); g_hash_table_iter_init (&iter, channels); while (g_hash_table_iter_next (&iter, &key, &value)) { g_ptr_array_add (array, get_channel_details (G_OBJECT (key))); } tp_svc_connection_interface_requests_emit_new_channels (self, array); g_ptr_array_foreach (array, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (array); /* Emit NewChannel */ g_hash_table_iter_init (&iter, channels); while (g_hash_table_iter_next (&iter, &key, &value)) { gboolean suppress_handler = ( g_hash_table_lookup (context.suppress_handler, key) != NULL); gchar *object_path, *channel_type; guint handle_type, handle; exportable_channel_get_old_info (TP_EXPORTABLE_CHANNEL (key), &object_path, &channel_type, &handle_type, &handle); tp_svc_connection_emit_new_channel (self, object_path, channel_type, handle_type, handle, suppress_handler); g_free (object_path); g_free (channel_type); } g_hash_table_unref (context.suppress_handler); } static void manager_request_already_satisfied_cb (TpChannelManager *manager, gpointer request_token, TpExportableChannel *channel, TpBaseConnection *self) { gchar *object_path; g_assert (TP_IS_CHANNEL_MANAGER (manager)); g_assert (TP_IS_EXPORTABLE_CHANNEL (channel)); g_assert (TP_IS_BASE_CONNECTION (self)); g_object_get (channel, "object-path", &object_path, NULL); satisfy_request (self, request_token, G_OBJECT (channel), object_path); g_free (object_path); } static void manager_request_failed_cb (TpChannelManager *manager, gpointer request_token, guint domain, gint code, gchar *message, TpBaseConnection *self) { GError error = { domain, code, message }; g_assert (TP_IS_CHANNEL_MANAGER (manager)); g_assert (domain > 0); g_assert (message != NULL); g_assert (TP_IS_BASE_CONNECTION (self)); fail_channel_request (self, request_token, &error); } static void manager_channel_closed_cb (TpChannelManager *manager, const gchar *path, TpBaseConnection *self) { g_assert (TP_IS_CHANNEL_MANAGER (manager)); g_assert (path != NULL); g_assert (TP_IS_BASE_CONNECTION (self)); tp_svc_connection_interface_requests_emit_channel_closed (self, path); } /* * Set the @handle_type'th handle repository, which must be %NULL, to * @handle_repo. This method can only be called from code run during the * constructor(), after handle repository instantiation (in practice, this * means it can only be called from the @create_channel_managers callback). */ void _tp_base_connection_set_handle_repo (TpBaseConnection *self, TpHandleType handle_type, TpHandleRepoIface *handle_repo) { g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (!self->priv->been_constructed); g_return_if_fail (tp_handle_type_is_valid (handle_type, NULL)); g_return_if_fail (self->priv->handles[TP_HANDLE_TYPE_CONTACT] != NULL); g_return_if_fail (self->priv->handles[handle_type] == NULL); g_return_if_fail (TP_IS_HANDLE_REPO_IFACE (handle_repo)); self->priv->handles[handle_type] = g_object_ref (handle_repo); } static void tp_base_connection_create_interfaces_array (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = self->priv; TpBaseConnectionClass *klass = TP_BASE_CONNECTION_GET_CLASS (self); GPtrArray *always; guint i; g_assert (priv->interfaces == NULL); always = klass->get_interfaces_always_present (self); priv->interfaces = g_array_sized_new (TRUE, FALSE, sizeof (gchar *), always->len); for (i = 0; i < always->len; i++) { g_array_append_val (priv->interfaces, g_ptr_array_index (always, i)); } g_ptr_array_unref (always); } static GObject * tp_base_connection_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params) { guint i; TpBaseConnection *self = TP_BASE_CONNECTION ( G_OBJECT_CLASS (tp_base_connection_parent_class)->constructor ( type, n_construct_properties, construct_params)); TpBaseConnectionPrivate *priv = self->priv; TpBaseConnectionClass *cls = TP_BASE_CONNECTION_GET_CLASS (self); g_assert (cls->create_handle_repos != NULL); g_assert (cls->create_channel_factories != NULL || cls->create_channel_managers != NULL); g_assert (cls->shut_down != NULL); g_assert (cls->start_connecting != NULL); /* if we fail to connect to D-Bus here, we'll return an error from * register */ tp_base_connection_ensure_dbus (self, NULL); (cls->create_handle_repos) (self, priv->handles); /* a connection that doesn't support contacts is no use to anyone */ g_assert (priv->handles[TP_HANDLE_TYPE_CONTACT] != NULL); if (cls->create_channel_factories != NULL) priv->channel_factories = cls->create_channel_factories (self); else priv->channel_factories = g_ptr_array_sized_new (0); if (cls->create_channel_managers != NULL) priv->channel_managers = cls->create_channel_managers (self); else priv->channel_managers = g_ptr_array_sized_new (0); for (i = 0; i < priv->channel_factories->len; i++) { GObject *factory = g_ptr_array_index (priv->channel_factories, i); g_signal_connect (factory, "new-channel", G_CALLBACK (factory_new_channel_cb), self); g_signal_connect (factory, "channel-error", G_CALLBACK (factory_channel_error_cb), self); } for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, i)); g_signal_connect (manager, "new-channels", (GCallback) manager_new_channels_cb, self); g_signal_connect (manager, "request-already-satisfied", (GCallback) manager_request_already_satisfied_cb, self); g_signal_connect (manager, "request-failed", (GCallback) manager_request_failed_cb, self); g_signal_connect (manager, "channel-closed", (GCallback) manager_channel_closed_cb, self); } tp_base_connection_create_interfaces_array (self); priv->been_constructed = TRUE; return (GObject *) self; } /** * tp_base_connection_add_possible_client_interest: * @self: a connection * @token: a quark corresponding to a D-Bus interface, or a token * representing part of a D-Bus interface, for which this connection wishes * to be notified when clients register an interest * * Add @token to the set of tokens for which this connection will emit * #TpBaseConnection::clients-interested and * #TpBaseConnection::clients-uninterested. * * This method must be called from the #GObjectClass.constructed or #GObjectClass.constructor callback * (otherwise, it will run too late to be useful). */ void tp_base_connection_add_possible_client_interest (TpBaseConnection *self, GQuark token) { gpointer p = GUINT_TO_POINTER (token); g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW); if (g_hash_table_lookup (self->priv->client_interests, p) == NULL) g_hash_table_insert (self->priv->client_interests, p, g_hash_table_new (g_str_hash, g_str_equal)); } /* D-Bus properties for the Requests interface */ static void factory_get_channel_details_foreach (TpChannelIface *chan, gpointer data) { GPtrArray *details = data; g_ptr_array_add (details, get_channel_details (G_OBJECT (chan))); } static void manager_get_channel_details_foreach (TpExportableChannel *chan, gpointer data) { GPtrArray *details = data; g_ptr_array_add (details, get_channel_details (G_OBJECT (chan))); } static GPtrArray * conn_requests_get_channel_details (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = self->priv; /* guess that each ChannelManager and each ChannelFactory has two * channels, on average */ GPtrArray *details = g_ptr_array_sized_new (priv->channel_managers->len * 2 + priv->channel_factories->len * 2); guint i; G_GNUC_BEGIN_IGNORE_DEPRECATIONS for (i = 0; i < priv->channel_factories->len; i++) { TpChannelFactoryIface *factory = TP_CHANNEL_FACTORY_IFACE ( g_ptr_array_index (priv->channel_factories, i)); tp_channel_factory_iface_foreach (factory, factory_get_channel_details_foreach, details); } G_GNUC_END_IGNORE_DEPRECATIONS for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, i)); tp_channel_manager_foreach_channel (manager, manager_get_channel_details_foreach, details); } return details; } static void get_requestables_foreach (TpChannelManager *manager, GHashTable *fixed_properties, const gchar * const *allowed_properties, gpointer user_data) { GPtrArray *details = user_data; g_ptr_array_add (details, tp_value_array_build (2, TP_HASH_TYPE_CHANNEL_CLASS, fixed_properties, G_TYPE_STRV, allowed_properties, G_TYPE_INVALID)); } static GPtrArray * conn_requests_get_requestables (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = self->priv; /* generously guess that each ChannelManager has about 2 ChannelClasses */ GPtrArray *details = g_ptr_array_sized_new (priv->channel_managers->len * 2); guint i; for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, i)); tp_channel_manager_foreach_channel_class (manager, get_requestables_foreach, details); } return details; } static void conn_requests_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { TpBaseConnection *self = TP_BASE_CONNECTION (object); g_return_if_fail (interface == TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS); if (name == g_quark_from_static_string ("Channels")) { g_value_take_boxed (value, conn_requests_get_channel_details (self)); } else if (name == g_quark_from_static_string ("RequestableChannelClasses")) { g_value_take_boxed (value, conn_requests_get_requestables (self)); } else { g_return_if_reached (); } } static GPtrArray * tp_base_connection_get_interfaces_always_present (TpBaseConnection *self) { GPtrArray *interfaces = g_ptr_array_new (); const gchar **ptr; /* copy the klass->interfaces_always_present property for backwards * compatibility */ for (ptr = TP_BASE_CONNECTION_GET_CLASS (self)->interfaces_always_present; ptr != NULL && *ptr != NULL; ptr++) { g_ptr_array_add (interfaces, (gchar *) *ptr); } return interfaces; } static void tp_base_connection_class_init (TpBaseConnectionClass *klass) { static TpDBusPropertiesMixinPropImpl connection_properties[] = { { "SelfHandle", "self-handle", NULL }, { "SelfID", "self-id", NULL }, { "Status", "dbus-status", NULL }, { "Interfaces", "interfaces", NULL }, { "HasImmortalHandles", "has-immortal-handles", NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl requests_properties[] = { { "Channels", NULL, NULL }, { "RequestableChannelClasses", NULL, NULL }, { NULL } }; GParamSpec *param_spec; GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (TpBaseConnectionPrivate)); object_class->dispose = tp_base_connection_dispose; object_class->finalize = tp_base_connection_finalize; object_class->constructor = tp_base_connection_constructor; object_class->get_property = tp_base_connection_get_property; object_class->set_property = tp_base_connection_set_property; klass->get_interfaces_always_present = tp_base_connection_get_interfaces_always_present; /** * TpBaseConnection:protocol: (skip) * * Identifier used in the Telepathy protocol when this connection's protocol * name is required. */ param_spec = g_param_spec_string ("protocol", "Telepathy identifier for protocol", "Identifier string used when the protocol name is required.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PROTOCOL, param_spec); /** * TpBaseConnection:self-handle: (skip) * * The handle of type %TP_HANDLE_TYPE_CONTACT representing the local user. * Must be set nonzero by the subclass before moving to state CONNECTED. * * Since: 0.7.15 */ param_spec = g_param_spec_uint ("self-handle", "Connection.SelfHandle", "The handle of type %TP_HANDLE_TYPE_CONTACT representing the local user.", 0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SELF_HANDLE, param_spec); /** * TpBaseConnection:self-id: (skip) * * The identifier representing the local user. This is the result of * inspecting #TpBaseConnection:self-handle. * * Since: 0.21.2 */ param_spec = g_param_spec_string ("self-id", "Connection.SelfID", "The identifier representing the local user.", "", G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SELF_ID, param_spec); /** * TpBaseConnection:interfaces: (skip) * * The set of D-Bus interfaces available on this Connection, other than * Connection itself. * * Since: 0.11.3 */ param_spec = g_param_spec_boxed ("interfaces", "Connection.Interfaces", "The set of D-Bus interfaces available on this Connection, other than " "Connection itself", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); /** * TpBaseConnection:dbus-status: (skip) * * The Connection.Status as visible on D-Bus, which is the same as * #TpBaseConnection.status except that * %TP_INTERNAL_CONNECTION_STATUS_NEW is replaced by * %TP_CONNECTION_STATUS_DISCONNECTED. * * The #GObject::notify signal is not currently emitted for this property. * * Since: 0.11.3 */ param_spec = g_param_spec_uint ("dbus-status", "Connection.Status", "The connection status as visible on D-Bus", TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_DISCONNECTED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_STATUS, param_spec); /** * TpBaseConnection:dbus-daemon: (skip) * * #TpDBusDaemon object encapsulating this object's connection to D-Bus. * Read-only except during construction. * * If this property is %NULL or omitted during construction, the object will * automatically attempt to connect to the starter or session bus with * tp_dbus_daemon_dup() just after it is constructed; if this fails, this * property will remain %NULL, and tp_base_connection_register() will fail. * * Since: 0.11.3 */ g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "D-Bus daemon", "The D-Bus daemon used by this object", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpBaseConnection:has-immortal-handles: * * This property is not useful to use directly. Its value is %TRUE, to * indicate that this version of telepathy-glib never unreferences handles * until the connection becomes disconnected. * * Since: 0.13.8 */ param_spec = g_param_spec_boolean ("has-immortal-handles", "Connection.HasImmortalHandles", "Always TRUE", TRUE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HAS_IMMORTAL_HANDLES, param_spec); /** * TpBaseConnection:account-path-suffix: * * The suffix of the account object path such as * "gabble/jabber/chris_40example_2ecom0" for the account whose object path is * %TP_ACCOUNT_OBJECT_PATH_BASE + "gabble/jabber/chris_40example_2ecom0". * The same as returned by tp_account_get_path_suffix(). * * It is given by the AccountManager in the connection parameters. Or %NULL if * the ConnectionManager or the AccountManager are too old. * * Since: 0.23.2 */ param_spec = g_param_spec_string ("account-path-suffix", "Account path suffix", "The suffix of the account path", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT_PATH_SUFFIX, param_spec); /* signal definitions */ /** * TpBaseConnection::shutdown-finished: (skip) * @connection: the #TpBaseConnection * * Emitted by tp_base_connection_finish_shutdown() when the underlying * network connection has been closed; #TpBaseConnectionManager listens * for this signal and removes connections from its table of active * connections when it is received. */ signals[SHUTDOWN_FINISHED] = g_signal_new ("shutdown-finished", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); /** * TpBaseConnection::clients-interested: * @connection: the #TpBaseConnection * @token: the interface or part of an interface in which clients are newly * interested * * Emitted when a client becomes interested in any token that was added with * tp_base_connection_add_possible_client_interest(). * * The "signal detail" is a GQuark representing @token. Modules implementing * an interface (Location, say) should typically connect to a detailed signal * like * "clients-interested::org.freedesktop.Telepathy.Connection.Interface.Location" * rather than receiving all emissions of this signal. */ signals[CLIENTS_INTERESTED] = g_signal_new ("clients-interested", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); /** * TpBaseConnection::clients-uninterested: * @connection: the #TpBaseConnection * @token: the interface or part of an interface in which clients are no * longer interested * * Emitted when no more clients are interested in an interface added with * tp_base_connection_add_possible_client_interest(), for which * #TpBaseConnection::clients-interested was previously emitted. * * As with #TpBaseConnection::clients-interested, the "signal detail" is a * GQuark representing @token. Modules implementing an interface (Location, * say) should typically connect to a detailed signal like * "clients-uninterested::org.freedesktop.Telepathy.Connection.Interface.Location" * rather than receiving all emissions of this signal. */ signals[CLIENTS_UNINTERESTED] = g_signal_new ("clients-uninterested", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); tp_dbus_properties_mixin_class_init (object_class, 0); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CONNECTION, tp_dbus_properties_mixin_getter_gobject_properties, NULL, connection_properties); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS, conn_requests_get_dbus_property, NULL, requests_properties); } static void tp_base_connection_init (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CONNECTION, TpBaseConnectionPrivate); guint i; self->priv = priv; self->status = TP_INTERNAL_CONNECTION_STATUS_NEW; for (i = 0; i < TP_NUM_HANDLE_TYPES; i++) { priv->handles[i] = NULL; } priv->channel_requests = g_ptr_array_new (); priv->client_interests = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_unref); priv->interested_clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); } static gchar * squash_name (const gchar *name, guint length) { GChecksum *checksum; gchar *squashed; g_assert (length >= 10); checksum = g_checksum_new (G_CHECKSUM_MD5); g_checksum_update (checksum, (guchar *) name, -1); squashed = g_strdup_printf ( "%.*s_%.8s", length - 9, name, g_checksum_get_string (checksum)); g_checksum_free (checksum); return squashed; } /** * tp_base_connection_register: * @self: A connection * @cm_name: The name of the connection manager in the Telepathy protocol * @bus_name: (out): Used to return the bus name corresponding to the connection * if %TRUE is returned. To be freed by the caller. * @object_path: (out): Used to return the object path of the connection if * %TRUE is returned. To be freed by the caller. * @error: Used to return an error if %FALSE is returned; may be %NULL * * Make the connection object appear on the bus, returning the bus * name and object path used. If %TRUE is returned, the connection owns the * bus name, and will release it when destroyed. * * Since 0.11.11, @bus_name and @object_path may be %NULL if the * strings are not needed. * * Returns: %TRUE on success, %FALSE on error. */ gboolean tp_base_connection_register (TpBaseConnection *self, const gchar *cm_name, gchar **bus_name, gchar **object_path, GError **error) { TpBaseConnectionClass *cls = TP_BASE_CONNECTION_GET_CLASS (self); TpBaseConnectionPrivate *priv = self->priv; gchar *tmp; gchar *safe_proto; gchar *unique_name; guint prefix_length; const guint dbus_max_name_length = 255; g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), FALSE); g_return_val_if_fail (cm_name != NULL, FALSE); g_return_val_if_fail (!self->priv->been_registered, FALSE); if (tp_connection_manager_check_valid_protocol_name (priv->protocol, NULL)) { safe_proto = g_strdelimit (g_strdup (priv->protocol), "-", '_'); } else { WARNING ("Protocol name %s is not valid - should match " "[A-Za-z][A-Za-z0-9-]+", priv->protocol); safe_proto = tp_escape_as_identifier (priv->protocol); } /* Plus two for the dots. */ prefix_length = strlen (TP_CONN_BUS_NAME_BASE) + strlen (cm_name) + strlen (safe_proto) + 2; if (cls->get_unique_connection_name) { tmp = cls->get_unique_connection_name (self); g_assert (tmp != NULL); unique_name = tp_escape_as_identifier (tmp); g_free (tmp); if (prefix_length + strlen (unique_name) > dbus_max_name_length) { /* Is prefix is too long to make reasonable bus name? Ten = one * character of the original unique name plus underscore plus * 8-character hash. */ if (prefix_length >= dbus_max_name_length - 10) { WARNING ( "Couldn't fit CM name + protocol name + unique name into " "255 characters."); g_free (unique_name); return FALSE; } tmp = unique_name; unique_name = squash_name ( tmp, dbus_max_name_length - prefix_length); g_free (tmp); } } else { unique_name = g_strdup_printf ("_%p", self); } if (!tp_base_connection_ensure_dbus (self, error)) { g_free (safe_proto); g_free (unique_name); return FALSE; } self->bus_name = g_strdup_printf (TP_CONN_BUS_NAME_BASE "%s.%s.%s", cm_name, safe_proto, unique_name); g_assert (strlen (self->bus_name) <= 255); self->object_path = g_strdup_printf (TP_CONN_OBJECT_PATH_BASE "%s/%s/%s", cm_name, safe_proto, unique_name); g_free (safe_proto); g_free (unique_name); if (!tp_dbus_daemon_request_name (priv->bus_proxy, self->bus_name, FALSE, error)) { g_free (self->bus_name); self->bus_name = NULL; return FALSE; } DEBUG ("%p: bus name %s; object path %s", self, self->bus_name, self->object_path); tp_dbus_daemon_register_object (priv->bus_proxy, self->object_path, self); self->priv->been_registered = TRUE; if (bus_name != NULL) *bus_name = g_strdup (self->bus_name); if (object_path != NULL) *object_path = g_strdup (self->object_path); return TRUE; } static void tp_base_connection_close_all_channels (TpBaseConnection *self) { TpBaseConnectionPrivate *priv = self->priv; /* We deliberately don't iterate over channel managers here - * they don't need this, and are expected to listen to * TpSvcConnection::status-changed on the connection for themselves. */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* trigger close_all on all channel factories */ g_ptr_array_foreach (priv->channel_factories, (GFunc) tp_channel_factory_iface_close_all, NULL); G_GNUC_END_IGNORE_DEPRECATIONS } /* D-Bus methods on Connection interface ----------------------------*/ static inline TpConnectionStatusReason conn_status_reason_from_g_error (GError *error) { if (error->domain == TP_ERROR) { switch (error->code) { #define OBVIOUS_MAPPING(x) \ case TP_ERROR_ ## x: \ return TP_CONNECTION_STATUS_REASON_ ## x OBVIOUS_MAPPING (NETWORK_ERROR); OBVIOUS_MAPPING (ENCRYPTION_ERROR); OBVIOUS_MAPPING (AUTHENTICATION_FAILED); OBVIOUS_MAPPING (CERT_NOT_PROVIDED); OBVIOUS_MAPPING (CERT_UNTRUSTED); OBVIOUS_MAPPING (CERT_EXPIRED); OBVIOUS_MAPPING (CERT_NOT_ACTIVATED); OBVIOUS_MAPPING (CERT_FINGERPRINT_MISMATCH); OBVIOUS_MAPPING (CERT_HOSTNAME_MISMATCH); OBVIOUS_MAPPING (CERT_SELF_SIGNED); #undef OBVIOUS_MAPPING case TP_ERROR_PERMISSION_DENIED: case TP_ERROR_DOES_NOT_EXIST: return TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED; case TP_ERROR_CERT_INVALID: return TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR; case TP_ERROR_CANCELLED: return TP_CONNECTION_STATUS_REASON_REQUESTED; case TP_ERROR_ENCRYPTION_NOT_AVAILABLE: return TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR; case TP_ERROR_REGISTRATION_EXISTS: case TP_ERROR_ALREADY_CONNECTED: case TP_ERROR_CONNECTION_REPLACED: return TP_CONNECTION_STATUS_REASON_NAME_IN_USE; case TP_ERROR_CONNECTION_REFUSED: case TP_ERROR_CONNECTION_FAILED: case TP_ERROR_CONNECTION_LOST: case TP_ERROR_SERVICE_BUSY: return TP_CONNECTION_STATUS_REASON_NETWORK_ERROR; /* current status: all TP_ERRORs up to and including * TP_ERROR_RESOURCE_UNAVAILABLE have been looked at */ } } return TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED; } static void tp_base_connection_connect (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionClass *cls = TP_BASE_CONNECTION_GET_CLASS (self); GError *error = NULL; g_assert (TP_IS_BASE_CONNECTION (self)); if (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW) { if (cls->start_connecting (self, &error)) { if (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW) { tp_base_connection_change_status (self, TP_CONNECTION_STATUS_CONNECTING, TP_CONNECTION_STATUS_REASON_REQUESTED); } } else { if (self->status != TP_CONNECTION_STATUS_DISCONNECTED) { tp_base_connection_change_status (self, TP_CONNECTION_STATUS_DISCONNECTED, conn_status_reason_from_g_error (error)); } dbus_g_method_return_error (context, error); g_error_free (error); return; } } tp_svc_connection_return_from_connect (context); } static void tp_base_connection_disconnect (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); g_assert (TP_IS_BASE_CONNECTION (self)); if (self->priv->disconnect_requests != NULL) { g_assert (self->status == TP_CONNECTION_STATUS_DISCONNECTED); g_ptr_array_add (self->priv->disconnect_requests, context); return; } if (self->status == TP_CONNECTION_STATUS_DISCONNECTED) { /* status DISCONNECTED and disconnect_requests NULL => already dead */ tp_svc_connection_return_from_disconnect (context); return; } self->priv->disconnect_requests = g_ptr_array_sized_new (1); g_ptr_array_add (self->priv->disconnect_requests, context); tp_base_connection_change_status (self, TP_CONNECTION_STATUS_DISCONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); } static const gchar * const * tp_base_connection_get_interfaces (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); return (const gchar * const *)(self->priv->interfaces->data); } static void tp_base_connection_dbus_get_interfaces (TpSvcConnection *iface, DBusGMethodInvocation *context) { tp_svc_connection_return_from_get_interfaces (context, (const gchar **) tp_base_connection_get_interfaces ( (TpBaseConnection *) iface)); } static void tp_base_connection_get_protocol (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv; g_assert (TP_IS_BASE_CONNECTION (self)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); priv = self->priv; tp_svc_connection_return_from_get_protocol (context, priv->protocol); } static void tp_base_connection_dbus_get_self_handle (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); g_assert (TP_IS_BASE_CONNECTION (self)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); tp_svc_connection_return_from_get_self_handle ( context, self->self_handle); } /** * tp_base_connection_get_status: * @self: the connection * * Return the status of this connection, as set by * tp_base_connection_change_status() or similar functions like * tp_base_connection_disconnect_with_dbus_error(). * * Like the corresponding D-Bus property, this method returns * %TP_CONNECTION_STATUS_DISCONNECTED in two situations: * either the connection is newly-created (and has never emitted * #TpSvcConnection::status-changed), or D-Bus clients have already been * told that it has been destroyed (by the Disconnect D-Bus method, * a failed attempt to connect, or loss of an established connection). * Use tp_base_connection_is_destroyed() to distinguish between the two. * * Returns: the value of #TpBaseConnection:dbus-status * Since: 0.19.1 */ TpConnectionStatus tp_base_connection_get_status (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), TP_CONNECTION_STATUS_DISCONNECTED); if (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW) { return TP_CONNECTION_STATUS_DISCONNECTED; } else { return self->status; } } /** * tp_base_connection_is_destroyed: * @self: the connection * * Return whether this connection has already emitted the D-Bus signal * indicating that it has been destroyed. * * In particular, this can be used to distinguish between the two reasons * why tp_base_connection_get_status() would return * %TP_CONNECTION_STATUS_DISCONNECTED: it will return %FALSE if the * connection is newly-created, and %TRUE if the Disconnect D-Bus method * has been called, an attempt to connect has failed, or an established * connection has encountered an error. * * Returns: %TRUE if this connection is disappearing from D-Bus * Since: 0.19.1 */ gboolean tp_base_connection_is_destroyed (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), TRUE); /* in particular return FALSE if the status is NEW */ return (self->status == TP_CONNECTION_STATUS_DISCONNECTED); } /** * tp_base_connection_check_connected: * @self: the connection * @error: used to raise %TP_ERROR_DISCONNECTED if %FALSE is returned * * Return whether this connection is fully active and connected. * If it is not, raise %TP_ERROR_DISCONNECTED. * * This is equivalent to checking whether tp_base_connection_get_status() * returns %TP_CONNECTION_STATUS_CONNECTED; it is provided because methods * on the connection often need to make this check, and return a * #GError if it fails. * * Returns: %TRUE if this connection is connected * Since: 0.19.1 */ gboolean tp_base_connection_check_connected (TpBaseConnection *self, GError **error) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), FALSE); if (self->status == TP_CONNECTION_STATUS_CONNECTED) return TRUE; g_set_error_literal (error, TP_ERROR, TP_ERROR_DISCONNECTED, "Connection is disconnected"); return FALSE; } static void tp_base_connection_dbus_get_status (TpSvcConnection *iface, DBusGMethodInvocation *context) { tp_svc_connection_return_from_get_status ( context, tp_base_connection_get_status ( (TpBaseConnection *) iface)); } static void tp_base_connection_hold_handles (TpSvcConnection *iface, guint handle_type, const GArray *handles, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv; GError *error = NULL; g_assert (TP_IS_BASE_CONNECTION (self)); priv = self->priv; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); if (!tp_handles_supported_and_valid (priv->handles, handle_type, handles, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_connection_return_from_hold_handles (context); } static void tp_base_connection_inspect_handles (TpSvcConnection *iface, guint handle_type, const GArray *handles, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv = self->priv; GError *error = NULL; const gchar **ret; guint i; g_assert (TP_IS_BASE_CONNECTION (self)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); if (!tp_handles_supported_and_valid (priv->handles, handle_type, handles, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } ret = g_new (const gchar *, handles->len + 1); for (i = 0; i < handles->len; i++) { TpHandle handle; const gchar *tmp; handle = g_array_index (handles, TpHandle, i); tmp = tp_handle_inspect (priv->handles[handle_type], handle); g_assert (tmp != NULL); ret[i] = tmp; } ret[i] = NULL; tp_svc_connection_return_from_inspect_handles (context, ret); g_free (ret); } /* * list_channel_factory_foreach_one: * @chan: a channel * @data: a GPtrArray in which channel information should be stored * * Called by the exported ListChannels function for each channel in a channel * factory, this should add to the GPtrArray (in the data pointer) a * GValueArray containing the following: * a D-Bus object path for the channel object on this service * a D-Bus interface name representing the channel type * an integer representing the handle type this channel communicates with, * or zero * an integer handle representing the contact, room or list this channel * communicates with, or zero */ static void list_channel_factory_foreach_one (TpChannelIface *chan, gpointer data) { GObject *channel = G_OBJECT (chan); GPtrArray *values = (GPtrArray *) data; gchar *path, *type; guint handle_type, handle; GValue *entry = tp_dbus_specialized_value_slice_new (TP_STRUCT_TYPE_CHANNEL_INFO); g_object_get (channel, "object-path", &path, "channel-type", &type, "handle-type", &handle_type, "handle", &handle, NULL); dbus_g_type_struct_set (entry, 0, path, 1, type, 2, handle_type, 3, handle, G_MAXUINT); g_ptr_array_add (values, entry); g_free (path); g_free (type); } /* * list_channel_manager_foreach_one: * @chan: a channel * @data: a GPtrArray in which channel information should be stored * * Called by the exported ListChannels function for each channel in a channel * manager, this should add to the GPtrArray (in the data pointer) a * GValueArray containing the following: * a D-Bus object path for the channel object on this service * a D-Bus interface name representing the channel type * an integer representing the handle type this channel communicates with, * or zero * an integer handle representing the contact, room or list this channel * communicates with, or zero */ static void list_channel_manager_foreach_one (TpExportableChannel *channel, gpointer data) { GPtrArray *values = (GPtrArray *) data; gchar *path, *type; guint handle_type, handle; GValue *entry = tp_dbus_specialized_value_slice_new (TP_STRUCT_TYPE_CHANNEL_INFO); g_assert (TP_IS_EXPORTABLE_CHANNEL (channel)); exportable_channel_get_old_info (channel, &path, &type, &handle_type, &handle); dbus_g_type_struct_set (entry, 0, path, 1, type, 2, handle_type, 3, handle, G_MAXUINT); g_ptr_array_add (values, entry); g_free (path); g_free (type); } static void tp_base_connection_list_channels (TpSvcConnection *iface, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv; GPtrArray *channels, *values; guint i; g_assert (TP_IS_BASE_CONNECTION (self)); priv = self->priv; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); /* I think on average, each factory will have 2 channels :D */ values = g_ptr_array_sized_new (priv->channel_factories->len * 2 + priv->channel_managers->len * 2); G_GNUC_BEGIN_IGNORE_DEPRECATIONS for (i = 0; i < priv->channel_factories->len; i++) { TpChannelFactoryIface *factory = g_ptr_array_index (priv->channel_factories, i); tp_channel_factory_iface_foreach (factory, list_channel_factory_foreach_one, values); } G_GNUC_END_IGNORE_DEPRECATIONS for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = g_ptr_array_index (priv->channel_managers, i); tp_channel_manager_foreach_channel (manager, list_channel_manager_foreach_one, values); } channels = g_ptr_array_sized_new (values->len); for (i = 0; i < values->len; i++) { g_ptr_array_add (channels, g_value_get_boxed (g_ptr_array_index (values, i))); } tp_svc_connection_return_from_list_channels (context, channels); g_ptr_array_unref (channels); for (i = 0; i < values->len; i++) { tp_g_value_slice_free (g_ptr_array_index (values, i)); } g_ptr_array_unref (values); } static void tp_base_connection_request_channel (TpSvcConnection *iface, const gchar *type, guint handle_type, guint handle, gboolean suppress_handler, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv; TpChannelFactoryRequestStatus status = TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED; GError *error = NULL; guint i; ChannelRequest *request; GHashTable *request_properties; gboolean claimed_by_channel_manager = FALSE; TpHandleRepoIface *handle_repo = NULL; g_assert (TP_IS_BASE_CONNECTION (self)); priv = self->priv; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); if (handle_type == TP_HANDLE_TYPE_NONE) { if (handle != 0) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "When handle type is NONE, handle must be 0" }; dbus_g_method_return_error (context, &e); return; } } else { handle_repo = tp_base_connection_get_handles (self, handle_type); if (handle_repo == NULL) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Handle type not supported by this connection manager" }; dbus_g_method_return_error (context, &e); return; } if (!tp_handle_is_valid (handle_repo, handle, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } } request = channel_request_new (context, METHOD_REQUEST_CHANNEL, type, handle_type, handle, suppress_handler); g_ptr_array_add (priv->channel_requests, request); /* First try the channel managers */ request_properties = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, type, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, handle_type, NULL); if (handle != 0) { tp_asv_set_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, handle); g_assert (handle_repo != NULL); tp_asv_set_string (request_properties, TP_PROP_CHANNEL_TARGET_ID, tp_handle_inspect (handle_repo, handle)); } for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, i)); if (tp_channel_manager_request_channel (manager, request, request_properties)) { claimed_by_channel_manager = TRUE; break; } } g_hash_table_unref (request_properties); if (claimed_by_channel_manager) return; /* OK, none of them wanted it. Now try the channel factories */ for (i = 0; i < priv->channel_factories->len; i++) { TpChannelFactoryIface *factory = g_ptr_array_index (priv->channel_factories, i); TpChannelFactoryRequestStatus cur_status; TpChannelIface *chan = NULL; G_GNUC_BEGIN_IGNORE_DEPRECATIONS cur_status = tp_channel_factory_iface_request (factory, type, (TpHandleType) handle_type, handle, request, &chan, &error); G_GNUC_END_IGNORE_DEPRECATIONS switch (cur_status) { case TP_CHANNEL_FACTORY_REQUEST_STATUS_EXISTING: { g_assert (NULL != chan); factory_satisfy_requests (self, factory, chan, request, FALSE); /* factory_satisfy_requests should remove the request */ g_assert (!tp_g_ptr_array_contains (priv->channel_requests, request)); return; } case TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED: g_assert (NULL != chan); /* the signal handler should have completed the queued request * and freed the ChannelRequest already */ g_assert (!tp_g_ptr_array_contains (priv->channel_requests, request)); return; case TP_CHANNEL_FACTORY_REQUEST_STATUS_QUEUED: DEBUG ("queued request, channel_type=%s, handle_type=%u, " "handle=%u, suppress_handler=%u", type, handle_type, handle, suppress_handler); return; case TP_CHANNEL_FACTORY_REQUEST_STATUS_ERROR: /* pass through error */ goto ERROR; default: /* always return the most specific error */ if (cur_status > status) status = cur_status; } } switch (status) { case TP_CHANNEL_FACTORY_REQUEST_STATUS_INVALID_HANDLE: DEBUG ("invalid handle %u", handle); error = g_error_new (TP_ERROR, TP_ERROR_INVALID_HANDLE, "invalid handle %u", handle); break; case TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_AVAILABLE: DEBUG ("requested channel is unavailable with " "handle type %u", handle_type); error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "requested channel is not available with " "handle type %u", handle_type); break; case TP_CHANNEL_FACTORY_REQUEST_STATUS_NOT_IMPLEMENTED: DEBUG ("unsupported channel type %s", type); error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "unsupported channel type %s", type); break; default: g_assert_not_reached (); } ERROR: g_assert (error != NULL); dbus_g_method_return_error (request->context, error); request->context = NULL; g_error_free (error); g_ptr_array_remove (priv->channel_requests, request); channel_request_free (request); } static void tp_base_connection_release_handles (TpSvcConnection *iface, guint handle_type, const GArray * handles, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpBaseConnectionPrivate *priv = self->priv; GError *error = NULL; g_assert (TP_IS_BASE_CONNECTION (self)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); if (!tp_handles_supported_and_valid (priv->handles, handle_type, handles, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } tp_svc_connection_return_from_release_handles (context); } typedef struct { GArray *handles; guint n_pending; DBusGMethodInvocation *context; } RequestHandlesData; typedef struct { RequestHandlesData *request; guint pos; } EnsureHandleData; static void ensure_handle_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpHandleRepoIface *repo = (TpHandleRepoIface *) source; EnsureHandleData *data = user_data; RequestHandlesData *request = data->request; TpHandle handle; GError *error = NULL; /* If another tp_handle_ensure_async() already failed, ignore others */ if (request->context == NULL) goto out; handle = tp_handle_ensure_finish (repo, result, &error); if (handle == 0) { dbus_g_method_return_error (request->context, error); request->context = NULL; g_clear_error (&error); } else { TpHandle *handle_p; handle_p = &g_array_index (request->handles, TpHandle, data->pos); g_assert (*handle_p == 0); *handle_p = handle; } out: request->n_pending--; if (request->n_pending == 0) { if (request->context != NULL) { tp_svc_connection_return_from_request_handles (request->context, request->handles); } g_array_unref (request->handles); g_slice_free (RequestHandlesData, request); } g_slice_free (EnsureHandleData, data); } /** * tp_base_connection_dbus_request_handles: (skip) * @iface: A pointer to #TpBaseConnection, cast to a pointer to * #TpSvcConnection * @handle_type: The handle type (#TpHandleType) as a guint * @names: A strv of handle names * @context: The dbus-glib method invocation context * * Implements D-Bus method RequestHandles on interface * org.freedesktop.Telepathy.Connection. * * This was exported so subclasses could use it as a basis for their * reimplementations, but reimplementing the method is now deprecated. * * Deprecated: 0.19.0 */ void tp_base_connection_dbus_request_handles (TpSvcConnection *iface, guint handle_type, const gchar **names, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (iface); TpHandleRepoIface *handle_repo = tp_base_connection_get_handles (self, handle_type); guint count, i; GError *error = NULL; RequestHandlesData *request; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); if (!tp_handle_type_is_valid (handle_type, &error)) { g_assert (error != NULL); goto error; } if (handle_repo == NULL) { DEBUG ("unimplemented handle type %u", handle_type); error = g_error_new (TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "unimplemented handle type %u", handle_type); goto error; } count = g_strv_length ((GStrv) names); if (count == 0) { GArray *tmp = g_array_sized_new (FALSE, TRUE, sizeof (guint), 0); tp_svc_connection_return_from_request_handles (context, tmp); g_array_unref (tmp); return; } request = g_slice_new0 (RequestHandlesData); request->handles = g_array_sized_new (FALSE, TRUE, sizeof (guint), count); request->n_pending = count; request->context = context; /* _sized_new() just pre-allocates memory, but handles->len is still 0 */ g_array_set_size (request->handles, count); for (i = 0; i < count; i++) { EnsureHandleData *data; data = g_slice_new0 (EnsureHandleData); data->request = request; data->pos = i; tp_handle_ensure_async (handle_repo, self, names[i], NULL, ensure_handle_cb, data); } return; error: dbus_g_method_return_error (context, error); g_error_free (error); } /** * tp_base_connection_get_handles: * @self: A connection * @handle_type: The handle type * * * * Returns: (transfer none): the handle repository corresponding to the given * handle type, or #NULL if it's unsupported or invalid. */ TpHandleRepoIface * tp_base_connection_get_handles (TpBaseConnection *self, TpHandleType handle_type) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); if (handle_type >= TP_NUM_HANDLE_TYPES) return NULL; return self->priv->handles[handle_type]; } /** * tp_base_connection_get_self_handle: (skip) * @self: A connection * * Returns the #TpBaseConnection:self-handle property, which is guaranteed not * to be 0 once the connection has moved to the CONNECTED state. * * Returns: the current self handle of the connection. * * Since: 0.7.15 */ TpHandle tp_base_connection_get_self_handle (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), 0); return self->self_handle; } /** * tp_base_connection_set_self_handle: * @self: A connection * @self_handle: The new self handle for the connection. * * Sets the #TpBaseConnection:self-handle property. self_handle may not be 0 * once the connection has moved to the CONNECTED state. * * Since: 0.7.15 */ void tp_base_connection_set_self_handle (TpBaseConnection *self, TpHandle self_handle) { if (self->status == TP_CONNECTION_STATUS_CONNECTED) g_return_if_fail (self_handle != 0); if (self->self_handle == self_handle) return; self->self_handle = self_handle; self->priv->self_id = NULL; if (self_handle != 0) { self->priv->self_id = tp_handle_inspect ( self->priv->handles[TP_HANDLE_TYPE_CONTACT], self_handle); } tp_svc_connection_emit_self_handle_changed (self, self->self_handle); tp_svc_connection_emit_self_contact_changed (self, self->self_handle, self->priv->self_id); g_object_notify ((GObject *) self, "self-handle"); g_object_notify ((GObject *) self, "self-id"); } /** * tp_base_connection_finish_shutdown: (skip) * @self: The connection * * Tell the connection manager that this Connection has been disconnected, * has emitted StatusChanged and is ready to be removed from D-Bus. */ void tp_base_connection_finish_shutdown (TpBaseConnection *self) { GPtrArray *contexts; guint i; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (self->status == TP_CONNECTION_STATUS_DISCONNECTED); g_return_if_fail (self->priv->disconnect_requests != NULL); contexts = self->priv->disconnect_requests; self->priv->disconnect_requests = NULL; for (i = 0; i < contexts->len; i++) { tp_svc_connection_return_from_disconnect (g_ptr_array_index (contexts, i)); } g_ptr_array_unref (contexts); g_signal_emit (self, signals[SHUTDOWN_FINISHED], 0); } /** * tp_base_connection_disconnect_with_dbus_error: (skip) * @self: The connection * @error_name: The D-Bus error with which the connection changed status to * Disconnected * @details: Further details of the error, as a hash table where the keys * are strings as defined in the Telepathy specification, and the * values are #GValues. %NULL is allowed, and treated as * an empty hash table. * @reason: The reason code to use in the StatusChanged signal * (a less specific, non-extensible version of @error_name) * * Changes the #TpBaseConnection.status of @self to * %TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to * tp_base_connection_change_status(), but additionally emits the * ConnectionError D-Bus signal to provide more details about the * error. * * Well-known keys for @details are documented in the Telepathy specification's * definition * of the ConnectionError signal, and include: * * * "debug-message", whose value should have type * #G_TYPE_STRING, for debugging information about the * disconnection which should not be shown to the user * "server-message", whose value should also have type * #G_TYPE_STRING, for a human-readable error message from the server (in an * unspecified language) explaining why the user was * disconnected. * * * Since: 0.7.24 */ void tp_base_connection_disconnect_with_dbus_error (TpBaseConnection *self, const gchar *error_name, GHashTable *details, TpConnectionStatusReason reason) { GHashTable *dup_ = NULL; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (tp_dbus_check_valid_interface_name (error_name, NULL)); if (details == NULL) { dup_ = g_hash_table_new (g_str_hash, g_str_equal); details = dup_; } tp_svc_connection_emit_connection_error (self, error_name, details); tp_base_connection_change_status (self, TP_CONNECTION_STATUS_DISCONNECTED, reason); if (dup_ != NULL) g_hash_table_unref (dup_); } /** * tp_base_connection_disconnect_with_dbus_error_vardict: (skip) * @self: The connection * @error_name: The D-Bus error with which the connection changed status to * Disconnected * @details: Further details of the error, as a variant of * type %G_VARIANT_TYPE_VARDICT. The keys * are strings as defined in the Telepathy specification, and the * values are of type %G_VARIANT_TYPE_VARIANT. * %NULL is allowed, and treated as an empty dictionary. * @reason: The reason code to use in the StatusChanged signal * (a less specific, non-extensible version of @error_name) * * Changes the #TpBaseConnection.status of @self to * %TP_CONNECTION_STATUS_DISCONNECTED, as if by a call to * tp_base_connection_change_status(), but additionally emits the * ConnectionError D-Bus signal to provide more details about the * error. * * Well-known keys for @details are documented in the Telepathy specification's * definition * of the ConnectionError signal, and include: * * * "debug-message", whose value should have type * #G_TYPE_STRING, for debugging information about the * disconnection which should not be shown to the user * "server-message", whose value should also have type * #G_TYPE_STRING, for a human-readable error message from the server (in an * unspecified language) explaining why the user was * disconnected. * * * Since: 0.7.24 */ void tp_base_connection_disconnect_with_dbus_error_vardict (TpBaseConnection *self, const gchar *error_name, GVariant *details, TpConnectionStatusReason reason) { GHashTable *hash; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (tp_dbus_check_valid_interface_name (error_name, NULL)); if (details == NULL) { hash = g_hash_table_new (g_str_hash, g_str_equal); } else { hash = _tp_asv_from_vardict (details); } tp_svc_connection_emit_connection_error (self, error_name, hash); tp_base_connection_change_status (self, TP_CONNECTION_STATUS_DISCONNECTED, reason); g_hash_table_unref (hash); } /** * tp_base_connection_change_status: * @self: The connection * @status: The new status * @reason: The reason for the status change * * Change the status of the connection. The allowed state transitions are: * * * #TP_INTERNAL_CONNECTION_STATUS_NEW → * #TP_CONNECTION_STATUS_CONNECTING * #TP_CONNECTION_STATUS_CONNECTING → * #TP_CONNECTION_STATUS_CONNECTED * #TP_INTERNAL_CONNECTION_STATUS_NEW → * #TP_CONNECTION_STATUS_CONNECTED (exactly equivalent to both of the above * one after the other; see below) * anything except #TP_CONNECTION_STATUS_DISCONNECTED → * #TP_CONNECTION_STATUS_DISCONNECTED * * * Before the transition to #TP_CONNECTION_STATUS_CONNECTED, the implementation * must have discovered the handle for the local user and passed it to * tp_base_connection_set_self_handle(). * * Changing from NEW to CONNECTED is implemented by doing the transition from * NEW to CONNECTING, followed by the transition from CONNECTING to CONNECTED; * it's exactly equivalent to calling tp_base_connection_change_status for * those two transitions one after the other. * * Any other valid transition does the following, in this order: * * * Update #TpBaseConnection.status; * If the new state is #TP_CONNECTION_STATUS_DISCONNECTED, call * tp_channel_factory_iface_close_all() on all channel factories * Emit the D-Bus StatusChanged signal; * Call #TpBaseConnectionClass.connecting, * #TpBaseConnectionClass.connected or #TpBaseConnectionClass.disconnected * as appropriate; * Call the channel factories' status change callbacks; * If the new state is #TP_CONNECTION_STATUS_DISCONNECTED, call the * subclass' #TpBaseConnectionClass.shut_down callback. * * * To provide more details about what happened when moving to @status * #TP_CONNECTION_STATUS_DISCONNECTED due to an error, consider calling * tp_base_connection_disconnect_with_dbus_error() instead of this function. * * Changed in 0.7.35: the @self_handle member of #TpBaseConnection was * previously set to 0 at this stage. It now remains non-zero until the object * is disposed. */ void tp_base_connection_change_status (TpBaseConnection *self, TpConnectionStatus status, TpConnectionStatusReason reason) { TpBaseConnectionPrivate *priv; TpBaseConnectionClass *klass; TpConnectionStatus prev_status; g_assert (TP_IS_BASE_CONNECTION (self)); priv = self->priv; klass = TP_BASE_CONNECTION_GET_CLASS (self); if (self->status == TP_INTERNAL_CONNECTION_STATUS_NEW && status == TP_CONNECTION_STATUS_CONNECTED) { /* going straight from NEW to CONNECTED would cause confusion, so before * we do anything else, go via CONNECTING */ DEBUG("from NEW to CONNECTED: going via CONNECTING first"); tp_base_connection_change_status (self, TP_CONNECTION_STATUS_CONNECTING, reason); } DEBUG("was %u, now %u, for reason %u", self->status, status, reason); g_return_if_fail (status != TP_INTERNAL_CONNECTION_STATUS_NEW); if (self->status == status) { WARNING ("attempted to re-emit the current status %u, reason %u", status, reason); return; } prev_status = self->status; /* make appropriate assertions about our state */ switch (status) { case TP_CONNECTION_STATUS_DISCONNECTED: /* you can go from any state to DISCONNECTED, except DISCONNECTED; * and we already warned and returned if that was the case, so * nothing to do here */ break; case TP_CONNECTION_STATUS_CONNECTED: /* you can only go to CONNECTED if you're CONNECTING (or NEW, but we * covered that by forcing a transition to CONNECTING above) */ g_return_if_fail (prev_status == TP_CONNECTION_STATUS_CONNECTING); /* by the time we go CONNECTED we must have the self handle */ g_return_if_fail (self->self_handle != 0); break; case TP_CONNECTION_STATUS_CONNECTING: /* you can't go CONNECTING if a connection attempt has been made * before */ g_return_if_fail (prev_status == TP_INTERNAL_CONNECTION_STATUS_NEW); break; default: CRITICAL ("invalid connection status %d", status); return; } /* now that we've finished return_if_fail'ing, we can start to make * the actual changes */ self->status = status; /* ref self in case user callbacks unref us */ g_object_ref (self); if (status == TP_CONNECTION_STATUS_DISCONNECTED) { /* the presence of this array indicates that we are shutting down */ if (self->priv->disconnect_requests == NULL) self->priv->disconnect_requests = g_ptr_array_sized_new (0); /* remove all channels and shut down all factories, so we don't get * any race conditions where method calls are delivered to a channel * after we've started disconnecting */ tp_base_connection_close_all_channels (self); } DEBUG("emitting status-changed to %u, for reason %u", status, reason); tp_svc_connection_emit_status_changed (self, status, reason); /* tell subclass and factories about the state change. In the case of * disconnection, shut down afterwards */ switch (status) { case TP_CONNECTION_STATUS_CONNECTING: if (klass->connecting) (klass->connecting) (self); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_ptr_array_foreach (priv->channel_factories, (GFunc) tp_channel_factory_iface_connecting, NULL); G_GNUC_END_IGNORE_DEPRECATIONS break; case TP_CONNECTION_STATUS_CONNECTED: /* the implementation should have ensured we have a valid self_handle * before changing the state to CONNECTED */ g_assert (self->self_handle != 0); g_assert (tp_handle_is_valid (priv->handles[TP_HANDLE_TYPE_CONTACT], self->self_handle, NULL)); if (klass->connected) (klass->connected) (self); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_ptr_array_foreach (priv->channel_factories, (GFunc) tp_channel_factory_iface_connected, NULL); G_GNUC_END_IGNORE_DEPRECATIONS break; case TP_CONNECTION_STATUS_DISCONNECTED: /* cancel all queued channel requests that weren't already cancelled by * the channel managers. */ if (priv->channel_requests->len > 0) { g_ptr_array_foreach (priv->channel_requests, (GFunc) channel_request_cancel, NULL); g_ptr_array_remove_range (priv->channel_requests, 0, priv->channel_requests->len); } if (prev_status != TP_INTERNAL_CONNECTION_STATUS_NEW) { if (klass->disconnected) (klass->disconnected) (self); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_ptr_array_foreach (priv->channel_factories, (GFunc) tp_channel_factory_iface_disconnected, NULL); G_GNUC_END_IGNORE_DEPRECATIONS } (klass->shut_down) (self); tp_base_connection_unregister (self); break; default: g_assert_not_reached (); } g_object_unref (self); } /** * tp_base_connection_add_interfaces: (skip) * @self: A TpBaseConnection in state #TP_INTERNAL_CONNECTION_STATUS_NEW * or #TP_CONNECTION_STATUS_CONNECTING * @interfaces: A %NULL-terminated array of D-Bus interface names, which * must remain valid at least until the connection enters state * #TP_CONNECTION_STATUS_DISCONNECTED (in practice, you should either * use static strings, or use strdup'd strings and free them in the dispose * callback). * * Add some interfaces to the list supported by this Connection. If you're * going to call this function at all, you must do so before moving to state * CONNECTED (or DISCONNECTED); if you don't call it, only the set of * interfaces always present (@get_interfaces_always_present in * #TpBaseConnectionClass) will be supported. */ void tp_base_connection_add_interfaces (TpBaseConnection *self, const gchar **interfaces) { TpBaseConnectionPrivate *priv = self->priv; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (self->status != TP_CONNECTION_STATUS_CONNECTED); g_return_if_fail (self->status != TP_CONNECTION_STATUS_DISCONNECTED); for (; interfaces != NULL && *interfaces != NULL; interfaces++) g_array_append_val (priv->interfaces, *interfaces); } static void tp_base_connection_interested_name_owner_changed_cb ( TpDBusDaemon *it G_GNUC_UNUSED, const gchar *unique_name, const gchar *new_owner, gpointer user_data) { TpBaseConnection *self = user_data; GHashTableIter iter; gpointer q, hash; /* We don't care about the initial report that :1.42 is owned by :1.42. */ if (!tp_str_empty (new_owner)) return; /* Failing that, @unique_name must have crashed... */ g_hash_table_iter_init (&iter, self->priv->client_interests); while (g_hash_table_iter_next (&iter, &q, &hash)) { if (g_hash_table_remove (hash, unique_name) && g_hash_table_size (hash) == 0) { const gchar *s = g_quark_to_string (GPOINTER_TO_UINT (q)); DEBUG ("%s was the last client interested in %s", unique_name, s); g_signal_emit (self, signals[CLIENTS_UNINTERESTED], (GQuark) GPOINTER_TO_UINT (q), s); } } /* this has to be done last, because the keys in the other hashes are * borrowed from here */ g_hash_table_remove (self->priv->interested_clients, unique_name); tp_dbus_daemon_cancel_name_owner_watch (self->priv->bus_proxy, unique_name, tp_base_connection_interested_name_owner_changed_cb, self); } static void tp_base_connection_add_client_interest_impl (TpBaseConnection *self, const gchar *unique_name, const gchar * const *interests, gboolean only_if_uninterested) { gpointer name_in_hash, count_p; gsize total; const gchar * const *interest; gboolean was_there; if (g_hash_table_lookup_extended (self->priv->interested_clients, unique_name, &name_in_hash, &count_p)) { total = GPOINTER_TO_SIZE (count_p); was_there = TRUE; } else { name_in_hash = g_strdup (unique_name); total = 0; g_hash_table_insert (self->priv->interested_clients, name_in_hash, GSIZE_TO_POINTER (total)); was_there = FALSE; } for (interest = interests; *interest != NULL; interest++) { GQuark q = g_quark_try_string (*interest); GHashTable *clients; gsize count; if (q == 0) { /* we can only declare an interest in known quarks, so clearly this * one is not useful */ continue; } clients = g_hash_table_lookup (self->priv->client_interests, GUINT_TO_POINTER (q)); if (clients == NULL) { /* declaring an interest in this token has no effect */ continue; } count = GPOINTER_TO_SIZE (g_hash_table_lookup (clients, unique_name)); if (count > 0 && only_if_uninterested) { /* that client is already interested - nothing to do */ continue; } /* name_in_hash is borrowed from interested_clients so we have to * keep using the same one */ g_hash_table_insert (clients, name_in_hash, GSIZE_TO_POINTER (++count)); total++; if (count == 1 && g_hash_table_size (clients) == 1) { /* Transition from 0 to 1 interests in total; the signal detail is * the token. */ DEBUG ("%s is the first to be interested in %s", unique_name, *interest); g_signal_emit (self, signals[CLIENTS_INTERESTED], q, *interest); } } if (total > 0) { /* name_in_hash is borrowed by client_interests so we have to keep * using the same one */ g_hash_table_steal (self->priv->interested_clients, name_in_hash); g_hash_table_insert (self->priv->interested_clients, name_in_hash, GSIZE_TO_POINTER (total)); if (!was_there) { tp_dbus_daemon_watch_name_owner (self->priv->bus_proxy, unique_name, tp_base_connection_interested_name_owner_changed_cb, self, NULL); } } else { g_hash_table_remove (self->priv->interested_clients, unique_name); tp_dbus_daemon_cancel_name_owner_watch (self->priv->bus_proxy, unique_name, tp_base_connection_interested_name_owner_changed_cb, self); } } /** * tp_base_connection_add_client_interest: * @self: a #TpBaseConnection * @unique_name: the unique bus name of a D-Bus client * @token: a D-Bus interface or a token representing part of an interface, * added with tp_base_connection_add_possible_client_interest() * @only_if_uninterested: only add to the interest count if the client is not * already interested (appropriate for APIs that implicitly subscribe on first * use if this has not been done already, like Location) * * Add a "client interest" for @token on behalf of the given client. * * This emits #TpBaseConnection::clients-interested if this was the first * time a client expressed an interest in this token. */ void tp_base_connection_add_client_interest (TpBaseConnection *self, const gchar *unique_name, const gchar *token, gboolean only_if_uninterested) { const gchar * tokens[2] = { NULL, NULL }; tokens[0] = token; tp_base_connection_add_client_interest_impl (self, unique_name, tokens, only_if_uninterested); } static void tp_base_connection_dbus_add_client_interest (TpSvcConnection *svc, const gchar **interests, DBusGMethodInvocation *context) { TpBaseConnection *self = (TpBaseConnection *) svc; gchar *unique_name = NULL; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (self->priv->bus_proxy != NULL); if (interests == NULL || interests[0] == NULL) goto finally; unique_name = dbus_g_method_get_sender (context); tp_base_connection_add_client_interest_impl (self, unique_name, (const gchar * const *) interests, FALSE); finally: tp_svc_connection_return_from_add_client_interest (context); g_free (unique_name); } static void tp_base_connection_dbus_remove_client_interest (TpSvcConnection *svc, const gchar **interests, DBusGMethodInvocation *context) { gchar *unique_name = NULL; const gchar **interest; TpBaseConnection *self = (TpBaseConnection *) svc; gpointer name_in_hash, count_p; gsize total; g_return_if_fail (TP_IS_BASE_CONNECTION (self)); g_return_if_fail (self->priv->bus_proxy != NULL); if (interests == NULL || interests[0] == NULL) goto finally; unique_name = dbus_g_method_get_sender (context); /* this method isn't really meant to fail, so we might as well return now */ if (!g_hash_table_lookup_extended (self->priv->interested_clients, unique_name, &name_in_hash, &count_p)) { /* unique_name doesn't own any client interests. Strictly speaking this * is an error, but it's probably ignoring the reply anyway, so we * won't tell it. */ goto finally; } total = GPOINTER_TO_SIZE (count_p); for (interest = interests; *interest != NULL; interest++) { GQuark q = g_quark_try_string (*interest); GHashTable *clients; gsize count; if (q == 0) { /* we can only declare an interest in known quarks, so clearly this * one is not useful */ continue; } clients = g_hash_table_lookup (self->priv->client_interests, GUINT_TO_POINTER (q)); if (clients == NULL) { /* declaring an interest in this token has no effect */ continue; } count = GPOINTER_TO_SIZE (g_hash_table_lookup (clients, unique_name)); if (count == 0) { /* strictly speaking, this is an error, but nobody will be waiting * for a reply anyway */ DEBUG ("unable to decrement %s interest in %s past zero", unique_name, *interest); continue; } total--; if (count == 1) { g_hash_table_remove (clients, unique_name); if (g_hash_table_size (clients) == 0) { /* transition from 1 to 0 total interest-counts */ DEBUG ("%s was the last client interested in %s", unique_name, *interest); g_signal_emit (self, signals[CLIENTS_UNINTERESTED], q, *interest); } } else { /* name_in_hash is borrowed from interested_clients so we have to * keep using the same one */ g_hash_table_insert (clients, name_in_hash, GSIZE_TO_POINTER (--count)); } } if (total == 0) { g_hash_table_remove (self->priv->interested_clients, unique_name); tp_dbus_daemon_cancel_name_owner_watch (self->priv->bus_proxy, unique_name, tp_base_connection_interested_name_owner_changed_cb, self); } finally: tp_svc_connection_return_from_remove_client_interest (context); g_free (unique_name); } static void conn_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionClass *klass = g_iface; #define IMPLEMENT(prefix,x) tp_svc_connection_implement_##x (klass, \ tp_base_connection_##prefix##x) IMPLEMENT(,connect); IMPLEMENT(,disconnect); IMPLEMENT(dbus_,get_interfaces); IMPLEMENT(,get_protocol); IMPLEMENT(dbus_,get_self_handle); IMPLEMENT(dbus_,get_status); IMPLEMENT(,hold_handles); IMPLEMENT(,inspect_handles); IMPLEMENT(,list_channels); IMPLEMENT(,request_channel); IMPLEMENT(,release_handles); G_GNUC_BEGIN_IGNORE_DEPRECATIONS IMPLEMENT(dbus_,request_handles); G_GNUC_END_IGNORE_DEPRECATIONS IMPLEMENT(dbus_,add_client_interest); IMPLEMENT(dbus_,remove_client_interest); #undef IMPLEMENT } /* The handling of calls to Connection.Interface.Requests.CreateChannel is * split into three chained functions, which each call the next function in * the chain unless an error has occured. */ static void conn_requests_check_basic_properties (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, DBusGMethodInvocation *context); static void conn_requests_requestotron_validate_handle (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, const gchar *type, TpHandleType target_handle_type, TpHandle target_handle, const gchar *target_id, DBusGMethodInvocation *context); static void conn_requests_offer_request (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, const gchar *type, TpHandleType target_handle_type, TpHandle target_handle, DBusGMethodInvocation *context); #define RETURN_INVALID_ARGUMENT(message) \ G_STMT_START { \ GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, message }; \ dbus_g_method_return_error (context, &e); \ return; \ } G_STMT_END static void conn_requests_requestotron (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, DBusGMethodInvocation *context) { TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (self, context); /* Call the first function in the chain handling incoming requests; it will * call the next steps. */ conn_requests_check_basic_properties (self, requested_properties, method, context); } static void conn_requests_check_basic_properties (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, DBusGMethodInvocation *context) { /* Step 1: * Check that ChannelType, TargetHandleType, TargetHandle, TargetID have * the correct types, and that ChannelType is not omitted. */ const gchar *type; TpHandleType target_handle_type; TpHandle target_handle; const gchar *target_id; gboolean valid; type = tp_asv_get_string (requested_properties, TP_PROP_CHANNEL_CHANNEL_TYPE); if (type == NULL) RETURN_INVALID_ARGUMENT ("ChannelType is required"); target_handle_type = tp_asv_get_uint32 (requested_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid); /* Allow TargetHandleType to be missing, but not to be otherwise broken */ if (!valid && tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE) != NULL) RETURN_INVALID_ARGUMENT ( "TargetHandleType must be an integer in range 0 to 2**32-1"); target_handle = tp_asv_get_uint32 (requested_properties, TP_PROP_CHANNEL_TARGET_HANDLE, &valid); /* Allow TargetHandle to be missing, but not to be otherwise broken */ if (!valid && tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_TARGET_HANDLE) != NULL) RETURN_INVALID_ARGUMENT ( "TargetHandle must be an integer in range 1 to 2**32-1"); /* TargetHandle may not be 0 */ if (valid && target_handle == 0) RETURN_INVALID_ARGUMENT ("TargetHandle may not be 0"); target_id = tp_asv_get_string (requested_properties, TP_PROP_CHANNEL_TARGET_ID); /* Allow TargetID to be missing, but not to be otherwise broken */ if (target_id == NULL && tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_TARGET_ID) != NULL) RETURN_INVALID_ARGUMENT ("TargetID must be a string"); if (tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_INITIATOR_HANDLE) != NULL) RETURN_INVALID_ARGUMENT ("InitiatorHandle may not be requested"); if (tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_INITIATOR_ID) != NULL) RETURN_INVALID_ARGUMENT ("InitiatorID may not be requested"); if (tp_asv_lookup (requested_properties, TP_PROP_CHANNEL_REQUESTED) != NULL) RETURN_INVALID_ARGUMENT ("Requested may not be requested"); conn_requests_requestotron_validate_handle (self, requested_properties, method, type, target_handle_type, target_handle, target_id, context); } /* * @target_handle: non-zero if a TargetHandle property was in the request; * zero if TargetHandle was not in the request. */ static void conn_requests_requestotron_validate_handle (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, const gchar *type, TpHandleType target_handle_type, TpHandle target_handle, const gchar *target_id, DBusGMethodInvocation *context) { /* Step 2: Validate the supplied set of Handle properties */ TpHandleRepoIface *handles = NULL; GHashTable *altered_properties = NULL; GValue *target_handle_value = NULL; GValue *target_id_value = NULL; /* Handle type 0 cannot have a handle */ if (target_handle_type == TP_HANDLE_TYPE_NONE && target_handle != 0) RETURN_INVALID_ARGUMENT ( "When TargetHandleType is NONE, TargetHandle must be omitted"); /* Handle type 0 cannot have a target id */ if (target_handle_type == TP_HANDLE_TYPE_NONE && target_id != NULL) RETURN_INVALID_ARGUMENT ( "When TargetHandleType is NONE, TargetID must be omitted"); if (target_handle_type != TP_HANDLE_TYPE_NONE) { GError *error = NULL; if (target_handle == 0 && target_id == NULL) RETURN_INVALID_ARGUMENT ("When TargetHandleType is not None, either " "TargetHandle or TargetID must also be given"); if (target_handle != 0 && target_id != NULL) RETURN_INVALID_ARGUMENT ( "TargetHandle and TargetID must not both be given"); handles = tp_base_connection_get_handles (self, target_handle_type); if (handles == NULL) { GError e = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Handle type not supported by this connection manager" }; dbus_g_method_return_error (context, &e); return; } if (target_handle == 0) { /* Turn TargetID into TargetHandle */ target_handle = tp_handle_ensure (handles, target_id, NULL, &error); if (target_handle == 0) { /* tp_handle_ensure can return any error in any domain; force * the domain and code to be as documented for CreateChannel. */ error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_HANDLE; dbus_g_method_return_error (context, error); g_error_free (error); return; } altered_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); tp_g_hash_table_update (altered_properties, requested_properties, NULL, NULL); target_handle_value = tp_g_value_slice_new_uint (target_handle); g_hash_table_insert (altered_properties, TP_PROP_CHANNEL_TARGET_HANDLE, target_handle_value); requested_properties = altered_properties; } else { /* Check the supplied TargetHandle is valid */ if (!tp_handle_is_valid (handles, target_handle, &error)) { error->domain = TP_ERROR; error->code = TP_ERROR_INVALID_HANDLE; dbus_g_method_return_error (context, error); g_error_free (error); return; } altered_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); tp_g_hash_table_update (altered_properties, requested_properties, NULL, NULL); target_id_value = tp_g_value_slice_new_string ( tp_handle_inspect (handles, target_handle)); g_hash_table_insert (altered_properties, TP_PROP_CHANNEL_TARGET_ID, target_id_value); requested_properties = altered_properties; } } conn_requests_offer_request (self, requested_properties, method, type, target_handle_type, target_handle, context); /* If we made a new table, we should destroy it, and whichever of the GValues * holding TargetHandle or TargetID we filled in. The other GValues are * borrowed from the supplied requested_properties table. */ if (altered_properties != NULL) { g_hash_table_unref (altered_properties); if (target_handle_value != NULL) tp_g_value_slice_free (target_handle_value); if (target_id_value != NULL) tp_g_value_slice_free (target_id_value); } } static void conn_requests_offer_request (TpBaseConnection *self, GHashTable *requested_properties, ChannelRequestMethod method, const gchar *type, TpHandleType target_handle_type, TpHandle target_handle, DBusGMethodInvocation *context) { /* Step 3: offer the incoming, vaguely sanitized request to the channel * managers. */ TpBaseConnectionPrivate *priv = self->priv; TpChannelManagerRequestFunc func; ChannelRequest *request; gboolean suppress_handler; guint i; switch (method) { case METHOD_CREATE_CHANNEL: func = tp_channel_manager_create_channel; suppress_handler = TRUE; break; case METHOD_ENSURE_CHANNEL: func = tp_channel_manager_ensure_channel; suppress_handler = FALSE; break; default: g_assert_not_reached (); } request = channel_request_new (context, method, type, target_handle_type, target_handle, suppress_handler); g_ptr_array_add (priv->channel_requests, request); for (i = 0; i < priv->channel_managers->len; i++) { TpChannelManager *manager = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, i)); if (func (manager, request, requested_properties)) return; } /* Nobody accepted the request */ tp_dbus_g_method_return_not_implemented (context); request->context = NULL; g_ptr_array_remove (priv->channel_requests, request); channel_request_free (request); } static void conn_requests_create_channel (TpSvcConnectionInterfaceRequests *svc, GHashTable *requested_properties, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (svc); conn_requests_requestotron (self, requested_properties, METHOD_CREATE_CHANNEL, context); } static void conn_requests_ensure_channel (TpSvcConnectionInterfaceRequests *svc, GHashTable *requested_properties, DBusGMethodInvocation *context) { TpBaseConnection *self = TP_BASE_CONNECTION (svc); conn_requests_requestotron (self, requested_properties, METHOD_ENSURE_CHANNEL, context); } static void requests_iface_init (gpointer g_iface, gpointer iface_data G_GNUC_UNUSED) { TpSvcConnectionInterfaceRequestsClass *iface = g_iface; #define IMPLEMENT(x) \ tp_svc_connection_interface_requests_implement_##x (\ iface, conn_requests_##x) IMPLEMENT (create_channel); IMPLEMENT (ensure_channel); #undef IMPLEMENT } /** * tp_base_connection_channel_manager_iter_init: (skip) * @iter: an uninitialized #TpChannelManagerIter * @self: a connection * * Initializes an iterator over the #TpChannelManager objects known to * @self. It is intended to be used as followed: * * * TpChannelManagerIter iter; * TpChannelManager *manager; * * tp_base_connection_channel_manager_iter_init (&iter, base_conn); * while (tp_base_connection_channel_manager_iter_next (&iter, &manager)) * { * ...do something with manager... * } * * * Since: 0.7.15 */ void tp_base_connection_channel_manager_iter_init (TpChannelManagerIter *iter, TpBaseConnection *self) { g_return_if_fail (TP_IS_BASE_CONNECTION (self)); iter->self = self; iter->index = 0; } /** * tp_base_connection_channel_manager_iter_next: (skip) * @iter: an initialized #TpChannelManagerIter * @manager_out: a location to store the channel manager, or %NULL. * * Advances @iter, and retrieves the #TpChannelManager it now points to. If * there are no more channel managers, @manager_out is not set and %FALSE is * returned. * * Returns: %FALSE if there are no more channel managers; else %TRUE. * * Since: 0.7.15 */ gboolean tp_base_connection_channel_manager_iter_next (TpChannelManagerIter *iter, TpChannelManager **manager_out) { TpBaseConnectionPrivate *priv; /* Check the caller initialized the iterator properly. */ g_assert (TP_IS_BASE_CONNECTION (iter->self)); priv = iter->self->priv; /* Be noisy if something's gone really wrong */ g_return_val_if_fail (iter->index <= priv->channel_managers->len, FALSE); if (iter->index == priv->channel_managers->len) return FALSE; if (manager_out != NULL) *manager_out = TP_CHANNEL_MANAGER ( g_ptr_array_index (priv->channel_managers, iter->index)); iter->index++; return TRUE; } static void tp_base_connection_fill_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { TpBaseConnection *self = TP_BASE_CONNECTION (obj); TpBaseConnectionPrivate *priv = self->priv; guint i; for (i = 0; i < contacts->len; i++) { TpHandle handle; const gchar *tmp; handle = g_array_index (contacts, TpHandle, i); tmp = tp_handle_inspect (priv->handles[TP_HANDLE_TYPE_CONTACT], handle); g_assert (tmp != NULL); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_CONTACT_ID, tp_g_value_slice_new_string (tmp)); } } /** * tp_base_connection_register_with_contacts_mixin: (skip) * @self: An instance of the #TpBaseConnections that uses the Contacts * mixin * * Register the Connection interface with the Contacts interface to make it * inspectable. The Contacts mixin should be initialized before this function * is called */ void tp_base_connection_register_with_contacts_mixin (TpBaseConnection *self) { g_return_if_fail (TP_IS_BASE_CONNECTION (self)); tp_contacts_mixin_add_contact_attributes_iface (G_OBJECT (self), TP_IFACE_CONNECTION, tp_base_connection_fill_contact_attributes); } /** * tp_base_connection_get_dbus_daemon: (skip) * @self: the connection manager * * * * Returns: (transfer none): the value of the * #TpBaseConnectionManager:dbus-daemon property. The caller must reference * the returned object with g_object_ref() if it will be kept. * * Since: 0.11.3 */ TpDBusDaemon * tp_base_connection_get_dbus_daemon (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); return self->priv->bus_proxy; } gpointer _tp_base_connection_find_channel_manager (TpBaseConnection *self, GType type) { guint i; g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); for (i = 0; i < self->priv->channel_managers->len; i++) { gpointer manager = g_ptr_array_index (self->priv->channel_managers, i); if (g_type_is_a (G_OBJECT_TYPE (manager), type)) { return manager; } } return NULL; } /** * tp_base_connection_get_bus_name: * @self: the connection * * Return the bus name starting with %TP_CONN_BUS_NAME_BASE that represents * this connection on D-Bus. * * The returned string belongs to the #TpBaseConnection and must be copied * by the caller if it will be kept. * * If this connection has never been present on D-Bus * (tp_base_connection_register() has never been called), return %NULL * instead. * * Returns: (allow-none) (transfer none): the bus name of this connection, * or %NULL * Since: 0.19.1 */ const gchar * tp_base_connection_get_bus_name (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); return self->bus_name; } /** * tp_base_connection_get_object_path: * @self: the connection * * Return the object path starting with %TP_CONN_OBJECT_PATH_BASE that * represents this connection on D-Bus. * * The returned string belongs to the #TpBaseConnection and must be copied * by the caller if it will be kept. * * If this connection has never been present on D-Bus * (tp_base_connection_register() has never been called), return %NULL * instead. * * Returns: (allow-none) (transfer none): the object path of this connection, * or %NULL * Since: 0.19.1 */ const gchar * tp_base_connection_get_object_path (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); return self->object_path; } /** * tp_base_connection_get_account_path_suffix: * @self: the connection * * * * Returns: the same value has the #TpBaseConnection:account-path-suffix * property. * Since: 0.23.2 */ const gchar * tp_base_connection_get_account_path_suffix (TpBaseConnection *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL); return self->priv->account_path_suffix; } telepathy-glib-0.24.2/telepathy-glib/base-connection.h0000644000175000017500000001740712652510705017600 00000000000000/* * base-connection.h - Header for TpBaseConnection * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CONNECTION_H__ #define __TP_BASE_CONNECTION_H__ #include #include #include #include #include #include #include #include G_BEGIN_DECLS /* The TpBaseConnection typedef is forward-declared in handle-repo.h */ typedef struct _TpBaseConnectionClass TpBaseConnectionClass; typedef struct _TpBaseConnectionPrivate TpBaseConnectionPrivate; typedef void (*TpBaseConnectionProc) (TpBaseConnection *self); typedef gboolean (*TpBaseConnectionStartConnectingImpl) ( TpBaseConnection *self, GError **error); typedef void (*TpBaseConnectionCreateHandleReposImpl) (TpBaseConnection *self, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]); typedef GPtrArray *(*TpBaseConnectionCreateChannelFactoriesImpl) ( TpBaseConnection *self); typedef GPtrArray *(*TpBaseConnectionCreateChannelManagersImpl) ( TpBaseConnection *self); typedef gchar *(*TpBaseConnectionGetUniqueConnectionNameImpl) ( TpBaseConnection *self); typedef GPtrArray *(*TpBaseConnectionGetInterfacesImpl) ( TpBaseConnection *self); struct _TpBaseConnection { /**/ GObject parent; gchar *_TP_SEAL (bus_name); gchar *_TP_SEAL (object_path); TpConnectionStatus _TP_SEAL (status); TpHandle _TP_SEAL (self_handle); /**/ gpointer _future1; gpointer _future2; gpointer _future3; gpointer _future4; TpBaseConnectionPrivate *priv; }; struct _TpBaseConnectionClass { GObjectClass parent_class; #ifdef __GI_SCANNER__ /**/ GCallback _internal_create_handle_repos; /**/ #else TpBaseConnectionCreateHandleReposImpl create_handle_repos; #endif TpBaseConnectionCreateChannelFactoriesImpl create_channel_factories; TpBaseConnectionGetUniqueConnectionNameImpl get_unique_connection_name; TpBaseConnectionProc connecting; TpBaseConnectionProc connected; TpBaseConnectionProc disconnected; TpBaseConnectionProc shut_down; TpBaseConnectionStartConnectingImpl start_connecting; /**/ const gchar **_TP_SEAL (interfaces_always_present); /**/ TpBaseConnectionCreateChannelManagersImpl create_channel_managers; TpBaseConnectionGetInterfacesImpl get_interfaces_always_present; /**/ gpointer _future3; gpointer _future4; gpointer priv; }; # define TP_INTERNAL_CONNECTION_STATUS_NEW ((TpConnectionStatus)(-1)) GType tp_base_connection_get_type (void); _TP_AVAILABLE_IN_0_20 const gchar *tp_base_connection_get_bus_name (TpBaseConnection *self); _TP_AVAILABLE_IN_0_20 const gchar *tp_base_connection_get_object_path (TpBaseConnection *self); _TP_AVAILABLE_IN_0_20 TpConnectionStatus tp_base_connection_get_status (TpBaseConnection *self); _TP_AVAILABLE_IN_0_20 gboolean tp_base_connection_is_destroyed (TpBaseConnection *self); _TP_AVAILABLE_IN_0_20 gboolean tp_base_connection_check_connected (TpBaseConnection *self, GError **error); TpHandleRepoIface *tp_base_connection_get_handles (TpBaseConnection *self, TpHandleType handle_type); gboolean tp_base_connection_register (TpBaseConnection *self, const gchar *cm_name, gchar **bus_name, gchar **object_path, GError **error); /* FIXME: when dbus-glib exposes its GError -> D-Bus error name mapping, we could also add: void tp_base_connection_disconnect_with_error (TpBaseConnection *self, const GError *error, GHashTable *details, TpConnectionStatusReason reason); */ void tp_base_connection_disconnect_with_dbus_error (TpBaseConnection *self, const gchar *error_name, GHashTable *details, TpConnectionStatusReason reason); void tp_base_connection_disconnect_with_dbus_error_vardict ( TpBaseConnection *self, const gchar *error_name, GVariant *details, TpConnectionStatusReason reason); void tp_base_connection_change_status (TpBaseConnection *self, TpConnectionStatus status, TpConnectionStatusReason reason); TpHandle tp_base_connection_get_self_handle (TpBaseConnection *self); void tp_base_connection_set_self_handle (TpBaseConnection *self, TpHandle self_handle); void tp_base_connection_finish_shutdown (TpBaseConnection *self); void tp_base_connection_add_interfaces (TpBaseConnection *self, const gchar **interfaces); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20 void tp_base_connection_dbus_request_handles (TpSvcConnection *iface, guint handle_type, const gchar **names, DBusGMethodInvocation *context); #endif void tp_base_connection_register_with_contacts_mixin (TpBaseConnection *self); typedef struct _TpChannelManagerIter TpChannelManagerIter; struct _TpChannelManagerIter { /**/ TpBaseConnection *self; guint index; gpointer _future[2]; }; void tp_base_connection_channel_manager_iter_init (TpChannelManagerIter *iter, TpBaseConnection *self); gboolean tp_base_connection_channel_manager_iter_next ( TpChannelManagerIter *iter, TpChannelManager **manager_out); /* TYPE MACROS */ #define TP_TYPE_BASE_CONNECTION \ (tp_base_connection_get_type ()) #define TP_BASE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_CONNECTION, \ TpBaseConnection)) #define TP_BASE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_CONNECTION, \ TpBaseConnectionClass)) #define TP_IS_BASE_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CONNECTION)) #define TP_IS_BASE_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CONNECTION)) #define TP_BASE_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONNECTION, \ TpBaseConnectionClass)) #define TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED(conn, context) \ G_STMT_START { \ TpBaseConnection *c_ = (conn); \ GError *e_ = NULL; \ \ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ if (!tp_base_connection_check_connected (c_, &e_)) \ { \ dbus_g_method_return_error ((context), e_); \ g_error_free (e_); \ return; \ } \ G_GNUC_END_IGNORE_DEPRECATIONS \ } G_STMT_END TpDBusDaemon *tp_base_connection_get_dbus_daemon (TpBaseConnection *self); void tp_base_connection_add_client_interest (TpBaseConnection *self, const gchar *unique_name, const gchar *token, gboolean only_if_uninterested); void tp_base_connection_add_possible_client_interest (TpBaseConnection *self, GQuark token); _TP_AVAILABLE_IN_0_24 const gchar *tp_base_connection_get_account_path_suffix ( TpBaseConnection *self); G_END_DECLS #endif /* #ifndef __TP_BASE_CONNECTION_H__*/ telepathy-glib-0.24.2/telepathy-glib/gtypes.c0000644000175000017500000000662612652510705016040 00000000000000/* * gtypes.c - Specialized GTypes representing D-Bus structs etc. * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include /** * SECTION:gtypes * @title: GType factory functions * @short_description: Macros using caching factory functions to get * dbus-glib specialized GTypes * * dbus-glib's built-in factory functions for specialized GTypes need to do * a fair amount of parsing on their arguments, so these macros are provided * to avoid that. Each macro expands to a call to a function which caches * the GType, so it only ever has to call into dbus-glib once. * * tp_dbus_specialized_value_slice_new() is also provided. * * Since: 0.7.0 */ /** * TP_ARRAY_TYPE_OBJECT_PATH_LIST: * * Expands to a call to a function * that returns the #GType of a #GPtrArray * of DBUS_TYPE_G_OBJECT_PATH. * * Since: 0.7.34 */ GType tp_type_dbus_array_of_o (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", DBUS_TYPE_G_OBJECT_PATH); return t; } /** * tp_dbus_specialized_value_slice_new: * @type: A D-Bus specialized type (i.e. probably a specialized GValueArray * representing a D-Bus struct) * * * * Returns: a slice-allocated GValue containing an empty value of the * given type. */ GValue * tp_dbus_specialized_value_slice_new (GType type) { GValue *value = tp_g_value_slice_new (type); g_value_take_boxed (value, dbus_g_type_specialized_construct (type)); return value; } /** * TP_TYPE_UCHAR_ARRAY: * * Expands to a call to a function * that returns the #GType of a #GArray * of %G_TYPE_UCHAR, i.e. the same thing as %DBUS_TYPE_G_UCHAR_ARRAY * * This is the type used in dbus-glib to represent a byte array, signature * 'ay'. (Note that the #GByteArray type is not used with dbus-glib.) * * Since: 0.11.1 */ GType tp_type_dbus_array_of_y (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = DBUS_TYPE_G_UCHAR_ARRAY; return t; } /** * TP_ARRAY_TYPE_UCHAR_ARRAY_LIST: * * Expands to a call to a function * that returns the #GType of a #GPtrArray of %TP_TYPE_UCHAR_ARRAY, i.e. * a #GPtrArray of #GArray of #guchar. * * This is the type used in dbus-glib to represent an array of byte arrays, * signature 'aay'. (Note that the #GByteArray type is not used with * dbus-glib.) * * Since: 0.11.14 */ GType tp_type_dbus_array_of_ay (void) { static GType t = 0; if (G_UNLIKELY (t == 0)) t = dbus_g_type_get_collection ("GPtrArray", TP_TYPE_UCHAR_ARRAY); return t; } /* auto-generated implementation stubs */ #include "_gen/gtypes-body.h" telepathy-glib-0.24.2/telepathy-glib/gtypes.h0000644000175000017500000000321012652510705016027 00000000000000/* * gtypes.h - Specialized GTypes representing D-Bus structs etc. * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_GTYPES_H__ #define __TP_GTYPES_H__ #include G_BEGIN_DECLS #include #define TP_ARRAY_TYPE_OBJECT_PATH_LIST (tp_type_dbus_array_of_o ()) #define TP_ARRAY_TYPE_UCHAR_ARRAY_LIST (tp_type_dbus_array_of_ay ()) #define TP_TYPE_UCHAR_ARRAY (tp_type_dbus_array_of_y ()) GType tp_type_dbus_array_of_o (void); GType tp_type_dbus_array_of_y (void); GType tp_type_dbus_array_of_ay (void); GValue *tp_dbus_specialized_value_slice_new (GType type); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/call-content.xml0000644000175000017500000000100112652510705017444 00000000000000 Call Content interfaces, version 1 telepathy-glib-0.24.2/telepathy-glib/debug-ansi.h0000644000175000017500000000467712652510705016554 00000000000000/** * SECTION:debug-ansi * @title: ANSI codes for debug messages * @short_description: used to colorize log messages for "clarity" * * This header provides some ANSI escapes you can use to make debug messages * more colourful. Please use sparingly. * * Deprecated: 0.13.3 */ #ifndef __TP_DEBUG_ANSI_H__ #define __TP_DEBUG_ANSI_H__ #ifndef TP_DISABLE_DEPRECATED /** * TP_ANSI_RESET: * * Reset all attributes. * * Deprecated: 0.13.3 */ #define TP_ANSI_RESET "\x1b[0m" /** * TP_ANSI_BOLD_ON: * * Set the bold attribute. * * Deprecated: 0.13.3 */ #define TP_ANSI_BOLD_ON "\x1b[1m" /** * TP_ANSI_INVERSE_ON: * * Set the inverse video attribute. * * Deprecated: 0.13.3 */ #define TP_ANSI_INVERSE_ON "\x1b[7m" /** * TP_ANSI_BOLD_OFF: * * Clear the bold attribute. * * Deprecated: 0.13.3 */ #define TP_ANSI_BOLD_OFF "\x1b[22m" /** * TP_ANSI_FG_BLACK: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_BLACK "\x1b[30m" /** * TP_ANSI_FG_RED: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_RED "\x1b[31m" /** * TP_ANSI_FG_GREEN: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_GREEN "\x1b[32m" /** * TP_ANSI_FG_YELLOW: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_YELLOW "\x1b[33m" /** * TP_ANSI_FG_BLUE: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_BLUE "\x1b[34m" /** * TP_ANSI_FG_MAGENTA: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_MAGENTA "\x1b[35m" /** * TP_ANSI_FG_CYAN: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_CYAN "\x1b[36m" /** * TP_ANSI_FG_WHITE: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_FG_WHITE "\x1b[37m" /** * TP_ANSI_BG_RED: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_RED "\x1b[41m" /** * TP_ANSI_BG_GREEN: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_GREEN "\x1b[42m" /** * TP_ANSI_BG_YELLOW: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_YELLOW "\x1b[43m" /** * TP_ANSI_BG_BLUE: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_BLUE "\x1b[44m" /** * TP_ANSI_BG_MAGENTA: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_MAGENTA "\x1b[45m" /** * TP_ANSI_BG_CYAN: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_CYAN "\x1b[46m" /** * TP_ANSI_BG_WHITE: * * * * Deprecated: 0.13.3 */ #define TP_ANSI_BG_WHITE "\x1b[47m" #endif #endif /* __TP_DEBUG_ANSI_H__ */ telepathy-glib-0.24.2/telepathy-glib/automatic-client-factory-internal.h0000644000175000017500000000411412652510705023241 00000000000000/**/ /* * Internal constructors for TpChannel subclasses * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_AUTOMATIC_CLIENT_FACTORY_INTERNAL_H__ #define __TP_AUTOMATIC_CLIENT_FACTORY_INTERNAL_H__ #include G_BEGIN_DECLS TpTextChannel *_tp_text_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpStreamTubeChannel *_tp_stream_tube_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpDBusTubeChannel *_tp_dbus_tube_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpFileTransferChannel *_tp_file_transfer_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpCallChannel *_tp_call_channel_new_with_factory ( TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/base-client-internal.h0000644000175000017500000000223612652510705020523 00000000000000/**/ /* * Base class for Client implementations * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_BASE_CLIENT_INTERNAL_H__ #define __TP_BASE_CLIENT_INTERNAL_H__ #include G_BEGIN_DECLS void _tp_base_client_set_only_for_account (TpBaseClient *self, TpAccount *account); void _tp_base_client_now_handling_channels (TpBaseClient *self, GPtrArray *channels); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/contact-search-result.c0000644000175000017500000001574112652510705020735 00000000000000/* * contact-search-result.c - a result for a contact search * * Copyright (C) 2010-2011 Collabora Ltd. * * The code contained in this file is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this code; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/contact-search-result.h" #include "telepathy-glib/contact-search-internal.h" #include #include #include #define DEBUG_FLAG TP_DEBUG_CHANNEL #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" #include "_gen/telepathy-interfaces.h" /** * SECTION:contact-search-result * @title: TpContactSearchResult * @short_description: a result of a contact search * @see_also: #TpContactSearch * * #TpContactSearchResult objects represent results for * #TpContactSearch. * * Since: 0.13.11 */ /** * TpContactSearchResultClass: * * The class of a #TpContactSearchResult. * * Since: 0.13.11 */ /** * TpContactSearchResult: * * An object representing the results of a Telepathy contact * search channel. * There are no interesting public struct fields. * * Since: 0.13.11 */ G_DEFINE_TYPE (TpContactSearchResult, tp_contact_search_result, G_TYPE_OBJECT); struct _TpContactSearchResultPrivate { gchar *identifier; /* List of TpContactInfoField. The list and its contents are owned by us. */ GList *fields; }; enum /* properties */ { PROP_0, PROP_IDENTIFIER, }; static gint find_tp_contact_info_field (gconstpointer f, gconstpointer n) { TpContactInfoField *field = (TpContactInfoField *) f; return g_strcmp0 (field->field_name, n); } static void tp_contact_search_result_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { TpContactSearchResult *self = TP_CONTACT_SEARCH_RESULT (object); switch (prop_id) { case PROP_IDENTIFIER: g_assert (self->priv->identifier == NULL); /* construct-only */ self->priv->identifier = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (self, prop_id, pspec); break; } } static void tp_contact_search_result_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { TpContactSearchResult *self = TP_CONTACT_SEARCH_RESULT (object); switch (prop_id) { case PROP_IDENTIFIER: g_value_set_string (value, self->priv->identifier); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void tp_contact_search_result_dispose (GObject *object) { TpContactSearchResult *self = TP_CONTACT_SEARCH_RESULT (object); tp_clear_pointer (&self->priv->identifier, g_free); tp_clear_pointer (&self->priv->fields, tp_contact_info_list_free); G_OBJECT_CLASS (tp_contact_search_result_parent_class)->dispose (object); } static void tp_contact_search_result_class_init (TpContactSearchResultClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->set_property = tp_contact_search_result_set_property; gobject_class->get_property = tp_contact_search_result_get_property; gobject_class->dispose = tp_contact_search_result_dispose; /** * TpContactSearch:identifier: * * The contact identifier. * * Since: 0.13.11 */ g_object_class_install_property (gobject_class, PROP_IDENTIFIER, g_param_spec_string ("identifier", "Identifier", "The contact identifier", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_type_class_add_private (gobject_class, sizeof (TpContactSearchResultPrivate)); } static void tp_contact_search_result_init (TpContactSearchResult *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CONTACT_SEARCH_RESULT, TpContactSearchResultPrivate); } TpContactSearchResult * _tp_contact_search_result_new (const gchar *identifier) { g_return_val_if_fail (identifier != NULL, NULL); return g_object_new (TP_TYPE_CONTACT_SEARCH_RESULT, "identifier", identifier, NULL); } void _tp_contact_search_result_insert_field (TpContactSearchResult *self, TpContactInfoField *field) { g_return_if_fail (TP_IS_CONTACT_SEARCH_RESULT (self)); self->priv->fields = g_list_append (self->priv->fields, field); } /** * tp_contact_search_result_get_identifier: * @self: a #TpContactSearchResult * * * * Returns: the contact identifier. * * Since: 0.13.11 */ const gchar * tp_contact_search_result_get_identifier (TpContactSearchResult *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH_RESULT (self), NULL); return self->priv->identifier; } /** * tp_contact_search_result_get_field: * @self: a #TpContactSearchResult * @field: the name of the field * * * * Returns: (transfer none): the specified field, or %NULL if the * result doesn't have it. * * Since: 0.13.11 */ TpContactInfoField * tp_contact_search_result_get_field (TpContactSearchResult *self, const gchar *field) { GList *l; g_return_val_if_fail (TP_IS_CONTACT_SEARCH_RESULT (self), NULL); l = g_list_find_custom (self->priv->fields, field, find_tp_contact_info_field); return (l ? l->data : NULL); } /** * tp_contact_search_result_get_fields: * @self: a search result * * * * Returns: (transfer container) (element-type TelepathyGLib.ContactInfoField): * a #GList of #TpContactInfoField for the specified contact. You should free * it when you're done with g_list_free(). * Deprecated: Since 0.19.9. New code should use * tp_contact_search_result_dup_fields() instead. */ GList * tp_contact_search_result_get_fields (TpContactSearchResult *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH_RESULT (self), NULL); return g_list_copy (self->priv->fields); } /** * tp_contact_search_result_dup_fields: * @self: a search result * * * * Returns: (transfer full) (element-type TelepathyGLib.ContactInfoField): * a #GList of #TpContactInfoField for the specified contact. You should free * it when you're done with tp_contact_info_list_free(). * Since: 0.19.9 */ GList * tp_contact_search_result_dup_fields (TpContactSearchResult *self) { g_return_val_if_fail (TP_IS_CONTACT_SEARCH_RESULT (self), NULL); return _tp_g_list_copy_deep (self->priv->fields, (GCopyFunc) tp_contact_info_field_copy, NULL); } telepathy-glib-0.24.2/telepathy-glib/contact-search-result.h0000644000175000017500000000603712652510705020740 00000000000000/* * contact-search-result.h - a result from a contact search * * Copyright (C) 2010-2011 Collabora Ltd. * * The code contained in this file is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either version * 2.1 of the License, or (at your option) any later version. * * This file is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this code; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONTACT_SEARCH_RESULT_H__ #define __TP_CONTACT_SEARCH_RESULT_H__ #include #include #include G_BEGIN_DECLS #define TP_TYPE_CONTACT_SEARCH_RESULT \ (tp_contact_search_result_get_type ()) #define TP_CONTACT_SEARCH_RESULT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT_SEARCH_RESULT, \ TpContactSearchResult)) #define TP_CONTACT_SEARCH_RESULT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CONTACT_SEARCH_RESULT, \ TpContactSearchResultClass)) #define TP_IS_CONTACT_SEARCH_RESULT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CONTACT_SEARCH_RESULT)) #define TP_IS_CONTACT_SEARCH_RESULT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CONTACT_SEARCH_RESULT)) #define TP_CONTACT_SEARCH_RESULT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONTACT_SEARCH_RESULT, \ TpContactSearchResultClass)) typedef struct _TpContactSearchResult TpContactSearchResult; typedef struct _TpContactSearchResultPrivate TpContactSearchResultPrivate; typedef struct _TpContactSearchResultClass TpContactSearchResultClass; struct _TpContactSearchResult { /**/ GObject parent; TpContactSearchResultPrivate *priv; }; struct _TpContactSearchResultClass { /**/ GObjectClass parent_class; GCallback _padding[7]; }; GType tp_contact_search_result_get_type (void); const gchar *tp_contact_search_result_get_identifier (TpContactSearchResult *self); TpContactInfoField *tp_contact_search_result_get_field (TpContactSearchResult *self, const gchar *field); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_contact_search_result_dup_fields) GList *tp_contact_search_result_get_fields (TpContactSearchResult *self); #endif _TP_AVAILABLE_IN_0_20 GList *tp_contact_search_result_dup_fields (TpContactSearchResult *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/simple-observer.c0000644000175000017500000003034512652510705017636 00000000000000/* * Simple implementation of an Observer * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION: simple-observer * @title: TpSimpleObserver * @short_description: a subclass of #TpBaseClient implementing * a simple Observer * * This class makes it easier to write #TpSvcClient implementing the * TpSvcClientObserver interface. * * A typical simple observer would look liks this: * |[ * static void * my_observe_channels (TpSimpleObserver *observer, * TpAccount *account, * TpConnection *connection, * GList *channels, * TpChannelDispatchOperation *dispatch_operation, * GList *requests, * TpObserveChannelsContext *context, * gpointer user_data) * { * /* do something useful with the channels here */ * * tp_observe_channels_context_accept (context); * } * * factory = tp_automatic_client_factory_new (dbus); * client = tp_simple_observer_new_with_factory (factory, TRUE, "MyObserver", * FALSE, my_observe_channels, user_data); * g_object_unref (factory); * * tp_base_client_take_observer_filter (client, tp_asv_new ( * TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, * TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, * NULL)); * * tp_base_client_register (client, NULL); * ]| * * See examples/client/media-observer.c for a complete example. */ /** * TpSimpleObserver: * * Data structure representing a simple Observer implementation. * * Since: 0.11.5 */ /** * TpSimpleObserverClass: * * The class of a #TpSimpleObserver. * * Since: 0.11.5 */ /** * TpSimpleObserverObserveChannelsImpl: * @observer: a #TpSimpleObserver instance * @account: a #TpAccount having %TP_ACCOUNT_FEATURE_CORE prepared if possible * @connection: a #TpConnection having %TP_CONNECTION_FEATURE_CORE prepared * if possible * @channels: (element-type TelepathyGLib.Channel): a #GList of #TpChannel, * all having %TP_CHANNEL_FEATURE_CORE prepared if possible * @dispatch_operation: (allow-none): a #TpChannelDispatchOperation or %NULL; * the dispatch_operation is not guaranteed to be prepared * @requests: (element-type TelepathyGLib.ChannelRequest): a #GList of * #TpChannelRequest, all having their object-path defined but are not * guaranteed to be prepared. * @context: a #TpObserveChannelsContext representing the context of this * D-Bus call * @user_data: arbitrary user-supplied data passed to tp_simple_observer_new() * * Signature of the implementation of the ObserveChannels method. * * This function must call either tp_observe_channels_context_accept(), * tp_observe_channels_context_delay() or tp_observe_channels_context_fail() * on @context before it returns. * * Since: 0.11.5 */ #include "config.h" #include "telepathy-glib/simple-observer.h" #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" G_DEFINE_TYPE(TpSimpleObserver, tp_simple_observer, TP_TYPE_BASE_CLIENT) enum { PROP_RECOVER = 1, PROP_CALLBACK, PROP_USER_DATA, PROP_DESTROY, N_PROPS }; struct _TpSimpleObserverPrivate { TpSimpleObserverObserveChannelsImpl callback; gpointer user_data; GDestroyNotify destroy; }; static void tp_simple_observer_init (TpSimpleObserver *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_SIMPLE_OBSERVER, TpSimpleObserverPrivate); } static void tp_simple_observer_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseClient *base = TP_BASE_CLIENT (object); TpSimpleObserver *self = TP_SIMPLE_OBSERVER (object); switch (property_id) { case PROP_RECOVER: tp_base_client_set_observer_recover (base, g_value_get_boolean (value)); break; case PROP_CALLBACK: self->priv->callback = g_value_get_pointer (value); break; case PROP_USER_DATA: self->priv->user_data = g_value_get_pointer (value); break; case PROP_DESTROY: self->priv->destroy = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_simple_observer_constructed (GObject *object) { TpSimpleObserver *self = TP_SIMPLE_OBSERVER (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_simple_observer_parent_class)->constructed; g_assert (self->priv->callback != NULL); if (chain_up != NULL) chain_up (object); } static void tp_simple_observer_dispose (GObject *object) { TpSimpleObserver *self = TP_SIMPLE_OBSERVER (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_simple_observer_parent_class)->dispose; if (self->priv->destroy != NULL) { self->priv->destroy (self->priv->user_data); self->priv->destroy = NULL; } if (dispose != NULL) dispose (object); } static void observe_channels ( TpBaseClient *client, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context) { TpSimpleObserver *self = TP_SIMPLE_OBSERVER (client); self->priv->callback (self, account, connection, channels, dispatch_operation, requests, context, self->priv->user_data); } static void tp_simple_observer_class_init (TpSimpleObserverClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); TpBaseClientClass *base_clt_cls = TP_BASE_CLIENT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpSimpleObserverPrivate)); object_class->set_property = tp_simple_observer_set_property; object_class->constructed = tp_simple_observer_constructed; object_class->dispose = tp_simple_observer_dispose; /** * TpSimpleObserver:recover: * * The value of the Observer.Recover D-Bus property. * * Since: 0.11.5 */ param_spec = g_param_spec_boolean ("recover", "Recover", "Observer.Recover", FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_RECOVER, param_spec); /** * TpSimpleObserver:callback: * * The TpSimpleObserverObserveChannelsImpl callback implementing the * ObserveChannels D-Bus method. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("callback", "Callback", "Function called when ObserveChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALLBACK, param_spec); /** * TpSimpleObserver:user-data: * * The user-data pointer passed to the callback implementing the * ObserveChannels D-Bus method. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("user-data", "user data", "pointer passed as user-data when ObserveChannels is called", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_USER_DATA, param_spec); /** * TpSimpleObserver:destroy: * * The #GDestroyNotify function called to free the user-data pointer when * the #TpSimpleObserver is destroyed. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("destroy", "destroy", "function called to destroy the user-data when destroying the observer", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DESTROY, param_spec); base_clt_cls->observe_channels = observe_channels; } /** * tp_simple_observer_new: * @dbus: a #TpDBusDaemon object, may not be %NULL * @recover: the value of the Observer.Recover D-Bus property * @name: the name of the Observer (see #TpBaseClient:name: for details) * @uniquify: the value of the #TpBaseClient:uniquify-name: property * @callback: the function called when ObserveChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with the user_data as argument, when the #TpSimpleObserver * is destroyed * * Convenient function to create a new #TpSimpleObserver instance. * * If @dbus is not the result of tp_dbus_daemon_dup(), you should call * tp_simple_observer_new_with_am() instead, so that #TpAccount, * #TpConnection and #TpContact instances can be shared between modules. * * Returns: (type TelepathyGLib.SimpleObserver): a new #TpSimpleObserver * * Since: 0.11.5 * Deprecated: New code should use tp_simple_observer_new_with_am() instead. */ TpBaseClient * tp_simple_observer_new (TpDBusDaemon *dbus, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_OBSERVER, "dbus-daemon", dbus, "recover", recover, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_observer_new_with_am: * @account_manager: an account manager, which may not be %NULL * @recover: the value of the Observer.Recover D-Bus property * @name: the name of the Observer (see #TpBaseClient:name: for details) * @uniquify: the value of the #TpBaseClient:uniquify-name: property * @callback: the function called when ObserveChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with the user_data as argument, when the #TpSimpleObserver * is destroyed * * Convenient function to create a new #TpSimpleObserver instance with a * specified #TpAccountManager. * * It is not necessary to prepare any features on @account_manager before * calling this function. * * Returns: (type TelepathyGLib.SimpleObserver): a new #TpSimpleObserver * * Since: 0.11.14 */ TpBaseClient * tp_simple_observer_new_with_am (TpAccountManager *account_manager, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_OBSERVER, "account-manager", account_manager, "recover", recover, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } /** * tp_simple_observer_new_with_factory: * @factory: a #TpSimpleClientFactory, which may not be %NULL * @recover: the value of the Observer.Recover D-Bus property * @name: the name of the Observer (see #TpBaseClient:name: for details) * @uniquify: the value of the #TpBaseClient:uniquify-name: property * @callback: the function called when ObserveChannels is called * @user_data: arbitrary user-supplied data passed to @callback * @destroy: called with the user_data as argument, when the #TpSimpleObserver * is destroyed * * Convenient function to create a new #TpSimpleObserver instance with a * specified #TpSimpleClientFactory. * * Returns: (type TelepathyGLib.SimpleObserver): a new #TpSimpleObserver * * Since: 0.15.5 */ TpBaseClient * tp_simple_observer_new_with_factory (TpSimpleClientFactory *factory, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy) { return g_object_new (TP_TYPE_SIMPLE_OBSERVER, "factory", factory, "recover", recover, "name", name, "uniquify-name", uniquify, "callback", callback, "user-data", user_data, "destroy", destroy, NULL); } telepathy-glib-0.24.2/telepathy-glib/simple-observer.h0000644000175000017500000000710412652510705017640 00000000000000/* * Simple implementation of an Observer * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_SIMPLE_OBSERVER_H__ #define __TP_SIMPLE_OBSERVER_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _TpSimpleObserver TpSimpleObserver; typedef struct _TpSimpleObserverClass TpSimpleObserverClass; typedef struct _TpSimpleObserverPrivate TpSimpleObserverPrivate; struct _TpSimpleObserverClass { /**/ TpBaseClientClass parent_class; GCallback _padding[7]; }; struct _TpSimpleObserver { /**/ TpBaseClient parent; TpSimpleObserverPrivate *priv; }; GType tp_simple_observer_get_type (void); #define TP_TYPE_SIMPLE_OBSERVER \ (tp_simple_observer_get_type ()) #define TP_SIMPLE_OBSERVER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_SIMPLE_OBSERVER, \ TpSimpleObserver)) #define TP_SIMPLE_OBSERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_SIMPLE_OBSERVER, \ TpSimpleObserverClass)) #define TP_IS_SIMPLE_OBSERVER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_SIMPLE_OBSERVER)) #define TP_IS_SIMPLE_OBSERVER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_SIMPLE_OBSERVER)) #define TP_SIMPLE_OBSERVER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_SIMPLE_OBSERVER, \ TpSimpleObserverClass)) typedef void (*TpSimpleObserverObserveChannelsImpl) ( TpSimpleObserver *observer, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context, gpointer user_data); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_observer_new_with_factory) TpBaseClient * tp_simple_observer_new (TpDBusDaemon *dbus, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); #endif TpBaseClient *tp_simple_observer_new_with_am ( TpAccountManager *account_manager, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); _TP_AVAILABLE_IN_0_16 TpBaseClient *tp_simple_observer_new_with_factory ( TpSimpleClientFactory *factory, gboolean recover, const gchar *name, gboolean uniquify, TpSimpleObserverObserveChannelsImpl callback, gpointer user_data, GDestroyNotify destroy); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/handle-repo-dynamic.c0000644000175000017500000005100012652510705020327 00000000000000/* * handle-repo-dynamic.c - mechanism to store and retrieve handles on a * connection (general implementation with dynamic handle allocation and * recycling) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:handle-repo-dynamic * @title: TpDynamicHandleRepo * @short_description: general handle repository implementation, with dynamic * handle allocation and recycling * @see_also: TpHandleRepoIface, TpStaticHandleRepo * * A dynamic handle repository will accept arbitrary handles, which can * be created and destroyed at runtime. * * The #TpHandleRepoIface:handle-type property must be set at construction * time; the #TpDynamicHandleRepo:normalize-function property may be set to * perform validation and normalization on handle ID strings. * * Most connection managers will use this for all supported handle types * except %TP_HANDLE_TYPE_LIST. * * Changed in 0.13.8: handles are no longer reference-counted, and * the reference-count-related functions are stubs. Instead, handles remain * valid until the handle repository is destroyed. */ #include "config.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_HANDLES #include "telepathy-glib/debug-internal.h" /** * TpDynamicHandleRepoNormalizeFunc: * @repo: The repository on which tp_handle_lookup() or tp_handle_ensure() * was called * @id: The name to be normalized * @context: Arbitrary context passed to tp_handle_lookup() or * tp_handle_ensure() * @error: Used to raise the Telepathy error InvalidHandle with an appropriate * message if NULL is returned * * Signature of the normalization function optionally used by * #TpDynamicHandleRepo instances. * * Returns: a normalized version of @id (to be freed with g_free by the * caller), or NULL if @id is not valid for this repository */ /** * TpDynamicHandleRepoNormalizeAsync: * @repo: The repository on which tp_handle_ensure_async() was called * @connection: the #TpBaseConnection using this handle repo * @id: The name to be normalized * @context: Arbitrary context passed to tp_handle_ensure_async() * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Signature of a function to asynchronously normalize an identifier. See * tp_dynamic_handle_repo_set_normalize_async(). * * Since: 0.19.2 */ /** * TpDynamicHandleRepoNormalizeFinish: * @repo: The repository on which tp_handle_ensure_async() was called * @result: a #GAsyncResult * @error: a #GError to fill * * Signature of a function to finish the operation started with * #TpDynamicHandleRepoNormalizeAsync. * * Since: 0.19.2 */ /** * tp_dynamic_handle_repo_new: * @handle_type: The handle type * @normalize_func: The function to be used to normalize and validate handles, * or %NULL to accept all handles as-is * @default_normalize_context: The context pointer to be passed to the * @normalize_func if a %NULL context is passed to tp_handle_lookup() and * tp_handle_ensure(); this may itself be %NULL * * * * Returns: a new dynamic handle repository */ /* Handle private data structure */ typedef struct _TpHandlePriv TpHandlePriv; struct _TpHandlePriv { /* Unique ID */ gchar *string; GData *datalist; }; static const TpHandlePriv empty_priv = { NULL, NULL }; static void handle_priv_init_take_string (TpHandlePriv *priv, gchar *string) { priv->string = string; g_datalist_init (&(priv->datalist)); } static void handle_priv_free_contents (TpHandlePriv *priv) { g_free (priv->string); g_datalist_clear (&(priv->datalist)); } enum { PROP_HANDLE_TYPE = 1, PROP_NORMALIZE_FUNCTION, PROP_DEFAULT_NORMALIZE_CONTEXT, }; /** * TpDynamicHandleRepoClass: * * The class of a dynamic handle repository. The contents of the struct * are private. */ struct _TpDynamicHandleRepoClass { GObjectClass parent_class; }; /** * TpDynamicHandleRepo: * * A dynamic handle repository. The contents of the struct are private. */ struct _TpDynamicHandleRepo { GObject parent; TpHandleType handle_type; /* Array of TpHandlePriv keyed by handle; 0th element is unused */ GArray *handle_to_priv; /* Map contact unique ID -> GUINT_TO_POINTER(handle) */ GHashTable *string_to_handle; /* Normalization function */ TpDynamicHandleRepoNormalizeFunc normalize_function; /* Context for normalization function if NULL is passed to _ensure or * _lookup */ gpointer default_normalize_context; /* Extra data for normalization */ gpointer normalization_data; /* Destructor for extra data */ GDestroyNotify free_normalization_data; /* Async normalization function */ TpDynamicHandleRepoNormalizeAsync normalize_async; TpDynamicHandleRepoNormalizeFinish normalize_finish; }; static void dynamic_repo_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_TYPE_WITH_CODE (TpDynamicHandleRepo, tp_dynamic_handle_repo, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_HANDLE_REPO_IFACE, dynamic_repo_iface_init)) static inline TpHandlePriv * handle_priv_lookup (TpDynamicHandleRepo *repo, TpHandle handle) { if (handle == 0 || handle >= repo->handle_to_priv->len) return NULL; return &g_array_index (repo->handle_to_priv, TpHandlePriv, handle); } static void tp_dynamic_handle_repo_init (TpDynamicHandleRepo *self) { self->handle_to_priv = g_array_new (FALSE, FALSE, sizeof (TpHandlePriv)); /* dummy 0'th entry */ g_array_append_val (self->handle_to_priv, empty_priv); self->string_to_handle = g_hash_table_new (g_str_hash, g_str_equal); } static void dynamic_dispose (GObject *obj) { _tp_dynamic_handle_repo_set_normalization_data ((TpHandleRepoIface *) obj, NULL, NULL); G_OBJECT_CLASS (tp_dynamic_handle_repo_parent_class)->dispose (obj); } static void dynamic_finalize (GObject *obj) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (obj); GObjectClass *parent = G_OBJECT_CLASS (tp_dynamic_handle_repo_parent_class); guint i; g_assert (self->handle_to_priv != NULL); g_assert (self->string_to_handle != NULL); for (i = 0; i < self->handle_to_priv->len; i++) { handle_priv_free_contents (&g_array_index (self->handle_to_priv, TpHandlePriv, i)); } g_array_unref (self->handle_to_priv); g_hash_table_unref (self->string_to_handle); if (parent->finalize) parent->finalize (obj); } static void dynamic_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (object); switch (property_id) { case PROP_HANDLE_TYPE: g_value_set_uint (value, self->handle_type); break; case PROP_NORMALIZE_FUNCTION: g_value_set_pointer (value, self->normalize_function); break; case PROP_DEFAULT_NORMALIZE_CONTEXT: g_value_set_pointer (value, self->default_normalize_context); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void dynamic_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (object); switch (property_id) { case PROP_HANDLE_TYPE: self->handle_type = g_value_get_uint (value); break; case PROP_NORMALIZE_FUNCTION: self->normalize_function = g_value_get_pointer (value); break; case PROP_DEFAULT_NORMALIZE_CONTEXT: self->default_normalize_context = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_dynamic_handle_repo_class_init (TpDynamicHandleRepoClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; object_class->dispose = dynamic_dispose; object_class->finalize = dynamic_finalize; object_class->get_property = dynamic_get_property; object_class->set_property = dynamic_set_property; g_object_class_override_property (object_class, PROP_HANDLE_TYPE, "handle-type"); /** * TpDynamicHandleRepo:normalize-function: * * An optional #TpDynamicHandleRepoNormalizeFunc used to validate and * normalize handle IDs. If %NULL (which is the default), any handle ID is * accepted as-is (equivalent to supplying a pointer to a function that just * calls g_strdup). */ param_spec = g_param_spec_pointer ("normalize-function", "Normalization function", "A TpDynamicHandleRepoNormalizeFunc used to normalize handle IDs.", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_NORMALIZE_FUNCTION, param_spec); /** * TpDynamicHandleRepo:default-normalize-context: * * An optional default context given to the * #TpDynamicHandleRepo:normalize-function if %NULL is passed as context to * the ensure or lookup functions, e.g. when RequestHandle is called via * D-Bus. The default is %NULL. */ param_spec = g_param_spec_pointer ("default-normalize-context", "Default normalization context", "The default context given to the normalize-function if NULL is passed " "as context to the ensure or lookup function, e.g. when RequestHandle" "is called via D-Bus. The default is NULL.", G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DEFAULT_NORMALIZE_CONTEXT, param_spec); } static gboolean dynamic_handle_is_valid (TpHandleRepoIface *irepo, TpHandle handle, GError **error) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (irepo); if (handle_priv_lookup (self, handle) == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "handle %u is not currently a valid %s handle (type %u)", handle, tp_handle_type_to_string (self->handle_type), self->handle_type); return FALSE; } else { return TRUE; } } static gboolean dynamic_handles_are_valid (TpHandleRepoIface *irepo, const GArray *handles, gboolean allow_zero, GError **error) { guint i; g_return_val_if_fail (handles != NULL, FALSE); for (i = 0; i < handles->len; i++) { TpHandle handle = g_array_index (handles, TpHandle, i); if (handle == 0 && allow_zero) continue; if (!dynamic_handle_is_valid (irepo, handle, error)) return FALSE; } return TRUE; } static void dynamic_unref_handle (TpHandleRepoIface *repo G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED) { } static TpHandle dynamic_ref_handle (TpHandleRepoIface *repo G_GNUC_UNUSED, TpHandle handle) { return handle; } static gboolean dynamic_client_hold_handle (TpHandleRepoIface *repo G_GNUC_UNUSED, const gchar *client_name G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } static gboolean dynamic_client_release_handle (TpHandleRepoIface *repo G_GNUC_UNUSED, const gchar *client_name G_GNUC_UNUSED, TpHandle handle G_GNUC_UNUSED, GError **error G_GNUC_UNUSED) { return TRUE; } static const char * dynamic_inspect_handle (TpHandleRepoIface *irepo, TpHandle handle) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (irepo); TpHandlePriv *priv = handle_priv_lookup (self, handle); if (priv == NULL) return NULL; else return priv->string; } /** * tp_dynamic_handle_repo_lookup_exact: * @irepo: The handle repository * @id: The name to be looked up * * Look up a name in the repository, returning the corresponding handle if * it is present in the repository, without creating a new reference. * * Unlike tp_handle_lookup() this function does not perform any normalization; * it just looks for the literal string you requested. This can be useful to * call from normalization callbacks (for instance, Gabble's contacts * repository uses it to see whether we already know that a JID belongs * to a multi-user chat room member). * * Returns: the handle corresponding to the given ID, or 0 if not present */ TpHandle tp_dynamic_handle_repo_lookup_exact (TpHandleRepoIface *irepo, const char *id) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (irepo); return GPOINTER_TO_UINT (g_hash_table_lookup (self->string_to_handle, id)); } static TpHandle dynamic_lookup_handle (TpHandleRepoIface *irepo, const char *id, gpointer context, GError **error) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (irepo); TpHandle handle; gchar *normal_id = NULL; if (context == NULL) context = self->default_normalize_context; if (self->normalize_function) { normal_id = (self->normalize_function) (irepo, id, context, error); if (normal_id == NULL) return 0; id = normal_id; } handle = GPOINTER_TO_UINT (g_hash_table_lookup (self->string_to_handle, id)); if (handle == 0) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "no %s handle (type %u) currently exists for ID \"%s\"", tp_handle_type_to_string (self->handle_type), self->handle_type, id); } g_free (normal_id); return handle; } static TpHandle ensure_handle_take_normalized_id (TpDynamicHandleRepo *self, gchar *normal_id) { TpHandle handle; TpHandlePriv *priv; handle = GPOINTER_TO_UINT (g_hash_table_lookup (self->string_to_handle, normal_id)); if (handle != 0) { g_free (normal_id); return handle; } handle = self->handle_to_priv->len; g_array_append_val (self->handle_to_priv, empty_priv); priv = &g_array_index (self->handle_to_priv, TpHandlePriv, handle); handle_priv_init_take_string (priv, normal_id); g_hash_table_insert (self->string_to_handle, priv->string, GUINT_TO_POINTER (handle)); return handle; } static TpHandle dynamic_ensure_handle (TpHandleRepoIface *irepo, const char *id, gpointer context, GError **error) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (irepo); gchar *normal_id; if (context == NULL) context = self->default_normalize_context; if (self->normalize_function) { normal_id = (self->normalize_function) (irepo, id, context, error); if (normal_id == NULL) return 0; } else { normal_id = g_strdup (id); } return ensure_handle_take_normalized_id (self, normal_id); } static void normalize_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpDynamicHandleRepo *self = (TpDynamicHandleRepo *) source; TpHandleRepoIface *repo = (TpHandleRepoIface *) self; GSimpleAsyncResult *my_result = user_data; gchar *normal_id; GError *error = NULL; normal_id = self->normalize_finish (repo, result, &error); if (normal_id == NULL) { g_simple_async_result_take_error (my_result, error); } else { TpHandle handle; handle = ensure_handle_take_normalized_id (self, normal_id); g_simple_async_result_set_op_res_gpointer (my_result, GUINT_TO_POINTER (handle), NULL); } g_simple_async_result_complete (my_result); g_object_unref (my_result); } static void dynamic_ensure_handle_async (TpHandleRepoIface *repo, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (repo); GSimpleAsyncResult *result; if (self->normalize_async == NULL) { TpHandleRepoIfaceClass *klass; /* Fallback to default implementation */ klass = g_type_default_interface_peek (TP_TYPE_HANDLE_REPO_IFACE); klass->ensure_handle_async (repo, connection, id, context, callback, user_data); return; } if (context == NULL) context = self->default_normalize_context; result = g_simple_async_result_new (G_OBJECT (repo), callback, user_data, dynamic_ensure_handle_async); self->normalize_async (repo, connection, id, context, normalize_cb, result); } static void dynamic_set_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id, gpointer data, GDestroyNotify destroy) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (repo); TpHandlePriv *priv = handle_priv_lookup (self, handle); g_return_if_fail (((void)"invalid handle", priv != NULL)); g_datalist_id_set_data_full (&priv->datalist, key_id, data, destroy); } static gpointer dynamic_get_qdata (TpHandleRepoIface *repo, TpHandle handle, GQuark key_id) { TpDynamicHandleRepo *self = TP_DYNAMIC_HANDLE_REPO (repo); TpHandlePriv *priv = handle_priv_lookup (self, handle); g_return_val_if_fail (((void)"invalid handle", priv != NULL), NULL); return g_datalist_id_get_data (&priv->datalist, key_id); } static void dynamic_repo_iface_init (gpointer g_iface, gpointer iface_data) { TpHandleRepoIfaceClass *klass = (TpHandleRepoIfaceClass *) g_iface; klass->handle_is_valid = dynamic_handle_is_valid; klass->handles_are_valid = dynamic_handles_are_valid; klass->ref_handle = dynamic_ref_handle; klass->unref_handle = dynamic_unref_handle; klass->client_hold_handle = dynamic_client_hold_handle; klass->client_release_handle = dynamic_client_release_handle; klass->inspect_handle = dynamic_inspect_handle; klass->lookup_handle = dynamic_lookup_handle; klass->ensure_handle = dynamic_ensure_handle; klass->ensure_handle_async = dynamic_ensure_handle_async; klass->set_qdata = dynamic_set_qdata; klass->get_qdata = dynamic_get_qdata; } /* * _tp_dynamic_handle_repo_set_normalization_data: * @irepo: (type TelepathyGLib.DynamicHandleRepo): a #TpDynamicHandleRepo * * Get the normalization data set with * _tp_dynamic_handle_repo_set_normalization_data(). * * Returns: (transfer none): the data */ gpointer _tp_dynamic_handle_repo_get_normalization_data ( TpHandleRepoIface *irepo) { TpDynamicHandleRepo *self = (TpDynamicHandleRepo *) irepo; g_return_val_if_fail (TP_IS_DYNAMIC_HANDLE_REPO (self), NULL); return self->normalization_data; } /* * _tp_dynamic_handle_repo_set_normalization_data: * @irepo: (type TelepathyGLib.DynamicHandleRepo): a #TpDynamicHandleRepo * @data: (allow-none): data to use during normalization * @destroy: (allow-none): destructor for @data, or %NULL * * Attach extra data to a handle repository which can be used during * handle normalization. For instance, this could be a weak reference to * the #TpBaseConnection or a #TpChannelManager. * * The normalization function can retrieve that data using * _tp_dynamic_handle_repo_get_normalization_data(). */ void _tp_dynamic_handle_repo_set_normalization_data (TpHandleRepoIface *irepo, gpointer data, GDestroyNotify destroy) { TpDynamicHandleRepo *self = (TpDynamicHandleRepo *) irepo; g_return_if_fail (TP_IS_DYNAMIC_HANDLE_REPO (self)); if (self->free_normalization_data != NULL) self->free_normalization_data (self->normalization_data); self->normalization_data = data; self->free_normalization_data = destroy; } /** * tp_dynamic_handle_repo_set_normalize_async: * @self: A #TpDynamicHandleRepo * @normalize_async: a #TpDynamicHandleRepoNormalizeAsync * @normalize_finish: a #TpDynamicHandleRepoNormalizeFinish * * Set an asynchronous normalization function. This is to be used if handle * normalization requires a server round-trip. See tp_handle_ensure_async(). * * Since: 0.19.2 */ void tp_dynamic_handle_repo_set_normalize_async (TpDynamicHandleRepo *self, TpDynamicHandleRepoNormalizeAsync normalize_async, TpDynamicHandleRepoNormalizeFinish normalize_finish) { g_return_if_fail (TP_IS_DYNAMIC_HANDLE_REPO (self)); g_return_if_fail (normalize_async != NULL); g_return_if_fail (normalize_finish != NULL); self->normalize_async = normalize_async; self->normalize_finish = normalize_finish; } telepathy-glib-0.24.2/telepathy-glib/handle-repo-dynamic.h0000644000175000017500000000725212652510705020346 00000000000000/* * tp-handle-repo-dynamic.h - mechanism to store and retrieve handles on * a connection - implementation for "normal" dynamically-created handles * * Copyright (C) 2005, 2007 Collabora Ltd. * Copyright (C) 2005, 2007 Nokia Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_HANDLE_REPO_DYNAMIC_H__ #define __TP_HANDLE_REPO_DYNAMIC_H__ #include G_BEGIN_DECLS typedef struct _TpDynamicHandleRepo TpDynamicHandleRepo; typedef struct _TpDynamicHandleRepoClass TpDynamicHandleRepoClass; typedef gchar *(*TpDynamicHandleRepoNormalizeFunc)(TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error); typedef void (*TpDynamicHandleRepoNormalizeAsync) (TpHandleRepoIface *repo, TpBaseConnection *connection, const gchar *id, gpointer context, GAsyncReadyCallback callback, gpointer user_data); typedef gchar * (*TpDynamicHandleRepoNormalizeFinish) (TpHandleRepoIface *repo, GAsyncResult *result, GError **error); GType tp_dynamic_handle_repo_get_type (void); #define TP_TYPE_DYNAMIC_HANDLE_REPO \ (tp_dynamic_handle_repo_get_type ()) #define TP_DYNAMIC_HANDLE_REPO(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_DYNAMIC_HANDLE_REPO,\ TpDynamicHandleRepo)) #define TP_DYNAMIC_HANDLE_REPO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_DYNAMIC_HANDLE_REPO,\ TpDynamicHandleRepo)) #define TP_IS_DYNAMIC_HANDLE_REPO(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_DYNAMIC_HANDLE_REPO)) #define TP_IS_DYNAMIC_HANDLE_REPO_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_DYNAMIC_HANDLE_REPO)) #define TP_DYNAMIC_HANDLE_REPO_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_DYNAMIC_HANDLE_REPO,\ TpDynamicHandleRepoClass)) TpHandle tp_dynamic_handle_repo_lookup_exact (TpHandleRepoIface *irepo, const char *id); static inline /* spacer so gtkdoc documents this function as though not static */ TpHandleRepoIface *tp_dynamic_handle_repo_new (TpHandleType handle_type, TpDynamicHandleRepoNormalizeFunc normalize_func, gpointer default_normalize_context); static inline TpHandleRepoIface * tp_dynamic_handle_repo_new (TpHandleType handle_type, TpDynamicHandleRepoNormalizeFunc normalize_func, gpointer default_normalize_context) { return (TpHandleRepoIface *) g_object_new (TP_TYPE_DYNAMIC_HANDLE_REPO, "handle-type", (guint)handle_type, "normalize-function", (gpointer)normalize_func, "default-normalize-context", default_normalize_context, NULL); } _TP_AVAILABLE_IN_0_20 void tp_dynamic_handle_repo_set_normalize_async (TpDynamicHandleRepo *self, TpDynamicHandleRepoNormalizeAsync normalize_async, TpDynamicHandleRepoNormalizeFinish normalize_finish); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-dispatch-operation-internal.h0000644000175000017500000000231312652510705023534 00000000000000/**/ /* * channel-dispatch-operation-internal.h - proxy for channels awaiting approval * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_CHANNEL_DISPATCH_OPERATION_INTERNAL_H #define TP_CHANNEL_DISPATCH_OPERATION_INTERNAL_H #include G_BEGIN_DECLS void _tp_channel_dispatch_operation_ensure_channels ( TpChannelDispatchOperation *self, GPtrArray *channels); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/connection-contact-info.c0000644000175000017500000004360512652510705021244 00000000000000/* * connection-contact-info.c - proxy for a Telepathy connection * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection.h" #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/util-internal.h" /** * TpContactInfoFieldSpec: * @name: The name of the field; this is the lowercased name of a vCard * field. For example, a field representing a contact's address would be named * "adr". * @parameters: The set of vCard type parameters which may be set on this field. * If this list is empty and the #TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT * flag is not set, any vCard type parameters may be used. The type parameter * names, and any values that are case-insensitive in vCard, MUST be in lower * case. For example, a contact's preferred home address would have parameters * 'type=home' and 'type=pref'. * @flags: Flags describing the behaviour of this field. * @max: Maximum number of instances of this field which may be set. * #G_MAXUINT32 is used to indicate that there is no limit. * * A struct describing a vCard field. * * Since: 0.11.7 */ /** * _tp_contact_info_field_spec_new: * @name: The name of the field; this is the lowercased name of a vCard * field. For example, a field representing a contact's address would be named * "adr". * @parameters: The set of vCard type parameters which may be set on this field. * If this list is empty and the #TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT * flag is not set, any vCard type parameters may be used. The type parameter * names, and any values that are case-insensitive in vCard, MUST be in lower * case. For example, a contact's preferred home address would have parameters * 'type=home' and 'type=pref'. * @flags: Flags describing the behaviour of this field. * @max: Maximum number of instances of this field which may be set. * #G_MAXUINT32 is used to indicate that there is no limit. * * * * Returns: a newly allocated #TpContactInfoFieldSpec, free it with * tp_contact_info_field_spec_free() * Since: 0.11.7 */ TpContactInfoFieldSpec * _tp_contact_info_field_spec_new (const gchar *name, GStrv parameters, TpContactInfoFieldFlags flags, guint max) { TpContactInfoFieldSpec *self; gchar *empty[] = { NULL }; self = g_slice_new0 (TpContactInfoFieldSpec); self->name = g_strdup (name); self->parameters = g_strdupv (parameters ? parameters : empty); self->flags = flags; self->max = max; return self; } /** * tp_contact_info_field_spec_copy: (skip) * @self: a #TpContactInfoFieldSpec * * * * Returns: a newly allocated #TpContactInfoFieldSpec, free it with * tp_contact_info_field_spec_free() * Since: 0.11.7 */ TpContactInfoFieldSpec * tp_contact_info_field_spec_copy (const TpContactInfoFieldSpec *self) { g_return_val_if_fail (self != NULL, NULL); return _tp_contact_info_field_spec_new (self->name, self->parameters, self->flags, self->max); } /** * tp_contact_info_field_spec_free: (skip) * @self: a #TpContactInfoFieldSpec * * Free all memory used by the #TpContactInfoFieldSpec. * * Since: 0.11.7 */ void tp_contact_info_field_spec_free (TpContactInfoFieldSpec *self) { if (self != NULL) { g_free (self->name); g_strfreev (self->parameters); g_slice_free (TpContactInfoFieldSpec, self); } } /** * TP_TYPE_CONTACT_INFO_FIELD_SPEC: * * The boxed type of a #TpContactInfoFieldSpec. * * Since: 0.11.7 */ G_DEFINE_BOXED_TYPE (TpContactInfoFieldSpec, tp_contact_info_field_spec, tp_contact_info_field_spec_copy, tp_contact_info_field_spec_free) /** * tp_contact_info_spec_list_copy: (skip) * @list: a #GList of #TpContactInfoFieldSpec * * * * Returns: a new #GList of newly allocated #TpContactInfoFieldSpec, * free it with tp_contact_info_spec_list_free() * Since: 0.11.7 */ GList * tp_contact_info_spec_list_copy (GList *list) { return _tp_g_list_copy_deep (list, (GCopyFunc) tp_contact_info_field_spec_copy, NULL); } /** * tp_contact_info_spec_list_free: (skip) * @list: a #GList of #TpContactInfoFieldSpec * * Free all memory used by the #GList and its elements. * * Since: 0.11.7 */ void tp_contact_info_spec_list_free (GList *list) { g_list_free_full (list, (GDestroyNotify) tp_contact_info_field_spec_free); } /** * TP_TYPE_CONTACT_INFO_SPEC_LIST: * * The boxed type of a #GList of #TpContactInfoFieldSpec. * * Since: 0.11.7 */ G_DEFINE_BOXED_TYPE (TpContactInfoSpecList, tp_contact_info_spec_list, tp_contact_info_spec_list_copy, tp_contact_info_spec_list_free) /** * TpContactInfoField: * @field_name: The name of the field; this is the lowercased name of a vCard * field. For example, a field representing a contact's address would be named * "adr". * @parameters: A list of vCard type parameters applicable to this field, * with their values. The type parameter names, and any values that are * case-insensitive in vCard, MUST be in lower case. For example, a contact's * preferred home address would have parameters 'type=home' and 'type=pref'. * @field_value: For unstructured vCard fields (such as 'fn', a formatted name * field), a single-element array containing the field's value. For structured * fields (such as 'adr', an address field), an array corresponding to the * semicolon-separated elements of the field (with empty strings for empty * elements). * * A structure representing an information about a contact. Similar to a vCard * field. * * Since: 0.11.7 */ /** * tp_contact_info_field_new: * @field_name: The name of the field; this is the lowercased name of a vCard * field. For example, a field representing a contact's address would be named * "adr". * @parameters: A list of vCard type parameters applicable to this field, * with their values. The type parameter names, and any values that are * case-insensitive in vCard, MUST be in lower case. For example, a contact's * preferred home address would have parameters 'type=home' and 'type=pref'. * @field_value: For unstructured vCard fields (such as 'fn', a formatted name * field), a single-element array containing the field's value. For structured * fields (such as 'adr', an address field), an array corresponding to the * semicolon-separated elements of the field (with empty strings for empty * elements). * * * * Returns: a newly allocated #TpContactInfoField, free it with * tp_contact_info_field_free() * Since: 0.11.7 */ TpContactInfoField * tp_contact_info_field_new (const gchar *field_name, GStrv parameters, GStrv field_value) { TpContactInfoField *self; gchar *empty[] = { NULL }; self = g_slice_new0 (TpContactInfoField); self->field_name = g_strdup (field_name); self->parameters = g_strdupv (parameters ? parameters : empty); self->field_value = g_strdupv (field_value ? field_value : empty); return self; } /** * tp_contact_info_field_copy: (skip) * @self: a #TpContactInfoField * * * * Returns: a newly allocated #TpContactInfoField, free it with * tp_contact_info_field_free() * Since: 0.11.7 */ TpContactInfoField * tp_contact_info_field_copy (const TpContactInfoField *self) { g_return_val_if_fail (self != NULL, NULL); return tp_contact_info_field_new (self->field_name, self->parameters, self->field_value); } /** * tp_contact_info_field_free: (skip) * @self: a #TpContactInfoField * * Free all memory used by the #TpContactInfoField. * * Since: 0.11.7 */ void tp_contact_info_field_free (TpContactInfoField *self) { if (self != NULL) { g_free (self->field_name); g_strfreev (self->parameters); g_strfreev (self->field_value); g_slice_free (TpContactInfoField, self); } } /** * TP_TYPE_CONTACT_INFO_FIELD: * * The boxed type of a #TpContactInfoField. * * Since: 0.11.7 */ G_DEFINE_BOXED_TYPE (TpContactInfoField, tp_contact_info_field, tp_contact_info_field_copy, tp_contact_info_field_free) /** * tp_contact_info_list_copy: (skip) * @list: a #GList of #TpContactInfoField * * * * Returns: a new #GList of newly allocated #TpContactInfoField, free it with * tp_contact_info_list_free() * Since: 0.11.7 */ GList * tp_contact_info_list_copy (GList *list) { return _tp_g_list_copy_deep (list, (GCopyFunc) tp_contact_info_field_copy, NULL); } /** * tp_contact_info_list_free: (skip) * @list: a #GList of #TpContactInfoField * * Free all memory used by the #GList and its elements. * * Since: 0.11.7 */ void tp_contact_info_list_free (GList *list) { g_list_free_full (list, (GDestroyNotify) tp_contact_info_field_free); } /** * TP_TYPE_CONTACT_INFO_LIST: * * The boxed type of a #GList of #TpContactInfoField. * * Since: 0.11.7 */ G_DEFINE_BOXED_TYPE (TpContactInfoList, tp_contact_info_list, tp_contact_info_list_copy, tp_contact_info_list_free) /** * TP_CONNECTION_FEATURE_CONTACT_INFO: * * Expands to a call to a function that returns a #GQuark representing the * "contact-info" feature. * * When this feature is prepared, the ContactInfoFlags and SupportedFields of * the Connection has been retrieved. Use tp_connection_get_contact_info_flags() * and tp_connection_dup_contact_info_supported_fields() to get them once * prepared. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.7 */ GQuark tp_connection_get_feature_quark_contact_info (void) { return g_quark_from_static_string ("tp-connection-feature-contact-info"); } static void tp_connection_get_contact_info_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; GPtrArray *specs; gboolean valid; guint i; if (error != NULL) { DEBUG ("Failed to get contact info properties: %s", error->message); g_simple_async_result_set_from_error (result, error); goto finally; } g_assert (self->priv->contact_info_supported_fields == NULL); self->priv->contact_info_flags = tp_asv_get_uint32 (properties, "ContactInfoFlags", &valid); specs = tp_asv_get_boxed (properties, "SupportedFields", TP_ARRAY_TYPE_FIELD_SPECS); if (!valid || specs == NULL) { DEBUG ("Some properties are missing on the ContactInfo interface"); g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_CONFUSED, "Some properties are missing on the ContactInfo interface"); goto finally; } DEBUG ("CONTACT INFO ready"); for (i = 0; i < specs->len; i++) { GValueArray *va = g_ptr_array_index (specs, i); const gchar *name; GStrv parameters; TpContactInfoFieldFlags flags; guint max; tp_value_array_unpack (va, 4, &name, ¶meters, &flags, &max); self->priv->contact_info_supported_fields = g_list_prepend ( self->priv->contact_info_supported_fields, _tp_contact_info_field_spec_new (name, parameters, flags, max)); } finally: g_simple_async_result_complete_in_idle (result); } void _tp_connection_prepare_contact_info_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, _tp_connection_prepare_contact_info_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_INFO, tp_connection_get_contact_info_cb, result, g_object_unref, NULL); } /** * tp_connection_get_contact_info_flags: * @self: a connection * * Returns the flags describing how contact info (vCards) behaves on this * connection * * To wait for valid contact info flags, call tp_proxy_prepare_async() * with the feature %TP_CONNECTION_FEATURE_CONTACT_INFO. * * This property cannot change after @self goes to the Connected state. * * Returns: a set of #TpContactInfoFlags * Since: 0.11.7 */ TpContactInfoFlags tp_connection_get_contact_info_flags (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), 0); return self->priv->contact_info_flags; } /** * tp_connection_get_contact_info_supported_fields: * @self: a connection * * Returns a newly allocated #GList of supported contact info fields for this * connection. The list must be freed with g_list_free() after used. * * Note that the #TpContactInfoFieldSpecs in the returned #GList are not * dupped before returning from this function. One could copy every item in the * list using tp_contact_info_field_spec_copy(). * * To wait for valid supported fields, call tp_proxy_prepare_async() with the * feature %TP_CONNECTION_FEATURE_CONTACT_INFO. * * This property cannot change after @self goes to the Connected state. * * Returns: (element-type TelepathyGLib.ContactInfoFieldSpec) (transfer container): * a #GList of #TpContactInfoFieldSpec struct, or %NULL if the feature is not * yet prepared or the connection doesn't have the necessary properties. * Since: 0.11.7 * Deprecated: Since 0.19.9. New code should use * tp_connection_dup_contact_info_supported_fields() instead. */ GList * tp_connection_get_contact_info_supported_fields (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return g_list_copy (self->priv->contact_info_supported_fields); } /** * tp_connection_dup_contact_info_supported_fields: * @self: a connection * * Returns a newly allocated #GList of supported contact info fields for this * connection. The list must be freed with tp_contact_info_spec_list_free(). * * To wait for valid supported fields, call tp_proxy_prepare_async() with the * feature %TP_CONNECTION_FEATURE_CONTACT_INFO. * * This property cannot change after @self goes to the Connected state. * * Returns: (element-type TelepathyGLib.ContactInfoFieldSpec) (transfer full): * a #GList of #TpContactInfoFieldSpec struct, or %NULL if the feature is not * yet prepared or the connection doesn't have the necessary properties. * Since: 0.19.9 */ GList * tp_connection_dup_contact_info_supported_fields (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return _tp_g_list_copy_deep (self->priv->contact_info_supported_fields, (GCopyFunc) tp_contact_info_field_spec_copy, NULL); } static void set_info_cb (TpConnection *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Failed to set ContactInfo: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete (result); } /** * tp_connection_set_contact_info_async: * @self: a #TpConnection * @info: (element-type TelepathyGLib.ContactInfoField): a #GList of * #TpContactInfoField * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Requests an asynchronous set of the contact info of @self. When * the operation is finished, @callback will be called. You can then call * tp_connection_set_contact_info_finish() to get the result of the operation. * * This method should not be expected to succeed if the result of * tp_connection_get_contact_info_flags() does not include * %TP_CONTACT_INFO_FLAG_CAN_SET. * Since: 0.11.7 */ void tp_connection_set_contact_info_async (TpConnection *self, GList *info, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GPtrArray *contact_info; g_return_if_fail (TP_IS_CONNECTION (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_connection_set_contact_info_finish); contact_info = g_ptr_array_new (); while (info != NULL) { TpContactInfoField *field = info->data; GValueArray *va; va = tp_value_array_build (3, G_TYPE_STRING, field->field_name, G_TYPE_STRV, field->parameters, G_TYPE_STRV, field->field_value, G_TYPE_INVALID); g_ptr_array_add (contact_info, va); info = info->next; } tp_cli_connection_interface_contact_info_call_set_contact_info (self, -1, contact_info, set_info_cb, result, g_object_unref, NULL); g_ptr_array_foreach (contact_info, (GFunc) tp_value_array_free, NULL); g_ptr_array_unref (contact_info); } /** * tp_connection_set_contact_info_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to be filled * * Finishes an async set of @self info. * * Returns: %TRUE if the request call was successful, otherwise %FALSE * * Since: 0.11.7 */ gboolean tp_connection_set_contact_info_finish (TpConnection *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_connection_set_contact_info_finish); } telepathy-glib-0.24.2/telepathy-glib/message.c0000644000175000017500000007760412652510705016155 00000000000000/* * message.c - Source for TpMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:message * @title: TpMessage * @short_description: a message in the Telepathy message interface * @see_also: #TpCMMessage, #TpClientMessage, #TpSignalledMessage * * #TpMessage represent a message send or received using the Message * interface. * * Since: 0.7.21 */ #include "config.h" #include "message.h" #include "message-internal.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_MISC #include "telepathy-glib/debug-internal.h" G_DEFINE_TYPE (TpMessage, tp_message, G_TYPE_OBJECT) /** * TpMessage: * * Opaque structure representing a message in the Telepathy messages interface * (an array of at least one mapping from string to variant, where the first * mapping contains message headers and subsequent mappings contain the * message body). * * This base class provides convenience API for most of the common keys that * can appear in the header. One notable exception is the sender of the * message. Inside a connection manager, messages are represented by the * #TpCMMessage subclass, and you should use tp_cm_message_get_sender(). * When composing a message in a client using #TpClientMessage, messages do * not have an explicit sender (the sender is automatically the local user). * When a client sees a sent or received message signalled by the connection * manager (represented by #TpSignalledMessage), the message's sender (if any) * can be accessed with tp_signalled_message_get_sender(). */ struct _TpMessagePrivate { gboolean mutable; }; static void tp_message_dispose (GObject *object) { TpMessage *self = TP_MESSAGE (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_message_parent_class)->dispose; guint i; if (self->parts != NULL) { for (i = 0; i < self->parts->len; i++) { g_hash_table_unref (g_ptr_array_index (self->parts, i)); } g_ptr_array_unref (self->parts); self->parts = NULL; } if (dispose != NULL) dispose (object); } static void tp_message_class_init (TpMessageClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = tp_message_dispose; g_type_class_add_private (gobject_class, sizeof (TpMessagePrivate)); } static void tp_message_init (TpMessage *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_MESSAGE, TpMessagePrivate); /* Message can be modified until _tp_message_set_immutable() is called */ self->priv->mutable = TRUE; /* Create header part */ self->parts = g_ptr_array_sized_new (1); tp_message_append_part (self); } /** * tp_message_new: * @connection: a connection on which to reference handles * @initial_parts: number of parts to create (at least 1) * @size_hint: preallocate space for this many parts (at least @initial_parts) * * * * Returns: a newly allocated message suitable to be passed to * tp_message_mixin_take_received() * * Since: 0.7.21 * Deprecated: since 0.13.9. Use tp_cm_message_new() */ TpMessage * tp_message_new (TpBaseConnection *connection, guint initial_parts, guint size_hint) { g_return_val_if_fail (size_hint >= initial_parts, NULL); return tp_cm_message_new (connection, initial_parts); } /** * tp_message_destroy: * @self: a message * * Since 0.13.9 this function is a simple wrapper around * g_object_unref() * * Since: 0.7.21 */ void tp_message_destroy (TpMessage *self) { g_object_unref (self); } /** * tp_message_count_parts: * @self: a message * * * * Returns: the number of parts in the message, including the headers in * part 0 * * Since: 0.7.21 */ guint tp_message_count_parts (TpMessage *self) { return self->parts->len; } /** * tp_message_peek: * @self: a message * @part: a part number * * * * Returns: (transfer none) (element-type utf8 GObject.Value): * the #GHashTable used to implement the given part, or %NULL if the * part number is out of range. The hash table is only valid as long as the * message is valid and the part is not deleted. * * Since: 0.7.21 */ const GHashTable * tp_message_peek (TpMessage *self, guint part) { if (part >= self->parts->len) return NULL; return g_ptr_array_index (self->parts, part); } /** * tp_message_dup_part: * @self: a message * @part: a part number * * * * Returns: (transfer full): * the current contents of the given part, or %NULL if the part number is * out of range * * Since: 0.19.10 */ GVariant * tp_message_dup_part (TpMessage *self, guint part) { if (part >= self->parts->len) return NULL; return _tp_asv_to_vardict (g_ptr_array_index (self->parts, part)); } /** * tp_message_append_part: * @self: a message * * Append a body part to the message. * * Returns: the part number * * Since: 0.7.21 */ guint tp_message_append_part (TpMessage *self) { g_return_val_if_fail (self->priv->mutable, 0); g_ptr_array_add (self->parts, g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free)); return self->parts->len - 1; } /** * tp_message_delete_part: * @self: a message * @part: a part number, which must be strictly greater than 0, and strictly * less than the number returned by tp_message_count_parts() * * Delete the given body part from the message. * * Since: 0.7.21 */ void tp_message_delete_part (TpMessage *self, guint part) { g_return_if_fail (part < self->parts->len); g_return_if_fail (part > 0); g_return_if_fail (self->priv->mutable); g_hash_table_unref (g_ptr_array_remove_index (self->parts, part)); } /** * tp_message_ref_handle: * @self: a message * @handle_type: a handle type, greater than %TP_HANDLE_TYPE_NONE and less than * %TP_NUM_HANDLE_TYPES * @handle: a handle of the given type * * Reference the given handle until this message is destroyed. * * Since: 0.7.21 * Deprecated: since 0.13.9. Handles are now immortal so there is * no point to ref them. Furthermore, the only handle that should be stored * in a TpMessage is message-sender which should be set using * tp_cm_message_set_sender(). */ void tp_message_ref_handle (TpMessage *self, TpHandleType handle_type, TpHandle handle) { g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (self->priv->mutable); /* Handles are now immortal so we don't have to anything */ } /** * tp_message_delete_key: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * * Remove the given key and its value from the given part. * * Returns: %TRUE if the key previously existed * * Since: 0.7.21 */ gboolean tp_message_delete_key (TpMessage *self, guint part, const gchar *key) { g_return_val_if_fail (part < self->parts->len, FALSE); g_return_val_if_fail (self->priv->mutable, FALSE); return g_hash_table_remove (g_ptr_array_index (self->parts, part), key); } /** * tp_message_set_handle: * @self: a #TpCMMessage * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @handle_type: a handle type * @handle_or_0: a handle of that type, or 0 * * If @handle_or_0 is not zero, reference it with tp_message_ref_handle(). * * Set @key in part @part of @self to have @handle_or_0 as an unsigned integer * value. * * Since 0.13.9 this function has been deprecated in favor or * tp_cm_message_set_sender() as 'message-sender' is the only handle * you can put in a #TpCMMessage. * * Since: 0.7.21 * Deprecated: since 0.13.9. Use tp_cm_message_set_sender() */ void tp_message_set_handle (TpMessage *self, guint part, const gchar *key, TpHandleType handle_type, TpHandle handle_or_0) { g_return_if_fail (TP_IS_CM_MESSAGE (self)); g_return_if_fail (self->priv->mutable); tp_message_set_uint32 (self, part, key, handle_or_0); } /** * tp_message_set_boolean: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @b: a boolean value * * Set @key in part @part of @self to have @b as a boolean value. * * Since: 0.7.21 */ void tp_message_set_boolean (TpMessage *self, guint part, const gchar *key, gboolean b) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_boolean (b)); } /** * tp_message_set_int16: * @s: a message * @p: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @k: a key in the mapping representing the part * @i: an integer value * * Set @key in part @part of @self to have @i as a signed integer value. * * Since: 0.7.21 */ /** * tp_message_set_int32: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @i: an integer value * * Set @key in part @part of @self to have @i as a signed integer value. * * Since: 0.7.21 */ void tp_message_set_int32 (TpMessage *self, guint part, const gchar *key, gint32 i) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_int (i)); } /** * tp_message_set_int64: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @i: an integer value * * Set @key in part @part of @self to have @i as a signed integer value. * * Since: 0.7.21 */ void tp_message_set_int64 (TpMessage *self, guint part, const gchar *key, gint64 i) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_int64 (i)); } /** * tp_message_set_uint16: * @s: a message * @p: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @k: a key in the mapping representing the part * @u: an unsigned integer value * * Set @key in part @part of @self to have @u as an unsigned integer value. * * Since: 0.7.21 */ /** * tp_message_set_uint32: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @u: an unsigned integer value * * Set @key in part @part of @self to have @u as an unsigned integer value. * * Since: 0.7.21 */ void tp_message_set_uint32 (TpMessage *self, guint part, const gchar *key, guint32 u) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_uint (u)); } /** * tp_message_set_uint64: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @u: an unsigned integer value * * Set @key in part @part of @self to have @u as an unsigned integer value. * * Since: 0.7.21 */ void tp_message_set_uint64 (TpMessage *self, guint part, const gchar *key, guint64 u) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_uint64 (u)); } /** * tp_message_set_string: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @s: a string value * * Set @key in part @part of @self to have @s as a string value. * * Since: 0.7.21 */ void tp_message_set_string (TpMessage *self, guint part, const gchar *key, const gchar *s) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (s != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_string (s)); } /** * tp_message_set_string_printf: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @fmt: a printf-style format string for the string value * @...: arguments for the format string * * Set @key in part @part of @self to have a string value constructed from a * printf-style format string. * * Since: 0.7.21 */ void tp_message_set_string_printf (TpMessage *self, guint part, const gchar *key, const gchar *fmt, ...) { va_list va; gchar *s; g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (fmt != NULL); g_return_if_fail (self->priv->mutable); va_start (va, fmt); s = g_strdup_vprintf (fmt, va); va_end (va); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_take_string (s)); } /** * tp_message_set_bytes: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @len: a number of bytes * @bytes: an array of @len bytes * * Set @key in part @part of @self to have @bytes as a byte-array value. * * Since: 0.7.21 */ void tp_message_set_bytes (TpMessage *self, guint part, const gchar *key, guint len, gconstpointer bytes) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (bytes != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_new_bytes (len, bytes)); } /** * tp_message_set: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @source: a value, encoded as dbus-glib would * * Set @key in part @part of @self to have a copy of @source as its value. * * If @source represents a data structure containing handles, they should * all be referenced with tp_message_ref_handle() first. * * In high-level language bindings, use tp_message_set_variant() instead. * * Since: 0.7.21 */ void tp_message_set (TpMessage *self, guint part, const gchar *key, const GValue *source) { g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (source != NULL); g_return_if_fail (self->priv->mutable); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), tp_g_value_slice_dup (source)); } /** * tp_message_set_variant: * @self: a message * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @value: a value * * Set @key in part @part of @self to have @value as its value. * * If @value is a floating reference (see g_variant_ref_sink()), then this * function will take ownership of it. * * Since: 0.19.10 */ void tp_message_set_variant (TpMessage *self, guint part, const gchar *key, GVariant *value) { GValue *gvalue; g_return_if_fail (part < self->parts->len); g_return_if_fail (key != NULL); g_return_if_fail (value != NULL); g_return_if_fail (self->priv->mutable); g_variant_ref_sink (value); gvalue = g_slice_new0 (GValue); dbus_g_value_parse_g_variant (value, gvalue); g_variant_unref (value); g_hash_table_insert (g_ptr_array_index (self->parts, part), g_strdup (key), gvalue); } /** * tp_message_take_message: * @self: a #TpCMMessage * @part: a part number, which must be strictly less than the number * returned by tp_message_count_parts() * @key: a key in the mapping representing the part * @message: another (distinct) message created for the same #TpBaseConnection * * Set @key in part @part of @self to have @message as an aa{sv} value (that * is, an array of Message_Part), and take ownership of @message. The caller * should not use @message after passing it to this function. All handle * references owned by @message will subsequently belong to and be released * with @self. * * Since: 0.7.21 * Deprecated: since 0.13.9. Use tp_cm_message_take_message() */ void tp_message_take_message (TpMessage *self, guint part, const gchar *key, TpMessage *message) { g_return_if_fail (TP_IS_CM_MESSAGE (self)); tp_cm_message_take_message (self, part, key, message); } static void subtract_from_hash (gpointer key, gpointer value, gpointer user_data) { DEBUG ("... removing %s", (gchar *) key); g_hash_table_remove (user_data, key); } /** * tp_message_to_text: * @message: a #TpMessage * @out_flags: (out) : if not %NULL, the #TpChannelTextMessageFlags of @message * * Concatene all the text parts contained in @message. * * Returns: (transfer full): a newly allocated string containing the * text content of #message * * Since: 0.13.9 */ gchar * tp_message_to_text (TpMessage *message, TpChannelTextMessageFlags *out_flags) { guint i; GHashTable *header = g_ptr_array_index (message->parts, 0); /* Lazily created hash tables, used as a sets: keys are borrowed * "alternative" string values from @parts, value == key. */ /* Alternative IDs for which we have already extracted an alternative */ GHashTable *alternatives_used = NULL; /* Alternative IDs for which we expect to extract text, but have not yet; * cleared if the flag Channel_Text_Message_Flag_Non_Text_Content is set. * At the end, if this contains any item not in alternatives_used, * Channel_Text_Message_Flag_Non_Text_Content must be set. */ GHashTable *alternatives_needed = NULL; GString *buffer = g_string_new (""); TpChannelTextMessageFlags flags = 0; if (tp_asv_get_boolean (header, "scrollback", NULL)) flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_SCROLLBACK; if (tp_asv_get_boolean (header, "rescued", NULL)) flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_RESCUED; /* If the message is on an extended interface, is a delivery report, or only * contains headers, definitely set the "your client is too old" flag. */ if (message->parts->len <= 1 || tp_asv_get_uint32 (header, "message-type", NULL) == TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT || g_hash_table_lookup (header, "interface") != NULL) { flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; } for (i = 1; i < message->parts->len; i++) { GHashTable *part = g_ptr_array_index (message->parts, i); const gchar *type = tp_asv_get_string (part, "content-type"); const gchar *alternative = tp_asv_get_string (part, "alternative"); /* Renamed to "content-type" in spec 0.17.14 */ if (type == NULL) type = tp_asv_get_string (part, "type"); DEBUG ("Parsing part %u, type %s, alternative %s", i, type, alternative); if (!tp_strdiff (type, "text/plain")) { GValue *value; DEBUG ("... is text/plain"); if (alternative != NULL && alternative[0] != '\0') { if (alternatives_used == NULL) { /* We can't have seen an alternative for this part yet. * However, we need to create the hash table now */ alternatives_used = g_hash_table_new (g_str_hash, g_str_equal); } else if (g_hash_table_lookup (alternatives_used, alternative) != NULL) { /* we've seen a "better" alternative for this part already. * Skip it */ DEBUG ("... already saw a better alternative, skipping it"); continue; } g_hash_table_insert (alternatives_used, (gpointer) alternative, (gpointer) alternative); } value = g_hash_table_lookup (part, "content"); if (value != NULL && G_VALUE_HOLDS_STRING (value)) { DEBUG ("... using its text"); g_string_append (buffer, g_value_get_string (value)); value = g_hash_table_lookup (part, "truncated"); if (value != NULL && (!G_VALUE_HOLDS_BOOLEAN (value) || g_value_get_boolean (value))) { DEBUG ("... appears to have been truncated"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_TRUNCATED; } } else { /* There was a text/plain part we couldn't parse: * that counts as "non-text content" I think */ DEBUG ("... didn't understand it, setting NON_TEXT_CONTENT"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; tp_clear_pointer (&alternatives_needed, g_hash_table_unref); } } else if ((flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT) == 0) { DEBUG ("... wondering whether this is NON_TEXT_CONTENT?"); if (tp_str_empty (alternative)) { /* This part can't possibly have a text alternative, since it * isn't part of a multipart/alternative group * (attached image or something, perhaps) */ DEBUG ("... ... yes, no possibility of a text alternative"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; tp_clear_pointer (&alternatives_needed, g_hash_table_unref); } else if (alternatives_used != NULL && g_hash_table_lookup (alternatives_used, (gpointer) alternative) != NULL) { DEBUG ("... ... no, we already saw a text alternative"); } else { /* This part might have a text alternative later, if we're * lucky */ if (alternatives_needed == NULL) alternatives_needed = g_hash_table_new (g_str_hash, g_str_equal); DEBUG ("... ... perhaps, but might have text alternative later"); g_hash_table_insert (alternatives_needed, (gpointer) alternative, (gpointer) alternative); } } } if ((flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT) == 0 && alternatives_needed != NULL) { if (alternatives_used != NULL) g_hash_table_foreach (alternatives_used, subtract_from_hash, alternatives_needed); if (g_hash_table_size (alternatives_needed) > 0) flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; } if (alternatives_needed != NULL) g_hash_table_unref (alternatives_needed); if (alternatives_used != NULL) g_hash_table_unref (alternatives_used); if (out_flags != NULL) { *out_flags = flags; } return g_string_free (buffer, FALSE); } void _tp_message_set_immutable (TpMessage *self) { self->priv->mutable = FALSE; } /** * tp_message_is_mutable: * @self: a #TpMessage * * Check if @self is mutable. Only mutable messages can be modified using * functions such as tp_message_set_string(). * * Returns: %TRUE if the message is mutable. * * Since: 0.13.9 */ gboolean tp_message_is_mutable (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), FALSE); return self->priv->mutable; } /** * tp_message_get_token: * @self: a message * * Return this message's identifier in the underlying protocol. This is * not guaranteed to be unique, even within the scope * of a single channel or contact: the only guarantee made is that two * messages with different non-empty tokens are different messages. * * If there is no suitable token, return %NULL. * * Returns: (transfer none): a non-empty opaque identifier, or %NULL if none * * Since: 0.13.9 */ const gchar * tp_message_get_token (TpMessage *self) { const gchar *token; g_return_val_if_fail (TP_IS_MESSAGE (self), NULL); token = tp_asv_get_string (tp_message_peek (self, 0), "message-token"); if (tp_str_empty (token)) return NULL; else return token; } /** * tp_message_get_message_type: * @self: a message * * * * Returns: the type of this message * * Since: 0.13.10 */ TpChannelTextMessageType tp_message_get_message_type (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL); /* if message-type is absent or invalid we just return 0, which is NORMAL */ return tp_asv_get_uint32 (tp_message_peek (self, 0), "message-type", NULL); } /** * tp_message_get_sent_timestamp: * @self: a message * * Return when this message was sent, as a number of seconds since the * beginning of 1970 in the UTC timezone (the same representation used by * g_date_time_new_from_unix_utc(), for instance), or 0 if not known. * * If this protocol does not track the time at which the message was * initially sent, this timestamp might be approximated by using the * time at which it arrived at a central server. * * Returns: a Unix timestamp, or 0 * * Since: 0.13.9 */ gint64 tp_message_get_sent_timestamp (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), 0); return tp_asv_get_int64 (tp_message_peek (self, 0), "message-sent", NULL); } /** * tp_message_get_received_timestamp: * @self: a message * * Return when this message was received locally, as a number of seconds since * the beginning of 1970 in the UTC timezone (the same representation used by * g_date_time_new_from_unix_utc(), for instance), or 0 if not known. * * Returns: a Unix timestamp, or 0 * * Since: 0.13.9 */ gint64 tp_message_get_received_timestamp (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), 0); return tp_asv_get_int64 (tp_message_peek (self, 0), "message-received", NULL); } /** * tp_message_is_scrollback: * @self: a message * * * * Returns: %TRUE if this message is part of a replay of message history, for * instance in an XMPP chatroom. * * Since: 0.13.9 */ gboolean tp_message_is_scrollback (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), FALSE); return tp_asv_get_boolean (tp_message_peek (self, 0), "scrollback", NULL); } /** * tp_message_is_rescued: * @self: a message * * Returns %TRUE if this incoming message has been seen in a previous channel * during the lifetime of the Connection, but had not been acknowledged when * that channel closed, causing an identical channel (in which the message now * appears) to open. * * Loggers should check this flag to avoid duplicating messages, for instance. * * Returns: %TRUE if this message was seen in a previous Channel on this * Connection * * Since: 0.13.9 */ gboolean tp_message_is_rescued (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), FALSE); return tp_asv_get_boolean (tp_message_peek (self, 0), "rescued", NULL); } /** * tp_message_get_supersedes: * @self: a message * * If this message replaces a previous message, return the value of * tp_message_get_token() for that previous message. Otherwise, return %NULL. * * For instance, a user interface could replace the superseded * message with this message, or grey out the superseded message. * * Returns: (transfer none): a non-empty opaque identifier, or %NULL if none * * Since: 0.13.9 */ const gchar * tp_message_get_supersedes (TpMessage *self) { const gchar *token; g_return_val_if_fail (TP_IS_MESSAGE (self), NULL); token = tp_asv_get_string (tp_message_peek (self, 0), "supersedes"); if (tp_str_empty (token)) return NULL; else return token; } /** * tp_message_get_specific_to_interface: * @self: a message * * If this message is specific to a particular D-Bus interface and should * be ignored by clients without knowledge of that interface, return the * name of the interface. * * If this message is an ordinary message or delivery report, return %NULL. * * Returns: (transfer none): a D-Bus interface name, or %NULL for ordinary * messages and delivery reports * * Since: 0.13.9 */ const gchar * tp_message_get_specific_to_interface (TpMessage *self) { g_return_val_if_fail (TP_IS_MESSAGE (self), NULL); return tp_asv_get_string (tp_message_peek (self, 0), "interface"); } /** * tp_message_is_delivery_report: * @self: a message * * If this message is a delivery report indicating success or failure of * delivering a message, return %TRUE. * * Returns: %TRUE if this is a delivery report * * Since: 0.13.9 */ gboolean tp_message_is_delivery_report (TpMessage *self) { gboolean valid; g_return_val_if_fail (TP_IS_MESSAGE (self), FALSE); tp_asv_get_uint32 (tp_message_peek (self, 0), "delivery-status", &valid); return valid; } /** * tp_message_get_pending_message_id: * @self: a message * @valid: (out): either %NULL, or a location in which to store %TRUE if @self * contains a pending message ID. * * Return the incoming message ID of @self. Only incoming messages have such * ID, for outgoing ones this function returns 0 and set @valid to %FALSE. * * Returns: the incoming message ID. * * Since: 0.15.3 */ guint32 tp_message_get_pending_message_id (TpMessage *self, gboolean *valid) { g_return_val_if_fail (TP_IS_MESSAGE (self), FALSE); return tp_asv_get_uint32 (tp_message_peek (self, 0), "pending-message-id", valid); } /* * Omitted for now: * * sender-nickname - perhaps better done in TpSignalledMessage, so we can use * the TpContact's nickname if the message doesn't specify? * * delivery reporting stuff other than "is this a report?" - later */ telepathy-glib-0.24.2/telepathy-glib/message.h0000644000175000017500000001142412652510705016146 00000000000000/* * message.h - Header for TpMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_MESSAGE_H__ #define __TP_MESSAGE_H__ #include #include #include G_BEGIN_DECLS #define TP_TYPE_MESSAGE (tp_message_get_type ()) #define TP_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_MESSAGE, TpMessage)) #define TP_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_MESSAGE, TpMessageClass)) #define TP_IS_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_MESSAGE)) #define TP_IS_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_MESSAGE)) #define TP_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_MESSAGE, TpMessageClass)) typedef struct _TpMessage TpMessage; typedef struct _TpMessageClass TpMessageClass; GType tp_message_get_type (void); void tp_message_destroy (TpMessage *self); guint tp_message_count_parts (TpMessage *self); const GHashTable *tp_message_peek (TpMessage *self, guint part); _TP_AVAILABLE_IN_0_20 GVariant *tp_message_dup_part (TpMessage *self, guint part); guint tp_message_append_part (TpMessage *self); void tp_message_delete_part (TpMessage *self, guint part); gboolean tp_message_delete_key (TpMessage *self, guint part, const gchar *key); void tp_message_set_boolean (TpMessage *self, guint part, const gchar *key, gboolean b); void tp_message_set_int32 (TpMessage *self, guint part, const gchar *key, gint32 i); #define tp_message_set_int16(s, p, k, i) \ tp_message_set_int32 (s, p, k, (gint16) i) void tp_message_set_int64 (TpMessage *self, guint part, const gchar *key, gint64 i); void tp_message_set_uint32 (TpMessage *self, guint part, const gchar *key, guint32 u); #define tp_message_set_uint16(s, p, k, u) \ tp_message_set_uint32 (s, p, k, (guint16) u) void tp_message_set_uint64 (TpMessage *self, guint part, const gchar *key, guint64 u); void tp_message_set_string (TpMessage *self, guint part, const gchar *key, const gchar *s); void tp_message_set_string_printf (TpMessage *self, guint part, const gchar *key, const gchar *fmt, ...) G_GNUC_PRINTF (4, 5); void tp_message_set_bytes (TpMessage *self, guint part, const gchar *key, guint len, gconstpointer bytes); void tp_message_set (TpMessage *self, guint part, const gchar *key, const GValue *source); _TP_AVAILABLE_IN_0_20 void tp_message_set_variant (TpMessage *self, guint part, const gchar *key, GVariant *value); gchar * tp_message_to_text (TpMessage *message, TpChannelTextMessageFlags *out_flags) G_GNUC_WARN_UNUSED_RESULT; #ifndef TP_DISABLE_DEPRECATED /* Takes a TpCMMessage */ _TP_DEPRECATED_FOR (tp_cm_message_set_sender) void tp_message_set_handle (TpMessage *self, guint part, const gchar *key, TpHandleType handle_type, TpHandle handle_or_0); _TP_DEPRECATED_FOR (tp_cm_message_take_message) void tp_message_take_message (TpMessage *self, guint part, const gchar *key, TpMessage *message); _TP_DEPRECATED_FOR (tp_cm_message_set_sender) void tp_message_ref_handle (TpMessage *self, TpHandleType handle_type, TpHandle handle); #endif gboolean tp_message_is_mutable (TpMessage *self); TpChannelTextMessageType tp_message_get_message_type (TpMessage *self); const gchar *tp_message_get_token (TpMessage *self); gint64 tp_message_get_sent_timestamp (TpMessage *self); gint64 tp_message_get_received_timestamp (TpMessage *self); gboolean tp_message_is_scrollback (TpMessage *self); gboolean tp_message_is_rescued (TpMessage *self); const gchar *tp_message_get_supersedes (TpMessage *self); const gchar *tp_message_get_specific_to_interface (TpMessage *self); gboolean tp_message_is_delivery_report (TpMessage *self); _TP_AVAILABLE_IN_0_16 guint32 tp_message_get_pending_message_id (TpMessage *self, gboolean *valid); G_END_DECLS #endif /* __TP_MESSAGE_H__ */ telepathy-glib-0.24.2/telepathy-glib/handle-channels-context-internal.h0000644000175000017500000000467012652510705023047 00000000000000/**/ /* * object for HandleChannels calls context (internal) * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_HANDLE_CHANNELS_CONTEXT_INTERNAL_H__ #define __TP_HANDLE_CHANNELS_CONTEXT_INTERNAL_H__ #include #include #include G_BEGIN_DECLS typedef enum { TP_HANDLE_CHANNELS_CONTEXT_STATE_NONE, TP_HANDLE_CHANNELS_CONTEXT_STATE_DONE, TP_HANDLE_CHANNELS_CONTEXT_STATE_FAILED, TP_HANDLE_CHANNELS_CONTEXT_STATE_DELAYED, } TpHandleChannelsContextState; struct _TpHandleChannelsContext { /**/ GObject parent; TpHandleChannelsContextPrivate *priv; TpAccount *account; TpConnection *connection; /* array of reffed TpChannel */ GPtrArray *channels; /* array of reffed TpChannelRequest */ GPtrArray *requests_satisfied; guint64 user_action_time; GHashTable *handler_info; }; TpHandleChannelsContext * _tp_handle_channels_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, GPtrArray *requests_satisfied, guint64 user_action_time, GHashTable *handler_info, DBusGMethodInvocation *dbus_context); TpHandleChannelsContextState _tp_handle_channels_context_get_state (TpHandleChannelsContext *self); void _tp_handle_channels_context_prepare_async ( TpHandleChannelsContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_handle_channels_context_prepare_finish ( TpHandleChannelsContext *self, GAsyncResult *result, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/call-stream-endpoint.c0000644000175000017500000007074112652510705020546 00000000000000/* * call-stream-endpoint.c - Source for TpCallStreamEndpoint * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-stream-endpoint * @title: TpCallStreamEndpoint * @short_description: class for #TpSvcCallStreamEndpoint implementations * @see_also: #TpBaseMediaCallStream * * This class makes it easier to write #TpSvcCallStreamEndpoint * implementations by implementing its properties and methods. * * Since: 0.17.5 */ /** * TpCallStreamEndpoint: * * A class for call stream endpoint implementations * * Since: 0.17.5 */ /** * TpCallStreamEndpointClass: * * The class structure for #TpCallStreamEndpoint * * Since: 0.17.5 */ #include "config.h" #include "call-stream-endpoint.h" #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-media-call-channel.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/dbus-properties-mixin.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/enums.h" #include "telepathy-glib/errors.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/util.h" #include "telepathy-glib/util-internal.h" static void call_stream_endpoint_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE(TpCallStreamEndpoint, tp_call_stream_endpoint, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_STREAM_ENDPOINT, call_stream_endpoint_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); ); /* properties */ enum { PROP_OBJECT_PATH = 1, PROP_DBUS_DAEMON, PROP_REMOTE_CREDENTIALS, PROP_REMOTE_CANDIDATES, PROP_SELECTED_CANDIDATE_PAIRS, PROP_ENDPOINT_STATE, PROP_TRANSPORT, PROP_CONTROLLING, PROP_IS_ICE_LITE }; enum /* signals */ { CANDIDATE_SELECTED, CANDIDATE_ACCEPTED, CANDIDATE_REJECTED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; struct _TpCallStreamEndpointPrivate { TpDBusDaemon *dbus_daemon; gchar *object_path; gchar *username; gchar *password; /* GPtrArray of owned #GValueArray (dbus struct) */ GPtrArray *remote_candidates; /* GPtrArray of owned #GValueArray (dbus struct) */ GPtrArray *selected_candidate_pairs; /* TpStreamComponent -> TpStreamEndpointState map */ GHashTable *endpoint_state; TpStreamTransportType transport; gboolean controlling; gboolean is_ice_lite; /* borrowed */ TpBaseMediaCallStream *stream; }; static void tp_call_stream_endpoint_init (TpCallStreamEndpoint *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CALL_STREAM_ENDPOINT, TpCallStreamEndpointPrivate); self->priv->username = g_strdup (""); self->priv->password = g_strdup (""); self->priv->remote_candidates = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); self->priv->selected_candidate_pairs = g_ptr_array_new_with_free_func ( (GDestroyNotify) tp_value_array_free); self->priv->endpoint_state = g_hash_table_new (NULL, NULL); } static void tp_call_stream_endpoint_constructed (GObject *obj) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (obj); /* register object on the bus */ DEBUG ("Registering %s", self->priv->object_path); tp_dbus_daemon_register_object (self->priv->dbus_daemon, self->priv->object_path, obj); if (G_OBJECT_CLASS (tp_call_stream_endpoint_parent_class)->constructed != NULL) G_OBJECT_CLASS (tp_call_stream_endpoint_parent_class)->constructed (obj); } static void tp_call_stream_endpoint_dispose (GObject *object) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (object); tp_dbus_daemon_unregister_object (self->priv->dbus_daemon, G_OBJECT (self)); g_clear_object (&self->priv->dbus_daemon); if (G_OBJECT_CLASS (tp_call_stream_endpoint_parent_class)->dispose) G_OBJECT_CLASS (tp_call_stream_endpoint_parent_class)->dispose (object); } static void tp_call_stream_endpoint_finalize (GObject *object) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (object); tp_clear_pointer (&self->priv->object_path, g_free); tp_clear_pointer (&self->priv->username, g_free); tp_clear_pointer (&self->priv->password, g_free); tp_clear_pointer (&self->priv->remote_candidates, g_ptr_array_unref); tp_clear_pointer (&self->priv->selected_candidate_pairs, g_ptr_array_unref); tp_clear_pointer (&self->priv->endpoint_state, g_hash_table_unref); G_OBJECT_CLASS (tp_call_stream_endpoint_parent_class)->finalize (object); } static void tp_call_stream_endpoint_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (object); switch (property_id) { case PROP_OBJECT_PATH: g_value_set_string (value, self->priv->object_path); break; case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus_daemon); break; case PROP_REMOTE_CREDENTIALS: { GValueArray *remote_credentials; remote_credentials = tp_value_array_build (2, G_TYPE_STRING, self->priv->username, G_TYPE_STRING, self->priv->password, G_TYPE_INVALID); g_value_take_boxed (value, remote_credentials); break; } case PROP_REMOTE_CANDIDATES: g_value_set_boxed (value, self->priv->remote_candidates); break; case PROP_SELECTED_CANDIDATE_PAIRS: g_value_set_boxed (value, self->priv->selected_candidate_pairs); break; case PROP_ENDPOINT_STATE: g_value_set_boxed (value, self->priv->endpoint_state); break; case PROP_TRANSPORT: g_value_set_uint (value, self->priv->transport); break; case PROP_CONTROLLING: g_value_set_boolean (value, self->priv->controlling); break; case PROP_IS_ICE_LITE: g_value_set_boolean (value, self->priv->is_ice_lite); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_stream_endpoint_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (object); switch (property_id) { case PROP_OBJECT_PATH: g_assert (self->priv->object_path == NULL); /* construct-only */ self->priv->object_path = g_value_dup_string (value); break; case PROP_DBUS_DAEMON: g_assert (self->priv->dbus_daemon == NULL); /* construct-only */ self->priv->dbus_daemon = g_value_dup_object (value); break; case PROP_TRANSPORT: self->priv->transport = g_value_get_uint (value); break; case PROP_IS_ICE_LITE: self->priv->is_ice_lite = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_call_stream_endpoint_class_init (TpCallStreamEndpointClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl endpoint_props[] = { { "RemoteCredentials", "remote-credentials", NULL }, { "RemoteCandidates", "remote-candidates", NULL }, { "SelectedCandidatePairs", "selected-candidate-pairs", NULL }, { "EndpointState", "endpoint-state", NULL }, { "Transport", "transport", NULL }, { "Controlling", "controlling", NULL }, { "IsICELite", "is-ice-lite", NULL }, { NULL } }; static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = { { TP_IFACE_CALL_STREAM_ENDPOINT, tp_dbus_properties_mixin_getter_gobject_properties, NULL, endpoint_props, }, { NULL } }; g_type_class_add_private (klass, sizeof (TpCallStreamEndpointPrivate)); object_class->dispose = tp_call_stream_endpoint_dispose; object_class->finalize = tp_call_stream_endpoint_finalize; object_class->constructed = tp_call_stream_endpoint_constructed; object_class->set_property = tp_call_stream_endpoint_set_property; object_class->get_property = tp_call_stream_endpoint_get_property; /** * TpCallStreamEndpoint:object-path: * * The D-Bus object path used for this object on the bus. * * Since: 0.17.5 */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path used for this " "object on the bus.", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec); /** * TpCallStreamEndpoint:dbus-daemon: * * The connection to the DBus daemon owning the CM. * * Since: 0.17.5 */ param_spec = g_param_spec_object ("dbus-daemon", "The DBus daemon connection", "The connection to the DBus daemon owning the CM", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, param_spec); /** * TpCallStreamEndpoint:remote-credentials: * * #GValueArray{username string, password string} * The remote credentials of this endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("remote-credentials", "RemoteCredentials", "The remote credentials of this endpoint", TP_STRUCT_TYPE_STREAM_CREDENTIALS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_CREDENTIALS, param_spec); /** * TpCallStreamEndpoint:remote-candidates: * * #GPtrArray{candidate #GValueArray} * The remote candidates of this endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("remote-candidates", "RemoteCandidates", "The remote candidates of this endpoint", TP_ARRAY_TYPE_CANDIDATE_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_CANDIDATES, param_spec); /** * TpCallStreamEndpoint:selected-candidate-pairs: * * #GPtrArray{local-candidate #GValueArray, remote-candidate #GValueArray} * The candidate pairs selected for this endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("selected-candidate-pairs", "SelectedCandidatePairs", "The candidate pairs selected for this endpoint", TP_ARRAY_TYPE_CANDIDATE_PAIR_LIST, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SELECTED_CANDIDATE_PAIRS, param_spec); /** * TpCallStreamEndpoint:endpoint-state: * * #GHashTable{#TpStreamComponent -> #TpStreamEndpointState} * The state of this endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("endpoint-state", "EndpointState", "The state of this endpoint.", TP_HASH_TYPE_COMPONENT_STATE_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ENDPOINT_STATE, param_spec); /** * TpCallStreamEndpoint:transport: * * The #TpStreamTransportType for the content of this endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("transport", "Transport", "The transport type for the content of this endpoint.", 0, G_MAXUINT, TP_STREAM_TRANSPORT_TYPE_UNKNOWN, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TRANSPORT, param_spec); /** * TpCallStreamEndpoint:controlling: * * Whether or not the local side is taking the controlling role. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("controlling", "Controlling", "The local side is taking the controlling role.", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTROLLING, param_spec); /** * TpCallStreamEndpoint:is-ice-lite: * * Whether or not the Remote side is an ICE Lite endpoint. * * Since: 0.17.5 */ param_spec = g_param_spec_boolean ("is-ice-lite", "IsICELite", "The Remote side is an ICE Lite endpoint.", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_IS_ICE_LITE, param_spec); klass->dbus_props_class.interfaces = prop_interfaces; tp_dbus_properties_mixin_class_init (object_class, G_STRUCT_OFFSET (TpCallStreamEndpointClass, dbus_props_class)); /** * TpCallStreamEndpoint::candidate-selected: * @self: the #TpCallStreamEndpoint * @local_candidate: the local candidate * @remote_candidate: the remote candidate * * The ::candidate-selected signal is emitted whenever * SetSelectedCandidatePair DBus method has been called on this object. * * Since: 0.17.5 */ _signals[CANDIDATE_SELECTED] = g_signal_new ("candidate-selected", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_STRUCT_TYPE_CANDIDATE, TP_STRUCT_TYPE_CANDIDATE); /** * TpCallStreamEndpoint::candidate-accepted: * @self: the #TpCallStreamEndpoint * @local_candidate: the local candidate * @remote_candidate: the remote candidate * * The ::candidate-accepted signal is emitted whenever * AcceptSelectedCandidatePair DBus method has been called on this object. * * Since: 0.17.5 */ _signals[CANDIDATE_ACCEPTED] = g_signal_new ("candidate-accepted", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_STRUCT_TYPE_CANDIDATE, TP_STRUCT_TYPE_CANDIDATE); /** * TpCallStreamEndpoint::candidate-rejected: * @self: the #TpCallStreamEndpoint * @local_candidate: the local candidate * @remote_candidate: the remote candidate * * The ::candidate-rejected signal is emitted whenever * RejectSelectedCandidatePair DBus method has been called on this object. * * Since: 0.17.5 */ _signals[CANDIDATE_REJECTED] = g_signal_new ("candidate-rejected", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, TP_STRUCT_TYPE_CANDIDATE, TP_STRUCT_TYPE_CANDIDATE); } /** * tp_call_stream_endpoint_new: * @dbus_daemon: value of #TpCallStreamEndpoint:dbus-daemon property * @object_path: value of #TpCallStreamEndpoint:object-path property * @transport: value of #TpCallStreamEndpoint:transport property * @is_ice_lite: value of #TpCallStreamEndpoint:is_ice_lite property * * Create a new #TpCallStreamEndpoint object. It is registered on the bus * at construction, and is unregistered at dispose. * * Returns: a new #TpCallStreamEndpoint. * Since: 0.17.5 */ TpCallStreamEndpoint * tp_call_stream_endpoint_new (TpDBusDaemon *dbus_daemon, const gchar *object_path, TpStreamTransportType transport, gboolean is_ice_lite) { g_return_val_if_fail (TP_IS_DBUS_DAEMON (dbus_daemon), NULL); g_return_val_if_fail (g_variant_is_object_path (object_path), NULL); return g_object_new (TP_TYPE_CALL_STREAM_ENDPOINT, "dbus-daemon", dbus_daemon, "object-path", object_path, "transport", transport, "is-ice-lite", is_ice_lite, NULL); } /** * tp_call_stream_endpoint_get_object_path: * @self: a #TpCallStreamEndpoint * * * * Returns: the value of #TpCallStreamEndpoint:object-path * Since: 0.17.5 */ const gchar * tp_call_stream_endpoint_get_object_path (TpCallStreamEndpoint *self) { g_return_val_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self), NULL); return self->priv->object_path; } /** * tp_call_stream_endpoint_get_state: * @self: a #TpCallStreamEndpoint * @component: a #TpStreamComponent * * * * Returns: the state of @self's @component * Since: 0.17.5 */ TpStreamEndpointState tp_call_stream_endpoint_get_state (TpCallStreamEndpoint *self, TpStreamComponent component) { g_return_val_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self), TP_STREAM_ENDPOINT_STATE_FAILED); return GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->endpoint_state, GUINT_TO_POINTER (component))); } /** * tp_call_stream_endpoint_add_new_candidates: * @self: a #TpCallStreamEndpoint * @candidates: #GPtrArray of #GValueArray defining the candidates to add * * Add @candidates to the #TpCallStreamEndpoint:remote-candidates property. * See Also: tp_call_stream_endpoint_add_new_candidate(). * * Since: 0.17.5 */ void tp_call_stream_endpoint_add_new_candidates (TpCallStreamEndpoint *self, const GPtrArray *candidates) { guint i; g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self)); if (candidates == NULL || candidates->len == 0) return; DEBUG ("Add %d candidates to endpoint %s", candidates->len, self->priv->object_path); for (i = 0; i < candidates->len; i++) { GValueArray *c = g_ptr_array_index (candidates, i); G_GNUC_BEGIN_IGNORE_DEPRECATIONS g_ptr_array_add (self->priv->remote_candidates, g_value_array_copy (c)); G_GNUC_END_IGNORE_DEPRECATIONS } tp_svc_call_stream_endpoint_emit_remote_candidates_added (self, candidates); } /** * tp_call_stream_endpoint_add_new_candidate: * @self: a #TpCallStreamEndpoint * @component: a #TpStreamComponent * @address: an IP address * @port: a port number * @info_hash: string -> #GValue mapping for extra info * * Add a candidate to the #TpCallStreamEndpoint:remote-candidates property. * See Also: tp_call_stream_endpoint_add_new_candidates(). * * Since: 0.17.5 */ void tp_call_stream_endpoint_add_new_candidate (TpCallStreamEndpoint *self, TpStreamComponent component, const gchar *address, guint port, const GHashTable *info_hash) { GPtrArray *candidates; GValueArray *c; g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self)); g_return_if_fail (address != NULL); g_return_if_fail (port < 65536); g_return_if_fail (info_hash != NULL); DEBUG ("Add one candidates to endpoint %s", self->priv->object_path); c = tp_value_array_build (4, G_TYPE_UINT, component, G_TYPE_STRING, address, G_TYPE_UINT, port, TP_HASH_TYPE_CANDIDATE_INFO, info_hash, G_TYPE_INVALID); g_ptr_array_add (self->priv->remote_candidates, c); candidates = g_ptr_array_new (); g_ptr_array_add (candidates, c); tp_svc_call_stream_endpoint_emit_remote_candidates_added (self, candidates); g_ptr_array_unref (candidates); } /** * tp_call_stream_endpoint_set_remote_credentials: * @self: a #TpCallStreamEndpoint * @username: the username * @password: the password * * Set the username and password to use for @self's crendentials. * * Since: 0.17.5 */ void tp_call_stream_endpoint_set_remote_credentials (TpCallStreamEndpoint *self, const gchar *username, const gchar *password) { g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self)); if (!tp_strdiff (self->priv->username, username) && !tp_strdiff (self->priv->password, password)) return; g_free (self->priv->username); g_free (self->priv->password); self->priv->username = g_strdup (username); self->priv->password = g_strdup (password); tp_svc_call_stream_endpoint_emit_remote_credentials_set (self, username, password); } static gboolean validate_candidate (const GValueArray *candidate, GError **error) { const GValue *value; if (candidate->n_values != 4) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "A candidate should have 4 values, got %d", candidate->n_values); return FALSE; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth ((GValueArray *) candidate, 0); G_GNUC_END_IGNORE_DEPRECATIONS if (g_value_get_uint (value) >= TP_NUM_STREAM_COMPONENTS) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid component id: %d", g_value_get_uint (value)); return FALSE; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth ((GValueArray *) candidate, 1); G_GNUC_END_IGNORE_DEPRECATIONS if (tp_str_empty (g_value_get_string (value))) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid address: %s", g_value_get_string (value)); return FALSE; } G_GNUC_BEGIN_IGNORE_DEPRECATIONS value = g_value_array_get_nth ((GValueArray *) candidate, 2); G_GNUC_END_IGNORE_DEPRECATIONS if (g_value_get_uint (value) > 65535) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid port: %d", g_value_get_uint (value)); return FALSE; } return TRUE; } static TpStreamComponent get_candidate_component (const GValueArray *candidate) { GValue *component_value; G_GNUC_BEGIN_IGNORE_DEPRECATIONS component_value = g_value_array_get_nth ((GValueArray *) candidate, 0); G_GNUC_END_IGNORE_DEPRECATIONS return g_value_get_uint (component_value); } static gboolean common_checks (TpCallStreamEndpoint *self, const GValueArray *local_candidate, const GValueArray *remote_candidate, GError **error) { if (!validate_candidate (local_candidate, error)) return FALSE; if (!validate_candidate (remote_candidate, error)) return FALSE; if (get_candidate_component (local_candidate) != get_candidate_component (remote_candidate)) { g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Component must be the same in local and remote candidate"); return FALSE; } if (!self->priv->controlling) { g_set_error_literal (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Only controlling side can call SetSelectedCandidatePair"); return FALSE; } return TRUE; } static void call_stream_endpoint_set_selected_candidate_pair (TpSvcCallStreamEndpoint *iface, const GValueArray *local_candidate, const GValueArray *remote_candidate, DBusGMethodInvocation *context) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); TpStreamComponent component; GValueArray *pair; guint i; GError *error = NULL; if (!common_checks (self, local_candidate, remote_candidate, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } component = get_candidate_component (local_candidate); DEBUG ("Candidate selected for component %d for endpoint %s", component, self->priv->object_path); /* Remove the pair for that component if we already had one */ for (i = 0; i < self->priv->selected_candidate_pairs->len; i++) { GValueArray *this_pair; TpStreamComponent this_component; this_pair = g_ptr_array_index (self->priv->selected_candidate_pairs, i); G_GNUC_BEGIN_IGNORE_DEPRECATIONS this_component = get_candidate_component ( g_value_get_boxed (g_value_array_get_nth (this_pair, 0))); G_GNUC_END_IGNORE_DEPRECATIONS if (this_component == component) { g_ptr_array_remove_index (self->priv->selected_candidate_pairs, i); break; } } pair = tp_value_array_build (2, TP_STRUCT_TYPE_CANDIDATE, local_candidate, TP_STRUCT_TYPE_CANDIDATE, remote_candidate, G_TYPE_INVALID); g_ptr_array_add (self->priv->selected_candidate_pairs, pair); tp_svc_call_stream_endpoint_emit_candidate_pair_selected (self, local_candidate, remote_candidate); g_signal_emit (self, _signals[CANDIDATE_SELECTED], 0, local_candidate, remote_candidate); tp_svc_call_stream_endpoint_return_from_set_selected_candidate_pair (context); } static void call_stream_endpoint_set_endpoint_state (TpSvcCallStreamEndpoint *iface, TpStreamComponent component, TpStreamEndpointState state, DBusGMethodInvocation *context) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); if (component >= TP_NUM_STREAM_COMPONENTS) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Stream component %d is out of the valid range.", state); dbus_g_method_return_error (context, error); g_error_free (error); return; } if (state >= TP_NUM_STREAM_ENDPOINT_STATES) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Stream state %d is out of the valid range.", state); dbus_g_method_return_error (context, error); g_error_free (error); return; } DEBUG ("State changed to %d for component %d for endpoint %s", state, component, self->priv->object_path); g_hash_table_insert (self->priv->endpoint_state, GUINT_TO_POINTER (component), GUINT_TO_POINTER (state)); g_object_notify (G_OBJECT (self), "endpoint-state"); tp_svc_call_stream_endpoint_emit_endpoint_state_changed (self, component, state); if (component == TP_STREAM_COMPONENT_DATA) { TpBaseCallChannel *chan = _tp_base_call_stream_get_channel ( TP_BASE_CALL_STREAM (self->priv->stream)); if (chan && TP_IS_BASE_MEDIA_CALL_CHANNEL (chan)) _tp_base_media_call_channel_endpoint_state_changed ( TP_BASE_MEDIA_CALL_CHANNEL (chan)); } tp_svc_call_stream_endpoint_return_from_set_endpoint_state (context); } static void call_stream_endpoint_accept_selected_candidate_pair ( TpSvcCallStreamEndpoint *iface, const GValueArray *local_candidate, const GValueArray *remote_candidate, DBusGMethodInvocation *context) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); GError *error = NULL; if (!common_checks (self, local_candidate, remote_candidate, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } DEBUG ("Selected candidate accepted for endpoint %s", self->priv->object_path); g_signal_emit (self, _signals[CANDIDATE_ACCEPTED], 0, local_candidate, remote_candidate); tp_svc_call_stream_endpoint_return_from_accept_selected_candidate_pair ( context); } static void call_stream_endpoint_reject_selected_candidate_pair ( TpSvcCallStreamEndpoint *iface, const GValueArray *local_candidate, const GValueArray *remote_candidate, DBusGMethodInvocation *context) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); GError *error = NULL; if (!common_checks (self, local_candidate, remote_candidate, &error)) { dbus_g_method_return_error (context, error); g_clear_error (&error); return; } DEBUG ("Selected candidate rejected for endpoint %s", self->priv->object_path); g_signal_emit (self, _signals[CANDIDATE_REJECTED], 0, local_candidate, remote_candidate); tp_svc_call_stream_endpoint_return_from_reject_selected_candidate_pair ( context); } static void call_stream_endpoint_set_controlling (TpSvcCallStreamEndpoint *iface, gboolean controlling, DBusGMethodInvocation *context) { TpCallStreamEndpoint *self = TP_CALL_STREAM_ENDPOINT (iface); self->priv->controlling = controlling; tp_svc_call_stream_endpoint_emit_controlling_changed (self, controlling); tp_svc_call_stream_endpoint_return_from_set_controlling (context); } static void call_stream_endpoint_iface_init (gpointer iface, gpointer data) { TpSvcCallStreamEndpointClass *klass = (TpSvcCallStreamEndpointClass *) iface; #define IMPLEMENT(x) tp_svc_call_stream_endpoint_implement_##x (\ klass, call_stream_endpoint_##x) IMPLEMENT(set_selected_candidate_pair); IMPLEMENT(set_endpoint_state); IMPLEMENT(accept_selected_candidate_pair); IMPLEMENT(reject_selected_candidate_pair); IMPLEMENT(set_controlling); #undef IMPLEMENT } /* Internal functions */ void _tp_call_stream_endpoint_set_stream (TpCallStreamEndpoint *self, TpBaseMediaCallStream *stream) { g_return_if_fail (TP_IS_CALL_STREAM_ENDPOINT (self)); g_return_if_fail (TP_IS_BASE_MEDIA_CALL_STREAM (stream)); g_return_if_fail (self->priv->stream == NULL); self->priv->stream = stream; } telepathy-glib-0.24.2/telepathy-glib/call-stream-endpoint.h0000644000175000017500000000715412652510705020551 00000000000000/* * call-stream-endpoint.h - Header for TpCallStreamEndpoint * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_STREAM_ENDPOINT_H__ #define __TP_CALL_STREAM_ENDPOINT_H__ #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpCallStreamEndpoint TpCallStreamEndpoint; typedef struct _TpCallStreamEndpointPrivate TpCallStreamEndpointPrivate; typedef struct _TpCallStreamEndpointClass TpCallStreamEndpointClass; struct _TpCallStreamEndpointClass { /**/ GObjectClass parent_class; TpDBusPropertiesMixinClass dbus_props_class; }; struct _TpCallStreamEndpoint { /**/ GObject parent; TpCallStreamEndpointPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_call_stream_endpoint_get_type (void); /* TYPE MACROS */ #define TP_TYPE_CALL_STREAM_ENDPOINT \ (tp_call_stream_endpoint_get_type ()) #define TP_CALL_STREAM_ENDPOINT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_CALL_STREAM_ENDPOINT, TpCallStreamEndpoint)) #define TP_CALL_STREAM_ENDPOINT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_CALL_STREAM_ENDPOINT, TpCallStreamEndpointClass)) #define TP_IS_CALL_STREAM_ENDPOINT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_CALL_STREAM_ENDPOINT)) #define TP_IS_CALL_STREAM_ENDPOINT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_CALL_STREAM_ENDPOINT)) #define TP_CALL_STREAM_ENDPOINT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_CALL_STREAM_ENDPOINT, TpCallStreamEndpointClass)) _TP_AVAILABLE_IN_0_18 TpCallStreamEndpoint *tp_call_stream_endpoint_new (TpDBusDaemon *dbus_daemon, const gchar *object_path, TpStreamTransportType transport, gboolean is_ice_lite); _TP_AVAILABLE_IN_0_18 const gchar *tp_call_stream_endpoint_get_object_path ( TpCallStreamEndpoint *self); _TP_AVAILABLE_IN_0_18 TpStreamEndpointState tp_call_stream_endpoint_get_state ( TpCallStreamEndpoint *self, TpStreamComponent component); _TP_AVAILABLE_IN_0_18 void tp_call_stream_endpoint_add_new_candidates (TpCallStreamEndpoint *self, const GPtrArray *candidates); _TP_AVAILABLE_IN_0_18 void tp_call_stream_endpoint_add_new_candidate (TpCallStreamEndpoint *self, TpStreamComponent component, const gchar *address, guint port, const GHashTable *info_hash); _TP_AVAILABLE_IN_0_18 void tp_call_stream_endpoint_set_remote_credentials ( TpCallStreamEndpoint *self, const gchar *username, const gchar *password); G_END_DECLS #endif /* #ifndef __TP_CALL_STREAM_ENDPOINT_H__*/ telepathy-glib-0.24.2/telepathy-glib/client-message.c0000644000175000017500000000611212652510705017413 00000000000000/* * client-message.c - Source for TpClientMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:client-message * @title: TpClientMessage * @short_description: a message in the Telepathy message interface, client side * * #TpClientMessage is used within Telepathy clients to represent a * message composed by a client, which it will send using the * Messages interface. * Its subclass #TpSignalledMessage represents messages as signalled by a * connection manager. * * Since: 0.13.9 */ #include "config.h" #include "client-message.h" #include "client-message-internal.h" #include "message-internal.h" #include #include #include /** * TpClientMessage: * * Opaque structure representing a message in the Telepathy messages interface * (client side). * * Since: 0.13.9 */ G_DEFINE_TYPE (TpClientMessage, tp_client_message, TP_TYPE_MESSAGE) struct _TpClientMessagePrivate { gpointer unused; }; static void tp_client_message_class_init (TpClientMessageClass *klass) { } static void tp_client_message_init (TpClientMessage *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE ((self), TP_TYPE_MESSAGE, TpClientMessagePrivate); } /** * tp_client_message_new: * * A convenient function to create a new #TpClientMessage * * Returns: (transfer full): a newly allocated #TpClientMessage having only * the header part. * * Since: 0.13.9 */ TpMessage * tp_client_message_new (void) { return g_object_new (TP_TYPE_CLIENT_MESSAGE, NULL); } /** * tp_client_message_new_text: * @type: the type of message * @text: content of the messsage * * A convenient function to create a new #TpClientMessage having * 'text/plain' as 'content-type', @type as 'message-type' and * @text as 'content'. * * Returns: (transfer full): a newly allocated #TpClientMessage * * Since: 0.13.9 */ TpMessage * tp_client_message_new_text (TpChannelTextMessageType type, const gchar *text) { TpMessage *msg; msg = g_object_new (TP_TYPE_CLIENT_MESSAGE, NULL); if (type != TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL) tp_message_set_uint32 (msg, 0, "message-type", type); tp_message_append_part (msg); tp_message_set_string (msg, 1, "content-type", "text/plain"); tp_message_set_string (msg, 1, "content", text); return msg; } telepathy-glib-0.24.2/telepathy-glib/client-message.h0000644000175000017500000000423112652510705017420 00000000000000/* * client-message.h - Header for TpClientMessage * Copyright (C) 2006-2010 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CLIENT_MESSAGE_H__ #define __TP_CLIENT_MESSAGE_H__ #include G_BEGIN_DECLS #include #define TP_TYPE_CLIENT_MESSAGE (tp_client_message_get_type ()) #define TP_CLIENT_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CLIENT_MESSAGE, TpClientMessage)) #define TP_CLIENT_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), TP_TYPE_CLIENT_MESSAGE, TpClientMessageClass)) #define TP_IS_CLIENT_MESSAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CLIENT_MESSAGE)) #define TP_IS_CLIENT_MESSAGE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), TP_TYPE_CLIENT_MESSAGE)) #define TP_CLIENT_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CLIENT_MESSAGE, TpClientMessageClass)) typedef struct _TpClientMessage TpClientMessage; typedef struct _TpClientMessageClass TpClientMessageClass; GType tp_client_message_get_type (void); TpMessage * tp_client_message_new (void); TpMessage * tp_client_message_new_text (TpChannelTextMessageType type, const gchar *text); G_END_DECLS #endif /* __TP_CLIENT_MESSAGE_H__ */ telepathy-glib-0.24.2/telepathy-glib/generic.xml0000644000175000017500000000054712652510705016513 00000000000000 Generic interfaces telepathy-glib-0.24.2/telepathy-glib/connection-contact-list.c0000644000175000017500000015476212652510705021273 00000000000000/* * Proxy for a Telepathy connection - ContactList support * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection-contact-list.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/contact-internal.h" #include "telepathy-glib/util-internal.h" typedef struct { GHashTable *changes; GHashTable *identifiers; GHashTable *removals; GPtrArray *new_contacts; } ContactsChangedItem; static ContactsChangedItem * contacts_changed_item_new (GHashTable *changes, GHashTable *identifiers, GHashTable *removals) { ContactsChangedItem *item; item = g_slice_new0 (ContactsChangedItem); item->changes = g_hash_table_ref (changes); item->identifiers = g_hash_table_ref (identifiers); item->removals = g_hash_table_ref (removals); item->new_contacts = g_ptr_array_new_with_free_func (g_object_unref); return item; } static void contacts_changed_item_free (ContactsChangedItem *item) { tp_clear_pointer (&item->changes, g_hash_table_unref); tp_clear_pointer (&item->identifiers, g_hash_table_unref); tp_clear_pointer (&item->removals, g_hash_table_unref); tp_clear_pointer (&item->new_contacts, g_ptr_array_unref); g_slice_free (ContactsChangedItem, item); } void _tp_connection_contacts_changed_queue_free (GQueue *queue) { g_queue_foreach (queue, (GFunc) contacts_changed_item_free, NULL); g_queue_free (queue); } static void process_queued_contacts_changed (TpConnection *self); static void contacts_changed_head_ready (TpConnection *self) { ContactsChangedItem *item; GHashTableIter iter; gpointer key; GPtrArray *added; GPtrArray *removed; guint i; item = g_queue_pop_head (self->priv->contacts_changed_queue); added = g_ptr_array_new_full (g_hash_table_size (item->removals), g_object_unref); removed = g_ptr_array_new_full (item->new_contacts->len, g_object_unref); /* Remove contacts from roster, and build a list of contacts really removed */ g_hash_table_iter_init (&iter, item->removals); while (g_hash_table_iter_next (&iter, &key, NULL)) { TpContact *contact; contact = g_hash_table_lookup (self->priv->roster, key); if (contact == NULL) { DEBUG ("handle %u removed but not in our table - broken CM", GPOINTER_TO_UINT (key)); continue; } g_ptr_array_add (removed, g_object_ref (contact)); g_hash_table_remove (self->priv->roster, key); } /* Add contacts to roster and build a list of contacts added */ for (i = 0; i < item->new_contacts->len; i++) { TpContact *contact = g_ptr_array_index (item->new_contacts, i); g_ptr_array_add (added, g_object_ref (contact)); g_hash_table_insert (self->priv->roster, GUINT_TO_POINTER (tp_contact_get_handle (contact)), g_object_ref (contact)); } DEBUG ("roster changed: %d added, %d removed", added->len, removed->len); if (added->len > 0 || removed->len > 0) g_signal_emit_by_name (self, "contact-list-changed", added, removed); g_ptr_array_unref (added); g_ptr_array_unref (removed); contacts_changed_item_free (item); process_queued_contacts_changed (self); } static void new_contacts_upgraded_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpSimpleClientFactory *factory = (TpSimpleClientFactory *) object; TpConnection *self = user_data; GError *error = NULL; if (!tp_simple_client_factory_upgrade_contacts_finish (factory, result, NULL, &error)) { DEBUG ("Error upgrading new roster contacts: %s", error->message); g_clear_error (&error); } contacts_changed_head_ready (self); } static void process_queued_contacts_changed (TpConnection *self) { ContactsChangedItem *item; GHashTableIter iter; gpointer key, value; item = g_queue_peek_head (self->priv->contacts_changed_queue); if (item == NULL) return; g_hash_table_iter_init (&iter, item->changes); while (g_hash_table_iter_next (&iter, &key, &value)) { TpContact *contact = g_hash_table_lookup (self->priv->roster, key); const gchar *identifier = g_hash_table_lookup (item->identifiers, key); TpHandle handle = GPOINTER_TO_UINT (key); /* If the contact is already in the roster, it is only a change of * subscription states. That's already handled by the TpContact itself so * we have nothing more to do for it here. */ if (contact != NULL) continue; contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); _tp_contact_set_subscription_states (contact, value); g_ptr_array_add (item->new_contacts, contact); } if (item->new_contacts->len == 0) { contacts_changed_head_ready (self); return; } tp_simple_client_factory_upgrade_contacts_async (tp_proxy_get_factory (self), self, item->new_contacts->len, (TpContact **) item->new_contacts->pdata, new_contacts_upgraded_cb, self); } static void contacts_changed_cb (TpConnection *self, GHashTable *changes, GHashTable *identifiers, GHashTable *removals, gpointer user_data, GObject *weak_object) { ContactsChangedItem *item; /* Ignore ContactsChanged signal if we didn't receive initial roster yet */ if (!self->priv->roster_fetched) return; /* We need a queue to make sure we don't reorder signals if we get a 2nd * ContactsChanged signal before the previous one finished preparing TpContact * objects. */ item = contacts_changed_item_new (changes, identifiers, removals); g_queue_push_tail (self->priv->contacts_changed_queue, item); /* If this is the only item in the queue, we can process it right away */ if (self->priv->contacts_changed_queue->length == 1) process_queued_contacts_changed (self); } static void got_contact_list_attributes_cb (TpConnection *self, GHashTable *attributes, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = (GSimpleAsyncResult *) weak_object; GArray *features = user_data; GHashTableIter iter; gpointer key, value; if (error != NULL) { self->priv->contact_list_state = TP_CONTACT_LIST_STATE_FAILURE; g_object_notify ((GObject *) self, "contact-list-state"); if (result != NULL) g_simple_async_result_set_from_error (result, error); goto OUT; } DEBUG ("roster fetched with %d contacts", g_hash_table_size (attributes)); self->priv->roster_fetched = TRUE; g_hash_table_iter_init (&iter, attributes); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); const gchar *id = tp_asv_get_string (value, TP_TOKEN_CONNECTION_CONTACT_ID); TpContact *contact; GError *e = NULL; contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, id); /* ensure_contact() can fail for obsolete CMs that don't have * ImmortalHandles */ if (contact == NULL) continue; if (!_tp_contact_set_attributes (contact, value, features->len, (TpContactFeature *) features->data, &e)) { DEBUG ("Error setting contact attributes: %s", e->message); g_clear_error (&e); } /* Give the contact ref to the table */ g_hash_table_insert (self->priv->roster, key, contact); } /* emit initial set if roster is not empty */ if (g_hash_table_size (self->priv->roster) != 0) { GPtrArray *added; GPtrArray *removed; added = tp_connection_dup_contact_list (self); removed = g_ptr_array_new (); g_signal_emit_by_name (self, "contact-list-changed", added, removed); g_ptr_array_unref (added); g_ptr_array_unref (removed); } self->priv->contact_list_state = TP_CONTACT_LIST_STATE_SUCCESS; g_object_notify ((GObject *) self, "contact-list-state"); OUT: if (result != NULL) { g_simple_async_result_complete_in_idle (result); g_object_unref (result); } } static void prepare_roster (TpConnection *self, GSimpleAsyncResult *result) { TpContactFeature feature_states = TP_CONTACT_FEATURE_SUBSCRIPTION_STATES; GArray *features; const gchar **supported_interfaces; DEBUG ("CM has the roster for connection %s, fetch it now.", tp_proxy_get_object_path (self)); tp_cli_connection_interface_contact_list_connect_to_contacts_changed_with_id ( self, contacts_changed_cb, NULL, NULL, NULL, NULL); features = tp_simple_client_factory_dup_contact_features ( tp_proxy_get_factory (self), self); /* We'll get subscription states for free, but we still need to tell * TpContact to bind to change notification. */ g_array_append_val (features, feature_states); supported_interfaces = _tp_contacts_bind_to_signals (self, features->len, (TpContactFeature *) features->data); tp_cli_connection_interface_contact_list_call_get_contact_list_attributes ( self, -1, supported_interfaces, TRUE, got_contact_list_attributes_cb, features, (GDestroyNotify) g_array_unref, result ? g_object_ref (result) : NULL); g_free (supported_interfaces); } static void contact_list_state_changed_cb (TpConnection *self, guint state, gpointer user_data, GObject *weak_object) { /* Ignore StateChanged if we didn't had the initial state or if * duplicate signal */ if (!self->priv->contact_list_properties_fetched || state == self->priv->contact_list_state) return; DEBUG ("contact list state changed: %d", state); /* If state goes to success, delay notification until roster is ready */ if (state == TP_CONTACT_LIST_STATE_SUCCESS && tp_proxy_is_prepared (self, TP_CONNECTION_FEATURE_CONTACT_LIST)) { prepare_roster (self, NULL); return; } self->priv->contact_list_state = state; g_object_notify ((GObject *) self, "contact-list-state"); } static void prepare_contact_list_props_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; gboolean valid; self->priv->contact_list_properties_fetched = TRUE; if (error != NULL) { DEBUG ("Error preparing ContactList properties: %s", error->message); g_simple_async_result_set_from_error (result, error); goto OUT; } self->priv->contact_list_state = tp_asv_get_uint32 (properties, "ContactListState", &valid); if (!valid) { DEBUG ("Connection %s doesn't have ContactListState property", tp_proxy_get_object_path (self)); } self->priv->contact_list_persists = tp_asv_get_boolean (properties, "ContactListPersists", &valid); if (!valid) { DEBUG ("Connection %s doesn't have ContactListPersists property", tp_proxy_get_object_path (self)); } self->priv->can_change_contact_list = tp_asv_get_boolean (properties, "CanChangeContactList", &valid); if (!valid) { DEBUG ("Connection %s doesn't have CanChangeContactList property", tp_proxy_get_object_path (self)); } self->priv->request_uses_message = tp_asv_get_boolean (properties, "RequestUsesMessage", &valid); if (!valid) { DEBUG ("Connection %s doesn't have RequestUsesMessage property", tp_proxy_get_object_path (self)); } DEBUG ("Got contact list properties; state=%d", self->priv->contact_list_state); OUT: g_simple_async_result_complete_in_idle (result); } void _tp_connection_prepare_contact_list_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_connection_prepare_contact_list_async); /* If the CM has the contact list, prepare it right away */ if (self->priv->contact_list_state == TP_CONTACT_LIST_STATE_SUCCESS) { prepare_roster (self, result); g_object_unref (result); return; } /* Contacts will be prepared once the CM has fetched the contact list from * the server. * Complete the preparation as it's not supposed to wait for the contact * list. */ g_simple_async_result_complete_in_idle (result); g_object_unref (result); } void _tp_connection_prepare_contact_list_props_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; tp_cli_connection_interface_contact_list_connect_to_contact_list_state_changed (self, contact_list_state_changed_cb, NULL, NULL, NULL, NULL); result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_connection_prepare_contact_list_props_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, prepare_contact_list_props_cb, result, g_object_unref, NULL); } static void contact_groups_created_cb (TpConnection *self, const gchar **names, gpointer user_data, GObject *weak_object) { const gchar **iter; if (!self->priv->groups_fetched) return; DEBUG ("Groups created:"); /* Remove the ending NULL */ g_ptr_array_remove_index_fast (self->priv->contact_groups, self->priv->contact_groups->len - 1); for (iter = names; *iter != NULL; iter++) { DEBUG (" %s", *iter); g_ptr_array_add (self->priv->contact_groups, g_strdup (*iter)); } /* Add back the ending NULL */ g_ptr_array_add (self->priv->contact_groups, NULL); g_object_notify ((GObject *) self, "contact-groups"); g_signal_emit_by_name (self, "groups-created", names); } static void contact_groups_removed_cb (TpConnection *self, const gchar **names, gpointer user_data, GObject *weak_object) { const gchar **iter; if (!self->priv->groups_fetched) return; DEBUG ("Groups removed:"); /* Remove the ending NULL */ g_ptr_array_remove_index_fast (self->priv->contact_groups, self->priv->contact_groups->len - 1); for (iter = names; *iter != NULL; iter++) { guint i; for (i = 0; i < self->priv->contact_groups->len; i++) { const gchar *str = g_ptr_array_index (self->priv->contact_groups, i); if (!tp_strdiff (str, *iter)) { DEBUG (" %s", str); g_ptr_array_remove_index_fast (self->priv->contact_groups, i); break; } } } /* Add back the ending NULL */ g_ptr_array_add (self->priv->contact_groups, NULL); g_object_notify ((GObject *) self, "contact-groups"); g_signal_emit_by_name (self, "groups-removed", names); } static void contact_group_renamed_cb (TpConnection *self, const gchar *old_name, const gchar *new_name, gpointer user_data, GObject *weak_object) { guint i; if (!self->priv->groups_fetched) return; DEBUG ("Group renamed: %s -> %s", old_name, new_name); /* Remove the ending NULL */ g_ptr_array_remove_index_fast (self->priv->contact_groups, self->priv->contact_groups->len - 1); for (i = 0; i < self->priv->contact_groups->len; i++) { const gchar *str = g_ptr_array_index (self->priv->contact_groups, i); if (!tp_strdiff (str, old_name)) { g_ptr_array_remove_index_fast (self->priv->contact_groups, i); break; } } g_ptr_array_add (self->priv->contact_groups, g_strdup (new_name)); /* Add back the ending NULL */ g_ptr_array_add (self->priv->contact_groups, NULL); g_object_notify ((GObject *) self, "contact-groups"); g_signal_emit_by_name (self, "group-renamed", old_name, new_name); } static void prepare_contact_groups_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; GStrv groups; gchar **iter; gboolean valid; if (error != NULL) { g_simple_async_result_set_from_error (result, error); goto OUT; } self->priv->groups_fetched = TRUE; self->priv->disjoint_groups = tp_asv_get_boolean (properties, "DisjointGroups", &valid); if (!valid) { DEBUG ("Connection %s doesn't have DisjointGroups property", tp_proxy_get_object_path (self)); } self->priv->group_storage = tp_asv_get_uint32 (properties, "GroupStorage", &valid); if (!valid) { DEBUG ("Connection %s doesn't have GroupStorage property", tp_proxy_get_object_path (self)); } DEBUG ("Got contact list groups:"); /* Remove the ending NULL */ g_ptr_array_remove_index_fast (self->priv->contact_groups, self->priv->contact_groups->len - 1); groups = tp_asv_get_boxed (properties, "Groups", G_TYPE_STRV); for (iter = groups; iter != NULL && *iter != NULL; iter++) { DEBUG (" %s", *iter); g_ptr_array_add (self->priv->contact_groups, g_strdup (*iter)); } /* Add back the ending NULL */ g_ptr_array_add (self->priv->contact_groups, NULL); OUT: g_simple_async_result_complete_in_idle (result); } void _tp_connection_prepare_contact_groups_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; tp_cli_connection_interface_contact_groups_connect_to_groups_created ( self, contact_groups_created_cb, NULL, NULL, NULL, NULL); tp_cli_connection_interface_contact_groups_connect_to_groups_removed ( self, contact_groups_removed_cb, NULL, NULL, NULL, NULL); tp_cli_connection_interface_contact_groups_connect_to_group_renamed ( self, contact_group_renamed_cb, NULL, NULL, NULL, NULL); result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_connection_prepare_contact_groups_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, prepare_contact_groups_cb, result, g_object_unref, NULL); } /** * TP_CONNECTION_FEATURE_CONTACT_LIST: * * Expands to a call to a function that returns a #GQuark representing the * "contact-list" feature. * * When this feature is prepared, the * %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES has been prepared, so the * contact list properties of the Connection has been retrieved. * If #TpConnection:contact-list-state is * %TP_CONTACT_LIST_STATE_SUCCESS, all #TpContact objects will also be created * and prepared with the desired features. See tp_connection_dup_contact_list() * to get the list of contacts, and * tp_simple_client_factory_add_contact_features() to define which features * needs to be prepared on them. * * This feature will fail to prepare when using obsolete Telepathy connection * managers which do not implement the ContactList interface. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.5 */ GQuark tp_connection_get_feature_quark_contact_list (void) { return g_quark_from_static_string ("tp-connection-feature-contact-list"); } /** * tp_connection_get_contact_list_state: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:contact-list-state property * * Since: 0.15.5 */ TpContactListState tp_connection_get_contact_list_state (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), TP_CONTACT_LIST_STATE_NONE); return self->priv->contact_list_state; } /** * tp_connection_get_contact_list_persists: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:contact-list-persists property * * Since: 0.15.5 */ gboolean tp_connection_get_contact_list_persists (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->contact_list_persists; } /** * tp_connection_get_can_change_contact_list: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:can-change-contact-list property * * Since: 0.15.5 */ gboolean tp_connection_get_can_change_contact_list (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->can_change_contact_list; } /** * tp_connection_get_request_uses_message: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:request-uses-message property * * Since: 0.15.5 */ gboolean tp_connection_get_request_uses_message (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->request_uses_message; } /** * tp_connection_dup_contact_list: * @self: a #TpConnection * * Retrieves the user's contact list. In general, blocked contacts are not * included in this list. The #TpContact objects returned are guaranteed to * have all of the features previously passed to * tp_simple_client_factory_add_contact_features() prepared. * * Before calling this method, you must first call tp_proxy_prepare_async() with * the %TP_CONNECTION_FEATURE_CONTACT_LIST feature, and verify that * #TpConnection:contact-list-state is set to %TP_CONTACT_LIST_STATE_SUCCESS. * * Returns: (transfer container) (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a new #GPtrArray of #TpContact. Use g_ptr_array_unref() when done. * * Since: 0.15.5 */ GPtrArray * tp_connection_dup_contact_list (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return _tp_contacts_from_values (self->priv->roster); } static void generic_callback (TpConnection *self, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; if (error != NULL) { DEBUG ("Operation failed: %s", error->message); g_simple_async_result_set_from_error (result, error); } /* tp_cli callbacks can potentially be called in a re-entrant way, * so we can't necessarily complete @result without using an idle. */ g_simple_async_result_complete_in_idle (result); } #define contact_list_generic_async(method, ...) \ G_STMT_START { \ GSimpleAsyncResult *result; \ GArray *handles; \ gboolean supplied_contacts_are_valid; \ \ g_return_if_fail (TP_IS_CONNECTION (self)); \ g_return_if_fail (n_contacts > 0); \ \ supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, \ contacts, &handles); \ g_return_if_fail (supplied_contacts_are_valid); \ \ result = g_simple_async_result_new ((GObject *) self, callback, user_data, \ tp_connection_##method##_async); \ \ tp_cli_connection_interface_contact_list_call_##method (self, -1, handles, \ ##__VA_ARGS__, generic_callback, result, g_object_unref, NULL); \ g_array_unref (handles); \ } G_STMT_END #define generic_finish(method) \ _tp_implement_finish_void (self, tp_connection_##method##_async); /** * tp_connection_request_subscription_async: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to whom * requests are to be sent. * @message: an optional plain-text message from the user, to send to those * @contacts with the subscription request. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Request that the given @contacts allow the local user to subscribe to their * presence, i.e. that their #TpContact:subscribe-state property becomes * %TP_SUBSCRIPTION_STATE_YES. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. * * Since: 0.15.5 */ void tp_connection_request_subscription_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (request_subscription, message); } /** * tp_connection_request_subscription_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_request_subscription_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_request_subscription_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (request_subscription); } /** * tp_connection_authorize_publication_async: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * authorize * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * For each of the given @contacts, request that the local user's presence is * sent to that contact, i.e. that their #TpContact:publish-state property * becomes %TP_SUBSCRIPTION_STATE_YES. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. * * Since: 0.15.5 */ void tp_connection_authorize_publication_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (authorize_publication); } /** * tp_connection_authorize_publication_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_authorize_publication_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_authorize_publication_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (authorize_publication); } /** * tp_connection_remove_contacts_async: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * remove * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Remove the given @contacts from the contact list entirely. It is * protocol-dependent whether this works, and under which circumstances. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. * * Since: 0.15.5 */ void tp_connection_remove_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (remove_contacts); } /** * tp_connection_remove_contacts_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_remove_contacts_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_remove_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (remove_contacts); } /** * tp_connection_unsubscribe_async: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * remove * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Attempt to set the given @contacts' #TpContact:subscribe-state property to * %TP_SUBSCRIPTION_STATE_NO, i.e. stop receiving their presence. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. * * Since: 0.15.5 */ void tp_connection_unsubscribe_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (unsubscribe); } /** * tp_connection_unsubscribe_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_unsubscribe_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_unsubscribe_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (unsubscribe); } /** * tp_connection_unpublish_async: * @self: a #TpConnection * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * remove * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Attempt to set the given @contacts' #TpContact:publish-state property to * %TP_SUBSCRIPTION_STATE_NO, i.e. stop sending presence to them. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST. * * Since: 0.15.5 */ void tp_connection_unpublish_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_list_generic_async (unpublish); } /** * tp_connection_unpublish_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_unpublish_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_unpublish_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (unpublish); } /** * TP_CONNECTION_FEATURE_CONTACT_GROUPS: * * Expands to a call to a function that returns a #GQuark representing the * "contact-groups" feature. * * When this feature is prepared, the contact groups properties of the * Connection has been retrieved. * * See #TpContact:contact-groups to get the list of groups a contact is member * of. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.5 */ GQuark tp_connection_get_feature_quark_contact_groups (void) { return g_quark_from_static_string ("tp-connection-feature-contact-groups"); } /** * tp_connection_get_disjoint_groups: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:disjoint-groups * * Since: 0.15.5 */ gboolean tp_connection_get_disjoint_groups (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->disjoint_groups; } /** * tp_connection_get_group_storage: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:group-storage * * Since: 0.15.5 */ TpContactMetadataStorageType tp_connection_get_group_storage (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), TP_CONTACT_METADATA_STORAGE_TYPE_NONE); return self->priv->group_storage; } /** * tp_connection_get_contact_groups: * @self: a #TpConnection * * * * Returns: (array zero-terminated=1) (transfer none): the value of * #TpConnection:contact-groups * * Since: 0.15.5 */ const gchar * const * tp_connection_get_contact_groups (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return (const gchar * const *) self->priv->contact_groups->pdata; } #define contact_groups_generic_async(method) \ G_STMT_START { \ GSimpleAsyncResult *result; \ GArray *handles; \ gboolean supplied_contacts_are_valid; \ \ g_return_if_fail (TP_IS_CONNECTION (self)); \ g_return_if_fail (group != NULL); \ g_return_if_fail (n_contacts > 0); \ \ supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, \ contacts, &handles); \ g_return_if_fail (supplied_contacts_are_valid); \ \ result = g_simple_async_result_new ((GObject *) self, callback, user_data, \ tp_connection_##method##_async); \ \ tp_cli_connection_interface_contact_groups_call_##method (self, -1, \ group, handles, generic_callback, result, g_object_unref, NULL); \ g_array_unref (handles); \ } G_STMT_END /** * tp_connection_set_group_members_async: * @self: a #TpConnection * @group: the group to alter. * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects members * for the group. If this set is empty, this method MAY remove the group. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Add the given @contacts to the given @group (creating it if necessary), and * remove all other members. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. * * Since: 0.15.5 */ void tp_connection_set_group_members_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_groups_generic_async (set_group_members); } /** * tp_connection_set_group_members_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_set_group_members_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_set_group_members_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (set_group_members); } /** * tp_connection_add_to_group_async: * @self: a #TpConnection * @group: the group to alter. * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * include in the group. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Add the given @contacts to the given @group, creating it if necessary. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. * * Since: 0.15.5 */ void tp_connection_add_to_group_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_groups_generic_async (add_to_group); } /** * tp_connection_add_to_group_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_add_to_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_add_to_group_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (add_to_group); } /** * tp_connection_remove_from_group_async: * @self: a #TpConnection * @group: the group to alter. * @n_contacts: The number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * remove from the group. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Remove the given @contacts from the given @group. If there are no members * left in the group afterwards, the group MAY itself be removed. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. * * Since: 0.15.5 */ void tp_connection_remove_from_group_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { contact_groups_generic_async (remove_from_group); } /** * tp_connection_remove_from_group_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_remove_from_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_remove_from_group_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (remove_from_group); } /** * tp_connection_remove_group_async: * @self: a #TpConnection * @group: the group to remove. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Remove all members from the given group, then remove the group itself. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. * * Since: 0.15.5 */ void tp_connection_remove_group_async (TpConnection *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (group != NULL); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_remove_group_async); tp_cli_connection_interface_contact_groups_call_remove_group (self, -1, group, generic_callback, result, g_object_unref, NULL); } /** * tp_connection_remove_group_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_remove_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_remove_group_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (remove_group); } /** * tp_connection_rename_group_async: * @self: a #TpConnection * @old_name: the group to rename * @new_name: the new name for the group * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Rename the given @old_name. * * On protocols where groups behave like tags, this is an API short-cut for * adding all of the group's members to a group with the new name, then removing * the old group. * * For this to work properly @self must have interface * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS. * * Since: 0.15.5 */ void tp_connection_rename_group_async (TpConnection *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (old_name != NULL); g_return_if_fail (new_name != NULL); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_rename_group_async); tp_cli_connection_interface_contact_groups_call_rename_group (self, -1, old_name, new_name, generic_callback, result, g_object_unref, NULL); } /** * tp_connection_rename_group_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_rename_group_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.15.5 */ gboolean tp_connection_rename_group_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (rename_group); } /* ContactBlocking */ /** * tp_connection_block_contacts_async: * @self: a #TpConnection * @n_contacts: the number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * block * @report_abusive: If %TRUE, report these contacts as abusive to the * server administrators as well as blocking them. See * #TpConnection:can-report-abusive to discover whether reporting abuse is * supported. If #TpConnection:can-report-abusive is %FALSE, this parameter will * be ignored. * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Direct the server to block @contacts. * * Since: 0.17.0 */ void tp_connection_block_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GArray *handles; gboolean supplied_contacts_are_valid; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (n_contacts > 0); supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, contacts, &handles); g_return_if_fail (supplied_contacts_are_valid); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_block_contacts_async); tp_cli_connection_interface_contact_blocking_call_block_contacts (self, -1, handles, report_abusive, generic_callback, result, g_object_unref, NULL); g_array_unref (handles); } /** * tp_connection_block_contacts_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_block_contacts_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.17.0 */ gboolean tp_connection_block_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (block_contacts); } /** * tp_connection_unblock_contacts_async: * @self: a #TpConnection * @n_contacts: the number of contacts in @contacts (must be at least 1) * @contacts: (array length=n_contacts): An array of #TpContact objects to * block * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Direct the server to unblock @contacts. * * Since: 0.17.0 */ void tp_connection_unblock_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; GArray *handles; gboolean supplied_contacts_are_valid; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (n_contacts > 0); supplied_contacts_are_valid = _tp_contacts_to_handles (self, n_contacts, contacts, &handles); g_return_if_fail (supplied_contacts_are_valid); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_unblock_contacts_async); tp_cli_connection_interface_contact_blocking_call_unblock_contacts (self, -1, handles, generic_callback, result, g_object_unref, NULL); g_array_unref (handles); } /** * tp_connection_unblock_contacts_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_connection_unblock_contacts_async() * * Returns: %TRUE if the operation was successful, otherwise %FALSE. * * Since: 0.17.0 */ gboolean tp_connection_unblock_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error) { generic_finish (unblock_contacts); } /** * TP_CONNECTION_FEATURE_CONTACT_BLOCKING: * * Expands to a call to a function that returns a #GQuark representing the * "contact-blocking" feature. * * When this feature is prepared, #TpConnection:blocked-contacts will contain an * up-to-date list of #TpContacts the user has blocked, and * #TpConnection:can-report-abusive will indicate whether abusive contacts can * be reported to the server administrator. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.17.0 */ GQuark tp_connection_get_feature_quark_contact_blocking (void) { return g_quark_from_static_string ("tp-connection-feature-contact-blocking"); } typedef struct { /* TpHandle -> (const gchar *) identifier */ GHashTable *added; /* TpHandle -> (const gchar *) identifier */ GHashTable *removed; /* array of reffed TpContact */ GPtrArray *added_contacts; /* array of reffed TpContact */ GPtrArray *removed_contacts; GSimpleAsyncResult *result; } BlockedChangedItem; static BlockedChangedItem * blocked_changed_item_new (TpConnection *conn, GHashTable *added, GHashTable *removed, GSimpleAsyncResult *result) { BlockedChangedItem *item = g_slice_new0 (BlockedChangedItem); item->added = g_hash_table_ref (added); if (removed != NULL) item->removed = g_hash_table_ref (removed); else item->removed = g_hash_table_new (NULL, NULL); item->added_contacts = g_ptr_array_new_with_free_func (g_object_unref); item->removed_contacts = g_ptr_array_new_with_free_func (g_object_unref); if (result != NULL) item->result = g_object_ref (result); return item; } static void blocked_changed_item_free (BlockedChangedItem *item) { g_hash_table_unref (item->added); g_hash_table_unref (item->removed); g_ptr_array_unref (item->added_contacts); g_ptr_array_unref (item->removed_contacts); g_clear_object (&item->result); g_slice_free (BlockedChangedItem, item); } static void process_queued_blocked_changed (TpConnection *self); void _tp_connection_set_contact_blocked (TpConnection *self, TpContact *contact) { gboolean blocked; blocked = tp_g_ptr_array_contains (self->priv->blocked_contacts, contact); _tp_contact_set_is_blocked (contact, blocked); } static void blocked_changed_head_ready (TpConnection *self) { BlockedChangedItem *item; item = g_queue_pop_head (self->priv->blocked_changed_queue); if (item->result != NULL) { /* Finish preparing TP_CONNECTION_FEATURE_CONTACT_BLOCKING; we can * prepare TP_CONTACT_FEATURE_CONTACT_BLOCKING on all contacts as we * have now the list of blocked contacts. */ GHashTableIter iter; gpointer contact; g_hash_table_iter_init (&iter, self->priv->contacts); while (g_hash_table_iter_next (&iter, NULL, &contact)) { _tp_connection_set_contact_blocked (self, contact); } g_simple_async_result_complete_in_idle (item->result); } blocked_changed_item_free (item); process_queued_blocked_changed (self); } static void blocked_contacts_upgraded_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpSimpleClientFactory *factory = (TpSimpleClientFactory *) object; TpConnection *self = user_data; BlockedChangedItem *item; guint i; GPtrArray *added, *removed; GPtrArray *contacts; GError *error = NULL; item = g_queue_peek_head (self->priv->blocked_changed_queue); if (!tp_simple_client_factory_upgrade_contacts_finish (factory, result, &contacts, &error)) { DEBUG ("Error upgrading blocked contacts: %s", error->message); g_clear_error (&error); goto out; } added = g_ptr_array_new (); removed = g_ptr_array_new_with_free_func (g_object_unref); for (i = 0; i < contacts->len; i++) { TpContact *contact = g_ptr_array_index (contacts, i); TpHandle handle; handle = tp_contact_get_handle (contact); if (g_hash_table_lookup (item->added, GUINT_TO_POINTER (handle)) != NULL) { DEBUG ("Contact %s is blocked", tp_contact_get_identifier (contact)); g_ptr_array_add (self->priv->blocked_contacts, g_object_ref (contact)); g_ptr_array_add (added, contact); } else if (g_hash_table_lookup (item->removed, GUINT_TO_POINTER (handle)) != NULL) { DEBUG ("Contact %s is no longer blocked", tp_contact_get_identifier (contact)); /* Ref the contact as removing it from blocked_contacts may drop its * last ref. */ g_ptr_array_add (removed, g_object_ref (contact)); g_ptr_array_remove (self->priv->blocked_contacts, contact); } else { g_assert_not_reached (); } } g_object_notify (G_OBJECT (self), "blocked-contacts"); g_signal_emit_by_name (self, "blocked-contacts-changed", added, removed); g_ptr_array_unref (added); g_ptr_array_unref (removed); g_ptr_array_unref (contacts); out: blocked_changed_head_ready (self); } static void process_queued_blocked_changed (TpConnection *self) { BlockedChangedItem *item; GHashTableIter iter; gpointer key, value; GPtrArray *contacts; item = g_queue_peek_head (self->priv->blocked_changed_queue); if (item == NULL) return; /* contacts will contain the union of item->added_contacts and * item->removed_contacts */ contacts = g_ptr_array_new (); g_hash_table_iter_init (&iter, item->added); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); const gchar *identifier = value; TpContact *contact; contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); g_ptr_array_add (item->added_contacts, contact); g_ptr_array_add (contacts, contact); _tp_contact_set_is_blocked (contact, TRUE); } g_hash_table_iter_init (&iter, item->removed); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle handle = GPOINTER_TO_UINT (key); const gchar *identifier = value; TpContact *contact; contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self), self, handle, identifier); g_ptr_array_add (item->removed_contacts, contact); g_ptr_array_add (contacts, contact); _tp_contact_set_is_blocked (contact, FALSE); } if (contacts->len == 0) { blocked_changed_head_ready (self); g_ptr_array_unref (contacts); return; } tp_simple_client_factory_upgrade_contacts_async (tp_proxy_get_factory (self), self, contacts->len, (TpContact **) contacts->pdata, blocked_contacts_upgraded_cb, self); g_ptr_array_unref (contacts); } static void add_to_blocked_changed_queue (TpConnection *self, GHashTable *added, GHashTable *removed, GSimpleAsyncResult *result) { BlockedChangedItem *item; item = blocked_changed_item_new (self, added, removed, result); g_queue_push_tail (self->priv->blocked_changed_queue, item); if (self->priv->blocked_changed_queue->length == 1) process_queued_blocked_changed (self); } static void request_blocked_contacts_cb (TpConnection *self, GHashTable *contacts, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = user_data; self->priv->blocked_contacts_fetched = TRUE; if (error != NULL) { DEBUG ("Error calling RequestBlockedContacts: %s", error->message); g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete_in_idle (result); return; } /* We are not supposed to add items to this queue until the blocked contacts * have been fetched. */ g_assert_cmpuint (self->priv->blocked_changed_queue->length, ==, 0); add_to_blocked_changed_queue (self, contacts, NULL, result); } static void prepare_contact_blocking_cb (TpProxy *proxy, GHashTable *properties, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; gboolean valid; if (error != NULL) { DEBUG ("Error preparing ContactBlocking properties: %s", error->message); } else { self->priv->contact_blocking_capabilities = tp_asv_get_uint32 (properties, "ContactBlockingCapabilities", &valid); if (!valid) { DEBUG ("Connection %s doesn't have ContactBlockingCapabilities " "property", tp_proxy_get_object_path (self)); } } tp_cli_connection_interface_contact_blocking_call_request_blocked_contacts ( self, -1, request_blocked_contacts_cb, g_object_ref (result), g_object_unref, G_OBJECT (self)); } static void blocked_contacts_changed_cb (TpConnection *self, GHashTable *blocked, GHashTable *unblocked, gpointer user_data, GObject *weak_object) { if (!self->priv->blocked_contacts_fetched) return; add_to_blocked_changed_queue (self, blocked, unblocked, NULL); } void _tp_connection_prepare_contact_blocking_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; GError *error = NULL; result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_connection_prepare_contact_blocking_async); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, prepare_contact_blocking_cb, result, g_object_unref, NULL); if (tp_cli_connection_interface_contact_blocking_connect_to_blocked_contacts_changed (self, blocked_contacts_changed_cb, NULL, NULL, NULL, &error) == NULL) { DEBUG ("Failed to connect to BlockedContactsChanged: %s", error->message); g_error_free (error); } } /** * tp_connection_can_report_abusive: * @self: a #TpConnection * * * * Returns: the value of #TpConnection:can-report-abusive * * Since: 0.17.0 */ gboolean tp_connection_can_report_abusive (TpConnection *self) { return (self->priv->contact_blocking_capabilities & TP_CONTACT_BLOCKING_CAPABILITY_CAN_REPORT_ABUSIVE) != 0; } /** * tp_connection_get_blocked_contacts: * @self: a #TpConnection * * * * Returns: (transfer none) (element-type TelepathyGLib.Contact): the value of * #TpConnection:blocked-contacts * * Since: 0.17.0 */ GPtrArray * tp_connection_get_blocked_contacts (TpConnection *self) { return self->priv->blocked_contacts; } void _tp_connection_blocked_changed_queue_free (GQueue *queue) { g_queue_foreach (queue, (GFunc) blocked_changed_item_free, NULL); g_queue_free (queue); } /** * TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES: * * Expands to a call to a function that returns a #GQuark representing the * "contact-list-properties" feature. * * When this feature is prepared, the contact list properties of the Connection * has been retrieved. * This feature will fail to prepare when using obsolete Telepathy connection * managers which do not implement the ContactList interface. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.17.0 */ GQuark tp_connection_get_feature_quark_contact_list_properties (void) { return g_quark_from_static_string ( "tp-connection-feature-contact-list-properties"); } telepathy-glib-0.24.2/telepathy-glib/connection-contact-list.h0000644000175000017500000001614012652510705021263 00000000000000/* * connection-contact-list.h - ContactList and ContactGroup support * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONNECTION_CONTACT_LIST_H__ #define __TP_CONNECTION_CONTACT_LIST_H__ #include #include #include #include G_BEGIN_DECLS #define TP_CONNECTION_FEATURE_CONTACT_LIST \ (tp_connection_get_feature_quark_contact_list ()) _TP_AVAILABLE_IN_0_16 GQuark tp_connection_get_feature_quark_contact_list (void) G_GNUC_CONST; #define TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES \ (tp_connection_get_feature_quark_contact_list_properties ()) _TP_AVAILABLE_IN_0_18 GQuark tp_connection_get_feature_quark_contact_list_properties (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 TpContactListState tp_connection_get_contact_list_state (TpConnection *self); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_get_contact_list_persists (TpConnection *self); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_get_can_change_contact_list (TpConnection *self); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_get_request_uses_message (TpConnection *self); _TP_AVAILABLE_IN_0_16 GPtrArray *tp_connection_dup_contact_list (TpConnection *self); _TP_AVAILABLE_IN_0_16 void tp_connection_request_subscription_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_request_subscription_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_authorize_publication_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_authorize_publication_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_remove_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_remove_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_unsubscribe_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_unsubscribe_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_unpublish_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_unpublish_finish (TpConnection *self, GAsyncResult *result, GError **error); #define TP_CONNECTION_FEATURE_CONTACT_GROUPS \ (tp_connection_get_feature_quark_contact_groups ()) _TP_AVAILABLE_IN_0_16 GQuark tp_connection_get_feature_quark_contact_groups (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 gboolean tp_connection_get_disjoint_groups (TpConnection *self); _TP_AVAILABLE_IN_0_16 TpContactMetadataStorageType tp_connection_get_group_storage (TpConnection *self); _TP_AVAILABLE_IN_0_16 const gchar * const *tp_connection_get_contact_groups (TpConnection *self); _TP_AVAILABLE_IN_0_16 void tp_connection_set_group_members_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_set_group_members_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_add_to_group_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_add_to_group_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_remove_from_group_async (TpConnection *self, const gchar *group, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_remove_from_group_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_remove_group_async (TpConnection *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_remove_group_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_connection_rename_group_async (TpConnection *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_connection_rename_group_finish (TpConnection *self, GAsyncResult *result, GError **error); /* ContactBlocking */ _TP_AVAILABLE_IN_0_18 void tp_connection_block_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_connection_block_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_18 void tp_connection_unblock_contacts_async (TpConnection *self, guint n_contacts, TpContact * const *contacts, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_connection_unblock_contacts_finish (TpConnection *self, GAsyncResult *result, GError **error); #define TP_CONNECTION_FEATURE_CONTACT_BLOCKING \ (tp_connection_get_feature_quark_contact_blocking ()) _TP_AVAILABLE_IN_0_18 GQuark tp_connection_get_feature_quark_contact_blocking (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 gboolean tp_connection_can_report_abusive (TpConnection *self); _TP_AVAILABLE_IN_0_18 GPtrArray * tp_connection_get_blocked_contacts (TpConnection *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/genums.h.template0000644000175000017500000000077312652510705017637 00000000000000/*** BEGIN file-header ***/ #ifndef __TP_GENUMS_H__ #define __TP_GENUMS_H__ #include G_BEGIN_DECLS /*** END file-header ***/ /*** BEGIN file-production ***/ /* enumerations from "@filename@" */ /*** END file-production ***/ /*** BEGIN value-header ***/ GType @enum_name@_get_type (void) G_GNUC_CONST; #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) /*** END value-header ***/ /*** BEGIN file-tail ***/ G_END_DECLS #endif /* __TP_GENUMS_H__ */ /*** END file-tail ***/ telepathy-glib-0.24.2/telepathy-glib/dbus-properties-mixin.c0000644000175000017500000012750612652510705020777 00000000000000/* * dbus-properties-mixin.c - D-Bus core Properties * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PROPERTIES #include "telepathy-glib/debug-internal.h" /** * SECTION:dbus-properties-mixin * @title: TpDBusPropertiesMixin * @short_description: a mixin implementation of the DBus.Properties interface * @see_also: #TpSvcDBusProperties * * This mixin provides an implementation of the org.freedesktop.DBus.Properties * interface. It relies on the auto-generated service-side GInterfaces from * telepathy-glib >= 0.7.3, or something similar, to register the abstract * properties and their GTypes; classes with the mixin can then register * an implementation of the properties. * * To register D-Bus properties in a GInterface to be implementable with this * mixin, either use the code-generation tools from telepathy-glib >= 0.7.3, * or call tp_svc_interface_set_dbus_properties_info() from a section of the * base_init function that only runs once. * * To use this mixin, include a #TpDBusPropertiesMixinClass somewhere * in your class structure, populate it with pointers to statically allocated * (or duplicated and never freed) data, and call * tp_dbus_properties_mixin_class_init() from your class_init implementation. * * To use this mixin as the implementation of #TpSvcDBusProperties, * call G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, * tp_dbus_properties_mixin_iface_init) in the fourth argument to * G_DEFINE_TYPE_WITH_CODE. * * Since: 0.7.3 */ /** * TpDBusPropertiesMixinFlags: * @TP_DBUS_PROPERTIES_MIXIN_FLAG_READ: The property can be read using Get and * GetAll * @TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE: The property can be written using Set * @TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED: The property's new value is * included in emissions of PropertiesChanged * @TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED: The property is announced * as invalidated, without its value, in emissions of PropertiesChanged * * Bitfield representing allowed access to a property. At most one of * %TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED and * %TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED may be specified for a * property. * * Since 0.11.5, there is a corresponding #GFlagsClass type, * %TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS. * * Since: 0.7.3 */ /** * TP_TYPE_DBUS_PROPERTIES_MIXIN_FLAGS: * * The #GFlagsClass type of #TpDBusPropertiesMixinFlags. * * Since: 0.11.5 */ /** * TpDBusPropertiesMixinPropInfo: * @name: Quark representing the property's name * @flags: Flags representing read/write access to the property * @dbus_signature: The D-Bus signature of the property * @type: The GType used in a GValue to implement the property * * Semi-abstract description of a property, as attached to a service * GInterface. This structure must either be statically allocated, or * duplicated and never freed, so it always remains valid. * * In addition to the documented members, there are two private pointers * for future expansion, which must always be initialized to %NULL. * * Since: 0.7.3 */ /** * TpDBusPropertiesMixinIfaceInfo: * @dbus_interface: Quark representing the interface's name * @props: Array of property descriptions, terminated by one with * @name == %NULL * * Semi-abstract description of an interface. Each service GInterface that * has properties must have one of these attached to it via * tp_svc_interface_set_dbus_properties_info() in its base_init function; * service GInterfaces that do not have properties may have one of these * with no properties. * * This structure must either be statically allocated, or duplicated and never * freed, so it always remains valid. * * In addition to the documented members, there are two private pointers * for future expansion, which must always be initialized to %NULL. * * Since: 0.7.3 */ static GQuark _iface_prop_info_quark (void) { static GQuark q = 0; if (G_UNLIKELY (q == 0)) q = g_quark_from_static_string ("tp_svc_interface_get_dbus_properties_info@TELEPATHY_GLIB_0.7.3"); return q; } /** * tp_svc_interface_set_dbus_properties_info: * @g_interface: The #GType of a service interface * @info: an interface description * * Declare that @g_interface implements the given D-Bus interface, with the * given properties. This may only be called once per GInterface, usually from * a section of its base_init function that only runs once. * * This is typically only used within generated code; there is normally no * reason to call it manually. * * Since: 0.7.3 */ void tp_svc_interface_set_dbus_properties_info (GType g_interface, TpDBusPropertiesMixinIfaceInfo *info) { GQuark q = _iface_prop_info_quark (); TpDBusPropertiesMixinPropInfo *prop; g_return_if_fail (G_TYPE_IS_INTERFACE (g_interface)); g_return_if_fail (g_type_get_qdata (g_interface, q) == NULL); g_return_if_fail (info->dbus_interface != 0); g_return_if_fail (info->props != NULL); for (prop = info->props; prop->name != 0; prop++) { g_return_if_fail (prop->flags != 0); g_return_if_fail ( (prop->flags & ~( TP_DBUS_PROPERTIES_MIXIN_FLAG_READ | TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED | TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED )) == 0); /* Check that at most one change-related flag is set. */ if ((prop->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED) && (prop->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED)) { CRITICAL ("at most one of EMITS_CHANGED and EMITS_INVALIDATED may be " "specified for a property, but %s.%s has both", g_quark_to_string (info->dbus_interface), g_quark_to_string (prop->name)); g_return_if_reached (); } g_return_if_fail (prop->dbus_signature != NULL); g_return_if_fail (prop->dbus_signature[0] != '\0'); g_return_if_fail (prop->type != 0); } g_type_set_qdata (g_interface, q, info); } /** * tp_svc_interface_get_dbus_properties_info: (skip) * @g_interface: The #GType of a service interface * * Retrieves the D-Bus property metadata for the given interface, if any. * This function is typically not useful outside telepathy-glib itself, but may * be useful for domain-specific variations on the theme of SetProperty. If in * doubt, you probably don't need this function. * * Returns: D-Bus property metadata for @g_interface, or %NULL if it has * none. * Since: 0.15.8 */ TpDBusPropertiesMixinIfaceInfo * tp_svc_interface_get_dbus_properties_info (GType g_interface) { return g_type_get_qdata (g_interface, _iface_prop_info_quark ()); } /** * TpDBusPropertiesMixinGetter: * @object: The exported object with the properties * @iface: A quark representing the D-Bus interface name * @name: A quark representing the D-Bus property name * @value: A GValue pre-initialized to the right type, into which to put * the value * @getter_data: The getter_data from the #TpDBusPropertiesMixinPropImpl * * Signature of a callback used to get the value of a property. * * For simplicity, in this mixin we don't allow getting a property to fail; * implementations must always be prepared to return *something*. */ /** * tp_dbus_properties_mixin_getter_gobject_properties: * @object: The exported object with the properties * @iface: A quark representing the D-Bus interface name * @name: A quark representing the D-Bus property name * @value: A GValue pre-initialized to the right type, into which to put * the value * @getter_data: The getter_data from the #TpDBusPropertiesMixinPropImpl, * which must be a string containing the GObject property's name * * An implementation of #TpDBusPropertiesMixinGetter which assumes that * the @getter_data is the name of a readable #GObject property of an * appropriate type, and uses it for the value of the D-Bus property. */ void tp_dbus_properties_mixin_getter_gobject_properties (GObject *object, GQuark iface, GQuark name, GValue *value, gpointer getter_data) { g_object_get_property (object, getter_data, value); } /** * TpDBusPropertiesMixinSetter: * @object: The exported object with the properties * @iface: A quark representing the D-Bus interface name * @name: A quark representing the D-Bus property name * @value: The new value for the property * @setter_data: The setter_data from the #TpDBusPropertiesMixinPropImpl * @error: Used to return an error on failure * * Signature of a callback used to get the value of a property. * * Returns: %TRUE on success, %FALSE (setting @error) on failure */ /** * tp_dbus_properties_mixin_setter_gobject_properties: * @object: The exported object with the properties * @iface: A quark representing the D-Bus interface name * @name: A quark representing the D-Bus property name * @value: The new value for the property * @setter_data: The setter_data from the #TpDBusPropertiesMixinPropImpl, * which must be a string containing the GObject property's name * @error: Not used * * An implementation of #TpDBusPropertiesMixinSetter which assumes that the * @setter_data is the name of a writable #GObject property of an appropriate * type, and sets that property to the given value. * * Returns: %TRUE */ gboolean tp_dbus_properties_mixin_setter_gobject_properties (GObject *object, GQuark iface, GQuark name, const GValue *value, gpointer setter_data, GError **error) { g_object_set_property (object, setter_data, value); return TRUE; } /** * TpDBusPropertiesMixinPropImpl: * @name: The name of the property as it appears on D-Bus * @getter_data: Arbitrary user-supplied data for the getter function * @setter_data: Arbitrary user-supplied data for the setter function * * Structure representing an implementation of a property. * * In addition to the documented fields, there are three pointers which must * be initialized to %NULL. * * This structure must either be statically allocated, or duplicated and never * freed, so it always remains valid. * * Since: 0.7.3 */ /** * TpDBusPropertiesMixinIfaceImpl: * @name: The name of the interface * @getter: A callback to get the current value of the property, to which * the @getter_data from each property implementation will be passed * @setter: A callback to set a new value for the property, to which * the @setter_data from each property implementation will be passed * @props: An array of property implementations, terminated by one with * @name equal to %NULL * * Structure representing an implementation of an interface's properties. * * In addition to the documented fields, there are four pointers which must * be initialized to %NULL. * * This structure must either be statically allocated, or duplicated and never * freed, so it always remains valid. * * Since: 0.7.3 */ /** * TpDBusPropertiesMixinClass: * @interfaces: An array of interface implementations, terminated by one with * @name equal to %NULL * * Structure representing all of a class's property implementations. One of * these structures may be placed in the layout of an object class structure. * * In addition to the documented fields, there are 7 pointers reserved for * future use, which must be initialized to %NULL. * * Since: 0.7.3 */ static GQuark _prop_mixin_offset_quark (void) { static GQuark q = 0; if (G_UNLIKELY (q == 0)) q = g_quark_from_static_string ("tp_dbus_properties_mixin_class_init@TELEPATHY_GLIB_0.7.3"); return q; } static GQuark _extra_prop_impls_quark (void) { static GQuark q = 0; if (G_UNLIKELY (q == 0)) q = g_quark_from_static_string ("tp_dbus_properties_mixin_implement_interface@TELEPATHY_GLIB_0.7.9"); return q; } static gboolean link_interface (GType type, const GType *interfaces, GQuark iface_quark, TpDBusPropertiesMixinIfaceImpl *iface_impl) { TpDBusPropertiesMixinIfaceInfo *iface_info = NULL; TpDBusPropertiesMixinPropImpl *prop_impl; g_return_val_if_fail (iface_impl->props != NULL, FALSE); /* no point bothering if there is no quark for the interface name */ if (iface_quark != 0) { const GType *iface; for (iface = interfaces; *iface != 0; iface++) { iface_info = tp_svc_interface_get_dbus_properties_info (*iface); if (iface_info != NULL && iface_info->dbus_interface == iface_quark) break; else iface_info = NULL; } } if (iface_info == NULL) { CRITICAL ("%s tried to implement undefined interface %s " "(perhaps you forgot to call G_IMPLEMENT_INTERFACE?)", g_type_name (type), iface_impl->name); return FALSE; } iface_impl->mixin_priv = iface_info; for (prop_impl = iface_impl->props; prop_impl->name != NULL; prop_impl++) { TpDBusPropertiesMixinPropInfo *prop_info; GQuark name_quark = g_quark_try_string (prop_impl->name); prop_impl->mixin_priv = NULL; /* no point bothering if there is no quark for this name */ if (name_quark != 0) { for (prop_info = iface_info->props; prop_info->name != 0; prop_info++) { if (prop_info->name == name_quark) { prop_impl->mixin_priv = prop_info; break; } } } if (prop_impl->mixin_priv == NULL) { CRITICAL ("%s tried to implement nonexistent property %s" " on interface %s", g_type_name (type), prop_impl->name, iface_impl->name); return FALSE; } } return TRUE; } /* if this assertion fails, TpDBusPropertiesMixinIfaceImpl.mixin_next (which * used to be a GCallback but is now a gpointer) will be an ABI break on this * architecture, so do some evil trick with unions or something */ G_STATIC_ASSERT (sizeof (GCallback) == sizeof (gpointer)); /* FIXME: GNOME#556489: getter and setter should be (scope infinite) if that * existed */ /** * tp_dbus_properties_mixin_implement_interface: (skip) * @cls: a subclass of #GObjectClass * @iface: a quark representing the the name of the interface to implement * @getter: a callback to get properties on this interface, or %NULL if they * are all write-only * @setter: a callback to set properties on this interface, or %NULL if they * are all read-only * @props: an array of #TpDBusPropertiesMixinPropImpl representing individual * properties, terminated by one with @name == %NULL * * Declare that, in addition to any interfaces set in * tp_dbus_properties_mixin_class_init(), the given class (and its subclasses) * will implement the properties of the interface @iface using the callbacks * @getter and @setter and the properties given by @props. * * This function should be called from the class_init callback in such a way * that it will only be called once, even if the class is subclassed. * * Typically, the static array @interfaces in the #TpDBusPropertiesMixinClass * should be used for interfaces whose properties are implemented directly by * the class @cls, and this function should be used for interfaces whose * properties are implemented by mixins. * * It is an error for the same interface to appear in the array @interfaces * in the #TpDBusPropertiesMixinClass, and also be set up by this function. * * If a class C and a subclass S both implement the properties of the same * interface, only the implementations from the subclass S will be used, * regardless of whether the implementations in C and/or S were set up by * this function or via the array @interfaces in the * #TpDBusPropertiesMixinClass. */ void tp_dbus_properties_mixin_implement_interface (GObjectClass *cls, GQuark iface, TpDBusPropertiesMixinGetter getter, TpDBusPropertiesMixinSetter setter, TpDBusPropertiesMixinPropImpl *props) { GQuark extras_quark = _extra_prop_impls_quark (); GType type = G_OBJECT_CLASS_TYPE (cls); GType *interfaces = g_type_interfaces (type, NULL); TpDBusPropertiesMixinIfaceImpl *iface_impl; g_return_if_fail (G_IS_OBJECT_CLASS (cls)); /* never freed - intentional per-class leak */ iface_impl = g_new0 (TpDBusPropertiesMixinIfaceImpl, 1); iface_impl->name = g_quark_to_string (iface); iface_impl->getter = getter; iface_impl->setter = setter; iface_impl->props = props; /* align property implementations with abstract properties */ if (G_LIKELY (link_interface (type, interfaces, iface, iface_impl))) { TpDBusPropertiesMixinIfaceImpl *next = g_type_get_qdata (type, extras_quark); #ifdef ENABLE_DEBUG GQuark offset_quark = _prop_mixin_offset_quark (); gpointer offset_qdata = g_type_get_qdata (type, offset_quark); TpDBusPropertiesMixinClass *mixin = NULL; TpDBusPropertiesMixinIfaceImpl *iter; if (offset_qdata != NULL) mixin = &G_STRUCT_MEMBER (TpDBusPropertiesMixinClass, cls, GPOINTER_TO_SIZE (offset_qdata)); /* assert that we're not trying to implement the same interface twice */ for (iter = next; iter != NULL && iter->name != NULL; iter = iter->mixin_next) { TpDBusPropertiesMixinIfaceInfo *other_info = iter->mixin_priv; g_assert (other_info != NULL); if (G_UNLIKELY (other_info->dbus_interface == iface)) { CRITICAL ("type %s tried to implement interface %s with %s " "twice", g_type_name (type), g_quark_to_string (iface), G_STRFUNC); goto out; } } /* assert that we're not trying to implement the same interface via * this function and the static data */ if (mixin != NULL && mixin->interfaces != NULL) { for (iter = mixin->interfaces; iter->name != NULL; iter++) { TpDBusPropertiesMixinIfaceInfo *other_info = iter->mixin_priv; g_assert (other_info != NULL); if (G_UNLIKELY (other_info->dbus_interface == iface)) { CRITICAL ("type %s tried to implement interface %s with %s " "and also in static data", g_type_name (type), g_quark_to_string (iface), G_STRFUNC); goto out; } } } #endif /* form a linked list */ iface_impl->mixin_next = next; g_type_set_qdata (type, extras_quark, iface_impl); } #ifdef ENABLE_DEBUG out: #endif g_free (interfaces); } /** * tp_dbus_properties_mixin_class_init: * @cls: a subclass of #GObjectClass * @offset: the offset within @cls of a TpDBusPropertiesMixinClass structure * * Initialize the class @cls to use the D-Bus Properties mixin. * The given struct member, of size sizeof(TpDBusPropertiesMixinClass), * will be used to store property implementation information. * * Each property and each interface must have been declared as a member of * a GInterface implemented by @cls, using * tp_svc_interface_set_dbus_properties_info(). * * Before calling this function, the array @interfaces must have been * placed in the #TpDBusPropertiesMixinClass structure; if it would be empty, * it may instead be %NULL. * * This function should be called from the class_init callback in such a way * that it will only be called once, even if the class is subclassed. * * Changed in 0.7.9: TpDBusPropertiesMixinClass::interfaces may now be %NULL, * which means that only interfaces whose properties are set up using * tp_dbus_properties_mixin_implement_interface() will be used. * * Changed in 0.7.15: @offset may now be 0, in which case the * #TpDBusPropertiesMixinClass can be omitted from @cls. It is treated as if * it were present, but with all fields (including * TpDBusPropertiesMixinClass::interfaces) being %NULL, so only interfaces * whose properties are set using * tp_dbus_properties_mixin_implement_interface() will be used. * * Since: 0.7.3 */ void tp_dbus_properties_mixin_class_init (GObjectClass *cls, gsize offset) { GQuark q = _prop_mixin_offset_quark (); GType type = G_OBJECT_CLASS_TYPE (cls); TpDBusPropertiesMixinClass *mixin; TpDBusPropertiesMixinIfaceImpl *iface_impl; GType *interfaces; g_return_if_fail (G_IS_OBJECT_CLASS (cls)); g_return_if_fail (g_type_get_qdata (type, q) == NULL); g_type_set_qdata (type, q, GSIZE_TO_POINTER (offset)); if (offset == 0) return; mixin = &G_STRUCT_MEMBER (TpDBusPropertiesMixinClass, cls, offset); if (mixin->interfaces == NULL) return; interfaces = g_type_interfaces (type, NULL); for (iface_impl = mixin->interfaces; iface_impl->name != NULL; iface_impl++) { GQuark iface_quark = g_quark_try_string (iface_impl->name); #ifdef ENABLE_DEBUG TpDBusPropertiesMixinIfaceImpl *other_impl; #endif if (G_UNLIKELY (!link_interface (type, interfaces, iface_quark, iface_impl))) goto out; #ifdef ENABLE_DEBUG for (other_impl = mixin->interfaces; other_impl != iface_impl; other_impl++) { TpDBusPropertiesMixinIfaceInfo *other_info = other_impl->mixin_priv; if (G_UNLIKELY (iface_quark == other_info->dbus_interface)) { CRITICAL ("type %s tried to implement interface %s in static " "data twice", g_type_name (type), iface_impl->name); goto out; } } #endif } out: g_free (interfaces); } static TpDBusPropertiesMixinIfaceImpl * _tp_dbus_properties_mixin_find_iface_impl (GObject *self, const gchar *name) { GType type; GQuark offset_quark = _prop_mixin_offset_quark (); GQuark extras_quark = _extra_prop_impls_quark (); GQuark iface_quark = g_quark_try_string (name); if (iface_quark == 0) return NULL; for (type = G_OBJECT_TYPE (self); type != 0; type = g_type_parent (type)) { gpointer offset = g_type_get_qdata (type, offset_quark); TpDBusPropertiesMixinClass *mixin = NULL; TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinIfaceInfo *iface_info; if (offset != NULL) mixin = &G_STRUCT_MEMBER (TpDBusPropertiesMixinClass, G_OBJECT_GET_CLASS (self), GPOINTER_TO_SIZE (offset)); if (mixin != NULL && mixin->interfaces != NULL) { for (iface_impl = mixin->interfaces; iface_impl->name != NULL; iface_impl++) { iface_info = iface_impl->mixin_priv; if (iface_info->dbus_interface == iface_quark) return iface_impl; } } for (iface_impl = g_type_get_qdata (type, extras_quark); iface_impl != NULL; iface_impl = iface_impl->mixin_next) { iface_info = iface_impl->mixin_priv; if (iface_info->dbus_interface == iface_quark) return iface_impl; } } return NULL; } static TpDBusPropertiesMixinPropImpl * _tp_dbus_properties_mixin_find_prop_impl (TpDBusPropertiesMixinIfaceImpl *iface_impl, const gchar *name) { GQuark prop_quark = g_quark_try_string (name); TpDBusPropertiesMixinPropImpl *prop_impl; if (prop_quark == 0) return NULL; for (prop_impl = iface_impl->props; prop_impl->name != NULL; prop_impl++) { TpDBusPropertiesMixinPropInfo *prop_info = prop_impl->mixin_priv; if (prop_info->name == prop_quark) return prop_impl; } return NULL; } static TpDBusPropertiesMixinPropImpl * _iface_impl_get_property_impl ( GObject *self, TpDBusPropertiesMixinIfaceImpl *iface_impl, const gchar *interface_name, const gchar *property_name, GError **error) { TpDBusPropertiesMixinPropImpl *prop_impl; TpDBusPropertiesMixinPropInfo *prop_info; prop_impl = _tp_dbus_properties_mixin_find_prop_impl (iface_impl, property_name); if (prop_impl == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Unknown property %s on %s", property_name, interface_name); return FALSE; } prop_info = prop_impl->mixin_priv; if ((prop_info->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_READ) == 0) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "Property %s on %s is write-only", property_name, interface_name); return FALSE; } if (iface_impl->getter == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Getting properties on %s is unimplemented", interface_name); return FALSE; } return prop_impl; } /** * tp_dbus_properties_mixin_get: * @self: an object with this mixin * @interface_name: a D-Bus interface name * @property_name: a D-Bus property name * @value: an unset GValue (initialized to all zeroes) * @error: used to return an error on failure * * Initialize @value with the type of the property @property_name on * @interface_name, and write the value of that property into it as if * by calling the D-Bus method org.freedesktop.DBus.Properties.Get. * * If Get would return a D-Bus error, @value remains unset and @error * is filled in instead. * * Returns: %TRUE (filling @value) on success, %FALSE (setting @error) * on failure * Since: 0.7.13 */ gboolean tp_dbus_properties_mixin_get (GObject *self, const gchar *interface_name, const gchar *property_name, GValue *value, GError **error) { TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinPropImpl *prop_impl; g_return_val_if_fail (G_IS_OBJECT (self), FALSE); g_return_val_if_fail (interface_name != NULL, FALSE); g_return_val_if_fail (property_name != NULL, FALSE); g_return_val_if_fail (value != NULL, FALSE); iface_impl = _tp_dbus_properties_mixin_find_iface_impl (self, interface_name); if (iface_impl == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No properties known for interface %s", interface_name); return FALSE; } prop_impl = _iface_impl_get_property_impl (self, iface_impl, interface_name, property_name, error); if (prop_impl != NULL) { TpDBusPropertiesMixinIfaceInfo *iface_info = iface_impl->mixin_priv; TpDBusPropertiesMixinPropInfo *prop_info = prop_impl->mixin_priv; g_value_init (value, prop_info->type); iface_impl->getter (self, iface_info->dbus_interface, prop_info->name, value, prop_impl->getter_data); return TRUE; } else { return FALSE; } } static void tp_dbus_properties_mixin_fill_properties_hash_va ( GObject *object, GHashTable *table, const gchar *first_interface, const gchar *first_property, va_list ap) { const gchar *iface, *property; gboolean first = TRUE; for (iface = first_interface; iface != NULL; iface = va_arg (ap, gchar *)) { GValue *value = g_slice_new0 (GValue); GError *error = NULL; if (first) { property = first_property; first = FALSE; } else { property = va_arg (ap, gchar *); } /* If property is NULL, the caller might have omitted a comma or * something; in any case, it shouldn't be. */ g_assert (property != NULL); if (tp_dbus_properties_mixin_get (object, iface, property, value, &error)) { g_assert (G_IS_VALUE (value)); g_hash_table_insert (table, g_strdup_printf ("%s.%s", iface, property), value); } else { /* This is bad and definitely indicates a programming error. */ CRITICAL ("Couldn't fetch '%s' on interface '%s': %s", property, iface, error->message); g_clear_error (&error); } } } /** * tp_dbus_properties_mixin_fill_properties_hash: (skip) * @object: an object which uses the D-Bus properties mixin * @table: (element-type utf8 GObject.Value): a hash table where the keys are * strings copied with g_strdup() and the values are slice-allocated * #GValues * @first_interface: the interface of the first property to be retrieved * @first_property: the name of the first property to be retrieved * @...: more (interface name, property name) pairs, terminated by %NULL. * * Retrieves the values of several D-Bus properties from an object, and adds * them to a hash mapping the fully-qualified name of the property to its * value. This is equivalent to calling tp_dbus_properties_mixin_get() for * each property and adding it to the table yourself, with the proviso that * this function will g_assert() if retrieving a property fails (for instance, * because it does not exist). * * Note that in particular, @table does not have the same memory-allocation * model as the hash tables required by tp_asv_set_string() and similar * functions. * * Since: 0.11.11 */ void tp_dbus_properties_mixin_fill_properties_hash ( GObject *object, GHashTable *table, const gchar *first_interface, const gchar *first_property, ...) { va_list ap; va_start (ap, first_property); tp_dbus_properties_mixin_fill_properties_hash_va (object, table, first_interface, first_property, ap); va_end (ap); } /** * tp_dbus_properties_mixin_make_properties_hash: (skip) * @object: an object which uses the D-Bus properties mixin * @first_interface: the interface of the first property to be retrieved * @first_property: the name of the first property to be retrieved * @...: more (interface name, property name) pairs, terminated by %NULL. * * Retrieves the values of several D-Bus properties from an object, and builds * a hash mapping the fully-qualified name of the property to its value. This * is equivalent to calling tp_dbus_properties_mixin_get() for each property * and building the table yourself, with the proviso that this function will * g_assert() if retrieving a property fails (for instance, because it does not * exist). * * Additional keys and values can be inserted into the returned hash table; * if this is done, the inserted keys and values will be freed when the * hash table is destroyed. The keys must be allocated with g_strdup() or * equivalent, and the values must be slice-allocated (for instance with * tp_g_value_slice_new_string() or a similar function). * * Note that in particular, tp_asv_set_string() and similar functions should * not be used with this hash table. * * Returns: a hash table mapping (gchar *) fully-qualified property names to * GValues, which must be freed by the caller (at which point its * contents will also be freed). */ GHashTable * tp_dbus_properties_mixin_make_properties_hash ( GObject *object, const gchar *first_interface, const gchar *first_property, ...) { GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); va_list ap; va_start (ap, first_property); tp_dbus_properties_mixin_fill_properties_hash_va (object, table, first_interface, first_property, ap); va_end (ap); return table; } /** * tp_dbus_properties_mixin_emit_properties_changed: * @object: an object which uses the D-Bus properties mixin * @interface_name: the interface on which properties have changed * @properties: (allow-none): a %NULL-terminated array of (unqualified) * property names whose values have changed. * * Emits the PropertiesChanged signal for the provided properties. Depending on * the EmitsChangedSignal annotations in the introspection XML, either the new * value of the property will be included in the signal, or merely the fact * that the property has changed. * * For example, the MPRIS specification defines a TrackList interface with two * properties, one of which is annotated with EmitsChangedSignal=true and one * annotated with EmitsChangedSignal=invalidates. The following call would * include the new value of CanEditTracks and list Tracks as invalidated: * * |[ * const gchar *properties[] = { "CanEditTracks", "Tracks", NULL }; * * tp_dbus_properties_mixin_emit_properties_changed (G_OBJECT (self), * "org.mpris.MediaPlayer2.TrackList", properties); * ]| * * It is an error to pass a property to this * function if the property is annotated with EmitsChangedSignal=false, or is * unannotated. * * Since: 0.15.6 */ void tp_dbus_properties_mixin_emit_properties_changed ( GObject *object, const gchar *interface_name, const gchar * const *properties) { TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinIfaceInfo *iface_info; GHashTable *changed_properties; GPtrArray *invalidated_properties; const gchar * const *prop_name; g_return_if_fail (interface_name != NULL); iface_impl = _tp_dbus_properties_mixin_find_iface_impl (object, interface_name); g_return_if_fail (iface_impl != NULL); iface_info = iface_impl->mixin_priv; /* If someone passes no property names, well … that's fine, we have nothing * to do. */ if (properties == NULL || properties[0] == NULL) return; changed_properties = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); invalidated_properties = g_ptr_array_new (); for (prop_name = properties; *prop_name != NULL; prop_name++) { TpDBusPropertiesMixinPropImpl *prop_impl; TpDBusPropertiesMixinPropInfo *prop_info; GError *error = NULL; prop_impl = _iface_impl_get_property_impl (object, iface_impl, interface_name, *prop_name, &error); if (prop_impl == NULL) { WARNING ("Couldn't get value for '%s.%s': %s", interface_name, *prop_name, error->message); g_clear_error (&error); g_return_if_reached (); } prop_info = prop_impl->mixin_priv; if (prop_info->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED) { GValue v = { 0, }; g_value_init (&v, prop_info->type); iface_impl->getter (object, iface_info->dbus_interface, prop_info->name, &v, prop_impl->getter_data); g_hash_table_insert (changed_properties, (gchar *) *prop_name, tp_g_value_slice_dup (&v)); g_value_unset (&v); } else if (prop_info->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED) { g_ptr_array_add (invalidated_properties, (gchar *) *prop_name); } else { WARNING ("'%s.%s' is not annotated with EmitsChangedSignal'", interface_name, *prop_name); } } g_ptr_array_add (invalidated_properties, NULL); tp_svc_dbus_properties_emit_properties_changed (object, interface_name, changed_properties, (const gchar **) invalidated_properties->pdata); g_hash_table_unref (changed_properties); g_ptr_array_unref (invalidated_properties); } /** * tp_dbus_properties_mixin_emit_properties_changed_varargs: (skip) * @object: an object which uses the D-Bus properties mixin * @interface_name: the interface on which properties have changed * @...: property names (unqualified) whose values have changed, terminated by * %NULL. * * A shortcut for calling tp_dbus_properties_mixin_emit_properties_changed(). * * Since: 0.15.6 */ void tp_dbus_properties_mixin_emit_properties_changed_varargs ( GObject *object, const gchar *interface_name, ...) { GPtrArray *property_names = g_ptr_array_new (); char *property_name; va_list ap; va_start (ap, interface_name); do { property_name = va_arg (ap, char *); g_ptr_array_add (property_names, property_name); } while (property_name != NULL); va_end (ap); tp_dbus_properties_mixin_emit_properties_changed (object, interface_name, (const gchar * const *) property_names->pdata); g_ptr_array_unref (property_names); } static void _tp_dbus_properties_mixin_get (TpSvcDBusProperties *iface, const gchar *interface_name, const gchar *property_name, DBusGMethodInvocation *context) { GObject *self = G_OBJECT (iface); GValue value = { 0 }; GError *error = NULL; if (tp_dbus_properties_mixin_get (self, interface_name, property_name, &value, &error)) { tp_svc_dbus_properties_return_from_get (context, &value); g_value_unset (&value); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_dbus_properties_mixin_dup_all: * @self: an object with this mixin * @interface_name: a D-Bus interface name * * Get all the properties of a particular interface. This implementation * never returns an error: it will return an empty map if the interface * is unknown. * * Returns: (transfer container) (element-type utf8 GObject.Value): a map * from property name (without the interface name) to value * Since: 0.21.2 */ GHashTable * tp_dbus_properties_mixin_dup_all (GObject *self, const gchar *interface_name) { TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinIfaceInfo *iface_info; TpDBusPropertiesMixinPropImpl *prop_impl; /* no key destructor needed - the keys are immortal */ GHashTable *values = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); iface_impl = _tp_dbus_properties_mixin_find_iface_impl (self, interface_name); if (iface_impl == NULL || iface_impl->getter == NULL) return values; iface_info = iface_impl->mixin_priv; for (prop_impl = iface_impl->props; prop_impl->name != NULL; prop_impl++) { TpDBusPropertiesMixinPropInfo *prop_info = prop_impl->mixin_priv; GValue *value; if ((prop_info->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_READ) == 0) continue; value = tp_g_value_slice_new (prop_info->type); iface_impl->getter (self, iface_info->dbus_interface, prop_info->name, value, prop_impl->getter_data); g_hash_table_insert (values, (gchar *) prop_impl->name, value); } return values; } static void _tp_dbus_properties_mixin_get_all_dbus (TpSvcDBusProperties *iface, const gchar *interface_name, DBusGMethodInvocation *context) { GHashTable *values = tp_dbus_properties_mixin_dup_all (G_OBJECT (iface), interface_name); tp_svc_dbus_properties_return_from_get_all (context, values); g_hash_table_unref (values); } /** * tp_dbus_properties_mixin_set: * @self: an object with this mixin * @interface_name: a D-Bus interface name * @property_name: a D-Bus property name * @value: a GValue containing the new value for this property. * @error: used to return an error on failure * * Sets a property to the value specified by @value, as if by * calling the D-Bus method org.freedesktop.DBus.Properties.Set. * * If Set would return a D-Bus error, sets @error and returns %FALSE * * Returns: %TRUE on success; %FALSE (setting @error) on failure * Since: 0.15.8 */ gboolean tp_dbus_properties_mixin_set ( GObject *self, const gchar *interface_name, const gchar *property_name, const GValue *value, GError **error) { TpDBusPropertiesMixinIfaceImpl *iface_impl; TpDBusPropertiesMixinIfaceInfo *iface_info; TpDBusPropertiesMixinPropImpl *prop_impl; TpDBusPropertiesMixinPropInfo *prop_info; GValue copy = { 0 }; gboolean ret; g_return_val_if_fail (G_IS_OBJECT (self), FALSE); g_return_val_if_fail (interface_name != NULL, FALSE); g_return_val_if_fail (property_name != NULL, FALSE); g_return_val_if_fail (G_IS_VALUE (value), FALSE); iface_impl = _tp_dbus_properties_mixin_find_iface_impl (self, interface_name); if (iface_impl == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "No properties known for interface '%s'", interface_name); return FALSE; } iface_info = iface_impl->mixin_priv; prop_impl = _tp_dbus_properties_mixin_find_prop_impl (iface_impl, property_name); if (prop_impl == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Unknown property '%s' on interface '%s'", property_name, interface_name); return FALSE; } prop_info = prop_impl->mixin_priv; if ((prop_info->flags & TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE) == 0) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "'%s.%s' is read-only", interface_name, property_name); return FALSE; } if (iface_impl->setter == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Setting properties on '%s' is unimplemented", interface_name); return FALSE; } if (G_VALUE_TYPE (value) != prop_info->type) { g_value_init (©, prop_info->type); if (!g_value_transform (value, ©)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Cannot convert %s to %s for property %s", g_type_name (G_VALUE_TYPE (value)), g_type_name (prop_info->type), property_name); ret = FALSE; goto out; } /* use copy instead of value from now on */ value = © } ret = iface_impl->setter (self, iface_info->dbus_interface, prop_info->name, value, prop_impl->setter_data, error); out: if (G_IS_VALUE (©)) g_value_unset (©); return ret; } static void _tp_dbus_properties_mixin_set (TpSvcDBusProperties *iface, const gchar *interface_name, const gchar *property_name, const GValue *value, DBusGMethodInvocation *context) { GObject *self = G_OBJECT (iface); GError *error = NULL; if (tp_dbus_properties_mixin_set (self, interface_name, property_name, value, &error)) { tp_svc_dbus_properties_return_from_set (context); } else { dbus_g_method_return_error (context, error); g_error_free (error); } } /** * tp_dbus_properties_mixin_iface_init: * @g_iface: a pointer to a #TpSvcDBusPropertiesClass structure * @iface_data: ignored * * Declare that the DBus.Properties interface represented by @g_iface * is implemented using this mixin. */ void tp_dbus_properties_mixin_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcDBusPropertiesClass *cls = g_iface; #define IMPLEMENT(x, suffix) \ tp_svc_dbus_properties_implement_##x (cls, \ _tp_dbus_properties_mixin_##x##suffix) IMPLEMENT (get,); IMPLEMENT (get_all,_dbus); IMPLEMENT (set,); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/dbus-properties-mixin.h0000644000175000017500000001237612652510705021002 00000000000000/* * dbus-properties-mixin.h - D-Bus core Properties * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_DBUS_PROPERTIES_MIXIN_H__ #define __TP_DBUS_PROPERTIES_MIXIN_H__ #include #include #include G_BEGIN_DECLS /* ---- Semi-abstract property definition (used in TpSvc*) ---------- */ typedef enum { /*< flags >*/ TP_DBUS_PROPERTIES_MIXIN_FLAG_READ = 1, TP_DBUS_PROPERTIES_MIXIN_FLAG_WRITE = 2, TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_CHANGED = 4, TP_DBUS_PROPERTIES_MIXIN_FLAG_EMITS_INVALIDATED = 8 } TpDBusPropertiesMixinFlags; typedef struct { GQuark name; TpDBusPropertiesMixinFlags flags; gchar *dbus_signature; GType type; /**/ GCallback _1; GCallback _2; } TpDBusPropertiesMixinPropInfo; typedef struct { GQuark dbus_interface; TpDBusPropertiesMixinPropInfo *props; /**/ GCallback _1; GCallback _2; } TpDBusPropertiesMixinIfaceInfo; void tp_svc_interface_set_dbus_properties_info (GType g_interface, TpDBusPropertiesMixinIfaceInfo *info); _TP_AVAILABLE_IN_0_16 TpDBusPropertiesMixinIfaceInfo *tp_svc_interface_get_dbus_properties_info ( GType g_interface); /* ---- Concrete implementation (in GObject subclasses) ------------- */ typedef void (*TpDBusPropertiesMixinGetter) (GObject *object, GQuark iface, GQuark name, GValue *value, gpointer getter_data); void tp_dbus_properties_mixin_getter_gobject_properties (GObject *object, GQuark iface, GQuark name, GValue *value, gpointer getter_data); typedef gboolean (*TpDBusPropertiesMixinSetter) (GObject *object, GQuark iface, GQuark name, const GValue *value, gpointer setter_data, GError **error); gboolean tp_dbus_properties_mixin_setter_gobject_properties (GObject *object, GQuark iface, GQuark name, const GValue *value, gpointer setter_data, GError **error); typedef struct { const gchar *name; gpointer getter_data; gpointer setter_data; /**/ GCallback _1; GCallback _2; gpointer mixin_priv; } TpDBusPropertiesMixinPropImpl; typedef struct { const gchar *name; TpDBusPropertiesMixinGetter getter; TpDBusPropertiesMixinSetter setter; TpDBusPropertiesMixinPropImpl *props; /**/ GCallback _1; GCallback _2; gpointer mixin_next; gpointer mixin_priv; } TpDBusPropertiesMixinIfaceImpl; struct _TpDBusPropertiesMixinClass { TpDBusPropertiesMixinIfaceImpl *interfaces; /**/ gpointer _1; gpointer _2; gpointer _3; gpointer _4; gpointer _5; gpointer _6; gpointer _7; }; typedef struct _TpDBusPropertiesMixinClass TpDBusPropertiesMixinClass; void tp_dbus_properties_mixin_class_init (GObjectClass *cls, gsize offset); void tp_dbus_properties_mixin_implement_interface (GObjectClass *cls, GQuark iface, TpDBusPropertiesMixinGetter getter, TpDBusPropertiesMixinSetter setter, TpDBusPropertiesMixinPropImpl *props); void tp_dbus_properties_mixin_iface_init (gpointer g_iface, gpointer iface_data); gboolean tp_dbus_properties_mixin_get (GObject *self, const gchar *interface_name, const gchar *property_name, GValue *value, GError **error); _TP_AVAILABLE_IN_0_16 gboolean tp_dbus_properties_mixin_set ( GObject *self, const gchar *interface_name, const gchar *property_name, const GValue *value, GError **error); _TP_AVAILABLE_IN_0_22 GHashTable *tp_dbus_properties_mixin_dup_all (GObject *self, const gchar *interface_name); GHashTable *tp_dbus_properties_mixin_make_properties_hash ( GObject *object, const gchar *first_interface, const gchar *first_property, ...) G_GNUC_NULL_TERMINATED G_GNUC_WARN_UNUSED_RESULT; void tp_dbus_properties_mixin_fill_properties_hash (GObject *object, GHashTable *table, const gchar *first_interface, const gchar *first_property, ...) G_GNUC_NULL_TERMINATED; _TP_AVAILABLE_IN_0_16 void tp_dbus_properties_mixin_emit_properties_changed ( GObject *object, const gchar *interface_name, const gchar * const *properties); _TP_AVAILABLE_IN_0_16 void tp_dbus_properties_mixin_emit_properties_changed_varargs ( GObject *object, const gchar *interface_name, ...) G_GNUC_NULL_TERMINATED; G_END_DECLS #endif /* #ifndef __TP_DBUS_PROPERTIES_MIXIN_H__ */ telepathy-glib-0.24.2/telepathy-glib/call-stream.xml0000644000175000017500000000046212652510705017277 00000000000000 Call Stream interfaces, version 1 telepathy-glib-0.24.2/telepathy-glib/telepathy-glib.h0000644000175000017500000001225312652510705017435 00000000000000/* * telepathy-glib.h - Headers for telepathy-glib * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_GLIB_H__ #define __TP_GLIB_H__ #define _TP_IN_META_HEADER #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* deprecated, gone in 1.0 */ #include #include #include #include /* D-Bus-API-dependent, moved to telepathy-glib-dbus.h in 1.0 */ #include #include #include #include #undef _TP_IN_META_HEADER #endif /* __TP_GLIB_H__ */ telepathy-glib-0.24.2/telepathy-glib/base-media-call-channel.c0000644000175000017500000004502112652510705021023 00000000000000/* * base-media-call-channel.c - Source for TpBaseMediaCallChannel * Copyright © 2011 Collabora Ltd. * @author Olivier Crete * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-media-call-channel * @title: TpBaseMediaCallChannel * @short_description: base class for #TpSvcChannelTypeCall RTP media implementations * @see_also: #TpBaseCallChannel, #TpBaseMediaCallContent, #TpBaseMediaCallStream * * This is a base class for connection managers that use standard RTP media. * * Since: 0.17.5 */ /** * TpBaseMediaCallChannel: * * A base class for call channel implementations with standard RTP * * Since: 0.17.5 */ /** * TpBaseMediaCallChannelClass: * @hold_state_changed: optional; virtual method called when the hold state * changed * @accept: optional; virtual method called when the call is locally accepted * and contents are ready. This replaces #TpBaseCallChannelClass.accept. * * The class structure for #TpBaseMediaCallChannel * * Since: 0.17.5 */ /** * TpBaseMediaCallChannelVoidFunc: * @self: a #TpBaseMediaCallChannel * * Signature of an implementation of #TpBaseMediaCallChannelClass.accept. * * Since: 0.17.5 */ /** * TpBaseMediaCallChannelHoldStateChangedFunc: * @self: a #TpBaseMediaCallChannel * @hold_state: the new #TpLocalHoldState * @hold_state_reason: the #TpLocalHoldStateReason for this change * * Signature of an implementation of * #TpBaseMediaCallChannelClass.hold_state_changed. * * Since: 0.17.5 */ #include "config.h" #include "base-media-call-channel.h" #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-content.h" #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/base-connection.h" #include "telepathy-glib/channel-iface.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/enums.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-channel.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/util.h" static void hold_iface_init (gpointer g_iface, gpointer iface_data); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseMediaCallChannel, tp_base_media_call_channel, TP_TYPE_BASE_CALL_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD, hold_iface_init) ) /* private structure */ struct _TpBaseMediaCallChannelPrivate { TpLocalHoldState hold_state; TpLocalHoldStateReason hold_state_reason; gboolean accepted; }; /* properties */ enum { LAST_PROPERTY }; static GPtrArray * tp_base_media_call_channel_get_interfaces (TpBaseChannel *base) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( tp_base_media_call_channel_parent_class)->get_interfaces (base); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_HOLD); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_DTMF); return interfaces; } static void call_members_changed_cb (TpBaseMediaCallChannel *self, GHashTable *updates, GHashTable *identifiers, GArray *removed, GValueArray *reason, gpointer user_data) { TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); GList *l, *l2; GHashTable *call_members = tp_base_call_channel_get_call_members (bcc); /* check for remote hold */ for (l = tp_base_call_channel_get_contents (bcc); l != NULL; l = l->next) { for (l2 = tp_base_call_content_get_streams (l->data); l2 != NULL; l2 = l2->next) { TpBaseMediaCallStream *stream = TP_BASE_MEDIA_CALL_STREAM (l2->data); GHashTable *remote_members = _tp_base_call_stream_get_remote_members ( TP_BASE_CALL_STREAM (stream)); gboolean all_held = TRUE; GHashTableIter iter; gpointer contact; g_hash_table_iter_init (&iter, remote_members); while (g_hash_table_iter_next (&iter, &contact, NULL)) { gpointer value; if (g_hash_table_lookup_extended (call_members, contact, NULL, &value)) { TpCallMemberFlags flags = GPOINTER_TO_UINT (value); if ((flags & TP_CALL_MEMBER_FLAG_HELD) == 0) all_held = FALSE; } } _tp_base_media_call_stream_set_remotely_held (stream, all_held); } } } static void tp_base_media_call_channel_try_accept (TpBaseMediaCallChannel *self) { TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); TpBaseMediaCallChannelClass *klass = TP_BASE_MEDIA_CALL_CHANNEL_GET_CLASS (self); GList *l; gboolean notready = FALSE; if (self->priv->accepted) return; for (l = tp_base_call_channel_get_contents (bcc); l; l = l->next) notready |= !_tp_base_media_call_content_ready_to_accept (l->data); if (notready && !_tp_base_media_channel_is_held (self)) return; if (klass->accept != NULL) klass->accept (self); TP_BASE_CALL_CHANNEL_CLASS (tp_base_media_call_channel_parent_class)->accept (bcc); self->priv->accepted = TRUE; } static void streams_changed_cb (GObject *stream, gpointer spec, TpBaseMediaCallChannel *self) { tp_base_media_call_channel_try_accept (self); if (self->priv->accepted) g_signal_handlers_disconnect_by_func (stream, streams_changed_cb, self); } static void wait_for_streams_to_be_receiving (TpBaseMediaCallChannel *self) { TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); GList *l; for (l = tp_base_call_channel_get_contents (bcc); l; l = l->next) { TpBaseCallContent *content = l->data; GList *l_stream; if (tp_base_call_content_get_disposition (content) != TP_CALL_CONTENT_DISPOSITION_INITIAL) continue; for (l_stream = tp_base_call_content_get_streams (content); l_stream; l_stream = l_stream->next) { TpBaseCallStream *stream = l_stream->data; g_signal_connect (stream, "notify::receiving-state", G_CALLBACK (streams_changed_cb), self); g_signal_connect (stream, "notify::remote-members", G_CALLBACK (streams_changed_cb), self); } } } static void tp_base_media_call_channel_accept (TpBaseCallChannel *bcc) { TpBaseMediaCallChannel *self = TP_BASE_MEDIA_CALL_CHANNEL (bcc); tp_base_media_call_channel_try_accept (self); if (!self->priv->accepted) wait_for_streams_to_be_receiving (self); } static void tp_base_media_call_channel_remote_accept (TpBaseCallChannel *self) { g_list_foreach (tp_base_call_channel_get_contents (self), (GFunc) _tp_base_media_call_content_remote_accepted, NULL); } static gboolean tp_base_media_call_channel_is_connected (TpBaseCallChannel *self) { GList *l; g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_CHANNEL (self), FALSE); for (l = tp_base_call_channel_get_contents (self); l != NULL; l = l->next) { GList *streams = tp_base_call_content_get_streams (l->data); for (; streams != NULL; streams = streams->next) { GList *endpoints; gboolean has_connected_endpoint = FALSE; endpoints = tp_base_media_call_stream_get_endpoints (streams->data); for (; endpoints != NULL; endpoints = endpoints->next) { TpStreamEndpointState state = tp_call_stream_endpoint_get_state ( endpoints->data, TP_STREAM_COMPONENT_DATA); if (state == TP_STREAM_ENDPOINT_STATE_PROVISIONALLY_CONNECTED || state == TP_STREAM_ENDPOINT_STATE_FULLY_CONNECTED) { has_connected_endpoint = TRUE; break; } } if (!has_connected_endpoint) return FALSE; } } return TRUE; } static void tp_base_media_call_channel_class_init (TpBaseMediaCallChannelClass *klass) { TpBaseChannelClass *base_channel_class = TP_BASE_CHANNEL_CLASS (klass); TpBaseCallChannelClass *base_call_channel_class = TP_BASE_CALL_CHANNEL_CLASS (klass); g_type_class_add_private (klass, sizeof (TpBaseMediaCallChannelPrivate)); base_channel_class->get_interfaces = tp_base_media_call_channel_get_interfaces; base_call_channel_class->accept = tp_base_media_call_channel_accept; base_call_channel_class->remote_accept = tp_base_media_call_channel_remote_accept; base_call_channel_class->is_connected = tp_base_media_call_channel_is_connected; } static void tp_base_media_call_channel_init (TpBaseMediaCallChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_MEDIA_CALL_CHANNEL, TpBaseMediaCallChannelPrivate); self->priv->hold_state = TP_LOCAL_HOLD_STATE_UNHELD; self->priv->hold_state_reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED; g_signal_connect (self, "call-members-changed", G_CALLBACK (call_members_changed_cb), NULL); } static void update_hold_state (TpBaseMediaCallChannel *self); static void set_hold_state (TpBaseMediaCallChannel *self, TpLocalHoldState hold_state, TpLocalHoldStateReason hold_state_reason) { TpBaseMediaCallChannelClass *klass = TP_BASE_MEDIA_CALL_CHANNEL_GET_CLASS (self); gboolean changed; g_return_if_fail (hold_state_reason < TP_NUM_LOCAL_HOLD_STATE_REASONS); changed = (self->priv->hold_state != hold_state); self->priv->hold_state = hold_state; self->priv->hold_state_reason = hold_state_reason; if (changed) { if (klass->hold_state_changed != NULL) klass->hold_state_changed (self, hold_state, hold_state_reason); tp_svc_channel_interface_hold_emit_hold_state_changed (self, hold_state, hold_state_reason); update_hold_state (self); } } static void update_hold_state (TpBaseMediaCallChannel *self) { TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); GList *l, *l2; gboolean is_started = TRUE; gboolean is_stopped = TRUE; TpLocalHoldState new_hold_state = self->priv->hold_state; if (self->priv->hold_state != TP_LOCAL_HOLD_STATE_PENDING_HOLD && self->priv->hold_state != TP_LOCAL_HOLD_STATE_PENDING_UNHOLD) return; if (!tp_base_call_channel_is_accepted (TP_BASE_CALL_CHANNEL (self))) goto done; for (l = tp_base_call_channel_get_contents (bcc); l != NULL; l = l->next) { for (l2 = tp_base_call_content_get_streams (l->data); l2 != NULL; l2 = l2->next) { TpBaseMediaCallStream *stream = TP_BASE_MEDIA_CALL_STREAM (l2->data); GHashTable *members = _tp_base_call_stream_get_remote_members ( TP_BASE_CALL_STREAM (stream)); TpSendingState local = tp_base_call_stream_get_local_sending_state ( TP_BASE_CALL_STREAM (stream)); GHashTableIter iter; gpointer key, value; gboolean wants_receive = FALSE; g_hash_table_iter_init (&iter, members); while (g_hash_table_iter_next (&iter, &key, &value)) { TpSendingState member_state = GPOINTER_TO_INT (value); if (member_state == TP_SENDING_STATE_PENDING_SEND || member_state == TP_SENDING_STATE_SENDING) { wants_receive = TRUE; break; } } tp_base_media_call_stream_update_receiving_state (stream); tp_base_media_call_stream_update_sending_state (stream); if (tp_base_media_call_stream_get_sending_state (stream) != TP_STREAM_FLOW_STATE_STOPPED || tp_base_media_call_stream_get_receiving_state (stream) != TP_STREAM_FLOW_STATE_STOPPED) is_stopped = FALSE; if ((tp_base_media_call_stream_get_sending_state (stream) != TP_STREAM_FLOW_STATE_STARTED && local == TP_SENDING_STATE_SENDING) || (tp_base_media_call_stream_get_receiving_state (stream) != TP_STREAM_FLOW_STATE_STARTED && wants_receive)) is_started = FALSE; } } done: if (self->priv->hold_state == TP_LOCAL_HOLD_STATE_PENDING_HOLD && is_stopped) new_hold_state = TP_LOCAL_HOLD_STATE_HELD; else if (self->priv->hold_state == TP_LOCAL_HOLD_STATE_PENDING_UNHOLD && is_started) new_hold_state = TP_LOCAL_HOLD_STATE_UNHELD; if (new_hold_state != self->priv->hold_state) set_hold_state (self, new_hold_state, self->priv->hold_state_reason); } static void hold_change_failed (TpBaseMediaCallChannel *self) { TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); GList *l, *l2; if (self->priv->hold_state != TP_LOCAL_HOLD_STATE_PENDING_UNHOLD) return; set_hold_state (self, TP_LOCAL_HOLD_STATE_PENDING_HOLD, TP_LOCAL_HOLD_STATE_REASON_RESOURCE_NOT_AVAILABLE); for (l = tp_base_call_channel_get_contents (bcc); l != NULL; l = l->next) { for (l2 = tp_base_call_content_get_streams (l->data); l2 != NULL; l2 = l2->next) { TpBaseMediaCallStream *stream = TP_BASE_MEDIA_CALL_STREAM (l2->data); tp_base_media_call_stream_update_receiving_state (stream); tp_base_media_call_stream_update_sending_state (stream); } } /* Ensure we escape channel pending state if there is no more pending stream state * change. */ update_hold_state (self); } static void tp_base_media_call_channel_get_hold_state ( TpSvcChannelInterfaceHold *hold_iface, DBusGMethodInvocation *context) { TpBaseMediaCallChannel *self = TP_BASE_MEDIA_CALL_CHANNEL (hold_iface); tp_svc_channel_interface_hold_return_from_get_hold_state (context, self->priv->hold_state, self->priv->hold_state_reason); } static void tp_base_media_call_channel_request_hold ( TpSvcChannelInterfaceHold *hold_iface, gboolean hold, DBusGMethodInvocation *context) { TpBaseMediaCallChannel *self = TP_BASE_MEDIA_CALL_CHANNEL (hold_iface); if ((hold && (self->priv->hold_state == TP_LOCAL_HOLD_STATE_HELD || self->priv->hold_state == TP_LOCAL_HOLD_STATE_PENDING_HOLD)) || (!hold && (self->priv->hold_state == TP_LOCAL_HOLD_STATE_UNHELD || self->priv->hold_state == TP_LOCAL_HOLD_STATE_PENDING_UNHOLD))) { self->priv->hold_state_reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED; goto out; } if (hold) { set_hold_state (self, TP_LOCAL_HOLD_STATE_PENDING_HOLD, TP_LOCAL_HOLD_STATE_REASON_REQUESTED); } else { set_hold_state (self, TP_LOCAL_HOLD_STATE_PENDING_UNHOLD, TP_LOCAL_HOLD_STATE_REASON_REQUESTED); } out: tp_svc_channel_interface_hold_return_from_request_hold (context); } static void hold_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelInterfaceHoldClass *klass = (TpSvcChannelInterfaceHoldClass *) g_iface; #define IMPLEMENT(x, suffix) tp_svc_channel_interface_hold_implement_##x (\ klass, tp_base_media_call_channel_##x##suffix) IMPLEMENT(get_hold_state,); IMPLEMENT(request_hold,); #undef IMPLEMENT } void _tp_base_media_call_channel_endpoint_state_changed ( TpBaseMediaCallChannel *self) { TpBaseChannel *bc = TP_BASE_CHANNEL (self); TpBaseCallChannel *bcc = TP_BASE_CALL_CHANNEL (self); switch (tp_base_call_channel_get_state (bcc)) { case TP_CALL_STATE_INITIALISING: if (_tp_base_call_channel_is_connected (bcc)) { tp_base_call_channel_set_state (bcc, TP_CALL_STATE_INITIALISED, tp_base_channel_get_self_handle (bc), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "There is a connected endpoint for each stream"); } break; case TP_CALL_STATE_ACTIVE: if (!_tp_base_call_channel_is_connected (bcc)) { tp_base_call_channel_set_state (bcc, TP_CALL_STATE_ACCEPTED, tp_base_channel_get_self_handle (bc), TP_CALL_STATE_CHANGE_REASON_CONNECTIVITY_ERROR, TP_ERROR_STR_CONNECTION_LOST, "There is no longer connected endpoint for each stream"); } break; case TP_CALL_STATE_ACCEPTED: if (_tp_base_call_channel_is_connected (bcc)) { tp_base_call_channel_set_state (bcc, TP_CALL_STATE_ACTIVE, tp_base_channel_get_self_handle (bc), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "There is a connected endpoint for each stream"); } break; default: break; } } gboolean _tp_base_media_channel_is_held (TpBaseMediaCallChannel *self) { switch (self->priv->hold_state) { case TP_LOCAL_HOLD_STATE_PENDING_HOLD: case TP_LOCAL_HOLD_STATE_HELD: return TRUE; case TP_LOCAL_HOLD_STATE_PENDING_UNHOLD: case TP_LOCAL_HOLD_STATE_UNHELD: return FALSE; default: g_assert_not_reached (); return FALSE; } } gboolean _tp_base_media_call_channel_streams_sending_state_changed ( TpBaseMediaCallChannel *self, gboolean success) { gboolean was_held = (self->priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD); if (success) update_hold_state (self); else hold_change_failed (self); return was_held; } gboolean _tp_base_media_call_channel_streams_receiving_state_changed ( TpBaseMediaCallChannel *self, gboolean success) { gboolean was_held = (self->priv->hold_state != TP_LOCAL_HOLD_STATE_UNHELD); if (success) update_hold_state (self); else hold_change_failed (self); return was_held; } /** * tp_base_media_call_channel_get_local_hold_state: * @channel: a #TpBaseMediaCallChannel * @reason: pointer to a location where to store the @reason, or %NULL * * * * Returns: The current hold state * * Since: 0.17.6 */ TpLocalHoldState tp_base_media_call_channel_get_local_hold_state ( TpBaseMediaCallChannel *channel, TpLocalHoldStateReason *reason) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_CHANNEL (channel), TP_LOCAL_HOLD_STATE_UNHELD); if (reason) *reason = channel->priv->hold_state_reason; return channel->priv->hold_state; } telepathy-glib-0.24.2/telepathy-glib/base-media-call-channel.h0000644000175000017500000000627012652510705021033 00000000000000/* * base-media-call-channel.h - Header for TpBaseMediaCallChannel * Copyright © 2011 Collabora Ltd. * @author Olivier Crete * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_MEDIA_CALL_CHANNEL_H__ #define __TP_BASE_MEDIA_CALL_CHANNEL_H__ #include #include G_BEGIN_DECLS typedef struct _TpBaseMediaCallChannel TpBaseMediaCallChannel; typedef struct _TpBaseMediaCallChannelPrivate TpBaseMediaCallChannelPrivate; typedef struct _TpBaseMediaCallChannelClass TpBaseMediaCallChannelClass; typedef void (*TpBaseMediaCallChannelHoldStateChangedFunc) ( TpBaseMediaCallChannel *self, TpLocalHoldState hold_state, TpLocalHoldStateReason hold_state_reason); typedef void (*TpBaseMediaCallChannelVoidFunc) (TpBaseMediaCallChannel *self); struct _TpBaseMediaCallChannelClass { /**/ TpBaseCallChannelClass parent_class; /*< public >*/ TpBaseMediaCallChannelHoldStateChangedFunc hold_state_changed; TpBaseMediaCallChannelVoidFunc accept; /**/ gpointer future[4]; }; struct _TpBaseMediaCallChannel { /**/ TpBaseCallChannel parent; TpBaseMediaCallChannelPrivate *priv; }; _TP_AVAILABLE_IN_0_18 GType tp_base_media_call_channel_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_MEDIA_CALL_CHANNEL \ (tp_base_media_call_channel_get_type ()) #define TP_BASE_MEDIA_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ TP_TYPE_BASE_MEDIA_CALL_CHANNEL, TpBaseMediaCallChannel)) #define TP_BASE_MEDIA_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_BASE_MEDIA_CALL_CHANNEL, TpBaseMediaCallChannelClass)) #define TP_IS_BASE_MEDIA_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_MEDIA_CALL_CHANNEL)) #define TP_IS_BASE_MEDIA_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_MEDIA_CALL_CHANNEL)) #define TP_BASE_MEDIA_CALL_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_BASE_MEDIA_CALL_CHANNEL, TpBaseMediaCallChannelClass)) _TP_AVAILABLE_IN_0_18 TpLocalHoldState tp_base_media_call_channel_get_local_hold_state ( TpBaseMediaCallChannel *channel, TpLocalHoldStateReason *reason); G_END_DECLS #endif /* #ifndef __TP_BASE_MEDIA_CALL_CHANNEL_H__*/ telepathy-glib-0.24.2/telepathy-glib/connection-internal.h0000644000175000017500000001472512652510705020502 00000000000000/**/ /* * TpConnection - proxy for a Telepathy connection (internals) * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef TP_CONNECTION_INTERNAL_H #define TP_CONNECTION_INTERNAL_H #include #include #include #include G_BEGIN_DECLS typedef void (*TpConnectionProc) (TpConnection *self); struct _TpConnectionPrivate { TpAccount *account; /* list of TpConnectionProc */ GList *introspect_needed; gchar *cm_name; gchar *proto_name; TpHandle last_known_self_handle; TpContact *self_contact; TpConnectionStatus status; TpConnectionStatusReason status_reason; gchar *connection_error; /* a TP_HASH_TYPE_STRING_VARIANT_MAP */ GHashTable *connection_error_details; /* GArray of GQuark */ GArray *contact_attribute_interfaces; /* items are GQuarks that represent arguments to * Connection.AddClientInterests */ TpIntset *interests; /* TpHandle => weak ref to TpContact */ GHashTable *contacts; TpCapabilities *capabilities; /* Queue of owned GSimpleAsyncResult, each result being a pending call * started using _tp_connection_do_get_capabilities_async */ GQueue capabilities_queue; TpAvatarRequirements *avatar_requirements; GArray *avatar_request_queue; guint avatar_request_idle_id; TpContactInfoFlags contact_info_flags; GList *contact_info_supported_fields; gint balance; guint balance_scale; gchar *balance_currency; gchar *balance_uri; /* ContactList properties */ TpContactListState contact_list_state; gboolean contact_list_persists; gboolean can_change_contact_list; gboolean request_uses_message; /* TpHandle => ref to TpContact */ GHashTable *roster; /* Queue of owned ContactsChangedItem */ GQueue *contacts_changed_queue; gboolean roster_fetched; gboolean contact_list_properties_fetched; /* ContactGroups properties */ gboolean disjoint_groups; TpContactMetadataStorageType group_storage; GPtrArray *contact_groups; gboolean groups_fetched; /* Queue of owned BlockedChangedItem */ GQueue *blocked_changed_queue; /* ContactBlocking properies */ TpContactBlockingCapabilities contact_blocking_capabilities; GPtrArray *blocked_contacts; gboolean blocked_contacts_fetched; /* Aliasing */ TpConnectionAliasFlags alias_flags; TpProxyPendingCall *introspection_call; unsigned ready:1; unsigned ready_enough_for_contacts:1; unsigned has_immortal_handles:1; unsigned tracking_aliases_changed:1; unsigned tracking_avatar_updated:1; unsigned tracking_avatar_retrieved:1; unsigned tracking_presences_changed:1; unsigned tracking_presence_update:1; unsigned tracking_location_changed:1; unsigned tracking_contact_caps_changed:1; unsigned tracking_contact_info_changed:1; unsigned introspecting_after_connected:1; unsigned tracking_client_types_updated:1; unsigned introspecting_self_contact:1; unsigned tracking_contacts_changed:1; unsigned tracking_contact_groups_changed:1; }; void _tp_connection_status_reason_to_gerror (TpConnectionStatusReason reason, TpConnectionStatus prev_status, const gchar **ret_str, GError **error); /* Internal hook to break potential dependency loop between Connection and * Contacts */ void _tp_connection_get_capabilities_async (TpConnection *self, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_connection_get_capabilities_finish (TpConnection *self, GAsyncResult *result, GError **error); /* Those functions should be used only from contact.c, they are risky since they * could operate on incomplete contacts */ void _tp_connection_add_contact (TpConnection *self, TpHandle handle, TpContact *contact); void _tp_connection_remove_contact (TpConnection *self, TpHandle handle, TpContact *contact); TpContact *_tp_connection_lookup_contact (TpConnection *self, TpHandle handle); void _tp_connection_set_account (TpConnection *self, TpAccount *account); /* connection-contact-info.c */ void _tp_connection_prepare_contact_info_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); TpContactInfoFieldSpec *_tp_contact_info_field_spec_new (const gchar *name, GStrv parameters, TpContactInfoFieldFlags flags, guint max); /* connection-avatars.c */ void _tp_connection_prepare_avatar_requirements_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); /* connection-contact-list.c */ void _tp_connection_prepare_contact_list_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); void _tp_connection_prepare_contact_list_props_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); void _tp_connection_prepare_contact_groups_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); void _tp_connection_contacts_changed_queue_free (GQueue *queue); void _tp_connection_blocked_changed_queue_free (GQueue *queue); void _tp_connection_prepare_contact_blocking_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); void _tp_connection_set_contact_blocked (TpConnection *self, TpContact *contact); /* connection-aliasing.c */ void _tp_connection_prepare_aliasing_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/connection.c0000644000175000017500000034303612652510705016663 00000000000000/* * connection.c - proxy for a Telepathy connection * * Copyright (C) 2007-2011 Collabora Ltd. * Copyright (C) 2007-2011 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/connection.h" #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_CONNECTION #include "telepathy-glib/capabilities-internal.h" #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/connection-contact-list.h" #include "telepathy-glib/dbus-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" #include "telepathy-glib/simple-client-factory-internal.h" #include "telepathy-glib/contact-internal.h" #include "telepathy-glib/util-internal.h" #include "telepathy-glib/variant-util-internal.h" #include "_gen/tp-cli-connection-body.h" /** * SECTION:connection * @title: TpConnection * @short_description: proxy object for a Telepathy connection * @see_also: #TpConnectionManager, #TpChannel * * #TpConnection objects represent Telepathy instant messaging connections * accessed via D-Bus. * * #TpConnection objects should be obtained from a #TpAccount, unless you * are implementing a lower-level Telepathy component (such as the account * manager service itself). * * Since 0.16, #TpConnection always has a non-%NULL #TpProxy:factory, and its * #TpProxy:factory will be propagated to its #TpChannel objects * (if any). Similarly, the #TpProxy:factory's features * will be used for #TpContact objects. * If a #TpConnection is created without going via the * #TpAccount or specifying a #TpProxy:factory, the default * is to use a new #TpAutomaticClientFactory. * * Since: 0.7.1 */ /** * TP_CONNECTION_FEATURE_CORE: * * Expands to a call to a function that returns a quark for the "core" feature * on a #TpConnection. * * When this feature is prepared, the basic properties of the Connection have * been retrieved and are available for use, and change-notification has been * set up for those that can change. * * Specifically, this implies that: * * * #TpConnection:status has a value other than * %TP_UNKNOWN_CONNECTION_STATUS, and #TpConnection:status-reason is * the reason for changing to that status * interfaces that are always available have been added to the * #TpProxy:interfaces (although the set of interfaces is not guaranteed * to be complete until #TpConnection:status becomes * %TP_CONNECTION_STATUS_CONNECTED)) * * * * prepared does not imply connected * Unlike the older #TpConnection:connection-ready mechanism, this * feature does not imply that the connection has successfully connected. * It only implies that an initial status (disconnected, connecting or * connected) has been discovered. %TP_CONNECTION_FEATURE_CONNECTED * is the closest equivalent of #TpConnection:connection-ready. * * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_connection_get_feature_quark_core (void) { return g_quark_from_static_string ("tp-connection-feature-core"); } /** * TP_CONNECTION_FEATURE_CONNECTED: * * Expands to a call to a function that returns a #GQuark representing the * "connected" feature. * * When this feature is prepared, it means that the connection has become * connected to the appropriate real-time communications service, and all * information requested via other features has been updated accordingly. * In particular, the following aspects of %TP_CONNECTION_FEATURE_CORE * will be up to date: * * * #TpConnection:status is * %TP_CONNECTION_STATUS_CONNECTED * #TpConnection:self-handle is valid and non-zero * #TpConnection:self-contact is non-%NULL * all interfaces have been added to the set of * #TpProxy:interfaces, and that set will not change again * * * * Someone still has to call Connect() * Requesting this feature via tp_proxy_prepare_async() means that * you want to wait for the connection to connect, but it doesn't actually * start the process of connecting. For connections associated with * a #TpAccount, the account manager service is responsible for * doing that, but if you are constructing connections directly * (e.g. if you are implementing an account manager), you must * tp_cli_connection_call_connect() separately. * * * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_connection_get_feature_quark_connected (void) { return g_quark_from_static_string ("tp-connection-feature-connected"); } /** * TP_CONNECTION_FEATURE_CAPABILITIES: * * Expands to a call to a function that returns a #GQuark representing the * "capabilities" feature. * * When this feature is prepared, the Requests.RequestableChannelClasses * property of the Connection has been retrieved. * In particular, the %TpConnection:capabilities property has been set. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.11.3 */ GQuark tp_connection_get_feature_quark_capabilities (void) { return g_quark_from_static_string ("tp-connection-feature-capabilities"); } /** * TP_CONNECTION_FEATURE_BALANCE: * * Expands to a call to a function that returns a #GQuark representing the * "balance" feature. * * When this feature is prepared, the Balance.AccountBalance and * Balance.ManageCreditURI properties of the Connection have been retrieved. * In particular, the %TpConnection:balance, %TpConnection:balance-scale, * %TpConnection:balance-currency and %TpConnection:balance-uri properties * have been set and the TpConnection::balance-changed: will be emitted * when they are changed. * * One can ask for a feature to be prepared using the * tp_proxy_prepare_async() function, and waiting for it to callback. * * Since: 0.15.1 */ GQuark tp_connection_get_feature_quark_balance (void) { return g_quark_from_static_string ("tp-connection-feature-balance"); } /** * TP_ERRORS_DISCONNECTED: * * #GError domain representing a Telepathy connection becoming disconnected. * The @code in a #GError with this domain must be a member of * #TpConnectionStatusReason. * * This macro expands to a function call returning a #GQuark. * * Since 0.7.24, this error domain is only used if a connection manager emits * a #TpConnectionStatusReason not known to telepathy-glib. * * Since: 0.7.1 */ GQuark tp_errors_disconnected_quark (void) { static GQuark q = 0; if (q == 0) q = g_quark_from_static_string ("tp_errors_disconnected_quark"); return q; } /** * TP_UNKNOWN_CONNECTION_STATUS: * * An invalid connection status used in #TpConnection to indicate that the * status has not yet been discovered. * * Since: 0.7.1 */ /** * TpConnectionClass: * @parent_class: the parent class * * The class of a #TpConnection. In addition to @parent_class there are four * pointers reserved for possible future use. * * (Changed in 0.7.12: the layout of the structure is visible, allowing * subclassing.) * * Since: 0.7.1 */ /** * TpConnection: * * A proxy object for a Telepathy connection. There are no interesting * public struct fields. * * (Changed in 0.7.12: the layout of the structure is visible, allowing * subclassing.) * * Since: 0.7.1 */ /* properties */ enum { PROP_STATUS = 1, PROP_STATUS_REASON, PROP_CONNECTION_MANAGER_NAME, PROP_CM_NAME, PROP_PROTOCOL_NAME, PROP_CONNECTION_READY, PROP_SELF_CONTACT, PROP_SELF_HANDLE, PROP_CAPABILITIES, PROP_BALANCE, PROP_BALANCE_SCALE, PROP_BALANCE_CURRENCY, PROP_BALANCE_URI, PROP_CONTACT_LIST_STATE, PROP_CONTACT_LIST_PERSISTS, PROP_CAN_CHANGE_CONTACT_LIST, PROP_REQUEST_USES_MESSAGE, PROP_DISJOINT_GROUPS, PROP_GROUP_STORAGE, PROP_CONTACT_GROUPS, PROP_CAN_REPORT_ABUSIVE, PROP_BLOCKED_CONTACTS, N_PROPS }; enum { SIGNAL_BALANCE_CHANGED, SIGNAL_GROUPS_CREATED, SIGNAL_GROUPS_REMOVED, SIGNAL_GROUP_RENAMED, SIGNAL_CONTACT_LIST_CHANGED, SIGNAL_BLOCKED_CONTACTS_CHANGED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; G_DEFINE_TYPE (TpConnection, tp_connection, TP_TYPE_PROXY) static void tp_connection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpConnection *self = TP_CONNECTION (object); /* Deprecated properties uses deprecated getters */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS switch (property_id) { case PROP_CONNECTION_MANAGER_NAME: g_value_set_string (value, self->priv->cm_name); break; case PROP_CM_NAME: g_value_set_string (value, self->priv->cm_name); break; case PROP_PROTOCOL_NAME: g_value_set_string (value, self->priv->proto_name); break; case PROP_CONNECTION_READY: g_value_set_boolean (value, self->priv->ready); break; case PROP_STATUS: g_value_set_uint (value, self->priv->status); break; case PROP_STATUS_REASON: g_value_set_uint (value, self->priv->status_reason); break; case PROP_SELF_CONTACT: g_value_set_object (value, tp_connection_get_self_contact (self)); break; case PROP_SELF_HANDLE: g_value_set_uint (value, tp_connection_get_self_handle (self)); break; case PROP_CAPABILITIES: g_value_set_object (value, self->priv->capabilities); break; case PROP_BALANCE: g_value_set_int (value, self->priv->balance); break; case PROP_BALANCE_SCALE: g_value_set_uint (value, self->priv->balance_scale); break; case PROP_BALANCE_CURRENCY: g_value_set_string (value, self->priv->balance_currency); break; case PROP_BALANCE_URI: g_value_set_string (value, self->priv->balance_uri); break; case PROP_CONTACT_LIST_STATE: g_value_set_uint (value, self->priv->contact_list_state); break; case PROP_CONTACT_LIST_PERSISTS: g_value_set_boolean (value, self->priv->contact_list_persists); break; case PROP_CAN_CHANGE_CONTACT_LIST: g_value_set_boolean (value, self->priv->can_change_contact_list); break; case PROP_REQUEST_USES_MESSAGE: g_value_set_boolean (value, self->priv->request_uses_message); break; case PROP_DISJOINT_GROUPS: g_value_set_boolean (value, self->priv->disjoint_groups); break; case PROP_GROUP_STORAGE: g_value_set_uint (value, self->priv->group_storage); break; case PROP_CONTACT_GROUPS: g_value_set_boxed (value, self->priv->contact_groups); break; case PROP_CAN_REPORT_ABUSIVE: g_value_set_boolean (value, tp_connection_can_report_abusive (self)); break; case PROP_BLOCKED_CONTACTS: g_value_set_boxed (value, tp_connection_get_blocked_contacts (self)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } G_GNUC_END_IGNORE_DEPRECATIONS } static void tp_connection_unpack_balance (TpConnection *self, GValueArray *balance_s) { gint balance = 0; guint scale = G_MAXUINT32; const char *currency = ""; gboolean changed = FALSE; if (balance_s == NULL) goto finally; tp_value_array_unpack (balance_s, 3, &balance, &scale, ¤cy); finally: g_object_freeze_notify ((GObject *) self); if (self->priv->balance != balance) { self->priv->balance = balance; g_object_notify ((GObject *) self, "balance"); changed = TRUE; } if (self->priv->balance_scale != scale) { self->priv->balance_scale = scale; g_object_notify ((GObject *) self, "balance-scale"); changed = TRUE; } if (tp_strdiff (self->priv->balance_currency, currency)) { g_free (self->priv->balance_currency); self->priv->balance_currency = g_strdup (currency); g_object_notify ((GObject *) self, "balance-currency"); changed = TRUE; } g_object_thaw_notify ((GObject *) self); if (changed) { g_signal_emit (self, signals[SIGNAL_BALANCE_CHANGED], 0, balance, scale, currency); } } static void tp_connection_get_balance_cb (TpProxy *proxy, GHashTable *props, const GError *in_error, gpointer user_data, GObject *weak_obj) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result = user_data; GValueArray *balance = NULL; if (in_error != NULL) { DEBUG ("Failed to get Balance properties: %s", in_error->message); g_simple_async_result_set_from_error (result, in_error); goto finally; } balance = tp_asv_get_boxed (props, "AccountBalance", TP_STRUCT_TYPE_CURRENCY_AMOUNT); self->priv->balance_uri = g_strdup (tp_asv_get_string (props, "ManageCreditURI")); g_object_freeze_notify ((GObject *) self); tp_connection_unpack_balance (self, balance); _tp_proxy_set_feature_prepared (proxy, TP_CONNECTION_FEATURE_BALANCE, TRUE); g_object_notify ((GObject *) self, "balance-uri"); g_object_thaw_notify ((GObject *) self); finally: g_simple_async_result_complete_in_idle (result); } static void tp_connection_balance_changed_cb (TpConnection *self, const GValueArray *balance, gpointer user_data, GObject *weak_obj) { tp_connection_unpack_balance (self, (GValueArray *) balance); } static void tp_connection_prepare_balance_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) proxy, callback, user_data, tp_connection_prepare_balance_async); g_assert (self->priv->balance_currency == NULL); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION_INTERFACE_BALANCE, tp_connection_get_balance_cb, result, g_object_unref, NULL); tp_cli_connection_interface_balance_connect_to_balance_changed (self, tp_connection_balance_changed_cb, NULL, NULL, NULL, NULL); } static void tp_connection_get_rcc_cb (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data, GObject *weak_object) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; if (error != NULL) { DEBUG ("Failed to get RequestableChannelClasses property, using an " "empty set: %s", error->message); /* it's NULL-safe */ self->priv->capabilities = _tp_capabilities_new (NULL, FALSE); goto finally; } g_assert (self->priv->capabilities == NULL); if (!G_VALUE_HOLDS (value, TP_ARRAY_TYPE_REQUESTABLE_CHANNEL_CLASS_LIST)) { DEBUG ("RequestableChannelClasses is not of type a(a{sv}as), using an " "empty set: %s", G_VALUE_TYPE_NAME (value)); /* it's NULL-safe */ self->priv->capabilities = _tp_capabilities_new (NULL, FALSE); goto finally; } DEBUG ("CAPABILITIES ready"); self->priv->capabilities = _tp_capabilities_new (g_value_get_boxed (value), FALSE); finally: while ((result = g_queue_pop_head (&self->priv->capabilities_queue)) != NULL) { g_simple_async_result_complete_in_idle (result); g_object_unref (result); } g_object_notify ((GObject *) self, "capabilities"); } static void _tp_connection_do_get_capabilities_async (TpConnection *self, GSimpleAsyncResult *result) { if (self->priv->capabilities != NULL) { /* been there, done that, bored now */ g_simple_async_result_complete_in_idle (result); g_object_unref (result); } else { g_queue_push_tail (&self->priv->capabilities_queue, result); if (g_queue_get_length (&self->priv->capabilities_queue) == 1) { DEBUG ("%s: Retrieving capabilities", tp_proxy_get_object_path (self)); /* We don't check whether we actually have this interface here. The * quark is dbus properties quark is guaranteed to be on every * TpProxy and only very very old CMs won't have Requests, in case * someone still has such a relic we'll we'll just handle it when * they reply to us with an error */ tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, "RequestableChannelClasses", tp_connection_get_rcc_cb, NULL, NULL, NULL); } } } void _tp_connection_get_capabilities_async (TpConnection *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_connection_get_capabilities_async); _tp_connection_do_get_capabilities_async (self, result); } gboolean _tp_connection_get_capabilities_finish (TpConnection *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, _tp_connection_get_capabilities_async); } static void tp_connection_prepare_capabilities_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpConnection *self = (TpConnection *) proxy; GSimpleAsyncResult *result; DEBUG ("%s: Preparing capabilities", tp_proxy_get_object_path (self)); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_connection_prepare_capabilities_async); _tp_connection_do_get_capabilities_async (self, result); } static void signal_connected (TpConnection *self) { /* we shouldn't have gone to status CONNECTED for any reason * that isn't REQUESTED :-) */ DEBUG ("%s (%p): CORE and CONNECTED ready", tp_proxy_get_object_path (self), self); self->priv->status = TP_CONNECTION_STATUS_CONNECTED; self->priv->status_reason = TP_CONNECTION_STATUS_REASON_REQUESTED; self->priv->ready = TRUE; _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CONNECTION_FEATURE_CONNECTED, TRUE); _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CONNECTION_FEATURE_CORE, TRUE); g_object_notify ((GObject *) self, "status"); g_object_notify ((GObject *) self, "status-reason"); g_object_notify ((GObject *) self, "connection-ready"); } static void will_announced_connected_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpConnection *self = (TpConnection *) source; GError *error = NULL; if (!_tp_proxy_will_announce_connected_finish ((TpProxy *) self, result, &error)) { DEBUG ("_tp_connection_prepare_contact_info_async failed: %s", error->message); g_error_free (error); } if (tp_proxy_get_invalidated (self) != NULL) { DEBUG ("Connection has been invalidated; we're done"); return; } signal_connected (self); } static void tp_connection_continue_introspection (TpConnection *self) { if (tp_proxy_get_invalidated (self) != NULL) { DEBUG ("Already invalidated: not becoming ready"); return; } if (self->priv->introspect_needed == NULL) { if (!self->priv->introspecting_after_connected) { /* Introspection will restart when we become CONNECTED */ DEBUG ("CORE ready, but not CONNECTED"); _tp_proxy_set_feature_prepared ((TpProxy *) self, TP_CONNECTION_FEATURE_CORE, TRUE); return; } /* We'll announce CONNECTED state soon, but first give a chance to * prepared feature to be updated, if needed */ _tp_proxy_will_announce_connected_async ((TpProxy *) self, will_announced_connected_cb, NULL); } else { TpConnectionProc next = self->priv->introspect_needed->data; self->priv->introspect_needed = g_list_delete_link ( self->priv->introspect_needed, self->priv->introspect_needed); next (self); } } static void got_contact_attribute_interfaces (TpProxy *proxy, const GValue *value, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *weak_object G_GNUC_UNUSED) { TpConnection *self = TP_CONNECTION (proxy); GArray *arr; g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error == NULL && G_VALUE_HOLDS (value, G_TYPE_STRV)) { gchar **interfaces = g_value_get_boxed (value); gchar **iter; arr = g_array_sized_new (FALSE, FALSE, sizeof (GQuark), interfaces == NULL ? 0 : g_strv_length (interfaces)); if (interfaces != NULL) { for (iter = interfaces; *iter != NULL; iter++) { if (tp_dbus_check_valid_interface_name (*iter, NULL)) { GQuark q = g_quark_from_string (*iter); DEBUG ("%p: ContactAttributeInterfaces has %s", self, *iter); g_array_append_val (arr, q); } else { DEBUG ("%p: ignoring invalid interface: %s", self, *iter); } } } } else { if (error == NULL) DEBUG ("%p: ContactAttributeInterfaces had wrong type %s, " "ignoring", self, G_VALUE_TYPE_NAME (value)); else DEBUG ("%p: Get(Contacts, ContactAttributeInterfaces) failed with " "%s %d: %s", self, g_quark_to_string (error->domain), error->code, error->message); arr = g_array_sized_new (FALSE, FALSE, sizeof (GQuark), 0); } g_assert (self->priv->contact_attribute_interfaces == NULL); self->priv->contact_attribute_interfaces = arr; self->priv->ready_enough_for_contacts = TRUE; tp_connection_continue_introspection (self); } static void introspect_contacts (TpConnection *self) { /* "This cannot change during the lifetime of the Connection." -- tp-spec */ if (self->priv->contact_attribute_interfaces != NULL) { tp_connection_continue_introspection (self); return; } g_assert (self->priv->introspection_call == NULL); self->priv->introspection_call = tp_cli_dbus_properties_call_get (self, -1, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, "ContactAttributeInterfaces", got_contact_attribute_interfaces, NULL, NULL, NULL); } static void tp_connection_set_self_contact (TpConnection *self, TpContact *contact) { if (contact != self->priv->self_contact) { TpContact *tmp = self->priv->self_contact; self->priv->self_contact = g_object_ref (contact); tp_clear_object (&tmp); g_object_notify ((GObject *) self, "self-contact"); g_object_notify ((GObject *) self, "self-handle"); } if (self->priv->introspecting_self_contact) { self->priv->introspecting_self_contact = FALSE; tp_connection_continue_introspection (self); } } static void tp_connection_got_self_contact_cb (TpConnection *self, guint n_contacts, TpContact * const *contacts, guint n_failed, const TpHandle *failed, const GError *error, gpointer unused_data G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { if (n_contacts != 0) { g_assert (n_contacts == 1); g_assert (n_failed == 0); g_assert (error == NULL); if (tp_contact_get_handle (contacts[0]) == self->priv->last_known_self_handle) { tp_connection_set_self_contact (self, contacts[0]); } else { DEBUG ("SelfHandle is now %u, ignoring contact object for %u", self->priv->last_known_self_handle, tp_contact_get_handle (contacts[0])); } } else if (error != NULL) { /* Unrecoverable error: we were probably invalidated, but in case * we weren't... */ DEBUG ("Failed to hold the handle from GetSelfHandle(): %s", error->message); tp_proxy_invalidate ((TpProxy *) self, error); } else if (n_failed == 1 && failed[0] != self->priv->last_known_self_handle) { /* Since we tried to make the TpContact, our self-handle has changed, * so it doesn't matter that we couldn't make a TpContact for the old * one - carry on and make a TpContact for the new one instead. */ DEBUG ("Failed to hold handle %u from GetSelfHandle(), but it's " "changed to %u anyway, so never mind", failed[0], self->priv->last_known_self_handle); } else { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "The handle from GetSelfHandle() was considered invalid" }; DEBUG ("%s", e.message); tp_proxy_invalidate ((TpProxy *) self, &e); } } static void get_self_contact (TpConnection *self) { TpSimpleClientFactory *factory; GArray *features; factory = tp_proxy_get_factory (self); features = tp_simple_client_factory_dup_contact_features (factory, self); /* FIXME: We should use tp_simple_client_factory_ensure_contact(), but that would * require immortal-handles and spec change to give the self identifier. */ /* This relies on the special case in tp_connection_get_contacts_by_handle() * which makes it start working slightly early. */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS tp_connection_get_contacts_by_handle (self, 1, &self->priv->last_known_self_handle, features->len, (TpContactFeature *) features->data, tp_connection_got_self_contact_cb, NULL, NULL, NULL); G_GNUC_END_IGNORE_DEPRECATIONS g_array_unref (features); } static void introspect_self_contact (TpConnection *self) { self->priv->introspecting_self_contact = TRUE; get_self_contact (self); } static void got_self_handle (TpConnection *self, guint self_handle, const GError *error, gpointer user_data G_GNUC_UNUSED, GObject *user_object G_GNUC_UNUSED) { g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error != NULL) { DEBUG ("%p: GetSelfHandle() failed: %s", self, error->message); tp_proxy_invalidate ((TpProxy *) self, error); return; } if (self_handle == 0) { GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT, "GetSelfHandle() returned 0" }; DEBUG ("%s", e.message); tp_proxy_invalidate ((TpProxy *) self, &e); return; } self->priv->last_known_self_handle = self_handle; self->priv->introspect_needed = g_list_append (self->priv->introspect_needed, introspect_self_contact); tp_connection_continue_introspection (self); } static void on_self_handle_changed (TpConnection *self, guint self_handle, gpointer user_data G_GNUC_UNUSED, GObject *user_object G_GNUC_UNUSED) { if (self_handle == 0) { DEBUG ("Ignoring alleged change of self-handle to %u", self_handle); return; } if (self->priv->last_known_self_handle == 0) { /* We're going to call GetAll(Connection) anyway, or if the CM * is sufficiently deficient, GetSelfHandle(). */ DEBUG ("Ignoring early self-handle change to %u, we'll pick it up later", self_handle); return; } DEBUG ("SelfHandleChanged to %u, I wonder what that means?", self_handle); self->priv->last_known_self_handle = self_handle; get_self_contact (self); } static void introspect_self_handle (TpConnection *self) { if (!self->priv->introspecting_after_connected) { tp_connection_continue_introspection (self); return; } g_assert (self->priv->introspection_call == NULL); self->priv->introspection_call = tp_cli_connection_call_get_self_handle ( self, -1, got_self_handle, NULL, NULL, NULL); } /* Appending callbacks to self->priv->introspect_needed relies on this */ G_STATIC_ASSERT (sizeof (TpConnectionProc) <= sizeof (gpointer)); static void tp_connection_add_interfaces_from_introspection (TpConnection *self, const gchar **interfaces) { TpProxy *proxy = (TpProxy *) self; tp_proxy_add_interfaces (proxy, interfaces); if (tp_proxy_has_interface_by_id (proxy, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS)) { self->priv->introspect_needed = g_list_append ( self->priv->introspect_needed, introspect_contacts); } else { self->priv->ready_enough_for_contacts = TRUE; } } static void tp_connection_got_interfaces_cb (TpConnection *self, const gchar **interfaces, const GError *error, gpointer user_data, GObject *user_object) { g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error != NULL) { DEBUG ("%p: GetInterfaces() failed, assuming no interfaces: %s", self, error->message); interfaces = NULL; } DEBUG ("%p: Introspected interfaces", self); if (tp_proxy_get_invalidated (self) != NULL) { DEBUG ("%p: already invalidated, not trying to become ready: %s", self, tp_proxy_get_invalidated (self)->message); return; } g_assert (self->priv->introspect_needed == NULL); if (interfaces != NULL) tp_connection_add_interfaces_from_introspection (self, interfaces); self->priv->introspect_needed = g_list_append (self->priv->introspect_needed, introspect_self_handle); /* FIXME: give subclasses a chance to influence the definition of "ready" * now that we have our interfaces? */ tp_connection_continue_introspection (self); } static void _tp_connection_got_properties (TpProxy *proxy, GHashTable *asv, const GError *error, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED); static void tp_connection_status_changed (TpConnection *self, guint status, guint reason) { DEBUG ("%p: %d -> %d because %d", self, self->priv->status, status, reason); if (status == TP_CONNECTION_STATUS_CONNECTED) { if (self->priv->introspection_call != NULL && !self->priv->introspecting_after_connected) { /* We thought we knew what was going on, but now the connection has * gone to CONNECTED and all bets are off. Start again! */ DEBUG ("Cancelling pre-CONNECTED introspection and starting again"); tp_proxy_pending_call_cancel (self->priv->introspection_call); self->priv->introspection_call = NULL; g_list_free (self->priv->introspect_needed); self->priv->introspect_needed = NULL; } self->priv->introspecting_after_connected = TRUE; /* we defer the perceived change to CONNECTED until ready */ if (self->priv->introspection_call == NULL) { self->priv->introspection_call = tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION, _tp_connection_got_properties, NULL, NULL, NULL); } } else { self->priv->status = status; self->priv->status_reason = reason; g_object_notify ((GObject *) self, "status"); g_object_notify ((GObject *) self, "status-reason"); } } static void tp_connection_connection_error_cb (TpConnection *self, const gchar *error_name, GHashTable *details, gpointer user_data, GObject *weak_object) { g_free (self->priv->connection_error); self->priv->connection_error = g_strdup (error_name); if (self->priv->connection_error_details != NULL) g_hash_table_unref (self->priv->connection_error_details); self->priv->connection_error_details = g_boxed_copy ( TP_HASH_TYPE_STRING_VARIANT_MAP, details); } void _tp_connection_status_reason_to_gerror (TpConnectionStatusReason reason, TpConnectionStatus prev_status, const gchar **ret_str, GError **error) { TpError code; const gchar *message; switch (reason) { case TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED: code = TP_ERROR_DISCONNECTED; message = "Disconnected for unspecified reason"; break; case TP_CONNECTION_STATUS_REASON_REQUESTED: code = TP_ERROR_CANCELLED; message = "User requested disconnection"; break; case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR: code = TP_ERROR_NETWORK_ERROR; message = "Network error"; break; case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR: code = TP_ERROR_ENCRYPTION_ERROR; message = "Encryption error"; break; case TP_CONNECTION_STATUS_REASON_NAME_IN_USE: if (prev_status == TP_CONNECTION_STATUS_CONNECTED) { code = TP_ERROR_CONNECTION_REPLACED; message = "Connection replaced"; } else { /* If the connection was with register=TRUE, we should ideally use * REGISTRATION_EXISTS; but we can't actually tell that from here, * so we'll have to rely on CMs supporting in-band registration * (Gabble) to emit ConnectionError */ code = TP_ERROR_ALREADY_CONNECTED; message = "Already connected (or if registering, registration " "already exists)"; } break; case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED: code = TP_ERROR_CERT_NOT_PROVIDED; message = "Server certificate not provided"; break; case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED: code = TP_ERROR_CERT_UNTRUSTED; message = "Server certificate CA not trusted"; break; case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED: code = TP_ERROR_CERT_EXPIRED; message = "Server certificate expired"; break; case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED: code = TP_ERROR_CERT_NOT_ACTIVATED; message = "Server certificate not valid yet"; break; case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH: code = TP_ERROR_CERT_HOSTNAME_MISMATCH; message = "Server certificate has wrong hostname"; break; case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH: code = TP_ERROR_CERT_FINGERPRINT_MISMATCH; message = "Server certificate fingerprint mismatch"; break; case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED: code = TP_ERROR_CERT_SELF_SIGNED; message = "Server certificate is self-signed"; break; case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR: code = TP_ERROR_CERT_INVALID; message = "Unspecified server certificate error"; break; default: g_set_error (error, TP_ERRORS_DISCONNECTED, reason, "Unknown disconnection reason"); if (ret_str != NULL) *ret_str = TP_ERROR_STR_DISCONNECTED; return; } g_set_error (error, TP_ERROR, code, "%s", message); if (ret_str != NULL) *ret_str = tp_error_get_dbus_name (code); } static void tp_connection_status_changed_cb (TpConnection *self, guint status, guint reason, gpointer user_data, GObject *weak_object) { TpConnectionStatus prev_status = self->priv->status; /* The status is initially attempted to be discovered starting in the * constructor. If we don't have the reply for that call yet, ignore this * signal StatusChanged in order to run the interface introspection only one * time. We will get the initial introspection reply later anyway. */ if (self->priv->status != TP_UNKNOWN_CONNECTION_STATUS) { tp_connection_status_changed (self, status, reason); } /* we only want to run this in response to a StatusChanged signal, * not if the initial status is DISCONNECTED */ if (status == TP_CONNECTION_STATUS_DISCONNECTED) { GError *error = NULL; if (self->priv->connection_error == NULL) { _tp_connection_status_reason_to_gerror (reason, prev_status, NULL, &error); } else { g_assert (self->priv->connection_error_details != NULL); tp_proxy_dbus_error_to_gerror (self, self->priv->connection_error, tp_asv_get_string (self->priv->connection_error_details, "debug-message"), &error); /* ... but if we don't know anything about that D-Bus error * name, we can still be more helpful by deriving an error code from * TpConnectionStatusReason */ if (g_error_matches (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR)) { GError *from_csr = NULL; _tp_connection_status_reason_to_gerror (reason, prev_status, NULL, &from_csr); error->domain = from_csr->domain; error->code = from_csr->code; g_error_free (from_csr); } } tp_proxy_invalidate ((TpProxy *) self, error); g_error_free (error); } } static void tp_connection_got_status_cb (TpConnection *self, guint status, const GError *error, gpointer unused, GObject *user_object) { DEBUG ("%p", self); g_assert (self->priv->introspection_call != NULL); self->priv->introspection_call = NULL; if (error == NULL) { DEBUG ("%p: Initial status is %d", self, status); tp_connection_status_changed (self, status, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED); /* try introspecting before CONNECTED - it might work... */ if (status != TP_CONNECTION_STATUS_CONNECTED && self->priv->introspection_call == NULL) { self->priv->introspection_call = tp_cli_connection_call_get_interfaces (self, -1, tp_connection_got_interfaces_cb, NULL, NULL, NULL); } } else { DEBUG ("%p: GetStatus() failed with %s %d \"%s\"", self, g_quark_to_string (error->domain), error->code, error->message); } } static void tp_connection_invalidated (TpConnection *self) { if (self->priv->introspection_call != NULL) { DEBUG ("Cancelling introspection"); tp_proxy_pending_call_cancel (self->priv->introspection_call); self->priv->introspection_call = NULL; } /* Drop the ref we have on all roster contacts, this is to break the refcycle * we have between TpConnection and TpContact, otherwise self would never * run dispose. * Note that invalidated is also called from dispose, so self->priv->roster * could already be NULL. * * FIXME: When we decide to break tp-glib API/guarantees, we should stop * TpContact taking a strong ref on its TpConnection and force user to keep * a ref on the TpConnection to use its TpContact, this would avoid the * refcycle completely. */ if (self->priv->roster != NULL) g_hash_table_remove_all (self->priv->roster); g_clear_object (&self->priv->self_contact); tp_clear_pointer (&self->priv->blocked_contacts, g_ptr_array_unref); } static gboolean _tp_connection_extract_properties (TpConnection *self, GHashTable *asv, guint32 *status, guint32 *self_handle, const gchar ***interfaces) { gboolean sufficient; /* has_immortal_handles is a bitfield, so we can't pass a pointer to it */ if (tp_asv_get_boolean (asv, "HasImmortalHandles", NULL)) self->priv->has_immortal_handles = TRUE; *status = tp_asv_get_uint32 (asv, "Status", &sufficient); if (!sufficient || *status > TP_CONNECTION_STATUS_DISCONNECTED) return FALSE; *interfaces = (const gchar **) tp_asv_get_strv (asv, "Interfaces"); if (*interfaces == NULL) return FALSE; if (*status == TP_CONNECTION_STATUS_CONNECTED) { *self_handle = tp_asv_get_uint32 (asv, "SelfHandle", &sufficient); if (!sufficient || *self_handle == 0) return FALSE; } else { *self_handle = 0; } return TRUE; } static void _tp_connection_got_properties (TpProxy *proxy, GHashTable *asv, const GError *error, gpointer unused G_GNUC_UNUSED, GObject *unused_object G_GNUC_UNUSED) { TpConnection *self = TP_CONNECTION (proxy); guint32 status; guint32 self_handle; const gchar **interfaces; if (tp_proxy_get_invalidated (self) != NULL) { DEBUG ("%p: already invalidated, not trying to become ready: %s", self, tp_proxy_get_invalidated (self)->message); return; } if (self->priv->introspection_call) self->priv->introspection_call = NULL; if (error == NULL && _tp_connection_extract_properties ( self, asv, &status, &self_handle, &interfaces)) { tp_connection_add_interfaces_from_introspection (self, interfaces); if (status == TP_CONNECTION_STATUS_CONNECTED) { self->priv->introspecting_after_connected = TRUE; self->priv->last_known_self_handle = self_handle; self->priv->introspect_needed = g_list_append ( self->priv->introspect_needed, introspect_self_contact); } else { tp_connection_status_changed (self, status, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED); } tp_connection_continue_introspection (self); return; } else if (error != NULL) { DEBUG ("GetAll failed: %s", error->message); } DEBUG ("Could not extract all required properties from GetAll return, " "will use 0.18 API instead"); if (self->priv->introspection_call == NULL) { if (self->priv->status == TP_UNKNOWN_CONNECTION_STATUS && !self->priv->introspecting_after_connected) { /* get my initial status */ DEBUG ("Calling GetStatus"); self->priv->introspection_call = tp_cli_connection_call_get_status (self, -1, tp_connection_got_status_cb, NULL, NULL, NULL); } else { self->priv->introspection_call = tp_cli_connection_call_get_interfaces (self, -1, tp_connection_got_interfaces_cb, NULL, NULL, NULL); } } } static gboolean _tp_connection_parse (const gchar *path_or_bus_name, char delimiter, gchar **protocol, gchar **cm_name); static void tp_connection_constructed (GObject *object) { GObjectClass *object_class = (GObjectClass *) tp_connection_parent_class; TpConnection *self = TP_CONNECTION (object); const gchar *object_path; if (object_class->constructed != NULL) object_class->constructed (object); DEBUG ("%s (%p) constructed", tp_proxy_get_object_path (object), object); _tp_proxy_ensure_factory (self, NULL); /* Connect to my own StatusChanged signal. * The connection hasn't had a chance to become invalid yet, so we can * assume that this signal connection will work */ tp_cli_connection_connect_to_status_changed (self, tp_connection_status_changed_cb, NULL, NULL, NULL, NULL); tp_cli_connection_connect_to_connection_error (self, tp_connection_connection_error_cb, NULL, NULL, NULL, NULL); /* We need to connect to SelfHandleChanged early, too, so that we're * already connected before we GetAll */ tp_cli_connection_connect_to_self_handle_changed (self, on_self_handle_changed, NULL, NULL, NULL, NULL); object_path = tp_proxy_get_object_path (TP_PROXY (self)); g_assert (_tp_connection_parse (object_path, '/', &(self->priv->proto_name), &(self->priv->cm_name))); tp_cli_dbus_properties_call_get_all (self, -1, TP_IFACE_CONNECTION, _tp_connection_got_properties, NULL, NULL, NULL); /* Give a chance to TpAccount to know about invalidated connection before we * unref all roster contacts. This is to let applications properly remove all * contacts at once instead of getting weak notify on each. */ g_signal_connect_after (self, "invalidated", G_CALLBACK (tp_connection_invalidated), NULL); } static void tp_connection_init (TpConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CONNECTION, TpConnectionPrivate); self->priv->status = TP_UNKNOWN_CONNECTION_STATUS; self->priv->status_reason = TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED; self->priv->contacts = g_hash_table_new (g_direct_hash, g_direct_equal); self->priv->introspection_call = NULL; self->priv->interests = tp_intset_new (); self->priv->contact_groups = g_ptr_array_new_with_free_func (g_free); g_ptr_array_add (self->priv->contact_groups, NULL); self->priv->roster = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref); self->priv->contacts_changed_queue = g_queue_new (); g_queue_init (&self->priv->capabilities_queue); self->priv->blocked_contacts = g_ptr_array_new_with_free_func ( g_object_unref); self->priv->blocked_changed_queue = g_queue_new (); } static void tp_connection_finalize (GObject *object) { TpConnection *self = TP_CONNECTION (object); DEBUG ("%p", self); tp_clear_pointer (&self->priv->cm_name, g_free); tp_clear_pointer (&self->priv->proto_name, g_free); /* not true unless we were finalized before we were ready */ if (self->priv->introspect_needed != NULL) { g_list_free (self->priv->introspect_needed); self->priv->introspect_needed = NULL; } if (self->priv->contact_attribute_interfaces != NULL) { g_array_unref (self->priv->contact_attribute_interfaces); self->priv->contact_attribute_interfaces = NULL; } g_free (self->priv->connection_error); self->priv->connection_error = NULL; if (self->priv->connection_error_details != NULL) { g_hash_table_unref (self->priv->connection_error_details); self->priv->connection_error_details = NULL; } if (self->priv->avatar_request_queue != NULL) { g_array_unref (self->priv->avatar_request_queue); self->priv->avatar_request_queue = NULL; } if (self->priv->avatar_request_idle_id != 0) { g_source_remove (self->priv->avatar_request_idle_id); self->priv->avatar_request_idle_id = 0; } tp_contact_info_spec_list_free (self->priv->contact_info_supported_fields); self->priv->contact_info_supported_fields = NULL; tp_clear_pointer (&self->priv->balance_currency, g_free); tp_clear_pointer (&self->priv->balance_uri, g_free); tp_clear_pointer (&self->priv->cm_name, g_free); tp_clear_pointer (&self->priv->proto_name, g_free); ((GObjectClass *) tp_connection_parent_class)->finalize (object); } static void contact_notify_disposed (gpointer k G_GNUC_UNUSED, gpointer v, gpointer d G_GNUC_UNUSED) { _tp_contact_connection_disposed (v); } static void tp_connection_dispose (GObject *object) { TpConnection *self = TP_CONNECTION (object); DEBUG ("%p", object); if (self->priv->account != NULL) { g_object_remove_weak_pointer ((GObject *) self->priv->account, (gpointer) &self->priv->account); self->priv->account = NULL; } tp_clear_pointer (&self->priv->contact_groups, g_ptr_array_unref); tp_clear_pointer (&self->priv->roster, g_hash_table_unref); tp_clear_pointer (&self->priv->contacts_changed_queue, _tp_connection_contacts_changed_queue_free); tp_clear_pointer (&self->priv->blocked_changed_queue, _tp_connection_blocked_changed_queue_free); if (self->priv->contacts != NULL) { g_hash_table_foreach (self->priv->contacts, contact_notify_disposed, NULL); tp_clear_pointer (&self->priv->contacts, g_hash_table_unref); } tp_clear_object (&self->priv->capabilities); tp_clear_pointer (&self->priv->avatar_requirements, tp_avatar_requirements_destroy); if (self->priv->interests != NULL) { guint size = tp_intset_size (self->priv->interests); /* Before freeing the set of tokens in which we declared an * interest, cancel those interests. We'll still get the signals * if there's another interested TpConnection in this process, * because the CM uses distributed refcounting. */ if (size > 0) { TpIntsetFastIter iter; GPtrArray *strings; guint element; strings = g_ptr_array_sized_new (size + 1); tp_intset_fast_iter_init (&iter, self->priv->interests); while (tp_intset_fast_iter_next (&iter, &element)) g_ptr_array_add (strings, (gchar *) g_quark_to_string (element)); g_ptr_array_add (strings, NULL); /* no callback - if the CM replies, we'll ignore it anyway */ tp_cli_connection_call_remove_client_interest (self, -1, (const gchar **) strings->pdata, NULL, NULL, NULL, NULL); g_ptr_array_unref (strings); } tp_intset_destroy (self->priv->interests); self->priv->interests = NULL; } tp_clear_pointer (&self->priv->blocked_contacts, g_ptr_array_unref); g_clear_object (&self->priv->self_contact); ((GObjectClass *) tp_connection_parent_class)->dispose (object); } enum { FEAT_CORE, FEAT_CONNECTED, FEAT_CAPABILITIES, FEAT_AVATAR_REQUIREMENTS, FEAT_CONTACT_INFO, FEAT_BALANCE, FEAT_CONTACT_LIST, FEAT_CONTACT_LIST_PROPS, FEAT_CONTACT_GROUPS, FEAT_CONTACT_BLOCKING, FEAT_ALIASING, N_FEAT }; static const TpProxyFeature * tp_connection_list_features (TpProxyClass *cls G_GNUC_UNUSED) { static TpProxyFeature features[N_FEAT + 1] = { { 0 } }; static GQuark need_requests[2] = {0, 0}; static GQuark need_avatars[2] = {0, 0}; static GQuark need_contact_info[2] = {0, 0}; static GQuark need_balance[2] = {0, 0}; static GQuark need_contact_list[3] = {0, 0, 0}; static GQuark need_contact_groups[2] = {0, 0}; static GQuark need_contact_blocking[2] = {0, 0}; static GQuark depends_contact_list[2] = {0, 0}; static GQuark need_aliasing[2] = {0, 0}; if (G_LIKELY (features[0].name != 0)) return features; features[FEAT_CORE].name = TP_CONNECTION_FEATURE_CORE; features[FEAT_CORE].core = TRUE; features[FEAT_CONNECTED].name = TP_CONNECTION_FEATURE_CONNECTED; features[FEAT_CAPABILITIES].name = TP_CONNECTION_FEATURE_CAPABILITIES; features[FEAT_CAPABILITIES].prepare_async = tp_connection_prepare_capabilities_async; need_requests[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_REQUESTS; features[FEAT_CAPABILITIES].interfaces_needed = need_requests; features[FEAT_AVATAR_REQUIREMENTS].name = TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS; features[FEAT_AVATAR_REQUIREMENTS].prepare_async = _tp_connection_prepare_avatar_requirements_async; need_avatars[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_AVATARS; features[FEAT_AVATAR_REQUIREMENTS].interfaces_needed = need_avatars; features[FEAT_CONTACT_INFO].name = TP_CONNECTION_FEATURE_CONTACT_INFO; features[FEAT_CONTACT_INFO].prepare_async = _tp_connection_prepare_contact_info_async; need_contact_info[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_INFO; features[FEAT_CONTACT_INFO].interfaces_needed = need_contact_info; features[FEAT_BALANCE].name = TP_CONNECTION_FEATURE_BALANCE; features[FEAT_BALANCE].prepare_async = tp_connection_prepare_balance_async; need_balance[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_BALANCE; features[FEAT_BALANCE].interfaces_needed = need_balance; features[FEAT_CONTACT_LIST].name = TP_CONNECTION_FEATURE_CONTACT_LIST; features[FEAT_CONTACT_LIST].prepare_async = _tp_connection_prepare_contact_list_async; need_contact_list[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST; need_contact_list[1] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS; features[FEAT_CONTACT_LIST].interfaces_needed = need_contact_list; depends_contact_list[0] = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES; features[FEAT_CONTACT_LIST].depends_on = depends_contact_list; features[FEAT_CONTACT_LIST_PROPS].name = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES; features[FEAT_CONTACT_LIST_PROPS].prepare_async = _tp_connection_prepare_contact_list_props_async; features[FEAT_CONTACT_LIST_PROPS].interfaces_needed = need_contact_list; features[FEAT_CONTACT_GROUPS].name = TP_CONNECTION_FEATURE_CONTACT_GROUPS; features[FEAT_CONTACT_GROUPS].prepare_async = _tp_connection_prepare_contact_groups_async; need_contact_groups[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS; features[FEAT_CONTACT_GROUPS].interfaces_needed = need_contact_groups; features[FEAT_CONTACT_BLOCKING].name = TP_CONNECTION_FEATURE_CONTACT_BLOCKING; features[FEAT_CONTACT_BLOCKING].prepare_async = _tp_connection_prepare_contact_blocking_async; need_contact_blocking[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING; features[FEAT_CONTACT_BLOCKING].interfaces_needed = need_contact_blocking; features[FEAT_ALIASING].name = TP_CONNECTION_FEATURE_ALIASING; features[FEAT_ALIASING].prepare_async = _tp_connection_prepare_aliasing_async; need_aliasing[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_ALIASING; features[FEAT_ALIASING].interfaces_needed = need_aliasing; /* assert that the terminator at the end is there */ g_assert (features[N_FEAT].name == 0); return features; } static void tp_connection_class_init (TpConnectionClass *klass) { GParamSpec *param_spec; TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; tp_connection_init_known_interfaces (); g_type_class_add_private (klass, sizeof (TpConnectionPrivate)); object_class->constructed = tp_connection_constructed; object_class->get_property = tp_connection_get_property; object_class->dispose = tp_connection_dispose; object_class->finalize = tp_connection_finalize; proxy_class->interface = TP_IFACE_QUARK_CONNECTION; /* If you change this, you must also change TpChannel to stop asserting * that its connection has a unique name */ proxy_class->must_have_unique_name = TRUE; proxy_class->list_features = tp_connection_list_features; /** * TpConnection:status: * * This connection's status, or %TP_UNKNOWN_CONNECTION_STATUS if we don't * know yet. * * To wait for a valid status (and other properties), call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE. * * Since version 0.11.3, the change to status * %TP_CONNECTION_STATUS_CONNECTED is delayed slightly, until introspection * of the connection has finished. */ param_spec = g_param_spec_uint ("status", "Status", "The status of this connection", 0, G_MAXUINT32, TP_UNKNOWN_CONNECTION_STATUS, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATUS, param_spec); /** * TpConnection:connection-manager-name: * * This connection's connection manager name. * * Since: 0.13.16 * Deprecated: Use #TpConnection:cm-name instead. */ g_object_class_install_property (object_class, PROP_CONNECTION_MANAGER_NAME, g_param_spec_string ("connection-manager-name", "Connection manager name", "The connection's connection manager name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpConnection:cm-name: * * This connection's connection manager name. * * Since: 0.19.3 */ g_object_class_install_property (object_class, PROP_CM_NAME, g_param_spec_string ("cm-name", "Connection manager name", "The connection's connection manager name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpConnection:protocol-name: * * The connection's machine-readable protocol name, such as "jabber", * "msn" or "local-xmpp". Recommended names for most protocols can be * found in the Telepathy D-Bus Interface Specification. * * Since: 0.13.16 * */ g_object_class_install_property (object_class, PROP_PROTOCOL_NAME, g_param_spec_string ("protocol-name", "Protocol name", "The connection's protocol name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** * TpConnection:self-handle: * * The %TP_HANDLE_TYPE_CONTACT handle of the local user on this connection, * or 0 if we don't know yet or if the connection has become invalid. * * This may change if the local user's unique identifier changes (for * instance by using /nick on IRC), in which case #GObject::notify will be * emitted. * * To wait for a valid self-handle (and other properties), call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONNECTED. * * Deprecated: Use #TpConnection:self-contact instead. */ param_spec = g_param_spec_uint ("self-handle", "Self handle", "The local user's Contact handle on this connection", 0, G_MAXUINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SELF_HANDLE, param_spec); /** * TpConnection:self-contact: * * A #TpContact representing the local user on this connection, * or %NULL if not yet available. * * If the local user's unique identifier changes (for instance by using * /nick on IRC), this property will change to a different #TpContact object * representing the new identifier, and #GObject::notify will be emitted. * * The #TpContact object is guaranteed to have all of the features previously * passed to tp_simple_client_factory_add_contact_features() prepared. * * To wait for a non-%NULL self-contact (and other properties), call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONNECTED. * * Since: 0.13.9 */ param_spec = g_param_spec_object ("self-contact", "Self contact", "The local user's Contact object on this connection", TP_TYPE_CONTACT, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SELF_CONTACT, param_spec); /** * TpConnection:status-reason: * * To wait for a valid status (and other properties), call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_CORE. * * The reason why #TpConnection:status changed to its current value, * or TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. * know yet. */ param_spec = g_param_spec_uint ("status-reason", "Last status change reason", "The reason why #TpConnection:status changed to its current value", 0, G_MAXUINT32, TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_STATUS_REASON, param_spec); /** * TpConnection:connection-ready: * * Initially %FALSE; changes to %TRUE when the connection has gone to * CONNECTED status, introspection has finished and it's ready for use. * * By the time this property becomes %TRUE, any extra interfaces will * have been set up and the #TpProxy:interfaces property will have been * populated. * * This is similar to %TP_CONNECTION_FEATURE_CONNECTED, except that once * it has changed to %TRUE, it remains %TRUE even if the connection has * been invalidated. * * Deprecated: 0.17.6: use tp_proxy_is_prepared() with * %TP_CHANNEL_FEATURE_CONNECTED for checks, or tp_proxy_prepare_async() for * notification */ param_spec = g_param_spec_boolean ("connection-ready", "Connection ready?", "Initially FALSE; changes to TRUE when introspection finishes", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED); g_object_class_install_property (object_class, PROP_CONNECTION_READY, param_spec); /** * TpConnection:capabilities: * * The %TpCapabilities object representing the capabilities of this * connection, or NULL if we don't know yet. * * To wait for valid capability information, call tp_proxy_prepare_async() * with the feature %TP_CONNECTION_FEATURE_CAPABILITIES. */ param_spec = g_param_spec_object ("capabilities", "Capabilities", "A TpCapabilities object representing the capabilities of the connection", TP_TYPE_CAPABILITIES, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAPABILITIES, param_spec); /** * TpConnection:balance: * * The Amount field of the Balance.AccountBalance property. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. * * See Also: tp_connection_get_balance() */ param_spec = g_param_spec_int ("balance", "Balance Amount", "The Amount field of the Account Balance", G_MININT32, G_MAXINT32, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BALANCE, param_spec); /** * TpConnection:balance-scale: * * The Scale field of the Balance.AccountBalance property. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. * * See Also: tp_connection_get_balance() */ param_spec = g_param_spec_uint ("balance-scale", "Balance Scale", "The Scale field of the Account Balance", 0, G_MAXUINT32, G_MAXUINT32, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BALANCE_SCALE, param_spec); /** * TpConnection:balance-currency: * * The Currency field of the Balance.AccountBalance property. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. * * See Also: tp_connection_get_balance() */ param_spec = g_param_spec_string ("balance-currency", "Balance Currency", "The Currency field of the Account Balance", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BALANCE_CURRENCY, param_spec); /** * TpConnection:balance-uri: * * The Balance.ManageCreditURI property. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. */ param_spec = g_param_spec_string ("balance-uri", "Balance URI", "The URI for managing the account balance", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BALANCE_URI, param_spec); /** * TpConnection::balance-changed: * @self: a channel * @balance: the value of the #TpConnection:balance property * @balance_scale: the value of the #TpConnection:balance-scale property * @balance_currency: the value of the #TpConnection:balance-currency property * * Emitted when at least one of the #TpConnection:balance, * #TpConnection:balance-scale or #TpConnection:balance-currency * property is changed. * * For this signal to be emitted, you must first call * tp_proxy_prepare_async() with the feature %TP_CONNECTION_FEATURE_BALANCE. * * Since: 0.15.1 */ signals[SIGNAL_BALANCE_CHANGED] = g_signal_new ("balance-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_INT, G_TYPE_UINT, G_TYPE_STRING); /** * TpConnection:contact-list-state: * * The progress made in retrieving the contact list. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or * %TP_CONNECTION_FEATURE_CONTACT_LIST. * * Since: 0.15.5 */ param_spec = g_param_spec_uint ("contact-list-state", "ContactList state", "The state of the contact list", 0, G_MAXUINT, TP_CONTACT_LIST_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_LIST_STATE, param_spec); /** * TpConnection:contact-list-persists: * * If true, presence subscriptions (in both directions) on this connection are * stored by the server or other infrastructure. * * If false, presence subscriptions on this connection are not stored. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or * %TP_CONNECTION_FEATURE_CONTACT_LIST. * * Since: 0.15.5 */ param_spec = g_param_spec_boolean ("contact-list-persists", "ContactList persists", "Whether the contact list persists", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_LIST_PERSISTS, param_spec); /** * TpConnection:can-change-contact-list: * * If true, presence subscription and publication can be changed using the * RequestSubscription, AuthorizePublication and RemoveContacts methods. * * Rational: link-local XMPP, presence is implicitly published to everyone in * the local subnet, so the user cannot control their presence publication. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or * %TP_CONNECTION_FEATURE_CONTACT_LIST. * * Since: 0.15.5 */ param_spec = g_param_spec_boolean ("can-change-contact-list", "ContactList can change", "Whether the contact list can change", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAN_CHANGE_CONTACT_LIST, param_spec); /** * TpConnection:request-uses-message: * * If true, the Message parameter to RequestSubscription is likely to be * significant, and user interfaces SHOULD prompt the user for a message to * send with the request; a message such as "I would like to add you to my * contact list", translated into the local user's language, might make a * suitable default. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES or * %TP_CONNECTION_FEATURE_CONTACT_LIST. * * Since: 0.15.5 */ param_spec = g_param_spec_boolean ("request-uses-message", "Request Uses Message", "Whether request uses message", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REQUEST_USES_MESSAGE, param_spec); /** * TpConnection:disjoint-groups: * * True if each contact can be in at most one group; false if each contact * can be in many groups. * * This property cannot change after the connection has moved to the * %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, * and it may change at any time, without notification. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ param_spec = g_param_spec_boolean ("disjoint-groups", "Disjoint Groups", "Whether groups are disjoint", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISJOINT_GROUPS, param_spec); /** * TpConnection:group-storage: * * Indicates the extent to which contacts' groups can be set and stored. * * This property cannot change after the connection has moved to the * %TP_CONNECTION_STATUS_CONNECTED state. Until then, its value is undefined, * and it may change at any time, without notification. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ param_spec = g_param_spec_uint ("group-storage", "Group Storage", "Group storage capabilities", 0, G_MAXUINT, TP_CONTACT_METADATA_STORAGE_TYPE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_GROUP_STORAGE, param_spec); /** * TpConnection:contact-groups: * * The names of all groups that currently exist. This may be a larger set than * the union of all #TpContact:contact-groups properties, if the connection * allows groups to be empty. * * This property's value is not meaningful until the * #TpConnection:contact-list-state property has become * %TP_CONTACT_LIST_STATE_SUCCESS. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ param_spec = g_param_spec_boxed ("contact-groups", "Contact Groups", "All existing contact groups", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT_GROUPS, param_spec); /** * TpConnection:can-report-abusive: * * If this property is %TRUE, contacts may be reported as abusive to the * server administrators by setting report_abusive to %TRUE when calling * tp_connection_block_contacts_async(). * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. * * Since: 0.17.0 */ param_spec = g_param_spec_boolean ("can-report-abusive", "Can report abusive", "Can report abusive", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CAN_REPORT_ABUSIVE, param_spec); /** * TpConnection:blocked-contacts: * * A #GPtrArray of blocked #TpContact. Changes are notified using the * #TpConnection::blocked-contacts-changed signal. * * These TpContact objects have been prepared with the desired features. * See tp_simple_client_factory_add_contact_features() to define which * features needs to be prepared on them. * * For this property to be valid, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. * * Since: 0.17.0 */ param_spec = g_param_spec_boxed ("blocked-contacts", "blocked contacts", "Blocked contacts", G_TYPE_PTR_ARRAY, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BLOCKED_CONTACTS, param_spec); /** * TpConnection::groups-created: * @self: a #TpConnection * @added: a #GStrv with the names of the new groups. * * Emitted when new, empty groups are created. This will often be followed by * #TpContact::contact-groups-changed signals that add some members. When this * signal is emitted, #TpConnection:contact-groups property is already * updated. * * For this signal to be emited, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ signals[SIGNAL_GROUPS_CREATED] = g_signal_new ( "groups-created", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRV); /** * TpConnection::groups-removed: * @self: A #TpConnection * @added: A #GStrv with the names of the groups. * * Emitted when one or more groups are removed. If they had members at the * time that they were removed, then immediately after this signal is emitted, * #TpContact::contact-groups-changed signals that their members were removed. * When this signal is emitted, #TpConnection:contact-groups property is * already updated. * * For this signal to be emited, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ signals[SIGNAL_GROUPS_REMOVED] = g_signal_new ( "groups-removed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRV); /** * TpConnection::group-renamed: * @self: a #TpConnection * @old_name: the old name of the group. * @new_name: the new name of the group. * * Emitted when a group is renamed, in protocols where this can be * distinguished from group creation, removal and membership changes. * * Immediately after this signal is emitted, #TpConnection::groups-created * signal the creation of a group with the new name, and * #TpConnection::groups-removed signal the removal of a group with the old * name. * If the group was not empty, immediately after those signals are emitted, * #TpContact::contact-groups-changed signal that the members of that group * were removed from the old name and added to the new name. * * When this signal is emitted, #TpConnection:contact-groups property is * already updated. * * For this signal to be emited, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_GROUPS. * * Since: 0.15.5 */ signals[SIGNAL_GROUP_RENAMED] = g_signal_new ( "group-renamed", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); /** * TpConnection::contact-list-changed: * @self: a #TpConnection * @added: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact added to contacts list * @removed: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact removed from contacts list * * Notify of changes in the list of contacts as returned by * tp_connection_dup_contact_list(). It is guaranteed that all contacts have * desired features prepared. See * tp_simple_client_factory_add_contact_features() to define which features * needs to be prepared. * * This signal is also emitted for the initial set of contacts once retrieved. * * For this signal to be emitted, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_LIST. * * Since: 0.15.5 */ signals[SIGNAL_CONTACT_LIST_CHANGED] = g_signal_new ( "contact-list-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY); /** * TpConnection::blocked-contacts-changed: * @self: a #TpConnection * @added: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact which have been blocked * @removed: (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a #GPtrArray of #TpContact which are no longer blocked * * Notify of changes in #TpConnection:blocked-contacts. * It is guaranteed that all contacts have desired features prepared. See * tp_simple_client_factory_add_contact_features() to define which features * needs to be prepared. * * This signal is also emitted for the initial set of blocked contacts once * retrieved. * * For this signal to be emitted, you must first call * tp_proxy_prepare_async() with the feature * %TP_CONNECTION_FEATURE_CONTACT_BLOCKING. * * Since: 0.17.0 */ signals[SIGNAL_BLOCKED_CONTACTS_CHANGED] = g_signal_new ( "blocked-contacts-changed", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_PTR_ARRAY, G_TYPE_PTR_ARRAY); } /** * tp_connection_new: * @dbus: a D-Bus daemon; may not be %NULL * @bus_name: (allow-none): the well-known or unique name of the connection * process; if well-known, this function will make a blocking call to the bus * daemon to resolve the unique name. May be %NULL if @object_path is not, in * which case a well-known name will be derived from @object_path. * @object_path: (allow-none): the object path of the connection process. * May be %NULL if @bus_name is a well-known name, in which case the object * path will be derived from @bus_name. * @error: used to indicate the error if %NULL is returned * * * * Returns: a new connection proxy, or %NULL if unique-name resolution * fails or on invalid arguments * * Since: 0.7.1 * Deprecated: Use tp_simple_client_factory_ensure_connection() instead. */ TpConnection * tp_connection_new (TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, GError **error) { return _tp_connection_new_with_factory (NULL, dbus, bus_name, object_path, error); } TpConnection * _tp_connection_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, GError **error) { gchar *dup_path = NULL; gchar *dup_name = NULL; gchar *dup_unique_name = NULL; TpConnection *ret = NULL; g_return_val_if_fail (TP_IS_DBUS_DAEMON (dbus), NULL); g_return_val_if_fail (object_path != NULL || (bus_name != NULL && bus_name[0] != ':'), NULL); if (object_path == NULL) { dup_path = g_strdelimit (g_strdup_printf ("/%s", bus_name), ".", '/'); object_path = dup_path; } else if (bus_name == NULL) { dup_name = g_strdelimit (g_strdup (object_path + 1), "/", '.'); bus_name = dup_name; } if (!_tp_connection_parse (object_path, '/', NULL, NULL)) { g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_INVALID_OBJECT_PATH, "Connection object path is not in the right format"); goto finally; } if (!tp_dbus_check_valid_bus_name (bus_name, TP_DBUS_NAME_TYPE_NOT_BUS_DAEMON, error)) goto finally; /* Resolve unique name if necessary */ if (bus_name[0] != ':') { if (!_tp_dbus_daemon_get_name_owner (dbus, 2000, bus_name, &dup_unique_name, error)) goto finally; bus_name = dup_unique_name; if (!tp_dbus_check_valid_bus_name (bus_name, TP_DBUS_NAME_TYPE_UNIQUE, error)) goto finally; } if (!tp_dbus_check_valid_object_path (object_path, error)) goto finally; ret = TP_CONNECTION (g_object_new (TP_TYPE_CONNECTION, "dbus-daemon", dbus, "bus-name", bus_name, "object-path", object_path, "factory", factory, NULL)); finally: g_free (dup_path); g_free (dup_name); g_free (dup_unique_name); return ret; } /** * tp_connection_get_account: * @self: a connection * * Return the the #TpAccount associated with this connection. Will return %NULL * if @self was not acquired from a #TpAccount via tp_account_get_connection(), * or if the account object got finalized in the meantime (#TpConnection does * not keep a strong ref on its #TpAccount). * * Returns: (transfer none): the account associated with this connection, or * %NULL. * * Since: 0.15.5 */ TpAccount * tp_connection_get_account (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->account; } void _tp_connection_set_account (TpConnection *self, TpAccount *account) { if (self->priv->account == account) return; g_assert (self->priv->account == NULL); g_assert (account != NULL); self->priv->account = account; g_object_add_weak_pointer ((GObject *) account, (gpointer) &self->priv->account); } /** * tp_connection_get_self_handle: * @self: a connection * * Return the %TP_HANDLE_TYPE_CONTACT handle of the local user on this * connection, or 0 if the self-handle is not known yet or the connection * has become invalid (the TpProxy::invalidated signal). * * The returned handle is not necessarily valid forever (the * notify::self-handle signal will be emitted if it changes, which can happen * on protocols such as IRC). Construct a #TpContact object if you want to * track the local user's identifier in the protocol, or other information * like their presence status, over time. * * Returns: the value of the TpConnection:self-handle property * * Since: 0.7.26 * Deprecated: Use tp_connection_get_self_contact() instead. */ TpHandle tp_connection_get_self_handle (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), 0); if (self->priv->self_contact == NULL) return 0; return tp_contact_get_handle (self->priv->self_contact); } /** * tp_connection_get_status: * @self: a connection * @reason: (out): a TpConnectionStatusReason, or %NULL * * If @reason is not %NULL it is set to the reason why "status" changed to its * current value, or %TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED if unknown. * * Returns: This connection's status, or %TP_UNKNOWN_CONNECTION_STATUS if we * don't know yet. * * Since: 0.7.14 */ TpConnectionStatus tp_connection_get_status (TpConnection *self, TpConnectionStatusReason *reason) { g_return_val_if_fail (TP_IS_CONNECTION (self), TP_UNKNOWN_CONNECTION_STATUS); if (reason != NULL) *reason = self->priv->status_reason; return self->priv->status; } /** * tp_connection_get_connection_manager_name: * @self: a #TpConnection * * * * Returns: the same as the #TpConnection:connection-manager-name property * * Since: 0.13.16 * Deprecated: Use tp_connection_get_cm_name() instead. * */ const gchar * tp_connection_get_connection_manager_name (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->cm_name; } /** * tp_connection_get_cm_name: * @self: a #TpConnection * * * * Returns: the same as the #TpConnection:cm-name property * * Since: 0.19.3 * */ const gchar * tp_connection_get_cm_name (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->cm_name; } /** * tp_connection_get_protocol_name: * @self: a #TpConnection * * * * Returns: the same as the #TpConnection:protocol-name property * * Since: 0.13.16 * */ const gchar * tp_connection_get_protocol_name (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->proto_name; } /** * tp_connection_run_until_ready: (skip) * @self: a connection * @connect: if %TRUE, call Connect() if it appears to be necessary; * if %FALSE, rely on Connect() to be called by another client * @error: if not %NULL and %FALSE is returned, used to raise an error * @loop: if not %NULL, a #GMainLoop is placed here while it is being run * (so calling code can call g_main_loop_quit() to abort), and %NULL is * placed here after the loop has been run * * If @self is connected and ready for use, return immediately. Otherwise, * call Connect() (unless @connect is %FALSE) and re-enter the main loop * until the connection becomes invalid, the connection connects successfully * and is introspected, or the main loop stored via @loop is cancelled. * * Returns: %TRUE if the connection is now connected and ready for use, * %FALSE if the connection has become invalid. * * Since: 0.7.1 * Deprecated: 0.11.0: Use tp_proxy_prepare_async() and re-enter the main * loop yourself, or restructure your program in such a way as to avoid * re-entering the main loop. */ typedef struct { GMainLoop *loop; TpProxyPendingCall *pc; GError *connect_error /* gets initialized */; } RunUntilReadyData; static void run_until_ready_ret (TpConnection *self, const GError *error, gpointer user_data, GObject *weak_object) { RunUntilReadyData *data = user_data; if (error != NULL) { g_main_loop_quit (data->loop); data->connect_error = g_error_copy (error); } } static void run_until_ready_destroy (gpointer p) { RunUntilReadyData *data = p; data->pc = NULL; } gboolean tp_connection_run_until_ready (TpConnection *self, gboolean connect, GError **error, GMainLoop **loop) { TpProxy *as_proxy = (TpProxy *) self; gulong invalidated_id, ready_id; RunUntilReadyData data = { NULL, NULL, NULL }; g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); if (as_proxy->invalidated) goto raise_invalidated; if (self->priv->ready) return TRUE; data.loop = g_main_loop_new (NULL, FALSE); invalidated_id = g_signal_connect_swapped (self, "invalidated", G_CALLBACK (g_main_loop_quit), data.loop); ready_id = g_signal_connect_swapped (self, "notify::connection-ready", G_CALLBACK (g_main_loop_quit), data.loop); if (self->priv->status != TP_CONNECTION_STATUS_CONNECTED && connect) { data.pc = tp_cli_connection_call_connect (self, -1, run_until_ready_ret, &data, run_until_ready_destroy, NULL); } if (data.connect_error == NULL) { if (loop != NULL) *loop = data.loop; g_main_loop_run (data.loop); if (loop != NULL) *loop = NULL; } if (data.pc != NULL) tp_proxy_pending_call_cancel (data.pc); g_signal_handler_disconnect (self, invalidated_id); g_signal_handler_disconnect (self, ready_id); g_main_loop_unref (data.loop); if (data.connect_error != NULL) { g_propagate_error (error, data.connect_error); return FALSE; } if (as_proxy->invalidated != NULL) goto raise_invalidated; if (self->priv->ready) return TRUE; g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_CANCELLED, "tp_connection_run_until_ready() cancelled"); return FALSE; raise_invalidated: if (error != NULL) { g_return_val_if_fail (*error == NULL, FALSE); *error = g_error_copy (as_proxy->invalidated); } return FALSE; } /** * TpConnectionNameListCb: * @names: (array zero-terminated=1): %NULL-terminated array of @n * connection bus names, or %NULL on error * @n: number of names (not including the final %NULL), or 0 on error * @cms: (array zero-terminated=1): %NULL-terminated array of @n * connection manager names (e.g. "gabble") in the same order as @names, or * %NULL on error * @protocols: (array zero-terminated=1): %NULL-terminated array of * @n protocol names as defined in the Telepathy spec (e.g. "jabber") in the * same order as @names, or %NULL on error * @error: %NULL on success, or an error that occurred * @user_data: user-supplied data * @weak_object: user-supplied weakly referenced object * * Signature of the callback supplied to tp_list_connection_names(). * * Since: 0.7.1 */ typedef struct { TpConnectionNameListCb callback; gpointer user_data; GDestroyNotify destroy; } _ListContext; static gboolean _tp_connection_parse (const gchar *path_or_bus_name, char delimiter, gchar **protocol, gchar **cm_name) { const gchar *prefix; const gchar *cm_name_start; const gchar *protocol_start; const gchar *account_start; gchar *dup_cm_name = NULL; gchar *dup_protocol = NULL; g_return_val_if_fail (delimiter == '.' || delimiter == '/', FALSE); /* If CM respects the spec, object path and bus name should be in the form: * /org/freedesktop/Telepathy/Connection/cmname/proto/account * org.freedesktop.Telepathy.Connection.cmname.proto.account */ if (delimiter == '.') prefix = TP_CONN_BUS_NAME_BASE; else prefix = TP_CONN_OBJECT_PATH_BASE; if (!g_str_has_prefix (path_or_bus_name, prefix)) goto OUT; cm_name_start = path_or_bus_name + strlen (prefix); protocol_start = strchr (cm_name_start, delimiter); if (protocol_start == NULL) goto OUT; protocol_start++; account_start = strchr (protocol_start, delimiter); if (account_start == NULL) goto OUT; account_start++; dup_cm_name = g_strndup (cm_name_start, protocol_start - cm_name_start - 1); if (!tp_connection_manager_check_valid_name (dup_cm_name, NULL)) { g_free (dup_cm_name); dup_cm_name = NULL; goto OUT; } dup_protocol = g_strndup (protocol_start, account_start - protocol_start - 1); if (!tp_strdiff (dup_protocol, "local_2dxmpp")) { /* the CM's telepathy-glib is older than 0.7.x, work around it. * FIXME: Remove this workaround in 0.9.x */ g_free (dup_protocol); dup_protocol = g_strdup ("local-xmpp"); } else { /* the real protocol name may have "-" in; bus names may not, but * they may have "_", so the Telepathy spec specifies replacement. * Here we need to undo that replacement */ g_strdelimit (dup_protocol, "_", '-'); } if (!tp_connection_manager_check_valid_protocol_name (dup_protocol, NULL)) { g_free (dup_protocol); dup_protocol = NULL; goto OUT; } OUT: if (dup_protocol == NULL || dup_cm_name == NULL) { g_free (dup_protocol); g_free (dup_cm_name); return FALSE; } if (cm_name != NULL) *cm_name = dup_cm_name; else g_free (dup_cm_name); if (protocol != NULL) *protocol = dup_protocol; else g_free (dup_protocol); return TRUE; } static void tp_list_connection_names_helper (TpDBusDaemon *bus_daemon, const gchar * const *names, const GError *error, gpointer user_data, GObject *user_object) { _ListContext *list_context = user_data; const gchar * const *iter; /* array of borrowed strings */ GPtrArray *bus_names; /* array of dup'd strings */ GPtrArray *cms; /* array of borrowed strings */ GPtrArray *protocols; if (error != NULL) { list_context->callback (NULL, 0, NULL, NULL, error, list_context->user_data, user_object); return; } bus_names = g_ptr_array_new (); cms = g_ptr_array_new (); protocols = g_ptr_array_new (); for (iter = names; iter != NULL && *iter != NULL; iter++) { gchar *proto, *cm_name; if (_tp_connection_parse (*iter, '.', &proto, &cm_name)) { /* the casts here are because g_ptr_array contains non-const pointers - * but in this case I'll only be passing pdata to a callback with const * arguments, so it's fine */ g_ptr_array_add (bus_names, (gpointer) *iter); g_ptr_array_add (cms, cm_name); g_ptr_array_add (protocols, proto); continue; } } g_ptr_array_add (bus_names, NULL); g_ptr_array_add (cms, NULL); g_ptr_array_add (protocols, NULL); list_context->callback ((const gchar * const *) bus_names->pdata, bus_names->len - 1, (const gchar * const *) cms->pdata, (const gchar * const *) protocols->pdata, NULL, list_context->user_data, user_object); g_ptr_array_unref (bus_names); g_strfreev ((char **) g_ptr_array_free (cms, FALSE)); g_strfreev ((char **) g_ptr_array_free (protocols, FALSE)); } static void list_context_free (gpointer p) { _ListContext *list_context = p; if (list_context->destroy != NULL) list_context->destroy (list_context->user_data); g_slice_free (_ListContext, list_context); } /** * tp_list_connection_names: * @bus_daemon: proxy for the D-Bus daemon * @callback: callback to be called when listing the connections succeeds or * fails; not called if the D-Bus connection fails completely or if the * @weak_object goes away * @user_data: user-supplied data for the callback * @destroy: callback to destroy the user-supplied data, called after * @callback, but also if the D-Bus connection fails or if the @weak_object * goes away * @weak_object: (allow-none): if not %NULL, will be weakly referenced; the callback will * not be called if the object has vanished * * List the bus names of all the connections that currently exist, together * with the connection manager name and the protocol name for each connection. * Call the callback when done. * * The bus names passed to the callback can be used to construct #TpConnection * objects for any connections that are of interest. * * Since: 0.7.1 */ void tp_list_connection_names (TpDBusDaemon *bus_daemon, TpConnectionNameListCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { _ListContext *list_context = g_slice_new0 (_ListContext); g_return_if_fail (TP_IS_DBUS_DAEMON (bus_daemon)); g_return_if_fail (callback != NULL); list_context->callback = callback; list_context->user_data = user_data; tp_dbus_daemon_list_names (bus_daemon, 2000, tp_list_connection_names_helper, list_context, list_context_free, weak_object); } static gpointer tp_connection_once (gpointer data G_GNUC_UNUSED) { GType type = TP_TYPE_CONNECTION; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (type, tp_cli_connection_add_signals); tp_proxy_subclass_add_error_mapping (type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); return NULL; } /** * tp_connection_init_known_interfaces: * * Ensure that the known interfaces for TpConnection have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CONNECTION. * * Since: 0.7.6 */ void tp_connection_init_known_interfaces (void) { static GOnce once = G_ONCE_INIT; g_once (&once, tp_connection_once, NULL); } typedef struct { TpConnectionWhenReadyCb callback; gpointer user_data; gulong invalidated_id; gulong ready_id; } CallWhenReadyContext; static void cwr_invalidated (TpConnection *self, guint domain, gint code, gchar *message, gpointer user_data) { CallWhenReadyContext *ctx = user_data; GError e = { domain, code, message }; DEBUG ("enter"); g_assert (ctx->callback != NULL); ctx->callback (self, &e, ctx->user_data); g_signal_handler_disconnect (self, ctx->invalidated_id); g_signal_handler_disconnect (self, ctx->ready_id); ctx->callback = NULL; /* poison it to detect errors */ g_slice_free (CallWhenReadyContext, ctx); } static void cwr_ready (TpConnection *self, GParamSpec *unused G_GNUC_UNUSED, gpointer user_data) { CallWhenReadyContext *ctx = user_data; DEBUG ("enter"); g_assert (ctx->callback != NULL); ctx->callback (self, NULL, ctx->user_data); g_signal_handler_disconnect (self, ctx->invalidated_id); g_signal_handler_disconnect (self, ctx->ready_id); ctx->callback = NULL; /* poison it to detect errors */ g_slice_free (CallWhenReadyContext, ctx); } /** * TpConnectionWhenReadyCb: * @connection: the connection (which may be in the middle of being disposed, * if error is non-%NULL, error->domain is TP_DBUS_ERRORS and error->code is * TP_DBUS_ERROR_PROXY_UNREFERENCED) * @error: %NULL if the connection is ready for use, or the error with which * it was invalidated if it is now invalid * @user_data: whatever was passed to tp_connection_call_when_ready() * * Signature of a callback passed to tp_connection_call_when_ready(), which * will be called exactly once, when the connection becomes ready or * invalid (whichever happens first) * * Deprecated: 0.17.6 */ /** * tp_connection_call_when_ready: (skip) * @self: a connection * @callback: called when the connection becomes ready or invalidated, * whichever happens first * @user_data: arbitrary user-supplied data passed to the callback * * If @self is ready for use or has been invalidated, call @callback * immediately, then return. Otherwise, arrange * for @callback to be called when @self either becomes ready for use * or becomes invalid. * * Note that if the connection is not in state CONNECTED, the callback will * not be called until the connection either goes to state CONNECTED * or is invalidated (e.g. by going to state DISCONNECTED or by becoming * unreferenced). In particular, this method does not call Connect(). * Call tp_cli_connection_call_connect() too, if you want to do that. * * Since: 0.7.7 * Deprecated: 0.17.6: Use tp_proxy_prepare_async() */ void tp_connection_call_when_ready (TpConnection *self, TpConnectionWhenReadyCb callback, gpointer user_data) { TpProxy *as_proxy = (TpProxy *) self; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (callback != NULL); if (self->priv->ready || as_proxy->invalidated != NULL) { DEBUG ("already ready or invalidated"); callback (self, as_proxy->invalidated, user_data); } else { CallWhenReadyContext *ctx = g_slice_new (CallWhenReadyContext); DEBUG ("arranging callback later"); ctx->callback = callback; ctx->user_data = user_data; ctx->invalidated_id = g_signal_connect (self, "invalidated", G_CALLBACK (cwr_invalidated), ctx); ctx->ready_id = g_signal_connect (self, "notify::connection-ready", G_CALLBACK (cwr_ready), ctx); } } static guint get_presence_type_availability (TpConnectionPresenceType type) { switch (type) { case TP_CONNECTION_PRESENCE_TYPE_UNSET: return 0; case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN: return 1; case TP_CONNECTION_PRESENCE_TYPE_ERROR: return 2; case TP_CONNECTION_PRESENCE_TYPE_OFFLINE: return 3; case TP_CONNECTION_PRESENCE_TYPE_HIDDEN: return 4; case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY: return 5; case TP_CONNECTION_PRESENCE_TYPE_AWAY: return 6; case TP_CONNECTION_PRESENCE_TYPE_BUSY: return 7; case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE: return 8; } /* This is an unexpected presence type, treat it like UNKNOWN */ return 1; } /** * tp_connection_presence_type_cmp_availability: * @p1: a #TpConnectionPresenceType * @p2: a #TpConnectionPresenceType * * Compares @p1 and @p2 like strcmp(). @p1 > @p2 means @p1 is more available * than @p2. * * The order used is: available > busy > away > xa > hidden > offline > error > * unknown > unset * * Returns: -1, 0 or 1, if @p1 is <, == or > than @p2. * * Since: 0.7.16 */ gint tp_connection_presence_type_cmp_availability (TpConnectionPresenceType p1, TpConnectionPresenceType p2) { guint availability1; guint availability2; availability1 = get_presence_type_availability (p1); availability2 = get_presence_type_availability (p2); if (availability1 < availability2) return -1; if (availability1 > availability2) return +1; return 0; } /** * tp_connection_parse_object_path: * @self: a connection * @protocol: (out) (transfer full): If not NULL, used to return the protocol * of the connection * @cm_name: (out) (transfer full): If not NULL, used to return the connection * manager name of the connection * * If the object path of @connection is in the correct form, set * @protocol and @cm_name, return TRUE. Otherwise leave them unchanged and * return FALSE. * * Returns: TRUE if the object path was correctly parsed, FALSE otherwise. * * Since: 0.7.27 * Deprecated: Use tp_connection_get_protocol_name() and * tp_connection_get_connection_manager_name() instead. */ gboolean tp_connection_parse_object_path (TpConnection *self, gchar **protocol, gchar **cm_name) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); if (protocol != NULL) *protocol = g_strdup (self->priv->proto_name); if (cm_name != NULL) *cm_name = g_strdup (self->priv->cm_name); return TRUE; } /* Can return a contact that's not meant to be visible to library users * because it lacks an identifier */ TpContact * _tp_connection_lookup_contact (TpConnection *self, TpHandle handle) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return g_hash_table_lookup (self->priv->contacts, GUINT_TO_POINTER (handle)); } /* this could be done with proper weak references, but we know that every * connection will weakly reference all its contacts, so we can just do this * explicitly in tp_contact_dispose */ void _tp_connection_remove_contact (TpConnection *self, TpHandle handle, TpContact *contact) { TpContact *mine; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (TP_IS_CONTACT (contact)); mine = g_hash_table_lookup (self->priv->contacts, GUINT_TO_POINTER (handle)); g_return_if_fail (mine == contact); g_hash_table_remove (self->priv->contacts, GUINT_TO_POINTER (handle)); } void _tp_connection_add_contact (TpConnection *self, TpHandle handle, TpContact *contact) { g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (TP_IS_CONTACT (contact)); g_return_if_fail (g_hash_table_lookup (self->priv->contacts, GUINT_TO_POINTER (handle)) == NULL); g_hash_table_insert (self->priv->contacts, GUINT_TO_POINTER (handle), contact); /* Set TP_CONTACT_FEATURE_CONTACT_BLOCKING if possible */ if (tp_proxy_is_prepared (self, TP_CONNECTION_FEATURE_CONTACT_BLOCKING)) { _tp_connection_set_contact_blocked (self, contact); } } /** * tp_connection_is_ready: (skip) * @self: a connection * * Returns the same thing as the #TpConnection:connection-ready property. * * Returns: %TRUE if introspection has completed * Since: 0.7.17 * Deprecated: 0.17.6: use tp_proxy_is_prepared() with * %TP_CONNECTION_FEATURE_CONNECTED */ gboolean tp_connection_is_ready (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->ready; } /** * tp_connection_get_capabilities: * @self: a connection * * * * Returns: (transfer none): the same #TpCapabilities as the * #TpConnection:capabilities property * Since: 0.11.3 */ TpCapabilities * tp_connection_get_capabilities (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->capabilities; } /** * tp_connection_get_detailed_error: * @self: a connection * @details: (out) (allow-none) (element-type utf8 GObject.Value) (transfer none): * optionally used to return a map from string to #GValue, which must not be * modified or destroyed by the caller * * If the connection has disconnected, return the D-Bus error name with which * it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was * disconnected by a user request). * * Otherwise, return %NULL, without altering @details. * * Returns: (transfer none) (allow-none): a D-Bus error name, or %NULL. * * Since: 0.11.4 */ const gchar * tp_connection_get_detailed_error (TpConnection *self, const GHashTable **details) { TpProxy *proxy = (TpProxy *) self; if (proxy->invalidated == NULL) return NULL; if (self->priv->connection_error != NULL) { g_assert (self->priv->connection_error_details != NULL); if (details != NULL) *details = self->priv->connection_error_details; return self->priv->connection_error; } else { /* no detailed error, but we *have* been invalidated - guess one based * on the invalidation reason */ if (details != NULL) { if (self->priv->connection_error_details == NULL) { self->priv->connection_error_details = tp_asv_new ( "debug-message", G_TYPE_STRING, proxy->invalidated->message, NULL); } *details = self->priv->connection_error_details; } if (proxy->invalidated->domain == TP_ERROR) { return tp_error_get_dbus_name (proxy->invalidated->code); } else if (proxy->invalidated->domain == TP_DBUS_ERRORS) { switch (proxy->invalidated->code) { case TP_DBUS_ERROR_NAME_OWNER_LOST: /* the CM probably crashed */ return DBUS_ERROR_NO_REPLY; break; case TP_DBUS_ERROR_OBJECT_REMOVED: case TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR: case TP_DBUS_ERROR_INCONSISTENT: /* ... and all other cases up to and including * TP_DBUS_ERROR_INCONSISTENT don't make sense in this context, so * just use the generic one for them too */ default: return TP_ERROR_STR_DISCONNECTED; } } else { /* no idea what that means */ return TP_ERROR_STR_DISCONNECTED; } } } /** * tp_connection_dup_detailed_error_vardict: * @self: a connection * @details: (out) (allow-none) (transfer full): * optionally used to return a %G_VARIANT_TYPE_VARDICT with details * of the error * * If the connection has disconnected, return the D-Bus error name with which * it disconnected (in particular, this is %TP_ERROR_STR_CANCELLED if it was * disconnected by a user request). * * Otherwise, return %NULL, without altering @details. * * Returns: (transfer full) (allow-none): a D-Bus error name, or %NULL. * * Since: 0.19.0 */ gchar * tp_connection_dup_detailed_error_vardict (TpConnection *self, GVariant **details) { const GHashTable *asv; const gchar *error = tp_connection_get_detailed_error (self, &asv); if (error == NULL) return NULL; if (details != NULL) *details = _tp_asv_to_vardict (asv); return g_strdup (error); } /** * tp_connection_add_client_interest: * @self: a connection * @interested_in: a string identifying an interface or part of an interface * to which this connection will subscribe * * Subscribe to any opt-in change notifications for @interested_in. * * For contact information, use #TpContact instead, which will call this * automatically. * * Since: 0.11.3 */ void tp_connection_add_client_interest (TpConnection *self, const gchar *interested_in) { tp_connection_add_client_interest_by_id (self, g_quark_from_string (interested_in)); } /** * tp_connection_add_client_interest_by_id: (skip) * @self: a connection * @interested_in: a quark identifying an interface or part of an interface * to which this connection will subscribe * * Subscribe to any opt-in change notifications for @interested_in. * * Equivalent to, but a little more efficient than, calling * tp_connection_add_client_interest() for the string value of @interested_in. * * Since: 0.11.3 */ void tp_connection_add_client_interest_by_id (TpConnection *self, GQuark interested_in) { TpProxy *proxy = (TpProxy *) self; const gchar *interest = g_quark_to_string (interested_in); const gchar *strv[2] = { interest, NULL }; g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (interest != NULL); if (proxy->invalidated != NULL || tp_intset_is_member (self->priv->interests, interested_in)) return; tp_intset_add (self->priv->interests, interested_in); /* no-reply flag set, and we ignore any reply */ tp_cli_connection_call_add_client_interest (self, -1, strv, NULL, NULL, NULL, NULL); } /** * tp_connection_has_immortal_handles: * @self: a connection * * Return %TRUE if this connection is known to not destroy handles * (#TpHandle) until it disconnects. * * On such connections, if you know that a handle maps to a particular * identifier now, then you can rely on that handle mapping to that * identifier for the whole lifetime of the connection. * * Returns: %TRUE if handles last as long as the connection itself */ gboolean tp_connection_has_immortal_handles (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->has_immortal_handles; } /** * tp_connection_get_self_contact: * @self: a connection * * Return a #TpContact representing the local user on this connection. * * The returned object is not necessarily valid after the main loop is * re-entered; ref it with g_object_ref() if you want to keep it. * * Returns: (transfer none): the value of the TpConnection:self-contact * property, which may be %NULL * * Since: 0.13.9 */ TpContact * tp_connection_get_self_contact (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return self->priv->self_contact; } /** * tp_connection_bind_connection_status_to_property: * @self: a #TpConnection * @target: the target #GObject * @target_property: the property on @target to bind (must be %G_TYPE_BOOLEAN) * @invert: %TRUE if you wish to invert the value of @target_property * (i.e. %FALSE if connected) * * Binds the :status of @self to the boolean property of another * object using a #GBinding such that the @target_property will be set to * %TRUE when @self is connected (and @invert is %FALSE). * * @target_property will be synchronised immediately (%G_BINDING_SYNC_CREATE). * @invert can be interpreted as analogous to %G_BINDING_INVERT_BOOLEAN. * * For instance, this function can be used to bind the GtkWidget:sensitive * property to only make a widget sensitive when the account is connected. * * See g_object_bind_property() for more information. * * Returns: (transfer none): the #GBinding instance representing the binding * between the @self and the @target. The binding is released whenever the * #GBinding reference count reaches zero. * Since: 0.13.16 */ GBinding * tp_connection_bind_connection_status_to_property (TpConnection *self, gpointer target, const char *target_property, gboolean invert) { g_return_val_if_fail (TP_IS_CONNECTION (self), NULL); return g_object_bind_property_full (self, "status", target, target_property, G_BINDING_SYNC_CREATE, _tp_bind_connection_status_to_boolean, NULL, GUINT_TO_POINTER (invert), NULL); } /** * tp_connection_get_balance: * @self: a #TpConnection * @balance: (out): a pointer to store the account balance (or %NULL) * @scale: (out): a pointer to store the balance scale (or %NULL) * @currency: (out) (transfer none): a pointer to store the balance * currency (or %NULL) * * If @self has a valid account balance, returns %TRUE and sets the variables * pointed to by @balance, @scale and @currency to the appropriate fields * of the Balance.AccountBalance property. * * The monetary value of the balance is expressed as a fixed-point number, * @balance, with a decimal scale defined by @scale; for instance a @balance * of 1234 with @scale of 2 represents a value of "12.34" in the currency * represented by @currency. * * Requires %TP_CONNECTION_FEATURE_BALANCE to be prepared. * * Returns: %TRUE if the balance is valid (and the values set), %FALSE if the * balance is invalid. * Since: 0.15.1 */ gboolean tp_connection_get_balance (TpConnection *self, gint *balance, guint *scale, const gchar **currency) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); if (self->priv->balance_currency == NULL) return FALSE; if (self->priv->balance == 0 && self->priv->balance_scale == G_MAXUINT32 && tp_str_empty (self->priv->balance_currency)) return FALSE; if (balance != NULL) *balance = self->priv->balance; if (scale != NULL) *scale = self->priv->balance_scale; if (currency != NULL) *currency = self->priv->balance_currency; return TRUE; } /** * tp_connection_get_balance_uri: * @self: a #TpConnection * * The value of Balance.ManageCreditURI. * * Requires %TP_CONNECTION_FEATURE_BALANCE to be prepared. * * Returns: (transfer none): the #TpConnection:balance-uri property. * Since: 0.15.1 */ const gchar * tp_connection_get_balance_uri (TpConnection *self) { g_return_val_if_fail (TP_IS_CONNECTION (self), FALSE); return self->priv->balance_uri; } static void _tp_connection_void_cb (TpConnection *proxy, const GError *error, gpointer user_data, GObject *weak_object) { GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); if (error != NULL) g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete_in_idle (result); g_object_unref (G_OBJECT (result)); } /** * tp_connection_disconnect_async: * @self: a #TpConnection * @callback: a callback to call when the request is satisfied * @user_data: data to pass to @callback * * Disconnect the connection. * * This method is intended for use by AccountManager implementations, * such as Mission Control. To disconnect a connection managed by an * AccountManager, either use tp_account_request_presence_async() * or tp_account_set_enabled_async(), depending whether the intention is * to put the account offline temporarily, or disable it longer-term. * * Since: 0.17.5 */ void tp_connection_disconnect_async (TpConnection *self, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_CONNECTION (self)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_connection_disconnect_async); tp_cli_connection_call_disconnect (self, -1, _tp_connection_void_cb, result, NULL, NULL); } /** * tp_connection_disconnect_finish: * @self: a #TpConnection * @result: a #GAsyncResult * @error: a #GError to fill * * Interpret the result of tp_connection_disconnect_async(). * * Returns: %TRUE if the call was successful, otherwise %FALSE * * Since: 0.17.5 */ gboolean tp_connection_disconnect_finish (TpConnection *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_connection_disconnect_async); } telepathy-glib-0.24.2/telepathy-glib/connection.h0000644000175000017500000003227412652510705016667 00000000000000/* * connection.h - proxy for a Telepathy connection * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CONNECTION_H__ #define __TP_CONNECTION_H__ #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpContactInfoFieldSpec TpContactInfoFieldSpec; struct _TpContactInfoFieldSpec { /**/ gchar *name; GStrv parameters; TpContactInfoFieldFlags flags; guint max; /**/ gpointer priv; }; #define TP_TYPE_CONTACT_INFO_FIELD_SPEC (tp_contact_info_field_spec_get_type ()) GType tp_contact_info_field_spec_get_type (void); TpContactInfoFieldSpec *tp_contact_info_field_spec_copy ( const TpContactInfoFieldSpec *self); void tp_contact_info_field_spec_free (TpContactInfoFieldSpec *self); #ifndef __GI_SCANNER__ /* the typedef only exists for G_DEFINE_BOXED_TYPE's benefit, and * g-ir-scanner 1.32.1 doesn't parse a skip annotation */ typedef GList TpContactInfoSpecList; #endif #define TP_TYPE_CONTACT_INFO_SPEC_LIST (tp_contact_info_spec_list_get_type ()) GType tp_contact_info_spec_list_get_type (void); GList *tp_contact_info_spec_list_copy (GList *list); void tp_contact_info_spec_list_free (GList *list); typedef struct _TpContactInfoField TpContactInfoField; struct _TpContactInfoField { /**/ gchar *field_name; GStrv parameters; GStrv field_value; /**/ gpointer priv; }; #define TP_TYPE_CONTACT_INFO_FIELD (tp_contact_info_field_get_type ()) GType tp_contact_info_field_get_type (void); TpContactInfoField *tp_contact_info_field_new (const gchar *field_name, GStrv parameters, GStrv field_value); TpContactInfoField *tp_contact_info_field_copy (const TpContactInfoField *self); void tp_contact_info_field_free (TpContactInfoField *self); #ifndef __GI_SCANNER__ /* the typedef only exists for G_DEFINE_BOXED_TYPE's benefit, and * g-ir-scanner 1.32.1 doesn't parse a skip annotation */ typedef GList TpContactInfoList; #endif #define TP_TYPE_CONTACT_INFO_LIST (tp_contact_info_list_get_type ()) GType tp_contact_info_list_get_type (void); GList *tp_contact_info_list_copy (GList *list); void tp_contact_info_list_free (GList *list); /* forward declaration, see contact.h for the rest */ typedef struct _TpContact TpContact; /* forward declaration, see account.h for the rest */ typedef struct _TpAccount TpAccount; typedef struct _TpConnection TpConnection; typedef struct _TpConnectionPrivate TpConnectionPrivate; typedef struct _TpConnectionClass TpConnectionClass; struct _TpConnectionClass { TpProxyClass parent_class; /**/ GCallback _1; GCallback _2; GCallback _3; GCallback _4; }; struct _TpConnection { /**/ TpProxy parent; TpConnectionPrivate *priv; }; GType tp_connection_get_type (void); #define TP_ERRORS_DISCONNECTED (tp_errors_disconnected_quark ()) GQuark tp_errors_disconnected_quark (void); #define TP_UNKNOWN_CONNECTION_STATUS ((TpConnectionStatus) -1) /* TYPE MACROS */ #define TP_TYPE_CONNECTION \ (tp_connection_get_type ()) #define TP_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_CONNECTION, \ TpConnection)) #define TP_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_CONNECTION, \ TpConnectionClass)) #define TP_IS_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_CONNECTION)) #define TP_IS_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_CONNECTION)) #define TP_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONNECTION, \ TpConnectionClass)) _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_connection) TpConnection *tp_connection_new (TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, GError **error) G_GNUC_WARN_UNUSED_RESULT; _TP_AVAILABLE_IN_0_16 TpAccount *tp_connection_get_account (TpConnection *self); TpConnectionStatus tp_connection_get_status (TpConnection *self, TpConnectionStatusReason *reason); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_connection_get_cm_name) const gchar *tp_connection_get_connection_manager_name (TpConnection *self); #endif _TP_AVAILABLE_IN_0_20 const gchar *tp_connection_get_cm_name (TpConnection *self); const gchar *tp_connection_get_protocol_name (TpConnection *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_connection_get_self_contact) TpHandle tp_connection_get_self_handle (TpConnection *self); #endif TpContact *tp_connection_get_self_contact (TpConnection *self); TpCapabilities * tp_connection_get_capabilities (TpConnection *self); TpContactInfoFlags tp_connection_get_contact_info_flags (TpConnection *self); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR (tp_connection_dup_contact_info_supported_fields) GList *tp_connection_get_contact_info_supported_fields (TpConnection *self); #endif _TP_AVAILABLE_IN_0_20 GList *tp_connection_dup_contact_info_supported_fields (TpConnection *self); void tp_connection_set_contact_info_async (TpConnection *self, GList *info, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_connection_set_contact_info_finish (TpConnection *self, GAsyncResult *result, GError **error); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_is_prepared) gboolean tp_connection_is_ready (TpConnection *self); _TP_DEPRECATED_IN_0_18 gboolean tp_connection_run_until_ready (TpConnection *self, gboolean connect, GError **error, GMainLoop **loop); typedef void (*TpConnectionWhenReadyCb) (TpConnection *connection, const GError *error, gpointer user_data); _TP_DEPRECATED_IN_0_18_FOR (tp_proxy_prepare_async) void tp_connection_call_when_ready (TpConnection *self, TpConnectionWhenReadyCb callback, gpointer user_data); #endif typedef void (*TpConnectionNameListCb) (const gchar * const *names, gsize n, const gchar * const *cms, const gchar * const *protocols, const GError *error, gpointer user_data, GObject *weak_object); void tp_list_connection_names (TpDBusDaemon *bus_daemon, TpConnectionNameListCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); void tp_connection_init_known_interfaces (void); gint tp_connection_presence_type_cmp_availability (TpConnectionPresenceType p1, TpConnectionPresenceType p2); #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_connection_get_protocol_name) gboolean tp_connection_parse_object_path (TpConnection *self, gchar **protocol, gchar **cm_name); #endif _TP_AVAILABLE_IN_0_20 const gchar *tp_connection_get_detailed_error (TpConnection *self, const GHashTable **details); _TP_AVAILABLE_IN_0_20 gchar *tp_connection_dup_detailed_error_vardict (TpConnection *self, GVariant **details) G_GNUC_WARN_UNUSED_RESULT; void tp_connection_add_client_interest (TpConnection *self, const gchar *interested_in); void tp_connection_add_client_interest_by_id (TpConnection *self, GQuark interested_in); gboolean tp_connection_has_immortal_handles (TpConnection *self); #define TP_CONNECTION_FEATURE_CORE \ (tp_connection_get_feature_quark_core ()) GQuark tp_connection_get_feature_quark_core (void) G_GNUC_CONST; #define TP_CONNECTION_FEATURE_CONNECTED \ (tp_connection_get_feature_quark_connected ()) GQuark tp_connection_get_feature_quark_connected (void) G_GNUC_CONST; #define TP_CONNECTION_FEATURE_CAPABILITIES \ (tp_connection_get_feature_quark_capabilities ()) GQuark tp_connection_get_feature_quark_capabilities (void) G_GNUC_CONST; #define TP_CONNECTION_FEATURE_CONTACT_INFO \ (tp_connection_get_feature_quark_contact_info ()) GQuark tp_connection_get_feature_quark_contact_info (void) G_GNUC_CONST; /* connection-handles.c */ #ifndef TP_DISABLE_DEPRECATED typedef void (*TpConnectionHoldHandlesCb) (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_20 void tp_connection_hold_handles (TpConnection *self, gint timeout_ms, TpHandleType handle_type, guint n_handles, const TpHandle *handles, TpConnectionHoldHandlesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); typedef void (*TpConnectionRequestHandlesCb) (TpConnection *connection, TpHandleType handle_type, guint n_handles, const TpHandle *handles, const gchar * const *ids, const GError *error, gpointer user_data, GObject *weak_object); _TP_DEPRECATED_IN_0_20 void tp_connection_request_handles (TpConnection *self, gint timeout_ms, TpHandleType handle_type, const gchar * const *ids, TpConnectionRequestHandlesCb callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); _TP_DEPRECATED_IN_0_20 void tp_connection_unref_handles (TpConnection *self, TpHandleType handle_type, guint n_handles, const TpHandle *handles); #endif /* connection-avatars.c */ typedef struct _TpAvatarRequirements TpAvatarRequirements; struct _TpAvatarRequirements { /**/ GStrv supported_mime_types; guint minimum_width; guint minimum_height; guint recommended_width; guint recommended_height; guint maximum_width; guint maximum_height; guint maximum_bytes; /**/ gpointer _1; gpointer _2; gpointer _3; gpointer _4; }; #define TP_TYPE_AVATAR_REQUIREMENTS (tp_avatar_requirements_get_type ()) GType tp_avatar_requirements_get_type (void); TpAvatarRequirements * tp_avatar_requirements_new (GStrv supported_mime_types, guint minimum_width, guint minimum_height, guint recommended_width, guint recommended_height, guint maximum_width, guint maximum_height, guint maximum_bytes); TpAvatarRequirements * tp_avatar_requirements_copy ( const TpAvatarRequirements *self); void tp_avatar_requirements_destroy (TpAvatarRequirements *self); #define TP_CONNECTION_FEATURE_AVATAR_REQUIREMENTS \ (tp_connection_get_feature_quark_avatar_requirements ()) GQuark tp_connection_get_feature_quark_avatar_requirements (void) G_GNUC_CONST; TpAvatarRequirements * tp_connection_get_avatar_requirements ( TpConnection *self); #define TP_CONNECTION_FEATURE_ALIASING \ (tp_connection_get_feature_quark_aliasing ()) _TP_AVAILABLE_IN_0_18 GQuark tp_connection_get_feature_quark_aliasing (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_18 gboolean tp_connection_can_set_contact_alias (TpConnection *self); #define TP_CONNECTION_FEATURE_BALANCE \ (tp_connection_get_feature_quark_balance ()) _TP_AVAILABLE_IN_0_16 GQuark tp_connection_get_feature_quark_balance (void) G_GNUC_CONST; _TP_AVAILABLE_IN_0_16 gboolean tp_connection_get_balance (TpConnection *self, gint *balance, guint *scale, const gchar **currency); _TP_AVAILABLE_IN_0_16 const gchar * tp_connection_get_balance_uri (TpConnection *self); _TP_AVAILABLE_IN_0_18 void tp_connection_disconnect_async (TpConnection *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_connection_disconnect_finish (TpConnection *self, GAsyncResult *result, GError **error); G_END_DECLS #include G_BEGIN_DECLS /* connection-handles.c again - this has to come after the auto-generated * stuff because it uses an auto-generated typedef */ #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_20_FOR(tp_simple_client_factory_ensure_contact) void tp_connection_get_contact_attributes (TpConnection *self, gint timeout_ms, guint n_handles, const TpHandle *handles, const gchar * const *interfaces, gboolean hold, tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); _TP_DEPRECATED_IN_0_20_FOR(tp_connection_dup_contact_list) void tp_connection_get_contact_list_attributes (TpConnection *self, gint timeout_ms, const gchar * const *interfaces, gboolean hold, tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object); #endif GBinding *tp_connection_bind_connection_status_to_property (TpConnection *self, gpointer target, const char *target_property, gboolean invert); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/simple-client-factory-internal.h0000644000175000017500000000511012652510705022541 00000000000000/**/ /* * Internal methods of TpSimpleClientFactory * * Copyright © 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_SIMPLE_CLIENT_FACTORY_INTERNAL_H__ #define __TP_SIMPLE_CLIENT_FACTORY_INTERNAL_H__ #include G_BEGIN_DECLS void _tp_simple_client_factory_insert_proxy (TpSimpleClientFactory *self, gpointer proxy); TpChannelRequest *_tp_simple_client_factory_ensure_channel_request ( TpSimpleClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error); TpChannelDispatchOperation * _tp_simple_client_factory_ensure_channel_dispatch_operation ( TpSimpleClientFactory *self, const gchar *object_path, GHashTable *immutable_properties, GError **error); TpAccount *_tp_account_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GError **error); TpConnection *_tp_connection_new_with_factory (TpSimpleClientFactory *factory, TpDBusDaemon *dbus, const gchar *bus_name, const gchar *object_path, GError **error); TpChannel *_tp_channel_new_with_factory (TpSimpleClientFactory *factory, TpConnection *conn, const gchar *object_path, const GHashTable *immutable_properties, GError **error); TpChannelRequest *_tp_channel_request_new_with_factory ( TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error); void _tp_channel_request_ensure_immutable_properties (TpChannelRequest *self, GHashTable *immutable_properties); TpChannelDispatchOperation *_tp_channel_dispatch_operation_new_with_factory ( TpSimpleClientFactory *factory, TpDBusDaemon *bus_daemon, const gchar *object_path, GHashTable *immutable_properties, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/base-connection-manager.c0000644000175000017500000011031412652510705021172 00000000000000/* * base-connection-manager.c - Source for TpBaseConnectionManager * * Copyright (C) 2007-2009 Collabora Ltd. * Copyright (C) 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-connection-manager * @title: TpBaseConnectionManager * @short_description: base class for #TpSvcConnectionManager implementations * @see_also: #TpBaseConnection, #TpSvcConnectionManager, #run * * This base class makes it easier to write #TpSvcConnectionManager * implementations by managing the D-Bus object path and bus name, * and maintaining a table of active connections. Subclasses should usually * only need to override the members of the class data structure. */ #include "config.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_PARAMS #include "telepathy-glib/base-protocol-internal.h" #include "telepathy-glib/debug-internal.h" /** * TpCMProtocolSpec: * @name: The name which should be passed to RequestConnection for this * protocol. * @parameters: An array of #TpCMParamSpec representing the valid parameters * for this protocol, terminated by a #TpCMParamSpec whose name * entry is NULL. * @params_new: A function which allocates an opaque data structure to store * the parsed parameters for this protocol. The offset fields * in the members of the @parameters array refer to offsets * within this opaque structure. * @params_free: A function which deallocates the opaque data structure * provided by #params_new, including deallocating its * data members (currently, only strings) if necessary. * @set_param: A function which sets a parameter within the opaque data * structure provided by #params_new. If %NULL, * tp_cm_param_setter_offset() will be used. (New in 0.7.0 - * previously, code equivalent to tp_cm_param_setter_offset() was * always used.) * * Structure representing a connection manager protocol. * * In addition to the fields documented here, there are three gpointer fields * which must currently be %NULL. A meaning may be defined for these in a * future version of telepathy-glib. */ /* * _TpLegacyProtocol: * * A limited implementation of TpProtocol, in terms of the ConnectionManager * API from telepathy-spec 0.18. */ typedef struct { TpBaseProtocol parent; /* Really a TpBaseConnectionManager, but using that type with * g_object_add_weak_pointer violates strict aliasing */ gpointer cm; const TpCMProtocolSpec *protocol_spec; } _TpLegacyProtocol; typedef struct { TpBaseProtocolClass parent; } _TpLegacyProtocolClass; #define _TP_TYPE_LEGACY_PROTOCOL (_tp_legacy_protocol_get_type ()) GType _tp_legacy_protocol_get_type (void) G_GNUC_CONST; G_DEFINE_TYPE(_TpLegacyProtocol, _tp_legacy_protocol, TP_TYPE_BASE_PROTOCOL) static const TpCMParamSpec * _tp_legacy_protocol_get_parameters (TpBaseProtocol *protocol) { _TpLegacyProtocol *self = (_TpLegacyProtocol *) protocol; return self->protocol_spec->parameters; } static gboolean parse_parameters (const TpCMParamSpec *paramspec, GHashTable *provided, TpIntset *params_present, const TpCMParamSetter set_param, void *params, GError **error); static TpBaseConnection * _tp_legacy_protocol_new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { _TpLegacyProtocol *self = (_TpLegacyProtocol *) protocol; const TpCMProtocolSpec *protospec = self->protocol_spec; TpBaseConnectionManagerClass *cls; TpBaseConnection *conn = NULL; void *params = NULL; TpIntset *params_present = NULL; TpCMParamSetter set_param; if (self->cm == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Connection manager no longer available"); return NULL; } g_object_ref (self->cm); g_assert (protospec->parameters != NULL); g_assert (protospec->params_new != NULL); g_assert (protospec->params_free != NULL); cls = TP_BASE_CONNECTION_MANAGER_GET_CLASS (self->cm); params_present = tp_intset_new (); params = protospec->params_new (); set_param = protospec->set_param; if (set_param == NULL) set_param = tp_cm_param_setter_offset; if (!parse_parameters (protospec->parameters, (GHashTable *) asv, params_present, set_param, params, error)) { goto finally; } conn = (cls->new_connection) (self->cm, protospec->name, params_present, params, error); finally: if (params_present != NULL) tp_intset_destroy (params_present); if (params != NULL) protospec->params_free (params); g_object_unref (self->cm); return conn; } static void _tp_legacy_protocol_class_init (_TpLegacyProtocolClass *cls) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) cls; base_class->is_stub = TRUE; base_class->get_parameters = _tp_legacy_protocol_get_parameters; base_class->new_connection = _tp_legacy_protocol_new_connection; } static void _tp_legacy_protocol_init (_TpLegacyProtocol *self) { } static TpBaseProtocol * _tp_legacy_protocol_new (TpBaseConnectionManager *cm, const TpCMProtocolSpec *protocol_spec) { _TpLegacyProtocol *self = g_object_new (_TP_TYPE_LEGACY_PROTOCOL, "name", protocol_spec->name, NULL); self->protocol_spec = protocol_spec; self->cm = cm; g_object_add_weak_pointer ((GObject *) cm, &(self->cm)); return (TpBaseProtocol *) self; } /** * TpBaseConnectionManager: * * A base class for connection managers. There are no interesting public * fields in the instance structure. */ /** * TpBaseConnectionManagerClass: * @parent_class: The parent class * @cm_dbus_name: The name of this connection manager, as used to construct * D-Bus object paths and bus names. Must contain only letters, digits * and underscores, and may not start with a digit. Must be filled in by * subclasses in their class_init function. * @get_interfaces: Returns a #GPtrArray of static strings of extra * D-Bus interfaces implemented by instances of this class, which may be * filled in by subclasses. The default is to list no additional interfaces. * Implementations must first chainup on parent class implementation and then * add extra interfaces to the #GPtrArray. Replaces @interfaces. Since: * 0.19.4 * * The class structure for #TpBaseConnectionManager. * * In addition to the fields documented here, there are some gpointer fields * which must currently be %NULL (a meaning may be defined for these in a * future version of telepathy-glib). * * Changed in 0.7.1: it is a fatal error for @cm_dbus_name not to conform to * the specification. * * Changed in 0.11.11: protocol_params and new_connection may both be * %NULL. If so, this connection manager is assumed to use Protocol objects * instead. Since 0.19.2 those fields are deprecated and should not be * used anymore. */ /** * TpBaseConnectionManagerNewConnFunc: * @self: The connection manager implementation * @proto: The protocol name from the D-Bus request * @params_present: A set of integers representing the indexes into the * array of #TpCMParamSpec of those parameters that were * present in the request * @parsed_params: An opaque data structure as returned by the protocol's * params_new function, populated according to the * parameter specifications * @error: if not %NULL, used to indicate the error if %NULL is returned * * A function that will return a new connection according to the * parsed parameters; used to implement RequestConnection. * * The connection manager base class will register the bus name for the * new connection, and place a reference to it in its table of * connections until the connection's shutdown process finishes. * * Returns: the new connection object, or %NULL on error. */ /** * TpBaseConnectionManagerGetInterfacesFunc: * @self: a #TpBaseConnectionManager * * Signature of an implementation of * #TpBaseConnectionManagerClass.get_interfaces virtual function. * * Implementation must first chainup on parent class implementation and then * add extra interfaces into the #GPtrArray. * * |[ * static GPtrArray * * my_connection_manager_get_interfaces (TpBaseConnectionManager *self) * { * GPtrArray *interfaces; * * interfaces = TP_BASE_CONNECTION_MANAGER_CLASS ( * my_connection_manager_parent_class)->get_interfaces (self); * * g_ptr_array_add (interfaces, TP_IFACE_BADGERS); * * return interfaces; * } * ]| * * Returns: (transfer container): a #GPtrArray of static strings for D-Bus * interfaces implemented by this client. * * Since: 0.19.4 */ static void service_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE(TpBaseConnectionManager, tp_base_connection_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES, tp_dbus_properties_mixin_iface_init); G_IMPLEMENT_INTERFACE(TP_TYPE_SVC_CONNECTION_MANAGER, service_iface_init)) struct _TpBaseConnectionManagerPrivate { /* if TRUE, the object has gone away */ gboolean dispose_has_run; /* used as a set: key is TpBaseConnection *, value is TRUE */ GHashTable *connections; /* true after tp_base_connection_manager_register is called */ gboolean registered; /* dup'd string => ref to TpBaseProtocol */ GHashTable *protocols; TpDBusDaemon *dbus_daemon; }; enum { PROP_DBUS_DAEMON = 1, PROP_INTERFACES, PROP_PROTOCOLS, N_PROPS }; enum { NO_MORE_CONNECTIONS, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; static void tp_base_connection_manager_dispose (GObject *object) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); TpBaseConnectionManagerPrivate *priv = self->priv; GObjectFinalizeFunc dispose = G_OBJECT_CLASS (tp_base_connection_manager_parent_class)->dispose; if (priv->dispose_has_run) return; priv->dispose_has_run = TRUE; if (priv->dbus_daemon != NULL) { g_object_unref (priv->dbus_daemon); priv->dbus_daemon = NULL; } if (priv->protocols != NULL) { g_hash_table_unref (priv->protocols); priv->protocols = NULL; } if (dispose != NULL) dispose (object); } static void tp_base_connection_manager_finalize (GObject *object) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); TpBaseConnectionManagerPrivate *priv = self->priv; g_hash_table_unref (priv->connections); G_OBJECT_CLASS (tp_base_connection_manager_parent_class)->finalize (object); } static gboolean tp_base_connection_manager_ensure_dbus (TpBaseConnectionManager *self, GError **error) { if (self->priv->dbus_daemon == NULL) { self->priv->dbus_daemon = tp_dbus_daemon_dup (error); if (self->priv->dbus_daemon == NULL) return FALSE; } return TRUE; } static GObject * tp_base_connection_manager_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *) tp_base_connection_manager_parent_class; TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object_class->constructor (type, n_params, params)); TpBaseConnectionManagerClass *cls = TP_BASE_CONNECTION_MANAGER_GET_CLASS (self); GError *error = NULL; g_assert (tp_connection_manager_check_valid_name (cls->cm_dbus_name, NULL)); /* if one of these is NULL, the other must be too */ g_assert (cls->new_connection == NULL || cls->protocol_params != NULL); g_assert (cls->protocol_params == NULL || cls->new_connection != NULL); if (!tp_base_connection_manager_ensure_dbus (self, &error)) { WARNING ("%s", error->message); g_error_free (error); } return (GObject *) self; } static void tp_base_connection_manager_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); TpBaseConnectionManagerClass *cls = TP_BASE_CONNECTION_MANAGER_GET_CLASS ( object); switch (property_id) { case PROP_DBUS_DAEMON: g_value_set_object (value, self->priv->dbus_daemon); break; case PROP_INTERFACES: { GPtrArray *interfaces = cls->get_interfaces (self); /* make sure there's a terminating NULL */ g_ptr_array_add (interfaces, NULL); g_value_set_boxed (value, interfaces->pdata); g_ptr_array_unref (interfaces); } break; case PROP_PROTOCOLS: { GHashTable *map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_hash_table_unref); GHashTableIter iter; gpointer name, protocol; g_hash_table_iter_init (&iter, self->priv->protocols); while (g_hash_table_iter_next (&iter, &name, &protocol)) { GHashTable *props; g_object_get (protocol, "immutable-properties", &props, NULL); g_hash_table_insert (map, g_strdup (name), props); } g_value_take_boxed (value, map); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_connection_manager_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); switch (property_id) { case PROP_DBUS_DAEMON: { TpDBusDaemon *dbus_daemon = g_value_get_object (value); g_assert (self->priv->dbus_daemon == NULL); /* construct-only */ if (dbus_daemon != NULL) self->priv->dbus_daemon = g_object_ref (dbus_daemon); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static GPtrArray * tp_base_connection_manager_get_interfaces (TpBaseConnectionManager *self) { GPtrArray *interfaces = g_ptr_array_new (); const char * const *ptr; /* copy the klass->interfaces property for backwards compatibility */ for (ptr = TP_BASE_CONNECTION_MANAGER_GET_CLASS (self)->interfaces; ptr != NULL && *ptr != NULL; ptr++) { g_ptr_array_add (interfaces, (char *) *ptr); } return interfaces; } static void tp_base_connection_manager_class_init (TpBaseConnectionManagerClass *klass) { static TpDBusPropertiesMixinPropImpl cm_properties[] = { { "Protocols", "protocols", NULL }, { "Interfaces", "interfaces", NULL }, { NULL } }; GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (TpBaseConnectionManagerPrivate)); object_class->constructor = tp_base_connection_manager_constructor; object_class->get_property = tp_base_connection_manager_get_property; object_class->set_property = tp_base_connection_manager_set_property; object_class->dispose = tp_base_connection_manager_dispose; object_class->finalize = tp_base_connection_manager_finalize; klass->get_interfaces = tp_base_connection_manager_get_interfaces; /** * TpBaseConnectionManager:dbus-daemon: * * #TpDBusDaemon object encapsulating this object's connection to D-Bus. * Read-only except during construction. * * If this property is %NULL or omitted during construction, the object will * automatically attempt to connect to the starter or session bus with * tp_dbus_daemon_dup() just after it is constructed; if this fails, a * warning will be logged with g_warning(), and this property will remain * %NULL. * * Since: 0.11.3 */ g_object_class_install_property (object_class, PROP_DBUS_DAEMON, g_param_spec_object ("dbus-daemon", "D-Bus daemon", "The D-Bus daemon used by this object", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** * TpBaseConnectionManager:interfaces: * * The set of D-Bus interfaces available on this ConnectionManager, other * than ConnectionManager itself. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_INTERFACES, g_param_spec_boxed ("interfaces", "ConnectionManager.Interfaces", "The set of D-Bus interfaces available on this ConnectionManager, " "other than ConnectionManager itself", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpBaseConnectionManager:protocols: * * The Protocol objects available on this ConnectionManager. * * Since: 0.11.11 */ g_object_class_install_property (object_class, PROP_PROTOCOLS, g_param_spec_boxed ("protocols", "ConnectionManager.Protocols", "The set of protocols available on this Connection, other than " "ConnectionManager itself", TP_HASH_TYPE_PROTOCOL_PROPERTIES_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** * TpBaseConnectionManager::no-more-connections: * * Emitted when the table of active connections becomes empty. * tp_run_connection_manager() uses this to detect when to shut down the * connection manager. */ signals[NO_MORE_CONNECTIONS] = g_signal_new ("no-more-connections", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 0); tp_dbus_properties_mixin_class_init (object_class, 0); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CONNECTION_MANAGER, tp_dbus_properties_mixin_getter_gobject_properties, NULL, cm_properties); } static void tp_base_connection_manager_init (TpBaseConnectionManager *self) { TpBaseConnectionManagerPrivate *priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CONNECTION_MANAGER, TpBaseConnectionManagerPrivate); self->priv = priv; priv->connections = g_hash_table_new (g_direct_hash, g_direct_equal); priv->protocols = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } /** * connection_shutdown_finished_cb: * @conn: #TpBaseConnection * @data: data passed in callback * * Signal handler called when a connection object disconnects. * When they become disconnected, we can unref and discard * them, and they will disappear from the bus. */ static void connection_shutdown_finished_cb (TpBaseConnection *conn, gpointer data) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (data); TpBaseConnectionManagerPrivate *priv = self->priv; /* temporary ref, because disconnecting this signal handler might release * the last ref */ g_object_ref (self); g_assert (g_hash_table_lookup (priv->connections, conn)); g_hash_table_remove (priv->connections, conn); DEBUG ("dereferenced connection"); if (g_hash_table_size (priv->connections) == 0) { g_signal_emit (self, signals[NO_MORE_CONNECTIONS], 0); } g_signal_handlers_disconnect_by_func (conn, connection_shutdown_finished_cb, data); g_object_unref (conn); g_object_unref (self); } /* Parameter parsing */ static TpBaseProtocol * tp_base_connection_manager_get_protocol (TpBaseConnectionManager *self, const gchar *protocol_name, GError **error) { TpBaseProtocol *protocol = g_hash_table_lookup (self->priv->protocols, protocol_name); if (protocol != NULL) return protocol; g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "unknown protocol %s", protocol_name); return NULL; } /** * tp_cm_param_setter_offset: * @paramspec: A parameter specification with offset set to some * meaningful value. * @value: The value for that parameter, either provided by the user or * constructed from the parameter's default. * @params: An opaque data structure such that the address at (@params + * @paramspec->offset) is a valid pointer to a variable of the * appropriate type. * * A #TpCMParamSetter which sets parameters by dereferencing an offset * from @params. If @paramspec->offset is G_MAXSIZE, the parameter is * deemed obsolete, and is accepted but ignored. * * Since: 0.7.0 */ void tp_cm_param_setter_offset (const TpCMParamSpec *paramspec, const GValue *value, gpointer params) { char *params_mem = params; if (paramspec->offset == G_MAXSIZE) { /* quietly ignore any obsolete params provided */ return; } switch (paramspec->dtype[0]) { case DBUS_TYPE_STRING: { gchar **save_to = (gchar **) (params_mem + paramspec->offset); const gchar *str; g_assert (paramspec->gtype == G_TYPE_STRING); str = g_value_get_string (value); g_free (*save_to); if (str == NULL) { *save_to = g_strdup (""); } else { *save_to = g_value_dup_string (value); } if (DEBUGGING) { if (strstr (paramspec->name, "password") != NULL) DEBUG ("%s = ", paramspec->name); else DEBUG ("%s = \"%s\"", paramspec->name, *save_to); } } break; case DBUS_TYPE_INT16: case DBUS_TYPE_INT32: { gint *save_to = (gint *) (params_mem + paramspec->offset); gint i = g_value_get_int (value); g_assert (paramspec->gtype == G_TYPE_INT); *save_to = i; DEBUG ("%s = %d = 0x%x", paramspec->name, i, i); } break; case DBUS_TYPE_UINT16: case DBUS_TYPE_UINT32: { guint *save_to = (guint *) (params_mem + paramspec->offset); guint i = g_value_get_uint (value); g_assert (paramspec->gtype == G_TYPE_UINT); *save_to = i; DEBUG ("%s = %u = 0x%x", paramspec->name, i, i); } break; case DBUS_TYPE_INT64: { gint64 *save_to = (gint64 *) (params_mem + paramspec->offset); gint64 i = g_value_get_int64 (value); g_assert (paramspec->gtype == G_TYPE_INT64); *save_to = i; DEBUG ("%s = %" G_GINT64_FORMAT, paramspec->name, i); } break; case DBUS_TYPE_UINT64: { guint64 *save_to = (guint64 *) (params_mem + paramspec->offset); guint64 i = g_value_get_uint64 (value); g_assert (paramspec->gtype == G_TYPE_UINT64); *save_to = i; DEBUG ("%s = %" G_GUINT64_FORMAT, paramspec->name, i); } break; case DBUS_TYPE_DOUBLE: { gdouble *save_to = (gdouble *) (params_mem + paramspec->offset); gdouble i = g_value_get_double (value); g_assert (paramspec->gtype == G_TYPE_DOUBLE); *save_to = i; DEBUG ("%s = %f", paramspec->name, i); } break; case DBUS_TYPE_OBJECT_PATH: { gchar **save_to = (gchar **) (params_mem + paramspec->offset); g_assert (paramspec->gtype == DBUS_TYPE_G_OBJECT_PATH); g_free (*save_to); *save_to = g_value_dup_boxed (value); DEBUG ("%s = \"%s\"", paramspec->name, *save_to); } break; case DBUS_TYPE_BOOLEAN: { gboolean *save_to = (gboolean *) (params_mem + paramspec->offset); gboolean b = g_value_get_boolean (value); g_assert (paramspec->gtype == G_TYPE_BOOLEAN); g_assert (b == TRUE || b == FALSE); *save_to = b; DEBUG ("%s = %s", paramspec->name, b ? "TRUE" : "FALSE"); } break; case DBUS_TYPE_ARRAY: switch (paramspec->dtype[1]) { case DBUS_TYPE_STRING: { GStrv *save_to = (GStrv *) (params_mem + paramspec->offset); g_strfreev (*save_to); *save_to = g_value_dup_boxed (value); if (DEBUGGING) { gchar *joined = g_strjoinv (", ", *save_to); DEBUG ("%s = [%s]", paramspec->name, joined); g_free (joined); } } break; case DBUS_TYPE_BYTE: { GArray **save_to = (GArray **) (params_mem + paramspec->offset); if (*save_to != NULL) { g_array_unref (*save_to); } *save_to = g_value_dup_boxed (value); DEBUG ("%s = ...[%u]", paramspec->name, (*save_to)->len); } break; default: ERROR ("encountered unhandled D-Bus array type %s on " "argument %s", paramspec->dtype, paramspec->name); g_assert_not_reached (); } break; default: ERROR ("encountered unhandled D-Bus type %s on argument %s", paramspec->dtype, paramspec->name); g_assert_not_reached (); } } static gboolean set_param_from_value (const TpCMParamSpec *paramspec, GValue *value, const TpCMParamSetter set_param, void *params, GError **error) { if (G_VALUE_TYPE (value) != paramspec->gtype) { DEBUG ("expected type %s for parameter %s, got %s", g_type_name (paramspec->gtype), paramspec->name, G_VALUE_TYPE_NAME (value)); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "expected type %s for account parameter %s, got %s", g_type_name (paramspec->gtype), paramspec->name, G_VALUE_TYPE_NAME (value)); return FALSE; } set_param (paramspec, value, params); return TRUE; } static gboolean parse_parameters (const TpCMParamSpec *paramspec, GHashTable *provided, TpIntset *params_present, const TpCMParamSetter set_param, void *params, GError **error) { int i; GValue *value; for (i = 0; paramspec[i].name; i++) { value = g_hash_table_lookup (provided, paramspec[i].name); if (value != NULL) { if (!set_param_from_value (¶mspec[i], value, set_param, params, error)) { return FALSE; } tp_intset_add (params_present, i); g_hash_table_remove (provided, paramspec[i].name); } } return TRUE; } /* * tp_base_connection_manager_get_parameters: * * Implements D-Bus method GetParameters * on interface org.freedesktop.Telepathy.ConnectionManager */ static void tp_base_connection_manager_get_parameters (TpSvcConnectionManager *iface, const gchar *proto, DBusGMethodInvocation *context) { GPtrArray *ret; GError *error = NULL; TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (iface); guint i; TpBaseProtocol *protocol; const TpCMParamSpec *parameters; g_assert (TP_IS_BASE_CONNECTION_MANAGER (iface)); /* a D-Bus method shouldn't be happening til we're on D-Bus */ g_assert (self->priv->registered); protocol = tp_base_connection_manager_get_protocol (self, proto, &error); if (protocol == NULL) { dbus_g_method_return_error (context, error); g_error_free (error); return; } parameters = tp_base_protocol_get_parameters (protocol); g_assert (parameters != NULL); ret = g_ptr_array_new (); for (i = 0; parameters[i].name != NULL; i++) { g_ptr_array_add (ret, _tp_cm_param_spec_to_dbus (parameters + i)); } tp_svc_connection_manager_return_from_get_parameters (context, ret); for (i = 0; i < ret->len; i++) { tp_value_array_free (g_ptr_array_index (ret, i)); } g_ptr_array_unref (ret); } /* * tp_base_connection_manager_list_protocols: * * Implements D-Bus method ListProtocols * on interface org.freedesktop.Telepathy.ConnectionManager */ static void tp_base_connection_manager_list_protocols (TpSvcConnectionManager *iface, DBusGMethodInvocation *context) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (iface); GPtrArray *protocols; GHashTableIter iter; gpointer name; /* a D-Bus method shouldn't be happening til we're on D-Bus */ g_assert (self->priv->registered); protocols = g_ptr_array_sized_new ( g_hash_table_size (self->priv->protocols) + 1); g_hash_table_iter_init (&iter, self->priv->protocols); while (g_hash_table_iter_next (&iter, &name, NULL)) { g_ptr_array_add (protocols, name); } g_ptr_array_add (protocols, NULL); tp_svc_connection_manager_return_from_list_protocols ( context, (const gchar **) protocols->pdata); g_ptr_array_unref (protocols); } /* * tp_base_connection_manager_request_connection: * * Implements D-Bus method RequestConnection * on interface org.freedesktop.Telepathy.ConnectionManager * * @error: Used to return a pointer to a GError detailing any error * that occurred, D-Bus will throw the error only if this * function returns FALSE. * * Returns: TRUE if successful, FALSE if an error was thrown. */ static void tp_base_connection_manager_request_connection (TpSvcConnectionManager *iface, const gchar *proto, GHashTable *parameters, DBusGMethodInvocation *context) { TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (iface); TpBaseConnectionManagerClass *cls = TP_BASE_CONNECTION_MANAGER_GET_CLASS (self); TpBaseConnectionManagerPrivate *priv = self->priv; TpBaseConnection *conn; gchar *bus_name; gchar *object_path; GError *error = NULL; TpBaseProtocol *protocol; g_assert (TP_IS_BASE_CONNECTION_MANAGER (iface)); /* a D-Bus method shouldn't be happening til we're on D-Bus */ g_assert (self->priv->registered); if (!tp_connection_manager_check_valid_protocol_name (proto, &error)) goto ERROR; protocol = tp_base_connection_manager_get_protocol (self, proto, &error); if (protocol == NULL) goto ERROR; conn = tp_base_protocol_new_connection (protocol, parameters, &error); if (conn == NULL) goto ERROR; /* register on bus and save bus name and object path */ if (!tp_base_connection_register (conn, cls->cm_dbus_name, &bus_name, &object_path, &error)) { DEBUG ("failed: %s", error->message); g_object_unref (G_OBJECT (conn)); goto ERROR; } /* bind to status change signals from the connection object */ g_signal_connect_data (conn, "shutdown-finished", G_CALLBACK (connection_shutdown_finished_cb), g_object_ref (self), (GClosureNotify) g_object_unref, 0); /* store the connection, using a hash table as a set */ g_hash_table_insert (priv->connections, conn, GINT_TO_POINTER(TRUE)); /* emit the new connection signal */ tp_svc_connection_manager_emit_new_connection ( self, bus_name, object_path, proto); tp_svc_connection_manager_return_from_request_connection ( context, bus_name, object_path); g_free (bus_name); g_free (object_path); return; ERROR: dbus_g_method_return_error (context, error); g_error_free (error); } /** * tp_base_connection_manager_register: * @self: The connection manager implementation * * Register the connection manager with an appropriate object path as * determined from its @cm_dbus_name, and register the appropriate well-known * bus name. * * Returns: %TRUE on success, %FALSE (having emitted a warning to stderr) * on failure */ gboolean tp_base_connection_manager_register (TpBaseConnectionManager *self) { GError *error = NULL; TpBaseConnectionManagerClass *cls; GString *string = NULL; guint i; GHashTableIter iter; gpointer name, protocol; g_assert (TP_IS_BASE_CONNECTION_MANAGER (self)); cls = TP_BASE_CONNECTION_MANAGER_GET_CLASS (self); if (!tp_base_connection_manager_ensure_dbus (self, &error)) goto except; if (cls->protocol_params != NULL) { for (i = 0; cls->protocol_params[i].name != NULL; i++) { TpBaseProtocol *p = _tp_legacy_protocol_new (self, cls->protocol_params + i); tp_base_connection_manager_add_protocol (self, p); g_object_unref (p); } } g_assert (self->priv->dbus_daemon != NULL); string = g_string_new (TP_CM_BUS_NAME_BASE); g_string_append (string, cls->cm_dbus_name); if (!tp_dbus_daemon_request_name (self->priv->dbus_daemon, string->str, TRUE, &error)) goto except; g_string_assign (string, TP_CM_OBJECT_PATH_BASE); g_string_append (string, cls->cm_dbus_name); tp_dbus_daemon_register_object (self->priv->dbus_daemon, string->str, self); g_hash_table_iter_init (&iter, self->priv->protocols); while (g_hash_table_iter_next (&iter, &name, &protocol)) { TpBaseProtocolClass *protocol_class = TP_BASE_PROTOCOL_GET_CLASS (protocol); if (!tp_connection_manager_check_valid_protocol_name (name, &error)) { g_critical ("%s", error->message); goto except; } /* don't export uninformative "stub" protocol objects on D-Bus */ if (protocol_class->is_stub) continue; g_string_assign (string, TP_CM_OBJECT_PATH_BASE); g_string_append (string, cls->cm_dbus_name); g_string_append_c (string, '/'); g_string_append (string, name); g_strdelimit (string->str, "-", '_'); tp_dbus_daemon_register_object (self->priv->dbus_daemon, string->str, protocol); } g_string_free (string, TRUE); self->priv->registered = TRUE; return TRUE; except: WARNING ("Couldn't claim bus name. If you are trying to debug this " "connection manager, disable all accounts and kill any running " "copies of this CM, then try again. %s", error->message); g_error_free (error); if (string != NULL) g_string_free (string, TRUE); return FALSE; } static void service_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcConnectionManagerClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_connection_manager_implement_##x (klass, \ tp_base_connection_manager_##x) IMPLEMENT(get_parameters); IMPLEMENT(list_protocols); IMPLEMENT(request_connection); #undef IMPLEMENT } /** * tp_base_connection_manager_get_dbus_daemon: * @self: the connection manager * * * * Returns: (transfer none): the value of the * #TpBaseConnectionManager:dbus-daemon property. The caller must reference * the returned object with g_object_ref() if it will be kept. * * Since: 0.11.3 */ TpDBusDaemon * tp_base_connection_manager_get_dbus_daemon (TpBaseConnectionManager *self) { g_return_val_if_fail (TP_IS_BASE_CONNECTION_MANAGER (self), NULL); return self->priv->dbus_daemon; } /** * tp_base_connection_manager_add_protocol: * @self: a connection manager object which has not yet registered on D-Bus * (i.e. tp_base_connection_manager_register() must not have been called) * @protocol: a protocol object, which must not have the same protocol name as * any that has already been added * * Add a protocol object to the set of supported protocols. */ void tp_base_connection_manager_add_protocol (TpBaseConnectionManager *self, TpBaseProtocol *protocol) { g_return_if_fail (TP_IS_BASE_CONNECTION_MANAGER (self)); g_return_if_fail (!self->priv->registered); g_return_if_fail (TP_IS_BASE_PROTOCOL (protocol)); g_hash_table_insert (self->priv->protocols, g_strdup (tp_base_protocol_get_name (protocol)), g_object_ref (protocol)); } telepathy-glib-0.24.2/telepathy-glib/base-connection-manager.h0000644000175000017500000001046012652510705021200 00000000000000/* * base-connection-manager.h - Header for TpBaseConnectionManager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CONNECTION_MANAGER_H__ #define __TP_BASE_CONNECTION_MANAGER_H__ #include #include #include #include #include #include #include G_BEGIN_DECLS void tp_cm_param_setter_offset (const TpCMParamSpec *paramspec, const GValue *value, gpointer params); typedef struct { const gchar *name; const TpCMParamSpec *parameters; gpointer (*params_new) (void); void (*params_free) (gpointer); TpCMParamSetter set_param; /**/ gpointer _future1; gpointer _future2; gpointer _future3; } TpCMProtocolSpec; typedef struct _TpBaseConnectionManager TpBaseConnectionManager; typedef struct _TpBaseConnectionManagerPrivate TpBaseConnectionManagerPrivate; typedef struct _TpBaseConnectionManagerClass TpBaseConnectionManagerClass; typedef struct _TpBaseConnectionManagerClassPrivate TpBaseConnectionManagerClassPrivate; typedef TpBaseConnection *(*TpBaseConnectionManagerNewConnFunc)( TpBaseConnectionManager *self, const gchar *proto, TpIntset *params_present, void *parsed_params, GError **error); typedef GPtrArray * (*TpBaseConnectionManagerGetInterfacesFunc) ( TpBaseConnectionManager *self); struct _TpBaseConnectionManagerClass { GObjectClass parent_class; const char *cm_dbus_name; /**/ const TpCMProtocolSpec *_TP_SEAL (protocol_params); TpBaseConnectionManagerNewConnFunc _TP_SEAL (new_connection); /*< public >*/ /**/ const gchar * const *_TP_SEAL (interfaces); /**/ TpBaseConnectionManagerGetInterfacesFunc get_interfaces; /**/ gpointer _future3; gpointer _future4; TpBaseConnectionManagerClassPrivate *priv; }; struct _TpBaseConnectionManager { /**/ GObject parent; TpBaseConnectionManagerPrivate *priv; }; GType tp_base_connection_manager_get_type (void); gboolean tp_base_connection_manager_register (TpBaseConnectionManager *self); TpDBusDaemon *tp_base_connection_manager_get_dbus_daemon ( TpBaseConnectionManager *self); void tp_base_connection_manager_add_protocol (TpBaseConnectionManager *self, TpBaseProtocol *protocol); /* TYPE MACROS */ #define TP_TYPE_BASE_CONNECTION_MANAGER \ (tp_base_connection_manager_get_type ()) #define TP_BASE_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_BASE_CONNECTION_MANAGER, \ TpBaseConnectionManager)) #define TP_BASE_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_BASE_CONNECTION_MANAGER, \ TpBaseConnectionManagerClass)) #define TP_IS_BASE_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_CONNECTION_MANAGER)) #define TP_IS_BASE_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_CONNECTION_MANAGER)) #define TP_BASE_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONNECTION_MANAGER, \ TpBaseConnectionManagerClass)) G_END_DECLS #endif /* #ifndef __TP_BASE_CONNECTION_MANAGER_H__*/ telepathy-glib-0.24.2/telepathy-glib/base-contact-list.c0000644000175000017500000062743012652510705020043 00000000000000/* ContactList channel manager * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include #include #include #include #include #include #include #include #include #include /** * SECTION:base-contact-list * @title: TpBaseContactList * @short_description: channel manager for ContactList channels * * This class represents a connection's contact list (roster, buddy list etc.) * inside a connection manager. It can be used to implement the ContactList * D-Bus interface on the Connection. * * Connections that use #TpBaseContactList must also have the #TpContactsMixin. * * Connection managers should subclass #TpBaseContactList, implementing the * virtual methods for core functionality in #TpBaseContactListClass. * Then, in the connection manager's #TpBaseConnection subclass: * * * * in #G_DEFINE_TYPE_WITH_CODE, implement * #TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST using * tp_base_contact_list_mixin_list_iface_init(): * |[ * G_DEFINE_TYPE_WITH_CODE (MyConnection, my_connection, * TP_TYPE_BASE_CONNECTION, * // ... * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST, * tp_base_contact_list_mixin_list_iface_init); * // ... * ) * ]| * * * in the class_init method, call * tp_base_contact_list_mixin_class_init() after * tp_contacts_mixin_class_init(): * |[ * // ... * tp_contacts_mixin_class_init (object_class, * G_STRUCT_OFFSET (MyConnectionClass, contacts_mixin)); * tp_base_contact_list_mixin_class_init (base_connection_class); * // ... * ]| * and include %TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST in * the output of * #TpBaseConnectionClass.get_interfaces_always_present; * * * in the #TpBaseConnectionClass.create_channel_managers * implementation, create an instance of the #TpBaseContactList * subclass, and include it in the returned #GPtrArray; * * * in the constructed method, call * tp_base_contact_list_mixin_register_with_contacts_mixin() on the * connection. * * * * To support user-defined contact groups too, additionally implement * %TP_TYPE_CONTACT_GROUP_LIST in the #TpBaseContactList subclass, add the * %TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS interface to the output of * #TpBaseConnectionClass.get interfaces_always_present, and implement the * %TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS in the #TpBaseConnection * subclass using tp_base_contact_list_mixin_groups_iface_init(). * * Optionally, one or more of the #TP_TYPE_MUTABLE_CONTACT_LIST, * #TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, and #TP_TYPE_BLOCKABLE_CONTACT_LIST * GObject interfaces may also be implemented, as appropriate to the protocol. * * In versions of the Telepathy D-Bus Interface Specification prior to * 0.21.0, this functionality was provided as a collection of * individual ContactList channels. As a result, this object also implements * the #TpChannelManager interface, so that it can provide those channels. * The channel objects are internal to this object, and not considered to be * part of the API. * * Since: 0.13.0 */ /** * TpBaseContactList: * * A connection's contact list (roster, buddy list) inside a connection * manager. Each #TpBaseConnection may have at most one #TpBaseContactList. * * This abstract base class provides the Telepathy "view" of the contact list: * subclasses must provide access to the "model" by implementing its virtual * methods in terms of the protocol's real contact list (e.g. the XMPP roster * object in Wocky). * * The implementation must call tp_base_contact_list_set_list_received() * exactly once, when the initial set of contacts has been received (or * immediately, if that condition is not meaningful for the protocol). * * Since: 0.13.0 */ /** * TpBaseContactListClass: * @parent_class: the parent class * @dup_contacts: the implementation of tp_base_contact_list_dup_contacts(); * every subclass must implement this itself * @dup_states: the implementation of * tp_base_contact_list_dup_states(); every subclass must implement * this itself * @get_contact_list_persists: the implementation of * tp_base_contact_list_get_contact_list_persists(); if a subclass does not * implement this itself, the default implementation always returns %TRUE, * which is correct for most protocols * @download_async: the implementation of * tp_base_contact_list_download_async(); if a subclass does not implement * this itself, the default implementation will raise * TP_ERROR_NOT_IMPLEMENTED asynchronously. Since: 0.18.0 * @download_finish: the implementation of * tp_base_contact_list_download_finish(). Since: 0.18.0 * * The class of a #TpBaseContactList. * * Additional functionality can be added by implementing #GInterfaces. * Most subclasses should implement %TP_TYPE_MUTABLE_CONTACT_LIST, which allows * the contact list to be altered. * * Subclasses may implement %TP_TYPE_BLOCKABLE_CONTACT_LIST if contacts can * be blocked from communicating with the user. * * Since: 0.13.0 */ /** * TpBaseContactListDupContactsFunc: * @self: the contact list manager * * Signature of a virtual method to list contacts with a particular state; * the required state is defined by the particular virtual method being * implemented. * * The implementation is expected to have a cache of contacts on the contact * list, which is updated based on protocol events. * * Returns: (transfer full): a set of contacts with the desired state * * Since: 0.13.0 */ /** * TpBaseContactListDupStatesFunc: * @self: the contact list manager * @contact: the contact * @subscribe: (out) (allow-none): used to return the state of the user's * subscription to @contact's presence * @publish: (out) (allow-none): used to return the state of @contact's * subscription to the user's presence * @publish_request: (out) (allow-none) (transfer full): if @publish will be * set to %TP_SUBSCRIPTION_STATE_ASK, used to return the message that * @contact sent when they requested permission to see the user's presence; * otherwise, used to return an empty string * * Signature of a virtual method to get contacts' presences. It should return * @subscribe = %TP_SUBSCRIPTION_STATE_NO, @publish = %TP_SUBSCRIPTION_STATE_NO * and @publish_request = "", without error, for any contact not on the * contact list. * * Since: 0.13.0 */ /** * TpBaseContactListAsyncFunc: * @self: the contact list manager * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a virtual method that needs no additional information. * * Since: 0.18.0 */ /** * TpBaseContactListActOnContactsFunc: * @self: the contact list manager * @contacts: the contacts on which to act * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a virtual method that acts on a set of contacts and needs no * additional information, such as removing contacts, approving or cancelling * presence publication, cancelling presence subscription, or removing * contacts. * * The virtual method should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before returning. * * Since: 0.13.0 */ /** * TpBaseContactListRequestSubscriptionFunc: * @self: the contact list manager * @contacts: the contacts whose subscription is to be requested * @message: an optional human-readable message from the user * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a virtual method to request permission to see some contacts' * presence. * * The virtual method should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before it calls @callback. * * Since: 0.13.0 */ /** * TpBaseContactListAsyncFinishFunc: * @self: the contact list manager * @result: the result of the asynchronous operation * @error: used to raise an error if %FALSE is returned * * Signature of a virtual method to finish an async operation. * * Returns: %TRUE on success, or %FALSE if @error is set * * Since: 0.13.0 */ #include "config.h" #include #include #define DEBUG_FLAG TP_DEBUG_CONTACT_LISTS #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" struct _TpBaseContactListPrivate { TpBaseConnection *conn; TpHandleRepoIface *contact_repo; TpContactListState state; /* NULL unless state = FAILURE */ GError *failure /* initially NULL */; /* values referenced; 0'th remains NULL */ TpBaseContactListChannel *lists[TP_NUM_LIST_HANDLES]; TpHandleRepoIface *group_repo; /* handle borrowed from channel => referenced TpContactGroupChannel */ GHashTable *groups; /* borrowed TpExportableChannel => GSList of gpointer (request tokens) that * will be satisfied by that channel when the contact list has been * downloaded. The requests are in reverse chronological order; the list * can also contain NULL. * * If a channel appears in the keys of this map, that means it hasn't been * announced via NewChannels yet. */ GHashTable *channel_requests; /* DBusGMethodInvocation *s for calls to RequestBlockedContacts which are * waiting for the contact list to (fail to) be downloaded. */ GQueue blocked_contact_requests; gulong status_changed_id; /* TRUE if @conn implements TpSvcConnectionInterface$FOO - used to * decide whether to emit signals on these new interfaces. Initialized in * the constructor and cleared when we lose @conn. */ gboolean svc_contact_list; gboolean svc_contact_groups; gboolean svc_contact_blocking; /* TRUE if the contact list must be downloaded at connection. Default is * TRUE. */ gboolean download_at_connection; }; struct _TpBaseContactListClassPrivate { char dummy; }; static void channel_manager_iface_init (TpChannelManagerIface *iface); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseContactList, tp_base_contact_list, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init); g_type_add_class_private (g_define_type_id, sizeof ( TpBaseContactListClassPrivate))) /** * TP_TYPE_MUTABLE_CONTACT_LIST: * * Interface representing a #TpBaseContactList on which the contact list can * potentially be changed. * * Since: 0.13.0 */ /** * TpMutableContactListInterface: * @parent: the parent interface * @request_subscription_async: the implementation of * tp_base_contact_list_request_subscription_async(); must always be provided * @request_subscription_finish: the implementation of * tp_base_contact_list_request_subscription_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @authorize_publication_async: the implementation of * tp_base_contact_list_authorize_publication_async(); must always be provided * @authorize_publication_finish: the implementation of * tp_base_contact_list_authorize_publication_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_contacts_async: the implementation of * tp_base_contact_list_remove_contacts_async(); must always be provided * @remove_contacts_finish: the implementation of * tp_base_contact_list_remove_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unsubscribe_async: the implementation of * tp_base_contact_list_unsubscribe_async(); must always be provided * @unsubscribe_finish: the implementation of * tp_base_contact_list_unsubscribe_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unpublish_async: the implementation of * tp_base_contact_list_unpublish_async(); must always be provided * @unpublish_finish: the implementation of * tp_base_contact_list_unpublish_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @store_contacts_async: the implementation of * tp_base_contact_list_store_contacts_async(); if not reimplemented, * the default implementation is %NULL, which is interpreted as "do nothing" * @store_contacts_finish: the implementation of * tp_base_contact_list_store_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @can_change_contact_list: the implementation of * tp_base_contact_list_can_change_contact_list(); if not reimplemented, * the default implementation always returns %TRUE * @get_request_uses_message: the implementation of * tp_base_contact_list_get_request_uses_message(); if not reimplemented, * the default implementation always returns %TRUE * * The interface vtable for a %TP_TYPE_MUTABLE_CONTACT_LIST. * * Since: 0.13.0 */ G_DEFINE_INTERFACE (TpMutableContactList, tp_mutable_contact_list, TP_TYPE_BASE_CONTACT_LIST) /** * TP_TYPE_BLOCKABLE_CONTACT_LIST: * * Interface representing a #TpBaseContactList on which contacts can * be blocked from communicating with the user. * * Since: 0.13.0 */ /** * TpBlockableContactListInterface: * @parent: the parent interface * @dup_blocked_contacts: the implementation of * tp_base_contact_list_dup_blocked_contacts(); must always be provided * @block_contacts_async: the implementation of * tp_base_contact_list_block_contacts_async(); either this or * @block_contacts_with_abuse_async must always be provided * @block_contacts_finish: the implementation of * tp_base_contact_list_block_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @unblock_contacts_async: the implementation of * tp_base_contact_list_unblock_contacts_async(); must always be provided * @unblock_contacts_finish: the implementation of * tp_base_contact_list_unblock_contacts_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @can_block: the implementation of * tp_base_contact_list_can_block(); if not reimplemented, * the default implementation always returns %TRUE * @block_contacts_with_abuse_async: the implementation of * tp_base_contact_list_block_contacts_async(); either this or * @block_contacts_async must always be provided. If the underlying protocol * does not support reporting contacts as abusive, implement * @block_contacts_async instead. Since: 0.15.1 * * The interface vtable for a %TP_TYPE_BLOCKABLE_CONTACT_LIST. * * Since: 0.13.0 */ G_DEFINE_INTERFACE (TpBlockableContactList, tp_blockable_contact_list, TP_TYPE_BASE_CONTACT_LIST) /** * TP_TYPE_CONTACT_GROUP_LIST: * * Interface representing a #TpBaseContactList on which contacts can * be in user-defined groups, which cannot necessarily be edited * (%TP_TYPE_MUTABLE_CONTACT_GROUP_LIST represents a list where these * groups exist and can also be edited). * * Since: 0.13.0 */ /** * TpContactGroupListInterface: * @parent: the parent interface * @dup_groups: the implementation of * tp_base_contact_list_dup_groups(); must always be implemented * @dup_group_members: the implementation of * tp_base_contact_list_dup_group_members(); must always be implemented * @dup_contact_groups: the implementation of * tp_base_contact_list_dup_contact_groups(); must always be implemented * @has_disjoint_groups: the implementation of * tp_base_contact_list_has_disjoint_groups(); if not reimplemented, * the default implementation always returns %FALSE * @normalize_group: the implementation of * tp_base_contact_list_normalize_group(); if not reimplemented, * the default implementation is %NULL, which allows any UTF-8 string * as a group name (including the empty string) and assumes that any distinct * group names can coexist * * The interface vtable for a %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ G_DEFINE_INTERFACE (TpContactGroupList, tp_contact_group_list, TP_TYPE_BASE_CONTACT_LIST) /** * TP_TYPE_MUTABLE_CONTACT_GROUP_LIST: * * Interface representing a #TpBaseContactList on which user-defined contact * groups can potentially be changed. %TP_TYPE_CONTACT_GROUP_LIST is a * prerequisite for this interface. * * Since: 0.13.0 */ /** * TpMutableContactGroupListInterface: * @parent: the parent interface * @get_group_storage: the implementation of * tp_base_contact_list_get_group_storage(); the default implementation is * %NULL, which results in %TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE being * advertised * @set_contact_groups_async: the implementation of * tp_base_contact_list_set_contact_groups_async(); must always be implemented * @set_contact_groups_finish: the implementation of * tp_base_contact_list_set_contact_groups_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @set_group_members_async: the implementation of * tp_base_contact_list_set_group_members_async(); must always be implemented * @set_group_members_finish: the implementation of * tp_base_contact_list_set_group_members_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @add_to_group_async: the implementation of * tp_base_contact_list_add_to_group_async(); must always be implemented * @add_to_group_finish: the implementation of * tp_base_contact_list_add_to_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_from_group_async: the implementation of * tp_base_contact_list_remove_from_group_async(); must always be implemented * @remove_from_group_finish: the implementation of * tp_base_contact_list_remove_from_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @remove_group_async: the implementation of * tp_base_contact_list_remove_group_async(); must always be implemented * @remove_group_finish: the implementation of * tp_base_contact_list_remove_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * @rename_group_async: the implementation of * tp_base_contact_list_rename_group_async(); the default implementation * results in group renaming being emulated via a call to * @add_to_group_async and a call to @remove_group_async * @rename_group_finish: the implementation of * tp_base_contact_list_rename_group_finish(); the default * implementation may be used if @result is a #GSimpleAsyncResult * * The interface vtable for a %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ G_DEFINE_INTERFACE (TpMutableContactGroupList, tp_mutable_contact_group_list, TP_TYPE_CONTACT_GROUP_LIST) enum { PROP_CONNECTION = 1, PROP_DOWNLOAD_AT_CONNECTION, N_PROPS }; static void tp_base_contact_list_contacts_changed_internal (TpBaseContactList *self, TpHandleSet *changed, TpHandleSet *removed, gboolean is_initial_roster); static void tp_base_contact_list_init (TpBaseContactList *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_CONTACT_LIST, TpBaseContactListPrivate); self->priv->groups = g_hash_table_new_full (NULL, NULL, NULL, g_object_unref); self->priv->channel_requests = g_hash_table_new (NULL, NULL); g_queue_init (&self->priv->blocked_contact_requests); } static void tp_base_contact_list_fail_channel_requests (TpBaseContactList *self, GQuark domain, gint code, const gchar *message) { if (self->priv->channel_requests != NULL) { GHashTable *tmp = self->priv->channel_requests; GHashTableIter iter; gpointer value; self->priv->channel_requests = NULL; g_hash_table_iter_init (&iter, tmp); while (g_hash_table_iter_next (&iter, NULL, &value)) { GSList *requests = value; GSList *slist; requests = g_slist_reverse (requests); for (slist = requests; slist != NULL; slist = slist->next) { tp_channel_manager_emit_request_failed (self, slist->data, domain, code, message); } g_slist_free (requests); g_hash_table_iter_steal (&iter); } g_hash_table_unref (tmp); } } static void tp_base_contact_list_fail_blocked_contact_requests ( TpBaseContactList *self, const GError *error) { DBusGMethodInvocation *context; while ((context = g_queue_pop_head (&self->priv->blocked_contact_requests)) != NULL) dbus_g_method_return_error (context, error); } static void tp_base_contact_list_free_contents (TpBaseContactList *self) { GError error = { TP_ERROR, TP_ERROR_DISCONNECTED, "Disconnected before blocked contacts were retrieved" }; guint i; tp_base_contact_list_fail_channel_requests (self, TP_ERROR, TP_ERROR_DISCONNECTED, "Unable to complete channel request due to disconnection"); tp_base_contact_list_fail_blocked_contact_requests (self, &error); for (i = 0; i < TP_NUM_LIST_HANDLES; i++) tp_clear_object (self->priv->lists + i); tp_clear_pointer (&self->priv->groups, g_hash_table_unref); tp_clear_object (&self->priv->contact_repo); if (self->priv->group_repo != NULL) { /* the normalization data is a borrowed reference to @self, which must * be released when @self is no longer usable */ _tp_dynamic_handle_repo_set_normalization_data (self->priv->group_repo, NULL, NULL); tp_clear_object (&self->priv->group_repo); } if (self->priv->conn != NULL) { if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } tp_clear_object (&self->priv->conn); self->priv->svc_contact_list = FALSE; self->priv->svc_contact_groups = FALSE; self->priv->svc_contact_blocking = FALSE; } } static void tp_base_contact_list_dispose (GObject *object) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_base_contact_list_parent_class)->dispose; tp_base_contact_list_free_contents (self); g_assert (self->priv->groups == NULL); g_assert (self->priv->contact_repo == NULL); g_assert (self->priv->group_repo == NULL); g_assert (self->priv->lists[TP_LIST_HANDLE_SUBSCRIBE] == NULL); g_assert (self->priv->channel_requests == NULL); if (dispose != NULL) dispose (object); } static void tp_base_contact_list_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_DOWNLOAD_AT_CONNECTION: g_value_set_boolean (value, self->priv->download_at_connection); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_contact_list_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (object); switch (property_id) { case PROP_CONNECTION: g_assert (self->priv->conn == NULL); /* construct-only */ self->priv->conn = g_value_dup_object (value); break; case PROP_DOWNLOAD_AT_CONNECTION: self->priv->download_at_connection = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gchar * tp_base_contact_list_repo_normalize_group (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { TpBaseContactList *self = _tp_dynamic_handle_repo_get_normalization_data (repo); gchar *ret; if (id == NULL) id = ""; if (self == NULL) { /* already disconnected or something */ return g_strdup (id); } ret = tp_base_contact_list_normalize_group (self, id); if (ret == NULL) g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "Invalid group name '%s'", id); return ret; } /* elements 0, 1... of this enum must be kept in sync with elements 1, 2... * of the enum in the -internal header */ static const gchar * const tp_base_contact_list_contact_lists [TP_NUM_LIST_HANDLES + 1] = { "subscribe", "publish", "stored", "deny", NULL }; static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, TpBaseContactList *self) { if (status == TP_CONNECTION_STATUS_DISCONNECTED) tp_base_contact_list_free_contents (self); } static void tp_base_contact_list_constructed (GObject *object) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (object); TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); void (*chain_up) (GObject *) = G_OBJECT_CLASS (tp_base_contact_list_parent_class)->constructed; TpHandleRepoIface *list_repo; if (chain_up != NULL) chain_up (object); g_assert (self->priv->conn != NULL); g_return_if_fail (cls->dup_contacts != NULL); g_return_if_fail (cls->dup_states != NULL); g_return_if_fail (cls->get_contact_list_persists != NULL); g_return_if_fail (cls->download_async != NULL); self->priv->svc_contact_list = TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_LIST (self->priv->conn); self->priv->svc_contact_groups = TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS (self->priv->conn); self->priv->svc_contact_blocking = TP_IS_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING (self->priv->conn); if (TP_IS_MUTABLE_CONTACT_LIST (self)) { TpMutableContactListInterface *iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (iface->can_change_contact_list != NULL); g_return_if_fail (iface->get_request_uses_message != NULL); g_return_if_fail (iface->request_subscription_async != NULL); g_return_if_fail (iface->request_subscription_finish != NULL); g_return_if_fail (iface->authorize_publication_async != NULL); g_return_if_fail (iface->authorize_publication_finish != NULL); /* iface->store_contacts_async == NULL is OK */ g_return_if_fail (iface->store_contacts_finish != NULL); g_return_if_fail (iface->remove_contacts_async != NULL); g_return_if_fail (iface->remove_contacts_finish != NULL); g_return_if_fail (iface->unsubscribe_async != NULL); g_return_if_fail (iface->unsubscribe_finish != NULL); g_return_if_fail (iface->unpublish_async != NULL); g_return_if_fail (iface->unpublish_finish != NULL); } if (TP_IS_BLOCKABLE_CONTACT_LIST (self)) { TpBlockableContactListInterface *iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (iface->can_block != NULL); g_return_if_fail (iface->dup_blocked_contacts != NULL); g_return_if_fail ((iface->block_contacts_async != NULL) ^ (iface->block_contacts_with_abuse_async != NULL)); g_return_if_fail (iface->block_contacts_finish != NULL); g_return_if_fail (iface->unblock_contacts_async != NULL); g_return_if_fail (iface->unblock_contacts_finish != NULL); } self->priv->contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); g_object_ref (self->priv->contact_repo); list_repo = tp_static_handle_repo_new (TP_HANDLE_TYPE_LIST, (const gchar **) tp_base_contact_list_contact_lists); if (TP_IS_CONTACT_GROUP_LIST (self)) { TpContactGroupListInterface *iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (iface->has_disjoint_groups != NULL); g_return_if_fail (iface->dup_groups != NULL); g_return_if_fail (iface->dup_contact_groups != NULL); g_return_if_fail (iface->dup_group_members != NULL); self->priv->group_repo = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_GROUP, tp_base_contact_list_repo_normalize_group, NULL); /* borrowed ref so the handle repo can call our virtual method, released * in tp_base_contact_list_free_contents */ _tp_dynamic_handle_repo_set_normalization_data (self->priv->group_repo, self, NULL); _tp_base_connection_set_handle_repo (self->priv->conn, TP_HANDLE_TYPE_GROUP, self->priv->group_repo); } if (TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) { TpMutableContactGroupListInterface *iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (iface->set_contact_groups_async != NULL); g_return_if_fail (iface->set_contact_groups_finish != NULL); g_return_if_fail (iface->set_group_members_async != NULL); g_return_if_fail (iface->set_group_members_finish != NULL); g_return_if_fail (iface->add_to_group_async != NULL); g_return_if_fail (iface->add_to_group_finish != NULL); g_return_if_fail (iface->remove_from_group_async != NULL); g_return_if_fail (iface->remove_from_group_finish != NULL); g_return_if_fail (iface->remove_group_async != NULL); g_return_if_fail (iface->remove_group_finish != NULL); } _tp_base_connection_set_handle_repo (self->priv->conn, TP_HANDLE_TYPE_LIST, list_repo); /* set_handle_repo doesn't steal a reference */ g_object_unref (list_repo); self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); } static gboolean tp_base_contact_list_simple_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { GSimpleAsyncResult *simple = (GSimpleAsyncResult *) result; g_return_val_if_fail (g_simple_async_result_is_valid ( result, G_OBJECT (self), NULL), FALSE); return !g_simple_async_result_propagate_error (simple, error); } static void tp_base_contact_list_download_async_default (TpBaseContactList *self, GAsyncReadyCallback callback, gpointer user_data) { g_simple_async_report_error_in_idle (G_OBJECT (self), callback, user_data, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This CM does not implement Download"); } static void tp_mutable_contact_list_default_init (TpMutableContactListInterface *iface) { iface->request_subscription_finish = tp_base_contact_list_simple_finish; iface->authorize_publication_finish = tp_base_contact_list_simple_finish; iface->unsubscribe_finish = tp_base_contact_list_simple_finish; iface->unpublish_finish = tp_base_contact_list_simple_finish; iface->store_contacts_finish = tp_base_contact_list_simple_finish; iface->remove_contacts_finish = tp_base_contact_list_simple_finish; iface->can_change_contact_list = tp_base_contact_list_true_func; iface->get_request_uses_message = tp_base_contact_list_true_func; /* there's no default for the other virtual methods */ } static void tp_blockable_contact_list_default_init (TpBlockableContactListInterface *iface) { iface->block_contacts_finish = tp_base_contact_list_simple_finish; iface->unblock_contacts_finish = tp_base_contact_list_simple_finish; iface->can_block = tp_base_contact_list_true_func; /* there's no default for the other virtual methods */ } static void tp_contact_group_list_default_init (TpContactGroupListInterface *iface) { iface->has_disjoint_groups = tp_base_contact_list_false_func; /* there's no default for the other virtual methods */ } static void tp_base_contact_list_emulate_rename_group (TpBaseContactList *, const gchar *, const gchar *, GAsyncReadyCallback, gpointer); static void tp_mutable_contact_group_list_default_init ( TpMutableContactGroupListInterface *iface) { iface->rename_group_async = tp_base_contact_list_emulate_rename_group; iface->add_to_group_finish = tp_base_contact_list_simple_finish; iface->remove_from_group_finish = tp_base_contact_list_simple_finish; iface->set_contact_groups_finish = tp_base_contact_list_simple_finish; iface->remove_group_finish = tp_base_contact_list_simple_finish; iface->rename_group_finish = tp_base_contact_list_simple_finish; iface->set_group_members_finish = tp_base_contact_list_simple_finish; } static void tp_base_contact_list_class_init (TpBaseContactListClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); g_type_class_add_private (cls, sizeof (TpBaseContactListPrivate)); cls->priv = G_TYPE_CLASS_GET_PRIVATE (cls, TP_TYPE_BASE_CONTACT_LIST, TpBaseContactListClassPrivate); /* defaults */ cls->get_contact_list_persists = tp_base_contact_list_true_func; cls->download_async = tp_base_contact_list_download_async_default; cls->download_finish = tp_base_contact_list_simple_finish; object_class->get_property = tp_base_contact_list_get_property; object_class->set_property = tp_base_contact_list_set_property; object_class->constructed = tp_base_contact_list_constructed; object_class->dispose = tp_base_contact_list_dispose; /** * TpBaseContactList:connection: * * The connection that owns this channel manager. * Read-only except during construction. * * Since: 0.13.0 */ g_object_class_install_property (object_class, PROP_CONNECTION, g_param_spec_object ("connection", "Connection", "The connection that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); /** * TpBaseContactList:download-at-connection: * * Whether the roster should be automatically downloaded at connection. * * This property doesn't change anything in TpBaseContactsList's behaviour. * Implementations should check this property when they become connected * and in their Download method, and behave accordingly. * * Since: 0.18.0 */ g_object_class_install_property (object_class, PROP_DOWNLOAD_AT_CONNECTION, g_param_spec_boolean ("download-at-connection", "Download at connection", "Whether the roster should be automatically downloaded at connection", TRUE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); } static void tp_base_contact_list_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc func, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (manager); GHashTableIter iter; gpointer handle, channel; guint i; /* in both cases, we look in channel_requests to avoid including channels * that don't officially exist yet */ for (i = 0; i < TP_NUM_LIST_HANDLES; i++) { if (self->priv->lists[i] != NULL && !g_hash_table_lookup_extended (self->priv->channel_requests, self->priv->lists[i], NULL, NULL)) func (TP_EXPORTABLE_CHANNEL (self->priv->lists[i]), user_data); } g_hash_table_iter_init (&iter, self->priv->groups); while (g_hash_table_iter_next (&iter, &handle, &channel)) { if (!g_hash_table_lookup_extended (self->priv->channel_requests, channel, NULL, NULL)) func (TP_EXPORTABLE_CHANNEL (channel), user_data); } } static const gchar * const fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL }; static const gchar * const allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, NULL }; static void tp_base_contact_list_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data) { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_LIST, NULL); func (type, table, allowed_properties, user_data); if (g_type_is_a (type, TP_TYPE_MUTABLE_CONTACT_GROUP_LIST)) { g_hash_table_insert (table, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, tp_g_value_slice_new_uint (TP_HANDLE_TYPE_GROUP)); func (type, table, allowed_properties, user_data); } g_hash_table_unref (table); } static void tp_base_contact_list_associate_request (TpBaseContactList *self, gpointer chan, gpointer request_token) { GSList *requests = NULL; /* remember that it hasn't been announced yet, by putting it in * channel_requests */ requests = g_hash_table_lookup (self->priv->channel_requests, chan); g_hash_table_steal (self->priv->channel_requests, chan); requests = g_slist_prepend (requests, request_token); g_hash_table_insert (self->priv->channel_requests, chan, requests); } static gpointer tp_base_contact_list_new_channel (TpBaseContactList *self, TpHandleType handle_type, TpHandle handle, gpointer request_token) { gpointer chan; gchar *object_path; GType type; if (handle_type == TP_HANDLE_TYPE_LIST) { object_path = g_strdup_printf ("%s/ContactList/%s", tp_base_connection_get_object_path (self->priv->conn), tp_base_contact_list_contact_lists[handle - 1]); type = TP_TYPE_CONTACT_LIST_CHANNEL; } else { g_assert (handle_type == TP_HANDLE_TYPE_GROUP); object_path = g_strdup_printf ("%s/Group/%u", tp_base_connection_get_object_path (self->priv->conn), handle); type = TP_TYPE_CONTACT_GROUP_CHANNEL; } chan = g_object_new (type, "connection", self->priv->conn, "manager", self, "object-path", object_path, "handle-type", handle_type, "handle", handle, NULL); g_free (object_path); if (handle_type == TP_HANDLE_TYPE_LIST) { g_assert (self->priv->lists[handle] == NULL); self->priv->lists[handle] = chan; } else { g_assert (g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)) == NULL); g_hash_table_insert (self->priv->groups, GUINT_TO_POINTER (handle), chan); } tp_base_contact_list_associate_request (self, chan, request_token); return chan; } static void tp_base_contact_list_announce_channel (TpBaseContactList *self, gpointer channel, const GError *error) { GSList *requests = g_hash_table_lookup (self->priv->channel_requests, channel); /* this is all fine even if requests is NULL */ g_hash_table_steal (self->priv->channel_requests, channel); /* get into chronological order */ requests = g_slist_reverse (requests); /* our list of requests can include NULL, which isn't a valid request * token; get rid of it/them */ requests = g_slist_remove_all (requests, NULL); if (error == NULL) { tp_channel_manager_emit_new_channel (self, channel, requests); } else { GSList *iter; for (iter = requests; iter != NULL; iter = iter->next) tp_channel_manager_emit_request_failed (self, iter->data, error->domain, error->code, error->message); } g_slist_free (requests); } static void tp_base_contact_list_create_group_cb (GObject *source, GAsyncResult *result, gpointer channel) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; if (tp_base_contact_list_add_to_group_finish (self, result, &error)) { /* If all goes well, the channel should have been announced. */ GSList *tokens = g_hash_table_lookup (self->priv->channel_requests, channel); if (tokens == NULL) return; g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "%s did not create a group even though it claims to have done so", G_OBJECT_TYPE_NAME (self)); } /**/ g_clear_error (&error); } static gboolean tp_base_contact_list_request_helper (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties, gboolean is_create) { TpBaseContactList *self = (TpBaseContactList *) manager; TpHandleType handle_type; TpHandle handle; TpBaseContactListChannel *chan; GError *error = NULL; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_CONTACT_LIST)) { return FALSE; } handle_type = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL); if (handle_type != TP_HANDLE_TYPE_LIST && (handle_type != TP_HANDLE_TYPE_GROUP || !TP_IS_CONTACT_GROUP_LIST (self))) { return FALSE; } handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); g_assert (handle != 0); if (tp_channel_manager_asv_has_unknown_properties (request_properties, fixed_properties, allowed_properties, &error) || tp_base_contact_list_get_connection (self, &error) == NULL) { goto error; } if (handle_type == TP_HANDLE_TYPE_LIST) { /* TpBaseConnection already checked the handle for validity */ g_assert (handle > 0); g_assert (handle < TP_NUM_LIST_HANDLES); if (handle == TP_LIST_HANDLE_STORED && !tp_base_contact_list_get_contact_list_persists (self)) { g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Subscriptions do not persist, so this connection lacks the " "'stored' channel"); goto error; } if (handle == TP_LIST_HANDLE_DENY && !tp_base_contact_list_can_block (self)) { g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This connection cannot put people on the 'deny' list"); goto error; } chan = self->priv->lists[handle]; } else { chan = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)); } if (chan == NULL) { if (handle_type == TP_HANDLE_TYPE_LIST) { /* make an object, don't announce it yet, and remember the * request token for when it's announced in set_list_received */ tp_base_contact_list_new_channel (self, handle_type, handle, request_token); } else { if (TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) { const gchar *name = tp_handle_inspect (self->priv->group_repo, handle); gpointer channel; TpHandleSet *set = tp_handle_set_new (self->priv->contact_repo); /* make an object, don't announce it yet, and remember the * request token for when it's announced, if it's actually * created */ channel = tp_base_contact_list_new_channel (self, handle_type, handle, request_token); /* this will create the empty group, and announce the channel(s) * later if appropriate */ tp_base_contact_list_add_to_group_async (self, name, set, tp_base_contact_list_create_group_cb, channel); tp_handle_set_destroy (set); } else { g_set_error_literal (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "This connection cannot create new groups"); goto error; } } } else if (is_create) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "A ContactList channel for type #%u, handle #%u already exists", handle_type, handle); goto error; } else if (g_hash_table_lookup_extended (self->priv->channel_requests, chan, NULL, NULL)) { /* there are outstanding requests for the channel, and there's an object * to represent it, but it hasn't been announced; just append our * request */ tp_base_contact_list_associate_request (self, chan, request_token); } else { tp_channel_manager_emit_request_already_satisfied (self, request_token, TP_EXPORTABLE_CHANNEL (chan)); } return TRUE; error: tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); g_error_free (error); return TRUE; } static gboolean tp_base_contact_list_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return tp_base_contact_list_request_helper (manager, request_token, request_properties, TRUE); } static gboolean tp_base_contact_list_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return tp_base_contact_list_request_helper (manager, request_token, request_properties, FALSE); } static void channel_manager_iface_init (TpChannelManagerIface *iface) { iface->foreach_channel = tp_base_contact_list_foreach_channel; iface->type_foreach_channel_class = tp_base_contact_list_type_foreach_channel_class; iface->create_channel = tp_base_contact_list_create_channel; iface->ensure_channel = tp_base_contact_list_ensure_channel; /* In this channel manager, Request has the same semantics as Ensure */ iface->request_channel = tp_base_contact_list_ensure_channel; } TpChannelGroupFlags _tp_base_contact_list_get_group_flags (TpBaseContactList *self) { if (TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) return TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_CAN_REMOVE; return 0; } TpChannelGroupFlags _tp_base_contact_list_get_list_flags (TpBaseContactList *self, TpHandle list) { if (!tp_base_contact_list_can_change_contact_list (self)) return 0; switch (list) { case TP_LIST_HANDLE_PUBLISH: /* We always allow an attempt to stop publishing presence to people, * and an attempt to send people our presence (if only as a sort of * pre-authorization). */ return TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_CAN_REMOVE; case TP_LIST_HANDLE_SUBSCRIBE: /* We can ask people to show us their presence, with a message. * We do our best to allow rescinding unreplied requests, and * unsubscribing, even if the underlying protocol does not. */ return TP_CHANNEL_GROUP_FLAG_CAN_ADD | (tp_base_contact_list_get_request_uses_message (self) ? TP_CHANNEL_GROUP_FLAG_MESSAGE_ADD : 0) | TP_CHANNEL_GROUP_FLAG_CAN_REMOVE | TP_CHANNEL_GROUP_FLAG_CAN_RESCIND; case TP_LIST_HANDLE_STORED: /* We allow attempts to add people to the roster and remove them again, * even if the real protocol doesn't. */ return TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_CAN_REMOVE; case TP_LIST_HANDLE_DENY: /* A deny list wouldn't be much good if we couldn't actually deny, * would it? */ return TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_CAN_REMOVE; default: g_return_val_if_reached (0); } } static void tp_base_contact_list_add_to_group_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (source)); if (tp_base_contact_list_add_to_group_finish (self, result, &error)) { dbus_g_method_return (user_data); } else { dbus_g_method_return_error (user_data, error); g_clear_error (&error); } } void _tp_base_contact_list_add_to_group (TpBaseContactList *self, TpHandle group, const GArray *contacts_arr, const gchar *message G_GNUC_UNUSED, DBusGMethodInvocation *context) { TpHandleSet *contacts; const gchar *group_name; GError *error = NULL; /* fail if not ready yet, failed, or disconnected, or if handles are bad */ if (tp_base_contact_list_get_state (self, &error) != TP_CONTACT_LIST_STATE_SUCCESS || !tp_handles_are_valid (self->priv->contact_repo, contacts_arr, FALSE, &error)) goto error; if (!TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot add contacts to a group"); goto error; } contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); group_name = tp_handle_inspect (self->priv->group_repo, group); tp_base_contact_list_add_to_group_async (self, group_name, contacts, tp_base_contact_list_add_to_group_cb, context); tp_handle_set_destroy (contacts); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } static void tp_base_contact_list_remove_from_group_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (source)); if (tp_base_contact_list_remove_from_group_finish (self, result, &error)) { dbus_g_method_return (user_data); } else { dbus_g_method_return_error (user_data, error); g_clear_error (&error); } } void _tp_base_contact_list_remove_from_group (TpBaseContactList *self, TpHandle group, const GArray *contacts_arr, const gchar *message G_GNUC_UNUSED, guint reason G_GNUC_UNUSED, DBusGMethodInvocation *context) { TpHandleSet *contacts; const gchar *group_name; GError *error = NULL; /* fail if not ready yet, failed, or disconnected, or if handles are bad */ if (tp_base_contact_list_get_state (self, &error) != TP_CONTACT_LIST_STATE_SUCCESS || !tp_handles_are_valid (self->priv->contact_repo, contacts_arr, FALSE, &error)) goto error; if (!TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot remove contacts from a group"); goto error; } contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); group_name = tp_handle_inspect (self->priv->group_repo, group); tp_base_contact_list_remove_from_group_async (self, group_name, contacts, tp_base_contact_list_remove_from_group_cb, context); tp_handle_set_destroy (contacts); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } static void tp_base_contact_list_delete_group_by_handle_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (source)); if (tp_base_contact_list_remove_group_finish (self, result, &error)) { DEBUG ("Removing group '%s' succeeded", (gchar *) user_data); } else { DEBUG ("Removing group '%s' failed: %s #%d: %s", (gchar *) user_data, g_quark_to_string (error->domain), error->code, error->message); g_clear_error (&error); } g_free (user_data); } gboolean _tp_base_contact_list_delete_group_by_handle (TpBaseContactList *self, TpHandle group, GError **error) { gchar *group_name; if (tp_base_contact_list_get_state (self, error) != TP_CONTACT_LIST_STATE_SUCCESS) { g_set_error (error, TP_ERROR, TP_ERROR_DISCONNECTED, "Disconnected"); return FALSE; } if (!TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot remove a group"); return FALSE; } group_name = g_strdup (tp_handle_inspect (self->priv->group_repo, group)); tp_base_contact_list_remove_group_async (self, group_name, tp_base_contact_list_delete_group_by_handle_cb, group_name); return TRUE; } typedef struct { DBusGMethodInvocation *context; TpListHandle list; } ListContext; static ListContext * list_context_new (DBusGMethodInvocation *context, TpListHandle list) { ListContext *lc = g_slice_new0 (ListContext); lc->context = context; lc->list = list; return lc; } static void list_context_finish_take_error (ListContext *lc, GError *error) { if (error == NULL) { dbus_g_method_return (lc->context); } else { dbus_g_method_return_error (lc->context, error); g_error_free (error); } g_slice_free (ListContext, lc); } static void tp_base_contact_list_add_to_list_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); ListContext *lc = user_data; GError *error = NULL; gboolean ok; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (source)); switch (lc->list) { case TP_LIST_HANDLE_SUBSCRIBE: ok = tp_base_contact_list_request_subscription_finish (self, result, &error); break; case TP_LIST_HANDLE_PUBLISH: ok = tp_base_contact_list_authorize_publication_finish (self, result, &error); break; case TP_LIST_HANDLE_STORED: ok = tp_base_contact_list_store_contacts_finish (self, result, &error); break; case TP_LIST_HANDLE_DENY: ok = tp_base_contact_list_block_contacts_finish (self, result, &error); break; default: g_return_if_reached (); } g_assert (ok == (error == NULL)); list_context_finish_take_error (lc, error); } void _tp_base_contact_list_add_to_list (TpBaseContactList *self, TpHandle list, const GArray *contacts_arr, const gchar *message, DBusGMethodInvocation *context) { TpHandleSet *contacts; GError *error = NULL; ListContext *lc; /* fail if not ready yet, failed, or disconnected, or if handles are bad */ if (tp_base_contact_list_get_state (self, &error) != TP_CONTACT_LIST_STATE_SUCCESS || !tp_handles_are_valid (self->priv->contact_repo, contacts_arr, FALSE, &error)) goto error; if (!tp_base_contact_list_can_change_contact_list (self)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot change subscriptions"); goto error; } contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); lc = list_context_new (context, list); switch (list) { case TP_LIST_HANDLE_SUBSCRIBE: tp_base_contact_list_request_subscription_async (self, contacts, message, tp_base_contact_list_add_to_list_cb, lc); break; case TP_LIST_HANDLE_PUBLISH: tp_base_contact_list_authorize_publication_async (self, contacts, tp_base_contact_list_add_to_list_cb, lc); break; case TP_LIST_HANDLE_STORED: tp_base_contact_list_store_contacts_async (self, contacts, tp_base_contact_list_add_to_list_cb, lc); break; case TP_LIST_HANDLE_DENY: tp_base_contact_list_block_contacts_async (self, contacts, tp_base_contact_list_add_to_list_cb, lc); break; default: g_assert_not_reached (); } tp_handle_set_destroy (contacts); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } static void tp_base_contact_list_remove_from_list_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); ListContext *lc = user_data; GError *error = NULL; gboolean ok; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (source)); switch (lc->list) { case TP_LIST_HANDLE_SUBSCRIBE: ok = tp_base_contact_list_unsubscribe_finish (self, result, &error); break; case TP_LIST_HANDLE_PUBLISH: ok = tp_base_contact_list_unpublish_finish (self, result, &error); break; case TP_LIST_HANDLE_STORED: ok = tp_base_contact_list_remove_contacts_finish (self, result, &error); break; case TP_LIST_HANDLE_DENY: ok = tp_base_contact_list_unblock_contacts_finish (self, result, &error); break; default: g_return_if_reached (); } g_assert (ok == (error == NULL)); list_context_finish_take_error (lc, error); } void _tp_base_contact_list_remove_from_list (TpBaseContactList *self, TpHandle list, const GArray *contacts_arr, const gchar *message G_GNUC_UNUSED, guint reason G_GNUC_UNUSED, DBusGMethodInvocation *context) { TpHandleSet *contacts; GError *error = NULL; ListContext *lc; /* fail if not ready yet, failed, or disconnected, or if handles are bad */ if (tp_base_contact_list_get_state (self, &error) != TP_CONTACT_LIST_STATE_SUCCESS || !tp_handles_are_valid (self->priv->contact_repo, contacts_arr, FALSE, &error)) goto error; if (!tp_base_contact_list_can_change_contact_list (self)) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot change subscriptions"); goto error; } contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); lc = list_context_new (context, list); switch (list) { case TP_LIST_HANDLE_SUBSCRIBE: tp_base_contact_list_unsubscribe_async (self, contacts, tp_base_contact_list_remove_from_list_cb, lc); break; case TP_LIST_HANDLE_PUBLISH: tp_base_contact_list_unpublish_async (self, contacts, tp_base_contact_list_remove_from_list_cb, lc); break; case TP_LIST_HANDLE_STORED: tp_base_contact_list_remove_contacts_async (self, contacts, tp_base_contact_list_remove_from_list_cb, lc); break; case TP_LIST_HANDLE_DENY: tp_base_contact_list_unblock_contacts_async (self, contacts, tp_base_contact_list_remove_from_list_cb, lc); break; default: g_assert_not_reached (); } tp_handle_set_destroy (contacts); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } /** * tp_base_contact_list_set_list_pending: * @self: the contact list manager * * Record that receiving the initial contact list is in progress. * * Since: 0.13.0 */ void tp_base_contact_list_set_list_pending (TpBaseContactList *self) { g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->state == TP_CONTACT_LIST_STATE_NONE); if (self->priv->conn == NULL || self->priv->state != TP_CONTACT_LIST_STATE_NONE) return; self->priv->state = TP_CONTACT_LIST_STATE_WAITING; tp_svc_connection_interface_contact_list_emit_contact_list_state_changed ( self->priv->conn, self->priv->state); } /** * tp_base_contact_list_set_list_failed: * @self: the contact list manager * @domain: a #GError domain * @code: a #GError code * @message: a #GError message * * Record that receiving the initial contact list has failed. * * This method cannot be called after tp_base_contact_list_set_list_received() * is called. * * Since: 0.13.0 */ void tp_base_contact_list_set_list_failed (TpBaseContactList *self, GQuark domain, gint code, const gchar *message) { g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS); if (self->priv->conn == NULL) return; self->priv->state = TP_CONTACT_LIST_STATE_FAILURE; g_clear_error (&self->priv->failure); self->priv->failure = g_error_new_literal (domain, code, message); tp_svc_connection_interface_contact_list_emit_contact_list_state_changed ( self->priv->conn, self->priv->state); tp_base_contact_list_fail_channel_requests (self, domain, code, message); tp_base_contact_list_fail_blocked_contact_requests (self, self->priv->failure); } /** * tp_base_contact_list_set_list_received: * @self: the contact list manager * * Record that the initial contact list has been received. This allows the * contact list manager to reply to requests for the list of contacts that * were previously made, and reply to subsequent requests immediately. * * This method can be called at most once for a contact list manager. * * In protocols where there's no good definition of the point at which the * initial contact list has been received (such as link-local XMPP), this * method may be called immediately. * * The #TpBaseContactListDupContactsFunc and * #TpBaseContactListDupStatesFunc must already give correct * results when entering this method. * * If implemented, tp_base_contact_list_dup_blocked_contacts() must also * give correct results when entering this method. * * Since: 0.13.0 */ void tp_base_contact_list_set_list_received (TpBaseContactList *self) { TpHandleSet *contacts; guint i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS); if (self->priv->conn == NULL) return; self->priv->state = TP_CONTACT_LIST_STATE_SUCCESS; /* we emit the signal for this later */ if (self->priv->lists[TP_LIST_HANDLE_SUBSCRIBE] == NULL) { tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_LIST, TP_LIST_HANDLE_SUBSCRIBE, NULL); } if (self->priv->lists[TP_LIST_HANDLE_PUBLISH] == NULL) { tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_LIST, TP_LIST_HANDLE_PUBLISH, NULL); } if (tp_base_contact_list_get_contact_list_persists (self) && self->priv->lists[TP_LIST_HANDLE_STORED] == NULL) { tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_LIST, TP_LIST_HANDLE_STORED, NULL); } contacts = tp_base_contact_list_dup_contacts (self); g_return_if_fail (contacts != NULL); /* A quick sanity check to make sure that faulty implementations crash * during development :-) */ tp_base_contact_list_dup_states (self, tp_base_connection_get_self_handle (self->priv->conn), NULL, NULL, NULL); if (DEBUGGING) { gchar *tmp = tp_intset_dump (tp_handle_set_peek (contacts)); DEBUG ("Initial contacts: %s", tmp); g_free (tmp); } tp_base_contact_list_contacts_changed_internal (self, contacts, NULL, TRUE); if (tp_base_contact_list_can_block (self)) { TpHandleSet *blocked; if (self->priv->lists[TP_LIST_HANDLE_DENY] == NULL) { tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_LIST, TP_LIST_HANDLE_DENY, NULL); } blocked = tp_base_contact_list_dup_blocked_contacts (self); if (DEBUGGING) { gchar *tmp = tp_intset_dump (tp_handle_set_peek (contacts)); DEBUG ("Initially blocked contacts: %s", tmp); g_free (tmp); } tp_base_contact_list_contact_blocking_changed (self, blocked); if (self->priv->svc_contact_blocking && self->priv->blocked_contact_requests.length > 0) { GHashTable *map = tp_handle_set_to_identifier_map (blocked); DBusGMethodInvocation *context; while ((context = g_queue_pop_head ( &self->priv->blocked_contact_requests)) != NULL) tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts (context, map); g_hash_table_unref (map); } tp_handle_set_destroy (blocked); } for (i = 0; i < TP_NUM_LIST_HANDLES; i++) { if (self->priv->lists[i] != NULL) tp_base_contact_list_announce_channel (self, self->priv->lists[i], NULL); } /* The natural thing to do here would be to iterate over all contacts, and * for each contact, emit a signal adding them to their own groups. However, * that emits a signal per contact. Here we turn the data model inside out, * to emit one signal per group - that's probably fewer (and also means we * can put them in batches for legacy Group channels). */ if (TP_IS_CONTACT_GROUP_LIST (self)) { GStrv groups = tp_base_contact_list_dup_groups (self); tp_base_contact_list_groups_created (self, (const gchar * const *) groups, -1); for (i = 0; groups != NULL && groups[i] != NULL; i++) { TpHandleSet *members = tp_base_contact_list_dup_group_members (self, groups[i]); tp_base_contact_list_groups_changed (self, members, (const gchar * const *) groups + i, 1, NULL, 0); tp_handle_set_destroy (members); } g_strfreev (groups); } tp_handle_set_destroy (contacts); /* emit this last, so people can distinguish between the initial state * and subsequent changes */ tp_svc_connection_interface_contact_list_emit_contact_list_state_changed ( self->priv->conn, self->priv->state); } char _tp_base_contact_list_presence_state_to_letter (TpSubscriptionState ps) { switch (ps) { case TP_SUBSCRIPTION_STATE_UNKNOWN: return '?'; case TP_SUBSCRIPTION_STATE_YES: return 'Y'; case TP_SUBSCRIPTION_STATE_NO: return 'N'; case TP_SUBSCRIPTION_STATE_ASK: return 'A'; case TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY: return 'R'; default: return '!'; } } /** * tp_base_contact_list_contacts_changed: * @self: the contact list manager * @changed: (allow-none): a set of contacts added to the contact list or with * a changed status * @removed: (allow-none): a set of contacts removed from the contact list * * Emit signals for a change to the contact list. * * The results of #TpBaseContactListDupContactsFunc and * #TpBaseContactListDupStatesFunc must already reflect * the contacts' new statuses when entering this method (in practice, this * means that implementations must update their own cache of contacts * before calling this method). * * Since: 0.13.0 */ void tp_base_contact_list_contacts_changed (TpBaseContactList *self, TpHandleSet *changed, TpHandleSet *removed) { tp_base_contact_list_contacts_changed_internal (self, changed, removed, FALSE); } static void tp_base_contact_list_contacts_changed_internal (TpBaseContactList *self, TpHandleSet *changed, TpHandleSet *removed, gboolean is_initial_roster) { GHashTable *changes; GHashTable *change_ids; GArray *removals; GHashTable *removal_ids; TpIntsetFastIter iter; TpIntset *pub, *sub, *sub_rp, *unpub, *unsub, *store; GObject *sub_chan, *pub_chan, *stored_chan; TpHandle self_handle; TpHandle contact; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); /* don't do anything if we're disconnecting, or if we haven't had the * initial contact list yet */ if (tp_base_contact_list_get_state (self, NULL) != TP_CONTACT_LIST_STATE_SUCCESS) return; self_handle = tp_base_connection_get_self_handle (self->priv->conn), sub_chan = (GObject *) self->priv->lists[TP_LIST_HANDLE_SUBSCRIBE]; pub_chan = (GObject *) self->priv->lists[TP_LIST_HANDLE_PUBLISH]; stored_chan = (GObject *) self->priv->lists[TP_LIST_HANDLE_STORED]; g_return_if_fail (G_IS_OBJECT (sub_chan)); g_return_if_fail (G_IS_OBJECT (pub_chan)); /* stored_chan can legitimately be NULL, though */ /* For some changes, we emit signals one by one, because the actor is * different every time. However, for these sets of changes, we do them all * at once, since they'll share an actor. */ pub = tp_intset_new (); unpub = tp_intset_new (); unsub = tp_intset_new (); sub = tp_intset_new (); sub_rp = tp_intset_new (); store = tp_intset_new (); changes = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) tp_value_array_free); change_ids = g_hash_table_new (NULL, NULL); if (changed != NULL) tp_intset_fast_iter_init (&iter, tp_handle_set_peek (changed)); while (changed != NULL && tp_intset_fast_iter_next (&iter, &contact)) { TpSubscriptionState subscribe = TP_SUBSCRIPTION_STATE_NO; TpSubscriptionState publish = TP_SUBSCRIPTION_STATE_NO; gchar *publish_request = NULL; tp_intset_add (store, contact); tp_base_contact_list_dup_states (self, contact, &subscribe, &publish, &publish_request); if (publish_request == NULL) publish_request = g_strdup (""); DEBUG ("Contact %s: subscribe=%c publish=%c '%s'", tp_handle_inspect (self->priv->contact_repo, contact), _tp_base_contact_list_presence_state_to_letter (subscribe), _tp_base_contact_list_presence_state_to_letter (publish), publish_request); switch (publish) { case TP_SUBSCRIPTION_STATE_NO: case TP_SUBSCRIPTION_STATE_UNKNOWN: tp_intset_add (unpub, contact); break; case TP_SUBSCRIPTION_STATE_ASK: { /* Emit any publication requests as we go along, since they can * each have a different message and actor */ TpIntset *pub_lp = tp_intset_new_containing (contact); tp_group_mixin_change_members (pub_chan, publish_request, NULL, NULL, pub_lp, NULL, contact, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (pub_lp); } break; case TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY: { /* Also emit publication request cancellations as we go along: * each one has a different actor */ TpIntset *pub_cancelled = tp_intset_new_containing ( contact); tp_group_mixin_change_members (pub_chan, "", NULL, pub_cancelled, NULL, NULL, contact, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (pub_cancelled); } break; case TP_SUBSCRIPTION_STATE_YES: tp_intset_add (pub, contact); break; default: g_assert_not_reached (); } switch (subscribe) { case TP_SUBSCRIPTION_STATE_NO: case TP_SUBSCRIPTION_STATE_UNKNOWN: tp_intset_add (unsub, contact); break; case TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY: { /* If our subscription request was rejected, the actor is the * other guy, and PERMISSION_DENIED seems a reasonable reason */ TpIntset *sub_rejected = tp_intset_new_containing (contact); tp_group_mixin_change_members (sub_chan, "", NULL, sub_rejected, NULL, NULL, contact, TP_CHANNEL_GROUP_CHANGE_REASON_PERMISSION_DENIED); tp_intset_destroy (sub_rejected); } break; case TP_SUBSCRIPTION_STATE_ASK: tp_intset_add (sub_rp, contact); break; case TP_SUBSCRIPTION_STATE_YES: if (is_initial_roster) { tp_intset_add (sub, contact); } else { /* If our subscription request was accepted, the actor is the * other guy accepting */ TpIntset *sub_approved = tp_intset_new_containing (contact); tp_group_mixin_change_members (sub_chan, "", sub_approved, NULL, NULL, NULL, contact, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (sub_approved); } break; default: g_assert_not_reached (); } g_hash_table_insert (changes, GUINT_TO_POINTER (contact), tp_value_array_build (3, G_TYPE_UINT, subscribe, G_TYPE_UINT, publish, G_TYPE_STRING, publish_request, G_TYPE_INVALID)); g_free (publish_request); g_hash_table_insert (change_ids, GUINT_TO_POINTER (contact), (gchar *) tp_handle_inspect (self->priv->contact_repo, contact)); } removal_ids = g_hash_table_new (NULL, NULL); if (removed != NULL) { guint i; tp_intset_union_update (unsub, tp_handle_set_peek (removed)); tp_intset_union_update (unpub, tp_handle_set_peek (removed)); removals = tp_handle_set_to_array (removed); for (i = 0; i < removals->len; i++) { TpHandle handle = g_array_index (removals, guint, i); g_hash_table_insert (removal_ids, GUINT_TO_POINTER (handle), (gchar *) tp_handle_inspect (self->priv->contact_repo, handle)); } } else { removals = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 0); } /* The actor is 0 for removals from subscribe and publish: we don't know * whether it was our idea, or caused by an unknown contact or by server * failure, since those are all represented as No. */ tp_group_mixin_change_members (sub_chan, "", NULL, unsub, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_group_mixin_change_members (pub_chan, "", NULL, unpub, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* pub is the set of contacts changing to publish=Yes (i.e. contacts we'll * allow to see our presence), which was presumably our idea. */ tp_group_mixin_change_members (pub_chan, "", pub, NULL, NULL, NULL, self_handle, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* sub is the set of contacts with subscribe=Yes while retrieving the * initial roster. We don't know if the contacts were already in the roster * or if they were added while we were offline, so the actor is 0. * Having all the initial contacts grouped together means we emit a single * MembersChanged and one MembersChangedDetailed for the whole roster. */ tp_group_mixin_change_members (sub_chan, "", sub, NULL, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* sub_rp is the set of contacts changing to subscribe=Ask, which was * presumably our idea. */ tp_group_mixin_change_members (sub_chan, "", NULL, NULL, NULL, sub_rp, self_handle, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* We use actor 0 for the stored list, since people can land on the stored * list for a variety of reasons (if someone has requested we publish to * them, they're temporarily claimed to be stored). */ if (stored_chan != NULL) { tp_group_mixin_change_members (stored_chan, "", store, removed == NULL ? NULL : tp_handle_set_peek (removed), NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); } if (g_hash_table_size (changes) > 0 || removals->len > 0) { DEBUG ("ContactsChanged([%u changed], [%u removed])", g_hash_table_size (changes), removals->len); if (self->priv->svc_contact_list) { tp_svc_connection_interface_contact_list_emit_contacts_changed_with_id ( self->priv->conn, changes, change_ids, removal_ids); tp_svc_connection_interface_contact_list_emit_contacts_changed ( self->priv->conn, changes, removals); } } tp_intset_destroy (pub); tp_intset_destroy (unpub); tp_intset_destroy (unsub); tp_intset_destroy (sub_rp); tp_intset_destroy (sub); tp_intset_destroy (store); g_hash_table_unref (changes); g_hash_table_unref (change_ids); g_hash_table_unref (removal_ids); g_array_unref (removals); } /** * tp_base_contact_list_one_contact_changed: * @self: the contact list manager * @changed: a contact handle * * Convenience wrapper around tp_base_contact_list_contacts_changed() for a * single handle in the 'changed' set and no 'removed' set. * * Since: 0.13.0 */ void tp_base_contact_list_one_contact_changed (TpBaseContactList *self, TpHandle changed) { TpHandleSet *set; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); /* if we're disconnecting, we might not have a handle repository any more: * tp_base_contact_list_contacts_changed does nothing in that situation */ if (self->priv->contact_repo == NULL) return; set = tp_handle_set_new_containing (self->priv->contact_repo, changed); tp_base_contact_list_contacts_changed (self, set, NULL); tp_handle_set_destroy (set); } /** * tp_base_contact_list_one_contact_removed: * @self: the contact list manager * @removed: a contact handle * * Convenience wrapper around tp_base_contact_list_contacts_changed() for a * single handle in the 'removed' set and no 'changed' set. * * Since: 0.13.0 */ void tp_base_contact_list_one_contact_removed (TpBaseContactList *self, TpHandle removed) { TpHandleSet *set; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); /* if we're disconnecting, we might not have a handle repository any more: * tp_base_contact_list_contacts_changed does nothing in that situation */ if (self->priv->contact_repo == NULL) return; set = tp_handle_set_new_containing (self->priv->contact_repo, removed); tp_base_contact_list_contacts_changed (self, NULL, set); tp_handle_set_destroy (set); } /** * tp_base_contact_list_contact_blocking_changed: * @self: the contact list manager * @changed: a set of contacts who were blocked or unblocked * * Emit signals for a change to the blocked contacts list. * * tp_base_contact_list_dup_blocked_contacts() * must already reflect the contacts' new statuses when entering this method * (in practice, this means that implementations must update their own cache * of contacts before calling this method). * * It is an error to call this method if tp_base_contact_list_can_block() * would return %FALSE. * * Since: 0.13.0 */ void tp_base_contact_list_contact_blocking_changed (TpBaseContactList *self, TpHandleSet *changed) { TpHandleSet *now_blocked; TpIntset *blocked, *unblocked; GHashTable *blocked_contacts, *unblocked_contacts; TpIntsetFastIter iter; GObject *deny_chan; TpHandle handle; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (changed != NULL); /* don't do anything if we're disconnecting, or if we haven't had the * initial contact list yet */ if (tp_base_contact_list_get_state (self, NULL) != TP_CONTACT_LIST_STATE_SUCCESS) return; g_return_if_fail (tp_base_contact_list_can_block (self)); deny_chan = (GObject *) self->priv->lists[TP_LIST_HANDLE_DENY]; g_return_if_fail (G_IS_OBJECT (deny_chan)); now_blocked = tp_base_contact_list_dup_blocked_contacts (self); blocked = tp_intset_new (); unblocked = tp_intset_new (); blocked_contacts = g_hash_table_new (NULL, NULL); unblocked_contacts = g_hash_table_new (NULL, NULL); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (changed)); while (tp_intset_fast_iter_next (&iter, &handle)) { const char *id = tp_handle_inspect (self->priv->contact_repo, handle); if (tp_handle_set_is_member (now_blocked, handle)) { tp_intset_add (blocked, handle); g_hash_table_insert (blocked_contacts, GUINT_TO_POINTER (handle), (gpointer) id); } else { tp_intset_add (unblocked, handle); g_hash_table_insert (unblocked_contacts, GUINT_TO_POINTER (handle), (gpointer) id); } DEBUG ("Contact %s: blocked=%c", id, tp_handle_set_is_member (now_blocked, handle) ? 'Y' : 'N'); } tp_group_mixin_change_members (deny_chan, "", blocked, unblocked, NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); if (self->priv->svc_contact_blocking && (g_hash_table_size (blocked_contacts) > 0 || g_hash_table_size (unblocked_contacts) > 0)) tp_svc_connection_interface_contact_blocking_emit_blocked_contacts_changed ( self->priv->conn, blocked_contacts, unblocked_contacts); tp_intset_destroy (blocked); tp_intset_destroy (unblocked); g_hash_table_unref (blocked_contacts); g_hash_table_unref (unblocked_contacts); tp_handle_set_destroy (now_blocked); } /** * tp_base_contact_list_dup_contacts: * @self: a contact list manager * * Return the contact list. It is incorrect to call this method before * tp_base_contact_list_set_list_received() has been called, or after the * connection has disconnected. * * This is a virtual method, implemented using * #TpBaseContactListClass.dup_contacts. Every subclass of #TpBaseContactList * must implement this method. * * If the contact list implements %TP_TYPE_BLOCKABLE_CONTACT_LIST, blocked * contacts should not appear in the result of this method unless they are * considered to be on the contact list for some other reason. * * Returns: (transfer full): a new #TpHandleSet of contact handles * * Since: 0.13.0 */ TpHandleSet * tp_base_contact_list_dup_contacts (TpBaseContactList *self) { TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); g_return_val_if_fail (cls != NULL, NULL); g_return_val_if_fail (cls->dup_contacts != NULL, NULL); g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS, NULL); return cls->dup_contacts (self); } /** * tp_base_contact_list_request_subscription_async: * @self: a contact list manager * @contacts: the contacts whose subscription is to be requested * @message: an optional human-readable message from the user * @callback: a callback to call when the request for subscription succeeds * or fails * @user_data: optional data to pass to @callback * * Request permission to see some contacts' presence. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpMutableContactListInterface.request_subscription_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before it calls @callback. * * If @message will be ignored, * #TpMutableContactListInterface.get_request_uses_message should also be * reimplemented to return %FALSE. * * Since: 0.13.0 */ void tp_base_contact_list_request_subscription_async (TpBaseContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->request_subscription_async != NULL); mutable_iface->request_subscription_async (self, contacts, message, callback, user_data); } /** * tp_base_contact_list_request_subscription_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_request_subscription_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_request_subscription_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.request_subscription_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_request_subscription_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->request_subscription_finish != NULL, FALSE); return mutable_iface->request_subscription_finish (self, result, error); } /** * tp_base_contact_list_dup_states: * @self: a contact list manager * @contact: the contact * @subscribe: (out) (allow-none): used to return the state of the user's * subscription to @contact's presence * @publish: (out) (allow-none): used to return the state of @contact's * subscription to the user's presence * @publish_request: (out) (allow-none) (transfer full): if @publish will be * set to %TP_SUBSCRIPTION_STATE_ASK, used to return the message that * @contact sent when they requested permission to see the user's presence; * otherwise, used to return an empty string * * Return the presence subscription state of @contact. It is incorrect to call * this method before tp_base_contact_list_set_list_received() has been * called, or after the connection has disconnected. * * This is a virtual method, implemented using * #TpBaseContactListClass.dup_states. Every subclass of #TpBaseContactList * must implement this method. * * Since: 0.13.0 */ void tp_base_contact_list_dup_states (TpBaseContactList *self, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request) { TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); g_return_if_fail (cls != NULL); g_return_if_fail (cls->dup_states != NULL); g_return_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS); cls->dup_states (self, contact, subscribe, publish, publish_request); if (publish_request != NULL && *publish_request == NULL) *publish_request = g_strdup (""); } /** * tp_base_contact_list_authorize_publication_async: * @self: a contact list manager * @contacts: the contacts to whom presence will be published * @callback: a callback to call when the authorization succeeds or fails * @user_data: optional data to pass to @callback * * Give permission for some contacts to see the local user's presence. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpMutableContactListInterface.authorize_publication_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before it calls @callback. * * Since: 0.13.0 */ void tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->authorize_publication_async != NULL); mutable_iface->authorize_publication_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_authorize_publication_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_authorize_publication_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_authorize_publication_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.authorize_publication_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_authorize_publication_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->authorize_publication_finish != NULL, FALSE); return mutable_iface->authorize_publication_finish (self, result, error); } /** * tp_base_contact_list_store_contacts_async: * @self: a contact list manager * @contacts: the contacts to be stored * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Store @contacts on the contact list, without attempting to subscribe to * them or send presence to them. If this is not possible, do nothing. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method, which may be implemented using * #TpMutableContactListInterface.store_contacts_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before calling @callback. * * If the implementation of * #TpMutableContactListInterface.store_contacts_async is %NULL (which is * the default), this method calls @callback to signal success, but does * nothing in the underlying protocol. * * Since: 0.13.0 */ void tp_base_contact_list_store_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); if (mutable_iface->store_contacts_async == NULL) tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, NULL); else mutable_iface->store_contacts_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_store_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_store_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_store_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.store_contacts_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->store_contacts_finish != NULL, FALSE); return mutable_iface->store_contacts_finish (self, result, error); } /** * tp_base_contact_list_remove_contacts_async: * @self: a contact list manager * @contacts: the contacts to be removed * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Remove @contacts from the contact list entirely; this includes the * effect of both tp_base_contact_list_unsubscribe_async() and * tp_base_contact_list_unpublish_async(), and also reverses the effect of * tp_base_contact_list_store_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, this method does nothing. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpMutableContactListInterface.remove_contacts_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->remove_contacts_async != NULL); mutable_iface->remove_contacts_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_remove_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_remove_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_remove_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.remove_contacts_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->remove_contacts_finish != NULL, FALSE); return mutable_iface->remove_contacts_finish (self, result, error); } /** * tp_base_contact_list_unsubscribe_async: * @self: a contact list manager * @contacts: the contacts whose presence will no longer be received * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Cancel a pending subscription request to @contacts, or attempt to stop * receiving their presence. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpMutableContactListInterface.unsubscribe_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->unsubscribe_async != NULL); mutable_iface->unsubscribe_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_unsubscribe_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_unsubscribe_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_unsubscribe_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.unsubscribe_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->unsubscribe_finish != NULL, FALSE); return mutable_iface->unsubscribe_finish (self, result, error); } /** * tp_base_contact_list_unpublish_async: * @self: a contact list manager * @contacts: the contacts to whom presence will no longer be published * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Reject a pending subscription request from @contacts, or attempt to stop * sending presence to them. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpMutableContactListInterface.unpublish_async. * The implementation should call tp_base_contact_list_contacts_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_unpublish_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_iface != NULL); g_return_if_fail (mutable_iface->unpublish_async != NULL); mutable_iface->unpublish_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_unpublish_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_unpublish_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_unpublish_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpMutableContactListInterface.unpublish_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_unpublish_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactListInterface *mutable_iface; mutable_iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_iface != NULL, FALSE); g_return_val_if_fail (mutable_iface->unpublish_finish != NULL, FALSE); return mutable_iface->unpublish_finish (self, result, error); } /** * TpBaseContactListBooleanFunc: * @self: a contact list manager * * Signature of a virtual method that returns a boolean result. These are used * for feature-discovery. * * For the simple cases of a constant result, use * tp_base_contact_list_true_func() or tp_base_contact_list_false_func(). * * Returns: a boolean result * * Since: 0.13.0 */ /** * tp_base_contact_list_true_func: * @self: ignored * * An implementation of #TpBaseContactListBooleanFunc that returns %TRUE, * for use in simple cases. * * Returns: %TRUE * * Since: 0.13.0 */ gboolean tp_base_contact_list_true_func (TpBaseContactList *self G_GNUC_UNUSED) { return TRUE; } /** * tp_base_contact_list_false_func: * @self: ignored * * An implementation of #TpBaseContactListBooleanFunc that returns %FALSE, * for use in simple cases. * * Returns: %FALSE * * Since: 0.13.0 */ gboolean tp_base_contact_list_false_func (TpBaseContactList *self G_GNUC_UNUSED) { return FALSE; } /** * tp_base_contact_list_can_change_contact_list: * @self: a contact list manager * * Return whether the contact list can be changed. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, this method always returns %FALSE. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST this is a virtual * method, implemented using * #TpMutableContactListInterface.can_change_contact_list. * The default implementation always returns %TRUE. * * In the rare case of a protocol where subscriptions can only sometimes be * changed and this is detected while connecting, the #TpBaseContactList * subclass should implement %TP_TYPE_MUTABLE_CONTACT_LIST. * #TpMutableContactListInterface.can_change_contact_list to its own * implementation, whose result must remain constant after the * #TpBaseConnection has moved to state %TP_CONNECTION_STATUS_CONNECTED. * * (For instance, this could be useful for XMPP, where subscriptions can * normally be altered, but on connections to Facebook Chat servers this is * not actually supported.) * * Returns: %TRUE if the contact list can be changed * * Since: 0.13.0 */ gboolean tp_base_contact_list_can_change_contact_list (TpBaseContactList *self) { TpMutableContactListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (!TP_IS_MUTABLE_CONTACT_LIST (self)) return FALSE; iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->can_change_contact_list != NULL, FALSE); return iface->can_change_contact_list (self); } /** * tp_base_contact_list_get_contact_list_persists: * @self: a contact list manager * * Return whether subscriptions on this protocol persist between sessions * (i.e. are stored on the server). * * This is a virtual method, implemented using * #TpBaseContactListClass.get_contact_list_persists. * * The default implementation is tp_base_contact_list_true_func(), which is * correct for most protocols. Protocols where the contact list isn't stored * should use tp_base_contact_list_false_func() as their implementation. * * In the rare case of a protocol where subscriptions sometimes persist * and this is detected while connecting, the subclass can implement another * #TpBaseContactListBooleanFunc (whose result must remain constant * after the #TpBaseConnection has moved to state * %TP_CONNECTION_STATUS_CONNECTED), and use that as the implementation. * * Returns: %TRUE if subscriptions persist * * Since: 0.13.0 */ gboolean tp_base_contact_list_get_contact_list_persists (TpBaseContactList *self) { TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); g_return_val_if_fail (cls != NULL, TRUE); g_return_val_if_fail (cls->get_contact_list_persists != NULL, TRUE); return cls->get_contact_list_persists (self); } /** * tp_base_contact_list_get_download_at_connection: * @self: a contact list manager * * This function returns the * #TpBaseContactList:download-at-connection property. * * Returns: the #TpBaseContactList:download-at-connection property * * Since: 0.18.0 */ gboolean tp_base_contact_list_get_download_at_connection (TpBaseContactList *self) { return self->priv->download_at_connection; } /** * tp_base_contact_list_download_async: * @self: a contact list manager * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Download the contact list when it is not done automatically at * connection. * * If the #TpBaseContactList subclass does not override * download_async, the default implementation will raise * TP_ERROR_NOT_IMPLEMENTED asynchronously. * * Since: 0.18.0 */ void tp_base_contact_list_download_async (TpBaseContactList *self, GAsyncReadyCallback callback, gpointer user_data) { TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); g_return_if_fail (cls != NULL); g_return_if_fail (cls->download_async != NULL); return cls->download_async (self, callback, user_data); } /** * tp_base_contact_list_download_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_download_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_download_async(). * * This is a virtual method which may be implemented using * #TpBaseContactListClass.download_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.18.0 */ gboolean tp_base_contact_list_download_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpBaseContactListClass *cls = TP_BASE_CONTACT_LIST_GET_CLASS (self); g_return_val_if_fail (cls != NULL, FALSE); g_return_val_if_fail (cls->download_finish != NULL, FALSE); return cls->download_finish (self, result, error); } /** * tp_base_contact_list_get_request_uses_message: * @self: a contact list manager * * Return whether the tp_base_contact_list_request_subscription_async() * method's @message argument is actually used. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_LIST, this method is meaningless, and always * returns %FALSE. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_LIST, this is a virtual * method, implemented using * #TpMutableContactListInterface.get_request_uses_message. * The default implementation always returns %TRUE, which is correct for most * protocols; subclasses may reimplement this method with * tp_base_contact_list_false_func() or a custom implementation if desired. * * Returns: %TRUE if tp_base_contact_list_request_subscription_async() will not * ignore its @message argument * * Since: 0.13.0 */ gboolean tp_base_contact_list_get_request_uses_message (TpBaseContactList *self) { TpMutableContactListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (!TP_IS_MUTABLE_CONTACT_LIST (self)) return FALSE; iface = TP_MUTABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->get_request_uses_message != NULL, FALSE); return iface->get_request_uses_message (self); } /** * TpBaseContactListBlockContactsWithAbuseFunc: * @self: the contact list manager * @contacts: the contacts to block * @report_abusive: whether to report the contacts as abusive to the server * operator * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a virtual method that blocks a set of contacts, optionally * reporting them to the server operator as abusive. * * Since: 0.15.1 */ /** * tp_base_contact_list_can_block: * @self: a contact list manager * * Return whether this contact list has a list of blocked contacts. If it * does, that list is assumed to be modifiable. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, this method always returns %FALSE. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method, implemented using #TpBlockableContactListInterface.can_block. * The default implementation always returns %TRUE. * * In the case of a protocol where blocking may or may not work * and this is detected while connecting, the subclass can implement another * #TpBaseContactListBooleanFunc (whose result must remain constant * after the #TpBaseConnection has moved to state * %TP_CONNECTION_STATUS_CONNECTED), and use that as the implementation. * * (For instance, this could be useful for XMPP, where support for contact * blocking is server-dependent: telepathy-gabble 0.8.x implements it for * connections to Google Talk servers, but not for any other server.) * * Returns: %TRUE if communication from contacts can be blocked * * Since: 0.13.0 */ gboolean tp_base_contact_list_can_block (TpBaseContactList *self) { TpBlockableContactListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (!TP_IS_BLOCKABLE_CONTACT_LIST (self)) return FALSE; iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->can_block != NULL, FALSE); return iface->can_block (self); } /** * tp_base_contact_list_dup_blocked_contacts: * @self: a contact list manager * * Return the list of blocked contacts. It is incorrect to call this method * before tp_base_contact_list_set_list_received() has been called, after * the connection has disconnected, or on a #TpBaseContactList that does * not implement %TP_TYPE_BLOCKABLE_CONTACT_LIST. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method, implemented using * #TpBlockableContactListInterface.dup_blocked_contacts. * It must always be implemented. * * Returns: (transfer full): a new #TpHandleSet of contact handles * * Since: 0.13.0 */ TpHandleSet * tp_base_contact_list_dup_blocked_contacts (TpBaseContactList *self) { TpBlockableContactListInterface *iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_blocked_contacts != NULL, NULL); g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS, NULL); return iface->dup_blocked_contacts (self); } /** * tp_base_contact_list_block_contacts_async: * @self: a contact list manager * @contacts: contacts whose communications should be blocked * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Request that the given contacts are prevented from communicating with the * user, and that presence is not sent to them even if they have a valid * presence subscription, if possible. This is equivalent to calling * tp_base_contact_list_block_contacts_with_abuse_async(), passing #FALSE as * the report_abusive argument. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpBlockableContactListInterface.block_contacts_async or * #TpBlockableContactListInterface.block_contacts_with_abuse_async. * The implementation should call * tp_base_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_block_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { tp_base_contact_list_block_contacts_with_abuse_async (self, contacts, FALSE, callback, user_data); } /** * tp_base_contact_list_block_contacts_with_abuse_async: * @self: a contact list manager * @contacts: contacts whose communications should be blocked * @report_abusive: whether to report the contacts as abusive to the server * operator * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Request that the given contacts are prevented from communicating with the * user, and that presence is not sent to them even if they have a valid * presence subscription, if possible. If the #TpBaseContactList subclass * implements #TpBlockableContactListInterface.block_contacts_with_abuse_async * and @report_abusive is #TRUE, also report the given contacts as abusive to * the server operator. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpBlockableContactListInterface.block_contacts_async or * #TpBlockableContactListInterface.block_contacts_with_abuse_async. * The implementation should call * tp_base_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.15.1 */ void tp_base_contact_list_block_contacts_with_abuse_async (TpBaseContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data) { TpBlockableContactListInterface *blockable_iface; blockable_iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (blockable_iface != NULL); if (blockable_iface->block_contacts_async != NULL) blockable_iface->block_contacts_async (self, contacts, callback, user_data); else if (blockable_iface->block_contacts_with_abuse_async != NULL) blockable_iface->block_contacts_with_abuse_async (self, contacts, report_abusive, callback, user_data); else g_critical ("neither block_contacts_async nor " "block_contacts_with_abuse_async is implemented"); } /** * tp_base_contact_list_block_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_block_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_block_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpBlockableContactListInterface.block_contacts_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpBlockableContactListInterface *blockable_iface; blockable_iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (blockable_iface != NULL, FALSE); g_return_val_if_fail (blockable_iface->block_contacts_finish != NULL, FALSE); return blockable_iface->block_contacts_finish (self, result, error); } /** * tp_base_contact_list_block_contacts_with_abuse_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_block_contacts_with_abuse_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_block_contacts_with_abuse_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpBlockableContactListInterface.block_contacts_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.15.1 */ gboolean tp_base_contact_list_block_contacts_with_abuse_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpBlockableContactListInterface *blockable_iface; blockable_iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (blockable_iface != NULL, FALSE); g_return_val_if_fail (blockable_iface->block_contacts_finish != NULL, FALSE); return blockable_iface->block_contacts_finish (self, result, error); } /** * tp_base_contact_list_unblock_contacts_async: * @self: a contact list manager * @contacts: contacts whose communications should no longer be blocked * @callback: a callback to call when the operation succeeds or fails * @user_data: optional data to pass to @callback * * Reverse the effects of tp_base_contact_list_block_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, this method does nothing. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which must be implemented, using * #TpBlockableContactListInterface.unblock_contacts_async. * The implementation should call * tp_base_contact_list_contact_blocking_changed() * for any contacts it has changed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpBlockableContactListInterface *blockable_iface; blockable_iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_if_fail (blockable_iface != NULL); g_return_if_fail (blockable_iface->unblock_contacts_async != NULL); blockable_iface->unblock_contacts_async (self, contacts, callback, user_data); } /** * tp_base_contact_list_unblock_contacts_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_unblock_contacts_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_unblock_contacts_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_BLOCKABLE_CONTACT_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_BLOCKABLE_CONTACT_LIST, this is a virtual * method which may be implemented using * #TpBlockableContactListInterface.unblock_contacts_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpBlockableContactListInterface *blockable_iface; blockable_iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); g_return_val_if_fail (blockable_iface != NULL, FALSE); g_return_val_if_fail (blockable_iface->unblock_contacts_finish != NULL, FALSE); return blockable_iface->unblock_contacts_finish (self, result, error); } /** * TpBaseContactListNormalizeFunc: * @self: a contact list manager * @s: a non-%NULL name to normalize * * Signature of a virtual method to normalize strings in a contact list * manager. * * Returns: a normalized form of @s, or %NULL on error * * Since: 0.13.0 */ /** * tp_base_contact_list_normalize_group: * @self: a contact list manager * @s: a non-%NULL group name to normalize * * Return a normalized form of the group name @s, or %NULL if a group of a * sufficiently similar name cannot be created. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always * returns %NULL. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.normalize_group. * If unimplemented, the default behaviour is to use the group's name as-is. * * Protocols where this default is not suitable (for instance, if group names * cannot be the empty string, or can only contain XML character data, or can * only contain a particular Unicode normal form like NFKC) should reimplement * this virtual method. * * Returns: a normalized form of @s, or %NULL on error * * Since: 0.13.0 */ gchar * tp_base_contact_list_normalize_group (TpBaseContactList *self, const gchar *s) { TpContactGroupListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), NULL); g_return_val_if_fail (s != NULL, NULL); if (!TP_IS_CONTACT_GROUP_LIST (self)) return NULL; iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); if (iface->normalize_group == NULL) return g_strdup (s); return iface->normalize_group (self, s); } /** * tp_base_contact_list_groups_created: * @self: a contact list manager * @created: (array length=n_created) (element-type utf8) (allow-none): zero * or more groups that were created * @n_created: the number of groups created, or -1 if @created is * %NULL-terminated * * Called by subclasses when new groups have been created. This will typically * be followed by a call to tp_base_contact_list_groups_changed() to add * some members to those groups. * * It is an error to call this method on a contact list that * does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ void tp_base_contact_list_groups_created (TpBaseContactList *self, const gchar * const *created, gssize n_created) { GPtrArray *actually_created; gssize i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (n_created >= -1); g_return_if_fail (n_created <= 0 || created != NULL); if (n_created == 0 || created == NULL) return; if (n_created < 0) { n_created = (gssize) g_strv_length ((GStrv) created); g_return_if_fail (n_created >= 0); } else { for (i = 0; i < n_created; i++) g_return_if_fail (created[i] != NULL); } if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; actually_created = g_ptr_array_sized_new (n_created + 1); for (i = 0; i < n_created; i++) { TpHandle handle = tp_handle_ensure (self->priv->group_repo, created[i], NULL, NULL); if (handle != 0) { gpointer c = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)); if (c == NULL) c = tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_GROUP, handle, NULL); if (g_hash_table_lookup_extended (self->priv->channel_requests, c, NULL, NULL)) { /* the channel hasn't been announced yet: do so, and include * it in the GroupsCreated signal */ g_ptr_array_add (actually_created, (gchar *) tp_handle_inspect ( self->priv->group_repo, handle)); tp_base_contact_list_announce_channel (self, c, NULL); } } } if (actually_created->len > 0) { DEBUG ("GroupsCreated([%u including '%s'])", actually_created->len, (gchar *) g_ptr_array_index (actually_created, 0)); if (self->priv->svc_contact_groups) { g_ptr_array_add (actually_created, NULL); tp_svc_connection_interface_contact_groups_emit_groups_created ( self->priv->conn, (const gchar **) actually_created->pdata); } } g_ptr_array_unref (actually_created); } /** * tp_base_contact_list_groups_removed: * @self: a contact list manager * @removed: (array length=n_removed) (element-type utf8) (allow-none): zero * or more groups that were removed * @n_removed: the number of groups removed, or -1 if @removed is * %NULL-terminated * * Called by subclasses when groups have been removed. * * Calling tp_base_contact_list_dup_group_members() during this method should * return the groups' old members. If this is done correctly by a subclass, * then tp_base_contact_list_groups_changed() will automatically be emitted * for the old members, and the subclass does not need to do so. * * It is an error to call this method on a contact list that * does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ void tp_base_contact_list_groups_removed (TpBaseContactList *self, const gchar * const *removed, gssize n_removed) { GPtrArray *actually_removed; gssize i; TpHandleSet *old_members; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (removed != NULL); g_return_if_fail (n_removed >= -1); g_return_if_fail (n_removed <= 0 || removed != NULL); if (n_removed == 0 || removed == NULL) return; if (n_removed < 0) { n_removed = (gssize) g_strv_length ((GStrv) removed); g_return_if_fail (n_removed >= 0); } else { for (i = 0; i < n_removed; i++) g_return_if_fail (removed[i] != NULL); } if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; old_members = tp_handle_set_new (self->priv->contact_repo); actually_removed = g_ptr_array_new_full (n_removed + 1, g_free); for (i = 0; i < n_removed; i++) { TpHandle handle = tp_handle_lookup (self->priv->group_repo, removed[i], NULL, NULL); if (handle != 0) { gpointer c = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)); if (c != NULL) { gchar *name; TpHandleSet *group_members; TpHandle contact; TpIntsetFastIter iter; /* the handle might get unref'd by closing the channel, so copy * the string */ name = g_strdup (tp_handle_inspect (self->priv->group_repo, handle)); g_ptr_array_add (actually_removed, name); group_members = tp_base_contact_list_dup_group_members (self, name); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (group_members)); while (tp_intset_fast_iter_next (&iter, &contact)) tp_handle_set_add (old_members, contact); /* Remove members if any: presumably the self-handle is the * actor. */ tp_group_mixin_change_members (c, "", NULL, tp_handle_set_peek (group_members), NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_channel_manager_emit_channel_closed_for_object (self, c); _tp_base_contact_list_channel_close (c); g_hash_table_remove (self->priv->groups, GUINT_TO_POINTER (handle)); tp_handle_set_destroy (group_members); } } } if (actually_removed->len > 0) { GArray *members_arr = tp_handle_set_to_array (old_members); DEBUG ("GroupsRemoved([%u including '%s'])", actually_removed->len, (gchar *) g_ptr_array_index (actually_removed, 0)); g_ptr_array_add (actually_removed, NULL); if (self->priv->svc_contact_groups) tp_svc_connection_interface_contact_groups_emit_groups_removed ( self->priv->conn, (const gchar **) actually_removed->pdata); if (members_arr->len > 0) { /* we already added NULL to actually_removed, so subtract 1 from its * length */ DEBUG ("GroupsChanged([%u contacts], [], [%u groups])", members_arr->len, actually_removed->len - 1); if (self->priv->svc_contact_groups) tp_svc_connection_interface_contact_groups_emit_groups_changed ( self->priv->conn, members_arr, NULL, (const gchar **) actually_removed->pdata); } g_array_unref (members_arr); } tp_handle_set_destroy (old_members); g_ptr_array_unref (actually_removed); } /** * tp_base_contact_list_group_renamed: * @self: a contact list manager * @old_name: the group's old name * @new_name: the group's new name * * Called by subclasses when a group has been renamed. * * Calling tp_base_contact_list_dup_group_members() for @old_name during this * method should return the group's old members. If this is done correctly by * a subclass, then tp_base_contact_list_groups_changed() will automatically * be emitted for the members, and the subclass does not need to do so. * * It is an error to call this method on a contact list that * does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ void tp_base_contact_list_group_renamed (TpBaseContactList *self, const gchar *old_name, const gchar *new_name) { TpHandle old_handle, new_handle; gpointer old_chan, new_chan; const gchar *old_names[] = { old_name, NULL }; const gchar *new_names[] = { new_name, NULL }; const TpIntset *set; TpHandleSet *old_members; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; old_handle = tp_handle_ensure (self->priv->group_repo, old_name, NULL, NULL); if (old_handle == 0) return; old_chan = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (old_handle)); new_handle = tp_handle_ensure (self->priv->group_repo, new_name, NULL, NULL); if (new_handle == 0) return; new_chan = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (new_handle)); if (new_chan == NULL) { new_chan = tp_base_contact_list_new_channel (self, TP_HANDLE_TYPE_GROUP, new_handle, NULL); } if (g_hash_table_lookup_extended (self->priv->channel_requests, new_chan, NULL, NULL)) { /* the channel hasn't been announced yet: do so */ tp_base_contact_list_announce_channel (self, new_chan, NULL); } old_members = tp_base_contact_list_dup_group_members (self, old_name); /* move the members - presumably the self-handle is the actor */ set = tp_handle_set_peek (old_members); tp_group_mixin_change_members (new_chan, "", set, NULL, NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); if (old_chan != NULL) { tp_group_mixin_change_members (old_chan, "", NULL, set, NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_channel_manager_emit_channel_closed_for_object (self, old_chan); _tp_base_contact_list_channel_close (old_chan); } g_hash_table_remove (self->priv->groups, GUINT_TO_POINTER (old_handle)); /* get normalized forms */ old_names[0] = tp_handle_inspect (self->priv->group_repo, old_handle); new_names[0] = tp_handle_inspect (self->priv->group_repo, new_handle); DEBUG ("GroupRenamed('%s', '%s')", old_names[0], new_names[0]); if (self->priv->svc_contact_groups) { tp_svc_connection_interface_contact_groups_emit_group_renamed ( self->priv->conn, old_names[0], new_names[0]); tp_svc_connection_interface_contact_groups_emit_groups_created ( self->priv->conn, new_names); tp_svc_connection_interface_contact_groups_emit_groups_removed ( self->priv->conn, old_names); } if (tp_intset_size (set) > 0) { DEBUG ("GroupsChanged([%u contacts], ['%s'], ['%s'])", tp_intset_size (set), new_names[0], old_names[0]); if (self->priv->svc_contact_groups) { GArray *arr = tp_intset_to_array (set); tp_svc_connection_interface_contact_groups_emit_groups_changed ( self->priv->conn, arr, new_names, old_names); g_array_unref (arr); } } tp_handle_set_destroy (old_members); } /** * tp_base_contact_list_groups_changed: * @self: a contact list manager * @contacts: a set containing one or more contacts * @added: (array length=n_added) (element-type utf8) (allow-none): zero or * more groups to which the @contacts were added, or %NULL (which has the * same meaning as an empty list) * @n_added: the number of groups added, or -1 if @added is %NULL-terminated * @removed: (array zero-terminated=1) (element-type utf8) (allow-none): zero * or more groups from which the @contacts were removed, or %NULL (which has * the same meaning as an empty list) * @n_removed: the number of groups removed, or -1 if @removed is * %NULL-terminated * * Called by subclasses when groups' membership has been changed. * * If any of the groups in @added are not already known to exist, * this method also signals that they were created, as if * tp_base_contact_list_groups_created() had been called first. * * It is an error to call this method on a contact list that * does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ void tp_base_contact_list_groups_changed (TpBaseContactList *self, TpHandleSet *contacts, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed) { gssize i; GPtrArray *really_added, *really_removed; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (contacts != NULL); g_return_if_fail (n_added >= -1); g_return_if_fail (n_removed >= -1); g_return_if_fail (n_added <= 0 || added != NULL); g_return_if_fail (n_removed <= 0 || removed != NULL); if (tp_handle_set_is_empty (contacts)) { DEBUG ("No contacts, doing nothing"); return; } if (n_added < 0) { if (added == NULL) n_added = 0; else n_added = (gssize) g_strv_length ((GStrv) added); g_return_if_fail (n_added >= 0); } else { for (i = 0; i < n_added; i++) g_return_if_fail (added[i] != NULL); } if (n_removed < 0) { if (added == NULL) n_removed = 0; else n_removed = (gssize) g_strv_length ((GStrv) added); g_return_if_fail (n_removed >= 0); } else { for (i = 0; i < n_removed; i++) g_return_if_fail (removed[i] != NULL); } if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; DEBUG ("Changing up to %u contacts, adding %" G_GSSIZE_FORMAT " groups, removing %" G_GSSIZE_FORMAT, tp_handle_set_size (contacts), n_added, n_removed); tp_base_contact_list_groups_created (self, added, n_added); /* These two arrays are lists of the groups whose members really changed; * groups where the change was a no-op are skipped. */ really_added = g_ptr_array_sized_new (n_added); really_removed = g_ptr_array_sized_new (n_removed); for (i = 0; i < n_added; i++) { TpHandle handle = tp_handle_lookup (self->priv->group_repo, added[i], NULL, NULL); gpointer c; /* it doesn't matter if handle is 0, we'll just get NULL */ c = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)); if (c == NULL) { DEBUG ("No channel for group '%s', it must be invalid?", added[i]); continue; } DEBUG ("Adding %u contacts to group '%s'", tp_handle_set_size (contacts), added[i]); if (tp_group_mixin_change_members (c, "", tp_handle_set_peek (contacts), NULL, NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE)) g_ptr_array_add (really_added, (gchar *) added[i]); } for (i = 0; i < n_removed; i++) { TpHandle handle = tp_handle_lookup (self->priv->group_repo, removed[i], NULL, NULL); gpointer c; /* it doesn't matter if handle is 0, we'll just get NULL */ c = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (handle)); if (c == NULL) { DEBUG ("Group '%s' doesn't exist", removed[i]); continue; } DEBUG ("Removing %u contacts from group '%s'", tp_handle_set_size (contacts), removed[i]); if (tp_group_mixin_change_members (c, "", NULL, tp_handle_set_peek (contacts), NULL, NULL, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE)) g_ptr_array_add (really_removed, (gchar *) removed[i]); } if (really_added->len > 0 || really_removed->len > 0) { DEBUG ("GroupsChanged([%u contacts], [%u groups], [%u groups])", tp_handle_set_size (contacts), really_added->len, really_removed->len); g_ptr_array_add (really_added, NULL); g_ptr_array_add (really_removed, NULL); if (self->priv->svc_contact_groups) { GArray *members_arr = tp_handle_set_to_array (contacts); tp_svc_connection_interface_contact_groups_emit_groups_changed ( self->priv->conn, members_arr, (const gchar **) really_added->pdata, (const gchar **) really_removed->pdata); g_array_unref (members_arr); } } g_ptr_array_unref (really_added); g_ptr_array_unref (really_removed); } /** * tp_base_contact_list_one_contact_groups_changed: * @self: the contact list manager * @contact: a contact handle * @added: (array length=n_added) (element-type utf8) (allow-none): zero or * more groups to which @contact was added, or %NULL * @n_added: the number of groups added, or -1 if @added is %NULL-terminated * @removed: (array zero-terminated=1) (element-type utf8) (allow-none): zero * or more groups from which the @contact was removed, or %NULL * @n_removed: the number of groups removed, or -1 if @removed is * %NULL-terminated * * Convenience wrapper around tp_base_contact_list_groups_changed() for a * single handle in the 'contacts' set. * * (There is no equivalent function for @added and @removed having trivial * contents, because you can already use NULL, 0 for an empty * list or &group_name, 1 for a single group.) * * Since: 0.13.0 */ void tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self, TpHandle contact, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed) { TpHandleSet *set; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); /* if we're disconnecting, we might not have a handle repository any more: * tp_base_contact_list_groups_changed does nothing in that situation */ if (self->priv->contact_repo == NULL) return; set = tp_handle_set_new_containing (self->priv->contact_repo, contact); tp_base_contact_list_groups_changed (self, set, added, n_added, removed, n_removed); tp_handle_set_destroy (set); } /** * tp_base_contact_list_has_disjoint_groups: * @self: a contact list manager * * Return whether groups in this protocol are disjoint * (i.e. each contact can be in at most one group). * This is merely informational: subclasses are responsible for making * appropriate calls to tp_base_contact_list_groups_changed(), etc. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_CONTACT_GROUP_LIST, this method is meaningless, and always * returns %FALSE. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.has_disjoint_groups. * * The default implementation is tp_base_contact_list_false_func(); * subclasses where groups are disjoint should use * tp_base_contact_list_true_func() instead. * In the unlikely event that a protocol can have disjoint groups, or not, * determined at runtime, it can use a custom implementation. * * Returns: %TRUE if groups are disjoint * * Since: 0.13.0 */ gboolean tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self) { TpContactGroupListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (!TP_IS_CONTACT_GROUP_LIST (self)) return FALSE; iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, FALSE); g_return_val_if_fail (iface->has_disjoint_groups != NULL, FALSE); return iface->has_disjoint_groups (self); } /** * TpBaseContactListDupGroupsFunc: * @self: a contact list manager * * Signature of a virtual method that lists every group that exists on a * connection. * * Returns: (array zero-terminated=1) (element-type utf8) (transfer full): an * array of groups * * Since: 0.13.0 */ /** * tp_base_contact_list_dup_groups: * @self: a contact list manager * * Return a list of all groups on this connection. It is incorrect to call * this method before tp_base_contact_list_set_list_received() has been * called, after the connection has disconnected, or on a #TpBaseContactList * that does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.dup_groups. * It must always be implemented. * * Returns: (array zero-terminated=1) (element-type utf8) (transfer full): an * array of groups * * Since: 0.13.0 */ GStrv tp_base_contact_list_dup_groups (TpBaseContactList *self) { TpContactGroupListInterface *iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_groups != NULL, NULL); g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS, NULL); return iface->dup_groups (self); } /** * TpBaseContactListDupContactGroupsFunc: * @self: a contact list manager * @contact: a non-zero contact handle * * Signature of a virtual method that lists the groups to which @contact * belongs. * * If @contact is not on the contact list, this method must return either * %NULL or an empty array, without error. * * Returns: (array zero-terminated=1) (element-type utf8) (transfer full): an * array of groups * * Since: 0.13.0 */ /** * tp_base_contact_list_dup_contact_groups: * @self: a contact list manager * @contact: a contact handle * * Return a list of groups of which @contact is a member. It is incorrect to * call this method before tp_base_contact_list_set_list_received() has been * called, after the connection has disconnected, or on a #TpBaseContactList * that does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * If @contact is not on the contact list, this method must return either * %NULL or an empty array. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.dup_contact_groups. * It must always be implemented. * * Returns: (array zero-terminated=1) (element-type utf8) (transfer full): an * array of groups * * Since: 0.13.0 */ GStrv tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, TpHandle contact) { TpContactGroupListInterface *iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_contact_groups != NULL, NULL); g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS, NULL); return iface->dup_contact_groups (self, contact); } /** * TpBaseContactListDupGroupMembersFunc: * @self: a contact list manager * @group: a normalized group name * * Signature of a virtual method that lists the members of a group. * * Returns: (transfer full): a set of contact (%TP_HANDLE_TYPE_CONTACT) handles * * Since: 0.13.0 */ /** * tp_base_contact_list_dup_group_members: * @self: a contact list manager * @group: a normalized group name * * Return the set of members of @group. It is incorrect to * call this method before tp_base_contact_list_set_list_received() has been * called, after the connection has disconnected, or on a #TpBaseContactList * that does not implement %TP_TYPE_CONTACT_GROUP_LIST. * * If @group does not exist, this method must return either %NULL or an empty * set, without error. * * For implementations of %TP_TYPE_CONTACT_GROUP_LIST, this is a virtual * method, implemented using #TpContactGroupListInterface.dup_group_members. * It must always be implemented. * * Returns: a set of contact (%TP_HANDLE_TYPE_CONTACT) handles * * Since: 0.13.0 */ TpHandleSet * tp_base_contact_list_dup_group_members (TpBaseContactList *self, const gchar *group) { TpContactGroupListInterface *iface = TP_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, NULL); g_return_val_if_fail (iface->dup_group_members != NULL, NULL); g_return_val_if_fail (tp_base_contact_list_get_state (self, NULL) == TP_CONTACT_LIST_STATE_SUCCESS, NULL); return iface->dup_group_members (self, group); } /** * TpBaseContactListGroupContactsFunc: * @self: a contact list manager * @group: a group * @contacts: a set of contact handles * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a virtual method that alters a group's members. * * Since: 0.13.0 */ /** * tp_base_contact_list_add_to_group_async: * @self: a contact list manager * @group: the normalized name of a group * @contacts: some contacts (may be an empty set) * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Add @contacts to @group, creating it if necessary. * * If @group does not exist, the implementation should create it, even if * @contacts is empty. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.add_to_group_async. * The implementation should call tp_base_contact_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_add_to_group_async (TpBaseContactList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *iface; iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->add_to_group_async != NULL); iface->add_to_group_async (self, group, contacts, callback, user_data); } /** * tp_base_contact_list_add_to_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_add_to_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_add_to_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented using * #TpMutableContactGroupListInterface.add_to_group_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_add_to_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->add_to_group_finish != NULL, FALSE); return mutable_groups_iface->add_to_group_finish (self, result, error); } /** * TpBaseContactListRenameGroupFunc: * @self: a contact list manager * @old_name: a group * @new_name: a new name for the group * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a method that renames groups. * * Since: 0.13.0 */ /** * tp_base_contact_list_rename_group_async: * @self: a contact list manager * @old_name: the normalized name of a group, which must exist * @new_name: a new normalized name for the group name * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Rename a group; if possible, do so as an atomic operation. If this * protocol can't do that, emulate renaming in terms of other operations. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented, using * #TpMutableContactGroupListInterface.rename_group_async. * * If this virtual method is not implemented, the default is to implement * renaming a group as creating the new group, adding all the old group's * members to it, and removing the old group: this is appropriate for protocols * like XMPP, in which groups behave more like tags. * * The implementation should call tp_base_contact_list_group_renamed() before * calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_rename_group_async (TpBaseContactList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *iface; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->rename_group_async != NULL); iface->rename_group_async (self, old_name, new_name, callback, user_data); } static void emulate_rename_group_remove_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GSimpleAsyncResult *rename_result = user_data; GError *error = NULL; if (!tp_base_contact_list_remove_group_finish (self, result, &error)) { g_simple_async_result_set_from_error (rename_result, error); g_clear_error (&error); } g_simple_async_result_complete (rename_result); g_object_unref (rename_result); } static void emulate_rename_group_add_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GSimpleAsyncResult *rename_result = user_data; GError *error = NULL; if (!tp_base_contact_list_add_to_group_finish (self, result, &error)) { g_simple_async_result_set_from_error (rename_result, error); g_clear_error (&error); g_simple_async_result_complete (rename_result); goto out; } tp_base_contact_list_remove_group_async (self, g_simple_async_result_get_op_res_gpointer (rename_result), emulate_rename_group_remove_cb, g_object_ref (rename_result)); out: g_object_unref (rename_result); } static void tp_base_contact_list_emulate_rename_group (TpBaseContactList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data) { TpHandle old_handle; gpointer old_channel; GSimpleAsyncResult *result; TpHandleSet *old_members; old_handle = tp_handle_lookup (self->priv->group_repo, old_name, NULL, NULL); g_return_if_fail (old_handle != 0); old_channel = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (old_handle)); g_return_if_fail (old_channel != NULL); result = g_simple_async_result_new ((GObject *) self, callback, user_data, tp_base_contact_list_emulate_rename_group); /* not really the operation result, just some extra data */ g_simple_async_result_set_op_res_gpointer (result, g_strdup (old_name), g_free); old_members = tp_base_contact_list_dup_group_members (self, old_name); tp_base_contact_list_add_to_group_async (self, new_name, old_members, emulate_rename_group_add_cb, g_object_ref (result)); g_object_unref (result); tp_handle_set_destroy (old_members); } /** * tp_base_contact_list_rename_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_rename_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_rename_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented using * #TpMutableContactGroupListInterface.rename_group_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_rename_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->rename_group_finish != NULL, FALSE); return mutable_groups_iface->rename_group_finish (self, result, error); } /** * tp_base_contact_list_remove_from_group_async: * @self: a contact list manager * @group: the normalized name of a group * @contacts: some contacts * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Remove @contacts from @group. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.remove_from_group_async. * The implementation should call tp_base_contact_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *iface; iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (iface != NULL); g_return_if_fail (iface->remove_from_group_async != NULL); iface->remove_from_group_async (self, group, contacts, callback, user_data); } /** * tp_base_contact_list_remove_from_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_remove_from_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_remove_from_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented using * #TpMutableContactGroupListInterface.remove_from_group_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_remove_from_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->remove_from_group_finish != NULL, FALSE); return mutable_groups_iface->remove_from_group_finish (self, result, error); } /** * TpBaseContactListRemoveGroupFunc: * @self: a contact list manager * @group: the normalized name of a group * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of a method that deletes groups. * * Since: 0.13.0 */ /** * tp_base_contact_list_remove_group_async: * @self: a contact list manager * @group: the normalized name of a group * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Remove a group entirely, removing any members in the process. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.remove_group_async. * The implementation should call tp_base_contact_list_groups_removed() * for any groups it successfully removed, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_remove_group_async (TpBaseContactList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *mutable_group_iface; mutable_group_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_group_iface != NULL); g_return_if_fail (mutable_group_iface->remove_group_async != NULL); mutable_group_iface->remove_group_async (self, group, callback, user_data); } /** * tp_base_contact_list_remove_group_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_remove_group_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_remove_group_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented using * #TpMutableContactGroupListInterface.remove_group_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_remove_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->remove_group_finish != NULL, FALSE); return mutable_groups_iface->remove_group_finish (self, result, error); } static void tp_base_contact_list_mixin_get_contact_list_attributes ( TpSvcConnectionInterfaceContactList *svc, const gchar **interfaces, gboolean hold, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); TpContactsMixin *contacts_mixin = TP_CONTACTS_MIXIN (svc); GError *error = NULL; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (contacts_mixin != NULL); if (tp_base_contact_list_get_state (self, &error) != TP_CONTACT_LIST_STATE_SUCCESS) { dbus_g_method_return_error (context, error); g_clear_error (&error); } else { TpHandleSet *set; GArray *contacts; const gchar *assumed[] = { TP_IFACE_CONNECTION, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, NULL }; gchar *sender = NULL; GHashTable *result; if (hold) sender = dbus_g_method_get_sender (context); set = tp_base_contact_list_dup_contacts (self); contacts = tp_handle_set_to_array (set); result = tp_contacts_mixin_get_contact_attributes ( (GObject *) self->priv->conn, contacts, interfaces, assumed, sender); tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes ( context, result); g_array_unref (contacts); tp_handle_set_destroy (set); g_free (sender); g_hash_table_unref (result); } } /** * TpBaseContactListSetContactGroupsFunc: * @self: a contact list manager * @contact: a contact handle * @normalized_names: (array length=n_names): the normalized names of some * groups * @n_names: the number of groups * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Signature of an implementation of * tp_base_contact_list_set_contact_groups_async(). * * Since: 0.13.0 */ /** * tp_base_contact_list_set_contact_groups_async: * @self: a contact list manager * @contact: a contact handle * @normalized_names: (array length=n_names): the normalized names of some * groups * @n_names: the number of groups * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Add @contact to each group in @normalized_names, creating them if necessary, * and remove @contact from any other groups of which they are a member. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.set_contact_groups_async. * The implementation should call tp_base_contact_list_groups_changed() * for any changes it successfully made, before returning. * * Since: 0.13.0 */ void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_groups_iface != NULL); g_return_if_fail (mutable_groups_iface->set_contact_groups_async != NULL); mutable_groups_iface->set_contact_groups_async (self, contact, normalized_names, n_names, callback, user_data); } /** * tp_base_contact_list_set_contact_groups_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_set_contact_groups_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_set_contact_groups_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which may be implemented using * #TpMutableContactGroupListInterface.set_contact_groups_finish. If the * @result will be a #GSimpleAsyncResult, the default implementation may be * used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_set_contact_groups_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->set_contact_groups_finish != NULL, FALSE); return mutable_groups_iface->set_contact_groups_finish (self, result, error); } /** * tp_base_contact_list_set_group_members_async: * @self: a contact list manager * @normalized_group: the normalized name of a group * @contacts: the contacts who should be in the group * @callback: a callback to call on success, failure or disconnection * @user_data: user data for the callback * * Set the members of @normalized_group to be exactly @contacts (i.e. * add @contacts, and simultaneously remove all members not in @contacts). * * If @normalized_group does not exist, the implementation should create it, * even if @contacts is empty. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method which must be implemented, using * #TpMutableContactGroupListInterface.set_group_members_async. * The implementation should call tp_base_contact_list_groups_changed() * for any changes it successfully made, before calling @callback. * * Since: 0.13.0 */ void tp_base_contact_list_set_group_members_async (TpBaseContactList *self, const gchar *normalized_group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_if_fail (mutable_groups_iface != NULL); g_return_if_fail (mutable_groups_iface->set_group_members_async != NULL); mutable_groups_iface->set_group_members_async (self, normalized_group, contacts, callback, user_data); } /** * tp_base_contact_list_set_group_members_finish: * @self: a contact list manager * @result: the result passed to @callback by an implementation of * tp_base_contact_list_set_group_members_async() * @error: used to raise an error if %FALSE is returned * * Interpret the result of an asynchronous call to * tp_base_contact_list_set_group_members_async(). * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, it is an error to call this method. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a virtual * method which may be implemented using * #TpMutableContactGroupListInterface.set_group_members_finish. If the @result * will be a #GSimpleAsyncResult, the default implementation may be used. * * Returns: %TRUE on success or %FALSE on error * * Since: 0.13.0 */ gboolean tp_base_contact_list_set_group_members_finish (TpBaseContactList *self, GAsyncResult *result, GError **error) { TpMutableContactGroupListInterface *mutable_groups_iface; mutable_groups_iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (mutable_groups_iface != NULL, FALSE); g_return_val_if_fail (mutable_groups_iface->set_group_members_finish != NULL, FALSE); return mutable_groups_iface->set_group_members_finish (self, result, error); } static gboolean tp_base_contact_list_check_change (TpBaseContactList *self, const GArray *contacts_or_null, GError **error) { g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), FALSE); if (tp_base_contact_list_get_state (self, error) != TP_CONTACT_LIST_STATE_SUCCESS) return FALSE; if (contacts_or_null != NULL && !tp_handles_are_valid (self->priv->contact_repo, contacts_or_null, FALSE, error)) return FALSE; return TRUE; } static gboolean tp_base_contact_list_check_list_change (TpBaseContactList *self, const GArray *contacts_or_null, GError **error) { if (!tp_base_contact_list_check_change (self, contacts_or_null, error)) return FALSE; if (!tp_base_contact_list_can_change_contact_list (self)) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot change subscriptions"); return FALSE; } return TRUE; } static gboolean tp_base_contact_list_check_group_change (TpBaseContactList *self, const GArray *contacts_or_null, GError **error) { if (!tp_base_contact_list_check_change (self, contacts_or_null, error)) return FALSE; if (tp_base_contact_list_get_group_storage (self) == TP_CONTACT_METADATA_STORAGE_TYPE_NONE) { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Cannot change group memberships"); return FALSE; } return TRUE; } /* Normally we'd use the return_from functions, but these methods all return * void, and life's too short. */ static void tp_base_contact_list_mixin_return_void (DBusGMethodInvocation *context, const GError *error) { if (error == NULL) dbus_g_method_return (context); else dbus_g_method_return_error (context, error); } static void tp_base_contact_list_mixin_request_subscription_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_request_subscription_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_request_subscription ( TpSvcConnectionInterfaceContactList *svc, const GArray *contacts, const gchar *message, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_list_change (self, contacts, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_request_subscription_async (self, contacts_set, message, tp_base_contact_list_mixin_request_subscription_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_authorize_publication_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_authorize_publication_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_authorize_publication ( TpSvcConnectionInterfaceContactList *svc, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_list_change (self, contacts, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_authorize_publication_async (self, contacts_set, tp_base_contact_list_mixin_authorize_publication_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_contacts_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_remove_contacts_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_contacts ( TpSvcConnectionInterfaceContactList *svc, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_list_change (self, contacts, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_remove_contacts_async (self, contacts_set, tp_base_contact_list_mixin_remove_contacts_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_unsubscribe_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_unsubscribe_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_unsubscribe ( TpSvcConnectionInterfaceContactList *svc, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_list_change (self, contacts, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_unsubscribe_async (self, contacts_set, tp_base_contact_list_mixin_unsubscribe_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_unpublish_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_unpublish_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_unpublish ( TpSvcConnectionInterfaceContactList *svc, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_list_change (self, contacts, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_unpublish_async (self, contacts_set, tp_base_contact_list_mixin_unpublish_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } typedef enum { LP_CONTACT_LIST_STATE, LP_CONTACT_LIST_PERSISTS, LP_CAN_CHANGE_CONTACT_LIST, LP_REQUEST_USES_MESSAGE, LP_DOWNLOAD_AT_CONNECTION, NUM_LIST_PROPERTIES } ListProp; static TpDBusPropertiesMixinPropImpl known_list_props[] = { { "ContactListState", GINT_TO_POINTER (LP_CONTACT_LIST_STATE), }, { "ContactListPersists", GINT_TO_POINTER (LP_CONTACT_LIST_PERSISTS), }, { "CanChangeContactList", GINT_TO_POINTER (LP_CAN_CHANGE_CONTACT_LIST) }, { "RequestUsesMessage", GINT_TO_POINTER (LP_REQUEST_USES_MESSAGE) }, { "DownloadAtConnection", GINT_TO_POINTER (LP_DOWNLOAD_AT_CONNECTION) }, { NULL } }; static void tp_base_contact_list_get_list_dbus_property (GObject *conn, GQuark interface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer data) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) conn, TP_TYPE_BASE_CONTACT_LIST); ListProp p = GPOINTER_TO_INT (data); g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->conn != NULL); switch (p) { case LP_CONTACT_LIST_STATE: g_return_if_fail (G_VALUE_HOLDS_UINT (value)); g_value_set_uint (value, self->priv->state); break; case LP_CONTACT_LIST_PERSISTS: g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value)); g_value_set_boolean (value, tp_base_contact_list_get_contact_list_persists (self)); break; case LP_CAN_CHANGE_CONTACT_LIST: g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value)); g_value_set_boolean (value, tp_base_contact_list_can_change_contact_list (self)); break; case LP_REQUEST_USES_MESSAGE: g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value)); g_value_set_boolean (value, tp_base_contact_list_get_request_uses_message (self)); break; case LP_DOWNLOAD_AT_CONNECTION: g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value)); g_value_set_boolean (value, self->priv->download_at_connection); break; default: g_return_if_reached (); } } static void tp_base_contact_list_fill_list_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST); guint i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (self->priv->conn != NULL); /* just omit the attributes if the contact list hasn't come in yet */ if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; for (i = 0; i < contacts->len; i++) { TpSubscriptionState subscribe = TP_SUBSCRIPTION_STATE_NO; TpSubscriptionState publish = TP_SUBSCRIPTION_STATE_NO; gchar *publish_request = NULL; TpHandle handle; handle = g_array_index (contacts, TpHandle, i); tp_base_contact_list_dup_states (self, handle, &subscribe, &publish, &publish_request); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH, tp_g_value_slice_new_uint (publish)); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_SUBSCRIBE, tp_g_value_slice_new_uint (subscribe)); if (tp_str_empty (publish_request) || publish != TP_SUBSCRIPTION_STATE_ASK) { g_free (publish_request); } else { tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_LIST_PUBLISH_REQUEST, tp_g_value_slice_new_take_string (publish_request)); } } } static void tp_base_contact_list_mixin_download_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_download_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_download ( TpSvcConnectionInterfaceContactList *svc, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); tp_base_contact_list_download_async (self, tp_base_contact_list_mixin_download_cb, context); } /** * tp_base_contact_list_mixin_list_iface_init: * @klass: the service-side D-Bus interface * * Use the #TpBaseContactList like a mixin, to implement the ContactList * D-Bus interface. * * This function should be passed to G_IMPLEMENT_INTERFACE() for * #TpSvcConnectionInterfaceContactList. * * Since: 0.13.0 */ void tp_base_contact_list_mixin_list_iface_init ( TpSvcConnectionInterfaceContactListClass *klass) { #define IMPLEMENT(x) tp_svc_connection_interface_contact_list_implement_##x (\ klass, tp_base_contact_list_mixin_##x) IMPLEMENT (get_contact_list_attributes); IMPLEMENT (request_subscription); IMPLEMENT (authorize_publication); IMPLEMENT (remove_contacts); IMPLEMENT (unsubscribe); IMPLEMENT (unpublish); IMPLEMENT (download); #undef IMPLEMENT } /** * TpBaseContactListUIntFunc: * @self: a contact list manager * * Signature of a virtual method that returns an unsigned integer result. * These are used for feature-discovery. * * Returns: an unsigned integer result * * Since: 0.13.0 */ /** * tp_base_contact_list_get_group_storage: * @self: a contact list manager * * Return the extent to which user-defined groups can be set in this protocol. * If this is %TP_CONTACT_METADATA_STORAGE_TYPE_NONE, methods that would alter * the group list will not be called. * * If the #TpBaseContactList subclass does not implement * %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this method is meaningless, and always * returns %TP_CONTACT_METADATA_STORAGE_TYPE_NONE. * * For implementations of %TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, this is a * virtual method, implemented using * #TpMutableContactGroupListInterface.get_group_storage. * * The default implementation is %NULL, which is treated as equivalent to an * implementation that always returns %TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE. * A custom implementation can also be used. * * Returns: a #TpContactMetadataStorageType * * Since: 0.13.0 */ TpContactMetadataStorageType tp_base_contact_list_get_group_storage (TpBaseContactList *self) { TpMutableContactGroupListInterface *iface; g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), TP_CONTACT_METADATA_STORAGE_TYPE_NONE); if (!TP_IS_MUTABLE_CONTACT_GROUP_LIST (self)) return TP_CONTACT_METADATA_STORAGE_TYPE_NONE; iface = TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE (self); g_return_val_if_fail (iface != NULL, TP_CONTACT_METADATA_STORAGE_TYPE_NONE); if (iface->get_group_storage == NULL) return TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE; return iface->get_group_storage (self); } static void tp_base_contact_list_mixin_set_contact_groups_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_set_contact_groups_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_set_contact_groups ( TpSvcConnectionInterfaceContactGroups *svc, guint contact, const gchar **groups, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); const gchar *empty_strv[] = { NULL }; GError *error = NULL; TpHandleSet *group_set = NULL; GPtrArray *normalized_groups = NULL; guint i; if (!tp_base_contact_list_check_group_change (self, NULL, &error)) goto finally; if (groups == NULL) groups = empty_strv; group_set = tp_handle_set_new (self->priv->group_repo); normalized_groups = g_ptr_array_sized_new (g_strv_length ((GStrv) groups)); for (i = 0; groups[i] != NULL; i++) { TpHandle group_handle = tp_handle_ensure (self->priv->group_repo, groups[i], NULL, NULL); if (group_handle != 0) { g_ptr_array_add (normalized_groups, (gchar *) tp_handle_inspect (self->priv->group_repo, group_handle)); tp_handle_set_add (group_set, group_handle); } else { DEBUG ("group '%s' not valid, ignoring it", groups[i]); } } tp_base_contact_list_set_contact_groups_async (self, contact, (const gchar * const *) normalized_groups->pdata, normalized_groups->len, tp_base_contact_list_mixin_set_contact_groups_cb, context); context = NULL; /* ownership transferred to callback */ finally: tp_clear_pointer (&group_set, tp_handle_set_destroy); tp_clear_pointer (&normalized_groups, g_ptr_array_unref); if (context != NULL) tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_set_group_members_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_set_group_members_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_set_group_members ( TpSvcConnectionInterfaceContactGroups *svc, const gchar *group, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); TpHandleSet *contacts_set = NULL; GError *error = NULL; if (!tp_base_contact_list_check_group_change (self, NULL, &error)) goto error; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_set_group_members_async (self, group, contacts_set, tp_base_contact_list_mixin_set_group_members_cb, context); tp_handle_set_destroy (contacts_set); return; error: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_add_to_group_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_add_to_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_add_to_group ( TpSvcConnectionInterfaceContactGroups *svc, const gchar *group, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandle group_handle = 0; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_group_change (self, contacts, &error)) goto sync_exit; /* get the handle so we can use the normalized name */ group_handle = tp_handle_ensure (self->priv->group_repo, group, NULL, &error); /* if the group's name is syntactically invalid, just fail */ if (group_handle == 0) goto sync_exit; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_add_to_group_async (self, tp_handle_inspect (self->priv->group_repo, group_handle), contacts_set, tp_base_contact_list_mixin_add_to_group_cb, context); tp_handle_set_destroy (contacts_set); return; sync_exit: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_from_group_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_remove_from_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_from_group ( TpSvcConnectionInterfaceContactGroups *svc, const gchar *group, const GArray *contacts, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandle group_handle; TpHandleSet *contacts_set; if (!tp_base_contact_list_check_group_change (self, contacts, &error)) goto sync_exit; /* get the handle so we can use the normalized name */ group_handle = tp_handle_lookup (self->priv->group_repo, group, NULL, NULL); /* removing from a group that doesn't exist is a no-op */ if (group_handle == 0) goto sync_exit; contacts_set = tp_handle_set_new_from_array (self->priv->contact_repo, contacts); tp_base_contact_list_remove_from_group_async (self, tp_handle_inspect (self->priv->group_repo, group_handle), contacts_set, tp_base_contact_list_mixin_remove_from_group_cb, context); tp_handle_set_destroy (contacts_set); return; sync_exit: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_group_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_remove_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_remove_group ( TpSvcConnectionInterfaceContactGroups *svc, const gchar *group, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandle group_handle; if (!tp_base_contact_list_check_group_change (self, NULL, &error)) goto sync_exit; /* get the handle so we can use the normalized name */ group_handle = tp_handle_lookup (self->priv->group_repo, group, NULL, NULL); /* removing from a group that doesn't exist is a no-op */ if (group_handle == 0) goto sync_exit; tp_base_contact_list_remove_group_async (self, group, tp_base_contact_list_mixin_remove_group_cb, context); return; sync_exit: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_rename_group_cb (GObject *source, GAsyncResult *result, gpointer context) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); GError *error = NULL; tp_base_contact_list_rename_group_finish (self, result, &error); tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } static void tp_base_contact_list_mixin_rename_group ( TpSvcConnectionInterfaceContactGroups *svc, const gchar *before, const gchar *after, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); GError *error = NULL; TpHandle old_handle; gpointer old_channel; TpHandle new_handle = 0; if (!tp_base_contact_list_check_group_change (self, NULL, &error)) goto sync_exit; old_handle = tp_handle_lookup (self->priv->group_repo, before, NULL, NULL); old_channel = g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (old_handle)); if (old_handle == 0 || old_channel == NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_DOES_NOT_EXIST, "Group '%s' does not exist", before); goto sync_exit; } new_handle = tp_handle_ensure (self->priv->group_repo, after, NULL, &error); if (new_handle == 0) goto sync_exit; if (g_hash_table_lookup (self->priv->groups, GUINT_TO_POINTER (new_handle)) != NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Group '%s' already exists", tp_handle_inspect (self->priv->group_repo, new_handle)); goto sync_exit; } tp_base_contact_list_rename_group_async (self, tp_handle_inspect (self->priv->group_repo, old_handle), tp_handle_inspect (self->priv->group_repo, new_handle), tp_base_contact_list_mixin_rename_group_cb, context); return; sync_exit: tp_base_contact_list_mixin_return_void (context, error); g_clear_error (&error); } typedef enum { GP_DISJOINT_GROUPS, GP_GROUP_STORAGE, GP_GROUPS, NUM_GROUP_PROPERTIES } GroupProp; static TpDBusPropertiesMixinPropImpl known_group_props[] = { { "DisjointGroups", GINT_TO_POINTER (GP_DISJOINT_GROUPS), }, { "GroupStorage", GINT_TO_POINTER (GP_GROUP_STORAGE) }, { "Groups", GINT_TO_POINTER (GP_GROUPS) }, { NULL } }; static void tp_base_contact_list_get_group_dbus_property (GObject *conn, GQuark interface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer data) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) conn, TP_TYPE_BASE_CONTACT_LIST); GroupProp p = GPOINTER_TO_INT (data); g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (self->priv->conn != NULL); switch (p) { case GP_DISJOINT_GROUPS: g_return_if_fail (G_VALUE_HOLDS_BOOLEAN (value)); g_value_set_boolean (value, tp_base_contact_list_has_disjoint_groups (self)); break; case GP_GROUP_STORAGE: g_return_if_fail (G_VALUE_HOLDS_UINT (value)); g_value_set_uint (value, tp_base_contact_list_get_group_storage (self)); break; case GP_GROUPS: g_return_if_fail (G_VALUE_HOLDS (value, G_TYPE_STRV)); if (self->priv->state == TP_CONTACT_LIST_STATE_SUCCESS) g_value_take_boxed (value, tp_base_contact_list_dup_groups (self)); break; default: g_return_if_reached (); } } static void tp_base_contact_list_fill_groups_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST); guint i; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_CONTACT_GROUP_LIST (self)); g_return_if_fail (self->priv->conn != NULL); /* just omit the attributes if the contact list hasn't come in yet */ if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; for (i = 0; i < contacts->len; i++) { TpHandle handle; handle = g_array_index (contacts, TpHandle, i); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_GROUPS_GROUPS, tp_g_value_slice_new_take_boxed (G_TYPE_STRV, tp_base_contact_list_dup_contact_groups (self, handle))); } } static void tp_base_contact_list_fill_blocking_contact_attributes (GObject *obj, const GArray *contacts, GHashTable *attributes_hash) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) obj, TP_TYPE_BASE_CONTACT_LIST); guint i; TpHandleSet *blocked; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_BLOCKABLE_CONTACT_LIST (self)); g_return_if_fail (self->priv->conn != NULL); /* just omit the attributes if the contact list hasn't come in yet */ if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) return; blocked = tp_base_contact_list_dup_blocked_contacts (self); for (i = 0; i < contacts->len; i++) { TpHandle handle; gboolean is_blocked; handle = g_array_index (contacts, TpHandle, i); is_blocked = tp_handle_set_is_member (blocked, handle); tp_contacts_mixin_set_contact_attribute (attributes_hash, handle, TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED, tp_g_value_slice_new_boolean (is_blocked)); } tp_handle_set_destroy (blocked); } /** * tp_base_contact_list_mixin_groups_iface_init: * @klass: the service-side D-Bus interface * * Use the #TpBaseContactList like a mixin, to implement the ContactGroups * D-Bus interface. * * This function should be passed to G_IMPLEMENT_INTERFACE() for * #TpSvcConnectionInterfaceContactGroups. * * Since: 0.13.0 */ void tp_base_contact_list_mixin_groups_iface_init ( TpSvcConnectionInterfaceContactGroupsClass *klass) { #define IMPLEMENT(x) tp_svc_connection_interface_contact_groups_implement_##x (\ klass, tp_base_contact_list_mixin_##x) IMPLEMENT (set_contact_groups); IMPLEMENT (set_group_members); IMPLEMENT (add_to_group); IMPLEMENT (remove_from_group); IMPLEMENT (remove_group); IMPLEMENT (rename_group); #undef IMPLEMENT } #define ERROR_IF_BLOCKING_NOT_SUPPORTED(self, context) \ if (!self->priv->svc_contact_blocking) \ { \ GError e = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, \ "ContactBlocking is not supported on this connection" }; \ dbus_g_method_return_error (context, &e); \ return; \ } static void tp_base_contact_list_mixin_request_blocked_contacts ( TpSvcConnectionInterfaceContactBlocking *svc, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); ERROR_IF_BLOCKING_NOT_SUPPORTED (self, context); switch (self->priv->state) { case TP_CONTACT_LIST_STATE_NONE: case TP_CONTACT_LIST_STATE_WAITING: g_queue_push_tail (&self->priv->blocked_contact_requests, context); break; case TP_CONTACT_LIST_STATE_FAILURE: g_warn_if_fail (self->priv->failure != NULL); dbus_g_method_return_error (context, self->priv->failure); break; case TP_CONTACT_LIST_STATE_SUCCESS: { TpHandleSet *blocked = tp_base_contact_list_dup_blocked_contacts (self); GHashTable *map = tp_handle_set_to_identifier_map (blocked); tp_svc_connection_interface_contact_blocking_return_from_request_blocked_contacts (context, map); g_hash_table_unref (map); tp_handle_set_destroy (blocked); break; } default: { GError broken = { TP_ERROR, TP_ERROR_CONFUSED, "My internal list of blocked contacts is inconsistent! " "I apologise for any inconvenience caused." }; dbus_g_method_return_error (context, &broken); g_return_if_reached (); } } } static void blocked_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); DBusGMethodInvocation *context = user_data; GError *error = NULL; if (tp_base_contact_list_block_contacts_with_abuse_finish (self, result, &error)) { tp_svc_connection_interface_contact_blocking_return_from_block_contacts ( context); } else { dbus_g_method_return_error (context, error); g_clear_error (&error); } } static void tp_base_contact_list_mixin_block_contacts ( TpSvcConnectionInterfaceContactBlocking *svc, const GArray *contacts_arr, gboolean report_abusive, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); TpHandleSet *contacts; ERROR_IF_BLOCKING_NOT_SUPPORTED (self, context); contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); tp_base_contact_list_block_contacts_with_abuse_async (self, contacts, report_abusive, blocked_cb, context); tp_handle_set_destroy (contacts); } static void unblocked_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseContactList *self = TP_BASE_CONTACT_LIST (source); DBusGMethodInvocation *context = user_data; GError *error = NULL; if (tp_base_contact_list_unblock_contacts_finish (self, result, &error)) { tp_svc_connection_interface_contact_blocking_return_from_unblock_contacts (context); } else { dbus_g_method_return_error (context, error); g_clear_error (&error); } } static void tp_base_contact_list_mixin_unblock_contacts ( TpSvcConnectionInterfaceContactBlocking *svc, const GArray *contacts_arr, DBusGMethodInvocation *context) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) svc, TP_TYPE_BASE_CONTACT_LIST); TpHandleSet *contacts; ERROR_IF_BLOCKING_NOT_SUPPORTED (self, context); contacts = tp_handle_set_new_from_array (self->priv->contact_repo, contacts_arr); tp_base_contact_list_unblock_contacts_async (self, contacts, unblocked_cb, context); tp_handle_set_destroy (contacts); } /** * tp_base_contact_list_mixin_blocking_iface_init: * @klass: the service-side D-Bus interface * * Use the #TpBaseContactList like a mixin, to implement the ContactBlocking * D-Bus interface. * * This function should be passed to G_IMPLEMENT_INTERFACE() for * #TpSvcConnectionInterfaceContactBlocking * * Since: 0.15.1 */ void tp_base_contact_list_mixin_blocking_iface_init ( TpSvcConnectionInterfaceContactBlockingClass *klass) { #define IMPLEMENT(x) tp_svc_connection_interface_contact_blocking_implement_##x (\ klass, tp_base_contact_list_mixin_##x) IMPLEMENT (block_contacts); IMPLEMENT (unblock_contacts); IMPLEMENT (request_blocked_contacts); #undef IMPLEMENT } static TpDBusPropertiesMixinPropImpl known_blocking_props[] = { { "ContactBlockingCapabilities" }, { NULL } }; static void tp_base_contact_list_get_blocking_dbus_property (GObject *conn, GQuark interface G_GNUC_UNUSED, GQuark name G_GNUC_UNUSED, GValue *value, gpointer data) { TpBaseContactList *self = _tp_base_connection_find_channel_manager ( (TpBaseConnection *) conn, TP_TYPE_BASE_CONTACT_LIST); TpBlockableContactListInterface *iface = TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE (self); static GQuark contact_blocking_capabilities_q = 0; guint flags = 0; g_return_if_fail (TP_IS_BASE_CONTACT_LIST (self)); g_return_if_fail (TP_IS_BLOCKABLE_CONTACT_LIST (self)); g_return_if_fail (self->priv->conn != NULL); if (G_UNLIKELY (contact_blocking_capabilities_q == 0)) contact_blocking_capabilities_q = g_quark_from_static_string ("ContactBlockingCapabilities"); g_return_if_fail (name == contact_blocking_capabilities_q); if (iface->block_contacts_with_abuse_async != NULL) flags |= TP_CONTACT_BLOCKING_CAPABILITY_CAN_REPORT_ABUSIVE; g_value_set_uint (value, flags); } /** * tp_base_contact_list_mixin_class_init: * @cls: A subclass of #TpBaseConnection that has a #TpContactsMixinClass, * and implements #TpSvcConnectionInterfaceContactList using * #TpBaseContactList * * Register the #TpBaseContactList to be used like a mixin in @cls. * Before this function is called, the #TpContactsMixin must be initialized * with tp_contacts_mixin_class_init(). * * If the connection implements #TpSvcConnectionInterfaceContactGroups, this * function automatically sets up that interface as well as ContactList. * In this case, when the #TpBaseContactList is created later, it must * implement %TP_TYPE_CONTACT_GROUP_LIST. * * Since: 0.13.0 */ void tp_base_contact_list_mixin_class_init (TpBaseConnectionClass *cls) { GType type = G_OBJECT_CLASS_TYPE (cls); GObjectClass *obj_cls = (GObjectClass *) cls; g_return_if_fail (TP_IS_BASE_CONNECTION_CLASS (cls)); g_return_if_fail (TP_CONTACTS_MIXIN_CLASS (cls) != NULL); g_return_if_fail (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST)); tp_dbus_properties_mixin_implement_interface (obj_cls, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST, tp_base_contact_list_get_list_dbus_property, NULL, known_list_props); if (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS)) { tp_dbus_properties_mixin_implement_interface (obj_cls, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_GROUPS, tp_base_contact_list_get_group_dbus_property, NULL, known_group_props); } if (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING)) { tp_dbus_properties_mixin_implement_interface (obj_cls, TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING, tp_base_contact_list_get_blocking_dbus_property, NULL, known_blocking_props); } } /** * tp_base_contact_list_mixin_register_with_contacts_mixin: * @conn: An instance of #TpBaseConnection that uses a #TpContactsMixin, * and implements #TpSvcConnectionInterfaceContactList using * #TpBaseContactList * * Register the ContactList interface with the Contacts interface to make it * inspectable. Before this function is called, the #TpContactsMixin must be * initialized with tp_contacts_mixin_init(), and @conn must have a * #TpBaseContactList in its list of channel managers (by creating it in * its #TpBaseConnectionClass.create_channel_managers implementation). * * If the connection implements #TpSvcConnectionInterfaceContactGroups * the #TpBaseContactList implements %TP_TYPE_CONTACT_GROUP_LIST, * this function automatically also registers the ContactGroups interface * with the contacts mixin. * * Since: 0.13.0 */ void tp_base_contact_list_mixin_register_with_contacts_mixin ( TpBaseConnection *conn) { TpBaseContactList *self; GType type = G_OBJECT_TYPE (conn); GObject *object = (GObject *) conn; g_return_if_fail (TP_IS_BASE_CONNECTION (conn)); self = _tp_base_connection_find_channel_manager (conn, TP_TYPE_BASE_CONTACT_LIST); g_return_if_fail (self != NULL); g_return_if_fail (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST)); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, tp_base_contact_list_fill_list_contact_attributes); if (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS) && TP_IS_CONTACT_GROUP_LIST (self)) { tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, tp_base_contact_list_fill_groups_contact_attributes); } if (g_type_is_a (type, TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING) && TP_IS_BLOCKABLE_CONTACT_LIST (self)) { tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, tp_base_contact_list_fill_blocking_contact_attributes); } } /** * tp_base_contact_list_get_state: * @self: a contact list * @error: used to raise an error if something other than * %TP_CONTACT_LIST_STATE_SUCCESS is returned * * Return how much progress this object has made towards retrieving the * contact list. * * If this contact list's connection has disconnected, or retrieving the * contact list has failed, return %TP_CONTACT_LIST_STATE_FAILURE. * * Returns: the state of the contact list * * Since: 0.13.0 */ TpContactListState tp_base_contact_list_get_state (TpBaseContactList *self, GError **error) { /* this checks TP_IS_BASE_CONTACT_LIST */ if (tp_base_contact_list_get_connection (self, error) == NULL) return TP_CONTACT_LIST_STATE_FAILURE; if (self->priv->failure != NULL) { g_set_error_literal (error, self->priv->failure->domain, self->priv->failure->code, self->priv->failure->message); return TP_CONTACT_LIST_STATE_FAILURE; } /* on failure, self->priv->failure was meant to be set */ g_return_val_if_fail (self->priv->state != TP_CONTACT_LIST_STATE_FAILURE, TP_CONTACT_LIST_STATE_FAILURE); if (self->priv->state != TP_CONTACT_LIST_STATE_SUCCESS) g_set_error (error, TP_ERROR, TP_ERROR_NOT_YET, "Contact list not downloaded yet"); return self->priv->state; } /** * tp_base_contact_list_get_connection: * @self: a contact list * @error: used to raise an error if %NULL is returned * * Return the Connection this contact list uses. If this contact list's * connection has already disconnected, return %NULL instead. * * Returns: (transfer none): the connection, or %NULL * * Since: 0.13.0 */ TpBaseConnection * tp_base_contact_list_get_connection (TpBaseContactList *self, GError **error) { g_return_val_if_fail (TP_IS_BASE_CONTACT_LIST (self), NULL); if (self->priv->conn == NULL) { g_set_error_literal (error, TP_ERROR, TP_ERROR_DISCONNECTED, "Connection is no longer connected"); return NULL; } return self->priv->conn; } telepathy-glib-0.24.2/telepathy-glib/base-contact-list.h0000644000175000017500000004712112652510705020041 00000000000000/* ContactList channel manager * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_CONTACT_LIST_H__ #define __TP_BASE_CONTACT_LIST_H__ #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpBaseContactList TpBaseContactList; typedef struct _TpBaseContactListClass TpBaseContactListClass; typedef struct _TpBaseContactListPrivate TpBaseContactListPrivate; typedef struct _TpBaseContactListClassPrivate TpBaseContactListClassPrivate; struct _TpBaseContactList { /**/ GObject parent; TpBaseContactListPrivate *priv; }; GType tp_base_contact_list_get_type (void); #define TP_TYPE_BASE_CONTACT_LIST \ (tp_base_contact_list_get_type ()) #define TP_BASE_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASE_CONTACT_LIST, \ TpBaseContactList)) #define TP_BASE_CONTACT_LIST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASE_CONTACT_LIST, \ TpBaseContactListClass)) #define TP_IS_BASE_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASE_CONTACT_LIST)) #define TP_IS_BASE_CONTACT_LIST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASE_CONTACT_LIST)) #define TP_BASE_CONTACT_LIST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONTACT_LIST, \ TpBaseContactListClass)) /* ---- Utility stuff which subclasses can use ---- */ TpContactListState tp_base_contact_list_get_state (TpBaseContactList *self, GError **error); TpBaseConnection *tp_base_contact_list_get_connection ( TpBaseContactList *self, GError **error); _TP_AVAILABLE_IN_0_18 gboolean tp_base_contact_list_get_download_at_connection ( TpBaseContactList *self); /* ---- Called by subclasses for ContactList (or both) ---- */ void tp_base_contact_list_set_list_pending (TpBaseContactList *self); void tp_base_contact_list_set_list_failed (TpBaseContactList *self, GQuark domain, gint code, const gchar *message); void tp_base_contact_list_set_list_received (TpBaseContactList *self); void tp_base_contact_list_contacts_changed (TpBaseContactList *self, TpHandleSet *changed, TpHandleSet *removed); void tp_base_contact_list_one_contact_changed (TpBaseContactList *self, TpHandle changed); void tp_base_contact_list_one_contact_removed (TpBaseContactList *self, TpHandle removed); /* ---- Implemented by subclasses for ContactList (mandatory read-only * things) ---- */ typedef gboolean (*TpBaseContactListBooleanFunc) ( TpBaseContactList *self); gboolean tp_base_contact_list_true_func (TpBaseContactList *self); gboolean tp_base_contact_list_false_func (TpBaseContactList *self); gboolean tp_base_contact_list_get_contact_list_persists ( TpBaseContactList *self); typedef TpHandleSet *(*TpBaseContactListDupContactsFunc) ( TpBaseContactList *self); TpHandleSet *tp_base_contact_list_dup_contacts (TpBaseContactList *self); typedef void (*TpBaseContactListDupStatesFunc) ( TpBaseContactList *self, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request); void tp_base_contact_list_dup_states (TpBaseContactList *self, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request); typedef void (*TpBaseContactListAsyncFunc) ( TpBaseContactList *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 void tp_base_contact_list_download_async (TpBaseContactList *self, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_base_contact_list_download_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); typedef gboolean (*TpBaseContactListAsyncFinishFunc) (TpBaseContactList *self, GAsyncResult *result, GError **error); struct _TpBaseContactListClass { GObjectClass parent_class; TpBaseContactListDupContactsFunc dup_contacts; TpBaseContactListDupStatesFunc dup_states; TpBaseContactListBooleanFunc get_contact_list_persists; TpBaseContactListAsyncFunc download_async; TpBaseContactListAsyncFinishFunc download_finish; /**/ GCallback _padding[5]; TpBaseContactListClassPrivate *priv; }; /* ---- Implemented by subclasses for ContactList modification ---- */ #define TP_TYPE_MUTABLE_CONTACT_LIST \ (tp_mutable_contact_list_get_type ()) #define TP_IS_MUTABLE_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_MUTABLE_CONTACT_LIST)) #define TP_MUTABLE_CONTACT_LIST_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_MUTABLE_CONTACT_LIST, TpMutableContactListInterface)) typedef struct _TpMutableContactListInterface TpMutableContactListInterface; typedef void (*TpBaseContactListRequestSubscriptionFunc) ( TpBaseContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); typedef void (*TpBaseContactListActOnContactsFunc) ( TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); struct _TpMutableContactListInterface { GTypeInterface parent; /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ TpBaseContactListRequestSubscriptionFunc request_subscription_async; TpBaseContactListAsyncFinishFunc request_subscription_finish; TpBaseContactListActOnContactsFunc authorize_publication_async; TpBaseContactListAsyncFinishFunc authorize_publication_finish; TpBaseContactListActOnContactsFunc remove_contacts_async; TpBaseContactListAsyncFinishFunc remove_contacts_finish; TpBaseContactListActOnContactsFunc unsubscribe_async; TpBaseContactListAsyncFinishFunc unsubscribe_finish; TpBaseContactListActOnContactsFunc unpublish_async; TpBaseContactListAsyncFinishFunc unpublish_finish; /* optional-to-implement */ TpBaseContactListActOnContactsFunc store_contacts_async; TpBaseContactListAsyncFinishFunc store_contacts_finish; TpBaseContactListBooleanFunc can_change_contact_list; TpBaseContactListBooleanFunc get_request_uses_message; }; GType tp_mutable_contact_list_get_type (void) G_GNUC_CONST; gboolean tp_base_contact_list_can_change_contact_list ( TpBaseContactList *self); gboolean tp_base_contact_list_get_request_uses_message ( TpBaseContactList *self); void tp_base_contact_list_request_subscription_async (TpBaseContactList *self, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_request_subscription_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_authorize_publication_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_authorize_publication_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_store_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_store_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_remove_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_unsubscribe_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_unpublish_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_unpublish_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); /* ---- contact blocking ---- */ #define TP_TYPE_BLOCKABLE_CONTACT_LIST \ (tp_blockable_contact_list_get_type ()) GType tp_blockable_contact_list_get_type (void) G_GNUC_CONST; #define TP_IS_BLOCKABLE_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_BLOCKABLE_CONTACT_LIST)) #define TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_BLOCKABLE_CONTACT_LIST, TpBlockableContactListInterface)) typedef struct _TpBlockableContactListInterface TpBlockableContactListInterface; void tp_base_contact_list_contact_blocking_changed ( TpBaseContactList *self, TpHandleSet *changed); gboolean tp_base_contact_list_can_block (TpBaseContactList *self); TpHandleSet *tp_base_contact_list_dup_blocked_contacts ( TpBaseContactList *self); void tp_base_contact_list_block_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_block_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); _TP_AVAILABLE_IN_0_16 void tp_base_contact_list_block_contacts_with_abuse_async ( TpBaseContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_16 gboolean tp_base_contact_list_block_contacts_with_abuse_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); typedef void (*TpBaseContactListBlockContactsWithAbuseFunc) ( TpBaseContactList *self, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data); struct _TpBlockableContactListInterface { GTypeInterface parent; /* mandatory to implement */ TpBaseContactListDupContactsFunc dup_blocked_contacts; /* unblock_contacts_async is mandatory to implement; either * block_contacts_async or block_contacts_with_abuse_async (but not both!) * must also be implemented. _finish have default implementations * suitable for a GSimpleAsyncResult */ TpBaseContactListActOnContactsFunc block_contacts_async; TpBaseContactListAsyncFinishFunc block_contacts_finish; TpBaseContactListActOnContactsFunc unblock_contacts_async; TpBaseContactListAsyncFinishFunc unblock_contacts_finish; /* optional to implement */ TpBaseContactListBooleanFunc can_block; /* see above. block_contacts_finish is the corresponding _finish function. */ TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async; }; /* ---- Called by subclasses for ContactGroups ---- */ void tp_base_contact_list_groups_created (TpBaseContactList *self, const gchar * const *created, gssize n_created); void tp_base_contact_list_groups_removed (TpBaseContactList *self, const gchar * const *removed, gssize n_removed); void tp_base_contact_list_group_renamed (TpBaseContactList *self, const gchar *old_name, const gchar *new_name); void tp_base_contact_list_groups_changed (TpBaseContactList *self, TpHandleSet *contacts, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed); void tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self, TpHandle contact, const gchar * const *added, gssize n_added, const gchar * const *removed, gssize n_removed); /* ---- Implemented by subclasses for ContactGroups ---- */ gboolean tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self); typedef GStrv (*TpBaseContactListDupGroupsFunc) ( TpBaseContactList *self); GStrv tp_base_contact_list_dup_groups (TpBaseContactList *self); typedef GStrv (*TpBaseContactListDupContactGroupsFunc) ( TpBaseContactList *self, TpHandle contact); GStrv tp_base_contact_list_dup_contact_groups (TpBaseContactList *self, TpHandle contact); typedef TpHandleSet *(*TpBaseContactListDupGroupMembersFunc) ( TpBaseContactList *self, const gchar *group); TpHandleSet *tp_base_contact_list_dup_group_members (TpBaseContactList *self, const gchar *group); typedef gchar *(*TpBaseContactListNormalizeFunc) ( TpBaseContactList *self, const gchar *s); gchar *tp_base_contact_list_normalize_group ( TpBaseContactList *self, const gchar *s); #define TP_TYPE_CONTACT_GROUP_LIST \ (tp_contact_group_list_get_type ()) GType tp_contact_group_list_get_type (void) G_GNUC_CONST; #define TP_IS_CONTACT_GROUP_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_CONTACT_GROUP_LIST)) #define TP_CONTACT_GROUP_LIST_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_CONTACT_GROUP_LIST, TpContactGroupListInterface)) typedef struct _TpContactGroupListInterface TpContactGroupListInterface; struct _TpContactGroupListInterface { GTypeInterface parent; /* mandatory to implement */ TpBaseContactListDupGroupsFunc dup_groups; TpBaseContactListDupGroupMembersFunc dup_group_members; TpBaseContactListDupContactGroupsFunc dup_contact_groups; /* optional to implement */ TpBaseContactListBooleanFunc has_disjoint_groups; TpBaseContactListNormalizeFunc normalize_group; }; /* ---- Implemented by subclasses for mutable ContactGroups ---- */ typedef guint (*TpBaseContactListUIntFunc) ( TpBaseContactList *self); TpContactMetadataStorageType tp_base_contact_list_get_group_storage ( TpBaseContactList *self); typedef void (*TpBaseContactListSetContactGroupsFunc) (TpBaseContactList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, GAsyncReadyCallback callback, gpointer user_data); void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self, TpHandle contact, const gchar * const *normalized_names, gsize n_names, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_set_contact_groups_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); typedef void (*TpBaseContactListGroupContactsFunc) (TpBaseContactList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); void tp_base_contact_list_add_to_group_async (TpBaseContactList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_add_to_group_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_remove_from_group_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); void tp_base_contact_list_set_group_members_async (TpBaseContactList *self, const gchar *normalized_group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_set_group_members_finish ( TpBaseContactList *self, GAsyncResult *result, GError **error); typedef void (*TpBaseContactListRemoveGroupFunc) (TpBaseContactList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); void tp_base_contact_list_remove_group_async (TpBaseContactList *self, const gchar *group, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_remove_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); typedef void (*TpBaseContactListRenameGroupFunc) (TpBaseContactList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data); void tp_base_contact_list_rename_group_async (TpBaseContactList *self, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_base_contact_list_rename_group_finish (TpBaseContactList *self, GAsyncResult *result, GError **error); #define TP_TYPE_MUTABLE_CONTACT_GROUP_LIST \ (tp_mutable_contact_group_list_get_type ()) GType tp_mutable_contact_group_list_get_type (void) G_GNUC_CONST; #define TP_IS_MUTABLE_CONTACT_GROUP_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ TP_TYPE_MUTABLE_CONTACT_GROUP_LIST)) #define TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE(obj) \ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), \ TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, TpMutableContactGroupListInterface)) typedef struct _TpMutableContactGroupListInterface TpMutableContactGroupListInterface; struct _TpMutableContactGroupListInterface { GTypeInterface parent; /* _async mandatory-to-implement, _finish has a default implementation * suitable for a GSimpleAsyncResult */ TpBaseContactListSetContactGroupsFunc set_contact_groups_async; TpBaseContactListAsyncFinishFunc set_contact_groups_finish; TpBaseContactListGroupContactsFunc set_group_members_async; TpBaseContactListAsyncFinishFunc set_group_members_finish; TpBaseContactListGroupContactsFunc add_to_group_async; TpBaseContactListAsyncFinishFunc add_to_group_finish; TpBaseContactListGroupContactsFunc remove_from_group_async; TpBaseContactListAsyncFinishFunc remove_from_group_finish; TpBaseContactListRemoveGroupFunc remove_group_async; TpBaseContactListAsyncFinishFunc remove_group_finish; /* optional to implement */ TpBaseContactListRenameGroupFunc rename_group_async; TpBaseContactListAsyncFinishFunc rename_group_finish; TpBaseContactListUIntFunc get_group_storage; }; /* ---- Mixin-like functionality for our parent TpBaseConnection ---- */ void tp_base_contact_list_mixin_class_init (TpBaseConnectionClass *cls); void tp_base_contact_list_mixin_register_with_contacts_mixin ( TpBaseConnection *conn); void tp_base_contact_list_mixin_list_iface_init ( TpSvcConnectionInterfaceContactListClass *klass); void tp_base_contact_list_mixin_groups_iface_init ( TpSvcConnectionInterfaceContactGroupsClass *klass); _TP_AVAILABLE_IN_0_16 void tp_base_contact_list_mixin_blocking_iface_init ( TpSvcConnectionInterfaceContactBlockingClass *klass); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel-request.xml0000644000175000017500000000034312652510705020167 00000000000000 CR interfaces telepathy-glib-0.24.2/telepathy-glib/dbus-daemon.xml0000644000175000017500000000612012652510705017266 00000000000000 D-Bus Daemon telepathy-glib-0.24.2/telepathy-glib/add-dispatch-operation-context.c0000644000175000017500000004127012652510705022524 00000000000000/* * objects for AddDispatchOperation calls * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:add-dispatch-operation-context * @title: TpAddDispatchOperationContext * @short_description: context of a Approver.AddDispatchOperation() call * * Object used to represent the context of a Approver.AddDispatchOperation() * D-Bus call on a #TpBaseClient. */ /** * TpAddDispatchOperationContext: * * Data structure representing the context of a Approver.AddDispatchOperation() * call. * * Since: 0.11.5 */ /** * TpAddDispatchOperationContextClass: * * The class of a #TpAddDispatchOperationContext. * * Since: 0.11.5 */ #include "config.h" #include "telepathy-glib/add-dispatch-operation-context-internal.h" #include "telepathy-glib/add-dispatch-operation-context.h" #include #include #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" struct _TpAddDispatchOperationContextClass { /**/ GObjectClass parent_class; }; G_DEFINE_TYPE(TpAddDispatchOperationContext, tp_add_dispatch_operation_context, G_TYPE_OBJECT) enum { PROP_ACCOUNT = 1, PROP_CONNECTION, PROP_CHANNELS, PROP_DISPATCH_OPERATION, PROP_DBUS_CONTEXT, N_PROPS }; struct _TpAddDispatchOperationContextPrivate { TpAddDispatchOperationContextState state; GSimpleAsyncResult *result; DBusGMethodInvocation *dbus_context; /* Number of calls we are waiting they return. Once they have all returned * the context is considered as prepared */ guint num_pending; }; static void tp_add_dispatch_operation_context_init (TpAddDispatchOperationContext *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT, TpAddDispatchOperationContextPrivate); self->priv->state = TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE; } static void tp_add_dispatch_operation_context_dispose (GObject *object) { TpAddDispatchOperationContext *self = TP_ADD_DISPATCH_OPERATION_CONTEXT ( object); void (*dispose) (GObject *) = G_OBJECT_CLASS (tp_add_dispatch_operation_context_parent_class)->dispose; if (self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE || self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DELAYED) { GError error = { TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Disposing the TpAddDispatchOperationContext" }; WARNING ("Disposing a context in the %s state", self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE ? "none": "delayed"); tp_add_dispatch_operation_context_fail (self, &error); } if (self->account != NULL) { g_object_unref (self->account); self->account = NULL; } if (self->connection != NULL) { g_object_unref (self->connection); self->connection = NULL; } if (self->channels != NULL) { g_ptr_array_unref (self->channels); self->channels = NULL; } if (self->dispatch_operation != NULL) { g_object_unref (self->dispatch_operation); self->dispatch_operation = NULL; } if (self->priv->result != NULL) { g_object_unref (self->priv->result); self->priv->result = NULL; } if (dispose != NULL) dispose (object); } static void tp_add_dispatch_operation_context_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpAddDispatchOperationContext *self = TP_ADD_DISPATCH_OPERATION_CONTEXT ( object); switch (property_id) { case PROP_ACCOUNT: g_value_set_object (value, self->account); break; case PROP_CONNECTION: g_value_set_object (value, self->connection); break; case PROP_CHANNELS: g_value_set_boxed (value, self->channels); break; case PROP_DISPATCH_OPERATION: g_value_set_object (value, self->dispatch_operation); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_add_dispatch_operation_context_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpAddDispatchOperationContext *self = TP_ADD_DISPATCH_OPERATION_CONTEXT ( object); switch (property_id) { case PROP_ACCOUNT: self->account = g_value_dup_object (value); break; case PROP_CONNECTION: self->connection = g_value_dup_object (value); break; case PROP_CHANNELS: self->channels = g_value_dup_boxed (value); break; case PROP_DISPATCH_OPERATION: self->dispatch_operation = g_value_dup_object (value); break; case PROP_DBUS_CONTEXT: self->priv->dbus_context = g_value_get_pointer (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_add_dispatch_operation_context_constructed (GObject *object) { TpAddDispatchOperationContext *self = TP_ADD_DISPATCH_OPERATION_CONTEXT ( object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_add_dispatch_operation_context_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_assert (self->account != NULL); g_assert (self->connection != NULL); g_assert (self->channels != NULL); g_assert (self->dispatch_operation != NULL); g_assert (self->priv->dbus_context != NULL); } static void tp_add_dispatch_operation_context_class_init ( TpAddDispatchOperationContextClass *cls) { GObjectClass *object_class = G_OBJECT_CLASS (cls); GParamSpec *param_spec; g_type_class_add_private (cls, sizeof (TpAddDispatchOperationContextPrivate)); object_class->get_property = tp_add_dispatch_operation_context_get_property; object_class->set_property = tp_add_dispatch_operation_context_set_property; object_class->constructed = tp_add_dispatch_operation_context_constructed; object_class->dispose = tp_add_dispatch_operation_context_dispose; /** * TpAddDispatchOperationContext:account: * * A #TpAccount object representing the Account of the DispatchOperation * that has been passed to AddDispatchOperation. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("account", "TpAccount", "The TpAccount of the context", TP_TYPE_ACCOUNT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); /** * TpAddDispatchOperationContext:connection: * * A #TpConnection object representing the Connection of the DispatchOperation * that has been passed to AddDispatchOperation. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("connection", "TpConnection", "The TpConnection of the context", TP_TYPE_CONNECTION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); /** * TpAddDispatchOperationContext:channels: * * A #GPtrArray containing #TpChannel objects representing the channels * that have been passed to AddDispatchOperation. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_boxed ("channels", "GPtrArray of TpChannel", "The TpChannels that have been passed to AddDispatchOperation", G_TYPE_PTR_ARRAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CHANNELS, param_spec); /** * TpAddDispatchOperationContext:dispatch-operation: * * A #TpChannelDispatchOperation object representing the * ChannelDispatchOperation that has been passed to AddDispatchOperation. * Read-only except during construction. * * This property can't be %NULL. * * Since: 0.11.5 */ param_spec = g_param_spec_object ("dispatch-operation", "TpChannelDispatchOperation", "The TpChannelDispatchOperation that has been passed to " "AddDispatchOperation", TP_TYPE_CHANNEL_DISPATCH_OPERATION, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DISPATCH_OPERATION, param_spec); /** * TpAddDispatchOperationContext:dbus-context: (skip) * * The #DBusGMethodInvocation representing the D-Bus context of the * AddDispatchOperation call. * Can only be written during construction. * * Since: 0.11.5 */ param_spec = g_param_spec_pointer ("dbus-context", "D-Bus context", "The DBusGMethodInvocation associated with the AddDispatchOperation call", G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_CONTEXT, param_spec); } TpAddDispatchOperationContext * _tp_add_dispatch_operation_context_new ( TpAccount *account, TpConnection *connection, GPtrArray *channels, TpChannelDispatchOperation *dispatch_operation, DBusGMethodInvocation *dbus_context) { return g_object_new (TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT, "account", account, "connection", connection, "channels", channels, "dispatch-operation", dispatch_operation, "dbus-context", dbus_context, NULL); } /** * tp_add_dispatch_operation_context_accept: * @self: a #TpAddDispatchOperationContext * * Called by #TpBaseClientClassAddDispatchOperationImpl when it's done so * the D-Bus method can return. * * Since: 0.11.5 */ void tp_add_dispatch_operation_context_accept (TpAddDispatchOperationContext *self) { g_return_if_fail (self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE || self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DONE; dbus_g_method_return (self->priv->dbus_context); self->priv->dbus_context = NULL; } /** * tp_add_dispatch_operation_context_fail: * @self: a #TpAddDispatchOperationContext * @error: the error to return from the method * * Called by #TpBaseClientClassAddDispatchOperationImpl to raise a D-Bus error. * * Since: 0.11.5 */ void tp_add_dispatch_operation_context_fail (TpAddDispatchOperationContext *self, const GError *error) { g_return_if_fail (self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE || self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DELAYED); g_return_if_fail (self->priv->dbus_context != NULL); self->priv->state = TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_FAILED; dbus_g_method_return_error (self->priv->dbus_context, error); self->priv->dbus_context = NULL; } /** * tp_add_dispatch_operation_context_delay: * @self: a #TpAddDispatchOperationContext * * Called by #TpBaseClientClassAddDispatchOperationImpl to indicate that it * implements the method in an async way. The caller must take a reference * to the #TpAddDispatchOperationContext before calling this function, and * is responsible for calling either * tp_add_dispatch_operation_context_accept() or * tp_add_dispatch_operation_context_fail() later. * * Since: 0.11.5 */ void tp_add_dispatch_operation_context_delay (TpAddDispatchOperationContext *self) { g_return_if_fail (self->priv->state == TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_NONE); self->priv->state = TP_ADD_DISPATCH_OPERATION_CONTEXT_STATE_DELAYED; } TpAddDispatchOperationContextState _tp_add_dispatch_operation_context_get_state ( TpAddDispatchOperationContext *self) { return self->priv->state; } static gboolean context_is_prepared (TpAddDispatchOperationContext *self) { return self->priv->num_pending == 0; } static void context_check_prepare (TpAddDispatchOperationContext *self) { if (!context_is_prepared (self)) return; /* is prepared */ g_simple_async_result_complete (self->priv->result); g_object_unref (self->priv->result); self->priv->result = NULL; } static void cdo_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpAddDispatchOperationContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare ChannelDispatchOperation: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void account_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpAddDispatchOperationContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare account: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void conn_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpAddDispatchOperationContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare connection: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void adoc_channel_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpAddDispatchOperationContext *self = user_data; GError *error = NULL; if (self->priv->result == NULL) goto out; if (!tp_proxy_prepare_finish (source, result, &error)) { DEBUG ("Failed to prepare channel: %s", error->message); g_error_free (error); } self->priv->num_pending--; context_check_prepare (self); out: g_object_unref (self); } static void context_prepare (TpAddDispatchOperationContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features) { GQuark cdo_features[] = { TP_CHANNEL_DISPATCH_OPERATION_FEATURE_CORE, 0 }; guint i; self->priv->num_pending = 3; tp_proxy_prepare_async (self->account, account_features, account_prepare_cb, g_object_ref (self)); tp_proxy_prepare_async (self->connection, connection_features, conn_prepare_cb, g_object_ref (self)); tp_proxy_prepare_async (self->dispatch_operation, cdo_features, cdo_prepare_cb, g_object_ref (self)); for (i = 0; i < self->channels->len; i++) { TpChannel *channel = g_ptr_array_index (self->channels, i); self->priv->num_pending++; tp_proxy_prepare_async (channel, channel_features, adoc_channel_prepare_cb, g_object_ref (self)); } } void _tp_add_dispatch_operation_context_prepare_async ( TpAddDispatchOperationContext *self, const GQuark *account_features, const GQuark *connection_features, const GQuark *channel_features, GAsyncReadyCallback callback, gpointer user_data) { g_return_if_fail (TP_IS_ADD_DISPATCH_OPERATION_CONTEXT (self)); /* This is only used once, by TpBaseClient, so for simplicity, we only * allow one asynchronous preparation */ g_return_if_fail (self->priv->result == NULL); self->priv->result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, _tp_add_dispatch_operation_context_prepare_async); context_prepare (self, account_features, connection_features, channel_features); } gboolean _tp_add_dispatch_operation_context_prepare_finish ( TpAddDispatchOperationContext *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, _tp_add_dispatch_operation_context_prepare_async); } telepathy-glib-0.24.2/telepathy-glib/add-dispatch-operation-context.h0000644000175000017500000000546312652510705022535 00000000000000/* * objects for AddDispatchOperation calls * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_ADD_DISPATCH_OPERATION_CONTEXT_H__ #define __TP_ADD_DISPATCH_OPERATION_CONTEXT_H__ #include #include G_BEGIN_DECLS typedef struct _TpAddDispatchOperationContext TpAddDispatchOperationContext; typedef struct _TpAddDispatchOperationContextClass \ TpAddDispatchOperationContextClass; typedef struct _TpAddDispatchOperationContextPrivate \ TpAddDispatchOperationContextPrivate; GType tp_add_dispatch_operation_context_get_type (void); #define TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT \ (tp_add_dispatch_operation_context_get_type ()) #define TP_ADD_DISPATCH_OPERATION_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT, \ TpAddDispatchOperationContext)) #define TP_ADD_DISPATCH_OPERATION_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT, \ TpAddDispatchOperationContextClass)) #define TP_IS_ADD_DISPATCH_OPERATION_CONTEXT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT)) #define TP_IS_ADD_DISPATCH_OPERATION_CONTEXT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT)) #define TP_ADD_DISPATCH_OPERATION_CONTEXT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT, \ TpAddDispatchOperationContextClass)) void tp_add_dispatch_operation_context_accept ( TpAddDispatchOperationContext *self); void tp_add_dispatch_operation_context_fail ( TpAddDispatchOperationContext *self, const GError *error); void tp_add_dispatch_operation_context_delay ( TpAddDispatchOperationContext *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/tls-certificate-rejection.c0000644000175000017500000002137412652510705021564 00000000000000/* * tls-certificate-rejection.c * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "tls-certificate-rejection.h" #include "tls-certificate-rejection-internal.h" /** * SECTION: tls-certificate-rejection * @title: TpTLSCertificateRejection * @short_description: a certificate rejection * * TpTLSCertificateRejection is a small object used by * #TpTLSCertificate to represent the rejection of a * certificate. */ /** * TpTLSCertificateRejection: * * Data structure representing a #TpTLSCertificateRejection. * * Since: 0.19.0 */ /** * TpTLSCertificateRejectionClass: * * The class of a #TpTLSCertificateRejection. * * Since: 0.19.0 */ G_DEFINE_TYPE (TpTLSCertificateRejection, tp_tls_certificate_rejection, G_TYPE_OBJECT) enum { PROP_REASON = 1, PROP_DBUS_ERROR, PROP_DETAILS, PROP_ERROR, N_PROPS }; struct _TpTLSCertificateRejectionPriv { TpTLSCertificateRejectReason reason; gchar *dbus_error; GVariant *details; GError *error; }; static void tp_tls_certificate_rejection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpTLSCertificateRejection *self = TP_TLS_CERTIFICATE_REJECTION (object); switch (property_id) { case PROP_REASON: g_value_set_uint (value, self->priv->reason); break; case PROP_DBUS_ERROR: g_value_set_string (value, self->priv->dbus_error); break; case PROP_DETAILS: g_value_set_variant (value, self->priv->details); break; case PROP_ERROR: g_value_set_boxed (value, self->priv->error); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tls_certificate_rejection_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpTLSCertificateRejection *self = TP_TLS_CERTIFICATE_REJECTION (object); switch (property_id) { case PROP_REASON: self->priv->reason = g_value_get_uint (value); break; case PROP_DBUS_ERROR: g_assert (self->priv->dbus_error == NULL); /* construct only */ self->priv->dbus_error = g_value_dup_string (value); break; case PROP_DETAILS: self->priv->details = g_value_dup_variant (value); break; case PROP_ERROR: self->priv->error = g_value_dup_boxed (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_tls_certificate_rejection_dispose (GObject *object) { TpTLSCertificateRejection *self = TP_TLS_CERTIFICATE_REJECTION (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tls_certificate_rejection_parent_class)->dispose; g_variant_unref (self->priv->details); if (chain_up != NULL) chain_up (object); } static void tp_tls_certificate_rejection_finalize (GObject *object) { TpTLSCertificateRejection *self = TP_TLS_CERTIFICATE_REJECTION (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_tls_certificate_rejection_parent_class)->finalize; g_free (self->priv->dbus_error); if (chain_up != NULL) chain_up (object); } static void tp_tls_certificate_rejection_class_init ( TpTLSCertificateRejectionClass *klass) { GObjectClass *oclass = G_OBJECT_CLASS (klass); GParamSpec *spec; oclass->get_property = tp_tls_certificate_rejection_get_property; oclass->set_property = tp_tls_certificate_rejection_set_property; oclass->dispose = tp_tls_certificate_rejection_dispose; oclass->finalize = tp_tls_certificate_rejection_finalize; /** * TpTLSCertificateRejection:reason: * * #TpTLSCertificateRejectReason representing the reason of the rejection * * Since: 0.19.0 */ spec = g_param_spec_uint ("reason", "reason", "TpTLSCertificateRejectReason", TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN, TP_NUM_TLS_CERTIFICATE_REJECT_REASONS, TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_REASON, spec); /** * TpTLSCertificateRejection:dbus-error: * * The D-Bus error name of the rejection * * Since: 0.19.0 */ spec = g_param_spec_string ("dbus-error", "dbus-error", "DBus error", NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_DBUS_ERROR, spec); /** * TpTLSCertificateRejection:details: * * A #G_VARIANT_TYPE_VARDICT containing the details of the rejection * * Since: 0.19.0 */ spec = g_param_spec_variant ("details", "details", "GVariant", G_VARIANT_TYPE_VARDICT, NULL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_DETAILS, spec); /** * TpTLSCertificateRejection:error: * * a #GError (likely to be in the %TP_ERROR domain) indicating the reason * of the rejection * * Since: 0.19.0 */ spec = g_param_spec_boxed ("error", "error", "GError", G_TYPE_ERROR, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (oclass, PROP_ERROR, spec); g_type_class_add_private (klass, sizeof (TpTLSCertificateRejectionPriv)); } static void tp_tls_certificate_rejection_init (TpTLSCertificateRejection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_TLS_CERTIFICATE_REJECTION, TpTLSCertificateRejectionPriv); } /* @details is sinked if it's a floating reference */ TpTLSCertificateRejection * _tp_tls_certificate_rejection_new ( GError *error, TpTLSCertificateRejectReason reason, const gchar *dbus_error, GVariant *details) { TpTLSCertificateRejection *ret; g_variant_ref_sink (details); ret = g_object_new (TP_TYPE_TLS_CERTIFICATE_REJECTION, "error", error, "reason", reason, "dbus-error", dbus_error, "details", details, NULL); g_variant_unref (details); return ret; } /** * tp_tls_certificate_rejection_get_error: * @self: a #TpTLSCertificateRejection * * Return the #TpTLSCertificateRejection:error property * * Returns: the value of #TpTLSCertificateRejection:error property * * Since: 0.19.0 */ const GError * tp_tls_certificate_rejection_get_error (TpTLSCertificateRejection *self) { return self->priv->error; } /** * tp_tls_certificate_rejection_get_reason: * @self: a #TpTLSCertificateRejection * * Return the #TpTLSCertificateRejection:reason property * * Returns: the value of #TpTLSCertificateRejection:reason property * * Since: 0.19.0 */ TpTLSCertificateRejectReason tp_tls_certificate_rejection_get_reason (TpTLSCertificateRejection *self) { return self->priv->reason; } /** * tp_tls_certificate_rejection_get_dbus_error: * @self: a #TpTLSCertificateRejection * * Return the #TpTLSCertificateRejection:dbus-error property * * Returns: the value of #TpTLSCertificateRejection:dbus-error property * * Since: 0.19.0 */ const gchar * tp_tls_certificate_rejection_get_dbus_error (TpTLSCertificateRejection *self) { return self->priv->dbus_error; } /** * tp_tls_certificate_rejection_get_details: * @self: a #TpTLSCertificateRejection * * Return the #TpTLSCertificateRejection:details property * * Returns: the value of #TpTLSCertificateRejection:details property * * Since: 0.19.0 */ GVariant * tp_tls_certificate_rejection_get_details (TpTLSCertificateRejection *self) { return self->priv->details; } /** * tp_tls_certificate_rejection_raise_error: * @self: a #TpTLSCertificateRejection * @error: (out) (allow-none) (transfer full): a #GError to fill * * Convenient function to raise the #TpTLSCertificateRejection:error * property in language binding supporting this feature. * * Returns: %FALSE * * Since: 0.19.0 */ gboolean tp_tls_certificate_rejection_raise_error (TpTLSCertificateRejection *self, GError **error) { if (error != NULL) *error = g_error_copy (self->priv->error); return FALSE; } telepathy-glib-0.24.2/telepathy-glib/tls-certificate-rejection.h0000644000175000017500000000602712652510705021567 00000000000000/* * tls-certificate-rejection.h * * Copyright (C) 2012 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_TLS_CERTIFICATE_REJECTION_H__ #define __TP_TLS_CERTIFICATE_REJECTION_H__ #include #include #include G_BEGIN_DECLS typedef struct _TpTLSCertificateRejection TpTLSCertificateRejection; typedef struct _TpTLSCertificateRejectionClass TpTLSCertificateRejectionClass; typedef struct _TpTLSCertificateRejectionPriv TpTLSCertificateRejectionPriv; struct _TpTLSCertificateRejectionClass { /**/ GObjectClass parent_class; }; struct _TpTLSCertificateRejection { /**/ GObject parent; TpTLSCertificateRejectionPriv *priv; }; _TP_AVAILABLE_IN_0_20 GType tp_tls_certificate_rejection_get_type (void); /* TYPE MACROS */ #define TP_TYPE_TLS_CERTIFICATE_REJECTION \ (tp_tls_certificate_rejection_get_type ()) #define TP_TLS_CERTIFICATE_REJECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_TLS_CERTIFICATE_REJECTION, \ TpTLSCertificateRejection)) #define TP_TLS_CERTIFICATE_REJECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_TLS_CERTIFICATE_REJECTION, \ TpTLSCertificateRejectionClass)) #define TP_IS_TLS_CERTIFICATE_REJECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ TP_TYPE_TLS_CERTIFICATE_REJECTION)) #define TP_IS_TLS_CERTIFICATE_REJECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ TP_TYPE_TLS_CERTIFICATE_REJECTION)) #define TP_TLS_CERTIFICATE_REJECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_TLS_CERTIFICATE_REJECTION, \ TpTLSCertificateRejectionClass)) _TP_AVAILABLE_IN_0_20 const GError * tp_tls_certificate_rejection_get_error ( TpTLSCertificateRejection *self); _TP_AVAILABLE_IN_0_20 TpTLSCertificateRejectReason tp_tls_certificate_rejection_get_reason ( TpTLSCertificateRejection *self); _TP_AVAILABLE_IN_0_20 const gchar * tp_tls_certificate_rejection_get_dbus_error ( TpTLSCertificateRejection *self); _TP_AVAILABLE_IN_0_20 GVariant * tp_tls_certificate_rejection_get_details ( TpTLSCertificateRejection *self); _TP_AVAILABLE_IN_0_20 gboolean tp_tls_certificate_rejection_raise_error ( TpTLSCertificateRejection *self, GError **error); G_END_DECLS #endif /* #ifndef __TP_TLS_CERTIFICATE_REJECTION_H__*/ telepathy-glib-0.24.2/telepathy-glib/call-content-media-description.xml0000644000175000017500000000104012652510705023045 00000000000000 Call misc interfaces, version 1 telepathy-glib-0.24.2/telepathy-glib/channel-contacts.c0000644000175000017500000010372314006542652017746 00000000000000/* * channel-contacts.c - proxy for a Telepathy channel (contacts feature) * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/channel-internal.h" #include #include #include #include #define DEBUG_FLAG TP_DEBUG_GROUPS #include "telepathy-glib/connection-internal.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/util-internal.h" static GArray * dup_handle_array (const GArray *source) { GArray *target; target = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), source->len); g_array_append_vals (target, source->data, source->len); return target; } static TpContact * dup_contact (TpChannel *self, TpHandle handle, GHashTable *identifiers) { const gchar *id; if (handle == 0) return NULL; id = g_hash_table_lookup (identifiers, GUINT_TO_POINTER (handle)); if (id == NULL) { DEBUG ("Missing identifier for handle %u - broken CM", handle); return NULL; } return tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, handle, id); } static GPtrArray * dup_contact_array (TpChannel *self, const GArray *handles, GHashTable *identifiers) { GPtrArray *array; guint i; array = g_ptr_array_new_full (handles->len, g_object_unref); for (i = 0; i < handles->len; i++) { TpHandle handle = g_array_index (handles, TpHandle, i); TpContact *contact = dup_contact (self, handle, identifiers); if (contact != NULL) g_ptr_array_add (array, contact); } return array; } static GHashTable * dup_contacts_table (TpChannel *self, TpIntset *source, GHashTable *identifiers) { GHashTable *target; TpIntsetFastIter iter; TpHandle handle; target = g_hash_table_new_full (NULL, NULL, NULL, g_object_unref); tp_intset_fast_iter_init (&iter, source); while (tp_intset_fast_iter_next (&iter, &handle)) { TpContact *contact = dup_contact (self, handle, identifiers); if (contact != NULL) g_hash_table_insert (target, GUINT_TO_POINTER (handle), contact); } return target; } /* self->priv->group_contact_owners may contain NULL TpContact and * g_object_unref isn't NULL safe */ static void safe_g_object_unref (gpointer data) { if (data == NULL) return; g_object_unref (data); } static gpointer safe_g_object_ref (gpointer data) { if (data == NULL) return NULL; return g_object_ref (data); } static GHashTable * dup_owners_table (TpChannel *self, GHashTable *source, GHashTable *identifiers) { GHashTable *target; GHashTableIter iter; gpointer key, value; target = g_hash_table_new_full (NULL, NULL, NULL, safe_g_object_unref); g_hash_table_iter_init (&iter, source); while (g_hash_table_iter_next (&iter, &key, &value)) { TpHandle owner_handle = GPOINTER_TO_UINT (value); TpContact *contact = dup_contact (self, owner_handle, identifiers); g_hash_table_insert (target, key, contact); } return target; } void _tp_channel_contacts_init (TpChannel *self) { /* Create TpContact objects if we have them for free */ if (!tp_connection_has_immortal_handles (self->priv->connection)) { self->priv->cm_too_old_for_contacts = TRUE; return; } g_assert (self->priv->target_contact == NULL); g_assert (self->priv->initiator_contact == NULL); if (self->priv->handle != 0 && self->priv->identifier != NULL && self->priv->handle_type == TP_HANDLE_TYPE_CONTACT) { self->priv->target_contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, self->priv->handle, self->priv->identifier); } G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (tp_channel_get_initiator_handle (self) != 0 && !tp_str_empty (tp_channel_get_initiator_identifier (self))) { self->priv->initiator_contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, tp_channel_get_initiator_handle (self), tp_channel_get_initiator_identifier (self)); } G_GNUC_END_IGNORE_DEPRECATIONS } void _tp_channel_contacts_group_init (TpChannel *self, GHashTable *identifiers) { GHashTableIter iter; gpointer value; /* Create TpContact objects if we have them for free */ if (!tp_connection_has_immortal_handles (self->priv->connection) || identifiers == NULL) { self->priv->cm_too_old_for_contacts = TRUE; return; } g_assert (self->priv->group_self_contact == NULL); g_assert (self->priv->group_members_contacts == NULL); g_assert (self->priv->group_local_pending_contacts == NULL); g_assert (self->priv->group_remote_pending_contacts == NULL); g_assert (self->priv->group_contact_owners == NULL); self->priv->group_self_contact = dup_contact (self, self->priv->group_self_handle, identifiers); self->priv->group_members_contacts = dup_contacts_table (self, self->priv->group_members, identifiers); self->priv->group_local_pending_contacts = dup_contacts_table (self, self->priv->group_local_pending, identifiers); self->priv->group_remote_pending_contacts = dup_contacts_table (self, self->priv->group_remote_pending, identifiers); self->priv->group_contact_owners = dup_owners_table (self, self->priv->group_handle_owners, identifiers); if (self->priv->group_local_pending_info != NULL) { g_hash_table_iter_init (&iter, self->priv->group_local_pending_info); while (g_hash_table_iter_next (&iter, NULL, &value)) { LocalPendingInfo *info = value; info->actor_contact = dup_contact (self, info->actor, identifiers); } } } struct _ContactsQueueItem { GPtrArray *contacts; GPtrArray *ids; GArray *handles; }; static void contacts_queue_item_free (ContactsQueueItem *item) { tp_clear_pointer (&item->contacts, g_ptr_array_unref); tp_clear_pointer (&item->ids, g_ptr_array_unref); tp_clear_pointer (&item->handles, g_array_unref); g_slice_free (ContactsQueueItem, item); } static void process_contacts_queue (TpChannel *self); static void contacts_queue_head_ready (TpChannel *self, const GError *error) { GSimpleAsyncResult *result = self->priv->current_contacts_queue_result; if (error != NULL) { DEBUG ("Error preparing channel contacts queue item: %s", error->message); g_simple_async_result_set_from_error (result, error); } g_simple_async_result_complete (result); self->priv->current_contacts_queue_result = NULL; process_contacts_queue (self); g_object_unref (result); } static void contacts_queue_item_upgraded_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const GError *error, gpointer user_data, GObject *weak_object) { TpChannel *self = (TpChannel *) weak_object; contacts_queue_head_ready (self, error); } static void contacts_queue_item_set_contacts (ContactsQueueItem *item, guint n_contacts, TpContact * const *contacts) { guint i; g_assert (item->contacts == NULL); item->contacts = g_ptr_array_new_full (n_contacts, g_object_unref); for (i = 0; i < n_contacts; i++) g_ptr_array_add (item->contacts, g_object_ref (contacts[i])); } static void contacts_queue_item_by_id_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, const gchar * const *requested_ids, GHashTable *failed_id_errors, const GError *error, gpointer user_data, GObject *weak_object) { TpChannel *self = (TpChannel *) weak_object; ContactsQueueItem *item = user_data; contacts_queue_item_set_contacts (item, n_contacts, contacts); contacts_queue_head_ready (self, error); } static void contacts_queue_item_by_handle_cb (TpConnection *connection, guint n_contacts, TpContact * const *contacts, guint n_failed, const TpHandle *failed, const GError *error, gpointer user_data, GObject *weak_object) { TpChannel *self = (TpChannel *) weak_object; ContactsQueueItem *item = user_data; contacts_queue_item_set_contacts (item, n_contacts, contacts); contacts_queue_head_ready (self, error); } static gboolean contacts_queue_item_idle_cb (gpointer user_data) { TpChannel *self = user_data; contacts_queue_head_ready (self, NULL); return FALSE; } static void process_contacts_queue (TpChannel *self) { GSimpleAsyncResult *result; ContactsQueueItem *item; GArray *features; const GError *error = NULL; if (self->priv->current_contacts_queue_result != NULL) return; /* self can't die while there are queued items because item->result keeps a * ref to it. But it could have been invalidated. */ error = tp_proxy_get_invalidated (self); if (error != NULL) { g_object_ref (self); while ((result = g_queue_pop_head (self->priv->contacts_queue)) != NULL) { g_simple_async_result_set_from_error (result, error); g_simple_async_result_complete (result); g_object_unref (result); } g_object_unref (self); return; } result = g_queue_pop_head (self->priv->contacts_queue); if (result == NULL) return; self->priv->current_contacts_queue_result = result; item = g_simple_async_result_get_op_res_gpointer (result); features = tp_simple_client_factory_dup_contact_features ( tp_proxy_get_factory (self->priv->connection), self->priv->connection); /* We can't use upgrade_contacts_async() because we need compat with older * CMs. by_id and by_handle are used only by TpTextChannel and are needed for * older CMs that does not give both message-sender and message-sender-id */ G_GNUC_BEGIN_IGNORE_DEPRECATIONS if (item->contacts != NULL && item->contacts->len > 0) { g_assert (item->ids == NULL); g_assert (item->handles == NULL); tp_connection_upgrade_contacts (self->priv->connection, item->contacts->len, (TpContact **) item->contacts->pdata, features->len, (TpContactFeature *) features->data, contacts_queue_item_upgraded_cb, item, NULL, (GObject *) self); } else if (item->ids != NULL && item->ids->len > 0) { g_assert (item->contacts == NULL); g_assert (item->handles == NULL); tp_connection_get_contacts_by_id (self->priv->connection, item->ids->len, (const gchar * const*) item->ids->pdata, features->len, (TpContactFeature *) features->data, contacts_queue_item_by_id_cb, item, NULL, (GObject *) self); } else if (item->handles != NULL && item->handles->len > 0) { g_assert (item->contacts == NULL); g_assert (item->ids == NULL); tp_connection_get_contacts_by_handle (self->priv->connection, item->handles->len, (TpHandle *) item->handles->data, features->len, (TpContactFeature *) features->data, contacts_queue_item_by_handle_cb, item, NULL, (GObject *) self); } else { /* It can happen there is no contact to prepare, and can still be useful * in order to not reorder some events. * We have to use an idle though, to guarantee callback is never called * without reentering mainloop first. */ g_idle_add (contacts_queue_item_idle_cb, self); } G_GNUC_END_IGNORE_DEPRECATIONS g_array_unref (features); } static void contacts_queue_item (TpChannel *self, GPtrArray *contacts, GPtrArray *ids, GArray *handles, GAsyncReadyCallback callback, gpointer user_data) { ContactsQueueItem *item = g_slice_new (ContactsQueueItem); GSimpleAsyncResult *result; item->contacts = contacts != NULL ? g_ptr_array_ref (contacts) : NULL; item->ids = ids != NULL ? g_ptr_array_ref (ids) : NULL; item->handles = handles != NULL ? g_array_ref (handles) : NULL; result = g_simple_async_result_new ((GObject *) self, callback, user_data, contacts_queue_item); g_simple_async_result_set_op_res_gpointer (result, item, (GDestroyNotify) contacts_queue_item_free); g_queue_push_tail (self->priv->contacts_queue, result); process_contacts_queue (self); } void _tp_channel_contacts_queue_prepare_async (TpChannel *self, GPtrArray *contacts, GAsyncReadyCallback callback, gpointer user_data) { contacts_queue_item (self, contacts, NULL, NULL, callback, user_data); } void _tp_channel_contacts_queue_prepare_by_id_async (TpChannel *self, GPtrArray *ids, GAsyncReadyCallback callback, gpointer user_data) { contacts_queue_item (self, NULL, ids, NULL, callback, user_data); } void _tp_channel_contacts_queue_prepare_by_handle_async (TpChannel *self, GArray *handles, GAsyncReadyCallback callback, gpointer user_data) { contacts_queue_item (self, NULL, NULL, handles, callback, user_data); } gboolean _tp_channel_contacts_queue_prepare_finish (TpChannel *self, GAsyncResult *result, GPtrArray **contacts, GError **error) { GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); ContactsQueueItem *item; item = g_simple_async_result_get_op_res_gpointer (simple); if (contacts != NULL) { if (item->contacts != NULL) *contacts = g_ptr_array_ref (item->contacts); else *contacts = g_ptr_array_new (); } if (g_simple_async_result_propagate_error (simple, error)) return FALSE; g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self), contacts_queue_item), FALSE); return TRUE; } typedef struct { GPtrArray *added; GArray *removed; GPtrArray *local_pending; GPtrArray *remote_pending; TpContact *actor; GHashTable *details; } MembersChangedData; static void members_changed_data_free (MembersChangedData *data) { tp_clear_pointer (&data->added, g_ptr_array_unref); tp_clear_pointer (&data->removed, g_array_unref); tp_clear_pointer (&data->local_pending, g_ptr_array_unref); tp_clear_pointer (&data->remote_pending, g_ptr_array_unref); g_clear_object (&data->actor); tp_clear_pointer (&data->details, g_hash_table_unref); g_slice_free (MembersChangedData, data); } static void members_changed_prepared_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpChannel *self = (TpChannel *) object; MembersChangedData *data = user_data; GPtrArray *removed; guint i; _tp_channel_contacts_queue_prepare_finish (self, result, NULL, NULL); /* For removed contacts, we have only handles because we are supposed to * already know them. So we have to search them in our tables, construct an * array of removed contacts and then remove them from our tables */ removed = g_ptr_array_new_full (data->removed->len, g_object_unref); for (i = 0; i < data->removed->len; i++) { TpHandle handle = g_array_index (data->removed, TpHandle, i); gpointer key = GUINT_TO_POINTER (handle); TpContact *contact; contact = g_hash_table_lookup (self->priv->group_members_contacts, key); if (contact == NULL) contact = g_hash_table_lookup ( self->priv->group_local_pending_contacts, key); if (contact == NULL) contact = g_hash_table_lookup ( self->priv->group_remote_pending_contacts, key); if (contact == NULL) { DEBUG ("Handle %u removed but not found in our tables - broken CM", handle); continue; } g_ptr_array_add (removed, g_object_ref (contact)); g_hash_table_remove (self->priv->group_members_contacts, key); g_hash_table_remove (self->priv->group_local_pending_contacts, key); g_hash_table_remove (self->priv->group_remote_pending_contacts, key); } for (i = 0; i < data->added->len; i++) { TpContact *contact = g_ptr_array_index (data->added, i); gpointer key = GUINT_TO_POINTER (tp_contact_get_handle (contact)); g_hash_table_insert (self->priv->group_members_contacts, key, g_object_ref (contact)); g_hash_table_remove (self->priv->group_local_pending_contacts, key); g_hash_table_remove (self->priv->group_remote_pending_contacts, key); } for (i = 0; i < data->local_pending->len; i++) { TpContact *contact = g_ptr_array_index (data->local_pending, i); gpointer key = GUINT_TO_POINTER (tp_contact_get_handle (contact)); g_hash_table_remove (self->priv->group_members_contacts, key); g_hash_table_insert (self->priv->group_local_pending_contacts, key, g_object_ref (contact)); g_hash_table_remove (self->priv->group_remote_pending_contacts, key); if (data->actor != NULL) { LocalPendingInfo *info; info = g_hash_table_lookup (self->priv->group_local_pending_info, key); if (info != NULL) info->actor_contact = g_object_ref (data->actor); } } for (i = 0; i < data->remote_pending->len; i++) { TpContact *contact = g_ptr_array_index (data->remote_pending, i); gpointer key = GUINT_TO_POINTER (tp_contact_get_handle (contact)); g_hash_table_remove (self->priv->group_members_contacts, key); g_hash_table_remove (self->priv->group_local_pending_contacts, key); g_hash_table_insert (self->priv->group_remote_pending_contacts, key, g_object_ref (contact)); } g_signal_emit_by_name (self, "group-contacts-changed", data->added, removed, data->local_pending, data->remote_pending, data->actor, data->details); g_ptr_array_unref (removed); members_changed_data_free (data); } void _tp_channel_contacts_members_changed (TpChannel *self, const GArray *added, const GArray *removed, const GArray *local_pending, const GArray *remote_pending, guint actor, GHashTable *details) { MembersChangedData *data; GPtrArray *contacts; GHashTable *ids; if (self->priv->cm_too_old_for_contacts) return; ids = tp_asv_get_boxed (details, "contact-ids", TP_HASH_TYPE_HANDLE_IDENTIFIER_MAP); if (ids == NULL && (added->len > 0 || local_pending->len > 0 || remote_pending->len > 0 || actor != 0 )) { DEBUG ("CM did not give identifiers, can't create TpContact"); return; } g_assert (self->priv->group_members_contacts != NULL); g_assert (self->priv->group_local_pending_contacts != NULL); g_assert (self->priv->group_remote_pending_contacts != NULL); /* Ensure all TpContact, and push to a queue. This is to ensure that signals * does not get reordered while we prepare them. */ data = g_slice_new (MembersChangedData); data->added = dup_contact_array (self, added, ids); data->removed = dup_handle_array (removed); data->local_pending = dup_contact_array (self, local_pending, ids); data->remote_pending = dup_contact_array (self, remote_pending, ids); data->actor = dup_contact (self, actor, ids); data->details = g_hash_table_ref (details); contacts = g_ptr_array_new (); tp_g_ptr_array_extend (contacts, data->added); tp_g_ptr_array_extend (contacts, data->local_pending); tp_g_ptr_array_extend (contacts, data->remote_pending); if (data->actor != NULL) g_ptr_array_add (contacts, data->actor); _tp_channel_contacts_queue_prepare_async (self, contacts, members_changed_prepared_cb, data); g_ptr_array_unref (contacts); } typedef struct { GHashTable *added; GArray *removed; } HandleOwnersChangedData; static void handle_owners_changed_data_free (HandleOwnersChangedData *data) { tp_clear_pointer (&data->added, g_hash_table_unref); tp_clear_pointer (&data->removed, g_array_unref); g_slice_free (HandleOwnersChangedData, data); } static void handle_owners_changed_prepared_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpChannel *self = (TpChannel *) object; HandleOwnersChangedData *data = user_data; guint i; _tp_channel_contacts_queue_prepare_finish (self, result, NULL, NULL); for (i = 0; i < data->removed->len; i++) { g_hash_table_remove (self->priv->group_contact_owners, GUINT_TO_POINTER (g_array_index (data->removed, TpHandle, i))); } tp_g_hash_table_update (self->priv->group_contact_owners, data->added, NULL, safe_g_object_ref); handle_owners_changed_data_free (data); } void _tp_channel_contacts_handle_owners_changed (TpChannel *self, GHashTable *added, const GArray *removed, GHashTable *identifiers) { HandleOwnersChangedData *data; GPtrArray *contacts; if (self->priv->cm_too_old_for_contacts) return; if (!self->priv->group_contact_owners) return; g_assert (self->priv->group_contact_owners != NULL); data = g_slice_new (HandleOwnersChangedData); data->added = dup_owners_table (self, added, identifiers); data->removed = dup_handle_array (removed); contacts = _tp_contacts_from_values (data->added); _tp_channel_contacts_queue_prepare_async (self, contacts, handle_owners_changed_prepared_cb, data); g_ptr_array_unref (contacts); } static void self_contact_changed_prepared_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpChannel *self = (TpChannel *) object; TpContact *contact = user_data; _tp_channel_contacts_queue_prepare_finish (self, result, NULL, NULL); g_clear_object (&self->priv->group_self_contact); self->priv->group_self_contact = contact; g_object_notify ((GObject *) self, "group-self-contact"); } void _tp_channel_contacts_self_contact_changed (TpChannel *self, guint self_handle, const gchar *identifier) { TpContact *contact; GPtrArray *contacts; if (self->priv->cm_too_old_for_contacts) return; contacts = g_ptr_array_new_with_free_func (g_object_unref); contact = tp_simple_client_factory_ensure_contact ( tp_proxy_get_factory (self->priv->connection), self->priv->connection, self_handle, identifier); g_ptr_array_add (contacts, g_object_ref (contact)); _tp_channel_contacts_queue_prepare_async (self, contacts, self_contact_changed_prepared_cb, contact); g_ptr_array_unref (contacts); } /** * tp_channel_get_target_contact: * @self: a channel * * * * Returns: (transfer none): the value of #TpChannel:target-contact * Since: 0.15.6 */ TpContact * tp_channel_get_target_contact (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->target_contact; } /** * tp_channel_get_initiator_contact: * @self: a channel * * * * Returns: (transfer none): the value of #TpChannel:initiator-contact * Since: 0.15.6 */ TpContact * tp_channel_get_initiator_contact (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->initiator_contact; } /** * tp_channel_group_get_self_contact: * @self: a channel * * * * Returns: (transfer none): the value of #TpChannel:group-self-contact * Since: 0.15.6 */ TpContact * tp_channel_group_get_self_contact (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return self->priv->group_self_contact; } /** * tp_channel_group_dup_members_contacts: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been * prepared, return a #GPtrArray containing its members. * * If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, * the result may either be a set of members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer container) (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. * * Since: 0.15.6 */ GPtrArray * tp_channel_group_dup_members_contacts (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return _tp_contacts_from_values (self->priv->group_members_contacts); } /** * tp_channel_group_dup_local_pending_contacts: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been * prepared, return a #GPtrArray containing its local-pending members. * * If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, * the result may either be a set of local-pending members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer container) (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. * * Since: 0.15.6 */ GPtrArray * tp_channel_group_dup_local_pending_contacts (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return _tp_contacts_from_values (self->priv->group_local_pending_contacts); } /** * tp_channel_group_dup_remote_pending_contacts: * @self: a channel * * If @self is a group and the %TP_CHANNEL_FEATURE_CONTACTS feature has been * prepared, return a #GPtrArray containing its remote-pending members. * * If @self is a group but %TP_CHANNEL_FEATURE_CONTACTS has not been prepared, * the result may either be a set of remote-pending members, or %NULL. * * If @self is not a group, return %NULL. * * Returns: (transfer container) (type GLib.PtrArray) (element-type TelepathyGLib.Contact): * a new #GPtrArray of #TpContact, free it with g_ptr_array_unref(), or %NULL. * * Since: 0.15.6 */ GPtrArray * tp_channel_group_dup_remote_pending_contacts (TpChannel *self) { g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); return _tp_contacts_from_values (self->priv->group_remote_pending_contacts); } /** * tp_channel_group_get_local_pending_contact_info: * @self: a channel * @local_pending: the #TpContact of a local-pending contact about whom more * information is needed * @actor: (out) (allow-none) (transfer none): either %NULL or a location to * return the contact who requested the change * @reason: (out) (allow-none): either %NULL or a location to return the reason * for the change * @message: (out) (allow-none) (transfer none): either %NULL or a location to * return the * user-supplied message * * If @local_pending is actually a local-pending contact, * write additional information into @actor, @reason and @message and return * %TRUE. The contact and message are not referenced or copied, and can only be * assumed to remain valid until the main loop is re-entered. * * If @local_pending is not the handle of a local-pending contact, * write %NULL into @actor, %TP_CHANNEL_GROUP_CHANGE_REASON_NONE into @reason * and "" into @message, and return %FALSE. * * Returns: %TRUE if the contact is in fact local-pending * Since: 0.15.6 */ gboolean tp_channel_group_get_local_pending_contact_info (TpChannel *self, TpContact *local_pending, TpContact **actor, TpChannelGroupChangeReason *reason, const gchar **message) { gboolean ret = FALSE; TpContact *a = NULL; TpChannelGroupChangeReason r = TP_CHANNEL_GROUP_CHANGE_REASON_NONE; const gchar *m = ""; g_return_val_if_fail (TP_IS_CHANNEL (self), FALSE); g_return_val_if_fail (TP_IS_CONTACT (local_pending), FALSE); g_return_val_if_fail (tp_contact_get_connection (local_pending) == self->priv->connection, FALSE); if (self->priv->group_local_pending != NULL) { TpHandle handle = tp_contact_get_handle (local_pending); /* it could conceivably be someone who is local-pending */ ret = tp_intset_is_member (self->priv->group_local_pending, handle); if (ret && self->priv->group_local_pending_info != NULL) { /* we might even have information about them */ LocalPendingInfo *info = g_hash_table_lookup ( self->priv->group_local_pending_info, GUINT_TO_POINTER (handle)); if (info != NULL) { a = info->actor_contact; r = info->reason; if (info->message != NULL) m = info->message; } /* else we have no info, which means (NULL, NONE, NULL) */ } } if (actor != NULL) *actor = a; if (message != NULL) *message = m; if (reason != NULL) *reason = r; return ret; } /** * tp_channel_group_get_contact_owner: * @self: a channel * @contact: a contact which is a member of this channel * * Synopsis (see below for further explanation): * * - if @self is not a group or @contact is not a member of this channel, * result is undefined; * - if %TP_CHANNEL_FEATURE_CONTACTS has not yet been prepared, result is * undefined; * - if @self does not have flags that include * %TP_CHANNEL_GROUP_FLAG_PROPERTIES, * result is undefined; * - if @contact is channel-specific and its globally valid "owner" is known, * return that owner; * - if @contact is channel-specific and its globally valid "owner" is unknown, * return %NULL; * - if @contact is globally valid, return @contact itself * * Some channels (those with flags that include * %TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES) have a concept of * "channel-specific contacts". These are contacts that only have meaning within * the context of the channel - for instance, in XMPP Multi-User Chat, * participants in a chatroom are identified by an in-room JID consisting * of the JID of the chatroom plus a local nickname. * * Depending on the protocol and configuration, it might be possible to find * out what globally valid contact (i.e. a contact that you could add to * your contact list) "owns" a channel-specific contact. For instance, in * most XMPP MUC chatrooms, normal users cannot see what global JID * corresponds to an in-room JID, but moderators can. * * This is further complicated by the fact that channels with channel-specific * contacts can sometimes have members with globally valid contacts (for * instance, if you invite someone to an XMPP MUC using their globally valid * JID, you would expect to see the contact representing that JID in the * Group's remote-pending set). * * Returns: (transfer none): the global contact that owns the given contact, * or %NULL. * Since: 0.15.6 */ TpContact * tp_channel_group_get_contact_owner (TpChannel *self, TpContact *contact) { TpHandle handle; gpointer value; g_return_val_if_fail (TP_IS_CHANNEL (self), NULL); g_return_val_if_fail (TP_IS_CONTACT (contact), NULL); g_return_val_if_fail (tp_contact_get_connection (contact) == self->priv->connection, NULL); if (self->priv->group_contact_owners == NULL) { /* undefined result - pretending it's global is probably as good as * any other behaviour, since we can't know either way */ return contact; } handle = tp_contact_get_handle (contact); if (g_hash_table_lookup_extended (self->priv->group_contact_owners, GUINT_TO_POINTER (handle), NULL, &value)) { /* channel-specific, value is either owner or NULL if unknown */ return value; } else { /* either already globally valid, or not a member */ return contact; } } static void contacts_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpChannel *self = (TpChannel *) object; GSimpleAsyncResult *result = user_data; GError *error = NULL; if (!_tp_channel_contacts_queue_prepare_finish (self, res, NULL, &error)) g_simple_async_result_take_error (result, error); g_simple_async_result_complete (result); g_object_unref (result); } static void append_contacts (GPtrArray *contacts, GHashTable *table) { GHashTableIter iter; gpointer value; if (table == NULL) return; g_hash_table_iter_init (&iter, table); while (g_hash_table_iter_next (&iter, NULL, &value)) { if (value == NULL) continue; g_ptr_array_add (contacts, value); } } void _tp_channel_contacts_prepare_async (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data) { TpChannel *self = (TpChannel *) proxy; GSimpleAsyncResult *result; GHashTableIter iter; gpointer value; GPtrArray *contacts; if (self->priv->cm_too_old_for_contacts) { g_simple_async_report_error_in_idle ((GObject *) self, callback, user_data, TP_ERROR, TP_ERROR_SOFTWARE_UPGRADE_REQUIRED, "The Connection Manager does not implement the required telepathy " "specification (>= 0.23.4) to prepare TP_CHANNEL_FEATURE_CONTACTS."); return; } result = g_simple_async_result_new ((GObject *) self, callback, user_data, _tp_channel_contacts_prepare_async); contacts = g_ptr_array_new (); /* Collect all the TpContacts we have for this channel */ if (self->priv->target_contact != NULL) g_ptr_array_add (contacts, self->priv->target_contact); if (self->priv->initiator_contact != NULL) g_ptr_array_add (contacts, self->priv->initiator_contact); if (self->priv->group_self_contact != NULL) g_ptr_array_add (contacts, self->priv->group_self_contact); append_contacts (contacts, self->priv->group_members_contacts); append_contacts (contacts, self->priv->group_local_pending_contacts); append_contacts (contacts, self->priv->group_remote_pending_contacts); append_contacts (contacts, self->priv->group_contact_owners); if (self->priv->group_local_pending_info != NULL) { g_hash_table_iter_init (&iter, self->priv->group_local_pending_info); while (g_hash_table_iter_next (&iter, NULL, &value)) { LocalPendingInfo *info = value; if (info->actor_contact != NULL) g_ptr_array_add (contacts, info->actor_contact); } } _tp_channel_contacts_queue_prepare_async (self, contacts, contacts_prepared_cb, result); g_ptr_array_unref (contacts); } telepathy-glib-0.24.2/telepathy-glib/dbus-introspectable.xml0000644000175000017500000000063512652510705021046 00000000000000 D-Bus introspectable object telepathy-glib-0.24.2/telepathy-glib/call-misc.c0000644000175000017500000000564212652510705016366 00000000000000/* * call.c - misc low level API for Call * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:call-misc * @title: Misc Call APIs * @short_description: Misc generated APISs for Call * * This contains generated APIs to be used by #TpCallChannel, #TpCallStream, * #TpCallContent or telepathy-farstream. Should not be needed for normal * clients. */ #include "config.h" #include "telepathy-glib/call-misc.h" #include "telepathy-glib/errors.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/proxy-subclass.h" #include "_gen/tp-cli-call-content-media-description-body.h" #include "_gen/tp-cli-call-stream-endpoint-body.h" /** * tp_call_stream_endpoint_init_known_interfaces: * * Ensure that the known interfaces for #TpProxy have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_PROXY. * * Since: 0.17.5 */ void tp_call_stream_endpoint_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_PROXY; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_call_stream_endpoint_add_signals); g_once_init_leave (&once, 1); } } /** * tp_call_content_media_description_init_known_interfaces: * * Ensure that the known interfaces for #TpProxy have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_PROXY. * * Since: 0.17.5 */ void tp_call_content_media_description_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_PROXY; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_call_content_media_description_add_signals); g_once_init_leave (&once, 1); } } telepathy-glib-0.24.2/telepathy-glib/call-misc.h0000644000175000017500000000301612652510705016364 00000000000000/* * call.h - misc low level API for Call * * Copyright (C) 2011 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_CALL_MISC_H__ #define __TP_CALL_MISC_H__ #include #include G_BEGIN_DECLS _TP_AVAILABLE_IN_0_18 void tp_call_stream_endpoint_init_known_interfaces (void); _TP_AVAILABLE_IN_0_18 void tp_call_content_media_description_init_known_interfaces (void); G_END_DECLS #include #include #endif telepathy-glib-0.24.2/telepathy-glib/base-call-internal.h0000644000175000017500000001204112652510705020153 00000000000000/**/ /* * base-call-internal.h - Header for TpBaseCall* (internals) * Copyright © 2011 Collabora Ltd. * @author Olivier Crete * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_BASE_CALL_INTERNAL_H__ #define __TP_BASE_CALL_INTERNAL_H__ #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS /* Implemented in base-call-content.c */ void _tp_base_call_content_set_channel (TpBaseCallContent *self, TpBaseCallChannel *channel); TpBaseCallChannel *_tp_base_call_content_get_channel (TpBaseCallContent *self); void _tp_base_call_content_accepted (TpBaseCallContent *self, TpHandle actor_handle); void _tp_base_call_content_deinit (TpBaseCallContent *self); void _tp_base_call_content_remove_stream_internal (TpBaseCallContent *self, TpBaseCallStream *stream, const GValueArray *reason_array); /* Implemented in base-media-call-content.c */ gboolean _tp_base_media_call_content_ready_to_accept ( TpBaseMediaCallContent *self); void _tp_base_media_call_content_remote_accepted (TpBaseMediaCallContent *self); /* Implemented in base-call-stream.c */ void _tp_base_call_stream_set_content (TpBaseCallStream *self, TpBaseCallContent *content); TpBaseCallContent *_tp_base_call_stream_get_content (TpBaseCallStream *self); TpBaseCallChannel *_tp_base_call_stream_get_channel (TpBaseCallStream *self); gboolean _tp_base_call_stream_set_sending (TpBaseCallStream *self, gboolean send, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message, GError **error); GHashTable *_tp_base_call_stream_get_remote_members (TpBaseCallStream *self); /* Implemented in base-media-call-stream.c */ void _tp_base_media_call_stream_set_remotely_held (TpBaseMediaCallStream *self, gboolean remotely_held); /* Implemented in base-call-channel.c */ GHashTable *_tp_base_call_dup_member_identifiers (TpBaseConnection *conn, GHashTable *source); GValueArray *_tp_base_call_state_reason_new (TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message); void _tp_base_call_channel_remove_content_internal (TpBaseCallChannel *self, TpBaseCallContent *content, const GValueArray *reason_array); gboolean _tp_base_call_channel_is_locally_accepted (TpBaseCallChannel *self); gboolean _tp_base_call_channel_is_connected (TpBaseCallChannel *self); const gchar *_tp_base_call_channel_get_initial_tones (TpBaseCallChannel *self); /* Implemented in base-media-call-channel.c */ void _tp_base_media_call_channel_endpoint_state_changed ( TpBaseMediaCallChannel *self); gboolean _tp_base_media_channel_is_held (TpBaseMediaCallChannel *self); gboolean _tp_base_media_call_channel_streams_sending_state_changed ( TpBaseMediaCallChannel *self, gboolean success); gboolean _tp_base_media_call_channel_streams_receiving_state_changed ( TpBaseMediaCallChannel *self, gboolean success); /* Implemented in call-content-media-description.c */ void _tp_call_content_media_description_offer_async ( TpCallContentMediaDescription *self, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); gboolean _tp_call_content_media_description_offer_finish ( TpCallContentMediaDescription *self, GAsyncResult *result, GHashTable **properties, GError **error); GHashTable *_tp_call_content_media_description_dup_properties ( TpCallContentMediaDescription *self); /* Implemented in call-stream-endpoint.c */ void _tp_call_stream_endpoint_set_stream (TpCallStreamEndpoint *self, TpBaseMediaCallStream *stream); /* Implemented in dtmf.c */ typedef enum { DTMF_CHAR_CLASS_MEANINGLESS, DTMF_CHAR_CLASS_PAUSE, DTMF_CHAR_CLASS_EVENT, DTMF_CHAR_CLASS_WAIT_FOR_USER } DTMFCharClass; TpDTMFEvent _tp_dtmf_char_to_event (gchar c); DTMFCharClass _tp_dtmf_char_classify (gchar c); G_END_DECLS #endif /* #ifndef __TP_BASE_CALL_INTERNAL_H__*/ telepathy-glib-0.24.2/telepathy-glib/contact-list-channel-internal.h0000644000175000017500000001134712652510705022352 00000000000000/**/ /* A ContactList channel with handle type LIST or GROUP. * * Copyright © 2009-2010 Collabora Ltd. * Copyright © 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_CONTACT_LIST_CHANNEL_INTERNAL_H__ #define __TP_CONTACT_LIST_CHANNEL_INTERNAL_H__ #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpBaseContactListChannel TpBaseContactListChannel; typedef struct _TpBaseContactListChannelClass TpBaseContactListChannelClass; /* the subclasses don't have, or need, their own structs */ typedef TpBaseContactListChannel TpContactListChannel; typedef TpBaseContactListChannel TpContactGroupChannel; typedef TpBaseContactListChannelClass TpContactListChannelClass; typedef TpBaseContactListChannelClass TpContactGroupChannelClass; GType _tp_base_contact_list_channel_get_type (void); #define TP_TYPE_BASE_CONTACT_LIST_CHANNEL \ (_tp_base_contact_list_channel_get_type ()) #define TP_BASE_CONTACT_LIST_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASE_CONTACT_LIST_CHANNEL, \ TpBaseContactListChannel)) #define TP_BASE_CONTACT_LIST_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASE_CONTACT_LIST_CHANNEL, \ TpBaseContactListChannelClass)) #define TP_IS_BASE_CONTACT_LIST_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASE_CONTACT_LIST_CHANNEL)) #define TP_IS_BASE_CONTACT_LIST_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASE_CONTACT_LIST_CHANNEL)) #define TP_BASE_CONTACT_LIST_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONTACT_LIST_CHANNEL, \ TpBaseContactListChannelClass)) GType _tp_contact_list_channel_get_type (void); #define TP_TYPE_CONTACT_LIST_CHANNEL \ (_tp_contact_list_channel_get_type ()) #define TP_CONTACT_LIST_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT_LIST_CHANNEL, \ TpContactListChannel)) #define TP_CONTACT_LIST_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CONTACT_LIST_CHANNEL, \ TpContactListChannelClass)) #define TP_IS_CONTACT_LIST_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CONTACT_LIST_CHANNEL)) #define TP_IS_CONTACT_LIST_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CONTACT_LIST_CHANNEL)) #define TP_CONTACT_LIST_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONTACT_LIST_CHANNEL, \ TpContactListChannelClass)) GType _tp_contact_group_channel_get_type (void); #define TP_TYPE_CONTACT_GROUP_CHANNEL \ (_tp_contact_group_channel_get_type ()) #define TP_CONTACT_GROUP_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CONTACT_GROUP_CHANNEL, \ TpContactGroupChannel)) #define TP_CONTACT_GROUP_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CONTACT_GROUP_CHANNEL, \ TpContactGroupChannelClass)) #define TP_IS_CONTACT_GROUP_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CONTACT_GROUP_CHANNEL)) #define TP_IS_CONTACT_GROUP_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CONTACT_GROUP_CHANNEL)) #define TP_CONTACT_GROUP_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CONTACT_GROUP_CHANNEL, \ TpContactGroupChannelClass)) struct _TpBaseContactListChannelClass { TpBaseChannelClass parent_class; TpGroupMixinClass group_class; }; struct _TpBaseContactListChannel { TpBaseChannel parent; TpGroupMixin group; /**/ /* these would be in priv if this was a public object */ /* set to NULL after channel is closed */ TpBaseContactList *manager; }; void _tp_base_contact_list_channel_close (TpBaseContactListChannel *self); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/handle-set.c0000644000175000017500000003037612652510705016550 00000000000000/* * handle-set.c - a set which refs a handle when inserted * * Copyright (C) 2005,2006,2007 Collabora Ltd. * Copyright (C) 2005,2006,2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "config.h" /* there is no handle-set.h - handle set and handle repo have a circular * dependency, so they share a header */ #include #include #include #define DEBUG_FLAG TP_DEBUG_HANDLES #include "debug-internal.h" /** * TpHandleSet: * * A set of handles. This is similar to a #TpIntset (and implemented using * one), but adding a handle to the set also references it. */ struct _TpHandleSet { TpHandleRepoIface *repo; TpIntset *intset; }; /** * TP_TYPE_HANDLE_SET: (skip) * * The boxed type of a #TpHandleSet. * * Since: 0.11.6 */ G_DEFINE_BOXED_TYPE (TpHandleSet, tp_handle_set, tp_handle_set_copy, tp_handle_set_destroy) /** * tp_handle_set_new: (skip) * @repo: #TpHandleRepoIface that holds the handles to be reffed by this set * * Creates a new #TpHandleSet * * Returns: (transfer full): A new #TpHandleSet */ TpHandleSet * tp_handle_set_new (TpHandleRepoIface *repo) { TpHandleSet *set; g_assert (repo != NULL); set = g_slice_new0 (TpHandleSet); set->intset = tp_intset_new (); set->repo = repo; return set; } /** * tp_handle_set_new_from_array: (skip) * @repo: #TpHandleRepoIface that holds the handles to be reffed by this set * @array: (element-type uint): array of handles to be referenced by this set * * Creates a new #TpHandleSet * * Returns: (transfer full): A new #TpHandleSet * * Since: 0.11.7 */ TpHandleSet * tp_handle_set_new_from_array (TpHandleRepoIface *repo, const GArray *array) { TpHandleSet *set = tp_handle_set_new (repo); TpIntset *tmp = tp_intset_from_array (array); tp_intset_destroy (tp_handle_set_update (set, tmp)); tp_intset_destroy (tmp); return set; } static void freer (TpHandleSet *set, TpHandle handle, gpointer userdata) { tp_handle_set_remove (set, handle); } /** * tp_handle_set_destroy: (skip) * @set:#TpHandleSet to destroy * * Delete a #TpHandleSet and unreference any handles that it holds */ void tp_handle_set_destroy (TpHandleSet *set) { tp_handle_set_foreach (set, freer, NULL); tp_intset_destroy (set->intset); g_slice_free (TpHandleSet, set); } /** * tp_handle_set_clear: (skip) * @set:#TpHandleSet to clear * * Remove every handle from @set, releasing the references it holds. * * Since: 0.11.6 */ void tp_handle_set_clear (TpHandleSet *set) { tp_handle_set_foreach (set, freer, NULL); g_assert (tp_handle_set_is_empty (set)); } /** * tp_handle_set_is_empty: (skip) * @set:#TpHandleSet to check * * Return the same thing as (tp_handle_set_size (set) == 0), * but calculated more efficiently. * * Returns: %TRUE if the set has no members * * Since: 0.11.6 */ gboolean tp_handle_set_is_empty (const TpHandleSet *set) { return tp_intset_is_empty (set->intset); } /** * tp_handle_set_peek: (skip) * @set:#TpHandleSet to peek at * * * * Returns: (transfer none): the underlying #TpIntset used by this #TpHandleSet */ TpIntset * tp_handle_set_peek (TpHandleSet *set) { return set->intset; } /** * tp_handle_set_add: (skip) * @set: #TpHandleSet to add this handle to * @handle: handle to add * * Add a handle to a #TpHandleSet, and reference it in the attached * #TpHandleRepoIface * */ void tp_handle_set_add (TpHandleSet *set, TpHandle handle) { g_return_if_fail (set != NULL); g_return_if_fail (handle != 0); tp_intset_add (set->intset, handle); } /** * tp_handle_set_remove: (skip) * @set: #TpHandleSet to remove this handle from * @handle: handle to remove * * Remove a handle from a #TpHandleSet, and unreference it in the attached * #TpHandleRepoIface * * Returns: FALSE if the handle was invalid, or was not in this set */ gboolean tp_handle_set_remove (TpHandleSet *set, TpHandle handle) { g_return_val_if_fail (set != NULL, FALSE); g_return_val_if_fail (handle != 0, FALSE); return tp_intset_remove (set->intset, handle); } /** * tp_handle_set_is_member: (skip) * @set: A #TpHandleSet * @handle: handle to check * * Check if the handle is in this set * * Returns: TRUE if the handle is in this set * */ gboolean tp_handle_set_is_member (const TpHandleSet *set, TpHandle handle) { return tp_intset_is_member (set->intset, handle); } typedef struct __foreach_data { TpHandleSet *set; TpHandleSetMemberFunc func; gpointer userdata; } _foreach_data; static void foreach_helper (guint i, gpointer userdata) { _foreach_data *data = userdata; data->func (data->set, i, data->userdata); } /** * TpHandleSetMemberFunc: (skip) * @set: The set of handles on which tp_handle_set_foreach() was called * @handle: A handle in the set * @userdata: Arbitrary user data as supplied to tp_handle_set_foreach() * * Signature of the callback used to iterate over the handle set in * tp_handle_set_foreach(). */ /** * tp_handle_set_foreach: (skip) * @set: A set of handles * @func: (scope call): A callback * @user_data: Arbitrary data to pass to @func * * Call @func(@set, @handle, @userdata) for each handle in @set. */ void tp_handle_set_foreach (TpHandleSet *set, TpHandleSetMemberFunc func, gpointer user_data) { _foreach_data data = {set, func, user_data}; tp_intset_foreach (set->intset, foreach_helper, &data); } /** * tp_handle_set_size: (skip) * @set: A set of handles * * * * Returns: the number of handles in this set */ int tp_handle_set_size (const TpHandleSet *set) { return tp_intset_size (set->intset); } /** * tp_handle_set_to_array: (skip) * @set: A handle set * * * * Returns: (element-type uint): a newly-allocated GArray of guint representing * the handles in the set */ GArray * tp_handle_set_to_array (const TpHandleSet *set) { g_return_val_if_fail (set != NULL, NULL); return tp_intset_to_array (set->intset); } /** * tp_handle_set_to_identifier_map: * @self: a handle set * * Returns a dictionary mapping each handle in @self to the corresponding * identifier, as if retrieved by calling tp_handle_inspect() on each handle. * The type of the returned value is described as * Handle_Identifier_Map in the Telepathy specification. * * Returns: (transfer full) (element-type TpHandle utf8): a map from the * handles in @self to the corresponding identifier. */ GHashTable * tp_handle_set_to_identifier_map ( TpHandleSet *self) { /* We don't bother dupping the strings: they remain valid as long as the * connection's alive and hence the repo exists. */ GHashTable *map = g_hash_table_new (NULL, NULL); TpIntsetFastIter iter; TpHandle handle; g_return_val_if_fail (self != NULL, map); tp_intset_fast_iter_init (&iter, self->intset); while (tp_intset_fast_iter_next (&iter, &handle)) { if (handle == 0 || !tp_handle_is_valid (self->repo, handle, NULL)) { WARNING ("handle set %p contains invalid handle #%u", self, handle); } else { g_hash_table_insert (map, GUINT_TO_POINTER (handle), (gchar *) tp_handle_inspect (self->repo, handle)); } } return map; } /** * tp_handle_set_copy: (skip) * @other: another handle set * * Creates a new #TpHandleSet with the same contents as @other. * * Returns: a new set * * Since: 0.11.6 */ TpHandleSet * tp_handle_set_copy (const TpHandleSet *other) { g_return_val_if_fail (other != NULL, NULL); return tp_handle_set_new_from_intset (other->repo, other->intset); } /** * tp_handle_set_new_containing: (skip) * @repo: #TpHandleRepoIface that holds the handles to be reffed by this set * @handle: a valid handle * * Creates a new #TpHandleSet from a specified handle repository and single * handle. * * Returns: (transfer full): A new #TpHandleSet * * Since: 0.13.0 */ TpHandleSet * tp_handle_set_new_containing (TpHandleRepoIface *repo, TpHandle handle) { TpHandleSet *set = tp_handle_set_new (repo); tp_handle_set_add (set, handle); return set; } /** * tp_handle_set_new_from_intset: (skip) * @repo: #TpHandleRepoIface that holds the handles to be reffed by this set * @intset: a set of handles, which must all be valid * * Creates a new #TpHandleSet from a specified handle repository and * set of handles. * * Returns: (transfer full): A new #TpHandleSet * * Since: 0.13.0 */ TpHandleSet * tp_handle_set_new_from_intset (TpHandleRepoIface *repo, const TpIntset *intset) { TpHandleSet *set; g_return_val_if_fail (repo != NULL, NULL); g_return_val_if_fail (intset != NULL, NULL); set = g_slice_new0 (TpHandleSet); set->repo = repo; set->intset = tp_intset_copy (intset); return set; } /** * tp_handle_set_update: (skip) * @set: a #TpHandleSet to update * @add: a #TpIntset of handles to add * * Add a set of handles to a handle set, referencing those which are not * already members. The TpIntset returned must be freed with tp_intset_destroy. * * Returns: the handles which were added (some subset of @add) */ TpIntset * tp_handle_set_update (TpHandleSet *set, const TpIntset *add) { TpIntset *ret, *tmp; g_return_val_if_fail (set != NULL, NULL); g_return_val_if_fail (add != NULL, NULL); /* reference each of ADD - CURRENT */ ret = tp_intset_difference (add, set->intset); /* update CURRENT to be the union of CURRENT and ADD */ tmp = tp_intset_union (add, set->intset); tp_intset_destroy (set->intset); set->intset = tmp; return ret; } /** * tp_handle_set_difference_update: (skip) * @set: a #TpHandleSet to update * @remove: a #TpIntset of handles to remove * * Remove a set of handles from a handle set, dereferencing those which are * members. The TpIntset returned must be freed with tp_intset_destroy. * * If you want to be able to inspect the handles in the set returned, * you must ensure that this function does not cause their refcount to drop * to zero, for instance by temporarily taking a reference to all the * handles in @remove, calling this function, doing something with the * result and discarding the temporary references. * * Returns: the handles which were dereferenced and removed (some subset * of @remove). */ TpIntset * tp_handle_set_difference_update (TpHandleSet *set, const TpIntset *remove) { TpIntset *ret, *tmp; g_return_val_if_fail (set != NULL, NULL); g_return_val_if_fail (remove != NULL, NULL); /* dereference each of REMOVE n CURRENT */ ret = tp_intset_intersection (remove, set->intset); /* update CURRENT to be CURRENT - REMOVE */ tmp = tp_intset_difference (set->intset, remove); tp_intset_destroy (set->intset); set->intset = tmp; return ret; } /** * tp_handle_set_dump: * @self: a handle set * * Format a #TpHandleSet for debug output. * * Returns: (transfer full) (type utf8): a string representation of the * handle set suitable for debug output */ gchar * tp_handle_set_dump (const TpHandleSet *self) { TpIntsetFastIter iter; guint handle; GString *string = g_string_new ("{ "); tp_intset_fast_iter_init (&iter, self->intset); while (tp_intset_fast_iter_next (&iter, &handle)) { if (handle == 0 || !tp_handle_is_valid (self->repo, handle, NULL)) { g_string_append_printf (string, "#%u , ", handle); } else { g_string_append_printf (string, "#%u '%s', ", handle, tp_handle_inspect (self->repo, handle)); } } g_string_append_c (string, '}'); return g_string_free (string, FALSE); } telepathy-glib-0.24.2/telepathy-glib/client.c0000644000175000017500000001011312652510705015765 00000000000000/* * client.c - proxy for a Telepathy client * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/client.h" #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_DISPATCHER #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/_gen/tp-cli-client-body.h" /** * SECTION:client * @title: TpClient * @short_description: proxy object for a client of the ChannelDispatcher * * Each client to which the ChannelDispatcher can send channels must implement * the Client interface. This object represents such a client, and is mainly * useful in the implementation of the ChannelDispatcher itself. * * Since: 0.7.32 */ /** * TpClient: * * Each client to which the ChannelDispatcher can send channels must implement * the Client interface. This object represents such a client, and is mainly * useful in the implementation of the ChannelDispatcher itself. * * This proxy is usable but very incomplete: accessors for D-Bus properties * will be added in a later version of telepathy-glib, along with a mechanism * similar to tp_connection_call_when_ready(). * * Many operations performed on a Client are done via D-Bus properties. * Until convenience methods for this are implemented, use of the generic * tp_cli_dbus_properties_call_get_all() and tp_cli_dbus_properties_call_set() * methods is recommended. * * Since: 0.7.32 */ /** * TpClientClass: * * The class of a #TpClient. */ struct _TpClientPrivate { gpointer dummy; }; G_DEFINE_TYPE (TpClient, tp_client, TP_TYPE_PROXY) static void tp_client_init (TpClient *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_CLIENT, TpClientPrivate); } static void tp_client_constructed (GObject *object) { TpClient *self = TP_CLIENT (object); void (*chain_up) (GObject *) = ((GObjectClass *) tp_client_parent_class)->constructed; if (chain_up != NULL) chain_up (object); g_return_if_fail (tp_proxy_get_dbus_daemon (self) != NULL); } static void tp_client_class_init (TpClientClass *klass) { TpProxyClass *proxy_class = (TpProxyClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (TpClientPrivate)); object_class->constructed = tp_client_constructed; proxy_class->interface = TP_IFACE_QUARK_CLIENT; tp_client_init_known_interfaces (); } /** * tp_client_init_known_interfaces: * * Ensure that the known interfaces for TpClient have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add() with first argument * %TP_TYPE_CLIENT. * * Since: 0.7.32 */ void tp_client_init_known_interfaces (void) { static gsize once = 0; if (g_once_init_enter (&once)) { GType tp_type = TP_TYPE_CLIENT; tp_proxy_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (tp_type, tp_cli_client_add_signals); tp_proxy_subclass_add_error_mapping (tp_type, TP_ERROR_PREFIX, TP_ERROR, TP_TYPE_ERROR); g_once_init_leave (&once, 1); } } telepathy-glib-0.24.2/telepathy-glib/client.h0000644000175000017500000000463712652510705016010 00000000000000/* * client.h - proxy for a Telepathy client * * Copyright (C) 2009 Collabora Ltd. * Copyright (C) 2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_CLIENT_H #define TP_CLIENT_H #include #include #include G_BEGIN_DECLS typedef struct _TpClient TpClient; typedef struct _TpClientClass TpClientClass; typedef struct _TpClientPrivate TpClientPrivate; typedef struct _TpClientClassPrivate TpClientClassPrivate; struct _TpClient { /**/ TpProxy parent; TpClientPrivate *priv; }; struct _TpClientClass { /**/ TpProxyClass parent_class; GCallback _padding[7]; TpClientClassPrivate *priv; }; GType tp_client_get_type (void); #define TP_TYPE_CLIENT \ (tp_client_get_type ()) #define TP_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_CLIENT, \ TpClient)) #define TP_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_CLIENT, \ TpClientClass)) #define TP_IS_CLIENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_CLIENT)) #define TP_IS_CLIENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_CLIENT)) #define TP_CLIENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_CLIENT, \ TpClientClass)) void tp_client_init_known_interfaces (void); G_END_DECLS #include #endif telepathy-glib-0.24.2/telepathy-glib/svc-channel-dispatcher.h0000644000175000017500000000053412652510705021047 00000000000000#if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only can be included directly." #endif #ifndef __TP_META_SVC_CHANNEL_DISPATCHER_H__ #define __TP_META_SVC_CHANNEL_DISPATCHER_H__ #include #endif telepathy-glib-0.24.2/telepathy-glib/connection.xml0000644000175000017500000000332512652510705017233 00000000000000 Connection interfaces telepathy-glib-0.24.2/telepathy-glib/util-internal.h0000644000175000017500000000777312652510705017325 00000000000000/**/ /* * util-internal.h - Headers for non-public telepathy-glib utility functions * * Copyright (C) 2009 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __TP_UTIL_INTERNAL_H__ #define __TP_UTIL_INTERNAL_H__ #include "config.h" #include #include #include #include #include GArray *_tp_quark_array_copy (const GQuark *quarks) G_GNUC_WARN_UNUSED_RESULT; void _tp_quark_array_merge (GArray *array, const GQuark *quarks, gssize n); void _tp_quark_array_merge_valist (GArray *array, GQuark feature, va_list var_args); #ifdef HAVE_GIO_UNIX GSocketAddress * _tp_create_temp_unix_socket (GSocketService *service, gchar **tmpdir, GError **error); #endif /* HAVE_GIO_UNIX */ GList * _tp_create_channel_request_list (TpSimpleClientFactory *factory, GHashTable *request_props); /* Copied from wocky/wocky-utils.h */ gboolean _tp_enum_from_nick (GType enum_type, const gchar *nick, gint *value); const gchar *_tp_enum_to_nick (GType enum_type, gint value); const gchar *_tp_enum_to_nick_nonnull (GType enum_type, gint value); #define _tp_implement_finish_void(source, tag) \ if (g_simple_async_result_propagate_error (\ G_SIMPLE_ASYNC_RESULT (result), error)) \ return FALSE; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT(source), tag), \ FALSE); \ return TRUE; #define _tp_implement_finish_copy_pointer(source, tag, copy_func, \ out_param) \ GSimpleAsyncResult *_simple; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error (_simple, error)) \ return FALSE; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), tag), \ FALSE); \ if (out_param != NULL) \ *out_param = copy_func ( \ g_simple_async_result_get_op_res_gpointer (_simple)); \ return TRUE; #define _tp_implement_finish_return_copy_pointer(source, tag, copy_func) \ GSimpleAsyncResult *_simple; \ _simple = (GSimpleAsyncResult *) result; \ if (g_simple_async_result_propagate_error (_simple, error)) \ return NULL; \ g_return_val_if_fail (g_simple_async_result_is_valid (result, \ G_OBJECT (source), tag), \ NULL); \ return copy_func (g_simple_async_result_get_op_res_gpointer (_simple)); gboolean _tp_bind_connection_status_to_boolean (GBinding *binding, const GValue *src_value, GValue *dest_value, gpointer user_data); gboolean _tp_set_socket_address_type_and_access_control_type ( GHashTable *supported_sockets, TpSocketAddressType *address_type, TpSocketAccessControl *access_control, GError **error); GSocket * _tp_create_client_socket (TpSocketAddressType socket_type, GError **error); gboolean _tp_contacts_to_handles (TpConnection *connection, guint n_contacts, TpContact * const *contacts, GArray **handles); GPtrArray *_tp_contacts_from_values (GHashTable *table); GList *_tp_object_list_copy (GList *l); void _tp_object_list_free (GList *l); /* This can be removed once we depend on GLib 2.34 */ GList *_tp_g_list_copy_deep (GList *list, GCopyFunc func, gpointer user_data); #endif /* __TP_UTIL_INTERNAL_H__ */ telepathy-glib-0.24.2/telepathy-glib/proxy.c0000644000175000017500000021664312652510705015710 00000000000000/* * proxy.c - Base class for Telepathy client proxies * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "telepathy-glib/proxy-subclass.h" #include "telepathy-glib/proxy-internal.h" #include #include #include #include #include "dbus-internal.h" #define DEBUG_FLAG TP_DEBUG_PROXY #include "debug-internal.h" #include "simple-client-factory-internal.h" #include "util-internal.h" #include "_gen/tp-cli-generic-body.h" #if 0 #define MORE_DEBUG DEBUG #else #define MORE_DEBUG(...) G_STMT_START {} G_STMT_END #endif /** * TP_DBUS_ERRORS: * * #GError domain representing D-Bus errors not directly related to * Telepathy, for use by #TpProxy. The @code in a #GError with this * domain must be a member of #TpDBusError. * * This macro expands to a function call returning a #GQuark. * * Since: 0.7.1 */ GQuark tp_dbus_errors_quark (void) { static GQuark q = 0; if (q == 0) q = g_quark_from_static_string ("tp_dbus_errors_quark"); return q; } /** * TpDBusError: * @TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR: Raised if the error raised by * a remote D-Bus object is not recognised * @TP_DBUS_ERROR_PROXY_UNREFERENCED: Emitted in #TpProxy::invalidated * when the #TpProxy has lost its last reference * @TP_DBUS_ERROR_NO_INTERFACE: Raised by #TpProxy methods if the remote * object does not appear to have the required interface * @TP_DBUS_ERROR_NAME_OWNER_LOST: Emitted in #TpProxy::invalidated if the * remote process loses ownership of its bus name, and raised by * any #TpProxy methods that have not had a reply at that time or are called * after the proxy becomes invalid in this way (usually meaning it crashed) * @TP_DBUS_ERROR_INVALID_BUS_NAME: Raised if a D-Bus bus name given is not * valid, or is of an unacceptable type (e.g. well-known vs. unique) * @TP_DBUS_ERROR_INVALID_INTERFACE_NAME: Raised if a D-Bus interface or * error name given is not valid * @TP_DBUS_ERROR_INVALID_OBJECT_PATH: Raised if a D-Bus object path * given is not valid * @TP_DBUS_ERROR_INVALID_MEMBER_NAME: Raised if a D-Bus method or signal * name given is not valid * @TP_DBUS_ERROR_OBJECT_REMOVED: A generic error which can be used with * #TpProxy::invalidated to indicate an application-specific indication * that the remote object no longer exists, if no more specific error * is available. * @TP_DBUS_ERROR_CANCELLED: Raised from calls that re-enter the main * loop (*_run_*) if they are cancelled * @TP_DBUS_ERROR_INCONSISTENT: Raised if information received from a remote * object is inconsistent or otherwise obviously wrong (added in 0.7.17). * See also %TP_ERROR_CONFUSED. * * #GError codes for use with the %TP_DBUS_ERRORS domain. * * Since 0.11.5, there is a corresponding #GEnumClass type, * %TP_TYPE_DBUS_ERROR. * * Since: 0.7.1 */ /** * NUM_TP_DBUS_ERRORS: (skip) * * 1 more than the highest valid #TpDBusError at the time of compilation. * In new code, use %TP_NUM_DBUS_ERRORS instead. * * Since: 0.7.1 */ /** * TP_NUM_DBUS_ERRORS: * * 1 more than the highest valid #TpDBusError at the time of compilation * * Since: 0.19.0 */ /** * TP_TYPE_DBUS_ERROR: * * The #GEnumClass type of a #TpDBusError. * * Since: 0.11.5 */ /** * SECTION:proxy * @title: TpProxy * @short_description: base class for Telepathy client proxy objects * @see_also: #TpChannel, #TpConnection, #TpConnectionManager * * #TpProxy is a base class for Telepathy client-side proxies, which represent * an object accessed via D-Bus and provide access to its methods and signals. * * Since: 0.7.1 */ /** * SECTION:proxy-dbus-core * @title: TpProxy D-Bus core methods * @short_description: The D-Bus Introspectable, Peer and Properties interfaces * @see_also: #TpProxy * * All D-Bus objects support the Peer interface, and many support the * Introspectable and Properties interfaces. * * Since: 0.7.2 */ /** * SECTION:proxy-tp-properties * @title: TpProxy Telepathy Properties * @short_description: The Telepathy Properties interface * @see_also: #TpProxy * * As well as #TpProxy, proxy.h includes auto-generated client wrappers for the * Telepathy Properties interface, which can be implemented by any type of * object. * * The Telepathy Properties interface should not be confused with the D-Bus * core Properties interface. * * Since: 0.7.1 */ /** * SECTION:proxy-subclass * @title: TpProxy subclasses and mixins * @short_description: Providing extra functionality for a #TpProxy or * subclass, or subclassing it * @see_also: #TpProxy * * The implementations of #TpProxy subclasses and "mixin" functions need * access to the underlying dbus-glib objects used to implement the * #TpProxy API. * * Mixin functions to implement particular D-Bus interfaces should usually * be auto-generated, by copying tools/glib-client-gen.py from telepathy-glib. * * Since: 0.7.1 */ /** * TpProxy: * * Structure representing a Telepathy client-side proxy. * * Since: 0.7.1 */ /** * TpProxyInterfaceAddedCb: * @self: the proxy * @quark: a quark whose string value is the interface being added * @proxy: the #DBusGProxy for the added interface * @unused: unused * * The signature of a #TpProxy::interface-added signal callback. * * Since: 0.7.1 */ /** * TpProxyClass: * @parent_class: The parent class structure * @interface: If set non-zero by a subclass, #TpProxy will * automatically add this interface in its constructor * @must_have_unique_name: If set %TRUE by a subclass, the #TpProxy * constructor will fail if a well-known bus name is given * * The class of a #TpProxy. The struct fields not documented here are reserved. * * Since: 0.7.1 */ /** * TpProxyPrepareAsync: * @proxy: the object on which @feature has to be prepared * @feature: a #GQuark representing the feature to prepare * @callback: called when the feature has been prepared, or the preparation * failed * @user_data: data to pass to @callback * * Function called when @feature has to be prepared for @proxy. */ /** * TpProxyFeature: * @name: a #GQuark representing the name of the feature * @core: if %TRUE, every non-core feature of the class depends on this one, * and every feature (core or not) in subclasses depends on this one * @prepare_async: called when the feature has to be prepared * @prepare_before_signalling_connected_async: only relevant for * TpConnection sub-classes; same as @prepare_async but for * features wanting to have a chance to prepare themself before the * TpConnection object announce its %TP_CONNECTION_STATUS_CONNECTED status * @interfaces_needed: an array of #GQuark representing interfaces which have * to be implemented on the object in order to be able to prepare the feature * @depends_on: an array of #GQuark representing other features which have to * be prepared before trying to prepare this feature * @can_retry: If %TRUE, allow retrying preparation of this feature even if it * failed once already; if %FALSE any attempt of preparing the feature after * the preparation already failed once will immediately fail with re-calling * @prepare_async * * Structure representing a feature. * * Since: 0.11.3 */ /** * TpProxyClassFeatureListFunc: * @cls: a subclass of #TpProxyClass * * A function called to list the features supported by * tp_proxy_prepare_async(). Currently, only code inside telepathy-glib can * implement this. * * Returns: an array of feature descriptions * * Since: 0.11.3 */ typedef struct _TpProxyErrorMappingLink TpProxyErrorMappingLink; struct _TpProxyErrorMappingLink { const gchar *prefix; GQuark domain; GEnumClass *code_enum_class; TpProxyErrorMappingLink *next; }; typedef struct _TpProxyInterfaceAddLink TpProxyInterfaceAddLink; struct _TpProxyInterfaceAddLink { TpProxyInterfaceAddedCb callback; TpProxyInterfaceAddLink *next; }; struct _TpProxyFeaturePrivate { gpointer unused; }; /** * TpProxyInvokeFunc: * @self: the #TpProxy on which the D-Bus method was invoked * @error: %NULL if the method call succeeded, or a non-%NULL error if the * method call failed * @args: array of "out" arguments (return values) for the D-Bus method, * or %NULL if an error occurred or if there were no "out" arguments * @callback: the callback that should be invoked, as passed to * tp_proxy_pending_call_v0_new() * @user_data: user-supplied data to pass to the callback, as passed to * tp_proxy_pending_call_v0_new() * @weak_object: user-supplied object to pass to the callback, as passed to * tp_proxy_pending_call_v0_new() * * Signature of a callback invoked by the #TpProxy machinery after a D-Bus * method call has succeeded or failed. It is responsible for calling the * user-supplied callback. * * Because parts of dbus-glib aren't reentrant, this callback may be called * from an idle handler shortly after the method call reply is received, * rather than from the callback for the reply. * * At most one of @args and @error can be non-%NULL (implementations may * assert this). @args and @error may both be %NULL if a method with no * "out" arguments (i.e. a method that returns nothing) was called * successfully. * * The #TpProxyInvokeFunc must call callback with @user_data, @weak_object, * and appropriate arguments derived from @error and @args. It is responsible * for freeing @error and @args, if their ownership has not been transferred. * * Since: 0.7.1 */ typedef enum { /* Not a feature */ FEATURE_STATE_INVALID = GPOINTER_TO_INT (NULL), /* Nobody cares */ FEATURE_STATE_UNWANTED, /* Want to prepare, waiting for dependencies to be satisfied (or maybe * just poll_features being called) */ FEATURE_STATE_WANTED, /* Want to prepare, have called prepare_async */ FEATURE_STATE_TRYING, /* Couldn't prepare because a required interface on the connection * was missing and the connection wasn't connected yet. We'll retry to * prepare once the connection is connected. * This state is only used when preparing Connection features */ FEATURE_STATE_MISSING_IFACE, /* Couldn't prepare, gave up */ FEATURE_STATE_FAILED, /* Prepared */ FEATURE_STATE_READY } FeatureState; typedef struct { GSimpleAsyncResult *result; GArray *features; gboolean core; } TpProxyPrepareRequest; static TpProxyPrepareRequest * tp_proxy_prepare_request_new (GSimpleAsyncResult *result, const GQuark *features) { TpProxyPrepareRequest *req = g_slice_new0 (TpProxyPrepareRequest); if (result != NULL) req->result = g_object_ref (result); req->features = _tp_quark_array_copy (features); g_assert (req->features != NULL); return req; } static void tp_proxy_prepare_request_finish (TpProxyPrepareRequest *req, const GError *error) { DEBUG ("%p", req); if (req->result != NULL) { if (error != NULL) g_simple_async_result_set_from_error (req->result, error); g_simple_async_result_complete_in_idle (req->result); g_object_unref (req->result); } g_array_unref (req->features); g_slice_free (TpProxyPrepareRequest, req); } struct _TpProxyPrivate { /* GQuark for interface => either a ref'd DBusGProxy *, * or the TpProxy itself used as a dummy value to indicate that * the DBusGProxy has not been needed yet */ GData *interfaces; /* feature => FeatureState */ GData *features; /* Queue of TpProxyPrepareRequest. The first requests are the core one, * sorted from the most upper super class to the subclass core features. * This is needed to guarantee than subclass features are not prepared * until the super class features have been prepared. */ GQueue *prepare_requests; GSimpleAsyncResult *will_announce_connected_result; /* Number of pending calls blocking will_announce_connected_result to be * completed */ guint pending_will_announce_calls; gboolean dispose_has_run; TpSimpleClientFactory *factory; }; G_DEFINE_TYPE (TpProxy, tp_proxy, G_TYPE_OBJECT) enum { PROP_DBUS_DAEMON = 1, PROP_DBUS_CONNECTION, PROP_BUS_NAME, PROP_OBJECT_PATH, PROP_INTERFACES, PROP_FACTORY, N_PROPS }; enum { SIGNAL_INTERFACE_ADDED, SIGNAL_INVALIDATED, N_SIGNALS }; static guint signals[N_SIGNALS] = {0}; static void tp_proxy_iface_destroyed_cb (DBusGProxy *dgproxy, TpProxy *self); /** * tp_proxy_borrow_interface_by_id: (skip) * @self: the TpProxy * @iface: quark representing the interface required * @error: used to raise an error in the #TP_DBUS_ERRORS domain if @iface * is invalid, @self has been invalidated or @self does not implement * @iface * * * * Returns: a borrowed reference to a #DBusGProxy * for which the bus name and object path are the same as for @self, but the * interface is as given (or %NULL if an @error is raised). * The reference is only valid as long as @self is. * * Since: 0.7.1 * Deprecated: Since 0.19.9. New code should use * tp_proxy_get_interface_by_id() instead. */ DBusGProxy * tp_proxy_borrow_interface_by_id (TpProxy *self, GQuark iface, GError **error) { return tp_proxy_get_interface_by_id (self, iface, error); } /** * tp_proxy_get_interface_by_id: (skip) * @self: the TpProxy * @iface: quark representing the interface required * @error: used to raise an error in the #TP_DBUS_ERRORS domain if @iface * is invalid, @self has been invalidated or @self does not implement * @iface * * * * Returns: a borrowed reference to a #DBusGProxy * for which the bus name and object path are the same as for @self, but the * interface is as given (or %NULL if an @error is raised). * The reference is only valid as long as @self is. * * Since: 0.19.9 */ DBusGProxy * tp_proxy_get_interface_by_id (TpProxy *self, GQuark iface, GError **error) { gpointer dgproxy; if (self->invalidated != NULL) { g_set_error (error, self->invalidated->domain, self->invalidated->code, "%s", self->invalidated->message); return NULL; } if (!tp_dbus_check_valid_interface_name (g_quark_to_string (iface), error)) return NULL; dgproxy = g_datalist_id_get_data (&self->priv->interfaces, iface); if (dgproxy == self) { /* dummy value - we've never actually needed the interface, so we * didn't create it, to avoid binding to all the signals */ dgproxy = dbus_g_proxy_new_for_name (self->dbus_connection, self->bus_name, self->object_path, g_quark_to_string (iface)); DEBUG ("%p: %s DBusGProxy is %p", self, g_quark_to_string (iface), dgproxy); g_signal_connect (dgproxy, "destroy", G_CALLBACK (tp_proxy_iface_destroyed_cb), self); g_datalist_id_set_data_full (&self->priv->interfaces, iface, dgproxy, g_object_unref); g_signal_emit (self, signals[SIGNAL_INTERFACE_ADDED], 0, (guint) iface, dgproxy); } if (dgproxy != NULL) { return dgproxy; } g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_NO_INTERFACE, "Object %s does not have interface %s", self->object_path, g_quark_to_string (iface)); return NULL; } /** * tp_proxy_has_interface_by_id: * @self: the #TpProxy (or subclass) * @iface: quark representing the D-Bus interface required * * Return whether this proxy is known to have a particular interface, by its * quark ID. This is equivalent to using g_quark_to_string() followed by * tp_proxy_has_interface(), but more efficient. * * Returns: %TRUE if this proxy implements the given interface. * * Since: 0.7.1 */ gboolean tp_proxy_has_interface_by_id (gpointer self, GQuark iface) { TpProxy *proxy = self; g_return_val_if_fail (TP_IS_PROXY (self), FALSE); return (g_datalist_id_get_data (&proxy->priv->interfaces, iface) != NULL); } /** * tp_proxy_has_interface: * @self: the #TpProxy (or subclass) * @iface: the D-Bus interface required, as a string * * Return whether this proxy is known to have a particular interface. In * versions older than 0.11.11, this was a macro wrapper around * tp_proxy_has_interface_by_id(). * * For objects that discover their interfaces at runtime, this method will * indicate that interfaces are missing until they are known to be present. * In subclasses that define features for use with tp_proxy_prepare_async(), * successfully preparing the "core" feature for that subclass (such as * %TP_CHANNEL_FEATURE_CORE or %TP_CONNECTION_FEATURE_CORE) implies that the * interfaces are known. * * Returns: %TRUE if this proxy implements the given interface. * Since: 0.7.1 */ gboolean tp_proxy_has_interface (gpointer self, const gchar *iface) { TpProxy *proxy = self; GQuark q = g_quark_try_string (iface); g_return_val_if_fail (TP_IS_PROXY (self), FALSE); return (q != 0 && g_datalist_id_get_data (&proxy->priv->interfaces, q) != NULL); } static void tp_proxy_lose_interface (GQuark unused, gpointer dgproxy_or_self, gpointer self) { if (dgproxy_or_self != self) g_signal_handlers_disconnect_by_func (dgproxy_or_self, G_CALLBACK (tp_proxy_iface_destroyed_cb), self); } static void tp_proxy_lose_interfaces (TpProxy *self) { g_datalist_foreach (&self->priv->interfaces, tp_proxy_lose_interface, self); g_datalist_clear (&self->priv->interfaces); } static void tp_proxy_poll_features (TpProxy *self, const GError *error); /* This signature is chosen to match GSourceFunc */ static gboolean tp_proxy_emit_invalidated (gpointer p) { TpProxy *self = TP_PROXY (p); g_signal_emit (self, signals[SIGNAL_INVALIDATED], 0, self->invalidated->domain, self->invalidated->code, self->invalidated->message); /* make all pending tp_proxy_prepare_async calls fail */ tp_proxy_poll_features (self, NULL); g_assert_cmpuint (g_queue_get_length (self->priv->prepare_requests), ==, 0); /* Don't clear the datalist until after we've emitted the signal, so * the pending call and signal connection friend classes can still get * to the proxies */ tp_proxy_lose_interfaces (self); if (self->dbus_connection != NULL) { dbus_g_connection_unref (self->dbus_connection); self->dbus_connection = NULL; } return FALSE; } /** * tp_proxy_invalidate: * @self: a proxy * @error: an error causing the invalidation * * Mark @self as having been invalidated - no further calls will work, and * if not already invalidated, the #TpProxy::invalidated signal will be emitted * with the given error. * * Since: 0.7.1 */ void tp_proxy_invalidate (TpProxy *self, const GError *error) { g_return_if_fail (self != NULL); g_return_if_fail (error != NULL); if (self->invalidated == NULL) { DEBUG ("%p: %s", self, error->message); self->invalidated = g_error_copy (error); tp_proxy_emit_invalidated (self); } } static void tp_proxy_iface_destroyed_cb (DBusGProxy *dgproxy, TpProxy *self) { /* We can't call any API on the proxy now. Because the proxies are all * for the same bus name, we can assume that all of them are equally * useless now */ tp_proxy_lose_interfaces (self); /* We need to be able to delay emitting the invalidated signal, so that * any queued-up method calls and signal handlers will run first, and so * it doesn't try to reenter libdbus. */ if (self->invalidated == NULL) { DEBUG ("%p", self); self->invalidated = g_error_new_literal (TP_DBUS_ERRORS, TP_DBUS_ERROR_NAME_OWNER_LOST, "Name owner lost (service crashed?)"); g_idle_add_full (G_PRIORITY_HIGH, tp_proxy_emit_invalidated, g_object_ref (self), g_object_unref); } } /** * tp_proxy_add_interface_by_id: (skip) * @self: the TpProxy, which must not have become #TpProxy::invalidated. * @iface: quark representing the interface to be added * * Declare that this proxy supports a given interface. * * To use methods and signals of that interface, either call * tp_proxy_get_interface_by_id() to get the #DBusGProxy, or use the * tp_cli_* wrapper functions (strongly recommended). * * If the interface is the proxy's "main interface", or has already been * added, then do nothing. * * Returns: either %NULL or a borrowed #DBusGProxy corresponding to @iface, * depending on implementation details. To reliably borrow the #DBusGProxy, use * tp_proxy_get_interface_by_id(). (This method should probably have * returned void; sorry.) * * Since: 0.7.1 */ DBusGProxy * tp_proxy_add_interface_by_id (TpProxy *self, GQuark iface) { DBusGProxy *iface_proxy = g_datalist_id_get_data (&self->priv->interfaces, iface); g_return_val_if_fail (tp_dbus_check_valid_interface_name (g_quark_to_string (iface), NULL), NULL); g_return_val_if_fail (tp_proxy_get_invalidated (self) == NULL, NULL); if (iface_proxy == NULL) { /* we don't want to actually create it just yet - dbus-glib will * helpfully wake us up on every signal, if we do. So we set a * dummy value (self), and replace it with the real value in * tp_proxy_get_interface_by_id */ g_datalist_id_set_data_full (&self->priv->interfaces, iface, self, NULL); } return iface_proxy; } /** * tp_proxy_add_interfaces: (skip) * @self: the TpProxy, which must not have become #TpProxy::invalidated. * @interfaces: the names of the interfaces to be added * * Declare that this proxy supports the given interfaces. Equivalent to calling * g_quark_from_string () followed by tp_proxy_add_interface_by_id () for each * of the interface names. * * Since: 0.14.4 */ void tp_proxy_add_interfaces (TpProxy *self, const gchar * const *interfaces) { const gchar * const *iter; if (G_UNLIKELY (interfaces == NULL)) return; for (iter = interfaces; *iter != NULL; iter++) { if (tp_dbus_check_valid_interface_name (*iter, NULL)) { GQuark q = g_quark_from_string (*iter); tp_proxy_add_interface_by_id (self, q); } else { DEBUG ("Ignoring invalid interface on %s: %s", tp_proxy_get_object_path (self), *iter); } } } static GQuark error_mapping_quark (void) { static GQuark q = 0; if (G_UNLIKELY (q == 0)) { q = g_quark_from_static_string ("TpProxyErrorMappingCb_0.7.1"); } return q; } /** * tp_proxy_dbus_error_to_gerror: * @self: a #TpProxy or subclass * @dbus_error: a D-Bus error name, for instance from the callback for * tp_cli_connection_connect_to_connection_error() * @debug_message: a debug message that accompanied the error name, or %NULL * @error: used to return the corresponding #GError * * Convert a D-Bus error name into a GError as if it was returned by a method * on this proxy. This method is useful when D-Bus error names are emitted in * signals, such as Connection.ConnectionError and * Group.MembersChangedDetailed. * * Since: 0.7.24 */ void tp_proxy_dbus_error_to_gerror (gpointer self, const char *dbus_error, const char *debug_message, GError **error) { GType proxy_type = TP_TYPE_PROXY; GType type; g_return_if_fail (TP_IS_PROXY (self)); if (error == NULL) return; g_return_if_fail (*error == NULL); if (!tp_dbus_check_valid_interface_name (dbus_error, error)) { return; } if (debug_message == NULL) debug_message = ""; for (type = G_TYPE_FROM_INSTANCE (self); type != proxy_type; type = g_type_parent (type)) { TpProxyErrorMappingLink *iter; for (iter = g_type_get_qdata (type, error_mapping_quark ()); iter != NULL; iter = iter->next) { size_t prefix_len = strlen (iter->prefix); if (!strncmp (dbus_error, iter->prefix, prefix_len) && dbus_error[prefix_len] == '.') { GEnumValue *code = g_enum_get_value_by_nick (iter->code_enum_class, dbus_error + prefix_len + 1); if (code != NULL) { g_set_error (error, iter->domain, code->value, "%s", debug_message); return; } } } } /* we don't have an error mapping - so let's just paste the * error name and message into TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR */ g_set_error (error, TP_DBUS_ERRORS, TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR, "%s: %s", dbus_error, debug_message); } GError * _tp_proxy_take_and_remap_error (TpProxy *self, GError *error) { if (error == NULL || error->domain != DBUS_GERROR || error->code != DBUS_GERROR_REMOTE_EXCEPTION) { return error; } else { GError *replacement = NULL; const gchar *dbus = dbus_g_error_get_name (error); tp_proxy_dbus_error_to_gerror (self, dbus, error->message, &replacement); g_error_free (error); return replacement; } } static void dup_quark_into_ptr_array (GQuark q, gpointer unused, gpointer user_data) { GPtrArray *strings = user_data; g_ptr_array_add (strings, g_strdup (g_quark_to_string (q))); } static void tp_proxy_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpProxy *self = TP_PROXY (object); switch (property_id) { case PROP_DBUS_DAEMON: if (TP_IS_DBUS_DAEMON (self)) { g_value_set_object (value, self); } else { g_value_set_object (value, self->dbus_daemon); } break; case PROP_DBUS_CONNECTION: g_value_set_boxed (value, self->dbus_connection); break; case PROP_BUS_NAME: g_value_set_string (value, self->bus_name); break; case PROP_OBJECT_PATH: g_value_set_string (value, self->object_path); break; case PROP_INTERFACES: { GPtrArray *strings = g_ptr_array_new (); g_datalist_foreach (&self->priv->interfaces, dup_quark_into_ptr_array, strings); g_ptr_array_add (strings, NULL); g_value_take_boxed (value, g_ptr_array_free (strings, FALSE)); } break; case PROP_FACTORY: g_value_set_object (value, self->priv->factory); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_proxy_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpProxy *self = TP_PROXY (object); switch (property_id) { case PROP_DBUS_DAEMON: if (TP_IS_DBUS_DAEMON (self)) { g_assert (g_value_get_object (value) == NULL); } else { TpProxy *daemon_as_proxy = TP_PROXY (g_value_get_object (value)); g_assert (self->dbus_daemon == NULL); if (daemon_as_proxy != NULL) self->dbus_daemon = TP_DBUS_DAEMON (g_object_ref (daemon_as_proxy)); if (daemon_as_proxy != NULL) { g_assert (self->dbus_connection == NULL || self->dbus_connection == daemon_as_proxy->dbus_connection); if (self->dbus_connection == NULL) self->dbus_connection = dbus_g_connection_ref (daemon_as_proxy->dbus_connection); } } break; case PROP_DBUS_CONNECTION: { DBusGConnection *conn = g_value_get_boxed (value); /* if we're given a NULL dbus-connection, but we've got a * DBusGConnection from the dbus-daemon, we want to keep it */ if (conn == NULL) return; if (self->dbus_connection == NULL) self->dbus_connection = g_value_dup_boxed (value); g_assert (self->dbus_connection == g_value_get_boxed (value)); } break; case PROP_BUS_NAME: g_assert (self->bus_name == NULL); self->bus_name = g_value_dup_string (value); break; case PROP_OBJECT_PATH: g_assert (self->object_path == NULL); self->object_path = g_value_dup_string (value); break; case PROP_FACTORY: g_assert (self->priv->factory == NULL); self->priv->factory = g_value_dup_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_proxy_init (TpProxy *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_PROXY, TpProxyPrivate); self->priv->prepare_requests = g_queue_new (); } static GQuark interface_added_cb_quark (void) { static GQuark q = 0; if (G_UNLIKELY (q == 0)) { q = g_quark_from_static_string ("TpProxyInterfaceAddedCb_0.7.1"); } return q; } static FeatureState tp_proxy_get_feature_state (TpProxy *self, GQuark feature) { return GPOINTER_TO_INT (g_datalist_id_get_data (&self->priv->features, feature)); } static void tp_proxy_set_feature_state (TpProxy *self, GQuark feature, FeatureState state) { g_datalist_id_set_data (&self->priv->features, feature, GINT_TO_POINTER (state)); } static void assert_feature_validity (TpProxy *self, const TpProxyFeature *feature) { g_assert (feature != NULL); /* Core features can't have depends, their depends are implicit */ if (feature->core) g_assert (feature->depends_on == NULL || feature->depends_on[0] == 0); /* prepare_before_signalling_connected_async only make sense for * TpConnection subclasses */ if (feature->prepare_before_signalling_connected_async != NULL) g_assert (TP_IS_CONNECTION (self)); } static GObject * tp_proxy_constructor (GType type, guint n_params, GObjectConstructParam *params) { GObjectClass *object_class = (GObjectClass *) tp_proxy_parent_class; TpProxy *self = TP_PROXY (object_class->constructor (type, n_params, params)); TpProxyClass *klass = TP_PROXY_GET_CLASS (self); TpProxyInterfaceAddLink *iter; GType proxy_parent_type = G_TYPE_FROM_CLASS (tp_proxy_parent_class); GType ancestor_type; _tp_register_dbus_glib_marshallers (); for (ancestor_type = type; ancestor_type != proxy_parent_type && ancestor_type != 0; ancestor_type = g_type_parent (ancestor_type)) { TpProxyClass *ancestor = g_type_class_peek (ancestor_type); const TpProxyFeature *features; guint i; GArray *core_features; for (iter = g_type_get_qdata (ancestor_type, interface_added_cb_quark ()); iter != NULL; iter = iter->next) g_signal_connect (self, "interface-added", G_CALLBACK (iter->callback), NULL); if (ancestor == NULL || ancestor->list_features == NULL) continue; features = ancestor->list_features (ancestor); if (features == NULL) continue; core_features = g_array_new (TRUE, FALSE, sizeof (GQuark)); for (i = 0; features[i].name != 0; i++) { assert_feature_validity (self, &features[i]); tp_proxy_set_feature_state (self, features[i].name, FEATURE_STATE_UNWANTED); if (features[i].core) { g_array_append_val (core_features, features[i].name); } } if (core_features->len > 0) { TpProxyPrepareRequest *req; req = tp_proxy_prepare_request_new (NULL, (const GQuark *) core_features->data); req->core = TRUE; g_queue_push_head (self->priv->prepare_requests, req); DEBUG ("%p: request %p represents core features on %s", self, req, g_type_name (ancestor_type)); } g_array_unref (core_features); } g_return_val_if_fail (self->dbus_connection != NULL, NULL); g_return_val_if_fail (self->object_path != NULL, NULL); g_return_val_if_fail (self->bus_name != NULL, NULL); g_return_val_if_fail (tp_dbus_check_valid_object_path (self->object_path, NULL), NULL); g_return_val_if_fail (tp_dbus_check_valid_bus_name (self->bus_name, TP_DBUS_NAME_TYPE_ANY, NULL), NULL); tp_proxy_add_interface_by_id (self, TP_IFACE_QUARK_DBUS_INTROSPECTABLE); tp_proxy_add_interface_by_id (self, TP_IFACE_QUARK_DBUS_PEER); tp_proxy_add_interface_by_id (self, TP_IFACE_QUARK_DBUS_PROPERTIES); if (klass->interface != 0) { tp_proxy_add_interface_by_id (self, klass->interface); } /* Some interfaces are stateful, so we only allow binding to a unique * name, like in dbus_g_proxy_new_for_name_owner() */ if (klass->must_have_unique_name) { g_return_val_if_fail (self->bus_name[0] == ':', NULL); } return (GObject *) self; } static GQuark const no_quarks[] = { 0 }; static void tp_proxy_dispose (GObject *object) { TpProxy *self = TP_PROXY (object); GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_PROXY_UNREFERENCED, "Proxy unreferenced" }; if (self->priv->dispose_has_run) return; self->priv->dispose_has_run = TRUE; DEBUG ("%p", self); tp_proxy_invalidate (self, &e); tp_clear_object (&self->dbus_daemon); tp_clear_object (&self->priv->factory); G_OBJECT_CLASS (tp_proxy_parent_class)->dispose (object); } static void tp_proxy_finalize (GObject *object) { TpProxy *self = TP_PROXY (object); DEBUG ("%p", self); if (self->priv->features != NULL) g_datalist_clear (&self->priv->features); g_assert (self->invalidated != NULL); g_error_free (self->invalidated); /* invalidation ensures that these have gone away */ g_assert_cmpuint (g_queue_get_length (self->priv->prepare_requests), ==, 0); tp_clear_pointer (&self->priv->prepare_requests, g_queue_free); g_free (self->bus_name); g_free (self->object_path); G_OBJECT_CLASS (tp_proxy_parent_class)->finalize (object); } /** * tp_proxy_or_subclass_hook_on_interface_add: * @proxy_or_subclass: The #GType of #TpProxy or a subclass * @callback: A signal handler for #TpProxy::interface-added * * Arrange for @callback to be connected to #TpProxy::interface-added * during the #TpProxy constructor. This is done sufficiently early that * it will see the signal for the default interface (@interface member of * #TpProxyClass), if any, being added. The intended use is for the callback * to call dbus_g_proxy_add_signal() on the new #DBusGProxy. * * Since 0.7.6, to ensure correct overriding of interfaces that might be * added to telepathy-glib, before calling this function you should * call tp_proxy_init_known_interfaces, tp_connection_init_known_interfaces, * tp_channel_init_known_interfaces etc. as appropriate for the subclass. * * Since: 0.7.1 */ void tp_proxy_or_subclass_hook_on_interface_add (GType proxy_or_subclass, TpProxyInterfaceAddedCb callback) { GQuark q = interface_added_cb_quark (); TpProxyInterfaceAddLink *old_link = g_type_get_qdata (proxy_or_subclass, q); TpProxyInterfaceAddLink *new_link; g_return_if_fail (g_type_is_a (proxy_or_subclass, TP_TYPE_PROXY)); g_return_if_fail (callback != NULL); /* never freed, suppressed in telepathy-glib.supp */ new_link = g_slice_new0 (TpProxyInterfaceAddLink); new_link->callback = callback; new_link->next = old_link; /* may be NULL */ g_type_set_qdata (proxy_or_subclass, q, new_link); } /** * tp_proxy_subclass_add_error_mapping: * @proxy_subclass: The #GType of a subclass of #TpProxy (which must not be * #TpProxy itself) * @static_prefix: A prefix for D-Bus error names, not including the trailing * dot (which must remain valid forever, and should usually be in static * storage) * @domain: A quark representing the corresponding #GError domain * @code_enum_type: The type of a subclass of #GEnumClass * * Register a mapping from D-Bus errors received from the given proxy * subclass to #GError instances. * * When a D-Bus error is received, the #TpProxy code checks for error * mappings registered for the class of the proxy receiving the error, * then for all of its parent classes. * * If there is an error mapping for which the D-Bus error name * starts with the mapping's @static_prefix, the proxy will check the * corresponding @code_enum_type for a value whose @value_nick is * the rest of the D-Bus error name (with the leading dot removed). If there * isn't such a value, it will continue to try other error mappings. * * If a suitable error mapping and code are found, the #GError that is raised * will have its error domain set to the @domain from the error mapping, * and its error code taken from the enum represented by the @code_enum_type. * * If no suitable error mapping or code is found, the #GError will have * error domain %TP_DBUS_ERRORS and error code * %TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR. * * Since: 0.7.1 */ void tp_proxy_subclass_add_error_mapping (GType proxy_subclass, const gchar *static_prefix, GQuark domain, GType code_enum_type) { GQuark q = error_mapping_quark (); TpProxyErrorMappingLink *old_link = g_type_get_qdata (proxy_subclass, q); TpProxyErrorMappingLink *new_link; GType tp_type_proxy = TP_TYPE_PROXY; g_return_if_fail (proxy_subclass != tp_type_proxy); g_return_if_fail (g_type_is_a (proxy_subclass, tp_type_proxy)); g_return_if_fail (static_prefix != NULL); g_return_if_fail (domain != 0); g_return_if_fail (code_enum_type != G_TYPE_INVALID); new_link = g_slice_new0 (TpProxyErrorMappingLink); new_link->prefix = static_prefix; new_link->domain = domain; /* We never unref the enum type - intentional one-per-process leak. * See "tp_proxy_subclass_add_error_mapping refs the enum" in our valgrind * suppressions file */ new_link->code_enum_class = g_type_class_ref (code_enum_type); new_link->next = old_link; /* may be NULL */ g_type_set_qdata (proxy_subclass, q, new_link); } static void tp_proxy_class_init (TpProxyClass *klass) { GParamSpec *param_spec; GObjectClass *object_class = G_OBJECT_CLASS (klass); tp_proxy_init_known_interfaces (); g_type_class_add_private (klass, sizeof (TpProxyPrivate)); object_class->constructor = tp_proxy_constructor; object_class->get_property = tp_proxy_get_property; object_class->set_property = tp_proxy_set_property; object_class->dispose = tp_proxy_dispose; object_class->finalize = tp_proxy_finalize; /** * TpProxy:dbus-daemon: * * The D-Bus daemon for this object (this object itself, if it is a * TpDBusDaemon). Read-only except during construction. */ param_spec = g_param_spec_object ("dbus-daemon", "D-Bus daemon", "The D-Bus daemon used by this object, or this object itself if it's " "a TpDBusDaemon", TP_TYPE_DBUS_DAEMON, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_DAEMON, param_spec); /** * TpProxy:dbus-connection: (skip) * * The D-Bus connection for this object. Read-only except during * construction. */ param_spec = g_param_spec_boxed ("dbus-connection", "D-Bus connection", "The D-Bus connection used by this object", DBUS_TYPE_G_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_DBUS_CONNECTION, param_spec); /** * TpProxy:bus-name: * * The D-Bus bus name for this object. Read-only except during construction. */ param_spec = g_param_spec_string ("bus-name", "D-Bus bus name", "The D-Bus bus name for this object", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_BUS_NAME, param_spec); /** * TpProxy:object-path: * * The D-Bus object path for this object. Read-only except during * construction. */ param_spec = g_param_spec_string ("object-path", "D-Bus object path", "The D-Bus object path for this object", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec); /** * TpProxy:interfaces: * * Known D-Bus interface names for this object. */ param_spec = g_param_spec_boxed ("interfaces", "D-Bus interfaces", "Known D-Bus interface names for this object", G_TYPE_STRV, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_INTERFACES, param_spec); /** * TpProxy:factory: * * The #TpSimpleClientFactory used to create this proxy, * or %NULL if this proxy was not created through a factory. */ param_spec = g_param_spec_object ("factory", "Simple Client Factory", "The TpSimpleClientFactory used to create this proxy", TP_TYPE_SIMPLE_CLIENT_FACTORY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_FACTORY, param_spec); /** * TpProxy::interface-added: (skip) * @self: the proxy object * @id: the GQuark representing the interface * @proxy: the dbus-glib proxy representing the interface * * Emitted when this proxy has gained an interface. It is not guaranteed * to be emitted immediately, but will be emitted before the interface is * first used (at the latest: before it's returned from * tp_proxy_get_interface_by_id(), any signal is connected, or any * method is called). * * The intended use is to call dbus_g_proxy_add_signals(). This signal * should only be used by TpProy implementations */ signals[SIGNAL_INTERFACE_ADDED] = g_signal_new ("interface-added", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, DBUS_TYPE_G_PROXY); /** * TpProxy::invalidated: * @self: the proxy object * @domain: domain of a GError indicating why this proxy was invalidated * @code: error code of a GError indicating why this proxy was invalidated * @message: a message associated with the error * * Emitted when this proxy has been become invalid for * whatever reason. Any more specific signal should be emitted first. * * An invalidated proxy is one which can make no more method calls and will * emit no more D-Bus signals. This is typically because the D-Bus object * represented by the proxy ceased to exist, or there was some error * obtaining the initial state. * * Any pending or future method calls made on this proxy will fail gracefully * with the same error as returned by tp_proxy_get_invalidated(). */ signals[SIGNAL_INVALIDATED] = g_signal_new ("invalidated", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_INT, G_TYPE_STRING); } /** * tp_proxy_get_factory: * @self: a #TpProxy or subclass * * * * Returns: (transfer none): the same value as #TpProxy:factory property * * Since: 0.15.5 */ TpSimpleClientFactory * tp_proxy_get_factory (gpointer self) { TpProxy *proxy = self; g_return_val_if_fail (TP_IS_PROXY (self), NULL); return proxy->priv->factory; } void _tp_proxy_ensure_factory (gpointer proxy, TpSimpleClientFactory *factory) { TpProxy *self = TP_PROXY (proxy); if (self->priv->factory != NULL) return; if (factory != NULL) { self->priv->factory = g_object_ref (factory); } else { self->priv->factory = (TpSimpleClientFactory *) tp_automatic_client_factory_new (self->dbus_daemon); } _tp_simple_client_factory_insert_proxy (self->priv->factory, self); } /** * tp_proxy_get_dbus_daemon: * @self: a #TpProxy or subclass * * * * Returns: (transfer none): a borrowed reference to the #TpDBusDaemon for * this object, if any; always %NULL if this object is itself a * #TpDBusDaemon. The caller must reference the returned object with * g_object_ref() if it will be kept. * * Since: 0.7.17 */ TpDBusDaemon * tp_proxy_get_dbus_daemon (gpointer self) { TpProxy *proxy = TP_PROXY (self); return proxy->dbus_daemon; } /** * tp_proxy_get_dbus_connection: (skip) * @self: a #TpProxy or subclass * * * * Returns: a borrowed reference to the D-Bus connection used by this object. * The caller must reference the returned pointer with * dbus_g_connection_ref() if it will be kept. * * Since: 0.7.17 */ DBusGConnection * tp_proxy_get_dbus_connection (gpointer self) { TpProxy *proxy = TP_PROXY (self); return proxy->dbus_connection; } /** * tp_proxy_get_bus_name: * @self: a #TpProxy or subclass * * * * Returns: the bus name of the application exporting the object. The caller * must copy the string with g_strdup() if it will be kept. * * Since: 0.7.17 */ const gchar * tp_proxy_get_bus_name (gpointer self) { TpProxy *proxy = TP_PROXY (self); return proxy->bus_name; } /** * tp_proxy_get_object_path: * @self: a #TpProxy or subclass * * * * Returns: the object path of the remote object. The caller must copy the * string with g_strdup() if it will be kept. * * Since: 0.7.17 */ const gchar * tp_proxy_get_object_path (gpointer self) { TpProxy *proxy = TP_PROXY (self); return proxy->object_path; } /** * tp_proxy_get_invalidated: * @self: a #TpProxy or subclass * * * * Returns: the reason this proxy was invalidated, or %NULL if has not been * invalidated. The caller must copy the error, for instance with * g_error_copy(), if it will be kept. * * Since: 0.7.17 */ const GError * tp_proxy_get_invalidated (gpointer self) { TpProxy *proxy = TP_PROXY (self); return proxy->invalidated; } /** * tp_proxy_dbus_g_proxy_claim_for_signal_adding: * @proxy: a #DBusGProxy * * Attempt to "claim" a #DBusGProxy for addition of signal signatures. * If this function has not been called on @proxy before, %TRUE is * returned, and the caller may safely call dbus_g_proxy_add_signal() * on @proxy. If this function has already been caled, %FALSE is * returned, and the caller may not safely call dbus_g_proxy_add_signal(). * * This is intended for use by auto-generated signal-adding functions, * to allow interfaces provided as local extensions to override those in * telepathy-glib without causing assertion failures. * * Returns: %TRUE if it is safe to call dbus_g_proxy_add_signal() * Since: 0.7.6 */ gboolean tp_proxy_dbus_g_proxy_claim_for_signal_adding (DBusGProxy *proxy) { static GQuark q = 0; g_return_val_if_fail (proxy != NULL, FALSE); if (G_UNLIKELY (q == 0)) { q = g_quark_from_static_string ( "tp_proxy_dbus_g_proxy_claim_for_signal_adding@0.7.6"); } if (g_object_get_qdata ((GObject *) proxy, q) != NULL) { /* Someone else has already added signal signatures for this interface. * We can't do it again or it'll cause an assertion */ return FALSE; } /* the proxy is just used as qdata here because it's a convenient * non-NULL pointer */ g_object_set_qdata ((GObject *) proxy, q, proxy); return TRUE; } static gpointer tp_proxy_once (gpointer data G_GNUC_UNUSED) { GType type = TP_TYPE_PROXY; tp_proxy_or_subclass_hook_on_interface_add (type, tp_cli_generic_add_signals); return NULL; } /** * tp_proxy_init_known_interfaces: * * Ensure that the known interfaces for TpProxy have been set up. * This is done automatically when necessary, but for correct * overriding of library interfaces by local extensions, you should * call this function before calling * tp_proxy_or_subclass_hook_on_interface_add(). * * Functions like tp_connection_init_known_interfaces and * tp_channel_init_known_interfaces do this automatically. * * Since: 0.7.6 */ void tp_proxy_init_known_interfaces (void) { static GOnce once = G_ONCE_INIT; g_once (&once, tp_proxy_once, NULL); } static const TpProxyFeature * tp_proxy_subclass_get_feature (GType type, GQuark feature) { GType proxy_type = TP_TYPE_PROXY; g_return_val_if_fail (g_type_is_a (type, proxy_type), NULL); /* we stop at proxy_type since we know that TpProxy has no features */ for ( ; type != proxy_type; type = g_type_parent (type)) { guint i; TpProxyClass *cls = g_type_class_ref (type); const TpProxyFeature *features; if (cls->list_features == NULL) goto cont; features = cls->list_features (cls); if (features == NULL) goto cont; for (i = 0; features[i].name != 0; i++) { if (features[i].name == feature) { g_type_class_unref (cls); return features + i; } } cont: g_type_class_unref (cls); } return FALSE; } /** * tp_proxy_is_prepared: * @self: an instance of a #TpProxy subclass * @feature: a feature that is supported by @self's class * * Return %TRUE if @feature has been prepared successfully, or %FALSE if * @feature has not been requested, has not been prepared yet, or is not * available on this object at all. * * (For instance, if @feature is %TP_CHANNEL_FEATURE_CHAT_STATES and @self * is a #TpChannel in a protocol that doesn't actually implement chat states, * or is not a #TpChannel at all, then this method will return %FALSE.) * * To prepare features, call tp_proxy_prepare_async(). * * Returns: %TRUE if @feature has been prepared successfully * * Since: 0.11.3 */ gboolean tp_proxy_is_prepared (gpointer self, GQuark feature) { FeatureState state; g_return_val_if_fail (TP_IS_PROXY (self), FALSE); if (tp_proxy_get_invalidated (self) != NULL) return FALSE; state = tp_proxy_get_feature_state (self, feature); return (state == FEATURE_STATE_READY); } /* * _tp_proxy_is_preparing: * @self: an instance of a #TpProxy subclass * @feature: a feature that is supported by @self's class * * Return %TRUE if @feature has been requested, but has not been prepared * successfully or unsuccessfully yet. * * It is an error to use a @feature not specifically supported by @self - for * instance, it is an error to use %TP_CHANNEL_FEATURE_CHAT_STATES on any * #TpProxy that is not also a #TpChannel. * * Subclasses of #TpProxy should use this method to check whether to take * action for a particular feature. For instance, #TpChannel could call this * method for %TP_CHANNEL_CHAT_STATES when it discovers that the ChatStates * interface is supported, to decide whether to fetch the state of that * interface. * * Returns: %TRUE if @feature has been requested, but preparing it has neither * succeeded nor failed yet */ gboolean _tp_proxy_is_preparing (gpointer self, GQuark feature) { FeatureState state; g_return_val_if_fail (TP_IS_PROXY (self), FALSE); if (tp_proxy_get_invalidated (self) != NULL) return FALSE; state = tp_proxy_get_feature_state (self, feature); g_return_val_if_fail (state != FEATURE_STATE_INVALID, FALSE); return (state == FEATURE_STATE_WANTED || state == FEATURE_STATE_TRYING); } static gboolean check_feature_interfaces (TpProxy *self, GQuark name) { const TpProxyFeature *feature = tp_proxy_subclass_get_feature ( G_OBJECT_TYPE (self), name); guint i; if (feature->interfaces_needed == NULL) return TRUE; for (i = 0; feature->interfaces_needed[i] != 0; i++) { if (!tp_proxy_has_interface_by_id (self, feature->interfaces_needed[i])) { DEBUG ("Proxy doesn't implement %s, can't prepare feature %s", g_quark_to_string (feature->interfaces_needed[i]), g_quark_to_string (name)); return FALSE; } } return TRUE; } /* Returns %TRUE if all the deps of @name are ready * @can_retry: if %TRUE dependencies which have failed but have * TpProxyFeature.can_retry won't be considered as having failed so we'll * still have a change to retry preparing those. * @failed: (out): %TRUE if one of @name's dep can't be prepared and so * @name can't be either */ static gboolean check_depends_ready (TpProxy *self, GQuark name, gboolean can_retry, gboolean *failed) { const TpProxyFeature *feature = tp_proxy_subclass_get_feature ( G_OBJECT_TYPE (self), name); guint i; gboolean ready = TRUE; g_assert (failed != NULL); *failed = FALSE; if (feature->depends_on == NULL) return TRUE; for (i = 0; feature->depends_on[i] != 0; i++) { GQuark dep = feature->depends_on[i]; const TpProxyFeature *dep_feature = tp_proxy_subclass_get_feature ( G_OBJECT_TYPE (self), dep); FeatureState dep_state; dep_state = tp_proxy_get_feature_state (self, dep); switch (dep_state) { case FEATURE_STATE_INVALID: DEBUG ("Can't prepare %s, because %s (a dependency) is " "invalid", g_quark_to_string (name), g_quark_to_string (dep)); *failed = TRUE; return FALSE; case FEATURE_STATE_FAILED: case FEATURE_STATE_MISSING_IFACE: if (!can_retry || !dep_feature->can_retry) { DEBUG ("Can't prepare %s, because %s (a dependency) is " "failed to prepare", g_quark_to_string (name), g_quark_to_string (dep)); *failed = TRUE; return FALSE; } DEBUG ("retry preparing dep: %s", g_quark_to_string (dep)); tp_proxy_set_feature_state (self, dep, FEATURE_STATE_WANTED); ready = FALSE; break; case FEATURE_STATE_UNWANTED: case FEATURE_STATE_WANTED: case FEATURE_STATE_TRYING: ready = FALSE; break; case FEATURE_STATE_READY: break; } } return ready; } static void depends_prepare_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpProxy *self = TP_PROXY (source); tp_proxy_poll_features (self, NULL); } static void prepare_depends (TpProxy *self, GQuark name) { const TpProxyFeature *feature; feature = tp_proxy_subclass_get_feature (G_OBJECT_TYPE (self), name); g_assert (feature->depends_on != NULL); tp_proxy_prepare_async (self, feature->depends_on, depends_prepare_cb, NULL); } /** * tp_proxy_prepare_async: * @self: an instance of a #TpProxy subclass * @features: (transfer none) (array zero-terminated=1) (allow-none): an array * of desired features, ending with 0; %NULL is equivalent to an array * containing only 0 * @callback: if not %NULL, called exactly once, when the features have all * been prepared or failed to prepare, or after the proxy is invalidated * @user_data: user data for @callback * * #TpProxy itself does not support any features, but subclasses like * #TpChannel can support features, which can either be core functionality like * %TP_CHANNEL_FEATURE_CORE, or extended functionality like * %TP_CHANNEL_FEATURE_CHAT_STATES. * * Proxy instances start with no features prepared. When features are * requested via tp_proxy_prepare_async(), the proxy starts to do the * necessary setup to use those features. * * tp_proxy_prepare_async() always waits for core functionality of the proxy's * class to be prepared, even if it is not specifically requested: for * instance, because %TP_CHANNEL_FEATURE_CORE is core functionality of a * #TpChannel, * * |[ * TpChannel *channel = ...; * * tp_proxy_prepare_async (channel, NULL, callback, user_data); * ]| * * is equivalent to * * |[ * TpChannel *channel = ...; * GQuark features[] = { TP_CHANNEL_FEATURE_CORE, 0 }; * * tp_proxy_prepare_async (channel, features, callback, user_data); * ]| * * If a feature represents core functionality (like %TP_CHANNEL_FEATURE_CORE), * failure to prepare it will result in tp_proxy_prepare_async() finishing * unsuccessfully: if failure to prepare the feature indicates that the proxy * is no longer useful, it will also emit #TpProxy::invalidated. * * If a feature represents non-essential functionality * (like %TP_CHANNEL_FEATURE_CHAT_STATES), or is not supported by the object * at all, then failure to prepare it is not fatal: * tp_proxy_prepare_async() will complete successfully, but * tp_proxy_is_prepared() will still return %FALSE for the feature, and * accessor methods for the feature will typically return a dummy value. * * Some #TpProxy subclasses automatically start to prepare their core * features when instantiated, and features will sometimes become prepared as * a side-effect of other actions, but to ensure that a feature is present you * must generally call tp_proxy_prepare_async() and wait for the result. * * Since: 0.11.3 */ void tp_proxy_prepare_async (gpointer self, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data) { TpProxy *proxy = self; GSimpleAsyncResult *result = NULL; guint i; g_return_if_fail (TP_IS_PROXY (self)); if (features == NULL) features = no_quarks; for (i = 0; features[i] != 0; i++) { FeatureState state = tp_proxy_get_feature_state (self, features[i]); const TpProxyFeature *feature = tp_proxy_subclass_get_feature ( G_OBJECT_TYPE (self), features[i]); /* We just skip unknown features, which have state FEATURE_STATE_INVALID * (this doesn't seem ideal, but is * consistent with TpAccountManager's existing behaviour) */ if (state == FEATURE_STATE_INVALID) { continue; } else if (state == FEATURE_STATE_UNWANTED || (state == FEATURE_STATE_FAILED && feature->can_retry)) { gboolean failed; /* Check deps. We only offer there the chance to retry a previously * failed dependency. Doing it in tp_proxy_poll_features() could * result in an infinite loop if we'd depends on 2 features which * are constantly failing. */ if (!check_depends_ready (self, features[i], TRUE, &failed)) { if (failed) { /* We can't prepare the feature because of its deps */ tp_proxy_set_feature_state (self, features[i], FEATURE_STATE_FAILED); continue; } prepare_depends (self, features[i]); } tp_proxy_set_feature_state (self, features[i], FEATURE_STATE_WANTED); } } if (callback != NULL) result = g_simple_async_result_new (self, callback, user_data, tp_proxy_prepare_async); if (proxy->invalidated != NULL) { if (result != NULL) { g_simple_async_result_set_from_error (result, proxy->invalidated); g_simple_async_result_complete_in_idle (result); } goto finally; } g_queue_push_tail (proxy->priv->prepare_requests, tp_proxy_prepare_request_new (result, features)); tp_proxy_poll_features (proxy, NULL); finally: if (result != NULL) g_object_unref (result); } /** * tp_proxy_prepare_finish: * @self: an instance of a #TpProxy subclass * @result: the result passed to the callback of tp_proxy_prepare_async() * @error: used to return an error if %FALSE is returned * * Check for error in a call to tp_proxy_prepare_async(). An error here * generally indicates that either the asynchronous call was cancelled, * or @self has emitted #TpProxy::invalidated. * * Returns: %FALSE (setting @error) if tp_proxy_prepare_async() failed * or was cancelled * * Since: 0.11.3 */ gboolean tp_proxy_prepare_finish (gpointer self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_proxy_prepare_async); } static gboolean prepare_finish (TpProxy *self, GAsyncResult *result, gpointer source, GError **error) { _tp_implement_finish_void (self, source); } static void feature_prepared_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpProxy *self = TP_PROXY (source); TpProxyFeature *feature = user_data; GError *error = NULL; gboolean prepared = TRUE; if (!prepare_finish (self, result, feature->prepare_async, &error)) { DEBUG ("Failed to prepare %s: %s", g_quark_to_string (feature->name), error->message); prepared = FALSE; g_error_free (error); } _tp_proxy_set_feature_prepared (self, feature->name, prepared); } static void prepare_feature (TpProxy *self, const TpProxyFeature *feature) { /* If no function is set, then subclass is supposed to call * _tp_proxy_set_feature_prepared() itself. This is used by features prepared * from constructed. */ if (feature->prepare_async == NULL) return; feature->prepare_async (self, feature, feature_prepared_cb, (gpointer) feature); } static gboolean core_prepared (TpProxy *self) { /* All the core features have been prepared if the head of the * prepare_requests queue is NOT a core feature */ TpProxyPrepareRequest *req = g_queue_peek_head (self->priv->prepare_requests); if (req == NULL) return TRUE; return !req->core; } /* Returns %TRUE if all the features requested in @req have complete their * preparation */ static gboolean request_is_complete (TpProxy *self, TpProxyPrepareRequest *req) { guint i; gboolean complete = TRUE; for (i = 0; i < req->features->len; i++) { GQuark feature = g_array_index (req->features, GQuark, i); FeatureState state = tp_proxy_get_feature_state (self, feature); const TpProxyFeature *feat_struct = tp_proxy_subclass_get_feature ( G_OBJECT_TYPE (self), feature); switch (state) { case FEATURE_STATE_UNWANTED: /* this can only happen in the special pseudo-request for the * core features, which blocks everything */ g_assert (req->core); complete = FALSE; /* fall through to treat it as WANTED */ case FEATURE_STATE_WANTED: if (core_prepared (self) || req->core) { gboolean failed; /* Check if we have the required interfaces. We can't do that * in tp_proxy_prepare_async() as CORE have to be prepared */ if (!check_feature_interfaces (self, feature)) { if (TP_IS_CONNECTION (self) && tp_connection_get_status ((TpConnection *) self, NULL) != TP_CONNECTION_STATUS_CONNECTED) { /* Give a chance to retry preparing the feature once * the Connection is connected as it may still gain * the interface. */ tp_proxy_set_feature_state (self, feature, FEATURE_STATE_MISSING_IFACE); } else { tp_proxy_set_feature_state (self, feature, FEATURE_STATE_FAILED); } continue; } if (check_depends_ready (self, feature, FALSE, &failed)) { /* We can prepare it now */ DEBUG ("%p: calling callback for %s", self, g_quark_to_string (feature)); tp_proxy_set_feature_state (self, feature, FEATURE_STATE_TRYING); prepare_feature (self, feat_struct); complete = FALSE; } else if (failed) { tp_proxy_set_feature_state (self, feature, FEATURE_STATE_FAILED); } else { /* We have to wait until the deps finish their * preparation. */ complete = FALSE; } } break; case FEATURE_STATE_TRYING: complete = FALSE; break; case FEATURE_STATE_INVALID: case FEATURE_STATE_FAILED: case FEATURE_STATE_MISSING_IFACE: case FEATURE_STATE_READY: /* nothing more to do */ break; } } return complete; } static void finish_all_requests (TpProxy *self, const GError *error) { GList *iter; GQueue *tmp = g_queue_copy (self->priv->prepare_requests); g_queue_clear (self->priv->prepare_requests); for (iter = tmp->head; iter != NULL; iter = g_list_next (iter)) { tp_proxy_prepare_request_finish (iter->data, error); } g_queue_free (tmp); } /* * tp_proxy_poll_features: * @self: a proxy * @error: if not %NULL, fail all feature requests with this error * * For each feature in state WANTED, if its dependencies have been satisfied, * call the callback and advance it to state TRYING. * * For each feature request, see if it's finished yet. * * Called every time the set of prepared/failed features changes, * when a temporary error causes introspection to fail, and when * #TpProxy.invalidated changes. * * If @error is %NULL, #TpProxy.invalidated is also checked. */ static void tp_proxy_poll_features (TpProxy *self, const GError *error) { const gchar *error_source = "temporarily failed"; GList *iter; GList *next; if (g_queue_get_length (self->priv->prepare_requests) == 0) return; g_object_ref (self); for (iter = self->priv->prepare_requests->head; iter != NULL; iter = next) { TpProxyPrepareRequest *req = iter->data; TpProxyPrepareRequest *head = g_queue_peek_head ( self->priv->prepare_requests); if (error == NULL) { error_source = "invalidated"; error = self->invalidated; } if (error != NULL) { DEBUG ("%p: %s, ending all requests", self, error_source); finish_all_requests (self, error); break; } next = iter->next; /* Core features have to be prepared first, in superclass-to-subclass * order. The next core feature to be prepared, if any, is always at the * head of prepare_requests. */ if (!core_prepared (self) && req != head) { DEBUG ("%p: core features not ready yet, nothing prepared", self); continue; } if (request_is_complete (self, req)) { DEBUG ("%p: request %p prepared", self, req); g_queue_delete_link (self->priv->prepare_requests, iter); tp_proxy_prepare_request_finish (req, NULL); } } g_object_unref (self); } /* * _tp_proxy_set_feature_prepared: * @self: a proxy * @feature: a feature made available by @self's class * @succeeded: %TRUE if the feature was prepared successfully * * Record that @self has attempted to prepare @feature. No further * attempts will be made to prepare it. If @succeeded is %TRUE, * tp_proxy_is_prepared() will return %TRUE for @self and @feature. * Whether @succeeded is %TRUE or %FALSE, any calls to * tp_proxy_prepare_async() that were only waiting for @feature will * finish successfully. * * If @feature represents core functionality of the class that should * always have worked (such as the GetAll method call for a #TpAccount's * properties), the subclass should instead call either * _tp_proxy_set_features_failed() (if it might still be possible to use @self * later, as for a #TpConnectionManager) or tp_proxy_invalidate() (if not) * instead; either of these will cause all calls to tp_proxy_prepare_async() * to finish with an error. */ void _tp_proxy_set_feature_prepared (TpProxy *self, GQuark feature, gboolean succeeded) { g_return_if_fail (TP_IS_PROXY (self)); g_return_if_fail (tp_proxy_get_feature_state (self, feature) != FEATURE_STATE_INVALID); tp_proxy_set_feature_state (self, feature, succeeded ? FEATURE_STATE_READY : FEATURE_STATE_FAILED); tp_proxy_poll_features (self, NULL); } /* * _tp_proxy_set_features_failed: * @self: a proxy * @error: an error * * Record that @self has been unable to prepare any features, but is still * potentially usable. Any pending calls to tp_proxy_prepare_async() will * finish unsuccessfully with @error, but @self will *not* be invalidated. */ void _tp_proxy_set_features_failed (TpProxy *self, const GError *error) { g_return_if_fail (TP_IS_PROXY (self)); g_return_if_fail (error != NULL); tp_proxy_poll_features (self, error); } static void check_announce_connected (TpProxy *self, gboolean in_idle) { if (self->priv->pending_will_announce_calls != 0) return; if (in_idle) { g_simple_async_result_complete_in_idle ( self->priv->will_announce_connected_result); } else { g_simple_async_result_complete ( self->priv->will_announce_connected_result); } tp_clear_object (&self->priv->will_announce_connected_result); } static void prepare_before_signalling_connected_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpProxy *self = TP_PROXY (user_data); /* We don't care if the call succeeded or not as it was already prepared */ self->priv->pending_will_announce_calls--; check_announce_connected (self, FALSE); } static void foreach_feature (GQuark name, gpointer data, gpointer user_data) { FeatureState state = GPOINTER_TO_INT (data); TpProxy *self = user_data; if (state == FEATURE_STATE_MISSING_IFACE) { GQuark features[] = { 0, 0}; tp_proxy_set_feature_state (self, name, FEATURE_STATE_UNWANTED); self->priv->pending_will_announce_calls++; features[0] = name; tp_proxy_prepare_async (self, features, prepare_before_signalling_connected_cb, self); } else if (state == FEATURE_STATE_READY) { const TpProxyFeature *feature; feature = tp_proxy_subclass_get_feature (G_OBJECT_TYPE (self), name); if (feature->prepare_before_signalling_connected_async == NULL) return; self->priv->pending_will_announce_calls++; feature->prepare_before_signalling_connected_async (self, feature, prepare_before_signalling_connected_cb, self); } } /* * _tp_proxy_will_announce_connected_async: * * Called by connection.c when the connection became connected and we're about * to announce it. But before we have to wait for all the prepared features to * process their prepare_before_signalling_connected_async, if any. */ void _tp_proxy_will_announce_connected_async (TpProxy *self, GAsyncReadyCallback callback, gpointer user_data) { g_assert (TP_IS_CONNECTION (self)); g_assert (self->priv->will_announce_connected_result == NULL); self->priv->will_announce_connected_result = g_simple_async_result_new ( (GObject *) self, callback, user_data, _tp_proxy_will_announce_connected_async); g_datalist_foreach (&self->priv->features, foreach_feature, self); check_announce_connected (self, TRUE); } gboolean _tp_proxy_will_announce_connected_finish (TpProxy *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, _tp_proxy_will_announce_connected_async) } telepathy-glib-0.24.2/telepathy-glib/proxy.h0000644000175000017500000001332612652510705015706 00000000000000/* * proxy.h - Base class for Telepathy client proxies * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_PROXY_H__ #define __TP_PROXY_H__ #include #include #include #include G_BEGIN_DECLS /* Forward declaration of a subclass - from dbus.h */ typedef struct _TpDBusDaemon TpDBusDaemon; /* Forward declaration - from simple-client-factory.h */ typedef struct _TpSimpleClientFactory TpSimpleClientFactory; typedef struct _TpProxyPrivate TpProxyPrivate; typedef struct _TpProxy TpProxy; #define TP_DBUS_ERRORS (tp_dbus_errors_quark ()) GQuark tp_dbus_errors_quark (void); typedef enum { TP_DBUS_ERROR_UNKNOWN_REMOTE_ERROR = 0, TP_DBUS_ERROR_PROXY_UNREFERENCED = 1, TP_DBUS_ERROR_NO_INTERFACE = 2, TP_DBUS_ERROR_NAME_OWNER_LOST = 3, TP_DBUS_ERROR_INVALID_BUS_NAME = 4, TP_DBUS_ERROR_INVALID_INTERFACE_NAME = 5, TP_DBUS_ERROR_INVALID_OBJECT_PATH = 6, TP_DBUS_ERROR_INVALID_MEMBER_NAME = 7, TP_DBUS_ERROR_OBJECT_REMOVED = 8, TP_DBUS_ERROR_CANCELLED = 9, TP_DBUS_ERROR_INCONSISTENT = 10, } TpDBusError; #define TP_NUM_DBUS_ERRORS (TP_DBUS_ERROR_INCONSISTENT + 1) #define NUM_TP_DBUS_ERRORS TP_NUM_DBUS_ERRORS struct _TpProxy { /**/ GObject parent; TpDBusDaemon *_TP_SEAL (dbus_daemon); DBusGConnection *_TP_SEAL (dbus_connection); gchar *_TP_SEAL (bus_name); gchar *_TP_SEAL (object_path); GError *_TP_SEAL (invalidated); TpProxyPrivate *priv; }; typedef struct _TpProxyClass TpProxyClass; typedef struct _TpProxyFeature TpProxyFeature; typedef struct _TpProxyFeaturePrivate TpProxyFeaturePrivate; typedef void (* TpProxyPrepareAsync) (TpProxy *proxy, const TpProxyFeature *feature, GAsyncReadyCallback callback, gpointer user_data); struct _TpProxyFeature { /**/ GQuark name; gboolean core; TpProxyPrepareAsync prepare_async; TpProxyPrepareAsync prepare_before_signalling_connected_async; const GQuark *interfaces_needed; /* Features we depend on */ const GQuark *depends_on; gboolean can_retry; /**/ GCallback _reserved[4]; TpProxyFeaturePrivate *priv; }; /* XXX: hide this from the g-i scanner, since vapigen can't cope */ #ifndef __GI_SCANNER__ typedef const TpProxyFeature *(*TpProxyClassFeatureListFunc) ( TpProxyClass *cls); #endif /* __GI_SCANNER__ */ struct _TpProxyClass { /**/ GObjectClass parent_class; GQuark interface; unsigned int must_have_unique_name:1; /**/ guint _reserved_flags:31; /* XXX: hide this from the g-i scanner, since vapigen can't cope */ #ifdef __GI_SCANNER__ GCallback _internal_list_features; #else TpProxyClassFeatureListFunc list_features; #endif /* __GI_SCANNER__ */ GCallback _reserved[3]; gpointer priv; }; typedef struct _TpProxyPendingCall TpProxyPendingCall; void tp_proxy_pending_call_cancel (TpProxyPendingCall *pc); typedef struct _TpProxySignalConnection TpProxySignalConnection; void tp_proxy_signal_connection_disconnect (TpProxySignalConnection *sc); GType tp_proxy_get_type (void); /* TYPE MACROS */ #define TP_TYPE_PROXY \ (tp_proxy_get_type ()) #define TP_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), TP_TYPE_PROXY, \ TpProxy)) #define TP_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), TP_TYPE_PROXY, \ TpProxyClass)) #define TP_IS_PROXY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_PROXY)) #define TP_IS_PROXY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_PROXY)) #define TP_PROXY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_PROXY, \ TpProxyClass)) gboolean tp_proxy_has_interface_by_id (gpointer self, GQuark iface); gboolean tp_proxy_has_interface (gpointer self, const gchar *iface); _TP_AVAILABLE_IN_0_16 TpSimpleClientFactory *tp_proxy_get_factory (gpointer self); TpDBusDaemon *tp_proxy_get_dbus_daemon (gpointer self); DBusGConnection *tp_proxy_get_dbus_connection (gpointer self); const gchar *tp_proxy_get_bus_name (gpointer self); const gchar *tp_proxy_get_object_path (gpointer self); const GError *tp_proxy_get_invalidated (gpointer self); void tp_proxy_dbus_error_to_gerror (gpointer self, const char *dbus_error, const char *debug_message, GError **error); gboolean tp_proxy_is_prepared (gpointer self, GQuark feature); void tp_proxy_prepare_async (gpointer self, const GQuark *features, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_proxy_prepare_finish (gpointer self, GAsyncResult *result, GError **error); G_END_DECLS #include #endif /* #ifndef __TP_PROXY_H__*/ telepathy-glib-0.24.2/telepathy-glib/message-mixin.c0000644000175000017500000012717512652510705017276 00000000000000/* * message-mixin.c - Source for TpMessageMixin * Copyright (C) 2006-2008 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:message-mixin * @title: TpMessageMixin * @short_description: a mixin implementation of the text channel type and the * Messages interface * @see_also: #TpSvcChannelTypeText, #TpSvcChannelInterfaceMessages, * TpDBusPropertiesMixin * * This mixin can be added to a channel GObject class to implement the * text channel type (with the Messages interface) in a general way. * The channel class should also have a #TpDBusPropertiesMixinClass. * * To use the messages mixin, include a #TpMessageMixin somewhere in your * instance structure, and call tp_message_mixin_init() from your * constructor function, and tp_message_mixin_finalize() from your dispose * or finalize function. In the class_init function, call * tp_message_mixin_init_dbus_properties() to hook this mixin into the D-Bus * properties mixin class. Finally, include the following in the fourth * argument of G_DEFINE_TYPE_WITH_CODE(): * * * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, * tp_message_mixin_text_iface_init); * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES, * tp_message_mixin_messages_iface_init); * * * To support sending messages, you must call * tp_message_mixin_implement_sending() in the constructor function. If you do * not, any attempt to send a message will fail with NotImplemented. * * To support chat state, you must call * tp_message_mixin_implement_send_chat_state() in the constructor function, and * include the following in the fourth argument of G_DEFINE_TYPE_WITH_CODE(): * * * G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE, * tp_message_mixin_chat_state_iface_init); * * * Since: 0.7.21 */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #define DEBUG_FLAG TP_DEBUG_IM #include "debug-internal.h" /** * TpMessageMixin: * * Structure to be included in the instance structure of objects that * use this mixin. Initialize it with tp_message_mixin_init(). * * There are no public fields. * * Since: 0.7.21 */ struct _TpMessageMixinPrivate { TpBaseConnection *connection; /* Sending */ TpMessageMixinSendImpl send_message; GArray *msg_types; TpMessagePartSupportFlags message_part_support_flags; TpDeliveryReportingSupportFlags delivery_reporting_support_flags; gchar **supported_content_types; /* Receiving */ guint recv_id; GQueue *pending; /* ChatState */ /* TpHandle -> TpChannelChatState */ GHashTable *chat_states; TpMessageMixinSendChatStateImpl send_chat_state; /* FALSE unless at least one chat state notification has been sent; * will only be sent when the channel closes if this is TRUE. This prevents * opening a channel and closing it immediately sending a spurious to * the peer. */ gboolean send_gone; }; static const char * const forbidden_keys[] = { "pending-message-id", NULL }; static const char * const body_only[] = { "alternative", "content-type", "type", /* deprecated in 0.17.14 */ "content", "identifier", "needs-retrieval", "truncated", "size", NULL }; static const char * const body_only_incoming[] = { "needs-retrieval", "truncated", "size", NULL }; static const char * const headers_only[] = { "message-type", "message-sender", "message-sender-id", "message-sent", "message-received", "message-token", NULL }; static const char * const headers_only_incoming[] = { "message-sender", "message-sender-id", "message-sent", "message-received", NULL }; #define TP_MESSAGE_MIXIN_OFFSET_QUARK (tp_message_mixin_get_offset_quark ()) #define TP_MESSAGE_MIXIN_OFFSET(o) \ (GPOINTER_TO_UINT (g_type_get_qdata (G_OBJECT_TYPE (o), \ TP_MESSAGE_MIXIN_OFFSET_QUARK))) #define TP_MESSAGE_MIXIN(o) \ ((TpMessageMixin *) tp_mixin_offset_cast (o, TP_MESSAGE_MIXIN_OFFSET (o))) /** * tp_message_mixin_get_offset_quark: * * * * Returns: the quark used for storing mixin offset on a GObject * * Since: 0.7.21 */ static GQuark tp_message_mixin_get_offset_quark (void) { static GQuark offset_quark = 0; if (G_UNLIKELY (offset_quark == 0)) offset_quark = g_quark_from_static_string ( "tp_message_mixin_get_offset_quark@0.7.7"); return offset_quark; } static gint pending_item_id_equals_data (gconstpointer item, gconstpointer data) { const TpCMMessage *self = item; guint id = GPOINTER_TO_UINT (data); /* The sense of this comparison is correct: the callback passed to * g_queue_find_custom() should return 0 when the desired item is found. */ return (self->incoming_id != id); } static gchar * parts_to_text (TpMessage *msg, TpChannelTextMessageFlags *out_flags, TpChannelTextMessageType *out_type, TpHandle *out_sender, guint *out_timestamp) { GHashTable *header = g_ptr_array_index (msg->parts, 0); if (out_type != NULL) { /* The fallback behaviour of tp_asv_get_uint32 is OK here, because * message type NORMAL is zero */ *out_type = tp_asv_get_uint32 (header, "message-type", NULL); } if (out_sender != NULL) { /* The fallback behaviour of tp_asv_get_uint32 is OK here - if there's * no good sender, then 0 is the least bad */ *out_sender = tp_asv_get_uint32 (header, "message-sender", NULL); } if (out_timestamp != NULL) { /* The fallback behaviour of tp_asv_get_uint32 is OK here - we assume * that we won't legitimately receive messages from 1970-01-01 :-) */ *out_timestamp = tp_asv_get_uint32 (header, "message-sent", NULL); if (*out_timestamp == 0) *out_timestamp = tp_asv_get_uint32 (header, "message-received", NULL); if (*out_timestamp == 0) *out_timestamp = time (NULL); } return tp_message_to_text (msg, out_flags); } /** * TpMessageMixinSendImpl: * @object: An instance of the implementation that uses this mixin * @message: An outgoing message * @flags: flags with which to send the message * * Signature of a virtual method which may be implemented to allow messages * to be sent. It must arrange for tp_message_mixin_sent() to be called when * the message has submitted or when message submission has failed. */ /** * tp_message_mixin_implement_sending: * @object: An instance of the implementation that uses this mixin * @send: An implementation of SendMessage() * @n_types: Number of supported message types * @types: @n_types supported message types * @message_part_support_flags: Flags indicating what message part structures * are supported * @delivery_reporting_support_flags: Flags indicating what kind of delivery * reports are supported * @supported_content_types: The supported content types * * Set the callback used to implement SendMessage, and the types of message * that can be sent. This must be called from the init, constructor or * constructed callback, after tp_message_mixin_init(), and may only be called * once per object. * * Since: 0.7.21 */ void tp_message_mixin_implement_sending (GObject *object, TpMessageMixinSendImpl send, guint n_types, const TpChannelTextMessageType *types, TpMessagePartSupportFlags message_part_support_flags, TpDeliveryReportingSupportFlags delivery_reporting_support_flags, const gchar * const * supported_content_types) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); g_return_if_fail (mixin->priv->send_message == NULL); mixin->priv->send_message = send; if (mixin->priv->msg_types->len > 0) g_array_remove_range (mixin->priv->msg_types, 0, mixin->priv->msg_types->len); g_assert (mixin->priv->msg_types->len == 0); g_array_append_vals (mixin->priv->msg_types, types, n_types); mixin->priv->message_part_support_flags = message_part_support_flags; mixin->priv->delivery_reporting_support_flags = delivery_reporting_support_flags; g_strfreev (mixin->priv->supported_content_types); mixin->priv->supported_content_types = g_strdupv ( (gchar **) supported_content_types); } static TpChannelChatState lookup_current_chat_state (TpMessageMixin *mixin, TpHandle member) { gpointer tmp; if (g_hash_table_lookup_extended (mixin->priv->chat_states, GUINT_TO_POINTER (member), NULL, &tmp)) { return GPOINTER_TO_UINT (tmp); } return TP_CHANNEL_CHAT_STATE_INACTIVE; } /** * tp_message_mixin_change_chat_state: * @object: an instance of the implementation that uses this mixin * @member: a member of this chat * @state: the new state to set * * Change the current chat state of @member to be @state. This emits * ChatStateChanged signal and update ChatStates property. * * Since: 0.19.0 */ void tp_message_mixin_change_chat_state (GObject *object, TpHandle member, TpChannelChatState state) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); g_return_if_fail (state < TP_NUM_CHANNEL_CHAT_STATES); if (state == lookup_current_chat_state (mixin, member)) return; if (state == TP_CHANNEL_CHAT_STATE_INACTIVE || state == TP_CHANNEL_CHAT_STATE_GONE) { g_hash_table_remove (mixin->priv->chat_states, GUINT_TO_POINTER (member)); } else { g_hash_table_insert (mixin->priv->chat_states, GUINT_TO_POINTER (member), GUINT_TO_POINTER (state)); } tp_svc_channel_interface_chat_state_emit_chat_state_changed (object, member, state); } /** * TpMessageMixinSendChatStateImpl: * @object: an instance of the implementation that uses this mixin * @state: a #TpChannelChatState to be send * @error: a #GError to fill * * Signature of a virtual method which may be implemented to allow sending chat * state. * * Returns: %TRUE on success, %FALSE otherwise. * Since: 0.19.0 */ /** * tp_message_mixin_implement_send_chat_state: * @object: an instance of the implementation that uses this mixin * @send_chat_state: send our chat state * * Set the callback used to implement SetChatState. This must be called from the * init, constructor or constructed callback, after tp_message_mixin_init(), * and may only be called once per object. * * Since: 0.19.0 */ void tp_message_mixin_implement_send_chat_state (GObject *object, TpMessageMixinSendChatStateImpl send_chat_state) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); g_return_if_fail (mixin->priv->send_chat_state == NULL); mixin->priv->send_chat_state = send_chat_state; } /** * tp_message_mixin_maybe_send_gone: * @object: An instance of the implementation that uses this mixin * * Send #TP_CHANNEL_CHAT_STATE_GONE if needed. This should be called on private * chats when channel is closed. * * Since: 0.19.0 */ void tp_message_mixin_maybe_send_gone (GObject *object) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); if (mixin->priv->send_gone && !TP_HAS_GROUP_MIXIN (object) && mixin->priv->send_chat_state != NULL) { mixin->priv->send_chat_state (object, TP_CHANNEL_CHAT_STATE_GONE, NULL); } mixin->priv->send_gone = FALSE; } /* FIXME: Use tp_base_channel_get_self_handle() when TpMessageMixin requires * TpBaseChannel. See bug #49366 */ static TpHandle get_self_handle (GObject *object) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); if (TP_HAS_GROUP_MIXIN (object)) { guint ret = 0; tp_group_mixin_get_self_handle (object, &ret, NULL); if (ret != 0) return ret; } return tp_base_connection_get_self_handle (mixin->priv->connection); } static void tp_message_mixin_set_chat_state_async (TpSvcChannelInterfaceChatState *iface, guint state, DBusGMethodInvocation *context) { GObject *object = (GObject *) iface; TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); GError *error = NULL; if (mixin->priv->send_chat_state == NULL) { tp_dbus_g_method_return_not_implemented (context); return; } if (state >= TP_NUM_CHANNEL_CHAT_STATES) { DEBUG ("invalid chat state %u", state); g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid state: %u", state); goto error; } if (state == TP_CHANNEL_CHAT_STATE_GONE) { /* We cannot explicitly set the Gone state */ DEBUG ("you may not explicitly set the Gone state"); g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "you may not explicitly set the Gone state"); goto error; } if (!mixin->priv->send_chat_state (object, state, &error)) goto error; mixin->priv->send_gone = TRUE; tp_message_mixin_change_chat_state (object, get_self_handle (object), state); tp_svc_channel_interface_chat_state_return_from_set_chat_state (context); return; error: dbus_g_method_return_error (context, error); g_clear_error (&error); } /** * tp_message_mixin_init: * @obj: An instance of the implementation that uses this mixin * @offset: The byte offset of the TpMessageMixin within the object structure * @connection: A #TpBaseConnection * * Initialize the mixin. Should be called from the implementation's * instance init function or constructor like so: * * * tp_message_mixin_init ((GObject *) self, * G_STRUCT_OFFSET (SomeObject, message_mixin), * self->connection); * * * Since: 0.7.21 */ void tp_message_mixin_init (GObject *obj, gsize offset, TpBaseConnection *connection) { TpMessageMixin *mixin; g_assert (G_IS_OBJECT (obj)); g_type_set_qdata (G_OBJECT_TYPE (obj), TP_MESSAGE_MIXIN_OFFSET_QUARK, GINT_TO_POINTER (offset)); mixin = TP_MESSAGE_MIXIN (obj); mixin->priv = g_slice_new0 (TpMessageMixinPrivate); mixin->priv->pending = g_queue_new (); mixin->priv->recv_id = 0; mixin->priv->msg_types = g_array_sized_new (FALSE, FALSE, sizeof (guint), TP_NUM_CHANNEL_TEXT_MESSAGE_TYPES); mixin->priv->connection = g_object_ref (connection); mixin->priv->supported_content_types = g_new0 (gchar *, 1); mixin->priv->chat_states = g_hash_table_new (NULL, NULL); } /** * tp_message_mixin_clear: * @obj: An object with this mixin * * Clear the pending message queue, deleting all messages without emitting * PendingMessagesRemoved. */ void tp_message_mixin_clear (GObject *obj) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (obj); TpMessage *item; while ((item = g_queue_pop_head (mixin->priv->pending)) != NULL) { tp_message_destroy (item); } } /** * tp_message_mixin_finalize: * @obj: An object with this mixin. * * Free resources held by the text mixin. * * Since: 0.7.21 */ void tp_message_mixin_finalize (GObject *obj) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (obj); DEBUG ("%p", obj); tp_message_mixin_clear (obj); g_assert (g_queue_is_empty (mixin->priv->pending)); g_queue_free (mixin->priv->pending); g_array_unref (mixin->priv->msg_types); g_strfreev (mixin->priv->supported_content_types); g_object_unref (mixin->priv->connection); g_hash_table_unref (mixin->priv->chat_states); g_slice_free (TpMessageMixinPrivate, mixin->priv); } static void tp_message_mixin_acknowledge_pending_messages_async ( TpSvcChannelTypeText *iface, const GArray *ids, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); GPtrArray *links = g_ptr_array_sized_new (ids->len); TpIntset *seen = tp_intset_new (); guint i; for (i = 0; i < ids->len; i++) { guint id = g_array_index (ids, guint, i); GList *link_; if (tp_intset_is_member (seen, id)) { gchar *client = dbus_g_method_get_sender (context); DEBUG ("%s passed message id %u more than once in one call to " "AcknowledgePendingMessages. Foolish pup.", client, id); g_free (client); continue; } tp_intset_add (seen, id); link_ = g_queue_find_custom (mixin->priv->pending, GUINT_TO_POINTER (id), pending_item_id_equals_data); if (link_ == NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid message id %u", id); DEBUG ("%s", error->message); dbus_g_method_return_error (context, error); g_error_free (error); g_ptr_array_unref (links); tp_intset_destroy (seen); return; } g_ptr_array_add (links, link_); } tp_svc_channel_interface_messages_emit_pending_messages_removed (iface, ids); for (i = 0; i < links->len; i++) { GList *link_ = g_ptr_array_index (links, i); TpMessage *item = link_->data; TpCMMessage *cm_msg = link_->data; DEBUG ("acknowledging message id %u", cm_msg->incoming_id); g_queue_delete_link (mixin->priv->pending, link_); tp_message_destroy (item); } g_ptr_array_unref (links); tp_intset_destroy (seen); tp_svc_channel_type_text_return_from_acknowledge_pending_messages (context); } static void tp_message_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, gboolean clear, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); GType pending_type = TP_STRUCT_TYPE_PENDING_TEXT_MESSAGE; guint count; GPtrArray *messages; GList *cur; guint i; count = g_queue_get_length (mixin->priv->pending); messages = g_ptr_array_sized_new (count); for (cur = g_queue_peek_head_link (mixin->priv->pending); cur != NULL; cur = cur->next) { TpMessage *msg = cur->data; TpCMMessage *cm_msg = cur->data; GValue val = { 0, }; gchar *text; TpChannelTextMessageFlags flags; TpChannelTextMessageType type; TpHandle sender; guint timestamp; text = parts_to_text (msg, &flags, &type, &sender, ×tamp); g_value_init (&val, pending_type); g_value_take_boxed (&val, dbus_g_type_specialized_construct (pending_type)); dbus_g_type_struct_set (&val, 0, cm_msg->incoming_id, 1, timestamp, 2, sender, 3, type, 4, flags, 5, text, G_MAXUINT); g_free (text); g_ptr_array_add (messages, g_value_get_boxed (&val)); } if (clear) { GArray *ids; DEBUG ("WARNING: ListPendingMessages(clear=TRUE) is deprecated"); cur = g_queue_peek_head_link (mixin->priv->pending); ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), count); while (cur != NULL) { TpMessage *msg = cur->data; TpCMMessage *cm_msg = cur->data; GList *next = cur->next; i = cm_msg->incoming_id; g_array_append_val (ids, i); g_queue_delete_link (mixin->priv->pending, cur); tp_message_destroy (msg); cur = next; } tp_svc_channel_interface_messages_emit_pending_messages_removed (iface, ids); g_array_unref (ids); } tp_svc_channel_type_text_return_from_list_pending_messages (context, messages); for (i = 0; i < messages->len; i++) tp_value_array_free (g_ptr_array_index (messages, i)); g_ptr_array_unref (messages); } static void tp_message_mixin_get_pending_message_content_async ( TpSvcChannelInterfaceMessages *iface, guint message_id, const GArray *part_numbers, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); GList *node; TpMessage *item; GHashTable *ret; guint i; node = g_queue_find_custom (mixin->priv->pending, GUINT_TO_POINTER (message_id), pending_item_id_equals_data); if (node == NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "invalid message id %u", message_id); DEBUG ("%s", error->message); dbus_g_method_return_error (context, error); g_error_free (error); return; } item = node->data; for (i = 0; i < part_numbers->len; i++) { guint part = g_array_index (part_numbers, guint, i); if (part == 0 || part >= item->parts->len) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "part number %u out of range", part); DEBUG ("%s", error->message); dbus_g_method_return_error (context, error); g_error_free (error); return; } } /* no free callbacks set - we borrow the content from the message */ ret = g_hash_table_new (g_direct_hash, g_direct_equal); /* FIXME: later, need a way to support streaming content */ for (i = 0; i < part_numbers->len; i++) { guint part = g_array_index (part_numbers, guint, i); GHashTable *part_data; GValue *value; g_assert (part != 0 && part < item->parts->len); part_data = g_ptr_array_index (item->parts, part); /* skip parts with no type (reserved) */ if (tp_asv_get_string (part_data, "content-type") == NULL && /* Renamed to "content-type" in spec 0.17.14 */ tp_asv_get_string (part_data, "type") == NULL) continue; value = g_hash_table_lookup (part_data, "content"); /* skip parts with no content */ if (value == NULL) continue; g_hash_table_insert (ret, GUINT_TO_POINTER (part), value); } tp_svc_channel_interface_messages_return_from_get_pending_message_content ( context, ret); g_hash_table_unref (ret); } static void tp_message_mixin_get_message_types_async (TpSvcChannelTypeText *iface, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); tp_svc_channel_type_text_return_from_get_message_types (context, mixin->priv->msg_types); } static void queue_pending (GObject *object, TpMessage *pending) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); TpChannelTextMessageFlags flags; TpChannelTextMessageType type; TpHandle sender; guint timestamp; gchar *text; const GHashTable *header; TpDeliveryStatus delivery_status; TpCMMessage *cm_message = (TpCMMessage *) pending; g_queue_push_tail (mixin->priv->pending, pending); text = parts_to_text (pending, &flags, &type, &sender, ×tamp); tp_svc_channel_type_text_emit_received (object, cm_message->incoming_id, timestamp, sender, type, flags, text); g_free (text); tp_svc_channel_interface_messages_emit_message_received (object, pending->parts); /* Check if it's a failed delivery report; if so, emit SendError too. */ header = tp_message_peek (pending, 0); delivery_status = tp_asv_get_uint32 (header, "delivery-status", NULL); if (delivery_status == TP_DELIVERY_STATUS_TEMPORARILY_FAILED || delivery_status == TP_DELIVERY_STATUS_PERMANENTLY_FAILED) { /* Fallback behaviour here is okay: 0 is Send_Error_Unknown */ TpChannelTextSendError send_error = tp_asv_get_uint32 (header, "delivery-error", NULL); GPtrArray *echo = tp_asv_get_boxed (header, "delivery-echo", TP_ARRAY_TYPE_MESSAGE_PART_LIST); type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL; text = NULL; timestamp = 0; if (echo != NULL && echo->len < 1) { WARNING ("delivery-echo should contain at least 1 part"); } else if (echo != NULL) { const GHashTable *echo_header = g_ptr_array_index (echo, 0); TpMessage *echo_msg; echo_msg = _tp_cm_message_new_from_parts (mixin->priv->connection, echo); /* The specification says that the timestamp in SendError should be the * time at which the original message was sent. parts_to_text falls * back to setting timestamp to time (NULL) if it can't find out when * the message was sent, but we want to use 0 in that case. Hence, * we look up timestamp here rather than delegating to parts_to_text. * The fallback behaviour of tp_asv_get_uint32 is correct: we want * timestamp to be 0 if we can't determine when the original message * was sent. */ text = parts_to_text (echo_msg, NULL, &type, NULL, NULL); timestamp = tp_asv_get_uint32 (echo_header, "message-sent", NULL); g_object_unref (echo_msg); } tp_svc_channel_type_text_emit_send_error (object, send_error, timestamp, type, text != NULL ? text : ""); g_free (text); } } /** * tp_message_mixin_take_received: * @object: a channel with this mixin * @message: the message. Its ownership is claimed by the message * mixin, so it must no longer be modified or freed * * Receive a message into the pending messages queue, where it will stay * until acknowledged, and emit the Received and ReceivedMessage signals. Also * emit the SendError signal if the message is a failed delivery report. * * Returns: the message ID * * Since: 0.7.21 */ guint tp_message_mixin_take_received (GObject *object, TpMessage *message) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); TpCMMessage *cm_msg = (TpCMMessage *) message; GHashTable *header; g_return_val_if_fail (cm_msg->incoming_id == G_MAXUINT32, 0); g_return_val_if_fail (message->parts->len >= 1, 0); header = g_ptr_array_index (message->parts, 0); g_return_val_if_fail (g_hash_table_lookup (header, "pending-message-id") == NULL, 0); /* FIXME: we don't check for overflow, so in highly pathological cases we * might end up with multiple messages with the same ID */ cm_msg->incoming_id = mixin->priv->recv_id++; tp_message_set_uint32 (message, 0, "pending-message-id", cm_msg->incoming_id); if (tp_asv_get_uint64 (header, "message-received", NULL) == 0) tp_message_set_uint64 (message, 0, "message-received", time (NULL)); /* Here we add the message to the incoming queue: Although we have not * returned the message ID to the caller directly at this point, we * have poked it into the TpMessage, which the caller (and anyone connected * to the relevant signals) has access to, so there isn't actually a race * between putting the message into the queue and making its ID available. */ queue_pending (object, message); return cm_msg->incoming_id; } /** * tp_message_mixin_has_pending_messages: * @object: An object with this mixin * @first_sender: If not %NULL, used to store the sender of the oldest pending * message * * Return whether the channel @obj has unacknowledged messages. If so, and * @first_sender is not %NULL, the handle of the sender of the first message * is placed in it, without incrementing the handle's reference count. * * Returns: %TRUE if there are pending messages */ gboolean tp_message_mixin_has_pending_messages (GObject *object, TpHandle *first_sender) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); TpMessage *msg = g_queue_peek_head (mixin->priv->pending); if (msg != NULL && first_sender != NULL) { const GHashTable *header = tp_message_peek (msg, 0); gboolean valid = TRUE; TpHandle h = tp_asv_get_uint32 (header, "message-sender", &valid); if (valid) *first_sender = h; else WARNING ("oldest message's message-sender is mistyped"); } return (msg != NULL); } /** * tp_message_mixin_set_rescued: * @obj: An object with this mixin * * Mark all pending messages as having been "rescued" from a channel that * previously closed. */ void tp_message_mixin_set_rescued (GObject *obj) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (obj); GList *cur; for (cur = g_queue_peek_head_link (mixin->priv->pending); cur != NULL; cur = cur->next) { TpMessage *msg = cur->data; tp_message_set_boolean (msg, 0, "rescued", TRUE); } } /** * TpMessageMixinOutgoingMessage: * @flags: Flags indicating how this message should be sent * @parts: The parts that make up the message (an array of #GHashTable, * with the first one containing message headers) * @priv: Pointer to opaque private data used by the messages mixin * * Structure representing a message which is to be sent. * * Connection managers may (and should) edit the @parts in-place to remove * keys that could not be sent, using g_hash_table_remove(). Connection * managers may also alter @parts to include newly allocated GHashTable * structures. * * However, they must not add keys to an existing GHashTable (this is because * the connection manager has no way to know how the keys and values will be * freed). * * Since: 0.7.21 */ struct _TpMessageMixinOutgoingMessagePrivate { DBusGMethodInvocation *context; gboolean messages:1; }; /** * tp_message_mixin_sent: * @object: An object implementing the Text and Messages interfaces with this * mixin * @message: The outgoing message * @flags: The flags used when sending the message, which may be a subset of * those passed to the #TpMessageMixinSendImpl implementation if not all are * supported, or 0 on error. * @token: A token representing the sent message (see the Telepathy D-Bus API * specification), or an empty string if no suitable identifier is available, * or %NULL on error * @error: %NULL on success, or the error with which message submission failed * * Indicate to the message mixin that message submission to the IM server has * succeeded or failed. This should be called as soon as the CM determines * it's theoretically possible to send the message (e.g. the parameters are * supported and correct). * * After this function is called, @message will have been freed, and must not * be dereferenced. * * Since: 0.7.21 */ void tp_message_mixin_sent (GObject *object, TpMessage *message, TpMessageSendingFlags flags, const gchar *token, const GError *error) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (object); TpCMMessage *cm_msg = (TpCMMessage *) message; time_t now = time (NULL); g_return_if_fail (mixin != NULL); g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (TP_IS_CM_MESSAGE (message)); g_return_if_fail (message->parts != NULL); g_return_if_fail (cm_msg->outgoing_context != NULL); g_return_if_fail (token == NULL || error == NULL); g_return_if_fail (token != NULL || error != NULL); if (error != NULL) { GError *e = g_error_copy (error); dbus_g_method_return_error (cm_msg->outgoing_context, e); g_error_free (e); } else { TpChannelTextMessageType message_type; gchar *string; GHashTable *header = g_ptr_array_index (message->parts, 0); mixin->priv->send_gone = TRUE; if (tp_asv_get_uint64 (header, "message-sent", NULL) == 0) tp_message_set_uint64 (message, 0, "message-sent", time (NULL)); tp_cm_message_set_sender (message, get_self_handle (object)); /* emit Sent and MessageSent */ tp_svc_channel_interface_messages_emit_message_sent (object, message->parts, flags, token); string = parts_to_text (message, NULL, &message_type, NULL, NULL); tp_svc_channel_type_text_emit_sent (object, now, message_type, string); g_free (string); /* return successfully */ if (cm_msg->outgoing_text_api) { tp_svc_channel_type_text_return_from_send ( cm_msg->outgoing_context); } else { tp_svc_channel_interface_messages_return_from_send_message ( cm_msg->outgoing_context, token); } } cm_msg->outgoing_context = NULL; tp_message_destroy (message); } static void tp_message_mixin_send_async (TpSvcChannelTypeText *iface, guint message_type, const gchar *text, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); TpMessage *message; TpCMMessage *cm_msg; if (mixin->priv->send_message == NULL) { tp_dbus_g_method_return_not_implemented (context); return; } message = tp_cm_message_new (mixin->priv->connection, 2); cm_msg = (TpCMMessage *) message; if (message_type != 0) tp_message_set_uint32 (message, 0, "message-type", message_type); tp_message_set_string (message, 1, "content-type", "text/plain"); tp_message_set_string (message, 1, "type", "text/plain"); /* Removed in 0.17.14 */ tp_message_set_string (message, 1, "content", text); cm_msg->outgoing_context = context; cm_msg->outgoing_text_api = TRUE; mixin->priv->send_message ((GObject *) iface, message, 0); } static void tp_message_mixin_send_message_async (TpSvcChannelInterfaceMessages *iface, const GPtrArray *parts, guint flags, DBusGMethodInvocation *context) { TpMessageMixin *mixin = TP_MESSAGE_MIXIN (iface); TpMessage *message; TpCMMessage *cm_msg; GHashTable *header; guint i; const char * const *iter; if (mixin->priv->send_message == NULL) { tp_dbus_g_method_return_not_implemented (context); return; } /* it must have at least a header part */ if (parts->len < 1) { GError e = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Cannot send a message that does not have at least one part" }; dbus_g_method_return_error (context, &e); return; } header = g_ptr_array_index (parts, 0); for (i = 0; i < parts->len; i++) { for (iter = forbidden_keys; *iter != NULL; iter++) { if (g_hash_table_lookup (header, *iter) != NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Key '%s' not allowed in a sent message", *iter); dbus_g_method_return_error (context, error); return; } } } for (iter = body_only; *iter != NULL; iter++) { if (g_hash_table_lookup (header, *iter) != NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Key '%s' not allowed in a message header", *iter); dbus_g_method_return_error (context, error); return; } } for (iter = headers_only_incoming; *iter != NULL; iter++) { if (g_hash_table_lookup (header, *iter) != NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Key '%s' not allowed in an outgoing message header", *iter); dbus_g_method_return_error (context, error); return; } } for (i = 1; i < parts->len; i++) { for (iter = headers_only; *iter != NULL; iter++) { if (g_hash_table_lookup (g_ptr_array_index (parts, i), *iter) != NULL) { GError *error = g_error_new (TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Key '%s' not allowed in a message body", *iter); dbus_g_method_return_error (context, error); return; } } } message = tp_cm_message_new (mixin->priv->connection, parts->len); cm_msg = (TpCMMessage *) message; for (i = 0; i < parts->len; i++) { tp_g_hash_table_update (g_ptr_array_index (message->parts, i), g_ptr_array_index (parts, i), (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); } cm_msg->outgoing_context = context; cm_msg->outgoing_text_api = FALSE; mixin->priv->send_message ((GObject *) iface, message, flags); } /** * tp_message_mixin_init_dbus_properties: * @cls: The class of an object with this mixin * * Set up a #TpDBusPropertiesMixinClass to use this mixin's implementation * of the Messages interface's properties. * * This uses tp_message_mixin_get_dbus_property() as the property getter * and sets a list of the supported properties for it. */ void tp_message_mixin_init_dbus_properties (GObjectClass *cls) { static TpDBusPropertiesMixinPropImpl props[] = { { "PendingMessages", NULL, NULL }, { "SupportedContentTypes", NULL, NULL }, { "MessagePartSupportFlags", NULL, NULL }, { "MessageTypes", NULL, NULL }, { "DeliveryReportingSupport", NULL, NULL }, { NULL } }; static TpDBusPropertiesMixinPropImpl chat_state_props[] = { { "ChatStates", NULL, NULL }, { NULL } }; GType type = G_OBJECT_CLASS_TYPE (cls); g_return_if_fail (g_type_is_a (type, TP_TYPE_SVC_CHANNEL_TYPE_TEXT)); g_return_if_fail (g_type_is_a (type, TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES)); tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES, tp_message_mixin_get_dbus_property, NULL, props); if (g_type_is_a (type, TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE)) { tp_dbus_properties_mixin_implement_interface (cls, TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE, tp_message_mixin_get_dbus_property, NULL, chat_state_props); } } /** * tp_message_mixin_get_dbus_property: * @object: An object with this mixin * @interface: Must be %TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES * @name: A quark representing the D-Bus property name, either * "PendingMessages", "SupportedContentTypes" or "MessagePartSupportFlags" * @value: A GValue pre-initialized to the right type, into which to put * the value * @unused: Ignored * * An implementation of #TpDBusPropertiesMixinGetter which assumes that * the @object has the messages mixin. It can only be used for the Messages * interface. */ void tp_message_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused G_GNUC_UNUSED) { TpMessageMixin *mixin; static GQuark q_pending_messages = 0; static GQuark q_supported_content_types = 0; static GQuark q_message_part_support_flags = 0; static GQuark q_delivery_reporting_support_flags = 0; static GQuark q_message_types = 0; static GQuark q_chat_states = 0; if (G_UNLIKELY (q_pending_messages == 0)) { q_pending_messages = g_quark_from_static_string ("PendingMessages"); q_supported_content_types = g_quark_from_static_string ("SupportedContentTypes"); q_message_part_support_flags = g_quark_from_static_string ("MessagePartSupportFlags"); q_delivery_reporting_support_flags = g_quark_from_static_string ("DeliveryReportingSupport"); q_message_types = g_quark_from_static_string ("MessageTypes"); q_chat_states = g_quark_from_static_string ("ChatStates"); } mixin = TP_MESSAGE_MIXIN (object); g_return_if_fail (interface == TP_IFACE_QUARK_CHANNEL_INTERFACE_MESSAGES || interface == TP_IFACE_QUARK_CHANNEL_INTERFACE_CHAT_STATE); g_return_if_fail (object != NULL); g_return_if_fail (name != 0); g_return_if_fail (value != NULL); g_return_if_fail (mixin != NULL); if (name == q_pending_messages) { GPtrArray *arrays = g_ptr_array_sized_new (g_queue_get_length ( mixin->priv->pending)); GList *l; GType type = dbus_g_type_get_collection ("GPtrArray", TP_HASH_TYPE_MESSAGE_PART); for (l = g_queue_peek_head_link (mixin->priv->pending); l != NULL; l = g_list_next (l)) { TpMessage *msg = l->data; g_ptr_array_add (arrays, g_boxed_copy (type, msg->parts)); } g_value_take_boxed (value, arrays); } else if (name == q_message_part_support_flags) { g_value_set_uint (value, mixin->priv->message_part_support_flags); } else if (name == q_delivery_reporting_support_flags) { g_value_set_uint (value, mixin->priv->delivery_reporting_support_flags); } else if (name == q_supported_content_types) { g_value_set_boxed (value, mixin->priv->supported_content_types); } else if (name == q_message_types) { g_value_set_boxed (value, mixin->priv->msg_types); } else if (name == q_chat_states) { g_value_set_boxed (value, mixin->priv->chat_states); } } /** * tp_message_mixin_text_iface_init: * @g_iface: A pointer to the #TpSvcChannelTypeTextClass in an object class * @iface_data: Ignored * * Fill in this mixin's Text method implementations in the given interface * vtable. * * Since: 0.7.21 */ void tp_message_mixin_text_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelTypeTextClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_type_text_implement_##x (klass,\ tp_message_mixin_##x##_async) IMPLEMENT (acknowledge_pending_messages); IMPLEMENT (get_message_types); IMPLEMENT (list_pending_messages); IMPLEMENT (send); #undef IMPLEMENT } /** * tp_message_mixin_messages_iface_init: * @g_iface: A pointer to the #TpSvcChannelInterfaceMessagesClass in an object * class * @iface_data: Ignored * * Fill in this mixin's Messages method implementations in the given interface * vtable. * * Since: 0.7.21 */ void tp_message_mixin_messages_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelInterfaceMessagesClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_messages_implement_##x (\ klass, tp_message_mixin_##x##_async) IMPLEMENT (send_message); IMPLEMENT (get_pending_message_content); #undef IMPLEMENT } /** * tp_message_mixin_chat_state_iface_init: * @g_iface: A pointer to the #TpSvcChannelInterfaceChatStateClass in an object * class * @iface_data: Ignored * * Fill in this mixin's ChatState method implementations in the given interface * vtable. * * Since: 0.19.0 */ void tp_message_mixin_chat_state_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcChannelInterfaceChatStateClass *klass = g_iface; #define IMPLEMENT(x) tp_svc_channel_interface_chat_state_implement_##x (\ klass, tp_message_mixin_##x##_async) IMPLEMENT (set_chat_state); #undef IMPLEMENT } telepathy-glib-0.24.2/telepathy-glib/message-mixin.h0000644000175000017500000000702712652510705017274 00000000000000/* * message-mixin.h - Header for TpMessageMixin * Copyright (C) 2006-2008 Collabora Ltd. * Copyright (C) 2006-2008 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef TP_MESSAGE_MIXIN_H #define TP_MESSAGE_MIXIN_H #include #include #include #include #include #include G_BEGIN_DECLS typedef struct _TpMessageMixin TpMessageMixin; typedef struct _TpMessageMixinPrivate TpMessageMixinPrivate; struct _TpMessageMixin { /**/ TpMessageMixinPrivate *priv; }; void tp_message_mixin_get_dbus_property (GObject *object, GQuark interface, GQuark name, GValue *value, gpointer unused); /* Receiving */ guint tp_message_mixin_take_received (GObject *object, TpMessage *message); gboolean tp_message_mixin_has_pending_messages (GObject *object, TpHandle *first_sender); void tp_message_mixin_set_rescued (GObject *obj); void tp_message_mixin_clear (GObject *obj); /* Sending */ typedef void (*TpMessageMixinSendImpl) (GObject *object, TpMessage *message, TpMessageSendingFlags flags); void tp_message_mixin_sent (GObject *object, TpMessage *message, TpMessageSendingFlags flags, const gchar *token, const GError *error); void tp_message_mixin_implement_sending (GObject *object, TpMessageMixinSendImpl send, guint n_types, const TpChannelTextMessageType *types, TpMessagePartSupportFlags message_part_support_flags, TpDeliveryReportingSupportFlags delivery_reporting_support_flags, const gchar * const * supported_content_types); /* ChatState */ typedef gboolean (*TpMessageMixinSendChatStateImpl) (GObject *object, TpChannelChatState state, GError **error); _TP_AVAILABLE_IN_0_20 void tp_message_mixin_change_chat_state (GObject *object, TpHandle member, TpChannelChatState state); _TP_AVAILABLE_IN_0_20 void tp_message_mixin_implement_send_chat_state (GObject *object, TpMessageMixinSendChatStateImpl send_chat_state); _TP_AVAILABLE_IN_0_20 void tp_message_mixin_maybe_send_gone (GObject *object); /* Initialization */ void tp_message_mixin_text_iface_init (gpointer g_iface, gpointer iface_data); void tp_message_mixin_messages_iface_init (gpointer g_iface, gpointer iface_data); void tp_message_mixin_chat_state_iface_init (gpointer g_iface, gpointer iface_data); void tp_message_mixin_init (GObject *obj, gsize offset, TpBaseConnection *connection); void tp_message_mixin_init_dbus_properties (GObjectClass *cls); void tp_message_mixin_finalize (GObject *obj); G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/basic-proxy-factory.c0000644000175000017500000000645212652510705020427 00000000000000/* * Simple client channel factory creating TpChannel * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:basic-proxy-factory * @title: TpBasicProxyFactory * @short_description: channel factory creating TpChannel objects * @see_also: #TpAutomaticProxyFactory * * This factory implements the #TpClientChannelFactory interface to create * plain #TpChannel objects. Unlike #TpAutomaticProxyFactory, it will * not create higher-level subclasses like #TpStreamTubeChannel. * The only feature this factory asks to prepare is #TP_CHANNEL_FEATURE_CORE. * * TpProxy subclasses other than TpChannel are not currently supported. * * Since: 0.13.2 */ /** * TpBasicProxyFactory: * * Data structure representing a #TpBasicProxyFactory * * Since: 0.13.2 */ /** * TpBasicProxyFactoryClass: * @parent_class: the parent class * * The class of a #TpBasicProxyFactory. * * Since: 0.13.2 */ #include "config.h" #include "telepathy-glib/basic-proxy-factory.h" #include #define DEBUG_FLAG TP_DEBUG_CLIENT #include "telepathy-glib/debug-internal.h" /* We rely on the default (lack of) implementation of everything */ G_DEFINE_TYPE_WITH_CODE(TpBasicProxyFactory, tp_basic_proxy_factory, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CLIENT_CHANNEL_FACTORY, NULL)) static void tp_basic_proxy_factory_init (TpBasicProxyFactory *self) { } static void tp_basic_proxy_factory_class_init (TpBasicProxyFactoryClass *cls) { } /** * tp_basic_proxy_factory_new: * * Convenient function to create a new #TpBasicProxyFactory instance. * * Returns: a new #TpBasicProxyFactory * * Since: 0.13.2 * Deprecated: New code should use #TpSimpleClientFactory instead */ static TpBasicProxyFactory * _tp_basic_proxy_factory_new (void) { return g_object_new (TP_TYPE_BASIC_PROXY_FACTORY, NULL); } TpBasicProxyFactory * tp_basic_proxy_factory_new (void) { return _tp_basic_proxy_factory_new (); } /** * tp_basic_proxy_factory_dup: * * Returns a cached #TpBasicProxyFactory; the same #TpBasicProxyFactory object * will be returned by this function repeatedly, as long as at least one * reference exists. * * Returns: (transfer full): a #TpBasicProxyFactory * * Since: 0.13.2 * Deprecated: New code should use #TpSimpleClientFactory instead */ TpBasicProxyFactory * tp_basic_proxy_factory_dup (void) { static TpBasicProxyFactory *singleton = NULL; if (singleton != NULL) return g_object_ref (singleton); singleton = _tp_basic_proxy_factory_new (); g_object_add_weak_pointer (G_OBJECT (singleton), (gpointer) &singleton); return singleton; } telepathy-glib-0.24.2/telepathy-glib/basic-proxy-factory.h0000644000175000017500000000506512652510705020433 00000000000000/* * Basic proxy factory * * Copyright © 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASIC_PROXY_FACTORY_H__ #define __TP_BASIC_PROXY_FACTORY_H__ #include #include G_BEGIN_DECLS typedef struct _TpBasicProxyFactory TpBasicProxyFactory; typedef struct _TpBasicProxyFactoryClass TpBasicProxyFactoryClass; struct _TpBasicProxyFactoryClass { /**/ GObjectClass parent_class; }; struct _TpBasicProxyFactory { /**/ GObject parent; }; GType tp_basic_proxy_factory_get_type (void); #define TP_TYPE_BASIC_PROXY_FACTORY \ (tp_basic_proxy_factory_get_type ()) #define TP_BASIC_PROXY_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASIC_PROXY_FACTORY, \ TpBasicProxyFactory)) #define TP_BASIC_PROXY_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASIC_PROXY_FACTORY, \ TpBasicProxyFactoryClass)) #define TP_IS_BASIC_PROXY_FACTORY(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASIC_PROXY_FACTORY)) #define TP_IS_BASIC_PROXY_FACTORY_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASIC_PROXY_FACTORY)) #define TP_BASIC_PROXY_FACTORY_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASIC_PROXY_FACTORY, \ TpBasicProxyFactoryClass)) #ifndef TP_DISABLE_DEPRECATED _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_new) TpBasicProxyFactory * tp_basic_proxy_factory_new (void); _TP_DEPRECATED_IN_0_16_FOR (tp_simple_client_factory_new) TpBasicProxyFactory * tp_basic_proxy_factory_dup (void); #endif G_END_DECLS #endif telepathy-glib-0.24.2/telepathy-glib/channel.xml0000644000175000017500000000426412652510705016507 00000000000000 Channel interfaces telepathy-glib-0.24.2/telepathy-glib/base-media-call-content.c0000644000175000017500000011103612652510705021065 00000000000000/* * base-media-call-content.c - Source for TpBaseMediaCallContent * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /** * SECTION:base-media-call-content * @title: TpBaseMediaCallContent * @short_description: base class for #TpSvcCallContentInterfaceMedia * implementations * @see_also: #TpSvcCallContentInterfaceMedia, #TpBaseCallChannel, * #TpBaseCallContent and #TpBaseCallStream * * This base class makes it easier to write #TpSvcCallContentInterfaceMedia * implementations by implementing its properties and methods. * * Subclasses must still implement #TpBaseCallContent's virtual methods. * * Since: 0.17.5 */ /** * TpBaseMediaCallContent: * * A base class for media call content implementations * * Since: 0.17.5 */ /** * TpBaseMediaCallContentClass: * * The class structure for #TpBaseMediaCallContent * * Since: 0.17.5 */ #include "config.h" #include "base-media-call-content.h" #include #define DEBUG_FLAG TP_DEBUG_CALL #include "telepathy-glib/base-call-internal.h" #include "telepathy-glib/base-call-channel.h" #include "telepathy-glib/base-channel.h" #include "telepathy-glib/base-connection.h" #include "telepathy-glib/base-media-call-stream.h" #include "telepathy-glib/dbus.h" #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/dtmf.h" #include "telepathy-glib/gtypes.h" #include "telepathy-glib/interfaces.h" #include "telepathy-glib/svc-call.h" #include "telepathy-glib/svc-properties-interface.h" #include "telepathy-glib/util.h" #include "telepathy-glib/util-internal.h" #define DTMF_PAUSE_MS (3000) static void call_content_media_iface_init (gpointer, gpointer); G_DEFINE_ABSTRACT_TYPE_WITH_CODE (TpBaseMediaCallContent, tp_base_media_call_content, TP_TYPE_BASE_CALL_CONTENT, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CALL_CONTENT_INTERFACE_MEDIA, call_content_media_iface_init) ) /* properties */ enum { /* Call.Content.Interface.Media properties */ PROP_REMOTE_MEDIA_DESCRIPTIONS = 1, PROP_LOCAL_MEDIA_DESCRIPTIONS, PROP_MEDIA_DESCRIPTION_OFFER, PROP_PACKETIZATION, PROP_CURRENT_DTMF_EVENT, PROP_CURRENT_DTMF_STATE, /* Call.Content.Interface.DTMF properties */ PROP_CURRENTLY_SENDING_TONES, PROP_DEFERRED_TONES }; enum /* signals */ { LOCAL_MEDIA_DESCRIPTION_UPDATED, LAST_SIGNAL }; static guint _signals[LAST_SIGNAL] = { 0, }; /* private structure */ struct _TpBaseMediaCallContentPrivate { /* TpHandle -> reffed GHashTable */ GHashTable *remote_media_descriptions; /* TpHandle -> reffed GHashTable */ GHashTable *local_media_descriptions; TpCallContentMediaDescription *current_offer; TpCallContentPacketizationType packetization; TpDTMFEvent current_dtmf_event; TpSendingState current_dtmf_state; gchar *requested_tones; const gchar *currently_sending_tones; gchar *deferred_tones; gboolean multiple_tones; gboolean tones_cancelled; guint tones_pause_timeout_id; gulong channel_state_changed_id; /* GQueue of GSimpleAsyncResult with a TpCallContentMediaDescription * as op_res_gpointer */ GQueue *outstanding_offers; GSimpleAsyncResult *current_offer_result; GCancellable *current_offer_cancellable; }; static GPtrArray *tp_base_media_call_content_get_interfaces ( TpBaseCallContent *bcc); static gboolean tp_base_media_call_content_start_tone (TpBaseCallContent *self, TpDTMFEvent event, GError **error); static gboolean tp_base_media_call_content_stop_tone (TpBaseCallContent *self, GError **error); static gboolean tp_base_media_call_content_multiple_tones ( TpBaseCallContent *self, const gchar *tones, GError **error); static void tp_base_media_call_content_dtmf_next (TpBaseMediaCallContent *self); static void tp_base_media_call_content_init (TpBaseMediaCallContent *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TP_TYPE_BASE_MEDIA_CALL_CONTENT, TpBaseMediaCallContentPrivate); self->priv->outstanding_offers = g_queue_new (); self->priv->local_media_descriptions = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_unref); self->priv->remote_media_descriptions = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_hash_table_unref); } static void call_content_deinit (TpBaseCallContent *base) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (base); g_queue_foreach (self->priv->outstanding_offers, (GFunc) g_object_unref, NULL); g_queue_clear (self->priv->outstanding_offers); if (self->priv->current_offer_cancellable != NULL) g_cancellable_cancel (self->priv->current_offer_cancellable); TP_BASE_CALL_CONTENT_CLASS ( tp_base_media_call_content_parent_class)->deinit (base); } static void tp_base_media_call_content_dispose (GObject *object) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (object); g_assert (self->priv->current_offer == NULL); g_assert (self->priv->current_offer_result == NULL); g_assert (g_queue_is_empty (self->priv->outstanding_offers)); tp_clear_pointer (&self->priv->local_media_descriptions, g_hash_table_unref); tp_clear_pointer (&self->priv->remote_media_descriptions, g_hash_table_unref); if (self->priv->tones_pause_timeout_id != 0) g_source_remove (self->priv->tones_pause_timeout_id); self->priv->tones_pause_timeout_id = 0; if (self->priv->channel_state_changed_id != 0) { TpBaseCallChannel *channel = _tp_base_call_content_get_channel ( TP_BASE_CALL_CONTENT (self)); g_signal_handler_disconnect (channel, self->priv->channel_state_changed_id); self->priv->channel_state_changed_id = 0; } if (G_OBJECT_CLASS (tp_base_media_call_content_parent_class)->dispose) G_OBJECT_CLASS (tp_base_media_call_content_parent_class)->dispose (object); } static void tp_base_media_call_content_finalize (GObject *object) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (object); g_queue_free (self->priv->outstanding_offers); g_free (self->priv->requested_tones); g_free (self->priv->deferred_tones); if (G_OBJECT_CLASS (tp_base_media_call_content_parent_class)->finalize) G_OBJECT_CLASS (tp_base_media_call_content_parent_class)->finalize (object); } static void tp_base_media_call_content_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (object); switch (property_id) { case PROP_REMOTE_MEDIA_DESCRIPTIONS: g_value_set_boxed (value, self->priv->remote_media_descriptions); break; case PROP_LOCAL_MEDIA_DESCRIPTIONS: g_value_set_boxed (value, self->priv->local_media_descriptions); break; case PROP_MEDIA_DESCRIPTION_OFFER: { const gchar *object_path = "/"; GHashTable *properties; GValueArray *value_array; if (self->priv->current_offer != NULL) { object_path = tp_call_content_media_description_get_object_path ( self->priv->current_offer); properties = _tp_call_content_media_description_dup_properties ( self->priv->current_offer); } else { properties = g_hash_table_new (NULL, NULL); } value_array = tp_value_array_build (2, DBUS_TYPE_G_OBJECT_PATH, object_path, TP_HASH_TYPE_MEDIA_DESCRIPTION_PROPERTIES, properties, G_TYPE_INVALID); g_value_take_boxed (value, value_array); g_hash_table_unref (properties); break; } case PROP_PACKETIZATION: g_value_set_uint (value, self->priv->packetization); break; case PROP_CURRENT_DTMF_EVENT: g_value_set_uchar (value, self->priv->current_dtmf_event); break; case PROP_CURRENT_DTMF_STATE: g_value_set_uint (value, self->priv->current_dtmf_state); break; case PROP_CURRENTLY_SENDING_TONES: g_value_set_boolean (value, self->priv->currently_sending_tones != NULL); break; case PROP_DEFERRED_TONES: if (self->priv->deferred_tones == NULL) g_value_set_static_string (value, ""); else g_value_set_string (value, self->priv->deferred_tones); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_media_call_content_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (object); switch (property_id) { case PROP_PACKETIZATION: self->priv->packetization = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void tp_base_media_call_content_class_init (TpBaseMediaCallContentClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseCallContentClass *bcc_class = TP_BASE_CALL_CONTENT_CLASS (klass); GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl content_media_props[] = { { "RemoteMediaDescriptions", "remote-media-descriptions", NULL }, { "LocalMediaDescriptions", "local-media-descriptions", NULL }, { "MediaDescriptionOffer", "media-description-offer", NULL }, { "Packetization", "packetization", NULL }, { "CurrentDTMFEvent", "current-dtmf-event", NULL }, { "CurrentDTMFState", "current-dtmf-state", NULL }, { NULL } }; g_type_class_add_private (klass, sizeof (TpBaseMediaCallContentPrivate)); object_class->get_property = tp_base_media_call_content_get_property; object_class->set_property = tp_base_media_call_content_set_property; object_class->dispose = tp_base_media_call_content_dispose; object_class->finalize = tp_base_media_call_content_finalize; bcc_class->deinit = call_content_deinit; bcc_class->get_interfaces = tp_base_media_call_content_get_interfaces; bcc_class->start_tone = tp_base_media_call_content_start_tone; bcc_class->stop_tone = tp_base_media_call_content_stop_tone; bcc_class->stop_tone = tp_base_media_call_content_stop_tone; bcc_class->multiple_tones = tp_base_media_call_content_multiple_tones; /** * TpBaseMediaCallContent:remote-media-descriptions: * * #GHashTable{contact #TpHandle, properties #GHashTable} * The map of contacts to remote media descriptions. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("remote-media-descriptions", "RemoteMediaDescriptions", "The map of contacts to remote media descriptions", TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_REMOTE_MEDIA_DESCRIPTIONS, param_spec); /** * TpBaseMediaCallContent:local-media-descriptions: * * #GHashTable{contact #TpHandle, properties #GHashTable} * The map of contacts to local media descriptions. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("local-media-descriptions", "LocalMediaDescriptions", "The map of contacts to local media descriptions", TP_HASH_TYPE_CONTACT_MEDIA_DESCRIPTION_PROPERTIES_MAP, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCAL_MEDIA_DESCRIPTIONS, param_spec); /** * TpBaseMediaCallContent:media-description-offer: * * #GValueArray{object-path, contact #TpHandle, properties #GHashTable}. * The current media description offer if any. * * Since: 0.17.5 */ param_spec = g_param_spec_boxed ("media-description-offer", "MediaDescriptionOffer", "The current media description offer if any", TP_STRUCT_TYPE_MEDIA_DESCRIPTION_OFFER, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_MEDIA_DESCRIPTION_OFFER, param_spec); /** * TpBaseMediaCallContent:packetization: * * The #TpCallContentPacketizationType of this content. * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("packetization", "Packetization", "The Packetization of this content", 0, G_MAXUINT, TP_CALL_CONTENT_PACKETIZATION_TYPE_RTP, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_PACKETIZATION, param_spec); /** * TpBaseMediaCallContent:current-dtmf-event: * * The currently being played #TpDTMFEvent if any * * Since: 0.17.5 */ param_spec = g_param_spec_uchar ("current-dtmf-event", "CurrentDTMFEvent", "The currently being played dtmf event if any", 0, TP_NUM_DTMF_EVENTS - 1, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENT_DTMF_EVENT, param_spec); /** * TpBaseMediaCallContent:current-dtmf-state: * * The #TpSendingState of the dtmf events * * Since: 0.17.5 */ param_spec = g_param_spec_uint ("current-dtmf-state", "CurrentDTMFState", "The sending state of the dtmf events", 0, TP_NUM_SENDING_STATES - 1, TP_SENDING_STATE_NONE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CURRENT_DTMF_STATE, param_spec); g_object_class_override_property (object_class, PROP_CURRENTLY_SENDING_TONES, "currently-sending-tones"); g_object_class_override_property (object_class, PROP_DEFERRED_TONES, "deferred-tones"); /** * TpBaseMediaCallContent::local-media-description-updated: * @self: the #TpCallChannel * @contact: the remote contact * @properties: the new media description properties asv * * The ::local-media-description-changed signal is emitted whenever the local * media description changes for a remote contact. * * Since: 0.17.5 */ _signals[LOCAL_MEDIA_DESCRIPTION_UPDATED] = g_signal_new ( "local-media-description-updated", G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_HASH_TABLE); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CALL_CONTENT_INTERFACE_MEDIA, tp_dbus_properties_mixin_getter_gobject_properties, NULL, content_media_props); } static void set_local_properties (TpBaseMediaCallContent *self, TpHandle contact, GHashTable *properties) { DEBUG ("Set local properties for contact %u", contact); g_hash_table_insert (self->priv->local_media_descriptions, GUINT_TO_POINTER (contact), g_hash_table_ref (properties)); g_signal_emit (self, _signals[LOCAL_MEDIA_DESCRIPTION_UPDATED], 0, contact, properties); tp_svc_call_content_interface_media_emit_local_media_description_changed ( self, properties); } static void set_remote_properties (TpBaseMediaCallContent *self, TpHandle contact, GHashTable *properties) { GHashTable *update; DEBUG ("Set remote properties for contact %u", contact); g_hash_table_insert (self->priv->remote_media_descriptions, GUINT_TO_POINTER (contact), g_hash_table_ref (properties)); update = g_hash_table_new (NULL, NULL); g_hash_table_insert (update, GUINT_TO_POINTER (contact), properties); tp_svc_call_content_interface_media_emit_remote_media_descriptions_changed ( self, update); g_hash_table_unref (update); } static void next_offer (TpBaseMediaCallContent *self); static void offer_finished_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpBaseMediaCallContent *self = user_data; TpCallContentMediaDescription *md = (TpCallContentMediaDescription *) source; GHashTable *local_properties = NULL; GHashTable *remote_properties = NULL; TpHandle contact; GError *error = NULL; g_assert (self->priv->current_offer == md); if (!_tp_call_content_media_description_offer_finish (md, result, &local_properties, &error)) { DEBUG ("Offer failed: %s", error->message); g_simple_async_result_take_error (self->priv->current_offer_result, error); goto out; } DEBUG ("Accepted offer: %s", tp_call_content_media_description_get_object_path (md)); /* Accepted, update local and remote MediaDescription */ remote_properties = _tp_call_content_media_description_dup_properties (md); contact = tp_call_content_media_description_get_remote_contact (md); set_local_properties (self, contact, local_properties); set_remote_properties (self, contact, remote_properties); out: g_simple_async_result_complete (self->priv->current_offer_result); g_clear_object (&self->priv->current_offer); g_clear_object (&self->priv->current_offer_result); g_clear_object (&self->priv->current_offer_cancellable); tp_svc_call_content_interface_media_emit_media_description_offer_done (self); next_offer (self); tp_clear_pointer (&local_properties, g_hash_table_unref); tp_clear_pointer (&remote_properties, g_hash_table_unref); g_object_unref (self); } static void next_offer (TpBaseMediaCallContent *self) { const gchar *object_path; GHashTable *properties; if (self->priv->current_offer_result != NULL) { DEBUG ("Waiting for the current offer to finish" " before starting the next one"); return; } self->priv->current_offer_result = g_queue_pop_head ( self->priv->outstanding_offers); if (self->priv->current_offer_result == NULL) { DEBUG ("No more offers outstanding"); return; } g_assert (self->priv->current_offer == NULL); g_assert (self->priv->current_offer_cancellable == NULL); self->priv->current_offer = g_simple_async_result_get_op_res_gpointer ( self->priv->current_offer_result); g_object_ref (self->priv->current_offer); self->priv->current_offer_cancellable = g_cancellable_new (); _tp_call_content_media_description_offer_async (self->priv->current_offer, self->priv->current_offer_cancellable, offer_finished_cb, g_object_ref (self)); object_path = tp_call_content_media_description_get_object_path ( self->priv->current_offer); properties = _tp_call_content_media_description_dup_properties ( self->priv->current_offer); DEBUG ("emitting NewMediaDescriptionOffer: %s", object_path); tp_svc_call_content_interface_media_emit_new_media_description_offer (self, object_path, properties); g_hash_table_unref (properties); } /** * tp_base_media_call_content_get_local_media_description: * @self: a #TpBaseMediaCallContent * @contact: the contact * * Get the media description used to stream to @contact. * * Returns: borrowed #GHashTable mapping iface propery string to #GValue. * Since: 0.17.5 */ GHashTable * tp_base_media_call_content_get_local_media_description ( TpBaseMediaCallContent *self, TpHandle contact) { g_return_val_if_fail (TP_IS_BASE_MEDIA_CALL_CONTENT (self), NULL); return g_hash_table_lookup (self->priv->local_media_descriptions, GUINT_TO_POINTER (contact)); } /** * tp_base_media_call_content_offer_media_description_async: * @self: a #TpBaseMediaCallContent * @md: a #TpCallContentMediaDescription * @callback: a callback to call when the operation finishes * @user_data: data to pass to @callback * * Offer @md for media description negociation. * * Since: 0.17.5 */ void tp_base_media_call_content_offer_media_description_async ( TpBaseMediaCallContent *self, TpCallContentMediaDescription *md, GAsyncReadyCallback callback, gpointer user_data) { GSimpleAsyncResult *result; g_return_if_fail (TP_IS_BASE_MEDIA_CALL_CONTENT (self)); g_return_if_fail (TP_IS_CALL_CONTENT_MEDIA_DESCRIPTION (md)); result = g_simple_async_result_new (G_OBJECT (self), callback, user_data, tp_base_media_call_content_offer_media_description_async); g_simple_async_result_set_op_res_gpointer (result, g_object_ref (md), g_object_unref); g_queue_push_tail (self->priv->outstanding_offers, result); next_offer (self); } /** * tp_base_media_call_content_offer_media_description_finish: * @self: a #TpBaseMediaCallContent * @result: a #GAsyncResult * @error: a #GError to fill * * Finishes tp_base_media_call_content_offer_media_description_async(). * * Since: 0.17.5 */ gboolean tp_base_media_call_content_offer_media_description_finish ( TpBaseMediaCallContent *self, GAsyncResult *result, GError **error) { _tp_implement_finish_void (self, tp_base_media_call_content_offer_media_description_async); } static void tp_base_media_call_content_update_local_media_description ( TpSvcCallContentInterfaceMedia *iface, GHashTable *properties, DBusGMethodInvocation *context) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (iface); GHashTable *current_properties; GPtrArray *codecs; TpHandle contact; gboolean valid; contact = tp_asv_get_uint32 (properties, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_REMOTE_CONTACT, &valid); if (!valid) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The media description is missing the RemoteContact key." }; dbus_g_method_return_error (context, &error); return; } current_properties = g_hash_table_lookup ( self->priv->local_media_descriptions, GUINT_TO_POINTER (contact)); if (current_properties == NULL) { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "The initial MediaDescription object has not yet appeared" }; dbus_g_method_return_error (context, &error); return; } codecs = tp_asv_get_boxed (properties, TP_PROP_CALL_CONTENT_MEDIA_DESCRIPTION_CODECS, TP_ARRAY_TYPE_CODEC_LIST); if (!codecs || codecs->len == 0) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Codecs can not be empty" }; dbus_g_method_return_error (context, &error); return; } if (self->priv->current_offer != NULL && tp_call_content_media_description_get_remote_contact (self->priv->current_offer) == contact) { GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "Can not update the media description while there is" " an outstanding offer for this contact." }; dbus_g_method_return_error (context, &error); return; } set_local_properties (self, contact, properties); tp_svc_call_content_interface_media_return_from_update_local_media_description (context); } static void tp_base_media_call_content_fail (TpSvcCallContentInterfaceMedia *iface, const GValueArray *reason_array, DBusGMethodInvocation *context) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (iface); TpBaseCallContent *content = (TpBaseCallContent *) self; TpBaseCallChannel *channel; channel = _tp_base_call_content_get_channel (content); _tp_base_call_channel_remove_content_internal (channel, content, reason_array); tp_svc_call_content_interface_media_return_from_fail (context); } static void tp_base_media_call_content_acknowledge_dtmf_change ( TpSvcCallContentInterfaceMedia *iface, guchar in_Event, guint in_State, DBusGMethodInvocation *context) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (iface); if (self->priv->current_dtmf_event != in_Event) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The acknoledgement is not for the right event"}; dbus_g_method_return_error (context, &error); return; } if (in_State != TP_SENDING_STATE_SENDING && in_State != TP_SENDING_STATE_NONE) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The new sending state can not be a pending state"}; dbus_g_method_return_error (context, &error); return; } if (in_State == self->priv->current_dtmf_state) goto out; if (self->priv->current_dtmf_state != TP_SENDING_STATE_PENDING_SEND && self->priv->current_dtmf_state != TP_SENDING_STATE_PENDING_STOP_SENDING) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Acknowledge rejected because we are not in a pending state"}; dbus_g_method_return_error (context, &error); return; } if ((self->priv->current_dtmf_state == TP_SENDING_STATE_PENDING_SEND && in_State != TP_SENDING_STATE_SENDING) || (self->priv->current_dtmf_state == TP_SENDING_STATE_PENDING_STOP_SENDING && in_State != TP_SENDING_STATE_NONE)) { GError error = { TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The new sending state does not match the pending state"}; dbus_g_method_return_error (context, &error); return; } /* Only tell the UI we are sending if we are actually sending */ if (in_State == TP_SENDING_STATE_SENDING) tp_svc_call_content_interface_dtmf_emit_sending_tones (self, self->priv->currently_sending_tones); else if (in_State == TP_SENDING_STATE_NONE && self->priv->currently_sending_tones && self->priv->currently_sending_tones[0]) self->priv->currently_sending_tones++; self->priv->current_dtmf_state = in_State; tp_base_media_call_content_dtmf_next (self); out: tp_svc_call_content_interface_media_return_from_acknowledge_dtmf_change ( context); } static void call_content_media_iface_init (gpointer g_iface, gpointer iface_data) { TpSvcCallContentInterfaceMediaClass *klass = (TpSvcCallContentInterfaceMediaClass *) g_iface; #define IMPLEMENT(x) tp_svc_call_content_interface_media_implement_##x (\ klass, tp_base_media_call_content_##x) IMPLEMENT(update_local_media_description); IMPLEMENT(acknowledge_dtmf_change); IMPLEMENT(fail); #undef IMPLEMENT } gboolean _tp_base_media_call_content_ready_to_accept (TpBaseMediaCallContent *self) { TpBaseCallContent *bcc = TP_BASE_CALL_CONTENT (self); GList *item; gboolean ret = TRUE; gboolean initial = tp_base_call_content_get_disposition (bcc) == TP_CALL_CONTENT_DISPOSITION_INITIAL; for (item = tp_base_call_content_get_streams (bcc); item; item = item->next) { TpBaseMediaCallStream *stream = item->data; GHashTable *members = _tp_base_call_stream_get_remote_members ( TP_BASE_CALL_STREAM (stream)); GHashTableIter iter; gpointer key, value; TpStreamFlowState receiving_state = tp_base_media_call_stream_get_receiving_state (stream); /* On incoming calls, start streaming (sending) when we accept the call, * if that was what the other side proposed */ if (initial && !tp_base_channel_is_requested ( TP_BASE_CHANNEL (_tp_base_call_content_get_channel (bcc))) && tp_base_call_stream_get_local_sending_state ( TP_BASE_CALL_STREAM (stream)) == TP_SENDING_STATE_PENDING_SEND) { tp_base_media_call_stream_set_local_sending (stream, TRUE); } tp_base_media_call_stream_update_sending_state (stream); g_hash_table_iter_init (&iter, members); while (g_hash_table_iter_next (&iter, &key, &value)) { TpSendingState member_state = GPOINTER_TO_INT (value); if (member_state == TP_SENDING_STATE_PENDING_SEND || member_state == TP_SENDING_STATE_SENDING) { tp_base_media_call_stream_update_receiving_state (stream); if (receiving_state != TP_STREAM_FLOW_STATE_STARTED) { if (initial) ret = FALSE; } } } } return ret; } void _tp_base_media_call_content_remote_accepted (TpBaseMediaCallContent *self) { TpBaseCallContent *bcc = TP_BASE_CALL_CONTENT (self); GList *l; if (tp_base_call_content_get_disposition (bcc) != TP_CALL_CONTENT_DISPOSITION_INITIAL) return; for (l = tp_base_call_content_get_streams (bcc); l != NULL; l = l->next) { TpBaseMediaCallStream *stream = TP_BASE_MEDIA_CALL_STREAM (l->data); TpSendingState local = tp_base_call_stream_get_local_sending_state ( TP_BASE_CALL_STREAM (stream)); if (local == TP_SENDING_STATE_SENDING) tp_base_media_call_stream_set_local_sending (stream, TRUE); tp_base_media_call_stream_update_sending_state (stream); } } static gboolean tp_base_media_call_content_start_tone (TpBaseCallContent *bcc, TpDTMFEvent event, GError **error) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (bcc); gchar buf[2] = { 0, 0 }; if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"); return FALSE; } if (self->priv->currently_sending_tones != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_SERVICE_BUSY, "Already sending a tone"); return FALSE; } buf[0] = tp_dtmf_event_to_char (event); if (_tp_dtmf_char_classify (buf[0]) == DTMF_CHAR_CLASS_MEANINGLESS) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid DTMF event %s", buf); return FALSE; } self->priv->multiple_tones = FALSE; self->priv->requested_tones = g_strdup (buf); self->priv->currently_sending_tones = self->priv->requested_tones; g_free (self->priv->deferred_tones); self->priv->deferred_tones = NULL; tp_base_media_call_content_dtmf_next (self); return TRUE; } static gboolean tp_base_media_call_content_stop_tone (TpBaseCallContent *bcc, GError **error) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (bcc); if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"); return FALSE; } if (self->priv->currently_sending_tones == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "No tone is currently being played"); return FALSE; } self->priv->currently_sending_tones = ""; self->priv->tones_cancelled = TRUE; tp_base_media_call_content_dtmf_next (self); return TRUE; } static gboolean tp_base_media_call_content_multiple_tones (TpBaseCallContent *bcc, const gchar *tones, GError **error) { TpBaseMediaCallContent *self = TP_BASE_MEDIA_CALL_CONTENT (bcc); guint i; if (tp_base_call_content_get_media_type (bcc) != TP_MEDIA_STREAM_TYPE_AUDIO) { g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method does not exist"); return FALSE; } if (self->priv->currently_sending_tones != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_SERVICE_BUSY, "Already sending a tone"); return FALSE; } for (i = 0; tones[i] != '\0'; i++) { if (_tp_dtmf_char_classify (tones[i]) == DTMF_CHAR_CLASS_MEANINGLESS) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Invalid character in DTMF string starting at %s", tones + i); return FALSE; } } self->priv->multiple_tones = TRUE; self->priv->requested_tones = g_strdup (tones); self->priv->currently_sending_tones = self->priv->requested_tones; g_free (self->priv->deferred_tones); self->priv->deferred_tones = NULL; tp_base_media_call_content_dtmf_next (self); return TRUE; } static gboolean dtmf_pause_timeout_func (gpointer data) { TpBaseMediaCallContent *self = data; self->priv->tones_pause_timeout_id = 0; tp_base_media_call_content_dtmf_next (self); return FALSE; } static void channel_state_changed_cb (TpBaseCallChannel *channel, TpCallState state, TpCallFlags flags, gpointer reason, GHashTable *details, TpBaseMediaCallContent *self) { if (state != TP_CALL_STATE_ACTIVE) return; if (self->priv->channel_state_changed_id != 0) { g_signal_handler_disconnect (self, self->priv->channel_state_changed_id); self->priv->channel_state_changed_id = 0; } tp_base_media_call_content_dtmf_next (self); } static void tp_base_media_call_content_dtmf_next (TpBaseMediaCallContent *self) { g_assert (self->priv->currently_sending_tones != NULL); switch (self->priv->current_dtmf_state) { case TP_SENDING_STATE_PENDING_SEND: if (self->priv->tones_cancelled) { self->priv->current_dtmf_state = TP_SENDING_STATE_PENDING_STOP_SENDING; tp_svc_call_content_interface_media_emit_dtmf_change_requested (self, self->priv->current_dtmf_event, self->priv->current_dtmf_state); return; } break; case TP_SENDING_STATE_PENDING_STOP_SENDING: /* Waiting on streaming implementation, do nothing */ break; case TP_SENDING_STATE_SENDING: if (self->priv->tones_cancelled || self->priv->multiple_tones) { self->priv->current_dtmf_state = TP_SENDING_STATE_PENDING_STOP_SENDING; tp_svc_call_content_interface_media_emit_dtmf_change_requested (self, self->priv->current_dtmf_event, self->priv->current_dtmf_state); } break; case TP_SENDING_STATE_NONE: { gchar next; TpBaseCallChannel *channel = _tp_base_call_content_get_channel ( TP_BASE_CALL_CONTENT (self)); /* Waiting for timeout */ if (self->priv->tones_pause_timeout_id != 0) return; if (channel && tp_base_call_channel_get_state (channel) != TP_CALL_STATE_ACTIVE) { if (self->priv->channel_state_changed_id == 0) self->priv->channel_state_changed_id = g_signal_connect (channel, "call-state-changed", G_CALLBACK (channel_state_changed_cb), self); return; } next = self->priv->currently_sending_tones[0]; if (next) { switch (_tp_dtmf_char_classify (next)) { case DTMF_CHAR_CLASS_EVENT: self->priv->current_dtmf_event = _tp_dtmf_char_to_event (next); self->priv->current_dtmf_state = TP_SENDING_STATE_PENDING_SEND; tp_svc_call_content_interface_media_emit_dtmf_change_requested ( self, self->priv->current_dtmf_event, self->priv->current_dtmf_state); break; case DTMF_CHAR_CLASS_PAUSE: self->priv->tones_pause_timeout_id = g_timeout_add ( DTMF_PAUSE_MS, dtmf_pause_timeout_func, self); tp_svc_call_content_interface_dtmf_emit_sending_tones (self, self->priv->currently_sending_tones); break; case DTMF_CHAR_CLASS_WAIT_FOR_USER: self->priv->deferred_tones = g_strdup (self->priv->currently_sending_tones + 1); self->priv->currently_sending_tones = ""; tp_svc_call_content_interface_dtmf_emit_tones_deferred (self, self->priv->deferred_tones); /* Let's stop here ! */ goto done; break; default: g_assert_not_reached (); } } else { done: tp_svc_call_content_interface_dtmf_emit_stopped_tones (self, self->priv->tones_cancelled && self->priv->multiple_tones); self->priv->tones_cancelled = FALSE; g_free (self->priv->requested_tones); self->priv->requested_tones = NULL; self->priv->currently_sending_tones = NULL; } } break; default: g_assert_not_reached (); } } static GPtrArray * tp_base_media_call_content_get_interfaces (TpBaseCallContent *bcc) { GPtrArray *interfaces; interfaces = TP_BASE_CALL_CONTENT_CLASS ( tp_base_media_call_content_parent_class)->get_interfaces (bcc); g_ptr_array_add (interfaces, TP_IFACE_CALL_CONTENT_INTERFACE_MEDIA); if (tp_base_call_content_get_media_type (bcc) == TP_MEDIA_STREAM_TYPE_AUDIO) g_ptr_array_add (interfaces, TP_IFACE_CALL_CONTENT_INTERFACE_DTMF); return interfaces; } telepathy-glib-0.24.2/telepathy-glib/base-media-call-content.h0000644000175000017500000000645712652510705021104 00000000000000/* * base-media-call-content.h - Header for TpBaseMediaCallContent * Copyright (C) 2009-2011 Collabora Ltd. * @author Sjoerd Simons * @author Xavier Claessens * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if defined (TP_DISABLE_SINGLE_INCLUDE) && !defined (_TP_IN_META_HEADER) && !defined (_TP_COMPILATION) #error "Only and can be included directly." #endif #ifndef __TP_BASE_MEDIA_CALL_CONTENT_H__ #define __TP_BASE_MEDIA_CALL_CONTENT_H__ #include #include #include #include G_BEGIN_DECLS typedef struct _TpBaseMediaCallContent TpBaseMediaCallContent; typedef struct _TpBaseMediaCallContentPrivate TpBaseMediaCallContentPrivate; typedef struct _TpBaseMediaCallContentClass TpBaseMediaCallContentClass; struct _TpBaseMediaCallContentClass { /**/ TpBaseCallContentClass parent_class; gpointer future[4]; }; struct _TpBaseMediaCallContent { /**/ TpBaseCallContent parent; TpBaseMediaCallContentPrivate *priv; }; GType tp_base_media_call_content_get_type (void); /* TYPE MACROS */ #define TP_TYPE_BASE_MEDIA_CALL_CONTENT \ (tp_base_media_call_content_get_type ()) #define TP_BASE_MEDIA_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ TP_TYPE_BASE_MEDIA_CALL_CONTENT, TpBaseMediaCallContent)) #define TP_BASE_MEDIA_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ TP_TYPE_BASE_MEDIA_CALL_CONTENT, TpBaseMediaCallContentClass)) #define TP_IS_BASE_MEDIA_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), TP_TYPE_BASE_MEDIA_CALL_CONTENT)) #define TP_IS_BASE_MEDIA_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), TP_TYPE_BASE_MEDIA_CALL_CONTENT)) #define TP_BASE_MEDIA_CALL_CONTENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ TP_TYPE_BASE_MEDIA_CALL_CONTENT, TpBaseMediaCallContentClass)) _TP_AVAILABLE_IN_0_18 GHashTable *tp_base_media_call_content_get_local_media_description ( TpBaseMediaCallContent *self, TpHandle contact); _TP_AVAILABLE_IN_0_18 void tp_base_media_call_content_offer_media_description_async ( TpBaseMediaCallContent *self, TpCallContentMediaDescription *md, GAsyncReadyCallback callback, gpointer user_data); _TP_AVAILABLE_IN_0_18 gboolean tp_base_media_call_content_offer_media_description_finish ( TpBaseMediaCallContent *self, GAsyncResult *result, GError **error); G_END_DECLS #endif /* #ifndef __TP_BASE_MEDIA_CALL_CONTENT_H__*/ telepathy-glib-0.24.2/gtk-doc.make0000644000175000017500000002504013721023002013610 00000000000000# -*- mode: makefile -*- # # gtk-doc.make - make rules for gtk-doc # Copyright (C) 2003 James Henstridge # 2004-2007 Damon Chaplin # 2007-2017 Stefan Sauer # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = $(LIBTOOL) --mode=execute else GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) GTKDOC_RUN = endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) SETUP_FILES = \ $(content_files) \ $(expand_content_files) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt EXTRA_DIST = \ $(HTML_IMAGES) \ $(SETUP_FILES) DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ html-build.stamp pdf-build.stamp \ sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt gtkdoc-check.test: Makefile $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ chmod +x $@ CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test if GTK_DOC_BUILD_HTML HTML_BUILD_STAMP=html-build.stamp else HTML_BUILD_STAMP= endif if GTK_DOC_BUILD_PDF PDF_BUILD_STAMP=pdf-build.stamp else PDF_BUILD_STAMP= endif all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) .PHONY: all-gtk-doc if ENABLE_GTK_DOC all-local: all-gtk-doc endif docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp #### setup #### GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_@AM_V@) GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; setup-build.stamp: -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ if test "x$$files" != "x" ; then \ for file in $$files ; do \ destdir=`dirname $(abs_builddir)/$$file`; \ test -d "$$destdir" || mkdir -p "$$destdir"; \ test -f $(abs_srcdir)/$$file && \ cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ done; \ fi; \ fi $(AM_V_at)touch setup-build.stamp #### scan #### GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_@AM_V@) GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_@AM_V@) GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(GTK_DOC_V_SCAN)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ scanobj_options=""; \ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ scanobj_options="--verbose"; \ fi; \ fi; \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ else \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi $(AM_V_at)touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### xml #### GTK_DOC_V_XML=$(GTK_DOC_V_XML_@AM_V@) GTK_DOC_V_XML_=$(GTK_DOC_V_XML_@AM_DEFAULT_V@) GTK_DOC_V_XML_0=@echo " DOC Building XML"; sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent $(GTK_DOC_V_XML)_source_dir='' ; \ for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ done ; \ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) $(AM_V_at)touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true $(DOC_MAIN_SGML_FILE): sgml-build.stamp @true xml/gtkdocentities.ent: Makefile $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ echo ""; \ ) > $@ #### html #### GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_@AM_V@) GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_@AM_DEFAULT_V@) GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_@AM_V@) GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_@AM_DEFAULT_V@) GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkhtml_options="$$mkhtml_options --verbose"; \ fi; \ fi; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$$?" = "0"; then \ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ fi; \ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) -@test "x$(HTML_IMAGES)" = "x" || \ for file in $(HTML_IMAGES) ; do \ test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ test -f $$file && cp $$file $(abs_builddir)/html; \ done; $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) $(AM_V_at)touch html-build.stamp #### pdf #### GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_@AM_V@) GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_@AM_DEFAULT_V@) GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ mkpdf_options=""; \ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ if test "$$?" = "0"; then \ if test "x$(V)" = "x1"; then \ mkpdf_options="$$mkpdf_options --verbose"; \ fi; \ fi; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ part=`dirname $$img`; \ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ if test $$? != 0; then \ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ fi; \ done; \ fi; \ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) $(AM_V_at)touch pdf-build.stamp ############## clean-local: @rm -f *~ *.bak @rm -rf .libs @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ rm -f $(DOC_MODULE).types; \ fi @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ rm -f $(DOC_MODULE)-sections.txt; \ fi distclean-local: @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ fi maintainer-clean-local: @rm -rf xml html install-data-local: @installfiles=`echo $(builddir)/html/*`; \ if test "$$installfiles" = '$(builddir)/html/*'; \ then echo 1>&2 'Nothing to install' ; \ else \ if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ $(mkinstalldirs) $${installdir} ; \ for i in $$installfiles; do \ echo ' $(INSTALL_DATA) '$$i ; \ $(INSTALL_DATA) $$i $${installdir}; \ done; \ if test -n "$(DOC_MODULE_VERSION)"; then \ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ fi; \ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ fi uninstall-local: @if test -n "$(DOC_MODULE_VERSION)"; then \ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ else \ installdir="$(DESTDIR)$(TARGET_DIR)"; \ fi; \ rm -rf $${installdir} # # Require gtk-doc when making dist # if HAVE_GTK_DOC dist-check-gtkdoc: docs else dist-check-gtkdoc: @echo "*** gtk-doc is needed to run 'make dist'. ***" @echo "*** gtk-doc was not found when 'configure' ran. ***" @echo "*** please install gtk-doc and rerun 'configure'. ***" @false endif dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local @mkdir $(distdir)/html @cp ./html/* $(distdir)/html @-cp ./$(DOC_MODULE).pdf $(distdir)/ @-cp ./$(DOC_MODULE).types $(distdir)/ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ @cd $(distdir) && rm -f $(DISTCLEANFILES) @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs telepathy-glib-0.24.2/build-aux/0000755000175000017500000000000014006623343013405 500000000000000telepathy-glib-0.24.2/build-aux/compile0000755000175000017500000001635014006601553014707 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: telepathy-glib-0.24.2/build-aux/depcomp0000755000175000017500000005602014006601553014704 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2020 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: telepathy-glib-0.24.2/build-aux/test-driver0000755000175000017500000001104214006601553015520 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2020 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>$log_file # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: telepathy-glib-0.24.2/build-aux/ltmain.sh0000644000175000017500000117416514006601547015166 00000000000000#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-10-04.22; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote ARG # -------------- # Aesthetically quote one ARG, store the result into $func_quote_result. Note # that we keep attention to performance here (so far O(N) complexity as long as # func_append is O(1)). func_quote () { $debug_cmd func_quote_result=$1 case $func_quote_result in *[\\\`\"\$]*) case $func_quote_result in *[\[\*\?]*) func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` return 0 ;; esac func_quote_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_result do case $1 in quote) func_append func_quote_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_result= ;; first) set quote "$_G_part" "" ;; esac done IFS=$func_quote_old_IFS done ;; *) ;; esac } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do func_quote "$1" _G_unquoted_arg=$func_quote_result if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote "$ECHO" qECHO=$func_quote_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac # As we are forced to pass -nostdlib to g++ during linking, the option # -pthread{,s} is not in effect; add the -lpthread to $deplist # explicitly to link correctly. if test "$tagname" = CXX -a x"$with_gcc" = xyes; then case "$arg" in -pthread*) func_append deplibs " -lpthread" ;; esac fi continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done func_quote "(cd `pwd`; $relink_command)" relink_command=$func_quote_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote "$relink_command" relink_command=$func_quote_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: telepathy-glib-0.24.2/build-aux/config.guess0000755000175000017500000013733214006601553015655 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2020 Free Software Foundation, Inc. timestamp='2020-04-26' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$driver" break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; *:OS108:*:*) echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Twizzler:*:*) echo "$UNAME_MACHINE"-unknown-twizzler exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi else echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI="$LIBC"x32 fi fi echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; *:Unleashed:*:*) echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" exit ;; esac # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-glib-0.24.2/build-aux/install-sh0000755000175000017500000003643514006601553015343 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: telepathy-glib-0.24.2/build-aux/config.sub0000755000175000017500000007626314006601553015325 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2020 Free Software Foundation, Inc. timestamp='2020-06-20' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 os=$maybe_os ;; android-linux) basic_machine=$field1-unknown os=linux-android ;; *) basic_machine=$field1-$field2 os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 os= ;; *) basic_machine=$field1 os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc os=bsd ;; a29khif) basic_machine=a29k-amd os=udi ;; adobe68k) basic_machine=m68010-adobe os=scout ;; alliant) basic_machine=fx80-alliant os= ;; altos | altos3068) basic_machine=m68k-altos os= ;; am29k) basic_machine=a29k-none os=bsd ;; amdahl) basic_machine=580-amdahl os=sysv ;; amiga) basic_machine=m68k-unknown os= ;; amigaos | amigados) basic_machine=m68k-unknown os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=sysv4 ;; apollo68) basic_machine=m68k-apollo os=sysv ;; apollo68bsd) basic_machine=m68k-apollo os=bsd ;; aros) basic_machine=i386-pc os=aros ;; aux) basic_machine=m68k-apple os=aux ;; balance) basic_machine=ns32k-sequent os=dynix ;; blackfin) basic_machine=bfin-unknown os=linux ;; cegcc) basic_machine=arm-unknown os=cegcc ;; convex-c1) basic_machine=c1-convex os=bsd ;; convex-c2) basic_machine=c2-convex os=bsd ;; convex-c32) basic_machine=c32-convex os=bsd ;; convex-c34) basic_machine=c34-convex os=bsd ;; convex-c38) basic_machine=c38-convex os=bsd ;; cray) basic_machine=j90-cray os=unicos ;; crds | unos) basic_machine=m68k-crds os= ;; da30) basic_machine=m68k-da30 os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec os= ;; delta88) basic_machine=m88k-motorola os=sysv3 ;; dicos) basic_machine=i686-pc os=dicos ;; djgpp) basic_machine=i586-pc os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=ose ;; gmicro) basic_machine=tron-gmicro os=sysv ;; go32) basic_machine=i386-pc os=go32 ;; h8300hms) basic_machine=h8300-hitachi os=hms ;; h8300xray) basic_machine=h8300-hitachi os=xray ;; h8500hms) basic_machine=h8500-hitachi os=hms ;; harris) basic_machine=m88k-harris os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp os=hpux ;; hp300bsd) basic_machine=m68k-hp os=bsd ;; hppaosf) basic_machine=hppa1.1-hp os=osf ;; hppro) basic_machine=hppa1.1-hp os=proelf ;; i386mach) basic_machine=i386-mach os=mach ;; isi68 | isi) basic_machine=m68k-isi os=sysv ;; m68knommu) basic_machine=m68k-unknown os=linux ;; magnum | m3230) basic_machine=mips-mips os=sysv ;; merlin) basic_machine=ns32k-utek os=sysv ;; mingw64) basic_machine=x86_64-pc os=mingw64 ;; mingw32) basic_machine=i686-pc os=mingw32 ;; mingw32ce) basic_machine=arm-unknown os=mingw32ce ;; monitor) basic_machine=m68k-rom68k os=coff ;; morphos) basic_machine=powerpc-unknown os=morphos ;; moxiebox) basic_machine=moxie-unknown os=moxiebox ;; msdos) basic_machine=i386-pc os=msdos ;; msys) basic_machine=i686-pc os=msys ;; mvs) basic_machine=i370-ibm os=mvs ;; nacl) basic_machine=le32-unknown os=nacl ;; ncr3000) basic_machine=i486-ncr os=sysv4 ;; netbsd386) basic_machine=i386-pc os=netbsd ;; netwinder) basic_machine=armv4l-rebel os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=newsos ;; news1000) basic_machine=m68030-sony os=newsos ;; necv70) basic_machine=v70-nec os=sysv ;; nh3000) basic_machine=m68k-harris os=cxux ;; nh[45]000) basic_machine=m88k-harris os=cxux ;; nindy960) basic_machine=i960-intel os=nindy ;; mon960) basic_machine=i960-intel os=mon960 ;; nonstopux) basic_machine=mips-compaq os=nonstopux ;; os400) basic_machine=powerpc-ibm os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=ose ;; os68k) basic_machine=m68k-none os=os68k ;; paragon) basic_machine=i860-intel os=osf ;; parisc) basic_machine=hppa-unknown os=linux ;; psp) basic_machine=mipsallegrexel-sony os=psp ;; pw32) basic_machine=i586-unknown os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=rdos ;; rdos32) basic_machine=i386-pc os=rdos ;; rom68k) basic_machine=m68k-rom68k os=coff ;; sa29200) basic_machine=a29k-amd os=udi ;; sei) basic_machine=mips-sei os=seiux ;; sequent) basic_machine=i386-sequent os= ;; sps7) basic_machine=m68k-bull os=sysv2 ;; st2000) basic_machine=m68k-tandem os= ;; stratus) basic_machine=i860-stratus os=sysv4 ;; sun2) basic_machine=m68000-sun os= ;; sun2os3) basic_machine=m68000-sun os=sunos3 ;; sun2os4) basic_machine=m68000-sun os=sunos4 ;; sun3) basic_machine=m68k-sun os= ;; sun3os3) basic_machine=m68k-sun os=sunos3 ;; sun3os4) basic_machine=m68k-sun os=sunos4 ;; sun4) basic_machine=sparc-sun os= ;; sun4os3) basic_machine=sparc-sun os=sunos3 ;; sun4os4) basic_machine=sparc-sun os=sunos4 ;; sun4sol2) basic_machine=sparc-sun os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun os= ;; sv1) basic_machine=sv1-cray os=unicos ;; symmetry) basic_machine=i386-sequent os=dynix ;; t3e) basic_machine=alphaev5-cray os=unicos ;; t90) basic_machine=t90-cray os=unicos ;; toad1) basic_machine=pdp10-xkl os=tops20 ;; tpf) basic_machine=s390x-ibm os=tpf ;; udi29k) basic_machine=a29k-amd os=udi ;; ultra3) basic_machine=a29k-nyu os=sym1 ;; v810 | necv810) basic_machine=v810-nec os=none ;; vaxv) basic_machine=vax-dec os=sysv ;; vms) basic_machine=vax-dec os=vms ;; vsta) basic_machine=i386-pc os=vsta ;; vxworks960) basic_machine=i960-wrs os=vxworks ;; vxworks68) basic_machine=m68k-wrs os=vxworks ;; vxworks29k) basic_machine=a29k-wrs os=vxworks ;; xbox) basic_machine=i686-pc os=mingw32 ;; ymp) basic_machine=ymp-cray os=unicos ;; *) basic_machine=$1 os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi os=${os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray os=${os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $os in irix*) ;; *) os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari os=mint ;; mipsEE* | ee) cpu=mips64r5900el vendor=scei case $os in linux*) ;; *) os=elf ;; esac ;; iop) cpu=mipsel vendor=scei os=irx ;; dvp) cpu=dvp vendor=scei os=elf ;; news-3600 | risc-news) cpu=mips vendor=sony os=newsos ;; next | m*-next) cpu=m68k vendor=next case $os in openstep*) ;; nextstep*) ;; ns2*) os=nextstep2 ;; *) os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde os=${os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x$os != x ] then case $os in # First match some system type aliases that might get confused # with valid system types. # solaris* is a basic system type, with this one exception. auroraux) os=auroraux ;; bluegene*) os=cnk ;; solaris1 | solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; solaris) os=solaris2 ;; unixware*) os=sysv4.2uw ;; gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) es1800*) os=ose ;; # Some version numbers need modification chorusos*) os=chorusos ;; isc) os=isc2.2 ;; sco6) os=sco5v6 ;; sco5) os=sco3.2v5 ;; sco4) os=sco3.2v4 ;; sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` ;; sco3.2v[4-9]* | sco5v6*) # Don't forget version if it is 3.2v4 or newer. ;; scout) # Don't match below ;; sco*) os=sco3.2v2 ;; psos*) os=psos ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # sysv* is not here because it comes later, after sysvr4. gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | sym* | kopensolaris* | plan9* \ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | aos* | aros* | cloudabi* | sortix* | twizzler* \ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | knetbsd* | mirbsd* | netbsd* \ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ | chorusrdb* | cegcc* | glidix* \ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ | linux-newlib* | linux-musl* | linux-uclibc* \ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | interix* | uwin* | mks* | rhapsody* | darwin* \ | openstep* | oskit* | conix* | pw32* | nonstopux* \ | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \ | os2* | vos* | palmos* | uclinux* | nucleus* \ | morphos* | superux* | rtmk* | windiss* \ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode*) # Remember, each alternative MUST END IN *, to match a version number. ;; qnx*) case $cpu in x86 | i*86) ;; *) os=nto-$os ;; esac ;; hiux*) os=hiuxwe2 ;; nto-qnx*) ;; nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; sim | xray | os68k* | v88r* \ | windows* | osx | abug | netware* | os9* \ | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; linux-dietlibc) os=linux-dietlibc ;; linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; lynx*178) os=lynxos178 ;; lynx*5) os=lynxos5 ;; lynx*) os=lynxos ;; mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; opened*) os=openedition ;; os400*) os=os400 ;; sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; wince*) os=wince ;; utek*) os=bsd ;; dynix*) os=bsd ;; acis*) os=aos ;; atheos*) os=atheos ;; syllable*) os=syllable ;; 386bsd) os=bsd ;; ctix* | uts*) os=sysv ;; nova*) os=rtmk-nova ;; ns2) os=nextstep2 ;; # Preserve the version number of sinix5. sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; sinix*) os=sysv4 ;; tpf*) os=tpf ;; triton*) os=sysv3 ;; oss*) os=sysv3 ;; svr4*) os=sysv4 ;; svr3) os=sysv3 ;; sysvr4) os=sysv4 ;; # This must come after sysvr4. sysv*) ;; ose*) os=ose ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) os=mint ;; zvmoe) os=zvmoe ;; dicos*) os=dicos ;; pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $cpu in arm*) os=eabi ;; *) os=elf ;; esac ;; nacl*) ;; ios) ;; psp) ;; none) ;; *-eabi) ;; *) echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $cpu-$vendor in score-*) os=elf ;; spu-*) os=elf ;; *-acorn) os=riscix1.2 ;; arm*-rebel) os=linux ;; arm*-semi) os=aout ;; c4x-* | tic4x-*) os=coff ;; c8051-*) os=elf ;; clipper-intergraph) os=clix ;; hexagon-*) os=elf ;; tic54x-*) os=coff ;; tic55x-*) os=coff ;; tic6x-*) os=coff ;; # This must come before the *-dec entry. pdp10-*) os=tops20 ;; pdp11-*) os=none ;; *-dec | vax-*) os=ultrix4.2 ;; m68*-apollo) os=domain ;; i386-sun) os=sunos4.0.2 ;; m68000-sun) os=sunos3 ;; m68*-cisco) os=aout ;; mep-*) os=elf ;; mips*-cisco) os=elf ;; mips*-*) os=elf ;; or32-*) os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=sysv3 ;; sparc-* | *-sun) os=sunos4.1.1 ;; pru-*) os=elf ;; *-be) os=beos ;; *-ibm) os=aix ;; *-knuth) os=mmixware ;; *-wec) os=proelf ;; *-winbond) os=proelf ;; *-oki) os=proelf ;; *-hp) os=hpux ;; *-hitachi) os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=sysv ;; *-cbm) os=amigaos ;; *-dg) os=dgux ;; *-dolphin) os=sysv3 ;; m68k-ccur) os=rtu ;; m88k-omron*) os=luna ;; *-next) os=nextstep ;; *-sequent) os=ptx ;; *-crds) os=unos ;; *-ns) os=genix ;; i370-*) os=mvs ;; *-gould) os=sysv ;; *-highlevel) os=bsd ;; *-encore) os=bsd ;; *-sgi) os=irix ;; *-siemens) os=sysv4 ;; *-masscomp) os=rtu ;; f30[01]-fujitsu | f700-fujitsu) os=uxpv ;; *-rom68k) os=coff ;; *-*bug) os=coff ;; *-apple) os=macos ;; *-atari*) os=mint ;; *-wrs) os=vxworks ;; *) os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $os in riscix*) vendor=acorn ;; sunos*) vendor=sun ;; cnk*|-aix*) vendor=ibm ;; beos*) vendor=be ;; hpux*) vendor=hp ;; mpeix*) vendor=hp ;; hiux*) vendor=hitachi ;; unos*) vendor=crds ;; dgux*) vendor=dg ;; luna*) vendor=omron ;; genix*) vendor=ns ;; clix*) vendor=intergraph ;; mvs* | opened*) vendor=ibm ;; os400*) vendor=ibm ;; ptx*) vendor=sequent ;; tpf*) vendor=ibm ;; vxsim* | vxworks* | windiss*) vendor=wrs ;; aux*) vendor=apple ;; hms*) vendor=hitachi ;; mpw* | macos*) vendor=apple ;; *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: telepathy-glib-0.24.2/build-aux/missing0000755000175000017500000001533614006601553014733 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: telepathy-glib-0.24.2/AUTHORS0000644000175000017500000000161112652510705012504 00000000000000(In alphabetical order by last name) Sunil Mohan Adapa Emanuele Aina Ross Burton Xavier Claessens Alban Crequy Guillaume Desmottes Dafydd Harries Pkilippe Kalaf Alberto Mardegan Robert McQueen Simon McVittie Mads Chr. Olesen Pekka Pessi Senko Rasic Ole André Ravnaas Olli Salli Sjoerd Simons Rob Taylor Will Thompson Mikhail Zabaluev telepathy-glib-0.24.2/INSTALL0000644000175000017500000003661414006601553012475 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. telepathy-glib-0.24.2/examples/0000755000175000017500000000000014006623342013330 500000000000000telepathy-glib-0.24.2/examples/cm/0000755000175000017500000000000014006623343013730 500000000000000telepathy-glib-0.24.2/examples/cm/call/0000755000175000017500000000000014006623342014642 500000000000000telepathy-glib-0.24.2/examples/cm/call/cm.c0000644000175000017500000000477112652510705015341 00000000000000/* * manager.c - an example connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "cm.h" #include #include #include "conn.h" #include "protocol.h" G_DEFINE_TYPE (ExampleCallConnectionManager, example_call_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) struct _ExampleCallConnectionManagerPrivate { int dummy; }; static void example_call_connection_manager_init (ExampleCallConnectionManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, ExampleCallConnectionManagerPrivate); } static void example_call_connection_manager_constructed (GObject *object) { ExampleCallConnectionManager *self = EXAMPLE_CALL_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) example_call_connection_manager_parent_class)->constructed; TpBaseProtocol *protocol; if (constructed != NULL) constructed (object); protocol = g_object_new (EXAMPLE_TYPE_CALL_PROTOCOL, "name", "example", NULL); tp_base_connection_manager_add_protocol (base, protocol); g_object_unref (protocol); } static void example_call_connection_manager_class_init ( ExampleCallConnectionManagerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; g_type_class_add_private (klass, sizeof (ExampleCallConnectionManagerPrivate)); object_class->constructed = example_call_connection_manager_constructed; base_class->cm_dbus_name = "example_call"; } telepathy-glib-0.24.2/examples/cm/call/cm.h0000644000175000017500000000525012652510705015337 00000000000000/* * manager.h - header for an example connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_CALL_CM_H #define EXAMPLE_CALL_CM_H #include #include G_BEGIN_DECLS typedef struct _ExampleCallConnectionManager ExampleCallConnectionManager; typedef struct _ExampleCallConnectionManagerPrivate ExampleCallConnectionManagerPrivate; typedef struct _ExampleCallConnectionManagerClass ExampleCallConnectionManagerClass; typedef struct _ExampleCallConnectionManagerClassPrivate ExampleCallConnectionManagerClassPrivate; struct _ExampleCallConnectionManagerClass { TpBaseConnectionManagerClass parent_class; ExampleCallConnectionManagerClassPrivate *priv; }; struct _ExampleCallConnectionManager { TpBaseConnectionManager parent; ExampleCallConnectionManagerPrivate *priv; }; GType example_call_connection_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_CALL_CONNECTION_MANAGER \ (example_call_connection_manager_get_type ()) #define EXAMPLE_CALL_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, \ ExampleCallConnectionManager)) #define EXAMPLE_CALL_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, \ ExampleCallConnectionManagerClass)) #define EXAMPLE_IS_CALL_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CALL_CONNECTION_MANAGER)) #define EXAMPLE_IS_CALL_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CALL_CONNECTION_MANAGER)) #define EXAMPLE_CALL_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, \ ExampleCallConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/call-channel.c0000644000175000017500000006241212652510705017257 00000000000000/* * call-channel.c - an example 1-1 audio/video call * * For simplicity, this channel emulates a device with its own * audio/video user interface, like a video-equipped form of the phones * manipulated by telepathy-snom or gnome-phone-manager. * * As a result, this channel has the HardwareStreaming flag, its contents * and streams do not have the Media interface, and clients should not attempt * to do their own streaming using telepathy-farsight, telepathy-stream-engine * or maemo-stream-engine. * * In practice, nearly all connection managers do not have HardwareStreaming, * and do have the Media interface on their contents/streams. Usage for those * CMs is the same, except that whichever client is the primary handler * for the channel should also hand the channel over to telepathy-farsight or * telepathy-stream-engine to implement the actual streaming. * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "call-channel.h" #include #include #include #include #include "call-content.h" #include "call-stream.h" static void hold_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (ExampleCallChannel, example_call_channel, TP_TYPE_BASE_MEDIA_CALL_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_HOLD, hold_iface_init)) enum { PROP_SIMULATION_DELAY = 1, N_PROPS }; struct _ExampleCallChannelPrivate { guint simulation_delay; TpBaseConnection *conn; TpHandle handle; gboolean locally_requested; guint hold_state; guint hold_state_reason; guint next_stream_id; gboolean closed; }; static GPtrArray * example_call_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS ( example_call_channel_parent_class)->get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_HOLD); return interfaces; } /* In practice you need one for audio, plus one per video (e.g. a * presentation might have separate video contents for the slides * and a camera pointed at the presenter), so having more than three * would be highly unusual */ #define MAX_CONTENTS_PER_CALL 100 G_GNUC_NULL_TERMINATED static void example_call_channel_set_state (ExampleCallChannel *self, TpCallState state, TpCallFlags flags, TpHandle actor, TpCallStateChangeReason reason, const gchar *error, ...) { /* FIXME: TpBaseCallChannel is not that flexible */ tp_base_call_channel_set_state ((TpBaseCallChannel *) self, state, actor, reason, error, ""); } static void example_call_channel_init (ExampleCallChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_CHANNEL, ExampleCallChannelPrivate); self->priv->next_stream_id = 1; self->priv->hold_state = TP_LOCAL_HOLD_STATE_UNHELD; self->priv->hold_state_reason = TP_LOCAL_HOLD_STATE_REASON_NONE; } static ExampleCallContent *example_call_channel_add_content ( ExampleCallChannel *self, TpMediaStreamType media_type, gboolean locally_requested, gboolean initial, const gchar *requested_name, GError **error); static void example_call_channel_initiate_outgoing (ExampleCallChannel *self); static void constructed (GObject *object) { void (*chain_up) (GObject *) = ((GObjectClass *) example_call_channel_parent_class)->constructed; ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (object); TpBaseChannel *base = (TpBaseChannel *) self; TpBaseCallChannel *call = (TpBaseCallChannel *) self; if (chain_up != NULL) chain_up (object); self->priv->handle = tp_base_channel_get_target_handle (base); self->priv->locally_requested = tp_base_channel_is_requested (base); self->priv->conn = tp_base_channel_get_connection (base); tp_base_call_channel_update_member_flags (call, self->priv->handle, 0, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); if (self->priv->locally_requested) { /* Nobody is locally pending. The remote peer will turn up in * remote-pending state when we actually contact them, which is done * in example_call_channel_initiate_outgoing. */ example_call_channel_set_state (self, TP_CALL_STATE_PENDING_INITIATOR, 0, 0, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); } else { /* This is an incoming call, so the self-handle is locally * pending, to indicate that we need to answer. */ example_call_channel_set_state (self, TP_CALL_STATE_INITIALISED, 0, self->priv->handle, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); } /* FIXME: should respect initial names */ if (tp_base_call_channel_has_initial_audio (call, NULL)) { g_message ("Channel initially has an audio stream"); example_call_channel_add_content (self, TP_MEDIA_STREAM_TYPE_AUDIO, self->priv->locally_requested, TRUE, NULL, NULL); } if (tp_base_call_channel_has_initial_video (call, NULL)) { g_message ("Channel initially has a video stream"); example_call_channel_add_content (self, TP_MEDIA_STREAM_TYPE_VIDEO, self->priv->locally_requested, TRUE, NULL, NULL); } tp_base_channel_register (base); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (object); switch (property_id) { case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (object); switch (property_id) { case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void example_call_channel_terminate (ExampleCallChannel *self, TpHandle actor, TpChannelGroupChangeReason reason, TpCallStateChangeReason call_reason, const gchar *error_name) { TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); if (call_state != TP_CALL_STATE_ENDED) { GList *contents; example_call_channel_set_state (self, TP_CALL_STATE_ENDED, 0, actor, call_reason, error_name, NULL); /* FIXME: fd.o #24936 #c20: it's unclear in the spec whether we should * remove peers on call termination or not. For now this example does. */ tp_base_call_channel_remove_member (base, self->priv->handle, actor, call_reason, error_name, NULL); if (actor == tp_base_connection_get_self_handle (self->priv->conn)) { const gchar *send_reason; /* In a real protocol these would be some sort of real protocol * construct, like an XMPP error stanza or a SIP error code */ switch (reason) { case TP_CHANNEL_GROUP_CHANGE_REASON_BUSY: send_reason = ""; break; case TP_CHANNEL_GROUP_CHANGE_REASON_NO_ANSWER: send_reason = ""; break; default: send_reason = ""; } g_message ("SIGNALLING: send: Terminating call: %s", send_reason); } /* terminate all streams: to avoid modifying the hash table (in the * streams-removed handler) while iterating over it, we have to copy the * keys and iterate over those */ contents = tp_base_call_channel_get_contents (base); contents = g_list_copy (contents); for (; contents != NULL; contents = g_list_delete_link (contents, contents)) { example_call_content_remove_stream (contents->data); tp_base_call_channel_remove_content (base, contents->data, 0, call_reason, error_name, ""); } } } static void dispose (GObject *object) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (object); /* the manager is meant to hold a ref to us until we've closed */ g_assert (self->priv->closed); ((GObjectClass *) example_call_channel_parent_class)->dispose (object); } static void close_channel (TpBaseChannel *base) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (base); example_call_channel_terminate (self, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); self->priv->closed = TRUE; tp_base_channel_destroyed (base); } static void call_accept (TpBaseCallChannel *self); static TpBaseCallContent * call_add_content (TpBaseCallChannel *self, const gchar *name, TpMediaStreamType media, TpMediaStreamDirection initial_direction, GError **error); static void call_hangup (TpBaseCallChannel *self, guint reason, const gchar *detailed_reason, const gchar *message); static void example_call_channel_class_init (ExampleCallChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); TpBaseCallChannelClass *call_class = (TpBaseCallChannelClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (ExampleCallChannelPrivate)); call_class->accept = call_accept; call_class->add_content = call_add_content; call_class->hangup = call_hangup; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->get_interfaces = example_call_channel_get_interfaces; base_class->close = close_channel; object_class->constructed = constructed; object_class->set_property = set_property; object_class->get_property = get_property; object_class->dispose = dispose; param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); } static gboolean simulate_contact_ended_cb (gpointer p) { ExampleCallChannel *self = p; TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); /* if the call has been cancelled while we were waiting for the * contact to do so, do nothing! */ if (call_state == TP_CALL_STATE_ENDED) return FALSE; g_message ("SIGNALLING: receive: call terminated: "); example_call_channel_terminate (self, self->priv->handle, TP_CHANNEL_GROUP_CHANGE_REASON_NONE, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, ""); return FALSE; } static gboolean simulate_contact_answered_cb (gpointer p) { ExampleCallChannel *self = p; TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); GList *contents; TpHandleRepoIface *contact_repo; const gchar *peer; /* if the call has been cancelled while we were waiting for the * contact to answer, do nothing! */ if (call_state == TP_CALL_STATE_ENDED) return FALSE; /* otherwise, we're waiting for a response from the contact, which now * arrives */ g_assert_cmpuint (call_state, ==, TP_CALL_STATE_INITIALISED); g_message ("SIGNALLING: receive: contact answered our call"); tp_base_call_channel_remote_accept (base); contents = tp_base_call_channel_get_contents (base); for (; contents != NULL; contents = contents->next) { ExampleCallStream *stream = example_call_content_get_stream (contents->data); if (stream == NULL) continue; /* remote contact accepts our proposed stream direction */ example_call_stream_simulate_contact_agreed_to_send (stream); } contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); peer = tp_handle_inspect (contact_repo, self->priv->handle); /* If the contact's ID contains the magic string "(terminate)", simulate * them hanging up after a moment. */ if (strstr (peer, "(terminate)") != NULL) { g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_contact_ended_cb, g_object_ref (self), g_object_unref); } return FALSE; } static gboolean simulate_contact_busy_cb (gpointer p) { ExampleCallChannel *self = p; TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); /* if the call has been cancelled while we were waiting for the * contact to answer, do nothing */ if (call_state == TP_CALL_STATE_ENDED) return FALSE; /* otherwise, we're waiting for a response from the contact, which now * arrives */ g_assert_cmpuint (call_state, ==, TP_CALL_STATE_INITIALISED); g_message ("SIGNALLING: receive: call terminated: "); example_call_channel_terminate (self, self->priv->handle, TP_CHANNEL_GROUP_CHANGE_REASON_BUSY, TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, TP_ERROR_STR_BUSY); return FALSE; } static ExampleCallContent * example_call_channel_add_content (ExampleCallChannel *self, TpMediaStreamType media_type, gboolean locally_requested, gboolean initial, const gchar *requested_name, GError **error) { TpBaseCallChannel *base = (TpBaseCallChannel *) self; GList *contents; const gchar *type_str; TpHandle creator = self->priv->handle; TpCallContentDisposition disposition = TP_CALL_CONTENT_DISPOSITION_NONE; guint id = self->priv->next_stream_id++; ExampleCallContent *content; ExampleCallStream *stream; gchar *name; gchar *path; guint i; /* an arbitrary limit much less than 2**32 means we don't use ridiculous * amounts of memory, and also means @i can't wrap around when we use it to * uniquify content names. */ contents = tp_base_call_channel_get_contents (base); if (g_list_length (contents) > MAX_CONTENTS_PER_CALL) { g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "What are you doing with all those contents anyway?!"); return NULL; } type_str = (media_type == TP_MEDIA_STREAM_TYPE_AUDIO ? "audio" : "video"); if (tp_str_empty (requested_name)) { requested_name = type_str; } for (i = 0; ; i++) { GList *l; if (i == 0) name = g_strdup (requested_name); else name = g_strdup_printf ("%s (%u)", requested_name, i); for (l = contents; l != NULL; l = l->next) { if (!tp_strdiff (tp_base_call_content_get_name (l->data), name)) break; } if (l == NULL) { /* this name hasn't been used - good enough */ break; } g_free (name); name = NULL; } if (initial) disposition = TP_CALL_CONTENT_DISPOSITION_INITIAL; if (locally_requested) { g_message ("SIGNALLING: send: new %s stream %s", type_str, name); creator = tp_base_connection_get_self_handle (self->priv->conn); } path = g_strdup_printf ("%s/Content%u", tp_base_channel_get_object_path ((TpBaseChannel *) self), id); content = g_object_new (EXAMPLE_TYPE_CALL_CONTENT, "connection", self->priv->conn, "creator", creator, "media-type", media_type, "name", name, "disposition", disposition, "object-path", path, NULL); tp_base_call_channel_add_content (base, (TpBaseCallContent *) content); g_free (path); path = g_strdup_printf ("%s/Stream%u", tp_base_channel_get_object_path ((TpBaseChannel *) self), id); stream = g_object_new (EXAMPLE_TYPE_CALL_STREAM, "connection", self->priv->conn, "handle", self->priv->handle, "locally-requested", locally_requested, "object-path", path, NULL); example_call_content_add_stream (content, stream); g_free (path); g_object_unref (content); g_object_unref (stream); return content; } static gboolean simulate_contact_ringing_cb (gpointer p) { ExampleCallChannel *self = p; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); const gchar *peer; tp_base_call_channel_update_member_flags ((TpBaseCallChannel *) self, self->priv->handle, TP_CALL_MEMBER_FLAG_RINGING, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); /* In this example there is no real contact, so just simulate them * answering after a short time - unless the contact's name * contains "(no answer)" or "(busy)" */ peer = tp_handle_inspect (contact_repo, self->priv->handle); if (strstr (peer, "(busy)") != NULL) { g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_contact_busy_cb, g_object_ref (self), g_object_unref); } else if (strstr (peer, "(no answer)") != NULL) { /* do nothing - the call just rings forever */ } else { g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_contact_answered_cb, g_object_ref (self), g_object_unref); } return FALSE; } static void example_call_channel_initiate_outgoing (ExampleCallChannel *self) { g_message ("SIGNALLING: send: new streamed media call"); example_call_channel_set_state (self, TP_CALL_STATE_INITIALISED, 0, tp_base_connection_get_self_handle (self->priv->conn), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); /* After a moment, we're sent an informational message saying it's ringing */ g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_contact_ringing_cb, g_object_ref (self), g_object_unref); } static void accept_incoming_call (ExampleCallChannel *self) { TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); GList *contents; g_message ("SIGNALLING: send: Accepting incoming call from %s", tp_handle_inspect (contact_repo, self->priv->handle)); example_call_channel_set_state (self, TP_CALL_STATE_ACCEPTED, 0, tp_base_connection_get_self_handle (self->priv->conn), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); contents = tp_base_call_channel_get_contents (base); for (; contents != NULL; contents = contents->next) { ExampleCallStream *stream = example_call_content_get_stream (contents->data); guint disposition = tp_base_call_content_get_disposition (contents->data); if (stream == NULL || disposition != TP_CALL_CONTENT_DISPOSITION_INITIAL) continue; /* we accept the proposed stream direction */ example_call_stream_accept_proposed_direction (stream); } } static void call_accept (TpBaseCallChannel *base) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (base); if (self->priv->locally_requested) { /* Take the contents we've already added, and make them happen */ example_call_channel_initiate_outgoing (self); } else { accept_incoming_call (self); } } static void call_hangup (TpBaseCallChannel *base, guint reason, const gchar *detailed_reason, const gchar *message G_GNUC_UNUSED) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (base); example_call_channel_terminate (self, tp_base_connection_get_self_handle (self->priv->conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE, reason, detailed_reason); } static TpBaseCallContent * call_add_content (TpBaseCallChannel *base, const gchar *content_name, guint content_type, TpMediaStreamDirection initial_direction, GError **error) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (base); return (TpBaseCallContent *) example_call_channel_add_content (self, content_type, TRUE, FALSE, content_name, error); } static gboolean simulate_hold (gpointer p) { ExampleCallChannel *self = p; TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); TpCallFlags call_flags = 0; /* FIXME */ self->priv->hold_state = TP_LOCAL_HOLD_STATE_HELD; g_message ("SIGNALLING: hold state changed to held"); tp_svc_channel_interface_hold_emit_hold_state_changed (self, self->priv->hold_state, self->priv->hold_state_reason); example_call_channel_set_state (self, call_state, call_flags | TP_CALL_FLAG_LOCALLY_HELD, tp_base_connection_get_self_handle (self->priv->conn), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); return FALSE; } static gboolean simulate_unhold (gpointer p) { ExampleCallChannel *self = p; TpBaseCallChannel *base = (TpBaseCallChannel *) self; TpCallState call_state = tp_base_call_channel_get_state (base); TpCallFlags call_flags = 0; /* FIXME */ self->priv->hold_state = TP_LOCAL_HOLD_STATE_UNHELD; g_message ("SIGNALLING: hold state changed to unheld"); tp_svc_channel_interface_hold_emit_hold_state_changed (self, self->priv->hold_state, self->priv->hold_state_reason); example_call_channel_set_state (self, call_state, call_flags & ~TP_CALL_FLAG_LOCALLY_HELD, tp_base_connection_get_self_handle (self->priv->conn), TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", NULL); return FALSE; } static gboolean simulate_inability_to_unhold (gpointer p) { ExampleCallChannel *self = p; self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_HOLD; g_message ("SIGNALLING: unable to unhold - hold state changed to " "pending hold"); tp_svc_channel_interface_hold_emit_hold_state_changed (self, self->priv->hold_state, self->priv->hold_state_reason); /* hold again */ g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_hold, g_object_ref (self), g_object_unref); return FALSE; } static void hold_get_hold_state (TpSvcChannelInterfaceHold *iface, DBusGMethodInvocation *context) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (iface); tp_svc_channel_interface_hold_return_from_get_hold_state (context, self->priv->hold_state, self->priv->hold_state_reason); } static void hold_request_hold (TpSvcChannelInterfaceHold *iface, gboolean hold, DBusGMethodInvocation *context) { ExampleCallChannel *self = EXAMPLE_CALL_CHANNEL (iface); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; const gchar *peer; GSourceFunc callback; if ((hold && self->priv->hold_state == TP_LOCAL_HOLD_STATE_HELD) || (!hold && self->priv->hold_state == TP_LOCAL_HOLD_STATE_UNHELD)) { tp_svc_channel_interface_hold_return_from_request_hold (context); return; } peer = tp_handle_inspect (contact_repo, self->priv->handle); if (!hold && strstr (peer, "(no unhold)") != NULL) { g_set_error (&error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "unable to unhold"); goto error; } self->priv->hold_state_reason = TP_LOCAL_HOLD_STATE_REASON_REQUESTED; if (hold) { self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_HOLD; callback = simulate_hold; } else { self->priv->hold_state = TP_LOCAL_HOLD_STATE_PENDING_UNHOLD; peer = tp_handle_inspect (contact_repo, self->priv->handle); if (strstr (peer, "(inability to unhold)") != NULL) { callback = simulate_inability_to_unhold; } else { callback = simulate_unhold; } } g_message ("SIGNALLING: hold state changed to pending %s", (hold ? "hold" : "unhold")); tp_svc_channel_interface_hold_emit_hold_state_changed (iface, self->priv->hold_state, self->priv->hold_state_reason); /* No need to change the call flags - we never change the actual hold state * here, only the pending hold state */ g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, callback, g_object_ref (self), g_object_unref); tp_svc_channel_interface_hold_return_from_request_hold (context); return; error: dbus_g_method_return_error (context, error); g_error_free (error); } void hold_iface_init (gpointer iface, gpointer data) { TpSvcChannelInterfaceHoldClass *klass = iface; #define IMPLEMENT(x) \ tp_svc_channel_interface_hold_implement_##x (klass, hold_##x) IMPLEMENT (get_hold_state); IMPLEMENT (request_hold); #undef IMPLEMENT } telepathy-glib-0.24.2/examples/cm/call/call-channel.h0000644000175000017500000000436712652510705017271 00000000000000/* * call-channel.h - header for an example channel * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_CALL_CHANNEL_H #define EXAMPLE_CALL_CHANNEL_H #include #include G_BEGIN_DECLS typedef struct _ExampleCallChannel ExampleCallChannel; typedef struct _ExampleCallChannelPrivate ExampleCallChannelPrivate; typedef struct _ExampleCallChannelClass ExampleCallChannelClass; GType example_call_channel_get_type (void); #define EXAMPLE_TYPE_CALL_CHANNEL \ (example_call_channel_get_type ()) #define EXAMPLE_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_TYPE_CALL_CHANNEL, \ ExampleCallChannel)) #define EXAMPLE_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), EXAMPLE_TYPE_CALL_CHANNEL, \ ExampleCallChannelClass)) #define EXAMPLE_IS_CALL_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXAMPLE_TYPE_CALL_CHANNEL)) #define EXAMPLE_IS_CALL_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EXAMPLE_TYPE_CALL_CHANNEL)) #define EXAMPLE_CALL_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_CHANNEL, \ ExampleCallChannelClass)) struct _ExampleCallChannelClass { TpBaseMediaCallChannelClass parent_class; }; struct _ExampleCallChannel { TpBaseMediaCallChannel parent; ExampleCallChannelPrivate *priv; }; G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/example_call.manager0000644000175000017500000000240212652510705020545 00000000000000[ConnectionManager] Interfaces= [Protocol example] Interfaces= ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts;org.freedesktop.Telepathy.Connection.Interface.Presence;org.freedesktop.Telepathy.Connection.Interface.SimplePresence; param-account=s required register param-simulation-delay=u default-simulation-delay=1000 RequestableChannelClasses=audio;video; VCardField=x-telepathy-example EnglishName=Example with Call channels Icon=face-smile [audio] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1 org.freedesktop.Telepathy.Channel.TargetHandleType u=1 org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio b=1 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo; [video] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1 org.freedesktop.Telepathy.Channel.TargetHandleType u=1 org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo b=1 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID;org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio; telepathy-glib-0.24.2/examples/cm/call/call-content.c0000644000175000017500000000547212652510705017324 00000000000000/* * call-content.c - a content in a call. * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "call-content.h" #include #include G_DEFINE_TYPE (ExampleCallContent, example_call_content, TP_TYPE_BASE_MEDIA_CALL_CONTENT) struct _ExampleCallContentPrivate { ExampleCallStream *stream; }; static void example_call_content_init (ExampleCallContent *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_CONTENT, ExampleCallContentPrivate); } static void dispose (GObject *object) { ExampleCallContent *self = EXAMPLE_CALL_CONTENT (object); g_clear_object (&self->priv->stream); ((GObjectClass *) example_call_content_parent_class)->dispose (object); } static void example_call_content_class_init (ExampleCallContentClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; g_type_class_add_private (klass, sizeof (ExampleCallContentPrivate)); object_class->dispose = dispose; } ExampleCallStream * example_call_content_get_stream (ExampleCallContent *self) { g_return_val_if_fail (EXAMPLE_IS_CALL_CONTENT (self), NULL); return self->priv->stream; } void example_call_content_add_stream (ExampleCallContent *self, ExampleCallStream *stream) { g_return_if_fail (EXAMPLE_IS_CALL_CONTENT (self)); g_return_if_fail (EXAMPLE_IS_CALL_STREAM (stream)); g_return_if_fail (self->priv->stream == NULL); self->priv->stream = g_object_ref (stream); tp_base_call_content_add_stream ((TpBaseCallContent *) self, (TpBaseCallStream *) stream); } void example_call_content_remove_stream (ExampleCallContent *self) { TpBaseCallStream *stream; g_return_if_fail (EXAMPLE_IS_CALL_CONTENT (self)); g_return_if_fail (self->priv->stream != NULL); stream = (TpBaseCallStream *) self->priv->stream; self->priv->stream = NULL; tp_base_call_content_remove_stream ((TpBaseCallContent *) self, stream, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); g_object_unref (stream); } telepathy-glib-0.24.2/examples/cm/call/call-content.h0000644000175000017500000000530412652510705017323 00000000000000/* * call-content.h - header for an example content * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_CALL_CONTENT_H #define EXAMPLE_CALL_CONTENT_H #include #include #include "call-stream.h" G_BEGIN_DECLS typedef struct _ExampleCallContent ExampleCallContent; typedef struct _ExampleCallContentPrivate ExampleCallContentPrivate; typedef struct _ExampleCallContentClass ExampleCallContentClass; typedef struct _ExampleCallContentClassPrivate ExampleCallContentClassPrivate; GType example_call_content_get_type (void); #define EXAMPLE_TYPE_CALL_CONTENT \ (example_call_content_get_type ()) #define EXAMPLE_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_TYPE_CALL_CONTENT, \ ExampleCallContent)) #define EXAMPLE_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), EXAMPLE_TYPE_CALL_CONTENT, \ ExampleCallContentClass)) #define EXAMPLE_IS_CALL_CONTENT(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXAMPLE_TYPE_CALL_CONTENT)) #define EXAMPLE_IS_CALL_CONTENT_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EXAMPLE_TYPE_CALL_CONTENT)) #define EXAMPLE_CALL_CONTENT_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_CONTENT, \ ExampleCallContentClass)) struct _ExampleCallContentClass { TpBaseMediaCallContentClass parent_class; ExampleCallContentClassPrivate *priv; }; struct _ExampleCallContent { TpBaseMediaCallContent parent; ExampleCallContentPrivate *priv; }; /* In this example, each content can only have one stream. */ ExampleCallStream *example_call_content_get_stream (ExampleCallContent *self); void example_call_content_add_stream (ExampleCallContent *self, ExampleCallStream *stream); void example_call_content_remove_stream (ExampleCallContent *self); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/protocol.c0000644000175000017500000001117412652510705016576 00000000000000/* * protocol.c - an example Protocol * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "protocol.h" #include #include "call-manager.h" #include "conn.h" G_DEFINE_TYPE (ExampleCallProtocol, example_call_protocol, TP_TYPE_BASE_PROTOCOL) static void example_call_protocol_init ( ExampleCallProtocol *self) { } gboolean example_call_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error) { g_return_val_if_fail (id != NULL, FALSE); if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return FALSE; } if (normal != NULL) *normal = g_utf8_normalize (id, -1, G_NORMALIZE_ALL_COMPOSE); return TRUE; } static gboolean account_param_filter (const TpCMParamSpec *paramspec, GValue *value, GError **error) { const gchar *id = g_value_get_string (value); return example_call_protocol_check_contact_id (id, NULL, error); } static const TpCMParamSpec example_call_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* no default */ 0, /* unused, formerly struct offset */ account_param_filter, NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { "simulation-delay", "u", G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GUINT_TO_POINTER (1000), /* default */ 0, /* unused, formerly struct offset */ NULL, /* no filter */ NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { NULL } }; static const TpCMParamSpec * get_parameters (TpBaseProtocol *self) { return example_call_example_params; } static TpBaseConnection * new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { ExampleCallConnection *conn; const gchar *account; guint sim_delay; account = tp_asv_get_string (asv, "account"); /* telepathy-glib checked this for us */ g_assert (account != NULL); sim_delay = tp_asv_get_uint32 (asv, "simulation-delay", NULL); conn = EXAMPLE_CALL_CONNECTION ( g_object_new (EXAMPLE_TYPE_CALL_CONNECTION, "account", account, "protocol", tp_base_protocol_get_name (protocol), "simulation-delay", sim_delay, NULL)); return (TpBaseConnection *) conn; } static gchar * normalize_contact (TpBaseProtocol *self G_GNUC_UNUSED, const gchar *contact, GError **error) { gchar *normal; if (example_call_protocol_check_contact_id (contact, &normal, error)) return normal; else return NULL; } static gchar * identify_account (TpBaseProtocol *self G_GNUC_UNUSED, GHashTable *asv, GError **error) { const gchar *account = tp_asv_get_string (asv, "account"); if (account != NULL) return normalize_contact (self, account, error); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'account' parameter not given"); return NULL; } static void get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED, GStrv *connection_interfaces, GType **channel_managers, gchar **icon_name, gchar **english_name, gchar **vcard_field) { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv ( (GStrv) example_call_connection_get_possible_interfaces ()); } if (channel_managers != NULL) { GType types[] = { EXAMPLE_TYPE_CALL_MANAGER, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof (types)); } if (icon_name != NULL) *icon_name = g_strdup ("face-smile"); if (english_name != NULL) *english_name = g_strdup ("Example with Call channels"); if (vcard_field != NULL) *vcard_field = g_strdup ("x-telepathy-example"); } static void example_call_protocol_class_init ( ExampleCallProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) klass; base_class->get_parameters = get_parameters; base_class->new_connection = new_connection; base_class->normalize_contact = normalize_contact; base_class->identify_account = identify_account; base_class->get_connection_details = get_connection_details; } telepathy-glib-0.24.2/examples/cm/call/protocol.h0000644000175000017500000000354612652510705016607 00000000000000/* * protocol.h - header for an example Protocol * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_CALL_PROTOCOL_H #define EXAMPLE_CALL_PROTOCOL_H #include #include G_BEGIN_DECLS typedef struct _ExampleCallProtocol ExampleCallProtocol; typedef struct _ExampleCallProtocolPrivate ExampleCallProtocolPrivate; typedef struct _ExampleCallProtocolClass ExampleCallProtocolClass; typedef struct _ExampleCallProtocolClassPrivate ExampleCallProtocolClassPrivate; struct _ExampleCallProtocolClass { TpBaseProtocolClass parent_class; ExampleCallProtocolClassPrivate *priv; }; struct _ExampleCallProtocol { TpBaseProtocol parent; ExampleCallProtocolPrivate *priv; }; GType example_call_protocol_get_type (void); #define EXAMPLE_TYPE_CALL_PROTOCOL \ (example_call_protocol_get_type ()) #define EXAMPLE_CALL_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_CALL_PROTOCOL, \ ExampleCallProtocol)) #define EXAMPLE_CALL_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_CALL_PROTOCOL, \ ExampleCallProtocolClass)) #define EXAMPLE_IS_CALL_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_CALL_PROTOCOL)) #define EXAMPLE_IS_CALL_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_CALL_PROTOCOL)) #define EXAMPLE_CALL_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_CALL_PROTOCOL, \ ExampleCallProtocolClass)) gboolean example_call_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/call-manager.c0000644000175000017500000003566112652510705017267 00000000000000/* * call-manager.c - an example channel manager for Call channels. * * This channel manager emulates a protocol like XMPP Jingle, where you can * make several simultaneous calls to the same or different contacts. * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "call-manager.h" #include #include #include "call-channel.h" static void channel_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (ExampleCallManager, example_call_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init)) /* type definition stuff */ enum { PROP_CONNECTION = 1, PROP_SIMULATION_DELAY, N_PROPS }; struct _ExampleCallManagerPrivate { TpBaseConnection *conn; guint simulation_delay; /* Map from reffed ExampleCallChannel to the same pointer; used as a * set. */ GHashTable *channels; /* Next channel will be ("CallChannel%u", next_channel_index) */ guint next_channel_index; gulong status_changed_id; gulong available_id; }; static void example_call_manager_init (ExampleCallManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_MANAGER, ExampleCallManagerPrivate); self->priv->conn = NULL; self->priv->channels = g_hash_table_new_full (NULL, NULL, g_object_unref, NULL); self->priv->status_changed_id = 0; self->priv->available_id = 0; } static void example_call_manager_close_all (ExampleCallManager *self) { if (self->priv->channels != NULL) { GHashTable *tmp = self->priv->channels; GHashTableIter iter; gpointer v; self->priv->channels = NULL; g_hash_table_iter_init (&iter, tmp); while (g_hash_table_iter_next (&iter, NULL, &v)) tp_base_channel_close (v); g_hash_table_unref (tmp); } if (self->priv->available_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->available_id); self->priv->available_id = 0; } if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } } static void dispose (GObject *object) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (object); example_call_manager_close_all (self); g_assert (self->priv->channels == NULL); ((GObjectClass *) example_call_manager_parent_class)->dispose ( object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (object); switch (property_id) { case PROP_CONNECTION: /* We don't ref the connection, because it owns a reference to the * channel manager, and it guarantees that the manager's lifetime is * less than its lifetime */ self->priv->conn = g_value_get_object (value); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, ExampleCallManager *self) { switch (status) { case TP_CONNECTION_STATUS_DISCONNECTED: { example_call_manager_close_all (self); } break; default: break; } } static ExampleCallChannel *new_channel (ExampleCallManager *self, TpHandle handle, TpHandle initiator, gpointer request_token, gboolean initial_audio, gboolean initial_video); static gboolean simulate_incoming_call_cb (gpointer p) { ExampleCallManager *self = p; TpHandleRepoIface *contact_repo; TpHandle caller; /* do nothing if we've been disconnected while waiting for the contact to * call us */ if (self->priv->available_id == 0) return FALSE; /* We're called by someone whose ID on the IM service is "caller" */ contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); caller = tp_handle_ensure (contact_repo, "caller", NULL, NULL); new_channel (self, caller, caller, NULL, TRUE, FALSE); return FALSE; } /* Whenever our presence changes from away to available, and whenever our * presence message changes while remaining available, simulate a call from * a contact */ static void available_cb (GObject *conn G_GNUC_UNUSED, const gchar *message, ExampleCallManager *self) { g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay, simulate_incoming_call_cb, g_object_ref (self), g_object_unref); } static void constructed (GObject *object) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_manager_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); self->priv->available_id = g_signal_connect (self->priv->conn, "available", (GCallback) available_cb, self); } static void example_call_manager_class_init (ExampleCallManagerClass *klass) { GParamSpec *param_spec; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; param_spec = g_param_spec_object ("connection", "Connection object", "The connection that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); g_type_class_add_private (klass, sizeof (ExampleCallManagerPrivate)); } static void example_call_manager_foreach_channel (TpChannelManager *iface, TpExportableChannelFunc callback, gpointer user_data) { ExampleCallManager *self = EXAMPLE_CALL_MANAGER (iface); GHashTableIter iter; gpointer chan; g_hash_table_iter_init (&iter, self->priv->channels); while (g_hash_table_iter_next (&iter, &chan, NULL)) callback (chan, user_data); } static void channel_closed_cb (ExampleCallChannel *chan, ExampleCallManager *self) { tp_channel_manager_emit_channel_closed_for_object (self, TP_EXPORTABLE_CHANNEL (chan)); if (self->priv->channels != NULL) g_hash_table_remove (self->priv->channels, chan); } static ExampleCallChannel * new_channel (ExampleCallManager *self, TpHandle handle, TpHandle initiator, gpointer request_token, gboolean initial_audio, gboolean initial_video) { ExampleCallChannel *chan; gchar *object_path; GSList *requests = NULL; /* FIXME: This could potentially wrap around, but only after 4 billion * calls, which is probably plenty. */ object_path = g_strdup_printf ("%s/CallChannel%u", tp_base_connection_get_object_path (self->priv->conn), self->priv->next_channel_index++); chan = g_object_new (EXAMPLE_TYPE_CALL_CHANNEL, "connection", self->priv->conn, "object-path", object_path, "handle", handle, "initiator-handle", initiator, "requested", (tp_base_connection_get_self_handle (self->priv->conn) == initiator), "simulation-delay", self->priv->simulation_delay, "initial-audio", initial_audio, "initial-video", initial_video, "mutable-contents", TRUE, NULL); g_free (object_path); g_signal_connect (chan, "closed", G_CALLBACK (channel_closed_cb), self); g_hash_table_insert (self->priv->channels, chan, chan); if (request_token != NULL) requests = g_slist_prepend (requests, request_token); tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), requests); g_slist_free (requests); return chan; } static const gchar * const audio_fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL }; static const gchar * const video_fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL }; static const gchar * const audio_allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL }; static const gchar * const video_allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL }; static void example_call_manager_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data) { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, NULL); func (type, table, audio_allowed_properties, user_data); g_hash_table_remove (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO); tp_asv_set_boolean (table, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, TRUE); func (type, table, video_allowed_properties, user_data); g_hash_table_unref (table); } static gboolean example_call_manager_request (ExampleCallManager *self, gpointer request_token, GHashTable *request_properties, gboolean require_new) { TpHandle handle; GError *error = NULL; gboolean initial_audio, initial_video; if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_CALL)) { return FALSE; } if (tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) != TP_HANDLE_TYPE_CONTACT) { return FALSE; } handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); g_assert (handle != 0); initial_audio = tp_asv_get_boolean (request_properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL); initial_video = tp_asv_get_boolean (request_properties, TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL); if (!initial_audio && !initial_video) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Call channels must initially have either audio or video content"); goto error; } /* the set of (fixed | allowed) properties is the same for audio and video, * so we only need to check with one set */ if (tp_channel_manager_asv_has_unknown_properties (request_properties, audio_fixed_properties, audio_allowed_properties, &error)) { goto error; } if (handle == tp_base_connection_get_self_handle (self->priv->conn)) { /* In protocols with a concept of multiple "resources" signed in to * one account (XMPP, and possibly MSN) it is technically possible to * call yourself - e.g. if you're signed in on two PCs, you can call one * from the other. For simplicity, this example simulates a protocol * where this is not the case. */ g_set_error (&error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "In this protocol, you can't call yourself"); goto error; } if (!require_new) { /* see if we're already calling that handle */ GHashTableIter iter; gpointer chan; g_hash_table_iter_init (&iter, self->priv->channels); while (g_hash_table_iter_next (&iter, &chan, NULL)) { guint its_handle; g_object_get (chan, "handle", &its_handle, NULL); if (its_handle == handle) { tp_channel_manager_emit_request_already_satisfied (self, request_token, TP_EXPORTABLE_CHANNEL (chan)); return TRUE; } } } new_channel (self, handle, tp_base_connection_get_self_handle (self->priv->conn), request_token, initial_audio, initial_video); return TRUE; error: tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); g_error_free (error); return TRUE; } static gboolean example_call_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_call_manager_request ( EXAMPLE_CALL_MANAGER (manager), request_token, request_properties, TRUE); } static gboolean example_call_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_call_manager_request ( EXAMPLE_CALL_MANAGER (manager), request_token, request_properties, FALSE); } static void channel_manager_iface_init (gpointer g_iface, gpointer iface_data G_GNUC_UNUSED) { TpChannelManagerIface *iface = g_iface; iface->foreach_channel = example_call_manager_foreach_channel; iface->type_foreach_channel_class = example_call_manager_type_foreach_channel_class; iface->create_channel = example_call_manager_create_channel; iface->ensure_channel = example_call_manager_ensure_channel; /* In this channel manager, RequestChannel is not supported; Call is not * designed to work with the old RequestChannel API. */ iface->request_channel = NULL; } telepathy-glib-0.24.2/examples/cm/call/call-manager.h0000644000175000017500000000450112652510705017261 00000000000000/* * media-manager.h - header for an example channel manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_CALL_MANAGER_H #define EXAMPLE_CALL_MANAGER_H #include G_BEGIN_DECLS typedef struct _ExampleCallManager ExampleCallManager; typedef struct _ExampleCallManagerPrivate ExampleCallManagerPrivate; typedef struct _ExampleCallManagerClass ExampleCallManagerClass; typedef struct _ExampleCallManagerClassPrivate ExampleCallManagerClassPrivate; struct _ExampleCallManagerClass { GObjectClass parent_class; ExampleCallManagerClassPrivate *priv; }; struct _ExampleCallManager { GObject parent; ExampleCallManagerPrivate *priv; }; GType example_call_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_CALL_MANAGER \ (example_call_manager_get_type ()) #define EXAMPLE_CALL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CALL_MANAGER, \ ExampleCallManager)) #define EXAMPLE_CALL_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CALL_MANAGER, \ ExampleCallManagerClass)) #define EXAMPLE_IS_CALL_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CALL_MANAGER)) #define EXAMPLE_IS_CALL_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CALL_MANAGER)) #define EXAMPLE_CALL_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_MANAGER, \ ExampleCallManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/conn.c0000644000175000017500000003124512652510705015673 00000000000000/* * conn.c - an example connection * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "conn.h" #include #include #include "call-manager.h" #include "protocol.h" G_DEFINE_TYPE_WITH_CODE (ExampleCallConnection, example_call_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, tp_presence_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE, tp_presence_mixin_simple_presence_iface_init)) enum { PROP_ACCOUNT = 1, PROP_SIMULATION_DELAY, N_PROPS }; enum { SIGNAL_AVAILABLE, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; struct _ExampleCallConnectionPrivate { gchar *account; guint simulation_delay; gboolean away; gchar *presence_message; }; static void example_call_connection_init (ExampleCallConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_CONNECTION, ExampleCallConnectionPrivate); self->priv->away = FALSE; self->priv->presence_message = g_strdup (""); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_value_dup_string (value); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (object); tp_contacts_mixin_finalize (object); g_free (self->priv->account); g_free (self->priv->presence_message); G_OBJECT_CLASS (example_call_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (conn); return g_strdup_printf ("%s@%p", self->priv->account, self); } static gchar * example_call_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { gchar *normal = NULL; if (example_call_protocol_check_contact_id (id, &normal, error)) return normal; else return NULL; } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_call_normalize_contact, NULL); } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (conn); GPtrArray *ret = g_ptr_array_sized_new (1); g_ptr_array_add (ret, g_object_new (EXAMPLE_TYPE_CALL_MANAGER, "connection", conn, "simulation-delay", self->priv->simulation_delay, NULL)); return ret; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, error); if (self_handle == 0) return FALSE; tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static void constructed (GObject *object) { TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (example_call_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (ExampleCallConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); tp_presence_mixin_init (object, G_STRUCT_OFFSET (ExampleCallConnection, presence_mixin)); tp_presence_mixin_simple_presence_register_with_contacts_mixin (object); } static gboolean status_available (GObject *object, guint index_) { TpBaseConnection *base = TP_BASE_CONNECTION (object); return tp_base_connection_check_connected (base, NULL); } static GHashTable * get_contact_statuses (GObject *object, const GArray *contacts, GError **error) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); guint i; GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) tp_presence_status_free); for (i = 0; i < contacts->len; i++) { TpHandle contact = g_array_index (contacts, guint, i); ExampleCallPresence presence; GHashTable *parameters; parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); /* we know our own status from the connection; for this example CM, * everyone else's status is assumed to be "available" */ if (contact == tp_base_connection_get_self_handle (base)) { presence = (self->priv->away ? EXAMPLE_CALL_PRESENCE_AWAY : EXAMPLE_CALL_PRESENCE_AVAILABLE); if (self->priv->presence_message[0] != '\0') g_hash_table_insert (parameters, "message", tp_g_value_slice_new_string (self->priv->presence_message)); } else { presence = EXAMPLE_CALL_PRESENCE_AVAILABLE; } g_hash_table_insert (result, GUINT_TO_POINTER (contact), tp_presence_status_new (presence, parameters)); g_hash_table_unref (parameters); } return result; } static gboolean set_own_status (GObject *object, const TpPresenceStatus *status, GError **error) { ExampleCallConnection *self = EXAMPLE_CALL_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); GHashTable *presences; const gchar *message = ""; if (status->optional_arguments != NULL) { GValue *v = g_hash_table_lookup (status->optional_arguments, "message"); if (v != NULL && G_VALUE_HOLDS_STRING (v)) { message = g_value_get_string (v); if (message == NULL) message = ""; } } if (status->index == EXAMPLE_CALL_PRESENCE_AWAY) { if (self->priv->away && !tp_strdiff (message, self->priv->presence_message)) return TRUE; self->priv->away = TRUE; } else { if (!self->priv->away && !tp_strdiff (message, self->priv->presence_message)) return TRUE; self->priv->away = FALSE; } g_free (self->priv->presence_message); self->priv->presence_message = g_strdup (message); presences = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); g_hash_table_insert (presences, GUINT_TO_POINTER (tp_base_connection_get_self_handle (base)), (gpointer) status); tp_presence_mixin_emit_presence_update (object, presences); g_hash_table_unref (presences); if (!self->priv->away) { g_signal_emit (self, signals[SIGNAL_AVAILABLE], 0, message); } return TRUE; } static const TpPresenceStatusOptionalArgumentSpec can_have_message[] = { { "message", "s", NULL, NULL }, { NULL } }; /* Must be kept in sync with ExampleCallPresence enum in header */ static const TpPresenceStatusSpec presence_statuses[] = { { "offline", TP_CONNECTION_PRESENCE_TYPE_OFFLINE, FALSE, NULL }, { "unknown", TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, FALSE, NULL }, { "error", TP_CONNECTION_PRESENCE_TYPE_ERROR, FALSE, NULL }, { "away", TP_CONNECTION_PRESENCE_TYPE_AWAY, TRUE, can_have_message }, { "available", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, TRUE, can_have_message }, { NULL } }; static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_CONTACTS, TP_IFACE_CONNECTION_INTERFACE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, NULL }; const gchar * const * example_call_connection_get_possible_interfaces (void) { /* in this example CM we don't have any extra interfaces that are sometimes, * but not always, present */ return interfaces_always_present; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( example_call_connection_parent_class)->get_interfaces_always_present (base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void example_call_connection_class_init ( ExampleCallConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->get_property = get_property; object_class->set_property = set_property; object_class->constructed = constructed; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (ExampleCallConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_managers = create_channel_managers; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); /* Used in the call manager, to simulate an incoming call when we become * available */ signals[SIGNAL_AVAILABLE] = g_signal_new ("available", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_STRING); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleCallConnectionClass, contacts_mixin)); tp_presence_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleCallConnectionClass, presence_mixin), status_available, get_contact_statuses, set_own_status, presence_statuses); tp_presence_mixin_simple_presence_init_dbus_properties (object_class); } telepathy-glib-0.24.2/examples/cm/call/conn.h0000644000175000017500000000460212652510705015675 00000000000000/* * conn.h - header for an example connection * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_CALL_CONN_H #define EXAMPLE_CALL_CONN_H #include #include G_BEGIN_DECLS typedef struct _ExampleCallConnection ExampleCallConnection; typedef struct _ExampleCallConnectionPrivate ExampleCallConnectionPrivate; typedef struct _ExampleCallConnectionClass ExampleCallConnectionClass; typedef struct _ExampleCallConnectionClassPrivate ExampleCallConnectionClassPrivate; struct _ExampleCallConnectionClass { TpBaseConnectionClass parent_class; TpPresenceMixinClass presence_mixin; TpContactsMixinClass contacts_mixin; ExampleCallConnectionClassPrivate *priv; }; struct _ExampleCallConnection { TpBaseConnection parent; TpPresenceMixin presence_mixin; TpContactsMixin contacts_mixin; ExampleCallConnectionPrivate *priv; }; GType example_call_connection_get_type (void); #define EXAMPLE_TYPE_CALL_CONNECTION \ (example_call_connection_get_type ()) #define EXAMPLE_CALL_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CALL_CONNECTION, \ ExampleCallConnection)) #define EXAMPLE_CALL_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CALL_CONNECTION, \ ExampleCallConnectionClass)) #define EXAMPLE_IS_CALL_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CALL_CONNECTION)) #define EXAMPLE_IS_CALL_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CALL_CONNECTION)) #define EXAMPLE_CALL_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_CONNECTION, \ ExampleCallConnectionClass)) /* Must be kept in sync with the array presence_statuses in conn.c */ typedef enum { EXAMPLE_CALL_PRESENCE_OFFLINE = 0, EXAMPLE_CALL_PRESENCE_UNKNOWN, EXAMPLE_CALL_PRESENCE_ERROR, EXAMPLE_CALL_PRESENCE_AWAY, EXAMPLE_CALL_PRESENCE_AVAILABLE } ExampleCallPresence; const gchar * const *example_call_connection_get_possible_interfaces (void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/Makefile.am0000644000175000017500000000340712652510705016625 00000000000000# Example connection manager with audio/video calls. EXAMPLES = telepathy-example-cm-call noinst_LTLIBRARIES = libexample-cm-call.la if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif libexample_cm_call_la_SOURCES = \ cm.c \ cm.h \ conn.c \ conn.h \ call-channel.c \ call-channel.h \ call-manager.c \ call-manager.h \ call-content.c \ call-content.h \ call-stream.c \ call-stream.h \ protocol.c \ protocol.h libexample_cm_call_la_LIBADD = $(LDADD) telepathy_example_cm_call_SOURCES = \ main.c telepathy_example_cm_call_LDADD = \ $(noinst_LTLIBRARIES) servicedir = ${datadir}/dbus-1/services if INSTALL_EXAMPLES service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_call.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_call" && \ echo "Exec=${libexecdir}/telepathy-example-cm-call"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_call.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) telepathy-glib-0.24.2/examples/cm/call/Makefile.in0000644000175000017500000007311614006601553016637 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Example connection manager with audio/video calls. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/call ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-cm-call$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libexample_cm_call_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libexample_cm_call_la_OBJECTS = cm.lo conn.lo call-channel.lo \ call-manager.lo call-content.lo call-stream.lo protocol.lo libexample_cm_call_la_OBJECTS = $(am_libexample_cm_call_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_telepathy_example_cm_call_OBJECTS = main.$(OBJEXT) telepathy_example_cm_call_OBJECTS = \ $(am_telepathy_example_cm_call_OBJECTS) telepathy_example_cm_call_DEPENDENCIES = $(noinst_LTLIBRARIES) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/call-channel.Plo \ ./$(DEPDIR)/call-content.Plo ./$(DEPDIR)/call-manager.Plo \ ./$(DEPDIR)/call-stream.Plo ./$(DEPDIR)/cm.Plo \ ./$(DEPDIR)/conn.Plo ./$(DEPDIR)/main.Po \ ./$(DEPDIR)/protocol.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libexample_cm_call_la_SOURCES) \ $(telepathy_example_cm_call_SOURCES) DIST_SOURCES = $(libexample_cm_call_la_SOURCES) \ $(telepathy_example_cm_call_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_call.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-cm-call noinst_LTLIBRARIES = libexample-cm-call.la libexample_cm_call_la_SOURCES = \ cm.c \ cm.h \ conn.c \ conn.h \ call-channel.c \ call-channel.h \ call-manager.c \ call-manager.h \ call-content.c \ call-content.h \ call-stream.c \ call-stream.h \ protocol.c \ protocol.h libexample_cm_call_la_LIBADD = $(LDADD) telepathy_example_cm_call_SOURCES = \ main.c telepathy_example_cm_call_LDADD = \ $(noinst_LTLIBRARIES) servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_call.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_call.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/call/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/call/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libexample-cm-call.la: $(libexample_cm_call_la_OBJECTS) $(libexample_cm_call_la_DEPENDENCIES) $(EXTRA_libexample_cm_call_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexample_cm_call_la_OBJECTS) $(libexample_cm_call_la_LIBADD) $(LIBS) telepathy-example-cm-call$(EXEEXT): $(telepathy_example_cm_call_OBJECTS) $(telepathy_example_cm_call_DEPENDENCIES) $(EXTRA_telepathy_example_cm_call_DEPENDENCIES) @rm -f telepathy-example-cm-call$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_cm_call_OBJECTS) $(telepathy_example_cm_call_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-channel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-content.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/call-stream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/call-channel.Plo -rm -f ./$(DEPDIR)/call-content.Plo -rm -f ./$(DEPDIR)/call-manager.Plo -rm -f ./$(DEPDIR)/call-stream.Plo -rm -f ./$(DEPDIR)/cm.Plo -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/call-channel.Plo -rm -f ./$(DEPDIR)/call-content.Plo -rm -f ./$(DEPDIR)/call-manager.Plo -rm -f ./$(DEPDIR)/call-stream.Plo -rm -f ./$(DEPDIR)/cm.Plo -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_managerDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libexecPROGRAMS install-man install-pdf install-pdf-am \ install-ps install-ps-am install-serviceDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_call" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-call"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/call/call-stream.c0000644000175000017500000003600512652510705017141 00000000000000/* * call-stream.c - a stream in a call. * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "call-stream.h" #include #include G_DEFINE_TYPE (ExampleCallStream, example_call_stream, TP_TYPE_BASE_MEDIA_CALL_STREAM) enum { PROP_SIMULATION_DELAY = 1, PROP_LOCALLY_REQUESTED, PROP_HANDLE, N_PROPS }; struct _ExampleCallStreamPrivate { guint simulation_delay; gboolean locally_requested; TpHandle handle; guint agreed_delay_id; }; static void example_call_stream_init (ExampleCallStream *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CALL_STREAM, ExampleCallStreamPrivate); } static void example_call_stream_receive_direction_request ( ExampleCallStream *self, gboolean local_send, gboolean remote_send); static void example_call_stream_change_direction (ExampleCallStream *self, gboolean want_to_send, gboolean want_to_receive); static void constructed (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_call_stream_parent_class)->constructed; static guint count = 0; TpBaseConnection *conn; TpDBusDaemon *dbus; gchar *object_path; TpCallStreamEndpoint *endpoint; if (chain_up != NULL) chain_up (object); conn = tp_base_call_stream_get_connection ((TpBaseCallStream *) self); dbus = tp_base_connection_get_dbus_daemon (conn); object_path = g_strdup_printf ("%s/Endpoint%d", tp_base_call_stream_get_object_path ((TpBaseCallStream *) self), count++); endpoint = tp_call_stream_endpoint_new (dbus, object_path, TP_STREAM_TRANSPORT_TYPE_RAW_UDP, FALSE); tp_base_media_call_stream_add_endpoint ((TpBaseMediaCallStream *) self, endpoint); if (self->priv->locally_requested) { example_call_stream_change_direction (self, TRUE, TRUE); } else { example_call_stream_receive_direction_request (self, TRUE, TRUE); } g_object_unref (endpoint); g_free (object_path); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); switch (property_id) { case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; case PROP_LOCALLY_REQUESTED: g_value_set_boolean (value, self->priv->locally_requested); break; case PROP_HANDLE: g_value_set_uint (value, self->priv->handle); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); switch (property_id) { case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; case PROP_LOCALLY_REQUESTED: self->priv->locally_requested = g_value_get_boolean (value); break; case PROP_HANDLE: self->priv->handle = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static gboolean stream_request_receiving (TpBaseCallStream *base, TpHandle contact, gboolean receive, GError **error); static gboolean stream_set_sending (TpBaseCallStream *base, gboolean sending, GError **error); static void finalize (GObject *object) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (object); if (self->priv->agreed_delay_id != 0) g_source_remove (self->priv->agreed_delay_id); G_OBJECT_CLASS (example_call_stream_parent_class)->finalize (object); } static void example_call_stream_class_init (ExampleCallStreamClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseCallStreamClass *stream_class = (TpBaseCallStreamClass *) klass; GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (ExampleCallStreamPrivate)); object_class->constructed = constructed; object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; stream_class->request_receiving = stream_request_receiving; stream_class->set_sending = stream_set_sending; param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); param_spec = g_param_spec_boolean ("locally-requested", "Locally requested?", "True if this channel was requested by the local user", FALSE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_LOCALLY_REQUESTED, param_spec); param_spec = g_param_spec_uint ("handle", "Peer's TpHandle", "The handle with which this stream communicates or 0 if not applicable", 0, G_MAXUINT32, 0, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_HANDLE, param_spec); } void example_call_stream_accept_proposed_direction (ExampleCallStream *self) { TpBaseCallStream *base = (TpBaseCallStream *) self; TpSendingState state = tp_base_call_stream_get_local_sending_state (base); if (state != TP_SENDING_STATE_PENDING_SEND) return; tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_SENDING, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } void example_call_stream_simulate_contact_agreed_to_send (ExampleCallStream *self) { TpBaseCallStream *base = (TpBaseCallStream *) self; TpSendingState state = tp_base_call_stream_get_remote_sending_state (base, self->priv->handle); if (state != TP_SENDING_STATE_PENDING_SEND) g_message ("%s: SIGNALLING: Sending to server: OK, I'll send you media", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_remote_sending_state ((TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_SENDING, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } static gboolean simulate_contact_agreed_to_send_cb (gpointer p) { example_call_stream_simulate_contact_agreed_to_send (p); return FALSE; } static void example_call_stream_change_direction (ExampleCallStream *self, gboolean want_to_send, gboolean want_to_receive) { TpBaseCallStream *base = (TpBaseCallStream *) self; TpSendingState local_sending_state = tp_base_call_stream_get_local_sending_state (base); TpSendingState remote_sending_state = tp_base_call_stream_get_remote_sending_state (base, self->priv->handle); if (want_to_send) { if (local_sending_state != TP_SENDING_STATE_SENDING) { if (local_sending_state == TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: send: I will now send you media", tp_base_call_stream_get_object_path (base)); } g_message ("%s: MEDIA: sending media to peer", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_SENDING, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } } else { if (local_sending_state == TP_SENDING_STATE_SENDING) { g_message ("%s: SIGNALLING: send: I will no longer send you media", tp_base_call_stream_get_object_path (base)); g_message ("%s: MEDIA: no longer sending media to peer", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } else if (local_sending_state == TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: send: refusing to send you media", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } } if (want_to_receive) { if (remote_sending_state == TP_SENDING_STATE_NONE) { g_message ("%s: SIGNALLING: send: send me media, please?", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_remote_sending_state ( (TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_PENDING_SEND, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); if (self->priv->agreed_delay_id == 0) { self->priv->agreed_delay_id = g_timeout_add ( self->priv->simulation_delay, simulate_contact_agreed_to_send_cb, self); } } } else { if (remote_sending_state != TP_SENDING_STATE_NONE) { g_message ("%s: SIGNALLING: send: Please stop sending me media", tp_base_call_stream_get_object_path (base)); g_message ("%s: MEDIA: suppressing output of stream", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_remote_sending_state ( (TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } } } /* The remote user wants to change the direction of this stream according * to @local_send and @remote_send. Shall we let him? */ static void example_call_stream_receive_direction_request (ExampleCallStream *self, gboolean local_send, gboolean remote_send) { TpBaseCallStream *base = (TpBaseCallStream *) self; TpSendingState local_sending_state = tp_base_call_stream_get_local_sending_state (base); TpSendingState remote_sending_state = tp_base_call_stream_get_remote_sending_state (base, self->priv->handle); /* In some protocols, streams cannot be neither sending nor receiving, so * if a stream is set to TP_MEDIA_STREAM_DIRECTION_NONE, this is equivalent * to removing it. (This is true in XMPP, for instance.) * * However, for this example we'll emulate a protocol where streams can be * directionless. */ if (local_send) { g_message ("%s: SIGNALLING: send: Please start sending me media", tp_base_call_stream_get_object_path (base)); if (local_sending_state == TP_SENDING_STATE_NONE) { /* ask the user for permission */ tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_PENDING_SEND, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } else { /* nothing to do, we're already sending (or asking the user for * permission to do so) on that stream */ } } else { g_message ("%s: SIGNALLING: receive: Please stop sending me media", tp_base_call_stream_get_object_path (base)); g_message ("%s: SIGNALLING: reply: OK!", tp_base_call_stream_get_object_path (base)); if (local_sending_state == TP_SENDING_STATE_SENDING) { g_message ("%s: MEDIA: no longer sending media to peer", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } else if (local_sending_state == TP_SENDING_STATE_PENDING_SEND) { tp_base_call_stream_update_local_sending_state (base, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } else { /* nothing to do, we're not sending on that stream anyway */ } } if (remote_send) { g_message ("%s: SIGNALLING: receive: I will now send you media", tp_base_call_stream_get_object_path (base)); if (remote_sending_state != TP_SENDING_STATE_SENDING) { tp_base_call_stream_update_remote_sending_state ( (TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_SENDING, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } } else { if (remote_sending_state == TP_SENDING_STATE_PENDING_SEND) { g_message ("%s: SIGNALLING: receive: No, I refuse to send you media", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_remote_sending_state ( (TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } else if (remote_sending_state == TP_SENDING_STATE_SENDING) { g_message ("%s: SIGNALLING: receive: I will no longer send media", tp_base_call_stream_get_object_path (base)); tp_base_call_stream_update_remote_sending_state ( (TpBaseCallStream *) self, self->priv->handle, TP_SENDING_STATE_NONE, 0, TP_CALL_STATE_CHANGE_REASON_UNKNOWN, "", ""); } } } static gboolean stream_set_sending (TpBaseCallStream *base, gboolean sending, GError **error) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (base); TpSendingState remote_sending_state = tp_base_call_stream_get_remote_sending_state (base, self->priv->handle); example_call_stream_change_direction (self, sending, (remote_sending_state == TP_SENDING_STATE_SENDING)); return TRUE; } static gboolean stream_request_receiving (TpBaseCallStream *base, TpHandle contact, gboolean receive, GError **error) { ExampleCallStream *self = EXAMPLE_CALL_STREAM (base); TpSendingState local_sending_state = tp_base_call_stream_get_local_sending_state (base); /* This is the only member */ g_assert (contact == self->priv->handle); example_call_stream_change_direction (self, (local_sending_state == TP_SENDING_STATE_SENDING), receive); return TRUE; } telepathy-glib-0.24.2/examples/cm/call/call-stream.h0000644000175000017500000000524512652510705017150 00000000000000/* * call-stream.h - header for an example stream * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef EXAMPLE_CALL_STREAM_H #define EXAMPLE_CALL_STREAM_H #include #include G_BEGIN_DECLS typedef struct _ExampleCallStream ExampleCallStream; typedef struct _ExampleCallStreamPrivate ExampleCallStreamPrivate; typedef struct _ExampleCallStreamClass ExampleCallStreamClass; typedef struct _ExampleCallStreamClassPrivate ExampleCallStreamClassPrivate; GType example_call_stream_get_type (void); #define EXAMPLE_TYPE_CALL_STREAM \ (example_call_stream_get_type ()) #define EXAMPLE_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_TYPE_CALL_STREAM, \ ExampleCallStream)) #define EXAMPLE_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), EXAMPLE_TYPE_CALL_STREAM, \ ExampleCallStreamClass)) #define EXAMPLE_IS_CALL_STREAM(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXAMPLE_TYPE_CALL_STREAM)) #define EXAMPLE_IS_CALL_STREAM_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EXAMPLE_TYPE_CALL_STREAM)) #define EXAMPLE_CALL_STREAM_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CALL_STREAM, \ ExampleCallStreamClass)) struct _ExampleCallStreamClass { TpBaseMediaCallStreamClass parent_class; ExampleCallStreamClassPrivate *priv; }; struct _ExampleCallStream { TpBaseMediaCallStream parent; ExampleCallStreamPrivate *priv; }; void example_call_stream_accept_proposed_direction (ExampleCallStream *self); void example_call_stream_connect (ExampleCallStream *self); /* This controls receiving emulated network events, so it wouldn't exist in * a real connection manager */ void example_call_stream_simulate_contact_agreed_to_send ( ExampleCallStream *self); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/call/main.c0000644000175000017500000000323412652510705015657 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" #include "config.h" #include #include "cm.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_CALL_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-cm-call", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/extended/0000755000175000017500000000000014006623343015530 500000000000000telepathy-glib-0.24.2/examples/cm/extended/example_extended.manager0000644000175000017500000000060612652510705022323 00000000000000[ConnectionManager] Interfaces= [Protocol example] Interfaces= ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts;com.example.Telepathy.Connection.Interface.Hats; param-account=s required register RequestableChannelClasses= VCardField=x-telepathy-example EnglishName=Extended (hats) example Icon=face-smile telepathy-glib-0.24.2/examples/cm/extended/protocol.c0000644000175000017500000001017612652510705017464 00000000000000/* * protocol.c - an example Protocol * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "protocol.h" #include #include "conn.h" G_DEFINE_TYPE (ExampleExtendedProtocol, example_extended_protocol, TP_TYPE_BASE_PROTOCOL) static void example_extended_protocol_init ( ExampleExtendedProtocol *self) { } static const TpCMParamSpec example_extended_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* no default */ 0, /* formerly struct offset, now unused */ tp_cm_param_filter_string_nonempty, /* filter - empty strings disallowed */ NULL, /* filter data, unused for our filter */ NULL /* setter data, now unused */ }, { NULL } }; static const TpCMParamSpec * get_parameters (TpBaseProtocol *self) { return example_extended_example_params; } static TpBaseConnection * new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { ExampleExtendedConnection *conn; const gchar *account; account = tp_asv_get_string (asv, "account"); if (account == NULL || account[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The 'account' parameter is required"); return NULL; } conn = EXAMPLE_EXTENDED_CONNECTION ( g_object_new (EXAMPLE_TYPE_EXTENDED_CONNECTION, "account", account, "protocol", tp_base_protocol_get_name (protocol), NULL)); return (TpBaseConnection *) conn; } gchar * example_extended_protocol_normalize_contact (const gchar *id, GError **error) { if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return NULL; } return g_utf8_strdown (id, -1); } static gchar * normalize_contact (TpBaseProtocol *self G_GNUC_UNUSED, const gchar *contact, GError **error) { return example_extended_protocol_normalize_contact (contact, error); } static gchar * identify_account (TpBaseProtocol *self G_GNUC_UNUSED, GHashTable *asv, GError **error) { const gchar *account = tp_asv_get_string (asv, "account"); if (account != NULL) return example_extended_protocol_normalize_contact (account, error); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'account' parameter not given"); return NULL; } static void get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED, GStrv *connection_interfaces, GType **channel_managers, gchar **icon_name, gchar **english_name, gchar **vcard_field) { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv ( (GStrv) example_extended_connection_get_possible_interfaces ()); } if (channel_managers != NULL) { /* we don't have any channel managers */ GType types[] = { G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof (types)); } if (icon_name != NULL) { /* a real protocol would use its own icon name, probably im-something - * for this example we use an emoticon instead */ *icon_name = g_strdup ("face-smile"); } if (english_name != NULL) { /* in a real protocol this would be "ICQ" or * "Windows Live Messenger (MSN)" or something */ *english_name = g_strdup ("Extended (hats) example"); } if (vcard_field != NULL) { /* in a real protocol this would be "tel" or "x-jabber" or something */ *vcard_field = g_strdup ("x-telepathy-example"); } } static void example_extended_protocol_class_init ( ExampleExtendedProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) klass; base_class->get_parameters = get_parameters; base_class->new_connection = new_connection; base_class->normalize_contact = normalize_contact; base_class->identify_account = identify_account; base_class->get_connection_details = get_connection_details; } telepathy-glib-0.24.2/examples/cm/extended/protocol.h0000644000175000017500000000372012652510705017466 00000000000000/* * protocol.h - header for an example Protocol * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_EXTENDED_PROTOCOL_H #define EXAMPLE_EXTENDED_PROTOCOL_H #include #include G_BEGIN_DECLS typedef struct _ExampleExtendedProtocol ExampleExtendedProtocol; typedef struct _ExampleExtendedProtocolPrivate ExampleExtendedProtocolPrivate; typedef struct _ExampleExtendedProtocolClass ExampleExtendedProtocolClass; typedef struct _ExampleExtendedProtocolClassPrivate ExampleExtendedProtocolClassPrivate; struct _ExampleExtendedProtocolClass { TpBaseProtocolClass parent_class; ExampleExtendedProtocolClassPrivate *priv; }; struct _ExampleExtendedProtocol { TpBaseProtocol parent; ExampleExtendedProtocolPrivate *priv; }; GType example_extended_protocol_get_type (void); #define EXAMPLE_TYPE_EXTENDED_PROTOCOL \ (example_extended_protocol_get_type ()) #define EXAMPLE_EXTENDED_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_EXTENDED_PROTOCOL, \ ExampleExtendedProtocol)) #define EXAMPLE_EXTENDED_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_EXTENDED_PROTOCOL, \ ExampleExtendedProtocolClass)) #define EXAMPLE_IS_EXTENDED_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_EXTENDED_PROTOCOL)) #define EXAMPLE_IS_EXTENDED_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_EXTENDED_PROTOCOL)) #define EXAMPLE_EXTENDED_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_EXTENDED_PROTOCOL, \ ExampleExtendedProtocolClass)) gchar *example_extended_protocol_normalize_contact (const gchar *id, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/extended/connection-manager.c0000644000175000017500000000326612652510705021374 00000000000000/* * manager.c - an example connection manager * * Copyright (C) 2007 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "connection-manager.h" #include #include #include #include "protocol.h" G_DEFINE_TYPE (ExampleExtendedConnectionManager, example_extended_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) static void example_extended_connection_manager_init ( ExampleExtendedConnectionManager *self) { } static void example_extended_connection_manager_constructed (GObject *object) { ExampleExtendedConnectionManager *self = EXAMPLE_EXTENDED_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) example_extended_connection_manager_parent_class)->constructed; TpBaseProtocol *protocol; if (constructed != NULL) constructed (object); protocol = g_object_new (EXAMPLE_TYPE_EXTENDED_PROTOCOL, "name", "example", NULL); tp_base_connection_manager_add_protocol (base, protocol); g_object_unref (protocol); } static void example_extended_connection_manager_class_init ( ExampleExtendedConnectionManagerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; object_class->constructed = example_extended_connection_manager_constructed; base_class->cm_dbus_name = "example_extended"; } telepathy-glib-0.24.2/examples/cm/extended/connection-manager.h0000644000175000017500000000454612652510705021403 00000000000000/* * manager.h - header for an example connection manager * Copyright (C) 2007 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_EXTENDED_CONNECTION_MANAGER_H__ #define __EXAMPLE_EXTENDED_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleExtendedConnectionManager ExampleExtendedConnectionManager; typedef struct _ExampleExtendedConnectionManagerPrivate ExampleExtendedConnectionManagerPrivate; typedef struct _ExampleExtendedConnectionManagerClass ExampleExtendedConnectionManagerClass; typedef struct _ExampleExtendedConnectionManagerClassPrivate ExampleExtendedConnectionManagerClassPrivate; struct _ExampleExtendedConnectionManagerClass { TpBaseConnectionManagerClass parent_class; ExampleExtendedConnectionManagerClassPrivate *priv; }; struct _ExampleExtendedConnectionManager { TpBaseConnectionManager parent; ExampleExtendedConnectionManagerPrivate *priv; }; GType example_extended_connection_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER \ (example_extended_connection_manager_get_type ()) #define EXAMPLE_EXTENDED_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER, \ ExampleExtendedConnectionManager)) #define EXAMPLE_EXTENDED_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER, \ ExampleExtendedConnectionManagerClass)) #define EXAMPLE_IS_EXTENDED_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER)) #define EXAMPLE_IS_EXTENDED_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER)) #define EXAMPLE_EXTENDED_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER, \ ExampleExtendedConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/extended/conn.c0000644000175000017500000002411312652510705016554 00000000000000/* * conn.c - an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "conn.h" #include #include /* This would conventionally be extensions/extensions.h */ #include "examples/extensions/extensions.h" #include "protocol.h" static void _hats_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (ExampleExtendedConnection, example_extended_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE (EXAMPLE_TYPE_SVC_CONNECTION_INTERFACE_HATS, _hats_iface_init)) /* type definition stuff */ enum { PROP_ACCOUNT = 1, N_PROPS }; struct _ExampleExtendedConnectionPrivate { gchar *account; gchar *hat_color; ExampleHatStyle hat_style; /* dup'd string => slice-allocated GValue */ GHashTable *hat_properties; }; static void example_extended_connection_init (ExampleExtendedConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_EXTENDED_CONNECTION, ExampleExtendedConnectionPrivate); self->priv->hat_color = g_strdup (""); self->priv->hat_style = EXAMPLE_HAT_STYLE_NONE; self->priv->hat_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) tp_g_value_slice_free); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_utf8_strdown (g_value_get_string (value), -1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (object); tp_contacts_mixin_finalize (object); g_free (self->priv->account); g_free (self->priv->hat_color); g_hash_table_unref (self->priv->hat_properties); G_OBJECT_CLASS (example_extended_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (conn); return g_strdup (self->priv->account); } static gchar * example_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { return example_extended_protocol_normalize_contact (id, error); } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_normalize_contact, NULL); } static GPtrArray * create_channel_factories (TpBaseConnection *conn) { return g_ptr_array_sized_new (0); } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, NULL); tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static void constructed (GObject *object) { TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (example_extended_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (ExampleExtendedConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); } static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, EXAMPLE_IFACE_CONNECTION_INTERFACE_HATS, NULL }; const gchar * const * example_extended_connection_get_possible_interfaces (void) { /* in this example CM we don't have any extra interfaces that are sometimes, * but not always, present */ return interfaces_always_present; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( example_extended_connection_parent_class)->get_interfaces_always_present (base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void example_extended_connection_class_init (ExampleExtendedConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->constructed = constructed; object_class->get_property = get_property; object_class->set_property = set_property; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (ExampleExtendedConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_factories = create_channel_factories; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleExtendedConnectionClass, contacts_mixin)); } static void my_get_hats (ExampleSvcConnectionInterfaceHats *iface, const GArray *contacts, DBusGMethodInvocation *context) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (iface); TpBaseConnection *base = (TpBaseConnection *) self; TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GError *error = NULL; guint i; GPtrArray *ret; if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } ret = g_ptr_array_sized_new (contacts->len); for (i = 0; i < contacts->len; i++) { TpHandle handle = g_array_index (contacts, guint, i); GValueArray *vals; /* for the sake of a simple example, let's assume nobody except me * has any hats */ if (handle == tp_base_connection_get_self_handle (base)) { vals = tp_value_array_build (4, G_TYPE_UINT, handle, G_TYPE_STRING, self->priv->hat_color, G_TYPE_UINT, self->priv->hat_style, TP_HASH_TYPE_STRING_VARIANT_MAP, self->priv->hat_properties, G_TYPE_INVALID); } else { GHashTable *empty = g_hash_table_new (g_str_hash, g_str_equal); vals = tp_value_array_build (4, G_TYPE_UINT, handle, G_TYPE_STRING, "", G_TYPE_UINT, EXAMPLE_HAT_STYLE_NONE, TP_HASH_TYPE_STRING_VARIANT_MAP, empty, G_TYPE_INVALID); g_hash_table_unref (empty); } g_ptr_array_add (ret, vals); } /* success */ example_svc_connection_interface_hats_return_from_get_hats (context, ret); g_boxed_free (EXAMPLE_ARRAY_TYPE_CONTACT_HAT_LIST, ret); } static void my_set_hat (ExampleSvcConnectionInterfaceHats *iface, const gchar *color, guint style, GHashTable *properties, DBusGMethodInvocation *context) { ExampleExtendedConnection *self = EXAMPLE_EXTENDED_CONNECTION (iface); TpBaseConnection *base = (TpBaseConnection *) self; g_free (self->priv->hat_color); self->priv->hat_color = g_strdup (color); self->priv->hat_style = style; g_hash_table_remove_all (self->priv->hat_properties); tp_g_hash_table_update (self->priv->hat_properties, properties, (GBoxedCopyFunc) g_strdup, (GBoxedCopyFunc) tp_g_value_slice_dup); /* success */ example_svc_connection_interface_hats_emit_hats_changed (self, tp_base_connection_get_self_handle (base), color, style, properties); example_svc_connection_interface_hats_return_from_set_hat (context); } static void _hats_iface_init (gpointer g_iface, gpointer iface_data) { ExampleSvcConnectionInterfaceHatsClass *klass = g_iface; #define IMPLEMENT(x) example_svc_connection_interface_hats_implement_##x \ (klass, my_##x) IMPLEMENT (get_hats); IMPLEMENT (set_hat); #undef IMPLEMENT } telepathy-glib-0.24.2/examples/cm/extended/conn.h0000644000175000017500000000402712652510705016563 00000000000000/* * conn.h - header for an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_EXTENDED_CONN_H__ #define __EXAMPLE_EXTENDED_CONN_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleExtendedConnection ExampleExtendedConnection; typedef struct _ExampleExtendedConnectionClass ExampleExtendedConnectionClass; typedef struct _ExampleExtendedConnectionPrivate ExampleExtendedConnectionPrivate; struct _ExampleExtendedConnectionClass { TpBaseConnectionClass parent_class; TpContactsMixinClass contacts_mixin; }; struct _ExampleExtendedConnection { TpBaseConnection parent; TpContactsMixin contacts_mixin; ExampleExtendedConnectionPrivate *priv; }; GType example_extended_connection_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_EXTENDED_CONNECTION \ (example_extended_connection_get_type ()) #define EXAMPLE_EXTENDED_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION, \ ExampleExtendedConnection)) #define EXAMPLE_EXTENDED_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_EXTENDED_CONNECTION, \ ExampleExtendedConnectionClass)) #define EXAMPLE_IS_EXTENDED_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION)) #define EXAMPLE_IS_EXTENDED_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_EXTENDED_CONNECTION)) #define EXAMPLE_EXTENDED_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_EXTENDED_CONNECTION, \ ExampleExtendedConnectionClass)) const gchar * const *example_extended_connection_get_possible_interfaces ( void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/extended/Makefile.am0000644000175000017500000000276012652510705017513 00000000000000EXAMPLES = telepathy-example-cm-extended if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif telepathy_example_cm_extended_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ protocol.c \ protocol.h \ main.c if INSTALL_EXAMPLES servicedir = ${datadir}/dbus-1/services service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_extended.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_extended" && \ echo "Exec=${libexecdir}/telepathy-example-cm-extended"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_extended.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/cm/extended/Makefile.in0000644000175000017500000006751214006601553017527 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/extended ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-cm-extended$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) am_telepathy_example_cm_extended_OBJECTS = conn.$(OBJEXT) \ connection-manager.$(OBJEXT) protocol.$(OBJEXT) main.$(OBJEXT) telepathy_example_cm_extended_OBJECTS = \ $(am_telepathy_example_cm_extended_OBJECTS) telepathy_example_cm_extended_LDADD = $(LDADD) am__DEPENDENCIES_1 = telepathy_example_cm_extended_DEPENDENCIES = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/conn.Po \ ./$(DEPDIR)/connection-manager.Po ./$(DEPDIR)/main.Po \ ./$(DEPDIR)/protocol.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(telepathy_example_cm_extended_SOURCES) DIST_SOURCES = $(telepathy_example_cm_extended_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_extended.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-cm-extended telepathy_example_cm_extended_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ protocol.c \ protocol.h \ main.c @INSTALL_EXAMPLES_TRUE@servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_extended.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_extended.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/extended/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/extended/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list telepathy-example-cm-extended$(EXEEXT): $(telepathy_example_cm_extended_OBJECTS) $(telepathy_example_cm_extended_DEPENDENCIES) $(EXTRA_telepathy_example_cm_extended_DEPENDENCIES) @rm -f telepathy-example-cm-extended$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_cm_extended_OBJECTS) $(telepathy_example_cm_extended_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conn.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/conn.Po -rm -f ./$(DEPDIR)/connection-manager.Po -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/conn.Po -rm -f ./$(DEPDIR)/connection-manager.Po -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_managerDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libexecPROGRAMS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-serviceDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_extended" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-extended"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/extended/main.c0000644000175000017500000000215512652510705016545 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "connection-manager.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_EXTENDED_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-cm-extended", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/echo-message-parts/0000755000175000017500000000000014006623343017417 500000000000000telepathy-glib-0.24.2/examples/cm/echo-message-parts/protocol.c0000644000175000017500000001763112652510705021356 00000000000000/* * protocol.c - an example Protocol * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "protocol.h" #include #include "conn.h" #include "im-manager.h" static void addressing_iface_init (TpProtocolAddressingInterface *iface); G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Protocol, example_echo_2_protocol, TP_TYPE_BASE_PROTOCOL, G_IMPLEMENT_INTERFACE (TP_TYPE_PROTOCOL_ADDRESSING, addressing_iface_init)) const gchar * const supported_avatar_mime_types[] = { "image/png", "image/jpeg", "image/gif", NULL }; const gchar * const addressing_vcard_fields[] = { "x-jabber", "tel", NULL }; const gchar * const addressing_uri_schemes[] = { "xmpp", "tel", NULL }; static void example_echo_2_protocol_init ( ExampleEcho2Protocol *self) { } static const TpCMParamSpec example_echo_2_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* no default */ 0, /* formerly struct offset, now unused */ tp_cm_param_filter_string_nonempty, /* filter - empty strings disallowed */ NULL, /* filter data, unused for our filter */ NULL /* setter data, now unused */ }, { NULL } }; static const TpCMParamSpec * get_parameters (TpBaseProtocol *self) { return example_echo_2_example_params; } static TpBaseConnection * new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { ExampleEcho2Connection *conn; const gchar *account; account = tp_asv_get_string (asv, "account"); if (account == NULL || account[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The 'account' parameter is required"); return NULL; } conn = EXAMPLE_ECHO_2_CONNECTION ( g_object_new (EXAMPLE_TYPE_ECHO_2_CONNECTION, "account", account, "protocol", tp_base_protocol_get_name (protocol), NULL)); return (TpBaseConnection *) conn; } gchar * example_echo_2_protocol_normalize_contact (const gchar *id, GError **error) { if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return NULL; } return g_utf8_strdown (id, -1); } static gchar * normalize_contact (TpBaseProtocol *self G_GNUC_UNUSED, const gchar *contact, GError **error) { return example_echo_2_protocol_normalize_contact (contact, error); } static gchar * identify_account (TpBaseProtocol *self G_GNUC_UNUSED, GHashTable *asv, GError **error) { const gchar *account = tp_asv_get_string (asv, "account"); if (account != NULL) return g_utf8_strdown (account, -1); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'account' parameter not given"); return NULL; } static GPtrArray * get_interfaces_array (TpBaseProtocol *self) { GPtrArray *interfaces; interfaces = TP_BASE_PROTOCOL_CLASS ( example_echo_2_protocol_parent_class)->get_interfaces_array (self); g_ptr_array_add (interfaces, TP_IFACE_PROTOCOL_INTERFACE_AVATARS); g_ptr_array_add (interfaces, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING); return interfaces; } static void get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED, GStrv *connection_interfaces, GType **channel_managers, gchar **icon_name, gchar **english_name, gchar **vcard_field) { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv ( (GStrv) example_echo_2_connection_get_possible_interfaces ()); } if (channel_managers != NULL) { GType types[] = { EXAMPLE_TYPE_ECHO_2_IM_MANAGER, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof (types)); } if (icon_name != NULL) { /* a real protocol would use its own icon name - for this example we * borrow the one from ICQ */ *icon_name = g_strdup ("im-icq"); } if (english_name != NULL) { /* in a real protocol this would be "ICQ" or * "Windows Live Messenger (MSN)" or something */ *english_name = g_strdup ("Echo II example"); } if (vcard_field != NULL) { /* in a real protocol this would be "tel" or "x-jabber" or something */ *vcard_field = g_strdup ("x-telepathy-example"); } } static void get_avatar_details (TpBaseProtocol *self, GStrv *supported_mime_types, guint *min_height, guint *min_width, guint *recommended_height, guint *recommended_width, guint *max_height, guint *max_width, guint *max_bytes) { if (supported_mime_types != NULL) *supported_mime_types = g_strdupv ((GStrv) supported_avatar_mime_types); if (min_height != NULL) *min_height = 32; if (min_width != NULL) *min_width = 32; if (recommended_height != NULL) *recommended_height = 64; if (recommended_width != NULL) *recommended_width = 64; if (max_height != NULL) *max_height = 96; if (max_width != NULL) *max_width = 96; if (max_bytes != NULL) *max_bytes = 37748736; } static GStrv dup_supported_uri_schemes (TpBaseProtocol *self) { return g_strdupv ((GStrv) addressing_uri_schemes); } static GStrv dup_supported_vcard_fields (TpBaseProtocol *self) { return g_strdupv ((GStrv) addressing_vcard_fields); } static gchar * normalize_vcard_address (TpBaseProtocol *self, const gchar *vcard_field, const gchar *vcard_address, GError **error) { if (g_ascii_strcasecmp (vcard_field, "x-jabber") == 0) { /* This is not really how you normalize a JID but it's good enough * for an example. In real life you'd do syntax-checking beyond * "is it empty?", stringprep, and so on. Here, we just assume * non-empty means valid, and lower-case means normalized. */ if (tp_str_empty (vcard_address)) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "The empty string is not a valid JID"); return NULL; } return g_utf8_strdown (vcard_address, -1); } else { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Don't know how to normalize vCard field: %s", vcard_field); return NULL; } } static gchar * normalize_contact_uri (TpBaseProtocol *self, const gchar *uri, GError **error) { gchar *scheme = g_uri_parse_scheme (uri); if (g_ascii_strcasecmp (scheme, "xmpp") == 0) { gchar *ret = NULL; gchar *id; id = normalize_vcard_address (self, "x-jabber", uri + 5, error); if (id != NULL) ret = g_strdup_printf ("%s:%s", scheme, id); g_free (scheme); g_free (id); return ret; } else if (scheme == NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "Not a valid URI: %s", uri); return NULL; } else { g_set_error (error, TP_ERROR, TP_ERROR_NOT_IMPLEMENTED, "Don't know how to normalize URIs of that scheme: %s", scheme); g_free (scheme); return NULL; } } static void example_echo_2_protocol_class_init ( ExampleEcho2ProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) klass; base_class->get_parameters = get_parameters; base_class->new_connection = new_connection; base_class->normalize_contact = normalize_contact; base_class->identify_account = identify_account; base_class->get_interfaces_array = get_interfaces_array; base_class->get_connection_details = get_connection_details; base_class->get_avatar_details = get_avatar_details; } static void addressing_iface_init (TpProtocolAddressingInterface *iface) { iface->dup_supported_vcard_fields = dup_supported_vcard_fields; iface->dup_supported_uri_schemes = dup_supported_uri_schemes; iface->normalize_vcard_address = normalize_vcard_address; iface->normalize_contact_uri = normalize_contact_uri; } telepathy-glib-0.24.2/examples/cm/echo-message-parts/protocol.h0000644000175000017500000000365012652510705021357 00000000000000/* * protocol.h - header for an example Protocol * Copyright (C) 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_ECHO_MESSAGE_PARTS_PROTOCOL_H #define EXAMPLE_ECHO_MESSAGE_PARTS_PROTOCOL_H #include #include G_BEGIN_DECLS typedef struct _ExampleEcho2Protocol ExampleEcho2Protocol; typedef struct _ExampleEcho2ProtocolPrivate ExampleEcho2ProtocolPrivate; typedef struct _ExampleEcho2ProtocolClass ExampleEcho2ProtocolClass; typedef struct _ExampleEcho2ProtocolClassPrivate ExampleEcho2ProtocolClassPrivate; struct _ExampleEcho2ProtocolClass { TpBaseProtocolClass parent_class; ExampleEcho2ProtocolClassPrivate *priv; }; struct _ExampleEcho2Protocol { TpBaseProtocol parent; ExampleEcho2ProtocolPrivate *priv; }; GType example_echo_2_protocol_get_type (void); #define EXAMPLE_TYPE_ECHO_2_PROTOCOL \ (example_echo_2_protocol_get_type ()) #define EXAMPLE_ECHO_2_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_ECHO_2_PROTOCOL, \ ExampleEcho2Protocol)) #define EXAMPLE_ECHO_2_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_ECHO_2_PROTOCOL, \ ExampleEcho2ProtocolClass)) #define EXAMPLE_IS_ECHO_2_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_ECHO_2_PROTOCOL)) #define EXAMPLE_IS_ECHO_2_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_ECHO_2_PROTOCOL)) #define EXAMPLE_ECHO_2_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_ECHO_2_PROTOCOL, \ ExampleEcho2ProtocolClass)) gchar *example_echo_2_protocol_normalize_contact (const gchar *id, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/echo-message-parts/connection-manager.c0000644000175000017500000000324512652510705023260 00000000000000/* * manager.c - an example connection manager * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "connection-manager.h" #include #include #include #include "protocol.h" G_DEFINE_TYPE (ExampleEcho2ConnectionManager, example_echo_2_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) /* type definition stuff */ static void example_echo_2_connection_manager_init ( ExampleEcho2ConnectionManager *self) { } static void example_echo_2_connection_manager_constructed (GObject *object) { ExampleEcho2ConnectionManager *self = EXAMPLE_ECHO_2_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) example_echo_2_connection_manager_parent_class)->constructed; TpBaseProtocol *protocol; if (constructed != NULL) constructed (object); protocol = g_object_new (EXAMPLE_TYPE_ECHO_2_PROTOCOL, "name", "example", NULL); tp_base_connection_manager_add_protocol (base, protocol); g_object_unref (protocol); } static void example_echo_2_connection_manager_class_init ( ExampleEcho2ConnectionManagerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; object_class->constructed = example_echo_2_connection_manager_constructed; base_class->cm_dbus_name = "example_echo_2"; } telepathy-glib-0.24.2/examples/cm/echo-message-parts/connection-manager.h0000644000175000017500000000415412652510705023265 00000000000000/* * manager.h - header for an example connection manager * Copyright (C) 2007 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_ECHO_MESSAGE_PARTS_MANAGER_H #define EXAMPLE_ECHO_MESSAGE_PARTS_MANAGER_H #include #include G_BEGIN_DECLS typedef struct _ExampleEcho2ConnectionManager ExampleEcho2ConnectionManager; typedef struct _ExampleEcho2ConnectionManagerPrivate ExampleEcho2ConnectionManagerPrivate; typedef struct _ExampleEcho2ConnectionManagerClass ExampleEcho2ConnectionManagerClass; typedef struct _ExampleEcho2ConnectionManagerClassPrivate ExampleEcho2ConnectionManagerClassPrivate; struct _ExampleEcho2ConnectionManagerClass { TpBaseConnectionManagerClass parent_class; ExampleEcho2ConnectionManagerClassPrivate *priv; }; struct _ExampleEcho2ConnectionManager { TpBaseConnectionManager parent; ExampleEcho2ConnectionManagerPrivate *priv; }; GType example_echo_2_connection_manager_get_type (void); #define EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER \ (example_echo_2_connection_manager_get_type ()) #define EXAMPLE_ECHO_2_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, \ ExampleEcho2ConnectionManager)) #define EXAMPLE_ECHO_2_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, \ ExampleEcho2ConnectionManagerClass)) #define EXAMPLE_IS_ECHO_2_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER)) #define EXAMPLE_IS_ECHO_2_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER)) #define EXAMPLE_ECHO_2_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, \ ExampleEcho2ConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/echo-message-parts/example_echo_2.manager0000644000175000017500000000112512652510705023546 00000000000000[ConnectionManager] Interfaces= [Protocol example] Interfaces= ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts; param-account=s required register RequestableChannelClasses=1-1-text; VCardField=x-telepathy-example EnglishName=Echo II example Icon=im-icq [1-1-text] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text org.freedesktop.Telepathy.Channel.TargetHandleType u=1 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID; telepathy-glib-0.24.2/examples/cm/echo-message-parts/chan.c0000644000175000017500000003104112652510705020415 00000000000000/* * chan.c - an example text channel talking to a particular * contact. Similar code is used for 1-1 IM channels in many protocols * (IRC private messages ("/query"), XMPP IM etc.) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "chan.h" #include #include #include static void destroyable_iface_init (gpointer iface, gpointer data); static void sms_iface_init (gpointer iface, gpointer data); G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Channel, example_echo_2_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, tp_message_mixin_text_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES, tp_message_mixin_messages_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_CHAT_STATE, tp_message_mixin_chat_state_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_DESTROYABLE, destroyable_iface_init) G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_SMS, sms_iface_init) ) /* type definition stuff */ static GPtrArray * example_echo_2_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS (example_echo_2_channel_parent_class)-> get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_SMS); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_CHAT_STATE); return interfaces; }; enum { PROP_SMS = 1, PROP_SMS_FLASH, N_PROPS }; struct _ExampleEcho2ChannelPrivate { gboolean sms; }; static void example_echo_2_channel_init (ExampleEcho2Channel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_ECHO_2_CHANNEL, ExampleEcho2ChannelPrivate); } static void send_message (GObject *object, TpMessage *message, TpMessageSendingFlags flags) { ExampleEcho2Channel *self = EXAMPLE_ECHO_2_CHANNEL (object); TpBaseChannel *base = TP_BASE_CHANNEL (self); time_t timestamp = time (NULL); guint len = tp_message_count_parts (message); TpMessage *received = NULL; guint i; if (tp_asv_get_string (tp_message_peek (message, 0), "interface") != NULL) { /* this message is interface-specific - let's not echo it */ goto finally; } received = tp_cm_message_new (tp_base_channel_get_connection (base), 1); /* Copy/modify the headers for the "received" message */ { TpChannelTextMessageType message_type; gboolean valid; tp_cm_message_set_sender (received, tp_base_channel_get_target_handle (base)); message_type = tp_asv_get_uint32 (tp_message_peek (message, 0), "message-type", &valid); /* The check for 'valid' means that if message-type is missing or of the * wrong type, fall back to NORMAL (this is in fact a no-op, since * NORMAL == 0 and tp_asv_get_uint32 returns 0 on missing or wrongly * typed values) */ if (valid && message_type != TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL) tp_message_set_uint32 (received, 0, "message-type", message_type); tp_message_set_uint32 (received, 0, "message-sent", timestamp); tp_message_set_uint32 (received, 0, "message-received", timestamp); } /* Copy the content for the "received" message */ for (i = 1; i < len; i++) { const GHashTable *input = tp_message_peek (message, i); const gchar *s; const GValue *value; guint j; /* in this example we ignore interface-specific parts */ s = tp_asv_get_string (input, "content-type"); if (s == NULL) continue; s = tp_asv_get_string (input, "interface"); if (s != NULL) continue; /* OK, we want to copy this part */ j = tp_message_append_part (received); s = tp_asv_get_string (input, "content-type"); g_assert (s != NULL); /* already checked */ tp_message_set_string (received, j, "content-type", s); s = tp_asv_get_string (input, "identifier"); if (s != NULL) tp_message_set_string (received, j, "identifier", s); s = tp_asv_get_string (input, "alternative"); if (s != NULL) tp_message_set_string (received, j, "alternative", s); s = tp_asv_get_string (input, "lang"); if (s != NULL) tp_message_set_string (received, j, "lang", s); value = tp_asv_lookup (input, "content"); if (value != NULL) tp_message_set (received, j, "content", value); } finally: /* "OK, we've sent the message" (after calling this, message must not be * dereferenced) */ tp_message_mixin_sent (object, message, flags, "", NULL); if (received != NULL) { /* Pretend the other user sent us back the same message. After this call, * the received message is owned by the mixin */ tp_message_mixin_take_received (object, received); } } static gboolean send_chat_state (GObject *object, TpChannelChatState state, GError **error) { return TRUE; } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { GObject *object = G_OBJECT_CLASS (example_echo_2_channel_parent_class)->constructor (type, n_props, props); ExampleEcho2Channel *self = EXAMPLE_ECHO_2_CHANNEL (object); TpBaseChannel *base = TP_BASE_CHANNEL (self); static TpChannelTextMessageType const types[] = { TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE }; static const char * const content_types[] = { "*/*", NULL }; tp_base_channel_register (base); tp_message_mixin_init (object, G_STRUCT_OFFSET (ExampleEcho2Channel, text), tp_base_channel_get_connection (base)); tp_message_mixin_implement_sending (object, send_message, G_N_ELEMENTS (types), types, TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT | TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES, content_types); tp_message_mixin_implement_send_chat_state (object, send_chat_state); return object; } static void finalize (GObject *object) { tp_message_mixin_finalize (object); ((GObjectClass *) example_echo_2_channel_parent_class)->finalize (object); } static void example_echo_2_channel_close (TpBaseChannel *self) { GObject *object = (GObject *) self; tp_message_mixin_maybe_send_gone (object); if (!tp_base_channel_is_destroyed (self)) { TpHandle first_sender; /* The manager wants to be able to respawn the channel if it has pending * messages. When respawned, the channel must have the initiator set * to the contact who sent us those messages (if it isn't already), * and the messages must be marked as having been rescued so they * don't get logged twice. */ if (tp_message_mixin_has_pending_messages (object, &first_sender)) { tp_message_mixin_set_rescued (object); tp_base_channel_reopened (self, first_sender); } else { tp_base_channel_destroyed (self); } } } static void example_echo_2_channel_fill_immutable_properties (TpBaseChannel *chan, GHashTable *properties) { TpBaseChannelClass *klass = TP_BASE_CHANNEL_CLASS ( example_echo_2_channel_parent_class); klass->fill_immutable_properties (chan, properties); tp_dbus_properties_mixin_fill_properties_hash ( G_OBJECT (chan), properties, TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessagePartSupportFlags", TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "DeliveryReportingSupport", TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "SupportedContentTypes", TP_IFACE_CHANNEL_INTERFACE_MESSAGES, "MessageTypes", TP_IFACE_CHANNEL_INTERFACE_SMS, "Flash", NULL); } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleEcho2Channel *self = (ExampleEcho2Channel *) object; switch (property_id) { case PROP_SMS: self->priv->sms = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleEcho2Channel *self = (ExampleEcho2Channel *) object; switch (property_id) { case PROP_SMS: g_value_set_boolean (value, self->priv->sms); break; case PROP_SMS_FLASH: g_value_set_boolean (value, TRUE); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void example_echo_2_channel_class_init (ExampleEcho2ChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = (TpBaseChannelClass *) klass; GParamSpec *param_spec; static TpDBusPropertiesMixinPropImpl sms_props[] = { { "SMSChannel", "sms", NULL }, { "Flash", "sms-flash", NULL }, { NULL } }; g_type_class_add_private (klass, sizeof (ExampleEcho2ChannelPrivate)); object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; base_class->get_interfaces = example_echo_2_channel_get_interfaces; base_class->close = example_echo_2_channel_close; base_class->fill_immutable_properties = example_echo_2_channel_fill_immutable_properties; param_spec = g_param_spec_boolean ("sms", "SMS", "SMS.SMSChannel", FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SMS, param_spec); param_spec = g_param_spec_boolean ("sms-flash", "SMS Flash", "SMS.Flash", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SMS_FLASH, param_spec); tp_dbus_properties_mixin_implement_interface (object_class, TP_IFACE_QUARK_CHANNEL_INTERFACE_SMS, tp_dbus_properties_mixin_getter_gobject_properties, NULL, sms_props); tp_message_mixin_init_dbus_properties (object_class); } static void destroyable_destroy (TpSvcChannelInterfaceDestroyable *iface, DBusGMethodInvocation *context) { TpBaseChannel *self = TP_BASE_CHANNEL (iface); tp_message_mixin_clear ((GObject *) self); example_echo_2_channel_close (self); g_assert (tp_base_channel_is_destroyed (self)); tp_svc_channel_interface_destroyable_return_from_destroy (context); } static void destroyable_iface_init (gpointer iface, gpointer data) { TpSvcChannelInterfaceDestroyableClass *klass = iface; #define IMPLEMENT(x) \ tp_svc_channel_interface_destroyable_implement_##x (klass, destroyable_##x) IMPLEMENT (destroy); #undef IMPLEMENT } void example_echo_2_channel_set_sms (ExampleEcho2Channel *self, gboolean sms) { if (self->priv->sms == sms) return; self->priv->sms = sms; tp_svc_channel_interface_sms_emit_sms_channel_changed (self, sms); } static void sms_get_sms_length (TpSvcChannelInterfaceSMS *self, const GPtrArray *parts, DBusGMethodInvocation *context) { TpMessage *message; guint i; gchar *txt; size_t len; message = tp_cm_message_new ( tp_base_channel_get_connection (TP_BASE_CHANNEL (self)), parts->len); for (i = 0; i < parts->len; i++) { GHashTableIter iter; gpointer key, value; tp_message_append_part (message); g_hash_table_iter_init (&iter, g_ptr_array_index (parts, i)); while (g_hash_table_iter_next (&iter, &key, &value)) { tp_message_set (message, i, key, value); } } txt = tp_message_to_text (message, NULL); len = strlen (txt); tp_svc_channel_interface_sms_return_from_get_sms_length (context, len, EXAMPLE_ECHO_2_CHANNEL_MAX_SMS_LENGTH - len, -1); g_object_unref (message); g_free (txt); } static void sms_iface_init (gpointer iface, gpointer data) { TpSvcChannelInterfaceSMSClass *klass = iface; #define IMPLEMENT(x) \ tp_svc_channel_interface_sms_implement_##x (klass, sms_##x) IMPLEMENT (get_sms_length); #undef IMPLEMENT } telepathy-glib-0.24.2/examples/cm/echo-message-parts/chan.h0000644000175000017500000000354412652510705020431 00000000000000/* * chan.h - header for an example channel * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_ECHO_MESSAGE_PARTS_CHAN_H #define EXAMPLE_ECHO_MESSAGE_PARTS_CHAN_H #include G_BEGIN_DECLS typedef struct _ExampleEcho2Channel ExampleEcho2Channel; typedef struct _ExampleEcho2ChannelClass ExampleEcho2ChannelClass; typedef struct _ExampleEcho2ChannelPrivate ExampleEcho2ChannelPrivate; GType example_echo_2_channel_get_type (void); #define EXAMPLE_TYPE_ECHO_2_CHANNEL \ (example_echo_2_channel_get_type ()) #define EXAMPLE_ECHO_2_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_TYPE_ECHO_2_CHANNEL, \ ExampleEcho2Channel)) #define EXAMPLE_ECHO_2_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), EXAMPLE_TYPE_ECHO_2_CHANNEL, \ ExampleEcho2ChannelClass)) #define EXAMPLE_IS_ECHO_2_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXAMPLE_TYPE_ECHO_2_CHANNEL)) #define EXAMPLE_IS_ECHO_2_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EXAMPLE_TYPE_ECHO_2_CHANNEL)) #define EXAMPLE_ECHO_2_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_ECHO_2_CHANNEL, \ ExampleEcho2ChannelClass)) struct _ExampleEcho2ChannelClass { TpBaseChannelClass parent_class; }; struct _ExampleEcho2Channel { TpBaseChannel parent; TpMessageMixin text; ExampleEcho2ChannelPrivate *priv; }; #define EXAMPLE_ECHO_2_CHANNEL_MAX_SMS_LENGTH 100 void example_echo_2_channel_set_sms (ExampleEcho2Channel *self, gboolean sms); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/echo-message-parts/conn.c0000644000175000017500000001472412652510705020452 00000000000000/* * conn.c - an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "conn.h" #include #include #include "im-manager.h" #include "protocol.h" G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Connection, example_echo_2_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init)) enum { PROP_ACCOUNT = 1, N_PROPS }; struct _ExampleEcho2ConnectionPrivate { gchar *account; }; static void example_echo_2_connection_init (ExampleEcho2Connection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_ECHO_2_CONNECTION, ExampleEcho2ConnectionPrivate); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { ExampleEcho2Connection *self = EXAMPLE_ECHO_2_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { ExampleEcho2Connection *self = EXAMPLE_ECHO_2_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_utf8_strdown (g_value_get_string (value), -1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { ExampleEcho2Connection *self = EXAMPLE_ECHO_2_CONNECTION (object); tp_contacts_mixin_finalize (object); g_free (self->priv->account); G_OBJECT_CLASS (example_echo_2_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { ExampleEcho2Connection *self = EXAMPLE_ECHO_2_CONNECTION (conn); return g_strdup (self->priv->account); } static gchar * example_normalize_contact (TpHandleRepoIface *repo G_GNUC_UNUSED, const gchar *id, gpointer context G_GNUC_UNUSED, GError **error) { return example_echo_2_protocol_normalize_contact (id, error); } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_normalize_contact, NULL); } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { GPtrArray *ret = g_ptr_array_sized_new (1); g_ptr_array_add (ret, g_object_new (EXAMPLE_TYPE_ECHO_2_IM_MANAGER, "connection", conn, NULL)); return ret; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { ExampleEcho2Connection *self = EXAMPLE_ECHO_2_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, NULL); tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, NULL }; const gchar * const * example_echo_2_connection_get_possible_interfaces (void) { /* in this example CM we don't have any extra interfaces that are sometimes, * but not always, present */ return interfaces_always_present; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( example_echo_2_connection_parent_class)->get_interfaces_always_present (base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void constructed (GObject *object) { TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (example_echo_2_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (ExampleEcho2Connection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); } static void example_echo_2_connection_class_init (ExampleEcho2ConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->constructed = constructed; object_class->get_property = get_property; object_class->set_property = set_property; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (ExampleEcho2ConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_managers = create_channel_managers; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleEcho2ConnectionClass, contacts_mixin)); } telepathy-glib-0.24.2/examples/cm/echo-message-parts/conn.h0000644000175000017500000000404712652510705020454 00000000000000/* * conn.h - header for an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_ECHO_MESSAGE_PARTS_CONN_H #define EXAMPLE_ECHO_MESSAGE_PARTS_CONN_H #include #include G_BEGIN_DECLS typedef struct _ExampleEcho2Connection ExampleEcho2Connection; typedef struct _ExampleEcho2ConnectionClass ExampleEcho2ConnectionClass; typedef struct _ExampleEcho2ConnectionPrivate ExampleEcho2ConnectionPrivate; struct _ExampleEcho2ConnectionClass { TpBaseConnectionClass parent_class; TpContactsMixinClass contacts_mixin; }; struct _ExampleEcho2Connection { TpBaseConnection parent; TpContactsMixin contacts_mixin; ExampleEcho2ConnectionPrivate *priv; }; GType example_echo_2_connection_get_type (void); #define EXAMPLE_TYPE_ECHO_2_CONNECTION \ (example_echo_2_connection_get_type ()) #define EXAMPLE_ECHO_2_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_ECHO_2_CONNECTION, \ ExampleEcho2Connection)) #define EXAMPLE_ECHO_2_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_ECHO_2_CONNECTION, \ ExampleEcho2ConnectionClass)) #define EXAMPLE_IS_ECHO_2_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_ECHO_2_CONNECTION)) #define EXAMPLE_IS_ECHO_2_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_ECHO_2_CONNECTION)) #define EXAMPLE_ECHO_2_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_ECHO_2_CONNECTION, \ ExampleEcho2ConnectionClass)) const gchar * const *example_echo_2_connection_get_guaranteed_interfaces ( void); const gchar * const *example_echo_2_connection_get_possible_interfaces ( void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/echo-message-parts/Makefile.am0000644000175000017500000000323512652510705021400 00000000000000EXAMPLES = telepathy-example-cm-echo-2 noinst_LTLIBRARIES = libexample-cm-echo-2.la if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif libexample_cm_echo_2_la_SOURCES = \ chan.c \ chan.h \ conn.c \ conn.h \ protocol.c \ protocol.h \ connection-manager.c \ connection-manager.h \ im-manager.c \ im-manager.h libexample_cm_echo_2_la_LIBADD = $(LDADD) telepathy_example_cm_echo_2_SOURCES = \ main.c telepathy_example_cm_echo_2_LDADD = \ $(noinst_LTLIBRARIES) if INSTALL_EXAMPLES servicedir = ${datadir}/dbus-1/services service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_echo_2.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_echo_2" && \ echo "Exec=${libexecdir}/telepathy-example-cm-echo-2"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_echo_2.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/cm/echo-message-parts/Makefile.in0000644000175000017500000007231414006601553021412 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/echo-message-parts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-cm-echo-2$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libexample_cm_echo_2_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libexample_cm_echo_2_la_OBJECTS = chan.lo conn.lo protocol.lo \ connection-manager.lo im-manager.lo libexample_cm_echo_2_la_OBJECTS = \ $(am_libexample_cm_echo_2_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_telepathy_example_cm_echo_2_OBJECTS = main.$(OBJEXT) telepathy_example_cm_echo_2_OBJECTS = \ $(am_telepathy_example_cm_echo_2_OBJECTS) telepathy_example_cm_echo_2_DEPENDENCIES = $(noinst_LTLIBRARIES) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/chan.Plo ./$(DEPDIR)/conn.Plo \ ./$(DEPDIR)/connection-manager.Plo ./$(DEPDIR)/im-manager.Plo \ ./$(DEPDIR)/main.Po ./$(DEPDIR)/protocol.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libexample_cm_echo_2_la_SOURCES) \ $(telepathy_example_cm_echo_2_SOURCES) DIST_SOURCES = $(libexample_cm_echo_2_la_SOURCES) \ $(telepathy_example_cm_echo_2_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_echo_2.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-cm-echo-2 noinst_LTLIBRARIES = libexample-cm-echo-2.la libexample_cm_echo_2_la_SOURCES = \ chan.c \ chan.h \ conn.c \ conn.h \ protocol.c \ protocol.h \ connection-manager.c \ connection-manager.h \ im-manager.c \ im-manager.h libexample_cm_echo_2_la_LIBADD = $(LDADD) telepathy_example_cm_echo_2_SOURCES = \ main.c telepathy_example_cm_echo_2_LDADD = \ $(noinst_LTLIBRARIES) @INSTALL_EXAMPLES_TRUE@servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_echo_2.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_echo_2.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/echo-message-parts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/echo-message-parts/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libexample-cm-echo-2.la: $(libexample_cm_echo_2_la_OBJECTS) $(libexample_cm_echo_2_la_DEPENDENCIES) $(EXTRA_libexample_cm_echo_2_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexample_cm_echo_2_la_OBJECTS) $(libexample_cm_echo_2_la_LIBADD) $(LIBS) telepathy-example-cm-echo-2$(EXEEXT): $(telepathy_example_cm_echo_2_OBJECTS) $(telepathy_example_cm_echo_2_DEPENDENCIES) $(EXTRA_telepathy_example_cm_echo_2_DEPENDENCIES) @rm -f telepathy-example-cm-echo-2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_cm_echo_2_OBJECTS) $(telepathy_example_cm_echo_2_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/im-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/chan.Plo -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/im-manager.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/chan.Plo -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/im-manager.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_managerDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libexecPROGRAMS install-man install-pdf install-pdf-am \ install-ps install-ps-am install-serviceDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_echo_2" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-echo-2"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/echo-message-parts/main.c0000644000175000017500000000215012652510705020427 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "connection-manager.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_ECHO_2_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-cm-echo-2", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/echo-message-parts/im-manager.c0000644000175000017500000002472212652510705021531 00000000000000/* * im-manager.c - an example channel manager for channels talking to a * particular contact. Similar code is used for 1-1 IM channels in many * protocols (IRC private messages ("/query"), XMPP IM etc.) * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "im-manager.h" #include #include #include "chan.h" static void channel_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (ExampleEcho2ImManager, example_echo_2_im_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init)) /* type definition stuff */ enum { PROP_CONNECTION = 1, N_PROPS }; struct _ExampleEcho2ImManagerPrivate { TpBaseConnection *conn; /* GUINT_TO_POINTER (handle) => ExampleEcho2Channel */ GHashTable *channels; gulong status_changed_id; }; static void example_echo_2_im_manager_init (ExampleEcho2ImManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_ECHO_2_IM_MANAGER, ExampleEcho2ImManagerPrivate); self->priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref); } static void example_echo_2_im_manager_close_all (ExampleEcho2ImManager *self); static void dispose (GObject *object) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (object); example_echo_2_im_manager_close_all (self); g_assert (self->priv->channels == NULL); ((GObjectClass *) example_echo_2_im_manager_parent_class)->dispose (object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: /* We don't ref the connection, because it owns a reference to the * channel manager, and it guarantees that the manager's lifetime is * less than its lifetime */ self->priv->conn = g_value_get_object (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, ExampleEcho2ImManager *self) { if (status == TP_CONNECTION_STATUS_DISCONNECTED) example_echo_2_im_manager_close_all (self); } static void constructed (GObject *object) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_echo_2_im_manager_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); } static void example_echo_2_im_manager_class_init (ExampleEcho2ImManagerClass *klass) { GParamSpec *param_spec; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; param_spec = g_param_spec_object ("connection", "Connection object", "The connection that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); g_type_class_add_private (klass, sizeof (ExampleEcho2ImManagerPrivate)); } static void example_echo_2_im_manager_close_all (ExampleEcho2ImManager *self) { if (self->priv->channels != NULL) { GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } } static void example_echo_2_im_manager_foreach_channel (TpChannelManager *iface, TpExportableChannelFunc callback, gpointer user_data) { ExampleEcho2ImManager *self = EXAMPLE_ECHO_2_IM_MANAGER (iface); GHashTableIter iter; gpointer handle, channel; g_hash_table_iter_init (&iter, self->priv->channels); while (g_hash_table_iter_next (&iter, &handle, &channel)) { callback (TP_EXPORTABLE_CHANNEL (channel), user_data); } } static void channel_closed_cb (ExampleEcho2Channel *chan, ExampleEcho2ImManager *self) { tp_channel_manager_emit_channel_closed_for_object (self, TP_EXPORTABLE_CHANNEL (chan)); if (self->priv->channels != NULL) { TpHandle handle; gboolean really_destroyed; g_object_get (chan, "handle", &handle, "channel-destroyed", &really_destroyed, NULL); /* Re-announce the channel if it's not yet ready to go away (pending * messages) */ if (really_destroyed) { g_hash_table_remove (self->priv->channels, GUINT_TO_POINTER (handle)); } else { tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), NULL); } } } static void new_channel (ExampleEcho2ImManager *self, TpHandle handle, TpHandle initiator, gpointer request_token) { ExampleEcho2Channel *chan; gchar *object_path; GSList *requests = NULL; object_path = g_strdup_printf ("%s/Echo2Channel%u", tp_base_connection_get_object_path (self->priv->conn), handle); chan = g_object_new (EXAMPLE_TYPE_ECHO_2_CHANNEL, "connection", self->priv->conn, "object-path", object_path, "handle", handle, "initiator-handle", initiator, NULL); g_free (object_path); g_signal_connect (chan, "closed", (GCallback) channel_closed_cb, self); g_hash_table_insert (self->priv->channels, GUINT_TO_POINTER (handle), chan); if (request_token != NULL) requests = g_slist_prepend (requests, request_token); tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), requests); g_slist_free (requests); } static const gchar * const fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL }; static const gchar * const allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, NULL }; static void example_echo_2_im_manager_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data) { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL); func (type, table, allowed_properties, user_data); g_hash_table_unref (table); } static gboolean example_echo_2_im_manager_request (ExampleEcho2ImManager *self, gpointer request_token, GHashTable *request_properties, gboolean require_new) { TpHandle handle; ExampleEcho2Channel *chan; GError *error = NULL; if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_TEXT)) { return FALSE; } if (tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) != TP_HANDLE_TYPE_CONTACT) { return FALSE; } handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); g_assert (handle != 0); if (tp_channel_manager_asv_has_unknown_properties (request_properties, fixed_properties, allowed_properties, &error)) { goto error; } chan = g_hash_table_lookup (self->priv->channels, GUINT_TO_POINTER (handle)); if (chan == NULL) { new_channel (self, handle, tp_base_connection_get_self_handle (self->priv->conn), request_token); } else if (require_new) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "An echo2 channel to contact #%u already exists", handle); goto error; } else { tp_channel_manager_emit_request_already_satisfied (self, request_token, TP_EXPORTABLE_CHANNEL (chan)); } return TRUE; error: tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); g_error_free (error); return TRUE; } static gboolean example_echo_2_im_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_echo_2_im_manager_request (EXAMPLE_ECHO_2_IM_MANAGER (manager), request_token, request_properties, TRUE); } static gboolean example_echo_2_im_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_echo_2_im_manager_request (EXAMPLE_ECHO_2_IM_MANAGER (manager), request_token, request_properties, FALSE); } static void channel_manager_iface_init (gpointer g_iface, gpointer data G_GNUC_UNUSED) { TpChannelManagerIface *iface = g_iface; iface->foreach_channel = example_echo_2_im_manager_foreach_channel; iface->type_foreach_channel_class = example_echo_2_im_manager_type_foreach_channel_class; iface->create_channel = example_echo_2_im_manager_create_channel; iface->ensure_channel = example_echo_2_im_manager_ensure_channel; /* In this channel manager, Request has the same semantics as Ensure */ iface->request_channel = example_echo_2_im_manager_ensure_channel; } telepathy-glib-0.24.2/examples/cm/echo-message-parts/im-manager.h0000644000175000017500000000341112652510705021526 00000000000000/* * manager.h - header for an example channel manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_ECHO_MESSAGE_PARTS_IM_MANAGER_H #define EXAMPLE_ECHO_MESSAGE_PARTS_IM_MANAGER_H #include G_BEGIN_DECLS typedef struct _ExampleEcho2ImManager ExampleEcho2ImManager; typedef struct _ExampleEcho2ImManagerClass ExampleEcho2ImManagerClass; typedef struct _ExampleEcho2ImManagerPrivate ExampleEcho2ImManagerPrivate; struct _ExampleEcho2ImManagerClass { GObjectClass parent_class; }; struct _ExampleEcho2ImManager { GObject parent; ExampleEcho2ImManagerPrivate *priv; }; GType example_echo_2_im_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_ECHO_2_IM_MANAGER \ (example_echo_2_im_manager_get_type ()) #define EXAMPLE_ECHO_2_IM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_ECHO_2_IM_MANAGER, \ ExampleEcho2ImManager)) #define EXAMPLE_ECHO_2_IM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_ECHO_2_IM_MANAGER, \ ExampleEcho2ImManagerClass)) #define EXAMPLE_IS_ECHO_2_IM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_ECHO_2_IM_MANAGER)) #define EXAMPLE_IS_ECHO_2_IM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_ECHO_2_IM_MANAGER)) #define EXAMPLE_ECHO_2_IM_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_ECHO_2_IM_MANAGER, \ ExampleEcho2ImManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/no-protocols/0000755000175000017500000000000014006623343016366 500000000000000telepathy-glib-0.24.2/examples/cm/no-protocols/connection-manager.c0000644000175000017500000000201012652510705022214 00000000000000/* * A trivial connection manager which supports no protocols * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "connection-manager.h" #include #include G_DEFINE_TYPE (ExampleNoProtocolsConnectionManager, example_no_protocols_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) /* type definition stuff */ static void example_no_protocols_connection_manager_init ( ExampleNoProtocolsConnectionManager *self) { } /* private data */ static void example_no_protocols_connection_manager_class_init ( ExampleNoProtocolsConnectionManagerClass *klass) { TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; base_class->cm_dbus_name = "example_no_protocols"; } telepathy-glib-0.24.2/examples/cm/no-protocols/connection-manager.h0000644000175000017500000000503012652510705022226 00000000000000/* * manager.h - header for an example connection manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_NO_PROTOCOLS_CONNECTION_MANAGER_H__ #define __EXAMPLE_NO_PROTOCOLS_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleNoProtocolsConnectionManager ExampleNoProtocolsConnectionManager; typedef struct _ExampleNoProtocolsConnectionManagerPrivate ExampleNoProtocolsConnectionManagerPrivate; typedef struct _ExampleNoProtocolsConnectionManagerClass ExampleNoProtocolsConnectionManagerClass; typedef struct _ExampleNoProtocolsConnectionManagerClassPrivate ExampleNoProtocolsConnectionManagerClassPrivate; struct _ExampleNoProtocolsConnectionManagerClass { TpBaseConnectionManagerClass parent_class; ExampleNoProtocolsConnectionManagerClassPrivate *priv; }; struct _ExampleNoProtocolsConnectionManager { TpBaseConnectionManager parent; ExampleNoProtocolsConnectionManagerPrivate *priv; }; GType example_no_protocols_connection_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER \ (example_no_protocols_connection_manager_get_type ()) #define EXAMPLE_NO_PROTOCOLS_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER, \ ExampleNoProtocolsConnectionManager)) #define EXAMPLE_NO_PROTOCOLS_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER, \ ExampleNoProtocolsConnectionManagerClass)) #define EXAMPLE_IS_NO_PROTOCOLS_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER)) #define EXAMPLE_IS_NO_PROTOCOLS_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER)) #define EXAMPLE_NO_PROTOCOLS_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER, \ ExampleNoProtocolsConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/no-protocols/Makefile.am0000644000175000017500000000260312652510705020345 00000000000000EXAMPLES = telepathy-example-no-protocols if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif telepathy_example_no_protocols_SOURCES = \ connection-manager.c \ connection-manager.h \ main.c if INSTALL_EXAMPLES servicedir = ${datadir}/dbus-1/services service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_no_protocols.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_no_protocols" && \ echo "Exec=${libexecdir}/telepathy-example-cm-no-protocols"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_no_protocols.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/cm/no-protocols/Makefile.in0000644000175000017500000006647614006601553020375 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/no-protocols ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-no-protocols$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) am_telepathy_example_no_protocols_OBJECTS = \ connection-manager.$(OBJEXT) main.$(OBJEXT) telepathy_example_no_protocols_OBJECTS = \ $(am_telepathy_example_no_protocols_OBJECTS) telepathy_example_no_protocols_LDADD = $(LDADD) am__DEPENDENCIES_1 = telepathy_example_no_protocols_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/connection-manager.Po \ ./$(DEPDIR)/main.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(telepathy_example_no_protocols_SOURCES) DIST_SOURCES = $(telepathy_example_no_protocols_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_no_protocols.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-no-protocols telepathy_example_no_protocols_SOURCES = \ connection-manager.c \ connection-manager.h \ main.c @INSTALL_EXAMPLES_TRUE@servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_no_protocols.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_no_protocols.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/no-protocols/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/no-protocols/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list telepathy-example-no-protocols$(EXEEXT): $(telepathy_example_no_protocols_OBJECTS) $(telepathy_example_no_protocols_DEPENDENCIES) $(EXTRA_telepathy_example_no_protocols_DEPENDENCIES) @rm -f telepathy-example-no-protocols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_no_protocols_OBJECTS) $(telepathy_example_no_protocols_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/connection-manager.Po -rm -f ./$(DEPDIR)/main.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/connection-manager.Po -rm -f ./$(DEPDIR)/main.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-dist_managerDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libexecPROGRAMS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-serviceDATA install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_no_protocols" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-no-protocols"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/no-protocols/main.c0000644000175000017500000000216212652510705017401 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "connection-manager.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_NO_PROTOCOLS_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-no-protocols", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/no-protocols/example_no_protocols.manager0000644000175000017500000000004012652510705024071 00000000000000[ConnectionManager] Interfaces= telepathy-glib-0.24.2/examples/cm/Makefile.am0000644000175000017500000000017012652510705015704 00000000000000SUBDIRS = \ call \ channelspecific \ contactlist \ echo-message-parts \ extended \ no-protocols telepathy-glib-0.24.2/examples/cm/Makefile.in0000644000175000017500000005025614006601553015724 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples/cm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ SUBDIRS = \ call \ channelspecific \ contactlist \ echo-message-parts \ extended \ no-protocols all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/contactlist/0000755000175000017500000000000014006623343016257 500000000000000telepathy-glib-0.24.2/examples/cm/contactlist/protocol.c0000644000175000017500000001136112652510705020210 00000000000000/* * protocol.c - an example Protocol * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "protocol.h" #include #include "conn.h" #include "contact-list.h" G_DEFINE_TYPE (ExampleContactListProtocol, example_contact_list_protocol, TP_TYPE_BASE_PROTOCOL) static void example_contact_list_protocol_init ( ExampleContactListProtocol *self) { } gboolean example_contact_list_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error) { g_return_val_if_fail (id != NULL, FALSE); if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return FALSE; } if (normal != NULL) *normal = g_utf8_normalize (id, -1, G_NORMALIZE_ALL_COMPOSE); return TRUE; } static gboolean account_param_filter (const TpCMParamSpec *paramspec, GValue *value, GError **error) { const gchar *id = g_value_get_string (value); return example_contact_list_protocol_check_contact_id (id, NULL, error); } static const TpCMParamSpec example_contact_list_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* no default */ 0, /* unused, formerly struct offset */ account_param_filter, NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { "simulation-delay", "u", G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GUINT_TO_POINTER (1000), /* default */ 0, /* unused, formerly struct offset */ NULL, /* no filter */ NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { NULL } }; static const TpCMParamSpec * get_parameters (TpBaseProtocol *self) { return example_contact_list_example_params; } static TpBaseConnection * new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { ExampleContactListConnection *conn; const gchar *account; guint sim_delay; account = tp_asv_get_string (asv, "account"); /* telepathy-glib checked this for us */ g_assert (account != NULL); sim_delay = tp_asv_get_uint32 (asv, "simulation-delay", NULL); conn = EXAMPLE_CONTACT_LIST_CONNECTION ( g_object_new (EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, "account", account, "protocol", tp_base_protocol_get_name (protocol), "simulation-delay", sim_delay, NULL)); return (TpBaseConnection *) conn; } static gchar * normalize_contact (TpBaseProtocol *self G_GNUC_UNUSED, const gchar *contact, GError **error) { gchar *normal; if (example_contact_list_protocol_check_contact_id (contact, &normal, error)) return normal; else return NULL; } static gchar * identify_account (TpBaseProtocol *self G_GNUC_UNUSED, GHashTable *asv, GError **error) { const gchar *account = tp_asv_get_string (asv, "account"); if (account != NULL) return normalize_contact (self, account, error); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'account' parameter not given"); return NULL; } static void get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED, GStrv *connection_interfaces, GType **channel_managers, gchar **icon_name, gchar **english_name, gchar **vcard_field) { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv ( (GStrv) example_contact_list_connection_get_possible_interfaces ()); } if (channel_managers != NULL) { GType types[] = { EXAMPLE_TYPE_CONTACT_LIST, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof (types)); } if (icon_name != NULL) *icon_name = g_strdup ("face-smile"); if (english_name != NULL) *english_name = g_strdup ("Example with a contact list"); if (vcard_field != NULL) *vcard_field = g_strdup ("x-telepathy-example"); } static void example_contact_list_protocol_class_init ( ExampleContactListProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) klass; base_class->get_parameters = get_parameters; base_class->new_connection = new_connection; base_class->normalize_contact = normalize_contact; base_class->identify_account = identify_account; base_class->get_connection_details = get_connection_details; } telepathy-glib-0.24.2/examples/cm/contactlist/protocol.h0000644000175000017500000000413612652510705020217 00000000000000/* * protocol.h - header for an example Protocol * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_CONTACT_LIST_PROTOCOL_H #define EXAMPLE_CONTACT_LIST_PROTOCOL_H #include #include G_BEGIN_DECLS typedef struct _ExampleContactListProtocol ExampleContactListProtocol; typedef struct _ExampleContactListProtocolPrivate ExampleContactListProtocolPrivate; typedef struct _ExampleContactListProtocolClass ExampleContactListProtocolClass; typedef struct _ExampleContactListProtocolClassPrivate ExampleContactListProtocolClassPrivate; struct _ExampleContactListProtocolClass { TpBaseProtocolClass parent_class; ExampleContactListProtocolClassPrivate *priv; }; struct _ExampleContactListProtocol { TpBaseProtocol parent; ExampleContactListProtocolPrivate *priv; }; GType example_contact_list_protocol_get_type (void); #define EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL \ (example_contact_list_protocol_get_type ()) #define EXAMPLE_CONTACT_LIST_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL, \ ExampleContactListProtocol)) #define EXAMPLE_CONTACT_LIST_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL, \ ExampleContactListProtocolClass)) #define EXAMPLE_IS_CONTACT_LIST_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL)) #define EXAMPLE_IS_CONTACT_LIST_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL)) #define EXAMPLE_CONTACT_LIST_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL, \ ExampleContactListProtocolClass)) gboolean example_contact_list_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/contactlist/connection-manager.c0000644000175000017500000000420512652510705022115 00000000000000/* * manager.c - an example connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "connection-manager.h" #include #include #include #include "conn.h" #include "protocol.h" G_DEFINE_TYPE (ExampleContactListConnectionManager, example_contact_list_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) struct _ExampleContactListConnectionManagerPrivate { int dummy; }; static void example_contact_list_connection_manager_init ( ExampleContactListConnectionManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER, ExampleContactListConnectionManagerPrivate); } static void example_contact_list_connection_manager_constructed (GObject *object) { ExampleContactListConnectionManager *self = EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) example_contact_list_connection_manager_parent_class)->constructed; TpBaseProtocol *protocol; if (constructed != NULL) constructed (object); protocol = g_object_new (EXAMPLE_TYPE_CONTACT_LIST_PROTOCOL, "name", "example", NULL); tp_base_connection_manager_add_protocol (base, protocol); g_object_unref (protocol); } static void example_contact_list_connection_manager_class_init ( ExampleContactListConnectionManagerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; g_type_class_add_private (klass, sizeof (ExampleContactListConnectionManagerPrivate)); object_class->constructed = example_contact_list_connection_manager_constructed; base_class->cm_dbus_name = "example_contact_list"; } telepathy-glib-0.24.2/examples/cm/contactlist/connection-manager.h0000644000175000017500000000453512652510705022130 00000000000000/* * manager.h - header for an example connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER_H__ #define __EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleContactListConnectionManager ExampleContactListConnectionManager; typedef struct _ExampleContactListConnectionManagerClass ExampleContactListConnectionManagerClass; typedef struct _ExampleContactListConnectionManagerPrivate ExampleContactListConnectionManagerPrivate; struct _ExampleContactListConnectionManagerClass { TpBaseConnectionManagerClass parent_class; }; struct _ExampleContactListConnectionManager { TpBaseConnectionManager parent; ExampleContactListConnectionManagerPrivate *priv; }; GType example_contact_list_connection_manager_get_type (void); #define EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER \ (example_contact_list_connection_manager_get_type ()) #define EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), \ EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER, \ ExampleContactListConnectionManager)) #define EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), \ EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER, \ ExampleContactListConnectionManagerClass)) #define EXAMPLE_IS_CONTACT_LIST_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), \ EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER)) #define EXAMPLE_IS_CONTACT_LIST_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), \ EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER)) #define EXAMPLE_CONTACT_LIST_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER, \ ExampleContactListConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/contactlist/conn.c0000644000175000017500000004422312652510705017307 00000000000000/* * conn.c - an example connection * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "conn.h" #include #include #include "contact-list.h" #include "protocol.h" static void init_aliasing (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (ExampleContactListConnection, example_contact_list_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_ALIASING, init_aliasing); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_LIST, tp_base_contact_list_mixin_list_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_GROUPS, tp_base_contact_list_mixin_groups_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACT_BLOCKING, tp_base_contact_list_mixin_blocking_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_PRESENCE, tp_presence_mixin_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_SIMPLE_PRESENCE, tp_presence_mixin_simple_presence_iface_init)) enum { PROP_ACCOUNT = 1, PROP_SIMULATION_DELAY, N_PROPS }; struct _ExampleContactListConnectionPrivate { gchar *account; guint simulation_delay; ExampleContactList *contact_list; gboolean away; }; static void example_contact_list_connection_init (ExampleContactListConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, ExampleContactListConnectionPrivate); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_value_dup_string (value); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); tp_contacts_mixin_finalize (object); g_free (self->priv->account); G_OBJECT_CLASS (example_contact_list_connection_parent_class)->finalize ( object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (conn); return g_strdup_printf ("%s@%p", self->priv->account, self); } gchar * example_contact_list_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { gchar *normal = NULL; if (example_contact_list_protocol_check_contact_id (id, &normal, error)) return normal; else return NULL; } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_contact_list_normalize_contact, NULL); } static void alias_updated_cb (ExampleContactList *contact_list, TpHandle contact, ExampleContactListConnection *self) { GPtrArray *aliases; GValueArray *pair; pair = tp_value_array_build (2, G_TYPE_UINT, contact, G_TYPE_STRING, example_contact_list_get_alias (contact_list, contact), G_TYPE_INVALID); aliases = g_ptr_array_sized_new (1); g_ptr_array_add (aliases, pair); tp_svc_connection_interface_aliasing_emit_aliases_changed (self, aliases); g_ptr_array_unref (aliases); tp_value_array_free (pair); } static void presence_updated_cb (ExampleContactList *contact_list, TpHandle contact, ExampleContactListConnection *self) { TpBaseConnection *base = (TpBaseConnection *) self; TpPresenceStatus *status; /* we ignore the presence indicated by the contact list for our own handle */ if (contact == tp_base_connection_get_self_handle (base)) return; status = tp_presence_status_new ( example_contact_list_get_presence (contact_list, contact), NULL); tp_presence_mixin_emit_one_presence_update ((GObject *) self, contact, status); tp_presence_status_free (status); } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (conn); GPtrArray *ret = g_ptr_array_sized_new (1); self->priv->contact_list = EXAMPLE_CONTACT_LIST (g_object_new ( EXAMPLE_TYPE_CONTACT_LIST, "connection", conn, "simulation-delay", self->priv->simulation_delay, NULL)); g_signal_connect (self->priv->contact_list, "alias-updated", G_CALLBACK (alias_updated_cb), self); g_signal_connect (self->priv->contact_list, "presence-updated", G_CALLBACK (presence_updated_cb), self); g_ptr_array_add (ret, self->priv->contact_list); return ret; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, error); if (self_handle == 0) return FALSE; tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static void aliasing_fill_contact_attributes (GObject *object, const GArray *contacts, GHashTable *attributes) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); guint i; for (i = 0; i < contacts->len; i++) { TpHandle contact = g_array_index (contacts, guint, i); tp_contacts_mixin_set_contact_attribute (attributes, contact, TP_TOKEN_CONNECTION_INTERFACE_ALIASING_ALIAS, tp_g_value_slice_new_string ( example_contact_list_get_alias (self->priv->contact_list, contact))); } } static void constructed (GObject *object) { TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (example_contact_list_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (ExampleContactListConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); tp_base_contact_list_mixin_register_with_contacts_mixin (base); tp_contacts_mixin_add_contact_attributes_iface (object, TP_IFACE_CONNECTION_INTERFACE_ALIASING, aliasing_fill_contact_attributes); tp_presence_mixin_init (object, G_STRUCT_OFFSET (ExampleContactListConnection, presence_mixin)); tp_presence_mixin_simple_presence_register_with_contacts_mixin (object); } static gboolean status_available (GObject *object, guint index_) { TpBaseConnection *base = TP_BASE_CONNECTION (object); return tp_base_connection_check_connected (base, NULL); } static GHashTable * get_contact_statuses (GObject *object, const GArray *contacts, GError **error) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); guint i; GHashTable *result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify) tp_presence_status_free); for (i = 0; i < contacts->len; i++) { TpHandle contact = g_array_index (contacts, guint, i); ExampleContactListPresence presence; GHashTable *parameters; /* we get our own status from the connection, and everyone else's status * from the contact lists */ if (contact == tp_base_connection_get_self_handle (base)) { presence = (self->priv->away ? EXAMPLE_CONTACT_LIST_PRESENCE_AWAY : EXAMPLE_CONTACT_LIST_PRESENCE_AVAILABLE); } else { presence = example_contact_list_get_presence ( self->priv->contact_list, contact); } parameters = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (result, GUINT_TO_POINTER (contact), tp_presence_status_new (presence, parameters)); g_hash_table_unref (parameters); } return result; } static gboolean set_own_status (GObject *object, const TpPresenceStatus *status, GError **error) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (object); TpBaseConnection *base = TP_BASE_CONNECTION (object); GHashTable *presences; if (status->index == EXAMPLE_CONTACT_LIST_PRESENCE_AWAY) { if (self->priv->away) return TRUE; self->priv->away = TRUE; } else { if (!self->priv->away) return TRUE; self->priv->away = FALSE; } presences = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); g_hash_table_insert (presences, GUINT_TO_POINTER (tp_base_connection_get_self_handle (base)), (gpointer) status); tp_presence_mixin_emit_presence_update (object, presences); g_hash_table_unref (presences); return TRUE; } static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_ALIASING, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST, TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS, TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING, TP_IFACE_CONNECTION_INTERFACE_PRESENCE, TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, NULL }; const gchar * const * example_contact_list_connection_get_possible_interfaces (void) { /* in this example CM we don't have any extra interfaces that are sometimes, * but not always, present */ return interfaces_always_present; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( example_contact_list_connection_parent_class)->get_interfaces_always_present ( base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void example_contact_list_connection_class_init ( ExampleContactListConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->get_property = get_property; object_class->set_property = set_property; object_class->constructed = constructed; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (ExampleContactListConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_managers = create_channel_managers; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleContactListConnectionClass, contacts_mixin)); tp_presence_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleContactListConnectionClass, presence_mixin), status_available, get_contact_statuses, set_own_status, example_contact_list_presence_statuses ()); tp_presence_mixin_simple_presence_init_dbus_properties (object_class); tp_base_contact_list_mixin_class_init (base_class); } static void get_alias_flags (TpSvcConnectionInterfaceAliasing *aliasing, DBusGMethodInvocation *context) { TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); tp_svc_connection_interface_aliasing_return_from_get_alias_flags (context, TP_CONNECTION_ALIAS_FLAG_USER_SET); } static void get_aliases (TpSvcConnectionInterfaceAliasing *aliasing, const GArray *contacts, DBusGMethodInvocation *context) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GHashTable *result; GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, NULL); for (i = 0; i < contacts->len; i++) { TpHandle contact = g_array_index (contacts, TpHandle, i); const gchar *alias = example_contact_list_get_alias ( self->priv->contact_list, contact); g_hash_table_insert (result, GUINT_TO_POINTER (contact), (gchar *) alias); } tp_svc_connection_interface_aliasing_return_from_get_aliases (context, result); g_hash_table_unref (result); } static void request_aliases (TpSvcConnectionInterfaceAliasing *aliasing, const GArray *contacts, DBusGMethodInvocation *context) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GPtrArray *result; gchar **strings; GError *error = NULL; guint i; TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED (base, context); if (!tp_handles_are_valid (contact_repo, contacts, FALSE, &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } result = g_ptr_array_sized_new (contacts->len + 1); for (i = 0; i < contacts->len; i++) { TpHandle contact = g_array_index (contacts, TpHandle, i); const gchar *alias = example_contact_list_get_alias ( self->priv->contact_list, contact); g_ptr_array_add (result, (gchar *) alias); } g_ptr_array_add (result, NULL); strings = (gchar **) g_ptr_array_free (result, FALSE); tp_svc_connection_interface_aliasing_return_from_request_aliases (context, (const gchar **) strings); g_free (strings); } static void set_aliases (TpSvcConnectionInterfaceAliasing *aliasing, GHashTable *aliases, DBusGMethodInvocation *context) { ExampleContactListConnection *self = EXAMPLE_CONTACT_LIST_CONNECTION (aliasing); TpBaseConnection *base = TP_BASE_CONNECTION (aliasing); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (base, TP_HANDLE_TYPE_CONTACT); GHashTableIter iter; gpointer key, value; g_hash_table_iter_init (&iter, aliases); while (g_hash_table_iter_next (&iter, &key, &value)) { GError *error = NULL; if (!tp_handle_is_valid (contact_repo, GPOINTER_TO_UINT (key), &error)) { dbus_g_method_return_error (context, error); g_error_free (error); return; } } g_hash_table_iter_init (&iter, aliases); while (g_hash_table_iter_next (&iter, &key, &value)) { example_contact_list_set_alias (self->priv->contact_list, GPOINTER_TO_UINT (key), value); } tp_svc_connection_interface_aliasing_return_from_set_aliases (context); } static void init_aliasing (gpointer iface, gpointer iface_data G_GNUC_UNUSED) { TpSvcConnectionInterfaceAliasingClass *klass = iface; #define IMPLEMENT(x) tp_svc_connection_interface_aliasing_implement_##x (\ klass, x) IMPLEMENT(get_alias_flags); IMPLEMENT(request_aliases); IMPLEMENT(get_aliases); IMPLEMENT(set_aliases); #undef IMPLEMENT } telepathy-glib-0.24.2/examples/cm/contactlist/conn.h0000644000175000017500000000450512652510705017313 00000000000000/* * conn.h - header for an example connection * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CONTACT_LIST_CONN_H__ #define __EXAMPLE_CONTACT_LIST_CONN_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleContactListConnection ExampleContactListConnection; typedef struct _ExampleContactListConnectionClass ExampleContactListConnectionClass; typedef struct _ExampleContactListConnectionPrivate ExampleContactListConnectionPrivate; struct _ExampleContactListConnectionClass { TpBaseConnectionClass parent_class; TpPresenceMixinClass presence_mixin; TpContactsMixinClass contacts_mixin; }; struct _ExampleContactListConnection { TpBaseConnection parent; TpPresenceMixin presence_mixin; TpContactsMixin contacts_mixin; ExampleContactListConnectionPrivate *priv; }; GType example_contact_list_connection_get_type (void); #define EXAMPLE_TYPE_CONTACT_LIST_CONNECTION \ (example_contact_list_connection_get_type ()) #define EXAMPLE_CONTACT_LIST_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, \ ExampleContactListConnection)) #define EXAMPLE_CONTACT_LIST_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, \ ExampleContactListConnectionClass)) #define EXAMPLE_IS_CONTACT_LIST_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CONTACT_LIST_CONNECTION)) #define EXAMPLE_IS_CONTACT_LIST_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CONTACT_LIST_CONNECTION)) #define EXAMPLE_CONTACT_LIST_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CONTACT_LIST_CONNECTION, \ ExampleContactListConnectionClass)) gchar *example_contact_list_normalize_contact (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error); const gchar * const * example_contact_list_connection_get_possible_interfaces ( void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/contactlist/contact-list.c0000644000175000017500000015044412652510705020761 00000000000000/* * Example implementation of TpBaseContactList. * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include "contact-list.h" #include #include #include /* this array must be kept in sync with the enum * ExampleContactListPresence in contact-list.h */ static const TpPresenceStatusSpec _statuses[] = { { "offline", TP_CONNECTION_PRESENCE_TYPE_OFFLINE, FALSE, NULL }, { "unknown", TP_CONNECTION_PRESENCE_TYPE_UNKNOWN, FALSE, NULL }, { "error", TP_CONNECTION_PRESENCE_TYPE_ERROR, FALSE, NULL }, { "away", TP_CONNECTION_PRESENCE_TYPE_AWAY, TRUE, NULL }, { "available", TP_CONNECTION_PRESENCE_TYPE_AVAILABLE, TRUE, NULL }, { NULL } }; const TpPresenceStatusSpec * example_contact_list_presence_statuses (void) { return _statuses; } typedef struct { gchar *alias; guint subscribe:1; guint publish:1; guint pre_approved:1; guint subscribe_requested:1; guint subscribe_rejected:1; /* string borrowed from priv->all_tags => the same pointer */ GHashTable *tags; } ExampleContactDetails; static ExampleContactDetails * example_contact_details_new (void) { return g_slice_new0 (ExampleContactDetails); } static void example_contact_details_destroy (gpointer p) { ExampleContactDetails *d = p; tp_clear_pointer (&d->tags, g_hash_table_unref); g_free (d->alias); g_slice_free (ExampleContactDetails, d); } static void mutable_contact_list_iface_init (TpMutableContactListInterface *); static void blockable_contact_list_iface_init ( TpBlockableContactListInterface *); static void contact_group_list_iface_init (TpContactGroupListInterface *); static void mutable_contact_group_list_iface_init ( TpMutableContactGroupListInterface *); G_DEFINE_TYPE_WITH_CODE (ExampleContactList, example_contact_list, TP_TYPE_BASE_CONTACT_LIST, G_IMPLEMENT_INTERFACE (TP_TYPE_BLOCKABLE_CONTACT_LIST, blockable_contact_list_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_CONTACT_GROUP_LIST, contact_group_list_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, mutable_contact_group_list_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_MUTABLE_CONTACT_LIST, mutable_contact_list_iface_init)) enum { ALIAS_UPDATED, PRESENCE_UPDATED, N_SIGNALS }; static guint signals[N_SIGNALS] = { 0 }; enum { PROP_SIMULATION_DELAY = 1, N_PROPS }; struct _ExampleContactListPrivate { TpBaseConnection *conn; guint simulation_delay; TpHandleRepoIface *contact_repo; /* g_strdup (group name) => the same pointer */ GHashTable *all_tags; /* All contacts on our (fake) protocol-level contact list, * plus all contacts in publish_requests or cancelled_publish_requests */ TpHandleSet *contacts; /* All contacts on our (fake) protocol-level contact list * GUINT_TO_POINTER (handle borrowed from contacts) * => ExampleContactDetails */ GHashTable *contact_details; /* Contacts with an outstanding request for presence publication * (may or may not be in contact_details) * handle borrowed from contacts => g_strdup (message) */ GHashTable *publish_requests; /* Contacts who have requested presence but then cancelled their request * (may or may not be in contact_details) */ TpHandleSet *cancelled_publish_requests; TpHandleSet *blocked_contacts; gulong status_changed_id; }; static void example_contact_list_init (ExampleContactList *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CONTACT_LIST, ExampleContactListPrivate); self->priv->contact_details = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, example_contact_details_destroy); self->priv->publish_requests = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); self->priv->all_tags = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); /* initialized properly in constructed() */ self->priv->contact_repo = NULL; self->priv->contacts = NULL; self->priv->blocked_contacts = NULL; self->priv->cancelled_publish_requests = NULL; } static void example_contact_list_close_all (ExampleContactList *self) { tp_clear_pointer (&self->priv->contacts, tp_handle_set_destroy); tp_clear_pointer (&self->priv->blocked_contacts, tp_handle_set_destroy); tp_clear_pointer (&self->priv->cancelled_publish_requests, tp_handle_set_destroy); tp_clear_pointer (&self->priv->publish_requests, g_hash_table_unref); tp_clear_pointer (&self->priv->contact_details, g_hash_table_unref); /* this must come after freeing contact_details, because the strings are * borrowed */ tp_clear_pointer (&self->priv->all_tags, g_hash_table_unref); if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } } static void dispose (GObject *object) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (object); example_contact_list_close_all (self); ((GObjectClass *) example_contact_list_parent_class)->dispose ( object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (object); switch (property_id) { case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (object); switch (property_id) { case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static ExampleContactDetails * lookup_contact (ExampleContactList *self, TpHandle contact) { return g_hash_table_lookup (self->priv->contact_details, GUINT_TO_POINTER (contact)); } static ExampleContactDetails * ensure_contact (ExampleContactList *self, TpHandle contact, gboolean *created) { ExampleContactDetails *ret = lookup_contact (self, contact); if (ret == NULL) { tp_handle_set_add (self->priv->contacts, contact); ret = example_contact_details_new (); ret->alias = g_strdup (tp_handle_inspect (self->priv->contact_repo, contact)); g_hash_table_insert (self->priv->contact_details, GUINT_TO_POINTER (contact), ret); /* if we already had a publish request from them, then adding them to * the protocol-level contact list doesn't alter the Telepathy contact * list */ if (created != NULL) { *created = (g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (contact)) == NULL); } } else if (created != NULL) { *created = FALSE; } return ret; } static gchar * ensure_tag (ExampleContactList *self, const gchar *s, gboolean emit_signal) { gchar *r = g_hash_table_lookup (self->priv->all_tags, s); if (r == NULL) { g_message ("creating group %s", s); r = g_strdup (s); g_hash_table_insert (self->priv->all_tags, r, r); if (emit_signal) tp_base_contact_list_groups_created ((TpBaseContactList *) self, &s, 1); } return r; } static void example_contact_list_set_contact_groups_async (TpBaseContactList *contact_list, TpHandle contact, const gchar * const *names, gsize n, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); gboolean created; gsize i; ExampleContactDetails *d; GPtrArray *old_names, *new_names; GHashTableIter iter; gpointer k; for (i = 0; i < n; i++) ensure_tag (self, names[i], FALSE); tp_base_contact_list_groups_created (contact_list, names, n); d = ensure_contact (self, contact, &created); if (created) tp_base_contact_list_one_contact_changed (contact_list, contact); if (d->tags == NULL) d->tags = g_hash_table_new (g_str_hash, g_str_equal); old_names = g_ptr_array_sized_new (g_hash_table_size (d->tags)); new_names = g_ptr_array_sized_new (n); for (i = 0; i < n; i++) { if (g_hash_table_lookup (d->tags, names[i]) == NULL) { gchar *tag = g_hash_table_lookup (self->priv->all_tags, names[i]); g_assert (tag != NULL); /* already ensured to exist, above */ g_hash_table_insert (d->tags, tag, tag); g_ptr_array_add (new_names, tag); } } g_hash_table_iter_init (&iter, d->tags); while (g_hash_table_iter_next (&iter, &k, NULL)) { for (i = 0; i < n; i++) { if (!tp_strdiff (names[i], k)) goto next_hash_element; } /* not found in @names, so remove it */ g_ptr_array_add (old_names, k); g_hash_table_iter_remove (&iter); next_hash_element: continue; } tp_base_contact_list_one_contact_groups_changed (contact_list, contact, (const gchar * const *) new_names->pdata, new_names->len, (const gchar * const *) old_names->pdata, old_names->len); g_ptr_array_unref (old_names); g_ptr_array_unref (new_names); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_set_contact_groups_async); } static gboolean receive_contact_lists (gpointer p) { TpBaseContactList *contact_list = p; ExampleContactList *self = p; TpHandle handle; gchar *cambridge, *montreal, *francophones; ExampleContactDetails *d; GHashTableIter iter; gpointer handle_p; if (self->priv->all_tags == NULL) { /* connection already disconnected, so don't process the * "data from the server" */ return FALSE; } /* In a real CM we'd have received a contact list from the server at this * point. But this isn't a real CM, so we have to make one up... */ g_message ("Receiving roster from server"); cambridge = ensure_tag (self, "Cambridge", FALSE); montreal = ensure_tag (self, "Montreal", FALSE); francophones = ensure_tag (self, "Francophones", FALSE); /* Add various people who are already subscribing and publishing */ handle = tp_handle_ensure (self->priv->contact_repo, "sjoerd@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Sjoerd"); d->subscribe = TRUE; d->publish = TRUE; d->tags = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (d->tags, cambridge, cambridge); handle = tp_handle_ensure (self->priv->contact_repo, "guillaume@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Guillaume"); d->subscribe = TRUE; d->publish = TRUE; d->tags = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (d->tags, cambridge, cambridge); g_hash_table_insert (d->tags, francophones, francophones); handle = tp_handle_ensure (self->priv->contact_repo, "olivier@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Olivier"); d->subscribe = TRUE; d->publish = TRUE; d->tags = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (d->tags, montreal, montreal); g_hash_table_insert (d->tags, francophones, francophones); handle = tp_handle_ensure (self->priv->contact_repo, "travis@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Travis"); d->subscribe = TRUE; d->publish = TRUE; /* Add a couple of people whose presence we've requested. They are * remote-pending in subscribe */ handle = tp_handle_ensure (self->priv->contact_repo, "geraldine@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Géraldine"); d->subscribe_requested = TRUE; d->tags = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (d->tags, cambridge, cambridge); g_hash_table_insert (d->tags, francophones, francophones); handle = tp_handle_ensure (self->priv->contact_repo, "helen@example.com", NULL, NULL); d = ensure_contact (self, handle, NULL); g_free (d->alias); d->alias = g_strdup ("Helen"); d->subscribe_requested = TRUE; d->tags = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_insert (d->tags, cambridge, cambridge); /* Receive a couple of authorization requests too. These people are * local-pending in publish; they're not actually on our protocol-level * contact list */ handle = tp_handle_ensure (self->priv->contact_repo, "wim@example.com", NULL, NULL); tp_handle_set_add (self->priv->contacts, handle); g_hash_table_insert (self->priv->publish_requests, GUINT_TO_POINTER (handle), g_strdup ("I'm more metal than you!")); handle = tp_handle_ensure (self->priv->contact_repo, "christian@example.com", NULL, NULL); tp_handle_set_add (self->priv->contacts, handle); g_hash_table_insert (self->priv->publish_requests, GUINT_TO_POINTER (handle), g_strdup ("I have some fermented herring for you")); /* Add a couple of blocked contacts. */ handle = tp_handle_ensure (self->priv->contact_repo, "bill@example.com", NULL, NULL); tp_handle_set_add (self->priv->blocked_contacts, handle); handle = tp_handle_ensure (self->priv->contact_repo, "steve@example.com", NULL, NULL); tp_handle_set_add (self->priv->blocked_contacts, handle); g_hash_table_iter_init (&iter, self->priv->contact_details); /* emit initial aliases, presences */ while (g_hash_table_iter_next (&iter, &handle_p, NULL)) { handle = GPOINTER_TO_UINT (handle_p); g_signal_emit (self, signals[ALIAS_UPDATED], 0, handle); g_signal_emit (self, signals[PRESENCE_UPDATED], 0, handle); } /* ... and off we go */ tp_base_contact_list_set_list_received (contact_list); return FALSE; } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, ExampleContactList *self) { switch (status) { case TP_CONNECTION_STATUS_CONNECTED: { /* Do network I/O to get the contact list. This connection manager * doesn't really have a server, so simulate a small network delay * then invent a contact list */ tp_base_contact_list_set_list_pending ((TpBaseContactList *) self); g_timeout_add_full (G_PRIORITY_DEFAULT, 2 * self->priv->simulation_delay, receive_contact_lists, g_object_ref (self), g_object_unref); } break; case TP_CONNECTION_STATUS_DISCONNECTED: { example_contact_list_close_all (self); tp_clear_object (&self->priv->conn); } break; } } static void constructed (GObject *object) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_contact_list_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } g_object_get (self, "connection", &self->priv->conn, NULL); g_assert (self->priv->conn != NULL); self->priv->contact_repo = tp_base_connection_get_handles (self->priv->conn, TP_HANDLE_TYPE_CONTACT); self->priv->contacts = tp_handle_set_new (self->priv->contact_repo); self->priv->blocked_contacts = tp_handle_set_new (self->priv->contact_repo); self->priv->cancelled_publish_requests = tp_handle_set_new ( self->priv->contact_repo); self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); } static void send_updated_roster (ExampleContactList *self, TpHandle contact) { ExampleContactDetails *d = g_hash_table_lookup (self->priv->contact_details, GUINT_TO_POINTER (contact)); const gchar *request = g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (contact)); const gchar *identifier = tp_handle_inspect (self->priv->contact_repo, contact); /* In a real connection manager, we'd transmit these new details to the * server, rather than just printing messages. */ if (d == NULL) { g_message ("Deleting contact %s from server", identifier); } else { g_message ("Transmitting new state of contact %s to server", identifier); g_message ("\talias = %s", d->alias); g_message ("\tcan see our presence = %s", d->publish ? "yes" : (request != NULL ? "no, but has requested it" : "no")); g_message ("\tsends us presence = %s", d->subscribe ? "yes" : (d->subscribe_requested ? "no, but we have requested it" : (d->subscribe_rejected ? "no, request refused" : "no"))); if (d->tags == NULL || g_hash_table_size (d->tags) == 0) { g_message ("\tnot in any groups"); } else { GHashTableIter iter; gpointer k; g_hash_table_iter_init (&iter, d->tags); while (g_hash_table_iter_next (&iter, &k, NULL)) { g_message ("\tin group: %s", (gchar *) k); } } } } static void example_contact_list_set_group_members_async (TpBaseContactList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *new_contacts = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *added = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *removed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; gchar *tag = ensure_tag (self, group, TRUE); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { gboolean created = FALSE, updated = FALSE; ExampleContactDetails *d = ensure_contact (self, member, &created); if (created) tp_handle_set_add (new_contacts, member); if (d->tags == NULL) d->tags = g_hash_table_new (g_str_hash, g_str_equal); if (g_hash_table_lookup (d->tags, tag) == NULL) { g_hash_table_insert (d->tags, tag, tag); updated = TRUE; } if (created || updated) { send_updated_roster (self, member); tp_handle_set_add (added, member); } } tp_intset_fast_iter_init (&iter, tp_handle_set_peek (self->priv->contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d; if (tp_handle_set_is_member (contacts, member)) continue; d = lookup_contact (self, member); if (d != NULL && d->tags != NULL && g_hash_table_remove (d->tags, group)) tp_handle_set_add (removed, member); } if (!tp_handle_set_is_empty (new_contacts)) tp_base_contact_list_contacts_changed (contact_list, new_contacts, NULL); if (!tp_handle_set_is_empty (added)) tp_base_contact_list_groups_changed (contact_list, added, &group, 1, NULL, 0); if (!tp_handle_set_is_empty (removed)) tp_base_contact_list_groups_changed (contact_list, removed, NULL, 0, &group, 1); tp_handle_set_destroy (added); tp_handle_set_destroy (removed); tp_handle_set_destroy (new_contacts); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_set_group_members_async); } static void example_contact_list_add_to_group_async (TpBaseContactList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *new_contacts = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *new_to_group = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; gchar *tag = ensure_tag (self, group, TRUE); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { gboolean created = FALSE, updated = FALSE; ExampleContactDetails *d = ensure_contact (self, member, &created); if (created) tp_handle_set_add (new_contacts, member); if (d->tags == NULL) d->tags = g_hash_table_new (g_str_hash, g_str_equal); if (g_hash_table_lookup (d->tags, tag) == NULL) { g_hash_table_insert (d->tags, tag, tag); updated = TRUE; } if (created || updated) { send_updated_roster (self, member); tp_handle_set_add (new_to_group, member); } } if (!tp_handle_set_is_empty (new_contacts)) tp_base_contact_list_contacts_changed (contact_list, new_contacts, NULL); if (!tp_handle_set_is_empty (new_to_group)) tp_base_contact_list_groups_changed (contact_list, new_to_group, &group, 1, NULL, 0); tp_handle_set_destroy (new_to_group); tp_handle_set_destroy (new_contacts); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_add_to_group_async); } static void example_contact_list_remove_from_group_async (TpBaseContactList *contact_list, const gchar *group, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = lookup_contact (self, member); /* If not on the roster or not in any groups, we have nothing to do */ if (d != NULL && d->tags != NULL && g_hash_table_remove (d->tags, group)) { send_updated_roster (self, member); tp_handle_set_add (changed, member); } } if (!tp_handle_set_is_empty (changed)) tp_base_contact_list_groups_changed (contact_list, changed, NULL, 0, &group, 1); tp_handle_set_destroy (changed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_remove_from_group_async); } typedef struct { ExampleContactList *self; TpHandle contact; } SelfAndContact; static SelfAndContact * self_and_contact_new (ExampleContactList *self, TpHandle contact) { SelfAndContact *ret = g_slice_new0 (SelfAndContact); ret->self = g_object_ref (self); ret->contact = contact; return ret; } static void self_and_contact_destroy (gpointer p) { SelfAndContact *s = p; g_object_unref (s->self); g_slice_free (SelfAndContact, s); } static void receive_auth_request (ExampleContactList *self, TpHandle contact) { ExampleContactDetails *d; /* if shutting down, do nothing */ if (self->priv->conn == NULL) return; /* A remote contact has asked to see our presence. * * In a real connection manager this would be the result of incoming * data from the server. */ g_message ("From server: %s has sent us a publish request", tp_handle_inspect (self->priv->contact_repo, contact)); d = lookup_contact (self, contact); if (d != NULL && d->publish) return; if (d != NULL && d->pre_approved) { /* the user already said yes, no need to signal anything */ g_message ("... this publish request was already approved"); d->pre_approved = FALSE; d->publish = TRUE; g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (contact)); tp_handle_set_remove (self->priv->cancelled_publish_requests, contact); send_updated_roster (self, contact); } else { tp_handle_set_add (self->priv->contacts, contact); g_hash_table_insert (self->priv->publish_requests, GUINT_TO_POINTER (contact), g_strdup ("May I see your presence, please?")); } tp_base_contact_list_one_contact_changed ((TpBaseContactList *) self, contact); /* If the contact has a name ending with "@cancel.something", they * immediately take it back; this is mainly for the regression test. */ if (strstr (tp_handle_inspect (self->priv->contact_repo, contact), "@cancel.") != NULL) { g_message ("From server: %s has cancelled their publish request", tp_handle_inspect (self->priv->contact_repo, contact)); if (d) { d->publish = FALSE; d->pre_approved = FALSE; } g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (contact)); tp_handle_set_add (self->priv->cancelled_publish_requests, contact); tp_base_contact_list_one_contact_changed ((TpBaseContactList *) self, contact); } } static gboolean receive_authorized (gpointer p) { SelfAndContact *s = p; ExampleContactDetails *d; /* if shutting down, do nothing */ if (s->self->priv->conn == NULL) return FALSE; /* A remote contact has accepted our request to see their presence. * * In a real connection manager this would be the result of incoming * data from the server. */ g_message ("From server: %s has accepted our subscribe request", tp_handle_inspect (s->self->priv->contact_repo, s->contact)); d = ensure_contact (s->self, s->contact, NULL); /* if we were already subscribed to them, then nothing really happened */ if (d->subscribe) return FALSE; d->subscribe_requested = FALSE; d->subscribe_rejected = FALSE; d->subscribe = TRUE; tp_base_contact_list_one_contact_changed ((TpBaseContactList *) s->self, s->contact); /* their presence changes to something other than UNKNOWN */ g_signal_emit (s->self, signals[PRESENCE_UPDATED], 0, s->contact); /* if we're not publishing to them, also pretend they have asked us to * do so */ if (!d->publish) { receive_auth_request (s->self, s->contact); } return FALSE; } static gboolean receive_unauthorized (gpointer p) { SelfAndContact *s = p; ExampleContactDetails *d; /* if shutting down, do nothing */ if (s->self->priv->conn == NULL) return FALSE; /* A remote contact has rejected our request to see their presence. * * In a real connection manager this would be the result of incoming * data from the server. */ g_message ("From server: %s has rejected our subscribe request", tp_handle_inspect (s->self->priv->contact_repo, s->contact)); d = ensure_contact (s->self, s->contact, NULL); if (!d->subscribe && !d->subscribe_requested) return FALSE; d->subscribe_requested = FALSE; d->subscribe_rejected = TRUE; d->subscribe = FALSE; tp_base_contact_list_one_contact_changed ((TpBaseContactList *) s->self, s->contact); /* their presence changes to UNKNOWN */ g_signal_emit (s->self, signals[PRESENCE_UPDATED], 0, s->contact); return FALSE; } static gboolean auth_request_cb (gpointer p) { SelfAndContact *s = p; receive_auth_request (s->self, s->contact); return FALSE; } ExampleContactListPresence example_contact_list_get_presence (ExampleContactList *self, TpHandle contact) { ExampleContactDetails *d = lookup_contact (self, contact); const gchar *id; if (d == NULL || !d->subscribe) { /* we don't know the presence of people not on the subscribe list, * by definition */ return EXAMPLE_CONTACT_LIST_PRESENCE_UNKNOWN; } id = tp_handle_inspect (self->priv->contact_repo, contact); /* In this example CM, we fake contacts' presence based on their name: * contacts in the first half of the alphabet are available, the rest * (including non-alphabetic and non-ASCII initial letters) are away. */ if ((id[0] >= 'A' && id[0] <= 'M') || (id[0] >= 'a' && id[0] <= 'm')) { return EXAMPLE_CONTACT_LIST_PRESENCE_AVAILABLE; } return EXAMPLE_CONTACT_LIST_PRESENCE_AWAY; } const gchar * example_contact_list_get_alias (ExampleContactList *self, TpHandle contact) { ExampleContactDetails *d = lookup_contact (self, contact); if (d == NULL) { /* we don't have a user-defined alias for people not on the roster */ return tp_handle_inspect (self->priv->contact_repo, contact); } return d->alias; } void example_contact_list_set_alias (ExampleContactList *self, TpHandle contact, const gchar *alias) { gboolean created; ExampleContactDetails *d; gchar *old; /* if shutting down, do nothing */ if (self->priv->conn == NULL) return; d = ensure_contact (self, contact, &created); if (created) { tp_base_contact_list_one_contact_changed ( (TpBaseContactList *) self, contact); } /* FIXME: if stored list hasn't been retrieved yet, queue the change for * later */ old = d->alias; d->alias = g_strdup (alias); if (created || tp_strdiff (old, alias)) send_updated_roster (self, contact); g_free (old); } static TpHandleSet * example_contact_list_dup_contacts (TpBaseContactList *contact_list) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); return tp_handle_set_copy (self->priv->contacts); } static TpHandleSet * example_contact_list_dup_group_members (TpBaseContactList *contact_list, const gchar *group) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpIntsetFastIter iter; TpHandle member; TpHandleSet *members = tp_handle_set_new (self->priv->contact_repo); tp_intset_fast_iter_init (&iter, tp_handle_set_peek (self->priv->contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = lookup_contact (self, member); if (d != NULL && d->tags != NULL && g_hash_table_lookup_extended (d->tags, group, NULL, NULL)) tp_handle_set_add (members, member); } return members; } static const ExampleContactDetails no_details = { NULL, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }; static inline TpSubscriptionState compose_presence (gboolean full, gboolean ask, gboolean removed_remotely) { if (full) return TP_SUBSCRIPTION_STATE_YES; else if (ask) return TP_SUBSCRIPTION_STATE_ASK; else if (removed_remotely) return TP_SUBSCRIPTION_STATE_REMOVED_REMOTELY; else return TP_SUBSCRIPTION_STATE_NO; } static void example_contact_list_dup_states (TpBaseContactList *contact_list, TpHandle contact, TpSubscriptionState *subscribe, TpSubscriptionState *publish, gchar **publish_request) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); const ExampleContactDetails *details = lookup_contact (self, contact); const gchar *request = g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (contact)); if (details == NULL) details = &no_details; if (subscribe != NULL) *subscribe = compose_presence (details->subscribe, details->subscribe_requested, details->subscribe_rejected); if (publish != NULL) *publish = compose_presence (details->publish, (request != NULL), tp_handle_set_is_member (self->priv->cancelled_publish_requests, contact)); if (publish_request != NULL) *publish_request = g_strdup (request); } static void example_contact_list_request_subscription_async ( TpBaseContactList *contact_list, TpHandleSet *contacts, const gchar *message, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { gboolean created; ExampleContactDetails *d = ensure_contact (self, member, &created); gchar *message_lc; /* if they already authorized us, it's a no-op */ if (d->subscribe) continue; /* In a real connection manager we'd start a network request here */ g_message ("Transmitting authorization request to %s: %s", tp_handle_inspect (self->priv->contact_repo, member), message); tp_handle_set_add (changed, member); d->subscribe_rejected = FALSE; d->subscribe_requested = TRUE; send_updated_roster (self, member); /* Pretend that after a delay, the contact notices the request * and allows or rejects it. In this example connection manager, * empty requests are allowed, as are requests that contain "please" * case-insensitively. All other requests are denied. */ message_lc = g_ascii_strdown (message, -1); if (message[0] == '\0' || strstr (message_lc, "please") != NULL) { g_timeout_add_full (G_PRIORITY_LOW, self->priv->simulation_delay, receive_authorized, self_and_contact_new (self, member), self_and_contact_destroy); } else { g_timeout_add_full (G_PRIORITY_LOW, self->priv->simulation_delay, receive_unauthorized, self_and_contact_new (self, member), self_and_contact_destroy); } g_free (message_lc); } tp_base_contact_list_contacts_changed (contact_list, changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_request_subscription_async); } static void example_contact_list_authorize_publication_async ( TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = ensure_contact (self, member, NULL); const gchar *request = g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (member)); if (tp_handle_set_remove (self->priv->cancelled_publish_requests, member)) tp_handle_set_add (changed, member); /* We would like member to see our presence. In this simulated protocol, * this is meaningless, unless they have asked for it; but we can still * remember the pre-authorization in case they ask later. */ if (request == NULL) { d->pre_approved = TRUE; } else if (!d->publish) { d->publish = TRUE; g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (member)); send_updated_roster (self, member); tp_handle_set_add (changed, member); } } tp_base_contact_list_contacts_changed (contact_list, changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_authorize_publication_async); } static void example_contact_list_store_contacts_async ( TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { /* We would like member to be on the roster, but nothing more. */ if (lookup_contact (self, member) == NULL) { gboolean created; ensure_contact (self, member, &created); send_updated_roster (self, member); /* If we'd had a publish request from this member, then adding them * to the protocol-level contact list doesn't actually cause a * state change visible on Telepathy. */ if (created) tp_handle_set_add (changed, member); } } tp_base_contact_list_contacts_changed (contact_list, changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_store_contacts_async); } static void example_contact_list_remove_contacts_async (TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *removed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { /* we would like to remove member from the roster altogether */ if (lookup_contact (self, member) != NULL || g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (member)) != NULL || tp_handle_set_is_member (self->priv->cancelled_publish_requests, member)) { tp_handle_set_add (removed, member); g_hash_table_remove (self->priv->contact_details, GUINT_TO_POINTER (member)); g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (member)); tp_handle_set_remove (self->priv->contacts, member); tp_handle_set_remove (self->priv->cancelled_publish_requests, member); send_updated_roster (self, member); /* since they're no longer on the subscribe list, we can't * see their presence, so emit a signal changing it to * UNKNOWN */ g_signal_emit (self, signals[PRESENCE_UPDATED], 0, member); } } tp_base_contact_list_contacts_changed (contact_list, NULL, removed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_remove_contacts_async); } static void example_contact_list_unsubscribe_async (TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = lookup_contact (self, member); /* we would like to avoid receiving member's presence any more, * or we would like to cancel an outstanding request for their * presence */ if (d != NULL) { if (d->subscribe_requested) { g_message ("Cancelling our authorization request to %s", tp_handle_inspect (self->priv->contact_repo, member)); d->subscribe_requested = FALSE; tp_handle_set_add (changed, member); send_updated_roster (self, member); } else if (d->subscribe_rejected) { g_message ("Forgetting rejected authorization request to %s", tp_handle_inspect (self->priv->contact_repo, member)); d->subscribe_rejected = FALSE; tp_handle_set_add (changed, member); send_updated_roster (self, member); } else if (d->subscribe) { g_message ("We no longer want presence from %s", tp_handle_inspect (self->priv->contact_repo, member)); d->subscribe = FALSE; /* since they're no longer on the subscribe list, we can't * see their presence, so emit a signal changing it to * UNKNOWN */ g_signal_emit (self, signals[PRESENCE_UPDATED], 0, member); tp_handle_set_add (changed, member); send_updated_roster (self, member); } } } tp_base_contact_list_contacts_changed (contact_list, changed, NULL); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unsubscribe_async); } static void example_contact_list_unpublish_async (TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpHandleSet *removed = tp_handle_set_new (self->priv->contact_repo); TpIntsetFastIter iter; TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = lookup_contact (self, member); const gchar *request = g_hash_table_lookup (self->priv->publish_requests, GUINT_TO_POINTER (member)); /* we would like member not to see our presence any more, or we * would like to reject a request from them to see our presence */ if (request != NULL) { g_message ("Rejecting authorization request from %s", tp_handle_inspect (self->priv->contact_repo, member)); g_hash_table_remove (self->priv->publish_requests, GUINT_TO_POINTER (member)); if (d == NULL) { /* the contact wasn't actually on our protocol-level contact * list, only on the Telepathy-level contact list, so rejecting * authorization makes them disappear */ tp_handle_set_add (removed, member); } else { tp_handle_set_add (changed, member); } } if (tp_handle_set_remove (self->priv->cancelled_publish_requests, member)) { g_message ("Acknowledging remotely-cancelled publish request"); tp_handle_set_add (changed, member); } if (d != NULL) { d->pre_approved = FALSE; if (d->publish) { g_message ("Removing authorization from %s", tp_handle_inspect (self->priv->contact_repo, member)); d->publish = FALSE; tp_handle_set_add (changed, member); send_updated_roster (self, member); /* Pretend that after a delay, the contact notices the change * and asks for our presence again */ g_timeout_add_full (G_PRIORITY_LOW, self->priv->simulation_delay, auth_request_cb, self_and_contact_new (self, member), self_and_contact_destroy); } } } tp_base_contact_list_contacts_changed (contact_list, changed, removed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unpublish_async); } static TpHandleSet * example_contact_list_dup_blocked_contacts (TpBaseContactList *contact_list) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); return tp_handle_set_copy (self->priv->blocked_contacts); } static void example_contact_list_block_contacts_with_abuse_async ( TpBaseContactList *contact_list, TpHandleSet *contacts, gboolean report_abusive, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpIntsetFastIter iter; TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { if (!tp_handle_set_is_member (self->priv->blocked_contacts, member)) { g_message ("Adding contact %s to blocked list", tp_handle_inspect (self->priv->contact_repo, member)); tp_handle_set_add (self->priv->blocked_contacts, member); tp_handle_set_add (changed, member); } } tp_base_contact_list_contact_blocking_changed (contact_list, changed); tp_handle_set_destroy (changed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_block_contacts_with_abuse_async); } static void example_contact_list_unblock_contacts_async (TpBaseContactList *contact_list, TpHandleSet *contacts, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpIntsetFastIter iter; TpHandleSet *changed = tp_handle_set_new (self->priv->contact_repo); TpHandle member; tp_intset_fast_iter_init (&iter, tp_handle_set_peek (contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { if (tp_handle_set_remove (self->priv->blocked_contacts, member)) { g_message ("Removing contact %s from blocked list", tp_handle_inspect (self->priv->contact_repo, member)); tp_handle_set_add (changed, member); } } tp_base_contact_list_contact_blocking_changed (contact_list, changed); tp_handle_set_destroy (changed); tp_simple_async_report_success_in_idle ((GObject *) self, callback, user_data, example_contact_list_unblock_contacts_async); } static guint example_contact_list_get_group_storage ( TpBaseContactList *contact_list G_GNUC_UNUSED) { return TP_CONTACT_METADATA_STORAGE_TYPE_ANYONE; } static GStrv example_contact_list_dup_groups (TpBaseContactList *contact_list) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); GPtrArray *tags = g_ptr_array_sized_new ( g_hash_table_size (self->priv->all_tags) + 1); GHashTableIter iter; gpointer tag; g_hash_table_iter_init (&iter, self->priv->all_tags); while (g_hash_table_iter_next (&iter, &tag, NULL)) g_ptr_array_add (tags, g_strdup (tag)); g_ptr_array_add (tags, NULL); return (GStrv) g_ptr_array_free (tags, FALSE); } static GStrv example_contact_list_dup_contact_groups (TpBaseContactList *contact_list, TpHandle contact) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); GPtrArray *tags = g_ptr_array_sized_new ( g_hash_table_size (self->priv->all_tags) + 1); ExampleContactDetails *d = lookup_contact (self, contact); if (d != NULL && d->tags != NULL) { GHashTableIter iter; gpointer tag; g_hash_table_iter_init (&iter, d->tags); while (g_hash_table_iter_next (&iter, &tag, NULL)) g_ptr_array_add (tags, g_strdup (tag)); } g_ptr_array_add (tags, NULL); return (GStrv) g_ptr_array_free (tags, FALSE); } static void example_contact_list_remove_group_async (TpBaseContactList *contact_list, const gchar *group, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); TpIntsetFastIter iter; TpHandle member; /* signal the deletion */ g_message ("deleting group %s", group); tp_base_contact_list_groups_removed (contact_list, &group, 1); /* apply the change to our model of the contacts too; we don't need to signal * the change, because TpBaseContactList already did */ tp_intset_fast_iter_init (&iter, tp_handle_set_peek (self->priv->contacts)); while (tp_intset_fast_iter_next (&iter, &member)) { ExampleContactDetails *d = lookup_contact (self, member); if (d != NULL && d->tags != NULL) g_hash_table_remove (d->tags, group); } tp_simple_async_report_success_in_idle ((GObject *) contact_list, callback, user_data, example_contact_list_remove_group_async); } static gchar * example_contact_list_normalize_group (TpBaseContactList *contact_list, const gchar *id) { if (id[0] == '\0') return NULL; return g_utf8_normalize (id, -1, G_NORMALIZE_ALL_COMPOSE); } static void example_contact_list_rename_group_async (TpBaseContactList *contact_list, const gchar *old_name, const gchar *new_name, GAsyncReadyCallback callback, gpointer user_data) { ExampleContactList *self = EXAMPLE_CONTACT_LIST (contact_list); gchar *tag = ensure_tag (self, new_name, FALSE); GHashTableIter iter; gpointer v; /* signal the rename */ g_print ("renaming group %s to %s", old_name, new_name); tp_base_contact_list_group_renamed (contact_list, old_name, new_name); /* update our model (this doesn't need to signal anything because * TpBaseContactList already did) */ g_hash_table_iter_init (&iter, self->priv->contact_details); while (g_hash_table_iter_next (&iter, NULL, &v)) { ExampleContactDetails *d = v; if (d->tags != NULL && g_hash_table_remove (d->tags, old_name)) g_hash_table_insert (d->tags, tag, tag); } tp_simple_async_report_success_in_idle ((GObject *) contact_list, callback, user_data, example_contact_list_rename_group_async); } static void example_contact_list_class_init (ExampleContactListClass *klass) { TpBaseContactListClass *contact_list_class = (TpBaseContactListClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 1000, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); contact_list_class->dup_contacts = example_contact_list_dup_contacts; contact_list_class->dup_states = example_contact_list_dup_states; /* for this example CM we pretend there is a server-stored contact list, * like in XMPP, even though there obviously isn't really */ contact_list_class->get_contact_list_persists = tp_base_contact_list_true_func; g_type_class_add_private (klass, sizeof (ExampleContactListPrivate)); signals[ALIAS_UPDATED] = g_signal_new ("alias-updated", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT); signals[PRESENCE_UPDATED] = g_signal_new ("presence-updated", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT); } static void mutable_contact_list_iface_init (TpMutableContactListInterface *iface) { iface->can_change_contact_list = tp_base_contact_list_true_func; iface->get_request_uses_message = tp_base_contact_list_true_func; iface->request_subscription_async = example_contact_list_request_subscription_async; iface->authorize_publication_async = example_contact_list_authorize_publication_async; iface->store_contacts_async = example_contact_list_store_contacts_async; iface->remove_contacts_async = example_contact_list_remove_contacts_async; iface->unsubscribe_async = example_contact_list_unsubscribe_async; iface->unpublish_async = example_contact_list_unpublish_async; } static void blockable_contact_list_iface_init (TpBlockableContactListInterface *iface) { iface->can_block = tp_base_contact_list_true_func; iface->dup_blocked_contacts = example_contact_list_dup_blocked_contacts; iface->block_contacts_with_abuse_async = example_contact_list_block_contacts_with_abuse_async; iface->unblock_contacts_async = example_contact_list_unblock_contacts_async; } static void contact_group_list_iface_init (TpContactGroupListInterface *iface) { iface->dup_groups = example_contact_list_dup_groups; iface->dup_group_members = example_contact_list_dup_group_members; iface->dup_contact_groups = example_contact_list_dup_contact_groups; iface->normalize_group = example_contact_list_normalize_group; } static void mutable_contact_group_list_iface_init ( TpMutableContactGroupListInterface *iface) { iface->set_group_members_async = example_contact_list_set_group_members_async; iface->add_to_group_async = example_contact_list_add_to_group_async; iface->remove_from_group_async = example_contact_list_remove_from_group_async; iface->remove_group_async = example_contact_list_remove_group_async; iface->rename_group_async = example_contact_list_rename_group_async; iface->set_contact_groups_async = example_contact_list_set_contact_groups_async; iface->get_group_storage = example_contact_list_get_group_storage; } telepathy-glib-0.24.2/examples/cm/contactlist/contact-list.h0000644000175000017500000000463412652510705020765 00000000000000/* * Example channel manager for contact lists * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CONTACT_LIST_H__ #define __EXAMPLE_CONTACT_LIST_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleContactList ExampleContactList; typedef struct _ExampleContactListClass ExampleContactListClass; typedef struct _ExampleContactListPrivate ExampleContactListPrivate; struct _ExampleContactListClass { TpBaseContactListClass parent_class; }; struct _ExampleContactList { TpBaseContactList parent; ExampleContactListPrivate *priv; }; GType example_contact_list_get_type (void); #define EXAMPLE_TYPE_CONTACT_LIST \ (example_contact_list_get_type ()) #define EXAMPLE_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CONTACT_LIST, \ ExampleContactList)) #define EXAMPLE_CONTACT_LIST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CONTACT_LIST, \ ExampleContactListClass)) #define EXAMPLE_IS_CONTACT_LIST(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CONTACT_LIST)) #define EXAMPLE_IS_CONTACT_LIST_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CONTACT_LIST)) #define EXAMPLE_CONTACT_LIST_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CONTACT_LIST, \ ExampleContactListClass)) /* this enum must be kept in sync with the array _statuses in * contact-list.c */ typedef enum { EXAMPLE_CONTACT_LIST_PRESENCE_OFFLINE = 0, EXAMPLE_CONTACT_LIST_PRESENCE_UNKNOWN, EXAMPLE_CONTACT_LIST_PRESENCE_ERROR, EXAMPLE_CONTACT_LIST_PRESENCE_AWAY, EXAMPLE_CONTACT_LIST_PRESENCE_AVAILABLE } ExampleContactListPresence; const TpPresenceStatusSpec *example_contact_list_presence_statuses ( void); ExampleContactListPresence example_contact_list_get_presence ( ExampleContactList *self, TpHandle contact); const gchar *example_contact_list_get_alias ( ExampleContactList *self, TpHandle contact); void example_contact_list_set_alias ( ExampleContactList *self, TpHandle contact, const gchar *alias); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/contactlist/Makefile.am0000644000175000017500000000330312652510705020234 00000000000000# Example connection manager with ContactList channels. EXAMPLES = telepathy-example-cm-contactlist noinst_LTLIBRARIES = libexample-cm-contactlist.la if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif libexample_cm_contactlist_la_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ contact-list.c \ contact-list.h \ protocol.c \ protocol.h libexample_cm_contactlist_la_LIBADD = $(LDADD) telepathy_example_cm_contactlist_SOURCES = \ main.c telepathy_example_cm_contactlist_LDADD = \ $(noinst_LTLIBRARIES) if INSTALL_EXAMPLES servicedir = ${datadir}/dbus-1/services service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_contact_list.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_contact_list" && \ echo "Exec=${libexecdir}/telepathy-example-cm-contactlist"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_contact_list.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) telepathy-glib-0.24.2/examples/cm/contactlist/Makefile.in0000644000175000017500000007230014006601553020245 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Example connection manager with ContactList channels. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/contactlist ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-cm-contactlist$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libexample_cm_contactlist_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libexample_cm_contactlist_la_OBJECTS = conn.lo \ connection-manager.lo contact-list.lo protocol.lo libexample_cm_contactlist_la_OBJECTS = \ $(am_libexample_cm_contactlist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_telepathy_example_cm_contactlist_OBJECTS = main.$(OBJEXT) telepathy_example_cm_contactlist_OBJECTS = \ $(am_telepathy_example_cm_contactlist_OBJECTS) telepathy_example_cm_contactlist_DEPENDENCIES = $(noinst_LTLIBRARIES) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/conn.Plo \ ./$(DEPDIR)/connection-manager.Plo \ ./$(DEPDIR)/contact-list.Plo ./$(DEPDIR)/main.Po \ ./$(DEPDIR)/protocol.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libexample_cm_contactlist_la_SOURCES) \ $(telepathy_example_cm_contactlist_SOURCES) DIST_SOURCES = $(libexample_cm_contactlist_la_SOURCES) \ $(telepathy_example_cm_contactlist_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_contact_list.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-cm-contactlist noinst_LTLIBRARIES = libexample-cm-contactlist.la libexample_cm_contactlist_la_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ contact-list.c \ contact-list.h \ protocol.c \ protocol.h libexample_cm_contactlist_la_LIBADD = $(LDADD) telepathy_example_cm_contactlist_SOURCES = \ main.c telepathy_example_cm_contactlist_LDADD = \ $(noinst_LTLIBRARIES) @INSTALL_EXAMPLES_TRUE@servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_contact_list.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_contact_list.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/contactlist/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/contactlist/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libexample-cm-contactlist.la: $(libexample_cm_contactlist_la_OBJECTS) $(libexample_cm_contactlist_la_DEPENDENCIES) $(EXTRA_libexample_cm_contactlist_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexample_cm_contactlist_la_OBJECTS) $(libexample_cm_contactlist_la_LIBADD) $(LIBS) telepathy-example-cm-contactlist$(EXEEXT): $(telepathy_example_cm_contactlist_OBJECTS) $(telepathy_example_cm_contactlist_DEPENDENCIES) $(EXTRA_telepathy_example_cm_contactlist_DEPENDENCIES) @rm -f telepathy-example-cm-contactlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_cm_contactlist_OBJECTS) $(telepathy_example_cm_contactlist_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-list.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/contact-list.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/contact-list.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_managerDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libexecPROGRAMS install-man install-pdf install-pdf-am \ install-ps install-ps-am install-serviceDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_contact_list" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-contactlist"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/contactlist/main.c0000644000175000017500000000217412652510705017275 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright © 2007-2009 Collabora Ltd. * Copyright © 2007-2009 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "connection-manager.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_CONTACT_LIST_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-cm-contactlist", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/contactlist/example_contact_list.manager0000644000175000017500000000207112652510705023736 00000000000000[ConnectionManager] Interfaces= [Protocol example] Interfaces= ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts;org.freedesktop.Telepathy.Connection.Interface.Presence;org.freedesktop.Telepathy.Connection.Interface.SimplePresence; param-account=s required register param-simulation-delay=u default-simulation-delay=1000 RequestableChannelClasses=contactlist;contactgroup; VCardField=x-telepathy-example EnglishName=Example with a contact list Icon=face-smile [contactlist] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.ContactList org.freedesktop.Telepathy.Channel.TargetHandleType u=3 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID; [contactgroup] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.ContactList org.freedesktop.Telepathy.Channel.TargetHandleType u=4 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID; telepathy-glib-0.24.2/examples/cm/channelspecific/0000755000175000017500000000000014006623342017045 500000000000000telepathy-glib-0.24.2/examples/cm/channelspecific/example_csh.manager0000644000175000017500000000123512652510705022615 00000000000000[ConnectionManager] Interfaces= [Protocol example] Interfaces= ConnectionInterfaces=org.freedesktop.Telepathy.Connection.Interface.Requests;org.freedesktop.Telepathy.Connection.Interface.Contacts; param-account=s required register param-simulation-delay=u default-simulation-delay=500 RequestableChannelClasses=room; VCardField=x-telepathy-example EnglishName=Example with channel-specific handles Icon=face-smile [room] org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Text org.freedesktop.Telepathy.Channel.TargetHandleType u=2 allowed=org.freedesktop.Telepathy.Channel.TargetHandle;org.freedesktop.Telepathy.Channel.TargetID; telepathy-glib-0.24.2/examples/cm/channelspecific/protocol.c0000644000175000017500000001337312652510705021004 00000000000000/* * protocol.c - an example Protocol * * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "protocol.h" #include #include #include "conn.h" #include "room-manager.h" G_DEFINE_TYPE (ExampleCSHProtocol, example_csh_protocol, TP_TYPE_BASE_PROTOCOL) static void example_csh_protocol_init ( ExampleCSHProtocol *self) { } /* For this example, we imagine that global handles look like * username@realm and channel-specific handles look like nickname@#chatroom, * where username and nickname contain any UTF-8 except "@", and realm * and chatroom contain any UTF-8 except "@" and "#". * * Additionally, we imagine that everything is case-sensitive but is * required to be in NFKC. */ gboolean example_csh_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error) { const gchar *at; g_return_val_if_fail (id != NULL, FALSE); if (id[0] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must not be empty"); return FALSE; } at = strchr (id, '@'); if (at == NULL || at == id || at[1] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID must look like aaa@bbb"); return FALSE; } if (strchr (at + 1, '@') != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "ID cannot contain more than one '@'"); return FALSE; } if (at[1] == '#' && at[2] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "chatroom name cannot be empty"); return FALSE; } if (strchr (at + 2, '#') != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "realm/chatroom cannot contain '#' except at the beginning"); return FALSE; } if (normal != NULL) *normal = g_utf8_normalize (id, -1, G_NORMALIZE_ALL_COMPOSE); return TRUE; } static gboolean account_param_filter (const TpCMParamSpec *paramspec, GValue *value, GError **error) { const gchar *id = g_value_get_string (value); return example_csh_protocol_check_contact_id (id, NULL, error); } static const TpCMParamSpec example_csh_example_params[] = { { "account", "s", G_TYPE_STRING, TP_CONN_MGR_PARAM_FLAG_REQUIRED | TP_CONN_MGR_PARAM_FLAG_REGISTER, NULL, /* no default */ 0, /* unused, formerly struct offset */ account_param_filter, NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { "simulation-delay", "u", G_TYPE_UINT, TP_CONN_MGR_PARAM_FLAG_HAS_DEFAULT, GUINT_TO_POINTER (500), /* default */ 0, /* unused, formerly struct offset */ NULL, /* no filter */ NULL, /* filter data, unused here */ NULL }, /* setter data, now unused */ { NULL } }; static const TpCMParamSpec * get_parameters (TpBaseProtocol *self) { return example_csh_example_params; } static TpBaseConnection * new_connection (TpBaseProtocol *protocol, GHashTable *asv, GError **error) { ExampleCSHConnection *conn; const gchar *account; guint sim_delay; account = tp_asv_get_string (asv, "account"); /* telepathy-glib checked this for us */ g_assert (account != NULL); sim_delay = tp_asv_get_uint32 (asv, "simulation-delay", NULL); conn = EXAMPLE_CSH_CONNECTION ( g_object_new (EXAMPLE_TYPE_CSH_CONNECTION, "account", account, "protocol", tp_base_protocol_get_name (protocol), "simulation-delay", sim_delay, NULL)); return (TpBaseConnection *) conn; } static gchar * normalize_contact (TpBaseProtocol *self G_GNUC_UNUSED, const gchar *contact, GError **error) { gchar *normal; if (example_csh_protocol_check_contact_id (contact, &normal, error)) return normal; else return NULL; } static gchar * identify_account (TpBaseProtocol *self G_GNUC_UNUSED, GHashTable *asv, GError **error) { const gchar *account = tp_asv_get_string (asv, "account"); if (account != NULL) return normalize_contact (self, account, error); g_set_error (error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT, "'account' parameter not given"); return NULL; } static void get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED, GStrv *connection_interfaces, GType **channel_managers, gchar **icon_name, gchar **english_name, gchar **vcard_field) { if (connection_interfaces != NULL) { *connection_interfaces = g_strdupv ( (GStrv) example_csh_connection_get_possible_interfaces ()); } if (channel_managers != NULL) { GType types[] = { EXAMPLE_TYPE_CSH_ROOM_MANAGER, G_TYPE_INVALID }; *channel_managers = g_memdup (types, sizeof (types)); } if (icon_name != NULL) *icon_name = g_strdup ("face-smile"); if (english_name != NULL) *english_name = g_strdup ("Example with channel-specific handles"); if (vcard_field != NULL) *vcard_field = g_strdup ("x-telepathy-example"); } static void example_csh_protocol_class_init ( ExampleCSHProtocolClass *klass) { TpBaseProtocolClass *base_class = (TpBaseProtocolClass *) klass; base_class->get_parameters = get_parameters; base_class->new_connection = new_connection; base_class->normalize_contact = normalize_contact; base_class->identify_account = identify_account; base_class->get_connection_details = get_connection_details; } telepathy-glib-0.24.2/examples/cm/channelspecific/protocol.h0000644000175000017500000000355612652510705021013 00000000000000/* * protocol.h - header for an example Protocol * Copyright © 2007-2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_CHANNELSPECIFIC_PROTOCOL_H #define EXAMPLE_CHANNELSPECIFIC_PROTOCOL_H #include #include G_BEGIN_DECLS typedef struct _ExampleCSHProtocol ExampleCSHProtocol; typedef struct _ExampleCSHProtocolPrivate ExampleCSHProtocolPrivate; typedef struct _ExampleCSHProtocolClass ExampleCSHProtocolClass; typedef struct _ExampleCSHProtocolClassPrivate ExampleCSHProtocolClassPrivate; struct _ExampleCSHProtocolClass { TpBaseProtocolClass parent_class; ExampleCSHProtocolClassPrivate *priv; }; struct _ExampleCSHProtocol { TpBaseProtocol parent; ExampleCSHProtocolPrivate *priv; }; GType example_csh_protocol_get_type (void); #define EXAMPLE_TYPE_CSH_PROTOCOL \ (example_csh_protocol_get_type ()) #define EXAMPLE_CSH_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ EXAMPLE_TYPE_CSH_PROTOCOL, \ ExampleCSHProtocol)) #define EXAMPLE_CSH_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), \ EXAMPLE_TYPE_CSH_PROTOCOL, \ ExampleCSHProtocolClass)) #define EXAMPLE_IS_CSH_PROTOCOL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ EXAMPLE_TYPE_CSH_PROTOCOL)) #define EXAMPLE_IS_CSH_PROTOCOL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), \ EXAMPLE_TYPE_CSH_PROTOCOL)) #define EXAMPLE_CSH_PROTOCOL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), \ EXAMPLE_TYPE_CSH_PROTOCOL, \ ExampleCSHProtocolClass)) gboolean example_csh_protocol_check_contact_id (const gchar *id, gchar **normal, GError **error); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/channelspecific/connection-manager.c0000644000175000017500000000315212652510705022704 00000000000000/* * manager.c - an example connection manager * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "connection-manager.h" #include #include "protocol.h" G_DEFINE_TYPE (ExampleCSHConnectionManager, example_csh_connection_manager, TP_TYPE_BASE_CONNECTION_MANAGER) static void example_csh_connection_manager_init (ExampleCSHConnectionManager *self) { } static void example_csh_connection_manager_constructed (GObject *object) { ExampleCSHConnectionManager *self = EXAMPLE_CSH_CONNECTION_MANAGER (object); TpBaseConnectionManager *base = (TpBaseConnectionManager *) self; void (*constructed) (GObject *) = ((GObjectClass *) example_csh_connection_manager_parent_class)->constructed; TpBaseProtocol *protocol; if (constructed != NULL) constructed (object); protocol = g_object_new (EXAMPLE_TYPE_CSH_PROTOCOL, "name", "example", NULL); tp_base_connection_manager_add_protocol (base, protocol); g_object_unref (protocol); } static void example_csh_connection_manager_class_init ( ExampleCSHConnectionManagerClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseConnectionManagerClass *base_class = (TpBaseConnectionManagerClass *) klass; object_class->constructed = example_csh_connection_manager_constructed; base_class->cm_dbus_name = "example_csh"; } telepathy-glib-0.24.2/examples/cm/channelspecific/connection-manager.h0000644000175000017500000000420512652510705022711 00000000000000/* * manager.h - header for an example connection manager * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CSH_CONNECTION_MANAGER_H__ #define __EXAMPLE_CSH_CONNECTION_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleCSHConnectionManager ExampleCSHConnectionManager; typedef struct _ExampleCSHConnectionManagerPrivate ExampleCSHConnectionManagerPrivate; typedef struct _ExampleCSHConnectionManagerClass ExampleCSHConnectionManagerClass; typedef struct _ExampleCSHConnectionManagerClassPrivate ExampleCSHConnectionManagerClassPrivate; struct _ExampleCSHConnectionManagerClass { TpBaseConnectionManagerClass parent_class; ExampleCSHConnectionManagerClassPrivate *priv; }; struct _ExampleCSHConnectionManager { TpBaseConnectionManager parent; ExampleCSHConnectionManagerPrivate *priv; }; GType example_csh_connection_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_CSH_CONNECTION_MANAGER \ (example_csh_connection_manager_get_type ()) #define EXAMPLE_CSH_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CSH_CONNECTION_MANAGER, \ ExampleCSHConnectionManager)) #define EXAMPLE_CSH_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CSH_CONNECTION_MANAGER, \ ExampleCSHConnectionManagerClass)) #define EXAMPLE_IS_CSH_CONNECTION_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CSH_CONNECTION_MANAGER)) #define EXAMPLE_IS_CSH_CONNECTION_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CSH_CONNECTION_MANAGER)) #define EXAMPLE_CSH_CONNECTION_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CSH_CONNECTION_MANAGER, \ ExampleCSHConnectionManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/channelspecific/conn.c0000644000175000017500000002031412652510705020071 00000000000000/* * conn.c - an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "conn.h" #include #include #include #include "protocol.h" #include "room-manager.h" G_DEFINE_TYPE_WITH_CODE (ExampleCSHConnection, example_csh_connection, TP_TYPE_BASE_CONNECTION, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CONNECTION_INTERFACE_CONTACTS, tp_contacts_mixin_iface_init)) /* type definition stuff */ enum { PROP_ACCOUNT = 1, PROP_SIMULATION_DELAY, N_PROPS }; struct _ExampleCSHConnectionPrivate { gchar *account; guint simulation_delay; }; static void example_csh_connection_init (ExampleCSHConnection *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CSH_CONNECTION, ExampleCSHConnectionPrivate); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *spec) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_value_set_string (value, self->priv->account); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *spec) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (object); switch (property_id) { case PROP_ACCOUNT: g_free (self->priv->account); self->priv->account = g_utf8_strdown (g_value_get_string (value), -1); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, spec); } } static void finalize (GObject *object) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (object); tp_contacts_mixin_finalize (object); g_free (self->priv->account); G_OBJECT_CLASS (example_csh_connection_parent_class)->finalize (object); } static gchar * get_unique_connection_name (TpBaseConnection *conn) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (conn); return g_strdup (self->priv->account); } static gchar * example_csh_normalize_contact (TpHandleRepoIface *repo G_GNUC_UNUSED, const gchar *id, gpointer context G_GNUC_UNUSED, GError **error) { gchar *normal = NULL; if (example_csh_protocol_check_contact_id (id, &normal, error)) return normal; else return NULL; } static gchar * example_csh_normalize_room (TpHandleRepoIface *repo, const gchar *id, gpointer context, GError **error) { /* See example_csh_protocol_normalize_contact() for syntax. */ if (id[0] != '#') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "Chatroom names in this protocol start with #"); } if (id[1] == '\0') { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "Chatroom name cannot be empty"); return NULL; } if (strchr (id, '@') != NULL) { g_set_error (error, TP_ERROR, TP_ERROR_INVALID_HANDLE, "Chatroom names in this protocol cannot contain '@'"); return NULL; } return g_utf8_normalize (id, -1, G_NORMALIZE_ALL_COMPOSE); } static void create_handle_repos (TpBaseConnection *conn, TpHandleRepoIface *repos[TP_NUM_HANDLE_TYPES]) { repos[TP_HANDLE_TYPE_CONTACT] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_CONTACT, example_csh_normalize_contact, NULL); repos[TP_HANDLE_TYPE_ROOM] = tp_dynamic_handle_repo_new (TP_HANDLE_TYPE_ROOM, example_csh_normalize_room, NULL); } static GPtrArray * create_channel_managers (TpBaseConnection *conn) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (conn); GPtrArray *ret = g_ptr_array_sized_new (1); g_ptr_array_add (ret, g_object_new (EXAMPLE_TYPE_CSH_ROOM_MANAGER, "connection", conn, "simulation-delay", self->priv->simulation_delay, NULL)); return ret; } static gboolean start_connecting (TpBaseConnection *conn, GError **error) { ExampleCSHConnection *self = EXAMPLE_CSH_CONNECTION (conn); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; /* In a real connection manager we'd ask the underlying implementation to * start connecting, then go to state CONNECTED when finished, but here * we can do it immediately. */ self_handle = tp_handle_ensure (contact_repo, self->priv->account, NULL, error); if (self_handle == 0) return FALSE; tp_base_connection_set_self_handle (conn, self_handle); tp_base_connection_change_status (conn, TP_CONNECTION_STATUS_CONNECTED, TP_CONNECTION_STATUS_REASON_REQUESTED); return TRUE; } static void shut_down (TpBaseConnection *conn) { /* In a real connection manager we'd ask the underlying implementation to * start shutting down, then call this function when finished, but here * we can do it immediately. */ tp_base_connection_finish_shutdown (conn); } static void constructed (GObject *object) { TpBaseConnection *base = TP_BASE_CONNECTION (object); void (*chain_up) (GObject *) = G_OBJECT_CLASS (example_csh_connection_parent_class)->constructed; if (chain_up != NULL) chain_up (object); tp_contacts_mixin_init (object, G_STRUCT_OFFSET (ExampleCSHConnection, contacts_mixin)); tp_base_connection_register_with_contacts_mixin (base); } static const gchar *interfaces_always_present[] = { TP_IFACE_CONNECTION_INTERFACE_REQUESTS, TP_IFACE_CONNECTION_INTERFACE_CONTACTS, NULL }; const gchar * const * example_csh_connection_get_possible_interfaces (void) { /* in this example CM we don't have any extra interfaces that are sometimes, * but not always, present */ return interfaces_always_present; } static GPtrArray * get_interfaces_always_present (TpBaseConnection *base) { GPtrArray *interfaces; guint i; interfaces = TP_BASE_CONNECTION_CLASS ( example_csh_connection_parent_class)->get_interfaces_always_present (base); for (i = 0; interfaces_always_present[i] != NULL; i++) g_ptr_array_add (interfaces, (gchar *) interfaces_always_present[i]); return interfaces; } static void example_csh_connection_class_init (ExampleCSHConnectionClass *klass) { TpBaseConnectionClass *base_class = (TpBaseConnectionClass *) klass; GObjectClass *object_class = (GObjectClass *) klass; GParamSpec *param_spec; object_class->constructed = constructed; object_class->get_property = get_property; object_class->set_property = set_property; object_class->finalize = finalize; g_type_class_add_private (klass, sizeof (ExampleCSHConnectionPrivate)); base_class->create_handle_repos = create_handle_repos; base_class->get_unique_connection_name = get_unique_connection_name; base_class->create_channel_managers = create_channel_managers; base_class->start_connecting = start_connecting; base_class->shut_down = shut_down; base_class->get_interfaces_always_present = get_interfaces_always_present; param_spec = g_param_spec_string ("account", "Account name", "The username of this user", NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_ACCOUNT, param_spec); param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 500, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); tp_contacts_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleCSHConnectionClass, contacts_mixin)); } telepathy-glib-0.24.2/examples/cm/channelspecific/conn.h0000644000175000017500000000361412652510705020102 00000000000000/* * conn.h - header for an example connection * * Copyright © 2007-2010 Collabora Ltd. * Copyright © 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CSH_CONN_H__ #define __EXAMPLE_CSH_CONN_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleCSHConnection ExampleCSHConnection; typedef struct _ExampleCSHConnectionClass ExampleCSHConnectionClass; typedef struct _ExampleCSHConnectionPrivate ExampleCSHConnectionPrivate; struct _ExampleCSHConnectionClass { TpBaseConnectionClass parent_class; TpContactsMixinClass contacts_mixin; }; struct _ExampleCSHConnection { TpBaseConnection parent; TpContactsMixin contacts_mixin; ExampleCSHConnectionPrivate *priv; }; GType example_csh_connection_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_CSH_CONNECTION \ (example_csh_connection_get_type ()) #define EXAMPLE_CSH_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CSH_CONNECTION, \ ExampleCSHConnection)) #define EXAMPLE_CSH_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CSH_CONNECTION, \ ExampleCSHConnectionClass)) #define EXAMPLE_IS_CSH_CONNECTION(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CSH_CONNECTION)) #define EXAMPLE_IS_CSH_CONNECTION_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CSH_CONNECTION)) #define EXAMPLE_CSH_CONNECTION_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CSH_CONNECTION, \ ExampleCSHConnectionClass)) const gchar * const * example_csh_connection_get_possible_interfaces (void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/channelspecific/Makefile.am0000644000175000017500000000334112652510705021025 00000000000000# Example connection manager with chatrooms where contacts have # channel-specific handles. EXAMPLES = telepathy-example-cm-csh noinst_LTLIBRARIES = libexample-cm-csh.la if INSTALL_EXAMPLES libexec_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif libexample_cm_csh_la_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ protocol.c \ protocol.h \ room.c \ room.h \ room-manager.c \ room-manager.h libexample_cm_csh_la_LIBADD = $(LDADD) telepathy_example_cm_csh_SOURCES = \ main.c telepathy_example_cm_csh_LDADD = \ $(noinst_LTLIBRARIES) servicedir = ${datadir}/dbus-1/services if INSTALL_EXAMPLES service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_csh.service $(service_DATA): %: Makefile $(MKDIR_P) _gen { echo "[D-BUS Service]" && \ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_csh" && \ echo "Exec=${libexecdir}/telepathy-example-cm-csh"; } > $@ managerdir = ${datadir}/telepathy/managers dist_manager_DATA = example_csh.manager endif clean-local: rm -rf _gen # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/cm/channelspecific/Makefile.in0000644000175000017500000007224714006601553021046 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Example connection manager with chatrooms where contacts have # channel-specific handles. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@libexec_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/cm/channelspecific ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_manager_DATA_DIST) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-cm-csh$(EXEEXT) am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" \ "$(DESTDIR)$(servicedir)" PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libexample_cm_csh_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libexample_cm_csh_la_OBJECTS = conn.lo connection-manager.lo \ protocol.lo room.lo room-manager.lo libexample_cm_csh_la_OBJECTS = $(am_libexample_cm_csh_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_telepathy_example_cm_csh_OBJECTS = main.$(OBJEXT) telepathy_example_cm_csh_OBJECTS = \ $(am_telepathy_example_cm_csh_OBJECTS) telepathy_example_cm_csh_DEPENDENCIES = $(noinst_LTLIBRARIES) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/conn.Plo \ ./$(DEPDIR)/connection-manager.Plo ./$(DEPDIR)/main.Po \ ./$(DEPDIR)/protocol.Plo ./$(DEPDIR)/room-manager.Plo \ ./$(DEPDIR)/room.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libexample_cm_csh_la_SOURCES) \ $(telepathy_example_cm_csh_SOURCES) DIST_SOURCES = $(libexample_cm_csh_la_SOURCES) \ $(telepathy_example_cm_csh_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__dist_manager_DATA_DIST = example_csh.manager am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } DATA = $(dist_manager_DATA) $(service_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXAMPLES = telepathy-example-cm-csh noinst_LTLIBRARIES = libexample-cm-csh.la libexample_cm_csh_la_SOURCES = \ conn.c \ conn.h \ connection-manager.c \ connection-manager.h \ protocol.c \ protocol.h \ room.c \ room.h \ room-manager.c \ room-manager.h libexample_cm_csh_la_LIBADD = $(LDADD) telepathy_example_cm_csh_SOURCES = \ main.c telepathy_example_cm_csh_LDADD = \ $(noinst_LTLIBRARIES) servicedir = ${datadir}/dbus-1/services @INSTALL_EXAMPLES_TRUE@service_DATA = _gen/org.freedesktop.Telepathy.ConnectionManager.example_csh.service @INSTALL_EXAMPLES_TRUE@managerdir = ${datadir}/telepathy/managers @INSTALL_EXAMPLES_TRUE@dist_manager_DATA = example_csh.manager # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/cm/channelspecific/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/cm/channelspecific/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libexample-cm-csh.la: $(libexample_cm_csh_la_OBJECTS) $(libexample_cm_csh_la_DEPENDENCIES) $(EXTRA_libexample_cm_csh_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexample_cm_csh_la_OBJECTS) $(libexample_cm_csh_la_LIBADD) $(LIBS) telepathy-example-cm-csh$(EXEEXT): $(telepathy_example_cm_csh_OBJECTS) $(telepathy_example_cm_csh_DEPENDENCIES) $(EXTRA_telepathy_example_cm_csh_DEPENDENCIES) @rm -f telepathy-example-cm-csh$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_cm_csh_OBJECTS) $(telepathy_example_cm_csh_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conn.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connection-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room-manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/room.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-dist_managerDATA: $(dist_manager_DATA) @$(NORMAL_INSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(managerdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(managerdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(managerdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(managerdir)" || exit $$?; \ done uninstall-dist_managerDATA: @$(NORMAL_UNINSTALL) @list='$(dist_manager_DATA)'; test -n "$(managerdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(managerdir)'; $(am__uninstall_files_from_dir) install-serviceDATA: $(service_DATA) @$(NORMAL_INSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(servicedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(servicedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(servicedir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(servicedir)" || exit $$?; \ done uninstall-serviceDATA: @$(NORMAL_UNINSTALL) @list='$(service_DATA)'; test -n "$(servicedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(servicedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(DATA) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(managerdir)" "$(DESTDIR)$(servicedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f ./$(DEPDIR)/room-manager.Plo -rm -f ./$(DEPDIR)/room.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dist_managerDATA install-serviceDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/conn.Plo -rm -f ./$(DEPDIR)/connection-manager.Plo -rm -f ./$(DEPDIR)/main.Po -rm -f ./$(DEPDIR)/protocol.Plo -rm -f ./$(DEPDIR)/room-manager.Plo -rm -f ./$(DEPDIR)/room.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-dist_managerDATA uninstall-libexecPROGRAMS \ uninstall-serviceDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool clean-local \ clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dist_managerDATA install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libexecPROGRAMS install-man install-pdf install-pdf-am \ install-ps install-ps-am install-serviceDATA install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-dist_managerDATA \ uninstall-libexecPROGRAMS uninstall-serviceDATA .PRECIOUS: Makefile @INSTALL_EXAMPLES_TRUE@$(service_DATA): %: Makefile @INSTALL_EXAMPLES_TRUE@ $(MKDIR_P) _gen @INSTALL_EXAMPLES_TRUE@ { echo "[D-BUS Service]" && \ @INSTALL_EXAMPLES_TRUE@ echo "Name=org.freedesktop.Telepathy.ConnectionManager.example_csh" && \ @INSTALL_EXAMPLES_TRUE@ echo "Exec=${libexecdir}/telepathy-example-cm-csh"; } > $@ clean-local: rm -rf _gen # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/cm/channelspecific/main.c0000644000175000017500000000221112652510705020054 00000000000000/* * main.c - entry point for an example Telepathy connection manager * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include "examples/cm/channelspecific/connection-manager.h" static TpBaseConnectionManager * construct_cm (void) { return (TpBaseConnectionManager *) g_object_new ( EXAMPLE_TYPE_CSH_CONNECTION_MANAGER, NULL); } int main (int argc, char **argv) { #ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); #endif return tp_run_connection_manager ("telepathy-example-cm-csh", VERSION, construct_cm, argc, argv); } telepathy-glib-0.24.2/examples/cm/channelspecific/room.c0000644000175000017500000003202612652510705020113 00000000000000/* * room.c - a chatroom channel * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "room.h" #include #include G_DEFINE_TYPE_WITH_CODE (ExampleCSHRoomChannel, example_csh_room_channel, TP_TYPE_BASE_CHANNEL, G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_TEXT, tp_message_mixin_text_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_MESSAGES, tp_message_mixin_messages_iface_init); G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP, tp_group_mixin_iface_init);) /* type definition stuff */ enum { PROP_SIMULATION_DELAY = 1, N_PROPS }; struct _ExampleCSHRoomChannelPrivate { guint simulation_delay; }; static GPtrArray * example_csh_room_channel_get_interfaces (TpBaseChannel *self) { GPtrArray *interfaces; interfaces = TP_BASE_CHANNEL_CLASS (example_csh_room_channel_parent_class)-> get_interfaces (self); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP); g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); return interfaces; }; static void example_csh_room_channel_init (ExampleCSHRoomChannel *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CSH_ROOM_CHANNEL, ExampleCSHRoomChannelPrivate); } static TpHandle suggest_room_identity (ExampleCSHRoomChannel *self) { TpBaseConnection *connection = tp_base_channel_get_connection (TP_BASE_CHANNEL (self)); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (connection, TP_HANDLE_TYPE_CONTACT); TpHandleRepoIface *room_repo = tp_base_connection_get_handles (connection, TP_HANDLE_TYPE_ROOM); gchar *nick, *id; TpHandle ret; nick = g_strdup (tp_handle_inspect (contact_repo, tp_base_connection_get_self_handle (connection))); g_strdelimit (nick, "@", '\0'); id = g_strdup_printf ("%s@%s", nick, tp_handle_inspect (room_repo, tp_base_channel_get_target_handle (TP_BASE_CHANNEL (self)))); g_free (nick); ret = tp_handle_ensure (contact_repo, id, NULL, NULL); g_free (id); g_assert (ret != 0); return ret; } /* This timeout callback represents a successful join. In a real CM it'd * happen in response to network events, rather than just a timer */ static void complete_join (ExampleCSHRoomChannel *self) { TpBaseConnection *conn = tp_base_channel_get_connection (TP_BASE_CHANNEL (self)); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandleRepoIface *room_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_ROOM); const gchar *room_name = tp_handle_inspect (room_repo, tp_base_channel_get_target_handle (TP_BASE_CHANNEL (self))); gchar *str; TpHandle alice_local, bob_local, chris_local, anon_local; TpHandle alice_global, bob_global, chris_global; TpGroupMixin *mixin = TP_GROUP_MIXIN (self); TpIntset *added; /* For this example, we assume that all chatrooms initially contain * Alice, Bob and Chris (and that their global IDs are also known), * and they also contain one anonymous user. */ str = g_strdup_printf ("alice@%s", room_name); alice_local = tp_handle_ensure (contact_repo, str, NULL, NULL); g_free (str); alice_global = tp_handle_ensure (contact_repo, "alice@alpha", NULL, NULL); str = g_strdup_printf ("bob@%s", room_name); bob_local = tp_handle_ensure (contact_repo, str, NULL, NULL); g_free (str); bob_global = tp_handle_ensure (contact_repo, "bob@beta", NULL, NULL); str = g_strdup_printf ("chris@%s", room_name); chris_local = tp_handle_ensure (contact_repo, str, NULL, NULL); g_free (str); chris_global = tp_handle_ensure (contact_repo, "chris@chi", NULL, NULL); str = g_strdup_printf ("anonymous coward@%s", room_name); anon_local = tp_handle_ensure (contact_repo, str, NULL, NULL); g_free (str); /* If our chosen nick is not available, pretend the server would * automatically rename us on entry. */ if (mixin->self_handle == alice_local || mixin->self_handle == bob_local || mixin->self_handle == chris_local || mixin->self_handle == anon_local) { TpHandle new_self; TpIntset *rp = tp_intset_new (); TpIntset *removed = tp_intset_new (); str = g_strdup_printf ("renamed by server@%s", room_name); new_self = tp_handle_ensure (contact_repo, str, NULL, NULL); g_free (str); tp_intset_add (rp, new_self); tp_intset_add (removed, mixin->self_handle); tp_group_mixin_add_handle_owner ((GObject *) self, new_self, tp_base_connection_get_self_handle (conn)); tp_group_mixin_change_self_handle ((GObject *) self, new_self); tp_group_mixin_change_members ((GObject *) self, "", NULL, removed, NULL, rp, 0, TP_CHANNEL_GROUP_CHANGE_REASON_RENAMED); tp_intset_destroy (removed); tp_intset_destroy (rp); } tp_group_mixin_add_handle_owner ((GObject *) self, alice_local, alice_global); tp_group_mixin_add_handle_owner ((GObject *) self, bob_local, bob_global); tp_group_mixin_add_handle_owner ((GObject *) self, chris_local, chris_global); /* we know that anon_local is channel-specific, but not whose it is, * hence 0 */ tp_group_mixin_add_handle_owner ((GObject *) self, anon_local, 0); /* everyone in! */ added = tp_intset_new(); tp_intset_add (added, alice_local); tp_intset_add (added, bob_local); tp_intset_add (added, chris_local); tp_intset_add (added, anon_local); tp_intset_add (added, mixin->self_handle); tp_group_mixin_change_members ((GObject *) self, "", added, NULL, NULL, NULL, 0, TP_CHANNEL_GROUP_CHANGE_REASON_NONE); /* now that the dust has settled, we can also invite people */ tp_group_mixin_change_flags ((GObject *) self, TP_CHANNEL_GROUP_FLAG_CAN_ADD | TP_CHANNEL_GROUP_FLAG_MESSAGE_ADD, 0); } static void join_room (ExampleCSHRoomChannel *self) { TpBaseConnection *conn = tp_base_channel_get_connection (TP_BASE_CHANNEL (self)); TpGroupMixin *mixin = TP_GROUP_MIXIN (self); GObject *object = (GObject *) self; TpIntset *add_remote_pending; g_assert (!tp_handle_set_is_member (mixin->members, mixin->self_handle)); g_assert (!tp_handle_set_is_member (mixin->remote_pending, mixin->self_handle)); /* Indicate in the Group interface that a join is in progress */ add_remote_pending = tp_intset_new (); tp_intset_add (add_remote_pending, mixin->self_handle); tp_group_mixin_add_handle_owner (object, mixin->self_handle, tp_base_connection_get_self_handle (conn)); tp_group_mixin_change_members (object, "", NULL, NULL, NULL, add_remote_pending, tp_base_connection_get_self_handle (conn), TP_CHANNEL_GROUP_CHANGE_REASON_NONE); tp_intset_destroy (add_remote_pending); /* Actually join the room. In a real implementation this would be a network * round-trip - we don't have a network, so pretend that joining takes * a short time */ g_timeout_add (self->priv->simulation_delay, (GSourceFunc) complete_join, self); } static void send_message (GObject *object, TpMessage *message, TpMessageSendingFlags flags) { /* The /dev/null of text channels - we claim to have sent the message, * but nothing more happens */ tp_message_mixin_sent (object, message, flags, "", NULL); } static GObject * constructor (GType type, guint n_props, GObjectConstructParam *props) { static TpChannelTextMessageType const types[] = { TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION, TP_CHANNEL_TEXT_MESSAGE_TYPE_NOTICE }; static const gchar * const content_types[] = { "*/*", NULL }; GObject *object = G_OBJECT_CLASS (example_csh_room_channel_parent_class)->constructor (type, n_props, props); ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object); TpBaseConnection *conn = tp_base_channel_get_connection (TP_BASE_CHANNEL (self)); TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (conn, TP_HANDLE_TYPE_CONTACT); TpHandle self_handle; tp_base_channel_register (TP_BASE_CHANNEL (self)); tp_message_mixin_init (object, G_STRUCT_OFFSET (ExampleCSHRoomChannel, message_mixin), conn); tp_message_mixin_implement_sending (object, send_message, G_N_ELEMENTS (types), types, TP_MESSAGE_PART_SUPPORT_FLAG_ONE_ATTACHMENT | TP_MESSAGE_PART_SUPPORT_FLAG_MULTIPLE_ATTACHMENTS, 0, /* no TpDeliveryReportingSupportFlags */ content_types); /* We start off remote-pending (if this CM supported other people inviting * us, we'd start off local-pending in that case instead - but it doesn't), * with this self-handle. */ self_handle = suggest_room_identity (self); tp_group_mixin_init (object, G_STRUCT_OFFSET (ExampleCSHRoomChannel, group), contact_repo, self_handle); /* Initially, we can't do anything. */ tp_group_mixin_change_flags (object, TP_CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES | TP_CHANNEL_GROUP_FLAG_PROPERTIES, 0); /* Immediately attempt to join the group */ join_room (self); return object; } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object); switch (property_id) { case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object); switch (property_id) { case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } } static void example_csh_room_channel_close (TpBaseChannel *self) { tp_base_channel_destroyed (self); } static void finalize (GObject *object) { tp_message_mixin_finalize (object); ((GObjectClass *) example_csh_room_channel_parent_class)->finalize (object); } static gboolean add_member (GObject *object, TpHandle handle, const gchar *message, GError **error) { /* In a real implementation, if handle was mixin->self_handle we'd accept * an invitation here; otherwise we'd invite the given contact. * Here, we do nothing for now. */ return TRUE; } static gboolean remove_member_with_reason (GObject *object, TpHandle handle, const gchar *message, guint reason, GError **error) { ExampleCSHRoomChannel *self = EXAMPLE_CSH_ROOM_CHANNEL (object); if (handle == self->group.self_handle) { /* TODO: if simulating a channel where the user is an operator, let them * kick themselves (like in IRC), resulting in different "network" * messages */ example_csh_room_channel_close (TP_BASE_CHANNEL (self)); return TRUE; } else { /* TODO: also simulate some channels where the user is an operator and * can kick people */ g_set_error (error, TP_ERROR, TP_ERROR_PERMISSION_DENIED, "You can't eject other users from this channel"); return FALSE; } } static void example_csh_room_channel_class_init (ExampleCSHRoomChannelClass *klass) { GObjectClass *object_class = (GObjectClass *) klass; TpBaseChannelClass *base_class = TP_BASE_CHANNEL_CLASS (klass); GParamSpec *param_spec; g_type_class_add_private (klass, sizeof (ExampleCSHRoomChannelPrivate)); object_class->constructor = constructor; object_class->set_property = set_property; object_class->get_property = get_property; object_class->finalize = finalize; base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_ROOM; base_class->get_interfaces = example_csh_room_channel_get_interfaces; base_class->close = example_csh_room_channel_close; param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 500, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); tp_group_mixin_class_init (object_class, G_STRUCT_OFFSET (ExampleCSHRoomChannelClass, group_class), add_member, NULL); tp_group_mixin_class_allow_self_removal (object_class); tp_group_mixin_class_set_remove_with_reason_func (object_class, remove_member_with_reason); tp_group_mixin_init_dbus_properties (object_class); tp_message_mixin_init_dbus_properties (object_class); } telepathy-glib-0.24.2/examples/cm/channelspecific/room.h0000644000175000017500000000351312652510705020117 00000000000000/* * room.h - header for an example chatroom channel * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef EXAMPLE_CSH_ROOM_H #define EXAMPLE_CSH_ROOM_H #include G_BEGIN_DECLS typedef struct _ExampleCSHRoomChannel ExampleCSHRoomChannel; typedef struct _ExampleCSHRoomChannelClass ExampleCSHRoomChannelClass; typedef struct _ExampleCSHRoomChannelPrivate ExampleCSHRoomChannelPrivate; GType example_csh_room_channel_get_type (void); #define EXAMPLE_TYPE_CSH_ROOM_CHANNEL \ (example_csh_room_channel_get_type ()) #define EXAMPLE_CSH_ROOM_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), EXAMPLE_TYPE_CSH_ROOM_CHANNEL, \ ExampleCSHRoomChannel)) #define EXAMPLE_CSH_ROOM_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST ((klass), EXAMPLE_TYPE_CSH_ROOM_CHANNEL, \ ExampleCSHRoomChannelClass)) #define EXAMPLE_IS_CSH_ROOM_CHANNEL(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EXAMPLE_TYPE_CSH_ROOM_CHANNEL)) #define EXAMPLE_IS_CSH_ROOM_CHANNEL_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE ((klass), EXAMPLE_TYPE_CSH_ROOM_CHANNEL)) #define EXAMPLE_CSH_ROOM_CHANNEL_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CSH_ROOM_CHANNEL, \ ExampleCSHRoomChannelClass)) struct _ExampleCSHRoomChannelClass { TpBaseChannelClass parent_class; TpGroupMixinClass group_class; }; struct _ExampleCSHRoomChannel { TpBaseChannel parent; TpMessageMixin message_mixin; TpGroupMixin group; ExampleCSHRoomChannelPrivate *priv; }; G_END_DECLS #endif telepathy-glib-0.24.2/examples/cm/channelspecific/room-manager.c0000644000175000017500000002501712652510705021525 00000000000000/* * room-manager.c: example channel manager for chatrooms * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "room-manager.h" #include #include #include "room.h" static void channel_manager_iface_init (gpointer, gpointer); G_DEFINE_TYPE_WITH_CODE (ExampleCSHRoomManager, example_csh_room_manager, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_MANAGER, channel_manager_iface_init)) /* type definition stuff */ enum { PROP_CONNECTION = 1, PROP_SIMULATION_DELAY, N_PROPS }; struct _ExampleCSHRoomManagerPrivate { TpBaseConnection *conn; guint simulation_delay; /* GUINT_TO_POINTER (room handle) => ExampleCSHRoomChannel */ GHashTable *channels; gulong status_changed_id; }; static void example_csh_room_manager_init (ExampleCSHRoomManager *self) { self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, EXAMPLE_TYPE_CSH_ROOM_MANAGER, ExampleCSHRoomManagerPrivate); self->priv->channels = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref); } static void example_csh_room_manager_close_all (ExampleCSHRoomManager *self); static void dispose (GObject *object) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (object); example_csh_room_manager_close_all (self); g_assert (self->priv->channels == NULL); ((GObjectClass *) example_csh_room_manager_parent_class)->dispose (object); } static void get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: g_value_set_object (value, self->priv->conn); break; case PROP_SIMULATION_DELAY: g_value_set_uint (value, self->priv->simulation_delay); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (object); switch (property_id) { case PROP_CONNECTION: /* We don't ref the connection, because it owns a reference to the * manager, and it guarantees that the manager's lifetime is * less than its lifetime */ self->priv->conn = g_value_get_object (value); break; case PROP_SIMULATION_DELAY: self->priv->simulation_delay = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } } static void status_changed_cb (TpBaseConnection *conn, guint status, guint reason, ExampleCSHRoomManager *self) { if (status == TP_CONNECTION_STATUS_DISCONNECTED) example_csh_room_manager_close_all (self); } static void constructed (GObject *object) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (object); void (*chain_up) (GObject *) = ((GObjectClass *) example_csh_room_manager_parent_class)->constructed; if (chain_up != NULL) { chain_up (object); } self->priv->status_changed_id = g_signal_connect (self->priv->conn, "status-changed", (GCallback) status_changed_cb, self); } static void example_csh_room_manager_class_init (ExampleCSHRoomManagerClass *klass) { GParamSpec *param_spec; GObjectClass *object_class = (GObjectClass *) klass; object_class->constructed = constructed; object_class->dispose = dispose; object_class->get_property = get_property; object_class->set_property = set_property; param_spec = g_param_spec_object ("connection", "Connection object", "The connection that owns this channel manager", TP_TYPE_BASE_CONNECTION, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONNECTION, param_spec); param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay", "Delay between simulated network events", 0, G_MAXUINT32, 500, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_SIMULATION_DELAY, param_spec); g_type_class_add_private (klass, sizeof (ExampleCSHRoomManagerPrivate)); } static void example_csh_room_manager_close_all (ExampleCSHRoomManager *self) { if (self->priv->channels != NULL) { GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) { g_signal_handler_disconnect (self->priv->conn, self->priv->status_changed_id); self->priv->status_changed_id = 0; } } static void example_csh_room_manager_foreach_channel (TpChannelManager *manager, TpExportableChannelFunc callback, gpointer user_data) { ExampleCSHRoomManager *self = EXAMPLE_CSH_ROOM_MANAGER (manager); GHashTableIter iter; gpointer handle, channel; g_hash_table_iter_init (&iter, self->priv->channels); while (g_hash_table_iter_next (&iter, &handle, &channel)) { callback (TP_EXPORTABLE_CHANNEL (channel), user_data); } } static void channel_closed_cb (ExampleCSHRoomChannel *chan, ExampleCSHRoomManager *self) { tp_channel_manager_emit_channel_closed_for_object (self, TP_EXPORTABLE_CHANNEL (chan)); if (self->priv->channels != NULL) { TpHandle handle; g_object_get (chan, "handle", &handle, NULL); g_hash_table_remove (self->priv->channels, GUINT_TO_POINTER (handle)); } } static void new_channel (ExampleCSHRoomManager *self, TpHandle handle, TpHandle initiator, gpointer request_token) { ExampleCSHRoomChannel *chan; gchar *object_path; GSList *requests = NULL; object_path = g_strdup_printf ("%s/CSHRoomChannel%u", tp_base_connection_get_object_path (self->priv->conn), handle); chan = g_object_new (EXAMPLE_TYPE_CSH_ROOM_CHANNEL, "connection", self->priv->conn, "object-path", object_path, "handle", handle, /* FIXME: initiator */ NULL); g_free (object_path); g_signal_connect (chan, "closed", (GCallback) channel_closed_cb, self); g_hash_table_insert (self->priv->channels, GUINT_TO_POINTER (handle), chan); if (request_token != NULL) requests = g_slist_prepend (requests, request_token); tp_channel_manager_emit_new_channel (self, TP_EXPORTABLE_CHANNEL (chan), requests); g_slist_free (requests); } static const gchar * const fixed_properties[] = { TP_PROP_CHANNEL_CHANNEL_TYPE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL }; static const gchar * const allowed_properties[] = { TP_PROP_CHANNEL_TARGET_HANDLE, TP_PROP_CHANNEL_TARGET_ID, NULL }; static void example_csh_room_manager_type_foreach_channel_class (GType type, TpChannelManagerTypeChannelClassFunc func, gpointer user_data) { GHashTable *table = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_ROOM, NULL); func (type, table, allowed_properties, user_data); g_hash_table_unref (table); } static gboolean example_csh_room_manager_request (ExampleCSHRoomManager *self, gpointer request_token, GHashTable *request_properties, gboolean require_new) { TpHandle handle; ExampleCSHRoomChannel *chan; GError *error = NULL; if (tp_strdiff (tp_asv_get_string (request_properties, TP_PROP_CHANNEL_CHANNEL_TYPE), TP_IFACE_CHANNEL_TYPE_TEXT)) { return FALSE; } if (tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) != TP_HANDLE_TYPE_ROOM) { return FALSE; } handle = tp_asv_get_uint32 (request_properties, TP_PROP_CHANNEL_TARGET_HANDLE, NULL); g_assert (handle != 0); if (tp_channel_manager_asv_has_unknown_properties (request_properties, fixed_properties, allowed_properties, &error)) { goto error; } chan = g_hash_table_lookup (self->priv->channels, GUINT_TO_POINTER (handle)); if (chan == NULL) { new_channel (self, handle, tp_base_connection_get_self_handle (self->priv->conn), request_token); } else if (require_new) { g_set_error (&error, TP_ERROR, TP_ERROR_NOT_AVAILABLE, "A Text channel for room #%u already exists", handle); goto error; } else { tp_channel_manager_emit_request_already_satisfied (self, request_token, TP_EXPORTABLE_CHANNEL (chan)); } return TRUE; error: tp_channel_manager_emit_request_failed (self, request_token, error->domain, error->code, error->message); g_error_free (error); return TRUE; } static gboolean example_csh_room_manager_create_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_csh_room_manager_request ( EXAMPLE_CSH_ROOM_MANAGER (manager), request_token, request_properties, TRUE); } static gboolean example_csh_room_manager_ensure_channel (TpChannelManager *manager, gpointer request_token, GHashTable *request_properties) { return example_csh_room_manager_request ( EXAMPLE_CSH_ROOM_MANAGER (manager), request_token, request_properties, FALSE); } static void channel_manager_iface_init (gpointer g_iface, gpointer data G_GNUC_UNUSED) { TpChannelManagerIface *iface = g_iface; iface->foreach_channel = example_csh_room_manager_foreach_channel; iface->type_foreach_channel_class = example_csh_room_manager_type_foreach_channel_class; iface->create_channel = example_csh_room_manager_create_channel; iface->ensure_channel = example_csh_room_manager_ensure_channel; /* In this channel manager, Request has the same semantics as Ensure */ iface->request_channel = example_csh_room_manager_ensure_channel; } telepathy-glib-0.24.2/examples/cm/channelspecific/room-manager.h0000644000175000017500000000342512652510705021531 00000000000000/* * manager.h - header for an example channel manager * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #ifndef __EXAMPLE_CSH_ROOM_MANAGER_H__ #define __EXAMPLE_CSH_ROOM_MANAGER_H__ #include #include G_BEGIN_DECLS typedef struct _ExampleCSHRoomManager ExampleCSHRoomManager; typedef struct _ExampleCSHRoomManagerClass ExampleCSHRoomManagerClass; typedef struct _ExampleCSHRoomManagerPrivate ExampleCSHRoomManagerPrivate; struct _ExampleCSHRoomManagerClass { GObjectClass parent_class; }; struct _ExampleCSHRoomManager { GObject parent; ExampleCSHRoomManagerPrivate *priv; }; GType example_csh_room_manager_get_type (void); /* TYPE MACROS */ #define EXAMPLE_TYPE_CSH_ROOM_MANAGER \ (example_csh_room_manager_get_type ()) #define EXAMPLE_CSH_ROOM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), EXAMPLE_TYPE_CSH_ROOM_MANAGER, \ ExampleCSHRoomManager)) #define EXAMPLE_CSH_ROOM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), EXAMPLE_TYPE_CSH_ROOM_MANAGER, \ ExampleCSHRoomManagerClass)) #define EXAMPLE_IS_CSH_ROOM_MANAGER(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), EXAMPLE_TYPE_CSH_ROOM_MANAGER)) #define EXAMPLE_IS_CSH_ROOM_MANAGER_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), EXAMPLE_TYPE_CSH_ROOM_MANAGER)) #define EXAMPLE_CSH_ROOM_MANAGER_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS ((obj), EXAMPLE_TYPE_CSH_ROOM_MANAGER, \ ExampleCSHRoomManagerClass)) G_END_DECLS #endif telepathy-glib-0.24.2/examples/README0000644000175000017500000000413312652510705014134 00000000000000telepathy-glib examples ======================= You can get more examples of telepathy-glib usage from: * the telepathy-glib branch of telepathy-inspector (versions >= 0.5.1 will use telepathy-glib) * the core connection managers (particularly telepathy-gabble; also telepathy-salut, telepathy-sofiasip and telepathy-haze) * the regression tests (tests/ in the source release) A valgrind suppressions file telepathy-glib-examples.supp was previously here, but it's been moved to tools/telepathy-glib.supp. client/list-managers.c ---------------------- List available connection managers. Usage: telepathy-example-list-managers client/inspect-cm.c ------------------- Introspect a connection manager (doesn't yet print out the information gathered, but it could). Example usage: telepathy-example-inspect-cm gabble client/list-connections.c ------------------------- List available connections. Usage: telepathy-example-list-connections client/inspect-connection.c --------------------------- Introspect a connection (as found by list-connections) and make an asynchronous method call to list its channels. Usage: one of telepathy-example-inspect-connection BUS_NAME telepathy-example-inspect-connection OBJECT_PATH telepathy-example-inspect-connection BUS_NAME OBJECT_PATH client/inspect-channel.c ------------------------ Introspect a channel (as found by inspect-connection) and print out its type, handle and interfaces. If it has the Group interface, also make a reentrant method call to list its members. Usage: telepathy-example-inspect-channel CONN_OBJECT_PATH CHAN_OBJECT_PATH cm/no-protocols/ ---------------- The simplest possible Telepathy connection manager. It doesn't support any protocols. cm/echo/ -------- A simple fake Telepathy connection manager, which supports text channels where the remote contact just echoes back your messages. extensions/ ----------- An example of how to add extra interfaces to telepathy-glib, for use with experimental or special-purpose interfaces. client/extended-client.c and cm/extended/ use the convenience library built by extensions/ to implement the Hats interface. telepathy-glib-0.24.2/examples/client/0000755000175000017500000000000014006623342014606 500000000000000telepathy-glib-0.24.2/examples/client/js/0000755000175000017500000000000014006623342015222 500000000000000telepathy-glib-0.24.2/examples/client/js/contact-list.js0000755000175000017500000000225012652510705020111 00000000000000#! /usr/bin/gjs const Gi = imports.gi; Gi.versions.TelepathyGLib = '0.12'; const Tp = imports.gi.TelepathyGLib; const Mainloop = imports.mainloop; let manager = Tp.AccountManager.dup(); let factory = manager.get_factory(); factory.add_account_features([Tp.Account.get_feature_quark_connection()]); factory.add_connection_features([Tp.Connection.get_feature_quark_contact_list()]); factory.add_contact_features([Tp.ContactFeature.CONTACT_GROUPS]); manager.prepare_async(null, function(self, result) { manager.prepare_finish(result); let accounts = manager.get_valid_accounts(); for (let i = 0; i < accounts.length; i++) { let connection = accounts[i].get_connection(); if (connection != null && connection.get_contact_list_state() == Tp.ContactListState.SUCCESS) { let contacts = connection.dup_contact_list(); for (let j = 0; j < contacts.length; j++) { let contact = contacts[j]; // poor man's printf... print (contact.get_identifier() + ' (' + contact.get_contact_groups() + ')'); } } } Mainloop.quit('example'); }); Mainloop.run('example'); telepathy-glib-0.24.2/examples/client/js/Makefile.am0000644000175000017500000000010112652510705017171 00000000000000EXTRA_DIST = \ contact-list.js \ debug-client.js \ $(NULL) telepathy-glib-0.24.2/examples/client/js/Makefile.in0000644000175000017500000003362414006601553017217 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples/client/js ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXTRA_DIST = \ contact-list.js \ debug-client.js \ $(NULL) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/client/js/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/client/js/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/client/js/debug-client.js0000755000175000017500000001672112652510705020057 00000000000000#! /usr/bin/gjs // // A simple Telepathy debug-message collector. // // Copyright © 2013 Intel Corporation // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA const Gi = imports.gi; Gi.versions.TelepathyGLib = '0.12'; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; const Lang = imports.lang; const Mainloop = imports.mainloop; const Tp = imports.gi.TelepathyGLib; // this is just a subset const DBusDaemonIface = ; const DBusDaemonProxy = Gio.DBusProxy.makeProxyWrapper(DBusDaemonIface); function levelStr(level) { bits = [] if (level & GLib.LogLevelFlags.FLAG_FATAL) bits.push('FATAL') if (level & GLib.LogLevelFlags.LEVEL_ERROR) bits.push('ERROR') if (level & GLib.LogLevelFlags.LEVEL_CRITICAL) bits.push('CRITICAL') if (level & GLib.LogLevelFlags.LEVEL_WARNING) bits.push('WARNING') if (level & GLib.LogLevelFlags.LEVEL_MESSAGE) bits.push('MESSAGE') if (level & GLib.LogLevelFlags.LEVEL_INFO) bits.push('INFO') if (level & GLib.LogLevelFlags.LEVEL_DEBUG) bits.push('DEBUG') if (level & GLib.LogLevelFlags.FLAG_RECURSION) bits.push('RECURSION') if (bits.length > 0) { return bits.join('|') } else { return '(level?)' } } function zeroPad(x) { let s = x.toString(); while (s.length < 6) s = '0' + s; return s; } DebugClient = new Lang.Class({ Name: 'DebugClient', Extends: Gio.Application, _init: function() { this.parent({application_id: 'im.telepathy.TpGLib.Example.DebugClient', flags: Gio.ApplicationFlags.NON_UNIQUE }); this.json = false; this._gdbus = Gio.DBus.session; this._dbusDaemon = Tp.DBusDaemon.dup(); this._debuggables = {}; this._timeOrigin = null; this._gdbusProxy = new DBusDaemonProxy(Gio.DBus.session, 'org.freedesktop.DBus', '/org/freedesktop/DBus'); this._gdbusProxy.connectSignal('NameOwnerChanged', Lang.bind(this, this._onNameOwnerChanged)); this._gdbusProxy.ListNamesRemote(Lang.bind(this, this._listNamesCb)); }, vfunc_activate: function() { this.hold(); }, _setEnabledCb: function(debugClient, result) { try { debugClient.set_enabled_finish(result); } catch (e) { logError(e, 'Unable to enable debug client ' + debugClient.get_bus_name()); } }, _getMessagesCb: function(debugClient, result) { let messages; try { messages = debugClient.get_messages_finish(result); } catch (e) { logError(e, 'Unable to enable debug client ' + debugClient.get_bus_name()); return; } for (i in messages) { this._newDebugMessageCb(debugClient, messages[i]); } }, _newDebugMessageCb: function(debugClient, debugMessage) { let dateTime = debugMessage.get_time(); if (!this._timeOrigin) this._timeOrigin = dateTime; if (this.json) { print(JSON.stringify({ time: dateTime.format('%Y-%m-%d %H:%M:%S'), usec: dateTime.difference(this._timeOrigin), uniqueName: debugClient.get_bus_name(), domain: debugMessage.get_domain(), category: debugMessage.get_category(), level: debugMessage.get_level(), message: debugMessage.get_message(), stamp: (dateTime.to_unix() * 1000000) + dateTime.get_microsecond(), })); } else { print(dateTime.format('%Y-%m-%d %H:%M:%S.') + zeroPad(dateTime.get_microsecond(), 6) + ' ' + debugClient.get_bus_name() + ' ' + debugMessage.get_domain() + '/' + debugMessage.get_category() + ' ' + levelStr(debugMessage.get_level()) + ': ' + debugMessage.get_message()); } }, _addDebuggable: function(wellKnownName, owner) { if (owner == null) { this._gdbusProxy.GetNameOwnerRemote(wellKnownName, Lang.bind(this, function(result, error) { if (error) { logError(error); } else if (result[0] != null) { print(result[0] + ' owns well-known name ' + wellKnownName); this._addDebuggable(wellKnownName, result[0]); } else { log('owner of ' + wellKnownName + ' is null?!'); } })); return; } if (owner in this._debuggables || owner == this._dbusDaemon.get_unique_name() || owner == this._gdbus.get_unique_name()) return; debugClient = Tp.DebugClient.new(this._dbusDaemon, owner); this._debuggables[owner] = debugClient; debugClient.connect('new-debug-message', Lang.bind(this, this._newDebugMessageCb)); debugClient.set_enabled_async(true, Lang.bind(this, this._setEnabledCb), null); debugClient.get_messages_async(Lang.bind(this, this._getMessagesCb)); }, _isInteresting: function(wellKnownName) { return (GLib.str_has_prefix(wellKnownName, 'org.freedesktop.Telepathy')); }, _onNameOwnerChanged: function(proxy, sender, [wellKnownName, oldOwner, newOwner]) { if (this._isInteresting(wellKnownName) && newOwner != '') { print(newOwner + ' owns well-known name ' + wellKnownName); this._addDebuggable(wellKnownName, newOwner); } }, _listNamesCb: function(result, error) { if (error) { logError(error, 'Unable to list bus names'); return; } for (i in result[0]) { let wellKnownName = result[0][i]; if (this._isInteresting(wellKnownName)) { this._addDebuggable(wellKnownName, null); } } }, }); let main = function () { let app = new DebugClient(); for (i in ARGV) { if (ARGV[i] == '--json') app.json = true; else { printerr('Usage: telepathy-debug-client [--json]'); return 1; } } return app.run(ARGV); }; main(); telepathy-glib-0.24.2/examples/client/list-connections.c0000644000175000017500000000401412652510705020167 00000000000000/* * telepathy-example-list-managers - list installed connection managers * * Copyright (C) 2008 Collabora Ltd. * Copyright (C) 2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include typedef struct { GMainLoop *mainloop; int exit_code; } ExampleData; static void got_connections (const gchar * const *bus_names, gsize n, const gchar * const *cms, const gchar * const *protocols, const GError *error, gpointer user_data, GObject *unused) { ExampleData *data = user_data; if (error != NULL) { g_warning ("%s", error->message); data->exit_code = 1; } else { gsize i; g_message ("Found %" G_GSIZE_FORMAT " connections:", n); for (i = 0; i < n; i++) { g_message ("%s", bus_names[i]); g_message ("- CM %s, protocol %s", cms[i], protocols[i]); } /* all the arrays are also NULL-terminated */ g_assert (bus_names[n] == NULL && cms[n] == NULL && protocols[n] == NULL); } g_main_loop_quit (data->mainloop); } int main (int argc, char **argv) { ExampleData data = { g_main_loop_new (NULL, FALSE), 0 }; TpDBusDaemon *bus_daemon; GError *error = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) { g_warning ("%s", error->message); g_error_free (error); data.exit_code = 1; goto out; } tp_list_connection_names (bus_daemon, got_connections, &data, NULL, NULL); g_main_loop_run (data.mainloop); out: if (data.mainloop != NULL) g_main_loop_unref (data.mainloop); if (bus_daemon != NULL) g_object_unref (bus_daemon); return data.exit_code; } telepathy-glib-0.24.2/examples/client/extended-client.c0000644000175000017500000001765712652510705017771 00000000000000/* * telepathy-example-client-extended - use an extended connection manager * * Usage: * * telepathy-example-client-extended * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include /* Usually this'd be a top-level extensions/ directory in practice */ #include "examples/extensions/extensions.h" static guint timer; static int main_ret = 1; static GMainLoop *mainloop; static gboolean die_if (const GError *error, const gchar *context) { if (error != NULL) { g_warning ("%s: %s", context, error->message); g_main_loop_quit (mainloop); return TRUE; } return FALSE; } static void disconnect_cb (TpConnection *conn, const GError *error, gpointer user_data, GObject *weak_object) { if (die_if (error, "Disconnect()")) return; main_ret = 0; g_main_loop_quit (mainloop); } typedef struct { TpContact *contacts[2]; } ContactPair; static void got_hats_cb (TpConnection *conn, const GPtrArray *hats, const GError *error, gpointer user_data, GObject *weak_object) { guint i; if (die_if (error, "GetHats()")) return; for (i = 0; i < hats->len; i++) { GValueArray *vals = g_ptr_array_index (hats, i); guint handle; const gchar *color; guint style; GHashTable *details; tp_value_array_unpack (vals, 4, &handle, &color, &style, &details); g_message ("Contact #%u has hat style %u, color \"%s\", with %u " "properties", handle, style, color, g_hash_table_size (details)); } tp_cli_connection_call_disconnect (conn, -1, disconnect_cb, NULL, NULL, NULL); } static void set_hat_cb (TpConnection *conn, const GError *error, gpointer user_data, GObject *weak_object) { ContactPair *pair = user_data; GArray *handles = NULL; TpHandle handle; if (die_if (error, "SetHat()")) return; handles = g_array_sized_new (FALSE, FALSE, sizeof (TpHandle), 2); handle = tp_contact_get_handle (pair->contacts[0]); g_array_append_val (handles, handle); handle = tp_contact_get_handle (pair->contacts[1]); g_array_append_val (handles, handle); example_cli_connection_interface_hats_call_get_hats (conn, -1, handles, got_hats_cb, NULL, NULL, NULL); } static void contact_pair_free (gpointer p) { ContactPair *pair = p; g_object_unref (pair->contacts[0]); g_object_unref (pair->contacts[1]); g_slice_free (ContactPair, pair); } static void contact_ready_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpConnection *conn = (TpConnection *) object; GHashTable *asv; ContactPair *pair; GError *error = NULL; pair = g_slice_new0 (ContactPair); pair->contacts[0] = tp_connection_dup_contact_by_id_finish (conn, result, &error); pair->contacts[1] = g_object_ref (tp_connection_get_self_contact (conn)); if (die_if (error, "tp_connection_dup_contact_by_id_async()")) { g_clear_error (&error); contact_pair_free (pair); return; } asv = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (asv, "previous-owner", tp_g_value_slice_new_static_string ("Shadowman")); example_cli_connection_interface_hats_call_set_hat (conn, -1, "red", EXAMPLE_HAT_STYLE_FEDORA, asv, set_hat_cb, pair, contact_pair_free, NULL); g_hash_table_unref (asv); } static void conn_ready (GObject *source, GAsyncResult *result, gpointer user_data) { GError *error = NULL; TpConnection *conn = TP_CONNECTION (source); if (!tp_proxy_prepare_finish (conn, result, &error)) { g_warning ("%s", error->message); g_main_loop_quit (mainloop); g_clear_error (&error); return; } if (!tp_proxy_has_interface_by_id (conn, EXAMPLE_IFACE_QUARK_CONNECTION_INTERFACE_HATS)) { g_warning ("Connection does not support Hats interface"); g_main_loop_quit (mainloop); return; } /* Get contact object for someone else */ tp_connection_dup_contact_by_id_async (conn, "other@server", 0, NULL, contact_ready_cb, NULL); } static void conn_status_changed (TpConnection *conn, guint status, guint reason, gpointer user_data, GObject *weak_object) { g_message ("Connection status changed to %u because %u", status, reason); if (status == TP_CONNECTION_STATUS_DISCONNECTED) { g_message ("Disconnected - exiting"); g_main_loop_quit (mainloop); } } static void cm_requested_connection (TpConnectionManager *manager, const gchar *bus_name, const gchar *object_path, const GError *error, gpointer user_data, GObject *weak_object) { TpSimpleClientFactory *factory; GError *e = NULL; TpConnection *conn; if (die_if (error, "RequestConnection()")) return; /* Because we don't have an AccountManager, we have to do more work here. */ factory = tp_simple_client_factory_new (NULL); conn = tp_simple_client_factory_ensure_connection (factory, object_path, NULL, &e); g_object_unref (factory); if (conn == NULL) { g_warning ("tp_connection_new(): %s", error->message); g_main_loop_quit (mainloop); return; } /* the connection hasn't had a chance to become invalid yet, so we can * assume that this signal connection will work */ tp_cli_connection_connect_to_status_changed (conn, conn_status_changed, NULL, NULL, NULL, NULL); tp_proxy_prepare_async (conn, NULL, conn_ready, NULL); tp_cli_connection_call_connect (conn, -1, NULL, NULL, NULL, NULL); } static void connection_manager_got_info (TpConnectionManager *cm, guint source, gpointer unused) { g_message ("Emitted got-info (source=%d)", source); if (source > 0) { GHashTable *params; GValue value = { 0 }; if (timer != 0) { g_source_remove (timer); timer = 0; } params = g_hash_table_new (g_str_hash, g_str_equal); g_value_init (&value, G_TYPE_STRING); g_value_set_static_string (&value, "myself@server"); g_hash_table_insert (params, "account", &value); /* This example is rather lower-level than most: it's * "going behind the account manager's back". This is not recommended * in real applications. */ tp_cli_connection_manager_call_request_connection (cm, -1, "example", params, cm_requested_connection, NULL, NULL, NULL); g_hash_table_unref (params); } } static gboolean time_out (gpointer unused) { g_warning ("Timed out trying to get CM info"); g_main_loop_quit (mainloop); return FALSE; } int main (int argc, char **argv) { TpConnectionManager *cm = NULL; GError *error = NULL; TpDBusDaemon *dbus = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); example_cli_init (); dbus = tp_dbus_daemon_dup (&error); if (dbus == NULL) { g_warning ("%s", error->message); g_error_free (error); goto out; } mainloop = g_main_loop_new (NULL, FALSE); cm = tp_connection_manager_new (dbus, "example_extended", NULL, &error); if (cm == NULL) { g_warning ("%s", error->message); goto out; } g_signal_connect (cm, "got-info", G_CALLBACK (connection_manager_got_info), NULL); timer = g_timeout_add (5000, time_out, NULL); g_main_loop_run (mainloop); out: if (cm != NULL) g_object_unref (cm); if (dbus != NULL) g_object_unref (dbus); if (mainloop != NULL) g_main_loop_unref (mainloop); return main_ret; } telepathy-glib-0.24.2/examples/client/inspect-cm.c0000644000175000017500000001727712652510705016755 00000000000000/* * telepathy-example-inspect-cm - inspect a connection manager * * Usage: * * telepathy-example-inspect-cm gabble * Inspect the Gabble connection manager, by reading the installed * .manager file if available, and introspecting the running CM if not * * telepathy-example-inspect-cm gabble data/gabble.manager * As above, but assume the given filename is correct * * telepathy-example-inspect-cm gabble "" * Don't read any .manager file, just introspect the running CM * * Copyright (C) 2007 Collabora Ltd. * Copyright (C) 2007 Nokia Corporation * Copyright (C) 2013 Intel Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include static const gchar * nonnull (const gchar *s) { if (s == NULL) return "(null)"; return s; } static void show_cm (TpConnectionManager *cm) { GList *protocols; g_message ("Connection manager name: %s", tp_connection_manager_get_name (cm)); g_message ("Is running: %s", tp_connection_manager_is_running (cm) ? "yes" : "no"); g_message ("Source of information: %s", tp_connection_manager_get_info_source (cm) == TP_CM_INFO_SOURCE_LIVE ? "D-Bus" : ".manager file"); protocols = tp_connection_manager_dup_protocols (cm); while (protocols) { TpProtocol *protocol = protocols->data; GList *params; const gchar *const *strv; const gchar *const *strv_iter; TpAvatarRequirements *avatar_reqs; g_message ("Protocol: %s", tp_protocol_get_name (protocol)); g_message ("\tEnglish name: %s", tp_protocol_get_english_name (protocol)); g_message ("\tIcon name: %s", tp_protocol_get_icon_name (protocol)); g_message ("\tvCard field: %s", nonnull (tp_protocol_get_vcard_field (protocol))); g_message ("\tCan register accounts via Telepathy: %s", tp_protocol_can_register (protocol) ? "yes" : "no"); strv = tp_protocol_get_authentication_types (protocol); for (strv_iter = strv; strv_iter != NULL && *strv_iter != NULL; strv_iter++) g_message ("\tAuthentication type: %s", *strv_iter); avatar_reqs = tp_protocol_get_avatar_requirements (protocol); if (avatar_reqs == NULL) { g_message ("\tNo known avatar requirements, or no avatar support"); } else { gboolean first = TRUE; g_message ("\tAvatar requirements:"); for (strv_iter = (const gchar * const *) avatar_reqs->supported_mime_types; strv_iter != NULL && *strv_iter != NULL; strv_iter++) { g_message ("\t\t%s MIME type: %s", (first ? "Recommended" : "Supported"), *strv_iter); first = FALSE; } g_message ("\t\tMinimum: %ux%u px", avatar_reqs->minimum_width, avatar_reqs->minimum_height); g_message ("\t\tRecommended: %ux%u px", avatar_reqs->recommended_width, avatar_reqs->recommended_height); g_message ("\t\tMaximum: %ux%u px, %u bytes", avatar_reqs->maximum_width, avatar_reqs->maximum_height, avatar_reqs->maximum_bytes); } params = tp_protocol_dup_params (protocol); while (params) { TpConnectionManagerParam *param = params->data; GValue value = { 0 }; g_message ("\tParameter: %s", tp_connection_manager_param_get_name (param)); g_message ("\t\tD-Bus signature: %s", tp_connection_manager_param_get_dbus_signature (param)); g_message ("\t\tIs required: %s", tp_connection_manager_param_is_required (param) ? "yes" : "no"); if (tp_protocol_can_register (protocol)) { g_message ("\t\tIs required for registration: %s", tp_connection_manager_param_is_required_for_registration ( param) ? "yes" : "no"); } g_message ("\t\tIs secret (password etc.): %s", tp_connection_manager_param_is_secret (param) ? "yes" : "no"); g_message ("\t\tIs a D-Bus property: %s", tp_connection_manager_param_is_dbus_property (param) ? "yes" : "no"); if (tp_connection_manager_param_get_default (param, &value)) { gchar *s = g_strdup_value_contents (&value); g_message ("\t\tDefault value: %s", s); g_free (s); g_value_unset (&value); } else { g_message ("\t\tNo default value"); } tp_connection_manager_param_free (param); params = g_list_delete_link (params, params); } g_object_unref (protocol); protocols = g_list_delete_link (protocols, protocols); } } static void list_cb (GObject *source G_GNUC_UNUSED, GAsyncResult *result, gpointer user_data) { GMainLoop *mainloop = user_data; GError *error = NULL; GList *cms = tp_list_connection_managers_finish (result, &error); if (error != NULL) { g_warning ("Error getting list of CMs: %s", error->message); g_error_free (error); } else if (cms == NULL) { g_message ("No Telepathy connection managers found"); } else { while (cms != NULL) { show_cm (cms->data); g_object_unref (cms->data); cms = g_list_delete_link (cms, cms); if (cms != NULL) g_message ("----------------------------------------"); } } g_main_loop_quit (mainloop); } static void ready (GObject *source, GAsyncResult *result, gpointer user_data) { TpConnectionManager *cm = TP_CONNECTION_MANAGER (source); GMainLoop *mainloop = user_data; GError *error = NULL; if (!tp_proxy_prepare_finish (cm, result, &error)) { g_assert (!tp_proxy_is_prepared (cm, TP_CONNECTION_MANAGER_FEATURE_CORE)); g_warning ("Error getting CM info: %s", error->message); g_error_free (error); } else { g_assert (tp_proxy_is_prepared (cm, TP_CONNECTION_MANAGER_FEATURE_CORE)); show_cm (cm); } g_main_loop_quit (mainloop); } int main (int argc, char **argv) { const gchar *cm_name, *manager_file; TpConnectionManager *cm = NULL; GMainLoop *mainloop = NULL; GError *error = NULL; TpDBusDaemon *dbus = NULL; int ret = 1; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (g_getenv ("EXAMPLE_TIMING") != NULL) g_log_set_default_handler (tp_debug_timestamped_log_handler, NULL); dbus = tp_dbus_daemon_dup (&error); if (dbus == NULL) { g_warning ("%s", error->message); g_error_free (error); goto out; } mainloop = g_main_loop_new (NULL, FALSE); if (argc >= 2) { cm_name = argv[1]; manager_file = argv[2]; /* possibly NULL */ cm = tp_connection_manager_new (dbus, cm_name, manager_file, &error); if (cm == NULL) { g_warning ("%s", error->message); g_error_free (error); goto out; } tp_proxy_prepare_async (cm, NULL, ready, mainloop); } else { tp_list_connection_managers_async (dbus, list_cb, mainloop); } g_main_loop_run (mainloop); ret = 0; out: if (cm != NULL) g_object_unref (cm); if (mainloop != NULL) g_main_loop_unref (mainloop); if (dbus != NULL) g_object_unref (dbus); return ret; } telepathy-glib-0.24.2/examples/client/media-observer.c0000644000175000017500000000534312652510705017606 00000000000000/* * media-observer - Observe media channels * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include static void chan_invalidated_cb (TpProxy *proxy, guint domain, gint code, gchar *message, gpointer user_data) { TpChannel *channel = TP_CHANNEL (proxy); g_print ("Call with %s terminated\n", tp_channel_get_identifier (channel)); g_object_unref (channel); } static void observe_channels_cb (TpSimpleObserver *self, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *dispatch_operation, GList *requests, TpObserveChannelsContext *context, gpointer user_data) { GList *l; gboolean recovering; recovering = tp_observe_channels_context_is_recovering (context); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; gboolean requested; if (tp_strdiff (tp_channel_get_channel_type (channel), TP_IFACE_CHANNEL_TYPE_CALL)) continue; requested = tp_channel_get_requested (channel); g_print ("Observing %s %s call %s %s\n", recovering? "existing": "new", requested? "outgoing": "incoming", requested? "to": "from", tp_channel_get_identifier (channel)); g_signal_connect (g_object_ref (channel), "invalidated", G_CALLBACK (chan_invalidated_cb), NULL); } tp_observe_channels_context_accept (context); } int main (int argc, char **argv) { GMainLoop *mainloop; TpAccountManager *manager; GError *error = NULL; TpBaseClient *observer; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); manager = tp_account_manager_dup (); observer = tp_simple_observer_new_with_am (manager, FALSE, "ExampleMediaObserver", FALSE, observe_channels_cb, NULL, NULL); tp_base_client_take_observer_filter (observer, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); if (!tp_base_client_register (observer, &error)) { g_warning ("Failed to register Observer: %s\n", error->message); g_error_free (error); goto out; } g_print ("Start observing\n"); mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); if (mainloop != NULL) g_main_loop_unref (mainloop); out: g_object_unref (manager); g_object_unref (observer); return 0; } telepathy-glib-0.24.2/examples/client/inspect-channel.c0000644000175000017500000001055212652510705017753 00000000000000/* * telepathy-example-inspect-channel - inspect a channel * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include typedef struct { int exit_status; GMainLoop *main_loop; const gchar *object_path; } InspectChannelData; static void channel_ready_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpChannel *channel = TP_CHANNEL (source); InspectChannelData *data = user_data; guint handle_type, handle; gchar *channel_type; gchar **interfaces, **iter; GError *error = NULL; if (!tp_proxy_prepare_finish (channel, result, &error)) { g_warning ("%s", error->message); data->exit_status = 1; g_main_loop_quit (data->main_loop); g_clear_error (&error); return; } g_object_get (channel, "channel-type", &channel_type, "handle-type", &handle_type, "handle", &handle, "interfaces", &interfaces, NULL); printf ("Type: %s\n", channel_type); printf ("Handle: of type %u, #%u\n", handle_type, handle); puts ("Interfaces:"); for (iter = interfaces; iter != NULL && *iter != NULL; iter++) { printf ("\t%s\n", *iter); } g_free (channel_type); g_strfreev (interfaces); if (tp_proxy_has_interface_by_id (channel, TP_IFACE_QUARK_CHANNEL_INTERFACE_GROUP)) { GPtrArray *members = tp_channel_group_dup_members_contacts (channel); guint i; printf ("Group members:\n"); for (i = 0; i < members->len; i++) { TpContact *member = g_ptr_array_index (members, i); printf ("\tcontact #%u %s\n", tp_contact_get_handle (member), tp_contact_get_identifier (member)); } g_ptr_array_unref (members); } data->exit_status = 0; g_main_loop_quit (data->main_loop); } static void connection_ready_cb (GObject *source, GAsyncResult *result, gpointer user_data) { InspectChannelData *data = user_data; GError *error = NULL; TpSimpleClientFactory *factory; TpConnection *connection = TP_CONNECTION (source); TpChannel *channel = NULL; if (!tp_proxy_prepare_finish (connection, result, &error)) { g_warning ("%s", error->message); data->exit_status = 1; g_main_loop_quit (data->main_loop); g_clear_error (&error); return; } factory = tp_proxy_get_factory (connection); channel = tp_simple_client_factory_ensure_channel (factory, connection, data->object_path, NULL, &error); if (channel == NULL) { g_warning ("%s", error->message); g_error_free (error); data->exit_status = 1; g_main_loop_quit (data->main_loop); return; } tp_proxy_prepare_async (channel, NULL, channel_ready_cb, user_data); /* the channel will remain referenced as long as it has calls pending on * it */ g_object_unref (channel); } int main (int argc, char **argv) { InspectChannelData data = { 1, NULL, NULL }; TpSimpleClientFactory *factory; TpConnection *connection = NULL; GError *error = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (argc < 3) { fputs ("Usage:\n" " telepathy-example-inspect-channel CONN_PATH CHANNEL_PATH\n", stderr); return 2; } data.object_path = argv[2]; factory = tp_simple_client_factory_new (NULL); connection = tp_simple_client_factory_ensure_connection (factory, argv[1], NULL, &error); if (connection == NULL) { g_warning ("%s", error->message); g_error_free (error); data.exit_status = 1; goto out; } data.main_loop = g_main_loop_new (NULL, FALSE); /* for this example I assume it's an existing connection on which someone * else has called (or will call) Connect(), so we won't call Connect() * on it ourselves */ tp_proxy_prepare_async (connection, NULL, connection_ready_cb, &data); g_main_loop_run (data.main_loop); out: if (data.main_loop != NULL) g_main_loop_unref (data.main_loop); if (connection != NULL) g_object_unref (connection); g_object_unref (factory); return data.exit_status; } telepathy-glib-0.24.2/examples/client/contact-list.c0000644000175000017500000000555612652510705017314 00000000000000/* * contact-list * * Copyright © 2011 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include static void account_manager_prepared_cb (GObject *object, GAsyncResult *res, gpointer user_data) { TpAccountManager *manager = (TpAccountManager *) object; GMainLoop *loop = user_data; GList *accounts, *l; GError *error = NULL; if (!tp_proxy_prepare_finish (object, res, &error)) { g_print ("Error preparing AM: %s\n", error->message); goto OUT; } accounts = tp_account_manager_dup_valid_accounts (manager); for (l = accounts; l != NULL; l = l->next) { TpAccount *account = l->data; TpConnection *connection = tp_account_get_connection (account); GPtrArray *contacts; guint i; /* Verify account is online and received its contact list. If state is not * SUCCESS this means we didn't received the roster from server yet and * we would have to wait for the "notify:contact-list-state" signal. */ if (connection == NULL || tp_connection_get_contact_list_state (connection) != TP_CONTACT_LIST_STATE_SUCCESS) continue; contacts = tp_connection_dup_contact_list (connection); for (i = 0; i < contacts->len; i++) { TpContact *contact = g_ptr_array_index (contacts, i); const gchar * const *groups; g_print ("contact %s (%s) in groups:\n", tp_contact_get_identifier (contact), tp_contact_get_alias (contact)); for (groups = tp_contact_get_contact_groups (contact); *groups != NULL; groups++) g_print (" %s\n", *groups); } g_ptr_array_unref (contacts); } g_list_free_full (accounts, g_object_unref); OUT: g_main_loop_quit (loop); } int main (int argc, char **argv) { TpAccountManager *manager; TpSimpleClientFactory *factory; GMainLoop *loop; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); loop = g_main_loop_new (NULL, FALSE); manager = tp_account_manager_dup (); factory = tp_proxy_get_factory (manager); tp_simple_client_factory_add_account_features_varargs (factory, TP_ACCOUNT_FEATURE_CONNECTION, 0); tp_simple_client_factory_add_connection_features_varargs (factory, TP_CONNECTION_FEATURE_CONTACT_LIST, 0); tp_simple_client_factory_add_contact_features_varargs (factory, TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_CONTACT_GROUPS, TP_CONTACT_FEATURE_INVALID); tp_proxy_prepare_async (manager, NULL, account_manager_prepared_cb, loop); g_main_loop_run (loop); g_object_unref (manager); g_main_loop_unref (loop); return 0; } telepathy-glib-0.24.2/examples/client/text-handler.c0000644000175000017500000000754412652510705017306 00000000000000/* * text-handler - Handle text channels * * Simple text channel handler echoing received message in upper case * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include static void echo_message (TpTextChannel *channel, TpMessage *message, gboolean pending) { gchar *text; gchar *up; TpMessage *reply; TpChannelTextMessageFlags flags; const gchar *comment = ""; text = tp_message_to_text (message, &flags); if (flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT) { comment = " (and some non-text content we don't understand)"; } if (pending) g_print ("pending: '%s' %s\n", text, comment); else g_print ("received: '%s' %s\n", text, comment); up = g_ascii_strup (text, -1); g_print ("send: %s\n", up); reply = tp_client_message_new_text (TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, up); tp_text_channel_send_message_async (channel, reply, 0, NULL, NULL); g_free (text); g_free (up); g_object_unref (reply); } static void message_received_cb (TpTextChannel *channel, TpMessage *message, gpointer user_data) { echo_message (channel, message, FALSE); tp_text_channel_ack_message_async (channel, message, NULL, NULL); } static void display_pending_messages (TpTextChannel *channel) { GList *messages, *l; messages = tp_text_channel_dup_pending_messages (channel); for (l = messages; l != NULL; l = g_list_next (l)) { TpMessage *msg = l->data; echo_message (channel, msg, TRUE); } tp_text_channel_ack_messages_async (channel, messages, NULL, NULL); g_list_free_full (messages, g_object_unref); } static void handle_channels_cb (TpSimpleHandler *self, TpAccount *account, TpConnection *connection, GList *channels, GList *requests, gint64 user_action_time, TpHandleChannelsContext *context, gpointer user_data) { GList *l; for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; TpTextChannel *text_chan = l->data; if (!TP_IS_TEXT_CHANNEL (channel)) continue; g_print ("Handling text channel with %s\n", tp_channel_get_identifier (channel)); g_signal_connect (channel, "message-received", G_CALLBACK (message_received_cb), NULL); /* The default TpAutomaticClientFactory used by * tp_account_manager_dup() has already prepared * TP_TEXT_CHANNEL_FEATURE_INCOMING_MESSAGES, if possible. */ display_pending_messages (text_chan); } tp_handle_channels_context_accept (context); } int main (int argc, char **argv) { GMainLoop *mainloop; TpAccountManager *manager; GError *error = NULL; TpBaseClient *handler; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); manager = tp_account_manager_dup (); handler = tp_simple_handler_new_with_am (manager, FALSE, FALSE, "ExampleHandler", FALSE, handle_channels_cb, NULL, NULL); tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_REQUESTED, G_TYPE_BOOLEAN, FALSE, NULL)); if (!tp_base_client_register (handler, &error)) { g_warning ("Failed to register Handler: %s\n", error->message); g_error_free (error); goto out; } g_print ("Waiting for channels\n"); mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); if (mainloop != NULL) g_main_loop_unref (mainloop); out: g_object_unref (manager); g_object_unref (handler); return 0; } telepathy-glib-0.24.2/examples/client/Makefile.am0000644000175000017500000000403312652510705016565 00000000000000SUBDIRS = stream-tubes dbus-tubes python js EXAMPLES = EXAMPLES += telepathy-example-inspect-channel telepathy_example_inspect_channel_SOURCES = inspect-channel.c EXAMPLES += telepathy-example-inspect-connection telepathy_example_inspect_connection_SOURCES = inspect-connection.c EXAMPLES += telepathy-example-inspect-contact telepathy_example_inspect_contact_SOURCES = inspect-contact.c EXAMPLES += telepathy-example-inspect-cm telepathy_example_inspect_cm_SOURCES = inspect-cm.c EXAMPLES += telepathy-example-list-connections telepathy_example_list_connections_SOURCES = list-connections.c EXAMPLES += telepathy-example-list-managers telepathy_example_list_managers_SOURCES = list-managers.c EXAMPLES += telepathy-example-extended-client telepathy_example_extended_client_SOURCES = extended-client.c telepathy_example_extended_client_LDADD = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(LDADD) EXAMPLES += telepathy-example-media-observer telepathy_example_media_observer_SOURCES = media-observer.c EXAMPLES += telepathy-example-approver telepathy_example_approver_SOURCES = approver.c EXAMPLES += telepathy-example-text-handler telepathy_example_text_handler_SOURCES = text-handler.c EXAMPLES += telepathy-example-contact-list telepathy_example_contact_list_SOURCES = contact-list.c if INSTALL_EXAMPLES bin_PROGRAMS = $(EXAMPLES) else noinst_PROGRAMS = $(EXAMPLES) endif # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/client/Makefile.in0000644000175000017500000011552114006601553016600 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_EXAMPLES_TRUE@bin_PROGRAMS = $(am__EXEEXT_1) @INSTALL_EXAMPLES_FALSE@noinst_PROGRAMS = $(am__EXEEXT_1) subdir = examples/client ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = telepathy-example-inspect-channel$(EXEEXT) \ telepathy-example-inspect-connection$(EXEEXT) \ telepathy-example-inspect-contact$(EXEEXT) \ telepathy-example-inspect-cm$(EXEEXT) \ telepathy-example-list-connections$(EXEEXT) \ telepathy-example-list-managers$(EXEEXT) \ telepathy-example-extended-client$(EXEEXT) \ telepathy-example-media-observer$(EXEEXT) \ telepathy-example-approver$(EXEEXT) \ telepathy-example-text-handler$(EXEEXT) \ telepathy-example-contact-list$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_telepathy_example_approver_OBJECTS = approver.$(OBJEXT) telepathy_example_approver_OBJECTS = \ $(am_telepathy_example_approver_OBJECTS) telepathy_example_approver_LDADD = $(LDADD) am__DEPENDENCIES_1 = telepathy_example_approver_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_telepathy_example_contact_list_OBJECTS = contact-list.$(OBJEXT) telepathy_example_contact_list_OBJECTS = \ $(am_telepathy_example_contact_list_OBJECTS) telepathy_example_contact_list_LDADD = $(LDADD) telepathy_example_contact_list_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_extended_client_OBJECTS = \ extended-client.$(OBJEXT) telepathy_example_extended_client_OBJECTS = \ $(am_telepathy_example_extended_client_OBJECTS) am__DEPENDENCIES_2 = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) telepathy_example_extended_client_DEPENDENCIES = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(am__DEPENDENCIES_2) am_telepathy_example_inspect_channel_OBJECTS = \ inspect-channel.$(OBJEXT) telepathy_example_inspect_channel_OBJECTS = \ $(am_telepathy_example_inspect_channel_OBJECTS) telepathy_example_inspect_channel_LDADD = $(LDADD) telepathy_example_inspect_channel_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_inspect_cm_OBJECTS = inspect-cm.$(OBJEXT) telepathy_example_inspect_cm_OBJECTS = \ $(am_telepathy_example_inspect_cm_OBJECTS) telepathy_example_inspect_cm_LDADD = $(LDADD) telepathy_example_inspect_cm_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_inspect_connection_OBJECTS = \ inspect-connection.$(OBJEXT) telepathy_example_inspect_connection_OBJECTS = \ $(am_telepathy_example_inspect_connection_OBJECTS) telepathy_example_inspect_connection_LDADD = $(LDADD) telepathy_example_inspect_connection_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_inspect_contact_OBJECTS = \ inspect-contact.$(OBJEXT) telepathy_example_inspect_contact_OBJECTS = \ $(am_telepathy_example_inspect_contact_OBJECTS) telepathy_example_inspect_contact_LDADD = $(LDADD) telepathy_example_inspect_contact_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_list_connections_OBJECTS = \ list-connections.$(OBJEXT) telepathy_example_list_connections_OBJECTS = \ $(am_telepathy_example_list_connections_OBJECTS) telepathy_example_list_connections_LDADD = $(LDADD) telepathy_example_list_connections_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_list_managers_OBJECTS = list-managers.$(OBJEXT) telepathy_example_list_managers_OBJECTS = \ $(am_telepathy_example_list_managers_OBJECTS) telepathy_example_list_managers_LDADD = $(LDADD) telepathy_example_list_managers_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_media_observer_OBJECTS = \ media-observer.$(OBJEXT) telepathy_example_media_observer_OBJECTS = \ $(am_telepathy_example_media_observer_OBJECTS) telepathy_example_media_observer_LDADD = $(LDADD) telepathy_example_media_observer_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_telepathy_example_text_handler_OBJECTS = text-handler.$(OBJEXT) telepathy_example_text_handler_OBJECTS = \ $(am_telepathy_example_text_handler_OBJECTS) telepathy_example_text_handler_LDADD = $(LDADD) telepathy_example_text_handler_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/approver.Po \ ./$(DEPDIR)/contact-list.Po ./$(DEPDIR)/extended-client.Po \ ./$(DEPDIR)/inspect-channel.Po ./$(DEPDIR)/inspect-cm.Po \ ./$(DEPDIR)/inspect-connection.Po \ ./$(DEPDIR)/inspect-contact.Po ./$(DEPDIR)/list-connections.Po \ ./$(DEPDIR)/list-managers.Po ./$(DEPDIR)/media-observer.Po \ ./$(DEPDIR)/text-handler.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(telepathy_example_approver_SOURCES) \ $(telepathy_example_contact_list_SOURCES) \ $(telepathy_example_extended_client_SOURCES) \ $(telepathy_example_inspect_channel_SOURCES) \ $(telepathy_example_inspect_cm_SOURCES) \ $(telepathy_example_inspect_connection_SOURCES) \ $(telepathy_example_inspect_contact_SOURCES) \ $(telepathy_example_list_connections_SOURCES) \ $(telepathy_example_list_managers_SOURCES) \ $(telepathy_example_media_observer_SOURCES) \ $(telepathy_example_text_handler_SOURCES) DIST_SOURCES = $(telepathy_example_approver_SOURCES) \ $(telepathy_example_contact_list_SOURCES) \ $(telepathy_example_extended_client_SOURCES) \ $(telepathy_example_inspect_channel_SOURCES) \ $(telepathy_example_inspect_cm_SOURCES) \ $(telepathy_example_inspect_connection_SOURCES) \ $(telepathy_example_inspect_contact_SOURCES) \ $(telepathy_example_list_connections_SOURCES) \ $(telepathy_example_list_managers_SOURCES) \ $(telepathy_example_media_observer_SOURCES) \ $(telepathy_example_text_handler_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ SUBDIRS = stream-tubes dbus-tubes python js EXAMPLES = telepathy-example-inspect-channel \ telepathy-example-inspect-connection \ telepathy-example-inspect-contact telepathy-example-inspect-cm \ telepathy-example-list-connections \ telepathy-example-list-managers \ telepathy-example-extended-client \ telepathy-example-media-observer telepathy-example-approver \ telepathy-example-text-handler telepathy-example-contact-list telepathy_example_inspect_channel_SOURCES = inspect-channel.c telepathy_example_inspect_connection_SOURCES = inspect-connection.c telepathy_example_inspect_contact_SOURCES = inspect-contact.c telepathy_example_inspect_cm_SOURCES = inspect-cm.c telepathy_example_list_connections_SOURCES = list-connections.c telepathy_example_list_managers_SOURCES = list-managers.c telepathy_example_extended_client_SOURCES = extended-client.c telepathy_example_extended_client_LDADD = \ $(top_builddir)/examples/extensions/libexample-extensions.la \ $(LDADD) telepathy_example_media_observer_SOURCES = media-observer.c telepathy_example_approver_SOURCES = approver.c telepathy_example_text_handler_SOURCES = text-handler.c telepathy_example_contact_list_SOURCES = contact-list.c # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path, and put it last; we use # a different format here because we're part of the telepathy-glib source tree. # Similarly, in an external project you'd put $(TP_GLIB_CFLAGS) at the end of # AM_CPPFLAGS. LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(NULL) AM_CPPFLAGS = \ -I${top_srcdir} -I${top_builddir} \ -DTP_DISABLE_SINGLE_INCLUDE \ $(GLIB_CFLAGS) \ $(DBUS_CFLAGS) \ $(NULL) AM_CFLAGS = $(ERROR_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/client/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/client/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list telepathy-example-approver$(EXEEXT): $(telepathy_example_approver_OBJECTS) $(telepathy_example_approver_DEPENDENCIES) $(EXTRA_telepathy_example_approver_DEPENDENCIES) @rm -f telepathy-example-approver$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_approver_OBJECTS) $(telepathy_example_approver_LDADD) $(LIBS) telepathy-example-contact-list$(EXEEXT): $(telepathy_example_contact_list_OBJECTS) $(telepathy_example_contact_list_DEPENDENCIES) $(EXTRA_telepathy_example_contact_list_DEPENDENCIES) @rm -f telepathy-example-contact-list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_contact_list_OBJECTS) $(telepathy_example_contact_list_LDADD) $(LIBS) telepathy-example-extended-client$(EXEEXT): $(telepathy_example_extended_client_OBJECTS) $(telepathy_example_extended_client_DEPENDENCIES) $(EXTRA_telepathy_example_extended_client_DEPENDENCIES) @rm -f telepathy-example-extended-client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_extended_client_OBJECTS) $(telepathy_example_extended_client_LDADD) $(LIBS) telepathy-example-inspect-channel$(EXEEXT): $(telepathy_example_inspect_channel_OBJECTS) $(telepathy_example_inspect_channel_DEPENDENCIES) $(EXTRA_telepathy_example_inspect_channel_DEPENDENCIES) @rm -f telepathy-example-inspect-channel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_inspect_channel_OBJECTS) $(telepathy_example_inspect_channel_LDADD) $(LIBS) telepathy-example-inspect-cm$(EXEEXT): $(telepathy_example_inspect_cm_OBJECTS) $(telepathy_example_inspect_cm_DEPENDENCIES) $(EXTRA_telepathy_example_inspect_cm_DEPENDENCIES) @rm -f telepathy-example-inspect-cm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_inspect_cm_OBJECTS) $(telepathy_example_inspect_cm_LDADD) $(LIBS) telepathy-example-inspect-connection$(EXEEXT): $(telepathy_example_inspect_connection_OBJECTS) $(telepathy_example_inspect_connection_DEPENDENCIES) $(EXTRA_telepathy_example_inspect_connection_DEPENDENCIES) @rm -f telepathy-example-inspect-connection$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_inspect_connection_OBJECTS) $(telepathy_example_inspect_connection_LDADD) $(LIBS) telepathy-example-inspect-contact$(EXEEXT): $(telepathy_example_inspect_contact_OBJECTS) $(telepathy_example_inspect_contact_DEPENDENCIES) $(EXTRA_telepathy_example_inspect_contact_DEPENDENCIES) @rm -f telepathy-example-inspect-contact$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_inspect_contact_OBJECTS) $(telepathy_example_inspect_contact_LDADD) $(LIBS) telepathy-example-list-connections$(EXEEXT): $(telepathy_example_list_connections_OBJECTS) $(telepathy_example_list_connections_DEPENDENCIES) $(EXTRA_telepathy_example_list_connections_DEPENDENCIES) @rm -f telepathy-example-list-connections$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_list_connections_OBJECTS) $(telepathy_example_list_connections_LDADD) $(LIBS) telepathy-example-list-managers$(EXEEXT): $(telepathy_example_list_managers_OBJECTS) $(telepathy_example_list_managers_DEPENDENCIES) $(EXTRA_telepathy_example_list_managers_DEPENDENCIES) @rm -f telepathy-example-list-managers$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_list_managers_OBJECTS) $(telepathy_example_list_managers_LDADD) $(LIBS) telepathy-example-media-observer$(EXEEXT): $(telepathy_example_media_observer_OBJECTS) $(telepathy_example_media_observer_DEPENDENCIES) $(EXTRA_telepathy_example_media_observer_DEPENDENCIES) @rm -f telepathy-example-media-observer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_media_observer_OBJECTS) $(telepathy_example_media_observer_LDADD) $(LIBS) telepathy-example-text-handler$(EXEEXT): $(telepathy_example_text_handler_OBJECTS) $(telepathy_example_text_handler_DEPENDENCIES) $(EXTRA_telepathy_example_text_handler_DEPENDENCIES) @rm -f telepathy-example-text-handler$(EXEEXT) $(AM_V_CCLD)$(LINK) $(telepathy_example_text_handler_OBJECTS) $(telepathy_example_text_handler_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/approver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/contact-list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extended-client.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inspect-channel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inspect-cm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inspect-connection.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inspect-contact.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-connections.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list-managers.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/media-observer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text-handler.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/approver.Po -rm -f ./$(DEPDIR)/contact-list.Po -rm -f ./$(DEPDIR)/extended-client.Po -rm -f ./$(DEPDIR)/inspect-channel.Po -rm -f ./$(DEPDIR)/inspect-cm.Po -rm -f ./$(DEPDIR)/inspect-connection.Po -rm -f ./$(DEPDIR)/inspect-contact.Po -rm -f ./$(DEPDIR)/list-connections.Po -rm -f ./$(DEPDIR)/list-managers.Po -rm -f ./$(DEPDIR)/media-observer.Po -rm -f ./$(DEPDIR)/text-handler.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/approver.Po -rm -f ./$(DEPDIR)/contact-list.Po -rm -f ./$(DEPDIR)/extended-client.Po -rm -f ./$(DEPDIR)/inspect-channel.Po -rm -f ./$(DEPDIR)/inspect-cm.Po -rm -f ./$(DEPDIR)/inspect-connection.Po -rm -f ./$(DEPDIR)/inspect-contact.Po -rm -f ./$(DEPDIR)/list-connections.Po -rm -f ./$(DEPDIR)/list-managers.Po -rm -f ./$(DEPDIR)/media-observer.Po -rm -f ./$(DEPDIR)/text-handler.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/client/inspect-contact.c0000644000175000017500000001155712652510705020004 00000000000000/* * telepathy-example-inspect-contact - inspect a contact on a connection * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include typedef struct { const gchar *to_inspect; int exit_status; GMainLoop *main_loop; } InspectContactData; static void display_contact (TpContact *contact) { const gchar *avatar_token; g_message ("Handle %u, \"%s\":", tp_contact_get_handle (contact), tp_contact_get_identifier (contact)); g_message ("\tAlias: \"%s\"", tp_contact_get_alias (contact)); avatar_token = tp_contact_get_avatar_token (contact); if (avatar_token == NULL) g_message ("\tAvatar token not known"); else g_message ("\tAvatar token: \"%s\"", avatar_token); g_message ("\tPresence: type #%i \"%s\": \"%s\"", tp_contact_get_presence_type (contact), tp_contact_get_presence_status (contact), tp_contact_get_presence_message (contact)); } static void contacts_upgraded_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpConnection *connection = (TpConnection *) object; InspectContactData *data = user_data; GPtrArray *contacts; GError *error = NULL; if (!tp_connection_upgrade_contacts_finish (connection, result, &contacts, &error)) { g_warning ("Error getting contacts: %s", error->message); data->exit_status = 1; g_clear_error (&error); } else { guint i; data->exit_status = 0; for (i = 0; i < contacts->len; i++) { display_contact (g_ptr_array_index (contacts, i)); } g_ptr_array_unref (contacts); } g_main_loop_quit (data->main_loop); } static void got_contacts_by_id (GObject *object, GAsyncResult *result, gpointer user_data) { TpConnection *connection = (TpConnection *) object; InspectContactData *data = user_data; TpContact *contact; GError *error = NULL; contact = tp_connection_dup_contact_by_id_finish (connection, result, &error); if (contact == NULL) { g_warning ("Error getting contacts: %s", error->message); data->exit_status = 1; g_clear_error (&error); } else { data->exit_status = 0; display_contact (contact); g_object_unref (contact); } g_main_loop_quit (data->main_loop); } static void connection_ready_cb (GObject *source, GAsyncResult *result, gpointer user_data) { static TpContactFeature features[] = { TP_CONTACT_FEATURE_ALIAS, TP_CONTACT_FEATURE_AVATAR_TOKEN, TP_CONTACT_FEATURE_PRESENCE }; InspectContactData *data = user_data; TpConnection *connection = TP_CONNECTION (source); GError *error = NULL; if (!tp_proxy_prepare_finish (connection, result, &error)) { g_warning ("%s", error->message); data->exit_status = 1; g_main_loop_quit (data->main_loop); g_clear_error (&error); return; } if (data->to_inspect == NULL) { TpContact *self_contact = tp_connection_get_self_contact (connection); tp_connection_upgrade_contacts_async (connection, 1, &self_contact, G_N_ELEMENTS (features), features, contacts_upgraded_cb, data); } else { tp_connection_dup_contact_by_id_async (connection, data->to_inspect, G_N_ELEMENTS (features), features, got_contacts_by_id, data); } } int main (int argc, char **argv) { TpConnection *connection = NULL; InspectContactData data = { NULL, 1, NULL }; TpSimpleClientFactory *factory; GError *error = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (argc < 2) { fputs ("Usage:\n" " telepathy-example-inspect-connection OBJECT_PATH [CONTACT_ID]\n", stderr); return 2; } data.to_inspect = argv[2]; factory = tp_simple_client_factory_new (NULL); connection = tp_simple_client_factory_ensure_connection (factory, argv[1], NULL, &error); if (connection == NULL) { g_warning ("%s", error->message); goto out; } data.main_loop = g_main_loop_new (NULL, FALSE); /* for this example I assume it's an existing connection on which someone * else has called (or will call) Connect(), so we won't call Connect() * on it ourselves */ tp_proxy_prepare_async (connection, NULL, connection_ready_cb, &data); g_main_loop_run (data.main_loop); out: if (error != NULL) g_error_free (error); if (data.main_loop != NULL) g_main_loop_unref (data.main_loop); if (connection != NULL) g_object_unref (connection); g_object_unref (factory); return data.exit_status; } telepathy-glib-0.24.2/examples/client/python/0000755000175000017500000000000014006623342016127 500000000000000telepathy-glib-0.24.2/examples/client/python/inspect-cm.py0000644000175000017500000000333112652510705020466 00000000000000#!/usr/bin/env python import sys import gi from gi.repository import GObject gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib as Tp def describe(cm): print("Connection manager: %s" % cm.get_name()) print("") for protocol in cm.dup_protocols(): print("Protocol: %s" % protocol.get_name()) print("\tEnglish name: %s" % protocol.get_english_name()) print("\tvCard field: %s" % protocol.get_vcard_field()) for param in protocol.dup_params(): print("\tParameter: %s" % param.get_name()) if param.is_required(): print("\t\tIs required") if param.is_secret(): print("\t\tIs a password or equivalent") if param.flags & Tp.ConnMgrParamFlags.HAS_DEFAULT: print("\t\tDefault value: %s" % param.default_value) else: print("\t\tNo default") def manager_prepared_cb(cm, result, loop): try: cm.prepare_finish(result) describe(cm) finally: loop.quit() def inspect(name): cm = Tp.ConnectionManager( dbus_daemon=Tp.DBusDaemon.dup(), bus_name=Tp.CM_BUS_NAME_BASE + name, object_path=Tp.CM_OBJECT_PATH_BASE + name, ) cm.prepare_async(None, cm, loop) def cms_cb(source, result, loop): try: cms = Tp.list_connection_managers_finish(result) for cm in cms: describe(cm) print("") finally: loop.quit() if __name__ == '__main__': loop = GObject.MainLoop() if len(sys.argv) >= 2: inspect(sys.argv[1]) else: Tp.list_connection_managers_async(Tp.DBusDaemon.dup(), cms_cb, loop) loop.run() telepathy-glib-0.24.2/examples/client/python/contact-list.py0000755000175000017500000000262012652510705021033 00000000000000#!/usr/bin/env python import os import gi from gi.repository import GObject GObject.threads_init() gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib as Tp def manager_prepared_cb(manager, result, loop): manager.prepare_finish(result) for account in manager.get_valid_accounts(): connection = account.get_connection() # Verify account is online and received its contact list. If state is not # SUCCESS this means we didn't received the roster from server yet and # we would have to wait for the "notify:contact-list-state" signal. */ if connection is not None and \ connection.get_contact_list_state() == Tp.ContactListState.SUCCESS: contacts = connection.dup_contact_list() for contact in contacts: print "%s (%s)" % (contact.get_identifier(), contact.get_contact_groups()) loop.quit() if __name__ == '__main__': Tp.debug_set_flags(os.getenv('EXAMPLE_DEBUG', '')) loop = GObject.MainLoop() manager = Tp.AccountManager.dup() factory = manager.get_factory() factory.add_account_features([Tp.Account.get_feature_quark_connection()]) factory.add_connection_features([Tp.Connection.get_feature_quark_contact_list()]) factory.add_contact_features([Tp.ContactFeature.CONTACT_GROUPS]) manager.prepare_async(None, manager_prepared_cb, loop) loop.run() telepathy-glib-0.24.2/examples/client/python/text-handler.py0000755000175000017500000000377012652510705021035 00000000000000#!/usr/bin/env python import gi from gi.repository import GObject GObject.threads_init() gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib def echo_message(channel, msg, pending): text, flags = msg.to_text() if pending: print "pending: %s" % (text) else: print "received: %s" % (text) reply = TelepathyGLib.ClientMessage.new_text( TelepathyGLib.ChannelTextMessageType.NORMAL, text.upper()) channel.send_message_async(reply, 0, lambda a, b, c: 0, None) def message_received_cb(channel, msg): echo_message(channel, msg, False) channel.ack_message_async(msg, lambda a, b, c: 0, None) def display_pending_messages(channel): messages = channel.get_pending_messages() for msg in messages: echo_message(channel, msg, True) # Ideally we should pass None as callback but that doesn't work # (bgo #640812) channel.ack_messages_async(messages, lambda a, b, c: 0, None) def handle_channels_cb(handler, account, connection, channels, requests, user_action_time, context, user_data): for channel in channels: if not isinstance(channel, TelepathyGLib.TextChannel): continue print "Handling text channel with", channel.get_identifier() channel.connect('message-received', message_received_cb) display_pending_messages(channel) context.accept() if __name__ == '__main__': #TelepathyGLib.debug_set_flags("all") am = TelepathyGLib.AccountManager.dup() handler = TelepathyGLib.SimpleHandler.new_with_am(am, False, False, 'ExampleHandler', False, handle_channels_cb, None) handler.add_handler_filter({ TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE: TelepathyGLib.IFACE_CHANNEL_TYPE_TEXT, # bgo #637466 TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(TelepathyGLib.HandleType.CONTACT), TelepathyGLib.PROP_CHANNEL_REQUESTED: False, }) handler.register() main_loop = GObject.MainLoop() main_loop.run() telepathy-glib-0.24.2/examples/client/python/stream-tube-offerer.py0000755000175000017500000000564012652510705022312 00000000000000#!/usr/bin/env python import sys import os import gi from gi.repository import GObject, Gio gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib as Tp def usage(): print "%s ACCOUNT CONTACT" % sys.argv[0] print "ACCOUNT is a Telepathy account name, use 'mc-tool list' to list all your accounts" print "CONTACT is a contact id such as badger@nyan.cat" sys.exit(1) def offer_channel_cb(tube, result, loop): try: tube.offer_finish(result) print "tube offered" except GObject.GError, e: print "Failed to offer tube: %s" % e sys.exit(1) def tube_conn_closed(tube, error): print "Tube connection has been closed", error.message def channel_close_cb(tube, result, loop): try: tube.close_finish(result) print "tube channel closed" except GObject.GError, e: print "Failed to close tube channel: %s" % e sys.exit(1) def tube_incoming_cb(tube, tube_conn, loop): tube_conn.connect('closed', tube_conn_closed) contact = tube_conn.get_contact(); print "Got IOStream from", contact.get_identifier() conn = tube_conn.get_socket_connection(); # g_input_stream_read() can't be used from Python so we use the more # binding friendly GDataInputStream in_stream = Gio.DataInputStream (base_stream=conn.get_input_stream()) out_stream = conn.get_output_stream() buf, len = in_stream.read_line_utf8(None) print "Received:", buf print "Sending: Pong" out_stream.write("Pong\n", None) tube.close_async(channel_close_cb, contact) def tube_invalidated_cb(tube, domain, code, message, loop): print "tube has been invalidated:", message loop.quit() def create_channel_cb(request, result, loop): try: (chan, context) = request.create_and_handle_channel_finish(result) chan.connect('incoming', tube_incoming_cb, loop) chan.connect('invalidated', tube_invalidated_cb, loop) chan.offer_async({}, offer_channel_cb, loop) except GObject.GError, e: print "Failed to create channel: %s" % e sys.exit(1) if __name__ == '__main__': Tp.debug_set_flags(os.getenv('EXAMPLE_DEBUG', '')) if len(sys.argv) != 3: usage() _, account_id, contact_id = sys.argv account_manager = Tp.AccountManager.dup() account = account_manager.ensure_account("%s%s" % (Tp.ACCOUNT_OBJECT_PATH_BASE, account_id)) request_dict = { Tp.PROP_CHANNEL_CHANNEL_TYPE: Tp.IFACE_CHANNEL_TYPE_STREAM_TUBE, Tp.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(Tp.HandleType.CONTACT), Tp.PROP_CHANNEL_TARGET_ID: contact_id, Tp.PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE: "ExampleService", } request = Tp.AccountChannelRequest.new(account, request_dict, 0) loop = GObject.MainLoop() request.create_and_handle_channel_async(None, create_channel_cb, loop) loop.run() telepathy-glib-0.24.2/examples/client/python/dialler.py0000755000175000017500000001625012652510705020047 00000000000000#!/usr/bin/env python # encoding: utf-8 # # A simple Telepathy dialler, suitable for use when a nicer UI you're # developing doesn't work yet. # # Copyright © 2012 Collabora Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import gi from gi.repository import GLib from gi.repository import GObject from gi.repository import Gio from gi.repository import Gtk gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib as Tp import sys GObject.threads_init() # not available via g-i USER_ACTION_TIME_NOT_USER_ACTION = 0 ACCOUNT_MANAGER_FEATURE_CORE = GLib.quark_from_string( 'tp-account-manager-feature-core') class Dialler(Gtk.Application): def __init__(self): Gtk.Application.__init__(self, application_id='im.telepathy.TpGLib.Example.PythonDialler', flags=Gio.ApplicationFlags.NON_UNIQUE) self.dbus = Tp.DBusDaemon.dup() self.am = Tp.AccountManager.dup() self.accounts = Gtk.ListStore(str, object) self.potential_handlers = set() self.handlers = Gtk.ListStore(str, str) self.window = None def do_activate(self): if self.window is not None: self.window.present() return self.window = Gtk.Window() self.grid = Gtk.Grid() self.grid.props.margin = 6 self.grid.props.column_spacing = 6 self.grid.props.row_spacing = 6 self.window.add(self.grid) row = 0 self.grid.attach(Gtk.Label('local account:'), 0, row, 1, 1) self.account_combo = Gtk.ComboBox.new_with_model(self.accounts) renderer = Gtk.CellRendererText() self.account_combo.pack_start(renderer, True) self.account_combo.add_attribute(renderer, "text", 0) self.grid.attach(self.account_combo, 1, row, 1, 1) row += 1 self.grid.attach(Gtk.Label('remote target:'), 0, row, 1, 1) self.target_entry = Gtk.Entry() self.target_entry.set_text('smcv@example.com') self.grid.attach(self.target_entry, 1, row, 1, 1) row += 1 self.grid.attach(Gtk.Label('preferred handler:'), 0, row, 1, 1) self.handler_combo = Gtk.ComboBox.new_with_model(self.handlers) renderer = Gtk.CellRendererText() self.handler_combo.pack_start(renderer, True) self.handler_combo.add_attribute(renderer, "text", 0) self.grid.attach(self.handler_combo, 1, row, 1, 1) row += 1 self.dial_button = Gtk.Button('dial') self.dial_button.connect('clicked', self._dial_clicked) self.grid.attach(self.dial_button, 0, row, 2, 1) row += 1 self.dial_button.props.sensitive = False self.window.show_all() self.add_window(self.window) self.am.prepare_async([], self._am_cb, None) Gio.bus_get(Gio.BusType.SESSION, None, self._session_bus_cb, None) def _am_cb(self, am, result, user_data): am.prepare_finish(result) for account in am.get_valid_accounts(): assert(account.object_path.startswith(Tp.ACCOUNT_OBJECT_PATH_BASE)) tail = account.object_path[len(Tp.ACCOUNT_OBJECT_PATH_BASE):] self.accounts.append([account.get_display_name() or tail, account]) self.account_combo.set_active(0) self.poll() def poll(self): if (self.am.is_prepared(ACCOUNT_MANAGER_FEATURE_CORE) and len(self.handlers) > 0 and len(self.potential_handlers) == 0): self.dial_button.props.sensitive = True def _session_bus_cb(self, session_bus, result, user_data): self.session_bus = Gio.bus_get_finish(result) self.session_bus.call('org.freedesktop.DBus', '/org/freedesktop/DBus', 'org.freedesktop.DBus', 'ListNames', GLib.Variant("()", ()), GLib.VariantType.new("(as)"), Gio.DBusCallFlags.NONE, -1, None, self._names_cb, None) def _names_cb(self, session_bus, result, user_data): names = set(session_bus.call_finish(result)[0]) self.handlers.append(['(no preference)', '']) self.handler_combo.set_active(0) for name in sorted(names): if name.startswith(Tp.CLIENT_BUS_NAME_BASE): self.potential_handlers.add(name) Gio.DBusProxy.new(session_bus, Gio.DBusProxyFlags.NONE, None, name, '/' + name.replace('.', '/'), Tp.IFACE_CLIENT_HANDLER, None, self._potential_handler_cb, name) self.poll() def _potential_handler_cb(self, proxy, result, name): self.potential_handlers.remove(name) proxy = Gio.DBusProxy.new_finish(result) filters = proxy.get_cached_property("HandlerChannelFilter") if filters is not None: for asv in filters: if asv.get(Tp.PROP_CHANNEL_CHANNEL_TYPE) == Tp.IFACE_CHANNEL_TYPE_CALL: tail = name[len(Tp.CLIENT_BUS_NAME_BASE):] self.handlers.append([tail, name]) break self.poll() def _dial_clicked(self, button): tree_iter = self.account_combo.get_active_iter() account = self.accounts[tree_iter][1] tree_iter = self.handler_combo.get_active_iter() handler = self.handlers[tree_iter][1] acr = Tp.AccountChannelRequest.new(account, { Tp.PROP_CHANNEL_CHANNEL_TYPE: Tp.IFACE_CHANNEL_TYPE_CALL, Tp.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(Tp.HandleType.CONTACT), Tp.PROP_CHANNEL_TARGET_ID: self.target_entry.get_text(), Tp.PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO: True, }, USER_ACTION_TIME_NOT_USER_ACTION) acr.create_and_observe_channel_async(handler, None, self._create_call_cb, None) def _create_call_cb(self, acr, result, user_data): channel = acr.create_and_observe_channel_finish(result) print("accepting channel %s" % channel) channel.accept_async(self._accept_cb, None) def _accept_cb(self, channel, result, user_data): channel.accept_finish(result) print("accepted channel %s" % channel) if __name__ == '__main__': Tp.debug_set_flags("all") sys.exit(Dialler().run(sys.argv)) telepathy-glib-0.24.2/examples/client/python/ft-handler.py0000644000175000017500000000342312652510705020452 00000000000000#!/usr/bin/env python import sys import gi from gi.repository import GObject GObject.threads_init() from gi.repository import Gio gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib def usage(): print "%s FILE" % sys.argv[0] print "FILE is a path to the location you want the file saved to" sys.exit(1) def state_changed_cb(channel, pspec, data): state, _ = channel.get_state() print 'State is now:', state def accept_cb(channel, result, data): if not channel.accept_file_finish(result): print 'Failed to accept file' def handle_channels_cb(handler, account, connection, channels, requests, user_action_time, context, filename): for chan in channels: if not isinstance(chan, TelepathyGLib.FileTransferChannel): continue chan.connect('notify::state', state_changed_cb, None) print 'Handling FileTransfer channel:', chan.get_identifier() file = Gio.File.new_for_path(filename) chan.accept_file_async(file, 0, accept_cb, None) context.accept() if __name__ == '__main__': if len(sys.argv) != 2: usage() _, filename = sys.argv #TelepathyGLib.debug_set_flags("all") dbus = TelepathyGLib.DBusDaemon.dup() handler = TelepathyGLib.SimpleHandler.new(dbus, False, False, 'ExampleFTHandler', False, handle_channels_cb, filename) handler.add_handler_filter({ TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE: TelepathyGLib.IFACE_CHANNEL_TYPE_FILE_TRANSFER, TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(TelepathyGLib.HandleType.CONTACT), TelepathyGLib.PROP_CHANNEL_REQUESTED: False }) handler.register() main_loop = GObject.MainLoop() main_loop.run() telepathy-glib-0.24.2/examples/client/python/stream-tube-accepter.py0000755000175000017500000000417212652510705022447 00000000000000#!/usr/bin/env python import os import gi from gi.repository import GObject, Gio gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib as Tp def tube_conn_closed(tube, error): print "Tube connection has been closed", error.message def tube_accept_cb(tube, result, loop): try: tube_conn = tube.accept_finish(result) except GObject.GError, e: print "Failed to accept tube: %s" % e sys.exit(1) tube_conn.connect('closed', tube_conn_closed) contact = tube_conn.get_contact(); print "Got IOStream to", contact.get_identifier() conn = tube_conn.get_socket_connection(); # g_input_stream_read() can't be used from Python so we use the more # binding friendly GDataInputStream in_stream = Gio.DataInputStream (base_stream=conn.get_input_stream()) out_stream = conn.get_output_stream() print "Sending: Ping" out_stream.write("Ping\n", None) buf, len = in_stream.read_line_utf8(None) print "Received:", buf def tube_invalidated_cb(tube, domain, code, message, loop): print "tube has been invalidated:", message loop.quit() def handle_channels_cb(handler, account, connection, channels, requests, user_action_time, context, loop): for channel in channels: if not isinstance(channel, Tp.StreamTubeChannel): continue print "Accepting tube" channel.connect('invalidated', tube_invalidated_cb, loop) channel.accept_async(tube_accept_cb, loop) context.accept() if __name__ == '__main__': Tp.debug_set_flags(os.getenv('EXAMPLE_DEBUG', '')) loop = GObject.MainLoop() account_manager = Tp.AccountManager.dup() handler = Tp.SimpleHandler.new_with_am(account_manager, False, False, 'ExampleServiceHandler', False, handle_channels_cb, loop) handler.add_handler_filter({ Tp.PROP_CHANNEL_CHANNEL_TYPE: Tp.IFACE_CHANNEL_TYPE_STREAM_TUBE, Tp.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(Tp.HandleType.CONTACT), Tp.PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE: "ExampleService", }) handler.register() print "Waiting for tube offer" loop.run() telepathy-glib-0.24.2/examples/client/python/Makefile.am0000644000175000017500000000144212652510705020107 00000000000000EXTRA_DIST = \ contact-list.py \ dialler.py \ ensure-channel.py \ inspect-cm.py \ text-handler.py \ file-transfer.py \ ft-handler.py \ stream-tube-offerer.py \ stream-tube-accepter.py installable_scripts = \ telepathy-example-python-dialler \ telepathy-example-python-contact-list \ telepathy-example-python-ensure-channel \ telepathy-example-python-file-transfer \ telepathy-example-python-ft-handler \ telepathy-example-python-inspect-cm \ telepathy-example-python-text-handler \ telepathy-example-python-stream-tube-accepter \ telepathy-example-python-stream-tube-offerer \ $(NULL) telepathy-example-python-%: %.py cp $< $@ chmod +x $@ if INSTALL_EXAMPLES bin_SCRIPTS = $(installable_scripts) endif CLEANFILES = $(installable_scripts) telepathy-glib-0.24.2/examples/client/python/Makefile.in0000644000175000017500000004274614006601553020131 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples/client/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ EXTRA_DIST = \ contact-list.py \ dialler.py \ ensure-channel.py \ inspect-cm.py \ text-handler.py \ file-transfer.py \ ft-handler.py \ stream-tube-offerer.py \ stream-tube-accepter.py installable_scripts = \ telepathy-example-python-dialler \ telepathy-example-python-contact-list \ telepathy-example-python-ensure-channel \ telepathy-example-python-file-transfer \ telepathy-example-python-ft-handler \ telepathy-example-python-inspect-cm \ telepathy-example-python-text-handler \ telepathy-example-python-stream-tube-accepter \ telepathy-example-python-stream-tube-offerer \ $(NULL) @INSTALL_EXAMPLES_TRUE@bin_SCRIPTS = $(installable_scripts) CLEANFILES = $(installable_scripts) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/client/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/client/python/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-binSCRIPTS .PRECIOUS: Makefile telepathy-example-python-%: %.py cp $< $@ chmod +x $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/client/python/file-transfer.py0000755000175000017500000000555312652510705021200 00000000000000#!/usr/bin/env python import sys import os import mimetypes import gi from gi.repository import GObject GObject.threads_init() from gi.repository import Gio gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib def usage(): print "%s ACCOUNT CONTACT FILE" % sys.argv[0] print "ACCOUNT is a Telepathy account name, use 'mc-tool list' to list all your accounts" print "CONTACT is a contact id such as badger@nyan.cat" print "FILE is a path to the local file you want sent" sys.exit(1) def provide_file_cb(channel, result, data): if not channel.provide_file_finish(result): print 'failed to provide' def state_changed_cb(channel, pspec, data): main_loop, file_path = data state, _ = channel.get_state() print 'state is now', state if state == TelepathyGLib.FileTransferState.ACCEPTED: file = Gio.File.new_for_path(file_path) channel.provide_file_async(file, provide_file_cb, None) def create_channel_cb(request, result, data): try: (chan, context) = request.create_and_handle_channel_finish(result) chan.connect('notify::state', state_changed_cb, data) except GObject.GError, e: print "Failed to create channel: %s" % e sys.exit(1) if __name__ == '__main__': #TelepathyGLib.debug_set_flags("all") dbus = TelepathyGLib.DBusDaemon.dup() if len(sys.argv) != 4: usage() _, account_id, contact_id, file_path = sys.argv account_manager = TelepathyGLib.AccountManager.dup() account = account_manager.ensure_account("%s%s" % (TelepathyGLib.ACCOUNT_OBJECT_PATH_BASE, account_id)) # Get file info stuff (mimetype, encoding) = mimetypes.guess_type(file_path) mtime = os.path.getmtime(file_path) filename = os.path.basename(file_path) filesize = os.path.getsize(file_path) request_dict = { TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE: TelepathyGLib.IFACE_CHANNEL_TYPE_FILE_TRANSFER, TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(TelepathyGLib.HandleType.CONTACT), TelepathyGLib.PROP_CHANNEL_TARGET_ID: contact_id, TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_TYPE: mimetype, TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_DATE: mtime, TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_DESCRIPTION: "", TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_FILENAME: filename, TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_INITIAL_OFFSET: 0, TelepathyGLib.PROP_CHANNEL_TYPE_FILE_TRANSFER_SIZE: filesize, } request = TelepathyGLib.AccountChannelRequest.new(account, request_dict, 0) main_loop = GObject.MainLoop() request.create_and_handle_channel_async(None, create_channel_cb, (main_loop, file_path)) main_loop.run() telepathy-glib-0.24.2/examples/client/python/ensure-channel.py0000755000175000017500000000433412652510705021342 00000000000000#!/usr/bin/env python import sys import gi from gi.repository import GObject GObject.threads_init() gi.require_version('TelepathyGLib', '0.12') from gi.repository import TelepathyGLib def usage(): print "%s ACCOUNT [text|audio|video] CONTACT" % sys.argv[0] print "ACCOUNT is a Telepathy account name, use 'mc-tool list' to list all your accounts" print "CONTACT is a contact id such as badger@gmail.com" sys.exit(1) def create_request_dict(action, contact_id): if action == 'text': return { TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE: TelepathyGLib.IFACE_CHANNEL_TYPE_TEXT, TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(TelepathyGLib.HandleType.CONTACT), TelepathyGLib.PROP_CHANNEL_TARGET_ID: contact_id} elif action in ['audio', 'video']: return { TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE: TelepathyGLib.IFACE_CHANNEL_TYPE_STREAMED_MEDIA, TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE: int(TelepathyGLib.HandleType.CONTACT), TelepathyGLib.PROP_CHANNEL_TARGET_ID: contact_id, TelepathyGLib.PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO: True, TelepathyGLib.PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO: action == 'video'} else: usage() def ensure_channel_cb(request, result, main_loop): request.ensure_channel_finish(result) main_loop.quit() if __name__ == '__main__': #TelepathyGLib.debug_set_flags("all") dbus = TelepathyGLib.DBusDaemon.dup() if len(sys.argv) != 4: usage() _, account_id, action, contact_id = sys.argv account_manager = TelepathyGLib.AccountManager.dup() account = account_manager.ensure_account("%s%s" % (TelepathyGLib.ACCOUNT_OBJECT_PATH_BASE, account_id)) request_dict = create_request_dict(action, contact_id) request = TelepathyGLib.AccountChannelRequest.new(account, request_dict, 0) # FIXME: for some reason TelepathyGLib.USER_ACTION_TIME_CURRENT_TIME is # not defined (bgo #639206) main_loop = GObject.MainLoop() request.ensure_channel_async("", None, ensure_channel_cb, main_loop) main_loop.run() telepathy-glib-0.24.2/examples/client/dbus-tubes/0000755000175000017500000000000014006623342016663 500000000000000telepathy-glib-0.24.2/examples/client/dbus-tubes/constants.h0000644000175000017500000000037012652510705020773 00000000000000#ifndef DBUS_TUBE_EXAMPLE_CONSTANTS_H #define DBUS_TUBE_EXAMPLE_CONSTANTS_H #define EXAMPLE_SERVICE_NAME "uk.co.example.calculator" #define EXAMPLE_INTERFACE "org.example.terriblecalculator" #define EXAMPLE_PATH "/org/example/calculator" #endif telepathy-glib-0.24.2/examples/client/dbus-tubes/offerer.c0000644000175000017500000001431612652510705020407 00000000000000#include "config.h" #include #include "constants.h" static GMainLoop *loop = NULL; static void connection_closed_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { GDBusConnection *connection = G_DBUS_CONNECTION (source); GError *error = NULL; if (!g_dbus_connection_close_finish (connection, result, &error)) { g_warning ("Couldn't close connection: %s", error->message); g_clear_error (&error); } else { g_message ("Connection closed."); } tp_channel_close_async (TP_CHANNEL (user_data), NULL, NULL); g_object_unref (connection); } static void handle_method_call ( GDBusConnection *connection, const gchar *sender, const gchar *object_path, const gchar *interface_name, const gchar *method_name, GVariant *parameters, GDBusMethodInvocation *invocation, gpointer user_data) { if (tp_strdiff (method_name, "Add")) { g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Unknown method '%s' on interface " EXAMPLE_INTERFACE, method_name); } else if (!g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(ii)"))) { g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "Add takes two int32 parameters, not %s", g_variant_get_type_string (parameters)); } else /* hooray! */ { guint x, y; gboolean ret; g_variant_get (parameters, "(ii)", &x, &y); g_dbus_method_invocation_return_value (invocation, g_variant_new ("(i)", x + y)); ret = g_dbus_connection_emit_signal (connection, NULL, object_path, interface_name, "LuckyNumber", g_variant_new ("(u)", g_random_int ()), NULL); /* "This can only fail if 'parameters' is not compatible with the D-Bus * protocol." */ g_return_if_fail (ret); g_dbus_connection_flush_sync (connection, NULL, NULL); g_dbus_connection_close (connection, NULL, connection_closed_cb, user_data); } } static void register_object (GDBusConnection *connection, TpDBusTubeChannel *channel) { GDBusNodeInfo *introspection_data; guint registration_id; static const GDBusInterfaceVTable interface_vtable = { handle_method_call, NULL, NULL, }; static const gchar introspection_xml[] = "" " " " " " " " " " " " " " " " " " " " " ""; introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL); g_assert (introspection_data != NULL); registration_id = g_dbus_connection_register_object (connection, EXAMPLE_PATH, introspection_data->interfaces[0], &interface_vtable, g_object_ref (channel), g_object_unref, NULL); g_assert (registration_id > 0); g_dbus_node_info_unref (introspection_data); } static void tube_offered (GObject *tube, GAsyncResult *res, gpointer user_data) { GError *error = NULL; GDBusConnection *conn; conn = tp_dbus_tube_channel_offer_finish (TP_DBUS_TUBE_CHANNEL (tube), res, &error); if (conn == NULL) { g_message ("Failed to offer tube: %s", error->message); g_error_free (error); tp_channel_close_async (TP_CHANNEL (tube), NULL, NULL); return; } g_message ("Tube opened"); register_object (conn, TP_DBUS_TUBE_CHANNEL (tube)); } static void tube_invalidated_cb (TpStreamTubeChannel *tube, guint domain, gint code, gchar *message, gpointer user_data) { g_message ("Tube has been invalidated: %s", message); g_main_loop_quit (loop); g_object_unref (tube); } static void channel_created (GObject *source, GAsyncResult *result, gpointer user_data) { TpChannel *channel; GError *error = NULL; TpDBusTubeChannel *tube; channel = tp_account_channel_request_create_and_handle_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, NULL, &error); if (channel == NULL) { g_message ("Failed to create channel: %s", error->message); g_error_free (error); g_main_loop_quit (loop); return; } g_message ("Channel created: %s", tp_proxy_get_object_path (channel)); tube = TP_DBUS_TUBE_CHANNEL (channel); g_signal_connect (tube, "invalidated", G_CALLBACK (tube_invalidated_cb), NULL); tp_dbus_tube_channel_offer_async (tube, NULL, tube_offered, NULL); } int main (int argc, const char **argv) { TpSimpleClientFactory *factory; TpAccount *account; char *account_path; GError *error = NULL; TpAccountChannelRequest *req; GHashTable *request; if (argc != 3) { g_printerr ("Usage: offerer gabble/jabber/ladygaga t-pain@example.com\n"); return 2; } factory = TP_SIMPLE_CLIENT_FACTORY (tp_automatic_client_factory_new (NULL)); account_path = g_strconcat (TP_ACCOUNT_OBJECT_PATH_BASE, argv[1], NULL); account = tp_simple_client_factory_ensure_account (factory, account_path, NULL, &error); g_assert_no_error (error); g_free (account_path); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, argv[2], TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, EXAMPLE_SERVICE_NAME, NULL); g_message ("Offer channel to %s", argv[2]); req = tp_account_channel_request_new (account, request, TP_USER_ACTION_TIME_CURRENT_TIME); tp_account_channel_request_create_and_handle_channel_async (req, NULL, channel_created, NULL); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_object_unref (account); g_object_unref (req); g_hash_table_unref (request); g_main_loop_unref (loop); g_object_unref (factory); return 0; } telepathy-glib-0.24.2/examples/client/dbus-tubes/accepter.c0000644000175000017500000001167612652510705020553 00000000000000#include "config.h" #include #include "constants.h" static GMainLoop *loop = NULL; static void dbus_connection_closed_cb ( GDBusConnection *connection, gboolean remote_peer_vanished, GError *error, gpointer user_data) { if (remote_peer_vanished) g_message ("remote peer disconnected: %s", error->message); else if (error != NULL) g_message ("remote peer sent broken data: %s", error->message); else g_message ("supposedly we closed the connection locally?!"); g_object_unref (connection); } static void lucky_number_cb ( GDBusConnection *connection, const gchar *sender_name, const gchar *object_path, const gchar *interface_name, const gchar *signal_name, GVariant *parameters, gpointer user_data) { if (g_variant_is_of_type (parameters, G_VARIANT_TYPE ("(u)"))) { guint32 x; g_variant_get (parameters, "(u)", &x); g_message ("My lucky number is: %u", x); } else { g_warning ("LuckyNumber's arguments were %s, not (u)", g_variant_get_type_string (parameters)); } } static void add_cb ( GObject *source, GAsyncResult *result, gpointer user_data) { GDBusConnection *conn = G_DBUS_CONNECTION (source); GVariant *ret; GError *error = NULL; ret = g_dbus_connection_call_finish (conn, result, &error); if (ret != NULL) { gint32 value; g_variant_get (ret, "(i)", &value); g_message ("Adding my numbers together gave: %i", value); g_variant_unref (ret); } else { g_warning ("Add() failed: %s", error->message); g_clear_error (&error); } } static void tube_accepted (GObject *tube, GAsyncResult *res, gpointer user_data) { GDBusConnection *conn; GError *error = NULL; conn = tp_dbus_tube_channel_accept_finish ( TP_DBUS_TUBE_CHANNEL (tube), res, &error); if (conn == NULL) { g_message ("Failed to accept tube: %s", error->message); g_error_free (error); tp_channel_close_async (TP_CHANNEL (tube), NULL, NULL); return; } g_message ("tube accepted"); g_signal_connect (conn, "closed", G_CALLBACK (dbus_connection_closed_cb), NULL); g_dbus_connection_signal_subscribe (conn, /* since we only deal with 1-1 connections, no need to match sender */ NULL, EXAMPLE_INTERFACE, "LuckyNumber", EXAMPLE_PATH, NULL, G_DBUS_SIGNAL_FLAGS_NONE, lucky_number_cb, NULL, NULL); g_dbus_connection_call (conn, NULL, EXAMPLE_PATH, EXAMPLE_INTERFACE, "Add", g_variant_new ("(ii)", 45, 54), G_VARIANT_TYPE ("(i)"), G_DBUS_CALL_FLAGS_NONE, -1, NULL, add_cb, NULL); } static void tube_invalidated_cb (TpStreamTubeChannel *tube, guint domain, gint code, gchar *message, gpointer user_data) { g_message ("Tube has been invalidated: %s", message); g_main_loop_quit (loop); g_object_unref (tube); } static void handle_channels (TpSimpleHandler *handler, TpAccount *account, TpConnection *conn, GList *channels, GList *requests, gint64 action_time, TpHandleChannelsContext *context, gpointer user_data) { TpDBusTubeChannel *tube; GList *l; GError error = { TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No channel to be handled" }; g_message ("Handling channels"); for (l = channels; l != NULL; l = l->next) { TpDBusTubeChannel *channel = l->data; if (!TP_IS_DBUS_TUBE_CHANNEL (channel)) continue; if (tp_strdiff (tp_dbus_tube_channel_get_service_name (channel), EXAMPLE_SERVICE_NAME)) continue; g_message ("Accepting tube"); tube = g_object_ref (channel); g_signal_connect (tube, "invalidated", G_CALLBACK (tube_invalidated_cb), NULL); tp_dbus_tube_channel_accept_async (tube, tube_accepted, context); tp_handle_channels_context_accept (context); return; } g_message ("Rejecting channels"); tp_handle_channels_context_fail (context, &error); } int main (int argc, const char **argv) { TpAccountManager *manager; TpBaseClient *handler; GError *error = NULL; manager = tp_account_manager_dup (); handler = tp_simple_handler_new_with_am (manager, FALSE, FALSE, "ExampleServiceHandler", FALSE, handle_channels, NULL, NULL); tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_DBUS_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TYPE_DBUS_TUBE_SERVICE_NAME, G_TYPE_STRING, EXAMPLE_SERVICE_NAME, NULL)); tp_base_client_register (handler, &error); g_assert_no_error (error); g_message ("Waiting for tube offer"); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (handler); g_object_unref (manager); return 0; } telepathy-glib-0.24.2/examples/client/dbus-tubes/Makefile.am0000644000175000017500000000107712652510705020647 00000000000000noinst_PROGRAMS = \ offerer \ accepter \ $(NULL) offerer_SOURCES = offerer.c constants.h accepter_SOURCES = accepter.c constants.h # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ \ @GLIB_LIBS@ AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ @TP_GLIB_CFLAGS@ AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/client/dbus-tubes/Makefile.in0000644000175000017500000005137614006601553020664 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = offerer$(EXEEXT) accepter$(EXEEXT) subdir = examples/client/dbus-tubes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_accepter_OBJECTS = accepter.$(OBJEXT) accepter_OBJECTS = $(am_accepter_OBJECTS) accepter_LDADD = $(LDADD) accepter_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_offerer_OBJECTS = offerer.$(OBJEXT) offerer_OBJECTS = $(am_offerer_OBJECTS) offerer_LDADD = $(LDADD) offerer_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/accepter.Po ./$(DEPDIR)/offerer.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(accepter_SOURCES) $(offerer_SOURCES) DIST_SOURCES = $(accepter_SOURCES) $(offerer_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ offerer_SOURCES = offerer.c constants.h accepter_SOURCES = accepter.c constants.h # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ \ @GLIB_LIBS@ AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ @TP_GLIB_CFLAGS@ AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/client/dbus-tubes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/client/dbus-tubes/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list accepter$(EXEEXT): $(accepter_OBJECTS) $(accepter_DEPENDENCIES) $(EXTRA_accepter_DEPENDENCIES) @rm -f accepter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(accepter_OBJECTS) $(accepter_LDADD) $(LIBS) offerer$(EXEEXT): $(offerer_OBJECTS) $(offerer_DEPENDENCIES) $(EXTRA_offerer_DEPENDENCIES) @rm -f offerer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(offerer_OBJECTS) $(offerer_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accepter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offerer.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/accepter.Po -rm -f ./$(DEPDIR)/offerer.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/accepter.Po -rm -f ./$(DEPDIR)/offerer.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/client/inspect-connection.c0000644000175000017500000000620012652510705020475 00000000000000/* * telepathy-example-inspect-connection - inspect a connection * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include static int exit_status = 1; static void got_channels (TpConnection *connection, const GPtrArray *channels, const GError *error, gpointer user_data, GObject *weak_object) { GMainLoop *mainloop = user_data; if (error == NULL) { guint i; for (i = 0; i < channels->len; i++) { GValueArray *channel = g_ptr_array_index (channels, i); printf ("Channel: %s\n", (const gchar *) g_value_get_boxed (channel->values)); printf ("\tType: %s\n", g_value_get_string (channel->values + 1)); printf ("\tHandle: type %u, #%u\n", g_value_get_uint (channel->values + 2), g_value_get_uint (channel->values + 3) ); } } else { printf ("Error listing channels: %s", error->message); } g_main_loop_quit (mainloop); } static void connection_ready_cb (GObject *source, GAsyncResult *result, gpointer user_data) { GMainLoop *mainloop = user_data; GError *error = NULL; TpConnection *connection = TP_CONNECTION (source); if (!tp_proxy_prepare_finish (connection, result, &error)) { g_warning ("%s", error->message); g_main_loop_quit (mainloop); g_clear_error (&error); return; } printf ("Connection ready\n"); tp_cli_connection_call_list_channels (connection, -1, /* If ListChannels() needed any arguments, they'd go here */ got_channels, g_main_loop_ref (mainloop), (GDestroyNotify) g_main_loop_unref, NULL); } int main (int argc, char **argv) { TpConnection *connection = NULL; GMainLoop *mainloop = NULL; TpSimpleClientFactory *factory; GError *error = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); if (argc < 2) { fputs ("Usage:\n" " telepathy-example-inspect-connection OBJECT_PATH\n", stderr); return 2; } mainloop = g_main_loop_new (NULL, FALSE); factory = tp_simple_client_factory_new (NULL); connection = tp_simple_client_factory_ensure_connection (factory, argv[1], NULL, &error); if (connection == NULL) { g_warning ("%s", error->message); g_error_free (error); goto out; } /* for this example I assume it's an existing connection on which someone * else has called (or will call) Connect(), so we won't call Connect() * on it ourselves */ tp_proxy_prepare_async (connection, NULL, connection_ready_cb, mainloop); g_main_loop_run (mainloop); out: if (connection != NULL) g_object_unref (connection); if (mainloop != NULL) g_main_loop_unref (mainloop); g_object_unref (factory); return exit_status; } telepathy-glib-0.24.2/examples/client/approver.c0000644000175000017500000001155512652510705016542 00000000000000/* * approver * * Copyright © 2010 Collabora Ltd. * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include #include #include GMainLoop *mainloop = NULL; static void cdo_finished_cb (TpProxy *self, guint domain, gint code, gchar *message, gpointer user_data) { g_print ("ChannelDispatchOperation has been invalidated\n"); g_object_unref (self); g_main_loop_quit (mainloop); } static void handle_with_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source); GError *error; if (!tp_channel_dispatch_operation_handle_with_finish (cdo, result, &error)) { g_print ("HandleWith() failed: %s\n", error->message); g_error_free (error); return; } g_print ("HandleWith() succeeded\n"); } static void close_cb (GObject *source, GAsyncResult *result, gpointer user_data) { TpChannelDispatchOperation *cdo = TP_CHANNEL_DISPATCH_OPERATION (source); GError *error; if (!tp_channel_dispatch_operation_close_channels_finish (cdo, result, &error)) { g_print ("Rejecting channels failed: %s\n", error->message); g_error_free (error); return; } g_print ("Rejected all the things!\n"); } static void add_dispatch_operation_cb (TpSimpleApprover *self, TpAccount *account, TpConnection *connection, GList *channels, TpChannelDispatchOperation *cdo, TpAddDispatchOperationContext *context, gpointer user_data) { GList *l; GStrv possible_handlers; gchar c; g_print ("Approving this batch of channels:\n"); g_signal_connect (cdo, "invalidated", G_CALLBACK (cdo_finished_cb), NULL); for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; g_print ("%s channel with %s\n", tp_channel_get_channel_type (channel), tp_channel_get_identifier (channel)); } possible_handlers = tp_channel_dispatch_operation_get_possible_handlers ( cdo); if (possible_handlers[0] == NULL) { g_print ("\nNo possible handler suggested\n"); } else { guint i; g_print ("\npossible handlers:\n"); for (i = 0; possible_handlers[i] != NULL; i++) g_print (" %s\n", possible_handlers[i]); } g_object_ref (cdo); tp_add_dispatch_operation_context_accept (context); g_print ("Approve? [y/n]\n"); c = fgetc (stdin); if (c == 'y' || c == 'Y') { g_print ("Approve channels\n"); tp_channel_dispatch_operation_handle_with_async (cdo, NULL, handle_with_cb, NULL); } else if (c == 'n' || c == 'N') { g_print ("Reject channels\n"); tp_channel_dispatch_operation_close_channels_async (cdo, close_cb, NULL); } else { g_print ("Ignore channels\n"); } } int main (int argc, char **argv) { TpAccountManager *manager; GError *error = NULL; TpBaseClient *approver; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); manager = tp_account_manager_dup (); approver = tp_simple_approver_new_with_am (manager, "ExampleApprover", FALSE, add_dispatch_operation_cb, NULL, NULL); /* contact text chat */ tp_base_client_take_approver_filter (approver, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); /* call */ tp_base_client_take_approver_filter (approver, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); /* room text chat */ tp_base_client_take_approver_filter (approver, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_TEXT, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_ROOM, NULL)); /* file transfer */ tp_base_client_take_approver_filter (approver, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); if (!tp_base_client_register (approver, &error)) { g_warning ("Failed to register Approver: %s\n", error->message); g_error_free (error); goto out; } g_print ("Start approving\n"); mainloop = g_main_loop_new (NULL, FALSE); g_main_loop_run (mainloop); if (mainloop != NULL) g_main_loop_unref (mainloop); out: g_object_unref (manager); g_object_unref (approver); return 0; } telepathy-glib-0.24.2/examples/client/list-managers.c0000644000175000017500000000364312652510705017451 00000000000000/* * telepathy-example-list-managers - list installed connection managers * * Copyright (C) 2007-2008 Collabora Ltd. * Copyright (C) 2007-2008 Nokia Corporation * * Copying and distribution of this file, with or without modification, * are permitted in any medium without royalty provided the copyright * notice and this notice are preserved. */ #include "config.h" #include typedef struct { GMainLoop *mainloop; int exit_code; } ExampleData; static void got_connection_managers (GObject *source, GAsyncResult *result, gpointer user_data) { ExampleData *data = user_data; GList *cms; GError *error = NULL; cms = tp_list_connection_managers_finish (result, &error); if (error != NULL) { g_warning ("%s", error->message); g_clear_error (&error); data->exit_code = 1; } else { g_message ("Found %u connection managers:", g_list_length (cms)); while (cms != NULL) { TpConnectionManager *cm = cms->data; g_message ("- %s", tp_connection_manager_get_name (cm)); g_object_unref (cm); cms = g_list_delete_link (cms, cms); } } g_main_loop_quit (data->mainloop); } int main (int argc, char **argv) { ExampleData data = { g_main_loop_new (NULL, FALSE), 0 }; TpDBusDaemon *bus_daemon; GError *error = NULL; tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); bus_daemon = tp_dbus_daemon_dup (&error); if (bus_daemon == NULL) { g_warning ("%s", error->message); g_error_free (error); data.exit_code = 1; goto out; } tp_list_connection_managers_async (bus_daemon, got_connection_managers, &data); g_main_loop_run (data.mainloop); out: if (data.mainloop != NULL) g_main_loop_unref (data.mainloop); if (bus_daemon != NULL) g_object_unref (bus_daemon); return data.exit_code; } telepathy-glib-0.24.2/examples/client/stream-tubes/0000755000175000017500000000000014006623342017221 500000000000000telepathy-glib-0.24.2/examples/client/stream-tubes/offerer.c0000644000175000017500000001106712652510705020745 00000000000000#include "config.h" #include static GMainLoop *loop = NULL; static void channel_closed_cb (GObject *object, GAsyncResult *result, gpointer user_data) { TpChannel *channel = TP_CHANNEL (object); GError *error = NULL; if (!tp_channel_close_finish (channel, result, &error)) { g_message ("Failed to close tube channel: %s", error->message); g_error_free (error); return; } g_message ("Tube channel closed"); } static void tube_conn_closed_cb (TpStreamTubeConnection *conn, const GError *error, gpointer user_data) { g_message ("Tube connection has been closed: %s", error->message); } static void _incoming_iostream (TpStreamTubeChannel *tube, TpStreamTubeConnection* tube_conn, gpointer user_data) { GInputStream *in; GOutputStream *out; char buf[128] = { 0, }; GError *error = NULL; TpContact *contact; GSocketConnection *conn; g_signal_connect (tube_conn, "closed", G_CALLBACK (tube_conn_closed_cb), NULL); contact = tp_stream_tube_connection_get_contact (tube_conn); g_message ("Got IOStream from %s", tp_contact_get_identifier (contact)); conn = tp_stream_tube_connection_get_socket_connection (tube_conn); in = g_io_stream_get_input_stream (G_IO_STREAM (conn)); out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); /* this bit is not a good example */ g_input_stream_read (in, &buf, sizeof (buf), NULL, &error); g_assert_no_error (error); g_message ("Received: %s", buf); g_message ("Sending: Pong"); g_output_stream_write (out, "Pong\n", 5, NULL, &error); g_assert_no_error (error); tp_channel_close_async (TP_CHANNEL (tube), channel_closed_cb, NULL); g_object_unref (tube); } static void _tube_offered (GObject *tube, GAsyncResult *res, gpointer user_data) { GError *error = NULL; if (!tp_stream_tube_channel_offer_finish (TP_STREAM_TUBE_CHANNEL (tube), res, &error)) { g_message ("Failed to offer tube: %s", error->message); g_error_free (error); return; } g_message ("Tube offered"); } static void tube_invalidated_cb (TpStreamTubeChannel *tube, guint domain, gint code, gchar *message, gpointer user_data) { g_message ("Tube has been invalidated: %s", message); g_main_loop_quit (loop); } static void _channel_created (GObject *source, GAsyncResult *result, gpointer user_data) { TpChannel *channel; GError *error = NULL; TpStreamTubeChannel *tube; channel = tp_account_channel_request_create_and_handle_channel_finish ( TP_ACCOUNT_CHANNEL_REQUEST (source), result, NULL, &error); if (channel == NULL) { g_message ("Failed to create channel: %s", error->message); g_error_free (error); return; } g_message ("Channel created: %s", tp_proxy_get_object_path (channel)); tube = TP_STREAM_TUBE_CHANNEL (channel); g_signal_connect (tube, "incoming", G_CALLBACK (_incoming_iostream), NULL); g_signal_connect (tube, "invalidated", G_CALLBACK (tube_invalidated_cb), NULL); tp_stream_tube_channel_offer_async (tube, NULL, _tube_offered, NULL); } int main (int argc, const char **argv) { TpSimpleClientFactory *factory; TpAccount *account; char *account_path; GError *error = NULL; TpAccountChannelRequest *req; GHashTable *request; if (argc != 3) { g_printerr ("Usage: offerer gabble/jabber/ladygaga t-pain@example.com\n"); return 2; } factory = TP_SIMPLE_CLIENT_FACTORY (tp_automatic_client_factory_new (NULL)); account_path = g_strconcat (TP_ACCOUNT_OBJECT_PATH_BASE, argv[1], NULL); account = tp_simple_client_factory_ensure_account (factory, account_path, NULL, &error); g_assert_no_error (error); g_free (account_path); request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, argv[2], TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, G_TYPE_STRING, "ExampleService", NULL); g_message ("Offer channel to %s", argv[2]); req = tp_account_channel_request_new (account, request, TP_USER_ACTION_TIME_CURRENT_TIME); tp_account_channel_request_create_and_handle_channel_async (req, NULL, _channel_created, NULL); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_object_unref (account); g_object_unref (req); g_hash_table_unref (request); g_main_loop_unref (loop); g_object_unref (factory); return 0; } telepathy-glib-0.24.2/examples/client/stream-tubes/accepter.c0000644000175000017500000000751312652510705021104 00000000000000#include "config.h" #include static GMainLoop *loop = NULL; static void tube_conn_closed_cb (TpStreamTubeConnection *conn, const GError *error, gpointer user_data) { g_message ("Tube connection has been closed: %s", error->message); } static void _tube_accepted (GObject *tube, GAsyncResult *res, gpointer user_data) { TpHandleChannelsContext *context = user_data; TpStreamTubeConnection *tube_conn; GSocketConnection *conn; GInputStream *in; GOutputStream *out; char buf[128] = { 0, }; GError *error = NULL; tube_conn = tp_stream_tube_channel_accept_finish ( TP_STREAM_TUBE_CHANNEL (tube), res, &error); g_signal_connect (tube_conn, "closed", G_CALLBACK (tube_conn_closed_cb), NULL); if (error != NULL) { g_message ("Can't accept the tube: %s", error->message); tp_handle_channels_context_fail (context, error); g_error_free (error); return; } tp_handle_channels_context_accept (context); g_object_unref (context); g_message ("Tube open, have IOStream"); conn = tp_stream_tube_connection_get_socket_connection (tube_conn); in = g_io_stream_get_input_stream (G_IO_STREAM (conn)); out = g_io_stream_get_output_stream (G_IO_STREAM (conn)); /* this bit is not a good example */ g_message ("Sending: Ping"); g_output_stream_write (out, "Ping\n", 5, NULL, &error); g_assert_no_error (error); g_input_stream_read (in, &buf, sizeof (buf), NULL, &error); g_assert_no_error (error); g_message ("Received: %s", buf); g_object_unref (tube_conn); } static void tube_invalidated_cb (TpStreamTubeChannel *tube, guint domain, gint code, gchar *message, gpointer user_data) { g_message ("Tube has been invalidated: %s", message); g_main_loop_quit (loop); } static void _handle_channels (TpSimpleHandler *handler, TpAccount *account, TpConnection *conn, GList *channels, GList *requests, gint64 action_time, TpHandleChannelsContext *context, gpointer user_data) { gboolean delay = FALSE; GList *l; g_message ("Handling channels"); for (l = channels; l != NULL; l = l->next) { TpStreamTubeChannel *tube = l->data; if (!TP_IS_STREAM_TUBE_CHANNEL (tube)) continue; g_message ("Accepting tube"); g_signal_connect (tube, "invalidated", G_CALLBACK (tube_invalidated_cb), NULL); tp_stream_tube_channel_accept_async (tube, _tube_accepted, context); delay = TRUE; } if (delay) { g_message ("Delaying channel acceptance"); tp_handle_channels_context_delay (context); g_object_ref (context); } else { GError *error; g_message ("Rejecting channels"); error = g_error_new (TP_ERROR, TP_ERROR_NOT_AVAILABLE, "No channels to be handled"); tp_handle_channels_context_fail (context, error); g_error_free (error); } } int main (int argc, const char **argv) { TpAccountManager *manager; TpBaseClient *handler; GError *error = NULL; manager = tp_account_manager_dup (); handler = tp_simple_handler_new_with_am (manager, FALSE, FALSE, "ExampleServiceHandler", FALSE, _handle_channels, NULL, NULL); tp_base_client_take_handler_filter (handler, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE, G_TYPE_STRING, "ExampleService", NULL)); tp_base_client_register (handler, &error); g_assert_no_error (error); g_message ("Waiting for tube offer"); loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (loop); g_main_loop_unref (loop); g_object_unref (handler); g_object_unref (manager); return 0; } telepathy-glib-0.24.2/examples/client/stream-tubes/Makefile.am0000644000175000017500000000104712652510705021202 00000000000000noinst_PROGRAMS = \ offerer \ accepter \ $(NULL) offerer_SOURCES = offerer.c accepter_SOURCES = accepter.c # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ \ @GLIB_LIBS@ AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ @TP_GLIB_CFLAGS@ AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) telepathy-glib-0.24.2/examples/client/stream-tubes/Makefile.in0000644000175000017500000005135414006601553021216 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = offerer$(EXEEXT) accepter$(EXEEXT) subdir = examples/client/stream-tubes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_accepter_OBJECTS = accepter.$(OBJEXT) accepter_OBJECTS = $(am_accepter_OBJECTS) accepter_LDADD = $(LDADD) accepter_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_offerer_OBJECTS = offerer.$(OBJEXT) offerer_OBJECTS = $(am_offerer_OBJECTS) offerer_LDADD = $(LDADD) offerer_DEPENDENCIES = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/accepter.Po ./$(DEPDIR)/offerer.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(accepter_SOURCES) $(offerer_SOURCES) DIST_SOURCES = $(accepter_SOURCES) $(offerer_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ offerer_SOURCES = offerer.c accepter_SOURCES = accepter.c # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path LDADD = \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la \ @DBUS_LIBS@ \ @GLIB_LIBS@ AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ @DBUS_CFLAGS@ \ @GLIB_CFLAGS@ \ @TP_GLIB_CFLAGS@ AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/client/stream-tubes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/client/stream-tubes/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list accepter$(EXEEXT): $(accepter_OBJECTS) $(accepter_DEPENDENCIES) $(EXTRA_accepter_DEPENDENCIES) @rm -f accepter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(accepter_OBJECTS) $(accepter_LDADD) $(LIBS) offerer$(EXEEXT): $(offerer_OBJECTS) $(offerer_DEPENDENCIES) $(EXTRA_offerer_DEPENDENCIES) @rm -f offerer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(offerer_OBJECTS) $(offerer_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accepter.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offerer.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/accepter.Po -rm -f ./$(DEPDIR)/offerer.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/accepter.Po -rm -f ./$(DEPDIR)/offerer.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstPROGRAMS cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/Makefile.am0000644000175000017500000000017312652510705015310 00000000000000# extensions has to be compiled first, because other examples need it. SUBDIRS = extensions client cm EXTRA_DIST = README telepathy-glib-0.24.2/examples/Makefile.in0000644000175000017500000005025614006601553015325 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ # extensions has to be compiled first, because other examples need it. SUBDIRS = extensions client cm EXTRA_DIST = README all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/extensions/0000755000175000017500000000000014006623342015527 500000000000000telepathy-glib-0.24.2/examples/extensions/Connection_Interface_Hats.xml0000644000175000017500000001253312652510705023236 00000000000000 Copyright (C) 2007 Collabora Ltd. Copyright (C) 2007 Nokia Corporation Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This interface is an example of how Telepathy can be extended. For the purposes of this example, we pretend we're an organisation example.com that's adding a proprietary extension to Telepathy, so the extension is not in the main Telepathy namespace. A data structure representing a contact and their hat. The contact wearing the hat. The color of the hat The style of the hat Optional key-value pairs describing extended properties of the hat. There is no hat. color MUST be the empty string and properties MUST be an empty mapping. An unspecified type of hat. A fedora, which MAY be red. A knitted hat, with or without a bobble. A bowler hat, as worn by stereotypical English businessmen. A hat with protective qualities. Emitted when the contact's hat has changed. The handle representing the contact's ID on the server The color of the contact's hat. The style of the contact's hat. There's always an a{sv}. Perhaps there's some special religious reason. Request a list of the hats worn by the given contacts. The handles of the contacts whose hats are requested A list of contacts and their hats. Indicate that the hat currently being worn by the local user has changed. The color of the contact's hat. The style of the contact's hat. There's always an a{sv}... telepathy-glib-0.24.2/examples/extensions/extensions-cli.c0000644000175000017500000000142012652510705020557 00000000000000#include "config.h" #include "extensions.h" #include #include #include static void _example_ext_register_dbus_glib_marshallers (void); /* include auto-generated stubs for client-specific code */ #include "_gen/cli-connection-body.h" #include "_gen/register-dbus-glib-marshallers-body.h" static gpointer example_cli_once (gpointer data) { _example_ext_register_dbus_glib_marshallers (); tp_connection_init_known_interfaces (); tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_CONNECTION, example_cli_connection_add_signals); return NULL; } void example_cli_init (void) { static GOnce once = G_ONCE_INIT; g_once (&once, example_cli_once, NULL); } telepathy-glib-0.24.2/examples/extensions/Makefile.am0000644000175000017500000001056212652510705017512 00000000000000# This directory is an example of how to build extensions to the spec. # Typically this would be in a top-level extensions/ directory. # # In this example we build an extension for the TpConnection class, # by using "--subclass=TpConnection --subclass-assert=TP_IS_CONNECTION". # We could instead (or additionally) have made an extension for any other # class, or by omitting those options entirely we could have made an extension # that will work on TpProxy or any subclass of TpProxy. tools_dir = $(top_srcdir)/tools AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TP_GLIB_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) EXTRA_DIST = \ all.xml \ connection.xml \ Connection_Interface_Hats.xml noinst_LTLIBRARIES = libexample-extensions.la # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path libexample_extensions_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la # The client-specific parts are built into a separate .o file, so the linker # can discard them when linking services. The service-specific parts are # in svc-*.c, so we don't need an extensions-svc.c. libexample_extensions_la_SOURCES = \ extensions.c \ extensions-cli.c \ extensions.h nodist_libexample_extensions_la_SOURCES = \ _gen/register-dbus-glib-marshallers-body.h \ _gen/enums.h \ _gen/gtypes.h \ _gen/gtypes-body.h \ _gen/interfaces.h \ _gen/interfaces-body.h \ _gen/cli-connection.h \ _gen/cli-connection-body.h \ _gen/svc-connection.h \ _gen/svc-connection.c BUILT_SOURCES = \ _gen/all.xml \ _gen/connection.xml \ $(nodist_libexample_extensions_la_SOURCES) \ extensions.html CLEANFILES = $(BUILT_SOURCES) clean-local: rm -rf _gen XSLTPROCFLAGS = --nonet --novalid # Generated files which can be generated for all categories simultaneously _gen/all.xml: all.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ $(tools_dir)/doc-generator.xsl \ $< > $@ # do nothing, output as a side-effect _gen/gtypes.h: _gen/gtypes-body.h @: _gen/gtypes-body.h: _gen/all.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ $< _gen/gtypes Example _gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \ $(tools_dir)/glib-client-marshaller-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ _example_ext > $@ _gen/enums.h: _gen/all.xml \ $(tools_dir)/c-constants-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Example \ $< _gen/enums # do nothing, output as a side-effect _gen/interfaces-body.h: _gen/interfaces.h @: _gen/interfaces.h: _gen/all.xml \ $(tools_dir)/glib-interfaces-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Example _gen/interfaces-body.h _gen/interfaces.h $< # Generated files which must be generated per "category". Each TpProxy # subclass you want to use with --subclass will need to have its own category, # although you can subdivide further if you want. _gen/connection.xml: connection.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ # do nothing, output as a side-effect _gen/cli-connection.h: _gen/cli-connection-body.h @: _gen/cli-connection-body.h: _gen/connection.xml \ $(tools_dir)/glib-client-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ --group=connection \ --subclass=TpConnection \ --subclass-assert=TP_IS_CONNECTION \ --iface-quark-prefix=EXAMPLE_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ $< Example_Cli _gen/cli-connection # do nothing, output as a side-effect _gen/svc-connection.h: _gen/svc-connection.c @: _gen/svc-connection.c: _gen/connection.xml \ $(tools_dir)/glib-ginterface-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-connection \ --signal-marshal-prefix=_example_ext \ --include='' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Example_Svc_ telepathy-glib-0.24.2/examples/extensions/Makefile.in0000644000175000017500000006301514006601553017521 00000000000000# Makefile.in generated by automake 1.16.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # This directory is an example of how to build extensions to the spec. # Typically this would be in a top-level extensions/ directory. # # In this example we build an extension for the TpConnection class, # by using "--subclass=TpConnection --subclass-assert=TP_IS_CONNECTION". # We could instead (or additionally) have made an extension for any other # class, or by omitting those options entirely we could have made an extension # that will work on TpProxy or any subclass of TpProxy. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = examples/extensions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/compiler.m4 \ $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/introspection.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/linker.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/tp-compiler-flag.m4 \ $(top_srcdir)/m4/tp-compiler-warnings.m4 \ $(top_srcdir)/m4/tp-linker-flag.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libexample_extensions_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la am_libexample_extensions_la_OBJECTS = extensions.lo extensions-cli.lo am__dirstamp = $(am__leading_dot)dirstamp nodist_libexample_extensions_la_OBJECTS = _gen/svc-connection.lo libexample_extensions_la_OBJECTS = \ $(am_libexample_extensions_la_OBJECTS) \ $(nodist_libexample_extensions_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/extensions-cli.Plo \ ./$(DEPDIR)/extensions.Plo _gen/$(DEPDIR)/svc-connection.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libexample_extensions_la_SOURCES) \ $(nodist_libexample_extensions_la_SOURCES) DIST_SOURCES = $(libexample_extensions_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COVERAGE_CFLAGS = @COVERAGE_CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ DBUS_LIBS = @DBUS_LIBS@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ ERROR_SCANNERFLAGS = @ERROR_SCANNERFLAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ GTKDOC_MKPDF = @GTKDOC_MKPDF@ GTKDOC_REBASE = @GTKDOC_REBASE@ HAVE_VALA = @HAVE_VALA@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ LT_REVISION = @LT_REVISION@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TP_GLIB_CFLAGS = @TP_GLIB_CFLAGS@ TP_MAJOR_VERSION = @TP_MAJOR_VERSION@ TP_MICRO_VERSION = @TP_MICRO_VERSION@ TP_MINOR_VERSION = @TP_MINOR_VERSION@ VALAC = @VALAC@ VALAFLAGS = @VALAFLAGS@ VAPIGEN = @VAPIGEN@ VERSION = @VERSION@ VERSION_SCRIPT_ARG = @VERSION_SCRIPT_ARG@ XSLTPROC = @XSLTPROC@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ enable_fatal_warnings = @enable_fatal_warnings@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ tpglibtestsdir = @tpglibtestsdir@ tools_dir = $(top_srcdir)/tools AM_CPPFLAGS = \ -DTP_DISABLE_SINGLE_INCLUDE \ $(NULL) AM_CFLAGS = \ $(ERROR_CFLAGS) \ $(DBUS_CFLAGS) \ $(GLIB_CFLAGS) \ $(TP_GLIB_CFLAGS) AM_LDFLAGS = \ $(ERROR_LDFLAGS) \ $(NULL) EXTRA_DIST = \ all.xml \ connection.xml \ Connection_Interface_Hats.xml noinst_LTLIBRARIES = libexample-extensions.la # In an external project you'd use $(TP_GLIB_LIBS) (obtained from # pkg-config via autoconf) instead of the .la path libexample_extensions_la_LIBADD = \ $(GLIB_LIBS) \ $(DBUS_LIBS) \ $(top_builddir)/telepathy-glib/libtelepathy-glib.la # The client-specific parts are built into a separate .o file, so the linker # can discard them when linking services. The service-specific parts are # in svc-*.c, so we don't need an extensions-svc.c. libexample_extensions_la_SOURCES = \ extensions.c \ extensions-cli.c \ extensions.h nodist_libexample_extensions_la_SOURCES = \ _gen/register-dbus-glib-marshallers-body.h \ _gen/enums.h \ _gen/gtypes.h \ _gen/gtypes-body.h \ _gen/interfaces.h \ _gen/interfaces-body.h \ _gen/cli-connection.h \ _gen/cli-connection-body.h \ _gen/svc-connection.h \ _gen/svc-connection.c BUILT_SOURCES = \ _gen/all.xml \ _gen/connection.xml \ $(nodist_libexample_extensions_la_SOURCES) \ extensions.html CLEANFILES = $(BUILT_SOURCES) XSLTPROCFLAGS = --nonet --novalid all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/extensions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu examples/extensions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } _gen/$(am__dirstamp): @$(MKDIR_P) _gen @: > _gen/$(am__dirstamp) _gen/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) _gen/$(DEPDIR) @: > _gen/$(DEPDIR)/$(am__dirstamp) _gen/svc-connection.lo: _gen/$(am__dirstamp) \ _gen/$(DEPDIR)/$(am__dirstamp) libexample-extensions.la: $(libexample_extensions_la_OBJECTS) $(libexample_extensions_la_DEPENDENCIES) $(EXTRA_libexample_extensions_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libexample_extensions_la_OBJECTS) $(libexample_extensions_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f _gen/*.$(OBJEXT) -rm -f _gen/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extensions-cli.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extensions.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@_gen/$(DEPDIR)/svc-connection.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf _gen/.libs _gen/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f _gen/$(DEPDIR)/$(am__dirstamp) -rm -f _gen/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/extensions-cli.Plo -rm -f ./$(DEPDIR)/extensions.Plo -rm -f _gen/$(DEPDIR)/svc-connection.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/extensions-cli.Plo -rm -f ./$(DEPDIR)/extensions.Plo -rm -f _gen/$(DEPDIR)/svc-connection.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-local \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile clean-local: rm -rf _gen # Generated files which can be generated for all categories simultaneously _gen/all.xml: all.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ $(tools_dir)/doc-generator.xsl \ $< > $@ # do nothing, output as a side-effect _gen/gtypes.h: _gen/gtypes-body.h @: _gen/gtypes-body.h: _gen/all.xml \ $(top_srcdir)/tools/glib-gtypes-generator.py $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ $< _gen/gtypes Example _gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \ $(tools_dir)/glib-client-marshaller-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ _example_ext > $@ _gen/enums.h: _gen/all.xml \ $(tools_dir)/c-constants-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \ Example \ $< _gen/enums # do nothing, output as a side-effect _gen/interfaces-body.h: _gen/interfaces.h @: _gen/interfaces.h: _gen/all.xml \ $(tools_dir)/glib-interfaces-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \ Example _gen/interfaces-body.h _gen/interfaces.h $< # Generated files which must be generated per "category". Each TpProxy # subclass you want to use with --subclass will need to have its own category, # although you can subdivide further if you want. _gen/connection.xml: connection.xml $(wildcard *.xml) $(tools_dir)/xincludator.py $(MKDIR_P) _gen $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@ # do nothing, output as a side-effect _gen/cli-connection.h: _gen/cli-connection-body.h @: _gen/cli-connection-body.h: _gen/connection.xml \ $(tools_dir)/glib-client-gen.py Makefile.am $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \ --group=connection \ --subclass=TpConnection \ --subclass-assert=TP_IS_CONNECTION \ --iface-quark-prefix=EXAMPLE_IFACE_QUARK \ --tp-proxy-api=0.7.6 \ $< Example_Cli _gen/cli-connection # do nothing, output as a side-effect _gen/svc-connection.h: _gen/svc-connection.c @: _gen/svc-connection.c: _gen/connection.xml \ $(tools_dir)/glib-ginterface-gen.py $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc-connection \ --signal-marshal-prefix=_example_ext \ --include='' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Example_Svc_ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: telepathy-glib-0.24.2/examples/extensions/extensions.c0000644000175000017500000000024412652510705020015 00000000000000#include "extensions.h" /* include auto-generated stubs for things common to service and client */ #include "_gen/gtypes-body.h" #include "_gen/interfaces-body.h" telepathy-glib-0.24.2/examples/extensions/extensions.h0000644000175000017500000000070112652510705020020 00000000000000#ifndef __EXAMPLE_EXTENSIONS_H__ #define __EXAMPLE_EXTENSIONS_H__ #include #include #include "examples/extensions/_gen/enums.h" #include "examples/extensions/_gen/cli-connection.h" #include "examples/extensions/_gen/svc-connection.h" G_BEGIN_DECLS #include "examples/extensions/_gen/gtypes.h" #include "examples/extensions/_gen/interfaces.h" void example_cli_init (void); G_END_DECLS #endif telepathy-glib-0.24.2/examples/extensions/all.xml0000644000175000017500000000071312652510705016745 00000000000000 Extensions for 'extended' examples telepathy-glib-0.24.2/examples/extensions/connection.xml0000644000175000017500000000040412652510705020331 00000000000000 Connection extensions for 'extended' example telepathy-glib-0.24.2/ChangeLog0000644000175000017500000202653214006623344013220 00000000000000commit 424e12a3277d23bc8cb3e84a1659a0939ade819e Author: Alexander Akulich Date: 2021-01-26 18:38:26 +0300 Prepare release 0.24.2 commit ef171780277fb7677b75fd08933a60447ae43d5d Author: Martin Jones Date: 2021-02-03 18:44:55 +0300 Fix crash when creating a conference call commit e7dcfacbf54caff1bb4103cec6985a18db5db923 Author: Alexander Akulich Date: 2021-01-26 18:35:36 +0300 NEWS: Change the target release to 0.24.2 commit 9bb136076bc8757a967d5a58fccc592976887f97 Merge: 2ec256464 9c6c6fb52 Author: Alexander Akulich Date: 2021-01-26 18:23:28 +0300 Merge 'master' into telepathy-glib-0.24 (the branch has only fixes) commit 2ec2564642ca3c3e84cc7fc0c29c5da2567201dd Merge: 7c43fdc26 2487d4f72 Author: Alexander Akulich Date: 2021-01-26 18:20:10 +0300 Merge telepathy-master into telepathy-glib-0.24 excluding some changes Exclude revert "Upload documentation to the 0.24.x location" Exclude revert "Disable warnings about deprecated functions for stable branch" commit 9c6c6fb5203d8cb73064a02cc6b147aa91908952 Author: Ivaylo Dimitrov Date: 2020-08-27 13:31:03 +0300 protocol: fix a memory leak Signed-off-by: Ivaylo Dimitrov commit fd7626ee3cc965f15fe78d9f45e713ebefd83a99 Author: Jakub Kulík Date: 2020-05-19 11:50:44 +0200 Tests: Make tests Python 3 compatible commit 8b3ef714d8f94b96eaa9af238abe2b2f62b60bae Author: Jakub Kulík Date: 2020-05-19 09:26:29 +0200 Sort generated types and adjust expected accordingly commit 0868f6d539d25c3b67e7cb10ed4ad21ce77f411e Author: Ting-Wei Lan Date: 2017-06-05 22:10:12 +0800 TpBasePasswordChannel: fix gtk-doc comment for finished signal https://bugs.freedesktop.org/show_bug.cgi?id=101301 commit 13a8d52077f0415d79c0f7aba2af50db01458021 Author: Fabrice Bellet Date: 2016-11-09 10:49:27 +0100 debug-sender: fix messages queue locking commit 2e8b2cc0db09b781d99e3755bb6d01548037fe7b Author: Fabrice Bellet Date: 2016-12-15 11:36:05 +0100 call-channel: fix a memory leak commit 76cc2d96a5601572639032d33c2e1a16ff8a8905 Author: Alexander Akulich Date: 2019-12-12 23:35:26 +0300 Tests: Adjust expected gtypes sources to conform with the types order commit e92d895158feacf7b0e4b3b102525447d61b3013 Author: Alexander Akulich Date: 2019-12-12 23:35:19 +0300 tools/glib-gtypes-generator.py: Sort generated types commit ab13da946b2839a79e199f59e57ff984ebf9ef98 Author: Alexey Andreyev Date: 2019-12-12 19:22:00 +0300 Port tools/manager-file.py to Python 3 commit 64fac8c6983be656d8fdbe8f3fe51b00753a2b73 Author: Alexander Akulich Date: 2019-09-15 15:46:16 +0300 Port make-release-mail.py to Python 3 commit 45ca39448d90d960fa003d3e5e118453fb7dceab Author: Alexander Akulich Date: 2019-09-25 01:54:12 +0300 xincludator.py: Fix behaviour on LANG=C Use UTF-8 encoding instead of 'None', because spec XMLs contain non-ASCII symbols, such as copyright sign. commit 739afb4e9ef4a0b3ee124d0a188757069791b1a6 Author: George Kiagiadakis Date: 2016-09-01 18:03:25 +0300 build: fix previous commit for out-of-source running of autogen.sh Previous commit: dc39be2757bd7fa789c3db834d8d701b1f54f785 This commit makes the final diff match the one by Alban Browaeys, as attached in bug 59705, which addresses some good points that Simon had made in his review. It is more portable and more clean this way. https://bugs.freedesktop.org/show_bug.cgi?id=59705 https://bugs.freedesktop.org/show_bug.cgi?id=94391 commit e03967c263fc628e1a3301c390353f7c17243c20 Author: Sebastian Geiger Date: 2016-07-01 23:29:54 +0200 Enable silent builds Bug: https://bugs.freedesktop.org/show_bug.cgi?id=96774 Reviewed-by: Debarshi Ray commit 26ed60ccf4efe7f3fed149ecd057a52329a03084 Author: George Kiagiadakis Date: 2016-06-18 14:21:52 +0300 Update NEWS commit 2764a6785a0d56c9a0341ec146dc715fed6704b4 Author: Philip Withnall Date: 2015-06-16 10:21:47 +0100 tests: Fix a service file path to fix the build with installed tests Two directories were the wrong way round. https://bugs.freedesktop.org/show_bug.cgi?id=90991 commit e86a31fba2acb8b4f0cfd9e022dbe73f587241b8 Author: Iain Lane Date: 2015-10-02 15:21:13 +0100 tests: Remove a G_GNUC_UNUSED which isn't true any more commit dc39be2757bd7fa789c3db834d8d701b1f54f785 Author: Philip Withnall Date: 2016-03-04 01:20:40 +0000 build: cd to the $srcdir in autogen.sh for running gtkdocize gtkdocize needs to run in the $srcdir (or have a --srcdir argument passed to it) so that it can find configure.[ac|in]. Ensure that’s the case in autogen.sh. This fixes autogen.sh in a srcdir ≠ builddir environment. commit 1f15dc935b65a7296dcf815b4da31a3d3b68f116 Author: George Kiagiadakis Date: 2016-06-18 11:33:59 +0300 tests: eliminate duplicate test case paths Seems like this doesn't work with recent versions of glib commit d27684c488ceee4f2f54f549738adab0e2e8165d Author: Simon McVittie Date: 2014-09-17 12:14:24 +0100 Replace tp_verify_* with equivalent G_STATIC_ASSERTs This was breaking the build: gtk-doc no longer understands verify.h. commit 2487d4f72c00fbac6fa2f9e32e4e72404e24ae96 Merge: 7494959b2 7c43fdc26 Author: Simon McVittie Date: 2014-09-17 11:55:28 +0100 Merge remote-tracking branch 'origin/telepathy-glib-0.24' commit 7494959b21e00acfc853728a230cb9dd55e46df5 Author: Simon McVittie Date: 2014-09-17 11:53:44 +0100 Revert "Upload documentation to the 0.24.x location" This reverts commit fb9e80acf4504706a9a52c9bca735362dd5411c7. commit 6d399eaec1ab6381c57a371320528fda5d2e3e7c Author: Simon McVittie Date: 2014-09-17 11:53:35 +0100 Revert "Don't check documentation completeness in this stable branch" This reverts commit 0273bfb815ef74115d614f5e5f04e013374f7a01. commit e79273e710e7c045542ff856f31ab6edbb29d5a8 Author: Simon McVittie Date: 2014-09-17 11:53:26 +0100 Revert "Disable warnings about deprecated functions for stable branch" This reverts commit d622628afac82b057fde9315cbb6e1cf022a3f3e. commit 7c43fdc26f561018c3ba66314974d5db45081415 Author: Guillaume Desmottes Date: 2014-08-25 14:41:02 +0200 set nano flag commit c834ef1a50a97cbfae7a0d560ff806fd5aa7ffe8 Author: Guillaume Desmottes Date: 2014-08-25 14:28:42 +0200 0.24.1 commit bee265a2a8e37dc549bbbfcce9d7a67a298b07e7 Merge: e01067b4c ff81777b6 Author: Guillaume Desmottes Date: 2014-05-26 14:09:24 +0200 Merge branch 'telepathy-glib-0.24' commit e01067b4cb9b31e562b656e3af32e26b46fcb36f Author: Guillaume Desmottes Date: 2014-05-21 10:54:22 +0200 test-connection-error: don't check errors twice We are already using g_assert_error() to check those. https://bugs.freedesktop.org/show_bug.cgi?id=79006 commit 93d10077e2ff5c629e6ca6eed2d4ed801eb964ad Author: Guillaume Desmottes Date: 2014-05-21 10:49:37 +0200 account-request: remove useless 'priv' variable https://bugs.freedesktop.org/show_bug.cgi?id=79006 commit ff81777b6176f5379a8c1f6152625f498757ddb1 Author: Guillaume Desmottes Date: 2014-05-21 10:47:23 +0200 contact-list: don't crash if 'd' is NULL https://bugs.freedesktop.org/show_bug.cgi?id=79006 commit ae627c03b209c521cf6c2f17b9d22fc44a6cd207 Author: Guillaume Desmottes Date: 2014-05-26 13:46:54 +0200 base-client: fix potential uninitialized variable bug commit 1880685e4cf1116dee132915f9e545d8e5d2ad31 Author: Guillaume Desmottes Date: 2014-05-08 15:18:27 +0200 stop hardcoding python's path in .py scripts https://bugs.freedesktop.org/show_bug.cgi?id=76495 commit 3ba6a273a477221c9285c323b64bf63b804e887a Author: Simon McVittie Date: 2014-03-26 16:48:10 +0000 nano version commit 2a401e6ecc6392768416a5db139cd862f942d6eb Author: Simon McVittie Date: 2014-03-26 15:43:35 +0000 0.24.0 commit fb9e80acf4504706a9a52c9bca735362dd5411c7 Author: Simon McVittie Date: 2014-03-26 15:42:17 +0000 Upload documentation to the 0.24.x location commit 0273bfb815ef74115d614f5e5f04e013374f7a01 Author: Simon McVittie Date: 2012-10-03 09:49:33 +0100 Don't check documentation completeness in this stable branch commit d622628afac82b057fde9315cbb6e1cf022a3f3e Author: Simon McVittie Date: 2010-04-06 12:33:21 +0100 Disable warnings about deprecated functions for stable branch Since this is a stable branch, we're unlikely to fix uses of deprecated functions, so we shouldn't warn about them. commit 97143251db33faf3ffb968120f611240e3406841 Author: Simon McVittie Date: 2014-03-18 13:58:25 +0000 NEWS commit 164cf33347e03e3d04f013ec7f710d991825cd66 Author: Simon McVittie Date: 2014-03-18 13:51:16 +0000 Don't leak method call results (regression in 0.23.1) Commit 7ffbde3f used common code for two blocks that were not actually the same. dbus-glib method calls give the caller a new reference to the results, whereas dbus-glib signals do not. As a result, the method-call case needs to either free the results, or get them freed by giving ownership to the GValueArray. I chose to give ownership. Reviewed-by: Guillaume Desmottes commit 9cac456895857da672c73edaa45594d384f174d6 Author: Guillaume Desmottes Date: 2014-03-18 12:20:45 +0100 set nano flag commit 3f02fdc0fd182e5f058507f966658ac89c1cdd85 Author: Guillaume Desmottes Date: 2014-03-18 11:01:57 +0100 0.23.3 commit bee5b30275907199e284625311bcd4fa6fc3097f Author: Guillaume Desmottes Date: 2014-03-17 16:45:07 +0100 tp_list_connection_managers_async: terminate properly if there is no CM Fix fdo#68892. commit e8b9fc31f0f4fee539dd6248bde70c2c505a6df4 Author: Guillaume Desmottes Date: 2014-03-17 16:46:44 +0100 connection-manager: factor out all_cms_prepared() commit 9415b529a87ed63faa770799655c9506c86ea6b4 Author: Guillaume Desmottes Date: 2014-03-14 12:56:45 +0100 call-channel: pass our factory to TpCallStream objects Partially fix fdo#76168. commit db4715246a5ccb28dd427f467cfdd4a34b4e65ff Author: Guillaume Desmottes Date: 2014-03-14 12:56:45 +0100 call-channel: pass our factory to TpCallContent objects Partially fix fdo#76168. commit 10259fa5d3b5dddc3b2202a36e4b6b621890fab1 Merge: 087e10432 86db955ee Author: Guillaume Desmottes Date: 2014-03-13 15:41:20 +0100 Merge branch 'telepathy-glib-0.22' Conflicts: telepathy-glib/contact.c commit 86db955eede16bf794c3ba7b3355183ca11a5a17 Author: Guillaume Desmottes Date: 2014-03-13 15:27:00 +0100 fix file path leaks g_file_get_path() returns (transfer full). Fix fdo#76119 commit 087e1043269d361b1f349b1cf123ac10506e4bbc Merge: e8c682307 3d96ce695 Author: Simon McVittie Date: 2014-03-13 13:54:16 +0000 Merge branch 'telepathy-glib-0.22' Conflicts: NEWS commit 3d96ce6954390613bf19bf8e5cf28ab1957717f2 Author: Simon McVittie Date: 2014-03-13 13:49:01 +0000 0.22 NEWS commit b80309ee68dc9003d6384d6932d89c1443cdc8a1 Author: Xavier Claessens Date: 2013-12-04 14:09:18 -0500 TpFileTransferChannel: Fix possible crashes, particularly with GLib 2.39 tp_file_transfer_channel_accept_file_async() and tp_file_transfer_channel_provide_file_async() operations are supposed to complete as soon as the CM returns from AcceptFile or ProvideFile. That means that we cannot call operation_failed() for streaming errors. We also have to keep a ref on self while streaming the file to avoid a crash in the callback when we dereference self. This means that the client app cannot cancel the ongoing streaming by unreffing the channel, replying on dispose calling g_cancellable_cancel(). It can still be doing using g_object_run_dispose() though. To make it cleaner we should probably add tp_file_transfer_channel_cancel(). The spec does not provide any way for the streaming client to inform the CM and other clients about the error occured while streaming. TpFileTransferChannel API does not even have a way to propagate that error to the user. [slightly more informative commit message for the 0.22 cherry-pick -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=72319 commit d1b1f0bf72a2820ae5a51b25c7817c3005b687ab Author: Simon McVittie Date: 2014-03-10 17:30:44 +0000 TpProxy: finish_all_requests: don't leak copied GQueue Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76000 Reviewed-by: Guillaume Desmottes commit 362dc49e04dfef23a2aaf4c2db04252a859dadde Author: Simon McVittie Date: 2014-03-10 16:57:50 +0000 TpContact: mime_file_written: don't leak the file's path Bug: https://bugs.freedesktop.org/show_bug.cgi?id=76000 Reviewed-by: Guillaume Desmottes commit e8c68230750766d6dc1d5594cc898f2d914c91fb Author: Guillaume Desmottes Date: 2014-02-28 17:01:02 +0100 add tp_protocol_new_vardict() commit de7f581297e8cc50d5fe9694bbccfb7e131ee009 Author: Guillaume Desmottes Date: 2014-02-28 16:57:35 +0100 protocol: add TpProtocol:protocol-properties-vardict commit 2d8217676a5765fa580d48f37310ecc0b2c8a5f1 Author: Guillaume Desmottes Date: 2014-02-28 16:26:12 +0100 test creating a TpProtocol by passing its immutable props commit a4d1165fcd95eaadbc662c89497386545c90ca56 Author: Guillaume Desmottes Date: 2014-02-28 16:24:39 +0100 test-protocol-objects: factor out check_tp_protocol() commit 7f475bb73bb54fb635092b92343556bc4d37ed44 Author: Guillaume Desmottes Date: 2014-02-26 13:22:30 +0100 set nano version commit 0b1a67b0ce875f5a59a5f59ae8d483cfad91f9ef Author: Guillaume Desmottes Date: 2014-02-26 11:07:15 +0100 0.23.2 commit 747174e71576e91f756a3dc56dd5a4f5d59042c1 Author: Guillaume Desmottes Date: 2014-02-25 16:10:28 +0100 add tp_account_channel_request_set_initial_invitees commit bf0b1ee111621247fdd83025d02cf42ab67aba5e Author: Guillaume Desmottes Date: 2014-02-25 15:57:33 +0100 add tp_account_channel_request_set_initial_invitee_ids() commit aa643f1836a732d0b849d465b7777ac3265ef9a4 Author: Guillaume Desmottes Date: 2014-02-25 15:45:33 +0100 add tp_account_channel_request_set_conference_initial_channels() commit 5ecb253be2a30f7bbde601aeed65f75acb7476ae Author: Guillaume Desmottes Date: 2014-02-25 15:20:13 +0100 account-channel-request: set TargetHandleType: TP_HANDLE_TYPE_NONE if needed commit c3beedcc25d4db5eb8d70581ddf6a06eb05bb951 Author: Guillaume Desmottes Date: 2014-02-25 14:56:57 +0100 account-channel-request: factor out going_to_request() commit bc7cdedbf761fc78ab176f77c8e31376527cc9fe Author: Guillaume Desmottes Date: 2014-02-25 14:35:42 +0100 add tp_account_channel_request_set_sms_channel() commit 6d1aed685b8860d2e0cc4d12b251d19616617819 Author: Guillaume Desmottes Date: 2014-02-25 14:20:50 +0100 add tp_account_channel_request_new_dbus_tube() commit b99443c02d20923988dc97318e6cf572e9b5e66f Author: Guillaume Desmottes Date: 2014-02-25 12:47:18 +0100 add tp_account_channel_request_new_stream_tube() commit 410e44a648eb3bd2eb5db31a39326b01ac953eac Author: Guillaume Desmottes Date: 2014-02-25 12:39:59 +0100 add tp_account_channel_request_set_file_transfer_hash() commit 8cc41d121d1579893c2c7f7cc7bc90670170380f Author: Xavier Claessens Date: 2014-01-24 16:31:53 -0500 TpBaseConnection: add "account-path-suffix" property commit 5bb624f0cc23d24d13ac9dd4ff0ef9ece0abe9c2 Author: Simon McVittie Date: 2014-02-04 14:12:32 +0000 nano version commit c7673566b0a789d5717ada3b282658fc57bcbff6 Author: Simon McVittie Date: 2014-02-04 13:43:33 +0000 maintainer-prepare-release: do "git tag" in srcdir commit b6df2edf754dd0b5ce6971e10140b44df9e730e1 Author: Simon McVittie Date: 2014-02-04 13:42:21 +0000 0.23.1 commit 58557fc633c44c261d5e1a8c85438fa12bdf72e6 Author: Simon McVittie Date: 2014-01-30 20:04:08 +0000 TpProtocol: fix some suspicious memory management It works fine as long as a preallocated GArray doesn't move its memory buffer for no reason, but it's good to be obviously correct. Spotted while working on the previous commit. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes commit bdba6fdf7804c050197db70d5840ae0f96cfe4be Author: Simon McVittie Date: 2014-02-04 12:51:58 +0000 tp_connection_manager_param_dup_variant_type: add In order for this to work, TpProtocol now ignores parameters whose D-Bus signatures are not a syntactically valid single complete type. This is helpful for Mission Control to be able to migrate parameters from untyped to typed storage - it stores parameters in terms of GVariant. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71093 Reviewed-by: Guillaume Desmottes [added (transfer full) as requested in review -smcv] commit 64e9a2cfc53c6786e0a1005f244fa7a8e635d8c7 Merge: 640e19a07 bba70fce0 Author: Simon McVittie Date: 2014-01-29 12:58:38 +0000 Merge branch 'telepathy-glib-0.22' Conflicts: NEWS configure.ac commit bba70fce033c7b5fcc120fcfce715ec79ca1361a Author: Simon McVittie Date: 2014-01-29 12:55:48 +0000 nano version commit 24a16df2d64fdad5b9c3ab678eeb38af1d461b9c Author: Simon McVittie Date: 2014-01-29 12:14:16 +0000 release 0.22.1 commit ee177171a7f6995cba2a63f4471d5be92ea5d9a3 Author: Simon McVittie Date: 2014-01-29 11:33:32 +0000 more NEWS for 0.22 commit 57a4680a76134a628d505c8326545ee5f9066f3f Author: Simon McVittie Date: 2013-11-12 12:44:35 +0000 examples: explicitly ask for TelepathyGLib-0.12 TelepathyGLib-1 isn't going to be fully compatible. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49737 Reviewed-by: Guillaume Desmottes commit 4b17ed73b7ac11e7f971f31a36e0367493b9d639 Author: Simon McVittie Date: 2014-01-29 11:21:52 +0000 NEWS for 0.22 commit 640e19a07a39756a8c3b5b68595589679403cc43 Author: Simon McVittie Date: 2014-01-29 11:19:36 +0000 add another bug number Please mention bug numbers in your commits, particularly if they're for stable. commit 6649f07748ebbe9023dde13328e5a9e7dc4abd7c Author: Simon McVittie Date: 2014-01-28 13:30:51 +0000 NEWS commit 3ba76d05699f6c20ff741c14fe95c1fd3f9a7fd1 Author: Xavier Claessens Date: 2014-01-24 15:07:28 -0500 AccountRequest: fix doc typo commit d96df54afb4ba104165359d32f52054ab95a3f04 Merge: e1d4f5439 77173033e Author: Guillaume Desmottes Date: 2014-01-20 14:46:17 +0100 Merge branch 'telepathy-glib-0.22' commit 77173033efaa7c33d1badf446133c701e2ae890f Author: Guillaume Desmottes Date: 2014-01-17 16:28:58 +0100 base-client: fix TpConnection leak commit e1d4f5439e851a8ac4585e021778c13cb1d122ed Author: Simon McVittie Date: 2013-11-12 12:44:35 +0000 examples: explicitly ask for TelepathyGLib-0.12 TelepathyGLib-1 isn't going to be fully compatible. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49737 Reviewed-by: Guillaume Desmottes commit 91c7de4f553c17118bb2d731f085ea18f05f3e84 Author: Simon McVittie Date: 2013-08-20 20:36:46 +0100 TpConnectionManager: add more debug for tp_list_connection_managers() Based on a patch by Guillaume Desmottes. Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68390 commit bfef0a5bc50485ff39ab1cc9e329aee71271aa91 Author: Simon McVittie Date: 2013-11-11 17:20:08 +0000 Enable GLib 2.36 deprecation warnings Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit e3d4c2977fbf086e7d42c77e3713e1bcddda2a9c Author: Simon McVittie Date: 2013-11-11 17:19:59 +0000 Stop calling g_type_init() It was deprecated in GLib 2.36, and we already have a hard dependency on that version. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 4480d2b9f5bb72c8acf0e9f712c6f8346a174f91 Author: Xavier Claessens Date: 2013-12-04 14:09:18 -0500 TpFileTransferChannel: Fix possible crashes. tp_file_transfer_channel_accept_file_async() and tp_file_transfer_channel_provide_file_async() operations are supposed to complete as soon as the CM returns from AcceptFile or ProvideFile. That means that we cannot call operation_failed() for streaming errors. We also have to keep a ref on self while streaming the file to avoid a crash in the callback when we dereference self. This means that the client app cannot cancel the ongoing streaming by unreffing the channel, replying on dispose calling g_cancellable_cancel(). It can still be doing using g_object_run_dispose() though. To make it cleaner we should probably add tp_file_transfer_channel_cancel(). The spec does not provide any way for the streaming client to inform the CM and other clients about the error occured while streaming. TpFileTransferChannel API does not even have a way to propagate that error to the user. commit 441fed1e0828b8fc6b94bd5f66c7cb222d09ef20 Merge: 831330683 1b28e0ca4 Author: Xavier Claessens Date: 2013-11-26 09:00:59 -0500 Merge branch 'telepathy-glib-0.22' commit 1b28e0ca43acec40f708d480e2824743561c5b97 Merge: d4388c7c1 3c1c43cc2 Author: Xavier Claessens Date: 2013-11-26 09:00:43 -0500 Merge branch 'telepathy-glib-0.20' into telepathy-glib-0.22 commit 3c1c43cc2a13df3d5f56e20d49c7bd136486b372 Author: Xavier Claessens Date: 2013-11-25 14:56:01 -0500 TpBaseConnectionManager: Fix critical printed each time a new connection is made glib 2.39.0 started to print a g_critical() message when calling g_source_remove() on a source that does not exist anymore. commit 8313306834c7f294596820919a5ed52197a574be Author: Xavier Claessens Date: 2013-10-28 14:59:57 -0400 Tests: use g_test_dbus_unset() Also link to https://bugzilla.gnome.org/show_bug.cgi?id=697348 to explain why we still have to unset STARTER env variables. commit 1aa78d2cf4d9b44c15c5b627eef210943646e3fb Author: Simon McVittie Date: 2013-10-28 16:56:38 +0000 TpProtocol: improve debug Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit d01acacceaef93160af478f8534e00d264baba03 Author: Simon McVittie Date: 2013-10-30 12:49:44 +0000 TpProtocol: add API for presence statuses Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 043d6101a4c8ad46e496fd463318979b2674ac68 Author: Simon McVittie Date: 2013-10-28 16:57:05 +0000 TpProtocol: parse status specs from .manager files Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit df8c7546c913398d072c76d5aaf9fc4a00a93b4f Author: Simon McVittie Date: 2013-10-28 14:13:30 +0000 Emit a new TpProtocol's immutable properties as debug messages Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit c73bd6a29e23bdc7afa8a26be0fd6ade0065c03a Author: Simon McVittie Date: 2013-10-28 14:54:53 +0000 TpPresenceStatusSpec: be a boxed type Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 712b3b082f740d1be16b7c74ad7a457aa91947c6 Author: Simon McVittie Date: 2013-10-28 14:53:04 +0000 TpPresenceStatusSpec: add some accessors Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit a7cff4b6a4801259ab9190a29f99a185b10e0962 Author: Simon McVittie Date: 2013-10-28 14:52:24 +0000 TpPresenceMixin: fix indentation Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit ccd7aed489d5e3263f0fa4c2f0af4141057aa7dd Author: Simon McVittie Date: 2013-10-28 14:51:55 +0000 TpPresenceMixin: deprecate optional arguments other than "message" Our D-Bus API no longer supports anything else. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 1c491dae9d8f6a90b4d1398dfc8914d8f4ff20a7 Author: Simon McVittie Date: 2013-10-28 13:27:03 +0000 TpProtocol: add high-level API for the Addressing interface Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit a48cf1a835d94ea6220d67883eca4071e686a4a7 Author: Simon McVittie Date: 2013-10-28 13:17:22 +0000 tp_protocol_identify_account_async: add and test To make the test a little more interesting and a little more realistic, we normalize the 'account' parameter to lower-case. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 689c4297ff8cd7cf971ba4bf46ad605a3149f6b4 Author: Simon McVittie Date: 2013-10-28 13:02:13 +0000 tp_protocol_normalize_contact_async: add and test Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 9cdd0c501a3c3d919468652f1ed3fad0202cb910 Author: Simon McVittie Date: 2013-10-30 12:01:38 +0000 Require GLib 2.36, for GTask Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit a47643a8ca7abf496aeb0c4f936aa995cf8f9ffc Author: Simon McVittie Date: 2013-10-30 11:59:22 +0000 _tp_protocol_parse_rcc: produce debug output Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 5db97e2ccc40795502202f404fc5a0c4cab0cb5f Author: Simon McVittie Date: 2013-10-28 12:53:10 +0000 TpProtocol: parse_default_value: take raw value as a parameter We previously passed the value when parsed as a string, but that makes very little sense. The raw value is at least used for something by the function itself, and it's better for debug messages too. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 45d958eeff097e1df862cbbbb760bf5831201642 Author: Simon McVittie Date: 2013-10-22 19:11:53 +0100 inspect-cm.py: on errors, exit rather than blocking forever Bug: https://bugs.freedesktop.org/show_bug.cgi?id=71048 Reviewed-by: Guillaume Desmottes commit 7ffbde3f23170ccc219ca969052efaf9c9a535bf Author: Simon McVittie Date: 2013-10-21 16:50:53 +0100 codegen: factor out copy_into_gvalue I needed this for TpExportable (which is still work in progress), but it's already a small code reduction. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59024 Reviewed-by: Guillaume Desmottes commit 07e7c3d2768fe85eb2815aa93d695291565f931e Author: Guillaume Desmottes Date: 2013-10-28 15:15:27 +0100 nano version commit 23949e9d81b968d8c0b9bcbb21c949cf246c22f7 Author: Guillaume Desmottes Date: 2013-10-28 15:05:52 +0100 util.h: define tp_value_array_free if version is at least 0.24 commit c20140663f240a922dc882d90d8d9a30818c9747 Author: Guillaume Desmottes Date: 2013-10-28 14:52:06 +0100 util.h: remove comment triggering the UNRELEASED check Having 'UNRELEASED' in a source file makes the release checker unhappy. commit bd8cf9856f1a95ef971d4d5f5b0b051baa2eee8d Author: Guillaume Desmottes Date: 2013-10-28 14:40:45 +0100 fix spurious.service EXTRA_DIST path commit a819c09df6e9123b0bc5213f9ea99e1e9df61500 Author: Guillaume Desmottes Date: 2013-10-28 14:40:29 +0100 util.h: replace _TP_AVAILABLE_IN_UNRELEASED commit 587b16ca92e5342a8685a2b391a84afc8977c458 Author: Guillaume Desmottes Date: 2013-10-28 14:39:56 +0100 define _TP_AVAILABLE_IN_0_24 _TP_DEPRECATED_IN_0_24 was already defined but not this one. commit 60cd45c04371390abe58bab9d8917704057cca9e Author: Guillaume Desmottes Date: 2013-10-28 13:00:16 +0100 0.23.0 commit 0615514fb03e88497e4f0a2e19418da2632294ff Author: Simon McVittie Date: 2013-10-16 15:33:07 +0100 README: no API guarantees on development branches commit ed4a1251f52abc801a4cbad5f9f464f51819a78b Author: Simon McVittie Date: 2013-10-15 13:22:19 +0100 Generate code for newly-stable interfaces commit 4868017daf708049102ee33618a615f96f4adbc6 Author: Guillaume Desmottes Date: 2013-10-28 12:05:36 +0100 spec 0.27.3 commit c38e41c0ae63ca6082381981bb7c71a14a7e8f94 Merge: 79acc094f d4388c7c1 Author: Guillaume Desmottes Date: 2013-10-24 14:54:32 +0200 Merge branch 'telepathy-glib-0.22' commit d4388c7c1fedb1e91b99075cd6b15b5cf573a302 Author: Guillaume Desmottes Date: 2013-10-24 14:38:45 +0200 channel-group: don't crash if no message has been provided commit 79acc094fb8d0136641022ae7e19e401e7aec8e5 Author: Guillaume Desmottes Date: 2013-10-23 14:55:10 +0200 add TpAccount::avatar-changed signal Fix https://bugs.freedesktop.org/show_bug.cgi?id=52938 commit 159b18dd5af2f618a5f5571fed870e65ccf110d9 Author: Guillaume Desmottes Date: 2013-10-23 12:44:35 +0200 simple-account: claim that we support Avatar commit dd8c765c0dbc080e408cadaf1de1cccafd938948 Author: Guillaume Desmottes Date: 2013-10-23 11:12:35 +0200 simple-account: add test API to change the avatar commit 69be1c1cc0a328905a7df44f44f3e56d213db5af Author: Simon McVittie Date: 2013-10-02 16:49:48 +0100 Put Autoconf, Automake, Libtool droppings in /build-aux Equivalent to MC commit c3cba93. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70045 Reviewed-by: Guillaume Desmottes commit 8fb03e86047fb5527da95288e3363f89a1115553 Author: Simon McVittie Date: 2013-10-02 16:48:43 +0100 Use subdir-objects (compile a/b.c to a/b.lo, not ./b.lo) Automake 2 will make this the default, and 1.14 warns about not using it. Equivalent to MC commit 1f11065. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70045 Reviewed-by: Guillaume Desmottes commit e4de996122b9559d03fabe2f3d3a1b51d29ffecc Author: Simon McVittie Date: 2013-10-02 16:47:19 +0100 Use MKDIR_P instead of deprecated mkdir_p In theory, AC_PROG_MKDIR_P only sets MKDIR_P, although for now it also sets the deprecated mkdir_p for compatibility with AM_PROG_MKDIR_P. Similar to MC commit 04dd9b4. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70045 Reviewed-by: Guillaume Desmottes commit 7b6e496317a332b81fb079256f7995cf082b5c57 Merge: e7b9ae33a 96cfbd0e8 Author: Simon McVittie Date: 2013-10-02 16:44:31 +0100 Merge branch 'telepathy-glib-0.22' Conflicts: NEWS configure.ac commit 96cfbd0e8401ab06b729cfa5b092d5939899dc6b Author: Simon McVittie Date: 2013-10-02 15:02:31 +0100 nano version commit e7b9ae33a0075541aa2f2376c2254ea0282920d7 Author: Simon McVittie Date: 2013-10-01 17:09:02 +0100 TpContact: improve debug info for GetContactAttributes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70010 Reviewed-by: Guillaume Desmottes commit 2ab17fc417761a6595abf02bd3fd6afd10a7853c Author: Simon McVittie Date: 2013-10-01 17:08:35 +0100 contact_avatar_retrieved: improve debug Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70010 Reviewed-by: Guillaume Desmottes commit 8912df6d612320dcb2ffda4fb43e995ef08aed9a Author: Simon McVittie Date: 2013-10-01 16:25:49 +0100 tp_contact_set_attributes: don't warn on genuinely absent interfaces The warning message says something like "... supposedly implements Contacts and Aliasing" but we don't actually check that the connection claims to implement Aliasing (in either its ContactAttributeInterfaces or Interfaces). SimplePresence has the same bug. The Mission Control regression tests trigger this, since they include some simulated connections with small subsets of interfaces. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68149 Reviewed-by: Guillaume Desmottes commit 0f5f605ab1217e008174f80ab4518e8464f3bc94 Merge: 8e83a1cbe fcfa0973c Author: Simon McVittie Date: 2013-10-02 14:52:58 +0100 Merge branch 'telepathy-glib-0.22' (early part) into HEAD commit ab5cef9789cb51cccd44aacbed80494a9379831e Author: Simon McVittie Date: 2013-10-02 14:31:44 +0100 0.22.0 commit fcfa0973c74c9d03020b6ea8c42a0362ccff791e Author: Simon McVittie Date: 2013-10-01 17:08:00 +0100 TpContact: avoid a race condition in avatar handling We have to remember the avatar token synchronously, before we start async-saving the cached file, so that we can't get into this situation: my avatar is token "A", bytes "AAAA..." my avatar changes to token "B", bytes "BBBB..." we start saving the file /.../B my avatar changes to token "C", bytes "CCCC..." saving the file /.../B finishes change-notification announces that my avatar has changed to "B" which is particularly problematic for Mission Control. Regression in 0.21.2 (fd.o #63402). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=70010 Reviewed-by: Guillaume Desmottes commit 8e83a1cbeccea3adb0102f196d2a9f6f3362a2f1 Author: Guillaume Desmottes Date: 2013-09-27 15:16:10 +0200 deprecate tp_account(_manager)_is_prepared for 0.24 commit f36f3a56ede1eb4350324b13250a449c4d847566 Author: Guillaume Desmottes Date: 2013-09-27 15:15:52 +0200 define _TP_DEPRECATED_IN_0_24(_FOR) commit 3f5dffa86e4890c8440eb7a0e3d328bdacf70fdc Author: Guillaume Desmottes Date: 2013-09-27 15:11:35 +0200 deprecate tp_account_manager_is_prepared() We removed it in 1.0 commit 0bce763db1a3237e6ff216daca3244585f69811e Author: Guillaume Desmottes Date: 2013-09-27 15:11:23 +0200 stop using tp_account_manager_is_prepared() commit 419de7023bc42c1c5fa7cab3a9bea7e62869d671 Author: Guillaume Desmottes Date: 2013-09-27 15:08:04 +0200 deprecate tp_account_is_prepared() It's obsolete since a while and we removed it in 1.0. commit 523dca7d96d328a92c940be5cb4550e8d72cef6d Author: Guillaume Desmottes Date: 2013-09-27 15:07:50 +0200 stop using tp_account_is_prepared() commit a02af787eab20a08a678a215c917b022c2ee6f8f Merge: 31d338bb4 05c0077c2 Author: Simon McVittie Date: 2013-09-26 16:32:42 +0100 Merge branch 'telepathy-glib-0.22' commit 05c0077c29a05d375ef543bc329ced29cb0259f2 Merge: b5c43a86d a21109040 Author: Simon McVittie Date: 2013-09-26 16:32:32 +0100 Merge branch 'telepathy-glib-0.20' into telepathy-glib-0.22 Conflicts: NEWS commit a211090400176d2d433f69a2e38f9c1356a3abda Author: Simon McVittie Date: 2013-09-26 16:32:06 +0100 NEWS for 0.20.x commit bf13f5c477d4963e6231feefde58099e72cfb4f5 Author: Simon McVittie Date: 2013-09-26 14:22:25 +0100 Account: don't crash if a CM returns a non-(ays) Avatar Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit 31d338bb47e46ee52347cc30622f57fbe72405ba Author: Simon McVittie Date: 2013-09-26 15:27:43 +0100 Bump GLib deprecation-cleanness to 2.34 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit 64d0037d0a2692d692b2b4f0a7a28d01fbfc5bf8 Author: Simon McVittie Date: 2013-09-26 14:38:02 +0100 Suppress remaining GValueArray deprecation warnings Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit b29452b531d9edadeb5558697c58c35ecf2f44c2 Author: Simon McVittie Date: 2013-09-26 14:37:41 +0100 Use tp_value_array_free instead of g_value_array_free Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit b8b0af6611ffabc84ad992697e2ae6c87e3483d8 Author: Simon McVittie Date: 2013-09-26 15:05:04 +0100 tp_value_array_free: add This lets connection managers and other Telepathy modules free the result of tp_value_array_build() without deprecation warnings. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit aa407653e274480ae63b21017869e07de3a1aa4e Author: Simon McVittie Date: 2013-09-26 14:28:40 +0100 Make more use of tp_value_array_unpack, tp_value_array_build As well as being less code, they're not flagged as deprecated. This requires a bit of extra copying, because there's no tp_value_array_unpack_dup() or tp_value_array_build_take(), but it seems worth it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit e6ac4848a0e613087b024af9f4c21fec3ee509ef Author: Simon McVittie Date: 2013-09-26 14:23:21 +0100 glib-client-gen.py: ignore GValueArray deprecation warnings Yes we know we have GValueArrays. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit e574b30a5e0b884838a6b04526528490dfc5ce91 Author: Simon McVittie Date: 2013-09-26 14:22:25 +0100 Account: don't crash if a CM returns a non-(ays) Avatar Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69849 Reviewed-by: Xavier Claessens commit 03e2bb3d09b527c9144c3186d2f0f9aa7113aac9 Author: Simon McVittie Date: 2013-09-26 15:34:14 +0100 0.24 branch commit 5765148158effd59f99976b5d6c59d08a3117ac7 Merge: dea8df907 b5c43a86d Author: Simon McVittie Date: 2013-09-26 15:26:12 +0100 Merge branch 'telepathy-glib-0.22', rejecting the changes commit b5c43a86d5d4301a8876db293472b6217ef9a016 Author: Simon McVittie Date: 2013-09-26 15:26:04 +0100 Upload documentation to the 0.22.x location commit cccddc75ed3dfcc74b5aac920c652f49d656f171 Author: Simon McVittie Date: 2012-10-03 09:49:33 +0100 Don't check documentation completeness in this stable branch commit 5e6b1349960e4983afca1630084daac94a544db8 Author: Simon McVittie Date: 2010-04-06 12:33:21 +0100 Disable warnings about deprecated functions for stable branch Since this is a stable branch, we're unlikely to fix uses of deprecated functions, so we shouldn't warn about them. commit 267bbbb6fe16b5d0e30f1dc446d93d9f833bc918 Author: Simon McVittie Date: 2013-09-24 14:03:06 +0100 TpConnection: don't crash if a broken CM has no Groups property Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54500 commit dea8df907dfd435809706f54e2ad39db86576a93 Author: Guillaume Desmottes Date: 2013-09-26 15:55:09 +0200 simple-account: set 'parameters' as writable Some logger tests relies on this. commit bfb21c309bcae17f74a27ac9435b4cbbdf1be767 Author: Xavier Claessens Date: 2012-04-11 16:31:56 +0200 Port unit tests to g_test_dbus_up/down https://bugs.freedesktop.org/show_bug.cgi?id=55761 commit d6c2580681fa9e84b6375331babef7f4e3962875 Author: Xavier Claessens Date: 2013-09-25 12:53:14 -0400 Tests: disable single include This will make tests rebuild more often, but makes life easier to other projects who copy/paste our test utilities (e.g. folks) commit ed6a2b37a5252d603b0ea45bba1940ed5b6f255e Author: Xavier Claessens Date: 2013-09-25 12:52:47 -0400 Add text-mixin.h in telepathy-glib.h commit 53d1e1aa87a73db22ffe1e2ffe22b9201b79de41 Author: Simon McVittie Date: 2013-09-24 17:21:44 +0100 nano version commit 25075cfb9b516b2a00e549d10a24a7863f3cf6d2 Author: Simon McVittie Date: 2013-09-24 15:47:27 +0100 0.21.2, second try commit 87f0171800e33938012457f3c38fbd9cf70ae03c Author: Simon McVittie Date: 2013-09-24 15:45:25 +0100 Revert "Copy contact-list.c into the ${builddir} so the XInclude in the docs works" This reverts commit ff26814b44720336cdcb298ddf45aea2edcfae0a. It has a race condition which *sometimes* breaks distcheck :-( commit ff26814b44720336cdcb298ddf45aea2edcfae0a Author: Simon McVittie Date: 2013-09-24 14:42:15 +0100 Copy contact-list.c into the ${builddir} so the XInclude in the docs works This fixes the long-standing bug that if telepathy-glib was built out-of-tree, the documentation had "FIXME: MISSING XINCLUDE CONTENT" instead of the example. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69753 commit fe4885a66bb1edba8521329674af6765fa785e77 Author: Simon McVittie Date: 2013-09-24 14:03:06 +0100 TpConnection: don't crash if a broken CM has no Groups property Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54500 Reviewed-by: Guillaume Desmottes commit c0fa33df2a7af1888e487676f6b03f4bf445b299 Author: Simon McVittie Date: 2013-08-21 15:14:11 +0100 inspect-cm example: allow inspecting all CMs Also print a bit more information about protocols, and allow requesting timestamps in debug output. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68390 Reviewed-by: Guillaume Desmottes commit b0a00c67c61b6b8287aee480d9f5aaa94d0f4979 Author: Simon McVittie Date: 2013-08-20 13:48:58 +0100 TpConnectionManager, TpProtocol: improve debug output Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68390 Reviewed-by: Guillaume Desmottes commit 3aaacd5566e2edc602870f86e89a3961aff6363c Author: Simon McVittie Date: 2013-09-24 14:19:15 +0100 Revert "0.21.2" while we make the release work This reverts commit 04dd20c2968223029d1310c9fdedbe86592dcaf4. commit 0b67409d65822f37195f50cfbaa11f95b40791c7 Author: Guillaume Desmottes Date: 2013-09-24 15:18:19 +0200 Revert "Copy contact-list.c into the ${builddir} so the XInclude in the docs works" This reverts commit ca33bfa878946a1ad904e0dcd88455e989223707. commit fe25459d20d0d0f2e908c5527b2b01f302f59ac1 Author: Guillaume Desmottes Date: 2013-09-24 15:04:59 +0200 add ABI file for 0.21.2 commit 47f02f028d33f84cf0af63755d49f9c45230c470 Author: Guillaume Desmottes Date: 2013-09-24 15:02:26 +0200 update UNRELEASED commit 04dd20c2968223029d1310c9fdedbe86592dcaf4 Author: Guillaume Desmottes Date: 2013-09-24 12:51:05 +0200 0.21.2 commit 01c89d0e02cb1233403c42cafc979567e93e8142 Author: Guillaume Desmottes Date: 2013-09-24 12:58:27 +0200 spec 0.27.2 commit 6924c0d1262102e18ccd7c006c35deb746fe95bf Author: Simon McVittie Date: 2013-09-24 13:52:59 +0100 NEWS commit ca33bfa878946a1ad904e0dcd88455e989223707 Author: Simon McVittie Date: 2013-09-24 13:05:20 +0100 Copy contact-list.c into the ${builddir} so the XInclude in the docs works This fixes the long-standing bug that if telepathy-glib was built out-of-tree, the documentation had "FIXME: MISSING XINCLUDE CONTENT" instead of the example. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69753 Reviewed-by: Guillaume Desmottes commit 8685a6d9368307046b3d21099ed2d33770a84ece Author: Simon McVittie Date: 2013-09-24 13:03:10 +0100 Make avatar image caching asynchronous Based on patches by Luca Versari and Chandni Verma. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63402 Reviewed-by: Guillaume Desmottes commit 7ba46141a7bfd7469ed1dba1d2938b2b62a10f85 Author: Xavier Claessens Date: 2013-09-20 15:51:27 -0400 TpBaseConnection: Implement SelfID and SelfContactChanged commit 35f5131ef8ce3660ca57854142e2c9a77cb7382c Author: Guillaume Desmottes Date: 2013-09-18 12:59:41 +0200 base-protocol: add Presence.Statuses as immutable properties https://bugs.freedesktop.org/show_bug.cgi?id=69520 commit 246e201a0ffcce7648b5cd3818ad889647b79ba5 Author: Simon McVittie Date: 2013-09-12 18:52:34 +0100 cm test: test "drop name on get" on a modern CM We were only testing this case on the archaic CM, but that's undesirable when converting to Telepathy 1.0, since a CM with no D-Bus properties will cease to be a valid CM. The diff is a little confusing because I'm basically turning test_dbus_fallback() and its fork test_dbus_ready() back into the same function. The merged version does everything that either of its precursors did. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69283 Reviewed-by: Guillaume Desmottes commit 8caae1a2a176ee27ba627efbbe4f5a7db659ad91 Author: Simon McVittie Date: 2013-09-12 18:49:28 +0100 tp_dbus_properties_mixin_dup_all: make public There's no real reason not to - anything that implements D-Bus properties is clearly going to have this method in some form. Also, my next commit needs it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69283 Reviewed-by: Guillaume Desmottes commit fa5c747f4ca64c819ff7b0c35e81861fa41666c2 Author: Simon McVittie Date: 2013-05-28 09:56:49 +0100 Pass on all AM_CPPFLAGS and CPPFLAGS to g-ir-scanner Failure to do so causes a false-positive in Debian's build log checks, which check that "hardening" flags are passed to all compilations. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65293 Reviewed-by: Guillaume Desmottes commit 79beda6266d5730d2c88cd31edd52d729f2cd27d Author: Simon McVittie Date: 2013-08-20 20:44:12 +0100 Regression tests: also avoid tmpnam() here This is a bit simpler than in production code, because we can just abort on errors that "should never happen". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68350 Reviewed-by: Guillaume Desmottes commit f4076dffc10600006dd6415c3584f97bd36907a6 Author: Simon McVittie Date: 2013-08-20 20:42:10 +0100 _tp_create_temp_unix_socket: avoid using tmpnam() On current Debian unstable, gcc/ld issues a warning about tmpnam(), because it's usually used in an unsafe way. "gcc -Wl,--fatal-warnings" (which I'm using in my development environment) upgrades that to fatal. Our usage was in fact safe (trying to listen on a socket always behaves like O_EXCL|O_CREAT, which can DoS'd but is not subject to symlink attacks), but we're swimming against the current by trying to use tmpnam(). Instead, create a secure private temporary directory with g_dir_make_tmp(), and put our socket in there. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68350 Reviewed-by: Guillaume Desmottes commit 21b395c356549d821b30253f6ec5be8dbd15e333 Author: Simon McVittie Date: 2013-09-06 12:20:30 +0100 C text handler: comment why the subclass / feature-prep works Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 15eda6a121a36c19787255ada71f7b8e0e6ed762 Author: Simon McVittie Date: 2013-09-06 12:20:06 +0100 Python text handler: ensure that we get a Tp.AutomaticClientFactory We want a Tp.TextChannel, not just a Tp.Channel, and the easiest way to do that is to use Tp.AccountManager.dup() (which provides a Tp.AutomaticClientFactory). Tp.SimpleHandler.new() is deprecated, for approximately this reason. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit de7e9b604dd50cb9fcadf3b226d049a9f3cf7ce3 Author: Simon McVittie Date: 2013-09-06 12:18:36 +0100 extended-client: comment that we're going behind MC's back Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit a44973d2298609dcef7d0cb482f230492524cc69 Author: Simon McVittie Date: 2013-09-06 12:06:33 +0100 TpSimpleClientFactory: drop doc-comments for private functions Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 844041a378c457974e2b464b6081bc75f7ef23c2 Author: Simon McVittie Date: 2013-09-06 12:03:39 +0100 TpSimpleClientFactory: document "connection must be ours" tp_simple_client_factory_ensure_channel and tp_simple_client_factory_ensure_contact already enforced that via a check, but didn't document it. tp_simple_client_factory_upgrade_contacts_async didn't previously either document or enforce it, and strictly speaking there's no reason why it shouldn't work, so I'm using a warning instead of a critical-and-return - but it probably indicates an error, so I think it should warn. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 0ed8a3af94781475354aec323a8e225787f07a48 Author: Simon McVittie Date: 2013-09-06 12:01:51 +0100 TpConnection: don't recommend that applications call Connect() For most applications, the rule is "the account manager does that". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 02db7af6e60a69d4e23f3e0c187967cbc5a459bd Author: Simon McVittie Date: 2013-09-06 12:01:18 +0100 TpConnection: describe factory behaviour Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit a8d4b650dc5e91f9e51ecedffa3a6eaaf983b822 Author: Simon McVittie Date: 2013-09-06 12:01:02 +0100 TpCDO, TpChannelRequest: always has a factory Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 3c4b4af98aeefd5956a76a89b4ceb3055233104f Author: Simon McVittie Date: 2013-09-06 12:00:42 +0100 TpCDO, TpChannelRequest: mention that they should come from "larger" objects Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 511b9f90484d1e05731ecd9587c67bd78bfc47d5 Author: Simon McVittie Date: 2013-09-06 12:00:12 +0100 TpSimpleClientFactory: suggest getting objects from "larger" objects Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 6758095e3ef770773808aaf951b28ac688958d59 Author: Simon McVittie Date: 2013-09-06 11:58:53 +0100 TpConnection: connections should come from accounts Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 8f41ddb26198eb6bee7f9019a3955c1623519d28 Author: Simon McVittie Date: 2013-09-06 11:46:03 +0100 TpConnection: remove woefully outdated feature list TpConnection does much, much more than a simple D-Bus proxy now. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 9f657accda96afcec4da64b6849fb87eb6f21cc0 Author: Simon McVittie Date: 2013-09-06 11:45:22 +0100 TpChannelDispatchOperation, TpChannelRequest: remove boilerplate This text made sense before we implemented more stuff, but is obsolete now. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 2b51b0772dbc716a50e8df0f84d3c51640834e55 Author: Simon McVittie Date: 2013-09-06 11:43:59 +0100 TpAccount: document interaction with factories a bit better Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 7251b59dd4d06e55574f7a68404200253e2e2491 Author: Simon McVittie Date: 2013-09-06 11:43:22 +0100 TpAccountManager: tighten up guarantees about factories It always has a factory, and if none is specified at construction, the default is to use a TpAutomaticClientFactory. If we document that, then client code won't need to mess about with tp_account_manager_set_default() unless it has special requirements, namely: either it has a factory of its own with more features and/or subclasses, or a TpSimpleClientFactory is sufficient and low-overhead is important. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 6f7e04e835f5733ba77453d5e14cb48217a45f7f Author: Simon McVittie Date: 2013-09-06 11:39:09 +0100 TpAccountManager: fix documentation of how many accounts are prepared The documentation had fewer guarantees than the implementation: since 0.16, we've delayed notification of new accounts until they're prepared. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 4717963eb9095a27495ac2f5c1d74174a81c3ac4 Author: Simon McVittie Date: 2013-09-06 13:16:02 +0100 tube examples: use g_message(), not g_debug() g_debug() is invisible unless you set G_MESSAGES_DEBUG, which is unhelpful when smoke-testing example code. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit c5ef21c08359eb9cc7e03d2ae8ec852e717deac7 Author: Simon McVittie Date: 2013-09-06 13:14:29 +0100 tube offering examples: don't dump core on invalid arguments Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit c4ac0a8300be1e5770c49feb57f977feaad4a58d Author: Simon McVittie Date: 2013-09-06 13:14:07 +0100 tube offerers: use an automatic client factory The TpSimpleClientFactory base class doesn't use channel-type-specific subclasses, which these examples rely on. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54061 Reviewed-by: Guillaume Desmottes commit 6adc3a97491b8aef64ac00a5efa5685fc5f2c6b7 Merge: 9efb9966e eefe5a1fc Author: Simon McVittie Date: 2013-09-04 14:04:58 +0100 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit eefe5a1fc22c4ac9911a2fc7f16299c454ecebea Author: Simon McVittie Date: 2013-09-04 14:03:01 +0100 NEWS for 0.20.x commit 883d8878ea635baffd869ab548a1c736404dd682 Author: Debarshi Ray Date: 2013-09-04 13:49:24 +0200 TpHeap: comparator results are not guaranteed to be -1, 0 and 1 A GCompareFunc might return any negative or positive value if the two values are not equal. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68932 Reviewed-by: Simon McVittie commit 9efb9966e3d7425d15ac1038584aadc8e81ac56c Author: Simon McVittie Date: 2013-08-20 21:03:10 +0100 more NEWS commit 69f749d936ea1f060f9465e41854efd8af4f39d7 Merge: 6c2ba1a53 2ebe4dff9 Author: Simon McVittie Date: 2013-08-20 21:02:46 +0100 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS configure.ac commit 2ebe4dff95aea5d9c6485f6fa3c64b86b2930a36 Author: Simon McVittie Date: 2013-08-20 20:51:43 +0100 nano version commit ea90d97e543b12a90db5b05958840045cc4f7a1d Author: Emilio Pozuelo Monfort Date: 2013-08-19 12:49:32 +0200 Fix documentation for tp_connection_get_self_handle Signed-off-by: Emilio Pozuelo Monfort Reviewed-by: Simon McVittie commit 6c2ba1a537ade5c26b7aa8d3b511c0ae8336c6e4 Author: Emilio Pozuelo Monfort Date: 2013-08-19 12:49:32 +0200 Fix documentation for tp_connection_get_self_handle Signed-off-by: Emilio Pozuelo Monfort Reviewed-by: Simon McVittie commit ff51b6a6a9f2ba28d3d919e60ef98c13ce0a77a0 Author: Simon McVittie Date: 2013-07-24 13:21:57 +0100 prepare 0.20.4 commit 60120429b3fd85170cefd72cb913e7014bb98644 Author: Simon McVittie Date: 2013-07-22 17:57:23 +0100 TpConnectionManager: retry introspection after CM exits, up to once Many connection managers automatically exit after 5 seconds of inactivity. If the CM has no .manager file *and* exits in this way while we are introspecting it, we would previously consider it to have failed introspection - but with sufficiently unfortunate timing, that can result in empathy-accounts not considering Haze to exist. To avoid this, without going into an infinite loop if the CM fails to introspect, retry once, but only once. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67183 Reviewed-by: Guillaume Desmottes commit 04d3e5f75d072af465219d571a443a8548df904f Author: Guillaume Desmottes Date: 2012-02-22 09:34:03 +0100 early return if GetContactInfo() failed https://bugs.freedesktop.org/show_bug.cgi?id=46430 commit ada77b717f5bcdf442dff3505db2dacf6c05b8d3 Author: Guillaume Desmottes Date: 2012-02-22 09:34:03 +0100 early return if GetContactInfo() failed https://bugs.freedesktop.org/show_bug.cgi?id=46430 commit 3df3c69fb8da8910affee42f66aa9f1e18ebe906 Author: Simon McVittie Date: 2013-06-20 17:06:04 +0100 nano version commit 3022deb9910fc7793cdf5a95f157effdb890ed6c Author: Simon McVittie Date: 2013-06-20 16:32:54 +0100 nano version commit 1a311e12cadf981d913d40aed4cd3d6b52d8a50e Author: Simon McVittie Date: 2013-06-20 16:06:08 +0100 Prepare 0.21.1 release commit 627c7217f21ec9b89e542983591ac54fca3c6281 Author: Simon McVittie Date: 2013-06-20 15:40:45 +0100 Prepare 0.20.3 commit 66733cb8347bbc541dadd87936127f9d73e479bf Merge: a45528703 a95947e2e Author: Simon McVittie Date: 2013-06-11 15:48:20 +0100 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit a95947e2e2ad6724c6b1e74910354fb0fa4897e1 Author: Simon McVittie Date: 2013-06-11 15:47:11 +0100 NEWS commit a4552870397dfad0f6f76e64e1f030845236cd98 Author: Simon McVittie Date: 2012-02-22 15:01:01 +0000 tp_call_stream_endpoint_get_state: return a TpStreamEndpointState on error TP_MEDIA_STREAM_STATE_DISCONNECTED is from another enum entirely, and will no longer exist in Telepathy 1.0. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65517 commit 050932ec56ad627380fce209eed9b26a593c3a00 Author: Simon McVittie Date: 2013-06-07 18:19:37 +0100 .gitignore: Automake 1.13 installs /test-driver Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65517 commit a9ea7a2170d5f0cd4a9aef4bb85655b5e4e181ee Author: Simon McVittie Date: 2013-06-07 17:14:11 +0100 Make tool tests executable rather than putting sh in TESTS_ENVIRONMENT This makes it possible to run the tool tests under the Automake 1.12+ parallel test harness, which is the default from 1.13 onwards. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65517 commit 9d5f9bfffd478e33a2785be6e6ea628079630ba4 Author: Simon McVittie Date: 2013-06-07 17:09:19 +0100 util-cxx: include config.h This avoids a deprecation warning for g_type_init(). Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65517 commit 0e944e7d41b38cb248a2164468d2fe064f61819d Author: Simon McVittie Date: 2013-06-07 17:08:53 +0100 Use AC_PROG_MKDIR_P instead of deprecated AM_PROG_MKDIR_P This means we define MKDIR_P instead of mkdir_p - adjust. Strictly speaking this requires Autoconf 2.59d, but 2.60 is hardly a new innovation (it was released in 2006). Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65517 commit 1fbfb30038dbdda78f79533138fec05a270ea485 Merge: 8e922eaeb ba0b31b42 Author: Simon McVittie Date: 2013-06-10 15:26:52 +0100 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit ba0b31b425d5871c4141ff0a7f477ec4e296e926 Author: Simon McVittie Date: 2013-06-10 15:14:45 +0100 NEWS for 0.20 commit 02b70ab2cffc399846fba5f94aff937963d170a4 Author: Guillaume Desmottes Date: 2013-03-12 11:11:02 +0100 tls-certificate: invalidate the proxy if CertificateChainData is missing We shouldn't assert if the CM is broken. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61616 Reviewed-by: Simon McVittie commit 8e922eaeba7b7875b01697c4c1bac2df7e8ac1b9 Merge: f85107b36 ccbcb74e3 Author: Simon McVittie Date: 2013-06-10 15:02:38 +0100 Merge branch 'telepathy-glib-0.20' commit ccbcb74e39d92ddc44fe2e86816ba8dfa7a27daa Author: Simon McVittie Date: 2013-01-03 11:40:46 +0000 contact-lists test: add a regression test for fd.o #52011 Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52011 Reviewed-by: Xavier Claessens commit 0b88229dc8439a37c69fc3e6544119201d7d4c48 Author: Simon McVittie Date: 2013-01-03 11:02:52 +0000 tp_base_contact_list_set_list_received: don't re-announce groups We already announced each group from tp_base_contact_list_groups_created a few lines ago; we don't need to do it again. Ideally we'd add each channel's members before announcing the channel itself, so that the channel is created "fully-formed"; but we've never actually done that, and keeping the first NewChannels instead of the second seems less likely to break applications. These channels are only for legacy code anyway: any modern client should be using the ContactGroups interface. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52011 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit f85107b368c2a4223623b7a50514c17fe4eac079 Author: Simon McVittie Date: 2013-06-07 17:49:58 +0100 Add a simple JavaScript debug-client which collects debug logs Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65518 Acked-by: Guillaume Desmottes commit 2acff880f5bcbd6a69baaad960ea3a029e34736e Merge: 60b2bbdce 65cfeebe2 Author: Simon McVittie Date: 2013-06-10 14:52:10 +0100 Merge branch 'telepathy-glib-0.20' commit 65cfeebe29bdd85fa7b72856ce93b900f7af1539 Author: Simon McVittie Date: 2013-06-10 14:49:31 +0100 NEWS for 0.20 commit b47a9af03b3154401cdd863f6b76c2393e2e7e39 Author: Simon McVittie Date: 2013-06-07 17:42:15 +0100 tp_debug_client_get_messages_finish: fix annotation Returning a GPtrArray with (transfer full) means the caller is expected to do the equivalent of: g_ptr_array_foreach (pa, (GFunc) g_free, NULL); g_ptr_array_unref (pa); whereas we just want them to unref it. This crashed my g-i-based debug-client. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65518 Reviewed-by: Guillaume Desmottes commit 60b2bbdce8ebe22152ac2078bb095a3eb0bef668 Merge: f58e406cf 8e6b3438e Author: Xavier Claessens Date: 2013-05-22 11:02:30 +0200 Merge branch 'telepathy-glib-0.20' commit 8e6b3438e6ec8f94ad83786ea60d183f23c2a8fe Author: Xavier Claessens Date: 2013-05-22 10:51:06 +0200 TpCallStream: Fix local-sending-state-changed signal signature. Fixes fdo#64837 commit f58e406cfffc1782ece080a17177271c098a1e0e Merge: 5d5c11908 5cb65fa97 Author: Will Thompson Date: 2013-04-14 11:55:14 +0100 Merge branch 'telepathy-glib-0.20' and update NEWS Conflicts: NEWS commit 5cb65fa971d4461b1f6fc6fd79a4f5b6fff3a8cc Author: Will Thompson Date: 2013-04-14 11:51:32 +0100 Update NEWS commit eb6aea91d8e88c573652a9f03709928969a64498 Author: Will Thompson Date: 2013-02-22 00:09:04 +0000 Always flag delivery reports with Non_Text_Content Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=61254 commit 66982e6c17691869aa17c00416d61674b5b3e34f Author: Will Thompson Date: 2013-01-23 11:34:20 +0000 Annotate tp_account_update_parameters_finish properly. kuuko discovered that unset_parameters is wrongly inferred to be a string argument, not a string array argument. At runtime, passing a string crashes. I think this is a bug in gobject-introspection but we can annotate it as an array to fix this particular function. commit 5d5c11908eb9b6e91455416d96e41a7a636c56e5 Merge: d3e062e6c 0b008a263 Author: Simon McVittie Date: 2013-04-04 15:59:26 +0100 Merge branch 'telepathy-glib-0.20' and update NEWS Conflicts: NEWS configure.ac commit 0b008a263cfe39d5fcb128d9076c22dfec8905a7 Author: Simon McVittie Date: 2013-04-04 15:50:34 +0100 NEWS for 0.20 (and add the release name) commit c768a891d6cd9012c3072b1a8307146e3d41be35 Author: Simon McVittie Date: 2013-04-04 14:28:58 +0100 with-session-bus.sh: clear DBUS_STARTER_* telepathy-glib prefers to use DBUS_BUS_STARTER, for the benefit of Telepathy components that are (or might be) service-activatable. The actual terminal part of gnome-terminal 3.8 is an activatable service, so when run from there, we pick up the real session bus' address via DBUS_STARTER_ADDRESS. We don't want that. (Yes, it's DBUS_STARTER_ADDRESS, not DBUS_STARTER_BUS_ADDRESS. The reference implementation and the D-Bus Specification both say so.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=63119 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit d3e062e6c771b611af9c35120a897117e8149825 Author: Xavier Claessens Date: 2013-04-03 13:04:38 +0200 bump nano version commit 31cb359ef8c1dc80f700c3fcc72d2578b0ffa0ba Author: Xavier Claessens Date: 2013-04-03 12:54:54 +0200 0.21.0 release commit b76abbb76f13fa4aef45c258994b26a51c584c96 Author: Xavier Claessens Date: 2013-04-03 12:47:28 +0200 bump nano version commit 0d60501986e382851570f3e927cde7842d4f5724 Author: Xavier Claessens Date: 2013-04-03 12:34:27 +0200 0.20.2 release commit bda340636d7fd33902e8016113e957dac2561a70 Author: Xavier Claessens Date: 2013-04-03 11:02:13 +0200 Fix test_utf8_make_valid() Older GLib explicitly disallowed non-characters (as this test assumes) but newer GLib follows Unicode Corrigendum 9 and allows them. https://bugzilla.gnome.org/show_bug.cgi?id=694669 commit 49cf6904ed3c5cee461d1ddcbaff73f4a10e3426 Author: Xavier Claessens Date: 2013-04-03 11:02:13 +0200 Fix test_utf8_make_valid() Older GLib explicitly disallowed non-characters (as this test assumes) but newer GLib follows Unicode Corrigendum 9 and allows them. https://bugzilla.gnome.org/show_bug.cgi?id=694669 commit aa640da529abdefc4cc459c3b61e035ad0ec6a71 Author: Xavier Claessens Date: 2013-03-29 19:45:23 +0100 Verify that TpConnection is not leaked in contacts unit tests This plugs various leaks in the tests as well. commit 29f3243d20a1a239f3c7f3bc28b7fce17763f2ee Author: Xavier Claessens Date: 2013-03-29 18:16:59 +0100 TpConnection: break refcycle when invalidated It is already explained in tp_connection_invalidated(), connection must drop its refs to all TpContact at that point. commit 86ac0ba97da73ed41f74c2d4b6708be1a1928404 Author: Xavier Claessens Date: 2013-03-29 18:16:39 +0100 TpConnection: self->priv->self_contact is leaked commit 484abc61967d4b18b8aa97f9fe5b15d6e9475920 Merge: a0f78fab8 c7dab2d3c Author: Simon McVittie Date: 2013-04-02 10:09:34 +0100 Merge branch 'telepathy-glib-0.20' commit c7dab2d3c6936443fb4aee43f54defa81b5dc592 Author: Maksim Melnikau Date: 2013-03-31 19:40:51 +0300 contact list C-example: fix iterating Signed-off-by: Maksim Melnikau Bug: https://bugs.freedesktop.org/show_bug.cgi?id=62968 Reviewed-by: Simon McVittie commit a0f78fab8b33eae3855f905b99c2b6f2228eef2b Author: Xavier Claessens Date: 2013-03-19 10:57:26 +0100 Replace more printf() with DEBUG() commit b105ec76bdc812cd83134618c216773466f18056 Author: Xavier Claessens Date: 2013-03-19 10:41:19 +0100 GroupMixin: Use DEBUG() instead of printf() commit 819310eaf22c882481ac72b44f07c6be9c7af3bf Merge: 81b4e43cd a33573ff2 Author: Guillaume Desmottes Date: 2013-03-12 16:40:22 +0100 Merge branch 'telepathy-glib-0.20' commit a33573ff2c48b9ec37bb6c36801be3b80871e62b Author: Guillaume Desmottes Date: 2013-03-12 16:25:43 +0100 start_file_transfer(): unset timer_id commit 81b4e43cd4a71dbd0cb71150ef6c7fcf3cbd77b1 Merge: e61dd1715 9ea571eca Author: Guillaume Desmottes Date: 2013-03-12 15:19:44 +0100 Merge branch 'telepathy-glib-0.20' commit 9ea571eca7d12648776c7179255711dbdd9aac25 Author: Guillaume Desmottes Date: 2013-03-12 15:14:48 +0100 file-transfer-chan: don't call start_file_transfer() after disposal commit 348e79afabca8a1f292ccf69e932d48553103a80 Author: Thomas Bechtold Date: 2013-02-09 21:50:04 +0100 Fix introspection annotations for GStrv types commit e61dd171562690e6ab0cc411e048f7f511856e6e Author: Thomas Bechtold Date: 2013-02-09 21:50:04 +0100 Fix introspection annotations for GStrv types commit 8198f852f26803285c14645b319c83d7e04e28d9 Author: Xavier Claessens Date: 2013-01-29 10:41:11 +0100 README: LD_LIBRARY_PATH needs to be set for running introspection examples commit 8608a306e80f3aec068c36c83e17f35c52df1381 Author: Simon McVittie Date: 2013-01-28 14:01:10 +0000 NEWS for master commit fc5fdd26527e77f5f84a08f4475cc9984ccd7533 Merge: 18dd2cc61 bb3d4a427 Author: Simon McVittie Date: 2013-01-28 13:52:17 +0000 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit bb3d4a427f8bd28a83896e499b64755534de02c5 Merge: 949324dbc 55f725396 Author: Simon McVittie Date: 2013-01-28 13:50:51 +0000 Merge branch 'telepathy-glib-0.18' into telepathy-glib-0.20 Conflicts: NEWS commit 55f7253966837f86aa68eb56ed8df534c6484ac6 Author: Simon McVittie Date: 2013-01-28 13:49:04 +0000 NEWS for 0.18 commit 63af5af2a0179d37292c3c68bf5c5be9f05de62b Author: Nuno Araujo Date: 2013-01-18 22:31:05 +0100 Fix the build with automake 1.13 In Automake 1.13, the long-deprecated macro AM_CONFIG_HEADER (deprecated since 2002) has been removed in favour of AC_CONFIG_HEADERS. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=59604 commit 18dd2cc616621f796bf1d1987e55b51eedca00b8 Author: Guillaume Desmottes Date: 2013-01-07 17:29:45 +0100 TpAccount: implement change notification on uri-schemes property commit 15b8eea5133e683ac14c79734dfbea6747af6e5f Author: Guillaume Desmottes Date: 2013-01-07 17:07:50 +0100 add TpAccount:uri-schemes: property The property was missing for some reason. commit 16578d4864f04d26c05c94dbd4c6035ba728d55c Author: Guillaume Desmottes Date: 2013-01-07 16:57:04 +0100 simple-account: add tp_tests_simple_account_add_uri_scheme() commit edd3e68fb24ffbeaf4b1073971bdecb0c4591a02 Merge: b3570e8e7 949324dbc Author: Will Thompson Date: 2013-01-09 10:00:56 +0000 Merge branch 'telepathy-glib-0.20' commit 949324dbc3515e2cebced4a1a410c725896f4a6e Author: Will Thompson Date: 2013-01-09 09:59:41 +0000 Fix mistaken references to tp_connection_get_contact_by_id_async tp_connection_get_contact_by_id_async does not exist; it is called tp_connection_dup_contact_by_id_async. commit b3570e8e77cb890c62744dc62859c49a6bebd8aa Author: Guillaume Desmottes Date: 2013-01-08 09:59:13 +0100 add missing config.h includes g_type_init() has been deprecated in GLib master. By including config.h we avoid the deprecation warning as it contains GLib's versions macros. commit 3c76b3c7833675bf04e28575805da874f07bee51 Merge: 08a0b1b34 12e8b2155 Author: Simon McVittie Date: 2013-01-07 13:03:09 +0000 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit 12e8b215512e99b8f11a2800b8f9842c59dd38d6 Merge: 308408b98 a0f0298c9 Author: Simon McVittie Date: 2013-01-07 11:55:28 +0000 Merge branch 'telepathy-glib-0.18' into telepathy-glib-0.20 Conflicts: NEWS commit a0f0298c9a2c6b69c7a1d6f6098fc20be4b82483 Author: Simon McVittie Date: 2013-01-07 11:53:50 +0000 Update NEWS for 0.18.x commit bc691e42d9e55ce6fe5030f898b8166b7e44d90b Author: Maksim Melnikau Date: 2013-01-06 02:01:00 +0300 fix segfault in got_contact_list_attributes_cb tp_simple_client_factory_ensure_contact returns NULL for protocols, if tp_connection_has_immortal_handles=0. Right now its happened for any telepathy-python based protocols (butterfly, sunsine, mixer). when tp_simple_client_factory_ensure_contact returns NULL, tp_simple_client_factory_ensure_contact just segfault in _tp_contact_set_attributes. lets assume that contact sometimes NULL here, and skip them Signed-off-by: Maksim Melnikau [edited for coding style, added a comment -smcv] Reviewed-by: Simon McVittie commit 08a0b1b3462a571a91d12ab63d3d5c17d9317c38 Author: Maksim Melnikau Date: 2013-01-06 02:03:36 +0300 del unused magic import in ft-handler.py example 1) it isn't used now 2) it is prevents run example on machines, which hasn't magic 3) magic(libmagic) isn't popular in various linux distributions Signed-off-by: Maksim Melnikau Reviewed-by: Simon McVittie commit ff1eea1e3abdc78665bb8b72c65bb19c8b1084b3 Author: Simon McVittie Date: 2013-01-03 18:19:08 +0000 NEWS for 0.21 commit 71ed6c18ca1c52d11256dadfbb4a2e530b5ae9c9 Merge: 8759a8f11 308408b98 Author: Simon McVittie Date: 2013-01-03 18:18:39 +0000 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS configure.ac commit 308408b98358b701a629b2b7821af81eaecc0239 Author: Simon McVittie Date: 2013-01-03 18:17:31 +0000 NEWS commit 8759a8f11bb1b480b0beaf3754020dfec73572e0 Author: Simon McVittie Date: 2012-11-09 17:37:38 +0000 Add dbus-properties-mixin-internal.h to tarballs, fixing distcheck Cherry-picked: from commit 162f347d313608bd6ea7148813c9fef99a0dee81 commit 202e5adc9a6216688d57940f92e9a3fd5c3b50fc Author: Simon McVittie Date: 2013-01-03 11:40:46 +0000 contact-lists test: add a regression test for fd.o #52011 Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52011 Reviewed-by: Xavier Claessens commit bbef06e7e6554850a9db6686ce19ad0cca39513f Author: Simon McVittie Date: 2013-01-03 11:02:52 +0000 tp_base_contact_list_set_list_received: don't re-announce groups We already announced each group from tp_base_contact_list_groups_created a few lines ago; we don't need to do it again. Ideally we'd add each channel's members before announcing the channel itself, so that the channel is created "fully-formed"; but we've never actually done that, and keeping the first NewChannels instead of the second seems less likely to break applications. These channels are only for legacy code anyway: any modern client should be using the ContactGroups interface. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52011 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit f4634b2caf1f92f27a507207ff181d3a7927871f Author: Simon McVittie Date: 2013-01-03 12:33:09 +0000 Make the code generation tools work under either Python 2 or 3 They have been verified to produce identical output in _gen. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=56758 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 8058faf2407867dcda1aca35616dd23496b1b814 Author: Guillaume Desmottes Date: 2013-01-02 15:22:07 +0100 text-channel: rename static vars/function to match the feature name The actual name of the feature is INCOMING_MESSAGE, not PENDING_MESSAGE. commit 8da3211ce74e143f59973b8f2f17295b7165b22c Author: Philip Withnall Date: 2012-12-29 11:41:50 +0000 Add some missing (element-type) introspection annotations This fixes compilation with --enable-introspection when introspection warnings are treated as errors. Signed-off-by: Robert McQueen https://bugs.freedesktop.org/show_bug.cgi?id=58851 commit fe88f67b789b7702d15866b80ebb989a28b6f7e6 Author: Philip Withnall Date: 2012-12-29 11:41:50 +0000 Add some missing (element-type) introspection annotations This fixes compilation with --enable-introspection when introspection warnings are treated as errors. Signed-off-by: Robert McQueen https://bugs.freedesktop.org/show_bug.cgi?id=58851 commit 4acc51d5b848359211bb8a00f0daa8e0bc44eb65 Author: Will Thompson Date: 2012-12-10 14:11:05 +0000 Remove pkg-config dependency from .pc files This causes problems for Yocto, since they use pc files when choosing package dependencies. It doesn't make a huge amount of sense for a .pc file to depend on pkg-config: by the time you've parsed the file, you've got pkg-config. And the versioned dependency is checked by configure, as commit 1154794 (which added this) mentions, so if you've compiled telepathy-glib, your pkg-config is new enough. commit 9197c36511e0fedd1cd32d99327a06ae3cd993d9 Author: Simon McVittie Date: 2012-11-09 18:04:42 +0000 Nano version commit 162f347d313608bd6ea7148813c9fef99a0dee81 Author: Simon McVittie Date: 2012-11-09 17:37:38 +0000 Add dbus-properties-mixin-internal.h to tarballs, fixing distcheck commit 6695cfc46050203ce1a4cc9bc0ab16285d8dc00f Author: Simon McVittie Date: 2012-11-09 17:25:08 +0000 Prepare release 0.20.1 commit 48a6895f21fd3a3ef996e3e18ded4ed8a8f9f576 Author: Debarshi Ray Date: 2012-10-17 14:48:11 +0200 base-call-channel: Don't call set_state from set_ringing and set_queued ... because they only change the flags and not the state. Instead emit CallStateChanged directly. Fixes: https://bugs.freedesktop.org/56044 commit dfca38a93e2c504c1a4643eec291c4ddb4368f4f Author: Debarshi Ray Date: 2012-10-17 10:50:24 +0200 base-call-channel: Ignore transitions with the same state Fixes: https://bugs.freedesktop.org/56044 commit 1dcb667751898544efad73b8e42d91ff58119e0d Author: Debarshi Ray Date: 2012-10-17 14:48:11 +0200 base-call-channel: Don't call set_state from set_ringing and set_queued ... because they only change the flags and not the state. Instead emit CallStateChanged directly. Fixes: https://bugs.freedesktop.org/56044 commit fd0448c174cfd169f297a8e3e306319806c4c074 Author: Debarshi Ray Date: 2012-10-17 10:50:24 +0200 base-call-channel: Ignore transitions with the same state Fixes: https://bugs.freedesktop.org/56044 commit a7e61d16b9aadf1cf212d8fc40db33e7cb2bccf1 Author: Simon McVittie Date: 2012-10-10 15:44:26 +0100 add missing inclusion commit 1c6846e925196b8286d96ee59a8f0636ee6f2a60 Author: Xavier Claessens Date: 2012-10-10 14:39:05 +0200 Util: Link APIs to their bug for inclusion in GLib commit e83233400f60acaac9838966b504801f00206132 Author: Xavier Claessens Date: 2012-10-10 14:15:01 +0200 Deprecate tp_g_key_file_get_(u)int64, GLib has it since 2.26 commit acd25c4ddc583f4fbfe127c3dae2f3d5a1e58b03 Merge: b203d2368 ce8d1f6ed Author: Simon McVittie Date: 2012-10-08 16:22:16 +0100 Merge branch 'telepathy-glib-0.20' commit ce8d1f6edf9161df170bc781f903f85346ac5554 Author: Simon McVittie Date: 2012-10-08 14:32:12 +0100 tests/lib: define _TP_COMPILATION for the internal variant foo_CPPFLAGS overrides AM_CPPFLAGS, so if you want to include the latter in the former, you have to do it explicitly. commit b203d2368f6f3d92d9be10b140be94dd00450a1d Merge: 75a6ae1fe e39ce95db Author: Simon McVittie Date: 2012-10-08 13:26:41 +0100 Merge branch 'telepathy-glib-0.20' Conflicts: NEWS commit e39ce95dbf2b2c57fb4621291a450aa8584fb193 Author: Simon McVittie Date: 2012-10-08 13:24:33 +0100 NEWS commit 5168e4145e4caf54b8b0a26f4268948edd8d9483 Author: Simon McVittie Date: 2012-10-08 13:23:06 +0100 self-handle test: test with a modern CM, not just an archaic one If we'd done this at the time, we wouldn't have broken SelfHandleChanged. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55666 Reviewed-by: Xavier Claessens [g_debug -> DEBUG as per Xavier's review -smcv] commit 99990babb32af5ebcf6912bb533ac001b12b085d Author: Simon McVittie Date: 2012-10-05 15:58:15 +0100 _tp_dbus_properties_mixin_get_all: expose to internal code The self-handle test can't exercise certain situations without this, except by pretending to be an obsolete CM, which means we don't test the non-obsolete code path properly. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55666 Reviewed-by: Xavier Claessens commit 70cf7cfcc62418264e3aeb0c346857440a9dfd8f Author: Simon McVittie Date: 2012-10-05 16:06:43 +0100 TpConnection: connect to SelfHandleChanged much earlier Previously, we only connected to it just before calling GetSelfHandle - but on the "modern" code path we no longer call that, because GetAll("...Connection") is just as informative. This meant we missed self-handle changes on modern connection managers. This was masked by the fact that the self-handle regression test deliberately breaks the "modern" code path, because some of its tests rely on GetSelfHandle being called. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55666 Reviewed-by: Xavier Claessens commit ab9489ed9e96b9b8cc3bfd9ee3fc18be22efb016 Author: Simon McVittie Date: 2012-10-05 15:56:16 +0100 Run the tests with G_MESSAGES_DEBUG=all Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55666 Reviewed-by: Xavier Claessens commit 75a6ae1febed4ab47bbc090a5cc30627fe341458 Author: Xavier Claessens Date: 2012-10-04 15:08:37 +0200 Add missing doc for TP_VERSION_0_22 commit cb289352235a5c53815bcaf542c9edbbbd325d4d Author: Xavier Claessens Date: 2012-10-04 11:21:33 +0200 Add defs for 0.22 branch commit 5639838f829ef4ea38be2a6eaa30d87b15899c42 Author: Guillaume Desmottes Date: 2012-10-03 14:17:19 +0200 start dev of 0.21.x commit ed011cd34e0a3c8b6e6fbf6a695b62f0a0177d02 Author: Guillaume Desmottes Date: 2012-10-03 14:16:45 +0200 Revert "Disable warnings about deprecated functions for stable branch" This reverts commit 74b79c60c152d7ac49f091c88c2001a6dcec93f1. commit aba81b8599fca976d3d0313043d3ad2c1ce7d106 Author: Guillaume Desmottes Date: 2012-10-03 14:16:34 +0200 Revert "Don't check documentation completeness in this stable branch" This reverts commit 860832b0521da2145e71bb2c06ff05b3a921c59f. commit 66b0194a274f7503074f4062884ab6472de090e2 Author: Guillaume Desmottes Date: 2012-10-03 14:16:21 +0200 Revert "Upload documentation to the 0.20.x location" This reverts commit 8a13206cedc749c301521f65b7f6f017fa39aee5. commit dc6f2f106202da6903e49848272f49d171423366 Author: Guillaume Desmottes Date: 2012-10-03 14:12:58 +0200 set nano version commit 2c9b852db37f2ba1df678f94d6d9a6e93f0a0634 Author: Guillaume Desmottes Date: 2012-10-03 12:48:13 +0200 prepare 0.20.0 commit 1bf52d3274028450a9d16a30ca663a411dc4a65e Author: Simon McVittie Date: 2012-10-03 09:56:51 +0100 NEWS file for 0.20 commit 8a13206cedc749c301521f65b7f6f017fa39aee5 Author: Simon McVittie Date: 2012-10-03 09:50:39 +0100 Upload documentation to the 0.20.x location To be reverted in the 0.21 branch. commit 860832b0521da2145e71bb2c06ff05b3a921c59f Author: Simon McVittie Date: 2012-10-03 09:49:33 +0100 Don't check documentation completeness in this stable branch To be reverted in the 0.21 branch. commit 74b79c60c152d7ac49f091c88c2001a6dcec93f1 Author: Simon McVittie Date: 2010-04-06 12:33:21 +0100 Disable warnings about deprecated functions for stable branch Since this is a stable branch, we're unlikely to fix uses of deprecated functions, so we shouldn't warn about them. To be reverted in the 0.21 branch. commit ed43abb7603e1286dbcbefbad75f354a654cae37 Author: Simon McVittie Date: 2012-10-02 16:15:53 +0100 Bump libtool current/age even though nothing actually changed This is to compensate for 0.19.10, which should have incremented them (because it added API) but didn't. commit 7c8d17cc9540823fa75b4ecfc6a431fdbc8712e2 Author: Guillaume Desmottes Date: 2012-09-26 16:10:30 +0200 set nano version commit 884e32afc11107aa8e12ff282a90c10113adba49 Author: Guillaume Desmottes Date: 2012-09-26 15:36:10 +0200 prepare 0.19.10 commit d7d81d9d33f471bfaf45e70764b875600c41439e Author: Guillaume Desmottes Date: 2012-09-26 15:46:31 +0200 NEWS: add missing new API commit 8fd76ceedfba306a72c1c962ab7d825c2232a05a Author: Guillaume Desmottes Date: 2012-09-26 15:28:14 +0200 update NEWS commit 68022368089c6430df6577fd1718f75e60cdc57c Author: Simon McVittie Date: 2012-09-19 13:56:28 +0100 tp_channel_dispatch_operation_get_channels: annotate return type, don't skip The justification for (skip)ing it is that it's just a binding for a property, but the underlying property is not useful from g-i due to a g-i limitation (GPtrArray properties can't be annotated with their element types, https://bugzilla.gnome.org/show_bug.cgi?id=663846). https://bugs.freedesktop.org/show_bug.cgi?id=55102 commit 3db2b44439ee7330eaa15ab374ebb033e8296063 Author: Simon McVittie Date: 2012-09-19 12:12:40 +0100 tp_message_set_variant: add and test https://bugs.freedesktop.org/show_bug.cgi?id=55096 commit 9720a304317d43b9ada1555b4542bcece7457c8a Author: Simon McVittie Date: 2012-09-19 12:06:00 +0100 tp_message_dup_part: add https://bugs.freedesktop.org/show_bug.cgi?id=55096 commit 641b45d0a6ddadd4825a0efcb2f31ba0e666ea83 Author: Simon McVittie Date: 2012-09-19 12:53:34 +0100 tp_account_manager_create_account_async: document TpAccountRequest as an alternative Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55099 commit b4012b9e337f10a60123ac76c44c68a83700face Author: Simon McVittie Date: 2012-09-19 12:52:43 +0100 tp_account_channel_request_dup_request, request-vardict property: add Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55099 commit 51487e6aa62e43661f32ec8055a8185d661cff49 Author: Simon McVittie Date: 2012-09-19 12:26:09 +0100 tp_account_channel_request_new_vardict: add Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55099 commit 08fa36559db4ee3909c4f62e15fc2b64c0c181ab Author: Simon McVittie Date: 2012-09-19 12:13:01 +0100 tp_account_channel_request_set_hints: document that set_hint is better for g-i Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55099 commit 93dd462e247ee8138b5e5088c72a1f9d6be0d047 Author: Simon McVittie Date: 2012-09-19 13:28:35 +0100 tp_g_socket_address_from_g_variant, tp_address_g_variant_from_g_socket_address: add https://bugs.freedesktop.org/show_bug.cgi?id=55101 commit c7221bfbc3303cb32b2dd1fcc0cb500edb575ca6 Author: Simon McVittie Date: 2012-09-19 14:20:51 +0100 tp_channel_request_dup_immutable_properties: add Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55101 https://bugs.freedesktop.org/show_bug.cgi?id=55103 commit 69305347a64f5cb3ac69db067f525855f6eeaa9c Author: Simon McVittie Date: 2012-09-19 14:07:52 +0100 tp_channel_request_dup_hints: add https://bugs.freedesktop.org/show_bug.cgi?id=55103 commit 3a7bc0a5b62c8eae5a3226ffbdfeffa7f1541e03 Author: Simon McVittie Date: 2012-09-19 15:40:29 +0100 TpDBusTubeChannel: add parameters-vardict Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55095 https://bugs.freedesktop.org/show_bug.cgi?id=55024 commit 426d2e6f389b5a691b6eb03a0a740bcbef173749 Author: Simon McVittie Date: 2012-09-19 15:39:14 +0100 TpStreamTubeChannel: add parameters-vardict and its getter Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55095 https://bugs.freedesktop.org/show_bug.cgi?id=55024 commit d7a526defeb0341805f739818e419c08cd47cf2a Author: Simon McVittie Date: 2012-09-19 15:17:51 +0100 tp_contact_dup_location, TpContact:location-vardict: add https://bugs.freedesktop.org/show_bug.cgi?id=55095 commit 51c4234251cc7c263b54803d7c0211db0dc25fa2 Author: Simon McVittie Date: 2012-09-19 15:12:50 +0100 contacts test: correct comparison of locations The values are GValues, not strings. This only appeared to work by chance: struct _GValue starts with a GType, and G_TYPE_STRING is '@', so on little-endian platforms interpreting a GValue as a string gives { '@', 0, 0, 0 } = "@" and on big-endian platforms it gives { 0, 0, 0, '@' } = "". https://bugs.freedesktop.org/show_bug.cgi?id=55095 commit c3ac127197aec474dd8533ad8943262bdd26aac8 Author: Simon McVittie Date: 2012-09-19 13:08:32 +0100 tp_base_client_add_observer_filter_vardict etc.: add https://bugs.freedesktop.org/show_bug.cgi?id=55100 commit 6d3c8df3cd918cf76abae7d5c43f84bfca6ed59d Author: Guillaume Desmottes Date: 2012-09-20 13:44:01 +0200 base-call-channel: include the expected and current state in Accept error message I'm debugging an Empathy call issue and this kind of info can be useful. commit 1bbda3bc12ba8b22c7d004ca82915e35d7496c4d Author: Travis Reitter Date: 2012-09-18 10:49:13 -0700 Introspection: Fix build break Reviewed-by: Simon McVittie commit 5882153f491a91ac28a62f1d7ead63888fd534ea Author: Simon McVittie Date: 2012-09-17 17:08:52 +0100 NEWS commit f77747947fa02ce9ff21ac866e07e10589cd1814 Author: Chandni Verma Date: 2012-09-17 21:00:52 +0530 Add tp_dbus_tube_channel_dup_parameters_vardict() [applied with documentation adjustments -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55024 Reviewed-by: Simon McVittie commit 046f1e6139a1d2278d90566df475e15b2b9d2602 Author: Xavier Claessens Date: 2012-09-12 17:17:40 +0200 Tests: check tp_vardict_get_foo() together with tp_asv_get_foo() commit d1d2203333f47701b5887dde18a910c0ffaed7f9 Author: Xavier Claessens Date: 2012-09-12 12:57:43 +0200 GVariant: Add tp_vardict_get_foo() similar to tp_asv_get_foo() commit 51115c42577150c400a9785b77714efd442117a8 Author: Xavier Claessens Date: 2012-09-12 12:55:09 +0200 Move GVariant utilities to variant-util.ch commit 2f3d04a0fb793570967d2451c2ed3b6c6c0ea733 Author: Guillaume Desmottes Date: 2012-09-12 15:56:31 +0200 channel-contacts: don't leak the result preparing group members commit 08de9efcd7295f50d0883f048abfd00f3974502c Author: Guillaume Desmottes Date: 2012-09-12 15:56:31 +0200 channel-contacts: don't leak the result preparing group members commit 0833a36225e9a4da6419c2bc3c26aa976d77e34c Author: Xavier Claessens Date: 2012-09-11 13:16:08 +0200 Bump nano version commit 2126739841326c79f98ae795b3c962ad3a1d7884 Author: Xavier Claessens Date: 2012-09-11 12:49:12 +0200 prepare 0.19.9 release commit 6555f449c4b6490f08d7b2c8c523faa4c542b89d Author: Xavier Claessens Date: 2012-06-08 16:28:49 +0200 TpContact: do not override properties with attributes we didn't request We check wanted flags for everything but States and Groups, there is no reason for that. Besides, if we did not request those attributes, there are chances we didn't bind to change notification neither. commit 0e224c223a3a78f20c3b940129c7bba84f815f6d Author: Xavier Claessens Date: 2012-09-06 15:13:41 +0200 TpHandleRepo: Deprecate tp_handle_set/get_qdata() https://bugs.freedesktop.org/show_bug.cgi?id=50886 commit 4770a0dd38909fb3f74f1e3436e4c628a7df3020 Author: Xavier Claessens Date: 2012-09-03 15:35:25 +0200 Deprecate tp_channel_request_new() and tp_channel_dispatch_operation_new() Those constructors are useless because TpChannelRequest and TpChannelDispatchOperation objects are created internally by TpBaseClient and friends. Applications using the high-level API should never need them. Those constructors are harmful because they do not take a factory and they need a factory internally. This means that creating our own TpChannelRequest/TpChannelDispatchOperation will create our own account/connection/channel/whatever objects instead of sharing them. Internally we already have _new_with_factory() variant. https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit 29daab56223b7a2bb8c98e389aca85a2b8a0dcfb Author: Xavier Claessens Date: 2012-09-10 17:03:25 +0200 Do not include single headers in codegen Headers to use is caller's choice, like that tp-glib internal can use single headers while extensions can use global header. This also move command line headers to generated .h instead of .c commit 6834819cccb408e6c44931b3cc6321018cbbfb56 Author: Xavier Claessens Date: 2012-09-10 17:02:40 +0200 properties-mixin.h: This header should be include separately commit 400cb44ea5b0175a07f98abe8a5c6c6b777e8aaa Author: Simon McVittie Date: 2012-09-07 16:47:24 +0100 NEWS commit 18f9679ecf30474e772ce2db852398b6e20dc18f Author: Simon McVittie Date: 2012-09-05 11:23:16 +0100 Introspect util.[ch] Most of it is useless in non-C languages, so we (skip) it. However, tp_simple_async_report_success_in_idle(), tp_utf8_make_valid(), tp_escape_as_identifier() and the user-action-time functions all seem like useful things to have. The tp_g_value_slice_new() family confuses g-ir-scanner (which goes looking for a TpGValueSlice type), but they're all (skip)'d anyway, so #ifdef them out. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54543 commit 8f9b57121072744bb57dd4aa801589e156048072 Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpContact: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit 8a628bd8efeee4fe359a72cf56bdde6350c024dc Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpTextChannel: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit cde6fbb93f2c1392e51f67f5d4d15b22ff48e307 Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpBaseClient: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit a934de9b7cdec5204046dacf38afcac9a12eef69 Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpAccountManager: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit 53e5e36d9fa59d62f0ae99caaca3a8ac9d67a1bc Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpContactSearchResult: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit 53e05b8c3dc0a09d79724142d8013224520cd449 Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpConnection: Deprecate _get_ functions returning a GList and replace them by _dup_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit 8a541d754eddda27039cf759c7228bf2e7f8a10c Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpProtocol: Deprecate _borrow_ functions New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib There is intentionally no tp_protocol_get_params() because it is internally an unintrospectable C-array, so a proper container needs to be created. In next branch they are internally in a GPtrArray so a _get_ function could be added. commit 93409a1f9ca16777e544e6c5da8bdec18b4bdd8f Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpDispatchOperation: Deprecate _borrow_ functions and replace them by _get_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib There is intentionally no tp_dispatch_operation_get_immutable_properties() since those are internal implementation detail. Individual property getters should be enough. commit 050fedeeacb312b99cf82482fa4aeea55194765e Author: Xavier Claessens Date: 2012-09-05 13:02:41 +0200 TpChannel: Deprecate _borrow_ functions and replace them by _get_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib _tp_channel_get_immutable_properties() is kept internal because we don't want to expose more dbus-glib structures. tp_channel_dup_immutable_properties() is added, it returns a GVariant and should be needed only to TpChannel subclasses. commit fad8f1f85525c1bf698240af6e6bad0cd3636a57 Author: Xavier Claessens Date: 2012-09-05 11:15:00 +0200 TpProxy: Deprecate _borrow_ functions and replace them by _get_ New transfer and naming policy has been discussed in https://bugs.freedesktop.org/show_bug.cgi?id=39189 and is documented there: http://telepathy.freedesktop.org/wiki/Style/TelepathyGLib commit 625f553077d234316b81ae81f399c99917217ae7 Author: Xavier Claessens Date: 2012-09-05 11:11:41 +0200 Modernise GList usage We can use g_list_free_full and (_tp_)g_list_copy_deep in more places commit 3df9ac884e876dc685951556a28c0f085e3938a3 Author: Xavier Claessens Date: 2012-09-05 10:53:22 +0200 Util: Add _tp_g_list_copy_deep() This implementation is less optimized than g_list_copy_deep() because it iterates the list twice. But it will be removed once we depend on glib 2.34 commit 4c886ee65c1e74ceb866f9d8b94d05cd1b0ab254 Author: Sjoerd Simons Date: 2012-09-03 11:14:34 +0200 Fix retrieving the remove contact from a MediaDescription hash Correctly get the remote contact handle out of the MediaDescription hash, it's an a{sv} not string => uint32. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54425 Conflicts: telepathy-glib/base-media-call-content.c commit f55630f7da156b0773e999ac70916d340f7b23e0 Author: Sjoerd Simons Date: 2012-09-03 11:10:01 +0200 Fix incorrect error on UpdateLocalMediaDescription Remove the code that errors out a local description update if there is *any* outstanding offer. A bit later in the same function a proper check is done to see if there is a offer for the update contact, which is correct. Conflicts: telepathy-glib/base-media-call-content.c commit a04137272f0468fc1f4904280a02633cea60c998 Author: Sjoerd Simons Date: 2012-09-03 11:14:34 +0200 Fix retrieving the remove contact from a MediaDescription hash Correctly get the remote contact handle out of the MediaDescription hash, it's an a{sv} not string => uint32. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=54425 commit 680a5dd2a492078a0cc497502aab1d81cdba39ac Author: Sjoerd Simons Date: 2012-09-03 11:10:01 +0200 Fix incorrect error on UpdateLocalMediaDescription Remove the code that errors out a local description update if there is *any* outstanding offer. A bit later in the same function a proper check is done to see if there is a offer for the update contact, which is correct. commit 8c682d0122b066ad69cc7106884f383563c2ba6d Author: Sjoerd Simons Date: 2012-08-31 15:33:08 +0200 tls-certificate test: GBytes aren't 0 terminated commit f59f0ef8f7966733385e545c4c2d702425d1efd1 Author: Xavier Claessens Date: 2012-08-31 12:36:31 +0200 Bump nano version commit 79e202509ce1ddf470dd856d71aa542f3953c3ca Author: Xavier Claessens Date: 2012-08-31 12:22:47 +0200 Prepare 0.19.8 release commit 84f63e56bbc5f32c418d8112b32574f62588b000 Author: Jonny Lamb Date: 2012-08-30 19:23:08 +0100 lcov: add a holding page for lcov reports When lcov fails on the buildbot let's upload /something/. Signed-off-by: Jonny Lamb commit 273cf5ca055378ddb4093a4b5addf039b750832d Author: Sjoerd Simons Date: 2012-08-30 11:07:17 +0200 Set the ChannelRequests immutable properties when observer channels When ObserveChannels comes in we are given all the immutable properties for the statisfied requests straight away, so lets use them as well. This prevents poor application authors from being confused about their hints not coming through in their observer. commit b6342b5b39d5f0cd02e2580ddc569d0eeb9e8c72 Author: Sjoerd Simons Date: 2012-08-30 10:08:15 +0200 Set the ChannelRequests immutable properties when handling channels When HandleChannels comes in we are given all the immutable properties for the statisfied requests straight away, so lets use them as well. This prevents poor application authors from being confused about their hints not coming through in their handler. commit 6a1bdcf39bb16c77b25004b77c9272f3dfe0af3d Author: Sjoerd Simons Date: 2012-08-30 09:29:30 +0200 Add tp_account_channel_request_set_hint API And an easy and bindable API to add a single hint to the hints dictionary commit 5ce5818887f0d72a5e615c5e293e3eae39965394 Author: Jonny Lamb Date: 2012-08-28 11:54:03 +0100 start on version 0.19.8 Signed-off-by: Jonny Lamb commit 3ec4ea8efdfccad9fa5bfc0c90dd84ffdb002a9f Author: Jonny Lamb Date: 2012-08-27 18:08:08 +0100 version 0.19.7 Signed-off-by: Jonny Lamb commit 54e3a228f78adb668b51ab1249fe6d60ecad0732 Author: Jonny Lamb Date: 2012-08-27 18:04:51 +0100 NEWS: updated Signed-off-by: Jonny Lamb commit 1a4d0f347efae2d4d7e8a8523ea8280086867d34 Merge: f2089116f 926ddbefa Author: Jonny Lamb Date: 2012-08-27 17:55:54 +0100 Merge branch 'base-channel-disappear' commit f2089116f3e01d4797d2eaf96e35b67312330084 Author: Simon McVittie Date: 2012-08-13 11:26:40 +0100 configure.ac: use AS_CASE instead of case/esac This is the same as AS_IF, but for "case". It's safer for the same reasons. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53445 commit 496b900156a853ca0ccf55b89736588ed3717f70 Author: Simon McVittie Date: 2012-08-13 11:26:06 +0100 configure.ac: use AS_IF instead of if/then/[else/]fi AS_IF is always safe, whereas if/fi usually works in practice, but sometimes fails to do the right thing with Autoconf macro dependencies. See for more information. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53445 commit facbaeaa87dcfbe4af811af4bac344225bc855e8 Author: Simon McVittie Date: 2012-08-13 11:20:29 +0100 configure.ac: don't rely on test -a test EXPR -a EXPR is a common extension (present in bash, dash etc.), but is not guaranteed by POSIX. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53445 commit 1090f37723ace6343cc6d24871390005ce435e1f Author: Simon McVittie Date: 2012-08-13 10:59:41 +0100 NEWS commit 66bfce2b467bb8873e8c88c7f70561637e03a81a Author: Simon McVittie Date: 2012-08-13 10:58:39 +0100 NEWS commit 505fe8deebb5d45dbc6dc19c741c57b525fe8f50 Merge: e29320964 21d9f3824 Author: Simon McVittie Date: 2012-08-13 10:56:31 +0100 Merge branch 'telepathy-glib-0.18' Conflicts: NEWS configure.ac commit e293209646eee5b6c3c00f8644e627db31d843de Author: Simon McVittie Date: 2012-08-06 09:19:40 +0100 Don't have a second copy of the TpBaseConnection typedef N1570 (C11 final draft) §6.7.3 says this usage is valid[1] so modern gcc doesn't have an option to even warn about it, but this is a recent change to the C standard, and older compilers like the one in the Android NDK treat it as a fatal error. [1] "a typedef name may be redefined to denote the same type as it currently does, provided that type is not a variably modified type" Bug: https://bugs.freedesktop.org/show_bug.cgi?id=53100 Reviewed-by: Jonny Lamb commit 21d9f38246c9c11307e9b170ebf0e8589909faa3 Author: Guillaume Desmottes Date: 2012-08-07 10:07:50 +0200 tp_account_dup_storage_identifier_variant: deal with storage_identifier being NULL https://bugs.freedesktop.org/show_bug.cgi?id=53201 commit 1af70f08af087ec452fdd0fc17d8dd2d3391994c Author: Guillaume Desmottes Date: 2012-08-07 10:07:50 +0200 tp_account_dup_storage_identifier_variant: deal with storage_identifier being NULL https://bugs.freedesktop.org/show_bug.cgi?id=53201 commit 153f645a95456c10aa0c90dd084246a7c7798bf0 Author: Guillaume Desmottes Date: 2012-08-06 16:09:50 +0200 set nano version commit 4c6f55112a8542035ba8311cdd3456c6b7673f1b Author: Guillaume Desmottes Date: 2012-08-06 15:33:36 +0200 prepare 0.19.6 commit 48cfae7dfe818c39835d609933e9db12a3bdc573 Author: Guillaume Desmottes Date: 2012-08-02 15:24:41 +0200 add tp_account_manager_can_set_default() When creating/editing an account, the Ubuntu Online Accounts panel loads the relevant plugin dynamically. In order to work properly, this plugin has to define the default AM with some features. But tp_account_manager_set_default() can only be called once, later calls resulting in critical warnings. By using tp_account_manager_can_set_default() the plugin can check if the default AM has already be defined or not. commit ae5de32be39b2dbb6df88033e74ac792ad4ace84 Author: Will Thompson Date: 2012-07-31 20:54:31 +0200 BaseChannel: assert that the subclass sets TargetHandleType If the subclass sets the channel's target handle, then it had better set the target handle type in the klass. I got this wrong when porting Idle to TpBaseChannel. Fist-bumped-by: Jonny Lamb commit 7e57a020c356778ef0ee009abab734b385cacc4f Author: Guillaume Desmottes Date: 2012-07-28 11:15:07 +0200 set nano version commit 19cb443d1a7accc92934e6fc89c4e3962caf2ff3 Author: Xavier Claessens Date: 2012-07-05 15:29:58 +0200 Make sure "make -j3 maintainer-foo" works commit 8392229d6cf825198bb0cbeb706ed0900f962112 Author: Guillaume Desmottes Date: 2012-07-28 10:52:01 +0200 prepare 0.18.2 commit 25dee6daf0cd5fcf72e0fb204c85074119e4af1d Author: Simon McVittie Date: 2012-07-26 11:50:48 +0100 NEWS commit fbacc9202217a86da303df05d881bfefe6385bd9 Author: Ross Burton Date: 2012-07-25 12:58:16 +0100 Fix a race in _gen/reentrant-methods.list Very occasionally, a parallel build will fail like this: | Making all in telepathy-glib | make[2]: Entering directory `/buildarea1/yocto-autobuilder/yocto-slave/nightly-x86/build/build/tmp/work/i586-poky-linux/telepathy-glib-0.19.2-r0/telepathy-glib-0.19.2/telepathy-glib' | /bin/mkdir -p _gen | ( cd . && cat versions/0.7.0.abi [...] versions/0.19.2.abi ) | \ | /bin/grep '^tp_cli_.*_run_.*' > _gen/reentrant-methods.list.tmp | /bin/sh: line 1: _gen/reentrant-methods.list.tmp: No such file or directory | make[2]: *** [_gen/reentrant-methods.list] Error 1 It's doing the mkdir and the subshell in parallel, when the mkdir should be done first. Add an explicit dependency on spec-stamp to reentrant-methods.list to ensure the ordering. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52480 Reviwewed-by: Jonny Lamb Reviwewed-by: Simon McVittie commit 38ca0a65e896c3af583b0c2ece61bc717746cd06 Author: Xavier Claessens Date: 2012-07-24 16:50:24 +0200 Bump nano version commit 746ff16c0d9bfd4e234e2066a49dec5a2f21624f Author: Xavier Claessens Date: 2012-07-24 16:25:18 +0200 Prepare 0.19.5 release commit bf772bf88572d235e905eea9a67e168b886bf670 Merge: 523691b44 e2f99aa39 Author: Xavier Claessens Date: 2012-07-24 16:17:38 +0200 Merge branch 'telepathy-glib-0.18' commit e2f99aa39425dd3431e9cd8d09fb3b144c1ab0a7 Author: Xavier Claessens Date: 2012-07-24 15:28:00 +0200 tp_connection_upgrade_contacts(): Use special trick of ready_enough_for_contacts TpConnection itself wants to prepare TpContacts before being officially CONNECTED. This was already the case for self contact. Use the same trick for blocked contacts. https://bugs.freedesktop.org/show_bug.cgi?id=52441 commit 523691b44584947b25ce1e93a0191e60c60ca78f Author: Xavier Claessens Date: 2012-07-24 13:45:25 +0200 TpAccountManager: set the requested presence on newly created accounts commit 505403d253c7071ab081cc258827b605a6ed93b0 Author: Guillaume Desmottes Date: 2012-07-19 12:36:00 +0200 set nano version commit f01424d595211eff173e4ca1cda9d89f11d48493 Author: Guillaume Desmottes Date: 2012-07-19 12:21:21 +0200 set UNRELEASED versions commit 70f4a3665d14868653e2f99b0fa77b6a81293ca1 Author: Guillaume Desmottes Date: 2012-07-19 12:04:36 +0200 prepare 0.19.4 commit 8dd23a0617edfc8fbc9adf1c855834ccd60ff531 Author: Guillaume Desmottes Date: 2012-07-17 15:51:59 +0200 add tp_account_request_set_storage_provider() commit 248a1c9c0dc909e6ebd4bf93d3f83b873a697f06 Author: Guillaume Desmottes Date: 2012-07-17 15:40:59 +0200 account-request: add missing 'service' getter commit b0e97c3827c4f5da668e0472afa0f02f7b533a47 Author: Jonny Lamb Date: 2012-07-10 15:24:08 +0100 base-connection: return from RequestHandles if called with no names Since we added async handle normalization functions, RequestHandles(1, []) would just not return at all. Signed-off-by: Jonny Lamb commit 4e35e0198e6a21d68f25adfe896f50afa74e3f2b Author: Xavier Claessens Date: 2012-07-10 16:18:01 +0200 Fix some gtk-doc errors commit 932a5758b82c9440d482694e66a80b0dcabba561 Author: Jonny Lamb Date: 2012-07-09 16:38:27 +0100 base-{connection,protocol}: be sure to add new class members to the end of the struct I already removed the padding (in c14d25b4bf4 and 436219789348) so just re-arrange the struct. D'oh. Signed-off-by: Jonny Lamb commit 528770ed041b494a23dc00b4e0b1f5b4ee5c75f9 Merge: 8e5090498 ec9a04f13 Author: Jonny Lamb Date: 2012-07-06 17:01:50 +0100 Merge branch '51441-get-interfaces' Conflicts: telepathy-glib/base-connection-manager.c Signed-off-by: Jonny Lamb commit ec9a04f139900957a59630a7f74015f55dffe100 Author: Jonny Lamb Date: 2012-07-05 16:52:51 +0100 example protocols: update to use get_interfaces_array vfunc Signed-off-by: Jonny Lamb commit 43621978934824f2b6815ef5d5e20887d59bca28 Author: Jonny Lamb Date: 2012-07-05 16:48:36 +0100 base-protocol: add get_interfaces_array vfunc to class struct This is a lot like 74bd945252, but we're having to deal with another older get_interfaces vfunc, which is slightly annoying. Signed-off-by: Jonny Lamb commit c14d25b4bf471b7d9797e097d4318af4b9da001c Author: Jonny Lamb Date: 2012-07-05 16:04:46 +0100 fixup! bcde9c87323454f946be989825b2dc74f61d16f7 Signed-off-by: Jonny Lamb commit 05ea1395d99b67e8569dd6e50ec99b782b72ea08 Author: Jonny Lamb Date: 2012-07-05 15:56:12 +0100 base-connection: simplify add_interfaces Calling set_size on the GArray is a little overkill. Signed-off-by: Jonny Lamb commit 6b037b43df5104636f58ab0a3e10c075012feee5 Author: Jonny Lamb Date: 2012-07-05 15:54:52 +0100 base-connection{,-manager}: seal old interfaces members gtk-doc gets confused, so they've been removed from the docs. See also: e8f9a27a388e21 Signed-off-by: Jonny Lamb commit aaea3147323cd1ad1b67e17c06504a5a6d6517cc Author: Jonny Lamb Date: 2012-07-05 15:05:34 +0100 example & test connections: update to use new get_interfaces… vfunc Signed-off-by: Jonny Lamb commit bcde9c87323454f946be989825b2dc74f61d16f7 Author: Jonny Lamb Date: 2012-07-05 15:04:00 +0100 base-connection: add get_interfaces… vfunc to class struct This is a lot like 74bd945252. Signed-off-by: Jonny Lamb commit 245d48040d0b52aab05b57c7c859b4118b0af776 Author: Jonny Lamb Date: 2012-07-04 17:58:16 +0100 base-room-config: fix old comment referring to TpBaseChannelClass.interfaces Signed-off-by: Jonny Lamb commit 8e509049846753db229d49465a85442d9dc7a009 Author: Xavier Claessens Date: 2012-07-05 15:40:16 +0200 Bump nano version commit dc783450b25d72b452dd15ac121f495beac1f436 Author: Xavier Claessens Date: 2012-07-05 15:29:58 +0200 Make sure "make -j3 maintainer-foo" works commit c575eec33ddd04ea25dd30cd97076092c8610963 Author: Xavier Claessens Date: 2012-07-05 14:30:22 +0200 Release 0.19.3 commit e8f9a27a388e2123a3281d610acbcd6a4b17d9a1 Author: Xavier Claessens Date: 2012-07-05 14:23:46 +0200 Remove from doc sealed fields Otherwise gtk-doc gets confused commit 19fd0c69ae3d557f9ed430ecced67701ec6a8c9f Author: Jonny Lamb Date: 2012-07-04 17:57:38 +0100 base-connection-manager: add get_interfaces vfunc to class struct This is a lot like 74bd945252. Signed-off-by: Jonny Lamb commit ac0a38eb86993bb2b223f08d3402ff9e1d4be27a Author: Xavier Claessens Date: 2012-06-27 11:18:17 +0200 TpBaseClient: Ensure that the Connection knows its Account early This fixes a crash in empathy-chat: https://bugs.freedesktop.org/show_bug.cgi?id=51444 commit ae6497b99573a0bed78660f739a1a7937e2b2c10 Author: Xavier Claessens Date: 2012-06-27 11:08:59 +0200 TpBaseClient: refactor code that create TpAccount, TpConnection and TpChannels commit 1fb96194bee4fa3af2230d996541f7474bf76600 Author: Xavier Claessens Date: 2012-05-23 10:58:20 +0200 NEWS commit 50fdb9d38694d620dbe49ff00572df1e54454052 Author: Xavier Claessens Date: 2012-05-16 13:10:31 +0200 Deprecate tp_account_new(), tp_connection_new() and tp_*_channel_new() Those proxies should be constructed using TpSimpleClientFactory https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit be781d63238f4eb55a334508c6073101d01a4ab0 Author: Xavier Claessens Date: 2012-05-16 14:37:29 +0200 tests/lib: Stop using tp_connection_new() https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit 633b26af12ce440481b75ec4ce7ab9786033bc9a Author: Xavier Claessens Date: 2012-05-16 14:24:32 +0200 Examples: stop using tp_account/connection/channel_new() https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit db27aa71a3aad393d971eefebac3b6bc03d49f3c Author: Xavier Claessens Date: 2012-06-07 17:10:39 +0200 TpConnectionManager: deprecate "connection-manager" and add "cm-name" Otherwise we could assume they are returning TpConnectionManager objects. This is more consistent with TpProtocol, TpConnection and TpAccountRequest API. commit d0335d2645f365834e313c086d0fe30ce7798d09 Author: Xavier Claessens Date: 2012-06-07 17:10:39 +0200 TpAccount: deprecate "connection-manager" and "protocol" and add "cm-name" and "protocol-name" Otherwise we could assume they are returning TpConnectionManager/TpProtocol objects commit 5763dc9c9bce465c7cffbfa29a6403496363f70f Author: Xavier Claessens Date: 2012-06-07 16:45:16 +0200 TpConnection: deprecate connection-manager-name and add cm-name This is to be consistent with TpProtocol naming. commit 9af5fe5b99a6446311660250a605abdcb5e4f353 Author: Xavier Claessens Date: 2012-06-07 16:39:34 +0200 TpConnection: trivial coding style fix commit 2604065abb90f022559a0910462cc13e88d31520 Author: Xavier Claessens Date: 2012-06-29 15:02:32 +0200 Set nano version commit 126a920d666bda09e4d38f06aec88acea6de24fa Author: Xavier Claessens Date: 2012-06-28 14:31:47 +0200 Release 0.19.2 commit 3f9776806675c1b7e3ded4ac3d1b95577af6ce97 Author: Xavier Claessens Date: 2012-05-29 13:28:38 +0200 TpBaseConnection: use tp_handle_ensure_async() in RequestHandles https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 78b16657eb08322a36816b05f60d68dc6bb2f754 Author: Xavier Claessens Date: 2012-05-29 13:27:21 +0200 TpContactsMixin: use tp_handle_ensure_async() in GetContactByID The identifier is most probably provided by the user, it could need server-side normalization. https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 6b1bbb146e12426d3bda22b9281c83abbe4cc38a Author: Xavier Claessens Date: 2012-05-29 13:25:13 +0200 TpDynamicHandleRepo: Support async normalization function Override TpHandleRepoIface::ensure_handle_async() and use an user provided async normalization function. https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 005b08101e316ac0bdf375f18cc75df7f6990857 Author: Xavier Claessens Date: 2012-05-29 12:52:42 +0200 TpDynamicHandleRepo: factor out ensure_handle_take_normalized_id() https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 25a3af6923d9e17ff4d6ae3e1bcf9322e7da3731 Author: Xavier Claessens Date: 2012-05-29 12:49:39 +0200 TpHandleRepoIface: add tp_handle_ensure_async() A default implementation is provided that just use tp_handle_ensure() and return the handle in an idle callback. https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 9b28efdc5aa735dd5482f0f050031594f20d3e9a Author: Xavier Claessens Date: 2012-05-29 10:14:50 +0200 TpHandleRepoIface: Use G_DEFINE_INTERFACE https://bugs.freedesktop.org/show_bug.cgi?id=50341 commit 16b839c3490a081ae9583dc08d4fcb0f6d818b4c Author: Xavier Claessens Date: 2012-06-26 13:15:39 +0200 TpBaseChannelClass: Seal interfaces member It is deprecated and should not be used anymore. commit 94bb7f4948a25a583c62ff61f6c66098a87820c5 Author: Xavier Claessens Date: 2012-06-26 12:54:59 +0200 TpBaseConnectionManagerClass: Seal protocol_params and new_connection members Those 2 struct members are now deprecated and implementations should use TpBaseProtocol API instead. commit f8dbd199da1a7c4b3f67775ef854a00dd3cf109c Author: Guillaume Desmottes Date: 2012-06-20 11:07:40 +0200 debug-client: propagate error if GetMessages() failed https://bugs.freedesktop.org/show_bug.cgi?id=51250 commit 1dffa0c38b208bf7b463f4614d4c5e8abd8edd14 Author: Guillaume Desmottes Date: 2012-06-06 16:39:48 +0200 set nano version commit 227d29086df4b4d40fd201ec6e0924a2559692d2 Author: Guillaume Desmottes Date: 2012-06-06 16:11:47 +0200 Prepare 0.19.1 commit 65d59a833bb1a6ec388b06c39d9c0bd28d529f9d Author: Xavier Claessens Date: 2012-06-06 15:59:35 +0200 Revert "Enable SEAL by default if we warn for 0.20 deprecations" This reverts commit bf7e97c45adc04e46118aed0cd449bdc2fa84d6e. commit 2ea0c999ab61ebaed883a69f207fe9ca3979dce0 Author: Xavier Claessens Date: 2012-06-06 15:57:14 +0200 NEWS commit 5d3655176a44bae0e442392a5cf8db70bfbad879 Author: Guillaume Desmottes Date: 2012-06-06 11:49:43 +0200 fix typo in TpConnectionManagerParam's doc commit 926ddbefa79a5b660bbb170a056588a20e7b991a Author: Jonny Lamb Date: 2012-06-05 16:27:13 +0100 text-respawn test: add a disappearing base channel test Signed-off-by: Jonny Lamb commit 8ff2818f0e663c5db1d5d7819d13185397bc2b8b Author: Jonny Lamb Date: 2012-06-04 17:16:09 +0100 base-channel: add support for 'disappearing' channels Signed-off-by: Jonny Lamb commit 3bfa39887625370541e0c654356124ec1ba24501 Author: Xavier Claessens Date: 2012-06-05 12:18:16 +0200 Remove useless TP_SEAL_ENABLE commit bf7e97c45adc04e46118aed0cd449bdc2fa84d6e Author: Xavier Claessens Date: 2012-06-05 10:27:43 +0200 Enable SEAL by default if we warn for 0.20 deprecations commit d0fbd7d4c7434fa7e8ba27695ad924bab9ef5fd8 Author: Xavier Claessens Date: 2012-06-05 13:07:46 +0200 Fix regression introduced by 1aba6b49919a9ac68671fc49a525e48ccfa75c57 G_GNUC_END_IGNORE_DEPRECATIONS is considered the instruction to run for the if. So the block following is executed unconditionally. commit a6365ee7a9d657cfc388c0ae5dfedea675a200b5 Author: Xavier Claessens Date: 2012-06-04 19:28:08 +0200 Examples: disable single include https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 05287db8a5d4557435356df0fcd6e1cf202e6503 Author: Xavier Claessens Date: 2012-05-30 11:34:17 +0200 Add single-include #error in all headers included from telepathy-glib(-dbus).h https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit d95d44bd327d96c5936deee1a3d970bcf27f29d0 Author: Xavier Claessens Date: 2012-05-30 13:37:53 +0200 Consider proxy-subclass.h as a meta header That header can be included directly, so proxy.h would #error. https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 2997e979daa03a66a3063df2b785361b193f07af Author: Xavier Claessens Date: 2012-05-30 13:36:17 +0200 Example extensions: include global header https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 6342f7890a21ac245bed5c90e957eaa4b73af4a3 Author: Xavier Claessens Date: 2012-05-30 13:34:17 +0200 Examples: do no use message-internal.h https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit f91d0476422666818bc2a61521406e9006b60eca Author: Xavier Claessens Date: 2012-05-30 11:35:01 +0200 define _TP_COMPILATION in gir scanner Otherwise upcoming single-include #error will break the scanner https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 4acfebcc2020de2376eac55787b0b6f0747ca607 Author: Xavier Claessens Date: 2012-05-30 12:14:58 +0200 meta-headers: #define _TP_IN_META_HEADER for future single-include guards https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit b3d0c00e584c5b97b79939ed5a699379a8bcd961 Author: Guillaume Desmottes Date: 2012-06-05 10:46:34 +0200 text-mixin: use versioned deprecation macros https://bugs.freedesktop.org/show_bug.cgi?id=50712 commit 1aba6b49919a9ac68671fc49a525e48ccfa75c57 Author: Guillaume Desmottes Date: 2012-06-05 10:44:57 +0200 Ignore deprecations in TP_BASE_CONNECTION_ERROR_IF_NOT_CONNECTED This macro is now implemented using in tp_base_connection_check_connected() which is annotated with _TP_AVAILABLE_IN_UNRELEASED, but we shouldn't raise an error if app don't want to use 0.20 API yet. https://bugs.freedesktop.org/show_bug.cgi?id=50712 commit 1fea0da192332a8856e01b62a0d6c30a420220d4 Author: Simon McVittie Date: 2012-05-04 16:45:13 +0100 TpConnectionManagerProtocol: deprecate in favour of TpProtocol commit 108d7eeed14dc64c6d3a3c16701658b8553d7270 Author: Simon McVittie Date: 2012-05-04 16:47:13 +0100 Deprecate tp_list_connection_managers commit d9a08300e0559a90ed9853665e0d92b783b6dbe4 Author: Xavier Claessens Date: 2012-06-04 14:30:48 +0200 Examples: Stop using tp_connection_manager_protocol_* They are soon to be deprecated commit 6d179e6e6ead222f7d8c1b0f3e16a30571014303 Author: Xavier Claessens Date: 2012-06-04 14:30:28 +0200 Examples: Stop using tp_list_connection_managers() It is soon to be deprecated commit c31f0ea8cd559442fab46d1c82077dde457633df Author: Xavier Claessens Date: 2012-06-04 15:15:25 +0200 Fix typo making gtkdoc fail commit 000329f27eed1fd13d7499ac2851583c778659f9 Author: Xavier Claessens Date: 2012-06-04 14:58:30 +0200 Fix regression in unit tests The bug was introduced in commit 97755a8cef146519f688054d1bafe22f40bc17ff commit 34c3c06a6d37ca0ec7aad18500e7695624fb3316 Author: Xavier Claessens Date: 2012-06-04 13:54:19 +0200 NEWS commit 7bb3148850a70ff1d826792fab611dc7e5c17aad Author: Simon McVittie Date: 2012-05-04 16:47:49 +0100 Compile all examples with TP_SEAL_ENABLE The only changes needed were in extended-client.c. commit 0952f8d1ab6ec5735fb74243a3adfffbf2b81cd0 Author: Simon McVittie Date: 2012-05-07 14:11:44 +0100 TpBaseConnection: seal struct fields commit 3a0ec556a6819d2ca1945b1def4dbacb534f0053 Author: Simon McVittie Date: 2012-05-04 16:45:44 +0100 TpConnectionManager: seal struct fields and do not document them Bug: https://bugs.freedesktop.org/show_bug.cgi?id=17112 commit cacba6db63a23df79f67eb149cedecfe1af052e2 Author: Simon McVittie Date: 2012-05-04 16:41:21 +0100 TpConnectionManagerParam: seal struct fields We have accessors for all of them, and the GValue is going to be a problem as we move towards GVariant. commit 1e9f3817245a25daa2c5829210f7170bca680007 Author: Simon McVittie Date: 2012-05-04 16:40:30 +0100 TpProxy: seal struct fields They were officially already private. commit a4e63aa59420a80ce6c3227c048f4aafe0359c1b Author: Simon McVittie Date: 2012-05-04 16:39:59 +0100 Add _TP_SEAL, controlled by TP_DISABLE_DEPRECATED or TP_SEAL_ENABLE commit 97755a8cef146519f688054d1bafe22f40bc17ff Author: Simon McVittie Date: 2012-05-07 14:08:50 +0100 Use accessors rather than accessing TpBaseConnection fields directly commit 5f90a8dd35be28392615de7ba15f1d552ea5c477 Author: Simon McVittie Date: 2012-05-07 14:02:45 +0100 TpBaseConnection: add method accessors for struct fields commit aa7b5e8d093c3224143659302af38eb286c94e5e Author: Xavier Claessens Date: 2012-06-01 18:30:48 +0200 Rename _tp_contact_connection_invalidated to _disposed That function is called from TpConnection::dispose, not when invalidated https://bugs.freedesktop.org/show_bug.cgi?id=49373 commit d426569b302164130ad97aa44c804c1347e70f74 Author: Xavier Claessens Date: 2012-06-01 17:26:59 +0200 TpConnection: Fix leaked result when preparing contact-list feature https://bugs.freedesktop.org/show_bug.cgi?id=49373 commit 32c94d6df1041d3428effa555979432c04dfad69 Author: Xavier Claessens Date: 2012-06-01 17:25:22 +0200 Small coding style fix https://bugs.freedesktop.org/show_bug.cgi?id=49373 commit 7aeafd996d5623a781e564f3ae3d485a6ee3a202 Author: Xavier Claessens Date: 2012-06-01 17:17:42 +0200 TpConnection: remove check for CONTACTS interface when preparing roster In tp_connection_list_features() it is already said that CONTACTS iface is required to prepare CONTACT_LIST feature. So the extra check is useless. https://bugs.freedesktop.org/show_bug.cgi?id=49373 commit 61971a97a59783b5a3eb6b918370c7a129224f93 Author: Xavier Claessens Date: 2012-05-23 10:37:47 +0200 NEWS commit 34e26d7b904443d8421c606923aa01728fb8898c Author: Xavier Claessens Date: 2012-05-18 20:02:12 +0200 Deprecate tp_account_parse_object_path() https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit 951c6fcf9292f451d3bd977dc90a01444db2c9f5 Author: Xavier Claessens Date: 2012-05-18 20:03:39 +0200 Deprecate tp_account_ensure_connection() https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit 947b96fd587d13f657077f7e3479fb135bf38858 Author: Xavier Claessens Date: 2012-05-16 13:15:12 +0200 tp_simple/automatic_client_factory_new: allow NULL TpDBusDaemon https://bugs.freedesktop.org/show_bug.cgi?id=49372 commit e54e1dd4fd5a09fd02d1cbf278eb615c1edeed36 Author: Xavier Claessens Date: 2012-05-22 16:38:09 +0200 Fix include path to work in folks copy commit 5783bcb85fce37e06851fe370a54e3d91857a426 Author: Xavier Claessens Date: 2012-05-15 16:12:14 +0200 Add tp_simple_client_factory_upgrade_contacts_async/finish Use it everywhere we can commit 3103f894f39be73f755d999e91ef43d7f3488a6f Author: Xavier Claessens Date: 2012-05-15 15:48:13 +0200 Add tp_simple_client_factory_ensure_contact_by_id_async/finish commit 153c9d799b39440f5d7bcbfa23757c6316f3f753 Author: Xavier Claessens Date: 2012-05-14 13:44:24 +0200 Deprecate tp_connection_parse_object_path() We have tp_connection_get_protocol_name() and tp_connection_get_connection_manager_name() now. commit 6afc5819e15200f7cf0970bad982ea245dca4327 Author: Xavier Claessens Date: 2012-05-13 15:26:09 +0200 Fix ContactList not having avatars This is a regression introduced by 22a4438161874e36e27282bd3d24a909f4b16f70, because ContactList does not go through the slow path. commit b3aa3ffb6683d92ccc4eeae8f8cb9c11e8eb4575 Merge: d4abcf399 149927722 Author: Simon McVittie Date: 2012-05-11 17:02:34 +0100 Merge branch 'telepathy-glib-0.18' into vala commit d4abcf3999ee5141805ab70bf925983b336d49f3 Author: Simon McVittie Date: 2012-05-11 16:49:56 +0100 Hide GList-based contact info typedefs from g-ir-scanner Recent vapigen versions don't like the result. This means we can revert the version that adds stub doc-comments for them, which seems to confuse gtk-doc. Good thing we don't have several duelling C-and-comment parsers or anything... Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49637 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 9e087fa03ff6c6b1cf6405750dd5561b42831cab Author: Simon McVittie Date: 2012-05-11 16:31:55 +0100 Require valac 0.16 valac 0.14 (the default valac in Debian testing/unstable at the moment) isn't new enough to understand GBytes. If your valac is too old, use: ./configure ... VALAC=/usr/bin/valac-0.16 VAPIGEN=/usr/bin/vapigen-0.16 Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 14992772277269299373386d68a632a5968ad511 Author: Colin Walters Date: 2012-05-11 15:53:51 +0100 vala: Fix srcdir != builddir We need to look for the .metadata file in the source directory, otherwise we silently generate a binding with a namespace of "Tp", not "TelepathyGLib". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49802 Reviewed-by: Simon McVittie commit fc6d558a71bfbe97362aade4a0fe8598b0ad067e Author: Colin Walters Date: 2012-05-11 15:53:51 +0100 vala: Fix srcdir != builddir We need to look for the .metadata file in the source directory, otherwise we silently generate a binding with a namespace of "Tp", not "TelepathyGLib". Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49802 Reviewed-by: Simon McVittie commit 7c668dad51a51500d47a19ae5ea3b4ea68e78456 Author: Ray Strode Date: 2012-05-11 10:28:26 -0400 Mark GList typedefs non-introspectable They end up causing under-defined entries in the gir output which makes vapigen choke. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49637 Reviewed-by: Simon McVittie commit dacdc30b38a39ba2500ecfeb223bfb83e464340a Author: Xavier Claessens Date: 2012-05-11 16:14:15 +0200 _dup_contact_by_id_async() and _upgrade_contacts_async(): drop custom implementation Simplify them by directly calling deprecated APIs, custom implementation suffers the same problem with avatar than fixed in previous commit commit 143b5ad6c4c9e17fff22652eaf93a45eb54b9596 Author: Xavier Claessens Date: 2012-05-11 16:17:03 +0200 Add regression test for avatar data problem commit 22a4438161874e36e27282bd3d24a909f4b16f70 Author: Xavier Claessens Date: 2012-05-11 14:08:03 +0200 TpContact does not always request avatar If AVATAR_TOKEN was already prepared and we upgrade to have AVATAR_DATA, the avatar won't be requested commit ae3ebc3bb9250d8cf7631bddba7328d154d54733 Author: Simon McVittie Date: 2012-05-10 19:06:17 +0100 Include tp_account_request_unset_parameter in documentation Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49735 commit 203515cea77126c5a1b7d6d8cfc2ae372d34ab08 Author: Simon McVittie Date: 2012-05-10 19:02:30 +0100 connection-contact-list: don't crash if no Contacts This situation would be stupid, but we still shouldn't crash. Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49735 commit 792f37a447e49accfef9c66d8e5e655cdaea234f Author: Simon McVittie Date: 2012-05-10 19:00:26 +0100 tp_connection_dup_contact_by_id_async: don't crash without Contacts Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49735 commit 34e4109a86992b88d0cc879618e892f3417cb312 Author: Simon McVittie Date: 2012-05-10 18:53:08 +0100 tp_connection_upgrade_contacts_async: fall back to old API if no Contacts Previously it would just crash with an assertion failure, because contacts_bind_to_signals() relies on the Contacts interface. Also test that case in contacts-slow-path.c. Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49735 commit efba4e4a7d18bef133e3492e2ef60881788a0413 Author: Jonny Lamb Date: 2012-05-11 10:23:07 +0100 channel-manager: include defs.h for the deprecation macros Signed-off-by: Jonny Lamb commit f28758a1337c3ad948845b4b03629afaebb9b894 Author: Jonny Lamb Date: 2012-05-10 18:35:01 +0100 channel-manager: deprecate emit_new_channels Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47942 Signed-off-by: Jonny Lamb commit 8e87e0eeabeefb59ac6f0869dda86320f035bdd7 Merge: 9e6ee0fc8 253b2ee2e Author: Jonny Lamb Date: 2012-05-10 15:37:10 +0100 Merge branch 'account-request-47100' Reviewed-by: Guillaume Desmottes commit 9e6ee0fc8a5f5e07aa006cfc832a469735484849 Author: Xavier Claessens Date: 2012-05-10 13:50:57 +0200 Deprecate tp_connection_hold_handles() Holding handles is not needed with Connection Managers having immortal handles (any Connection Manager using telepathy-glib >= 0.13.8). Other Connection Managers are considered deprecated, clients wanting to still support them should continue using this deprecated function. commit 80da6b4bcff9068bed0aa7da2c3eb9cd54b31ba1 Author: Xavier Claessens Date: 2012-05-10 13:22:53 +0200 Deprecate tp_connection_request_handles() Everywhere we need an handle, we can give an ID nowadays. commit 2716a4c17f85d7c1ecf5a5b881e900cd4d4ffea3 Author: Xavier Claessens Date: 2012-05-10 12:37:05 +0200 Deprecate tp_connection_get_contact(_list)_attributes Contact attributes is an internal concept that should not appear in our API. commit 4dfca790804fff5411c316c34cca3494c44b340b Author: Xavier Claessens Date: 2012-05-10 11:14:25 +0200 Deprecate tp_handle(s)_ref/unref, tp_handle(s)_client_hold/release and tp_connection_unref_handles() They are no-op now, so we can safely remove them all commit b09ac85e4056cfe6c4dc27bfdcf7f6b80f7e3538 Author: Simon McVittie Date: 2012-05-10 13:09:26 +0100 tp_message_mixin_init_dbus_properties: only conditionally implement ChatState Also check that Text and Messages are implemented. This fixes a regression in 0.19.0 where applying MessageMixin to a channel without ChatState, like those in telepathy-rakia, would cause a critical warning. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit 253b2ee2e1eb8ef631e7d0049907576e04acaa2e Author: Jonny Lamb Date: 2012-05-10 11:44:38 +0100 future-account: rename to TpAccountRequest Signed-off-by: Jonny Lamb commit 10bade958c71c7e2b69dac0667b224cd9ff436c6 Author: Xavier Claessens Date: 2012-05-10 11:00:31 +0200 test-account: connection set on account must exist TpAccount now listen to invalidated signal on its connection, and if the service does not exist TpConnection will be invalidated. commit 53cf9df185364f552d60415de885936ed6a51b81 Author: Xavier Claessens Date: 2012-05-09 19:06:39 +0200 Silent warning about some used deprecated symbols commit 5d616b7d39c9c9a7af4d31ceecd903f5d968bb0c Author: Xavier Claessens Date: 2012-05-09 18:51:40 +0200 bump nano-version commit b0c8eef1b36ec8e765eac5bec0ee3d2de4d1f478 Author: Xavier Claessens Date: 2012-05-09 16:04:49 +0200 Release 0.19.0 commit b1f9a33b6952a8be7eb8c5fa1ba899546487cd9e Author: Xavier Claessens Date: 2012-05-09 16:05:59 +0200 NEWS commit 2745e3d2d7a259aaafeaeece10576202e09c74cd Author: Xavier Claessens Date: 2012-05-09 18:02:18 +0200 Update to telepathy-spec 0.27.0 commit ccffb823b4694a108c0f6a0d05707ad71a5e8870 Author: Xavier Claessens Date: 2012-05-09 18:26:21 +0200 ChatState: Add the missing _TP_AVAILABLE/DEPRECATED_IN_0_20 commit 897cfccb89322cce4fa077a339739ec7d33fb26e Author: Xavier Claessens Date: 2012-04-30 13:29:37 +0200 Add comment explaining what it means if feature->prepare_async is NULL https://bugs.freedesktop.org/show_bug.cgi?id=49215 commit 5cc59603b4747632c53c4cafd1dfa39079281e10 Author: Xavier Claessens Date: 2012-04-30 13:29:03 +0200 Add ChatState unit tests https://bugs.freedesktop.org/show_bug.cgi?id=49215 commit 0d47abe5e83cc44fdea982823d05cd7bd29ed6fe Author: Xavier Claessens Date: 2012-04-30 13:28:26 +0200 Implement ChatState in test echo channel https://bugs.freedesktop.org/show_bug.cgi?id=49215 commit 0a1cd9095c51fd7dbc2911fed48bd0da6baca604 Author: Xavier Claessens Date: 2012-04-30 13:22:42 +0200 TpMessageMixin: add helpers to implement ChatState https://bugs.freedesktop.org/show_bug.cgi?id=49215 commit 9544a1997eed04aecef4ed98ddf776c2759b28b9 Author: Xavier Claessens Date: 2012-04-27 14:32:10 +0200 Move ChatState to TpTextChannel API on TpChannel is now deprecated but still used to implement the corresponding API on TpTextChannel. https://bugs.freedesktop.org/show_bug.cgi?id=49215 commit 76205ffed60d37618e04c479299c09ee497dcd15 Author: Xavier Claessens Date: 2012-05-08 18:07:47 +0200 Deprecate tp_connection_get_contacts_by_id/handle() They are replaced by proper _async() API commit 305495dc6c871c92e6432d95811762ecaa8a19cf Author: Xavier Claessens Date: 2012-05-08 18:45:47 +0200 account-channel-request test: do not use soon to be deprecated API _by_id_async() needs CONTACTS iface on the connection, so the unit test must be using TpTestsContactsConnection. commit 1bcea5378f204f29b08a3b4d031c90459b414a4a Author: Xavier Claessens Date: 2012-05-08 18:44:52 +0200 Examples: do not use soon to be deprecated APIs commit e60b0466429cb381d0cd3e52921c4d0956d36a97 Author: Xavier Claessens Date: 2012-05-08 18:04:04 +0200 TpConnection: use tp_connection_upgrade_contacts_async() ContactList API was already depending on newer spec, so it's fine. commit ac3538ae8029988458947efda467bc035cf3d3c8 Author: Xavier Claessens Date: 2012-05-08 15:27:39 +0200 Add tp_connection_upgrade_contacts_async/finish This replaces tp_connection_upgrade_contacts() but with a proper async API. commit 89ee88d7a534502f6dc73653f4407098eb835d3f Author: Xavier Claessens Date: 2012-05-08 14:30:06 +0200 Add tp_connection_dup_contact_by_id_async/finish This replaces tp_connection_get_contacts_by_id() but for single id and with a proper async API. merge by_id commit a9c13065262e3b679d537b8240971a88909ddacf Author: Xavier Claessens Date: 2012-05-08 11:45:26 +0200 contacts-mixin: Implement GetContactByID commit 38151925c854b2051ddf6118d882457c806c897f Author: Xavier Claessens Date: 2012-05-08 11:12:28 +0200 Update Connection.Interface.Contacts spec commit 542bbe9e034e63ba0ffc54d703367689bdc061da Author: Guillaume Desmottes Date: 2012-05-04 09:44:10 +0200 _tp_tls_certificate_rejection_new: explicitely ref sink @details commit 5ce4b947776aa2e488d2a7e72ac22d733ec4830e Author: Guillaume Desmottes Date: 2012-05-04 09:20:02 +0200 tp_tls_certificate_rejection_get_details: document Returns commit cc0e38eed5ef3139e92d7e9f5feeec9d351cb236 Author: Guillaume Desmottes Date: 2012-05-04 09:18:48 +0200 Move low level certificate API out of the doc commit f4820fdb1715dbef62a839b63c9cd49ec3a285e1 Author: Guillaume Desmottes Date: 2012-05-03 14:27:50 +0200 Version-annotate TLS certificate API commit 0d6429043efc817233dfc2b0f083f3feec4ce55a Author: Guillaume Desmottes Date: 2012-05-03 14:27:50 +0200 Use TP_ERROR instead of TP_ERRORS commit a1dfd77a72be0b0ad59121ebb5c27c8b6faa280c Author: Guillaume Desmottes Date: 2012-05-03 10:17:18 +0200 invalid the certificate if its state is invalid commit c1df57b9955393f7c4ef8b3d145b6fe70d2a1a0f Author: Guillaume Desmottes Date: 2012-05-03 09:56:49 +0200 Use TP_NUM_TLS_CERTIFICATE_REJECT_REASONS commit f7fdbf7336f5d7b8a12ac67448baff6f161b43f4 Author: Guillaume Desmottes Date: 2012-05-03 09:54:57 +0200 tls-certificate-rejection: remove GError coding style check workaround commit 05b3d1e1f9d5c63d0d01a9cecc3f04cae3191605 Author: Guillaume Desmottes Date: 2012-05-03 09:54:13 +0200 check-c-style: don't check if GError are initialized It just leads us to writing insanity like: GError *error /* badger */; commit 7f880d8ce0f605434929992ea429523ef586627b Author: Guillaume Desmottes Date: 2012-05-03 09:51:04 +0200 Don't include tp-cli header in tls-certificate.h Users should just rely on the high level API. commit 71536658de65fecc09ef7c905b51b86288152131 Author: Guillaume Desmottes Date: 2012-04-23 10:32:33 +0200 Use GBytes to store the cert data commit adddf79bf94450f3b9a6bd797093df7d620d0feb Author: Guillaume Desmottes Date: 2012-04-20 15:08:50 +0200 allow parent to be NULL Needed to be able to port the empathy-tls-test without adding mock objects. tp_tls_certificate_new() still checks that a parent is passed so that shouldn't affect 'normal' users of this API. commit 2304df9563ba80ae717bf6220535cc645a6c9fb8 Author: Guillaume Desmottes Date: 2012-04-19 16:03:20 +0200 add tp_tls_certificate_rejection_raise_error() commit bf363ee4d8a1c6c20c0a80708655dd2872ae22bf Author: Guillaume Desmottes Date: 2012-04-19 15:33:32 +0200 Use TpTLSCertificateRejection commit 5abd182c71d56445f303c04338a1e0a2167832de Author: Guillaume Desmottes Date: 2012-04-19 15:33:16 +0200 add TpTLSCertificateRejection commit 3320966b2adc98407e488c34e6e7342830ec11c7 Author: Guillaume Desmottes Date: 2012-04-19 15:32:45 +0200 add tls-certificate to the doc commit 50a721045a77424bed8c53434047901a2d0c2fc5 Author: Guillaume Desmottes Date: 2012-04-19 13:53:19 +0200 test tp_tls_certificate_rejected_cb's code path if there is no rejections commit c40c8cf0548c9800500035b7890ee07976a5ede7 Author: Guillaume Desmottes Date: 2012-04-19 12:50:41 +0200 Use a GVariant to return rejection details commit f45d621d4de4324689551112f7f56e9e2f205786 Author: Guillaume Desmottes Date: 2012-04-19 12:01:09 +0200 tp_tls_certificate_add_rejection(): takes a GVariant instead of a GHashTable commit 9be7554a63ff6a4f1039cc84d80547561d0225d5 Author: Guillaume Desmottes Date: 2012-04-19 11:50:46 +0200 account: use _tp_asv_from_vardict() commit 9f4260f19ef4344c75eeaefb799603a9dfc360fc Author: Guillaume Desmottes Date: 2012-04-19 11:50:26 +0200 base-connection: use _tp_asv_from_vardict() commit 55cb32b5bd54e8f2ca59f62c13b7ab9514ae10bd Author: Guillaume Desmottes Date: 2012-04-19 11:45:43 +0200 add _tp_asv_from_vardict() commit 268c5a5e7d4de7bde8dd41cf6330d082176eb7ce Author: Guillaume Desmottes Date: 2012-04-19 10:20:28 +0200 Test if cert is invalidated when its parent is commit 467faee1b12408f92d25b36ad00580136acfecd3 Author: Guillaume Desmottes Date: 2012-04-18 13:30:08 +0200 test tp_tls_certificate_reject_async() commit fe57164130e2da969d9e73f26f213a5e53276514 Author: Guillaume Desmottes Date: 2012-04-18 13:29:43 +0200 tp_tls_certificate_add_rejection(): allow @details to be NULL commit 2c452279528067c0cb360a41016efee2219dc663 Author: Guillaume Desmottes Date: 2012-04-18 13:02:18 +0200 test tp_tls_certificate_accept_async() commit 16c054d58c2748435c45e44924a44063ad57d439 Author: Guillaume Desmottes Date: 2012-04-18 12:55:53 +0200 Test TP_TLS_CERTIFICATE_FEATURE_CORE and props commit a380793b20a04cf9d6e40c23c3eaff227509162b Author: Guillaume Desmottes Date: 2012-04-18 12:39:21 +0200 tls-certificate: add accessors I didn't add one for the 'parent' property because it's more of an implementation detail and a get_parent() method would look weird. commit bb29e6e5e47ad09b77ae2fe6c75f22f96d1758f5 Author: Guillaume Desmottes Date: 2012-04-18 11:37:16 +0200 add test-tls-certificate commit 7b906d5254a92064e9036f8bd1db8e13381f22c3 Author: Guillaume Desmottes Date: 2012-04-18 11:57:29 +0200 Pass the right value as bus-name property commit 8f582d1207b3bd2e1ee253cb5ab2d409a67feb4f Author: Guillaume Desmottes Date: 2012-04-18 11:20:05 +0200 add tls-certificate Copied from Gabble, I just re-namespaced it. commit fa62f763fb25d82a67377f43c6bb8b01f2460bb4 Author: Guillaume Desmottes Date: 2012-04-18 11:04:26 +0200 introspection.am: add tls-certificate commit b4b23ba4aeb534eee98b4a08f834c25ed1bfb67d Author: Guillaume Desmottes Date: 2012-04-18 10:48:28 +0200 tp_tls_certificate_new: document @error commit c38ed70d3b35cc8f3da81d932a7b74a8705394bf Author: Guillaume Desmottes Date: 2012-04-18 10:45:29 +0200 Fix and add mising Since annotation This is not going to be included in a 0.13.x release :) commit 2d40786ff20f1399bdfe3e3f2e43f8258cf9fa91 Author: Simon McVittie Date: 2010-12-15 13:16:42 +0000 TpTLSCertificate: allow several rejection reasons to be queued up commit c39eff9d8fdbb0de2235440d159d2d6923d0f674 Author: Simon McVittie Date: 2010-12-15 13:00:00 +0000 TpTLSCertificate: track the signalled rejection reason(s) commit 43978342cf1925fac3eca5cb2e4d235334228a76 Author: Simon McVittie Date: 2010-12-15 12:13:54 +0000 tp_tls_certificate_reject_async: allow a D-Bus error name to be specified commit d38cc3ca2eeaa18d77bfa9551fd594e858922a81 Author: Simon McVittie Date: 2010-12-15 12:13:32 +0000 Track changes to TpTLSCertificate:state commit deae4edfcad3cca0d4b70b7eff5abe40d3d23665 Author: Simon McVittie Date: 2010-12-15 11:52:27 +0000 Change the range of TpTLSCertificate:state to [0, 2**32) It comes from D-Bus, so we can't guarantee that it takes one of the known enum values. commit 5f104c4117b8e3216c6bcba14a9ed2af4ae23589 Author: Simon McVittie Date: 2010-12-15 11:51:15 +0000 Document TpTLSCertificate:state commit f2539f9ded31fe99b384971d1e3c3d86ac95d0e8 Author: Simon McVittie Date: 2010-12-15 11:44:54 +0000 TpTLSCertificate: be subordinate to a channel or connection commit a47bc47e2e04962ef07f59735c5f9b392b04a7ae Author: Simon McVittie Date: 2010-12-14 17:01:01 +0000 Document TpTLSCertificate commit 62e153ad10ad53868f5fca3d83e3e11bb11287b9 Author: Simon McVittie Date: 2010-12-14 16:42:30 +0000 TpTLSCertificateClass: add a small amount of ABI padding commit 66ce3c8fd454fadbb5a9316dd3015c78366c8784 Author: Simon McVittie Date: 2010-12-14 16:13:30 +0000 Include TpTLSCertificate in the documentation commit 8ef7fe360e0e2a8b093b2f33ebe92dcdf4a63e91 Author: Simon McVittie Date: 2010-12-14 15:44:11 +0000 TpTLSCertificate: use _tp_implement_finish_void for finish functions commit 379b918d1abd987738ca9b45de1f4f31f7e52257 Author: Simon McVittie Date: 2010-12-14 15:43:26 +0000 TpTLSCertificate: don't pass useless user_data through D-Bus calls self is the proxy being called, so a ref is held for the duration of the call anyway, so taking a weak ref is unnecessary. commit de4686f4f669299f66dca21fe3b1449a0dabc238 Author: Simon McVittie Date: 2010-12-14 15:41:55 +0000 tp_tls_certificate_new: don't debug on error It would have crashed when error == NULL, and in any case the caller can reasonably be expected to do something about any errors. commit 694563fee1ff738e2c2fed14555c1bd2f15a9c34 Author: Simon McVittie Date: 2010-12-14 15:41:19 +0000 reject_reason_get_dbus_error: streamline boilerplate with a macro commit 5ebb3968072da90d83d9392aa36f8027013683d3 Author: Simon McVittie Date: 2010-12-14 15:41:02 +0000 TpTLSCertificate: remove unwanted semicolon from G_DEFINE_TYPE commit af1f77c1ca8babdefaece7a5e85afc88ae532c1b Author: Simon McVittie Date: 2010-12-14 15:40:48 +0000 TpTLSCertificate: use N_PROPS, not the misleading LAST_PROPERTY This is one beyond the last property. commit 2583fd739e8bf6be746ad310b7c5a3ce94c9b1cb Author: Simon McVittie Date: 2010-12-14 15:40:17 +0000 tls-certificate.c: don't include errno.h, no longer needed commit ec888541591f7e2f5264e77493a49c3b287f5779 Author: Simon McVittie Date: 2010-11-26 15:35:39 +0000 Generate TpTLSCertificate code to have that object as first argument commit eefb6136fbd3abf5c0aebb9d6ad43e6351074bd4 Author: Simon McVittie Date: 2010-11-26 15:24:56 +0000 TpTLSCertificate: have a CORE feature instead of our own prepare method commit caeba3dc1d027a9c90d77ac5ac6d00e9997365af Author: Simon McVittie Date: 2010-11-26 15:17:32 +0000 Add TpTLSCertificate, minimally adapted from Empathy - re-namespaced - tp_tls_certificate_init_known_interfaces() added - GNUTLS-dependent method empathy_tls_certificate_store_ca removed commit 6c557efaaae94f8ebf66c5af2640d43c92cb72f7 Author: Simon McVittie Date: 2010-12-14 15:30:10 +0000 Add TLS debug flag commit 14b822a2e3ad3a66d3f0025013f134e513fc2cc2 Author: Simon McVittie Date: 2010-11-26 14:25:20 +0000 Do minimal code-generation for TpTLSCertificate commit a51964b574c9007b2308843a45d4b040bd3a73bd Author: Xavier Claessens Date: 2012-04-30 15:10:40 +0200 TpAccount: ensure connection is set to NULL before it unref all its contacts This is to let a chance to applications to properly remove all contacts at once instead of getting weak notify on them. https://bugzilla.gnome.org/show_bug.cgi?id=675141 commit b79e36c1d65a59a44de20264224b5bc05a2934c1 Author: Jonny Lamb Date: 2012-05-09 10:41:23 +0100 future-account: add warn_unused_result attribute for create_account_finish Signed-off-by: Jonny Lamb commit d755aab78c1572c5524b43380707359166f60e34 Author: Jonny Lamb Date: 2012-05-09 10:41:06 +0100 future-account: add missing colon in gtk-doc docs Signed-off-by: Jonny Lamb commit d9cd4d3fb69147d9f51fd762dbca7f9b6119971c Author: Jonny Lamb Date: 2012-05-09 10:40:56 +0100 future-account: add service property and setter Signed-off-by: Jonny Lamb commit 84e6c35146ce4749fe43743e22b25c4d35609c48 Author: Jonny Lamb Date: 2012-05-09 09:45:42 +0100 future-account: don't allow modifications if created/creating account Signed-off-by: Jonny Lamb commit 2618d12fe15e83c7dc427c46b1b4394c742e5c5a Author: Jonny Lamb Date: 2012-05-09 09:24:05 +0100 future-account: give display name on creation I decided to leave set_display_name() but decided against setter functions for protocol and CM name. Signed-off-by: Jonny Lamb commit 3c7d083ac43d42bafdc0b91d1c818a219acebb3d Author: Xavier Claessens Date: 2012-05-08 16:17:12 +0200 TP_VERSION_MIN_REQUIRED should be _TP_VERSION_CUR_STABLE by default That was a bug in glib we copied. commit 22105db79f4a5f9c46e0a53ca04f56a07a9fb6b4 Author: Jonny Lamb Date: 2012-05-08 11:45:20 +0100 future-account: add Since tags to all the API Signed-off-by: Jonny Lamb commit 6f64f59c7cb73b4a32fc7d0f06f121292f112517 Author: Jonny Lamb Date: 2012-05-08 11:41:34 +0100 simple-account: be sure to free the connection path Signed-off-by: Jonny Lamb commit f9c72a2ee021436c10f716d877cc1630f1e23dfa Author: Jonny Lamb Date: 2012-05-08 11:40:57 +0100 future-account test: don't bother getting Supersedes value We don't use it and we weren't freeing something properly before.. Signed-off-by: Jonny Lamb commit bd169925aa29a0bd5bd657447ad55d4381597551 Author: Xavier Claessens Date: 2012-05-07 23:50:24 +0200 add telepathy-glib/version.h to gitignore commit 822748c0769a57a485e909cc163ab4b1fc998524 Author: Xavier Claessens Date: 2012-05-04 09:18:46 +0200 TpChannel: MembersChanged's details does not always need contact-ids For removal-only signal, CM could omit it. commit b31c25dd8c52148cd4950a71b1cdffbacf21bef9 Author: Jonny Lamb Date: 2012-05-07 19:07:45 +0100 future-account: stop leaking a GArray Signed-off-by: Jonny Lamb commit 300598d142a66c168d6a609db9f9dff487620dec Author: Simon McVittie Date: 2012-05-07 18:23:40 +0100 Include channel-iface.h in telepathy-glib.h On master, this was already included via channel-factory-iface.h; on next, that no longer works. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49593 Reviewed-by: Jonny Lamb Reviewed-by: Xavier Claessens commit a5917159e0ce07af4a22895b513f7f7f7cb79cb4 Author: Jonny Lamb Date: 2012-05-07 18:53:57 +0100 future-account: fix typo Signed-off-by: Jonny Lamb commit 339c8260655fee98dbe03d9301e0384b18f62e03 Author: Jonny Lamb Date: 2012-05-07 18:53:02 +0100 future-account: fix docs for create_account_finish Signed-off-by: Jonny Lamb commit dc568bfd8af38d07f108b324fa2fbf26a786d353 Author: Xavier Claessens Date: 2012-05-07 18:56:11 +0200 TpChannel: fix typo when removing self handle from group fails This is now consistent with channel_destroy_cb() for example. The idea is if there is an error, but channel is invalidated anyway, there is no point in fallback to Close. commit e5e061e1c5b0ecbc1457a5792f7de017b3e1a431 Author: Simon McVittie Date: 2012-05-07 17:07:07 +0100 NEWS commit 8c275d9585df2575cbcc61b54ab74969baa10ea6 Author: Simon McVittie Date: 2012-05-07 16:49:10 +0100 Deprecate reimplementation of RequestHandles Gabble hasn't done this since 2009, and this function has been removed from the public API on 'next' (it interferes with separating tp_svc_* out of the main library). Reviewed-by: Xavier Claessens commit 1bc24d3ed03c22202a9628892f0e2dc1efa37f86 Author: Simon McVittie Date: 2012-05-04 16:36:10 +0100 Add _TP_DEPRECATED_IN_UNRELEASED, ..._FOR Reviewed-by: Xavier Claessens commit a95806d419ba88a57a1f5793e86bfe99a0d4dc02 Author: Simon McVittie Date: 2012-05-07 14:25:32 +0100 NEWS commit d83d5758b476146d6f5f2d4feb39c717395b155e Author: Simon McVittie Date: 2012-05-04 13:56:28 +0100 Documentation: recommend including meta-headers Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 83a388b0cf10dbbb8cec9c17f4255188dcd7f65c Author: Simon McVittie Date: 2012-05-04 13:55:43 +0100 All examples: follow the meta-header policy Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 1c1b1f93953f85bf7c6cec326f8952368908b062 Author: Simon McVittie Date: 2012-05-04 13:16:22 +0100 Add meta-header This includes all generated code, including the things that will be a separate library in 1.0. Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 5f347b0b78c4e8730b5434372cee37c0a7cb3246 Author: Simon McVittie Date: 2012-05-04 13:15:43 +0100 Include nearly all headers in telepathy-glib.h Exceptions: * dbus-daemon.h is included via dbus.h * debug-ansi.h is deprecated * extra-gtkdoc.h is not really a header * properties-mixin.h is deprecated * proxy-subclass.h is sufficiently low-level that API users should "opt in" * svc-*.h wil be in telepathy-glib-dbus.h * text-mixin.h is deprecated * verify.h is included via util.h Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 2d748f0e03ccf2117e46a4b31e9ad06a18f99fb4 Author: Simon McVittie Date: 2012-05-04 12:51:34 +0100 Define _TP_COMPILATION when compiling library and tests (but not examples) This will switch off single-inclusion checks. We don't want to use telepathy-glib/telepathy-glib.h within the library since it'll trigger mass recompilation whenever any header changes. For the examples, it seems acceptable to use the meta-header so that the examples will be exemplary. Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 5b9be38644d00f948d315cabf8f6e0df80ca33d9 Author: Simon McVittie Date: 2012-05-04 12:48:50 +0100 Mark all -internal headers as /**/ This is a nicer way to get them out of the gtk-doc than listing them all in docs/reference/Makefile.am. (We still need to mention proxy-introspectable.h there, though - it's private from gtk-doc's point of view, but not gobject-introspection's.) Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit ed4ed83ec28ff130afbf28c5c4dc8f76614bccc3 Author: Simon McVittie Date: 2012-05-04 12:19:19 +0100 Add multiple-inclusion guards to generated client-side code Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49384 commit 09ece4e16b3a8b99d92a9f48610d92949edfa732 Author: Jonny Lamb Date: 2012-05-07 13:50:10 +0100 future-account: check we have AM, CM, and protocol in constructed Signed-off-by: Jonny Lamb commit 00fed1ec56499e7a93c8d9c7c0a56fa101b24416 Author: Jonny Lamb Date: 2012-05-04 12:23:46 +0100 future-account: make sure colons are present after annotations Signed-off-by: Jonny Lamb commit 84dce18673e185290dcc766b187aa37bff7d6937 Author: Jonny Lamb Date: 2012-05-04 12:22:53 +0100 future-account: turn :parameters and :properties into an a{sv} GVariant Signed-off-by: Jonny Lamb commit 9829e860a57cf7e9bf83e91f0a7653ca69025bfe Author: Jonny Lamb Date: 2012-05-03 15:02:57 +0100 future-account: constructed should chain_up first Signed-off-by: Jonny Lamb commit 7023cc0e002720b25f91079fd09ac01beed48e50 Author: Jonny Lamb Date: 2012-05-03 15:01:38 +0100 future-account: lose our ref to the account manager Signed-off-by: Jonny Lamb commit 5e30f62e70787c5db6502f70c7b805b259eaaf39 Author: Jonny Lamb Date: 2012-05-03 14:59:39 +0100 future-account: function definition args should be one-per-line http://telepathy.freedesktop.org/wiki/Style?action=diff&rev1=22&rev2=23 I didn't know this had changed over three years ago. Signed-off-by: Jonny Lamb commit e574214c27179b6bf52855ea4feb6fc7fa4fed72 Author: Jonny Lamb Date: 2012-05-03 14:53:29 +0100 future-account: _new functions should be (transfer full) Signed-off-by: Jonny Lamb commit 871bf9c8d2f622d0604d3017ae742f5ef51b3d72 Author: Jonny Lamb Date: 2012-05-03 14:52:33 +0100 introspection: allow future-account be introspected Signed-off-by: Jonny Lamb commit 234f01647a09e25743c79f0d65ad3863f614c8c6 Author: Jonny Lamb Date: 2012-05-03 14:50:40 +0100 future-account: remove dispose_has_run Signed-off-by: Jonny Lamb commit 036159424010216f58d43f156671736609a31104 Author: Jonny Lamb Date: 2012-05-03 14:49:49 +0100 future-account: version-annotate new symbols Signed-off-by: Jonny Lamb commit ef6fd0cdf0e8aafefd38b05da9f2063dfe896ed2 Author: Jonny Lamb Date: 2012-04-27 16:50:09 +0100 telepathy-glib.h: add future-account.h Signed-off-by: Jonny Lamb commit 69579a555535557d41202f2918cf1e3451d3349a Author: Jonny Lamb Date: 2012-04-27 16:49:58 +0100 future-account: add new_from_protocol Signed-off-by: Jonny Lamb commit 226414747dc89925f51f82985573613f0b91e9b5 Author: Jonny Lamb Date: 2012-04-27 16:25:02 +0100 protocol: add a _get_cm_name function and :cm-name property Signed-off-by: Jonny Lamb commit 3987baa5a05b7561cbfab17c1a667e0595f597a3 Author: Jonny Lamb Date: 2012-04-27 15:51:51 +0100 future-account: give a warning when creating the account again Signed-off-by: Jonny Lamb commit f1089e2afd634039ffc8a2f45e8dd932d4eec930 Author: Jonny Lamb Date: 2012-04-27 15:41:17 +0100 future-account: add set_avatar Signed-off-by: Jonny Lamb commit 22668ce0fbea88f57d1ce82dbccf7dadec45c125 Author: Jonny Lamb Date: 2012-04-27 15:38:24 +0100 future-account test: add more tests for the :properties GObject property Signed-off-by: Jonny Lamb commit 681a9ec11725b1f19a2fb71fd5e627cf61c2a8be Author: Jonny Lamb Date: 2012-04-27 15:35:31 +0100 future-account: don't bother will fallbacks for get_property This is what the default value argument of g_param_spec_new_* is for. Signed-off-by: Jonny Lamb commit c2b25d7ed22d154d983dc9cb997b303ce7083354 Author: Jonny Lamb Date: 2012-04-27 14:14:29 +0100 future-account: add add_supersedes function and :supersedes property Signed-off-by: Jonny Lamb commit 1f9a0ee2f6835bd10aa068e6d7d7593aa9d70e93 Author: Jonny Lamb Date: 2012-04-27 10:40:19 +0100 future-account: new account properties should be fully-qualified Oops! Signed-off-by: Jonny Lamb commit 5902ebc629bacc6080e5582f8f016e7be686aa27 Author: Jonny Lamb Date: 2012-04-27 10:05:41 +0100 future-account: add automatic presence and test it Signed-off-by: Jonny Lamb commit 96d2fc381e07f57161b10d7ed1da816add189ff6 Author: Jonny Lamb Date: 2012-04-27 09:48:19 +0100 docs: add TpFutureAccount to the docs Signed-off-by: Jonny Lamb commit 0b2132a33024bd6bcc253ec6b72c9dda9b838164 Author: Jonny Lamb Date: 2012-04-27 09:48:00 +0100 future-account: remove unused signals enum Signed-off-by: Jonny Lamb commit f9851e26af16c83df2a18dad1019046bf6202cf8 Author: Jonny Lamb Date: 2012-04-27 09:47:44 +0100 future-account: improve docs and fix FIXMEs Signed-off-by: Jonny Lamb commit 282a5314bd3c67be264295751c2f4893148e455d Author: Jonny Lamb Date: 2012-04-27 09:14:36 +0100 future-account: add _set_connect_automatically function and property Signed-off-by: Jonny Lamb commit 81d3a71c8043bf7892a7ebaa048c0297bfbec745 Author: Jonny Lamb Date: 2012-04-26 17:18:31 +0100 future-account: add set_enabled function and :enabled property Signed-off-by: Jonny Lamb commit 7955221c201193e7e1a6e41966009121c5424b2a Author: Jonny Lamb Date: 2012-04-26 17:00:33 +0100 future-account: add unset_parameter and test it Signed-off-by: Jonny Lamb commit 241acf6d9cd8f6f0b001d16e56269f7673cac69c Author: Jonny Lamb Date: 2012-04-26 16:51:17 +0100 future-account test: add a test for CreateChannel failing Signed-off-by: Jonny Lamb commit 625282d3428c5f19450fc22c3e60ca881c872c27 Author: Jonny Lamb Date: 2012-04-26 15:16:57 +0100 future-account test: add test for _create_account_async Signed-off-by: Jonny Lamb commit 72db0d4c167db8e1c0147418ee6aa0a06f910abe Author: Jonny Lamb Date: 2012-04-26 15:16:28 +0100 future-account test: register account manager and account services Signed-off-by: Jonny Lamb commit 6f387259e167080e30788934c2c05ab4f10437cb Author: Jonny Lamb Date: 2012-04-26 15:15:26 +0100 simple-account-manager: save CreateAccount parameters Signed-off-by: Jonny Lamb commit 0aa1bbd7d9081a48609e05dd2ab6885e30264919 Author: Jonny Lamb Date: 2012-04-26 13:04:46 +0100 future-account: add set_nickname Signed-off-by: Jonny Lamb commit a517f60eb8467fc5c7ed7de1e02b5d7306be5688 Author: Jonny Lamb Date: 2012-04-26 12:56:48 +0100 future-account: add create_{async,finish} functions Signed-off-by: Jonny Lamb commit 34752d004ced4ce4ac75e7ab0c601bf444bed864 Author: Simon McVittie Date: 2012-05-03 20:12:23 +0100 Revert "Add tp_contact_is_self()" This reverts commit aa611fb0084b0c94f5e3b3c9c7e5ae30b8556c67. We shouldn't release this until it's more reliable. Opens: https://bugs.freedesktop.org/show_bug.cgi?id=49443 commit 2f377dab66ef074497ff0630508535716d369cb7 Author: Simon McVittie Date: 2012-05-03 15:04:05 +0100 Use G_DEFINE_BOXED_TYPE for every boxed type except TpIntset TpIntset is a bit weird because of backwards compatibility with TpIntSet, so we can only replace that one on next. Reviewed-by: Xavier Claessens commit 595bf67a876ee69bf6aba5c9b083b882d1cda16d Author: Jonny Lamb Date: 2012-04-26 10:56:30 +0100 future-account: small documentation fixes Signed-off-by: Jonny Lamb commit 43f46c026068c4a150a1b819d71a2a6b38306327 Author: Jonny Lamb Date: 2012-04-26 10:54:52 +0100 future-account: add set_icon_name and test it Signed-off-by: Jonny Lamb commit 2cbb7ad58e270682a476e12012098ae6b97fb0e9 Author: Jonny Lamb Date: 2012-04-26 10:38:00 +0100 future-account: add :properties GObject property Signed-off-by: Jonny Lamb commit 4b26fe68ba9be14d887d4f0a728cf3d71fc85c7d Author: Jonny Lamb Date: 2012-04-26 10:14:26 +0100 future-account: start adding set_parameter functions _set_parameter is useful for introspection, but the _set_parameter_* functions are more useful when using C, and some of us are indeed still using C. Signed-off-by: Jonny Lamb commit 1231b08bd8720f2bf8e58d3a8c308c1baecc36cb Author: Jonny Lamb Date: 2012-04-25 19:23:35 +0100 future-account: add set_display_name Signed-off-by: Jonny Lamb commit 4e13f0c52ee32c22a69db28afc98a010c861c711 Author: Jonny Lamb Date: 2012-04-25 18:47:53 +0100 tests: add simple TpFutureAccount test Signed-off-by: Jonny Lamb commit 5bc3b939d8c7f21c3abae71091353b507a64da9a Author: Jonny Lamb Date: 2012-04-25 18:47:31 +0100 future-account: store account manager, manager, and protocol Signed-off-by: Jonny Lamb commit b304e203f8a781387523fcc1102c34963937a2ac Author: Jonny Lamb Date: 2012-04-25 18:02:01 +0100 future-account: add dummy object Signed-off-by: Jonny Lamb commit fd81730d9c9b79ddd165fb6b0f02268b72e0b811 Author: Xavier Claessens Date: 2012-05-03 15:05:10 +0200 channel.h: reorder functions per-feature commit 72514214fb4a0708f086951044b7cad293a5fa1c Author: Simon McVittie Date: 2012-05-03 13:08:46 +0100 Version-annotate tp_contact_is_self too commit d23ad5d02837f526d9ba804e7fb664725151a8b4 Merge: aa611fb00 59e580c56 Author: Simon McVittie Date: 2012-05-03 13:06:17 +0100 Merge branch 'deprecation' Reviewed-by: Xavier Claessens Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49400 commit 59e580c564711b194d3c0c8004cf8db195f06428 Author: Simon McVittie Date: 2012-05-03 12:13:43 +0100 Version-annotate recent API commit f524ee716e4e2fdb959c1dd28210a3a8dfc6cbfe Author: Simon McVittie Date: 2012-05-03 12:31:31 +0100 Fix computation of CUR_STABLE, PREV_STABLE for nearly-0.19 (0.18.999.1) commit feeb27e39d71594f70a26e0fa2ac25ffd0b12f2f Author: Simon McVittie Date: 2012-05-03 12:31:05 +0100 Fix defaults for TP_VERSION_MIN_REQUIRED, TP_VERSION_MAX_ALLOWED commit e02ae4591b92838a74c1f2040da83def31c874c6 Author: Simon McVittie Date: 2012-05-03 12:30:50 +0100 Fix earliest-required-version checking: I only went back to 0.16 commit 4c7be65d8823d2e61ace30f3e3aaf477dcd15569 Author: Simon McVittie Date: 2012-05-03 12:13:21 +0100 Add a _TP_AVAILABLE_IN_UNRELEASED macro for use in unmerged branches commit 5287659d2a9796c2bd95ad237050a2f87c6a2694 Author: Simon McVittie Date: 2012-05-03 12:12:57 +0100 Allow defs.h to contain UNRELEASED commit aa611fb0084b0c94f5e3b3c9c7e5ae30b8556c67 Author: Xavier Claessens Date: 2012-05-02 17:24:58 +0200 Add tp_contact_is_self() commit a685482d48addbb37e4bdf1da7db11139b9481dc Author: Simon McVittie Date: 2012-05-02 20:34:40 +0100 Deprecate the slow version of TpIntset iteration commit f62c4d0445542287bb620a7708c9652161c5c9db Author: Simon McVittie Date: 2012-05-02 20:34:15 +0100 tp_connection_dispose: use the fast version of int-set iteration There's no good reason why we want to iterate in order. commit 55c45e9b080a3d1ce08f3b9bb68629334b570601 Author: Simon McVittie Date: 2012-05-02 19:32:57 +0100 Deprecate TpIntSet, TpIntSetIter and TpIntSetFastIter commit e77bd67b1c51f0399c918754ed7f7ab227c986e1 Author: Simon McVittie Date: 2012-05-02 19:31:23 +0100 Get rid of the last few references to TpIntSet (it's now TpIntset) commit 7bffcf1b5047938fe50feed425323e51e4b6a217 Author: Simon McVittie Date: 2012-05-02 19:06:32 +0100 Emit deprecation warnings for TP_ERRORS commit 9aec808ae99f5b06c816943fc1648358af0d8294 Author: Simon McVittie Date: 2012-05-02 19:06:24 +0100 Stop using TP_ERRORS We deprecated this in 0.11. commit 2cc2520bcfa36c834dab111ebf41637bbfc8371f Author: Simon McVittie Date: 2012-05-02 18:49:08 +0100 Use _TP_DEPRECATED_IN_* for most deprecated functions Also make use of TP_DISABLE_DEPRECATED consistent: always wrap deprecated functions, and add deprecation decorators to any wrapped function. commit bf6922353b10e50b62ae7a26d9a727fe5f5bf763 Author: Simon McVittie Date: 2012-05-02 19:16:21 +0100 Ignore deprecation of TpChannelFactoryIface when calling its methods TpBaseConnection has to support it for backwards compatibility. commit 3f29d2ccefb1662e1859c05585bb73fe9289e21c Author: Simon McVittie Date: 2012-05-02 17:58:28 +0100 Add GLib 2.32-style deprecation macros commit 4a0739c2a00b833fdc3a312680686a87c49258a0 Author: Rohan Garg Date: 2012-05-02 22:07:40 +0530 Call add_ft_class with proper arguments Reviewed-by: Simon McVittie commit 103bea9443286ba589a636a240f1ead028c7bf66 Author: Guillaume Desmottes Date: 2012-04-30 15:56:10 +0200 test_supports_tube: don't leak the classes array https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit 1c43047cafffec3aedd5a73655d07773fd97262a Author: Guillaume Desmottes Date: 2012-04-23 16:30:39 +0200 Add tp_capabilities_dup_channel_classes_variant() https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit d4a47ca60fb39d2f733eba7326d5bd9faec69a93 Author: Guillaume Desmottes Date: 2012-04-25 10:28:24 +0200 _tp_asv_to_vardict: use _tp_boxed_to_variant() https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit 16ab7a71f5e2f3e51549a361be98484554c23025 Author: Guillaume Desmottes Date: 2012-04-25 10:21:14 +0200 add _tp_boxed_to_variant() https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit 4e142f577f0faa86096a90f90f5509805f776201 Author: Xavier Claessens Date: 2012-05-02 13:54:19 +0200 TpConnection: Deprecate _get_self_handle() New code should be using _get_self_contact() commit f81a0bd99be209c74a48b9c2b8101fd6fb596c40 Author: Xavier Claessens Date: 2012-05-02 13:53:22 +0200 channel-group.c: Allow using deprecated in the whole module That module is itself mostly deprecated and replaced by channel-contacts.c commit 58b6f88c53bb68d468f4cbdfdf25bb750300387f Merge: df950691f f3681d4dd Author: Simon McVittie Date: 2012-05-02 12:15:26 +0100 Merge branch 'telepathy-glib-0.18' Conflicts: NEWS commit f3681d4dddcfbb86525dcf2b9371231ad3681de5 Author: Simon McVittie Date: 2012-05-02 12:07:40 +0100 NEWS for 0.18 commit 759d4b5ff49e1f067ef6cf3cc71e2584d1067ed6 Author: Simon McVittie Date: 2012-05-01 13:14:04 +0100 Add `make clean-for-new-branch` commit df950691ff246bf556a1ee5ff59fdaac0f191437 Author: Simon McVittie Date: 2012-04-30 19:40:11 +0100 NEWS commit 66d16e25024525993ea8b8b10ebba29e04d7841e Author: Simon McVittie Date: 2012-04-25 16:07:44 +0100 Don't (visibly) document ROOM-based Call channels yet No CM implements them, yet. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 00a994237dc0f8b6bcbd2f11ac98e144399f7515 Author: Simon McVittie Date: 2012-04-25 16:07:08 +0100 Format bullet lists correctly gtk-doc's subset of Markdown allows "-" as a bullet point, but not "*". Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 0f17e3bf57c0c1f0fd2a618f36269215b0a948e5 Author: Simon McVittie Date: 2012-04-25 15:59:10 +0100 Test tp_account_channel_request_set_file_transfer_description etc. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 4670e6639445555fc6fd42f5d045d1131e5f512f Author: Simon McVittie Date: 2012-04-16 19:37:08 +0100 tp_account_channel_request_set_file_transfer_description etc.: add These are partly useful in their own right, and partly a demonstration of how any other optional properties should work in this API. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 521799547ad4daf15d006a9ede630bcc7ff98f86 Author: Simon McVittie Date: 2012-04-25 15:57:13 +0100 Add and test functions to check for particular file transfer properties These functions make the simplifying assumption that all of these properties are orthogonal, so if both (say) InitialOffset and Description are supported, then they'll be supported in the same requestable channel class. This is about the best you can do without exposing the requestable channel classes themselves as API and having applications iterate through them, which seems lower-level than we want. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 6cdfe94bfdb340455fa1c377fb807a45cbb265d1 Author: Simon McVittie Date: 2012-04-16 19:06:06 +0100 Test tp_account_channel_request_new_file_transfer Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 190bd127672dd8baa8c8415a543fd97dc2099d4b Author: Simon McVittie Date: 2012-04-16 19:36:31 +0100 tp_account_channel_request_new_file_transfer: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 0c4e961c10b5afbc322d6a36529b63c6f5f71496 Author: Simon McVittie Date: 2012-04-16 18:44:26 +0100 Test requesting audio and audio/video calls, and arbitrary properties Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 1079b72a6d0899115e9a33ea4a6ef7182330b913 Author: Simon McVittie Date: 2012-04-16 19:35:37 +0100 tp_account_channel_request_new_audio_call, audio_video_call: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 199fd080e4a6ad07936d295a30bba7fab8b05e30 Author: Simon McVittie Date: 2012-04-16 19:34:59 +0100 tp_account_channel_request_set_request_property: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 2e07d043286d90064679b066118877d26bae1f58 Author: Simon McVittie Date: 2012-04-16 18:14:44 +0100 TpAccountChannelRequest: test that properties get through to the request Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 3d6e83e8fcb0bb43c45ff19df0003f42ee8b534f Author: Simon McVittie Date: 2012-04-16 16:53:27 +0100 Test tp_account_channel_request_set_target_contact Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit ca29a4de02541d24aff6813aa2ac838d5735aeb6 Author: Simon McVittie Date: 2012-04-16 16:52:50 +0100 tp_tests_connection_run_until_contact_by_id: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 3708aa6276e9b8cd398f55875a83851f92a184e5 Author: Simon McVittie Date: 2012-04-16 16:49:29 +0100 Test tp_account_channel_request_new_text, tp_account_channel_request_set_target_id Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit f89c396996d914b1e54dee714276da85df0fcb5e Author: Simon McVittie Date: 2012-04-16 16:33:46 +0100 tp_account_channel_request_new_text, tp_account_channel_request_set_target_contact, tp_account_channel_request_set_target_id: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 40c12e5ec863922f62a053f8feeb1ed414188430 Author: Simon McVittie Date: 2012-04-16 16:13:37 +0100 TpAccountChannelRequest: copy the hash table with a specific memory model Forcing use of a particular key and value destructor makes it safe to edit the hash table after the request has been created. (Setting every property in the constructor doesn't scale, in the presence of optional properties, and we want high-level API for this so apps can be a bit less D-Bus-API-dependent.) Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780 commit 3f70ba0caacd9fa72e60d316bf354c7d463bab61 Author: Xavier Claessens Date: 2012-04-30 14:40:35 +0200 Deprecate TpTextMixin It has been replaced by TpMessageMixin for a while commit 609825c7d81f98ab0f7c6463c9ce4c78c077e2fe Author: Xavier Claessens Date: 2012-04-30 18:01:18 +0200 Do not use TpTextMixin for channel types that does not need it This smell like contagious copy/pasting commit d4490b3357fce06549503095f4b7fc983ab0b261 Author: Guillaume Desmottes Date: 2012-04-27 11:02:53 +0200 simple-conn: rename priv->channels to priv->text_channels commit bf226f20c5a42e6f350f620fe54924a746777666 Author: Guillaume Desmottes Date: 2012-04-27 11:01:36 +0200 simple-con: don't store the room list chan in priv->channels commit 98d0a2113daa4b94b7e7726491af23714deddd08 Author: Guillaume Desmottes Date: 2012-04-26 10:27:07 +0200 room-list: rename get_listing() to is_listing() commit 6199b89e2978b0f72ea0baee5865812567f8cc13 Author: Guillaume Desmottes Date: 2012-04-26 10:25:35 +0200 room-list: rename 'got-rooms' signal to 'got-room' It's not plural. commit 2e3b97db5c99be0144abfab369302aedb65fb5be Author: Guillaume Desmottes Date: 2012-04-26 10:24:30 +0200 fix room-list doc It's not a TpChannel sub-class any more. commit 6a46f92c20e1fafb4c7b655936194d300ae29076 Author: Guillaume Desmottes Date: 2012-04-26 10:19:25 +0200 room-info: rename hash to info That's how it's called in the spec. commit 52f6e8bb2ff7df80721bbb63008ab792609dc283 Author: Guillaume Desmottes Date: 2012-04-26 10:15:47 +0200 rename tp_room_info_get_members to get_members_count() commit 7fb8ececde74eef92a78d7fd1008d1df905e3cfd Author: Guillaume Desmottes Date: 2012-04-26 10:11:25 +0200 Fix TpRoomInfo doc commit fa2cbf7cb4153fa0f18ed2606cb9dfbca060bfc8 Author: Guillaume Desmottes Date: 2012-04-17 17:42:10 +0200 Fire the 'failed' signal when channel is invalidated commit 55879d7e5bdb0ad2bc73ff1232fdc930c7c46d2f Author: Guillaume Desmottes Date: 2012-04-17 17:05:35 +0200 test ListRooms() failing commit c5e4e467091a1a578a79e46c0e63456cb31be43c Author: Guillaume Desmottes Date: 2012-04-17 16:48:26 +0200 Make the start() API sync and report errors using a signal commit 87222101f944e535c43a934d0c507be0e9c98967 Author: Guillaume Desmottes Date: 2012-04-17 16:06:29 +0200 Rename TpRoomListChannel to TpRoomList It's not a TpChannel any more. commit 36dabfbf9f770e83bfd10e082435d24dd79aa2c3 Author: Guillaume Desmottes Date: 2012-04-17 15:35:15 +0200 TpRoomListChannel: hide the channel as an implementation detail This API works now as TpContactSearch does. It's a GObject implementing the GAsyncInitable interface instead of being a TpChannel subclass. It also takes care of requesting the underlying channel. commit fa95a0e28015a847870368b5855c44ddd330fb68 Author: Guillaume Desmottes Date: 2012-04-17 15:36:48 +0200 simple-channel-request: allow to create room list channels commit 0b291b59709c9da444ed87ec80447ce177145266 Author: Guillaume Desmottes Date: 2012-04-17 15:36:28 +0200 simple-conn: add tp_tests_simple_connection_ensure_room_list_chan() commit b2d1595361a5c85f8f25548e1178e267404ec63a Author: Guillaume Desmottes Date: 2012-04-17 15:35:50 +0200 room-list-chan: implement close commit 911847cd4fb1c1a27ebc0f537d8afe5032f4143c Author: Guillaume Desmottes Date: 2012-04-12 14:38:09 +0200 Actually implement room listing commit 6cb97884c2932ea90bcc4701ecb3a1a1c3c64bfa Author: Guillaume Desmottes Date: 2012-04-12 14:37:40 +0200 add TpRoomInfo commit 0173bb1410e7c60f71955304b847a898a1efd1c2 Author: Guillaume Desmottes Date: 2012-04-12 08:32:37 +0200 implement TP_ROOM_LIST_CHANNEL_FEATURE_LISTING Also start the implementation of tp_room_list_channel_start_listing_async(). commit 0dc738ade5d76d2f88194e24341232f643373bd5 Author: Guillaume Desmottes Date: 2012-04-11 14:38:20 +0200 add test-room-list-channel commit de890e68890a89c9d2d5656e03d6723bec5197df Author: Guillaume Desmottes Date: 2012-04-11 14:37:58 +0200 add TpTestsRoomListChan for tests commit 499b4d7e641194d321476be78e93bb550e96eddb Author: Guillaume Desmottes Date: 2010-09-23 14:46:59 +0200 add TpRoomListChannel commit a03bca462e6a0ab842b9e0e66be2b8166cc272eb Author: Xavier Claessens Date: 2012-04-27 15:05:39 +0200 Update NEWS with new deprecations commit 355cebc58cb1a5cbfbed4937ac1ae4b7eac8502b Author: Xavier Claessens Date: 2012-04-27 13:46:22 +0200 TpChannel: Deprecate all TpHandle APIs that have TpContact variant https://bugs.freedesktop.org/show_bug.cgi?id=49213 commit 8318e418a1e34def29028ca6468f67f0f74b72fb Author: Xavier Claessens Date: 2012-04-27 14:15:31 +0200 Bump GLib required version to 2.32 https://bugs.freedesktop.org/show_bug.cgi?id=49213 commit 414e19f9d4021cd4b353fff01da1b8ce9ba2df7b Merge: 2556ea7ff 5d2f1f6a6 Author: Guillaume Desmottes Date: 2012-04-27 10:44:05 +0200 Merge branch 'telepathy-glib-0.18' commit 5d2f1f6a6b491a9eb05ff0013a258471d59248de Author: Guillaume Desmottes Date: 2011-11-16 14:23:21 +0100 Retry to prepare features which failed because of a missing conn iface If we try to prepare a connection feature before the connection is connected, the preparation may fall if a required interface hasn't been announced yet by the CM. So, we give those features a second chance to be prepared when the connection has been connected. https://bugs.freedesktop.org/show_bug.cgi?id=42981 commit 2556ea7ff0fceff8dcc893c8b68bbfc596b3f44c Author: Jonny Lamb Date: 2012-04-25 17:18:48 +0100 account-manager: fix small typos in documentation Signed-off-by: Jonny Lamb commit d4cbc804089b0888126f94f37afb3a2de3be3a74 Author: Jonny Lamb Date: 2012-04-25 16:00:17 +0100 account-manager: document what signal is used for new accounts Signed-off-by: Jonny Lamb commit 032592af28cf29069b2bcf7c33fb0ae560587158 Author: Xavier Claessens Date: 2012-04-23 13:39:02 +0200 Use g_ptr_array_new_full() now that we can depend on glib 2.30 commit c193a39211ffdef8e724c153ae13bf00b31dc7eb Author: Xavier Claessens Date: 2012-04-23 11:00:57 +0200 Fix typo in gtkdoc tags commit ec1e840e3aa541304742620396011bb3e74f57fb Merge: 109fa9cf7 3e49a76cd Author: Simon McVittie Date: 2012-04-20 18:31:34 +0100 Merge branch 'telepathy-glib-0.18' Conflicts: NEWS configure.ac commit 3e49a76cd11ab42610ac498cd0d0a66e580d6f63 Author: Simon McVittie Date: 2012-04-20 18:26:44 +0100 nano version commit 32532b43297b8c9009581e0dca93dc1f0c1e0a9d Author: Simon McVittie Date: 2012-04-20 18:19:39 +0100 belatedly name the release commit 629bea3bfcf0c6698055b5bf6811485b330d335b Author: Simon McVittie Date: 2012-04-20 17:07:25 +0100 Prepare 0.18.1 commit 109fa9cf7375bc4f2f2ced2a9c0dfb551e471886 Author: Guillaume Desmottes Date: 2012-04-18 09:49:43 +0200 debug-client: add missing config.h include commit 7c4391801a12292165604b630485a9633ba787eb Author: Guillaume Desmottes Date: 2012-04-16 13:32:46 +0200 debug-message: split the category from the domain The spec specifies how the category can be included in the domain, UI may want to display/filter them separately so best to split it for them. commit fa79ac662465b80900646ffc8998ed3f72ef49d2 Author: Guillaume Desmottes Date: 2012-04-16 11:22:47 +0200 debug-message: strip the message from trailing whitespaces empathy-debug-window was doing that; it doesn't hurt and will save Empathy from copying the string to strip it itself. commit 08585dc696b299d414eaa00ded85829f9c2ec2e9 Author: Guillaume Desmottes Date: 2012-04-16 09:27:41 +0200 test-debug-client: fix header comment commit 0bbef6a26f050571c93a7df02bcc6e9cabab9f27 Author: Guillaume Desmottes Date: 2012-04-13 15:08:11 +0200 add new-debug-message signal commit 8c1aa2f67d0013507da8c0205df1054e673c8552 Author: Guillaume Desmottes Date: 2012-04-13 14:35:09 +0200 Add tp_debug_client_get_messages_async() commit 99341b830f11761fbf3c52b05e42564defbde7bd Author: Guillaume Desmottes Date: 2012-04-13 14:34:50 +0200 introspection.am: add new debug client API commit ad4a3ac68481c352051380934430dec635fd12ff Author: Guillaume Desmottes Date: 2012-04-13 14:34:19 +0200 Add TpDebugMessage commit 312587f6be7f5a11a32dfdd0a03bc83db8c1173b Author: Guillaume Desmottes Date: 2012-04-13 10:35:28 +0200 test tp_debug_client_set_enabled_async() commit ba969da94a01420f5aa4e101640ea9ba83d912c4 Author: Guillaume Desmottes Date: 2012-04-13 10:31:04 +0200 test TP_DEBUG_CLIENT_FEATURE_CORE commit d68fbb41e865b6615cee62834b0c0aff0714637a Author: Guillaume Desmottes Date: 2012-04-13 10:30:40 +0200 debug-client: expose enabled as a property commit f7217554dc69fa2682f3d88e7166b75686f4a4ff Author: Guillaume Desmottes Date: 2012-04-13 09:50:25 +0200 add test-debug-client commit 200fca7d1432a85a39a21fb9244a341659becbb1 Author: Guillaume Desmottes Date: 2012-04-13 09:49:47 +0200 telepathy-glib.h: add debug-client.h commit 07440903a1228b8ad31100f45dde422e7fe59389 Author: Guillaume Desmottes Date: 2012-04-12 16:38:58 +0200 debug-client: fix doc commit b98cfe87b1f5a026abf184ca2452214e7a869c20 Author: Will Thompson Date: 2010-11-27 00:05:02 +0000 DebugClient: add set_enabled_async() This is the only binding I'm going to bother adding for now. commit e8bb33b6c8213d82562d4b8436a2a4de0ffde172 Author: Will Thompson Date: 2010-11-27 00:04:25 +0000 DebugClient: add a Core feature. This feature basically just checks that the thing at the other end actually supports the Debug interface. commit 908650d2219b74c4794a354e75bb9b2d054a4a8c Author: Will Thompson Date: 2010-11-26 23:53:43 +0000 DebugClient: invalidate when service vanishes commit 5affea2190000acb8443e16c128eac1d52d85f3c Author: Will Thompson Date: 2010-11-26 23:53:28 +0000 Add a debug key for client-side debug stuff commit aca908ec4be2849ede0caa4793a036034401b218 Author: Will Thompson Date: 2010-11-26 12:38:00 +0000 Generate client Debug code (with a trivial class) commit 6e70761bddc4def5057ccd240650a45601ce2cab Author: Will Thompson Date: 2010-11-26 12:34:08 +0000 Add a #define for the Debug object path commit b2cde22bbf29015c644a6552cfad26d0ca9aabc9 Author: Xavier Claessens Date: 2012-04-17 12:44:35 +0200 TpCapabilities: Add more unit tests for the case of extra unknown fixed props commit dc9ec1cd1f8abe7b298a6871959daeb9c47d94e3 Author: Xavier Claessens Date: 2012-04-17 12:35:21 +0200 Add a comment explaining why _supports_contact_search() does not require THT prop commit ded205c7dd94ee87c03e5fc55e7955a6c2b570d9 Author: Xavier Claessens Date: 2012-04-16 22:12:53 +0200 Add unit test for tp_capabilities_supports_audio(_video)_call() commit bb1105761f7a42179a670485d3d910ba033e2ca9 Author: Xavier Claessens Date: 2012-04-16 16:15:12 +0200 TpCapabilities: Verify fixed properties does not contain extra fields we don't understand commit bb5d7690cb32a4caa7989de5ada684b0b91d5521 Author: Xavier Claessens Date: 2012-04-17 09:41:13 +0200 Implement SetAliases on test Connection commit 0318b322af4a9baf6c402dd1282dbc56fc0433c7 Author: Xavier Claessens Date: 2012-04-17 09:57:50 +0200 sync test Connection with folks' commit d3ae14a03a52b5d292410fef19b4383e9f01150a Author: Simon McVittie Date: 2012-04-16 16:11:28 +0100 Document that tp_user_action_time_from_x11 works for GDK 3 too GDK 3 uses the same timestamps as GDK 2, X11, and Clutter 1.0. Also change the spelling from Gdk to GDK, following the style used in GDK's own documentation. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit c0a58f8c543cefb9024ab5d088aca1be7fe37389 Author: Simon McVittie Date: 2012-04-12 18:24:27 +0100 tp_connection_dup_detailed_error_vardict: add and test Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit bcadb5364ff8a873d965064a3e60ccbb341f3217 Author: Simon McVittie Date: 2012-04-12 18:20:36 +0100 tp_base_connection_disconnect_with_dbus_error_vardict: add and test Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit 656ab5f7cac54c160488f0149ed7eda975e694a5 Author: Simon McVittie Date: 2012-04-12 18:17:21 +0100 tp_connection_manager_param_dup_default_variant: add and test Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 commit 48942a44e3250c097347cd7197cc29bb954b9d71 Merge: f464c89e6 bab960e0f Author: Simon McVittie Date: 2012-04-16 19:53:41 +0100 Merge remote-tracking branch 'origin/telepathy-glib-0.18' commit bab960e0f3f63a52850e76b80b3dae77ea9c174d Author: Xavier Claessens Date: 2012-04-03 11:50:15 +0200 TpAM: Document that _set_default() keeps an internal reference commit f464c89e68d8b460bba1247c9941e4a30ba22c2f Author: Xavier Claessens Date: 2012-04-03 11:50:15 +0200 TpAM: Document that _set_default() keeps an internal reference commit 299785c6addba3d40c35a4caa9cf479b2905bf92 Author: Xavier Claessens Date: 2012-02-08 14:37:01 +0100 Add tp_contact_get_account() commit 7b7fad6ef2d9211489891c66d497b4b720d1b53c Author: Xavier Claessens Date: 2012-04-16 18:43:33 +0200 connection-internal.h Add warning comment for APIs that should not be used outside contact.c commit a75257708a4766a5e1fcbf19d1d7d5bf588eab91 Author: Xavier Claessens Date: 2012-04-16 17:42:33 +0200 Do not use _tp_connection_lookup_contact() outside contact.c That function is dangerous because it does not guarantee that the returned TpContact has an identifier set. In the case a TpContact is being created with tp_connection_get_contacts_by_id(), the first step is to inspect its handle and then create the TpContact object *without* giving its ID. The id will be set later once we got the contact attributes. If _tp_connection_lookup_contact() is called for the same handle/id between the moment the TpContact is created and the moment it sets its attributes, then a contact with no identifier is returned. commit 57e23d6d7788498061349649e9b4bccf9ea7bf7b Author: Xavier Claessens Date: 2012-04-16 17:42:33 +0200 Do not use _tp_connection_lookup_contact() outside contact.c That function is dangerous because it does not guarantee that the returned TpContact has an identifier set. In the case a TpContact is being created with tp_connection_get_contacts_by_id(), the first step is to inspect its handle and then create the TpContact object *without* giving its ID. The id will be set later once we got the contact attributes. If _tp_connection_lookup_contact() is called for the same handle/id between the moment the TpContact is created and the moment it sets its attributes, then a contact with no identifier is returned. commit 9fee4385e567e0f4265ffdddb6898aa0d364214e Author: Guillaume Desmottes Date: 2012-04-10 16:52:49 +0200 Add tp_capabilities_supports_sms() https://bugs.freedesktop.org/show_bug.cgi?id=48506 commit c1e3f295a9879185b08ecef2146f4a5fb2b4981d Author: Simon McVittie Date: 2012-04-13 12:55:23 +0100 NEWS commit 4ddb12fa9b0306f26e2a56048de8788791ea465e Author: Simon McVittie Date: 2012-04-12 16:41:23 +0100 Use --enable-fatal-warnings to select g-ir-scanner --warn-error Reviewed-by: Jonny Lamb commit 3a76832422b241f3fb8341f4357231efd214f5fe Author: Simon McVittie Date: 2012-04-12 16:38:34 +0100 merge the various "fatal warnings or not?" options I've kept --disable-Werror (it's from a reusable macro for -Werror), but distributors should now use --disable-fatal-warnings to control all the potentially-fatal checks simultaneously. Reviewed-by: Jonny Lamb commit 13a33ce1628ced2b54370dce06dabc5940efdd34 Merge: 2d2991d46 66d1a078e Author: Simon McVittie Date: 2012-04-13 12:56:07 +0100 Merge branch 'telepathy-glib-0.18', rejecting non-fatal g-ir-scanner warnings Conflicts: NEWS commit 66d1a078e9d52791ad53db2ce7a94e817e86d12e Author: Simon McVittie Date: 2012-04-13 12:38:26 +0100 NEWS commit 892174994149b1266f266833f90e73e6a727945c Author: Simon McVittie Date: 2012-04-12 16:55:47 +0100 Don't make g-ir-scanner warnings fatal on this stable branch Reviewed-by: Jonny Lamb commit c992c64af097576d1023dc793a6d4752360ff564 Author: Alban Browaeys Date: 2012-04-10 00:48:08 +0200 Codegen: fix comment line start leftover. Generated telepathy-glib/_gen/telepathy-enums-gtk-doc.h from: /usr/bin/python ../tools/c-constants-gen.py Tp _gen/stable-spec.xml _gen/telepathy-enums has incorrect comment. Fix it with the same remedy as in 5c58330c32f39a9dd6aaaef37f54461922cf6124 "many fixes to documentation comments" ie remove the newline between '*' and identifier. Reviewed-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48363 commit 2d2991d46fa150f38ac2a5090c45d64b5346391d Author: Simon McVittie Date: 2012-04-10 14:35:46 +0100 Install remaining Python examples Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48504 Reviewed-by: Jonny Lamb commit e5f8a8211107a57d617865a1a74605430ad63ecb Author: Simon McVittie Date: 2012-04-10 14:34:24 +0100 Optionally install most of the Python examples We already optionally install many of the C examples. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48504 Reviewed-by: Jonny Lamb commit 87323d2c4db3a87c55d00d35039c0b74ff66ed2c Author: Simon McVittie Date: 2012-04-10 14:33:53 +0100 Add a simple Gtk3 dialler Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48504 Reviewed-by: Jonny Lamb commit 4b9ed8f4feaca5b7cef26cfd7c0e0066b0960a76 Merge: 9f15b9669 0065a23ce Author: Simon McVittie Date: 2012-04-12 15:45:34 +0100 Merge branch 'telepathy-glib-0.18' commit 0065a23ce403becdaf86139b5bb29d0d9fe2f3cc Author: Stef Walter Date: 2012-04-12 16:30:13 +0200 Fix gtk-doc comments for auto-generated constants headers Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48592 Reviewed-by: Simon McVittie commit a769d111600b58452622279128f040f50ebe48f6 Author: Simon McVittie Date: 2012-04-12 14:01:40 +0100 dbus-tube-chan test: listen on a random address appropriate for the OS Instead of hard-coding the abstract Unix socket '\000dbus-tube-test', listen on a random (abstract or real) Unix socket in /tmp if on Unix, or a random port on 127.0.0.1 if not. These are the same listening addresses I used in test/loopback.c in libdbus. The Unix version also matches what the session bus normally uses. This fixes the test on non-Linux Unix (not insisting on abstract-namespace sockets working), when run twice in parallel on Linux (not insisting on using a particular hard-coded name), and in theory also on Windows (not trying to use Unix sockets). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48600 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes commit 9f15b9669e02238c3efee3471d5a6f2398559d04 Merge: be03dcdf3 3302343b9 Author: Simon McVittie Date: 2012-04-12 13:33:01 +0100 Merge branch 'telepathy-glib-0.18', rejecting 0.18-specific changes Conflicts: NEWS telepathy-glib/base-connection.c telepathy-glib/dbus-properties-mixin.c telepathy-glib/presence-mixin.c tools/c-constants-gen.py commit 3302343b9dbe8246e1fda0d75db2145d8a9520bd Author: Simon McVittie Date: 2012-04-12 13:27:04 +0100 Upload documentation to the 0.18.x location commit e0329bd9ccc05b095c38fde993289db4912c09d5 Author: Simon McVittie Date: 2010-09-20 12:07:15 +0100 Don't check documentation completeness in this stable branch commit 07d4cb30fa07bf3dca05bc77aa28170ba062c77e Author: Simon McVittie Date: 2010-04-06 12:33:21 +0100 Disable warnings about deprecated functions for stable branch Since this is a stable branch, we're unlikely to fix uses of deprecated functions, so we shouldn't warn about them. commit abacdfed03e8e0247e29d760a138400f3868e95b Author: Simon McVittie Date: 2012-04-12 12:53:00 +0100 NEWS commit 114a16ba3f91dfa700770ec817ff3f8b4061e0a7 Author: Stef Walter Date: 2012-04-12 11:46:52 +0200 Fix doc comments for recent stricter gtk-doc * Build fails with new gtk-doc (1.18.1) which seems to be stricter than previous versions. [Also fixes g-ir-scanner warnings, which were what was actually fatal. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48592 Reviewed-by: Simon McVittie commit be03dcdf3e6f1e89a4ec226a14d88e0a2d339adc Author: Simon McVittie Date: 2012-04-12 11:52:31 +0100 0.19 NEWS commit 3c0276a87da6ae9540b1e28c795c1715ad48f671 Merge: ac5d4e98c e2b5e25a3 Author: Simon McVittie Date: 2012-04-12 11:51:44 +0100 Merge branch 'telepathy-glib-0.18' commit e2b5e25a33edc03682b61b307d640dfbf3b72e6c Author: Simon McVittie Date: 2012-04-12 11:51:35 +0100 0.18 NEWS commit ac5d4e98cdd52d9f0a55cc1890d2319c912329b2 Author: Simon McVittie Date: 2012-03-02 18:18:56 +0000 Don't use the deprecated TpBaseChannelClass.interfaces property Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48547 commit 6d546be194d9752e883bb86b70cb1641709413f5 Author: Simon McVittie Date: 2012-02-22 18:39:32 +0000 Annotate GStrv as (array zero-terminated=1) for introspectability (type GObject.Strv) isn't understood. This affects tp_account_update_parameters_finish, tp_connection_manager_dup_protocol_names, tp_connection_manager_protocol_dup_param_names and tp_protocol_dup_param_names. commit 286ffd0da22fbe51a0cb31e4b7198c961da972e2 Author: Simon McVittie Date: 2012-03-02 16:32:55 +0000 Rename internal NUM_TP_LIST_HANDLES to TP_NUM_LIST_HANDLES for completeness Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470 commit 9a7b5f6721c5554e4bf9e111e132746b63b233c0 Author: Simon McVittie Date: 2012-03-02 16:31:57 +0000 Use TP_NUM_… instead of NUM_TP_… Based on a patch from Jonny Lamb, updated for current master. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470 commit 6f867844aaefb0e5239ff2328a4b7329b450f4dd Author: Simon McVittie Date: 2012-02-22 16:50:19 +0000 Generate TP_NUM_foo for every generated enum Unlike NUM_TP_foo, these are introspectable. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470 commit 8418fb5504aca4140c956e0962dc31f2d7a20b60 Author: Simon McVittie Date: 2012-02-22 16:49:46 +0000 TP_NUM_DBUS_ERRORS, TP_NUM_CONTACT_FEATURES: add NUM_TP_CONTACT_FEATURES and NUM_TP_DBUS_ERRORS aren't introspectable. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46470 commit c6ed9fa480ed859dd7d111f6412b3a43a8cd73ca Author: Simon McVittie Date: 2012-02-01 19:30:39 +0000 Complete results of TpProxy D-Bus calls in an idle GAsyncResult guarantees to call your callback from the main loop. For historical reasons (basically "5 years ago I didn't know any better"), TpProxy does not: if the interface is missing or the proxy has been invalidated, the callback is called re-entrantly. I'm going to fix that in Telepathy 1.0, but for now, let's give GAsyncResult the correct semantics. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45514 Reviewed-by: Jonny Lamb commit aa273c1835bb84766fb9e2b933677ef9fb79dd09 Author: Simon McVittie Date: 2012-04-11 12:10:13 +0100 channel-contacts: reverse ownership of ContactsQueueItem and result Previously, the ContactsQueueItem assumed that it owned the only reference to the GSimpleAsyncResult. This could result in the GSAR still existing after the CQI had been freed, if someone else took a reference to the GSAR. Refcounting the CQI would not solve this problem, because then the CQI and the GSAR would have a cyclic reference. Instead, change the queue of CQIs into a queue of GSARs, and have the CQI owned by the GSAR. This means the GSAR's refcounting protects the CQI from being freed prematurely. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Reviewed-by: Jonny Lamb commit 2e72176e91c5e6b34ffdc2625aa7cd89381e662e Author: Simon McVittie Date: 2012-04-11 11:59:32 +0100 channel-contacts: merge contacts_queue_item_new into contacts_queue_item Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Reviewed-by: Jonny Lamb commit 0b77bfd9e045e5c4b9df0f072d32052146c2b648 Merge: 5c58330c3 76b0d3cc3 Author: Simon McVittie Date: 2012-04-10 13:52:17 +0100 Merge remote-tracking branch 'origin/telepathy-glib-0.18' commit 5c58330c32f39a9dd6aaaef37f54461922cf6124 Author: Jonny Lamb Date: 2012-04-06 15:35:16 -0400 many fixes to documentation comments fd.o#48363 was opened which complains about lots of documentation problems (which g-ir-scanner finds). While I was at it I did some grepping to find yet more problems. Signed-off-by: Jonny Lamb commit 76b0d3cc3f6dd10f1f88a7e7b1d57a88ac531a08 Author: Guillaume Desmottes Date: 2012-04-04 11:04:41 +0200 the right GLib macro is GLIB_VERSION_MAX_ALLOWED commit 08f4a05e33f8a3fa2fe0e326014dbaccc7c55be6 Author: Guillaume Desmottes Date: 2012-04-03 15:54:12 +0200 add stream-tubes.py/accepter.py commit 8c31202992b37f0e387f67ca0100df2e1643c889 Author: Guillaume Desmottes Date: 2012-04-03 15:54:12 +0200 add stream-tubes.py/offerer.py commit 5c4281431b16c48ce53d97bbc602137af4acab07 Author: Alvaro Soliverez Date: 2012-04-03 17:39:21 -0300 AOSP does not handle Android includes with relative paths correctly. This uses a variable that holds the local directory to include the file correctly. commit cf0e9d8b366792a9df8303778fcda2dec21217ea Author: Guillaume Desmottes Date: 2012-04-03 15:48:42 +0200 Fix the type of the TpStreamTubeConnection::closed signal python-gobject can't bind G_TYPE_POINTER. This seems to be save from an API/ABI pov according to GLib gurus, we'll just copy the GError instead of passing the same pointer: commit e17cd19f2341eeafa666301580fed1f0a77c83a6 Author: Guillaume Desmottes Date: 2012-04-03 14:43:50 +0200 stream tube examples: send \n with data This will allow us to use g_data_input_stream_read_line_utf8() in Python as g_input_stream_read() is not bindable. commit b985cb3474132a802df647e0438a2872c02c71fa Author: Guillaume Desmottes Date: 2012-04-03 14:43:50 +0200 stream tube examples: use tp_channel_close_async() commit 55582d8af3627adf09ebf6ac586753ad4f6abe59 Author: Guillaume Desmottes Date: 2012-04-03 14:43:50 +0200 stream tube examples: split sending/receiving data debug messages Make it easier to understand/debug what's going on. commit c93cd8f2bbb9c8888ba3a4ad153a485e33568a4c Author: Xavier Claessens Date: 2012-04-03 14:11:34 +0200 Introspect a few getters It is not always a good idea for bindings to always rely on GObject::get_property(), it can be slow to access properties that way everytime instead of keeping a proxy object in native language. commit 81b7492074ae982f1ae130b900db61c273380a4b Author: Xavier Claessens Date: 2012-04-03 14:11:34 +0200 Introspect a few getters It is not always a good idea for bindings to always rely on GObject::get_property(), it can be slow to access properties that way everytime instead of keeping a proxy object in native language. commit b0919cddbde87259613b0f9c56fb9f25b6065b12 Author: Jonny Lamb Date: 2012-04-02 16:44:58 -0400 start on version 0.19.0 Signed-off-by: Jonny Lamb commit 0dfebb47ded9af7128e641ac90a032e13c2be7f4 Author: Jonny Lamb Date: 2012-04-02 16:43:12 -0400 start on version 0.18.1 Signed-off-by: Jonny Lamb commit 95b3336d2d43fdbfe61692144dca8700e0ad0071 Author: Jonny Lamb Date: 2012-04-02 16:31:18 -0400 version 0.18.0 Signed-off-by: Jonny Lamb commit 7d8094e59bf346b092f7a51e21afd0e7d9df6f1a Author: Jonny Lamb Date: 2012-04-02 16:23:52 -0400 NEWS: update for 0.18.0 Signed-off-by: Jonny Lamb commit dcab14f903605fc2f0c162e45b1c322966eb46c2 Merge: 6275753ca 126261cf2 Author: Will Thompson Date: 2012-04-02 16:46:25 +0100 Merge branch '29271-some-dbus-tube-api' https://bugs.freedesktop.org/show_bug.cgi?id=29271 Reviewed-by: Guillaume Desmottes commit 126261cf295622c659238bf51d85d8e39c8eaf2c Author: Will Thompson Date: 2012-04-02 16:43:31 +0100 DBusTubeChannel: write a better preamble maybe? commit 86216b62cd607b94bf837b4052f1f1e6cbfab819 Author: Will Thompson Date: 2012-04-02 16:16:25 +0100 dbus tube test: add bug references for FIXMEs commit b5bb8f51d46aa7ea89fafcc3042d30bc4a5db018 Author: Will Thompson Date: 2012-03-30 16:10:52 +0100 dbus-tubes example: check method argument types commit 5421f1432ed21a198e00aa708dc00e8f032ec488 Author: Will Thompson Date: 2012-03-30 15:20:53 +0100 DBusTubeChannel: always use CREDENTIALS for now Unlike with stream tubes, I don't think this is something which tp-glib can decide for you. CREDENTIALS means “Use D-Bus's normal SASL handshaking”; LOCALHOST means “turn off the same-user restriction and optionally enable the ANONYMOUS mechanism if the socket really is only available to local users” or something. (To be honest, it's not obvious how an application can decide what it wants without being patched. I think this functionality exists for Sugar's benefit, where the CMs are run as different users to the applications; the applications can only talk to them, IIRC, because the session bus has authentication turned off.) commit ecbbb72e7d11951a13514151cdf16112e09e608c Author: Will Thompson Date: 2012-03-30 09:00:50 +0100 dbus-tube: fail offer/accept if channel is invalidated commit a3725ba5c52443bdad1d6bf87230bd01af4cf53a Author: Will Thompson Date: 2012-03-29 17:48:52 +0100 Test DBus tubes opening after Accept/Offer returns commit d63489a560f483d85204b5ce0402fda69aac4503 Author: Will Thompson Date: 2012-03-29 17:08:06 +0100 proxy: sprinkle some checked casts around. It's really tempting fate to just blindly cast objects to their expected type, particularly objects as fundamental as TpProxy, and particularly from callbacks. In this case, my incorrect refcounting was causing me to steal a reference; causing a perplexing crash in tp_proxy_poll_features() when tp_proxy_emit_invalidated() got called from an idle after I'd stolen its reference. Putting the checked cast in at the beginning made it much easier to spot the nature of the bug. commit 7e812b3eebadc026b57fb8595b146ea8db3c5a5c Author: Will Thompson Date: 2012-03-30 15:32:42 +0100 Add an example dbus tube offerer and accepter. commit 6275753ca716891e5865d5ea7ce5be94b096d34a Author: Guillaume Desmottes Date: 2012-03-30 09:46:26 +0200 call-channel: display a string representation of the state commit 9ace209ddec046bb514200df8a4d82021fbd49fe Author: Guillaume Desmottes Date: 2012-03-30 09:46:07 +0200 media-observer: use more TpChannel accessors commit cee24813a448f792c2846a474cc31fa1c2d10625 Author: Guillaume Desmottes Date: 2012-03-30 09:33:46 +0200 media-observer: Observe Call channels instead of StreamedMedia commit 79aa8283e9f1abf240f4885a87ca409aa3bfc5d9 Author: Guillaume Desmottes Date: 2012-03-30 09:33:31 +0200 approver.c: Approve Call channels instead of StreamedMedia commit a0bdd4727bed1802f5998487e1f4a7fd759d5eaf Author: Xavier Claessens Date: 2012-03-28 11:32:12 +0200 Tests: SetContactInfo must also emit ContactInfoChanged signal commit 19cd507119858c8b4a5656dad6da02f4bae9b98e Author: Xavier Claessens Date: 2012-03-28 11:31:33 +0200 Tests: Add more supported ContactInfo fields Those are needed for folks tests commit ea0800451b9ef3577edad6048a30ddffab7e3462 Author: Xavier Claessens Date: 2012-03-27 16:07:39 +0200 Tests: Improve fake Account and AccountManager * add/remove accounts from the AccountManager * set a connection on an Account * enable/disable an Account commit a51467903021e816cf0ba80761db549f3d69fb94 Author: Xavier Claessens Date: 2012-03-27 14:44:14 +0200 Tests: Rename TestContactListManager to TpTestsContactListManager This is to respect the TpTests namespace. It is important for the copy in folks that introspect that API. commit d977e60be4a8b3e59c02dbbf3342ccd57eadf0dd Author: Xavier Claessens Date: 2012-03-27 14:29:14 +0200 Tests: manage the global set of groups At the moment, only groups per contact is managed commit f27ae89b1d3160db22041bed29bfaa9b1dc2be7f Author: Xavier Claessens Date: 2012-03-27 14:28:10 +0200 Tests: Implement mutable contact list commit cce321f4c16c734cc5c72a94ce18fecf5ef9fb1a Author: Xavier Claessens Date: 2011-08-17 15:45:54 +0200 Make g-i scanner abort on warning if not official release commit a5e22eb37d1cb943049fe8bff301271fd93ce582 Author: Olivier Crête Date: 2012-03-23 18:51:02 -0400 CallContentMediaDescription: Add missing documentation https://bugs.freedesktop.org/show_bug.cgi?id=47767 commit eabc9d497dab65d10565822454b86ca782453c34 Author: Guillaume Desmottes Date: 2011-09-28 14:52:46 +0200 examples/client/stream-tubes/Makefile.am: ensure that we link on tp-glib from source It has to be the first one in LDADD commit e846211f3d47b0cbe5364bb4d4bd2cfd95929a13 Author: Guillaume Desmottes Date: 2011-09-28 13:39:53 +0200 add tp_dbus_tube_channel_accept_async() commit 10d524e09c93fb49cdf5deba279aab920ea38a37 Author: Will Thompson Date: 2012-03-28 17:52:52 +0100 Correct English in tp_dbus_tube_channel_offer_async() commit 283b25fae9573e495adf152c0dc5e025e1e599c6 Author: Will Thompson Date: 2012-03-28 17:41:36 +0100 dbus-tube test: return TRUE from ::new-connection handler The documentation for GDBusServer::new-connection says: > If you want to accept the connection, take a reference to the connection > object and return TRUE. We were not doing this—the callback returned void. So random bytes from the stack were interpreted as a boolean. The result on my machine was that this test case passed when run in isolation (-p /dbus-tube/offer) but failed when test-dbus-tube ran as a whole. This is presumably because GDBusServer does this: if (claimed) g_dbus_connection_start_message_processing (data->connection); So if we happened to "return" a false value, the connection never got started. commit 081c0684259606b72f5bb8fe4ad36bfdc87ef180 Author: Guillaume Desmottes Date: 2011-09-28 12:39:55 +0200 add tp_dbus_tube_channel_offer_async() commit 26256dedabc9287d6f5b8afa677cb41cf71c9d3d Author: Guillaume Desmottes Date: 2011-09-28 12:34:44 +0200 TpTestsDBusTubeChannel: implement Offer() commit db2a2e16b84fea0afd1f3b7f34feb138ce92970e Author: Guillaume Desmottes Date: 2011-09-28 12:28:27 +0200 Add TP_DBUS_TUBE_CHANNEL_FEATURE_CORE It does tracking of State property. Currently not used but will be by Offer/Accept methods. commit 2776c23c3095ca4aaa356c6d9f0ee0c02b4c7edc Author: Will Thompson Date: 2012-03-28 14:09:58 +0100 AutomaticClientFactory: add a channel type lookup table This is a bit longer but it makes me feel smart. commit b5fe86f5fe8e2cfbc257fff29c1b087e3d2b4f74 Author: Alvaro Soliverez Date: 2012-03-27 17:54:36 -0300 Move TpBaseContactListAsyncFinishFunc right before the point where it is used for the first time commit 477cc4b53205617345a76975e5ac98d0e4cf2bec Author: Alvaro Soliverez Date: 2012-03-27 17:26:26 -0300 Remove duplicate typedef that was introduced by mistake in one of the latest commits It works fine in Linux, but duplicated statements fail on Windows and Android. commit 4decb6712215cda729841003f3ad868cc877c521 Author: Alban Crequy Date: 2012-03-27 19:33:36 +0100 doc: TpBaseContactList's download-at-connection property commit 952d0a8ff765c9a992dc0b11e6c46efe34cc32fc Author: Alban Crequy Date: 2012-03-27 19:31:31 +0100 doc: tp_base_contact_list_get_download_at_connection commit a705c6fbd77befe839aedc9890f6529f3f861abd Author: Alban Crequy Date: 2012-02-23 18:36:26 +0000 test: contact-list download https://bugs.freedesktop.org/show_bug.cgi?id=43826 commit 3e0b118737007410230ba5ada721747a8818eeea Author: Alban Crequy Date: 2012-03-20 11:58:50 +0000 ContactList: implement helper tp_base_contact_list_get_download_at_connection https://bugs.freedesktop.org/show_bug.cgi?id=43826 commit 8bde24822f73aeb9ec66f719d3066673d41d1c08 Author: Alban Crequy Date: 2012-02-25 19:31:05 +0000 ContactList: add method Download in TpBaseContactList https://bugs.freedesktop.org/show_bug.cgi?id=43826 commit aa1d2196aa5291af961d4ceff36507773a5393c0 Author: Alban Crequy Date: 2012-01-20 13:51:01 +0000 ContactList: add property DownloadAtConnection in TpBaseContactList https://bugs.freedesktop.org/show_bug.cgi?id=43826 commit 234bf108287a72e86a95357a38372f40d713bf1a Author: Alvaro Soliverez Date: 2012-03-27 08:45:31 -0300 Have the Android target depend on the generated code Previously, the code autogeneration was executed manually from the Android.mk. This proved to be prone to errors, and having the Android.mk target in Makefile.am is much more standard and it works fine. Therefore, we removed the statement from Android.mk and added the target dependency. commit a936ed76760f2daacaff9d0fbe964daf9a10dc28 Author: Will Thompson Date: 2012-03-26 17:13:30 +0100 stream_tube_channel_new: refer to TpAutomaticProxyFactory Most API users don't actually need to call this function. commit 7cfb90e3dfac54456423c0a27ba0f39b512f6997 Author: Will Thompson Date: 2012-03-26 17:13:06 +0100 docs: Fix "Finishes to" broken English commit 75d92d599cde42d24d487c12ba3170a300db4311 Author: Will Thompson Date: 2012-02-03 14:58:42 +0000 python/ft example: handle an exception. Hooray! commit 04b24840f7ce2956e02384c1b8a200b3f5eaf9ac Author: Xavier Claessens Date: 2012-03-26 13:01:50 +0200 Use g_dir_make_tmp() now that we depend on glib 2.30 commit 2ff460d6866fc740c9776229a1749f702307034e Author: Guillaume Desmottes Date: 2012-03-23 14:54:27 +0100 contact_set_subscription_states: use _tp_base_contact_list_presence_state_to_letter() I've just been tricked by a log when reading: contact_set_subscription_states: subscribe: 1 I read '1' as TRUE while it was actually TP_SUBSCRIPTION_STATE_NO. This patch also has the nice side effect of reducing the debug output as everything is now on a single line. commit 24f1c7fa370f061165b1e46692e254455864b5cc Author: Guillaume Desmottes Date: 2012-03-23 14:49:24 +0100 export _tp_base_contact_list_presence_state_to_letter as private API commit bd59256d28412d86a360cc43a8798d21d2ce157f Author: Jonny Lamb Date: 2012-03-22 18:34:11 -0400 start on version 0.17.8 Signed-off-by: Jonny Lamb commit 37bb3f998ef5c2b8e8cb01047e4f5d7e9284e52f Author: Jonny Lamb Date: 2012-03-22 17:34:44 -0400 version 0.17.7 Signed-off-by: Jonny Lamb commit 3805b29b643fea19147653ae30038edd4c87f059 Author: Olivier Crête Date: 2012-03-21 16:06:49 -0400 BaseMediaCallChannel: Only wait for streams to start if they were sending to finish unhold commit 7e1e016abba25e84ae0e8ed311877174ac082a9a Merge: afcafad12 ff2a82b1c Author: Will Thompson Date: 2012-03-21 14:18:13 +0000 Merge branch 'example-approver' Reviewed-by: Jonny Lamb commit ff2a82b1c362f55ece17d075b6129e863d085cf3 Author: Will Thompson Date: 2012-03-21 14:11:20 +0000 example approver: "Dissaprove" is not a word. commit 5b8e9996cef7291640ddc5fccdd6381da371fb72 Author: Will Thompson Date: 2012-03-21 14:10:51 +0000 example approver: use _close_channels_async() commit afcafad122ed2dc8734c2a15bbb64044287b35a4 Author: Olivier Crête Date: 2012-03-18 16:56:36 -0400 BaseMediaCallStream: Only emit STUNServersChanged if they have changed commit fedc390e969be494dc14ece7a8a6b2a53260896d Author: Olivier Crête Date: 2012-03-18 14:32:15 -0400 Include the debug message in the TpCallStateReason structure commit 44958fe1f70a6dc42d70b30b630f7119e87c9701 Author: Olivier Crête Date: 2012-03-15 23:06:52 -0400 BaseMediaCallStream: Clear local sending state on sending failure This way, only calling SetSending() again will restart sending commit 6b2ea7f3a1b9983afd8321caabdc98346fe9a9c2 Author: Olivier Crête Date: 2012-03-15 22:42:56 -0400 Call: Ignore all sending/receiving failures while held commit 44c9fa321532bc4ccfa674d31056fb611d39e2f8 Author: Olivier Crête Date: 2012-03-15 21:56:24 -0400 BaseMediaCallContent: Make sure the sending state is updated on call acceptance commit 388e07425166fbeb0ad6b341b429bbd0869d2732 Author: Olivier Crête Date: 2012-03-15 21:56:06 -0400 BaseMediaCallStream: Export if the CM has allowed sending commit 5cf27e1109d98c2176c3369c3ab7143c996329f0 Author: Guillaume Desmottes Date: 2012-03-19 16:56:00 +0100 add missing file 0.17.6.abi commit e4bcfe258fff2a9847442a7a6756227ff24a87d1 Author: Guillaume Desmottes Date: 2012-03-19 16:50:03 +0100 set nano flag commit a2a0637336525f48434ac2d2b9707bc9314a77c2 Author: Guillaume Desmottes Date: 2012-03-19 16:38:14 +0100 NEWS: set release date commit d75169034b7b0a83409ad0318ff0169b0d99d1f1 Author: Guillaume Desmottes Date: 2012-03-19 16:28:38 +0100 prepare 0.17.6 commit cd804b6cb321d94a3b5b6ddbd31425dec304be46 Author: Guillaume Desmottes Date: 2012-03-16 15:26:31 +0100 call-channel: annotate the state-changed signal https://bugs.freedesktop.org/show_bug.cgi?id=47410 commit f61ee3ebdd4de33e3996c7ca0d05f7d0542e2199 Author: Olivier Crête Date: 2012-03-15 18:44:54 -0400 CallChannel: Add const keyword for the const strings commit 9b39d51b1056de9923a7ddc16b7ac9defc69da3f Author: Olivier Crête Date: 2012-03-13 18:33:37 -0400 BaseMediaCallStream: Update the sending and receiving states when a channel is set commit 5d4cd5e236294458cbe9988aa19222652d5dfa4d Author: Olivier Crête Date: 2012-03-13 18:33:17 -0400 BaseCallStream: Emit notification when the channel is set commit 1d019b177f5e9b49154125af9b6ef9e3973d4e23 Author: Olivier Crête Date: 2012-03-05 18:31:14 -0500 CallChannel: Add functions to request hold commit 7e178c06747a0fc389e16c06d9f0dd2064850a0e Author: Olivier Crête Date: 2012-03-05 18:03:42 -0500 CallChannel: Add Hold state as a GObject property commit 369fb5e87d6ed501b4ab50819808ae7fdcac94f1 Author: Olivier Crête Date: 2012-03-05 18:00:49 -0500 CallChannel: Expose the hold state as a GObject property commit c1f734fef56277f75ce31564042263d26bcbab74 Author: Olivier Crête Date: 2012-03-05 16:31:19 -0500 Document that CallStateDetails is a asv commit 7358f2ad6fd53652d5ed0c008b7f3876a6ae5fa7 Author: Olivier Crête Date: 2012-03-05 13:07:03 -0500 BaseMediaCallStream: Never start sending until a call is accepted commit ff2e7f25e366c94d8bf41134cce8a65daf16cc18 Author: Olivier Crête Date: 2012-03-02 19:37:17 -0500 BaseMediaCallStream: Make it possible to set the Content at construct time Make it possible to set the content as construct time if it is available. commit c3ce04aedca4e3dbda47c0b9e870e3e2b15b9c96 Author: Olivier Crête Date: 2012-03-01 20:34:06 -0500 BaseMediaCallStream: Don't start receiving during a failure report commit cf32f035a8c34667cbb20e7d78afdf279c23b640 Author: Olivier Crête Date: 2012-03-01 19:47:10 -0500 BaseMediaCallStream: Don't start sending during a failure report commit 7e87424f0f7aaa0d142d26332516a1a1a27d62bc Author: Olivier Crête Date: 2012-03-01 18:29:46 -0500 BaseMedia: Don't report sending/receiving failures when unholding They will instead just cause the unholding to fail. commit 73bd281569d45b4acce20f952dba3d4e79441ec2 Author: Olivier Crête Date: 2012-02-29 16:53:05 -0500 BaseMediaCallChannel: Add method to get the hold state commit c40b66f5847eb37700a992beb091ae383badbec9 Author: Olivier Crête Date: 2012-02-24 20:43:40 -0500 BaseCallStream: Fix read of uninitialised memory commit 508675e357d279ef3a48124a0bca80db0a4a2612 Author: Olivier Crête Date: 2012-03-14 15:14:32 -0400 CallContent: Add property for parent Channel commit 6a45e85dc139ec3e77e0c5c5db2f987b26c37085 Author: Olivier Crête Date: 2012-03-14 15:11:25 -0400 CallStream: Add property for parent Content commit 9a0f22e36a6af966ffe41e1ee70100f10852186c Author: Olivier Crête Date: 2012-03-05 18:55:54 -0500 CallContentMediaDescription: Add extra interfaces without filling them commit 4186135646b69477ccb2f04a021c436e7b637ffd Author: Xavier Claessens Date: 2012-01-16 20:54:18 +0100 TpCallContentMediaDescription: Add extra interfaces commit 7de10745e106f3d9c55e01c8711a5d39b48c8a45 Author: Simon McVittie Date: 2012-03-13 12:41:20 +0000 Bump dbus-glib dependency to 0.90 for dbus_g_value_parse_variant_by_type Also add Requires.private: dbus-1 to the pkg-config files, since it'd be required for static linking. Signed-off-by: Simon McVittie Reviewed-by: Vivek Dasmohapatra commit 1f75801db3e04254fd04de7d7269f1ccceef36fc Author: Simon McVittie Date: 2012-03-09 18:38:26 +0000 Update NEWS commit 6cd7f67b3a538a434251005951c4fdf2f2be7199 Author: Simon McVittie Date: 2012-03-08 13:32:40 +0000 tp_account_dup_detailed_error_vardict: add Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit 5820fe7bafb6be7d12b1983fc10c30f68391ff92 Author: Simon McVittie Date: 2012-03-08 13:32:23 +0000 tp_account_update_parameters_vardict_async: add Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit 2ee978bca10ab13133c8766db27bfed38cf0917e Author: Simon McVittie Date: 2012-03-08 13:31:27 +0000 tp_account_dup_parameters_vardict: add Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit 4bea527034d215c0bc1cbeed2ce7e87d39e0afd8 Author: Simon McVittie Date: 2012-03-08 12:51:41 +0000 tp_account_dup_storage_specific_information_vardict_async: add This is just like tp_account_get_storage_specific_information_async, but with more GVariant. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit eda90e08141dbcb6be4685839208dfebc8b6679d Author: Simon McVittie Date: 2012-03-08 12:51:17 +0000 account test: rename variables in macros to not shadow normal variables Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit c978190ff2c5b87e363c4a41dd400c51566327ed Author: Simon McVittie Date: 2012-03-08 12:49:09 +0000 Add _tp_asv_to_vardict, a utility function to convert a{sv} representations Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit 8b3f45676451e8c6d03db131cfc1b60005136ca4 Author: Simon McVittie Date: 2012-03-08 12:45:12 +0000 Add tp_account_dup_storage_identifier_variant Bug: https://bugs.freedesktop.org/show_bug.cgi?id=30422 Reviewed-by: Jonny Lamb commit 6e83a149157b06d7717f5f960f97a61471e59725 Author: Simon McVittie Date: 2012-03-08 11:24:54 +0000 Add a Python example which lists and inspects protocols with g-i I could get used to this "rapid prototyping in Python" thing. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 1eae5f295c9b57a9a64df7b2c06dc56e627cc06a Author: Simon McVittie Date: 2012-03-07 14:32:28 +0000 tp_connection_manager_dup_protocols: add Again, this provides a more introspectable way to get the protocols. Combining dup_protocol_names() and get_protocol() is more type-safe, but less obvious. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit dcb1a9b3a6e3b822299dc1dcf6f8722879a3e43e Author: Simon McVittie Date: 2012-03-07 14:23:16 +0000 tp_protocol_dup_params, tp_protocol_dup_param, tp_protocol_borrow_params: add tp_protocol_dup_params might be less nice for C (you have to free the list and the items), but is definitely nicer for Python and other g-i bindings. It will probably be renamed to ...get_params in Telepathy 1.0. tp_protocol_borrow_params is an efficient "C binding", but not as GObject'y. tp_protocol_dup_param will replace get_param in Telepathy 1.0. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 3ddd7624ed38d8eaf12acd5165c10da6d386768d Author: Simon McVittie Date: 2012-03-05 20:00:08 +0000 Test listing CMs the new way Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 0c7e8cb86c9f47d043fbdb598c0efdb87cbcba17 Author: Simon McVittie Date: 2012-03-05 19:36:55 +0000 tp_list_connection_managers_async: add This is a modern, bindable version of tp_list_connection_managers(), which has been noted not to work in Python. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit b455b394c152fbad69fcd743c2882469e2dec73f Author: Simon McVittie Date: 2012-03-05 19:34:36 +0000 _tp_object_list_copy, _tp_object_list_free: add Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit bcbb0a54bb7090c12def75f3ba979c5537fa1f4f Author: Simon McVittie Date: 2012-03-05 19:49:19 +0000 CM test: after listing CMs, inspect them in the test, not the callback This will make it easier to re-use the same test for different ways to list CMs. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit bada24f6df04dc974cd7b004673fe2a9a5606f76 Author: Simon McVittie Date: 2012-03-05 19:48:46 +0000 cm test: free things in a less verbose way Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 882bd3001dda65d47db51ec200161560d6b66703 Author: Simon McVittie Date: 2012-03-05 19:18:49 +0000 tests/dbus/cm: actually run the test that lists connection managers It turns out this was my fault, back in 2009. Oops. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit e2194ffe34164653ad699cd97448d6c7336489cf Author: Simon McVittie Date: 2012-03-05 19:18:23 +0000 Expect to find service files in the srcdir, not the builddir This fixes the /cm/list test in out-of-tree builds, or rather, would fix it if that test had ever worked (which is fixed by the next commit). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46358 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 2af32b0f649029a8ae5f7dcdb27aa837a5987c6a Author: Simon McVittie Date: 2012-03-09 15:42:48 +0000 Apply the same codegen changes to examples, tests as to the main codegen commit 29dd816547415a8dc093bfeed8b13e9a60ded772 Author: Simon McVittie Date: 2012-03-09 15:28:05 +0000 Generate reentrant-methods.list from ABI lists, not documentation The ABI lists are really the canonical list of what we've committed to generating, and we don't want every alteration to -sections.txt to trigger a rebuild. It currently does, because reentrant-methods.list causes a rebuild of the client codegen, which causes a rebuild of everything that includes channel.h, connection.h or telepathy-glib.h. commit beb2d9712e271af88a10edd5565c9d0991adbbed Author: Simon McVittie Date: 2012-03-09 14:06:49 +0000 improve the mtime-transferring hack in tools/ The point of this stuff is to rebuild generated code when, for instance, libtpcodegen.py has changed, without every rule that uses glib-something-gen.py having to know to depend on libtpcodegen.py as well. To do that, we propagate newer mtime from Python library code to Python executables, using touch(1). If building out-of-tree, we need to touch the file in srcdir, rather than creating an empty file in the builddir. The rules that depend on glib-something-gen.py specifically depend on the version in the $(srcdir), so in an out-of-tree build, if we aren't careful to act on the version in the srcdir, editing libtpcodegen.py won't actually cause a rebuild. Reviewed-by: Xavier Claessens commit 36c2a545c9c1d1cc6db205bfc33d980d29b0a0f6 Author: Simon McVittie Date: 2012-03-09 15:13:13 +0000 Avoid having two of the same set of commands run in parallel A rule like this: _gen/x.c _gen/x.h: prerequisites $(AM_V_GEN)x-generator doesn't consider x.c and x.h together. Instead, it expands to two rules, one to generate x.c and one to generate x.h, which happen to run the same commands. This means that in the worst case, you can end up running x-generator twice in parallel, and they'll race with each other and overwrite or delete each other's output. Reviewed-by: Xavier Claessens commit 60470526bdbe624201c32a50f9d4145dd32fa1cb Author: Simon McVittie Date: 2012-02-21 14:32:40 +0000 Codegen: write temporary files first, and rename them into place Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36398 Reviewed-by: Xavier Claessens commit 920c4e208fd7e0ce27abfc9657750ab8d34e38a7 Author: Simon McVittie Date: 2012-02-21 14:20:13 +0000 Write intermediate files by writing a temporary file first Otherwise, we have a race condition: the file exists, so make can proceed, but its contents are not right yet. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36398 Reviewed-by: Xavier Claessens commit 09fa07cfd8e0d7dcfe37a427d91360798d93f9e2 Author: Simon McVittie Date: 2012-03-09 13:26:21 +0000 Redo documentation setup every time a copied source file changes gtk-doc copies these files from the srcdir into the builddir, but after it does so, it touches setup-build.stamp. That file has no prerequisites in gtk-doc.mk, so once these files have been copied once, they won't be updated from the srcdir unless you explicitly delete them. This is pretty annoying when you're adding API on branches and building out-of-tree. To fix this, we just need to give it some prerequisites. Reviewed-by: Xavier Claessens commit 37b40c8244d16a0e88768cb30436618cab315d71 Author: Simon McVittie Date: 2012-03-09 13:10:37 +0000 Partially revert previous commit (re-add variable 'count'), fixing the build Reviewed-by: Xavier Claessens commit 94d9e891eac8577e125e9bb30be157041ebff3c4 Author: Xavier Claessens Date: 2012-02-15 15:06:52 +0100 Correctly implement and document tp_call_channel_has_dtmf(). commit a406196624c70121fdb802e77ca0164b8dfb6622 Author: Simon McVittie Date: 2012-03-06 13:38:50 +0000 glib-interfaces-gen: generate self-contained header files Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46835 Reviewed-by: Jonny Lamb commit 9afcd919e3aa05a36748ff3f45241ffb6316458a Author: Simon McVittie Date: 2012-03-06 13:45:13 +0000 Update GLib dependency in .pc files to catch up with configure.ac Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46835 Reviewed-by: Jonny Lamb commit ebd37e9690a542574ef93df7eb775eeb27ddd68d Author: Guillaume Desmottes Date: 2012-03-07 12:59:56 +0100 Make use of new GLib macros to check API we are using commit c1da88f54b7444fe406d72c85f7d7291a2a2451d Author: Simon McVittie Date: 2012-03-05 17:48:37 +0000 Rewrite unsupported-interface to be suitable for the 'next' branch TpDBusDaemon doesn't have optionally-supported interfaces after the removal of Telepathy Properties, so we have to use TpConnection. I took the opportunity to modernize the test and use GTest. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46978 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 8d80ec6b2c5b6b9fb8753a5ec512f213b096304e Author: Simon McVittie Date: 2012-03-05 14:32:49 +0000 Deprecate tp_connection_manager_call_when_ready and is_ready Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit db40ebdb33258f70164cf60bd5a41640dbc0fb93 Author: Simon McVittie Date: 2012-03-06 10:36:40 +0000 tp_list_connection_managers: use tp_proxy_prepare_async We're about to deprecate call_when_ready, so let's not call it. [+ a comment in response to Jonny's review] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit ca73fa52ebf7be00b43600ecd96d4b964cdb19a6 Author: Simon McVittie Date: 2012-03-05 14:02:42 +0000 Improve coverage of TpConnectionManager test * test prepare_async in every situation where we previously tested call_when_ready * test is_prepared (CORE) in the same situations * test get_invalidated in the same situations This brings us closer to being able to deprecate call_when_ready and is_ready. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 9bc4fbe9caa6b9e03d5c0cb305ef7913b8690711 Author: Simon McVittie Date: 2012-03-05 13:36:51 +0000 tests/dbus/cm: use g_assert_no_error for better diagnostics Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 2b35afc056b7dc30e9bc910802c87012c5cf8a6c Author: Simon McVittie Date: 2012-03-05 12:54:53 +0000 NEWS so far for 0.17.x commit e744fbcbc9aee7eaa58204427ebd0752b51a94a2 Author: Simon McVittie Date: 2012-02-09 15:58:32 +0000 inspect-cm example: stop using call_when_ready Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 418d0a1e9a07d564212f258f51c11330c2e91803 Author: Simon McVittie Date: 2012-02-09 15:28:02 +0000 Deprecate tp_connection_is_ready, TpConnection:connection-ready Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 4fb68b07fc1adc48b88858a85639b38bbb4f2271 Author: Simon McVittie Date: 2012-02-09 15:42:07 +0000 TpContact: stop using about-to-be-deprecated Connection API Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit ebc0d0068b1d362e06767cab760991a09dd862ea Author: Simon McVittie Date: 2012-02-09 15:27:37 +0000 Deprecate tp_channel_is_ready and TpChannel:channel-ready Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit a2bd9248fb0a514d1880902b5b3237a6f1c510fd Author: Simon McVittie Date: 2012-02-09 14:40:34 +0000 Deprecate tp_channel_call_when_ready, tp_connection_call_when_ready Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 7162d30eea3e94894531c1ab6d85b89534cbcada Author: Simon McVittie Date: 2012-02-09 15:58:04 +0000 Use tp_proxy_prepare_async() to prepare connections in example code Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 38b6331ab00d96f81f9eeedeb28a14395f2ff1cb Author: Simon McVittie Date: 2012-03-02 19:11:21 +0000 Don't use tp_channel_call_when_ready, except in its regression tests Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45842 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit ad90e68c7c7ede1a7849151169eea8faddcd1a04 Author: Xavier Claessens Date: 2012-03-01 16:18:04 +0000 Add handle_type arg to tp_capabilities_support_*_call() Like that they can be used to know about call conferences as well. commit d70ba9ba46ea037b8003efc27de7f8c2d067befa Author: Simon McVittie Date: 2012-02-23 15:32:02 +0000 Stop generating lists of signals marshallers altogether Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46523 Reviewed-by: Jonny Lamb commit a7f5ea03fd6b09a8a3c4c3a63a85d0d9932bf11d Author: Simon McVittie Date: 2012-02-23 15:31:36 +0000 Use GLib's default marshaller everywhere In contrast to the previous commit, I'm just using NULL here - telepathy-glib has an explicit dependency on GLib 2.30. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46523 Reviewed-by: Jonny Lamb commit 1eee3b6d61e52c5bf23128236c9f8f931f5ea033 Author: Simon McVittie Date: 2012-02-23 15:30:40 +0000 Generate code that uses g_cclosure_marshal_generic() I'm using the symbol explicitly in the generated code, because if someone copies the tools into another project but forgets to increase the GLib dependency, failing to compile with a missing symbol is a much nicer failure mode than failing to work at runtime. (Also, I haven't checked whether dbus-glib copes gracefully with NULL as a marshaller.) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46523 Reviewed-by: Jonny Lamb commit daed91cba508fa2cc72df986f14585725d324c51 Author: Simon McVittie Date: 2012-02-23 15:29:27 +0000 Require GLib 2.30, for g_cclosure_marshal_generic() Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46523 Reviewed-by: Jonny Lamb commit b13c6c36f5326fcfadc1d22ea1f1fa5fa98eb548 Author: Xavier Claessens Date: 2012-02-29 15:58:20 +0100 TpCapabilities: Add API telling if call and file transfer are supported commit 8cf081eccb2634cff8013463319a5688a68ba71f Author: Olivier Crête Date: 2012-02-24 15:44:20 -0500 Call.Content.MD: Reject codecs with the appropriate error commit 08751a5682109baf203c13f2f4d41cef9356217b Author: Olivier Crête Date: 2012-02-23 21:56:31 -0500 Call.I.Stream: Don't confuse hold and set_sending(FALSE) Don't change the stream direction because of a Hold commit 9f725fe9a199a77fbde1b0d57778b5edb113781c Author: Olivier Crête Date: 2012-02-23 21:55:18 -0500 Call.Content.I.Media: Reject updates while offer is pending Reject updates to the local while there is an offer pending commit dfd72a979c07ee9ce91d8b9a7aa920c214108356 Author: Simon McVittie Date: 2012-02-21 15:41:46 +0000 Remove another unnecessary forward-declaration of TpBaseCallChannel Reviewed-by: Guillaume Desmottes Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46384 commit de075fb368386470a342082a343daa4e3e6a9a0d Author: Simon McVittie Date: 2012-02-21 13:59:05 +0000 Avoid forward-declaring Call classes Having more than one typedef for the same name is an error. If forward declarations are needed to break cycles, the typedef must be *moved* (not copied) from the header it'd normally appear in to the header with the forward declaration: for instance, TpCallContent (forward-declared in call-channel.h) gets this right. In extreme cases, a global "types.h" header can forward-declare everything, although that often leads to unnecessary compilation, so we've avoided it in telepathy-glib. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46384 Reviewed-by: Guillaume Desmottes commit 9a03650ec5a67807bd9f7e022473e8b77b3630c7 Author: George Kiagiadakis Date: 2012-02-21 12:23:20 +0200 example-call: s/Call.DRAFT/Call1/ in example_call.manager Reviewed-by: Simon McVittie commit 66fe90c1096cacad680956f4f564d9394d501812 Author: Simon McVittie Date: 2012-02-20 19:02:45 +0000 Nano version commit 5656c065f5ed1f98a6cd05df6bb0101c7ac88427 Author: Simon McVittie Date: 2012-02-20 17:17:36 +0000 Prepare 0.17.5 commit 453fa6317155cfdb4f741cdeed80f6a5910f5839 Author: Simon McVittie Date: 2012-02-20 17:30:50 +0000 Distribute CaptchaAuthentication commit 5f8bccce9893205d80e63da7e3c75c63c3041381 Author: Simon McVittie Date: 2012-02-20 17:28:35 +0000 Fix out-of-tree releases commit 8ae7472cfdd0b88718c73749d48d03fc2643f290 Author: Simon McVittie Date: 2012-02-14 13:45:45 +0000 Parse arrays of object path in .manager files, for completeness Reviewed-by: Guillaume Desmottes commit 05f741275590cfff37cddf71232778e0a6c30182 Author: Simon McVittie Date: 2012-02-14 13:45:16 +0000 Add the Supersedes property and test it Reviewed-by: Guillaume Desmottes commit 4e72d3e9acfad7200f513f2e3925090f3477f8c5 Author: Simon McVittie Date: 2012-02-20 15:45:08 +0000 Finish Call1 documentation commit c1a420af1ada2ba45b61dfb30de680ad30417dab Author: Simon McVittie Date: 2012-02-20 15:31:06 +0000 Use absolute header paths in headers Not doing so breaks out-of-tree builds of the telepathy-glib examples, which have -I${top_srcdir} and -I${top_builddir} but not -I${top_builddir}/telepathy-glib. commit 78977ba7a02d5df92c94cb757168177825cb4751 Author: Simon McVittie Date: 2012-02-20 15:29:08 +0000 Remove support for the Mute interface, not stable yet commit c99370d3e1532073f526378155bb5183a4f50a3f Merge: 89ebc5c79 50fb23a47 Author: Simon McVittie Date: 2012-02-20 16:35:23 +0000 Merge remote-tracking branch 'origin/call1' into call1 Conflicts: docs/reference/telepathy-glib-docs.sgml docs/reference/telepathy-glib-sections.txt examples/future/call-cm/call-channel.c examples/future/call-cm/call-stream.c spec/Call_Content.xml spec/Call_Content_Interface_Audio_Control.xml spec/Call_Content_Interface_DTMF.xml spec/Call_Content_Interface_Media.xml spec/Call_Content_Interface_Video_Control.xml spec/Call_Content_Media_Description.xml spec/Call_Content_Media_Description_Interface_RTCP_Extended_Reports.xml spec/Call_Content_Media_Description_Interface_RTCP_Feedback.xml spec/Call_Content_Media_Description_Interface_RTP_Header_Extensions.xml spec/Call_Interface_Mute.xml spec/Call_Stream.xml spec/Call_Stream_Endpoint.xml spec/Call_Stream_Interface_Media.xml spec/Channel_Interface_DTMF.xml spec/Channel_Type_Call.xml spec/all.xml telepathy-glib/channel.xml telepathy-glib/extra-gtkdoc.h tests/dbus/call-example.c commit 89ebc5c794da4b2312ea299764f58de2bf037343 Author: Simon McVittie Date: 2012-02-20 15:09:37 +0000 Further update spec, to 0.25.2 Code changes: * Generate code for Chan.T.Call1, Conn.I.Addressing1, Chan.I.CaptchaAuthentication1, and document them * Adapt Call1 CM and test for Direction argument to AddContent * Add CaptchaNotSupported error commit 50fb23a47944f2a47427010db697afe5e4a003df Merge: 724bf9e46 67ab1ed9e Author: Guillaume Desmottes Date: 2012-02-20 10:15:45 +0100 Merge remote-tracking branch 'tester/call1-addcontent-direction' into call1 commit 724bf9e4675d28b29e775c5c4ce8c964eb8ca7e6 Author: Olivier Crête Date: 2012-02-16 16:56:39 -0500 StopTone after StartTone is not a cancellation commit 6953bb5278425cc4e4ff0075052f3c53b59879e8 Author: Olivier Crête Date: 2012-02-16 16:56:22 -0500 MediaCallContent: Don't drop tone currently_sending before it's done playing commit 67ab1ed9edc0ce716557bf8db4fb68267b54bf45 Author: Olivier Crête Date: 2012-02-16 12:51:15 -0500 Add direction parameter to AddContent commit 24e5776b0225f4095372fc9bfe8be33d026b195a Author: Olivier Crête Date: 2012-02-16 12:25:20 -0500 Spec Call: Add direction to AddContent commit 790547386bc0aa39f8135dfb742230ce55f86249 Author: Olivier Crête Date: 2012-02-15 16:41:01 -0500 Test Call: Prepare streams before checking which interfaces it has commit 444bfafef9cb430324e53b92c38d97a17e5d0107 Author: Olivier Crête Date: 2012-02-15 16:08:56 -0500 Remove implementation of the Mute interface commit e4f9a420fc02e5a1b60ef5162e6bddc811c1c854 Author: Olivier Crête Date: 2012-02-15 16:01:53 -0500 Update spec to remove mute commit 71a38001a7e094f2a55bdc6c49665467b94c0dee Author: Xavier Claessens Date: 2012-02-15 11:15:23 +0100 Update to latest spec commit 586522417a3952bf9eae09943dbecf8ceefe345b Author: Olivier Crête Date: 2012-02-14 18:20:01 -0500 BaseCallStream: Put the pending states in the right order commit 1acc0c64548f35ca80421fd99f72ba4e047d4caf Author: Olivier Crête Date: 2012-02-10 11:53:22 +0100 BaseMediaCallContent: Only emit SendingTones when the tones are being sent commit faee7d8bd4282644460a6c54dd6177ea72903801 Author: Olivier Crête Date: 2012-02-10 11:33:31 +0100 BaseCallChannel: Starting to ring means you're not queued commit 1d222677afa04e737d08de9399c05f1e2b3fd242 Author: Olivier Crête Date: 2012-02-09 18:31:02 +0100 Put the event and state in the right order in change requested commit 06c7bcfc8aadb784bec2a1a5b0b6f2ca718fab8e Author: Olivier Crête Date: 2012-02-08 13:01:57 +0100 BaseMediaCallStream: Make it possible for the CM to fail FinishInitialCandidates The CM can now refuse FinishInitialCandidates if it doesn't haven the candidates it needs. commit 8a3806fe3a1340259ff5e740a403d89beeb93f18 Author: Olivier Crête Date: 2012-02-08 13:00:37 +0100 BaseMediaCallStream: Add method to fetch the local candidates commit 5b70e100fcfee015f204b03381960fe49af83e30 Author: Olivier Crête Date: 2012-02-01 18:33:51 +0000 BaseMediaCallStream: Add function to remove endpoints commit b3cb12d0f32a4424efd708bd0bde5f3179a81a85 Author: Olivier Crête Date: 2012-02-01 15:07:48 +0000 Call.Content.MediaDescription: Verify invalid arguments commit 455e07e61e9a3e357c7ed29051dc22d84348516c Author: Guillaume Desmottes Date: 2012-02-14 11:53:38 +0100 start preparing 0.17.5 I didn't change configure.ac yet, we'll do it when actually releasing. commit 46963665e493ca20363a66ff65fb1ca7520b4629 Merge: 892c02224 b0f3d3b61 Author: Guillaume Desmottes Date: 2012-02-14 11:43:34 +0100 Merge branch 'telepathy-glib-0.16' into release Trivial conflicts. Conflicts: NEWS configure.ac commit b0f3d3b614db26db6c4d7a98d5f563d6e2dd060d Author: Guillaume Desmottes Date: 2012-02-13 16:15:47 +0100 set nano flag commit 65226cf0e15b5b62bcef4e13a9fb03e1093d651a Author: Xavier Claessens Date: 2012-02-13 13:02:37 +0100 Fix 2 bugs in DTMF code Also add DTMF unit test that covers both cases commit b72527bcb3147f4cb7df87a293b75e4c674cbae3 Author: Guillaume Desmottes Date: 2012-02-13 14:59:56 +0100 prepare 0.16.5 commit 892c022246793a07a6c087bb13a97e6440fd0322 Merge: 12297c1d9 f6038c7c1 Author: Guillaume Desmottes Date: 2012-02-13 14:32:45 +0100 Merge branch 'telepathy-glib-0.16' commit f6038c7c1a4302e298fbdadc81e5e89fc844e6b2 Author: Guillaume Desmottes Date: 2012-02-13 11:04:17 +0100 make sure the result object stays alive while renaming groups I started tracking this in Gabble so my unit test is living there. https://bugs.freedesktop.org/show_bug.cgi?id=45982 commit 89a7c78224a47b81b6ebc12a3be33b366f787f77 Author: Xavier Claessens Date: 2012-02-13 13:01:27 +0100 Call unit test: Use Media base classes To make it work, example CM needs to create an Endpoint and we have to wait for it to be connected to get to ACTIVE state. commit 7cdf37e9c5407e66615a15e0988f20b2223eb704 Author: Xavier Claessens Date: 2012-02-13 12:56:47 +0100 Fix racy crash in call unit test Keeping a ref on the stream for the timeout make it survive its TpBaseCallChannel leading to issues later. commit 12297c1d9cd9db58cf8be07cf05586ebc080bf72 Author: Simon McVittie Date: 2012-02-09 15:25:48 +0000 Consistently use G_PARAM_STATIC_STRINGS for properties Many didn't use this shorthand, and some even didn't declare one of the three strings as static (causing GObject to copy it). Signed-off-by: Simon McVittie Reviewed-by: Vivek Dasmohapatra commit f654ace092c9a6c4aea6d00bd405f056766a5a50 Merge: 8d4e7536c 10c3dda16 Author: Simon McVittie Date: 2012-02-09 13:30:52 +0000 Merge branch 'telepathy-glib-0.16' Conflicts: NEWS commit 10c3dda166f5dbf8f28117fbe07a4c237ac81598 Author: Simon McVittie Date: 2012-02-09 13:30:00 +0000 NEWS for 0.16 commit d0811d73bd94f31fa9434091441951467884c92f Author: Simon McVittie Date: 2012-02-02 13:44:12 +0000 TpSimplePasswordManager: copy the string into the result Otherwise, if a caller kept a ref to the GAsyncResult after control had returned to the channel, the channel could have freed the GString already. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 4d43c14e47ae3b67a83ff88bc39c34e02ad15434 Author: Simon McVittie Date: 2012-02-09 13:24:57 +0000 tp_account_update_parameters_async: fix lifetime of result, and test it Without this change to TpAccount, the test would fail with a use-after-free while inspecting reconnect_required. The TpAccount code assumed that _finish would always be called directly from the callback, but it is perfectly valid not to do so. In the test, also test Reconnect (which is currently unimplemented), since UpdateParameters and Reconnect are so closely related. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit f91744d3cfe0083338e03abc2ada88c9df7cb9d5 Author: Simon McVittie Date: 2012-02-01 20:27:01 +0000 tp_account_manager_create_account_finish: warn that the return has a limited lifetime Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit c217c8e6c43e35f4729c7a7aa5e7a6c31fbf5f75 Author: Simon McVittie Date: 2012-02-01 20:26:41 +0000 account test: deliberately keep async results after the callback This is valid usage, and often (as in this case!) uncovers bugs. It also makes the flow of the code more obvious. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 8063df40a53ffb596b481b038716aac89f87ba00 Author: Simon McVittie Date: 2012-02-01 20:25:30 +0000 TpAccount: ensure that async-returned objects live as long as the result It is valid to keep a GAsyncResult for as long as you like, so it will have to take a copy of the result data. Otherwise, a change as simple as replacing g_simple_async_result_complete with ..._complete_in_idle will result in the data having already been freed by the time the caller sees it. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit f745ccc6d2fb1fcd3f8bb0c74a1f1d649f1a0870 Author: Simon McVittie Date: 2012-02-01 20:22:56 +0000 TpTestsSimpleAccount: add Avatar interface Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb commit 35e4fa26fd63e17e5123a984b880ad7e9f4c1220 Author: Xavier Claessens Date: 2012-02-09 13:21:49 +0100 Remove useless empty line commit 8d4e7536c0720846a2d9b1789d7358a40bfac2a6 Author: Siraj Razick Date: 2012-01-31 13:02:06 -0500 Produce DLL files when compiled for windows. When we cross-compile telepathy-glib for windows with the current flags we end up with a static library and it creates link issues in libraries and applications which uses teleapthy-glib on windows. to solve this -no-undefined LDFLAG is introduced in this commit. This ensures all the symbols are defined when we compile for windows. see: http://www.gnu.org/software/libtool/manual/libtool.html for more details about -no-undefined flag. Reviewed-by: Simon McVittie (smcv) commit 005655ae50db78c801edaef73bd19cc66eadc772 Author: Xavier Claessens Date: 2012-02-06 14:42:20 +0100 Add config.h include in all call source files commit b978d265c7e7fde904976f432d7b519dd58aec9d Merge: a6ce47466 6d3b61188 Author: Xavier Claessens Date: 2012-02-06 14:36:14 +0100 Merge branch 'master' into call1 Conflicts: examples/cm/callable/conn.c examples/cm/callable/connection-manager.c examples/cm/callable/media-channel.c examples/cm/callable/media-manager.c examples/cm/callable/media-stream.c examples/cm/callable/protocol.c examples/future/call-cm/call-channel.c examples/future/call-cm/call-content.c examples/future/call-cm/call-stream.c extensions/call-content.c extensions/call-stream.c extensions/extensions-cli.c tests/dbus/call-example.c tests/dbus/callable-example.c commit 6d3b611885665f46356623ccb296fe97a8bd8b6a Author: Xavier Claessens Date: 2012-02-06 13:55:59 +0100 Add config.h include in all source files commit 5e2385d21d4c9b4fb268426f2a29cbd301e76e7f Author: Xavier Claessens Date: 2012-02-06 13:38:16 +0100 Disable glib deprecated warnings We need GValueArray for dbus-glib, and it got deprecated in GLib 2.31.x commit 8e1abf1f40d991ef23f4e33697784665681b2f2c Merge: 4718016b8 d60343f25 Author: Simon McVittie Date: 2012-02-02 17:10:39 +0000 Merge branch 'telepathy-glib-0.16' commit d60343f25c2fa949e8c0108e89b915c228e23654 Author: Simon McVittie Date: 2012-02-01 17:51:41 +0000 channel-request test: avoid a race condition If we emit Succeeded or Failed quickly enough after setting up the TpProxy, the match rules might not have reached the dbus-daemon yet. (The real ChannelRequest implementation avoids this bug by having the Proceed method.) Reviewed-by: Jonny Lamb commit 7f8d540689172bfd697e6d22775a94cc73259a3f Author: Xavier Claessens Date: 2012-01-11 15:30:51 +0100 channel-contacts.c: Fix crash when preparing TpCallChannel If if a new contact fetch is queued from the callback of last contact fetch, it leads to a crash. This is because when queueing the new item it is processed right away since it is the only item in queue, then when it returns from g_simple_async_result_complete() it calls process_contacts_queue() again so the item is prepared twice, and then freed twice. Fix this by keeping currently being processes item outside the queue. commit 4718016b803e7b2927c6b9fe74714f028d8aa5f4 Author: Simon McVittie Date: 2012-02-01 17:51:41 +0000 channel-request test: avoid a race condition If we emit Succeeded or Failed quickly enough after setting up the TpProxy, the match rules might not have reached the dbus-daemon yet. (The real ChannelRequest implementation avoids this bug by having the Proceed method.) Reviewed-by: Jonny Lamb commit cdfa979d03137d90150ac030a21c92f1f6e5e60b Author: Simon McVittie Date: 2012-02-01 12:21:28 +0000 Fix brokenness, copy-paste errors and unused variables in tests I thought I'd tested this... but apparently not. Signed-off-by: Simon McVittie Reviewed-by: Xavier Claessens commit c6ed3ecc2e01a6c8a3ff9797e628195e3f56d15b Author: Simon McVittie Date: 2012-01-31 20:02:12 +0000 add tp_connection_disconnect_async to the docs Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45459 commit 258a390e67f46eb24c083e7d4ad3f5d76de33351 Author: Simon McVittie Date: 2012-01-31 19:46:03 +0000 Replace one remaining call to tp_cli_connection_run_disconnect This one is allowed to fail, so use tp_connection_disconnect_async() directly. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45459 commit a09adf6dd3b5a79e3b7206d563d97125b4f5b6e6 Author: Simon McVittie Date: 2012-01-31 19:45:38 +0000 Replace nearly all calls to tp_cli_connection_run_disconnect Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45459 commit dbfd20b0d78e5cdd1ef7ab005d3894c62748b671 Author: Simon McVittie Date: 2012-01-31 19:42:36 +0000 tp_tests_connection_assert_disconnect_succeeds: add This calls Disconnect(), runs the main loop and asserts that it worked. This can be used to supersede most calls to tp_cli_connection_run_disconnect(), which is going away in Telepathy 1.0. Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45459 commit 2615205676777cea11a6f2cd3bdf88ccc049b504 Author: Simon McVittie Date: 2012-01-31 19:40:58 +0000 tp_connection_disconnect_async: add Signed-off-by: Simon McVittie Reviewed-by: Jonny Lamb Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45459 commit a6ce47466a1a725498ea1a54c4a2983063d15049 Author: Nicolas Dufresne Date: 2012-01-26 16:20:20 -0500 CallStream: Add traces to media stream flow state change commit 73270e4351d324963d7bd8fd4eaf46b511e1acb3 Author: Nicolas Dufresne Date: 2012-01-25 16:09:15 -0500 call: Add traces on CallState changes commit 8ad70c119f10d5c4f2603f01d488e1c65b3d144f Author: Xavier Claessens Date: 2012-01-20 13:19:04 +0100 TpCallChannel, TpCallContent: add _send_tones_async() tp_call_channel_send_tones_async() is helper API calling tp_call_content_send_tones_async() on each of its contents supporting the DTMF interfaces. tp_call_content_send_tones_async() does the queuing of events commit be92c904d473f42f6f85066bf3535125fb4f0cce Merge: 043c11f87 8e5aa8b64 Author: Xavier Claessens Date: 2012-01-26 09:31:12 +0100 Merge branch 'master' into call1 commit 8e5aa8b6485afad8658c749a3133b5a3ee5700a9 Author: Guillaume Desmottes Date: 2012-01-24 14:27:24 +0100 account-mgr: pretend that we are AVAILABLE if the best presence is UNSET This is what most UI would expect; they just care if we are connected, not if SimplePresence is actually implemented by the underlying CM. https://bugs.freedesktop.org/show_bug.cgi?id=45120 commit 679ccf8528516d5a4f80cb839adec05b24867700 Author: Guillaume Desmottes Date: 2012-01-25 13:42:39 +0100 more tp_account_manager_get_most_available_presence() tests https://bugs.freedesktop.org/show_bug.cgi?id=45120 commit 8e99dde4875f02654c2738c2c9b0e8d0385f82ba Author: Guillaume Desmottes Date: 2012-01-25 13:36:38 +0100 coding style fix https://bugs.freedesktop.org/show_bug.cgi?id=45120 commit 2b331fb9769be6b64e14c9bc7ef061c370e85a2d Author: Guillaume Desmottes Date: 2012-01-25 13:36:16 +0100 simple-account: add API to change the presence https://bugs.freedesktop.org/show_bug.cgi?id=45120 commit d93a5f53f2ddaa0c97220488a4ade2014bc41cef Author: Guillaume Desmottes Date: 2012-01-24 17:16:25 +0100 start testing tp_account_manager_get_most_available_presence() This was supposed to be the trivial test (accounts are not even used yet) but I already found a bug. :) commit 0981825d45b7c2e665b107ab7567d989b209f62d Author: Guillaume Desmottes Date: 2012-01-24 17:07:00 +0100 add tp_tests_simple_account_manager_set_valid_accounts() Usefull for tests wanting to run with a specific set of valid accounts. commit 49099ed58891b860444b37b29a213013c8d8f38b Merge: 2c99e62bc 0ca5332db Author: Guillaume Desmottes Date: 2012-01-24 17:34:12 +0100 Merge branch 'telepathy-glib-0.16' commit 0ca5332db718340aa8546cd828b138c411a99adf Author: Guillaume Desmottes Date: 2012-01-24 17:14:53 +0100 get_most_available_presence(): match the doc if no account connected If no account is connected, doc says we should return (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, "offline", "") but we use to return (TP_CONNECTION_PRESENCE_TYPE_OFFLINE, NULL, NULL) commit 2c99e62bcf8cf4ab0ddcf6f50641076a77634b5a Author: Xavier Claessens Date: 2012-01-24 14:57:09 +0000 Add extra cast of guchar to guint when using GUINT_TO_POINTER This is a workaround for glib bug #661546 commit 62663e9983186ad6ea63f2cdd9bd431f7c1b1630 Author: Guillaume Desmottes Date: 2012-01-24 15:05:35 +0100 test_offer_race: don't assume any ordering on tube connections Connection is async now so we shouldn't assume any ordering. https://bugs.freedesktop.org/show_bug.cgi?id=45173 commit 043c11f87a0a36c5b0e9189022837f2459e1e6f6 Author: Nicolas Dufresne Date: 2012-01-20 15:25:41 -0500 Fix local hold state stransition for call channel Call channel should go to pending hold state until all the streams are no longer pending stop (the one that didn't failed). Also, the transition from pending stop to started is impossible. commit 777052913570724fb438130eb3cd86a5ada9669e Merge: 4988342c1 10f3e01c9 Author: Xavier Claessens Date: 2012-01-20 16:57:09 +0100 Merge branch 'master' into call1 commit 10f3e01c93ef23a638b934d81fee5015b44be768 Author: Xavier Claessens Date: 2012-01-20 16:55:57 +0100 TpBasePasswordChannel: Use TpBaseChannel:get_interfaces() virtual method commit 4988342c1ba7c174e248ba32f5a06a769cd2b9ad Author: Xavier Claessens Date: 2012-01-20 16:47:50 +0100 Use TpBaseChannel::get_interfaces() virtual method commit 270fbad7b136b76e31c20b7b4f0915174fb51a47 Merge: 28f5e095c 74bd94525 Author: Xavier Claessens Date: 2012-01-20 16:38:06 +0100 Merge branch 'master' into call1 commit 74bd9452523bef1280a708eb31f08b91971bdb1e Author: Danielle Madeley Date: 2012-01-19 12:50:12 +1100 base-channel: deprecate interfaces class property for get_interfaces() method With the interfaces class property, programmers writing a concrete class could not chain-up to inherit the interfaces implemented by the base class. Using a get_interfaces() class method, the programmer can simply add the interfaces she is implementing to those of the base class. Furthermore, classes that only implement an interface in specific instances required a subclass that had to be instantiated by the manager. This is no longer required. For backwards compatibility, the base get_interfaces() method returns the value of the interfaces class property. commit 28f5e095c5b7424427b24c787629c4055348d450 Merge: 4ed646760 139a0f63b Author: Xavier Claessens Date: 2012-01-19 16:32:26 +0100 Merge branch 'master' into call1 commit 139a0f63b6d832ddbff78fb507e1f21ff36680be Author: Xavier Claessens Date: 2012-01-19 15:47:44 +0100 TpStreamTubeChannel: Use async API to send/receive credentials This fixes deadlock in unit test where sending and receiving are in the same process (fd.o#44825). commit 730121cd64471064cc1e76b3fd64a0a8cd612969 Author: Xavier Claessens Date: 2012-01-19 15:46:13 +0100 Add async variant for _receive_credentials_with_byte() and _send_credentials_with_byte() commit 4ed646760253dcc21314d66609ee1c615068d251 Author: Olivier Crête Date: 2012-01-16 11:56:48 +0100 Interfaces property of CallContent is per-object, not per-class The Audio has DTMF, but video doesn't. The class is the same. commit 9dc1689db37fd71f5232529172584d87671a7caf Author: Xavier Claessens Date: 2012-01-16 11:54:49 +0100 TpBaseCallContent/Stream: add get_interfaces virtual method This is more flexible for subclasses to define the interfaces they implement. Especially in the case of sub-subclasse. commit acf6d62027a58460313773da6aa7bf2f8979622a Author: Xavier Claessens Date: 2012-01-12 12:22:20 +0100 TpBaseCallContent: add missing API doc commit b938b6b098b368fca75da92186cb97f49b1b286a Author: Xavier Claessens Date: 2012-01-12 12:19:55 +0100 TpBaseCallContent: Use TpDTMFEvent instead of guchar Also some coding style fixes commit c83721345972a33838c7c089d69d7646a804c9c6 Author: Xavier Claessens Date: 2012-01-12 10:35:03 +0100 TpBaseMediaCallContent: Fix leaked deferred_tones commit b6bec5ffab50b59b6441d0d362968bc2cf377485 Merge: 688bc46c4 7026429f1 Author: Xavier Claessens Date: 2012-01-12 11:04:13 +0100 Merge branch 'master' into call1 commit 7026429f1c375855f32421cc217bba849850792e Author: Xavier Claessens Date: 2012-01-11 15:30:51 +0100 channel-contacts.c: Fix crash when preparing TpCallChannel If if a new contact fetch is queued from the callback of last contact fetch, it leads to a crash. This is because when queueing the new item it is processed right away since it is the only item in queue, then when it returns from g_simple_async_result_complete() it calls process_contacts_queue() again so the item is prepared twice, and then freed twice. Fix this by keeping currently being processes item outside the queue. commit 688bc46c47edc9227c6fab0f22c15d206c4da49e Author: Nicolas Dufresne Date: 2012-01-11 17:35:43 -0500 Fix typo in currently-sending-tones property name commit 67d0f6f75bf3b42ae6a5886125df0fd8f02e6813 Author: Olivier Crête Date: 2012-01-11 16:08:04 -0500 Skip the w on deferred tones commit 42f024b28c211719194f2d4f6a6d4284003d475e Author: Olivier Crête Date: 2012-01-05 17:48:21 -0500 Implement DTMF interface on TpBaseMediaContent commit f10122e854dc4afb934fd1ca145b35c99c3b297f Author: Olivier Crête Date: 2011-12-31 15:48:41 -0500 Implement Call Content in the base class commit 9135915511be313c5f862c1cc209307e5ea3bdab Author: Olivier Crête Date: 2012-01-05 20:49:05 -0500 Implement requestable InitialTones as a Channel property in Call commit 0cea4f1259b12163981212f324671acb82676ad6 Author: Olivier Crête Date: 2011-12-31 14:34:51 -0500 Build Call.Content.I.DTMF commit ac6482196e00f60dc350814de6473084530044cc Author: Olivier Crête Date: 2011-12-31 14:32:36 -0500 TMP: Add Call.Content.I.DTMF from spec branch commit 3335e801ac7a738a7ca7c27371f7ef5fc821a6e0 Author: Xavier Claessens Date: 2012-01-11 13:13:07 +0100 Fix doc of a few lowlevel symbols being in wrong section commit e209c10aa33dbf6270f3a2a92482126bb94c91a4 Author: Xavier Claessens Date: 2012-01-11 11:24:32 +0100 Fix g-i warning commit ab5df5c62a78523ef917b26dd8d11d300c971305 Author: Olivier Crête Date: 2012-01-10 14:49:39 -0500 Call1: Fix unit tests commit d72eb1ebb8a697f8c459fc54ee78a580ced3958a Author: Danielle Madeley Date: 2012-01-11 17:04:44 +1100 call1: swap order of methods in docs for consistency commit 3cbf1f77dc8fd3297c3ae4bed913585a49b9ab3c Author: Danielle Madeley Date: 2012-01-11 16:55:14 +1100 call1: move function docs into the right class From TpBaseMediaCallChannel to TpBaseCallChannel. commit 8332541fe05e171b7ba07fa1fdc6992b379cd2ed Author: Danielle Madeley Date: 2012-01-11 16:46:10 +1100 base-media-call-channel: add classes to gtk-doc commit bfb84444bdc837091f2c61d3311b353a092e5066 Author: Xavier Claessens Date: 2012-01-10 14:47:15 +0100 Doc fix: TP_CALL_STATE_RINGING does not exist anymore commit 0f74acb518654ad19a93acf0afb22b8aa8dd2460 Author: Xavier Claessens Date: 2012-01-10 10:53:20 +0100 Partly fix call unit tests commit f2dc3b62db9a85264d5bcc8f23d4ed887afecf1f Author: Danielle Madeley Date: 2012-01-10 17:45:47 +1100 Mark base call types as abstract Use correct semicolons. commit 182cb712accfe8d4fe3ec964a7b0686f847cd838 Author: Xavier Claessens Date: 2012-01-10 00:16:12 +0100 Make sure to prepare TP_CALL_CHANNEL_FEATURE_CORE after TP_CHANNEL_FEATURE_CORE Otherwise the channel's connect could be still unprepared and so fail to prepare channel's contacts. commit ea056eea030cddd077aa51ef7f6d609a9eb82260 Author: Danielle Madeley Date: 2012-01-07 12:22:50 +1100 base-media-call-content: fix parameter for tp_bmcc_offer_media_description_finish Takes a content, not a MediaDescription otherwise it fails the check for the correct type. commit 3143dc922cc1a0a100fb1a525e20e23f134496ad Author: Danielle Madeley Date: 2012-01-04 17:36:27 +1100 base-call-content: deinit the content instead of just asserting If for some reason the programmer hasn't deinited the content, just do it for her. commit 0e7285e77b31f7082da40f362c994a1744b4cfdb Author: Xavier Claessens Date: 2012-01-03 17:05:27 +0100 fix trivial typo commit 2495de343c185261402012e93e8d2ca0c69c38b2 Author: Xavier Claessens Date: 2012-01-03 14:21:46 +0100 a bit of code moving commit 4b41d1eae17ac3eab6a7f77b60a1d0ef80d598b3 Author: Xavier Claessens Date: 2012-01-03 13:40:25 +0100 few coding style fixes commit 8f1737a03cb4f311d3a494e80a998c9a8aabb6a5 Author: Xavier Claessens Date: 2012-01-03 12:35:50 +0100 More doc fixes commit 4f605b73f6cd3a105825cfbdb4043a52a887b00f Author: Xavier Claessens Date: 2012-01-03 12:34:56 +0100 Make tp_base_call_channel_is_connected/locall_accepted internal commit fd32df030ad852753161ea08df4ea63819be3d9d Author: Xavier Claessens Date: 2012-01-02 16:16:41 +0100 update documentation commit e2540c1bd73836f93125bac37727fe668c36da6a Author: Xavier Claessens Date: 2012-01-02 15:36:36 +0100 TpBaseMediaCallStream::set_sending: self is not a TpBaseCallStream This is more typesafe. commit 290d344c0df321650fc5aee4a6acd6f3ffed3b74 Author: Xavier Claessens Date: 2012-01-02 15:11:56 +0100 TpCallStreamEndpoint: ensure username/password is never NULL This is how it's done in TpBaseMediaCallStream as well. commit 5c2c2cbb14319e1b750d8cdfd348e90354598fa8 Author: Xavier Claessens Date: 2012-01-02 15:04:22 +0100 TpBaseMediaCallStream: move code around to be correctly grouped and fix coding style commit 00da5756da8f415c9437c56ec30d3369988837a7 Author: Xavier Claessens Date: 2012-01-02 15:01:09 +0100 TpBaseMediaCallStream: small simplification commit 43d12cd2688ae7c52a3e6a25e961775121935d31 Author: Xavier Claessens Date: 2012-01-02 13:56:30 +0100 Avoid small code duplication commit d9af29eab63185c48557125757c7b203af4589c5 Author: Xavier Claessens Date: 2012-01-02 13:56:14 +0100 coding style commit 37448a7b3258fd5b16ff0822bf0bda2a7541a047 Author: Xavier Claessens Date: 2012-01-02 13:40:50 +0100 TpBaseMediaCallStrea: Use a TpIntset instead of GArray for a set of TpHandle commit edbd5f82543c8b889fa5d43f592aec741a605709 Author: Xavier Claessens Date: 2012-01-02 13:23:10 +0100 small coding style commit 35f5357513aa4ba938859c946c48f30959b171ad Author: Xavier Claessens Date: 2012-01-02 12:04:09 +0100 Rename _borrow_remote_members to _get_remote_members Our coding style is that _get_ returns a borrowed pointer, and _dup_ returns a copy/ref. commit 882edc1b6f6c44dda61e3ec8ffe9189e37d87ea8 Author: Xavier Claessens Date: 2012-01-02 12:00:01 +0100 some coding style commit 7e131bf3c66197d0eebc2d5e361514c3139d0b45 Author: Xavier Claessens Date: 2012-01-02 11:55:29 +0100 Fix some coding style commit f49f8ee72edff473a34605a3bfd9b44cf29eeef3 Author: Xavier Claessens Date: 2012-01-02 11:15:37 +0100 TpBaseCallChannel: move code around to group public methods commit 0c097231f467745dca59767adad5eba687cb8e8a Author: Xavier Claessens Date: 2012-01-02 11:15:05 +0100 TpBaseCallChannel: is_connected and remote_accept virtual methods are private They only need to be implemented by TpBaseMediaCallChannel so does not have to appear in public API documentation commit e84162c57957b438eb82fc4305149e863bbf9b73 Author: Xavier Claessens Date: 2012-01-02 11:08:38 +0100 TpBaseCallChannel: Move state from ACCEPTED to ACTIVE depending on connectivity commit abe4571a999b05c86b6e0dd25b23c131a4981fe4 Author: Xavier Claessens Date: 2012-01-02 10:51:13 +0100 fix some coding style commit 77ea29e129258cba5176a410e03eea0eee6285fc Author: Olivier Crête Date: 2011-12-30 17:53:19 -0500 Disable sending if all members of a stream are remotely held commit 386570bb305f6149d9394f768deb53a6c2ccc9b7 Author: Olivier Crête Date: 2011-12-30 17:13:56 -0500 Implement Local hold for Call commit f3dfe4aaec613871a5b9101e2024f131d3985584 Author: Olivier Crête Date: 2011-12-29 22:49:26 -0500 Call.Stream.I.Media: Make setting the sending state mostly internal commit dbe9e55f752f76372190414232c3066b4411cfe7 Author: Olivier Crête Date: 2011-12-29 18:33:22 -0500 Call.Stream.I.Media: Make setting the receiving state internal commit d8ff77603e0e4fe8d9fdff32bcbfce387a4d39ed Author: Olivier Crête Date: 2011-12-29 17:21:34 -0500 Centralise setting the local hold state in one place commit e23bcddb2f69720a8163e3a21db7d8d5fddb775c Author: Olivier Crête Date: 2011-12-29 17:21:09 -0500 Only call the subclass if the requesting state was directly requested commit de1dc1dce8cde4e81986f537317c8da05d3fccee Author: Olivier Crête Date: 2011-12-29 17:20:52 -0500 Ignore re-settings that change nothing commit a5e24b25e63510ee2f5992237841b222e6b98b06 Author: Olivier Crête Date: 2011-12-28 01:08:21 -0500 Start receiving when the other sides asks us to commit aa850a6172460e88549bb272d5c94f02a7698ba5 Author: Olivier Crête Date: 2011-12-27 01:45:27 -0500 Reject direction changes if the protocol doesn't allow it commit 417433676520ac3fc38b31681af0d012d7d3c2de Author: Olivier Crête Date: 2011-12-27 00:52:56 -0500 Fix request_receiving commit 85cb6c819840038dad1dc11ae3ede705fd0ff91f Author: Olivier Crête Date: 2011-12-26 23:48:52 -0500 Emit Initializing before initialised and accepted before active. This should make it possible ot have slightly simpler clients commit 217d464526c6b5ea370b40249249825fdc42216f Author: Olivier Crête Date: 2011-12-26 23:08:48 -0500 Set the right Call state based on endpoint connectedness commit aae1ccf8c6fde76f7728aa921d0bacb138ad5440 Author: Olivier Crête Date: 2011-12-26 20:56:50 -0500 Set the sending and receiving directions correctly commit 8aa61104494698debae8df3c11bc9df672c6dbc9 Author: Olivier Crête Date: 2011-12-23 15:58:11 -0500 Remove another duplicated Contact It is already in the media description offer commit 33ceebb411fe0a8ac51f9c2f3f668c48feea837a Author: Olivier Crête Date: 2011-12-23 13:15:13 -0500 Update for Call spec changes commit 029b36a7e2597524bbf07495ffc19aa8eb90cc22 Author: Olivier Crête Date: 2011-12-23 12:59:41 -0500 TMP: Update to misc changes to Call spec commit f7c32e20115d655ac5fecde945de3c6df7a1d009 Author: Olivier Crête Date: 2011-12-23 11:35:28 -0500 Show the new state in the state changed cb commit 475de423b63e35134100caf7ce004fa2b30e933c Author: Olivier Crête Date: 2011-12-23 11:35:10 -0500 Add API to let the CM set the remote credentials commit 7bffb4deff8d5f15ccb5522457b07ece9b9c011f Author: Olivier Crête Date: 2011-12-23 11:34:46 -0500 Avoid trying to empty already empty GArray commit fb77554c3f5304ec332b6037476a9d68d8ea8656 Author: Olivier Crête Date: 2011-12-16 18:57:33 -0500 Implement the sending/receiving states in TpBaseMediaCallStream commit 24becc3d5895f280f666c9887da2c88a05e20045 Author: Olivier Crête Date: 2011-12-15 19:15:09 -0500 Implement the locally muted flag commit 43c27b7fb57113c634fd410ec53b939900801506 Author: Olivier Crête Date: 2011-12-15 19:02:05 -0500 Add TpBaseMediaCallChannel class commit b865b00203491fb036a07824eea950ae2ffb4f0b Author: Xavier Claessens Date: 2011-12-22 09:31:44 +0100 Set TpBaseMediaCallContent:packetization construct-only commit 6a24778fd49b3cde261330235d3cf66912a08dc2 Author: Xavier Claessens Date: 2011-12-20 11:20:02 +0100 Generate lowlevel API for Content.iface.AudioControl commit fd225e4ab7fb6229a0f4a452508c89e21bec3e73 Author: Xavier Claessens Date: 2011-12-20 10:09:36 +0100 TMP: add AudioControl iface commit bf876c3f66086118e238a396df22a7a2ee04458c Author: Olivier Crête Date: 2011-12-13 17:14:21 -0500 Export has-remote-information correctly commit 7fde176fffd95df29ea7f544a7f3faa65f91af77 Author: Olivier Crête Date: 2011-12-13 16:01:34 -0500 Emit notification when the Endpoint state changes commit 9e973cb579861f40037b41e4f5887726c68e637b Author: Xavier Claessens Date: 2011-12-14 09:33:05 +0100 Accept NULL dbus_reason and message Better be safe than sorry commit 204f700e0d45d6dce65f12ef4c84d3de3f50a35e Author: Xavier Claessens Date: 2011-12-09 15:33:51 +0100 Fix Initialising->Initialised transition commit b68d0a041345e8967f55b75e039a985c298cfb3f Author: Xavier Claessens Date: 2011-12-09 12:08:39 +0100 Replace TP_CALL_STATE_RINGING with TP_CALL_STATE_INITIALISED commit 8c1a487217e396ea766f6af9ffce9906b887c29b Author: Xavier Claessens Date: 2011-12-09 11:20:18 +0100 TMP: spec update commit feb529363bfdb3d2e0a067154fedb8f241f50023 Author: Xavier Claessens Date: 2011-12-08 17:33:15 +0100 TpBaseCallChannel: move to RINGING state when all its endpoints are CONNECTED commit 7b5ef139e9174f87a616e819deb4d99b6c83017a Author: Xavier Claessens Date: 2011-12-08 17:32:31 +0100 TpCallStreamEndpoint: keep a pointer to its TpBaseMediaCallStream commit 13551baf121d6d9eab997c20fc144e1344e1df11 Author: Xavier Claessens Date: 2011-12-08 17:29:18 +0100 TpCallStreamEndpoint: add _get_state() method This returns the state of a given component commit 6fa1239044bd7db049fa7591f386874aa3851321 Author: Xavier Claessens Date: 2011-12-08 17:27:43 +0100 TpBaseCallChannel: setting member flag RINGING does not make state move to RINGING commit 700321ee4ecf772377d6c1a26db9ad478b33dc8f Author: Xavier Claessens Date: 2011-12-08 17:25:17 +0100 TpBaseCallChannel::add_content, special case for INITIAL contents If content's disposition is INITIAL, set the corresponding initial-audio/video and initial-audio/video-name properties. commit 59fd037a2ec947d654696469ad4500f0a2b619b8 Author: Xavier Claessens Date: 2011-12-08 12:51:22 +0100 Make some vmethod optional to implement, and document optionals/mandatory commit 804623f4e43c39853e0c204cc7b1af7f0f9e7085 Author: Xavier Claessens Date: 2011-12-08 10:51:23 +0100 TpBaseMediaCallStream: Ensure that username/password are not NULL This fixes a crash in gabble commit b5c74fb15b5783075911351c94525b3e16639d1c Author: Xavier Claessens Date: 2011-12-07 14:39:37 +0100 Add more DEBUG to help debugging Calls commit e5d0674b64817d690041d0263cdad5743b04e17a Author: Xavier Claessens Date: 2011-12-07 10:56:50 +0100 trivial coding style fix commit b1c3dcf25f0ff3e04bc53b6fcdd6c5ff5e8d4eed Author: Xavier Claessens Date: 2011-12-06 15:29:05 +0100 TpBaseMediaCallStream: Let CM set sending/receiving PENDING states commit 3a2807309b1e08d1f573835a742976ea49134af4 Author: Xavier Claessens Date: 2011-12-06 15:09:18 +0100 TpBaseMediaCallStream: implement remaining methods CompleteSendingStateChange, ReportSendingFailure, CompleteReceivingStateChange and ReportReceivingFailure commit 77ba5a3f3917d4b6b1f1aa2d757fa39b6fe3d5aa Author: Xavier Claessens Date: 2011-12-06 15:08:05 +0100 TpCallStreamEndpoint: inform CM when candidate is selected/accepted/rejected This is done via a signal instead of a virtual method to implement because TpCallStreamEndpoint is not a base class. commit 0d42cb7fd24f0d2fabdfbb0a0a1a7d5dcb3c570a Author: Xavier Claessens Date: 2011-12-06 11:52:22 +0100 TpBaseMediaCallContent: Make offer_media_description async commit 07f53b53462405ce7d17c93fbf83e3fe450a5f32 Author: Xavier Claessens Date: 2011-12-05 18:53:44 +0100 Correctly implement SetSelectedCandidate commit 900356549923fa812110b0107c38d7c8908d5492 Author: Xavier Claessens Date: 2011-12-04 10:36:13 +0100 Implement TpBaseMediaCallStream::fail commit 99f4b6e4b714fc28e30ab3d1761ab64881abed7d Author: Xavier Claessens Date: 2011-11-25 17:00:22 +0100 Add TpBaseMediaCallStream and TpCallStreamEndpoint commit c2c1608cf89393cb79d3c88b6427a8c1186931cb Author: Xavier Claessens Date: 2011-11-24 16:45:07 +0100 Add TpBaseMediaCallContent and TpCallContentMediaDescription objects commit 72b1b1cca4a9efb0c8b88c079d5ebd704d975f48 Author: Xavier Claessens Date: 2011-11-24 16:43:23 +0100 TpBaseCall*: export some internal apis commit 7dbf69920a906a5c4a378f737ec8fdde3e0da1e6 Author: Xavier Claessens Date: 2011-11-24 16:38:42 +0100 TMP: spec fix commit 0ebb5abeb8b6a5a27ac41620cb2ac7d274bfadef Author: Xavier Claessens Date: 2011-11-23 10:22:52 +0100 Call CM example is not future anymore commit f2d82e052eb2ba059e9a8ed08d5156f26f5d2dd7 Author: Xavier Claessens Date: 2011-11-23 10:19:12 +0100 Remove StreamedMedia example commit cdd6f92b95dc9e94b1827c45fdf08da2fff75147 Author: Xavier Claessens Date: 2011-11-18 10:13:01 +0100 Port example call CM to TpBaseCall* commit 7195abaa3a49bd679f8898523fc9e653e24b6a45 Author: Xavier Claessens Date: 2011-11-18 10:10:41 +0100 Add TpBaseCallChannel, TpBaseCallContent and TpBaseCallStream commit 2ed58c29e2dbd1b114a2f0c55019168a37bf2063 Author: Xavier Claessens Date: 2011-11-22 13:31:17 +0100 TpBaseChannel: Add tp_base_channel_get_self_handle() commit 945e6690b216c58af00bf3844a712a4155373aff Author: Xavier Claessens Date: 2011-11-14 14:50:12 +0100 Add tp_call_channel_has_dtmf() commit 09c4935a9ad87b764b6b70cb96183535ca9437e3 Author: Xavier Claessens Date: 2011-11-14 11:04:25 +0100 Rename unit test call-example.c to call-channel.c commit 90a78cf04777f9bca71de66ec360e5506b69be67 Author: Xavier Claessens Date: 2011-11-14 11:03:32 +0100 Port call-example unit test to TpCallChannel commit 1dd8f264178349681604b2286395b8c1ead46825 Author: Xavier Claessens Date: 2011-11-12 13:16:07 +0100 Port example call implementation to TpBaseChannel commit c5e38258c9cea6f2916c5ecbb2292336c62413bf Author: Xavier Claessens Date: 2011-11-14 11:02:30 +0100 TpCallChannel, TpCallContent and TpCallStream: add _async() operations commit 500436718000e3d7b097336c16ebd5f25168aed3 Author: Xavier Claessens Date: 2011-11-11 17:18:57 +0100 TpCallStream: introspect all properties and add getters Based on TpyCallStream merge stream commit 3252eb11bafebd0e25ea39f71059d179aafe64c5 Author: Xavier Claessens Date: 2011-11-11 17:18:27 +0100 TpCallContent: introspect all properties and add getters Based on TpyCallContent commit 23d40d437a2fa02881e24eccba88b314e4c5a3fd Author: Xavier Claessens Date: 2011-11-11 17:17:02 +0100 TpCallChannel: introspect all properties and add getters Based on TpyCallChannel code commit 1b672007bf9d08950f7eba85098b4f88d2a8dd29 Author: Xavier Claessens Date: 2011-11-08 11:57:57 +0100 Remove extensions/ It was used only for Call draft APIs. Now we can use the stable APIs. Authors: Will Thompson and David Laban commit 3fb5a0f0d3b5cf26257ac972ebdc853dd88de2a1 Author: Xavier Claessens Date: 2011-11-08 11:51:54 +0100 Generate lowlevel API for Call1 spec Add skeleton for TpCallChannel, TpCallContent and TpCallStream commit 45d9a2b8758edfedd15fc4203236918fdfa6fe14 Author: Olivier Crête Date: 2011-10-23 13:04:18 +0200 Add Call debug class commit bece0b27f6bfdf622c0c99b9364766f7e38d57da Author: Xavier Claessens Date: 2011-11-08 11:47:40 +0100 TMP: Mark call1 spec stable commit 9d92fa09f6d4e20f3000f6c9863eb1ef937267e0 Author: Siraj Razick Date: 2011-12-21 15:03:15 -0500 Changes required to cross compile with mingw32 These changes enables us to cross compile telepathy-glib for windows commit 50a3f4139b2b3419aec5ee489342e5da0fcb6f7f Author: Guillaume Desmottes Date: 2011-12-19 16:30:36 +0100 set nano version commit f8d067e29a5f5be1aaa488a1b1b224aaea993cb7 Author: Guillaume Desmottes Date: 2011-12-19 16:18:11 +0100 prepare 0.17.4 commit cbd087f7f8959ad0208ba35d0a2a68fd60e6a1fe Author: Xavier Claessens Date: 2011-12-13 14:00:54 +0100 Simplify _finish() functions using _tp_implement_finish_* commit 15bf9ec4887974ee5a3d676821cc9f7623c72bfd Merge: 1a44fc2a3 ef4bb3485 Author: Xavier Claessens Date: 2011-12-13 13:27:56 +0100 Merge branch 'telepathy-glib-0.16' commit ef4bb34859576d60ee3bb9d80d16ea582dba8e72 Author: Xavier Claessens Date: 2011-11-04 16:44:26 +0100 TpSimple{Observer, Approver, Handler}: Do not use deprecated API doc examples commit 1a44fc2a3e42c329dc84d357eb286cff7cde67ee Merge: 31c15e7f8 bc9bd8a38 Author: Guillaume Desmottes Date: 2011-12-13 11:36:38 +0100 Merge branch 'telepathy-glib-0.16' Conflicts: NEWS configure.ac commit bc9bd8a381c5162140d0418abb9f2cafe7e2d8a0 Author: Guillaume Desmottes Date: 2011-12-13 11:33:04 +0100 set nano flag commit 4be3683ceabaa6215b933db595da86d9007dad85 Author: Guillaume Desmottes Date: 2011-12-13 11:17:56 +0100 prepare 0.16.4 commit 31c15e7f8a27db0a578cab06466ea7ade484622a Merge: fa5bb85c8 78c39c68e Author: Guillaume Desmottes Date: 2011-12-13 09:47:46 +0100 Merge branch 'telepathy-glib-0.16' commit 78c39c68e7722673e1737cbaaeb44f8357524968 Author: Guillaume Desmottes Date: 2011-12-12 17:48:06 +0100 handle_owners_changed_prepared_cb: use a NULL safe g_object_ref An unknown owner is implemented storing a NULL TpContact in the hash table. https://bugs.freedesktop.org/show_bug.cgi?id=43755 commit fa5bb85c8954ee23a903192b875fb89d8c1b421b Author: Guillaume Desmottes Date: 2011-12-07 11:13:27 +0100 tp_account_set_uri_scheme_association_finish: use _tp_implement_finish_void() commit 9a8084232de58a23efd255add90f378532da3420 Merge: e88ba20da 788e6a69c Author: Guillaume Desmottes Date: 2011-12-07 11:11:33 +0100 Merge branch 'telepathy-glib-0.16' into trivia commit 788e6a69c8414b64052c65ceb834430ffca11e56 Author: Guillaume Desmottes Date: 2011-12-07 11:03:55 +0100 tp_account_set_uri_scheme_association_async: set the right source tag Convention is to use the _async method as that's what being checked in tp_account_set_uri_scheme_association_finish(). commit e88ba20da99e8ebd323dfb09e5c99171d5f17bb5 Merge: 0524a4a2b 282f4985e Author: Danielle Madeley Date: 2011-11-28 22:21:31 +1100 Merge branch 'telepathy-glib-0.16' commit 282f4985ebc1dbeac9a181c00d5bf47defabbffe Author: Danielle Madeley Date: 2011-11-24 17:57:39 +1100 Remove ; that should not be commit 0524a4a2bfee7655d3d7a85e9ac4735e97911904 Author: Guillaume Desmottes Date: 2011-11-28 12:01:50 +0100 set nano flag commit 01e360d649628e578eaeafd8deb33075d925e2aa Author: Guillaume Desmottes Date: 2011-11-28 11:28:31 +0100 Version 0.17.3 commit 111576f9ba3bdaa1df0ebd81be3601c816c43bb9 Merge: 175f74a06 6e1187c36 Author: Guillaume Desmottes Date: 2011-11-28 11:25:42 +0100 Merge branch 'telepathy-glib-0.16' Conflicts: NEWS configure.ac commit 6e1187c3634e284254874a65349196ba7cb150d8 Author: Guillaume Desmottes Date: 2011-11-28 11:22:25 +0100 set nano flag commit 7c7ded2fcf8319fa09b0258ce2829433037c2b9b Author: Guillaume Desmottes Date: 2011-11-28 11:01:15 +0100 prepare 0.16.3 commit 175f74a06a124c699595503c55ac26be5086b3bc Author: Guillaume Desmottes Date: 2011-11-28 10:30:47 +0100 tests/dbus/connection-balance: use tp_tests_proxy_run_until_prepared() commit 58ef08c1c871631c22d234a9b96003228da60a94 Author: Guillaume Desmottes Date: 2011-11-25 11:11:14 +0100 Add tp_connection_can_set_contact_alias() https://bugs.freedesktop.org/show_bug.cgi?id=28037 commit 997565cb54c780c7fe7bee9cd949bfa7a0f888d9 Author: Will Thompson Date: 2011-11-23 23:13:49 +0000 Bump nano-version commit d4b53bd7f1c3e4ba4e64112e2d6afbaacccac7ce Author: Will Thompson Date: 2011-11-23 23:06:40 +0000 Makefile: fix out-of-tree maintainer-upload-release Historically, gtk-doc cleverly put the docs into the srcdir, not the builddir. This is fixed these days, so we need to update this rule accordingly. commit e3e191cdb83bce235fbcf10d7ee6ab879fa83734 Author: Will Thompson Date: 2011-11-23 16:15:26 +0000 Version 0.17.2 commit 3c5dc1e3f7dd27b7261d5a41be32061dfea7cc77 Author: Will Thompson Date: 2011-11-23 22:42:19 +0000 docs: refer to the renamed NormalizedContactURI commit d4f2471d45a8e689510ebf1fac15a2d21c39cd36 Author: Will Thompson Date: 2011-11-23 16:12:45 +0000 NEWS for 0.17.2 I genuinely laughed out loud when I saw the line removed by this patch. commit 41f571bbfa95a6231b4e96df0412d2ab2fcbef18 Author: Will Thompson Date: 2011-11-23 16:05:15 +0000 Update the rest of the spec to 0.25.1 commit 23ea29277756631413ce901b108dd4ea792a954d Merge: a28df1e2c c984facfd Author: Will Thompson Date: 2011-11-23 16:03:18 +0000 Merge remote-tracking branch 'andrunko/protocol-addressing' commit a28df1e2c3c883c7a266b078c6491fa986daabcc Merge: fb98b4780 d830c3d8b Author: Will Thompson Date: 2011-11-23 16:01:53 +0000 Merge remote-tracking branch 'jonny/misc' commit fb98b4780bb1cf281f34641e3f93c48d61962815 Author: Will Thompson Date: 2011-11-23 15:58:20 +0000 Makefile: make gir file depend on .la file As of 7728cd8d, this dependency wasn't explicitly stated, so parallel make either blew up or introspected the .la file left around from a previous run. commit 83cd0ef8c56944a8b77a4d921efcd13596243626 Author: Will Thompson Date: 2011-11-23 15:57:30 +0000 Tell GI to skip tp_svc_interface_get_dbus_properties_info The DBus properties mixin is unusable from introspected code at the moment. commit d830c3d8b67238b8173077fa3ea01857edb8149e Author: Jonny Lamb Date: 2011-11-23 14:47:25 +0000 docs: many misc fixups We still have multiple gtk-doc warnings which are much harder to fix, such as things like this in the spec: "see bug #26417" html/telepathy-glib-channel-text.html:1538: warning: no link for: '26417:CAPS' -> (26417). and the change I made to the code generator in c0b13f7ccc26e78. Signed-off-by: Jonny Lamb commit a2ea6309a9fe52c7f6963a4c36b4f2a95c526c29 Author: Derek Foreman Date: 2011-05-13 15:21:42 -0400 Support building for Android https://bugs.freedesktop.org/show_bug.cgi?id=42447 commit c984facfd1126ae71720ddfe9ba6505ac3733748 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-21 12:47:33 -0200 Update Conn.Interface.Addressing from tp-spec. commit 6bed6fdea8a9c93fc940b074c3ca230f13413bac Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-21 12:48:19 -0200 Update Proto.I.Addressing from tp-spec. commit bbb6c4d0f33bbdb7a7769fdf145f0811d64a92cf Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-14 14:45:41 -0200 TpBaseProtocol: Add "Func" Suffix to TpBaseProtocolDupSupportedVCardFields and TpBaseProtocolDupSupportedURISchemes. commit 6e827ab08236680481ce027258c517b62a68adf2 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-14 14:36:00 -0200 TpBaseProtocol: Rename Get/get to Dup/dup on callbacks to retrieve the supported vcard fields/uri schemes. commit f7543ff4873819d61fd5613ad3a11b62fbc22724 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-14 13:28:08 -0200 protocol-objects test: Properly check for advertised interfaces. commit 7d4548b6825db8110051174297aef792f80b553f Author: Andre Moreira Magalhaes (andrunko) Date: 2011-11-14 13:25:34 -0200 Update documentation for Proto.I.Addressing support. commit cfc73d25323410f394f9625d1f72571a22740f9a Author: Eitan Isaacson Date: 2011-01-03 12:56:26 -0800 Make Protocol.Interface.Addressing functionality a GInterface. commit a45dc50337a4e377294a6088ab3bb8ac6662c9ca Author: Eitan Isaacson Date: 2010-12-27 15:38:36 -0800 Basic protocol addressing test. commit 1ace42d618a5f099727215305553f5c9503d9fb1 Author: Eitan Isaacson Date: 2010-12-27 14:56:38 -0800 Added Protocol.Interface.Addressing support. commit 727fe764db9b6695ee5a31f16f89119339e33009 Author: Eitan Isaacson Date: 2010-12-27 15:40:50 -0800 Undraft Protocol.Interface.Addressing. commit 717db63a6ed18186670fb7f97ddc5a2e15c82937 Author: Jonny Lamb Date: 2011-11-18 10:41:24 +0000 ft-channel: ensure incoming connections are actually closed (and not leaked) Previously, we were getting the GSocketConnection and using it, but once the splice operation was complete, we were only closing one side of it, and then leaking the object in the process. This is a problem because CMs can wait for EOF on the stream (like salut) so if the stream isn't closed properly transfers can hang. It wasn't noticed properly before because other CMs automatically close the connection when the number of received bytes looks sane (like gabble). And yes, also we were leaking the GSocketConnection object. Signed-off-by: Jonny Lamb commit b3f50e345e8dabb2c620420e5889a2167935ffd7 Author: Xavier Claessens Date: 2011-11-16 15:15:44 +0100 Add coding style check for g_hash_table_destroy and g_array_free usage commit 67bffca0678d1286d07b1531f6562126e92cc31e Author: Xavier Claessens Date: 2011-11-16 14:08:45 +0100 Use _unref instead of _free _destroy when possible. Replace g_(ptr_)array_free (foo, TRUE) and g_hash_table_destroy with respectively g_(ptr_)array_unref (foo) and g_hash_table_unref. I used this command to generate this patch: for f in `find -name "*.c"`; do sed -i $f -re 's/g_ptr_array_free \(([^ ,]+), TRUE\)/g_ptr_array_unref \(\1\)/'; done See Danielle's blog for explanation of possible bug _free can do: http://blogs.gnome.org/danni/2011/11/16/mistakes-with-g_value_set_boxed/ commit e6d8b4c7531688cd2dbd3c9bbd8a6c224123de05 Author: Will Thompson Date: 2011-11-15 11:33:21 +0000 configure: remove --enable-handle-leak-debug Since handles became immortal, this has just been vestigial. commit 21a2ee1810bc401cd7553ebf5d75f0dfe4a27cee Author: Jonny Lamb Date: 2011-11-15 11:39:17 +0000 start on 0.17.2 Signed-off-by: Jonny Lamb commit e2729497d75412198667b991c179877e5d0e3c48 Author: Jonny Lamb Date: 2011-11-15 08:33:27 +0000 version 0.17.1 Signed-off-by: Jonny Lamb commit 16d7b1c02c3d470ff8612543fa6918a9e37db794 Author: Jonny Lamb Date: 2011-11-14 17:25:19 +0000 tests: fix coding style Signed-off-by: Jonny Lamb commit b0e9b65f364c3e3f382a0f1c65743310415f22a4 Author: Jonny Lamb Date: 2011-11-14 17:01:38 +0000 ft-channel: fix a programlisting end tag What a buffoon. Signed-off-by: Jonny Lamb commit f3c3f199bc239be446cd8d721f8f20f60d6ea02d Merge: b3b8af77e aeec48523 Author: Jonny Lamb Date: 2011-11-14 16:08:40 +0000 Merge branch 'ft-send-receive' commit aeec485234085d2fe78d2cad3f62f62f19ed1ac3 Author: Jonny Lamb Date: 2011-11-14 15:20:43 +0000 ft-channel: add example of request channel with metadata Signed-off-by: Jonny Lamb commit 392eb1b4eee3b2af25497f89949347d2a3b8161f Author: Jonny Lamb Date: 2011-11-14 15:07:13 +0000 ft-channel: replace example tags in docs with shorthand Signed-off-by: Jonny Lamb commit b3b8af77e5ab16228b0adc45d67ecec9b425fb54 Author: Will Thompson Date: 2011-11-11 19:49:00 +0000 Update make-release-mail.py from the Gabble. commit a39ac85357a6855aa629b35169ae8eb488667372 Merge: d6118003e 079837c22 Author: Will Thompson Date: 2011-11-11 17:47:41 +0000 Merge branch 'telepathy-glib-0.16' Conflicts: configure.ac commit 079837c22b691658d6748f54a2124ab5c847e639 Author: Will Thompson Date: 2011-11-11 16:37:58 +0000 configure: bump gobject-introspect dep to 1.30 Sjoerd tells me that “with older g-i you don't get all annotation right and gnome-shell will fail”. Specifically, methods like DelegateChannel(), used by Gnome Shell 3.2, don't work. 1.30 is the current stable release. commit ab416676f64bd920a56656220c9988e99a225ec9 Author: Travis Reitter Date: 2011-10-26 16:58:56 -0700 Bump the Vala requirement to fix binding for ContactInfoField Vala-0.12 does not generate the constructor for ContactInfoField, which causes a build failure for Folks (and any other clients that depend upon creating new ContactInfoFields from Vala). Empathy 3.2, for whose benefit the 0.16 stable branch of tp-glib exists, depends (via Folks) on telepathy-glib being built with at least valac-0.14. https://bugs.freedesktop.org/show_bug.cgi?id=42296 commit 6f51daf994524450db3dab919b8a49786080a826 Author: Jonny Lamb Date: 2011-11-11 11:03:02 +0000 ft-channel: add missing colons to gtk-doc headers Signed-off-by: Jonny Lamb commit 0275247b2571bf9c2ffe2c9351444b122556bf6b Author: Jonny Lamb Date: 2011-11-11 10:57:50 +0000 ft-channel: more documentation fixups Signed-off-by: Jonny Lamb commit 0390518a6975c53c007345f53e712ab76f6fe281 Author: Jonny Lamb Date: 2011-11-10 12:51:25 +0000 ft-channel: removed useless debugs Signed-off-by: Jonny Lamb commit de3e0eca143b367046952e29ed67804501f2e23e Author: Jonny Lamb Date: 2011-11-10 12:50:37 +0000 ft-channel: misc updates to the docs And added a sly "priv->metadata is always non-NULL after CORE is prepared". Signed-off-by: Jonny Lamb commit 45ef3a0cce2256fa847646a8284e4f659093054e Author: Jonny Lamb Date: 2011-11-10 12:17:06 +0000 ft-channel: remove useless debug messages Signed-off-by: Jonny Lamb commit 9083e98df3a019f7cfbcb1f5bd37e6b4c1c4aaa0 Author: Jonny Lamb Date: 2011-11-10 12:08:51 +0000 ft-channel: don't leak a GFile if the CM signals URIDefined twice Signed-off-by: Jonny Lamb commit f0c85a8e62ace68b21401b27827db681032eb4be Author: Jonny Lamb Date: 2011-11-10 12:07:58 +0000 ft-channel: remove absolutely rogue new line Signed-off-by: Jonny Lamb commit f6a02a0c92074d3b879e1f709264ef42fed5f178 Author: Jonny Lamb Date: 2011-11-10 12:06:39 +0000 ft-channel: don't potentially call _cancel on a NULL GCancellable > I don't think this is safe. TpProxy's _dispose() method, which is > called after TpFileTransferChannel's, emits invalidated if the proxy > wasn't already invalidated. But by that time, > self->priv->cancellable will have been freed by TpFTChannel's > _dispose() implementation. Signed-off-by: Jonny Lamb commit 3092ef449b20759fce14e9689664f366755beada Author: Jonny Lamb Date: 2011-11-10 12:00:38 +0000 ft-channel: add example for requesting FT channel Signed-off-by: Jonny Lamb commit a82c1507081e40212f15fcbfaebc59610f3d8501 Author: Jonny Lamb Date: 2011-11-10 11:48:46 +0000 ft-channel: fix crasher if the incoming client connection fails I'm not sure this can ever actually happen... but there's no harm in including this. Signed-off-by: Jonny Lamb commit 102f2c16f8b39042440d1fc4681cd2d88099a4ec Author: Jonny Lamb Date: 2011-11-10 11:45:47 +0000 ft-channel: make operation_failed take the GError Signed-off-by: Jonny Lamb commit c5ba5036d032967e0bc1bb1a26e9d5f0be31bf4c Author: Jonny Lamb Date: 2011-11-09 19:36:46 +0000 ft-channel: update to newer metadata draft Signed-off-by: Jonny Lamb commit 69cc5afe3dc1d47742337c8463cf379aae85c2a7 Author: Jonny Lamb Date: 2011-11-08 13:45:51 +0000 ft-channel: cancel splice operation on channel invalidation Signed-off-by: Jonny Lamb commit 9f3ea8363e20f0e1b7efd810c4560cfe9a1becbd Author: Jonny Lamb Date: 2011-11-07 16:08:04 +0000 tests: test Metadata accessors Signed-off-by: Jonny Lamb commit 2bfd5553f10bac6e0644a891d2f1c55c92824eec Author: Jonny Lamb Date: 2011-10-31 11:16:08 +0000 file-transfer-channel: add metadata accessors Signed-off-by: Jonny Lamb commit 72a87bb61681b808f1548a20aede292a84c1b281 Author: Jonny Lamb Date: 2011-11-07 13:49:44 +0000 ft-channel: improve docs Signed-off-by: Jonny Lamb commit 9d78454128de6c3f808b0b230b37455e84605bb5 Author: Jonny Lamb Date: 2011-11-04 18:58:14 +0000 ft-channel: more misc. fixes to docs Signed-off-by: Jonny Lamb commit ea6a2cbba50851f041603933be199461137a35a7 Author: Jonny Lamb Date: 2011-11-04 17:40:52 +0000 python examples: update file transfer examples Signed-off-by: Jonny Lamb commit 3044465ff3b5aee82d1112f0de6a56e748c75f66 Author: Jonny Lamb Date: 2011-11-04 17:15:53 +0000 ft test: pass a real file into provide_async provide_file_async now tests that we can read the file given so we should make sure something is there. I'm not very happy with this solution but can't think of anything better right now. I guess we should make a temporary directory instead of using /tmp. Signed-off-by: Jonny Lamb commit edcc46e6393a3863324a52698fa6567ac800718e Author: Jonny Lamb Date: 2011-11-04 17:15:29 +0000 ft tests: fix debug statement to be the same as the code Signed-off-by: Jonny Lamb commit e6acd055dea81480e7e391b738418db7e994591d Author: Jonny Lamb Date: 2011-11-04 16:05:58 +0000 ft-channel: rewrite most of the provide/accept code I'm so sorry about this patch. Basically it is heavily inspired by EmpathyTpFile which has actually been used for several years so has some user testing, except instead of using raw Linux socket functions, it uses the fluffy Gio classes! It has the advantage of sharing more of the code betweeen Accept and Provide. The other advantage is that sending files actually works now. Signed-off-by: Jonny Lamb commit 035b02ca162a5d69fcb18e72bded1195e940441f Author: Jonny Lamb Date: 2011-11-02 14:20:35 +0000 ft-channel: fail to provide if state is not Accepted/Pending Signed-off-by: Jonny Lamb commit 58d2606cd89408b8b3a4140b2e5b56c8a7b8cd77 Author: Jonny Lamb Date: 2011-11-02 13:46:14 +0000 ft-channel: rename offer_file functions to provide_file The offer is sent when the channel is created so "offer" doesn't actually make sense here. Signed-off-by: Jonny Lamb commit f5317c6ef4f569114af72a3e55ea65ccd2339478 Author: Jonny Lamb Date: 2011-11-01 17:18:06 +0000 docs: add new TpFileTransfer functions Signed-off-by: Jonny Lamb commit 7e0d59ab90750c73795189bc67efe559e49f98cb Author: Jonny Lamb Date: 2011-11-01 15:28:31 +0000 ft-channel: set the access control param correctly in the incoming case Signed-off-by: Jonny Lamb commit 6e5661c43f8dcee92c1c7d5792cd6ce4b577d8f3 Author: Jonny Lamb Date: 2011-11-01 15:22:07 +0000 ft-channel: style changes Signed-off-by: Jonny Lamb commit c1e858011b797271121bd92404a5efbcf6314cd4 Author: Jonny Lamb Date: 2011-11-01 14:52:25 +0000 ft-channel: don't cryptically use a random value for the access control param wat Signed-off-by: Jonny Lamb commit f9107efe4dbab601808ac234e4f70910cd93260a Author: Jonny Lamb Date: 2011-11-01 14:37:28 +0000 ft-channel: set the access control param properly when calling ProvideFile Signed-off-by: Jonny Lamb commit d36e8850062051958c07c8badfc1521157efbfc0 Author: Jonny Lamb Date: 2011-11-01 13:41:43 +0000 ft-channel: complete the async result after accepting succeeds Signed-off-by: Jonny Lamb commit 99689e4fc5e6dda7d28ab084d7ba1b613b6f74f3 Author: Jonny Lamb Date: 2011-11-01 12:55:30 +0000 ft-channel: fix so it compiles Signed-off-by: Jonny Lamb commit 0882727247a6c24d51f847ffffee6c6f283271ab Author: Jonny Lamb Date: 2011-11-01 11:37:01 +0000 ft-channel: clarify some docs Signed-off-by: Jonny Lamb commit f17dd5f6de0458092c2ca87c2b5744b62445f731 Author: Jonny Lamb Date: 2011-10-31 16:50:09 +0000 ft-channel: add an initial-offset property I've no idea how it worked before without this? Signed-off-by: Jonny Lamb commit b6e8fd2962ea4d798f466ad64999f7e2195380eb Author: Jonny Lamb Date: 2011-10-31 16:45:29 +0000 ft-channel: clean up some debug messages DEBUG uses macros to prepend the function name, so it's not necessary to do it yourself. I'm unconvinced all these are necessary too, but oh well. Signed-off-by: Jonny Lamb commit 2d260da28c058bd019e78e0e2287155bf6109afb Author: Jonny Lamb Date: 2011-10-31 16:37:53 +0000 ft-channel: small fixes to gtk-doc Signed-off-by: Jonny Lamb commit a3f229b69cad01be2dd30237c346c8dec31d6f78 Author: Jonny Lamb Date: 2011-10-31 16:29:24 +0000 ft-channel: remove in_ arguments tp-glib codegen names them that. I hate them. Signed-off-by: Jonny Lamb commit 849173ae8710adfeda4e8053dd92b433822d147e Author: Jonny Lamb Date: 2011-10-31 16:28:26 +0000 ft-channel: remove useless line Signed-off-by: Jonny Lamb commit 8f6338cdc46cba1b427696a5c5fa61fa401cf353 Author: Jonny Lamb Date: 2011-10-31 16:26:35 +0000 ft-channel: remove get_uri prototype This function doesn't exist. Signed-off-by: Jonny Lamb commit 631b1111c89db57b7e1793aa56df24ee846d8147 Author: Guillaume Desmottes Date: 2011-07-13 15:19:56 +0200 Bring back Mortem's code commit d6118003e5bed41b62b18c080fd50eccc5db2aea Author: Jonny Lamb Date: 2011-11-11 10:35:12 +0000 fixup! a06045dc90c7b342d09f0d8a1d1b47469a20a5ae Signed-off-by: Jonny Lamb commit d6df3c469224c39ecd68b6aed3ef70ed5309e9e6 Author: Jonny Lamb Date: 2011-11-10 23:08:23 +0000 spec: generate code for Chan.I.FileTransfer.Metadata Signed-off-by: Jonny Lamb commit a06045dc90c7b342d09f0d8a1d1b47469a20a5ae Author: Jonny Lamb Date: 2011-11-10 23:06:58 +0000 spec: update to version 0.25.0 Signed-off-by: Jonny Lamb commit 388fdb5e4663caae902c959fe3f375b71eabf3fa Merge: 0423b8ce0 09dec41d5 Author: Mikhail Zabaluev Date: 2011-11-08 17:12:03 +0200 Merge branch 'fix-password-manager' Reviewed-By: Jonathon Jongsma commit 09dec41d5b2954b45f1b9abeb407bff775d192e2 Author: Mikhail Zabaluev Date: 2011-11-07 19:45:37 +0200 TpSimplePasswordManager: don't keep a pointer to the challenge result The pointer goes stale when the result is consumed, and it trips an assertion if the manager gets a new challenge. commit 0423b8ce09c3ef053ca5b027cfe31314077da72a Author: Guillaume Desmottes Date: 2011-11-08 13:19:23 +0100 set nano version commit c090f34baea89267739f5f1c923ab678088f3f47 Author: Guillaume Desmottes Date: 2011-11-08 12:53:20 +0100 prepare 0.17.0 commit 3e0d6d15c1c053a40031d41912700a10130e9243 Merge: e4d7e1e65 664556d27 Author: Guillaume Desmottes Date: 2011-11-08 12:46:29 +0100 Merge branch 'telepathy-glib-0.16' into release Conflicts: NEWS configure.ac commit 664556d27223a9d1916e981368a21e8aba6d526a Author: Guillaume Desmottes Date: 2011-11-08 12:44:05 +0100 set nano flag commit cc199941231165935e99c04613873dfa4bc077e4 Author: Guillaume Desmottes Date: 2011-11-08 12:09:58 +0100 prepare 0.16.2 commit e4d7e1e653892eb802ec9301f22bb4cc49c29a85 Merge: 4de1cf73e c56154233 Author: Guillaume Desmottes Date: 2011-11-07 17:54:32 +0100 Merge branch 'telepathy-glib-0.16' commit c5615423317f2604498fb4bd2d7d3be02d06d31e Author: Guillaume Desmottes Date: 2011-11-07 17:15:39 +0100 channel-contacts: hash table may contain NULL contact This is the case when joining a room containing members having an unknown owner. https://bugs.freedesktop.org/show_bug.cgi?id=42670 commit 4de1cf73eaa89f75e540387be8c57e8fc34b343d Author: Xavier Claessens Date: 2011-11-02 12:44:08 +0100 Fix race condition when an observer calls claim_with then accept the context tp_channel_dispatch_operation_claim_with_async() were preparing itself as first step, which means the dbus call is not made directly, and the tp_observer_context_accept() dbus message could get to MC first, making MC dispatch the channel to any capable handler. There is no reason to prepare self in _async calls, caller is responsible for that. Fixes fd.o#42503 commit dedce116cc8b592743cb599bda3e6aa32c5be730 Author: Xavier Claessens Date: 2011-11-02 13:30:24 +0100 TpObserverChannelsContext: prepare the CDO Observers doing tp_cdo_claim_with_async() will need it to be prepared commit d2e6b77f34cf74cbaa8ec8f352ff7b7d9be117d4 Author: Alban Crequy Date: 2011-11-01 11:24:56 +0000 test example-no-protocols: fix the test when it is installed https://bugs.freedesktop.org/show_bug.cgi?id=41455 commit e745c29573950efcb7ffd7c0b6184582c4365c05 Author: Alban Crequy Date: 2011-10-04 16:57:03 +0100 tests: add --enable-installed-tests This configure option makes it possible to install the tests in /usr/lib/telepathy-glib-tests and run them without the sources. The dbus configuration moved to tests/dbus/dbus-installed for the installed tests and is duplicated into tests/dbus/dbus-uninstalled for the uninstalled tests. https://bugs.freedesktop.org/show_bug.cgi?id=41455 commit 45b8e51b72b95646ad855807d0b0f9d89737edf1 Author: Guillaume Desmottes Date: 2011-11-03 12:48:10 +0100 Add TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES This feature is now a dependency on TP_CONNECTION_FEATURE_CONTACT_LIST so it will be automatically prepared when preparing TP_CONNECTION_FEATURE_CONTACT_LIST (so we don't break existing code) https://bugs.freedesktop.org/show_bug.cgi?id=42546 commit 252e1801e2f781a0ec8f3732a878fa87cef8402f Author: Guillaume Desmottes Date: 2011-11-03 11:48:17 +0100 test that contact list properties are set https://bugs.freedesktop.org/show_bug.cgi?id=42546 commit 3b40037ad760793c912c1cf391f69f9cc2c4cda3 Author: Guillaume Desmottes Date: 2011-11-03 11:38:59 +0100 contact-list-client: make test path clearer https://bugs.freedesktop.org/show_bug.cgi?id=42546 commit 02e5923e69638efe7dcea50df48e186356fa8d0a Author: Guillaume Desmottes Date: 2011-11-01 12:13:50 +0100 check if we pass at least one contacts directly in the API call The error message will be more useful to users than the one in tp-glib's internals. commit 48d50aacbde935e0f390922e422d4b846cc55c3b Author: Guillaume Desmottes Date: 2011-11-01 10:57:00 +0100 coding style tweak commit 941c288870f433c6dc6ed173156f1f7f80f0708a Author: Guillaume Desmottes Date: 2011-11-01 10:56:08 +0100 fix typo in comments commit 0526488eb0291d94540931cc6e6a4e5dd22a318d Author: Guillaume Desmottes Date: 2011-11-01 10:55:36 +0100 process_queued_blocked_changed: don't leak contacts commit 2ea9b904fc951506d3d0f95f99b3ad142391dd86 Author: Guillaume Desmottes Date: 2011-11-01 10:47:23 +0100 improve TpConnection:can-report-abusive doc commit 9cd28dd74b4d5e544cf66938ac66c0156d125de0 Author: Guillaume Desmottes Date: 2011-11-01 10:45:31 +0100 prepare_contact_blocking_cb: remove useless goto commit ebeeb38ed7c800a4b3fa34a3c9e4363580bc833d Author: Guillaume Desmottes Date: 2011-11-01 10:44:04 +0100 improve TP_CONNECTION_FEATURE_CONTACT_BLOCKING commit 6a0e61e8d7fdda7fb6d30ae02de34f7638c3100d Author: Guillaume Desmottes Date: 2011-11-01 10:37:51 +0100 improve @@report_abusive doc commit 7a9b6ac95634eb32b651f3280514c7310944c422 Author: Guillaume Desmottes Date: 2011-11-01 10:33:20 +0100 _tp_contacts_to_handles: check we pass at least one contact All the functions using this were already documenting that we should pass at least one contact. commit 7e48f9876b7505b8a74222f9efc669e8fcbe56fa Author: Guillaume Desmottes Date: 2011-10-31 16:41:38 +0100 rename contact-list-clt.c to contact-list-client commit 70df467659e59c11a54245a57dba50eb53f6a8e5 Author: Guillaume Desmottes Date: 2011-10-20 17:49:57 +0200 Automatically prepare TP_CONTACT_FEATURE_CONTACT_BLOCKING when possible Once TP_CONNECTION_FEATURE_CONTACT_BLOCKING has been prepared we can easily prepare TP_CONTACT_FEATURE_CONTACT_BLOCKING on all contacts as we have all the information needed. Extra contact feature for free! https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit 293c43f3c7d9359d7c03a150dbc348fbeaf14ca6 Author: Guillaume Desmottes Date: 2011-10-20 16:23:59 +0200 TpContact: add is-blocked property https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit c712fb46c5ed09a461a86d52a712a03d33beae2d Author: Guillaume Desmottes Date: 2011-10-19 17:14:27 +0200 add contact operations for blocking API https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit 1b48e12c7ce5104d4266c6917f32add72aba427b Author: Guillaume Desmottes Date: 2011-10-19 16:40:29 +0200 add TpConnection::blocked-contacts-changed: signal https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit 99faf245247dfd32ac21460b6e063655cdae2e60 Author: Guillaume Desmottes Date: 2011-10-19 13:41:15 +0200 add TpConnection:blocked-contacts property https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit b6b7882ef113588583d32bd0a201e00d80ff3f6a Author: Guillaume Desmottes Date: 2011-10-17 11:37:29 +0200 add can-report-abusive property and TP_CONNECTION_FEATURE_CONTACT_BLOCKING https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit dd3f97cc9ae7f2770f10164f1ad2c8d4a3a04123 Author: Guillaume Desmottes Date: 2011-10-19 12:23:52 +0200 ExampleContactList: implement block_contacts_with_abuse_async That doesn't change much for existing tests but will be handy to test the client side part of this property. https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit 726e4173951c47757adaaf97368af862bdd3e2e8 Author: Guillaume Desmottes Date: 2011-10-17 10:31:42 +0200 add high level API to block/unblock contacts https://bugs.freedesktop.org/show_bug.cgi?id=41801 commit dfe6f80cf4e73d60d06fbe67b1f9c6ef0af4d545 Merge: fa115d82e 6e9c139d4 Author: Guillaume Desmottes Date: 2011-10-31 17:05:39 +0100 Merge branch 'telepathy-glib-0.16' commit 6e9c139d4a3b84e368d8f45592189d244fc59e32 Author: Guillaume Desmottes Date: 2011-10-31 16:48:06 +0100 don't call _tp_contacts_to_handles in g_return_if_fail g_return_if_fail() can be compiled as noop, so we shouldn't rely on it to get the handles. commit fa115d82e775075a9c9dbc7923ff5c375947378b Merge: e93e8889e 7fd5cd6f1 Author: Guillaume Desmottes Date: 2011-10-31 15:55:21 +0100 Merge branch 'telepathy-glib-0.16' commit 7fd5cd6f113df88f5282486c86c0491f83b74919 Author: Guillaume Desmottes Date: 2011-10-27 12:03:19 +0200 group-mixin: always set the Members_Changed_Detailed flag We unconditionally implements the MembersChangedDetailed signal so this flag should always be set. https://bugs.freedesktop.org/show_bug.cgi?id=42305 commit e93e8889e7b75fa25911419a757e24ae23bcd4d6 Merge: fdfaadecf 3f095ac75 Author: Danielle Madeley Date: 2011-10-31 22:36:51 +1100 Merge branch 'telepathy-glib-0.16' commit 3f095ac75873015fc6758f1da7c21f955d5b5ab4 Author: Danielle Madeley Date: 2011-10-31 22:33:38 +1100 Document the meaning of TpProxy::invalidated It turns out that when we talked about invalidation, people didn't actually know what this meant. commit fdfaadecfe8ae955c3c227eb58e43c4161b5009e Merge: 9a7d9195d 751e72fec Author: Danielle Madeley Date: 2011-10-30 23:04:15 +1100 Merge branch 'introspection' commit 751e72fecfdf83c0290676eabb9253c2f7b215dc Author: Danielle Madeley Date: 2011-10-29 11:30:30 +1100 introspection.am: Use correct variable name Fixes distcheck. commit 9a7d9195dab1035ffe2da0d7cd28c4a06b484881 Author: Travis Reitter Date: 2011-10-25 09:27:42 -0700 Replace deprecated g_unix_socket_* functions. https://bugs.freedesktop.org/show_bug.cgi?id=42233 commit 7ead77a13870e4ae7ed435e7cd695a81f7065470 Author: Alban Crequy Date: 2011-10-28 17:33:51 +0100 Removes reference to kludge.xsl kludge.xsl no longer exists with this commit: |commit 7728cd8d8fa224838f2081dce2e852ec418c61ef |Author: Danielle Madeley |Date: Tue Oct 18 17:46:16 2011 +1100 | | Use g-i makefile rules to simplify building the introspection files | | It turns out we can now remove the kludges which made the introspection rules | so complicated. commit 2c30c3b8f7a7df8ae78aead13a84e39614471fba Author: Mikhail Zabaluev Date: 2011-10-25 17:08:20 +0300 Fix a race condition in codegen make rules It occurs in parallel builds when your mkdir is not fast enough. commit f36aabfa69cb2fca1aa8cc21e75fa40ad5a4e48d Author: Guillaume Desmottes Date: 2011-10-25 10:29:14 +0200 set nano version commit b7fb9d6dba3f64d68ce635e312d5d742b59ae8aa Author: Guillaume Desmottes Date: 2011-10-24 17:45:05 +0200 prepare 0.16.1 commit 54ac9a23387546370652f5c81d2f735d1e294596 Merge: de32456d8 60615777a Author: Guillaume Desmottes Date: 2011-10-24 16:42:51 +0200 Merge branch 'telepathy-glib-0.16' commit 60615777a80c190a270e270b1b3972e367ad7dfd Author: Guillaume Desmottes Date: 2011-10-24 16:37:03 +0200 document capabilities_queue commit 81c9de86431c1c6fc2968b862ab8645e2804f448 Author: Sjoerd Simons Date: 2011-10-20 15:30:17 +0200 Prevent circular introspection dependency As part of preparing a Connection the self contact will be retrieved. If the contacts requested features include _CAPABILITIES _and_ the connection doesn't support ContactCapabilities then the Capabilties of the connection get use. But if we wait for this feature to be prepared then the introspection stalls. So instead use internal API to force getting the capabilities of the connection regardless of the state of the various features and break the circular dependency. commit f1f4e8bc7f58bb8e4c551bbc0c98674cfa0dc1c7 Author: Sjoerd Simons Date: 2011-10-20 15:23:50 +0200 Add internal API to get connection capabilities without having core prepared commit 6bf59dec6b50af267f56eeb7980476919a1dd92d Author: Sjoerd Simons Date: 2011-10-20 15:04:24 +0200 Let TpTestsNoRequestsConnection return an empty RCC If we don't implement Requests we shouldn't respond to the retrieval of RCC properties. Unfortunately that's tricky to do, so do a quick hack which means we will have an empty RCC property, which is at least somewhat more useful for our tests. commit df26d5592ec8fc2ff026f30c562f3e5102263c65 Author: Sjoerd Simons Date: 2011-10-20 05:37:35 +0100 Make it easier to debug connection preparation by printing object paths in some cases commit e6536da10f3bca2d3d73d0c190f43224e9603c25 Author: Sjoerd Simons Date: 2011-10-20 05:34:30 +0100 Add some extra debugging to make it easier to follow AccountManager preparation commit de32456d8d460b427ab26c489c142a41319d2023 Merge: cb67f9f35 dd159a5d6 Author: Guillaume Desmottes Date: 2011-10-24 12:35:14 +0200 Merge branch 'telepathy-glib-0.16' commit dd159a5d6e737106f0966f2c121953079731f716 Author: Guillaume Desmottes Date: 2011-10-20 14:43:47 +0200 base-contact-list: implement TP_TOKEN_CONNECTION_INTERFACE_CONTACT_BLOCKING_BLOCKED https://bugs.freedesktop.org/show_bug.cgi?id=42049 commit cb67f9f357769b6a6132d4e260e5885f7cdd2bfa Merge: 06519d20a ba3cfa861 Author: Guillaume Desmottes Date: 2011-10-18 17:14:28 +0200 Merge branch 'telepathy-glib-0.16' commit ba3cfa861786ba3c18f4759aa331b0a25a511b50 Author: Guillaume Desmottes Date: 2011-10-18 16:44:38 +0200 deal with self->priv->group_contact_owners may containing NULL contact If the owner is unknown self->priv->group_contact_owners may contain NULL TpContact. g_object_unref() not being NULL safe we have to use our own value_destroy_func to avoid warnings. https://bugs.freedesktop.org/show_bug.cgi?id=41928 commit b67a85de59ecf73ef80a7da81fa45e00287e8669 Author: Guillaume Desmottes Date: 2011-10-18 16:06:33 +0200 test_receive_muc_delivery: use g_test_bug() commit a35dadc4069721ffee181123ef379f60a9055716 Author: Guillaume Desmottes Date: 2011-10-18 15:46:11 +0200 _tp_channel_contacts_queue_prepare_finish: don't assume item->contacts is not NULL For example, when receiving a MUC delivery report we end up with a message having no sender and so no contact to prepare. https://bugs.freedesktop.org/show_bug.cgi?id=41929 commit 06519d20a42026638999a88a7efbe57457f86c6f Author: Danielle Madeley Date: 2011-10-18 18:02:06 +1100 Bump g-i requirement to something that definitely supports the new makefile rules commit 7728cd8d8fa224838f2081dce2e852ec418c61ef Author: Danielle Madeley Date: 2011-10-18 17:46:16 +1100 Use g-i makefile rules to simplify building the introspection files It turns out we can now remove the kludges which made the introspection rules so complicated. commit d2fa46eb5e86d38db4033b62c5c352911f1746bb Author: Danielle Madeley Date: 2011-10-18 17:39:26 +1100 Update introspection.m4 commit 93c41a465e78d7a8d9a1998bdb14edcc643ade33 Author: Will Thompson Date: 2011-10-14 15:13:17 +0100 And bump again to 0.16.999.1 commit 1a01d5f17d259491211320b67036ab1bdfc1c134 Author: Will Thompson Date: 2011-10-14 15:12:27 +0100 Bump nano-version to 0.16.1.1 commit 81947d9ec85ff9e4068a985f915b6fb349ca5390 Author: Will Thompson Date: 2011-10-14 14:50:33 +0100 Version 0.16.0 commit a2f309d604b489cc14c88e4f36399d49230c5ac7 Author: Will Thompson Date: 2011-10-14 14:49:46 +0100 Truncate generated ChangeLog at 0.12.0 commit b873170905561f6ec614e00bcc91a47af99b5f58 Author: Will Thompson Date: 2011-10-14 14:49:25 +0100 NEWS for 0.16.0 commit 2749adbac0f5e2cb977d77d404da448873b001ad Author: Will Thompson Date: 2011-10-14 14:46:55 +0100 Account: expand :normalized-name documentation. Fixes: commit fee374d5ef99a880b001438fd719d5db53b38d2b Author: Will Thompson Date: 2011-10-14 14:13:36 +0100 test-channel-introspect: remove most MYASSERTs This macro is really ugly. I only left it in place for assertions like MYASSERT (!tp_proxy_prepare_finish (chan, prepare_result, &error), ""); where the assertion has a side-effect. Otherwise, if someone disables assertions the test will crash. Ugh. commit 4491d8bc77332748414de0807b2e4e2fb4882cab Author: Will Thompson Date: 2011-10-14 14:10:28 +0100 test-channel-introspect: plug a leak fea8294 introduced this pretty obvious leak. commit fab2a851d8fea0da4a8202984d7a9cd74f430d64 Author: Simon McVittie Date: 2011-10-14 13:06:38 +0100 remove unnecessary x bit from source code commit fea8294ac39d066738914849619a48f7be6d4ab5 Author: Guillaume Desmottes Date: 2011-10-12 18:43:01 -0400 TpChannel: don't rely on introspection queue to add the iface ID of the type tp-glib uses to rely on its introspection queue to add the interface ID of its channel type even when the type was already known during construction (which is basically alway the case now as we always pass the immutable properties when creating a TpChannel). This was forcing TpChannel subclasses to have a CORE feature to connect signals on their channel type interface for no good reason. https://bugs.freedesktop.org/show_bug.cgi?id=41729 commit 5dd6de2e21f672009ce064cc7d7aeb1ea64741ee Author: Will Thompson Date: 2011-10-12 10:42:46 +0100 Bump nano-version to 0.15.9.1 commit 27d4ea43ae5f157724786217345b09d1740925d7 Author: Will Thompson Date: 2011-10-12 10:32:27 +0100 Version 0.15.9 commit fd25b9eced97e819322c9eba8505646cb2258f65 Merge: c4840088b 810469123 Author: Will Thompson Date: 2011-10-12 10:24:57 +0100 Merge remote-tracking branch 'origin/master' commit c4840088b5d8a0586a3753f87e60c1a1cbd08bab Author: Will Thompson Date: 2011-10-12 10:21:48 +0100 bump nano version to 0.15.8.1 commit 8104691233d634225a8351e0feb8e42c6386c446 Author: Guillaume Desmottes Date: 2011-10-11 17:38:11 -0400 _tp_contacts_from_values: skip NULL contacts dup_owners_table() can insert NULL contacts into the hash (if the owner is unknown) so we should just ignore those. https://bugs.freedesktop.org/show_bug.cgi?id=41697 commit a4806385597c950cdb83f0c7729f210a760b4933 Author: Will Thompson Date: 2011-10-11 19:31:16 +0100 Version 0.15.8 commit a850ddf3be9186ae738d4b75c8e5e67cb7f95f0d Author: Will Thompson Date: 2011-10-11 19:30:42 +0100 NEWS for 0.15.8 commit bdacfa26393e9c336638502e34aa8a19ec636fd3 Merge: 3caf6bafb 36dc71206 Author: Will Thompson Date: 2011-10-11 19:04:46 +0100 Merge branch 'bye-bye-properties' See . Reviewed-by: Jonny Lamb commit 36dc712062abb5e0cd932ceb17a419693f8e76f6 Author: Will Thompson Date: 2011-09-15 18:32:03 +0100 BaseRoomConfig: document why we copy properties dict commit 82d88fd54759609dff47ee9ec0f16a6a7e7204fa Author: Will Thompson Date: 2011-09-15 18:25:10 +0100 BaseRoomConfig: move the macros up a bit commit bfe1679a98e5072d1119fe4ffbb3b447c857f1f1 Author: Will Thompson Date: 2011-09-06 14:34:22 +0100 BaseRoomConfig: pass self to update_async Previously, the update_async vfunc in TpBaseRoomConfigClass took a pointer to a TpBaseChannel as its first argument. This is an artifact of how this was initially hooked up in Gabble, and is pretty unconventional, to say the least. commit ad7b669829d3d74cd508e3ec017b5fa11ef9c088 Author: Will Thompson Date: 2011-09-06 14:27:51 +0100 BaseRoomConfig: improve find_myself error checking TpBaseRoomConfig stores a pointer to itself as qdata on its parent channel. It did not previously NULL that pointer out when it was disposed: it now does. Correspondingly, I added an explicit check for NULL to find_myself(). While this is technically redundant with the TP_IS_BASE_ROOM_CONFIG() check, I think it makes the error message clearer to distinguish between the two. commit 8f683e81f687b8f6dc4f943e57297ddfb8efc951 Author: Will Thompson Date: 2011-09-06 14:22:51 +0100 Add tp_base_room_config_dup_channel() This is handier than using the GObject property, and it transpires that subclasses would like to use it. It returns a ref rather than not because TpBaseRoomConfig only holds a weak ref to the channel, so it would otherwise be quite easy for CM code to accidentally try to use a dead pointer. (I fell into this trap while working on Gabble.) commit e480f13e2729539a8f99576a066b42a0c7adc46b Author: Will Thompson Date: 2011-09-06 09:11:27 +0100 Add TpBaseRoomConfig This is a mixin-esque class (akin to TpBaseContactList) implementing the RoomConfig interface on MUC channels. This class was developed inside Gabble, and moved here when essentially complete. Changes since the last time it appears in Gabble: • Uses of wocky_enum_{to,from}_nick were replaced by _tp_enum_{to,from}_nick; • The description section of the documentation was written; • Obviously, it was renamed. commit 679f0afeb605c106dff18f49967ff15ff66a41ef Author: Will Thompson Date: 2011-09-06 09:10:49 +0100 Steal wocky_enum_{to,from}_nick The RoomConfig mixin needs these. commit 3caf6bafbb2e4efe3154ebe1e833096d11e8ffce Merge: eaa0477a4 d805cc7eb Author: Will Thompson Date: 2011-10-11 18:14:23 +0100 Merge branch 'dbus-properties-mixin-stuff' Reviewed-by: Xavier Claessens commit d805cc7eb60597df6e819bdc7d251b5ad24ffb1a Author: Will Thompson Date: 2011-08-30 18:10:59 +0100 Expose tp_dbus_properties_mixin_set() This allows the application to set a property as if in response to a D-Bus call. This turned out to not actually be needed for this branch, but it is needed if we want MC to use TpDBusPropertiesMixin. (See also, fd.o#32416.) commit eaa0477a43617b2f9c4585a81c2b6bbbf7eefcc4 Merge: 468c19fb3 87e6f6379 Author: Will Thompson Date: 2011-10-11 17:45:12 +0100 Merge branch 'spec-0.24' Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41658 Reviewed-by: Simon McVittie commit c176abf6162264ced42c630491f48ca8f4a337f4 Author: Will Thompson Date: 2011-08-30 15:46:57 +0100 Expose tp_svc_interface_get_dbus_properties_info I find myself wanting this while writing RoomConfig support. Admittedly once that code is in tp-glib it won't strictly need to be exported, but I think it's harmless enough. commit 4f70e8891881d1ee8c612df34a73bd34829d725d Author: Will Thompson Date: 2011-08-30 15:28:58 +0100 DBusProperties: document set_dbus_prop_info as niche Almost no-one ever needs to call this. commit 87e6f6379f8007f8f9acbc2795f3cf8f0aa1d8c4 Author: Will Thompson Date: 2011-10-10 17:58:11 +0100 Generate code for Room, RoomConfig and Subject commit e0a7a0722c688aa30b120499d84b3feec1e78479 Author: Will Thompson Date: 2011-10-10 17:26:27 +0100 codegen: add a whitelist of tp_cli_*_run_* methods We have to generate a bunch of (deprecated) tp_cli_*_run_* methods, for backwards-compatibility. But there's no reason to add any *more* every time we define a new channel interface. So here, we generate a list of methods we need to generate for backwards compatibility (based on their being listed in the documentation), and modify the code generator to refuse to generate any _run_ method not named in that file. commit 43a87ab723d8c21880c18bfd084a5c03e90ad89f Author: Will Thompson Date: 2011-10-10 15:10:59 +0100 Update to telepathy-spec 0.24.0 This also includes the updates to the Call-based example code omitted from fa81060. commit 468c19fb3ee29da725d9ed9acd07325ad2b329f4 Author: Will Thompson Date: 2011-10-10 13:25:52 +0100 channel-contacts: guard against no-op updates process_contacts_queue() can already cope with ContactsQueueItems in the queue which do not actually have any contacts to prepare. As a comment in the function describes, we still go through the motions of enqueuing a preparation/upgrade operation to avoid reordering events. However, previously the function assumed that if any of the three arrays (of contact objects, ids, or handles) were non-NULL, then they would be non-empty. This assumption is false, as illustrates. The concrete example in that bug is an emission of MembersChanged, with all arrays except Removed empty, and Actor set to 0. We don't bother preparing contacts which are removed; so _tp_channel_contacts_queue_prepare_async() is called with an empty array of contacts. There are a few other signals which can lead to this situation. So this patch makes process_contacts_queue() do the right thing if the arrays are present but empty. (Previously all three paths would assert in this situation.) Fixes: Reviewed-by: Simon McVittie commit d1d4ec502285832f113e297337b96a265a6ea610 Author: Will Thompson Date: 2011-10-10 11:42:14 +0100 Bump nano version to 0.15.7.1 commit b0c14c2613232de12ce8800230471db93517d7d4 Author: Xavier Claessens Date: 2011-10-03 14:38:03 +0200 Version 0.15.7 commit f1b611ea1a5e06cd801d059db05dd00de6ad5e1c Merge: be940765a 41be1c9d7 Author: Will Thompson Date: 2011-10-04 15:41:18 +0100 Merge branch 'telepathy-glib-0.14' Conflicts: NEWS configure.ac telepathy-glib/message-mixin.c commit 41be1c9d7467a643efc6c12cf3b96816d98fbd30 Author: Will Thompson Date: 2011-10-04 15:31:12 +0100 Nano-version bump to 0.14.10.1 commit 041f910c3c94caa7eed412acd645bec68408fc22 Author: Will Thompson Date: 2011-10-04 15:22:21 +0100 Version 0.14.10 commit cb7875e4bf52b8553d4cab670ac6e0484afa5f6d Author: Will Thompson Date: 2011-10-04 15:21:25 +0100 More NEWS for 0.14.10 commit 1c1c688e8c6ceda679c1473c7454ee6db2710007 Merge: a899ab819 dff3ce56f Author: Will Thompson Date: 2011-10-04 15:05:11 +0100 Merge branch '40523-crash-on-ack' into telepathy-glib-0.14 Reviewed-by: Xavier Claessens commit dff3ce56fe82a9b16068d0cdcbc508d2d3c390ba Author: Will Thompson Date: 2011-10-04 14:16:07 +0100 MessageMixin: DEBUG if AckPM gets an id more than once commit be940765ac3e355ee7efb52a49bf68431e52b0c0 Author: Xavier Claessens Date: 2011-10-03 15:05:05 +0200 test_upgrade_noop: verify with all features commit 535ac16a74b535c3256e7acd9757a61e23bfc493 Author: Xavier Claessens Date: 2011-10-03 14:18:20 +0200 Add regression test case to verify no-op upgrade commit b693c190495599b90ca07f9441cf6ecc41bd5169 Author: Xavier Claessens Date: 2011-10-03 12:41:10 +0200 Make sure tp_connection_upgrade_contacts() is no-op if all features are already prepared commit dedd4a32647c96dd3854120c5c20b319ed00fbae Author: Xavier Claessens Date: 2011-10-04 10:48:05 +0200 Add unit test for sent message without message-sender commit bd5f36739a0e9b16c9351b1ac71a5ba26e24cf87 Author: Xavier Claessens Date: 2011-10-04 08:05:56 +0200 TpTextChannel: Fallback to self contact if sent message does not have a sender This was a regression, butterfly does not set message-sender on sent messages. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=41435 commit e6886e1af905cbd11b91dcd82104ee5a394863fa Author: Will Thompson Date: 2011-10-03 14:20:01 +0100 MessageMixin: don't repeatedly scan pending message list g_queue_remove() has to traverse the list, comparing data pointers, until it finds the link we want to remove. It's stupid to use it here, because we already *have* a pointer to each link we want to remove. commit 4d41eec6c0b51c8bedd2a15fafc64529e45c4340 Author: Will Thompson Date: 2011-10-03 13:54:57 +0100 MessageMixin: don't crash if an id appears twice Fixes: commit c3f9dd779c1d780eab6d0de8be510c2ea45fc796 Author: Will Thompson Date: 2011-10-03 12:57:41 +0100 MessageMixin: track messages to be acked in a GPtrArray Since 'ids' may contain duplicates (which a future patch will filter out), using an array of GList *s is a bit cumbersome: we'd have to be sure not to index elements of it which haven't been initialized. Using a GPtrArray is clearer. commit 89b27c10020723769d4c7732c56f9ff809801c01 Author: Xavier Claessens Date: 2011-10-03 10:19:17 +0200 Add warning comment to warn that ordering matters for gi-scanner commit c1b9b9f899589e3fc3a340ef5f0a22b962a32ee1 Author: Xavier Claessens Date: 2011-10-03 10:17:17 +0200 Revert "Sort alphabetically introspected files" This reverts commit 48998822d5e9575af822c1936b35be514dc2401b. It seems gi-scanner depends on the order the files are given. See https://bugzilla.gnome.org/show_bug.cgi?id=660629 commit 48e8194462ade5440f9a76121796383676148f6e Author: Xavier Claessens Date: 2011-10-03 12:23:44 +0200 Nano-version bump commit 43b597d8bb9d67d4256961981b5a578b6a2e44b5 Author: Xavier Claessens Date: 2011-09-30 14:30:23 +0200 Version 0.15.6 commit 3f0f9abe1470d48e5ae09df8487b2759c614a85c Author: Xavier Claessens Date: 2011-09-30 14:18:03 +0200 NEWS for 0.15.6 commit 904c8d1ab8cd2044f4e458c41ab97aae52524de7 Author: Xavier Claessens Date: 2011-09-30 12:50:06 +0200 Add unit test to make sure sender gets prepared commit 0ce9da3c49acba674df79e95316e4ae2c77fb020 Author: Xavier Claessens Date: 2011-09-16 16:48:51 +0200 TpTextChannel: Guarantee that senders are always prepared with factory features This makes all events go into the channel's contacts_queue to preserve reordering. Note that it even fixes previous possible reordering on CMs not having immortal-handlers. commit 72eca4029b4c5e0d8094d55b21dc0253af7adfd6 Author: Xavier Claessens Date: 2011-09-29 13:35:53 +0200 TpStreamTubeChannel: Prepare factory contact features on connections commit 5fd927b3b560973ff6ff8d884410873cfb5fc1dc Author: Xavier Claessens Date: 2011-09-13 18:35:39 +0200 Add unit test for TP_CHANNEL_FEATURE_CONTACTS commit c434a51062415ed37b9225117ccfde4d21a346f9 Author: Xavier Claessens Date: 2011-09-13 18:35:21 +0200 Add TP_CHANNEL_FEATURE_CONTACTS feature It ensures that all TpContact objects related to a channel are prepared with factory features. It fail to prepare on old CMs. commit 0aae81e14a7b40bb035fbaa4d5595665069d9b53 Author: Xavier Claessens Date: 2011-06-29 22:16:08 +0200 Implement new Channel.Group spec in TpGroupMixin commit 48998822d5e9575af822c1936b35be514dc2401b Author: Xavier Claessens Date: 2011-09-30 10:18:19 +0200 Sort alphabetically introspected files commit fa810607e474b44755612baded586efcb2c2c739 Author: Xavier Claessens Date: 2011-09-29 21:17:42 +0200 Update to spec 0.23.4 Except for Call stuff because the example using extensions needs update to new spec. commit 051ae67740f49bbdb328eadad837a8b72ea32838 Author: Will Thompson Date: 2011-09-21 14:27:31 +0100 tp_debug_sender_add_message_vprintf: fix doc comment I'm sure gtk-doc used to accept @Varargs, but @... is used elsewhere in tp-glib too. commit 2ee8b2305c0312a71d2dd43c0a16cf16b809389a Author: Will Thompson Date: 2011-09-07 14:23:33 +0100 gtk-doc: use no-tmpl flavour This stops gtk-doc even generating the legacy .tmpl files, for a marginally faster (and less crufty) documentation build process. For some reason, this makes it start failing to parse the final argument of functions annotated with _TP_GNUC_DEPRECATED_FOR(). Not overly surprising that it can't parse them; the surprise is that no-tmpl affects this. But since we already pass _TP_GNUC_DEPRECATED to --ignore-decorators, it seems reasonable to also filter out _TP_GNUC_DEPRECATED_FOR there. commit 4b47d3a5375ff270214b1d427b0eb4d720c21404 Author: Xavier Claessens Date: 2011-09-21 14:30:15 +0200 remove typo in client.xml commit 7dca869db9cfe8105757e4ba3c4120f84c5e4c3d Author: Guillaume Desmottes Date: 2011-09-19 13:11:10 +0200 deprecate tp_account_prepare_{async,finish} commit c949b7a725970d155e6b14e44bfa15fd5511af50 Author: Guillaume Desmottes Date: 2011-09-19 13:11:10 +0200 deprecate tp_account_manager_prepare_{async,finish} commit ebac428b37557756ee7392680ee5f6c44d451b91 Author: Marco Barisione Date: 2011-09-16 11:44:29 +0100 BaseContactList: group the MembersChanged signals for the initial roster We were emitting one MembersChanged and one MembersChangedDetailed signals per contact in the subscribe list when initially connecting. Now we group all of the initial contacts together, setting actor=0. If contacts appear later in the subscribe list we keep emitting a signal per contact (with themselves as actors). Fixes: Reviewed-by: Will Thompson Reviewed-by: Simon McVittie commit e48b851363ef3e083eb5a05809ad3032707284d0 Author: Xavier Claessens Date: 2011-09-14 18:07:51 +0200 Remove tp_dbus_tube_channel_new() We don't need a constructor, channels should always come from a factory. commit 9c42b1568602672b7640cb1eb6c86009f7fee9b4 Author: Xavier Claessens Date: 2011-09-13 11:56:03 +0200 Introspect TpDBusTubeChannel commit f6d49828ecebb2dcf5710d875a509f489a9935a1 Author: Xavier Claessens Date: 2011-09-13 11:42:30 +0200 TpAutomaticClientFactory: Create TpDBusTubeChannel objects commit bd1ae7c77fdf8e5cc00746614f08f62881b29046 Author: Xavier Claessens Date: 2011-09-13 11:12:02 +0200 Coding style: one arg per line commit f507acbfd8dbd9cf8217988398d7b83e79dd98bf Author: Guillaume Desmottes Date: 2011-06-09 16:21:49 +0200 Add TpDBusTubeChannel (#29271) Not much so far, just the base of the object and its basic properties. commit 65d2227e3b949c25d57325ab262a83f9a7f1c97f Author: Guillaume Desmottes Date: 2011-06-09 16:09:28 +0200 add tests/lib/dbus-tube-chan for tests commit d08ba89ff856573f3eae62c506854d6728925a81 Author: Will Thompson Date: 2011-09-13 12:40:53 +0100 Connection: provide debug-message when CM crashes Previously, when a TpConnection was invalidated due to a crash, tp_connection_get_detailed_error() would return DBUS_ERROR_NO_REPLY (which is plausible) but would not include any details in the dict o' details. This is a shame, because the invalidation GError in this case contains a message like “Name owner lost (service crashed?)”. So, let's pass the message on. Related-to: Reviewed-by: Guillaume Desmottes commit 1de349019cd39b643bb7e04acbbe51780ffb3b57 Author: Xavier Claessens Date: 2011-09-07 22:51:56 +0200 Test: verify TpConnection's self contact get factory features prepared commit c78a544a8d533f1fab4308ffbce84840a23accf9 Author: Xavier Claessens Date: 2011-09-07 18:49:18 +0200 tp_simple_client_factory_dup_contact() does not exists commit 2abee14dd2675fd136bebe700ffd49198aabc751 Author: Xavier Claessens Date: 2011-09-07 10:51:30 +0200 TpConnection: prepare factory features on self contact commit 9ad43307fd7757feec5abfb4d12fcdecfade896a Author: Jonny Lamb Date: 2011-09-09 16:10:34 +0100 simple-client-factory: point out NULL is allowed for an account's properties Signed-off-by: Jonny Lamb commit a899ab819ccb3f60b083822eedb0f7989bee3707 Author: Vivek Dasmohapatra Date: 2011-09-07 17:01:59 +0100 Update NEWS commit 55979632725dcce40bf5b6b29cfe4a5e1ed4b7f7 Merge: 2f8725a61 0cb8c83e3 Author: Vivek Dasmohapatra Date: 2011-09-07 16:54:15 +0100 Merge branch 'telepathy-glib-0.14' Conflicts: telepathy-glib/connection.c commit 0cb8c83e33f8addebd35c4890c0355fa9ccd0b2c Author: Vivek Dasmohapatra Date: 2011-09-07 16:39:27 +0100 Debug messages leaked if the debug message cache is disabled, ironically commit 2f8725a6131a3b273edcada8f1d688d4d44cd37e Merge: 93a4228b3 e10e59f8a Author: Vivek Dasmohapatra Date: 2011-09-07 16:18:37 +0100 Merge HEAD, branch 'master' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-glib commit e10e59f8ad45a7f89cceac185906edade97f774e Merge: 83c90bef4 a1dead10c Author: Will Thompson Date: 2011-09-07 11:58:48 +0100 Merge branch 'emit-properties-changed' Fixes: Reviewed-by: Jonny Lamb commit a1dead10c61ac34eb8a5357a575027574991648e Author: Will Thompson Date: 2011-08-26 13:41:20 +0100 Add tp_dbus_properties_mixin_emit_properties_changed_varargs() commit 6e6172c8d1bd6a89495ff27d87d9198b3493a28e Author: Will Thompson Date: 2011-08-26 13:31:07 +0100 _emit_properties_changed(): use annotations Given that we have necessary information in introspection XML to choose between including the property in Changed and in Invalidated, we may as well use it. commit 0630ff688eb5eacce5a635068e0f4e9ca2b6427e Author: Will Thompson Date: 2011-08-26 12:08:45 +0100 ginterface-gen: set PropertiesChanged annotation flags This will be tested shortly. commit 423b08acd005876d0c8eb1e4905939d806980d12 Author: Will Thompson Date: 2011-08-26 12:08:10 +0100 DBusPropertiesMixin: add flags for Changed annotation commit 5b3c8fac3558c7d1f782678adee1ccedd08d7277 Author: Will Thompson Date: 2011-08-02 16:45:40 +0100 Add tp_dbus_properties_mixin_emit_properties_changed It's a bit annoying to use because you have to define the two arrays ahead of time, but hey. commit 3d6e28b390309b704cb44466d6d8eda9b3883483 Author: Will Thompson Date: 2011-08-02 15:41:13 +0100 Extract guts of tp_dbus_properties_mixin_get This will be useful in implementing _emit_properties_changed without it having to repeatedly find the IfaceInfo structure. commit ff92e927810e2fe109f1ab9ae5c9165273b39dbf Author: Will Thompson Date: 2011-08-02 15:32:20 +0100 tp_dbus_properties_mixin_get: add parameter guards These reflect conditions under which this function will currently crash. commit a875eaa7e7d553400aa241e88bf4fdba491ea05f Author: Will Thompson Date: 2011-08-02 18:11:01 +0100 fill_properties_hash: make assertions more useful Previously if you messed up the arguments to this function (say, you passed a fully-qualified property name rather than a interface_name, property_name pair), you'd get an unhelpful assertion about G_IS_VALUE() failing. Now you get a nice critical about the specific property which couldn't be retrieved, listing the interface name and property name and giving the error. commit fe835fc5f94c0e5c1e675b2af0e39c9b36cffe5e Author: Will Thompson Date: 2011-08-02 16:39:27 +0100 test-properties: add a #define for the interface name commit da0ebf66bd23b7fccbc2df739673a5b576198535 Author: Will Thompson Date: 2011-08-02 16:16:40 +0100 test-properties: use GTest commit fdd00e0676868874f5e5c4c86e14485cfc693f1e Author: Will Thompson Date: 2011-08-02 16:00:48 +0100 test-properties: stop using MYASSERT commit 91265f78004e45d316f2727a85ffbee7dba8c268 Author: Will Thompson Date: 2011-08-02 15:53:15 +0100 test-properties: use tp_asv_dump commit 3c16024d94801a108f7f7823455712a3d3485968 Author: Will Thompson Date: 2011-08-02 15:52:58 +0100 tp_asv_dump: swaddle output in {} This makes it a little more obvious commit 83c90bef429392a99e97c077a098b8890a833e51 Author: Xavier Claessens Date: 2011-09-02 10:11:55 +0200 Do not mix static and dynamic GObject bindings in python examples commit 305d4a705e1cc7855886b91c9fe2a3a820da0d25 Author: Vivek Dasmohapatra Date: 2011-08-31 16:39:09 +0100 Free the GStrv of keyfile keys when we are finished with it commit e291b184f921c524cfaf3fb418eeea43a383ed5f Author: Vivek Dasmohapatra Date: 2011-08-30 15:19:10 +0100 Two string members not freed in tp connection destructor commit 93a4228b3d73e71bae72a45a5e9daffbf5fe4d48 Merge: 8db501d95 56729b464 Author: Vivek Dasmohapatra Date: 2011-08-30 15:08:34 +0100 Merge HEAD, branch 'master' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-glib commit 56729b46480a21d43da33bc7dc9e854d9ed3093a Author: Guillaume Desmottes Date: 2011-04-11 14:41:08 +0200 TpProtocol: add API to get avatars requirements (fdo #36049) https://bugs.freedesktop.org/show_bug.cgi?id=36049 commit 0b7e9eab27502bbafc3f097c5c4496de9a24c3ca Author: Will Thompson Date: 2011-08-17 11:33:33 +0100 tp_base_channel_close: check vfunc is not NULL Reviewed-by: Jonny Lamb commit 124c30bd18e0bd5fd3d4547a4ddc357a27ea78ab Author: Xavier Claessens Date: 2011-08-24 17:02:30 +0200 TpConnection: emit contact-list-changed when initial roster is fetched commit 944af3fbdf71ca3333c7d20c32792f5ad524ce73 Author: Xavier Claessens Date: 2011-08-25 11:56:43 +0200 tp_contact_foo_async() callback must be the TpContact not its TpConnection commit f3dd6328aefdbc14876cdd52e1f931589a54ed3e Author: Xavier Claessens Date: 2011-08-24 22:31:17 +0200 Add contact list JS example commit 27ccfd17bd8801c043ac1f0e99aabfe08571cebe Author: Xavier Claessens Date: 2011-08-24 22:32:29 +0200 Include contact-list.py example in tarballs commit 7f465e4a7d2d552f8ded3fd58e537f84b6b9f3a2 Author: Xavier Claessens Date: 2011-08-17 15:31:15 +0200 Hide tp_g_value_slice_new_foo() from g-i scanner This is a workaround for GNOME bug #656743 commit 9afe6d9d087e4bfd928717a5646e7fa6fe939509 Author: Will Thompson Date: 2011-08-23 11:08:10 +0100 Nano-version bump commit cf56f52d3202cb4227d6eb4d990da246d1160013 Author: Will Thompson Date: 2011-08-17 16:02:19 +0100 Version 0.15.5 commit 51171b4f6b0508a6d3ae41b2b54c25d6bbf24415 Author: Will Thompson Date: 2011-08-17 15:55:58 +0100 NEWS for 0.15.5 commit 56e8200aed0fc34bd79750a639a4ae7d2e3ddf46 Author: Xavier Claessens Date: 2011-08-17 15:01:10 +0200 Add skip annotation for NUM_FOO g-i now understands it (GNOME bug #652712) commit a6e979f50ce33b835c4dca8ca274caf2610bc7f8 Author: Xavier Claessens Date: 2011-08-17 14:17:57 +0200 Remove useless ; line commit e420e6ced47dcde7288c380846391ee374b2042a Author: Xavier Claessens Date: 2011-08-05 13:08:49 +0200 Print useful warning in case tp_account_manager_set_default() fails commit 5c198ce94a977f430b898543ce8b8dc53cf74067 Author: Xavier Claessens Date: 2011-08-05 12:46:26 +0200 Define _TP_GNUC_DEPRECATED_FOR() and use it where appropriate commit 798a3651a1549433290d1c1d7c9163cfafa912ec Author: Xavier Claessens Date: 2011-08-05 12:05:02 +0200 Improve documentation a bit commit 93e3044b253278a576a4a885ef5b85a86d9f61c0 Author: Xavier Claessens Date: 2011-08-04 11:26:54 +0200 TpSimpleClientFactory: add code example of typical app's main() when using custom factory commit 6fede7551062e147cec9ea6bb518df90b3a9bda4 Author: Xavier Claessens Date: 2011-08-03 17:46:48 +0200 TpAccountManager is the "toplevel" object, do not create it through a factory Instead of creating a TpAccountManager through a factory, it is more natural to create it directly. If no custom factory is provided at constructor, a default one is created internally anyway. This is also what tp-qt4 does. Note this is break of unreleased API/ABI. commit 01fca3925803eb704f403ac77790263915070ec9 Author: Xavier Claessens Date: 2011-08-03 22:16:52 +0200 TpAccountChannelRequest: do not create a TpAccountManager for tmp handler We can now create TpSimpleHandler with account's factory. This avoid introspection of other accounts if app does not need them. commit 9fbb9a58ed465a85b382c970e0b546f118eb81cd Author: Xavier Claessens Date: 2011-08-03 18:24:28 +0200 TpBaseClient: add constructors with factory instead of AM A factory is what we really need, forcing to create a TpAccountManager also means that a simple channel handler will always introspect all accounts even if it needs only one. With a factory, TpBaseClient can create only needed accounts and still share them with a TpAccountManager if one exists. commit e896dac5070c46b1ac566dd5fa646be9ebe55ee9 Author: Xavier Claessens Date: 2011-08-02 17:40:14 +0200 Add tp_account_manager_set_default() This defines the TpAccountManager returned by tp_account_manager_dup() commit b730034fd48b523b0ad562c07e7fe8cb572de99d Author: Xavier Claessens Date: 2011-08-01 19:59:53 +0200 Deprecate tp_base_client_add_*_features() features are set on TpSimpleClientFactory now commit 02044fd6ef0b093794542b849b55520b0560da04 Author: Xavier Claessens Date: 2011-08-05 09:49:52 +0200 TpBaseClient: prepare TpAccount, TpConnection and TpChannels with factory desired features There are lots of code duplication for those proxy creation and preparation, this will be fixed later. commit d1574f96efab380fff38e336deddc8291d710fae Author: Xavier Claessens Date: 2011-07-27 13:55:42 +0200 Deprecate tp_account_manager_ensure_account() Use instead tp_simple_client_factory_ensure_account() commit 9b093ea38bde5cc7c1ac118b9f48108774241c6f Author: Xavier Claessens Date: 2011-08-04 23:20:11 +0200 TpAccountManager: Fix doc now that TpAccount objects are guaranteed to be prepared commit 7fe582085139e7bb563eee8c37baa72649a9c1b8 Author: Xavier Claessens Date: 2011-08-04 23:19:42 +0200 TpAccountManager: trivial code simplification commit e297364453f319f19b93a9f025573882dc9d2699 Author: Xavier Claessens Date: 2011-08-04 23:19:11 +0200 TpAccountManager: Stop tp_a_m_ensure_account() from inserting non prepared accounts For compatibility we still need to return a TpAccount and no ref, so added a legacy table to keep them. commit b80d04412a1a9dbea414fc8dcb6ca365186fe0f4 Author: Xavier Claessens Date: 2011-08-04 23:06:14 +0200 TpAccountManager: Delay preparing CORE featur until all TpAccounts are ready commit 7db021e92ad36b1f62e143ac29cea506e10df353 Author: Xavier Claessens Date: 2011-08-04 22:57:13 +0200 TpAccountManager: delay account-validity-changed until TpAccount is ready commit 2c4d52b0a4269c9b7b6169b09941b72a528cc50a Author: Xavier Claessens Date: 2011-08-04 22:13:52 +0200 TpAccountManager: Delay create_account_async() reply until TpAccount is ready commit 7da2779fd1b6d4da62a7d92efed4321e1078b612 Author: Xavier Claessens Date: 2011-08-17 11:30:08 +0200 Correctly free a GQueue from dispose If dispose is run twice, first run would free the queue and 2nd would still do a g_queue_foreach() on it... I can't beleive GLib still does not have free_func and refcount on GQueue... commit 236aa055896672319ede0ee5f3f672a77c0dea97 Merge: a7dd01e28 60f6b3edf Author: Xavier Claessens Date: 2011-08-05 15:14:22 +0200 Merge branch 'contact-list-rebase' commit 60f6b3edf2e3ee79191d782fbfe8895ad47d113e Author: Xavier Claessens Date: 2011-08-05 14:53:02 +0200 reword tp_connection_get_contact_list() doc commit ad457b1e77c7e5e8fcad020eae5493da35db61d2 Author: Xavier Claessens Date: 2011-08-05 14:24:37 +0200 Add comment in example explaining what state SUCCESS means commit a7dd01e283f79f4a6e739a3e074dfcf23f39fe85 Author: Xavier Claessens Date: 2011-08-05 12:49:38 +0200 Print warning if tp_account_manager_dup() fails commit 37e03deab2c76f4c94c8808835c16cc782b41b53 Author: Xavier Claessens Date: 2011-08-05 11:19:56 +0200 contact-list.py: rename TelepathyGLib namespace as Tp commit 06acc6e3ff8a391bb99607716271b499f41b27f5 Author: Xavier Claessens Date: 2011-08-05 11:04:58 +0200 contact-list examples: verify state is SUCCESS before getting the contact list commit 319f8960b8969df0251671a7433dbc0689ebd0fd Author: Xavier Claessens Date: 2011-08-05 11:03:56 +0200 Doc fix: Make clear in TpAccountManager doc that propagating the factory also means its features will be prepared on proxies commit 9d6e53029bdeb2d4ae3c59e1674f4558d6340758 Author: Xavier Claessens Date: 2011-08-05 11:03:34 +0200 Doc fix: preparing TP_CONNECTION_FEATURE_CONTACT_LIST is not enough to get contacts contact-list-state must also be SUCCESS commit dc26a80ed9bad3e565dea605ca60661e757de64e Author: Xavier Claessens Date: 2011-07-28 11:02:53 +0200 Tests: verify TP_CONNECTION_FEATURE_CONTACT_LIST also prepare TpContact commit 8e65b2c1f006923e63925367c603d808fbdb78ed Author: Xavier Claessens Date: 2011-07-18 12:06:51 +0200 Include contact-list.c example into TpAccountManager's doc commit 5c71b0d607786524637e5d23ed898319c75bb5fc Author: Xavier Claessens Date: 2011-06-13 11:46:32 +0200 add contact-list.{c,py} example It demonstrate how to get all prepared contacts using a factory. commit 4834baa40d6270b12270d2ee7fa49230318db4e3 Author: Xavier Claessens Date: 2011-06-13 20:14:14 +0200 Prepare TpContact objects for the ContactList If TpConnection has TP_CONNECTION_FEATURE_CONTACT_LIST, also create TpContact objects for the roster. Add tp_connection_dup_contact_list() to get them. commit 3c45ff1964d34ebd48cb0ca46d0b4ea06767f585 Merge: 98807970a 606b8413c Author: Will Thompson Date: 2011-08-04 18:10:25 +0100 Merge branch 'qed' Fixes: Reviewed-by: Xavier Claessens commit 98807970a4c2710cd529459562a1e9f68ae6f5ab Merge: 2b3901490 8370b72c4 Author: Will Thompson Date: 2011-08-04 17:26:08 +0100 Merge branch 'target-id-in-channel-manager' Fixes: Reviewed-by: Will Thompson Reviewed-by: Xavier Claessens commit 2b3901490c8ad0e50b0cdc1e0dab35025e7588b0 Author: Xavier Claessens Date: 2011-08-04 15:50:06 +0200 Add TP_CONTACT_FEATURE_INVALID into doc fix make check commit e4677ed33842a2deeffd5e119833c74571485d0e Author: Xavier Claessens Date: 2011-08-04 15:10:45 +0200 Add TP_CONTACT_FEATURE_INVALID because 0 is a valid TpContactFeature commit 24d358dfc94c8872e2931e1290e7de94cd6e4f3c Author: Xavier Claessens Date: 2011-08-04 14:06:07 +0200 Add tp_simple_client_factory_add_*_features_varargs() This is much nicer C API, and TpBaseClient had those helpers too. commit 026d5c3c6a1f678c50cb763ecc1d597329be3c58 Author: Xavier Claessens Date: 2011-07-17 12:26:47 +0200 Add _tp_contacts_from_values commit cb60818446aa2ada02be888c0bb99b42777f5594 Author: Xavier Claessens Date: 2011-06-13 20:32:09 +0200 export some internal functions of contact.c commit a26e5896246996113c22ce7979bb14efe138fb99 Author: Guillaume Desmottes Date: 2011-08-04 11:57:55 +0200 annotate TpConnectionUpgradeContactsCb commit 95435cdb202d5c85de5bddf5d0e376737aeca5c5 Author: Xavier Claessens Date: 2011-06-05 18:11:33 +0200 Add TP_CONNECTION_FEATURE_CONTACT_GROUPS to prepare the list of groups on the connection commit 8db501d95f781c6b411f46fb8513d307d9dde7ca Author: Vivek Dasmohapatra Date: 2011-08-03 11:47:18 +0100 Merge HEAD, branch 'master' of git+ssh://git.freedesktop.org/git/telepathy/telepathy-glib commit ef8fe8be1a8a631fa406a03fa2db3c54146b0bd5 Author: Xavier Claessens Date: 2011-08-02 14:34:57 +0200 Deprecate constructors of TpBaseClient subclasses which do not take a TpAccountManager Those are misleading, if app created its own TpSimpleClientFactory and is using a TpAccountManager from it, they must pass their AM instead otherwise the default one will be used. commit 98568941339b7f177c790036fdd20a813398dbc8 Author: Xavier Claessens Date: 2011-08-01 14:26:04 +0200 TpChannel: prepare CORE on its connection before doing anything else commit 9bd9e89432eee838986ee9e1ab84631892170be4 Merge: f882f8c5b 54c187e5f Author: Will Thompson Date: 2011-07-29 18:39:07 +0100 Merge branch 'fix-gtkdoc-out-of-tree-builds' Reviewed-by: Simon McVittie Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=39666 commit 54c187e5fffaa36cba6065c6992318f4fe882423 Author: Will Thompson Date: 2011-07-29 18:33:47 +0100 Depend on gtk-doc ≥ 1.17 I can't find a Debian package of 1.16, and the docs don't build at all with 1.15 with this branch. Debian Testing and Ubuntu Natty both have 1.17 so I think this is fine. commit 01fc098d7ca7e72f5d2e41c362a3f504f877a151 Author: Will Thompson Date: 2011-07-29 16:05:57 +0100 Add automatic-client-factory-internal.h to makefile. commit 3ab0d7678cb15cb33b7042c8a8b69c1b3ac5e93f Author: Will Thompson Date: 2011-07-29 15:54:22 +0100 docs: fix out-of-tree doc checks with gtk-doc 1.17 gtk-doc 1.17 runs in the builddir, not the sourcedir. So these files end up in the builddir, which is where we're running. Unfortunately this breaks doc checks with gtk-doc ≤ 1.16, which I can't find the strength to care about. commit 07cccde224118ebd852c41b7849bc9690ff2dc78 Author: Will Thompson Date: 2011-07-29 15:42:52 +0100 docs: sync Makefile with gtk-doc's example one This does not change any behaviour; it just adds some defaults and comments from the sample file to make diffing the two easier. commit 019e84e641e01b30732bcd4313620faaf15c371b Author: Will Thompson Date: 2011-07-29 15:23:49 +0100 docs: use GTKDOC_CFLAGS not INCLUDES Going by the examples provided by gtk-doc, this is preferred. It's been supported approximately forever. commit e3dcc31f9134f9307da478a5fa4881907cd8e13f Author: Will Thompson Date: 2011-07-29 15:04:44 +0100 docs: correctly scan source dir commit b736d5036954996dbaef25cb545df5c1d6535f13 Author: Will Thompson Date: 2011-07-28 18:46:32 +0100 docs: generate version.xml from configure commit 6317c33a6e44146cd6fccc9c1ad25976d7d4d6e8 Author: Will Thompson Date: 2011-05-18 15:24:17 +0100 docs: add version.xml to content_files In the past, gtk-doc always build documentation in the source tree, even if you were building out of tree. gtk-doc 1.17 corrects this; but it means that we now have to tell it that this file exists. commit f882f8c5b8f38251c151ff4cd0463cf3cd8af3e1 Author: Travis Reitter Date: 2010-11-04 11:19:15 -0700 Cut unnecessary sed hacks for Vala bindings. Fixes fdo#31387. commit 8370b72c49621d0882e3f88058cfe1e3ad75fea1 Author: Will Thompson Date: 2011-07-28 14:25:03 +0100 echo-conn: simplify normalize func commit 65f3c4057f5ffb3bac8766fce96a751e8aa1c808 Author: Will Thompson Date: 2011-07-28 14:24:45 +0100 request-properties test: mention bug # commit 0d61cf38abce53d9694f18d659435d5b62522f6c Author: Will Thompson Date: 2011-07-28 13:01:57 +0100 Requests: update comment about synthesized properties We have a couple more synthesized properties these days. commit a93e97a9ea768b6885864ff8094efb6ad6408133 Author: Will Thompson Date: 2011-07-28 12:59:53 +0100 RequestChannel: avoid re-fetching handle repo It is indeed guaranteed to be non-NULL because of the above: in fact, the above set it to a non-NULL value in the handle != 0 case. commit 829c73575a6afaf54edcca59857d462813ad4462 Author: Jonny Lamb Date: 2011-01-10 11:55:13 +0000 gitignore: updated Cheers, emacs. Signed-off-by: Jonny Lamb commit 55771f1a309cce65ee6a540a047df54cf835a778 Author: Jonny Lamb Date: 2011-01-10 11:54:50 +0000 channel-manager-request-properties: add test for remaining TargetID Tests fd.o#27855 Signed-off-by: Jonny Lamb commit 6d7396ac8066d44c14e6573163f8d02f97d37e5d Author: Jonny Lamb Date: 2011-01-10 11:53:44 +0000 simple-channel-manager: add object with emits ::request on a channel request The TpBaseConnection is in the public struct so it can be created without the connection at first and then added later. Signed-off-by: Jonny Lamb commit dece3d5667673858017ec0bbf922d1ab67062d28 Author: Jonny Lamb Date: 2011-01-10 11:52:38 +0000 echo-channel-manager-conn: add base connection subclass This simple connection lets a test add one channel manager of its choosing. Signed-off-by: Jonny Lamb commit f18c7e73aa3a495062feba7402474ea218991bcb Author: Jonny Lamb Date: 2011-01-10 11:51:13 +0000 echo-conn: change behaviour of contact normalize function slightly Look, documentation too! Signed-off-by: Jonny Lamb commit 9badb5ab35b1091f571201e3713f80303b4c7771 Author: Jonny Lamb Date: 2011-01-06 14:38:40 +0000 base-connection: ensure TargetID is untouched and present in requests Signed-off-by: Jonny Lamb commit 960abaf4481ed35308e40ca83d886bff6fd79858 Author: Xavier Claessens Date: 2011-07-21 12:24:44 +0200 Add unit test for ContactList properties commit acc0d08619a108ec774ca9d3057e15b86d851467 Author: Xavier Claessens Date: 2011-06-06 12:09:57 +0200 Add new feature TP_CONNECTION_FEATURE_CONTACT_LIST It introspects Connection.ContactList properties commit 68017d35d57e8947a02a742eadf09653e76720e0 Merge: aed3c378d cbffbb62c Author: Will Thompson Date: 2011-07-27 18:34:04 +0100 Merge branch 'fd.o-39377-repeated-location-requests-moar' Fixes: Reviewed-by: Jonny Lamb Reviewed-by: Xavier Claessens commit cbffbb62cb6ec9a3cc0474472a0dc2713587ca40 Author: Will Thompson Date: 2011-07-27 18:27:15 +0100 test-contacts: ensure all features are tested for idempotency commit be50c6d0ea626e9b6041d12d7487beda5b0a6b1b Author: Will Thompson Date: 2011-07-27 18:26:51 +0100 test-contacts: test AVATAR_DATA idempotency This was fixed by Xavier's commit ea9c94140f985e1940f027346aefbcd2b472f48e. commit e0d5749573d310b94b132d685bb953c1dc7c98fe Author: Will Thompson Date: 2011-07-21 19:16:40 +0100 test-contacts: check idempotency of CAPABILITIES I'm bending the rules a little here... commit 897ed19a5382ff1961d94c45add39ee51f955334 Author: Will Thompson Date: 2011-07-21 19:15:38 +0100 Contact: don't wrongly mark Capabilities prepared This is the same hypothetical issue as fixed (and tested to be fixed) for SimplePresence. commit ac25fbae2e234704d6ea698362ec737066a9cbec Author: Will Thompson Date: 2011-07-21 18:16:21 +0100 test-contacts: add fd.o#27686 ref to its test commit 93c9b19671c812c4e527b9ad44bc6d60698642a0 Author: Will Thompson Date: 2011-07-21 17:52:20 +0100 Contact: avoid stupid prepend-and-reverse pattern Normally I'd say “use GQueue” but we can just as easily iterate backwards. commit ff475baddbc251a5cbae057aa0bb1cd74dfe1cef Author: Will Thompson Date: 2011-07-21 17:50:10 +0100 Contact: mark CONTACT_INFO prepared if info is unknown You can't distinguish between “This contact has no information” and “This contact's information is unknown” from the tp-glib API *anyway*. commit bf9e1017ed8ab024587cf158b2e5286cc17369b9 Author: Will Thompson Date: 2011-07-27 18:20:29 +0100 Contacts: warn if CM's Aliasing impl is buggy commit 09e8f5d53472331c6fe73e44b129f5c9ae431b0f Author: Will Thompson Date: 2011-07-21 17:18:16 +0100 PresenceMixin: expunge g_hash_table_foreach I was checking this code out and these scared me. The one in tp_presence_mixin_set_status is particularly weird because the callback was only called once because g_hash_table_foreach() only got called if g_hash_table_size() returned 1! commit b216c95f9d184deb9bf5c7a1e2eacc048ed676b8 Author: Will Thompson Date: 2011-07-21 17:11:37 +0100 Contacts: don't wrongly mark SimplePresence prepared Previously, if a broken CM included the SimplePresence/presence attribute when TpContact didn't ask for it, CONTACT_FEATURE_FLAG_PRESENCE would still be set, even if we weren't listening to PresencesChanged. So this is broken. This fix makes TpContact ignore unsolicited presence information in GetContactAttributes replies. The other option was to bind to the signal in that event, which seems … surprising. commit 0fa6d8c766622c8310cc746a4575f22fb2c42dc3 Author: Will Thompson Date: 2011-07-21 15:47:35 +0100 Contacts: avoid re-introspecting client types My reading of the spec says that it's okay to leave /client-types out of the result of GetContactAttributes(). My reading of the tp-glib documentation is that it's valid for tp_contact_get_client_types() to return NULL even if TP_CONTACT_FEATURE_CLIENT_TYPES is prepared. TpContact:client-types is documented a little differently, so I'm changing it to match. commit 2dfeab6378ca0fc57a9060c873f2c2db6ff29682 Author: Will Thompson Date: 2011-07-19 19:46:23 +0100 Contacts: avoid repeatedly re-introspecting avatar tokens The definition of the token attribute says it should be “omitted from the result if the contact's avatar token is not known”. commit 4379cadab2b89cfbd86366e96b2bbab2fb02cf2d Author: Will Thompson Date: 2011-07-19 19:29:52 +0100 test-contacts/by_handle_again: prepare many more features In theory this test should be able to prepare *every* feature and not make redundant GetContactAttributes(). Until recently, this was broken for LOCATION. Some features are currently commented out because TpContact is buggy; others are commented out because TpTestContactsConnection is buggy. commit a69d04ea3a6482e227138ff2dbabe26072615233 Author: Will Thompson Date: 2011-07-19 18:45:16 +0100 Contacts: remove slow path for Location The only CM that implements Location is Gabble. It implements Contacts. Also Contacts has been around forever. Bye bye dead code. commit cc017585dee87eb3f34442b98a487136a87cb510 Author: Will Thompson Date: 2011-07-19 18:32:44 +0100 Contacts: mark LOCATION prepared if contact has none Previously, if a contact had no published location, the internal flag for “LOCATION is prepared” would not be set, and so repeated calls to tp_connection_get_contacts_by_{id,handle} would repeatedly call GetContactAttributes(). commit 11ff0856d23ee0cc87f1a05793dec3f581e3b450 Author: Will Thompson Date: 2011-07-19 17:49:58 +0100 test-contacts/by_handle_again: don't SEGV on failure If this test regresses (perhaps because some nefarious developer finds that it fails for many features other than ALIAS, and systematically tries them all), it should fail with a reasonable assertion, rather than a segmentation fault. Thus, our first assertion should be that the second call to tp_connection_get_contacts_by_handle() did not return an error, rather than trying to make assertions which will dereference NULL pointers if the call fails. commit d2a9b72b823fcad5a43cd8c60fd7229bb560d83e Author: Will Thompson Date: 2011-07-19 16:56:19 +0100 test-contacts: extract TpBaseConnection-disappearing This is a neat trick. I'm gonna use it in my own tests. commit 1fc67d18306a581979ca776ecdb2b29fecd13880 Author: Will Thompson Date: 2011-07-19 16:49:22 +0100 test-contacts: correct names of British Isles states http://en.wikipedia.org/wiki/Terminology_of_the_British_Isles commit 40820f53c074ef21e75b4aab7a081f30f700de58 Author: Will Thompson Date: 2011-07-27 18:12:15 +0100 Contact: pass all wanted features to set_attributes commit aed3c378de59e1b28ffb4fe370f1ddd981c9e163 Merge: 15838f798 f3719c040 Author: Will Thompson Date: 2011-07-27 18:00:29 +0100 Merge branch 'disable-test-timeouts-in-gdb' Reviewed-by: Jonny Lamb commit f3719c040b7e12cc7c10da981a9a688e01eb56d8 Author: Will Thompson Date: 2011-07-19 16:35:06 +0100 Tests: disable timeouts if we're being debugged This is pretty evil, but I got sick of my gdb sessions being destroyed because I forgot to set TP_TESTS_NO_TIMEOUT to prevent the SIGALRM going off after 10 seconds or whatever. So this checks /proc/self/status to see whether another process is tracing us. If a "TracerPid:" line is present, and is followed by a non-zero pid, the timeout is disabled. If the line is present but with a zero pid, if the line is missing, or if the file is missing or reading it fails, we set the timeout as usual. commit 15838f798a31540fdb919c8ba8bdbc164a9dda35 Merge: 1fd9b082e 77efcf363 Author: Will Thompson Date: 2011-07-27 17:58:00 +0100 Merge remote-tracking branch 'xclaesse/contact-refactor' Reviewed-by: Will Thompson commit 77efcf363bf3546d41d330e66cecdc79ab7c0a84 Author: Xavier Claessens Date: 2011-06-06 13:12:29 +0200 Factor out contacts_bind_to_signals() commit 8288a109594c1ebb84ad82545c906276287f758b Author: Xavier Claessens Date: 2011-06-06 13:19:43 +0200 Factor out tp_contact_set_attributes() commit ea9c94140f985e1940f027346aefbcd2b472f48e Author: Xavier Claessens Date: 2011-06-06 11:30:15 +0200 Stop depending on slow path for avatar data commit 1fd9b082ee7d7e96aea2905e0749482a49e5c345 Author: Xavier Claessens Date: 2011-07-25 11:23:25 +0200 Deprecate Tp{Basic,Automatic}ProxyFactory in favor of Tp{Simple,Automatic}ClientFactory Add internal wrappers for deprecated functions so we can still use them for compatibility commit d69d8d8e20dd2061e1bb892534ab338c608eb47a Author: Xavier Claessens Date: 2011-07-25 11:05:25 +0200 Use TpSimpleClientFactory to create TpChannel objects For compatibility, still use TpAutomaticProxyFactory if one is explicitely set, but use TpAutomaticClientFactory otherwise. commit a2076276e910b910c73a0538cf7ad9bde9164263 Author: Xavier Claessens Date: 2011-06-08 23:14:28 +0200 Add new feature TP_ACCOUNT_FEATURE_CONNECTION It delays "connection" property change notification until the TpConnection is prepared with factory's desired features. commit 6738187d265dfc0987dd52a31ef0ae94534dbc23 Author: Xavier Claessens Date: 2011-06-08 21:56:36 +0200 Add tp_connection_get_account to get a TpAccount from a TpConnection This works only if the connection was created using a factory that has the corresponding account commit c490a898d4d97a0521fb72a4e5759b5aa71e34a5 Merge: 6d07832b7 2e4ee3789 Author: Will Thompson Date: 2011-07-25 19:05:29 +0100 Merge remote-tracking branch 'danni/set_message-38061' commit 6d07832b73f29c943b7aceb8bc27228ed545406d Merge: a85dba4ea bd771a612 Author: Will Thompson Date: 2011-07-25 18:43:26 +0100 Merge branch 'misc' Reviewed-by: Robert McQueen commit bd771a61262c9be1de928da144777fc0d2de4003 Author: Will Thompson Date: 2011-07-25 18:37:40 +0100 Connection: replace constructor with constructed In theory someone might have subclassed this and depended on this work being done in constructor. But it seems unlikely. commit ce1c7e7f3e52a1db223e7ad5ad3836debabdb6ff Author: Will Thompson Date: 2011-07-25 18:35:34 +0100 Connection: remove useless debug from constructor commit a85dba4eab8b8e12e72eedbdc584feb65b40cbc8 Merge: 755173281 771cd883b Author: Will Thompson Date: 2011-07-25 18:33:24 +0100 Merge branch 'telepathy-glib-0.14' commit 771cd883be1e889fb56c1fed0fe4360f55d123f5 Merge: 1d72e2d85 563c7de5b Author: Will Thompson Date: 2011-07-25 18:33:19 +0100 Merge remote-tracking branch 'danni/crash-38060' into telepathy-glib-0.14 commit f782b74f3a1d24a8d5493b492b609380f1245b51 Author: Will Thompson Date: 2011-07-25 17:29:47 +0100 Connection: remove an obsolete and redundant comment We use more than just HasImmortalHandles from the connection's properties. commit 7551732815526391f15f6e1ab94bfee7a310c199 Author: Xavier Claessens Date: 2011-07-25 11:30:13 +0200 Fix inconsistency in #include commit 8f2263089e92543d62e40d6b6eb7bb01cd725deb Author: Xavier Claessens Date: 2011-07-25 11:30:01 +0200 Fix alphabetic order commit 66b946b1380c8c68dbf7416e6e268d82409ce2dc Author: Xavier Claessens Date: 2011-07-22 10:34:27 +0200 Rename _tp_g_ptr_array_sized_new_with_free_func() to _tp_g_ptr_array_new_full() To match the name of the function that will be included in GLib 2.30 commit 036e5009ded107700ce4812b064cb5c8c572ce5f Author: Will Thompson Date: 2011-07-18 18:16:27 +0100 SimpleClientFactory: refer to channel_new_from_properties tp_channel_new_with_properties() doesn't exist. commit 9c753743b18d9a72b910b15e3beb6b6d1b84b8f9 Author: Will Thompson Date: 2011-07-18 18:00:11 +0100 Document TpSimpleClientFactoryClass The previous documentation had a lot of words but no facts. (While I was here I reworded the introduction.) commit 0c34686824c44b99b4c10e488887cba3da059f9d Author: Will Thompson Date: 2011-07-18 17:36:12 +0100 TpSimpleClientFactoryClass: correct copy-pasta error dup_account_manager_features' documentation referred to tp_simple_client_factory_dup_account_features() rather than to tp_simple_client_factory_dup_account_manager_features(). commit 1e09067808be91a56dd42fdce32631ea11130091 Author: Will Thompson Date: 2011-07-18 17:23:02 +0100 SimpleClientFactory: group methods into subsections This helps break up the huge wall o' prototypes in the synopsis by grouping the functions into the type of proxy they relate to. commit 8c4f2beb0865db6728aa7fc32391a28d5509b513 Author: Will Thompson Date: 2011-07-18 17:15:00 +0100 *ClientFactory: add better one-line summaries commit ccb35268821cdca7cdad25c2f83c958a51b19235 Author: Will Thompson Date: 2011-07-18 16:22:52 +0100 automatic-client-factory-internal.h: more useful summary commit f9577eb481f02aceb8b01c1240d0bd656ef23ff3 Author: Will Thompson Date: 2011-07-18 15:31:35 +0100 AutomaticClientFactory: linkify FEATURE_SMS commit 939d28020d4d83c3f9752e353b7fb976f4f54392 Author: Will Thompson Date: 2011-07-15 17:46:29 +0100 *ClientFactory, Proxy: Documentation nits. commit 7c87f9389ed05ca6755125d0aa674d4f8e022868 Author: Will Thompson Date: 2011-07-15 16:24:38 +0100 AutomaticClientFactory: improve short description commit e4ec2336b5270ec76cf362d252518e08e705a9de Author: Xavier Claessens Date: 2011-07-15 16:56:46 +0200 Add a comment explaining why we cannot let make TpContact subclasses yet commit dede71ff8ff450a8137f37ba2cad8063deb203d8 Author: Xavier Claessens Date: 2011-07-15 16:54:41 +0200 Always create TpChannelDispatchOperation through a factory commit 3b61b734df953582fe48cb7626709dca35d3a128 Author: Xavier Claessens Date: 2011-07-15 16:52:25 +0200 Always create TpChannelRequest objects through a factory commit 34dd2ad3f2aaa2a5a8167c3af1829ec4ad064787 Author: Xavier Claessens Date: 2011-07-15 16:47:17 +0200 Ensure TpChannelRequest always has a factory and use it to create its TpConnection and TpAccount commit b65a8a0c7ca7dc38c8f992a129f583cc12cfe13b Author: Xavier Claessens Date: 2011-07-15 16:44:03 +0200 Ensure TpConnection always has a factory commit 0d616c29b663e475e2e4e2105693f2212b7715b6 Author: Xavier Claessens Date: 2011-07-15 16:42:54 +0200 Ensure TpAccount always has a factory and use it to create its TpConnection commit e2e02013a3f848ee9103c7f34909402931648b1a Author: Xavier Claessens Date: 2011-07-15 16:42:08 +0200 Ensure TpAccountManager always has a factory and use it to create its TpAccount commit 06b2551cd230f4778389654b04750cdd0d8ce485 Author: Xavier Claessens Date: 2011-07-15 16:40:05 +0200 Add _tp_proxy_ensure_factory commit b74a3c1288b5e871fd2d231beb4cf692b0b42d9e Author: Xavier Claessens Date: 2011-07-15 16:36:02 +0200 Add TpAutomaticClientFactory This is a subclass of TpSimpleClientFactory that creates specialized TpChannel objects, like TpTextChannel and TpStreamTubeChannel commit ebe0c53202e216cd049e4b59e4d49d5b5e7f67db Author: Xavier Claessens Date: 2011-07-15 16:30:59 +0200 Add TpSimpleClientFactory This is a new object replacing TpBasicProxyFactory but can construct any known TpProxy subclasses, guarantee their uniqueness per object-path and keep a user-defined set of features to prepare on them. commit f35ecbc1b9dcc50f79c895e806854938244a37f7 Author: Xavier Claessens Date: 2011-07-13 16:50:34 +0200 Expose internally a TpContact constructor commit 1c6215a7f12108dcd240eaa541df7a4be296bd17 Author: Will Thompson Date: 2011-07-18 18:17:04 +0100 AccountChannelRequest: remove invalid @see_also tag Previously, gtk-doc complained of an illegal multi-line “Since:” annotation, and omitted the cross-reference from the generated documentation. @see_also is only legal in section headers, not in function documentation. commit 3b4124174abb5ac7dfa6898ed3b4a4d7c9810ac9 Author: Will Thompson Date: 2011-07-18 15:24:07 +0100 Tweak TpFileTransferChannel docs. Previously, TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE was documented, but missing from the generated documentation because it was under in -sections.txt which is gtk-doc-ese for “omit this”. Fixing this revealed a nit in its docstring. While I was here I fixed up some other docs too. commit 416612c8733377fd648062a25970f8d2194c8ad7 Author: Simon McVittie Date: 2011-07-18 11:43:31 +0100 Link a second static library for libtp-glib-tests, against libtelepathy-glib-internal.la Linking with -Bsymbolic (as done by default on recent Ubuntu) ends up linking different parts of the executable against the copy of libtelepathy-glib-internal in the shared library, and the copy in the static library. This leads to mysterious GLib assertion failures. Tests that need to access internal symbols (and thus link against libtelepathy-glib-internal.la) must now use libtp-glib-tests-internal.la instead of libtp-glib-tests.la. There's currently no difference between the two except their dependencies, but in principle, we could add test glue that also requires internal symbols to libtp-glib-tests-internal while avoiding including it in libtp-glib-tests. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39183 Reviewed-by: Will Thompson commit e050432941d160f64a79311159728b921598df8d Author: Will Thompson Date: 2011-07-15 16:14:36 +0100 ChannelRequest: unref connection, not NULL channel commit 4426eb12caa562a69da5b0f63a0ffb888425225f Author: Xavier Claessens Date: 2010-12-08 17:10:16 +0100 It is useless to ref/unref channels in the GPtrArray, it has a free_func anyway commit dedcd5b114c17ff7593a7a01d9a85ed373c34af3 Author: Xavier Claessens Date: 2011-07-15 14:15:03 +0200 add convenient wrappers for single-contact operations commit c95c1684ab9def8baa55f05a04578de31aa44408 Author: Xavier Claessens Date: 2011-07-15 14:12:54 +0200 Add async wrapper for RequestSubscription, AuthorizePublication, RemoveContacts, Unsubscribe, Unpublish, SetGroupMembers, AddToGroup, RemoveFromGroup, RemoveGroup and RenameGroup commit 476db658257a9024ee6204dbc9b801ab38ad2fdd Author: Xavier Claessens Date: 2011-06-30 13:09:11 +0200 Add _tp_contacts_to_handles() Help implementing _async(guint n_contacts, TpContact **contacts) methods commit fca869ff377775bdf7abc5a5a3d69ad006b18467 Author: Guillaume Desmottes Date: 2011-07-14 10:13:37 +0200 telepathy-glib-docs.sgml: add TpFileTransferChannel commit 36978eed7bec4ce5622f04fa46a3e034aaadc278 Author: Guillaume Desmottes Date: 2011-07-14 09:54:29 +0200 automatic-proxy-factory: document that we ask to prepare TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE commit 2e2a28f8864b0f592f1e6229517d9b4e4f48b0c1 Author: Morten Mjelva Date: 2011-02-16 23:37:14 +0100 Add TpFileTransferChannel (fdo #31376) Only support basic properties for now. commit 4bb8d5f8aad41a5d89db289de1cad6e969efd0bb Author: Xavier Claessens Date: 2011-07-13 14:21:08 +0200 Use tp_clear_pointer() in tp_channel_finalize() commit 6b6703a8f068fb4e2e49d833d2f3467888e10321 Author: Morten Mjelva Date: 2011-06-17 14:29:22 +0100 Factor out _tp_destroy_socket_control_list() to tests/lib/util https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit a2ae63f0c84f866567b85c271e7be279580580c2 Author: Morten Mjelva Date: 2011-06-17 14:28:58 +0100 Factor out _tp_create_local_socket() to tests/lib/util https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit 9426b05a03dcc35f3e6b3fe6edf1a7316005b282 Author: Morten Mjelva Date: 2011-06-17 14:32:35 +0100 Factor out _tp_set_socket_address_type_and_access_control_type() and _tp_create_client_socket to util-internal https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit 63d1b120b041155b29e3d12167025a0cf453fea8 Author: Xavier Claessens Date: 2011-07-13 13:11:10 +0200 Trivial coding style fix commit e6c5a04375b755cbf41f9eab2c0461b29dd55f84 Author: Xavier Claessens Date: 2011-07-13 12:47:24 +0200 Drop useless leave_channel_async() static function commit b25437e2942a08f590b14c5c889274cb79819cb2 Author: Xavier Claessens Date: 2011-07-13 12:25:44 +0200 Add tp_channel_join_async() commit c027544e5f5479a92dab00434195e68fac4138c3 Author: Will Thompson Date: 2011-07-12 17:07:00 +0100 Bump nano version to 0.15.4.1 commit 26e2815291d7d1fc27ec10c46c9bef41041ea0b1 Author: Will Thompson Date: 2011-07-12 16:52:34 +0100 Version 0.15.4 commit e4e75f300766b3e019b29f80b624f225168d3f97 Author: Will Thompson Date: 2011-07-12 16:51:53 +0100 NEWS for 0.15.4 commit f09170ae457acd3eb638979d500f54421eca2a5a Merge: 99458a627 f34329fed Author: Will Thompson Date: 2011-07-12 16:44:37 +0100 Merge branch 'fd.o-39172-TpTextChannel-pending-message-queue' Reviewed-by: Jonny Lamb commit f34329fed56539cad3dd63cee46d620c25200692 Author: Will Thompson Date: 2011-07-12 16:37:56 +0100 TextChannel: clarify choice of _by_handle vs _by_id These comments' positioning confused me. commit 20a7d3ff395b2934cc8e0f207955820104d3620f Author: Will Thompson Date: 2011-07-12 16:30:44 +0100 TextChannel: use a GQueue while processing pending messages commit d485129ddd30936589b8ee190043425cf6f9346b Author: Will Thompson Date: 2011-07-12 16:19:40 +0100 TextChannel: don't leak self pointer in contacts cbs In got_pending_senders_contact_by_handle_cb and got_pending_senders_contact_by_id_cb, we get a pointer to ourself using g_async_result_get_source_object, which returns a new reference rather than borrowing one. So we need to unref. commit 6ab2ef14112276f43196d98a8c51f4fea149f874 Author: Will Thompson Date: 2011-07-12 16:17:35 +0100 TextChannel: fail IncomingMessages if contacts can't prepare If we can't prepare *any* contacts (as opposed to just some contacts failing to prepare) then the channel is pretty broken. In the past, in this case we would mark the IncomingMessages features as prepared without failure, but silently drop the messages! In practice this can only fail if the CM crashes or the connection goes away behind our back. But it seems safer to mark the operation as failed. (Relatedly, if we just _complete() the GSimpleAsyncResult then TpProxy's machinery marks the features as prepared or failed as appropriate.) commit a3e2e0cbeddb96a943dfe3f2cc1eabc24f25cda4 Author: Will Thompson Date: 2011-07-12 16:11:57 +0100 TextChannel: return on GetPendingMessages errors commit 8e12523d99a495f562066a124536e1287aeeb1c8 Author: Will Thompson Date: 2011-07-12 16:00:38 +0100 TpTextChannel: fix preparing when message-sender-id is missing 6fe8293 introduced a regression where, if a CM does not include message-sender-id in received messages, preparing a TpTextChannel for a proxy which has pending messages will never complete. As of that commit, the only reference to 'result' is owned by the call to Get(..., 'PendingMessages'), which is released once get_pending_messages_cb() returns. So the callback for tp_connection_get_contacts_by_handle/tp_connection_get_contacts_by_id never fires, because 'result' is specified as the weak object for the call: the result dies immediately, and hence the get_contacts operation is cancelled. This patch makes the calls to get_contacts_by_* hold a reference to the result which they pass as a weak object. This is an abuse of the weak_object field to pass both an object and another pointer to the callback. Arguably it would be clearer to use a context struct, and my advocating the removal of exactly such a context struct triggered this bug… Fixes: commit c92f25b3b3ffacf4cd2b516e46148f2b4a5f40b8 Author: Will Thompson Date: 2011-07-12 15:53:08 +0100 text-channel test: store bob's handle. While we're there, remove unused references to 'alf'! commit 99458a6274936fb6207131705cbedc6eedc63334 Merge: 3ea87ba10 1d72e2d85 Author: Guillaume Desmottes Date: 2011-07-12 16:14:07 +0200 Merge branch 'telepathy-glib-0.14' commit 1d72e2d85ba9d2e1c2d883bc8e472e332d476d11 Author: Guillaume Desmottes Date: 2011-07-12 15:18:40 +0200 test-stream-tube: pass if UNIX sockets are not implemented https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit 8805d05c1b2d6fd3e287dbd286fde215e47d5bd0 Author: Guillaume Desmottes Date: 2011-07-12 15:09:36 +0200 gnio-util: properly set the GError if UNIX sockets are not implemented https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit ae7aa32899863e0aed03c56c3e853ca0c3ffe167 Author: Guillaume Desmottes Date: 2011-07-12 14:55:37 +0200 tests/lib/stream-tube-chan: don't try to use UNIX socket if not supported https://bugs.freedesktop.org/show_bug.cgi?id=38997 commit 3ea87ba10095c0e02a2ce2ac9777bd95be8d2768 Author: Xavier Claessens Date: 2011-07-12 12:47:02 +0200 Fix build error in unit tests commit ebf70605418bd424e32973d49b6e3d86e053524c Author: Xavier Claessens Date: 2011-07-12 12:31:31 +0200 Factor out _tp_g_ptr_array_sized_new_with_free_func() commit 83858d2f09064fa00011ffca1608b4619c941f7a Author: Xavier Claessens Date: 2011-07-12 11:21:37 +0200 Set initial value to user_action_time to make compiler happy Actually if that var did not receive a value, it already does a goto out anyway commit 9112203599b94092566a05cdc94908568d3ee483 Merge: 81a558320 b39713ce4 Author: Will Thompson Date: 2011-07-11 17:42:31 +0100 Merge branch 'debug-stubs' https://bugs.freedesktop.org/show_bug.cgi?id=39046 Reviewed-by: Guillaume Desmottes commit 81a558320db6a4250172c5647c34ebd3d3aac5ba Author: Guillaume Desmottes Date: 2011-07-08 13:10:41 +0200 set nano flag commit ae5e66f5c51bfdfc058010cb6f679af86732cd48 Author: Guillaume Desmottes Date: 2011-07-08 12:40:53 +0200 prepare 0.15.3 commit 3cac880eb65d8c31c4bde837cdabb66d10643fc9 Author: Guillaume Desmottes Date: 2011-07-08 12:14:32 +0200 Revert "Revert "channel-iface: set TP_UNKNOWN_HANDLE_TYPE as default handle type"" This reverts commit 433cc4833d23c1dc662e6572b6127f5bae1f583e. We do want this change in 0.15 as that's the dev branch. CMs should be fixed. commit 0bd49ea011a9da63c48d1e8bd8e2fe424487bb6b Merge: ed21d5b43 7b3da30d9 Author: Guillaume Desmottes Date: 2011-07-08 12:14:09 +0200 Merge branch 'telepathy-glib-0.14' into release Conflicts: NEWS configure.ac commit 7b3da30d95fbee84b1a9b2a5a293f17722a551a1 Author: Guillaume Desmottes Date: 2011-07-08 12:11:37 +0200 set nano flag commit b8d20f9416ae3c190b853eed64824af69b942708 Author: Guillaume Desmottes Date: 2011-07-08 10:20:07 +0200 prepare 0.14.9 commit 433cc4833d23c1dc662e6572b6127f5bae1f583e Author: Guillaume Desmottes Date: 2011-07-08 11:44:07 +0200 Revert "channel-iface: set TP_UNKNOWN_HANDLE_TYPE as default handle type" This reverts commit d50e2a51e92c2f3c37f7c30d7351c4651da350f9. This fix introduces assertion error in some CM which is not a good thing in a stable branch. commit ed21d5b431b6e8fa3ba78b0f638653fc13b4c5ac Author: Guillaume Desmottes Date: 2011-07-05 11:05:00 +0200 TpAccountChannelRequest: add org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler support (#38249) commit 32ff32749f913893c4708d0e1ea1805ee7565479 Author: Guillaume Desmottes Date: 2011-06-24 14:00:21 +0200 add tp_account_channel_request_set_delegate_to_preferred_handler() commit 96023b36b2f1872cecef1d7660b502837e9e4338 Author: Guillaume Desmottes Date: 2011-06-24 12:51:37 +0200 TpBaseClient: add org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler support (#38249) commit 7fa15556deb41298e9f6353fce5b1870658a285c Author: Guillaume Desmottes Date: 2011-06-24 10:27:48 +0200 simple-channel-request: export tp_tests_simple_channel_request_dup_immutable_props() commit b39713ce49bf3411b6557a7636e6fc2e4cd46024 Author: Will Thompson Date: 2011-07-07 17:54:04 +0100 BaseConnection: remove repeated includes of debug-internal This used to be done to change the debug flag used for handle-reference-related code. But because handles are immortal now, these functions have no DEBUG() statements at all. commit 3e2df72ead78c9f96beb0cefb77e766733a390f1 Author: Will Thompson Date: 2011-07-07 17:45:31 +0100 Make DEBUG a no-op static inline with --disable-debug. commit 22db42544e3390e3685956c07d5c1ed15309141d Author: Debarshi Ray Date: 2011-07-07 16:18:27 +0100 Update the release mail automation script to contain the Git URL [This is 02ad9c4 in Gabble.] Signed-off-by: Will Thompson commit 35fb5624bbedf36e88c1ccf099bdc75955b2d234 Author: Guillaume Desmottes Date: 2011-07-06 14:05:22 +0200 Add tp_message_get_pending_message_id() We use to say that this wasn't needed because TpTextChannel is already doing the ID -> TpMessage lookup but at least the logger and Empathy need it so it's probably worth it. https://bugs.freedesktop.org/show_bug.cgi?id=39000 commit 90574d974be8bb932e3778c4f18b025794aa18ce Author: Guillaume Desmottes Date: 2011-07-06 12:07:57 +0200 Include the right headers to actually check if credentials-passing is supported commit 8b8342a988002fdf5b859304d6dc42a4a01dc328 Author: Emilio Pozuelo Monfort Date: 2011-07-06 08:34:39 +0100 Remove trailing space Fixes make check. commit 9bdfecb9e1ade99d1b86aedea87f6782ecfde283 Author: Emilio Pozuelo Monfort Date: 2011-07-05 18:13:23 +0100 Properly convert the GType with GSIZE_TO_POINTER This caused the test to fail on IA64. https://bugs.freedesktop.org/show_bug.cgi?id=38980 commit f4c4b8ff207ab06953e0c37436fe074944e98149 Author: Siraj Razick Date: 2011-07-04 21:22:25 +0530 fixes : bug#38944 - memory leak in telepathy-glib/connection.c self->priv->cm_name and self->priv->proto_name is not freed after use, this results in a memory leak commit 9906b70777d65c62986f74404bb930656366106d Merge: f095d5816 f085405fe Author: Simon McVittie Date: 2011-07-01 10:16:32 +0100 Merge branch 'telepathy-glib-0.14' commit f085405fe27465a2150d2171d89c03b3fd9f501b Author: Simon McVittie Date: 2011-07-01 00:26:15 +0100 Skip stream tube credentials-passing tests where unsupported Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36801 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623587 Reviewed-by: Guillaume Desmottes commit f095d5816d68c2510b11e80cea56e02ee180bc2d Author: Will Thompson Date: 2011-06-29 14:17:52 +0100 ChannelRequest test: cast 64-bit int in varargs. Without any additional type information, integer literals in varargs get passed as pointer-sized things (IIRC). So on 32-bit this is wrong and crashes. Reviewed-by: Nicolas Dufresne commit 9a787ec08f9663be60b6ed74fc805e62e521533b Author: Guillaume Desmottes Date: 2011-06-29 14:31:17 +0200 annotate tp_channe_group_ methods commit 606b8413c766a0f2c216df3d5a5030b905979906 Author: Will Thompson Date: 2011-06-29 11:01:54 +0100 DebugSender: wrap a long line. commit 1d109553c612497279f1fdfae7db24435bab02ba Author: Will Thompson Date: 2011-06-29 11:00:51 +0100 DebugSender: avoid calling g_get_current_time() twice. commit 4f07a1d165861a9ef8a81674505b3707d0f5b14f Author: Will Thompson Date: 2011-06-29 11:00:04 +0100 DebugSender: fix a reference to _set_timestamps() commit f67ad8165a1f03f304bb823e5161b18d3a8d9c35 Author: Jonny Lamb Date: 2011-01-10 14:00:49 +0000 debug-sender: add tp_debug_sender_set_timestamps Fixes: fd.o#26516 Signed-off-by: Jonny Lamb commit 285aa26d6c222c9d91f8cc770cd4bfdab5854bab Author: Colin Walters Date: 2011-06-24 11:07:55 -0400 Honor NOCONFIGURE for compatibility with gnome-autogen.sh See also: http://people.gnome.org/~walters/docs/build-api.txt commit 750c00f6f54d6219a462953cfe4cfc0a6795993b Merge: 11b5f30b5 a49f10492 Author: Will Thompson Date: 2011-06-24 19:34:09 +0100 Merge branch 'master' of git://anongit.freedesktop.org/telepathy/telepathy-glib commit a49f10492aa82e6dcdbafb03ce0ff399c5f845c7 Author: Guillaume Desmottes Date: 2011-06-23 16:09:08 +0200 TpChannelRequest: add properties and accessors for Account, UserActionTime and PreferredHandler (#38605) I didn't add Requests as it's less useful and I'm not sure we want to expose more string -> GVariant hash table in the API. commit 11b5f30b598b90bf4d1e97258974af82509dfa58 Author: Will Thompson Date: 2011-06-23 11:58:54 +0100 Fix set-but-not-used warnings with --disable-debug Reviewed-by: Guillaume Desmottes commit 6152cfdcbd35509c5207ef337acca2f47a807c5b Author: Adam Conrad Date: 2011-06-22 16:16:04 -0600 Jack the timeout of the dbus/contact-lists test, so it no longer fails on slow architectures like arm and mips. commit 572979b5a00a8b01b0290716133233d70ca7b6f7 Author: Guillaume Desmottes Date: 2011-06-22 12:33:44 +0200 add tp_text_channel_ack_all_pending_messages_async() (#38559) commit 0bfaa156755fbea6630a8c5e37b3d6b73c6c4452 Author: Guillaume Desmottes Date: 2011-06-22 09:42:39 +0200 TpTextChannel: document that TpSignalledMessage are cached commit 743004dce43794c746f0a8494b7f63d31743d3c7 Author: Guillaume Desmottes Date: 2011-06-21 17:10:11 +0200 set nano flag commit af36f7b4f00996c95596dd26daecd4ae591ad3c2 Author: Guillaume Desmottes Date: 2011-06-21 16:53:49 +0200 prepare 0.15.2 commit 78083d60a23441715841503dd2595a33f6bb1efc Merge: 820f8650b 23ce54c34 Author: Guillaume Desmottes Date: 2011-06-21 16:37:23 +0200 Merge branch 'telepathy-glib-0.14' into release Conflicts: NEWS configure.ac commit 23ce54c347cc8c99e70a6ef2938a84de1a5a97ee Author: Guillaume Desmottes Date: 2011-06-21 16:32:57 +0200 set nano flag commit bff9e130d0f365c61f125424263981cf12f6b779 Author: Guillaume Desmottes Date: 2011-06-21 16:19:01 +0200 prepare 0.14.8 commit 820f8650b7cb8c2b0c74d3e922ff62ea3bb0a5f8 Merge: 66db4d7e0 d50e2a51e Author: Guillaume Desmottes Date: 2011-06-21 16:10:05 +0200 Merge branch 'telepathy-glib-0.14' commit d50e2a51e92c2f3c37f7c30d7351c4651da350f9 Author: Guillaume Desmottes Date: 2011-06-21 15:39:43 +0200 channel-iface: set TP_UNKNOWN_HANDLE_TYPE as default handle type TP_HANDLE_TYPE_NONE is not a good default, if we don't know the handle type we shouln't try to guess it. This also confuses TpChannel which think we are setting a valid handle type; see fdo#38524. commit 66db4d7e070b6e34072ffdf5d112dd23b458c693 Merge: e4b624d25 32af717f8 Author: Will Thompson Date: 2011-06-17 17:08:24 +0100 Merge branch 'debug-spam' Reviewed-by: Jonny Lamb commit e4b624d25d7aedb89be4d717ca0ff61721bcde68 Author: Guillaume Desmottes Date: 2011-06-17 12:18:21 +0100 stream-tube-channel.c: add some comments explaining how we use client sockets commit ad423a616f2b1600cc406366638290b6357e3975 Author: Xavier Claessens Date: 2011-06-15 22:38:23 +0200 Add missing files to introspection commit 2e4ee37892fd271f5d6cea0157bfdbe1e5724e92 Author: Danielle Madeley Date: 2011-06-09 15:37:01 +1000 Test tp_cm_message_take_message() commit 876e49a961c23ee28dac9ccd0bf164ade08d9158 Author: Danielle Madeley Date: 2011-06-09 15:24:03 +1000 Add tests for tp_cm_message_set_message() The first test destroys the delivery-echo message early. The second test changes the delivery-echo. commit ef1ae465aeb17a28f9348c88302ca136c92a4179 Author: Danielle Madeley Date: 2011-06-09 15:21:16 +1000 Copy the message more deeply so it may be unreffed or changed Create a new array and maps and keys but 'dup' the values. This should be safe because people should be using tp_message_set_* which replaces the GValue, rather than fiddling with its contents. commit 563c7de5b47b837690fa5deee3507d3ec0d6888a Author: Danielle Madeley Date: 2011-06-09 10:17:18 +1000 Warn if there is not at least one part commit a6d52df4a22c71093354ef2522d6a5c3ab6392f0 Author: Danielle Madeley Date: 2011-06-08 14:49:53 +1000 Add a new method tp_cm_message_set_message() Compliments tp_cm_message_take_message(). Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38061 commit 3a1e587720b6b37eb43fa332d5c8376a1dafb206 Author: Danielle Madeley Date: 2011-06-08 14:09:51 +1000 Ensure there is at least 1 part in the delivery-echo commit d6bf0589bfc84fcef1be61b3f7ef1dbb836adc6f Author: Danielle Madeley Date: 2011-06-08 14:09:07 +1000 Fix off-by-one error Header is part 0, not part 1 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=38060 commit ae747652aefbbc5169870af41ab6929244001a55 Author: Guillaume Desmottes Date: 2011-05-25 14:04:33 +0200 automatic-proxy-factory: prepare TP_CHANNEL_FEATURE_PASSWORD commit fee9c4dc6ba76fe55c9a75369fab46df41321e36 Author: Guillaume Desmottes Date: 2011-05-25 12:01:47 +0200 TpChannel: add high-level API for Password (#37360) commit 331e4c192fc1dbd1cbbc03f98b30b878ef332b34 Author: Guillaume Desmottes Date: 2011-05-25 14:02:11 +0200 textchan-group: implement Password commit 87c5fb649bec9df2f96f30a3cb56d6dcf5685f7d Author: Guillaume Desmottes Date: 2011-05-30 14:53:33 +0200 simplify channel_remove_self_cb commit 985d78ca9d0eb3947fd35269e6a55e0fecf57526 Author: Guillaume Desmottes Date: 2011-05-30 14:49:58 +0200 simplify channel_destroy_cb commit 0866c7eb7b580086cae52618abf8dd16b502e55c Author: Guillaume Desmottes Date: 2011-05-30 14:06:27 +0200 add tp_channel_dispatch_operation_destroy_channels_async() (fdo #28015) commit 37a46435c1e3fb934c11f681f6a50178ffd61d00 Author: Guillaume Desmottes Date: 2011-05-30 13:55:47 +0200 add tp_channel_destroy_async() commit db9d23c30197248ef00320e9427493f7f0a02f83 Author: Guillaume Desmottes Date: 2011-05-27 17:29:01 +0200 add tp_channel_dispatch_operation_leave_channels_async (#28015) commit 837dafccc57660143bd6ecf780faa7772b174340 Author: Guillaume Desmottes Date: 2011-05-30 11:54:17 +0200 set nano flag commit 108d88b0c472b05a5425b49cab6c7d024010b5d8 Author: Guillaume Desmottes Date: 2011-05-30 11:19:33 +0200 prepare 0.15.1 commit f28bf8d7fc1509d472941f0a1a13e3a28d513b1a Merge: 34c993a9f 4bde00853 Author: Guillaume Desmottes Date: 2011-05-30 11:41:34 +0200 Merge branch 'telepathy-glib-0.14' into release Conflicts: NEWS configure.ac commit 4bde00853bbd0089732c10eeb421a66c00740f57 Author: Guillaume Desmottes Date: 2011-05-30 11:13:43 +0200 set nano flag commit 43252ac59189b274b0ae9737339bfa8eff5bab24 Author: Guillaume Desmottes Date: 2011-05-30 10:03:10 +0200 prepare 0.14.7 commit 34c993a9f017af003eed4560336628b6b0b84669 Author: Guillaume Desmottes Date: 2011-05-24 11:09:22 +0200 automatic-proxy-factory: prepare TP_TEXT_CHANNEL_FEATURE_SMS commit 26d3b35a857e7a5d6451075f61be68a9c752d466 Author: Guillaume Desmottes Date: 2011-05-20 11:55:44 +0200 add tp_text_channel_get_sms_length_async() commit 850bb30a7fb660f6c30f80d89a53b01d555f86be Author: Guillaume Desmottes Date: 2011-05-20 11:55:29 +0200 ExampleEcho2Channel: add a simple implementation of SMS.GetSMSLength() commit 0f205be359d813369defe3f0d72022657b90fdf1 Author: Guillaume Desmottes Date: 2011-05-20 10:34:12 +0200 TpTextChannel: add TP_TEXT_CHANNEL_FEATURE_SMS (#37358) commit 088ab9f68b221949c3142612f32b53e4c9870aa2 Author: Guillaume Desmottes Date: 2011-05-20 10:31:48 +0200 ExampleEcho2Channel: implement SMS interface commit 6a34a59d39e7c18c343b19f212b576d7ef2dd8bb Merge: 396d10c4d 62aac19d9 Author: Guillaume Desmottes Date: 2011-05-30 09:39:16 +0200 Merge branch 'balance-feature-36334' commit 62aac19d9b3b3cf5c56d39cb14c3b98361cb31ea Author: Guillaume Desmottes Date: 2011-05-30 09:36:42 +0200 fix typo in doc commit 559a47923ed41c46af44dc37e000a2098fd7114a Author: Guillaume Desmottes Date: 2011-05-27 14:05:22 +0200 add TpConnection::balance-changed signal commit 5d1e25cfb2268c210dc698a6ff2ba7204be9f459 Author: Guillaume Desmottes Date: 2011-05-27 13:22:26 +0200 tp_connection_get_balance_cb: complete the operation if we failed to get Balance commit 396d10c4d48f9b36822ec4a34f104473d7e013c7 Merge: 4054e4d9d ded16605f Author: Guillaume Desmottes Date: 2011-05-27 13:05:27 +0200 Merge branch 'cdo-reject-28015' commit ded16605feb6f6bc70b57e9cf8a9674b1176cba3 Author: Guillaume Desmottes Date: 2011-05-26 12:26:37 +0200 factor out prepare_core_and_claim_ctx_failed() commit f88dfe4f53cd448a99dd47995d063eeee0ffbcb1 Author: Guillaume Desmottes Date: 2011-04-25 15:45:56 +0200 Add tp_channel_dispatch_operation_close_channels_async() (#28015) commit 4054e4d9d2d0c325f9a9ba545f3d58545d9a97ff Author: Will Thompson Date: 2011-03-10 12:02:12 +0000 Improve the “CM already running” error message. Reviewed-by: Vivek Dasmohapatra commit 9200886c1bcb440d5df5a865ab50b6cf82831d2e Author: Guillaume Desmottes Date: 2011-05-24 12:21:23 +0200 factor out prepare_core_and_claim() commit 397074a398c15b7e81c92f19bc713e0ded04f3df Merge: 5164836f3 ad7291aa8 Author: Guillaume Desmottes Date: 2011-05-26 09:45:38 +0200 Merge branch 'telepathy-glib-0.14' commit 5164836f39aca43f0d8cd095e974a2e59ac5f364 Merge: 2ba2d147f fc6181e6a Author: Will Thompson Date: 2011-05-25 14:27:08 +0100 Merge branch 'blocking' Fixes: Reviewed-by: Danielle Madeley commit 4e2c15eecd98556fb451e46f9f5ede28b6d14f8f Author: Emilio Pozuelo Monfort Date: 2011-05-17 17:57:11 +0100 Update balance feature preparation for recent changes commit ad7291aa804fcfc88d065955c89574d2921bf85d Author: Guillaume Desmottes Date: 2011-05-19 14:38:00 +0200 tp_text_channel_set_chat_state_finish: check the right source tag commit dcbd9af2c8250de294f537c3d055b13970b59caa Author: Jonny Lamb Date: 2011-05-18 11:15:07 +0100 connection: set the self handle to something sane instead of leaving uninitialized Signed-off-by: Jonny Lamb commit 2ba2d147f8f2cb6b9dd2b1dba6b16fa818b7a3b3 Author: Jonny Lamb Date: 2011-05-18 11:15:07 +0100 connection: set the self handle to something sane instead of leaving uninitialized Signed-off-by: Jonny Lamb commit 58b17e55e3d941aad673d4402141a5c5aebfb1b4 Merge: c2f9bae72 bbe027c08 Author: Emilio Pozuelo Monfort Date: 2011-05-17 16:50:32 +0100 Merge remote-tracking branch 'danni/balance-feature-36334' into balance-feature-36334 Conflicts: telepathy-glib/connection-internal.h commit c2f9bae72b15b82cdb8bad0f20bc12c09d93b6e4 Author: Guillaume Desmottes Date: 2011-05-17 12:34:25 +0200 Fix race in tp_channel_dispatch_operation_claim_with_async() Claiming the CDO will result in MC destroying it, so we have to prepare it before calling Claim(). (fdo #37280) commit d04f1003cf6eae545e924b736bdaa049893633d3 Author: Guillaume Desmottes Date: 2011-05-17 12:32:12 +0200 simple-channel-dispatch-operation: fire Finished when Claim is called commit 06ffab287704a5f78cb10b2ed2b207fc47e81724 Author: Guillaume Desmottes Date: 2011-05-17 11:03:41 +0200 bump nano version commit 8b189089cf796e3466b212c8e16f6ec66f20c3b9 Author: Guillaume Desmottes Date: 2011-05-17 09:02:55 +0200 prepare 0.15.0 commit 7f64bc9ef6dce174f258da8cb106228d11e7d16c Merge: f1e9435ad 7c60cb824 Author: Guillaume Desmottes Date: 2011-05-17 08:51:19 +0200 Merge branch 'telepathy-glib-0.14' commit 7c60cb8249f5eb975969d09c4ec23f4afb69e309 Author: Guillaume Desmottes Date: 2011-05-16 12:36:06 +0200 set nano version commit fc6181e6a0643142c14fc72289eeca67cea244a3 Author: Will Thompson Date: 2011-05-16 11:16:05 +0100 BaseContactList: extensiblize blocking cap flags commit 3b4ce2481e7f033294ec1867b079e98ff584eb6d Author: Will Thompson Date: 2011-05-16 10:59:18 +0100 BaseContactList: assert that just one block_contacts is implemented Danni suggested in fd.o#35331: “XOR perhaps?”. A fine suggestion. Of course C doesn't have a logical XOR, but bitwise XOR should work in this context. commit 532c4879df011d8d8f29b71d668867a893f24a5d Author: Will Thompson Date: 2011-05-16 10:56:53 +0100 BaseContactList: remove useless comment about line lengths commit 63fa8772264e46f20c1d680cbaf7aa69ca611347 Author: Guillaume Desmottes Date: 2011-05-16 11:39:03 +0200 prepare 0.14.6 commit f1e9435ad656137507a624f065439c349fcb200c Author: Guillaume Desmottes Date: 2011-05-16 09:21:49 +0200 fix typos in doc commit d32d1334148c31f133968d1b1979fd29f8fec2a6 Author: Guillaume Desmottes Date: 2011-05-13 12:24:08 +0200 test DelegateChannels() refusing to delegate commit 0d7638c507a58911a29e45d7830326bf60aa55d9 Author: Guillaume Desmottes Date: 2011-05-13 12:01:36 +0200 Use new DelegateChannels() API commit 051440da4248dfcf378b9e37fffa13bb06db7a38 Author: Guillaume Desmottes Date: 2011-04-25 13:16:17 +0200 introspection.am: add channel-dispatcher commit 02b7e46a24771917b739f96a60e347b31a101ac4 Author: Guillaume Desmottes Date: 2011-04-22 14:48:35 +0200 add tp_channel_dispatcher_present_channel_{async,finish} commit 59b10772153ec4cef86131193c1c5342b674b0ae Author: Guillaume Desmottes Date: 2011-04-22 14:27:15 +0200 add tp_base_client_delegate_channels_{async,finish} (fdo #34610) commit 235742058d624f9b90507bb47ce53a9c0ec17cda Author: Guillaume Desmottes Date: 2011-05-16 10:50:30 +0200 Update to spec 0.23.2 Add: - TP_HASH_TYPE_NOT_DELEGATED_MAP - TP_STRUCT_TYPE_NOT_DELEGATED_ERROR - tp_type_dbus_hash_o_28ss_29 commit fd989060b2bfb80b29a2245ee5dc122a9b130841 Merge: 2174e7733 e44f08c22 Author: Simon McVittie Date: 2011-05-16 09:54:19 +0100 Merge branch 'telepathy-glib-0.14' commit e44f08c22e15bad0ec0448876582777cd1ae28b6 Merge: 42360d0d2 3a3ee21b2 Author: Simon McVittie Date: 2011-05-16 09:54:12 +0100 Merge remote-tracking branch 'upstream/telepathy-glib-0.14' into telepathy-glib-0.14 commit 2174e77334ff2cdd82d45e85abf157a2db3314c8 Merge: 28d3db1f6 42360d0d2 Author: Simon McVittie Date: 2011-05-16 09:48:03 +0100 Merge branch 'telepathy-glib-0.14' commit 42360d0d279037ca3e3c1bc9f5c8692ff3252da9 Author: Simon McVittie Date: 2011-05-10 19:09:49 +0100 tp_base_connection_change_status: delay side-effects until all preconditions are checked If the caller makes an invalid state change, we shouldn't allow the status to be updated, for instance from DISCONNECTED to CONNECTED if success and failure race with each other and failure wins, as seen in fd.o #37078; we should just emit the critical warning and leave it DISCONNECTED. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37079 Reviewed-by: Vivek Dasmohapatra commit 28d3db1f6ef2481ddeb40bb3b141b3f68070a1dc Author: Guillaume Desmottes Date: 2011-04-27 14:14:44 +0200 Move TpProxyFeature as public API (#31583) commit 55b12c5bf85c2cbee872f9ab39568843336826f9 Author: Guillaume Desmottes Date: 2011-04-26 09:51:54 +0200 pass free_parts_list as GDestroyNotify when requesting contacts commit f0c3266b454a558e9bae86c3c360d5c64777583b Author: Guillaume Desmottes Date: 2011-04-26 09:46:30 +0200 get_pending_messages_cb: cast from the TpProxy That's equivalent as the weak object is the same pointer but a bit clearer. commit 665ba3f8d0f24621d795234e82dc3f1432c95b0f Author: Guillaume Desmottes Date: 2011-01-27 14:49:03 +0100 use tp_tests_init() in most tests commit fa8649935b8ba5c62fda3dd30209a15c5d5c67d5 Author: Guillaume Desmottes Date: 2011-01-27 14:33:14 +0100 test-proxy-preparation: use tp_tests_init() commit b9dcc1eca8a124d5991bafa434950cc0938df694 Author: Guillaume Desmottes Date: 2011-01-27 14:32:51 +0100 tests/lib/util: add tp_tests_init commit bcf76973898c6bfc180067fc5beb814d9289172a Author: Guillaume Desmottes Date: 2011-01-27 14:24:39 +0100 rename check_feature_validity to assert_feature_validity commit 045f4e1e8e3b951b8ecb1e251a0aa91471e47ef0 Author: Guillaume Desmottes Date: 2011-01-27 14:20:49 +0100 improve comment commit 7532018ef16b109e99788a5f84d378391b97779e Author: Guillaume Desmottes Date: 2011-01-27 14:15:44 +0100 use a GQueue to store prepare_requests commit 3ba83349560266d687058d65f1d893e64d4e977a Author: Guillaume Desmottes Date: 2011-01-27 13:46:25 +0100 factor out finish_all_requests commit 3ff1c1b29f2bfe41399cf3a3d84c83da9f53e95a Author: Guillaume Desmottes Date: 2011-01-27 12:53:15 +0100 identation fix commit ec509cef2513e88c6dd039c4e4088a5194e6408d Author: Guillaume Desmottes Date: 2011-01-27 12:51:46 +0100 Update copyright of new files commit 9ecc526bfc528fef5fdafdeb81ea53d232b0effd Author: Guillaume Desmottes Date: 2011-01-27 12:49:07 +0100 test_prepare_capabilities: improve description commit 447d7d95e37617e7d75499ea585dbefdd0689f43 Author: Guillaume Desmottes Date: 2011-01-27 12:12:20 +0100 list_features: no need to check if the dep array has already be init There is already a check at the beginning of the function preventing that. commit 7e7616d3a8914670b3ba19ca608199a8848ed7c7 Author: Guillaume Desmottes Date: 2011-01-27 11:58:06 +0100 fix some phrasing commit 49e810fd4e85a3b652bd3cf75d8bb195052b739f Author: Guillaume Desmottes Date: 2011-01-27 11:55:29 +0100 coding style fix commit 6fe82938b9cabf4b0a6271231e97e8e7ada7d8c5 Author: Guillaume Desmottes Date: 2011-01-27 11:45:50 +0100 stop using IdentifyMessagesCtx commit 515abe51c6248a0a862be1b5073d3a6975d58e9b Author: Guillaume Desmottes Date: 2011-01-18 15:12:04 +0100 test prepare_before_signalling_connected_async commit e3761c4c807b66b8e9a4408f51c81fd4fd4a8248 Author: Guillaume Desmottes Date: 2011-01-18 15:09:14 +0100 Add TpProxyFeature.prepare_before_signalling_connected_async It allows a prepared feature to be notified to update itself before announcing that the connection is now CONNECTED. commit 7b1fdf9783ffb9e6527c48257de56edc62c2dbcc Author: Guillaume Desmottes Date: 2011-01-18 13:59:52 +0100 connection: factor out signal_connected commit d59a3d1e54b1b23ce6666009565bf0426e46ecad Author: Guillaume Desmottes Date: 2011-01-18 13:45:01 +0100 core features can't have explicit depends This avoid cyclic references and weird corner cases. commit 15d953c08e40baa252e31b07d5c61565c841a3e3 Author: Guillaume Desmottes Date: 2011-01-17 16:35:48 +0100 retry preparing failed dep, if possible commit 3d9c255172a9641fd7df32a71fbeeac0642ee08d Author: Guillaume Desmottes Date: 2011-01-17 15:41:06 +0100 add TpProxyFeature.can_retry commit a24526a08c468cac853d26615cf66fed3137ccc2 Author: Guillaume Desmottes Date: 2011-01-17 15:02:13 +0100 prepare core features of subclass before core of super classes commit 343e602c8ad7d9550265b4793f63cc2427c8419a Author: Guillaume Desmottes Date: 2011-01-17 14:19:54 +0100 split prepare_core into one TpProxyPrepareRequest per subclass We'll need this to guarantee that super class core features are prepared before subclass ones. commit 6d7f23df8ea606f36a731de58e9591b6be079b61 Author: Guillaume Desmottes Date: 2011-01-17 11:57:10 +0100 test prearing a feature of which its dep fails commit 66d91c25f2e0484ba1e2ab575adf702a388b3607 Author: Guillaume Desmottes Date: 2011-01-17 11:53:11 +0100 test preparing a feature which fail commit d173d87dac5cd36fe3c2af9e4b16d30cf3ee1b7e Author: Guillaume Desmottes Date: 2011-01-17 11:44:15 +0100 test preparing a feature having a unpreparable dep commit d2bf687c5de58224992e9443dcdd1f9bf8ca959e Author: Guillaume Desmottes Date: 2011-01-17 11:35:39 +0100 test preparing a feature requiring a not implemented iface commit 61b3847982a901b95593a07135285a81fd3f08b8 Author: Guillaume Desmottes Date: 2011-01-17 11:28:35 +0100 test features depends commit 1cacd7cdfcaca3f909c9696f79bed58e25659926 Author: Guillaume Desmottes Date: 2011-01-17 10:51:16 +0100 my-conn-proxy: add our own core feature commit 153598481949b6f5629ff1a21a56ac765e72d43f Author: Guillaume Desmottes Date: 2011-01-17 10:40:44 +0100 Actually fall through when the core features are unwanted We want starting preparing those as they block every other features. commit 9a0e92d738850582280ce1907f0942d084ad04cd Author: Guillaume Desmottes Date: 2011-01-14 15:54:15 +0100 proxy-preparation: use TpTestsMyConnProxy commit d0ad2840a8df61ef421bf6a658cf6bf9ab508646 Author: Guillaume Desmottes Date: 2011-01-14 15:53:58 +0100 add tests/lib/my-conn-proxy commit a3cfe7ddd1bdbb577d8eeead04edcebe36d02189 Author: Guillaume Desmottes Date: 2011-01-14 15:06:11 +0100 add a new test file testing proxy preparation commit 5fb961188d8bc064827daac502790947ef254953 Author: Guillaume Desmottes Date: 2011-01-14 15:08:28 +0100 Wait that core has been prepared before checking requested interfaces If core is not prepared, tp_proxy_has_interface_by_id() will also fail. commit 45afe9a0dc77643586ced5398e04e9689d4a4431 Author: Guillaume Desmottes Date: 2011-01-14 14:15:17 +0100 remove TpProxyFeature.start_preparing() commit 64700fa2b3099cd653be8bab7c025f6e646ce927 Author: Guillaume Desmottes Date: 2011-01-14 14:08:59 +0100 connection: use prepare_async instead of start_preparing commit e59a158de74c79677918c6ca40986b3853b02e07 Author: Guillaume Desmottes Date: 2011-01-14 13:59:44 +0100 update comments refering to the old start_preparing function commit 7bf13e3a26feb6c101291dec2734983da4df0f68 Author: Guillaume Desmottes Date: 2011-01-14 13:55:56 +0100 channel-dispatch-operation: use prepare_async to prepare core commit 94ed3f27bb263f8fc41808358bc716b2bbc6124c Author: Guillaume Desmottes Date: 2011-01-14 12:02:51 +0100 account: use prepare_async to prepare features commit fb4ffcf530e80817aca49601663fe85d9c1c5cc5 Author: Guillaume Desmottes Date: 2011-01-14 11:54:56 +0100 channel: use prepare_async to prepare chat state commit 054d26f3567ecd2e293de41ee493852e75f18904 Author: Guillaume Desmottes Date: 2011-01-14 11:46:58 +0100 connection: simplify contact info preparation commit 135f442394b253bb0f54de8eed77969b60883f78 Author: Guillaume Desmottes Date: 2011-01-14 11:46:44 +0100 connection: simplify avatars requirements preparation commit 1a3cda74367984a4299ec6b53fa8085c4ff34025 Author: Guillaume Desmottes Date: 2011-01-14 11:35:31 +0100 connection: simplify capabilities preparation commit 91c9ebff07faa83ca1da8cd530fff021eee9bffb Author: Guillaume Desmottes Date: 2011-01-14 11:31:03 +0100 connection: fail preparing TP_CONNECTION_FEATURE_CAPABILITIES if Requests is not implemented Requests is mandatory since a while, and if you don't implement it you have more serious issue than not being able to prepare this feature. commit 97f81499baad0e6f5aa98d9cbadf22e18ad99437 Author: Guillaume Desmottes Date: 2011-01-14 10:58:06 +0100 channel-dispatch-operation: simplify core preparation commit d81a898ad5e4c86aa66c9b62e431c31aea017eca Author: Guillaume Desmottes Date: 2011-01-14 10:44:20 +0100 channel.c: simplify chat-states preparation commit 85097b3c3329c7c88199864b46dc78318b4e3640 Author: Guillaume Desmottes Date: 2011-01-14 10:40:29 +0100 account: simplify features preparation We don't have to call prepare function ourself any more when core is prepared (proxy.c does it for us) and they are guarantee to be called only once when we actually want the feature. commit 5c88ca886d6ca72196d28aaacc22cbefb5e8713f Author: Guillaume Desmottes Date: 2011-01-13 15:20:24 +0100 add depends support to feature commit eedf8926cdea63bb5adbb2d1cbba613fd86ab4ab Author: Guillaume Desmottes Date: 2011-01-13 14:23:11 +0100 factor out request_is_complete() commit 96c639f712ef219f153f03589c573ebd8a865edc Author: Guillaume Desmottes Date: 2011-01-13 12:49:20 +0100 channel: rely on TpProxyFeature.interfaces_needed commit 164d6962c5906afb67716e0c1874bbb2cab949c4 Author: Guillaume Desmottes Date: 2011-01-13 12:48:38 +0100 TpProxyFeature: add interfaces_needed commit bd04c89e24d573974c8f05c05f3a9c6cb6805725 Author: Guillaume Desmottes Date: 2011-01-13 11:49:43 +0100 TpTextChanne: implement prepare_async instead of start_preparing commit e76a18cff9e4ccec7d871486b0d20e59560b606f Author: Guillaume Desmottes Date: 2011-01-13 11:46:18 +0100 Add an async variant of start_preparing commit 39807f88f0ee729f2dcdf75ba2b73538f4e4b77b Author: Guillaume Desmottes Date: 2011-01-12 16:55:16 +0100 start preparing features in tp_proxy_poll_features() We don't want to start prepare features right away but when all the requierements are done. This include core features, so now we don't call prepare functions until core features have been prepared. commit d57ca9080ead62971e2e2bd2c1773513a90590c7 Author: Simon McVittie Date: 2010-12-16 14:39:54 +0000 tp_proxy_poll_features: move checking for invalidation inside the loop We call out to user code from the loop, which could conceivably invalidate us. Also hold a ref for the duration of the loop, for the same reason. commit 1bd8a2089379afd6e94ccb1c87ec171e4460dcf7 Author: Simon McVittie Date: 2010-12-16 14:28:42 +0000 Split FEATURE_STATE_WANTED from FEATURE_STATE_TRYING For now, we go straight to calling the callback, i.e. TRYING. commit 84258d7cc4830f7f06fd7f19bb7ba2bb6b5371aa Author: Simon McVittie Date: 2010-12-16 14:26:30 +0000 FeatureState: comment the values commit 16c722c412d247f83ab454f0dec4f548c9e06897 Author: Simon McVittie Date: 2010-12-15 18:51:38 +0000 tp_proxy_prepare_async: don't start anything if we were already invalidated commit 04e01bc35eff152032b683ab1d98985a6ae43a75 Author: Guillaume Desmottes Date: 2010-11-16 16:14:15 +0100 TpProxyFeature: use a proper private struct commit bbe027c08ce35a2c222660f9624dac78978230f3 Author: Danielle Madeley Date: 2011-05-12 15:51:38 +1000 Tests for Conn.I.Balance commit 76edd2b8014a9955fd10edc9239982c02cd39003 Author: Danielle Madeley Date: 2011-05-12 15:51:01 +1000 Add support for retrieving Conn.I.Balance commit f580804514058fd0d9044b5536696b26c5922841 Merge: 03e7c0039 3a3ee21b2 Author: Will Thompson Date: 2011-05-11 18:27:58 +0100 Merge branch 'telepathy-glib-0.14' commit 3a3ee21b251b121ce9e0c5159f27e13902cc3500 Author: Will Thompson Date: 2011-05-11 17:49:05 +0100 GroupMixin test: use tp_asv_get_boxed() for contact-ids Reviewed-by: Simon McVittie commit 05d530838985bc75a72719995fda748bb6c488b9 Author: Will Thompson Date: 2011-05-11 17:43:36 +0100 GroupMixin: also update variable names to contact_ids Unlike the previous patch, this introduces no functional changes. Reviewed-by: Simon McVittie commit 6c13365154f6c9017489c1e8c7161294d2e62cfd Author: Will Thompson Date: 2011-05-11 16:32:40 +0100 GroupMixin: correctly use contact-ids, not member-ids For the past two-ish years telepathy-glib has included a key named 'member-ids' in the MembersChangedDetailed details dictionary. This is wrong: the spec says it should be called contact-ids. Whoops. I've checked Empathy, telepathy-logger, tp-glib and tp-qt4, and none of them rely on the incorrect name. So … I think we're safe to just change it. Fixes: Reviewed-by: Simon McVittie commit 03e7c0039f509a20e82561eb8c6d3793611f3d0e Author: Guillaume Desmottes Date: 2011-05-10 09:39:17 +0200 test-base-client: wait for exactly the right number of callbacks to be called commit 2cd4f6f620f84d17acafa853eaa9f577b0895869 Author: Guillaume Desmottes Date: 2011-05-04 13:49:14 +0200 deprecate tp_channel_dispatch_operation_claim_async() commit 96efda8744108e7a1b2ab852df5bc7fad4dd4560 Author: Guillaume Desmottes Date: 2011-05-04 13:40:26 +0200 examples/client/approver.c: use tp_channel_dispatch_operation_claim_with_async() commit cbaeea3ab904fe8ff8cde5b2d13d23f4d790b21b Author: Guillaume Desmottes Date: 2011-05-04 13:36:39 +0200 fix doc of tp_channel_dispatch_operation_claim_async() commit cbb09c486f10bad1807b23259950b1978e3c7116 Author: Guillaume Desmottes Date: 2011-05-04 11:35:01 +0200 add tp_channel_dispatch_operation_claim_with_async() (fdo #36490) commit 61ca4253bf27ea5c448149064bf2bda775d6e326 Author: Guillaume Desmottes Date: 2011-05-03 11:49:55 +0200 Depends on Glib 2.28.0 This offers us new exciting API such as g_simple_async_result_take_error(). commit 9354c13814bb18f1a7b414360310d196a0cbbfc7 Author: Guillaume Desmottes Date: 2011-05-09 15:18:40 +0200 update to spec 0.23.1 Generate API for: - Channel.Interface.SMS.GetSMSLength() - ChannelDispatcher.DelegateChannels() - ChannelDispatcher.PresentChannel() commit 3d327b76fc2c1bf2b1553dc295a8c77ee900250d Merge: 97f9f0576 411467f1f Author: Will Thompson Date: 2011-05-05 19:10:46 +0100 Merge branch 'telepathy-glib-0.14' commit 411467f1f613ee5ba034694150fdd6310a45cdb0 Author: Will Thompson Date: 2011-05-05 17:56:28 +0100 configure: squash ‘AC_LANG_SOURCE call detected’ warning. Since I upgraded my toolchain, autogen has started complaining: configure.ac:109: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body ../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from... ../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... ../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... m4/tp-linker-flag.m4:18: TP_LINKER_FLAG is expanded from... m4/tp-linker-flag.m4:41: TP_ADD_LINKER_FLAG is expanded from... configure.ac:109: the top level Reading suggests that AC_LANG_PROGRAM() is implemented in terms of AC_LANG_SOURCE() and so should work fine in this context, but it doesn't seem to. In any case, since the program is empty we can just use the single-argument form and squash the warning. commit 97f9f0576723448364ddd959f3fdc76affe6ca7f Merge: fefef1e47 0d7199c22 Author: Mike Ruprecht Date: 2011-05-04 22:40:34 -0500 Merge branch 'telepathy-glib-0.14' commit 0d7199c228146e310ac498a748565f9275ef5fdd Author: Mike Ruprecht Date: 2011-05-04 20:51:51 -0500 Fix leak of source object. g_async_result_get_source_object() refs the source object upon return. It was not being unreffed before. Also, g_simple_async_result_is_valid() ignores the source tag if NULL is passed. This patch simplifies things by calling g_simple_async_result_is_valid() with a NULL source tag, which in effect fixes the leak of the source object as well. commit fefef1e473f3ca188beb631458dd7a724d785b51 Merge: 084226e7a 134634a73 Author: Vivek Dasmohapatra Date: 2011-05-04 14:07:42 +0100 Merge branch 'telepathy-glib-0.14' commit 134634a73707d1a6926986cb1f266a4c6ab0de90 Author: Vivek Dasmohapatra Date: 2011-05-04 13:55:55 +0100 Update NEWS commit 259531bd7e1b34a0daef66b1756ec0e69f1f64be Author: Vivek Dasmohapatra Date: 2011-05-04 13:48:05 +0100 tp_dbus_daemon_watch_name_owner & ..._list_names_common leak a DBusMessage dbus_connection_send_with_reply does not take ownership so we must unref commit 084226e7a4d7f6813febba2b4a75f559619beda0 Merge: c0b13f7cc cbccc2ebb Author: Will Thompson Date: 2011-05-02 14:27:49 +0100 Merge branch 'telepathy-glib-0.14' commit cbccc2ebba1236f1721065f2f2dd80020a37663a Author: Will Thompson Date: 2011-04-22 15:41:03 +0100 BaseContactList: clarify how to use it Reviewed-by: Jonny Lamb commit c0b13f7ccc26e78cd81dfbba6bfe20d806ef9cc7 Author: Jonny Lamb Date: 2011-01-06 10:41:02 +0000 glib-client-gen.py: try to add the enum type when documenting guint args Signed-off-by: Jonny Lamb commit 5df746489af48d364defcf03bc57a980f1d65964 Merge: d2055e41e c7c94590c Author: Will Thompson Date: 2011-04-28 11:54:31 +0100 Merge branch '0.14' commit c7c94590c280679a385e70654876b0a0cf5e1b46 Merge: bc3aac03d ca6e114be Author: Will Thompson Date: 2011-04-28 11:52:25 +0100 Merge branch 'base-connection-disconnect' into 0.14 Reviewed-by: Jonny Lamb Fixes: Date: 2011-04-27 16:27:47 +0100 extra-gtkdoc: include notes about ContactBlocking interface Signed-off-by: Jonny Lamb commit d2055e41e90e41ee591dd07b610f6ef07d5883de Author: Jonny Lamb Date: 2011-04-27 16:27:47 +0100 extra-gtkdoc: include notes about ContactBlocking interface Signed-off-by: Jonny Lamb commit 32af717f8baa617d7deeb7606cb7301949782ac7 Author: Will Thompson Date: 2011-04-21 17:49:01 +0100 BaseConnection: reduce debug spam. I don't think any of these have ever been of use to me. Including the address of the object in the debug output once seems fine. This shaves another 3% off the Gabble test suite debug output. commit 2aeaa8fe2dbc967063bcbb6a12535872a49d5fc1 Author: Will Thompson Date: 2011-04-21 17:17:30 +0100 BaseProtocol: don't debug for unspecified parameters If MC didn't specify a value for a connection parameter, then of course either the default value, or no value, will be used. This change accounts for over 4% by size of the debug output from running the Gabble test suite! commit da80d7883531f427985263f549f42d38aea385a7 Merge: 90373392b eefcf8ad0 Author: Will Thompson Date: 2011-04-21 10:03:00 +0100 Merge branch '0.14' Conflicts: configure.ac spec/Connection_Interface_Simple_Presence.xml telepathy-glib/base-client.c telepathy-glib/presence-mixin.c commit eefcf8ad035a5880688f73cdde829690e9d4afc7 Author: Will Thompson Date: 2011-04-21 10:01:47 +0100 to the left! to the right! do the nano-version bump! commit 2dcd8f054fa8bd717da553b2455ec394c8d7cc34 Author: Will Thompson Date: 2011-04-20 19:49:01 +0100 Version 0.14.5 commit 9dc915cb9f1b0acb7666e9a563f8f0bd9d5c6ac6 Author: Will Thompson Date: 2011-04-20 18:25:18 +0100 Fully update spec to 0.22.2 commit 98646464068863f114a5c3d28e02743a10a5b40d Author: Will Thompson Date: 2011-04-20 18:12:19 +0100 Add missing docs for MaxStatusMessageLength stuff commit 22701518de0d8e4352c29d8a315d1831fa9ba60f Merge: 86e7d8905 fe09fc00f Author: Will Thompson Date: 2011-04-20 17:46:02 +0100 Merge branch 'gtk-doc-regressions' into 0.14 commit fe09fc00f7bcec24c082e36d1bdccdfebda0cd3e Author: Will Thompson Date: 2011-04-20 14:22:45 +0100 Correct tp_simple_password_manager_prompt_for_channel_async ref. commit f0b95290ea868a504b11f34dff4ca698d236f5ac Author: Will Thompson Date: 2011-04-20 13:45:42 +0100 Move instance struct definitions above classes. This works around a regression in gtk-doc which prevents the fields of these structs being picked up. Moving these three instance structs above their corresponding classes seems to do the job. The issue doesn't seem to affect other headers, and I have no idea why not. commit 34eda44d389de3804be2d29e5bb90cfead9921c8 Author: Will Thompson Date: 2011-04-20 11:28:36 +0100 Clean up tp_handle_set_foreach() gtk-doc was complaining that it didn't recognise the (closure) annotation. While it is documented to be correct on , since the function is (skip)ed anyway I don't see any particular reason to keep it around. Besides, if we call the parameter 'user_data' then GI makes the right assumption. While looking at this I noticed that the implementation inexplicably initializes its iterator closure twice. commit aecab25a163d7c6f9a5fd41c871e430857712a15 Author: Will Thompson Date: 2011-04-20 11:26:35 +0100 Annotate tp_errors_quark as deprecated. The docstring says it's deprecated; it's been that way for years; the macro that people actually use has long since expanded to tp_error_quark. This doesn't actually make gtk-doc shut up, as I hoped it would, because it doesn't pay the blindest bit of notice to G_GNUC_DEPRECATED and instead witters on about deprecation guards. Oh well. commit ef5f302e7ed74bf5e2e33928b3e99e1029885e58 Author: Will Thompson Date: 2011-04-20 11:16:01 +0100 Remove inexplicably duplicated symbols from docs commit 77958fe8c01a0fac6f32b02d0679a29d615ff4b1 Author: Will Thompson Date: 2011-04-19 18:51:31 +0100 gnio-util: correct typo in “(allown-none)” annotation commit 51fbfef221470ae0ad94bc26a1e6b016757948b2 Author: Will Thompson Date: 2011-04-19 18:51:04 +0100 Add /**/ annotations to various structs. For some reason gtk-doc 1.16 and later don't pick these fields up without this annotation. commit f2ced8f48a6901cd7f5819f153f157778ae6ca93 Author: Will Thompson Date: 2011-04-19 17:13:14 +0100 Make tp_str_empty() a static inline function directly The tp_str_empty()-is-a-macro-which-is-implemented-as-a-static-inline-function thing was a workaround for gtk-doc not supporting static inline functions. As of 1.16, it does. commit 1d78f4a9fb520ec024d0b2cb7fc9eca5babdb5ce Author: Will Thompson Date: 2011-04-19 17:06:40 +0100 tp_intset_iter_{init,reset}: demacroify Previously, tp_intset_iter_init (resp. _reset) was a macro, which was implemented using tp_intset_iter_init_inline, which was a static inline function defined in the header. This seems unnecessary, particularly for an iterator type documented to be slow and old and semi-deprecated in favour of the faster variant, which uses a regular function to init. commit 86e7d89052ef4cd7dd3b47d2f3274b2c16cca06f Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:39:32 -0300 Update Connection_Interface_Simple_Presence with spec changes. commit 58faf040432d6464bad8e90493b8c4d21eaa2822 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:16:23 -0300 Add rationale for TpPresenceMixinClass::get_maximum_status_message_length. commit 56109498391f21aa7b5841ec0291c872ff5db1f0 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:15:24 -0300 Properly add / annotations to TpPresenceMixinClass. commit a7cb0d5be213ea7a142254d96bc2ec77e1754206 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:52:12 -0300 self-presence test: Add test for Conn.SimplePresence.MaximumStatusMessageLength. commit 6ef16c438398db1e219760972a4b33f98f01150b Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:50:59 -0300 contacts-conn: Add support for Conn.SimplePresence.MaximumStatusMessageLength. commit f99d23fb33e5c82132556a1228472a98a2bb2bda Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 01:40:55 -0300 Add support for Conn.SimplePresence.MaximumStatusMessageLength. commit dd82637259edc5fc20d86d96fb192a77e55210bb Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:44:32 -0300 Updated Conn.SimplePresence to support MaximumStatusMessageLength. commit 1190edcea92ea240b16b19821b394ec5b684321f Author: Guillaume Desmottes Date: 2011-04-05 15:27:06 +0200 add tp_base_client_is_handling_channel (fdo #35990) commit 90373392bf4efe4a9be44066c0e87f396384bc96 Merge: 5b0f7afdc 37bf2be02 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-20 12:07:36 -0300 Merge branch 'presence-status-max' Reviewed-by: Will Thompson commit fa547f56057dd36ce7b39d1f3963e3bb74cfb37c Author: Will Thompson Date: 2011-04-18 11:39:54 +0100 Tests: include system $XDG_DATA_DIRS The glib-networking proxy resolver uses GSettings. GSettings looks for schemas in XDG_DATA_DIRS. GSettings gets really angry if a schema is missing: GLib-GIO-ERROR **: Settings schema 'org.gnome.system.proxy' is not installed Setting XDG_DATA_DIRS replaces the defaults, rather than adding to them. While in principle it's nice to be isolated from the system, and while it would be better to ensure we don't hit the network by having a dummy proxy resolver, I'd like to be able to run the test suite. Reviewed-by: Simon McVittie commit 37bf2be02c9153e60c6b38e7eb95b66a70f16338 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:39:32 -0300 Update Connection_Interface_Simple_Presence with spec changes. commit bcdca187cc2fc6d6ae4eb2d90d05beb5df93d686 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:16:23 -0300 Add rationale for TpPresenceMixinClass::get_maximum_status_message_length. commit bbd154b115a7c9308a311974c3106e48e7e95222 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-19 13:15:24 -0300 Properly add / annotations to TpPresenceMixinClass. commit 5b0f7afdc2be91fc22ab31261b6d136e9583b0f1 Author: Will Thompson Date: 2011-04-18 11:39:54 +0100 Tests: include system $XDG_DATA_DIRS The glib-networking proxy resolver uses GSettings. GSettings looks for schemas in XDG_DATA_DIRS. GSettings gets really angry if a schema is missing: GLib-GIO-ERROR **: Settings schema 'org.gnome.system.proxy' is not installed Setting XDG_DATA_DIRS replaces the defaults, rather than adding to them. While in principle it's nice to be isolated from the system, and while it would be better to ensure we don't hit the network by having a dummy proxy resolver, I'd like to be able to run the test suite. Reviewed-by: Simon McVittie commit 2e35fdedf33872cd7d6f40276f11d882dbd94b3a Author: Will Thompson Date: 2011-04-16 14:43:54 +0100 BaseContactList: implement ContactBlockingCapabilities Again, I've verified that it works if you implement block_contacts_with_abuse_async, but not added it to the test suite. commit 1224c304eb586895ed45dceac2eb9774cf63af04 Author: Will Thompson Date: 2011-04-16 14:15:12 +0100 BaseContactList: pass report_abusive to subclass. This is untested. I quickly hacked the test case to implement block_contacts_with_abuse_async rather than block_contacts_async and it worked. I don't really want to go through all the hassle of making the test suite test both. commit a3c9aefa9eb3d642c510a5b8dd000c727344c9b1 Author: Will Thompson Date: 2011-04-16 14:07:19 +0100 BaseContactList: add _with_abuse_async() and _finish() commit e678ed09f969ecf4b41e0c868477d9aed4dd581a Author: Will Thompson Date: 2011-04-16 13:44:32 +0100 BlockableContactListIface: add _with_abuse variant commit e466cb6f91e13f4a7382d3e80b77135ccfcba6c3 Author: Will Thompson Date: 2011-04-16 13:01:40 +0100 ContactList: implement BlockContacts and UnblockContacts For now, the Report_Abusive parameter to the former is ignored. commit 2446589f95de51ca3c8bfa69850cf3031dfd1458 Author: Will Thompson Date: 2011-04-16 12:17:17 +0100 BaseContactList: implement RequestBlockedContacts() commit 3e2b6ffce4e865cdb23de8672e5a18f2dc538c57 Author: Will Thompson Date: 2011-04-16 11:56:35 +0100 ContactList test: split up setup/teardown I want to write a test for calling RequestBlockedContacts before the connection goes online; splitting up the pre-connection and post-connection setup and teardown makes this easier. commit 5214a5763ae982e3d72110ed61faa5bc15f830ba Author: Will Thompson Date: 2011-03-15 09:48:37 +0000 BaseContactList: emit BlockedContactsChanged Just like we only emit the ContactList/ContactGroups signals if the connection the BaseContactList is attached to implements those interfaces, so here we only emit BlockedContactsChange if ContactBlocking is implemented. We do the hard work of building the hash tables anyway. I don't think this is a big cost (and we have been turning intsets into arrays and then immediately freeing them since this code was written!). The test case checks that blocking/unblocking individual contacts using the old API causes this new signal to be emitted. commit 1eae063d507e2940d7df1e5ea042590bbc732d3f Author: Will Thompson Date: 2011-03-15 09:41:36 +0000 Examples: implement Conn.I.ContactBlocking in CL example commit 192ccf185ac62f1c1f91d046d6cd59306c76c5f4 Author: Will Thompson Date: 2011-03-15 09:41:07 +0000 BaseContactList: add stub blocking_iface_init commit 6a4dcc550765a57fa643692bb551080936c7d69c Author: Will Thompson Date: 2011-03-14 11:30:10 +0000 BaseContactList: track whether ContactBlocking is implemented commit f4df23f20c4a0737f7ed98786aeef543b62f22ed Author: Will Thompson Date: 2011-03-28 23:32:25 +0100 Add tp_handle_set_to_identifier_map() This is primarily useful for implementing the signals on ContactList and ContactBlocking which use Handle_Identifier_Maps; I'm sure there are other places where this will be useful too. commit 1b8046f748bbc63668081a1e5570afda7c079bf3 Author: Olli Salli Date: 2011-04-15 13:49:57 +0300 Bump nano version to 0.14.4.1 commit 226dbf27e1ce46b92550e6401781b9bac94d9d2f Author: Olli Salli Date: 2011-04-15 13:28:07 +0300 version 0.14.4 commit b936d51d01131b84ed82d3cc0b8d2cf8bd4ff71c Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:52:12 -0300 self-presence test: Add test for Conn.SimplePresence.MaximumStatusMessageLength. commit 0ee57e5945674a24744c8c1890423cee38b2fadd Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:50:59 -0300 contacts-conn: Add support for Conn.SimplePresence.MaximumStatusMessageLength. commit 00764591b5141aa6161e232316105c61783277fe Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 01:40:55 -0300 Add support for Conn.SimplePresence.MaximumStatusMessageLength. commit 225f914f2af1ee16390310fefdead126abfe2f26 Author: Andre Moreira Magalhaes (andrunko) Date: 2011-04-14 02:44:32 -0300 Updated Conn.SimplePresence to support MaximumStatusMessageLength. commit 6fccb59746e9432e4eaface983f9f04e600f745d Merge: 10e4835c7 abfc9014b Author: Guillaume Desmottes Date: 2011-04-12 17:13:01 +0200 Merge branch 'telepathy-glib-0.14' commit abfc9014b493106bc76520faf9d54e5c9869e197 Author: Guillaume Desmottes Date: 2011-04-11 15:59:19 +0200 tp_base_protocol_get_immutable_properties: add Avatars property commit 10e4835c705fc17b875bd2262ddf154f5ab09ab1 Merge: 01ae0bca1 8f047aaaf Author: Guillaume Desmottes Date: 2011-04-12 15:55:44 +0200 Merge branch 'telepathy-glib-0.14' commit 8f047aaaf9f0d5bdadb652cbc455d683c449ded3 Author: Guillaume Desmottes Date: 2011-04-11 17:23:52 +0200 TpProtocol: add supported interfaces (fdo #36134) commit 4fee994638e36662aec5e08b13cd57253fa5c227 Author: Guillaume Desmottes Date: 2011-04-11 17:31:27 +0200 Use tp_proxy_add_interfaces() more commit 8780dc7ad37a5ff5b1b234a3351a72227c80b3fa Author: Guillaume Desmottes Date: 2011-04-12 15:07:52 +0200 tp_proxy_add_interfaces: interfaces is a 'const gchar * const *' commit 9bf259aa30cb42f263d2968f4458f00b3420b0d4 Author: Guillaume Desmottes Date: 2011-04-12 14:21:50 +0200 tp_proxy_add_interfaces: improve debug message commit c7e6750de39024df947b7b4a6ce4c73f92e14198 Merge: 8ac64f0ed 1b46c3259 Author: Olli Salli Date: 2011-04-12 13:34:07 +0300 Merge branch 'conn-introspection-0.14' into telepathy-glib-0.14 Reviewed-by: Will Thompson (wjt) commit 1b46c3259567e61c654934334ef0bf00f664b5fb Author: Olli Salli Date: 2011-04-12 13:31:50 +0300 Add tp_proxy_add_interfaces to gtk-doc commit a461cde341e1b408bddb5499dd77b740b128d035 Author: Olli Salli Date: 2011-04-12 12:46:49 +0300 tp_proxy_add_interfaces: Early-return with NULL interfaces commit a9e1a5a8390a2e34e7979b15e973c9b18dacdc01 Author: Olli Salli Date: 2011-04-12 12:45:48 +0300 tp_proxy_add_interfaces: Fix reference to tp_proxy_add_interface_by_id() commit 5804473cc301bbf1f5104bff6edc913482b1ed6a Author: Olli Salli Date: 2011-04-11 19:46:01 +0300 Refactor tp_proxy_add_interfaces out from TpConn introspection commit e5d552f4ef6300c59deda2a501181f7d0e50e8c8 Author: Olli Salli Date: 2011-04-11 19:23:36 +0300 Avoid the goto in _tp_connection_got_properties commit 54c073f0ccd933f55b906d0ea7f040f6d70b6bb0 Author: Olli Salli Date: 2011-04-07 23:01:55 +0300 connection.c: Remove stale comment commit 6c8ec1857f76b776dc18940f61858c56fcfb62b5 Author: Olli Salli Date: 2011-04-07 22:47:31 +0300 TpConnection: Use fast-path also for CONNECTED reintrospection commit f0810a01ff3e1c9fceae846cc00d0db1978e6eed Author: Olli Salli Date: 2011-04-07 18:26:33 +0300 TpConnection: Use GetAll return for initial introspection commit be779696b98c227b6f0a8582207fe9779a692188 Author: Olli Salli Date: 2011-04-07 21:52:44 +0300 TpTestsSimpleConnection: Make it possible to break 0.19.2 props To force slow-path introspection in TpConnection. In particular, the self-handle changing test depends on receiving GetSelfHandle calls, which it doesn't if we're just calling GetAll. commit f6a169db0c31f64ef5ba953d0e1cabd325ea3e10 Author: Olli Salli Date: 2011-04-07 18:40:07 +0300 bug16307-conn.c: Intentionally break Connection properties implementation Otherwise the fast-path will be hit, and TpConnection never calls GetStatus which this test is supposed to simulate being returned to at a certain moment. commit fd5f43f9d76f11593d026bd87396ce6265cc1b99 Author: Olli Salli Date: 2011-04-07 21:02:24 +0300 Fix crash in contacts_get_attributes with invalidated conn If the connection was invalidated at an inopportune time, contacts_get_attributes could be called with the connection already having been invalidated and dropped its interfaces. This would cause an assert checking for support for the Conn.I.Contacts interface to be hit. This is a simple but safe way to prevent that and related bugs. An invalidated connection never needs to build contacts successfully. commit 798ddba6d3f37a84a878b20b12ffbce9dd5f7ab5 Author: Olli Salli Date: 2011-04-07 18:26:15 +0300 connection.c: Update copyright commit 0eb637466bab96391100070f04b1313e405ded59 Author: Olli Salli Date: 2011-04-07 17:17:15 +0300 TpConnection: Demote the current introspection path to a slow-path commit 90095cfbe3803085e74875a542a5d8e37674d8dc Author: Olli Salli Date: 2011-04-07 16:56:02 +0300 tp_connection_got_interfaces_cb: Refactor out introspection queuing loop commit 01ae0bca11e6656a2d046d602d922d031a9ca6f9 Merge: 256fd0a3a 11d464aa6 Author: Guillaume Desmottes Date: 2011-04-05 16:43:18 +0200 Merge branch 'is-handling-35990' commit 11d464aa6bf4ba61b7546a5ce3b62c0390df6be3 Author: Guillaume Desmottes Date: 2011-04-05 15:27:06 +0200 add tp_base_client_is_handling_channel (fdo #35990) commit 256fd0a3a213e4ee473f4d7aa0ca8657ac8e7aac Merge: 56cf9781f 8ac64f0ed Author: Will Thompson Date: 2011-03-31 15:11:30 +0100 Merge branch 'telepathy-glib-0.14' Conflicts: configure.ac commit 8ac64f0ed40681f91f507eed139fef1279e4333b Author: Will Thompson Date: 2011-03-31 15:11:00 +0100 Bump nano-version to 0.14.3.1 commit e5314ff0b6b44bbe10ce29a30c446b5dbf919aad Author: Will Thompson Date: 2011-03-31 14:13:10 +0100 Version 0.14.3 There is no 0.14.2; that version was erroneously used in the 0.14.1 ABI file. commit a7e64d0b3a99323c33f2c0801a7834638cc12afa Author: Will Thompson Date: 2011-03-31 14:03:07 +0100 NEWS for 0.14.2 commit 17be7923400ae8aa0d4c203bb86569ce855a9b5a Merge: b2e7daca8 1c430b4f7 Author: Will Thompson Date: 2011-03-31 13:46:42 +0100 Merge branch 'ptr-array-extend' into telepathy-glib-0.14 commit 1c430b4f7c2289764db64eaba9c29465f1edea35 Author: Will Thompson Date: 2011-03-31 13:37:04 +0100 tp_g_ptr_array_*: add NULL guards commit f9dfd31f2fe46fcbd343857da2503603680e1869 Author: Will Thompson Date: 2011-03-31 13:34:23 +0100 Move tp_g_ptr_array_extend to beside _contains() commit 7bc830c2ef68cf1d4db9ef41e6b58ead7962e352 Author: Will Thompson Date: 2011-03-31 13:31:14 +0100 tp_g_ptr_array_extend: use better argument names commit b2e7daca8cf62663aaef34b49a7e5b5d56370804 Author: Will Thompson Date: 2011-03-30 14:58:09 +0100 Update to spec 0.22.1. commit ca6e114be97aa50620e84b3767bda37b5f30f47b Author: Will Thompson Date: 2011-03-25 14:00:05 +0000 base_connection_change_status: clean up docs commit a4631c580bab085b6f49b17e61a6332d8b4631da Author: Will Thompson Date: 2011-03-25 13:53:01 +0000 disconnect_with_dbus_error: improve documentation commit 716944939f8cccfc182e20980fddc15ed613f687 Author: Will Thompson Date: 2011-03-25 13:25:12 +0000 base_conn_change_status: refer to _disconnect_with_dbus_error commit 56cf9781fb2bcfb2d7f92255e74ec2e2bdb1facc Merge: d4aabe356 55d3fecc4 Author: Will Thompson Date: 2011-03-22 13:17:36 +0000 Merge branch 'telepathy-glib-0.14' Conflicts: configure.ac commit 55d3fecc427d3225f150092b0d63dcaa854957c6 Author: Will Thompson Date: 2011-03-22 13:17:13 +0000 bump version to 0.14.1.1 commit 9b3deb4eaf98c2f594c8d41d4ad1b6629871fddc Author: Will Thompson Date: 2011-03-22 12:55:26 +0000 Add a note about adding API on a stable branch. commit 869a063a5ce8ff82557d806f253a289f6de5a225 Author: Guillaume Desmottes Date: 2011-03-22 11:17:14 +0100 prepare 0.14.1 commit 3d75d29eaf6c34a017d2274caa6a7df004653c49 Author: Guillaume Desmottes Date: 2011-03-22 11:50:09 +0100 add TpContactBlockingCapabilities to the doc as I meant to commit 3c11d99746c55f93613d137da13db3dfc6820fbb Author: Guillaume Desmottes Date: 2011-03-22 10:56:00 +0100 Generate code for Conn.I.ContactBlocking commit 00c153c57c455ecaa5bd12d0ece2c7afe4d4fec7 Author: Guillaume Desmottes Date: 2011-03-22 10:25:22 +0100 sync to spec 0.22.0 commit d4aabe356906caae49b67772cdfba0d10c5a3aaf Author: Will Thompson Date: 2011-03-21 18:10:11 +0000 Bump version to 0.14.999.1 commit b301f12e71ea54b842afe06554ac3f6ea45ec352 Author: Will Thompson Date: 2011-03-21 18:09:51 +0000 Bump nano-version to 0.14.0.1 commit e2c8c159cd5cae2a944f4b79aec03b2bbc246f1d Author: Jonny Lamb Date: 2011-02-14 09:34:29 +0000 util: add tp_g_ptr_array_extend Signed-off-by: Jonny Lamb telepathy-glib-0.24.2/COPYING0000644000175000017500000007210312652510705012473 00000000000000Most of Gabble is licensed under the GNU Lesser General Public License, as published by the Free Software Foundation and reproduced below: either version 2.1 of the License, or (at your option) any later version. Gabble incorporates the libmd5-rfc MD5 implementation by L. Peter Deutsch (in the directory src/libmd5-rfc). This is released under a BSD-style license also reproduced below. Gabble incorporates a SHA1 implementation by Allan Saddi, taken from sha v1.0.4 (in the directory src/sha). This is released under a BSD-style license also reproduced below. ------------------------------------------------------------------------ GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! ------------------------------------------------------------------------ License of src/libmd5-rfc: Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. L. Peter Deutsch ghost@aladdin.com ------------------------------------------------------------------------ License of src/sha1: /*- * Copyright (c) 2001-2003 Allan Saddi * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY ALLAN SADDI AND HIS CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL ALLAN SADDI OR HIS CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * $Id: sha1.h 347 2003-02-23 22:11:49Z asaddi $ */